summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/generic/pgf/ChangeLog196
-rw-r--r--Master/texmf-dist/doc/generic/pgf/FILES1329
-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.tex178
-rw-r--r--Master/texmf-dist/doc/generic/pgf/pgfmanual.pdfbin10007574 -> 10436298 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-actions.tex467
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-animations.tex1348
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-arrows.tex1298
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex1310
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-design.tex202
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-external.tex459
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex291
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-internalregisters.tex103
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-layers.tex141
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex541
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex1546
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-paths.tex737
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-patterns.tex238
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-plots.tex633
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex449
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-quick.tex155
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex1178
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex490
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transformations.tex1088
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex349
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-drivers.tex654
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-axes.tex3920
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-backend.tex10
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-formats.tex788
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-introduction.tex203
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-main.tex936
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-polar.tex380
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-stylesheets.tex2082
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-visualizers.tex620
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-algorithm-layer.tex929
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-algorithms-in-c.tex860
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-binding-layer.tex250
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-circular.tex12
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-display-layer.tex339
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-edge-routing.tex16
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-force.tex18
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-layered.tex11
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-ogdf.tex32
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-overview.tex392
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-phylogenetics.tex39
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-trees.tex17
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-usage-pgf.tex1064
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-usage-tikz.tex627
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-guidelines.tex873
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-installation.tex232
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-introduction.tex441
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-3d.tex191
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-angles.tex91
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex81
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex241
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-babel.tex126
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex250
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calc.tex5
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex1016
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-chains.tex464
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex2159
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex2281
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-edges.tex348
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-er.tex74
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-external.tex941
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fadings.tex34
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex133
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fixedpoint.tex195
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-folding.tex166
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex660
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-lsystems.tex517
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-math.tex513
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex214
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex495
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-patterns.tex67
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-petri.tex267
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-handlers.tex484
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex114
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-profiler.tex232
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-rdf.tex1040
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shadings.tex261
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shadows.tex195
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex2069
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-spy.tex498
-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-through.tex32
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex135
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex97
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-views.tex127
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-license.tex2058
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-body.tex186
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-preamble.tex169
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main.tex5
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex257
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-commands.tex190
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-design.tex135
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-numberprinting.tex792
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-math-parsing.tex1199
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-module-parser.tex113
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-oo.tex818
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pages.tex810
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex665
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex447
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex1667
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfkeysfiltered.tex485
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-animations.tex1510
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-commands.tex1543
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-overview.tex75
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-paths.tex257
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-protocol.tex83
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex1231
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-animations.tex2602
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-arrows.tex3384
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex1183
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex464
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-design.tex309
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-graphs.tex3946
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex473
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex1598
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-pics.tex636
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex743
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-scopes.tex697
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex3156
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transformations.tex447
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-transparency.tex851
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-trees.tex747
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex464
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-chains.tex525
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex663
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.tex695
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex1253
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-xxcolor.tex79
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvipdfm/en/Makefile5
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvipdfm/en/pgfmanual.tex2
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/Makefile15
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual-test.tex5
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual.tex2
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/Makefile11
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/pgfmanual-test.tex23
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/pgfmanual.tex2
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/Makefile55
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/color.cfg0
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual-test.html5
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual-test.tex27
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual.html9
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual.tex16
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-asymptotic-example.table204
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-exp.table29
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-parametric-example.table29
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-sin.table29
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-tan-example.table104
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-x.table29
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgfmanual-sine.table24
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgfplotgnuplot-example.table104
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/pgfmanual-dvisvgm.cfg336
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-luatex/en/Makefile16
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-luatex/en/pgfmanual-test.tex37
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-luatex/en/pgfmanual.tex15
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-luatex/pgfmanual-luatex.cfg3
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/Makefile7
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/pgfmanual.tex2
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-pdftex/pgfmanual-pdftex.cfg3
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-tex4ht/en/Makefile5
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-vtex/en/Makefile5
-rw-r--r--Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/Makefile5
-rw-r--r--Master/texmf-dist/source/generic/pgf/testsuite/mathtest/unittest_luamathparser.tex162
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex164
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex37
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex3
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex16
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex21
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex655
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex46
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex183
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex417
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex228
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex228
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex42
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex124
-rw-r--r--Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex26
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.code.tex53
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.IEC.code.tex117
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.code.tex17
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.CDH.code.tex7
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.IEC.code.tex11
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.US.code.tex11
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.code.tex7
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.3d.code.tex23
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.barcharts.code.tex8
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.code.tex455
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.formats.functions.code.tex6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.polar.code.tex64
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.sparklines.code.tex11
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.code.tex836
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.standard.code.tex22
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzexternalshared.code.tex273
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.code.tex45
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryangles.code.tex42
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryanimations.code.tex904
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryarrows.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex92
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybabel.code.tex6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex76
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybending.code.tex6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex126
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalendar.code.tex120
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex54
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex38
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.footprints.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.fractals.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.markings.code.tex12
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathmorphing.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathreplacing.code.tex40
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.shapes.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.text.code.tex188
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryer.code.tex22
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex16
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex21
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfixedpointarithmetic.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex1831
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfpu.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryintersections.code.tex62
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarylindenmayersystems.code.tex116
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymath.code.tex1014
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymatrix.code.tex50
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex177
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex12
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.meta.code.tex24
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.code.tex138
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplothandlers.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex46
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex44
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryrdf.code.tex291
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex34
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadings.code.tex6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadows.code.tex19
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.callouts.code.tex30
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex50
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex52
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.code.tex26
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.symbols.code.tex8
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex36
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryspy.code.tex18
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysvg.path.code.tex12
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarythrough.code.tex6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex41
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytrees.code.tex44
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryturtle.code.tex30
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryviews.code.tex45
-rw-r--r--Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex2563
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/Binding.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/BindingToPGF.lua102
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/Tantau2012.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Anchoring.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDirection.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentOrder.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Components.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Distances.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/LayoutPipeline.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/NodeAnchors.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Sublayouts.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Edge.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Graph.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Iterators.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Node.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Vector.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FastMultipoleEmbedder.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/GEMLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/MultilevelLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFR.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFRExact.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderKK.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/BarycenterPlacer.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/CirclePlacer.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/EdgeCoverMerger.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/IndependentSetMerger.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MatchingMerger.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MedianPlacer.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomMerger.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomPlacer.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarMerger.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarPlacer.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/ZeroPlacer.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/BarycenterHeuristic.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/CoffmanGrahamRanking.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/DfsAcyclicSubgraph.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastHierarchyLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastSimpleHierarchyLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyCycleRemoval.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyInsertHeuristic.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/LongestPathRanking.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/MedianHeuristic.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/OptimalRanking.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SiftingHeuristic.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SplitHeuristic.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/BalloonLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/CircularLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/AcyclicSubgraphModule.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/HierarchyLayoutModule.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/InitialPlacer.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/MultilevelBuilder.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/RankingModule.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/TwoLayerCrossMin.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity/PlanarizationLayout.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleDemo.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GraphAnimationCoordination.lua638
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GreedyTemporalCycleRemoval.lua177
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Skambath2016.lua875
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Supergraph.lua570
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/SupergraphVertexSplitOptimization.lua196
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/TimeSpec.lua60
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/doc.lua116
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua107
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/library.lua33
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/CoarseGraph.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/Control.lua28
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlDeclare.lua41
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/QuadTree.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalHu2006.lua16
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalLayouts.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalWalshaw2000.lua14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua9
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringLayouts.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/library.lua4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceCore.lua14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToAlgorithms.lua6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToC.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/Scope.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CrossingMinimizationGansnerKNV1993.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990a.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990b.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalEadesLS1993.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalGansnerKNV1993.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/EdgeRoutingGansnerKNV1993.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NetworkSimplex.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodePositioningGansnerKNV1993.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingGansnerKNV1993.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingMinimumHeight.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Ranking.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Sugiyama.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/crossing_minimization.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/cycle_removal.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/edge_routing.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_positioning.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_ranking.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib.lua28
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/DepthFirstSearch.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Arc.lua35
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Collection.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Coordinate.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Digraph.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Edge.lua10
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Hyperedge.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path.lua6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path_arced.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Vertex.lua37
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/Koerner2015.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/AuthorDefinedPhylogeny.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedMinimumEvolution.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedNearestNeighbourInterchange.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/DistanceMatrix.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/Maeusle2012.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/PhylogeneticTree.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/SokalMichener1958.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar.lua6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/BoyerMyrvold2004.lua678
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/Embedding.lua787
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/LinkedList.lua88
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/List.lua49
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PDP.lua576
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PlanarLayout.lua159
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/ShiftMethod.lua128
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/parameters.lua144
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/tools/make_gd_wrap.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ReingoldTilford1981.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/library.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/experimental/tikzlibrarygraphdrawing.evolving.code.tex21
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.circular.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.code.tex499
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.examples.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.force.code.tex14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.layered.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.trees.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/tikzlibrarygraphdrawing.code.tex101
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.barcharts.code.tex34
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.formats.functions.code.tex46
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/datavisualization/pgflibrarydatavisualization.polar.code.tex54
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.footprints.code.tex52
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.fractals.code.tex28
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.markings.code.tex52
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathmorphing.code.tex103
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathreplacing.code.tex163
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.shapes.code.tex186
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.text.code.tex522
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgf/luamath/functions.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgf/luamath/parser.lua30
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgflibraryluamath.code.tex231
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.code.tex112
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.meta.code.tex149
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.spaced.code.tex118
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarycurvilinear.code.tex52
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfadings.code.tex34
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfixedpointarithmetic.code.tex881
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfpu.code.tex3329
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryintersections.code.tex1484
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarylindenmayersystems.code.tex356
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex336
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex56
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex270
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryplotmarks.code.tex188
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryprofiler.code.tex634
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshadings.code.tex42
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysnakes.code.tex6
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex142
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytimelines.code.tex197
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.IEC.code.tex425
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex137
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex408
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex4312
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.code.tex34
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.arrows.code.tex4579
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.callouts.code.tex1570
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.code.tex10
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.geometric.code.tex8070
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.misc.code.tex2100
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.multipart.code.tex2118
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.symbols.code.tex548
-rw-r--r--Master/texmf-dist/tex/generic/pgf/lua/pgf/manual.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/lua/pgf/manual/DocumentParser.lua2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex17
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex53
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex17
-rw-r--r--Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex26
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleanimations.code.tex1314
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmodulebending.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledatavisualization.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledecorations.code.tex12
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmodulenonlineartransformations.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleoo.code.tex37
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleparser.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex40
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmodulesnakes.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/modules/pgfmodulesorting.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/pgf.revision.tex15
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg3
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def53
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def8
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def7
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def1325
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvi.def4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def58
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def12
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def32
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvisvgm.def149
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def7
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-textures.def4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-vtex.def8
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex823
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysanimations.code.tex2009
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfcalendar.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex11
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex23
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex10
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex90
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex579
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def3
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def12
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def32
-rw-r--r--Master/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty2
-rw-r--r--Master/texmf-dist/tex/latex/pgf/compatibility/pgfarrows.sty2
-rw-r--r--Master/texmf-dist/tex/latex/pgf/compatibility/pgfautomata.sty2
-rw-r--r--Master/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty2
-rw-r--r--Master/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty2
-rw-r--r--Master/texmf-dist/tex/latex/pgf/compatibility/pgfheaps.sty2
-rw-r--r--Master/texmf-dist/tex/latex/pgf/compatibility/pgfnodes.sty2
-rw-r--r--Master/texmf-dist/tex/latex/pgf/compatibility/pgfshade.sty2
-rw-r--r--Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.code.tex2
-rw-r--r--Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.pdflinks.code.tex17
-rw-r--r--Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex51
-rw-r--r--Master/texmf-dist/tex/latex/pgf/frontendlayer/libraries/tikzlibraryexternal.code.tex5
-rw-r--r--Master/texmf-dist/tex/latex/pgf/utilities/pgfpages.sty105
-rw-r--r--Master/texmf-dist/tex/latex/pgf/utilities/xxcolor.sty2
-rw-r--r--Master/texmf-dist/tex/plain/pgf/basiclayer/pgf.tex2
564 files changed, 86170 insertions, 64046 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/ChangeLog b/Master/texmf-dist/doc/generic/pgf/ChangeLog
index fa06356be52..39a51ff77da 100644
--- a/Master/texmf-dist/doc/generic/pgf/ChangeLog
+++ b/Master/texmf-dist/doc/generic/pgf/ChangeLog
@@ -1,11 +1,183 @@
+2019-01-05 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
+
+ - Release 3.1!
+
+2018-12-28 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
+
+ - \pgfmathprintnumber: implemented 'retain unit mantissa=true|false' (feature #92)
+
+2018-12-30 Henri Menke
+
+ - fixed wrong projection of `canvas is xy plane at z` in `3d` library (bug #410)
+ - added documentation of `3d` library to the manual (support request #11)
+ - defined CMYK colors for ConTeXt (feature request #33)
+ - `text along path` decoration repeated last char multiple times when
+ this was in math mode (bug #479)
+
+2018-12-29 Henri Menke
+
+ - fixed accidental usage of `\rm` (bug #476)
+
+ 2018-12-28 Henri Menke
+
+ - fixed newlines for tex4ht (bug #327)
+ - fixed bug that `fit` didn't work with `transform shape` (bug #330)
+ - fill color in nodes now respects colormodel (bug #349)
+ - fixed broken VTeX support (bug #350)
+ - `text=<color>` now works fine when in the nodes' text `\textcolor` is used (bug #362)
+
+2018-12-26 Henri Menke
+
+ - allowed whitespace between layers in `\pgfsetlayers` (bug #376)
+
+2018-12-25 Henri Menke
+
+ - fixed `\method` which can now contain empty lines (bug #448)
+ - manual improvement regarding `pgfoothis` (bug #452)
+ - documented commands `\pgfooeset`, `\pgfooappend`, `\pgfooprefix` (bug #452)
+
+2018-12-24 Henri Menke
+
+ - fixed bug in \pgfkeysedef (bug #306)
+ - `miter limit` now raises an error when a value < 1 is given (bug #347)
+ - fixed bug that `\pgfmathmax` and `pgfmathmin` were broken when
+ `fixedpointarithmetic` library was loaded (bug #360)
+ - added missing function `\pgfmathpneg` in `fixedpointarithmetic` library (bug #361)
+ - fixed bug that brace decorations were malformed for large amplitudes (bug #351)
+ - made node parser aware of prefix and suffix (bug #397)
+
+2018-12-23 Henri Menke
+
+ - (almost) fixed guillemets for LuaTeX (bug #473)
+
+2018-12-21 Henri Menke
+
+ - fixed incorrect spelling in pgflibrarydecorations.text (bug #479)
+ (but this doesn't solve the bug 100%)
+ - fixed 'bend left' bug if used with a formula (bug #423)
+ - use \typeout stream instead of \write16 (bug #488)
+ - fixed some bugs regarding graphdrawing electrical "springs" (bugs #380 and #381)
+
+ 2018-12-20 Henri Menke
+
+ - fixed pgf_lookup_and_require for new luaotfload (bug #493)
+ - fixed graphdrawing for ConTeXt (bug #477)
+
+2018-04-30 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
+
+ - added utility \pgfmathifexpression (and special treatment in luamath
+ library and fpu library)
+
+2017-11-14 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
+
+ - intersections lib: improved accuracy of intersections for linear paths
+
+2017-02-08 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
+
+ - fixed incompatibility issue of tikzmath and fpu reported in
+ http://tex.stackexchange.com/questions/349766/pgfplots-on-tikzmath-function-with-conditionals-returns-an-error
+
+2016-12-31 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
+
+ - Improved driver detection (bug #395 TikZ does not create output with LuaTeX 0.95.0)
+ - New luatex driver now supports fallback to pdftex driver if
+ luatexversion is older than 95 (let's hope this works reliably - luatex
+ used to have version 240 some time ago!)
+
+2016-08-10 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed bugs that caused pgfsys-dvips.def to generate corrupt
+ PostScript for all nodes.
+
+2016-07-16 Till Tantau <tantau@users.sourceforge.net>
+
+ - Bounding box computations for animations implemented.
+ - Animated arrow tips are now possible.
+
+2016-07-13 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
+
+ - fixed incompatibility between textpos (absolute mode) and external
+
+2016-06-17 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
+
+ - fixed \write18 issues in luatex 0.87 and later (by using os.execute())
+ affects external lib and plot function.
+
+2016-03-31 Till Tantau <tantau@users.sourceforge.net>
+
+ - Lots of bugfixes in animation and svg code.
+ - Added optimizations to reduce file size for svg code
+ (better support by dvisvgm will be needed however for more
+ compact text!).
+
+2016-03-18 Till Tantau <tantau@users.sourceforge.net>
+
+ - First working, fully documented version of TikZ animations!
+
+2016-02-24 Till Tantau <tantau@users.sourceforge.net>
+
+ - Fixed manual stuff to compile it with dvisvgm.
+
+2016-02-02 Till Tantau <tantau@users.sourceforge.net>
+
+ - Rewrote tikz animation lib.
+
+2016-01-06 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
+
+ - added context-related aux file fix of Hans Hagen
+
+2016-01-02 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
+
+ - fixed save stack issues (eliminated 'retaining' issues) about pgf@x and pgf@y
+
+2015-12-29 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
+
+ - external lib: 'force remake' now also updates .md5 files
+
+2015-11-28 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
+
+ - fpu: fixed floor and ceil
+ - fixed basic layer floor function
+ - lua library: improved interoperability of luamath and fpu
+ - unit test now compares luamath, fpu, and pgfbasic math
+
+2015-11-15 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
+
+ - activated math parser in foreach's end notation to allow \foreach \i in {0,...,10-9}
+
+2015-09-09 Till Tantau <tantau@users.sourceforge.net>
+
+ - Worked on pgfsys-dvisvgm.def a lot. Now requires
+ dvisvgm-1.5.3 because of switch from pt to bp there. Does
+ correct bounding box computations.
+
+2015-09-06 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
+
+ - fixed bug in luamath library
+
2015-08-29 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
- - Release 3.0.1a containing a corrected manual (the one of 3.0.1
- accidentally deactivated examples in the manual)
+ - external lib: added support to automatically externalize references and
+ labels with 'mode=convert with system call'
+
+2015-08-24 Till Tantau <tantau@users.sourceforge.net>
+
+ - Reworked implementation of animations for tikz and started
+ on documentation of the backend.
+
+2015-08-20 Till Tantau <tantau@users.sourceforge.net>
+
+ - First complete implementation of animations for tikz! (for
+ svg backend). Documentation still missing, but works nicely.
+
+2015-08-13 Till Tantau <tantau@users.sourceforge.net>
+
+ - First work on animations for svg. Added commands in pgfsys
+ and added module pgfmoduleanimations. No documnetation yet.
2015-08-07 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
- - Release 3.0.1!
+ - Release 3.0.1!
2015-08-03 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
@@ -34,14 +206,14 @@
2015-06-05 Till Tantau <tantau@users.sourceforge.net>
- Added number nodes option to graph lib.
-
+
2015-05-18 Till Tantau <tantau@users.sourceforge.net>
- Fixed nullfont warnings in axes in datavisualization.
- Fixed wrong axes for school book plots.
2015-05-15 Mark Wibrow <vibrovski@users.sourceforge.net>
-
+
- Fixed nullfont warnings when parsing logic gate inputs.
2015-05-08 Till Tantau <tantau@users.sourceforge.net>
@@ -51,10 +223,10 @@
pgf@fillcolor@global over groups was done only in \pgfscope,
but not in the scopes opened and closed by tikz when drawing a
path (\pgfsys@beginscope is used there). This caused wrong
- colors to be used.
+ colors to be used.
2015-05-08 Mark Wibrow <vibrovski@users.sourceforge.net>
-
+
- Updated patterns.meta library.
2015-05-02 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
@@ -86,7 +258,7 @@
functions works. I also added support for 'declare function'
2014-10-11 Mark Wibrow <vibrovski@users.sourceforge.net>
-
+
- Added provisional code for patterns.meta library. Patterns
can now be declared using TikZ code with additional support
for tile transformations. Currently only PDF output supported
@@ -111,7 +283,7 @@
- added automatic "fast lane" to math parser: if the input is a number
without units, it will return that as-is. Reduces typesetting time down to
66% for huge scatter plots and has just 1% overhead for math intensive
- figures.
+ figures.
2014-06-22 Christian Feuersaenger <cfeuersaenger@users.sourceforge.net>
@@ -158,7 +330,7 @@
option "outer sep=auto", which takes care of both this problem
(at least in all normal cases) and also of the draw versus
fill problem with outer seps.
-
+
2014-03-20 Till Tantau <tantau@users.sourceforge.net>
- Fixed #285 \tikz@intersect@namedpaths persists outside
@@ -166,7 +338,7 @@
- Fixed #284 Additional rerun statement for overlays (for LyX)
by adding the proposed solution (essentially).
- Added post-fix for #288 by undoing all -- ligatures in
- verbatim code.
+ verbatim code.
2014-03-19 Till Tantau <tantau@users.sourceforge.net>
@@ -175,7 +347,7 @@
- Fixed #288 "All the '£' should be '$' in the examples of
pgfmanual..." by switching to T1 enconding.
- Fixed #282 "\pgfmathredeclarefunction does not work properly."
-
+
2014-02-24 Till Tantau <tantau@users.sourceforge.net>
- Added first edge routing algorithm to gd.
diff --git a/Master/texmf-dist/doc/generic/pgf/FILES b/Master/texmf-dist/doc/generic/pgf/FILES
index 01e13626085..ff9069cafa6 100644
--- a/Master/texmf-dist/doc/generic/pgf/FILES
+++ b/Master/texmf-dist/doc/generic/pgf/FILES
@@ -1,721 +1,772 @@
-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/brave-gnu-world-logo.xbb
-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-tan-example.gnuplot
-pgf/doc/generic/pgf/text-en/plots/pgf-tan-example.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/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-polar.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-gd-algorithm-layer.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-algorithms-in-c.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-binding-layer.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-circular.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-display-layer.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-edge-routing.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-examples.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-force.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-layered.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-misc.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-ogdf.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-overview.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-phylogenetics.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-trees.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-usage-pgf.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-usage-tikz.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-angles.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-babel.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-math.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-body.tex
-pgf/doc/generic/pgf/text-en/pgfmanual-en-main-preamble.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-arrows.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-graphs.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-pics.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.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/en/pgfmanual-test.tex
-pgf/doc/generic/pgf/version-for-dvipdfmx/pgfmanual-dvipdfmx.cfg
-pgf/doc/generic/pgf/version-for-dvips/en/pgfmanual.tex
-pgf/doc/generic/pgf/version-for-dvips/en/Makefile
-pgf/doc/generic/pgf/version-for-dvips/pgfmanual-dvips.cfg
-pgf/doc/generic/pgf/version-for-luatex/en/Makefile
-pgf/doc/generic/pgf/version-for-luatex/en/pgfmanual-test.tex
-pgf/doc/generic/pgf/version-for-luatex/en/pgfmanual.tex
-pgf/doc/generic/pgf/version-for-luatex/pgfmanual-luatex.cfg
-pgf/doc/generic/pgf/version-for-pdftex/en/pgfmanual.tex
-pgf/doc/generic/pgf/version-for-pdftex/en/Makefile
-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/README-3.0.0
-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/.travis.yml
+pgf/source/generic/pgf/testsuite/external/tikzexternaltest.sharedpreamble.tex
+pgf/source/generic/pgf/testsuite/external/Makefile
+pgf/source/generic/pgf/testsuite/external/tikzexternaltestmakefile.tex
+pgf/source/generic/pgf/testsuite/external/tikzexternaltest.code.tex
+pgf/source/generic/pgf/testsuite/external/tikzexternaltest.tex
+pgf/source/generic/pgf/testsuite/mathtest/unittest_luamathparser.tex
+pgf/source/generic/pgf/testsuite/mathtest/pgfmathtestsuite.tex
+pgf/source/generic/pgf/c/INSTALL
+pgf/source/generic/pgf/c/config/ExampleLocalMakefileConfig.mk
+pgf/source/generic/pgf/c/config/MakefileConfig.mk
+pgf/source/generic/pgf/c/Makefile
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/examples/c/Makefile
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/examples/c/SimpleDemoCPlusPlus.c++
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/examples/c/SimpleDemoC.c
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/interface/c/InterfaceFromC++.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/interface/c/InterfaceFromC.c
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/interface/c/InterfaceFromC.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/interface/c/Makefile
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/interface/c/InterfaceFromC++.c++
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/planarity/PlanarizationLayout_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/planarity/planarity_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/energybased_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/SpringEmbedderKK_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/FastMultipoleEmbedder_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/MultilevelLayout_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/SolarPlacer_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/LocalBiconnectedMerger_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/IndependentSetMerger_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/ZeroPlacer_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/multilevelmixer_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/MedianPlacer_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/RandomMerger_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/SolarMerger_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/EdgeCoverMerger_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/RandomPlacer_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/CirclePlacer_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/MatchingMerger_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/BarycenterPlacer_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/SpringEmbedderFRExact_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/GEMLayout_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/FMMMLayout_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/SpringEmbedderFR_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/FastHierarchyLayout_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/BarycenterHeuristic_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/FastSimpleHierarchyLayout_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/GreedyInsertHeuristic_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/GreedyCycleRemoval_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/OptimalRanking_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/CoffmanGrahamRanking_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/SplitHeuristic_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/LongestPathRanking_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/SugiyamaLayout_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/layered_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/SiftingHeuristic_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/DfsAcyclicSubgraph_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/MedianHeuristic_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/SimpleDemoOGDF.c++
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/Makefile
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/module/module_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/misclayout/misclayout_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/misclayout/BalloonLayout_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/misclayout/CircularLayout_script.h
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/InterfaceFromOGDF.c++
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/ogdf_script.c++
+pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/InterfaceFromOGDF.h
+pgf/tex/generic/pgf/modules/pgfmoduleparser.code.tex
+pgf/tex/generic/pgf/modules/pgfmodulesnakes.code.tex
+pgf/tex/generic/pgf/modules/pgfmodulematrix.code.tex
+pgf/tex/generic/pgf/modules/pgfmodulebending.code.tex
+pgf/tex/generic/pgf/modules/pgfmoduledatavisualization.code.tex
+pgf/tex/generic/pgf/modules/pgfmoduleanimations.code.tex
+pgf/tex/generic/pgf/modules/pgfmoduledecorations.code.tex
+pgf/tex/generic/pgf/modules/pgfmoduleplot.code.tex
+pgf/tex/generic/pgf/modules/pgfmoduleshapes.code.tex
+pgf/tex/generic/pgf/modules/pgfmodulesorting.code.tex
+pgf/tex/generic/pgf/modules/pgfmoduleoo.code.tex
+pgf/tex/generic/pgf/modules/pgfmodulenonlineartransformations.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarychains.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfit.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryspy.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarythrough.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadings.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarylindenmayersystems.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypositioning.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryautomata.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.standard.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/tikzlibraryarrows.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathreplacing.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzexternalshared.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.code.tex
pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.ee.IEC.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/circuits/tikzlibrarycircuits.logic.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.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/tikzlibrarydecorations.shapes.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryviews.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybabel.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.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/tikzlibraryanimations.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryintersections.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymindmap.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfixedpointarithmetic.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybending.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfpu.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymath.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathmorphing.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.3d.code.tex
pgf/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.sparklines.code.tex
-pgf/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.standard.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/tikzlibraryangles.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/tikzlibrarybabel.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryturtle.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.meta.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex
pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.code.tex
-pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybending.code.tex
-pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalc.code.tex
-pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalendar.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/tikzlibraryshapes.symbols.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.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/tikzlibrarymath.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryrdf.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypetri.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/tikzlibraryshapes.callouts.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.text.code.tex
pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex
-pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.meta.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/tikzlibraryquotes.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/frontendlayer/tikz/libraries/tikzlibrarycalendar.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryscopes.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysvg.path.code.tex
+pgf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryangles.code.tex
+pgf/tex/generic/pgf/pgf.revision.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorequick.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcore.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex
+pgf/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex
+pgf/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.force.code.tex
+pgf/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.code.tex
+pgf/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.trees.code.tex
+pgf/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.circular.code.tex
+pgf/tex/generic/pgf/graphdrawing/tex/tikzlibrarygraphdrawing.code.tex
+pgf/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.layered.code.tex
+pgf/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.examples.code.tex
+pgf/tex/generic/pgf/graphdrawing/tex/experimental/tikzlibrarygraphdrawing.evolving.code.tex
+pgf/tex/generic/pgf/graphdrawing/lua/LUA_CODING_STYLE
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/library.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/ASCIIDisplayer.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/BindingToASCII.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/example_graph_for_ascii_displayer.txt
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleDemo.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/tools/make_gd_wrap.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Node.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Edge.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Vector.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Graph.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Iterators.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/BindingToPGF.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/Binding.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/Tantau2012.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/library.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Anchoring.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/NodeAnchors.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDirection.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentOrder.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/LayoutPipeline.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Components.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Distances.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/LayoutPipeline.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/NodeAnchors.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Sublayouts.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Iterators.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Edge.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Graph.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Vector.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Node.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/IndependentSetMerger.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/BarycenterPlacer.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/CirclePlacer.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/EdgeCoverMerger.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MatchingMerger.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentOrder.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Anchoring.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalEadesLS1993.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Ranking.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Sugiyama.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingMinimumHeight.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingGansnerKNV1993.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_ranking.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NetworkSimplex.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/edge_routing.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/library.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodePositioningGansnerKNV1993.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990b.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_positioning.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalGansnerKNV1993.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990a.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/EdgeRoutingGansnerKNV1993.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CrossingMinimizationGansnerKNV1993.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/crossing_minimization.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/cycle_removal.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/Embedding.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/library.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PlanarLayout.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PDP.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/LinkedList.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/List.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/BoyerMyrvold2004.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/ShiftMethod.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/parameters.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/library.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/library.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ReingoldTilford1981.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity/PlanarizationLayout.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFR.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFRExact.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MedianPlacer.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomMerger.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomPlacer.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarMerger.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/BarycenterPlacer.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarPlacer.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MatchingMerger.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/IndependentSetMerger.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/EdgeCoverMerger.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/CirclePlacer.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/ZeroPlacer.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomMerger.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomPlacer.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderKK.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/MultilevelLayout.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/GEMLayout.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FastMultipoleEmbedder.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFRExact.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFR.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderKK.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastSimpleHierarchyLayout.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/LongestPathRanking.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyInsertHeuristic.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/BarycenterHeuristic.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/CoffmanGrahamRanking.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SiftingHeuristic.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastSimpleHierarchyLayout.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/DfsAcyclicSubgraph.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastHierarchyLayout.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyInsertHeuristic.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyCycleRemoval.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/LongestPathRanking.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/MedianHeuristic.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/OptimalRanking.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SiftingHeuristic.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/CoffmanGrahamRanking.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SplitHeuristic.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/BalloonLayout.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/CircularLayout.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/AcyclicSubgraphModule.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/OptimalRanking.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastHierarchyLayout.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyCycleRemoval.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/RankingModule.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/HierarchyLayoutModule.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/InitialPlacer.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/AcyclicSubgraphModule.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/MultilevelBuilder.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/RankingModule.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/TwoLayerCrossMin.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity/PlanarizationLayout.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/BalloonLayout.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/CircularLayout.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/ASCIIDisplayer.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/BindingToASCII.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleDemo.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/library.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/example_graph_for_ascii_displayer.txt
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/algorithms/SocialGravityCloseness.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/library.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/Koerner2015.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Edge.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Arc.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Vertex.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Coordinate.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/library.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Digraph.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Collection.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path_arced.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Hyperedge.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/DepthFirstSearch.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/library.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/Tantau2012.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlDeclare.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/QuadTree.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringLayouts.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalWalshaw2000.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalHu2006.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/CoarseGraph.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/library.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalLayouts.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/library.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/forcetypes/ForceCanvasDistance.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/forcetypes/ForcePullToPoint.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/forcetypes/ForcePullToGrid.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/forcetypes/ForceGraphDistance.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/forcetypes/ForceAbsoluteValue.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/forcetypes/ForceCanvasPosition.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/base/Preprocessing.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/base/ForceController.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/base/PathLengthsFW.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/base/InitialTemplate.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/base/ForceTemplate.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/base/CoarseGraphFW.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/algorithms/FruchtermanReingold.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/algorithms/HuSpringElectricalFW.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/algorithms/SimpleSpring.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/algorithms/SocialGravityDegree.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/base/CoarseGraphFW.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/base/ForceController.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/base/ForceTemplate.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/base/InitialTemplate.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/base/PathLengthsFW.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/base/Preprocessing.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/forcetypes/ForceAbsoluteValue.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/forcetypes/ForceCanvasDistance.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/forcetypes/ForceCanvasPosition.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/forcetypes/ForceGraphDistance.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/forcetypes/ForcePullToGrid.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/forcetypes/ForcePullToPoint.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/initialpositioning/CircularInitialPositioning.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/algorithms/HuSpringElectricalFW.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/algorithms/SocialGravityCloseness.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/initialpositioning/GridInitialPositioning.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/initialpositioning/CircularInitialPositioning.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/initialpositioning/RandomInitialPositioning.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/library.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/jedi/doc.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/CoarseGraph.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/Control.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalHu2006.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/QuadTree.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalWalshaw2000.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalLayouts.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringLayouts.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/library.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToAlgorithms.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceCore.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToC.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/Scope.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/cycle_removal.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Ranking.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CrossingMinimizationGansnerKNV1993.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990a.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990b.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalEadesLS1993.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalGansnerKNV1993.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/EdgeRoutingGansnerKNV1993.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NetworkSimplex.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodePositioningGansnerKNV1993.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingGansnerKNV1993.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingMinimumHeight.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Sugiyama.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/crossing_minimization.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/edge_routing.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/library.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_positioning.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_ranking.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/DepthFirstSearch.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Collection.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Arc.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Coordinate.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Digraph.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Edge.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Hyperedge.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path_arced.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Vertex.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/library.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/Koerner2015.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/library.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/TimeSpec.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Supergraph.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GraphAnimationCoordination.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/library.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GreedyTemporalCycleRemoval.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Skambath2016.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/SupergraphVertexSplitOptimization.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/doc.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/AuthorDefinedPhylogeny.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedMinimumEvolution.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/DistanceMatrix.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/Maeusle2012.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/DistanceMatrix.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/library.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/SokalMichener1958.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedNearestNeighbourInterchange.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/PhylogeneticTree.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/SokalMichener1958.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/library.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/library.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/tools/make_gd_wrap.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ReingoldTilford1981.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/library.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/control.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/force.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/model.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees.lua
-pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua
-pgf/tex/generic/pgf/graphdrawing/lua/LUA_CODING_STYLE
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedMinimumEvolution.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceCore.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToC.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToAlgorithms.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/Scope.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua
+pgf/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua
pgf/tex/generic/pgf/graphdrawing/lua/pgf.lua
-pgf/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.circular.code.tex
-pgf/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.code.tex
-pgf/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.examples.code.tex
-pgf/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.force.code.tex
-pgf/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.layered.code.tex
-pgf/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.trees.code.tex
-pgf/tex/generic/pgf/graphdrawing/tex/tikzlibrarygraphdrawing.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/pgflibrarysvg.path.code.tex
+pgf/tex/generic/pgf/libraries/luamath/pgf/luamath/parser.lua
+pgf/tex/generic/pgf/libraries/luamath/pgf/luamath/functions.lua
+pgf/tex/generic/pgf/libraries/luamath/pgflibraryluamath.code.tex
+pgf/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex
+pgf/tex/generic/pgf/libraries/pgflibrarycurvilinear.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex
+pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.shapes.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.fractals.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.pathmorphing.code.tex
+pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.footprints.code.tex
pgf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.text.code.tex
-pgf/tex/generic/pgf/libraries/luamath/pgf/luamath/functions.lua
-pgf/tex/generic/pgf/libraries/luamath/pgf/luamath/parser.lua
-pgf/tex/generic/pgf/libraries/luamath/pgflibraryluamath.code.tex
-pgf/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryfadings.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryarrows.spaced.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryprofiler.code.tex
+pgf/tex/generic/pgf/libraries/pgflibrarylindenmayersystems.code.tex
+pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.callouts.code.tex
+pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.symbols.code.tex
+pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.geometric.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/circuits/pgflibraryshapes.gates.logic.US.code.tex
+pgf/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.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/pgflibraryarrows.meta.code.tex
-pgf/tex/generic/pgf/libraries/pgflibraryarrows.code.tex
+pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.multipart.code.tex
+pgf/tex/generic/pgf/libraries/shapes/pgflibraryshapes.arrows.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryshadings.code.tex
pgf/tex/generic/pgf/libraries/pgflibraryfixedpointarithmetic.code.tex
-pgf/tex/generic/pgf/libraries/pgflibraryarrows.spaced.code.tex
-pgf/tex/generic/pgf/libraries/pgflibrarycurvilinear.code.tex
-pgf/tex/generic/pgf/libraries/pgflibraryfadings.code.tex
-pgf/tex/generic/pgf/libraries/pgflibraryintersections.code.tex
-pgf/tex/generic/pgf/libraries/pgflibraryfpu.code.tex
-pgf/tex/generic/pgf/libraries/pgflibrarylindenmayersystems.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/datavisualization/pgflibrarydatavisualization.formats.functions.code.tex
pgf/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex
-pgf/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex
-pgf/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryintersections.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryarrows.code.tex
+pgf/tex/generic/pgf/libraries/pgflibrarytimelines.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/pgflibraryfpu.code.tex
+pgf/tex/generic/pgf/libraries/pgflibraryarrows.meta.code.tex
pgf/tex/generic/pgf/libraries/pgflibrarysnakes.code.tex
-pgf/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex
-pgf/tex/generic/pgf/lua/pgf/manual/DocumentParser.lua
-pgf/tex/generic/pgf/lua/pgf/manual.lua
-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.round.code.tex
+pgf/tex/generic/pgf/math/pgfmathutil.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.integerarithmetics.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/pgfmathfunctions.trigonometric.code.tex
+pgf/tex/generic/pgf/math/pgfmathfunctions.base.code.tex
pgf/tex/generic/pgf/math/pgfmathode.code.tex
+pgf/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex
+pgf/tex/generic/pgf/math/pgfmathcalc.code.tex
+pgf/tex/generic/pgf/math/pgfmath.code.tex
+pgf/tex/generic/pgf/math/pgfmathfunctions.random.code.tex
+pgf/tex/generic/pgf/math/pgfmathfloat.code.tex
+pgf/tex/generic/pgf/math/pgfmathfunctions.code.tex
+pgf/tex/generic/pgf/math/pgfmathfunctions.comparison.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/pgfmodulebending.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/pgfmodulenonlineartransformations.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/systemlayer/pgfsys-dvipdfmx.def
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-luatex.def
+pgf/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def
+pgf/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
+pgf/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def
+pgf/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
+pgf/tex/generic/pgf/systemlayer/pgfsys-vtex.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-dvisvgm.def
-pgf/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
-pgf/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def
+pgf/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex
+pgf/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def
+pgf/tex/generic/pgf/systemlayer/pgf.cfg
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/systemlayer/pgfsys-dvisvgm.def
+pgf/tex/generic/pgf/systemlayer/pgfsysanimations.code.tex
+pgf/tex/generic/pgf/systemlayer/pgfsys-xetex.def
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-plain.def
pgf/tex/generic/pgf/utilities/pgfutil-common-lists.tex
+pgf/tex/generic/pgf/utilities/pgfkeys.code.tex
+pgf/tex/generic/pgf/utilities/pgfcalendar.code.tex
pgf/tex/generic/pgf/utilities/pgfrcs.code.tex
pgf/tex/generic/pgf/utilities/pgfutil-common.tex
pgf/tex/generic/pgf/utilities/pgfutil-context.def
+pgf/tex/generic/pgf/utilities/pgfexternalwithdepth.tex
pgf/tex/generic/pgf/utilities/pgfutil-latex.def
-pgf/tex/generic/pgf/utilities/pgfutil-plain.def
-pgf/source/generic/pgf/c/config/ExampleLocalMakefileConfig.mk
-pgf/source/generic/pgf/c/config/MakefileConfig.mk
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/examples/c/SimpleDemoC.c
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/examples/c/Makefile
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/examples/c/SimpleDemoCPlusPlus.c++
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/interface/c/InterfaceFromC++.c++
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/interface/c/InterfaceFromC++.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/interface/c/InterfaceFromC.c
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/interface/c/InterfaceFromC.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/interface/c/Makefile
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/IndependentSetMerger_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/BarycenterPlacer_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/CirclePlacer_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/EdgeCoverMerger_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/LocalBiconnectedMerger_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/MatchingMerger_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/MedianPlacer_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/RandomMerger_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/RandomPlacer_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/SolarMerger_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/SolarPlacer_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/ZeroPlacer_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/multilevelmixer/multilevelmixer_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/MultilevelLayout_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/FMMMLayout_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/GEMLayout_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/FastMultipoleEmbedder_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/SpringEmbedderFRExact_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/SpringEmbedderFR_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/SpringEmbedderKK_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/energybased/energybased_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/CoffmanGrahamRanking_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/BarycenterHeuristic_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/FastSimpleHierarchyLayout_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/DfsAcyclicSubgraph_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/FastHierarchyLayout_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/GreedyInsertHeuristic_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/GreedyCycleRemoval_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/LongestPathRanking_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/MedianHeuristic_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/OptimalRanking_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/SiftingHeuristic_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/SplitHeuristic_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/SugiyamaLayout_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/layered/layered_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/misclayout/BalloonLayout_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/misclayout/CircularLayout_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/misclayout/misclayout_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/module/module_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/planarity/PlanarizationLayout_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/planarity/planarity_script.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/ogdf_script.c++
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/Makefile
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/InterfaceFromOGDF.c++
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/InterfaceFromOGDF.h
-pgf/source/generic/pgf/c/graphdrawing/pgf/gd/ogdf/c/SimpleDemoOGDF.c++
-pgf/source/generic/pgf/c/INSTALL
-pgf/source/generic/pgf/c/Makefile
-pgf/source/generic/pgf/testsuite/external/Makefile
-pgf/source/generic/pgf/testsuite/external/tikzexternaltest.sharedpreamble.tex
-pgf/source/generic/pgf/testsuite/external/tikzexternaltest.code.tex
-pgf/source/generic/pgf/testsuite/external/tikzexternaltestmakefile.tex
-pgf/source/generic/pgf/testsuite/external/tikzexternaltest.tex
-pgf/source/generic/pgf/testsuite/mathtest/unittest_luamathparser.tex
-pgf/source/generic/pgf/testsuite/mathtest/pgfmathtestsuite.tex
+pgf/tex/generic/pgf/utilities/pgffor.code.tex
+pgf/tex/generic/pgf/lua/pgf/manual/DocumentParser.lua
+pgf/tex/generic/pgf/lua/pgf/manual.lua
+pgf/tex/context/third/pgf/frontendlayer/t-tikz.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfbla.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfbpt.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfbpl.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfbma.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfcor.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgf.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfbsh.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfbim.tex
+pgf/tex/context/third/pgf/basiclayer/t-pgfbsn.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-pgfmod.tex
+pgf/tex/context/third/pgf/utilities/t-pgfrcs.tex
+pgf/tex/context/third/pgf/utilities/t-pgfkey.tex
+pgf/tex/context/third/pgf/utilities/t-pgffor.tex
+pgf/tex/context/third/pgf/utilities/t-pgfcal.tex
+pgf/tex/plain/pgf/frontendlayer/tikz.tex
+pgf/tex/plain/pgf/basiclayer/pgfbaseplot.tex
+pgf/tex/plain/pgf/basiclayer/pgf.tex
+pgf/tex/plain/pgf/basiclayer/pgfbasesnakes.tex
+pgf/tex/plain/pgf/basiclayer/pgfbaseshapes.tex
+pgf/tex/plain/pgf/basiclayer/pgfbaseimage.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/pgfcore.tex
+pgf/tex/plain/pgf/math/pgfmath.tex
+pgf/tex/plain/pgf/systemlayer/pgfsys.tex
+pgf/tex/plain/pgf/utilities/pgffor.tex
+pgf/tex/plain/pgf/utilities/pgfrcs.tex
+pgf/tex/plain/pgf/utilities/pgfkeys.tex
+pgf/tex/plain/pgf/utilities/pgfcalendar.tex
+pgf/tex/latex/pgf/frontendlayer/tikz.sty
+pgf/tex/latex/pgf/frontendlayer/pgfpict2e.sty
+pgf/tex/latex/pgf/frontendlayer/libraries/tikzlibraryexternal.code.tex
+pgf/tex/latex/pgf/compatibility/pgfheaps.sty
+pgf/tex/latex/pgf/compatibility/pgfnodes.sty
+pgf/tex/latex/pgf/compatibility/pgflibraryarrows.sty
+pgf/tex/latex/pgf/compatibility/pgflibraryplothandlers.sty
+pgf/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty
+pgf/tex/latex/pgf/compatibility/pgflibrarytikztrees.sty
+pgf/tex/latex/pgf/compatibility/pgfautomata.sty
+pgf/tex/latex/pgf/compatibility/pgfshade.sty
+pgf/tex/latex/pgf/compatibility/pgflibrarytikzbackgrounds.sty
+pgf/tex/latex/pgf/compatibility/pgflibraryautomata.sty
+pgf/tex/latex/pgf/compatibility/pgflibraryplotmarks.sty
+pgf/tex/latex/pgf/compatibility/pgfarrows.sty
+pgf/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty
+pgf/tex/latex/pgf/compatibility/pgflibraryshapes.sty
+pgf/tex/latex/pgf/compatibility/pgflibrarysnakes.sty
+pgf/tex/latex/pgf/basiclayer/pgfbasepatterns.sty
+pgf/tex/latex/pgf/basiclayer/pgfcore.sty
+pgf/tex/latex/pgf/basiclayer/pgfbaseshapes.sty
+pgf/tex/latex/pgf/basiclayer/pgfbasesnakes.sty
+pgf/tex/latex/pgf/basiclayer/pgf.sty
+pgf/tex/latex/pgf/basiclayer/pgfbaseimage.sty
+pgf/tex/latex/pgf/basiclayer/pgfbasematrix.sty
+pgf/tex/latex/pgf/basiclayer/pgfbaselayers.sty
+pgf/tex/latex/pgf/basiclayer/pgfbaseplot.sty
+pgf/tex/latex/pgf/doc/pgfmanual.code.tex
+pgf/tex/latex/pgf/doc/pgfmanual.pdflinks.code.tex
+pgf/tex/latex/pgf/doc/pgfmanual.sty
+pgf/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex
+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/pgfpages.sty
+pgf/tex/latex/pgf/utilities/pgffor.sty
+pgf/tex/latex/pgf/utilities/pgfkeys.sty
+pgf/tex/latex/pgf/utilities/tikzexternal.sty
+pgf/tex/latex/pgf/utilities/xxcolor.sty
+pgf/tex/latex/pgf/utilities/pgfrcs.sty
+pgf/doc/generic/pgf/licenses/LICENSE
+pgf/doc/generic/pgf/licenses/latex-project-public-license-1.3c.txt
+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/manifest-documentation.txt
+pgf/doc/generic/pgf/licenses/manifest-code.txt
+pgf/doc/generic/pgf/macros/pgfmanual-en-macros.tex
+pgf/doc/generic/pgf/version-for-luatex/pgfmanual-luatex.cfg
+pgf/doc/generic/pgf/version-for-luatex/en/Makefile
+pgf/doc/generic/pgf/version-for-luatex/en/pgfmanual.tex
+pgf/doc/generic/pgf/version-for-luatex/en/pgfmanual-test.tex
+pgf/doc/generic/pgf/FILES
+pgf/doc/generic/pgf/version-for-dvipdfmx/pgfmanual-dvipdfmx.cfg
+pgf/doc/generic/pgf/version-for-dvipdfmx/en/Makefile
+pgf/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual.tex
+pgf/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual-test.tex
+pgf/doc/generic/pgf/version-for-vtex/pgfmanual-vtex.cfg
+pgf/doc/generic/pgf/version-for-vtex/en/Makefile
+pgf/doc/generic/pgf/version-for-vtex/en/pgfmanual.tex
+pgf/doc/generic/pgf/README-3.0.0
+pgf/doc/generic/pgf/INSTALL
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-circular.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-xxcolor.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-points.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-lsystems.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pgffor.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-math-algorithms.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-arrows.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfkeysfiltered.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-shadings.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-transformations.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-folding.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-profiler.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial-Euclid.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-usage-tikz.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-circuits.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-babel.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-examples.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-graphs.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-animations.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-transparency.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial-chains.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-backend.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-plot-handlers.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-turtle.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-edge-routing.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-shadows.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-actions.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-overview.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-introduction.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-shapes.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-transparency.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-polar.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-binding-layer.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-actions.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-force.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-matrices.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-commands.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-fixedpoint.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-rdf.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-main-body.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-paths.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-backgrounds.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-layers.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-examples.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-algorithm-layer.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-math-parsing.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-angles.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-design.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-phylogenetics.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial-nodes.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-main-preamble.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-animations.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-trees.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-petri.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-guidelines.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-oo.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-patterns.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-math.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-views.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfkeys.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-formats.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-3d.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-ogdf.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-er.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-external.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfcalendar.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-usage-pgf.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-paths.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-module-parser.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-fadings.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-math-design.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-spy.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-plots.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-patterns.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-algorithms-in-c.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-layered.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-arrows.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-display-layer.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-overview.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-animations.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-visualizers.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-main.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-pages.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-trees.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-drivers.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-decorations.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-license.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-calc.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-introduction.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-pics.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-scopes.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-decorations.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tutorial-map.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-gd-misc.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-decorations.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-math-numberprinting.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-coordinates.tex
+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/pgfmanual-sine.table
+pgf/doc/generic/pgf/text-en/plots/pgf-exp.gnuplot
+pgf/doc/generic/pgf/text-en/plots/pgf-tan-example.gnuplot
+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-sin.table
+pgf/doc/generic/pgf/text-en/plots/pgf-parametric-example.gnuplot
+pgf/doc/generic/pgf/text-en/plots/pgfplotgnuplot-example.table
+pgf/doc/generic/pgf/text-en/plots/pgf-tan-example.table
+pgf/doc/generic/pgf/text-en/plots/pgf-x.table
+pgf/doc/generic/pgf/text-en/plots/pgf-x.gnuplot
+pgf/doc/generic/pgf/text-en/plots/pgf-exp.table
+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/pgfmanual-en-library-shadings.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-svg-path.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-main.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-through.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-internalregisters.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-tikz-design.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-edges.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-nodes.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-math-commands.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-chains.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-transformations.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-plots.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-stylesheets.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-installation.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-dv-axes.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-library-external.tex
+pgf/doc/generic/pgf/text-en/pgfmanual-en-base-quick.tex
+pgf/doc/generic/pgf/version-for-tex4ht/pgfmanual-tex4ht.cfg
+pgf/doc/generic/pgf/version-for-tex4ht/en/Makefile
+pgf/doc/generic/pgf/version-for-tex4ht/en/pgfmanual.tex
+pgf/doc/generic/pgf/version-for-xetex/pgfmanual-xetex.cfg
+pgf/doc/generic/pgf/version-for-xetex/en/Makefile
+pgf/doc/generic/pgf/version-for-xetex/en/pgfmanual.tex
+pgf/doc/generic/pgf/ChangeLog
+pgf/doc/generic/pgf/version-for-pdftex/pgfmanual-pdftex.cfg
+pgf/doc/generic/pgf/version-for-pdftex/en/Makefile
+pgf/doc/generic/pgf/version-for-pdftex/en/pgfmanual.tex
+pgf/doc/generic/pgf/version-for-dvisvgm/pgfmanual-dvisvgm.cfg
+pgf/doc/generic/pgf/version-for-dvisvgm/en/color.cfg
+pgf/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual-test.html
+pgf/doc/generic/pgf/version-for-dvisvgm/en/Makefile
+pgf/doc/generic/pgf/version-for-dvisvgm/en/plots/pgfmanual-sine.table
+pgf/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-asymptotic-example.table
+pgf/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-sin.table
+pgf/doc/generic/pgf/version-for-dvisvgm/en/plots/pgfplotgnuplot-example.table
+pgf/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-tan-example.table
+pgf/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-x.table
+pgf/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-exp.table
+pgf/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-parametric-example.table
+pgf/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual.tex
+pgf/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual.html
+pgf/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual-test.tex
+pgf/doc/generic/pgf/pgfmanual.pdf
+pgf/doc/generic/pgf/AUTHORS
+pgf/doc/generic/pgf/README
+pgf/doc/generic/pgf/images/brave-gnu-world-logo-mask.bb
+pgf/doc/generic/pgf/images/brave-gnu-world-logo.eps
+pgf/doc/generic/pgf/images/brave-gnu-world-logo.xbb
+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-mask.jpg
+pgf/doc/generic/pgf/images/brave-gnu-world-logo.bb
+pgf/doc/generic/pgf/images/brave-gnu-world-logo.jpg
+pgf/doc/generic/pgf/images/pgfmanual-mindmap-1.pdf
+pgf/doc/generic/pgf/images/brave-gnu-world-logo.25.bb
+pgf/doc/generic/pgf/images/pgfmanual-mindmap-2.pdf
+pgf/doc/generic/pgf/version-for-dvipdfm/pgfmanual-dvipdfm.cfg
+pgf/doc/generic/pgf/version-for-dvipdfm/en/Makefile
+pgf/doc/generic/pgf/version-for-dvipdfm/en/pgfmanual.tex
+pgf/doc/generic/pgf/version-for-dvips/pgfmanual-dvips.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/en/pgfmanual-test.tex
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 7fc67685fa9..9c02410d1d2 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,469 +1,4 @@
-%!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/'>
@@ -526,77 +61,7 @@ ConsumeMetadata
-<?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%
@@ -789,9 +254,4 @@ 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
+*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
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 680ee260892..1c5f93cff22 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,541 +1,4 @@
-%!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/'>
@@ -598,77 +61,7 @@ ConsumeMetadata
-<?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%
@@ -985,9 +378,4 @@ 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
+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
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 9217305dd75..37591af1529 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,7 +7,7 @@
%
% 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.81 2014/03/20 10:07:44 tantau Exp $
+% $Header$
\providecommand\href[2]{\texttt{#1}}
@@ -15,9 +15,27 @@
\providecommand\hyperlink[2]{\texttt{#1}}
+\newcount\pgfmanualtargetcount
+
+\def\cleanuplink#1{%
+ \expandafter\ifx\csname pgfmanual@hlink@#1\endcsname\relax%
+ \global\advance\pgfmanualtargetcount by1\relax%
+ \expandafter\xdef\csname pgfmanual@hlink@#1\endcsname{pgfmanual-pos-\the\pgfmanualtargetcount}%
+ \fi%
+}
+\def\cleanedhypertarget#1#2{% necessary for dvisvgm
+ \cleanuplink{#1}%
+ \hypertarget{\csname pgfmanual@hlink@#1\endcsname}{#2}%
+}
+\def\cleanedhyperlink#1#2{%
+ \cleanuplink{#1}%
+ \hyperlink{\csname pgfmanual@hlink@#1\endcsname}{#2}%
+}
+
\colorlet{examplefill}{yellow!80!black}
\definecolor{graphicbackground}{rgb}{0.96,0.96,0.8}
\definecolor{codebackground}{rgb}{0.9,0.9,1}
+\definecolor{animationgraphicbackground}{rgb}{0.96,0.96,0.8}
\newenvironment{pgfmanualentry}{\list{}{\leftmargin=2em\itemindent-\leftmargin\def\makelabel##1{\hss##1}}}{\endlist}
\newcommand\pgfmanualentryheadline[1]{\itemsep=0pt\parskip=0pt{\raggedright\item\strut{#1}\par}\topsep=0pt}
@@ -52,6 +70,57 @@
}
+\newenvironment{sysanimateattribute}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \texttt{\string\pgfsysanimate\char`\{\declare{#1}\char`\}}%
+ }
+ \index{#1@\protect\texttt{#1} system layer animation attribute}%
+ \index{Animation attributes (system layer)!#1@\protect\texttt{#1}}%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+
+\newenvironment{animateattribute}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \texttt{\string\pgfanimateattribute\char`\{\declare{#1}\char`\}\marg{options}}%
+ }
+ \index{#1@\protect\texttt{#1} basic layer animation attribute}%
+ \index{Animation attributes (basic layer)!#1@\protect\texttt{#1}}%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+
+\newenvironment{tikzanimateattribute}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \foreach \attr in{#1} {\expandafter\pgfmanualpdflabel\expandafter{\attr}{}}%
+ \textbf{Animation attribute} \foreach \attr[count=\i]
+ in{#1}{{\ifnum\i>1 \textbf,\fi} \texttt{:\declare{\attr}}}%
+ }
+ \foreach\attr in{#1}{%
+ \edef\indexcall{%
+ \noexpand\index{\attr@\noexpand\protect\noexpand\texttt{\attr} animation attribute}%
+ \noexpand\index{Animation attributes!\attr@\noexpand\protect\noexpand\texttt{\attr}}%
+ }%
+ \indexcall%
+ }%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+
\newenvironment{command}[1]{
\begin{pgfmanualentry}
\extractcommand#1\@@
@@ -163,7 +232,7 @@
\newenvironment{luafiledescription}[1]{}{}
\newenvironment{luacommand}[4]{
- \hypertarget{pgf/lua/#1}{\luageneric{#2}{#3}{\texttt{(#4)}}{\texttt{function}}}
+ \cleanedhypertarget{pgf/lua/#1}{\luageneric{#2}{#3}{\texttt{(#4)}}{\texttt{function}}}
}{\endluageneric}
\newenvironment{luaparameters}{\par\emph{Parameters:}%
@@ -244,7 +313,7 @@
\newenvironment{math-function}[1]{
\def\mathdefaultname{#1}
\extractmathfunctionname{#1}
- \edef\mathurl{{math:\mathname}}\expandafter\hypertarget\expandafter{\mathurl}{}%
+ \edef\mathurl{{math:\mathname}}\expandafter\cleanedhypertarget\expandafter{\mathurl}{}%
\begin{pgfmanualentry}
\pgfmanualentryheadline{\texttt{#1}}%
\index{\mathname @\protect\texttt{\mathname} math function}%
@@ -845,7 +914,7 @@
\index{Class \currentclass!#1@\protect\texttt{#1}}%
}
-\newenvironment{attribute}[1]{
+\newenvironment{classattribute}[1]{
\begin{pgfmanualentry}
\extractattribute#1\@nil
\pgfmanualbody
@@ -1521,6 +1590,8 @@
code/.code= {\colorlet{codebackground}{#1}},
execute code/.is if=code@execute,
code only/.code= {\code@executefalse},
+ setup code/.code= {\pgfmanual@setup@codetrue\code@executefalse},
+ multipage/.code= {\code@executefalse\pgfmanual@multipage@codetrue},
pre/.store in=\code@pre,
post/.store in=\code@post,
% #1 is the *complete* environment contents as it shall be
@@ -1534,8 +1605,23 @@
every codeexample/.style={width=4cm+7pt, tikz syntax=true},
from file/.code={\codeexamplefromfiletrue\def\codeexamplesource{#1}},
tikz syntax/.is if=pgfmanualtikzsyntaxhilighting,
+ animation list/.store in=\code@animation@list,
+ animation pre/.store in=\code@animation@pre,
+ animation post/.store in=\code@animation@post,
+ animation scale/.store in=\pgfmanualanimscale,
+ animation bb/.style={
+ animation pre={
+ \tikzset{
+ every picture/.style={
+ execute at begin picture={
+ \useasboundingbox[clip] #1;}
+ }
+ }
+ }
+ }
}
+\def\pgfmanualanimscale{.5}
\newread\examplesource
@@ -1562,16 +1648,24 @@
\fi
}
+\let\code@animation@pre\pgfutil@empty
+\let\code@animation@post\pgfutil@empty
+\let\code@animation@list\pgfutil@empty
+
\let\code@pre\pgfutil@empty
\let\code@post\pgfutil@empty
\let\code@render\pgfutil@empty
\def\code@catcode@hook{}
+\newif\ifpgfmanual@multipage@code
+\newif\ifpgfmanual@setup@code
\newif\ifcodeexamplefromfile
\newdimen\codeexamplewidth
\newif\ifcode@execute
\newbox\codeexamplebox
\def\codeexample[#1]{%
+ \global\let\pgfmanual@do@this\relax%
+ \aftergroup\pgfmanual@do@this%
\begingroup%
\code@executetrue
\pgfqkeys{/codeexample}{every codeexample,#1}%
@@ -1598,6 +1692,19 @@
\fi}
\def\endofcodeexample#1{%
\endgroup%
+ \ifpgfmanual@setup@code%
+ \gdef\pgfmanual@do@this{%
+ {%
+ \returntospace%
+ \commenthandler%
+ \xdef\code@temp{#1}% removes returns and comments
+ }%
+ \edef\pgfmanualmcatcode{\the\catcode`\^^M}%
+ \catcode`\^^M=9\relax%
+ \expandafter\scantokens\expandafter{\code@temp}%
+ \catcode`\^^M=\pgfmanualmcatcode%
+ }%
+ \fi%
\ifcode@execute%
\setbox\codeexamplebox=\hbox{%
\ifx\code@render\pgfutil@empty%
@@ -1612,10 +1719,34 @@
\code@pre\expandafter\scantokens\expandafter{\code@temp\ignorespaces}\code@post\ignorespaces}%
}%
\else%
+ \global\let\code@temp\code@render%
\colorbox{graphicbackground}{\color{black}\ignorespaces%
\code@render}%
\fi%
}%
+ \ifx\code@animation@list\pgfutil@empty%
+ \else%
+ \setbox\codeexampleboxanim=\vbox{%
+ \rightskip0pt\leftskip0pt plus1filll%
+ \ifdim\wd\codeexamplebox>\codeexamplewidth%
+ \else%
+ \hsize\codeexamplewidth%
+ \advance\hsize by2cm%
+ \fi%
+ \leavevmode\catcode`\^^M=9%
+ \foreach \pgfmanualtime/\pgfmanualtimehow in\code@animation@list{%
+ \setbox\codeexampleboxanim=\hbox{\colorbox{animationgraphicbackground}{%
+ \tikzset{make snapshot of=\pgfmanualtime}%
+ \scalebox{\pgfmanualanimscale}{\color{black}\ignorespaces%
+ \code@animation@pre\expandafter\scantokens\expandafter{\code@temp\ignorespaces}\code@animation@post\ignorespaces}%
+ }}%
+ \space\raise4pt\hbox to0pt{\vrule width0pt height1em\hbox
+ to\wd\codeexampleboxanim{\hfil\scriptsize$t{=}\pgfmanualtimehow \mathrm s$\hfil}\hss}%
+ \lower\ht\codeexampleboxanim\box\codeexampleboxanim\hfil\penalty0\hskip0ptplus-1fil%
+ }%
+ }%
+ \setbox\codeexampleboxanim=\hbox{\hbox{}\hskip-2cm\box\codeexampleboxanim}%
+ \fi%
\ifdim\wd\codeexamplebox>\codeexamplewidth%
\def\code@start{\par}%
\def\code@flushstart{}\def\code@flushend{}%
@@ -1640,6 +1771,9 @@
\hrule width0pt%
\footnotesize\vskip-1em%
\code@flushstart\box\codeexamplebox\code@flushend%
+ \vskip0pt%
+ \leavevmode%
+ \box\codeexampleboxanim%
\vskip-1ex
\leavevmode%
\end{minipage}%
@@ -1648,10 +1782,29 @@
\def\code@width{\linewidth-6pt}
\def\code@end{}
\fi%
- \code@mid%
- \colorbox{codebackground}{%
- \pgfkeysvalueof{/codeexample/prettyprint/base color}%
- \begin{minipage}[t]{\code@width}%
+ \code@mid%
+ \ifpgfmanual@multipage@code%
+ {%
+ \pgfkeysvalueof{/codeexample/prettyprint/base color}%
+ \pgfmanualdolisting{#1}%
+ }%
+ \else%
+ \colorbox{codebackground}{%
+ \pgfkeysvalueof{/codeexample/prettyprint/base color}%
+ \begin{minipage}[t]{\code@width}%
+ \pgfmanualdolisting{#1}%
+ \end{minipage}}%
+ \fi%
+ \code@end%
+ \par%
+ \medskip
+ \endcodeexample\endgroup%
+}
+
+\def\endcodeexample{\endgroup}
+\newbox\codeexampleboxanim
+
+\def\pgfmanualdolisting#1{%
{%
\let\do\@makeother
\dospecials
@@ -1670,16 +1823,9 @@
\obeylines
\everypar \expandafter{\the\everypar \unpenalty}%
\pgfkeysvalueof{/codeexample/typeset listing/.@cmd}{#1}\pgfeov
- }
- \end{minipage}}%
- \code@end%
- \par%
- \medskip
- \endcodeexample\endgroup
+ }%
}
-\def\endcodeexample{\endgroup}
-
\makeatother
diff --git a/Master/texmf-dist/doc/generic/pgf/pgfmanual.pdf b/Master/texmf-dist/doc/generic/pgf/pgfmanual.pdf
index 17a2d2cbcde..630e9b8b341 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 81d12c2c6e9..fa2f26158b2 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
@@ -12,47 +12,42 @@
\subsection{Overview}
-Once a path has been constructed, it can be \emph{used} in different
-ways. For example, you can draw the path or fill it or use it for
-clipping.
-
-Numerous graph parameters influence how a path will be rendered. For
-example, when you draw a path, the line width is important as well as
-the dashing pattern. The options that govern how paths are rendered
-can all be set with commands starting with |\pgfset|. \emph{All
- options that influence how a path is rendered always influence the
- complete path.} Thus, it is not possible to draw part of a path
-using, say, a red color and drawing another part using a green
-color. To achieve such an effect, you must use two paths.
+Once a path has been constructed, it can be \emph{used} in different ways. For
+example, you can draw the path or fill it or use it for clipping.
-In detail, paths can be used in the following ways:
+Numerous graph parameters influence how a path will be rendered. For example,
+when you draw a path, the line width is important as well as the dashing
+pattern. The options that govern how paths are rendered can all be set with
+commands starting with |\pgfset|. \emph{All options that influence how a path
+is rendered always influence the complete path.} Thus, it is not possible to
+draw part of a path using, say, a red color and drawing another part using a
+green color. To achieve such an effect, you must use two paths.
+In detail, paths can be used in the following ways:
+%
\begin{enumerate}
-\item
- You can \emph{stroke} (also known as \emph{draw}) a path.
-\item
- You can add \emph{arrow tips} to a path.
-\item
- You can \emph{fill} a path with a uniform color.
-\item
- You can \emph{clip} subsequent renderings against the path.
-\item
- You can \emph{shade} a path.
-\item
- You can \emph{use the path as bounding box} for the whole picture.
+ \item You can \emph{stroke} (also known as \emph{draw}) a path.
+ \item You can add \emph{arrow tips} to a path.
+ \item You can \emph{fill} a path with a uniform color.
+ \item You can \emph{clip} subsequent renderings against the path.
+ \item You can \emph{shade} a path.
+ \item You can \emph{use the path as bounding box} for the whole picture.
\end{enumerate}
-You can also perform any combination of the above, though it makes no
-sense to fill and shade a path at the same time.
+%
+You can also perform any combination of the above, though it makes no sense to
+fill and shade a path at the same time.
-To perform (a combination of) the first four actions, you can use the
-following command:
+To perform (a combination of) the first four actions, you can use the following
+command:
+%
\begin{command}{\pgfusepath\marg{actions}}
- Applies the given \meta{actions} to the current path. Afterwards,
- the current path is (globally) empty. The following actions are
- possible:
- \begin{itemize}
- \item \declare{|fill|}
- fills the path. See Section~\ref{section-fill} for further details.
+ Applies the given \meta{actions} to the current path. Afterwards, the
+ current path is (globally) empty. The following actions are possible:
+ %
+ \begin{itemize}
+ \item \declare{|fill|} fills the path. See Section~\ref{section-fill}
+ for further details.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
@@ -61,8 +56,10 @@ following command:
\pgfusepath{fill}
\end{pgfpicture}
\end{codeexample}
- \item \declare{|stroke|} strokes the path. See
- Section~\ref{section-stroke} for further details.
+ %
+ \item \declare{|stroke|} strokes the path. See
+ Section~\ref{section-stroke} for further details.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
@@ -71,10 +68,12 @@ following command:
\pgfusepath{stroke}
\end{pgfpicture}
\end{codeexample}
- \item \declare{|draw|} has the same effect as |stroke|.
- \item \declare{|clip|}
- clips all subsequent drawings against the path. Always supresses
- arrow tips. See Section~\ref{section-clip} for further details.
+ %
+ \item \declare{|draw|} has the same effect as |stroke|.
+ \item \declare{|clip|} clips all subsequent drawings against the path.
+ Always suppresses arrow tips. See Section~\ref{section-clip} for
+ further details.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
@@ -85,45 +84,45 @@ following command:
\pgfusepath{fill}
\end{pgfpicture}
\end{codeexample}
- \item \declare{|discard|}
- discards the path, that is, it is not used at all. Giving this
- option (alone) has the same effect as giving an empty options
- list.
- \end{itemize}
- When more than one of the first three actions are given, they are
- applied in the above ordering, regardless of their ordering in
- \meta{actions}. Thus, |{stroke,fill}| and |{fill,stroke}| have the
- same effect.
+ %
+ \item \declare{|discard|} discards the path, that is, it is not used at
+ all. Giving this option (alone) has the same effect as giving an
+ empty options list.
+ \end{itemize}
+ %
+ When more than one of the first three actions are given, they are applied
+ in the above ordering, regardless of their ordering in \meta{actions}.
+ Thus, |{stroke,fill}| and |{fill,stroke}| have the same effect.
\end{command}
-To shade a path, use the |\pgfshadepath| command, which is explained
-in Section~\ref{section-shadings}.
-
+To shade a path, use the |\pgfshadepath| command, which is explained in
+Section~\ref{section-shadings}.
\subsection{Stroking a Path}
\label{section-stroke}
-When you use |\pgfusepath{stroke}| to stroke a path, several graphic
-parameters influence how the path is drawn. The commands for setting
-these parameters are explained in the following.
+When you use |\pgfusepath{stroke}| to stroke a path, several graphic parameters
+influence how the path is drawn. The commands for setting these parameters are
+explained in the following.
+
+Note that all graphic parameters apply to the path as a whole, never only to a
+part of it.
-Note that all graphic parameters apply to the path as a whole, never
-only to a part of it.
+All graphic parameters are local to the current |{pgfscope}|, but they persists
+past \TeX\ groups, \emph{except} for the interior rule (even-odd or nonzero)
+and the arrow tip kinds. The latter graphic parameters only persist till the
+end of the current \TeX\ group, but this may change in the future, so do not
+count on this.
-All graphic parameters are local to the current |{pgfscope}|, but they
-persists past \TeX\ groups, \emph{except} for the interior rule
-(even-odd or nonzero) and the arrow tip kinds. The latter graphic
-parameters only persist till the end of the current \TeX\ group, but
-this may change in the future, so do not count on this.
\subsubsection{Graphic Parameter: Line Width}
\begin{command}{\pgfsetlinewidth\marg{line width}}
- This command sets the line width for subsequent strokes (in the
- current |pgfscope|). The line width is given as a normal \TeX\
- dimension like |0.4pt| or |1mm|.
-
+ This command sets the line width for subsequent strokes (in the current
+ |pgfscope|). The line width is given as a normal \TeX\ dimension like
+ |0.4pt| or |1mm|.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfsetlinewidth{1mm}
@@ -136,58 +135,60 @@ this may change in the future, so do not count on this.
\pgfusepath{stroke}
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
\begin{textoken}{\pgflinewidth}
- You can access the current line width via the \TeX\ dimension
- |\pgflinewidth|. It will be set to the correct line width, that is,
- even when a \TeX\ group closed, the value will be correct since it
- is set globally, but when a |{pgfscope}| closes, the value is set to
- the correct value it had before the scope.
+ You can access the current line width via the \TeX\ dimension
+ |\pgflinewidth|. It will be set to the correct line width, that is, even
+ when a \TeX\ group closed, the value will be correct since it is set
+ globally, but when a |{pgfscope}| closes, the value is set to the correct
+ value it had before the scope.
\end{textoken}
\subsubsection{Graphic Parameter: Caps and Joins}
\begin{command}{\pgfsetbuttcap}
- Sets the line cap to a butt cap. See Section~\ref{section-cap-joins}
- for an explanation of what this is.
+ Sets the line cap to a butt cap. See Section~\ref{section-cap-joins} for an
+ explanation of what this is.
\end{command}
+%
\begin{command}{\pgfsetroundcap}
- Sets the line cap to a round cap. See again
- Section~\ref{section-cap-joins}.
+ Sets the line cap to a round cap. See again Section~\ref{section-cap-joins}.
\end{command}
\begin{command}{\pgfsetrectcap}
- Sets the line cap to a square cap. See again
- Section~\ref{section-cap-joins}.
+ Sets the line cap to a square cap. See again Section~\ref{section-cap-joins}.
\end{command}
+%
\begin{command}{\pgfsetroundjoin}
- Sets the line join to a round join. See again
- Section~\ref{section-cap-joins}.
+ Sets the line join to a round join. See again Section~\ref{section-cap-joins}.
\end{command}
+%
\begin{command}{\pgfsetbeveljoin}
- Sets the line join to a bevel join. See again
- Section~\ref{section-cap-joins}.
+ Sets the line join to a bevel join. See again Section~\ref{section-cap-joins}.
\end{command}
+%
\begin{command}{\pgfsetmiterjoin}
- Sets the line join to a miter join. See again
- Section~\ref{section-cap-joins}.
+ Sets the line join to a miter join. See again Section~\ref{section-cap-joins}.
\end{command}
+%
\begin{command}{\pgfsetmiterlimit\marg{miter limit factor}}
- Sets the miter limit to \meta{miter limit factor}. See again
- Section~\ref{section-cap-joins}.
+ Sets the miter limit to \meta{miter limit factor}. See again
+ Section~\ref{section-cap-joins}.
\end{command}
+
\subsubsection{Graphic Parameter: Dashing}
\begin{command}{\pgfsetdash\marg{list of even length of dimensions}\marg{phase}}
- Sets the dashing of a line. The first entry in the list specifies
- the length of the first solid part of the list. The second entry
- specifies the length of the following gap. Then comes the length of
- the second solid part, following by the length of the second gap,
- and so on. The \meta{phase} specifies where the first solid part
- starts relative to the beginning of the line.
-
+ Sets the dashing of a line. The first entry in the list specifies the
+ length of the first solid part of the list. The second entry specifies the
+ length of the following gap. Then comes the length of the second solid
+ part, following by the length of the second gap, and so on. The
+ \meta{phase} specifies where the first solid part starts relative to the
+ beginning of the line.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfsetdash{{0.5cm}{0.5cm}{0.1cm}{0.2cm}}{0cm}
@@ -205,29 +206,29 @@ this may change in the future, so do not count on this.
\end{pgfpicture}
\end{codeexample}
- Use |\pgfsetdash{}{0pt}| to get a solid dashing.
+ Use |\pgfsetdash{}{0pt}| to get a solid dashing.
\end{command}
+
\subsubsection{Graphic Parameter: Stroke Color}
\begin{command}{\pgfsetstrokecolor\marg{color}}
- Sets the color used for stroking lines to \meta{color}, where
- \meta{color} is a \LaTeX\ color like |red| or |black!20!red|. Unlike
- the |\color| command, the effect of this command lasts till the end
- of the current |{pgfscope}| and not till the end of the current
- \TeX\ group.
-
- The color used for stroking may be different from the color used for
- filling. However, a |\color| command will always ``immediately
- override'' any special settings for the stroke and fill colors.
-
- In plain \TeX, this command will also work, but the problem of
- \emph{defining} a color arises. After all, plain \TeX\ does not
- provide \LaTeX\ colors. For this reason, \pgfname\ implements a
- minimalistic ``emulation'' of the |\definecolor|, |\colorlet|, and
- |\color| commands. Only gray-scale and rgb colors are supported. For
- most cases this turns out to be enough.
-
+ Sets the color used for stroking lines to \meta{color}, where \meta{color}
+ is a \LaTeX\ color like |red| or |black!20!red|. Unlike the |\color|
+ command, the effect of this command lasts till the end of the current
+ |{pgfscope}| and not till the end of the current \TeX\ group.
+
+ The color used for stroking may be different from the color used for
+ filling. However, a |\color| command will always ``immediately override''
+ any special settings for the stroke and fill colors.
+
+ In plain \TeX, this command will also work, but the problem of
+ \emph{defining} a color arises. After all, plain \TeX\ does not provide
+ \LaTeX\ colors. For this reason, \pgfname\ implements a minimalistic
+ ``emulation'' of the |\definecolor|, |\colorlet|, and |\color| commands.
+ Only gray-scale and rgb colors are supported. For most cases this turns out
+ to be enough.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfsetlinewidth{1pt}
@@ -239,69 +240,66 @@ this may change in the future, so do not count on this.
\pgfpathcircle{\pgfpoint{2cm}{0cm}}{3mm} \pgfusepath{fill,stroke}
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfsetcolor\marg{color}}
- Sets both the stroke and fill color. The difference to the normal
- |\color| command is that the effect lasts till the end of the
- current |{pgfscope}|, not only till the end of the current \TeX\
- group.
+ Sets both the stroke and fill color. The difference to the normal |\color|
+ command is that the effect lasts till the end of the current |{pgfscope}|,
+ not only till the end of the current \TeX\ group.
\end{command}
\subsubsection{Graphic Parameter: Stroke Opacity}
-You can set the stroke opacity using |\pgfsetstrokeopacity|. This
-command is described in Section~\ref{section-transparency}.
+You can set the stroke opacity using |\pgfsetstrokeopacity|. This command is
+described in Section~\ref{section-transparency}.
\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, spaced 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.
+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, spaced 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.
-
+ 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}
@@ -311,15 +309,15 @@ Two commands are used to set the inner line width and color.
\pgfsetinnerlinewidth{1pt}
\pgfusepath{stroke}
\end{pgfpicture}
-\end{codeexample}
+\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.
-
+ 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}
@@ -330,25 +328,26 @@ Two commands are used to set the inner line width and color.
\pgfsetinnerstrokecolor{red!50}
\pgfusepath{stroke}
\end{pgfpicture}
-\end{codeexample}
+\end{codeexample}
+ %
\end{command}
\subsection{Arrow Tips on a Path}
\label{section-tips}
-After a path has been drawn, \pgfname\ can add arrow tips at the
-ends, depending on how the |tips| key is set, on whether |stroke| or
-|clip| arw used and on whether the path contains closed subpaths. The
-exact rules when arrow tips are added are explained in
-Section~\ref{section-arrow-tips-where}.
+After a path has been drawn, \pgfname\ can add arrow tips at the ends,
+depending on how the |tips| key is set, on whether |stroke| or |clip| are used
+and on whether the path contains closed subpaths. The exact rules when arrow
+tips are added are explained in Section~\ref{section-arrow-tips-where}.
\begin{command}{\pgfsetarrowsstart\marg{start arrow tip specification}}
- Sets the arrow tip kind used at the start of a (possibly curved)
- path. The syntax of the \meta{start arrow specification} is detailed
- in Section~\ref{section-arrow-spec}.
+ Sets the arrow tip kind used at the start of a (possibly curved) path. The
+ syntax of the \meta{start arrow specification} is detailed in
+ Section~\ref{section-arrow-spec}.
- To ``clear'' the start arrow, say |\pgfsetarrowsstart{}|.
+ To ``clear'' the start arrow, say |\pgfsetarrowsstart{}|.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfsetarrowsstart{Latex[length=10pt]}
@@ -362,12 +361,13 @@ Section~\ref{section-arrow-tips-where}.
\end{pgfpicture}
\end{codeexample}
- The effect of this command persists only till the end of the current
- \TeX\ scope.
+ The effect of this command persists only till the end of the current \TeX\
+ scope.
\end{command}
\begin{command}{\pgfsetarrowsend\marg{end arrow tip specification}}
- Sets the arrow tip kind used at the end of a path.
+ Sets the arrow tip kind used at the end of a path.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfsetarrowsstart{Latex[length=10pt]}
@@ -377,12 +377,14 @@ Section~\ref{section-arrow-tips-where}.
\pgfusepath{stroke}
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfsetarrows\marg{argument}}
- The \meta{argument} can be of the form \meta{start arrow tip
- specifciation}|-|\meta{end arrow tip specification}. In this
- case, both the start and the end arrow specification are set:
+ The \meta{argument} can be of the form \meta{start arrow tip
+ specification}|-|\meta{end arrow tip specification}. In this case, both the
+ start and the end arrow specification are set:
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfsetarrows{Latex[length=10pt]->>}
@@ -391,22 +393,22 @@ Section~\ref{section-arrow-tips-where}.
\pgfusepath{stroke}
\end{pgfpicture}
\end{codeexample}
- Alternatively, \meta{argument} can be of the form |[|\meta{arrow
- keys}|]|. In this case, the \meta{arrow keys} will be set for all
- arrow tips in the current scope, see Section~\ref{section-arrow-scopes}.
+ %
+ Alternatively, \meta{argument} can be of the form |[|\meta{arrow keys}|]|.
+ In this case, the \meta{arrow keys} will be set for all arrow tips in the
+ current scope, see Section~\ref{section-arrow-scopes}.
\end{command}
-
\begin{command}{\pgfsetshortenstart\marg{dimension}}
- This command will shortened the start of every stroked path by the
- given dimension. This shortening is done in addition to automatic
- shortening done by a start arrow, but it can be used even if no
- start arrow is given.
+ This command will shortened the start of every stroked path by the given
+ dimension. This shortening is done in addition to automatic shortening done
+ by a start arrow, but it can be used even if no start arrow is given.
- It is usually better to use the |sep| key with arrow tips.
+ It is usually better to use the |sep| key with arrow tips.
- This command is useful if you wish arrows or lines to ``stop shortly
- before'' a given point.
+ This command is useful if you wish arrows or lines to ``stop shortly
+ before'' a given point.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfpathcircle{\pgfpointorigin}{5mm}
@@ -418,34 +420,34 @@ Section~\ref{section-arrow-tips-where}.
\pgfusepath{stroke}
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
-
+
\begin{command}{\pgfsetshortenend\marg{dimension}}
- Works like |\pgfsetshortenstart|.
+ Works like |\pgfsetshortenstart|.
\end{command}
-
\subsection{Filling a Path}
\label{section-fill}
-Filling a path means coloring every interior point of the path with
-the current fill color. It is not always obvious whether a point is
-``inside'' a path when the path is self-intersecting and/or consists
-or multiple parts. In this case either the nonzero winding number rule
-or the even-odd crossing number rule is used to decide which points
-lie ``inside.'' These rules are explained in
-Section~\ref{section-rules}.
+Filling a path means coloring every interior point of the path with the current
+fill color. It is not always obvious whether a point is ``inside'' a path when
+the path is self-intersecting and/or consists or multiple parts. In this case
+either the nonzero winding number rule or the even-odd crossing number rule is
+used to decide which points lie ``inside''. These rules are explained in
+Section~\ref{section-rules}.
+
\subsubsection{Graphic Parameter: Interior Rule}
You can set which rule is used using the following commands:
\begin{command}{\pgfseteorule}
- Dictates that the even-odd rule is used in subsequent fillings in
- the current \emph{\TeX\ scope}. Thus, for once, the effect of this
- command does not persist past the current \TeX\ scope.
-
+ Dictates that the even-odd rule is used in subsequent fillings in the
+ current \emph{\TeX\ scope}. Thus, for once, the effect of this command does
+ not persist past the current \TeX\ scope.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfseteorule
@@ -454,12 +456,13 @@ You can set which rule is used using the following commands:
\pgfusepath{fill}
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfsetnonzerorule}
- Dictates that the nonzero winding number rule is used in subsequent
- fillings in the current \TeX\ scope. This is the default.
-
+ Dictates that the nonzero winding number rule is used in subsequent
+ fillings in the current \TeX\ scope. This is the default.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfsetnonzerorule
@@ -468,47 +471,52 @@ You can set which rule is used using the following commands:
\pgfusepath{fill}
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
+
\subsubsection{Graphic Parameter: Filling Color}
\begin{command}{\pgfsetfillcolor\marg{color}}
- Sets the color used for filling paths to \meta{color}. Like the
- stroke color, the effect lasts only till the next use of |\color|.
+ Sets the color used for filling paths to \meta{color}. Like the stroke
+ color, the effect lasts only till the next use of |\color|.
\end{command}
\subsubsection{Graphic Parameter: Fill Opacity}
-You can set the fill opacity using |\pgfsetfillopacity|. This
-command is described in Section~\ref{section-transparency}.
+You can set the fill opacity using |\pgfsetfillopacity|. This command is
+described in Section~\ref{section-transparency}.
+
\subsection{Clipping a Path}
\label{section-clip}
-When you add the |clip| option, the current path is used for
-clipping subsequent drawings. The same rule as for filling is used to
-decide whether a point is inside or outside the path, that is, either
-the even-odd rule or the nonzero rule.
+When you add the |clip| option, the current path is used for clipping
+subsequent drawings. The same rule as for filling is used to decide whether a
+point is inside or outside the path, that is, either the even-odd rule or the
+nonzero rule.
-Clipping never enlarges the clipping area. Thus, when you clip against
-a certain path and then clip again against another path, you clip
-against the intersection of both.
+Clipping never enlarges the clipping area. Thus, when you clip against a
+certain path and then clip again against another path, you clip against the
+intersection of both.
+
+The only way to enlarge the clipping path is to end the |{pgfscope}| in which
+the clipping was done. At the end of a |{pgfscope}| the clipping path that was
+in force at the beginning of the scope is reinstalled.
-The only way to enlarge the clipping path is to end the |{pgfscope}|
-in which the clipping was done. At the end of a |{pgfscope}| the
-clipping path that was in force at the beginning of the scope is
-reinstalled.
\subsection{Using a Path as a Bounding Box}
\label{section-using-bb}
-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. Alternatively, you can use |\pgfresetboundingbox|, followed by |\pgfusepath{use as bounding box}| to overrule the picture's bounding box completely.
-
+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. Alternatively, you can use |\pgfresetboundingbox|,
+followed by |\pgfusepath{use as bounding box}| to overrule the picture's
+bounding box completely.
+%
\begin{codeexample}[]
Left
\begin{pgfpicture}
@@ -520,4 +528,3 @@ Left
\end{pgfpicture}
right.
\end{codeexample}
-
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-animations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-animations.tex
new file mode 100644
index 00000000000..32bfa24386d
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-animations.tex
@@ -0,0 +1,1348 @@
+% Copyright 2015 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{Animations}
+\label{section-base-animations}
+
+\begin{pgfmodule}{animations}
+ This module contains the basic layer support of animations, which is
+ documented in the following.
+\end{pgfmodule}
+
+This section described the basic layer support of animations, the \tikzname\
+support is described in Section~\ref{section-tikz-animations}. As always,
+\tikzname\ mainly converts syntactic constructs (like the special colon or
+quote syntax) to appropriate basic layer commands, which are documented here.
+Note, however, that while many attributes and options are the same on both
+layers, some things are handled differently on the basic layer.
+
+
+\subsection{Overview}
+
+An \emph{animation} changes the way some part of a graphic looks like over
+time. The archetypical animation is, of course, a \emph{movement} of node, but
+a change of, say, the opacity of a path is also an animation. \pgfname\ allows
+you to specify such animations using a set of commands and keys that are
+documented in the following.
+%
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \pgfanimateattribute{opacity}{
+ whom = node, begin on = {click}, entry = {0s}{1}, entry = {2s}{0} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+
+Differently from other packages, the animations created by \pgfname\ are not
+precomputed sequences of pictures that are displayed in rapid succession.
+Rather, an animation created by \pgfname\ consists mainly of an annotation in
+the output that a certain attribute of a certain object should change over time
+in some specific way when the object is displayed. It is the job of the
+document viewer application to actually compute and display the animation.
+Interestingly, this means that animations neither increase the size of the
+ouput files noticably nor does it put a special burden on \TeX. The hard and
+complicated calculations are done by the viewer application, not by \TeX\ and
+\pgfname.
+
+Only few viewer applications and formats are currently ``up to the job'' of
+displaying animations. In particular, the popular \textsc{pdf} format does
+\emph{not} allow one to specify animations in this way (one can partly ``fake''
+animations at the high price of including a great number of precomputed
+pictures and using JavaScript in special viewers, but this is really not the
+same thing as what \pgfname\ does). Indeed, currently only the \textsc{svg}
+format allows one to specify animations in a sensible way. Thus, \pgfname's
+animations will only be displayed when \textsc{svg} is used as output format.
+
+Because of the shortcomings of the other formats and, also, for purposes of
+printing and depicting animations in a sequential manner, \pgfname\ also allows
+you to create ``snapshots'' of animations. As an example, the following code
+shows how the same drawing is shown at different ``time snapshots'':
+%
+\begin{codeexample}[width=3.9cm]
+\tikz [make snapshot of=0.5s] \scoped :rotate = { 0s = "0", 2s = "90" }
+ \node [draw=blue, very thick] {\pgfname};
+\tikz [make snapshot of=1s] \scoped :rotate = { 0s = "0", 2s = "90" }
+ \node [draw=blue, very thick] {\pgfname};
+\tikz [make snapshot of=1.5s] \scoped :rotate = { 0s = "0", 2s = "90" }
+ \node [draw=blue, very thick] {\pgfname};
+\tikz [make snapshot of=2s] \scoped :rotate = { 0s = "0", 2s = "90" }
+ \node [draw=blue, very thick] {\pgfname};
+\end{codeexample}
+
+
+\subsection{Animating an Attribute}
+
+\subsubsection{The Main Command}
+
+Creating an animation is done using the command |\pgfanimateattribute|, which
+takes a to-be-animated attribute and options specifying the timeline:
+
+\begin{command}{\pgfanimateattribute\marg{attribute}\marg{options}}
+ Adds an animation of the \meta{attribute} of a future \emph{object} to the
+ current graphic. Attributes are things like the ``fill opacity'' or the
+ transformation matrix or the line width.
+
+ The \meta{options} are keys that configure how the attribute changes over
+ time. Using the |entry| key multiple times, you specify which value the
+ chosen attribute should have at different points in time. Unless special
+ keys are used, ``outside'' the specified timeline the animation has no
+ effect:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2,2.5}]
+\tikz {
+ \pgfanimateattribute{opacity}{
+ whom = node, begin on = {click}, entry = {0s}{1}, entry = {2s}{0} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+
+ Other keys, like |repeats|, allow you to specify how the animation behaves
+ ``as a whole''. These keys are documented later in this section.
+
+
+ \medskip
+ \textbf{The Attributes}
+
+ In detail, the |\pgfanimateattribute| command opens a \TeX-scope, looks up
+ the \emph{type} values of the specified \meta{attribute} have (if you wish
+ to animate the |opacity| of an object, the type is ``scalar'' meaning that
+ entries must be scalar numbers; when you animate the |fill| attribute, the
+ type is ``color'' and values must be colors, and so on), and then executes
+ the \meta{options} with the path prefix |/pgf/animation|. Finally, an
+ appropriate system layer command |\pgfsysanimate...| is called to create
+ the actual animation and the scope is closed.
+
+ The following \meta{attributes} are permissible:
+
+ \begin{tabular}{ll}
+ \emph{Attribute} & \emph{Type} \\
+ |draw|, |fill| & color \\
+ |line width| & dimension \\
+ |motion| & scalar \\
+ |opacity|, |fill opacity|, |draw opacity| & scalar \\
+ |path| & path \\
+ |rotate| & scalar \\
+ |scale| & scaling \\
+ |softpath| & softpath \\
+ |translate| & point \\
+ |view| & viewbox \\
+ |visible| & boolean \\
+ |stage| & boolean \\
+ |xskew|, |yskew| & scalar \\
+ \end{tabular}
+
+ These attributes are detailed in Sections
+ \ref{section-base-animation-painting}
+ to~\ref{section-base-animation-views}, but here is a quick overview:
+ %
+ \begin{itemize}
+ \item |draw| and |fill| refer to the color used to draw (stroke) and
+ fill paths in an object, respectively. Typical values for this
+ attribute are |red| or |black!10|.
+ \item |line width| is, of course, the line width used in an object.
+ Typical values are |0.4pt| or |1mm|. Note that you (currently)
+ cannot use keys like |thin| or |thick| here, but this may change in
+ the future.
+ \item |motion| is a slightly special attribute: It allows you to
+ specify a path along which the object should be moved (using the
+ |along| key). The values given to the |entry| key for this
+ attribute refer to a \emph{fraction of the distance along the
+ path}. See the |along| key for details.
+ \item |opacity| and the variants |fill opacity| and |draw opacity|
+ animate the opacity of an object. Allowed values range between 0
+ and 1.
+ \item |path| allows you to animate a path (it will morph). The
+ ``values'' are now paths themselves. See
+ Section~\ref{section-base-animation-paths} for details.
+ \item |rotate| refers to a rotation of the object. Values for the
+ |entry| key are the rotation angles like |0| or |90|.
+ \item |scale| refers to the scaling of the object. Values are either
+ single scalars values (like |1| or |1.5|) or two numbers separated
+ by a comma (like |1,1.5| or |0.5,2|), referring to the $x$-scaling
+ and $y$-scaling.
+ \item |softpath| is a special case of the |path| attribute, see
+ Section~\ref{section-base-animation-paths} once more.
+ \item |translate| shifts the object by a certain vector. Values are
+ points like |\pgfpoint{1cm}{2cm}|.
+ \item |view| allows you to animate the view box of a view, see
+ Section~\ref{section-base-animation-views} for details.
+ \item |visible| refers to the visibility of an object. Allowed values
+ are |true| and |false|.
+ \item |stage| is identical to |visible|, but when the object is not
+ animated, it will be hidden by default.
+ \item |xskew| and |yskew| skew the object. Attributes are angles like
+ |0| or |45| or even |90|.
+ \end{itemize}
+
+
+ \medskip
+ \textbf{The Target Object}
+
+ As stated earlier, the \meta{options} are used to specify the object whose
+ attribute for which an animation should be added to the picture. Indeed,
+ you \emph{must} specify the object explicitly using the |whom| key and you
+ must do so \emph{before} the object is created. Note that, in contrast, in
+ \textsc{svg} you can specify an animation more or less anywhere and then
+ use hyper-references to link the animation to the to-be-animated object;
+ \pgfname\ insists that you specify the animation before the object. This is
+ a bit of a bother in some situations, but it is the only way to ensure that
+ \pgfname\ has a fighting chance to attach some additional code to the
+ object (which is necessary for almost all animations of the transformation
+ matrix).
+
+ \begin{key}{/pgf/animation/whom=\meta{id}\opt{|.|\meta{type}}}
+ You \emph{must} use this key once which each call of the
+ |\pgfanimateattribute| command. The \meta{id} and the optional
+ \meta{type} (which is whatever follows the first dot) will be passed to
+ |\pgfidrefnextuse|, see that command for details.
+ \end{key}
+
+ As explained in the introduction of this chapter, an ``animation'' is just
+ a bit of special text in the output document asking a viewer application to
+ animate the object at some later time. The |\pgfanimateattribute| command
+ inserts this special text immediately, even though it refers to an object
+ created only later on. Normally, this is not a problem, but the special
+ text should be on the same page as the to-be-animated object. To ensure
+ this, it suffices to call |\pgfanimateattribute| no earlier than the
+ beginning of the |pgfpicture| containing the object.
+
+
+ \medskip
+ \textbf{Naming the Animation}
+
+ You can assign a name to an animation for later (or early) reference. In
+ particular, it is possible to begin \emph{another} animation relative to
+ the beginning or end of this animation and for referencing this animation
+ must be assigned a name. See the |of| and |of next| keys for details.
+
+ \begin{key}{/pgf/animation/name=\meta{name}}
+ Assigns a name to the animation by which it can be referenced using the
+ |of| and |of next| keys in another animation.
+ %
+\begin{codeexample}[animation list={.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6}]
+\tikz [very thick] {
+ \pgfanimateattribute{rotate}{
+ whom = node, begin on = {end, of next = my move animation, delay = 1s},
+ entry = {0s}{0}, entry = {2s}{90}, begin snapshot = 3s, }
+ \pgfanimateattribute{translate}{
+ name = my move animation, whom = node, begin on = {click},
+ entry = {0s}{\pgfpointorigin}, entry = {2s}{\pgfpoint{0cm}{-5mm}} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Here!};
+}
+\end{codeexample}
+ \end{key}
+\end{command}
+
+\begin{command}{\pgfanimateattributecode\marg{attribute}\marg{code}}
+ The command works like |\pgfanimateattribute|, only instead of
+ \meta{options} you specify some \meta{code} whose job is to setup the
+ options.
+\end{command}
+
+
+\subsubsection{Specifying the Timeline}
+
+The core key for specifying how an attribute varies over time is the |entry|
+key:
+%
+\begin{key}{/pgf/animation/entry=\marg{time}\marg{value}}
+ You use this key repeatedly to specify the different values that the
+ \meta{attribute} should have over time. At the \meta{time} specified, the
+ \meta{attribute} will have the value specified as \meta{value}:
+ %
+\begin{codeexample}[animation list={.5,1,1.5,2}]
+\tikz {
+ \pgfanimateattribute{rotate}{
+ whom = node, begin on = {click},
+ entry = {0s}{0}, entry = {1s}{90}, entry = {1.1s}{45}, entry = {2s}{90}
+ }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+
+ You need to call |entry| once for each time in the timeline for which you
+ want to specify a \meta{value} explicitly. Between these times, the values
+ get interpolated (see below for details). You need to specify the
+ \meta{time}s in non-decreasing order (it is permissible and sometimes also
+ necessary to specify the same time twice, namely to create a ``jump'' of
+ the value of some attribute).
+
+ The \meta{time} is parsed using the command |\pgfparsetime| described
+ later.
+
+
+ \medskip
+ \textbf{Start and end of the timeline.}
+ The first and last times of the timeline are a bit special: The timeline
+ starts on the first time and the duration of the timeline is the difference
+ between the first and last time. ``Starting'' on the start time actually
+ means that any beginnings (see the |begin| and |end| keys) get offset by
+ the start time; similarly end times are offset by this value.
+
+
+ \medskip
+ \textbf{Syntax of the values.}
+ The syntax of the \meta{value} varies according to the type of the
+ \meta{attribute}. In detail, these are:
+
+ \begin{tabular}{lp{12cm}}
+ \emph{Type} & \emph{Syntax} \\
+ color & Standard color syntax like |red| or |black!10| \\
+ scalar & A value parsed using |\pgfmathparse| \\
+ dimension & A dimension parsed using |\pgfmathparse| \\
+ path & A sequence of path construction commands \\
+ softpath & A sequence of soft path construction commands \\
+ scaling & A scalar value or a pair of scalar values separated by a comma \\
+ point & A \pgfname-point like |\pgfpoint{1cm}{5mm}| \\
+ viewbox & Two \pgfname-points \\
+ boolean & |true| or |false| \\
+ \end{tabular}
+
+
+ \medskip
+ \textbf{Interpolation between key times.}
+ You use the |entry| key repeatedly, namely once for each ``key time'',
+ which is a time point for which you specify the value of the attribute
+ explicitly. Between these key times, the attribute's value is interpolated.
+ Normally, this is just a linear interpolation, but you can influence this
+ using the following keys, see Section~\ref{section-anim-smooth} for
+ details.
+
+ \begin{key}{/pgf/animations/exit control=\marg{time fraction}\marg{value fraction}}
+ Same as |/tikz/animate/options/exit control|.
+ %
+\begin{codeexample}[animation list={0.333/\frac{1}{3},0.666/\frac{2}{3},1,1.333/1\frac{1}{3},1.666/1\frac{2}{3}}]
+\tikz {
+ \foreach \i in {0,0.1,...,1} \draw (-0.9,.9-\i) -- ++(1.8,0);
+ \pgfanimateattribute{translate}{
+ whom = node, begin on = {click},
+ exit control={1}{0},
+ entry = {0s}{\pgfpointorigin},
+ linear, % revert to default
+ entry = {1s}{\pgfpoint{0cm}{-5mm}},
+ entry control={0}{1},
+ entry = {2s}{\pgfpoint{0cm}{-10mm}} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+ \end{key}
+
+ \begin{key}{/pgf/animations/entry control=\marg{time fraction}\marg{value fraction}}
+ Works like |exit control|.
+ \end{key}
+
+ \begin{key}{/pgf/animations/linear}
+ A shorthand for |exit control={0}{0}, entry control={1}{1}|. This will
+ (re)install a linear curve.
+ \end{key}
+
+ \begin{key}{/pgf/animations/stay}
+ Same as |/tikz/animate/options/stay|.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2,2.5}]
+\tikz {
+ \foreach \i in {0,0.1,...,1} \draw (-0.9,.9-\i) -- ++(1.8,0);
+ \pgfanimateattribute{translate}{
+ whom = node, begin on = {click},
+ entry = {0s}{\pgfpointorigin},
+ stay,
+ entry = {1s}{\pgfpoint{0cm}{-5mm}},
+ linear,
+ entry = {2s}{\pgfpoint{0cm}{-10mm}},
+ entry = {3s}{\pgfpoint{0cm}{-15mm}} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+ \end{key}
+
+ \begin{key}{/pgf/animations/jump}
+ Same as |/tikz/animate/options/jump|.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \foreach \i in {0,0.1,...,1} \draw (-0.9,.9-\i) -- ++(1.8,0);
+ \pgfanimateattribute{translate}{
+ whom = node, begin on = {click},
+ entry = {0s}{\pgfpointorigin},
+ jump,
+ entry = {1s}{\pgfpoint{0cm}{-1cm}},
+ linear,
+ entry = {2s}{\pgfpoint{0cm}{-2cm}} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+ \end{key}
+\end{key}
+
+When the time of an animation lies outside the timeline specified by the
+|entry| keys, no animation is present. This means that the value of the
+attribute is the object's scope is used instead. Using the following key, you
+can set this value directly:
+
+\begin{key}{/tikz/animations/base=\meta{value}}
+ The syntax of the \meta{value} is the same as for the |entry| key. The
+ \meta{value} is installed as the value of the object's attribute whenever
+ the timeline is not active. This makes it easy to specify the value of an
+ attribute when the animation is ``not running''.
+ %
+\begin{codeexample}[animation list={-1,0,1,2,3}]
+\tikz {
+ \pgfanimateattribute{rotate}{
+ whom = node, begin on = {click},
+ entry = {0s}{90}, entry = {2s}{180},
+ base = 45
+ }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+ %
+\end{key}
+
+It may happen that there is more than one timeline active that is ``trying to
+modify'' a given attribute. In this case, the following rules are used to
+determine, which timeline ``wins'':
+%
+\begin{enumerate}
+ \item If no animation is active at the current time (all animation either
+ have not yet started or they have already ended), then the base value
+ given in the animation encountered last in the code is used. (If there
+ are no base values, the attribute is taken from the surrounding scope.)
+ \item If there are several active animations, the one that has started last
+ is used and the its value is used.
+ \item If there are several active animations that have started at the same
+ time, the one that comes last in the code is used.
+\end{enumerate}
+
+Note that these rules do not apply to transformations of the canvas since these
+are always additive (or, phrased differently, they are always all active and
+the effects accumulate).
+
+\begin{command}{\pgfparsetime\marg{time}}
+ This command works like |\pgfmathparse| (indeed, it calls is internally),
+ but returns the result in the macro |\pgftimeresult| rather than
+ |\pgfmathresult|. Furthermore, the following changes are installed:
+ %
+ \begin{itemize}
+ \item The postfix operator |s| is added, which has no effect.
+ \item The postfix operator |ms| is added, which divides a number by
+ 1000, so |2ms| equals 0.002s.
+ \item The postfix operator |min| is added, which multiplies a number by
+ 60.
+ \item The postfix operator |h| is added, which multiplies a number by
+ 3600.
+ \item The infix operator |:| is redefined, so that it multiplies its
+ first argument by 60 and adds the second. This implies that |1:20|
+ equals 80s and |01:00:00| equals 3600s.
+ \item The parsing of octal numbers is switched off to allow things like
+ |01:08| for 68s.
+ \end{itemize}
+\end{command}
+
+
+\subsubsection{``Anti-Animations'': Snapshots}
+
+There are a number of situations in which you want the ``opposite'' of an
+animation to happen: You want to create a ``still image''. For instance, when
+you want to print an animation you will typically wish to show one or more
+``temporal snapshots'' of the animation. Also, you may wish to specify a value
+for an object when it is \emph{not} being animated.
+
+Let us start with creating a snapshot:
+
+\begin{command}{\pgfsnapshot\marg{time}}
+ When this command is used inside a \TeX\ scope, the behaviour of
+ |\pgfanimateattribute| changes: Instead of adding an animation to the
+ object and the attribute, the object's attribute is set to value it would
+ have during the animation at time \meta{time}. Note that when this command
+ is used in a \TeX\ scope, no animation is created and no support by the
+ driver is needed (so, it works with \textsc{pdf}).
+ %
+\begin{codeexample}[]
+\tikz [make snapshot of=1s,
+ animate = { myself: = {
+ :rotate = { 0s = "0", 2s = "90" },
+ :color = { 0s = "red", 2s = "green" },
+ :line width = { 0s = "0mm", 4s = "4mm" }
+ }}]
+ \node [fill=black!20, draw] { Node };
+\end{codeexample}
+
+
+ \medskip\textbf{Timing and Events.}
+ The timeline of an animation normally starts at a ```moment |0s|'' and the
+ \meta{time} is considered relative to this time. For instance, if a
+ timeline contains, say, the settings |entry={2s}{0}| and |entry={3s}{10}|
+ and \marg{time} is set to |2.5s|, then the value the attribute will get is
+ 5.
+
+ It is, however, also possible to specify that animations begin and end at
+ certain times relative to events like a |click| event. \emph{These events
+ are not relevant with respect to snapshots.} However, there is one key that
+ allows you to specify the beginning of the snapshot timeline:
+ %
+ \begin{key}{/tikz/animations/begin snapshot=\meta{begin time}}
+ When this key is used inside the options of |\pgfanimateattribute|,
+ with respect to snapshots, the timeline begins at \meta{begin time}.
+ This means that, if the snapshot time is set to \meta{time} and the
+ beginning of the snapshot's timeline is set to \meta{begin time}, the
+ attribute is set to the value of the timeline at time $\meta{time} -
+ \meta{begin time}$.
+
+ The idea is that when you make a snapshot of several animations and all
+ of them have started at different times because of different events,
+ you use |begin snapshot| with each object and attribute to directly
+ specify when these different events have happened.
+ \end{key}
+
+ Note that the |end| keys have no effect with snapshots, that is, with a
+ snapshot all animations always run till the end of the timeline (which may
+ or may not be ``forever'').
+
+
+ \medskip\textbf{Limitations.}
+ For snapshots, the value an animation has at time \meta{time} must be
+ computed by \TeX. While in many cases this is easy to achieve, in some
+ cases this is not trivial such as a timeline for a path with repeats plus
+ smoothing via splines. An additional complication is the fact that an
+ animation may be specified at a place far removed from the actual
+ to-be-animated object. For these reasons, certain limitations apply to
+ snapshots:
+ %
+ \begin{itemize}
+ \item The |begin| and |begin on| keys have no effect (but |begin
+ snapshot| has one.
+ \item The |end| and |end on| keys have no effect.
+ \item The |current value| may not be used in a timeline (since
+ \pgfname\ cannot really determine this value).
+ \item The |accumulating| specification may not be used with paths,
+ views, or motions.
+ \item Since the timing computations are done using \TeX\ code, they are
+ not necessarily stable. For instance, when a time interval is very
+ small and there are many repeats or when a spline is very
+ complicated, the calculated values may not be fully accurate.
+ \end{itemize}
+\end{command}
+
+\begin{command}{\pgfsnapshotafter\marg{time}}
+ This command works exactly like |\pgfsnapshot| only the ``moment'' that
+ \meta{time} refers to is conceptually $\meta{time} + \epsilon$: When
+ timeline specifies several values for \meta{time}, this command will select
+ the last value at \meta{time}, while |\pgfsnapshot| will select the first
+ value at \meta{time}. Similarly, when a timeline ends at \meta{time},
+ |\pgfsnapshot| will select the last value of the timeline while
+ |\pgfsnapshotafter| will not apply the animation any more:
+ %
+\begin{codeexample}[]
+\foreach \t in {0,1,2,3,4} {
+ \pgfsnapshot{\t}
+ \tikz :rotate = { 0s = "0", 2s = "90", 2s = "180", 4s = "270" }
+ \node [draw=blue, very thick] {f}; }
+\end{codeexample}
+ %
+\begin{codeexample}[]
+\foreach \t in {0,1,2,3,4} {
+ \pgfsnapshotafter{\t}
+ \tikz :rotate = { 0s = "0", 2s = "90", 2s = "180", 4s = "270" }
+ \node [draw=blue, very thick] {f}; }
+\end{codeexample}
+ %
+\end{command}
+
+
+\subsection{Animating Color, Opacity, Visibility, and Staging}
+\label{section-base-animation-painting}
+
+\begin{animateattribute}{fill}
+ You can animate the color of the target object of an animation using the
+ attributes |fill| or |draw|, which animate the fill color and the drawing
+ (stroking) color, respectively. To animate both the fill and draw color,
+ you need to create two animations, one for each.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \pgfanimateattribute{fill}{
+ whom = node.background, begin on = {click},
+ entry = {0s}{white}, entry = {2s}{red} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+ %
+\end{animateattribute}
+
+\begin{animateattribute}{draw}
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \pgfanimateattribute{draw}{
+ whom = node.background, begin on = {click},
+ entry = {0s}{white}, entry = {2s}{red} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+\end{animateattribute}
+
+When the target of a color animation is a scope, you animate the color ``used
+in this scope'' for filling or stroking. However, when an object inside the
+scope has its color set explicitly, this color overrules the color of the
+scope:
+%
+\begin{codeexample}[animation list={0.5,1,1.5,2},animation bb={(1.5,-0.75) rectangle (3,0.75)}]
+\tikz {
+ \pgfanimateattribute{fill}{
+ whom = example, begin on = {click, of next=node},
+ entry = {0s}{white}, entry = {2s}{red} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+ \begin{scope}[name = example]
+ \fill (1.5,-0.75) rectangle ++ (1,1);
+ \fill [blue] (2,-0.25) rectangle ++ (1,1);
+ \end{scope}
+}
+\end{codeexample}
+
+Note that in certain cases, a graphic scope may contain graphic objects with
+their colors set explicitly ``in places where you do not expect it'': In
+particular, a node normally consists at least of a background path and a text.
+For both the text and for the background path, colors will be set for the text
+and also for the path explicitly. This means that when you pick the fill
+attribute of a node as the target of an animation, you will \emph{not} animate
+the color of the background path in case this color has been set explicitly.
+Instead, you must choose the background path of the node as the target of the
+animation. Fortunately, this is easy to achieve since when the background path
+of a node is created, the identifier type is set to |background|, which in turn
+allows you to access it as \meta{node}|.background| through the |whom| key.
+
+The text of a node also gets it color set explicitly, which means that a change
+of the node's scope's color has no effect on the text color. Instead, you must
+choose \meta{name}|.text| as the target (or, if the node has more parts, use
+the name of the part as the identifier type instead of |text|).
+%
+\begin{codeexample}[animation list={0.5,1,1.5,2},animation bb={(1.1,-0.9) rectangle (2.9,0.9)}]
+\tikz {
+ \pgfanimateattribute{fill}{
+ whom = example, begin on = {click, of next=node},
+ entry = {0s}{white}, entry = {2s}{red} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+ \node at (2,0) (example) [fill = blue!20, circle] {No effect}; }
+\end{codeexample}
+
+\begin{codeexample}[animation list={0.5,1,1.5,2},animation bb={(1.1,-0.9) rectangle (2.9,0.9)}]
+\tikz {
+ \pgfanimateattribute{fill}{
+ whom = example.background, begin on = {click, of next=node},
+ entry = {0s}{white}, entry = {2s}{red} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+ \node at (2,0) (example) [fill = blue!20, circle] {Effect}; }
+\end{codeexample}
+
+\begin{codeexample}[animation list={0.5,1,1.5,2},animation bb={(1.1,-0.9) rectangle (2.9,0.9)}]
+\tikz {
+ \pgfanimateattribute{fill}{
+ whom = example.text, begin on = {click, of next=node},
+ entry = {0s}{white}, entry = {2s}{red} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+ \node at (2,0) (example) [fill = blue!20, circle, font=\huge] {Text}; }
+\end{codeexample}
+
+Similarly to the color, you can also set the opacity used for filling and for
+drawing. You specify the opacity using a number between 0 (transparent) and 1
+(opaque).
+
+\begin{animateattribute}{fill opacity}
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \pgfanimateattribute{fill opacity}{
+ whom = node, begin on = {click}, entry = {0s}{1}, entry = {2s}{0} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+\end{animateattribute}
+
+\begin{animateattribute}{draw opacity}
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \pgfanimateattribute{draw opacity}{
+ whom = node, begin on = {click}, entry = {0s}{1}, entry = {2s}{0} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+\end{animateattribute}
+
+\begin{animateattribute}{opacity}
+ Unlike colors, where there is no joint attribute for filling and stroking,
+ there is a single |opacity| attribute in addition to the above two
+ attributes. If supported by the driver, it treats the graphic object to
+ which it is applied as a transparency group. In essence, ``this attribute
+ does what you want'' at least in most situations.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \pgfanimateattribute{opacity}{
+ whom = node, begin on = {click}, entry = {0s}{1}, entry = {2s}{0} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+ %
+\end{animateattribute}
+
+\begin{animateattribute}{visible}
+ The difference between the |visible| attribute and an opacity of |0| is
+ that an invisible object cannot be clicked and does not need to be
+ rendered. The (only) two possible values for this attribute are |false| and
+ |true|.
+ %
+\begin{codeexample}[animation list={1,2,3,4}]
+\tikz {
+ \pgfanimateattribute{visible}{
+ whom = node, begin on = {click}, entry = {0s}{false}, entry = {2s}{false} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+ %
+\end{animateattribute}
+
+\begin{animateattribute}{stage}
+ This attribute is the same as the |visible| attribute, only |base=false| is
+ set by default. This means that the object is \emph{only} visible when you
+ explicitly during the time the entries are set to |true|. The idea behind
+ the name ``stage'' is that the object is normally ``off stage'' and when
+ you explicitly set the ``stage attribute'' to |true| the object ``enters''
+ the stage and ``leaves'' once more when it is no longer ``on stage''.
+ %
+\begin{codeexample}[animation list={-1,0,1,2,3},animation bb={(1.3,-0.7) rectangle (2.7,0.7)}]
+\tikz {
+ \pgfanimateattribute{stage}{
+ whom = example, begin on = {click, of next=node},
+ entry = {0s}{true}, entry = {2s}{true} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+ \node at (2,0) (example) [fill = blue!20, circle] {Effect}; }
+\end{codeexample}
+ %
+\end{animateattribute}
+
+
+\subsection{Animating Paths and their Rendering}
+\label{section-base-animation-paths}
+
+You can animate the appearance of a path in the following ways:
+
+\begin{animateattribute}{line width}
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [very thick] {
+ \pgfanimateattribute{line width}{
+ whom = node, begin on = {click}, entry = {0s}{1pt}, entry = {2s}{5mm} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Click me!};
+}
+\end{codeexample}
+ %
+ The possible values passed to the |entry| key are, of course, dimensions.
+\end{animateattribute}
+
+\begin{animateattribute}{dash}
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \pgfanimateattribute{dash}{
+ whom = node, begin on = {click}, entry = {0s}{{{10pt}{1pt}}{0pt}},
+ entry = {2s}{{{1pt}{10pt}}{0pt}} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \pgfanimateattribute{dash}{
+ whom = node, begin on = {click}, entry = {0s}{{{1cm}{1pt}}{0pt}},
+ entry = {2s}{{{1cm}{1pt}}{1cm}} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+ %
+ To specify the dash pattern, you specify a sequence of ``on and off''
+ dimensions; see |\pgfsetdash| for details. Note that you \emph{must}
+ specify the same number of elements in all patterns of a timeline: You
+ cannot specify that the dash pattern for |1s| is |{1pt}{2pt}| and for |2s|
+ is |{1pt}{3pt}{2pt}| since the number of elements would differ. In
+ particular, you cannot (sensibly) use |current value| for the first entry
+ since this corresponds to an empty dash pattern (even when you have
+ specified a dash pattern for the target object: this pattern will not be
+ attached to the to-be-animated scope or object but to a surrounding scope
+ and, thus, the to-be-animated scope will not have any dash pattern
+ installed).
+\end{animateattribute}
+
+\begin{animateattribute}{path}
+ You can animate the path itself:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \pgfanimateattribute{path}{
+ whom = node.background.path, begin on = {click, of next=node},
+ entry = {0s}{\pgfpathellipse{\pgfpointorigin}
+ {\pgfpointxy{1}{0}}{\pgfpointxy{0}{1.5}}},
+ entry = {2s}{\pgfpathellipse{\pgfpointxy{.5}{0}}
+ {\pgfpointxy{.5}{.5}}{\pgfpointxy{0.25}{.25}}}}
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+ %
+ The path is specified by giving path construction commands as in the above
+ example. They will be executed in a special protected scope to ensure that
+ they have only little side effects.
+
+ As for the dash pattern, you must ensure that all paths in the timeline
+ have the same structure (same sequence of path construction commands); only
+ the coordinates may differ. In particular, you cannot say that the path at
+ |1s| is a rectangle using |\pgfpathrectangle| and at |2s| is a circle using
+ |\pgfpathcircle|. Instead, you would have to ensure that at both times that
+ path consists of appropriate Bézier curves.
+
+ Unlike the dash pattern, the to-be-animated object is, indeed, the path
+ itself and not some special scope. This means that you can use the |current
+ value| for the start path. However, this also means that you really must
+ pick \emph{the path object} as the target of the animation. In conjunction
+ with \tikzname, this will be an object of type |path| as in the above
+ example.
+
+ When a path is animated, it cannot have ``normal'' arrows attached to it
+ since due to the way \pgfname\ adds arrow tips to paths, these would not
+ ``move along'' with the path (you get an error message if you try).
+ However, it still \emph{is} possible to add arrow tips to an animated path,
+ only you need to use the |arrows| key described next.
+
+ Concerning the bounding box computation of the path, a bounding box for all
+ paths mentioned for any time point is used as the overall bounding box.
+\end{animateattribute}
+
+\begin{key}{/pgf/animation/arrows=\meta{start tip spec}|-|\meta{end tip spec}}
+ This key specifies arrow tips during the animation of the path. The syntax
+ for the arrow tips is the same syntax as the |\pgfsetarrow| command or
+ \tikzname's |arrows| key. The specified start and end arrow tips are
+ rendered as ``markers'', which are added to the path \emph{only} during the
+ animation. The markers are rotated along with the path in exactly the same
+ way as normal arrow tips would be. To be precise, the rules used for the
+ computation of where arrow tips go and in which direction they head is not
+ always the same for ``static'' arrow tips (arrow tips added to a normal
+ path) and the ``dynamic'' arrow tips based on markers; namely when the
+ paths are very short or closed. For this reason, you should add arrow tips
+ to animated paths only when the paths are ``nice and simple'' in the sense
+ that they consist of a single segment whose ends are reasonably long.
+
+ In addition to adding the arrow tips to the path during the animation, the
+ path gets shortened as necessary to compensate for the extend of the arrow
+ tips. However, for this to work, the arrow tips have to be specified before
+ path values are specified (since the shortening is done immediately when a
+ path value is parsed).
+ %
+\begin{codeexample}[animation list={0,1,2,3,4},animation bb={(0.9,-0.1)rectangle(2.1,1.1)}]
+\tikz {
+ \pgfanimateattribute{path}{
+ whom = p.path, begin on = {click, of next=node}, arrows = ->,
+ entry = {1s}{\pgfpathmoveto{\pgfpoint{1cm}{0cm}}
+ \pgfpathlineto{\pgfpoint{2cm}{1cm}}},
+ entry = {3s}{\pgfpathmoveto{\pgfpoint{1cm}{1cm}}
+ \pgfpathlineto{\pgfpoint{2cm}{5mm}}}}
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+ \draw [very thick, blue, name=p] (1,0.5) -- (2,0.5);
+}
+\end{codeexample}
+
+ Note that the markers that visualize the arrow tips are rendered only once
+ per animation. In consequence, ``bending'' arrow tips cannot be rendered
+ correctly: As a path ``morphs'' a bend arrow tip needs not only to rotate
+ along, but must actually ``bend along'', which is not supported (neither by
+ \pgfname\ nor by \textsc{svg}).
+
+ As pointed out earlier, an animated path cannot have ``static'' arrow tips.
+ However, when you specify a |base| value, which is the path used whenever
+ there is no active animation, \emph{will} use the arrow tips. As a result,
+ you can use this to animate a path with an arrow tip:
+ %
+\begin{codeexample}[animation list={0,1,2,3,4},animation bb={(0.9,-0.1)rectangle(2.1,1.1)}]
+\tikz {
+ \pgfanimateattribute{path}{
+ whom = p.path, begin on = {click, of next=node}, arrows = ->,
+ base = {\pgfpathmoveto{\pgfpoint{1cm}{5mm}}
+ \pgfpathlineto{\pgfpoint{2cm}{5mm}}},
+ entry = {1s}{\pgfpathmoveto{\pgfpoint{1cm}{0cm}}
+ \pgfpathlineto{\pgfpoint{2cm}{1cm}}},
+ entry = {3s}{\pgfpathmoveto{\pgfpoint{1cm}{1cm}}
+ \pgfpathlineto{\pgfpoint{2cm}{5mm}}}}
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+ \draw [very thick, blue, name=p];
+}
+\end{codeexample}
+ %
+\end{key}
+
+\begin{key}{/pgf/animation/shorten >=\meta{dimension}}
+ Just like the normal \tikzname\ key |shorten >|, this key specifies an
+ extra shortening of to-be-animated paths. Whenever a path is parsed as a
+ value for a path animation, it gets shortened at the end by the
+ \meta{dimension} (and, additionally, by the length of the attached arrow
+ tip). Just like the |arrows| key, this key must be given before the path
+ entries are specified.
+ %
+\begin{codeexample}[animation list={0,1,2,3,4},animation bb={(0.9,-0.1)rectangle(2.1,1.1)}]
+\tikz {
+ \pgfanimateattribute{path}{
+ whom = p.path, begin on = {click, of next=node}, arrows = ->,
+ shorten > = 2mm,
+ base = {\pgfpathmoveto{\pgfpoint{1cm}{5mm}}
+ \pgfpathlineto{\pgfpoint{2cm}{5mm}}},
+ entry = {1s}{\pgfpathmoveto{\pgfpoint{1cm}{0cm}}
+ \pgfpathlineto{\pgfpoint{2cm}{1cm}}},
+ entry = {3s}{\pgfpathmoveto{\pgfpoint{1cm}{1cm}}
+ \pgfpathlineto{\pgfpoint{2cm}{5mm}}}}
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+ \draw (0.9,-0.1) grid (2.1,1.1);
+ \draw [help lines] (0.9,-0.1) grid[step=1mm] (2.1,1.1);
+ \draw [very thick, blue, name=p];
+}
+\end{codeexample}
+ %
+\end{key}
+
+\begin{key}{/pgf/animation/shorten <=\meta{dimension}}
+ Works like |shorten >|.
+\end{key}
+
+
+\subsection{Animating Transformations and Views}
+\label{section-base-animation-views}
+
+In order to animate the canvas transformation matrix, you do not animate an
+attribute called ``|transform|'' (or something similar). Rather, there are
+several keys that all manipulate the canvas transformation matrix in different
+ways. These keys, taken in appropriate combination, allow you to achieve any
+particular canvas transformation matrix. All keys that animate the
+transformation matrix \emph{always} accumulate.
+
+Some, but not all, of these keys also have an effect on the bounding box
+computation: The |translate| and |motion| attribute change the computation of
+the bounding box in such a way that it is chosen large enough as to include the
+whole picture during all stages of the animation (however, if there are
+multiple transformations active at the same time, the computation may not be
+correct). In contrast, |scale|, |rotate| and |skew| animations change the
+canvas transformation, but are ignored for the bounding box computation. When
+in doubt, please set the bounding box explicitly.
+
+Let us start with the basic keys that allow you to change the canvas
+transformation matrix directly:
+
+\begin{animateattribute}{scale}
+ The |scale| attribute adds an animation of the scaling:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [very thick] {
+ \pgfanimateattribute{scale}{
+ whom = node, begin on = {click},
+ entry = {0s}{0.5}, entry = {2s}{0.75,1.5} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Click me!};
+}
+\end{codeexample}
+ %
+ The values passed to the |entry| key must either be single scalar values or
+ a pair of such numbers separated by a comma (which then refer to the $x$-
+ and $y$-scaling).
+\end{animateattribute}
+
+\begin{animateattribute}{rotate}
+ The |rotate| key adds an animation of the rotation:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [very thick] {
+ \pgfanimateattribute{rotate}{
+ whom = node, begin on = {click},
+ entry = {0s}{45}, entry = {2s}{90} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Click me!};
+}
+\end{codeexample}
+ %
+ The values are scalar values representing a rotation in degrees.
+\end{animateattribute}
+
+\begin{animateattribute}{xskew}
+ The |xskew| and |yskew| keys (and also |skew x| and |skew y|, which are
+ aliases) add an animation of the skew (given in degrees, not as a slant):
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [very thick] {
+ \pgfanimateattribute{xskew}{
+ whom = node, begin on = {click}, entry = {0s}{0}, entry = {2s}{45} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Click me!};
+}
+\end{codeexample}
+ %
+ The values are scalar values.
+\end{animateattribute}
+
+\begin{animateattribute}{yskew}
+ See |xskew|.
+\end{animateattribute}
+
+\begin{animateattribute}{skew x}
+ An alias of |xskew|.
+\end{animateattribute}
+
+\begin{animateattribute}{skew y}
+ An alias of |yskew|.
+\end{animateattribute}
+
+\begin{animateattribute}{translate}
+ The |translate| key adds an animation of the translation (shift):
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [very thick] {
+ \pgfanimateattribute{translate}{
+ whom = node, begin on = {click},
+ entry = {0s}{\pgfpointorigin}, entry = {2s}{\pgfpoint{5mm}{-5mm}} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Click me!};
+}
+\end{codeexample}
+ %
+ The values are \pgfname-points.
+
+ Unlike for the previous canvas transformations, for this key the bounding
+ box computation is changed: All points in the to-be-animated scope do not
+ only contribute to the normal bounding box, but they also contribute
+ shifted by all points in the entry list. The effect is that a bounding box
+ is computed that encompasses the animated scope at all stages.
+\end{animateattribute}
+
+For all of these attributes, the following key is of importance:
+%
+\begin{key}{/pgf/animation/origin=\meta{pgf point}}
+ An animation of the canvas transformation is added to all other
+ transformations from surrounding or interior scopes. This means that, in
+ particular, the origin of a canvas transformation is, by default, the
+ origin of the canvas of the scope surrounding the transformation object.
+
+ For some canvas animations, like a rotation or a scaling, you will
+ typically wish to use a different origin (like the center of an object that
+ is to be rotated or scaled). You can achieve this effect by surrounding the
+ object by a scope that shifts the canvas to the desired origin, followed by
+ a scope whose transformation matrix you animate, followed by a scope that
+ shifts back the canvas.
+
+ The |origin| key simplifies this process by allowing you to specify the
+ origin of the transformation directly. Internally, however, all this key
+ does is to create the above-mentioned scopes with the necessary shifts.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [very thick] {
+ \pgfanimateattribute{rotate}{
+ whom = node, begin on = {click},
+ origin = \pgfpoint{-5mm}{0mm}, entry = {0s}{0}, entry = {2s}{90} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Click me!};
+}
+\end{codeexample}
+ %
+\end{key}
+
+\begin{animateattribute}{motion}
+ A second way of changing the canvas transformation matrix is to use the
+ |motion| attribute:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [very thick] {
+ \pgfanimateattribute{motion}{
+ whom = node, begin on = {click},
+ along = \pgfpathcircle{\pgfpointorigin}{5mm},
+ entry = {0s}{.25}, entry = {2s}{.5} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Click me!}; }
+\end{codeexample}
+
+ Just like the |translate| attribute, this key also changes the bounding box
+ computation.
+ %
+ \begin{key}{/pgf/animation/along=\meta{path}}
+ This key must be used with |motion| attribute to specify a path along
+ which the transformation matrix will be ``moved'' (that is, a shift
+ transformation will be added to the different points on the path).
+
+ The values passed to the |entry| key specify fractions of the distance
+ along the \meta{path}. That means, when you provide a value of |0|, you
+ reference the start point of the path, a value of |1| references the
+ end of the path and |0.5| referenced the point halfway along the path.
+ %
+\begin{codeexample}[animation list={0.25,0.5,0.75,1,1.25,1.5,1.75,2,2.25,2.5}]
+\tikz [very thick] {
+ \pgfanimateattribute{motion}{
+ whom = node, begin on = {click},
+ along = \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0mm}{5mm}},
+ entry = {0s}{0}, entry = {1s}{0.5}, entry = {2s}{0.25}, entry={3s}{1} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Click me!}; }
+\end{codeexample}
+ \end{key}
+
+ \begin{key}{/pgf/animation/rotate along=\meta{Boolean} (default true)}
+ When set to |true|, the |along| key additionally adds a rotation that
+ varies in such a way that a tangent to the path always points right.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [very thick] {
+ \pgfanimateattribute{motion}{
+ whom = node, begin on = {click},
+ rotate along = true,
+ along = \pgfpathmoveto {\pgfpointorigin}
+ \pgfpathcurveto{\pgfpoint{5mm}{0cm}}{\pgfpoint{5mm}{0cm}}
+ {\pgfpoint{5mm}{5mm}},
+ entry = {0s}{0}, entry = {2s}{1} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Click me!}; }
+\end{codeexample}
+ \end{key}
+\end{animateattribute}
+
+The final method of changing the transformation matrix is to animate a
+\emph{view.}
+
+\begin{animateattribute}{view}
+ A view is a canvas transformation that shifts and scales the canvas in such
+ a way that a certain rectangle ``matches'' another rectangle: The idea is
+ that you ``look through'' a ``window'' (the view) and ``see'' a certain
+ area of the canvas. View animation do not allow you to do anything that
+ cannot also be done using the |translate| and |scale| keys in combination,
+ but it often much more natural to animate which area of a graphic you wish
+ to see than to compute and animate a scaling and shift explicitly.
+
+ In order to use a view, you first need to create a view, which is done
+ using a |{pgfviewboxscope}|, see Section~\ref{section-base-view}, which is
+ used by the |view| library internally. You can then animate the view using
+ the |view| attribute. The values passed to the |entry| key must be two
+ \pgfname-points, each surrounded by parentheses.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2},animation bb={(1.1,-0.9) rectangle (2.9,0.9)}]
+\tikz [very thick] {
+ \pgfanimateattribute{view}{
+ whom = me.view, begin on = {click, of next=node}, freeze at end,
+ entry = {0s}{{\pgfpoint{0mm}{0mm}}{\pgfpoint{20mm}{20mm}}},
+ entry = {2s}{{\pgfpoint{10mm}{10mm}}{\pgfpoint{15mm}{15mm}}} }
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+
+ \draw [green!50!black] (1.2,-0.8) rectangle (2.7,0.8);
+ \begin{scope}[name = me, view = {(0,0) (2,2) at (1.2,-0.8) (2.7,0.8)}]
+ \draw [red] (10mm,10mm) rectangle (15mm,15mm);
+ \node at (10mm,10mm) [circle, fill=red, text=white, font=\tiny] {red};
+ \end{scope}
+}
+\end{codeexample}
+
+\begin{codeexample}[width=2cm]
+\tikz [very thick] {
+ \pgfanimateattribute{view}{
+ whom = me.view, begin on = {click, of next=n1}, freeze at end,
+ entry = {0s}{\pgfpoint{0mm}{0mm}}{\pgfpoint{2cm}{2cm}},
+ entry = {2s}{{\pgfpoint{5mm}{5mm}}{\pgfpoint{15mm}{20mm}}} }
+ \pgfanimateattribute{view}{
+ whom = me.view, begin on = {click, of next=n2}, freeze at end,
+ entry = {0s}{\pgfpoint{0mm}{0mm}}{\pgfpoint{2cm}{2cm}},
+ entry = {2s}{{\pgfpoint{10mm}{10mm}}{\pgfpoint{15mm}{15mm}}} }
+ \node (n1) at (0,0) [fill = blue!20, draw = blue, circle] {Zoom blue};
+ \node (n2) at (2,0) [fill = blue!20, draw = blue, circle] {Zoom red};
+
+ \draw [green!50!black] (4,0) rectangle (6,2);
+ \begin{scope}[name = me, view = {(0,0) (2,2) at (4,0) (6,2)}]
+ \draw [blue] (5mm,5mm) rectangle (15mm,20mm);
+ \node at (5mm,5mm) [circle, fill=blue, text=white] {blue};
+
+ \draw [red] (10mm,10mm) rectangle (15mm,15mm);
+ \node at (10mm,10mm) [circle, fill=red, text=white, font=\tiny] {red};
+ \end{scope}
+}
+\end{codeexample}
+ %
+\end{animateattribute}
+
+
+\subsection{Commands for Specifying Timing: Beginnings and Endings}
+
+Using the |entry| key repeatedly, you specify a timeline: The \meta{time} used
+with the first use of the |entry| key in a timeline is the start time and the
+\meta{time} in the last |entry| key is the stop time. However, this leaves open
+then question of when the whole timeline is to be started: The moment the
+document is opened? When the page is displayed? When the user scrolls to the
+to-be-animated object? When some other object is clicked? The key |begin|, and
+also the key |end|, allow you to specify answers to these questions.
+
+\begin{key}{/pgf/animation/begin=\meta{time}}
+ This key specifies when the ``moment |0s|'' should be relative to the
+ moment when the current graphic is first displayed. You can use this key
+ multiple times, in this case the timeline is restarted for each of the
+ times specified (if it is already running, it will be reset). If no |begin|
+ key is given at all, the effect is the same as if |begin=0s| had been
+ specified.
+
+ It is permissible to set \meta{time} to a negative value.
+\end{key}
+
+\begin{key}{/pgf/animation/end=\meta{time}}
+ This key will truncate the timeline so that it ends \meta{time} after the
+ display of the graphic, provided the timeline begins before the specified
+ end time. For instance, if you specify a timeline starting at 2\,s and
+ ending at 5\,s and you set |begin| to 1\,s and |end| to 4\,s, the timeline
+ will run, relative to the moment when the graphic is displayed from 3\,s to
+ 4\,s.
+ %
+\begin{codeexample}[width=3cm]
+\tikz [very thick] {
+ \pgfanimateattribute{rotate}{
+ whom = node, begin = 2s, end = 4s,
+ entry = {1s}{0}, entry = {2s}{90}, entry = {3s}{180}, entry = {4s}{270} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Turn after 3s!}; }
+\end{codeexample}
+ %
+\end{key}
+
+It is not immediately clear what should happen with the attribute of an object
+when an animation ends: Should it revert to its original value ``as if there
+had never been an animation'' or should it ``stay at the last value''? The
+following key governs what should happen:
+
+\begin{key}{/pgf/animation/freeze at end=\meta{true or false} (default true, initially false)}
+ When set to |true|, whenever a timeline ends (either because the last time
+ of timeline has been reached or because an |end| or |end of| key have ended
+ it prematurely), the last value the attribute had because of the animation
+ ``stays put''. When set to |false|, which is the initial value, once an
+ animation ends, its effect will be removed ``as if it never happened''.
+ %
+\begin{codeexample}[animation list={0,1,2,3,4}]
+\tikz [very thick] {
+ \pgfanimateattribute{rotate}{
+ whom = node, begin on = {click}, freeze at end = false,
+ entry = {0s}{0}, entry = {2s}{90} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Here!}; }
+\end{codeexample}
+ %
+\begin{codeexample}[animation list={0,1,2,3,4}]
+\tikz [very thick] {
+ \pgfanimateattribute{rotate}{
+ whom = node, begin on = {click}, freeze at end,
+ entry = {0s}{0}, entry = {2s}{90} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Here!}; }
+\end{codeexample}
+ %
+\end{key}
+
+Instead of specifying the beginning of the timeline relative to the moment to
+to-be-animated graphic is displayed, you can also set the ``moment |0s|'' to
+the moment a specific \emph{event} happens using the following key:
+
+\begin{key}{/pgf/animation/begin on=\meta{options}}
+ Has the same effect as |/tikz/animate/option/begin on|, see
+ Section~\ref{section-anim-begin-end}.
+\end{key}
+
+When you use |begin on| to start an animation when a certain event is
+triggered, it is not clear what should happen when the event is triggered
+\emph{again}. Should this be ignored completely? Should it only be ignored
+while the animation is running? The following key allows you to specify when
+should happen:
+
+\begin{key}{/pgf/animation/restart=\meta{choice} (default true)}
+ Has the same effect as |/tikz/animate/option/restart|, see
+ Section~\ref{section-anim-begin-end}.
+\end{key}
+
+Just like |begin on| specifies when a timeline begins relative to some event,
+the |end on| allows you to stop is early when some event happens:
+
+\begin{key}{/pgf/animation/end on=\meta{options}}
+ Works exactly like |begin on|, one possible end of the timeline is
+ specified using the \meta{options}.
+\end{key}
+
+
+\subsection{Commands for Specifying Timing: Repeats}
+
+Normally, a timeline is displayed once and then ends. You can, however, request
+that the timeline should be repeated a certain number of times or indefinitely.
+
+\begin{key}{/pgf/animation/repeats=\meta{specification}}
+ Use this key to specify that the timeline animation should repeat at the
+ end. The \meta{specification} must consist of two parts, each of which may
+ be empty. The first part is one of the following:
+ %
+ \begin{itemize}
+ \item Empty, in which case the timeline repeats forever.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5}]
+\tikz [very thick] {
+ \pgfanimateattribute{rotate}{
+ whom = node, begin on = {click}, repeats,
+ entry = {0s}{0}, entry = {2s}{90} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Click me!}; }
+\end{codeexample}
+ %
+ \item A \meta{number} (like |2| or |3.25|), in which case the timeline
+ repeats \meta{number} times.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5}]
+\tikz [very thick] {
+ \pgfanimateattribute{rotate}{
+ whom = node, begin on = {click}, repeats = 1.75,
+ entry = {0s}{0}, entry = {2s}{90} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Click me!}; }
+\end{codeexample}
+ %
+ \item The text ``|for| \meta{time}'' (like |for 2s| or |for 300ms|), in
+ which case the timeline repeats however often necessary so that it
+ stops exactly after \meta{time}.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5}]
+\tikz [very thick] {
+ \pgfanimateattribute{rotate}{
+ whom = node, begin on = {click}, repeats = for 3.5s,
+ entry = {0s}{0}, entry = {2s}{90} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Click me!}; }
+\end{codeexample}
+ \end{itemize}
+ %
+ The second part of the specification must be one of the following:
+ %
+ \begin{itemize}
+ \item Empty, in which case each time the timeline is restarted, the
+ attribute's value undergoes the same series of values it did
+ previously.
+ \item The text |accumulating|. This has the effect that each time the
+ timeline is restarted, the attribute values specified by the
+ timeline are \emph{added} to the value from the previous
+ iteration(s). A typical example is an animation that shifts a scope
+ by, say, 1\,cm over a time of 1\,s. Now, if you repeat this five
+ times, normally the scope will shift 1\,cm for 1\,s then ``jump
+ back'', shift again, jump back, and so on for five times. In
+ contrast, when the repeats are accumulating, the scope will move by
+ 5\,cm over 5\,s in total.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5}]
+\tikz [very thick] {
+ \pgfanimateattribute{rotate}{
+ whom = node, begin on = {click}, repeats = accumulating,
+ entry = {0s}{0}, entry = {2s}{90} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Click me!}; }
+\end{codeexample}
+ %
+\begin{codeexample}[animation list={1,2,3,4,5}]
+\tikz [very thick] {
+ \pgfanimateattribute{rotate}{
+ whom = node, begin on = {click}, repeats = 2 accumulating,
+ entry = {0s}{0}, entry = {2s}{90} }
+ \node (node) [fill = blue!20, draw = blue, circle] {Click me!}; }
+\end{codeexample}
+ \end{itemize}
+\end{key}
+
+\begin{key}{/pgf/animation/repeat=\meta{specification}}
+ This is an alias for |repeats|.
+\end{key}
+
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: "pgfmanual"
+%%% End:
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 15926efe567..b26efb1b87c 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
@@ -11,64 +11,61 @@
\section{Defining New Arrow Tip Kinds}
\label{section-arrows}
-
\subsection{Overview}
-In present section we have a look at how you can define new arrow tips
-for use in \pgfname. The low-level commands for selecting which arrow
-tips are to be used have already been described in
-Section~\ref{section-tips}, the general syntax rules for using arrows
-are detailed in Section~\ref{section-tikz-arrows}. Although
-Section~\ref{section-tikz-arrows} describes the use of arrows in
-\tikzname, in reality, \tikzname\ itself does not actually do anything
-about arrow tips; all of the functionality is implemented on the
-\pgfname\ level in the commands described in
-Section~\ref{section-tikz-arrows}. Indeed, even the |/.tip| key
-handler described in Section~\ref{section-tikz-arrows} is actually
-implemented on the \pgfname\ layer.
-
-What has \emph{not} yet been covered is how you can actually define a
-complete new arrow tip. In \pgfname, arrows are ``meta-arrows'' in the
-same way that fonts in \TeX\ are ``meta-fonts.'' When a meta-arrow is
-resized, it is not simply scaled, but a possibly complicated
-transformation is applied to the size.
-
-A meta-font is not one particular font at a specific size with a
-specific stroke width (and with a large number of other parameters
-being fixed). Rather, it is a ``blueprint'' (actually, more like a
-program) for generating such a font at a particular size and
-width. This allows the designer of a meta-font to make sure that, say,
-the font is somewhat thicker and wider at very small sizes. To
-appreciate the difference: Compare the following texts: ``Berlin'' and
-``\tikz{\node [scale=2,inner sep=0pt,outer sep=0pt]{\tiny
- Berlin};}''. The first is a ``normal'' text, the second is the tiny
-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.
-
-\pgfname's meta-arrows work in a similar fashion: The shape of an
-arrow tip can vary according to a great number of parameters, the line
-width of the arrow tip being one of them. Thus, an arrow tip drawn at
-a line width of 5pt will typically \emph{not} be five times as large
-as an arrow tip of line width 1pt. Instead, the size of the arrow will
-get bigger only slowly as the line width increases.
+In present section we have a look at how you can define new arrow tips for use
+in \pgfname. The low-level commands for selecting which arrow tips are to be
+used have already been described in Section~\ref{section-tips}, the general
+syntax rules for using arrows are detailed in
+Section~\ref{section-tikz-arrows}. Although Section~\ref{section-tikz-arrows}
+describes the use of arrows in \tikzname, in reality, \tikzname\ itself does
+not actually do anything about arrow tips; all of the functionality is
+implemented on the \pgfname\ level in the commands described in
+Section~\ref{section-tikz-arrows}. Indeed, even the |/.tip| key handler
+described in Section~\ref{section-tikz-arrows} is actually implemented on the
+\pgfname\ layer.
+
+What has \emph{not} yet been covered is how you can actually define a complete
+new arrow tip. In \pgfname, arrows are ``meta-arrows'' in the same way that
+fonts in \TeX\ are ``meta-fonts''. When a meta-arrow is resized, it is not
+simply scaled, but a possibly complicated transformation is applied to the
+size.
+
+A meta-font is not one particular font at a specific size with a specific
+stroke width (and with a large number of other parameters being fixed). Rather,
+it is a ``blueprint'' (actually, more like a program) for generating such a
+font at a particular size and width. This allows the designer of a meta-font to
+make sure that, say, the font is somewhat thicker and wider at very small
+sizes. To appreciate the difference: Compare the following texts: ``Berlin''
+and ``\tikz{\node [scale=2,inner sep=0pt,outer sep=0pt]{\tiny Berlin};}''. The
+first is a ``normal'' text, the second is the tiny 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.
+
+\pgfname's meta-arrows work in a similar fashion: The shape of an arrow tip can
+vary according to a great number of parameters, the line width of the arrow tip
+being one of them. Thus, an arrow tip drawn at a line width of 5pt will
+typically \emph{not} be five times as large as an arrow tip of line width 1pt.
+Instead, the size of the arrow will get bigger only slowly as the line width
+increases.
To appreciate the difference, here are the |Latex| and
-|Classical TikZ Rightarrow| arrows, as drawn by \pgfname\ at four different sizes:
+|Classical TikZ Rightarrow| arrows, as drawn by \pgfname\ at four different
+sizes:
\medskip
\begin{tikzpicture}[1/.tip=Latex, 2/.tip=Classical TikZ Rightarrow]
- \draw[-1, line width=0.1pt] (0pt,0ex) -- +(3,0) node[thin,right] {line width is 0.1pt};
- \draw[-1, line width=0.4pt] (0pt,-2em) -- +(3,0) node[thin,right] {line width is 0.4pt};
- \draw[-1, line width=1.2pt] (0pt,-4em) -- +(3,0) node[thin,right] {line width is 1.2pt};
- \draw[-1, line width=5pt] (0pt,-6em) -- +(3,0) node[thin,right] {line width is 5pt};
-
- \draw[-2, line width=0.1pt] (6cm,0ex) -- +(3,0) node[thin,right] {line width is 0.1pt};
- \draw[-2, line width=0.4pt] (6cm,-2em) -- +(3,0) node[thin,right] {line width is 0.4pt};
- \draw[-2, line width=1.2pt] (6cm,-4em) -- +(3,0) node[thin,right] {line width is 1.2pt};
- \draw[-2, line width=5pt] (6cm,-6em) -- +(3,0) node[thin,right] {line width is 5pt};
+ \draw[-1, line width=0.1pt] (0pt,0ex) -- +(3,0) node[thin,right] {line width is 0.1pt};
+ \draw[-1, line width=0.4pt] (0pt,-2em) -- +(3,0) node[thin,right] {line width is 0.4pt};
+ \draw[-1, line width=1.2pt] (0pt,-4em) -- +(3,0) node[thin,right] {line width is 1.2pt};
+ \draw[-1, line width=5pt] (0pt,-6em) -- +(3,0) node[thin,right] {line width is 5pt};
+
+ \draw[-2, line width=0.1pt] (6cm,0ex) -- +(3,0) node[thin,right] {line width is 0.1pt};
+ \draw[-2, line width=0.4pt] (6cm,-2em) -- +(3,0) node[thin,right] {line width is 0.4pt};
+ \draw[-2, line width=1.2pt] (6cm,-4em) -- +(3,0) node[thin,right] {line width is 1.2pt};
+ \draw[-2, line width=5pt] (6cm,-6em) -- +(3,0) node[thin,right] {line width is 5pt};
\end{tikzpicture}
\medskip
@@ -88,434 +85,431 @@ Here, by comparison, are the same arrows when they are simply ``resized'':
\end{tikzpicture}
\bigskip
-As can be seen, simple scaling produces arrow tips that are way too
-large at larger sizes and way too small at smaller sizes.
+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.
+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{Terminology}
\label{section-arrow-terminology}
-Before we have a look at the exact commands used for defining arrow
-tips, we need to fix some terminology. Consider the following drawing
-of an arrow tip where the arrow tip is drawn transparently so that we
-can see what is ``happening behind it'':
-
+Before we have a look at the exact commands used for defining arrow tips, we
+need to fix some terminology. Consider the following drawing of an arrow tip
+where the arrow tip is drawn transparently so that we can see what is
+``happening behind it'':
+%
\begin{tikzpicture}
- \draw [red!50, ,line width=1cm] (0,0) -- (4,0);
- \path [tips, opacity=.25,line width=1cm, -{Stealth[black,line width=0pt,length=4cm, width=4cm, inset=1cm]}] (0,0) -- (6,0);
-
- \draw [->,thick] (1,0) -- (8,0) node [right] {$x$-axis};
- \draw [->,thick] (5,-2.25) -- (5,2.25) node [above] {$y$-axis};
-
- \foreach \i in {-3,-2,-1,1,2} \draw (\i+5,-1mm) -- (\i+5,1mm) node [above] {\small$\i$};
- \foreach \i in {-2,-1,1,2} \draw (49mm,\i) -- (51mm,\i) node [right] {\small$\i$};;
+ \draw [red!50, ,line width=1cm] (0,0) -- (4,0);
+ \path [tips, opacity=.25,line width=1cm, -{Stealth[black,line width=0pt,length=4cm, width=4cm, inset=1cm]}] (0,0) -- (6,0);
+
+ \draw [->,thick] (1,0) -- (8,0) node [right] {$x$-axis};
+ \draw [->,thick] (5,-2.25) -- (5,2.25) node [above] {$y$-axis};
+
+ \foreach \i in {-3,-2,-1,1,2} \draw (\i+5,-1mm) -- (\i+5,1mm) node [above] {\small$\i$};
+ \foreach \i in {-2,-1,1,2} \draw (49mm,\i) -- (51mm,\i) node [right] {\small$\i$};;
\end{tikzpicture}
-I have also added a coordinate system. The code for drawing an arrow
-tip always draws it in the way shown above: Pointing right along the
-$x$-axis.
+I have also added a coordinate system. The code for drawing an arrow tip always
+draws it in the way shown above: Pointing right along the $x$-axis.
We will use the following terminology:
+%
\begin{itemize}
-\item The point where tip of the arrow ends is called the
- \emph{tip end}. It is at $(1,0)$ in our example and we always
- assume it to lie on the $x$-axis, so we just treat it as a distance,
- 1 in this case. This is the position where the original path was
- supposed to end (so if the arrow tip had not been added to the red
- path, it would have ended here).
-\item The \emph{back end} of the arrow is where a vertical line just
- to the left of the arrow intersects the $x$-axis. In our case, this
- is the point $(-3,0)$ and again we treat it as a distance, $-3$ in
- this case.
-\item The \emph{line end} is the position where the path now
- ends. This should be a position inside the arrow head that gets
- ``covered'' by the path. Note that a path may have a round or a rect
- head and should still be covered. Clearly, necessary shortening of
- the path will be the difference between the tip end and the line
- end.
-\item The \emph{visual back end} is the position where the path and
- the the arrow head ``meet last'' on the path. In our case, because
- of the inset, the visual back end is not the same as the back end:
- The arrow ends ``visually'' at $(-2,0)$. The difference between the
- back end and the visual back end is important when the arrow tip is
- flexed, see Section~\ref{section-arrow-flex} for an explanation of
- flexing.
-\item There is also a \emph{visual tip end}, the counterpart of the
- visual back end for the front. In our case, the visual tip end and
- the tip end obviously coincide, but if we were to reverse the arrow
- tip, the visual tip end would be different form the tip end (while
- the visual back end would then coincide with the new back end).
-\item There are four points that make up the \emph{convex hull} of the
- arrow tip: $(1,0)$, $(-3,2)$, and $(-3,-2)$.
-
- Normally, \pgfname\ automatically keeps track of a bounding box of
- everything you draw. However, since arrow tips are drawn so often,
- \pgfname\ caches the code needing for drawing arrow tips internally
- and because of this cache it cannot determine the size of the arrow
- tip just based on the drawing commands used for drawing the
- tip. Instead, a convex hull of the arrow tip must be explicitly
- provided in the definition.
+ \item The point where tip of the arrow ends is called the \emph{tip end}.
+ It is at $(1,0)$ in our example and we always assume it to lie on the
+ $x$-axis, so we just treat it as a distance, 1 in this case. This is
+ the position where the original path was supposed to end (so if the
+ arrow tip had not been added to the red path, it would have ended
+ here).
+ \item The \emph{back end} of the arrow is where a vertical line just to the
+ left of the arrow intersects the $x$-axis. In our case, this is the
+ point $(-3,0)$ and again we treat it as a distance, $-3$ in this case.
+ \item The \emph{line end} is the position where the path now ends. This
+ should be a position inside the arrow head that gets ``covered'' by the
+ path. Note that a path may have a round or a rect head and should still
+ be covered. Clearly, necessary shortening of the path will be the
+ difference between the tip end and the line end.
+ \item The \emph{visual back end} is the position where the path and the the
+ arrow head ``meet last'' on the path. In our case, because of the
+ inset, the visual back end is not the same as the back end: The arrow
+ ends ``visually'' at $(-2,0)$. The difference between the back end and
+ the visual back end is important when the arrow tip is flexed, see
+ Section~\ref{section-arrow-flex} for an explanation of flexing.
+ \item There is also a \emph{visual tip end}, the counterpart of the visual
+ back end for the front. In our case, the visual tip end and the tip end
+ obviously coincide, but if we were to reverse the arrow tip, the visual
+ tip end would be different form the tip end (while the visual back end
+ would then coincide with the new back end).
+ \item There are four points that make up the \emph{convex hull} of the
+ arrow tip: $(1,0)$, $(-3,2)$, and $(-3,-2)$.
+
+ Normally, \pgfname\ automatically keeps track of a bounding box of
+ everything you draw. However, since arrow tips are drawn so often,
+ \pgfname\ caches the code needing for drawing arrow tips internally and
+ because of this cache it cannot determine the size of the arrow tip
+ just based on the drawing commands used for drawing the tip. Instead, a
+ convex hull of the arrow tip must be explicitly provided in the
+ definition.
\end{itemize}
-When you design a new arrow tip, all of the above parameters must be
-defined.
+When you design a new arrow tip, all of the above parameters must be defined.
-\subsection{Caching and Rendering of Arrows}
-As a last preparation for the description of the commands for
-declaring arrows, it is important to understand the exact process by
-which \pgfname\ draws arrows.
+\subsection{Caching and Rendering of Arrows}
+As a last preparation for the description of the commands for declaring arrows,
+it is important to understand the exact process by which \pgfname\ draws
+arrows.
+%
\begin{enumerate}
-\item First, you have to define an arrow tip kind using
- |\pgfdeclarearrow{name=foo,...|. This will tell \pgfname\ that %}
- |foo| is now the name of an arrow tip. In particular, the
- parser for arrow tip specifications will now treat |foo| as the name
- of an arrow tip and will not try to consider |f|, |o|, and |o| as
- the names of single-char shorthands.
-
- Other than storing the definitions in the declaration internally,
- this command has little other effect. In particular, no drawing or
- other processing takes place.
-\item Now assume that at some point the arrow tip |foo| is actually
- used. In this case, certain options may have been set, for instance
- the user may have requested the arrow tip
- |foo[length=5pt,open]|. What happens next depends on whether it is
- the first time the arrow tip |foo| is used with \emph{these exact
- options} ornot.
-\item Assume that is the first time |foo| is requested at a length of
- 5pt and in an ``open'' version. \pgfname\ now retrieves the
- definition of the arrow tip kind that it stored in the first step
- and executes the so-called \emph{setup} code. When this code is
- executed, all the options will be in force (for
- instance, |\pgfarrowlength| will equal |5pt| in our case). The job
- of the setup code is two-fold: First, it needs to compute all of the
- parameters listed in Section~\ref{section-arrow-terminology}, that
- is, it has to compute where the tip end will lie in the arrow tip's
- coordinate system \emph{at the particular size of 5pt}, where the
- back end will be, where the convex hull points lie, and so
- on. Second, the setup code should precompute values that will be
- important for constructing the path of the arrow. In our example,
- there is little to do in this regard, but for more complicated
- arrows, all time-consuming preparations are done now.
-
- It is \emph{not} the job of the setup to actually draw the arrow
- tip, only to ``prepare'' this as much as possible.
-
- The setup code will always be executed only once for each arrow tip
- kind for a given set of options. Thus, when a user uses
- |foo[length=5pt,open]| once more later anywhere in the document, the
- setup code will not be executed again.
-\item The next thing that happens is that we have a look at the
- \emph{drawin code} stored in the |code| field of the arrow. In our
- example, the drawing code would consist of creating a filled path
- with four straight segments.
-
- In most cases, what happens now is that the drawing code is executed in a
- special sandbox in which the low-level driver commands that do the
- actual drawing are intercepted and stored away in a so-called
- \emph{cache}. Once such a cache has been created, its contents will
- be reused whenever |foo[length=5pt,open]| is requested by a user and
- just like the setup code, the drawing code will not be executed
- again.
-
- There are, however, two cases in which the drawing code gets executed
- each time the arrow is used: First, an arrow tip kind can specify
- that this should always happen by saying |cachable=false| in its
- definition. This is necessary if the drawing code contains
- low-level drawing commands that cannot be intercepted such as a use
- of |\pgftext| for arrow tips that ``contain text.'' Second, when the
- |bend| option is used, the same arrow tip will look different each
- time it is used, namely in dependence on the exact curvature of the
- path to which it is added.
-
- Because the drawing code may be executed several times, while the
- setup code may not, we must find a way to ``communicate'' the
- values computed by the setup code to the drawing code. This is done
- by explicitly calling |\pgfarrowssave| inside the setup
- code. Whatever is ``saved'' in this way is restored each time before
- the drawing code is executed.
+ \item First, you have to define an arrow tip kind using
+ |\pgfdeclarearrow{name=foo,...|. This will tell \pgfname\ that |foo| is %}
+ now the name of an arrow tip. In particular, the parser for arrow tip
+ specifications will now treat |foo| as the name of an arrow tip and
+ will not try to consider |f|, |o|, and |o| as the names of single-char
+ shorthands.
+
+ Other than storing the definitions in the declaration internally, this
+ command has little other effect. In particular, no drawing or other
+ processing takes place.
+ \item Now assume that at some point the arrow tip |foo| is actually used.
+ In this case, certain options may have been set, for instance the user
+ may have requested the arrow tip |foo[length=5pt,open]|. What happens
+ next depends on whether it is the first time the arrow tip |foo| is
+ used with \emph{these exact options} or not.
+ \item Assume that is the first time |foo| is requested at a length of 5pt
+ and in an ``open'' version. \pgfname\ now retrieves the definition of
+ the arrow tip kind that it stored in the first step and executes the
+ so-called \emph{setup} code. When this code is executed, all the
+ options will be in force (for instance, |\pgfarrowlength| will equal
+ |5pt| in our case). The job of the setup code is two-fold: First, it
+ needs to compute all of the parameters listed in
+ Section~\ref{section-arrow-terminology}, that is, it has to compute
+ where the tip end will lie in the arrow tip's coordinate system
+ \emph{at the particular size of 5pt}, where the back end will be, where
+ the convex hull points lie, and so on. Second, the setup code should
+ precompute values that will be important for constructing the path of
+ the arrow. In our example, there is little to do in this regard, but
+ for more complicated arrows, all time-consuming preparations are done
+ now.
+
+ It is \emph{not} the job of the setup to actually draw the arrow tip,
+ only to ``prepare'' this as much as possible.
+
+ The setup code will always be executed only once for each arrow tip
+ kind for a given set of options. Thus, when a user uses
+ |foo[length=5pt,open]| once more later anywhere in the document, the
+ setup code will not be executed again.
+ \item The next thing that happens is that we have a look at the
+ \emph{drawin code} stored in the |code| field of the arrow. In our
+ example, the drawing code would consist of creating a filled path with
+ four straight segments.
+
+ In most cases, what happens now is that the drawing code is executed in
+ a special sandbox in which the low-level driver commands that do the
+ actual drawing are intercepted and stored away in a so-called
+ \emph{cache}. Once such a cache has been created, its contents will be
+ reused whenever |foo[length=5pt,open]| is requested by a user and just
+ like the setup code, the drawing code will not be executed again.
+
+ There are, however, two cases in which the drawing code gets executed
+ each time the arrow is used: First, an arrow tip kind can specify that
+ this should always happen by saying |cachable=false| in its definition.
+ This is necessary if the drawing code contains low-level drawing
+ commands that cannot be intercepted such as a use of |\pgftext| for
+ arrow tips that ``contain text''. Second, when the |bend| option is
+ used, the same arrow tip will look different each time it is used,
+ namely in dependence on the exact curvature of the path to which it is
+ added.
+
+ Because the drawing code may be executed several times, while the setup
+ code may not, we must find a way to ``communicate'' the values computed
+ by the setup code to the drawing code. This is done by explicitly
+ calling |\pgfarrowssave| inside the setup code. Whatever is ``saved''
+ in this way is restored each time before the drawing code is executed.
\end{enumerate}
-As can be seen, the process is a bit involved, but it leads to
-a reasonably fast arrow tip management.
+As can be seen, the process is a bit involved, but it leads to a reasonably
+fast arrow tip management.
\subsection{Declaring an Arrow Tip Kind}
\begin{command}{\pgfdeclarearrow\marg{config}}
- This command is both used to define a new arrow tip kind and to to
- declare a so-called shorthand. We have a look at the case that a
- complete new arrow tip kind is created and then have a look how the
- command can be used to create shorthands.
-
- \medskip
- \noindent\textbf{Defining a Complete New Arrow Tip Kind.}
- The \meta{config} is a key--value list in which different keys are
- used to setup the to-be defined arrow. The following keys can be given:
-
- \begin{itemize}
- \item \declare{|name|}|=|\meta{name} or |name=|\meta{start name}|-|\meta{end
- name}
-
- This defines the name of the arrow tip. It is legal to define an
- arrow tip a second time, in this case the previous definition will
- be overwritten in the current \TeX\ scope. It is customary to use
- a name with an uppercase fist letter for a ``complete'' arrow tip
- kind. Short names and lower case names should be used for
- shorthands that change their meaning inside a document, while
- arrow tips with uppercase first letters should not be redefined.
-
- If the name contains a hyphen, the second syntax is assumed and
- everything before the hyphen will be the name used in start arrow
- specifications, while the text after the hyphen is the name used
- in end specifications.
- \item \declare{|parameters|}|=|\marg{list of macros}
-
- As explained earlier, an arrow tip typically needs to be redrawn
- each time an option like |length| or |inset| is changed. However,
- for some arrow tips, the |inset| has no influence, while for other
- it is important whether the arrow is reversed or not. (How keys
- like |length| actually set \TeX\ dimensions like |\pgfarrowlength|
- is explained in Section~\ref{section-arrow-options}.)
-
- The job of the |parameters| key is to specify which dependencies
- the arrow tip has. Everything that will influence any of the
- parameters computed in the setup code or used in the drawing code
- should be listed here.
-
- The \meta{list of macros} will be used inside a
- |\csname|-|\endcsname| pair and should expand to the current
- values of the relevant parameters have. For example, if the arrow
- tip depends on the current value of |\pgfarrowlength| and
- |\pgfarrowwidth| only, then \meta{list of macros} should be set to
- |\the\pgfarrowlength,\the\pgfarrowwidth|. (Actually, the comma is
- optional, the \meta{list of macros} does not really have to be a
- list, just something that can be expanded unambiuously.)
-
- Note that the line width (|\pgflinewidth|) and the inner line
- width (|\pgfinnerlinewidth|) are always parameters and need not be
- specified in the |parameters|.
-
- It is important to get this parameter right. Otherwise, arrow tips
- may look wrong because \pgfname\ thinks that it can reuse some
- code when, in reality, this code actually depends on a parameter
- not listed here.
-
- \item \declare{|setup code|}|=|\marg{code}
-
- When an arrow tip is used, the value stored in |parameters| is
- expanded and it is tested whether the result was encountered
- before. If not, the \meta{code} gets executed (only this
- once). The code can now do aribtrarily complicated computations
- the prepare the later drawing of the arrow tip. Also the
- \meta{code} must specify the different tip and back ends and the
- convex hull points. This is done by calling the following macros
- inside the \meta{code}:
-
- \begin{command}{\pgfarrowssettipend\marg{dimension}}
- When this command is called inside the setup code of an arrow
- tip, it specifies that the tip of the drawn arrow will end
- exactly at \meta{dimension}. For example, for our earlier
- example of the large arrow tip, where the tip end was at 1cm, we
- would call
+ This command is both used to define a new arrow tip kind and to to declare
+ a so-called shorthand. We have a look at the case that a complete new arrow
+ tip kind is created and then have a look how the command can be used to
+ create shorthands.
+
+
+ \medskip
+ \noindent\textbf{Defining a Complete New Arrow Tip Kind.}
+ The \meta{config} is a key--value list in which different keys are used to
+ setup the to-be defined arrow. The following keys can be given:
+ %
+ \begin{itemize}
+ \item \declare{|name|}|=|\meta{name} or |name=|\meta{start
+ name}|-|\meta{end name}
+
+ This defines the name of the arrow tip. It is legal to define an
+ arrow tip a second time, in this case the previous definition will
+ be overwritten in the current \TeX\ scope. It is customary to use a
+ name with an uppercase fist letter for a ``complete'' arrow tip
+ kind. Short names and lower case names should be used for
+ shorthands that change their meaning inside a document, while arrow
+ tips with uppercase first letters should not be redefined.
+
+ If the name contains a hyphen, the second syntax is assumed and
+ everything before the hyphen will be the name used in start arrow
+ specifications, while the text after the hyphen is the name used in
+ end specifications.
+ \item \declare{|parameters|}|=|\marg{list of macros}
+
+ As explained earlier, an arrow tip typically needs to be redrawn
+ each time an option like |length| or |inset| is changed. However,
+ for some arrow tips, the |inset| has no influence, while for other
+ it is important whether the arrow is reversed or not. (How keys
+ like |length| actually set \TeX\ dimensions like |\pgfarrowlength|
+ is explained in Section~\ref{section-arrow-options}.)
+
+ The job of the |parameters| key is to specify which dependencies
+ the arrow tip has. Everything that will influence any of the
+ parameters computed in the setup code or used in the drawing code
+ should be listed here.
+
+ The \meta{list of macros} will be used inside a
+ |\csname|-|\endcsname| pair and should expand to the current values
+ of the relevant parameters have. For example, if the arrow tip
+ depends on the current value of |\pgfarrowlength| and
+ |\pgfarrowwidth| only, then \meta{list of macros} should be set to
+ |\the\pgfarrowlength,\the\pgfarrowwidth|. (Actually, the comma is
+ optional, the \meta{list of macros} does not really have to be a
+ list, just something that can be expanded unambiguously.)
+
+ Note that the line width (|\pgflinewidth|) and the inner line width
+ (|\pgfinnerlinewidth|) are always parameters and need not be
+ specified in the |parameters|.
+
+ It is important to get this parameter right. Otherwise, arrow tips
+ may look wrong because \pgfname\ thinks that it can reuse some code
+ when, in reality, this code actually depends on a parameter not
+ listed here.
+ \item \declare{|setup code|}|=|\marg{code}
+
+ When an arrow tip is used, the value stored in |parameters| is
+ expanded and it is tested whether the result was encountered
+ before. If not, the \meta{code} gets executed (only this once). The
+ code can now do arbitrarily complicated computations the prepare
+ the later drawing of the arrow tip. Also the \meta{code} must
+ specify the different tip and back ends and the convex hull points.
+ This is done by calling the following macros inside the
+ \meta{code}:
+ %
+ \begin{command}{\pgfarrowssettipend\marg{dimension}}
+ When this command is called inside the setup code of an arrow
+ tip, it specifies that the tip of the drawn arrow will end
+ exactly at \meta{dimension}. For example, for our earlier
+ example of the large arrow tip, where the tip end was at 1cm,
+ we would call
+ %
\begin{codeexample}[code only]
-\pgfarrowssettipend{1cm}
+\pgfarrowssettipend{1cm}
\end{codeexample}
- Note that for efficience reasons, the \meta{dimension} is not
- passed through |\pgfmathsetlength|; rather what happens is that
- |\pgf@x=|\meta{dimension} gets executed. In particular, you can
- pack further computations into the \meta{dimension} by simply
- starting it with a number and then appending some code that
- modifies |\pgf@x|. Here is an example where instead of 1cm we
- use $1\mathrm{cm} - \frac12\mathrm{linewidth}$ as the tip end:
+ %
+ Note that for efficiency reasons, the \meta{dimension} is not
+ passed through |\pgfmathsetlength|; rather what happens is that
+ |\pgf@x=|\meta{dimension} gets executed. In particular, you can
+ pack further computations into the \meta{dimension} by simply
+ starting it with a number and then appending some code that
+ modifies |\pgf@x|. Here is an example where instead of 1cm we
+ use $1\mathrm{cm} - \frac12\mathrm{linewidth}$ as the tip end:
+ %
\begin{codeexample}[code only]
-\pgfarrowssettipend{1cm\advance\pgf@x by-.5\pgflinewidth}
+\pgfarrowssettipend{1cm\advance\pgf@x by-.5\pgflinewidth}
\end{codeexample}
- If the command is not called at all inside the setup code, the
- tip end is set to |0pt|.
- \end{command}
-
- \begin{command}{\pgfarrowssetbackend\marg{dimension}}
- Works like the command for the tip end, only it sets the back
- end. In our example we would call
+ %
+ If the command is not called at all inside the setup code, the
+ tip end is set to |0pt|.
+ \end{command}
+
+ \begin{command}{\pgfarrowssetbackend\marg{dimension}}
+ Works like the command for the tip end, only it sets the back
+ end. In our example we would call
+ %
\begin{codeexample}[code only]
-\pgfarrowssettipend{-3cm}
+\pgfarrowssettipend{-3cm}
\end{codeexample}
- Defaults to |0pt|.
- \end{command}
-
- \begin{command}{\pgfarrowssetlineend\marg{dimension}}
- Sets the line end, so in the example we have
- |\pgfarrowssettipend{-1cm}|. Default to |0pt|.
- \end{command}
-
- \begin{command}{\pgfarrowssetvisualbackend\marg{dimension}}
- Sets the visual back end, |\pgfarrowssetvisualbackend{-2cm}| in
- our example. Default to the value of the normal back end.
- \end{command}
-
- \begin{command}{\pgfarrowssetvisualtipend\marg{dimension}}
- Sets the visual tip end. Default to the value of the normal tip
- end and, thus, we need not set it in our example.
- \end{command}
-
- \begin{command}{\pgfarrowshullpoint\marg{x dimension}\marg{y dimension}}
- Adds a point to the convex hull of the arrow tip. As for the
- previous commands, no math parsing is done; instead \pgfname\
- says |\pgf@x=|\meta{x dimension} and then |\pgf@y=|\meta{y
- dimension}. Thus, both ``dimensions'' can contain code for
- advancing and thus modifying |\pgf@x| and |\pgf@y|.
-
- In our example we would write
+ %
+ Defaults to |0pt|.
+ \end{command}
+
+ \begin{command}{\pgfarrowssetlineend\marg{dimension}}
+ Sets the line end, so in the example we have
+ |\pgfarrowssettipend{-1cm}|. Default to |0pt|.
+ \end{command}
+
+ \begin{command}{\pgfarrowssetvisualbackend\marg{dimension}}
+ Sets the visual back end, |\pgfarrowssetvisualbackend{-2cm}| in
+ our example. Default to the value of the normal back end.
+ \end{command}
+
+ \begin{command}{\pgfarrowssetvisualtipend\marg{dimension}}
+ Sets the visual tip end. Default to the value of the normal tip
+ end and, thus, we need not set it in our example.
+ \end{command}
+
+ \begin{command}{\pgfarrowshullpoint\marg{x dimension}\marg{y dimension}}
+ Adds a point to the convex hull of the arrow tip. As for the
+ previous commands, no math parsing is done; instead \pgfname\
+ says |\pgf@x=|\meta{x dimension} and then |\pgf@y=|\meta{y
+ dimension}. Thus, both ``dimensions'' can contain code for
+ advancing and thus modifying |\pgf@x| and |\pgf@y|.
+
+ In our example we would write
+ %
\begin{codeexample}[code only]
\pgfarrowshullpoint{1cm}{0pt}
\pgfarrowshullpoint{-3cm}{2cm}
\pgfarrowshullpoint{-3cm}{-2cm}
\end{codeexample}
- \end{command}
+ \end{command}
+ \begin{command}{\pgfarrowsupperhullpoint\marg{x dimension}\marg{y dimension}}
+ This command works like the previous command, only it normally
+ adds \emph{two} points to the convex hull: First, the point
+ $(\meta{x dimension},\meta{y dimension})$ and, secondly, the
+ point $(\meta{x dimension},-\meta{y dimension})$. However, the
+ second point is only added if the arrow is not a harpoon.
- \begin{command}{\pgfarrowsupperhullpoint\marg{x dimension}\marg{y dimension}}
- This command works like the previous command, only it normally
- adds \emph{two} points to the convex hull: First, the point $(\meta{x
- dimension},\meta{y dimension})$ and, secondly, the point $(\meta{x
- dimension},-\meta{y dimension})$. However, the second point is
- only added if the arrow is not a harpoon.
-
- Thus, in our example we could simplify the convex hull to
+ Thus, in our example we could simplify the convex hull to
+ %
\begin{codeexample}[code only]
\pgfarrowshullpoint{1cm}{0pt}
\pgfarrowsupperhullpoint{-3cm}{2cm}
\end{codeexample}
- If the \meta{y dimension} is zero or less, only one point,
- namely $(\meta{x dimension},\meta{y dimension})$, is added to
- the hull. Thus, we could also have used the upper convex hull
- command in the first of the two of the above commands.
- \end{command}
-
- \begin{command}{\pgfarrowssave\marg{macro}}
- As explained earlier, the setup code needs to ``communicate''
- with the drawing code via ``saved values.'' This command get the
- name of a macro and will store the value this macro had
- internally. Then, each time drawing code is executed, the value
- of this macro will be restored.
- \end{command}
-
- \begin{command}{\pgfarrowssavethe\marg{register}}
- Works like |\pgfarrowssave|, only the parameter must be a
- register and |\the|\meta{register} will be saved.
- Typically, you will write something like
+ %
+ If the \meta{y dimension} is zero or less, only one point,
+ namely $(\meta{x dimension},\meta{y dimension})$, is added to
+ the hull. Thus, we could also have used the upper convex hull
+ command in the first of the two of the above commands.
+ \end{command}
+
+ \begin{command}{\pgfarrowssave\marg{macro}}
+ As explained earlier, the setup code needs to ``communicate''
+ with the drawing code via ``saved values''. This command get
+ the name of a macro and will store the value this macro had
+ internally. Then, each time drawing code is executed, the value
+ of this macro will be restored.
+ \end{command}
+
+ \begin{command}{\pgfarrowssavethe\marg{register}}
+ Works like |\pgfarrowssave|, only the parameter must be a
+ register and |\the|\meta{register} will be saved. Typically,
+ you will write something like
+ %
\begin{codeexample}[code only]
\pgfarrowssavethe{\pgfarrowlength}
\pgfarrowssavethe{\pgfarrowwidth}
\end{codeexample}
- To ensure that inside the drawing code the the dimension
- registers |\pgfarrowlength| and |\pgfarrowwidth| are setup with
- the values they had during the setup.
- \end{command}
-
- \item \declare{|drawing code|}|=|\marg{code}
-
- This code will be executed at least once for each setting of the
- parameters when the time arrow tip is actually drawn. Usually,
- this one execution will be all and the
- low-level commands generated inside the \meta{code} will we stored
- in a special cache; but in some cases the \meta{code} gets
- executed each time the arrow tip is used, so do not assume
- anything about it. Inside the \meta{code}, you have access to all
- values that were saved in the setup code as well as to the line
- width.
-
- The \meta{code} should draw the arrow tip ``going right along the
- $x$-axis.'' \pgfname\ will take care of setting up a canvas
- transformation beforehand to a rotation such that when the
- drawing is rendered, the arrow tip that is actually drawn points
- in the direction of the line. Alternatively, when bending is
- switched on, even more complicated low-level transformations will
- be done automatically.
-
- The are some special considerations concerning the \meta{code}:
- \begin{itemize}
- \item
- In the \meta{code} you may \emph{not} use |\pgfusepath|
- since this would try to add arrow tips to the arrow tip and lead
- to a recursion. Use the ``quick'' versions |\pgfusepathqstroke|
- and so on instead, which never try to add arrow tips.
- \item
- If you stroke the path that you construct, you should first set
- the dashing to solid and set up fixed joins and caps, as
- needed. This will ensure that the arrow tip will always look the
- same.
- \item
- When the arrow tip code is executed, it is automatically put
- inside a low-level scope, so nothing will ``leak out'' from the
- scope.
- \item
- The high-level coordinate transformation matrix will be set to the
- identity matrix when the code is executed for the first time.
+ %
+ To ensure that inside the drawing code the the dimension
+ registers |\pgfarrowlength| and |\pgfarrowwidth| are setup with
+ the values they had during the setup.
+ \end{command}
+ \item \declare{|drawing code|}|=|\marg{code}
+
+ This code will be executed at least once for each setting of the
+ parameters when the time arrow tip is actually drawn. Usually, this
+ one execution will be all and the low-level commands generated
+ inside the \meta{code} will we stored in a special cache; but in
+ some cases the \meta{code} gets executed each time the arrow tip is
+ used, so do not assume anything about it. Inside the \meta{code},
+ you have access to all values that were saved in the setup code as
+ well as to the line width.
+
+ The \meta{code} should draw the arrow tip ``going right along the
+ $x$-axis''. \pgfname\ will take care of setting up a canvas
+ transformation beforehand to a rotation such that when the drawing
+ is rendered, the arrow tip that is actually drawn points in the
+ direction of the line. Alternatively, when bending is switched on,
+ even more complicated low-level transformations will be done
+ automatically.
+
+ The are some special considerations concerning the \meta{code}:
+ %
+ \begin{itemize}
+ \item In the \meta{code} you may \emph{not} use |\pgfusepath|
+ since this would try to add arrow tips to the arrow tip and
+ lead to a recursion. Use the ``quick'' versions
+ |\pgfusepathqstroke| and so on instead, which never try to
+ add arrow tips.
+ \item If you stroke the path that you construct, you should
+ first set the dashing to solid and set up fixed joins and
+ caps, as needed. This will ensure that the arrow tip will
+ always look the same.
+ \item When the arrow tip code is executed, it is automatically
+ put inside a low-level scope, so nothing will ``leak out''
+ from the scope.
+ \item The high-level coordinate transformation matrix will be
+ set to the identity matrix when the code is executed for
+ the first time.
+ \end{itemize}
+ \item \declare{|cache|}|=|\meta{true or false}
+
+ When set to |true|, which is the default, the \meta{code} will be
+ executed only once for a particular value of parameters and the
+ low-level commands created by the drawing code (using the system
+ layer protocol subsystem, see Section~\ref{section-protocols}) will
+ be cached and reused later on. However, when the drawing code
+ contains ``uncachable'' code like a call to |\pgftext|, caching
+ must be switched off by saying |cache=false|.
+ \item \declare{|bending mode|}|=|\meta{mode}
+
+ This key is important only when the |bend| option is used with an
+ arrow, see Section~\ref{section-arrow-flex} for an introduction to
+ this option. The |bend| option asks us to, well, bend the arrow
+ head. For some arrow head this is not possible or leads to very
+ strange drawings (for instance, when the |\pgftext| command is
+ used) and then it is better to switch bending off for the arrow
+ head (|flex| will then be used instead). To achieve this, set
+ \meta{mode} to |none|.
+
+ For most arrow tips it does, however, make sense to bend them.
+ There are (at least) two different mathematical ways of doing so,
+ see Section~\ref{section-library-curvilinear} for details. Which of
+ these ways is use can be configured by setting \meta{mode} to
+ either |orthogonal| or to |polar|. It is best to try simply try out
+ both when designing an arrow tip to see which works better. Since
+ |orthogonal| is quicker and often gives good oder even better
+ results, it is the default. Some arrow tips, however, profit from
+ saying |bending mode=polar|.
+ \item \declare{|defaults|}|=|\meta{arrow keys}
+
+ The \meta{arrow keys} allow you to configure the default values for
+ the parameters on which an arrow tip depends. The \meta{arrow keys}
+ will be executed first before any other arrow tip options are
+ executed, see Section~\ref{section-arrow-scopes} for the exact
+ sequence. Also see Section~\ref{section-arrow-options} below for
+ more details on arrow options.
\end{itemize}
-
- \item \declare{|cache|}|=|\meta{true or false}
-
- When set to |true|, which is the default, the \meta{code} will be
- executed only once for a partiular value of parameters and the
- low-level commands created by the drawing code (using the system
- layer protocol subsystem, see Section~\ref{section-protocols})
- will be cached and reused later on. However, when the drawing code
- contains ``uncachable'' code like a call to |\pgftext|, caching
- must be switched off by saying |cache=false|.
-
- \item \declare{|bending mode|}|=|\meta{mode}
-
- This key is important only when the |bend| option is used with an
- arrow, see Section~\ref{section-arrow-flex} for an introduction to
- this option. The |bend| option asks us to, well, bend the arrow
- head. For some arrow head this is not possible or leads to very
- strange drawings (for instance, when the |\pgftext| command is
- used) and then it is better to switch bending off for the arrow
- head (|flex| will then be used instead). To achieve this, set
- \meta{mode} to |none|.
-
- For most arrow tips it does, however, make sense to bend
- them. There are (at least) two different mathematical ways of
- doing so, see Section~\ref{section-library-curvilinear} for details. Which of
- these ways is use can be configured by setting \meta{mode} to
- either |orthogonal| or to |polar|. It is best to try simply try
- out both when designing an arrow tip to see which works
- better. Since |orthogonal| is quicker and often gives good oder
- even better results, it is the default. Some arrow tips, however,
- profit from saying |bending mode=polar|.
-
- \item \declare{|defaults|}|=|\meta{arrow keys}
-
- The \meta{arrow keys} allow you to configure the default values
- for the parameters on which an arrow tip depends. The \meta{arrow
- keys} will be executed first before any other arrow tip options
- are executed, see Section~\ref{section-arrow-scopes} for the exact
- sequence. Also see Section~\ref{section-arrow-options} below for
- more details on arrow options.
- \end{itemize}
-
- This concludes the description of the keys you provide for the
- declaration of an arrow. Let us now have a look at a simple example
- that uses these features: We want to define an arrow tip kind |foo|
- that produces the arrow tip we used as our running examlpe. However,
- to make things a bit more interesting, let us make it
- ``configurable'' insofar as the length of the arrow tip can be
- configured using the |length| option, which sets the
- |\pgfarrowlength|. By default, this length should be the gigantic
- 4cm we say in the example, but uses should be able to set it to
- anything they like. We will not worry about the arrow width or
- insets, of arrow line width, or harpoons, or anything else in this
- example to keep it simple.
-
- Here is the code:
+
+ This concludes the description of the keys you provide for the declaration
+ of an arrow. Let us now have a look at a simple example that uses these
+ features: We want to define an arrow tip kind |foo| that produces the arrow
+ tip we used as our running example. However, to make things a bit more
+ interesting, let us make it ``configurable'' insofar as the length of the
+ arrow tip can be configured using the |length| option, which sets the
+ |\pgfarrowlength|. By default, this length should be the gigantic 4cm we
+ say in the example, but uses should be able to set it to anything they
+ like. We will not worry about the arrow width or insets, of arrow line
+ width, or harpoons, or anything else in this example to keep it simple.
+
+ Here is the code:
+ %
\begin{codeexample}[code only]
\pgfdeclarearrow{
name = foo,
@@ -534,17 +528,19 @@ a reasonably fast arrow tip management.
\pgfarrowssavethe\pgfarrowlength
},
drawing code = {
- \pgfpathmoveto{.25\pgfarrowlength}{0pt}
- \pgfpathlineto{-.75\pgfarrowlength}{.5\pgfarrowlength}
- \pgfpathlineto{-.5\pgfarrowlength}{0pt}
- \pgfpathlineto{-.75\pgfarrowlength}{-.5\pgfarrowlength}
+ \pgfpathmoveto{\pgfqpoint{.25\pgfarrowlength}{0pt}}
+ \pgfpathlineto{\pgfqpoint{-.75\pgfarrowlength}{.5\pgfarrowlength}}
+ \pgfpathlineto{\pgfqpoint{-.5\pgfarrowlength}{0pt}}
+ \pgfpathlineto{\pgfqpoint{-.75\pgfarrowlength}{-.5\pgfarrowlength}}
\pgfpathclose
\pgfusepathqfill
},
defaults = { length = 4cm }
-}
+}
\end{codeexample}
- We can now use it:
+ %
+ We can now use it:
+ %
\pgfdeclarearrow{
name = foo,
parameters = { \the\pgfarrowlength },
@@ -570,306 +566,305 @@ a reasonably fast arrow tip management.
\pgfusepathqfill
},
defaults = { length = 4cm }
-}
+}
\begin{codeexample}[]
-\tikz \draw [-foo] (0,0) -- (8,0);
+\tikz \draw [-foo] (0,0) -- (8,0);
\end{codeexample}
\begin{codeexample}[]
-\tikz \draw [-{foo[length=2cm,bend]}] (0,0) to [bend left] (3,0);
+\tikz \draw [-{foo[length=2cm,bend]}] (0,0) to [bend left] (3,0);
\end{codeexample}
- \medskip
- \noindent\textbf{Defining a Shorthand.}
- The |\pgfdeclarearrow| command can also used to define
- \emph{shorthands}. This works as follows:
- \begin{itemize}
- \item First, you must provide a |name| just in the same way as when
- you define a full-flung new arrow tip kind.
- \item Second, instead of all of the other options listed above, you
- just use one more option:
-
- \smallskip
- \declare{|means|}|=|\meta{end arrow specification}
-
- This sets up things so that whenever \meta{name} is now used in an
- arrow specification, it will be replaced by the \meta{end arrow
- specification} (the problems resulting form the \meta{name}
- begin used in a start arrow specification are taken care of
- automatically). See also Section~\ref{section-arrow-tip-macro} for
- details on the order in which options get executed in such cases.
-
- Note that the \meta{end arrow specification} will be executed
- immediately to build the so-called arrow option caches, a concept
- explored in more detail in
- Section~\ref{section-arrow-option-cache}. In practice, this has
- mainly two effects: First, all arrow tips referred to in the
- specification must already exist (at least as ``dummy''
- versions). Second, all dimensions mentioned in options of the
- \meta{end arrow specification} will be evaluated immediately. For
- instance, when you write
+
+ \medskip
+ \noindent\textbf{Defining a Shorthand.}
+ The |\pgfdeclarearrow| command can also used to define
+ \emph{shorthands}. This works as follows:
+ \begin{itemize}
+ \item First, you must provide a |name| just in the same way as when you
+ define a full-flung new arrow tip kind.
+ \item Second, instead of all of the other options listed above, you
+ just use one more option:
+
+ \smallskip
+ \declare{|means|}|=|\meta{end arrow specification}
+
+ This sets up things so that whenever \meta{name} is now used in an
+ arrow specification, it will be replaced by the \meta{end arrow
+ specification} (the problems resulting form the \meta{name} begin
+ used in a start arrow specification are taken care of
+ automatically). See also Section~\ref{section-arrow-tip-macro} for
+ details on the order in which options get executed in such cases.
+
+ Note that the \meta{end arrow specification} will be executed
+ immediately to build the so-called arrow option caches, a concept
+ explored in more detail in
+ Section~\ref{section-arrow-option-cache}. In practice, this has
+ mainly two effects: First, all arrow tips referred to in the
+ specification must already exist (at least as ``dummy'' versions).
+ Second, all dimensions mentioned in options of the \meta{end arrow
+ specification} will be evaluated immediately. For instance, when
+ you write
+ %
\begin{codeexample}[code only]
-\pgfdeclarearrow{ name=foo, means = bar[length=2cm+\mydimen] }
+\pgfdeclarearrow{ name=foo, means = bar[length=2cm+\mydimen] }
\end{codeexample}
- The value |2cm+\mydimen| is evaluated immediately. When |foo| is
- used later on and |\mydimen| has changed, this has no effect.
- \end{itemize}
+ %
+ The value |2cm+\mydimen| is evaluated immediately. When |foo| is
+ used later on and |\mydimen| has changed, this has no effect.
+ \end{itemize}
\end{command}
-
\subsection{Handling Arrow Options}
-
\label{section-arrow-options}
-When you declare an arrow tip, your drawing code should take into
-account the different arrow keys set for it (like the arrow tip length,
-width, or harpooning). The different arrow keys that are available
-have been described in detail in Section~\ref{section-arrow-config}; but
-how do we access the values set by an option like |length| or
-|harpoon| or |bend| in the drawing code? In the present section we
-have a look at how this works.
+When you declare an arrow tip, your drawing code should take into account the
+different arrow keys set for it (like the arrow tip length, width, or
+harpooning). The different arrow keys that are available have been described in
+detail in Section~\ref{section-arrow-config}; but how do we access the values
+set by an option like |length| or |harpoon| or |bend| in the drawing code? In
+the present section we have a look at how this works.
\subsubsection{Dimension Options}
-Most arrow keys, like |length| or |width'|, simple set a \TeX\
-dimension register to a certain value. For example, |length| sets the
-value of the \TeX\ dimension register |\pgfarrowlength|. Note that
-|length| takes several values as input with a complicated semantics as
-explained for the |length| key on
-page~\pageref{length-arrow-key}. All of these settings are not
-important for the setup code: When it gets executed, the code behind
-the |length| key will have computed a simple number that is stored
-in |\pgfarrowlength|. Indeed, inside the setup code you do not have
-access to the exact value given to the |length| key; just to the
-final computed value.
+Most arrow keys, like |length| or |width'|, simple set a \TeX\ dimension
+register to a certain value. For example, |length| sets the value of the \TeX\
+dimension register |\pgfarrowlength|. Note that |length| takes several values
+as input with a complicated semantics as explained for the |length| key on
+page~\pageref{length-arrow-key}. All of these settings are not important for
+the setup code: When it gets executed, the code behind the |length| key will
+have computed a simple number that is stored in |\pgfarrowlength|. Indeed,
+inside the setup code you do not have access to the exact value given to the
+|length| key; just to the final computed value.
The following \TeX\ dimensions are available to the setup code:
-
+%
\begin{itemize}
-\item |\pgfarrowslength|. It gets set by the arrow keys |length| and |angle|.
-\item |\pgfarrowswidth|. It gets set by |width|, |width'|, and |angle|.
-\item |\pgfarrowsinset|. It gets set by |inset| and |inset'|.
-\item |\pgfarrowslinewidth|. It gets set by |line width| and |line width'|.
+ \item |\pgfarrowslength|. It gets set by the arrow keys |length| and
+ |angle|.
+ \item |\pgfarrowswidth|. It gets set by |width|, |width'|, and |angle|.
+ \item |\pgfarrowsinset|. It gets set by |inset| and |inset'|.
+ \item |\pgfarrowslinewidth|. It gets set by |line width| and |line width'|.
\end{itemize}
-If your setup code depends on any of them, add them to the
-|parameters| key of the arrow tip.
+If your setup code depends on any of them, add them to the |parameters| key of
+the arrow tip.
\subsubsection{True--False Options}
-A number of arrow keys just do a yes/no switch, like |reversed|. All
-of them setup a \TeX-if that you can access in the setup code:
-
+A number of arrow keys just do a yes/no switch, like |reversed|. All of them
+setup a \TeX-if that you can access in the setup code:
+%
\begin{itemize}
-\item |\ifpgfarrowreversed| is setup by |reversed|.
-\item |\ifpgfarrowswap| is setup by |swap| and also |right|.
-\item |\ifpgfarrowharpoon| is setup by |harpoon| and also |left| and |right|.
-\item |\ifpgfarrowroundcap| is set to true by |line cap=round| and set
- to false by |line cap=butt|. It also gets (re)set by |round| and |sharp|.
-\item |\ifpgfarrowroundjoin| is set to true by |line join=round| and set
- to false by |line join=miter|. It also gets (re)set by |round| and |sharp|.
-\item |\ifpgfarrowopen| is set to true by |fill=none| and by |open|
- (which is a shorthand for |fill=none|) and set to false by |color|
- and all other |fill=|\meta{color}.
+ \item |\ifpgfarrowreversed| is setup by |reversed|.
+ \item |\ifpgfarrowswap| is setup by |swap| and also |right|.
+ \item |\ifpgfarrowharpoon| is setup by |harpoon| and also |left| and
+ |right|.
+ \item |\ifpgfarrowroundcap| is set to true by |line cap=round| and set to
+ false by |line cap=butt|. It also gets (re)set by |round| and |sharp|.
+ \item |\ifpgfarrowroundjoin| is set to true by |line join=round| and set to
+ false by |line join=miter|. It also gets (re)set by |round| and
+ |sharp|.
+ \item |\ifpgfarrowopen| is set to true by |fill=none| and by |open| (which
+ is a shorthand for |fill=none|) and set to false by |color| and all
+ other |fill=|\meta{color}.
\end{itemize}
-If you code depends on any of these, you must add them to
-the |parameters| in such a way that the parameters are different when
-the \TeX-if is set from when it is not set. An easy way to achieve
-this is to write something like
+If you code depends on any of these, you must add them to the |parameters| in
+such a way that the parameters are different when the \TeX-if is set from when
+it is not set. An easy way to achieve this is to write something like
+%
\begin{codeexample}[code only]
parameters = { \the\pgfarrowlength,...,
\ifpgfarrowharpoon h\fi\
- \ifpgfarrowroundjoin j\fi}
+ \ifpgfarrowroundjoin j\fi}
\end{codeexample}
-In other words, for each set parameter on which the arrow tip depends,
-a specific letter is added to the parameters, making them unique.
+%
+In other words, for each set parameter on which the arrow tip depends, a
+specific letter is added to the parameters, making them unique.
The first two of the above keys are a bit special: Reversing and swapping an
-arrow tip can be done just by fiddling with the
-transformation matrix: a reverse is a ``flip'' along the $y$-axis and
-a swap is a flip along the $x$-axis. This is done automatically by
-\pgfname.
-
-Nevertheless, you may wish to modify you code in dependence
-especially of the |reverse| key: When |\ifpgfarrowreverse| is true,
-\pgfname\ will flip the coordinate system along the $y$-axis, will
-negate all end values (like line end, tip end, and so on) and will
-exchange the meaning of back end and tip end as well as of visual back
-end and visual back end. Usually, this is exactly what one need;
-\emph{except} that the line end may no longer be appropriate. After
-all, the line end should be chosen so that it is completely covered by
-the arrow. Now, when the arrow tip is open, a reversed arrow should no
-longer have the line end near the old visual back end, but near to the
-old visual tip end.
-
-For these reasons, you may need to make the computation of the line
-end dependent on whether the arrow is reversed or not. Note that when
-you specify a different line end for a reversed arrow tip, the
-transformation and inverting of the coordinate system will still be
-done, meaning that if |reverse| is true, you need to specify a line
-end in the ``old'' coordinate system that is at the position where,
-after everything is inverted, it will be at the correct
-position. Usually that means that if the |reverse| option is set, you
-need to \emph{increase} the line end.
+arrow tip can be done just by fiddling with the transformation matrix: a
+reverse is a ``flip'' along the $y$-axis and a swap is a flip along the
+$x$-axis. This is done automatically by \pgfname.
+
+Nevertheless, you may wish to modify you code in dependence especially of the
+|reverse| key: When |\ifpgfarrowreverse| is true, \pgfname\ will flip the
+coordinate system along the $y$-axis, will negate all end values (like line
+end, tip end, and so on) and will exchange the meaning of back end and tip end
+as well as of visual back end and visual back end. Usually, this is exactly
+what one need; \emph{except} that the line end may no longer be appropriate.
+After all, the line end should be chosen so that it is completely covered by
+the arrow. Now, when the arrow tip is open, a reversed arrow should no longer
+have the line end near the old visual back end, but near to the old visual tip
+end.
+
+For these reasons, you may need to make the computation of the line end
+dependent on whether the arrow is reversed or not. Note that when you specify a
+different line end for a reversed arrow tip, the transformation and inverting
+of the coordinate system will still be done, meaning that if |reverse| is true,
+you need to specify a line end in the ``old'' coordinate system that is at the
+position where, after everything is inverted, it will be at the correct
+position. Usually that means that if the |reverse| option is set, you need to
+\emph{increase} the line end.
\subsubsection{Inaccessible Options}
-There are some options that influence the way an arrow tip looks, but
-that you cannot access inside the setup code. Handling these options
-lies entirely with \pgfname. If you wish your setup code to handle
-these options, you have to setup your own ``parallel'' options.
-
+There are some options that influence the way an arrow tip looks, but that you
+cannot access inside the setup code. Handling these options lies entirely with
+\pgfname. If you wish your setup code to handle these options, you have to
+setup your own ``parallel'' options.
+%
\begin{itemize}
-\item |quick|, |flex|, |flex'|, and |bend| are all handled
- automatically. You can, however, set the |bending mode| to avoid
- bending of your arrow tip.
-\item The colors set by |color| and |fill|. You can, however, access
- them indirectly, namely through the current stroke and fill colors.
-\item |sep|
+ \item |quick|, |flex|, |flex'|, and |bend| are all handled automatically.
+ You can, however, set the |bending mode| to avoid bending of your arrow
+ tip.
+ \item The colors set by |color| and |fill|. You can, however, access them
+ indirectly, namely through the current stroke and fill colors.
+ \item |sep|
\end{itemize}
\subsubsection{Defining New Arrow Keys}
\label{section-arrow-option-cache}
-The set of predefined options is already quite long and most arrow
-tips will not need more than the predefined options. However,
-sometimes an arrow tip may need to introduce a new special-purpose
-option. For instance, suppose we wish to introcue a new fictive arrow
-key |depth|. In such cases, you must do two things:
-
+The set of predefined options is already quite long and most arrow tips will
+not need more than the predefined options. However, sometimes an arrow tip may
+need to introduce a new special-purpose option. For instance, suppose we wish
+to introduce a new fictive arrow key |depth|. In such cases, you must do two
+things:
+%
\begin{enumerate}
-\item
- Introduce a new dimension register or macro that will hold the
- configuration value and which will be accessed by the setup
- code. The could be achieved by saying
+ \item Introduce a new dimension register or macro that will hold the
+ configuration value and which will be accessed by the setup code. The
+ could be achieved by saying
+ %
\begin{codeexample}[code only]
\newdimen\pgfarrowdepth
\end{codeexample}
-\item
- Introduce a new arrow key option |/pgf/arrow keys/depth| that allows
- users to configure the new macro or register.
+ %
+ \item Introduce a new arrow key option |/pgf/arrow keys/depth| that allows
+ users to configure the new macro or register.
\end{enumerate}
-When an arrow is selected via for instance |foo[depth=5pt]|, the
-key--value pairs between the square brackets are executed with the
-path prefix |/pgf/arrow keys|. Thus, in the example, our depth key
-would get executed. Thus, it is temping to write something like
+When an arrow is selected via for instance |foo[depth=5pt]|, the key--value
+pairs between the square brackets are executed with the path prefix
+|/pgf/arrow keys|. Thus, in the example, our depth key would get executed.
+Thus, it is tempting to write something like
+%
\begin{codeexample}[code only]
\pgfkeys{/pgf/arrow keys/depth/.code = \pgfmathsetlength{\pgfarrowdepth}{#1}}
\end{codeexample}
-Sadly, this will not work. The reason is that the is yet another level
-of caching involved when \pgfname\ processes arrow tips: The option
-cache! The problem is each time an arrow tip is used, even when the
-drawing code of the arrow tip is nicely cached, we still need to
-process the options in |foo[length=5pt]| to find out which version in
-the cache we would like to access. To make matters worse, |foo| might
-be a shorthand that calls other arrow tips, which add more options,
-and so on. Unfortunately, executing keys is quite an expensive
-operation (\pgfname's key--value parser is powerful, but that power
-comes at a price). So, whenever possible, we do \emph{not} want the
+Sadly, this will not work. The reason is that there is yet another level of
+caching involved when \pgfname\ processes arrow tips: The option cache! The
+problem is each time an arrow tip is used, even when the drawing code of the
+arrow tip is nicely cached, we still need to process the options in
+|foo[length=5pt]| to find out which version in the cache we would like to
+access. To make matters worse, |foo| might be a shorthand that calls other
+arrow tips, which add more options, and so on. Unfortunately, executing keys is
+quite an expensive operation (\pgfname's key--value parser is powerful, but
+that power comes at a price). So, whenever possible, we do \emph{not} want the
key--value parser to be started.
-For these reasons, when something like |foo[|\meta{options}|]| is
-encountered inside a shorthand, the \meta{options} are executed only
-once. They should now setup the \emph{arrow option cache}, which is
-some code that, when executed, should setup the values that the
-\meta{options} configure. In our example, the |depth| key should add
-something to the arrow option cache that sets |\pgfarrowdepth| to the
-given value.
+For these reasons, when something like |foo[|\meta{options}|]| is encountered
+inside a shorthand, the \meta{options} are executed only once. They should now
+setup the \emph{arrow option cache}, which is some code that, when executed,
+should setup the values that the \meta{options} configure. In our example, the
+|depth| key should add something to the arrow option cache that sets
+|\pgfarrowdepth| to the given value.
-Adding something to the arrow option cache is done using the following
-command:
+Adding something to the arrow option cache is done using the following command:
\begin{command}{\pgfarrowsaddtooptions\marg{code}}
- This command should be called by keys with the prefix
- |/pgf/arrow keys| to add code to the arrow option cache. For our
- |depth| key example, we could use this key as follows:
+ This command should be called by keys with the prefix |/pgf/arrow keys| to
+ add code to the arrow option cache. For our |depth| key example, we could
+ use this key as follows:
+ %
\begin{codeexample}[code only]
\pgfkeys{/pgf/arrow keys/depth/.code=
\pgfarrowsaddtooptions{\pgfmathsetlength{\pgfarrowdepth}{#1}}
\end{codeexample}
- Actually, this is still not optimal since the expensive
- |\pgfmathsetlength| command is now called each time an arrow tip is
- used with the |depth| option set. The trick is to do the expensive
- operation only once and then store only very quick code in the arrow
- option cache:
+ %
+ Actually, this is still not optimal since the expensive |\pgfmathsetlength|
+ command is now called each time an arrow tip is used with the |depth|
+ option set. The trick is to do the expensive operation only once and then
+ store only very quick code in the arrow option cache:
+ %
\begin{codeexample}[code only]
\pgfkeys{/pgf/arrow keys/depth/.code=
\pgfmathsetlength{\somedimen}{#1}
\pgfarrowsaddtooptions{\pgfarrowdepth=\somedimen} % buggy
\end{codeexample}
- The above code will not (yet) work since |\somedimen| will surely
- have a different value when the cache is executed. The trick is to
- use some |\expandafter|s:
+ %
+ The above code will not (yet) work since |\somedimen| will surely have a
+ different value when the cache is executed. The trick is to use some
+ |\expandafter|s:
+ %
\begin{codeexample}[code only]
\pgfkeys{/pgf/arrow keys/depth/.code=
\pgfmathsetlength{\somedimen}{#1}
\expandafter\pgfarrowsaddtooptions\expandafter{\expandafter\pgfarrowdepth\expandafter=\the\somedimen}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfarrowsaddtolateoptions\marg{code}}
- This command works like |\pgfarrowsaddtooptions|, only the
- \meta{code} will be executed ``later'' than the code added by the
- normal version of the command. This is useful for keys that depend
- on the length of an arrow: Keys like |width'| want to define the
- arrow width as a multiple of the arrow length, but when the |width'|
- key is given, the length may not yet have been specified. By making
- the computation of the width a ``late'' option, we ensure that
- |\pgfarrowlength| will have been setup correctly.
+ This command works like |\pgfarrowsaddtooptions|, only the \meta{code} will
+ be executed ``later'' than the code added by the normal version of the
+ command. This is useful for keys that depend on the length of an arrow:
+ Keys like |width'| want to define the arrow width as a multiple of the
+ arrow length, but when the |width'| key is given, the length may not yet
+ have been specified. By making the computation of the width a ``late''
+ option, we ensure that |\pgfarrowlength| will have been setup correctly.
\end{command}
-If you define a new option that sets a dimensions and if that
-dimension should change in accordance to the setting of either
-|scale length| or |scale width|, you need to make \pgfname\ ``aware''
-of this using the following key:
+If you define a new option that sets a dimensions and if that dimension should
+change in accordance to the setting of either |scale length| or |scale width|,
+you need to make \pgfname\ ``aware'' of this using the following key:
\begin{command}{\pgfarrowsaddtolengthscalelist\marg{dimension register}}
- Each time an arrow tip is used, the given \meta{dimension register}
- will be multiplied by the |scale length| factor prior to the actual
- drawing. You call this command only once in the preamble somewhere.
+ Each time an arrow tip is used, the given \meta{dimension register} will be
+ multiplied by the |scale length| factor prior to the actual drawing. You
+ call this command only once in the preamble somewhere.
\end{command}
\begin{command}{\pgfarrowsaddtowidthscalelist\marg{dimension register}}
- Works like |\pgfarrowsaddtolengthscalelist|, only for width parameters.
+ Works like |\pgfarrowsaddtolengthscalelist|, only for width parameters.
\end{command}
-\begin{command}{\pgfarrowsthreeparameters\marg{line-width dependent
- size specification}}
- This command is useful for parsing the values given to keys like
- |length| or |width| the expect a dimension followed optionally for
- some numbers. This command converts the \meta{line-width dependent
- size specification}, which may consist of one, two, or three
- numbers, into a triple of three numbers in curly braces, which gets
- stored in the macro |\pgfarrowstheparameters|. Here is an example,
- where |\showvalueofmacro| is used in this example to show the value
- stored in a macro:
- \makeatletter
- \def\showvalueofmacro#1{%
- \texttt{\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\pgfutil@gobble\expandafter\expandafter\expandafter\string\expandafter\csname#1\endcsname}
- }
+\begin{command}{\pgfarrowsthreeparameters\marg{line-width dependent size specification}}
+ This command is useful for parsing the values given to keys like |length|
+ or |width| the expect a dimension followed optionally for some numbers.
+ This command converts the \meta{line-width dependent size specification},
+ which may consist of one, two, or three numbers, into a triple of three
+ numbers in curly braces, which gets stored in the macro
+ |\pgfarrowstheparameters|. Here is an example, where |\showvalueofmacro| is
+ used in this example to show the value stored in a macro:
+ %
+ \makeatletter
+ \def\showvalueofmacro#1{%
+ \texttt{\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\pgfutil@gobble\expandafter\expandafter\expandafter\string\expandafter\csname#1\endcsname}
+ }
\begin{codeexample}[]
\pgfarrowsthreeparameters{2pt 1}
-\showvalueofmacro\pgfarrowstheparameters
+\showvalueofmacro\pgfarrowstheparameters
\end{codeexample}
+ %
\end{command}
+\begin{command}{\pgfarrowslinewidthdependent\marg{dimension}\marg{line width factor}\marg{outer factor}}
+ This command take three parameters and does the ``line width dependent
+ computation'' described on page~\pageref{length-arrow-key} for the |length|
+ key. The result is returned in |\pgf@x|.
-\begin{command}{\pgfarrowslinewidthdependent\marg{dimension}\marg{line
- width factor}\marg{outer factor}}
- This command take three parameters and does the ``line width
- dependent computation'' described on page~\pageref{length-arrow-key}
- for the |length| key. The result is returned in |\pgf@x|.
-
- The idea is that you can setup line-width dependent keys like
- |length| or |width| using code like the following:
+ The idea is that you can setup line-width dependent keys like |length| or
+ |width| using code like the following:
+ %
\begin{codeexample}[code only]
\pgfkeys{/pgf/arrow keys/depth/.code={%
\pgfarrowsthreeparameters{#1}%
@@ -877,16 +872,18 @@ of this using the following key:
\expandafter\pgfarrowslinewidthdependent\pgfarrowstheparameters% compute...
\pgfarrowdepth\pgf@x% ... and store.
}%
-}
+}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfarrowslengthdependent\marg{dimension}\marg{length factor}\marg{dummy}}
- This command take three parameters, of which the last one is
- ignored, and does the ``length dependent computation'' described for
- the |width'| and |inset'| keys. The result is returned in |\pgf@x|.
+ This command take three parameters, of which the last one is ignored, and
+ does the ``length dependent computation'' described for the |width'| and
+ |inset'| keys. The result is returned in |\pgf@x|.
- You can setup length dependent keys using code like the following:
+ You can setup length dependent keys using code like the following:
+ %
\begin{codeexample}[code only]
\pgfkeys{/pgf/arrow keys/depth'/.code={%
\pgfarrowsthreeparameters{#1}%
@@ -894,8 +891,9 @@ of this using the following key:
\expandafter\pgfarrowslengthdependent\pgfarrowstheparameters% compute...
\pgfarrowdepth\pgf@x% ... and store.
}%
-}
+}
\end{codeexample}
+ %
\end{command}
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 92da9d37342..b51d5373162 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
@@ -1,4 +1,4 @@
- % Copyright 2008 by Till Tantau and Mark Wibrow
+% Copyright 2008 by Till Tantau and Mark Wibrow
%
% This file may be distributed and/or modified
%
@@ -7,29 +7,29 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Decorations}
\label{section-base-decorations}
-
\begin{pgfmodule}{decorations}
- 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.
+ 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.
\end{pgfmodule}
\subsection{Overview}
-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
-
+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
+%
\begin{codeexample}[]
\tikz \draw decorate[decoration=zigzag] {(0,0) -- (3,0)};
\end{codeexample}
+%
\ldots but could also be as complex as typesetting text along a path:
+%
{\catcode`\|12
\begin{codeexample}[]
\tikz \path decorate [decoration={text along path,
@@ -39,237 +39,222 @@ new path. This could be as simple as extending a path with a
}
The workflow for using decorations is the following:
+%
\begin{enumerate}
-\item You define a decoration using the |\pgfdeclaredecoration|
- command. Different useful decorations are already declared in
- libraries like |decorations.shapes|.
-\item You use normal path construction commands like |\pgfpathlineto|
- to construct a path. Let us call this path the
- \emph{to-be-decorated} path.
-\item You place the path construction commands inside the environment
- |{pgfdecoration}|. This environment takes the name of a previously
- declared decoration as a parameter. It will then start ``walking
- along'' the to-be-decorated path. As it does this, a special finite
- automaton called a \emph{decoration automaton} produces new path commands as its output (or even other outputs). These
- outputs replace the to-be-decorated path; indeed, after the
- to-be-decorated path has been fully walked along it is thrown away,
- only the output of the automaton persists.
+ \item You define a decoration using the |\pgfdeclaredecoration| command.
+ Different useful decorations are already declared in libraries like
+ |decorations.shapes|.
+ \item You use normal path construction commands like |\pgfpathlineto| to
+ construct a path. Let us call this path the \emph{to-be-decorated}
+ path.
+ \item You place the path construction commands inside the environment
+ |{pgfdecoration}|. This environment takes the name of a previously
+ declared decoration as a parameter. It will then start ``walking
+ along'' the to-be-decorated path. As it does this, a special finite
+ automaton called a \emph{decoration automaton} produces new path
+ commands as its output (or even other outputs). These outputs replace
+ the to-be-decorated path; indeed, after the to-be-decorated path has
+ been fully walked along it is thrown away, only the output of the
+ automaton persists.
\end{enumerate}
-In the present section the process of how decoration automata work is
-explained first. Then the command(s) for declaring decoration automata
-and for using them are covered.
-
+In the present section the process of how decoration automata work is explained
+first. Then the command(s) for declaring decoration automata and for using them
+are covered.
\subsection{Decoration Automata}
-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 versatility is
-provided by ``meta-decorations''. These are automata that decorate a
-path with decorations.
-
-In the present subsection the different ideas underlying decoration
-automata are presented.
+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 versatility is provided by ``meta-decorations''. These are
+automata that decorate a path with decorations.
+In the present subsection the different ideas underlying decoration automata
+are presented.
\subsubsection{The Different Paths}
-In order to prevent confusion with different types of paths, such
-as those that are extended, those that are decorated and those that
-are created, the following conventions will be used:
-
+In order to prevent confusion with different types of paths, such 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
- 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.)
-\item
- The \emph{input} path refers to the to-be-decorated path that the
- 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.
-\item
- 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.
+ \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.)
+ \item The \emph{input} path refers to the to-be-decorated path that the
+ 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.
+ \item 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.
\end{itemize}
-The effect of a decoration environment is the following: The input
-path, which is specified inside the environment, is constructed and
-stored. This process does not alter the preexisting path in any
-way. Then the decoration automaton is started (as described later) and
-it produces an output path (possibly empty). Whenever part of the
-output path is produced, it is concatenated with the preexisting
-path. After the environment, the current path will equal the original
-preexisting path followed by the output path.
-
-It is permissible that a decoration issues a |\pgfusepath|
-command. As usual, this causes the current path to be
-filled or stroked or some other action to be taken and the current
-path is set to the empty path. As described above, when the decoration
-automaton starts, the current path is the preexisting path and as the
-automaton progresses, the current path is constantly being extended by
-the output path. This means that first time a |\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.
-
-You can use this mechanism to stroke or fill different parts of the
-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.
+The effect of a decoration environment is the following: The input path, which
+is specified inside the environment, is constructed and stored. This process
+does not alter the preexisting path in any way. Then the decoration automaton
+is started (as described later) and it produces an output path (possibly
+empty). Whenever part of the output path is produced, it is concatenated with
+the preexisting path. After the environment, the current path will equal the
+original preexisting path followed by the output path.
+
+It is permissible that a decoration issues a |\pgfusepath| command. As usual,
+this causes the current path to be filled or stroked or some other action to be
+taken and the current path is set to the empty path. As described above, when
+the decoration automaton starts, the current path is the preexisting path and
+as the automaton progresses, the current path is constantly being extended by
+the output path. This means that first time a |\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.
+
+You can use this mechanism to stroke or fill different parts of the 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.
\subsubsection{Segments and States}
-The most common use of a decoration is to ``repeat something along a
-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 is repeated: a decoration
-can consist of different parts, or \emph{segments}, repeated in a
-particular order.
-
-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:
+The most common use of a decoration is to ``repeat something along a 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 is
+repeated: a decoration can consist of different parts, or \emph{segments},
+repeated in a particular order.
+
+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:
+%
\begin{codeexample}[code only]
\pgfpathlineto{\pgfpoint{5pt}{5pt}}
\pgfpathlineto{\pgfpoint{15pt}{-5pt}}
\pgfpathlineto{\pgfpoint{20pt}{0pt}}
\end{codeexample}
-\pgfname\ will ensure that an appropriate coordinate transformation
-is in place when the segment is rendered such that
-the segment actually points in the right direction. Also,
-subsequent segments will be transformed such that they are
-``further along the path'' toward the end of the path.
-All transformations are set up automatically.
-
-Note that we did not use a |\pgfpathmoveto{\pgfpointorigin}| at the
-beginning of the segment code. Doing so would subdivide the path into
-numerous subpaths. Rather, we assume that the previous segment caused
-the current point to be at the origin.
-
-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.
-
-The |zigzag| decoration only has one segment that is repeated again and
-again. However, we might also like to have \emph{different} segments
-and use rules to describe which segment should be used where. For
-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
-start in a special \emph{state} called the \emph{initial state}. In
-this state, and also in all other states 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
-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$.
-
-Only if none of the rules tell us to switch to another
-state, \pgfname\ will execute the state's code. This code will
-(typically) add a segment to the output path. In addition to the rules
-there is also a width parameter attached to each state. \pgfname\ then
-translates the coordinate system by this width and reduces the
-remaining distance on the input path. Then, \pgfname\ either stays in
-the current state or switches to another state, depending on yet
+\pgfname\ will ensure that an appropriate coordinate transformation is in place
+when the segment is rendered such that the segment actually points in the right
+direction. Also, subsequent segments will be transformed such that they are
+``further along the path'' toward the end of the path. All transformations are
+set up automatically.
+
+Note that we did not use a |\pgfpathmoveto{\pgfpointorigin}| at the beginning
+of the segment code. Doing so would subdivide the path into numerous subpaths.
+Rather, we assume that the previous segment caused the current point to be at
+the origin.
+
+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.
+
+The |zigzag| decoration only has one segment that is repeated again and again.
+However, we might also like to have \emph{different} segments and use rules to
+describe which segment should be used where. For 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 start in a special
+\emph{state} called the \emph{initial state}. In this state, and also in all
+other states 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 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$.
+
+Only if none of the rules tell us to switch to another state, \pgfname\ will
+execute the state's code. This code will (typically) add a segment to the
+output path. In addition to the rules there is also a width parameter attached
+to each state. \pgfname\ then translates the coordinate system by this width
+and reduces the remaining distance on the input path. Then, \pgfname\ either
+stays in the current state or switches to another state, depending on yet
another property attached of the state.
-The whole process stops when a special state called |final| is
-reached. The segment of this state is immediately added to the output
-path (it is often empty, though) and the process ends.
-
-
+The whole process stops when a special state called |final| is reached. The
+segment of this state is immediately added to the output path (it is often
+empty, though) and the process ends.
\subsection{Declaring Decorations}
-The following command is used to declare a decoration. Essentially,
-this command describes the decoration automaton.
-
-
-\begin{command}{\pgfdeclaredecoration\marg{name}\marg{initial
- state}\marg{states}}
- This command declares a new decoration called \meta{name}. The
- \meta{states} argument contains a description of the decoration
- automaton's states and the transitions between them. The
- \meta{initial state} is the state in which the automaton starts.
-
- When the automaton is later applied to an input path, it keeps track
- of a certain position on the input path. This current point
- 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 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 travel 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
- input path since this would have caused an immediate switch to
- the |final| state.
-
- Note that the computation of the path lengths has only a low
- accuracy because of \TeX's small math capabilities. Do not
- expect high accuracy alignments when using decorations (unless the
- input path consists only of horizontal and vertical lines).
-
- The \meta{states} argument should consist of |\state| commands, one
- for each state of the decoration automaton. The |\state| command is
- defined only when the \meta{states} argument is executed.
-
- \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 to a
- state switch, see below. 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
- is immediate, even if later options might cause a different
- state switch.
- \item
- The \meta{code} is executed in a \TeX-group with the current
- transformation matrix set up in such a way that the origin is on
- the input path at the current point (the point at the distance
- 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, that is, it extends the
- preexisting path. Here is an example:
-
+The following command is used to declare a decoration. Essentially, this
+command describes the decoration automaton.
+
+\begin{command}{\pgfdeclaredecoration\marg{name}\marg{initial state}\marg{states}}
+ This command declares a new decoration called \meta{name}. The
+ \meta{states} argument contains a description of the decoration automaton's
+ states and the transitions between them. The \meta{initial state} is the
+ state in which the automaton starts.
+
+ When the automaton is later applied to an input path, it keeps track of a
+ certain position on the input path. This current point 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 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
+ travel 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 input path since this would have caused an immediate switch
+ to the |final| state.
+
+ Note that the computation of the path lengths has only a low accuracy
+ because of \TeX's small math capabilities. Do not expect high accuracy
+ alignments when using decorations (unless the input path consists only of
+ horizontal and vertical lines).
+
+ The \meta{states} argument should consist of |\state| commands, one for
+ each state of the decoration automaton. The |\state| command is defined
+ only when the \meta{states} argument is executed.
+
+ \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 to a state
+ switch, see below. 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 is immediate, even if later options might cause a
+ different state switch.
+ \item The \meta{code} is executed in a \TeX-group with the current
+ transformation matrix set up in such a way that the origin is
+ on the input path at the current point (the point at the
+ distance 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, that is, it extends the
+ preexisting path. Here is an example:
+ %
\begin{codeexample}[]
\pgfdeclaredecoration{example}{initial}
{
@@ -293,13 +278,13 @@ this command describes the decoration automaton.
}
\end{codeexample}
- Alternatively, the \meta{code} can also contain the
- |\pgfusepath| command. This will use the path in the usual manner,
- where ``the path'' is the preexisting path plus a part of the
- 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:
-
+ Alternatively, the \meta{code} can also contain the
+ |\pgfusepath| command. This will use the path in the usual
+ manner, where ``the path'' is the preexisting path plus a part
+ of the 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]
@@ -320,171 +305,175 @@ this command describes the decoration automaton.
.. controls (3,-3) and (0,0) .. (0,-3)
.. controls (0,-5) and (3,-5) .. (3,-3);
\end{codeexample}
-
- \item
- After the \meta{code} has been executed (possibly more than
- once, if the |repeat state| option is used), the state switches to
- whatever state has been specified inside the \meta{options}
- using the |next state| option. If no |next state| has been
- specified, the state stays the same.
- \end{enumerate}
-
- The \meta{options} are executed with the key path set to
- |/pgf/decoration automaton|. The following keys are defined:
- \begin{key}{/pgf/decoration automaton/switch if less than=\meta{dimension}\texttt{ to }\meta{new state}}
- When this key is encountered, \pgfname\ checks whether the
- remaining distance to the end of the input path is less than
- \meta{dimension}. If so, an immediate state switch to \meta{new
- state} occurs.
- \end{key}
- \begin{key}{/pgf/decoration automaton/switch if input segment less than=\\\meta{dimension}\texttt{ to }\meta{new state}}
- When this key is encountered, \pgfname\ checks whether the
- remaining distance to the end of the current input segment of the
- input path is less than \meta{dimension}. If so, an immediate
- state switch to \meta{new state} occurs.
- \end{key}
- \begin{key}{/pgf/decoration automaton/width=\meta{dimension}}
- First, this option causes an immediate switch to the
- state |final| if the remaining distance on the input path is
- less than \meta{dimension}. The effect is the same as if you had
- said |switch if less than=|\meta{dimension}| to final| just
- before the |width| option.
-
- If no switch occurs, this option tells \pgfname\ the width of
- the segment. The current point will travel along the input path
- (as described earlier) by this distance.
- \end{key}
- \begin{key}{/pgf/decoration automaton/repeat state=\meta{repetitions} (initially 0)}
- Tells \pgfname\ how long the automaton stays ``normally'' in the
- current state. This count is reset to \meta{repetitions} each
- time one of the |switch if| keys causes a state switch. If no
- 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
- 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
- is $\meta{repetitions}+1$.
- \end{key}
- \begin{key}{/pgf/decoration automaton/next state=\meta{new state}}
- After the \meta{code} for state has been executed for the last
- time, 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}
-
- \begin{key}{/pgf/decoration automaton/if input segment is closepath=\meta{options}}
- This key checks whether the current input segment is a closepath
- operation. If so, the \meta{options} get executed; otherwise
- nothing happens. You can use this option to handle a closepath
- in some special way, for instance, switching to a new state in
- which |\pgfpathclose| is executed.
- \end{key}
-
- \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 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
- operation. Otherwise, it is checked whether the current input
- segment is a closepath segment and whether the remaining
- distance on the current input segment is at most
- \meta{distance}. If so, then a closepath operation is used to
- close the decorated path and the automaton continues with the
- next subpath, remaining in the current state.
-
- In all other cases, nothing happens.
- \end{key}
-
- \begin{key}{/pgf/decoration automaton/auto corner on length=\meta{dimension}}
- This key has the following effect: Firstly, in case the \TeX-if
- |\ifpgfdecoratepathhascorners| is false, nothing
- happens. Otherwise, it is tested whether the remaining distance
- on the current input segment is at most \meta{dimension}. If so,
- a |lineto| operation is used to reach the end of this input
- segment and the automaton continues with the next input segment,
- but remains in the current state.
-
- The main idea behind this option is to avoid having decoration
- segments ``overshoot'' past a corner.
- \end{key}
-
- You may sometimes wish to do computations outside the
- 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 the state is executed, the \meta{precode} is
- executed first and it is executed outside the \TeX-group of the
- \meta{code}. Note that when the \meta{precode} is executed, the
- transformation matrix is not set up.
- \end{key}
-
- \begin{key}{/pgf/decoration automaton/persistent postcomputation=\meta{postcode}}
- Works like the |persistent precomputation| option, only the
- \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.
- \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.
- \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
- this angle.
- \end{command}
-
- The following \TeX\ dimension registers are also available inside the
- automaton:
-
- \begin{command}{\pgfdecoratedremainingdistance}
- The remaining distance on the input path.
- \end{command}
-
- \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:
+ %
+
+ \item After the \meta{code} has been executed (possibly more than
+ once, if the |repeat state| option is used), the state switches
+ to whatever state has been specified inside the \meta{options}
+ using the |next state| option. If no |next state| has been
+ specified, the state stays the same.
+ \end{enumerate}
+
+ The \meta{options} are executed with the key path set to
+ |/pgf/decoration automaton|. The following keys are defined:
+ %
+ \begin{key}{/pgf/decoration automaton/switch if less than=\meta{dimension}\texttt{ to }\meta{new state}}
+ When this key is encountered, \pgfname\ checks whether the
+ remaining distance to the end of the input path is less than
+ \meta{dimension}. If so, an immediate state switch to \meta{new
+ state} occurs.
+ \end{key}
+ %
+ \begin{key}{/pgf/decoration automaton/switch if input segment less than=\\\meta{dimension}\texttt{ to }\meta{new state}}
+ When this key is encountered, \pgfname\ checks whether the
+ remaining distance to the end of the current input segment of the
+ input path is less than \meta{dimension}. If so, an immediate state
+ switch to \meta{new state} occurs.
+ \end{key}
+ %
+ \begin{key}{/pgf/decoration automaton/width=\meta{dimension}}
+ First, this option causes an immediate switch to the state |final|
+ if the remaining distance on the input path is less than
+ \meta{dimension}. The effect is the same as if you had said |switch
+ if less than=|\meta{dimension}| to final| just before the |width|
+ option.
+
+ If no switch occurs, this option tells \pgfname\ the width of the
+ segment. The current point will travel along the input path (as
+ described earlier) by this distance.
+ \end{key}
+ %
+ \begin{key}{/pgf/decoration automaton/repeat state=\meta{repetitions} (initially 0)}
+ Tells \pgfname\ how long the automaton stays ``normally'' in the
+ current state. This count is reset to \meta{repetitions} each time
+ one of the |switch if| keys causes a state switch. If no 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 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
+ is $\meta{repetitions}+1$.
+ \end{key}
+ %
+ \begin{key}{/pgf/decoration automaton/next state=\meta{new state}}
+ After the \meta{code} for state has been executed for the last
+ time, 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}
+
+ \begin{key}{/pgf/decoration automaton/if input segment is closepath=\meta{options}}
+ This key checks whether the current input segment is a closepath
+ operation. If so, the \meta{options} get executed; otherwise
+ nothing happens. You can use this option to handle a closepath in
+ some special way, for instance, switching to a new state in which
+ |\pgfpathclose| is executed.
+ \end{key}
+
+ \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 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 operation. Otherwise, it is
+ checked whether the current input segment is a closepath segment
+ and whether the remaining distance on the current input segment is
+ at most \meta{distance}. If so, then a closepath operation is used
+ to close the decorated path and the automaton continues with the
+ next subpath, remaining in the current state.
+
+ In all other cases, nothing happens.
+ \end{key}
+
+ \begin{key}{/pgf/decoration automaton/auto corner on length=\meta{dimension}}
+ This key has the following effect: Firstly, in case the \TeX-if
+ |\ifpgfdecoratepathhascorners| is false, nothing happens.
+ Otherwise, it is tested whether the remaining distance on the
+ current input segment is at most \meta{dimension}. If so, a
+ |lineto| operation is used to reach the end of this input segment
+ and the automaton continues with the next input segment, but
+ remains in the current state.
+
+ The main idea behind this option is to avoid having decoration
+ segments ``overshoot'' past a corner.
+ \end{key}
+
+ You may sometimes wish to do computations outside the 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 the state is executed, the \meta{precode} is
+ executed first and it is executed outside the \TeX-group of the
+ \meta{code}. Note that when the \meta{precode} is executed, the
+ transformation matrix is not set up.
+ \end{key}
+
+ \begin{key}{/pgf/decoration automaton/persistent postcomputation=\meta{postcode}}
+ Works like the |persistent precomputation| option, only the
+ \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.
+ \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.
+ \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 this angle.
+ \end{command}
+
+ The following \TeX\ dimension registers are also available inside the
+ automaton:
+
+ \begin{command}{\pgfdecoratedremainingdistance}
+ The remaining distance on the input path.
+ \end{command}
+
+ \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}
{
@@ -530,19 +519,16 @@ this command describes the decoration automaton.
decorate {(.5,-2) -- ++(2.5,-2.5)} -- (3,-5) -| (0,-2) -- cycle;
\end{tikzpicture}
\end{codeexample}
- \end{command}
+ \end{command}
\end{command}
-
\subsubsection{Predefined Decorations}
-The three decorations |moveto|, |lineto|, and |curveto| are predefined
-and ``always available.'' They are mostly useful in conjunction with
+The three decorations |moveto|, |lineto|, and |curveto| are predefined and
+``always available''. They are mostly useful in conjunction with
meta-decorations. They are documented in
-Section~\ref{section-library-decorations} alongside the other
-decorations.
-
+Section~\ref{section-library-decorations} alongside the other decorations.
\subsection{Using Decorations}
@@ -550,85 +536,74 @@ decorations.
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:
- \begin{enumerate}
- \item
- The preexisting unused path is saved.
- \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
- \begin{quote}
- \marg{decoration}\marg{length}\opt{\marg{before code}\marg{after code}}
- \end{quote}
- The \meta{before code} and the \meta{after code} are optional. The
- input path is divided into input paths as follows: The first input
- path consists of the first lines of the path specified in the
- \meta{environment contents} until the \meta{length} of the first
- element of the \meta{decoration list} is reached. If this length
- is reached in the middle of a line, the line is broken up at this
- exact position. Then the second input path has the \meta{length}
- of the second element in the \meta{decoration list} and consists
- of the lines making up the following \meta{length} part of the
- path in the \meta{environment contents}, and so on.
-
- If the lengths in the \meta{decoration list}
- do not add up to the total length of the path in the
- \meta{environment contents}, either some decorations are dropped
- (if their lengths add up to more than the length of the
- \meta{environment contents}) or
- the input path is not fully used (if their lengths add up to less).
- \item
- The preexisting path is reinstalled.
- \item
- The decoration automata move along the input paths, thus creating
- (and possibly using) the output paths. These output paths extend
- the current path (unless they are used).
- \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|, the 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
- in \meta{environment contents} are discarded.
- \item
- Any move-to commands at the end of \meta{environment contents} are
- ignored.
- \item
- Any close-path commands on the input path are interpreted as
- straight lines.
- 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 starts with a line-to or curve-to when the
- existing path is empty, an appropriate move-to command should be
- inserted before the decoration starts.
- \item
- If a decoration uses its own path, the first time this happens the
- preexisting path is part of the path that is used at this point.
- \end{itemize}
-
-Before the automata start to "work on" their respective inputs paths,
- \meta{before code} is
- executed. After the decoration automaton has finished, \meta{after
- code} is executed.
+ 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:
+ %
+ \begin{enumerate}
+ \item The preexisting unused path is saved.
+ \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
+ %
+ \begin{quote}
+ \marg{decoration}\marg{length}\opt{\marg{before code}\marg{after code}}
+ \end{quote}
+ %
+ The \meta{before code} and the \meta{after code} are optional. The
+ input path is divided into input paths as follows: The first input
+ path consists of the first lines of the path specified in the
+ \meta{environment contents} until the \meta{length} of the first
+ element of the \meta{decoration list} is reached. If this length is
+ reached in the middle of a line, the line is broken up at this
+ exact position. Then the second input path has the \meta{length} of
+ the second element in the \meta{decoration list} and consists of
+ the lines making up the following \meta{length} part of the path in
+ the \meta{environment contents}, and so on.
+
+ If the lengths in the \meta{decoration list} do not add up to the
+ total length of the path in the \meta{environment contents}, either
+ some decorations are dropped (if their lengths add up to more than
+ the length of the \meta{environment contents}) or the input path is
+ not fully used (if their lengths add up to less).
+ \item The preexisting path is reinstalled.
+ \item The decoration automata move along the input paths, thus creating
+ (and possibly using) the output paths. These output paths extend
+ the current path (unless they are used).
+ \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|, the 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 in \meta{environment contents} are discarded.
+ \item Any move-to commands at the end of \meta{environment contents}
+ are ignored.
+ \item Any close-path commands on the input path are interpreted as
+ straight lines. 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 starts with a
+ line-to or curve-to when the existing path is empty, an appropriate
+ move-to command should be inserted before the decoration starts.
+ \item If a decoration uses its own path, the first time this happens
+ the preexisting path is part of the path that is used at this
+ point.
+ \end{itemize}
+
+ Before the automata start to "work on" their respective inputs paths,
+ \meta{before code} is executed. After the decoration automaton has
+ finished, \meta{after code} is executed.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={segment length=5pt}]
\draw [help lines] grid (3,2);
@@ -641,12 +616,12 @@ Before the automata start to "work on" their respective inputs paths,
\end{tikzpicture}
\end{codeexample}
- When the lengths are evaluated, the dimension
- |\pgfdecoratedremainingdistance| holds the remaining distance on
- the entire decorated path, and |\pgfdecoratedpathlength| holds the
- total length of the path. Thus, it is possible to specify lengths
- like |\pgfdecoratedpathlength/3|.
-
+ When the lengths are evaluated, the dimension
+ |\pgfdecoratedremainingdistance| holds the remaining distance on the entire
+ decorated path, and |\pgfdecoratedpathlength| holds the total length of the
+ path. Thus, it is possible to specify lengths like
+ |\pgfdecoratedpathlength/3|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={segment length=5pt}]
\draw [help lines] grid (3,2);
@@ -663,20 +638,21 @@ Before the automata start to "work on" their respective inputs paths,
\end{tikzpicture}
\end{codeexample}
- When \meta{before code} is executed, the following macro is useful:
- \begin{command}{\pgfpointdecoratedpathfirst}
- Returns the point corresponding to the start of the current
- input path.
- \end{command}
- When \meta{after code} is executed, the following macro can be used:
- \begin{command}{\pgfpointdecoratedpathlast}
- 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 continue from the
- correct place.
-
+ When \meta{before code} is executed, the following macro is useful:
+ %
+ \begin{command}{\pgfpointdecoratedpathfirst}
+ Returns the point corresponding to the start of the current input path.
+ \end{command}
+ %
+ When \meta{after code} is executed, the following macro can be used:
+ %
+ \begin{command}{\pgfpointdecoratedpathlast}
+ 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 continue from the correct place.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
@@ -706,88 +682,88 @@ Before the automata start to "work on" their respective inputs paths,
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
-
- After the |{decoration}| environment has finished, the following
- macros are available:
-
- \begin{command}{\pgfdecorateexistingpath}
- The preexisting path before the environment was entered.
- \end{command}
-
- \begin{command}{\pgfdecoratedpath}
- The (total) input path (that is, the path created by the environment contents).
- \end{command}
-
- \begin{command}{\pgfdecorationpath}
- The output path. If the path is used, this macro contains only the
- last unused part of the output path.
- \end{command}
-
- \begin{command}{\pgfpointdecoratedpathlast}
- The final point of the input path.
- \end{command}
-
- \begin{command}{\pgfpointdecorationpathlast}
- The final point of the output path.
- \end{command}
-
- The following style is executed each time a decoration is used. You
- may use it to set up default options for decorations.
- \begin{stylekey}{/pgf/every decoration (initially \normalfont empty)}
- This style is executed for every decoration.
- \end{stylekey}
+
+ After the |{decoration}| environment has finished, the following macros are
+ available:
+
+ \begin{command}{\pgfdecorateexistingpath}
+ The preexisting path before the environment was entered.
+ \end{command}
+
+ \begin{command}{\pgfdecoratedpath}
+ The (total) input path (that is, the path created by the environment
+ contents).
+ \end{command}
+
+ \begin{command}{\pgfdecorationpath}
+ The output path. If the path is used, this macro contains only the last
+ unused part of the output path.
+ \end{command}
+
+ \begin{command}{\pgfpointdecoratedpathlast}
+ The final point of the input path.
+ \end{command}
+
+ \begin{command}{\pgfpointdecorationpathlast}
+ The final point of the output path.
+ \end{command}
+
+ The following style is executed each time a decoration is used. You may use
+ it to set up default options for decorations.
+ %
+ \begin{stylekey}{/pgf/every decoration (initially \normalfont empty)}
+ This style is executed for every decoration.
+ \end{stylekey}
\end{environment}
\begin{plainenvironment}{{pgfdecoration}\marg{name}}
- The plain-\TeX{} version of the |{pgfdecorate}| environment. % TODOsp: `pgfdecorate' right or `pgfdecoration'? really no idea
+ The plain-\TeX{} version of the |{pgfdecorate}| environment.
+ \todosp{`pgfdecorate' right or `pgfdecoration'? really no idea}
\end{plainenvironment}
\begin{contextenvironment}{{pgfdecoration}\marg{name}}
- The Con\TeX t version of the |{pgfdecoration}| environment.
+ The Con\TeX t version of the |{pgfdecoration}| environment.
\end{contextenvironment}
-For convenience, the following macros provide a ``shorthand''
-for decorations (internally, they all use the |{pgfdecoration}|
-environment).
+For convenience, the following macros provide a ``shorthand'' for decorations
+(internally, they all use the |{pgfdecoration}| environment).
\begin{command}{\pgfdecoratepath\marg{name}\marg{path commands}}
- Decorate the path described by \meta{path commands} with the
- decoration \meta{name}. This is equivalent to
+ Decorate the path described by \meta{path commands} with the decoration
+ \meta{name}. This is equivalent to
+ %
\begin{codeexample}[code only]
\pgfdecorate{{name}{\pgfdecoratedpathlength}
{\pgfdecoratebeforecode}{\pgfdecorateaftercode}}
// the path commands.
\endpgfdecorate
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfdecoratecurrentpath\marg{name}}
- Decorate the preexisting path with the decoration \meta{name}.
+ Decorate the preexisting path with the decoration \meta{name}.
\end{command}
-Both the above commands use the current definitions of the following
-macros:
+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|.
+ Code executed as \meta{before code}, see the description of |\pgfdecorate|.
\end{command}
\begin{command}{\pgfdecorateaftercode}
- Code executed as \meta{after code}, see the description of
- |\pgfdecorate|.
+ Code executed as \meta{after code}, see the description of |\pgfdecorate|.
\end{command}
-It may sometimes be useful to add an additional transformation
-for each segment of a decoration. The following command allows
-you to define such a ``last minute transformation.''
+It may sometimes be useful to add an additional transformation for each segment
+of a decoration. The following command allows you to define such a ``last
+minute transformation''.
\begin{command}{\pgfsetdecorationsegmenttransformation\marg{code}}
- The \meta{code} will be executed at the very beginning of each
- segment. Note when applying multiple decorations, this will
- be reset between decorations, so it needs to be specified for
- each segment.
-
+ The \meta{code} will be executed at the very beginning of each segment.
+ Note when applying multiple decorations, this will be reset between
+ decorations, so it needs to be specified for each segment.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
@@ -807,141 +783,133 @@ you to define such a ``last minute transformation.''
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
-
\subsection{Meta-Decorations}
-
\label{section-base-meta-decorations}
-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
-their own decoration. Like ordinary decorations, a meta-decoration must be declared before it can be used.
+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 their own decoration. Like ordinary
+decorations, a meta-decoration must be declared before it can be used.
+
\subsubsection{Declaring Meta-Decorations}
\begin{command}{\pgfdeclaremetadecorate\marg{name}\marg{initial state}\marg{states}}
-
- This command declares a new meta-decoration called \meta{name}. The
- \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
- 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.
-
- The \meta{options} are executed with the key path set to
- |/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
- 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}.
-
- 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
- decoration state. In almost all cases only the following three
- 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 \meta{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
- such as segment length, or segment amplitude, then they
- can be set in \meta{before code}.
+ This command declares a new meta-decoration called \meta{name}. The
+ \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 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.
+
+ The \meta{options} are executed with the key path set to
+ |/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 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}.
+
+ 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
+ decoration state. In almost all cases only the following three 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 \meta{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 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 \meta{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 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.
+ \end{command}
+
+ \begin{command}{\pgfpointmetadecoratedpathlast}
+ When the \meta{after code} is executed, this macro stores the last
+ point on the current sub-input-path.
+ \end{command}
+
+ \begin{command}{\pgfmetadecoratedpathlength}
+ The entire length of the entire input path.
+ \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.
+ \end{command}
\end{command}
- \begin{command}{\afterdecoration\marg{after code}}
- Defines \meta{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 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.
- \end{command}
-
- \begin{command}{\pgfpointmetadecoratedpathlast}
- When the \meta{after code} is executed,
- this macro stores the last point on the current
- sub-input-path.
- \end{command}
-
- \begin{command}{\pgfmetadecoratedpathlength}
- The entire length of the entire input path.
- \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.
- \end{command}
- \end{command}
-
- Here is a complete example of a meta-decoration:
-
+ Here is a complete example of a meta-decoration:
+ %
\begin{codeexample}[]
\pgfdeclaremetadecoration{arrows}{initial}{
\state{initial}[width=0pt, next state=arrow]
- {
+ {
\pgfmathdivide{100}{\pgfmetadecoratedpathlength}
\let\factor\pgfmathresult
\pgfsetlinewidth{1pt}
@@ -958,20 +926,20 @@ their own decoration. Like ordinary decorations, a meta-decoration must be decla
\pgfmathparse{\pgfmetadecoratedcompleteddistance*\factor}
\pgfsetcolor{red!\pgfmathresult!yellow}
\pgfpathmoveto{\pgfpointmetadecoratedpathfirst}
- }
+ }
}
\state{zigzag}[width=\pgfmetadecorationsegmentlength/3, next state=end arrow]
{
- \decoration{zigzag}
+ \decoration{zigzag}
}
\state{end arrow}[width=\pgfmetadecorationsegmentlength/3, next state=move]
{
\decoration{curveto}
\beforedecoration{\pgfpathmoveto{\pgfpointmetadecoratedpathfirst}}
\afterdecoration
- {
+ {
\pgfsetarrowsend{to}
- \pgfusepath{stroke}
+ \pgfusepath{stroke}
}
}
\state{move}[width=\pgfmetadecorationsegmentlength/2, next state=arrow]{}
@@ -984,7 +952,7 @@ their own decoration. Like ordinary decorations, a meta-decoration must be decla
.. controls (0,-6) and (3,-6) .. (3,-8)
.. controls (3,-10) and (0,-10) .. (0,-8);
\end{codeexample}
-
+ %
\end{command}
@@ -995,18 +963,18 @@ There are no predefined meta-decorations loaded with \pgfname{}.
\subsubsection{Using Meta-Decorations}
-Using meta-decorations is ``simpler'' than using decorations, because
-you can only use one meta-decoration per path.
+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
- \meta{environment contents}, with the meta-decoration \meta{name}.
+ This environment decorates the input path described in \meta{environment
+ contents}, with the meta-decoration \meta{name}.
\end{environment}
\begin{plainenvironment}{{pgfmetadecoration}\marg{name}}
- The plain \TeX{} version of the |{pgfmetadecoration}| environment.
+ The plain \TeX{} version of the |{pgfmetadecoration}| environment.
\end{plainenvironment}
\begin{contextenvironment}{{pgfmetadecoration}\marg{name}}
- The Con\TeX t version of the |{pgfmetadecoration}| environment.
+ The Con\TeX t version of the |{pgfmetadecoration}| environment.
\end{contextenvironment}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-design.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-design.tex
index 63d6ebeacf7..72dc66db700 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-design.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-design.tex
@@ -10,54 +10,51 @@
\section{Design Principles}
-This section describes the basic layer of \pgfname. This layer is
-built on top of the system layer. Whereas the system layer just
-provides the absolute minimum for drawing graphics, the basic
-layer provides numerous commands that make it possible to create
-sophisticated graphics easily and also quickly.
-
-The basic layer does not provide a convenient syntax for describing
-graphics, which is left to frontends like \tikzname. For this reason, the
-basic layer is typically used only by ``other programs.'' For example,
-the \textsc{beamer} package uses the basic layer extensively, but does
-not need a convenient input syntax. Rather, speed and flexibility are
-needed when \textsc{beamer} creates graphics.
+This section describes the basic layer of \pgfname. This layer is built on top
+of the system layer. Whereas the system layer just provides the absolute
+minimum for drawing graphics, the basic layer provides numerous commands that
+make it possible to create sophisticated graphics easily and also quickly.
+
+The basic layer does not provide a convenient syntax for describing graphics,
+which is left to frontends like \tikzname. For this reason, the basic layer is
+typically used only by ``other programs''. For example, the \textsc{beamer}
+package uses the basic layer extensively, but does not need a convenient input
+syntax. Rather, speed and flexibility are needed when \textsc{beamer} creates
+graphics.
The following basic design principles underlie the basic layer:
+%
\begin{enumerate}
-\item Structuring into a core and modules.
-\item Consistently named \TeX\ macros for all graphics commands.
-\item Path-centered description of graphics.
-\item Coordinate transformation system.
+ \item Structuring into a core and modules.
+ \item Consistently named \TeX\ macros for all graphics commands.
+ \item Path-centered description of graphics.
+ \item Coordinate transformation system.
\end{enumerate}
-
\subsection{Core and Modules}
-The basic layer consists of a \emph{core package}, called |pgfcore|,
-which provides the most basic commands, and several
-\emph{modules} like commands for plotting (in the |plot| module).
-Modules are loaded using the |\usepgfmodule| command.
-
-If you say |\usepackage{pgf}| or |\input pgf.tex| or
-|\usemodule[pgf]|, the |plot| and |shapes| modules are preloaded (as
-well as the core and the system layer).
+The basic layer consists of a \emph{core package}, called |pgfcore|, which
+provides the most basic commands, and several \emph{modules} like commands for
+plotting (in the |plot| module). Modules are loaded using the |\usepgfmodule|
+command.
+If you say |\usepackage{pgf}| or |\input pgf.tex| or |\usemodule[pgf]|, the
+|plot| and |shapes| modules are preloaded (as well as the core and the system
+layer).
\subsection{Communicating with the Basic Layer via Macros}
-In order to ``communicate'' with the basic layer you use long
-sequences of commands that start with |\pgf|. You are only allowed to
-give these commands inside a |{pgfpicture}| environment. (Note that
-|{tikzpicture}| opens a |{pgfpicture}| internally, so you can freely
-mix \pgfname\ commands and \tikzname\ commands inside a
-|{tikzpicture}|.) It is possible to ``do other things'' between the
-commands. For example, you might use one command to move to a certain
-point, then have a complicated computation of the next point, and then
-move there.
-
+In order to ``communicate'' with the basic layer you use long sequences of
+commands that start with |\pgf|. You are only allowed to give these commands
+inside a |{pgfpicture}| environment. (Note that |{tikzpicture}| opens a
+|{pgfpicture}| internally, so you can freely mix \pgfname\ commands and
+\tikzname\ commands inside a |{tikzpicture}|.) It is possible to ``do other
+things'' between the commands. For example, you might use one command to move
+to a certain point, then have a complicated computation of the next point, and
+then move there.
+%
\begin{codeexample}[]
\newdimen\myypos
\begin{pgfpicture}
@@ -71,94 +68,79 @@ move there.
\end{codeexample}
The following naming conventions are used in the basic layer:
-
+%
\begin{enumerate}
-\item
- All commands and environments start with |pgf|.
-\item
- All commands that specify a point (a coordinate) start with |\pgfpoint|.
-\item
- All commands that extend the current path start with |\pgfpath|.
-\item
- All commands that set/change a graphics parameter start with |\pgfset|.
-\item
- All commands that use a previously declared object (like a path,
- image or shading) start with |\pgfuse|.
-\item
- All commands having to do with coordinate transformations start with
- |\pgftransform|.
-\item
- All commands having to do with arrow tips start with |\pgfarrows|.
-\item
- All commands for ``quickly'' extending or drawing a path start with
- |\pgfpathq| or |\pgfusepathq|.
-\item
- All commands having to do with matrices start with |\pgfmatrix|.
+ \item All commands and environments start with |pgf|.
+ \item All commands that specify a point (a coordinate) start with
+ |\pgfpoint|.
+ \item All commands that extend the current path start with |\pgfpath|.
+ \item All commands that set/change a graphics parameter start with
+ |\pgfset|.
+ \item All commands that use a previously declared object (like a path,
+ image or shading) start with |\pgfuse|.
+ \item All commands having to do with coordinate transformations start with
+ |\pgftransform|.
+ \item All commands having to do with arrow tips start with |\pgfarrows|.
+ \item All commands for ``quickly'' extending or drawing a path start with
+ |\pgfpathq| or |\pgfusepathq|.
+ \item All commands having to do with matrices start with |\pgfmatrix|.
\end{enumerate}
\subsection{Path-Centered Approach}
-In \pgfname\ the most important entity is the \emph{path}. All
-graphics are composed of numerous paths that can be stroked,
-filled, shaded, or clipped against. Paths can be closed or open, they
-can self-intersect and consist of unconnected parts.
-
-Paths are first \emph{constructed} and then \emph{used}. In order to
-construct a path, you can use commands starting with |\pgfpath|. Each
-time such a command is called, the current path is extended in some
-way.
-
-Once a path has been completely constructed, you can use it using the
-command |\pgfusepath|. Depending on the parameters given to this
-command, the path will be stroked (drawn) or filled or subsequent
-drawings will be clipped against this path.
+In \pgfname\ the most important entity is the \emph{path}. All graphics are
+composed of numerous paths that can be stroked, filled, shaded, or clipped
+against. Paths can be closed or open, they can self-intersect and consist of
+unconnected parts.
+Paths are first \emph{constructed} and then \emph{used}. In order to construct
+a path, you can use commands starting with |\pgfpath|. Each time such a command
+is called, the current path is extended in some way.
+Once a path has been completely constructed, you can use it using the command
+|\pgfusepath|. Depending on the parameters given to this command, the path will
+be stroked (drawn) or filled or subsequent drawings will be clipped against
+this path.
\subsection{Coordinate Versus Canvas Transformations}
-
\label{section-design-transformations}
-\pgfname\ provides two transformation systems: \pgfname's own
-\emph{coordinate} transformation matrix and \pdf's or PostScript's
-\emph{canvas} transformation matrix. These two systems are quite
-different. Whereas a scaling by a factor of, say, $2$ of the canvas
-causes \emph{everything} to be scaled by this factor (including
-the thickness of lines and text), a scaling of two in the coordinate
-system causes only the \emph{coordinates} to be scaled, but not the
-line width nor text.
-
-By default, all transformations only apply to the coordinate
-transformation system. However, using the command |\pgflowlevel|
-it is possible to apply a transformation to the canvas.
-
-Coordinate transformations are often preferable over canvas
-transformations. Text and lines that are transformed using canvas
-transformations suffer from differing sizes and lines whose thickness
-differs depending on whether the line is horizontal or vertical. To
-appreciate the difference, consider the following two ``circles'' both
-of which have been scaled in the $x$-direction by a factor of $3$ and
-by a factor of $0.5$ in the $y$-direction. The left circle uses a
-canvas transformation, the right uses \pgfname's coordinate
-transformation (some viewers will render the left graphic incorrectly
-since they do no apply the low-level transformation the way they
-should):
+\pgfname\ provides two transformation systems: \pgfname's own \emph{coordinate}
+transformation matrix and \pdf's or PostScript's \emph{canvas} transformation
+matrix. These two systems are quite different. Whereas a scaling by a factor
+of, say, $2$ of the canvas causes \emph{everything} to be scaled by this factor
+(including the thickness of lines and text), a scaling of two in the coordinate
+system causes only the \emph{coordinates} to be scaled, but not the line width
+nor text.
+
+By default, all transformations only apply to the coordinate transformation
+system. However, using the command |\pgflowlevel| it is possible to apply a
+transformation to the canvas.
+
+Coordinate transformations are often preferable over canvas transformations.
+Text and lines that are transformed using canvas transformations suffer from
+differing sizes and lines whose thickness differs depending on whether the line
+is horizontal or vertical. To appreciate the difference, consider the following
+two ``circles'' both of which have been scaled in the $x$-direction by a factor
+of $3$ and by a factor of $0.5$ in the $y$-direction. The left circle uses a
+canvas transformation, the right uses \pgfname's coordinate transformation
+(some viewers will render the left graphic incorrectly since they do no apply
+the low-level transformation the way they should):
\begin{tikzpicture}[line width=5pt]
- \useasboundingbox (-1.75,-1) rectangle (14,1);
-
- \begin{scope}
- \pgflowlevel{\pgftransformxscale{3}}
- \pgflowlevel{\pgftransformyscale{.5}}
-
- \draw (0,0) circle (0.5cm);
- \draw (.55cm,0pt) node[right] {canvas};
- \end{scope}
- \begin{scope}[xshift=9cm,xscale=3,yscale=.5]
- \draw (0,0) circle (0.5cm);
- \draw (.55cm,0pt) node[right] {coordinate};
- \end{scope}
+ \useasboundingbox (-1.75,-1) rectangle (14,1);
+
+ \begin{scope}
+ \pgflowlevel{\pgftransformxscale{3}}
+ \pgflowlevel{\pgftransformyscale{.5}}
+
+ \draw (0,0) circle (0.5cm);
+ \draw (.55cm,0pt) node[right] {canvas};
+ \end{scope}
+ \begin{scope}[xshift=9cm,xscale=3,yscale=.5]
+ \draw (0,0) circle (0.5cm);
+ \draw (.55cm,0pt) node[right] {coordinate};
+ \end{scope}
\end{tikzpicture}
-
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 33792dd1a2f..033049def23 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
@@ -11,87 +11,82 @@
\section{Externalizing Graphics}
\label{section-external}
-
\subsection{Overview}
-There are two fundamentally different ways of inserting graphics into
-a \TeX-document. First, you can create a graphic using some external
-program like |xfig| or |InDesign| and then include this graphic in
-your text. This is done using commands like |\includegraphics| or
-|\pgfimage|. In this case, the graphic file contains all the low-level
-graphic commands that describe the picture. When such a file is
-included, all \TeX\ has to worry about is the size of the picture; the
-internals of the picture are unknown to \TeX\ and it does not care
-about them.
-
-The second method of creating graphics is to use a special package
-that transforms \TeX-commands like |\draw| or |\psline| into
-appropriate low-level graphic commands. In this case, \TeX\ has to do
-all the hard work of ``typesetting'' the picture and if a picture has
-a complicated internal structure this may take a lot of time.
-
-While \pgfname\ was created to facilitate the second method of
-creating pictures, there are two main reasons why you may need to
-employ the first method of image-inclusion, nevertheless:
-
+There are two fundamentally different ways of inserting graphics into a
+\TeX-document. First, you can create a graphic using some external program like
+|xfig| or |InDesign| and then include this graphic in your text. This is done
+using commands like |\includegraphics| or |\pgfimage|. In this case, the
+graphic file contains all the low-level graphic commands that describe the
+picture. When such a file is included, all \TeX\ has to worry about is the size
+of the picture; the internals of the picture are unknown to \TeX\ and it does
+not care about them.
+
+The second method of creating graphics is to use a special package that
+transforms \TeX-commands like |\draw| or |\psline| into appropriate low-level
+graphic commands. In this case, \TeX\ has to do all the hard work of
+``typesetting'' the picture and if a picture has a complicated internal
+structure this may take a lot of time.
+
+While \pgfname\ was created to facilitate the second method of creating
+pictures, there are two main reasons why you may need to employ the first
+method of image-inclusion, nevertheless:
+%
\begin{enumerate}
-\item Typesetting a picture using \TeX\ can be a very time-consuming
- process. If \TeX\ needs a minute to typeset a picture, you do not
- want to wait this minute when you re\TeX\ your document after having
- changed a single comma.
-\item Some users, especially journal editors, may not be able to
- process files that contain \pgfname\ commands -- for the simple
- reason that the systems of many publishing houses do not have
- \pgfname\ installed.
+ \item Typesetting a picture using \TeX\ can be a very time-consuming
+ process. If \TeX\ needs a minute to typeset a picture, you do not want
+ to wait this minute when you re\TeX\ your document after having changed
+ a single comma.
+ \item Some users, especially journal editors, may not be able to process
+ files that contain \pgfname\ commands -- for the simple reason that the
+ systems of many publishing houses do not have \pgfname\ installed.
\end{enumerate}
-In both cases, the solution is to ``extract'' or ``externalize''
-pictures that would normally be typeset every time a document is \TeX
-ed. Once the pictures have been extracted into separate graphics
-files, these graphic files can be reinserted into the text using the
-first method.
-
-Extracting a graphic from a file is not as easy as it may sound at
-first since \TeX\ cannot write parts of its output into different
-files and a bit of trickery is needed. The following macros
-simplify the workflow:
+In both cases, the solution is to ``extract'' or ``externalize'' pictures that
+would normally be typeset every time a document is \TeX ed. Once the pictures
+have been extracted into separate graphics files, these graphic files can be
+reinserted into the text using the first method.
+Extracting a graphic from a file is not as easy as it may sound at first since
+\TeX\ cannot write parts of its output into different files and a bit of
+trickery is needed. The following macros simplify the workflow:
+%
\begin{enumerate}
-\item You have to tell \pgfname\ which files will be used for which
- pictures. To do so, you enclose each picture that you wish to be
- ``externalized'' in a pair of |\beginpgfgraphicnamed| and
- |\endpgfgraphicnamed| macros.
-\item The next step is to generate the extracted graphics. For this
- you run \TeX\ with the |\jobname| set to the graphic file's
- name. This will cause |\pgfname| to behave in a very special way:
- All of your document will simply be thrown away, \emph{except} for
- the single graphic having the same name as the current jobname.
-\item After you have run \TeX\ once for each graphic that your wish to
- externalize, you can rerun \TeX\ on your document normally. This
- will have the following effect: Each time a |\beginpgfgraphicnamed|
- is encountered, \pgfname\ checks whether a graphic file of the given
- name exists (if you did step 2, it will). If this graphic file
- exists, it will be input and the text till the corresponding
- |\endpgfgraphicnamed| will be ignored.
+ \item You have to tell \pgfname\ which files will be used for which
+ pictures. To do so, you enclose each picture that you wish to be
+ ``externalized'' in a pair of |\beginpgfgraphicnamed| and
+ |\endpgfgraphicnamed| macros.
+ \item The next step is to generate the extracted graphics. For this you run
+ \TeX\ with the |\jobname| set to the graphic file's name. This will
+ cause |\pgfname| to behave in a very special way: All of your document
+ will simply be thrown away, \emph{except} for the single graphic having
+ the same name as the current jobname.
+ \item After you have run \TeX\ once for each graphic that your wish to
+ externalize, you can rerun \TeX\ on your document normally. This will
+ have the following effect: Each time a |\beginpgfgraphicnamed| is
+ encountered, \pgfname\ checks whether a graphic file of the given name
+ exists (if you did step 2, it will). If this graphic file exists, it
+ will be input and the text till the corresponding |\endpgfgraphicnamed|
+ will be ignored.
\end{enumerate}
-In the rest of this section, the above workflow is explained in more
-detail.
+In the rest of this section, the above workflow is explained in more detail.
\subsection{Workflow Step 1: Naming Graphics}
-In order to put each graphic in an external file, you first need to
-tell \pgfname\ the names of these files.
+In order to put each graphic in an external file, you first need to tell
+\pgfname\ the names of these files.
\begin{command}{\beginpgfgraphicnamed\marg{file name prefix}}
- This command indicates that everything up to
- the next call of |\endpgfgraphicnamed| is part of a graphic that
- should be placed in a file named \meta{file name
- prefix}|.|\meta{suffix}, where the \meta{suffix} depends on your
- backend driver. Typically, \meta{suffix} will be |dvi| or |pdf|.
-
- Here is a typical example of how this command is used:
+ This command indicates that everything up to the next call of
+ |\endpgfgraphicnamed| is part of a graphic that should be placed in a file
+ named \meta{file name prefix}|.|\meta{suffix}, where the \meta{suffix}
+ depends on your backend driver. Typically, \meta{suffix} will be |dvi| or
+ |pdf|.
+
+ Here is a typical example of how this command is used:
+ %
\begin{codeexample}[code only]
% In file main.tex:
...
@@ -107,65 +102,69 @@ As we see in Figure~\ref{fig1}, the world is flat.
\end{figure}
\end{codeexample}
- Each graphic to be externalized should have a unique name. Note
- that this name will be used as the name of a file in the file
- system, so it should not contain any funny characters.
-
- This command can have three different effects:
- \begin{enumerate}
- \item The easiest situation arises if there does not yet exist a
- graphic file called \meta{file name prefix}|.|\meta{suffix},
- where the \meta{suffix} is one of the suffixes understood by your
- current backend driver (so |pdf| or |jpg| if you use |pdftex|,
- |eps| if you use |dvips|, and so on). In this case, both this
- command and the |\endpgfgraphicnamed| command simply have no
- effect.
- \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%
- \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
- text up to the next occurrence of |\endpgfgraphicnamed| is thrown
- away without any macro expansion. This means, in particular, that
- (a) you cannot put |\endpgfgraphicnamed| inside a macro and (b)
- the macros used in the graphics need not be defined at all when
- the graphic file is included.
- \item The most complex behaviour arises when current the |\jobname|
- equals the \meta{file name prefix} and, furthermore, the
- \emph{real job name} has been declared. The behaviour for this
- case is explained later.
- \end{enumerate}
-
- Note that the |\beginpgfgraphicnamed| does not really have any
- effect until you have generated the graphic files named. Till then,
- this command is simply ignored. Also, if you delete the graphics
- file later on, the graphics are typeset normally once more.
+ Each graphic to be externalized should have a unique name. Note that this
+ name will be used as the name of a file in the file system, so it should
+ not contain any funny characters.
+
+ This command can have three different effects:
+ %
+ \begin{enumerate}
+ \item The easiest situation arises if there does not yet exist a
+ graphic file called \meta{file name prefix}|.|\meta{suffix}, where
+ the \meta{suffix} is one of the suffixes understood by your current
+ backend driver (so |pdf| or |jpg| if you use |pdftex|, |eps| if you
+ use |dvips|, and so on). In this case, both this command and the
+ |\endpgfgraphicnamed| command simply have no effect.
+ \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%
+ %
+ \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
+ text up to the next occurrence of |\endpgfgraphicnamed| is thrown
+ away without any macro expansion. This means, in particular, that
+ (a) you cannot put |\endpgfgraphicnamed| inside a macro and (b) the
+ macros used in the graphics need not be defined at all when the
+ graphic file is included. \item The most complex behaviour arises
+ when current the |\jobname| equals the \meta{file name prefix} and,
+ furthermore, the \emph{real job name} has been declared. The
+ behaviour for this case is explained later.
+ \end{enumerate}
+
+ Note that the |\beginpgfgraphicnamed| does not really have any effect until
+ you have generated the graphic files named. Till then, this command is
+ simply ignored. Also, if you delete the graphics file later on, the
+ graphics are typeset normally once more.
\end{command}
\begin{command}{\endpgfgraphicnamed}
- This command just marks the end of the graphic that should be
- externalized.
+ This command just marks the end of the graphic that should be externalized.
\end{command}
\subsection{Workflow Step 2: Generating the External Graphics}
-We have now indicated all the graphics for which we would like graphic
-files to be generated. In order to generate the files, you now need to
-modify the |\jobname| appropriately. This is done in two steps:
-
+We have now indicated all the graphics for which we would like graphic files to
+be generated. In order to generate the files, you now need to modify the
+|\jobname| appropriately. This is done in two steps:
+%
\begin{enumerate}
-\item You use the following command to tell \pgfname\ the real name of
- your |.tex| file:
- \begin{command}{\pgfrealjobname\marg{name}}
- Tells \pgfname\ the real name of your job. For instance, if you
- have a file called |survey.tex| that contains two graphics that
- you wish to be called |survey-graphic1| and |survey-graphic2|,
- then you should write the following.
+ \item You use the following command to tell \pgfname\ the real name of your
+ |.tex| file:
+ %
+ \begin{command}{\pgfrealjobname\marg{name}}
+ Tells \pgfname\ the real name of your job. For instance, if you
+ have a file called |survey.tex| that contains two graphics that you
+ wish to be called |survey-graphic1| and |survey-graphic2|, then you
+ should write the following.
+ %
\begin{codeexample}[code only]
% This is file survey.tex
\documentclass{article}
@@ -173,138 +172,148 @@ modify the |\jobname| appropriately. This is done in two steps:
\usepackage{tikz}
\pgfrealjobname{survey}
\end{codeexample}
- \end{command}
-\item You run \TeX\ with the |\jobname| set to the name of
-the graphic for which you need an external graphic to be generated.
-To set the |\jobname|, you use the |--jobname=| option of \TeX:
-
+ \end{command}
+ \item You run \TeX\ with the |\jobname| set to the name of the graphic for
+ which you need an external graphic to be generated. To set the
+ |\jobname|, you use the |--jobname=| option of \TeX:
+ %
\begin{codeexample}[code only, tikz syntax=false]
bash> latex --jobname=survey-graphic1 survey.tex
\end{codeexample}
+ %
\end{enumerate}
The following things will now happen:
+%
\begin{enumerate}
-\item |\pgfrealjobname| notices that the |\jobname|
- is not the ``real'' jobname and, thus, must be the name of a graphic
- that is to be put in an external file.
-\item At the beginning of the document, \pgfname\ changes the
- definition of \TeX's internal |\shipout| macro. The new shipout
- macro simply throws away the output. This means that the document is
- typeset normally, but no output is produced.
-\item When the |\beginpgfgraphicnamed{|\meta{name}|}| command is
- encountered where the \meta{name} is the same as the current
- |\jobname|, then a \TeX-box is started and \meta{everything} up to the
- following |\endpgfgraphicnamed| command is stored inside this box.
-
- Note that, typically, \meta{everything} will contain just a single
- |{tikzpicture}| or |{pgfpicture}| environment. However, this need
- not be the case, you can use, say, a |{pspicture}| environment as
- \meta{everything} or even just some normal \TeX-text.
-\item At the |\endpgfgraphicnamed|, the box \emph{is} shipped out
- using the original |\shipout| command. Thus, unlike everything else,
- the contents of the graphic is made part of the output.
-\item When the box containing the graphic is shipped out, the paper
- size is modified such that it is exactly equal to the height and width
- of the box.
+ \item |\pgfrealjobname| notices that the |\jobname| is not the ``real''
+ jobname and, thus, must be the name of a graphic that is to be put in
+ an external file.
+ \item At the beginning of the document, \pgfname\ changes the definition of
+ \TeX's internal |\shipout| macro. The new shipout macro simply throws
+ away the output. This means that the document is typeset normally, but
+ no output is produced.
+ \item When the |\beginpgfgraphicnamed{|\meta{name}|}| command is
+ encountered where the \meta{name} is the same as the current
+ |\jobname|, then a \TeX-box is started and \meta{everything} up to the
+ following |\endpgfgraphicnamed| command is stored inside this box.
+
+ Note that, typically, \meta{everything} will contain just a single
+ |{tikzpicture}| or |{pgfpicture}| environment. However, this need not
+ be the case, you can use, say, a |{pspicture}| environment as
+ \meta{everything} or even just some normal \TeX-text.
+ \item At the |\endpgfgraphicnamed|, the box \emph{is} shipped out using the
+ original |\shipout| command. Thus, unlike everything else, the contents
+ of the graphic is made part of the output.
+ \item When the box containing the graphic is shipped out, the paper size is
+ modified such that it is exactly equal to the height and width of the
+ box.
\end{enumerate}
-The net effect of everything described above is that the two
-commands
+The net effect of everything described above is that the two commands
+%
\begin{codeexample}[code only, tikz syntax=false]
bash> latex --jobname=survey-graphic1 survey.tex
bash> dvips survey-graphic1
\end{codeexample}
+%
\noindent produce a file called |survey-graphic1.ps| that consists of a single
page that contains exactly the graphic produced by the code between
-|\beginpgfgraphicnamed{survey-graphic1}| and
-|\endpgfgraphicnamed|. Furthermore, the size of this single page is
-exactly the size of the graphic.
+|\beginpgfgraphicnamed{survey-graphic1}| and |\endpgfgraphicnamed|.
+Furthermore, the size of this single page is exactly the size of the graphic.
If you use pdf\TeX, producing the graphic is even simpler:
+%
\begin{codeexample}[code only, tikz syntax=false]
bash> pdflatex --jobname=survey-graphic1 survey.tex
\end{codeexample}
+%
\noindent produces the single-page |pdf|-file |survey-graphic1.pdf|.
+
\subsection{Workflow Step 3: Including the External Graphics}
-Once you have produced all the pictures in the text, including them
-into the main document is easy: Simply run \TeX\ again without any
-modification of the |\jobname|. In this case the
-|\pgfrealjobname| command will notice that the main file is, indeed,
-the main file. The main file will then be typeset normally and the
-|\beginpgfgraphicnamed| commands also behave normally, which means
-that they will try to include the generated graphic files -- which is
+Once you have produced all the pictures in the text, including them into the
+main document is easy: Simply run \TeX\ again without any modification of the
+|\jobname|. In this case the |\pgfrealjobname| command will notice that the
+main file is, indeed, the main file. The main file will then be typeset
+normally and the |\beginpgfgraphicnamed| commands also behave normally, which
+means that they will try to include the generated graphic files -- which is
exactly what you want.
-Suppose that you wish to send your survey to a journal that does not
-have \pgfname\ installed. In this case, you now have all the necessary
-external graphics, but you still need \pgfname\ to automatically
-include them instead of the executing the picture code! One way to
-solve this problem is to simply delete all of the \pgfname\ or
-\tikzname\ code from your |survey.tex| and instead insert appropriate
-|\includegraphics| commands ``by hand.'' However, there is a better
-way: You input the file |pgfexternal.tex|.
+Suppose that you wish to send your survey to a journal that does not have
+\pgfname\ installed. In this case, you now have all the necessary external
+graphics, but you still need \pgfname\ to automatically include them instead of
+the executing the picture code! One way to solve this problem is to simply
+delete all of the \pgfname\ or \tikzname\ code from your |survey.tex| and
+instead insert appropriate |\includegraphics| commands ``by hand''. However,
+there is a better way: You input the file |pgfexternal.tex|.
\begin{filedescription}{pgfexternal.tex}
- This file defines the command |\beginpgfgraphicnamed| and causes it
- to have the following effect: It includes the graphic file given as
- a parameter to it and then gobbles everything up to
- |\endpgfgraphicnamed|.
-
- Since |\beginpgfgraphicnamed| does not do macro expansion as it
- searches for |\endpgfgraphicnamed|, it is not necessary to actually
- include the packages necessary for \emph{creating} the graphics.
- So the idea is that you comment out things like |\usepackage{tikz}|
- and instead say |\input pgfexternal.tex|.
-
- Indeed, the contents of this file is simply the following line:
+ This file defines the command |\beginpgfgraphicnamed| and causes it to have
+ the following effect: It includes the graphic file given as a parameter to
+ it and then gobbles everything up to |\endpgfgraphicnamed|.
+
+ Since |\beginpgfgraphicnamed| does not do macro expansion as it searches
+ for |\endpgfgraphicnamed|, it is not necessary to actually include the
+ packages necessary for \emph{creating} the graphics. So the idea is that
+ you comment out things like |\usepackage{tikz}| and instead say |\input
+ pgfexternal.tex|.
+
+ Indeed, the contents of this file is simply the following line:
+ %
\begin{codeexample}[code only]
\long\def\beginpgfgraphicnamed#1#2\endpgfgraphicnamed{\includegraphics{#1}}
\end{codeexample}
- Instead of |\input pgfexternal.tex| you could also include this line
- in your main file.
+ Instead of |\input pgfexternal.tex| you could also include this line in
+ your main file.
\end{filedescription}
-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|.
+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|.
+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.
+ 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:
+ 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.
+ %
+ 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.
+ 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 = [ ... ]|.
+ A possible value for |viewport| can be found in the |.pdf| image, search
+ for |/MediaBox = [ ... ]|.
\end{key}
+
\subsection{A Complete Example}
-Let us now have a look at a simple, but complete example. We start out
-with a normal file called |survey.tex| that has the following
-contents:
+Let us now have a look at a simple, but complete example. We start out with a
+normal file called |survey.tex| that has the following contents:
+%
\begin{codeexample}[code only]
% This is the file survey.tex
\documentclass{article}
@@ -325,10 +334,10 @@ By comparison, in this figure we see a rectangle:
\end{document}
\end{codeexample}
-Now our editor tells us that the publisher will need all figures to be
-provided in separate PostScript or |.pdf|-files. For this, we
-enclose all figures in |...graphicnamed|-pairs and we add a call to
-the |\pgfrealjobname| macro:
+Now our editor tells us that the publisher will need all figures to be provided
+in separate PostScript or |.pdf|-files. For this, we enclose all figures in
+|...graphicnamed|-pairs and we add a call to the |\pgfrealjobname| macro:
+%
\begin{codeexample}[code only]
% This is the file survey.tex
\documentclass{article}
@@ -354,12 +363,12 @@ By comparison, in this figure we see a rectangle:
\end{document}
\end{codeexample}
-After these changes, typesetting the file will still yield the same
-output as it did before -- after all, we have not yet created any
-external graphics.
+After these changes, typesetting the file will still yield the same output as
+it did before -- after all, we have not yet created any external graphics.
-To create the external graphics, we run |pdflatex| twice, once for
-each graphic:
+To create the external graphics, we run |pdflatex| twice, once for each
+graphic:
+%
\begin{codeexample}[code only, tikz syntax=false]
bash> pdflatex --jobname=survey-f1 survey.tex
This is pdfTeX, Version 3.141592-1.40.3 (Web2C 7.5.6)
@@ -390,6 +399,7 @@ We can now send the two generated graphics (|survey-f1.pdf| and
|\usepackage{tikz}| and they do not have \pgfname\ installed.
Thus, we modify the main file |survey.tex| as follows:
+%
\begin{codeexample}[code only]
% This is the file survey.tex
\documentclass{article}
@@ -415,9 +425,11 @@ By comparison, in this figure we see a rectangle:
\endpgfgraphicnamed
\end{document}
\end{codeexample}
+%
If we now run pdf\LaTeX, then, indeed, \pgfname\ is no longer needed:
% In the following, we switch off typesetting of listings because the
% parentheses confuse the pretty printer
+%
\begin{codeexample}[code only,typeset listing/.code=#1]
bash> pdflatex survey.tex
This is pdfTeX, Version 3.141592-1.40.3 (Web2C 7.5.6)
@@ -445,25 +457,33 @@ 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|.
-\item The graphic file |survey-f2.pdf|.
-\item The file |pgfexternal.tex|, whose contents is simply
+ \item The last |survey.tex| shown above.
+ \item The graphic file |survey-f1.pdf|.
+ \item The graphic file |survey-f2.pdf|.
+ \item The file |pgfexternal.tex|, whose contents is simply
+ %
\begin{codeexample}[code only]
\long\def\beginpgfgraphicnamed#1#2\endpgfgraphicnamed{\includegraphics{#1}}
\end{codeexample}
- (Alternatively, we can also directly add this line to our
- |survey.tex| file).
+ %
+ (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
+%
+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
+ \ifeof1 \box1
\else
\read1 to\pgfincludeexternalgraphicsdp\closein1
\dimen0=\pgfincludeexternalgraphicsdp\relax
@@ -472,10 +492,11 @@ In case we have used the |baseline| option, we also need to include any |.dpth|
\endgroup
}
\end{codeexample}
+%
Again, we could simply copy these lines to our |survey.tex| file.
-%%% 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-images.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-images.tex
index 79ff832a88d..e8531820ca2 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
@@ -11,7 +11,6 @@
\section{Declaring and Using Images}
\label{section-images}
-
This section describes the commands for creating images.
@@ -19,134 +18,127 @@ This section describes the commands for creating images.
To be quite frank, \LaTeX's |\includegraphics| is designed better than
\pgfname's image mechanism. For this reason, \emph{I recommend that you use the
- standard image inclusion mechanism of your format}. Thus, \LaTeX\
-users are encouraged to use |\includegraphics| to include images.
+standard image inclusion mechanism of your format}. Thus, \LaTeX\ users are
+encouraged to use |\includegraphics| to include images.
-However, there are reasons why you might need to use the image
-inclusion facilities of \pgfname:
+However, there are reasons why you might need to use the image inclusion
+facilities of \pgfname:
+%
\begin{itemize}
-\item
- There is no standard image inclusion mechanism in your format. For
- example, plain \TeX\ does not have one, so \pgfname's inclusion
- mechanism is ``better than nothing.''
-
- However, this applies only to the |pdftex| backend. For all other
- backends, \pgfname\ currently maps its commands back to the |graphicx|
- 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.
-\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
- the graphics package in \LaTeX\ in the future.
+ \item There is no standard image inclusion mechanism in your format. For
+ example, plain \TeX\ does not have one, so \pgfname's inclusion
+ mechanism is ``better than nothing''.
+
+ However, this applies only to the |pdftex| backend. For all other
+ backends, \pgfname\ currently maps its commands back to the |graphicx|
+ 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.
+ \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 the
+ graphics package in \LaTeX\ in the future.
\end{itemize}
-Whatever your choice, you can still use the usual image inclusion
-facilities of the |graphics| package.
-
-The general approach taken by \pgfname\ to including an image is the
-following: First, |\pgfdeclareimage| declares the
-image. This must be done prior to the first use of the image. Once you
-have declared an image, you can insert it into the text using
-|\pgfuseimage|. The advantage of this two-phase approach is that, at
-least for \textsc{pdf}, the image data will only be included once in the
-file. This can drastically reduce the file size if you use an image
-repeatedly, for example in an overlay. However, there is also a
-command called |\pgfimage| that declares and then immediately uses the
-image.
-
-To speedup the compilation, you may wish to use the following class
-option:
+Whatever your choice, you can still use the usual image inclusion facilities of
+the |graphics| package.
+
+The general approach taken by \pgfname\ to including an image is the following:
+First, |\pgfdeclareimage| declares the image. This must be done prior to the
+first use of the image. Once you have declared an image, you can insert it into
+the text using |\pgfuseimage|. The advantage of this two-phase approach is
+that, at least for \textsc{pdf}, the image data will only be included once in
+the file. This can drastically reduce the file size if you use an image
+repeatedly, for example in an overlay. However, there is also a command called
+|\pgfimage| that declares and then immediately uses the image.
+
+To speedup the compilation, you may wish to use the following class option:
+%
\begin{packageoption}{draft}
- 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.
+ 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.
\end{packageoption}
-\subsection{Declaring an Image}
-\begin{command}{\pgfdeclareimage\oarg{options}\marg{image
- name}\marg{filename}}
- Declares an image, but does not paint anything. To draw the image,
- 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.
-
- The following options are possible:
- \begin{itemize}
- \item
- \declare{|height=|\meta{dimension}} sets the height of the
- image. If the width is not specified simultaneously, the aspect
- ratio of the image is kept.
- \item
- \declare{|width=|\meta{dimension}} sets the width of the
- image. If the height is not specified simultaneously, the aspect
- ratio of the image is kept.
- \item
- \declare{|page=|\meta{page number}} selects a given page number
- from a multipage document. Specifying this option will have the
- following effect: first, \pgfname\ tries to find a file named
- \begin{quote}
- \meta{filename}|.page|\meta{page number}|.|\meta{extension}
- \end{quote}
- If such a file is found, it will be used instead of the originally
- specified filename. If not, \pgfname\ inserts the image stored in
- \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.
- \item
- \declare{|interpolate=|\meta{true or false}} selects whether the
- image should be ``smoothed'' when zoomed. False by default.
- \item
- \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.
- \end{itemize}
+\subsection{Declaring an Image}
+\begin{command}{\pgfdeclareimage\oarg{options}\marg{image name}\marg{filename}}
+ Declares an image, but does not paint anything. To draw the image, 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.
+
+ The following options are possible:
+ %
+ \begin{itemize}
+ \item \declare{|height=|\meta{dimension}} sets the height of the image.
+ If the width is not specified simultaneously, the aspect ratio of
+ the image is kept.
+ \item \declare{|width=|\meta{dimension}} sets the width of the image.
+ If the height is not specified simultaneously, the aspect ratio of
+ the image is kept.
+ \item \declare{|page=|\meta{page number}} selects a given page number
+ from a multipage document. Specifying this option will have the
+ following effect: first, \pgfname\ tries to find a file named
+ %
+ \begin{quote}
+ \meta{filename}|.page|\meta{page number}|.|\meta{extension}
+ \end{quote}
+ %
+ If such a file is found, it will be used instead of the originally
+ specified filename. If not, \pgfname\ inserts the image stored in
+ \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.
+ \item \declare{|interpolate=|\meta{true or false}} selects whether the
+ image should be ``smoothed'' when zoomed. False by default.
+ \item \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.
+ \end{itemize}
+ %
\begin{codeexample}[code only]
\pgfdeclareimage[interpolate=true,height=1cm]{image1}{brave-gnu-world-logo}
\pgfdeclareimage[interpolate=true,width=1cm,height=1cm]{image2}{brave-gnu-world-logo}
\pgfdeclareimage[interpolate=true,height=1cm]{image3}{brave-gnu-world-logo}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgfaliasimage\marg{new image name}\marg{existing image name}}
- The \marg{existing image name} is ``cloned'' and the \marg{new image
- name} can now be used whenever the original image is used. This
- command is useful for creating aliases for alternate extensions
- and for accessing the last image inserted using |\pgfimage|.
+ The \marg{existing image name} is ``cloned'' and the \marg{new image name}
+ can now be used whenever the original image is used. This command is useful
+ for creating aliases for alternate extensions and for accessing the last
+ image inserted using |\pgfimage|.
- \example |\pgfaliasimage{image.!30!white}{image.!25!white}|
+ \example |\pgfaliasimage{image.!30!white}{image.!25!white}|
\end{command}
\subsection{Using an Image}
\begin{command}{\pgfuseimage\marg{image name}}
- Inserts a previously declared image into the \emph{normal text}. If
- you wish to use it in a |{pgfpicture}| environment, you must put a
- |\pgftext| around it.
-
- If the macro |\pgfalternateextension| expands to some nonempty
- \meta{alternate extension}, \pgfname\ will first try to use the image
- named \meta{image name}|.|\meta{alternate extension}. If this
- image is not defined, \pgfname\ will next check whether \meta{alternate
- extension} contains a |!| character. If so, everything up to this
- exclamation mark and including it is deleted from \meta{alternate
- extension} and the \pgfname\ again tries to use the image \meta{image
- name}|.|\meta{alternate extension}. This is repeated until
- \meta{alternate extension} no longer contains a~|!|. Then the
- original image is used.
-
- The |xxcolor| package sets the alternate extension to the current
- color mixin. % TODOsp: `color mixin': meant `color mixing' or the `colormixin' environment?
-
+ Inserts a previously declared image into the \emph{normal text}. If you
+ wish to use it in a |{pgfpicture}| environment, you must put a |\pgftext|
+ around it.
+
+ If the macro |\pgfalternateextension| expands to some nonempty
+ \meta{alternate extension}, \pgfname\ will first try to use the image named
+ \meta{image name}|.|\meta{alternate extension}. If this image is not
+ defined, \pgfname\ will next check whether \meta{alternate extension}
+ contains a |!| character. If so, everything up to this exclamation mark and
+ including it is deleted from \meta{alternate extension} and the \pgfname\
+ again tries to use the image \meta{image name}|.|\meta{alternate
+ extension}. This is repeated until \meta{alternate extension} no longer
+ contains a~|!|. Then the original image is used.
+
+ The |xxcolor| package sets the alternate extension to the current color
+ mixin.
+ %
\begin{codeexample}[]
\pgfdeclareimage[interpolate=true,width=1cm,height=1cm]
{image1}{brave-gnu-world-logo}
@@ -164,9 +156,9 @@ option:
\end{pgfpicture}
\end{codeexample}
- The following example demonstrates the effect of using
- |\pgfuseimage| inside a colormixin environment.
-
+ The following example demonstrates the effect of using |\pgfuseimage|
+ inside a colormixin environment.
+ %
\begin{codeexample}[]
\pgfdeclareimage[interpolate=true,width=1cm,height=1cm]
{image1.!25!white}{brave-gnu-world-logo.25}
@@ -187,21 +179,21 @@ option:
\end{pgfpicture}
\end{colormixin}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfalternateextension}
- You should redefine this command to install a different alternate
- extension.
+ You should redefine this command to install a different alternate
+ extension.
- \example |\def\pgfalternateextension{!25!white}|
+ \example |\def\pgfalternateextension{!25!white}|
\end{command}
-
\begin{command}{\pgfimage\oarg{options}\marg{filename}}
- Declares the image under the name |pgflastimage| and
- immediately uses it. You can ``save'' the image for later usage by
- invoking |\pgfaliasimage| on |pgflastimage|.
-
+ 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}
@@ -219,44 +211,45 @@ option:
\end{pgfpicture}
\end{colormixin}
\end{codeexample}
+ %
\end{command}
-
\subsection{Masking an Image}
-
\begin{command}{\pgfdeclaremask\oarg{options}\marg{mask name}\marg{filename}}
- Declares a transparency mask named \meta{mask name} (called a
- \emph{soft mask} in the \textsc{pdf} specification). This mask is
- read from the file \meta{filename}. This file should contain a
- grayscale image that is as large as the actual image. A white
- pixel in the mask will correspond to ``transparent,'' a black pixel
- to ``solid,'' and gray values correspond to intermediate values. The
- mask must have a single ``color channel.'' This means that the
- mask must be a ``real'' grayscale image, not an \textsc{rgb}-image
- in which all \textsc{rgb}-triples happen to have the same
- components.
-
- You can only mask images the are in a ``pixel format.'' These are
- |.jpg| and |.png|. You cannot mask |.pdf| images in this way. Also,
- again, the mask file and the image file must have the same size.
-
- The following options may be given:
- \begin{itemize}
- \item |matte=|\marg{color components} sets the so-called
- \emph{matte} of the actual image (strangely, this has to be
- specified together with the mask, not with the image itself). The
- matte is the color that has been used to preblend the image. For
- example, if the image has been preblended with a red background,
- then \meta{color components} should be set to |{1 0 0}|. The
- default is |{1 1 1}|, which is white in the rgb model.
-
- The matte is specified in terms of the parent's image color
- space. Thus, if the parent is a grayscale image, the matte has to
- be set to |{1}|.
- \end{itemize}
- \example
+ Declares a transparency mask named \meta{mask name} (called a \emph{soft
+ mask} in the \textsc{pdf} specification). This mask is read from the file
+ \meta{filename}. This file should contain a grayscale image that is as
+ large as the actual image. A white pixel in the mask will correspond to
+ ``transparent'', a black pixel to ``solid'', and gray values correspond to
+ intermediate values. The mask must have a single ``color channel''. This
+ means that the mask must be a ``real'' grayscale image, not an
+ \textsc{rgb}-image in which all \textsc{rgb}-triples happen to have the
+ same components.
+
+ You can only mask images the are in a ``pixel format''. These are |.jpg|
+ and |.png|. You cannot mask |.pdf| images in this way. Also, again, the
+ mask file and the image file must have the same size.
+
+ The following options may be given:
+ %
+ \begin{itemize}
+ \item |matte=|\marg{color components} sets the so-called \emph{matte}
+ of the actual image (strangely, this has to be specified together
+ with the mask, not with the image itself). The matte is the color
+ that has been used to preblend the image. For example, if the image
+ has been preblended with a red background, then \meta{color
+ components} should be set to |{1 0 0}|. The default is |{1 1 1}|,
+ which is white in the rgb model.
+
+ The matte is specified in terms of the parent's image color space.
+ Thus, if the parent is a grayscale image, the matte has to be set
+ to |{1}|.
+ \end{itemize}
+ %
+ \example
+ %
\begin{codeexample}[]
%% Draw a large colorful background
\pgfdeclarehorizontalshading{colorful}{5cm}{color(0cm)=(red);
@@ -269,8 +262,10 @@ color(14cm)=(green)}
\pgfdeclaremask{mymask}{brave-gnu-world-logo-mask}
\pgfimage[mask=mymask,height=4cm,interpolate=true]{brave-gnu-world-logo}}
\end{codeexample}
+ %
\end{command}
+
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
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
index 035e10b1edd..64c9da58f16 100644
--- 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
@@ -9,69 +9,103 @@
\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.
+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|.
+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.
+ 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.
+ 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
+ \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.
+ %
+ \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.
+ 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.
+ \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.
+ 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 |\r@pgf@writea| and you should always close the file before returning from your code.
+ 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
+ |\r@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
@@ -84,9 +118,10 @@ looking into the source code of |\pgfpointadd| to see which registers are used.
\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|.
+ 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-layers.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-layers.tex
index 0f1c9e1eb02..65ec0f8896a 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-layers.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-layers.tex
@@ -9,95 +9,91 @@
\section{Layered Graphics}
-
\label{section-layers}
\subsection{Overview}
-\pgfname\ provides a layering mechanism for composing graphics from
-multiple layers. (This mechanism is not to be confused with the
-conceptual ``software layers'' the \pgfname\ system is composed of.)
-Layers are often used in graphic programs. The idea is that you can
-draw on the different layers in any order. So you might start drawing
-something on the ``background'' layer, then something on the
-``foreground'' layer, then something on the ``middle'' layer, and then
-something on the background layer once more, and so on. At the end, no
-matter in which ordering you drew on the different layers, the layers
-are ``stacked on top of each other'' in a fixed ordering to produce
-the final picture. Thus, anything drawn on the middle layer would come
-on top of everything of the background layer.
-
-Normally, you do not need to use different layers since you will have
-little trouble ``ordering'' your graphic commands in such a way that
-layers are superfluous. However, in certain situations you only
-``know'' what you should draw behind something else after the
-``something else'' has been drawn.
-
-For example, suppose you wish to draw a yellow background behind your
-picture. The background should be as large as the bounding box of the
-picture, plus a little border. If you know the size of the bounding box
-of the picture at its beginning, this is easy to accomplish. However,
-in general this is not the case and you need to create a
-``background'' layer in addition to the standard ``main'' layer. Then,
-at the end of the picture, when the bounding box has been established,
-you can add a rectangle of the appropriate size to the picture.
-
+\pgfname\ provides a layering mechanism for composing graphics from multiple
+layers. (This mechanism is not to be confused with the conceptual ``software
+layers'' the \pgfname\ system is composed of.) Layers are often used in graphic
+programs. The idea is that you can draw on the different layers in any order.
+So you might start drawing something on the ``background'' layer, then
+something on the ``foreground'' layer, then something on the ``middle'' layer,
+and then something on the background layer once more, and so on. At the end, no
+matter in which ordering you drew on the different layers, the layers are
+``stacked on top of each other'' in a fixed ordering to produce the final
+picture. Thus, anything drawn on the middle layer would come on top of
+everything of the background layer.
+
+Normally, you do not need to use different layers since you will have little
+trouble ``ordering'' your graphic commands in such a way that layers are
+superfluous. However, in certain situations you only ``know'' what you should
+draw behind something else after the ``something else'' has been drawn.
+
+For example, suppose you wish to draw a yellow background behind your picture.
+The background should be as large as the bounding box of the picture, plus a
+little border. If you know the size of the bounding box of the picture at its
+beginning, this is easy to accomplish. However, in general this is not the case
+and you need to create a ``background'' layer in addition to the standard
+``main'' layer. Then, at the end of the picture, when the bounding box has been
+established, you can add a rectangle of the appropriate size to the picture.
\subsection{Declaring Layers}
-In \pgfname\ layers are referenced using names. The standard layer,
-which is a bit special in certain ways, is called |main|. If nothing
-else is specified, all graphic commands are added to the |main|
-layer. You can declare a new layer using the following command:
+In \pgfname\ layers are referenced using names. The standard layer, which is a
+bit special in certain ways, is called |main|. If nothing else is specified,
+all graphic commands are added to the |main| layer. You can declare a new layer
+using the following command:
\begin{command}{\pgfdeclarelayer\marg{name}}
- This command declares a layer named \meta{name} for later
- use. Mainly, this will set up some internal bookkeeping.
+ This command declares a layer named \meta{name} for later use. Mainly, this
+ will set up some internal bookkeeping.
\end{command}
-The next step toward using a layer is to tell \pgfname\ which layers
-will be part of the actual picture and which will be their
-ordering. Thus, it is possible to have more layers declared than are
-actually used.
+The next step toward using a layer is to tell \pgfname\ which layers will be
+part of the actual picture and which will be their ordering. Thus, it is
+possible to have more layers declared than are actually used.
\begin{command}{\pgfsetlayers\marg{layer list}}
- This command tells \pgfname\ which layers will be used in
- pictures. They are stacked on top of each other in the order
- given. The layer |main| should always be part of the list. Here is
- an example:
+ This command tells \pgfname\ which layers will be used in pictures. They
+ are stacked on top of each other in the order given. The layer |main|
+ should always be part of the list. Here is an example:
+ %
\begin{codeexample}[code only]
\pgfdeclarelayer{background}
-\pgfdeclarelayer{foreground}
+\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
\end{codeexample}
- This command should be given either outside of any picture or ``directly inside'' of a picture.
- Here, the ``directly inside'' means that there should be no further level of \TeX\ grouping between |\pgfsetlayers| and the matching |\end{pgfpicture}| (no closing braces, no |\end{...}|). It will also work if |\pgfsetlayers| is provided before |\end{tikzpicture}| (with similar restrictions).
+ This command should be given either outside of any picture or ``directly
+ inside'' of a picture. Here, the ``directly inside'' means that there
+ should be no further level of \TeX\ grouping between |\pgfsetlayers| and
+ the matching |\end{pgfpicture}| (no closing braces, no |\end{...}|). It
+ will also work if |\pgfsetlayers| is provided before |\end{tikzpicture}|
+ (with similar restrictions).
\end{command}
\subsection{Using Layers}
-Once the layers of your picture have been declared, you can start to
-``fill'' them. As said before, all graphics commands are normally
-added to the |main| layer. Using the |{pgfonlayer}| environment, you
-can tell \pgfname\ that certain commands should, instead, be added to
-the given layer.
+Once the layers of your picture have been declared, you can start to ``fill''
+them. As said before, all graphics commands are normally added to the |main|
+layer. Using the |{pgfonlayer}| environment, you can tell \pgfname\ that
+certain commands should, instead, be added to the given layer.
\begin{environment}{{pgfonlayer}\marg{layer name}}
- The whole \meta{environment contents} is added to the layer with the
- name \meta{layer name}. This environment can be used anywhere inside
- a picture. Thus, even if it is used inside a |{pgfscope}| or a \TeX\
- group, the contents will still be added to the ``whole'' picture.
- Using this environment multiple times inside the same picture will
- cause the \meta{environment contents} to accumulate.
-
- \emph{Note:} You can \emph{not} add anything to the |main| layer
- using this environment. The only way to add anything to the main
- layer is to give graphic commands outside all |{pgfonlayer}|
- environments.
-
+ The whole \meta{environment contents} is added to the layer with the name
+ \meta{layer name}. This environment can be used anywhere inside a picture.
+ Thus, even if it is used inside a |{pgfscope}| or a \TeX\ group, the
+ contents will still be added to the ``whole'' picture. Using this
+ environment multiple times inside the same picture will cause the
+ \meta{environment contents} to accumulate.
+
+ \emph{Note:} You can \emph{not} add anything to the |main| layer using this
+ environment. The only way to add anything to the main layer is to give
+ graphic commands outside all |{pgfonlayer}| environments.
+ %
\begin{codeexample}[]
\pgfdeclarelayer{background layer}
\pgfdeclarelayer{foreground layer}
@@ -105,15 +101,15 @@ the given layer.
\begin{tikzpicture}
% On main layer:
\fill[blue] (0,0) circle (1cm);
-
+
\begin{pgfonlayer}{background layer}
\fill[yellow] (-1,-1) rectangle (1,1);
\end{pgfonlayer}
-
+
\begin{pgfonlayer}{foreground layer}
\node[white] {foreground};
\end{pgfonlayer}
-
+
\begin{pgfonlayer}{background layer}
\fill[black] (-.8,-.8) rectangle (.8,.8);
\end{pgfonlayer}
@@ -122,22 +118,19 @@ the given layer.
\fill[blue!50] (-.5,-1) rectangle (.5,1);
\end{tikzpicture}
\end{codeexample}
+ %
\end{environment}
\begin{plainenvironment}{{pgfonlayer}\marg{layer name}}
- This is the plain \TeX\ version of the environment.
+ This is the plain \TeX\ version of the environment.
\end{plainenvironment}
\begin{contextenvironment}{{pgfonlayer}\marg{layer name}}
- This is the Con\TeX t version of the environment.
+ This is the Con\TeX t version of the environment.
\end{contextenvironment}
-
-
-
-
-%%% 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-matrices.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-matrices.tex
index ca17510a797..edba1275d1e 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
@@ -9,51 +9,46 @@
\section{Matrices}
-
\label{section-base-matrices}
\begin{pgfmodule}{matrix}
- The present section documents the commands of this module.
+The present section documents the commands of this module.
\end{pgfmodule}
\subsection{Overview}
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.
+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.
-In the following, the basic idea behind the alignment mechanism is
-explained first. Then the command |\pgfmatrix| is explained. At the
-end of the section, additional ways of modifying the width of columns
-and rows are discussed.
+In the following, the basic idea behind the alignment mechanism is explained
+first. Then the command |\pgfmatrix| is explained. At the end of the section,
+additional ways of modifying the width of columns and rows are discussed.
\subsection{Cell Pictures and Their Alignment}
-A matrix consists of rows of \emph{cells}. Cells are separated using
-the special command |\pgfmatrixnextcell|, rows are ended using the
-command |\pgfmatrixendrow| (the command |\\| is set up 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 bounding box like a
-normal picture does. These bounding boxes are important for the
-alignment as explained in the following.
-
-Each cell picture will have an origin somewhere in the picture (or
-even outside the picture). The position of these origins are important
-for the alignment: On each row the origins will be on the same
-horizontal line and for each column the origins will also be on the
-same vertical line. These two requirements mean that the cell pictures
-may need to be shifted around so that the origins wind up on the same
-lines. The top of a row is given by the top of the cell picture whose
-bounding box's maximum $y$-position is largest. Similarly, the bottom
-of a row is given by the bottom of the cell picture whose bounding
-box's minimum $y$-position is the most negative. Similarly, the left
-end of a row is given by the left end of the cell whose bounding box's
-$x$-position is the most negative; and similarly for the right end of
-a row.
-
+A matrix consists of rows of \emph{cells}. Cells are separated using the
+special command |\pgfmatrixnextcell|, rows are ended using the command
+|\pgfmatrixendrow| (the command |\\| is set up 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 bounding box like a normal picture does. These
+bounding boxes are important for the alignment as explained in the following.
+
+Each cell picture will have an origin somewhere in the picture (or even outside
+the picture). The position of these origins are important for the alignment: On
+each row the origins will be on the same horizontal line and for each column
+the origins will also be on the same vertical line. These two requirements mean
+that the cell pictures may need to be shifted around so that the origins wind
+up on the same lines. The top of a row is given by the top of the cell picture
+whose bounding box's maximum $y$-position is largest. Similarly, the bottom of
+a row is given by the bottom of the cell picture whose bounding box's minimum
+$y$-position is the most negative. Similarly, the left end of a column is given
+by the left end of the cell whose bounding box's $x$-position is the most
+negative; and similarly for the right end of a column.
+%
\begin{codeexample}[]
\begin{tikzpicture}[x=3mm,y=3mm,fill=blue!50]
\def\atorig#1{\node[black] at (0,0) {\tiny #1};}
@@ -78,47 +73,45 @@ a row.
All matrices are typeset using the following command:
-\begin{command}{\pgfmatrix\marg{shape}\marg{anchor}\marg{name}%
- \marg{usage}\marg{shift}\marg{pre-code}\marg{matrix cells}}
-
- This command creates a node that contains a matrix. The name of the
- node is \meta{name}, its shape is \meta{shape} and the node is
- anchored at \meta{anchor}.
-
- The \meta{matrix cell} parameter contains the cells of the
- matrix. In each cell drawing commands may be given, which create a
- so-called cell picture. For each cell picture a bounding box is
- computed and the cells are aligned according to the rules outlined
- in the previous section.
-
- The resulting matrix is used as the |text| box of the node. As for a
- normal node, the \meta{usage} commands are applied, so that the
- path(s) of the resulting node is (are) stroked or filled or whatever.
-
- \medskip
- \textbf{Specifying the cells and rows.\ }
- Even though this command uses |\halign| internally, there are two
- special rules for indicating cells:
- \begin{enumerate}
- \item Cells in the same row must be separated using the macro
- |\pgfmatrixnextcell| rather than |&|. Using |&| will result in an
- error message.
-
- However, you can make |&| an active character and have it expand
- to |\pgfmatrixnextcell|. This way, it will ``look'' as if |&| is
- used.
- \item Rows are ended using the command |\pgfmatrixendrow|, but |\\|
- is set up to mean the same by default. However, some environments
- 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|.
- \end{enumerate}
-
- Both |\pgfmatrixnextcell| and |\pgfmatrixendrow| (and, thus, also
- |\\|) take an optional argument as explained in the
- Section~\ref{section-matrix-spacing}
-
+\begin{command}{\pgfmatrix\marg{shape}\marg{anchor}\marg{name}\marg{usage}\marg{shift}\marg{pre-code}\marg{matrix cells}}
+ This command creates a node that contains a matrix. The name of the node is
+ \meta{name}, its shape is \meta{shape} and the node is anchored at
+ \meta{anchor}.
+
+ The \meta{matrix cell} parameter contains the cells of the matrix. In each
+ cell drawing commands may be given, which create a so-called cell picture.
+ For each cell picture a bounding box is computed and the cells are aligned
+ according to the rules outlined in the previous section.
+
+ The resulting matrix is used as the |text| box of the node. As for a normal
+ node, the \meta{usage} commands are applied, so that the path(s) of the
+ resulting node is (are) stroked or filled or whatever.
+
+
+ \medskip
+ \textbf{Specifying the cells and rows.\ }
+ Even though this command uses |\halign| internally, there are two special
+ rules for indicating cells:
+ %
+ \begin{enumerate}
+ \item Cells in the same row must be separated using the macro
+ |\pgfmatrixnextcell| rather than |&|. Using |&| will result in an
+ error message.
+
+ However, you can make |&| an active character and have it expand to
+ |\pgfmatrixnextcell|. This way, it will ``look'' as if |&| is used.
+ \item Rows are ended using the command |\pgfmatrixendrow|, but |\\| is
+ set up to mean the same by default. However, some environments 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|.
+ \end{enumerate}
+
+ Both |\pgfmatrixnextcell| and |\pgfmatrixendrow| (and, thus, also |\\|)
+ take an optional argument as explained in the
+ Section~\ref{section-matrix-spacing}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\pgfmatrix{rectangle}{center}{mymatrix}
@@ -130,170 +123,178 @@ All matrices are typeset using the following command:
\end{tikzpicture}
\end{codeexample}
- \medskip
- \textbf{Anchoring matrices at nodes inside the matrix.\ }
- The parameter \meta{shift} is an additional negative shift for the
- node. Normally, such a shift could be given beforehand (that is, the
- shift could be preapplied to the current transformation
- matrix). However, when \meta{shift} is evaluated, you can refer to
- \emph{temporary} positions of nodes inside the matrix. In detail,
- the following happens: When the matrix has been typeset, all nodes
- in the matrix temporarily get assigned their positions in the matrix
- 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.
-
- 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
- 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.
-
- \medskip
- \textbf{Rotations and scaling.\ }
- The matrix node is never rotated or shifted, because the current
- coordinate transformation matrix is reset (except for the
- translational part) at the beginning of |\pgfmatrix|. This is
- intentional and will not change in the future. If you need to rotate
- the matrix, you must install an appropriate canvas transformation
- yourself.
-
- However, nodes and stuff inside the cell pictures can be rotated and
- scaled normally.
-
- \medskip
- \textbf{Callbacks.\ }
- 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}.
-
- \medskip
- \textbf{Executing extra code.\ }
- The parameter \meta{pre-code} is executed at the beginning of the
- outermost \TeX-group enclosing the matrix node. It is inside this
- \TeX-group, but outside the matrix itself. It can be used
- for different purposes:
- \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
- 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|
- internally. This command does a lot of strange and magic things like
- expanding the first macro of every cell in a most unusual
- manner. Here are some effects you may wish to be aware of:
- \begin{itemize}
- \item It is not necessary to actually mention |\pgfmatrixnextcell|
- or |\pgfmatrixendrow| inside the \meta{matrix cells}. It suffices
- 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.
- \end{itemize}
+
+ \medskip
+ \textbf{Anchoring matrices at nodes inside the matrix.\ }
+ The parameter \meta{shift} is an additional negative shift for the node.
+ Normally, such a shift could be given beforehand (that is, the shift could
+ be preapplied to the current transformation matrix). However, when
+ \meta{shift} is evaluated, you can refer to \emph{temporary} positions of
+ nodes inside the matrix. In detail, the following happens: When the matrix
+ has been typeset, all nodes in the matrix temporarily get assigned their
+ positions in the matrix 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.
+
+ 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 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.
+
+
+ \medskip
+ \textbf{Rotations and scaling.\ }
+ The matrix node is never rotated or scaled, because the current coordinate
+ transformation matrix is reset (except for the translational part) at the
+ beginning of |\pgfmatrix|. This is intentional and will not change in the
+ future. If you need to rotate or scale the matrix, you must install an
+ appropriate canvas transformation yourself.
+
+ However, nodes and stuff inside the cell pictures can be rotated and scaled
+ normally.
+
+
+ \medskip
+ \textbf{Callbacks.\ }
+ 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}.
+
+
+ \medskip
+ \textbf{Executing extra code.\ }
+ The parameter \meta{pre-code} is executed at the beginning of the outermost
+ \TeX-group enclosing the matrix node. It is inside this \TeX-group, but
+ outside the matrix itself. It can be used for different purposes:
+ %
+ \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
+ 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| internally. This
+ command does a lot of strange and magic things like expanding the first
+ macro of every cell in a most unusual manner. Here are some effects you may
+ wish to be aware of:
+ %
+ \begin{itemize}
+ \item It is not necessary to actually mention |\pgfmatrixnextcell| or
+ |\pgfmatrixendrow| inside the \meta{matrix cells}. It suffices 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.
+ \end{itemize}
\end{command}
\subsection{Row and Column Spacing}
\label{section-matrix-spacing}
-It is possible to control the space between columns and rows rather
-detailedly. Two commands are important for the row spacing and two
-commands for the column spacing.
+It is possible to control the space between columns and rows rather detailedly.
+Two commands are important for the row spacing and two commands for the column
+spacing.
\begin{command}{\pgfsetmatrixcolumnsep\marg{sep list}}
- This macro sets the default separation list for columns. The details of the
- format of this list are explained in the description of the next command.
+ This macro sets the default separation list for columns. The details of the
+ format of this list are explained in the description of the next command.
\end{command}
\begin{command}{\pgfmatrixnextcell\opt{\oarg{additional sep list}}}
- 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.
-
- The optional \meta{additional sep list} may only be provided when
- the |\pgfmatrixnextcell| command starts a new column. Normally, this
- will only be the case in the first row, but sometimes a later row
- has more elements than the first row. In this case, the
- |\pgfmatrixnextcell| commands that start the new columns in the
- later row may also have the optional argument. Once a column has
- been started, subsequent uses of this optional argument for the
- column have no effect.
-
- To determine the space between the two columns that are separated by
- |\pgfmatrixnextcell|, the following algorithm is executed:
- \begin{enumerate}
- \item Both the default separation list (as set up by
- |\pgfsetmatrixcolumnsep|) and the \meta{additional sep list} are
- processed, in this order. If the \meta{additional sep list}
- argument is missing, only the default separation list is
- processed.
- \item Both lists may contain dimensions, separated by commas, as
- well as occurrences of the keywords |between origins| and
- |between borders|.
- \item All dimensions occurring in either list are added together to
- arrive at a dimension $d$.
- \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}
- At the end of the algorithm, a dimension $d$ has been computed and
- one of the two \emph{modes} |between borders| and |between origins|
- has been determined. Depending on which mode has been determined,
- the following happens:
- \begin{itemize}
- \item For the |between borders| mode, an additional horizontal space
- of $d$ is added between the two columns. Note that $d$ may be
- negative.
- \item For the |between origins| mode, the spacing between the two
- columns is computed differently: Recall that the origins of the
- cell pictures in both pictures lie on two vertical lines. The
- spacing between the two columns is set up such that the horizontal
- distance between these two lines is exactly $d$.
-
- This mode may only be used between columns \emph{already
- introduced in the first row}.
- \end{itemize}
- All of the above rules boil down to the following effects:
- \begin{itemize}
- \item A default spacing between columns should be set up using
- |\pgfsetmatrixcolumnsep|. For example, you might say
- |\pgfsetmatrixcolumnsep{5pt}| to have columns spaced apart by
- |5pt|. You could say
+ 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.
+
+ The optional \meta{additional sep list} may only be provided when the
+ |\pgfmatrixnextcell| command starts a new column. Normally, this will only
+ be the case in the first row, but sometimes a later row has more elements
+ than the first row. In this case, the |\pgfmatrixnextcell| commands that
+ start the new columns in the later row may also have the optional argument.
+ Once a column has been started, subsequent uses of this optional argument
+ for the column have no effect.
+
+ To determine the space between the two columns that are separated by
+ |\pgfmatrixnextcell|, the following algorithm is executed:
+ %
+ \begin{enumerate}
+ \item Both the default separation list (as set up by
+ |\pgfsetmatrixcolumnsep|) and the \meta{additional sep list} are
+ processed, in this order. If the \meta{additional sep list}
+ argument is missing, only the default separation list is processed.
+ \item Both lists may contain dimensions, separated by commas, as well
+ as occurrences of the keywords |between origins| and |between
+ borders|.
+ \item All dimensions occurring in either list are added together to
+ arrive at a dimension $d$.
+ \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}
+ %
+ At the end of the algorithm, a dimension $d$ has been computed and one of
+ the two \emph{modes} |between borders| and |between origins| has been
+ determined. Depending on which mode has been determined, the following
+ happens:
+ %
+ \begin{itemize}
+ \item For the |between borders| mode, an additional horizontal space of
+ $d$ is added between the two columns. Note that $d$ may be
+ negative.
+ \item For the |between origins| mode, the spacing between the two
+ columns is computed differently: Recall that the origins of the
+ cell pictures in both pictures lie on two vertical lines. The
+ spacing between the two columns is set up such that the horizontal
+ distance between these two lines is exactly $d$.
+
+ This mode may only be used between columns \emph{already introduced
+ in the first row}.
+ \end{itemize}
+ %
+ All of the above rules boil down to the following effects:
+ %
+ \begin{itemize}
+ \item A default spacing between columns should be set up using
+ |\pgfsetmatrixcolumnsep|. For example, you might say
+ |\pgfsetmatrixcolumnsep{5pt}| to have columns spaced apart by
+ |5pt|. You could say
+ %
\begin{verbatim}
\pgfsetmatrixcolumnsep{1cm,between origins}
\end{verbatim}
- to specify that horizontal space between the origins of cell
- pictures in adjacent columns should be 1cm by default --
- regardless of the actual size of the cell pictures.
- \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, 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
- |between origins|, you can say
+ %
+ to specify that horizontal space between the origins of cell
+ pictures in adjacent columns should be 1cm by default -- regardless
+ of the actual size of the cell pictures.
+ \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, 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
+ |between origins|, you can say
+ %
\begin{verbatim}
\pgfmatrixnextcell[5pt,between borders]
\end{verbatim}
- to locally change the mode for these columns to
- |between borders|.
- \end{itemize}
-
- \begin{codeexample}[]
+ %
+ to locally change the mode for these columns to |between borders|.
+ \end{itemize}
+ %
+\begin{codeexample}[]
\begin{tikzpicture}[every node/.style=draw]
\pgfsetmatrixcolumnsep{1mm}
\pgfmatrix{rectangle}{center}{mymatrix}
@@ -304,8 +305,9 @@ commands for the column spacing.
\node {4}; \& \node{9}; \& \node {2}; \\
}
\end{tikzpicture}
- \end{codeexample}
- \begin{codeexample}[]
+\end{codeexample}
+ %
+\begin{codeexample}[]
\begin{tikzpicture}[every node/.style=draw]
\pgfsetmatrixcolumnsep{1mm}
\pgfmatrix{rectangle}{center}{mymatrix}
@@ -318,8 +320,9 @@ commands for the column spacing.
\draw [<->,red,thick,every node/.style=] (a.center) -- (b.center)
node [above,midway] {11mm};
\end{tikzpicture}
- \end{codeexample}
- \begin{codeexample}[]
+\end{codeexample}
+ %
+\begin{codeexample}[]
\begin{tikzpicture}[every node/.style=draw]
\pgfsetmatrixcolumnsep{1cm,between origins}
\pgfmatrix{rectangle}{center}{mymatrix}
@@ -335,44 +338,42 @@ commands for the column spacing.
{10mm};
\end{scope}
\end{tikzpicture}
- \end{codeexample}
+\end{codeexample}
+ %
\end{command}
-The mechanism for the between-row-spacing is the same, only the
-commands are called differently.
-
+The mechanism for the between-row-spacing is the same, only the commands are
+called differently.
\begin{command}{\pgfsetmatrixrowsep\marg{sep list}}
- This macro sets the default separation list for rows.
+ This macro sets the default separation list for rows.
\end{command}
-
-
\begin{command}{\pgfmatrixendrow\opt{\oarg{additional sep list}}}
- This command ends a line. The optional \meta{additional sep list} is
- used to determine the spacing between the row being ended and the
- next row. The modes and the computation of $d$ is done in the same
- way as for columns. For the last row the optional argument has no
- effect.
-
- Inside matrices (and only there) the command |\\| is set up to mean
- the same as this command.
+ This command ends a line. The optional \meta{additional sep list} is used
+ to determine the spacing between the row being ended and the next row. The
+ modes and the computation of $d$ is done in the same way as for columns.
+ For the last row the optional argument has no effect.
+
+ Inside matrices (and only there) the command |\\| is set up to mean the
+ same as this command.
\end{command}
\subsection{Callbacks}
\label{section-matrix-callbacks}
-There are three macros that get called at the beginning and end of
-cells. By redefining these macros, which are empty by default, you can
-change the appearance of cells in a very general manner.
+There are three macros that get called at the beginning and end of cells. By
+redefining these macros, which are empty by default, you can 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
- immediately ends with |\pgfmatrixemptycode| or |\pgfmatrixendrow|)
- and, if so, put this macro inside the cell.
- \begin{codeexample}[]
+ This macro is executed for empty cells. This means that \pgfname\ uses some
+ macro magic to determine whether a cell is empty (it immediately ends with
+ |\pgfmatrixemptycode| or |\pgfmatrixendrow|) and, if so, put this macro
+ inside the cell.
+ %
+\begin{codeexample}[]
\begin{tikzpicture}
\def\pgfmatrixemptycode{\node{empty};}
\pgfmatrix{rectangle}{center}{mymatrix}
@@ -382,17 +383,18 @@ change the appearance of cells in a very general manner.
\& \node{c}; \& \node {d}; \& \\
}
\end{tikzpicture}
- \end{codeexample}
- As can be seen, the macro is not executed for empty cells at the end
- of row when columns are added only later on.
+\end{codeexample}
+ %
+ As can be seen, the macro is not executed for empty cells at the end of row
+ when columns are added only later on.
\end{command}
-
\begin{command}{\pgfmatrixbegincode}
- This macro is executed at the beginning of non-empty
- cells. Correspondingly, |\pgfmatrixendcode| is added at
- the end of every non-empty cell.
- \begin{codeexample}[]
+ This macro is executed at the beginning of non-empty cells.
+ Correspondingly, |\pgfmatrixendcode| is added at the end of every non-empty
+ cell.
+ %
+\begin{codeexample}[]
\begin{tikzpicture}
\def\pgfmatrixbegincode{\node[draw]\bgroup}
\def\pgfmatrixendcode{\egroup;}
@@ -403,33 +405,32 @@ change the appearance of cells in a very general manner.
d \& \& e \\
}
\end{tikzpicture}
- \end{codeexample}
- Note that between |\pgfmatrixbegincode| and |\pgfmatrixendcode|
- there will \emph{not} only be the contents of the cell. Rather,
- \pgfname\ will add some (invisible) commands for book-keeping
- purposes that involve |\let| and |\gdef|. In particular, it is not a
- good idea to have |\pgfmatrixbegincode| end with |\csname| and
- |\pgfmatrixendcode| start with |\endcsname|.
+\end{codeexample}
+ %
+ Note that between |\pgfmatrixbegincode| and |\pgfmatrixendcode| there will
+ \emph{not} only be the contents of the cell. Rather, \pgfname\ will add
+ some (invisible) commands for book-keeping purposes that involve |\let| and
+ |\gdef|. In particular, it is not a good idea to have |\pgfmatrixbegincode|
+ end with |\csname| and |\pgfmatrixendcode| start with |\endcsname|.
\end{command}
\begin{command}{\pgfmatrixendcode}
- See the explanation above.
+ See the explanation above.
\end{command}
-
-The following two counters allow you to access the current row and
-current column in a callback:
+The following two counters allow you to access the current row and 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 about changing this counter.
+ This counter stores the current row of the current cell of the matrix. Do
+ not even think about changing this counter.
\end{command}
\begin{command}{\pgfmatrixcurrentcolumn}
- This counter stores the current column of the current cell of the
- matrix.
+ This counter stores the current column of the current cell of the matrix.
\end{command}
+
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
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 c40d308b3f4..4e0ba4f5361 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
@@ -15,159 +15,142 @@
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|.
+ 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|.
\end{pgfmodule}
\subsection{Overview}
-\pgfname\ comes with a sophisticated set of commands for creating
-\emph{nodes} and \emph{shapes}. A \emph{node} is a graphical object
-that consists (typically) of (one or more) text labels and some
-additional stroked or filled paths. Each node has a certain
-\emph{shape}, which may be something simple like a |rectangle| or a
-|circle|, but it may also be something complicated like a
-|uml class diagram| (this shape is currently not implemented,
-though). Different nodes that have the same shape may look quite
-different, however, since shapes (need not) specify whether the shape
-path is stroked or filled.
+\pgfname\ comes with a sophisticated set of commands for creating \emph{nodes}
+and \emph{shapes}. A \emph{node} is a graphical object that consists
+(typically) of (one or more) text labels and some additional stroked or filled
+paths. Each node has a certain \emph{shape}, which may be something simple like
+a |rectangle| or a |circle|, but it may also be something complicated like a
+|uml class diagram| (this shape is currently not implemented, though).
+Different nodes that have the same shape may look quite different, however,
+since shapes (need not) specify whether the shape path is stroked or filled.
\subsubsection{Creating and Referencing Nodes}
You create a node by calling the macro |\pgfnode| or the more general
-|\pgfmultipartnode|. This 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
-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
+|\pgfmultipartnode|. This 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 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
determined by \pgfname. This is \emph{not} the case if you use canvas
transformations instead.
\subsubsection{Anchors}
-An important property of a node or a shape in general are its
-\emph{anchors}. Anchors are ``important'' positions in a shape. For
-example, the |center| anchor lies at the center of a shape, the
-|north| anchor is usually ``at the top, in the middle'' of a shape,
-the |text| anchor is the lower left corner of the shape's text label
-(if present), and so on.
-
-Anchors are important both when you create a node and when you
-reference it. When you create a node, you specify the node's
-``position'' by asking \pgfname\ to place the shape in such a way that
-a certain anchor lies at a certain point. For example, you might ask
-that the node is placed such that the |north| anchor is at the
-origin. This will effectively cause the node to be placed below the
+An important property of a node or a shape in general are its \emph{anchors}.
+Anchors are ``important'' positions in a shape. For example, the |center|
+anchor lies at the center of a shape, the |north| anchor is usually ``at the
+top, in the middle'' of a shape, the |text| anchor is the lower left corner of
+the shape's text label (if present), and so on.
+
+Anchors are important both when you create a node and when you reference it.
+When you create a node, you specify the node's ``position'' by asking \pgfname\
+to place the shape in such a way that a certain anchor lies at a certain point.
+For example, you might ask that the node is placed such that the |north| anchor
+is at the origin. This will effectively cause the node to be placed below the
origin.
-When you reference a node, you always reference an anchor of the
-node. For example, when you request the ``|north| anchor of the node
-just placed'' you will get the origin. However, you can also request
-the ``|south| anchor of this node,'' which will give you a point
-somewhere below the origin. When a coordinate transformation was in
-force at the time of creation of a node, all anchors are also
-transformed accordingly.
+When you reference a node, you always reference an anchor of the node. For
+example, when you request the ``|north| anchor of the node just placed'' you
+will get the origin. However, you can also request the ``|south| anchor of this
+node'', which will give you a point somewhere below the origin. When a
+coordinate transformation was in force at the time of creation of a node, all
+anchors are also transformed accordingly.
-\subsubsection{Layers of a Shape}
-The simplest shape, the |coordinate|, has just one anchor, namely the
-|center|, and a label (which is usually empty). More complicated
-shapes like the |rectangle| shape also have a \emph{background
- path}. This is a \pgfname-path that is defined by the shape. The
-shape does not prescribe what should happen with the path: When a node
-is created, this path may be stroked (resulting in a frame around the
-label), filled (resulting in a background color for the text), or just
-discarded.
+\subsubsection{Layers of a Shape}
-Although most shapes consist just of a background path plus some label
-text, when a shape is drawn, up to seven different layers are drawn:
+The simplest shape, the |coordinate|, has just one anchor, namely the |center|,
+and a label (which is usually empty). More complicated shapes like the
+|rectangle| shape also have a \emph{background path}. This is a \pgfname-path
+that is defined by the shape. The shape does not prescribe what should happen
+with the path: When a node is created, this path may be stroked (resulting in a
+frame around the label), filled (resulting in a background color for the text),
+or just discarded.
+Although most shapes consist just of a background path plus some label text,
+when a shape is drawn, up to seven different layers are drawn:
+%
\begin{enumerate}
-\item
- The ``behind the background layer.'' Unlike the background path,
- which can be used in different ways by different nodes, the graphic
- commands given for this layer will always stroke or
- always fill the path they construct. They might also insert some
- text that is ``behind everything.''
-\item
- The background path layer. How this path is used depends on the
- arguments of the |\pgfnode| command.
-\item
- The ``before the background path layer.'' This layer works like the
- first one, only the commands of this layer are executed after the
- background path has been used (in whatever way the creator of the
- node chose).
-\item
- The label layer. This layer inserts the node's text box(es).
-\item
- The ``behind the foreground layer.'' This layer, like the
- first layer, once more contains graphic commands that are ``simply
- executed.''
-\item
- The foreground path layer. This path is treated in the same way as the
- background path, only it is drawn after the label text has been
- drawn.
-\item
- The ``before the foreground layer.''
+ \item The ``behind the background layer''. Unlike the background path,
+ which can be used in different ways by different nodes, the graphic
+ commands given for this layer will always stroke or always fill the
+ path they construct. They might also insert some text that is ``behind
+ everything''.
+ \item The background path layer. How this path is used depends on the
+ arguments of the |\pgfnode| command.
+ \item The ``before the background path layer''. This layer works like the
+ first one, only the commands of this layer are executed after the
+ background path has been used (in whatever way the creator of the node
+ chose).
+ \item The label layer. This layer inserts the node's text box(es).
+ \item The ``behind the foreground layer''. This layer, like the first
+ layer, once more contains graphic commands that are ``simply
+ executed''.
+ \item The foreground path layer. This path is treated in the same way as
+ the background path, only it is drawn after the label text has been
+ drawn.
+ \item The ``before the foreground layer''.
\end{enumerate}
Which of these layers are actually used depends on the shape.
-
\subsubsection{Node Parts}
-A shape typically does not consist only of different background and
-foreground paths, but it may also have text labels. Indeed, for many
-shapes the text labels are the more important part of the shape.
+A shape typically does not consist only of different background and foreground
+paths, but it may also have text labels. Indeed, for many shapes the text
+labels are the more important part of the shape.
-Most shapes will have only one text label. In this case, this text
-label is simply passed as a parameter to the |\pgfnode| command. When
-the node is drawn, the text label is shifted around such that its
-lower left corner is at the |text| anchor of the node.
+Most shapes will have only one text label. In this case, this text label is
+simply passed as a parameter to the |\pgfnode| command. When the node is drawn,
+the text label is shifted around such that its lower left corner is at the
+|text| anchor of the node.
-More complicated shapes may have more than one text label. Nodes of
-such shapes are called \emph{multipart nodes}. The different
-\emph{node parts} are simply the different text labels. For example, a
-|uml class| shape might have a |class name| part, a |method| part and
-an |attributes| part. Indeed, single part nodes are a special case of
-multipart nodes: They only have one part named |text|.
+More complicated shapes may have more than one text label. Nodes of such shapes
+are called \emph{multipart nodes}. The different \emph{node parts} are simply
+the different text labels. For example, a |uml class| shape might have a
+|class name| part, a |method| part and an |attributes| part. Indeed, single
+part nodes are a special case of multipart nodes: They only have one part named
+|text|.
-When a shape is declared, you must specify the node parts. There is a
-simple command called |\nodeparts| that takes a list of the part names
-as input. When you create a node of a multipart shape, for each part
-of the node you must have set up a \TeX-box containing the text of the
-part. For a part named |XYZ| you must set up the box
-|\pgfnodepartXYZbox|. The box will be placed at the anchor |XYZ|. See
-the description of |\pgfmultipartnode| for more details.
+When a shape is declared, you must specify the node parts. There is a simple
+command called |\nodeparts| that takes a list of the part names as input. When
+you create a node of a multipart shape, for each part of the node you must have
+set up a \TeX-box containing the text of the part. For a part named |XYZ| you
+must set up the box |\pgfnodepartXYZbox|. The box will be placed at the anchor
+|XYZ|. See the description of |\pgfmultipartnode| for more details.
\subsection{Creating Nodes}
-
\subsubsection{Creating Simple Nodes}
-\begin{command}{\pgfnode\marg{shape}\marg{anchor}\marg{label
- 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|.
-
- The shape is shifted such that the \meta{anchor} is at the
- origin. In order to place the shape somewhere else, use the
- coordinate transformation prior to calling this command.
+\begin{command}{\pgfnode\marg{shape}\marg{anchor}\marg{label 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|.
- The \meta{name} is a name for later reference. If no name is given,
- nothing will be ``saved'' for the node, it will just be drawn.
+ The shape is shifted such that the \meta{anchor} is at the origin. In order
+ to place the shape somewhere else, use the coordinate transformation prior
+ to calling this command.
- The \meta{path usage command} is executed for the background and the
- foreground path (if the shape defines them).
+ The \meta{name} is a name for later reference. If no name is given, nothing
+ will be ``saved'' for the node, it will just be drawn.
+ The \meta{path usage command} is executed for the background and the
+ foreground path (if the shape defines them).
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (4,3);
@@ -185,14 +168,13 @@ the description of |\pgfmultipartnode| for more details.
\end{tikzpicture}
\end{codeexample}
- As can be seen, all coordinate transformations are also applied to
- the text of the shape. Sometimes, it is desirable that the
- transformations are applied to the point where the shape will be
- 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.
-
+ As can be seen, all coordinate transformations are also applied to the text
+ of the shape. Sometimes, it is desirable that the transformations are
+ applied to the point where the shape will be 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (4,3);
@@ -207,33 +189,29 @@ the description of |\pgfmultipartnode| for more details.
\end{tikzpicture}
\end{codeexample}
- The \meta{label text} is typeset inside the \TeX-box
- |\pgfnodeparttextbox|. This box is shown at the |text| anchor of the
- node, if the node has a |text| part. See the description of
- |\pgfmultipartnode| for details.
+ The \meta{label text} is typeset inside the \TeX-box |\pgfnodeparttextbox|.
+ This box is shown at the |text| anchor of the node, if the node has a
+ |text| part. See the description of |\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
- the |\pgfnode| command. While the |\pgfnode| command can only be
- used for shapes that have a single part (which is the case for most
- shapes), this command can also be used with multi-part nodes.
-
- When this command is called, for each node part of the node you must
- have set up one \TeX-box. Suppose the shape has two parts: The |text|
- part and the |lower| part. Then, prior to calling
- |\pgfmultipartnode|, you must have set up the boxes
- |\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
- anchor positions |text| and |lower|.
-
+\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 the
+ |\pgfnode| command. While the |\pgfnode| command can only be used for
+ shapes that have a single part (which is the case for most shapes), this
+ command can also be used with multi-part nodes.
+
+ When this command is called, for each node part of the node you must have
+ set up one \TeX-box. Suppose the shape has two parts: The |text| part and
+ the |lower| part. Then, prior to calling |\pgfmultipartnode|, you must have
+ set up the boxes |\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 anchor
+ positions |text| and |lower|.
+ %
\begin{codeexample}[]
\setbox\pgfnodeparttextbox=\hbox{$q_1$}
\setbox\pgfnodepartlowerbox=\hbox{01}
@@ -242,66 +220,66 @@ the description of |\pgfmultipartnode| for more details.
\end{pgfpicture}
\end{codeexample}
- \emph{Note:\/} Be careful when using the |\setbox| command inside a
- |{pgfpicture}| command. You will have to use |\pgfinterruptpath| at
- the beginning of the box and |\endpgfinterruptpath| at the end of
- the box to make sure that the box is typeset correctly. In the above
- example this problem was sidestepped by moving the box construction
- outside the environment.
-
- \emph{Note:\/} It is not necessary to use |\newbox| for every node
- part name. Although you need a different box for each part of a
- single shape, two different shapes may very well use the same box
- even when the names of the parts are different. Suppose you have a
- |circle split| shape that has a |lower| part and you have a
- |uml class| shape that has a |methods| part. Then, in order to avoid
- exhausting \TeX's limited number of box registers, you can say
+ \emph{Note:\/} Be careful when using the |\setbox| command inside a
+ |{pgfpicture}| command. You will have to use |\pgfinterruptpath| at the
+ beginning of the box and |\endpgfinterruptpath| at the end of the box to
+ make sure that the box is typeset correctly. In the above example this
+ problem was sidestepped by moving the box construction outside the
+ environment.
+
+ \emph{Note:\/} It is not necessary to use |\newbox| for every node part
+ name. Although you need a different box for each part of a single shape,
+ two different shapes may very well use the same box even when the names of
+ the parts are different. Suppose you have a |circle split| shape that has a
+ |lower| part and you have a |uml class| shape that has a |methods| part.
+ Then, in order to avoid exhausting \TeX's limited number of box registers,
+ you can say
+ %
\begin{codeexample}[code only]
\newbox\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:
+ %
+ Also, when you have a node part name with spaces like |class name|, it may
+ be useful to create an alias:
+ %
\begin{codeexample}[code only]
\newbox\mybox
\expandafter\let\csname pgfnodepartclass namebox\endcsname=\mybox
\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.
+ 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}.
+ 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.
+ 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.
+There are a number of values that have an influence on the size of a node.
+These values are stored in the following keys.
\begin{key}{/pgf/minimum width=\meta{dimension} (initially 1pt)}
- \keyalias{tikz}
- 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.
-
- Note that this value is just a recommendation. A shape may choose to
- ignore this key.
-
+\keyalias{tikz}
+ 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.
+
+ 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);
@@ -310,26 +288,25 @@ node. These values are stored in the following keys.
\pgfnode{rectangle}{center}{Hello World}{}{\pgfusepath{stroke}}
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/pgf/minimum height=\meta{dimension} (initially 1pt)}
- \keyalias{tikz}
- Works like |/pgf/minimum width|.
+\keyalias{tikz}
+ Works like |/pgf/minimum width|.
\end{key}
\begin{key}{/pgf/minimum size=\meta{dimension}}
- \keyalias{tikz}
- This style both |/pgf/minimum width| and |/pgf/minimum height| to \meta{dimension}.
+\keyalias{tikz}
+ This style both |/pgf/minimum width| and |/pgf/minimum height| to \meta{dimension}.
\end{key}
-
\begin{key}{/pgf/inner xsep=\meta{dimension} (initially 0.3333em)}
- \keyalias{tikz}
- This key stores the \emph{recommended} horizontal
- 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.
-
+\keyalias{tikz}
+ This key stores the \emph{recommended} horizontal 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);
@@ -338,28 +315,28 @@ node. These values are stored in the following keys.
\pgfnode{rectangle}{center}{Hello World}{}{\pgfusepath{stroke}}
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/pgf/inner ysep=\meta{dimension} (initially 0.3333em)}
- \keyalias{tikz}
- Works like |/pgf/inner xsep|.
+\keyalias{tikz}
+ Works like |/pgf/inner xsep|.
\end{key}
\begin{key}{/pgf/inner sep=\meta{dimension}}
- \keyalias{tikz}
- This style sets both |/pgf/inner xsep| and |/pgf/inner ysep| to \meta{dimension}.
+\keyalias{tikz}
+ This style sets both |/pgf/inner xsep| and |/pgf/inner ysep| to
+ \meta{dimension}.
\end{key}
-
-
\begin{key}{/pgf/outer xsep=\meta{dimension} (initially .5\string\pgflinewidth)}
- \keyalias{tikz}
- 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.
- As before, this value is just a recommendation.
-
+\keyalias{tikz}
+ 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. As before, this value is just a
+ recommendation.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (-2,0) grid (2,1);
@@ -375,106 +352,107 @@ node. These values are stored in the following keys.
\pgfusepath{fill}
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/pgf/outer ysep=\meta{dimension} (initially .5\string\pgflinewidth)}
- \keyalias{tikz}
- Works like |/pgf/outer xsep|.
+\keyalias{tikz}
+ Works like |/pgf/outer xsep|.
\end{key}
\begin{key}{/pgf/outer sep=\meta{dimension}}
- \keyalias{tikz}
- This style sets both |/pgf/outer xsep| and |/pgf/outer ysep| to \meta{dimension}.
+\keyalias{tikz}
+ This style sets both |/pgf/outer xsep| and |/pgf/outer ysep| to
+ \meta{dimension}.
\end{key}
\subsubsection{Deferred Node Positioning}
\label{section-shapes-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 created. Using |\pgfpositionnodelater| in concert with
-|\pgfpositionnodenow|, you can create a node whose position is
-determined only at some later time.
+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 created.
+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 set up:
-
- \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 positionedPGFINTERNAL|. 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. It is guaranteed, that this macro will
- contain a dimension in the format \meta{number}|pt|.
- \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}.
-
- The following two macros will also be set inside the call to
- \meta{macro name}, but they are only ``informative'' in the sense
- that you need \emph{not} restore these macros when
- |\pgfpositionnodenow| is called.
-
- \begin{command}{\pgfpositionnodelaterpath}
- This macro stores the path of the background of the node. See
- Section~\ref{section-soft-paths} for an overview of how these
- paths are encode.
- \end{command}
-
- 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.
+ 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 set up:
+
+ \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 positionedPGFINTERNAL|. 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. It is guaranteed, that this macro will contain a dimension in
+ the format \meta{number}|pt|.
+ \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}.
+
+ The following two macros will also be set inside the call to \meta{macro
+ name}, but they are only ``informative'' in the sense that you need
+ \emph{not} restore these macros when |\pgfpositionnodenow| is called.
+
+ \begin{command}{\pgfpositionnodelaterpath}
+ This macro stores the path of the background of the node. See
+ Section~\ref{section-soft-paths} for an overview of how these paths are
+ encode.
+ \end{command}
+
+ 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 using the command |\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}. Then, the late code (see below)
- is called. Subsequently, you can refer to the node with its
- original name as if it had just been created.
-
- \begin{codeexample}[]
+ This command is used to position a node that has previously been created
+ using the command |\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}.
+ Then, the late code (see below) is called. Subsequently, you can refer to
+ the node with its original name as if it had just been created.
+ %
+\begin{codeexample}[]
\newbox\mybox
\def\mysaver{
@@ -503,50 +481,47 @@ determined only at some later time.
\draw (hi) -- (0,0);
\end{tikzpicture}
- \end{codeexample}
+\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgfnodepostsetupcode\marg{node name}\marg{code}}
- When you call this macro inside a scope for which the
- |\pgfpositionnodelater| has been called, the \meta{code} will be
- stored internally. Later, when the node named \meta{node name} is
- actually positioned using |\pgfpositionnodenow|, the \meta{code}
- will be executed. When this macro is called multiple times with the
- same \meta{node name}, the \meta{code} accumulates. However, When
- |\pgfpositionnodenow| is called, the code stored for the node is
- cleared.
-
- The main purpose of this mechanism is to allow \tikzname\ to store
- so-called ``late options'' with a node that will be positioned only
- later.
+ When you call this macro inside a scope for which the
+ |\pgfpositionnodelater| has been called, the \meta{code} will be stored
+ internally. Later, when the node named \meta{node name} is actually
+ positioned using |\pgfpositionnodenow|, the \meta{code} will be executed.
+ When this macro is called multiple times with the same \meta{node name},
+ the \meta{code} accumulates. However, When |\pgfpositionnodenow| is called,
+ the code stored for the node is cleared.
+
+ The main purpose of this mechanism is to allow \tikzname\ to store
+ so-called ``late options'' with a node that will be positioned only later.
\end{command}
\subsection{Using Anchors}
-Each shape defines a set of anchors. We saw already that the anchors
-are used when the shape is drawn: the shape is placed in such a way
-that the given anchor is at the origin (which in turn is typically
-translated somewhere else).
+Each shape defines a set of anchors. We saw already that the anchors are used
+when the shape is drawn: the shape is placed in such a way that the given
+anchor is at the origin (which in turn is typically translated somewhere else).
-One has to look up the set of anchors of each shape, there is no
-``default'' set of anchors, except for the |center| anchor, which
-should always be present. Also, most shapes will declare anchors like
-|north| or |east|, but this is not guaranteed.
+One has to look up the set of anchors of each shape, there is no ``default''
+set of anchors, except for the |center| anchor, which should always be present.
+Also, most shapes will declare anchors like |north| or |east|, but this is not
+guaranteed.
\subsubsection{Referencing Anchors of Nodes in the Same Picture}
-Once a node has been defined, you can refer to its anchors using the
-following commands:
+Once a node has been defined, you can refer to its anchors using the following
+commands:
\begin{command}{\pgfpointanchor\marg{node}\marg{anchor}}
- This command is another ``point command'' like the commands
- described in Section~\ref{section-points}. It returns the coordinate
- of the given \meta{anchor} in the given \meta{node}. The command can
- be used in commands like |\pgfpathmoveto|.
-
+ This command is another ``point command'' like the commands described in
+ Section~\ref{section-points}. It returns the coordinate of the given
+ \meta{anchor} in the given \meta{node}. The command can be used in commands
+ like |\pgfpathmoveto|.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgftransformrotate{30}
@@ -561,23 +536,21 @@ following commands:
\end{pgfpicture}
\end{codeexample}
- In the above example, you may have noticed something curious: The
- rotation transformation is still in force when the anchors are
- invoked, but it does not seem to have an effect. You might expect
- that the rotation should apply to the already rotated points once
- more.
-
- However, |\pgfpointanchor| returns a point that takes the current
- transformation matrix into account: \emph{The inverse transformation
- to the current coordinate transformation is applied to an anchor
- point before returning it.}
-
- This behavior may seem a bit strange, but you will find it very
- natural in most cases. If you really want to apply a transformation
- to an anchor point (for example, to ``shift it away'' a little bit),
- you have to invoke |\pgfpointanchor| without any transformations in
- force. Here is an example:
-
+ In the above example, you may have noticed something curious: The rotation
+ transformation is still in force when the anchors are invoked, but it does
+ not seem to have an effect. You might expect that the rotation should apply
+ to the already rotated points once more.
+
+ However, |\pgfpointanchor| returns a point that takes the current
+ transformation matrix into account: \emph{The inverse transformation to the
+ current coordinate transformation is applied to an anchor point before
+ returning it.}
+
+ This behavior may seem a bit strange, but you will find it very natural in
+ most cases. If you really want to apply a transformation to an anchor point
+ (for example, to ``shift it away'' a little bit), you have to invoke
+ |\pgfpointanchor| without any transformations in force. Here is an example:
+ %
\makeatletter
\begin{codeexample}[]
\begin{pgfpicture}
@@ -595,28 +568,25 @@ following commands:
\end{pgfpicture}
\end{codeexample}
- A special situation arises when the \meta{node} lies in a picture
- different from the current picture. In this case, if you have not
- told \pgfname\ that the picture should be ``remembered,'' the
- \meta{node} will be treated as if it lay in the current
- picture. For example, if the \meta{node} was at position $(3,2)$ in
- the original picture, it is treated as if it lay at position
- $(3,2)$ in the current picture. However, if you have told \pgfname\
- to remember the picture position of the node's picture and also of
- the current picture,
- 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}.
+ A special situation arises when the \meta{node} lies in a picture different
+ from the current picture. In this case, if you have not told \pgfname\ that
+ the picture should be ``remembered'', the \meta{node} will be treated as if
+ it lay in the current picture. For example, if the \meta{node} was at
+ position $(3,2)$ in the original picture, it is treated as if it lay at
+ position $(3,2)$ in the current picture. However, if you have told
+ \pgfname\ to remember the picture position of the node's picture and also
+ of the current picture, 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}.
\end{command}
\begin{command}{\pgfpointshapeborder\marg{node}\marg{point}}
- This command returns the point on the border of the shape that lies
- on a straight line from the center of the node to \meta{point}. For
- complex shapes it is not guaranteed that this point will actually
- lie on the border, it may be on the border of a ``simplified''
- version of the shape.
-
+ This command returns the point on the border of the shape that lies on a
+ straight line from the center of the node to \meta{point}. For complex
+ shapes it is not guaranteed that this point will actually lie on the
+ border, it may be on the border of a ``simplified'' version of the shape.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\begin{pgfscope}
@@ -630,102 +600,102 @@ following commands:
\pgfusepath{fill}
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
\subsubsection{Referencing Anchors of Nodes in Different Pictures}
\label{section-cross-pictures-pgf}
-As a picture is typeset, \pgfname\ keeps track of the positions of all
-nodes inside the picture. What \pgfname\ does not remember is the
-position of the picture \emph{itself} on the page. Thus, if you define
-a node in one picture and then try to reference this node while
-another picture is typeset, \pgfname\ will only know the position of
-the nodes that you try to typeset inside the original picture, but it
-will not know where this picture lies. What is missing is the relative
-positioning of the two pictures.
-
-To overcome this problem, you need to tell \pgfname\ that it should
-remember the position of pictures on a page. If these positions are
-remembered, then \pgfname\ can compute the offset between the pictures
-and make nodes in different pictures accessible.
-
-Determining the positions of pictures on the page is, alas,
-not-so-easy. Because of this, \pgfname\ does not do so
-automatically. Rather, you have to proceed as follows:
+As a picture is typeset, \pgfname\ keeps track of the positions of all nodes
+inside the picture. What \pgfname\ does not remember is the position of the
+picture \emph{itself} on the page. Thus, if you define a node in one picture
+and then try to reference this node while another picture is typeset, \pgfname\
+will only know the position of the nodes that you try to typeset inside the
+original picture, but it will not know where this picture lies. What is missing
+is the relative positioning of the two pictures.
+
+To overcome this problem, you need to tell \pgfname\ that it should remember
+the position of pictures on a page. If these positions are remembered, then
+\pgfname\ can compute the offset between the pictures and make nodes in
+different pictures accessible.
+
+Determining the positions of pictures on the page is, alas, not-so-easy.
+Because of this, \pgfname\ does not do so automatically. Rather, you have to
+proceed as follows:
+%
\begin{enumerate}
-\item You have to use a backend driver that supports position
- tracking. pdf\TeX\ is one such driver, |dvips| currently is not.
-\item You have to say |\pgfrememberpicturepositiononpagetrue|
- somewhere before or inside every picture
- \begin{itemize}
- \item in which you wish to reference a node and
- \item from which you wish to reference a node in another picture.
- \end{itemize}
- The second item is important since \pgfname\ does not only need to
- know the position of the picture in which the node you wish to
- reference lies, but it also needs to know where the current picture
- lies.
-\item You typically have to run \TeX\ twice (depending on the backend
- driver) since the position information typically gets written into
- an external file on the first run and is available only on the
- 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 bounding box of the current
- picture. You should say |\pgfusepath{use as bounding box}| before
- using a coordinate in another picture.
+ \item You have to use a backend driver that supports position tracking.
+ pdf\TeX\ is one such driver, |dvips| currently is not.
+ \item You have to say |\pgfrememberpicturepositiononpagetrue| somewhere
+ before or inside every picture
+ %
+ \begin{itemize}
+ \item in which you wish to reference a node and
+ \item from which you wish to reference a node in another picture.
+ \end{itemize}
+ %
+ The second item is important since \pgfname\ does not only need to know
+ the position of the picture in which the node you wish to reference
+ lies, but it also needs to know where the current picture lies.
+ \item You typically have to run \TeX\ twice (depending on the backend
+ driver) since the position information typically gets written into an
+ external file on the first run and is available only on the 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 bounding box of the current picture. You should say
+ |\pgfusepath{use as bounding box}| before using a coordinate in another
+ picture.
\end{enumerate}
-
\subsection{Special Nodes}
-There are several special nodes that are always defined and which you
-should not attempt to redefine.
+There are several special nodes that are always defined and which you should
+not attempt to redefine.
\begin{predefinednode}{current bounding box}
- This node is of shape |rectangle|. Unlike normal nodes, its size
- changes constantly and always reflects the size of the bounding box
- of the current picture. This means that, for instance, that
+ This node is of shape |rectangle|. Unlike normal nodes, its size changes
+ constantly and always reflects the size of the bounding box of the current
+ picture. This means that, for instance, that
+ %
\begin{codeexample}[code only]
\pgfpointanchor{current bounding box}{south east}
\end{codeexample}
- returns the lower left corner of the bounding box of the current
- picture.
+ %
+ returns the lower left corner of the bounding box of the current picture.
\end{predefinednode}
\begin{predefinednode}{current path bounding box}
- This node is also of shape |rectangle|. Its size is the size of the
- bounding box of the current path.
+ This node is also of shape |rectangle|. Its size is the size of the
+ bounding box of the current path.
\end{predefinednode}
\begin{predefinednode}{current subpath start}
- This node is of shape |coordinate| and is at the beginning of the
- current subpath. This is the position of the last move-to
- operation.
+ This node is of shape |coordinate| and is at the beginning of the current
+ subpath. This is the position of the last move-to operation.
\end{predefinednode}
\begin{predefinednode}{current page}
- This node is inside a virtual remembered picture. The size of this
- node is the size of the current page. This means that if you create
- a remembered picture and inside this picture you reference an anchor
- of this node, you reference an absolute position on the page. To
- demonstrate the effect, the following code puts some text in the
- lower left corner of the current page. Note that this works only if
- the backend driver supports it, otherwise the text is inserted right
- here.%
+ This node is inside a virtual remembered picture. The size of this node is
+ the size of the current page. This means that if you create a remembered
+ picture and inside this picture you reference an anchor of this node, you
+ reference an absolute position on the page. To demonstrate the effect, the
+ following code puts some text in the lower left corner of the current page.
+ Note that this works only if the backend driver supports it, otherwise the
+ text is inserted right here.
+ %
{%
\pgfrememberpicturepositiononpagetrue%
\begin{pgfpicture}
- \pgfusepath{use as bounding box}
- \pgftransformshift{\pgfpointanchor{current page}{south west}}
- \pgftransformshift{\pgfpoint{1cm}{1cm}}
- \pgftext[left,base]{
- \textcolor{red}{
- Text absolutely positioned in
- the lower left corner.}
- }
+ \pgfusepath{use as bounding box}
+ \pgftransformshift{\pgfpointanchor{current page}{south west}}
+ \pgftransformshift{\pgfpoint{1cm}{1cm}}
+ \pgftext[left,base]{
+ \textcolor{red}{
+ Text absolutely positioned in
+ the lower left corner.}
+ }
\end{pgfpicture}
}%
\begin{codeexample}[code only]
@@ -741,20 +711,21 @@ should not attempt to redefine.
}
\end{pgfpicture}
\end{codeexample}
+ %
\end{predefinednode}
-
-There is also an option that allows you to create new special nodes
-quite similar to the above:
+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 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
- the size of a certain area. Note that excessive use of this option
- (keeping track of dozens of bounding boxes at the same time)
- will slow things down.
+\keyalias{tikz}
+ 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 the size of a certain
+ area. Note that excessive use of this option (keeping track of dozens of
+ bounding boxes at the same time) will slow things down.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -765,101 +736,95 @@ quite similar to the above:
\draw[red] (inner box.south west) rectangle (inner box.north east);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\subsection{Declaring New Shapes}
There are only three predefined shapes, see
-Section~\ref{section-predefined-shapes}, so there must be some way of
-defining new shapes. Defining a shape is, unfortunately, a
-not-quite-trivial process. The reason is that shapes need to be both
-very flexible (their size will vary greatly according to
-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.
+Section~\ref{section-predefined-shapes}, so there must be some way of defining
+new shapes. Defining a shape is, unfortunately, a not-quite-trivial process.
+The reason is that shapes need to be both very flexible (their size will vary
+greatly according to 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.
\subsubsection{What Must Be Defined For a Shape?}
In order to define a new shape, you must provide:
+%
\begin{itemize}
-\item
- a \emph{shape name},
-\item
- code for computing the \emph{saved anchors} and \emph{saved
+ \item a \emph{shape name},
+ \item code for computing the \emph{saved anchors} and \emph{saved
dimensions},
-\item
- code for computing \emph{anchor} positions in terms of the saved anchors,
-\item
- optionally code for the \emph{background path} and \emph{foreground path},
-\item
- optionally code for \emph{things to be drawn before or behind} the
- background and foreground paths.
-\item
- optionally a list of node parts.
+ \item code for computing \emph{anchor} positions in terms of the saved
+ anchors,
+ \item optionally code for the \emph{background path} and \emph{foreground
+ path},
+ \item optionally code for \emph{things to be drawn before or behind} the
+ background and foreground paths.
+ \item optionally a list of node parts.
\end{itemize}
\subsubsection{Normal Anchors Versus Saved Anchors}
-Anchors are special places in a 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
- 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
+Anchors are special places in a 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 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.
-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 be 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
+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 be 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.
-To solve this problem, \pgfname\ will always compute the locations of
-all \emph{saved anchors} and store these positions. Then, when an
-normal anchor position is requested later on, the anchor position can
-be given just from knowing where the locations of the saved anchors are.
+To solve this problem, \pgfname\ will always compute the locations of all
+\emph{saved anchors} and store these positions. Then, when an normal anchor
+position is requested later on, the anchor position can be given just from
+knowing where the locations of the saved anchors are.
-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.
-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.
+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. 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.
-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.
+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.
\subsubsection{Command for Declaring New Shapes}
The following command declares a new shape:
-\begin{command}{\pgfdeclareshape\marg{shape name}\marg{shape
- specification}}
- This command declares a new shape named \meta{shape name}. The shape
- name can later be used in commands like |\pgfnode|.
+%
+\begin{command}{\pgfdeclareshape\marg{shape name}\marg{shape specification}}
+ This command declares a new shape named \meta{shape name}. The shape name
+ can later be used in commands like |\pgfnode|.
- The \meta{shape specification} is some \TeX\ code containing calls
- to special commands that are only defined inside the \meta{shape
- specification} (similarly to commands like |\draw| that are only
- available inside the |{tikzpicture}| environment).
+ The \meta{shape specification} is some \TeX\ code containing calls to
+ special commands that are only defined inside the \meta{shape
+ specification} (similarly to commands like |\draw| that are only available
+ inside the |{tikzpicture}| environment).
- \example Here is the code of the |coordinate| shape:
+ \example Here is the code of the |coordinate| shape:
+ %
\begin{codeexample}[code only]
\pgfdeclareshape{coordinate}
{
@@ -873,86 +838,82 @@ The following command declares a new shape:
}
\end{codeexample}
- The special commands are explained next. In the examples given for
- the special commands a new shape will be constructed, which we might
- call |simple rectangle|. It should behave like the normal rectangle
- shape, only without bothering about the fine details like inner and
- outer separations. The skeleton for the shape is the following.
+ The special commands are explained next. In the examples given for the
+ special commands a new shape will be constructed, which we might call
+ |simple rectangle|. It should behave like the normal rectangle shape, only
+ without bothering about the fine details like inner and outer separations.
+ The skeleton for the shape is the following.
+ %
\begin{codeexample}[code only]
\pgfdeclareshape{simple rectangle}{
...
}
\end{codeexample}
- \begin{command}{\nodeparts\marg{list of node parts}}
- This command declares which parts make up nodes of this shape. A
- \emph{node part} is a (possibly empty) text label that is drawn
- when a node of the shape is created.
-
- By default, a shape has just one node part called |text|. However,
- there can be several node parts. For example, the
- |circle split| shape has two parts: the |text| part, which
- shows that the upper text, and a |lower| part, which shows the
- lower text. For the |circle split| shape the |\nodeparts| command
- was called with the argument |{text,lower}|.
-
- When a multipart node is created, the text labels are drawn in the
- sequences listed in the \meta{list of node parts}. For each node
- part, you must have declared one anchor and the \TeX-box of
- the part is placed at this anchor. For a node part called |XYZ|
- the \TeX-box |\pgfnodepartXYZbox| is placed at anchor |XYZ|.
- \end{command}
-
- \begin{command}{\savedanchor\marg{command}\marg{code}}
- This command declares a saved anchor. The argument \meta{command}
- should be a \TeX\ macro name like |\centerpoint|.
-
- 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}
- 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 set up when the \meta{code} is
- 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,
- the \meta{code} can take into account the values of dimensions like
- |\pgfshapeminwidth| or |\pgfshapeinnerxsep|. Furthermore, the
- \meta{code} can take into consideration the values of any further
- shape-specific variables that are set at the moment when
- |\pgfnode| is called.
-
- The net effect of the \meta{code} should be to set the two \TeX\
- dimensions |\pgf@x| and |\pgf@y|. One way to achieve this is to
- say |\pgfpoint{|\meta{x value}|}{|\meta{y value}|}| at the end of
- the \meta{code}, but you can also just set these variables.
- The values that |\pgf@x| and |\pgf@y| have after the code has been
- executed, let us call them $x$ and $y$, will be recorded and
- stored together with the node that is created by the command
- |\pgfnode|.
-
- The macro \meta{command} is defined to be
- |\pgfpoint{|$x$|}{|$y$|}|. However, the \meta{command} is only
- locally defined while anchor positions are being computed. Thus,
- it is possible to use very simple names for \meta{command}, like
- |\center| or |\a|, without causing a name-clash. (To be precise,
- very simple \meta{command} names will clash with existing names,
- but only locally inside the computation of anchor positions; and
- we do not need the normal |\center| command during these
- computations.)
-
- For our |simple rectangle| shape, we will need only one saved
- anchor: The upper right corner. The lower left corner could either
- be the origin or the ``mirrored'' upper right corner, depending on
- whether we want the text label to have its lower left corner at
- the origin or whether the text label should be centered on the
- 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
- the following code for the upper right corner:
+ \begin{command}{\nodeparts\marg{list of node parts}}
+ This command declares which parts make up nodes of this shape. A
+ \emph{node part} is a (possibly empty) text label that is drawn when a
+ node of the shape is created.
+
+ By default, a shape has just one node part called |text|. However,
+ there can be several node parts. For example, the |circle split| shape
+ has two parts: the |text| part, which shows that the upper text, and a
+ |lower| part, which shows the lower text. For the |circle split| shape
+ the |\nodeparts| command was called with the argument |{text,lower}|.
+
+ When a multipart node is created, the text labels are drawn in the
+ sequences listed in the \meta{list of node parts}. For each node part,
+ you must have declared one anchor and the \TeX-box of the part is
+ placed at this anchor. For a node part called |XYZ| the \TeX-box
+ |\pgfnodepartXYZbox| is placed at anchor |XYZ|.
+ \end{command}
+
+ \begin{command}{\savedanchor\marg{command}\marg{code}}
+ This command declares a saved anchor. The argument \meta{command}
+ should be a \TeX\ macro name like |\centerpoint|.
+
+ 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} 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 set up when the \meta{code} is
+ 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, the \meta{code}
+ can take into account the values of dimensions like |\pgfshapeminwidth|
+ or |\pgfshapeinnerxsep|. Furthermore, the \meta{code} can take into
+ consideration the values of any further shape-specific variables that
+ are set at the moment when |\pgfnode| is called.
+
+ The net effect of the \meta{code} should be to set the two \TeX\
+ dimensions |\pgf@x| and |\pgf@y|. One way to achieve this is to say
+ |\pgfpoint{|\meta{x value}|}{|\meta{y value}|}| at the end of the
+ \meta{code}, but you can also just set these variables. The values that
+ |\pgf@x| and |\pgf@y| have after the code has been executed, let us
+ call them $x$ and $y$, will be recorded and stored together with the
+ node that is created by the command |\pgfnode|.
+
+ The macro \meta{command} is defined to be |\pgfpoint{|$x$|}{|$y$|}|.
+ However, the \meta{command} is only locally defined while anchor
+ positions are being computed. Thus, it is possible to use very simple
+ names for \meta{command}, like |\center| or |\a|, without causing a
+ name-clash. (To be precise, very simple \meta{command} names will clash
+ with existing names, but only locally inside the computation of anchor
+ positions; and we do not need the normal |\center| command during these
+ computations.)
+
+ For our |simple rectangle| shape, we will need only one saved anchor:
+ The upper right corner. The lower left corner could either be the
+ origin or the ``mirrored'' upper right corner, depending on whether we
+ want the text label to have its lower left corner at the origin or
+ whether the text label should be centered on the 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 the following code for the upper right corner:
+ %
\begin{codeexample}[code only]
\savedanchor{\upperrightcorner}{
\pgf@y=.5\ht\pgfnodeparttextbox % height of the box, ignoring the depth
@@ -960,9 +921,9 @@ The following command declares a new shape:
}
\end{codeexample}
- If we wanted to take, say, the |\pgfshapeminwidth| into account,
- we could use the following code:
-
+ 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
@@ -973,76 +934,79 @@ The following command declares a new shape:
\fi
}
\end{codeexample}
- Note that we could not have written |.5\pgfshapeminwidth| since
- 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}
- \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
- set just to (the value of) $x$.
-
- In the |simple rectangle| shape we might use a saved dimension to
- store the depth of the shape box.
-
+ %
+ Note that we could not have written |.5\pgfshapeminwidth| since 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}
+ %
+ \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 set
+ just to (the value of) $x$.
+
+ 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
}
\end{codeexample}
- \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,
- (this could be a value, or some text).
-
- In the |regular polygon| shape, a saved macro is used to
- store the number of sides of the polygon.
-
+ \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, (this
+ could be a value, or some text).
+
+ 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}
- \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
- declared. Rather, the \meta{code} is only executed when the anchor
- is specifically requested; either for anchoring the node during
- its creation or as a position in the shape referenced later on.
-
- The \meta{name} is a quite arbitrary string that is not ``passed
- down'' to the system level. Thus, names like |south| or |1| or
- |::| would all be fine.
-
- A saved anchor is not automatically also a normal anchor. If you
- wish to give the users access to a saved anchor you must declare a
- normal anchor that just returns the position of the saved anchor.
-
- When the \meta{code} is executed, all saved anchor macros will be
- defined. Thus, you can reference them in your \meta{code}. The
- effect of the \meta{code} should be to set the values of |\pgf@x|
- and |\pgf@y| to the coordinates of the anchor.
-
- 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|:
-
+ \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
+ declared. Rather, the \meta{code} is only executed when the anchor is
+ specifically requested; either for anchoring the node during its
+ creation or as a position in the shape referenced later on.
+
+ The \meta{name} is a quite arbitrary string that is not ``passed down''
+ to the system level. Thus, names like |south| or |1| or |::| would all
+ be fine.
+
+ A saved anchor is not automatically also a normal anchor. If you wish
+ to give the users access to a saved anchor you must declare a normal
+ anchor that just returns the position of the saved anchor.
+
+ When the \meta{code} is executed, all saved anchor macros will be
+ defined. Thus, you can reference them in your \meta{code}. The effect
+ of the \meta{code} should be to set the values of |\pgf@x| and |\pgf@y|
+ to the coordinates of the anchor.
+
+ 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}
- The |\upperrightcorner| macro will set |\pgf@x| and |\pgf@y| to
- the coordinates of the upper right corner. Thus, |\pgf@x| and
- |\pgf@y| will have exactly the right values at the end of the
- anchor's code.
-
- Next, let us define a |north west| anchor. For this anchor, we can
- negate the |\pgf@x| variable:
+ The |\upperrightcorner| macro will set |\pgf@x| and |\pgf@y| to the
+ coordinates of the upper right corner. Thus, |\pgf@x| and |\pgf@y| will
+ have exactly the right values at the end of the anchor's code.
+ 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
@@ -1050,28 +1014,28 @@ The following command declares a new shape:
}
\end{codeexample}
- Finally, it is a good idea to always define a |center| anchor,
- which will be the default location for a shape.
-
+ Finally, it is a good idea to always define a |center| anchor, which
+ will be the default location for a shape.
+ %
\begin{codeexample}[code only]
\anchor{center}{\pgfpointorigin}
\end{codeexample}
- You might wonder whether we should not take into consideration
- that the node is not placed at the origin, but has been shifted
- somewhere. However, the anchor positions are always specified in
- the shape's ``private'' coordinate system. The ``outer''
- transformation that has been applied to the shape upon its
- creation is applied automatically to the coordinates returned by
- the anchor's \meta{code}.
-
- Our |simple rectangle| only has one text label (node
- part) called |text|. This is the default situation, so we do not need to
- do anything. For the |text| node part we must set up a |text|
- anchor. This anchor is used upon creation of a node to determine
- the lower left corner of the text label (within the private
- coordinate system of the shape). By default, the |text| anchor is
- at the origin, but you may change this. For example, we would say
+ You might wonder whether we should not take into consideration that the
+ node is not placed at the origin, but has been shifted somewhere.
+ However, the anchor positions are always specified in the shape's
+ ``private'' coordinate system. The ``outer'' transformation that has
+ been applied to the shape upon its creation is applied automatically to
+ the coordinates returned by the anchor's \meta{code}.
+
+ Our |simple rectangle| only has one text label (node part) called
+ |text|. This is the default situation, so we do not need to do
+ anything. For the |text| node part we must set up a |text| anchor. Upon
+ creation of a node, this anchor will be made to coincide with the left
+ endpoint of the baseline of the text label (within the private
+ coordinate system of the shape). By default, the |text| anchor is at
+ the origin, but you may change this. For example, we would say
+ %
\begin{codeexample}[code only]
\anchor{text}{%
\upperrightcorner%
@@ -1079,31 +1043,31 @@ The following command declares a new shape:
\pgf@y=-\pgf@y%
}
\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:
-
+ 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.
-
- If a shape has several node parts, we would have to define an
- anchor for each part.
+ %
+ 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.
+
+ If a shape has several node parts, we would have to define an 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).
-
+ 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}
@@ -1125,27 +1089,28 @@ The following command declares a new shape:
\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
- depends on the shape.
-
- When the user requests a point on the border of the shape using the
- |\pgfpointshapeborder| command, the \meta{code} will be executed
- to discern this point. When the execution of the \meta{code}
- starts, the dimensions |\pgf@x| and |\pgf@y| will have been set to
- a location $p$ in the shape's coordinate system. It is now the job of
- the \meta{code} to set up |\pgf@x| and |\pgf@y| such that they
- specify the point on the shape's border that lies on a straight
- line from the shape's center to the point $p$. Usually, this is a
- somewhat complicated computation, involving many case distinctions
- and some basic math.
-
- For our |simple rectangle| we must compute a point on the border
- of a rectangle whose one corner is the origin (ignoring the depth
- for simplicity) and whose other corner is |\upperrightcorner|. The
- following code might be used:
+ \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 depends on
+ the shape.
+
+ When the user requests a point on the border of the shape using the
+ |\pgfpointshapeborder| command, the \meta{code} will be executed to
+ discern this point. When the execution of the \meta{code} starts, the
+ dimensions |\pgf@x| and |\pgf@y| will have been set to a location $p$
+ in the shape's coordinate system. It is now the job of the \meta{code}
+ to set up |\pgf@x| and |\pgf@y| such that they specify the point on the
+ shape's border that lies on a straight line from the shape's center to
+ the point $p$. Usually, this is a somewhat complicated computation,
+ involving many case distinctions and some basic math.
+
+ For our |simple rectangle| we must compute a point on the border of a
+ rectangle whose one corner is the origin (ignoring the depth for
+ simplicity) and whose other corner is |\upperrightcorner|. The
+ following code might be used:
+ %
\begin{codeexample}[code only]
\anchorborder{%
% Call a function that computes a border point. Since this
@@ -1156,22 +1121,22 @@ The following command declares a new shape:
\pgfpointborderrectangle{\pgfpoint{\@tempdima}{\@tempdimb}}{\upperrightcorner}
}
\end{codeexample}
- \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
- to happen with the path: It might be drawn, shaded, filled, or
- even thrown away. If you want to specify that something should
- ``always'' happen when this shape is drawn (for example, if the
- shape is a stop-sign, we \emph{always} want it to be filled with a
- red color), you can use commands like |\beforebackgroundpath|,
- explained below.
-
- When the \meta{code} is executed, all saved anchors will be in
- effect. The \meta{code} should contain path construction
- commands.
-
- For our |simple rectangle|, the following code might be used:
+ \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 to happen
+ with the path: It might be drawn, shaded, filled, or even thrown away.
+ If you want to specify that something should ``always'' happen when
+ this shape is drawn (for example, if the shape is a stop-sign, we
+ \emph{always} want it to be filled with a red color), you can use
+ commands like |\beforebackgroundpath|, explained below.
+
+ When the \meta{code} is executed, all saved anchors will be in effect.
+ The \meta{code} should contain path construction commands.
+
+ For our |simple rectangle|, the following code might be used:
+ %
\begin{codeexample}[code only]
\backgroundpath{
\pgfpathrectanglecorners
@@ -1179,84 +1144,101 @@ The following command declares a new shape:
{\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}
- \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}
- \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
- appropriate. For example, the \meta{code} might fill some area
- with a uniform color.
-
- Whatever the \meta{code} does, it does it first. This means that
- any drawing done by \meta{code} will be even behind the background
- path.
-
- Note that the \meta{code} is protected with a |{pgfscope}|.
- \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}
- \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}
- \begin{command}{\beforeforegroundpath\marg{code}}
- This \meta{code} is executed at the very end.
- \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
- a new shape that is just a small modification of a another shape,
- you can recycle the code used for \meta{another shape name}.
-
- The effect of this command is the same as if you had called
- |\savedanchor| and |\saveddimen| for each saved anchor or saved
- dimension declared in \meta{another shape name}. Thus, it is not
- possible to ``selectively'' inherit only some saved anchors, you
- 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}
- \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}
- \begin{command}{\inheritbackgroundpath|[from=|\marg{another shape name}|]|}
- Inherits the background path code from \meta{another shape name}.
- \end{command}
- \begin{command}{\inheritbeforebackgroundpath|[from=|\marg{another shape name}|]|}
- Inherits the before background path code from \meta{another shape name}.
- \end{command}
- \begin{command}{\inheritbehindforegroundpath|[from=|\marg{another shape name}|]|}
- Inherits the behind foreground path code from \meta{another shape name}.
- \end{command}
- \begin{command}{\inheritforegroundpath|[from=|\marg{another shape name}|]|}
- Inherits the foreground path code from \meta{another shape name}.
- \end{command}
- \begin{command}{\inheritbeforeforegroundpath|[from=|\marg{another shape name}|]|}
- Inherits the before foreground path code from \meta{another shape name}.
- \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}
- \begin{command}{\inheritanchorborder|[from=|\marg{another shape name}|]|}
- Inherits the border anchor code from \meta{another shape name}.
- \end{command}
-
- The following example shows how a shape can be defined that relies
- heavily on inheritance:
+ %
+ 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}
+ %
+ \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}
+ %
+ \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 appropriate.
+ For example, the \meta{code} might fill some area with a uniform color.
+
+ Whatever the \meta{code} does, it does it first. This means that any
+ drawing done by \meta{code} will be even behind the background path.
+
+ Note that the \meta{code} is protected with a |{pgfscope}|.
+ \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}
+ %
+ \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}
+ %
+ \begin{command}{\beforeforegroundpath\marg{code}}
+ This \meta{code} is executed at the very end.
+ \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 a new
+ shape that is just a small modification of a another shape, you can
+ recycle the code used for \meta{another shape name}.
+
+ The effect of this command is the same as if you had called
+ |\savedanchor| and |\saveddimen| for each saved anchor or saved
+ dimension declared in \meta{another shape name}. Thus, it is not
+ possible to ``selectively'' inherit only some saved anchors, you 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}
+ %
+ \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}
+ %
+ \begin{command}{\inheritbackgroundpath|[from=|\marg{another shape name}|]|}
+ Inherits the background path code from \meta{another shape name}.
+ \end{command}
+ %
+ \begin{command}{\inheritbeforebackgroundpath|[from=|\marg{another shape name}|]|}
+ Inherits the before background path code from \meta{another shape
+ name}.
+ \end{command}
+ %
+ \begin{command}{\inheritbehindforegroundpath|[from=|\marg{another shape name}|]|}
+ Inherits the behind foreground path code from \meta{another shape
+ name}.
+ \end{command}
+ %
+ \begin{command}{\inheritforegroundpath|[from=|\marg{another shape name}|]|}
+ Inherits the foreground path code from \meta{another shape name}.
+ \end{command}
+ %
+ \begin{command}{\inheritbeforeforegroundpath|[from=|\marg{another shape name}|]|}
+ Inherits the before foreground path code from \meta{another shape
+ name}.
+ \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}
+ %
+ \begin{command}{\inheritanchorborder|[from=|\marg{another shape name}|]|}
+ Inherits the border anchor code from \meta{another shape name}.
+ \end{command}
+
+ The following example shows how a shape can be defined that relies heavily
+ on inheritance:
+ %
\makeatletter
\begin{codeexample}[]
\pgfdeclareshape{document}{
@@ -1297,12 +1279,10 @@ The following command declares a new shape:
\draw[dashed] (x) -- (y);
\end{tikzpicture}
\end{codeexample}
-
+ %
\end{command}
-
-
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
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 eacaa4b84e8..4863835ddac 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
@@ -12,13 +12,13 @@
\subsection{Overview}
-The ``basic entity of drawing'' in \pgfname\ is the \emph{path}. A
-path consists of several parts, each of which is either a closed or
-open curve. An open curve has a starting point and an end point and,
-in between, consists of several \emph{segments}, each of which is
-either a straight line or a B\'ezier curve. Here is an example of a
-path (in red) consisting of two parts, one open, one closed:
-
+The ``basic entity of drawing'' in \pgfname\ is the \emph{path}. A path
+consists of several parts, each of which is either a closed or open curve. An
+open curve has a starting point and an end point and, in between, consists of
+several \emph{segments}, each of which is either a straight line or a Bézier
+curve. Here is an example of a path (in red) consisting of two parts, one open,
+one closed:
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=2]
\draw[thick,red]
@@ -35,47 +35,47 @@ path (in red) consisting of two parts, one open, one closed:
\end{tikzpicture}
\end{codeexample}
-A path, by itself, has no ``effect,'' that is, it does not leave any
-marks on the page. It is just a set of points on the plane. However,
-you can \emph{use} a path in different ways. The most natural actions
-are \emph{stroking} (also known as \emph{drawing}) and
-\emph{filling}. Stroking can be imagined as picking up a pen of a
-certain diameter and ``moving it along the path.'' Filling means that
-everything ``inside'' the path is filled with a uniform
-color. Naturally, the open parts of a path must first be closed before
-a path can be filled.
-
-In \pgfname, there are numerous commands for constructing paths, all
-of which start with |\pgfpath|. There are also commands for
-\emph{using} paths, though most operations can be performed by calling
-|\pgfusepath| with an appropriate parameter.
-
-As a side-effect, the path construction commands keep track of two
-bounding boxes. One is the bounding box for the current path, the
-other is a bounding box for all paths in the current picture. See
-Section~\ref{section-bb} for more details.
-
-Each path construction command extends the current path in some
-way. The ``current path'' is a global entity that persists across
-\TeX\ groups. Thus, between calls to the path construction commands
-you can perform arbitrary computations and even open and close \TeX\
-groups. The current path only gets ``flushed'' when the |\pgfusepath|
-command is called (or when the soft-path subsystem is used directly,
-see Section~\ref{section-soft-paths}).
+A path, by itself, has no ``effect'', that is, it does not leave any marks on
+the page. It is just a set of points on the plane. However, you can \emph{use}
+a path in different ways. The most natural actions are \emph{stroking} (also
+known as \emph{drawing}) and \emph{filling}. Stroking can be imagined as
+picking up a pen of a certain diameter and ``moving it along the path''.
+Filling means that everything ``inside'' the path is filled with a uniform
+color. Naturally, the open parts of a path must first be closed before a path
+can be filled.
+
+In \pgfname, there are numerous commands for constructing paths, all of which
+start with |\pgfpath|. There are also commands for \emph{using} paths, though
+most operations can be performed by calling |\pgfusepath| with an appropriate
+parameter.
+
+As a side-effect, the path construction commands keep track of two bounding
+boxes. One is the bounding box for the current path, the other is a bounding
+box for all paths in the current picture. See Section~\ref{section-bb} for more
+details.
+
+Each path construction command extends the current path in some way. The
+``current path'' is a global entity that persists across \TeX\ groups. Thus,
+between calls to the path construction commands you can perform arbitrary
+computations and even open and close \TeX\ groups. The current path only gets
+``flushed'' when the |\pgfusepath| command is called (or when the soft-path
+subsystem is used directly, see Section~\ref{section-soft-paths}).
+
\subsection{The Move-To Path Operation}
-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.
+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.
\begin{command}{\pgfpathmoveto\marg{coordinate}}
- This command expects a \pgfname-coordinate like |\pgfpointorigin| as
- its parameter. When the current path is empty, this operation will
- start the path at the given \meta{coordinate}. If a path has already
- been partly constructed, this command will end the current part of
- the path and start a new one.
+ This command expects a \pgfname-coordinate like |\pgfpointorigin| as its
+ parameter. When the current path is empty, this operation will start the
+ path at the given \meta{coordinate}. If a path has already been partly
+ constructed, this command will end the current part of the path and start a
+ new one.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
@@ -87,6 +87,7 @@ can also be used to start a new part of a path.
\pgfusepath{fill,stroke}
\end{pgfpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
@@ -99,23 +100,25 @@ can also be used to start a new part of a path.
\pgfusepath{fill,stroke}
\end{pgfpicture}
\end{codeexample}
- The command will apply the current coordinate transformation matrix
- to \meta{coordinate} before using it.
+ %
+ The command will apply the current coordinate transformation matrix to
+ \meta{coordinate} before using it.
- It will update the bounding box of the current path and
- picture, if necessary.
+ It will update the bounding box of the current path and picture, if
+ necessary.
\end{command}
\subsection{The Line-To Path Operation}
\begin{command}{\pgfpathlineto\marg{coordinate}}
- This command extends the current path in a straight line to the
- given \meta{coordinate}. If this command is given at the beginning
- 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.
+ This command extends the current path in a straight line to the given
+ \meta{coordinate}. If this command is given at the beginning 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.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
@@ -125,25 +128,26 @@ can also be used to start a new part of a path.
\pgfusepath{fill,stroke}
\end{pgfpicture}
\end{codeexample}
- The command will apply the current coordinate transformation matrix
- to \meta{coordinate} before using it.
+ %
+ The command will apply the current coordinate transformation matrix to
+ \meta{coordinate} before using it.
- It will update the bounding box of the current path and
- picture, if necessary.
+ It will update the bounding box of the current path and picture, if
+ necessary.
\end{command}
\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\'ezier curve from the
- last point of the path to \meta{coordinate}. The \meta{support 1}
- and \meta{support 2} are the first and second support point of the
- B\'ezier curve. For more information on B\'ezier curves, please consult a
- standard textbook on computer graphics.
-
- Like the line-to command, this command may not be the first path
- construction command in a path.
+ This command extends the current path with a Bézier curve from the last
+ point of the path to \meta{coordinate}. The \meta{support 1} and
+ \meta{support 2} are the first and second support point of the Bézier
+ curve. For more information on Bézier curves, please consult a standard
+ textbook on computer graphics.
+
+ Like the line-to command, this command may not be the first path
+ construction command in a path.
\begin{codeexample}[]
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
@@ -153,23 +157,24 @@ can also be used to start a new part of a path.
\pgfusepath{fill,stroke}
\end{pgfpicture}
\end{codeexample}
- The command will apply the current coordinate transformation matrix
- to \meta{coordinate} before using it.
-
- It will update the bounding box of the current path and
- picture, if necessary. However, the bounding box is simply made
- 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
- can be avoided without resorting to ``some serious math'' in order
- to calculate a precise bounding box.
+ %
+ The command will apply the current coordinate transformation matrix to
+ \meta{coordinate} before using it.
+
+ It will update the bounding box of the current path and picture, if
+ necessary. However, the bounding box is simply made 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 can be avoided without resorting to ``some serious math''
+ in order 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\'ezier curve rather than a cubic one. This means that only one
- support point is needed.
+ 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}
@@ -179,25 +184,23 @@ can also be used to start a new part of a path.
\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.
+ %
+ 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\'ezier curve:
+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.
-
+ 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);
@@ -209,23 +212,25 @@ There exist two commands to draw only part of a cubic B\'ezier curve:
\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.
+ This command works like |\pgfpathcurvebetweentime|, except that a moveto
+ operation is \emph{not} made to the first point.
\end{command}
\subsection{The Close Path Operation}
\begin{command}{\pgfpathclose}
- This command closes the current part of the path by appending a
- straight line to the start point of the current part. Note that there
- \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:
+ This command closes the current part of the path by appending a straight
+ line to the start point of the current part. Note that there \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:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -241,30 +246,30 @@ There exist two commands to draw only part of a cubic B\'ezier curve:
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\subsection{Arc, Ellipse and Circle Path Operations}
-The path construction commands that we have discussed up to now are
-sufficient to create all paths that can be created ``at all.''
-However, it is useful to have special commands to create certain
-shapes, like circles, that arise often in practice.
-
-In the following, the commands for adding (parts of) (transformed)
-circles to a path are described.
-
-\begin{command}{\pgfpatharc\marg{start angle}\marg{end
- angle}{\ttfamily\char`\{}\meta{radius}\opt{| and |\meta{y-radius}}{\ttfamily\char`\}}}
- This command appends a part of a circle (or an ellipse) to the current
- path. Imagine the curve between \meta{start angle} and \meta{end
- angle} on a circle of radius \meta{radius} (if $\meta{start angle}
- < \meta{end angle}$, the curve goes around the circle
- 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.
-
+The path construction commands that we have discussed up to now are sufficient
+to create all paths that can be created ``at all''. However, it is useful to
+have special commands to create certain shapes, like circles, that arise often
+in practice.
+
+In the following, the commands for adding (parts of) (transformed) circles to a
+path are described.
+
+\begin{command}{\pgfpatharc\marg{start angle}\marg{end angle}{\ttfamily\char`\{}\meta{radius}\opt{| and |\meta{y-radius}}{\ttfamily\char`\}}}
+ This command appends a part of a circle (or an ellipse) to the current
+ path. Imagine the curve between \meta{start angle} and \meta{end angle} on
+ a circle of radius \meta{radius} (if $\meta{start angle} < \meta{end
+ angle}$, the curve goes around the circle 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -277,14 +282,14 @@ circles to a path are described.
\end{tikzpicture}
\end{codeexample}
- Saying |\pgfpatharc{0}{360}{1cm}| ``nearly'' gives you a full
- circle. The ``nearly'' refers to the fact that the circle will not
- be closed. You can close it using |\pgfpathclose|.
-
- If the optional \meta{y-radius} is given, the \meta{radius} is the
- $x$-radius and the \meta{y-radius} the $y$-radius of the ellipse
- from which the curve is taken:
+ Saying |\pgfpatharc{0}{360}{1cm}| ``nearly'' gives you a full circle. The
+ ``nearly'' refers to the fact that the circle will not be closed. You can
+ close it using |\pgfpathclose|.
+ If the optional \meta{y-radius} is given, the \meta{radius} is the
+ $x$-radius and the \meta{y-radius} the $y$-radius of the ellipse from which
+ the curve is taken:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -294,11 +299,10 @@ circles to a path are described.
\end{tikzpicture}
\end{codeexample}
- The axes of the circle or ellipse from which the arc is ``taken''
- always point up and right. However, the current coordinate
- transformation matrix will have an effect on the arc. This can be
- used to, say, rotate an arc:
-
+ The axes of the circle or ellipse from which the arc is ``taken'' always
+ point up and right. However, the current coordinate transformation matrix
+ will have an effect on the arc. This can be used to, say, rotate an arc:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -309,22 +313,22 @@ circles to a path are described.
\end{tikzpicture}
\end{codeexample}
- The command will update the bounding box of the current path and
- picture, if necessary. Unless rotation or shearing transformations
- are applied, the bounding box will be tight.
+ The command will update the bounding box of the current path and picture,
+ if necessary. Unless rotation or shearing transformations are applied, the
+ bounding box will be tight.
\end{command}
-\begin{command}{\pgfpatharcaxes\marg{start angle}\marg{end
- angle}\marg{first axis}\marg{second axis}}
- This command is similar to |\pgfpatharc|. The main difference is how
- the ellipse or circle is specified from which the arc is taken. The
- two parameters \meta{first axis} and \meta{second axis} are the
- $0^\circ$-axis and the $90^\circ$-axis of the ellipse from which the
- path is taken. Thus, |\pgfpatharc{0}{90}{1cm and 2cm}| has the same effect
- as
+\begin{command}{\pgfpatharcaxes\marg{start angle}\marg{end angle}\marg{first axis}\marg{second axis}}
+ This command is similar to |\pgfpatharc|. The main difference is how the
+ ellipse or circle is specified from which the arc is taken. The two
+ parameters \meta{first axis} and \meta{second axis} are the $0^\circ$-axis
+ and the $90^\circ$-axis of the ellipse from which the path is taken. Thus,
+ |\pgfpatharc{0}{90}{1cm and 2cm}| has the same effect as
+ %
\begin{verbatim}
\pgfpatharcaxes{0}{90}{\pgfpoint{1cm}{0cm}}{\pgfpoint{0cm}{2cm}}
\end{verbatim}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -335,23 +339,22 @@ circles to a path are described.
\pgfusepath{draw}
\end{tikzpicture}
\end{codeexample}
+ %
\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{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);
@@ -361,14 +364,15 @@ circles to a path are described.
\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.
+ %
+ 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}
@@ -394,21 +398,25 @@ circles to a path are described.
\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 it
- works quite nicely is when the resulting angle is a multiple
- of~$90^\circ$.
+ %
+ \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 it 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.
+ 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 |\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.
+ 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);
@@ -437,33 +445,31 @@ circles to a path are described.
\end{tikzpicture}
\end{codeexample}
- \begin{command}{\pgfpatharctomaxstepsize}
- The quality of arc approximation taken by
- |\pgfpatharctoprecomputed| by means of B\'ezier splines is
- controlled by a mesh width, which is initially
+ \begin{command}{\pgfpatharctomaxstepsize}
+ The quality of arc approximation taken by |\pgfpatharctoprecomputed| by
+ means of Bézier splines is controlled by a mesh width, which is
+ initially
- |\def\pgfpatharctoprecomputed{45}|.
+ |\def\pgfpatharctoprecomputed{45}|.
- The mesh width is provided in (full!) degrees. The smaller the mesh
- width, the more precise the arc approximation.
+ 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).
+ 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}
+ 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
- path (if the path is not empty, a new part is started). The
- ellipse's center will be \meta{center} and \meta{first axis} and
- \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.
-
+\begin{command}{\pgfpathellipse\marg{center}\marg{first axis}\marg{second axis}}
+ The effect of this command is to append an ellipse to the current path (if
+ the path is not empty, a new part is started). The ellipse's center will be
+ \meta{center} and \meta{first axis} and \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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -479,35 +485,32 @@ circles to a path are described.
\end{tikzpicture}
\end{codeexample}
- The command will apply coordinate transformations to all coordinates
- of the ellipse. However, the coordinate transformations are applied
- only after the ellipse is ``finished conceptually.'' Thus, a
- transformation of 1cm to the right will simply shift the ellipse one
- centimeter to the right; it will not add 1cm to the $x$-coordinates
- of the two axis vectors.
+ The command will apply coordinate transformations to all coordinates of the
+ ellipse. However, the coordinate transformations are applied only after the
+ ellipse is ``finished conceptually''. Thus, a transformation of 1cm to the
+ right will simply shift the ellipse one centimeter to the right; it will
+ not add 1cm to the $x$-coordinates of the two axis vectors.
- The command will update the bounding box of the current path and
- picture, if necessary.
+ The command will update the bounding box of the current path and picture,
+ if necessary.
\end{command}
\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})$.
+ A shorthand for |\pgfpathellipse| applied to \meta{center} and the two axis
+ vectors $(\meta{radius},0)$ and $(0,\meta{radius})$.
\end{command}
\subsection{Rectangle Path Operations}
-Another shape that arises frequently is the rectangle. Two commands
-can be used to add a rectangle to the current path. Both commands will
-start a new part of the path.
-
+Another shape that arises frequently is the rectangle. Two commands can be used
+to add a rectangle to the current path. Both commands will start a new part of
+the path.
\begin{command}{\pgfpathrectangle\marg{corner}\marg{diagonal vector}}
- Adds a rectangle to the path whose one corner is \meta{corner} and
- whose opposite corner is given by $\meta{corner} + \meta{diagonal
- vector}$.
-
+ Adds a rectangle to the path whose one corner is \meta{corner} and whose
+ opposite corner is given by $\meta{corner} + \meta{diagonal vector}$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -517,14 +520,15 @@ start a new part of the path.
\pgfusepath{draw}
\end{tikzpicture}
\end{codeexample}
- The command will apply coordinate transformations and update the
- bounding boxes tightly.
+ %
+ The command will apply coordinate transformations and update the bounding
+ boxes tightly.
\end{command}
-
\begin{command}{\pgfpathrectanglecorners\marg{corner}\marg{opposite corner}}
- Adds a rectangle to the path whose two opposing corners are
- \meta{corner} and \meta{opposite corner}.
+ Adds a rectangle to the path whose two opposing corners are \meta{corner}
+ and \meta{opposite corner}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -532,37 +536,40 @@ start a new part of the path.
\pgfusepath{draw}
\end{tikzpicture}
\end{codeexample}
- The command will apply coordinate transformations and update the
- bounding boxes tightly.
+ %
+ The command will apply coordinate transformations and update the bounding
+ boxes tightly.
\end{command}
-
\subsection{The Grid Path Operation}
\begin{command}{\pgfpathgrid\oarg{options}\marg{first corner}\marg{second corner}}
- Appends a grid to the current path. That is, a (possibly large)
- 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
- to the rectangle specified by the \meta{first corner} and
- the \meta{second corner}. However, no clipping occurs (this
- command just adds parts to the current path) and the points
- where the lines enter and leave the ``clipping area'' are computed
- and used to add simple lines to the current path.
-
- The following keys influence the grid:
- \begin{key}{/pgf/stepx=\meta{dimension} (initially 1cm)}
- The horizontal stepping.
- \end{key}
- \begin{key}{/pgf/stepy=\meta{dimension} (initially 1cm)}
- The vertical stepping.
- \end{key}
- \begin{key}{/pgf/step=\meta{vector}}
- Sets the horizontal stepping to the $x$-coordinate of
- \meta{vector} and the vertical stepping to its $y$-coordinate.
- \end{key}
+ Appends a grid to the current path. That is, a (possibly large) 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 to the
+ rectangle specified by the \meta{first corner} and the \meta{second
+ corner}. However, no clipping occurs (this command just adds parts to the
+ current path) and the points where the lines enter and leave the ``clipping
+ area'' are computed and used to add simple lines to the current path.
+
+ The following keys influence the grid:
+ %
+ \begin{key}{/pgf/stepx=\meta{dimension} (initially 1cm)}
+ The horizontal stepping.
+ \end{key}
+ %
+ \begin{key}{/pgf/stepy=\meta{dimension} (initially 1cm)}
+ The vertical stepping.
+ \end{key}
+ %
+ \begin{key}{/pgf/step=\meta{vector}}
+ Sets the horizontal stepping to the $x$-coordinate of \meta{vector} and
+ the vertical stepping to its $y$-coordinate.
+ \end{key}
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfsetlinewidth{0.8pt}
@@ -575,9 +582,11 @@ start a new part of the path.
\pgfusepath{stroke}
\end{pgfpicture}
\end{codeexample}
- The command will apply coordinate transformations and update the
- bounding boxes. As for ellipses, the transformations are
- applied to the ``conceptually finished'' grid.
+ %
+ The command will apply coordinate transformations and update the bounding
+ boxes. As for ellipses, the transformations are applied to the
+ ``conceptually finished'' grid.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgftransformrotate{10}
@@ -585,27 +594,28 @@ start a new part of the path.
\pgfusepath{stroke}
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
\subsection{The Parabola Path Operation}
\begin{command}{\pgfpathparabola\marg{bend vector}\marg{end vector}}
- This command appends two half-parabolas to the current path. The
- first starts at the current point and ends at the current point plus
- \meta{bend vector}. At this point, it has its bend. The second half
- parabola starts at that bend point and ends at point that is given by
- the bend plus \meta{end vector}.
-
- If you set \meta{end vector} to the null vector, you append only a
- half parabola that goes from the current point to the bend; by
- setting \meta{bend vector} to the null vector, you append only a
- half parabola that goes through the current point and \meta{end vector} and
- has its bend at the current point.
-
- It is not possible to use this command to draw a part of a parabola
- that does not contain the bend.
-
+ This command appends two half-parabolas to the current path. The first
+ starts at the current point and ends at the current point plus \meta{bend
+ vector}. At this point, it has its bend. The second half parabola starts at
+ that bend point and ends at point that is given by the bend plus \meta{end
+ vector}.
+
+ If you set \meta{end vector} to the null vector, you append only a half
+ parabola that goes from the current point to the bend; by setting
+ \meta{bend vector} to the null vector, you append only a half parabola that
+ goes through the current point and \meta{end vector} and has its bend at
+ the current point.
+
+ It is not possible to use this command to draw a part of a parabola that
+ does not contain the bend.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
% Half-parabola going ``up and right''
@@ -627,22 +637,24 @@ start a new part of the path.
\pgfusepath{stroke}
\end{pgfpicture}
\end{codeexample}
- The command will apply coordinate transformations and update the
- bounding boxes.
+ %
+ The command will apply coordinate transformations and update the bounding
+ boxes.
\end{command}
\subsection{Sine and Cosine Path Operations}
-Sine and cosine curves often need to be drawn and the following commands
-may help with this. However, they only allow you to append sine and
-cosine curves in intervals that are multiples of $\pi/2$.
+Sine and cosine curves often need to be drawn and the following commands may
+help with this. However, they only allow you to append sine and cosine curves
+in intervals that are multiples of $\pi/2$.
\begin{command}{\pgfpathsine\marg{vector}}
- This command appends a sine curve in the interval $[0,\pi/2]$ to the
- current path. The sine curve is squeezed or stretched such that the
- curve starts at the current point and ends at the current point plus
- \meta{vector}.
+ This command appends a sine curve in the interval $[0,\pi/2]$ to the
+ current path. The sine curve is squeezed or stretched such that the curve
+ starts at the current point and ends at the current point plus
+ \meta{vector}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,1);
@@ -656,16 +668,18 @@ cosine curves in intervals that are multiples of $\pi/2$.
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
- The command will apply coordinate transformations and update the
- bounding boxes.
+ %
+ The command will apply coordinate transformations and update the bounding
+ boxes.
\end{command}
\begin{command}{\pgfpathcosine\marg{vector}}
- This command appends a cosine curve in the interval $[0,\pi/2]$ to the
- current path. The curve is squeezed or stretched such that the
- curve starts at the current point and ends at the current point plus
- \meta{vector}. Using several sine and cosine operations in sequence
- allows you to produce a complete sine or cosine curve
+ This command appends a cosine curve in the interval $[0,\pi/2]$ to the
+ current path. The curve is squeezed or stretched such that the curve starts
+ at the current point and ends at the current point plus \meta{vector}.
+ Using several sine and cosine operations in sequence allows you to produce
+ a complete sine or cosine curve
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfpathmoveto{\pgfpoint{0cm}{0cm}}
@@ -677,43 +691,42 @@ cosine curves in intervals that are multiples of $\pi/2$.
\pgfusepath{fill,stroke}
\end{pgfpicture}
\end{codeexample}
- The command will apply coordinate transformations and update the
- bounding boxes.
+ %
+ The command will apply coordinate transformations and update the bounding
+ boxes.
\end{command}
-
\subsection{Plot Path Operations}
-There exist several commands for appending
-plots to a path. These
-commands are available through the module |plot|. They are
-documented in Section~\ref{section-plots}.
+There exist several commands for appending plots to a path. These commands are
+available through the module |plot|. They are documented in
+Section~\ref{section-plots}.
\subsection{Rounded Corners}
-Normally, when you connect two straight line segments or when you
-connect two curves that end and start ``at different angles,'' you get
-``sharp corners'' between the lines or curves. In some cases it is
-desirable to produce ``rounded corners'' instead. Thus, the lines
-or curves should be shortened a bit and then connected by arcs.
+Normally, when you connect two straight line segments or when you connect two
+curves that end and start ``at different angles'', you get ``sharp corners''
+between the lines or curves. In some cases it is desirable to produce ``rounded
+corners'' instead. Thus, the lines or curves should be shortened a bit and then
+connected by arcs.
-\pgfname\ offers an easy way to achieve this effect, by calling the
-following two commands.
+\pgfname\ offers an easy way to achieve this effect, by calling the following
+two commands.
\begin{command}{\pgfsetcornersarced\marg{point}}
- This command causes all subsequent corners to be replaced by little
- arcs. The effect of this command lasts till the end of the current
- \TeX\ scope.
-
- The \meta{point} dictates how large the corner arc will be. Consider
- a corner made by two lines $l$ and~$r$ and assume that the line $l$
- comes first on the path. The $x$-dimension of the \meta{point}
- decides by how much the line~$l$ will be shortened, the
- $y$-dimension of \meta{point} decides by how much the line $r$ will
- be shortened. Then, the shortened lines are connected by an arc.
-
+ This command causes all subsequent corners to be replaced by little
+ arcs. The effect of this command lasts till the end of the current
+ \TeX\ scope.
+
+ The \meta{point} dictates how large the corner arc will be. Consider a
+ corner made by two lines $l$ and~$r$ and assume that the line $l$ comes
+ first on the path. The $x$-dimension of the \meta{point} decides by how
+ much the line~$l$ will be shortened, the $y$-dimension of \meta{point}
+ decides by how much the line $r$ will be shortened. Then, the shortened
+ lines are connected by an arc.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -742,15 +755,14 @@ following two commands.
\end{tikzpicture}
\end{codeexample}
- If the $x$- and $y$-coordinates of \meta{point} are the same and the
- corner is a right angle, you will get a perfect quarter circle
- (well, not quite perfect, but perfect up to six decimals). When the
- angle is not $90^\circ$, you only get a fair approximation.
-
- 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.)
+ If the $x$- and $y$-coordinates of \meta{point} are the same and the corner
+ is a right angle, you will get a perfect quarter circle (well, not quite
+ perfect, but perfect up to six decimals). When the angle is not $90^\circ$,
+ you only get a fair approximation.
+ 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}}
@@ -764,102 +776,101 @@ following two commands.
\end{pgfpicture}
\end{codeexample}
- To return to normal (unrounded) corners, use
- |\pgfsetcornersarced{\pgfpointorigin}|.
+ To return to normal (unrounded) corners, use
+ |\pgfsetcornersarced{\pgfpointorigin}|.
- 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.
+ 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{command}
-
-
\subsection{Internal Tracking of Bounding Boxes for Paths and Pictures}
-
\label{section-bb}
\makeatletter
-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}|.
+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}|.
\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).
+ 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
-contain the letter~|@|.
+The bounding boxes are not accessible by ``normal'' macros. Rather, two sets of
+four dimension variables are used for this, all of which contain the
+letter~|@|.
\begin{textoken}{\pgf@pathminx}
- The minimum $x$-coordinate ``mentioned'' in the current
- path. Initially, this is set to $16000$pt.
+ The minimum $x$-coordinate ``mentioned'' in the current path. Initially,
+ this is set to $16000$pt.
\end{textoken}
\begin{textoken}{\pgf@pathmaxx}
- The maximum $x$-coordinate ``mentioned'' in the current
- path. Initially, this is set to $-16000$pt.
+ The maximum $x$-coordinate ``mentioned'' in the current path. Initially,
+ this is set to $-16000$pt.
\end{textoken}
\begin{textoken}{\pgf@pathminy}
- The minimum $y$-coordinate ``mentioned'' in the current
- path. Initially, this is set to $16000$pt.
+ The minimum $y$-coordinate ``mentioned'' in the current path. Initially,
+ this is set to $16000$pt.
\end{textoken}
\begin{textoken}{\pgf@pathmaxy}
- The maximum $y$-coordinate ``mentioned'' in the current
- path. Initially, this is set to $-16000$pt.
+ The maximum $y$-coordinate ``mentioned'' in the current path. Initially,
+ this is set to $-16000$pt.
\end{textoken}
\begin{textoken}{\pgf@picminx}
- The minimum $x$-coordinate ``mentioned'' in the current
- picture. Initially, this is set to $16000$pt.
+ The minimum $x$-coordinate ``mentioned'' in the current picture. Initially,
+ this is set to $16000$pt.
\end{textoken}
\begin{textoken}{\pgf@picmaxx}
- The maximum $x$-coordinate ``mentioned'' in the current
- picture. Initially, this is set to $-16000$pt.
+ The maximum $x$-coordinate ``mentioned'' in the current picture. Initially,
+ this is set to $-16000$pt.
\end{textoken}
\begin{textoken}{\pgf@picminy}
- The minimum $y$-coordinate ``mentioned'' in the current
- picture. Initially, this is set to $16000$pt.
+ The minimum $y$-coordinate ``mentioned'' in the current picture. Initially,
+ this is set to $16000$pt.
\end{textoken}
\begin{textoken}{\pgf@picmaxy}
- The maximum $y$-coordinate ``mentioned'' in the current
- picture. Initially, this is set to $-16000$pt.
+ The maximum $y$-coordinate ``mentioned'' in the current picture. Initially,
+ this is set to $-16000$pt.
\end{textoken}
-Each time a path construction command is called, the above variables
-are (globally) updated. To facilitate this, you can use the following
-command:
+Each time a path construction command is called, the above variables are
+(globally) updated. To facilitate this, you can use the following command:
\begin{command}{\pgf@protocolsizes\marg{x-dimension}\marg{y-dimension}}
- Updates all of the above dimensions in such a way that the point
- specified by the two arguments is inside both bounding boxes. For
- the picture's bounding box this updating occurs only if
- |\ifpgf@relevantforpicturesize| is true, see below.
+ Updates all of the above dimensions in such a way that the point specified
+ by the two arguments is inside both bounding boxes. For the picture's
+ bounding box this updating occurs only if |\ifpgf@relevantforpicturesize|
+ is true, see below.
\end{command}
-For the bounding box of the picture it is not always desirable that
-every path construction command affects this bounding box. For
-example, if you have just used a clip command, you do not want anything
-outside the clipping area to affect the bounding box. For this reason,
-there exists a special ``\TeX\ if'' that (locally) decides whether
-updating should be applied to the picture's bounding box. Clipping
-will set this if to false, as will certain other commands.
+For the bounding box of the picture it is not always desirable that every path
+construction command affects this bounding box. For example, if you have just
+used a clip command, you do not want anything outside the clipping area to
+affect the bounding box. For this reason, there exists a special ``\TeX\ if''
+that (locally) decides whether updating should be applied to the picture's
+bounding box. Clipping will set this if to false, as will certain other
+commands.
\begin{command}{\pgf@relevantforpicturesizefalse}
- Suppresses updating of the picture's bounding box.
+ Suppresses updating of the picture's bounding box.
\end{command}
\begin{command}{\pgf@relevantforpicturesizetrue}
- Causes updating of the picture's bounding box.
+ 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 6837464fccd..a8f85fb4cf3 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
@@ -9,96 +9,90 @@
\section{Patterns}
-
\label{section-patterns}
\subsection{Overview}
-There are many ways of filling a path. First, you can fill it using a
-solid color and this is also the fastest method. Second, you can also
-fill it using a shading, which means that the color changes smoothly
-between two (or more) different colors. Third, you can fill it using a
-tiling pattern and it is explained in the following how this is done.
+There are many ways of filling a path. First, you can fill it using a solid
+color and this is also the fastest method. Second, you can also fill it using a
+shading, which means that the color changes smoothly between two (or more)
+different colors. Third, you can fill it using a 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
-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
-part of this infinite plane.
+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 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 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,
-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
-this pattern is used, the stamp is used to print copies of the stamp
-picture onto the plane, but we can use a different stamp color each
-time we use a form-only pattern.
-
-\pgfname\ provides a special support for patterns. You can declare a
-pattern and then use it very much like a fill color. \pgfname\
-directly maps patterns to the pattern facilities of the underlying
-graphic languages (PostScript, \textsc{pdf}, and \textsc{svg}). This
-means that filling a path using a pattern will be nearly as fast as if
-you used a uniform color.
-
-There are a number of pitfalls and restrictions when using
-patterns. First, once a pattern has been declared, you cannot change
-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. 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 the origin of the ``first'' tile is. To be more precise,
-PostScript and \textsc{pdf} on the one hand and \textsc{svg} on the
-other hand define the origin differently. PostScript and \textsc{pdf}
-define a fixed origin that is independent of where the path lies. This
-has the highly desirable effect that if you use the same pattern to
-fill multiple paths, the outcome is the same as if you had filled a single path consisting of the union of all these paths. By
-comparison, \textsc{svg} uses the upper-left (?) corner of the path to
-be filled as the origin. However, the \textsc{svg} specification is a
-bit vague on this question.
+\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, 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 this pattern is used, the stamp is used to print copies
+of the stamp picture onto the plane, but we can use a different stamp color
+each time we use a form-only pattern.
+
+\pgfname\ provides a special support for patterns. You can declare a pattern
+and then use it very much like a fill color. \pgfname\ directly maps patterns
+to the pattern facilities of the underlying graphic languages (PostScript,
+\textsc{pdf}, and \textsc{svg}). This means that filling a path using a pattern
+will be nearly as fast as if you used a uniform color.
+
+There are a number of pitfalls and restrictions when using patterns. First,
+once a pattern has been declared, you cannot change 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. 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 the origin of the ``first'' tile is. To be more precise, PostScript and
+\textsc{pdf} on the one hand and \textsc{svg} on the other hand define the
+origin differently. PostScript and \textsc{pdf} define a fixed origin that is
+independent of where the path lies. This has the highly desirable effect that
+if you use the same pattern to fill multiple paths, the outcome is the same as
+if you had filled a single path consisting of the union of all these paths. By
+comparison, \textsc{svg} uses the upper-left (?) corner of the path to be
+filled as the origin. However, the \textsc{svg} specification is a bit vague on
+this question.
\subsection{Declaring a Pattern}
-Before a pattern can be used, it must be declared. The following
-command is used for this:
+Before a pattern can be used, it must be declared. The following command is
+used for this:
\begin{command}{\pgfdeclarepatternformonly%
- \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 \meta{name} is a
- name for later reference. The two parameters \meta{lower left} and
- \meta{upper right} must describe a bounding box that is large enough
- to encompass the complete tile.
-
- The size of a tile is given by \meta{tile size}, that is, a tile is
- a rectangle whose lower left corner is the origin and whose upper
- right corner is given by \meta{tile size}. This might make you
- wonder why the second and third parameters are needed. First, the
- bounding box might be smaller than the tile size if the tile is
- larger than the picture on the tile. Second, the bounding box might
- be bigger, in which case the picture will ``bleed'' over the tile.
-
- The \meta{code} should be \pgfname\ code than can be protocolled. It
- should not contain any color code.
-
-
+ \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 \meta{name} is a name
+ for later reference. The two parameters \meta{lower left} and \meta{upper
+ right} must describe a bounding box that is large enough to encompass the
+ complete tile.
+
+ The size of a tile is given by \meta{tile size}, that is, a tile is a
+ rectangle whose lower left corner is the origin and whose upper right
+ corner is given by \meta{tile size}. This might make you wonder why the
+ second and third parameters are needed. First, the bounding box might be
+ smaller than the tile size if the tile is larger than the picture on the
+ tile. Second, the bounding box might be bigger, in which case the picture
+ will ``bleed'' over the tile.
+
+ 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}}
@@ -120,37 +114,33 @@ command is used for this:
\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 pattern 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|.
-
+ 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 pattern 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}}
@@ -175,21 +165,22 @@ command is used for this:
\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}}
+ \opt{\oarg{variables}}
\marg{name}
\marg{lower left}
\marg{upper right}
\marg{tile size}
- \marg{code}}
- 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 is not protocolled.
-
+ \marg{code}%
+}
+ 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 is not
+ protocolled.
+ %
\begin{codeexample}[]
\pgfdeclarepatterninherentlycolored{green stars}
{\pgfpointorigin}{\pgfpoint{1cm}{1cm}}
@@ -209,21 +200,20 @@ command is used for this:
\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.
\begin{command}{\pgfsetfillpattern\marg{name}\marg{color}}
- This command specifies that paths that are filled should be filled
- with the ``color'' by the pattern \meta{name}. For an inherently
- colored pattern, the \meta{color} parameter is ignored. For
- form-only patterns, the \meta{color} parameter specifies the color
- to be used for the pattern.
+ This command specifies that paths that are filled should be filled with the
+ ``color'' by the pattern \meta{name}. For an inherently colored pattern,
+ the \meta{color} parameter is ignored. For form-only patterns, the
+ \meta{color} parameter specifies the color to be used for the pattern.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\pgfsetfillpattern{stars}{red}
@@ -233,10 +223,10 @@ Once a pattern has been declared, it can be used.
\filldraw (1.5,0) rectangle (3,2);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
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 61e627f8304..4e4bac2faf0 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
@@ -9,70 +9,59 @@
\section{Creating Plots}
-
\label{section-plots}
This section describes the |plot| module.
\begin{pgfmodule}{plot}
- 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|.
+ 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|.
\end{pgfmodule}
\subsection{Overview}
-There are different reasons for using \pgfname\ for creating plots
-rather than some more powerful program such as \textsc{gnuplot} or
-\textsc{mathematica}, as discussed in
-Section~\ref{section-why-pgname-for-plots}. So, let us assume that --
-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
-\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
-handler might also try to issue appropriate curve-to operations in
-order to smooth the curve. A handler may even do something else
-entirely, like writing each coordinate to another stream, thereby
-duplicating the original stream.
+There are different reasons for using \pgfname\ for creating plots rather than
+some more powerful program such as \textsc{gnuplot} or \textsc{mathematica}, as
+discussed in Section~\ref{section-why-pgname-for-plots}. So, let us assume that
+-- for whatever reason -- you wish to use \pgfname\ for generating a plot.
-Both for the creation of streams and the handling of streams different
-sets of commands exist. The commands for creating streams start with
-|\pgfplotstream|, the commands for setting the handler start with
-|\pgfplothandler|.
+\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 \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
+handler might also try to issue appropriate curve-to operations in order to
+smooth the curve. A handler may even do something else entirely, like writing
+each coordinate to another stream, thereby duplicating the original stream.
+Both for the creation of streams and the handling of streams different sets of
+commands exist. The commands for creating streams start with |\pgfplotstream|,
+the commands for setting the handler start with |\pgfplothandler|.
\subsection{Generating Plot Streams}
\subsubsection{Basic Building Blocks of Plot Streams}
-A \emph{plot stream} is a (long) sequence of the following
-commands:
+A \emph{plot stream} is a (long) sequence of the following commands:
+%
\begin{enumerate}
-\item
- |\pgfplotstreamstart|,
-\item
- |\pgfplotstreampoint|,
-\item
- |\pgfplotstreampointoutlier|,
-\item
- |\pgfplotstreampointundefined|,
-\item
- |\pgfplotstreamnewdataset|,
-\item
- |\pgfplotstreamspecial|, and
-\item
- |\pgfplotstreamend|.
+ \item |\pgfplotstreamstart|,
+ \item |\pgfplotstreampoint|,
+ \item |\pgfplotstreampointoutlier|,
+ \item |\pgfplotstreampointundefined|,
+ \item |\pgfplotstreamnewdataset|,
+ \item |\pgfplotstreamspecial|, and
+ \item |\pgfplotstreamend|.
\end{enumerate}
-Between calls of these commands arbitrary other code may be
-called. Obviously, the stream should start with the first command and
-end with the last command. Here is an example of a plot stream:
+%
+Between calls of these commands arbitrary other code may be called. Obviously,
+the stream should start with the first command and end with the last command.
+Here is an example of a plot stream:
+%
\begin{codeexample}[code only]
\pgfplotstreamstart
\pgfplotstreampoint{\pgfpoint{1cm}{1cm}}
@@ -84,151 +73,151 @@ end with the last command. Here is an example of a plot stream:
\pgfplotstreamend
\end{codeexample}
-Streams are \emph{global}, meaning that they are not influenced by
-\TeX\ groups.
+Streams are \emph{global}, meaning that they are not influenced by \TeX\
+groups.
\begin{command}{\pgfplotstreamstart}
- This command signals that a plot stream starts. The effect of this
- command is to call the internal command |\pgf@plotstreamstart|,
- which is set by the current plot handler to do whatever needs to be
- done at the beginning of the plot. It will also reset the
- meaning of the internal commands like |\pgf@plotstreampoint| to the
- initial setting for the plot handler (what this means will be
- explained in a moment).
+ This command signals that a plot stream starts. The effect of this command
+ is to call the internal command |\pgf@plotstreamstart|, which is set by the
+ current plot handler to do whatever needs to be done at the beginning of
+ the plot. It will also reset the meaning of the internal commands like
+ |\pgf@plotstreampoint| to the initial setting for the plot handler (what
+ this means will be explained in a moment).
\end{command}
\begin{command}{\pgfplotstreampoint\marg{point}}
- This command adds a \meta{point} to the current plot stream. The
- effect of this command is to call the internal command |\pgf@plotstreampoint|,
- which is also set by the current plot handler. This command should
- now ``handle'' the point in some sensible way. For example, a
- line-to command might be issued for the point.
-
- When a plot handler is installed, it will setup the internal command
- |\pgf@plotstreampoint| in some way. It is permissible to change the
- meaning of this internal command during a stream. For instance, a
- handler might setup |\pgf@plotstreampoint| in some sensible way for
- the first point and then redefine it so that subsequent points are
- handled in some other way.
-
- As mentioned earlier, the |\pgfplotstreamstart| will always reset
- the definition of the internal command to the initial meaning it had
- when the handler was installed. This is true for the other commands
- mentioned in the following.
+ This command adds a \meta{point} to the current plot stream. The effect of
+ this command is to call the internal command |\pgf@plotstreampoint|, which
+ is also set by the current plot handler. This command should now ``handle''
+ the point in some sensible way. For example, a line-to command might be
+ issued for the point.
+
+ When a plot handler is installed, it will setup the internal command
+ |\pgf@plotstreampoint| in some way. It is permissible to change the meaning
+ of this internal command during a stream. For instance, a handler might
+ setup |\pgf@plotstreampoint| in some sensible way for the first point and
+ then redefine it so that subsequent points are handled in some other way.
+
+ As mentioned earlier, the |\pgfplotstreamstart| will always reset the
+ definition of the internal command to the initial meaning it had when the
+ handler was installed. This is true for the other commands mentioned in the
+ following.
\end{command}
\begin{command}{\pgfplotstreampointoutlier\marg{point}}
- An \emph{outlier} is a point that is ``out of bounds'' in some
- way. For instance, it might have very large coordinates or the
- coordinates might just be outside some specified
- range. Nevertheless, an outlier is still a well-defined point. This
- command is issued, for instance, by \textsc{gnuplot} when a value is
- outside the specified range.
-
- You can configure how outliers are treated using the following key:
- \begin{key}{/pgf/handle outlier points in plots=\meta{how}
- (initially jump)}
+ An \emph{outlier} is a point that is ``out of bounds'' in some way. For
+ instance, it might have very large coordinates or the coordinates might
+ just be outside some specified range. Nevertheless, an outlier is still a
+ well-defined point. This command is issued, for instance, by
+ \textsc{gnuplot} when a value is outside the specified range.
+
+ You can configure how outliers are treated using the following key:
+ %
+ \begin{key}{/pgf/handle outlier points in plots=\meta{how} (initially jump)}
\keyalias{tikz}
- You can set \meta{how} to one of the following values:
- \begin{itemize}
- \item |plot| This will cause the outlier to be drawn normally,
- just as if |\pgfplotstreampoint| had been used rather than this
- command.
- \item |ignore| The outlier will be completely ignored, just as if
- the command had not been used at all.
- \item |jump| This causes the internal macro |\pgf@plotstreamjump|
- to be called. A ``jump'' in a stream is a position where a
- ``gap'' is introduced. For instance, a simple line-to plot
- handler will stop the current subpath at a jump position and
- begin with a move-to operation at the next normal point of the
- stream.
-
- The net effect of this setting is that at outlier points plots
- get interrupted and ``restarted'' when the points are no longer
- outliers. This is usually the behaviour you will be looking for.
- \end{itemize}
- \end{key}
+ You can set \meta{how} to one of the following values:
+ %
+ \begin{itemize}
+ \item |plot| This will cause the outlier to be drawn normally, just
+ as if |\pgfplotstreampoint| had been used rather than this
+ command.
+ \item |ignore| The outlier will be completely ignored, just as if
+ the command had not been used at all.
+ \item |jump| This causes the internal macro |\pgf@plotstreamjump|
+ to be called. A ``jump'' in a stream is a position where a
+ ``gap'' is introduced. For instance, a simple line-to plot
+ handler will stop the current subpath at a jump position and
+ begin with a move-to operation at the next normal point of the
+ stream.
+
+ The net effect of this setting is that at outlier points plots
+ get interrupted and ``restarted'' when the points are no longer
+ outliers. This is usually the behaviour you will be looking
+ for.
+ \end{itemize}
+ \end{key}
\end{command}
\begin{command}{\pgfplotstreampointundefined}
- This command indicated that the stream contains an ``undefined''
- point like a point where some coordinate results for a division by
- zero. Such a point cannot be plotted, which is why it is not given
- as a parameter. However, such a point \emph{can} result in a jump in
- the plot, depending on the setting of the following key:
- \begin{key}{/pgf/handle undefined points in plots=\meta{how}
- (initially jump)}
+ This command indicated that the stream contains an ``undefined'' point like
+ a point where some coordinate results for a division by zero. Such a point
+ cannot be plotted, which is why it is not given as a parameter. However,
+ such a point \emph{can} result in a jump in the plot, depending on the
+ setting of the following key:
+ %
+ \begin{key}{/pgf/handle undefined points in plots=\meta{how} (initially jump)}
\keyalias{tikz}
- You can set \meta{how} to one of the following values:
- \begin{itemize}
- \item |ignore| The undefined point will be completely ignored, just as if
- the command had not been used at all.
- \item |jump| This causes the internal macro |\pgf@plotstreamjump|
- to be called.
- \end{itemize}
- \end{key}
+ You can set \meta{how} to one of the following values:
+ %
+ \begin{itemize}
+ \item |ignore| The undefined point will be completely ignored, just
+ as if the command had not been used at all.
+ \item |jump| This causes the internal macro |\pgf@plotstreamjump|
+ to be called.
+ \end{itemize}
+ \end{key}
\end{command}
\begin{command}{\pgfplotstreamnewdataset}
- This command indicated that in the stream a ``new data set'' starts.
- So, the stream does not end, but there is a logical break in the
- data. For example, when a table is read from a file, empty lines are
- interpreted as indicating new data sets. What happens when a new
- data set is encountered is governed by the following key:
- \begin{key}{/pgf/handle new data sets in plots=\meta{how}
- (initially jump)}
+ This command indicated that in the stream a ``new data set'' starts. So,
+ the stream does not end, but there is a logical break in the data. For
+ example, when a table is read from a file, empty lines are interpreted as
+ indicating new data sets. What happens when a new data set is encountered
+ is governed by the following key:
+ %
+ \begin{key}{/pgf/handle new data sets in plots=\meta{how} (initially jump)}
\keyalias{tikz}
- You can set \meta{how} to one of the following values:
- \begin{itemize}
- \item |ignore| The command will be completely ignored, just as if
- the command had not been used at all.
- \item |jump| This causes the internal macro |\pgf@plotstreamjump|
- to be called.
- \end{itemize}
- \end{key}
+ You can set \meta{how} to one of the following values:
+ %
+ \begin{itemize}
+ \item |ignore| The command will be completely ignored, just as if
+ the command had not been used at all.
+ \item |jump| This causes the internal macro |\pgf@plotstreamjump|
+ to be called.
+ \end{itemize}
+ \end{key}
\end{command}
\begin{command}{\pgfplotstreamspecial\marg{text}}
- This command causes |\pgf@plotstreamspecial| to be called with
- \meta{text} as its parameter. This allows handler-specific
- information to be passed to the handler. All normal handlers ignore
- this command.
+ This command causes |\pgf@plotstreamspecial| to be called with \meta{text}
+ as its parameter. This allows handler-specific information to be passed to
+ the handler. All normal handlers ignore this command.
\end{command}
\begin{command}{\pgfplotstreamend}
- This command signals that a plot stream ends. It calls
- |\pgf@plotstreamend|, which should now do any necessary ``cleanup.''
+ This command signals that a plot stream ends. It calls
+ |\pgf@plotstreamend|, which should now do any necessary ``cleanup''.
\end{command}
-Note that plot streams are not buffered, that is, the different points
-are handled immediately. However, using the recording handler, it is
-possible to record a stream.
+Note that plot streams are not buffered, that is, the different points are
+handled immediately. However, using the recording handler, it is possible to
+record a stream.
\subsubsection{Commands That Generate Plot Streams}
\label{section-plot-jumps}
-Plot streams can be created ``by hand'' as in the earlier
-example. However, most of the time the coordinates will be produced
-internally by some command. For example, the |\pgfplotxyfile| reads a
-file and converts it into a plot stream.
+Plot streams can be created ``by hand'' as in the earlier example. However,
+most of the time the coordinates will be produced internally by some command.
+For example, the |\pgfplotxyfile| reads a file and converts it into a plot
+stream.
\begin{command}{\pgfplotxyfile\marg{filename}}
- This command will try to open the file \meta{filename}. If this
- succeeds, it will convert the file contents into a plot stream as
- follows: A |\pgfplotstreamstart| is issued. Then, for each nonempty
- line a |\pgfplotstreamnewdataset| is produced. Other lines in the
- file should start with two numbers separated by a space, such as
- |0.1 1| or |100 -.3|. The numbers may be followed by some text,
- which will be ignore \emph{except} if it is exactly ``|u|'' or
- ``|o|''. For ``|u|'', the point is considered to be undefined and
- |\pgfplotstreampointundefined| is called. For ``|o|'', the point is
- considered to be an outlier and |\pgfplotstreampointoutlier| is
- called. Otherwise, each pair \meta{x} and \meta{y} of numbers is
- converted into one plot stream point in the xy-coordinate
- system. Thus, a line like
+ This command will try to open the file \meta{filename}. If this succeeds,
+ it will convert the file contents into a plot stream as follows: A
+ |\pgfplotstreamstart| is issued. Then, for each empty line a
+ |\pgfplotstreamnewdataset| is produced. Other lines in the file should
+ start with two numbers separated by a space, such as |0.1 1| or |100 -.3|.
+ The numbers may be followed by some text, which will be ignore
+ \emph{except} if it is exactly ``|u|'' or ``|o|''. For ``|u|'' the point
+ is considered to be undefined and |\pgfplotstreampointundefined| is called.
+ For ``|o|'' the point is considered to be an outlier and
+ |\pgfplotstreampointoutlier| is called. Otherwise, each pair \meta{x} and
+ \meta{y} of numbers is converted into one plot stream point in the
+ $xy$-coordinate system. Thus, a line like
+ %
\begin{codeexample}[code only, tikz syntax=false]
-0 Nan u
+0 Nan u
1 1 some text
2 4
3 9
@@ -236,7 +225,9 @@ file and converts it into a plot stream.
4 16 o
5 25 oo
\end{codeexample}
- is turned into
+ %
+ is turned into
+ %
\begin{codeexample}[code only]
\pgfplotstreamstart
\pgfplotstreampointundefined
@@ -248,22 +239,22 @@ file and converts it into a plot stream.
\pgfplotstreampoint{\pgfpointxy{5}{25}}
\pgfplotstreamend
\end{codeexample}
- (Note that the last line is not an outlier because |oo| is not the
- same as |o|).
+ %
+ (Note that the last line is not an outlier because |oo| is not the same as
+ |o|).
- The two characters |%| and |#| are also allowed in a file and they
- are both treated as comment characters. Thus, a line starting with
- either of them is treated as empty.
+ The two characters |%| and |#| are also allowed in a file and they are both
+ treated as comment characters. Thus, a line starting with either of them is
+ treated as empty.
- When the file has been read completely, |\pgfplotstreamend| is
- called.
+ When the file has been read completely, |\pgfplotstreamend| is called.
\end{command}
-
\begin{command}{\pgfplotxyzfile\marg{filename}}
- This command works like |\pgfplotxyfile|, only \emph{three} numbers
- are expected on each non-empty line. They are converted into points
- in the xyz-coordinate system. Consider, the following file:
+ This command works like |\pgfplotxyfile|, only \emph{three} numbers are
+ expected on each non-empty line. They are converted into points in the
+ $xyz$-coordinate system. Consider, the following file:
+ %
\begin{codeexample}[code only, tikz syntax=false]
% Some comments
# more comments
@@ -271,7 +262,9 @@ file and converts it into a plot stream.
2 -.2 2 o
2 -5 2 third entry
\end{codeexample}
- It is turned into the following stream:
+ %
+ It is turned into the following stream:
+ %
\begin{codeexample}[code only]
\pgfplotstreamstart
\pgfplotstreamnewdataset
@@ -281,22 +274,20 @@ file and converts it into a plot stream.
\pgfplotstreampoint{\pgfpointxyz{2}{-5}{2}}
\pgfplotstreamend
\end{codeexample}
+ %
\end{command}
-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.
-
+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.
\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
- \meta{variable}, the \meta{point} is evaluated and the resulting
- coordinate is inserted into the plot stream.
-
+ 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 \meta{variable}, the \meta{point} is evaluated
+ and the resulting coordinate is inserted into the plot stream.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[x=3.8cm/360]
\pgfplothandlerlineto
@@ -313,40 +304,38 @@ intelligently.
\end{tikzpicture}
\end{codeexample}
- Be warned that if the expressions that need to evaluated for each
- point are complex, then this command can be very slow.
+ Be warned that if the expressions that need to evaluated for each point are
+ complex, then this command can be very slow.
\end{command}
-
-
\begin{command}{\pgfplotgnuplot\oarg{prefix}\marg{function}}
- This command will ``try'' to call the \textsc{gnuplot} program to
- generate the coordinates of the \meta{function}. In detail, the
- following happens:
+ This command will ``try'' to call the \textsc{gnuplot} program to generate
+ the coordinates of the \meta{function}. In detail, the following happens:
- This command works with two files: \meta{prefix}|.gnuplot| and
- \meta{prefix}|.table|. If the optional argument \meta{prefix} is
- not given, it is set to |\jobname|.
+ This command works with two files: \meta{prefix}|.gnuplot| and
+ \meta{prefix}|.table|. If the optional argument \meta{prefix} is not
+ given, it is set to |\jobname|.
- Let us start with the situation where none of these files
- exists. Then \pgfname\ will first generate the file
- \meta{prefix}|.gnuplot|. In this file it writes
+ Let us start with the situation where none of these files exists. Then
+ \pgfname\ will first generate the file \meta{prefix}|.gnuplot|. In this
+ file it writes
+ %
\begin{codeexample}[code only, tikz syntax=false]
set terminal table; set output "#1.table"; set format "%.5f"
\end{codeexample}
- where |#1| is replaced by \meta{prefix}. Then, in a second line, it
- writes the text \meta{function}.
-
- Next, \pgfname\ will try to invoke the program |gnuplot| with the
- argument \meta{prefix}|.gnuplot|. This call may or may not succeed,
- depending on whether the |\write18| mechanism (also known as
- shell escape) is switched on and whether the |gnuplot| program is
- available.
-
- 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|.
-
+ %
+ where |#1| is replaced by \meta{prefix}. Then, in a second line, it writes
+ the text \meta{function}.
+
+ Next, \pgfname\ will try to invoke the program |gnuplot| with the argument
+ \meta{prefix}|.gnuplot|. This call may or may not succeed, depending on
+ whether the |\write18| mechanism (also known as shell escape) is switched
+ on and whether the |gnuplot| program is available.
+
+ 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);
@@ -356,59 +345,53 @@ set terminal table; set output "#1.table"; set format "%.5f"
\end{tikzpicture}
\end{codeexample}
- The more difficult situation arises when the |.gnuplot| file exists,
- which will be the case on the second run of \TeX\ on the \TeX\
- file. In this case \pgfname\ will read this file and check whether
- it contains exactly what \pgfname\ ``would have written'' into
- this file. If this is not the case, the file contents is overwritten
- with what ``should be there'' and, as above, |gnuplot| is invoked to
- generate a new |.table| file. However, if the file contents is ``as
- expected,'' the external |gnuplot| program is \emph{not}
- called. Instead, the \meta{prefix}|.table| file is immediately
- read.
-
- As explained in Section~\ref{section-tikz-gnuplot}, the net effect
- of the above mechanism is that |gnuplot| is called as seldom as
- possible and that when you pass along the |.gnuplot| and |.table|
- files with your |.tex| file to someone else, that person can
- \TeX\ the |.tex| file without having |gnuplot| installed and without
- having the |\write18| mechanism switched on.
-
- \begin{key}{/pgf/plot/gnuplot call=\meta{gnuplot invocation} (initially gnuplot)}
- This key can be used to change the way gnuplot is called.
-
- Some portable Mik\TeX{} distribution needs something like the
- following.
-
+ The more difficult situation arises when the |.gnuplot| file exists, which
+ will be the case on the second run of \TeX\ on the \TeX\ file. In this case
+ \pgfname\ will read this file and check whether it contains exactly what
+ \pgfname\ ``would have written'' into this file. If this is not the case,
+ the file contents is overwritten with what ``should be there'' and, as
+ above, |gnuplot| is invoked to generate a new |.table| file. However, if
+ the file contents is ``as expected'', the external |gnuplot| program is
+ \emph{not} called. Instead, the \meta{prefix}|.table| file is immediately
+ read.
+
+ As explained in Section~\ref{section-tikz-gnuplot}, the net effect of the
+ above mechanism is that |gnuplot| is called as seldom as possible and that
+ when you pass along the |.gnuplot| and |.table| files with your |.tex| file
+ to someone else, that person can \TeX\ the |.tex| file without having
+ |gnuplot| installed and without having the |\write18| mechanism switched
+ on.
+
+ \begin{key}{/pgf/plot/gnuplot call=\meta{gnuplot invocation} (initially gnuplot)}
+ This key can be used to change the way gnuplot is called.
+
+ Some portable MiK\TeX{} distribution needs something like the
+ following.
+ %
\begin{codeexample}[code only]
\pgfkeys{/pgf/plot/gnuplot call="/Programs/gnuplot/binary/gnuplot"}
\end{codeexample}
-
- \end{key}
+ \end{key}
\end{command}
-
\subsection{Plot Handlers}
-
\label{section-plot-handlers}
-A \emph{plot handler} determines what ``should be done'' with a
-plot stream. You must set the plot handler before the stream starts.
-The following commands install the most basic plot handlers; more plot
-handlers are defined in the file |pgflibraryplothandlers|, which is
-documented in Section~\ref{section-library-plothandlers}.
+A \emph{plot handler} determines what ``should be done'' with a plot stream.
+You must set the plot handler before the stream starts. The following commands
+install the most basic plot handlers; more plot handlers are defined in the
+file |pgflibraryplothandlers|, which is documented in
+Section~\ref{section-library-plothandlers}.
-All plot handlers work by setting or redefining the following three
-macros: |\pgf@plotstreamstart|, |\pgf@plotstreampoint|, and
-|\pgf@plotstreamend|.
+All plot handlers work by setting or redefining the following three macros:
+|\pgf@plotstreamstart|, |\pgf@plotstreampoint|, and |\pgf@plotstreamend|.
\begin{command}{\pgfplothandlerlineto}
- This handler will issue a |\pgfpathlineto| command for each point of
- the plot, \emph{except} possibly for the first. What happens with
- the first point can be specified using the two commands described
- below.
-
+ This handler will issue a |\pgfpathlineto| command for each point of the
+ plot, \emph{except} possibly for the first. What happens with the first
+ point can be specified using the two commands described below.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
@@ -422,20 +405,20 @@ macros: |\pgf@plotstreamstart|, |\pgf@plotstreampoint|, and
\pgfusepath{stroke}
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfsetmovetofirstplotpoint}
- 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,
- desirable. This is the default.
+ 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, desirable. This is the default.
\end{command}
\begin{command}{\pgfsetlinetofirstplotpoint}
- Specifies that plot handlers should issue a line-to command for the
- first point of the plot.
-
+ Specifies that plot handlers should issue a line-to command for the first
+ point of the plot.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfpathmoveto{\pgfpointorigin}
@@ -450,25 +433,25 @@ macros: |\pgf@plotstreamstart|, |\pgf@plotstreampoint|, and
\pgfusepath{stroke}
\end{pgfpicture}
\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.
+ 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.
+ This handler will simply throw away the stream.
\end{command}
\begin{command}{\pgfplothandlerrecord\marg{macro}}
- When this handler is installed, each time a plot stream command is
- called, this command will be appended to \meta{macro}. Thus, at
- the end of the stream, \meta{macro} will contain all the
- commands that were issued on the stream. You can then install
- another handler and invoke \meta{macro} to ``replay'' the stream
- (possibly many times).
-
+ When this handler is installed, each time a plot stream command is called,
+ this command will be appended to \meta{macro}. Thus, at the end of the
+ stream, \meta{macro} will contain all the 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}
@@ -485,19 +468,20 @@ macros: |\pgf@plotstreamstart|, |\pgf@plotstreampoint|, and
\pgfusepath{stroke}
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
-
\subsection{Defining New Plot Handlers}
You can define new plot handlers using the following command:
\begin{command}{\pgfdeclareplothandler\marg{macro}\marg{arguments}\marg{configuration}}
- This command creates a new plot handler that can subsequently be
- called using the macro \meta{macro}. This macro take the arguments
- given in \meta{arguments}, which can be a list like |#1#2| if
- \meta{macro} should be invoked with two arguments. Here is a typical example:
+ This command creates a new plot handler that can subsequently be called
+ using the macro \meta{macro}. This macro take the arguments given in
+ \meta{arguments}, which can be a list like |#1#2| if \meta{macro} should be
+ invoked with two arguments. Here is a typical example:
+ %
\begin{codeexample}[code only]
\pgfdeclareplothandler{\myhandler}{#1}{...}
...
@@ -507,33 +491,36 @@ You can define new plot handlers using the following command:
\pgfplotstreamend
\end{codeexample}
- The \meta{configuration} is used to define the behaviour of the
- handler. It is a list of key--value pairs, where the following keys
- are allowed:
- \begin{itemize}
- \item |start=|\meta{code}. The \meta{code} will be executed whenever
- |\pgfplotstreamstart| is used while the handler \meta{macro} is
- selected. Inside the \meta{code}, you can use |#1|, |#2|, and so
- on to refer to the parameters that were given to \meta{macro}:
+ The \meta{configuration} is used to define the behaviour of the handler. It
+ is a list of key--value pairs, where the following keys are allowed:
+ %
+ \begin{itemize}
+ \item |start=|\meta{code}. The \meta{code} will be executed whenever
+ |\pgfplotstreamstart| is used while the handler \meta{macro} is
+ selected. Inside the \meta{code}, you can use |#1|, |#2|, and so on
+ to refer to the parameters that were given to \meta{macro}:
+ %
\begin{codeexample}[width=6cm]
\pgfdeclareplothandler{\myhandler}{#1}{
start = Hi #1.,
end = Bye #1.,
}
\myhandler{foo}
-\pgfplotstreamstart
+\pgfplotstreamstart
\pgfplotstreamend
\myhandler{bar}
-\pgfplotstreamstart
+\pgfplotstreamstart
\pgfplotstreamend
\end{codeexample}
- \item |end=|\meta{code} Works just like |start|.
- \item |point=|\meta{code}. The \meta{code} will be executed whenever
- |\pgfplotstreampoint| is used while the handler \meta{macro} is in
- force. Inside the \meta{code}, you can use |#1|, |#2|, and so on
- to refer to the arguments give to \meta{macro}, while you can use
- |##1| to refer to the argument given to |\pgfplotstreampoint|
- itself (this will be the coordinate).
+ %
+ \item |end=|\meta{code} Works just like |start|.
+ \item |point=|\meta{code}. The \meta{code} will be executed whenever
+ |\pgfplotstreampoint| is used while the handler \meta{macro} is in
+ force. Inside the \meta{code}, you can use |#1|, |#2|, and so on to
+ refer to the arguments give to \meta{macro}, while you can use
+ |##1| to refer to the argument given to |\pgfplotstreampoint|
+ itself (this will be the coordinate).
+ %
\begin{codeexample}[]
\pgfdeclareplothandler{\myhandler}{#1}{
point=\pgfpathcircle{##1}{#1} % ##1 is the coordinate,
@@ -556,40 +543,42 @@ You can define new plot handlers using the following command:
\pgfusepath{stroke}
\end{pgfpicture}
\end{codeexample}
- The \meta{code} will also be called for
- |\pgfplotstreampointoutlier| when this command has been configured
- to |plot| the outliers.
- \item |jump=|\meta{code} The \meta{code} will be called whenever a
- jump has been requested indirectly via an outlier point, and
- undefined point, or a new data set (for each of which the command
- needs to be configured to |jump|). As always, inside the
- \meta{code} you can access |#1| and so on.
- \item |special=|\meta{code} Causes \meta{code} to be executed
- whenever |\pgfplotstreamspecial|\marg{something} is used. Inside
- the \meta{code}, you can access \meta{something} via |##1| and the
- parameters of \meta{macro} as |#1|, |#2|, and so on.
- \end{itemize}
-
- In addition to the above keys, there exist also ``code macro
- versions'' of them:
- \begin{itemize}
- \item |point macro=|\meta{some macro}. Causes |\pgfplotstreampoint|
- to call \meta{some macro} directly (actually,
- |\pgf@plotstreampoint| is set to be equal to \meta{some
- macro}). Inside the \meta{some macro} you can use |#1| to access
- the coordinate passed to |\pgfplotstreampoint| and you can no
- longer access the parameters passed to the original call to
- \meta{macro} that installed the handler. So, \meta{some macro}
- must take exactly one argument, namely |#1|.
- \item |special macro=|\meta{some macro}. As |point macro|, only for
- specials.
- \item |start macro=|\meta{some macro}. Causes \meta{some macro} to
- be executed at the start. This macro, like the below ones, may not
- take any parameters and will not have access to the parameters
- passed to the original \meta{macro}.
- \item |end macro=|\meta{some macro}. As above.
- \item |jump macro=|\meta{some macro}. As above.
- \end{itemize}
+ %
+ The \meta{code} will also be called for
+ |\pgfplotstreampointoutlier| when this command has been configured
+ to |plot| the outliers.
+ \item |jump=|\meta{code} The \meta{code} will be called whenever a jump
+ has been requested indirectly via an outlier point, and undefined
+ point, or a new data set (for each of which the command needs to be
+ configured to |jump|). As always, inside the \meta{code} you can
+ access |#1| and so on.
+ \item |special=|\meta{code} Causes \meta{code} to be executed whenever
+ |\pgfplotstreamspecial|\marg{something} is used. Inside the
+ \meta{code}, you can access \meta{something} via |##1| and the
+ parameters of \meta{macro} as |#1|, |#2|, and so on.
+ \end{itemize}
+
+ In addition to the above keys, there exist also ``code macro versions'' of
+ them:
+ %
+ \begin{itemize}
+ \item |point macro=|\meta{some macro}. Causes |\pgfplotstreampoint| to
+ call \meta{some macro} directly (actually, |\pgf@plotstreampoint|
+ is set to be equal to \meta{some macro}). Inside the \meta{some
+ macro} you can use |#1| to access the coordinate passed to
+ |\pgfplotstreampoint| and you can no longer access the parameters
+ passed to the original call to \meta{macro} that installed the
+ handler. So, \meta{some macro} must take exactly one argument,
+ namely |#1|.
+ \item |special macro=|\meta{some macro}. As |point macro|, only for
+ specials.
+ \item |start macro=|\meta{some macro}. Causes \meta{some macro} to be
+ executed at the start. This macro, like the below ones, may not
+ take any parameters and will not have access to the parameters
+ passed to the original \meta{macro}.
+ \item |end macro=|\meta{some macro}. As above.
+ \item |jump macro=|\meta{some macro}. As above.
+ \end{itemize}
\end{command}
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 833118bdf57..eace57ffde3 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
@@ -9,28 +9,24 @@
\section{Specifying Coordinates}
-
\label{section-points}
\subsection{Overview}
-Most \pgfname\ commands expect you to provide the coordinates of a
-\emph{point} (also called \emph{coordinate}) inside your
-picture. Points are always ``local'' to your picture, that is, they
-never refer to an absolute position on the page, but to a position
-inside the current |{pgfpicture}| environment. To specify a coordinate
-you can use commands that start with |\pgfpoint|.
+Most \pgfname\ commands expect you to provide the coordinates of a \emph{point}
+(also called \emph{coordinate}) inside your picture. Points are always
+``local'' to your picture, that is, they never refer to an absolute position on
+the page, but to a position inside the current |{pgfpicture}| environment. To
+specify a coordinate you can use commands that start with |\pgfpoint|.
\subsection{Basic Coordinate Commands}
-The following commands are the most basic for specifying a
-coordinate.
+The following commands are the most basic for specifying a coordinate.
\begin{command}{\pgfpoint\marg{x coordinate}\marg{y coordinate}}
- Yields a point location. The coordinates are given as \TeX\
- dimensions.
-
+ Yields a point location. The coordinates are given as \TeX\ dimensions.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -40,19 +36,21 @@ coordinate.
\pgfusepath{fill}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfpointorigin}
- Yields the origin. Same as |\pgfpoint{0pt}{0pt}|.
+ Yields the origin. Same as |\pgfpoint{0pt}{0pt}|.
\end{command}
\begin{command}{\pgfpointpolar\marg{degree}{\ttfamily\char`\{}\meta{radius}\opt{|/|\meta{y-radius}}{\ttfamily\char`\}}}
- Yields a point location given in polar coordinates. You can specify
- the angle only in degrees, radians are not supported, currently.
+ Yields a point location given in polar coordinates. You can specify the
+ angle only in degrees, radians are not supported, currently.
- If the optional \meta{y-radius} is given, the polar coordinate is
- actually a coordinate on an ellipse whose $x$-radius is given by
- \meta{radius} and whose $y$-radius is given by \meta{y-radius}.
+ If the optional \meta{y-radius} is given, the polar coordinate is actually
+ a coordinate on an ellipse whose $x$-radius is given by \meta{radius} and
+ whose $y$-radius is given by \meta{y-radius}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -62,6 +60,7 @@ coordinate.
\pgfusepath{fill}
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -71,23 +70,23 @@ coordinate.
\pgfusepath{fill}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\subsection{Coordinates in the XY-Coordinate System}
Coordinates can also be specified as multiples of an $x$-vector and a
-$y$-vector. Normally, the $x$-vector points one centimeter in the
-$x$-direction and the $y$-vector points one centimeter in the
-$y$-direction, but using the commands |\pgfsetxvec| and
-|\pgfsetyvec| they can be changed. Note that the $x$- and
-$y$-vector do not necessarily point ``horizontally'' and
-``vertically.''
+$y$-vector. Normally, the $x$-vector points one centimeter in the $x$-direction
+and the $y$-vector points one centimeter in the $y$-direction, but using the
+commands |\pgfsetxvec| and |\pgfsetyvec| they can be changed. Note that the
+$x$- and $y$-vector do not necessarily point ``horizontally'' and
+``vertically''.
\begin{command}{\pgfpointxy\marg{$s_x$}\marg{$s_y$}}
- Yields a point that is situated at $s_x$ times the
- $x$-vector plus $s_y$ times the $y$-vector.
+ Yields a point that is situated at $s_x$ times the $x$-vector plus $s_y$
+ times the $y$-vector.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -96,13 +95,13 @@ $y$-vector do not necessarily point ``horizontally'' and
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgfsetxvec\marg{point}}
- Sets that current $x$-vector for usage in the $xyz$-coordinate
- system.
- \example
+ Sets that current $x$-vector for usage in the $xyz$-coordinate system.
+ \example
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -118,23 +117,22 @@ $y$-vector do not necessarily point ``horizontally'' and
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfsetyvec\marg{point}}
- Works like |\pgfsetxvec|.
+ Works like |\pgfsetxvec|.
\end{command}
-
-
\begin{command}{\pgfpointpolarxy\marg{degree}{\ttfamily\char`\{}\meta{radius}\opt{|/|\meta{y-radius}}{\ttfamily\char`\}}}
- This command is similar to the |\pgfpointpolar| command, but the
- \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$-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.
+ This command is similar to the |\pgfpointpolar| command, but the
+ \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$-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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -146,20 +144,20 @@ $y$-vector do not necessarily point ``horizontally'' and
\end{scope}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\subsection{Three Dimensional Coordinates}
-It is also possible to specify a point as a multiple of three vectors,
-the $x$-, $y$-, and $z$-vector. This is useful for creating simple
-three dimensional graphics.
+It is also possible to specify a point as a multiple of three vectors, the
+$x$-, $y$-, and $z$-vector. This is useful for creating simple three
+dimensional graphics.
\begin{command}{\pgfpointxyz\marg{$s_x$}\marg{$s_y$}\marg{$s_z$}}
- Yields a point that is situated at $s_x$ times the
- $x$-vector plus $s_y$ times the $y$-vector plus $s_z$ times the
- $z$-vector.
+ Yields a point that is situated at $s_x$ times the $x$-vector plus $s_y$
+ times the $y$-vector plus $s_z$ times the $z$-vector.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfsetarrowsend{to}
@@ -175,21 +173,23 @@ three dimensional graphics.
\pgfusepath{stroke}
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfsetzvec\marg{point}}
- Works like |\pgfsetxvec|.
+ Works like |\pgfsetxvec|.
\end{command}
-Inside the $xyz$-coordinate system, you can also specify points
-using spherical and cylindrical coordinates.
-
+Inside the $xyz$-coordinate system, you can also specify points using spherical
+and cylindrical coordinates.
\begin{command}{\pgfpointcylindrical\marg{degree}\marg{radius}\marg{height}}
- This command yields the same as
+ This command yields the same as
+ %
\begin{verbatim}
\pgfpointadd{\pgfpointpolarxy{degree}{radius}}{\pgfpointxyz{0}{0}{height}}
\end{verbatim}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [->] (0,0) -- (1,0,0) node [right] {$x$};
@@ -202,13 +202,14 @@ using spherical and cylindrical coordinates.
\draw[red] (0,0) -- (0,0,.5) -- +(80:1);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfpointspherical\marg{longitude}\marg{latitude}\marg{radius}}
- This command yields a point ``on the surface of the earth''
- specified by the \meta{longitude} and the \meta{latitude}. The
- radius of the earth is given by \meta{radius}. The equator lies in
- the $xy$-plane.
+ This command yields a point ``on the surface of the earth'' specified by
+ the \meta{longitude} and the \meta{latitude}. The radius of the earth is
+ given by \meta{radius}. The equator lies in the $xy$-plane.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\pgfsetfillcolor{lightgray}
@@ -227,10 +228,10 @@ using spherical and cylindrical coordinates.
}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\subsection{Building Coordinates From Other Coordinates}
Many commands allow you to construct a coordinate in terms of other
@@ -240,7 +241,8 @@ coordinates.
\subsubsection{Basic Manipulations of Coordinates}
\begin{command}{\pgfpointadd\marg{$v_1$}\marg{$v_2$}}
- Returns the sum vector $\meta{$v_1$} + \meta{$v_2$}$.
+ Returns the sum vector $\meta{$v_1$} + \meta{$v_2$}$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -248,10 +250,12 @@ coordinates.
\pgfusepath{fill}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfpointscale\marg{factor}\marg{coordinate}}
- Returns the vector $\meta{factor}\meta{coordinate}$.
+ Returns the vector $\meta{factor}\meta{coordinate}$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -259,10 +263,12 @@ coordinates.
\pgfusepath{fill}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfpointdiff\marg{start}\marg{end}}
- Returns the difference vector $\meta{end} - \meta{start}$.
+ Returns the difference vector $\meta{end} - \meta{start}$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -270,23 +276,23 @@ coordinates.
\pgfusepath{fill}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgfpointnormalised\marg{point}}
- This command returns a normalised version of \meta{point}, that is,
- a vector of length 1pt pointing in the direction of \meta{point}. If
- \meta{point} is the $0$-vector or extremely short, a vector of
- length 1pt pointing upwards is returned.
-
- This command is \emph{not} implemented by calculating the length of
- the vector, but rather by calculating the angle of the vector and
- then using (something equivalent to) the |\pgfpointpolar|
- command. This ensures that the point will really have length 1pt,
- but it is not guaranteed that the vector will \emph{precisely} point
- in the direction of \meta{point} due to the fact that the polar
- tables are accurate only up to one degree. Normally, this is not a
- problem.
+ This command returns a normalised version of \meta{point}, that is, a
+ vector of length 1pt pointing in the direction of \meta{point}. If
+ \meta{point} is the $0$-vector or extremely short, a vector of length 1pt
+ pointing upwards is returned.
+
+ This command is \emph{not} implemented by calculating the length of the
+ vector, but rather by calculating the angle of the vector and then using
+ (something equivalent to) the |\pgfpointpolar| command. This ensures that
+ the point will really have length 1pt, but it is not guaranteed that the
+ vector will \emph{precisely} point in the direction of \meta{point} due to
+ the fact that the polar tables are accurate only up to one degree.
+ Normally, this is not a problem.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -296,32 +302,27 @@ coordinates.
\pgfusepath{fill}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\subsubsection{Points Traveling along Lines and Curves}
-
\label{section-pointsattime}
-The commands in this section allow you to specify points on a line or
-a curve. Imagine a point ``traveling'' along a curve from some point
-$p$ to another point $q$. At time $t=0$ the point is at $p$ and at
-time $t=1$ it is at $q$ and at time, say, $t=1/2$ it is ``somewhere in
-the middle.'' The exact location at time $t=1/2$ will not necessarily
-be the ``halfway point,'' that is, the point whose distance on the
-curve from $p$ and $q$ is equal. Rather, the exact location will
-depend on the ``speed'' at which the point is traveling, which in
-turn depends on the lengths of the support vectors in a complicated
-manner. If you are interested in the details, please see a good book
-on B\'ezier curves.
-
-
+The commands in this section allow you to specify points on a line or a curve.
+Imagine a point ``traveling'' along a curve from some point $p$ to another
+point $q$. At time $t=0$ the point is at $p$ and at time $t=1$ it is at $q$ and
+at time, say, $t=1/2$ it is ``somewhere in the middle''. The exact location at
+time $t=1/2$ will not necessarily be the ``halfway point'', that is, the point
+whose distance on the curve from $p$ and $q$ is equal. Rather, the exact
+location will depend on the ``speed'' at which the point is traveling, which in
+turn depends on the lengths of the support vectors in a complicated manner. If
+you are interested in the details, please see a good book on Bézier curves.
\begin{command}{\pgfpointlineattime\marg{time $t$}\marg{point $p$}\marg{point $q$}}
- Yields a point that is the $t$th fraction between $p$
- and~$q$, that is, $p + t(q-p)$. For $t=1/2$ this is the middle of
- $p$ and $q$.
-
+ Yields a point that is the $t$th fraction between $p$ and~$q$, that is, $p
+ + t(q-p)$. For $t=1/2$ this is the middle of $p$ and $q$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -333,14 +334,17 @@ on B\'ezier curves.
\pgfpointlineattime{\t}{\pgfpointorigin}{\pgfpoint{2cm}{2cm}}]{\t}}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfpointlineatdistance\marg{distance}\marg{start point}\marg{end point}}
- Yields a point that is located \meta{distance} many units away
- from the start point in the direction of the end point. In other
- words, this is the point that results if we travel \meta{distance}
- steps from \meta{start point} towards \meta{end point}.
- \example
+ Yields a point that is located \meta{distance} many units away from the
+ start point in the direction of the end point. In other words, this is the
+ point that results if we travel \meta{distance} steps from \meta{start
+ point} towards \meta{end point}.
+ %
+ \example
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -352,17 +356,16 @@ on B\'ezier curves.
\pgfpointlineatdistance{\d}{\pgfpointorigin}{\pgfpoint{3cm}{2cm}}]{\d}}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-\begin{command}{\pgfpointarcaxesattime\marg{time
- $t$}\marg{center}\marg{0-degree axis}\marg{90-degree
- axis}\marg{start angle}\\\marg{end angle}}
- Yields a point on the arc between \meta{start angle} and \meta{end
- angle} on an ellipse whose center is at \meta{center} and whose
- two principal axes are \meta{0-degree axis} and \meta{90-degree
- axis}. For $t=0$ the point at the \meta{start angle} is returned
- and for $t=1$ the point at the \meta{end angle}.
-
+\begin{command}{\pgfpointarcaxesattime\marg{time $t$}\marg{center}\marg{0-degree axis}\marg{90-degree axis}\marg{start angle}\\\marg{end angle}}
+ Yields a point on the arc between \meta{start angle} and \meta{end angle}
+ on an ellipse whose center is at \meta{center} and whose two principal axes
+ are \meta{0-degree axis} and \meta{90-degree axis}. For $t=0$ the point at
+ the \meta{start angle} is returned and for $t=1$ the point at the \meta{end
+ angle}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -374,14 +377,14 @@ on B\'ezier curves.
{\pgfpoint{2cm}{0cm}}{\pgfpoint{0cm}{1cm}}{0}{60}]{\t}}
\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$}}
- Yields a point that is on the B\'ezier 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$.
-
+\begin{command}{\pgfpointcurveattime\marg{time $t$}\marg{point $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$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -396,24 +399,26 @@ on B\'ezier curves.
{\pgfpoint{3cm}{2cm}}]{\t}}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
+
\subsubsection{Points on Borders of Objects}
-The following commands are useful for specifying a point that lies on
-the border of special shapes. They are used, for example, by the shape
-mechanism to determine border points of shapes.
+The following commands are useful for specifying a point that lies on the
+border of special shapes. They are used, for example, by the shape mechanism to
+determine border points of shapes.
\begin{command}{\pgfpointborderrectangle\marg{direction point}\marg{corner}}
- This command returns a point that lies on the intersection of a line
- starting at the origin and going towards the point \meta{direction
- point} and a rectangle whose center is in the origin and whose
- upper right corner is at \meta{corner}.
-
- The \meta{direction point} should have length ``about 1pt,'' but it
- will be normalized automatically. Nevertheless, the ``nearer'' the
- length is to 1pt, the less rounding errors.
-
+ This command returns a point that lies on the intersection of a line
+ starting at the origin and going towards the point \meta{direction point}
+ and a rectangle whose center is in the origin and whose upper right corner
+ is at \meta{corner}.
+
+ The \meta{direction point} should have length ``about 1pt'', but it will be
+ normalized automatically. Nevertheless, the ``nearer'' the length is to
+ 1pt, the less rounding errors.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (2,1.5);
@@ -431,14 +436,14 @@ mechanism to determine border points of shapes.
\pgfusepath{fill}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgfpointborderellipse\marg{direction point}\marg{corner}}
- This command works like the corresponding command for rectangles,
- only this time the \meta{corner} is the corner of the bounding
- rectangle of an ellipse.
-
+ This command works like the corresponding command for rectangles, only this
+ time the \meta{corner} is the corner of the bounding rectangle of an
+ ellipse.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (2,1.5);
@@ -456,17 +461,17 @@ mechanism to determine border points of shapes.
\pgfusepath{fill}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\subsubsection{Points on the Intersection of Lines}
-
\begin{command}{\pgfpointintersectionoflines\marg{$p$}\marg{$q$}\marg{$s$}\marg{$t$}}
- This command returns the intersection of a line going through $p$
- and $q$ and a line going through $s$ and $t$. If the lines do not
- intersection, an arithmetic overflow will occur.
-
+ This command returns the intersection of a line going through $p$ and $q$
+ and a line going through $s$ and $t$. If the lines do not intersection, an
+ arithmetic overflow will occur.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (2,2);
@@ -480,18 +485,17 @@ mechanism to determine border points of shapes.
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\subsubsection{Points on the Intersection of Two Circles}
-
\begin{command}{\pgfpointintersectionofcircles\marg{$p_1$}\marg{$p_2$}\marg{$r_1$}\marg{$r_2$}\marg{solution}}
- This command returns the intersection of the two circles centered at
- $p_1$ and $p_2$ with radii $r_1$ and $r_2$. If \meta{solution} is
- |1|, the first intersection is returned, otherwise the second one is
- returned.
-
+ This command returns the intersection of the two circles centered at $p_1$
+ and $p_2$ with radii $r_1$ and $r_2$. If \meta{solution} is |1|, the first
+ intersection is returned, otherwise the second one is returned.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (2,2);
@@ -505,32 +509,31 @@ mechanism to determine border points of shapes.
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-\subsubsection{Points on the Intersection of Two Paths}
+\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 of
- lots of very small segments such as plots or decorated paths.
+ 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 of 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.
-
+ 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
@@ -553,91 +556,89 @@ mechanism to determine border points of shapes.
\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}
-
+ \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.
\begin{command}{\pgfextractx\marg{dimension}\marg{point}}
- Sets the \TeX-\meta{dimension} to the $x$-coordinate of the point.
-
+ Sets the \TeX-\meta{dimension} to the $x$-coordinate of the point.
+ %
\begin{codeexample}[code only]
\newdimen\mydim
\pgfextractx{\mydim}{\pgfpoint{2cm}{4pt}}
%% \mydim is now 2cm
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfextracty\marg{dimension}\marg{point}}
- Like |\pgfextractx|, except for the $y$-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.
+ 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.
+ %
+ 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.
-
-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. 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.
-
-Since commands like |\pgfpointnormalised| modify other variables
-besides |\pgf@x| and |\pgf@y| during the computation of the final values of
-|\pgf@x| and |\pgf@y|, it is a good idea to enclose a call of a
-command like |\pgfpoint| in a \TeX-scope and then make the changes of
-|\pgf@x| and |\pgf@y| global as in the following example:
+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.
+
+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. 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.
+
+Since commands like |\pgfpointnormalised| modify other variables besides
+|\pgf@x| and |\pgf@y| during the computation of the final values of |\pgf@x|
+and |\pgf@y|, it is a good idea to enclose a call of a command like |\pgfpoint|
+in a \TeX-scope and then make the changes of |\pgf@x| and |\pgf@y| global as in
+the following example:
+ %
\begin{codeexample}[code only]
...
{ % open scope
@@ -652,18 +653,19 @@ command like |\pgfpoint| in a \TeX-scope and then make the changes of
\makeatletter
Since this situation arises very often, the macro |\pgf@process| can
be used to perform the above code:
+ %
\begin{command}{\pgf@process\marg{code}}
- Executes the \meta{code} in a scope and then makes |\pgf@x| and
- |\pgf@y| global.
+ Executes the \meta{code} in a scope and then makes |\pgf@x| and |\pgf@y|
+ global.
\end{command}
-Note that this macro is used often internally. For this reason, it is
-not a good idea to keep anything important in the variables |\pgf@x|
-and |\pgf@y| since they will be overwritten and changed
-frequently. Instead, intermediate values can ge stored in the
-\TeX-dimensions |\pgf@xa|, |\pgf@xb|, |\pgf@xc| and their
-|y|-counterparts |\pgf@ya|, |\pgf@yb|, |pgf@yc|. For example, here is
-the code of the command |\pgfpointadd|:
+Note that this macro is used often internally. For this reason, it is not a
+good idea to keep anything important in the variables |\pgf@x| and |\pgf@y|
+since they will be overwritten and changed frequently. Instead, intermediate
+values can ge stored in the \TeX-dimensions |\pgf@xa|, |\pgf@xb|, |\pgf@xc| and
+their |y|-counterparts |\pgf@ya|, |\pgf@yb|, |pgf@yc|. For example, here is the
+code of the command |\pgfpointadd|:
+%
\begin{codeexample}[code only]
\def\pgfpointadd#1#2{%
\pgf@process{#1}%
@@ -675,7 +677,6 @@ the code of the command |\pgfpointadd|:
\end{codeexample}
-
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
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 c7f762bef6c..b07c3a51c4e 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
@@ -10,59 +10,61 @@
\section{Quick Commands}
-This section explains the ``quick'' commands of \pgfname. These
-commands are executed more quickly than the normal commands of
-\pgfname, but offer less functionality. You should use these commands
-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.
+This section explains the ``quick'' commands of \pgfname. These commands are
+executed more quickly than the normal commands of \pgfname, but offer less
+functionality. You should use these commands 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 Coordinate Commands}
\begin{command}{\pgfqpoint\marg{x}\marg{y}}
- This command does the same as |\pgfpoint|, but \meta{x} and \meta{y}
- must be simple dimensions like |1pt| or |1cm|. Things like |2ex| or
- |2cm+1pt| are not allowed.
+ This command does the same as |\pgfpoint|, but \meta{x} and \meta{y} must
+ be simple dimensions like |1pt| or |1cm|. Things like |2ex| or |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 allowed.
+ 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 allowed.
\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.
+ 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.
+ 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
-the quick path commands
+The difference between the quick and the normal path commands is that the quick
+path commands
+%
\begin{itemize}
-\item
- do not keep track of the bounding boxes,
-\item
- do not allow you to arc corners,
-\item
- do not apply coordinate transformations.
+ \item do not keep track of the bounding boxes,
+ \item do not allow you to arc corners,
+ \item do not apply coordinate transformations.
\end{itemize}
However, they do use the soft-path subsystem (see
-Section~\ref{section-soft-paths} for details), which allows you to mix
-quick and normal path commands arbitrarily.
+Section~\ref{section-soft-paths} for details), which allows you to mix quick
+and normal path commands arbitrarily.
All quick path construction commands start with |\pgfpathq|.
\begin{command}{\pgfpathqmoveto\marg{x dimension}\marg{y dimension}}
- Either starts a path or starts a new part of a path at the coordinate
- $(\meta{x dimension},\meta{y dimension})$. The coordinate is
- \emph{not} transformed by the current coordinate transformation
- matrix. However, any low-level transformations apply.
-
+ Either starts a path or starts a new part of a path at the coordinate
+ $(\meta{x dimension},\meta{y dimension})$. The coordinate is \emph{not}
+ transformed by the current coordinate transformation matrix. However, any
+ low-level transformations apply.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -73,17 +75,18 @@ All quick path construction commands start with |\pgfpathq|.
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfpathqlineto\marg{x dimension}\marg{y dimension}}
- The quick version of the line-to operation.
+ The quick version of the line-to operation.
\end{command}
\begin{command}{\pgfpathqcurveto\marg{$s^1_x$}\marg{$s^1_y$}\marg{$s^2_x$}\marg{$s^2_y$}\marg{$t_x$}\marg{$t_y$}}
- The quick version of the curve-to operation. The first support point
- is $(s^1_x,s^1_y)$, the second support point is $(s^2_x,s^2_y)$,
- and the target is $(t_x,t_y)$.
-
+ The quick version of the curve-to operation. The first support point is
+ $(s^1_x,s^1_y)$, the second support point is $(s^2_x,s^2_y)$, and the
+ target is $(t_x,t_y)$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -92,13 +95,13 @@ All quick path construction commands start with |\pgfpathq|.
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfpathqcircle\marg{radius}}
- Adds a radius around the origin of the given \meta{radius}. This
- command is orders of magnitude faster than
- |\pgfcircle{\pgfpointorigin}{|\meta{radius}|}|.
-
+ Adds a radius around the origin of the given \meta{radius}. This command is
+ orders of magnitude faster than |\pgfcircle{\pgfpointorigin}{|\meta{radius}|}|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (1,1);
@@ -107,83 +110,79 @@ All quick path construction commands start with |\pgfpathq|.
\pgfusepath{stroke,fill}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\subsection{Quick Path Usage Commands}
-The quick path usage commands perform similar tasks as |\pgfusepath|,
-but they
+The quick path usage commands perform similar tasks as |\pgfusepath|, but they
+%
\begin{itemize}
-\item
- do not add arrows,
-\item
- do not modify the path in any way, in particular,
-\item
- ends are not shortened,
-\item
- corners are not replaced by arcs.
+ \item do not add arrows,
+ \item do not modify the path in any way, in particular,
+ \item ends are not shortened,
+ \item corners are not replaced by arcs.
\end{itemize}
-Note that you \emph{have to} use the quick versions in the code of
-arrow tip definitions since, inside these definition, you obviously do
-not want arrows to be drawn.
+Note that you \emph{have to} use the quick versions in the code of arrow tip
+definitions since, inside these definition, you obviously do not want arrows to
+be drawn.
\begin{command}{\pgfusepathqstroke}
- Strokes the path without further ado. No arrows are drawn, no
- corners are arced.
-
+ Strokes the path without further ado. No arrows are drawn, no corners are
+ arced.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfpathqcircle{5pt}
\pgfusepathqstroke
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfusepathqfill}
- Fills the path without further ado.
+ Fills the path without further ado.
\end{command}
\begin{command}{\pgfusepathqfillstroke}
- Fills and then strokes the path without further ado.
+ Fills and then strokes the path without further ado.
\end{command}
\begin{command}{\pgfusepathqclip}
- Clips all subsequent drawings against the current path. The path is
- not processed.
+ Clips all subsequent drawings against the current path. The path is not
+ processed.
\end{command}
\subsection{Quick Text Box Commands}
\begin{command}{\pgfqbox\marg{box number}}
- This command inserts a \TeX\ box into a |{pgfpicture}| by
- ``escaping'' to \TeX, inserting the box number \meta{box number} at
- the origin, and then returning to the typesetting the picture.
+ This command inserts a \TeX\ box into a |{pgfpicture}| by ``escaping'' to
+ \TeX, inserting the box number \meta{box number} at the origin, and then
+ returning to the typesetting the picture.
\end{command}
\begin{command}{\pgfqboxsynced\marg{box number}}
- This command works similarly to the |\pgfqbox| command. However,
- before inserting the text in \meta{box number}, the current
- coordinate transformation matrix is applied to the current canvas
- transformation matrix (is it ``synced'' with this matrix, hence the
- name).
-
- Thus, this command basically has the same effect as if you first
- called |\pgflowlevelsynccm| followed by |\pgfqbox|. However, this
- command will use |\hskip| and |\raise| commands for the
- ``translational part'' of the coordinate transformation matrix,
- instead of adding the translational part to the current
- canvas transformation matrix directly. Both methods have the same
- effect (box \meta{box number} is translated to where it should be), but
- the method used by |\pgfqboxsynced| ensures that hyperlinks are
- placed correctly. Note that scaling and rotation will not (cannot,
- even) apply to hyperlinks.
+ This command works similarly to the |\pgfqbox| command. However, before
+ inserting the text in \meta{box number}, the current coordinate
+ transformation matrix is applied to the current canvas transformation
+ matrix (is it ``synced'' with this matrix, hence the name).
+
+ Thus, this command basically has the same effect as if you first called
+ |\pgflowlevelsynccm| followed by |\pgfqbox|. However, this command will use
+ |\hskip| and |\raise| commands for the ``translational part'' of the
+ coordinate transformation matrix, instead of adding the translational part
+ to the current canvas transformation matrix directly. Both methods have the
+ same effect (box \meta{box number} is translated to where it should be),
+ but the method used by |\pgfqboxsynced| ensures that hyperlinks are placed
+ correctly. Note that scaling and rotation will not (cannot, even) apply to
+ hyperlinks.
\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-scopes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex
index 9d8e999a863..618ff86c66a 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
@@ -9,296 +9,266 @@
\section[Hierarchical Structures: Package, Environments, Scopes, and Text]
-{Hierarchical Structures:\\
- Package, Environments, Scopes, and Text}
-
+ {Hierarchical Structures:\\
+ Package, Environments, Scopes, and Text}
\subsection{Overview}
-\pgfname\ uses two kinds of hierarchical structuring: First, the
-package itself is structured hierarchically, consisting of different
-packages that are built on top of each other. Second, \pgfname\ allows you
-to structure your graphics hierarchically using environments and scopes.
+\pgfname\ uses two kinds of hierarchical structuring: First, the package itself
+is structured hierarchically, consisting of different packages that are built
+on top of each other. Second, \pgfname\ allows you to structure your graphics
+hierarchically using environments and scopes.
-\subsubsection{The Hierarchical Structure of the Package}
-The \pgfname\ system consists of several layers:
+\subsubsection{The Hierarchical Structure of the Package}
+The \pgfname\ system consists of several layers:
+%
\begin{description}
-\item[System layer.]
- The lowest layer is called the \emph{system layer}, though it might
- also be called ``driver layer'' or perhaps ``backend layer.'' Its
- job is to provide an abstraction of the details of which driver
- is used to transform the |.dvi| file. The system layer is
- implemented by the package |pgfsys|, which will load appropriate
- driver files as needed.
-
- The system layer is documented in Part~\ref{part-system}.
-\item[Basic layer.]
- The basic layer is loaded by the package |pgfcore| and subsequent
- use of the command |\usepgfmodule| to load additional modules of the
- basic layer.
-
- The basic layer is documented in the present part.
-\item[Frontend layer.]
- The frontend layer is not loaded by a single package. Rather,
- different packages, like \tikzname\ or \textsc{pgfpict2e}, are
- different frontends to the basic layer.
-
- The \tikzname\ frontend is documented in Part~\ref{part-tikz}.
+ \item[System layer.]
+ The lowest layer is called the \emph{system layer}, though it might
+ also be called ``driver layer'' or perhaps ``backend layer''. Its job
+ is to provide an abstraction of the details of which driver is used to
+ transform the |.dvi| file. The system layer is implemented by the
+ package |pgfsys|, which will load appropriate driver files as needed.
+
+ The system layer is documented in Part~\ref{part-system}.
+ \item[Basic layer.]
+ The basic layer is loaded by the package |pgfcore| and subsequent use
+ of the command |\usepgfmodule| to load additional modules of the basic
+ layer.
+
+ The basic layer is documented in the present part.
+ \item[Frontend layer.]
+ The frontend layer is not loaded by a single package. Rather, different
+ packages, like \tikzname\ or \textsc{pgfpict2e}, are different
+ frontends to the basic layer.
+
+ The \tikzname\ frontend is documented in Part~\ref{part-tikz}.
\end{description}
-Each layer will automatically load the necessary files of the layers below
-it.
+Each layer will automatically load the necessary files of the layers below it.
-In addition to the packages of these layers, there are also some
-library packages. These packages provide additional definitions of
-things like new arrow tips or new plot handlers.
+In addition to the packages of these layers, there are also some library
+packages. These packages provide additional definitions of things like new
+arrow tips or new plot handlers.
The library packages are documented in Part~\ref{part-libraries}.
-
-
\subsubsection{The Hierarchical Structure of Graphics}
-Graphics in \pgfname\ are typically structured
-hierarchically. Hierarchical structuring can be used to identify
-groups of graphical elements that are to be treated ``in the same
-way.'' For example, you might group together a number of paths, all of
-which are to be drawn in red. Then, when you decide later on that you
-like them to be drawn in, say, blue, all you have to do is to change
-the color once.
+Graphics in \pgfname\ are typically structured hierarchically. Hierarchical
+structuring can be used to identify groups of graphical elements that are to be
+treated ``in the same way''. For example, you might group together a number of
+paths, all of which are to be drawn in red. Then, when you decide later on that
+you like them to be drawn in, say, blue, all you have to do is to change the
+color once.
The general mechanism underlying hierarchical structuring is known as
-\emph{scoping} in computer science. The idea is that all changes to
-the general ``state'' of the graphic that are done inside a scope are
-local to that scope. So, if you change the color inside a scope, this
-does not affect the color used outside the scope. Likewise, when you
-change the line width in a scope, the line width outside is not
-changed, and so on.
-
-There are different ways of starting and ending scopes of graphic
-parameters. Unfortunately, these scopes are sometimes ``in conflict''
-with each other and it is sometimes not immediately clear which scopes
-apply. In essence, the following scoping mechanisms are available:
-
+\emph{scoping} in computer science. The idea is that all changes to the general
+``state'' of the graphic that are done inside a scope are local to that scope.
+So, if you change the color inside a scope, this does not affect the color used
+outside the scope. Likewise, when you change the line width in a scope, the
+line width outside is not changed, and so on.
+
+There are different ways of starting and ending scopes of graphic parameters.
+Unfortunately, these scopes are sometimes ``in conflict'' with each other and
+it is sometimes not immediately clear which scopes apply. In essence, the
+following scoping mechanisms are available:
+%
\begin{enumerate}
-\item
- The ``outermost'' scope supported by \pgfname\ is the |{pgfpicture}|
- environment. All changes to the graphic state done inside a
- |{pgfpicture}| are local to that picture.
-
- In general, it is \emph{not} possible to set graphic parameters
- globally outside any |{pgfpicture}| environments. Thus, you can
- \emph{not} say |\pgfsetlinewidth{1pt}| at the beginning of your
- document to have a default line width of one point. Rather, you have
- to (re)set all graphic parameters inside each |{pgfpicture}|. (If
- this is too bothersome, try defining some macro that does the job
- for you.)
-\item
- Inside a |{pgfpicture}| you can use a |{pgfscope}| environment to
- keep changes of the graphic state local to that environment.
-
- The effect of commands that change the graphic state are local to
- the current |{pgfscope}|, but not always to the current \TeX\
- group. Thus, if you open a \TeX\ group (some text in curly braces)
- inside a |{pgfscope}|, and if you change, for example, the dash
- pattern, the effect of this changed dash pattern will persist till
- the end of the |{pgfscope}|.
-
- 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
- inside a \TeX\ group, the effect lasts only till the end of the
- current \TeX\ group.
-\item
- Some graphic parameters are not scoped by |{pgfscope}| but
- ``already'' by \TeX\ groups. For example, the effect of coordinate
- transformation commands is always local to the current \TeX\
- group.
-
- Since every |{pgfscope}| automatically creates a \TeX\ group, all
- graphic parameters that are local to the current \TeX\ group are
- also local to the current |{pgfscope}|.
-\item
- Some graphic parameters can only be scoped using \TeX\ groups, since
- in some situations it is not possible to introduce a
- |{pgfscope}|. For example, a path always has to be completely
- 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}|.
-\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 possible to use
- another |{pgfpicture}| environment inside the argument of
- |\pgftext|.
+ \item The ``outermost'' scope supported by \pgfname\ is the |{pgfpicture}|
+ environment. All changes to the graphic state done inside a
+ |{pgfpicture}| are local to that picture.
+
+ In general, it is \emph{not} possible to set graphic parameters
+ globally outside any |{pgfpicture}| environments. Thus, you can
+ \emph{not} say |\pgfsetlinewidth{1pt}| at the beginning of your
+ document to have a default line width of one point. Rather, you have to
+ (re)set all graphic parameters inside each |{pgfpicture}|. (If this is
+ too bothersome, try defining some macro that does the job for you.)
+ \item Inside a |{pgfpicture}| you can use a |{pgfscope}| environment to
+ keep changes of the graphic state local to that environment.
+
+ The effect of commands that change the graphic state are local to the
+ current |{pgfscope}|, but not always to the current \TeX\ group. Thus,
+ if you open a \TeX\ group (some text in curly braces) inside a
+ |{pgfscope}|, and if you change, for example, the dash pattern, the
+ effect of this changed dash pattern will persist till the end of the
+ |{pgfscope}|.
+
+ 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 inside a
+ \TeX\ group, the effect lasts only till the end of the current \TeX\
+ group.
+ \item Some graphic parameters are not scoped by |{pgfscope}| but
+ ``already'' by \TeX\ groups. For example, the effect of coordinate
+ transformation commands is always local to the current \TeX\ group.
+
+ Since every |{pgfscope}| automatically creates a \TeX\ group, all
+ graphic parameters that are local to the current \TeX\ group are also
+ local to the current |{pgfscope}|.
+ \item Some graphic parameters can only be scoped using \TeX\ groups, since
+ in some situations it is not possible to introduce a |{pgfscope}|. For
+ example, a path always has to be completely 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}|.
+ \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 possible to use another
+ |{pgfpicture}| environment inside the argument of |\pgftext|.
\end{enumerate}
-
Most of the complications can be avoided if you stick to the following
rules:
-
+%
\begin{itemize}
-\item
- Give graphic commands only inside |{pgfpicture}| environments.
-\item
- Use |{pgfscope}| to structure graphics.
-\item
- Do not use \TeX\ groups inside graphics, \emph{except} for keeping
- the effect of coordinate transformations local.
+ \item Give graphic commands only inside |{pgfpicture}| environments.
+ \item Use |{pgfscope}| to structure graphics.
+ \item Do not use \TeX\ groups inside graphics, \emph{except} for keeping
+ the effect of coordinate transformations local.
\end{itemize}
-
-
\subsection{The Hierarchical Structure of the Package}
-Before we come to the structuring commands provided by \pgfname\ to
-structure your graphics, let us first have a look at the structure of
-the package itself.
+Before we come to the structuring commands provided by \pgfname\ to structure
+your graphics, let us first have a look at the structure of the package itself.
+
\subsubsection{The Core Package}
To use \pgfname, include the following package:
\begin{package}{pgfcore}
- This package loads the complete core of the ``basic layer'' of
- \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
- explained below.
+ This package loads the complete core of the ``basic layer'' of \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 explained below.
\end{package}
The following package is just a convenience.
\begin{package}{pgf}
- This package loads the |pgfcore| and the two modules |shapes| and
- |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}
+ This package loads the |pgfcore| and the two modules |shapes| and |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}
\end{package}
-
\subsubsection{The Modules}
-\begin{command}{\usepgflibrary\marg{module names}}
- Once the core has been loaded, you can use this command to load
- further modules. The modules in the \meta{module names} list should
- 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.
-
- \example |\usepgfmodule{matrix,shapes}|
-
- What this command does is to load the file
- |pgfmodule|\meta{module}|.code.tex| for each \meta{module} in
- the list of \meta{module names}. Thus, to write your own module,
- all you need to do is to place a file of the appropriate name
- somewhere \TeX\ can find it. \LaTeX, plain \TeX, and Con\TeX t
- users can then use your library.
-\end{command}
+\begin{command}{\usepgfmodule\marg{module names}}
+ Once the core has been loaded, you can use this command to load further
+ modules. The modules in the \meta{module names} list should 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.
-The following modules are available for use with |pgfcore|:
+ \example |\usepgfmodule{matrix,shapes}|
+ What this command does is to load the file
+ |pgfmodule|\meta{module}|.code.tex| for each \meta{module} in the list of
+ \meta{module names}. Thus, to write your own module, all you need to do is
+ to place a file of the appropriate name somewhere \TeX\ can find it.
+ \LaTeX, plain \TeX, and Con\TeX t users can then use your library.
+\end{command}
+
+The following modules are available for use with |pgfcore|: \todosp{In the
+meantime there are some more modules. Also mention them here?}
+%
\begin{itemize}
-\item The |plot| module provides commands for plotting functions. The
- 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}.
-\item The |decorations| module provides commands for adding
- decorations to paths. These commands are explained in
- Section~\ref{section-base-decorations}.
-\item The |matrix| module provides the |\pgfmatrix| command. The
- commands are documented in Section~\ref{section-base-matrices}.
+ \item The |plot| module provides commands for plotting functions. The
+ 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}.
+ \item The |decorations| module provides commands for adding decorations to
+ paths. These commands are explained in
+ Section~\ref{section-base-decorations}.
+ \item The |matrix| module provides the |\pgfmatrix| command. The commands
+ are documented in Section~\ref{section-base-matrices}.
\end{itemize}
-
\subsubsection{The Library Packages}
-There is a special command for loading library packages. The
-difference between a library and module is the following: A library
-just defines additional objects using the basic layer, whereas a
-module adds completely new functionality. For instance, a decoration
-library defines additional decorations, while a decoration module
-defines the whole code for handling decorations.
+There is a special command for loading library packages. The difference between
+a library and module is the following: A library just defines additional
+objects using the basic layer, whereas a module adds completely new
+functionality. For instance, a decoration library defines additional
+decorations, while a decoration module defines the whole code for handling
+decorations.
\begin{command}{\usepgflibrary\marg{list of libraries}}
- 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.
-
- \example |\usepgflibrary{arrows}|
-
- 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
- users can then use your library.
-
- You should also consider adding a \tikzname\ library that simply
- includes your \pgfname\ library.
-\end{command}
+ 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.
+
+ \example |\usepgflibrary{arrows}|
+ 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 users can then use your library.
+
+ You should also consider adding a \tikzname\ library that simply includes
+ your \pgfname\ library.
+\end{command}
\subsection{The Hierarchical Structure of the Graphics}
\subsubsection{The Main Environment}
-
-Most, but not all, commands of the \pgfname\ package must be given
-within a |{pgfpicture}| environment. The only commands that (must) be
-given outside are commands having to do with including images (like
-|\pgfuseimage|) and with inserting complete shadings (like
-|\pgfuseshading|). However, just to keep life entertaining, the
-|\pgfshadepath| command must be given \emph{inside} a |{pgfpicture}|
-environment.
+Most, but not all, commands of the \pgfname\ package must be given within a
+|{pgfpicture}| environment. The only commands that (must) be given outside are
+commands having to do with including images (like |\pgfuseimage|) and with
+inserting complete shadings (like |\pgfuseshading|). However, just to keep life
+entertaining, the |\pgfshadepath| command must be given \emph{inside} a
+|{pgfpicture}| environment.
\begin{environment}{{pgfpicture}}
- This environment will insert a \TeX\ box containing the graphic drawn by
- the \meta{environment contents} at the current position.
-
- \medskip
- \textbf{The size of the bounding box.}
- The size of the box is determined in the following
- manner: While \pgfname\ parses the \meta{environment contents}, it
- keeps track of a bounding box for the graphic. Essentially, this
- bounding box is the smallest box that contains all coordinates
- mentioned in the graphics. Some coordinates may be ``mentioned'' by
- \pgfname\ itself; for example, when you add circle to the current
- path, the support points of the curve making up the circle are also
- ``mentioned'' despite the fact that you will not ``see'' them in
- your code.
-
- Once the \meta{environment contents} have been parsed completely, a
- \TeX\ box is created whose size is the size of the computed bounding
- box and this box is inserted at the current position.
-
+ This environment will insert a \TeX\ box containing the graphic drawn by
+ the \meta{environment contents} at the current position.
+
+
+ \medskip
+ \textbf{The size of the bounding box.}
+ The size of the box is determined in the following manner: While \pgfname\
+ parses the \meta{environment contents}, it keeps track of a bounding box
+ for the graphic. Essentially, this bounding box is the smallest box that
+ contains all coordinates mentioned in the graphics. Some coordinates may be
+ ``mentioned'' by \pgfname\ itself; for example, when you add circle to the
+ current path, the support points of the curve making up the circle are also
+ ``mentioned'' despite the fact that you will not ``see'' them in your code.
+
+ Once the \meta{environment contents} have been parsed completely, a \TeX\
+ box is created whose size is the size of the computed bounding box and this
+ box is inserted at the current position.
+ %
\begin{codeexample}[]
Hello \begin{pgfpicture}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2ex}{1ex}}
@@ -306,22 +276,21 @@ Hello \begin{pgfpicture}
\end{pgfpicture} World!
\end{codeexample}
- Sometimes, you may need more fine-grained control over the size of
- the bounding box. For example, the computed bounding box may be too
- large or you intensionally wish the box to be ``too small.'' In
- these cases, you can use the command
- |\pgfusepath{use as bounding box}|, as described in
- Section~\ref{section-using-bb}.
-
-
- \medskip
- \textbf{The baseline of the bounding box.}
- When the box containing the graphic is inserted into the normal
- text, the baseline of the graphic is normally at the bottom of the
- 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:
-
+ Sometimes, you may need more fine-grained control over the size of the
+ bounding box. For example, the computed bounding box may be too large or
+ you intensionally wish the box to be ``too small''. In these cases, you can
+ use the command |\pgfusepath{use as bounding box}|, as described in
+ Section~\ref{section-using-bb}.
+
+
+ \medskip
+ \textbf{The baseline of the bounding box.}
+ When the box containing the graphic is inserted into the normal text, the
+ baseline of the graphic is normally at the bottom of the 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,9 +301,8 @@ Rectangles \begin{pgfpicture}
\end{pgfpicture}.
\end{codeexample}
- You can change the baseline using the |\pgfsetbaseline| command, see
- below.
-
+ You can change the baseline using the |\pgfsetbaseline| command, see below.
+ %
\begin{codeexample}[]
Rectangles \begin{pgfpicture}
\pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2ex}{1ex}}
@@ -347,79 +315,77 @@ Rectangles \begin{pgfpicture}
\end{pgfpicture}.
\end{codeexample}
- \medskip
- \textbf{Including text and images in a picture.}
- You cannot directly include text and images in a picture. Thus, you
- should \emph{not} simply write some text in a |{pgfpicture}| or use
- a command like |\includegraphics| or even |\pgfimage|. In all these
- cases, you need to place the text inside a |\pgftext| command. This
- will ``escape back'' to normal \TeX\ mode, see
- Section~\ref{section-text-command} for details.
-
- \medskip
- \textbf{Remembering a picture position for later reference.}
- 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
- different pictures automatically.
-
- In order to make \pgfname\ ``remember'' a picture, the \TeX-if
- |\||ifpgfrememberpicturepositiononpage| should be set to |true|. It
- is only important that this \TeX-if is |true| at the end of the
- |{pgfpicture}|-en\-vi\-ron\-ment, so you can switch it on inside the
- environment. However, you can also just switch it on globally, then
- the positions of all pictures are remembered.
-
- There are several reasons why the remembering is not switched on by
- default. First, it does not work for all backend drivers (currently, it
- works only for pdf\TeX). Second, it requires two passes of \TeX\
- over the file; on the first pass all positions will be wrong. Third,
- for every remembered picture a line is added to the |.aux|-file,
- which may result in a large number of extra lines.
-
- Despite all these ``problems,'' for documents that are processed
- with pdf\TeX\ and in which there is only a small number of pictures
- (less than a hundred or so), you can switch on this option globally,
- it will not cause any significant slowing of \TeX.
+
+ \medskip
+ \textbf{Including text and images in a picture.}
+ You cannot directly include text and images in a picture. Thus, you should
+ \emph{not} simply write some text in a |{pgfpicture}| or use a command like
+ |\includegraphics| or even |\pgfimage|. In all these cases, you need to
+ place the text inside a |\pgftext| command. This will ``escape back'' to
+ normal \TeX\ mode, see Section~\ref{section-text-command} for details.
+
+
+ \medskip
+ \textbf{Remembering a picture position for later reference.}
+ 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 different pictures automatically.
+
+ In order to make \pgfname\ ``remember'' a picture, the \TeX-if
+ |\||ifpgfrememberpicturepositiononpage| should be set to |true|. It is only
+ important that this \TeX-if is |true| at the end of the
+ |{pgfpicture}|-en\-vi\-ron\-ment, so you can switch it on inside the
+ environment. However, you can also just switch it on globally, then the
+ positions of all pictures are remembered.
+
+ There are several reasons why the remembering is not switched on by
+ default. First, it does not work for all backend drivers (currently, it
+ works only for pdf\TeX). Second, it requires two passes of \TeX\ over the
+ file; on the first pass all positions will be wrong. Third, for every
+ remembered picture a line is added to the |.aux|-file, which may result in
+ a large number of extra lines.
+
+ Despite all these ``problems'', for documents that are processed with
+ pdf\TeX\ and in which there is only a small number of pictures (less than a
+ hundred or so), you can switch on this option globally, it will not cause
+ any significant slowing of \TeX.
\end{environment}
\begin{plainenvironment}{{pgfpicture}}
- The plain \TeX\ version of the environment. Note that in this
- version, also, a \TeX\ group is created around the environment.
+ The plain \TeX\ version of the environment. Note that in this version,
+ also, a \TeX\ group is created around the environment.
\end{plainenvironment}
\begin{contextenvironment}{{pgfpicture}}
- This is the Con\TeX t version of the environment.
+ This is the Con\TeX t version of the environment.
\end{contextenvironment}
-
{\let\ifpgfrememberpicturepositiononpage=\relax
\begin{command}{\ifpgfrememberpicturepositiononpage}
- Determines whether the position of pictures on the page should be
- recorded. The value of this \TeX-if at the end of a |{pgfpicture}|
- environment is important, not the value at the beginning.
-
- If this option is set to true of a picture, \pgfname\ will attempt
- to record the position of the picture on the page. (This attempt
- will fail with most drivers and when it works, it typically requires
- 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.
+ Determines whether the position of pictures on the page should be recorded.
+ The value of this \TeX-if at the end of a |{pgfpicture}| environment is
+ important, not the value at the beginning.
+
+ If this option is set to true of a picture, \pgfname\ will attempt to
+ record the position of the picture on the page. (This attempt will fail
+ with most drivers and when it works, it typically requires 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.
\end{command}
}
-
\makeatletter
\begin{command}{\pgfsetbaseline\marg{dimension}}
- This command specifies a $y$-coordinate of the picture that should
- be used as the baseline of the whole picture. When a \pgfname\
- picture has been typeset completely, \pgfname\ must decide at which
- height the baseline of the picture should lie. Normally, the
- baseline is set to the $y$-coordinate of the bottom of the picture,
- but it is often desirable to use a different height.
-
+ This command specifies a $y$-coordinate of the picture that should be used
+ as the baseline of the whole picture. When a \pgfname\ picture has been
+ typeset completely, \pgfname\ must decide at which height the baseline of
+ the picture should lie. Normally, the baseline is set to the $y$-coordinate
+ of the bottom of the picture, but it is often desirable to use a different
+ height.
+ %
\begin{codeexample}[]
Text
\begin{pgfpicture}
@@ -438,19 +404,18 @@ Text
\pgfpathcircle{\pgfpointorigin}{1ex}\pgfusepath{stroke}
\end{pgfpicture}.
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfsetbaselinepointnow\marg{point}}
- This command specifies the baseline indirectly, namely as the
- $y$-coordinate that the given \meta{point} has when the command is
- called.
+ This command specifies the baseline indirectly, namely as the
+ $y$-coordinate that the given \meta{point} has when the command is called.
\end{command}
\begin{command}{\pgfsetbaselinepointlater\marg{point}}
- This command also specifies the baseline indirectly, but the
- $y$-coordinate of the given \meta{point} is only computed at the end
- of the picture.
-
+ This command also specifies the baseline indirectly, but the $y$-coordinate
+ of the given \meta{point} is only computed at the end of the picture.
+ %
\begin{codeexample}[]
Hello
\begin{pgfpicture}
@@ -459,42 +424,37 @@ Hello
\pgfnode{cross out}{center}{world.}{X}{\pgfusepath{stroke}}
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
-
\subsubsection{Graphic Scope Environments}
-Inside a |{pgfpicture}| environment you can substructure your picture
-using the following environment:
+Inside a |{pgfpicture}| environment you can substructure your picture using the
+following environment:
\begin{environment}{{pgfscope}}
- All changes to the graphic state done inside this environment are
- local to the environment. The graphic state includes the following:
- \begin{itemize}
- \item
- The line width.
- \item
- The stroke and fill colors.
- \item
- The dash pattern.
- \item
- The line join and cap.
- \item
- The miter limit.
- \item
- The canvas transformation matrix.
- \item
- The clipping path.
- \end{itemize}
- Other parameters may also influence how graphics are rendered, but they
- are \emph{not} part of the graphic state. For example, the arrow tip
- kind is not part of the graphic state and the effect of commands
- setting the arrow tip kind are local to the current \TeX\ group, not
- to the current |{pgfscope}|. However, since |{pgfscope}| starts and
- ends a \TeX\ group automatically, a |{pgfscope}| can be used to
- limit the effect of, say, commands that set the arrow tip kind.
-
+ All changes to the graphic state done inside this environment are
+ local to the environment. The graphic state includes the following:
+ %
+ \begin{itemize}
+ \item The line width.
+ \item The stroke and fill colors.
+ \item The dash pattern.
+ \item The line join and cap.
+ \item The miter limit.
+ \item The canvas transformation matrix.
+ \item The clipping path.
+ \end{itemize}
+ %
+ Other parameters may also influence how graphics are rendered, but they are
+ \emph{not} part of the graphic state. For example, the arrow tip kind is
+ not part of the graphic state and the effect of commands setting the arrow
+ tip kind are local to the current \TeX\ group, not to the current
+ |{pgfscope}|. However, since |{pgfscope}| starts and ends a \TeX\ group
+ automatically, a |{pgfscope}| can be used to limit the effect of, say,
+ commands that set the arrow tip kind.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\begin{pgfscope}
@@ -527,63 +487,59 @@ using the following environment:
\end{pgfpicture}
\end{codeexample}
- At the start of the scope, the current path must be empty, that is,
- you cannot open a scope while constructing a path.
+ At the start of the scope, the current path must be empty, that is, you
+ cannot open a scope while constructing a path.
- It is usually a good idea \emph{not} to introduce \TeX\ groups
- inside a |{pgfscope}| environment.
+ It is usually a good idea \emph{not} to introduce \TeX\ groups inside a
+ |{pgfscope}| environment.
\end{environment}
\begin{plainenvironment}{{pgfscope}}
- Plain \TeX\ version of the |{pgfscope}| environment.
+ Plain \TeX\ version of the |{pgfscope}| environment.
\end{plainenvironment}
\begin{contextenvironment}{{pgfscope}}
- This is the Con\TeX t version of the environment.
+ This is the Con\TeX t version of the environment.
\end{contextenvironment}
-
-The following scopes also encapsulate certain properties of the
-graphic state. However, they are typically not used directly by the
-user.
+The following scopes also encapsulate certain properties of the graphic state.
+However, they are typically not used directly by the user.
\begin{environment}{{pgfinterruptpath}}
- This environment can be used to temporarily interrupt the
- construction of the current path. The effect will be that the path
- currently under construction will be ``stored away'' and restored at
- the end of the environment. Inside the environment you can construct
- a new path and do something with it.
-
- An example application of this environment is the arrow tip
- caching. Suppose you ask \pgfname\ to use a specific arrow tip
- kind. When the arrow tip needs to be rendered for the first time,
- \pgfname\ will ``cache'' the path that makes up the arrow tip. To do
- so, it interrupts the current path construction and then protocols
- the path of the arrow tip. The |{pgfinterruptpath}| environment is
- used to ensure that this does not interfere with the path to which
- the arrow tips should be attached.
-
- This command does \emph{not} install a |{pgfscope}|. In particular,
- it does not call any |\pgfsys@| commands at all, which would,
- indeed, be dangerous in the middle of a path construction.
+ This environment can be used to temporarily interrupt the construction of
+ the current path. The effect will be that the path currently under
+ construction will be ``stored away'' and restored at the end of the
+ environment. Inside the environment you can construct a new path and do
+ something with it.
+
+ An example application of this environment is the arrow tip caching.
+ Suppose you ask \pgfname\ to use a specific arrow tip kind. When the arrow
+ tip needs to be rendered for the first time, \pgfname\ will ``cache'' the
+ path that makes up the arrow tip. To do so, it interrupts the current path
+ construction and then protocols the path of the arrow tip. The
+ |{pgfinterruptpath}| environment is used to ensure that this does not
+ interfere with the path to which the arrow tips should be attached.
+
+ This command does \emph{not} install a |{pgfscope}|. In particular, it does
+ not call any |\pgfsys@| commands at all, which would, indeed, be dangerous
+ in the middle of a path construction.
\end{environment}
\begin{plainenvironment}{{pgfinterruptpath}}
- Plain \TeX\ version of the environment.
+ Plain \TeX\ version of the environment.
\end{plainenvironment}
\begin{contextenvironment}{{pgfinterruptpath}}
- Con\TeX t version of the environment.
+ Con\TeX t version of the environment.
\end{contextenvironment}
-
\begin{environment}{{pgfinterruptpicture}}
- This environment can be used to temporarily interrupt a
- |{pgfpicture}|. However, the environment is intended only to be used
- at the beginning and end of a box that is (later) inserted into a
- |{pgfpicture}| using |\pgfqbox|. You cannot use this environment
- directly inside a |{pgfpicture}|.
-
+ This environment can be used to temporarily interrupt a |{pgfpicture}|.
+ However, the environment is intended only to be used at the beginning and
+ end of a box that is (later) inserted into a |{pgfpicture}| using
+ |\pgfqbox|. You cannot use this environment directly inside a
+ |{pgfpicture}|.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfpathmoveto{\pgfpoint{0cm}{0cm}} % In the middle of path, now
@@ -602,166 +558,470 @@ user.
\pgfusepath{stroke}
\end{pgfpicture}\hskip3.9cm
\end{codeexample}
+ %
\end{environment}
\begin{plainenvironment}{{pgfinterruptpicture}}
- Plain \TeX\ version of the environment.
+ Plain \TeX\ version of the environment.
\end{plainenvironment}
\begin{contextenvironment}{{pgfinterruptpicture}}
- Con\TeX t version of the environment.
+ Con\TeX t version of the environment.
\end{contextenvironment}
-
-
\begin{environment}{{pgfinterruptboundingbox}}
- 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 original bounding box is
- reinstalled as if nothing has happened.
+ 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 original bounding box is reinstalled as if nothing has
+ happened.
\end{environment}
\begin{plainenvironment}{{pgfinterruptboundingbox}}
- Plain \TeX\ version of the environment.
+ Plain \TeX\ version of the environment.
\end{plainenvironment}
\begin{contextenvironment}{{pgfinterruptboundingbox}}
- Con\TeX t version of the environment.
+ Con\TeX t version of the environment.
\end{contextenvironment}
\subsubsection{Inserting Text and Images}
-
\label{section-text-command}
-Often, you may wish to add normal \TeX\ text at a certain point inside
-a |{pgfpicture}|. You cannot do so ``directly,'' that is, you cannot
-simply write this text inside the |{pgfpicture}| environment. Rather,
-you must pass the text as an argument to the |\pgftext| command.
+Often, you may wish to add normal \TeX\ text at a certain point inside a
+|{pgfpicture}|. You cannot do so ``directly'', that is, you cannot simply write
+this text inside the |{pgfpicture}| environment. Rather, you must pass the text
+as an argument to the |\pgftext| command.
-You must \emph{also} use the |\pgftext| command to insert an image or
-a shading into a |{pgfpicture}|.
+You must \emph{also} use the |\pgftext| command to insert an image or a shading
+into a |{pgfpicture}|.
\begin{command}{\pgftext\opt{\oarg{options}}\marg{text}}
- This command will typeset \meta{text} in normal \TeX\ mode and
- insert the resulting box into the |{pgfpicture}|. The bounding box
- of the graphic will be updated so that all of the text box is
- inside. By default, the text box is centered at the origin, but this
- can be changed either by giving appropriate \meta{options} or by
- applying an appropriate coordinate transformation beforehand.
-
- The \meta{text} may contain verbatim text. (In other words, the
- \meta{text} ``argument'' is not a normal argument, but is put in a
- box and some |\aftergroup| hackery is used to find the end of the
- box.)
-
- \pgfname's current (high-level) coordinate transformation is
- synchronized with the canvas transformation matrix temporarily
- when the text box is inserted. The effect is that if there is
- currently a high-level rotation of, say, 30 degrees, the \meta{text}
- will also be rotated by thirty degrees. If you do not want this
- effect, you have to (possibly temporarily) reset the high-level
- transformation matrix.
-
- The \meta{options} keys are used with the path |/pgf/text/|. The
- 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.
+ This command will typeset \meta{text} in normal \TeX\ mode and insert the
+ resulting box into the |{pgfpicture}|. The bounding box of the graphic will
+ be updated so that all of the text box is inside. By default, the text box
+ is centered at the origin, but this can be changed either by giving
+ appropriate \meta{options} or by applying an appropriate coordinate
+ transformation beforehand.
+
+ The \meta{text} may contain verbatim text. (In other words, the \meta{text}
+ ``argument'' is not a normal argument, but is put in a box and some
+ |\aftergroup| hackery is used to find the end of the box.)
+
+ \pgfname's current (high-level) coordinate transformation is synchronized
+ with the canvas transformation matrix temporarily when the text box is
+ inserted. The effect is that if there is currently a high-level rotation
+ of, say, 30 degrees, the \meta{text} will also be rotated by thirty
+ degrees. If you do not want this effect, you have to (possibly temporarily)
+ reset the high-level transformation matrix.
+
+ The \meta{options} keys are used with the path |/pgf/text/|. The 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.
+ %
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[left] {lovely}}
\end{codeexample}
- \end{key}
- \begin{key}{/pgf/text/right}
- The key causes the text box to be placed such that its right
- border is on the origin.
+ \end{key}
+ %
+ \begin{key}{/pgf/text/right}
+ 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}}
\end{codeexample}
- \end{key}
- \begin{key}{/pgf/text/right}
- This key causes the text box to be placed such that its top is on the
- origin. This option can be used together with the |left| or
- |right| option.
+ \end{key}
+ %
+ \begin{key}{/pgf/text/top}
+ This key causes the text box to be placed such that its top is on the
+ origin. This option can be used together with the |left| or |right|
+ option.
+ %
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[top] {lovely}}
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[top,right] {lovely}}
\end{codeexample}
- \end{key}
- \begin{key}{/pgf/text/bottom}
- This key causes the text box to be placed such that its bottom is
- on the origin.
+ \end{key}
+ %
+ \begin{key}{/pgf/text/bottom}
+ This key causes the text box to be placed such that its bottom is on
+ the origin.
+ %
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[bottom] {lovely}}
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[bottom,right] {lovely}}
\end{codeexample}
- \end{key}
- \begin{key}{/pgf/text/base}
- This key causes the text box to be placed such that its baseline
- is on the origin.
+ \end{key}
+ %
+ \begin{key}{/pgf/text/base}
+ This key causes the text box to be placed such that its baseline is on
+ the origin.
+ %
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base] {lovely}}
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base,right] {lovely}}
\end{codeexample}
- \end{key}
- \begin{key}{/pgf/text/at=\meta{point}}
- Translates the origin (that is, the point where the text is
- shown) to \meta{point}.
+ \end{key}
+ %
+ \begin{key}{/pgf/text/at=\meta{point}}
+ Translates the origin (that is, the point where the text is shown) to
+ \meta{point}.
+ %
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base,at={\pgfpoint{1cm}{0cm}}] {lovely}}
\end{codeexample}
- \end{key}
- \begin{key}{/pgf/text/x=\meta{dimension}}
- Translates the origin by \meta{dimension} along the $x$-axis.
+ \end{key}
+ %
+ \begin{key}{/pgf/text/x=\meta{dimension}}
+ Translates the origin by \meta{dimension} along the $x$-axis.
+ %
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base,x=1cm,y=-0.5cm] {lovely}}
\end{codeexample}
- \end{key}
- \begin{key}{/pgf/text/y=\meta{dimension}}
- This key works like the |x| option.
- \end{key}
- \begin{key}{/pgf/text/rotate=\meta{degree}}
- Rotates the coordinate system by \meta{degree}. This will also
- rotate the text box.
+ \end{key}
+ %
+ \begin{key}{/pgf/text/y=\meta{dimension}}
+ This key works like the |x| option.
+ \end{key}
+ %
+ \begin{key}{/pgf/text/rotate=\meta{degree}}
+ Rotates the coordinate system by \meta{degree}. This will also rotate
+ the text box.
+ %
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base,x=1cm,y=-0.5cm,rotate=30] {lovely}}
\end{codeexample}
-\end{key}
+ \end{key}
+\end{command}
+
+
+\subsection{Object Identifiers}
+
+Graphical objects can have an \emph{identifier,} which allows you to reference
+the object later on. For instance, you could reference the object as the target
+of a hyperlink (although this capability is not necessarily implemented by
+drivers) or as the target of an animation; indeed, animations always need an
+object identifier to identify the to-be-animated object.
+
+Attaching an identifier to an object is a two-step process:
+%
+\begin{enumerate}
+ \item You call |\pgfuseid{|\meta{id}|}| to choose an id, which is a normal
+ string.
+ \item Next, you call one of several commands like |\pgfidscope| or
+ |\pgftext|, which create an object. This object will have then have the
+ id.
+\end{enumerate}
+
+
+\subsubsection{Commands for Creating Graphic Objects}
+
+The following system level commands create an object with an id:
+%
+\begin{enumerate}
+ \item |\pgfsys@begin@idscope|, which creates a graphic scope.
+ \item |\pgfsys@viewboxmeet| or |\pgfsys@viewboxslice|, which create view
+ boxes,
+ \item |\pgfsys@fill|, |\pgfsys@stroke|, and all other path usage command,
+ \item |\pgfsys@hbox| or |\pgfsys@hboxsynced|, which create text boxes, and
+ \item |\pgfsys@animate...|, which create animations.
+\end{enumerate}
+
+These system layer commands are, in turn, called by the following basic layer
+commands (and, also, by the commands that call them, in turn):
+%
+\begin{itemize}
+ \item |\pgfidscope|, which creates an id scope (see below).
+ \item |\pgfviewboxscope|, which creates a view box.
+ \item |\pgfusepath|, which creates a path.
+ \item |\pgftext| and |\pgfnode| and |\pgfmultipartnode|, which create text
+ boxes and nodes, and
+ \item |\pgfanimateattribute|, which creates an animation.
+\end{itemize}
+
+\begin{environment}{{pgfidscope}}
+ Creates a graphic scope that will have the id last used with |\pgfuseid|
+ attached to, provided such an id was set and was not already used with
+ another object. In the latter cases, no graphic scope is created. Thus, if
+ you wish to ensure that a graphic scope is created, you must (additionally)
+ call |\pgfscope| inside or outside the id scope.
+\end{environment}
+
+The Plain\TeX\ and Con\TeX t versions of the environment are:
+%
+\begin{plainenvironment}{{pgfidscope}}
+\end{plainenvironment}
+
+\begin{contextenvironment}{{pgfidscope}}
+\end{contextenvironment}
+
+
+\subsubsection{Settings and Querying Identifiers}
+
+In order to attach an identifier to an object, you first use the following
+command:
+
+\begin{command}{\pgfuseid\marg{name}}
+ The \meta{name} is a string by which the object will be referenced (see
+ |\pgfidrefnextuse|). The next time a graphic object is created in the
+ current \TeX\ scope, the name will be attached to it (actually, it will get
+ a system layer identifier attached to it that is automatically created
+ using |\pgfsys@new@id|, the \meta{name} is bound to that identifier and it
+ can be retrieved using |\pgfidrefnextuse|). This holds true only for the
+ next object: If a second object is created, it will not get the name
+ attached to it. This does not mean, however, that you cannot attach the
+ same name to different objects; you just need to call |\pgfuseid| again
+ before each object.
+
+ Besides the \meta{name} (or, more precisely, besides the system layer
+ identifier is refers to), the current \emph{identifier type} is also
+ important: Actually, a graphic object is not referenced by a system layer
+ identifier, but by the combination of the identifier and a type. You can
+ use the following commands for modifying the type used for the creation of
+ objects:
+
+ \begin{command}{\pgfusetype\marg{type}}
+ Sets the type used for the referencing of graphic objects for the
+ current scope to \meta{type} or, if \meta{type} starts with a dot,
+ appends \meta{type} to the current type.
+
+ You use this command with compound graphic objects: Before each part of
+ a graphic object, set the type to an appropriate value. Now, if the
+ object is named using |\pgfuseid|, you can later on access all parts of
+ the compound object using the combination of the \meta{name} used with
+ |\pgfuseid| and the type of the part.
+
+ As an example, this system is used to give you access to the different
+ parts of a node: When use say |\pgfuseid{mynode}| and then create a
+ node, you can use |mynode| with the empty type to reference the
+ graphics scope that encompasses the whole node, but also |mynode|
+ together with the type |background| to access the background path of
+ the node.
+
+ In detail, \pgfname\ uses this command to set the following types:
+ %
+ \begin{itemize}
+ \item Inside the command |\pgfviewboxscope|, the type |.view| is
+ used for the view object.
+ \item Inside the command |\pgfmultipartnode|, the type
+ |.behind background| is used for the scope of drawings behind
+ the background. Similarly, |.before background| and
+ |.behind foreground| and finally |.before foreground| are used
+ with the respective parts of a node.
+ \item Also inside a node, |.background| and |.foreground| are used
+ as types of the background and foreground paths, respectively.
+ \item Finally, inside a node, for each text part, the text part's
+ name is used as a type (so |.text| is used for the main part).
+ \end{itemize}
+
+ In addition, \tikzname\ uses this command in the following
+ situations:
+ %
+ \begin{itemize}
+ \item The type |.path| is used with a named path (named using the
+ |name| key). This is the graphic object you need to reference
+ when you wish to morph a path.
+ \item The type |.path picture| is used with the scope of the
+ optional path picture.
+ \item The type |.path fill| is used with the path used for filling.
+ This is not the same as the normal path in case the path is
+ filled and patterned, for instance.
+ \item The type |.path shade| is used with the path used for shading
+ a path.
+ \end{itemize}
+ \end{command}
+
+ \begin{command}{\pgfpushtype}
+ Pushes the current type on an internal global stack. The idea is to
+ allow you to temporarily change the current type without having to open
+ a \TeX\ scope.
+ \end{command}
+
+ \begin{command}{\pgfpoptype}
+ Restores the most recent type from the internal global stack of types.
+ \end{command}
+\end{command}
+
+\begin{command}{\pgfclearid}
+ Clears the current id (and type) for the local scope.
+\end{command}
+
+\begin{command}{\pgfidrefnextuse\marg{macro}\marg{name}}
+ This command assigns a system layer identifier (the identifier returned by
+ |\pgfsys@new@id|) to the \meta{macro}, namely the one that will be used the
+ \emph{next} time |\pgfuseid| is used. You use this command for ``forward
+ referencing''.
+
+ A typical use case is the following: A key like |whom| for animations uses
+ this command to get the system identifier that will be used for a future
+ object. Then, this identifier can be passed to system layer commands like
+ |\pgfsys@animation@whom|.
+
+ Note that the ``next'' use need not be on the same page (or there may not
+ even be any use at all), in which case the reference will not refer to any
+ object.
+\end{command}
+
+\begin{command}{\pgfidrefprevuse\marg{macro}\marg{name}}
+ Works like |\pgfidrefnextuse|, only it references the most recent
+ \emph{previous} use of the \meta{name}. As for |\pgfidrefnextuse|, the most
+ recent use need not be on the same page.
+\end{command}
+
+\begin{command}{\pgfaliasid\marg{alias}\marg{name}}
+ Creates an alias of a name inside the current \TeX\ scope. After calling
+ this command, you can use \meta{alias} anywhere where you would normally
+ use \meta{name}. Note that the binding between \meta{alias} and \meta{name}
+ is not kept when |\pgfuseid| is used on the \meta{name} (or the
+ \meta{alias}).
+\end{command}
+
+\begin{command}{\pgfgaliasid\marg{1}\marg{2}}
+ Like |\pgfaliasid|, only the alias is set globally.
+\end{command}
+
+\begin{command}{\pgfifidreferenced\marg{name}\marg{then code}\marg{else code}}
+ If \meta{name} has been referenced, \meta{then code} is executed, otherwise
+ \meta{else code}.
+\end{command}
+
+
+\subsection{Resource Description Framework Annotations (RDFa)}
+\label{section-base-rdf}
+
+With certain output formats (in particular, with \textsc{svg}) you can insert
+annotations into the output file following the standard set by the
+\emph{resource description framework} (known as ``\textsc{rdf}'', please
+consult the literature on \textsc{rdf} and \textsc{rdf}a for an introduction to
+resource descriptions and ontologies and their purpose in general). To do so,
+you call one (or several) of the following commands before you call
+|\pgfidscope|. The attributes and values you specify using the commands will
+then be added to the resulting scope (if the driver supports this, which is
+only the case for \textsc{svg} at the moment). As an example, when you write
+%
+\begin{codeexample}[code only]
+\pgfrdfresource{/fruits/apple}
+\pgfidscope
+...
+\pgfendidscope
+\end{codeexample}
+
+in the resulting \textsc{svg} file you get
+%
+\begin{codeexample}[code only]
+<g resource="/fruits/apple">
+ ...
+</g>
+\end{codeexample}
+
+Most of the following commands just set a single attribute for the next id
+scope. In some cases, however, repeated calling of these commands makes sense
+and causes the passed values to accumulate as in the following example:
+%
+\begin{codeexample}[code only]
+\pgfrdfresource{/fruits/apple}
+\pgfrdfproperty{http://foo.com/props/juicy}
+\pgfrdfproperty{http://foo.com/props/green}
+\pgfidscope
+...
+\pgfendidscope
+\end{codeexample}
+
+Now you get:
+%
+\begin{codeexample}[code only]
+<g resource="/fruits/apple"
+ property="http://foo.com/props/juicy http://foo.com/props/green">
+ ...
+</g>
+\end{codeexample}
+
+The following commands ``accumulate'': |\pgfrdfproperty|, |\pgfrdfrel|,
+|\pgfrdfrev| and also the command |\pgfrdftypeof|.
+
+\begin{command}{\pgfrdfabout\marg{text}}
+ Adds the \textsc{rdf} attribute |about="|\meta{text}|"| to the next id
+ scope (please see the \textsc{rdf}a specification for details on the
+ semantics of |about| in the context of the resource description framework).
+\end{command}
+
+The following commands work the same way.
+
+\begin{command}{\pgfrdfcontent\marg{text}}
+\end{command}
+
+\begin{command}{\pgfrdfdatatype\marg{text}}
+\end{command}
+
+\begin{command}{\pgfrdfhref\marg{text}}
+\end{command}
+
+\begin{command}{\pgfrdfinlist}
+\end{command}
+
+\begin{command}{\pgfrdfprefix\marg{text}}
+\end{command}
+
+\begin{command}{\pgfrdfproperty\marg{text}}
+\end{command}
+
+\begin{command}{\pgfrdfrel\marg{text}}
+\end{command}
+
+\begin{command}{\pgfrdfresource\marg{text}}
+\end{command}
+
+\begin{command}{\pgfrdfrev\marg{text}}
+\end{command}
+
+\begin{command}{\pgfrdfsrc\marg{text}}
+\end{command}
+
+\begin{command}{\pgfrdftypeof\marg{text}}
+\end{command}
+\begin{command}{\pgfrdfvocab\marg{text}}
\end{command}
\subsection{Error Messages and Warnings}
-Sometimes, a command inside \pgfname\ may fail. In this case, two
-commands are useful to communicate with the author:
+Sometimes, a command inside \pgfname\ may fail. In this case, two commands are
+useful to communicate with the author:
\begin{command}{\pgferror\marg{message}}
- Stops the processing of the current document and prints out the
- \meta{message}. In \LaTeX, this will be done using |\PackageError|,
- otherwise |\errmessage| is used directly.
+ Stops the processing of the current document and prints out the
+ \meta{message}. In \LaTeX, this will be done using |\PackageError|,
+ otherwise |\errmessage| is used directly.
\end{command}
\begin{command}{\pgfwarning\marg{message}}
- Prints the \meta{message} on the output, but does not interrupt the
- processing. In \LaTeX, this will be done using |\PackageWarning|,
- otherwise a write to stream $17$ is used.
+ Prints the \meta{message} on the output, but does not interrupt the
+ processing. In \LaTeX, this will be done using |\PackageWarning|, otherwise
+ a write to stream $17$ is used.
\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 16d4dd04d99..c405699081b 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
@@ -9,94 +9,87 @@
\section{Shadings}
-
\label{section-shadings}
\subsection{Overview}
A shading is an area in which the color changes smoothly between different
-colors. Similarly to an image, a shading must first be declared before
-it can be used. Also similarly to an image, a shading is put into a
-\TeX-box. Hence, in order to include a shading in a |{pgfpicture}|,
-you have to use |\pgftext| around it.
-
-There are different kinds of shadings: horizontal, vertical, radial,
-and functional shadings. However, you can rotate and clip shadings
-like any other graphics object, which allows you to create more
-complicated shadings. Horizontal shadings could be created by rotating
-a vertical shading by 90 degrees, but explicit commands for creating both
-horizontal and vertical shadings are included for convenience.
-
-Once you have declared a shading, you can insert it into the text using
-the command |\pgfuseshading|. This command cannot be used directly in
-a |{pgfpicture}|, you have to put a |\pgftext| around it. The second
-command for using shadings, |\pgfshadepath|, on the other hand, can
-only be used inside |{pgfpicture}| environments. It will ``fill'' the
-current path with the shading.
-
-A horizontal shading is a horizontal bar of a certain height whose
-color changes smoothly. You must at least specify the colors at the
-left and at the right end of the bar, but you can also add color
-specifications for points in between. For example, suppose you
-wish to create a bar that is red at the left end, green in the
-middle, and blue at the end, and you would like the bar to be 4cm
-long. This could be specified as follows:
+colors. Similarly to an image, a shading must first be declared before it can
+be used. Also similarly to an image, a shading is put into a \TeX-box. Hence,
+in order to include a shading in a |{pgfpicture}|, you have to use |\pgftext|
+around it.
+
+There are different kinds of shadings: horizontal, vertical, radial, and
+functional shadings. However, you can rotate and clip shadings like any other
+graphics object, which allows you to create more complicated shadings.
+Horizontal shadings could be created by rotating a vertical shading by 90
+degrees, but explicit commands for creating both horizontal and vertical
+shadings are included for convenience.
+
+Once you have declared a shading, you can insert it into the text using the
+command |\pgfuseshading|. This command cannot be used directly in a
+|{pgfpicture}|, you have to put a |\pgftext| around it. The second command for
+using shadings, |\pgfshadepath|, on the other hand, can only be used inside
+|{pgfpicture}| environments. It will ``fill'' the current path with the
+shading.
+
+A horizontal shading is a horizontal bar of a certain height whose color
+changes smoothly. You must at least specify the colors at the left and at the
+right end of the bar, but you can also add color specifications for points in
+between. For example, suppose you wish to create a bar that is red at the left
+end, green in the middle, and blue at the end, and you would like the bar to be
+4cm long. This could be specified as follows:
+%
\begin{codeexample}[code only]
rgb(0cm)=(1,0,0); rgb(2cm)=(0,1,0); rgb(4cm)=(0,0,1)
\end{codeexample}
-This line means that at 0cm (the left end) of the bar, the color
-should be red, which has red-green-blue (rgb) components (1,0,0). At
-2cm, the bar should be green, and at 4cm it should be blue.
-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
-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.
+%
+This line means that at 0cm (the left end) of the bar, the color should be red,
+which has red-green-blue (rgb) components (1,0,0). At 2cm, the bar should be
+green, and at 4cm it should be blue. 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 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.
\subsection{Declaring Shadings}
\subsubsection{Horizontal and Vertical Shadings}
-\begin{command}{\pgfdeclarehorizontalshading\oarg{color list}\marg{shading
- name}\marg{shading height}\marg{color specification}}
- Declares a horizontal shading named \meta{shading name} of the specified
- \meta{height} with the specified colors. The width of the bar is
- deduced automatically from the maximum dimension in the specification.
-
+\begin{command}{\pgfdeclarehorizontalshading\oarg{color list}\marg{shading name}\marg{shading height}\marg{color specification}}
+ Declares a horizontal shading named \meta{shading name} of the specified
+ \meta{height} with the specified colors. The width of the bar is deduced
+ automatically from the maximum dimension in the specification.
+ %
\begin{codeexample}[]
\pgfdeclarehorizontalshading{myshadingA}
{1cm}{rgb(0cm)=(1,0,0); color(2cm)=(green); color(4cm)=(blue)}
\pgfuseshading{myshadingA}
\end{codeexample}
- The effect of the \meta{color list}, which is a
- comma-separated list of colors, is the following: Normally, when
- this list is empty, once a shading has been declared, it becomes
- ``frozen.'' This means that even if you change a color that was used
- in the declaration of the shading later on, the shading will not
- 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}, % 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
- 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
- given.
-
- When a shading is recalculated because of a change in the
- colors mentioned in \meta{color list}, the complete shading
- 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.
-
+ The effect of the \meta{color list}, which is a comma-separated list of
+ colors, is the following: Normally, when this list is empty, once a shading
+ has been declared, it becomes ``frozen''. This means that even if you
+ change a color that was used in the declaration of the shading later on,
+ the shading will not 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}, 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 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 given.
+
+ When a shading is recalculated because of a change in the colors mentioned
+ in \meta{color list}, the complete shading 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)}
@@ -105,40 +98,37 @@ in increasing order.
\colorlet{mycolor}{blue}
\pgfuseshading{myshadingB}
\end{codeexample}
+ %
\end{command}
-
-\begin{command}{\pgfdeclareverticalshading\oarg{color list}\marg{shading
- name}\marg{shading width}\marg{color specification}}
- Declares a vertical shading named \meta{shading name} of the
- specified \meta{width}. The height of the bar is deduced
- automatically. The effect of \meta{color list} is the same as for
- horizontal shadings.
-
+\begin{command}{\pgfdeclareverticalshading\oarg{color list}\marg{shading name}\marg{shading width}\marg{color specification}}
+ Declares a vertical shading named \meta{shading name} of the specified
+ \meta{width}. The height of the bar is deduced automatically. The effect of
+ \meta{color list} is the same as for horizontal shadings.
+ %
\begin{codeexample}[]
\pgfdeclareverticalshading{myshadingC}
{4cm}{rgb(0cm)=(1,0,0); rgb(1.5cm)=(0,1,0); rgb(2cm)=(0,0,1)}
\pgfuseshading{myshadingC}
\end{codeexample}
+ %
\end{command}
\subsubsection{Radial Shadings}
-\begin{command}{\pgfdeclareradialshading\oarg{color list}\marg{shading
- name}\marg{center point}\marg{color specification}}
- Declares a radial shading. A radial shading is a circle whose inner
- color changes as specified by the color specification. Assuming that
- the center of the shading is at the origin, the color of the center
- 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
- 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.
-
+\begin{command}{\pgfdeclareradialshading\oarg{color list}\marg{shading name}\marg{center point}\marg{color specification}}
+ Declares a radial shading. A radial shading is a circle whose inner color
+ changes as specified by the color specification. Assuming that the center
+ of the shading is at the origin, the color of the center 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 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.
+ %
\begin{codeexample}[]
\pgfdeclareradialshading{sphere}{\pgfpoint{0.5cm}{0.5cm}}%
{rgb(0cm)=(0.9,0,0);
@@ -147,81 +137,76 @@ in increasing order.
rgb(1.05cm)=(1,1,1)}
\pgfuseshading{sphere}
\end{codeexample}
+ %
\end{command}
\subsubsection{General (Functional) Shadings}
\begin{command}{\pgfdeclarefunctionalshading\oarg{color list}\marg{shading
- name}\marg{lower left corner}\marg{upper right corner}\\
- \marg{init code}\marg{type 4 function}}
- \emph{Warning: These shadings are the least portable of all and they
- put the heaviest burden of the renderer. They are slow and,
- possibly, will not print correctly!}
-
- This command creates a \emph{functional shading}. For such a
- shading, the color of each point is calculated by calling a function
- that takes the coordinates of the point as input and yields 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 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
- renderer.
-
- The syntax for specifying functions is the following: You use a
- 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 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,
- and no variables or names.'' The allowed operators are (exactly) the
- following: \texttt{abs}, \texttt{add}, \texttt{atan},
- \texttt{ceiling}, \texttt{cos}, \texttt{cvi}, \texttt{cvr},
- \texttt{div}, \texttt{exp}, \texttt{floor}, \texttt{idiv},
- \texttt{ln}, \texttt{log}, \texttt{mod}, \texttt{mul}, \texttt{neg},
- \texttt{round}, \texttt{sin}, \texttt{sqrt}, \texttt{sub},
- \texttt{truncate}, \texttt{and}, \texttt{bitshift}, \texttt{eq},
- \texttt{false}, \texttt{ge}, \texttt{gt}, \texttt{le}, \texttt{lt},
- \texttt{ne}, \texttt{not}, \texttt{or}, \texttt{true}, \texttt{xor},
- \texttt{if}, \texttt{ifelse}, \texttt{copy}, \texttt{dup},
- \texttt{exch}, \texttt{index}, \texttt{pop}.
-
- When the function is evaluated, the top two stack elements are the
- 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}. 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
- real values, not integers since, Apple's PDF renderer is broken in
- this regard (use cvr at the end if necessary).
-
- Conceptually, the function will be evaluated once for each point of
- the rectangle \meta{lower left corner} to \meta{upper right corner},
- 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.
-
- Because of the rather difficult PostScript syntax, use this macro
- only \emph{if you know what you are doing} (or if you are
- adventurous, 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
- has changed.
-
- The \meta{init code} is executed each time a shading is
- (re)calculated. Typically, it will contain code to extract
- coordinates from colors.
-
+ name}\marg{lower left corner}\marg{upper right corner}\\
+ \marg{init code}\marg{type 4 function}%
+}
+ \emph{Warning: These shadings are the least portable of all and they put
+ the heaviest burden of the renderer. They are slow and, possibly, will not
+ print correctly!}
+
+ This command creates a \emph{functional shading}. For such a shading, the
+ color of each point is calculated by calling a function that takes the
+ coordinates of the point as input and yields 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 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 renderer.
+
+ The syntax for specifying functions is the following: You use a 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
+ 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, and no
+ variables or names.'' The allowed operators are (exactly) the following:
+ \texttt{abs}, \texttt{add}, \texttt{atan}, \texttt{ceiling}, \texttt{cos},
+ \texttt{cvi}, \texttt{cvr}, \texttt{div}, \texttt{exp}, \texttt{floor},
+ \texttt{idiv}, \texttt{ln}, \texttt{log}, \texttt{mod}, \texttt{mul},
+ \texttt{neg}, \texttt{round}, \texttt{sin}, \texttt{sqrt}, \texttt{sub},
+ \texttt{truncate}, \texttt{and}, \texttt{bitshift}, \texttt{eq},
+ \texttt{false}, \texttt{ge}, \texttt{gt}, \texttt{le}, \texttt{lt},
+ \texttt{ne}, \texttt{not}, \texttt{or}, \texttt{true}, \texttt{xor},
+ \texttt{if}, \texttt{ifelse}, \texttt{copy}, \texttt{dup}, \texttt{exch},
+ \texttt{index}, \texttt{pop}.
+
+ When the function is evaluated, the top two stack elements are the
+ 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}. 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 real values, not integers
+ since, Apple's PDF renderer is broken in this regard (use cvr at the end if
+ necessary).
+
+ Conceptually, the function will be evaluated once for each point of the
+ rectangle \meta{lower left corner} to \meta{upper right corner}, 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.
+
+ Because of the rather difficult PostScript syntax, use this macro only
+ \emph{if you know what you are doing} (or if you are adventurous, 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 has changed.
+
+ The \meta{init code} is executed each time a shading is (re)calculated.
+ Typically, it will contain code to extract coordinates from colors.
+ %
\begin{codeexample}[]
\pgfdeclarefunctionalshading{twospots}
{\pgfpointorigin}{\pgfpoint{4cm}{4cm}}{}{
@@ -244,20 +229,17 @@ 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 |\pgfshadecolortorgb| 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|.
-
-
+ 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 |\pgfshadecolortorgb| 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}}{
@@ -289,17 +271,15 @@ in increasing order.
\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.
-
+ 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}
+ \end{command}
\begin{codeexample}[]
\pgfdeclarefunctionalshading[col1,col2,col3,col4]{bilinear interpolation}
@@ -333,6 +313,7 @@ be used in the \meta{type 4 function} argument.
\colorlet{col4}{green}
\pgfuseshading{bilinear interpolation}
\end{codeexample}
+ %
\end{command}
@@ -340,10 +321,9 @@ be used in the \meta{type 4 function} argument.
\label{section-shading-a-path}
\begin{command}{\pgfuseshading\marg{shading name}}
- 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.
-
+ Inserts a previously declared shading into the text. If you wish to use it
+ in a |pgfpicture| environment, you should put a |\pgftext| around it.
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\pgfdeclareverticalshading{myshadingD}
@@ -352,58 +332,55 @@ be used in the \meta{type 4 function} argument.
\pgftext[at=\pgfpoint{2cm}{0.5cm}]{\pgfuseshading{myshadingD}}
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfshadepath\marg{shading name}\marg{angle}}
- This command must be used inside a |{pgfpicture}| environment. The
- effect is a bit complex, so let us go over it step by step.
-
- First, \pgfname\ will set up a local scope.
-
- Second, it uses the current path to clip everything inside this
- scope. However, the current path is once more available after the
- scope, so it can be used, for example, to stroke it.
-
- Now, the \meta{shading name} should be a shading whose width and
- height are 100\,bp, that is, 100 big points. \pgfname\ has a look at
- 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.
-
- 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 path (the
- details are a bit more complex, see below). Then, the coordinate
- system is rotated by \meta{angle}. Finally, if the macro
- |\pgfsetadditionalshadetransform| has been used, an additional
- 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
- shading seems to ``fill'' the path.
-
- If both the path and the shadings were always rectangles and if
- rotations were never involved, it would be easy to scale shadings
- such they always cover the path. However, when a vertical shading is
- rotated, it must obviously be ``magnified'' so that it
- still covers the path. Things get worse when the path is not a
- rectangle itself.
-
- For these reasons, things work slightly differently ``in reality.''
- 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
- 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.
-
- In other words, only the center quarter of the shading will actually
- ``survive the clipping'' if the path is a rectangle. If the path is
- not a rectangle, but, say, a circle, even less is seen of the
- shading. Here is an example that demonstrates this effect:
-
+ This command must be used inside a |{pgfpicture}| environment. The effect
+ is a bit complex, so let us go over it step by step.
+
+ First, \pgfname\ will set up a local scope.
+
+ Second, it uses the current path to clip everything inside this scope.
+ However, the current path is once more available after the scope, so it can
+ be used, for example, to stroke it.
+
+ Now, the \meta{shading name} should be a shading whose width and height are
+ 100\,bp, that is, 100 big points. \pgfname\ has a look at 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.
+
+ 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 path (the details are a bit
+ more complex, see below). Then, the coordinate system is rotated by
+ \meta{angle}. Finally, if the macro |\pgfsetadditionalshadetransform| has
+ been used, an additional 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 shading seems
+ to ``fill'' the path.
+
+ If both the path and the shadings were always rectangles and if rotations
+ were never involved, it would be easy to scale shadings such they always
+ cover the path. However, when a vertical shading is rotated, it must
+ obviously be ``magnified'' so that it still covers the path. Things get
+ worse when the path is not a rectangle itself.
+
+ For these reasons, things work slightly differently ``in reality''. 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 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.
+
+ In other words, only the center quarter of the shading will actually
+ ``survive the clipping'' if the path is a rectangle. If the path is not a
+ rectangle, but, say, a circle, even less is seen of the shading. Here is an
+ example that demonstrates this effect:
+ %
\begin{codeexample}[]
\pgfdeclareverticalshading{myshadingE}{100bp}
{color(0bp)=(red); color(25bp)=(green); color(75bp)=(blue); color(100bp)=(black)}
@@ -425,14 +402,12 @@ be used in the \meta{type 4 function} argument.
\end{pgfpicture}
\end{codeexample}
- As can be seen above in the last case, the ``hidden'' part of the
- shading actually \emph{can} become visible if the shading is
- rotated. The reason is that it is scaled as if no rotation took
- place, then the rotation is done.
-
- The following graphics show which part of the shading are actually
- shown:
+ As can be seen above in the last case, the ``hidden'' part of the shading
+ actually \emph{can} become visible if the shading is rotated. The reason is
+ that it is scaled as if no rotation took place, then the rotation is done.
+ The following graphics show which part of the shading are actually shown:
+ %
\begin{codeexample}[]
\pgfdeclareverticalshading{myshadingF}{100bp}
{color(0bp)=(red); color(25bp)=(green); color(75bp)=(blue); color(100bp)=(black)}
@@ -455,9 +430,9 @@ be used in the \meta{type 4 function} argument.
\end{tikzpicture}
\end{codeexample}
- An advantage of this approach is that when you rotate a radial
- shading, no distortion is introduced:
-
+ An advantage of this approach is that when you rotate a radial shading, no
+ distortion is introduced:
+ %
\begin{codeexample}[]
\pgfdeclareradialshading{ballshading}{\pgfpoint{-10bp}{10bp}}
{color(0bp)=(red!15!white); color(9bp)=(red!75!white);
@@ -477,11 +452,11 @@ be used in the \meta{type 4 function} argument.
\end{pgfpicture}
\end{codeexample}
- If you specify a rotation of $90^\circ$
- 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:
-
+ If you specify a rotation of $90^\circ$ 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}
{color(0bp)=(red); color(25bp)=(green); color(75bp)=(blue); color(100bp)=(black)}
@@ -498,9 +473,9 @@ be used in the \meta{type 4 function} argument.
\end{pgfpicture}
\end{codeexample}
-
- As a final example, let us define a ``rainbow spectrum'' shading for
- use with \tikzname.
+ As a final example, let us define a ``rainbow spectrum'' shading for use
+ with \tikzname.
+ %
\begin{codeexample}[]
\pgfdeclareverticalshading{rainbow}{100bp}
{color(0bp)=(red); color(25bp)=(red); color(35bp)=(yellow);
@@ -512,17 +487,18 @@ be used in the \meta{type 4 function} argument.
\end{tikzpicture}
\end{codeexample}
- Note that rainbow shadings are \emph{way} too colorful in almost all
- applications.
+ Note that rainbow shadings are \emph{way} too colorful in almost all
+ 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}|.
+ 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}|.
\end{command}
+
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
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 77d63178955..2cd4553dfef 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
@@ -7,117 +7,105 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Coordinate, Canvas, and Nonlinear Transformations}
\subsection{Overview}
-\pgfname\ offers different ways of scaling, shifting, and rotating
-(these operations are generally known as \emph{transformations})
-graphics: You can apply \emph{coordinate transformations} to all
-coordinates, you can apply \emph{canvas transformations} to the
-canvas on which you draw, and you can apply \emph{additional nonlinear
- transformations.} (The names ``coordinate'' and ``canvas''
-transformations are not standard, I introduce them only for the
-purposes of this manual.)
+\pgfname\ offers different ways of scaling, shifting, and rotating (these
+operations are generally known as \emph{transformations}) graphics: You can
+apply \emph{coordinate transformations} to all coordinates, you can apply
+\emph{canvas transformations} to the canvas on which you draw, and you can
+apply \emph{additional nonlinear transformations}. (The names ``coordinate''
+and ``canvas'' transformations are not standard, I introduce them only for the
+purposes of this manual.)
The differences are the following:
-
+%
\begin{itemize}
-\item
- As the name ``coordinate transformation'' suggests, coordinate
- transformations apply only to coordinates. For example, when you
- specify a coordinate like |\pgfpoint{1cm}{2cm}| and you wish to
- ``use'' this coordinate---for example as an argument to a
- |\pgfpathmoveto| command---then the coordinate transformation matrix
- is applied to the coordinate, resulting in a new
- coordinate. Continuing the example, if the current coordinate
- transformation is ``scale by a factor of two,'' the coordinate
- |\pgfpoint{1cm}{2cm}| actually designates the point
- $(2\mathrm{cm},4\mathrm{cm})$.
-
- Note that coordinate transformations apply \emph{only} to
- coordinates. They do not apply to, say, line width or shadings or
- text.
-\item
- The effect of a ``canvas transformation'' like ``scale by a factor
- of two'' can be imagined as follows: You first draw your picture on
- a ``rubber canvas'' normally. Then, once you are done, the whole
- canvas is transformed, in this case stretched by a factor of
- two. In the resulting image \emph{everything} will be larger: Text,
- lines, coordinates, and shadings.
-\item
- Nonlinear transformations are a special form of coordinate
- transformations that are, as the name suggests, not linear. The
- support for nonlinear transformations is quite different from the
- support for linear coordinate transformations, the main reason being
- speed: While linear coordinate transformations can be applied very
- quickly (\pgfname\ does so almost constantly), nonlinear
- transformations are much harder to apply and also to use. For this
- reason, nonlinear transformations are implemented in a special
- module |nonlineartransformations| that has to be loaded
- explicitly. By default, they are not available.
+ \item As the name ``coordinate transformation'' suggests, coordinate
+ transformations apply only to coordinates. For example, when you
+ specify a coordinate like |\pgfpoint{1cm}{2cm}| and you wish to ``use''
+ this coordinate -- for example as an argument to a |\pgfpathmoveto|
+ command -- then the coordinate transformation matrix is applied to the
+ coordinate, resulting in a new coordinate. Continuing the example, if
+ the current coordinate transformation is ``scale by a factor of two'',
+ the coordinate |\pgfpoint{1cm}{2cm}| actually designates the point
+ $(2\mathrm{cm},4\mathrm{cm})$.
+
+ Note that coordinate transformations apply \emph{only} to coordinates.
+ They do not apply to, say, line width or shadings or text.
+ \item The effect of a ``canvas transformation'' like ``scale by a factor of
+ two'' can be imagined as follows: You first draw your picture on a
+ ``rubber canvas'' normally. Then, once you are done, the whole canvas
+ is transformed, in this case stretched by a factor of two. In the
+ resulting image \emph{everything} will be larger: Text, lines,
+ coordinates, and shadings.
+ \item Nonlinear transformations are a special form of coordinate
+ transformations that are, as the name suggests, not linear. The support
+ for nonlinear transformations is quite different from the support for
+ linear coordinate transformations, the main reason being speed: While
+ linear coordinate transformations can be applied very quickly
+ (\pgfname\ does so almost constantly), nonlinear transformations are
+ much harder to apply and also to use. For this reason, nonlinear
+ transformations are implemented in a special module
+ |nonlineartransformations| that has to be loaded explicitly. By
+ default, they are not available.
\end{itemize}
-In many cases, it is preferable that you use coordinate
-transformations and not canvas transformations. When canvas
-transformations are used, \pgfname\ looses track of the coordinates of
-nodes and shapes. Also, canvas transformations often cause undesirable
-effects like changing text size. For these reasons, \pgfname\ makes it
-easy to setup the coordinate transformation, but a bit harder to
-change the canvas transformation. Because of the speed penalties
+In many cases, it is preferable that you use coordinate transformations and not
+canvas transformations. When canvas transformations are used, \pgfname\ looses
+track of the coordinates of nodes and shapes. Also, canvas transformations
+often cause undesirable effects like changing text size. For these reasons,
+\pgfname\ makes it easy to setup the coordinate transformation, but a bit
+harder to change the canvas transformation. Because of the speed penalties
caused by nonlinear transformations, they are even harder to set up.
\subsection{Coordinate Transformations}
\label{section-linear-coordinate-transformations}
-\subsubsection{How PGF Keeps Track of the Coordinate Transformation
- Matrix}
+\subsubsection{How PGF Keeps Track of the Coordinate Transformation Matrix}
\label{section-transform-cm}
-\pgfname\ has an internal coordinate transformation matrix. This
-matrix is applied to coordinates ``in certain situations.'' This means
-that the matrix is not always applied to every coordinate ``no matter
-what.'' Rather, \pgfname\ tries to be reasonably smart at when and how
-this matrix should be applied. The most prominent examples are the
-path construction commands, which apply the coordinate transformation
-matrix to their inputs.
-
-The coordinate transformation matrix consists of four numbers $a$,
-$b$, $c$, and $d$, and two dimensions $s$ and $t$. When the coordinate
-transformation matrix is applied to a coordinate $(x,y)$, the new
-coordinate $(ax+by+s,cx+dy+t)$ results. For more details on how
-transformation matrices work in general, please see, for example, the
-\textsc{pdf} or PostScript reference or a textbook on computer
-graphics.
-
-The coordinate transformation matrix is equal to the identity matrix
-at the beginning. More precisely, $a=1$, $b=0$, $c=0$, $d=1$,
-$s=0\mathrm{pt}$, and $t=0\mathrm{pt}$.
+\pgfname\ has an internal coordinate transformation matrix. This matrix is
+applied to coordinates ``in certain situations''. This means that the matrix is
+not always applied to every coordinate ``no matter what''. Rather, \pgfname\
+tries to be reasonably smart at when and how this matrix should be applied. The
+most prominent examples are the path construction commands, which apply the
+coordinate transformation matrix to their inputs.
-The different coordinate transformation commands will modify the
-matrix by concatenating it with another transformation matrix. This
-way the effect of applying several transformation commands will
-\emph{accumulate}.
+The coordinate transformation matrix consists of four numbers $a$, $b$, $c$,
+and $d$, and two dimensions $s$ and $t$. When the coordinate transformation
+matrix is applied to a coordinate $(x,y)$, the new coordinate
+$(ax+cy+s,bx+dy+t)$ results. For more details on how transformation matrices
+work in general, please see, for example, the \textsc{pdf} or PostScript
+reference or a textbook on computer graphics.
-The coordinate transformation matrix is local to the current \TeX\
-group (unlike the canvas transformation matrix, which is local to the
-current |{pgfscope}|). Thus, the effect of adding a coordinate
-transformation to the coordinate transformation matrix will last only
-till the end of the current \TeX\ group.
+The coordinate transformation matrix is equal to the identity matrix at the
+beginning. More precisely, $a=1$, $b=0$, $c=0$, $d=1$, $s=0\mathrm{pt}$, and
+$t=0\mathrm{pt}$.
+The different coordinate transformation commands will modify the matrix by
+concatenating it with another transformation matrix. This way the effect of
+applying several transformation commands will \emph{accumulate}.
+The coordinate transformation matrix is local to the current \TeX\ group
+(unlike the canvas transformation matrix, which is local to the current
+|{pgfscope}|). Thus, the effect of adding a coordinate transformation to the
+coordinate transformation matrix will last only till the end of the current
+\TeX\ group.
\subsubsection{Commands for Relative Coordinate Transformations}
-The following commands add a basic coordinate transformation to the
-current coordinate transformation matrix. For all commands, the
-transformation is applied \emph{in addition} to any previous
-coordinate transformations.
+The following commands add a basic coordinate transformation to the current
+coordinate transformation matrix. For all commands, the transformation is
+applied \emph{in addition} to any previous coordinate transformations.
\begin{command}{\pgftransformshift\marg{point}}
- Shifts coordinates by \meta{point}.
+ Shifts coordinates by \meta{point}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -126,10 +114,12 @@ coordinate transformations.
\draw[red] (0,0) -- (2,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgftransformxshift\marg{dimensions}}
- Shifts coordinates by \meta{dimension} along the $x$-axis.
+ Shifts coordinates by \meta{dimension} along the $x$-axis.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -138,14 +128,16 @@ coordinate transformations.
\draw[red] (0,0) -- (2,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgftransformyshift\marg{dimensions}}
- Like |\pgftransformxshift|, only for the $y$-axis.
+ Like |\pgftransformxshift|, only for the $y$-axis.
\end{command}
\begin{command}{\pgftransformscale\marg{factor}}
- Scales coordinates by \meta{factor}.
+ Scales coordinates by \meta{factor}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -154,10 +146,12 @@ coordinate transformations.
\draw[red] (0,0) -- (2,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgftransformxscale\marg{factor}}
- Scales coordinates by \meta{factor} in the $x$-direction.
+ Scales coordinates by \meta{factor} in the $x$-direction.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -166,17 +160,17 @@ coordinate transformations.
\draw[red] (0,0) -- (2,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgftransformyscale\marg{factor}}
- Like |\pgftransformxscale|, only for the $y$-axis.
+ Like |\pgftransformxscale|, only for the $y$-axis.
\end{command}
-
\begin{command}{\pgftransformxslant\marg{factor}}
- Slants coordinates by \meta{factor} in the $x$-direction. Here, a
- factor of |1| means $45^\circ$.
+ Slants coordinates by \meta{factor} in the $x$-direction. Here, a factor of
+ |1| means $45^\circ$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -185,11 +179,12 @@ coordinate transformations.
\draw[red] (0,0) -- (2,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgftransformyslant\marg{factor}}
- Slants coordinates by \meta{factor} in the $y$-direction.
+ Slants coordinates by \meta{factor} in the $y$-direction.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -198,12 +193,13 @@ coordinate transformations.
\draw[red] (0,0) -- (2,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgftransformrotate\marg{angles}}
- Rotates coordinates counterclockwise by \meta{angles} given in degrees.
+ Rotates coordinates counterclockwise by \meta{angles} given in degrees.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -212,15 +208,15 @@ coordinate transformations.
\draw[red] (0,0) -- (2,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
-
\begin{command}{\pgftransformtriangle\marg{a}\marg{b}\marg{c}}
- This command transforms the coordinate system in such a way that the
- triangle given by the points \meta{a}, \meta{b} and \meta{c} lies at
- the coordinates $(0,0)$, $(1\mathrm{pt},0\mathrm{pt})$ and
- $(0\mathrm{pt},1\mathrm{pt})$.
+ This command transforms the coordinate system in such a way that the
+ triangle given by the points \meta{a}, \meta{b} and \meta{c} lies at the
+ coordinates $(0,0)$, $(1\mathrm{pt},0\mathrm{pt})$ and
+ $(0\mathrm{pt},1\mathrm{pt})$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -228,17 +224,18 @@ coordinate transformations.
{\pgfpoint{1cm}{0cm}}
{\pgfpoint{0cm}{2cm}}
{\pgfpoint{3cm}{1cm}}
-
+
\draw (0,0) -- (1pt,0pt) -- (0pt,1pt) -- cycle;
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgftransformcm\marg{a}\marg{b}\marg{c}\marg{d}\marg{point}}
- Applies the transformation matrix given by $a$, $b$, $c$, and $d$
- and the shift \meta{point} to coordinates (in addition to any
- previous transformations already in force).
+ Applies the transformation matrix given by $a$, $b$, $c$, and $d$ and the
+ shift \meta{point} to coordinates (in addition to any previous
+ transformations already in force).
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -247,12 +244,13 @@ coordinate transformations.
\draw[red] (0,0) -- (2,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgftransformarrow\marg{start}\marg{end}}
- Shifts coordinates to the end of the line going from \meta{start}
- to \meta{end} with the correct rotation.
+ Shifts coordinates to the end of the line going from \meta{start} to
+ \meta{end} with the correct rotation.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -261,18 +259,18 @@ coordinate transformations.
\pgftext{tip}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgftransformlineattime\marg{time}\marg{start}\marg{end}}
- Shifts coordinates by a specific point on a line at a specific
- time. The point by which the coordinate is shifted is calculated by
- calling |\pgfpointlineattime|, see
- Section~\ref{section-pointsattime}.
-
- In addition to shifting the coordinate, a rotation \emph{may} also
- be applied. Whether this is the case depends on whether the \TeX\ if
- |\ifpgfslopedattime| is set to true or not.
+ Shifts coordinates by a specific point on a line at a specific time. The
+ point by which the coordinate is shifted is calculated by calling
+ |\pgfpointlineattime|, see Section~\ref{section-pointsattime}.
+
+ In addition to shifting the coordinate, a rotation \emph{may} also be
+ applied. Whether this is the case depends on whether the \TeX\ if
+ |\ifpgfslopedattime| is set to true or not.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -281,6 +279,7 @@ coordinate transformations.
\pgftext{Hi!}
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -290,16 +289,17 @@ coordinate transformations.
\pgftext{Hi!}
\end{tikzpicture}
\end{codeexample}
- If |\ifpgfslopedattime| is true, another \TeX\ |\if| is important:
- |\ifpgfallowupsidedowattime|. If this is false, \pgfname\ will
- ensure that the rotation is done in such a way that text is never
- ``upside down.''
-
- There is another \TeX\ |\if| that influences this command. If you set
- |\ifpgfresetnontranslationattime| to true, then, between
- shifting the coordinate and (possibly) rotating/sloping the
- coordinate, the command |\pgftransformresetnontranslations| is
- called. See the description of this command for details.
+ %
+ If |\ifpgfslopedattime| is true, another \TeX\ |\if| is important:
+ |\ifpgfallowupsidedowattime|. If this is false, \pgfname\ will ensure that
+ the rotation is done in such a way that text is never ``upside down''.
+
+ There is another \TeX\ |\if| that influences this command. If you set
+ |\ifpgfresetnontranslationattime| to true, then, between shifting the
+ coordinate and (possibly) rotating/sloping the coordinate, the command
+ |\pgftransformresetnontranslations| is called. See the description of this
+ command for details.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -311,6 +311,7 @@ coordinate transformations.
\pgftext{Hi!}
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -322,17 +323,17 @@ coordinate transformations.
\pgftext{Hi!}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
+\begin{command}{\pgftransformcurveattime\marg{time}\marg{start}\marg{first support}\marg{second support}\marg{end}}
+ Shifts coordinates by a specific point on a curve at a specific time, see
+ Section~\ref{section-pointsattime} once more.
-\begin{command}{\pgftransformcurveattime\marg{time}\marg{start}\marg{first
- support}\marg{second support}\marg{end}}
- Shifts coordinates by a specific point on a curve at a specific
- time, see Section~\ref{section-pointsattime} once more.
-
- As for the line-at-time transformation command, |\ifpgfslopedattime|
- decides whether an additional rotation should be applied. Again, the
- value of |\ifpgfallowupsidedowattime| is also considered.
+ As for the line-at-time transformation command, |\ifpgfslopedattime|
+ decides whether an additional rotation should be applied. Again, the value
+ of |\ifpgfallowupsidedowattime| is also considered.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -342,6 +343,7 @@ coordinate transformations.
\pgftext{Hi!}
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -352,19 +354,21 @@ coordinate transformations.
\pgftext{Hi!}
\end{tikzpicture}
\end{codeexample}
- The value of |\ifpgfresetnontranslationsattime| is also taken into account.
+ %
+ The value of |\ifpgfresetnontranslationsattime| is also taken into account.
\end{command}
-
\begin{command}{\pgftransformarcaxesattime\marg{time
$t$}\marg{center}\marg{0-degree axis}\marg{90-degree
- axis}\marg{start angle}\marg{end angle}}
- Shifts coordinates by a specific point on an arc at a specific
- time, see Section~\ref{section-pointsattime} once more.
-
- As for the previous commands, |\ifpgfslopedattime|
- decides whether an additional rotation should be applied and
- |\ifpgfallowupsidedowattime| is also considered.
+ axis}\marg{start angle}\marg{end angle}%
+}
+ Shifts coordinates by a specific point on an arc at a specific time, see
+ Section~\ref{section-pointsattime} once more.
+
+ As for the previous commands, |\ifpgfslopedattime| decides whether an
+ additional rotation should be applied and |\ifpgfallowupsidedowattime| is
+ also considered.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -379,47 +383,48 @@ coordinate transformations.
\pgftext{Hi!}
\end{tikzpicture}
\end{codeexample}
- The value of |\ifpgfresetnontranslationsattime| is also taken into account.
+ %
+ The value of |\ifpgfresetnontranslationsattime| is also taken into account.
\end{command}
-
{
- \let\ifpgfslopedattime=\relax
- \begin{textoken}{\ifpgfslopedattime}
- Decides whether the ``at time'' transformation commands also
- rotate coordinates or not.
- \end{textoken}
+ \let\ifpgfslopedattime=\relax
+ \begin{textoken}{\ifpgfslopedattime}
+ Decides whether the ``at time'' transformation commands also rotate
+ coordinates or not.
+ \end{textoken}
}
{
- \let\ifpgfallowupsidedowattime=\relax
- \begin{textoken}{\ifpgfallowupsidedowattime}
- Decides whether the ``at time'' transformation commands should
- allow the rotation be done in such a way that ``upside-down text''
- can result.
- \end{textoken}
+ \let\ifpgfallowupsidedowattime=\relax
+ \begin{textoken}{\ifpgfallowupsidedowattime}
+ Decides whether the ``at time'' transformation commands should allow
+ the rotation be done in such a way that ``upside-down text'' can
+ result.
+ \end{textoken}
}
{
- \let\ifpgfresetnontranslationsattime=\relax
- \begin{textoken}{\ifpgfresetnontranslationsattime}
- Decides whether the ``at time'' transformation commands should
- reset the non-translations between shifting and rotating.
- \end{textoken}
+ \let\ifpgfresetnontranslationsattime=\relax
+ \begin{textoken}{\ifpgfresetnontranslationsattime}
+ Decides whether the ``at time'' transformation commands should reset
+ the non-translations between shifting and rotating.
+ \end{textoken}
}
\subsubsection{Commands for Absolute Coordinate Transformations}
-The coordinate transformation commands introduced up to now are always
-applied in addition to any previous transformations. In contrast, the
-commands presented in the following can be used to change the
-transformation matrix ``in absolute terms.'' Note that this is, in general,
-dangerous and will often produce unexpected effects. You should use
-these commands only if you really know what you are doing.
+The coordinate transformation commands introduced up to now are always applied
+in addition to any previous transformations. In contrast, the commands
+presented in the following can be used to change the transformation matrix ``in
+absolute terms''. Note that this is, in general, dangerous and will often
+produce unexpected effects. You should use these commands only if you really
+know what you are doing.
\begin{command}{\pgftransformreset}
- Resets the coordinate transformation matrix to the identity
- matrix. Thus, once this command is given no transformations are
- applied till the end of the scope.
+ Resets the coordinate transformation matrix to the identity matrix. Thus,
+ once this command is given no transformations are applied till the end of
+ the scope.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -429,20 +434,20 @@ these commands only if you really know what you are doing.
\draw[red] (0,0) -- (2,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgftransformresetnontranslations}
- This command sets the $a$, $b$, $c$, and $d$ part of the coordinate
- transformation matrix to $a=1$, $b=0$, $c=0$, and $d=1$. However,
- the current shifting of the matrix is not modified.
+ This command sets the $a$, $b$, $c$, and $d$ part of the coordinate
+ transformation matrix to $a=1$, $b=0$, $c=0$, and $d=1$. However, the
+ current shifting of the matrix is not modified.
- The effect of this command is that any rotation/scaling/slanting is
- undone in the current \TeX\ group, but the origin is not ``moved
- back.''
+ The effect of this command is that any rotation/scaling/slanting is undone
+ in the current \TeX\ group, but the origin is not ``moved back''.
- This command is mostly useful directly before a |\pgftext| command
- to ensure that the text is not scaled or rotated.
+ This command is mostly useful directly before a |\pgftext| command to
+ ensure that the text is not scaled or rotated.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -454,18 +459,19 @@ these commands only if you really know what you are doing.
\pgftext{shifted only}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgftransforminvert}
- Replaces the coordinate transformation matrix by a coordinate
- transformation matrix that ``exactly undoes the original
- transformation.'' For example, if the original transformation was
- ``scale by 2 and then shift right by 1cm'' the new one is ``shift
- left by 1cm and then scale by $1/2$.''
-
- This command will produce an error if the determinant of
- the matrix is too small, that is, if the matrix is near-singular.
+ Replaces the coordinate transformation matrix by a coordinate
+ transformation matrix that ``exactly undoes the original transformation''.
+ For example, if the original transformation was ``scale by 2 and then shift
+ right by 1cm'' the new one is ``shift left by 1cm and then scale by
+ $1/2$''.
+
+ This command will produce an error if the determinant of the matrix is too
+ small, that is, if the matrix is near-singular.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -475,74 +481,71 @@ these commands only if you really know what you are doing.
\draw[red] (0,0) -- (2,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
+\subsubsection{Saving and Restoring the Coordinate Transformation Matrix}
-\subsubsection{Saving and Restoring the Coordinate Transformation
- Matrix}
-
-There are two commands for saving and restoring coordinate
-transformation matrices.
+There are two commands for saving and restoring coordinate transformation
+matrices.
\begin{command}{\pgfgettransform\marg{macro}}
- This command will (locally) define \meta{macro} to a representation
- of the current coordinate transformation matrix. This matrix can
- later on be reinstalled using |\pgfsettransform|.
+ This command will (locally) define \meta{macro} to a representation of the
+ current coordinate transformation matrix. This matrix can later on be
+ reinstalled using |\pgfsettransform|.
\end{command}
-
\begin{command}{\pgfsettransform\marg{macro}}
- Reinstalls a coordinate transformation matrix that was previously
- saved using |\pgfgettransform|.
+ Reinstalls a coordinate transformation matrix that was previously 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|.
+ 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|).
+ 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}
-
\subsubsection{Computing Adjustments for Coordinate Transformations}
\label{section-adjustment-transformations}
\begin{command}{\pgftransformationadjustments}
- This command computes ``adjustments'' for the current transformation
- matrix so that even when you install a transformation matrix that
- scales everything by a certain factor, you can still draw
- something of ``an absolute size.'' Suppose for instance that you
- install a transformation matrix that scales everything by a factor
- of 4 and you now wish to draw a horizontal line of length 1cm. Then,
- if you do not reset the transformation matrix, you can draw a line
- of logical length 2.5mm, which will then get scaled to a line of
- 1cm. Things get more difficult in case you scale things only, say,
- vertically. In this case, the adjustement necessary for horizontal
- lines is different from the one needed for vertical lines.
-
- This function computes two scaling factors, one for horizontal lines
- and one for vertical lines, and stores them in the following macros:
- \begin{command}{\pgfhorizontaltransformationadjustment}
- When you scale the length of a horizontal line by this factor in
- the current transformation, you compensate for the
- scaling. Formally, it is $1/\|\mathit{transform}(1,0)\|_2$, where
- $\mathit{transform}$ applies the current transformations matrix to
- the given number.
+ This command computes ``adjustments'' for the current transformation matrix
+ so that even when you install a transformation matrix that scales
+ everything by a certain factor, you can still draw something of ``an
+ absolute size''. Suppose for instance that you install a transformation
+ matrix that scales everything by a factor of 4 and you now wish to draw a
+ horizontal line of length 1cm. Then, if you do not reset the transformation
+ matrix, you can draw a line of logical length 2.5mm, which will then get
+ scaled to a line of 1cm. Things get more difficult in case you scale things
+ only, say, vertically. In this case, the adjustment necessary for
+ horizontal lines is different from the one needed for vertical lines.
+
+ This function computes two scaling factors, one for horizontal lines
+ and one for vertical lines, and stores them in the following macros:
+ %
+ \begin{command}{\pgfhorizontaltransformationadjustment}
+ When you scale the length of a horizontal line by this factor in the
+ current transformation, you compensate for the scaling. Formally, it is
+ $1/\|\mathit{transform}(1,0)\|_2$, where $\mathit{transform}$ applies
+ the current transformations matrix to the given number.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (2,2);
@@ -552,8 +555,9 @@ transformation matrices.
\pgftransformationadjustments
\draw [blue] (1,0) -- ++(\pgfhorizontaltransformationadjustment,0);
\end{scope}
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (2,2);
@@ -563,65 +567,65 @@ transformation matrices.
\pgftransformationadjustments
\draw [blue] (1,0) -- ++(\pgfhorizontaltransformationadjustment,0);
\end{scope}
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
- \end{command}
- \begin{command}{\pgfverticaltransformationadjustment}
- $1/\|\mathit{transform}(0,1)\|_2$.
- \end{command}
-
- Note that the ``right'' way to draw a line of absolute length 1cm in
- a transformed coordinate system is to first compute the start point
- and to then reset the transformation matrix. The transformation
- adjustments computed here are important only in situations where you
- cannot do this, for instance when an |outer xsep| must be set.
+ \end{command}
+ %
+ \begin{command}{\pgfverticaltransformationadjustment}
+ $1/\|\mathit{transform}(0,1)\|_2$.
+ \end{command}
+
+ Note that the ``right'' way to draw a line of absolute length 1cm in a
+ transformed coordinate system is to first compute the start point and to
+ then reset the transformation matrix. The transformation adjustments
+ computed here are important only in situations where you cannot do this,
+ for instance when an |outer xsep| must be set.
\end{command}
\subsection{Canvas Transformations}
-The canvas transformation matrix is not managed by \pgfname, but by
-the output format like \pdf\ or PostScript. All that \pgfname\ does is
-to call appropriate low-level |\pgfsys@| commands to change the canvas
-transformation matrix.
+The canvas transformation matrix is not managed by \pgfname, but by the output
+format like \pdf\ or PostScript. All that \pgfname\ does is to call appropriate
+low-level |\pgfsys@| commands to change the canvas transformation matrix.
Unlike coordinate transformations, canvas transformations apply to
-``everything,'' including images, text, shadings, line thickness, and
-so on. The idea is that a canvas transformation really stretches and
-deforms the canvas after the graphic is finished.
-
-Unlike coordinate transformations, canvas transformations are local to
-the current |{pgfscope}|, not to the current \TeX\ group. This is due
-to the fact that they are managed by the backend driver, not by \TeX\
-or \pgfname.
-
-Unlike the coordinate transformation matrix, it is not possible to
-``reset'' the canvas transformation matrix. The only way to change it
-is to concatenate it with another canvas transformation matrix or to
-end the current |{pgfscope}|.
-
-Unlike coordinate transformations, \pgfname\ does not ``keep track''
-of canvas transformations. In particular, it will not be able to
-correctly save the coordinates of shapes or nodes when a canvas
-transformation is used.
-
-\pgfname\ does not offer a whole set of special commands for modifying
-the canvas transformation matrix. Instead, different commands allow
-you to concatenate the canvas transformation matrix with a coordinate
-transformation matrix (and there are numerous commands for specifying
-a coordinate transformation, see the previous section).
+``everything'', including images, text, shadings, line thickness, and so on.
+The idea is that a canvas transformation really stretches and deforms the
+canvas after the graphic is finished.
-\begin{command}{\pgflowlevelsynccm}
- This command concatenates the canvas transformation matrix with the
- current coordinate transformation matrix. Afterward, the coordinate
- transformation matrix is reset.
+Unlike coordinate transformations, canvas transformations are local to the
+current |{pgfscope}|, not to the current \TeX\ group. This is due to the fact
+that they are managed by the backend driver, not by \TeX\ or \pgfname.
- The effect of this command is to ``synchronize'' the coordinate
- transformation matrix and the canvas transformation matrix. All
- transformations that were previously applied by the coordinate
- transformations matrix are now applied by the canvas transformation
- matrix.
+Unlike the coordinate transformation matrix, it is not possible to ``reset''
+the canvas transformation matrix. The only way to change it is to concatenate
+it with another canvas transformation matrix or to end the current
+|{pgfscope}|.
+Unlike coordinate transformations, \pgfname\ does not ``keep track'' of canvas
+transformations. In particular, it will not be able to correctly save the
+coordinates of shapes or nodes when a canvas transformation is used.
+
+
+\subsubsection{Applying General Canvas Transformations}
+
+\pgfname\ does not offer many commands for modifying the canvas transformation
+matrix. Instead, different commands allow you to concatenate the canvas
+transformation matrix with a coordinate transformation matrix (and there are
+numerous commands for specifying a coordinate transformation, see the previous
+section).
+
+\begin{command}{\pgflowlevelsynccm}
+ This command concatenates the canvas transformation matrix with the current
+ coordinate transformation matrix. Afterward, the coordinate transformation
+ matrix is reset.
+
+ The effect of this command is to ``synchronize'' the coordinate
+ transformation matrix and the canvas transformation matrix. All
+ transformations that were previously applied by the coordinate
+ transformations matrix are now applied by the canvas transformation matrix.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -633,13 +637,13 @@ a coordinate transformation, see the previous section).
\draw[red] (0,0) -- (0.4,.2);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgflowlevel\marg{transformation code}}
- This command concatenates the canvas transformation matrix with the
- coordinate transformation specified by \meta{transformation code}.
-
+ This command concatenates the canvas transformation matrix with the
+ coordinate transformation specified by \meta{transformation code}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -648,14 +652,14 @@ a coordinate transformation, see the previous section).
\draw (0,0) -- (0.4,.2);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgflowlevelobj\marg{transformation code}\marg{code}}
- This command creates a local |{pgfscope}|. Inside this scope,
- |\pgflowlevel| is first called with the argument
- \meta{transformation code}, then the \meta{code} is inserted.
-
+ This command creates a local |{pgfscope}|. Inside this scope,
+ |\pgflowlevel| is first called with the argument \meta{transformation
+ code}, then the \meta{code} is inserted.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -664,14 +668,14 @@ a coordinate transformation, see the previous section).
\pgflowlevelobj{\pgftransformxshift{-1cm}}{\draw (0,0) -- (0.4,.2);}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{environment}{{pgflowlevelscope}\marg{transformation code}}
- This environment first surrounds the \meta{environment contents} by
- a |{pgfscope}|. Then it calls |\pgflowlevel| with the argument
- \meta{transformation code}.
-
+ This environment first surrounds the \meta{environment contents} by a
+ |{pgfscope}|. Then it calls |\pgflowlevel| with the argument
+ \meta{transformation code}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -684,63 +688,119 @@ a coordinate transformation, see the previous section).
\end{pgflowlevelscope}
\end{tikzpicture}
\end{codeexample}
+ %
\end{environment}
-
\begin{plainenvironment}{{pgflowlevelscope}\marg{transformation code}}
- Plain \TeX\ version of the environment.
+ Plain \TeX\ version of the environment.
\end{plainenvironment}
\begin{contextenvironment}{{pgflowlevelscope}\marg{transformation code}}
- Con\TeX t version of the environment.
+ Con\TeX t version of the environment.
+\end{contextenvironment}
+
+
+\subsubsection{Establishing View Boxes}
+\label{section-base-view}
+
+A \emph{view box} is like a ``window'' through which you see a graphic. To
+establish a view box, you specify a rectangle -- which is the window -- and
+another rectangle surrounding the to-be-viewed graphic. The graphic will then
+be rescaled and shifted in such a way that the to-be-viewed rectangle matches
+the view box's rectangle as well as possible. Note that establishing a view box
+does, indeed, cause a canvas transformation to be installed.
+
+View boxes are only seldom needed in normal graphics. Their main application is
+with animations since you can \emph{animate} the to-be-viewed rectangle. This
+makes it easy to create animations in which you zoom in, zoom out, and pan a
+graphic.
+
+\begin{environment}{{pgfviewboxscope}\marg{$ll_1$}\marg{$ur_1$}\marg{$ll_2$}\marg{$ur_2$}\marg{meet or slice}}
+ Inside the viewbox scope, the source rectangle (with the two \pgfname\
+ points $ll_1$ and $ur_1$ as corners) will be translated and scaled so that
+ it becomes centered on the target rectangle (with the corners $ll_2$ and
+ $ur_2$) and will, for |meet| as last parameter, be as large as possible so
+ that it fits inside the target and, for |slice|, be as small as possible so
+ that it encompasses the target.
+ %
+\begin{codeexample}[]
+\tikz {
+ \draw [red, very thick] (0,0) rectangle (20mm,20mm);
+ \begin{pgfviewboxscope}
+ {\pgfpoint{5mm}{5mm}}{\pgfpoint{25mm}{15mm}} % Source
+ {\pgfpoint{0mm}{0mm}}{\pgfpoint{20mm}{20mm}} % Target
+ {meet}
+ \draw [blue, very thick] (5mm,5mm) rectangle (25mm,15mm);
+ \draw [thick] (1,1) circle [radius=8mm] node {Hi};
+ \end{pgfviewboxscope} }
+\end{codeexample}
+ %
+\begin{codeexample}[]
+\tikz {
+ \draw [red, very thick] (0,0) rectangle (20mm,20mm);
+ \begin{pgfviewboxscope}
+ {\pgfpoint{5mm}{5mm}}{\pgfpoint{25mm}{15mm}} % Source
+ {\pgfpoint{0mm}{0mm}}{\pgfpoint{20mm}{20mm}} % Target
+ {slice}
+ \draw [blue, very thick] (5mm,5mm) rectangle (25mm,15mm);
+ \draw [thick] (1,1) circle [radius=8mm] node {Hi};
+ \end{pgfviewboxscope} }
+\end{codeexample}
+ %
+\end{environment}
+
+\begin{plainenvironment}{{pgfviewboxscope}\marg{$ll_1$}\marg{$ur_1$}\marg{$ll_2$}\marg{$ur_2$}\marg{meet or slice}}
+ Plain \TeX\ version of the environment.
+\end{plainenvironment}
+
+\begin{contextenvironment}{{pgfviewboxscope}\marg{$ll_1$}\marg{$ur_1$}\marg{$ll_2$}\marg{$ur_2$}\marg{meet or slice}}
+ Con\TeX t version of the environment.
\end{contextenvironment}
\subsection{Nonlinear Transformations}
\label{section-nonlinear-transformations}
-In order to use nonlinear transformations, you first have to load the
-following \pgfname\ module:
+
+In order to use nonlinear transformations, you first have to load the following
+\pgfname\ module:
\begin{pgfmodule}{nonlineartransformations}
- Loads the necessary functionality for nonlinear transformations.
+ Loads the necessary functionality for nonlinear transformations.
\end{pgfmodule}
\subsubsection{Introduction}
The difference between the coordinate transformations introduced in
-Section~\ref{section-linear-coordinate-transformations} above to
-nonlinear transformations is, of course, that the transformations can
-be nonlinear. An example of a nonlinear transformation is the
-transformation underlying polar coordinates: A polar coordinate
-$(r,d)$ gets transformed to the canvas position $(d\cos r,d\sin r)$,
-which is clearly not a linear transformation.
-
-Nonlinear transformations work somewhat like the normal linear
-coordinate transformations in the sense that they apply to coordinate
-and thereby to the construction of paths, but not to things like text
-or line width or shadings. (Indeed, it is not possible to apply
-nonlinear transformations to, say, text.)
-
-This means that there is a fundamental
-difference between, on the one hand, calling a function like
-|\pgfpointpolar| or specifying a coordinate as |(45:2)| in \tikzname\
-and, on the other hand, installing the nonlinear transformation
+Section~\ref{section-linear-coordinate-transformations} above to nonlinear
+transformations is, of course, that the transformations can be nonlinear. An
+example of a nonlinear transformation is the transformation underlying polar
+coordinates: A polar coordinate $(r,d)$ gets transformed to the canvas position
+$(d\cos r,d\sin r)$, which is clearly not a linear transformation.
+
+Nonlinear transformations work somewhat like the normal linear coordinate
+transformations in the sense that they apply to coordinate and thereby to the
+construction of paths, but not to things like text or line width or shadings.
+(Indeed, it is not possible to apply nonlinear transformations to, say, text.)
+
+This means that there is a fundamental difference between, on the one hand,
+calling a function like |\pgfpointpolar| or specifying a coordinate as |(45:2)|
+in \tikzname\ and, on the other hand, installing the nonlinear transformation
``polar coordinates'' using the command |\pgftransformnonlinear|: In a
-coordinate like |(45:2)| the user explicitly says ``please evaluate
-this one coordinate in polar coordinate and then continue in the
-normal coordinate system with the result.'' Otherwise nothing changes
-and a line between two points specified in this way is still a
-straight line.
-
-Things are quite different when we install a polar
-\emph{transformation} using |\pgftransformnonlinear|. Now, even a
-seemingly low-level Cartesian coordinate |\pgfqpoint{1pt}{1pt}| will
-get transformed. Even more drastically, what is specified as a
-straight line like
+coordinate like |(45:2)| the user explicitly says ``please evaluate this one
+coordinate in polar coordinate and then continue in the normal coordinate
+system with the result''. Otherwise nothing changes and a line between two
+points specified in this way is still a straight line.
+
+Things are quite different when we install a polar \emph{transformation} using
+|\pgftransformnonlinear|. Now, even a seemingly low-level Cartesian coordinate
+|\pgfqpoint{1pt}{1pt}| will get transformed. Even more drastically, what is
+specified as a straight line like
+%
\begin{codeexample}[code only]
\draw (0,1) -- (1,1);
\end{codeexample}
+%
can become curved since \emph{everything} gets transformed.
@@ -759,19 +819,19 @@ can become curved since \emph{everything} gets transformed.
\makeatother
\begin{command}{\pgftransformnonlinear\marg{transformation code}}
- This command adds the \meta{transformation code} to the list of non-linear
- transformations currently in force. Thus, similar to linear
- coordinate transformations, each additional call to this function
- adds another transformation to the current \TeX\ scope and the
- effect ends at the end of the current scope. In practice, however,
- you typically will not have more than one active nonlinear
- transformation.
-
- The job of the \meta{transformation code} is to map a point~$p$
- given in the registers |\pgf@x| and |\pgf@y| to a new
- coordinate~$f(p)$, which should be returned in |\pgf@x| and |\pgf@y|
- as well. As an example, suppose we wish to install polar coordinates
- as the nonlinear transformation. For this, we need a bit of code:
+ This command adds the \meta{transformation code} to the list of non-linear
+ transformations currently in force. Thus, similar to linear coordinate
+ transformations, each additional call to this function adds another
+ transformation to the current \TeX\ scope and the effect ends at the end of
+ the current scope. In practice, however, you typically will not have more
+ than one active nonlinear transformation.
+
+ The job of the \meta{transformation code} is to map a point~$p$ given in
+ the registers |\pgf@x| and |\pgf@y| to a new coordinate~$f(p)$, which
+ should be returned in |\pgf@x| and |\pgf@y| as well. As an example, suppose
+ we wish to install polar coordinates as the nonlinear transformation. For
+ this, we need a bit of code:
+ %
\begin{codeexample}[code only]
\def\polartransformation{%
% \pgf@x will contain the radius
@@ -783,70 +843,71 @@ can become curved since \emph{everything} gets transformed.
\pgf@y=\pgfmathresulty\pgf@y%
}
\end{codeexample}
- (In case you wonder why you cannot just call |\pgfpointpolar| at
- this point: You can, but this function internally uses |\pgf@x|
- and |\pgf@y| in complicated ways, so you would first have to safe
- them so some other registers. Also, the above is faster.)
-
- If we were to call this function again, we would get something funny
- like ``polar-polar coordinates,'' so let's not do this. Let us
- instead have a look at the effect this call has: Once a nonlinear
- transformation is installed, all subsequent path constructions are
- affected by this transformation. In particular, a normal grid now
- becomes the typical ``polar grid.''
-
+ %
+ (In case you wonder why you cannot just call |\pgfpointpolar| at this
+ point: You can, but this function internally uses |\pgf@x| and |\pgf@y| in
+ complicated ways, so you would first have to safe them so some other
+ registers. Also, the above is faster.)
+
+ If we were to call this function again, we would get something funny like
+ ``polar-polar coordinates'', so let's not do this. Let us instead have a
+ look at the effect this call has: Once a nonlinear transformation is
+ installed, all subsequent path constructions are affected by this
+ transformation. In particular, a normal grid now becomes the typical
+ ``polar grid''.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
% Start nonlinear transformation
\pgftransformnonlinear{\polartransformation}% see above
-
+
% Draw something with this transformation in force
\draw (0pt,0mm) grid [xstep=10pt, ystep=5mm] (90pt, 20mm);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\subsubsection{Applying Nonlinear Transformations to Points}
\begin{command}{\pgfpointtransformednonlinear\marg{point}}
- Works like |\pgfpointtransformed|, but also applies the current
- nonlinear transformation; that is, it first applies the current
- linear transformation and then the current nonlinear
- transformations. Note that, just like |\pgfpointtransformed|, you
- normally do not call this function directly since it is called
- internally by the path drawing commands.
+ Works like |\pgfpointtransformed|, but also applies the current nonlinear
+ transformation; that is, it first applies the current linear transformation
+ and then the current nonlinear transformations. Note that, just like
+ |\pgfpointtransformed|, you normally do not call this function directly
+ since it is called internally by the path drawing commands.
\end{command}
\subsubsection{Applying Nonlinear Transformations to Paths}
-When a nonlinear transformation is installed, the normal path
-construction commands like |\pgfpathmoveto| get adjusted so that the
-``honour'' the nonlinear transformations currently in force. For
-|\pgfpathmoveto| this is pretty simple: Instead of just applying the
-linear transformation matrix to the point to which the path should
-``jump'' next, we also apply the nonlinear transformation. However,
-for a command like |\pgfpathlineto|, things are much more difficult:
-A straight line will no longer be a straight line!
-
-In order to make straight lines ``bend'', the following changes are in
-force while a nonlinear transformation is installed:
+When a nonlinear transformation is installed, the normal path construction
+commands like |\pgfpathmoveto| get adjusted so that the ``honour'' the
+nonlinear transformations currently in force. For |\pgfpathmoveto| this is
+pretty simple: Instead of just applying the linear transformation matrix to the
+point to which the path should ``jump'' next, we also apply the nonlinear
+transformation. However, for a command like |\pgfpathlineto|, things are much
+more difficult: A straight line will no longer be a straight line!
+In order to make straight lines ``bend'', the following changes are in force
+while a nonlinear transformation is installed:
+%
\begin{enumerate}
-\item Whenever a straight line between two points $p$ and $q$ should
- be added to the path, either through |\pgfpathlineto| or through
- |\pgfpathclose|, we replace this straight line by a ``degenerated
- curve'' from $p$ to $q$ whose control points are at one third and
- two third of the distance between $p$ and $q$ on the line between
- $p$ and $q$. In this way, while nonlinear transformations are in
- force, we only need to transform curves.
-\item Next, suppose we wish to transform a curve from $p$ to $q$ with
- supports $s$ and $t$. For this, we simply apply the nonlinear
- transformation $f$ to all four points and draw a line with the
- results. Note that this mapping is actually not quite satisfactory
- for long lines that are strongly curved:
+ \item Whenever a straight line between two points $p$ and $q$ should be
+ added to the path, either through |\pgfpathlineto| or through
+ |\pgfpathclose|, we replace this straight line by a ``degenerated
+ curve'' from $p$ to $q$ whose control points are at one third and two
+ third of the distance between $p$ and $q$ on the line between $p$ and
+ $q$. In this way, while nonlinear transformations are in force, we only
+ need to transform curves.
+ \item Next, suppose we wish to transform a curve from $p$ to $q$ with
+ supports $s$ and $t$. For this, we simply apply the nonlinear
+ transformation $f$ to all four points and draw a line with the results.
+ Note that this mapping is actually not quite satisfactory for long
+ lines that are strongly curved:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -856,28 +917,29 @@ force while a nonlinear transformation is installed:
\draw [red] (0,20mm) -- (90pt,20mm);
}
% Here is the curve with controls just transformed:
- \draw (0:20mm) .. controls (30pt:20mm) and (60pt:20mm) .. (90pt:20mm);
+ \draw (0:20mm) .. controls (30pt:20mm) and (60pt:20mm) .. (90pt:20mm);
\end{tikzpicture}
\end{codeexample}
- As the example shows, the control points now lie on the arc; but in
- reality they should point along the tangents at the start and the
- end. This is exactly when \pgfname\ does through the computation
- described above.
-\item
- To overcome the effect of the control points being ``off,'' it is
- necessary to split up longer curves into smaller parts, which are
- drawn individually to increase the accuracy. When such splitting
- occurs, can be configured using the following command:
- \begin{command}{\pgfsettransformnonlinearflatness\marg{dimension}
- (initially 5pt)}
- Whenever in a to-be-drawn curve the $L^\infty$-distance (maximum
- of the distances in $x$- and $y$-directions) between the start of
- a curve and its first control point or between the first and
- second control points or between the second control point and the
- end is more than \meta{distance}, the curve gets split in the
- middle (more precisely, at time $t= 0.5$) and we draw the two
- parts individually (for them, splitting may occur again, if the
- curve is still too long).
+ %
+ As the example shows, the control points now lie on the arc; but in
+ reality they should point along the tangents at the start and the end.
+ This is exactly when \pgfname\ does through the computation described
+ above.
+ \item To overcome the effect of the control points being ``off'', it is
+ necessary to split up longer curves into smaller parts, which are drawn
+ individually to increase the accuracy. When such splitting occurs, can
+ be configured using the following command:
+ %
+ \begin{command}{\pgfsettransformnonlinearflatness\marg{dimension} (initially 5pt)}
+ Whenever in a to-be-drawn curve the $L^\infty$-distance (maximum of
+ the distances in $x$- and $y$-directions) between the start of a
+ curve and its first control point or between the first and second
+ control points or between the second control point and the end is
+ more than \meta{distance}, the curve gets split in the middle (more
+ precisely, at time $t= 0.5$) and we draw the two parts individually
+ (for them, splitting may occur again, if the curve is still too
+ long).
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -889,33 +951,31 @@ force while a nonlinear transformation is installed:
}
\end{tikzpicture}
\end{codeexample}
- \end{command}
+ \end{command}
\end{enumerate}
\subsubsection{Applying Nonlinear Transformations to Text}
-Earlier, it was pointed that nonlinear transformations do not apply
-to text. Nevertheless, when you use |\pgftext| or |\pgfnode|,
-\pgfname\ will do a sort of ``best effort'' to render the text in
-the nonlinear coordinate system: The point where the text should be
-shown can obviously be computed easily. When then temporarily reset
-the nonlinear transformation and, instead, setup a linear
-transformation that matches the nonlinear transformation at the
-point where the text should be. Then, the text is shown. This means
-that if the text is longer, it will not ``follow'' the nonlinear
-transformation, but near the origin of the text it will look
-``correct.'' As an example, let us add some text at the grid point
-of the above example:
-
+Earlier, it was pointed that nonlinear transformations do not apply to text.
+Nevertheless, when you use |\pgftext| or |\pgfnode|, \pgfname\ will do a sort
+of ``best effort'' to render the text in the nonlinear coordinate system: The
+point where the text should be shown can obviously be computed easily. When
+then temporarily reset the nonlinear transformation and, instead, setup a
+linear transformation that matches the nonlinear transformation at the point
+where the text should be. Then, the text is shown. This means that if the text
+is longer, it will not ``follow'' the nonlinear transformation, but near the
+origin of the text it will look ``correct''. As an example, let us add some
+text at the grid point of the above example:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
\pgftransformnonlinear{\polartransformation}% see above
-
+
% Draw something with this transformation in force
\draw (0pt,0mm) grid [xstep=10pt, ystep=5mm] (90pt, 20mm);
-
+
\foreach \angle in {0,30,60,90}
\foreach \dist in {1,2}
{
@@ -928,22 +988,23 @@ of the above example:
\subsubsection{Approximating Nonlinear Transformations Using Linear Transformations}
-At any given point, the current nonlinear transformation can be
-approximated using a linear transformation. The following two
-functions allow you to install such a local approximation:
+At any given point, the current nonlinear transformation can be approximated
+using a linear transformation. The following two functions allow you to install
+such a local approximation:
\begin{command}{\pgfapproximatenonlineartransformation}
- This command will do two things:
- \begin{enumerate}
- \item It clears the nonlinear transformations for the rest of the
- current \TeX\ scope, so only linear transformations apply.
- \item However, before removing the nonlinear transformations, the
- linear transformation matrix is modified so that it mimics the
- effect the nonlinear transformation had at the origin. That is,
- after you call this command, drawing something near the origin
- will look almost the same as if you had not called it.
- \end{enumerate}
-
+ This command will do two things:
+ %
+ \begin{enumerate}
+ \item It clears the nonlinear transformations for the rest of the
+ current \TeX\ scope, so only linear transformations apply.
+ \item However, before removing the nonlinear transformations, the
+ linear transformation matrix is modified so that it mimics the
+ effect the nonlinear transformation had at the origin. That is,
+ after you call this command, drawing something near the origin will
+ look almost the same as if you had not called it.
+ \end{enumerate}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -952,27 +1013,28 @@ functions allow you to install such a local approximation:
\begin{scope}[shift={(45pt,20mm)}]
% Draw something near "origin":
- \draw [red] (-10pt,-10pt) -- (10pt,10pt);
+ \draw [red] (-10pt,-10pt) -- (10pt,10pt);
\draw [red] (10pt,-10pt) -- (-10pt,10pt);
% Now draw the same, but in the "approximate" coordinate system:
\pgfapproximatenonlineartransformation
- \draw [] (-10pt,-10pt) -- (10pt,10pt);
+ \draw [] (-10pt,-10pt) -- (10pt,10pt);
\draw [] (10pt,-10pt) -- (-10pt,10pt);
\pgftext{foo};
\end{scope}
\end{tikzpicture}
-\end{codeexample}
- This command is used by |\pgftext| and |\pgfnode| to transform text
- when a nonlinear transformation is in force.
+\end{codeexample}
+ %
+ This command is used by |\pgftext| and |\pgfnode| to transform text when a
+ nonlinear transformation is in force.
\end{command}
\begin{command}{\pgfapproximatenonlineartranslation}
- This command works like the normal approximation command, but it
- will only approximate how the origin gets translated, it will not
- approximate the rotation, skewing, or scaling that is involved. This
- is useful for drawing text at the right position, but without
- ``mutilating'' the text.
+ This command works like the normal approximation command, but it will only
+ approximate how the origin gets translated, it will not approximate the
+ rotation, skewing, or scaling that is involved. This is useful for drawing
+ text at the right position, but without ``mutilating'' the text.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -981,17 +1043,18 @@ functions allow you to install such a local approximation:
\begin{scope}[shift={(45pt,20mm)}]
% Draw something near "origin":
- \draw [red] (-10pt,-10pt) -- (10pt,10pt);
+ \draw [red] (-10pt,-10pt) -- (10pt,10pt);
\draw [red] (10pt,-10pt) -- (-10pt,10pt);
% Now draw the same, but in the "approximate" coordinate system:
\pgfapproximatenonlineartranslation
- \draw [] (-10pt,-10pt) -- (10pt,10pt);
+ \draw [] (-10pt,-10pt) -- (10pt,10pt);
\draw [] (10pt,-10pt) -- (-10pt,10pt);
\pgftext{foo};
\end{scope}
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
+ %
\end{command}
@@ -999,27 +1062,26 @@ functions allow you to install such a local approximation:
\label{section-library-curvilinear}
\begin{pgflibrary}{curvilinear}
- This library defines commands for computing nonlinear
- transformations ``along B\'ezier curves''.
+ This library defines commands for computing nonlinear transformations
+ ``along Bézier curves''.
\end{pgflibrary}
-Up to now, our running example for a nonlinear transformation was
-polar transformation. However, is \pgfname\ nonlinear transformations
-are \emph{actually} mainly used for transforming arrow tips; and these
-need to be transformed ``along curves.'' The |curvilinear| library
-defines a number of commands that offer the necessary computations for
-such transformations.
-
-\begin{command}{\pgfsetcurvilinearbeziercurve\marg{start}\marg{first
- support}\marg{second support}\marg{end}}
- Prior to using any other command from this library, you first call
- this function to ``install'' a B\'ezier curve to which the commands
- will refer. This curve will be local to the current \TeX\ scope and
- you can install only one curve at a time.
-
- The main job of this command is to store the passed points
- internally and to build a lookup table for distance-to-time
- conversions, see the next command.
+Up to now, our running example for a nonlinear transformation was polar
+transformation. However, is \pgfname\ nonlinear transformations are
+\emph{actually} mainly used for transforming arrow tips; and these need to be
+transformed ``along curves''. The |curvilinear| library defines a number of
+commands that offer the necessary computations for such transformations.
+
+\begin{command}{\pgfsetcurvilinearbeziercurve\marg{start}\marg{first support}\marg{second support}\marg{end}}
+ Prior to using any other command from this library, you first call this
+ function to ``install'' a Bézier curve to which the commands will refer.
+ This curve will be local to the current \TeX\ scope and you can install
+ only one curve at a time.
+
+ The main job of this command is to store the passed points internally and
+ to build a lookup table for distance-to-time conversions, see the next
+ command.
+ %
\begin{codeexample}[code only]
\pgfsetcurvilinearbeziercurve
{\pgfpointorigin}
@@ -1027,33 +1089,34 @@ such transformations.
{\pgfpoint{2cm}{1cm}}
{\pgfpoint{3cm}{0cm}}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfcurvilineardistancetotime\marg{distance}}
- This command does a ``distance-to-time-conversion'': It tries to
- compute a time $t$, returned in |\pgf@x|, that corresponds to
- travelling \meta{distance} along the curve that has last been
- installed using the command |\pgfsetcurvilinearbeziercurve|. The distance-to-time-conversion
- uses the precomputations done by that command. Note that several
- compromises had to be made between speed and accuracy:
- \begin{itemize}
- \item The conversion will be best near the start of the curve.
- \item The more ``degenerate'' the curve, the worse the results.
- \end{itemize}
+ This command does a ``distance-to-time-conversion'': It tries to compute a
+ time $t$, returned in |\pgf@x|, that corresponds to travelling
+ \meta{distance} along the curve that has last been installed using the
+ command |\pgfsetcurvilinearbeziercurve|. The distance-to-time-conversion
+ uses the precomputations done by that command. Note that several
+ compromises had to be made between speed and accuracy:
+ %
+ \begin{itemize}
+ \item The conversion will be best near the start of the curve.
+ \item The more ``degenerate'' the curve, the worse the results.
+ \end{itemize}
\end{command}
-
\begin{command}{\pgfpointcurvilinearbezierorthogonal\marg{distance}\marg{offset}}
- This command computes the following point: Consider the curve
- last installed using the command |\pgfsetcurvilinearbeziercurve|. We
- travel along this curve by \meta{distance}, arriving at a point
- $p$. Then, we turn by $90^\circ$ and travel by \meta{offset} units
- ``aways from the curve,'' arriving at a point $q$. This point $q$
- will now be returned in |\pgf@x| and |\pgf@y|; furthermore, the
- transformed local coordinate system at point $q$ will also be
- returned |\pgf@xa| and the other registers, see
- |\pgftransformnonlinear| for details.
- \makeatletter
+ This command computes the following point: Consider the curve last
+ installed using the command |\pgfsetcurvilinearbeziercurve|. We travel
+ along this curve by \meta{distance}, arriving at a point $p$. Then, we turn
+ by $90^\circ$ and travel by \meta{offset} units ``always from the curve'',
+ arriving at a point $q$. This point $q$ will now be returned in |\pgf@x|
+ and |\pgf@y|; furthermore, the transformed local coordinate system at point
+ $q$ will also be returned |\pgf@xa| and the other registers, see
+ |\pgftransformnonlinear| for details.
+ %
+\makeatletter
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -1087,27 +1150,27 @@ such transformations.
(0mm,20mm) .. controls (10mm,20mm) and (10mm,10mm) .. (20mm,10mm);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgfpointcurvilinearbezierpolar\marg{x}\marg{y}}
- This command is similar to the previous version, but the
- transformation is different: The idea is that a line form $(0,0)$ to
- $(x,0)$ gets transformed to the curve from the start of the curve to
- a point at distance $x$ along the curve. This is identical to what
- the ``orthogonal'' transformation above also does. The difference is
- that a line from $(0,0)$ to $(0,y)$ gets still transformed to an
- initial segment of the curve of a length of $y$, but now rotated by
- $90^\circ$. In general, the point $p = (x,y)$ gets transferred to a
- point that at distance $|p| = \sqrt{x^2+y^2}$ along the curve, but
- rotated by the angle of $p$ relative to the $x$-axis.
-
- All of these computations mainly have the following effect: Two
- straight lines from the start of the curve as in a |Straight Barb|
- arrow tip get transformed to an initial segment of the curve whose
- length is the length of the two lines, but this segment gets rotated
- by the angle of the two lines.
- \makeatletter
+ This command is similar to the previous version, but the transformation is
+ different: The idea is that a line form $(0,0)$ to $(x,0)$ gets transformed
+ to the curve from the start of the curve to a point at distance $x$ along
+ the curve. This is identical to what the ``orthogonal'' transformation
+ above also does. The difference is that a line from $(0,0)$ to $(0,y)$ gets
+ still transformed to an initial segment of the curve of a length of $y$,
+ but now rotated by $90^\circ$. In general, the point $p = (x,y)$ gets
+ transferred to a point that at distance $|p| = \sqrt{x^2+y^2}$ along the
+ curve, but rotated by the angle of $p$ relative to the $x$-axis.
+
+ All of these computations mainly have the following effect: Two straight
+ lines from the start of the curve as in a |Straight Barb| arrow tip get
+ transformed to an initial segment of the curve whose length is the length
+ of the two lines, but this segment gets rotated by the angle of the two
+ lines.
+ %
+\makeatletter
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -1145,13 +1208,14 @@ such transformations.
(0mm,20mm) .. controls (10mm,20mm) and (10mm,10mm) .. (20mm,10mm);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-%%% Local Variables:
+%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
-%%% End:
+%%% End:
% LocalWords: nonlineartransformations PGF cx dy pdf PostScript pgfscope xstep
% LocalWords: Reinstalls shiftx backend pgflowlevelscope ystep ezier lookup xa
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 1243597df54..fda8f6a8872 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
@@ -9,12 +9,10 @@
\section{Transparency}
-
\label{section-transparency}
-
-For an introduction to the notion of transparency, fadings, and
-transparency groups, please consult Section~\ref{section-tikz-transparency}.
+For an introduction to the notion of transparency, fadings, and transparency
+groups, please consult Section~\ref{section-tikz-transparency}.
\subsection{Specifying a Uniform Opacity}
@@ -22,11 +20,11 @@ transparency groups, please consult Section~\ref{section-tikz-transparency}.
Specifying a stroke and/or fill opacity is quite easy.
\begin{command}{\pgfsetstrokeopacity\marg{value}}
- Sets the opacity of stroking operations. The \meta{value} should be
- 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.
-
+ Sets the opacity of stroking operations. The \meta{value} should be 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}
@@ -37,15 +35,15 @@ Specifying a stroke and/or fill opacity is quite easy.
\pgfpathcircle{\pgfpoint{1cm}{0cm}}{10mm} \pgfusepath{stroke}
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgfsetfillopacity\marg{value}}
- 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.
+ 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\pgfsetfillopacity{0.5}
@@ -54,12 +52,12 @@ Specifying a stroke and/or fill opacity is quite easy.
\fill[blue] (-30:1cm) circle (11mm);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-Note the following effect: If you set up a certain opacity for stroking
-or filling and you stroke or fill the same area twice, the effect
-accumulates:
-
+Note the following effect: If you set up a certain opacity for stroking or
+filling and you stroke or fill the same area twice, the effect accumulates:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\pgfsetfillopacity{0.5}
@@ -77,52 +75,49 @@ transparency groups, see the end of this section, to change this.
To set the blend mode, use the following command:
\begin{command}{\pgfsetblendmode\marg{mode}}
- Sets the blend mode to one of the values described in
- Section~\ref{section-blend-modes}. As described there, blend modes
- are an advanced feature of \textsc{pdf} and not always rendered
- correctly.
-
-
+ Sets the blend mode to one of the values described in
+ Section~\ref{section-blend-modes}. As described there, blend modes are an
+ advanced feature of \textsc{pdf} and not always rendered correctly.
+ %
\begin{codeexample}[]
\tikz [transparency group] {
\pgfsetblendmode{screen}
-
+
\fill[red!90!black] ( 90:.6) circle (1);
\fill[green!80!black] (210:.6) circle (1);
\fill[blue!90!black] (330:.6) circle (1);
}
\end{codeexample}
+ %
\end{command}
\subsection{Specifying a Fading}
-The method used by \pgfname\ for specifying fadings is quite
-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 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
-opacity of the fading at that position. Positions in the fading where
-the picture was black will be completely transparent, positions where
-the picture was white will be completely opaque. Positions that have
-not been painted at all in the picture are always completely
-transparent.
-
+The method used by \pgfname\ for specifying fadings is quite 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 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 opacity of the fading at that position. Positions in the fading
+where the picture was black will be completely transparent, positions where the
+picture was white will be completely opaque. Positions that have not been
+painted at all in the picture are always completely transparent.
\begin{command}{\pgfdeclarefading\marg{name}\marg{contents}}
- This command declares a fading named \meta{name} for later use. The
- ``picture'' on which the fading is based is given by the
- \meta{contents}. The \meta{contents} are normally typeset in a \TeX\
- box. The resulting box is then used as the ``picture.'' In
- particular, inside the \meta{contents} you must explicitly open a
- |{pgfpicture}| environment if you wish to use \pgfname\ commands.
-
- Let's start with an easy example. Our first fading picture is just
- some text:
+ This command declares a fading named \meta{name} for later use. The
+ ``picture'' on which the fading is based is given by the \meta{contents}.
+ The \meta{contents} are normally typeset in a \TeX\ box. The resulting box
+ is then used as the ``picture''. In particular, inside the \meta{contents}
+ you must explicitly open a |{pgfpicture}| environment if you wish to use
+ \pgfname\ commands.
+
+ 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}
\begin{tikzpicture}
@@ -132,32 +127,31 @@ transparent.
\fill [red] (0,0) rectangle (2,2);
\end{tikzpicture}
\end{codeexample}
- What's happening here? The ``fading picture'' is mostly transparent,
- except for the pixels that are part of the word Ti\emph{k}Z. Now,
- these pixels are \emph{white} and, thus, have a high
- luminosity. This in turn means that these pixels of the fading will
- be highly opaque. For this reason, only those pixels of the big red
- rectangle ``shine through'' that are at the positions of these
- opaque pixels.
-
- It is somewhat counter-intuitive that the white pixels in a fading
- picture are opaque in a fading. For this reason, the color
- |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 like |pgftransparent!20| for parts that are 20\%
- transparent.
-
- Furthermore, the color |pgftransparent!0| (which is the same as
- white and which corresponds to completely opaque) is installed at
- the beginning of a fading picture. Thus, in the above example the
- |\color{white}| was not really necessary.
-
- Next, let us create a fading that gets more and more transparent as
- 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.
+ %
+ What's happening here? The ``fading picture'' is mostly transparent, except
+ for the pixels that are part of the word Ti\emph{k}Z. Now, these pixels are
+ \emph{white} and, thus, have a high luminosity. This in turn means that
+ these pixels of the fading will be highly opaque. For this reason, only
+ those pixels of the big red rectangle ``shine through'' that are at the
+ positions of these opaque pixels.
+
+ It is somewhat counter-intuitive that the white pixels in a fading picture
+ are opaque in a fading. For this reason, the color |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 like |pgftransparent!20|
+ for parts that are 20\% transparent.
+
+ Furthermore, the color |pgftransparent!0| (which is the same as white and
+ which corresponds to completely opaque) is installed at the beginning of a
+ fading picture. Thus, in the above example the |\color{white}| was not
+ really necessary.
+
+ Next, let us create a fading that gets more and more transparent as 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.
+ %
\begin{codeexample}[]
\pgfdeclarefading{fading2}
{\tikz \shade[left color=pgftransparent!0,
@@ -170,8 +164,8 @@ transparent.
\end{tikzpicture}
\end{codeexample}
- In our final example, we create a fading that is based on a radial
- shading.
+ In our final example, we create a fading that is based on a radial shading.
+ %
\begin{codeexample}[]
\pgfdeclareradialshading{myshading}{\pgfpointorigin}
{
@@ -188,29 +182,30 @@ transparent.
\fill [red] (0,0) rectangle (2,2);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-After having declared a fading, we can use it. As for shadings, there
-are different commands for using fadings:
+After having declared a fading, we can use it. As for shadings, there are
+different commands for using fadings:
\begin{command}{\pgfsetfading\marg{name}\marg{transformations}}
- This command sets the graphic state parameter ``fading'' to a
- previously defined fading \meta{name}. This graphic state works like
- other graphic states, that is, is persists till the end of the
- current scope or until a different transparency setting is chosen.
-
- When the fading is installed, it will be centered on the origin with
- its natural size. Anything outside the fading picture's original
- bounding box will be transparent and, thus, the fading effectively
- clips against this bounding box.
-
- The \meta{transformations} are applied to the fading before it is
- used. They contain normal \pgfname\ transformation commands like
- |\pgftransformshift|. You can also scale the fading using this
- command. Note, however, that the transformation needs to be inverted
- internally, which may result in inaccuracies and the following
- graphics may be slightly distorted if you use a strong
- \meta{transformation}.
+ This command sets the graphic state parameter ``fading'' to a previously
+ defined fading \meta{name}. This graphic state works like other graphic
+ states, that is, is persists till the end of the current scope or until a
+ different transparency setting is chosen.
+
+ When the fading is installed, it will be centered on the origin with its
+ natural size. Anything outside the fading picture's original bounding box
+ will be transparent and, thus, the fading effectively clips against this
+ bounding box.
+
+ The \meta{transformations} are applied to the fading before it is used.
+ They contain normal \pgfname\ transformation commands like
+ |\pgftransformshift|. You can also scale the fading using this command.
+ Note, however, that the transformation needs to be inverted internally,
+ which may result in inaccuracies and the following graphics may be slightly
+ distorted if you use a strong \meta{transformation}.
+ %
\begin{codeexample}[]
\pgfdeclarefading{fading2}
{\tikz \shade[left color=pgftransparent!0,
@@ -222,6 +217,7 @@ are different commands for using fadings:
\fill [red] (0,0) rectangle (2,2);
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\fill [black!20] (0,0) rectangle (2,2);
@@ -231,28 +227,29 @@ are different commands for using fadings:
\fill [red] (0,0) rectangle (2,2);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfsetfadingforcurrentpath\marg{name}\marg{transformations}}
- This command works like |\pgfsetfading|, but the fading is scaled
- and transformed according to the following rules:
- \begin{enumerate}
- \item
- If the current path is empty, the command has the same effect as
- |\pgfsetfading|.
- \item
- Otherwise it is assumed that the fading has a size of 100bp times
- 100bp.
- \item
- 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})$
- lies at the upper-right corner of the current path.
- \end{enumerate}
- Note that these rules are the same as the ones used in
- |\pgfshadepath| for shadings. After these transformations, the
- \meta{transformations} are executed (typically a rotation).
+ This command works like |\pgfsetfading|, but the fading is scaled and
+ transformed according to the following rules:
+ %
+ \begin{enumerate}
+ \item If the current path is empty, the command has the same effect as
+ |\pgfsetfading|.
+ \item Otherwise it is assumed that the fading has a size of 100bp times
+ 100bp.
+ \item 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})$
+ lies at the upper-right corner of the current path.
+ \end{enumerate}
+ %
+ Note that these rules are the same as the ones used in |\pgfshadepath| for
+ shadings. After these transformations, the \meta{transformations} are
+ executed (typically a rotation).
+ %
\begin{codeexample}[]
\pgfdeclarehorizontalshading{shading}{100bp}
{ color(0pt)=(transparent!0); color(25bp)=(transparent!0);
@@ -277,16 +274,16 @@ are different commands for using fadings:
\fill [red] (0,1) rectangle (2,2);
\end{tikzpicture}
\end{codeexample}
-
+ %
\end{command}
\begin{command}{\pgfsetfadingforcurrentpathstroked\marg{name}\marg{transformations}}
- This command works line |\pgfsetfadingforcurrentpath|, only the
- current path is enlarged by the line width in both $x$- and
- $y$-direction. This is exactly the enlargement necessary to
- compensate for the fact that if the current path will be stroked,
- this much needs to be added around the path's bounding box to
- actually contain the path.
+ This command works line |\pgfsetfadingforcurrentpath|, only the current
+ path is enlarged by the line width in both $x$- and $y$-direction. This is
+ exactly the enlargement necessary to compensate for the fact that if the
+ current path will be stroked, this much needs to be added around the path's
+ bounding box to actually contain the path.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\pgfsetlinewidth{2mm}
@@ -296,58 +293,61 @@ are different commands for using fadings:
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
+
\subsection{Transparency Groups}
Transparency groups are declared using the following commands.
\begin{environment}{{pgftransparencygroup}\opt{\oarg{options}}}
- This environment should only be used inside a |{pgfpicture}|. It has
- the following effect:
- \begin{enumerate}
- \item The \meta{environment contents} are stroked/filled
- ``ignoring any outside transparency.'' This means, all previous
- transparency settings are ignored (you can still set transparency
- inside the group, but never mind). This means that if in the
- \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
- \emph{fill} transparency settings are now applied to the resulting
- 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.
- \end{enumerate}
-
- The optional \meta{options} are keys that configure the transparency
- group further. Two keys are currently defined:
- \begin{itemize}
- \item \declare{|knockout|\opt{|=|\meta{true or false}}} Configures
- whether the group is a knockout group (if no argument is given,
- |true| is assumed; initially the key is always false, even when
- the command is used in a nested manner.) See
- Section~\ref{section-transparency-groups} for details on knockout groups.
- \item \declare{|isolated|\opt{|=|\meta{true or false}}} Similar, but
- configures whether the group is an isolated group. Also see
- Section~\ref{section-transparency-groups} for details on isolated groups.
- \end{itemize}
-
- Note that, depending on the driver, \pgfname\ may have to guess the
- size of the contents of the transparency group (because such a group
- is put in an XForm in \textsc{pdf} and a bounding box must be
- supplied). \pgfname\ will use normally use the size of the picture's
- bounding box at the end of the transparency group plus a safety
- margin of 1cm. Under normal circumstances, this will work nicely
- 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 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:
-
+ This environment should only be used inside a |{pgfpicture}|. It has the
+ following effect:
+ %
+ \begin{enumerate}
+ \item The \meta{environment contents} are stroked/filled ``ignoring any
+ outside transparency''. This means, all previous transparency
+ settings are ignored (you can still set transparency inside the
+ group, but never mind). This means that if in the \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
+ \emph{fill} transparency settings are now applied to the resulting
+ 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.
+ \end{enumerate}
+
+ The optional \meta{options} are keys that configure the transparency group
+ further. Two keys are currently defined:
+ %
+ \begin{itemize}
+ \item \declare{|knockout|\opt{|=|\meta{true or false}}} Configures
+ whether the group is a knockout group (if no argument is given,
+ |true| is assumed; initially the key is always false, even when the
+ command is used in a nested manner.) See
+ Section~\ref{section-transparency-groups} for details on knockout
+ groups.
+ \item \declare{|isolated|\opt{|=|\meta{true or false}}} Similar, but
+ configures whether the group is an isolated group. Also see
+ Section~\ref{section-transparency-groups} for details on isolated
+ groups.
+ \end{itemize}
+
+ Note that, depending on the driver, \pgfname\ may have to guess the size of
+ the contents of the transparency group (because such a group is put in an
+ XForm in \textsc{pdf} and a bounding box must be supplied). \pgfname\ will
+ use normally use the size of the picture's bounding box at the end of the
+ transparency group plus a safety margin of 1cm. Under normal circumstances,
+ this will work nicely 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 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}[]
@@ -368,19 +368,16 @@ Transparency groups are declared using the following commands.
\end{codeexample}
}%
+ \begin{plainenvironment}{{pgftransparencygroup}}
+ Plain \TeX\ version of the |{pgftransparencygroup}| environment.
+ \end{plainenvironment}
-\begin{plainenvironment}{{pgftransparencygroup}}
- Plain \TeX\ version of the |{pgftransparencygroup}| environment.
-\end{plainenvironment}
-
-\begin{contextenvironment}{{pgftransparencygroup}}
- This is the Con\TeX t version of the environment.
-\end{contextenvironment}
-
+ \begin{contextenvironment}{{pgftransparencygroup}}
+ This is the Con\TeX t version of the environment.
+ \end{contextenvironment}
\end{environment}
-
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
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 3674f2f86d9..e107e8f097a 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
@@ -11,43 +11,38 @@
\section{Supported Formats}
\label{section-formats}
-
\TeX\ was designed to be a flexible system. This is true both for the
-\emph{input} for \TeX\ as well as for the \emph{output}. The present
-section explains which input formats there are and how they are
-supported by \pgfname. It also explains which different output formats
-can be produced.
-
+\emph{input} for \TeX\ as well as for the \emph{output}. The present section
+explains which input formats there are and how they are supported by \pgfname.
+It also explains which different output formats can be produced.
\subsection{Supported Input Formats: \LaTeX, Plain \TeX, Con\TeX t}
-\TeX\ does not prescribe exactly how your input should be
-formatted. While it is \emph{customary} that, say, an opening brace
-starts a scope in \TeX, this is by no means necessary. Likewise, it is
-\emph{customary} that environments start with |\begin|, but \TeX\
-could not really care less about the exact command name.
+\TeX\ does not prescribe exactly how your input should be formatted. While it
+is \emph{customary} that, say, an opening brace starts a scope in \TeX, this is
+by no means necessary. Likewise, it is \emph{customary} that environments start
+with |\begin|, but \TeX\ could not really care less about the exact command
+name.
-Even though \TeX\ can be reconfigured, users can not. For this reason,
-certain \emph{input formats} specify a set of commands and conventions
-how input for \TeX\ should be formatted. There are currently three
-``major'' formats: Donald Knuth's original |plain| \TeX\ format,
-Leslie Lamport's popular \LaTeX\ format, and Hans Hangen's Con\TeX t
-format.
+Even though \TeX\ can be reconfigured, users can not. For this reason, certain
+\emph{input formats} specify a set of commands and conventions how input for
+\TeX\ should be formatted. There are currently three ``major'' formats: Donald
+Knuth's original |plain| \TeX\ format, Leslie Lamport's popular \LaTeX\ format,
+and Hans Hangen's Con\TeX t format.
-\subsubsection{Using the \LaTeX\ Format}
+\subsubsection{Using the \LaTeX\ Format}
-Using \pgfname\ and \tikzname\ with the \LaTeX\ format is easy: You
-say |\usepackage{pgf}| or |\usepackage{tikz}|. Usually, that is all
-you need to do, all configuration will be done automatically and
-(hopefully) correctly.
+Using \pgfname\ and \tikzname\ with the \LaTeX\ format is easy: You say
+|\usepackage{pgf}| or |\usepackage{tikz}|. Usually, that is all you need to do,
+all configuration will be done automatically and (hopefully) correctly.
The style files used for the \LaTeX\ format reside in the subdirectory
-|latex/pgf/| of the \pgfname-system. Mainly, what these files do is to
-include files in the directory |generic/pgf|. For example, here is the
-content of the file |latex/pgf/frontends/tikz.sty|:
-
+|latex/pgf/| of the \pgfname-system. Mainly, what these files do is to include
+files in the directory |generic/pgf|. For example, here is the content of the
+file |latex/pgf/frontends/tikz.sty|:
+%
\begin{codeexample}[code only]
% Copyright 2006 by Till Tantau
%
@@ -69,423 +64,386 @@ content of the file |latex/pgf/frontends/tikz.sty|:
The files in the |generic/pgf| directory do the actual work.
-
\subsubsection{Using the Plain \TeX\ Format}
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|.
-
-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.
+|\end{pgfpicture}| you use |\pgfpicture| and |\endpgfpicture|.
-Like the \LaTeX\ style files, the plain \TeX\ files like |tikz.tex|
-also just include the correct |tikz.code.tex| file.
+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.
+Like the \LaTeX\ style files, the plain \TeX\ files like |tikz.tex| 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.
-
-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
-format directly and graphics inclusion may be a problem.
-
-In addition to |pgf| and |tikz| there also exist modules like
-|pgfcore| or |pgfmodulematrix|. To
-use them, you may need to include the module |pgfmod| first (the
-modules |pgf| and |tikz| both include |pgfmod| for you, so typically
+|\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 format directly and graphics
+inclusion may be a problem.
+
+In addition to |pgf| and |tikz| there also exist modules like |pgfcore| or
+|pgfmodulematrix|. To use them, you may need to include the module |pgfmod|
+first (the modules |pgf| and |tikz| both include |pgfmod| for you, so typically
you can skip this). This special module is necessary since Con\TeX t
-satanically restricts the length of module names to 6 characters
-and \pgfname's long names are mapped
-to cryptic 6-letter-names for you by the module |pgfmod|.
-
-
-
+satanically restricts the length of module names to 6 characters and \pgfname's
+long names are mapped to cryptic 6-letter-names for you by the module |pgfmod|.
\subsection{Supported Output Formats}
\label{section-drivers}
-An output format is a format in which \TeX\ outputs the text it has
-typeset. Producing the output is (conceptually) a two-stage process:
+An output format is a format in which \TeX\ outputs the text it has 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
- (possibly) some ``special'' commands. This long list of pairs
- is written to something called a |.dvi|-file (informally known as
- ``device-independent file'').
-\item
- Some other program reads this |.dvi|-file and translates the
- letter--coordinate pairs into, say, PostScript commands for placing
- the given letter at the given coordinate.
+ \item \TeX\ typesets your text and graphics. The result of this
+ 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 (informally known as
+ ``device-independent file'').
+ \item Some other program reads this |.dvi|-file and translates the
+ letter--coordinate pairs into, say, PostScript commands for placing
+ the given letter at the given coordinate.
\end{enumerate}
-The classical example of this process is the combination of |latex|
-and |dvips|. The |latex| program (which is just the |tex| program
-called with the \LaTeX-macros preinstalled) produces a |.dvi|-file as
-its output. The |dvips| program takes this output and produces a
-|.ps|-file (a PostScript file). Possibly, this file is further
-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
-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
-output, this time it is a |.html| file. The programs |pdftex| and
-|pdflatex| are special: They directly produce a |.pdf|-file without
-the intermediate |.dvi|-stage. However, from the programmer's point of
-view they behave exactly as if there was an intermediate stage.
-
-Normally, \TeX\ only produces letter--coordinate pairs as its
-``output.'' This obviously makes it difficult to draw, say, a
-curve. For this, ``special'' commands can be used. Unfortunately,
-these special commands are not the same for the different programs
-that process the |.dvi|-file. Indeed, every program that takes a
-|.dvi|-file as input has a totally different syntax for the special
-commands.
-
-One of the main jobs of \pgfname\ is to ``abstract away'' 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.
+The classical example of this process is the combination of |latex| and
+|dvips|. The |latex| program (which is just the |tex| program called with the
+\LaTeX-macros preinstalled) produces a |.dvi|-file as its output. The |dvips|
+program takes this output and produces a |.ps|-file (a PostScript file).
+Possibly, this file is further 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 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 output, this time it is
+a |.html| file. The programs |pdftex| and |pdflatex| are special: They directly
+produce a |.pdf|-file without the intermediate |.dvi|-stage. However, from the
+programmer's point of view they behave exactly as if there was an intermediate
+stage.
+
+Normally, \TeX\ only produces letter--coordinate pairs as its ``output''. This
+obviously makes it difficult to draw, say, a curve. For this, ``special''
+commands can be used. Unfortunately, these special commands are not the same
+for the different programs that process the |.dvi|-file. Indeed, every program
+that takes a |.dvi|-file as input has a totally different syntax for the
+special commands.
+
+One of the main jobs of \pgfname\ is to ``abstract away'' 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.
\subsubsection{Selecting the Backend Driver}
-When \TeX\ typesets your document, it does not know which program
-you are going to use to transform the |.dvi|-file. If your |.dvi|-file
-does not contain any special commands, this would be fine; but these
-days almost all |.dvi|-files contain lots of special commands. It is
-thus necessary to tell \TeX\ which program you are going to use later
-on.
-
-Unfortunately, there is no ``standard'' way of telling this to
-\TeX. For the \LaTeX\ format a sophisticated mechanism exists inside
-the |graphics| package and \pgfname\ plugs into this mechanism. For
-other formats and when this plugging does not work as expected, it is
-necessary to tell \pgfname\ directly which program you are going to
-use. This is done by redefining the macro |\pgfsysdriver| to an
-appropriate value \emph{before} you load |pgf|. If you are going to
-use the |dvips| program, you set this macro to the value
+When \TeX\ typesets your document, it does not know which program you are going
+to use to transform the |.dvi|-file. If your |.dvi|-file does not contain any
+special commands, this would be fine; but these days almost all |.dvi|-files
+contain lots of special commands. It is thus necessary to tell \TeX\ which
+program you are going to use later on.
+
+Unfortunately, there is no ``standard'' way of telling this to \TeX. For the
+\LaTeX\ format a sophisticated mechanism exists inside the |graphics| package
+and \pgfname\ plugs into this mechanism. For other formats and when this
+plugging does not work as expected, it is necessary to tell \pgfname\ directly
+which program you are going to use. This is done by redefining the macro
+|\pgfsysdriver| to an appropriate value \emph{before} you load |pgf|. If you
+are going to use the |dvips| program, you set this macro to the value
|pgfsys-dvips.def|; if you use |pdftex| or |pdflatex|, you set it to
-|pgfsys-pdftex.def|; and so on. In the following, details of the
-support of the different programs are discussed.
+|pgfsys-pdftex.def|; and so on. In the following, details of the support of the
+different programs are discussed.
\subsubsection{Producing PDF Output}
\pgfname\ supports three programs that produce \pdf\ output (\pdf\ means
-``portable document format'' and was invented by the Adobe company):
-|dvipdfm|, |pdftex|, and |vtex|. The |pdflatex| program is the same as the
-|pdftex| program: it uses a different input format, but the output is
-exactly the same.
+``portable document format'' and was invented by the Adobe company): |dvipdfm|,
+|pdftex|, and |vtex|. The |pdflatex| program is the same as the |pdftex|
+program: it uses a different input format, but the output is exactly the same.
\begin{filedescription}{pgfsys-pdftex.def}
- This is the driver file for use with pdf\TeX, that is, with the
- |pdftex| or |pdflatex| command. It includes
- |pgfsys-common-pdf.def|.
+ This is the driver file for use with pdf\TeX, that is, with the |pdftex| or
+ |pdflatex| command. It includes |pgfsys-common-pdf.def|.
- This driver has a lot of functionality. (Almost) everything
- \pgfname\ ``can do at all'' is implemented in this driver.
+ This driver has a lot of functionality. (Almost) everything \pgfname\ ``can
+ do at all'' is implemented in this driver.
\end{filedescription}
\begin{filedescription}{pgfsys-dvipdfm.def}
- This is a driver file for use with (|la|)|tex| followed by |dvipdfm|. It
- includes |pgfsys-common-pdf.def|.
-
- This driver supports most of \pgfname's features, but there are some
- restrictions:
- \begin{enumerate}
- \item
- In \LaTeX\ mode it uses |graphicx| for the graphics
- inclusion and does not support masking.
- \item
- In plain \TeX\ mode it does not support image inclusion.
- \end{enumerate}
+ This is a driver file for use with (|la|)|tex| followed by |dvipdfm|. It
+ includes |pgfsys-common-pdf.def|.
+
+ This driver supports most of \pgfname's features, but there are some
+ restrictions:
+ %
+ \begin{enumerate}
+ \item In \LaTeX\ mode it uses |graphicx| for the graphics inclusion
+ and does not support masking.
+ \item In plain \TeX\ mode it does not support image inclusion.
+ \end{enumerate}
\end{filedescription}
\begin{filedescription}{pgfsys-xetex.def}
- This is a driver file for use with |xe|(|la|)|tex| followed by
- |xdvipdfmx|. This driver supports largely the same operations as the
- |dvipdfm| driver.
+ This is a driver file for use with |xe|(|la|)|tex| followed by |xdvipdfmx|.
+ This driver supports largely the same operations as the |dvipdfm| driver.
\end{filedescription}
\begin{filedescription}{pgfsys-vtex.def}
- This is the driver file for use with the commercial \textsc{vtex}
- program. Even though it produces \textsc{pdf} output, it
- includes |pgfsys-common-postscript.def|. Note that the
- \textsc{vtex} program can produce \emph{both} Postscript and
- \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.
-
- This driver supports most of \pgfname's features, except for
- the following restrictions:
- \begin{enumerate}
- \item
- In \LaTeX\ mode it uses |graphicx| for the graphics
- inclusion and does not support masking.
- \item
- In plain \TeX\ mode it does not support image inclusion.
- \item
- Shading is fully implemented, but yields the same quality as the
- implementation for |dvips|.
- \item
- Opacity is not supported.
- \item
- Remembering of pictures (inter-picture connections) is not
- supported.
- \end{enumerate}
+ This is the driver file for use with the commercial \textsc{vtex} program.
+ Even though it produces \textsc{pdf} output, it includes
+ |pgfsys-common-postscript.def|. Note that the \textsc{vtex} program can
+ produce \emph{both} Postscript and \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.
+
+ This driver supports most of \pgfname's features, except for the following
+ restrictions:
+ %
+ \begin{enumerate}
+ \item In \LaTeX\ mode it uses |graphicx| for the graphics inclusion
+ and does not support masking.
+ \item In plain \TeX\ mode it does not support image inclusion.
+ \item Shading is fully implemented, but yields the same quality as
+ the implementation for |dvips|.
+ \item Opacity is not supported.
+ \item Remembering of pictures (inter-picture connections) is not
+ supported.
+ \end{enumerate}
\end{filedescription}
-It is also possible to produce a |.pdf|-file by first producing a
-PostScript file (see below) and then using a PostScript-to-\pdf\
-conversion program like |ps2pdf| or the Acrobat Distiller.
+It is also possible to produce a |.pdf|-file by first producing a PostScript
+file (see below) and then using a PostScript-to-\pdf\ conversion program like
+|ps2pdf| or the Acrobat Distiller.
\subsubsection{Producing PostScript Output}
\begin{filedescription}{pgfsys-dvips.def}
- This is a driver file for use with (|la|)|tex| followed by
- |dvips|. It includes |pgfsys-common-postscript.def|.
-
- This driver also supports most of \pgfname's features, except for
- the following restrictions:
- \begin{enumerate}
- \item
- In \LaTeX\ mode it uses |graphicx| for the graphics
- inclusion and does not support masking.
- \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.
- \item
- Opacity works only in conjunction with newer versions of
- Ghostscript.
- \item
- For remembering of pictures (inter-picture connections) you need
- to use a recent version of |pdftex| running in DVI-mode.
- \end{enumerate}
+ This is a driver file for use with (|la|)|tex| followed by |dvips|. It
+ includes |pgfsys-common-postscript.def|.
+
+ This driver also supports most of \pgfname's features, except for the
+ following restrictions:
+ %
+ \begin{enumerate}
+ \item In \LaTeX\ mode it uses |graphicx| for the graphics inclusion
+ and does not support masking.
+ \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.
+ \item Opacity works only in conjunction with newer versions of
+ Ghostscript.
+ \item For remembering of pictures (inter-picture connections) you
+ need to use a recent version of |pdftex| running in DVI-mode.
+ \end{enumerate}
\end{filedescription}
\begin{filedescription}{pgfsys-textures.def}
- This is a driver file for use with the \textsc{textures} program. It
- includes |pgfsys-common-postscript.def|.
+ This is a driver file for use with the \textsc{textures} program. It
+ includes |pgfsys-common-postscript.def|.
- This driver has exactly the same restrictions as the driver for
- |dvips|.
+ This driver has exactly the same restrictions as the driver for |dvips|.
\end{filedescription}
-You can also use the |vtex| program together with |pgfsys-vtex.def| to
-produce Postscript output.
-
+You can also use the |vtex| program together with |pgfsys-vtex.def| to produce
+Postscript output.
\subsubsection{Producing SVG Output}
\begin{filedescription}{pgfsys-dvisvgm.def}
- This driver converts \textsc{dvi} files to \textsc{svg} file,
- including text and fonts. When you select this driver, \pgfname\
- will output the required raw \textsc{svg} code for the pictures it
- produces.
-
- Since the |graphics| package does not (yet?) support this driver
- directly, there is special rule for this driver in \LaTeX: If the
- option |dvisvgm| is given to the |tikz| package, this driver gets
- selected (normally, the driver selected by |graphics| would be
- used). For packages like |beamer| that load \pgfname\
- themselves, this means that the option |dvisvgm| should be given to
- the document class.
+ This driver converts \textsc{dvi} files to \textsc{svg} file, including
+ text and fonts. When you select this driver, \pgfname\ will output the
+ required raw \textsc{svg} code for the pictures it produces.
+
+ Since the |graphics| package does not (yet?) support this driver directly,
+ there is special rule for this driver in \LaTeX: If the option |dvisvgm| is
+ given to the |tikz| package, this driver gets selected (normally, the
+ driver selected by |graphics| would be used). For packages like |beamer|
+ that load \pgfname\ themselves, this means that the option |dvisvgm| should
+ be given to the document class.
+ %
\begin{codeexample}[code only]
-% example.tex
+% example.tex
\documentclass[dvisvgm]{minimal}
\usepackage{tikz}
\begin{document}
Hello \tikz [baseline] \fill [fill=blue!80!black] (0,.75ex) circle[radius=.75ex];
-\end{document}
+\end{document}
\end{codeexample}
- And then run
+ And then run
+ %
\begin{codeexample}[code only]
latex example
-dvisvgm example
+dvisvgm example
\end{codeexample}
- or better
+ %
+ or better
+ %
\begin{codeexample}[code only]
lualatex --output-format=dvi example
-dvisvgm example
+dvisvgm example
\end{codeexample}
- (This is ``better'' since it gives you access to the full power of
- Lua\TeX\ inside your \TeX-file. In particular, \tikzname\ is able
- to run graph drawing algorithms in this case.)
+ %
+ (This is ``better'' since it gives you access to the full power of Lua\TeX\
+ inside your \TeX-file. In particular, \tikzname\ is able to run graph
+ drawing algorithms in this case.)
- Unlike the |tex4ht| driver below, this driver has full support of
- text nodes.
+ Unlike the |tex4ht| driver below, this driver has full support of text
+ nodes.
\end{filedescription}
-
\begin{filedescription}{pgfsys-tex4ht.def}
- This is a driver file for use with the |tex4ht| program. It is
- selected automatically when the |tex4ht| style or command is
- loaded. It includes |pgfsys-common-svg.def|.
-
- The |tex4ht| program converts |.dvi|-files to |.html|-files. While the
- \textsc{html}-format cannot be used to draw graphics, the
- \textsc{svg}-format can. This driver will ask
- \pgfname\ to produce an \textsc{svg}-picture for each \pgfname\
- graphic in your text.
-
- When using this driver you should be aware of the following
- restrictions:
- \begin{enumerate}
- \item
- In \LaTeX\ mode it uses |graphicx| for the graphics
- inclusion.
- \item
- In plain \TeX\ mode it does not support image inclusion.
- \item
- Remembering of pictures (inter-picture connections) is not
- 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, although it is possible to ``escape
- back'' to \textsc{html}, \tikzname\ 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.
- \item
- Matrices do not work.
- \item
- Functional shadings are not supported.
- \end{enumerate}
-
- The driver basically works as follows: When a |{pgfpicture}| is
- started, appropriate |\special| commands are used to directed the
- output of |tex4ht| to a new file called |\jobname-xxx.svg|, where
- |xxx| is a number that is increased for each graphic. Then, till the
- end of the picture, each (system layer) graphic command creates a
- special that inserts appropriate \textsc{svg} literal text into the
- output file. The exact details are a bit complicated since the
- 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}{/pgf/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:
+ This is a driver file for use with the |tex4ht| program. It is selected
+ automatically when the |tex4ht| style or command is loaded. It includes
+ |pgfsys-common-svg.def|.
+
+ The |tex4ht| program converts |.dvi|-files to |.html|-files. While the
+ \textsc{html}-format cannot be used to draw graphics, the
+ \textsc{svg}-format can. This driver will ask \pgfname\ to produce an
+ \textsc{svg}-picture for each \pgfname\ graphic in your text.
+
+ When using this driver you should be aware of the following restrictions:
+ %
\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.
+ \item In \LaTeX\ mode it uses |graphicx| for the graphics inclusion.
+ \item In plain \TeX\ mode it does not support image inclusion.
+ \item Remembering of pictures (inter-picture connections) is not
+ 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, although it is possible to ``escape
+ back'' to \textsc{html}, \tikzname\ 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.
+ \item Matrices do not work.
+ \item Functional shadings are not supported.
\end{enumerate}
- If you use text that contains anything special, even something as
- simple as |$\alpha$|, this may corrupt the graphic.
+ The driver basically works as follows: When a |{pgfpicture}| is started,
+ appropriate |\special| commands are used to directed the output of |tex4ht|
+ to a new file called |\jobname-xxx.svg|, where |xxx| is a number that is
+ increased for each graphic. Then, till the end of the picture, each (system
+ layer) graphic command creates a special that inserts appropriate
+ \textsc{svg} literal text into the output file. The exact details are a bit
+ complicated since the 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}{/pgf/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,/pgf/tex4ht node/escape=false] {Example : $(a+b)^2=a^2+2ab+b^2$};
\end{codeexample}
When you write |node[/pgf/tex4ht node/escape=true] {|\meta{text}|}|,
- \pgfname\ 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 |{pgfpicture}|, 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,
- \pgfname\ 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.
+ \pgfname\ 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 |{pgfpicture}|, 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, \pgfname\ 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,/pgf/tex4ht node/escape=true]
{Example : $\int_0^\infty\frac{1}{1+t^2}dt=\frac{\pi}{2}$};
\end{codeexample}
- \end{key}
-
- \begin{key}{/pgf/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}{/pgf/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}{/pgf/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{key}
+
+ \begin{key}{/pgf/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}{/pgf/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}{/pgf/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}
\subsubsection{Producing Perfectly Portable DVI Output}
\begin{filedescription}{pgfsys-dvi.def}
- This is a driver file that can be used with any output driver,
- except for |tex4ht|.
-
- The driver will produce perfectly portable |.dvi| files by composing
- all pictures entirely of black rectangles, the basic and only graphic
- shape supported by the \TeX\ core. Even straight, but slanted lines
- are tricky to get right in this model (they need to be composed of
- lots of little squares).
-
- Naturally, \emph{very little} is possible with this driver. In fact,
- so little is possible that it is easier to list what is possible:
- \begin{itemize}
- \item Text boxes can be placed in the normal way.
- \item Lines and curves can be drawn (stroked). If they are not
- horizontal or vertical, they are composed of hundreds of small
- rectangles.
- \item Lines of different width are supported.
- \item Transformations are supported.
- \end{itemize}
- Note that, say, even filling is not supported! (Let alone color or
- anything fancy.)
-
- This driver has only one real application: It might be useful when
- you only need horizontal or vertical lines in a picture. Then, the
- results are quite satisfactory.
+ This is a driver file that can be used with any output driver, except for
+ |tex4ht|.
+
+ The driver will produce perfectly portable |.dvi| files by composing all
+ pictures entirely of black rectangles, the basic and only graphic shape
+ supported by the \TeX\ core. Even straight, but slanted lines are tricky to
+ get right in this model (they need to be composed of lots of little
+ squares).
+
+ Naturally, \emph{very little} is possible with this driver. In fact, so
+ little is possible that it is easier to list what is possible:
+ %
+ \begin{itemize}
+ \item Text boxes can be placed in the normal way.
+ \item Lines and curves can be drawn (stroked). If they are not
+ horizontal or vertical, they are composed of hundreds of small
+ rectangles.
+ \item Lines of different width are supported.
+ \item Transformations are supported.
+ \end{itemize}
+ %
+ Note that, say, even filling is not supported! (Let alone color or anything
+ fancy.)
+
+ This driver has only one real application: It might be useful when you only
+ need horizontal or vertical lines in a picture. Then, the results are quite
+ satisfactory.
\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
index f44b1b4ad4a..a0e46cbaf9b 100644
--- 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
@@ -7,176 +7,178 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Axes}
\label{section-dv-axes}
-
\subsection{Overview}
-When a data point is visualized, the most obvious way of creating a
-visual representation of its many attributes is to
-vary \emph{where} the data point is shown. The data visualization
-system uses \emph{axes} to turn data point attributes into positions
-on a page. The simplest -- and most common -- use of axes is to vary
-the horizontal position of data points according to one attribute and
-to vary the vertical position according to another attribute. In
-contrast, in a polar plot one attribute dictates the distance of the
-data point from the origin and another attribute describes the
-angle. From the data visualization engine's point of view, in both
-cases two \emph{axes} are involved.
-
-In addition to specifying how the value of a certain attribute is
-converted into a displacement on the page, an axis is also typically
-(but not always) visualized (``drawn'') somewhere on the page. In this case, it is
-also customary to add a visual representation on this axis of which
-attribute values correspond to which positions on the page --
-something commonly known as \emph{ticks}. Similar to ticks, \emph{grid
- lines} also indicate positions where a certain attribute has a
-certain value, but instead of just indicating a single position on an
-axis, a grid line goes through all points that share an attribute
-value.
-
-In the following, in Section~\ref{section-dv-axes-main} we first have
-a look at how axes can be defined and configured. As you will see, a
-lot of powerful configurations are available, but you will rarely
-define and configure an axis from scratch. Rather, it is more common
-to use a preconfigured axis
-instead. Section~\ref{section-dv-axis-systems} introduces \emph{axis
- systems}, which are predefined bundles of axes. You can define your
-own axis systems, but, again, in most cases it will suffice to just
-use one of the many preconfigured axis systems and use a few options
-to configure it so that it fits your
-need. Section~\ref{section-dv-ticks-and-grids} explains how ticks and
-grid lines can be configured. Again, several layers of
-options allow you to configure the way ticks look and where they are
-placed in great detail.
-
-This section documents the standard axis systems that are always
-available. For polar axis systems, a special library needs to be
-loaded, which is documented in Section~\ref{section-dv-polar}.
-
+When a data point is visualized, the most obvious way of creating a visual
+representation of its many attributes is to vary \emph{where} the data point is
+shown. The data visualization system uses \emph{axes} to turn data point
+attributes into positions on a page. The simplest -- and most common -- use of
+axes is to vary the horizontal position of data points according to one
+attribute and to vary the vertical position according to another attribute. In
+contrast, in a polar plot one attribute dictates the distance of the data point
+from the origin and another attribute describes the angle. From the data
+visualization engine's point of view, in both cases two \emph{axes} are
+involved.
+
+In addition to specifying how the value of a certain attribute is converted
+into a displacement on the page, an axis is also typically (but not always)
+visualized (``drawn'') somewhere on the page. In this case, it is also
+customary to add a visual representation on this axis of which attribute values
+correspond to which positions on the page -- something commonly known as
+\emph{ticks}. Similar to ticks, \emph{grid lines} also indicate positions where
+a certain attribute has a certain value, but instead of just indicating a
+single position on an axis, a grid line goes through all points that share an
+attribute value.
+
+In the following, in Section~\ref{section-dv-axes-main} we first have a look at
+how axes can be defined and configured. As you will see, a lot of powerful
+configurations are available, but you will rarely define and configure an axis
+from scratch. Rather, it is more common to use a preconfigured axis instead.
+Section~\ref{section-dv-axis-systems} introduces \emph{axis systems}, which are
+predefined bundles of axes. You can define your own axis systems, but, again,
+in most cases it will suffice to just use one of the many preconfigured axis
+systems and use a few options to configure it so that it fits your need.
+Section~\ref{section-dv-ticks-and-grids} explains how ticks and grid lines can
+be configured. Again, several layers of options allow you to configure the way
+ticks look and where they are placed in great detail.
+
+This section documents the standard axis systems that are always available. For
+polar axis systems, a special library needs to be loaded, which is documented
+in Section~\ref{section-dv-polar}.
\subsection{Basic Configuration of Axes}
\label{section-dv-axes-main}
-Inside the data visualization system, an \emph{axis} is roughly a
-``systematic, named way of mapping an attribute to a
-position on a page''. For instance, the classical ``$x$-axis'' is the
-``systematic way of mapping the value of the |x| attribute of data
-points to a horizontal position on the page''. An axis is \emph{not}
-its visual representation (such as the horizontal line with the ticks
-drawn to represent the $x$-axis), but a visual representation can be
+Inside the data visualization system, an \emph{axis} is roughly a ``systematic,
+named way of mapping an attribute to a position on a page''. For instance, the
+classical ``$x$-axis'' is the ``systematic way of mapping the value of the |x|
+attribute of data points to a horizontal position on the page''. An axis is
+\emph{not} its visual representation (such as the horizontal line with the
+ticks drawn to represent the $x$-axis), but a visual representation can be
created once an axis has been defined.
-The transformation of an attribute value (such as the value |1000000000|
-for the |x| attribute) to a specific displacement of the corresponding
-data point on the page involves two steps:
+The transformation of an attribute value (such as the value |1000000000| for
+the |x| attribute) to a specific displacement of the corresponding data point
+on the page involves two steps:
+%
\begin{enumerate}
-\item First, the range of possible values such as $[-5.6\cdot
- 10^{12},7.8\cdot 10^{12}]$ must be mapped to a ``reasonable''
- interval such as $[0\mathrm{cm},5\mathrm{cm}]$ or
- $[0^\circ,180^\circ]$. \tikzname's drawing routines will only be
- able to cope with values from such a ``reasonable'' interval.
-\item Second, the values from the reasonable interval must be mapped
- to a transformation.
+ \item First, the range of possible values such as $[-5.6\cdot
+ 10^{12},7.8\cdot 10^{12}]$ must be mapped to a ``reasonable'' interval
+ such as $[0\mathrm{cm},5\mathrm{cm}]$ or $[0^\circ,180^\circ]$.
+ \tikzname's drawing routines will only be able to cope with values from
+ such a ``reasonable'' interval.
+ \item Second, the values from the reasonable interval must be mapped to a
+ transformation.
\end{enumerate}
-The first step is always the same for all axes, while the second
-requires different strategies. For this reason, the command
-|new axis base| is used to create a ``basic'' axis that has a
-``scaling mapper'', whose job it is to map the range of values of a
-specific attribute to a reasonable interval, but such a basic axis
-does not define an actual transformation object. For this second step,
-additional objects such as a |linear transformer| need to be created
-separately.
+%
+The first step is always the same for all axes, while the second requires
+different strategies. For this reason, the command |new axis base| is used to
+create a ``basic'' axis that has a ``scaling mapper'', whose job it is to map
+the range of values of a specific attribute to a reasonable interval, but such
+a basic axis does not define an actual transformation object. For this second
+step, additional objects such as a |linear transformer| need to be created
+separately.
\subsubsection{Usage}
-To create an axis, the key |new axis base| is used first. Since this key
-does not create a transformation object, users typically do not use
-this key directly. Rather, it is used internally by other keys
-that create ``real'' axes. These keys are listed in
-Section~\ref{section-dv-reference-axis-types}.
+To create an axis, the key |new axis base| is used first. Since this key does
+not create a transformation object, users typically do not use this key
+directly. Rather, it is used internally by other keys that create ``real''
+axes. These keys are listed in Section~\ref{section-dv-reference-axis-types}.
\begin{key}{/tikz/data visualization/new axis base=\meta{axis name}}
- This key defines a new axis for the current data visualization
- called \meta{name}. This has two effects:
- \begin{enumerate}
- \item A so called \emph{scaling mapper} is created that will monitor
- a certain attribute, rescale it, and map it to another
- attribute. (This will be explained in detail in a moment.)
- \item The \meta{axis name} is made available as a key that can be
- used to configure the axis:
- \begin{key}{/tikz/data visualization/\meta{axis name}=\meta{options}}
- This key becomes available once |new axis base=|meta{axis name} has
- been called. It will execute the \meta{options} with the path
- prefix |/tikz/data visualization/axis options|.
+ This key defines a new axis for the current data visualization called
+ \meta{name}. This has two effects:
+ %
+ \begin{enumerate}
+ \item A so called \emph{scaling mapper} is created that will monitor a
+ certain attribute, rescale it, and map it to another attribute.
+ (This will be explained in detail in a moment.)
+ \item The \meta{axis name} is made available as a key that can be used
+ to configure the axis:
+ %
+ \begin{key}{/tikz/data visualization/\meta{axis name}=\meta{options}}
+ This key becomes available once |new axis base=|meta{axis name}
+ has been called. It will execute the \meta{options} with the
+ path prefix |/tikz/data visualization/axis options|.
+ %
\begin{codeexample}[code only]
[new axis base=my axis,
my axis={attribute=some attribute}]
\end{codeexample}
- \end{key}
- \item The \meta{axis name} becomes part of the current set of
- axes. This set can be accessed through the following key:
- \begin{key}{/tikz/data visualization/all axes=\meta{options}}
- This key passes the \meta{options} to all axes inside the
- current scope, just as if you had written \meta{some axis
- name}|=|\meta{options} for each \meta{some axis name} in the
- current scope, including the just-created name \meta{axis name}.
- \end{key}
- \end{enumerate}
- There are many \meta{options} that can be passed to a newly created
- axis. They are explained in the rest of this section.
+ \end{key}
+ \item The \meta{axis name} becomes part of the current set of axes.
+ This set can be accessed through the following key:
+ %
+ \begin{key}{/tikz/data visualization/all axes=\meta{options}}
+ This key passes the \meta{options} to all axes inside the
+ current scope, just as if you had written \meta{some axis
+ name}|=|\meta{options} for each \meta{some axis name} in the
+ current scope, including the just-created name \meta{axis
+ name}.
+ \end{key}
+ \end{enumerate}
+ %
+ There are many \meta{options} that can be passed to a newly created axis.
+ They are explained in the rest of this section.
\end{key}
Note the |new axis base| does \emph{not} cause attributes to be mapped to
-positions on a page. Rather, special keys like |new Cartesian axis|
-first use |new axis base| to create an axis and then create an internal
-object that performs a linear mapping of the attribute to
-positions along a vectors.
+positions on a page. Rather, special keys like |new Cartesian axis| first use
+|new axis base| to create an axis and then create an internal object that
+performs a linear mapping of the attribute to positions along a vectors.
\subsubsection{The Axis Attribute}
\label{section-dv-axis-attribute}
-The first main job of an axis is to map the different values of some
-attribute to a reasonable interval. To achieve this, the following
-options are important (recall that these options are passed to the key
-whose name is the name of the axis):
+The first main job of an axis is to map the different values of some attribute
+to a reasonable interval. To achieve this, the following options are important
+(recall that these options are passed to the key whose name is the name of the
+axis):
\begin{key}{/tikz/data visualization/axis options/attribute=\meta{attribute}}
- Specifies that the axis is used to transform the data points
- according the different values of the key
- |/data point/|\meta{attribute}. For instance, when we create a
- classical two-dimensional Cartesian coordinate system, then there
- are two axes called |x axis| and |y axis| that monitor the values of
- the attributes |/data point/x| and |/data point/y|, respectively:
+ Specifies that the axis is used to transform the data points according the
+ different values of the key |/data point/|\meta{attribute}. For instance,
+ when we create a classical two-dimensional Cartesian coordinate system,
+ then there are two axes called |x axis| and |y axis| that monitor the
+ values of the attributes |/data point/x| and |/data point/y|, respectively:
+ %
\begin{codeexample}[code only]
[new axis base=x axis,
new axis base=y axis,
x axis={attribute=x},
y axis={attribute=y}]
\end{codeexample}
- In another example, we also create an |x axis| and a
- |y axis|. However, this time, we want to plot the values of the
- |/data point/time| attribute on the $x$-axis and, say, the value of
- the |height| attribute on the $y$-axis:
+ %
+ In another example, we also create an |x axis| and a |y axis|. However,
+ this time, we want to plot the values of the |/data point/time| attribute
+ on the $x$-axis and, say, the value of the |height| attribute on the
+ $y$-axis:
+ %
\begin{codeexample}[code only]
[new axis base=x axis,
new axis base=y axis,
x axis={attribute=time},
y axis={attribute=height}]
\end{codeexample}
- During the data visualization, the \meta{attribute} will be
- ``monitored'' during the survey phase. This means that for each data
- point, the current value of |/data point/|\meta{attribute} is
- examined and the minimum value of all of these values as well as the
- maximum value is recorded internally. Note that this works even when
- very large numbers like |100000000000| are involved.
-
- Here is a real-life example. The |scientific axes| create two axes,
- called |x axis| and |y axis|, respectively.
+ %
+ During the data visualization, the \meta{attribute} will be ``monitored''
+ during the survey phase. This means that for each data point, the current
+ value of |/data point/|\meta{attribute} is examined and the minimum value
+ of all of these values as well as the maximum value is recorded internally.
+ Note that this works even when very large numbers like |100000000000| are
+ involved.
+
+ Here is a real-life example. The |scientific axes| create two axes, called
+ |x axis| and |y axis|, respectively.
+ %
\begin{codeexample}[]
\tikz \datavisualization [scientific axes,
x axis={attribute=people, length=2.5cm, ticks=few},
@@ -191,39 +193,41 @@ whose name is the name of the axis):
2000, 150
};
\end{codeexample}
+ %
\end{key}
\subsubsection{The Axis Attribute Range Interval}
-Once an attribute has been specified for an axis, the data
-visualization engine will start monitoring this value. This means that
-before anything actual visualization is done, a ``survey phase'' is
-used to determine the range of values encountered for the attribute
-for all data points. This range of values results in what is called
-the \emph{attribute range interval}. Its minimum is the smallest value
-encountered in the data and its maximum is the largest value.
-
-Even though the attribute range interval is computed automatically and
-even though you typically do not need to worry about it, there are
-some situations where you may wish to set or enlarge the attribute
-range interval:
+Once an attribute has been specified for an axis, the data visualization engine
+will start monitoring this value. This means that before anything actual
+visualization is done, a ``survey phase'' is used to determine the range of
+values encountered for the attribute for all data points. This range of values
+results in what is called the \emph{attribute range interval}. Its minimum is
+the smallest value encountered in the data and its maximum is the largest
+value.
+
+Even though the attribute range interval is computed automatically and even
+though you typically do not need to worry about it, there are some situations
+where you may wish to set or enlarge the attribute range interval:
+%
\begin{itemize}
-\item You may wish to start the interval with $0$, even though the
- range of values contains only positive values.
-\item You may wish to slightly enlarge the interval so that, say, the
- maximum is some ``nice'' value like |100| or |60|.
+ \item You may wish to start the interval with $0$, even though the range of
+ values contains only positive values.
+ \item You may wish to slightly enlarge the interval so that, say, the
+ maximum is some ``nice'' value like |100| or |60|.
\end{itemize}
-The following keys can be used to influence the size of the attribute
-range interval:
-\begin{key}{/tikz/data visualization/axis options/include
- value=\meta{list of value}}
- This key ``fakes'' data points for which the attribute's values are
- in the comma-separated \meta{list of values}. For instance, when you
- write |include value=0|, then the attribute range interval is
- guaranteed to contain |0| -- even if the actual data points are all
- positive or all negative.
+The following keys can be used to influence the size of the attribute range
+interval:
+%
+\begin{key}{/tikz/data visualization/axis options/include value=\meta{list of value}}
+ This key ``fakes'' data points for which the attribute's values are in the
+ comma-separated \meta{list of values}. For instance, when you write
+ |include value=0|, then the attribute range interval is guaranteed to
+ contain |0| -- even if the actual data points are all positive or all
+ negative.
+ %
\begin{codeexample}[]
\tikz \datavisualization [scientific axes, all axes={length=3cm},
visualize as line]
@@ -231,7 +235,8 @@ range interval:
var x : interval [5:10];
func y = \value x * \value x;
};
-\end{codeexample}
+\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \datavisualization [scientific axes, all axes={length=3cm},
visualize as line,
@@ -241,44 +246,48 @@ range interval:
var x : interval [5:10];
func y = \value x * \value x;
};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/axis options/min value=\meta{value}}
- This key allows you to simply set the minimum value, regardless of
- which values are present in the actual data. This key should be used
- with care: If there are data points for which the attribute's value
- is less than \meta{value}, they will still be depicted, but
- typically outside the normal visualization area. Usually, saying
- |include value=|\meta{value} will achieve the same as saying
- |min value=|\meta{value}, but with less danger of creating
- ill-formed visualizations.
+ This key allows you to simply set the minimum value, regardless of which
+ values are present in the actual data. This key should be used with care:
+ If there are data points for which the attribute's value is less than
+ \meta{value}, they will still be depicted, but typically outside the normal
+ visualization area. Usually, saying |include value=|\meta{value} will
+ achieve the same as saying |min value=|\meta{value}, but with less danger
+ of creating ill-formed visualizations.
\end{key}
\begin{key}{/tikz/data visualization/axis options/max value=\meta{value}}
- Works like |min value|.
+ Works like |min value|.
\end{key}
\subsubsection{Scaling: The General Mechanism}
-The above key allows us specify which attribute should be
-``monitored''. The next key is used to specify what should happen with
-the observed values.
+The above key allows us specify which attribute should be ``monitored''. The
+next key is used to specify what should happen with the observed values.
\begin{key}{/tikz/data visualization/axis options/scaling=\meta{scaling spec}}
- The \meta{scaling spec} must have the following form:
- \begin{quote}
- \meta{$s_1$}| at |\meta{$t_1$}| and |\meta{$s_2$}| at |\meta{$t_2$}
- \end{quote}
- This means that monitored values in the interval $[s_1,s_2]$ should
- be mapped to values the ``reasonable'' interval $[t_1,t_2]$,
- instead. For instance, we might write
+ The \meta{scaling spec} must have the following form:
+ %
+ \begin{quote}
+ \meta{$s_1$}| at |\meta{$t_1$}| and |\meta{$s_2$}| at |\meta{$t_2$}
+ \end{quote}
+ %
+ This means that monitored values in the interval $[s_1,s_2]$ should be
+ mapped to values the ``reasonable'' interval $[t_1,t_2]$, instead. For
+ instance, we might write
+ %
\begin{codeexample}[code only]
[y axis = {scaling = 1900 at 0cm and 2000 at 5cm}]
\end{codeexample}
- in order to map dates between 1900 and 2000 to the dimension
- interval $[0\mathrm{cm},5\mathrm{cm}]$.
+ %
+ in order to map dates between 1900 and 2000 to the dimension interval
+ $[0\mathrm{cm},5\mathrm{cm}]$.
+ %
\begin{codeexample}[]
\tikz \datavisualization
[scientific axes,
@@ -294,115 +303,120 @@ the observed values.
2000, 150
};
\end{codeexample}
- So much for the basic idea. Let us now have a detailed look at what
- happens.
-
- \medskip
- \textbf{Number format and the min and max keywords.}
- The source values $s_1$ and $s_2$ are typically just numbers like
- |3.14| or |10000000000|. However, as described in
- Section~\ref{section-dv-expressions}, you can also specify
- expressions like |(pi/2)|, provided that (currently) you put them in
- parentheses.
-
- Instead of a number, you may alternatively also use the two key
- words |min| and |max| for $s_1$ and/or $s_2$. In this case, |min|
- evaluates to the smallest value observed for the attribute in the
- data, symmetrically |max| evaluates to the largest values. For
- instance, in the above example with the |year| attribute ranging
- from |1900| to |2000|, the keyword |min| would stand for |1900| and
- |max| for |2000|. Similarly, for the |people| attribute |min| stands
- for |100| and |max| for |250|. Note that |min| and |max| can only be
- used for $s_1$ and $s_2$, not for $t_1$ and $t_2$.
-
- A typical use of the |min| and |max| keywords is to say
+ %
+ So much for the basic idea. Let us now have a detailed look at what
+ happens.
+
+
+ \medskip
+ \textbf{Number format and the min and max keywords.}
+ The source values $s_1$ and $s_2$ are typically just numbers like |3.14| or
+ |10000000000|. However, as described in
+ Section~\ref{section-dv-expressions}, you can also specify expressions like
+ |(pi/2)|, provided that (currently) you put them in parentheses.
+
+ Instead of a number, you may alternatively also use the two key words |min|
+ and |max| for $s_1$ and/or $s_2$. In this case, |min| evaluates to the
+ smallest value observed for the attribute in the data, symmetrically |max|
+ evaluates to the largest values. For instance, in the above example with
+ the |year| attribute ranging from |1900| to |2000|, the keyword |min| would
+ stand for |1900| and |max| for |2000|. Similarly, for the |people|
+ attribute |min| stands for |100| and |max| for |250|. Note that |min| and
+ |max| can only be used for $s_1$ and $s_2$, not for $t_1$ and $t_2$.
+
+ A typical use of the |min| and |max| keywords is to say
+ %
\begin{codeexample}[code only]
-scaling = min at 0cm and max at 5cm
-\end{codeexample}
- to map the complete range of values into an interval of length of
- 5cm.
-
- The interval $[s_1,s_2]$ need not contain all values that the
- \meta{attribute} may attain. It is permissible that values are less
- than $s_1$ or more than $s_2$.
-
- \medskip
- \textbf{Linear transformation of the attribute.}
- As indicated earlier, the main job of an axis is to map values from
- a ``large'' interval $[s_1,s_2]$ to a more reasonable interval
- $[t_1,t_2]$. Suppose
- that for the current data point the value of the key
- |/data point/|\meta{attribute} is the number $v$. In the simplest
- case, the following happens: A new value $v'$ is computed so that
- $v' = t_1$ when $v=s_1$ and $v'=t_2$ when $v=s_2$ and $v'$ is some
- value in between $t_1$ and $t_2$ then $v$ is some value in between
- $s_1$ and $s_2$. (Formally, in this basic case $v' = t_1 +
- (v-s_1)\frac{t_2-t_1}{s_2-s_1}$.)
-
- Once $v'$ has been computed, it is stored in the key
- |/data point/|\meta{attribute}|/scaled|. Thus, the ``reasonable''
- value $v'$ does not replace the value of the attribute, but it is
- placed in a different key. This means that both the original value
- and the more ``scaled'' values are available when the data point is
- visualized.
-
- As an example, suppose you have written
+scaling = min at 0cm and max at 5cm
+\end{codeexample}
+ %
+ to map the complete range of values into an interval of length of 5cm.
+
+ The interval $[s_1,s_2]$ need not contain all values that the
+ \meta{attribute} may attain. It is permissible that values are less than
+ $s_1$ or more than $s_2$.
+
+
+ \medskip
+ \textbf{Linear transformation of the attribute.}
+ As indicated earlier, the main job of an axis is to map values from a
+ ``large'' interval $[s_1,s_2]$ to a more reasonable interval $[t_1,t_2]$.
+ Suppose that for the current data point the value of the key
+ |/data point/|\meta{attribute} is the number $v$. In the simplest case, the
+ following happens: A new value $v'$ is computed so that $v' = t_1$ when
+ $v=s_1$ and $v'=t_2$ when $v=s_2$ and $v'$ is some value in between $t_1$
+ and $t_2$ then $v$ is some value in between $s_1$ and $s_2$. (Formally, in
+ this basic case $v' = t_1 + (v-s_1)\frac{t_2-t_1}{s_2-s_1}$.)
+
+ Once $v'$ has been computed, it is stored in the key
+ |/data point/|\meta{attribute}|/scaled|. Thus, the ``reasonable'' value
+ $v'$ does not replace the value of the attribute, but it is placed in a
+ different key. This means that both the original value and the more
+ ``scaled'' values are available when the data point is visualized.
+
+ As an example, suppose you have written
+ %
\begin{codeexample}[code only]
[x axis = {attribute = x, scaling=1000 at 20 and 2000 at 30}]
\end{codeexample}
- Now suppose that |/data point/x| equals |1200| for a data
- point. Then the key |/data point/x/scaled| will be set to |22| when
- the data point is being visualized.
-
- \medskip
- \textbf{Nonlinear transformations of the attribute.}
- By default, the transformation of $[s_1,s_2]$ to $[t_1,t_2]$ is the
- linear transformation described above. However, in some case you may
- be interested in a different kind of transformation: For example, in
- a logarithmic plot, values of an attribute may range between, say,
- |1| and |1000| and we want an axis of length |3cm|. So, we would
- write
- \begin{codeexample}[code only]
+ %
+ Now suppose that |/data point/x| equals |1200| for a data point. Then the
+ key |/data point/x/scaled| will be set to |22| when the data point is being
+ visualized.
+
+
+ \medskip
+ \textbf{Nonlinear transformations of the attribute.}
+ By default, the transformation of $[s_1,s_2]$ to $[t_1,t_2]$ is the linear
+ transformation described above. However, in some case you may be interested
+ in a different kind of transformation: For example, in a logarithmic plot,
+ values of an attribute may range between, say, |1| and |1000| and we want
+ an axis of length |3cm|. So, we would write
+ %
+\begin{codeexample}[code only]
[x axis = {attribute = x, scaling=1 at 0cm and 1000 at 3cm}]
- \end{codeexample}
- Indeed, |1| will now be mapped to position |0cm| and |1000| will be
- mapped to position |3cm|. Now, the value |10| will be mapped to
- approximately |0.03cm| because it is (almost) at one percent between
- |1| and |1000|. However, in a logarithmic plot we actually want |10|
- to be mapped to the position |1cm| rather than |0.03cm| and we want
- |100| to be mapped to the position |2cm|. Such a mapping a
- \emph{nonlinear} mapping between the intervals.
-
- In order to achieve such a nonlinear mapping, the |function| key can
- be used, whose syntax is described in a moment. The effect of this key is
- to specify a function $f \colon \mathbb R \to \mathbb R$ like, say,
- the logarithm function. When such a function is specified, the
- mapping of $v$ to $v'$ is computed as follows:
- \begin{align*}
- v' = t_1 + (f(s_2) - f(v))\frac{t_2 - t_1}{f(s_2)-f(s_1)}.
- \end{align*}
-
- The syntax of the |function| key is described next, but you
- typically will not call this key directly. Rather, you will use a
- key like |logarithmic| that installs appropriate code for the
- |function| key for you.
- \begin{key}{/tikz/data visualization/axis options/function=\meta{code}}
- The \meta{code} should specify a function $f$ that is applied
- during the transformation of the interval $[s_1,s_2]$ to the
- interval $[t_1,t_2]$ in the following way: When the \meta{code} is
- called, the macro |\pgfvalue| will have been set to an internal
- representation of the to-be-transformed value~$v$. You can then
- call the commands of the math-micro-kernel of the data
- visualization system, see Section~\ref{section-dv-math-kernel}, to
- compute a new value. This new value must once more be stored in
- |\pgfvalue|.
-
- The most common use of this key is to say
+\end{codeexample}
+ %
+ Indeed, |1| will now be mapped to position |0cm| and |1000| will be mapped
+ to position |3cm|. Now, the value |10| will be mapped to approximately
+ |0.03cm| because it is (almost) at one percent between |1| and |1000|.
+ However, in a logarithmic plot we actually want |10| to be mapped to the
+ position |1cm| rather than |0.03cm| and we want |100| to be mapped to the
+ position |2cm|. Such a mapping a \emph{nonlinear} mapping between the
+ intervals.
+
+ In order to achieve such a nonlinear mapping, the |function| key can be
+ used, whose syntax is described in a moment. The effect of this key is to
+ specify a function $f \colon \mathbb{R} \to \mathbb{R}$ like, say, the
+ logarithm function. When such a function is specified, the mapping of $v$
+ to $v'$ is computed as follows:
+ %
+ \begin{align*}
+ v' = t_1 + (f(s_2) - f(v))\frac{t_2 - t_1}{f(s_2)-f(s_1)}.
+ \end{align*}
+
+ The syntax of the |function| key is described next, but you typically will
+ not call this key directly. Rather, you will use a key like |logarithmic|
+ that installs appropriate code for the |function| key for you.
+ %
+ \begin{key}{/tikz/data visualization/axis options/function=\meta{code}}
+ The \meta{code} should specify a function $f$ that is applied during
+ the transformation of the interval $[s_1,s_2]$ to the interval
+ $[t_1,t_2]$ in the following way: When the \meta{code} is called, the
+ macro |\pgfvalue| will have been set to an internal representation of
+ the to-be-transformed value~$v$. You can then call the commands of the
+ math-micro-kernel of the data visualization system, see
+ Section~\ref{section-dv-math-kernel}, to compute a new value. This new
+ value must once more be stored in |\pgfvalue|.
+
+ The most common use of this key is to say
+ %
\begin{codeexample}[code only]
-some axis={function=\pgfdvmathln{\pgfvalue}{\pgfvalue}}
+some axis={function=\pgfdvmathln{\pgfvalue}{\pgfvalue}}
\end{codeexample}
- This specifies that the function $f$ is the logarithm
- function.
+ %
+ This specifies that the function $f$ is the logarithm function.
+ %
\begin{codeexample}[]
\tikz \datavisualization
[scientific axes,
@@ -414,7 +428,9 @@ some axis={function=\pgfdvmathln{\pgfvalue}{\pgfvalue}}
x={1,100,...,1000}, y={1,2,3}
};
\end{codeexample}
- Another possibility might be to use the square-root function, instead:
+ %
+ Another possibility might be to use the square-root function, instead:
+ %
\begin{codeexample}[]
\tikz \datavisualization
[scientific axes,
@@ -426,49 +442,52 @@ some axis={function=\pgfdvmathln{\pgfvalue}{\pgfvalue}}
x={0,100,...,1000}, y={1,2,3}
};
\end{codeexample}
- \end{key}
-
- \medskip
- \textbf{Default scaling.}
- When no scaling is specified, it may seem natural to use $[0,1]$
- both as the source and the target interval. However, this would not
- work when the logarithm function is used as transformations: In this
- case the logarithm of zero would be computed, leading to an
- error. Indeed, for a logarithmic axis it is far more natural to use
- $[1,10]$ as the source interval and $[0,1]$ as the target interval.
-
- For these reasons, the default value for the |scaling| that is used
- when no value is specified explicitly can be set using a special
- key:
- \begin{key}{/tikz/data visualization/axis options/scaling/default=\meta{text}}
- The \meta{text} is used as |scaling| whenever no other scaling is
- specified. This key is mainly used when a transformation function
- is set using |function|; normally, you will not use this key
- directly.
- \end{key}
-\end{key}
-
-Most of the time, you will not use neither the |scaling| nor the
-|function| key directly, but rather you will use one of the following
-predefined styles documented in the following.
+ \end{key}
+
+
+ \medskip
+ \textbf{Default scaling.}
+ When no scaling is specified, it may seem natural to use $[0,1]$ both as
+ the source and the target interval. However, this would not work when the
+ logarithm function is used as transformations: In this case the logarithm
+ of zero would be computed, leading to an error. Indeed, for a logarithmic
+ axis it is far more natural to use $[1,10]$ as the source interval and
+ $[0,1]$ as the target interval.
+
+ For these reasons, the default value for the |scaling| that is used when no
+ value is specified explicitly can be set using a special key:
+ %
+ \begin{key}{/tikz/data visualization/axis options/scaling/default=\meta{text}}
+ The \meta{text} is used as |scaling| whenever no other scaling is
+ specified. This key is mainly used when a transformation function is
+ set using |function|; normally, you will not use this key directly.
+ \end{key}
+\end{key}
+
+Most of the time, you will not use neither the |scaling| nor the |function| key
+directly, but rather you will use one of the following predefined styles
+documented in the following.
\subsubsection{Scaling: Logarithmic Axes}
\begin{key}{/tikz/data visualization/axis options/logarithmic}
- When this key is used with an axis, three things happen:
- \begin{enumerate}
- \item The transformation |function| of the axis is setup to the
- logarithm.
- \item The strategy for automatically generating ticks and grid lines
- is set to the |exponential strategy|, see
- Section~\ref{section-dv-exponential-strategy} for details.
- \item The default scaling is setup sensibly.
- \end{enumerate}
- All told, to turn an axis into a logarithmic axis, you just need to
- add this option to the axis.
+ When this key is used with an axis, three things happen:
+ %
+ \begin{enumerate}
+ \item The transformation |function| of the axis is setup to the
+ logarithm.
+ \item The strategy for automatically generating ticks and grid lines is
+ set to the |exponential strategy|, see
+ Section~\ref{section-dv-exponential-strategy} for details.
+ \item The default scaling is setup sensibly.
+ \end{enumerate}
+ %
+ All told, to turn an axis into a logarithmic axis, you just need to add
+ this option to the axis.
+ %
\begin{codeexample}[width=8cm]
-\tikz \datavisualization [scientific axes,
+\tikz \datavisualization [scientific axes,
x axis={logarithmic},
y axis={logarithmic},
visualize as line]
@@ -477,39 +496,42 @@ predefined styles documented in the following.
func y = \value x * \value x;
};
\end{codeexample}
- Note that this will work with any axis,
- including, say, the degrees on a polar axis:
+ %
+ Note that this will work with any axis, including, say, the degrees on a
+ polar axis:
+ %
\begin{codeexample}[]
\tikz \datavisualization
- [new polar axes,
+ [new polar axes,
angle axis={logarithmic, scaling=1 at 0 and 90 at 90},
radius axis={scaling=0 at 0cm and 100 at 3cm},
visualize as scatter]
data [format=named] {
angle={1,10,...,90}, radius={1,10,...,100}
};
-\end{codeexample}
+\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \datavisualization
- [new polar axes,
+ [new polar axes,
angle axis={degrees},
radius axis={logarithmic, scaling=1 at 0cm and 100 at 3cm},
visualize as scatter]
data [format=named] {
angle={1,10,...,90}, radius={1,10,...,100}
};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
-
\subsubsection{Scaling: Setting the Length or Unit Length}
\begin{key}{/tikz/data visualization/axis options/length=\meta{dimension}}
- Sets |scaling| to |min at 0cm and max at |\meta{dimension}. The
- effect is that the range of all values of the axis's attribute will
- be mapped to an interval of exact length \meta{dimension}.
-
+ Sets |scaling| to |min at 0cm and max at |\meta{dimension}. The effect is
+ that the range of all values of the axis's attribute will be mapped to an
+ interval of exact length \meta{dimension}.
+ %
\begin{codeexample}[]
\tikz \datavisualization [scientific axes,
x axis={length=3cm},
@@ -524,6 +546,7 @@ predefined styles documented in the following.
13, 20
};
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \datavisualization [scientific axes,
x axis={length=3cm},
@@ -538,15 +561,15 @@ predefined styles documented in the following.
13, 20
};
\end{codeexample}
-
+ %
\end{key}
-\begin{key}{/tikz/data visualization/axis
- options/unit length=\meta{dimension}\opt{| per |\meta{number}| units|}}
- Sets |scaling| to |0 at 0cm and 1 at |\meta{dimension}. In other
- words, this key allows you to specify how long a single unit should
- be. This key is particularly useful when you wish to ensure that the
- same scaling is used across multiple axes or pictures.
+\begin{key}{/tikz/data visualization/axis options/unit length=\meta{dimension}\opt{| per |\meta{number}| units|}}
+ Sets |scaling| to |0 at 0cm and 1 at |\meta{dimension}. In other words,
+ this key allows you to specify how long a single unit should be. This key
+ is particularly useful when you wish to ensure that the same scaling is
+ used across multiple axes or pictures.
+ %
\begin{codeexample}[]
\tikz \datavisualization [scientific axes,
all axes={ticks=few, unit length=1mm},
@@ -559,12 +582,13 @@ predefined styles documented in the following.
13, 20
};
\end{codeexample}
- The optional |per |\meta{number}| units| allows you to apply more
- drastic scaling. Suppose that you want to plot a graph where one
- billion corresponds to one centimeter. Then the unit length would be
- need to be set to a hundredth of a nanometer -- much too small for
- \TeX\ to handle as a dimension. In this case, you can write
- |unit length=1cm per 1000000000 units|:
+ The optional |per |\meta{number}| units| allows you to apply more drastic
+ scaling. Suppose that you want to plot a graph where one billion
+ corresponds to one centimeter. Then the unit length would be need to be set
+ to a hundredth of a nanometer -- much too small for \TeX\ to handle as a
+ dimension. In this case, you can write
+ |unit length=1cm per 1000000000 units|:
+ %
\begin{codeexample}[]
\tikz \datavisualization
[scientific axes,
@@ -578,18 +602,19 @@ predefined styles documented in the following.
13000000000, 20
};
\end{codeexample}
+ %
\end{key}
-\begin{key}{/tikz/data visualization/axis
- options/power unit length=\meta{dimension}}
- This key is used in conjunction with the |logarithmic| setting. It
- cases the |scaling| to be set to
- |1 at 0cm and 10 at |\meta{dimension}. This causes a ``power unit,''
- that is, one power of ten in a logarithmic plot, to get a length of
- \meta{dimension}. Again, this key is useful for ensuring that the
- same scaling is used across multiple axes or pictures.
+%
+\begin{key}{/tikz/data visualization/axis options/power unit length=\meta{dimension}}
+ This key is used in conjunction with the |logarithmic| setting. It cases
+ the |scaling| to be set to |1 at 0cm and 10 at |\meta{dimension}. This
+ causes a ``power unit'', that is, one power of ten in a logarithmic plot,
+ to get a length of \meta{dimension}. Again, this key is useful for ensuring
+ that the same scaling is used across multiple axes or pictures.
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization
- [scientific axes,
+ [scientific axes,
y axis={logarithmic, power unit length=1mm, grid},
visualize as line]
data {
@@ -603,25 +628,26 @@ predefined styles documented in the following.
6, 5000000000000000000
};
\end{codeexample}
+ %
\end{key}
-
\subsubsection{Axis Label}
-An axis can have a \emph{label}, which is a textual representation of
-the attribute according to which the axis varies the position of the
-page. You can set the attribute using the following key:
-
-\begin{key}{/tikz/data visualization/axis
- options/label=\opt{|\char`\{[|\meta{options}|]|}\meta{text}\opt{|\char`\}|}
- (default \normalfont axis's label in math mode)}
- This key sets the label of an axis to \meta{text}. This text will
- typically be placed inside a |node| and the \meta{options} can be
- used to further configure the way this node is rendered. The
- \meta{options} will be executed with the path prefix
- |/tikz/data visualization/|, so you need to say |node style| to
- configure the styling of a node, see Section~\ref{section-dv-style}.
+An axis can have a \emph{label}, which is a textual representation of the
+attribute according to which the axis varies the position of the page. You can
+set the attribute using the following key:
+
+\begin{key}{/tikz/data visualization/axis options/label=\opt{|\char`\{[|\meta{options}|]|}\meta{text}\opt{|\char`\}|}
+ (default \normalfont axis's label in math mode)%
+}
+ This key sets the label of an axis to \meta{text}. This text will typically
+ be placed inside a |node| and the \meta{options} can be used to further
+ configure the way this node is rendered. The \meta{options} will be
+ executed with the path prefix |/tikz/data visualization/|, so you need to
+ say |node style| to configure the styling of a node, see
+ Section~\ref{section-dv-style}.
+ %
\begin{codeexample}[]
\tikz \datavisualization [
scientific axes,
@@ -632,55 +658,52 @@ page. You can set the attribute using the following key:
var x : interval [-3:5];
func y = \value x * \value x;
};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
-Note that using the |label| key does not actually cause a node to be
-created, because it is somewhat unclear where the label should be
-placed. Instead, the |visualize label| key is used (typically
-internally by an axis system) to show the label at some sensible
-position. This key is documented in
-Section~\ref{section-dv-visualize-label}.
-
+Note that using the |label| key does not actually cause a node to be created,
+because it is somewhat unclear where the label should be placed. Instead, the
+|visualize label| key is used (typically internally by an axis system) to show
+the label at some sensible position. This key is documented in
+Section~\ref{section-dv-visualize-label}.
\subsubsection{Reference: Axis Types}
-
\label{section-dv-reference-axis-types}
-As explained earlier, when you use |new axis base| to create a new axis,
-a powerful scaling and attribute mapping mechanism is installed, but
-no mapping of values to positions on the page is performed. For this,
-a \emph{transformation object} must be installed. The following keys
-take care of this for you. Note, however, that even these keys do not
-cause a visual representation of the axis to be added to the
-visualization -- this is the job of an axis system, see
-Section~\ref{section-dv-axis-systems}.
+As explained earlier, when you use |new axis base| to create a new axis, a
+powerful scaling and attribute mapping mechanism is installed, but no mapping
+of values to positions on the page is performed. For this, a
+\emph{transformation object} must be installed. The following keys take care of
+this for you. Note, however, that even these keys do not cause a visual
+representation of the axis to be added to the visualization -- this is the job
+of an axis system, see Section~\ref{section-dv-axis-systems}.
\begin{key}{/tikz/data visualization/new Cartesian axis=\meta{name}}
- This key creates a new ``Cartesian'' axis, named \meta{name}. For
- such an axis, the (scaled) values of the axis's attribute are
- transformed into a displacement on the page along a straight
- line. The following key is used to configure in which ``direction''
- the axis points:
- \begin{key}{/tikz/data visualization/axis options/unit
- vector=\meta{coordinate} (initially {(1pt,0pt)})}
- Recall that an axis takes the values of an attribute and rescales
- them so that they fit into a ``reasonable'' interval
- $[t_1,t_2]$. Suppose that $v'$ is the rescaled dimension in (\TeX)
- points. Then when the data point is visualized, the coordinate
- system will be shifted by $v'$ times the \meta{coordinate}.
-
- As an example, suppose that you have said
- |scaling=0 and 10pt and 50 and 20pt|. Then when the underlying
- attribute has the value |25|, it will be mapped to a $v'$ of $15$
- (because |25| lies in the middle of |0| and |50| and |15pt| lies
- in the middle of |10pt| and |20pt|). This, in turn, causes the
- data point to be displaced by $15$ times the \meta{coordinate}.
-
- The bottom line is that the \meta{coordinate} should usually
- denote a point that is at distance |1pt| from the origin and that
- points into the direction of the axis.
+ This key creates a new ``Cartesian'' axis, named \meta{name}. For such an
+ axis, the (scaled) values of the axis's attribute are transformed into a
+ displacement on the page along a straight line. The following key is used
+ to configure in which ``direction'' the axis points:
+ %
+ \begin{key}{/tikz/data visualization/axis options/unit vector=\meta{coordinate} (initially {(1pt,0pt)})}
+ Recall that an axis takes the values of an attribute and rescales them
+ so that they fit into a ``reasonable'' interval $[t_1,t_2]$. Suppose
+ that $v'$ is the rescaled dimension in (\TeX) points. Then when the
+ data point is visualized, the coordinate system will be shifted by $v'$
+ times the \meta{coordinate}.
+
+ As an example, suppose that you have said
+ |scaling=0 and 10pt and 50 and 20pt|. Then when the underlying
+ attribute has the value |25|, it will be mapped to a $v'$ of $15$
+ (because |25| lies in the middle of |0| and |50| and |15pt| lies in the
+ middle of |10pt| and |20pt|). This, in turn, causes the data point to
+ be displaced by $15$ times the \meta{coordinate}.
+
+ The bottom line is that the \meta{coordinate} should usually denote a
+ point that is at distance |1pt| from the origin and that points into
+ the direction of the axis.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -703,71 +726,72 @@ Section~\ref{section-dv-axis-systems}.
};
\end{tikzpicture}
\end{codeexample}
-\end{key}
+ \end{key}
\end{key}
-
\subsection{Axis Systems}
\label{section-dv-axis-systems}
+An \emph{axis system} is, as the name suggests, a whole family of axes that act
+in concert. For example, in the ``standard'' axis system there is a horizontal
+axis called the $x$-axis that monitors the |x| attribute (by default, you can
+change this easily) and a vertical axis called the $y$-axis. Furthermore, a
+certain number of ticks are added and labels are placed at sensible positions.
-An \emph{axis system} is, as the name suggests, a whole family of axes
-that act in concert. For example, in the ``standard'' axis system there
-is a horizontal axis called the $x$-axis that monitors the |x|
-attribute (by default, you can change this easily) and a vertical axis
-called the $y$-axis. Furthermore, a certain number of ticks are added
-and labels are placed at sensible positions.
\subsubsection{Usage}
-Using an axis system is usually pretty easy: You just specify a key
-like |scientific axes| and the necessary axes get initialized with
-sensible default values. You can then start to modify these default
-values, if necessary.
+Using an axis system is usually pretty easy: You just specify a key like
+|scientific axes| and the necessary axes get initialized with sensible default
+values. You can then start to modify these default values, if necessary.
-First, you can (and should) set the attributes to which the difference
-axes refer. For instance, if the |time| attribute is plotted along the
-$x$-axis, you would write
+First, you can (and should) set the attributes to which the difference axes
+refer. For instance, if the |time| attribute is plotted along the $x$-axis, you
+would write
+%
\begin{codeexample}[code only]
x axis = {attribute = time}
\end{codeexample}
-Second, you may wish to modify the lengths of the axes. For this, you
-can use keys like |length| or further keys as described in the
-references later on.
+Second, you may wish to modify the lengths of the axes. For this, you can use
+keys like |length| or further keys as described in the references later on.
-Third, you may often wish to modify how many ticks and grid lines are
-shown. By default, no grid lines are shown, but you can say the
-following in order to cause grid lines to be shown:
+Third, you may often wish to modify how many ticks and grid lines are shown. By
+default, no grid lines are shown, but you can say the following in order to
+cause grid lines to be shown:
+%
\begin{codeexample}[code only]
all axes={grid}
\end{codeexample}
-Naturally, instead of |all axes| you can also specify a single axis,
-causing only grid lines to be shown for this axis.
-In order to change the number of ticks that are shown, you can say
+%
+Naturally, instead of |all axes| you can also specify a single axis, causing
+only grid lines to be shown for this axis. In order to change the number of
+ticks that are shown, you can say
+%
\begin{codeexample}[code only]
-all axes={ticks=few}
+all axes={ticks=few}
\end{codeexample}
-or also |many| instead of |few| or even |none|. Far more fine-grained
-control over the tick placement and rendering is possible,
-see Section~\ref{section-dv-ticks-and-grids} for details.
+%
+or also |many| instead of |few| or even |none|. Far more fine-grained control
+over the tick placement and rendering is possible, see
+Section~\ref{section-dv-ticks-and-grids} for details.
Fourth, consider adding units (like ``cm'' for centimeters or
-``$\mathrm m/\mathrm s^2$'' for acceleration) to your ticks:
+``$\mathrm{m}/\mathrm{s}^2$'' for acceleration) to your ticks:
+%
\begin{codeexample}[code only]
-x axis={ticks={tick unit=cm}}, y axis={ticks={tick unit=m/s^2}}
+x axis={ticks={tick unit=cm}}, y axis={ticks={tick unit=m/s^2}}
\end{codeexample}
-
-Finally, consider adding labels to your axes. For this, use the label
-option:
+Finally, consider adding labels to your axes. For this, use the label option:
+%
\begin{codeexample}[code only]
-x axes={time $t$ (ms)}, y axis={distance $d$ (mm)}
+x axes={time $t$ (ms)}, y axis={distance $d$ (mm)}
\end{codeexample}
Here is an example that employs most of the above features:
-
+%
\begin{codeexample}[width=8.5cm]
\tikz \datavisualization [
scientific axes=clean,
@@ -790,13 +814,12 @@ data {
\end{codeexample}
-
\subsubsection{Reference: Scientific Axis Systems}
\begin{key}{/tikz/data visualization/scientific axes=\opt{\meta{options}}}
- This key installs a two-dimensional coordinate system based on the
- attributes |/data point/x| and |/data point/y|.
-
+ This key installs a two-dimensional coordinate system based on the
+ attributes |/data point/x| and |/data point/y|.
+ %
\begin{codeexample}[width=7cm]
\begin{tikzpicture}
\datavisualization [scientific axes,
@@ -808,24 +831,25 @@ data {
\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.
+ 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.
- You can use the \meta{options} to fine tune the axis system. The
- \meta{options} will be executed with the following path prefix:
+ You can use the \meta{options} to fine tune the axis system. The
+ \meta{options} will be executed with the following path prefix:
+ %
\begin{codeexample}[code only]
-/tikz/data visualization/scientific axes
+/tikz/data visualization/scientific axes
\end{codeexample}
- All keys with this prefix can thus be passed as \meta{options}.
-
- 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'':
+ %
+ All keys with this prefix can thus be passed as \meta{options}.
+ 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,
@@ -838,44 +862,46 @@ data {
\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.
- \end{itemize}
+ 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.
+ \end{itemize}
- The following keys are executed by default as options: |outer ticks|
- and |standard labels|.
+ The following keys are executed by default as options: |outer ticks| and
+ |standard labels|.
- You can use the following style to overrule the defaults:
+ You can use the following style to overrule the defaults:
- \begin{stylekey}{/tikz/data visualization/every scientific axes}
- \end{stylekey}
+ \begin{stylekey}{/tikz/data visualization/every scientific axes}
+ \end{stylekey}
\end{key}
-The keys described in the following can be used to fine-tune the way
-the scientific axis system is rendered.
+The keys described in the following can be used to fine-tune the way the
+scientific axis system is rendered.
\begin{key}{/tikz/data visualization/scientific axes/outer ticks}
- This causes the ticks to be drawn `` on the outside'' of the frame
- so that they interfere as little as possible with the data. It is
- the default.
-
+ This causes the ticks to be drawn `` on the outside'' of the frame so that
+ they interfere as little as possible with the data. It is the default.
+ %
\begin{codeexample}[width=7cm]
\begin{tikzpicture}
\datavisualization [scientific axes=outer ticks,
@@ -886,12 +912,13 @@ the scientific axis system is rendered.
};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/scientific axes/inner ticks}
- This axis system works like |scientific axes|, only the ticks are on
- the ``inside'' of the frame.
-
+ This axis system works like |scientific axes|, only the ticks are on the
+ ``inside'' of the frame.
+ %
\begin{codeexample}[width=7cm]
\begin{tikzpicture}
\datavisualization [scientific axes=inner ticks,
@@ -903,9 +930,10 @@ the scientific axis system is rendered.
\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:
+ 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 axes={inner ticks, width=3.2cm},
@@ -927,14 +955,14 @@ the scientific axis system is rendered.
};
\end{tikzpicture}
\end{codeexample}
-
+ %
\end{key}
\begin{key}{/tikz/data visualization/scientific axes/clean}
- 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.
-
+ 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}[width=7.5cm]
\tikz \datavisualization [
scientific axes=clean,
@@ -945,19 +973,19 @@ data [format=function] {
};
\end{codeexample}
- The distance of the axes from the actual plot is given by the
- padding of the axes.
+ 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.
+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.
+ 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}[width=8cm]
\tikz \datavisualization
[scientific axes={clean, standard labels},
@@ -970,11 +998,13 @@ data [format=function] {
func y = sin(\value x);
};
\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.
+ Works like |scientific axes standard labels|, only the label of the
+ $y$-axis is not rotated.
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
scientific axes={clean, upright labels},
@@ -990,12 +1020,13 @@ data [format=function] {
func y = cos(\value x);
};
\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.
+ 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}[width=8cm]
\tikz \datavisualization [
scientific axes={clean, end labels},
@@ -1008,28 +1039,26 @@ data [format=function] {
func y = tan(\value x);
};
\end{codeexample}
+ %
\end{key}
-
\subsubsection{Reference: School Book Axis Systems}
\begin{key}{/tikz/data visualization/school book axes=\meta{options}}
- 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.''
-
+ 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]
@@ -1040,15 +1069,17 @@ data [format=function] {
\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.
-
- The \meta{options} are executed with the key itself as path
- prefix. Thus, the following subkeys are permissible options:
- \begin{key}{/tikz/data visualization/school book axes/unit=\meta{value}}
- Sets the scaling so that 1\,cm corresponds to \meta{value}
- units. At the same time, the stepping of the ticks will also be
- set to \meta{value}.
+ The stepping of the ticks is one unit by default. Using keys like
+ |ticks=some| may help to give better steppings.
+
+ The \meta{options} are executed with the key itself as path prefix. Thus,
+ the following subkeys are permissible options:
+ %
+ \begin{key}{/tikz/data visualization/school book axes/unit=\meta{value}}
+ Sets the scaling so that 1\,cm corresponds to \meta{value} units. At
+ the same time, the stepping of the ticks will also be set to
+ \meta{value}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\datavisualization [school book axes={unit=10},
@@ -1062,15 +1093,16 @@ data [format=function] {
};
\end{tikzpicture}
\end{codeexample}
- \end{key}
+ \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.
+ \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.
+ Currently, this is the only supported placement strategy for the school
+ book axis system.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\datavisualization [school book axes={standard labels},
@@ -1084,29 +1116,25 @@ data [format=function] {
};
\end{tikzpicture}
\end{codeexample}
- \end{key}
+ \end{key}
\end{key}
-
\subsubsection{Advanced Reference: 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.
+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.
-
+ 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]
@@ -1117,122 +1145,112 @@ positions.
\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}
-
+ \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}
-
+ 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}
-
+ 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.
+ Like |xyz Cartesian cabinet|, but for the $uvw$-system.
- \begin{key}{/tikz/data visualization/uvw axes=\meta{options}}
- Like |xyz axes|.
- \end{key}
+ \begin{key}{/tikz/data visualization/uvw axes=\meta{options}}
+ Like |xyz axes|.
+ \end{key}
\end{key}
-
\subsection{Ticks and Grids}
\label{section-dv-ticks-and-grids}
-
\subsubsection{Concepts}
-A \emph{tick} is a small visual indication on an axis of the value of
-the axis's attribute at the position where the tick is shown. A tick
-may be accompanied additionally by a textual representation, but it
-need not. A \emph{grid line} is similar to a tick, but it is not an
-indication on the axis, but rather a whole line that indicates all
-positions where the attribute has a certain value. Unlike ticks,
-grid lines (currently) are not accompanied by a textual
-representation.
-
-Just as for axes, the data visualization system decouples the
-specification of which ticks are present \emph{in principle} from
-where they are visualized. In the following, I describe how you
-specify which ticks and grid lines you would like to be drawn and how
-they should look like (their styling). The axis system of your choice
-will then visualize the ticks at a sensible position for the chosen
-system. For details on how to change where whole axis is shown along
-with its ticks, see Section~\ref{section-dv-visualize-ticks}.
-
-Specifying which ticks you are interested in is done as follows:
-First, you use |ticks| key (or, for specifying which grid lines should
-be present, the |grid| key). This key takes several possible options,
-described in detail in the following, which have different effects:
+A \emph{tick} is a small visual indication on an axis of the value of the
+axis's attribute at the position where the tick is shown. A tick may be
+accompanied additionally by a textual representation, but it need not. A
+\emph{grid line} is similar to a tick, but it is not an indication on the axis,
+but rather a whole line that indicates all positions where the attribute has a
+certain value. Unlike ticks, grid lines (currently) are not accompanied by a
+textual representation.
+
+Just as for axes, the data visualization system decouples the specification of
+which ticks are present \emph{in principle} from where they are visualized. In
+the following, I describe how you specify which ticks and grid lines you would
+like to be drawn and how they should look like (their styling). The axis system
+of your choice will then visualize the ticks at a sensible position for the
+chosen system. For details on how to change where whole axis is shown along
+with its ticks, see Section~\ref{section-dv-visualize-ticks}.
+
+Specifying which ticks you are interested in is done as follows: First, you use
+|ticks| key (or, for specifying which grid lines should be present, the |grid|
+key). This key takes several possible options, described in detail in the
+following, which have different effects:
+%
\begin{enumerate}
-\item Keys like |step=10| or |minor steps between steps| cause a
- ``semi-automatic'' computation of possible steps. Here, you
- explicitly specify the stepping of steps, but the first stepping and
- their number are computed automatically according to the range of
- possible values for the attribute.
-\item Keys like |few|, |some|, or |many| can be passed to |ticks| in
- order to have \tikzname\ compute good tick positions
- automatically. This is usually what you want to happen, which is why
- most axis system will implicitly say |ticks={some}|.
-\item Keys like |at| or |also at| provide ``absolute control'' over
- which ticks or grid lines are shown. For these keys, you can not only
- specify at what value a tick should be shown, but also its styling
- and also whether it is a major, minor, or subminor tick or grid line.
+ \item Keys like |step=10| or |minor steps between steps| cause a
+ ``semi-automatic'' computation of possible steps. Here, you explicitly
+ specify the stepping of steps, but the first stepping and their number
+ are computed automatically according to the range of possible values
+ for the attribute.
+ \item Keys like |few|, |some|, or |many| can be passed to |ticks| in order
+ to have \tikzname\ compute good tick positions automatically. This is
+ usually what you want to happen, which is why most axis system will
+ implicitly say |ticks={some}|.
+ \item Keys like |at| or |also at| provide ``absolute control'' over which
+ ticks or grid lines are shown. For these keys, you can not only specify
+ at what value a tick should be shown, but also its styling and also
+ whether it is a major, minor, or subminor tick or grid line.
\end{enumerate}
-In the following, the main keys |ticks| and |grids| are documented
-first. Then the different kinds of ways of specifying where ticks or
-grid lines should be shown are explained.
+In the following, the main keys |ticks| and |grids| are documented first. Then
+the different kinds of ways of specifying where ticks or grid lines should be
+shown are explained.
\subsubsection{The Main Options: Tick and Grid}
-\begin{key}{/tikz/data visualization/axis options/ticks=\meta{options}
- (default some)}
- This key can be passed to an axis in order to configure which ticks
- are present for the axis. The possible \meta{options} include, for
- instance, keys like |step|, which is used to specify a stepping for
- the ticks, but also keys like |major| or |minor| for specifying the
- positions of major and minor ticks in detail. The list of possible
- options is described in the rest of this section.
-
- Note that the |ticks| option will only configure which ticks should
- be shown in principle. The actual rendering is done only when the
- |visualize ticks| key is used, documented in
- Section~\ref{section-dv-visualize-ticks}, which is typically done
- only internally by an axis system.
-
- The \meta{options} will be executed with the path prefix
- |/tikz/data visualization/|. When the |ticks| key is used multiple
- times for an axis, the \meta{options} accumulate.
+\begin{key}{/tikz/data visualization/axis options/ticks=\meta{options} (default some)}
+ This key can be passed to an axis in order to configure which ticks are
+ present for the axis. The possible \meta{options} include, for instance,
+ keys like |step|, which is used to specify a stepping for the ticks, but
+ also keys like |major| or |minor| for specifying the positions of major and
+ minor ticks in detail. The list of possible options is described in the
+ rest of this section.
+
+ Note that the |ticks| option will only configure which ticks should be
+ shown in principle. The actual rendering is done only when the
+ |visualize ticks| key is used, documented in
+ Section~\ref{section-dv-visualize-ticks}, which is typically done only
+ internally by an axis system.
+
+ The \meta{options} will be executed with the path prefix
+ |/tikz/data visualization/|. When the |ticks| key is used multiple times
+ for an axis, the \meta{options} accumulate.
+ %
\begin{codeexample}[width=6cm]
\tikz \datavisualization [
scientific axes, visualize as line,
@@ -1251,29 +1269,29 @@ grid lines should be shown are explained.
80, 0.47
};
\end{codeexample}
+ %
\end{key}
-\begin{key}{/tikz/data visualization/axis options/grid=\meta{options}
- (default at default ticks)}
- This key is similar to |ticks|, only it is used to configure where
- grid lines should be shown rather than ticks. In particular, the
- options that can be passed to the |ticks| key can also be passed to
- the |grid| key. Just like |ticks|, the \meta{options} only specify
- which grid lines should be drawn in principle; it is the job of the
- |visualize grid| key to actually cause any grid lines to be shown.
+\begin{key}{/tikz/data visualization/axis options/grid=\meta{options} (default at default ticks)}
+ This key is similar to |ticks|, only it is used to configure where grid
+ lines should be shown rather than ticks. In particular, the options that
+ can be passed to the |ticks| key can also be passed to the |grid| key. Just
+ like |ticks|, the \meta{options} only specify which grid lines should be
+ drawn in principle; it is the job of the |visualize grid| key to actually
+ cause any grid lines to be shown.
- If you do not specify any \meta{options}, the default text
- |at default ticks| is used. This option causes grid lines to be
- drawn at all positions where ticks are shown by default. Since this
- usually exactly what you would like to happen, most of the time you
- just need to |all axes=grid| to cause a grid to be shown.
+ If you do not specify any \meta{options}, the default text
+ |at default ticks| is used. This option causes grid lines to be drawn at
+ all positions where ticks are shown by default. Since this usually exactly
+ what you would like to happen, most of the time you just need to
+ |all axes=grid| to cause a grid to be shown.
\end{key}
\begin{key}{/tikz/data visualization/axis options/ticks and grid=\meta{options}}
- This key passes the \meta{options} to both the |ticks| key and also
- to the |grid| key. This is useful when you want to specify some
- special points explicitly where you wish a tick to be shown and also
- a grid line.
+ This key passes the \meta{options} to both the |ticks| key and also to the
+ |grid| key. This is useful when you want to specify some special points
+ explicitly where you wish a tick to be shown and also a grid line.
+ %
\begin{codeexample}[]
\tikz \datavisualization
[scientific axes,
@@ -1286,44 +1304,42 @@ grid lines should be shown are explained.
func y = sin(\value x r);
};
\end{codeexample}
+ %
\end{key}
\subsubsection{Semi-Automatic Computation of Tick and Grid Line Positions}
\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, 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
+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, 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:
-
+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]
@@ -1346,25 +1362,24 @@ the tick placement strategy:
\end{codeexample}
Two strategies are always available: |linear steps|, which yields
-(semi)automatic ticks are evenly spaced positions, and
-|exponential steps|, which yields (semi)automatic steps at positions
-at exponentially increasing positions -- which is exactly what is
-needed for logarithmic plots. These strategies are details in
-Section~\ref{section-dv-strategies}.
-
-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}|.
+(semi)automatic ticks are evenly spaced positions, and |exponential steps|,
+which yields (semi)automatic steps at positions at exponentially increasing
+positions -- which is exactly what is needed for logarithmic plots. These
+strategies are details in Section~\ref{section-dv-strategies}.
+
+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, see the explanations in
- Section~\ref{section-dv-strategies} for details. Basically, all
- ticks are placed at all multiples of \meta{value} that lie in the
- attribute range interval.
+ 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,
+ see the explanations in Section~\ref{section-dv-strategies} for details.
+ Basically, all ticks are placed at all multiples of \meta{value} that lie
+ in the attribute range interval.
+ %
\begin{codeexample}[]
\tikz \datavisualization [
school book axes, visualize as smooth line,
@@ -1375,16 +1390,16 @@ things like |x axis={ticks={step=2}}|, but |x axis={linear steps}|.
func y = \value x*\value x/2;
};
\end{codeexample}
+ %
\end{key}
-\begin{key}{/tikz/data visualization/minor steps between
- steps=\meta{number} (default 9)}
- Specifies that between any two major steps (whose positions are
- specified by the |step| key), there should be \meta{number} many
- minor steps. Note that the default of |9| is exactly the right
- number so that each interval between two minor steps is exactly a
- tenth of the size of a major step. See also
- Section~\ref{section-dv-strategies} for further details.
+\begin{key}{/tikz/data visualization/minor steps between steps=\meta{number} (default 9)}
+ Specifies that between any two major steps (whose positions are specified
+ by the |step| key), there should be \meta{number} many minor steps. Note
+ that the default of |9| is exactly the right number so that each interval
+ between two minor steps is exactly a tenth of the size of a major step. See
+ also Section~\ref{section-dv-strategies} for further details.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\datavisualization [school book axes, visualize as smooth line,
@@ -1397,270 +1412,260 @@ things like |x axis={ticks={step=2}}|, but |x axis={linear steps}|.
};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/phase=\meta{value} (initially 0)}
- See Section~\ref{section-dv-strategies} for details on how the phase
- of steps influences the tick placement.
+ See Section~\ref{section-dv-strategies} for details on how the phase of
+ steps influences the tick placement.
\end{key}
-
\subsubsection{Automatic Computation of Tick and Grid Line Positions}
-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.
+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 value=0,
- include value=1
- }
- }
- }
+ 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.
- \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 value=0,
- include value=\max
+ \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.023\,45$ or
+ $345\,223.76$, so $s$ must be replaced by a better value like $0.02$ in the
+ first case and perhaps $250\,000$ 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.023\,45$ would be rewritten as $2.345 \cdot 10^{-2}$ and
+ $345\,223.76$ as $3.452\,2376 \cdot 10^5$. The next step is to replace the
+ still not-so-good number $m$ like $2.345$ or $3.452\,237$ 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 value=0,
+ include value=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 value=0,
+ include value=\max
+ }
+ ];
+
+ \node at (0,-5mm) [anchor=mid] {\texttt{\about}};
+ \end{scope}
}
- ];
- \node at (0,-5mm) [anchor=mid] {\texttt{\about}};
- \end{scope}
- }
+ \node at (30pt,-5mm) [anchor=mid east] {\texttt{about=\ \ }};
+ \end{tikzpicture}
+ }
- \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|:
- 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 value=1,
- include value=1e\max
- }
- ];
- \end{scope}
- }
- \end{tikzpicture}
+ \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 value=1,
+ include value=1e\max
+ }
+ ];
+ \end{scope}
+ }
+ \end{tikzpicture}
- \medskip
- \textbf{Alternative strategies.}
+ \medskip
+ \textbf{Alternative strategies.}
- In addition to the standard |about strategy|, there are some
- additional strategies that you might wish to use instead:
+ 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/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.
+ \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}
+ \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.
+ \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}
+ \showstrategy{half about strategy}
+ \end{key}
- \begin{key}{/tikz/data visualization/decimal about strategy}
- The only permissible value for $m'$ is $1$. This is an even more
- radical version of the previous strategy.
+ \begin{key}{/tikz/data visualization/decimal about strategy}
+ The only permissible value for $m'$ is $1$. This is an even more
+ radical version of the previous strategy.
- \showstrategy{decimal about strategy}
- \end{key}
+ \showstrategy{decimal about strategy}
+ \end{key}
- \begin{key}{/tikz/data visualization/quarter about strategy}
- Permissible values for $m'$ are: $1$, $2.5$, and $5$.
+ \begin{key}{/tikz/data visualization/quarter about strategy}
+ Permissible values for $m'$ are: $1$, $2.5$, and $5$.
- \showstrategy{quarter about strategy}
- \end{key}
+ \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$.
+ \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}
+ \showstrategy{int about strategy}
+ \end{key}
\end{key}
\begin{key}{/tikz/data visualization/many}
- This is an abbreviation for |about=10|.
+ This is an abbreviation for |about=10|.
\end{key}
\begin{key}{/tikz/data visualization/some}
- This is an abbreviation for |about=5|.
+ This is an abbreviation for |about=5|.
\end{key}
\begin{key}{/tikz/data visualization/few}
- This is an abbreviation for |about=3|.
+ 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.
+ Switches off the automatic step computation. Unless you use |step=|
+ explicitly to set a stepping, no ticks will be (automatically) added.
\end{key}
-
\subsubsection{Manual Specification of Tick and Grid Line Positions}
-The automatic computation of ticks and grid lines will usually do a
-good job, but not always. For instance, you might wish to have ticks
-exactly at, say, prime numbers or at Fibonacci numbers or you might
-wish to have an additional tick at $\pi$. In these cases you need more
-direct control over the specification of tick positions.
-
-First, it is important to understand that the data visualization
-system differentiates between three kinds of
-ticks and grid lines: major, minor, and subminor. The major ticks are
-the most prominent ticks where, typically, a textual representation of
-the tick is shown; and the major grid lines are the thickest. The
-minor ticks are smaller, more numerous, and lie between major
-ticks. They are used, for instance, to indicate positions in the
-middle between major ticks or at all integer positions between major
-ticks. Finally, subminor ticks are even smaller than minor ticks and
-they lie between minor ticks.
+The automatic computation of ticks and grid lines will usually do a good job,
+but not always. For instance, you might wish to have ticks exactly at, say,
+prime numbers or at Fibonacci numbers or you might wish to have an additional
+tick at $\pi$. In these cases you need more direct control over the
+specification of tick positions.
+
+First, it is important to understand that the data visualization system
+differentiates between three kinds of ticks and grid lines: major, minor, and
+subminor. The major ticks are the most prominent ticks where, typically, a
+textual representation of the tick is shown; and the major grid lines are the
+thickest. The minor ticks are smaller, more numerous, and lie between major
+ticks. They are used, for instance, to indicate positions in the middle between
+major ticks or at all integer positions between major ticks. Finally, subminor
+ticks are even smaller than minor ticks and they lie between minor ticks.
Four keys are used to configure the different kinds:
\begin{key}{/tikz/data visualization/major=\meta{options}}
- The key can be passed as an option to the |ticks| key and also to
- the |grid| key, which in turn is passed as an option to an axis. The
- \meta{options} passed to |major| specify at which positions
- major ticks/grid lines should be shown (using the |at| option and
- |also at| option) and also any special styling. The different
- possible options are described later in this section.
+ The key can be passed as an option to the |ticks| key and also to the
+ |grid| key, which in turn is passed as an option to an axis. The
+ \meta{options} passed to |major| specify at which positions major
+ ticks/grid lines should be shown (using the |at| option and |also at|
+ option) and also any special styling. The different possible options are
+ described later in this section.
+ %
\begin{codeexample}[]
\tikz \datavisualization
[ school book axes, visualize as smooth line,
@@ -1670,10 +1675,12 @@ Four keys are used to configure the different kinds:
func y = \value x * \value x / 2;
};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/minor=\meta{options}}
- Like |major|, only for minor ticks/grid lines.
+ Like |major|, only for minor ticks/grid lines.
+ %
\begin{codeexample}[]
\tikz \datavisualization
[ school book axes, visualize as smooth line,
@@ -1683,19 +1690,20 @@ Four keys are used to configure the different kinds:
func y = \value x * \value x / 2;
};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/subminor=\meta{options}}
- Like |major|, only for subminor ticks/grid lines.
+ Like |major|, only for subminor ticks/grid lines.
\end{key}
-
\begin{key}{/tikz/data visualization/common=\meta{options}}
- This key allows you to specify \meta{options} that apply to |major|,
- |minor| and |subminor| alike. It does not make sense to use |common|
- to specify positions (since you typically do not want both a major
- and a minor tick at the same position), but it can be useful to
- configure, say, the size of all kinds of ticks:
+ This key allows you to specify \meta{options} that apply to |major|,
+ |minor| and |subminor| alike. It does not make sense to use |common| to
+ specify positions (since you typically do not want both a major and a minor
+ tick at the same position), but it can be useful to configure, say, the
+ size of all kinds of ticks:
+ %
\begin{codeexample}[]
\tikz \datavisualization
[ school book axes, visualize as smooth line,
@@ -1705,20 +1713,21 @@ Four keys are used to configure the different kinds:
func y = \value x * \value x / 2;
};
\end{codeexample}
+ %
\end{key}
-
-The following keys can now be passed to the |major|, |minor|, and
-|subminor| keys to specify where ticks or grid lines should be shown:
+The following keys can now be passed to the |major|, |minor|, and |subminor|
+keys to specify where ticks or grid lines should be shown:
\begin{key}{/tikz/data visualization/at=\meta{list}}
- Basically, the \meta{list} must be a list of values that is
- processed with the |\foreach| macro (thus, it can contain ellipses
- to specify ranges of value). Empty values are skipped.
-
- The effect of passing |at| to a |major|, |minor|, or |subminor| key
- is that ticks or grid lines on the axis will be placed exactly at
- the values in \meta{list}. Here is an example:
+ Basically, the \meta{list} must be a list of values that is processed with
+ the |\foreach| macro (thus, it can contain ellipses to specify ranges of
+ value). Empty values are skipped.
+
+ The effect of passing |at| to a |major|, |minor|, or |subminor| key is that
+ ticks or grid lines on the axis will be placed exactly at the values in
+ \meta{list}. Here is an example:
+ %
\begin{codeexample}[]
\tikz \datavisualization
[ school book axes, visualize as smooth line,
@@ -1727,44 +1736,48 @@ The following keys can now be passed to the |major|, |minor|, and
var x : interval [-1.25:2];
func y = \value x * \value x / 2;
};
-\end{codeexample}
- When this option is used, any previously specified tick positions
- are overwritten by the values in \meta{list}. Automatically computed
- ticks are also overwritten. Thus, this option gives you complete
- control over where ticks should be placed.
-
- Normally, the individual values inside the \meta{list} are just
- numbers that are specified in the same way as an attribute
- value. However, such a value may also contain the keyword |as|,
- which allows you so specify the styling of the tick in
- detail. Section~\ref{section-dv-ticks-styling} details how this
- works.
-
- It is often a bit cumbersome that one has to write things like
-\begin{codeexample}[code only]
-some axis = {ticks = {major = {at = {...}}}}
\end{codeexample}
- A slight simplification is given by the following keys, which can be
- passed directly to |ticks| and |grid|:
- \begin{key}{/tikz/data visualization/major at=\meta{list}}
- A shorthand for |major={at={|\meta{list}|}}|.
- \end{key}
- \begin{key}{/tikz/data visualization/minor at=\meta{list}}
- A shorthand for |major={at={|\meta{list}|}}|.
- \end{key}
- \begin{key}{/tikz/data visualization/subminor at=\meta{list}}
- A shorthand for |major={at={|\meta{list}|}}|.
- \end{key}
+ When this option is used, any previously specified tick positions are
+ overwritten by the values in \meta{list}. Automatically computed ticks are
+ also overwritten. Thus, this option gives you complete control over where
+ ticks should be placed.
+
+ Normally, the individual values inside the \meta{list} are just numbers
+ that are specified in the same way as an attribute value. However, such a
+ value may also contain the keyword |as|, which allows you so specify the
+ styling of the tick in detail. Section~\ref{section-dv-ticks-styling}
+ details how this works.
+
+ It is often a bit cumbersome that one has to write things like
+ %
+\begin{codeexample}[code only]
+some axis = {ticks = {major = {at = {...}}}}
+\end{codeexample}
+ %
+ A slight simplification is given by the following keys, which can be passed
+ directly to |ticks| and |grid|:
+ %
+ \begin{key}{/tikz/data visualization/major at=\meta{list}}
+ A shorthand for |major={at={|\meta{list}|}}|.
+ \end{key}
+ %
+ \begin{key}{/tikz/data visualization/minor at=\meta{list}}
+ A shorthand for |major={at={|\meta{list}|}}|.
+ \end{key}
+ %
+ \begin{key}{/tikz/data visualization/subminor at=\meta{list}}
+ A shorthand for |major={at={|\meta{list}|}}|.
+ \end{key}
\end{key}
\begin{key}{/tikz/data visualization/also at=\meta{list}}
- This key is similar to |at|, but it causes ticks or grid lines to be
- placed at the positions in the \meta{list} \emph{in addition} to the
- ticks that have already been specified either directly using |at| or
- indirectly using keys like |step| or |some|. The effect of multiple
- calls of this key accumulate. However, when |at| is used after an
- |also at| key, the |at| key completely resets the positions where
- ticks or grid lines are shown.
+ This key is similar to |at|, but it causes ticks or grid lines to be placed
+ at the positions in the \meta{list} \emph{in addition} to the ticks that
+ have already been specified either directly using |at| or indirectly using
+ keys like |step| or |some|. The effect of multiple calls of this key
+ accumulate. However, when |at| is used after an |also at| key, the |at| key
+ completely resets the positions where ticks or grid lines are shown.
+ %
\begin{codeexample}[]
\tikz \datavisualization
[ school book axes, visualize as smooth line,
@@ -1773,101 +1786,102 @@ some axis = {ticks = {major = {at = {...}}}}
var x : interval [-1.25:2];
func y = \value x * \value x / 2;
};
-\end{codeexample}
- As for |at|, there are some shorthands available:
- \begin{key}{/tikz/data visualization/major also at=\meta{list}}
- A shorthand for |major={also at={|\meta{list}|}}|.
- \end{key}
- \begin{key}{/tikz/data visualization/minor also at=\meta{list}}
- A shorthand for |major={also at={|\meta{list}|}}|.
- \end{key}
- \begin{key}{/tikz/data visualization/subminor also at=\meta{list}}
- A shorthand for |major={also at={|\meta{list}|}}|.
- \end{key}
+\end{codeexample}
+ %
+ As for |at|, there are some shorthands available:
+ %
+ \begin{key}{/tikz/data visualization/major also at=\meta{list}}
+ A shorthand for |major={also at={|\meta{list}|}}|.
+ \end{key}
+ %
+ \begin{key}{/tikz/data visualization/minor also at=\meta{list}}
+ A shorthand for |major={also at={|\meta{list}|}}|.
+ \end{key}
+ %
+ \begin{key}{/tikz/data visualization/subminor also at=\meta{list}}
+ A shorthand for |major={also at={|\meta{list}|}}|.
+ \end{key}
\end{key}
\subsubsection{Styling Ticks and Grid Lines: Introduction}
-
\label{section-dv-ticks-styling}
-When a tick, a tick label, or a grid line is visualized on the page, a
-whole regiment of styles influences the appearance. The reason for
-this large number of interdependent styles is the fact that we often
-wish to influence only a very certain part of how a tick is rendered
-while leaving the other aspects untouched: Sometimes we need to modify
-just the font of the tick label; sometimes we wish to change the
-length of the tick label and the tick label position at the same time;
-sometimes we wish to change the color of grid line, tick, and tick
-label; and sometimes we wish to generally change the thickness of all
-ticks.
-
-Let us go over the different kinds of things that can be styled (grid
-lines, ticks, and tick labels) one by one and let us have a look at
-which styles are involved. We will start with the grid lines, since they
-turn out to be the most simple, but first let us have a look at the
-general |style| and |styling| mechanism that is used in many placed in
-the following:
+When a tick, a tick label, or a grid line is visualized on the page, a whole
+regiment of styles influences the appearance. The reason for this large number
+of interdependent styles is the fact that we often wish to influence only a
+very certain part of how a tick is rendered while leaving the other aspects
+untouched: Sometimes we need to modify just the font of the tick label;
+sometimes we wish to change the length of the tick label and the tick label
+position at the same time; sometimes we wish to change the color of grid line,
+tick, and tick label; and sometimes we wish to generally change the thickness
+of all ticks.
+
+Let us go over the different kinds of things that can be styled (grid lines,
+ticks, and tick labels) one by one and let us have a look at which styles are
+involved. We will start with the grid lines, since they turn out to be the most
+simple, but first let us have a look at the general |style| and |styling|
+mechanism that is used in many placed in the following:
-\subsubsection{Styling Ticks and Grid Lines: The Style and Node Style Keys}
+\subsubsection{Styling Ticks and Grid Lines: The Style and Node Style Keys}
\label{section-dv-style}
All keys of the data visualization system have the path prefix
-|/tikz/data visualization|. This is not only true for the main keys
-like |scientific axes| or |visualize as line|, but also for keys that
-govern how ticks are visualized. In particular, a style like
-|every major grid| has the path prefix |/tikz/data visualization| and
-all keys stored in this style are also executed with this path
-prefix.
-
-Normally, this does not cause any trouble since most of the keys and
-even styles used in a data visualization are intended to configure
-what is shown in the visualization. However, at some point, we may
-also with to specify options that no longer configure the
-visualization in general, but specify the appearance of a line or a
-node on the \tikzname\ layer.
+|/tikz/data visualization|. This is not only true for the main keys like
+|scientific axes| or |visualize as line|, but also for keys that govern how
+ticks are visualized. In particular, a style like |every major grid| has the
+path prefix |/tikz/data visualization| and all keys stored in this style are
+also executed with this path prefix.
+
+Normally, this does not cause any trouble since most of the keys and even
+styles used in a data visualization are intended to configure what is shown in
+the visualization. However, at some point, we may also with to specify options
+that no longer configure the visualization in general, but specify the
+appearance of a line or a node on the \tikzname\ layer.
Two keys are used to ``communicate'' with the \tikzname\ layer:
\begin{key}{/tikz/data visualization/style=\meta{\tikzname\ options}}
- This key takes options whose path prefix is |/tikz|, not
- |/tikz/data visualization|. These options will be \emph{appended} to
- a current list of such options (thus, multiple calls of this key
- accumulate). The resulting list of keys is not executed
- immediately, but it will be executed whenever the data visualization
- engine calls the \tikzname\ layer to draw something (this placed
- will be indicated in the following).
+ This key takes options whose path prefix is |/tikz|, not
+ |/tikz/data visualization|. These options will be \emph{appended} to a
+ current list of such options (thus, multiple calls of this key accumulate).
+ The resulting list of keys is not executed immediately, but it will be
+ executed whenever the data visualization engine calls the \tikzname\ layer
+ to draw something (this placed will be indicated in the following).
+ %
\begin{codeexample}[]
\tikz \datavisualization
[scientific axes,
all axes={ticks={style=blue}, length=3cm},
- y axis={grid, grid={minor steps between steps, major={style=red}}},
+ y axis={grid, grid={minor steps between steps, major={style=red}}},
visualize as line]
data [format=function] {
var x : interval [5:10];
func y = \value x * \value x;
};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/styling}
- Executing this key will cause all ``accumulated'' \tikzname\ options
- from previous calls to the key |/tikz/data visualization/style| to be
- executed. Thus, you use |style| to set \tikzname\ options, but you
- use |styling| to actually apply these options. Usually, you do not
- call this option directly since this application is only done deep
- inside the data visualization engine.
+ Executing this key will cause all ``accumulated'' \tikzname\ options from
+ previous calls to the key |/tikz/data visualization/style| to be executed.
+ Thus, you use |style| to set \tikzname\ options, but you use |styling| to
+ actually apply these options. Usually, you do not call this option directly
+ since this application is only done deep inside the data visualization
+ engine.
\end{key}
-Similar to |style| (and |styling|) there also exist the
-|node style| (and |node styling|) key that takes \tikzname\ options that
-apply to nodes only -- in addition to the usual |style|.
+Similar to |style| (and |styling|) there also exist the |node style| (and
+|node styling|) key that takes \tikzname\ options that apply to nodes only --
+in addition to the usual |style|.
\begin{key}{/tikz/data visualization/node style=\meta{\tikzname\ options}}
- This key works like |style|, only it has an effect only on nodes
- that are created during a data visualization. This includes tick
- labels and axis labels:
+ This key works like |style|, only it has an effect only on nodes that are
+ created during a data visualization. This includes tick labels and axis
+ labels:
+ %
\begin{codeexample}[]
\tikz \datavisualization
[scientific axes,
@@ -1878,13 +1892,14 @@ apply to nodes only -- in addition to the usual |style|.
func y = \value x * \value x;
};
\end{codeexample}
- Note that in the example the ticks themselves (the little thicker
- lines) are not red.
+ %
+ Note that in the example the ticks themselves (the little thicker lines)
+ are not red.
\end{key}
\begin{key}{/tikz/data visualization/node styling}
- Executing this key will cause all ``accumulated'' node stylings to
- be executed.
+ Executing this key will cause all ``accumulated'' node stylings to be
+ executed.
\end{key}
@@ -1892,40 +1907,35 @@ apply to nodes only -- in addition to the usual |style|.
\label{section-dv-styling-grid-lines}
When a grid line is visualized, see
-Section~\ref{section-dv-visualize-gridlines} for details on when this
-happens, the following styles are executed in the specified order.
-
+Section~\ref{section-dv-visualize-gridlines} for details on when this happens,
+the following styles are executed in the specified order.
+%
\begin{enumerate}
-\item
- |grid layer|.
-\item
- |every grid|.
-\item |every major grid| or |every minor grid| or
- |every subminor grid|, depending on the kind of grid line.
-\item
- locally specified options for the individual grid line, see
- Section~\ref{section-dv-local-styles}.
-\item
- |styling|, see Section~\ref{section-dv-style}.
+ \item |grid layer|.
+ \item |every grid|.
+ \item |every major grid| or |every minor grid| or |every subminor grid|,
+ depending on the kind of grid line.
+ \item locally specified options for the individual grid line, see
+ Section~\ref{section-dv-local-styles}.
+ \item |styling|, see Section~\ref{section-dv-style}.
\end{enumerate}
-All of these keys have the path prefix
-|/tikz/data visualization|. However, the options stored in the first
-style (|grid layer|) and also in the last (|styling|) are executed
-with the path prefix |/tikz| (see Section~\ref{section-dv-style}).
+All of these keys have the path prefix |/tikz/data visualization|. However, the
+options stored in the first style (|grid layer|) and also in the last
+(|styling|) are executed with the path prefix |/tikz| (see
+Section~\ref{section-dv-style}).
Let us now have a look at these keys in detail:
\begin{stylekey}{/tikz/data visualization/grid layer (initially on background layer)}
- \label{section-dv-grid-layer}%
- This key is used to specified the \emph{layer} on which grid lines
- should be drawn (layers are explained in
- Section~\ref{section-tikz-backgrounds}). By default, all grid lines
- are placed on the |background| layer and thus behind the data
- visualization. This is a sensible strategy since it avoids obscuring
- the more important data with the far less important grid
- lines. However, you can change this style to ``get the grid lines to
- the front'':
+\label{section-dv-grid-layer}%
+ This key is used to specified the \emph{layer} on which grid lines should
+ be drawn (layers are explained in Section~\ref{section-tikz-backgrounds}).
+ By default, all grid lines are placed on the |background| layer and thus
+ behind the data visualization. This is a sensible strategy since it avoids
+ obscuring the more important data with the far less important grid lines.
+ However, you can change this style to ``get the grid lines to the front'':
+ %
\begin{codeexample}[]
\tikz \datavisualization
[scientific axes,
@@ -1940,26 +1950,29 @@ Let us now have a look at these keys in detail:
var x : interval [5:10];
func y = \value x * \value x;
};
-\end{codeexample}
- When this style is executed, the keys stored in the style will be
- executed with the prefix |/tikz|. Normally, you should only set this
- style to be empty or to |on background layer|.
+\end{codeexample}
+ %
+ When this style is executed, the keys stored in the style will be executed
+ with the prefix |/tikz|. Normally, you should only set this style to be
+ empty or to |on background layer|.
\end{stylekey}
\begin{stylekey}{/tikz/data visualization/every grid}
- This style provides overall configuration options for grid lines. By
- default, it is set to the following:
+ This style provides overall configuration options for grid lines. By
+ default, it is set to the following:
+ %
\begin{codeexample}[code only]
low=min, high=max
\end{codeexample}
- This causes grid lines to span all possible values when they are
- visualized, which is usually the desired behaviour (the |low| and
- |high| keys are explained in
- Section~\ref{section-dv-visualize-ticks}. You can append
- the |style| key to this style to configure the overall appearance of
- grid lines. In the following example we cause all grid lines to be
- dashed (which is not a good idea in general since it creates a
- distracting background pattern).
+ %
+ This causes grid lines to span all possible values when they are
+ visualized, which is usually the desired behaviour (the |low| and |high|
+ keys are explained in Section~\ref{section-dv-visualize-ticks}. You can
+ append the |style| key to this style to configure the overall appearance of
+ grid lines. In the following example we cause all grid lines to be dashed
+ (which is not a good idea in general since it creates a distracting
+ background pattern).
+ %
\begin{codeexample}[]
\tikz \datavisualization
[scientific axes,
@@ -1970,18 +1983,21 @@ low=min, high=max
var x : interval [5:10];
func y = \value x * \value x;
};
-\end{codeexample}
+\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/data visualization/every major grid}
- This style configures the appearance of major grid lines. It does so
- by calling the |style| key to setup appropriate \tikzname\ options
- for visualizing major grid lines. The default definition of this
- style is:
+ This style configures the appearance of major grid lines. It does so by
+ calling the |style| key to setup appropriate \tikzname\ options for
+ visualizing major grid lines. The default definition of this style is:
+ %
\begin{codeexample}[code only]
style = {help lines, thin, black!25}
\end{codeexample}
- In the following example, we use thin major blue grid lines:
+ %
+ In the following example, we use thin major blue grid lines:
+ %
\begin{codeexample}[]
\tikz \datavisualization
[scientific axes,
@@ -1996,148 +2012,144 @@ style = {help lines, thin, black!25}
var x : interval [5:10];
func y = \value x * \value x;
};
-\end{codeexample}
- As can be seen, this is not exactly visually pleasing. The default
- settings for the grid lines should work in most situations; you may
- wish to increase the blackness level, however, when you experience
- trouble during printing or projecting graphics.
+\end{codeexample}
+ %
+ As can be seen, this is not exactly visually pleasing. The default settings
+ for the grid lines should work in most situations; you may wish to increase
+ the blackness level, however, when you experience trouble during printing
+ or projecting graphics.
\end{stylekey}
\begin{stylekey}{/tikz/data visualization/every minor grid}
- Works like |every major grid|. The default is
+ Works like |every major grid|. The default is
+ %
\begin{codeexample}[code only]
style = {help lines, black!25}
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/data visualization/every subminor grid}
- Works like |every major grid|. The default is
+ Works like |every major grid|. The default is
+ %
\begin{codeexample}[code only]
style = {help lines, black!10}
\end{codeexample}
+ %
\end{stylekey}
-
\subsubsection{Styling Ticks and Grid Lines: Styling Ticks and Tick Labels}
-
\label{section-dv-styling-ticks}
-Styling ticks and tick labels is somewhat similar to styling grid
-lines. Let us start with the tick \emph{mark}, that is, the small line
-that represents the tick. When this mark is drawn, the following styles are applied:
-
+Styling ticks and tick labels is somewhat similar to styling grid lines. Let us
+start with the tick \emph{mark}, that is, the small line that represents the
+tick. When this mark is drawn, the following styles are applied:
+%
\begin{enumerate}
-\item
- |every ticks|.
-\item |every major ticks| or |every minor ticks| or
- |every subminor ticks|, depending on the kind of ticks to be
- visualized.
-\item
- locally specified options for the individual tick, see
- Section~\ref{section-dv-local-styles}.
-\item
- |tick layer|
-\item
- |every odd tick| or |every even tick|, see Section~\ref{section-dv-stacking}.
-\item
- |draw|
-\item
- |styling|, see Section~\ref{section-dv-style}.
+ \item |every ticks|.
+ \item |every major ticks| or |every minor ticks| or |every subminor ticks|,
+ depending on the kind of ticks to be visualized.
+ \item locally specified options for the individual tick, see
+ Section~\ref{section-dv-local-styles}.
+ \item |tick layer|
+ \item |every odd tick| or |every even tick|, see
+ Section~\ref{section-dv-stacking}.
+ \item |draw|
+ \item |styling|, see Section~\ref{section-dv-style}.
\end{enumerate}
-For the tick label node (the node containing the textual
-representation of the attribute's value at the tick position), the
-following styles are applied:
-
+For the tick label node (the node containing the textual representation of the
+attribute's value at the tick position), the following styles are applied:
+%
\begin{enumerate}
-\item
- |every ticks|.
-\item |every major ticks| or |every minor ticks| or
- |every subminor ticks|, depending on the kind of ticks to be
- visualized.
-\item
- locally specified options for the individual tick, see
- Section~\ref{section-dv-local-styles}.
-\item
- |tick node layer|
-\item
- |every odd tick| or |every even tick|, see Section~\ref{section-dv-stacking}.
-\item
- |styling|, see Section~\ref{section-dv-style}.
-\item
- |node styling|, see Section~\ref{section-dv-style}.
+ \item |every ticks|.
+ \item |every major ticks| or |every minor ticks| or |every subminor ticks|,
+ depending on the kind of ticks to be visualized.
+ \item locally specified options for the individual tick, see
+ Section~\ref{section-dv-local-styles}.
+ \item |tick node layer|
+ \item |every odd tick| or |every even tick|, see
+ Section~\ref{section-dv-stacking}.
+ \item |styling|, see Section~\ref{section-dv-style}.
+ \item |node styling|, see Section~\ref{section-dv-style}.
\end{enumerate}
\begin{stylekey}{/tikz/data visualization/every ticks}
- This style allows you to configure the appearance of ticks using the
- |style| and |node style| key. Here is (roughly) the default
- definition of this style:
+ This style allows you to configure the appearance of ticks using the
+ |style| and |node style| key. Here is (roughly) the default definition of
+ this style:
+ %
\begin{codeexample}[code only]
node style={
font=\footnotesize,
inner sep=1pt,
outer sep=.1666em,
rounded corners=1.5pt
-}
+}
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/data visualization/every major ticks}
- The default is
+ The default is
+ %
\begin{codeexample}[code only]
style={line cap=round}, tick length=2pt
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/data visualization/every minor ticks}
- The default is
+ The default is
+ %
\begin{codeexample}[code only]
style={help lines,thin, line cap=round}, tick length=1.4pt
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/data visualization/every subminor ticks}
- The default is
+ The default is
+ %
\begin{codeexample}[code only]
style={help lines, line cap=round}, tick length=0.8pt
\end{codeexample}
+ %
\end{stylekey}
-
\begin{stylekey}{/tikz/data visualization/tick layer (initially on background layer)}
- Like |grid layer|, this key specifies on which layer the ticks
- should be placed.
+ Like |grid layer|, this key specifies on which layer the ticks should be
+ placed.
\end{stylekey}
-\begin{stylekey}{/tikz/data visualization/tick node layer (initially
- \normalfont empty)}
- Like |tick layer|, but now for the nodes. By default, tick nodes are
- placed on the main layer and thus on top of the data in case that
- the tick nodes are inside the data.
+\begin{stylekey}{/tikz/data visualization/tick node layer (initially \normalfont empty)}
+ Like |tick layer|, but now for the nodes. By default, tick nodes are placed
+ on the main layer and thus on top of the data in case that the tick nodes
+ are inside the data.
\end{stylekey}
\subsubsection{Styling Ticks and Grid Lines: Exceptional Ticks}
-You may sometimes wish to style a few ticks differently from the other
-ticks. For instance, in the axis system |school book axes| there
-should be a tick label at the |0| position only on one axis and then
-this label should be offset a bit. In many cases this is easy to
-achieve: When you add a tick ``by hand'' using the |at| or |also at|
-option, you can add any special options in square brackets.
+You may sometimes wish to style a few ticks differently from the other ticks.
+For instance, in the axis system |school book axes| there should be a tick
+label at the |0| position only on one axis and then this label should be offset
+a bit. In many cases this is easy to achieve: When you add a tick ``by hand''
+using the |at| or |also at| option, you can add any special options in square
+brackets.
-However, in some situations the special tick position has been
-computed automatically for you, for instance by the |step| key or by
-saying |tick=some|. In this case, adding a tick mark with the desired
-options using |also at| would cause the tick mark with the correct
-options to be shown in addition to the tick mark with the wrong
-options. In cases like this one, the following option may be helpful:
+However, in some situations the special tick position has been computed
+automatically for you, for instance by the |step| key or by saying |tick=some|.
+In this case, adding a tick mark with the desired options using |also at| would
+cause the tick mark with the correct options to be shown in addition to the
+tick mark with the wrong options. In cases like this one, the following option
+may be helpful:
\begin{key}{/tikz/data visualization/options at=\meta{value} |as [|\meta{options}|]|}
- This key causes the \meta{options} to be executed for any tick
- mark(s) at \meta{value} in addition to any options given already for
- this position:
+ This key causes the \meta{options} to be executed for any tick mark(s) at
+ \meta{value} in addition to any options given already for this position:
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
scientific axes,
@@ -2151,53 +2163,45 @@ data [format=function] {
func y = sin(\value x r);
};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/no tick text at=\meta{value}}
- Shorthand for |options at=|\meta{value}| as [no tick text]|.
+ Shorthand for |options at=|\meta{value}| as [no tick text]|.
\end{key}
-
\subsubsection{Styling Ticks and Grid Lines: Styling and Typesetting a Value}
-
\label{section-dv-local-styles}
\label{section-dv-tick-labels}
-
-The |at| and |also at| key allow you to provide a comma-separated
-\meta{list} of \meta{value}s where ticks or grid lines should be
-placed. In the simplest case, the \meta{value} is simply a
-number. However, the general syntax allows three different kinds of
-\meta{value}s:
-
+The \todosp{why 2 labels?} |at| and |also at| key allow you to provide a
+comma-separated \meta{list} of \meta{value}s where ticks or grid lines should
+be placed. In the simplest case, the \meta{value} is simply a number. However,
+the general syntax allows three different kinds of \meta{value}s:
+%
\begin{enumerate}
-\item
- \meta{value}
-\item
- \meta{value} |as| |[|\meta{local options}|]|
-\item
- \meta{value} |as| \opt{|[|\meta{local options}|]|} \meta{text}
+ \item \meta{value}
+ \item \meta{value} |as| |[|\meta{local options}|]|
+ \item \meta{value} |as| \opt{|[|\meta{local options}|]|} \meta{text}
\end{enumerate}
-In the first case, the \meta{value} is just a number that is
-interpreted like any other attribute value.
-
-In the second case, where the keyword |as| is present, followed by
-some option in square brackets, but nothing following the closing
-square bracket, when the tick or grid line at position \meta{value} is
-shown, the \meta{local options} are executed first. These can use the
-|style| key or the |node style| key to configure the appearance of
-this single tick or grid line. You can also use keys like |low| or
-|high| to influence how large the grid lines or the ticks are or keys
-like |tick text at low| to explicitly hide or show a tick label.
-
-In the third case, which is only important for |ticks| and not for
-|grid|, the same happens as in the second case, but the
-text that is shown as tick label is \meta{text} rather than the
-automatically generated tick label. This automatic generation of tick
-labels is explained in the following.
-
+In the first case, the \meta{value} is just a number that is interpreted like
+any other attribute value.
+
+In the second case, where the keyword |as| is present, followed by some option
+in square brackets, but nothing following the closing square bracket, when the
+tick or grid line at position \meta{value} is shown, the \meta{local options}
+are executed first. These can use the |style| key or the |node style| key to
+configure the appearance of this single tick or grid line. You can also use
+keys like |low| or |high| to influence how large the grid lines or the ticks
+are or keys like |tick text at low| to explicitly hide or show a tick label.
+
+In the third case, which is only important for |ticks| and not for |grid|, the
+same happens as in the second case, but the text that is shown as tick label is
+\meta{text} rather than the automatically generated tick label. This automatic
+generation of tick labels is explained in the following.
+%
\begin{codeexample}[]
\tikz \datavisualization
[scientific axes=clean,
@@ -2215,36 +2219,33 @@ labels is explained in the following.
};
\end{codeexample}
-
-A value like ``2'' or ``17'' could just be used as \meta{text} to be
-displayed in the node of a tick label. However, things are more
-difficult when the to-be-shown value is $0.0000000015$, because we
-then would typically (but not always) prefer something like $1.5 \cdot
-10^{-9}$ to be shown. Also, we might wish a unit to be added like
-$23\mathrm{m}/\mathrm{s}$. Finally, we might wish a number like
-$3.141$ to be replaced by $\pi$. For these reasons, the data
-visualization system does not simply put the to-be-shown value in a
-node as plain text. Instead, the number is passed to a
-\emph{typesetter} whose job it is to typeset this number nicely using
-\TeX's typesetting capabilities. The only exception is, as indicated
-above, the third syntax version of the |at| and |also at| keys, where
-\meta{text} is placed in the tick label's node, regardless of what the
-typesetting would usually do.
+A value like ``2'' or ``17'' could just be used as \meta{text} to be displayed
+in the node of a tick label. However, things are more difficult when the
+to-be-shown value is $0.0000000015$, because we then would typically (but not
+always) prefer something like $1.5 \cdot 10^{-9}$ to be shown. Also, we might
+wish a unit to be added like $23\mathrm{m}/\mathrm{s}$. Finally, we might wish
+a number like $3.141$ to be replaced by $\pi$. For these reasons, the data
+visualization system does not simply put the to-be-shown value in a node as
+plain text. Instead, the number is passed to a \emph{typesetter} whose job it
+is to typeset this number nicely using \TeX's typesetting capabilities. The
+only exception is, as indicated above, the third syntax version of the |at| and
+|also at| keys, where \meta{text} is placed in the tick label's node,
+regardless of what the typesetting would usually do.
The text produced by the automatic typesetting is computed as follows:
+%
\begin{enumerate}
-\item The current contents of the key |tick prefix| is put into the node.
-\item This is followed by a call of the key |tick typesetting| which
- gets the \meta{value} of the tick as its argument in scientific
- notation.
-\item This is followed by the contents of the key |tick suffix|.
+ \item The current contents of the key |tick prefix| is put into the node.
+ \item This is followed by a call of the key |tick typesetting| which gets
+ the \meta{value} of the tick as its argument in scientific notation.
+ \item This is followed by the contents of the key |tick suffix|.
\end{enumerate}
Let us have a look at these keys in detail:
-\begin{key}{/tikz/data visualization/tick prefix=\meta{text}
- (initially \normalfont empty)}
- The \meta{text} will be put in front of every typeset tick:
+\begin{key}{/tikz/data visualization/tick prefix=\meta{text} (initially \normalfont empty)}
+ The \meta{text} will be put in front of every typeset tick:
+ %
\begin{codeexample}[]
\tikz \datavisualization
[scientific axes, all axes={ticks=few, length=2.5cm},
@@ -2255,15 +2256,17 @@ Let us have a look at these keys in detail:
func y = \value x * \value x;
};
\end{codeexample}
+ %
\end{key}
-\begin{key}{/tikz/data visualization/tick suffix=\meta{text}
- (initially \normalfont empty)}
- Works like |tick prefix|. This key is especially useful for adding
- units like ``cm'' or ``$\mathrm m/\mathrm s$'' to every tick
- label. For this reason, there is a (near) alias that is easier to memorize:
- \begin{key}{/tikz/data visualization/tick unit=\meta{roman math text}}
- A shorthand for |tick suffix={$\,\rm|\meta{roman math text}|$}|:
+\begin{key}{/tikz/data visualization/tick suffix=\meta{text} (initially \normalfont empty)}
+ Works like |tick prefix|. This key is especially useful for adding units
+ like ``cm'' or ``$\mathrm m/\mathrm s$'' to every tick label. For this
+ reason, there is a (near) alias that is easier to memorize:
+ %
+ \begin{key}{/tikz/data visualization/tick unit=\meta{roman math text}}
+ A shorthand for |tick suffix={$\,\rm|\meta{roman math text}|$}|:
+ %
\begin{codeexample}[]
\tikz \datavisualization
[scientific axes, all axes={length=3cm},
@@ -2275,21 +2278,20 @@ Let us have a look at these keys in detail:
func y = \value x * \value x;
};
\end{codeexample}
- \end{key}
+ \end{key}
\end{key}
\begin{key}{/tikz/data visualization/tick typesetting=\meta{value}}
- The key gets called for each number that should be typeset. The
- argument \meta{value} will be in scientific notation (like |1.0e1|
- for $10$). By default, this key applies |\pgfmathprintnumber| to its
- argument. This command is a powerful number printer whose
- configuration is documented in
- Section~\ref{pgfmath-numberprinting}.
-
- You are invited to code underlying this key so that a different
- typesetting mechanism is used. Here is a (not quite finished)
- example that shows how, say, numbers could be printed in terms of
- multiples of $\pi$:
+ The key gets called for each number that should be typeset. The argument
+ \meta{value} will be in scientific notation (like |1.0e1| for $10$). By
+ default, this key applies |\pgfmathprintnumber| to its argument. This
+ command is a powerful number printer whose configuration is documented in
+ Section~\ref{pgfmath-numberprinting}.
+
+ You are invited to code underlying this key so that a different typesetting
+ mechanism is used. Here is a (not quite finished) example that shows how,
+ say, numbers could be printed in terms of multiples of $\pi$:
+ %
\begin{codeexample}[]
\def\mytypesetter#1{%
\pgfmathparse{#1/pi}%
@@ -2305,19 +2307,16 @@ Let us have a look at these keys in detail:
func y = sin(\value x r);
};
\end{codeexample}
+ %
\end{key}
-
-
\subsubsection{Stacked Ticks}
-
\label{section-dv-stacking}
-
-
-Sometimes, the text of tick labels are so long or so numerous that the
-text of adjacent tick labels overlap (or have too little padding):
+Sometimes, the text of tick labels are so long or so numerous that the text of
+adjacent tick labels overlap (or have too little padding):
+%
\begin{codeexample}[]
\tikz \datavisualization [scientific axes,
all axes={length=2.5cm},
@@ -2327,9 +2326,12 @@ text of adjacent tick labels overlap (or have too little padding):
func x = \value y*\value y;
};
\end{codeexample}
+%
There are two ways to address this problem:
+%
\begin{itemize}
-\item One can rotate the labels on horizontal axes:
+ \item One can rotate the labels on horizontal axes:
+ %
\begin{codeexample}[]
\tikz \datavisualization [scientific axes,
all axes={length=2.5cm},
@@ -2340,10 +2342,12 @@ There are two ways to address this problem:
func x = \value y*\value y;
};
\end{codeexample}
- This is often a good solution, but may be hard to read. Also
- consider rotating labels only by $45^\circ$ or $30^\circ$.
-\item One can specify different shifts of the nodes for the different
- ticks, whereby the ticks text no longer overlap.
+ %
+ This is often a good solution, but may be hard to read. Also consider
+ rotating labels only by $45^\circ$ or $30^\circ$.
+ \item One can specify different shifts of the nodes for the different
+ ticks, whereby the ticks text no longer overlap.
+ %
\begin{codeexample}[]
\tikz \datavisualization [scientific axes,
all axes={length=2.5cm},
@@ -2357,10 +2361,12 @@ There are two ways to address this problem:
func x = \value y*\value y;
};
\end{codeexample}
- However, specifying shifts ``by hand'' in the above way is not
- always an option, especially when the tick positions should be
- computed automatically. Instead, the |stack| option can be used,
- which is much easier to use and gives better results:
+ %
+ However, specifying shifts ``by hand'' in the above way is not always
+ an option, especially when the tick positions should be computed
+ automatically. Instead, the |stack| option can be used, which is much
+ easier to use and gives better results:
+ %
\begin{codeexample}[]
\tikz \datavisualization [scientific axes,
all axes={length=2.5cm}, x axis={ticks=stack},
@@ -2370,44 +2376,44 @@ There are two ways to address this problem:
func x = \value y*\value y;
};
\end{codeexample}
+ %
\end{itemize}
-
-The |stack| option is actually just a style that gives you access to
-the general even/odd mechanism for ticks with labels. Whenever a tick
-mark is created where a tick label is also to be drawn, two special
-things happen:
-
+The |stack| option is actually just a style that gives you access to the
+general even/odd mechanism for ticks with labels. Whenever a tick mark is
+created where a tick label is also to be drawn, two special things happen:
+%
\begin{enumerate}
-\item For every odd tick mark, the |every odd tick| style is executed,
- for every even tick mark the |every even tick|. Here, ``odd'' and
- ``even'' are with respect to the order in which the ticks have been
- added to the list of |at| positions for each major, minor, or
- subminor tick list, not with respect to the order in which they will
- appear on the axis. Thus, when you write
+ \item For every odd tick mark, the |every odd tick| style is executed, for
+ every even tick mark the |every even tick|. Here, ``odd'' and ``even''
+ are with respect to the order in which the ticks have been added to the
+ list of |at| positions for each major, minor, or subminor tick list,
+ not with respect to the order in which they will appear on the axis.
+ Thus, when you write
+ %
\begin{codeexample}[code only]
ticks={major at={1,2,3,4}, major at={0,-1,-2}, minor at={9,8,7}}
\end{codeexample}
- then for |1|, |3|, |0|, and |-2| as well as |9| and |7| the key
- |every odd tick| will be executed, while |every even tick| will be
- executed for positions |2|, |4|, |-1|, and also |8|.
-\item When a tick node label is shown at the |low| position of the
- tick mark, the dimension stored in the key
- |tick text low even padding| is added to the |low| value. Provided
- that this padding is not zero (which is the default), the length of
- the even tick marks will be increased and the tick label node will
- be placed at a greater distance from the axis.
-
- Similar keys exist for padding ticks with labels at high positions
- and also at even positions.
+ %
+ then for |1|, |3|, |0|, and |-2| as well as |9| and |7| the key
+ |every odd tick| will be executed, while |every even tick| will be
+ executed for positions |2|, |4|, |-1|, and also |8|.
+ \item When a tick node label is shown at the |low| position of the tick
+ mark, the dimension stored in the key |tick text low even padding| is
+ added to the |low| value. Provided that this padding is not zero (which
+ is the default), the length of the even tick marks will be increased
+ and the tick label node will be placed at a greater distance from the
+ axis.
+
+ Similar keys exist for padding ticks with labels at high positions and
+ also at even positions.
\end{enumerate}
-
-\begin{key}{/tikz/data visualization/tick text low even
- padding=\meta{dimension} (initially 0pt)}
- When a tick label is shown at the low position of an even tick, the
- \meta{distance} is added to the |low| value, see also
- Section~\ref{section-dv-visualize-ticks}.
+\begin{key}{/tikz/data visualization/tick text low even padding=\meta{dimension} (initially 0pt)}
+ When a tick label is shown at the low position of an even tick, the
+ \meta{distance} is added to the |low| value, see also
+ Section~\ref{section-dv-visualize-ticks}.
+ %
\begin{codeexample}[]
\tikz \datavisualization [scientific axes,
all axes={length=2.5cm},
@@ -2418,36 +2424,38 @@ ticks={major at={1,2,3,4}, major at={0,-1,-2}, minor at={9,8,7}}
func x = \value y*\value y;
};
\end{codeexample}
- Note that \meta{dimension} should usually be non-positive.
+ %
+ Note that \meta{dimension} should usually be non-positive.
\end{key}
The following keys work similarly:
+%
\begin{key}{/tikz/data visualization/tick text low odd padding=\meta{dimension} (initially 0pt)}
\end{key}
+%
\begin{key}{/tikz/data visualization/tick text high even padding=\meta{dimension} (initially 0pt)}
\end{key}
+%
\begin{key}{/tikz/data visualization/tick text high odd padding=\meta{dimension} (initially 0pt)}
\end{key}
-\begin{key}{/tikz/data visualization/tick text odd
- padding=\meta{dimension}}
- A shorthand for setting |tick text odd low padding| and
- |tick text odd high padding| at the same time.
+\begin{key}{/tikz/data visualization/tick text odd padding=\meta{dimension}}
+ A shorthand for setting |tick text odd low padding| and
+ |tick text odd high padding| at the same time.
\end{key}
-\begin{key}{/tikz/data visualization/tick text even
- padding=\meta{dimension}}
- A shorthand for setting |tick text even low padding| and
- |tick text even high padding| at the same time.
+\begin{key}{/tikz/data visualization/tick text even padding=\meta{dimension}}
+ A shorthand for setting |tick text even low padding| and
+ |tick text even high padding| at the same time.
\end{key}
-\begin{key}{/tikz/data visualization/tick text
- padding=\meta{dimension}}
- Sets all text paddings to \meta{dimension}.
+\begin{key}{/tikz/data visualization/tick text padding=\meta{dimension}}
+ Sets all text paddings to \meta{dimension}.
\end{key}
\begin{key}{/tikz/data visualization/stack=\meta{dimension} (default 1em)}
- Shorthand for |tick text even padding=|\meta{dimension}.
+ Shorthand for |tick text even padding=|\meta{dimension}.
+ %
\begin{codeexample}[]
\tikz \datavisualization [scientific axes,
all axes={length=2.5cm},
@@ -2458,13 +2466,13 @@ The following keys work similarly:
func x = \value y*\value y;
};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/stack'=\meta{dimension}}
- Shorthand for |tick text odd padding=|\meta{dimension}. The
- difference to |stack| is that the set of value that are
- ``lowered'' is exactly exchanged with the set of value ``lowered''
- by |stack|.
+ Shorthand for |tick text odd padding=|\meta{dimension}. The difference to
+ |stack| is that the set of value that are ``lowered'' is exactly exchanged
+ with the set of value ``lowered'' by |stack|.
\begin{codeexample}[]
\tikz \datavisualization [scientific axes,
all axes={length=2.5cm},
@@ -2475,13 +2483,13 @@ The following keys work similarly:
func x = \value y*\value y;
};
\end{codeexample}
+ %
\end{key}
-Note that the above keys have an effect on all tick labels of an axis,
-also on special ticks that you may have added using the |also at|
-key. When using the |stack| key, you should specify a |tick text padding|
-explicitly for such keys:
-
+Note that the above keys have an effect on all tick labels of an axis, also on
+special ticks that you may have added using the |also at| key. When using the
+|stack| key, you should specify a |tick text padding| explicitly for such keys:
+%
\begin{codeexample}[width=7cm]
\tikz \datavisualization
[scientific axes,
@@ -2496,31 +2504,29 @@ explicitly for such keys:
\subsubsection{Reference: Basic Strategies}
-
\label{section-dv-strategies}
\begin{key}{/tikz/data visualization/axis options/linear steps}
- This strategy places 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.
-
+ This strategy places 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
@@ -2535,23 +2541,23 @@ explicitly for such keys:
};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\label{section-dv-exponential-strategy}
\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$.
+ 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.
- The minor steps are added in the same way as for |linear steps|. In
- particular, they interpolate \emph{linearly} between mayor steps.
+ 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
@@ -2566,40 +2572,41 @@ explicitly for such keys:
};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\subsubsection{Advanced: Defining New Placement 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{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}[width=7cm]
\def\silly{
\tikzdatavisualizationset{major={at={
@@ -2617,46 +2624,44 @@ explicitly for such keys:
};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
-
-
\subsection{Advanced: Creating New Axis Systems}
-The data visualization library comes with a number of predefined axis
-systems, like |scientific axes=clean|, but it is also possible and
-to define new axis systems. Doing so involves the following steps:
-
+The data visualization library comes with a number of predefined axis systems,
+like |scientific axes=clean|, but it is also possible and to define new axis
+systems. Doing so involves the following steps:
+%
\begin{enumerate}
-\item Creating a number of axes.
-\item Configuring attributes of these axes like their length or
- default scaling.
-\item Creating visual representations of the axes.
-\item Creating visual representations of the ticks and grid lines.
+ \item Creating a number of axes.
+ \item Configuring attributes of these axes like their length or default
+ scaling.
+ \item Creating visual representations of the axes.
+ \item Creating visual representations of the ticks and grid lines.
\end{enumerate}
-The first step uses |new ... axis| keys to create new axes, the
-last steps use |visualize ...| keys to create the visual
-representations of the axes.
+The first step uses |new ... axis| keys to create new axes, the last steps use
+|visualize ...| keys to create the visual representations of the axes.
-Note that the axis system has no control over the actual attribute
-value ranges and neither over which ticks need to be drawn. The axis
-system can only provide good defaults and then specify \emph{how} the
-ticks or labels should be drawn and \emph{where} on the page -- but
-not at which values.
+Note that the axis system has no control over the actual attribute value ranges
+and neither over which ticks need to be drawn. The axis system can only provide
+good defaults and then specify \emph{how} the ticks or labels should be drawn
+and \emph{where} on the page -- but not at which values.
In the following, as a running example let us develop an axis system
-|our system| that does the following: For the $x$-axis is looks like a
-normal scientific axis system, but there are actually two $y$-axes:
-One at the left and one at the right, each using a different
-attribute, but both coexisting in the same picture.
+|our system| that does the following: For the $x$-axis is looks like a normal
+scientific axis system, but there are actually two $y$-axes: One at the left
+and one at the right, each using a different attribute, but both coexisting in
+the same picture.
+
\subsubsection{Creating the Axes}
A new axis system is created as a style key with the prefix
|/tikz/data visualization|. Thus, we would write:
+%
\begin{codeexample}[code only]
\tikzset{
data visualization/our system/.style={
@@ -2665,9 +2670,9 @@ A new axis system is created as a style key with the prefix
}
\end{codeexample}
-In our system we need three axis: The $x$-axis, the left axis and the
-right axis. Since all of these axes are Cartesian axes, we write the
-following:
+In our system we need three axis: The $x$-axis, the left axis and the right
+axis. Since all of these axes are Cartesian axes, we write the following:
+%
\begin{codeexample}[code only]
\tikzset{
data visualization/our system/.style={
@@ -2680,28 +2685,30 @@ following:
}
}
\end{codeexample}
-As can be seen, we also configure things so that the $x$-axis will use
-the |x| attribute by default (users can later change this by saying
-|x axis={attribute=|\meta{some other attribute}|}|), but we do not
-configure the attributes of the |left axis| nor the |right axis|. We
-also make the left and right axis point upward (the |x axis| needs no
-configuration here since a Cartesian axis points right by default). The
-reason is the |left| would not be a particularly good attribute name
-and this way we ensure that users have to pick names themselves
-(hopefully good ones).
-
-The next step is to define a standard scaling for the axes. Here, we
-can use the same as for |scientific axes|, so we would add the
-following keys to the definition of |our system|:
+%
+As can be seen, we also configure things so that the $x$-axis will use the |x|
+attribute by default (users can later change this by saying
+|x axis={attribute=|\meta{some other attribute}|}|), but we do not configure
+the attributes of the |left axis| nor the |right axis|. We also make the left
+and right axis point upward (the |x axis| needs no configuration here since a
+Cartesian axis points right by default). The reason is the |left| would not be
+a particularly good attribute name and this way we ensure that users have to
+pick names themselves (hopefully good ones).
+
+The next step is to define a standard scaling for the axes. Here, we can use
+the same as for |scientific axes|, so we would add the following keys to the
+definition of |our system|:
+%
\begin{codeexample}[code only]
x axis ={length=\pgfkeysvalueof{/tikz/data visualization/scientific axes/width}},
left axis ={length=\pgfkeysvalueof{/tikz/data visualization/scientific axes/height}},
right axis={length=\pgfkeysvalueof{/tikz/data visualization/scientific axes/height}}
\end{codeexample}
-We now already have enough to try our system, although we will not yet
-see any axes or ticks, but we will see the correct scaling of the
-attributes. Let us first define a data group:
+We now already have enough to try our system, although we will not yet see any
+axes or ticks, but we will see the correct scaling of the attributes. Let us
+first define a data group:
+%
\begin{codeexample}[]
\tikz \datavisualization data group {people and money} = {
data [set=people 1] {
@@ -2731,7 +2738,7 @@ attributes. Let us first define a data group:
1960, 3
1970, 4
1990, 3.5
- }
+ }
};
\end{codeexample}
@@ -2759,66 +2766,65 @@ attributes. Let us first define a data group:
people 2={style={visualizer color=blue!50}},
money 1={style={visualizer color=red}},
money 2={style={visualizer color=red!50}}]
- data group {people and money};
+ data group {people and money};
\end{codeexample}
-
\subsubsection{Visualizing the Axes}
-
\label{section-dv-visualize-axis}
-We must now show the axes themselves. For this we can use the
-|visualize axis| key:
+We must now show the axes themselves. For this we can use the |visualize axis|
+key:
\begin{key}{/tikz/data visualization/axis options/visualize axis=\meta{options}}
- This key is passed to an axis as an option. It causes a visual
- representation of the axis to be created during the data visualization. The
- \meta{options} are used to determine where the axis should be drawn
- and how long it should be. We can specify, for instance, that an
- axis should be drawn at the minimum value of another axis or where
- another axis has the value |0|.
-
- \medskip
- \textbf{The goto, high, and low Keys.}
- In our example, the |left axis| should be shown at the left hand
- side. This is the position where the |x axis| has its minimum
- value. To specify this, we would use the following code:
+ This key is passed to an axis as an option. It causes a visual
+ representation of the axis to be created during the data visualization. The
+ \meta{options} are used to determine where the axis should be drawn and how
+ long it should be. We can specify, for instance, that an axis should be
+ drawn at the minimum value of another axis or where another axis has the
+ value |0|.
+
+
+ \medskip
+ \textbf{The goto, high, and low Keys.}
+ In our example, the |left axis| should be shown at the left hand side. This
+ is the position where the |x axis| has its minimum value. To specify this,
+ we would use the following code:
+ %
\begin{codeexample}[code only]
left axis={ visualize axis={ x axis={ goto=min } }
\end{codeexample}
- As can be seen, we can pass another axis as an \meta{option} to
- |visualize axis|, where we pass the following key to the axis in
- turn:
- \begin{key}{/tikz/data visualization/axis options/goto=\meta{value}}
- The key can be passed to an axis. It will set the attribute
- monitored by the axis to the given \meta{value}, which is usually
- some number. However, \meta{value} may also be one of the
- following, which causes a special behaviour:
- \begin{itemize}
- \item
- |min|: The attribute is set to the minimal value that the
- attribute has attained along this axis.
- \item
- |max|: Like |min|.
- \item
- |padded min|: This will also set the \meta{attribute} monitored
- by the axis to the same value as |min|. Additionally, however,
- the subkey |/data point/|\meta{attribute}|/offset| is set to the
- current padding for the minimum, see the description of
- |padding min| later on. The effect of this is that the actual
- point ``meant'' by the attribute is offset by this padding along
- the attribute's axis.
- \item
- |padded max|: Like |padded min|.
- \end{itemize}
- \end{key}
+ %
+ As can be seen, we can pass another axis as an \meta{option} to
+ |visualize axis|, where we pass the following key to the axis in turn:
+ %
+ \begin{key}{/tikz/data visualization/axis options/goto=\meta{value}}
+ The key can be passed to an axis. It will set the attribute monitored
+ by the axis to the given \meta{value}, which is usually some number.
+ However, \meta{value} may also be one of the following, which causes a
+ special behaviour:
+ %
+ \begin{itemize}
+ \item |min|: The attribute is set to the minimal value that the
+ attribute has attained along this axis.
+ \item |max|: Like |min|.
+ \item |padded min|: This will also set the \meta{attribute}
+ monitored by the axis to the same value as |min|.
+ Additionally, however, the subkey
+ |/data point/|\meta{attribute}|/offset| is set to the current
+ padding for the minimum, see the description of |padding min|
+ later on. The effect of this is that the actual point ``meant''
+ by the attribute is offset by this padding along the
+ attribute's axis.
+ \item |padded max|: Like |padded min|.
+ \end{itemize}
+ \end{key}
- The |right axis| would be visualized the same way, only at
- |goto=max|. The $x$-axis actually need to be visualized
- \emph{twice}: Once at the bottom and once at the top. Thus, we need
- to call |visualize axis| twice for this axis:
-
+ The |right axis| would be visualized the same way, only at |goto=max|. The
+ $x$-axis actually need to be visualized \emph{twice}: Once at the bottom
+ and once at the top. Thus, we need to call |visualize axis| twice for this
+ axis:
+%
\tikzdatavisualizationset{
our system/.style={
new Cartesian axis=x axis,
@@ -2847,30 +2853,31 @@ left axis={ visualize axis={ x axis={ goto=min } }
left axis ={attribute=money},
right axis={attribute=people},
visualize as line/.list={people 1, people 2, money 1, money 2}]
- data group {people and money};
-\end{codeexample}
-
- There is another key that is similar to |goto|, but has a slightly
- different semantics:
- \begin{key}{/tikz/data visualization/axis options/goto pos=\meta{fraction}}
- The key works like |goto|, only the \meta{fraction} is not
- interpreted as a value but as a fraction of the way between the
- minimum and the maximum value for this axis.
-
- Suppose that for an axis the attribute range interval is
- $[500,1000]$ and the reasonable interval is $[1,3]$. Then for a
- \meta{fraction} of |0|, the mapping process would choose value
- $1$ from the reasonable interval, for a \meta{fraction} of |1| the
- position $3$ from the reasonable interval, and for a
- \meta{fraction} or |0.25| the position $1.5$ since it is one
- quarter at the distance from $1$ to $3$.
-
- Note that neither the attribute range interval nor the
- transformation function for the attribute are important for the
- |goto pos| option -- the \meta{fraction} is computed with respect
- to the reasonable interval. Also note that the values of the
- actual attribute corresponding to the fractional positions in the
- reasonable interval are not computed.
+ data group {people and money};
+\end{codeexample}
+
+ There is another key that is similar to |goto|, but has a slightly
+ different semantics:
+ %
+ \begin{key}{/tikz/data visualization/axis options/goto pos=\meta{fraction}}
+ The key works like |goto|, only the \meta{fraction} is not interpreted
+ as a value but as a fraction of the way between the minimum and the
+ maximum value for this axis.
+
+ Suppose that for an axis the attribute range interval is $[500,1000]$
+ and the reasonable interval is $[1,3]$. Then for a \meta{fraction} of
+ |0|, the mapping process would choose value $1$ from the reasonable
+ interval, for a \meta{fraction} of |1| the position $3$ from the
+ reasonable interval, and for a \meta{fraction} or |0.25| the position
+ $1.5$ since it is one quarter at the distance from $1$ to $3$.
+
+ Note that neither the attribute range interval nor the transformation
+ function for the attribute are important for the |goto pos| option --
+ the \meta{fraction} is computed with respect to the reasonable
+ interval. Also note that the values of the actual attribute
+ corresponding to the fractional positions in the reasonable interval
+ are not computed.
+ %
\begin{codeexample}[]
\tikzset{
data visualization/our system/.append style={
@@ -2884,73 +2891,78 @@ left axis={ visualize axis={ x axis={ goto=min } }
left axis ={attribute=money},
right axis={attribute=people},
visualize as line/.list={people 1, people 2, money 1, money 2}]
- data group {people and money};
-\end{codeexample}
- \end{key}
-
- By default, when an axis is visualized, it spans the set of all
- possible values for the monitored attribute, that is, from |min| to
- |max|. However, there are actually two keys that allow you to adjust
- this:
- \begin{key}{/tikz/data visualization/low=\meta{value}}
- This is the attribute value where the axis visualization
- starts. The same special values as for |goto| are permissible
- (like |min| or |padded min|, but also |0| or |1|).
- \end{key}
- \begin{key}{/tikz/data visualization/high=\meta{value}}
- Like |low|, only for where the axis ends.
- \end{key}
-
- By default, |low=min| and |high=max| are set for an axis
- visualization. Another sensible setting is |low=padded min| and
- |high=padded max|. The following key provides a shorthand for this:
- \begin{key}{/tikz/data visualization/padded}
- Shorthand for |low=padded min, high=padded max|.
- \end{key}
- As an example, consider the |scientific axes=clean|. Here, each axis
- is actually drawn three times: Once at the minimum, once at the
- maximum and then once more at the padded minimum.
-
-
- \medskip
- \textbf{The axis line.}
- When an axis is drawn, \tikzname\ does not simply draw a straight
- line from the |low| position to the |high| position. In reality, the
- data visualization system uses the two commands |\pgfpathdvmoveto|
- and |\pgfpathdvlineto| internally. These will replace the straight
- line by a curve in certain situations. For instance, in a polar
- coordinate system, if an axis should be drawn along an angle axis
- for a fixed radius, an arc will be used instead of a straight line.
-
- \medskip
- \textbf{Styling the axis.}
- As can be seen, we now get the axis we want (but without the ticks,
- visualizing them will be explained later). The axis is, however,
- simply a black line. We can \emph{style} the axis in a manner
- similar to styling ticks and grid lines, see
- Section~\ref{section-dv-style}. In detail, the following styles get
- executed:
- \begin{enumerate}
- \item |axis layer|
- \item |every axis|
- \item |styling|
- \end{enumerate}
- Additionally, even before |every axis| is executed, |low=min| and
- |high=max| are executed.
-
- \begin{stylekey}{/tikz/data visualization/axis layer (initially on
- background layer)}
- The layer on which the axis is drawn. See the description of
- |grid layer| on page~\ref{section-dv-grid-layer} for details.
- \end{stylekey}
-
- \begin{stylekey}{/tikz/data visualization/every axis}
- Put styling of the axis here. It is usually a good idea to set
- this style to |style={black!50}|.
- \end{stylekey}
-
- Recall that the |styling| key is set using the |style| key, see
- Section~\ref{section-dv-style}.
+ data group {people and money};
+\end{codeexample}
+ \end{key}
+
+ By default, when an axis is visualized, it spans the set of all possible
+ values for the monitored attribute, that is, from |min| to |max|. However,
+ there are actually two keys that allow you to adjust this:
+ %
+ \begin{key}{/tikz/data visualization/low=\meta{value}}
+ This is the attribute value where the axis visualization starts. The
+ same special values as for |goto| are permissible (like |min| or
+ |padded min|, but also |0| or |1|).
+ \end{key}
+ %
+ \begin{key}{/tikz/data visualization/high=\meta{value}}
+ Like |low|, only for where the axis ends.
+ \end{key}
+
+ By default, |low=min| and |high=max| are set for an axis visualization.
+ Another sensible setting is |low=padded min| and |high=padded max|. The
+ following key provides a shorthand for this:
+ %
+ \begin{key}{/tikz/data visualization/padded}
+ Shorthand for |low=padded min, high=padded max|.
+ \end{key}
+ %
+ As an example, consider the |scientific axes=clean|. Here, each axis is
+ actually drawn three times: Once at the minimum, once at the maximum and
+ then once more at the padded minimum.
+
+
+ \medskip
+ \textbf{The axis line.}
+ When an axis is drawn, \tikzname\ does not simply draw a straight line from
+ the |low| position to the |high| position. In reality, the data
+ visualization system uses the two commands |\pgfpathdvmoveto| and
+ |\pgfpathdvlineto| internally. These will replace the straight line by a
+ curve in certain situations. For instance, in a polar coordinate system, if
+ an axis should be drawn along an angle axis for a fixed radius, an arc will
+ be used instead of a straight line.
+
+
+ \medskip
+ \textbf{Styling the axis.}
+ As can be seen, we now get the axis we want (but without the ticks,
+ visualizing them will be explained later). The axis is, however, simply a
+ black line. We can \emph{style} the axis in a manner similar to styling
+ ticks and grid lines, see Section~\ref{section-dv-style}. In detail, the
+ following styles get executed:
+ %
+ \begin{enumerate}
+ \item |axis layer|
+ \item |every axis|
+ \item |styling|
+ \end{enumerate}
+ %
+ Additionally, even before |every axis| is executed, |low=min| and
+ |high=max| are executed.
+
+ \begin{stylekey}{/tikz/data visualization/axis layer (initially on background layer)}
+ The layer on which the axis is drawn. See the description of
+ |grid layer| on page~\ref{section-dv-grid-layer} for details.
+ \end{stylekey}
+
+ \begin{stylekey}{/tikz/data visualization/every axis}
+ Put styling of the axis here. It is usually a good idea to set this
+ style to |style={black!50}|.
+ \end{stylekey}
+
+ Recall that the |styling| key is set using the |style| key, see
+ Section~\ref{section-dv-style}.
+ %
\tikzset{
}
\begin{codeexample}[]
@@ -2969,7 +2981,7 @@ left axis={ visualize axis={ x axis={ goto=min } }
left axis ={attribute=money},
right axis={attribute=people},
visualize as line/.list={people 1, people 2, money 1, money 2}]
- data group {people and money};
+ data group {people and money};
\end{codeexample}
\tikzset{
data visualization/our system/.append style={
@@ -2980,27 +2992,27 @@ left axis={ visualize axis={ x axis={ goto=min } }
visualize axis={left axis={goto=max}}},
}
}
-
- \medskip
- \textbf{Padding the Axis.}
- When an axis is visualized, it is often a good idea to make it ``a
- little bit longer'' or to ``remove it a bit from the border,'' because
- the visualization of an axis should not interfere with the actual
- data. For this reason, a \emph{padding} can be specified for axes:
-
- \begin{key}{/tikz/data visualization/axis options/padding min=\meta{dimension}}
- This is the dimension that is used whenever |goto=padded min| is
- used. The \meta{dimension} is then put into the |offset| subkey of
- the attribute monitored by the axis. When a data point is
- transformed by a linear transformer and when this subkey is
- nonzero, this offset is added. (For an angle axis of a polar
- transformer, the \meta{dimension} is interpreted as an additional
- angle rather than as an additional distance). Note that
- \meta{dimension} should typically be negative since
- ``adding the \meta{dimension}'' will then make the axis longer
- (because it starts at a smaller value). The standard
- axis systems set the padding to some default and take its value
- into account:
+
+
+ \medskip
+ \textbf{Padding the Axis.}
+ When an axis is visualized, it is often a good idea to make it ``a little
+ bit longer'' or to ``remove it a bit from the border'', because the
+ visualization of an axis should not interfere with the actual data. For
+ this reason, a \emph{padding} can be specified for axes:
+
+ \begin{key}{/tikz/data visualization/axis options/padding min=\meta{dimension}}
+ This is the dimension that is used whenever |goto=padded min| is used.
+ The \meta{dimension} is then put into the |offset| subkey of the
+ attribute monitored by the axis. When a data point is transformed by a
+ linear transformer and when this subkey is nonzero, this offset is
+ added. (For an angle axis of a polar transformer, the \meta{dimension}
+ is interpreted as an additional angle rather than as an additional
+ distance). Note that \meta{dimension} should typically be negative
+ since ``adding the \meta{dimension}'' will then make the axis longer
+ (because it starts at a smaller value). The standard axis systems set
+ the padding to some default and take its value into account:
+ %
\begin{codeexample}[width=8cm]
\begin{tikzpicture}
\datavisualization [scientific axes=clean,
@@ -3013,8 +3025,9 @@ left axis={ visualize axis={ x axis={ goto=min } }
\end{tikzpicture}
\end{codeexample}
- Using padded and using the |padded| key, we can visualize our axis
- ``a little removed from the actual data'':
+ Using padded and using the |padded| key, we can visualize our axis ``a
+ little removed from the actual data'':
+ %
\begin{codeexample}[]
\tikzset{
data visualization/our system/.append style={
@@ -3031,88 +3044,90 @@ left axis={ visualize axis={ x axis={ goto=min } }
left axis ={attribute=money},
right axis={attribute=people},
visualize as line/.list={people 1, people 2, money 1, money 2}]
- data group {people and money};
-\end{codeexample}
- \end{key}
+ data group {people and money};
+\end{codeexample}
+ \end{key}
- \begin{key}{/tikz/data visualization/axis options/padding max=\meta{dimension}}
- Works like |padding min|, but \meta{dimension} should typically be positive.
- \end{key}
-
- \begin{key}{/tikz/data visualization/axis options/padding=\meta{dimension}}
- Sets both |padding min| to the negated value of \meta{dimension} and
- |padding max| to \meta{dimension}.
- \end{key}
-\end{key}
+ \begin{key}{/tikz/data visualization/axis options/padding max=\meta{dimension}}
+ Works like |padding min|, but \meta{dimension} should typically be
+ positive.
+ \end{key}
+ \begin{key}{/tikz/data visualization/axis options/padding=\meta{dimension}}
+ Sets both |padding min| to the negated value of \meta{dimension} and
+ |padding max| to \meta{dimension}.
+ \end{key}
+\end{key}
\subsubsection{Visualizing Grid Lines}
-
\label{section-dv-visualize-gridlines}
-As explained earlier, the |grid| key is used to specify at which
-positions grid lines should be drawn in principle. However, this key
-does not actually cause any grid lines to be drawn. Instead, the
-|visualize grid| key is used by the axis system to specify how grid
-lines are drawn.
+As explained earlier, the |grid| key is used to specify at which positions grid
+lines should be drawn in principle. However, this key does not actually cause
+any grid lines to be drawn. Instead, the |visualize grid| key is used by the
+axis system to specify how grid lines are drawn.
\begin{key}{/tikz/data visualization/axis options/visualize grid=\meta{options}}
- This key is passed to an axis. It causes grid lines to be drawn at
- the positions specified by the |grid| key for this axis. The
- \meta{options} govern where and how the grid lines will be drawn.
-
- \medskip
- \textbf{The direction axis.}
- At first sight, one might expect that the grid lines for an axis
- should simply be drawn perpendicular to the axis between the minimum
- and maximum value of the axis. However, things are somewhat more
- difficult in reality:
- \begin{enumerate}
- \item A grid line is supposed to indicate all positions where a
- certain attribute attains a fixed value. But, then, a grid line
- does not really need to be a grid \emph{line}. Consider for
- instance a three dimensional axis system. A ``grid line'' for the
- $x$-coordinate |3| would actually be a ``grid plane.''
- \item For a polar coordinate system and a fixed radius, this set of
- positions at a certain radius is not a straight line, but an
- arc. For more complicated coordinate systems such as the one
- arising from three-dimensional spherical projections, a grid line
- may well be a fairly involved curve.
- \end{enumerate}
- The |visualize grid| command addresses these complications as
- follows:
- \begin{enumerate}
- \item A grid line is always a line, not a plane or a volume. This
- means that in the example of a three dimensional axis system and
- the $x$-attribute being |3|, one would have to choose whether the
- grid line should go ``along'' the $y$-axis or ``along'' the
- $z$-axis for this position. One can, however, call the
- |visualize grid| command twice, once for each direction, to cause
- grid lines to be shown for both directions.
- \item A grid line is created by moving to a start position and then
- doing a lineto to the target position. However, the ``moveto''
- and ``lineto'' are done by calling special commands of the data
- visualization system. These special commands allow coordinate
- system to ``notice'' that the line is along an axis and will allow
- them to replace the straight line by an appropriate curve. The
- polar axes systems employ this strategy, for instance.
- \end{enumerate}
-
- By the above discussion, in order to create a grid line for
- attribute $a$ having value $v$, we need to specify an axis ``along''
- which the line should be drawn. When there are only two axes, this
- is usually ``the other axis''. This ``other axis'' is specified using the following key:
- \begin{key}{/tikz/data visualization/direction axis=\meta{axis name}}
- You must pass this key as an \meta{option} each time you use
- |visualize axis|. When the grid line is drawn, the attribute $a$
- is set to $v$ and the axis \meta{axis name}'s attribute is set
- once to the current value of |low| and once to |high|. Then a line
- is drawn between these two positions using |\pgfpathdvlineto|.
- \end{key}
- The |low| and |high| keys are the same as the ones used in the
- |visualize axis| key.
-
+ This key is passed to an axis. It causes grid lines to be drawn at the
+ positions specified by the |grid| key for this axis. The \meta{options}
+ govern where and how the grid lines will be drawn.
+
+
+ \medskip
+ \textbf{The direction axis.}
+ At first sight, one might expect that the grid lines for an axis should
+ simply be drawn perpendicular to the axis between the minimum and maximum
+ value of the axis. However, things are somewhat more difficult in reality:
+ %
+ \begin{enumerate}
+ \item A grid line is supposed to indicate all positions where a certain
+ attribute attains a fixed value. But, then, a grid line does not
+ really need to be a grid \emph{line}. Consider for instance a three
+ dimensional axis system. A ``grid line'' for the $x$-coordinate |3|
+ would actually be a ``grid plane''.
+ \item For a polar coordinate system and a fixed radius, this set of
+ positions at a certain radius is not a straight line, but an arc.
+ For more complicated coordinate systems such as the one arising
+ from three-dimensional spherical projections, a grid line may well
+ be a fairly involved curve.
+ \end{enumerate}
+ %
+ The |visualize grid| command addresses these complications as follows:
+ %
+ \begin{enumerate}
+ \item A grid line is always a line, not a plane or a volume. This means
+ that in the example of a three dimensional axis system and the
+ $x$-attribute being |3|, one would have to choose whether the grid
+ line should go ``along'' the $y$-axis or ``along'' the $z$-axis for
+ this position. One can, however, call the |visualize grid| command
+ twice, once for each direction, to cause grid lines to be shown for
+ both directions.
+ \item A grid line is created by moving to a start position and then
+ doing a lineto to the target position. However, the ``moveto'' and
+ ``lineto'' are done by calling special commands of the data
+ visualization system. These special commands allow coordinate
+ system to ``notice'' that the line is along an axis and will allow
+ them to replace the straight line by an appropriate curve. The
+ polar axes systems employ this strategy, for instance.
+ \end{enumerate}
+
+ By the above discussion, in order to create a grid line for attribute $a$
+ having value $v$, we need to specify an axis ``along'' which the line
+ should be drawn. When there are only two axes, this is usually ``the other
+ axis''. This ``other axis'' is specified using the following key:
+ %
+ \begin{key}{/tikz/data visualization/direction axis=\meta{axis name}}
+ You must pass this key as an \meta{option} each time you use
+ |visualize axis|. When the grid line is drawn, the attribute $a$ is set
+ to $v$ and the axis \meta{axis name}'s attribute is set once to the
+ current value of |low| and once to |high|. Then a line is drawn between
+ these two positions using |\pgfpathdvlineto|.
+ \end{key}
+ %
+ The |low| and |high| keys are the same as the ones used in the
+ |visualize axis| key.
+ %
\begin{codeexample}[]
\tikz \datavisualization [
xyz Cartesian cabinet,
@@ -3124,48 +3139,50 @@ lines are drawn.
0, 0, 1
0, 1, 0
2, 2, 2
- };
-\end{codeexample}
+ };
+\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \datavisualization [
xyz Cartesian cabinet,
all axes={visualize axis={low=0, style=->}, grid=many},
- x axis={visualize grid={direction axis=z axis}},
+ x axis={visualize grid={direction axis=z axis}},
z axis={visualize grid={direction axis=x axis},
- visualize grid={direction axis=y axis},},
+ visualize grid={direction axis=y axis},},
visualize as scatter]
data {
x, y, z
0, 0, 1
0, 1, 0
2, 2, 2
- };
-\end{codeexample}
-
- \medskip
- \textbf{Styling the grid lines.}
- When a grid line is draw, styles are applied as described in
- Section~\ref{section-dv-styling-grid-lines}.
-
- \medskip
- \textbf{The major, minor, and subminor grid lines.}
- The |grid| option allows you to specify for each kind of grid line
- (major, minor, or subminor) a set of different values for which
- these grid lines should be drawn. Correspondingly, it is also
- possible to configure for each kind of grid line how it should be
- drawn. For this, the |major|, |minor|, |subminor|, and also the
- |common| keys can be used inside the \meta{options} of
- |visualize grid|. While as option to |grid| these keys are used to
- specify |at| values, as options of |visualize grid| they are used to
- configure the different kinds of grid lines.
-
- Most of the time, no special configuration is necessary since all
- styling is best done by configuring keys like
- |every major grid|. You need to use a key like |major| only if you
- wish to configure for instance the |low| or |high| values of a
- |major| grid line differently from those of |minor| grid lines --
- are rather unlikely setting -- or when the styling should deviate
- from the usual settings.
+ };
+\end{codeexample}
+
+
+ \medskip
+ \textbf{Styling the grid lines.}
+ When a grid line is draw, styles are applied as described in
+ Section~\ref{section-dv-styling-grid-lines}.
+
+
+ \medskip
+ \textbf{The major, minor, and subminor grid lines.}
+ The |grid| option allows you to specify for each kind of grid line (major,
+ minor, or subminor) a set of different values for which these grid lines
+ should be drawn. Correspondingly, it is also possible to configure for each
+ kind of grid line how it should be drawn. For this, the |major|, |minor|,
+ |subminor|, and also the |common| keys can be used inside the
+ \meta{options} of |visualize grid|. While as option to |grid| these keys
+ are used to specify |at| values, as options of |visualize grid| they are
+ used to configure the different kinds of grid lines.
+
+ Most of the time, no special configuration is necessary since all styling
+ is best done by configuring keys like |every major grid|. You need to use a
+ key like |major| only if you wish to configure for instance the |low| or
+ |high| values of a |major| grid line differently from those of |minor| grid
+ lines -- are rather unlikely setting -- or when the styling should deviate
+ from the usual settings.
+ %
\begin{codeexample}[]
\tikz \datavisualization [
xy Cartesian,
@@ -3179,17 +3196,17 @@ lines are drawn.
x, y
0, 0
3, 3
- };
-\end{codeexample}
+ };
+\end{codeexample}
+ %
\end{key}
-Returning to the example of |our system| with the two axis systems, it
-is straight-forward to configure the grid lines of the $x$-axis: The
-direction axis is either of the other two axis (they point in the same
-direction and they have the same range). For the other two axes, we
-visualize one grid independently of the other, using different colors.
-
-
+Returning to the example of |our system| with the two axis systems, it is
+straight-forward to configure the grid lines of the $x$-axis: The direction
+axis is either of the other two axis (they point in the same direction and they
+have the same range). For the other two axes, we visualize one grid
+independently of the other, using different colors.
+%
\begin{codeexample}[]
\tikzset{
data visualization/our system/.append style={
@@ -3206,27 +3223,25 @@ visualize one grid independently of the other, using different colors.
left axis ={attribute=money, grid=some},
right axis={attribute=people, grid=few},
visualize as line/.list={people 1, people 2, money 1, money 2}]
- data group {people and money};
+ data group {people and money};
\end{codeexample}
-
\subsubsection{Visualizing the Ticks and Tick Labels}
-
\label{section-dv-visualize-ticks}
\begin{key}{/tikz/data visualization/axis options/visualize ticks=\meta{options}}
- Visualizing a tick involves (possibly) drawing a tick mark and
- adding (possibly) the tick node. The process is similar to
- |visualize grid|: Users use the |ticks| key to configure how many
- ticks they would like for an axis and at which positions. The axis
- system uses the |visualize ticks| key to specify where these ticks
- should actually be shown.
-
- Unlike grid lines, which are typically only visualized once for each
- combination of an axis and a direction axis, tick marks might be
- visualized at different places for the same axis. Consider for
- instance the |scientific axes|:
+ Visualizing a tick involves (possibly) drawing a tick mark and adding
+ (possibly) the tick node. The process is similar to |visualize grid|: Users
+ use the |ticks| key to configure how many ticks they would like for an axis
+ and at which positions. The axis system uses the |visualize ticks| key to
+ specify where these ticks should actually be shown.
+
+ Unlike grid lines, which are typically only visualized once for each
+ combination of an axis and a direction axis, tick marks might be visualized
+ at different places for the same axis. Consider for instance the
+ |scientific axes|:
+ %
\begin{codeexample}[]
\tikz \datavisualization [scientific axes, all axes={length=3cm},
x axis={ticks={stack}},
@@ -3236,36 +3251,37 @@ visualize one grid independently of the other, using different colors.
func y = \value x*\value x;
};
\end{codeexample}
- Have a look at the ticks on the $y$-axis: There are ticks at values |0|,
- |1|, |2|, |3|, and~|4|. These are visualized both at the left
- side (where the tick nodes are also shown) and additionally also at
- the right side, but only as small marks. Similarly, the ticks on the
- $x$-axis appear at the bottom, but also (in much simpler versions)
- at the top. Both for the $x$-axis and for the $y$-axis the
- |visualize ticks| key was called twice.
-
- \medskip
- \textbf{The tick marks.}
- Drawing a tick mark is quite similar to visualizing a grid line;
- indeed a tick mark can be thought of as a ``mini grid line'': Just
- like a grid line it ``points a long an axis.'' However, a tick will
- always be a short straight line -- even when the coordinate system
- is actually twisted (experimentation has shown that ticks that
- follow the curvature of the coordinate system like grid lines are
- hard to recognize). For this reason, the |low| and |high| keys have
- a different meaning from the one used with the |visualize grid|
- key. In detail to configure the size and position of a tick mark for
- the value $v$ of attribute $a$, proceed as follows:
- \begin{itemize}
- \item The |visualize ticks| key will have setup attribute $a$ to be
- equal to $v$.
- \item You should now use the |goto| or |goto pos| key together with all
- \emph{other} axes to configure at which position with respect to
- these other options the tick mark should be shown. For instance,
- suppose we want tick marks in |our system| for the $x$-axis at the
- bottom and at the top. This corresponds to once setting the
- |left axis| to its minimal value and once to its maximal value:
+ %
+ Have a look at the ticks on the $y$-axis: There are ticks at values |0|,
+ |1|, |2|, |3|, and~|4|. These are visualized both at the left side (where
+ the tick nodes are also shown) and additionally also at the right side, but
+ only as small marks. Similarly, the ticks on the $x$-axis appear at the
+ bottom, but also (in much simpler versions) at the top. Both for the
+ $x$-axis and for the $y$-axis the |visualize ticks| key was called twice.
+
+ \medskip
+ \textbf{The tick marks.}
+ Drawing a tick mark is quite similar to visualizing a grid line; indeed a
+ tick mark can be thought of as a ``mini grid line'': Just like a grid line
+ it ``points a long an axis''. However, a tick will always be a short
+ straight line -- even when the coordinate system is actually twisted
+ (experimentation has shown that ticks that follow the curvature of the
+ coordinate system like grid lines are hard to recognize). For this reason,
+ the |low| and |high| keys have a different meaning from the one used with
+ the |visualize grid| key. In detail to configure the size and position of a
+ tick mark for the value $v$ of attribute $a$, proceed as follows:
+ %
+ \begin{itemize}
+ \item The |visualize ticks| key will have setup attribute $a$ to be
+ equal to $v$.
+ \item You should now use the |goto| or |goto pos| key together with all
+ \emph{other} axes to configure at which position with respect to
+ these other options the tick mark should be shown. For instance,
+ suppose we want tick marks in |our system| for the $x$-axis at the
+ bottom and at the top. This corresponds to once setting the
+ |left axis| to its minimal value and once to its maximal value:
+ %
\begin{codeexample}[]
\tikzset{
data visualization/our system/.append style={
@@ -3280,39 +3296,45 @@ visualize one grid independently of the other, using different colors.
left axis ={attribute=money},
right axis={attribute=people},
visualize as line/.list={people 1, people 2, money 1, money 2}]
- data group {people and money};
-\end{codeexample}
- \item In the above example, we may wish to shorten the ticks a bit
- at the bottom and at the top. For this, we use the |low| and
- |high| key:
- \begin{key}{/tikz/data visualization/low=\meta{dimension}}
- When used with the |visualize ticks| option, the |low| key
- contains a dimension that specifies the extend of the tick going
- ``toward the minimum'' of the direction axis. More precisely, when a tick
- mark is visualized, a unit tangent vector at the current data point
- in the direction of the |direction axis| is computed and this
- vector is multiplied by \meta{dimension} to compute the start
- position of the tick line. The end position is given by this
- vector times the |high| value.
-
- Note that the \meta{dimension} should usually be negative for
- the |low| key and positive for the |high| key.
-
- For tick marks where a tick label node is shown, the
- \meta{dimension} is increased by the current values of keys like
- |tick text even low padding|, see
- Section~\ref{section-dv-stacking} for details.
- \end{key}
- \begin{key}{/tikz/data visualization/high=\meta{dimension}}
- Like |low|.
- \end{key}
- \begin{key}{/tikz/data visualization/tick length=\meta{dimension}}
- Shorthand for |low=-|\meta{dimension}|, high=|\meta{dimension}.
- \end{key}
-
- What we want to happen is that in the upper visualization of the
- ticks the |low| value is |0pt|, while in the lower one the |high|
- value is |0pt|:
+ data group {people and money};
+\end{codeexample}
+ %
+ \item In the above example, we may wish to shorten the ticks a bit at
+ the bottom and at the top. For this, we use the |low| and |high|
+ key:
+ %
+ \begin{key}{/tikz/data visualization/low=\meta{dimension}}
+ When used with the |visualize ticks| option, the |low| key
+ contains a dimension that specifies the extend of the tick
+ going ``toward the minimum'' of the direction axis. More
+ precisely, when a tick mark is visualized, a unit tangent
+ vector at the current data point in the direction of the
+ |direction axis| is computed and this vector is multiplied by
+ \meta{dimension} to compute the start position of the tick
+ line. The end position is given by this vector times the |high|
+ value.
+
+ Note that the \meta{dimension} should usually be negative for
+ the |low| key and positive for the |high| key.
+
+ For tick marks where a tick label node is shown, the
+ \meta{dimension} is increased by the current values of keys
+ like |tick text even low padding|, see
+ Section~\ref{section-dv-stacking} for details.
+ \end{key}
+ %
+ \begin{key}{/tikz/data visualization/high=\meta{dimension}}
+ Like |low|.
+ \end{key}
+ %
+ \begin{key}{/tikz/data visualization/tick length=\meta{dimension}}
+ Shorthand for |low=-|\meta{dimension}|, high=|\meta{dimension}.
+ \end{key}
+
+ What we want to happen is that in the upper visualization of the
+ ticks the |low| value is |0pt|, while in the lower one the |high|
+ value is |0pt|:
+ %
\begin{codeexample}[]
\tikzset{
data visualization/our system/.append style={
@@ -3328,28 +3350,31 @@ visualize one grid independently of the other, using different colors.
left axis ={attribute=money},
right axis={attribute=people},
visualize as line/.list={people 1, people 2, money 1, money 2}]
- data group {people and money};
+ data group {people and money};
\end{codeexample}
-\end{itemize}
- In order to style the tick mark, use the styling mechanism that is
- detailed in Section~\ref{section-dv-styling-ticks}.
-
- \medskip
- \textbf{The tick label node.}
- At certain tick positions, we may wish to add a node indicating the
- value of the attribute at the given position. The |visualize ticks|
- command has no influence over which text should be shown at a node
- -- the text is specified and typeset as explained in
- Section~\ref{section-dv-tick-labels}.
-
- Each time |visualize ticks|, for each tick position up to two tick
- label nodes will be created: One at the |low| position and one at
- the |high| position. The following keys are used to configure which
- of these cases happen:
- \begin{key}{/tikz/data visualization/tick text at
- low=\opt{\meta{true or false}} (default true)}
- Pass this option to |visualize ticks| when you want tick label
- nodes to be placed at the |low| position of each tick mark.
+ %
+ \end{itemize}
+ %
+ In order to style the tick mark, use the styling mechanism that is detailed
+ in Section~\ref{section-dv-styling-ticks}.
+
+
+ \medskip
+ \textbf{The tick label node.}
+ At certain tick positions, we may wish to add a node indicating the value
+ of the attribute at the given position. The |visualize ticks| command has
+ no influence over which text should be shown at a node -- the text is
+ specified and typeset as explained in Section~\ref{section-dv-tick-labels}.
+
+ Each time |visualize ticks|, for each tick position up to two tick label
+ nodes will be created: One at the |low| position and one at the |high|
+ position. The following keys are used to configure which of these cases
+ happen:
+ %
+ \begin{key}{/tikz/data visualization/tick text at low=\opt{\meta{true or false}} (default true)}
+ Pass this option to |visualize ticks| when you want tick label nodes to
+ be placed at the |low| position of each tick mark.
+ %
\begin{codeexample}[]
\tikzset{
data visualization/our system/.append style={
@@ -3367,16 +3392,17 @@ visualize one grid independently of the other, using different colors.
left axis ={attribute=money},
right axis={attribute=people},
visualize as line/.list={people 1, people 2, money 1, money 2}]
- data group {people and money};
-\end{codeexample}
- \end{key}
- \begin{key}{/tikz/data visualization/tick text at
- high=\opt{\meta{true or false}} (default true)}
- Like |tick text at low|.
- \end{key}
-
- \begin{key}{/tikz/data visualization/no tick text}
- Shorthand for |tick text at low=false, tick text at high=false|.
+ data group {people and money};
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/tikz/data visualization/tick text at high=\opt{\meta{true or false}} (default true)}
+ Like |tick text at low|.
+ \end{key}
+
+ \begin{key}{/tikz/data visualization/no tick text}
+ Shorthand for |tick text at low=false, tick text at high=false|.
+ %
\begin{codeexample}[]
\tikz \datavisualization [scientific axes, all axes={length=3cm},
x axis={ticks={
@@ -3386,55 +3412,51 @@ visualize one grid independently of the other, using different colors.
var x : interval [5:10];
func y = \value x * \value x;
};
-\end{codeexample}
- \end{key}
-
- When a tick label node is to be placed at the low or the high
- position, the next step is to determine the exact position and the
- correct anchor of the node. This is done as follows:
- \begin{itemize}
- \item In order to compute an appropriate |anchor|, the tick mark is
- considered: This is a short line pointing in a certain
- direction. For a tick label node at the |low| position, the
- |anchor| attribute is setup in such a way that the node label will
- be below the |low| position when the tick mark direction points
- up, it will be to the right when the direction points left, above
- when it points down, and so on also for diagonal
- directions. Similarly, for the |high| position, when the direction
- points up, the node will be placed above the tick mark and so on.
-
- This computation is done automatically.
- \item The tick label node is styled. The styles that are applied are
- described in Section~\ref{section-dv-styling-ticks}.
- \item A tick label node for the |low| position is usually anchored
- at this |low| position, but an additional padding will be
- added as described in Section~\ref{section-dv-stacking}.
- \end{itemize}
-\end{key}
-
+\end{codeexample}
+ \end{key}
+ When a tick label node is to be placed at the low or the high position, the
+ next step is to determine the exact position and the correct anchor of the
+ node. This is done as follows:
+ %
+ \begin{itemize}
+ \item In order to compute an appropriate |anchor|, the tick mark is
+ considered: This is a short line pointing in a certain direction.
+ For a tick label node at the |low| position, the |anchor| attribute
+ is setup in such a way that the node label will be below the |low|
+ position when the tick mark direction points up, it will be to the
+ right when the direction points left, above when it points down,
+ and so on also for diagonal directions. Similarly, for the |high|
+ position, when the direction points up, the node will be placed
+ above the tick mark and so on.
+
+ This computation is done automatically.
+ \item The tick label node is styled. The styles that are applied are
+ described in Section~\ref{section-dv-styling-ticks}.
+ \item A tick label node for the |low| position is usually anchored at
+ this |low| position, but an additional padding will be added as
+ described in Section~\ref{section-dv-stacking}.
+ \end{itemize}
+\end{key}
\subsubsection{Visualizing the Axis Labels}
-
\label{section-dv-visualize-label}
-The |label| option can be used with an axis to specify a text should
-be shown next to the axis to indicates which attribute this axis
-refers to. Like |ticks| or |grid|, the |label| option does not
-actually draw the label, this is the job of the |visualize label| key,
-which is configured by the axis system.
+The |label| option can be used with an axis to specify a text should be shown
+next to the axis to indicates which attribute this axis refers to. Like |ticks|
+or |grid|, the |label| option does not actually draw the label, this is the job
+of the |visualize label| key, which is configured by the axis system.
\begin{key}{/tikz/data visualization/axis options/visualize label=\meta{options}}
- The \meta{options} should be used to configure a ``good place'' for
- the axis label. Usually, you will use the |goto| or the |goto pos|
- key.
-
- For the example of |our system|, we would like the label of the
- |x axis| to be placed below at the middle of the axis, so we use
- |goto pos=.5| to determine this position. Concerning the other axes,
- we want it to be placed at the minimum position of the |left axis|
- with a lot of padding.
+ The \meta{options} should be used to configure a ``good place'' for the
+ axis label. Usually, you will use the |goto| or the |goto pos| key.
+
+ For the example of |our system|, we would like the label of the |x axis| to
+ be placed below at the middle of the axis, so we use |goto pos=.5| to
+ determine this position. Concerning the other axes, we want it to be placed
+ at the minimum position of the |left axis| with a lot of padding.
+ %
\begin{codeexample}[width=7cm]
\tikzdatavisualizationset{
our system/.append style={
@@ -3444,27 +3466,27 @@ which is configured by the axis system.
}
}
\tikz \datavisualization [
- our system,
+ our system,
x axis={attribute=time, ticks=some, label},
left axis ={attribute=money},
right axis={attribute=people},
visualize as line/.list={
people 1, people 2, money 1, money 2}]
- data group {people and money};
-\end{codeexample}
-
- In the above example, the |padding| of |1.5em| was rather arbitrary
- and ``suboptimal''. It would be outright wrong if the labels on the |x axis| were larger or
- if they were missing. It would be better if the vertical position of
- the |x axis| label were always ``below'' all other options. For such
- cases a slightly strange approach is useful: You position the node
- using |node style={at=...}| where |at|
- is now the normal \tikzname\ option that is used to specify the
- position of a node. Inside the |...|, you specify that the
- horizontal position should be the bottom of up-to-now-constructed
- data visualization and the vertical position should be at the
- ``origin,'' which is, however, the position computed by the |goto|
- keys for the axes:
+ data group {people and money};
+\end{codeexample}
+
+ In the above example, the |padding| of |1.5em| was rather arbitrary and
+ ``suboptimal''. It would be outright wrong if the labels on the |x axis|
+ were larger or if they were missing. It would be better if the vertical
+ position of the |x axis| label were always ``below'' all other options. For
+ such cases a slightly strange approach is useful: You position the node
+ using |node style={at=...}| where |at| is now the normal \tikzname\ option
+ that is used to specify the position of a node. Inside the |...|, you
+ specify that the horizontal position should be the bottom of
+ up-to-now-constructed data visualization and the vertical position should
+ be at the ``origin'', which is, however, the position computed by the
+ |goto| keys for the axes:
+ %
\begin{codeexample}[width=7cm]
\tikzdatavisualizationset{
our system/.append style={
@@ -3475,36 +3497,38 @@ which is configured by the axis system.
below
} } } } }
\tikz \datavisualization [
- our system,
+ our system,
x axis={attribute=time, ticks=some, label=Year},
left axis ={attribute=money},
right axis={attribute=people},
visualize as line/.list={
people 1, people 2, money 1, money 2}]
- data group {people and money};
-\end{codeexample}
-
- Two additional keys are useful for positioning axis labels:
- \begin{key}{/tikz/data visualization/axis option/anchor at min}
- When passed to an axis, this key sets the |anchor| so that a node
- positioned at either the |min| or the |padded min| value of the
- axis will be placed ``nicely'' with respect to the axis. For
- instance, if the axis points upwards from the |min| value to the
- |max| value, the |anchor| would be set to |north| since this gives
- a label below the axis's start. Similarly, if the axis points
- right, the anchor would be set to |east|, and so on.
- \end{key}
- \begin{key}{/tikz/data visualization/axis option/anchor at max}
- Like |anchor at min|.
- \end{key}
+ data group {people and money};
+\end{codeexample}
+
+ Two additional keys are useful for positioning axis labels:
+ %
+ \begin{key}{/tikz/data visualization/axis option/anchor at min}
+ When passed to an axis, this key sets the |anchor| so that a node
+ positioned at either the |min| or the |padded min| value of the axis
+ will be placed ``nicely'' with respect to the axis. For instance, if
+ the axis points upwards from the |min| value to the |max| value, the
+ |anchor| would be set to |north| since this gives a label below the
+ axis's start. Similarly, if the axis points right, the anchor would be
+ set to |east|, and so on.
+ \end{key}
+ %
+ \begin{key}{/tikz/data visualization/axis option/anchor at max}
+ Like |anchor at min|.
+ \end{key}
\end{key}
\subsubsection{The Complete Axis System}
-Here is the code for the complete axis system developed above and an
-example of how it is used:
-
+Here is the code for the complete axis system developed above and an example of
+how it is used:
+%
\begin{codeexample}[code only]
\tikzdatavisualizationset{ our system/.style={
% The axes
@@ -3529,7 +3553,7 @@ example of how it is used:
left axis= {visualize grid={direction axis=x axis, common={style=red!50}}},
right axis={visualize grid={direction axis=x axis, common={style=blue!50}}},
% Visualizing the ticks, when requested
- left axis={visualize ticks={style={red!50!black}, direction axis=x axis,
+ left axis={visualize ticks={style={red!50!black}, direction axis=x axis,
x axis={goto=padded min}, high=0pt, tick text at low}},
right axis={visualize ticks={style={blue!80!black}, direction axis=x axis,
x axis={goto=padded max}, low=0pt, tick text at high}},
@@ -3548,7 +3572,6 @@ example of how it is used:
}}
\end{codeexample}
-
\tikzdatavisualizationset{
our system/.style={
% The axes
@@ -3601,7 +3624,7 @@ example of how it is used:
\begin{codeexample}[]
\tikz \datavisualization [
- our system,
+ our system,
x axis={attribute=time, label=Year,
ticks={tick text padding=2pt, style={/pgf/number format/set thousands separator=}}},
left axis={attribute=money, label=Spending,
@@ -3618,80 +3641,77 @@ example of how it is used:
people 2={style={visualizer color=blue!50}},
money 1={style={visualizer color=red}},
money 2={style={visualizer color=red!50}} ]
-data group {people and money};
+data group {people and money};
\end{codeexample}
-
\subsubsection{Using the New Axis System Key}
-The axis system |our system| that we developed in the course of the
-previous section is not yet ``configurable.'' The only configuration
-that was possible was to ``misuse'' the |width| and |height| keys of
-the |scientific axes|.
+The axis system |our system| that we developed in the course of the previous
+section is not yet ``configurable''. The only configuration that was possible
+was to ``misuse'' the |width| and |height| keys of the |scientific axes|.
In order to make |our system| configurable so that we can say
-|our system=|\meta{options}, where \meta{options} are executed with
-the path prefix
+|our system=|\meta{options}, where \meta{options} are executed with the path
+prefix
+%
\begin{codeexample}[code only]
-/tikz/data visualization/our system
+/tikz/data visualization/our system
\end{codeexample}
+%
we can use the following key:
\begin{key}{/tikz/data visualization/new axis system=\marg{axis system
name}\marg{axis setup}\marg{default options}\\ \marg{application
- options}}
- The |new axis system| key takes four parameters. The first one,
- \meta{system name}, is the name of the to-be-created axis system,
- |our system| in our case. The |new axis system| will create the
- following new key:
- \begin{key}{/tikz/data visualization/\meta{axis system
- name}=\opt{\meta{options}}}
- When the key \meta{axis system name} is used, the following keys
- will be executed in the following order:
- \begin{enumerate}
- \item
- The \meta{axis setup} with the path prefix |/tikz/data visualization/|.
- \item
- The \meta{default options} with the same path prefix.
- \item
- The following style:
- \begin{stylekey}{/tikz/data visualization/every \meta{axis system name}}
- Even though this style has the path prefix
- |/tikz/data visualization| itself, the keys stored in this
- style will be executed with the path prefix
- |/tikz/data visualization/|\meta{axis system name}.
- \end{stylekey}
- \item
- The \meta{options} with the path prefix
- |/tikz/data visualization/|\meta{axis system name}.
- \item
- The \meta{application options} with the path prefix |/tikz/data visualization/|
- \end{enumerate}
- \end{key}
-
- Let us now have a look at what all of this means. First, the
- \meta{axis setup} will contain all options that setup the axis
- system in all ways that need not be configured. For instance, the
- \meta{axis setup} for the |scientific axes| will create an |x axis|
- and also a |y axis| (because these are always present), but will not
- setup the label visualization (because this can be configured in
- different ways). For |our system|, which cannot be configured at
- all, we would place all of our configuration in the \meta{axis
- setup}.
-
- The \meta{default options} can be used to pick default values that
- would usually be passed to the \meta{options} of the newly created
- axis system. For instance, for |scientific axis|, the
- \meta{default options} are set to |outer ticks,standard labels|,
- because these are the defaults.
-
- Finally, the \meta{application options} can be used to actually
- apply the configuration that has been chosen by the
- \meta{options}. The idea is that \meta{default options},
- \meta{options}, and also |every| \meta{axis system name} all have a
- chance of changing, re-changing and re-setting all sorts of styles
- and keys. Then, with the last change ``winning,'' the resulting
- setting of a style can be executed, which may then cause a label
- visualization to be installed.
+ options}%
+}
+ The |new axis system| key takes four parameters. The first one,
+ \meta{system name}, is the name of the to-be-created axis system,
+ |our system| in our case. The |new axis system| will create the following
+ new key:
+ %
+ \begin{key}{/tikz/data visualization/\meta{axis system name}=\opt{\meta{options}}}
+ When the key \meta{axis system name} is used, the following keys will be
+ executed in the following order:
+ %
+ \begin{enumerate}
+ \item The \meta{axis setup} with the path prefix
+ |/tikz/data visualization/|.
+ \item The \meta{default options} with the same path prefix.
+ \item The following style:
+ %
+ \begin{stylekey}{/tikz/data visualization/every \meta{axis system name}}
+ Even though this style has the path prefix
+ |/tikz/data visualization| itself, the keys stored in this
+ style will be executed with the path prefix
+ |/tikz/data visualization/|\meta{axis system name}.
+ \end{stylekey}
+ \item The \meta{options} with the path prefix
+ |/tikz/data visualization/|\meta{axis system name}.
+ \item The \meta{application options} with the path prefix
+ |/tikz/data visualization/|
+ \end{enumerate}
+ \end{key}
+
+ Let us now have a look at what all of this means. First, the \meta{axis
+ setup} will contain all options that setup the axis system in all ways that
+ need not be configured. For instance, the \meta{axis setup} for the
+ |scientific axes| will create an |x axis| and also a |y axis| (because
+ these are always present), but will not setup the label visualization
+ (because this can be configured in different ways). For |our system|, which
+ cannot be configured at all, we would place all of our configuration in the
+ \meta{axis setup}.
+
+ The \meta{default options} can be used to pick default values that would
+ usually be passed to the \meta{options} of the newly created axis system.
+ For instance, for |scientific axis|, the \meta{default options} are set to
+ |outer ticks,standard labels|, because these are the defaults.
+
+ Finally, the \meta{application options} can be used to actually apply the
+ configuration that has been chosen by the \meta{options}. The idea is that
+ \meta{default options}, \meta{options}, and also |every| \meta{axis system
+ name} all have a chance of changing, re-changing and re-setting all sorts
+ of styles and keys. Then, with the last change ``winning'', the resulting
+ setting of a style can be executed, which may then cause a label
+ visualization to be installed.
\end{key}
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
index 23ffe87eb89..ca3fcf2833c 100644
--- 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
@@ -13,11 +13,11 @@
\subsection{Overview}
-The present section explains the mechanisms behind the data
-visualization engine.
+The present section explains the mechanisms behind the data visualization
+engine.
-Until it is documented properly, we will have to make do with the
-documentation in the source code.
+Until it is documented properly, we will have to make do with the documentation
+in the source code.
\subsection{The Rendering Pipeline}
@@ -29,6 +29,6 @@ To be written...
To be written...
\subsection{The Mathematical Micro-Kernel}
-
\label{section-dv-math-kernel}
+
To be written...
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
index f7a6e54eb09..61504874373 100644
--- 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
@@ -13,42 +13,40 @@
\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.
+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}.
+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
+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/|.
+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
@@ -56,44 +54,43 @@ x, y, z
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.
+%
+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.
+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:
+ 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
@@ -101,26 +98,29 @@ angle, radius
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}[]
+ %
+ 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] {
@@ -136,13 +136,15 @@ angle, radius
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}[]
+\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}] {
@@ -152,16 +154,16 @@ angle, radius
3, 0
};
\end{tikzpicture}
- \end{codeexample}
- \end{key}
+\end{codeexample}
+ \end{key}
\end{dataformat}
-
\begin{dataformat}{named}
- Basically, each line of the data must consist of a comma-separated
- sequence of attribute--values pairs like |x=5, lo=500|. This will
- cause the attribute |/data point/x| to be set to |5| and
- |/data point/lo| to be set to |500|.
+ Basically, each line of the data must consist of a comma-separated sequence
+ of attribute--values pairs like |x=5, lo=500|. This will cause the
+ attribute |/data point/x| to be set to |5| and |/data point/lo| to be set
+ to |500|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\datavisualization [school book axes, visualize as line]
@@ -173,16 +175,17 @@ angle, radius
};
\end{tikzpicture}
\end{codeexample}
- However, instead of just specifying a single value for an attribute
- as in |x=5|, you may also specify a whole set of values as in
- |x={1,2,3}|. In this case, three data points will be created, one
- for each value in the list. Indeed, the |\foreach| statement is used
- to iterate over the list of values, so you can write things like
- |x={1,...,5}|.
-
- It is also permissible to specify lists of values for more than one
- attribute. In this case, a data point is created for each possible
- combination of values in the different lists:
+ %
+ However, instead of just specifying a single value for an attribute as in
+ |x=5|, you may also specify a whole set of values as in |x={1,2,3}|. In
+ this case, three data points will be created, one for each value in the
+ list. Indeed, the |\foreach| statement is used to iterate over the list of
+ values, so you can write things like |x={1,...,5}|.
+
+ It is also permissible to specify lists of values for more than one
+ attribute. In this case, a data point is created for each possible
+ combination of values in the different lists:
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization
[scientific axes=clean,
@@ -194,15 +197,17 @@ data [format=named] {
x=6, y={5,7,...,15}, set=c
};
\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}[]
+ 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] {
@@ -213,93 +218,95 @@ data [format=named] {
\pgfkeyssetvalue{/data point/y}{0} \pgfdatapoint
};
\end{tikzpicture}
- \end{codeexample}
+\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 one of the following:
- \begin{enumerate}
- \item
- |var |\declare{\meta{variable}}| : interval[|\meta{low}|:|\meta{high}|]|
- \opt{|samples |\meta{number}}|;|
- \item
- |var |\declare{\meta{variable}}| : interval[|\meta{low}|:|\meta{high}%
- |] step |\meta{step}|;|
- \item
- |var |\declare{\meta{variable}}| : {|\meta{values}|};|
- \end{enumerate}
- In the first case, if the optional |samples| part is missing, the
- number of |samples| is taken from 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 declaring a variable declaration to range over an
- |interval| is that 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}.
-
- The meaning of declaring a variable using a list of \meta{values}
- is that the variable will simply iterate over the values using
- |\foreach|.
-
- 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.
-
+ 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 one of the
+ following:
+ %
+ \begin{enumerate}
+ \item |var |\declare{\meta{variable}}| : interval[|\meta{low}|:|\meta{high}|]|
+ \opt{|samples |\meta{number}}|;|
+ \item |var |\declare{\meta{variable}}| : interval[|\meta{low}|:|\meta{high}%
+ |] step |\meta{step}|;|
+ \item |var |\declare{\meta{variable}}| : {|\meta{values}|};|
+ \end{enumerate}
+ %
+ In the first case, if the optional |samples| part is missing, the
+ number of |samples| is taken from 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 declaring a variable declaration to range over an
+ |interval| is that 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}.
+
+ The meaning of declaring a variable using a list of \meta{values} is
+ that the variable will simply iterate over the values using |\foreach|.
+
+ 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}[]
\tikz
\datavisualization [school book axes, visualize as smooth line]
@@ -309,6 +316,7 @@ data [format=named] {
func y = \value x * \value x;
};
\end{codeexample}
+ %
\begin{codeexample}[width=6cm]
\tikz \datavisualization [
school book axes,
@@ -321,6 +329,7 @@ data [format=function] {
func y = \value t * sin(\value t r);
};
\end{codeexample}
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
scientific axes=clean,
@@ -337,58 +346,57 @@ data [format=function] {
func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
};
\end{codeexample}
- \end{dataformat}
-
+ \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.
+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.
+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/read from file=\meta{filename} (initially \normalfont empty)}
- If you set the |read from file| 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 |read from file| is empty, the data must
- directly follow as \meta{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/read from file=\meta{filename} (initially \normalfont empty)}
+ If you set the |read from file| 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 |read from file| 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, read from file=file1.csv]
\pgfdata[format=table, read from file=file2.csv]
\end{codeexample}
+ %
\begin{codeexample}[code only]
% Data is given inline:
\pgfdata[format=table]
@@ -398,171 +406,181 @@ Let us now have a look at how |\pgfdata| works.
2, 3
}
\end{codeexample}
- \end{key}
- \begin{key}{/pgf/data/inline}
- This is a shorthand file |read from file={}|. You can add this to
- make it clear(er) to the reader that data follows inline.
- \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.
-
- \medskip
- \textbf{Data sets.}
- There are three options that allow you to create \emph{data
- sets}. Such a data set is essentially a macro that stores a
- pre-parsed set of data that can be used multiple times in subsequent
- visualizations (or even in the same visualization).
- \begin{key}{/pgf/data/new set=\meta{name}}
- Creates an empty data set called \meta{name}. If a data set of the
- same name already exists, it is overwritten and made empty. Data
- sets are global.
- \end{key}
- \begin{key}{/pgf/data/store in set=\meta{name}}
- When this key is set to any non-empty \meta{name} and if this
- \meta{name} has previously been used with the |new set| key, then
- the following happens: For the current |\pgfdata| command, all
- parsed data is not passed to the rendering pipeline. Instead, the
- parsed data is appended to the data set \meta{name}. This includes
- all options parsed to the |\pgfdata| command, which is why neither
- this key nor the previous key should be passed as options to a
- |\pgfdata| command.
- \end{key}
- \begin{key}{/pgf/data/use set=\meta{name}}
- This works similar to |read from file|. When this key is used with
- a |\pgfdata| command, no inline data may follow. Instead, the data
- stored in the data set \meta{name} is used.
- \end{key}
+ \end{key}
+ %
+ \begin{key}{/pgf/data/inline}
+ This is a shorthand file |read from file={}|. You can add this to make
+ it clear(er) to the reader that data follows inline.
+ \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.
+
+
+ \medskip
+ \textbf{Data sets.}
+ There are three options that allow you to create \emph{data sets}. Such a
+ data set is essentially a macro that stores a pre-parsed set of data that
+ can be used multiple times in subsequent visualizations (or even in the
+ same visualization).
+ %
+ \begin{key}{/pgf/data/new set=\meta{name}}
+ Creates an empty data set called \meta{name}. If a data set of the same
+ name already exists, it is overwritten and made empty. Data sets are
+ global.
+ \end{key}
+ %
+ \begin{key}{/pgf/data/store in set=\meta{name}}
+ When this key is set to any non-empty \meta{name} and if this
+ \meta{name} has previously been used with the |new set| key, then the
+ following happens: For the current |\pgfdata| command, all parsed data
+ is not passed to the rendering pipeline. Instead, the parsed data is
+ appended to the data set \meta{name}. This includes all options parsed
+ to the |\pgfdata| command, which is why neither this key nor the
+ previous key should be passed as options to a |\pgfdata| command.
+ \end{key}
+ %
+ \begin{key}{/pgf/data/use set=\meta{name}}
+ This works similar to |read from file|. When this key is used with a
+ |\pgfdata| command, no inline data may follow. Instead, the data stored
+ in the data set \meta{name} is used.
+ \end{key}
\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|:
+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:
+ 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)
@@ -572,7 +590,8 @@ command, which is basic layer command defined in the module
(2,4)
\end{codeexample}
- A format parser for this format could be defined as follows:
+ 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.
@@ -596,7 +615,9 @@ command, which is basic layer command defined in the module
% And we also have no end-of-line code.
{}
\end{codeexample}
-This format could now be used as follows:
+ %
+ This format could now be used as follows:
+ %
\begin{codeexample}[code only]
\begin{tikzpicture}
\datavisualization[school book axes, visualize as smooth line]
@@ -611,4 +632,5 @@ This format could now be used as follows:
};
\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
index b480f2ed589..cd48bd5d675 100644
--- 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
@@ -10,125 +10,113 @@
\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.
+\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.
+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
+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.
+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.
+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.
+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:
+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]
@@ -138,6 +126,7 @@ visualization pipeline that is appropriate for this kind of plot:
};
\end{tikzpicture}
\end{codeexample}
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=.7]
\datavisualization [scientific axes, visualize as smooth line]
@@ -147,10 +136,10 @@ visualization pipeline that is appropriate for this kind of plot:
};
\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.
-
+%
+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:
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
index 1efb972e439..26a97fa4e7f 100644
--- 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
@@ -14,72 +14,68 @@
\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:
+The \todosp{why two labels? The first doesn't seem to be used.} 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.
+ 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.
+ \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''.
+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.
+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.
+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}[]
+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 {
@@ -93,9 +89,9 @@ formats:
1.5, 2.25
};
\end{tikzpicture}
- \end{codeexample}
+\end{codeexample}
- \begin{codeexample}[]
+\begin{codeexample}[]
\begin{tikzpicture}
\datavisualization [school book axes, visualize as smooth line]
data [format=function] {
@@ -103,88 +99,81 @@ formats:
func y = \value x*\value x;
};
\end{tikzpicture}
- \end{codeexample}
+\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.
+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.}\label{section-dv-expressions}
-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.
+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.
+ \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 $100\,000$ 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.
-
-
+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}[]
+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,
@@ -196,10 +185,9 @@ predefined styles take care of this for you:
func y = \value x*\value x;
};
\end{tikzpicture}
- \end{codeexample}
-
+\end{codeexample}
- \begin{codeexample}[]
+\begin{codeexample}[]
\begin{tikzpicture}
\datavisualization [
scientific axes=clean,
@@ -212,24 +200,23 @@ predefined styles take care of this for you:
func y = \value x*\value x;
};
\end{tikzpicture}
- \end{codeexample}
+\end{codeexample}
-Section~\ref{section-dv-axes} explains in more detail how axes, ticks,
-and grid lines can be chosen and configured.
+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}[]
+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 axes=clean,
@@ -241,8 +228,9 @@ visualizers or pie chart visualizers.
func y = \value x*\value x;
};
\end{tikzpicture}
- \end{codeexample}
- \begin{codeexample}[]
+\end{codeexample}
+%
+\begin{codeexample}[]
\begin{tikzpicture}
\datavisualization [
scientific axes=clean,
@@ -254,41 +242,39 @@ visualizers or pie chart visualizers.
func y = \value x*\value x;
};
\end{tikzpicture}
- \end{codeexample}
+\end{codeexample}
-Section~\ref{section-dv-visualizers} provides more information on
-visualizers as well as reference lists.
+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:
-
+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.
+ \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.
-
+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 axes=clean,
@@ -315,87 +301,80 @@ coloring and the dashing is varied.
\end{tikzpicture}
\end{codeexample}
-Section~\ref{section-dv-style-sheets} details style sheets and
-legends.
+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.
+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/read from file=\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{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/read from file=\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 [read from file=file1.csv]
data [read from file=file2.csv];
\end{codeexample}
- The other way round, if |read from file| is empty, the data must directly
- follow as \meta{inline data}.
+ %
+ The other way round, if |read from file| is empty, the data must
+ directly follow as \meta{inline data}.
+ %
\begin{codeexample}[code only]
\datavisualization ...
data {
@@ -404,34 +383,35 @@ visualizations.
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:
+ \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, read from file=experiment007.csv]
@@ -453,58 +433,60 @@ visualizations.
};
\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}
+ \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}{data point}{\opt{\oarg{options}}}
- This command is used to specify data a single data point. The
- \meta{options} are simply executed with the path |/data point| and
- then a data point is created. This means that inside the
- \meta{options} you just specify the values of all attributes in
- key-value syntax.
+ This command is used to specify data a single data point. The
+ \meta{options} are simply executed with the path |/data point| and then a
+ data point is created. This means that inside the \meta{options} you just
+ specify the values of all attributes in key--value syntax.
+ %
\begin{codeexample}[]
\tikz \datavisualization [school book axes, visualize as line]
data point [x=1, y=1] data point [x=1, y=2]
data point [x=2, y=2] data point [x=2, y=0.5];
\end{codeexample}
+ %
\end{datavisualizationoperation}
\begin{key}{/tikz/data visualization/data point=\meta{options}}
- This key is the ``key version'' of the previous command. The
- difference is that this key can be used internally inside styles.
+ This key is the ``key version'' of the previous command. The difference is
+ that this key can be used internally inside styles.
+ %
\begin{codeexample}[]
\tikzdatavisualizationset{
horizontal/.style={
@@ -515,38 +497,44 @@ visualizations.
horizontal=1,
horizontal=2 ];
\end{codeexample}
+ %
\end{key}
\begin{datavisualizationoperation}{data group}{\opt{\oarg{options}}\marg{name}\opt{|+=|\marg{data specifications}}}
- You can store a whole \meta{data specification} in a \emph{data
- group}. This allows you to reuse data in multiple places without
- having to write the data to an external file.
-
- The syntax of this command comes in the following three variants:
- \begin{itemize}
- \item |data group| \opt{\oarg{options}} \marg{name} |=| \marg{data specifications}
- \item |data group| \opt{\oarg{options}} \marg{name} |+=| \marg{data specifications}
- \item |data group| \opt{\oarg{options}} \marg{name}
- \end{itemize}
- In the first case, a new data group called \meta{name} is created (an
- existing data group of the same name will be erased) and the following
- \meta{data specifications} is stored in this data group. The data group
- will not be fed to the rendering pipeline, but it is parsed at this
- point as if it were. The defined data group is defined globally, so
- you can used it in subsequent visualizations. The \meta{options} are
- saved with the parsed \meta{data specifications}.
-
- In the second case, an already existing data group is extended by
- adding the \meta{data specifications} to it.
-
- In the third case (detected by noting that the \meta{name} is
- neither followed by an equal sign nor a plus sign), the contents of
- the previously defined data group \meta{name} is inserted. The
- \meta{options} are also executed.
-
- Let is now first create a data group. Note that nothing is drawn since
- the ``dummy'' data visualization is empty and used only for the
- definition of the data group.
+ You can store a whole \meta{data specification} in a \emph{data group}.
+ This allows you to reuse data in multiple places without having to write
+ the data to an external file.
+
+ The syntax of this command comes in the following three variants:
+ %
+ \begin{itemize}
+ \item |data group| \opt{\oarg{options}} \marg{name} |=| \marg{data
+ specifications}
+ \item |data group| \opt{\oarg{options}} \marg{name} |+=| \marg{data
+ specifications}
+ \item |data group| \opt{\oarg{options}} \marg{name}
+ \end{itemize}
+ %
+ In the first case, a new data group called \meta{name} is created (an
+ existing data group of the same name will be erased) and the following
+ \meta{data specifications} is stored in this data group. The data group
+ will not be fed to the rendering pipeline, but it is parsed at this point
+ as if it were. The defined data group is defined globally, so you can used
+ it in subsequent visualizations. The \meta{options} are saved with the
+ parsed \meta{data specifications}.
+
+ In the second case, an already existing data group is extended by adding
+ the \meta{data specifications} to it.
+
+ In the third case (detected by noting that the \meta{name} is neither
+ followed by an equal sign nor a plus sign), the contents of the previously
+ defined data group \meta{name} is inserted. The \meta{options} are also
+ executed.
+
+ Let is now first create a data group. Note that nothing is drawn since the
+ ``dummy'' data visualization is empty and used only for the definition of
+ the data group.
+ %
\begin{codeexample}[]
\tikz \datavisualization data group {points} = {
data {
@@ -561,21 +549,22 @@ visualizations.
};
\end{codeexample}
- We can now use this data in different plots:
+ We can now use this data in different plots:
+ %
\begin{codeexample}[]
\tikz \datavisualization [school book axes, visualize as line] data group {points};
\qquad
\tikz \datavisualization [scientific axes=clean, visualize as line] data group {points};
\end{codeexample}
+ %
\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{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]
@@ -590,22 +579,20 @@ visualizations.
data [read from file=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.
-
-
+ 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 ]
@@ -620,26 +607,25 @@ visualizations.
\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}
+ 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}
\begin{datavisualizationoperation}{info'}{\opt{\oarg{options}}\marg{code}}
- This command works like |info|, only the \meta{code} will be
- executed just before the visualization is done. This allows you to
- draw things \emph{behind} the visualization.
-
+ This command works like |info|, only the \meta{code} will be executed just
+ before the visualization is done. This allows you to draw things
+ \emph{behind} the visualization.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[baseline]
\datavisualization [ school book axes, visualize as line ]
@@ -652,120 +638,126 @@ visualizations.
};
\end{tikzpicture}
\end{codeexample}
+ %
\end{datavisualizationoperation}
-\label{section-dv-bounding-box}
-
+\label{section-dv-bounding-box}%
\begin{predefinednode}{data visualization bounding box}
- This rectangle node stores a bounding box of the data visualization
- that is currently being constructed. This node can be useful inside
- |info| commands or when labels need to be added.
+ This rectangle node stores a bounding box of the data visualization that is
+ currently being constructed. This node can be useful inside |info| commands
+ or when labels need to be added.
\end{predefinednode}
\begin{predefinednode}{data bounding box}
- This rectangle node is similar to |data visualization bounding box|,
- but it keeps track only of the actual data. The spaces needed for
- grid lines, ticks, axis labels, tick labels, and other all other
- information that is not part of the actual data is not part of this
- box.
+ This rectangle node is similar to |data visualization bounding box|, but it
+ keeps track only of the actual data. The spaces needed for grid lines,
+ ticks, axis labels, tick labels, and other all other information that is
+ not part of the actual data is not part of this box.
\end{predefinednode}
+
\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}.
+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 \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:
+ 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}.
+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 serves 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.
+ This key serves 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:
+ 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={
@@ -775,12 +767,16 @@ you are familiar with the concepts of Section~\ref{section-dv-backend}.
}
}
\end{codeexample}
- causes the following object creation code to be executed later on:
+ %
+ 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:
+ %
+ 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={
@@ -790,17 +786,20 @@ you are familiar with the concepts of Section~\ref{section-dv-backend}.
}
}
\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:
+ %
+ 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}
+ \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{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={
@@ -810,17 +809,20 @@ you are familiar with the concepts of Section~\ref{section-dv-backend}.
}
\tikzset{some key/.initial=foobar}
\end{codeexample}
- causes the following to be executed:
+ %
+ 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}
+ %
+ 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-polar.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-polar.tex
index 7eb15fde505..5d9f3518052 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-polar.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-dv-polar.tex
@@ -8,27 +8,21 @@
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-
-
\section{Polar Axes}
-
\label{section-dv-polar}
-
\subsection{Overview}
\begin{tikzlibrary}{datavisualization.polar}
- This library contains keys that allow you to create plots in a polar
- axis system is used.
+ This library contains keys that allow you to create plots in a polar axis
+ system is used.
\end{tikzlibrary}
-In a \emph{polar axis system} two attributes are visualized by
-displacing a data point as follows: One attribute is used to compute a
-an angle (a direction) while a second attribute is used as a radius (a
-distance). The angle can be measured in degrees, radians, or can be
-scaled arbitrarily.
-
-
+In a \emph{polar axis system} two attributes are visualized by displacing a
+data point as follows: One attribute is used to compute a an angle (a
+direction) while a second attribute is used as a radius (a distance). The angle
+can be measured in degrees, radians, or can be scaled arbitrarily.
+%
\begin{codeexample}[width=8.5cm]
\tikz \datavisualization [
scientific polar axes={0 to pi, clean},
@@ -50,20 +44,18 @@ scaled arbitrarily.
};
\end{codeexample}
-Most of the time, in order to create a polar axis system, you will
-just use the |scientific polar axes| key, which takes a number of
-options that allow you to configure the axis system in greater
-detail. This key is documented in
-Section~\ref{section-dv-sci-polar-axes}. Internally, this key uses
-more low level keys which are documented in the en suite sections.
-
-It is worthwhile to note that the axes of a polar axis system are,
-still, normal axes of the data visualization system. In particular,
-all the configurations possible for, say, Cartesian axes also apply to
-the ``angle axis'' and the ``radius axis'' of a polar axis system. For
-instance, you can could make both axes logarithmic or style their
-ticks:
-
+Most of the time, in order to create a polar axis system, you will just use the
+|scientific polar axes| key, which takes a number of options that allow you to
+configure the axis system in greater detail. This key is documented in
+Section~\ref{section-dv-sci-polar-axes}. Internally, this key uses more low
+level keys which are documented in the en suite sections.
+
+It is worthwhile to note that the axes of a polar axis system are, still,
+normal axes of the data visualization system. In particular, all the
+configurations possible for, say, Cartesian axes also apply to the ``angle
+axis'' and the ``radius axis'' of a polar axis system. For instance, you can
+could make both axes logarithmic or style their ticks:
+%
\begin{codeexample}[]
\tikz[baseline] \datavisualization [
scientific axes={clean},
@@ -90,7 +82,7 @@ ticks:
var t : interval [-3:3];
func angle = exp(\value t);
func radius = \value{t}*\value{t};
- };
+ };
\end{codeexample}
@@ -98,32 +90,33 @@ ticks:
\label{section-dv-sci-polar-axes}
\begin{key}{/tikz/data visualization/scientific polar axes=\meta{options}}
- This key installs a polar axis system that can be used in a
- ``scientific'' publication. Two axes are created called the
- |angle axis| and the |radius axis|. Unlike ``normal'' Cartesian
- axes, these axes do not point in a specific direction. Rather, the
- |radius axis| is used to map the values of one attribute to a
- distance from the origin while the |angle axis| is used to map the
- values of another attribute to a rotation angle.
-
- The \meta{options} will be executed with the path prefix
+ This key installs a polar axis system that can be used in a ``scientific''
+ publication. Two axes are created called the |angle axis| and the
+ |radius axis|. Unlike ``normal'' Cartesian axes, these axes do not point in
+ a specific direction. Rather, the |radius axis| is used to map the values
+ of one attribute to a distance from the origin while the |angle axis| is
+ used to map the values of another attribute to a rotation angle.
+
+ The \meta{options} will be executed with the path prefix
+ %
\begin{codeexample}[code only]
-/tikz/data visualization/scientific polar axes
+/tikz/data visualization/scientific polar axes
\end{codeexample}
- The permissible keys are documented in the later subsections of this
- section.
-
- Let us start with the configuration of the radius axis since it is
- easier. Firstly, you should specify which attribute is linked to the
- radius. The default is |radius|, but you will typically wish to
- change this. As with any other axis, the |attribute| key is used to
- configure the axis, see Section~\ref{section-dv-axis-attribute} for
- details. You can also apply all other configurations to the radius
- axis like, say, |unit length| or |length| or |style|. Note, however,
- that the |logarithmic| key will not work with the radius axis for a
- |scientific polar axes| system since the attribute value zero is
- always placed at the center -- and for a logarithmic plot the value
- |0| cannot be mapped.
+ %
+ The permissible keys are documented in the later subsections of this
+ section.
+
+ Let us start with the configuration of the radius axis since it is easier.
+ Firstly, you should specify which attribute is linked to the radius. The
+ default is |radius|, but you will typically wish to change this. As with
+ any other axis, the |attribute| key is used to configure the axis, see
+ Section~\ref{section-dv-axis-attribute} for details. You can also apply all
+ other configurations to the radius axis like, say, |unit length| or
+ |length| or |style|. Note, however, that the |logarithmic| key will not
+ work with the radius axis for a |scientific polar axes| system since the
+ attribute value zero is always placed at the center -- and for a
+ logarithmic plot the value |0| cannot be mapped.
+ %
\begin{codeexample}[width=8.8cm]
\tikz \datavisualization [
scientific polar axes,
@@ -141,24 +134,23 @@ data [format=function] {
};
\end{codeexample}
- For the |angle axis|, you can also specify an attribute using the
- |attribute| key. However, for this axis the mapping of a value to an
- actual angle is a complicated process involving many considerations
- of how the polar axis system should be visualized. For this reason,
- there are a large number of predefined such mappings documented in
- Section~\ref{section-dv-angle-ranges}.
-
- Finally, as for a |scientific plot|, you can configure where the
- ticks should be shown using the keys |inner ticks|, |outer ticks|,
- and |clean|, documented below.
+ For the |angle axis|, you can also specify an attribute using the
+ |attribute| key. However, for this axis the mapping of a value to an actual
+ angle is a complicated process involving many considerations of how the
+ polar axis system should be visualized. For this reason, there are a large
+ number of predefined such mappings documented in
+ Section~\ref{section-dv-angle-ranges}. Finally, as for a |scientific plot|,
+ you can configure where the ticks should be shown using the keys
+ |inner ticks|, |outer ticks|, and |clean|, documented below.
\end{key}
\subsubsection{Tick Placements}
\begin{key}{/tikz/data visualization/scientific polar axes/outer ticks}
- This key, which is the default, causes ticks to be drawn
- ``outside'' the outer ``ring'' of the polar axes:
+ This key, which is the default, causes ticks to be drawn ``outside'' the
+ outer ``ring'' of the polar axes:
+ %
\begin{codeexample}[width=8.8cm]
\tikz \datavisualization [
scientific polar axes={outer ticks, 0 to 180},
@@ -168,11 +160,13 @@ data [format=function] {
func radius = \value{angle};
};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/scientific polar axes/inner ticks}
- This key causes the ticks to be ``turned to the inside.'' I do not
- recommend using this key.
+ This key causes the ticks to be ``turned to the inside''. I do not
+ recommend using this key.
+ %
\begin{codeexample}[width=8.8cm]
\tikz \datavisualization [
scientific polar axes={inner ticks, 0 to 180},
@@ -182,13 +176,14 @@ data [format=function] {
func radius = \value{angle};
};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/scientific polar axes/clean}
- This key separates the area where the data is shown from the area
- where the ticks are shown. Usually, this is the best choice for the
- tick placement since it avoids a collision of data and
- explanations.
+ This key separates the area where the data is shown from the area where the
+ ticks are shown. Usually, this is the best choice for the tick placement
+ since it avoids a collision of data and explanations.
+ %
\begin{codeexample}[width=8.8cm]
\tikz \datavisualization [
scientific polar axes={clean, 0 to 180},
@@ -197,63 +192,60 @@ data [format=function] {
var angle : interval [0:100];
func radius = \value{angle};
};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
\subsubsection{Angle Ranges}
\label{section-dv-angle-ranges}
-Suppose you create a polar plot in which the radius values vary
-between, say, $567$ and $1234$. Then the normal axis scaling mechanisms
-can be used to compute a good scaling for the ``radius axis'': Place
-the value $1234$ at a distance of , say, $5\,\mathrm{cm}$ from the
-origin and place the value $0$ at the origin. Now, by comparison,
-suppose that the values of the angle axis's attribute ranged between,
-say, $10$ and $75.7$. In this case, we may wish the angles to be
-scaled so that the minimum value is horizontal and the maximum value is
-vertical. But we may also wish the a value of $0$ is horizontal and a
-value of $90$ is vertical.
-
-Since it is unclear which interpretation is the right one, you have to
-use an option to select which should happen. The applicable options
-fall into three categories:
-
+Suppose you create a polar plot in which the radius values vary between, say,
+$567$ and $1234$. Then the normal axis scaling mechanisms can be used to
+compute a good scaling for the ``radius axis'': Place the value $1234$ at a
+distance of , say, $5\,\mathrm{cm}$ from the origin and place the value $0$ at
+the origin. Now, by comparison, suppose that the values of the angle axis's
+attribute ranged between, say, $10$ and $75.7$. In this case, we may wish the
+angles to be scaled so that the minimum value is horizontal and the maximum
+value is vertical. But we may also wish the a value of $0$ is horizontal and a
+value of $90$ is vertical.
+
+Since it is unclear which interpretation is the right one, you have to use an
+option to select which should happen. The applicable options fall into three
+categories:
+%
\begin{itemize}
-\item Options that request the scaling to be done in such a way that
- the attribute is interpreted as a value in degrees and such that the
- minimum and maximum of the depicted range is a multiple of
- $90^\circ$. For instance, the option |0 to 180| causes the angle
- axis to range from $0^\circ$ to $180^\circ$, independently of the
- actual range of the values.
-\item Options that work as above, but use radians rather than
- degrees. An example is the option |0 to pi|.
-\item Options that map the minimum value in the data to a horizontal
- or vertical line and the maximum value to another such line. This is
- useful when the values neither directly correspond to degrees or
- radians. In this case, the angle axis may also be a logarithmic
- axis.
+ \item Options that request the scaling to be done in such a way that the
+ attribute is interpreted as a value in degrees and such that the
+ minimum and maximum of the depicted range is a multiple of $90^\circ$.
+ For instance, the option |0 to 180| causes the angle axis to range from
+ $0^\circ$ to $180^\circ$, independently of the actual range of the
+ values.
+ \item Options that work as above, but use radians rather than degrees. An
+ example is the option |0 to pi|.
+ \item Options that map the minimum value in the data to a horizontal or
+ vertical line and the maximum value to another such line. This is
+ useful when the values neither directly correspond to degrees or
+ radians. In this case, the angle axis may also be a logarithmic axis.
\end{itemize}
-In addition to the above categories, all of the option documented in
-the following implicitly also select quadrants that are used to depict
-the data. For instance, the |0 to 90| key and also the |0 to pi half|
-key setup the polar axis system in such a way that only first (upper
-right) quadrant is used. No check is done whether the data fill
-actually lie in this quadrant -- if it does not, the data will ``bleed
-outside'' the range. Naturally, with a key like |0 to 360| or
-|0 to 2pi| this cannot happen.
-
-In order to save some space in this manual, in the following the
-different possible keys are only given in a table together with a
-small example for each key. The examples were created using the
-following code:
-
+In addition to the above categories, all of the option documented in the
+following implicitly also select quadrants that are used to depict the data.
+For instance, the |0 to 90| key and also the |0 to pi half| key setup the polar
+axis system in such a way that only first (upper right) quadrant is used. No
+check is done whether the data fill actually lie in this quadrant -- if it does
+not, the data will ``bleed outside'' the range. Naturally, with a key like
+|0 to 360| or |0 to 2pi| this cannot happen.
+
+In order to save some space in this manual, in the following the different
+possible keys are only given in a table together with a small example for each
+key. The examples were created using the following code:
+%
\begin{codeexample}[]
\tikz \datavisualization [
scientific polar axes={
clean,
- 0 to 90 % the option
+ 0 to 90 % the option
},
angle axis={ticks={step=30}},
radius axis={length=1cm, ticks={step=1}},
@@ -263,13 +255,13 @@ data point [angle=30, radius=1]
data point [angle=40, radius=1.5];
\end{codeexample}
-For the options on radians, the angle values have been replaced by
-|0.2|, |0.3|, and |0.4| and the stepping has been changed by setting
-|step=(pi/6)|. For the quadrant options, no stepping is set at all (it
-is computed automatically).
+For the options on radians, the angle values have been replaced by |0.2|,
+|0.3|, and |0.4| and the stepping has been changed by setting |step=(pi/6)|.
+For the quadrant options, no stepping is set at all (it is computed
+automatically).
\def\polarexample#1#2#3#4#5{%
- \texttt{#1}%
+ \texttt{#1}%
\indexkey{/tikz/data visualization/scientific polar axes/#1}&
\tikz [baseline]{\path(-2.25cm,0)(2.25cm,0); \datavisualization [
scientific polar axes={clean, #1},
@@ -297,62 +289,60 @@ is computed automatically).
}
\begin{tabular}{lcc}
- \emph{Option} & \emph{With clean ticks} & \emph{With outer ticks} \\
- \polarexample{0 to 90}{step=30}{20}{30}{40}
- \polarexample{-90 to 0}{step=30}{20}{30}{40}
- \polarexample{0 to 180}{step=30}{20}{30}{40}
- \polarexample{-90 to 90}{step=30}{20}{30}{40}
- \polarexample{0 to 360}{step=30}{20}{30}{40}
- \polarexample{-180 to 180}{step=30}{20}{30}{40}
+ \emph{Option} & \emph{With clean ticks} & \emph{With outer ticks} \\
+ \polarexample{0 to 90}{step=30}{20}{30}{40}
+ \polarexample{-90 to 0}{step=30}{20}{30}{40}
+ \polarexample{0 to 180}{step=30}{20}{30}{40}
+ \polarexample{-90 to 90}{step=30}{20}{30}{40}
+ \polarexample{0 to 360}{step=30}{20}{30}{40}
+ \polarexample{-180 to 180}{step=30}{20}{30}{40}
\end{tabular}
\begin{tabular}{lcc}
- \emph{Option} & \emph{With clean ticks} & \emph{With outer ticks} \\
- \polarexample{0 to pi half}{step=(pi/6)}{0.2}{0.3}{0.4}
- \polarexample{-pi half to 0}{step=(pi/6)}{0.2}{0.3}{0.4}
- \polarexample{0 to pi}{step=(pi/6)}{0.2}{0.3}{0.4}
- \polarexample{-pi half to pi half}{step=(pi/6)}{0.2}{0.3}{0.4}
- \polarexample{0 to 2pi}{step=(pi/6)}{0.2}{0.3}{0.4}
- \polarexample{-pi to pi}{step=(pi/6)}{0.2}{0.3}{0.4}
+ \emph{Option} & \emph{With clean ticks} & \emph{With outer ticks} \\
+ \polarexample{0 to pi half}{step=(pi/6)}{0.2}{0.3}{0.4}
+ \polarexample{-pi half to 0}{step=(pi/6)}{0.2}{0.3}{0.4}
+ \polarexample{0 to pi}{step=(pi/6)}{0.2}{0.3}{0.4}
+ \polarexample{-pi half to pi half}{step=(pi/6)}{0.2}{0.3}{0.4}
+ \polarexample{0 to 2pi}{step=(pi/6)}{0.2}{0.3}{0.4}
+ \polarexample{-pi to pi}{step=(pi/6)}{0.2}{0.3}{0.4}
\end{tabular}
\begin{tabular}{lcc}
- \emph{Option} & \emph{With clean ticks} & \emph{With outer ticks} \\
- \polarexample{quadrant}{}{20}{30}{40}
- \polarexample{quadrant clockwise}{}{20}{30}{40}
- \polarexample{fourth quadrant}{}{20}{30}{40}
- \polarexample{fourth quadrant clockwise}{}{20}{30}{40}
- \polarexample{upper half}{}{20}{30}{40}
- \polarexample{upper half clockwise}{}{20}{30}{40}
- \polarexample{lower half}{}{20}{30}{40}
- \polarexample{lower half clockwise}{}{20}{30}{40}
+ \emph{Option} & \emph{With clean ticks} & \emph{With outer ticks} \\
+ \polarexample{quadrant}{}{20}{30}{40}
+ \polarexample{quadrant clockwise}{}{20}{30}{40}
+ \polarexample{fourth quadrant}{}{20}{30}{40}
+ \polarexample{fourth quadrant clockwise}{}{20}{30}{40}
+ \polarexample{upper half}{}{20}{30}{40}
+ \polarexample{upper half clockwise}{}{20}{30}{40}
+ \polarexample{lower half}{}{20}{30}{40}
+ \polarexample{lower half clockwise}{}{20}{30}{40}
\end{tabular}
\begin{tabular}{lcc}
- \emph{Option} & \emph{With clean ticks} & \emph{With outer ticks} \\
- \polarexample{left half}{}{20}{30}{40}
- \polarexample{left half clockwise}{}{20}{30}{40}
- \polarexample{right half}{}{20}{30}{40}
- \polarexample{right half clockwise}{}{20}{30}{40}
+ \emph{Option} & \emph{With clean ticks} & \emph{With outer ticks} \\
+ \polarexample{left half}{}{20}{30}{40}
+ \polarexample{left half clockwise}{}{20}{30}{40}
+ \polarexample{right half}{}{20}{30}{40}
+ \polarexample{right half clockwise}{}{20}{30}{40}
\end{tabular}
-
\subsection{Advanced: Creating a New Polar Axis System}
-\begin{key}{/tikz/data visualization/new polar axes=|\char`\{|\meta{angle axis
- name}|\char`\}||\char`\{|\meta{radius axis name}|\char`\}|}
- This key actually creates two axes, whose names are give as
- parameters: An \emph{angle axis} and a \emph{radius axis}. These two
- axes work in concert in the following way: Suppose a data point has two
- attributes called |angle| and |radius| (these attribute names can be
- changed by changing the |attribute| of the \meta{angle axis name} or
- the \meta{radius axis name}, respectively). These two attributes are
- then scaled as usual, resulting in two ``reasonable'' values $a$
- (for the angle) and $r$ (for the radius). Then, the data point gets
- visualized (in principle, details will follow) at a position on the
- page that is at a distance of $r$ from the origin and at an angle
- of~$a$.
+\begin{key}{/tikz/data visualization/new polar axes=|\char`\{|\meta{angle axis name}|\char`\}||\char`\{|\meta{radius axis name}|\char`\}|}
+ This key actually creates two axes, whose names are give as parameters: An
+ \emph{angle axis} and a \emph{radius axis}. These two axes work in concert
+ in the following way: Suppose a data point has two attributes called
+ |angle| and |radius| (these attribute names can be changed by changing the
+ |attribute| of the \meta{angle axis name} or the \meta{radius axis name},
+ respectively). These two attributes are then scaled as usual, resulting in
+ two ``reasonable'' values $a$ (for the angle) and $r$ (for the radius).
+ Then, the data point gets visualized (in principle, details will follow) at
+ a position on the page that is at a distance of $r$ from the origin and at
+ an angle of~$a$.
+ %
\begin{codeexample}[]
\tikz \datavisualization
[new polar axes={angle axis}{radius axis},
@@ -362,26 +352,27 @@ is computed automatically).
angle={0,20,...,160}, radius={0,...,5}
};
\end{codeexample}
- In detail, the \meta{angle axis} keeps track of two vectors $v_0$
- and $v_{90}$, each of which will usually have unit length (length
- |1pt|) and which point in two different directions. Given a radius
- $r$ (measured in \TeX\ |pt|s, so if the
- radius attribute |10pt|, then $r$ would be $10$) and an angle $a$,
- let $s$ be the sine of $a$ and let $c$ be the cosine
- of $a$, where $a$ is a number is degrees (so $s$
- would be $1$ for $a = 90$). Then, the current page position is
- shifted by $c \cdot r$ times $v_0$ and, additionally, by $s \cdot r$
- times $v_{90}$. This means that in the
- ``polar coordinate system'' $v_0$ is the unit vector along the
- ``$0^\circ$-axis'' and $v_{90}$ is the unit vector along
- ``$90^\circ$-axis''. The values of $v_0$ and $v_{90}$ can be changed
- using the following key on the \meta{angle axis}:
- \begin{key}{/tikz/data visualization/axis options/unit
- vectors=|\char`\{|\meta{unit vector 0
- degrees}|\char`\}\char`\{|\meta{unit vector 90
- degrees}|\char`\}| (initially {\char`\{(1pt,0pt)\char`\}\char`\{(0pt,1pt)\char`\}})}
- Both the \meta{unit vector 0 degrees} and the \meta{unit vector 90
- degrees} are \tikzname\ coordinates:
+ %
+ In detail, the \meta{angle axis} keeps track of two vectors $v_0$ and
+ $v_{90}$, each of which will usually have unit length (length |1pt|) and
+ which point in two different directions. Given a radius $r$ (measured in
+ \TeX\ |pt|s, so if the radius attribute |10pt|, then $r$ would be $10$) and
+ an angle $a$, let $s$ be the sine of $a$ and let $c$ be the cosine of $a$,
+ where $a$ is a number is degrees (so $s$ would be $1$ for $a = 90$). Then,
+ the current page position is shifted by $c \cdot r$ times $v_0$ and,
+ additionally, by $s \cdot r$ times $v_{90}$. This means that in the ``polar
+ coordinate system'' $v_0$ is the unit vector along the ``$0^\circ$-axis''
+ and $v_{90}$ is the unit vector along ``$90^\circ$-axis''. The values of
+ $v_0$ and $v_{90}$ can be changed using the following key on the
+ \meta{angle axis}:
+ %
+ \begin{key}{/tikz/data visualization/axis options/unit vectors=%
+ |\char`\{|\meta{unit vector 0 degrees}|\char`\}\char`\{|\meta{unit vector 90 degrees}|\char`\}|
+ (initially {\char`\{(1pt,0pt)\char`\}\char`\{(0pt,1pt)\char`\}})%
+ }
+ Both the \meta{unit vector 0 degrees} and the \meta{unit vector 90 degrees}
+ are \tikzname\ coordinates:
+ %
\begin{codeexample}[]
\tikz \datavisualization
[new polar axes={angle axis}{radius axis},
@@ -391,17 +382,18 @@ is computed automatically).
data [format=named] {
angle={0,90}, radius={0.25,0.5,...,2}
};
-\end{codeexample}
- \end{key}
+\end{codeexample}
+ \end{key}
\end{key}
-Once created, the |angle axis| can be scaled conveniently using the
-following keys:
+Once created, the |angle axis| can be scaled conveniently using the following
+keys:
\begin{key}{/tikz/data visualization/axis options/degrees}
- When this key is passed to the angle axis of a polar axis system, it
- sets up the scaling so that a value of |360| on this axis
- corresponds to a complete circle.
+ When this key is passed to the angle axis of a polar axis system, it sets
+ up the scaling so that a value of |360| on this axis corresponds to a
+ complete circle.
+ %
\begin{codeexample}[]
\tikz \datavisualization
[new polar axes={angle axis}{radius axis},
@@ -411,12 +403,14 @@ following keys:
data [format=named] {
angle={10,90}, radius={0.25,0.5,...,2}
};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/axis options/radians}
- In contrast to |degrees|, this option sets up things so that a value
- of |2*pi| on this axis corresponds to a complete circle.
+ In contrast to |degrees|, this option sets up things so that a value of
+ |2*pi| on this axis corresponds to a complete circle.
+ %
\begin{codeexample}[]
\tikz \datavisualization
[new polar axes={angle axis}{radius axis},
@@ -427,7 +421,5 @@ following keys:
angle={0,1.5}, radius={0.25,0.5,...,2}
};
\end{codeexample}
+ %
\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
index 43682ca38e3..0e162cc1c32 100644
--- 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
@@ -13,70 +13,64 @@
\subsection{Overview}
-In many data visualizations, different sets of data need to be
-visualized in a single visualization. For instance, in a plot there
-might be a line for the sine of~$x$ and another line for the cosine
-of~$x$; in another visualization there might be a set of points
-representing data from a first experiment and another set of points
-representing data from a second experiment; and so on. In order to
-indicate to which data set a data point belongs, one might plot the
-curve of the sine in, say, black, and the curve of the cosine in red;
-we might plot the data from the fist experiment using stars and the
-data from the second experiment using circles; and so on. Finally, at
-some place in the visualization -- either inside the data or in a
-legend next to it -- the meaning of the colors or symbols need to be
-explained.
-
-Just as you would like \tikzname\ to map the data points automatically
-onto the axes, you will also typically wish \tikzname\ to choose for
-instance the coloring of the lines automatically for you. This is done
-using \emph{style sheets}. There are at least two good reasons why you
-should prefer style sheets over configuring the styling of each
-visualizer ``by hand'' using the |style| key:
+In many data visualizations, different sets of data need to be visualized in a
+single visualization. For instance, in a plot there might be a line for the
+sine of~$x$ and another line for the cosine of~$x$; in another visualization
+there might be a set of points representing data from a first experiment and
+another set of points representing data from a second experiment; and so on. In
+order to indicate to which data set a data point belongs, one might plot the
+curve of the sine in, say, black, and the curve of the cosine in red; we might
+plot the data from the fist experiment using stars and the data from the second
+experiment using circles; and so on. Finally, at some place in the
+visualization -- either inside the data or in a legend next to it -- the
+meaning of the colors or symbols need to be explained.
+
+Just as you would like \tikzname\ to map the data points automatically onto the
+axes, you will also typically wish \tikzname\ to choose for instance the
+coloring of the lines automatically for you. This is done using \emph{style
+sheets}. There are at least two good reasons why you should prefer style sheets
+over configuring the styling of each visualizer ``by hand'' using the |style|
+key:
+%
\begin{enumerate}
-\item It is far more convenient to just say
- |style sheet=strong colors| than having to individually
- picking the different colors.
-\item The style sheets were chosen and constructed rather
- carefully.
-
- For instance, the |strong colors| style sheet does not
- pick colors like pure green or pure yellow, which have very low
- contrast with respect to a white background and which often lead to
- unintelligible graphics. Instead, opposing primary colors with
- maximum contrast on a white background were picked that are visually
- quite pleasing.
-
- Similarly, the different dashing style sheets are
- constructed in such a way that there are only few and small gaps in
- the dashing so that no data points get lost because the dashes are
- spaced too far apart. Also dashing patterns were chosen that have a
- maximum optical difference.
-
- As a final example, style sheets for
- plot marks are constructed in such a way that even when two plot
- marks lie directly on top of each other, they are still easily
- distinguishable.
+ \item It is far more convenient to just say |style sheet=strong colors|
+ than having to individually picking the different colors.
+ \item The style sheets were chosen and constructed rather carefully.
+
+ For instance, the |strong colors| style sheet does not pick colors like
+ pure green or pure yellow, which have very low contrast with respect to
+ a white background and which often lead to unintelligible graphics.
+ Instead, opposing primary colors with maximum contrast on a white
+ background were picked that are visually quite pleasing.
+
+ Similarly, the different dashing style sheets are constructed in such a
+ way that there are only few and small gaps in the dashing so that no
+ data points get lost because the dashes are spaced too far apart. Also
+ dashing patterns were chosen that have a maximum optical difference.
+
+ As a final example, style sheets for plot marks are constructed in such
+ a way that even when two plot marks lie directly on top of each other,
+ they are still easily distinguishable.
\end{enumerate}
-The bottom line is that whenever possible, you should use one of the
-predefined style sheets rather than picking colors or dashings at
-random.
+%
+The bottom line is that whenever possible, you should use one of the predefined
+style sheets rather than picking colors or dashings at random.
+
\subsection{Concepts: Style Sheets}
-A \emph{style sheet} is a predefined list of styles such as a list of
-colors, a list of dashing pattern, a list of plot marks, or a
-combinations thereof. A style sheet can be \emph{attached} to a data
-point attribute. Then, the value of this attribute is used with data
-points to choose which style in the list should be chosen to visualize
-the data point.
+A \emph{style sheet} is a predefined list of styles such as a list of colors, a
+list of dashing pattern, a list of plot marks, or a combinations thereof. A
+style sheet can be \emph{attached} to a data point attribute. Then, the value
+of this attribute is used with data points to choose which style in the list
+should be chosen to visualize the data point.
-In most cases, there is just one attribute to which style sheets get
-attached: the |/data point/visualizer| attribute. The effect of
-attaching a style sheet to this attribute is that each visualizer is
-styled differently.
+In most cases, there is just one attribute to which style sheets get attached:
+the |/data point/visualizer| attribute. The effect of attaching a style sheet
+to this attribute is that each visualizer is styled differently.
For the following examples, let us first define a simple data set:
+%
\begin{codeexample}[]
\tikz \datavisualization data group {function classes} = {
data [set=log, format=function] {
@@ -115,29 +109,26 @@ data group {function classes};
\end{codeexample}
-
\subsection{Concepts: Legends}
\label{section-dv-labels-in}
-A \emph{legend} is a box that is next to a data visualization (or
-inside it at some otherwise empty position) that contains a textual
-explanation of the different colors or styles used in a data
-visualization.
-
-Just as it is difficult to get colors and dashing patterns right ``by
-hand,'' it is also difficult to get a legend right. For instance, when
-a small line is shown in the legend that represents the actual line in
-the data visualization, if the line is too short and the dashing is
-too large, it may be impossible to discern which dashing is actually
-meant. Similarly, when plot marks are shown on such a short line,
-using a simple straight line may make it hard to read the plot marks
-correctly.
-
-The data visualization engine makes some effort to make it easy to
-create high-quality legends. Additionally, it also offers ways of
-easily adding labels for visualizers directly inside the data
-visualization, which is even better than adding a legend, in general.
-
+A \emph{legend} is a box that is next to a data visualization (or inside it at
+some otherwise empty position) that contains a textual explanation of the
+different colors or styles used in a data visualization.
+
+Just as it is difficult to get colors and dashing patterns right ``by hand'',
+it is also difficult to get a legend right. For instance, when a small line is
+shown in the legend that represents the actual line in the data visualization,
+if the line is too short and the dashing is too large, it may be impossible to
+discern which dashing is actually meant. Similarly, when plot marks are shown
+on such a short line, using a simple straight line may make it hard to read the
+plot marks correctly.
+
+The data visualization engine makes some effort to make it easy to create
+high-quality legends. Additionally, it also offers ways of easily adding labels
+for visualizers directly inside the data visualization, which is even better
+than adding a legend, in general.
+%
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
school book axes, all axes={unit length=7.5mm},
@@ -151,7 +142,6 @@ visualization, which is even better than adding a legend, in general.
data group {function classes};
\end{codeexample}
-
\begin{codeexample}[width=6.3cm]
\tikz \datavisualization [
school book axes,
@@ -173,20 +163,19 @@ data group {function classes};
\subsubsection{Picking a Style Sheet}
-To use a style sheet, you need to \emph{attach} it to an
-attribute. You can attach multiple style sheets to an attribute and
-in this case all of these style sheets can influence the appearance of
-the data points.
+To use a style sheet, you need to \emph{attach} it to an attribute. You can
+attach multiple style sheets to an attribute and in this case all of these
+style sheets can influence the appearance of the data points.
-Most of the time, you will attach a style sheet to the |set|
-attribute. This has the effect that each different data set inside the
-same visualization is rendered in a different way. Since this use of
-style sheets is the most common, there is a special, easy-to-remember
-option for this:
+Most of the time, you will attach a style sheet to the |set| attribute. This
+has the effect that each different data set inside the same visualization is
+rendered in a different way. Since this use of style sheets is the most common,
+there is a special, easy-to-remember option for this:
\begin{key}{/tikz/data visualization/style sheet=\meta{style sheet}}
- Adds the \meta{style sheet} to the list of style sheets attached to
- the |set| attribute.
+ Adds the \meta{style sheet} to the list of style sheets attached to the
+ |set| attribute.
+ %
\begin{codeexample}[width=6cm]
\tikz \datavisualization [
school book axes, all axes={unit length=7.5mm},
@@ -195,103 +184,103 @@ option for this:
style sheet=vary hue]
data group {function classes};
\end{codeexample}
+ %
\end{key}
-While the |style sheet| key will attach a style sheet only to the
-|set| attribute, the following key handler can be used to attach a
-style sheet to an arbitrary attribute:
-
+While the |style sheet| key will attach a style sheet only to the |set|
+attribute, the following key handler can be used to attach a style sheet to an
+arbitrary attribute:
\begin{handler}{{.style sheet}=\meta{style sheet}}
- Inside a data visualization you can use this key handler together
- with an attribute, that is, with a key having the path prefix
- |/data point|. For instance, in order to attach the \meta{style
- sheet} |strong colors| to the attribute |set|, you could write
+ Inside a data visualization you can use this key handler together with an
+ attribute, that is, with a key having the path prefix |/data point|. For
+ instance, in order to attach the \meta{style sheet} |strong colors| to the
+ attribute |set|, you could write
+ %
\begin{codeexample}[code only]
-/data point/set/.style sheet=strong colors
-\end{codeexample}
- Indeed, the |style sheet| key is just a shorthand for the above.
-
- The effect of attaching a style sheet is the following:
- \begin{itemize}
- \item A new object is created that will monitor the attribute.
- \item Each time a special \emph{styling key} is emitted by the data
- visualization engine, this object will inspect the current value
- of the attribute to which it is attached.
- \item Depending on this value, one of the styles stored in the style
- sheet is chosen (how this works, exactly, will be explained in a
- moment).
- \item The chosen style is then locally applied.
- \end{itemize}
-
- In reality, things are a bit more complicated: If the attribute of
- the data point happens to have a subkey named in the same way as the
- value, then the value of is this subkey is used instead of the value
- itself. This allows you to ``rename'' a value.
-
- In a sense, a style sheet behaves much like a visualizer (see
- Section~\ref{section-dv-visualizers}): In accordance with the value
- of a certain attribute, the appearance of data points
- change. However, there are a few differences: First, the styling of
- a data point needs to be triggered explicitly and this triggering is
- not necessarily done for each data point individually, but only for
- a whole visualizer. Second, styles can be computed even when no data
- point is present. This is useful for instance in a legend since,
- here, a visual representation of a visualizer needs to be created
- independently of the actual data points.
+/data point/set/.style sheet=strong colors
+\end{codeexample}
+ %
+ Indeed, the |style sheet| key is just a shorthand for the above.
+
+ The effect of attaching a style sheet is the following:
+ %
+ \begin{itemize}
+ \item A new object is created that will monitor the attribute.
+ \item Each time a special \emph{styling key} is emitted by the data
+ visualization engine, this object will inspect the current value of
+ the attribute to which it is attached.
+ \item Depending on this value, one of the styles stored in the style
+ sheet is chosen (how this works, exactly, will be explained in a
+ moment).
+ \item The chosen style is then locally applied.
+ \end{itemize}
+
+ In reality, things are a bit more complicated: If the attribute of the data
+ point happens to have a subkey named in the same way as the value, then the
+ value of is this subkey is used instead of the value itself. This allows
+ you to ``rename'' a value.
+
+ In a sense, a style sheet behaves much like a visualizer (see
+ Section~\ref{section-dv-visualizers}): In accordance with the value of a
+ certain attribute, the appearance of data points change. However, there are
+ a few differences: First, the styling of a data point needs to be triggered
+ explicitly and this triggering is not necessarily done for each data point
+ individually, but only for a whole visualizer. Second, styles can be
+ computed even when no data point is present. This is useful for instance in
+ a legend since, here, a visual representation of a visualizer needs to be
+ created independently of the actual data points.
\end{handler}
+
\subsubsection{Creating a New Style Sheet}
-Creating a style sheet works as follows: For each
-possible value that an attribute can attain we must specify a
-style. This is done by creating a style key for each such possible
-value with a special path prefix and setting this style key to the
-desired value. The special path prefix is
-|/pgf/data visualization/style sheets| followed by the name of the
-style sheet.
-
-As an example, suppose we wish to create a style sheet |test| that makes
-styled data points |red| when the attribute has value |foo| and
-|green| when the attribute has value |bar| and |dashed, blue| when the
-attribute is |foobar|. We could then write
+Creating a style sheet works as follows: For each possible value that an
+attribute can attain we must specify a style. This is done by creating a style
+key for each such possible value with a special path prefix and setting this
+style key to the desired value. The special path prefix is
+|/pgf/data visualization/style sheets| followed by the name of the style sheet.
+
+As an example, suppose we wish to create a style sheet |test| that makes styled
+data points |red| when the attribute has value |foo| and |green| when the
+attribute has value |bar| and |dashed, blue| when the attribute is |foobar|. We
+could then write
+%
\begin{codeexample}[code only]
-/pgf/data visualization/style sheets/test/foo/.style={red},
-/pgf/data visualization/style sheets/test/bar/.style={green},
-/pgf/data visualization/style sheets/test/foobar/.style={dashed, blue},
+/pgf/data visualization/style sheets/test/foo/.style={red},
+/pgf/data visualization/style sheets/test/bar/.style={green},
+/pgf/data visualization/style sheets/test/foobar/.style={dashed, blue},
\end{codeexample}
-We could then attach this style sheet to the attribute |code| as
-follows:
+We could then attach this style sheet to the attribute |code| as follows:
+%
\begin{codeexample}[code only]
/data point/code/.style sheet=test
\end{codeexample}
-Then, when |/data point/code=foobar| holds when the styling signal is
-raised, the style |dashed, blue| will get executed.
+Then, when |/data point/code=foobar| holds when the styling signal is raised,
+the style |dashed, blue| will get executed.
-A natural question arises concerning the situation that the value of
-the attribute is not defined as a subkey of the style sheet. In this
-case, a special key gets executed:
+A natural question arises concerning the situation that the value of the
+attribute is not defined as a subkey of the style sheet. In this case, a
+special key gets executed:
-\begin{stylekey}{/pgf/data visualization/style sheets/\meta{style
- sheet}/default style=\meta{value}}
- This key gets during styling whenever
- |/pgf/data visualization/style sheet/|\meta{style
- sheet}|/|\meta{value} is not defined.
+\begin{stylekey}{/pgf/data visualization/style sheets/\meta{style sheet}/default style=\meta{value}}
+ This key gets during styling whenever
+ |/pgf/data visualization/style sheet/|\meta{style sheet}|/|\meta{value} is
+ not defined.
\end{stylekey}
-Let us put all of this together in a real-life example. Suppose we
-wish to create a style sheet that makes the first data set |green|, the
-second |yellow| and the third one |red|. Further data sets should be,
-say, |black|. The attribute that we intend to style is the |set|
-attribute. For the moment, we assume that the data sets will be named
-|1|, |2|, |3|, and so on (instead of, say, |experiment 1| or |sin| or
-something more readable -- we will get rid of this restriction in a
-minute).
+Let us put all of this together in a real-life example. Suppose we wish to
+create a style sheet that makes the first data set |green|, the second |yellow|
+and the third one |red|. Further data sets should be, say, |black|. The
+attribute that we intend to style is the |set| attribute. For the moment, we
+assume that the data sets will be named |1|, |2|, |3|, and so on (instead of,
+say, |experiment 1| or |sin| or something more readable -- we will get rid of
+this restriction in a minute).
We would now write:
-
+%
\begin{codeexample}[]
\pgfkeys{
/pgf/data visualization/style sheets/traffic light/.cd,
@@ -315,16 +304,15 @@ data point [x=0.5, y=1.5, set=3]
data point [x=2.25, y=1.75, set=3];
\end{codeexample}
-In the above example, we have to name the visualizers |1|, |2|, |3|
-and so one since the value of the |set| attribute is used both assign
-data points to visualizers and also pick a style sheet. However, it
-would be much nicer if we could name any way we want. To achieve this,
-we use the special rule for style sheets that says that if there is a
-subkey of an attribute whose name is the same name as the value, then
-the value of this key is used instead. This slightly intimidating
-definition is much easier to understand when we have a look at an
-example:
-
+In the above example, we have to name the visualizers |1|, |2|, |3| and so one
+since the value of the |set| attribute is used both assign data points to
+visualizers and also pick a style sheet. However, it would be much nicer if we
+could name any way we want. To achieve this, we use the special rule for style
+sheets that says that if there is a subkey of an attribute whose name is the
+same name as the value, then the value of this key is used instead. This
+slightly intimidating definition is much easier to understand when we have a
+look at an example:
+%
\pgfkeys{
/pgf/data visualization/style sheets/traffic light/.cd,
% All these styles have the above prefix.
@@ -333,11 +321,10 @@ example:
3/.style={red!80!black},
default style/.style={black}
}
-
\begin{codeexample}[]
-% Definition of traffic light keys as above
+% Definition of traffic light keys as above
\begin{tikzpicture}
- \datavisualization data group {lines} = {
+ \datavisualization data group {lines} = {
data point [x=0, y=0, set=normal]
data point [x=2, y=2, set=normal]
data point [x=0, y=1, set=heated]
@@ -358,19 +345,17 @@ example:
\end{tikzpicture}
\end{codeexample}
-Now, it is a bit bothersome that we have to set all these
-|/data point/set/...| keys by hand. It turns out that this is not
-necessary: Each time a visualizer is created, a subkey of
-|/data point/set| with the name of the visualizer is created
-automatically and a number is stored that is increased for each new
-visualizer in a data visualization. This means that the three lines
-starting with |/data point| are inserted automatically for you, so
-they can be left out. However, you would need them for instance when
-you would like several different data sets to use the same styling:
-
-
+Now, it is a bit bothersome that we have to set all these |/data point/set/...|
+keys by hand. It turns out that this is not necessary: Each time a visualizer
+is created, a subkey of |/data point/set| with the name of the visualizer is
+created automatically and a number is stored that is increased for each new
+visualizer in a data visualization. This means that the three lines starting
+with |/data point| are inserted automatically for you, so they can be left out.
+However, you would need them for instance when you would like several different
+data sets to use the same styling:
+%
\begin{codeexample}[]
-% Definition of traffic light keys as above
+% Definition of traffic light keys as above
\tikz \datavisualization [
school book axes,
visualize as line=normal,
@@ -381,14 +366,13 @@ you would like several different data sets to use the same styling:
data group {lines};
\end{codeexample}
-We can a command that slightly simplifies the definition of style
-sheets:
+We can a command that slightly simplifies the definition of style sheets:
\begin{command}{\pgfdvdeclarestylesheet\marg{name}\marg{keys}}
- This command executes the \meta{keys} with the path prefix
- |/pgf/data visualization/style sheets/|\penalty0\meta{name}. The above
- definition of the traffic light style sheet could be rewritten as
- follows:
+ This command executes the \meta{keys} with the path prefix
+ |/pgf/data visualization/style sheets/|\penalty0\meta{name}. The above
+ definition of the traffic light style sheet could be rewritten as follows:
+ %
\begin{codeexample}[code only]
\pgfdvdeclarestylesheet{traffic light}{
1/.style={green!50!black},
@@ -397,12 +381,13 @@ sheets:
default style/.style={black}
}
\end{codeexample}
+ %
\end{command}
-As a final example, let us create a style sheet that changes the
-dashing pattern according to the value of the attribute. We do not
-need to define an large number of styles in this case, but can use the
-|default style| key to ``calculate'' the correct dashing.
+As a final example, let us create a style sheet that changes the dashing
+pattern according to the value of the attribute. We do not need to define an
+large number of styles in this case, but can use the |default style| key to
+``calculate'' the correct dashing.
\begin{codeexample}[]
\pgfdvdeclarestylesheet{my dashings}{
@@ -417,21 +402,22 @@ need to define an large number of styles in this case, but can use the
data group {lines};
\end{codeexample}
+
\subsubsection{Creating a New Color Style Sheet}
-Creating a style sheet that varies colors according to an attribute
-works the same way as creating a normal style sheet: Subkeys lies |1|,
-|2|, and so on use the |style| attribute to setup a color. However,
-instead of using the |color| attribute to set the color, you should
-use the |visualizer color| key to set the color:
+Creating a style sheet that varies colors according to an attribute works the
+same way as creating a normal style sheet: Subkeys lies |1|, |2|, and so on use
+the |style| attribute to setup a color. However, instead of using the |color|
+attribute to set the color, you should use the |visualizer color| key to set
+the color:
\begin{key}{/tikz/visualizer color=\meta{color}}
- This key is used to set the color |visualizer color| to
- \meta{color}. This color is used by visualizers to color the data
- they visualize, rather than the current ``standard color.'' The
- reason for not using the normal current color is simply that it
- makes many internals of the data visualization engine a bit
- simpler.
+ This key is used to set the color |visualizer color| to \meta{color}. This
+ color is used by visualizers to color the data they visualize, rather than
+ the current ``standard color''. The reason for not using the normal current
+ color is simply that it makes many internals of the data visualization
+ engine a bit simpler.
+ %
\begin{codeexample}[]
\pgfdvdeclarestylesheet{my colors}
{
@@ -448,26 +434,24 @@ use the |visualizer color| key to set the color:
style sheet=my colors]
data group {lines};
\end{codeexample}
+ %
\end{key}
-There is an additional command that makes it easy to define a style
-sheet based on a \emph{color series}. Color series are a concept from
-the |xcolor| package: The idea is that we start with a certain color
-for the first data set and then add a certain ``color offset'' for
-each next data point. Please consult the documentation of the |xcolor|
-package for details.
-
-\begin{command}{\tikzdvdeclarestylesheetcolorseries\marg{name}\marg{color
- model}\marg{initial color}\marg{step}}
- This command creates a new style sheet using
- |\pgfdvdeclarestylesheet|. This style sheet will only have a default
- style setup that maps numbers to the color in the color series
- starting with \meta{initial color} and having a stepping of
- \meta{step}. Note that when the value of the attribute is |1|, which
- it is the first data set, the \emph{second} color in the color
- series is used (since counting starts at |0| for color
- series). Thus, in general, you need to start the \meta{initial
- color} ``one early.''
+There is an additional command that makes it easy to define a style sheet based
+on a \emph{color series}. Color series are a concept from the |xcolor| package:
+The idea is that we start with a certain color for the first data set and then
+add a certain ``color offset'' for each next data point. Please consult the
+documentation of the |xcolor| package for details.
+
+\begin{command}{\tikzdvdeclarestylesheetcolorseries\marg{name}\marg{color model}\marg{initial color}\marg{step}}
+ This command creates a new style sheet using |\pgfdvdeclarestylesheet|.
+ This style sheet will only have a default style setup that maps numbers to
+ the color in the color series starting with \meta{initial color} and having
+ a stepping of \meta{step}. Note that when the value of the attribute is
+ |1|, which it is the first data set, the \emph{second} color in the color
+ series is used (since counting starts at |0| for color series). Thus, in
+ general, you need to start the \meta{initial color} ``one early''.
+ %
\begin{codeexample}[]
\tikzdvdeclarestylesheetcolorseries{greens}{hsb}{0.3,1.3,0.8}{0,-.4,-.1}
\tikz \datavisualization [
@@ -478,18 +462,16 @@ package for details.
style sheet=greens]
data group {lines};
\end{codeexample}
-
+ %
\end{command}
-
-
\subsection{Reference: Style Sheets for Lines}
-The following style sheets can be applied to visualizations that use
-the |visualize as line| and related keys. For the examples, the
-following style and data set are used:
-
+The following style sheets can be applied to visualizations that use the
+|visualize as line| and related keys. For the examples, the following style and
+data set are used:
+%
\begin{codeexample}[code only]
\tikzdatavisualizationset {
example visualization/.style={
@@ -508,7 +490,7 @@ following style and data set are used:
7={label in legend={text=$\frac{1}{12}\sin 17x$}},
8={label in legend={text=$\frac{1}{13}\sin 18x$}}
}
-}
+}
\end{codeexample}
\tikzdatavisualizationset {
example visualization/.style={
@@ -527,7 +509,7 @@ following style and data set are used:
7={label in legend={text=$\frac{1}{12}\sin 17x$}},
8={label in legend={text=$\frac{1}{13}\sin 18x$}}
}
-}
+}
\begin{codeexample}[code only]
\tikz \datavisualization data group {sin functions} = {
@@ -536,7 +518,7 @@ following style and data set are used:
var x : interval [0:50];
func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
}
-};
+};
\end{codeexample}
\tikz \datavisualization data group {sin functions} = {
data [format=function] {
@@ -544,12 +526,13 @@ following style and data set are used:
var x : interval [0:50];
func y = sin(\value x * (\value{set}+10))/(\value{set}+5);
}
-};
+};
\begin{stylesheet}{vary thickness}
- This style varies the thickness of lines. It should be used only
- when there are only two or three lines, and even then it is not
- particularly pleasing visually.
+ This style varies the thickness of lines. It should be used only when there
+ are only two or three lines, and even then it is not particularly pleasing
+ visually.
+ %
\begin{codeexample}[width=10cm]
\tikz \datavisualization [
visualize as smooth line/.list=
@@ -558,15 +541,16 @@ following style and data set are used:
style sheet=vary thickness]
data group {sin functions};
\end{codeexample}
+ %
\end{stylesheet}
-
\begin{stylesheet}{vary dashing}
- This style varies the dashing of lines. Although it is not
- particularly pleasing visually and although visualizations using
- this style sheet tend to look ``excited'' (but not necessarily
- ``exciting''), this style sheet is often the best choice when the
- visualization is to be printed in black and white.
+ This style varies the dashing of lines. Although it is not particularly
+ pleasing visually and although visualizations using this style sheet tend
+ to look ``excited'' (but not necessarily ``exciting''), this style sheet is
+ often the best choice when the visualization is to be printed in black and
+ white.
+ %
\begin{codeexample}[width=10cm]
\tikz \datavisualization [
visualize as smooth line/.list=
@@ -575,21 +559,22 @@ data group {sin functions};
style sheet=vary dashing]
data group {sin functions};
\end{codeexample}
- As can be seen, there are only seven distinct dashing patterns. The
- eighth and further lines will use a solid line once more. You will
- then have to specify the dashing ``by hand'' using the |style|
- option together with the visualizer.
+ %
+ As can be seen, there are only seven distinct dashing patterns. The eighth
+ and further lines will use a solid line once more. You will then have to
+ specify the dashing ``by hand'' using the |style| option together with the
+ visualizer.
\end{stylesheet}
\begin{stylesheet}{vary dashing and thickness}
- This style alternates between varying the thickness and the dashing
- of lines. The
- difference to just using both the |vary thickness| and
- |vary dashing| is that too thick lines are avoided. Instead, this
- style creates clearly distinguishable line styles for many lines (up
- to 14) with a minimum of visual clutter. This style is the most
- useful for visualizations when many different lines (ten or more)
- should be printed in black and white.
+ This style alternates between varying the thickness and the dashing of
+ lines. The difference to just using both the |vary thickness| and
+ |vary dashing| is that too thick lines are avoided. Instead, this style
+ creates clearly distinguishable line styles for many lines (up to 14) with
+ a minimum of visual clutter. This style is the most useful for
+ visualizations when many different lines (ten or more) should be printed in
+ black and white.
+ %
\begin{codeexample}[width=10cm]
\tikz \datavisualization [
visualize as smooth line/.list=
@@ -599,8 +584,10 @@ data group {sin functions};
and dashing]
data group {sin functions};
\end{codeexample}
- For comparison, here is the must-less-than-satisfactory result of
- combining the two independent style sheets:
+ %
+ For comparison, here is the must-less-than-satisfactory result of combining
+ the two independent style sheets:
+ %
\begin{codeexample}[width=10cm]
\tikz \datavisualization [
visualize as smooth line/.list=
@@ -610,22 +597,25 @@ data group {sin functions};
style sheet=vary dashing]
data group {sin functions};
\end{codeexample}
+ %
\end{stylesheet}
\subsection{Reference: Style Sheets for Scatter Plots}
-The following style sheets can be used both for scatter plots and also
-with lines. In the latter case, the marks are added to the lines.
+The following style sheets can be used both for scatter plots and also with
+lines. In the latter case, the marks are added to the lines.
\begin{stylesheet}{cross marks}
- This style uses different crosses to distinguish between the data
- points of different data sets. The crosses were chosen in such a way
- that when two different cross marks lie at the same coordinate,
- their overall shape allows one to still uniquely determine which
- marks are on top of each other.
-
- This style supports only up to six different data sets.
+ This style uses different crosses to distinguish between the data points of
+ different data sets. The crosses were chosen in such a way that when two
+ different cross marks lie at the same coordinate, their overall shape
+ allows one to still uniquely determine which marks are on top of each
+ other.
+
+ This style supports only up to six different data sets and requires the
+ |plotmarks| library.
+ %
\begin{codeexample}[width=10cm]
\tikz \datavisualization [
visualize as scatter/.list=
@@ -634,6 +624,7 @@ with lines. In the latter case, the marks are added to the lines.
style sheet=cross marks]
data group {sin functions};
\end{codeexample}
+ %
\begin{codeexample}[width=10cm]
\tikz \datavisualization [
visualize as smooth line/.list=
@@ -642,35 +633,36 @@ data group {sin functions};
style sheet=cross marks]
data group {sin functions};
\end{codeexample}
+ %
\end{stylesheet}
\subsection{Reference: Color Style Sheets}
Color style sheets are very useful for creating visually pleasing data
-visualizations that contain multiple data sets. However, there are two
-things to keep in mind:
-
+visualizations that contain multiple data sets. However, there are two things
+to keep in mind:
+%
\begin{itemize}
-\item At some point, every data visualization is printed or photo
- copied in black and white by someone. In this case, data sets can
- often no longer be distinguished.
-\item A few people are color blind. They will not be able to
- distinguish between red and green lines (and some people are not
- even able to distinguish colors at all).
+ \item At some point, every data visualization is printed or photo copied in
+ black and white by someone. In this case, data sets can often no longer
+ be distinguished.
+ \item A few people are color blind. They will not be able to distinguish
+ between red and green lines (and some people are not even able to
+ distinguish colors at all).
\end{itemize}
-For these reasons, if there is any chance that the data visualization
-will be printed in black and white at some point, consider combining
-color style sheets with style sheets like |vary dashing| to make data
-sets distinguishable in all situations.
-
+For these reasons, if there is any chance that the data visualization will be
+printed in black and white at some point, consider combining color style sheets
+with style sheets like |vary dashing| to make data sets distinguishable in all
+situations.
\begin{stylesheet}{strong colors}
- This style sheets uses pure primary colors that can very easily be
- distinguished. Although not as visually pleasing as the |vary hue|
- style sheet, the visualizations are easier to read when this style
- sheet is used. Up to six different data sets are supported.
+ This style sheets uses pure primary colors that can very easily be
+ distinguished. Although not as visually pleasing as the |vary hue| style
+ sheet, the visualizations are easier to read when this style sheet is used.
+ Up to six different data sets are supported.
+ %
\begin{codeexample}[width=10cm]
\tikz \datavisualization [
visualize as smooth line/.list=
@@ -679,6 +671,7 @@ sets distinguishable in all situations.
style sheet=strong colors]
data group {sin functions};
\end{codeexample}
+ %
\begin{codeexample}[width=10cm]
\tikz \datavisualization [
visualize as smooth line/.list=
@@ -688,16 +681,17 @@ data group {sin functions};
style sheet=vary dashing]
data group {sin functions};
\end{codeexample}
+ %
\end{stylesheet}
-Unlike |strong colors|, the following style sheets support, in
-principle, an unlimited number of data set. In practice, as always,
-more than four or five data sets lead to nearly indistinguishable data
-sets.
+Unlike |strong colors|, the following style sheets support, in principle, an
+unlimited number of data set. In practice, as always, more than four or five
+data sets lead to nearly indistinguishable data sets.
\begin{stylesheet}{vary hue}
- This style uses a different hue for each data set.
+ This style uses a different hue for each data set.
+ %
\begin{codeexample}[width=10cm]
\tikz \datavisualization [
visualize as smooth line/.list=
@@ -706,11 +700,12 @@ sets.
style sheet=vary hue]
data group {sin functions};
\end{codeexample}
+ %
\end{stylesheet}
\begin{stylesheet}{shades of blue}
- As the name suggests, different shades of blue are used for different
- data sets.
+ As the name suggests, different shades of blue are used for different data
+ sets.
\begin{codeexample}[width=10cm]
\tikz \datavisualization [
visualize as smooth line/.list=
@@ -719,9 +714,9 @@ data group {sin functions};
style sheet=shades of blue]
data group {sin functions};
\end{codeexample}
+ %
\end{stylesheet}
-
\begin{stylesheet}{shades of red}
\begin{codeexample}[width=10cm]
\tikz \datavisualization [
@@ -733,10 +728,10 @@ data group {sin functions};
\end{codeexample}
\end{stylesheet}
-
\begin{stylesheet}{gray scale}
- For once, this style sheet can also be used when the visualization
- is printed in black and white.
+ For once, this style sheet can also be used when the visualization is
+ printed in black and white.
+ %
\begin{codeexample}[width=10cm]
\tikz \datavisualization [
visualize as smooth line/.list=
@@ -745,88 +740,88 @@ data group {sin functions};
style sheet=gray scale]
data group {sin functions};
\end{codeexample}
+ %
\end{stylesheet}
\subsection{Usage: Labeling Data Sets Inside the Visualization}
-In a visualization that contains multiple data sets, it is often
-necessary to clearly point out which line or mark type corresponds to
-which data set. This can be done in the main text via a sentence like
-``the normal data (black) lies clearly below the critical values
-(red),'' but it often a good idea to indicate data sets ideally
-directly inside the data visualization or directly next to it in a
-so-called legend.
-
-The data visualization engine has direct support both for indicating
-data sets directly inside the visualization and also for indicating
-them in a legend.
-
-The ``best'' way of indicating where a data set lies or which color is
-used for it is to put a label directly inside the data
-visualization. The reason this is the ``best'' way is that people do
-not have to match the legend entries against the data, let alone
-having to look up the meaning of line styles somewhere in the
-text. However, adding a label directly inside the visualization is
-also the most tricky way of indicating data sets since it is hard to
-compute good positions for the labels automatically and since there
-needs to be some empty space where the label can be put.
+In a visualization that contains multiple data sets, it is often necessary to
+clearly point out which line or mark type corresponds to which data set. This
+can be done in the main text via a sentence like ``the normal data (black) lies
+clearly below the critical values (red)'', but it often a good idea to indicate
+data sets ideally directly inside the data visualization or directly next to it
+in a so-called legend.
+
+The data visualization engine has direct support both for indicating data sets
+directly inside the visualization and also for indicating them in a legend.
+
+The ``best'' way of indicating where a data set lies or which color is used for
+it is to put a label directly inside the data visualization. The reason this is
+the ``best'' way is that people do not have to match the legend entries against
+the data, let alone having to look up the meaning of line styles somewhere in
+the text. However, adding a label directly inside the visualization is also the
+most tricky way of indicating data sets since it is hard to compute good
+positions for the labels automatically and since there needs to be some empty
+space where the label can be put.
+
\subsubsection{Placing a Label Next to a Data Set}
-The following key is used to create a label inside the data
-visualization for a data set:
+The following key is used to create a label inside the data visualization for a
+data set:
\begin{key}{/tikz/data visualization/visualizer options/label in data=\meta{options}}
- This key is passed to a visualizer that has previously been created
- using keys starting |visualize as ...|. It will create a label
- inside the data visualization ``next'' to the visualizer (the
- details are explained in a moment). You can use this key multiple
- times with a visualizer to create multiple labels at different
- points with different texts.
-
- The \meta{options} determine which text is shown and where it is
- shown. They are executed with the following path prefix:
+ This key is passed to a visualizer that has previously been created using
+ keys starting |visualize as ...|. It will create a label inside the data
+ visualization ``next'' to the visualizer (the details are explained in a
+ moment). You can use this key multiple times with a visualizer to create
+ multiple labels at different points with different texts.
+
+ The \meta{options} determine which text is shown and where it is shown.
+ They are executed with the following path prefix:
+ %
\begin{codeexample}[code only]
/tikz/data visualization/visualizer label options
\end{codeexample}
- In order to configure which text is shown and where, use the
- following keys inside the \meta{options}:
-
- \begin{key}{/tikz/data visualization/visualizer label options/text=\meta{text}}
- This is the text that will be displayed next to the data. It will
- be to the ``left'' of the data, see the description below.
- \end{key}
- \begin{key}{/tikz/data visualization/visualizer label options/text'=\meta{text}}
- Like |text|, only the text will be to the ``right'' of the data.
- \end{key}
-
- The following keys are used to configure where the label will be
- shown. They use different strategies to specify one data point where
- the label will be anchored. The coordinate of this data point will
- be stored in |(label| |visualizer| |coordinate)|. Independently of
- the strategy, once the data point has been chosen, the coordinate of
- the next data point is stored in |(label| |visualizer|
- |coordinate')|. Then, a (conceptual) line is created from the first
- coordinate to the second and a node is placed at the beginning of
- this line to its ``left'' or, for the |text'| option, on its
- ``right.'' More precisely, an automatic anchor is computed for a
- node placed implicitly on this line using the |auto| option or, for
- the |text'| option, using |auto,swap|.
-
- The node placed at the position computed in this way will have the
- \meta{text} set by the |text| or |text'| option and its styling is
- determined by the current |node style|.
-
- Let us now have a look at the different ways of determining the data
- point at which the label in anchored:
- \begin{key}{/tikz/data visualization/visualizer label
- options/when=\meta{attribute}| is|\meta{number}}
- This key causes the value of the \meta{attribute} to be monitored
- in the stream of data points. The chosen is data point is the
- first data point where the \meta{attribute} is at least
- \meta{number} (if this never happens, the last data point is used).
+ In order to configure which text is shown and where, use the following keys
+ inside the \meta{options}:
+
+ \begin{key}{/tikz/data visualization/visualizer label options/text=\meta{text}}
+ This is the text that will be displayed next to the data. It will be to
+ the ``left'' of the data, see the description below.
+ \end{key}
+ %
+ \begin{key}{/tikz/data visualization/visualizer label options/text'=\meta{text}}
+ Like |text|, only the text will be to the ``right'' of the data.
+ \end{key}
+
+ The following keys are used to configure where the label will be shown.
+ They use different strategies to specify one data point where the label
+ will be anchored. The coordinate of this data point will be stored in
+ |(label| |visualizer| |coordinate)|. Independently of the strategy, once
+ the data point has been chosen, the coordinate of the next data point is
+ stored in |(label| |visualizer| |coordinate')|. Then, a (conceptual) line
+ is created from the first coordinate to the second and a node is placed at
+ the beginning of this line to its ``left'' or, for the |text'| option, on
+ its ``right''. More precisely, an automatic anchor is computed for a node
+ placed implicitly on this line using the |auto| option or, for the |text'|
+ option, using |auto,swap|.
+
+ The node placed at the position computed in this way will have the
+ \meta{text} set by the |text| or |text'| option and its styling is
+ determined by the current |node style|.
+
+ Let us now have a look at the different ways of determining the data point
+ at which the label in anchored:
+ %
+ \begin{key}{/tikz/data visualization/visualizer label options/when=\meta{attribute}| is|\meta{number}}
+ This key causes the value of the \meta{attribute} to be monitored in
+ the stream of data points. The chosen is data point is the first data
+ point where the \meta{attribute} is at least \meta{number} (if this
+ never happens, the last data point is used).
+ %
\begin{codeexample}[width=6.3cm]
\tikz \datavisualization [
school book axes,
@@ -841,11 +836,12 @@ visualization for a data set:
style sheet=vary hue]
data group {function classes};
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/data visualization/visualizer label
- options/index=\meta{number}}
- This key chooses the \meta{number}th data point belonging to the
- visualizer's data set.
+ \end{key}
+ %
+ \begin{key}{/tikz/data visualization/visualizer label options/index=\meta{number}}
+ This key chooses the \meta{number}th data point belonging to the
+ visualizer's data set.
+ %
\begin{codeexample}[width=6.3cm]
\tikz \datavisualization [
school book axes,
@@ -858,11 +854,13 @@ data group {function classes};
style sheet=vary hue]
data group {function classes};
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/data visualization/visualizer label options/pos=\meta{fraction}}
- This key chooses the first data point belonging to the data set
- whose index is at least \meta{fraction} times the number of all
- data points in the data set.
+ \end{key}
+ %
+ \begin{key}{/tikz/data visualization/visualizer label options/pos=\meta{fraction}}
+ This key chooses the first data point belonging to the data set whose
+ index is at least \meta{fraction} times the number of all data points
+ in the data set.
+ %
\begin{codeexample}[width=6.3cm]
\tikz \datavisualization [
school book axes,
@@ -875,18 +873,20 @@ data group {function classes};
style sheet=vary hue]
data group {function classes};
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/data visualization/visualizer label options/auto}
- This key is executed automatically by default. It works like the
- |pos| option, where the \meta{fraction} is set to $(\meta{data set's
- index}-1/2)/\meta{number of data sets}$. For instance, when
- there are $10$ data sets, the fraction for the first one will be
- $5\%$, the fraction for the second will be $15\%$, for the third
- it will be $25\%$, ending with $95\%$ for the last one.
-
- The net effect of all this is that when there are several lines,
- labels will be placed at different positions along the lines with
- hopefully only little overlap.
+ \end{key}
+ %
+ \begin{key}{/tikz/data visualization/visualizer label options/auto}
+ This key is executed automatically by default. It works like the |pos|
+ option, where the \meta{fraction} is set to $(\meta{data set's
+ index}-1/2)/\meta{number of data sets}$. For instance, when there are
+ $10$ data sets, the fraction for the first one will be $5\%$, the
+ fraction for the second will be $15\%$, for the third it will be
+ $25\%$, ending with $95\%$ for the last one.
+
+ The net effect of all this is that when there are several lines, labels
+ will be placed at different positions along the lines with hopefully
+ only little overlap.
+ %
\begin{codeexample}[width=6.3cm]
\tikz \datavisualization [
scientific axes=clean,
@@ -907,30 +907,29 @@ data [set=cubed, format=function] {
func y = \value x * \value x * \value x;
};
\end{codeexample}
- As can be seen in the example, the result is not always
- satisfactory. In this case, the |pin in data| option might be
- preferable, see below.
- \end{key}
-
- The following keys allow you to style labels.
-
- \begin{key}{/tikz/data visualization/visualizer label
- options/node style=\meta{options}}
- Just passes the options to |/tikz/data visualization/node style|.
- \end{key}
- \begin{key}{/tikz/data visualization/visualizer label
- options/text colored}
- Causes the |node style| to set the text color to
- |visualizer color|. The effect of this is that the label's text
- will have the same color as the data set to which it is attached.
- \end{key}
-
- \begin{stylekey}{/tikz/data visualization/every data set label}
- This style is executed with every label that represents a
- data set. Inside this style, use |node style| to change the
- appearance of nodes. This style has a default definition, usually
- you should just append things to this style.
+ %
+ As can be seen in the example, the result is not always satisfactory.
+ In this case, the |pin in data| option might be preferable, see below.
+ \end{key}
+ The following keys allow you to style labels.
+
+ \begin{key}{/tikz/data visualization/visualizer label options/node style=\meta{options}}
+ Just passes the options to |/tikz/data visualization/node style|.
+ \end{key}
+ %
+ \begin{key}{/tikz/data visualization/visualizer label options/text colored}
+ Causes the |node style| to set the text color to |visualizer color|.
+ The effect of this is that the label's text will have the same color as
+ the data set to which it is attached.
+ \end{key}
+
+ \begin{stylekey}{/tikz/data visualization/every data set label}
+ This style is executed with every label that represents a data set.
+ Inside this style, use |node style| to change the appearance of nodes.
+ This style has a default definition, usually you should just append
+ things to this style.
+ %
\begin{codeexample}[width=6.3cm]
\tikz \datavisualization [
school book axes,
@@ -946,23 +945,25 @@ data [set=cubed, format=function] {
style sheet=vary hue]
data group {function classes};
\end{codeexample}
- \end{stylekey}
-
- \begin{stylekey}{/tikz/data visualization/every label in data}
- Like |every data set label|, this key is also executed with
- labels. However, this key is executed after the style sheets have
- been executed, giving you a chance to overrule their styling.
- \end{stylekey}
+ \end{stylekey}
+
+ \begin{stylekey}{/tikz/data visualization/every label in data}
+ Like |every data set label|, this key is also executed with labels.
+ However, this key is executed after the style sheets have been
+ executed, giving you a chance to overrule their styling.
+ \end{stylekey}
\end{key}
-\subsubsection{Connecting a Label to a Data Set via a Pin}
+
+\subsubsection{Connecting a Label to a Data Set via a Pin}
\begin{key}{/tikz/data visualization/visualizer options/pin in data=\meta{options}}
- This key is a variant of the |label in data| key and takes the same
- options, plus two additional ones. The difference to |label in data|
- is that the label node is shown a bit removed from the data set, but
- connected to it via a small line (this is like the difference
- between the |label| and |pin| options).
+ This key is a variant of the |label in data| key and takes the same
+ options, plus two additional ones. The difference to |label in data| is
+ that the label node is shown a bit removed from the data set, but connected
+ to it via a small line (this is like the difference between the |label| and
+ |pin| options).
+ %
\begin{codeexample}[width=6.3cm]
\tikz \datavisualization [
scientific axes=clean,
@@ -983,28 +984,31 @@ data [set=cubed, format=function] {
func y = \value x * \value x * \value x;
};
\end{codeexample}
- The following keys can be used additionally:
- \begin{key}{/tikz/data visualization/visualizer label options/pin angle=\meta{angle}}
- The position of the label of a |pin in data| is mainly computed in
- the same way as for a |label in data|. However, once the position
- has been computed, the label is shifted as follows:
- \begin{itemize}
- \item When an \meta{angle} is specified using the present key, the
- shift is by the current value of |pin length| in the direction
- of \meta{angle}.
- \item When \meta{angle} is empty (which is the default), then the
- shift is also by the current value of |pin length|, but now in
- the direction that is orthogonal and to the left of the line
- between the coordinate of the data point and the coordinate of
- the next data point. When |text'| is used, the direction is to
- the right instead of the left.
- \end{itemize}
- \end{key}
-
- \begin{key}{/tikz/data visualization/visualizer label options/pin length=\meta{dimension}}
- See the description of |pin angle|.
- \end{key}
+ %
+ The following keys can be used additionally:
+ %
+ \begin{key}{/tikz/data visualization/visualizer label options/pin angle=\meta{angle}}
+ The position of the label of a |pin in data| is mainly computed in the
+ same way as for a |label in data|. However, once the position has been
+ computed, the label is shifted as follows:
+ %
+ \begin{itemize}
+ \item When an \meta{angle} is specified using the present key, the
+ shift is by the current value of |pin length| in the direction
+ of \meta{angle}.
+ \item When \meta{angle} is empty (which is the default), then the
+ shift is also by the current value of |pin length|, but now in
+ the direction that is orthogonal and to the left of the line
+ between the coordinate of the data point and the coordinate of
+ the next data point. When |text'| is used, the direction is to
+ the right instead of the left.
+ \end{itemize}
+ \end{key}
+ \begin{key}{/tikz/data visualization/visualizer label options/pin length=\meta{dimension}}
+ See the description of |pin angle|.
+ \end{key}
+ %
\begin{codeexample}[width=6.3cm]
\tikz \datavisualization [
school book axes,
@@ -1020,73 +1024,72 @@ data [set=cubed, format=function] {
style sheet=vary hue]
data group {function classes};
\end{codeexample}
-\end{key}
-
+ \end{key}
\subsection{Usage: Labeling Data Sets Inside a Legend}
-The ``classical'' way of indicating the style used for the different
-data sets inside a visualization is a \emph{legend}. It is a
-description next to or even inside the visualization that contains one
-line for each data set and displays an iconographic version of the
-data set next to some text labeling the data set. Note, however, that
-even though legend are quite common, also
-consider using a |label in data| or a |pin in data| instead.
-
-Creating a high-quality legend is by no means simple. A legend should
-not distract the reader, so aggressive borders should definitively be
-avoided. A legend should make it easy to match the actual
-styling of a data set (like, say, using a red, dashed line) to
-the ``iconographic'' representation of this styling. An example of
-what can go wrong here is using short lines to represent lines dashed
-in different way where the lines are so short that the differences in
-the dashing cannot be discerned. Another example is showing straight
-lines with plot marks on them where the plot marks are obscured by the
-horizontal line itself, while the plot marks are clearly visible in
-the actual visualization since no horizontal lines occur.
-
-The data visualization engine comes with a large set of options for
-creating and placing high-quality legends next or inside data
-visualizations.
+The ``classical'' way of indicating the style used for the different data sets
+inside a visualization is a \emph{legend}. It is a description next to or even
+inside the visualization that contains one line for each data set and displays
+an iconographic version of the data set next to some text labeling the data
+set. Note, however, that even though legend are quite common, also consider
+using a |label in data| or a |pin in data| instead.
+
+Creating a high-quality legend is by no means simple. A legend should not
+distract the reader, so aggressive borders should definitively be avoided. A
+legend should make it easy to match the actual styling of a data set (like,
+say, using a red, dashed line) to the ``iconographic'' representation of this
+styling. An example of what can go wrong here is using short lines to represent
+lines dashed in different way where the lines are so short that the differences
+in the dashing cannot be discerned. Another example is showing straight lines
+with plot marks on them where the plot marks are obscured by the horizontal
+line itself, while the plot marks are clearly visible in the actual
+visualization since no horizontal lines occur.
+
+The data visualization engine comes with a large set of options for creating
+and placing high-quality legends next or inside data visualizations.
+
\subsubsection{Creating Legends and Legend Entries}
-A data visualization can be accompanied by one or more legends. In
-order to create a legend, the following key can be used (although, in
-practice, you will usually use the |legend| key instead, see below):
-
-\begin{key}{/tikz/data visualization/new legend=\meta{legend name}
- (default main legend)}
- This key is used to create a new legend named \meta{legend name}. The
- legend is empty by default and further options are needed to add
- entries to it. When the key is called a second time for the same
- \meta{legend name} nothing happens.
-
- When a legend is created, a new key is created that can
- subsequently be used to configure the legend:
- \begin{key}{/tikz/data visualization/\meta{legend name}=\meta{options}}
- When this key is used, the \meta{options} are executed with the
- path prefix
+A data visualization can be accompanied by one or more legends. In order to
+create a legend, the following key can be used (although, in practice, you will
+usually use the |legend| key instead, see below):
+
+\begin{key}{/tikz/data visualization/new legend=\meta{legend name} (default main legend)}
+ This key is used to create a new legend named \meta{legend name}. The
+ legend is empty by default and further options are needed to add entries to
+ it. When the key is called a second time for the same \meta{legend name}
+ nothing happens.
+
+ When a legend is created, a new key is created that can subsequently be
+ used to configure the legend:
+ %
+ \begin{key}{/tikz/data visualization/\meta{legend name}=\meta{options}}
+ When this key is used, the \meta{options} are executed with the path
+ prefix
+ %
\begin{codeexample}[code only]
/tikz/data visualization/legend options
\end{codeexample}
- The different keys with this path prefix allow you to change the
- position where the legend is shown and how it is organised (for
- instance, whether legend entries are shown in a row or in a column
- or in a square).
-
- The different possible keys will be explained in the course of
- this section.
- \end{key}
-
- In the end, the legend is just a \tikzname\ node, a |matrix| node,
- to be precise. The following key is used to style this node:
-
-
- \begin{key}{/tikz/data visualization/legend options/matrix node style=\meta{options}}
- Adds the \meta{options} to the list of options that will be
- executed when the legend's node is created.
+ %
+ The different keys with this path prefix allow you to change the
+ position where the legend is shown and how it is organised (for
+ instance, whether legend entries are shown in a row or in a column or
+ in a square).
+
+ The different possible keys will be explained in the course of this
+ section.
+ \end{key}
+
+ In the end, the legend is just a \tikzname\ node, a |matrix| node, to be
+ precise. The following key is used to style this node:
+
+ \begin{key}{/tikz/data visualization/legend options/matrix node style=\meta{options}}
+ Adds the \meta{options} to the list of options that will be executed
+ when the legend's node is created.
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
scientific axes,
@@ -1099,19 +1102,19 @@ practice, you will usually use the |legend| key instead, see below):
exp= {label in legend={text=$e^x$}},
style sheet=vary dashing]
data group {function classes};
-\end{codeexample}
- \end{key}
-
-
- The following style allows you to configure the default appearance
- of every newly created legend:
- \begin{stylekey}{/tikz/data visualization/legend options/every new legend}
- This key defaults to |east outside, label style=text right|. This means
- that by default a legend is placed to the right of the data
- visualization and that in the individual legend entries the text
- is to the right of the data set visualization.
- \end{stylekey}
+\end{codeexample}
+ \end{key}
+ The following style allows you to configure the default appearance of every
+ newly created legend:
+ %
+ \begin{stylekey}{/tikz/data visualization/legend options/every new legend}
+ This key defaults to |east outside, label style=text right|. This means
+ that by default a legend is placed to the right of the data
+ visualization and that in the individual legend entries the text is to
+ the right of the data set visualization.
+ \end{stylekey}
+ %
\begin{codeexample}[width=6cm]
\tikz \datavisualization [
scientific axes, x axis={label=$x$},
@@ -1126,14 +1129,16 @@ data group {function classes};
exp= {label in legend={text=$e^x$, legend=lower legend}},
style sheet=vary dashing]
data group {function classes};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/legend=\meta{options}}
- This is a shorthand for |new legend=main legend, main legend=|\meta{options}.
- In other words, this key creates a new |main legend| and immediately
- passes the configuration \meta{options} to this legend.
-
+ This is a shorthand for
+ |new legend=main legend, main legend=|\meta{options}. In other words, this
+ key creates a new |main legend| and immediately passes the configuration
+ \meta{options} to this legend.
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
scientific axes, x axis={label=$x$},
@@ -1146,91 +1151,88 @@ data group {function classes};
style sheet=vary dashing]
data group {function classes};
\end{codeexample}
+ %
\end{key}
-
-As pointed out above, a legend is empty by default. In particular,
-the different data sets are not automatically inserted into the
-legend. Instead, the key |label in legend| must be used together
-with a data set:
+
+As pointed out above, a legend is empty by default. In particular, the
+different data sets are not automatically inserted into the legend. Instead,
+the key |label in legend| must be used together with a data set:
\begin{key}{/tikz/data visualization/visualizer options/label in legend=\meta{options}}
- This key is passed to a data set, similar to options like
- |pin in data| or |smooth line|. The \meta{options} are used to
- configure the following:
- \begin{itemize}
- \item The legend in which the data set should be visualized.
- \item The text that is to be shown in the legend for the data set.
- \item The appearance of the legend entries.
- \end{itemize}
- In detail, the \meta{options} are executed with the path prefix
+ This key is passed to a data set, similar to options like |pin in data| or
+ |smooth line|. The \meta{options} are used to configure the following:
+ %
+ \begin{itemize}
+ \item The legend in which the data set should be visualized.
+ \item The text that is to be shown in the legend for the data set.
+ \item The appearance of the legend entries.
+ \end{itemize}
+ %
+ In detail, the \meta{options} are executed with the path prefix
+ %
\begin{codeexample}[code only]
/tikz/data visualization/legend entry options
\end{codeexample}
- To configure in which legend the label should appear, use the
- following key:
- \begin{key}{/tikz/data visualization/legend entry
- options/legend=\meta{name} (initially main legend)}
- Set this key to the name of a legend that has previously been
- created using |new legend|. The label will then be shown in this
- legend.
+ %
+ To configure in which legend the label should appear, use the
+ following key:
+ %
+ \begin{key}{/tikz/data visualization/legend entry options/legend=\meta{name} (initially main legend)}
+ Set this key to the name of a legend that has previously been created
+ using |new legend|. The label will then be shown in this legend.
- In most cases, there is only one legend (namely |main legend|) and
- there is no need to set this key since it defaults to the main
- legend.
+ In most cases, there is only one legend (namely |main legend|) and
+ there is no need to set this key since it defaults to the main legend.
- Also note that the legend \meta{name} is automatically created if
- it nodes not yet exist.
- \end{key}
-
- \begin{key}{/tikz/data visualization/legend entry options/text=\meta{text}}
- Use this key to setup the \meta{text} that is shown as the label
- of the data set.
+ Also note that the legend \meta{name} is automatically created if it
+ nodes not yet exist.
+ \end{key}
+ \begin{key}{/tikz/data visualization/legend entry options/text=\meta{text}}
+ Use this key to setup the \meta{text} that is shown as the label of the
+ data set.
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
scientific axes, x axis={label=$x$},
visualize as smooth line/.list=
- {log, lin, squared, exp},
+ {log, lin, squared, exp},
log= {label in legend={text=$\log x$}},
lin= {label in legend={text=$x/2$}},
squared={pin in data ={text=$x^2$, pos=0.1}},
exp= {label in data ={text=$e^x$}},
style sheet=vary dashing]
data group {function classes};
-\end{codeexample}
- \end{key}
-
- In addition to the two keys described above, there are further
- keys that are described in
- Section~\ref{section-dv-label-legend-entry-options}.
+\end{codeexample}
+ \end{key}
+
+ In addition to the two keys described above, there are further keys that
+ are described in Section~\ref{section-dv-label-legend-entry-options}.
\end{key}
\subsubsection{Rows and Columns of Legend Entries}
-In a legend, the different legend entries are arranged in a matrix,
-which typically has only one row or one column. For the impatient
-reader: Say |rows=1| to get everything in a row, say |columns=1| to
-get everything in a single column, and skip the rest of this section.
-
-The more patient reader will appreciate that when there are very many
-different data sets in a single visualization, it may be
-necessary to use more than one row or column inside the legend.
-\tikzname\ comes with a rather powerful mechanism for distributing the
-multiple legend entries over the matrix.
-
-The first thing to decide is in which ``direction'' the entries should
-be inserted into the matrix. Suppose we have a $3 \times 3$ matrix and
-our entries are $a$, $b$, $c$, and so on. Then, one might place the
-$a$ in the upper left corner of the matrix, $b$ in the upper middle
-position, $c$ in the upper right position, and $d$ in the middle left
-position. This is a ``first right, then down'' strategy. A different
-strategy might be to place the $a$ in the upper left corner, but $b$
-in the middle left position, $c$ in the lower left position, and $d$
-then in the upper middle position. This is a ``first down, then
-right'' strategy. In certain situations it might even make sense to
-place $a$ in the lower right corner and then go ``first up, then
-left''.
+In a legend, the different legend entries are arranged in a matrix, which
+typically has only one row or one column. For the impatient reader: Say
+|rows=1| to get everything in a row, say |columns=1| to get everything in a
+single column, and skip the rest of this section.
+
+The more patient reader will appreciate that when there are very many different
+data sets in a single visualization, it may be necessary to use more than one
+row or column inside the legend. \tikzname\ comes with a rather powerful
+mechanism for distributing the multiple legend entries over the matrix.
+
+The first thing to decide is in which ``direction'' the entries should be
+inserted into the matrix. Suppose we have a $3 \times 3$ matrix and our entries
+are $a$, $b$, $c$, and so on. Then, one might place the $a$ in the upper left
+corner of the matrix, $b$ in the upper middle position, $c$ in the upper right
+position, and $d$ in the middle left position. This is a ``first right, then
+down'' strategy. A different strategy might be to place the $a$ in the upper
+left corner, but $b$ in the middle left position, $c$ in the lower left
+position, and $d$ then in the upper middle position. This is a ``first down,
+then right'' strategy. In certain situations it might even make sense to place
+$a$ in the lower right corner and then go ``first up, then left''.
All of these strategies are supported by the |legend| command. You can
configure which strategy is used using the following keys:
@@ -1247,13 +1249,13 @@ configure which strategy is used using the following keys:
7={label in legend={text=7}},
8={label in legend={text=8}}
}
-}
-
+}
\begin{key}{/tikz/data visualization/legend options/down then right}
- Causes the legend entries to fill the legend matrix first downward
- and, once a column is full, the next column is begun to the right of
- the previous one. This is the default.
+ Causes the legend entries to fill the legend matrix first downward and,
+ once a column is full, the next column is begun to the right of the
+ previous one. This is the default.
+ %
\begin{codeexample}[width=6cm]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
@@ -1261,7 +1263,9 @@ configure which strategy is used using the following keys:
main legend={down then right, columns=3}]
data group {sin functions};
\end{codeexample}
- In the example, the |legend example| is the following style:
+ %
+ In the example, the |legend example| is the following style:
+ %
\begin{codeexample}[code only]
\tikzdatavisualizationset {
legend example/.style={
@@ -1275,8 +1279,9 @@ data group {sin functions};
7={label in legend={text=7}},
8={label in legend={text=8}}
}
-}
+}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/legend options/down then left}
@@ -1309,7 +1314,6 @@ data group {sin functions};
\end{codeexample}
\end{key}
-
\begin{key}{/tikz/data visualization/legend options/left then up}
\begin{codeexample}[width=6cm]
\tikz \datavisualization [
@@ -1350,191 +1354,192 @@ data group {sin functions};
\end{codeexample}
\end{key}
-
-Having configured the directions in which the matrix is being filled,
-you must next setup the number of rows or columns that are to be
-shown. There are actually two different ways of doing so. The first
-way is to specify a maximum number of rows or columns. For instance,
-you might specify that there should be at most ten rows to a column
-and when there are more, a new column should be begun. This is
-achieved using the following keys:
+Having configured the directions in which the matrix is being filled, you must
+next setup the number of rows or columns that are to be shown. There are
+actually two different ways of doing so. The first way is to specify a maximum
+number of rows or columns. For instance, you might specify that there should be
+at most ten rows to a column and when there are more, a new column should be
+begun. This is achieved using the following keys:
\begin{key}{/tikz/data visualization/legend options/max rows=\meta{number}}
- As the legend matrix is being filled, whenever the number of rows in
- the current column would exceed \meta{number}, a new column is
- started.
+ As the legend matrix is being filled, whenever the number of rows in the
+ current column would exceed \meta{number}, a new column is started.
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
main legend={max rows=3}]
data group {sin functions};
-\end{codeexample}
+\end{codeexample}
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
main legend={max rows=4}]
data group {sin functions};
-\end{codeexample}
+\end{codeexample}
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
main legend={max rows=5}]
data group {sin functions};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
-
\begin{key}{/tikz/data visualization/legend options/max columns=\meta{number}}
- This key works like |max rows|, only now the number of columns is
- monitored. Note that this strategy only really makes sense when the
- when you use this key with a strategy that first goes left or right
- and then up or down.
+ This key works like |max rows|, only now the number of columns is
+ monitored. Note that this strategy only really makes sense when the when
+ you use this key with a strategy that first goes left or right and then up
+ or down.
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
main legend={right then down, max columns=2}]
data group {sin functions};
-\end{codeexample}
+\end{codeexample}
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
main legend={right then down,max columns=3}]
data group {sin functions};
-\end{codeexample}
+\end{codeexample}
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
main legend={right then down,max columns=4}]
data group {sin functions};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
-
-The second way of specifying the number of entries in a row or column
-is to specify an ``ideal number of rows or columns.'' The idea is as
-follows: Suppose that we use the standard strategy and would like to
-have everything in two columns. Then if there are eight entries, the
-first four should go to the first column, while the next four should
-go to the second column. If we have 20 entries, the first ten should
-go the first column and the next ten to the second, and so on. So, in
-general, the objective is to distribute the entries evenly so the this
-``ideal number of columns'' is reached. Only when there are too few
-entries to achieve this or when the number of entries per column would
-exceed the |max rows| value, will the number of columns deviate from
-this ideal value.
-
-
+The second way of specifying the number of entries in a row or column is to
+specify an ``ideal number of rows or columns''. The idea is as follows: Suppose
+that we use the standard strategy and would like to have everything in two
+columns. Then if there are eight entries, the first four should go to the first
+column, while the next four should go to the second column. If we have 20
+entries, the first ten should go the first column and the next ten to the
+second, and so on. So, in general, the objective is to distribute the entries
+evenly so the this ``ideal number of columns'' is reached. Only when there are
+too few entries to achieve this or when the number of entries per column would
+exceed the |max rows| value, will the number of columns deviate from this ideal
+value.
\begin{key}{/tikz/data visualization/legend options/ideal number of columns=\meta{number}}
- Specifies, that the entries should be split into \meta{number}
- different columns, whenever possible. However, when there would be
- more than the |max rows| value of rows per column, more columns than
- the ideal number are created.
+ Specifies, that the entries should be split into \meta{number} different
+ columns, whenever possible. However, when there would be more than the
+ |max rows| value of rows per column, more columns than the ideal number are
+ created.
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
main legend={ideal number of columns=2}]
data group {sin functions};
-\end{codeexample}
+\end{codeexample}
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
main legend={ideal number of columns=4}]
data group {sin functions};
-\end{codeexample}
+\end{codeexample}
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
main legend={max rows=3,ideal number of columns=2}]
data group {sin functions};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
-\begin{key}{/tikz/data visualization/legend
- options/rows=\meta{number}}
- Shorthand for |ideal number of rows=|\meta{number}.
+\begin{key}{/tikz/data visualization/legend options/rows=\meta{number}}
+ Shorthand for |ideal number of rows=|\meta{number}.
\end{key}
-
\begin{key}{/tikz/data visualization/legend options/ideal number of rows=\meta{number}}
- Works like |ideal number of columns|.
+ Works like |ideal number of columns|.
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
main legend={ideal number of rows=2}]
data group {sin functions};
-\end{codeexample}
+\end{codeexample}
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
main legend={ideal number of rows=4}]
data group {sin functions};
-\end{codeexample}
+\end{codeexample}
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
visualize as smooth line/.list={1,2,3,4,5,6,7,8},
legend example, style sheet=vary hue,
main legend={max columns=3,ideal number of rows=2}]
data group {sin functions};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
-\begin{key}{/tikz/data visualization/legend
- options/columns=\meta{number}}
- Shorthand for |ideal number of columns=|\meta{number}.
+\begin{key}{/tikz/data visualization/legend options/columns=\meta{number}}
+ Shorthand for |ideal number of columns=|\meta{number}.
\end{key}
\subsubsection{Legend Placement: The General Mechanism}
-A legend can either be placed next to the data visualization or inside
-the data visualization at some place where there are no data
-entries. Both approached have advantages: Placing the legend next to
-the visualization minimises the ``cluttering'' by keeping all the
-extra information apart from the actual data, while placing the legend
-inside the visualization minimises the distance between the data sets
-and their explanations, making it easier for the eye to connect them.
-
-For both approaches there are options that make the placement easier,
-see Sections \ref{section-dv-legend-outside}
-and~\ref{section-dv-legend-inside}, but these options internally just
-map to the following two options:
-
-\begin{key}{/tikz/data visualization/legend
- options/anchor=\meta{anchor}}
- The whole legend is a \tikzname-matrix internally. Thus,
- in particular, it is stored in a node, which has anchors. Like for
- any other node, when the node is shown, the node is shifted in such
- a way that the \meta{anchor} of the node lies at the current |at|
- position.
-\end{key}
-
-\begin{key}{/tikz/data visualization/legend
- options/at=\meta{coordinate}}
- Configures the \meta{coordinate} at which the \meta{anchor} of the
- legend's node should lie.
-
- It may seem hard to predict a good \meta{coordinate} for a legend
- since, depending of the size of the axis, different positions need
- to the chosen for the legend. However, it turns out that one
- can often use the coordinates of the special nodes
- |data bounding box| and |data visualization bounding box|,
- documented in Section~\ref{section-dv-bounding-box}.
-
- As an example, let us put a legend to the right of the
- visualization, but so that the first entry starts at the top of the
- visualization:
+A legend can either be placed next to the data visualization or inside the data
+visualization at some place where there are no data entries. Both approached
+have advantages: Placing the legend next to the visualization minimises the
+``cluttering'' by keeping all the extra information apart from the actual data,
+while placing the legend inside the visualization minimises the distance
+between the data sets and their explanations, making it easier for the eye to
+connect them.
+
+For both approaches there are options that make the placement easier, see
+Sections \ref{section-dv-legend-outside} and~\ref{section-dv-legend-inside},
+but these options internally just map to the following two options:
+
+\begin{key}{/tikz/data visualization/legend options/anchor=\meta{anchor}}
+ The whole legend is a \tikzname-matrix internally. Thus, in particular, it
+ is stored in a node, which has anchors. Like for any other node, when the
+ node is shown, the node is shifted in such a way that the \meta{anchor} of
+ the node lies at the current |at| position.
+\end{key}
+
+\begin{key}{/tikz/data visualization/legend options/at=\meta{coordinate}}
+ Configures the \meta{coordinate} at which the \meta{anchor} of the legend's
+ node should lie.
+
+ It may seem hard to predict a good \meta{coordinate} for a legend since,
+ depending of the size of the axis, different positions need to the chosen
+ for the legend. However, it turns out that one can often use the
+ coordinates of the special nodes |data bounding box| and
+ |data visualization bounding box|, documented in
+ Section~\ref{section-dv-bounding-box}.
+
+ As an example, let us put a legend to the right of the visualization, but
+ so that the first entry starts at the top of the visualization:
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
scientific axes, x axis={label=$x$},
@@ -1549,8 +1554,9 @@ map to the following two options:
style sheet=vary dashing]
data group {function classes};
\end{codeexample}
- As can be seen, a bit of an additional shift might have been in
- order, but the result is otherwise quite satisfactory.
+ %
+ As can be seen, a bit of an additional shift might have been in order, but
+ the result is otherwise quite satisfactory.
\end{key}
@@ -1558,13 +1564,14 @@ data group {function classes};
\label{section-dv-legend-outside}
The following keys make it easy to place a legend outside the data
-visualization.
+visualization.
\begin{key}{/tikz/data visualization/legend options/east outside}
- Placing the legend to the right of the data visualization is the default:
+ Placing the legend to the right of the data visualization is the default:
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list=
{log, lin, squared, exp},
legend=east outside,
@@ -1574,19 +1581,20 @@ visualization.
exp= {label in legend={text=$e^x$}},
style sheet=strong colors]
data group {function classes};
-\end{codeexample}
+\end{codeexample}
- \begin{key}{/tikz/data visualization/legend options/right}
- This is an easier-to-remember alias.
- \end{key}
+ \begin{key}{/tikz/data visualization/legend options/right}
+ This is an easier-to-remember alias.
+ \end{key}
\end{key}
\begin{key}{/tikz/data visualization/legend options/north east outside}
- A variant, where the legend is to the right, but aligned with the
- northern end of the data visualization:
+ A variant, where the legend is to the right, but aligned with the northern
+ end of the data visualization:
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list=
{log, lin, squared, exp},
legend=north east outside,
@@ -1596,13 +1604,14 @@ data group {function classes};
exp= {label in legend={text=$e^x$}},
style sheet=strong colors]
data group {function classes};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/legend options/south east outside}
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list=
{log, lin, squared, exp},
legend=south east outside,
@@ -1612,15 +1621,15 @@ data group {function classes};
exp= {label in legend={text=$e^x$}},
style sheet=strong colors]
data group {function classes};
-\end{codeexample}
+\end{codeexample}
\end{key}
\begin{key}{/tikz/data visualization/legend options/west outside}
- The legend is placed left. Note that the text also swaps its
- position.
+ The legend is placed left. Note that the text also swaps its position.
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list=
{log, lin, squared, exp},
legend=west outside,
@@ -1630,16 +1639,17 @@ data group {function classes};
exp= {label in legend={text=$e^x$}},
style sheet=strong colors]
data group {function classes};
-\end{codeexample}
- \begin{key}{/tikz/data visualization/legend options/left}
- This is an easier-to-remember alias.
- \end{key}
+\end{codeexample}
+ %
+ \begin{key}{/tikz/data visualization/legend options/left}
+ This is an easier-to-remember alias.
+ \end{key}
\end{key}
\begin{key}{/tikz/data visualization/legend options/north west outside}
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list=
{log, lin, squared, exp},
legend=north west outside,
@@ -1649,13 +1659,13 @@ data group {function classes};
exp= {label in legend={text=$e^x$}},
style sheet=strong colors]
data group {function classes};
-\end{codeexample}
+\end{codeexample}
\end{key}
\begin{key}{/tikz/data visualization/legend options/south west outside}
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list=
{log, lin, squared, exp},
legend=south west outside,
@@ -1665,16 +1675,17 @@ data group {function classes};
exp= {label in legend={text=$e^x$}},
style sheet=strong colors]
data group {function classes};
-\end{codeexample}
+\end{codeexample}
\end{key}
\begin{key}{/tikz/data visualization/legend options/north outside}
- The legend is placed above the data. Note that the legend entries
- now for a row rather than a column.
+ The legend is placed above the data. Note that the legend entries now for a
+ row rather than a column.
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list=
{log, lin, squared, exp},
legend=north outside,
@@ -1684,16 +1695,17 @@ data group {function classes};
exp= {label in legend={text=$e^x$}},
style sheet=strong colors]
data group {function classes};
-\end{codeexample}
- \begin{key}{/tikz/data visualization/legend options/above}
- This is an easier-to-remember alias.
- \end{key}
+\end{codeexample}
+ %
+ \begin{key}{/tikz/data visualization/legend options/above}
+ This is an easier-to-remember alias.
+ \end{key}
\end{key}
\begin{key}{/tikz/data visualization/legend options/south outside}
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list=
{log, lin, squared, exp},
legend=south outside,
@@ -1703,29 +1715,28 @@ data group {function classes};
exp= {label in legend={text=$e^x$}},
style sheet=strong colors]
data group {function classes};
-\end{codeexample}
- \begin{key}{/tikz/data visualization/legend options/below}
- This is an easier-to-remember alias.
- \end{key}
+\end{codeexample}
+ %
+ \begin{key}{/tikz/data visualization/legend options/below}
+ This is an easier-to-remember alias.
+ \end{key}
\end{key}
-
\subsubsection{Legend Placement: Inside to the Data Visualization}
\label{section-dv-legend-inside}
-There are two sets of options for placing a legend directly inside a
-data visualization: First, there are options for placing it inside,
-but next to some part of the border. Second, there are options for
-positioning it relative to a coordinate given by a certain data point.
-
-
+There are two sets of options for placing a legend directly inside a data
+visualization: First, there are options for placing it inside, but next to some
+part of the border. Second, there are options for positioning it relative to a
+coordinate given by a certain data point.
\begin{key}{/tikz/data visualization/legend options/south east inside}
- Puts the legend in the upper right corner of the data.
+ Puts the legend in the upper right corner of the data.
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list=
{log, lin},
legend=south east inside,
@@ -1733,45 +1744,47 @@ positioning it relative to a coordinate given by a certain data point.
lin= {label in legend={text=$x/2$}},
style sheet=strong colors]
data group {function classes};
-\end{codeexample}
+\end{codeexample}
- Note that the text is now a little smaller since there tends to be
- much less space inside the data visualization than next to it. Also,
- the legend's node is filled in white by default to ensures that the
- legend is clearly legible even in the presence of, say, a grid or
- data points behind it. This behaviour is triggered by the following
- style key:
+ Note that the text is now a little smaller since there tends to be much
+ less space inside the data visualization than next to it. Also, the
+ legend's node is filled in white by default to ensures that the legend is
+ clearly legible even in the presence of, say, a grid or data points behind
+ it. This behaviour is triggered by the following style key:
- \begin{stylekey}{/tikz/data visualization/legend options/every legend inside}
- Executed the keys |opaque| by default and sets the text size to
- the size of footnotes.
- \end{stylekey}
+ \begin{stylekey}{/tikz/data visualization/legend options/every legend inside}
+ Executed the keys |opaque| by default and sets the text size to the
+ size of footnotes.
+ \end{stylekey}
\end{key}
-In order to further configure the default appearance of an inner
-legend, the following keys might be useful:
+In order to further configure the default appearance of an inner legend, the
+following keys might be useful:
-\begin{key}{/tikz/data visualization/legend
- options/opaque=\meta{color} (default white)}
- When this key is used, the legend's node will be filled with the
- \meta{color} and its corners will be rounded. Additionally, the
- inner and outer separations will be set to sensible values.
+\begin{key}{/tikz/data visualization/legend options/opaque=\meta{color} (default white)}
+ When this key is used, the legend's node will be filled with the
+ \meta{color} and its corners will be rounded. Additionally, the inner and
+ outer separations will be set to sensible values.
\end{key}
-\begin{key}{/tikz/data visualization/legend
- options/transparent}
- Sets the filling of the legend node to |none|.
+%
+\begin{key}{/tikz/data visualization/legend options/transparent}
+ Sets the filling of the legend node to |none|.
\end{key}
The following keys work much the same way as |south east inside|:
\begin{key}{/tikz/data visualization/legend options/east inside}
\end{key}
+%
\begin{key}{/tikz/data visualization/legend options/north east inside}
\end{key}
+%
\begin{key}{/tikz/data visualization/legend options/south west inside}
\end{key}
+%
\begin{key}{/tikz/data visualization/legend options/west inside}
\end{key}
+%
\begin{key}{/tikz/data visualization/legend options/north west inside}
\end{key}
@@ -1779,108 +1792,111 @@ The keys |south inside| and |north inside| are a bit different: They use a row
rather than a column for the legend entries:
\begin{key}{/tikz/data visualization/legend options/south inside}
- Puts the legend in the upper right corner of the data. Note that the
- text is now a little smaller since there tends to be much less space
- inside the data visualization than next to it.
+ Puts the legend in the upper right corner of the data. Note that the text
+ is now a little smaller since there tends to be much less space inside the
+ data visualization than next to it.
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list={log, lin},
legend=south inside,
log= {label in legend={text=$\log x$}},
lin= {label in legend={text=$x/2$}},
style sheet=strong colors]
data group {function classes};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/legend options/north inside}
- As above.
+ As above.
\end{key}
-The above keys do not always give you as fine a control as you may
-need over the placement of the legend. In such cases, the following
-keys may help (or you can revert to directly setting the |at| and the
-|anchor| keys):
+The above keys do not always give you as fine a control as you may need over
+the placement of the legend. In such cases, the following keys may help (or you
+can revert to directly setting the |at| and the |anchor| keys):
-\begin{key}{/tikz/data visualization/legend options/at
- values=\meta{data point}}
- This key allows you to specify the desired center of the legend in
- terms of a data point. The \meta{data point} should be a list of
- comma-separated key--value pairs that specify a data point. The
- legend will then be centered at this data point.
+\begin{key}{/tikz/data visualization/legend options/at values=\meta{data point}}
+ This key allows you to specify the desired center of the legend in terms of
+ a data point. The \meta{data point} should be a list of comma-separated
+ key--value pairs that specify a data point. The legend will then be
+ centered at this data point.
+ %
\begin{codeexample}[width=6cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list={log, lin},
legend={at values={x=-1, y=2}},
log= {label in legend={text=$\log x$}},
lin= {label in legend={text=$x/2$}},
style sheet=strong colors]
data group {function classes};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
-\begin{key}{/tikz/data visualization/legend options/right
- of=\meta{data point}}
- Works like |at values|, but the anchor is set to |west|:
+\begin{key}{/tikz/data visualization/legend options/right of=\meta{data point}}
+ Works like |at values|, but the anchor is set to |west|:
+ %
\begin{codeexample}[width=6cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list={log, lin},
legend={right of={x=-1, y=2}},
log= {label in legend={text=$\log x$}},
lin= {label in legend={text=$x/2$}},
style sheet=strong colors]
data group {function classes};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
The following keys work similarly:
-\begin{key}{/tikz/data visualization/legend options/above right of=\meta{data point}}
+%
+\begin{key}{/tikz/data visualization/legend options/above right of=\meta{data point}}
\end{key}
-\begin{key}{/tikz/data visualization/legend options/above of=\meta{data point}}
+%
+\begin{key}{/tikz/data visualization/legend options/above of=\meta{data point}}
\end{key}
-\begin{key}{/tikz/data visualization/legend options/above left of=\meta{data point}}
+%
+\begin{key}{/tikz/data visualization/legend options/above left of=\meta{data point}}
\end{key}
-\begin{key}{/tikz/data visualization/legend options/left of=\meta{data point}}
+%
+\begin{key}{/tikz/data visualization/legend options/left of=\meta{data point}}
\end{key}
-\begin{key}{/tikz/data visualization/legend options/below left of=\meta{data point}}
+%
+\begin{key}{/tikz/data visualization/legend options/below left of=\meta{data point}}
\end{key}
-\begin{key}{/tikz/data visualization/legend options/below of=\meta{data point}}
+%
+\begin{key}{/tikz/data visualization/legend options/below of=\meta{data point}}
\end{key}
-\begin{key}{/tikz/data visualization/legend options/below right of=\meta{data point}}
+%
+\begin{key}{/tikz/data visualization/legend options/below right of=\meta{data point}}
\end{key}
-
-
\subsubsection{Legend Entries: General Styling}
-
\label{section-dv-label-legend-entry-options}
The entries in a legend can be styled in several ways:
-
+%
\begin{itemize}
-\item
- You can configure the styling of the text node.
-\item
- You can configure the relative placement of the text node and the
- little picture depicting the data set's styling.
-\item
- You can configure how the data set's styling is depicted.
+ \item You can configure the styling of the text node.
+ \item You can configure the relative placement of the text node and the
+ little picture depicting the data set's styling.
+ \item You can configure how the data set's styling is depicted.
\end{itemize}
-Before we have look at how each of these are configured, in detail,
-let us first have a look at the keys that allow us to save a set of
-such styles:
+Before we have look at how each of these are configured, in detail, let us
+first have a look at the keys that allow us to save a set of such styles:
\begin{stylekey}{/tikz/data visualization/every label in legend}
- This key is executed with every label in a legend. However, the
- options stored in this style are executed with the path prefix
- |/tikz/data visualization/legend entry options|. Thus, this key can
- use keys like |node style| to configure the styling of all text
- nodes:
+ This key is executed with every label in a legend. However, the options
+ stored in this style are executed with the path prefix
+ |/tikz/data visualization/legend entry options|. Thus, this key can use
+ keys like |node style| to configure the styling of all text nodes:
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
scientific axes,
@@ -1897,12 +1913,13 @@ such styles:
style sheet=strong colors]
data group {function classes};
\end{codeexample}
+ %
\end{stylekey}
\begin{key}{/tikz/data visualization/legend options/label style=\meta{options}}
- This key can be used with a legend. It will simply add the
- \meta{options} to the |every label in legend| style for the given
- legend.
+ This key can be used with a legend. It will simply add the \meta{options}
+ to the |every label in legend| style for the given legend.
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
scientific axes,
@@ -1917,19 +1934,20 @@ data group {function classes};
style sheet=strong colors]
data group {function classes};
\end{codeexample}
+ %
\end{key}
\subsubsection{Legend Entries: Styling the Text Node}
-The appearance of the text nodes is easy to configure.
+The appearance of the text nodes is easy to configure.
\begin{key}{/tikz/data visualization/legend entry options/node style=\meta{options}}
- This key adds \meta{options} to the styling of the text nodes of the
- label.
+ This key adds \meta{options} to the styling of the text nodes of the label.
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list=
{log, lin, squared, exp},
legend=north east outside,
@@ -1941,15 +1959,17 @@ The appearance of the text nodes is easy to configure.
style sheet=strong colors]
data group {function classes};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/legend entry options/text colored}
- Causes the |node style| to set the text color to
- |visualizer color|. The effect of this is that the label's text
- will have the same color as the data set to which it is attached.
+ Causes the |node style| to set the text color to |visualizer color|. The
+ effect of this is that the label's text will have the same color as the
+ data set to which it is attached.
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list=
{log, lin, squared, exp},
legend={label style=text colored},
@@ -1960,24 +1980,26 @@ data group {function classes};
style sheet=strong colors]
data group {function classes};
\end{codeexample}
+ %
\end{key}
\subsubsection{Legend Entries: Text Placement}
-Three keys govern where the text will be placed relative to the data
-set style visualization.
+Three keys govern where the text will be placed relative to the data set style
+visualization.
\begin{key}{/tikz/data visualization/legend entry options/text right}
- Placed the text node to the right of the data set style
- visualization. This is the default for most, but not all, legends.
+ Placed the text node to the right of the data set style visualization. This
+ is the default for most, but not all, legends.
\end{key}
+%
\begin{key}{/tikz/data visualization/legend entry options/text left}
- Placed the text node to the left of the data set style
- visualization.
+ Placed the text node to the left of the data set style visualization.
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list=
{log, lin, squared, exp},
legend={label style=text left},
@@ -1988,15 +2010,17 @@ set style visualization.
style sheet=strong colors]
data group {function classes};
\end{codeexample}
+ %
\end{key}
+%
\begin{key}{/tikz/data visualization/legend entry options/text only}
- Shows only the text nodes and no data set style visualization at
- all. This options only makes sense in conjunction with the
- |text colored| options, which is why this options is also selected
- implicitly.
+ Shows only the text nodes and no data set style visualization at all. This
+ options only makes sense in conjunction with the |text colored| options,
+ which is why this options is also selected implicitly.
+ %
\begin{codeexample}[width=8cm]
\tikz \datavisualization [
- scientific axes,
+ scientific axes,
visualize as smooth line/.list=
{log, lin, squared, exp},
legend={south east inside, rows=2,
@@ -2008,69 +2032,70 @@ data group {function classes};
style sheet=strong colors]
data group {function classes};
\end{codeexample}
+ %
\end{key}
-
-
-
\subsubsection{Advanced: Labels in Legends and Their Visualizers}
-
\label{section-dv-legend-entries}
-The following explanations are important only for you if you intend to
-create a new visualizer and an accompanying label in legend
-visualizer; otherwise you can safely proceed with the next section.
-
-A legend entry consists not only of some explaining text, but, even
-more importantly, of a visual representation of the style used for the
-data points, created by a \emph{label in legend visualizer}. For
-instance, when data points are visualized as lines in
-different colors, the legend entry for the first line might consist of
-the text ``first experiment'' and a short line in black and the second
-entry might consist of ``failed experiment'' and a short line in red
--- assuming, of course, that the style sheet makes the first line
-black and the second line blue. As another example, when data sets are
-visualized as clouds of plot marks, the texts in the legend would be
-accompanied by the plot marks used to visualize the data sets.
+The following explanations are important only for you if you intend to create a
+new visualizer and an accompanying label in legend visualizer; otherwise you
+can safely proceed with the next section.
+
+A legend entry consists not only of some explaining text, but, even more
+importantly, of a visual representation of the style used for the data points,
+created by a \emph{label in legend visualizer}. For instance, when data points
+are visualized as lines in different colors, the legend entry for the first
+line might consist of the text ``first experiment'' and a short line in black
+and the second entry might consist of ``failed experiment'' and a short line in
+red -- assuming, of course, that the style sheet makes the first line black and
+the second line blue. As another example, when data sets are visualized as
+clouds of plot marks, the texts in the legend would be accompanied by the plot
+marks used to visualize the data sets.
For every visualizer, the \emph{label in legend visualizer} creates an
-appropriate visualization of the data set's styling. There may be more
-than one possible such label in legend visualizer that is appropriate,
-in which case options are used to choose between them.
+appropriate visualization of the data set's styling. There may be more than one
+possible such label in legend visualizer that is appropriate, in which case
+options are used to choose between them.
-Let us start with the key for creating a new legend entry. This key
-gets called for instance by |label in legend|:
+Let us start with the key for creating a new legend entry. This key gets called
+for instance by |label in legend|:
\begin{key}{/tikz/data visualization/new legend entry=\meta{options}}
- This key will add a new entry to the legend that is identified by
- the \meta{options}. For this, the \meta{options} are executed once
- with the path prefix |/tikz/data visualization/legend entry options|
- and the resulting setting of the |legend| key is used to pick which
- legend the new entry should belong to. Then, the \meta{options} are
- stored away for the time being.
-
- Later, when the legend is created, the \meta{options} get executed
- once more. This time, however, the |legend| key is no longer
- important. Instead, the \meta{options} that setup keys like
- |text| or |visualizer in legend| now play a role.
-
- In detail, the following happens:
- \begin{itemize}
- \item For the legend entry, a little cell picture is created in the
- matrix of the legend (see Section~\ref{section-tikz-cell-pictures}
- for details on cell pictures).
- \item Inside this picture, a node is created whose text is taken
- from the key
+ This key will add a new entry to the legend that is identified by the
+ \meta{options}. For this, the \meta{options} are executed once with the
+ path prefix |/tikz/data visualization/legend entry options| and the
+ resulting setting of the |legend| key is used to pick which legend the new
+ entry should belong to. Then, the \meta{options} are stored away for the
+ time being.
+
+ Later, when the legend is created, the \meta{options} get executed once
+ more. This time, however, the |legend| key is no longer important. Instead,
+ the \meta{options} that setup keys like |text| or |visualizer in legend|
+ now play a role.
+
+ In detail, the following happens:
+ %
+ \begin{itemize}
+ \item For the legend entry, a little cell picture is created in the
+ matrix of the legend (see Section~\ref{section-tikz-cell-pictures}
+ for details on cell pictures).
+ \item Inside this picture, a node is created whose text is taken from
+ the key
+ %
\begin{codeexample}[code only]
-/tikz/data visualization/legend entry options/text
-\end{codeexample}
- \item Also inside the picture, the code stored in the following key
- gets executed:
- \begin{key}{/tikz/data visualization/legend entry options/visualizer in legend}
- Set this key to some code that paints something in the cell
- picture. Typically, this will be a visual representation of the
- data set styling, but it could also be something different.
+/tikz/data visualization/legend entry options/text
+\end{codeexample}
+ %
+ \item Also inside the picture, the code stored in the following key
+ gets executed:
+ %
+ \begin{key}{/tikz/data visualization/legend entry options/visualizer in legend}
+ Set this key to some code that paints something in the cell
+ picture. Typically, this will be a visual representation of the
+ data set styling, but it could also be something different.
+ %
\begin{codeexample}[width=6cm]
\tikz \datavisualization [
school book axes, visualize as line/.list={a,b},
@@ -2084,76 +2109,77 @@ gets called for instance by |label in legend|:
data point [x=-1, y=-1, set=a] data point [x=1, y=0, set=a]
data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
\end{codeexample}
- \end{key}
- \end{itemize}
- The following styles are applied in the following order before the
- cell picture is filled:
- \begin{enumerate}
- \item |/tikz/data visualization/every data set label| with path
- |/tikz/data visualization|
- \item |/tikz/data visualization/every label in legend| with path\\
- |/tikz/data visualization/legend entry options|.
- \item The \meta{options}.
- \item The code in the following key:
- \begin{key}{/tikz/data visualization/legend entry options/setup}
- Some code to be executed at this point. Mostly, it is used to
- setup attributes for style sheets.
- \end{key}
- \item A styling signal is emitted.
- \item Only for the node: The current value of |node style|.
- \item Only for the visualizer in legend: The styling that has been
- accumulated by calls to the following key:
- \begin{stylekey}{/tikz/data visualization/legend entry
- options/visualizer in legend style=\\\marg{options}}
- Calls to this key accumulate \meta{options} that will be
- executed with the path prefix |/tikz| at this point.
- \end{stylekey}
- \end{enumerate}
+ \end{key}
+ \end{itemize}
+ %
+ The following styles are applied in the following order before the cell
+ picture is filled:
+ %
+ \begin{enumerate}
+ \item |/tikz/data visualization/every data set label| with path
+ |/tikz/data visualization|
+ \item |/tikz/data visualization/every label in legend| with path\\
+ |/tikz/data visualization/legend entry options|.
+ \item The \meta{options}.
+ \item The code in the following key:
+ %
+ \begin{key}{/tikz/data visualization/legend entry options/setup}
+ Some code to be executed at this point. Mostly, it is used to
+ setup attributes for style sheets.
+ \end{key}
+ \item A styling signal is emitted.
+ \item Only for the node: The current value of |node style|.
+ \item Only for the visualizer in legend: The styling that has been
+ accumulated by calls to the following key:
+ %
+ \begin{stylekey}{/tikz/data visualization/legend entry options/visualizer in legend style=\\\marg{options}}
+ Calls to this key accumulate \meta{options} that will be
+ executed with the path prefix |/tikz| at this point.
+ \end{stylekey}
+ \end{enumerate}
\end{key}
As indicated earlier, the |new legend entry| key is called by the
-|label in legend=|\meta{options} key internally. In this case, the
-following extra \meta{extra options} are passed to |new legend entry|
-key:
+|label in legend=|\meta{options} key internally. In this case, the following
+extra \meta{extra options} are passed to |new legend entry| key:
+%
\begin{itemize}
-\item The styling of the visualizer.
-\item The |/tikz/data visualization/every label in legend| style.
-\item The |/tikz/every label| style with path |/tikz|.
-\item Setting |setup| to |/data point/set=|\meta{name of the visualizer}.
-\item The value of the |label legend options| that are stored in the
- visualizer. These options can be changed using the following key:
- \begin{key}{/tikz/data visualization/visualizer options/label in
- legend options=\meta{options}}
- Use this key with a visualizer to configure the label in legend
- options. Typically, this key is used only internally by a
- visualizer upon its creating to set the \meta{options} to setup
- the |visualizer in legend| key.
- \end{key}
+ \item The styling of the visualizer.
+ \item The |/tikz/data visualization/every label in legend| style.
+ \item The |/tikz/every label| style with path |/tikz|.
+ \item Setting |setup| to |/data point/set=|\meta{name of the visualizer}.
+ \item The value of the |label legend options| that are stored in the
+ visualizer. These options can be changed using the following key:
+ %
+ \begin{key}{/tikz/data visualization/visualizer options/label in legend options=\meta{options}}
+ Use this key with a visualizer to configure the label in legend
+ options. Typically, this key is used only internally by a
+ visualizer upon its creating to set the \meta{options} to setup the
+ |visualizer in legend| key.
+ \end{key}
\end{itemize}
\subsubsection{Reference: Label in Legend Visualizers for Lines and Scatter Plots}
-Visualizers like |visualize as line| or |visualize as smooth line|
-use a label in legend visualizer that draws a short line to represent
-the data set inside the legend. However, this line needs not be a
-simple straight line, but can be a little curve or a small circle --
-indeed, even the default line is not a simple straight line but rather
-a small zig-zag curve. To configure this line, the two keys
-are used, although you will only rarely use them directly, but
+Visualizers like |visualize as line| or |visualize as smooth line| use a label
+in legend visualizer that draws a short line to represent the data set inside
+the legend. However, this line needs not be a simple straight line, but can be
+a little curve or a small circle -- indeed, even the default line is not a
+simple straight line but rather a small zig-zag curve. To configure this line,
+the two keys are used, although you will only rarely use them directly, but
rather use one of the predefined styles mentioned later on.
-Before we go into the glorious details of all of these keys, let us
-first have a look at the keys you are most likely to use in practice:
-The keys for globally reconfiguring the default label in legend
-visualizers:
-\begin{stylekey}{/tikz/data visualization/legend entry options/default
- label in legend path}
- This style is set, by default, to |zig zag label in legend line|. It
- is installed by the styles |straight line|, |smooth line|, and
- |gap line|, so changing this style will change the appearance of lines in
- legends. The main other sensible option for this key is
- |straight label in legend line|.
+Before we go into the glorious details of all of these keys, let us first have
+a look at the keys you are most likely to use in practice: The keys for
+globally reconfiguring the default label in legend visualizers:
+%
+\begin{stylekey}{/tikz/data visualization/legend entry options/default label in legend path}
+ This style is set, by default, to |zig zag label in legend line|. It is
+ installed by the styles |straight line|, |smooth line|, and |gap line|, so
+ changing this style will change the appearance of lines in legends. The
+ main other sensible option for this key is |straight label in legend line|.
+ %
\begin{codeexample}[width=5cm]
\tikz \datavisualization [
school book axes, visualize as line/.list={a,b},
@@ -2162,6 +2188,7 @@ visualizers:
data point [x=-1, y=-1, set=a] data point [x=1, y=0, set=a]
data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
\end{codeexample}
+ %
\begin{codeexample}[width=5cm]
\tikz \datavisualization [
school book axes, visualize as line/.list={a,b},
@@ -2172,23 +2199,23 @@ data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
data point [x=-1, y=-1, set=a] data point [x=1, y=0, set=a]
data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
\end{codeexample}
+ %
\end{stylekey}
-\begin{stylekey}{/tikz/data visualization/legend entry options/default
- label in legend closed path}
- This style is executed by |smooth cycle| and |straight cycle|. There
- are (currently) no other predefined sets of coordinates that can be
- used instead of the default value |circular label in legend line|.
+%
+\begin{stylekey}{/tikz/data visualization/legend entry options/default label in legend closed path}
+ This style is executed by |smooth cycle| and |straight cycle|. There are
+ (currently) no other predefined sets of coordinates that can be used
+ instead of the default value |circular label in legend line|.
\end{stylekey}
-\begin{stylekey}{/tikz/data visualization/legend entry options/default
- label in legend mark}
- This style is executed by |no lines| and, implicitly, by scatter
- plots. The default is to use
- |label in legend line one mark|. Another possible value is
- |label in legend line three marks|.
+\begin{stylekey}{/tikz/data visualization/legend entry options/default label in legend mark}
+ This style is executed by |no lines| and, implicitly, by scatter plots. The
+ default is to use |label in legend line one mark|. Another possible value
+ is |label in legend line three marks|.
+ %
\begin{codeexample}[width=5cm]
\tikz \datavisualization [
- visualize as scatter/.list={a,b,c},
+ visualize as scatter/.list={a,b,c},
style sheet=cross marks,
legend entry options/default label in legend mark/.style=
label in legend three marks,
@@ -2196,35 +2223,34 @@ data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
b={label in legend={text=example b}},
c={label in legend={text=example c}}];
\end{codeexample}
+ %
\end{stylekey}
-\begin{key}{/tikz/data visualization/legend entry options/label in
- legend line coordinates=\\\marg{list of coordinates}}
- This key takes a \meta{list of coordinates}, which are
- \tikzname-coordinates separated by commas like |(0,0),|\penalty0|(1,1)|. The
- effect of setting the key is the following: The label in legend
- visualizer used by, for instance, |visualize as line| will draw a
- path going through these points. When the line is drawn, the exact
- same style will be used as was used for the data set. For instance,
- if the |smooth line| key was used and also the |style=red| key, the
- line through the \meta{list of coordinates} will also be red and
- smooth. When the |straight cycle| key was used, the coordinates will
- also be connected by a cycle, and so on.
-
- When the line connecting the \meta{list of coordinates} is drawn,
- the coordinate system will have been shifted and transformed in such
- a way that |(0,0)| lies to the left of the text and at half the
- height of the character ``x''. This means that the right-most-point
- in the list should usually be |(0,0)| and all other $x$-coordinates
- should usually be negative. When the |text left| options is used,
- the coordinate system will have been flipped, so the \meta{list of
- coordinates} is independent of whether the text is to the right or
- to the left of the line.
-
- Let us now have a look at a first, simple example. We create a
- legend entry that is just a straight line, so it should start
- somewhere to the left of the origin at height $0$ and go to the
- origin:
+\begin{key}{/tikz/data visualization/legend entry options/label in legend line coordinates=\\\marg{list of coordinates}}
+ This key takes a \meta{list of coordinates}, which are
+ \tikzname-coordinates separated by commas like |(0,0),|\penalty0|(1,1)|.
+ The effect of setting the key is the following: The label in legend
+ visualizer used by, for instance, |visualize as line| will draw a path
+ going through these points. When the line is drawn, the exact same style
+ will be used as was used for the data set. For instance, if the
+ |smooth line| key was used and also the |style=red| key, the line through
+ the \meta{list of coordinates} will also be red and smooth. When the
+ |straight cycle| key was used, the coordinates will also be connected by a
+ cycle, and so on.
+
+ When the line connecting the \meta{list of coordinates} is drawn, the
+ coordinate system will have been shifted and transformed in such a way that
+ |(0,0)| lies to the left of the text and at half the height of the
+ character ``x''. This means that the right-most-point in the list should
+ usually be |(0,0)| and all other $x$-coordinates should usually be
+ negative. When the |text left| options is used, the coordinate system will
+ have been flipped, so the \meta{list of coordinates} is independent of
+ whether the text is to the right or to the left of the line.
+
+ Let us now have a look at a first, simple example. We create a legend entry
+ that is just a straight line, so it should start somewhere to the left of
+ the origin at height $0$ and go to the origin:
+ %
\begin{codeexample}[width=5cm]
\tikz \datavisualization [
school book axes, visualize as line/.list={a,b},
@@ -2237,7 +2263,8 @@ data point [x=-1, y=-1, set=a] data point [x=1, y=0, set=a]
data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
\end{codeexample}
- Now let us make this a bit more fancy and useful by using shifted lines:
+ Now let us make this a bit more fancy and useful by using shifted lines:
+ %
\begin{codeexample}[width=5cm]
\tikz \datavisualization [
school book axes, visualize as line/.list={a,b},
@@ -2250,7 +2277,8 @@ data point [x=-1, y=-1, set=a] data point [x=1, y=0, set=a]
data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
\end{codeexample}
- In the final example, we use a little ``hat'' to represent lines:
+ In the final example, we use a little ``hat'' to represent lines:
+ %
\begin{codeexample}[width=5cm]
\tikz \datavisualization [
school book axes, visualize as line/.list={a,b},
@@ -2264,20 +2292,20 @@ data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
data point [x=-1, y=-1, set=a] data point [x=1, y=0, set=a]
data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
\end{codeexample}
+ %
\end{key}
-\begin{key}{/tikz/data visualization/legend entry options/label in
- legend mark coordinates=\\\marg{list of coordinates}}
- This key is similar to |label in legend line coordinates|, but now
- the \meta{list of coordinates} is used as the positions where plot
- marks are shown. Naturally, plot marks are only shown there if they
- are also shown by the visualizer in the actual data -- just like the
- line through the coordinates of the previous key is only shown when
- there is a line.
+\begin{key}{/tikz/data visualization/legend entry options/label in legend mark coordinates=\\\marg{list of coordinates}}
+ This key is similar to |label in legend line coordinates|, but now the
+ \meta{list of coordinates} is used as the positions where plot marks are
+ shown. Naturally, plot marks are only shown there if they are also shown by
+ the visualizer in the actual data -- just like the line through the
+ coordinates of the previous key is only shown when there is a line.
- The \meta{list of coordinates} may be the same as the one used for
- lines, but usually it is not. In general, it is better to have marks
- for instance not at the ends of the line.
+ The \meta{list of coordinates} may be the same as the one used for lines,
+ but usually it is not. In general, it is better to have marks for instance
+ not at the ends of the line.
+ %
\begin{codeexample}[width=5cm]
\tikz \datavisualization [
school book axes, visualize as line/.list={a,b},
@@ -2297,72 +2325,80 @@ data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
data point [x=-1, y=-1, set=a] data point [x=1, y=0, set=a]
data point [x=-1, y=1, set=b] data point [x=1, y=0.5, set=b];
\end{codeexample}
+ %
\end{key}
-
-Naturally, you typically will not give coordinates explicitly for each
-label, but use one of the following styles:
+Naturally, you typically will not give coordinates explicitly for each label,
+but use one of the following styles:
\begin{key}{/tikz/data visualization/legend entry options/straight label in legend line}
- Just gives a straight line and two plot marks.
+ Just gives a straight line and two plot marks.
+ %
\begin{codeexample}[width=5cm]
-\tikz \datavisualization [visualize as line,
- line={style={mark=x}, label in legend={text=example,
+\tikz \datavisualization [visualize as line,
+ line={style={mark=x}, label in legend={text=example,
straight label in legend line}}];
\end{codeexample}
- This style might seem like a good idea to use in general, but it
- does have a huge drawback: Some commonly used plot marks will be impossible to
- distinguish -- even though there is no problem distinguishing them
- in a graph.
+ %
+ This style might seem like a good idea to use in general, but it does have
+ a huge drawback: Some commonly used plot marks will be impossible to
+ distinguish -- even though there is no problem distinguishing them in a
+ graph.
+ %
\begin{codeexample}[width=5cm]
-\tikz \datavisualization [visualize as line/.list={a,b,c},
+\tikz \datavisualization [visualize as line/.list={a,b,c},
legend entry options/default label in legend path/.style=
straight label in legend line,
a={style={mark=+}, label in legend={text=bad example a}},
b={style={mark=-}, label in legend={text=bad example b}},
c={style={mark=|}, label in legend={text=bad example c}}];
\end{codeexample}
- For this reason, this option is not the default, but rather the next one.
+ %
+ For this reason, this option is not the default, but rather the next one.
\end{key}
\begin{key}{/tikz/data visualization/legend entry options/zig zag label in legend line}
- Uses a small up-down-up line as the label in legend visualizer. The
- two plot marks are at the extremal points of the line. It works
- pretty well in almost all situations and is the default.
+ Uses a small up-down-up line as the label in legend visualizer. The two
+ plot marks are at the extremal points of the line. It works pretty well in
+ almost all situations and is the default.
+ %
\begin{codeexample}[width=5cm]
\tikz \datavisualization [
visualize as line=a,
- visualize as smooth line/.list={b,c},
+ visualize as smooth line/.list={b,c},
a={style={mark=+}, label in legend={text=better example a}},
b={style={mark=-}, label in legend={text=better example b}},
c={style={mark=|}, label in legend={text=better example c}}];
\end{codeexample}
- Even though the above example shows that the marks are easier to
- distinguish than with a straight line, the chosen marks are still
- not optimal. This is the reason that the |cross marks| style uses
- different crosses:
+ %
+ Even though the above example shows that the marks are easier to
+ distinguish than with a straight line, the chosen marks are still not
+ optimal. This is the reason that the |cross marks| style uses different
+ crosses:
+ %
\begin{codeexample}[width=5cm]
\tikz \datavisualization [
visualize as line/.list={a,b},
- visualize as smooth line=c,
+ visualize as smooth line=c,
style sheet=cross marks,
a={label in legend={text=good example a}},
b={label in legend={text=good example b}},
c={gap line, label in legend={text=good example c}}];
\end{codeexample}
+ %
\end{key}
-
\begin{key}{/tikz/data visualization/legend entry options/circular label in legend line}
- This style is especially tailored to represent lines that are
- closed. It is automatically selected for instance by the |polygon|
- or the |smooth cycle| styles.
+ This style is especially tailored to represent lines that are closed. It is
+ automatically selected for instance by the |polygon| or the |smooth cycle|
+ styles.
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
scientific axes={clean}, all axes={length=3cm},
visualize as line/.list={a,b,c},
- a={polygon}, b={smooth cycle},
+ a={polygon}, b={smooth cycle},
style sheet=cross marks,
a={label in legend={text=polygon}},
b={label in legend={text=circle}},
@@ -2380,17 +2416,18 @@ data [format=function, set=b] {
data point [x=-1, y=0.5, set=c]
data point [x=1, y=0.25, set=c];
\end{codeexample}
+ %
\end{key}
-
\begin{key}{/tikz/data visualization/legend entry options/gap circular label in legend line}
- This style is especially tailored to for the |gap cycle| style and
- automatically selected by it:
+ This style is especially tailored to for the |gap cycle| style and
+ automatically selected by it:
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
scientific axes={clean}, all axes={length=3cm},
visualize as line/.list={a,b,c},
- a={gap cycle}, b={smooth cycle}, c={gap line},
+ a={gap cycle}, b={smooth cycle}, c={gap line},
a={style={mark=*, mark size=0.5pt},
label in legend={text=polygon}},
b={label in legend={text=circle}},
@@ -2409,14 +2446,14 @@ data [format=function, set=b] {
data point [x=-1, y=0.5, set=c]
data point [x=1, y=0.25, set=c];
\end{codeexample}
+ %
\end{key}
-
-
\begin{key}{/tikz/data visualization/legend entry options/label in legend one mark}
- To be used with scatter plots, since no line is drawn. Just displays
- a single mark (this is the default with a scatter plot or when the
- |no line| is selected.
+ To be used with scatter plots, since no line is drawn. Just displays a
+ single mark (this is the default with a scatter plot or when the |no line|
+ is selected.
+ %
\begin{codeexample}[width=5cm]
\tikz \datavisualization [visualize as scatter/.list={a,b,c},
style sheet=cross marks,
@@ -2424,11 +2461,12 @@ data point [x=1, y=0.25, set=c];
b={label in legend={text=example b}},
c={label in legend={text=example c}}];
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/legend entry options/label in legend three marks}
- An alternative to the previous style, where several marks are
- shown.
+ An alternative to the previous style, where several marks are shown.
+ %
\begin{codeexample}[width=5cm]
\tikz \datavisualization [visualize as scatter/.list={a,b,c},
style sheet=cross marks,
@@ -2436,7 +2474,5 @@ data point [x=1, y=0.25, set=c];
b={label in legend={text=example b, label in legend three marks}},
c={label in legend={text=example c, label in legend three marks}}];
\end{codeexample}
+ %
\end{key}
-
-
-
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
index 784e838baee..3923339a115 100644
--- 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
@@ -13,50 +13,50 @@
\subsection{Overview}
-In a data visualization a long stream of data points is
-\emph{visualized} using \emph{visualizers}. Recall that it is the job
-of the axis systems as described in Section~\ref{section-dv-axes} to
-determine \emph{where} data points are visualized. It is the job of
-the visualizers to determine \emph{how} they are visualized.
-
-The most basic and common visualizer is the \emph{line visualizer}. It
-simply connects subsequent data points by straight lines to indicate
-either that the points on these lines interpolate between the real
-data points or the straight lines are used to indicate the order in
-which the data points appear. A different, more ``conservative''
-visualizer is the \emph{scatter visualizer} or \emph{mark visualizer},
-which just places a small mark at each data point. Such a visualizer
-does not imply any interpolation or ordering between the data points.
-
-Visualizers may, however, also be more complicated. For instance, a
-visualizer used for a box plot could visualize a data point as a box
-with a median value, standard deviation, outliers, and other
-information; a rectangle visualizer might visualize data points as
-larger areas; a projection visualizer might visualize the projection
-of data points onto different axes; and so.
-
-Creating a new visualizer is not quite trivial since a new \pgfname\
-class needs to be implemented. Fortunately, using visualizers is much
-simpler: For each kind of visualizer there is a key that allows you to
-create such a visualizer. You can then use further keys to configure
-the visualizer and to connect it to the data.
-
-In a data visualization multiple visualizers may exist at the same
-time. This happens in different situations:
+In a data visualization a long stream of data points is \emph{visualized} using
+\emph{visualizers}. Recall that it is the job of the axis systems as described
+in Section~\ref{section-dv-axes} to determine \emph{where} data points are
+visualized. It is the job of the visualizers to determine \emph{how} they are
+visualized.
+
+The most basic and common visualizer is the \emph{line visualizer}. It simply
+connects subsequent data points by straight lines to indicate either that the
+points on these lines interpolate between the real data points or the straight
+lines are used to indicate the order in which the data points appear. A
+different, more ``conservative'' visualizer is the \emph{scatter visualizer} or
+\emph{mark visualizer}, which just places a small mark at each data point. Such
+a visualizer does not imply any interpolation or ordering between the data
+points.
+
+Visualizers may, however, also be more complicated. For instance, a visualizer
+used for a box plot could visualize a data point as a box with a median value,
+standard deviation, outliers, and other information; a rectangle visualizer
+might visualize data points as larger areas; a projection visualizer might
+visualize the projection of data points onto different axes; and so.
+
+Creating a new visualizer is not quite trivial since a new \pgfname\ class
+needs to be implemented. Fortunately, using visualizers is much simpler: For
+each kind of visualizer there is a key that allows you to create such a
+visualizer. You can then use further keys to configure the visualizer and to
+connect it to the data.
+
+In a data visualization multiple visualizers may exist at the same time. This
+happens in different situations:
+%
\begin{itemize}
-\item A data visualization may contain several independent data sets
- that are to be visualized. There might be a line plot, for which a
- line visualizer is used, and also a scatter plot, for which a
- scatter visualizer would be used.
-
- In this case, for each data point only one visualizer will do
- anything. To achieve this, each data point has an attribute called
- |visualizer| which tells the visualizer objects whether they should
- ``react'' to the data point or not.
-\item A single data point might be visualized several times. For
- instance, a scatter visualizer might draw a mark at the data point's
- position on the page and a projection visualizer might draw,
- additionally, a mark at the projected position.
+ \item A data visualization may contain several independent data sets that
+ are to be visualized. There might be a line plot, for which a line
+ visualizer is used, and also a scatter plot, for which a scatter
+ visualizer would be used.
+
+ In this case, for each data point only one visualizer will do anything.
+ To achieve this, each data point has an attribute called |visualizer|
+ which tells the visualizer objects whether they should ``react'' to the
+ data point or not.
+ \item A single data point might be visualized several times. For instance,
+ a scatter visualizer might draw a mark at the data point's position on
+ the page and a projection visualizer might draw, additionally, a mark
+ at the projected position.
\end{itemize}
@@ -64,14 +64,14 @@ time. This happens in different situations:
\subsubsection{Using a Single Visualizer}
-The simplest scenario for using visualizers are data visualizations in
-which there is only a single data set that is visualized in one
-style. In this case, all that needs to be done in order to choose a
-visualizer is use one of the options starting with |visualize as ...|
-together with the |\datavisualization| command:
-
+The simplest scenario for using visualizers are data visualizations in which
+there is only a single data set that is visualized in one style. In this case,
+all that needs to be done in order to choose a visualizer is use one of the
+options starting with |visualize as ...| together with the |\datavisualization|
+command:
+%
\begin{codeexample}[]
-% Define a data set:
+% Define a data set:
\tikz \datavisualization data group {example} = {
data {
x, y
@@ -82,54 +82,53 @@ data {
2, 0.5
}};
\tikz \datavisualization [school book axes, visualize as line] data group {example};
-\qquad
+\qquad
\tikz \datavisualization [school book axes, visualize as smooth line] data group {example};
-\qquad
+\qquad
\tikz \datavisualization [school book axes, visualize as scatter] data group {example};
\end{codeexample}
-Methods for styling visualizers are discussed in Section~\ref{section-dv-visualizer-styling}.
+Methods for styling visualizers are discussed in
+Section~\ref{section-dv-visualizer-styling}.
\subsubsection{Using Multiple Visualizers}
-A data visualization may contain multiple data groups and for each data
-set we might wish to use a different visualizer. In this case, we need
-some way of telling the data visualization engine to which visualizer
-should be used with the different data points.
-
-To solve this problem, you can \emph{name} a visualizer. The
-visualizer's name can then both be used to configure the visualizer
-and also to indicate that data points ``belong'' to the visualizer.
+A data visualization may contain multiple data groups and for each data set we
+might wish to use a different visualizer. In this case, we need some way of
+telling the data visualization engine to which visualizer should be used with
+the different data points.
-Naming a visualizer is quite simple: The |visualize as ...| keys
-actually take a single parameter, which is the name of the
-visualizer. For instance, the following code creates three
-visualizers, named |sin|, |cos|, and |tan|:
+To solve this problem, you can \emph{name} a visualizer. The visualizer's name
+can then both be used to configure the visualizer and also to indicate that
+data points ``belong'' to the visualizer.
+Naming a visualizer is quite simple: The |visualize as ...| keys actually take
+a single parameter, which is the name of the visualizer. For instance, the
+following code creates three visualizers, named |sin|, |cos|, and |tan|:
+%
\begin{codeexample}[code only]
visualize as line=sin,
visualize as line=cos,
visualize as scatter=tan
\end{codeexample}
-(When you just say |visualize as line| without providing a name, the
-name |line| is chosen as a default, for |visualize as scatter| the
-name |scatter| is the default and so.)
+(When you just say |visualize as line| without providing a name, the name
+|line| is chosen as a default, for |visualize as scatter| the name |scatter| is
+the default and so.)
-In order to indicate which data points should be visualized by which
-of these visualizers, the following key is important:
+In order to indicate which data points should be visualized by which of these
+visualizers, the following key is important:
\begin{key}{/data point/set}
- A visualizer will only act on a data point when its name matches the
- value of this key. Initially, this key is set to the last visualizer
- created, so if there is only one, there is no need to set or worry
- about this key.
+ A visualizer will only act on a data point when its name matches the value
+ of this key. Initially, this key is set to the last visualizer created, so
+ if there is only one, there is no need to set or worry about this key.
\end{key}
-Since the |set| key has the path prefix |/data point|, it can
-be set like any other attribute of a data key:
-
+Since the |set| key has the path prefix |/data point|, it can be set like any
+other attribute of a data key:
+%
\begin{codeexample}[width=7cm]
\tikz \datavisualization
[scientific axes=clean,
@@ -155,16 +154,16 @@ data {
};
\end{codeexample}
-As can be seen, the data points with the same |set| attribute
-do not need to be consecutive.
+As can be seen, the data points with the same |set| attribute do not need to be
+consecutive.
-The above method of specifying the visualizer works nicely, but in
-most cases it would be more natural to keep the |set| attribute
-out of the table. This is easy to achieve by using multiple |data| and
-using the following key:
+The above method of specifying the visualizer works nicely, but in most cases
+it would be more natural to keep the |set| attribute out of the table. This is
+easy to achieve by using multiple |data| and using the following key:
\begin{key}{/pgf/data/set=\meta{name}}
- Shorthand for |/data point/set=|\meta{name}.
+ Shorthand for |/data point/set=|\meta{name}.
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization
[scientific axes=clean,
@@ -187,16 +186,16 @@ data [set=cos] {
4, 1
};
\end{codeexample}
+ %
\end{key}
-When you need to visualize several similar things in a single plot
-(like ten lines that all get visualized by |visualize as line|), it is
-somewhat cumbersome having to write this ten times. In this case you
-can shorten your code by making use of the |.list| key handler: When
-you add it to a key, the ``value'' passed to the key is parsed as a
-list of values. The key is then executed once for each of these
-values:
-
+When you need to visualize several similar things in a single plot (like ten
+lines that all get visualized by |visualize as line|), it is somewhat
+cumbersome having to write this ten times. In this case you can shorten your
+code by making use of the |.list| key handler: When you add it to a key, the
+``value'' passed to the key is parsed as a list of values. The key is then
+executed once for each of these values:
+%
\begin{codeexample}[width=7cm]
\tikz \datavisualization
[scientific axes=clean,
@@ -216,29 +215,27 @@ data [set=tan, format=function] {
\end{codeexample}
-
\subsubsection{Styling a Visualizer}
\label{section-dv-visualizer-styling}
-In order to style a visualizer that has been created using for
-instance |visualize as line=|\meta{visualizer name}, you can use the
-following key:
+In order to style a visualizer that has been created using for instance
+|visualize as line=|\meta{visualizer name}, you can use the following key:
-\begin{key}{/tikz/data visualization/\meta{visualizer
- name}=\meta{options}}
- For each visualizer, a key of the same name is created with the path
- prefix |/tikz/data visualization|. This key takes the \meta{options}
- and executes them with the path prefix
+\begin{key}{/tikz/data visualization/\meta{visualizer name}=\meta{options}}
+ For each visualizer, a key of the same name is created with the path prefix
+ |/tikz/data visualization|. This key takes the \meta{options} and executes
+ them with the path prefix
+ %
\begin{codeexample}[code only]
-/tikz/data visualization/visualizer options/
+/tikz/data visualization/visualizer options/
\end{codeexample}
- These options are then used to configure the appearance of the
- current visualizer. (This is quite similar to the way options are
- passed to an axis in order to configure the axis.)
- Possible options include |style|, but also |label in legend| and
- |label in data|. The latter two options are discussed in
- Section~\ref{section-dv-labels-in}, the first option below.
-
+ %
+ These options are then used to configure the appearance of the current
+ visualizer. (This is quite similar to the way options are passed to an axis
+ in order to configure the axis.) Possible options include |style|, but also
+ |label in legend| and |label in data|. The latter two options are discussed
+ in Section~\ref{section-dv-labels-in}, the first option below.
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization
[scientific axes=clean,
@@ -254,13 +251,13 @@ data [set=cos, format=function] {
func y = cos(\value x r);
};
\end{codeexample}
+ %
\end{key}
-\begin{key}{/tikz/data visualization/visualizer
- options/style=\meta{options}}
- The \meta{options} given to this key should be normal \tikzname\
- options. They will be executed when the visualizer is used.
-
+\begin{key}{/tikz/data visualization/visualizer options/style=\meta{options}}
+ The \meta{options} given to this key should be normal \tikzname\ options.
+ They will be executed when the visualizer is used.
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization
[scientific axes=clean,
@@ -279,13 +276,12 @@ data [set=cos, format=function] {
};
\end{codeexample}
- When you have multiple visualizers in a single data visualization,
- you can use the |style| option with each visualizer to configure
- their different appearances as in the above example. However, it is
- usually much better (and easier) to use a style sheet, see
- Section~\ref{section-dv-style-sheets}.
-
-
+ When you have multiple visualizers in a single data visualization, you can
+ use the |style| option with each visualizer to configure their different
+ appearances as in the above example. However, it is usually much better
+ (and easier) to use a style sheet, see
+ Section~\ref{section-dv-style-sheets}.
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization
[scientific axes={clean, end labels},
@@ -314,28 +310,27 @@ data [set=cos 2, format=function] {
func y = cos(2*\value x r);
};
\end{codeexample}
+ %
\end{key}
-\begin{key}{/tikz/data visualization/visualizer options/ignore style
- sheets}
- This option, which should be passed to a visualizer after its
- creation before another visualizer is created, causes style sheets
- \emph{not} to apply to the visualizer (but the |style| option will
- still have an effect). This allows you to create visualizers that
- are used for special purposes and that do not ``take part'' in the
- usual styling. For instance, a visualizer might be used internally
- to depict a regression line, even though the regression line itself
- should not participate in the usual styling by, say, dashing or
- different coloring.
+\begin{key}{/tikz/data visualization/visualizer options/ignore style sheets}
+ This option, which should be passed to a visualizer after its creation
+ before another visualizer is created, causes style sheets \emph{not} to
+ apply to the visualizer (but the |style| option will still have an effect).
+ This allows you to create visualizers that are used for special purposes
+ and that do not ``take part'' in the usual styling. For instance, a
+ visualizer might be used internally to depict a regression line, even
+ though the regression line itself should not participate in the usual
+ styling by, say, dashing or different coloring.
\end{key}
-In addition to the options passed to a visualizer via |style|, the
-following also gets executed when a visualizer is used:
+In addition to the options passed to a visualizer via |style|, the following
+also gets executed when a visualizer is used:
\begin{stylekey}{/tikz/data visualization/every visualizer}
- This style is used with every visualizer. Note that it should
- contain normal \tikzname\ keys.
-
+ This style is used with every visualizer. Note that it should contain
+ normal \tikzname\ keys.
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization
[scientific axes=clean,
@@ -346,6 +341,7 @@ data [format=function] {
func y = sin(\value x r);
};
\end{codeexample}
+ %
\end{stylekey}
@@ -353,39 +349,39 @@ data [format=function] {
\subsubsection{Visualizing Data Points Using Lines}
-\begin{key}{/tikz/data visualizers/visualize as line=\meta{visualizer
- name} (default line)}
- Creates a new visualizer named \meta{visualizer name}. Basically,
- this visualizer connects all data points for which the
- |/data point/set| attribute equals \meta{visualizer name} by
- a line that is styled by the visualizer's style.
-
- In more detail, the following happens:
- \begin{enumerate}
- \item A new object is created (of class |plot handler visualizer|)
- that is configured to collect the canvas positions of all data
- points whose |set| attribute equals \meta{visualizer name}.
- \item During the end of the data visualization, \pgfname's plotting
- mechanism (see Section~\ref{section-plots}) is used to plot the
- stream of recorded data points.
-
- This means that, in principle, all of the plot handlers available
- in \tikzname\ could be used for the visualization (such as the
- |smooth| handler). However, some plot handlers such as, say, the
- |xcomb| are unsuitable as plot handlers since they do not support
- the advanced axis handling done by the data visualization
- engine. Because of this (and also for other reasons), you cannot
- set the plot handler directly, but must use one of the options
- like |straight line|, |smooth line| and others, documented in a
- moment.
- \item Additionally, plot marks can be drawn at the collected data
- points. Here, all of the options available to \tikzname\ for
- drawing plot marks are available. To configure them, all options
- offered by \tikzname\ for configuring marks are available such as
- |mark repeat|:
+\begin{key}{/tikz/data visualizers/visualize as line=\meta{visualizer name} (default line)}
+ Creates a new visualizer named \meta{visualizer name}. Basically, this
+ visualizer connects all data points for which the |/data point/set|
+ attribute equals \meta{visualizer name} by a line that is styled by the
+ visualizer's style.
+
+ In more detail, the following happens:
+ %
+ \begin{enumerate}
+ \item A new object is created (of class |plot handler visualizer|) that
+ is configured to collect the canvas positions of all data points
+ whose |set| attribute equals \meta{visualizer name}.
+ \item During the end of the data visualization, \pgfname's plotting
+ mechanism (see Section~\ref{section-plots}) is used to plot the
+ stream of recorded data points.
+
+ This means that, in principle, all of the plot handlers available
+ in \tikzname\ could be used for the visualization (such as the
+ |smooth| handler). However, some plot handlers such as, say, the
+ |xcomb| are unsuitable as plot handlers since they do not support
+ the advanced axis handling done by the data visualization engine.
+ Because of this (and also for other reasons), you cannot set the
+ plot handler directly, but must use one of the options like
+ |straight line|, |smooth line| and others, documented in a moment.
+ \item Additionally, plot marks can be drawn at the collected data
+ points. Here, all of the options available to \tikzname\ for
+ drawing plot marks are available. To configure them, all options
+ offered by \tikzname\ for configuring marks are available such as
+ |mark repeat|:
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization
- [scientific axes=clean,
+ [scientific axes=clean,
visualize as line=my data,
my data={style={mark=x, mark repeat=3}}]
data [format=function] {
@@ -393,26 +389,27 @@ data [format=function] {
func y = sin(\value x r);
};
\end{codeexample}
- \end{enumerate}
-
- The line visualizer also provides a method of dealing with gaps in a
- line. Take for instance the function $f(x) = \tan x$. When this
- function is plotted over the interval $[0,\pi]$, then the function
- will go to $\pm \infty$ at $\pi/2$. When we plot this, we might plot
- the function in the interval $[0,\frac{\pi}{2}-\epsilon]$ and then
- continue in the interval $[\frac{\pi}{2}+\epsilon,\pi]$. However, we
- do not want the point at coordinate $\bigl(\frac{\pi}{2}- \epsilon,
- \tan(\frac{\pi}{2}- \epsilon)\bigr)$ to be connected to the
- coordinate $\bigl(\frac{\pi}{2}+ \epsilon, \tan(\frac{\pi}{2}+
- \epsilon)\bigr)$ by a line. Rather, there should be a ``gap'' or a
- ``jump'' between these coordinates. To achieve this, the following
- key can be used:
- \begin{key}{/data point/outlier=\meta{value} (default true, initially \normalfont empty)}
- When this key is set to anything non-empty value, a visualizer
- will consider this data point to be an ``outlier.'' For a line
- visualizer this means that the point is not shown and that the
- current line ends at the previous data point and a new line starts
- at the next data point.
+ \end{enumerate}
+
+ The line visualizer also provides a method of dealing with gaps in a line.
+ Take for instance the function $f(x) = \tan x$. When this function is
+ plotted over the interval $[0,\pi]$, then the function will go to $\pm
+ \infty$ at $\pi/2$. When we plot this, we might plot the function in the
+ interval $[0,\frac{\pi}{2}-\epsilon]$ and then continue in the interval
+ $[\frac{\pi}{2}+\epsilon,\pi]$. However, we do not want the point at
+ coordinate $\bigl(\frac{\pi}{2}- \epsilon, \tan(\frac{\pi}{2}-
+ \epsilon)\bigr)$ to be connected to the coordinate $\bigl(\frac{\pi}{2}+
+ \epsilon, \tan(\frac{\pi}{2}+ \epsilon)\bigr)$ by a line. Rather, there
+ should be a ``gap'' or a ``jump'' between these coordinates. To achieve
+ this, the following key can be used:
+ %
+ \begin{key}{/data point/outlier=\meta{value} (default true, initially \normalfont empty)}
+ When this key is set to anything non-empty value, a visualizer will
+ consider this data point to be an ``outlier''. For a line visualizer
+ this means that the point is not shown and that the current line ends
+ at the previous data point and a new line starts at the next data
+ point.
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization
[scientific axes=clean, x axis={grid={major at=(pi/2)}},
@@ -427,19 +424,17 @@ data [format=function] {
func y = tan(\value x r);
};
\end{codeexample}
- \end{key}
+ \end{key}
\end{key}
-
-\begin{key}{/tikz/data visualizers/visualize as smooth line=\meta{visualizer
- name} (default line)}
- A shorthand |visualize as line=|\meta{visualizer name}
- followed \meta{visualizer name}|=smooth line|.
+\begin{key}{/tikz/data visualizers/visualize as smooth line=\meta{visualizer name} (default line)}
+ A shorthand |visualize as line=|\meta{visualizer name} followed
+ \meta{visualizer name}|=smooth line|.
\end{key}
-
\begin{key}{/tikz/data visualization/visualizer options/straight line}
- Causes the data points to be connected by straight lines.
+ Causes the data points to be connected by straight lines.
+ %
\begin{codeexample}[]
\tikz [scale=.55] \datavisualization
[scientific axes=clean, all axes={ticks=few},
@@ -450,10 +445,12 @@ data [format=function] {
func y = sin(\value t r);
};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/data visualization/visualizer options/straight cycle}
- Causes the data points to be connected by a polygon.
+ Causes the data points to be connected by a polygon.
+ %
\begin{codeexample}[]
\tikz [scale=.55] \datavisualization
[scientific axes=clean, all axes={ticks=few},
@@ -464,15 +461,17 @@ data [format=function] {
func y = sin(\value t r);
};
\end{codeexample}
+ %
\end{key}
-
+
\begin{key}{/tikz/data visualization/visualizer options/polygon}
- This is an alias for |straight cycle|.
+ This is an alias for |straight cycle|.
\end{key}
\begin{key}{/tikz/data visualization/visualizer options/smooth line}
- Causes the data points to be connected by a line that is smoothed
- at the joins:
+ Causes the data points to be connected by a line that is smoothed at the
+ joins:
+ %
\begin{codeexample}[]
\tikz [scale=.55] \datavisualization
[scientific axes=clean, all axes={ticks=few},
@@ -483,11 +482,13 @@ data [format=function] {
func y = sin(\value t r);
};
\end{codeexample}
+ %
\end{key}
-
+
\begin{key}{/tikz/data visualization/visualizer options/smooth cycle}
- Causes the data points to be connected by a circular line that is
- smoothed at the joins:
+ Causes the data points to be connected by a circular line that is smoothed
+ at the joins:
+ %
\begin{codeexample}[]
\tikz [scale=.55] \datavisualization
[scientific axes=clean, all axes={ticks=few},
@@ -498,12 +499,14 @@ data [format=function] {
func y = sin(\value t r);
};
\end{codeexample}
+ %
\end{key}
-
+
\begin{key}{/tikz/data visualization/visualizer options/gap line}
- This key causes the data points to be connected by lines that ``do
- not quite touch'' the data points. This is implemented by using the
- |\pgfplothandlergaplineto|, see Section~\ref{section-plot-gapped}.
+ This key causes the data points to be connected by lines that ``do not
+ quite touch'' the data points. This is implemented by using the
+ |\pgfplothandlergaplineto|, see Section~\ref{section-plot-gapped}.
+ %
\begin{codeexample}[]
\tikz [scale=.55] \datavisualization
[scientific axes=clean, all axes={ticks=few},
@@ -514,10 +517,12 @@ data [format=function] {
func y = sin(\value t r);
};
\end{codeexample}
+ %
\end{key}
-
+
\begin{key}{/tikz/data visualization/visualizer options/gap cycle}
- Like |gapped line|, only with a cycle:
+ Like |gapped line|, only with a cycle:
+ %
\begin{codeexample}[]
\tikz [scale=.55] \datavisualization
[scientific axes=clean, all axes={ticks=few},
@@ -528,11 +533,13 @@ data [format=function] {
func y = sin(\value t r);
};
\end{codeexample}
+ %
\end{key}
-
+
\begin{key}{/tikz/data visualization/visualizer options/no lines}
- Suppresses the line. This option only makes sense when the |mark|
- option is used.
+ Suppresses the line. This option only makes sense when the |mark| option is
+ used.
+ %
\begin{codeexample}[]
\tikz [scale=.55] \datavisualization
[scientific axes=clean, all axes={ticks=few},
@@ -543,122 +550,127 @@ data [format=function] {
func y = sin(\value t r);
};
\end{codeexample}
+ %
\end{key}
-
\subsubsection{Visualizing Data Points Using Marks}
-\begin{key}{/tikz/data visualizers/visualize as scatter=\meta{visualizer
- name} (default scatter)}
- A shorthand |visualize as line=|\meta{visualizer name}
- followed \meta{visualizer name}|=no lines| and setting
- the |style| of the visualizer so that is will use |mark=x| (plus
- some size adjustments) to draw marks at the data points.
+\begin{key}{/tikz/data visualizers/visualize as scatter=\meta{visualizer name} (default scatter)}
+ A shorthand |visualize as line=|\meta{visualizer name} followed
+ \meta{visualizer name}|=no lines| and setting the |style| of the visualizer
+ so that is will use |mark=x| (plus some size adjustments) to draw marks at
+ the data points.
+ %
\begin{codeexample}[width=7cm]
\tikz \datavisualization
- [scientific axes=clean,
+ [scientific axes=clean,
visualize as scatter]
data [format=function] {
var x : interval [0:pi] samples 10;
func y = sin(\value x r);
};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
\subsection{Advanced: Creating New Visualizers}
-Creating a new visualizer is a two-stage process that does,
-unfortunately, require in-depth knowledge of the data
-visualization backend:
+Creating a new visualizer is a two-stage process that does, unfortunately,
+require in-depth knowledge of the data visualization backend:
+%
\begin{enumerate}
-\item First, you need to create a new class using |\pgfooclass| whose
- instances react to the signal |visualize datapoint signal|. This requires
- detailed knowledge of the data visualization engine, see
- Section~\ref{section-dv-backend}.
-\item Second, you should provide keys on the \tikzname\ level for
- creating the necessary objects. These keys invoke the key
- |new visualizer| internally.
+ \item First, you need to create a new class using |\pgfooclass| whose
+ instances react to the signal |visualize datapoint signal|. This
+ requires detailed knowledge of the data visualization engine, see
+ Section~\ref{section-dv-backend}.
+ \item Second, you should provide keys on the \tikzname\ level for creating
+ the necessary objects. These keys invoke the key |new visualizer|
+ internally.
\end{enumerate}
-\begin{key}{/tikz/data visualization/new
- visualizer=\marg{name}\marg{options}\marg{legend entry options}}
- This key configures a new visualizer named \meta{name}. This entails
- the following actions:
- \begin{itemize}
- \item The key |/tikz/data visualization/|\meta{name} is
- created. As described earlier, this key can be used to pass
- for instance |style| options to the visualizer.
- \item The style key |/tikz/data visualization/visualizers/|\meta{name}|/styling|
- is created and made empty. This is the key in which the |style|
- key will store the options passed to the visualizer.
- \item The style key |/tikz/data visualization/visualizers/|\meta{name}|/label in legend options|
- is set to \meta{legend entry options}. These options are used to
- configure how the visualizer should be rendered in a legend, see
- Section~\ref{section-dv-legend-entries} for details.
- \item The key |/data point/set/|\meta{name} is set to a
- number that is increased for each visualizer in the current data
- visualization. This number is important for style sheets, see
- Section~\ref{section-dv-style-sheets}.
- \item The key |/data point/|\meta{name}|/execute at begin| is set to
- code that creates a |{scope}| that executes the following styles
- as options:
- \begin{enumerate}
- \item The \meta{options} passed to the |new visualizer| key.
- \item The |every visualizer| style.
- \item The styling from the currently active style sheets, see
- Section~\ref{section-dv-style-sheets}.
- \item The styling stored in the |styling| key mentioned above.
- \end{enumerate}
- \item The key |/data point/|\meta{name}|/execute at end| is set to
- code that will finish all paths that may have been created by the
- visualizer and closes the scope.
- \end{itemize}
-
- All of the above mean the following in practice:
- \begin{itemize}
- \item Inside a new |visualize as ...| key, you pass the name of
- the to-be-created to |new visualizer| as the first parameter and
- any special default styling setup of the visualizer as the second
- parameter.
- \item The new |visualize as ...| key should also create a visualizer
- object using |new object|.
- \item When this object finally is about to create the actual
- visualization, it should surround the code by invoking the code
- stored in the |execute at begin| and the |execute at end| keys of
- the visualizer.
- \end{itemize}
-
- Everything else is usually taken care of by the |new visualizer| key
- automatically.
+\begin{key}{/tikz/data visualization/new visualizer=\marg{name}\marg{options}\marg{legend entry options}}
+ This key configures a new visualizer named \meta{name}. This entails the
+ following actions:
+ %
+ \begin{itemize}
+ \item The key |/tikz/data visualization/|\meta{name} is created. As
+ described earlier, this key can be used to pass for instance
+ |style| options to the visualizer.
+ \item The style key
+ |/tikz/data visualization/visualizers/|\meta{name}|/styling| is
+ created and made empty. This is the key in which the |style| key
+ will store the options passed to the visualizer.
+ \item The style key
+ |/tikz/data visualization/visualizers/|\meta{name}|/label in legend options|
+ is set to \meta{legend entry options}. These options are used to
+ configure how the visualizer should be rendered in a legend, see
+ Section~\ref{section-dv-legend-entries} for details.
+ \item The key |/data point/set/|\meta{name} is set to a number that is
+ increased for each visualizer in the current data visualization.
+ This number is important for style sheets, see
+ Section~\ref{section-dv-style-sheets}.
+ \item The key |/data point/|\meta{name}|/execute at begin| is set to
+ code that creates a |{scope}| that executes the following styles as
+ options:
+ %
+ \begin{enumerate}
+ \item The \meta{options} passed to the |new visualizer| key.
+ \item The |every visualizer| style.
+ \item The styling from the currently active style sheets, see
+ Section~\ref{section-dv-style-sheets}.
+ \item The styling stored in the |styling| key mentioned above.
+ \end{enumerate}
+ %
+ \item The key |/data point/|\meta{name}|/execute at end| is set to code
+ that will finish all paths that may have been created by the
+ visualizer and closes the scope.
+ \end{itemize}
+
+ All of the above mean the following in practice:
+ %
+ \begin{itemize}
+ \item Inside a new |visualize as ...| key, you pass the name of the
+ to-be-created to |new visualizer| as the first parameter and any
+ special default styling setup of the visualizer as the second
+ parameter.
+ \item The new |visualize as ...| key should also create a visualizer
+ object using |new object|.
+ \item When this object finally is about to create the actual
+ visualization, it should surround the code by invoking the code
+ stored in the |execute at begin| and the |execute at end| keys of
+ the visualizer.
+ \end{itemize}
+
+ Everything else is usually taken care of by the |new visualizer| key
+ automatically.
\end{key}
+As an example, let us create a simple visualizer that creates a circle whose
+radius is dictated by the |radius| attribute. To keep things simple in this
+example, this attribute cannot be configured.
-As an example, let us create a simple visualizer that creates a
-circle whose radius is dictated by the |radius| attribute. To keep
-things simple in this example, this attribute cannot be configured.
-
-First, we need the visualizer class. For this example I have boiled it
-down to a minimum:
-
+First, we need the visualizer class. For this example I have boiled it down to
+a minimum:
+%
\begin{codeexample}[code only]
\pgfooclass{circle visualizer}
{
% Stores the name of the visualizer. This is needed for filtering and configuration
\attribute name;
-
+
% The constructor. Just setup the attribute.
\method circle visualizer(#1) { \pgfooset{name}{#1} }
-
+
% Connect to visualize signal.
\method default connects() {
\pgfoothis.get handle(\me)
\pgfkeysvalueof{/pgf/data visualization/obj}.connect(\me,visualize,visualize datapoint signal)
}
-
+
% This method is invoked for each data point. It checks whether the data point belongs to the correct
- % visualizer and, if so, calls the macro \dovisualization to do the actual visualization.
+ % visualizer and, if so, calls the macro \dovisualization to do the actual visualization.
\method visualize() {
\pgfdvfilterpassedtrue
\pgfdvnamedvisualizerfilter
@@ -669,9 +681,8 @@ down to a minimum:
}
\end{codeexample}
-The |\dovisualization| method must now do the correct
-visualization.
-
+The |\dovisualization| method must now do the correct visualization.
+%
\begin{codeexample}[code only]
\def\dovisualization{
\pgfkeysvalueof{/data point/\pgfoovalueof{name}/execute at begin}
@@ -682,7 +693,7 @@ visualization.
\end{codeexample}
Finally, we create a |visualize as| key:
-
+%
\begin{codeexample}[code only]
\tikzdatavisualizationset{
visualize as circle/.style={
@@ -704,25 +715,23 @@ Finally, we create a |visualize as| key:
Now, let's see how this works:
-
-\pgfooclass{circle visualizer}
-{
+\pgfooclass{circle visualizer} {
% Stores the name of the visualizer. This is needed for filtering
% and configuration
\attribute name;
-
+
% The constructor. Just setup the attribute.
\method circle visualizer(#1) { \pgfooset{name}{#1} }
-
+
% Connect to visualize signal.
\method default connects() {
\pgfoothis.get handle(\me)
\pgfkeysvalueof{/pgf/data visualization/obj}.connect(\me,visualize,visualize datapoint signal)
}
-
+
% This method is invoked for each data point. It checks whether the
% data point belongs to the correct visualizer and, if so, calls the
- % macro \dovisualization to do the actual visualization.
+ % macro \dovisualization to do the actual visualization.
\method visualize() {
\pgfdvfilterpassedtrue
\pgfdvnamedvisualizerfilter
@@ -756,7 +765,6 @@ Now, let's see how this works:
visualize as circle/.default=circle
}
-
\begin{codeexample}[width=7cm]
\tikz \datavisualization [
scientific axes=clean,
@@ -780,5 +788,5 @@ data [set=c] {
x, y, radius
3, 2, 3pt
2.5, 0.5, 4pt
-};
+};
\end{codeexample}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-algorithm-layer.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-algorithm-layer.tex
index 38bf29e058f..aa9fa817a92 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-algorithm-layer.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-algorithm-layer.tex
@@ -11,126 +11,119 @@
\section{The Algorithm Layer}
-
\label{section-gd-algorithm-layer}
\noindent{\emph{by Till Tantau}}
-\ifluatex\else This section of the manual can only be typeset using Lua\TeX.\expandafter\endinput\fi
+\ifluatex
+\else
+ This section of the manual can only be typeset using Lua\TeX.
+ \expandafter\endinput
+\fi
-\subsection{Overview}
-The present section is addressed at readers interested in implementing
-new graph drawing algorithms for the graph drawing system. Obviously,
-in order to do so, you need to have an algorithm in mind and also some
-programming skills; but fortunately only in the Lua programming
-language: Even though the graph drawing system was originally
-developed as an extension of \tikzname, is has been restructured so
-that the ``algorithm layer'' where you define algorithms is
-scrupulously separated from \tikzname. In particular, an algorithm
-declared and implemented on this layer can be used in with every ``display
-layers,'' see Section~\ref{section-gd-display-layer}, without change. Nevertheless, in
-the following we will use the \tikzname\ display layer and syntax in
-our examples.
-
-Normally, new graph drawing algorithms can and must be implemented in
-the Lua programming language, which is a small, easy-to-learn (and
-quite beautiful) language integrated into current versions of
-\TeX. However, as explained in Section~\ref{section-algorithms-in-c},
-you can also implement algorithms in C or C++ (and, possibly, in the
-future also in other languages), but this comes at a great cost
-concerning portability. In the present section, I assume that you are
-only interested in writing an algorithm using Lua.
-
-In the following, after a small ``hello world'' example of graph
-drawing and a discussion of technical details like
-how to name files so that \TeX\ will find them, we have a look at the
-main parts of the algorithm layer:
+\subsection{Overview}
+The present section is addressed at readers interested in implementing new
+graph drawing algorithms for the graph drawing system. Obviously, in order to
+do so, you need to have an algorithm in mind and also some programming skills;
+but fortunately only in the Lua programming language: Even though the graph
+drawing system was originally developed as an extension of \tikzname, is has
+been restructured so that the ``algorithm layer'' where you define algorithms
+is scrupulously separated from \tikzname. In particular, an algorithm declared
+and implemented on this layer can be used in with every ``display layers'', see
+Section~\ref{section-gd-display-layer}, without change. Nevertheless, in the
+following we will use the \tikzname\ display layer and syntax in our examples.
+
+Normally, new graph drawing algorithms can and must be implemented in the Lua
+programming language, which is a small, easy-to-learn (and quite beautiful)
+language integrated into current versions of \TeX. However, as explained in
+Section~\ref{section-algorithms-in-c}, you can also implement algorithms in C
+or C++ (and, possibly, in the future also in other languages), but this comes
+at a great cost concerning portability. In the present section, I assume that
+you are only interested in writing an algorithm using Lua.
+
+In the following, after a small ``hello world'' example of graph drawing and a
+discussion of technical details like how to name files so that \TeX\ will find
+them, we have a look at the main parts of the algorithm layer:
+%
\begin{itemize}
-\item Section~\ref{section-gd-namespaces} gives and overview of the
- available namespaces and also of naming conventions used in the
- graph drawing system.
-\item Section~\ref{section-gd-gd-scope} explores what graph
- drawing scopes ``look like on the algorithm layer.'' As the graph
- of a graph drawing scope is being parsed on the display layer, a lot
- of information is gathered: The nodes and edges of the graph are
- identified and the
- object-oriented model is built, but other information is also
- collected. For instance, a sequence of \emph{events} is created
- during the parsing process. As another example, numerous kinds of
- \emph{collections} may be identified by the parser. The parsed graph
- together with the event sequence and the collections are all
- gathered in a single table, called the \emph{scope table} of the
- current graph drawing scope. Algorithms can access this table to
- retrieve information that goes beyond the ``pure'' graph model.
-
- One entry in this table is of particular importance: The
- \emph{syntactic digraph.} While most graph drawing
- algorithms are not really interested in the ``details'' of how a
- graph was specified, for some algorithms it makes a big difference
- whether you write |a -> b| or |b <- a| in your specification of the
- graph. These algorithms can access the ``fine details'' of how the
- input graph was specified through the syntactic digraph; all other
- algorithms can access their |digraph| or |ugraph| fields and do not
- have to worry about the difference between |a -> b| and |b <- a|.
-\item Section~\ref{section-gd-models} explains the object-oriented
- model of graphs used throughout the graph drawing system. Graph
- drawing algorithms do not get the ``raw'' specification used by the
- user to specify a graph (like |{a -> {b,c}}| in the |graph|
- syntax). Instead, what a graph drawing algorithm sees is ``just'' a
- graph object that provides methods for accessing the vertices and
- arcs.
-\item Section~\ref{section-gd-transformations} explains how the
- information in the graph drawing scope is processed. One might
- expect that we simply run the algorithm selected by the user;
- however, things are more involved in practice. When the layout of a
- graph needs to be computed, only very few algorithms will actually
- be able to compute positions for the nodes of \emph{every}
- graph. For instance, most algorithms implicitly assume that the
- input graph is connected; algorithms for computing layouts for trees
- assume that the input is, well, a tree; and so on. For this reason,
- graph drawing algorithms will not actually need the original input
- graph as their input, but some \emph{transformed} version of
- it. Indeed, \emph{all} graph drawing algorithms are treated as graph
- transformations by the graph drawing engine.
-
- This section explains how transformations are chosen and which
- transformations are applied by default.
-\item Section~\ref{section-gd-interface-to-algorithms} documents the
- interface-to-algorithm class. This interface encapsulates all that
- an algorithm ``sees'' of the graph drawing system (apart from the
- classes in |model| and |lib|).
-\item Section~\ref{section-gd-examples} provides a number of complete
- examples that show how graph drawing algorithms can, actually, be
- implemented.
-\item Section~\ref{section-gd-libs} documents the different
- libraries functions that come with the graph drawing engine. For
- instance, there are library functions for computing the (path)
- distance of nodes in a graph; a parameter that is needed by some
- algorithms.
+ \item Section~\ref{section-gd-namespaces} gives and overview of the
+ available namespaces and also of naming conventions used in the graph
+ drawing system.
+ \item Section~\ref{section-gd-gd-scope} explores what graph drawing scopes
+ ``look like on the algorithm layer''. As the graph of a graph drawing
+ scope is being parsed on the display layer, a lot of information is
+ gathered: The nodes and edges of the graph are identified and the
+ object-oriented model is built, but other information is also
+ collected. For instance, a sequence of \emph{events} is created during
+ the parsing process. As another example, numerous kinds of
+ \emph{collections} may be identified by the parser. The parsed graph
+ together with the event sequence and the collections are all gathered
+ in a single table, called the \emph{scope table} of the current graph
+ drawing scope. Algorithms can access this table to retrieve information
+ that goes beyond the ``pure'' graph model.
+
+ One entry in this table is of particular importance: The
+ \emph{syntactic digraph.} While most graph drawing algorithms are not
+ really interested in the ``details'' of how a graph was specified, for
+ some algorithms it makes a big difference whether you write |a -> b| or
+ |b <- a| in your specification of the graph. These algorithms can
+ access the ``fine details'' of how the input graph was specified
+ through the syntactic digraph; all other algorithms can access their
+ |digraph| or |ugraph| fields and do not have to worry about the
+ difference between |a -> b| and |b <- a|.
+ \item Section~\ref{section-gd-models} explains the object-oriented model of
+ graphs used throughout the graph drawing system. Graph drawing
+ algorithms do not get the ``raw'' specification used by the user to
+ specify a graph (like |{a -> {b,c}}| in the |graph| syntax). Instead,
+ what a graph drawing algorithm sees is ``just'' a graph object that
+ provides methods for accessing the vertices and arcs.
+ \item Section~\ref{section-gd-transformations} explains how the information
+ in the graph drawing scope is processed. One might expect that we
+ simply run the algorithm selected by the user; however, things are more
+ involved in practice. When the layout of a graph needs to be computed,
+ only very few algorithms will actually be able to compute positions for
+ the nodes of \emph{every} graph. For instance, most algorithms
+ implicitly assume that the input graph is connected; algorithms for
+ computing layouts for trees assume that the input is, well, a tree; and
+ so on. For this reason, graph drawing algorithms will not actually need
+ the original input graph as their input, but some \emph{transformed}
+ version of it. Indeed, \emph{all} graph drawing algorithms are treated
+ as graph transformations by the graph drawing engine.
+
+ This section explains how transformations are chosen and which
+ transformations are applied by default.
+ \item Section~\ref{section-gd-interface-to-algorithms} documents the
+ interface-to-algorithm class. This interface encapsulates all that an
+ algorithm ``sees'' of the graph drawing system (apart from the classes
+ in |model| and |lib|).
+ \item Section~\ref{section-gd-examples} provides a number of complete
+ examples that show how graph drawing algorithms can, actually, be
+ implemented.
+ \item Section~\ref{section-gd-libs} documents the different libraries
+ functions that come with the graph drawing engine. For instance, there
+ are library functions for computing the (path) distance of nodes in a
+ graph; a parameter that is needed by some algorithms.
\end{itemize}
-
\subsection{Getting Started}
-In this section, a ``hello world'' example of a graph
-drawing algorithm is given, followed by an overview of the
-organization of the whole engine.
+In this section, a ``hello world'' example of a graph drawing algorithm is
+given, followed by an overview of the organization of the whole engine.
\subsubsection{The Hello World of Graph Drawing}
-Let us start our tour of the algorithm layer with a ``hello world''
-version of graph drawing: An algorithm that simply places all nodes of
-a graph in a circle of a fixed radius. Naturally, this is not a
-particularly impressive or intelligent graph drawing algorithm; but
-neither is the classical ``hello world''$\dots$\ Here is a minimal
-version of the needed code (this is not the typical way of formulating
-the code, but it is the shortest; we will have a look at the more
-standard and verbose way in a moment):
-
+Let us start our tour of the algorithm layer with a ``hello world'' version of
+graph drawing: An algorithm that simply places all nodes of a graph in a circle
+of a fixed radius. Naturally, this is not a particularly impressive or
+intelligent graph drawing algorithm; but neither is the classical ``hello
+world''$\dots$\ Here is a minimal version of the needed code (this is not the
+typical way of formulating the code, but it is the shortest; we will have a
+look at the more standard and verbose way in a moment):
+%
\begin{codeexample}[code only, tikz syntax=false]
pgf.gd.interface.InterfaceToAlgorithms.declare {
key = "very simple demo layout",
@@ -162,38 +155,36 @@ pgf.gd.interface.InterfaceToAlgorithms.declare {
}
}
-This code \emph {declares} a new algorithm (|very simple demo layout|)
-and includes an implementation of the algorithm (through the |run|
-field of the |algorithm| field). When the |run| method is called, the
-|self| parameter will contain the to-be-drawn graph in its |ugraph|
-field. It is now the job of the code to modify the positions of the
-vertices in this graph (in the example, this is done by assigning
-values to |vertex.pos.x| and |vertex.pos.y|).
-
-In order to actually \emph{use} the algorithm, the above code first
-needs to be executed somehow. For \tikzname, one can just call
-|\directlua| on it or put it in a file and then use |\directlua| plus
-|require| (a better alternative) or you put it in a file like
-|simpledemo.lua| and use |\usegdlibrary{simpledemo}| (undoubtedly the
-``best'' way). For another display layer, like a graphical editor, the
-code could also be executed through the use of |require|.
-
-Executing the code ``just'' declares the algorithm, this is what the
-|declare| function does. Inside some internal tables, the algorithm
-layer will store the fact that a |very simple demo layout| is now
-available. The algorithm layer will also communicate with the display
-layer through the binding layer to advertise this fact to the
-``user.'' In the case of \tikzname, this means that the option key
-|very simple demo layout| becomes available at this point and we can
-use it like this:
-
+This code \emph {declares} a new algorithm (|very simple demo layout|) and
+includes an implementation of the algorithm (through the |run| field of the
+|algorithm| field). When the |run| method is called, the |self| parameter will
+contain the to-be-drawn graph in its |ugraph| field. It is now the job of the
+code to modify the positions of the vertices in this graph (in the example,
+this is done by assigning values to |vertex.pos.x| and |vertex.pos.y|).
+
+In order to actually \emph{use} the algorithm, the above code first needs to be
+executed somehow. For \tikzname, one can just call |\directlua| on it or put it
+in a file and then use |\directlua| plus |require| (a better alternative) or
+you put it in a file like |simpledemo.lua| and use |\usegdlibrary{simpledemo}|
+(undoubtedly the ``best'' way). For another display layer, like a graphical
+editor, the code could also be executed through the use of |require|.
+
+Executing the code ``just'' declares the algorithm, this is what the |declare|
+function does. Inside some internal tables, the algorithm layer will store the
+fact that a |very simple demo layout| is now available. The algorithm layer
+will also communicate with the display layer through the binding layer to
+advertise this fact to the ``user''. In the case of \tikzname, this means that
+the option key |very simple demo layout| becomes available at this point and we
+can use it like this:
+%
\begin{codeexample}[]
\tikz [very simple demo layout]
\graph { f -> c -> e -> a -> {b -> {c, d, f}, e -> b}};
\end{codeexample}
-It turns out, that our little algorithm is already more powerful than
-one might expect. Consider the following example:
+It turns out, that our little algorithm is already more powerful than one might
+expect. Consider the following example:
+%
\begin{codeexample}[]
\tikz [very simple demo layout, componentwise]
\graph {
@@ -202,53 +193,51 @@ one might expect. Consider the following example:
};
\end{codeexample}
-Note that, in our algorithm, we ``just'' put all nodes on a circle
-around the origin. Nevertheless, the graph gets decomposed into two
-connected components, the components are rotated so that the edge from
-node |2| to node |3| goes from left to right and the edge from |b| to
-|c| goes up at an angle of $45^\circ$, and the components are placed
-next to each other so that some spacing is achieved.
+Note that, in our algorithm, we ``just'' put all nodes on a circle around the
+origin. Nevertheless, the graph gets decomposed into two connected components,
+the components are rotated so that the edge from node |2| to node |3| goes from
+left to right and the edge from |b| to |c| goes up at an angle of $45^\circ$,
+and the components are placed next to each other so that some spacing is
+achieved.
-The ``magic'' that achieves all this behind the scenes is called
-``graph transformations.'' They will heavily pre- and postprocess the
-input and output of graph drawing algorithms to achieve the above
-results.
+The ``magic'' that achieves all this behind the scenes is called ``graph
+transformations''. They will heavily pre- and postprocess the input and output
+of graph drawing algorithms to achieve the above results.
-Naturally, some algorithms may not wish their inputs and/or
-outputs to be ``tampered'' with. An algorithm can easily configure
-which transformations should be applied, by passing appropriate options
-to |declare|.
+Naturally, some algorithms may not wish their inputs and/or outputs to be
+``tampered'' with. An algorithm can easily configure which transformations
+should be applied, by passing appropriate options to |declare|.
\subsubsection{Declaring an Algorithm}
-Let us now have a look at how one would ``really'' implement the
-example algorithm. First of all, we place our algorithm in a
-separate file called, say, |ExampleLayout.lua|. This way, by putting
-it in a separate file, all display layers can easily install the
-algorithm at runtime by saying |require "ExampleLayout"|.
-
-Next, the |declare| function is needed quite often, so it makes sense
-to create a short local name for it:
+Let us now have a look at how one would ``really'' implement the example
+algorithm. First of all, we place our algorithm in a separate file called, say,
+|ExampleLayout.lua|. This way, by putting it in a separate file, all display
+layers can easily install the algorithm at runtime by saying
+|require "ExampleLayout"|.
+Next, the |declare| function is needed quite often, so it makes sense to create
+a short local name for it:
+%
\begin{codeexample}[code only, tikz syntax=false]
-- This is the file ExampleLayout.lua
-local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
+local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
\end{codeexample}
-The |declare| function is the work-horse of the algorithm layer. It
-takes a table that contains at least a |key| field, which must be a
-unique string, and some other fields that specify in more detail what
-kind of key is declared. Once declared through a call of |declare|,
-the ``key'' can be used on the display layer.
-
-For declaring an algorithm, the table passed to |declare| must contain
-a field |algorithm|. This field, in turn, must (normally) be set to a
-table that will become the algorithm class. In the above example, our
-algorithm was so simple that we could place the whole definition of
-the class inside the call of |declare|, but normally the class is
-defined in more detail after the call to |declare|:
-
+The |declare| function is the work-horse of the algorithm layer. It takes a
+table that contains at least a |key| field, which must be a unique string, and
+some other fields that specify in more detail what kind of key is declared.
+Once declared through a call of |declare|, the ``key'' can be used on the
+display layer.
+
+For declaring an algorithm, the table passed to |declare| must contain a field
+|algorithm|. This field, in turn, must (normally) be set to a table that will
+become the algorithm class. In the above example, our algorithm was so simple
+that we could place the whole definition of the class inside the call of
+|declare|, but normally the class is defined in more detail after the call to
+|declare|:
+%
\begin{codeexample}[code only, tikz syntax=false]
local ExampleClass = {} -- A local variable holding the class table
@@ -263,89 +252,84 @@ function ExampleClass:run ()
end
\end{codeexample}
-The effect of the |declare| will be that the table stored in
-|ExampleClass| is setup to form a class in the sense of
-object-oriented programming. In particular, a static |new| function
-is installed.
+The effect of the |declare| will be that the table stored in |ExampleClass| is
+setup to form a class in the sense of object-oriented programming. In
+particular, a static |new| function is installed.
-Now, whenever the user uses the key |very simple demo layout| on a
-graph, at some point the graph drawing engine will create a new
-instance of the |ExampleClass| using |new| and will then call the
-|run| method of this class. The class can have any number of other
-methods, but |new| and |run| are the only ones directly called by the
-graph drawing system.
+Now, whenever the user uses the key |very simple demo layout| on a graph, at
+some point the graph drawing engine will create a new instance of the
+|ExampleClass| using |new| and will then call the |run| method of this class.
+The class can have any number of other methods, but |new| and |run| are the
+only ones directly called by the graph drawing system.
\subsubsection{The Run Method}
-The |run| method of an algorithm classes lies at the heart of any
-graph drawing algorithm. This method will be called whenever a graph
-needs to be laid out. Upon this call, the |self| object will have
-some important fields set:
+The |run| method of an algorithm classes lies at the heart of any graph drawing
+algorithm. This method will be called whenever a graph needs to be laid out.
+Upon this call, the |self| object will have some important fields set:
+%
\begin{itemize}
-\item |ugraph| This stands for ``undirected graph'' and is the
- ``undirected'' version of the to-be-laid out graph. In this graph,
- whenever there is an arc between $u$ and $v$, there is also an arc
- between $v$ and $u$. It is obtained by considering the syntactic
- digraph and then ``forgetting'' about the actual direction of the
- edges.
-
- When you have set certain |preconditions| in your algorithm class,
- like |connected=true|, the |ugraph| will satisfy these
- conditions. In particular, the |ugraph| typically will not be the
- underlying undirected graph of the complete syntactic digraph, but
- rather of some part of it. The use of (sub)layouts will also modify
- the syntactic digraph is fancy ways.
-
- Refer to this graph whenever your algorithm is ``most comfortable''
- with an undirected graph, as is the case for instance for most
- force-base algorithms.
-\item |digraph| This stands for ``directed graph'' and is the
- ``semantically directed'' version of the to-be-laid out
- graph. Basically, when happens is that reverse edges in the
- syntactic digraph (an edge like |b <- a|) will yield an |Arc| from
- |a| to |b| in the |digraph| while they yield a |b| to |a| arc and
- edge in the syntactic digraph. Also, undirected edges like |a -- b|
- are replaced by directed edges in both directions between the
- vertices.
-\item |scope| The graph drawing scope.
-\item |layout| The layout object for this graph. This is a collection
- of kind |layout|.
+ \item |ugraph| This stands for ``undirected graph'' and is the
+ ``undirected'' version of the to-be-laid out graph. In this graph,
+ whenever there is an arc between $u$ and $v$, there is also an arc
+ between $v$ and $u$. It is obtained by considering the syntactic
+ digraph and then ``forgetting'' about the actual direction of the
+ edges.
+
+ When you have set certain |preconditions| in your algorithm class, like
+ |connected=true|, the |ugraph| will satisfy these conditions. In
+ particular, the |ugraph| typically will not be the underlying
+ undirected graph of the complete syntactic digraph, but rather of some
+ part of it. The use of (sub)layouts will also modify the syntactic
+ digraph is fancy ways.
+
+ Refer to this graph whenever your algorithm is ``most comfortable''
+ with an undirected graph, as is the case for instance for most
+ force-base algorithms.
+ \item |digraph| This stands for ``directed graph'' and is the
+ ``semantically directed'' version of the to-be-laid out graph.
+ Basically, when happens is that reverse edges in the syntactic digraph
+ (an edge like |b <- a|) will yield an |Arc| from |a| to |b| in the
+ |digraph| while they yield a |b| to |a| arc and edge in the syntactic
+ digraph. Also, undirected edges like |a -- b| are replaced by directed
+ edges in both directions between the vertices.
+ \item |scope| The graph drawing scope.
+ \item |layout| The layout object for this graph. This is a collection of
+ kind |layout|.
\end{itemize}
\subsubsection{Loading Algorithms on Demand}
-In order to use the |very simple demo layout| on the display layer,
-|declare| must have been called for this key. However, we just saw
-that the |declare| function takes the actual class table as parameter
-and, thus, whenever an algorithm is declared, it is also completely
-loaded and compiled at this point.
-
-This is not always desirable. A user may wish to include a number of
-libraries in order to declare a large number of potentially useful
-algorithms, but will not actually use all of them. Indeed, at least
-for large, complex algorithms, it is preferable that the algorithm's
-code is loaded only when the algorithm is used for the first time.
-
-Such a ``loading of algorithms on demand'' is supported through the
-option of setting the |algorithm| field in a |declare| to a
-string. This string must now be the file name of a Lua file that
-contains the code of the actual algorithm. When the key is actually
-used for the first time, this file will be loaded. It must return a
-table that will be plugged into the |algorithm| field; so subsequent
-usages of the key will not load the file again.
-
-The net effect of all this is that you can place implementations of
-algorithms in files separate from interface files that just contain
-the |declare| commands for these algorithms. You will typically do
-this only for rather large algorithms.
+In order to use the |very simple demo layout| on the display layer, |declare|
+must have been called for this key. However, we just saw that the |declare|
+function takes the actual class table as parameter and, thus, whenever an
+algorithm is declared, it is also completely loaded and compiled at this point.
+
+This is not always desirable. A user may wish to include a number of libraries
+in order to declare a large number of potentially useful algorithms, but will
+not actually use all of them. Indeed, at least for large, complex algorithms,
+it is preferable that the algorithm's code is loaded only when the algorithm is
+used for the first time.
+
+Such a ``loading of algorithms on demand'' is supported through the option of
+setting the |algorithm| field in a |declare| to a string. This string must now
+be the file name of a Lua file that contains the code of the actual algorithm.
+When the key is actually used for the first time, this file will be loaded. It
+must return a table that will be plugged into the |algorithm| field; so
+subsequent usages of the key will not load the file again.
+
+The net effect of all this is that you can place implementations of algorithms
+in files separate from interface files that just contain the |declare| commands
+for these algorithms. You will typically do this only for rather large
+algorithms.
For our example, the code would look like this:
-
+%
\begin{codeexample}[code only, tikz syntax=false]
-- File ExampleLayout.lua
-local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
+local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
declare {
key = "very simple demo layout",
algorithm = "ExampleLayoutImplementation"
@@ -365,17 +349,16 @@ return ExampleClass
\subsubsection{Declaring Options}
-Let us now make our example algorithm a bit more ``configurable''. For
-this, we use |declare| once more, but instead of the |algorithm|
-field, we use a |type| field. This tells the display layer that the
-key is not used to select an algorithm, but to configure ``something''
-about the graph or about nodes or edges.
-
-In our example, we may wish to configure the radius of the graph. So,
-we introduce a |radius| key (actually, this key already exists, so we
-would not need to declare it, but let us do so anyway for example
-purposes):
+Let us now make our example algorithm a bit more ``configurable''. For this, we
+use |declare| once more, but instead of the |algorithm| field, we use a |type|
+field. This tells the display layer that the key is not used to select an
+algorithm, but to configure ``something'' about the graph or about nodes or
+edges.
+In our example, we may wish to configure the radius of the graph. So, we
+introduce a |radius| key (actually, this key already exists, so we would not
+need to declare it, but let us do so anyway for example purposes):
+%
\begin{codeexample}[code only, tikz syntax=false]
declare {
key = "radius",
@@ -384,52 +367,48 @@ declare {
}
\end{codeexample}
-This tells the display layer that there is now an option called
-|radius|, that users set it to some ``length'', and that if it is not
-set at all, then the 25pt should be used.
-
-To access what the user has specified for this key, an algorithm can
-access the |options| field of a graph, vertex, or arc at the
-key's name:
+This tells the display layer that there is now an option called |radius|, that
+users set it to some ``length'', and that if it is not set at all, then the
+25pt should be used.
+To access what the user has specified for this key, an algorithm can access the
+|options| field of a graph, vertex, or arc at the key's name:
+%
\begin{codeexample}[code only, tikz syntax=false]
vertex.pos.x = math.cos(i * alpha) * vertex.options.radius
vertex.pos.y = math.sin(i * alpha) * vertex.options.radius
\end{codeexample}
-
\subsubsection{Adding Inline Documentation}
-You should always document the keys you |declare|. For this, the
-|declare| function allows you to add three fields to its argument
-table:
+You should always document the keys you |declare|. For this, the |declare|
+function allows you to add three fields to its argument table:
+%
\begin{itemize}
-\item |summary| This should be a string that succinctly summarizes the
- effect this key has. The idea is that this text will be shown as a
- ``tooltip'' in a graphical editor or will be printed out by a
- command line tool when a user requests help about the key.
- You can profit from using Lua's |[[| and |]]| syntax for specifying
- multi-line strings.
-
- Also, when the file containing the key is parsed for
- this manual, this text will be shown.
-\item |documentation| When present, this field contains a more
- extensive documentation of the key. It will also be shown in this
- manual, but typically not as a tool tip.
-\item |examples| This should either be a single string or an array of
- strings. Each string should be an example demonstrating how the key
- is used in \tikzname. They will all be included in the manual, each
- surrounded by a |codeexample| environment.
+ \item |summary| This should be a string that succinctly summarizes the
+ effect this key has. The idea is that this text will be shown as a
+ ``tooltip'' in a graphical editor or will be printed out by a command
+ line tool when a user requests help about the key. You can profit from
+ using Lua's |[[| and |]]| syntax for specifying multi-line strings.
+
+ Also, when the file containing the key is parsed for this manual, this
+ text will be shown.
+ \item |documentation| When present, this field contains a more extensive
+ documentation of the key. It will also be shown in this manual, but
+ typically not as a tool tip.
+ \item |examples| This should either be a single string or an array of
+ strings. Each string should be an example demonstrating how the key is
+ used in \tikzname. They will all be included in the manual, each
+ surrounded by a |codeexample| environment.
\end{itemize}
-Let us augment our |radius| key with some documentation. The three
-dashes before the |declare| are only needed when the declaration is
-part of this manual and they will trigger an inclusion of the key in
-the manual.
-
+Let us augment our |radius| key with some documentation. The three dashes
+before the |declare| are only needed when the declaration is part of this
+manual and they will trigger an inclusion of the key in the manual.
+%
\begin{codeexample}[code only, tikz syntax=false]
----
+---
declare {
key = "radius",
type = "length",
@@ -447,13 +426,11 @@ declare {
}
\end{codeexample}
-As a courtesy, all of the strings given in the documentation can start
-and end with quotation marks, which will be removed. (This helps
-syntax highlighting with editors that do not recognize the |[[| to |]]|
-syntax.) Also, the indentation of the strings is removed (we compute
-the minimum number of leading spaces on any line and remove this many
-spaces from all lines).
-
+As a courtesy, all of the strings given in the documentation can start and end
+with quotation marks, which will be removed. (This helps syntax highlighting
+with editors that do not recognize the |[[| to |]]| syntax.) Also, the
+indentation of the strings is removed (we compute the minimum number of leading
+spaces on any line and remove this many spaces from all lines).
\subsubsection{Adding External Documentation}
@@ -461,30 +438,28 @@ spaces from all lines).
As an alternative to inlining documentation, you can also store the
documentation of keys in a separate file that is loaded only when the
-documentation is actually accessed. Since this happens only rarely
-(for instance, not at all, when \tikzname\ is run, except for this
-manual), this will save time and space. Also, for C code, it is
-impractical to store multi-line documentation strings directly in the C
-file.
+documentation is actually accessed. Since this happens only rarely (for
+instance, not at all, when \tikzname\ is run, except for this manual), this
+will save time and space. Also, for C code, it is impractical to store
+multi-line documentation strings directly in the C file.
In order to store documentation externally, instead of the |summary|,
-|documentation|, and |examples| keys, you provide the key
-|documentation_in|. The |documentation_in| key must be set
-to a string that is input using |require|.
+|documentation|, and |examples| keys, you provide the key |documentation_in|.
+The |documentation_in| key must be set to a string that is input using
+|require|.
In detail, when someone tries to access the |summary|, |documentation|, or
-|examples| field of a key and these keys are not (yet) defined, the
-system checks whether the |documentation_in| key is set. If so, we
-apply |require| to the string stored in this field. The file loaded in
-this way can now setup the missing fields of the current key and,
-typically, also of all other keys defined in the same file as the
-current key. For this purpose, it is advisable to use the |pgf.gd.doc|
-class:
+|examples| field of a key and these keys are not (yet) defined, the system
+checks whether the |documentation_in| key is set. If so, we apply |require| to
+the string stored in this field. The file loaded in this way can now setup the
+missing fields of the current key and, typically, also of all other keys
+defined in the same file as the current key. For this purpose, it is advisable
+to use the |pgf.gd.doc| class:
\includeluadocumentationof{pgf.gd.doc}
As a longer example, consider the following declarations:
-
+%
\begin{codeexample}[code only, tikz syntax=false]
---
declare {
@@ -493,7 +468,7 @@ declare {
documentation_in = "documentation_file"
}
----
+---
declare {
key = "radius",
type = "length",
@@ -503,7 +478,7 @@ declare {
\end{codeexample}
The file |documentation_file.lua| would look like this:
-
+%
\begin{codeexample}[code only, tikz syntax=false]
-- File documentation_file.lua
local key = require 'pgf.gd.doc'.key
@@ -529,300 +504,295 @@ example
\end{codeexample}
-
-
\subsection{Namespaces and File Names}
-
\label{section-gd-namespaces}
\subsubsection{Namespaces}
All parts of the graph drawing library reside in the Lua ``namespace''
|pgf.gd|, which is itself a ``sub-namespace'' of |pgf|. For your own
-algorithms, you are free to place them in whatever namespace you like;
-only for the official distribution of \pgfname\ everything has been
-put into the correct namespace.
-
-Let us now have a more detailed look at these namespaces. A namespace
-is just a Lua table, and sub-namespaces are just subtables of
-namespace tables. Following the Java convention, namespaces are in
-lowercase letters. The following namespaces are part of the core of
-the graph drawing engine:
+algorithms, you are free to place them in whatever namespace you like; only for
+the official distribution of \pgfname\ everything has been put into the correct
+namespace.
+
+Let us now have a more detailed look at these namespaces. A namespace is just a
+Lua table, and sub-namespaces are just subtables of namespace tables. Following
+the Java convention, namespaces are in lowercase letters. The following
+namespaces are part of the core of the graph drawing engine:
+%
\begin{itemize}
-\item |pgf| This namespace is the main namespace of \pgfname. Other
- parts of \pgfname\ and \tikzname\ that also employ Lua should put an
- entry into this table. Since, currently, only the graph drawing
- engine adheres to this rule, this namespace is declared inside the
- graph drawing directory, but this will change.
-
- The |pgf| table is the \emph{only} entry into the global table of
- Lua generated by the graph drawing engine (or, \pgfname, for that
- matter). If you intend to extend the graph drawing engine, do not
- even \emph{think} of polluting the global namespace. You will be
- fined.
-\item |pgf.gd| This namespace is the main namespace of the graph drawing
- engine, including the object-oriented models of graphs and the
- layout pipeline. Algorithms that are part of the
- distribution are also inside this namespace, but if you write your
- own algorithms you do not need place them inside this
- namespace. (Indeed, you probably should not before they are made
- part of the official distribution.)
-\item |pgf.gd.interface| This namespace handles, on the one hand, the
- communication between the algorithm layer and the binding layer and,
- on the other hand, the communication between the display layer
- (\tikzname) and the binding layer.
-\item |pgf.gd.binding| So-called ``bindings'' between display layers
- and the graph drawing system reside in this namespace.
-\item |pgf.gd.lib| Numerous useful classes that ``make an algorithm's
- your life easier'' are collected in this namespace. Examples are a
- class for decomposing a graph into connected components or a class
- for computing the ideal distance between two sibling nodes in a
- tree, taking all sorts of rotations and separation parameters into
- account.
-\item |pgf.gd.model| This namespace contains all Lua classes that are
- part of the object-oriented model of graphs employed
- throughout the graph drawing engine. For readers familiar with the
- model--view--controller pattern: This is the namespace containing
- the model-part of this pattern.
-\item |pgf.gd.control| This namespace contains the ``control logic''
- of the graph drawing system. It will transform graphs according to
- rules, disassemble layouts and sublayouts and will call the
- appropriate algorithms. For readers still familiar with the
- model--view--controller pattern: This is the namespace containing
- the control-part of this pattern.
-\item |pgf.gd.trees| This namespace contains classes that are useful
- for dealing with graphs that are trees. In particular, it contains a
- class for computing a spanning tree of an arbitrary connected graph;
- an operation that is an important preprocessing step for many
- algorithms.
-
- In addition to providing ``utility functions for trees,'' the
- namespace \emph{also} includes actual algorithms for computing graph
- layouts like |pgf.gd.trees.ReingoldTilford1981|. It may seem to be a
- bit of an ``impurity'' that a namespace mixes utility classes and
- ``real'' algorithms, but experience has shown that it is better to
- keep things together in this way.
-
- Concluding the analogy to the model--view--controller pattern, a
- graph drawing algorithm is, in a loose sense, the ``view'' part of
- the pattern.
-\item |pgf.gd.layered| This namespace provides classes and functions
- for ``layered'' layouts; the Sugiyama layout method being the most
- well-known one. Again, the namespace contains both algorithms to be
- used by a user and utility functions.
-\item |pgf.gd.force| Collects force-based algorithms and, again, also
- utility functions and classes.
-\item |pgf.gd.examples| Contains some example algorithms. They are
- \emph{not} intended to be used directly, rather they should serve as
- inspirations for readers wishing to implement their own algorithms.
+ \item |pgf| This namespace is the main namespace of \pgfname. Other parts
+ of \pgfname\ and \tikzname\ that also employ Lua should put an entry
+ into this table. Since, currently, only the graph drawing engine
+ adheres to this rule, this namespace is declared inside the graph
+ drawing directory, but this will change.
+
+ The |pgf| table is the \emph{only} entry into the global table of Lua
+ generated by the graph drawing engine (or, \pgfname, for that matter).
+ If you intend to extend the graph drawing engine, do not even
+ \emph{think} of polluting the global namespace. You will be fined.
+ \item |pgf.gd| This namespace is the main namespace of the graph drawing
+ engine, including the object-oriented models of graphs and the layout
+ pipeline. Algorithms that are part of the distribution are also inside
+ this namespace, but if you write your own algorithms you do not need
+ place them inside this namespace. (Indeed, you probably should not
+ before they are made part of the official distribution.)
+ \item |pgf.gd.interface| This namespace handles, on the one hand, the
+ communication between the algorithm layer and the binding layer and, on
+ the other hand, the communication between the display layer (\tikzname)
+ and the binding layer.
+ \item |pgf.gd.binding| So-called ``bindings'' between display layers and
+ the graph drawing system reside in this namespace.
+ \item |pgf.gd.lib| Numerous useful classes that ``make an algorithm's your
+ life easier'' are collected in this namespace. Examples are a class for
+ decomposing a graph into connected components or a class for computing
+ the ideal distance between two sibling nodes in a tree, taking all
+ sorts of rotations and separation parameters into account.
+ \item |pgf.gd.model| This namespace contains all Lua classes that are part
+ of the object-oriented model of graphs employed throughout the graph
+ drawing engine. For readers familiar with the model--view--controller
+ pattern: This is the namespace containing the model-part of this
+ pattern.
+ \item |pgf.gd.control| This namespace contains the ``control logic'' of the
+ graph drawing system. It will transform graphs according to rules,
+ disassemble layouts and sublayouts and will call the appropriate
+ algorithms. For readers still familiar with the model--view--controller
+ pattern: This is the namespace containing the control-part of this
+ pattern.
+ \item |pgf.gd.trees| This namespace contains classes that are useful for
+ dealing with graphs that are trees. In particular, it contains a class
+ for computing a spanning tree of an arbitrary connected graph; an
+ operation that is an important preprocessing step for many algorithms.
+
+ In addition to providing ``utility functions for trees'', the namespace
+ \emph{also} includes actual algorithms for computing graph layouts like
+ |pgf.gd.trees.ReingoldTilford1981|. It may seem to be a bit of an
+ ``impurity'' that a namespace mixes utility classes and ``real''
+ algorithms, but experience has shown that it is better to keep things
+ together in this way.
+
+ Concluding the analogy to the model--view--controller pattern, a graph
+ drawing algorithm is, in a loose sense, the ``view'' part of the
+ pattern.
+ \item |pgf.gd.layered| This namespace provides classes and functions for
+ ``layered'' layouts; the Sugiyama layout method being the most
+ well-known one. Again, the namespace contains both algorithms to be
+ used by a user and utility functions.
+ \item |pgf.gd.force| Collects force-based algorithms and, again, also
+ utility functions and classes.
+ \item |pgf.gd.examples| Contains some example algorithms. They are
+ \emph{not} intended to be used directly, rather they should serve as
+ inspirations for readers wishing to implement their own algorithms.
\end{itemize}
-There are further namespaces that also reside in the |pgf.gd|
-namespace, these namespaces are used to organize different graph
-drawing algorithms into categories.
-
-In Lua, similarly to Java, when a class |SomeClass| is part of, say,
-the namespace |pgf.gd.example|, it is customary to put the class's
-code in a file |SomeClass.lua| and then put this class in a directory
-|example|, that is a subdirectory of a directory |gd|, which is in
-turn a subdirectory of a directory |pgf|. When you write
-\texttt{require "pgf.gd.example.SomeClass"} the so-called
-\emph{loader} will turn this into a request for the file
-\texttt{pgf/gd/example/SomeClass.lua} (for Unix systems).
+There are further namespaces that also reside in the |pgf.gd| namespace, these
+namespaces are used to organize different graph drawing algorithms into
+categories.
+In Lua, similarly to Java, when a class |SomeClass| is part of, say, the
+namespace |pgf.gd.example|, it is customary to put the class's code in a file
+|SomeClass.lua| and then put this class in a directory |example|, that is a
+subdirectory of a directory |gd|, which is in turn a subdirectory of a
+directory |pgf|. When you write \texttt{require "pgf.gd.example.SomeClass"} the
+so-called \emph{loader} will turn this into a request for the file
+\texttt{pgf/gd/example/SomeClass.lua} (for Unix systems).
\subsubsection{Defining and Using Namespaces and Classes}
-There are a number of rules concerning the structure and naming of
-namespaces as well as the naming of files. Let us start with the
-rules for naming namespaces, classes, and functions. They follow the
-``Java convention'':
-
+There are a number of rules concerning the structure and naming of namespaces
+as well as the naming of files. Let us start with the rules for naming
+namespaces, classes, and functions. They follow the ``Java convention'':
+%
\begin{enumerate}
-\item A namespace is a short lowercase |word|.
-\item A function in a namespace is in |lowercase_with_underscores_between_words|.
-\item A class name is in |CamelCaseWithAnUppercaseFirstLetter|.
-\item A class method name is in |camelCaseWithALowercaseFirstLetter|.
+ \item A namespace is a short lowercase |word|.
+ \item A function in a namespace is in
+ |lowercase_with_underscores_between_words|.
+ \item A class name is in |CamelCaseWithAnUppercaseFirstLetter|.
+ \item A class method name is in |camelCaseWithALowercaseFirstLetter|.
\end{enumerate}
-From Lua's point of view, every namespace and every class is just a
-table. However, since these tables will be loaded using Lua's
-|require| function, each namespace and each class must be placed
-inside a separate file (unless you modify the |package.loaded| table,
-but, then, you know what you are doing anyway). Inside such a file, you
-should first declare a local variable whose name is the name of the
-namespace or class that you intend to define and then assign a
-(possibly empty) table to this variable:
+From Lua's point of view, every namespace and every class is just a table.
+However, since these tables will be loaded using Lua's |require| function, each
+namespace and each class must be placed inside a separate file (unless you
+modify the |package.loaded| table, but, then, you know what you are doing
+anyway). Inside such a file, you should first declare a local variable whose
+name is the name of the namespace or class that you intend to define and then
+assign a (possibly empty) table to this variable:
+%
\begin{codeexample}[code only, tikz syntax=false]
-- File pgf.gd.example.SomeClass.lua:
local SomeClass = {}
\end{codeexample}
-Next, you should add your class to the encompassing namespace. This is
-achieved as follows:
+%
+Next, you should add your class to the encompassing namespace. This is achieved
+as follows:
+%
\begin{codeexample}[code only, tikz syntax=false]
require("pgf.gd.example").SomeClass = SomeClass
\end{codeexample}
-The reason this works is that the |require| will return the table that
-is the namespace |pgf.gd.example|. So, inside this namespace, the
-|SomeClass| field will be filled with the table stored in the local
-variable of the same name -- which happens to be the table
-representing the class.
+%
+The reason this works is that the |require| will return the table that is the
+namespace |pgf.gd.example|. So, inside this namespace, the |SomeClass| field
+will be filled with the table stored in the local variable of the same name --
+which happens to be the table representing the class.
At the end of the file, you must write
+%
\begin{codeexample}[code only, tikz syntax=false]
-return SomeClass
+return SomeClass
\end{codeexample}
-This ensures that the table that is defined in this file gets stored
-by Lua in the right places. Note that you need and should not use
-Lua's |module| command. The reason is that this command has
-disappeared in the new version of Lua and that it is not really
-needed.
+%
+This ensures that the table that is defined in this file gets stored by Lua in
+the right places. Note that you need and should not use Lua's |module| command.
+The reason is that this command has disappeared in the new version of Lua and
+that it is not really needed.
Users of your class can import and use your class by writing:
+%
\begin{codeexample}[code only, tikz syntax=false]
...
local SomeClass = require "pgf.gd.examples.SomeClass"
-...
+...
\end{codeexample}
-
-
\subsection{The Graph Drawing Scope}
-
\label{section-gd-gd-scope}
\includeluadocumentationof{pgf.gd.interface.Scope}
-
\subsection{The Model Classes}
-
\label{section-gd-models}
-All that a graph drawing algorithm will ``see'' of the graph specified
-by the user is a ``graph object.'' Such an object is an
-object-oriented model of the user's graph that no longer encodes the
-specific way in which the user specified the graph; it only encodes
-which nodes and edges are present. For instance, the \tikzname\ graph
-specification
+All that a graph drawing algorithm will ``see'' of the graph specified by the
+user is a ``graph object''. Such an object is an object-oriented model of the
+user's graph that no longer encodes the specific way in which the user
+specified the graph; it only encodes which nodes and edges are present. For
+instance, the \tikzname\ graph specification
+%
\begin{codeexample}[code only]
graph { a -- {b, c} }
\end{codeexample}
+%
\noindent and the graph specification
+%
\begin{codeexample}[code only]
node (a) { a }
child { node (b) {b} }
child { node (c) {c} }
\end{codeexample}
+%
will generate exactly the same graph object.
\begin{luanamespace}{pgf.gd.}{model}
- This namespace contains the classes modeling graphs,
- nodes, and edges. Also, the |Coordinate| class is found here, since
- coordinates are also part of the modeling.
+ This namespace contains the classes modeling graphs, nodes, and edges.
+ Also, the |Coordinate| class is found here, since coordinates are also part
+ of the modeling.
\end{luanamespace}
\subsubsection{Directed Graphs (Digraphs)}
-Inside the graph drawing engine, the only model of a graph that is
-available treats graphs as
+Inside the graph drawing engine, the only model of a graph that is available
+treats graphs as
+%
\begin{enumerate}
-\item directed (all edges have a designated head and a designated
- tail) and
-\item simple (there can be at most one edge between any pair of
- nodes).
+ \item directed (all edges have a designated head and a designated tail) and
+ \item simple (there can be at most one edge between any pair of nodes).
\end{enumerate}
-These two properties may appear to be somewhat at odds with what users
-can specify as graphs and with what some graph drawing algorithms
-might expect as input. For instance, suppose a user writes
+%
+These two properties may appear to be somewhat at odds with what users can
+specify as graphs and with what some graph drawing algorithms might expect as
+input. For instance, suppose a user writes
+%
\begin{codeexample}[code only]
graph { a -- b --[red] c, b --[green, bend right] c }
\end{codeexample}
-In this case, it seems that the input graph for a graph drawing
-algorithm should actually be an \emph{undirected} graph in which there
-are \emph{multiple} edges (namely $2$) between |b| and~|c|.
-Nevertheless, the graph drawing engine will turn the user's input a
-directed simple graph in ways described later. You do not need to
-worry that information gets lost during this process: The
-\emph{syntactic digraph,} which is available to graph drawing
-algorithms on request, stores all the information about which edges
-are present in the original input graph.
-
-The main reasons for only considering directed, simple graphs are speed
-and simplicity: The implementation of these graphs has been optimized so
-that all operations on these graphs have a guaranteed running time
-that is small in practice.
+%
+In this case, it seems that the input graph for a graph drawing algorithm
+should actually be an \emph{undirected} graph in which there are
+\emph{multiple} edges (namely $2$) between |b| and~|c|. Nevertheless, the graph
+drawing engine will turn the user's input a directed simple graph in ways
+described later. You do not need to worry that information gets lost during
+this process: The \emph{syntactic digraph,} which is available to graph drawing
+algorithms on request, stores all the information about which edges are present
+in the original input graph.
+
+The main reasons for only considering directed, simple graphs are speed and
+simplicity: The implementation of these graphs has been optimized so that all
+operations on these graphs have a guaranteed running time that is small in
+practice.
\includeluadocumentationof{pgf.gd.model.Digraph}
+
\subsubsection{Vertices}
\includeluadocumentationof{pgf.gd.model.Vertex}
+
\subsubsection{Arcs}
\label{section-gd-arc-model}
\includeluadocumentationof{pgf.gd.model.Arc}
+
\subsubsection{Edges}
\includeluadocumentationof{pgf.gd.model.Edge}
+
\subsubsection{Collections}
\includeluadocumentationof{pgf.gd.model.Collection}
+
\subsubsection{Coordinates, Paths, and Transformations}
\includeluadocumentationof{pgf.gd.model.Coordinate}
\includeluadocumentationof{pgf.gd.model.Path}
\includeluadocumentationof{pgf.gd.lib.Transform}
+
\subsubsection{Options and Data Storages for Vertices, Arcs, and Digraphs}
-Many objects in the graph drawing system have an |options| table
-attached to them. These tables will contain the different kinds
-options specified by the user for the object. For efficiency reasons,
-many objects may share the same options table (since, more often than
-not, almost all objects have exactly the same |options| table). For
-this reason, you cannot store anything in an options table, indeed,
-you should never attemp to write anything into an options
+Many objects in the graph drawing system have an |options| table attached to
+them. These tables will contain the different kinds options specified by the
+user for the object. For efficiency reasons, many objects may share the same
+options table (since, more often than not, almost all objects have exactly the
+same |options| table). For this reason, you cannot store anything in an options
+table, indeed, you should never attempt to write anything into an options
table. Instead, you should use a |Storage|.
\includeluadocumentationof{pgf.gd.lib.Storage}
+
\subsubsection{Events}
\includeluadocumentationof{pgf.gd.lib.Event}
-
\subsection{Graph Transformations}
-
\label{section-gd-transformations}
\subsubsection{The Layout Pipeline}
\includeluadocumentationof{pgf.gd.control.LayoutPipeline}
+
\subsubsection{Hints For Edge Routing}
\includeluadocumentationof{pgf.gd.routing.Hints}
\subsection{The Interface To Algorithms}
-
\label{section-gd-interface-to-algorithms}
\includeluadocumentationof{pgf.gd.interface.InterfaceToAlgorithms}
-
-
-
\subsection{Examples of Implementations of Graph Drawing Algorithms}
\label{section-gd-examples}
@@ -832,14 +802,11 @@ table. Instead, you should use a |Storage|.
\includeluadocumentationof{pgf.gd.examples.SimpleHuffman}
-
-
\subsection{Support Libraries}
-
\label{section-gd-libs}
-The present section lists a number of general-purpose libraries that
-are used by different algorithms.
+The present section lists a number of general-purpose libraries that are used
+by different algorithms.
\subsubsection{Basic Functions}
@@ -847,19 +814,19 @@ are used by different algorithms.
\includeluadocumentationof{pgf.gd.lib}
+
\subsubsection{Lookup Tables}
\includeluadocumentationof{pgf.gd.lib.LookupTable}
+
\subsubsection{Computing Distances in Graphs}
\emph{Still needs to be ported to digraph classes!}
%\includeluadocumentationof{pgf.gd.lib.PathLengths}
+
\subsubsection{Priority Queues}
\includeluadocumentationof{pgf.gd.lib.PriorityQueue}
-
-
-
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-algorithms-in-c.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-algorithms-in-c.tex
index 15a39a75ea8..042493105da 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-algorithms-in-c.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-algorithms-in-c.tex
@@ -8,137 +8,129 @@
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-
\section{Writing Graph Drawing Algorithms in C}
\label{section-algorithms-in-c}
\noindent{\emph{by Till Tantau}}
\bigskip
-\ifluatex\else This section of the manual can only be typeset using Lua\TeX.\expandafter\endinput\fi
+\ifluatex
+\else
+ This section of the manual can only be typeset using Lua\TeX.
+ \expandafter\endinput
+\fi
In the present section we have a look at how graph drawing
algorithms written in the C programming language (or in C++) can be
used in the graph drawing framework.
\begin{quote}
- \emph{Warning:} Graph drawing algorithms written in C can be
- incredibly fast if you use the facilities of C
- correctly. \emph{However,} C code is much less portable than Lua
- code in the sense that it has to be compiled for the specific
- platform used by the user and that it has to be linked dynamically
- during a run of the \TeX\ program. All of this in possible (and
- works, as demonstrated by the linking of the \textsc{ogdf}
- framework), but it is \emph{much} harder to get right than writing
- Lua code.
-
- Bottom line, \emph{you really should be using this method
- only if it is really necessary (namely, when Lua code is simply not
- fast enough).}
+ \emph{Warning:} Graph drawing algorithms written in C can be incredibly
+ fast if you use the facilities of C correctly. \emph{However,} C code is
+ much less portable than Lua code in the sense that it has to be compiled
+ for the specific platform used by the user and that it has to be linked
+ dynamically during a run of the \TeX\ program. All of this in possible (and
+ works, as demonstrated by the linking of the \textsc{ogdf} framework), but
+ it is \emph{much} harder to get right than writing Lua code.
+
+ Bottom line, \emph{you really should be using this method only if it is
+ really necessary (namely, when Lua code is simply not fast enough).}
\end{quote}
-In the following, I first explain how the link between \TeX\ and C
-code works, in general. Then, in the subsequent sections, we go over
-the different kinds of programming languages and frameworks for which
-there is direct support for such a link.
+In the following, I first explain how the link between \TeX\ and C code works,
+in general. Then, in the subsequent sections, we go over the different kinds of
+programming languages and frameworks for which there is direct support for such
+a link.
\subsection{How C and \TeX\ Communicate}
-In order to use C code for graph drawing algorithms during a run of
-the \TeX\ program, there is no need to build a new version of
-\TeX. Rather, it is possible that C code is linked into the \TeX\
-executable at runtime. This is made possible by the fact that Lua
-(which part of Lua\TeX$\dots$) is able to link C libraries at runtime --
-provided a strict regime of rules is adhered to:
-
+In order to use C code for graph drawing algorithms during a run of the \TeX\
+program, there is no need to build a new version of \TeX. Rather, it is
+possible that C code is linked into the \TeX\ executable at runtime. This is
+made possible by the fact that Lua (which part of Lua\TeX$\dots$) is able to
+link C libraries at runtime -- provided a strict regime of rules is adhered to:
+%
\begin{enumerate}
-\item When you say |require| in Lua, it will normally look for a
- |.lua| file; but it will also try to find a |.so| file (a shared C
- library) as a fallback.
-\item If it finds such a shared library, Lua(\TeX) will try to link
- this library dynamically at runtime.
-\item Inside the library, there must be a function (called an entry
- point) with a special name (it must start with |luaopen_| and it
- must otherwise be the path and name of the library with slashes replaced by
- underscores).
-\item This function gets called by Lua, once. Its job is to setup the
- library so that it can be used by Lua. Mainly, this means that
- certain C functions get registered in such a way that Lua can call
- them.
-\item At this point, control returns to Lua and, now, certain
- functions have become available on the Lua layer that, when called,
- actually invoke the C code of our linked library.
+ \item When you say |require| in Lua, it will normally look for a |.lua|
+ file; but it will also try to find a |.so| file (a shared C library) as
+ a fallback.
+ \item If it finds such a shared library, Lua(\TeX) will try to link this
+ library dynamically at runtime.
+ \item Inside the library, there must be a function (called an entry point)
+ with a special name (it must start with |luaopen_| and it must
+ otherwise be the path and name of the library with slashes replaced by
+ underscores).
+ \item This function gets called by Lua, once. Its job is to setup the
+ library so that it can be used by Lua. Mainly, this means that certain
+ C functions get registered in such a way that Lua can call them.
+ \item At this point, control returns to Lua and, now, certain functions
+ have become available on the Lua layer that, when called, actually
+ invoke the C code of our linked library.
\end{enumerate}
For each of the above points, there are some bells and whistles:
-
+%
\begin{enumerate}
-\item Lua\TeX\ looks at slightly inconvenient places for shared
- libraries: By default, (currently, 2013) it looks in a |lib|
- subdirectory of the directory containing the Lua\TeX\
- executable. The logic behind is that the shared libraries depend on
- the specific architecture of the executable. Thus, unlike normal Lua
- files, the library needs to be installed ``far away'' from the actual
- package of which it is part.
-\item Certain vesions of Lua\TeX\ have a broken handling of filenames
- of libraries written in C. The TL2013 version of Lua\TeX, for
- instance, crashes when the filename of a shared library does not
- contain the complete path (while this works for normal
- file). Hopefully, this, too, will be fixed in future versions.
-\item On certain platforms, the support for dynamic linking against
- Lua\TeX\ is broken since the symbol table of the Lua library has been
- stripped away. Hopefully, this will be fixed soon; in the meantime, a
- highly fragile workaround is to link in another copy of the Lua
- library.
-\item The entry point that is called by Lua requires a certain
- signature (it takes a Lua state as its only parameter) and must
- return the number of objects it returns on the Lua stack.
-\item The registration process of C functions is somewhat tricky and
- changes from Lua version to Lua version.
-\item C functions that get called by Lua must follow all sorts of
- tricky rules in order to communicate with Lua correctly.
+ \item Lua\TeX\ looks at slightly inconvenient places for shared libraries:
+ By default, (currently, 2013) it looks in a |lib| subdirectory of the
+ directory containing the Lua\TeX\ executable. The logic behind is that
+ the shared libraries depend on the specific architecture of the
+ executable. Thus, unlike normal Lua files, the library needs to be
+ installed ``far away'' from the actual package of which it is part.
+ \item Certain versions of Lua\TeX\ have a broken handling of filenames of
+ libraries written in C. The TL2013 version of Lua\TeX, for instance,
+ crashes when the filename of a shared library does not contain the
+ complete path (while this works for normal file). Hopefully, this, too,
+ will be fixed in future versions.
+ \item On certain platforms, the support for dynamic linking against
+ Lua\TeX\ is broken since the symbol table of the Lua library has been
+ stripped away. Hopefully, this will be fixed soon; in the meantime, a
+ highly fragile workaround is to link in another copy of the Lua
+ library.
+ \item The entry point that is called by Lua requires a certain signature
+ (it takes a Lua state as its only parameter) and must return the number
+ of objects it returns on the Lua stack.
+ \item The registration process of C functions is somewhat tricky and
+ changes from Lua version to Lua version.
+ \item C functions that get called by Lua must follow all sorts of tricky
+ rules in order to communicate with Lua correctly.
\end{enumerate}
-Despite the above obstacles, one can use graph drawing algorithms
-written in C inside Lua, in principle, as follows: One loads an
-appropriately prepared and located C library using |require| and this
-library uses commands like |declare| to register its own functions
-into the graph drawing system so that when the |run| method is called,
-a C functions gets called instead.
-
-Unfortunately, the above approach is extremely tedious and error-prone
-and it is ``no fun'' to access Lua data structures (such as the
-syntactic digraph) from C. For this reason, I have written some
-libraries that encapsulate (as much as possible) of this communication
-between C and Lua. Indeed, when you use these libraries, you can focus
-entirely on the graph drawing issues and you will not even notice that
-your code ``is talking to Lua.'' (Except for the name of the entry
-point, which is fixed to start with |luaopen_| and it is impossible to
-change this without disrupting a lot inside Lua's module system).
-
-There are libraries available for simplifying the communication
-between the graph drawing system and graph drawing algorithms written
-in
-
+Despite the above obstacles, one can use graph drawing algorithms written in C
+inside Lua, in principle, as follows: One loads an appropriately prepared and
+located C library using |require| and this library uses commands like |declare|
+to register its own functions into the graph drawing system so that when the
+|run| method is called, a C functions gets called instead.
+
+Unfortunately, the above approach is extremely tedious and error-prone and it
+is ``no fun'' to access Lua data structures (such as the syntactic digraph)
+from C. For this reason, I have written some libraries that encapsulate (as
+much as possible) of this communication between C and Lua. Indeed, when you use
+these libraries, you can focus entirely on the graph drawing issues and you
+will not even notice that your code ``is talking to Lua''. (Except for the name
+of the entry point, which is fixed to start with |luaopen_| and it is
+impossible to change this without disrupting a lot inside Lua's module system).
+
+There are libraries available for simplifying the communication between the
+graph drawing system and graph drawing algorithms written in
+%
\begin{itemize}
-\item C, see Section~\ref{section-gd-c},
-\item C++, see Section~\ref{section-gd-c++},
-\item Open Graph Drawing Framework, see Section~\ref{section-gd-ogdf-interface}.
+ \item C, see Section~\ref{section-gd-c},
+ \item C++, see Section~\ref{section-gd-c++},
+ \item Open Graph Drawing Framework, see
+ Section~\ref{section-gd-ogdf-interface}.
\end{itemize}
-
\subsection{Writing Graph Drawing Algorithms in C}
-
\label{section-gd-c}
\subsubsection{The Hello World of Graph Drawing in C}
-As our first example, as always, the ``hello world'' of graph drawing
-simply places nodes on a circle. For this, we implement a
-function |fast_hello_world| in a file |SimpleDemoC.c|. It starts as
-follows:
-
+As our first example, as always, the ``hello world'' of graph drawing simply
+places nodes on a circle. For this, we implement a function |fast_hello_world|
+in a file |SimpleDemoC.c|. It starts as follows:
+%
\begin{codeexample}[code only, tikz syntax=false]
#include <pgf/gd/interface/c/InterfaceFromC.h>
#include <math.h>
@@ -148,31 +140,28 @@ static void fast_hello_world (pgfgd_SyntacticDigraph* graph) {
}
\end{codeexample}
-As we can see, we first include a special header file of a rather small
-library that does all the hard work of translating between Lua and C
-for us (|InterfaceFromC|). These header files reside in the |c|
-subdirectory of the |pgf| package. Note that we do \emph{not} have to
-include the headers of the Lua library; indeed, you do not need access
-to the source of Lua to use the interface headers. As a side effect,
-we will, however, have to write |struct lua_State| instead of the more common
-|lua_State| once in our code, namely in the declaration of the entry
-point; but that is the only downside.
-
-The library |InterfaceFromC| declares the type
-|pgfgd_SyntacticDigraph|. In a moment, we will
-see that we can setup a key |fast simple demo layout| such that when
-this key is used on the display layer, the function
-|fast_hello_world| gets called. When it is called, the |graph|
-parameter will be a full representation of the to-be-laid-out
-graph. We can access the fields of the graph and even directly modify
-some of its fields (in particular, we can modify the |pos| fields of
-the vertices). Here is the complete code of the algorithm:
-
+As we can see, we first include a special header file of a rather small library
+that does all the hard work of translating between Lua and C for us
+(|InterfaceFromC|). These header files reside in the |c| subdirectory of the
+|pgf| package. Note that we do \emph{not} have to include the headers of the
+Lua library; indeed, you do not need access to the source of Lua to use the
+interface headers. As a side effect, we will, however, have to write
+|struct lua_State| instead of the more common |lua_State| once in our code,
+namely in the declaration of the entry point; but that is the only downside.
+
+The library |InterfaceFromC| declares the type |pgfgd_SyntacticDigraph|. In a
+moment, we will see that we can setup a key |fast simple demo layout| such that
+when this key is used on the display layer, the function |fast_hello_world|
+gets called. When it is called, the |graph| parameter will be a full
+representation of the to-be-laid-out graph. We can access the fields of the
+graph and even directly modify some of its fields (in particular, we can modify
+the |pos| fields of the vertices). Here is the complete code of the algorithm:
+%
\begin{codeexample}[code only, tikz syntax=false]
static void fast_hello_world (pgfgd_SyntacticDigraph* graph) {
double angle = 6.28318530718 / graph->vertices.length;
double radius = pgfgd_tonumber(graph->options, "fast simple demo radius");
-
+
int i;
for (i = 0; i < graph->vertices.length; i++) {
pgfgd_Vertex* v = graph->vertices.array[i];
@@ -182,16 +171,16 @@ static void fast_hello_world (pgfgd_SyntacticDigraph* graph) {
}
\end{codeexample}
-That is all that is needed; the C library will take care of both
-creating the |graph| object as all well as of deleting it and of
-copying back the computed values of the |pos| fields of the vertices.
-
-Our next task is to setup the key |fast simple demo layout|. We can
-(and must) also do this from C, using the following code:
+That is all that is needed; the C library will take care of both creating the
+|graph| object as all well as of deleting it and of copying back the computed
+values of the |pos| fields of the vertices.
+Our next task is to setup the key |fast simple demo layout|. We can (and must)
+also do this from C, using the following code:
+%
\begin{codeexample}[code only, tikz syntax=false]
int luaopen_pgf_gd_examples_c_SimpleDemoC (struct lua_State *state) {
-
+
pgfgd_Declaration* d = pgfgd_new_key ("fast simple demo layout");
pgfgd_key_summary (d, "The C version of the hello world of graph drawing");
pgfgd_key_algorithm (d, fast_hello_world);
@@ -201,15 +190,15 @@ int luaopen_pgf_gd_examples_c_SimpleDemoC (struct lua_State *state) {
pgfgd_free_key (d);
\end{codeexample}
-The function |luaopen_pgf_gd_examples_c_SimpleDemoC| is the
-function that will be called by Lua (we will come to that). More
-important for us, at the moment, is the declaration of the key: We use
-|pgfgd_new_key| to create a declaration record and then fill the
-different fields using appropriate function calls. In particular, the
-call |pgfgd_key_algorithm| allows us to link the key with a particular
-C function. The |pgfgd_declare| will then pass the whole declaration
-back to Lua, so the effect of the above is essentially the same as if
-you had written in Lua:
+The function |luaopen_pgf_gd_examples_c_SimpleDemoC| is the function that will
+be called by Lua (we will come to that). More important for us, at the moment,
+is the declaration of the key: We use |pgfgd_new_key| to create a declaration
+record and then fill the different fields using appropriate function calls. In
+particular, the call |pgfgd_key_algorithm| allows us to link the key with a
+particular C function. The |pgfgd_declare| will then pass the whole declaration
+back to Lua, so the effect of the above is essentially the same as if you had
+written in Lua:
+%
\begin{codeexample}[code only, tikz syntax=false]
declare {
key = "fast simple demo layout",
@@ -225,9 +214,9 @@ declare {
\end{codeexample}
In our algorithm, in addition to the above key, we also use the
-|fast simple demo radius| key, which is a simple length key. This key, too, can be
-declared on the C layer:
-
+|fast simple demo radius| key, which is a simple length key. This key, too, can
+be declared on the C layer:
+%
\begin{codeexample}[code only, tikz syntax=false]
d = pgfgd_new_key ("fast simple demo radius");
pgfgd_key_summary (d, "A radius value for the hello world of graph drawing");
@@ -235,95 +224,100 @@ declared on the C layer:
pgfgd_key_initial (d, "1cm");
pgfgd_declare (state, d);
pgfgd_free_key (d);
-
+
return 0;
}
\end{codeexample}
We simply add this code to the startup function above.
-Now it is time to compile and link the code. For this, you must, well,
-compile it, link it against the library |InterfaceFromC|, and build a
-shared library out of it. Also, you must place it somewhere where
-Lua\TeX\ will find it. You will find a Makefile that should be able to
-achieve all of this in the directory |pgf/c/graphdrawing/pgf/gd/examples/c|,
-where you will also find the code of the above example.
-
-Now, all you need to do to use it is to write in Lua (after you have
-loaded the |pgf.gd| library, of course), would normally be the call
+Now it is time to compile and link the code. For this, you must, well, compile
+it, link it against the library |InterfaceFromC|, and build a shared library
+out of it. Also, you must place it somewhere where Lua\TeX\ will find it. You
+will find a Makefile that should be able to achieve all of this in the
+directory |pgf/c/graphdrawing/pgf/gd/examples/c|, where you will also find the
+code of the above example.
+Now, all you need to do to use it is to write in Lua (after you have loaded the
+|pgf.gd| library, of course), would normally be the call
+%
\begin{codeexample}[code only, tikz syntax=false]
-require 'pgf.gd.examples.c.SimpleDemoC'
+require 'pgf.gd.examples.c.SimpleDemoC'
\end{codeexample}
+%
or in \tikzname
+%
\begin{codeexample}[code only]
\usegdlibrary {examples.c.SimpleDemoC}
\end{codeexample}
-This should cause Lua\TeX\ to find the shared library, load it, and then
-call the function in that library with the lengthy name (the name is
-always |luaopen_| followed by the path and filename with slashes
-replaced by underscores).
+This should cause Lua\TeX\ to find the shared library, load it, and then call
+the function in that library with the lengthy name (the name is always
+|luaopen_| followed by the path and filename with slashes replaced by
+underscores).
-\emph{Remark:} Unfortunately, the above does not work with the \TeX
-Live 2013 versions of Lua\TeX\ due to a bugs that causes the ``replace
-dots by slashes'' to fail. For this reason, we currently need to
-rename our sharded library file to
+\emph{Remark:} Unfortunately, the above does not work with the \TeX Live 2013
+versions of Lua\TeX\ due to a bugs that causes the ``replace dots by slashes''
+to fail. For this reason, we currently need to rename our shared library file
+to
+%
\begin{codeexample}[code only, tikz syntax=false]
pgf_gd_examples_c_SimpleDemoC.so
\end{codeexample}
+%
and then say
+%
\begin{codeexample}[code only, tikz syntax=false]
-require 'pgf_gd_examples_c_SimpleDemoC'
+require 'pgf_gd_examples_c_SimpleDemoC'
\end{codeexample}
+%
or in \tikzname
+%
\begin{codeexample}[code only]
\usegdlibrary {pgf_gd_examples_c_SimpleDemoC}
\end{codeexample}
-In future versions of Lua\TeX, things should be ``back to normal'' in
-this regard. Also, the bug only concerns shared libraries; you can
-still create a normal Lua file with a nice name and place at a nice
-location and the only contents of this file is then the above
-|require| command.
+In future versions of Lua\TeX, things should be ``back to normal'' in this
+regard. Also, the bug only concerns shared libraries; you can still create a
+normal Lua file with a nice name and place at a nice location and the only
+contents of this file is then the above |require| command.
Anyway, once we have loaded the shared library we can say:
-
+%
\begin{codeexample}[code only]
\tikz \graph [fast simple demo layout, fast simple demo radius=1.25cm]
{ a -> b -> c -> d -> e -> a };
\end{codeexample}
+
\subsubsection{Documenting Algorithms Written in C}
\label{section-gd-documenting-c-algos}
-In our above example, we included a summary with the keys in the C
-code. It would be even better if we added a longer documentation and
-some examples that show how the key works; but this is a bit
-impracticable in C since multi-line strings are hard to write down
-in~C. The trick is to use the |documentation_in| field of a key: It
-allows us to specify the name of a Lua file that should be loaded
-(using |require|) to install the missing documentation fields. As
-explained in Section~\ref{section-gd-documentation-in}, this Lua file
-may make good use the |pgf.gd.doc| package. Note, also, that for keys
-documented in this way the documentation can easily be included in
-this manual through the use of the |\includedocumentationof| command.
-
-In our example, we would first add the following line twice in the
-C code (once for each key), assuming that the documentation resides in
-the file |pgf/gd/doc/examples/SimpleDemoC.lua|:
-
+In our above example, we included a summary with the keys in the C code. It
+would be even better if we added a longer documentation and some examples that
+show how the key works; but this is a bit impracticable in C since multi-line
+strings are hard to write down in~C. The trick is to use the |documentation_in|
+field of a key: It allows us to specify the name of a Lua file that should be
+loaded (using |require|) to install the missing documentation fields. As
+explained in Section~\ref{section-gd-documentation-in}, this Lua file may make
+good use the |pgf.gd.doc| package. Note, also, that for keys documented in this
+way the documentation can easily be included in this manual through the use of
+the |\includedocumentationof| command.
+
+In our example, we would first add the following line twice in the C code (once
+for each key), assuming that the documentation resides in the file
+|pgf/gd/doc/examples/SimpleDemoC.lua|:
+%
\begin{codeexample}[code only, tikz syntax=false]
pgfgd_key_documentation_in (d, "pgf.gd.doc.examples.SimpleDemoC");
\end{codeexample}
-Note that since the documentation is a normal Lua file, it will be
-searched in the usual places Lua files are located (in the texmf
-trees) and not, like the C shared library, in the special |lib|
-subdirectory of the Lua\TeX\ binary.
+Note that since the documentation is a normal Lua file, it will be searched in
+the usual places Lua files are located (in the texmf trees) and not, like the C
+shared library, in the special |lib| subdirectory of the Lua\TeX\ binary.
Here are typical contents of the documentation file:
-
+%
\begin{codeexample}[code only, tikz syntax=false]
-- File pgf/gd/doc/examples/SimpleDemoC.lua
local key = require 'pgf.gd.doc'.key
@@ -332,7 +326,7 @@ local summary = require 'pgf.gd.doc'.summary
local example = require 'pgf.gd.doc'.example
key "fast simple demo layout"
-documentation
+documentation
[[
This layout is used...
]]
@@ -343,7 +337,7 @@ example
]]
key "fast simple demo radius"
-documentation
+documentation
[[
The radius parameter is used to ...
]]
@@ -355,42 +349,35 @@ example
\end{codeexample}
-
\subsubsection{The Interface From C}
-In the above example, we already saw some of the functions from the
-library |InterfaceFromC| that translated from Lua to C for us. For a
-complete list of all functions available, currently please see
-|graphdrawing/c/pgf/gd/interface/c/InterfaceFromC.h| directly.
-
-Currently, the library provides C functions to directly access all
-aspects of the syntactic digraph and also of the graphs computed by
-the preprocessing of the layout pipeline. What is missing, however, is
-access to the tree of (sub)layouts and to collections. Hopefully, these will
-be added in the future.
-
+In the above example, we already saw some of the functions from the library
+|InterfaceFromC| that translated from Lua to C for us. For a complete list of
+all functions available, currently please see
+|graphdrawing/c/pgf/gd/interface/c/InterfaceFromC.h| directly.
+Currently, the library provides C functions to directly access all aspects of
+the syntactic digraph and also of the graphs computed by the preprocessing of
+the layout pipeline. What is missing, however, is access to the tree of
+(sub)layouts and to collections. Hopefully, these will be added in the future.
\subsection{Writing Graph Drawing Algorithms in C++}
-
\label{section-gd-c++}
-Built on top of the C interface presented in the previous section,
-there is also a C++ interface available. It encapsulates as much of
-the C functions as possible in C++ classes. Thus, this interface is
-mostly there for convenience, it does not offer fundamentally new
-functionality.
+Built on top of the C interface presented in the previous section, there is
+also a C++ interface available. It encapsulates as much of the C functions as
+possible in C++ classes. Thus, this interface is mostly there for convenience,
+it does not offer fundamentally new functionality.
\subsubsection{The Hello World of Graph Drawing in C++}
-Let us have a look at how our beloved hello world of graph drawing
-looks in C++. Although it is still possible to put graph drawing
-algorithms inside functions, it is more natural in C++ to turn them
-into methods of a class. Thus, we start the code of
-|SimpleDemoCPlusPlus.c++| as follows:
-
+Let us have a look at how our beloved hello world of graph drawing looks in
+C++. Although it is still possible to put graph drawing algorithms inside
+functions, it is more natural in C++ to turn them into methods of a class.
+Thus, we start the code of |SimpleDemoCPlusPlus.c++| as follows:
+%
\begin{codeexample}[code only, tikz syntax=false]
#include <pgf/gd/interface/c/InterfaceFromC++.h>
#include <pgf/gd/interface/c/InterfaceFromC.h>
@@ -402,31 +389,30 @@ struct FastLayout : scripting::declarations, scripting::runner {
}
\end{codeexample}
-As can be seen, we do not only include the interface from C++, but
-also that from C (since, currently, not all functionality of the C
-library is encapsulated in C++).
+As can be seen, we do not only include the interface from C++, but also that
+from C (since, currently, not all functionality of the C library is
+encapsulated in C++).
The interesting part is the |struct FastLayout|, which will contain our
-algorithm (you could just as well have used a |class| instead of a
-|struct|). It is derived from two classes: First, from a
-|declarations| class and, secondly, from a |runner| class. Both of
-them, just like everything else from the interface, reside in the
-namespace |scripting|. This name was chosen since the main purpose of
-the interface is to provide ``scripting facilities'' to C code through
-the use of Lua.
-
-We are currently interested in the class |runner|. This class has a
-virtual function |run| that gets called when, on the Lua side, someone
-has selected the algorithm represented by the class. Thus, we place
-our algorithm in this method:
-
+algorithm (you could just as well have used a |class| instead of a |struct|).
+It is derived from two classes: First, from a |declarations| class and,
+secondly, from a |runner| class. Both of them, just like everything else from
+the interface, reside in the namespace |scripting|. This name was chosen since
+the main purpose of the interface is to provide ``scripting facilities'' to C
+code through the use of Lua.
+
+We are currently interested in the class |runner|. This class has a virtual
+function |run| that gets called when, on the Lua side, someone has selected the
+algorithm represented by the class. Thus, we place our algorithm in this
+method:
+%
\begin{codeexample}[code only, tikz syntax=false]
void run () {
pgfgd_SyntacticDigraph* graph = parameters->syntactic_digraph;
-
+
double angle = 6.28318530718 / graph->vertices.length;
double radius = parameters->option<double>("fast simple demo radius c++");
-
+
for (int i = 0; i < graph->vertices.length; i++) {
pgfgd_Vertex* v = graph->vertices.array[i];
v->pos.x = cos(angle*i) * radius;
@@ -435,24 +421,22 @@ void run () {
}
\end{codeexample}
-The |run| method has access to the member variable |parameters|, which
-contains all sorts of information concerning the to-be-drawn graph. In
-particular, the |syntactic_digraph| field gives us access to the
-syntactic digraph structure that was already available in the
-interface from plain~C. However, we can also see that a template
-function like |option| allows us to access the graph's option table in
-a simple way.
+The |run| method has access to the member variable |parameters|, which contains
+all sorts of information concerning the to-be-drawn graph. In particular, the
+|syntactic_digraph| field gives us access to the syntactic digraph structure
+that was already available in the interface from plain~C. However, we can also
+see that a template function like |option| allows us to access the graph's
+option table in a simple way.
As for C code, our next task is to setup a key that, when used on the
-\tikzname\ layer, will run our algorithm. For this, we can use an
-object derived from a |declarations|. In our example, the |FastLayout|
-is both derived from a |runner| (since it contains an algorithm) and
-also from |declarations| (since it also contains the code necessary for
-declaring this algorithm). If you prefer, you can split this into two
-classes. A |declarations| object must override the |declare|
-method. This method gets a |script| object as input, which is the
-``representation'' of Lua inside the C++ code:
-
+\tikzname\ layer, will run our algorithm. For this, we can use an object
+derived from a |declarations|. In our example, the |FastLayout| is both derived
+from a |runner| (since it contains an algorithm) and also from |declarations|
+(since it also contains the code necessary for declaring this algorithm). If
+you prefer, you can split this into two classes. A |declarations| object must
+override the |declare| method. This method gets a |script| object as input,
+which is the ``representation'' of Lua inside the C++ code:
+%
\begin{codeexample}[code only, tikz syntax=false]
void declare(scripting::script s) {
using namespace scripting;
@@ -462,7 +446,7 @@ void declare(scripting::script s) {
.precondition ("connected")
.precondition ("tree")
.algorithm (this));
-
+
s.declare(key ("fast simple demo radius c++")
.summary ("A radius value for the hello world of graph drawing")
.type ("length")
@@ -470,17 +454,16 @@ void declare(scripting::script s) {
}
\end{codeexample}
-For each key that we wish to declare, we call the script's |declare|
-method once. This method takes a |key| object as input, which can be
-configured through a sequence of calls to different member functions
-(like |summary| or |algorithm|). Most of these member functions are
-rather self-explaining; only |algorithm| is a bit trickier: It does
-not take a function as input, but rather an object of type |runner|
-and it will call the |run| method of this object whenever the
-algorithm is run.
+For each key that we wish to declare, we call the script's |declare| method
+once. This method takes a |key| object as input, which can be configured
+through a sequence of calls to different member functions (like |summary| or
+|algorithm|). Most of these member functions are rather self-explaining; only
+|algorithm| is a bit trickier: It does not take a function as input, but rather
+an object of type |runner| and it will call the |run| method of this object
+whenever the algorithm is run.
Lastly, we also need to write the entry point:
-
+%
\begin{codeexample}[code only, tikz syntax=false]
extern "C" int luaopen_pgf_gd_examples_c_SimpleDemoCPlusPlus (struct lua_State *state) {
scripting::script s (state);
@@ -490,25 +473,30 @@ extern "C" int luaopen_pgf_gd_examples_c_SimpleDemoCPlusPlus (struct lua_State *
\end{codeexample}
Note that it is the job of the interface classes to free the passed
-|declarations| object. For this reason, you really need to call |new|
-and cannot pass the address of a temporary object.
+|declarations| object. For this reason, you really need to call |new| and
+cannot pass the address of a temporary object.
-As before, because of the bug in some Lua\TeX\ versions, to actually
-load the library at runtime, we need to rename it to
+As before, because of the bug in some Lua\TeX\ versions, to actually load the
+library at runtime, we need to rename it to
+%
\begin{codeexample}[code only, tikz syntax=false]
pgf_gd_examples_c_SimpleDemoCPlusPlus.so
\end{codeexample}
+%
and then say
+%
\begin{codeexample}[code only, tikz syntax=false]
-require 'pgf_gd_examples_c_SimpleDemoCPlusPlus'
+require 'pgf_gd_examples_c_SimpleDemoCPlusPlus'
\end{codeexample}
+%
or in \tikzname
+%
\begin{codeexample}[code only]
\usegdlibrary {pgf_gd_examples_c_SimpleDemoCPlusPlus}
\end{codeexample}
We can now use it:
-
+%
\begin{codeexample}[code only]
\tikz \graph [fast simple demo layout c++, fast simple demo radius c++=1.25cm]
{ a -> b -> c -> d -> e -> a };
@@ -517,103 +505,101 @@ We can now use it:
\subsubsection{The Interface From C++}
-The header |graphdrawing/c/pgf/gd/interface/c/InterfaceFromC++.h|
-contains, as the name suggest, the interface from C++. A complete
-documentation is still missing, but let us go over the main ideas:
+The header |graphdrawing/c/pgf/gd/interface/c/InterfaceFromC++.h| contains, as
+the name suggest, the interface from C++. A complete documentation is still
+missing, but let us go over the main ideas:
+
\medskip
\noindent\textbf{Runners.}
-Algorithms are represented by objects of type |runner|. An
-algorithm will overwrite the |run| method, as we saw in the
-example, and it should modify the |parameters| of the runner
-object.
-
-In addition to the |run| method, there are also two more virtual
-methods, called |bridge| and |unbrigde|. The first is called before
-the |run| method is called and the second afterwards. The idea is that
-another framework, such as \textsc{ogdf}, can implement a new class
-|ogdf_runner| that overrides these two methods in order to transform
-the Lua/C representation of the input graph into an \textsc{ogdf}
-representation prior to the |run| method being called. The |run|
-method can then access additional member variables that store the
-graph representations in \textsc{ogdf} form (or another form,
-depending on the framework). The |unbridge| method allows the
-framework to translate back.
-
-Although a |runner| object must be created for every algorithm, an
-algorithm can also reside in a function. The class |function_runner|
-is a simple wrapper that turns a function into such an object.
+Algorithms are represented by objects of type |runner|. An algorithm will
+overwrite the |run| method, as we saw in the example, and it should modify the
+|parameters| of the runner object.
+
+In addition to the |run| method, there are also two more virtual methods,
+called |bridge| and |unbrigde|. The first is called before the |run| method is
+called and the second afterwards. The idea is that another framework, such as
+\textsc{ogdf}, can implement a new class |ogdf_runner| that overrides these two
+methods in order to transform the Lua/C representation of the input graph into
+an \textsc{ogdf} representation prior to the |run| method being called. The
+|run| method can then access additional member variables that store the graph
+representations in \textsc{ogdf} form (or another form, depending on the
+framework). The |unbridge| method allows the framework to translate back.
+
+Although a |runner| object must be created for every algorithm, an algorithm
+can also reside in a function. The class |function_runner| is a simple wrapper
+that turns a function into such an object.
\medskip
\noindent\textbf{Keys.}
-A key object is a temporary object that is passed to the |declare|
-method of a script. It represents the table that is passed to the Lua
-function |declare|. In order to make setting its field easy, for each
-field name there is a corresponding function (like |summary|) that
-takes the string that should be set to this field and returns the key
-object once more, so that we can chain calls.
-
-The |algorithm| method gets a runner object as parameter and will
-store a pointer to this object inside Lua. Each time the algorithm is
-used, this object will be used to ``run'' the algorithm, that is, the
-methods |prepare|, |bridge|, |run|, and |unbridge| will be called in
-that order. Since the object is reused each time, only one object is
-needed; but this object may not be freed prematurely. Indeed, you will
-normally create the object using |new| once and will then never delete
-it.
+A key object is a temporary object that is passed to the |declare| method of a
+script. It represents the table that is passed to the Lua function |declare|.
+In order to make setting its field easy, for each field name there is a
+corresponding function (like |summary|) that takes the string that should be
+set to this field and returns the key object once more, so that we can chain
+calls.
+
+The |algorithm| method gets a runner object as parameter and will store a
+pointer to this object inside Lua. Each time the algorithm is used, this object
+will be used to ``run'' the algorithm, that is, the methods |prepare|,
+|bridge|, |run|, and |unbridge| will be called in that order. Since the object
+is reused each time, only one object is needed; but this object may not be
+freed prematurely. Indeed, you will normally create the object using |new| once
+and will then never delete it.
A typical idiom you may find in the code is
+%
\begin{codeexample}[code only, tikz syntax=false]
s.declare (key (...)
.algorithm(this)
- ...);
+ ...);
\end{codeexample}
+%
This code is seen inside the |declare| method of objects that are both
-declarations and runners. They register ``themselves'' via the above
-code. Note, however, that this requires that the |this| pointer is not
-a temporary object. (The typing rules of C++ make it hard for this
-situation to happen, but it can be achieved.)
+declarations and runners. They register ``themselves'' via the above code.
+Note, however, that this requires that the |this| pointer is not a temporary
+object. (The typing rules of C++ make it hard for this situation to happen, but
+it can be achieved.)
\medskip
-\noindent\textbf{Reading options.}
-Once options have been declared, your C++ algorithms will wish to read
-them back. For this, the |parameters| field of a runner object
-provides a number of templated methods:
+\noindent\textbf{Reading options.} Once options have been declared, your C++
+algorithms will wish to read them back. For this, the |parameters| field of a
+runner object provides a number of templated methods:
+%
\begin{itemize}
-\item The |option_is_set| method returns |true| if the passed option
- has been set \emph{and} can be cast to the type of the template. So,
- |option_is_set<double>("node distance")| will return true if the
- |node distance| key has been set for the graph as a whole
- (currently, there is no way to read the options of a vertex or an
- edge from C++, use the C methods instead).
-\item The |option| function comes in two flavours: First, it takes a
- single option name and just returns the option's value. If, however,
- the option has not been set or has another type, some sort of null
- value is returned. So, |option<double>("node distance")| will return
- the configured node distance as a double. When an option has an
- initial value, this call will always return a sensible value.
-
- The second flavour of |option| allows you to pass a reference to an
- object in which the option's value should be stored and the function
- will return true if the option is set (and, thus, something was
- written into the reference). This is the ``safest'' way to access
- an option:
+ \item The |option_is_set| method returns |true| if the passed option has
+ been set \emph{and} can be cast to the type of the template. So,
+ |option_is_set<double>("node distance")| will return true if the
+ |node distance| key has been set for the graph as a whole (currently,
+ there is no way to read the options of a vertex or an edge from C++,
+ use the C methods instead).
+ \item The |option| function comes in two flavours: First, it takes a single
+ option name and just returns the option's value. If, however, the
+ option has not been set or has another type, some sort of null value is
+ returned. So, |option<double>("node distance")| will return the
+ configured node distance as a double. When an option has an initial
+ value, this call will always return a sensible value.
+
+ The second flavour of |option| allows you to pass a reference to an
+ object in which the option's value should be stored and the function
+ will return true if the option is set (and, thus, something was written
+ into the reference). This is the ``safest'' way to access an option:
+ %
\begin{codeexample}[code only, tikz syntax=false]
double dist;
if (parameters->option ("node distance", dist))
...
-\end{codeexample}
-
- Caution must be taken for |char*| options: The returned string must
- be explicitly freed; it will be a copy of the string stored in the
- Lua table.
-\item
- The |configure_option| method is used to set a member of an object
- based on the value of a certain option. For this, you must pass a
- pointer to a member function that sets the member. Here is an
- example:
+\end{codeexample}
+
+ Caution must be taken for |char*| options: The returned string must be
+ explicitly freed; it will be a copy of the string stored in the Lua
+ table.
+ \item The |configure_option| method is used to set a member of an object
+ based on the value of a certain option. For this, you must pass a
+ pointer to a member function that sets the member. Here is an example:
+ %
\begin{codeexample}[code only, tikz syntax=false]
class MyClass {
public:
@@ -625,64 +611,59 @@ public:
MyClass m;
parameters->configure_option("node distance", &MyClass::setMyDistance, m);
\end{codeexample}
- If the option has not been set or does not have the correct type,
- the member function is not called.
+ %
+ If the option has not been set or does not have the correct type, the
+ member function is not called.
\end{itemize}
\medskip
\noindent\textbf{Factories and modules.}
-A Lua key is normally either a Boolean, a double, or a
-string. However, in C++, we may also sometimes wish Lua users to
-configure which C function is used to achieve something. One could do
-this using strings or numbers and then use search algorithms or a long
-|switch|, but this would neither be flexible nor elegant.
-
-Instead, it is possible to store \emph{factories} in Lua keys. A
-factory is a class derived from |factory| that implements the virtual
-function |make|. This function will return a new object of a template
-type. You can store such a factory in a key.
+A Lua key is normally either a Boolean, a double, or a string. However, in C++,
+we may also sometimes wish Lua users to configure which C function is used to
+achieve something. One could do this using strings or numbers and then use
+search algorithms or a long |switch|, but this would neither be flexible nor
+elegant.
-The |make| method of a parameters object allows you to invoke the
-factory stored in a key. (If no factory is stored in it, |null| is
-returned).
+Instead, it is possible to store \emph{factories} in Lua keys. A factory is a
+class derived from |factory| that implements the virtual function |make|. This
+function will return a new object of a template type. You can store such a
+factory in a key.
-The |configure_module| method is akin to |configure_option|, only
-the result of applying the factory is passed to the member function of
-the class.
+The |make| method of a parameters object allows you to invoke the factory
+stored in a key. (If no factory is stored in it, |null| is returned).
+The |configure_module| method is akin to |configure_option|, only the result of
+applying the factory is passed to the member function of the class.
\medskip
\noindent\textbf{Scripts.}
-A ``script'' is the abstraction of the communication between Lua and
-C++. From C++'s point of view, the script object offers different
-|declare| methods that allow us to ``make objects and function
-scriptable'' in the sense that they can then be called and configured
-from Lua. The script must be initialized with a Lua state and will be
-bound to that state (basically, the script only stores this single
-pointer).
-
-When you call |declare|, you either pass a single key object (which is
-then declared on the Lua layer) or you pass a |declarations| object,
-whose virtual |declare| method is then called. The |declarations|
-objects are used to bundle several declarations into a single one.
+A ``script'' is the abstraction of the communication between Lua and C++. From
+C++'s point of view, the script object offers different |declare| methods that
+allow us to ``make objects and function scriptable'' in the sense that they can
+then be called and configured from Lua. The script must be initialized with a
+Lua state and will be bound to that state (basically, the script only stores
+this single pointer).
+When you call |declare|, you either pass a single key object (which is then
+declared on the Lua layer) or you pass a |declarations| object, whose virtual
+|declare| method is then called. The |declarations| objects are used to bundle
+several declarations into a single one.
\subsection{Writing Graph Drawing Algorithms Using OGDF}
-
\label{section-gd-ogdf-interface}
-Built on top of the C++ interface, a small interface allows you to
-easily link algorithms written for the \textsc{ogdf} (Open Graph
-Drawing Framework) with graph drawing in Lua.
+Built on top of the C++ interface, a small interface allows you to easily link
+algorithms written for the \textsc{ogdf} (Open Graph Drawing Framework) with
+graph drawing in Lua.
\subsubsection{The Hello World of Graph Drawing in OGDF -- From Scratch}
We start with some startup code:
-
+%
\begin{codeexample}[code only, tikz syntax=false]
#include <pgf/gd/ogdf/c/InterfaceFromOGDF.h>
#include <math.h>
@@ -691,61 +672,60 @@ using namespace ogdf;
using namespace scripting;
\end{codeexample}
-Note that the interface from \textsc{ogdf} resides in the |ogdf|
-folder, not in the |interface| folder.
-
-Like in the plain C++ interface, we must now subclass the |runner|
-class and the |declarations| class. Also like the plain C++ interface,
-we can use multiple inheritance. The difference lies in the fact that
-we do not directly subclass form |runner|, but rather from
-|ogdf_runner|. This class implements the complicated ``bridging'' or
-``translation'' process between the world of |InterfaceFromC++| and
-\textsc{ogdf}:
+Note that the interface from \textsc{ogdf} resides in the |ogdf| folder, not in
+the |interface| folder.
+Like in the plain C++ interface, we must now subclass the |runner| class and
+the |declarations| class. Also like the plain C++ interface, we can use
+multiple inheritance. The difference lies in the fact that we do not directly
+subclass form |runner|, but rather from |ogdf_runner|. This class implements
+the complicated ``bridging'' or ``translation'' process between the world of
+|InterfaceFromC++| and \textsc{ogdf}:
+%
\begin{codeexample}[code only, tikz syntax=false]
struct FastLayoutOGDF : declarations, ogdf_runner {
-
+
void run () {
double angle = 6.28318530718 / graph.numberOfNodes();
double radius = parameters->option<double>("my radius ogdf");
-
+
int i = 0;
for (node v = graph.firstNode(); v; v=v->succ(), i++) {
graph_attributes.x(v) = cos(angle*i) * radius;
graph_attributes.y(v) = sin(angle*i) * radius;
}
}
-\end{codeexample}
+\end{codeexample}
-As can be seen, in a subclass of |ogdf_runner|, the |run| method will
-have access to a member called |graph| and to another member called
-|graph_attributes|. These will have been setup with the graph from the
-Lua layer and, after the algorithm has run, the information stored in
-the |x| and |y| fields of the graph attributes and also the bend
-information of the edges will be written back automatically.
+As can be seen, in a subclass of |ogdf_runner|, the |run| method will have
+access to a member called |graph| and to another member called
+|graph_attributes|. These will have been setup with the graph from the Lua
+layer and, after the algorithm has run, the information stored in the |x| and
+|y| fields of the graph attributes and also the bend information of the edges
+will be written back automatically.
Next, we need to declare the algorithm. This is done as in the plain
C++ interface:
-
+%
\begin{codeexample}[code only, tikz syntax=false]
void declare(script s) {
using namespace scripting;
s.declare(key ("fast simple demo layout ogdf")
- .summary ("The OGDF version of the hello world of graph drawing")
- .precondition ("connected")
- .algorithm (this));
-
+ .summary ("The OGDF version of the hello world of graph drawing")
+ .precondition ("connected")
+ .algorithm (this));
+
s.declare(key ("my radius ogdf")
- .summary ("A radius value for the hello world of graph drawing")
- .type ("length")
- .initial ("1cm"));
+ .summary ("A radius value for the hello world of graph drawing")
+ .type ("length")
+ .initial ("1cm"));
}
};
\end{codeexample}
Finally, we need the entry point, which is also ``as usual'':
-
+%
\begin{codeexample}[code only, tikz syntax=false]
extern "C" int luaopen_pgf_gd_examples_c_SimpleDemoOGDF (struct lua_State *state) {
script (state).declare (new FastLayoutOGDF);
@@ -755,34 +735,33 @@ extern "C" int luaopen_pgf_gd_examples_c_SimpleDemoOGDF (struct lua_State *state
Yet again, we need to rename the resulting shared library and then say
|require| on it. We can now use it:
-
+%
\begin{codeexample}[code only]
\tikz \graph [fast simple demo layout ogdf, my radius ogdf=1cm]
{ a -> b -> c -> d -> e -> a };
\end{codeexample}
-
\subsubsection{The Hello World of Graph Drawing in OGDF -- Adapting Existing Classes}
In the previous example we implemented a graph drawing algorithm using
-\textsc{ogdf} for use with Lua ``from scratch.'' In particular, the
-whole algorithm was contained in the |run| method of our main
-class. In practice, however, graph drawing algorithms are typically
-placed in classes that ``know nothing about scripting.'' For instance,
-our hello world of graph drawing might actually be implemented like this:
-
+\textsc{ogdf} for use with Lua ``from scratch''. In particular, the whole
+algorithm was contained in the |run| method of our main class. In practice,
+however, graph drawing algorithms are typically placed in classes that ``know
+nothing about scripting''. For instance, our hello world of graph drawing might
+actually be implemented like this:
+%
\begin{codeexample}[code only, tikz syntax=false]
// File HelloWorldLayout.h
#include <ogdf/module/LayoutModule.h>
class HelloWorldLayout : puplic ogdf::LayoutModule {
public:
-
+
virtual void call(ogdf::GraphAttributes &GA)
{
using namespace ogdf;
-
+
const Graph &graph = GA.constGraph();
double angle = 6.28318530718 / graph.numberOfNodes();
int i = 0;
@@ -791,21 +770,19 @@ public:
GA.y(v) = sin(angle*i) * radius;
}
}
-
+
void setRadius (double r) { radius = r; }
-
+
private:
double radius;
};
\end{codeexample}
-Now, what we actually want to do is to ``make this class
-scriptable''. For this, we setup a new class whose |run| method will
-produce a new |HelloWorldLayout|, configure it, and then run it. Here
-is this run method:
-
-
+Now, what we actually want to do is to ``make this class scriptable''. For
+this, we setup a new class whose |run| method will produce a new
+|HelloWorldLayout|, configure it, and then run it. Here is this run method:
+%
\begin{codeexample}[code only, tikz syntax=false]
void run ()
{
@@ -817,7 +794,7 @@ void run ()
Next, we need to write the declarations code. This is very similar to the
``from scratch'' version:
-
+%
\begin{codeexample}[code only, tikz syntax=false]
void declare(script s) {
using namespace scripting;
@@ -826,7 +803,7 @@ void declare(script s) {
.summary ("The OGDF version of the hello world of graph drawing")
.precondition ("connected")
.algorithm (this));
-
+
s.declare(key ("HelloWorldLayout.radius")
.summary ("A radius value for the hello world of graph drawing")
.type ("length")
@@ -834,17 +811,16 @@ void declare(script s) {
}
\end{codeexample}
-Two remarks are in order: First, it is customary to name the keys for
-the display system the same way as the classes. Second, the different
-configuration options of the algorithm are named with the class name
-followed by the option name. This makes it clear who, exactly, is
-being configured. However, these keys should then also get an |alias|
-field set, which will cause an automatic forwarding of the key to
-something more ``user friendly'' like just |radius|.
-
-It remains to put the above methods in a ``script'' file. It is this
-file that, when compiled, must be linked at runtime against Lua\TeX.
+Two remarks are in order: First, it is customary to name the keys for the
+display system the same way as the classes. Second, the different configuration
+options of the algorithm are named with the class name followed by the option
+name. This makes it clear who, exactly, is being configured. However, these
+keys should then also get an |alias| field set, which will cause an automatic
+forwarding of the key to something more ``user friendly'' like just |radius|.
+It remains to put the above methods in a ``script'' file. It is this file that,
+when compiled, must be linked at runtime against Lua\TeX.
+%
\begin{codeexample}[code only, tikz syntax=false]
// File HelloWorldLayout_script.c++
@@ -868,23 +844,21 @@ extern "C" int luaopen_my_path_HelloWorldLayout_script (struct lua_State *state)
\subsubsection{Documenting OGDF Algorithms}
-As explained in Section~\ref{section-gd-documenting-c-algos}, we can
-add external documentation to algorithms written in C and, using the
-|documentation_in| method of the |key| class, we can use the exact
-same method to document \textsc{ogdf} algorithms.
+As explained in Section~\ref{section-gd-documenting-c-algos}, we can add
+external documentation to algorithms written in C and, using the
+|documentation_in| method of the |key| class, we can use the exact same method
+to document \textsc{ogdf} algorithms.
I strongly recommend making use of this feature since, currently, the
-documentation of many \textsc{ogdf} classes is sketchy at best and
-using \tikzname\ examples seems to be a good way of explaining the
-effect of the different parameters algorithms offer.
-
+documentation of many \textsc{ogdf} classes is sketchy at best and using
+\tikzname\ examples seems to be a good way of explaining the effect of the
+different parameters algorithms offer.
\subsubsection{The Interface From OGDF}
-The support for \textsc{ogdf} offered inside |InterfaceFromOGDF.h| is
-just the class |ogdf_runner| we saw already
-in the example. In addition, there is also a wrapper class
-|ogdf_function_runner| that allows you to wrap an algorithm
-implemented in a function that uses \textsc{ogdf}, but I expect this
-to be the case only rarely.
+The support for \textsc{ogdf} offered inside |InterfaceFromOGDF.h| is just the
+class |ogdf_runner| we saw already in the example. In addition, there is also a
+wrapper class |ogdf_function_runner| that allows you to wrap an algorithm
+implemented in a function that uses \textsc{ogdf}, but I expect this to be the
+case only rarely.
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-binding-layer.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-binding-layer.tex
index 422d7d8d0a2..b677de2175a 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-binding-layer.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-binding-layer.tex
@@ -15,66 +15,66 @@
\section{The Binding Layer}
-
\label{section-gd-binding-layer}
-\ifluatex\else This section of the manual can only be typeset using Lua\TeX.\expandafter\endinput\fi
+\ifluatex
+\else
+ This section of the manual can only be typeset using Lua\TeX.
+ \expandafter\endinput
+\fi
+
\subsection{Overview}
-This section explains how the \emph{binding} of the graph drawing
-system to a particular display layer works. Let me stress
-that all of this is important only for readers who
+This section explains how the \emph{binding} of the graph drawing system to a
+particular display layer works. Let me stress that all of this is important
+only for readers who
+%
\begin{itemize}
-\item either wish to write new display system (see
- Section~\ref{section-gd-display-layer})
-\item or wish to know more about how the graph drawing system works on
- the pure \pgfname\ layer (this is were the binding occurs).
+ \item either wish to write new display system (see
+ Section~\ref{section-gd-display-layer})
+ \item or wish to know more about how the graph drawing system works on the
+ pure \pgfname\ layer (this is were the binding occurs).
\end{itemize}
-\emph{Bindings} are used to encapsulate the details of the
-communication between the graph drawing system and a display system
-(see Section~\ref{section-gd-display-layer} for an introduction to
-display systems).
-
-Consider a display system that communicates with the graph drawing
-system. At some point, the display system would like to run an
-algorithm to lay out a graph. To achieve this, it will call different
-functions from the class |InterfaceToDisplay| and the effect of this
-is that a representation of the to-be-drawn graph is constructed
-internally and that the appropriate algorithms are run. All of this is
-in some sense independent of the actual display system, the class
-|InterfaceToDisplay| offers the same standard interface to all display
-systems.
-
-At some point, however, the graph drawing system may need to ``talk
-back'' to the display system. For instance, once the graph has been
-laid out, to trigger the actual rendering of the graph, the graph
-drawing system must ``tell'' the display layer where the vertices
-lie. For some display systems this is easy: if the display system
-itself is written in Lua, it could just access the syntactic digraph
-directly. However, for systems like \tikzname\ or systems written in
-another language, the graph drawing system needs a set of functions
-that it can call that will tell the display system what is going
-on. This is were bindings come in.
-
-The class |Binding| is an interface that defines numerous methods that
-will be called by the graph drawing system in different situations (see
-the documentation below for details). For instance, there is a
-function |renderVertex| that is called by the graph drawing system
-whenever a vertex should be rendered by the display system. The class
-is really just an interface in the sense of object-oriented
-programming. For each display system you need to create a subclass of
-|Binding| like |BindingToPGF| or |BindingToASCII| that implement the
-methods declared by |Binding|. The number of methods that need to be
-implemented depends on the display system.
-
-In the following, you will find the documentation of the |Binding|
-class in Section~\ref{section-gd-binding-doc}. Following this, we
-first have a quick look at how the |BindingToPGF| works and then go
-over a simple example of a binding to a more or less imaginary
-display system. This example should help readers interested in
-implementing their own bindings.
+\emph{Bindings} are used to encapsulate the details of the communication
+between the graph drawing system and a display system (see
+Section~\ref{section-gd-display-layer} for an introduction to display systems).
+
+Consider a display system that communicates with the graph drawing system. At
+some point, the display system would like to run an algorithm to lay out a
+graph. To achieve this, it will call different functions from the class
+|InterfaceToDisplay| and the effect of this is that a representation of the
+to-be-drawn graph is constructed internally and that the appropriate algorithms
+are run. All of this is in some sense independent of the actual display system,
+the class |InterfaceToDisplay| offers the same standard interface to all
+display systems.
+
+At some point, however, the graph drawing system may need to ``talk back'' to
+the display system. For instance, once the graph has been laid out, to trigger
+the actual rendering of the graph, the graph drawing system must ``tell'' the
+display layer where the vertices lie. For some display systems this is easy: if
+the display system itself is written in Lua, it could just access the syntactic
+digraph directly. However, for systems like \tikzname\ or systems written in
+another language, the graph drawing system needs a set of functions that it can
+call that will tell the display system what is going on. This is were bindings
+come in.
+
+The class |Binding| is an interface that defines numerous methods that will be
+called by the graph drawing system in different situations (see the
+documentation below for details). For instance, there is a function
+|renderVertex| that is called by the graph drawing system whenever a vertex
+should be rendered by the display system. The class is really just an interface
+in the sense of object-oriented programming. For each display system you need
+to create a subclass of |Binding| like |BindingToPGF| or |BindingToASCII| that
+implement the methods declared by |Binding|. The number of methods that need to
+be implemented depends on the display system.
+
+In the following, you will find the documentation of the |Binding| class in
+Section~\ref{section-gd-binding-doc}. Following this, we first have a quick
+look at how the |BindingToPGF| works and then go over a simple example of a
+binding to a more or less imaginary display system. This example should help
+readers interested in implementing their own bindings.
\subsection{The Binding Class and the Interface Core}
@@ -94,15 +94,15 @@ implementing their own bindings.
\label{section-gd-binding-layer-example}
In the present section a complete binding is presented to an imaginary
-``\textsc{ascii} art display system'' is presented. The idea is that
-this display system will depict graphs using just normal letters and
-spaces so that, when the text is typeset in a monospace font, a
-visualization of the graph results. For instance:
+``\textsc{ascii} art display system'' is presented. The idea is that this
+display system will depict graphs using just normal letters and spaces so that,
+when the text is typeset in a monospace font, a visualization of the graph
+results. For instance:
\bigskip
\noindent
\begin{minipage}[t]{.5\textwidth}
-\emph{Graph rendered by |BindingToPGF|:}
+\emph{Graph rendered by |BindingToPGF|:}
\medskip
\tikz [anchor=base]\graph [layered layout,level distance=2.35cm,sibling
@@ -127,44 +127,44 @@ distance=1.2cm,edges={rounded corners,>=spaced stealth'}] {
};
\end{minipage}%
\begin{minipage}[t]{.49\textwidth}
-\emph{Graph rendered by |BindingToASCII|:}
-
+\emph{Graph rendered by |BindingToASCII|:}
+
\begin{verbatim}
- Alice
- .......
- .. . . .
- ... . . .
- ... .. . ..
- .. . . .
- Charly Bob . .
- .. . . .
- . . . .
- . . . .
- .. . . .
- .. . .
- Dave George .
- .. . ... .
- . . .. .
- . . ...
- .. . . ...
- .. . ..
- Eve . ..
- .. . ..
- . . .
- . . .
- .. . ..
- ...
- Fritz
+ Alice
+ .......
+ .. . . .
+ ... . . .
+ ... .. . ..
+ .. . . .
+ Charly Bob . .
+ .. . . .
+ . . . .
+ . . . .
+ .. . . .
+ .. . .
+ Dave George .
+ .. . ... .
+ . . .. .
+ . . ...
+ .. . . ...
+ .. . ..
+ Eve . ..
+ .. . ..
+ . . .
+ . . .
+ .. . ..
+ ...
+ Fritz
\end{verbatim}
\end{minipage}
\bigskip
-The binding will reside in a file |BindingToASCII.lua|, whose contents
-is detailed below, and which is used by calling the |bind| function of
+The binding will reside in a file |BindingToASCII.lua|, whose contents is
+detailed below, and which is used by calling the |bind| function of
|InterfaceToDisplay|, see its documentation for details.
The binding's code starts with some initializations:
-
+%
\begin{codeexample}[code only]
-- File BindingToASCII.lua
@@ -175,19 +175,18 @@ local lib = require "pgf.gd.lib"
local BindingToASCII = lib.class { base_class = require "pgf.gd.bindings.Binding" }
\end{codeexample}
-The interesting code is the code for
-``rendering'' a graph. The graph drawing system will invoke the
-binding's methods |renderStart| and |renderStop| to signal that the
-graph drawing algorithms have finished and that the vertices and edges
-can now be drawn.
-
-In our \textsc{ascii} renderer, we use a two-dimensional field holding
-characters that severs as the ``drawing canvas''. At the beginning of
-the rendering, we initialize it with blanks:
+The interesting code is the code for ``rendering'' a graph. The graph drawing
+system will invoke the binding's methods |renderStart| and |renderStop| to
+signal that the graph drawing algorithms have finished and that the vertices
+and edges can now be drawn.
+In our \textsc{ascii} renderer, we use a two-dimensional field holding
+characters that severs as the ``drawing canvas''. At the beginning of the
+rendering, we initialize it with blanks:
+%
\begin{codeexample}[code only]
local canvas
-
+
function BindingToASCII:renderStart()
canvas = {}
-- Clear the canvas
@@ -200,29 +199,26 @@ function BindingToASCII:renderStart()
end
\end{codeexample}
-In order to ``render'' a vertex, the graph drawing system will call
-the |renderVertex| method. The binding of \tikzname\ does a lot of
-complicated things in this method to retrieve the underlying node's
-box from internal table and to somehow reinstall the box in \TeX's
-output stream; for our \textsc{ascii} binding things are much simpler:
-We simply put the vertex's name at the canvas position corresponding
-to the vertex's |pos| coordinate. Note that this simple version of an
-\textsc{ascii} renderer does not try to scale things; thus, array out
-of bounds might occur here.
-
+In order to ``render'' a vertex, the graph drawing system will call the
+|renderVertex| method. The binding of \tikzname\ does a lot of complicated
+things in this method to retrieve the underlying node's box from internal table
+and to somehow reinstall the box in \TeX's output stream; for our
+\textsc{ascii} binding things are much simpler: We simply put the vertex's name
+at the canvas position corresponding to the vertex's |pos| coordinate. Note
+that this simple version of an \textsc{ascii} renderer does not try to scale
+things; thus, array out of bounds might occur here.
+%
\begin{codeexample}[code only]
function BindingToASCII:renderVertex(v)
canvas [math.floor(v.pos.x)][math.floor(v.pos.y)] = v.name
end
\end{codeexample}
-The rendering of edges is a more complicated process. Given two
-vertices, we put dots at the canvas positions between them; provided
-there are no vertices (so edges are behind the nodes). Here is the
-essential part of the code (for the complete code, have a look at
-|pgf/gd/examples/BindingToASCII.lua|):
-
-
+The rendering of edges is a more complicated process. Given two vertices, we
+put dots at the canvas positions between them; provided there are no vertices
+(so edges are behind the nodes). Here is the essential part of the code (for
+the complete code, have a look at |pgf/gd/examples/BindingToASCII.lua|):
+%
\begin{codeexample}[code only]
function BindingToASCII:renderEdge(e)
local function connect (p,q)
@@ -235,33 +231,31 @@ function BindingToASCII:renderEdge(e)
local slope = delta_y/delta_x
for i=x1,x2 do
local x,y = i, math.floor(y1 + (i-x1)*slope + 0.5)
-
+
if canvas[x][y] == " " then
canvas[x][y] = '.'
end
end
...
end
-
+
-- Iterate over all points on the path from tail to head:
local p = e.tail.pos
for i=1,#e.path do
connect(p, e.tail.pos + e.path[i])
p = e.tail.pos + e.path[i]
- end
+ end
connect(p, e.head.pos)
end
\end{codeexample}
-
-The methods |renderVertex| and |renderEdge| will be called once for
-each vertex and edge of the to-be-rendered graph. At the end, the
-|renderStop| method is called. In our case, this method will output
-the canvas using |print|. A slight complication arises when node names
-are longer than just one character. In this case, the following code
-``centers'' them on their coordinate and makes sure that they do not
-get overwritten by the dots forming edges:
-
+The methods |renderVertex| and |renderEdge| will be called once for each vertex
+and edge of the to-be-rendered graph. At the end, the |renderStop| method is
+called. In our case, this method will output the canvas using |print|. A slight
+complication arises when node names are longer than just one character. In this
+case, the following code ``centers'' them on their coordinate and makes sure
+that they do not get overwritten by the dots forming edges:
+%
\begin{codeexample}[code only]
function BindingToASCII:renderStop()
for y=10,-30,-1 do
@@ -281,9 +275,7 @@ end
\end{codeexample}
At the end, we need to return the created object:
-
+%
\begin{codeexample}[code only]
return BindingToASCII
\end{codeexample}
-
-
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-circular.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-circular.tex
index fefb7c4aff6..c503936db02 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-circular.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-circular.tex
@@ -7,19 +7,23 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Graph Drawing Algorithms: Circular Layouts}
{\noindent {\emph{by Till Tantau}}}
-\ifluatex\else This section of the manual can only be typeset using Lua\TeX.\expandafter\endinput\fi
+\ifluatex
+\else
+ This section of the manual can only be typeset using Lua\TeX.
+ \expandafter\endinput
+\fi
\includeluadocumentationof{pgf.gd.circular.library}
\includeluadocumentationof{pgf.gd.circular.Tantau2012}
-
-%%% 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-gd-display-layer.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-display-layer.tex
index d5848375067..46b1d5db041 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-display-layer.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-display-layer.tex
@@ -15,159 +15,155 @@
\section{The Display Layer}
+\label{section-gd-display-layer}
{\noindent {\itshape{by Till Tantau}}}
-\ifluatex\else This section of the manual can only be typeset using Lua\TeX.\expandafter\endinput\fi
+\ifluatex
+\else
+ This section of the manual can only be typeset using Lua\TeX.
+ \expandafter\endinput
+\fi
-\label{section-gd-display-layer}
\begin{quote}
- \itshape You do not need to read this section in order to write new
- graph drawing algorithms. It is of interest only to those wishing to
- write programs that wish to ``use'' the graph drawing system in a
- similar way that \tikzname\ does for laying out graphs that are
- generated and then passed down from the program to the graph drawing
- system.
+ \itshape You do not need to read this section in order to write new graph
+ drawing algorithms. It is of interest only to those wishing to write
+ programs that wish to ``use'' the graph drawing system in a similar way
+ that \tikzname\ does for laying out graphs that are generated and then
+ passed down from the program to the graph drawing system.
\end{quote}
\subsection{Introduction: The Interplay of the Different Layers}
-The job of the graph drawing system is to run graph drawing algorithms
-on graphs. Since graph drawing is useful in many different contexts,
-not only in the context of \tikzname\ for which the present system was
-originally developed, the graph drawing system was designed in such a
-way that it can be used independently of \tikzname. To achieve this,
-the \emph{display layer} provides an interface via which an arbitrary
-program (\tikzname, a graph editor, a command line interface, etc.)
-``talk'' to the graph drawing system.
-
-To better understand how this works, let us consider the following
-setup:
+The job of the graph drawing system is to run graph drawing algorithms on
+graphs. Since graph drawing is useful in many different contexts, not only in
+the context of \tikzname\ for which the present system was originally
+developed, the graph drawing system was designed in such a way that it can be
+used independently of \tikzname. To achieve this, the \emph{display layer}
+provides an interface via which an arbitrary program (\tikzname, a graph
+editor, a command line interface, etc.) ``talk'' to the graph drawing system.
+To better understand how this works, let us consider the following setup:
+%
\begin{itemize}
-\item A program would like to communicate with the graph
- drawing system. It is written in Java and its job is to analyse social
- networks. This software would like to use graph drawing to produce
- drawings of some ``social graphs'' arising from its analyses. This
- software will be called ``the display system'' in the following.
-\item There are two algorithms that the display system would like to apply to
- the graphs its produces. Let us call these algorithms ``A'' and
- ``B''. However, the display system would also, ideally, wish to make it
- possible that its user chooses other algorithms ``C'' that are not
- necessarily part of its binary.
-\item The display system has internally generated a ``social graph'' that it
- would now like to draw.
+ \item A program would like to communicate with the graph drawing system. It
+ is written in Java and its job is to analyse social networks. This
+ software would like to use graph drawing to produce drawings of some
+ ``social graphs'' arising from its analyses. This software will be
+ called ``the display system'' in the following.
+ \item There are two algorithms that the display system would like to apply
+ to the graphs its produces. Let us call these algorithms ``A'' and
+ ``B''. However, the display system would also, ideally, wish to make it
+ possible that its user chooses other algorithms ``C'' that are not
+ necessarily part of its binary.
+ \item The display system has internally generated a ``social graph'' that
+ it would now like to draw.
\end{itemize}
-For this setup, the communication between the different layers of the
-graph drawing system is as follows:
-
+For this setup, the communication between the different layers of the graph
+drawing system is as follows:
+%
\begin{enumerate}
-\item The display system, being written in Java, must embed Lua to use the
- graph drawing system.
-\item The display system must initialize the graph drawing system. For this,
- it must use |require| on the file |InterfaceToDisplay|, which, as
- the name suggests, contains the interface between the display
- system and the graph drawing system.
-
- It must also create a so-called ``binding'' between the
- graph drawing system and the display layer. See
- Section~\ref{section-gd-binding-layer} for more information on
- bindings.
-\item The display system now needs to load the declarations of the
- algorithms A and B. For this, it just needs to apply |require| to
- the files in which the algorithms reside. This will cause the
- |declare| function to be called. This function is declared by
- |InterfaceToAlgorithms| and allows files to declare that certain
- algorithms and options are now available.
-
- Once this is done, the graph drawing system is fully initialized and
- can be used.
-\item Later on, the display system wishes to lay out a social graph. Note
- that this is known as ``drawing the graph'' in the graph drawing
- community, even though this only means the coordinates are computed
- for the nodes of the graph. The actual ``rendering'' of the graph on
- the display is the job of the display system (hence the name ``display
- layer'').
-\item To start the layout process, the display system calls the function
- |beginGraphDrawingScope| of the class |InterfaceToDisplay|.
-\item Next, for each vertex the function |createVertex| of the
- interface class must be called and similarly for each edge. These
- calls will cause an internal model of the graph to be created on the
- algorithm layer. Options that are attached to nodes and edges are
- also communicated to the graph drawing system through function calls
- like |pushOption|.
-\item When the graph is fully specified, the method
- |runGraphDrawingAlgorithm| must be called, which is once more a
- method of the interface class. This function will internally discern
- which algorithms have been chosen (via options) and invoke the code
- of the appropriate algorithms.
-\item Next, the function |renderGraph| must be called. Its job is to
- ``communicate back'' which coordinates have been computed. It will
- use the binding for this communication, see
- Section~\ref{section-gd-binding-layer}.
-\item Finally, by calling |endGraphDrawingScope|, the resources needed
- for the layout process for the social graph are freed once more.
+ \item The display system, being written in Java, must embed Lua to use the
+ graph drawing system.
+ \item The display system must initialize the graph drawing system. For
+ this, it must use |require| on the file |InterfaceToDisplay|, which, as
+ the name suggests, contains the interface between the display system
+ and the graph drawing system.
+
+ It must also create a so-called ``binding'' between the graph drawing
+ system and the display layer. See
+ Section~\ref{section-gd-binding-layer} for more information on
+ bindings.
+ \item The display system now needs to load the declarations of the
+ algorithms A and B. For this, it just needs to apply |require| to the
+ files in which the algorithms reside. This will cause the |declare|
+ function to be called. This function is declared by
+ |InterfaceToAlgorithms| and allows files to declare that certain
+ algorithms and options are now available.
+
+ Once this is done, the graph drawing system is fully initialized and
+ can be used.
+ \item Later on, the display system wishes to lay out a social graph. Note
+ that this is known as ``drawing the graph'' in the graph drawing
+ community, even though this only means the coordinates are computed for
+ the nodes of the graph. The actual ``rendering'' of the graph on the
+ display is the job of the display system (hence the name ``display
+ layer'').
+ \item To start the layout process, the display system calls the function
+ |beginGraphDrawingScope| of the class |InterfaceToDisplay|.
+ \item Next, for each vertex the function |createVertex| of the interface
+ class must be called and similarly for each edge. These calls will
+ cause an internal model of the graph to be created on the algorithm
+ layer. Options that are attached to nodes and edges are also
+ communicated to the graph drawing system through function calls like
+ |pushOption|.
+ \item When the graph is fully specified, the method
+ |runGraphDrawingAlgorithm| must be called, which is once more a method
+ of the interface class. This function will internally discern which
+ algorithms have been chosen (via options) and invoke the code of the
+ appropriate algorithms.
+ \item Next, the function |renderGraph| must be called. Its job is to
+ ``communicate back'' which coordinates have been computed. It will use
+ the binding for this communication, see
+ Section~\ref{section-gd-binding-layer}.
+ \item Finally, by calling |endGraphDrawingScope|, the resources needed for
+ the layout process for the social graph are freed once more.
\end{enumerate}
A few points may be noteworthy:
+%
\begin{itemize}
-\item The whole communication between the display system and the graph
- drawing system goes through the interface class via function
- calls. This makes it easy to communicate with display system whose
- internal model of graphs is quite different from the one used in Lua
- (as is certainly the case for \TeX, but also the ``social graph''
- mentioned above need not even exist as a separate entity inside the
- display system).
-
- \emph{The display system should only rely on the interface
- class. All communication has to go through this class, the
- display system may not access the internals of the internally
- constructed graphs directly.}
-\item New algorithms can be loaded at runtime, as long as the
- |require| method is supported.
-\item The display system can also use the interface class to query which
- algorithms and which options are available in principle (and display
- this information to the user). The display system can even get access the
- documentation of the options at runtime since the documentation is
- stored in fields of the declared options.
+ \item The whole communication between the display system and the graph
+ drawing system goes through the interface class via function calls.
+ This makes it easy to communicate with display system whose internal
+ model of graphs is quite different from the one used in Lua (as is
+ certainly the case for \TeX, but also the ``social graph'' mentioned
+ above need not even exist as a separate entity inside the display
+ system).
+
+ \emph{The display system should only rely on the interface class. All
+ communication has to go through this class, the display system may not
+ access the internals of the internally constructed graphs directly.}
+ \item New algorithms can be loaded at runtime, as long as the |require|
+ method is supported.
+ \item The display system can also use the interface class to query which
+ algorithms and which options are available in principle (and display
+ this information to the user). The display system can even get access
+ the documentation of the options at runtime since the documentation is
+ stored in fields of the declared options.
\end{itemize}
-
In the following, we first present a simple display system other than
-\tikzname. The remainder of the section then encompasses a
-documentation of the different functions of the class
-|InterfaceToDisplay|.
-
+\tikzname. The remainder of the section then encompasses a documentation of the
+different functions of the class |InterfaceToDisplay|.
\subsection{An Example Display System}
-In the following, we present the code of a very simple display system
-written in Lua (another such display system is \tikzname\ itself, but
-the minimal system will allow us to focus on what is really
-needed). You will also find it in |pgf.gd.examples.ASCIIDisplayer|.
-
-The job of this display system is to parse a string that encodes a graph
-and to call the appropriate functions of |InterfaceToDisplay| to lay
-out the graph. The actual calls for rendering the graph are part of
-the binding, which is documented in
-Section~\ref{section-gd-binding-layer-example}.
-
-The syntax of the to-be-laid-out graph is a reduced version of
-\tikzname's |graph| syntax: The string must start with
-|graph[|\meta{algorithm's name}|]{| and end with |}|. Between the
-braces, all lines must either be of the form \meta{node name}|;| or
-\meta{name 1}|->|\meta{name 2}|;| with optional spaces around the node
-names.
-
-Let us now have a look at what we must do to use the graph drawing
-system. First, we load some libraries and initialize the binding (see
-Section~\ref{section-gd-binding-layer-example} for details on the
-binding; we can ignore it for now).
-
+In the following, we present the code of a very simple display system written
+in Lua (another such display system is \tikzname\ itself, but the minimal
+system will allow us to focus on what is really needed). You will also find it
+in |pgf.gd.examples.ASCIIDisplayer|.
+
+The job of this display system is to parse a string that encodes a graph and to
+call the appropriate functions of |InterfaceToDisplay| to lay out the graph.
+The actual calls for rendering the graph are part of the binding, which is
+documented in Section~\ref{section-gd-binding-layer-example}.
+
+The syntax of the to-be-laid-out graph is a reduced version of \tikzname's
+|graph| syntax: The string must start with |graph[|\meta{algorithm's name}|]{|
+and end with |}|. Between the braces, all lines must either be of the form
+\meta{node name}|;| or \meta{name 1}|->|\meta{name 2}|;| with optional spaces
+around the node names.
+
+Let us now have a look at what we must do to use the graph drawing system.
+First, we load some libraries and initialize the binding (see
+Section~\ref{section-gd-binding-layer-example} for details on the binding; we
+can ignore it for now).
+%
\begin{codeexample}[code only]
local InterfaceToDisplay = require "pgf.gd.interface.InterfaceToDisplay"
InterfaceToDisplay.bind(require "pgf.gd.examples.BindingToASCII")
@@ -178,13 +174,14 @@ require "pgf.gd.layered.library"
require "pgf.gd.force.library"
\end{codeexample}
-Now comes some preparation code that starts a graph drawing scope and
-sets up the algorithm to the string provided between the square
-brackets:
+Now comes some preparation code that starts a graph drawing scope and sets up
+the algorithm to the string provided between the square \todosp{should
+\texttt{.pushPhase} be \texttt{.pushOption}? (bug \#396)} brackets:
+%
\begin{codeexample}[code only]
local algorithm = io.read():match("%s*graph%s*%[(.-)%]")
-
+
InterfaceToDisplay.pushPhase(algorithm, "main", 1)
InterfaceToDisplay.pushOption("level distance", 6, 2)
InterfaceToDisplay.pushOption("sibling distance", 8, 3)
@@ -192,13 +189,11 @@ InterfaceToDisplay.beginGraphDrawingScope(3)
InterfaceToDisplay.pushLayout(4)
\end{codeexample}
-The numbers |1| to |4| are the positions on the options stack at which
-the options should be placed. See the description of |pushOption| for
-more details.
-
-We are now ready to create the vertices and edges via a very simple
-parser:
+The numbers |1| to |4| are the positions on the options stack at which the
+options should be placed. See the description of |pushOption| for more details.
+We are now ready to create the vertices and edges via a very simple parser:
+%
\begin{codeexample}[code only]
for line in io.lines() do
if line:match("}") then
@@ -213,24 +208,23 @@ for line in io.lines() do
end
\end{codeexample}
-The graph is now completely constructed inside the graph drawing
-system. We can now invoke the algorithms:
-
+The graph is now completely constructed inside the graph drawing system. We can
+now invoke the algorithms:
+%
\begin{codeexample}[code only]
InterfaceToDisplay.runGraphDrawingAlgorithm()
InterfaceToDisplay.renderGraph()
InterfaceToDisplay.endGraphDrawingScope()
\end{codeexample}
-We can now run the resulting file using the Lua interpreter. If we
-provide the input shown on the left, we get the output shown on the
-right:
+We can now run the resulting file using the Lua interpreter. If we provide the
+input shown on the left, we get the output shown on the right:
\bigskip
\noindent
\begin{minipage}[t]{.5\textwidth}
-\emph{Input given to ASCIIDisplayer:}
-
+\emph{Input given to ASCIIDisplayer:}
+
\begin{verbatim}
graph [layered layout] {
Alice;
@@ -250,38 +244,38 @@ graph [layered layout] {
George -> Eve;
George -> Fritz;
Alice -> George;
-}
+}
\end{verbatim}
\end{minipage}%
\begin{minipage}[t]{.49\textwidth}
-\emph{Output produced by ASCIIDisplayer:}
-
+\emph{Output produced by ASCIIDisplayer:}
+
\begin{verbatim}
- Alice
- .......
- .. . . .
- ... . . .
- ... .. . ..
- .. . . .
- Charly Bob . .
- .. . . .
- . . . .
- . . . .
- .. . . .
- .. . .
- Dave George .
- .. . ... .
- . . .. .
- . . ...
- .. . . ...
- .. . ..
- Eve . ..
- .. . ..
- . . .
- . . .
- .. . ..
- ...
- Fritz
+ Alice
+ .......
+ .. . . .
+ ... . . .
+ ... .. . ..
+ .. . . .
+ Charly Bob . .
+ .. . . .
+ . . . .
+ . . . .
+ .. . . .
+ .. . .
+ Dave George .
+ .. . ... .
+ . . .. .
+ . . ...
+ .. . . ...
+ .. . ..
+ Eve . ..
+ .. . ..
+ . . .
+ . . .
+ .. . ..
+ ...
+ Fritz
\end{verbatim}
\end{minipage}
@@ -289,4 +283,3 @@ graph [layered layout] {
\subsection{The Interface to Display Systems}
\includeluadocumentationof{pgf.gd.interface.InterfaceToDisplay}
-
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-edge-routing.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-edge-routing.tex
index 170ff044a9c..4c4fa8cab37 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-edge-routing.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-edge-routing.tex
@@ -7,23 +7,27 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\section{Graph Drawing Algorithms: Edge Routing}
+\section{Graph Drawing Algorithms: Edge Routing}
\label{section-last-graphdrawing-library-in-manual}
-{\noindent {\emph{by Till Tantau}}}
+{\noindent{\emph{by Till Tantau}}\todosp{Why is a second label here? The second
+doesn't seem to be used.}}
\label{section-gd-edge-routing}
-\ifluatex\else This section of the manual can only be typeset using Lua\TeX.\expandafter\endinput\fi
+\ifluatex
+\else
+ This section of the manual can only be typeset using Lua\TeX.
+ \expandafter\endinput
+\fi
\includeluadocumentationof{pgf.gd.routing.library}
\includeluadocumentationof{pgf.gd.routing.NecklaceRouting}
-
-%%% 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-gd-force.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-force.tex
index 1925de99765..514351e5347 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-force.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-force.tex
@@ -7,26 +7,28 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Graph Drawing Algorithms: Force-Based Methods}
\label{section-library-graphdrawing-force-based}
{\emph{by Till Tantau and Jannis Pohlmann}}
-\ifluatex\else This section of the manual can only be typeset using Lua\TeX.\expandafter\endinput\fi
+\ifluatex
+\else
+ This section of the manual can only be typeset using Lua\TeX.
+ \expandafter\endinput
+\fi
\includeluadocumentationof{pgf.gd.force.library}
-\includeluadocumentationof{pgf.gd.force.Control}
+\includeluadocumentationof{pgf.gd.force.ControlDeclare}
\includeluadocumentationof{pgf.gd.force.ControlStart}
\includeluadocumentationof{pgf.gd.force.ControlIteration}
\includeluadocumentationof{pgf.gd.force.ControlSprings}
\includeluadocumentationof{pgf.gd.force.ControlElectric}
\includeluadocumentationof{pgf.gd.force.ControlCoarsening}
-
-
-
\includeluadocumentationof{pgf.gd.force.SpringLayouts}
\includeluadocumentationof{pgf.gd.force.SpringHu2006}
@@ -35,9 +37,7 @@
\includeluadocumentationof{pgf.gd.force.SpringElectricalWalshaw2000}
-\endinput
-
-%%% 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-gd-layered.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-layered.tex
index f4c1704b827..4f68dae40ff 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-layered.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-layered.tex
@@ -7,11 +7,16 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Graph Drawing Algorithms: Layered Layouts}
{\emph{by Till Tantau and Jannis Pohlmann}}
-\ifluatex\else This section of the manual can only be typeset using Lua\TeX.\expandafter\endinput\fi
+\ifluatex
+\else
+ This section of the manual can only be typeset using Lua\TeX.
+ \expandafter\endinput
+\fi
\includeluadocumentationof{pgf.gd.layered.library}
\includeluadocumentationof{pgf.gd.layered.Sugiyama}
@@ -22,7 +27,7 @@
\includeluadocumentationof{pgf.gd.layered.edge_routing}
-%%% 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-gd-ogdf.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-ogdf.tex
index d2828108ba0..579606e54c6 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-ogdf.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-ogdf.tex
@@ -9,29 +9,33 @@
\section[Graph Drawing Algorithms: The Open Graph Drawing Framework]{Graph Drawing Algorithms:\\ The Open Graph Drawing Framework}
+% TODO:{
% ATTENTION: this label is ALSO present in the previous algorithm.
% Please update the labels once this section is back in the manual
+% }
\label{section-last-graphdrawing-library-in-manual}
-
{\emph{by Till Tantau (who copied much of the text from
the source documentation of \textsc{ogdf})}}
-\ifluatex\else This section of the manual can only be typeset using Lua\TeX.\expandafter\endinput\fi
+\ifluatex
+\else
+ This section of the manual can only be typeset using Lua\TeX.
+ \expandafter\endinput
+\fi
\ifgdccodeogdf
\else
-In order to typeset this section, LuaTeX\ must be able to link C code
-at runtime and the \textsc{ogdf} graph drawing C libraries must be
-installed on your system. You will find the sources in the |c|
-subdirectory of the installation, where you will also find example
-Makefiles.
-\expandafter\endinput
+ In order to typeset this section, LuaTeX\ must be able to link C code at
+ runtime and the \textsc{ogdf} graph drawing C libraries must be installed
+ on your system. You will find the sources in the |c| subdirectory of the
+ installation, where you will also find example Makefiles.
+ \expandafter\endinput
\fi
\emph{Remark:} The integration of the \textsc{ogdf} library is still under
-construction and the examples in this section are more a
-proof-of-concept. So, use at your own risk.
+construction and the examples in this section are more a proof-of-concept. So,
+use at your own risk.
\includeluadocumentationof{pgf.gd.ogdf.library}
@@ -60,8 +64,6 @@ proof-of-concept. So, use at your own risk.
\includeluadocumentationof{pgf.gd.doc.ogdf.layered.FastSimpleHierarchyLayout}
-
-
\includeluadocumentationof{pgf.gd.doc.ogdf.energybased}
\includeluadocumentationof{pgf.gd.doc.ogdf.energybased.SpringEmbedderFR}
@@ -95,7 +97,6 @@ proof-of-concept. So, use at your own risk.
% \includeluadocumentationof{pgf.gd.doc.ogdf.energybased.multilevelmixer.SolarMerger}
-
\includeluadocumentationof{pgf.gd.doc.ogdf.planarity}
\includeluadocumentationof{pgf.gd.doc.ogdf.planarity.PlanarizationLayout}
@@ -108,8 +109,7 @@ proof-of-concept. So, use at your own risk.
\includeluadocumentationof{pgf.gd.doc.ogdf.misclayout.CircularLayout}
-
-%%% 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-gd-overview.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-overview.tex
index 4c86aa0ed47..39ecd659a87 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-overview.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-overview.tex
@@ -10,32 +10,32 @@
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-
\section{Introduction to Algorithmic Graph Drawing}
\label{section-intro-gd}
\emph{by Till Tantau}
-\ifluatex\else This section of the manual can only be typeset using Lua\TeX.\expandafter\endinput\fi
+\ifluatex
+\else
+ This section of the manual can only be typeset using Lua\TeX.
+ \expandafter\endinput
+\fi
\subsection{What Is Algorithmic Graph Drawing?}
-
-
\emph{Algorithmic graph drawing} (or just \emph{graph drawing} in the
-following) is the process of computing algorithmically where the nodes of
-a graph are positioned on a page so that the graph ``looks nice.'' The
-idea is that you, as human (or you, as a machine, if you happen to be
-a machine and happen to be reading this document) just specify which
-nodes are present in a graph and which edges are
-present. Additionally, you may add some ``hints'' like ``this node
-should be near the center'' or ``this edge is pretty important.'' You
-do \emph{not} specify where, exactly, the nodes and edges should
-be. This is something you leave to a \emph{graph drawing
- algorithm}. The algorithm gets your description of the graph as an
-input and then decides where the nodes should go on the page.
-
+following) is the process of computing algorithmically where the nodes of a
+graph are positioned on a page so that the graph ``looks nice''. The idea is
+that you, as human (or you, as a machine, if you happen to be a machine and
+happen to be reading this document) just specify which nodes are present in a
+graph and which edges are present. Additionally, you may add some ``hints''
+like ``this node should be near the center'' or ``this edge is pretty
+important''. You do \emph{not} specify where, exactly, the nodes and edges
+should be. This is something you leave to a \emph{graph drawing algorithm}. The
+algorithm gets your description of the graph as an input and then decides where
+the nodes should go on the page.
+%
\begin{codeexample}[]
\tikz \graph [binary tree layout, level distance=5mm] {
4 -- {
@@ -49,6 +49,8 @@ input and then decides where the nodes should go on the page.
\end{codeexample}
\begin{codeexample}[]
+% \usetikzlibrary{graphs,graphdrawing,quotes}
+% \usegdlibrary{force}
\tikz \graph [spring layout,
edge quotes mid,
edges={nodes={font=\scriptsize, fill=white, sloped, inner sep=1pt}}]
@@ -56,49 +58,49 @@ input and then decides where the nodes should go on the page.
1 ->["Das"] 2 ->["ist"] 3 ->["das"] 4 ->["Haus"]
2 ->["vom" near start] 5 ->["Ni"] 4 ->["ko" near start]
1 ->["laus", orient=right] 5;
-};
+};
\end{codeexample}
-Naturally, graph drawing is a bit of a (black?) art. There is no
-``perfect'' way of drawing a graph, rather, depending on the
-circumstances there are several different ways of drawing the same
-graph and often it will just depend on the aesthetic sense of the
-reader which layout he or she would prefer. For this reason, there are
-a huge number of graph drawing algorithms ``out there'' and there are
-scientific conference devoted to such algorithms, where each
-year dozens of new algorithms are proposed.
-
-Unlike the rest of \pgfname\ and \tikzname, which is implemented
-purely in \TeX, the graph drawing algorithms are simply too complex to
-be implemented directly in \TeX. Instead, the programming language Lua is used
-by the graph drawing library -- a programming language that has been
-integrated into recent versions of \TeX. This means that (a) as a user
-of the graph drawing engine you run \TeX\ on your documents
-in the usual way, no external programs are called since Lua is already
-integrated into \TeX, and (b) it is pretty easy to implement new graph
-drawing algorithms for \tikzname\ since Lua can be used and no \TeX\
-programming knowledge is needed.
+Naturally, graph drawing is a bit of a (black?) art. There is no ``perfect''
+way of drawing a graph, rather, depending on the circumstances there are
+several different ways of drawing the same graph and often it will just depend
+on the aesthetic sense of the reader which layout he or she would prefer. For
+this reason, there are a huge number of graph drawing algorithms ``out there''
+and there are scientific conference devoted to such algorithms, where each year
+dozens of new algorithms are proposed.
+
+Unlike the rest of \pgfname\ and \tikzname, which is implemented purely in
+\TeX, the graph drawing algorithms are simply too complex to be implemented
+directly in \TeX. Instead, the programming language Lua is used by the graph
+drawing library -- a programming language that has been integrated into recent
+versions of \TeX. This means that (a) as a user of the graph drawing engine you
+run \TeX\ on your documents in the usual way, no external programs are called
+since Lua is already integrated into \TeX, and (b) it is pretty easy to
+implement new graph drawing algorithms for \tikzname\ since Lua can be used and
+no \TeX\ programming knowledge is needed.
\subsection{Using the Graph Drawing System}
-``Users'' of the graph drawing engine can invoke the graph
-drawing algorithms often by just adding a single option to their
-picture. Here is a typical example, where the |layered layout| option
-tells \tikzname\ that the graph should be drawn (``should be layed
-out'') using a so-called ``layered graph drawing algorithm'' (what
-these are will be explained later):
+``Users'' of the graph drawing engine can invoke the graph drawing algorithms
+often by just adding a single option to their picture. Here is a typical
+example, where the |layered layout| option tells \tikzname\ that the graph
+should be drawn (``should be laid out'') using a so-called ``layered graph
+drawing algorithm'' (what these are will be explained later):
+%
\begin{codeexample}[]
\tikz [>=spaced stealth']
\graph [layered layout, components go right top aligned, nodes=draw, edges=rounded corners]
{
first root -> {1 -> {2, 3, 7} -> {4, 5}, 6 }, 4 -- 5;
second root -> x -> {a -> {u,v}, b, c -> d -> {w,z} };
- third root -> child -> grandchild -> youngster -> third root;
+ third root -> child -> grandchild -> youngster -> third root;
};
\end{codeexample}
-Here is another example, where a different layout method is used
-that is more appropriate for trees:
+%
+Here is another example, where a different layout method is used that is more
+appropriate for trees:
+%
\begin{codeexample}[]
\tikz [grow'=up, binary tree layout, nodes={circle,draw}]
\node {1}
@@ -116,8 +118,10 @@ that is more appropriate for trees:
}
};
\end{codeexample}
-A final example, this time using a ``spring electrical layout''
-(whatever that might be\dots):
+%
+A final example, this time using a ``spring electrical layout'' (whatever that
+might be\dots):
+%
\begin{codeexample}[]
\tikz [spring electrical layout, node distance=1.3cm,
every edge/.style={
@@ -127,7 +131,7 @@ A final example, this time using a ``spring electrical layout''
{
\foreach \i in {1,...,6}
\node (node \i) [fill=blue!50, text=white, circle] {\i};
-
+
\draw (node 1) edge (node 2)
(node 2) edge (node 3)
edge (node 4)
@@ -136,39 +140,35 @@ A final example, this time using a ``spring electrical layout''
edge (node 6);
}
\end{codeexample}
-In all of the example, the positions of the nodes have only been
-computed \emph{after} all nodes have been created and the edges have
-been specified. For instance, in the last example, without the
-option |spring electrical layout|, all of the nodes would have been
-placed on top of each other.
+%
+In all of the example, the positions of the nodes have only been computed
+\emph{after} all nodes have been created and the edges have been specified. For
+instance, in the last example, without the option |spring electrical layout|,
+all of the nodes would have been placed on top of each other.
\subsection{Extending the Graph Drawing System}
-The graph drawing engine is also intended to make is
-(relatively) easy to implement new graph drawing algorithms. These
-algorithms can either be implemented in the Lua programming
-language (which is \emph{much} easier to program than \TeX\
-itself) or in C/C++ (but at a great cost regarding portability). The
-Lua code for a graph drawing algorithm gets an
-object-oriented model of the input graph as an input and must just
-compute the desired new positions of the nodes. The complete
-handling of passing options and configurations back-and-forth
-between the different \tikzname\ and \pgfname\ layers is handled by
-the graph drawing engine.
-
-As a caveat, the graph drawing engine comes with a library of
-functions and methods that simplify the writing of new
-graph drawing algorithms. As a typical example, when you implement a
-graph drawing algorithm for trees, you typically require that your
-input is a tree; but you can bet that users will feed all sorts of
-graphs to your algorithm, including disjoint unions of cliques. The
-graph drawing engine offers you to say that a precondition to running
-your algorithm is that the graph is a |tree| and instead of the original graph your
-algorithm will be provided with a spanning tree of the graph on
-which it can work. There are numerous further automatic pre- and
-postprocessing steps that include orienting, anchoring, and packing
-of components, to name a few.
+The graph drawing engine is also intended to make is (relatively) easy to
+implement new graph drawing algorithms. These algorithms can either be
+implemented in the Lua programming language (which is \emph{much} easier to
+program than \TeX\ itself) or in C/C++ (but at a great cost regarding
+portability). The Lua code for a graph drawing algorithm gets an
+object-oriented model of the input graph as an input and must just compute the
+desired new positions of the nodes. The complete handling of passing options
+and configurations back-and-forth between the different \tikzname\ and
+\pgfname\ layers is handled by the graph drawing engine.
+
+As a caveat, the graph drawing engine comes with a library of functions and
+methods that simplify the writing of new graph drawing algorithms. As a typical
+example, when you implement a graph drawing algorithm for trees, you typically
+require that your input is a tree; but you can bet that users will feed all
+sorts of graphs to your algorithm, including disjoint unions of cliques. The
+graph drawing engine offers you to say that a precondition to running your
+algorithm is that the graph is a |tree| and instead of the original graph your
+algorithm will be provided with a spanning tree of the graph on which it can
+work. There are numerous further automatic pre- and postprocessing steps that
+include orienting, anchoring, and packing of components, to name a few.
The bottom line is that the graph drawing engine makes it easy
to try out new graph drawing algorithms for medium sized graphs (up
@@ -176,143 +176,131 @@ to a few hundred nodes) in Lua. For larger graphs, C/C++ code must be
used.
-
\subsection{The Layers of the Graph Drawing System}
-
\label{section-gd-layers}
-Even though the graph drawing system presented in the following
-sections was developed as part of \pgfname, it can be used
-independently of \pgfname\ and \tikzname: It was (re)designed so that
-it can be used by arbitrary programs as long as they are able to run
-Lua. To achieve this, the graph drawing system consists of three
-layers:
-
+Even though the graph drawing system presented in the following sections was
+developed as part of \pgfname, it can be used independently of \pgfname\ and
+\tikzname: It was (re)designed so that it can be used by arbitrary programs as
+long as they are able to run Lua. To achieve this, the graph drawing system
+consists of three layers:
+%
\begin{enumerate}
-\item At the ``bottom'' we have the \emph{algorithmic layer}. This
- layer, written in Lua, contains all graph drawing
- algorithms. Interestingly, options must also be declared on this
- layer, so an algorithm together with all options it uses can and
- must be specified entirely on this layer.
- If you intend to implement a new graph drawing algorithm, you will
- only be interested in the functionality of this layer.
-
- Algorithm ``communicate'' with the graph drawing system through
- a well-defined interface, encapsulated in the class
- |InterfaceToAlgorithms|.
-\item At the ``top'' we have the \emph{display layer}. This layer is
- not actually part of the graph drawing system. Rather, it is a piece
- of software that ``displays'' graphs and \tikzname\ is just one
- example of such a software. Another example might be a graph
- editor that uses the graph drawing system to lay out the graph it
- displays. Yet another example might be a command line tool for
- drawing graphs described in a file. Finally, you may also wish to
- use the graph drawing system as a simple subroutine for rendering
- graphs produced in a larger program.
-
- Since the different possible instantiations of the display layer are
- quite heterogeneous, all display layers must communicate with the
- graph drawing system through a special interface, encapsulated in
- the class |InterfaceToDisplay|.
-
- The main job of this class is to provide a set of methods for
- specifying that a graph has certain nodes and edges and that certain
- options have been set for them. However, this interface also allows
- you to query all options that have been declared by algorithms,
- including their documentation. This
- way, an editor or a command line tool can display a list of all
- graph drawing algorithms and how they can be configured.
-\item
- The algorithm layer and the display layer are ``bound together''
- through the \emph{binding layer}. Most of the bookkeeping concerning
- the to-be-drawn graphs is done by the graph drawing system
- independently of which algorithm is used and also independently of
- which display layer is used, but some things are still specific to
- each display layer. For instance, some algorithms may create new
- nodes and the algorithms may then need to know how large these nodes
- will be. For this, the display layer must be ``queried'' during a
- run of the algorithm -- and it is the job of the binding layer to
- achieve this callback.
-
- As a rule, the binding layer implements the ``backward''
- communication from the graph drawing system back to the display
- layer, while the display layer's interface class provides only
- functions that are called from the display layer but which will not
- ``talk back''.
+ \item At the ``bottom'' we have the \emph{algorithmic layer}. This layer,
+ written in Lua, contains all graph drawing algorithms. Interestingly,
+ options must also be declared on this layer, so an algorithm together
+ with all options it uses can and must be specified entirely on this
+ layer. If you intend to implement a new graph drawing algorithm, you
+ will only be interested in the functionality of this layer.
+
+ Algorithm ``communicate'' with the graph drawing system through a
+ well-defined interface, encapsulated in the class
+ |InterfaceToAlgorithms|.
+ \item At the ``top'' we have the \emph{display layer}. This layer is not
+ actually part of the graph drawing system. Rather, it is a piece of
+ software that ``displays'' graphs and \tikzname\ is just one example of
+ such a software. Another example might be a graph editor that uses the
+ graph drawing system to lay out the graph it displays. Yet another
+ example might be a command line tool for drawing graphs described in a
+ file. Finally, you may also wish to use the graph drawing system as a
+ simple subroutine for rendering graphs produced in a larger program.
+
+ Since the different possible instantiations of the display layer are
+ quite heterogeneous, all display layers must communicate with the graph
+ drawing system through a special interface, encapsulated in the class
+ |InterfaceToDisplay|.
+
+ The main job of this class is to provide a set of methods for
+ specifying that a graph has certain nodes and edges and that certain
+ options have been set for them. However, this interface also allows you
+ to query all options that have been declared by algorithms, including
+ their documentation. This way, an editor or a command line tool can
+ display a list of all graph drawing algorithms and how they can be
+ configured.
+ \item The algorithm layer and the display layer are ``bound together''
+ through the \emph{binding layer}. Most of the bookkeeping concerning
+ the to-be-drawn graphs is done by the graph drawing system
+ independently of which algorithm is used and also independently of
+ which display layer is used, but some things are still specific to each
+ display layer. For instance, some algorithms may create new nodes and
+ the algorithms may then need to know how large these nodes will be. For
+ this, the display layer must be ``queried'' during a run of the
+ algorithm -- and it is the job of the binding layer to achieve this
+ callback.
+
+ As a rule, the binding layer implements the ``backward'' communication
+ from the graph drawing system back to the display layer, while the
+ display layer's interface class provides only functions that are called
+ from the display layer but which will not ``talk back''.
\end{enumerate}
-All of the files concerned with graph drawing reside in the
-|graphdrawing| subdirectory of |generic/pgf|.
+All of the files concerned with graph drawing reside in the |graphdrawing|
+subdirectory of |generic/pgf|.
+
\subsection{Organisation of the Graph Drawing Documentation}
-The documentation of the graph drawing engine is structured as
-follows:
+The documentation of the graph drawing engine is structured as follows:
+%
\begin{enumerate}
-\item Following this overview section, the next section documents
- the graph drawing engine from ``the \tikzname\ user's point of
- view''. No knowledge of Lua or algorithmic graph drawing is needed
- for this section, everyone who intends to use algorithmic graph
- drawing in \tikzname\ may be interested in reading it.
-\item You will normally only use \tikzname's keys and
- commands in order to use the graph drawing system, but, internally,
- these keys call more basic \pgfname\ commands that do the ``hard
- work'' of binding the world of \TeX\ boxes and macros to the
- object-oriented world of Lua. Section~\ref{section-gd-pgf} explains
- how this works and which commands are available for authors of
- packages that directly need to use the graph drawing system inside
- \pgfname, avoiding the overhead incurred by \tikzname.
-
- Most readers can safely skip this section.
-\item The next sections detail which graph drawing algorithms are
- currently implemented as part of the \tikzname\ distribution, see
- Sections~\ref{section-first-graphdrawing-library-in-manual}
- to~\ref{section-last-graphdrawing-library-in-manual}.
-\item
- Section~\ref{section-gd-algorithm-layer} is addressed at readers
- who wish to implement their own graph drawing
- algorithms. For this, \emph{no knowledge at all} of \TeX\
- programming is needed. The section explains the graph model used in
- Lua, the available libraries, the graph drawing pipeline, and everything
- else that is part of the Lua side of the engine.
-\item
- Section~\ref{section-gd-display-layer} details the
- display layer of the graph drawing system. You should read this
- section if you wish to implement a new display system (that is, a
- non-\TeX-based program) that intends to use the graph drawing system.
-\item
- Section~\ref{section-gd-binding-layer} explains how binding layers
- can be implemented. This section, too, is of interest only to
- readers who wish to write new display systems.
+ \item Following this overview section, the next section documents the graph
+ drawing engine from ``the \tikzname\ user's point of view''. No
+ knowledge of Lua or algorithmic graph drawing is needed for this
+ section, everyone who intends to use algorithmic graph drawing in
+ \tikzname\ may be interested in reading it.
+ \item You will normally only use \tikzname's keys and commands in order to
+ use the graph drawing system, but, internally, these keys call more
+ basic \pgfname\ commands that do the ``hard work'' of binding the world
+ of \TeX\ boxes and macros to the object-oriented world of Lua.
+ Section~\ref{section-gd-pgf} explains how this works and which commands
+ are available for authors of packages that directly need to use the
+ graph drawing system inside \pgfname, avoiding the overhead incurred by
+ \tikzname.
+
+ Most readers can safely skip this section.
+ \item The next sections detail which graph drawing algorithms are currently
+ implemented as part of the \tikzname\ distribution, see
+ Sections~\ref{section-first-graphdrawing-library-in-manual}
+ to~\ref{section-last-graphdrawing-library-in-manual}.
+ \item Section~\ref{section-gd-algorithm-layer} is addressed at readers who
+ wish to implement their own graph drawing algorithms. For this,
+ \emph{no knowledge at all} of \TeX\ programming is needed. The section
+ explains the graph model used in Lua, the available libraries, the
+ graph drawing pipeline, and everything else that is part of the Lua
+ side of the engine.
+ \item Section~\ref{section-gd-display-layer} details the display layer of
+ the graph drawing system. You should read this section if you wish to
+ implement a new display system (that is, a non-\TeX-based program) that
+ intends to use the graph drawing system.
+ \item Section~\ref{section-gd-binding-layer} explains how binding layers
+ can be implemented. This section, too, is of interest only to readers
+ who wish to write new display systems.
\end{enumerate}
-
\subsection{Acknowledgements}
-Graph drawing in \tikzname\ began as a student's project under my
-supervision. Ren\'ee Ahrens, Olof-Joachim Frahm, Jens
-Kluttig, Matthias Schulz, and Stephan Schuster wrote the first
-prototype of a graph drawing system inside \tikzname\ that uses
-Lua\TeX\ for the implementation of graph drawing algorithms.
-
-This first, early version was greatly extended on the algorithmic side
-by Jannis Pohlmann who wrote his Diploma thesis on graph drawing under
-my supervision. He implemented, in particular, the Sugiyama method
-(|layered layout|) and force based algorithms. Also, he rewrote some
-of the code of the prototype.
-
-At some point it became apparent that the first implementation had a
-number of deficiencies, both concerning the structure, the interfaces,
-and (in particular) the performance. Because of this, I rewrote
-the code of the graph drawing system, both on the \TeX\ side
-and on the Lua side in its current form. However, I would like to
-stress that without the work of the people mentioned above graph
-drawing in \tikzname\ would not exist.
-
-The documentation was written almost entirely by myself, though I did
-copy some paragraphs from Jannis's Diploma thesis, which I can highly
-recommend everyone to read.
-
-In the future, I hope that other people will contribute algorithms,
-which will be available as libraries. \ No newline at end of file
+Graph drawing in \tikzname\ began as a student's project under my supervision.
+Ren\'ee Ahrens, Olof-Joachim Frahm, Jens Kluttig, Matthias Schulz, and Stephan
+Schuster wrote the first prototype of a graph drawing system inside \tikzname\
+that uses Lua\TeX\ for the implementation of graph drawing algorithms.
+
+This first, early version was greatly extended on the algorithmic side by
+Jannis Pohlmann who wrote his Diploma thesis on graph drawing under my
+supervision. He implemented, in particular, the Sugiyama method
+(|layered layout|) and force based algorithms. Also, he rewrote some of the
+code of the prototype.
+
+At some point it became apparent that the first implementation had a number of
+deficiencies, both concerning the structure, the interfaces, and (in
+particular) the performance. Because of this, I rewrote the code of the graph
+drawing system, both on the \TeX\ side and on the Lua side in its current form.
+However, I would like to stress that without the work of the people mentioned
+above graph drawing in \tikzname\ would not exist.
+
+The documentation was written almost entirely by myself, though I did copy some
+paragraphs from Jannis's Diploma thesis, which I can highly recommend everyone
+to read.
+
+In the future, I hope that other people will contribute algorithms, which will
+be available as libraries.
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-phylogenetics.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-phylogenetics.tex
index 28906ec17b5..486b930ce5e 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-phylogenetics.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-phylogenetics.tex
@@ -11,9 +11,13 @@
\section{Graph Drawing Layouts: Phylogenetic Trees}
\label{section-library-graphdrawing-phylogenetics}
-{\noindent {\emph{by Sarah M\"ausle and Till Tantau}}}
+{\noindent {\emph{by Sarah Mäusle and Till Tantau}}}
-\ifluatex\else This section of the manual can only be typeset using Lua\TeX.\expandafter\endinput\fi
+\ifluatex
+\else
+ This section of the manual can only be typeset using Lua\TeX.
+ \expandafter\endinput
+\fi
\tikzset{/graph drawing/phylogenetic inner node/.style={
/tikz/.cd,
@@ -24,43 +28,44 @@
thick, rounded corners,edge node={node[auto,font=\tiny, inner sep=2pt]{}}}
}
-
\includeluadocumentationof{pgf.gd.phylogenetics.library}
\includeluadocumentationof{pgf.gd.phylogenetics.PhylogeneticTree}
\subsection{Generating a Phylogenetic Tree}
-...
+... \todosp{I guess something should be added here, right?}
-When a phylogenetic tree is generated, new nodes and edges get
-created. In order to give you a chance at styling them, the following
-styles are executed:
+When a phylogenetic tree is generated, new nodes and edges get created. In
+order to give you a chance at styling them, the following styles are executed:
\begin{stylekey}{/graph drawing/phylogenetic inner node}
- The style is added every newly created inner node. In this manual,
- this key is set to:
+ The style is added every newly created inner node. In this manual, this key
+ is set to:
+ %
\begin{codeexample}[code only]
\pgfgdset{phylogenetic inner node/.style={
/tikz/.cd, draw, circle, inner sep=0pt, minimum size=5pt
}
}
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/graph drawing/phylogenetic edge=\meta{length}}
- The style is added every newly created phylogenetic edge. The
- \meta{length} will be set to the computed evolutionary length of the
- edge. In this manual, this key is set to:
+ The style is added every newly created phylogenetic edge. The \meta{length}
+ will be set to the computed evolutionary length of the edge. In this
+ manual, this key is set to:
+ %
\begin{codeexample}[code only]
\pgfgdset{phylogenetic edge/.style={
/tikz/.cd, thick, rounded corners
}
}
\end{codeexample}
+ %
\end{stylekey}
-
\includeluadocumentationof{pgf.gd.phylogenetics.AuthorDefinedPhylogeny}
\includeluadocumentationof{pgf.gd.phylogenetics.SokalMichener1958}
\includeluadocumentationof{pgf.gd.phylogenetics.BalancedMinimumEvolution}
@@ -72,11 +77,7 @@ styles are executed:
\includeluadocumentationof{pgf.gd.phylogenetics.Maeusle2012}
-
-\endinput
-
-
-%%% 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-gd-trees.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-trees.tex
index edfbcdeba4e..171b7f8778a 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-trees.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-trees.tex
@@ -12,23 +12,28 @@
\label{section-first-graphdrawing-library-in-manual}
\label{section-library-graphdrawing-trees}
-{\noindent {\emph{by Till Tantau}}}
+{\noindent {\emph{by Till Tantau}} \todosp{why 2 labels? The second doesn't
+seem to be used.}}
-\ifluatex\else This section of the manual can only be typeset using Lua\TeX.\expandafter\endinput\fi
+\ifluatex
+\else
+ This section of the manual can only be typeset using Lua\TeX.
+ \expandafter\endinput
+\fi
\includeluadocumentationof{pgf.gd.trees.library}
+
\subsection{The Tree Layouts}
+
\includeluadocumentationof{pgf.gd.trees.ReingoldTilford1981}
% Other subsections:
\includeluadocumentationof{pgf.gd.trees.ChildSpec}
\includeluadocumentationof{pgf.gd.trees.SpanningTreeComputation}
-\endinput
-
-%%% 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-gd-usage-pgf.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-usage-pgf.tex
index 095e3f771a4..961f1e1076f 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-usage-pgf.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-usage-pgf.tex
@@ -14,100 +14,94 @@
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-
\section{Using Graph Drawing in PGF}
-
\label{section-gd-pgf}
{\noindent {\emph{by Till Tantau}}}
\begin{purepgflibrary}{graphdrawing}
- This package provides the core support for graph drawing inside
- \pgfname. It does so by providing \pgfname\ macros for controlling
- the graph drawing system, but also implements the binding to the
- graph drawing system (see Section~\ref{section-gd-binding-layer} for
- details on bindings).
+ This package provides the core support for graph drawing inside \pgfname.
+ It does so by providing \pgfname\ macros for controlling the graph drawing
+ system, but also implements the binding to the graph drawing system (see
+ Section~\ref{section-gd-binding-layer} for details on bindings).
\end{purepgflibrary}
-\ifluatex\else This section of the manual can only be typeset using Lua\TeX.\expandafter\endinput\fi
+\ifluatex
+\else
+ This section of the manual can only be typeset using Lua\TeX.
+ \expandafter\endinput
+\fi
-\subsection{Overview}
-Just like everywhere else in \pgfname, \tikzname\ is ``just a
-convenient syntax'' in the context of graph drawing. The ``hard work''
-of binding the internal representations of nodes and edges with the graph
-drawing system written in Lua is not done by \tikzname, but rather by
-a set of macros that are part of the basic \pgfname\ layer.
+\subsection{Overview}
-The documentation of the \pgfname\ part of the graph drawing system
-that is presented in the following includes only those macros that
-other \TeX\ packages could conceivably call in order to use the graph
-drawing system without using \tikzname; for instance, for efficiency
-reasons. (The internal callback functions defined in the graph drawing
-library that are part of the binding between \pgfname\ and the graph
-drawing system are not documented, should not be called, and may
-change in the future.)
+Just like everywhere else in \pgfname, \tikzname\ is ``just a convenient
+syntax'' in the context of graph drawing. The ``hard work'' of binding the
+internal representations of nodes and edges with the graph drawing system
+written in Lua is not done by \tikzname, but rather by a set of macros that are
+part of the basic \pgfname\ layer.
+The documentation of the \pgfname\ part of the graph drawing system that is
+presented in the following includes only those macros that other \TeX\ packages
+could conceivably call in order to use the graph drawing system without using
+\tikzname; for instance, for efficiency reasons. (The internal callback
+functions defined in the graph drawing library that are part of the binding
+between \pgfname\ and the graph drawing system are not documented, should not
+be called, and may change in the future.)
\subsection{How Graph Drawing in PGF Works}
The core idea behind graph drawing in \pgfname\ is that inside special
-\emph{graph drawing scopes} whenever \pgfname\ creates a node, we
-intercept this node creation and \emph{do not} immediately place the
-node. Rather, we pass it down to Lua part of the graph drawing system
-via calls to appropriate methods of the (Lua) class
-|InterfaceToDisplay|. The effect will be that the nodes are ``tucked
-away'' in some internal tables. For edges, we introduce a
-special command called |\pgfgdedge| that tells the graph drawing
-system that there is an edge between two tucked-away nodes. Then,
-at the end of the graph drawing scope, a graph drawing algorithm
-written in Lua starts to work on the graph by computing new positions
-for the nodes. Once the algorithm has finished, the graph drawing
-system starts sending back the nodes and edges to \pgfname\ via the
-methods of the class |BindingToPGF|. These methods reinsert some code
-into the \TeX\ output stream that finally places the nodes at
-their final positions. Note that graph drawing algorithms are
-perfectly oblivious to all of this; indeed, the graph drawing
-algorithms can even be used independently of \TeX.
-
-Let us have a look at a simple example to see what happens when a
-graph is specified:
-
+\emph{graph drawing scopes} whenever \pgfname\ creates a node, we intercept
+this node creation and \emph{do not} immediately place the node. Rather, we
+pass it down to Lua part of the graph drawing system via calls to appropriate
+methods of the (Lua) class |InterfaceToDisplay|. The effect will be that the
+nodes are ``tucked away'' in some internal tables. For edges, we introduce a
+special command called |\pgfgdedge| that tells the graph drawing system that
+there is an edge between two tucked-away nodes. Then, at the end of the graph
+drawing scope, a graph drawing algorithm written in Lua starts to work on the
+graph by computing new positions for the nodes. Once the algorithm has
+finished, the graph drawing system starts sending back the nodes and edges to
+\pgfname\ via the methods of the class |BindingToPGF|. These methods reinsert
+some code into the \TeX\ output stream that finally places the nodes at their
+final positions. Note that graph drawing algorithms are perfectly oblivious to
+all of this; indeed, the graph drawing algorithms can even be used
+independently of \TeX.
+
+Let us have a look at a simple example to see what happens when a graph is
+specified:
+%
\begin{codeexample}[]
\tikz[tree layout]
\graph {root [as=Hello] -> World[fill=blue!20]};
\end{codeexample}
The key |tree layout| internally calls the key |request scope and layout|,
-which in turn calls the macro |\pgfgdbeginscope|, which starts a graph
-drawing scope inside the graph drawing system. Once this macro has been
-called, until the next call of |\pgfgdendscope|, all nodes that are
-created actually get passed down to the graph drawing engine. This is
-implemented on the lowest layer, namely by directly intercepting
-nodes freshly created using |\pgfnode|. In our example, this happens
-in two places: For the |root| node and for the |World| node. The
-|graph| library and \tikzname\ internally call the |\pgfnode| macro
-for these two nodes (after a large number of internal syntax
-translations, but the graph drawing system does not care about them).
-
-Note that the node boxes will have been fully created before they are
-passed down to the graph drawing engine -- only their final position
-is not yet fixed. It is not possible to modify the size of nodes
-inside the graph drawing engine, but you can create new nodes in
-certain situations.
-
-In contrast, the single edge of the graph that is created by the |->|
-command is not fully created before it is passed down to the
-graph drawing system. This would not really make sense since before the final
-positions of the nodes are fixed, we cannot even begin to compute the
-length of this edge, let alone where it should start or end. For this
-reason, on the upper \tikzname\ layer, the normal edge creation that
-would be caused by |->| via |new ->| is suppressed. Instead, the
-command |\pgfgdedge| is called. Similarly, inside a graph drawing
-scope, \tikzname\ will suppress both the |edge| and the
-|edge from parent| command and cause |\pgfgdedge| to be called
-instead.
+which in turn calls the macro |\pgfgdbeginscope|, which starts a graph drawing
+scope inside the graph drawing system. Once this macro has been called, until
+the next call of |\pgfgdendscope|, all nodes that are created actually get
+passed down to the graph drawing engine. This is implemented on the lowest
+layer, namely by directly intercepting nodes freshly created using |\pgfnode|.
+In our example, this happens in two places: For the |root| node and for the
+|World| node. The |graph| library and \tikzname\ internally call the |\pgfnode|
+macro for these two nodes (after a large number of internal syntax
+translations, but the graph drawing system does not care about them).
+
+Note that the node boxes will have been fully created before they are passed
+down to the graph drawing engine -- only their final position is not yet fixed.
+It is not possible to modify the size of nodes inside the graph drawing engine,
+but you can create new nodes in certain situations.
+
+In contrast, the single edge of the graph that is created by the |->| command
+is not fully created before it is passed down to the graph drawing system. This
+would not really make sense since before the final positions of the nodes are
+fixed, we cannot even begin to compute the length of this edge, let alone where
+it should start or end. For this reason, on the upper \tikzname\ layer, the
+normal edge creation that would be caused by |->| via |new ->| is suppressed.
+Instead, the command |\pgfgdedge| is called. Similarly, inside a graph drawing
+scope, \tikzname\ will suppress both the |edge| and the |edge from parent|
+command and cause |\pgfgdedge| to be called instead.
An overview of what happens is illustrated by the following call graph:
@@ -118,131 +112,132 @@ An overview of what happens is illustrated by the following call graph:
object node/.style={draw,minimum size=15pt, fill=yellow!20},
p/.style={->,>=spaced stealth'},
livespan/.style={very thick},
- xscale=0.8]
- % class names above
- \node (tikz) at (0,4) [class name] {\tikzname\ layer (\TeX)};
- \node (tex) at (6,4) [class name] {\pgfname\ layer (\TeX)};
- \node (interface) at (13,4) [class name] {Display layer (Lua)};
- % lines from the class names to the bottom of the picture
- \draw[livespan] (tikz) -- (0,-6.5);
- \draw[livespan] (tex) -- (6,-6.5);
- \draw[livespan] (interface) -- (13,-6.5);
- % first command: \graph{ -- generates new graph in lua interface
- \node (tikz-begin-graph) at (0,3) [object node] {|\graph[... layout]{|}; %}
- \node (tex-begin-graph) at (6,3) [object node] {|\pgfgdbeginscope|};
- \node (interface-new-graph) at (13,3) [object node] {|beginGraphDrawingScope(|...|)|};
- \draw [p] (tikz-begin-graph.east) -- (tex-begin-graph.west);
- \draw [p] (tex-begin-graph.east) -- (interface-new-graph.west);
- % second command: a -> b -- generates two nodes in lua
- % and one edge
- \node (tikz-node) at (0,2) [object node] {|a -> b;|};
- \node (tex-node) at (6,2) [object node, double copy shadow] {|\pgfnode|};
- \draw[p] (tikz-node.east) -- (tex-node.west);
-
- \node (interface-add-node) at (13,2) [object node, double copy shadow] {|createVertex(|...|)|};
- \draw[p] (tex-node.east) -- (interface-add-node.west);
-
- \node (tex-add-edge) at (6,1) [object node, double copy shadow] {|\pgfgdedge|};
- \node (interface-add-edge) at (13,1) [object node, double copy shadow] {|createEdge(|...|)|};
- \draw[p] (tikz-node.east) -- (1.5,2) -- (1.5,1) -- (tex-add-edge.west);
- \draw[p] (tex-add-edge.east) -- (interface-add-edge.west);
-
- % scope ends -- cloes graph, layouts it and draws it
- \node (tikz-end) at (0,0) [object node] {|};|};
- \node (tex-end) at (6,0) [object node] {|\pgfgdendscope|};
- \node (interface-draw-graph) at (13,0) [object node] {|runGraphDrawingAlgorithm()|};
- \node (interface-finish-graph) at (13,-2) [object node] {|endGraphDrawingScope()|};
-
- \node (invoke-algorithm) at (15.5,-1) [object node] {invoke algorithm};
- \draw[p] (tikz-end.east) -- (tex-end.west);
- \draw[p] (tex-end.east) -- (interface-draw-graph.west);
- \draw[p] (interface-draw-graph.east) -| (invoke-algorithm.20);
- \draw[p] (tex-end.east) -- (9.5,0) -- (9.5,-2) -- (interface-finish-graph.west);
-
- % begin shipout
- \node (tex-begin-shipout) at (6,-3) [object node] {|\pgfgdcallbackbeginshipout|};
-
- \node (tex-puttexbox) at (6,-4) [object node, double copy shadow] {|\pgfgdcallbackrendernode|};
- \node (tex-putedge) at (6,-5) [object node, double copy shadow] {|\pgfgddefaultedgecallback|};
-
- \node (tex-end-shipout) at (6,-6) [object node] {|\pgfgdcallbackendshipout|};
-
- \draw [p] (interface-finish-graph.-170) |- (tex-begin-shipout.east);
- \draw [p] (interface-finish-graph.-170) |- (tex-puttexbox.east);
- \draw [p] (interface-finish-graph.-170) |- (tex-putedge.east);
- \draw [p] (interface-finish-graph.-170) |- (tex-end-shipout.east);
- %(interface-finish-graph.east) -- (12.5,-2) -- (12.5,-4) -- (sys-puttexbox.west);
-
- % put edge
- %(interface-finish-graph.east) -- (12.5,-2) -- (12.5,-5) -- (sys-put-edge.west);
- % end shipout
- %(interface-finish-graph.east) -- (12.5,-2) -- (12.5,-6) -- (sys-end-shipout.west);
+ xscale=0.8,
+]
+ % class names above
+ \node (tikz) at (0,4) [class name] {\tikzname\ layer (\TeX)};
+ \node (tex) at (6,4) [class name] {\pgfname\ layer (\TeX)};
+ \node (interface) at (13,4) [class name] {Display layer (Lua)};
+ % lines from the class names to the bottom of the picture
+ \draw[livespan] (tikz) -- (0,-6.5);
+ \draw[livespan] (tex) -- (6,-6.5);
+ \draw[livespan] (interface) -- (13,-6.5);
+ % first command: \graph{ -- generates new graph in lua interface
+ \node (tikz-begin-graph) at (0,3) [object node] {|\graph[... layout]{|}; %}
+ \node (tex-begin-graph) at (6,3) [object node] {|\pgfgdbeginscope|};
+ \node (interface-new-graph) at (13,3) [object node] {|beginGraphDrawingScope(|...|)|};
+ \draw [p] (tikz-begin-graph.east) -- (tex-begin-graph.west);
+ \draw [p] (tex-begin-graph.east) -- (interface-new-graph.west);
+ % second command: a -> b -- generates two nodes in lua
+ % and one edge
+ \node (tikz-node) at (0,2) [object node] {|a -> b;|};
+ \node (tex-node) at (6,2) [object node, double copy shadow] {|\pgfnode|};
+ \draw[p] (tikz-node.east) -- (tex-node.west);
+
+ \node (interface-add-node) at (13,2) [object node, double copy shadow] {|createVertex(|...|)|};
+ \draw[p] (tex-node.east) -- (interface-add-node.west);
+
+ \node (tex-add-edge) at (6,1) [object node, double copy shadow] {|\pgfgdedge|};
+ \node (interface-add-edge) at (13,1) [object node, double copy shadow] {|createEdge(|...|)|};
+ \draw[p] (tikz-node.east) -- (1.5,2) -- (1.5,1) -- (tex-add-edge.west);
+ \draw[p] (tex-add-edge.east) -- (interface-add-edge.west);
+
+ % scope ends -- cloes graph, layouts it and draws it
+ \node (tikz-end) at (0,0) [object node] {|};|};
+ \node (tex-end) at (6,0) [object node] {|\pgfgdendscope|};
+ \node (interface-draw-graph) at (13,0) [object node] {|runGraphDrawingAlgorithm()|};
+ \node (interface-finish-graph) at (13,-2) [object node] {|endGraphDrawingScope()|};
+
+ \node (invoke-algorithm) at (15.5,-1) [object node] {invoke algorithm};
+ \draw[p] (tikz-end.east) -- (tex-end.west);
+ \draw[p] (tex-end.east) -- (interface-draw-graph.west);
+ \draw[p] (interface-draw-graph.east) -| (invoke-algorithm.20);
+ \draw[p] (tex-end.east) -- (9.5,0) -- (9.5,-2) -- (interface-finish-graph.west);
+
+ % begin shipout
+ \node (tex-begin-shipout) at (6,-3) [object node] {|\pgfgdcallbackbeginshipout|};
+
+ \node (tex-puttexbox) at (6,-4) [object node, double copy shadow] {|\pgfgdcallbackrendernode|};
+ \node (tex-putedge) at (6,-5) [object node, double copy shadow] {|\pgfgddefaultedgecallback|};
+
+ \node (tex-end-shipout) at (6,-6) [object node] {|\pgfgdcallbackendshipout|};
+
+ \draw [p] (interface-finish-graph.-170) |- (tex-begin-shipout.east);
+ \draw [p] (interface-finish-graph.-170) |- (tex-puttexbox.east);
+ \draw [p] (interface-finish-graph.-170) |- (tex-putedge.east);
+ \draw [p] (interface-finish-graph.-170) |- (tex-end-shipout.east);
+ %(interface-finish-graph.east) -- (12.5,-2) -- (12.5,-4) -- (sys-puttexbox.west);
+
+ % put edge
+ %(interface-finish-graph.east) -- (12.5,-2) -- (12.5,-5) -- (sys-put-edge.west);
+ % end shipout
+ %(interface-finish-graph.east) -- (12.5,-2) -- (12.5,-6) -- (sys-end-shipout.west);
\end{tikzpicture}
\medskip
-The above diagram glosses over the fact that the display layer does
-not actually call any of the macros of \TeX\ directly, but uses a so
-called \emph{binding} (see the class |BindingToPGF|). However, this
-will not be important for the present section since you cannot access
-the binding directly.
-
+The above diagram glosses over the fact that the display layer does not
+actually call any of the macros of \TeX\ directly, but uses a so called
+\emph{binding} (see the class |BindingToPGF|). However, this will not be
+important for the present section since you cannot access the binding directly.
\subsubsection{Graph Drawing Scopes}
-
\label{section-gd-scopes}
-When the graph drawing system is active, some pretty basic things
-inside \pgfname\ change -- such as the fact that nodes are no longer
-created in the normal manner. For this reason, the graph drawing
-system must be switched on and of explicitly through opening and
-closing a so called \emph{graph drawing scope}. These scopes can, in
-principle, be nested, namely a graph contains a node that
-contains some text that in turn contains a subpicture that contains a
-drawing of a graph. However, this is \emph{not} the same as subgraphs
-nodes and sublayouts, which are all part of the same graph drawing
-scope. Normally, graph drawing scopes are not nested.
+When the graph drawing system is active, some pretty basic things inside
+\pgfname\ change -- such as the fact that nodes are no longer created in the
+normal manner. For this reason, the graph drawing system must be switched on
+and of explicitly through opening and closing a so called \emph{graph drawing
+scope}. These scopes can, in principle, be nested, namely a graph contains a
+node that contains some text that in turn contains a subpicture that contains a
+drawing of a graph. However, this is \emph{not} the same as subgraphs nodes and
+sublayouts, which are all part of the same graph drawing scope. Normally, graph
+drawing scopes are not nested.
Graph drawing scopes are created using the following commands:
\begin{command}{\pgfgdbeginscope}
- This macro starts a \TeX\ scope inside which the following things
- happen:
- \begin{enumerate}
- \item The display layer method |beginGraphDrawingScope| is
- called, which created a new graph drawing scope inside the graph
- drawing system and places it on top of an internal stack. From now
- on, all subsequent interface calls will refer to this scope until
- |\pgfgdendscope| is called, which will pop the scope once more.
- \item Inside the \TeX\ scope, nodes are not placed
- immediately. Rather, |\pgfpositionnodelater|, see
- Section~\ref{section-shapes-deferred-node-positioning}, is used to
- call |InterfaceToDisplay.createVertex| for all nodes created
- inside the scope. This will cause them to be put inside some internal
- table.
- \item Some additional \meta{code} is executed, which has been set
- using the following command:
- \begin{command}{\pgfgdaddspecificationhook\marg{code}}
- This command adds the \meta{code} to the code that is executed
- whenever a graph drawing scope starts. For instance, the
- \tikzname\ library |graphdrawing| uses this macro to add some
- \meta{code} that will redirect the |edge| and |edge from parent|
- path commands to |\pgfgdedge|.
- \end{command}
- \item |\pgftransformreset| is called.
- \item The following \TeX-if is set to true:
- {
- \let\ifpgfgdgraphdrawingscopeactive=\relax
- \begin{textoken}{\ifpgfgdgraphdrawingscopeactive}
- Will be true inside a graph drawing scope.
- \end{textoken}
- }
- \end{enumerate}
- The above has a number of consequences for what can happen inside a
- graph drawing scope:
- \begin{itemize}
- \item Since nodes are not actually created before the end of the
- scope, you cannot reference these nodes. Thus, you cannot write
+ This macro starts a \TeX\ scope inside which the following things happen:
+ %
+ \begin{enumerate}
+ \item The display layer method |beginGraphDrawingScope| is called,
+ which created a new graph drawing scope inside the graph drawing
+ system and places it on top of an internal stack. From now on, all
+ subsequent interface calls will refer to this scope until
+ |\pgfgdendscope| is called, which will pop the scope once more.
+ \item Inside the \TeX\ scope, nodes are not placed immediately. Rather,
+ |\pgfpositionnodelater|, see
+ Section~\ref{section-shapes-deferred-node-positioning}, is used to
+ call |InterfaceToDisplay.createVertex| for all nodes created inside
+ the scope. This will cause them to be put inside some internal
+ table.
+ \item Some additional \meta{code} is executed, which has been set using
+ the following command:
+ %
+ \begin{command}{\pgfgdaddspecificationhook\marg{code}}
+ This command adds the \meta{code} to the code that is executed
+ whenever a graph drawing scope starts. For instance, the
+ \tikzname\ library |graphdrawing| uses this macro to add some
+ \meta{code} that will redirect the |edge| and
+ |edge from parent| path commands to |\pgfgdedge|.
+ \end{command}
+ \item |\pgftransformreset| is called.
+ \item The following \TeX-if is set to true:
+ {
+ \let\ifpgfgdgraphdrawingscopeactive=\relax
+ \begin{textoken}{\ifpgfgdgraphdrawingscopeactive}
+ Will be true inside a graph drawing scope.
+ \end{textoken}
+ }
+ \end{enumerate}
+ %
+ The above has a number of consequences for what can happen inside a graph
+ drawing scope:
+ %
+ \begin{itemize}
+ \item Since nodes are not actually created before the end of the scope,
+ you cannot reference these nodes. Thus, you cannot write
+ %
\begin{codeexample}[code only]
\tikz [spring layout] {
\node (a) {a};
@@ -250,318 +245,296 @@ Graph drawing scopes are created using the following commands:
\draw (a) -- (b);
}
\end{codeexample}
- The problem is that we cannot connect |(a)| and |(b)| via a
- straight line since these nodes do not exist at that point (they
- are available only deeply inside the Lua).
- \item In order to create edges between nodes inside a graph drawing
- scope, you need to call the |\pgfgdedge| command, described below.
- \end{itemize}
-
- Additionally, when \tikzname\ is used, the following things also
- happen:
- \begin{itemize}
- \item If the |graphs| library has been loaded, the default
- positioning mechanisms of this library are switched off, leaving
- the positioning to the graph drawing engine. Also, when an edge is
- created by the |graphs| library, this is signalled to the graph
- drawing library. (To be more precise: The keys |new ->| and so on
- are redefined so that they call |\pgfgdedge| instead of creating
- an edge.
- \item The |edge| path command is modified so that it also calls
- |\pgfgdedge| instead of immediately creating any edges.
- \item The |edge from parent| path command is modified so that is
- also calls |\pgfgdedge|.
- \item The keys |append after command| and |prefix after command|
- keys are modified so that they are executed only via
- |late options| when the node has ``reached its final parking
- position''.
- \end{itemize}
-
- Note that inside a graph drawing scope you first have to open a
- (main) layout scope (using the |\pgfgdbeginlayout| command described
- later on) before you can add nodes and edges to the scope.
+ %
+ The problem is that we cannot connect |(a)| and |(b)| via a
+ straight line since these nodes do not exist at that point (they
+ are available only deeply inside the Lua).
+ \item In order to create edges between nodes inside a graph drawing
+ scope, you need to call the |\pgfgdedge| command, described below.
+ \end{itemize}
+
+ Additionally, when \tikzname\ is used, the following things also happen:
+ %
+ \begin{itemize}
+ \item If the |graphs| library has been loaded, the default positioning
+ mechanisms of this library are switched off, leaving the
+ positioning to the graph drawing engine. Also, when an edge is
+ created by the |graphs| library, this is signalled to the graph
+ drawing library. (To be more precise: The keys |new ->| and so on
+ are redefined so that they call |\pgfgdedge| instead of creating an
+ edge.
+ \item The |edge| path command is modified so that it also calls
+ |\pgfgdedge| instead of immediately creating any edges.
+ \item The |edge from parent| path command is modified so that is also
+ calls |\pgfgdedge|.
+ \item The keys |append after command| and |prefix after command| keys
+ are modified so that they are executed only via |late options| when
+ the node has ``reached its final parking position''.
+ \end{itemize}
+
+ Note that inside a graph drawing scope you first have to open a (main)
+ layout scope (using the |\pgfgdbeginlayout| command described later on)
+ before you can add nodes and edges to the scope.
\end{command}
-
\begin{command}{\pgfgdendscope}
- This macro is used to end a graph drawing scope. It must be given on
- the same \TeX\ grouping level as the corresponding
- |\pgfgdbeginscope|. When the macro is called, it triggers a lot of
- new calls:
- \begin{enumerate}
- \item The special treatment of newly created boxes is ended. Nodes
- are once more created normally.
- \item The effects of the \meta{code} that was inserted via the
- specification hook command also ends (provided it had no global
- effects).
- \item We call |InterfaceToDisplay.runGraphDrawingAlgorithm|. This
- will cause the algorithm(s) for the graph to be executed (since a
- graph can have sublayouts, several algorithms may be run). See
- Section~\ref{section-gd-layout-scopes} below.
- \item Next, we call |InterfaceToDisplay.endGraphDrawingScope|.
- This causes all nodes that were intercepted during the
- graph drawing scope to be reinserted into the output stream at the
- positions that were computed for them. Also, for each edge that
- was requested via |\pgfgdedge|, the callback macro is
- called (see below).
- \end{enumerate}
+ This macro is used to end a graph drawing scope. It must be given on the
+ same \TeX\ grouping level as the corresponding |\pgfgdbeginscope|. When the
+ macro is called, it triggers a lot of new calls:
+ %
+ \begin{enumerate}
+ \item The special treatment of newly created boxes is ended. Nodes are
+ once more created normally.
+ \item The effects of the \meta{code} that was inserted via the
+ specification hook command also ends (provided it had no global
+ effects).
+ \item We call |InterfaceToDisplay.runGraphDrawingAlgorithm|. This will
+ cause the algorithm(s) for the graph to be executed (since a graph
+ can have sublayouts, several algorithms may be run). See
+ Section~\ref{section-gd-layout-scopes} below.
+ \item Next, we call |InterfaceToDisplay.endGraphDrawingScope|. This
+ causes all nodes that were intercepted during the graph drawing
+ scope to be reinserted into the output stream at the positions that
+ were computed for them. Also, for each edge that was requested via
+ |\pgfgdedge|, the callback macro is called (see below).
+ \end{enumerate}
\end{command}
-
-Inside a graph drawing scope, nodes are
-automatically passed down to the graph drawing engine, while for edges
-a command has to be called explicitly:
-
-\begin{command}{\pgfgdedge\marg{first node}\marg{second
- node}\marg{edge direction}\marg{edge options}\marg{edge nodes}}
- This command is used to tell the graph drawing engine that there is
- an edge between \meta{first node} and \meta{second node} in your
- graph. The ``kind'' of connection is indicated by \meta{direction},
- which may be one of the following:
- \begin{itemize}
- \item
- |->| indicates a directed edge (also known as an arc) from
- \meta{first node} to \meta{second node}.
- \item |--| indicates an undirected edge between \meta{first node}
- and \meta{second node},
- \item |<-| indicates a directed edge from \meta{second node} to
- \meta{first node}, but with the ``additional hint'' that this is a
- ``backward'' edge. A graph drawing algorithm may or may not take
- this hint into account.
- \item |<->| indicates a bi-directed edge between \meta{first node}
- and \meta{second node}.
- \item |-!-| indicates that the edge from \meta{first node} to
- \meta{second node} is ``missing''.
- \end{itemize}
- Note that in all cases, the syntatic digraph will contain an arc
- from \meta{first node} to \meta{second node}, regardless of the
- value of \meta{direction}. The \meta{direction} is ``just'' a
- ``semantic annotation''.
-
- The parameters \meta{edge options} and \meta{edge nodes} are a bit
- more tricky. When an edge between two vertices of a graph is created
- via |\pgfgdedge|, nothing is actually done immediately. After all,
- without knowing the final positions of the nodes \meta{first node}
- and \meta{second node}, there is no way of creating the actual
- drawing commands for the edge. Thus, the actual drawing of the edge
- is done only when the graph drawing algorithm is done (namely in the
- macro |\pgfgdedgecallback|, see later).
-
- Because of this ``delayed'' drawing of edges, options that influence
- the edge must be retained until the moment when the edge is actually
- drawn. Parameters \meta{edge options} and \meta{edge nodes} store such
- options.
-
- Let us start with \meta{edge options}. This parameter should be set
- to a list of key-value pairs like
+Inside a graph drawing scope, nodes are automatically passed down to the graph
+drawing engine, while for edges a command has to be called explicitly:
+
+\begin{command}{\pgfgdedge\marg{first node}\marg{second node}\marg{edge direction}\marg{edge options}\marg{edge nodes}}
+ This command is used to tell the graph drawing engine that there is an edge
+ between \meta{first node} and \meta{second node} in your graph. The
+ ``kind'' of connection is indicated by \meta{direction}, which may be one
+ of the following:
+ %
+ \begin{itemize}
+ \item |->| indicates a directed edge (also known as an arc) from
+ \meta{first node} to \meta{second node}.
+ \item |--| indicates an undirected edge between \meta{first node} and
+ \meta{second node},
+ \item |<-| indicates a directed edge from \meta{second node} to
+ \meta{first node}, but with the ``additional hint'' that this is a
+ ``backward'' edge. A graph drawing algorithm may or may not take
+ this hint into account.
+ \item |<->| indicates a bi-directed edge between \meta{first node} and
+ \meta{second node}.
+ \item |-!-| indicates that the edge from \meta{first node} to
+ \meta{second node} is ``missing''.
+ \end{itemize}
+ %
+ Note that in all cases, the syntactic digraph will contain an arc from
+ \meta{first node} to \meta{second node}, regardless of the value of
+ \meta{direction}. The \meta{direction} is ``just'' a ``semantic
+ annotation''.
+
+ The parameters \meta{edge options} and \meta{edge nodes} are a bit more
+ tricky. When an edge between two vertices of a graph is created via
+ |\pgfgdedge|, nothing is actually done immediately. After all, without
+ knowing the final positions of the nodes \meta{first node} and \meta{second
+ node}, there is no way of creating the actual drawing commands for the
+ edge. Thus, the actual drawing of the edge is done only when the graph
+ drawing algorithm is done (namely in the macro |\pgfgdedgecallback|, see
+ later).
+
+ Because of this ``delayed'' drawing of edges, options that influence the
+ edge must be retained until the moment when the edge is actually drawn.
+ Parameters \meta{edge options} and \meta{edge nodes} store such options.
+
+ Let us start with \meta{edge options}. This parameter should be set to a
+ list of key--value pairs like
+ %
\begin{codeexample}[code only]
/tikz/.cd, color=red, very thick, orient=down
\end{codeexample}
- Some of these options may be of interest to the graph drawing
- algorithm (like the last option) while others will
- only be important during the drawing of edge (like the first
- option). The options that are important for the graph drawing
- algorithm must be pushed onto the graph drawing system's option
- stack.
-
- The tricky part is that options that are of interest to the graph
- drawing algorithm must be executed \emph{before} the algorithm starts,
- but the options as a whole are usually only executed during the
- drawing of the edges, which is \emph{after} the algorithm has finished.
- To overcome this problem, the following happens:
-
- The options in \meta{edge options} are executed ``tentatively'' inside
- |\pgfgdedge|. However, this execution is done in a ``heavily guarded
- sandbox'' where all effects of the options (like changing the
- color or the line width) do not propagate beyond the sandbox. Only
- the changes of the graph drawing edge parameters leave the
- sandbox. These parameters are then passed down to the graph drawing
- system.
-
- Later, when the edge is drawn using |\pgfgdedgecallback|, the
- options \meta{edge options} are available once more and then they
- are executed normally.
-
- Note that when the options in \meta{edge options} are executed, no
- path is preset. Thus, you typically need to start it with, say,
- |/tikz/.cd|. Also note that the sandbox is not perfect and changing
- global values will have an effect outside the sandbox. Indeed,
- ``putting things in a sandbox'' just means that the options are
- executed inside a \TeX\ scope inside an interrupted path inside a
- \TeX\ box that is thrown away immediately.
-
- The text in \meta{edge nodes} is some ``auxilliary'' text that is
- simply stored away and later directed to |\pgfgdedgecallback|. This
- is used for instance by \tikzname\ to store its node labels.
+ %
+ Some of these options may be of interest to the graph drawing algorithm
+ (like the last option) while others will only be important during the
+ drawing of edge (like the first option). The options that are important for
+ the graph drawing algorithm must be pushed onto the graph drawing system's
+ option stack.
+
+ The tricky part is that options that are of interest to the graph drawing
+ algorithm must be executed \emph{before} the algorithm starts, but the
+ options as a whole are usually only executed during the drawing of the
+ edges, which is \emph{after} the algorithm has finished. To overcome this
+ problem, the following happens:
+
+ The options in \meta{edge options} are executed ``tentatively'' inside
+ |\pgfgdedge|. However, this execution is done in a ``heavily guarded
+ sandbox'' where all effects of the options (like changing the color or the
+ line width) do not propagate beyond the sandbox. Only the changes of the
+ graph drawing edge parameters leave the sandbox. These parameters are then
+ passed down to the graph drawing system.
+
+ Later, when the edge is drawn using |\pgfgdedgecallback|, the options
+ \meta{edge options} are available once more and then they are executed
+ normally.
+
+ Note that when the options in \meta{edge options} are executed, no path is
+ preset. Thus, you typically need to start it with, say, |/tikz/.cd|. Also
+ note that the sandbox is not perfect and changing global values will have
+ an effect outside the sandbox. Indeed, ``putting things in a sandbox'' just
+ means that the options are executed inside a \TeX\ scope inside an
+ interrupted path inside a \TeX\ box that is thrown away immediately.
+
+ The text in \meta{edge nodes} is some ``auxiliary'' text that is simply
+ stored away and later directed to |\pgfgdedgecallback|. This is used for
+ instance by \tikzname\ to store its node labels.
\end{command}
-
\begin{command}{\pgfgdsetedgecallback\marg{macro}}
- This command allows you to change the \meta{macro} that gets called
- form inside the graph drawing system at the end of the creation of a
- graph, when the nodes have been positioned. The \meta{macro} will be
- called once for each edge with the following parameters:
- \begin{quote}
- \meta{macro}\marg{first node}\marg{second
- node}\marg{direction}\marg{edge options}\marg{edge
- nodes}\\
- \marg{algorithm-generated options}\marg{bend information}
- \end{quote}
-
- The first five parameters are the original values that were passed
- down to the |\pgfgdedge| command.
-
- The \meta{algorithm-generated options} have been ``computed by the
- algorithm''. For instance, an algorithm might have determined, say,
- flow capacities for edges and it might now wish to communicate this
- information back to the upper layers. These options should be
- executed with the path |/graph drawing|.
-
- The parameter \meta{bend information} contains
- algorithmically-computed information concerning how the
- edge should bend. This will be a text like
- |(10pt,20pt)--(30pt,40pt)| in \tikzname-syntax and may include the
- path commands |--|, |..| (followed by B\'ezier coordintes), and
- |--cycle|.
-
- The default \meta{macro} simply draws a line between the nodes. When
- the |graphdrawing| library of the \tikzname\ layer is loaded, a more
- fancy \meta{macro} is used that takes all of the parameters into
- account.
+ This command allows you to change the \meta{macro} that gets called form
+ inside the graph drawing system at the end of the creation of a graph, when
+ the nodes have been positioned. The \meta{macro} will be called once for
+ each edge with the following parameters:
+ %
+ \begin{quote}
+ \meta{macro}\marg{first node}\marg{second node}\marg{direction}\marg{edge options}\marg{edge nodes}\\
+ \marg{algorithm-generated options}\marg{bend information}\marg{animations}
+ \end{quote}
+
+ The first five parameters are the original values that were passed down to
+ the |\pgfgdedge| command.
+
+ The \meta{algorithm-generated options} have been ``computed by the
+ algorithm''. For instance, an algorithm might have determined, say, flow
+ capacities for edges and it might now wish to communicate this information
+ back to the upper layers. These options should be executed with the path
+ |/graph drawing|.
+
+ The parameter \meta{bend information} contains algorithmically-computed
+ information concerning how the edge should bend. This will be a text like
+ |(10pt,20pt)--(30pt,40pt)| in \tikzname-syntax and may include the path
+ commands |--|, |..| (followed by Bézier coordinates), and |--cycle|.
+
+ The parameter \meta{animations} contains algorithmically-generated
+ animation commands (calls to |\pgfanimateattribute|. The |whom| will be set
+ to |pgf@gd|.
+
+ The default \meta{macro} simply draws a line between the nodes. When the
+ |graphdrawing| library of the \tikzname\ layer is loaded, a more fancy
+ \meta{macro} is used that takes all of the parameters into account.
\end{command}
-
\subsection{Layout Scopes}
\label{section-gd-layout-scopes}
-As described in Section~\ref{section-gd-sublayouts}, the graph drawing
-engine does not always apply only a single algorithm. Rather, several
-different algorithm may be applied to different parts of the
-graph. How this happens, exactly, is goverened by a hierarchy of
-layouts, which are setup using the commands |\pgfgdbeginlayout| and
-|\pgfgdendlayout|.
-
+As described in Section~\ref{section-gd-sublayouts}, the graph drawing engine
+does not always apply only a single algorithm. Rather, several different
+algorithm may be applied to different parts of the graph. How this happens,
+exactly, is governed by a hierarchy of layouts, which are setup using the
+commands |\pgfgdbeginlayout| and |\pgfgdendlayout|.
\begin{command}{\pgfgdbeginlayout}
- This command first starts a new \TeX\ scope and then informs the
- display layer that a new (sub)layout should be started. For each
- graph there may be a hierarchy of layouts, each of which contains a
- certain number of vertices and edges. This hierarchy is created
- through calls to this macros and the corresponding calls of
- |\pgfgdendlayout|. For each graph drawing scope there has to be
- exactly one main layout that encompasses all nodes and edges and
- also all sublayouts. Thus, after a graph drawing scope has been
- opened, a layout scope also needs to be opened almost immediately.
-
- For each layout created via this macro, a graph drawing algorithm
- will be run later on on the subgraph of all nodes that make up the
- layout. Which algorithm is run for the layout is dictated by which
- layout key (one of the |... layout| keys) is ``in force'' when the
- macro is called. Thus, using a layout key for selecting an algorithm
- must always be done \emph{before} the layout is started. (However,
- see the discussion of layout keys in the next subsection for more
- details on what really happens.)
-
- A vertex can be part of several layouts, either because they are
- nested or because they overlap (this happens when a node is later on
- added to another layout by calling |\pgfgdsetlatenodeoption|). This
- means that it is not immediately obvious how conflicts arising from
- the different ways different algorithms ``would like to place
- nodes'' should be resolved. The method for this resolving is
- detailed in Section~\ref{section-gd-layout-resolve}.
+ This command first starts a new \TeX\ scope and then informs the display
+ layer that a new (sub)layout should be started. For each graph there may be
+ a hierarchy of layouts, each of which contains a certain number of vertices
+ and edges. This hierarchy is created through calls to this macros and the
+ corresponding calls of |\pgfgdendlayout|. For each graph drawing scope
+ there has to be exactly one main layout that encompasses all nodes and
+ edges and also all sublayouts. Thus, after a graph drawing scope has been
+ opened, a layout scope also needs to be opened almost immediately.
+
+ For each layout created via this macro, a graph drawing algorithm will be
+ run later on the subgraph of all nodes that make up the layout. Which
+ algorithm is run for the layout is dictated by which layout key (one of the
+ |... layout| keys) is ``in force'' when the macro is called. Thus, using a
+ layout key for selecting an algorithm must always be done \emph{before} the
+ layout is started. (However, see the discussion of layout keys in the next
+ subsection for more details on what really happens.)
+
+ A vertex can be part of several layouts, either because they are nested or
+ because they overlap (this happens when a node is later on added to another
+ layout by calling |\pgfgdsetlatenodeoption|). This means that it is not
+ immediately obvious how conflicts arising from the different ways different
+ algorithms ``would like to place nodes'' should be resolved. The method for
+ this resolving is detailed in Section~\ref{section-gd-layout-resolve}.
\end{command}
\begin{command}{\pgfgdendlayout}
- This command ends the \TeX\ scope of the current layout. Once
- closed, no nodes or edges can be added to a layout.
+ This command ends the \TeX\ scope of the current layout. Once closed, no
+ nodes or edges can be added to a layout.
\end{command}
-
\begin{command}{\pgfgdsetlatenodeoption\marg{node name}}
- This command can only be called when the node named \meta{node name}
- has already been created inside the current graph drawing scope. The
- effect of calling this macro will be that all options currently on
- the graph drawing system's option stack will be added to the node's
- option, possibly overwriting the original option
- settings. Furthermore, the node will become part of all layouts
- currently on the option stack. This means that you can use this
- command to add a node to several layouts that are not included in
- one another.
+ This command can only be called when the node named \meta{node name} has
+ already been created inside the current graph drawing scope. The effect of
+ calling this macro will be that all options currently on the graph drawing
+ system's option stack will be added to the node's option, possibly
+ overwriting the original option settings. Furthermore, the node will become
+ part of all layouts currently on the option stack. This means that you can
+ use this command to add a node to several layouts that are not included in
+ one another.
\end{command}
-
\subsection{Layout Keys}
-\emph{Layout keys} are keys like |tree layout|
-or |layered layout| that are used to select a specific graph drawing
-algorithm. From the graph drawing system's point of view, these keys
-``just'' select an algorithm and when several layout keys are used in
-a row, the last one would ``win''; just as when you say |orient=90| directly
-followed by |orient=0|, the result is that the |orient| key is set to
-|0| because the last key ``wins.''
-
-Unfortunately, if keys like |tree layout| were ``just'' to select an
-algorithm, we would still need a key or some special syntax to
-actually start a (sub)layout. In early versions of the system this was
-exactly what people had to do and this was somewhat awkward. Because
-of this problem, the behaviour of the layout keys in \pgfname\ (and
-only there, other display layers need to implement their own
-behaviour) is now a bit more involved. When you use a key like
-|tree layout| (more precisely, any key that
-was declared as an algorithm key on the algorithm layer of the graph
-drawing system) in any scope in \pgfname, the following happens:
+\emph{Layout keys} are keys like |tree layout| or |layered layout| that are
+used to select a specific graph drawing algorithm. From the graph drawing
+system's point of view, these keys ``just'' select an algorithm and when
+several layout keys are used in a row, the last one would ``win''; just as when
+you say |orient=90| directly followed by |orient=0|, the result is that the
+|orient| key is set to |0| because the last key ``wins''.
+
+Unfortunately, if keys like |tree layout| were ``just'' to select an algorithm,
+we would still need a key or some special syntax to actually start a
+(sub)layout. In early versions of the system this was exactly what people had
+to do and this was somewhat awkward. Because of this problem, the behaviour of
+the layout keys in \pgfname\ (and only there, other display layers need to
+implement their own behaviour) is now a bit more involved. When you use a key
+like |tree layout| (more precisely, any key that was declared as an algorithm
+key on the algorithm layer of the graph drawing system) in any scope in
+\pgfname, the following happens:
+%
\begin{enumerate}
-\item The graph drawing system is told that a specific algorithm has
- been selected (the Reingold--Tilford-algorithm in this case; this
- information was communicated to the graph drawing system during the
- declaration of the algorithm). Being ``told'' about this means that
- a special entry is pushed onto the current options stack of the
- graph drawing system.
-\item An internal ``request'' for a ``scope and a layout'' is
- made. This has several effects:
-\item
- We first test whether we are already inside a layout scope. If not,
- we use |\pgfgdbeginscope| to open a graph drawing scope. This
- scope will be closed appropriately (see |\pgfgdsetrequestcallback|
- for details).
-\item
- Next, a layout scope is opened using |\pgfgdbeginlayout|. It will
- also be closed appropriately.
+ \item The graph drawing system is told that a specific algorithm has been
+ selected (the Reingold--Tilford-algorithm in this case; this
+ information was communicated to the graph drawing system during the
+ declaration of the algorithm). Being ``told'' about this means that a
+ special entry is pushed onto the current options stack of the graph
+ drawing system.
+ \item An internal ``request'' for a ``scope and a layout'' is made. This
+ has several effects:
+ \item We first test whether we are already inside a layout scope. If not,
+ we use |\pgfgdbeginscope| to open a graph drawing scope. This scope
+ will be closed appropriately (see |\pgfgdsetrequestcallback| for
+ details).
+ \item Next, a layout scope is opened using |\pgfgdbeginlayout|. It will
+ also be closed appropriately.
\end{enumerate}
-The net effect of the above is that the first use of a layout key in a
-picture starts both a graph drawing scope and also a main layout,
-while subsequent uses of layout keys inside a picture will only open
-sublayouts.
+The net effect of the above is that the first use of a layout key in a picture
+starts both a graph drawing scope and also a main layout, while subsequent uses
+of layout keys inside a picture will only open sublayouts.
\begin{command}{\pgfgdsetrequestcallback\marg{macro}}
- This command sets up \meta{macro} as the macro that is called
- whenever a layout key ``requests'' that a layout and, possibly, a
- graph drawing scope is opened. When \meta{macro} is called, it gets
- two parameters, the \meta{begin code} and the \meta{end code}. In
- addition to whatever setup the \meta{macro} would like to do, it
- should execute the \meta{begin code} at the beginning of a \TeX\
- scope (the code will open graph drawing and layout scopes) and the
- \meta{end code} at the end of the same \TeX\ scope.
-
- The need for this slightly strange macro arises from the fact that
- in \tikzname\ we often write things like
- |[spring layout,node sep=2cm]|. The point is that when the
- |spring layout| key is executed, we do \emph{not} wish to open a
- layout scope immediately. Rather, this should happen only after the
- option |nodes sep=2cm| has been executed. For this reason, \tikzname\
- sets up a special \meta{macro} that ``delays'' the execution of the
- \meta{begin code} until the end of the opening of the next scope.
-
- Because of this, in \tikzname\ layout keys can only be used as an
- option when a \tikzname\ scope is started. Thus, you can
- pass them to |\tikz|, to |{tikzpicture}|, to |\scoped|, to |{scope}|,
- to |graph|, and to |{graph}|. For instance, the |tree layout| option can
- be used in the following ways:
+ This command sets up \meta{macro} as the macro that is called whenever a
+ layout key ``requests'' that a layout and, possibly, a graph drawing scope
+ is opened. When \meta{macro} is called, it gets two parameters, the
+ \meta{begin code} and the \meta{end code}. In addition to whatever setup
+ the \meta{macro} would like to do, it should execute the \meta{begin code}
+ at the beginning of a \TeX\ scope (the code will open graph drawing and
+ layout scopes) and the \meta{end code} at the end of the same \TeX\ scope.
+
+ The need for this slightly strange macro arises from the fact that in
+ \tikzname\ we often write things like |[spring layout,node sep=2cm]|. The
+ point is that when the |spring layout| key is executed, we do \emph{not}
+ wish to open a layout scope immediately. Rather, this should happen only
+ after the option |nodes sep=2cm| has been executed. For this reason,
+ \tikzname\ sets up a special \meta{macro} that ``delays'' the execution of
+ the \meta{begin code} until the end of the opening of the next scope.
+
+ Because of this, in \tikzname\ layout keys can only be used as an option
+ when a \tikzname\ scope is started. Thus, you can pass them to |\tikz|, to
+ |{tikzpicture}|, to |\scoped|, to |{scope}|, to |graph|, and to |{graph}|.
+ For instance, the |tree layout| option can be used in the following ways:
+ %
\begin{codeexample}[]
-\tikz [tree layout] \graph {1 -> {b,c}};
+\tikz [tree layout] \graph {1 -> {b,c}};
\tikz \graph [tree layout] {2 -> {b,c}};
\tikz \path graph [tree layout] {3 -> {b,c}};
@@ -571,17 +544,17 @@ sublayouts.
\begin{tikzpicture}
\scoped [tree layout] \graph {5 -> {b,c}};
-
+
\begin{scope}[tree layout, xshift=1.5cm]
\graph {6 -> {b,c}};
\end{scope}
\end{tikzpicture}
\end{codeexample}
- You can \emph{not} use layout keys with a single
- node or on a path. In particular, to typeset a tree given in the
- |child| syntax somewhere inside a |{tikzpicture}|, you must prefix
- it with the |\scoped| command:
+ You can \emph{not} use layout keys with a single node or on a path. In
+ particular, to typeset a tree given in the |child| syntax somewhere inside
+ a |{tikzpicture}|, you must prefix it with the |\scoped| command:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\scoped [tree layout]
@@ -590,132 +563,121 @@ sublayouts.
child { node {right child} };
\end{tikzpicture}
\end{codeexample}
- Naturally, the above could have been written more succinctly as
+ %
+ Naturally, the above could have been written more succinctly as
+ %
\begin{codeexample}[]
\tikz [tree layout]
\node {root}
child { node {left child} }
child { node {right child} };
\end{codeexample}
- Or even more succinctly:
+ %
+ Or even more succinctly:
+ %
\begin{codeexample}[]
\tikz \graph [tree layout] { root -- {left child, right child} };
\end{codeexample}
+ %
\end{command}
-
\subsection{Parameters}
\label{section-gd-parameters}
-When a graph drawing algorithm starts working, a set of options,
-called ``graph drawing parameters'' or just ``parameters'' can influence
-the way the algorithm works. For instance, a graph drawing parameter
-might be the average distance between vertices which the algorithm
-should take into account. Another example might be the fact the
-certain nodes are special nodes and that a certain edge should have
-a large label.
+When a graph drawing algorithm starts working, a set of options, called ``graph
+drawing parameters'' or just ``parameters'' can influence the way the algorithm
+works. For instance, a graph drawing parameter might be the average distance
+between vertices which the algorithm should take into account. Another example
+might be the fact the certain nodes are special nodes and that a certain edge
+should have a large label.
-These graph drawing parameters are different from ``usual'' \pgfname\
-options: An alogrithmic parameter influences the way the algorithm
-works, while usual options influence the way the result
-looks like. For instance, the fact that a node is red is not a
-graph drawing parameter, while the shape of a node might be an graph
-drawing parameter.
+These graph drawing parameters are different from ``usual'' \pgfname\ options:
+An algorithmic parameter influences the way the algorithm works, while usual
+options influence the way the result looks like. For instance, the fact that a
+node is red is not a graph drawing parameter, while the shape of a node might
+be an graph drawing parameter.
-The possible graph parameters are declared by the algorithmic layer
-through the |declare| method; you cannot declare parameters on the
-\pgfname\ layer since this would not be compatible across different
-display systems.
+The possible graph parameters are declared by the algorithmic layer through the
+|declare| method; you cannot declare parameters on the \pgfname\ layer since
+this would not be compatible across different display systems.
-Users use a graph parameter in the same way as a normal key. The
-difference is that each time a key representing a graph drawing
-parameter is used, a special function of the graph drawing system's
-interface is called to ``push'' the parameter onto an internal option
-stack (and elements are popped from this stack whenever the \TeX\
-scope closes in which the key was used).
-
-The net effect of all of this is that the graph drawing system keeps
-track of a stack of option in parallel to \TeX. You cannot, however,
-access the current values of graph drawing parameters from \TeX\ since
-they are tucked away deep inside the graph drawing system.
+Users use a graph parameter in the same way as a normal key. The difference is
+that each time a key representing a graph drawing parameter is used, a special
+function of the graph drawing system's interface is called to ``push'' the
+parameter onto an internal option stack (and elements are popped from this
+stack whenever the \TeX\ scope closes in which the key was used).
+The net effect of all of this is that the graph drawing system keeps track of a
+stack of option in parallel to \TeX. You cannot, however, access the current
+values of graph drawing parameters from \TeX\ since they are tucked away deep
+inside the graph drawing system.
\subsection{Events}
-\emph{Events} are used to pass information from the parser about the
-syntactic structure of a graph to graph drawing algorithms. Consider,
-for instance, a graph that is actually a tree in which some node
-``misses'' its first child. In this case, the information that the
-child is missing is neither part of any node (because the node is
-missing, after all) nor is it an option of the whole graph. However,
-events are created by the parser the allow an algorithm to reconstruct
-the fact that the child is missing. Naturally, graph drawing
+\emph{Events} are used to pass information from the parser about the syntactic
+structure of a graph to graph drawing algorithms. Consider, for instance, a
+graph that is actually a tree in which some node ``misses'' its first child. In
+this case, the information that the child is missing is neither part of any
+node (because the node is missing, after all) nor is it an option of the whole
+graph. However, events are created by the parser the allow an algorithm to
+reconstruct the fact that the child is missing. Naturally, graph drawing
algorithms may choose to ignore events and most will.
-Most of the creation and handling of events is done automatically. The
-only reason you might wish to use the following commands is when you
-write a ``parser extension'' together with a new graph drawing
-algorithm. For instance, you might come up with new options that, when
-used, trigger events.
+Most of the creation and handling of events is done automatically. The only
+reason you might wish to use the following commands is when you write a
+``parser extension'' together with a new graph drawing algorithm. For instance,
+you might come up with new options that, when used, trigger events.
\begin{command}{\pgfgdevent\marg{kind}\marg{parameter}}
- Calls |createEvent| of the graph drawing system's interface
- class. This creates a new |Event| object on the Lua layer whose
- |kind| field is set to \meta{kind} and the |parameters| field to
- \meta{parameter}. You must be inside a graph drawing scope to use
- this command.
+ Calls |createEvent| of the graph drawing system's interface class. This
+ creates a new |Event| object on the Lua layer whose |kind| field is set to
+ \meta{kind} and the |parameters| field to \meta{parameter}. You must be
+ inside a graph drawing scope to use this command.
\end{command}
\begin{command}{\pgfgdbegineventgroup\marg{parameter}}
- Starts an event group. This just means that an |Event| of kind
- |begin| is created with the given \meta{parameter}.
+ Starts an event group. This just means that an |Event| of kind |begin| is
+ created with the given \meta{parameter}.
\end{command}
\begin{command}{\pgfgdendeventgroup}
- Ends an event group. This is done by adding an event of kind |end|
- without any parameters to the event string.
+ Ends an event group. This is done by adding an event of kind |end| without
+ any parameters to the event string.
\end{command}
\begin{command}{\pgfgdeventgroup\marg{parameters}}
- Starts an event group just like |\pgfgdbegineventgroup|, but adds a
- corresponding closing |end| event at the end of the current \TeX\
- group (using |\aftergroup|).
+ Starts an event group just like |\pgfgdbegineventgroup|, but adds a
+ corresponding closing |end| event at the end of the current \TeX\ group
+ (using |\aftergroup|).
\end{command}
\subsection{Subgraph Nodes}
\begin{command}{\pgfgdsubgraphnode\marg{name}\marg{node options}\marg{node text}}
- A subgraph node is a node that ``surrounds'' the nodes of a
- subgraph. The special property of a subgraph node opposed to a
- normal node is that it is created only after the subgraph has been
- laid out. However, the difference to a collection like |hyper| is
- that the node is availble immediately as a normal node in the sense
- that you can connect edges to it.
-
- What happens internally is that subgraph nodes get ``registered''
- immediately both on the \pgfname\ level and on the Lua level, but the
- actual node is only created inside the layout pipeline using a
- callback. The actual node creation happens when the innermost layout
- in which the subgraph node is declared has finished.
-
- When you create a subgraph node using this macro, you also start a
- collection (of an internal kind) that stores the subgraph. All
- following nodes in the current \TeX\ scope will become part of this
- collection.
-
- The \meta{name} is the node name by which you can refer to this node
- in the following. The \meta{node options} are normal \pgfname\
- options (like |red| or |draw| or |circle|) that will influence the
- appearance when it is created later on. The \meta{node text} is the
- text that will be passed to |\pgfnode| upon creation of the node.
-
- See |InterfaceToDisplay.pushSubgraphVertex| for more details.
+ A subgraph node is a node that ``surrounds'' the nodes of a subgraph. The
+ special property of a subgraph node opposed to a normal node is that it is
+ created only after the subgraph has been laid out. However, the difference
+ to a collection like |hyper| is that the node is available immediately as a
+ normal node in the sense that you can connect edges to it.
+
+ What happens internally is that subgraph nodes get ``registered''
+ immediately both on the \pgfname\ level and on the Lua level, but the
+ actual node is only created inside the layout pipeline using a callback.
+ The actual node creation happens when the innermost layout in which the
+ subgraph node is declared has finished.
+
+ When you create a subgraph node using this macro, you also start a
+ collection (of an internal kind) that stores the subgraph. All following
+ nodes in the current \TeX\ scope will become part of this collection.
+
+ The \meta{name} is the node name by which you can refer to this node in the
+ following. The \meta{node options} are normal \pgfname\ options (like |red|
+ or |draw| or |circle|) that will influence the appearance when it is
+ created later on. The \meta{node text} is the text that will be passed to
+ |\pgfnode| upon creation of the node.
+
+ See |InterfaceToDisplay.pushSubgraphVertex| for more details.
\end{command}
-
-
-
-
-
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-usage-tikz.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-usage-tikz.tex
index 222898b66e7..bbedfc01db9 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-usage-tikz.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-gd-usage-tikz.tex
@@ -13,78 +13,82 @@
{\noindent {\emph{by Till Tantau}}}
\begin{tikzlibrary}{graphdrawing}
- This package provides capabilities for automatic graph drawing. It
- requires that the document is typeset using Lua\TeX. This package
- should work with Lua\TeX\ 0.54 or higher.
+ This package provides capabilities for automatic graph drawing. It requires
+ that the document is typeset using Lua\TeX. This package should work with
+ Lua\TeX\ 0.54 or higher.
\end{tikzlibrary}
-\ifluatex\else This section of the manual can only be typeset using Lua\TeX.\expandafter\endinput\fi
+\ifluatex
+\else
+ This section of the manual can only be typeset using Lua\TeX.
+ \expandafter\endinput
+\fi
\subsection{Choosing a Layout and a Library}
The graph drawing engine is initialized when you load the library
-|graphdrawing|. This library provides the basic framework for graph
-drawing, including all options and keys described in the present
-section. However, this library does \emph{not} load any actual
-algorithms for drawing graphs. For this, you need to use the following
-command, which is defined by the |graphdrawing| library:
+|graphdrawing|. This library provides the basic framework for graph drawing,
+including all options and keys described in the present section. However, this
+library does \emph{not} load any actual algorithms for drawing graphs. For
+this, you need to use the following command, which is defined by the
+|graphdrawing| library:
\begin{command}{\usegdlibrary\marg{list of libraries}}
- This command is used to load the special graph drawing libraries
- (the |gd| in the name of the command stands for ``graph
- drawing''). The \meta{list of libraries} is a comma-separated list
- of library written in the Lua programming language (which is why a
- special command is needed).
-
- In detail, this command does the following. For each \meta{name} in
- the \meta{list of libraries} we do:
- \begin{enumerate}
- \item Check whether Lua\TeX\ can call |require| on the library file
- |pgf.gd.|\meta{name}|.library|. Lua\TeX's usual file search
- mechanism will search the texmf-trees in the usual manner and the
- dots in the file name get converted into directory slashes.
- \item If the above failed, try to |require| the string
- |pgf.gd.|\meta{name}.
- \item If this fails, try to |require| the string
- \meta{name}|.library|.
- \item If this fails, try to |require| the string \meta{name}. If
- this fails, print an error message.
- \end{enumerate}
- The net effect of the above is the following: Authors of graph
- drawing algorithms can bundle together multiple algorithms in a
- library by creating a |...xyz/library.lua| file that internally just
- calls |require| for all files containing declarations. On the other
- hand, if a graph drawing algorithm completely fits inside a single
- file, it can also be read directly using |\usegdlibrary|.
+ This command is used to load the special graph drawing libraries (the |gd|
+ in the name of the command stands for ``graph drawing''). The \meta{list of
+ libraries} is a comma-separated list of library written in the Lua
+ programming language (which is why a special command is needed).
+
+ In detail, this command does the following. For each \meta{name} in the
+ \meta{list of libraries} we do:
+ %
+ \begin{enumerate}
+ \item Check whether Lua\TeX\ can call |require| on the library file
+ |pgf.gd.|\meta{name}|.library|. Lua\TeX's usual file search
+ mechanism will search the texmf-trees in the usual manner and the
+ dots in the file name get converted into directory slashes.
+ \item If the above failed, try to |require| the string
+ |pgf.gd.|\meta{name}.
+ \item If this fails, try to |require| the string \meta{name}|.library|.
+ \item If this fails, try to |require| the string \meta{name}. If this
+ fails, print an error message.
+ \end{enumerate}
+ %
+ The net effect of the above is the following: Authors of graph drawing
+ algorithms can bundle together multiple algorithms in a library by creating
+ a |...xyz/library.lua| file that internally just calls |require| for all
+ files containing declarations. On the other hand, if a graph drawing
+ algorithm completely fits inside a single file, it can also be read
+ directly using |\usegdlibrary|.
+ %
\begin{codeexample}[code only]
\usetikzlibrary{graphdrawing}
-\usegdlibrary{trees,force}
+\usegdlibrary{trees,force}
\end{codeexample}
- The different graph drawing libraries are documented in the following
- Sections~\ref{section-first-graphdrawing-library-in-manual} to
- \ref{section-last-graphdrawing-library-in-manual}.
+ The different graph drawing libraries are documented in the following
+ Sections~\ref{section-first-graphdrawing-library-in-manual} to
+ \ref{section-last-graphdrawing-library-in-manual}.
\end{command}
-Note that in addition to the graph \emph{drawing} libraries, you may
-also wish to load the normal \tikzname\ library |graphs|. It provides
-the powerful |graph| path command with its easy-to-use syntax for
-specifying graphs, but you can use the graph drawing engine
-independently of the |graphs| library, for instance in conjunction
-with the |child| or the |edge| syntax. Here is a typical setup:
-
+Note that in addition to the graph \emph{drawing} libraries, you may also wish
+to load the normal \tikzname\ library |graphs|. It provides the powerful
+|graph| path command with its easy-to-use syntax for specifying graphs, but you
+can use the graph drawing engine independently of the |graphs| library, for
+instance in conjunction with the |child| or the |edge| syntax. Here is a
+typical setup:
+%
\begin{codeexample}[code only]
\usetikzlibrary{graphs, graphdrawing}
-\usegdlibrary{trees, layered}
+\usegdlibrary{trees, layered}
\end{codeexample}
-Having set things up, you must then specify for which scopes the
-graph drawing engine should apply a layout algorithm to the nodes in
-the scope. Typically, you just add an option ending with |... layout|
-to the |graph| path operation and then let the graph drawing do its
-magic:
-
+Having set things up, you must then specify for which scopes the graph drawing
+engine should apply a layout algorithm to the nodes in the scope. Typically,
+you just add an option ending with |... layout| to the |graph| path operation
+and then let the graph drawing do its magic:
+%
\begin{codeexample}[]
\tikz [rounded corners]
\graph [layered layout, sibling distance=8mm, level distance=8mm]
@@ -93,92 +97,87 @@ magic:
b,
c -> { d, e }
} ->
- f ->
+ f ->
a
- };
+ };
\end{codeexample}
Whenever you use such an option, you can:
+%
\begin{itemize}
-\item Create nodes in the usual way. The nodes will be created
- completely, but then tucked away in an internal table. This means
- that all of \tikzname's options for nodes can be applied. You can
- also name a node and reference it later.
-\item Create edges using either the syntax of the |graph| command
- (using |--|, |<-|, |->|, or |<->|), or using the |edge| command,
- or using the |child| command. These edges will, however, not be
- created immediately. Instead, the basic layer's command
- |\pgfgdedge| will be called, which stores ``all the information
- concerning the edge.'' The actual drawing of the edge will only
- happen after all nodes have been positioned.
-\item Most of the keys that can be passed to an edge will work as
- expected. In particular, you can add labels to edges using the
- usual |node| syntax for edges.
-\item The |label| and |pin| options can be used in the usual manner
- with nodes inside a graph drawing scope. Only, the labels and
- nodes will play no role in the positioning of the nodes and they
- are added when the nodes are finally positioned.
-\item Similarly, nodes that are placed ``on an edge'' using the
- implicit positioning syntax can be used in the usual manner.
+ \item Create nodes in the usual way. The nodes will be created completely,
+ but then tucked away in an internal table. This means that all of
+ \tikzname's options for nodes can be applied. You can also name a node
+ and reference it later.
+ \item Create edges using either the syntax of the |graph| command (using
+ |--|, |<-|, |->|, or |<->|), or using the |edge| command, or using the
+ |child| command. These edges will, however, not be created immediately.
+ Instead, the basic layer's command |\pgfgdedge| will be called, which
+ stores ``all the information concerning the edge''. The actual drawing
+ of the edge will only happen after all nodes have been positioned.
+ \item Most of the keys that can be passed to an edge will work as expected.
+ In particular, you can add labels to edges using the usual |node|
+ syntax for edges.
+ \item The |label| and |pin| options can be used in the usual manner with
+ nodes inside a graph drawing scope. Only, the labels and nodes will
+ play no role in the positioning of the nodes and they are added when
+ the nodes are finally positioned.
+ \item Similarly, nodes that are placed ``on an edge'' using the implicit
+ positioning syntax can be used in the usual manner.
\end{itemize}
+%
Here are some things that will \emph{not} work:
+%
\begin{itemize}
-\item Only edges created using the graph syntax, the |edge| command,
- or the |child| command will correctly pass their connection
- information to the basic layer. When you write |\draw (a)--(b);|
- inside a graph drawing scope, where |a| and |b| are nodes that
- have been created inside the scope, you will get an error
- message / things will look wrong. The reason is that the usual
- |--| is not ``caught'' by the graph drawing engine and, thus,
- tries to immediately connect two nodes that do not yet exist
- (except inside some internal table).
-\item The options of edges are executed twice: Once when the edge is
- ``examined'' by the |\pgfgdedge| command (using some magic to shield
- against the side effects) and then once more when the edge is
- actually created. Fortunately, in almost all cases, this will not be
- a problem; but if you do very evil magic inside your edge options,
- you must roll a D100 to see what strange things will happen. (Do no
- evil, by the way.)
+ \item Only edges created using the graph syntax, the |edge| command, or the
+ |child| command will correctly pass their connection information to the
+ basic layer. When you write |\draw (a)--(b);| inside a graph drawing
+ scope, where |a| and |b| are nodes that have been created inside the
+ scope, you will get an error message / things will look wrong. The
+ reason is that the usual |--| is not ``caught'' by the graph drawing
+ engine and, thus, tries to immediately connect two nodes that do not
+ yet exist (except inside some internal table).
+ \item The options of edges are executed twice: Once when the edge is
+ ``examined'' by the |\pgfgdedge| command (using some magic to shield
+ against the side effects) and then once more when the edge is actually
+ created. Fortunately, in almost all cases, this will not be a problem;
+ but if you do very evil magic inside your edge options, you must roll a
+ D100 to see what strange things will happen. (Do no evil, by the way.)
\end{itemize}
-If you are really interested in the ``fine print'' of what happens,
-please see Section~\ref{section-gd-pgf}.
+If you are really interested in the ``fine print'' of what happens, please see
+Section~\ref{section-gd-pgf}.
\subsection{Graph Drawing Parameters}
-Graph drawing algorithms can typically be configured in some way. For
-instance, for a graph drawing algorithm that visualizes its nodes as a
-tree, it will typically be useful when the user can change the
-so-called \emph{level distance} and the \emph{sibling distance}. For
-other algorithms, like force-based algorithms, a large number of
-parameters influence the way the algorithms work.
-Options that influence graph drawing algorithms will be called
-\emph{(graph drawing) parameters} in the following. From the user's
-point of view, these parameters look like normal \tikzname\ keys and
-you set them in the usual way. Internally, they are treated a bit
-differently from normal keys since their ``effect'' becomes apparent
-only later on, namely during the run of the graph drawing algorithm.
-
-A graph drawing algorithm may or may not take different graph
-parameters into account. After all, these options may even outright
-contradict each other, so an algorithm can only try to ``do its
-best''. While many graph parameters are very specific to a single
-algorithm, a number of graph parameters will be important for many
-algorithms and they are documented in the course of the present
-section. Here is an example of an option the ``always works'':
-
+Graph drawing algorithms can typically be configured in some way. For instance,
+for a graph drawing algorithm that visualizes its nodes as a tree, it will
+typically be useful when the user can change the so-called \emph{level
+distance} and the \emph{sibling distance}. For other algorithms, like
+force-based algorithms, a large number of parameters influence the way the
+algorithms work. Options that influence graph drawing algorithms will be called
+\emph{(graph drawing) parameters} in the following. From the user's point of
+view, these parameters look like normal \tikzname\ keys and you set them in the
+usual way. Internally, they are treated a bit differently from normal keys
+since their ``effect'' becomes apparent only later on, namely during the run of
+the graph drawing algorithm.
+
+A graph drawing algorithm may or may not take different graph parameters into
+account. After all, these options may even outright contradict each other, so
+an algorithm can only try to ``do its best''. While many graph parameters are
+very specific to a single algorithm, a number of graph parameters will be
+important for many algorithms and they are documented in the course of the
+present section. Here is an example of an option the ``always works'':
+%
\begin{codeexample}[]
-\tikz \graph [spring layout, vertical=1 to 2] { 1--2--3--1 };
+\tikz \graph [spring layout, vertical=1 to 2] { 1--2--3--1 };
\end{codeexample}
-
\includeluadocumentationof{pgf.gd.control.Distances}
\includeluadocumentationof{pgf.gd.control.Anchoring}
\includeluadocumentationof{pgf.gd.control.Orientation}
-
-
\includeluadocumentationof{pgf.gd.control.FineTune}
\includeluadocumentationof{pgf.gd.control.Components}
@@ -193,46 +192,43 @@ section. Here is an example of an option the ``always works'':
\subsection{Using Several Different Layouts to Draw a Single Graph}
-
\label{section-gd-sublayouts}
-Inside each graph drawing scope, a main algorithm is used to perform
-the graph drawing. However, parts of the graph may be drawn using
-different algorithms: For instance, a graph might consist of
-several, say, cliques that are arranged in a tree-like fashion. In
-this case, it might be useful to layout each clique using a circular
-layout, but then lay out all laid out cliques using a tree drawing
-algorithm.
+Inside each graph drawing scope, a main algorithm is used to perform the graph
+drawing. However, parts of the graph may be drawn using different algorithms:
+For instance, a graph might consist of several, say, cliques that are arranged
+in a tree-like fashion. In this case, it might be useful to layout each clique
+using a circular layout, but then lay out all laid out cliques using a tree
+drawing algorithm.
-In order to lay out a graph using multiple algorithms, we need two
-things: First, we must be able to \emph{specify} which algorithms
-should be used where and, second, we must be able to \emph{resolve}
-conflicts that may result from different algorithms ``having different
-ideas'' concerning where nodes should be placed.
+In order to lay out a graph using multiple algorithms, we need two things:
+First, we must be able to \emph{specify} which algorithms should be used where
+and, second, we must be able to \emph{resolve} conflicts that may result from
+different algorithms ``having different ideas'' concerning where nodes should
+be placed.
\subsubsection{Sublayouts}
-Specifying different layouts for a graph is easy: Inside a graph
-drawing scope, simply open scopes, in which you use an option like
-|tree layout| for the nodes mentioned in this scope. Inside these
-scopes, you can open even subscopes for sublayouts, and so
-on. Furthermore, the |graphs| library has special support for
-sublayouts.
-
-Let us start with the ``plain'' syntax for opening sublayouts: You
-pass a key for creating layouts to a |scope|:
+Specifying different layouts for a graph is easy: Inside a graph drawing scope,
+simply open scopes, in which you use an option like |tree layout| for the nodes
+mentioned in this scope. Inside these scopes, you can open even subscopes for
+sublayouts, and so on. Furthermore, the |graphs| library has special support
+for sublayouts.
+Let us start with the ``plain'' syntax for opening sublayouts: You pass a key
+for creating layouts to a |scope|:
+%
\begin{codeexample}[]
\tikz [spring layout] {
- \begin{scope}[tree layout]
+ \begin{scope}[tree layout]
\node (a) {a};
\node (b) {b};
\node (c) {c};
\draw (a) edge (b) edge (c);
\end{scope}
-
- \begin{scope}[tree layout]
+
+ \begin{scope}[tree layout]
\node (1) {1};
\node (2) {2};
\draw (1) edge (2);
@@ -242,27 +238,26 @@ pass a key for creating layouts to a |scope|:
}
\end{codeexample}
-Let us see, what is going on here. The main layout (|spring layout|)
-contains two sublayouts (the two |tree layouts|). Both of them are
-laid out independently (more on the details in a moment). Then, from
-the main layout's point of view, the sublayouts behave like ``large
-nodes'' and, thus, the edge between |a| and |1| is actually the only
-edge that is used by the |spring layout| -- resulting in a simple
-layout consisting of one big node at the top and a big node at the
-bottom.
-
-The |graphs| library has a special support for sublayouts: The syntax
-is as follows: wherever a normal node would go, you can write
+Let us see, what is going on here. The main layout (|spring layout|) contains
+two sublayouts (the two |tree layouts|). Both of them are laid out
+independently (more on the details in a moment). Then, from the main layout's
+point of view, the sublayouts behave like ``large nodes'' and, thus, the edge
+between |a| and |1| is actually the only edge that is used by the
+|spring layout| -- resulting in a simple layout consisting of one big node at
+the top and a big node at the bottom.
+The |graphs| library has a special support for sublayouts: The syntax is as
+follows: wherever a normal node would go, you can write
+%
\begin{quote}
- |//| \opt{\oarg{layout options}} |{|\meta{sublayout}|}|
+ |//| \opt{\oarg{layout options}} |{|\meta{sublayout}|}|
\end{quote}
-Following the double slash, you may provide
-\meta{layout options} in square brackets. However, you \emph{must}
-provide a sublayout in braces. The contents of \meta{sublayout} will
-be parsed using the usual |graph| syntax, but will form a sublayout.
-
+Following the double slash, you may provide \meta{layout options} in square
+brackets. However, you \emph{must} provide a sublayout in braces. The contents
+of \meta{sublayout} will be parsed using the usual |graph| syntax, but will
+form a sublayout.
+%
\begin{codeexample}[]
\tikz \graph [spring layout] {
// [tree layout] { a -- {b, c} };
@@ -271,17 +266,16 @@ be parsed using the usual |graph| syntax, but will form a sublayout.
};
\end{codeexample}
-
-In the above example, there is no node before the double slash, which
-means that the two sublayouts will be part of the main graph, but will
-not be indicated otherwise.
-
-\begin{codeexample}[]
+In the above example, there is no node before the double slash, which means
+that the two sublayouts will be part of the main graph, but will not be
+indicated otherwise.
+%
+\begin{codeexample}[]
\tikz \graph [simple necklace layout] {
// [simple necklace layout] { a -> b -> c -> d -> e -> f -> a };
-
+
// [tree layout] { % first tentacle
- a -> {1, 2};
+ a -> {1, 2};
};
// [tree layout] {% second tentacle
@@ -290,24 +284,23 @@ not be indicated otherwise.
};
\end{codeexample}
-In the above example, the first sublayout is the one for the nodes
-with letter names. These nodes are arranged using a simple necklace layout
-as the sublayout inherits this option from the main layout. The two
-small trees (|a -> {1, 2}| and the tree starting at the |d| node)
-are also sublayouts, triggered by the |tree layout| option. They are
-also arranged. Then, all of the layouts are merged (as described
-later). The result is actually a single node, so the main layout
-does nothing here.
+In the above example, the first sublayout is the one for the nodes with letter
+names. These nodes are arranged using a simple necklace layout as the sublayout
+inherits this option from the main layout. The two small trees (|a -> {1, 2}|
+and the tree starting at the |d| node) are also sublayouts, triggered by the
+|tree layout| option. They are also arranged. Then, all of the layouts are
+merged (as described later). The result is actually a single node, so the main
+layout does nothing here.
Compare the above to the following code:
-
-\begin{codeexample}[]
+%
+\begin{codeexample}[]
\tikz \graph [simple necklace layout] {
// [tree layout] { % first ``giant node''
- a -> {1, 2};
+ a -> {1, 2};
};
-
- a -> b -> c -> d;
+
+ a -> b -> c -> d;
// [tree layout] {% second ``giant node''
d -> {3, 4 -> {5, 6}}
@@ -315,37 +308,35 @@ Compare the above to the following code:
d -> e -> f -> a;
};
-\end{codeexample}
+\end{codeexample}
-Here, only the two trees are laid out first. They are then
-contracted into ``giant nodes'' and these are then part of the set
-of nodes that are arranged by the |simple necklace layout|. For details of
-how this contracting works, see below.
+Here, only the two trees are laid out first. They are then contracted into
+``giant nodes'' and these are then part of the set of nodes that are arranged
+by the |simple necklace layout|. For details of how this contracting works, see
+below.
\subsubsection{Subgraph Nodes}
-A \emph{subgraph node} is a special kind of node that ``surrounds''
-the vertices of a subgraph. The special property of a subgraph node
-opposed to a normal node is that it is created only after the subgraph
-has been laid out. However, the difference to a collection like
-|hyper| is that the node is available immediately as a normal node in
-the sense that you can connect edges to it.
-
-The syntax used to declare a subgraph node in a |graph| specification
-is as follows:
+A \emph{subgraph node} is a special kind of node that ``surrounds'' the
+vertices of a subgraph. The special property of a subgraph node opposed to a
+normal node is that it is created only after the subgraph has been laid out.
+However, the difference to a collection like |hyper| is that the node is
+available immediately as a normal node in the sense that you can connect edges
+to it.
+The syntax used to declare a subgraph node in a |graph| specification is as
+follows:
+%
\begin{quote}
- \opt{|"|}\meta{node
- name}\opt{|"|}\opt{|/|\opt{|"|}\meta{text}\opt{|"|}}
- \opt{\oarg{node options}}
- |//| \opt{\oarg{layout options}} |{|\meta{subgraph}|}|
+ \opt{|"|}\meta{node name}\opt{|"|}\opt{|/|\opt{|"|}\meta{text}\opt{|"|}}
+ \opt{\oarg{node options}} |//| \opt{\oarg{layout options}} |{|\meta{subgraph}|}|
\end{quote}
-The idea ist that a subgraph node is declared like a normal node
-specification, but is followed by a double slash and a subgraph:
-
-\begin{codeexample}[width=5cm]
+The idea ist that a subgraph node is declared like a normal node specification,
+but is followed by a double slash and a subgraph:
+%
+\begin{codeexample}[width=5cm]
\tikz \graph [simple necklace layout] {
tree 1[draw, circle] // [tree layout] { a -> {1, 2}; }
-> b
@@ -355,191 +346,185 @@ specification, but is followed by a double slash and a subgraph:
-> f
-> tree 1;
};
-\end{codeexample}
-
-Note how the two subgraph nodes |tree 1| and |tree 2| surround the two
-smaller trees. In the example, both had trees as contents and these
-trees were rendered using a sublayout. However, a subgraph layout does
-not need to have its own layout: If you do \emph{not} provide a layout
-name after the double slash, the subgraph node will simply surround
-all nodes that were placed by the main layout wherever they were
-placed:
+\end{codeexample}
-\begin{codeexample}[]
+Note how the two subgraph nodes |tree 1| and |tree 2| surround the two smaller
+trees. In the example, both had trees as contents and these trees were rendered
+using a sublayout. However, a subgraph layout does not need to have its own
+layout: If you do \emph{not} provide a layout name after the double slash, the
+subgraph node will simply surround all nodes that were placed by the main
+layout wherever they were placed:
+%
+\begin{codeexample}[]
\tikz [subgraph text bottom=text centered,
subgraph nodes={font=\itshape}]
\graph [tree layout] {
a -> { b -> {c, d}, e -> {f, g -> h} };
-
+
left [draw] // { b, c, d };
right [draw] // { e, f, g, h};
-
+
left <-> right;
};
-\end{codeexample}
-
-
+\end{codeexample}
-Every time a subgraph node is created, the following style is execute:
+Every time a subgraph node is created, the following style is execute:
\begin{key}{/tikz/every subgraph node}
- Set a subgraph node style.
+ Set a subgraph node style.
\end{key}
\begin{key}{/tikz/subgraph nodes=\meta{style}}
- Sets the |every subgraph node| style to \meta{style}.
-\begin{codeexample}[]
+ Sets the |every subgraph node| style to \meta{style}.
+ %
+\begin{codeexample}[]
\tikz [subgraph text bottom=text centered,
subgraph nodes=red]
\graph [tree layout] {
a -> { b -> {c, d}, e -> {f, g -> h} };
-
+
left [draw] // { b, c, d };
right [draw] // { e, f, g, h};
-
+
left <-> right;
};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/subgraph text none}
- When this option is used, the text of a subgraph node is not
- shown. Adding a slash after the node name achieves roughly the same
- effect, but this option is useful in situations when subgraph nodes
- generally should not have any text inside them.
-\begin{codeexample}[]
+ When this option is used, the text of a subgraph node is not shown. Adding
+ a slash after the node name achieves roughly the same effect, but this
+ option is useful in situations when subgraph nodes generally should not
+ have any text inside them.
+ %
+\begin{codeexample}[]
\tikz [subgraph text none]
\graph [tree layout] {
a -> { b -> {c, d}, e -> {f, g -> h} };
-
+
left [draw] // { b, c, d };
right [draw] // { e, f, g, h};
-
+
left <-> right;
};
-\end{codeexample}
-
+\end{codeexample}
+ %
\end{key}
-\begin{key}{/tikz/subgraph text top=\meta{text alignment
- options} (default text ragged right)}
- Specifies that the text of a subgraph node should be placed at the
- top of the subgraph node: Still inside the node, but above all nodes
- inside the subgraph node.
-\begin{codeexample}[]
+\begin{key}{/tikz/subgraph text top=\meta{text alignment options} (default text ragged right)}
+ Specifies that the text of a subgraph node should be placed at the top of
+ the subgraph node: Still inside the node, but above all nodes inside the
+ subgraph node.
+ %
+\begin{codeexample}[]
\tikz [subgraph text top=text ragged left]
\graph [tree layout] {
a -> { b -> {c, d}, e -> {f, g -> h} };
-
+
left [draw] // { b, c, d };
right [draw] // { e, f, g, h};
-
+
left <-> right;
};
-\end{codeexample}
- You can pass any of the \meta{text alignment options} understood by
- \tikzname, such as |text centered|:
-\begin{codeexample}[width=5cm]
+\end{codeexample}
+ %
+ You can pass any of the \meta{text alignment options} understood by
+ \tikzname, such as |text centered|:
+ %
+\begin{codeexample}[width=5cm]
\tikz [subgraph text top=text centered]
\graph [tree layout] {
a -> { b -> {c, d}, e -> {f, g -> h} };
-
+
left [draw, circle] // { b, c, d };
};
-\end{codeexample}
- To place a label \emph{outside} the subgraph node, use a label,
- typically defined using the |quotes| library:
-\begin{codeexample}[]
+\end{codeexample}
+ %
+ To place a label \emph{outside} the subgraph node, use a label, typically
+ defined using the |quotes| library:
+ %
+\begin{codeexample}[]
\tikz \graph [tree layout] {
a -> { b -> {c, d}, e -> {f, g -> h} };
-
+
/ ["left", draw] // { b, c, d } <->
/ ["right", draw] // { e, f, g, h};
};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
-
-\begin{key}{/tikz/subgraph text bottom=\meta{text alignment
- options} (default ragged right)}
- Works like |subgraph text top|, only the text placed at the bottom.
+\begin{key}{/tikz/subgraph text bottom=\meta{text alignment options} (default ragged right)}
+ Works like |subgraph text top|, only the text placed at the bottom.
\end{key}
-Note that there are no keys |subgraph text left| or |... right|,
-for somewhat technical reasons.
+Note that there are no keys |subgraph text left| or |... right|, for somewhat
+technical reasons.
\begin{key}{/tikz/subgraph text sep=\meta{dimension} (initially .1em)}
- Some space added between the inner nodes of a subgraph node and the
- text labels.
+ Some space added between the inner nodes of a subgraph node and the text
+ labels.
\end{key}
\subsubsection{Overlapping Sublayouts}
-
\label{section-gd-layout-resolve}
-Nodes and edges can be part of several layouts. This
-will inevitably lead to conflicts because algorithm will disagree on
-where a node should be placed on the canvas. For this reason, there
-are some rules governing how such conflicts are resolved: Given a
-layout, starting with the main layout, the graph drawing system does
-the following:
-
-\begin{enumerate}
-\item We start by first processing the (direct) sublayouts of the
- current layout (recursively). Sublayouts may overlap (they may share
- one or more nodes), but we run the specified layout algorithm for
- each sublayout independently on a ``fresh copy'' of all the nodes
- making up the sublayout. In particular, different, conflicting
- positions may be computed for nodes when they are present in several
- sublayouts.
-\item Once all nodes in the sublayouts have been laid out in this way,
- we \emph{join} overlapping elements. The idea is that if two layouts
- share exactly one vertex, we can shift them around so that his
- vertex is at the same position in both layouts. In more detail, the
- following happens:
-
- We build a (conceptual) graph whose nodes are the sublayouts and in
- which there is an edge between two nodes if the sublayouts
- represented by these elements have a node in common.
- Inside the resulting graph, we treat each connected component
- separately. Each component has the property that the sublayouts
- represented by the nodes in the component overlap by at least one
- node. We now \emph{join} them as follows: We start with the first
- sublayout in the component (``first'' with respect to the order in
- which they appear in the input graph) and ``mark'' this
- sublayout. We loop the following instructions as long as possible:
- Search for the first sublayout (again, with respect to the order in
- which they appear in the input) that is connect by an edge to a
- marked sublayout. The sublayout will now have at least one node in
- common with the marked sublayouts (possibly, even more). We
- consider the first such node (again, first respect to the input
- ordering) and shift the whole sublayout is such a way that this
- particular node is at the position is has in the marked
- sublayouts. Note that after the shift, other nodes that are also
- present in the marked sublayouts may lie at a different position in
- the current sublayout. In this case, the position in the marked
- sublayouts ``wins.'' We then mark the sublayout.
-\item When the above algorithm has run, we will have computed
- positions for all nodes in all sublayouts of each of the
- components. For each component, we contract all
- nodes of the component to a single node. This new
- node will be ``large'' in the sense that its convex hull is the
- convex hull of all the nodes in the component. All nodes that used
- to be part of the component are removed and the new large node is
- added (with arcs adjusted appropriately).
-\item We now run the layout's algorithm on the resulting nodes
- (the remaining original nodes and the contracted nodes).
-\item In a last step, once the graph has been laid out, we expand the
- nodes that were previously contracted. For this, the
- nodes that were deleted earlier get reinserted, but shifted by
- whatever amount the contraction node got shifted.
+Nodes and edges can be part of several layouts. This will inevitably lead to
+conflicts because algorithm will disagree on where a node should be placed on
+the canvas. For this reason, there are some rules governing how such conflicts
+are resolved: Given a layout, starting with the main layout, the graph drawing
+system does the following:
+%
+\begin{enumerate}
+ \item We start by first processing the (direct) sublayouts of the current
+ layout (recursively). Sublayouts may overlap (they may share one or
+ more nodes), but we run the specified layout algorithm for each
+ sublayout independently on a ``fresh copy'' of all the nodes making up
+ the sublayout. In particular, different, conflicting positions may be
+ computed for nodes when they are present in several sublayouts.
+ \item Once all nodes in the sublayouts have been laid out in this way, we
+ \emph{join} overlapping elements. The idea is that if two layouts share
+ exactly one vertex, we can shift them around so that his vertex is at
+ the same position in both layouts. In more detail, the following
+ happens:
+
+ We build a (conceptual) graph whose nodes are the sublayouts and in
+ which there is an edge between two nodes if the sublayouts represented
+ by these elements have a node in common. Inside the resulting graph, we
+ treat each connected component separately. Each component has the
+ property that the sublayouts represented by the nodes in the component
+ overlap by at least one node. We now \emph{join} them as follows: We
+ start with the first sublayout in the component (``first'' with respect
+ to the order in which they appear in the input graph) and ``mark'' this
+ sublayout. We loop the following instructions as long as possible:
+ Search for the first sublayout (again, with respect to the order in
+ which they appear in the input) that is connect by an edge to a marked
+ sublayout. The sublayout will now have at least one node in common with
+ the marked sublayouts (possibly, even more). We consider the first such
+ node (again, first respect to the input ordering) and shift the whole
+ sublayout is such a way that this particular node is at the position is
+ has in the marked sublayouts. Note that after the shift, other nodes
+ that are also present in the marked sublayouts may lie at a different
+ position in the current sublayout. In this case, the position in the
+ marked sublayouts ``wins''. We then mark the sublayout.
+ \item When the above algorithm has run, we will have computed positions for
+ all nodes in all sublayouts of each of the components. For each
+ component, we contract all nodes of the component to a single node.
+ This new node will be ``large'' in the sense that its convex hull is
+ the convex hull of all the nodes in the component. All nodes that used
+ to be part of the component are removed and the new large node is added
+ (with arcs adjusted appropriately).
+ \item We now run the layout's algorithm on the resulting nodes (the
+ remaining original nodes and the contracted nodes).
+ \item In a last step, once the graph has been laid out, we expand the nodes
+ that were previously contracted. For this, the nodes that were deleted
+ earlier get reinserted, but shifted by whatever amount the contraction
+ node got shifted.
\end{enumerate}
\subsection{Miscellaneous Options}
\includeluadocumentationof{pgf.gd.control.library}
-
-\endinput
-
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 5a5a7b75957..a91cd43452b 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
@@ -10,304 +10,267 @@
\section{Guidelines on Graphics}
-The present section is not about \pgfname\ or \tikzname, but about
-general guidelines and principles concerning the creation of
-graphics for scientific presentations, papers, and books.
-
-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.
-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.
+The present section is not about \pgfname\ or \tikzname, but about general
+guidelines and principles concerning the creation of graphics for scientific
+presentations, papers, and books.
+
+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. 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.
The first thing you should ask yourself when someone presents a bunch of
-guidelines is: Should I really follow these guidelines? This is an
-important question, because there are good reasons not to follow
-general guidelines. The person who set up the guidelines may have had other
-objectives than you do. For example, a guideline might say ``use the
-color red for emphasis.'' While this guideline makes perfect sense
-for, say, a presentation using a projector, red ``color'' has the
-\emph{opposite} effect of ``emphasis'' when printed using a
-black-and-white printer. Guidelines were almost always set up to
-address a specific situation. If you are not in this situation,
-following a guideline can do more harm than good.
-
-The second thing you should be aware of is the basic rule of
-typography is: ``Every rule can be broken, as long as you are
-\emph{aware} that you are breaking a rule.'' This rule also applies
-to graphics. Phrased differently, the basic rule states: ``The only
-mistakes in typography are things done in ignorance.'' When you are
-aware of a rule and when you decide that breaking the rule has a
-desirable effect, break the rule.
+guidelines is: Should I really follow these guidelines? This is an important
+question, because there are good reasons not to follow general guidelines. The
+person who set up the guidelines may have had other objectives than you do. For
+example, a guideline might say ``use the color red for emphasis''. While this
+guideline makes perfect sense for, say, a presentation using a projector, red
+``color'' has the \emph{opposite} effect of ``emphasis'' when printed using a
+black-and-white printer. Guidelines were almost always set up to address a
+specific situation. If you are not in this situation, following a guideline can
+do more harm than good.
+
+The second thing you should be aware of is the basic rule of typography is:
+``Every rule can be broken, as long as you are \emph{aware} that you are
+breaking a rule.'' This rule also applies to graphics. Phrased differently, the
+basic rule states: ``The only mistakes in typography are things done in
+ignorance.'' When you are aware of a rule and when you decide that breaking the
+rule has a desirable effect, break the rule.
\subsection{Planning the Time Needed for the Creation of Graphics}
-When you create a paper with numerous graphics, the time needed to
-create these graphics becomes an important factor. How much time
-should you calculate for the creation of graphics?
-
-As a general rule, assume that a graphic will need as much time to
-create as would a text of the same length. For example, when I
-write a paper, I need about one hour per page for
-the first draft. Later, I need between two and four hours per page
-for revisions. Thus, I expect to need about half an hour for the
-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 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
-statistical software shows them. As will be argued later on, the
-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.
+When you create a paper with numerous graphics, the time needed to create these
+graphics becomes an important factor. How much time should you calculate for
+the creation of graphics?
+
+As a general rule, assume that a graphic will need as much time to create as
+would a text of the same length. For example, when I write a paper, I need
+about one hour per page for the first draft. Later, I need between two and four
+hours per page for revisions. Thus, I expect to need about half an hour for the
+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 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 statistical software shows them. As will be argued later on, the
+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.
+%
\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.
-\item
- Plan as much time for the creation and revision of a graphic as you
- would plan for text of the same size.
-\item
- Difficult graphics with a high information density may require even
- more time.
-\item
- 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.
+ \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.
+ \item Plan as much time for the creation and revision of a graphic as you
+ would plan for text of the same size.
+ \item Difficult graphics with a high information density may require even
+ more time.
+ \item 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.
\end{itemize}
\subsection{Workflow for Creating a Graphic}
-When you write a (scientific) paper, you will most likely follow the
-following pattern: You have some results/ideas that you would
-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
+When you write a (scientific) paper, you will most likely follow the following
+pattern: You have some results/ideas that you would 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
sentence that has survived unmodified from the first draft.
Creating a graphics follows the same pattern:
+%
\begin{itemize}
-\item
- Decide on what the graphic should communicate. Make this a conscious
- decision, that is, determine ``What is the graphic supposed to tell
- the reader?''
-\item
- Create an ``outline,'' that is, the rough overall ``shape'' of the
- graphic, containing the most crucial elements. Often, it is
- useful to do this using pencil and paper.
-\item
- Fill out the finer details of the graphic to create a first
- draft.
-\item
- Revise the graphic repeatedly along with the rest of the paper.
+ \item Decide on what the graphic should communicate. Make this a
+ conscious decision, that is, determine ``What is the graphic supposed
+ to tell the reader?''
+ \item Create an ``outline'', that is, the rough overall ``shape'' of the
+ graphic, containing the most crucial elements. Often, it is useful to
+ do this using pencil and paper.
+ \item Fill out the finer details of the graphic to create a first draft.
+ \item Revise the graphic repeatedly along with the rest of the paper.
\end{itemize}
-
-
\subsection{Linking Graphics With the Main Text}
-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 stand-alone ``figures.'' Since printers (the
-people) like to have their pages ``filled,'' (both for aesthetic and
-economic reasons) stand-alone figures may traditionally be placed on
-pages in the document far away from the main text that refers to
-them. \LaTeX\ and \TeX\ tend to encourage this ``drifting away'' of
-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
-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 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 stand-alone figures:
+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 stand-alone ``figures''. Since printers (the people) like to have
+their pages ``filled'', (both for aesthetic and economic reasons) stand-alone
+figures may traditionally be placed on pages in the document far away from the
+main text that refers to them. \LaTeX\ and \TeX\ tend to encourage this
+``drifting away'' of 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 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 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 stand-alone figures:
+%
\begin{itemize}
-\item
- 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
- stages of a quicksort algorithm. Then the figure's caption should,
- at the very least, inform the reader that ``The figure shows the
- different stages of the quicksort algorithm introduced on page
- xyz.'' and not just ``Quicksort algorithm.''
-\item
- A good caption adds as much context information as possible. For
- example, you could say: ``The figure shows the different stages of
- the quicksort algorithm introduced on page xyz. In the first line,
- the pivot element 5 is chosen. This causes\dots'' While this
- information can also be given in the main text, putting it in the
- caption will ensure that the context is kept. Do not feel afraid of
- a 5-line caption. (Your editor may hate you for this. Consider
- hating them back.)
-\item
- Reference the graphic in your main text as in ``For an example of
- quicksort `in action,' see Figure~2.1 on page xyz.''
-\item
- Most books on style and typography recommend that you do not use
- abbreviations as in ``Fig.~2.1'' but write ``Figure 2.1.''
-
- The main argument against abbreviations is that ``a period is too
- valuable to waste it on an abbreviation.'' The idea is that a period
- will make the reader assume that the sentence ends after ``Fig'' and
- it takes a ``conscious backtracking'' to realize that the sentence
- 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
- 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.
+ \item 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
+ stages of a quicksort algorithm. Then the figure's caption should, at
+ the very least, inform the reader that ``the figure shows the
+ different stages of the quicksort algorithm introduced on page xyz''.
+ and not just ``Quicksort algorithm''.
+ \item A good caption adds as much context information as possible. For
+ example, you could say: ``The figure shows the different stages of
+ the quicksort algorithm introduced on page xyz. In the first line,
+ the pivot element 5 is chosen. This causes\dots'' While this
+ information can also be given in the main text, putting it in the
+ caption will ensure that the context is kept. Do not feel afraid of a
+ 5-line caption. (Your editor may hate you for this. Consider hating
+ them back.)
+ \item Reference the graphic in your main text as in ``for an example of
+ quicksort `in action', see Figure~2.1 on page xyz''.
+ \item Most books on style and typography recommend that you do not use
+ abbreviations as in ``Fig.~2.1'' but write ``Figure~2.1''.
+
+ The main argument against abbreviations is that ``a period is too
+ valuable to waste it on an abbreviation''. The idea is that a period
+ will make the reader assume that the sentence ends after ``Fig'' and
+ it takes a ``conscious backtracking'' to realize that the sentence
+ 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
+ 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.
\end{itemize}
-
\subsection{Consistency Between Graphics and Text}
-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
-their text looks.
-
-It is quite common that authors use several different programs for
-creating the graphics of a paper. An author might produce some plots
-using \textsc{gnuplot}, a diagram using \textsc{xfig}, and include an
-|.eps| graphic a coauthor contributed using some unknown program. All
-these graphics will, most likely, use different line widths, different
-fonts, and have different sizes. In addition, authors often use
-options like |[height=5cm]| when including graphics to scale them to
-some ``nice size.''
-
-If the same approach were taken to writing the main text, every
-section would be written in a different font at a different size. In
-some sections all theorems would be underlined, in another they would
-be printed all in uppercase letters, and in another in red. In
-addition, the margins would be different on each page.
-Readers and editors would not tolerate a text if it were written in
+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 their text looks.
+
+It is quite common that authors use several different programs for creating the
+graphics of a paper. An author might produce some plots using \textsc{gnuplot},
+a diagram using \textsc{xfig}, and include an |.eps| graphic a coauthor
+contributed using some unknown program. All these graphics will, most likely,
+use different line widths, different fonts, and have different sizes. In
+addition, authors often use options like |[height=5cm]| when including graphics
+to scale them to some ``nice size''.
+
+If the same approach were taken to writing the main text, every section would
+be written in a different font at a different size. In some sections all
+theorems would be underlined, in another they would be printed all in uppercase
+letters, and in another in red. In addition, the margins would be different on
+each page. Readers and editors would not tolerate a text if it were written in
this fashion, but with graphics they often have to.
-To create consistency between graphics and text, stick to the
-following guidelines:
+To create consistency between graphics and text, stick to the following
+guidelines:
+%
\begin{itemize}
-\item
- Do not scale graphics.
-
- This means that when generating graphics using an external program,
- create them ``at the right size.''
-\item
- Use the same font(s) both in graphics and the body text.
-\item
- Use the same line width in text and graphics.
-
- The ``line width'' for normal text is the width of the stem of
- letters like T{}. For \TeX, this is usually
- $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
- 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
- headlines and section titles, use blue also for structural elements
- of your graphic.
-
- However, graphics may also use a logical intrinsic color
- coding. For example, no matter what colors you normally use, readers
- will generally assume, say, that the color green as ``positive, go,
- ok'' and red as ``alert, warning, action.''
+ \item Do not scale graphics.
+
+ This means that when generating graphics using an external program,
+ create them ``at the right size''.
+ \item Use the same font(s) both in graphics and the body text.
+ \item Use the same line width in text and graphics.
+
+ The ``line width'' for normal text is the width of the stem of letters
+ like T{}. For \TeX, this is usually $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
+ 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
+ headlines and section titles, use blue also for structural elements
+ of your graphic.
+
+ However, graphics may also use a logical intrinsic color
+ coding. For example, no matter what colors you normally use, readers
+ will generally assume, say, that the color green as ``positive, go,
+ ok'' and red as ``alert, warning, action''.
\end{itemize}
Creating consistency when using different graphic programs is almost
-impossible. For this reason, you should consider sticking to a single
-graphics program.
+impossible. For this reason, you should consider sticking to a single graphics
+program.
\subsection{Labels in Graphics}
-Almost all graphics will contain labels, that is, pieces of text that
-explain parts of the graphics. When placing labels, stick to the
-following guidelines:
-
+Almost all graphics will contain labels, that is, pieces of text that explain
+parts of the graphics. When placing labels, stick to the following guidelines:
+%
\begin{itemize}
-\item
- Follow the rule of consistency when placing labels. You should do
- so in two ways: First, be consistent with the main text, that is,
- use the same font as the main text also for labels. Second, be
- consistent between labels, that is, if you format some labels in
- some particular way, format all labels in this way.
-\item
- In addition to using the same fonts in text and graphics, you should
- also use the same notation. For example, if you write $1/2$ in your
- 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''.
-\item
- Labels should be legible. They should not only have a reasonably
- large size, they also should not be obscured by lines or other
- text. This also applies to labels of lines and text \emph{behind} the
- labels.
-\item
- Labels should be ``in place.'' Whenever there is enough space,
- labels should be placed next to the thing they label. Only if
- 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.
-\item
- Consider subduing ``unimportant'' labels using, for example, a gray
- color. This will keep the focus on the actual graphic.
+ \item Follow the rule of consistency when placing labels. You should do
+ so in two ways: First, be consistent with the main text, that is, use
+ the same font as the main text also for labels. Second, be consistent
+ between labels, that is, if you format some labels in some particular
+ way, format all labels in this way.
+ \item In addition to using the same fonts in text and graphics, you
+ should also use the same notation. For example, if you write $1/2$ in
+ your 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''.
+ \item Labels should be legible. They should not only have a reasonably
+ large size, they also should not be obscured by lines or other text.
+ This also applies to labels of lines and text \emph{behind} the
+ labels.
+ \item Labels should be ``in place''. Whenever there is enough space,
+ labels should be placed next to the thing they label. Only if
+ 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.
+ \item Consider subduing ``unimportant'' labels using, for example, a gray
+ color. This will keep the focus on the actual graphic.
\end{itemize}
-
\subsection{Plots and Charts}
-One of the most frequent kind of graphics, especially in scientific
-papers, are \emph{plots}. They come in a large variety, including
-simple line plots, parametric plots, three dimensional plots, pie
-charts, and many more.
+One of the most frequent kind of graphics, especially in scientific papers, are
+\emph{plots}. They come in a large variety, including simple line plots,
+parametric plots, three dimensional plots, pie charts, and many more.
-Unfortunately, plots are notoriously hard to get right. Partly, the
-default settings of programs like \textsc{gnuplot} or Excel are to
-blame for this since these programs make it very convenient to create
-bad plots.
+Unfortunately, plots are notoriously hard to get right. Partly, the default
+settings of programs like \textsc{gnuplot} or Excel are to blame for this since
+these programs make it very convenient to create 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.
+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.
-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
-that the seminar was ``very bad.''
+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 that the seminar was ``very bad''.
A simple way of summing up this information is the following table:
@@ -324,10 +287,9 @@ A simple way of summing up this information is the following table:
\end{tabular}
\bigskip
-What the lecturer did was to visualize the data using a 3D bar
-diagram. It looked like this (except that in reality the numbers
-where typeset using some extremely low-resolution bitmap font and
-were near-unreadable):
+What the lecturer did was to visualize the data using a 3D bar diagram. It
+looked like this (except that in reality the numbers where typeset using some
+extremely low-resolution bitmap font and were near-unreadable):
\bigskip
\par
@@ -353,72 +315,58 @@ were near-unreadable):
\end{tikzpicture}
\bigskip
-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:
+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:
+%
\begin{enumerate}
-\item
- How many participants where there?
-\item
- How many participants returned the feedback form?
-\item
- What percentage of the participants returned the feedback form?
-\item
- How many participants checked ``very good''?
-\item
- What percentage out of all participants checked ``very good''?
-\item
- Did more than a quarter of the participants check ``bad'' or ``very bad''?
-\item
- What percentage of the participants that returned the form checked ``very good''?
+ \item How many participants where there?
+ \item How many participants returned the feedback form?
+ \item What percentage of the participants returned the feedback form?
+ \item How many participants checked ``very good''?
+ \item What percentage out of all participants checked ``very good''?
+ \item Did more than a quarter of the participants check ``bad'' or ``very
+ bad''?
+ \item What percentage of the participants that returned the form checked
+ ``very good''?
\end{enumerate}
Sadly, the graphic does not allow us to answer \emph{a single one of these
- questions}. The table answers all of them directly, except for the last
-one. In essence, the information density of the graphic is very
-close to zero. The table has a much higher information density; despite
-the fact that it uses quite a lot of white space to present a few numbers.
-Here is the list of things that went wrong with the 3D-bar diagram:
+questions}. The table answers all of them directly, except for the last one. In
+essence, the information density of the graphic is very close to zero. The
+table has a much higher information density; despite the fact that it uses
+quite a lot of white space to present a few numbers. Here is the list of things
+that went wrong with the 3D-bar diagram:
+%
\begin{itemize}
-\item
- The whole graphic is dominated by irritating background lines.
-\item
- It is not clear what the numbers at the left mean; presumably
- percentages, but it might also be the absolute number of
- participants.
-\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
- low resolution with about 10 by 6 pixels per letter with wrong
- kerning, making the rotated text almost impossible to read.)
-\item
- The third dimension adds complexity to the graphic without adding
- information.
-\item
- The three dimensional setup makes it much harder to gauge the height
- of the bars correctly. Consider the ``bad'' bar. It the number this
- bar stands for more than 20 or less? While the front of the bar is
- below the 20 line, the back of the bar (which counts) is above.
-\item
- It is impossible to tell which numbers are represented by the
- bars. Thus, the bars needlessly hide the information these bars are
- all about.
-\item
- What do the bar heights add up to? Is it 100\% or 60\%?
-\item
- Does the bar for ``very bad'' represent 0 or~1?
-\item
- Why are the bars blue?
+ \item The whole graphic is dominated by irritating background lines.
+ \item It is not clear what the numbers at the left mean; presumably
+ percentages, but it might also be the absolute number of
+ participants.
+ \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
+ low resolution with about 10 by 6 pixels per letter with wrong
+ kerning, making the rotated text almost impossible to read.)
+ \item The third dimension adds complexity to the graphic without adding
+ information.
+ \item The three dimensional setup makes it much harder to gauge the
+ height of the bars correctly. Consider the ``bad'' bar. It the number
+ this bar stands for more than 20 or less? While the front of the bar
+ is below the 20 line, the back of the bar (which counts) is above.
+ \item It is impossible to tell which numbers are represented by the
+ bars. Thus, the bars needlessly hide the information these bars are
+ all about.
+ \item What do the bar heights add up to? Is it 100\% or 60\%?
+ \item Does the bar for ``very bad'' represent 0 or~1?
+ \item Why are the bars blue?
\end{itemize}
-You might argue that in the example the exact numbers are not
-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:
+You might argue that in the example the exact numbers are not 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:
\medskip
\par
@@ -455,15 +403,14 @@ clearly:
\end{tikzpicture}
\bigskip
-The above graphic has about the same information density as the table
-(about the same size and the same numbers are shown). In addition, one
-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.
+The above graphic has about the same information density as the table (about
+the same size and the same numbers are shown). In addition, one 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.
-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:
+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:
\bigskip
\par
@@ -557,168 +504,148 @@ that I redrew from a pie chart in \emph{Die Zeit}, June 4th, 2005:
\end{scope}
\end{tikzpicture}
-This graphic has been redrawn in \tikzname, but the original looks
-almost exactly the same.
-
-At first sight, the graphic looks ``nice and informative,'' but there
-are a lot of things that went wrong:
+This graphic has been redrawn in \tikzname, but the original looks almost
+exactly the same.
+At first sight, the graphic looks ``nice and informative'', but there are a lot
+of things that went wrong:
+%
\begin{itemize}
-\item
- The chart is three dimensional. However, the shadings add
- nothing ``information-wise,'' at best, they distract.
-\item
- In a 3D-pie-chart the relative sizes are very strongly
- distorted. For example, the area taken up by the gray color of ``Braunkohle''
- is larger than the area taken up by the green color of
- ``Kernenergie'' \emph{despite the fact that the percentage of
- 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.''
- 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
- Mineral\"olprodukte.}
-
- In the last case, the different sizes are only partly due to
- 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.)
-\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.
-
- Coal as an energy source is split up into two slices: one for
- ``Steinkohle'' and one for ``Braunkohle'' (two different kinds of
- coal). When you add them up, you see that the whole lower half of
- the pie chart is taken up by coal.
-
- The two areas for the different kinds of coal are not visually
- linked at all. Rather, two different colors are used, the labels are
- on different sides of the graphic. By comparison, ``Regenerative''
- and ``Wind'' are very closely linked.
-\item
- The color coding of the graphic follows no logical pattern at
- all. Why is nuclear energy green? Regenerative energy is light blue,
- ``other sources'' are blue. It seems more like a joke that the area
- for ``Braunkohle'' (which literally translates to ``brown coal'') is
- stone gray, while the area for ``Steinkohle'' (which literally
- translates to ``stone coal'') is brown.
-\item
- The area with the lightest color is used for ``Erdgas.'' This area
- stands out most because of the brighter color. However, for this
- chart ``Erdgas'' is not really important at all.
+ \item The chart is three dimensional. However, the shadings add nothing
+ ``information-wise'', at best, they distract.
+ \item In a 3D-pie-chart the relative sizes are very strongly distorted.
+ For example, the area taken up by the gray color of ``Braunkohle'' is
+ larger than the area taken up by the green color of ``Kernenergie''
+ \emph{despite the fact that the percentage of 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''. 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
+ Mineral\"olprodukte.}
+
+ In the last case, the different sizes are only partly due to
+ 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.)
+ \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.
+
+ Coal as an energy source is split up into two slices: one for
+ ``Steinkohle'' and one for ``Braunkohle'' (two different kinds of
+ coal). When you add them up, you see that the whole lower half of
+ the pie chart is taken up by coal.
+
+ The two areas for the different kinds of coal are not visually
+ linked at all. Rather, two different colors are used, the labels are
+ on different sides of the graphic. By comparison, ``Regenerative''
+ and ``Wind'' are very closely linked.
+ \item The color coding of the graphic follows no logical pattern at all.
+ Why is nuclear energy green? Regenerative energy is light blue,
+ ``other sources'' are blue. It seems more like a joke that the area
+ for ``Braunkohle'' (which literally translates to ``brown coal'') is
+ stone gray, while the area for ``Steinkohle'' (which literally
+ translates to ``stone coal'') is brown.
+ \item The area with the lightest color is used for ``Erdgas''. This area
+ stands out most because of the brighter color. However, for this
+ chart ``Erdgas'' is not really important at all.
\end{itemize}
-Edward Tufte calls graphics like the above ``chart junk.'' (I am happy
-to announce, however, that \emph{Die Zeit} has stopped using 3D pie
-charts and their information graphics have got somewhat better.)
+%
+Edward Tufte calls graphics like the above ``chart junk''. (I am happy to
+announce, however, that \emph{Die Zeit} has stopped using 3D pie charts and
+their information graphics have got somewhat better.)
Here are a few recommendations that may help you avoid producing chart junk:
+%
\begin{itemize}
-\item
- Do not use 3D pie charts. They are \emph{evil}.
-\item
- Consider using a table instead of a pie chart.
-\item
- 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
- lines, instead of colors. They distract. Background patterns in
- information graphics are \emph{evil}.
+ \item Do not use 3D pie charts. They are \emph{evil}.
+ \item Consider using a table instead of a pie chart.
+ \item 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
+ lines, instead of colors. They distract. Background patterns in
+ information graphics are \emph{evil}.
\end{itemize}
-
\subsection{Attention and Distraction}
-Pick up your favorite fiction novel and have a look at a typical
-page. You will notice that the page is very uniform. Nothing is there
-to distract the reader while reading; no large headlines, no bold
-text, no large white areas. Indeed, even when the author does wish to
-emphasize something, this is done using italic letters. Such letters
-blend nicely with the main text---at a distance you will not be able to
-tell whether a page contains italic letters, but you would notice a
-single bold word immediately. The reason novels are typeset this way
-is the following paradigm: Avoid distractions.
-
-Good typography (like good organization) is something you do
-\emph{not} notice. The job of typography is to make reading the text,
-that is, ``absorbing'' its information content, as effortless as
-possible. For a novel, readers absorb the content by reading the text
-line-by-line, as if they were listening to someone telling the
-story. In this situation anything on the page that distracts the eye
-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
-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
-pictures. The reason magazines are typeset in this way is another
-paradigm: Steer attention.
-
-Readers will not read a magazine like a novel. Instead of reading a
-magazine line-by-line, we use headlines and short abstracts to check
-whether we want to read a certain article or not. The job of
-typography is to steer our attention to these abstracts and headlines,
-first. Once we have decided that we want to read an article, however,
-we no longer tolerate distractions, which is why the main text of
-articles is typeset exactly the same way as a novel.
-
-The two principles ``avoid distractions'' and ``steer attention'' also
-apply to graphics. When you design a graphic, you should eliminate
-everything that will ``distract the eye.'' At the same time, you
-should try to actively help the reader ``through the graphic'' by
-using fonts/colors/line widths to highlight different parts.
+Pick up your favorite fiction novel and have a look at a typical page. You will
+notice that the page is very uniform. Nothing is there to distract the reader
+while reading; no large headlines, no bold text, no large white areas. Indeed,
+even when the author does wish to emphasize something, this is done using
+italic letters. Such letters blend nicely with the main text -- at a distance
+you will not be able to tell whether a page contains italic letters, but you
+would notice a single bold word immediately. The reason novels are typeset this
+way is the following paradigm: Avoid distractions.
+
+Good typography (like good organization) is something you do \emph{not} notice.
+The job of typography is to make reading the text, that is, ``absorbing'' its
+information content, as effortless as possible. For a novel, readers absorb the
+content by reading the text line-by-line, as if they were listening to someone
+telling the story. In this situation anything on the page that distracts the
+eye 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 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 pictures. The reason
+magazines are typeset in this way is another paradigm: Steer attention.
+
+Readers will not read a magazine like a novel. Instead of reading a magazine
+line-by-line, we use headlines and short abstracts to check whether we want to
+read a certain article or not. The job of typography is to steer our attention
+to these abstracts and headlines, first. Once we have decided that we want to
+read an article, however, we no longer tolerate distractions, which is why the
+main text of articles is typeset exactly the same way as a novel.
+
+The two principles ``avoid distractions'' and ``steer attention'' also apply to
+graphics. When you design a graphic, you should eliminate everything that will
+``distract the eye''. At the same time, you should try to actively help the
+reader ``through the graphic'' by using fonts/colors/line widths to highlight
+different parts.
Here is a non-exhaustive list of things that can distract readers:
+%
\begin{itemize}
-\item
- Strong contrasts will always be registered first by the eye. For
- example, consider the following two grids:
-
- \medskip\par
- \begin{tikzpicture}[x=40pt,y=40pt]
- \draw[step=10pt,gray] (0,0) grid +(1,1);
- \draw[step=2pt] (2,0) grid +(1,1);
- \end{tikzpicture}
-
- \medskip
- Even though the left grid comes first in English reading order,
- the right one is much more likely to be seen first: The
- white-to-black contrast is higher than the gray-to-white
- contrast. In addition, there are more ``places'' adding to the
- overall contrast in the right grid.
-
- Things like grids and, more generally, help lines usually should not
- grab the attention of the readers and, hence, should be typeset with
- a low contrast to the background. Also, a loosely-spaced grid is
- less distracting than a very closely-spaced grid.
-\item
- Dashed lines create many points at which there is black-to-white
- contrast. Dashed or dotted lines can be very distracting and, hence,
- should be avoided in general.
-
- Do not use different dashing patterns to differentiate curves in
- plots. You lose data points this way and the eye is not
- particularly good at ``grouping things according to a dashing
- pattern.'' The eye is \emph{much} better at grouping things
- according to colors.
-\item
- Background patterns filling an area using diagonal lines or
- horizontal and vertical lines or just dots are almost always
- distracting and, usually, serve no real purpose.
-\item
- Background images and shadings distract and only seldomly add
- anything of importance to a graphic.
-\item
- Cute little clip arts can easily draw attention away from the
- data.
+ \item Strong contrasts will always be registered first by the eye. For
+ example, consider the following two grids:
+
+ \medskip\par
+ \begin{tikzpicture}[x=40pt,y=40pt]
+ \draw[step=10pt,gray] (0,0) grid +(1,1);
+ \draw[step=2pt] (2,0) grid +(1,1);
+ \end{tikzpicture}
+
+ \medskip
+ Even though the left grid comes first in English reading order, the
+ right one is much more likely to be seen first: The white-to-black
+ contrast is higher than the gray-to-white contrast. In addition,
+ there are more ``places'' adding to the overall contrast in the right
+ grid.
+
+ Things like grids and, more generally, help lines usually should not
+ grab the attention of the readers and, hence, should be typeset with
+ a low contrast to the background. Also, a loosely-spaced grid is less
+ distracting than a very closely-spaced grid.
+ \item Dashed lines create many points at which there is black-to-white
+ contrast. Dashed or dotted lines can be very distracting and, hence,
+ should be avoided in general.
+
+ Do not use different dashing patterns to differentiate curves in
+ plots. You lose data points this way and the eye is not particularly
+ good at ``grouping things according to a dashing pattern''. The eye
+ is \emph{much} better at grouping things according to colors.
+ \item Background patterns filling an area using diagonal lines or
+ horizontal and vertical lines or just dots are almost always
+ distracting and, usually, serve no real purpose.
+ \item Background images and shadings distract and only seldomly add
+ anything of importance to a graphic.
+ \item 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 af964feedac..a80222fa91f 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
@@ -7,185 +7,165 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Installation}
-There are different ways of installing \pgfname, depending
-on your system and needs, and you may need to install other
-packages as well, see below. Before installing, you may wish to
-review the licenses under which the package is
+There are different ways of installing \pgfname, depending on your system and
+needs, and you may need to install other packages as well, see below. Before
+installing, you may wish to review the licenses under which the package is
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.
+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.
\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
-\TeX\ installation. When using \LaTeX, you need the following packages
-installed (newer versions should also work):
+This documentation is part of version \pgfversion\ of the \pgfname\ 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}
-\item
- |xcolor| version \xcolorversion.
+ \item |xcolor| version \xcolorversion.
\end{itemize}
-With plain \TeX, |xcolor| is not needed, but you obviously do not
-get its (full) functionality.
+%
+With plain \TeX, |xcolor| is not needed, but you obviously do not get its
+(full) functionality.
Currently, \pgfname\ supports the following backend drivers:
+%
\begin{itemize}
-\item
- |luatex| version 0.76 or higher. Most earlier versions also work.
-\item
- |pdftex| version 0.14 or higher. Earlier versions do not work.
-\item
- |dvips| version 5.94a or higher. Earlier versions may also work.
-
- For inter-picture connections, you need to process pictures using
- |pdftex| version 1.40 or higher running in DVI mode.
-\item
- |dvipdfm| version 0.13.2c or higher. Earlier versions may also work.
-
- For inter-picture connections, you need to process pictures using
- |pdftex| version 1.40 or higher running in DVI mode.
-\item
- |dvipdfmx| version 0.13.2c or higher. Earlier versions may also work.
-\item
- |dvisvgm| version 1.2.2 or higher. Earlier versions may also work.
-\item
- |tex4ht| version 2003-05-05 or higher. Earlier versions may also work.
-\item
- |vtex| version 8.46a or higher. Earlier versions may also work.
-\item
- |textures| version 2.1 or higher. Earlier versions may also work.
-\item
- |xetex| version 0.996 or higher. Earlier versions may also work.
+ \item |luatex| version 0.76 or higher. Most earlier versions also work.
+ \item |pdftex| version 0.14 or higher. Earlier versions do not work.
+ \item |dvips| version 5.94a or higher. Earlier versions may also work.
+
+ For inter-picture connections, you need to process pictures using
+ |pdftex| version 1.40 or higher running in DVI mode.
+ \item |dvipdfm| version 0.13.2c or higher. Earlier versions may also
+ work.
+
+ For inter-picture connections, you need to process pictures using
+ |pdftex| version 1.40 or higher running in DVI mode.
+ \item |dvipdfmx| version 0.13.2c or higher. Earlier versions may also
+ work.
+ \item |dvisvgm| version 1.2.2 or higher. Earlier versions may also work.
+ \item |tex4ht| version 2003-05-05 or higher. Earlier versions may also
+ work.
+ \item |vtex| version 8.46a or higher. Earlier versions may also work.
+ \item |textures| version 2.1 or higher. Earlier versions may also work.
+ \item |xetex| version 0.996 or higher. Earlier versions may also work.
\end{itemize}
Currently, \pgfname\ supports the following formats:
+%
\begin{itemize}
-\item
- |latex| with complete functionality.
-\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 |latex| with complete functionality.
+ \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.
\end{itemize}
For more details, see Section~\ref{section-formats}.
-
\subsection{Installing Prebundled Packages}
-I do not create or manage prebundled packages of \pgfname, but,
-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.
+I do not create or manage prebundled packages of \pgfname, but, 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.
\subsubsection{Debian}
-The command ``|aptitude install pgf|'' should do the trick. Sit back
-and relax.
-
-\subsubsection{MiKTeX}
+The command ``|aptitude install pgf|'' should do the trick. Sit back and relax.
-For MiK\TeX, use the update wizard to install the (latest versions of
-the) packages called |pgf| and |xcolor|.
+\subsubsection{MiKTeX}
+For MiK\TeX, use the update wizard to install the (latest versions of the)
+packages called |pgf| and |xcolor|.
\subsection{Installation in a texmf Tree}
-For a permanent installation, you place the files of
-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
-are simply huge directories that contain these files. By default,
-\TeX\ looks for files in three different |texmf| trees:
+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 are simply huge
+directories that contain these files. By default, \TeX\ looks for files in
+three different |texmf| trees:
+%
\begin{itemize}
-\item
- The root |texmf| tree, which is usually located at
- |/usr/share/texmf/| or |c:\texmf\| or somewhere similar.
-\item
- The local |texmf| tree, which is usually located at
- |/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/|.
+ \item The root |texmf| tree, which is usually located at
+ |/usr/share/texmf/| or |c:\texmf\| or somewhere similar.
+ \item The local |texmf| tree, which is usually located at
+ |/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/|.
\end{itemize}
-You should install the packages either in the local tree or in
-your personal tree, depending on whether you have write access to the
-local tree. Installation in the root tree can cause problems, since an
-update of the whole \TeX\ installation will replace this whole tree.
+You should install the packages either in the local tree or in your personal
+tree, depending on whether you have write access to the local tree.
+Installation in the root tree can cause problems, since an update of the whole
+\TeX\ installation will replace this whole tree.
\subsubsection{Installation that Keeps Everything Together}
-Once you have located the right texmf tree, you must decide whether
-you want to install \pgfname\ in such a way that ``all its files are
-kept in one place'' or whether you want to be
-``\textsc{tds}-compliant,'' where \textsc{tds} means ``\TeX\ directory
-structure.''
+Once you have located the right texmf tree, you must decide whether you want to
+install \pgfname\ in such a way that ``all its files are kept in one place'' or
+whether you want to be ``\textsc{tds}-compliant'', where \textsc{tds} means
+``\TeX\ directory structure''.
-If you want to keep ``everything in one place,'' inside the |texmf|
-tree that you have chosen create a sub-sub-directory called
-|texmf/tex/generic/pgf| or
-|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.
+If you want to keep ``everything in one place'', inside the |texmf| tree that
+you have chosen create a sub-sub-directory called |texmf/tex/generic/pgf| or
+|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.
\subsubsection{Installation that is TDS-Compliant}
-While the above installation process is the most ``natural'' one and
-although I would like to recommend it since it makes updating and
-managing the \pgfname\ package easy, it is not
-\textsc{tds}-compliant. If you want to be \textsc{tds}-compliant,
-proceed as follows: (If you do not know what \textsc{tds}-compliant
-means, you probably do not want to be \textsc{tds}-compliant.)
+While the above installation process is the most ``natural'' one and although I
+would like to recommend it since it makes updating and managing the \pgfname\
+package easy, it is not \textsc{tds}-compliant. If you want to be
+\textsc{tds}-compliant, proceed as follows: (If you do not know what
+\textsc{tds}-compliant means, you probably do not want to be
+\textsc{tds}-compliant.)
The |.tar| file of the |pgf| package contains the following files and
-directories at its root: |README|, |doc|, |generic|, |plain|, and
-|latex|. You should ``merge'' each of the four directories with the
-following directories |texmf/doc|, |texmf/tex/generic|,
-|texmf/tex/plain|, and |texmf/tex/latex|. For example, in the |.tar|
-file the |doc| directory contains just the directory |pgf|, and this
-directory has to be moved to |texmf/doc/pgf|. The root |README| file
-can be ignored since it is reproduced in |doc/pgf/README|.
-
-You may also consider keeping everything in one place and using
-symbolic links to point from the \textsc{tds}-compliant directories to
-the central installation.
-
-\vskip1em
-For a more detailed explanation of the standard installation process
+directories at its root: |README|, |doc|, |generic|, |plain|, and |latex|. You
+should ``merge'' each of the four directories with the following directories
+|texmf/doc|, |texmf/tex/generic|, |texmf/tex/plain|, and |texmf/tex/latex|. For
+example, in the |.tar| file the |doc| directory contains just the directory
+|pgf|, and this directory has to be moved to |texmf/doc/pgf|. The root |README|
+file can be ignored since it is reproduced in |doc/pgf/README|.
+
+You may also consider keeping everything in one place and using symbolic links
+to point from the \textsc{tds}-compliant directories to the central
+installation.
+
+\vskip1em For a more detailed explanation of the standard installation process
of packages, you might wish to consult
\href{http://www.ctan.org/installationadvice/}{|http://www.ctan.org/installationadvice/|}.
-However, note that the \pgfname\ package does not come with a
-|.ins| file (simply skip that part).
+However, note that the \pgfname\ package does not come with a |.ins| file
+(simply skip that part).
\subsection{Updating the Installation}
-To update your installation from a previous version, all you need to
-do is to replace everything in the directory |texmf/tex/generic/pgf|
-with the files of the new version (or in all the directories where
-|pgf| was installed, if you chose a \textsc{tds}-compliant
-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 commands 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.
+To update your installation from a previous version, all you need to do is to
+replace everything in the directory |texmf/tex/generic/pgf| with the files of
+the new version (or in all the directories where |pgf| was installed, if you
+chose a \textsc{tds}-compliant 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 commands 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.
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 ece53e719e6..42493010673 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
@@ -10,280 +10,251 @@
\section{Introduction}
-Welcome to the documentation of \tikzname\ and the underlying
-\pgfname\ system. What began as a small La\TeX\ style for creating the
-graphics in my (Till Tantau's) PhD thesis directly with pdf\LaTeX\ has now
-grown to become a full-flung graphics language with a manual of over a
-thousand pages. The wealth of options offered by \tikzname\ is often
-daunting to beginners; but fortunately this documentation comes with a
-number slowly-paced tutorials that will teach you almost all you
-should know about \tikzname\ without your having to read the rest.
-
-I wish to start with the questions ``What is \tikzname?''
-Basically, it just 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
-|\tikz \fill[orange] (1ex,1ex) circle (1ex);| yields \tikz
-\fill[orange] (1ex,1ex) circle (1ex);. In a sense, when you use
-\tikzname\ you ``program'' your graphics, just as you ``program'' your
-document when you use \TeX. This also explains the name: \tikzname\
-is a recursive accronym in the tradition of ``\textsc{gnu} is not
-unix'' and means ``\tikzname\ ist \emph{kein} Zeichenprogramm,'' which
-translates to ``\tikzname\ is not a drawing program,'' cautioning the
-reader as to what to expect. With \tikzname\ 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.
-
-Now that we know what \tikzname\ is, what about ``\pgfname''?
-As mentioned earlier, \tikzname\ started out as a project to implement
-\TeX\ graphics macros that can be used both with pdf\LaTeX\ and also
-with the classical (PostScript-based) \LaTeX. In other words, I wanted
-to implement a ``portable graphics format'' for \TeX\ -- hence the
-name \pgfname. These early macros are still around and they form the
-``basic layer'' of the system described in this manual, but most of
-the interaction an author has theses days is with \tikzname\ -- which
-has become a whole language of its own.
+Welcome to the documentation of \tikzname\ and the underlying \pgfname\ system.
+What began as a small \LaTeX\ style for creating the graphics in my (Till
+Tantau's) PhD thesis directly with pdf\LaTeX\ has now grown to become a
+full-flung graphics language with a manual of over a thousand pages. The wealth
+of options offered by \tikzname\ is often daunting to beginners; but
+fortunately this documentation comes with a number slowly-paced tutorials that
+will teach you almost all you should know about \tikzname\ without your having
+to read the rest.
+
+I wish to start with the questions ``What is \tikzname?'' Basically, it just
+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 |\tikz \fill[orange] (1ex,1ex) circle (1ex);| yields
+\tikz \fill[orange] (1ex,1ex) circle (1ex);. In a sense, when you use
+\tikzname\ you ``program'' your graphics, just as you ``program'' your document
+when you use \TeX. This also explains the name: \tikzname\ is a recursive
+acronym in the tradition of ``\textsc{gnu} is not unix'' and means ``\tikzname\
+ist \emph{kein} Zeichenprogramm'', which translates to ``\tikzname\ is not a
+drawing program'', cautioning the reader as to what to expect. With \tikzname\
+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.
+
+Now that we know what \tikzname\ is, what about ``\pgfname''? As mentioned
+earlier, \tikzname\ started out as a project to implement \TeX\ graphics macros
+that can be used both with pdf\LaTeX\ and also with the classical
+(PostScript-based) \LaTeX. In other words, I wanted to implement a ``portable
+graphics format'' for \TeX\ -- hence the name \pgfname. These early macros are
+still around and they form the ``basic layer'' of the system described in this
+manual, but most of the interaction an author has theses days is with
+\tikzname\ -- which has become a whole language of its own.
\subsection{The Layers Below \tikzname}
It turns out that there are actually \emph{two} layers below \tikzname:
-
+%
\begin{description}
-\item[System layer:] This layer provides a complete abstraction of what is
- going on ``in the driver.'' The driver is a program like |dvips| or
- |dvipdfm| that takes a |.dvi| file as input and generates a |.ps| or
- a |.pdf| file. (The |pdftex| program also counts as a driver, even
- though it does not take a |.dvi| file as input. Never mind.) Each
- driver has its own syntax for the generation of graphics, causing
- headaches to everyone who wants to create graphics in a portable
- way. \pgfname's system layer ``abstracts away'' these
- 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|,
- |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
- additional command makes it more work to port \pgfname\ to a new
- driver.
-
- As a user, you will not use the system layer directly.
-\item[Basic layer:]
- The basic layer provides a set of basic commands that allow
- you to produce complex graphics in a much easier manner than by using
- the system layer directly. For example, the system layer provides
- no commands for creating circles since circles can be composed from
- the more basic B\'ezier curves (well, almost). However, as a user you
- will want to have a simple command to create circles
- (at least I do) instead of having to write down half a page of
- B\'ezier curve support coordinates. Thus, the basic layer provides a
- command |\pgfpathcircle| that generates the necessary curve
- coordinates for you.
-
- The basic layer consists of a \emph{core}, which consists of
- several interdependent packages that can only be loaded \emph{en
- bloc,} and additional \emph{modules} that extend the core by more
- special-purpose commands like node management or a plotting
- interface. For instance, the \textsc{beamer} package uses only the
- core and not, say, the |shapes| modules.
-\end{description}
-
-In theory, \tikzname itself is just one of several possible
-``frontends,'' which are sets of commands or a special syntax that
-makes using the basic layer easier. A problem with directly using the
-basic layer is that code written for this layer is often too
-``verbose.'' For example, to draw a simple
-triangle, you may need as many as five commands when using the basic
-layer: One for beginning a path at the first corner of the triangle,
-one for extending the path to the second corner, one for going to
-the third, one for closing the path, and one for actually painting
-the triangle (as opposed to filling it). With the \tikzname\ frontend
-all this boils down to a single simple \textsc{metafont}-like
-command:
+ \item[System layer:] This layer provides a complete abstraction of what
+ is going on ``in the driver''. The driver is a program like |dvips|
+ or |dvipdfm| that takes a |.dvi| file as input and generates a |.ps|
+ or a |.pdf| file. (The |pdftex| program also counts as a driver, even
+ though it does not take a |.dvi| file as input. Never mind.) Each
+ driver has its own syntax for the generation of graphics, causing
+ headaches to everyone who wants to create graphics in a portable way.
+ \pgfname's system layer ``abstracts away'' these 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|, |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 additional command makes it
+ more work to port \pgfname\ to a new driver.
+
+ As a user, you will not use the system layer directly.
+ \item[Basic layer:] The basic layer provides a set of basic commands that
+ allow you to produce complex graphics in a much easier manner than by
+ using the system layer directly. For example, the system layer provides
+ no commands for creating circles since circles can be composed from the
+ more basic Bézier curves (well, almost). However, as a user you will
+ want to have a simple command to create circles (at least I do) instead
+ of having to write down half a page of Bézier curve support
+ coordinates. Thus, the basic layer provides a command |\pgfpathcircle|
+ that generates the necessary curve coordinates for you.
+
+ The basic layer consists of a \emph{core}, which consists of several
+ interdependent packages that can only be loaded \emph{en bloc}, and
+ additional \emph{modules} that extend the core by more
+ special-purpose commands like node management or a plotting
+ interface. For instance, the \textsc{beamer} package uses only the
+ core and not, say, the |shapes| modules.
+\end{description}
+
+In theory, \tikzname\ itself is just one of several possible ``frontends''.
+which are sets of commands or a special syntax that makes using the basic layer
+easier. A problem with directly using the basic layer is that code written for
+this layer is often too ``verbose''. For example, to draw a simple triangle,
+you may need as many as five commands when using the basic layer: One for
+beginning a path at the first corner of the triangle, one for extending the
+path to the second corner, one for going to the third, one for closing the
+path, and one for actually painting the triangle (as opposed to filling it).
+With the \tikzname\ frontend all this boils down to a single simple
+\textsc{metafont}-like command:
+%
\begin{verbatim}
\draw (0,0) -- (1,0) -- (1,1) -- cycle;
\end{verbatim}
-In practice, \tikzname\ is the only ``serious'' 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. There are other frontends
-besides \tikzname, but they are more intended as ``technology
-studies'' and less as serious alternatives to \tikzname. In
-particular, the |pgfpict2e| frontend reimplements the standard
-\LaTeX\ |{picture}| environment and
-commands like |\line| or |\vector|
-using the \pgfname\ basic layer. This layer is not really ``necessary''
-since the |pict2e.sty| package does at least as good a job at
-reimplementing the |{picture}| environment. Rather, the idea
-behind this package is to have a simple demonstration of how a
-frontend can be implemented.
-
-Since most users will only use \tikzname\ and almost no one will use
-the system layer directly, this manual is mainly about \tikzname\ in
-the first parts; the basic layer and the system layer are explained at
-the end.
+In practice, \tikzname\ is the only ``serious'' 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. There are other frontends besides \tikzname, but they are more
+intended as ``technology studies'' and less as serious alternatives to
+\tikzname. In particular, the |pgfpict2e| frontend reimplements the standard
+\LaTeX\ |{picture}| environment and commands like |\line| or |\vector| using
+the \pgfname\ basic layer. This layer is not really ``necessary'' since the
+|pict2e.sty| package does at least as good a job at reimplementing the
+|{picture}| environment. Rather, the idea behind this package is to have a
+simple demonstration of how a frontend can be implemented.
+
+Since most users will only use \tikzname\ and almost no one will use the system
+layer directly, this manual is mainly about \tikzname\ in the first parts; the
+basic layer and the system layer are explained at the end.
\subsection{Comparison with Other Graphics Packages}
-\tikzname\ is not the only graphics package for \TeX. In the following,
-I try to give a reasonably fair comparison of \tikzname\ and
-other packages.
+\tikzname\ is not the only graphics package for \TeX. In the following, I try
+to give a reasonably fair comparison of \tikzname\ and other packages.
+%
\begin{enumerate}
-\item
- The standard \LaTeX\ |{picture}| environment allows you to create
- simple graphics, but little more. This is certainly not
- due to a lack of knowledge or imagination on the part of
- \LaTeX's designer(s). Rather, this is the price paid for the
- |{picture}| environment's portability: It works together with all
- backend drivers.
-\item
- The |pstricks| package is certainly powerful enough to create
- any conceivable kind of graphic, but it is not really portable. Most
- importantly, it does not work with |pdftex| nor with any other
- driver that produces anything but PostScript code.
-
- Compared to \tikzname, |pstricks| has a similar support base. There
- are many nice extra packages for special purpose situations that have
- been contributed by users over the last decade.
- The \tikzname\ syntax is more consistent than the |pstricks| syntax
- as \tikzname\ was developed ``in a more centralized manner'' and
- also ``with the shortcomings on |pstricks| in mind.''
-\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.
-\item
- The |dratex| package is a small graphic package for creating a
- graphics. Compared to the other package, including \tikzname, it is
- very small, which may or may not be an advantage.
-\item
- The |metapost| program is a powerful alternative to
- \tikzname. It used to be an external program, which entailed a
- bunch of problems, but in Lua\TeX\ it is now build in. An obstacle
- with |metapost| is the inclusion of labels. This is \emph{much}
- easier to achieve using \pgfname.
-\item
- The |xfig| program is an important alternative to \tikzname\ for
- users who do not wish to ``program'' their graphics as is necessary
- with \tikzname\ and the other packages above. There is a conversion
- program that will convert |xfig| graphics to \tikzname.
+ \item The standard \LaTeX\ |{picture}| environment allows you to create
+ simple graphics, but little more. This is certainly not due to a lack
+ of knowledge or imagination on the part of \LaTeX's designer(s).
+ Rather, this is the price paid for the |{picture}| environment's
+ portability: It works together with all backend drivers.
+ \item The |pstricks| package is certainly powerful enough to create any
+ conceivable kind of graphic, but it is not really portable. Most
+ importantly, it does not work with |pdftex| nor with any other driver
+ that produces anything but PostScript code.
+
+ Compared to \tikzname, |pstricks| has a similar support base. There
+ are many nice extra packages for special purpose situations that have
+ been contributed by users over the last decade. The \tikzname\ syntax
+ is more consistent than the |pstricks| syntax as \tikzname\ was
+ developed ``in a more centralized manner'' and also ``with the
+ shortcomings on |pstricks| in mind''.
+ \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.
+ \item The |dratex| package is a small graphic package for creating a
+ graphics. Compared to the other package, including \tikzname, it is
+ very small, which may or may not be an advantage.
+ \item The |metapost| program is a powerful alternative to \tikzname. It
+ used to be an external program, which entailed a bunch of problems,
+ but in Lua\TeX\ it is now build in. An obstacle with |metapost| is
+ the inclusion of labels. This is \emph{much} easier to achieve using
+ \pgfname.
+ \item The |xfig| program is an important alternative to \tikzname\ for
+ users who do not wish to ``program'' their graphics as is necessary
+ with \tikzname\ and the other packages above. There is a conversion
+ program that will convert |xfig| graphics to \tikzname.
\end{enumerate}
\subsection{Utility Packages}
-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:
+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:
+%
\begin{enumerate}
-\item The |pgfkeys| package defines a powerful key management
- facility. It can be used completely independently of \pgfname.
-\item The |pgffor| package defines a useful |\foreach| statement.
-\item The |pgfcalendar| package defines macros for creating
- calendars. Typically, these calendars will be rendered using
- \pgfname's graphic engine, but you can use |pgfcalendar| also
- typeset calendars using normal text. The package also defines
- commands for ``working'' with dates.
-\item The |pgfpages| package is used to assemble several pages into a
- single page. It provides commands for assembling several
- ``virtual pages'' into a single ``physical page.'' The idea is that
- whenever \TeX\ has a page ready for ``shipout,'' |pgfpages| interrupts
- this shipout and instead stores the page to be shipped out in a
- special box. When enough ``virtual pages'' have been accumulated in
- this way, they are scaled down and arranged on a ``physical page,''
- which then \emph{really} shipped out. This mechanism allows you to
- create ``two page on one page'' versions of a document directly inside
- \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.
+ \item The |pgfkeys| package defines a powerful key management facility.
+ It can be used completely independently of \pgfname.
+ \item The |pgffor| package defines a useful |\foreach| statement.
+ \item The |pgfcalendar| package defines macros for creating calendars.
+ Typically, these calendars will be rendered using \pgfname's graphic
+ engine, but you can use |pgfcalendar| also typeset calendars using
+ normal text. The package also defines commands for ``working'' with
+ dates.
+ \item The |pgfpages| package is used to assemble several pages into a
+ single page. It provides commands for assembling several ``virtual
+ pages'' into a single ``physical page''. The idea is that whenever
+ \TeX\ has a page ready for ``shipout'', |pgfpages| interrupts this
+ shipout and instead stores the page to be shipped out in a special
+ box. When enough ``virtual pages'' have been accumulated in this way,
+ they are scaled down and arranged on a ``physical page'', which then
+ \emph{really} shipped out. This mechanism allows you to create ``two
+ page on one page'' versions of a document directly inside \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.
\end{enumerate}
-
\subsection{How to Read This Manual}
-This manual describes both the design of \tikzname\ and
-its usage. The organization is very roughly according to
-``user-friendliness.'' The commands and subpackages that are easiest
-and most frequently used are described first, more low-level and
-esoteric features are discussed later.
+This manual describes both the design of \tikzname\ and its usage. The
+organization is very roughly according to ``user-friendliness''. The commands
+and subpackages that are easiest and most frequently used are described first,
+more low-level and esoteric features are discussed later.
-If you have not yet installed \tikzname, 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 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.
+If you have not yet installed \tikzname, 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 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.
-The ``public'' commands and environments provided by the system
-are described throughout the text. In each such description, the
-described command, environment or option is printed in red. Text shown
-in green is optional and can be left out.
+The ``public'' commands and environments provided by the system are described
+throughout the text. In each such description, the described command,
+environment or option is printed in red. Text shown in green is optional and
+can be left out.
\subsection{Authors and Acknowledgements}
\label{section-authors}
-The bulk of the \pgfname\ system and its documentation was written by
-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.
+The bulk of the \pgfname\ system and its documentation was written by 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.
-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!
+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!
\subsection{Getting Help}
-When you need help with \pgfname\ and \tikzname, please do the
-following:
+When you need help with \pgfname\ and \tikzname, please do the following:
\begin{enumerate}
-\item
- Read the manual, at least the part that has to do with your problem.
-\item
- If that does not solve the problem, try having a look at the
- sourceforge development page for \pgfname\ and \tikzname\ (see the
- title of this document). Perhaps someone has already reported a
- similar problem and someone has found a solution.
-\item
- On the website you will find numerous forums for getting
- help. There, you can write to help forums, file bug reports, join
- mailing lists, and so on.
-\item
- Before you file a bug report, especially a bug report concerning the
- installation, make sure that this is really a bug. In particular,
- have a look at the |.log| file that results when you \TeX\ your
- files. This |.log| file should show that all the right files are
- loaded from the right directories. Nearly all installation problems
- can be resolved by looking at the |.log| file.
-\item
- \emph{As a last resort} you can try to email me (Till Tantau) or, if
- the problem concerns the mathematical engine, Mark Wibrow. I do
- not mind getting emails, I simply get way too many of them. Because
- of this, I cannot guarantee that your emails will be answered timely
- or even at all. Your chances that your problem will be fixed are
- somewhat higher if you mail to the \pgfname\ mailing list
- (naturally, I read this list and answer questions when I have the
- time).
+ \item Read the manual, at least the part that has to do with your
+ problem.
+ \item If that does not solve the problem, try having a look at the
+ sourceforge development page for \pgfname\ and \tikzname\ (see the
+ title of this document). Perhaps someone has already reported a
+ similar problem and someone has found a solution.
+ \item On the website you will find numerous forums for getting help.
+ There, you can write to help forums, file bug reports, join mailing
+ lists, and so on.
+ \item Before you file a bug report, especially a bug report concerning
+ the installation, make sure that this is really a bug. In particular,
+ have a look at the |.log| file that results when you \TeX\ your
+ files. This |.log| file should show that all the right files are
+ loaded from the right directories. Nearly all installation problems
+ can be resolved by looking at the |.log| file.
+ \item \emph{As a last resort} you can try to email me (Till Tantau) or,
+ if the problem concerns the mathematical engine, Mark Wibrow. I do
+ not mind getting emails, I simply get way too many of them. Because
+ of this, I cannot guarantee that your emails will be answered timely
+ or even at all. Your chances that your problem will be fixed are
+ somewhat higher if you mail to the \pgfname\ mailing list (naturally,
+ I read this list and answer questions when I have the time).
\end{enumerate}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-3d.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-3d.tex
index d1b8b0e0c63..76014f5e821 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-3d.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-3d.tex
@@ -11,21 +11,187 @@
\section{Three Dimensional Drawing Library}
\begin{tikzlibrary}{3d}
- This packages, which is still under construction, provides some
- styles and options for drawing three dimensional shapes.
-
- \textbf{This package is not officially released and commands may
- change or disappear without backward compatibility support.}
+ This package provides some styles and options for drawing three dimensional
+ shapes.
\end{tikzlibrary}
-This package is not yet documented. Here is, at least, an example of
-where this whole thing is supposed to head.
+\subsection{Coordinate Systems}
+
+\begin{coordinatesystem}{xyz cylindrical}
+ The |xyz cylindrical| coordinate system allows to you specify a point in
+ terms of cylindrical coordinates, sometimes also referred to as cylindrical
+ polar coordinates or polar cylindrical coordinates. It is very similar to
+ the |canvas polar| and |xy polar| coordinate systems with the difference
+ that you provide an elevation over the $xy$-plane using the |z| key.
+ %
+ \begin{key}{/tikz/cs/angle=\meta{degrees} (initially 0)}
+ The angle of the coordinate interpreted in the ellipse whose axes are
+ the $x$-vector and the $y$-vector.
+ \end{key}
+ %
+ \begin{key}{/tikz/cs/radius=\meta{number} (initially 0)}
+ A factor by which the $x$-vector and $y$-vector are multiplied prior to
+ forming the ellipse.
+ \end{key}
+ %
+ \begin{key}{/tikz/cs/z=\meta{number} (initially 0)}
+ Factor by which the $z$-vector is multiplied.
+ \end{key}
+ %
+\begin{codeexample}[]
+\begin{tikzpicture}[->]
+ \draw (0,0,0) -- (xyz cylindrical cs:radius=1);
+ \draw (0,0,0) -- (xyz cylindrical cs:radius=1,angle=90);
+ \draw (0,0,0) -- (xyz cylindrical cs:z=1);
+\end{tikzpicture}
+\end{codeexample}
+ %
+\end{coordinatesystem}
+
+\begin{coordinatesystem}{xyz spherical}
+ The |xyz spherical| coordinate system allows you to specify a point in
+ terms of spherical coordinates.
+ %
+ \begin{key}{/tikz/cs/radius=\meta{number} (initially 0)}
+ Factor by which the $x$-, $y$-, and $z$-vector are multiplied.
+ \end{key}
+ %
+ \begin{key}{/tikz/cs/latitude=\meta{degrees} (initially 0)}
+ Angle of the coordinate between the $y$- and $z$-vector, measured from
+ the $y$-vector.
+ \end{key}
+ %
+ \begin{key}{/tikz/cs/longitude=\meta{degrees} (initially 0)}
+ Angle of the coordinate between the $x$- and $y$-vector, measured from
+ the $y$-vector.
+ \end{key}
+ %
+ \begin{key}{/tikz/cs/angle=\meta{degrees} (initially 0)}
+ Same as |longitude|.
+ \end{key}
+ %
+\begin{codeexample}[]
+\begin{tikzpicture}[->]
+ \draw (0,0,0) -- (xyz spherical cs:radius=1);
+ \draw (0,0,0) -- (xyz spherical cs:radius=1,latitude=90);
+ \draw (0,0,0) -- (xyz spherical cs:radius=1,longitude=90);
+\end{tikzpicture}
+\end{codeexample}
+ %
+\end{coordinatesystem}
+
+
+\subsection{Coordinate Planes}
+
+Sometimes drawing with full three dimensional coordinates is not necessary and
+it suffices to draw in two dimensions but in a different coordinate plane. The
+following options help you to switch to a different plane.
+
+
+\subsubsection{Switching to an arbitrary plane}
+
+\begin{key}{/tikz/plane origin=\meta{point} (initially {(0,0)})}
+ Origin of the plane.
+\end{key}
+
+\begin{key}{/tikz/plane x=\meta{point} (initially {(1,0)})}
+ Unit vector of the $x$-direction in the new plane.
+\end{key}
+
+\begin{key}{/tikz/plane y=\meta{point} (initially {(0,1)})}
+ Unit vector of the $y$-direction in the new plane.
+\end{key}
+\begin{key}{/tikz/canvas is plane}
+ Perform the transformation into the new canvas plane using the units above.
+ Note that you have to set the units \emph{before} calling
+ |canvas is plane|.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}[z={(10:10mm)},x={(-45:5mm)}]
+\begin{tikzpicture}[
+ ->,
+ plane x={(0.707,-0.707)},
+ plane y={(0.707,0.707)},
+ canvas is plane,
+]
+ \draw (0,0) -- (1,0);
+ \draw (0,0) -- (0,1);
+\end{tikzpicture}
+\end{codeexample}
+ %
+\end{key}
+
+
+\subsubsection{Predefined planes}
+
+\begin{key}{/tikz/canvas is xy plane at z=\meta{dimension}}
+ A plane with
+ %
+ \begin{itemize}
+ \item |plane origin={(0,0,|\meta{dimension}|)}|,
+ \item |plane x={(1,0,|\meta{dimension}|)}|, and
+ \item |plane y={(0,1,|\meta{dimension}|)}|.
+ \end{itemize}
+\end{key}
+
+\begin{key}{/tikz/canvas is yx plane at z=\meta{dimension}}
+ A plane with
+ %
+ \begin{itemize}
+ \item |plane origin={(0,0,|\meta{dimension}|)}|,
+ \item |plane x={(0,1,|\meta{dimension}|)}|, and
+ \item |plane y={(1,0,|\meta{dimension}|)}|.
+ \end{itemize}
+\end{key}
+
+\begin{key}{/tikz/canvas is xz plane at y=\meta{dimension}}
+ A plane with
+ %
+ \begin{itemize}
+ \item |plane origin={(0,|\meta{dimension}|,0)}|,
+ \item |plane x={(1,|\meta{dimension}|,0)}|, and
+ \item |plane y={(0,|\meta{dimension}|,1)}|.
+ \end{itemize}
+\end{key}
+
+\begin{key}{/tikz/canvas is zx plane at y=\meta{dimension}}
+ A plane with
+ %
+ \begin{itemize}
+ \item |plane origin={(0,|\meta{dimension}|,0)}|,
+ \item |plane x={(0,|\meta{dimension}|,1)}|, and
+ \item |plane y={(1,|\meta{dimension}|,0)}|.
+ \end{itemize}
+\end{key}
+
+\begin{key}{/tikz/canvas is yz plane at x=\meta{dimension}}
+ A plane with
+ %
+ \begin{itemize}
+ \item |plane origin={(|\meta{dimension}|,0,0)}|,
+ \item |plane x={(|\meta{dimension}|,1,0)}|, and
+ \item |plane y={(|\meta{dimension}|,0,1)}|.
+ \end{itemize}
+\end{key}
+
+\begin{key}{/tikz/canvas is zy plane at x=\meta{dimension}}
+ A plane with
+ %
+ \begin{itemize}
+ \item |plane origin={(|\meta{dimension}|,0,0)}|,
+ \item |plane x={(|\meta{dimension}|,0,1)}|, and
+ \item |plane y={(|\meta{dimension}|,1,0)}|.
+ \end{itemize}
+\end{key}
+
+
+\subsection{Examples}
+
+\begin{codeexample}[]
+\begin{tikzpicture}[z={(10:10mm)},x={(-45:5mm)}]
\def\wave{
\draw[fill,thick,fill opacity=.2]
- (0,0) sin (1,1) cos (2,0) sin (3,-1) cos (4,0)
+ (0,0) sin (1,1) cos (2,0) sin (3,-1) cos (4,0)
sin (5,1) cos (6,0) sin (7,-1) cos (8,0)
sin (9,1) cos (10,0)sin (11,-1)cos (12,0);
\foreach \shift in {0,4,8}
@@ -72,10 +238,7 @@ where this whole thing is supposed to head.
\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-angles.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-angles.tex
index c46a6e4204b..975afd3d5b8 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-angles.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-angles.tex
@@ -9,44 +9,44 @@
\section{Angle Library}
-
\label{section-angle}
\begin{tikzlibrary}{angles}
- This library defines pic types for drawing angles.
+ This library defines pic types for drawing angles.
\end{tikzlibrary}
\begin{pictype}{angle}{\opt{|=|\meta{A}|--|\meta{B}|--|\meta{C}}}
- This pic adds a drawing of an angle to the current path. This
- ``drawing of an angle'' consist of a ``sector'' or ``wedge'' or
- ``slice'' whose pointed end is at point \meta{B} and whose straight
- sides lie on the lines form \meta{B} to \meta{A} and from \meta{B}
- to \meta{C}. The length of these lines is governed by the following
- key:
- \begin{key}{/tikz/angle radius=\meta{dimension} (initially 5mm)}
- The length of the sides of the angle's wedge:
+ This pic adds a drawing of an angle to the current path. This ``drawing of
+ an angle'' consist of a ``sector'' or ``wedge'' or ``slice'' whose pointed
+ end is at point \meta{B} and whose straight sides lie on the lines form
+ \meta{B} to \meta{A} and from \meta{B} to \meta{C}. The length of these
+ lines is governed by the following key:
+ %
+ \begin{key}{/tikz/angle radius=\meta{dimension} (initially 5mm)}
+ The length of the sides of the angle's wedge:
+ %
\begin{codeexample}[]
\tikz \draw (2,0) coordinate (A) -- (0,0) coordinate (B)
-- (-1,-1) coordinate (C)
pic [fill=black!50] {angle = A--B--C}
pic [draw,->,red,thick,angle radius=1cm] {angle = C--B--A};
\end{codeexample}
- \end{key}
-
- The three points \meta{A}, \meta{B}, and \meta{C} \emph{must} be the
- names of nodes or coordinates; you cannot use direct coordinates like
- ``|(1,1)|'' here.
+ \end{key}
- You can leave out the three points, in this case the text |A--B--C|
- is used; so in the above examples we could just have written
- |{angle}| in the first pic.
+ The three points \meta{A}, \meta{B}, and \meta{C} \emph{must} be the names
+ of nodes or coordinates; you cannot use direct coordinates like ``|(1,1)|''
+ here.
- Concerning the sector that makes up the drawing of the angle, the
- angular part of this sector is drawn in front of the path if the
- |draw| option is given to the |pic|, while filled sector is drawn
- behind the |pic|, provided an option like |fill| or |shade| is
- passed to the pic. The following example shows the difference:
+ You can leave out the three points, in this case the text |A--B--C| is
+ used; so in the above examples we could just have written |{angle}| in the
+ first pic.
+ Concerning the sector that makes up the drawing of the angle, the angular
+ part of this sector is drawn in front of the path if the |draw| option is
+ given to the |pic|, while filled sector is drawn behind the |pic|, provided
+ an option like |fill| or |shade| is passed to the pic. The following
+ example shows the difference:
+ %
\begin{codeexample}[]
\tikz \draw [line width=2mm]
(2,0) coordinate (A) -- (0,0) coordinate (B)
@@ -54,36 +54,55 @@
pic [draw=blue, fill=blue!50, angle radius=1cm] {angle};
\end{codeexample}
- When |pic text| is set (which you typically do by using the quotes
- syntax), a node will be created whose name is empty
- (and, thus, inherits the pic's name) and which will be at the
- half-way angle between the lines to \meta{A} and \meta{C} and whose
- distance from \meta{B} is |angle radius| times the following factor:
- \begin{key}{/tikz/angle eccentricity=\meta{factor} (initially 0.6)}
+ When |pic text| is set (which you typically do by using the quotes syntax),
+ a node will be created whose name is empty (and, thus, inherits the pic's
+ name) and which will be at the half-way angle between the lines to \meta{A}
+ and \meta{C} and whose distance from \meta{B} is |angle radius| times the
+ following factor:
+ %
+ \begin{key}{/tikz/angle eccentricity=\meta{factor} (initially 0.6)}
\begin{codeexample}[]
\tikz \draw (2,0) coordinate (A) -- (0,0) coordinate (B)
-- (1,1) coordinate (C)
pic ["$\alpha$", draw, ->] {angle};
-\end{codeexample}
+\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \draw (2,0) coordinate (A) -- (0,0) coordinate (B)
-- (1,1) coordinate (C)
pic ["$\alpha$", draw, angle eccentricity=1] {angle};
-\end{codeexample}
+\end{codeexample}
+ %
\begin{codeexample}[]
\tikz {
\draw (2,0) coordinate (A) -- (0,0) coordinate (B)
-- (1,1) coordinate (C)
pic (alpha) ["$\alpha$", draw] {angle};
-
+
\draw (alpha) circle [radius=5pt];
}
-\end{codeexample}
- \end{key}
+\end{codeexample}
+ \end{key}
+\end{pictype}
+
+\begin{pictype}{right angle}{\opt{|=|\meta{A}|--|\meta{B}|--|\meta{C}}}
+ This pic adds a drawing of a right angle to the current path. It works in
+ the same way as |angle| pic.
+ %
+\begin{codeexample}[]
+ \tikz
+ \draw (1,0,0) coordinate (A) -- (0,0,0) coordinate (B)
+ -- (0,0,1) coordinate (C)
+ (B) -- (0,1,0) coordinate (D)
+ pic [fill=gray,angle radius=4mm] {right angle = A--B--C}
+ pic [draw,red,thick,angle eccentricity=.5,pic text=$\cdot$]
+ {right angle = A--B--D};
+\end{codeexample}
+ %
\end{pictype}
-%%% 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-arrows.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-arrows.tex
index 6db5b1002ac..e9e1a8be007 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
@@ -11,18 +11,15 @@
\section{Arrow Tip Library}
\label{section-library-arrows}
-The libraries |arrows| and |arrows.spaced| from older
-versions of \pgfname\ are still available for compatibility, but they
-are considered deprecated.
+The libraries |arrows| and |arrows.spaced| from older versions of \pgfname\ are
+still available for compatibility, but they are considered deprecated.
-The standard arrow tips, which are loaded by the library
-|arrows.meta|, are documented in Section~\ref{section-arrows-meta}.
-
-\endinput
+The standard arrow tips, which are loaded by the library |arrows.meta|, are
+documented in Section~\ref{section-arrows-meta}.
% \subsection{Mathematical Arrow Tips}
-
+%
% \begin{tabular}{ll}
% \symarrow{to} \\
% \symarrow{to reversed} \\
@@ -31,10 +28,10 @@ The standard arrow tips, which are loaded by the library
% \symarrow{spaced to reversed} \\
% \symarrowdouble{spaced implies} \\
% \end{tabular}
-
-
+%
+%
% \subsection{Triangular Arrow Tips}
-
+%
% \begin{tabular}{ll}
% \symarrowdouble{latex} \\
% \symarrowdouble{latex reversed} \\
@@ -57,7 +54,7 @@ The standard arrow tips, which are loaded by the library
% \symarrow{open triangle 45} \\
% \symarrow{open triangle 45 reversed} \\
% \end{tabular}
-
+%
% \medskip
% \noindent
% \begin{tabular}{ll}
@@ -70,7 +67,7 @@ The standard arrow tips, which are loaded by the library
% \symarrow{spaced stealth'} \\
% \symarrow{spaced stealth' reversed}\\
% \end{tabular}
-
+%
% \medskip
% \noindent
% \begin{tabular}{ll}
@@ -87,10 +84,10 @@ The standard arrow tips, which are loaded by the library
% \symarrow{spaced open triangle 45} \\
% \symarrow{spaced open triangle 45 reversed} \\
% \end{tabular}
-
-
+%
+%
% \subsection{Barbed Arrow Tips}
-
+%
% \begin{tabular}{ll}
% \symarrow{angle 90} \\
% \symarrow{angle 90 reversed} \\
@@ -101,7 +98,7 @@ The standard arrow tips, which are loaded by the library
% \symarrow{hooks} \\
% \symarrow{hooks reversed} \\
% \end{tabular}
-
+%
% \medskip
% \noindent
% \begin{tabular}{ll}
@@ -114,10 +111,10 @@ The standard arrow tips, which are loaded by the library
% \symarrow{spaced hooks} \\
% \symarrow{spaced hooks reversed} \\
% \end{tabular}
-
-
+%
+%
% \subsection{Bracket-Like Arrow Tips}
-
+%
% {
% \bigskip
% \catcode`\|=12
@@ -128,7 +125,7 @@ The standard arrow tips, which are loaded by the library
% \sarrow{)}{(} \\
% \index{*vbar@\protect\texttt{\protect\myvbar} arrow tip}%
% \index{Arrow tips!*vbar@\protect\texttt{\protect\myvbar}}%
-% \texttt{\char`\|-\char`\|} & yields thick
+% \texttt{\char`\|-\char`\|} & yields thick
% \begin{tikzpicture}[arrows={|-|},thick]
% \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
% \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
@@ -145,7 +142,7 @@ The standard arrow tips, which are loaded by the library
% \sarrow{spaced )}{spaced (} \\
% \index{*spaced vbar@\protect\texttt{spaced \protect\myvbar} arrow tip}%
% \index{Arrow tips!*spaced vbar@\protect\texttt{spaced \protect\myvbar}}%
-% \texttt{spaced \char`\|-spaced \char`\|} & yields thick
+% \texttt{spaced \char`\|-spaced \char`\|} & yields thick
% \begin{tikzpicture}[arrows={spaced |-spaced |},thick]
% \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
% \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
@@ -158,10 +155,10 @@ The standard arrow tips, which are loaded by the library
% \end{tikzpicture}
% \end{tabular}
% }
-
+%
% \subsection{Circle, Diamond and Square Arrow Tips}
-
-
+%
+%
% \begin{tabular}{ll}
% \symarrow{o} \\
% \symarrow{*} \\
@@ -170,8 +167,8 @@ The standard arrow tips, which are loaded by the library
% \symarrow{square} \\
% \symarrow{open square} \\
% \end{tabular}
-
-
+%
+%
% \medskip
% \noindent
% \begin{tabular}{ll}
@@ -182,18 +179,18 @@ The standard arrow tips, which are loaded by the library
% \symarrow{spaced square} \\
% \symarrow{spaced open square} \\
% \end{tabular}
-
-
+%
+%
% \subsection{Serif-Like Arrow Tips}
-
+%
% \begin{tabular}{ll}
% \symarrow{serif cm} \\
% \symarrow{spaced serif cm}
% \end{tabular}
-
-
+%
+%
% \subsection{Partial Arrow Tips}
-
+%
% \begin{tabular}{ll}
% \symarrow{left to} \\
% \symarrow{left to reversed} \\
@@ -212,10 +209,10 @@ The standard arrow tips, which are loaded by the library
% \symarrow{spaced right hook} \\
% \symarrow{spaced right hook reversed}
% \end{tabular}
-
-
+%
+%
% \subsection{Line Caps}
-
+%
% \begin{tabular}{ll}
% \carrow{round cap} \\
% \carrow{butt cap} \\
@@ -230,19 +227,19 @@ The standard arrow tips, which are loaded by the library
% \carrow{spaced fast cap} \\
% \carrow{spaced fast cap reversed} \\
% \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:
+%%% 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-automata.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex
index 01441b39f13..a0e73700ff7 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
@@ -11,38 +11,38 @@
\section{Automata Drawing Library}
\begin{tikzlibrary}{automata}
- This packages provides shapes and styles for drawing finite state
- automata and Turing machines.
+ This packages provides shapes and styles for drawing finite state automata
+ and Turing machines.
\end{tikzlibrary}
\subsection{Drawing Automata}
-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.
+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.
To draw an automaton, proceed as follows:
+%
\begin{enumerate}
-\item For each state of the automaton, there should be one node with
- the option |state|.
-\item To place the states, you can either use absolute positions or
- relative positions, using options like |above| or |right|.
-\item Give a unique name to each state node.
-\item Accepting and initial states are indicated by adding the
- options |accepting| and |initial|, respectively, to the state
- nodes.
-\item Once the states are fixed, the edges can be added. For this, the
- |edge| operation is most useful. It is, however, also possible to
- add edges after each node has been placed.
-\item For loops, use the |edge [loop]| operation.
+ \item For each state of the automaton, there should be one node with the
+ option |state|.
+ \item To place the states, you can either use absolute positions or
+ relative positions, using options like |above| or |right|.
+ \item Give a unique name to each state node.
+ \item Accepting and initial states are indicated by adding the options
+ |accepting| and |initial|, respectively, to the state nodes.
+ \item Once the states are fixed, the edges can be added. For this, the
+ |edge| operation is most useful. It is, however, also possible to add
+ edges after each node has been placed.
+ \item For loops, use the |edge [loop]| operation.
\end{enumerate}
Let us now see how this works for a real example. Let us consider a
-nondeterministic four state automaton that checks whether an input contains
-the sequence $0^*1$ or the sequence $1^*0$.
+nondeterministic four state automaton that checks whether an input 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);
@@ -64,23 +64,24 @@ the sequence $0^*1$ or the sequence $1^*0$.
\subsection{States With and Without Output}
-The |state| style actually just ``selects'' a default underlying
-style. Thus, you can define multiple new complicated state style and
-then simply set the |state| style to your given style to get the
-desired kind of styles.
+The |state| style actually just ``selects'' a default underlying style. Thus,
+you can define multiple new complicated state style and then simply set the
+|state| style to your given style to get the desired kind of styles.
By default, the following state styles are defined:
+%
\begin{stylekey}{/tikz/state without output}
- This node style causes nodes to be drawn as circles. Also, this style
- calls |every state|.
+ This node style causes nodes to be drawn as circles. Also, this style calls
+ |every state|.
\end{stylekey}
\begin{stylekey}{/tikz/state with output}
- This node style causes nodes to be drawn as split circles, that is,
- using the |circle split| shape. In the upper part of the shape you
- have the name of the style, in the lower part the output is
- placed. To specify the output, use the command |\nodepart{lower}|
- inside the node. This style also calls |every state|.
+ This node style causes nodes to be drawn as split circles, that is, using
+ the |circle split| shape. In the upper part of the shape you have the name
+ of the style, in the lower part the output is placed. To specify the
+ output, use the command |\nodepart{lower}| inside the node. This style also
+ calls |every state|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -90,23 +91,26 @@ By default, the following state styles are defined:
\node[state with output] at (2,0) {$q_1$ \nodepart{lower} $00$};
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/state (initially state without output)}
- You should redefine it to something else, if you wish to use states
- of a different nature.
+ You should redefine it to something else, if you wish to use states of a
+ different nature.
\begin{codeexample}[]
\begin{tikzpicture}[state/.style=state with output]
\node[state] {$q_0$ \nodepart{lower} $11$};
\node[state] at (2,0) {$q_1$ \nodepart{lower} $00$};
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
\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:
+ 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:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,>=stealth',
every state/.style={draw=blue!50,very thick,fill=blue!20}]
@@ -121,103 +125,117 @@ By default, the following state styles are defined:
(q_2) edge [loop below] node {1} ();
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
\subsection{Initial and Accepting States}
-The styles |initial| and |accepting| are similar to the |state| style
-as they also just select an ``underlying'' style, which installs the
-actual settings for initial and accepting states.
+The styles |initial| and |accepting| are similar to the |state| style as they
+also just select an ``underlying'' style, which installs the actual settings
+for initial and accepting states.
Let us start with the initial states.
+%
\begin{stylekey}{/tikz/initial (initially initial by arrow)}
- This style is used to draw initial states.
+ This style is used to draw initial states.
\end{stylekey}
+
\begin{stylekey}{/tikz/initial by arrow}
- This style causes an arrow and, possibly, some text to be added to
- the node. The arrow points from the text to the node. The node text
- and the direction and the distance can be set using the following
- key:
- \begin{key}{/tikz/initial text=\meta{text} (initially start)}
- This key sets the text to be used. Use an empty text to suppress
- all text.
- \end{key}
- \begin{key}{/tikz/initial where=\meta{direction} (initially left)}
- Set the place where the text should be shown. Allowed values are
- |above|, |below|, |left|, and |right|.
- \end{key}
- \begin{key}{/tikz/initial distance=\meta{distance} (initially 3ex)}
- Sets the length of the arrow leading from the text to the state
- node.
- \end{key}
- \begin{stylekey}{/tikz/every initial by arrow (initially \normalfont empty)}
- This style is executed at the beginning of every path that contains
- the arrow and the text. You can use it to, say, make the text red or
- whatever.
- \end{stylekey}
+ This style causes an arrow and, possibly, some text to be added to the
+ node. The arrow points from the text to the node. The node text and the
+ direction and the distance can be set using the following key:
+ %
+ \begin{key}{/tikz/initial text=\meta{text} (initially start)}
+ This key sets the text to be used. Use an empty text to suppress all
+ text.
+ \end{key}
+ %
+ \begin{key}{/tikz/initial where=\meta{direction} (initially left)}
+ Set the place where the text should be shown. Allowed values are
+ |above|, |below|, |left|, and |right|.
+ \end{key}
+ %
+ \begin{key}{/tikz/initial distance=\meta{distance} (initially 3ex)}
+ Sets the length of the arrow leading from the text to the state node.
+ \end{key}
+ %
+ \begin{stylekey}{/tikz/every initial by arrow (initially \normalfont empty)}
+ This style is executed at the beginning of every path that contains the
+ arrow and the text. You can use it to, say, make the text red or
+ whatever.
+ \end{stylekey}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every initial by arrow/.style={text=red,->>}]
\node[state,initial,initial distance=2cm] {$q_0$};
\end{tikzpicture}
\end{codeexample}
- %<<
+ %
\end{stylekey}
+
\begin{stylekey}{/tikz/initial above}
- This is a shorthand for |initial by arrow,initial where=above|.
+ This is a shorthand for |initial by arrow,initial where=above|.
\end{stylekey}
+
\begin{stylekey}{/tikz/initial below}
- Works similarly to the previous option.
+ Works similarly to the previous option.
\end{stylekey}
+
\begin{stylekey}{/tikz/initial left}
- Works similarly to the previous option.
+ Works similarly to the previous option.
\end{stylekey}
+
\begin{stylekey}{/tikz/initial right}
- Works similarly to the previous option.
+ Works similarly to the previous option.
\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 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|,
-only with the direction of arrow reversed, and |accepting by double|,
-where accepting states get a double line around them.
+|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|, only with the direction of arrow reversed, and
+|accepting by double|, where accepting states get a double line around them.
\begin{stylekey}{/tikz/accepting (initially accepting by double)}
- This style is used to draw accepting states. You can replace
- this by the style |accepting by arrow| to get accepting states with
- an arrow leaving them.
+ This style is used to draw accepting states. You can replace this by the
+ style |accepting by arrow| to get accepting states with an arrow leaving
+ them.
\end{stylekey}
\begin{stylekey}{/tikz/accepting by double}
- This style causes a double line to be drawn around a state.
+ This style causes a double line to be drawn around a state.
\end{stylekey}
\begin{stylekey}{/tikz/accepting by arrow}
- This style causes an arrow and, possibly, some text to be added to
- the node. The arrow points to the text from the node.
-
- The same options as for initial states can be used, only with
- |initial| replaced by |accepting|:
- \begin{key}{/tikz/accepting text=\meta{text} (initially \normalfont empty)}
- This key sets the text to be used.
- \end{key}
- \begin{key}{/tikz/accepting where=\meta{direction} (initially right)}
- Set the place where the text should be shown. Allowed values are
- |above|, |below|, |left|, and |right|.
- \end{key}
- \begin{key}{/tikz/initial distance=\meta{distance} (initially 3ex)}
- Sets the length of the arrow leading from the text to the state
- node.
- \end{key}
- \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}
+ This style causes an arrow and, possibly, some text to be added to the
+ node. The arrow points to the text from the node.
+
+ The same options as for initial states can be used, only with |initial|
+ replaced by |accepting|:
+ %
+ \begin{key}{/tikz/accepting text=\meta{text} (initially \normalfont empty)}
+ This key sets the text to be used.
+ \end{key}
+ %
+ \begin{key}{/tikz/accepting where=\meta{direction} (initially right)}
+ Set the place where the text should be shown. Allowed values are
+ |above|, |below|, |left|, and |right|.
+ \end{key}
+ %
+ \begin{key}{/tikz/initial distance=\meta{distance} (initially 3ex)}
+ Sets the length of the arrow leading from the text to the state
+ node.
+ \end{key}
+ %
+ \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}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[shorten >=1pt,node distance=2cm,on grid,>=stealth',initial text=,
@@ -237,31 +255,33 @@ where accepting states get a double line around them.
edge [loop below] node {1} ();
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/accepting above}
- This is a shorthand for |accepting by arrow,accepting where=above|.
+ This is a shorthand for |accepting by arrow,accepting where=above|.
\end{stylekey}
+
\begin{stylekey}{/tikz/accepting below}
- Works similarly to the previous option.
+ Works similarly to the previous option.
\end{stylekey}
+
\begin{stylekey}{/tikz/accepting left}
- Works similarly to the previous option.
+ Works similarly to the previous option.
\end{stylekey}
+
\begin{stylekey}{/tikz/accepting right}
- Works similarly to the previous option.
+ Works similarly to the previous option.
\end{stylekey}
-
\subsection{Examples}
-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.
-
+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.
+%
\begin{codeexample}[]
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,>=stealth',thick,
every state/.style={fill,draw=none,orange,text=white,circular drop shadow},
@@ -282,9 +302,8 @@ red state to a green state.
\end{tikzpicture}
\end{codeexample}
-The next example is the current candidate for the five-state busiest
-beaver:
-
+The next example is the current candidate for the five-state busiest beaver:
+%
\begin{codeexample}[]
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,%
auto,node distance=2cm,on grid,semithick,
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-babel.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-babel.tex
index 6cd62e59530..dd8bb7b43a1 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-babel.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-babel.tex
@@ -7,57 +7,53 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Babel Library}
\label{section-library-babel}
-
\begin{pgflibrary}{babel}
- A tiny library that make the interaction with the |babel| package
- easier. Despite the name, it may also be useful in other contexts,
- namely whenever the catcodes of important symbols are changed
- globally. Normally, using this library is always a good idea; it is not
- always loaded by default since in some rare cases it may break old
- code.
+ A tiny library that make the interaction with the |babel| package easier.
+ Despite the name, it may also be useful in other contexts, namely whenever
+ the catcodes of important symbols are changed globally. Normally, using
+ this library is always a good idea; it is not always loaded by default
+ since in some rare cases it may break old code.
\end{pgflibrary}
The problems this library tries to fix have to do with the so-called
-``catcodes'' of symbols used inside \tikzname. In normal \TeX\
-operation, symbols like |!| or |"| are ``normal'' characters and the
-\tikzname\ parser expects them to be. Some packages, most noticably
-the |babel| package, agressively change these character codes so that
-for instance a semicolon gets a little extra space in |french| mode or
-a quotation mark followed by a vertical bar breaks ligatures in
-|german| mode.
-
-Unfortunately, \tikzname\ expects the character codes of some symbols
-to be ``normal.'' In some important cases it will tolerate changed
-character codes, but when the changes made by |babel| (or some other
-package) are too ``aggressive,'' compilation of \tikzname\ code will
-fail.
-
-The |babel| library of \tikzname\ is intended to help out in this
-situation. All this library does is to set the following two keys to
-|true|. You can, however, also set these keys directly and also switch
-them off or on individually and independently of this library.
-
+``catcodes'' of symbols used inside \tikzname. In normal \TeX\ operation,
+symbols like |!| or |"| are ``normal'' characters and the \tikzname\ parser
+expects them to be. Some packages, most noticeably the |babel| package,
+aggressively change these character codes so that for instance a semicolon gets
+a little extra space in |french| mode or a quotation mark followed by a
+vertical bar breaks ligatures in |german| mode.
+
+Unfortunately, \tikzname\ expects the character codes of some symbols to be
+``normal''. In some important cases it will tolerate changed character codes,
+but when the changes made by |babel| (or some other package) are too
+``aggressive'', compilation of \tikzname\ code will fail.
+
+The |babel| library of \tikzname\ is intended to help out in this situation.
+All this library does is to set the following two keys to |true|. You can,
+however, also set these keys directly and also switch them off or on
+individually and independently of this library.
\begin{key}{/tikz/handle active characters in code=\opt{\meta{true or false}} (initially false)}
- When this key is set, at the beginning of every |\tikz| command and
- every |{tikzpicture}|, the character codes of all symbols used by
- \tikzname\ are reset to their normal values. Furthermore, at the
- beginning of each node, the catcodes are restored to the values they
- had prior to the current picture.
-
- The net effect of this is that, in most cases, symbols having a
- special character code can be used nicely both in \tikzname\ code
- and also in node texts.
-
- In the following, slightly silly, example we make the dot an active
- character and define it in some strange way. Now, in the later
- \tikzname\ command, the dot in |3.0cm| may no longer be active and
- setting the |handle...| option achieves exactly this. However, as
- can be seen, the dot is once more active inside the node.
-
+ When this key is set, at the beginning of every |\tikz| command and every
+ |{tikzpicture}|, the character codes of all symbols used by \tikzname\ are
+ reset to their normal values. Furthermore, at the beginning of each node,
+ the catcodes are restored to the values they had prior to the current
+ picture.
+
+ The net effect of this is that, in most cases, symbols having a special
+ character code can be used nicely both in \tikzname\ code and also in node
+ texts.
+
+ In the following, slightly silly, example we make the dot an active
+ character and define it in some strange way. Now, in the later \tikzname\
+ command, the dot in |3.0cm| may no longer be active and setting the
+ |handle...| option achieves exactly this. However, as can be seen, the dot
+ is once more active inside the node.
+ %
\begin{codeexample}[]
\catcode`\.=\active
\def.{\o}
@@ -65,29 +61,27 @@ them off or on individually and independently of this library.
\tikz [handle active characters in code]
\node [draw, minimum width=3.0cm] {hall. pe.ple};
\end{codeexample}
+ %
\end{key}
-
-
\begin{key}{/tikz/handle active characters in nodes=\opt{\meta{true or false}} (initially false)}
- This key is needed for a special situation: As explained for the
- |handle ... code| key, that key switches off all special meaning of
- symbols and switches them back on again at the beginning of
- nodes. However, there is one situation when this is not possible:
- When some text has already been read by \TeX, the catcodes can no
- longer change. Now, for normal nodes this is not a problem since
- their contents has not been read at the moment the catcodes are
- restored. In contrast for label nodes for edges, nodes produced by the
- |graph| and |quotes| libraries, and some others nodes, their text
- \emph{has} already been read when the catcodes get adjusted.
-
- The present key may help in such situations: It causes the text of
- all such ``indirectly created'' nodes to be surrounded by a call to
- the |\scantokens| command. This command attempts to reread an
- already read text, but allows catcodes to change. As users of this
- command will know, it is not a perfect substitute for directly
- reading the text by \TeX, but it normally has the desired effect.
-
+ This key is needed for a special situation: As explained for the
+ |handle ... code| key, that key switches off all special meaning of symbols
+ and switches them back on again at the beginning of nodes. However, there
+ is one situation when this is not possible: When some text has already been
+ read by \TeX, the catcodes can no longer change. Now, for normal nodes this
+ is not a problem since their contents has not been read at the moment the
+ catcodes are restored. In contrast for label nodes for edges, nodes
+ produced by the |graph| and |quotes| libraries, and some others nodes,
+ their text \emph{has} already been read when the catcodes get adjusted.
+
+ The present key may help in such situations: It causes the text of all such
+ ``indirectly created'' nodes to be surrounded by a call to the
+ |\scantokens| command. This command attempts to reread an already read
+ text, but allows catcodes to change. As users of this command will know, it
+ is not a perfect substitute for directly reading the text by \TeX, but it
+ normally has the desired effect.
+ %
\begin{codeexample}[]
\catcode`\.=\active
\def.{\o}
@@ -96,11 +90,5 @@ them off or on individually and independently of this library.
handle active characters in nodes]
\node [draw, label=f..] {hall. pe.ple};
\end{codeexample}
+ %
\end{key}
-
-
-
-\endinput
-
-
-
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 2b79d042e58..b24a38860a0 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
@@ -8,40 +8,37 @@
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-
\section{Background Library}
-
\label{section-tikz-backgrounds}
\begin{tikzlibrary}{backgrounds}
- This library defines ``backgrounds'' for pictures. This does not
- refer to background pictures, but rather to frames drawn around and
- behind pictures. For example, this package allows you to just add
- the |framed| option to a picture to get a rectangular box around
- your picture or |gridded| to put a grid behind your picture.
+ This library defines ``backgrounds'' for pictures. This does not refer to
+ background pictures, but rather to frames drawn around and behind pictures.
+ For example, this package allows you to just add the |framed| option to a
+ picture to get a rectangular box around 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:
+The first use of this library is to make the following key available:
+%
\begin{key}{/tikz/on background layer=\meta{options}}
- This key can (only) be used with a |{scope}| or |\scoped|. It will
- cause everything inside the scope to be typeset on a background
- layer.
-
- The \meta{options} will be executed \emph{inside} background
- scope. This is useful since \emph{other} options passed to the
- |{scope}| environment will be executed \emph{before} the actual
- background material starts and, thus, will have no effect on it.
+ This key can (only) be used with a |{scope}| or |\scoped|. It will cause
+ everything inside the scope to be typeset on a background layer.
+ The \meta{options} will be executed \emph{inside} background scope. This is
+ useful since \emph{other} options passed to the |{scope}| environment will
+ be executed \emph{before} the actual background material starts and, thus,
+ will have no effect on it.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
% On main layer:
\fill[blue] (0,0) circle (1cm);
-
+
\begin{scope}[on background layer={color=yellow}]
\fill (-1,-1) rectangle (1,1);
\end{scope}
-
+
\begin{scope}[on background layer]
\fill[black] (-.8,-.8) rectangle (.8,.8);
\end{scope}
@@ -51,90 +48,100 @@ The first use of this library is to make the following key available:
\end{tikzpicture}
\end{codeexample}
- A scope with this option set 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,'' see
- also Section~\ref{section-layers} for details. In particular,
- setting, say, the line width at the beginning of a picture will not
- have an effect on the background picture.
-
- For this reason, it may be useful to setup the following style:
- \begin{stylekey}{/tikz/every on background layer}
- This style is executed at the beginning of each background
- layer. If you have a global setup in |every picture|, you should
- consider putting that part of it that concerns the graphics state
- into this style.
+ A scope with this option set 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'', see also
+ Section~\ref{section-layers} for details. In particular, setting, say, the
+ line width at the beginning of a picture will not have an effect on the
+ background picture.
+ For this reason, it may be useful to setup the following style:
+ %
+ \begin{stylekey}{/tikz/every on background layer}
+ This style is executed at the beginning of each background layer. If
+ you have a global setup in |every picture|, you should consider putting
+ that part of it that concerns the graphics state into this style.
+ %
\begin{codeexample}[]
\tikzset{
every picture/.style={line width=1ex},
every on background layer/.style={every picture}
-}
+}
\begin{tikzpicture}
\draw [->] (0,0) -- (2,1);
-
+
\scoped[on background layer]
\draw[red] (0,1) -- (2,0);
\end{tikzpicture}
\end{codeexample}
- \end{stylekey}
+ \end{stylekey}
\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
- style option must be given to the |{tikzpicture}| environment or to
- the |\tikz| command.
+ This style causes a rectangle to be drawn behind your graphic. This style
+ option must be given to the |{tikzpicture}| environment or to the |\tikz|
+ command.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[show background rectangle]
\draw (0,0) ellipse (10mm and 5mm);
\end{tikzpicture}
\end{codeexample}
- The size of the background rectangle is determined as follows:
- We start with the bounding box of the picture. Then, a certain
- separator distance is added on the sides. This distance can be
- different for the $x$- and $y$-directions and can be set using the
- following options:
- \begin{key}{/tikz/inner frame xsep=\meta{dimension} (initially 1ex)}
- Sets the additional horizontal separator distance for the
- background rectangle.
- \end{key}
- \begin{key}{/tikz/inner frame ysep=\meta{dimension} (initially 1ex)}
- Same for the vertical separator distance.
- \end{key}
- \begin{key}{/tikz/inner frame sep=\meta{dimension}}
- Sets the horizontal and vertical separator distances
- simultaneously.
- \end{key}
- The following two styles make setting the inner separator a bit
- easier to remember:
- \begin{stylekey}{/tikz/tight background}
- Sets the inner frame separator to 0pt. The background rectangle
- will have the size of the bounding box.
- \end{stylekey}
- \begin{stylekey}{/tikz/loose background}
- Sets the inner frame separator to 2ex.
- \end{stylekey}
+ %
+ The size of the background rectangle is determined as follows: We start
+ with the bounding box of the picture. Then, a certain separator distance is
+ added on the sides. This distance can be different for the $x$- and
+ $y$-directions and can be set using the following options:
+ %
+ \begin{key}{/tikz/inner frame xsep=\meta{dimension} (initially 1ex)}
+ Sets the additional horizontal separator distance for the background
+ rectangle.
+ \end{key}
+ %
+ \begin{key}{/tikz/inner frame ysep=\meta{dimension} (initially 1ex)}
+ Same for the vertical separator distance.
+ \end{key}
+ %
+ \begin{key}{/tikz/inner frame sep=\meta{dimension}}
+ Sets the horizontal and vertical separator distances simultaneously.
+ \end{key}
+ %
+ The following two styles make setting the inner separator a bit easier to
+ remember:
+ %
+ \begin{stylekey}{/tikz/tight background}
+ Sets the inner frame separator to 0pt. The background rectangle will
+ have the size of the bounding box.
+ \end{stylekey}
+ %
+ \begin{stylekey}{/tikz/loose background}
+ Sets the inner frame separator to 2ex.
+ \end{stylekey}
- You can influence how the background rectangle is rendered by setting
- the following style:
- \begin{stylekey}{/tikz/background rectangle (initially draw)}
- This style dictates how the background rectangle is drawn or
- filled. The default setting causes the path of the background
- rectangle to be drawn in the usual
- way. Setting this style to, say, |fill=blue!20| causes a light
- blue background to be added to the picture. You can also use more
- fancy settings as shown in the following example:
+ You can influence how the background rectangle is rendered by setting the
+ following style:
+ %
+ \begin{stylekey}{/tikz/background rectangle (initially draw)}
+ This style dictates how the background rectangle is drawn or filled.
+ The default setting causes the path of the background rectangle to be
+ drawn in the usual way. Setting this style to, say, |fill=blue!20|
+ causes a light blue background to be added to the picture. You can also
+ use more fancy settings as shown in the following example:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[background rectangle/.style=
- {double,ultra thick,draw=red,top color=blue,rounded corners},
+ {double,ultra thick,draw=red,top color=blue,rounded corners},
show background rectangle]
\draw (0,0) ellipse (10mm and 5mm);
\end{tikzpicture}
\end{codeexample}
- Naturally, no one in their right mind would use the above, but
- here is a nice background:
+ %
+ Naturally, no one in their right mind would use the above, but here is
+ a nice background:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[background rectangle/.style=
@@ -143,27 +150,30 @@ When this package is loaded, the following styles become available:
\draw (0,0) ellipse (10mm and 5mm);
\end{tikzpicture}
\end{codeexample}
- \end{stylekey}
+ \end{stylekey}
\end{stylekey}
\begin{stylekey}{/tikz/framed}
- This is a shorthand for |show background rectangle|.
+ This is a shorthand for |show background rectangle|.
\end{stylekey}
\begin{stylekey}{/tikz/show background grid}
- This style behaves similarly to the |show background rectangle|
- style, but it will not use a rectangle path, but a grid. The lower
- left and upper right corner of the grid is computed in the same way
- as for the background rectangle:
+ This style behaves similarly to the |show background rectangle| style, but
+ it will not use a rectangle path, but a grid. The lower left and upper
+ right corner of the grid is computed in the same way as for the background
+ rectangle:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[show background grid]
\draw (0,0) ellipse (10mm and 5mm);
\end{tikzpicture}
\end{codeexample}
- You can influence the background grid by setting
- the following style:
- \begin{stylekey}{/tikz/background grid (initially draw,help lines)}
- This style dictates how the background grid path is drawn.
+ %
+ You can influence the background grid by setting the following style:
+ %
+ \begin{stylekey}{/tikz/background grid (initially draw,help lines)}
+ This style dictates how the background grid path is drawn.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[background grid/.style={thick,draw=red,step=.5cm},
@@ -171,9 +181,11 @@ When this package is loaded, the following styles become available:
\draw (0,0) ellipse (10mm and 5mm);
\end{tikzpicture}
\end{codeexample}
- \end{stylekey}
- This option can be combined with the |framed| option (use the
- |framed| option first):
+ \end{stylekey}
+ %
+ This option can be combined with the |framed| option (use the |framed|
+ option first):
+ %
\begin{codeexample}[]
\tikzset{background grid/.style={thick,draw=red,step=.5cm},
background rectangle/.style={rounded corners,fill=yellow}}
@@ -181,16 +193,18 @@ When this package is loaded, the following styles become available:
\draw (0,0) ellipse (10mm and 5mm);
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/gridded}
- This is a shorthand for |show background grid|.
+ This is a shorthand for |show background grid|.
\end{stylekey}
\begin{stylekey}{/tikz/show background top}
- This style causes a single line to be drawn at the top of the
- background rectangle. Normally, the line coincides exactly with the
- top line of the background rectangle:
+ This style causes a single line to be drawn at the top of the background
+ rectangle. Normally, the line coincides exactly with the top line of the
+ background rectangle:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[
background rectangle/.style={fill=yellow},
@@ -198,10 +212,12 @@ When this package is loaded, the following styles become available:
\draw (0,0) ellipse (10mm and 5mm);
\end{tikzpicture}
\end{codeexample}
- The following option allows you to lengthen (or shorten) the line:
- \begin{key}{/tikz/outer frame xsep=\meta{dimension} (initially 0pt)}
- The \meta{dimension} is added at the left and right side of the
- line.
+ %
+ The following option allows you to lengthen (or shorten) the line:
+ %
+ \begin{key}{/tikz/outer frame xsep=\meta{dimension} (initially 0pt)}
+ The \meta{dimension} is added at the left and right side of the line.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[background rectangle/.style={fill=yellow},
@@ -211,14 +227,17 @@ When this package is loaded, the following styles become available:
\draw (0,0) ellipse (10mm and 5mm);
\end{tikzpicture}
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/outer frame ysep=\meta{dimension} (initially 0pt)}
- This option does not apply to the top line, but to the left and
- right lines, see below.
- \end{key}
- \begin{key}{/tikz/outer frame sep=\meta{dimension}}
- Sets both the $x$- and $y$-separation.
- \end{key}
+ \end{key}
+ %
+ \begin{key}{/tikz/outer frame ysep=\meta{dimension} (initially 0pt)}
+ This option does not apply to the top line, but to the left and right
+ lines, see below.
+ \end{key}
+ %
+ \begin{key}{/tikz/outer frame sep=\meta{dimension}}
+ Sets both the $x$- and $y$-separation.
+ \end{key}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[background rectangle={fill=blue!20},
@@ -230,9 +249,11 @@ When this package is loaded, the following styles become available:
\draw (0,0) ellipse (10mm and 5mm);
\end{tikzpicture}
\end{codeexample}
- You can influence how the line is drawn grid by setting
- the following style:
- \begin{stylekey}{/tikz/background top (initially draw)}
+ %
+ You can influence how the line is drawn grid by setting the following
+ style:
+ %
+ \begin{stylekey}{/tikz/background top (initially draw)}
\begin{codeexample}[]
\tikzset{background rectangle/.style={fill=blue!20},
background top/.style={draw=blue!50,line width=1ex}}
@@ -240,22 +261,23 @@ When this package is loaded, the following styles become available:
\draw (0,0) ellipse (10mm and 5mm);
\end{tikzpicture}
\end{codeexample}
- \end{stylekey}
+ \end{stylekey}
\end{stylekey}
\begin{stylekey}{/tikz/show background bottom}
- Works like the style for the top line.
+ Works like the style for the top line.
\end{stylekey}
+
\begin{stylekey}{/tikz/show background left}
- Works similarly.
+ Works similarly.
\end{stylekey}
+
\begin{stylekey}{/tikz/show background right}
- Works similarly.
+ Works similarly.
\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-calc.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calc.tex
index 5641ec11b6b..49ece07ff9e 100644
--- 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
@@ -1,6 +1,7 @@
+
\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}.
+ 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 f0e2e8c8e1c..6d1f3a3f4f4 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
@@ -9,160 +9,166 @@
\section{Calendar Library}
-
\label{section-calender}
\begin{tikzlibrary}{calendar}
- The library defines the |\calendar| command, which can be used to
- typeset calendars. The command relies on the |\pgfcalendar| command
- from the |pgfcalendar| package, which is loaded automatically.
+ The library defines the |\calendar| command, which can be used to typeset
+ calendars. The command relies on the |\pgfcalendar| command from the
+ |pgfcalendar| package, which is loaded automatically.
- The |\calendar| command is quite configurable, allowing you to
- produce all kinds of different calendars.
+ The |\calendar| command is quite configurable, allowing you to produce all
+ kinds of different calendars.
\end{tikzlibrary}
\subsection{Calendar Command}
-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).
+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).
\begin{command}{\calendar \meta{calendar specification}|;|}
- The syntax for this command is similar to commands like |\node| or
- |\matrix|. However, it has its complete own parser and only those
- commands described in the following will be recognized, nothing
- else. Note, furthermore, that a \meta{calendar specification} is not
- a path specification, indeed, no path is created for the calendar.
-
- \medskip
- \textbf{The specification syntax.}
- The \meta{calendar specification} must be a sequence of
- elements, each of which has one of the following structures:
- \begin{itemize}
- \item |[|\meta{options}|]|
-
- You provide \meta{options} in square brackets as
- 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
- 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}|)|
-
- This has the same effect as saying |[at=(|\meta{coordinate}|)]|.
- \item |if (|\meta{date condition}|)| \meta{options or
- commands}\opt{|else|\meta{else options or commands}}
-
- The effect of such an |if| is explained later.
+ The syntax for this command is similar to commands like |\node| or
+ |\matrix|. However, it has its complete own parser and only those commands
+ described in the following will be recognized, nothing else. Note,
+ furthermore, that a \meta{calendar specification} is not a path
+ specification, indeed, no path is created for the calendar.
+
+
+ \medskip
+ \textbf{The specification syntax.}
+ The \meta{calendar specification} must be a sequence of elements, each of
+ which has one of the following structures:
+ %
+ \begin{itemize}
+ \item |[|\meta{options}|]|
+
+ You provide \meta{options} in square brackets as 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 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}|)|
+
+ This has the same effect as saying |[at=(|\meta{coordinate}|)]|.
+ \item |if (|\meta{date condition}|)| \meta{options or commands}\opt{|else|\meta{else options or commands}}
+
+ The effect of such an |if| is explained later.
\end{itemize}
- At the beginning of every calendar, the following style is used:
- \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
- each day of a range of dates. This range of dates is set using the
- following option:
- \begin{key}{/tikz/dates=\meta{start date}| to |\meta{end date}}
- This
- option specifies the date range. Both the start and end date are
- specified as described on page~\pageref{calendar-date-format}. In
- short: You can provide ISO-format type dates like |2006-01-02|, you
- can replace the day of month by |last| to refer to the last day of a
- month (so |2006-02-last| is the same as |2006-02-28|), and you can
- add a plus sign followed by a number to specify an offset (so
- |2006-01-01+-1| is the same as |2005-12-31|).
- \end{key}
- It will be useful to fix two pieces of terminology for the following
- descriptions: The |\calendar| command iterates over the dates in the
- range. The \emph{current date} refers to the current date the
- command is processing as it iterates over the dates. For each
- 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
- |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:
-
+ At the beginning of every calendar, the following style is used:
+ %
+ \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 each
+ day of a range of dates. This range of dates is set using the following
+ option:
+ %
+ \begin{key}{/tikz/dates=\meta{start date}| to |\meta{end date}}
+ This option specifies the date range. Both the start and end date are
+ specified as described on page~\pageref{calendar-date-format}. In
+ short: You can provide ISO-format type dates like |2006-01-02|, you can
+ replace the day of month by |last| to refer to the last day of a month
+ (so |2006-02-last| is the same as |2006-02-28|), and you can add a plus
+ sign followed by a number to specify an offset (so |2006-01-01+-1| is
+ the same as |2005-12-31|).
+ \end{key}
+ %
+ It will be useful to fix two pieces of terminology for the following
+ descriptions: The |\calendar| command iterates over the dates in the range.
+ The \emph{current date} refers to the current date the command is
+ processing as it iterates over the dates. For each 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 |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];
\end{codeexample}
- \medskip
- \textbf{Changing the spacing.}
- In the above calendar, the spacing between the days is determined by
- numerous options. Most arrangements do not use all of these
- options, but only those that apply naturally.
- \begin{key}{/tikz/day xshift=\meta{dimension} (initially 3.5ex)}
- Specifies the
- horizontal shift between days. This is not the gap between days,
- but the shift between the anchors of their nodes.
+
+ \medskip
+ \textbf{Changing the spacing.}
+ In the above calendar, the spacing between the days is determined by
+ numerous options. Most arrangements do not use all of these options, but
+ only those that apply naturally.
+ %
+ \begin{key}{/tikz/day xshift=\meta{dimension} (initially 3.5ex)}
+ Specifies the 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];
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/day yshift=\meta{dimension} (initially 3ex)}
- Specifies the
- vertical shift between days. Again, this is the shift between the
- anchors of their nodes.
+ \end{key}
+ %
+ \begin{key}{/tikz/day yshift=\meta{dimension} (initially 3ex)}
+ Specifies the 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];
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/month xshift=\meta{dimension}}
- Specifies an additional horizontal shift between different
- months.
- \end{key}
- \begin{key}{/tikz/month yshift=\meta{dimension}}
- Specifies an
- additional vertical shift between different months.
+ \end{key}
+ %
+ \begin{key}{/tikz/month xshift=\meta{dimension}}
+ Specifies an additional horizontal shift between different months.
+ \end{key}
+ %
+ \begin{key}{/tikz/month yshift=\meta{dimension}}
+ Specifies an additional vertical shift between different months.
+ %
\begin{codeexample}[]
\tikz \calendar[dates=2000-01-01 to 2000-02-last,week list,
month yshift=0pt];
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \calendar[dates=2000-01-01 to 2000-02-last,week list,
month yshift=1cm];
\end{codeexample}
- \end{key}
-
- \medskip
- \textbf{Changing the position of the calendar.}
- The calendar is placed in such a way that, normally, the anchor of
- the first day label is at the origin. This can be changed by using
- the |at| option. When you say |at={(1,1)}|, this anchor of the first
- day will lie at coordinate $(1,1)$.
-
- In general, arrangements will not always place the anchor of the
- first day at the origin. Sometimes, additional spacing rules get in
- the way. There are different ways of addressing this problem: First,
- you can just ignore it. Since calendars are often placed in their own
- |{tikzpicture}| and since their size if computed automatically, the
- exact position of the origin often does not matter at all. Second,
- you can put the calendar inside a node as in
- |...node {\tikz \calendar...}|. This allows you to position the node
- in the normal ways using the node's anchors. Third, you can be very
- clever and use a single-cell matrix. The advantage is that a matrix
- allows you to provide any anchor of any node inside the matrix as an
- anchor for the whole matrix. For example, the following calendar is
- placed in such a way the center of 2000-01-20 lies on the position
- $(2,2)$:
+ \end{key}
+
+
+ \medskip
+ \textbf{Changing the position of the calendar.}
+ The calendar is placed in such a way that, normally, the anchor of the
+ first day label is at the origin. This can be changed by using the |at|
+ option. When you say |at={(1,1)}|, this anchor of the first day will lie at
+ coordinate $(1,1)$.
+
+ In general, arrangements will not always place the anchor of the first day
+ at the origin. Sometimes, additional spacing rules get in the way. There
+ are different ways of addressing this problem: First, you can just ignore
+ it. Since calendars are often placed in their own |{tikzpicture}| and since
+ their size if computed automatically, the exact position of the origin
+ often does not matter at all. Second, you can put the calendar inside a
+ node as in |...node {\tikz \calendar...}|. This allows you to position the
+ node in the normal ways using the node's anchors. Third, you can be very
+ clever and use a single-cell matrix. The advantage is that a matrix allows
+ you to provide any anchor of any node inside the matrix as an anchor for
+ the whole matrix. For example, the following calendar is placed in such a
+ way the center of 2000-01-20 lies on the position $(2,2)$:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -170,40 +176,47 @@ environments (similar to, say, the |\draw| command).
{ \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,
- 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.}
- As mentioned before, each day in the above calendar is produced by
- an execution of the |\tikzdaycode|. Each time this code is executed,
- the coordinate system will have been set up appropriately to place
- the day of the month correctly. You can change both the code and its
- appearance using the following options.
- \begin{key}{/tikz/day code=\meta{code} (initially \normalfont see below)}
- This option allows you to change the code that is executed for
- each day. The default is to create a node with an appropriate
- name, but you can change this:
+ %
+ Unfortunately, the matrix-base positions, which is the cleanest way, 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.}
+ As mentioned before, each day in the above calendar is produced by an
+ execution of the |\tikzdaycode|. Each time this code is executed, the
+ coordinate system will have been set up appropriately to place the day of
+ the month correctly. You can change both the code and its appearance using
+ the following options.
+ %
+ \begin{key}{/tikz/day code=\meta{code} (initially \normalfont see below)}
+ This option allows you to change the code that is executed for each
+ day. The default is to create a node with an appropriate 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);}];
\end{codeexample}
- The default code is the following:
+ %
+ The default code is the following:
+ %
\begin{codeexample}[code only]
\node[name=\pgfcalendarsuggestedname,every day]{\tikzdaytext};
\end{codeexample}
- The first part causes the day nodes to be accessible via the
- following names: If \meta{name} is the name given to the calendar
- via a |name=| option or via the specification element
- |(|\meta{name}|)|, then |\pgfcalendarsuggestedname| will expand to
- \meta{name}|-|\meta{date}, where \meta{date} is the date of the
- day that is currently being processed in ISO format .
+ %
+ The first part causes the day nodes to be accessible via the following
+ names: If \meta{name} is the name given to the calendar via a |name=|
+ option or via the specification element |(|\meta{name}|)|, then
+ |\pgfcalendarsuggestedname| will expand to \meta{name}|-|\meta{date},
+ where \meta{date} is the date of the 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 containing the |1|
- for this date will be names |mycal-2006-01-01|. You can later
- reference this node.
+ For example, if January 1, 2006 is being processed and the 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}[]
\begin{tikzpicture}
\calendar (mycal) [dates=2000-01-01 to 2000-01-31,week list];
@@ -211,167 +224,176 @@ environments (similar to, say, the |\draw| command).
\draw[red] (mycal-2000-01-20) circle (4pt);
\end{tikzpicture}
\end{codeexample}
- \end{key}
+ \end{key}
- \begin{key}{/tikz/day text=\meta{text}}
- This option changes the setting of the |\tikzdaytext|. By default,
- this macro simply yields the current day of month, but you can
- change it arbitrarily. Here is a silly example:
+ \begin{key}{/tikz/day text=\meta{text}}
+ This option changes the setting of the |\tikzdaytext|. By default, this
+ macro simply yields the current day of month, but you can 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];
\end{codeexample}
- More useful examples are based on using the |\%| command. This
- command is redefined inside a |\pgfcalendar| to mean the same as
- |\pgfcalendarshorthand|. (The original meaning of |\%| is lost
- inside the calendar, you need to save if before the calendar if
- you really need it.)
-
- 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 (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
- textual, and |.| means textual, abbreviated). For example |\%d0|
- gives the day with a leading zero (for more details see
- the description of |\pgfcalendarshorthand| on
- page~\pageref{pgfcalendarshorthand}).
-
- Let us redefine the |day text| so that it yields the day with a
- leading zero:
+ %
+ More useful examples are based on using the |\%| command. This command
+ is redefined inside a |\pgfcalendar| to mean the same as
+ |\pgfcalendarshorthand|. (The original meaning of |\%| is lost inside
+ the calendar, you need to save if before the calendar if you really
+ need it.)
+
+ 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 (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 textual, and |.| means textual, abbreviated).
+ For example |\%d0| gives the day with a leading zero (for more details
+ see the description of |\pgfcalendarshorthand| on
+ page~\pageref{pgfcalendarshorthand}).
+
+ Let us redefine the |day text| so that it yields the day with a leading
+ zero:
+ %
\begin{codeexample}[leave comments]
\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,
day text=\%d0];
\end{codeexample}
- \end{key}
+ \end{key}
- \begin{key}{/tikz/every day (initially anchor=base east)}
- This style is executed by the default node code for each day.
- The |every day| style is useful for changing the way days
- look. For example, let us make all days red:
+ \begin{key}{/tikz/every day (initially anchor=base east)}
+ This style is executed by the default node code for each day. The
+ |every day| style is useful for changing the way days look. For
+ example, let us make all days red:
+ %
\begin{codeexample}[leave comments]
\tikz[every day/.style=red]
\calendar[dates=2000-01-01 to 2000-01-31,week list];
\end{codeexample}
- \end{key}
+ \end{key}
- \medskip
- \textbf{Changing the appearance of month and year labels.}
- In addition to the days of a calendar, labels for the months and
- even years (for really long calendars) can be added. These labels
- are only added once per month or year and this is not done by
- default. Rather, special styles starting with |month label|
- place these labels and make them visible:
+ \medskip
+ \textbf{Changing the appearance of month and year labels.}
+ In addition to the days of a calendar, labels for the months and even years
+ (for really long calendars) can be added. These labels are only added once
+ per month or year and this is not done by default. Rather, special styles
+ starting with |month label| place these labels and make them visible:
+ %
\begin{codeexample}[]
\tikz \calendar[dates=2000-01-01 to 2000-02-last,week list,
month label above centered];
\end{codeexample}
- The following options change the appearance of the month and year
- label:
- \begin{key}{/tikz/month code=\meta{code} (initially \normalfont see below)}
- This option allows you to specify what the macro |\tikzmonthcode|
- should expand to.
+ The following options change the appearance of the month and year label:
+ %
+ \begin{key}{/tikz/month code=\meta{code} (initially \normalfont see below)}
+ This option allows you to specify what the macro |\tikzmonthcode|
+ should expand to.
- By default, the |\tikzmonthcode| it is set to
+ By default, the |\tikzmonthcode| it is set to
+ %
\begin{codeexample}[code only]
\node[every month]{\tikzmonthtext};
\end{codeexample}
- Note that this node is not named by default.
- \end{key}
+ %
+ Note that this node is not named by default.
+ \end{key}
- \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.
+ \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.
+ %
\begin{codeexample}[leave comments]
\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,
month label above centered,
month text=\textcolor{red}{\%mt} \%y-];
\end{codeexample}
- \end{key}
-
- \begin{stylekey}{/tikz/every month (initially \normalfont empty)}
- This style can be used to change the
- appearance of month labels.
- \end{stylekey}
-
- \begin{key}{/tikz/year code=\meta{code}}
- Works like |month code|, only for years.
- \end{key}
-
- \begin{key}{/tikz/year text=\meta{text}}
- Works like |month text|, only for years.
- \end{key}
-
-
- \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
- conditionals. There are two equivalent way of specifying such a
- conditional. First, you can add the text
- |if (|\meta{conditions}|) |\meta{code or options} to your
- \meta{calendar specification}, possibly followed by |else|\meta{else
- 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{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.
- \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{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.
-
- The command |\ifdate| and, thereby, |\pgfcalendarifdate| are used
- to evaluate the \meta{conditions}, see
- page~\pageref{pgfcalendarifdate} for a complete list of possible
- tests. The most useful tests are: Tests like |Monday| and so on,
- |workday| for the days Monday to Friday, |weekend| for Saturday
- and Sunday, |equals| for testing whether the current date equals a
- given date, |at least| and |at least| for comparing the current
- date with a given date.
- \item If the date passes the check, the \meta{code or options} is
- evaluated in a manner to be described in a moment; if the date
- fails, the \meta{else code or options} is evaluated, if present.
-
- The \meta{code or options} can either be some code. This is
- indicated by surrounding the code with curly braces. It can also
- be a list of \tikzname\ options. This is indicated by surrounding
- the options with square brackets. For example in the date test
- |if (Sunday) {\draw...} else {\fill...}| there are two pieces of
- code involved. By comparison, |if (Sunday) [red] else [green]|
- involves two options.
-
- If \meta{code or options} is code, it is simply executed (for the
- current day). If it is a list of options, these options are passed
- to a scope surrounding the current date.
- \end{enumerate}
- Let us now have a look at some examples. First, we use a conditional
- to make all Sundays red.
+ \end{key}
+
+ \begin{stylekey}{/tikz/every month (initially \normalfont empty)}
+ This style can be used to change the appearance of month labels.
+ \end{stylekey}
+
+ \begin{key}{/tikz/year code=\meta{code}}
+ Works like |month code|, only for years.
+ \end{key}
+
+ \begin{key}{/tikz/year text=\meta{text}}
+ Works like |month text|, only for years.
+ \end{key}
+
+
+ \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
+ conditionals. There are two equivalent way of specifying such a
+ conditional. First, you can add the text
+ |if (|\meta{conditions}|) |\meta{code or options} to your \meta{calendar
+ specification}, possibly followed by |else|\meta{else 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{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.
+ \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{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.
+
+ The command |\ifdate| and, thereby, |\pgfcalendarifdate| are used
+ to evaluate the \meta{conditions}, see
+ page~\pageref{pgfcalendarifdate} for a complete list of possible
+ tests. The most useful tests are: Tests like |Monday| and so on,
+ |workday| for the days Monday to Friday, |weekend| for Saturday and
+ Sunday, |equals| for testing whether the current date equals a
+ given date, |at least| and |at least| for comparing the current
+ date with a given date.
+ \item If the date passes the check, the \meta{code or options} is
+ evaluated in a manner to be described in a moment; if the date
+ fails, the \meta{else code or options} is evaluated, if present.
+
+ The \meta{code or options} can either be some code. This is
+ indicated by surrounding the code with curly braces. It can also be
+ a list of \tikzname\ options. This is indicated by surrounding the
+ options with square brackets. For example in the date test
+ |if (Sunday) {\draw...} else {\fill...}| there are two pieces of
+ code involved. By comparison, |if (Sunday) [red] else [green]|
+ involves two options.
+
+ If \meta{code or options} is code, it is simply executed (for the
+ current day). If it is a list of options, these options are passed
+ to a scope surrounding the current date.
+ \end{enumerate}
+ %
+ Let us now have a look at some examples. First, we use a conditional to
+ make all Sundays red.
+ %
\begin{codeexample}[]
\tikz
\calendar
[dates=2000-01-01 to 2000-01-31,week list]
if (Sunday) [red];
\end{codeexample}
- Next, let us do something on a specific date:
+ %
+ Next, let us do something on a specific date:
+ %
\begin{codeexample}[]
\tikz
\calendar
@@ -379,10 +401,12 @@ environments (similar to, say, the |\draw| command).
if (Sunday) [red]
if (equals=2000-01-20) {\draw (0,0) circle (8pt);};
\end{codeexample}
- You might wonder why the circle seems to be ``off'' the
- date. Actually, it is centered on the date, it is just that the date
- label uses the |base east| anchor, which shifts the label up and
- right. To overcome this problem we can change the anchor:
+ %
+ You might wonder why the circle seems to be ``off'' the date. Actually, it
+ is centered on the date, it is just that the date label uses the
+ |base east| anchor, which shifts the label up and right. To overcome this
+ problem we can change the anchor:
+ %
\begin{codeexample}[]
\tikz [every day/.style={anchor=mid}]
\calendar
@@ -390,113 +414,115 @@ environments (similar to, say, the |\draw| command).
if (Sunday) [red]
if (equals=2000-01-20) {\draw (0,0) circle (8pt);};
\end{codeexample}
- However, the single day dates are now no longer aligned
- 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.
-
- \medskip
- \textbf{The current date code.}
- As mentioned earlier, for each date in the calendar the current date
- code is executed. It is the job of this code to shift around date
- 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 date code consists of the following parts, in this order:
- \begin{enumerate}
- \item The before-scope code.
- \item A scope is opened.
- \item The at-begin-scope code.
- \item All date-ifs from the \meta{calendar specification} are
- executed.
- \item The at-end-scope code.
- \item The scope is closed.
- \item The after-scope code.
- \end{enumerate}
- All of the codes mentioned above can be changed using appropriate
- options, see below. In case you wonder why so many are needed, the
- reason is that the current date code as a whole is not
- surrounded by a scope or \TeX\ group. This means that code executed
- in the before-scope code and in the after-scope code has an effect
- on all following days. For example, if the after-scope code modifies
- the transformation matrix by shifting everything downward, all
- following days will be shifted downward. If each day does this, you
- get a list of days, one below the other.
-
- However, you do not always want code to have an effect on everything
- that follows. For instance, if a day has the date-if
- |if (Sunday) [red]|, we only want this Sunday to red, not all
- following days also. Similarly, sometimes it is easier to compute
- the position of a day relative to a fixed origin and we do not want
- any modifications of the transformation matrix to have an effect
- outside the scope.
-
- By cleverly adjusting the different codes, all sorts of different
- day arrangements are possible.
-
- \begin{key}{/tikz/execute before day scope=\meta{code}}
- The \meta{code} is executed before everything else for each
- 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.
- \end{key}
- \begin{key}{/tikz/execute at begin day scope=\meta{code}}
- This code is execute before everything else inside the scope of
- the current date. Again, the effect is accumulative.
- \end{key}
- \begin{key}{/tikz/execute at end day scope=\meta{code}}
- This code is executed just before the day scope is
- closed. The effect is also accumulative, however, in reverse
- order. This is useful to pair, say, |\scope| and |\endscope|
- 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
- scope. The accumulation is also in reverse.
- \end{key}
+ %
+ However, the single day dates are now no longer aligned 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.
+
+ \medskip
+ \textbf{The current date code.}
+ As mentioned earlier, for each date in the calendar the current date code
+ is executed. It is the job of this code to shift around date 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 date code consists of the following parts, in this order:
+ %
+ \begin{enumerate}
+ \item The before-scope code.
+ \item A scope is opened.
+ \item The at-begin-scope code.
+ \item All date-ifs from the \meta{calendar specification} are executed.
+ \item The at-end-scope code.
+ \item The scope is closed.
+ \item The after-scope code.
+ \end{enumerate}
+ %
+ All of the codes mentioned above can be changed using appropriate options,
+ see below. In case you wonder why so many are needed, the reason is that
+ the current date code as a whole is not surrounded by a scope or \TeX\
+ group. This means that code executed in the before-scope code and in the
+ after-scope code has an effect on all following days. For example, if the
+ after-scope code modifies the transformation matrix by shifting everything
+ downward, all following days will be shifted downward. If each day does
+ this, you get a list of days, one below the other.
+
+ However, you do not always want code to have an effect on everything that
+ follows. For instance, if a day has the date-if |if (Sunday) [red]|, we
+ only want this Sunday to red, not all following days also. Similarly,
+ sometimes it is easier to compute the position of a day relative to a fixed
+ origin and we do not want any modifications of the transformation matrix to
+ have an effect outside the scope.
+
+ By cleverly adjusting the different codes, all sorts of different day
+ arrangements are possible.
+
+ \begin{key}{/tikz/execute before day scope=\meta{code}}
+ The \meta{code} is executed before everything else for each 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.
+ \end{key}
+ %
+ \begin{key}{/tikz/execute at begin day scope=\meta{code}}
+ This code is execute before everything else inside the scope of the
+ current date. Again, the effect is accumulative.
+ \end{key}
+ %
+ \begin{key}{/tikz/execute at end day scope=\meta{code}}
+ This code is executed just before the day scope is closed. The effect
+ is also accumulative, however, in reverse order. This is useful to
+ pair, say, |\scope| and |\endscope| 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
+ scope. The accumulation is also in reverse.
+ \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.
+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.
\subsubsection{Creating a Simple List of Days}
-We start with a list of 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:
+We start with a list of 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:
+%
\begin{codeexample}[]
\tikz
\calendar [dates=2000-01-01 to 2000-01-08,
execute after day scope=
{\pgftransformyshift{-1em}}];
\end{codeexample}
-Clearly, we can use this approach to create day lists going up,
-down, right, left, or even diagonally.
+%
+Clearly, we can use this approach to create day lists going up, down, right,
+left, or even diagonally.
\subsubsection{Adding a Month Label}
-We now want to add a month label to the left of the beginning of each
-month. The idea is to do two things:
+We now want to add a month label to the left of the beginning of each month.
+The idea is to do two things:
+%
\begin{enumerate}
-\item We add code that is executed only on the first of each month.
-\item The code is executed before the actual day is rendered. This
- ensures that options applying to the days do not affect the month
- rendering.
+ \item We add code that is executed only on the first of each month.
+ \item The code is executed before the actual day is rendered. This ensures
+ that options applying to the days do not affect the month rendering.
\end{enumerate}
-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 inadvertently ``leak outside.''
+%
+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
+inadvertently ``leak outside''.
+%
\begin{codeexample}[]
\tikz
\calendar
@@ -508,26 +534,27 @@ settings to not inadvertently ``leak outside.''
\end{codeexample}
In the above code we used the |\ifdate|\marg{condition}\marg{then
- code}\marg{else code} command, which is described on
-page~\pageref{ifdate} in detail and which has much the same effect as
-|if (|\meta{condition}|)|\marg{then code}| else |\marg{else code}, but
-works in normal code.
+code}\marg{else code} command, which is described on page~\pageref{ifdate} in
+detail and which has much the same effect as
+|if (|\meta{condition}|)|\marg{then code}| else |\marg{else code}, but works in
+normal code.
\subsubsection{Creating a Week List Arrangement}
-Let us now address a more complicated arrangement: A week list. In
-this arrangement there is line for each week. The horizontal placement
-of the days is thus that all Mondays lie below each other, likewise
-for all Tuesdays, and so on.
-
-In order to typeset this arrangement, we can use the following
-approach: The origin of the coordinate system rests at the anchor for
-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.
+Let us now address a more complicated arrangement: A week list. In this
+arrangement there is line for each week. The horizontal placement of the days
+is thus that all Mondays lie below each other, likewise for all Tuesdays, and
+so on.
+
+In order to typeset this arrangement, we can use the following approach: The
+origin of the coordinate system rests at the anchor for 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.
+%
\begin{codeexample}[]
\tikz
\calendar
@@ -543,19 +570,19 @@ 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 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
-week, this means that each row has to have an individual offset.
-
-One possible way is to use the following approach: After each month
-(or at the beginning of each month) we advance the vertical position
-of the offset by one line. For horizontal placement, inside the day
-scope we locally shift the day by its day of month. Furthermore, we
-must additionally shift the day to ensure that the first day of the
-month lies on the correct day of week column. For this, we remember
-this day of week the first time we see it.
+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 week, this means that each row has to
+have an individual offset.
+
+One possible way is to use the following approach: After each month (or at the
+beginning of each month) we advance the vertical position of the offset by one
+line. For horizontal placement, inside the day scope we locally shift the day
+by its day of month. Furthermore, we must additionally shift the day to ensure
+that the first day of the month lies on the correct day of week column. For
+this, we remember this day of week the first time we see it.
+%
\begin{codeexample}[]
\newcount\mycount
\tikz
@@ -582,90 +609,98 @@ this day of week the first time we see it.
\subsection{Arrangements}
-An \emph{arrangement} specifies how the days of calendar are arranged
-on the page. The calendar library defines a number of predefined
-arrangements.
+An \emph{arrangement} specifies how the days of calendar are arranged 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.
+We start with arrangements in which the days are listed in a long line.
\begin{stylekey}{/tikz/day list downward}
- This style causes the days of a month to be typeset one below the
- other. The shift between days is given by |day yshift|. Between
- month an additional shift of |month yshift| is added.
+ This style causes the days of a month to be typeset one below the other.
+ The shift between days is given by |day yshift|. Between month an
+ additional shift of |month yshift| is added.
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list downward,month yshift=1em];
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/day list upward}
- works as above, only the list grows upward instead of downward.
+ Works as above, only the list grows upward instead of downward.
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list upward,month yshift=1em];
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/day list right}
- This style also works as before, but the list of days grows to the
- right. Instead of |day yshift| and |month yshift|, the values of
- |day xshift| and |month xshift| are used.
+ This style also works as before, but the list of days grows to the right.
+ Instead of |day yshift| and |month yshift|, the values of |day xshift| and
+ |month xshift| are used.
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list right,month xshift=1em];
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/day list left}
- As above, but the list grows left.
+ As above, but the list grows left.
\end{stylekey}
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
- of |day xshift| is used for the distance between days in each week
- row, the value of |day yshift| is used for the distance between
- rows. In both cases, ``distance'' refers to the distance between
- the anchors of the nodes of the days (or, more generally, the
- distance between the origins of the little pictures created for each
- day).
-
- The days inside each week are shifted such that Monday is always
- at the first position (to change this, you need to copy and then
- modify the code appropriately). If the date range does not start on
- a Monday, the first line will not start in the first column, but
- rather in the column appropriate for the first date in the range.
-
- At the beginning of each month (except for the first month in the
- range) an additional vertical space of |month yshift| is added. If
- this is set to |0pt| you get a continuous list of days.
+ This style creates one row for each week in the range. The value of
+ |day xshift| is used for the distance between days in each week row, the
+ value of |day yshift| is used for the distance between rows. In both cases,
+ ``distance'' refers to the distance between the anchors of the nodes of the
+ days (or, more generally, the distance between the origins of the little
+ pictures created for each day).
+
+ The days inside each week are shifted such that Monday is always at the
+ first position (to change this, you need to copy and then modify the code
+ appropriately). If the date range does not start on a Monday, the first
+ line will not start in the first column, but rather in the column
+ appropriate for the first date in the range.
+
+ At the beginning of each month (except for the first month in the range) an
+ additional vertical space of |month yshift| is added. If this is set to
+ |0pt| you get a continuous list of days.
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-01-01 to 2000-02-last,week list];
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-01-01 to 2000-02-last,week list,
month yshift=0pt];
\end{codeexample}
+ %
\end{stylekey}
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 shift, |month yshift| is used.
+ 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
+ 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.
+ 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.
+ %
\begin{codeexample}[]
\sffamily\scriptsize
\tikz
@@ -673,139 +708,161 @@ The following arrangement gives a very compact view of a whole year.
month list,month label left,month yshift=1.25em]
if (Sunday) [black!50];
\end{codeexample}
+ %
\end{stylekey}
+
\subsection{Month Labels}
-For many calendars you may wish to add a label to each month. We have
-already covered how month nodes are created and rendered in the
-description of the |\calendar| command: use |month text|,
-|every month|, and also |month code| (if necessary) to change the
-appearance of the month labels.
+For many calendars you may wish to add a label to each month. We have already
+covered how month nodes are created and rendered in the description of the
+|\calendar| command: use |month text|, |every month|, and also |month code| (if
+necessary) to change the appearance of the month labels.
-What we have not yet covered is where these labels are placed. By
-default, they are not placed at all as there is no good ``default
-position'' for them. Instead, you can use one of the following options
-to specify a position for the labels:
+What we have not yet covered is where these labels are placed. By default, they
+are not placed at all as there is no good ``default position'' for them.
+Instead, you can use one of the following options to specify a position for the
+labels:
+%
\begin{stylekey}{/tikz/month label left}
- Places the month label to the left of the first day of the
- month. (For |week list| and |month list| where a month does not
- start on a Monday, the position is chosen ``as if'' the month had
- started on a Monday -- which is usually exactly what you want.)
+ Places the month label to the left of the first day of the month. (For
+ |week list| and |month list| where a month does not start on a Monday, the
+ position is chosen ``as if'' the month had started on a Monday -- which is
+ usually exactly what you want.)
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list downward,month yshift=1em,
month label left];
\end{codeexample}
+ %
\end{stylekey}
+
\begin{stylekey}{/tikz/month label left vertical}
- This style works like the above style, only the label is rotated
- counterclockwise by 90 degrees.
+ This style works like the above style, only the label is rotated
+ counterclockwise by 90 degrees.
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list downward,month yshift=1em,
month label left vertical];
\end{codeexample}
+ %
\end{stylekey}
+
\begin{stylekey}{/tikz/month label right}
- This style places the month label to the right of the row in which
- the first day of the month lies. This means that for a day list the
- label is to the right of the first day, for a week list it is to the
- right of the first week, and for a month list it is to the right of
- the whole month.
+ This style places the month label to the right of the row in which the
+ first day of the month lies. This means that for a day list the label is to
+ the right of the first day, for a week list it is to the right of the first
+ week, and for a month list it is to the right of the whole month.
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list downward,month yshift=1em,
month label right];
\end{codeexample}
+ %
\end{stylekey}
+
\begin{stylekey}{/tikz/month label right vertical}
- Works as above, only the label is rotated clockwise by 90 degrees.
+ Works as above, only the label is rotated clockwise by 90 degrees.
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list downward,month yshift=1em,
month label right vertical];
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/month label above left}
- This style places the month label above of the row of the first day,
- flushed left to the leftmost column. The amount by which the label
- is raised is fixed to |1.25em|; use the |yshift| option with the
- month node to modify this.
+ This style places the month label above of the row of the first day,
+ flushed left to the leftmost column. The amount by which the label is
+ raised is fixed to |1.25em|; use the |yshift| option with the month node to
+ modify this.
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list right,month xshift=1em,
month label above left];
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-01-20 to 2000-02-10,
week list,month label above left];
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/month label above centered}
- works as above, only the label is centered above the row containing
- the first day.
+ Works as above, only the label is centered above the row containing the
+ first day.
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-02-01 to 2000-02-last,
day list right,month label above centered];
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-01-20 to 2000-02-10,
week list,month label above centered];
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/month label above right}
- works as above, but flushed right
+ Works as above, but flushed right
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-01-20 to 2000-02-10,
week list,month label above right];
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/month label below left}
- Works like |month label above left|, only the label is placed below
- the row. This placement is not really useful with the |week list|
- arrangement, but rather with the |day list right| or |month list|
- arrangement.
+ Works like |month label above left|, only the label is placed below the
+ row. This placement is not really useful with the |week list| arrangement,
+ but rather with the |day list right| or |month list| arrangement.
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-02-01 to 2000-02-last,
day list right,month label below left];
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/month label below centered}
- Works like |month label above centered|, only below.
+ Works like |month label above centered|, only below.
+ %
\begin{codeexample}[]
\tikz
\calendar [dates=2000-02-01 to 2000-02-last,
day list right,month label below centered];
\end{codeexample}
+ %
\end{stylekey}
-
\subsection{Examples}
-In the following, some example calendars are shown that come either
-from real applications or are just nice to look at.
-
-Let us start with a year-2100-countdown, in which we cross out dates
-as we approach the big celebration. For
-this, we set the shape to |strike out| for these dates.
+In the following, some example calendars are shown that come either from real
+applications or are just nice to look at.
+Let us start with a year-2100-countdown, in which we cross out dates as we
+approach the big celebration. For this, we set the shape to |strike out| for
+these dates.
+%
\begin{codeexample}[leave comments]
\begin{tikzpicture}
\calendar
@@ -820,11 +877,11 @@ this, we set the shape to |strike out| for these dates.
\end{tikzpicture}
\end{codeexample}
-The next calendar shows a deadline, which is 10 days in the future
-from the current date. The last three days before the deadline are in
-red, because we really should be done by then. All days on which we
-can no longer work on the project are crossed out.
-
+The next calendar shows a deadline, which is 10 days in the future from the
+current date. The last three days before the deadline are in red, because we
+really should be done by then. All days on which we can no longer work on the
+project are crossed out.
+%
\begin{codeexample}[leave comments]
\begin{tikzpicture}
\calendar
@@ -846,7 +903,7 @@ can no longer work on the project are crossed out.
\end{codeexample}
The following example is a futuristic calendar that is all about circles:
-
+%
\begin{codeexample}[]
\sffamily
@@ -894,6 +951,7 @@ The following example is a futuristic calendar that is all about circles:
\end{codeexample}
Next, let's us have a whole year in a tight column:
+%
\begin{codeexample}[leave comments]
\begin{tikzpicture}
\small\sffamily
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 0c02a736efe..da838741519 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
@@ -9,80 +9,71 @@
\section{Chains}
-
\label{section-chains}
\begin{tikzlibrary}{chains}
- This library defines options for creating chains.
+ This library defines options for creating chains.
\end{tikzlibrary}
\subsection{Overview}
-\emph{Chains} are sequences of nodes that are -- typically -- arranged
-in a 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
-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.
-
+\emph{Chains} are sequences of nodes that are -- typically -- arranged in a 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 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.
\subsection{Starting and Continuing a Chain}
-Typically, you construct one chain at a time, but it is
-permissible to construct multiple chains simultaneously. In this
-case, the chains must be named differently and you must specify for
-each node which chain it belongs to.
+Typically, you construct one chain at a time, but it is permissible to
+construct multiple chains simultaneously. In this case, the chains must be
+named differently and you must specify for each node which chain it belongs to.
-The first step toward creating a chain is to use the |start chain|
-option.
+The first step toward creating a chain is to use the |start chain| option.
\begin{key}{/tikz/start chain=\opt{\meta{chain name}}\opt{\meta{direction}}}
- This key should, but need not, be given as an option to a scope
- enclosing all nodes of the chain. Typically, this will be a |scope|
- or the whole |tikzpicture|, but it might just be a path on which all
- nodes of the chain are found.
- If no \meta{chain name} is given, the default value |chain| will be
- used instead.
-
- The key starts a chain named \meta{chain name} and makes it
- \emph{active}, which means that it is currently being constructed. The
- |start chain| can be issued only once to activate a chain, inside a
- scope in which a chain is active you cannot use this option once
- more (for the same chain name). The chain stops being active at the
- end of the scope in which the |start chain| command was given.
-
- Although chains are only locally active (that is, active inside the
- scope the |start chain| command was issued), the information
- concerning the chains is stored globally and it is possible
- to \emph{continue} a chain after a scope has ended. For this, the
- |continue chain| option can be used, which allows you to reactivate
- an existing chain in another scope.
-
- The \meta{direction} is used to determine the placement rule for
- nodes on the chain. If it is omitted, the current value of the
- following key is used:
- \begin{key}{/tikz/chain default direction=\meta{direction}
- (initially going right)}
- This \meta{direction} is used in a |chain| option, if no other
- \meta{direction} is specified.
- \end{key}
-
- The \meta{direction} can have two different forms:
- \declare{|going |\meta{options}} or
- \declare{|placed |\meta{options}}. The effect of these rules will be
- 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.
+ This key should, but need not, be given as an option to a scope enclosing
+ all nodes of the chain. Typically, this will be a |scope| or the whole
+ |tikzpicture|, but it might just be a path on which all nodes of the chain
+ are found. If no \meta{chain name} is given, the default value |chain| will
+ be used instead.
+
+ The key starts a chain named \meta{chain name} and makes it \emph{active},
+ which means that it is currently being constructed. The |start chain| can
+ be issued only once to activate a chain, inside a scope in which a chain is
+ active you cannot use this option once more (for the same chain name). The
+ chain stops being active at the end of the scope in which the |start chain|
+ command was given.
+
+ Although chains are only locally active (that is, active inside the scope
+ the |start chain| command was issued), the information concerning the
+ chains is stored globally and it is possible to \emph{continue} a chain
+ after a scope has ended. For this, the |continue chain| option can be used,
+ which allows you to reactivate an existing chain in another scope.
+
+ The \meta{direction} is used to determine the placement rule for nodes on
+ the chain. If it is omitted, the current value of the following key is
+ used:
+ %
+ \begin{key}{/tikz/chain default direction=\meta{direction} (initially going right)}
+ This \meta{direction} is used in a |chain| option, if no other
+ \meta{direction} is specified.
+ \end{key}
+
+ The \meta{direction} can have two different forms:
+ \declare{|going |\meta{options}} or \declare{|placed |\meta{options}}. The
+ effect of these rules will be 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[start chain]
% The chain is called just "chain"
@@ -119,18 +110,19 @@ option.
\node [on chain=1] {D};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/continue chain=\opt{\meta{chain name}}\opt{\meta{direction}}}
- This option allows you to (re)activate an existing chain and to
- possibly change the default direction. If the |chain name| is
- missing, the name of the innermost activated chain is used. If no
- chain is activated, |chain| is used.
-
- Let us have a look at the two different applications of this
- option. The first is to change the direction of a chain as it is
- being constructed. For this, just give this option somewhere inside
- the scope of the chain.
+ This option allows you to (re)activate an existing chain and to possibly
+ change the default direction. If the |chain name| is missing, the name of
+ the innermost activated chain is used. If no chain is activated, |chain| is
+ used.
+
+ Let us have a look at the two different applications of this option. The
+ first is to change the direction of a chain as it is being constructed. For
+ this, just give this option somewhere inside the scope of the chain.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[start chain=going right,node distance=5mm]
\node [draw,on chain] {Hello};
@@ -141,9 +133,9 @@ option.
\end{tikzpicture}
\end{codeexample}
- The second application is to reactivate a chain after it ``has
- already been closed down.''
-
+ The second application is to reactivate a chain after it ``has already been
+ closed down''.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[node distance=5mm,
every node/.style=draw]
@@ -164,79 +156,81 @@ option.
}
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\subsection{Nodes on a Chain}
\begin{key}{/tikz/on chain=\opt{\meta{chain name}}\opt{\meta{direction}}}
- This key should be given as an option to a node. When the option is
- used, the \meta{chain name} must be the name of a chain that has
- been started using the |start chain| option. If \meta{chain name} is
- the empty string, the current value of the innermost activated chain
- is used. If this option is used several times for a node, only the
- last invocation ``wins.'' (To place a node on several chains, use
- the |\chainin| command repeatedly.)
-
- The \meta{direction} part is optional. If present, it sets the
- 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).
-
- The effects of this option are the following:
- \begin{enumerate}
- \item An internal counter (there is one local counter
- for each chain) is increased. This counter reflects the current
- number of the node in the chain, where the first node is node 1,
- the second is node 2, and so on.
-
- The value of this internal counter is globally stored in the
- macro \declare{|\tikzchaincount|}.
- \item If the node does not yet have a name, (having been given using
- the |name| option or the name-syntax), the name of the node is set to
- \meta{chain name}|-|\meta{value of the internal chain
- counter}. For instance, if the chain is called |nums|, the first
- node would be named |nums-1|, the second |nums-2|, and so on. For
- the default chain name |chain|, the first node is named |chain-1|,
- the second |chain-2|, and so on.
- \item Independently of whether the name has been provided
- automatically or via the |name| option, the name of the node is
- globally stored in the macro \declare{|\tikzchaincurrent|}.
- \item Except for the first node, the macro
- \declare{|\tikzchainprevious|} is now globally set to the name of
- the node of the previous node on the chain. For the first node of
- the chain, this macro is globally set to the empty string.
- \item Except possibly for the first node of the chain, the placement
- rule is now executed. The placement rule is just a \tikzname\ option
- that is applied automatically to each node on the chain. Depending
- on the form of the \meta{direction} parameter (either the locally
- given one or the one given to the |start chain| option), different
- things happen.
-
- First, it makes a difference whether the \meta{direction} starts
- 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|-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.''
-
- Independently of which form is used, the \meta{text} inside
- \meta{direction} that follows |going| or |placed| (separated by a
- compulsory space) can have two different effects:
+ This key should be given as an option to a node. When the option is used,
+ the \meta{chain name} must be the name of a chain that has been started
+ using the |start chain| option. If \meta{chain name} is the empty string,
+ the current value of the innermost activated chain is used. If this option
+ is used several times for a node, only the last invocation ``wins''. (To
+ place a node on several chains, use the |\chainin| command repeatedly.)
+
+ The \meta{direction} part is optional. If present, it sets the 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).
+
+ The effects of this option are the following:
+ %
\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.
- \item If it does not contain an equal sign, then
- \meta{text}|=of \tikzchainprevious| is used as the placement
- rule.
- \end{enumerate}
-
- Note that in the first case, inside the \meta{text} you have
- access to |\tikzchainprevious| and |\tikzchaincount| for doing
- your positioning calculations.
+ \item An internal counter (there is one local counter for each chain)
+ is increased. This counter reflects the current number of the node
+ in the chain, where the first node is node 1, the second is node 2,
+ and so on.
+
+ The value of this internal counter is globally stored in the macro
+ \declare{|\tikzchaincount|}.
+ \item If the node does not yet have a name, (having been given using
+ the |name| option or the name-syntax), the name of the node is set
+ to \meta{chain name}|-|\meta{value of the internal chain counter}.
+ For instance, if the chain is called |nums|, the first node would
+ be named |nums-1|, the second |nums-2|, and so on. For the default
+ chain name |chain|, the first node is named |chain-1|, the second
+ |chain-2|, and so on.
+ \item Independently of whether the name has been provided automatically
+ or via the |name| option, the name of the node is globally stored
+ in the macro \declare{|\tikzchaincurrent|}.
+ \item Except for the first node, the macro
+ \declare{|\tikzchainprevious|} is now globally set to the name of
+ the node of the previous node on the chain. For the first node of
+ the chain, this macro is globally set to the empty string.
+ \item Except possibly for the first node of the chain, the placement
+ rule is now executed. The placement rule is just a \tikzname\
+ option that is applied automatically to each node on the chain.
+ Depending on the form of the \meta{direction} parameter (either the
+ locally given one or the one given to the |start chain| option),
+ different things happen.
+
+ First, it makes a difference whether the \meta{direction} starts
+ 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|-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''.
+
+ Independently of which form is used, the \meta{text} inside
+ \meta{direction} that follows |going| or |placed| (separated by a
+ 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.
+ \item If it does not contain an equal sign, then
+ \meta{text}|=of \tikzchainprevious| is used as the
+ placement rule.
+ \end{enumerate}
+
+ Note that in the first case, inside the \meta{text} you have access
+ to |\tikzchainprevious| and |\tikzchaincount| for doing your
+ positioning calculations.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[start chain=circle placed {at=(\tikzchaincount*30:1.5)}]
\foreach \i in {1,...,10}
@@ -245,18 +239,19 @@ option.
\draw (circle-1) -- (circle-10);
\end{tikzpicture}
\end{codeexample}
- \item
- The following style is executed:
- \begin{stylekey}{/tikz/every on chain}
- This key is executed for every node on a chain, including the
- first one.
- \end{stylekey}
- \end{enumerate}
+ \item The following style is executed:
+ %
+ \begin{stylekey}{/tikz/every on chain}
+ This key is executed for every node on a chain, including the
+ first one.
+ \end{stylekey}
+ \end{enumerate}
- Recall that the standard placement rule has a form like
- |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|.
+ Recall that the standard placement rule has a form like
+ |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}[]
\begin{tikzpicture}[start chain,node distance=5mm]
\node [draw,on chain] {};
@@ -265,8 +260,9 @@ option.
\end{tikzpicture}
\end{codeexample}
- The optional \meta{direction} allows us to temporarily change the
- direction in the middle of a chain:
+ The optional \meta{direction} allows us to temporarily change the direction
+ in the middle of a chain:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[start chain,node distance=5mm]
\node [draw,on chain] {Hello};
@@ -277,7 +273,8 @@ option.
\end{tikzpicture}
\end{codeexample}
- You can also use more complicated computations in the \meta{direction}:
+ You can also use more complicated computations in the \meta{direction}:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[start chain=going {at=(\tikzchainprevious),shift=(30:1)}]
\draw [help lines] (0,0) grid (3,2);
@@ -287,47 +284,48 @@ option.
\node [draw,on chain] {.};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
For each chain, two special ``pseudo nodes'' are created.
\begin{predefinednode}{\meta{chain name}-begin}
- This node is the same as the first node on the chain. It is only
- defined after a first node has been defined.
+ This node is the same as the first node on the chain. It is only defined
+ after a first node has been defined.
\end{predefinednode}
\begin{predefinednode}{\meta{chain name}-end}
- This node is the same as the (currently) last node on the chain. As
- the chain is extended, this node changes.
+ This node is the same as the (currently) last node on the chain. As the
+ chain is extended, this node changes.
\end{predefinednode}
-The |on chain| option can also be used, in conjunction with
-|late options|, to add an already existing node to a chain. The
-following command, which is only defined inside scopes where a
-|start chain| option is present, simplifies this process.
+The |on chain| option can also be used, in conjunction with |late options|, to
+add an already existing node to a chain. The following command, which is only
+defined inside scopes where a |start chain| option is present, simplifies this
+process.
\begin{command}{\chainin |(|\meta{existing name}|)| \opt{\oarg{options}}}
- This command makes it easy to add a node to chain that has already
- been constructed. This node may even be part of a another chain.
-
- When you say |\chainin (some node);|, the node |some node| must
- already exist. It will then be made part of the current chain. This
- does not mean that the node can be changed (it is already
- constructed, after all), but the |join| option can be used to join
- |some node| to the previous last node on the chain and subsequent
- nodes will be placed relative to |some node|.
-
- 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.
-
- 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.
-
+ This command makes it easy to add a node to chain that has already been
+ constructed. This node may even be part of a another chain.
+
+ When you say |\chainin (some node);|, the node |some node| must already
+ exist. It will then be made part of the current chain. This does not mean
+ that the node can be changed (it is already constructed, after all), but
+ the |join| option can be used to join |some node| to the previous last node
+ on the chain and subsequent nodes will be placed relative to |some node|.
+
+ 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.
+
+ 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=->]
@@ -335,18 +333,19 @@ following command, which is only defined inside scopes where a
\node[red] (existing) at (0,2) {existing};
- { [start chain]
+ \begin{scope}[start chain]
\node [draw,on chain,join] {Hello};
\node [draw,on chain,join] {World};
\chainin (existing) [join];
\node [draw,on chain,join] {this};
\node [draw,on chain,join] {is};
- }
+ \end{scope}
\end{tikzpicture}
\end{codeexample}
- Here is an example where nodes are positioned using a matrix and
- then connected using a chain
+ Here is an example where nodes are positioned using a matrix and then
+ connected using a chain
+ %
{\catcode`\|=12
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style=draw]
@@ -357,6 +356,7 @@ following command, which is only defined inside scopes where a
|(e) [ellipse]| great & |(f)| ! \\
};
+ % (the `scopes' library needs to be loaded to make the following work)
{ [start chain,every on chain/.style={join=by ->}]
\chainin (a);
\chainin (b);
@@ -368,28 +368,29 @@ following command, which is only defined inside scopes where a
\end{tikzpicture}
\end{codeexample}
}
+ %
\end{command}
-
\subsection{Joining Nodes on a Chain}
\begin{key}{/tikz/join=\opt{|with |\meta{with} }\opt{|by |\meta{options}}}
- When this key is given to any node on a chain (except possibly for
- the first node), an |edge| command is added after the node. The
- |with| part specifies which node should be used for the start point
- of the edge; if the |with| part is omitted, the |\tikzchainprevious|
- 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.
- \begin{stylekey}{/tikz/every join}
- This style is executed each time this command is used.
- \end{stylekey}
-
- Note that it makes sense to call this option several times for a
- node, in order to connect it to several nodes. This is especially
- useful for joining in branches, see the next section.
+ When this key is given to any node on a chain (except possibly for the
+ first node), an |edge| command is added after the node. The |with| part
+ specifies which node should be used for the start point of the edge; if the
+ |with| part is omitted, the |\tikzchainprevious| 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.
+ %
+ \begin{stylekey}{/tikz/every join}
+ This style is executed each time this command is used.
+ \end{stylekey}
+
+ Note that it makes sense to call this option several times for a node, in
+ order to connect it to several nodes. This is especially useful for joining
+ in branches, see the next section.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[start chain,node distance=5mm,
every join/.style={->,red}]
@@ -400,41 +401,43 @@ following command, which is only defined inside scopes where a
join,join=with chain-1 by {blue,<-}] {foo};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\subsection{Branches}
-A \emph{branch} is a chain that (typically only temporarily) extends
-an existing chain. The idea is the following: Suppose we are
-constructing a chain and at some node |x| there is a fork. In this
-case, one (or even more) branches starts at this fork. For each branch
-a chain is created, but the first node on this chain should
-be~|x|. For this, it is useful to use |\chainin| on the node |x| to
-make it part of the different branch chains and to name the branch
+A \emph{branch} is a chain that (typically only temporarily) extends an
+existing chain. The idea is the following: Suppose we are constructing a chain
+and at some node |x| there is a fork. In this case, one (or even more) branches
+starts at this fork. For each branch a chain is created, but the first node on
+this chain should be~|x|. For this, it is useful to use |\chainin| on the node
+|x| to make it part of the different branch chains and to name the branch
chains in some way that reflects the name of the main chain.
-The |start branch| option provides a shorthand for doing exactly what
-was just described.
+The |start branch| option provides a shorthand for doing exactly what was just
+described.
\begin{key}{/tikz/start branch=\meta{branch name}\opt{\meta{direction}}}
- This key is used in the same manner as the |start chain| command,
- however, the effect is slightly different:
- \begin{itemize}
- \item This option may only be used if some chain is already active
- and there is a (last) node on this chain. Let us call this node
- the \meta{fork node}.
- \item The chain is not just called \meta{branch name}, but
- \meta{current chain}|/|\meta{branch name}. For instance, if the
- \meta{fork node} is part of the chain called |trunk| and the
- \meta{branch name} is set to |left|, the complete chain name of
- the branch is |trunk/left|. The \meta{branch name} must be given,
- there is no default value.
- \item The \meta{fork node} is automatically ``chained into'' the
- branch chain as its first node. Thus, for the first node on the
- branch that you provide, the |join| option will cause it to be
- connected to the fork node.
- \end{itemize}
+ This key is used in the same manner as the |start chain| command, however,
+ the effect is slightly different:
+ %
+ \begin{itemize}
+ \item This option may only be used if some chain is already active and
+ there is a (last) node on this chain. Let us call this node the
+ \meta{fork node}.
+ \item The chain is not just called \meta{branch name}, but
+ \meta{current chain}|/|\meta{branch name}. For instance, if the
+ \meta{fork node} is part of the chain called |trunk| and the
+ \meta{branch name} is set to |left|, the complete chain name of the
+ branch is |trunk/left|. The \meta{branch name} must be given, there
+ is no default value.
+ \item The \meta{fork node} is automatically ``chained into'' the branch
+ chain as its first node. Thus, for the first node on the branch
+ that you provide, the |join| option will cause it to be connected
+ to the fork node.
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every on chain/.style=join,every join/.style=->,
node distance=2mm and 1cm]
@@ -462,12 +465,14 @@ was just described.
}
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/continue branch=\meta{branch name}\opt{\meta{direction}}}
- 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}.
+ 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}[]
\begin{tikzpicture}[every on chain/.style=join,every join/.style=->,
node distance=2mm and 1cm]
@@ -490,4 +495,5 @@ was just described.
}
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
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
index 6290ee705d0..66bbd1e3233 100644
--- 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
@@ -7,20 +7,22 @@
%
% 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.
+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}
@@ -70,12 +72,11 @@ representations of circuits.
\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]|:
+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:
@@ -116,90 +117,92 @@ the options of the |{tikzpicture}| environment replaced by
\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.
+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.
+``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|.
+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 set up 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
+\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 set up 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.
+ \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:
+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 set up keys like |and gate| to
-create use an appropriate symbol graphic for rendering an |and gate|. Using the |circuit logic IEC| instead will set up |and gate| to
-use another symbol graphic.
-
+%
+To create a picture that contains a US-style circuit you can now use the option
+|circuit logic US|. This will set up keys like |and gate| to create use an
+appropriate symbol graphic for rendering an |and gate|. Using the
+|circuit logic IEC| instead will set up |and gate| to use another symbol
+graphic.
+%
\begin{codeexample}[]
\begin{tikzpicture}[circuit logic US]
\matrix[column sep=7mm]
@@ -220,7 +223,6 @@ use another symbol graphic.
\end{tikzpicture}
\end{codeexample}
-
\begin{codeexample}[]
\begin{tikzpicture}[circuit logic IEC]
\matrix[column sep=7mm]
@@ -242,19 +244,17 @@ use another symbol graphic.
\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:
+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)
@@ -262,37 +262,34 @@ annotation as a parameter to the symbol as in the following example:
\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.
+ 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|.
+ 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.
+ 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);
@@ -300,32 +297,35 @@ annotation as a parameter to the symbol as in the following example:
(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|.
+ 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|.
+ 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|.
+ 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|.
+ 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|.
+ 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{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);
@@ -336,41 +336,43 @@ annotation as a parameter to the symbol as in the following example:
\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
+ 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:
+ %
+ 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 set up 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:
+ However, in the above example we would not actually see anything since we
+ have not yet set up 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,
@@ -381,302 +383,317 @@ annotation as a parameter to the symbol as in the following example:
\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 set up 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.
+ 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 set up 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.
+ 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 be placed as a mark on the path.
- \item The marking decoration will automatically subdivide the path
- and cause a line to be drawn 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.
+ 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 be placed as a mark on the path.
+ \item The marking decoration will automatically subdivide the path and
+ cause a line to be drawn 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:
-
+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 shows how the inductor shape (which looks,
- unrotated, like this: \tikz[circuit ee IEC]\node[inductor]{};) is
- automatically rotated around:
+ \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 shows 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|.
+ %
+ \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|.
+ \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|.
+ \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.
+ \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{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).
+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 built on top of this option, but it comes in some
-predefined variants that are especially useful in conjunction with
-circuits.
+\tikzname\ already provides the |label| option for this purpose. The |info|
+option is built 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.
+ 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}.
+ 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}:
+ 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.
+ 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.
+ 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|.
+ 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.
+ 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 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:
+ 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}
@@ -684,7 +701,9 @@ Annotations can be declared using the following key:
{(0pt,8pt) arc (-270:80:3.5pt)}
}
\end{codeexample}
- We can then use it like this:
+ %
+ We can then use it like this:
+ %
\tikzset{circuit declare annotation=
{circular annotation}
{8pt}
@@ -694,11 +713,12 @@ Annotations can be declared using the following key:
\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:
+ %
+ 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)}] ()}
@@ -707,13 +727,14 @@ Annotations can be declared using the following key:
\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:
+ %
+ 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)}] ()}
}
@@ -722,28 +743,28 @@ Annotations can be declared using the following key:
\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:
+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.
+ \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,
@@ -753,66 +774,78 @@ in several ways:
\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.
+ %
+ \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 that do
- not surround anything. Examples are a capacitor.
+ \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 that 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.
+ \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
+ 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
+ %
+ 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{stylekey}
\end{itemize}
-All circuit environments like |circuit logic IEC| mainly use options
-like |set and gate graphic=...| to set up 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:
+All circuit environments like |circuit logic IEC| mainly use options like
+|set and gate graphic=...| to set up 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=
{
@@ -824,14 +857,13 @@ The |and gate IEC graphic| style, in turn, is defined as follows:
}
\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:
-
+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
@@ -849,65 +881,63 @@ saying |set resistor graphic| yourself:
\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.
+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.
+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:
+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}.
+ 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}
- \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:
+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
- set up a scope that contains a logical circuit where the gates are
- shown in this style.
+ 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 set up 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|.
+ \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.
+ 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={
@@ -930,21 +960,23 @@ you need to use one of the following libraries, instead:
\draw (o.output) -- ++(right:3mm);
\end{tikzpicture}
\end{codeexample}
- \end{key}
+ \end{key}
\end{pgflibrary}
\begin{pgflibrary}{circuits.logic.US}
- This library provides graphics showing ``American'' logic
- gates. It defines the following key:
+ 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]
+ \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}
+\end{codeexample}
- Here is an example:
+ Here is an example:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[circuit logic CDH,
tiny circuit symbols,
@@ -967,37 +999,36 @@ set and gate graphic = and gate US graphic
\draw (o.output) -- ++(right:3mm);
\end{tikzpicture}
\end{codeexample}
- \end{key}
+ \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}
+ 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:
+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}.
-
+ 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]
{
@@ -1006,24 +1037,24 @@ one of them, all the other work the same way:
}
\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 to 1024, which should be \emph{way}
- more than would ever be needed.
+ \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 to 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.
+ 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{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) {};
@@ -1032,26 +1063,23 @@ one of them, all the other work the same way:
\draw (A.output) -- ++(right:5mm);
\end{tikzpicture}
\end{codeexample}
- \end{key}
+ \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.)
+ (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|.
+ \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.
+|circuits.logic| library and their appearance in the different sublibraries.
\medskip
\def\gateexamples#1{%
@@ -1077,37 +1105,34 @@ sublibraries.
\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.
+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.
+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.
+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.
-
+ 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}]
@@ -1118,13 +1143,13 @@ inputs.
\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|.
-
+ 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 Jürgen 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) {};
@@ -1133,27 +1158,24 @@ inputs.
\draw (A.output) -- ([xshift=0.5cm]A.output);
\end{tikzpicture}
\end{codeexample}
+ \end{key}
-\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:
+ 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.
-\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.
+ 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}}
@@ -1161,12 +1183,13 @@ centers of the inputs can be customized using the following keys:
\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.
+ %
+ \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);
@@ -1178,44 +1201,40 @@ centers of the inputs can be customized using the following keys:
(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{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.
-
+ 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) {};
@@ -1226,35 +1245,35 @@ centers of the inputs can be customized using the following keys:
(A.\a) circle(\z);
\end{tikzpicture}
\end{codeexample}
+ %
+ \end{key}
-\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.
-
+ 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}
@@ -1273,97 +1292,93 @@ centers of the inputs can be customized using the following keys:
\end{tikzpicture}
\end{codeexample}
- (For the definition of the |shape example| style, see
- Section~\ref{section-libs-shapes}.)
- \end{shape}
+ (For the definition of the |shape example| style, see
+ Section~\ref{section-libs-shapes}.)
+ \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}
+ 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/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/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/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/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/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 |xor 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/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/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 |xor 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/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/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/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/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{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}}
+ \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}{
@@ -1373,37 +1388,36 @@ centers of the inputs can be customized using the following keys:
}
\end{tikzpicture}
\end{codeexample}
+ %
+ \end{key}
-\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
- inverted inputs are
- shown below. Anchor |30| is an example of a border anchor.
+ \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 inverted inputs are shown below. Anchor |30| is an
+ example of a border anchor.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -1423,100 +1437,100 @@ centers of the inputs can be customized using the following keys:
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
-\end{shape}
+ \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.
+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 is a base library and more specific libraries.
+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 is 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}
+ 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.
+ 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|.
+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}
+ 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 others work the
-same way.
+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 others 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.
+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.
+ 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).
+ \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.
+ 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:
+ 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|.
+ 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) {};
@@ -1525,107 +1539,111 @@ Section~\ref{section-circuits-ee-symbols} and later sections.
}
\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:
-
+ \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.
+ 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 have four
- standard compass direction anchors.
+ \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 have four 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.
+ \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}.
+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}$.
+ 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.
+ 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.
+ 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|.
+ 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
+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.
-
+ 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.
+ 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]
{
@@ -1634,27 +1652,25 @@ Section~\ref{section-circuits-annotations}.
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{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}
&
@@ -1693,19 +1709,19 @@ Section~\ref{section-circuits-annotations}.
\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|.
+There \todosp{why two labels? The first doesn't seem to be used.} 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'}{}
+ \emph{Key} & \emph{Appearance}\\[.25em]
+ \eelineexample{/tikz/current direction}{}
+ \eelineexample{/tikz/current direction'}{}
\end{tabular}
\medskip
@@ -1716,22 +1732,21 @@ The examples have been produced by (in essence)
\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|.
+|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}{}
+ \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}
@@ -1761,15 +1776,14 @@ The following table shows contacts as they are depicted inside the
\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}{}
+ \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:
@@ -1777,23 +1791,21 @@ The |circuit.ee| library predefines the following unit keys:
\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}
+ \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:
@@ -1801,99 +1813,101 @@ The |circuit.ee.IEC| library defines the following annotations:
\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}
+ \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.
+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.
+ 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.
+ 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.
+ 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 set up 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 tip end and the back end specified
- by the arrow itself (see Section~\ref{section-arrow-terminology}
- for details). You usually need not worry about this width
- setting.
-
- By comparison, the height of the arrow is given by the current
- setting of |minimum height|. Thus, this key must have been set up
- 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
- set up 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.
-
+ 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 set up 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 tip end and the back end specified by the
+ arrow itself (see Section~\ref{section-arrow-terminology} for
+ details). You usually need not worry about this width setting.
+
+ By comparison, the height of the arrow is given by the current
+ setting of |minimum height|. Thus, this key must have been set up
+ 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 set
+ up 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}
@@ -1917,38 +1931,40 @@ directly.
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.
+ 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 shape 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:
+ 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 shape 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={
@@ -1960,15 +1976,15 @@ directly.
},
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 the 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|.
+ This shape is used to depict diodes. The main shape is taken up by a
+ ``right pointing'' triangle. The anchors are positioned on the 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] {};
@@ -1982,22 +1998,23 @@ directly.
\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.
+ 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={
@@ -2011,15 +2028,14 @@ directly.
},
draw] {};
\end{codeexample}
- \end{key}
+ \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|.
+ 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] {};
@@ -2032,22 +2048,23 @@ directly.
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 set up 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.
+ 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 set up
+ 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] {};
@@ -2060,20 +2077,20 @@ directly.
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|.
+ 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] {};
@@ -2086,15 +2103,16 @@ directly.
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.
+ %
+ 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.
+ 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,
@@ -2108,30 +2126,36 @@ directly.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
\begin{shape}{battery IEC}
- This shape is similar to a |capacitor IEC|, however, the right line is
- only half the height of the left line.
+ This shape is similar to a |capacitor IEC|, however, 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.
+ 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|.
+ 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] {};
@@ -2144,25 +2168,28 @@ directly.
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.
+ 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|.
+ 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 277543a1951..58d2b6f3af8 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
@@ -7,134 +7,130 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Decoration Library}
\label{section-library-decorations}
-
\subsection{Overview and Common Options}
-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
-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.
-
-The decorations are influenced by a number of parameters that can be
-set using the |decoration| option. These parameters are
-typically shared between different decorations. In the following, the
-general options are documented (they are defined directly in the
-|decoration| module), special-purpose keys are documented
-with the decoration that uses it.
-
-Since you are encouraged to use these keys to make your own
-decorations configurable, it is indicated for each key where the value
-is stored (so that you can access it). Note that some values are
-stored in \TeX\ dimension registers while others are stored in macros.
+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 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.
+
+The decorations are influenced by a number of parameters that can be set using
+the |decoration| option. These parameters are typically shared between
+different decorations. In the following, the general options are documented
+(they are defined directly in the |decoration| module), special-purpose keys
+are documented with the decoration that uses it.
+
+Since you are encouraged to use these keys to make your own decorations
+configurable, it is indicated for each key where the value 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
- 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 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 sets the \TeX-dimension |\pgfdecorationsegmentamplitude|.
+ This key sets 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 sets the \TeX-macro (!) |\pgfmetadecorationsegmentamplitude|.
+ The key sets 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.
+ Many decorations are made up of small segments. This key determines the
+ desired length of such segments.
- This key sets the \TeX-dimension |\pgfdecorationsegmentlength|.
+ This key sets 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 determined the length of the meta-segments from which a
+ meta-decoration is made up.
- This key sets the \TeX-macro (!) |\pgfmetadecorationsegmentlength|.
+ This key sets the \TeX-macro (!) |\pgfmetadecorationsegmentlength|.
\end{key}
\begin{key}{/pgf/decoration/angle=\meta{degree} (initially 45)}
- The way some decorations look like depends on a configurable angle. For
- instance, a |wave| decoration consists of arcs and the opening angle
- of these arcs is given by the |angle|.
+ The way some decorations look like depends on a configurable angle. For
+ instance, a |wave| decoration consists of arcs and the opening angle of
+ these arcs is given by the |angle|.
- This key sets the \TeX-macro |\pgfdecorationsegmentangle|.
+ This key sets the \TeX-macro |\pgfdecorationsegmentangle|.
\end{key}
\begin{key}{/pgf/decoration/aspect=\meta{factor} (initially 0.5)}
- For some decorations there is a natural aspect ratio. For instance,
- for a |brace| decoration the aspect ratio determines where the brace
- point will be.
+ For some decorations there is a natural aspect ratio. For instance,
+ for a |brace| decoration the aspect ratio determines where the brace
+ point will be.
- This key sets the \TeX-macro |\pgfdecorationsegmentaspect|.
+ This key sets the \TeX-macro |\pgfdecorationsegmentaspect|.
\end{key}
\begin{key}{/pgf/decoration/start radius=\meta{dimension} (initially 2.5pt)}
- For some decorations there is a natural start radius (of some circle, presumably).
+ For some decorations there is a natural start radius (of some circle,
+ presumably).
- This key stores the value directly inside the key.
+ This key stores the value directly inside the key.
\end{key}
\begin{key}{/pgf/decoration/end radius=\meta{dimension} (initially 2.5pt)}
- For some decorations there is a natural end radius (of some circle, presumably).
+ For some decorations there is a natural end radius (of some circle,
+ presumably).
- This key stores the value directly inside the key.
+ This key stores the value directly inside the key.
\end{key}
\begin{stylekey}{/pgf/decoration/radius=\meta{dimension}}
- Sets the start and end radius simultaneously.
+ Sets the start and end radius simultaneously.
\end{stylekey}
-
\begin{key}{/pgf/decoration/path has corners=\meta{boolean} (initially false)}
- 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 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
- the \TeX-if |\ifpgfdecoratepathhascorners|.
+ 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 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 the \TeX-if |\ifpgfdecoratepathhascorners|.
\end{key}
\subsection{Path Morphing Decorations}
\begin{pgflibrary}{decorations.pathmorphing}
- A \emph{path morphing decoration} ``morphs'' or ``deforms'' the
- to-be-decorated path. This means that what used to be a straight
- line might afterwards be a snaking curve and have bumps. However, a
- line is still a line and path deforming decorations do not
- 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 subpaths and one open
- subpath.
+ A \emph{path morphing decoration} ``morphs'' or ``deforms'' the
+ to-be-decorated path. This means that what used to be a straight line might
+ afterwards be a snaking curve and have bumps. However, a line is still a
+ line and path deforming decorations do not 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
+ subpaths and one open subpath.
\end{pgflibrary}
\subsubsection{Decorations Producing Straight Line Paths}
-The following deformations use only straight lines in order to morph
-the paths.
+The following deformations use only straight lines in order to morph the paths.
\begin{decoration}{lineto}
- This decoration replaces the path by straight lines. For each curve,
- the path simply goes directly from the start point to the end point.
- In the following example, the arc actually consist of two
- subcurves.
+ This decoration replaces the path by straight lines. For each curve, the
+ path simply goes directly from the start point to the end point. In the
+ following example, the arc actually consist of two subcurves.
- This decoration is actually always defined when the decoration
- module is loaded, but it is documented here for consistency.
+ This decoration is actually always defined when the decoration module is
+ loaded, but it is documented here for consistency.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=lineto]
\draw [help lines] grid (3,2);
@@ -142,24 +138,23 @@ the paths.
(0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle;
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
-
\begin{decoration}{straight zigzag}
- 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 zigzag line raises above and falls below
- a straight line to the target point.
- \item |segment length|
- determines the length of a complete ``up-down'' cycle.
- \item |meta-segment length|
- determines the length of the |curveto| and the |zigzag| decorations.
- \end{itemize}
-
+ 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 zigzag line raises above and
+ falls below a straight line to the target point.
+ \item |segment length| determines the length of a complete ``up-down''
+ cycle.
+ \item |meta-segment length| determines the length of the |curveto| and the
+ |zigzag| decorations.
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={straight zigzag,meta-segment length=1.1cm}]
\draw [help lines] grid (3,2);
@@ -167,21 +162,21 @@ the paths.
(0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle;
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
-
\begin{decoration}{random steps}
- This decoration consists of straight line segments. The line segments
- head towards the target, but each step is randomly shifted a little
- bit. The following parameters influence the decorations:
- \begin{itemize}
- \item |segment length|
- determines the basic length of each step.
- \item |amplitude|
- The end of each step is perturbed both in $x$- and in
- $y$-direction by two values drawn uniformly from the interval
- $[-d,d]$, where $d$ is the value of |amplitude|.
- \end{itemize}
+ This decoration consists of straight line segments. The line segments head
+ towards the target, but each step is randomly shifted a little bit. The
+ following parameters influence the decorations:
+ %
+ \begin{itemize}
+ \item |segment length| determines the basic length of each step.
+ \item |amplitude| The end of each step is perturbed both in $x$- and in
+ $y$-direction by two values drawn uniformly from the interval
+ $[-d,d]$, where $d$ is the value of |amplitude|.
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[decoration={random steps,segment length=2mm}]
@@ -190,18 +185,19 @@ the paths.
(0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle;
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
-
\begin{decoration}{saw}
- This decoration looks like the blade of a saw. The following parameters
- influence the decoration:
- \begin{itemize}
- \item |amplitude|
- determines how much each spike raises above the straight line.
- \item |segment length|
- determines the length each spike.
- \end{itemize}
+ This decoration looks like the blade of a saw. The following parameters
+ influence the decoration:
+ %
+ \begin{itemize}
+ \item |amplitude| determines how much each spike raises above the
+ straight line.
+ \item |segment length| determines the length each spike.
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=saw]
\draw [help lines] grid (3,2);
@@ -209,19 +205,20 @@ the paths.
(0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle;
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
-
\begin{decoration}{zigzag}
- This decoration looks like a zigzag line. The following parameters
- influence the decoration:
- \begin{itemize}
- \item |amplitude|
- determines how much the zigzag line raises above and falls below
- a straight line to the target point.
- \item |segment length|
- determines the length of a complete ``up-down'' cycle.
- \end{itemize}
+ This decoration looks like a zigzag line. The following parameters
+ influence the decoration:
+ %
+ \begin{itemize}
+ \item |amplitude| determines how much the zigzag line raises above and
+ falls below a straight line to the target point.
+ \item |segment length| determines the length of a complete ``up-down''
+ cycle.
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=zigzag]
\draw [help lines] grid (3,2);
@@ -229,30 +226,33 @@ the paths.
(0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle;
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
-
\subsubsection{Decorations Producing Curved Line Paths}
\begin{decoration}{bent}
- This decoration adds a slightly bent line from the start to the
- target. The amplitude of the bend is given |amplitude|
- (an amplitude of zero gives a straight line).
- \begin{itemize}
- \item |amplitude|
- determines the amplitude of the bend.
- \item |aspect|
- determines how tight the bend 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.
+ This decoration adds a slightly bent line from the start to the target. The
+ amplitude of the bend is given |amplitude| (an amplitude of zero gives a
+ straight line).
+ %
+ \begin{itemize}
+ \item |amplitude| determines the amplitude of the bend.
+ \item |aspect| determines how tight the bend 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=bent]
\draw [help lines] grid (3,2);
\draw [decorate] (0,0) -- (3,1) -- (1.5,2) -- (0,1);
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={bent,aspect=.3}]
\draw [decorate,fill=yellow!80!black] (0,0) rectangle (3.5,2);
@@ -262,18 +262,18 @@ the paths.
\draw[->,decorate] (B) -- (A);
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
-
\begin{decoration}{bumps}
- This decoration replaces the path by little half ellipses. The
- following parameters influence it.
- \begin{itemize}
- \item |amplitude|
- determines the height of the half ellipse.
- \item |segment length|
- determines the width of the half ellipse.
- \end{itemize}
+ This decoration replaces the path by little half ellipses. The following
+ parameters influence it.
+ %
+ \begin{itemize}
+ \item |amplitude| determines the height of the half ellipse.
+ \item |segment length| determines the width of the half ellipse.
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=bumps]
\draw [help lines] grid (3,2);
@@ -281,29 +281,28 @@ the paths.
(0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle;
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
-
\begin{decoration}{coil}
- This decoration replaces the path by a coiled line. To understand how this works,
- imagine a three-dimensional spring. The spring's axis points along
- 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:
- \begin{itemize}
- \item |amplitude|
- determines how much the coil rises above the path and falls below
- it. Thus, this is the radius of the coil.
- \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.
- \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.''
- \end{itemize}
+ This decoration replaces the path by a coiled line. To understand how this
+ works, imagine a three-dimensional spring. The spring's axis points along
+ 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:
+ %
+ \begin{itemize}
+ \item |amplitude| determines how much the coil rises above the path and
+ falls below it. Thus, this is the radius of the coil.
+ \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.
+ \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''.
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=coil]
\draw [help lines] grid (3,2);
@@ -311,6 +310,7 @@ the paths.
(0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle;
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[decoration={coil,aspect=0.3,segment length=3mm,amplitude=3mm}]
@@ -319,22 +319,19 @@ the paths.
(0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle;
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
-
-
\begin{decoration}{curveto}
- This decoration simply yields a line following the original
- path. This means that (ideally) it does not change the path and
- follows any curves in the path (hence the name). In
- reality, due to the internals of how decorations are implemented,
- this decoration actually replaces the path by numerous small
- straight lines.
-
- This decoration is mostly useful in conjunction with
- meta-decorations. It is also actually defined in the decoration
- module and is always available.
+ This decoration simply yields a line following the original path. This
+ means that (ideally) it does not change the path and follows any curves in
+ the path (hence the name). In reality, due to the internals of how
+ decorations are implemented, this decoration actually replaces the path by
+ numerous small straight lines.
+ This decoration is mostly useful in conjunction with meta-decorations. It
+ is also actually defined in the decoration module and is always available.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=curveto]
\draw [help lines] grid (3,2);
@@ -342,21 +339,19 @@ the paths.
(0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle;
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
-
-
\begin{decoration}{snake}
- 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:
- \begin{itemize}
- \item |amplitude|
- determines the sine wave's amplitude.
- \item |segment length|
- determines the sine wave's wavelength.
- \end{itemize}
+ 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:
+ %
+ \begin{itemize}
+ \item |amplitude| determines the sine wave's amplitude.
+ \item |segment length| determines the sine wave's wavelength.
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=snake]
\draw [help lines] grid (3,2);
@@ -364,36 +359,35 @@ the paths.
(0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle;
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
-
-
\subsection{Path Replacing Decorations}
\begin{pgflibrary}{decorations.pathreplacing}
- This library defines decorations that replace the to-be-decorated
- path by another path. Unlike morphing decorations, the replaced path
- might be quite different, for instance a straight line might be
- replaced by a set of circles. Note that filling a path that has been
- replaced using one of the decorations in this library typically does
- not fill the original area but, rather, the smaller area of the
- newly-created path segments.
+ This library defines decorations that replace the to-be-decorated path by
+ another path. Unlike morphing decorations, the replaced path might be quite
+ different, for instance a straight line might be replaced by a set of
+ circles. Note that filling a path that has been replaced using one of the
+ decorations in this library typically does not fill the original area but,
+ rather, the smaller area of the newly-created path segments.
\end{pgflibrary}
\begin{decoration}{border}
- This decoration adds straight lines to 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'' of an area. The following
- 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.
- \end{itemize}
+ This decoration adds straight lines to 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'' of an area. The following 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.
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=border]
\draw [help lines] grid (3,2);
@@ -401,109 +395,105 @@ the paths.
(0,0) -- (3,1) arc (0:180:1.5 and 1);
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
-
\begin{decoration}{brace}
- This decoration replaces a straight line path by a long brace. The
- left and right end of the brace will be exactly on the start and
- endpoint of the decoration. The decoration really only makes sense
- for paths that are a straight line.
- \begin{itemize}
- \item |amplitude|
- 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.
- \end{itemize}
+ This decoration replaces a straight line path by a long brace. The left and
+ right end of the brace will be exactly on the start and endpoint of the
+ decoration. The decoration really only makes sense for paths that are a
+ straight line.
+ %
+ \begin{itemize}
+ \item |amplitude| 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.
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=brace]
\draw [help lines] grid (3,2);
\draw [decorate] (0,0) -- (3,1);
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
-
-
\begin{decoration}{expanding waves}
- This decoration adds arcs to the path that get bigger along the line
- towards the target. The following parameters influence the decoration:
- \begin{itemize}
- \item |segment length|
- determines the distance between consecutive arcs.
- \item |angle|
- determines the opening angle below and above the path. Thus, the
- total opening angle is twice this angle.
- \end{itemize}
+ This decoration adds arcs to the path that get bigger along the line
+ towards the target. The following parameters influence the decoration:
+ %
+ \begin{itemize}
+ \item |segment length| determines the distance between consecutive
+ arcs.
+ \item |angle| determines the opening angle below and above the path.
+ Thus, the total opening angle is twice this angle.
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={expanding waves,angle=5}]
\draw [help lines] grid (3,2);
\draw [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1);
\end{tikzpicture}
\end{codeexample}
+ %
\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 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.
+ 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:
- \begin{itemize}
- \item |segment length|
- determines the distance between consecutive ticks.
- \item |amplitude|
- determines half the length of the ticks.
- \end{itemize}
+ This decoration replaces the path by straight lines that are orthogonal to
+ the path. The following parameters influence the decoration:
+ %
+ \begin{itemize}
+ \item |segment length| determines the distance between consecutive
+ ticks.
+ \item |amplitude| determines half the length of the ticks.
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=ticks]
\draw [help lines] grid (3,2);
\draw [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1);
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
-
-
\begin{decoration}{waves}
- This decoration replaces the path by arcs that have a constant
- size. The following parameters influence the decoration:
- \begin{itemize}
- \item |segment length|
- determines the distance between consecutive arcs.
- \item |angle|
- determines the opening angle below and above the path. Thus, the
- total opening angle is twice this angle.
- \item |radius|
- determines the radius of each arc.
- \end{itemize}
+ This decoration replaces the path by arcs that have a constant size. The
+ following parameters influence the decoration:
+ %
+ \begin{itemize}
+ \item |segment length| determines the distance between consecutive
+ arcs.
+ \item |angle| determines the opening angle below and above the path.
+ Thus, the total opening angle is twice this angle.
+ \item |radius| determines the radius of each arc.
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={waves,radius=4mm}]
\draw [help lines] grid (3,2);
\draw [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1);
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
-
-
-
\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.
-
+ 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,
@@ -528,56 +518,53 @@ the paths.
\end{tikzpicture}
\end{codeexample}
+ The following keys can be used to specify the code to execute for each type
+ of input segment.
- 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/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/curveto code=\meta{code} (initially \char`\{\char`\})}
- Set the code to be executed for every curveto input segment.
-\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/closepath code=\meta{code} (initially \char`\{\char`\})}
- Set the code to be executed for every closepath 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}
-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|.
+ \begin{key}{/pgf/decoration/closepath code=\meta{code} (initially \char`\{\char`\})}
+ Set the code to be executed for every closepath input segment.
+ \end{key}
-In \tikzname, you can use the following macros
-inside a \tikzname{} coordinate.
+ 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|.
-\begin{command}{\tikzinputsegmentfirst}
- The first point on the current input segment path.
-\end{command}
+ In \tikzname, you can use the following macros inside a \tikzname{}
+ coordinate.
-\begin{command}{\tikzinputsegmentlast}
- The last point on the current input segment path.
-\end{command}
+ \begin{command}{\tikzinputsegmentfirst}
+ The first 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}{\tikzinputsegmentlast}
+ The last point on the current input segment path.
+ \end{command}
-\begin{command}{\tikzinputsegmentsupportb}
- The second support on the curveto 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{
@@ -602,61 +589,59 @@ inside a \tikzname{} coordinate.
\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.
+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.
+ 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:
+ 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.
+ %
+ 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.
+ 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:
+ Let us start with the above example in real code:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={
markings,% switch on markings
@@ -674,7 +659,8 @@ a path. We start with the most general and most useful of these libraries.
\end{tikzpicture}
\end{codeexample}
- We can also add the cross repeatedly:
+ We can also add the cross repeatedly:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={
markings,% switch on markings
@@ -692,50 +678,49 @@ a path. We start with the most general and most useful of these libraries.
\end{tikzpicture}
\end{codeexample}
- The |mark| decoration option is used to specify a marking. It comes
- in two versions:
- \begin{key}{/pgf/decoration/mark=\texttt{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 displaced 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 displaced 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 contain 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.
-
+ The |mark| decoration option is used to specify a marking. It comes in two
+ versions:
+ %
+ \begin{key}{/pgf/decoration/mark=\texttt{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 displaced 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 displaced 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 contain 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
@@ -748,8 +733,9 @@ a path. We start with the most general and most useful of these libraries.
\end{tikzpicture}
\end{codeexample}
- Here is an example that shows how markings can be used to place text
- on plots:
+ 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,
@@ -767,39 +753,42 @@ a path. We start with the most general and most useful of these libraries.
\end{tikzpicture}
\end{codeexample}
- When the \meta{code} is being executed, two special keys will have
- been set up, 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).
+ When the \meta{code} is being executed, two special keys will have been
+ set up, 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}
- \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$).
+
+ 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
@@ -810,9 +799,10 @@ a path. We start with the most general and most useful of these libraries.
\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.
+ 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
@@ -823,9 +813,10 @@ a path. We start with the most general and most useful of these libraries.
\end{tikzpicture}
\end{codeexample}
- Using the key |sequence number| we can also ``number'' the nodes
- and even refer to them later on.
- % FIXME : the automatic key highlighting fails here!
+ Using the key |sequence number| we can also ``number'' the nodes and
+ even refer to them later on.
+ %
+% FIXME: the automatic key highlighting fails here!
\begin{codeexample}[]
\begin{tikzpicture}[decoration={markings,
mark=between positions 0 and 1 step 1cm with {
@@ -839,8 +830,9 @@ a path. We start with the most general and most useful of these libraries.
\end{tikzpicture}
\end{codeexample}
- In the following example we use the distance info to place
- ``length information'' on a path:
+ In the following example we use the distance info to place ``length
+ information'' on a path:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={markings,
% Main marks
@@ -856,37 +848,38 @@ a path. We start with the most general and most useful of these libraries.
\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 non-empty \meta{node name} while the
- decoration is being processed, the following happens: The marking
- code should, among possibly other things, define a 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:
+ \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 non-empty \meta{node name} while the
+ decoration is being processed, the following happens: The marking code
+ should, among possibly other things, define a 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,
@@ -906,25 +899,24 @@ a path. We start with the most general and most useful of these libraries.
\draw decorate { (0,0) -- (3,2) };
\end{tikzpicture}
\end{codeexample}
-
- \end{key}
+ \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 executed. (They are only defined in this code):
+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
+executed. (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.
+ 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.
+ 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
@@ -937,7 +929,7 @@ a |mark| option is executed. (They are only defined in this code):
\end{tikzpicture}
\end{codeexample}
- Here is a more useful example:
+ Here is a more useful example:
\begin{codeexample}[]
\begin{tikzpicture}[decoration={
markings,% switch on markings
@@ -948,173 +940,181 @@ a |mark| option is executed. (They are only defined in this code):
\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.
+ 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.
+ 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.
+ 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.
+ %
+ 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.
+ \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.
+ \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 rotated by this much.
+ \end{key}
+ %
+ \begin{key}{/pgf/decoration/foot angle (initially 10)}
+ Footprints are rotated 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{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.
+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
- (which can be overwritten using options like |shape start width|).
- \end{key}
-
- \begin{key}{/pgf/decoration/shape height=\meta{dimension} (initially 2.5pt)}
- Works like the previous key, only for the height.
- \end{key}
-
- \begin{key}{/pgf/decoration/shape size=\meta{dimension}}
- Sets the desired width and height simultaneously.
- \end{key}
-
- For the exact places and macros where these keys store the values,
- please consult the beginning of the code of the library.
-\end{pgflibrary}
+ 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 (which can be
+ overwritten using options like |shape start width|).
+ \end{key}
+ \begin{key}{/pgf/decoration/shape height=\meta{dimension} (initially 2.5pt)}
+ Works like the previous key, only for the height.
+ \end{key}
+ \begin{key}{/pgf/decoration/shape size=\meta{dimension}}
+ Sets the desired width and height simultaneously.
+ \end{key}
+
+ For the exact places and macros where these keys store the values, please
+ consult the beginning of the code of the library.
+\end{pgflibrary}
\begin{decoration}{crosses}
- This decoration replaces the path by (diagonal) crosses. The
- following parameters influence the decoration:
- \begin{itemize}
- \item |segment length|
- determines the distance between (the centers of) consecutive crosses.
- \item |shape height|
- determines the height of each cross.
- \item |shape width|
- determines the width of each cross.
- \end{itemize}
+ This decoration replaces the path by (diagonal) crosses. The following
+ parameters influence the decoration:
+ %
+ \begin{itemize}
+ \item |segment length| determines the distance between (the centers of)
+ consecutive crosses.
+ \item |shape height| determines the height of each cross.
+ \item |shape width| determines the width of each cross.
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=crosses]
\draw [help lines] grid (3,2);
\draw [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1);
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
\begin{decoration}{triangles}
- This decoration replaces the path by triangles that point along the
- path. The following parameters influence the decoration:
- \begin{itemize}
- \item |segment length|
- determines the distance between consecutive triangles.
- \item |shape height|
- determines the height of the triangle side that is orthogonal
- to the path.
- \item |shape width|
- determines the width of the triangle.
- \end{itemize}
+ This decoration replaces the path by triangles that point along the path.
+ The following parameters influence the decoration:
+ %
+ \begin{itemize}
+ \item |segment length| determines the distance between consecutive
+ triangles.
+ \item |shape height| determines the height of the triangle side that is
+ orthogonal to the path.
+ \item |shape width| determines the width of the triangle.
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=triangles]
\draw [help lines] grid (3,2);
\draw [decorate,fill=yellow!80!black] (0,0) -- (3,1) arc (0:180:1.5 and 1);
\end{tikzpicture}
\end{codeexample}
+ %
\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 been 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}. 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 on the size of the text box (like the
- arrow shapes).} If any of these restrictions pose a problem, use
- the |markings| library instead.
-
+ 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 been 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}. 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 on 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}]
\draw [help lines] grid (3,2);
@@ -1134,17 +1134,16 @@ reasons, using the |markings| library is usually preferable.
\end{tikzpicture}
\end{codeexample}
- All shapes are positioned by the anchor that is specified via the
- |anchor| decoration option:
+ All shapes are positioned by the anchor that is specified via the |anchor|
+ decoration option:
- \begin{key}{/pgf/decoration/anchor=\meta{anchor} (initially center)}
- The anchor used to position the shape backgrounds.
- \end{key}
+ \begin{key}{/pgf/decoration/anchor=\meta{anchor} (initially center)}
+ The anchor used to position the shape backgrounds.
+ \end{key}
- 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.
-
+ 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={
shape backgrounds,shape=regular polygon,shape size=4mm}]
@@ -1155,20 +1154,18 @@ reasons, using the |markings| library is usually preferable.
\end{tikzpicture}
\end{codeexample}
- 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
- values, resulting in an initial shape. This shape is then rescaled
- using coordinate transformations so that it has the desired size
- (which may vary as we travel along the to-be-decorated path). This
- means that settings involving angles and distances may not appear
- 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{
+ 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 values, resulting in an
+ initial shape. This shape is then rescaled using coordinate transformations
+ so that it has the desired size (which may vary as we travel along the
+ to-be-decorated path). This means that settings involving angles and
+ distances may not appear 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},
my star/.style={decorate,decoration={shape backgrounds,shape=star},
star points=#1}
@@ -1180,21 +1177,20 @@ reasons, using the |markings| library is usually preferable.
\end{tikzpicture}
\end{codeexample}
- There are various keys to control the drawing of the shape
- decoration.
+ There are various keys to control the drawing of the shape decoration.
- \begin{key}{/pgf/decoration/shape=\meta{shape name} (initially circle)}
- The shape whose background path is used.
- \end{key}
+ \begin{key}{/pgf/decoration/shape=\meta{shape name} (initially circle)}
+ The shape whose background path is used.
+ \end{key}
- \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.
-
+ \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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[
decoration={shape backgrounds,shape size=.5cm,shape=signal},
@@ -1209,20 +1205,18 @@ reasons, using the |markings| library is usually preferable.
(0,0) -- (3,0);
\end{tikzpicture}
\end{codeexample}
- \end{key}
-
- \begin{key}{/pgf/decoration/shape evenly spread=\meta{number}}
- 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),
- to specify how the distance between shapes is determined. These
- keywords will only have a noticeable effect if the shapes sizes
- differ over time.
+ \end{key}
+ \begin{key}{/pgf/decoration/shape evenly spread=\meta{number}}
+ 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), to specify how the
+ distance between shapes is determined. These 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},
@@ -1240,14 +1234,14 @@ reasons, using the |markings| library is usually preferable.
\fill [paint=gray, spreading=1] (0,0) -- (3,0);
\end{tikzpicture}
\end{codeexample}
- \end{key}
-
- \begin{key}{/pgf/decoration/shape sloped=\opt{\meta{boolean}} (initially true)}
- 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|
- accordingly.
+ \end{key}
+ \begin{key}{/pgf/decoration/shape sloped=\opt{\meta{boolean}} (initially true)}
+ 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|
+ accordingly.
+ %
\begin{codeexample}[]
\tikzset{
paint/.style={draw=#1!50!black, fill=#1!50}
@@ -1262,14 +1256,14 @@ reasons, using the |markings| library is usually preferable.
(1,0) -- (3,2);
\end{tikzpicture}
\end{codeexample}
- \end{key}%
+ \end{key}
+
+ It is possible to scale the width and height of the shapes along the 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:
- It is possible to scale the width and height of the shapes along the
- 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:
-
- \begin{key}{/pgf/decoration/shape scaled=\meta{boolean} (initially false)}
+ \begin{key}{/pgf/decoration/shape scaled=\meta{boolean} (initially false)}
\begin{codeexample}[]
\tikzset{
bigger/.style={decoration={shape start size=.125cm, shape end size=.5cm}},
@@ -1284,29 +1278,28 @@ reasons, using the |markings| library is usually preferable.
\end{tikzpicture}
\end{codeexample}
- If this key is set to false (which is the default), then only the
- start width and height are used. Note that the keys |shape width|
- and |shape height| set the start and end height simultaneously.
- \end{key}
-
- \begin{key}{/pgf/decoration/shape start width=\meta{length} (initially 2.5pt)}
- The starting width of the shape.
- \end{key}%
-
- \begin{key}{/pgf/decoration/shape start height=\meta{length} (initially 2.5pt)}
- The starting height of the shape.
- \end{key}%
+ If this key is set to false (which is the default), then only the start
+ width and height are used. Note that the keys |shape width| and
+ |shape height| set the start and end height simultaneously.
+ \end{key}
- \begin{stylekey}{/pgf/decoration/shape start size=\meta{length}}
- Sets both the start height and start width simultaneously.
- \end{stylekey}%
+ \begin{key}{/pgf/decoration/shape start width=\meta{length} (initially 2.5pt)}
+ The starting width of the shape.
+ \end{key}%
- \begin{key}{/pgf/decoration/shape end width=\meta{length} (initially 2.5pt)}
- The recommended ending width of the shape. Note that this is the
- width that a shape will take only if it is drawn exactly at the end
- of the path.
+ \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}}
+ Sets both the start height and start width simultaneously.
+ \end{stylekey}%
+ \begin{key}{/pgf/decoration/shape end width=\meta{length} (initially 2.5pt)}
+ The recommended ending width of the shape. Note that this is the width
+ that a shape will take only if it is drawn exactly at the end of the
+ path.
+ %
\begin{codeexample}[]
\tikzset{
bigger/.style={decoration={shape start size=.25cm, shape end size=1cm}},
@@ -1326,35 +1319,32 @@ reasons, using the |markings| library is usually preferable.
(0,1) -- (3,.625) (0,0) -- (3,.375);
\end{tikzpicture}
\end{codeexample}
- \end{key}%
+ \end{key}
- \begin{key}{/pgf/decoration/shape end height=\meta{length}}
- The recommended ending height of the shape.
- \end{key}%
+ \begin{key}{/pgf/decoration/shape end height=\meta{length}}
+ The recommended ending height of the shape.
+ \end{key}
- \begin{stylekey}{/pgf/decoration/shape end size=\meta{length}}
- Set both the end height and end width simultaneously.
- \end{stylekey}
+ \begin{stylekey}{/pgf/decoration/shape end size=\meta{length}}
+ Set both the end height and end width simultaneously.
+ \end{stylekey}
\end{decoration}
-
-
-
\subsection{Text Decorations}
\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.
+ The decoration in this library decorates the path with some text. This can
+ be used to draw text that follows a curve.
\end{pgflibrary}
\begin{decoration}{text along path}
- This decoration decorates the path with text. This drawing of the
- text is a ``side effect'' of the decoration. The to-be-decorated
- path is only used to determine where the characters should be put
- and it is thrown away after the decoration is done. This is why no line is shown in
- the following example.
-
+ This decoration decorates the path with text. This drawing of the text is a
+ ``side effect'' of the decoration. The to-be-decorated path is only used to
+ determine where the characters should be put and it is thrown away after
+ the decoration is done. This is why no line is shown in the following
+ example.
+ %
\begin{codeexample}[]
\catcode`\|12
\begin{tikzpicture}[decoration={text along path,
@@ -1364,51 +1354,47 @@ reasons, using the |markings| library is usually preferable.
\end{tikzpicture}
\end{codeexample}
- \pgfname{} ``does its best'' to typeset the text, however you
- should note the following points:
- \begin{itemize}
- \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|.
- \item
- Each character is positioned using the center of its baseline. To
- 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$^\circ$
- (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
- 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 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 a 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)}
- Sets 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 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).
-
+ \pgfname{} ``does its best'' to typeset the text, however you should note
+ the following points:
+ %
+ \begin{itemize}
+ \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|.
+ \item Each character is positioned using the center of its baseline. To
+ 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$^\circ$ (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 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 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 a 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)}
+ Sets 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
+ 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}[]
\catcode`\|12
@@ -1420,10 +1406,10 @@ reasons, using the |markings| library is usually preferable.
\end{tikzpicture}
\end{codeexample}
}
- By following the first delimiter
- with |+|, the formatting commands are added to any existing
- formatting.
-
+ %
+ By following the first delimiter with |+|, the formatting commands are
+ added to any existing formatting.
+ %
{\catcode`\|12
\begin{codeexample}[]
\begin{tikzpicture}
@@ -1434,28 +1420,23 @@ reasons, using the |markings| library is usually preferable.
\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
- path has been reached will be stored in |\pgfdecorationrestoftext|.
- \end{key}
+ 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
- \begin{key}{/pgf/decoration/text format delimiters=\marg{before}\marg{after} (initially \char`\{|\char`\}\char`\{\char`\})}
-
- \catcode`\|13
-
- 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
- |11| or |12|.
- As |+| is used to indicate that the specified format commands
- are added to any existing ones, you should avoid using |+| as
- a delimiter.
+ \begin{key}{/pgf/decoration/text format delimiters=\marg{before}\marg{after} (initially \char`\{|\char`\}\char`\{\char`\})}
+ \catcode`\|13
+ 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 |11| or |12|. 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);
@@ -1464,18 +1445,17 @@ reasons, using the |markings| library is usually preferable.
(0,0) .. controls (0,2) and (3,0) .. (3,2);
\end{tikzpicture}
\end{codeexample}
- \end{key}
+ \end{key}
}
- \begin{key}{/pgf/decoration/text color=\meta{color} (initially black)}
- The color of the text.
- \end{key}
-
-
-\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.
+ \begin{key}{/pgf/decoration/text color=\meta{color} (initially black)}
+ The color of the text.
+ \end{key}
+ \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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
@@ -1487,62 +1467,59 @@ reasons, using the |markings| library is usually preferable.
(3,0) .. controls (3,2) and (0,2) .. (0,0);
\end{tikzpicture}
\end{codeexample}
+ %
+ \end{key}
-\end{key}
-
-\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}
-
-\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|.
+ \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}
+ \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|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
- \draw [help lines] grid (3,2);
- \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);
+\draw [help lines] grid (3,2);
+\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{key}
-\end{key}
-
-\begin{stylekey}{/pgf/decoration/text align/left}
- Aligns the text to the left end of the path.
-
-\end{stylekey}
-
-\begin{stylekey}{/pgf/decoration/text align/right}
- Aligns the text to the right end of the path.
-\end{stylekey}
+ \begin{stylekey}{/pgf/decoration/text align/left}
+ Aligns the text to the left end of the path.
+ \end{stylekey}
-\begin{stylekey}{/pgf/decoration/text align/center}
- Aligns the text to the center of the path.
-\end{stylekey}
+ \begin{stylekey}{/pgf/decoration/text align/right}
+ Aligns the text to the right end of the path.
+ \end{stylekey}
-\begin{key}{/pgf/decoration/text align/left indent=\meta{length} (initially 0pt)}
- Specifies a distance which the automaton should move along
- before it starts typesetting the text.
-\end{key}
+ \begin{stylekey}{/pgf/decoration/text align/center}
+ Aligns the text to the center of the path.
+ \end{stylekey}
-\begin{key}{/pgf/decoration/text align/right indent=\meta{length} (initially 0pt)}
- Specifies a distance before the end of the path, where
- the automaton should stop typesetting the text.
-\end{key}
+ \begin{key}{/pgf/decoration/text align/left indent=\meta{length} (initially 0pt)}
+ Specifies a distance which the automaton should move along before it
+ starts 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.
+ \begin{key}{/pgf/decoration/text align/right indent=\meta{length} (initially 0pt)}
+ Specifies 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
@@ -1552,14 +1529,14 @@ reasons, using the |markings| library is usually preferable.
(0,0) .. controls (0,2) and (3,2) .. (3,0);
\end{tikzpicture}
\end{codeexample}
+ %
+ \end{key}
-\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{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}
\draw [help lines] grid (3,2);
@@ -1569,86 +1546,65 @@ reasons, using the |markings| library is usually preferable.
(0,0) .. controls (0,2) and (3,2) .. (3,0);
\end{tikzpicture}
\end{codeexample}
-\end{key}
-
+ \end{key}
\end{decoration}
-
-
-
\begin{decoration}{text effects along path}
-
- This decoration is similar to the |text along path| decoration
- except that each character is inserted into the picture
- as a \tikzname\ node, and node options (such as |text|, |scale| and |opacity|)
- can be used to create `text effects'.
-
+ This decoration is similar to the |text along path| decoration except that
+ each character is inserted into the picture as a \tikzname\ node, and node
+ options (such as |text|, |scale| and |opacity|) can be used to create `text
+ effects'.
+ %
\begin{codeexample}[]
\bfseries\large
-\begin{tikzpicture}[decoration={text effects along path,
+\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!}, text align=center,
text effects/.cd,
character count=\i, character total=\n,
characters={evaluate={\c=\i/\n*100;}, text along path, text=red!\c!orange},
character widths={text along path, xslant=0, yscale=1}}]
-\path [postaction={decorate}, preaction={decorate,
- text effects={characters/.append={yscale=-1.5, opacity=0.5,
- text=gray, xslant=(\i/\n-0.5)*3}}}]
+\path [postaction={decorate}, preaction={decorate,
+ text effects={characters/.append={yscale=-1.5, opacity=0.5,
+ text=gray, xslant=(\i/\n-0.5)*3}}}]
(0,0) .. controls ++(2,1) and ++(-2,-1) .. (3,4);
\end{tikzpicture}
\end{codeexample}
+ There are some important differences between this decoration and the |text
+ along path| decoration:
+ %
+ \begin{itemize}
+ \item formatting (e.g., font and color) cannot be specified in the
+ decoration text. They can only be specified using the keys
+ described below.
+ \item as a consequence of using the \tikzname\ node options, this
+ decoration is only available in \tikzname.
+ \item due to the number of computations involved, this is quite a slow
+ decoration.
+ \end{itemize}
+
+ The following keys are shared with the |text along path| decoration:
+
+ \begin{key}{/pgf/decoration/text=\marg{text}}
+ Set the text this decoration will use. Braces can be used to group
+ multiple characters together, or commands that should not be expanded
+ until they are typset, for example |gr{\"o}{\ss}eren|. You should
+ \emph{not} use the formatting delimiters or math mode characters that
+ the |text along path| decoration supports.
+ \end{key}
- There are some important differences between this decoration and the
- |text along path| decoration:
-
- \begin{itemize}
- \item
- formatting (e.g., font and color)
- cannot be specified in the decoration text. They can only be specified
- using the keys described below.
- \item
- as a consequence of using the \tikzname\ node options, this
- decoration is only available in \tikzname.
- \item
- due to the number of computations involved, this is
- quite a slow decoration.
-
- \end{itemize}
-
- The following keys are shared with the |text along path|
- decoration:
-
-\begin{key}{/pgf/decoration/text=\marg{text}}
-
-
- Set the text this decoration will use. Braces can be
- used to group multiple characters together,
- or commands that should not be expanded until they are typset, for example
- |gr{\"o}{\ss}eren|. You should \emph{not} use the formatting
- delimiters or math mode characters
- that the |text along path| decoration supports.
-
-\end{key}
-
-
-
-\begin{key}{/pgf/decoration/text align=\meta{align}}
-
- This sets the alignment of the text along the path.
- The \meta{align} argument should be |left|, |right| or |center|.
- Spreading the text out, or stretching the spaces between
- words is \emph{not} supported.
-
-\end{key}
-
- The decoration text can be thought of as consisting
- of \emph{characters} arranged in to sequences of \emph{letters}
- to make \emph{words} which are separated by a \emph{word separator}.
- This, however, does not mean that you are limited to using only
- natural language as the decoration text.
+ \begin{key}{/pgf/decoration/text align=\meta{align}}
+ This sets the alignment of the text along the path. The \meta{align}
+ argument should be |left|, |right| or |center|. Spreading the text out,
+ or stretching the spaces between words is \emph{not} supported.
+ \end{key}
+ The decoration text can be thought of as consisting of \emph{characters}
+ arranged in to sequences of \emph{letters} to make \emph{words} which are
+ separated by a \emph{word separator}. This, however, does not mean that you
+ are limited to using only natural language as the decoration text.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
text={000-001-010-011-100-101-110-111},
@@ -1656,14 +1612,13 @@ reasons, using the |markings| library is usually preferable.
path from text,
word separator=-,
every letter/.style={shape=rectangle, fill=blue!20, draw=blue!40}}]
-
+
\path [decorate] (0,0);
\end{tikzpicture}
\end{codeexample}
-
- In addition, it is possible to replace characters
- with \tikzname\ code:
-
+
+ In addition, it is possible to replace characters with \tikzname\ code:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
text={000-001-010-011-100-101-110-111}, text align=center,
@@ -1673,299 +1628,229 @@ reasons, using the |markings| library is usually preferable.
replace characters=1 with {\fill [orange] circle [radius=2pt]; },
replace characters=- with {\path circle [radius=2pt]; },
every letter/.style={shape=rectangle, fill=blue!20, draw=blue!40}}]
-
+
\path [decorate] (0,0) .. controls ++(2,0) and ++(-2,0) .. (3,4);
\end{tikzpicture}
\end{codeexample}
-
- There are many keys and styles that can be used to add effects
- to the decoration text.
- Many of these keys have the parent path |/pgf/decoration/text effects/|,
- but for convenience, these keys can be accessed using the following
- key:
-
-\begin{key}{/tikz/text effects=\marg{options}}
-
- Execute every option in \marg{options} with the
- key path for each option temporarily set to |/pgf/decoration/text effects/|.
-
-\end{key}
-
-
- The following keys can be used to customise the
- appearance of text in the |text effects along path|
- decoration.
-
-
-
-
-\begin{stylekey}{/pgf/decoration/text effects/every character}
+ There are many keys and styles that can be used to add effects to the
+ decoration text. Many of these keys have the parent path
+ |/pgf/decoration/text effects/|, but for convenience, these keys can be
+ accessed using the following key:
- Set the effects that will be applied to
- every character in the decoration text. The effects
- will typically be \tikzname\ node options.
- Initially, this style is empty so the decoration simply positions
- nodes at the appropriate position along the path. In order to
- make the text `follow the path' like the |text along path| decoration
- the following key can be added to the |every character| style.
-
-\end{stylekey}
-
-
-\begin{stylekey}{/pgf/decoration/text effects/text along path}
+ \begin{key}{/tikz/text effects=\marg{options}}
+ Execute every option in \marg{options} with the key path for each option
+ temporarily set to |/pgf/decoration/text effects/|.
+ \end{key}
- This style automatically sets the \tikzname\ keys
- |transform shape| (to make the character slope with the path),
- |anchor=baseline| (to make the baseline of the characters `sit' on
- the path) and |inner xsep=0pt| (to horizontally fit each node to the character
- it contains, reducing the spacing between characters).
-
+ The following keys can be used to customise the
+ appearance of text in the |text effects along path|
+ decoration.
+
+ \begin{stylekey}{/pgf/decoration/text effects/every character}
+ Set the effects that will be applied to every character in the
+ decoration text. The effects will typically be \tikzname\ node options.
+ Initially, this style is empty so the decoration simply positions nodes
+ at the appropriate position along the path. In order to make the text
+ `follow the path' like the |text along path| decoration the following
+ key can be added to the |every character| style.
+ \end{stylekey}
+
+ \begin{stylekey}{/pgf/decoration/text effects/text along path}
+ This style automatically sets the \tikzname\ keys |transform shape| (to
+ make the character slope with the path), |anchor=baseline| (to make the
+ baseline of the characters `sit' on the path) and |inner xsep=0pt| (to
+ horizontally fit each node to the character it contains, reducing the
+ spacing between characters).
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
- text={text effects along path!}}]
-
-\path [draw=red, dotted, postaction={decorate}]
+ text={text effects along path!}}]
+
+\path [draw=red, dotted, postaction={decorate}]
(0,0) .. controls ++(1,0) and ++(-1,0) .. (3,2);
\path [draw=blue, dotted, yshift=1cm, postaction={decorate},
- text effects={text along path}]
+ text effects={text along path}]
(0,0) .. controls ++(1,0) and ++(-1,0) .. (3,2);
\end{tikzpicture}
\end{codeexample}
-\end{stylekey}
-
-
-\begin{key}{/pgf/decoration/text effects/characters=\marg{effects}}
-
- Shorthand for the |every character|.
-
-\end{key}
-
-\begin{stylekey}{/pgf/decoration/text effects/character \meta{number}}
-
- Specify additional effects for the character \meta{number}.
-
-\end{stylekey}
-
+ \end{stylekey}
-\begin{stylekey}{/pgf/decoration/text effects/every letter}
+ \begin{key}{/pgf/decoration/text effects/characters=\marg{effects}}
+ Shorthand for the |every character|.
+ \end{key}
- Specify additional effects for every letter (i.e., every character
- that isn't the word separator) in the decoration text.
-
-\end{stylekey}
+ \begin{stylekey}{/pgf/decoration/text effects/character \meta{number}}
+ Specify additional effects for the character \meta{number}.
+ \end{stylekey}
-\begin{stylekey}{/pgf/decoration/text effects/letter \meta{number}}
+ \begin{stylekey}{/pgf/decoration/text effects/every letter}
+ Specify additional effects for every letter (i.e., every character that
+ isn't the word separator) in the decoration text.
+ \end{stylekey}
- Specify the effects for letter \meta{number} in \emph{every} word.
-
-\end{stylekey}
+ \begin{stylekey}{/pgf/decoration/text effects/letter \meta{number}}
+ Specify the effects for letter \meta{number} in \emph{every} word.
+ \end{stylekey}
\begin{stylekey}{/pgf/decoration/text effects/every first letter}
-
- Specify additional effects for the first letter in \emph{every} word.
-
+ Specify additional effects for the first letter in \emph{every} word.
\end{stylekey}
-
\begin{stylekey}{/pgf/decoration/text effects/every last letter}
-
- Specify additional effects for the last letter in \emph{every} word.
-
+ Specify additional effects for the last letter in \emph{every} word.
\end{stylekey}
-
\begin{stylekey}{/pgf/decoration/text effects/every word}
-
- Specify additional effects for every word in the decoration text.
-
+ Specify additional effects for every word in the decoration text.
\end{stylekey}
-
-
\begin{stylekey}{/pgf/decoration/text effects/word \meta{number}}
-
- Specify additional effects for word \meta{number} in the decoration text.
-
+ Specify additional effects for word \meta{number} in the decoration text.
\end{stylekey}
-
-
\begin{stylekey}{/pgf/decoration/text effects/word \meta{m} letter \meta{n}}
-
- Specify additional effects for letter \meta{n} in word \meta{m} in the decoration text.
-
+ Specify additional effects for letter \meta{n} in word \meta{m} in the
+ decoration text.
\end{stylekey}
-
-
\begin{stylekey}{/pgf/decoration/text effects/every word separator}
-
- Specify additional effects for every character that is a word separator.
-
+ Specify additional effects for every character that is a word separator.
\end{stylekey}
-
-
\begin{key}{/pgf/decoration/text effects/word separator=\meta{character} (initially space)}
-
- Specify the character that is to be used as the word separator.
- This \emph{must} be a single character such as |a| or |-| or
- the special value |space| (which should be used to indicate that
- spaces should be used as the separator).
-
+ Specify the character that is to be used as the word separator. This
+ \emph{must} be a single character such as |a| or |-| or the special value
+ |space| (which should be used to indicate that spaces should be used as the
+ separator).
\end{key}
- By default, the width for each character is calculated according
- to the bounding box of the node in which it is contained.
- However, if the node is rotated or slanted, or has a substantial
- |inner sep|, this bounding box
- will be quite big. The following key enables different effects
- to be applied to the node that is used to calculate the
- width.
-
-
-
-
-\begin{stylekey}{/pgf/decoration/text effects/every character width}
-
- This style is appplied to the (invisible) nodes used for calculating
- the width of a character node.
-
-\end{stylekey}
-
-
-
-\begin{key}{/pgf/decoration/text effects/character widths=\marg{effects}}
+ By default, the width for each character is calculated according to the
+ bounding box of the node in which it is contained. However, if the node is
+ rotated or slanted, or has a substantial |inner sep|, this bounding box
+ will be quite big. The following key enables different effects to be
+ applied to the node that is used to calculate the width.
- Shorthand for the |every character width| style.
+ \begin{stylekey}{/pgf/decoration/text effects/every character width}
+ This style is applied to the (invisible) nodes used for calculating the
+ width of a character node.
+ \end{stylekey}
+ \begin{key}{/pgf/decoration/text effects/character widths=\marg{effects}}
+ Shorthand for the |every character width| style.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}[decoration={text effects along path,
+\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!}, text align=center,
text effects/.cd,
- character count=\i,
+ character count=\i,
characters={xslant=0.5, text along path, name=c-\i}}]
\path [decorate] (0,0) -- (3,2);
-\path [decorate,
+\path [decorate,
text effects={character widths={inner xsep=0pt, xslant=0}}]
(0,1) -- (3,3);
\end{tikzpicture}
\end{codeexample}
-\end{key}
+ \end{key}
- It is possible to parametrize effects, perhaps for doing
- calculations, or labelling nodes based on the number of the
- character in the decoration text. To access the number
- of the character, and the total number of characters
- the following keys can be used.
- However, these keys should \emph{not}
- be used inside the style keys given above.
-
-\begin{key}{/pgf/decoration/text effects/character count=\meta{macro}}
- Store the number of the character being typeset in \meta{macro}.
-
+ It is possible to parameterize effects, perhaps for doing calculations, or
+ labelling nodes based on the number of the character in the decoration
+ text. To access the number of the character, and the total number of
+ characters the following keys can be used. However, these keys should
+ \emph{not} be used inside the style keys given above.
+
+ \begin{key}{/pgf/decoration/text effects/character count=\meta{macro}}
+ Store the number of the character being typeset in \meta{macro}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
- text={text effects along path!},
+ text={text effects along path!},
text effects/.cd,
- path from text,
+ path from text,
character count=\i, every word separator/.style={fill=red!30},
characters={text along path, shape=circle, fill=gray!50}}]
-
+
\path [decorate, text effects={characters/.append={label=above:\footnotesize\i}}] (0,0);
\end{tikzpicture}
\end{codeexample}
-
-\end{key}
+ \end{key}
-\begin{key}{/pgf/decoration/text effects/character total=\meta{macro}}
- Store the total number of the characters in the decoration text
- in \meta{macro}.
- This key can be used with the |character count| key to produce
- some quite pleasing effects:
-
+ \begin{key}{/pgf/decoration/text effects/character total=\meta{macro}}
+ Store the total number of the characters in the decoration text in
+ \meta{macro}. This key can be used with the |character count| key to
+ produce some quite pleasing effects:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
- text={text effects along path!},
+ text={text effects along path!},
text effects/.cd,
- character count=\i, character total=\n,
+ character count=\i, character total=\n,
characters={text along path, evaluate={\c=\i/\n*100;},
text=orange!\c!blue, scale=\i/\n+0.5}}]
-
-\path [decorate]
+
+\path [decorate]
(0,0) .. controls ++(1,0) and ++(-1,0) .. (3,2);
\end{tikzpicture}
\end{codeexample}
+ \end{key}
-\end{key}
-
-\begin{key}{/pgf/decoration/text effects/letter count=\meta{macro}}
-
- Store the number of letter being typeset (i.e., the position of the character
- in the word) in \meta{macro}. Numbering starts at |1| and
- the character acting as a word separator is numbered |0|.
-
+ \begin{key}{/pgf/decoration/text effects/letter count=\meta{macro}}
+ Store the number of letter being typeset (i.e., the position of the
+ character in the word) in \meta{macro}. Numbering starts at |1| and the
+ character acting as a word separator is numbered |0|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
- text={text effects along path!},
+ text={text effects along path!},
text effects/.cd,
path from text, letter count=\i, every word separator/.style={fill=red!30},
characters={text along path, shape=circle, fill=gray!50}}]
-
+
\path [decorate, text effects={characters/.append={label=above:\footnotesize\i}}] (0,0);
\end{tikzpicture}
\end{codeexample}
+ \end{key}
-\end{key}
-
-\begin{key}{/pgf/decoration/text/effetcs/letter total=\meta{macro}}
-
- Store the number of letters in the current word in \meta{macro}.
- When the character is the word separator, this value is |0|.
-
-\end{key}
-
-\begin{key}{/pgf/decoration/text effects/word count=\meta{macro}}
- Store the number of words in the decoration text in \meta{macro}.
- Numbering starts at |1|.
- When the character is the word separator, \meta{macro}
- takes the number of the previous word. If the decoration text
- starts with a word separator \meta{macro} will be |0|.
+ \begin{key}{/pgf/decoration/text/effetcs/letter total=\meta{macro}}
+ Store the number of letters in the current word in \meta{macro}. When
+ the character is the word separator, this value is |0|.
+ \end{key}
+ \begin{key}{/pgf/decoration/text effects/word count=\meta{macro}}
+ Store the number of words in the decoration text in \meta{macro}.
+ Numbering starts at |1|. When the character is the word separator,
+ \meta{macro} takes the number of the previous word. If the decoration
+ text starts with a word separator \meta{macro} will be |0|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
- text={text effects along path!},
+ text={text effects along path!},
text effects/.cd,
path from text, word count=\i, every word separator/.style={fill=red!30},
characters={text along path, shape=circle, fill=gray!50}}]
-
+
\path [decorate, text effects={characters/.append={label=above:\footnotesize\i}}] (0,0);
\end{tikzpicture}
\end{codeexample}
-\end{key}
-
-\begin{key}{/pgf/decoration/text effects/word total=\meta{macro}}
-
- Store the total number of words in the decoration text in \meta{macro}.
-
-\end{key}
-
+ %
+ \end{key}
- It is also possible to apply effects to specific
- characters such as coloring every instance of the
- character |a|,
- or changing the font of every |T| in the decoration text:
-
-\begin{key}{/pgf/decoration/text effects/style characters=\marg{characters} with \marg{effects}}
+ \begin{key}{/pgf/decoration/text effects/word total=\meta{macro}}
+ Store the total number of words in the decoration text in \meta{macro}.
+ \end{key}
- This key enables \meta{effects} to be applied to every character
- in the decoration text that is specified in \meta{characters}.
+ It is also possible to apply effects to specific characters such as
+ coloring every instance of the character |a|, or changing the font of every
+ |T| in the decoration text:
+ \begin{key}{/pgf/decoration/text effects/style characters=\marg{characters} with \marg{effects}}
+ This key enables \meta{effects} to be applied to every character in the
+ decoration text that is specified in \meta{characters}.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}[decoration={text effects along path,
+\begin{tikzpicture}[decoration={text effects along path,
text={Falsches {\"U}ben von Xylophonmusik qu{\"a}lt jeden gr{\"o}{\ss}eren Zwerg},
text effects/.cd,
path from text,
@@ -1975,127 +1860,112 @@ reasons, using the |markings| library is usually preferable.
\path [decorate] (0,0);
\end{tikzpicture}
\end{codeexample}
+ \end{key}
-\end{key}
-
-\begin{key}{/pgf/decoration/text effects/path from text=\opt{\marg{true or false}} (default true)}
- When this key is set to |true| and the decorated path
- consists only of a single point, the decoration will calculate
- the width of the decoration text using all the specified parameters
- as if the decorated path was actually a straight line
- starting from the given point. This `virtual'
- straight line is then decorated with the text.
-
+ \begin{key}{/pgf/decoration/text effects/path from text=\opt{\marg{true or false}} (default true)}
+ When this key is set to |true| and the decorated path consists only of
+ a single point, the decoration will calculate the width of the
+ decoration text using all the specified parameters as if the decorated
+ path was actually a straight line starting from the given point. This
+ `virtual' straight line is then decorated with the text.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
- text={text effects along path!},
+ text={text effects along path!},
text effects/.cd,
path from text,
character count=\i, character total=\n,
characters={text along path, scale=\i/\n+0.5}}]
-
+
\path [decorate] (0,0);
\end{tikzpicture}
\end{codeexample}
+ \end{key}
-\end{key}
-
-
-
-\begin{key}{/pgf/decoration/text effects/path from text angle=\meta{angle}}
-
- When used in conjunction with the |path from text| key,
- the straight line that is used as the decorated path
- is rotated by \meta{angle} around the starting point.
-
+ \begin{key}{/pgf/decoration/text effects/path from text angle=\meta{angle}}
+ When used in conjunction with the |path from text| key, the straight
+ line that is used as the decorated path is rotated by \meta{angle}
+ around the starting point.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
- text={text effects along path!},
+ text={text effects along path!},
text effects/.cd,
path from text, path from text angle=60,
character count=\i, character total=\n,
characters={text along path, scale=\i/\n+0.5}}]
-
+
\path [decorate] (0,0);
\end{tikzpicture}
\end{codeexample}
+ \end{key}
-\end{key}
-
-
-\begin{key}{/pgf/decoration/text effects/fit text to path=\opt{\meta{true or false}} (default true)}
-
- This key will make the decoration increase the space between
- characters so that the entire path is used by the decoration.
-
+ \begin{key}{/pgf/decoration/text effects/fit text to path=\opt{\meta{true or false}} (default true)}
+ This key will make the decoration increase the space between characters
+ so that the entire path is used by the decoration.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
text effects/every character/.style={text along path}}]
-
-\path [draw=gray, postaction={decorate}, rotate=90]
+
+\path [draw=gray, postaction={decorate}, rotate=90]
(0,0) .. controls ++(2,0) and ++(-1,0) .. (5,-1);
\path [draw=gray, postaction={decorate}, rotate=90, yshift=-1cm,
- text effects={fit text to path}]
+ text effects={fit text to path}]
(0,0) .. controls ++(2,0) and ++(-1,0) .. (5,-1);
\end{tikzpicture}
\end{codeexample}
-\end{key}
-
-
-\begin{key}{/pgf/decoration/text effects/scale text to path=\opt{\meta{true or false}} (default true)}
+ %
+ \end{key}
- This key will make the decoration scale the text
- so that the entire path is used by the decoration.
-
+ \begin{key}{/pgf/decoration/text effects/scale text to path=\opt{\meta{true or false}} (default true)}
+ This key will make the decoration scale the text so that the entire
+ path is used by the decoration.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!},
text effects/every character/.style={text along path}}]
-
-\path [draw=gray, postaction={decorate}, rotate=90]
+
+\path [draw=gray, postaction={decorate}, rotate=90]
(0,0) .. controls ++(2,0) and ++(-1,0) .. (5,-1);
\path [draw=gray, postaction={decorate}, rotate=90, yshift=-1cm,
- text effects={scale text to path}]
+ text effects={scale text to path}]
(0,0) .. controls ++(2,0) and ++(-1,0) .. (5,-1);
\end{tikzpicture}
\end{codeexample}
-\end{key}
-
-
-\begin{key}{/pgf/decoration/text effects/reverse text}
+ %
+ \end{key}
- Reverse the order of the characters in the decoration text.
- This may be useful if using `right-to-left` languages.
- Unfortunately, any
- leading `soft' spaces in the original text will be lost.
-
+ \begin{key}{/pgf/decoration/text effects/reverse text}
+ Reverse the order of the characters in the decoration text. This may be
+ useful if using `right-to-left` languages. Unfortunately, any leading
+ `soft' spaces in the original text will be lost.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
- text={text effects along path!},
+ text={text effects along path!},
text effects/.cd,
path from text, path from text angle=60,
reverse text,
character count=\i, character total=\n,
characters={text along path, scale=\i/\n+0.5}}]
-
+
\path [decorate] (0,0) .. controls ++(1,0) and ++(-1,0) .. (3,2);
\end{tikzpicture}
\end{codeexample}
- It is important to note that the |reverse text| key reverses the
- text \emph{before} doing anything else. This means that the
- numbering of characters, letters and words will still
- still be in the normal order, so any parametrized effects
- will have to take this into account.
- Alternatively, to get the numbering
- to follow the reversed text, it is possible to reverse the path and then
- invert the scale:
-
+ It is important to note that the |reverse text| key reverses the text
+ \emph{before} doing anything else. This means that the numbering of
+ characters, letters and words will still be in the normal order, so any
+ parameterized effects will have to take this into account.
+ Alternatively, to get the numbering to follow the reversed text, it is
+ possible to reverse the path and then invert the scale:
+ %
\begin{codeexample}[]
-
\begin{tikzpicture}[decoration={text effects along path,
- text={text effects along path!},
+ text={text effects along path!},
text effects/.cd,
path from text, path from text angle=60,
character count=\i, character total=\n,
@@ -2106,65 +1976,60 @@ reasons, using the |markings| library is usually preferable.
text effects={characters/.append={scale=-1}}] (1,0);
\end{tikzpicture}
\end{codeexample}
-\end{key}
-
-\begin{key}{/pgf/decoration/text effects/group letters}
-
- Group sequences of letters together so they are treated
- as a single `character'.
+ %
+ \end{key}
+ \begin{key}{/pgf/decoration/text effects/group letters}
+ Group sequences of letters together so they are treated as a single
+ `character'.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
- text={text effects along path!},
+ text={text effects along path!},
text effects/.cd,
path from text, path from text angle=60,
every word separator/.style={fill=none},
character count=\i, character total=\n,
characters={text along path, fill=gray!50, scale=\i/\n+0.5}}]
-
+
\path [decorate] (0,0);
\path [decorate, text effects={group letters,
characters/.append={fill=red!20}}]
(1,0);
\end{tikzpicture}
\end{codeexample}
+ \end{key}
-\end{key}
-
- The order in which the |reverse text| and |group letters| keys
- are applied is important:
-
+ The order in which the |reverse text| and |group letters| keys are applied
+ is important:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
- text={text effects along path!},
+ text={text effects along path!},
text effects/.cd,
path from text, path from text angle=60,
every word separator/.style={fill=none},
character count=\i, character total=\n,
characters={text along path, fill=gray!50, scale=\i/\n+0.5}}]
-
+
\path [decorate, text effects={reverse text, group letters}] (0,0);
\path [decorate, text effects={group letters, reverse text,
characters/.append={fill=red!20}}] (1,0);
\end{tikzpicture}
\end{codeexample}
-\begin{key}{/pgf/decoration/text effects/repeat text=\opt{\meta{times}}}
-
- Usually, when the decoration runs out of text, it simply stops.
- This key will make the decoration repeat the decoration text
- for the specified number of \meta{times}. If no value is given
- the text will be repeated until the path is finished.
- There are two points to remember however.
- Firstly the numbering of characters, letters and words
- will be restarted each time the text is repeated.
- Secondly, the options for alignment, scaling or fitting
- the text to the path, fitting the path to the text,
- and so on, are computed using the decoration text before the
- decoration starts. If any of these options are given
- the behaviour of the |repeat text| key is undefined, but
- typically it will be ignored.
-
+ \begin{key}{/pgf/decoration/text effects/repeat text=\opt{\meta{times}}}
+ Usually, when the decoration runs out of text, it simply stops. This
+ key will make the decoration repeat the decoration text for the
+ specified number of \meta{times}. If no value is given the text will be
+ repeated until the path is finished. There are two points to remember
+ however. Firstly the numbering of characters, letters and words will be
+ restarted each time the text is repeated. Secondly, the options for
+ alignment, scaling or fitting the text to the path, fitting the path to
+ the text, and so on, are computed using the decoration text before the
+ decoration starts. If any of these options are given the behaviour of
+ the |repeat text| key is undefined, but typically it will be ignored.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
text={text effects along path!\ },
@@ -2172,82 +2037,73 @@ reasons, using the |markings| library is usually preferable.
repeat text,
character count=\m, character total=\n,
characters={text along path, scale=0.5+\m/\n/2}}]
-
-\path [draw=gray, ultra thin, postaction=decorate]
+
+\path [draw=gray, ultra thin, postaction=decorate]
(180:2) \foreach \a in {0,...,12}{ arc (180-\a*90:90-\a*90:1.5-\a/10) };
\end{tikzpicture}
\end{codeexample}
-\end{key}
+ \end{key}
-\begin{key}{/pgf/decoration/text effects/character command=\meta{macro}}
-
- This key specifies a command that is executed when
- each character is placed in the node. The \meta{macro} should
- be an ordinary \TeX\ macro which takes one argument. The
- argument will be a macro which when expanded will
- contain the current character.
-
+ \begin{key}{/pgf/decoration/text effects/character command=\meta{macro}}
+ This key specifies a command that is executed when each character is
+ placed in the node. The \meta{macro} should be an ordinary \TeX\ macro
+ which takes one argument. The argument will be a macro which when
+ expanded will contain the current character.
+ %
\begin{codeexample}[]
\def\mycommand#1{#1$_\n$}
\begin{tikzpicture}[decoration={text effects along path,
- text={text effects along path!},
+ text={text effects along path!},
text effects/.cd,
path from text, path from text angle=60, group letters,
word count=\n,
every word/.style={character command=\mycommand},
characters={text along path}}]
-
+
\path [decorate] (0,0);
\end{tikzpicture}
\end{codeexample}
-\end{key}
-
-
-\begin{key}{/pgf/decoration/text effects/replace characters=\meta{characters} with \marg{code}}
+ \end{key}
- Replace the node for each character in \meta{characters} with \meta{code}.
- The \meta{code} can be thought of as describing
- a little picture or marking which will be
- used instead of the character node.
- The origin will be the current point along the
- decoration path.
- Any transformations associated with
- the \meta{characters} (e.g., applied with the |every character|
- or |every letter| styles) will also be applied to \meta{code}.
-
+ \begin{key}{/pgf/decoration/text effects/replace characters=\meta{characters} with \marg{code}}
+ Replace the node for each character in \meta{characters} with
+ \meta{code}. The \meta{code} can be thought of as describing a little
+ picture or marking which will be used instead of the character node.
+ The origin will be the current point along the decoration path. Any
+ transformations associated with the \meta{characters} (e.g., applied
+ with the |every character| or |every letter| styles) will also be
+ applied to \meta{code}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration={text effects along path,
- text={text effects along path!},
+ text={text effects along path!},
text effects/.cd,
path from text, path from text angle=60,
replace characters=e with {\fill [red!20] (0,1mm) circle [radius=1mm];},
replace characters=a with {\fill [black!20] (0,1mm) circle [radius=1mm];},
character count=\i, character total=\n,
characters={text along path, scale=\i/\n+0.5}}]
-
+
\path [decorate] (0,0);
\end{tikzpicture}
\end{codeexample}
-
-\end{key}
+ \end{key}
\end{decoration}
-
\subsection{Fractal Decorations}
\begin{pgflibrary}{decorations.fractals}
- The decorations of this library can be used to create fractal
- lines. To use them, you typically have to apply the decoration
- repeatedly to an originally straight path.
+ The decorations of this library can be used to create fractal lines. To use
+ them, you typically have to apply the decoration repeatedly to an
+ originally straight path.
\end{pgflibrary}
-
\begin{decoration}{Koch curve type 1}
- This decoration replaces a straight line by a ``rectangular bump.''
- By repeatedly applying this replacement, different levels of the
- Koch curve fractal can be created. Its Hausdorff dimension is $\log
- 5/\log 3$.
+ This decoration replaces a straight line by a ``rectangular bump''. By
+ repeatedly applying this replacement, different levels of the Koch curve
+ fractal can be created. Its Hausdorff dimension is $\log 5/\log 3$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=Koch curve type 1]
\draw decorate{ (0,0) -- (3,0) };
@@ -2255,12 +2111,13 @@ reasons, using the |markings| library is usually preferable.
\draw decorate{ decorate{ decorate{ (0,-3) -- (3,-3) }}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
-
\begin{decoration}{Koch curve type 2}
- This decoration replaces a straight line by a ``rectangular sine.''
- Its Hausdorff dimension is $3/2$.
+ This decoration replaces a straight line by a ``rectangular sine''. Its
+ Hausdorff dimension is $3/2$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=Koch curve type 2]
\draw decorate{ (0,0) -- (3,0) };
@@ -2268,11 +2125,13 @@ reasons, using the |markings| library is usually preferable.
\draw decorate{ decorate{ decorate{ (0,-4) -- (3,-4) }}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
\begin{decoration}{Koch snowflake}
- This decoration replaces a straight line by a ``line with a spike.''
- The Hausdorff dimension of Koch's snowflake's is $\log 4/\log 3$.
+ This decoration replaces a straight line by a ``line with a spike''. The
+ Hausdorff dimension of Koch's snowflake's is $\log 4/\log 3$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=Koch snowflake]
\draw decorate{ (0,0) -- (3,0) };
@@ -2281,12 +2140,13 @@ reasons, using the |markings| library is usually preferable.
\draw decorate{ decorate{ decorate{ decorate{ (0,-3) -- (3,-3) }}}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{decoration}
\begin{decoration}{Cantor set}
- This decoration replaces a straight line by a ``line with a gap in
- the middle.'' The Hausdorff dimension of the Cantor set is $\log
- 2/\log 3$.
+ This decoration replaces a straight line by a ``line with a gap in the
+ middle''. The Hausdorff dimension of the Cantor set is $\log 2/\log 3$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=Cantor set,very thick]
\draw decorate{ (0,0) -- (3,0) };
@@ -2295,10 +2155,5 @@ reasons, using the |markings| library is usually preferable.
\draw decorate{ decorate{ decorate{ decorate{ (0,-1.5) -- (3,-1.5) }}}};
\end{tikzpicture}
\end{codeexample}
+ %
\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 3fbb14ca195..09666becea4 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
@@ -7,72 +7,75 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\section{To Path Library}
+\section{To Path Library}
\label{library-to-paths}
\begin{tikzlibrary}{topaths}
- This library provides predefined to paths for use with the |to|
- path operation. After loading this package, you can say for instance
- |to [loop]| to add a loop to a node.
+ This library provides predefined to paths for use with the |to| path
+ operation. After loading this package, you can say for instance |to [loop]|
+ to add a loop to a node.
- This library is loaded automatically by \tikzname, so you do not
- need to load it yourself.
+ This library is loaded automatically by \tikzname, so you do not need to
+ load it yourself.
\end{tikzlibrary}
\subsection{Straight Lines}
-The following style installs a to path that is simply a straight line
-from the start coordinate to the target coordinate.
+The following style installs a to path that is simply a straight line from the
+start coordinate to the target coordinate.
\begin{key}{/tikz/line to}
- Causes a straight line to be added to the path upon a |to| or an
- |edge| operation.
+ Causes a straight line to be added to the path upon a |to| or an |edge|
+ operation.
+ %
\begin{codeexample}[]
\tikz {\draw (0,0) to[line to] (1,0);}
\end{codeexample}
+ %
\end{key}
\subsection{Move-Tos}
-The following style installs a to path that simply ``jumps'' to the
-target coordinate.
+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.
+ 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
-exact way this curve looks can be influenced via a number of options.
+The |curve to| style causes the to path to be set to a curve. The exact way
+this curve looks can be influenced via a number of options.
\begin{key}{/tikz/curve to}
- Specifies that the |to path| should be a curve. This curve will
- leave the start coordinate at a certain angle, which can be
- specified using the |out| option. It reaches the target coordinate
- also at a certain angle, which is specified using the |in|
- option. The control points of the curve are at a certain distance
- that is computed in different ways, depending on which options are
- set.
-
- All of the following options implicitly cause the |curve to| style to
- be installed.
-
- \begin{key}{/tikz/out=\meta{angle}}
- The angle at which the curve leaves the start coordinate. If the
- start coordinate is a node, the start coordinate is the point on the
- border of the node at the given \meta{angle}. The control point
- will, thus, lie at a certain distance in the direction \meta{angle}
- from the start coordinate.
+ Specifies that the |to path| should be a curve. This curve will leave the
+ start coordinate at a certain angle, which can be specified using the |out|
+ option. It reaches the target coordinate also at a certain angle, which is
+ specified using the |in| option. The control points of the curve are at a
+ certain distance that is computed in different ways, depending on which
+ options are set.
+
+ All of the following options implicitly cause the |curve to| style to be
+ installed.
+
+ \begin{key}{/tikz/out=\meta{angle}}
+ The angle at which the curve leaves the start coordinate. If the start
+ coordinate is a node, the start coordinate is the point on the border
+ of the node at the given \meta{angle}. The control point will, thus,
+ lie at a certain distance in the direction \meta{angle} from the start
+ coordinate.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[out=45,in=135]
\draw (0,0) to (1,0)
@@ -80,26 +83,27 @@ exact way this curve looks can be influenced via a number of options.
(0,0) to (3,0);
\end{tikzpicture}
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/in=\meta{angle}}
- The angle at which the curve reaches the target coordinate.
- \end{key}
-
- \begin{key}{/tikz/relative=\meta{true or false} (default true)}
- This option tells \tikzname\ whether the |in| and |out| angles
- should be considered absolute or relative. Absolute means that an
- |out| angle of 30$^\circ$ means that the curve leaves the start
- coordinate at an angle of 30$^\circ$ relative to the paper (unless,
- of course, further transformations have been installed). A
- \emph{relative} angle is, by comparison, measured relative to a
- straight line from the start coordinate to the target
- coordinate. Thus, a relative angle of 30$^\circ$ means that the
- curve will bend to the left from the line going straight from the
- start to the target. For the target, the relative coordinate is
- measured in the same manner, namely relative to the line going from
- the start to the target. Thus, an angle of 150$^\circ$ means that
- the curve will reach target coming slightly from the left.
-
+ \end{key}
+ %
+ \begin{key}{/tikz/in=\meta{angle}}
+ The angle at which the curve reaches the target coordinate.
+ \end{key}
+
+ \begin{key}{/tikz/relative=\meta{true or false} (default true)}
+ This option tells \tikzname\ whether the |in| and |out| angles should
+ be considered absolute or relative. Absolute means that an |out| angle
+ of 30$^\circ$ means that the curve leaves the start coordinate at an
+ angle of 30$^\circ$ relative to the paper (unless, of course, further
+ transformations have been installed). A \emph{relative} angle is, by
+ comparison, measured relative to a straight line from the start
+ coordinate to the target coordinate. Thus, a relative angle of
+ 30$^\circ$ means that the curve will bend to the left from the line
+ going straight from the start to the target. For the target, the
+ relative coordinate is measured in the same manner, namely relative to
+ the line going from the start to the target. Thus, an angle of
+ 150$^\circ$ means that the curve will reach target coming slightly from
+ the left.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[out=45,in=135,relative]
\draw (0,0) to (1,0)
@@ -118,13 +122,13 @@ exact way this curve looks can be influenced via a number of options.
edge (c);
\end{tikzpicture}
\end{codeexample}
- \end{key}
-
- \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.
+ \end{key}
+ \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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid]
\node[state,initial] (q_0) {$q_0$};
@@ -150,69 +154,78 @@ exact way this curve looks can be influenced via a number of options.
edge [<-,bend left=22,looseness=0.8] (\to);
\end{tikzpicture}
\end{codeexample}
- \end{key}
-
- \begin{key}{/tikz/bend right=\meta{angle} (default \normalfont last value)}
- Works like the |bend left| option, only the bend is to the other side.
- \end{key}
-
- \begin{key}{/tikz/bend angle=\meta{angle}}
- Sets the angle to be used by the |bend left| or |bend right|, but
- without actually selecting the |curve to| or the |relative|
- option. This is useful for globally specifying a |bend angle| for a
- whole picture.
- \end{key}
-
- \begin{key}{/tikz/looseness=\meta{number} (initially 1)}
- This number specifies how ``loose'' the curve will be. In detail,
- the following happens: \tikzname\ computes the distance between the
- start and the target coordinate (if the start and/or target
- coordinate are nodes, the distance is computed between the points on
- their border). This distance is then multiplied by a fixed factor
- and also by the factor \meta{number}. The resulting distance, let us
- call it $d$, is then used as the distance of the control points from
- the start and target coordinates.
-
- The fixed factor has been chosen in such a way that if \meta{number}
- is |1|, if the |in| and |out| angles differ by
- 90$\circ$, then a quarter circle results:
- \begin{codeexample}[]
+ \end{key}
+
+ \begin{key}{/tikz/bend right=\meta{angle} (default \normalfont last value)}
+ Works like the |bend left| option, only the bend is to the other side.
+ \end{key}
+
+ \begin{key}{/tikz/bend angle=\meta{angle}}
+ Sets the angle to be used by the |bend left| or |bend right|, but
+ without actually selecting the |curve to| or the |relative| option.
+ This is useful for globally specifying a |bend angle| for a whole
+ picture.
+ \end{key}
+
+ \begin{key}{/tikz/looseness=\meta{number} (initially 1)}
+ This number specifies how ``loose'' the curve will be. In detail, the
+ following happens: \tikzname\ computes the distance between the start
+ and the target coordinate (if the start and/or target coordinate are
+ nodes, the distance is computed between the points on their border).
+ This distance is then multiplied by a fixed factor and also by the
+ factor \meta{number}. The resulting distance, let us call it $d$, is
+ then used as the distance of the control points from the start and
+ target coordinates.
+
+ The fixed factor has been chosen in such a way that if \meta{number} is
+ |1|, if the |in| and |out| angles differ by 90$\circ$, then a quarter
+ circle results:
+ %
+\begin{codeexample}[]
\tikz \draw (0,0) to [out=0,in=-90] (1,1);
\tikz \draw (0,0) to [out=0,in=-90,looseness=0.5] (1,1);
- \end{codeexample}
- \end{key}
-
- \begin{key}{/tikz/out looseness=\meta{number}}
- Specifies the looseness factor for the out distance only.
- \end{key}
-
- \begin{key}{/tikz/in looseness=\meta{number}}
- Specifies the looseness factor for the in distance only.
- \end{key}
- \begin{key}{/tikz/min distance=\meta{distance}}
- If the computed distance for the start and target coordinates are
- below \meta{distance}, then \meta{distance} is used instead.
- \end{key}
- \begin{key}{/tikz/max distance=\meta{distance}}
- If the computed distance for the start and target coordinates are
- above \meta{distance}, then \meta{distance} is used instead.
- \end{key}
- \begin{key}{/tikz/out min distance=\meta{distance}}
- 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.
- \end{key}
- \begin{key}{/tikz/in min distance=\meta{distance}}
- The minimum distance set only for the target coordinate.
- \end{key}
- \begin{key}{/tikz/in max distance=\meta{distance}}
- The maximum distance set only for the target coordinate.
- \end{key}
- \begin{key}{/tikz/distance=\meta{distance}}
- Set the minimum and maximum distance to the same value \meta{distance}. Note
- that this causes any computed distance $d$ to be ignored and
- \meta{distance} to be used instead.
+\end{codeexample}
+ \end{key}
+
+ \begin{key}{/tikz/out looseness=\meta{number}}
+ Specifies the looseness factor for the out distance only.
+ \end{key}
+
+ \begin{key}{/tikz/in looseness=\meta{number}}
+ Specifies the looseness factor for the in distance only.
+ \end{key}
+ %
+ \begin{key}{/tikz/min distance=\meta{distance}}
+ If the computed distance for the start and target coordinates are below
+ \meta{distance}, then \meta{distance} is used instead.
+ \end{key}
+ %
+ \begin{key}{/tikz/max distance=\meta{distance}}
+ If the computed distance for the start and target coordinates are above
+ \meta{distance}, then \meta{distance} is used instead.
+ \end{key}
+ %
+ \begin{key}{/tikz/out min distance=\meta{distance}}
+ 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.
+ \end{key}
+ %
+ \begin{key}{/tikz/in min distance=\meta{distance}}
+ The minimum distance set only for the target coordinate.
+ \end{key}
+ %
+ \begin{key}{/tikz/in max distance=\meta{distance}}
+ The maximum distance set only for the target coordinate.
+ \end{key}
+ %
+ \begin{key}{/tikz/distance=\meta{distance}}
+ Set the minimum and maximum distance to the same value \meta{distance}.
+ Note that this causes any computed distance $d$ to be ignored and
+ \meta{distance} to be used instead.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[out=45,in=135,distance=1cm]
\draw (0,0) to (1,0)
@@ -220,77 +233,96 @@ exact way this curve looks can be influenced via a number of options.
(0,0) to (3,0);
\end{tikzpicture}
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/out distance=\meta{distance}}
- Sets the minimum and maximum out distance.
- \end{key}
- \begin{key}{/tikz/in distance=\meta{distance}}
- Sets the minimum and maximum in distance.
- \end{key}
- \begin{key}{/tikz/out control=\meta{coordinate}}
- This option causes the \meta{coordinate} to be used as the start
- control point. All computations of $d$ are ignored. You can use a
- coordinate like |+(1,0)| to specify a point relative to the start
- coordinate.
- \end{key}
- \begin{key}{/tikz/in control=\meta{coordinate}}
- This option causes the \meta{coordinate} to be used as the target
- control point.
- \end{key}
- \begin{key}{/tikz/controls=\meta{coordinate}| and |\meta{coordinate}}
- This option causes the \meta{coordinate}s to be used as control
- points.
+ %
+ \end{key}
+ %
+ \begin{key}{/tikz/out distance=\meta{distance}}
+ Sets the minimum and maximum out distance.
+ \end{key}
+ %
+ \begin{key}{/tikz/in distance=\meta{distance}}
+ Sets the minimum and maximum in distance.
+ \end{key}
+ %
+ \begin{key}{/tikz/out control=\meta{coordinate}}
+ This option causes the \meta{coordinate} to be used as the start
+ control point. All computations of $d$ are ignored. You can use a
+ coordinate like |+(1,0)| to specify a point relative to the start
+ coordinate.
+ \end{key}
+ %
+ \begin{key}{/tikz/in control=\meta{coordinate}}
+ This option causes the \meta{coordinate} to be used as the target
+ control point.
+ \end{key}
+ %
+ \begin{key}{/tikz/controls=\meta{coordinate}| and |\meta{coordinate}}
+ This option causes the \meta{coordinate}s to be used as control points.
+ %
\begin{codeexample}[]
\tikz \draw (0,0) to [controls=+(90:1) and +(90:1)] (3,0);
\end{codeexample}
- \end{key}
+ \end{key}
\end{key}
\subsection{Loops}
\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 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
- when the opening angle (difference between |in| and |out|) is
- 30$^\circ$.
+ 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
+ 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 when the opening angle
+ (difference between |in| and |out|) is 30$^\circ$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node [circle,draw] {a} edge [in=30,out=60,loop] ();
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\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.
+ 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node [circle,draw] {a} edge [loop above] node {x} ();
\end{tikzpicture}
\end{codeexample}
+ %
+\end{stylekey}
+
+\begin{stylekey}{/tikz/loop below}
+ Works like the previous option.
+\end{stylekey}
+%
+\begin{stylekey}{/tikz/loop left}
+ Works like the previous option.
\end{stylekey}
-\begin{stylekey}{/tikz/loop below} Works like the previous option. \end{stylekey}
-\begin{stylekey}{/tikz/loop left} Works like the previous option. \end{stylekey}
-\begin{stylekey}{/tikz/loop right} Works like the previous option. \end{stylekey}
+%
+\begin{stylekey}{/tikz/loop right}
+ Works like the previous option.
+\end{stylekey}
+%
\begin{stylekey}{/tikz/every loop (initially {->,shorten >=1pt})}
- This style is installed at the beginning of
- every loop.
+ This style is installed at the beginning of every loop.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every loop/.style={}]
\draw (0,0) to [loop above] () to [loop right] ()
to [loop below] () to [loop left] ();
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
-
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
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 c896037c584..691d4e1d790 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
@@ -11,13 +11,12 @@
\section{Entity-Relationship Diagram Drawing Library}
\begin{tikzlibrary}{er}
- This packages provides styles for drawing entity-relationship
- diagrams.
+ This packages provides styles for drawing entity-relationship diagrams.
\end{tikzlibrary}
-This library is intended to help you in creating E/R-diagrams. It defines
-only few new styles, but using the style |entity| instead of
-saying |rectangle,draw| makes the code more expressive.
+This library is intended to help you in creating E/R-diagrams. It defines only
+few new styles, but using the style |entity| instead of saying |rectangle,draw|
+makes the code more expressive.
\subsection{Entities}
@@ -25,27 +24,29 @@ saying |rectangle,draw| makes the code more expressive.
The package defines a simple style for drawing entities:
\begin{stylekey}{/tikz/entity}
- This style is to be used with nodes that represent entity types. It
- causes the node's shape to be set to a rectangle that is drawn and
- whose minimum size and width are set to sensible values.
-
- Note that this style is called |entity| despite the fact that it is
- to be used for nodes representing entity \emph{types} (the
- difference between an entity and an entity type is the same as the
- difference between an object and a class in object-oriented
- programming). If this bothers you, feel free to define a style
- |entity type| instead.
+ This style is to be used with nodes that represent entity types. It causes
+ the node's shape to be set to a rectangle that is drawn and whose minimum
+ size and width are set to sensible values.
+
+ Note that this style is called |entity| despite the fact that it is to be
+ used for nodes representing entity \emph{types} (the difference between an
+ entity and an entity type is the same as the difference between an object
+ and a class in object-oriented programming). If this bothers you, feel free
+ to define a style |entity type| instead.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node[entity] (sheep) {Sheep};
\node[entity] (genome) [right=of sheep] {Genome};
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/every entity}
- This style is evoked by the style |entity|. To change the
- appearance of entities, you can change this style.
+ This style is evoked by the style |entity|. To change the appearance of
+ entities, you can change this style.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[every entity/.style={draw=blue!50,fill=blue!20,thick}]
@@ -53,18 +54,19 @@ The package defines a simple style for drawing entities:
\node[entity] (genome) [right=of sheep] {Genome};
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
-
\subsection{Relationships}
-Relationships are drawn using styles that are very similar to the
-styles for entities.
+Relationships are drawn using styles that are very similar to the 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.
+ This style works like |entity|, only it is to be used for relationships.
+ Again, |relationship|s are actually relationship types.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node[entity] (sheep) at (0,0) {Sheep};
@@ -74,10 +76,12 @@ styles for entities.
edge (genome);
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/every relationship}
- Works like |every entity|.
+ Works like |every entity|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[every entity/.style={fill=blue!20,draw=blue,thick},
@@ -89,16 +93,17 @@ styles for entities.
edge (genome);
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
-
\subsection{Attributes}
\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.
+ 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node[entity] (sheep) {Sheep}
@@ -106,23 +111,25 @@ styles for entities.
child {node[attribute] {color}};
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every pin edge/.style=draw]
\node[entity,pin={[attribute]60:name},pin={[attribute]120:color}] {Sheep};
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/key attribute}
- This style is intended for key attributes. By default, the will
- 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.
+ This style is intended for key attributes. By default, the will 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}
-
\begin{stylekey}{/tikz/every attribute}
- This style is used with every attribute, and therefore also for every key attribute.
+ This style is used with every attribute, and therefore also for every key
+ attribute.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[text depth=1pt,
@@ -138,6 +145,7 @@ styles for entities.
edge (genome);
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
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
index 793d4c94618..db97f4400e1 100644
--- 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
@@ -6,46 +6,94 @@
% 2. under the GNU Free Documentation License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
\section{Externalization Library}
+\label{section-libs-external}
+
{
\pgfkeys{
- /pdflinks/search key prefixes in/.add={/tikz/external/,}{}
+ /pdflinks/search key prefixes in/.add={/tikz/external/,}{}
}
-\label{section-libs-external}
-{\noindent {\emph{by Christian Feuers\"anger}}}
+{\noindent {\emph{by Christian Feuersänger}}}
\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.
+ 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.
+ 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:
+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.
+ \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}.
+%
+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|.
+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.
-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).
+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.
-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 currently only supported for \LaTeX.
-%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|).
+
+Currently, the basic layer backend |\beginpgfgraphicnamed| $\dotsc$
+|\endpgfgraphicnamed| relies on \LaTeX\ only, so externalization is currently
+only supported for \LaTeX.
+%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.
+
+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
@@ -68,114 +116,227 @@ 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
+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, tikz syntax=false]
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.
-
+%
+\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.
+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.
+ 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.
- 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).
- 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}.
- 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}.
- 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}
+ \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).
+ 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 depends on the value of |\pgfsysdriver|. For |pgfsys-pdftex.def|, it is
+ The default depends on the value of |\pgfsysdriver|. For
+ |pgfsys-pdftex.def|, it 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.}.
-
- Other drivers result in slightly different calls. There is support for |lualatex|, |xelatex|, and |dvips|. The precise values are written to the |.log| file as soon as you attempt to compile a document.
-
- 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.
+ %
+ \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.}.
+
+ Other drivers result in slightly different calls. There is support for
+ |lualatex|, |xelatex|, and |dvips|. The precise values are written to the
+ |.log| file as soon as you attempt to compile a document.
+
+ 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]|.
+ 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 an external files.
-There are, however, some points which need your attention when you try to use
+The |external| library comes with extra support for |\label| and |\ref| (and
+other commands which usually store information in the |.aux| file) inside an
+external files.
+
+In particular, it supports the two use-cases
+%
\begin{enumerate}
- \item[a)] |\ref| to something in the main document inside an externalized graphics or
- \item[b)] |\label| in the externalized graphics which is referenced in the main document.
+ \item[a)] |\ref| to something in the main document inside 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.
+The only restriction is that you need to compile your document multiple times
+(as usual for references).
-Point b) is implemented 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 once again 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 implemented 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.
-\begin{key}{/tikz/external/aux in dpth=\marg{boolean} (initially true)}
- Allows to disable the feature. Disabling it will safe one |\newwrite| command, i.e.\ a write register.
+\paragraph{NOTE:}
+support for a) is unavailable for versions up to and including \pgfname\ 3.0.1.
- Also see the |disable dependency files| feature.
+\begin{key}{/tikz/external/aux in dpth=\marg{boolean} (initially true)}
+ Allows to enable or disable the feature which handles references and labels
+ as part of image externalization. Disabling it will safe one |\newwrite|
+ command, i.e.\ a write register.
+
+ Also see the |disable dependency files| feature.
+
+ Here are some implementation details on how references within/from external
+ graphics work for those who would like to know the details:
+
+ For point a), a |\ref| inside of an externalized graphics works by reading
+ the main document's |.aux| file. To this end, the standard
+ |mode=convert with system call| detects such references and reschedules the
+ externalization to |\end{document}.|\footnote{Note that this requires the
+ \texttt{atveryend} package. The purpose to reschedule the externalization
+ is to access the main job's aux file, but only after it has been written
+ completely.} Other values of |mode| require just one attempt to externalize
+ the picture.
+
+ Note that |\pageref| is not supported (sorry).
+
+ Point b) works as follows: 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 once again 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}
+
+ This does also work if a |\label|/|\ref| combination is implemented itsself
+ by a |tikzpicture| (a feature offered by |pgfplots|).
\end{key}
-
\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:
+
+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|.
+ \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.
+ 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,
+ 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.
+ %
+ 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}).
+ 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.
+ 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.
+ 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}.
+ Please note that |prefix| will still be prepended to \marg{file name}.
+ %
\begin{codeexample}[code only]
\documentclass{article}
% main document, called main.tex
@@ -204,18 +365,27 @@ A simple image is \tikz \fill (0,0) circle(5pt);. % will be written to 'figures/
\end{tikzpicture}
\end{document}
\end{codeexample}
+ %
\begin{codeexample}[code only, tikz syntax=false]
pdflatex -shell-escape main
\end{codeexample}
+ %
\end{command}
\begin{key}{/tikz/external/figure name=\marg{name}}
- Same as |\tikzsetfigurename|\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{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
@@ -249,49 +419,77 @@ pdflatex -shell-escape main
\end{tikzpicture}
\end{document}
\end{codeexample}
- The scope of |figure name| ends with the next closing brace.
+ %
+ 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|.
+ 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|.
+ 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).
+ 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}.
+ 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
- The effect is that if \meta{file name} changes, the external graphics associated with the picture shall be remade.
+ \meta{target file}|.\tikzexternalimgextension: |\meta{file name}.
- 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|).
+ The effect is that if \meta{file name} changes, the external graphics
+ associated with the picture shall be remade.
- \paragraph{Limitations:} this command is currently only supported for |mode=list and make| and the generated |makefile|.
+ 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.
+ 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/disable dependency files}
- Allows to (irreversibly) disable the generation of file dependencies. Disabling it will safe one |\newwrite| command, i.e.\ a write register. Note that the write register is only allocated if the feature has been used at all. This key needs to be provided as argument to |\tikzexternalize| (or it needs to be set before calling |\tikzexternalize|).
+ Allows to (irreversibly) disable the generation of file dependencies.
+ Disabling it will safe one |\newwrite| command, i.e.\ a write register.
+ Note that the write register is only allocated if the feature has been used
+ at all. This key needs to be provided as argument to |\tikzexternalize| (or
+ it needs to be set before calling |\tikzexternalize|).
- Also see the |aux in dpth| key.
+ Also see the |aux in dpth| key.
\end{key}
\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.
-
+ 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);
+ \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
+ %
+ 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);
@@ -304,59 +502,87 @@ pdflatex -shell-escape main
\tikz \draw (0,0) -- (1,1);
\end{codeexample}
- will only apply |force remake| to the second figure.
+ 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|.
+ 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.
+ 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.
+ 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.
-
+ 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|).
+ %
+ For \LaTeX, the feature lasts until the next |\end|\marg{$\cdot$} (this
+ holds for every call to |\tikzset|).
\end{key}
\begin{key}{/tikz/external/up to date check=\marg{choice} (initially md5)}
- The |external| lib has to decide when some existing figure is up-to-date. In such a case, it can be used without remaking it. Outdated pictures will be remade.
-
- The key |up to date check| allows to choose among a couple of heuristics which are supposed to catch the most important reasons to remake a figure.
-
- The |up to date check| can be overrule by any of the |force remake| or |remake next| keys: if one of them is true, the figure is not up-to-date.
-
- The choice \declare{simple} is based on the existence of the file: the file is
- up-to-date if and only if it exists.
-
- The choice \declare{md5} generates an MD5 checksum of the picture for which the up-to-date check is running. The MD5 is compared against the MD5 of the previous run, which, in turn, will be written into an extra file with the extension |.md5|. This file will be modified if and only if the MD5 comparison indicates a difference. The MD5 computation is based on the pdf\TeX\ method |\pdfmdfivesum|. If it is unavailable for some reason, the choice |diff| will be used instead.
-
- The choice \declare{diff} is the same as MD5 -- except that it compares the picture content as-is instead of a hash. The |.md5| file will be used to compare an old version with the current one -- but its content is some ``normalized'' version of the picture for internal use.
-
- \paragraph{Attention:} the content--based strategies |md5| and |diff| operate on the picture content -- and only on the picture content. Here, ``picture content'' only includes the top--level tokens; no expansion is applied and no included files are part of the strategies. If you change preamble styles, you have to rebuild the figures manually (for example by deleting the generated graphics files). If you have include files, consider using |\tikzpicturedependsonfile| and its variants. Since this key provides heuristics, you should always remake your figures before you finally publish your document. Example: Suppose we have the following picture which depends on a command |\mycommand|:
+ The |external| lib has to decide when some existing figure is up-to-date.
+ In such a case, it can be used without remaking it. Outdated pictures will
+ be remade.
+
+ The key |up to date check| allows to choose among a couple of heuristics
+ which are supposed to catch the most important reasons to remake a figure.
+
+ The |up to date check| can be overrule by any of the |force remake| or
+ |remake next| keys: if one of them is true, the figure is not up-to-date.
+
+ The choice \declare{simple} is based on the existence of the file: the file
+ is up-to-date if and only if it exists.
+
+ The choice \declare{md5} generates an MD5 checksum of the picture for which
+ the up-to-date check is running. The MD5 is compared against the MD5 of the
+ previous run, which, in turn, will be written into an extra file with the
+ extension |.md5|. This file will be modified if and only if the MD5
+ comparison indicates a difference. The MD5 computation is based on the
+ pdf\TeX\ method |\pdfmdfivesum|. If it is unavailable for some reason, the
+ choice |diff| will be used instead.
+
+ The choice \declare{diff} is the same as MD5 -- except that it compares the
+ picture content as-is instead of a hash. The |.md5| file will be used to
+ compare an old version with the current one -- but its content is some
+ ``normalized'' version of the picture for internal use.
+
+ \paragraph{Attention:}
+ the content--based strategies |md5| and |diff| operate on the picture
+ content -- and only on the picture content. Here, ``picture content'' only
+ includes the top--level tokens; no expansion is applied and no included
+ files are part of the strategies. If you change preamble styles, you have
+ to rebuild the figures manually (for example by deleting the generated
+ graphics files). If you have include files, consider using
+ |\tikzpicturedependsonfile| and its variants. Since this key provides
+ heuristics, you should always remake your figures before you finally
+ publish your document. Example: Suppose we have the following picture which
+ depends on a command |\mycommand|:
+ %
\begin{codeexample}[code only]
\def\mycommand{My comment}
@@ -364,30 +590,50 @@ pdflatex -shell-escape main
\node at (0,0) {\mycommand};
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
- What happens if you change ``My comment'' to ``My super comment''? Well, |external| will \emph{not} pick it up; you will need to handle this manually. However, if you modify anything between |\begin{tikzpicture}| and |\end{tikzpicture}|, the external library \emph{will} pick it up and regenerate the picture.
-
- The |up to date check| is applied for |mode=convert with system call| and |mode=list and make|.
+ %
+ What happens if you change ``My comment'' to ``My super comment''? Well,
+ |external| will \emph{not} pick it up; you will need to handle this
+ manually. However, if you modify anything between |\begin{tikzpicture}| and
+ |\end{tikzpicture}|, the external library \emph{will} pick it up and
+ regenerate the picture.
+
+ The |up to date check| is applied for |mode=convert with system call| and
+ |mode=list and make|.
\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|.
+ 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|.
+ 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 your log file).
+\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 your log
+ file).
+ %
\begin{codeexample}[code only]
\documentclass{article}
% main document, called main.tex
@@ -423,35 +669,62 @@ A simple image is \tikz \fill (0,0) circle(5pt);.
\begin{codeexample}[code only, tikz syntax=false]
pdflatex main
\end{codeexample}
-generates |main.figlist| containing
+ %
+ generates |main.figlist| containing
+ %
\begin{codeexample}[code only, tikz syntax=false]
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 applied according to the |up to date check| key.
-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
+ 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 applied according to the
+ |up to date check| key. 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, tikz syntax=false]
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
+ %
+ 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, tikz syntax=false]
% step 1: generate main.makefile:
pdflatex main
@@ -460,42 +733,70 @@ make -j 2 -f main.makefile
% step 3: include the graphics:
pdflatex main
\end{codeexample}
- \noindent This last make method is optional: |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.
-
-
+ %
+ \noindent This last make method is optional: |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.
+ 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.
+ 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}.
+ 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.
+ 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.
+ 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.
+ 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.
+ 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-negative 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:
+ 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-negative 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}
@@ -511,6 +812,7 @@ pdflatex main
\tikzset{external/optimize command away={\myExpensiveMacroWithThreeArgs}{3}}
\end{codeexample}
+
\begin{codeexample}[code only]
% A command with optional argument:
\newcommand{\aFurtherExample}[3][]{Very expensive!}
@@ -519,10 +821,14 @@ pdflatex main
% 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.
+ %
+ 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!
+ % this picture is currently converted!
\end{tikzpicture}
This here is outside of the converted picture and contains \myExpensiveMacro. It will be discarded.
@@ -531,41 +837,59 @@ This call: \myExpensiveMacro[argument=value]{Argument} as well.
And this here: \myExpensiveMacro{Argument} also.
\end{codeexample}
- The default is to optimize |\includegraphics| away.
+ The default is to optimize |\includegraphics| away.
- This key is actually a style which sets the |optimize/install| and |optimize/restore| keys.
+ 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.
+ 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.
+ 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.
+ 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}.
+ 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}.
+ Its description can be found in the corresponding basic layer documentation
+ on page~\pageref{pgf:includeexternalkey}.
- Just one example here: you can use
+ 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.
+ %
+ to manually change the viewport (bounding box) for included graphics.
- Another example (of probably limited use) is
+ 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
+ %
+ \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}}}
@@ -574,48 +898,98 @@ And this here: \myExpensiveMacro{Argument} also.
\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 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|.
+ 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.
+ 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,
+The standard run |pdflatex |\meta{main document} causes the |external| library
+to check every occurrence of |\begin{tikzpicture}| and every |\tikz| short
+command. 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, tikz syntax=false]
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
+%
+\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, tikz syntax=false]
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.
-
+%
+\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.
+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
+
+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, tikz syntax=false]
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
+%
+\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
@@ -642,7 +1016,9 @@ 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, tikz syntax=false]
tikzexternal.sty
main.tex
@@ -650,25 +1026,59 @@ 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 external graphics).
+%
+\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 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.
-Just copy the |.sty| file into the directory of your |main.tex| file and use it as part of your document.
+\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.
-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.
+\subsection{\texttt{eps} Graphics Export}
-\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.
+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.
-\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.
-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:
+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
@@ -690,58 +1100,119 @@ The |external| library can be customized to export bitmap images -- with the hel
}
}
\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 current environment (or until the next closing curly brace `|}|').
+%
+\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
+current environment (or until the next closing curly brace `|}|').
\begin{key}{/pgf/images/external info=\marg{boolean} (initially false)}
- If this key is activated, the size for any externalized image will be stored explicitly into the associated |.dpth| file.
+ 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}.
+ 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.
+It is allowed if a picture contains references, for example
+|\tikz \node {Reference to \ref{a:label}};|.
-Thus, you \emph{will} need to invoke |pdflatex -jobname |\meta{image}| |\meta{mainfile} \emph{manually} for any image which contains references.
+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.
-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.
+Thus, you \emph{will} need to invoke
+|pdflatex -jobname |\meta{image}| |\meta{mainfile} \emph{manually}
+for any image which contains references.
-\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|.
+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.
- \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).
+\subsubsection{Compatibility With Other Libraries or Packages}
- To fix those problems, use
+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
+ % don't include package XYZ here
}{%
- \usepackage{pdfpages}
- \usepackage{vmargin}
- ...
+ \usepackage{pdfpages}
+ \usepackage{vmargin}
+ ...
}%
\end{codeexample}
- This uses the requested packages for the main document, but not for the single, exported graphics.
+ %
+ 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.
+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).
+
+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:
+
+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}
@@ -750,6 +1221,6 @@ This library is fully compatible with |\beginpgfgraphicnamed|$\dotsc$|\endpgfgra
\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-fadings.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fadings.tex
index 3a2b89abd1c..c42e10a2164 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fadings.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fadings.tex
@@ -12,17 +12,17 @@
\label{section-library-fadings}
\begin{pgflibrary}{fadings}
- The package defines a number of fadings, see
- Section~\ref{section-tikz-transparency} for an introduction. The
- \tikzname\ version defines special \tikzname\ commands for creating
- fadings. These commands are explained in
- Section~\ref{section-tikz-transparency}.
+ The package defines a number of fadings, see
+ Section~\ref{section-tikz-transparency} for an introduction. The
+ \tikzname\ version defines special \tikzname\ commands for creating
+ fadings. These commands are explained in
+ Section~\ref{section-tikz-transparency}.
\end{pgflibrary}
\newcommand\fadingindex[1]{%
\index{#1@\protect\texttt{#1} fading}%
\index{Fadings!#1@\protect\texttt{#1}}%
- \texttt{#1}&
+ \texttt{#1}&
\begin{tikzpicture}[baseline=5mm-.5ex]
\fill [black!20] (0,0) rectangle (1,1);
\path [pattern=checkerboard,pattern color=black!30] (0,0) rectangle (1,1);
@@ -33,19 +33,19 @@
\noindent
\begin{tabular}{ll}
- \emph{Fading name} & \emph{Example (solid blue faded on checkerboard)} \\[1mm]
- \fadingindex{west}
- \fadingindex{east}
- \fadingindex{north}
- \fadingindex{south}
- \fadingindex{circle with fuzzy edge 10 percent}
- \fadingindex{circle with fuzzy edge 15 percent}
- \fadingindex{circle with fuzzy edge 20 percent}
- \fadingindex{fuzzy ring 15 percent}
+ \emph{Fading name} & \emph{Example (solid blue faded on checkerboard)} \\[1mm]
+ \fadingindex{west}
+ \fadingindex{east}
+ \fadingindex{north}
+ \fadingindex{south}
+ \fadingindex{circle with fuzzy edge 10 percent}
+ \fadingindex{circle with fuzzy edge 15 percent}
+ \fadingindex{circle with fuzzy edge 20 percent}
+ \fadingindex{fuzzy ring 15 percent}
\end{tabular}
-%%% 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-fit.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fit.tex
index 2a521518498..1e0fbbd8f25 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,31 +12,32 @@
\label{section-library-fit}
\begin{tikzlibrary}{fit}
- The library defines (currently only two) options for fitting a node
- so that it contains a set of coordinates.
+ 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 options become available:
\begin{key}{/tikz/fit=\meta{coordinates or nodes}}
- This option must be given to a |node| path command. The
- \meta{coordinates or nodes} should be a sequence of \tikzname\
- coordinates or node names, one directly after the other without
- commas (like with the |plot coordinates| path operation). Examples
- are |(1,0) (2,2)| or |(a) (1,0) (b)|, where |a| and |b| are nodes.
-
- For this sequence of coordinates, a minimal bounding box is computed
- that encompasses all the listed \meta{coordinates or nodes}. For
- coordinates in the list, the bounding box is guaranteed to contain
- this coordinate, for nodes it is guaranteed to contain the |east|,
- |west|, |north| and |south| anchors of the node. In principle (the
- details will be explained in a moment), things are now set up such
- that the text box of the node will be exactly this bounding box.
-
- Here is an example: We fit several points in a rectangular node. By
- setting the |inner sep| to zero, we see exactly the text box of the
- node. Then we fit these points again in a circular node. Note how
- the circle encompasses exactly the same bounding box.
+ This option must be given to a |node| path command. The \meta{coordinates
+ or nodes} should be a sequence of \tikzname\ coordinates or node names,
+ one directly after the other without commas (like with the
+ |plot coordinates| path operation). Examples are |(1,0) (2,2)| or
+ |(a) (1,0) (b)|, where |a| and |b| are nodes.
+
+ For this sequence of coordinates, a minimal bounding box is computed that
+ encompasses all the listed \meta{coordinates or nodes}. For coordinates in
+ the list, the bounding box is guaranteed to contain this coordinate, for
+ nodes it is guaranteed to contain the |east|, |west|, |north| and |south|
+ anchors of the node. In principle (the details will be explained in a
+ moment), things are now set up such that the text box of the node will be
+ exactly this bounding box.
+
+ Here is an example: We fit several points in a rectangular node. By setting
+ the |inner sep| to zero, we see exactly the text box of the node. Then we
+ fit these points again in a circular node. Note how the circle encompasses
+ exactly the same bounding box.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[inner sep=0pt,thick,
dot/.style={fill=blue,circle,minimum size=3pt}]
@@ -52,44 +53,45 @@ When you load this library, the following options become available:
\end{tikzpicture}
\end{codeexample}
- Every time the |fit| option is used, the following style is also
- applied to the node:
- \begin{stylekey}{/tikz/every fit (initially \normalfont empty)}
- Set this style to change the appearance of a node that uses the
- |fit| option.
- \end{stylekey}
-
- The exact effects of the |fit| option are the following:
- \begin{enumerate}
- \item A minimal bounding box containing all coordinates is
- computed. Note that if a coordinate like |(a)| is used that
- contains 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 |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.
- \item After the node has been typeset, its height and depth are
- adjusted such that they add up to the height of the computed
- bounding box and such that the text of the node is vertically
- centered inside the box.
- \end{enumerate}
- The above means that, generally speaking, if the node contains text
- like |box| in the above example, it will be centered inside the
- box. It will be difficult to put the text elsewhere, in particular,
- changing the |anchor| of the node will not have the desired
- effect. Instead, what you should do is to create a node with the
- |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.
-
- 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:
+ Every time the |fit| option is used, the following style is also applied to
+ the node:
+ %
+ \begin{stylekey}{/tikz/every fit (initially \normalfont empty)}
+ Set this style to change the appearance of a node that uses the |fit|
+ option.
+ \end{stylekey}
+
+ The exact effects of the |fit| option are the following:
+ %
+ \begin{enumerate}
+ \item A minimal bounding box containing all coordinates is computed.
+ Note that if a coordinate like |(a)| is used that contains 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 |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.
+ \item After the node has been typeset, its height and depth are
+ adjusted such that they add up to the height of the computed
+ bounding box and such that the text of the node is vertically
+ centered inside the box.
+ \end{enumerate}
+ %
+ The above means that, generally speaking, if the node contains text like
+ |box| in the above example, it will be centered inside the box. It will be
+ difficult to put the text elsewhere, in particular, changing the |anchor|
+ of the node will not have the desired effect. Instead, what you should do
+ is to create a node with the |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.
+
+ 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:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[inner sep=0pt,thick,
dot/.style={fill=blue,circle,minimum size=3pt}]
@@ -105,8 +107,8 @@ When you load this library, the following options become available:
\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}
[vertex/.style={minimum size=2pt,fill,draw,circle},
@@ -135,14 +137,13 @@ When you load this library, the following options become available:
\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.
-
+ 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}]
@@ -156,5 +157,5 @@ When you load this library, the following options become available:
\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
index 1be2d41e7b8..238d0c16ad2 100644
--- 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
@@ -11,109 +11,81 @@
\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.
+ 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:
+\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.
-
-
+ \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:
+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.
-
+ 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}:
+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}.
-
+ 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);
@@ -122,30 +94,27 @@
\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}
-
+ 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-folding.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-folding.tex
index 93f832f826c..58a7d4c9a19 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-folding.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-folding.tex
@@ -9,17 +9,15 @@
\section{Paper Folding Diagrams Library}
-
\label{section-calender-folding}
\begin{tikzlibrary}{folding}
- This library defines pic types for creating paper folding
- diagrams. Many thanks to Nico van Cleemput for providing most of the
- code.
+ This library defines pic types for creating paper folding diagrams. Many
+ thanks to Nico van Cleemput for providing most of the code.
\end{tikzlibrary}
Here is a big example that produces a diagram for a calendar:
-
+%
\begin{codeexample}[leave comments]
\sffamily\scriptsize
\tikz \pic [
@@ -50,29 +48,36 @@ Here is a big example that produces a diagram for a calendar:
The foldings are sorted by number of faces.
\begin{pictype}{tetrahedron folding}{}
- This pic type draws a folding diagram for a tetrahedron.
- The following keys influence the pic:
- \begin{key}{/tikz/folding line length=\meta{dimension}}
- Sets the length of the base line for folding. For the dodecahedron
- this is the length of all the sides of the pentagons.
- \end{key}
- \begin{key}{/tikz/face 1=\meta{code}}
- The \meta{code} is executed for the first face of the
- dodecahedron. When it is executed, the coordinate system will have
- been shifted and rotated such that it lies at the middle of the
- first face of the dodecahedron.
- \end{key}
- \begin{key}{/tikz/face 2=\meta{code}}
- Same as |face 1|, but for the second face.
- \end{key}
- \begin{key}{/tikz/face 3=\meta{code}}
- \end{key}
- \begin{key}{/tikz/face 4=\meta{code}}
- \end{key}
- There are further similar options for more faces (for commands
- shown later).
-
- Here is a simple example:
+ This pic type draws a folding diagram for a tetrahedron. The following keys
+ influence the pic:
+ %
+ \begin{key}{/tikz/folding line length=\meta{dimension}}
+ Sets the length of the base line for folding. For the dodecahedron this
+ is the length of all the sides of the pentagons.
+ \end{key}
+ %
+ \begin{key}{/tikz/face 1=\meta{code}}
+ The \meta{code} is executed for the first face of the dodecahedron.
+ When it is executed, the coordinate system will have been shifted and
+ rotated such that it lies at the middle of the first face of the
+ dodecahedron.
+ \end{key}
+ %
+ \begin{key}{/tikz/face 2=\meta{code}}
+ Same as |face 1|, but for the second face.
+ \end{key}
+ %
+ \begin{key}{/tikz/face 3=\meta{code}}
+ \end{key}
+ %
+ \begin{key}{/tikz/face 4=\meta{code}}
+ \end{key}
+ %
+ There are further similar options for more faces (for commands shown
+ later).
+
+ Here is a simple example:
+ %
\begin{codeexample}[]
\tikz \pic [
transform shape,
@@ -84,14 +89,16 @@ The foldings are sorted by number of faces.
] {tetrahedron folding};
\end{codeexample}
- The appearance of the cut and folding lines can be influenced using
- the following styles:
- \begin{stylekey}{/tikz/every cut (initially \normalfont empty)}
- Executed for every line that should be cut using scissors.
- \end{stylekey}
- \begin{stylekey}{/tikz/every fold (initially help lines)}
- Executed for every line that should be
- folded.
+ The appearance of the cut and folding lines can be influenced using the
+ following styles:
+ %
+ \begin{stylekey}{/tikz/every cut (initially \normalfont empty)}
+ Executed for every line that should be cut using scissors.
+ \end{stylekey}
+ %
+ \begin{stylekey}{/tikz/every fold (initially help lines)}
+ Executed for every line that should be folded.
+ %
\begin{codeexample}[]
\tikz \pic[
every cut/.style=red,
@@ -99,138 +106,147 @@ The foldings are sorted by number of faces.
folding line length=6mm
] { tetrahedron folding };
\end{codeexample}
- \end{stylekey}
-
- There is one style that is mainly useful for the present
- documentation:
- \begin{stylekey}{/tikz/numbered faces}
- Sets |face |\meta{i} to |\node {|\meta{i}|};| for all~$i$.
- \end{stylekey}
-
+ \end{stylekey}
+
+ There is one style that is mainly useful for the present documentation:
+ %
+ \begin{stylekey}{/tikz/numbered faces}
+ Sets |face |\meta{i} to |\node {|\meta{i}|};| for all~$i$.
+ \end{stylekey}
\end{pictype}
\begin{pictype}{tetrahedron truncated folding}{}
- A folding of a truncated tetrahedron.
+ A folding of a truncated tetrahedron.
+ %
\begin{codeexample}[width=5cm]
\tikz \pic [folding line length=6mm, numbered faces, transform shape]
{ tetrahedron truncated folding };
\end{codeexample}
+ %
\end{pictype}
-
\begin{pictype}{cube folding}{}
- A folding of a cube.
+ A folding of a cube.
+ %
\begin{codeexample}[]
\tikz \pic [folding line length=6mm, numbered faces, transform shape]
{ cube folding };
\end{codeexample}
+ %
\end{pictype}
-
\begin{pictype}{cube truncated folding}{}
- A folding of a truncated cube.
+ A folding of a truncated cube.
+ %
\begin{codeexample}[width=5cm]
\tikz \pic [folding line length=6mm, numbered faces, transform shape]
{ cube truncated folding };
\end{codeexample}
+ %
\end{pictype}
\begin{pictype}{octahedron folding}{}
- A folding of an octahedron.
+ A folding of an octahedron.
+ %
\begin{codeexample}[]
\tikz \pic [folding line length=6mm, numbered faces, transform shape]
{ octahedron folding };
\end{codeexample}
+ %
\end{pictype}
-
\begin{pictype}{octahedron folding}{}
- A folding of a truncated octahedron.
+ A folding of a truncated octahedron.
+ %
\begin{codeexample}[]
\tikz \pic [folding line length=6mm, numbered faces, transform shape]
{ octahedron truncated folding };
\end{codeexample}
+ %
\end{pictype}
-
\begin{pictype}{dodecahedron folding}{}
- A folding of a dodecahedron.
-
+ A folding of a dodecahedron.
+ %
\begin{codeexample}[]
\tikz \pic [folding line length=6mm, numbered faces, transform shape]
{ dodecahedron folding };
\end{codeexample}
+ %
\end{pictype}
-
-
\begin{pictype}{dodecahedron' folding}{}
- This is an alternative folding of a dodecahedron.
+ This is an alternative folding of a dodecahedron.
+ %
\begin{codeexample}[]
\tikz \pic [folding line length=6mm, numbered faces, transform shape]
{ dodecahedron' folding };
\end{codeexample}
+ %
\end{pictype}
-
-
-
\begin{pictype}{cuboctahedron folding}{}
- A folding of a cuboctahedron.
+ A folding of a cuboctahedron.
+ %
\begin{codeexample}[]
\tikz \pic [folding line length=6mm, numbered faces, transform shape]
{ cuboctahedron folding };
\end{codeexample}
+ %
\end{pictype}
-
\begin{pictype}{cuboctahedron truncated folding}{}
- A folding of a truncated cuboctahedron.
+ A folding of a truncated cuboctahedron.
+ %
\begin{codeexample}[]
\tikz \pic [folding line length=6mm, numbered faces, transform shape]
{ cuboctahedron truncated folding };
\end{codeexample}
+ %
\end{pictype}
-
\begin{pictype}{icosahedron folding}{}
- A folding of an icosahedron.
+ A folding of an icosahedron.
+ %
\begin{codeexample}[]
\tikz \pic [folding line length=6mm, numbered faces, transform shape]
{ icosahedron folding };
\end{codeexample}
+ %
\end{pictype}
-
\begin{pictype}{rhombicuboctahedron folding}{}
- A folding of an rhombicuboctahedron.
+ A folding of an rhombicuboctahedron.
+ %
\begin{codeexample}[]
\tikz \pic [folding line length=6mm, numbered faces, transform shape]
{ rhombicuboctahedron folding };
\end{codeexample}
+ %
\end{pictype}
-
\begin{pictype}{snub cube folding}{}
- A folding of a snub cube.
+ A folding of a snub cube.
+ %
\begin{codeexample}[width=5cm]
\tikz \pic [folding line length=6mm, numbered faces, transform shape]
{ snub cube folding };
\end{codeexample}
+ %
\end{pictype}
-
\begin{pictype}{icosidodecahedron folding}{}
- A folding of an icosidodecahedron.
+ A folding of an icosidodecahedron.
+ %
\begin{codeexample}[]
\tikz \pic [folding line length=6mm, numbered faces, transform shape]
{ icosidodecahedron folding };
\end{codeexample}
+ %
\end{pictype}
-
-%%% 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-fpu.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex
index 7177e771b95..bdc58135ef0 100644
--- 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
@@ -9,183 +9,197 @@
\section{Floating Point Unit Library}
-{\noindent {\emph{by Christian Feuers\"anger}}}
\label{pgfmath-floatunit}
\label{section-library-fpu}
+{\noindent {\emph{by Christian Feuersänger}}}
+
\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.
+ 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.
+
+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
+ low-level 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{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.
+ %
+ \noindent The FPU uses a low-level 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);
+% \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.
+ 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.
+ 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.
+ 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.
+ 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.
+ 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.
+ 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 \meta{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 \meta{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 \meta{scale}.
-
- The initial setting does not scale |plot file|.
+ /pgf/fpu/scale file plot z=\marg{scale}%
+}
+ These keys will patch \pgfname's |plot file| command to automatically scale
+ single coordinates by \meta{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 either \meta{true-code} or
- \meta{false-code}, depending on whether the FPU has been activated
- or not.
+ This command can be used to execute either \meta{true-code} or
+ \meta{false-code}, depending 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:
+
+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).
+ \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$.
+ 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
+ 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:
+ %
+ 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}
@@ -221,48 +235,50 @@ Flags: \F; Mantissa \M; Exponent \E.
\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E}
Flags: \F; Mantissa \M; Exponent \E.
\end{codeexample}
- The argument \meta{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).
+ %
+ The argument \meta{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!).
+ 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.
+ 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!).
+ 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.
+ 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 not a 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 \meta{input}.
+ This command key is invoked whenever |\pgfmathfloattoregisters| or its
+ variants encounter something which is not a properly formatted low-level
+ 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 \meta{input}.
- The initial setting is to generate an error message.
+ 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.
+ 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 \meta{x}
- as a fixed point number (of arbitrary precision).
-
+ 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 \meta{x} as a fixed point number (of
+ arbitrary precision).
+ %
\begin{codeexample}[]
\pgfmathfloatparsenumber{0.00052}
\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E}
@@ -280,61 +296,67 @@ $\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).
+ 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.
+ 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|.
+ 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$.
+ Expands a number from low-level floating point representation to scientific
+ format, $1.234e4$.
- Use |\pgfmathfloatvalueof| in contexts where only expandable macros are allowed.
+ 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
- \meta{flags}, \meta{mantissa} and \meta{exponent}.
-
- All arguments are characters and will be expanded using |\edef|.
+ Defines |\pgfmathresult| as the floating point number encoded by
+ \meta{flags}, \meta{mantissa} and \meta{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 \meta{true-code} if the flag of \meta{floating point number}
- equals \meta{flag} and \meta{false-code} otherwise.
-
- The argument \meta{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}
-
+ Invokes \meta{true-code} if the flag of \meta{floating point number} equals
+ \meta{flag} and \meta{false-code} otherwise.
+
+ The argument \meta{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!}
@@ -345,307 +367,311 @@ Flags: \F; Mantissa \M; Exponent \E
\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 \meta{x} to
- \meta{flagsmacro}, the mantissa to \meta{mantissamacro} and the
- exponent to \meta{exponentmacro}.
+ Extracts the flags of a floating point number \meta{x} to
+ \meta{flagsmacro}, the mantissa to \meta{mantissamacro} and the exponent to
+ \meta{exponentmacro}.
\end{command}
\begin{command}{\pgfmathfloattoregisters{\marg{x}}{\marg{flagscount}}{\marg{mantissadimen}}{\marg{exponentcount}}}
- Takes a floating point number \meta{x} as input and writes flags to
- count register \meta{flagscount}, mantissa to dimen register
- \meta{mantissadimen} and exponent to count register \meta{exponentcount}.
+ Takes a floating point number \meta{x} as input and writes flags to count
+ register \meta{flagscount}, mantissa to dimen register \meta{mantissadimen}
+ and exponent to count register \meta{exponentcount}.
- Please note that this method rounds the mantissa to \TeX-precision.
+ 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.
+ 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 \meta{x} into the count register
- \meta{flagscount}.
+ Extracts the flags of \meta{x} into the count register \meta{flagscount}.
\end{command}
\begin{command}{\pgfmathfloatgetflagstomacro{\marg{x}}{\marg{macro}}}
- Extracts the flags of \meta{x} into the macro \meta{macro}.
+ Extracts the flags of \meta{x} into the macro \meta{macro}.
\end{command}
\begin{command}{\pgfmathfloatgetmantissa{\marg{x}}{\marg{mantissadimen}}}
- Extracts the mantissa of \meta{x} into the dimen register
- \meta{mantissadimen}.
+ Extracts the mantissa of \meta{x} into the dimen register
+ \meta{mantissadimen}.
\end{command}
\begin{command}{\pgfmathfloatgetmantissatok{\marg{x}}{\marg{mantissatoks}}}
- Extracts the mantissa of \meta{x} into the token register
- \meta{mantissatoks}.
+ Extracts the mantissa of \meta{x} into the token register
+ \meta{mantissatoks}.
\end{command}
\begin{command}{\pgfmathfloatgetexponent{\marg{x}}{\marg{exponentcount}}}
- Extracts the exponent of \meta{x} into the count register
- \meta{exponentcount}.
+ Extracts the exponent of \meta{x} into the count register
+ \meta{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.
+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 \meta{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 \meta{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.
+ 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.
+ 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).
+ 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 section describes some of the replacement commands in more
-detail.
+This section describes some of the replacement commands in more detail.
-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.
+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.
+ 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.
+ 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 \meta{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.
+ Renormalizes \meta{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 \meta{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}
+ Sets the precision used inside of |\pgfmathfloattoextentedprecision| to
+ \meta{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 \meta{x} and
- \meta{y} are expected to be numbers which have already been
- processed by |\pgfmathfloatparsenumber|. Arithmetic is carried out
- using \TeX-registers for exponent- and mantissa comparison.
+ 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 \meta{x} and \meta{y} are expected to be numbers
+ which have already been processed by |\pgfmathfloatparsenumber|. Arithmetic
+ 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
- renormalize the result where $m$ is the mantissa of \meta{float}.
+ 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 renormalize 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.
+ 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.
+ 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|.
+ 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}
+ \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 \meta{x}. The argument \meta{num} is expected to be a
- (positive or negative) integer.
+ Defines |\pgfmathresult| to be $\meta{x} \cdot 10^{\meta{num}}$. The
+ operation is an arithmetic shift base ten and modifies only the exponent of
+ \meta{x}. The argument \meta{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.
+ 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.
+ 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 \meta{x}, by
- truncating any digits after the period. This methods truncates the
- absolute value $\rvert x \lvert$ to the next smaller integer and
- restores the original sign afterwards.
+ Returns the integer part of the floating point number \meta{x}, by
+ truncating any digits after the period. This methods truncates the absolute
+ value $\rvert x \lvert$ to the next smaller integer and restores the
+ original sign afterwards.
- The result is returned as floating point number as well.
+ The result is returned as floating point number as well.
- See also |\pgfmathfloattoint| which returns the number in integer
- format.
+ 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 \meta{x},
- $\ln(\meta{x})$. This method is logically the same as |\pgfmathln|,
- but it applies floating point arithmetics to read number \meta{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 \meta{x} needs to be a number, expression parsing
- is not possible here.
-
- If \meta{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.
+ Defines |\pgfmathresult| to be the natural logarithm of \meta{x},
+ $\ln(\meta{x})$. This method is logically the same as |\pgfmathln|, but it
+ applies floating point arithmetics to read number \meta{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 \meta{x} needs to be a number, expression parsing is not
+ possible here.
+
+ If \meta{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.
+\subsubsection{Accessing the Original Math Routines for Programmers}
-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.
+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
index 75462b19720..c46b8ed5f53 100644
--- 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
@@ -9,21 +9,22 @@
\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
+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}{
@@ -35,9 +36,9 @@ fractal patterns\ldots
lindenmayer system -- cycle;
\end{tikzpicture}
\end{codeexample}
-
+%
\noindent\ldots and ``plant like'' patterns\ldots
-
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw [green!50!black, rotate=90]
@@ -46,222 +47,198 @@ fractal patterns\ldots
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).
+%
+\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.
+ 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,
-they 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
- current value of the key |randomize step percent|.
-\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.
+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,
+ they 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
+ current value of the key |randomize step percent|.
+ \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}
@@ -273,23 +250,24 @@ growth of the system.
\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.
-
+ 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);
@@ -303,26 +281,24 @@ The following command is used to run an L-system in \pgfname:
\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.
-
+ 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''.
+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:
-
+ 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}
@@ -335,60 +311,60 @@ The following command is used to run an L-system in \pgfname:
\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.
+ 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 the following keys are provided for convenience, so that you do not have to keep repeating this path:
+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 the following keys are provided for convenience, so that you do
+not have to keep repeating this path:
\begin{stylekey}{/pgf/lindenmayer system=\marg{keys}}
\keyalias{tikz}
-This key changes the key path to |/pgf/lindenmayer systems| and
-executes \meta{keys}.
+ 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.
+ A more compact version of the previous key.
\end{stylekey}
\begin{key}{/pgf/lindenmayer system/name=\marg{name}}
- Sets the name for the L-system.
+ Sets the name for the L-system.
\end{key}
\begin{key}{/pgf/lindenmayer system/axiom=\marg{string}}
- Sets the axiom (or input string) for the L-system.
+ Sets the axiom (or input string) for the L-system.
\end{key}
\begin{key}{/pgf/lindenmayer system/order=\marg{integer}}
- Sets the number of iterations the L-system will perform.
+ Sets 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.
-
+ 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}.
-
-
+ 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}{
@@ -404,4 +380,5 @@ A more compact version of the previous key.
[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-math.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-math.tex
index 7d30a93c9d3..d090ccae996 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-math.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-math.tex
@@ -8,55 +8,48 @@
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-
\section{Math Library}
\label{section-library-math}
\begin{tikzlibrary}{math}
- This library defines a simple mathematical language
- to define simple functions and perform sequences of basic mathematical
- operations.
+ This library defines a simple mathematical language to define simple
+ functions and perform sequences of basic mathematical operations.
\end{tikzlibrary}
\subsection{Overview}
- \pgfname\ and \tikzname\ both use the \pgfname\ mathematical engine
- which provides many commands for parsing expressions. Unfortunately
- the \pgfname\ math engine is somewhat cumbersome for long sequences
- of mathematical
- operations, particularly when assigning values to multiple variables.
- The \tikzname\ |calc| library
- provides some additional ``convenience'' operations for doing calculations
- (particularly with coordinates), but this can only be used inside
- \tikzname\ path commands.
-
- This |math| library provides a means to
- perform sequences of mathematical operations in a more `user friendly'
- manner than the \pgfname\ math engine. In addition, the coordinate calculations of the |calc| library
- can be accessed (provided it is loaded).
- %
- However as the |math| library uses the \pgfname\ math engine -- which uses pure \TeX\
- to perform all its calculations -- it is subject to the same speed
- and accuracy limitations. It is worth bearing this in mind, before
- trying to implement algorithms requiring intensive and highly
- accurate computation. You can, of course use the |fp| or the |fpu|
- libraries to increase the accuracy (but not necessarily the speed)
- of computations.
-
- For most purposes, the features provided by this library are accessed
- using the following command:
-
-\begin{command}{\tikzmath\texttt{\{}\meta{statements}\texttt{\}}}
+\pgfname\ and \tikzname\ both use the \pgfname\ mathematical engine which
+provides many commands for parsing expressions. Unfortunately the \pgfname\
+math engine is somewhat cumbersome for long sequences of mathematical
+operations, particularly when assigning values to multiple variables. The
+\tikzname\ |calc| library provides some additional ``convenience'' operations
+for doing calculations (particularly with coordinates), but this can only be
+used inside \tikzname\ path commands.
+
+This |math| library provides a means to perform sequences of mathematical
+operations in a more `user friendly' manner than the \pgfname\ math engine. In
+addition, the coordinate calculations of the |calc| library can be accessed
+(provided it is loaded).
+%
+However as the |math| library uses the \pgfname\ math engine -- which uses pure
+\TeX\ to perform all its calculations -- it is subject to the same speed and
+accuracy limitations. It is worth bearing this in mind, before trying to
+implement algorithms requiring intensive and highly accurate computation. You
+can, of course use the |fp| or the |fpu| libraries to increase the accuracy
+(but not necessarily the speed) of computations.
- This command process a series of \meta{statements} which can
- represent assignments, function definitions, conditional evaluation,
- and iterations. It provides, in effect, a miniature mathematical
- language to perform basic mathematical operations.
- Perhaps the most important thing to remember is that \emph{every
- statement should end with a semi-colon}. This is
- likely to be the most common reason why the |\tikzmath| command fails.
+For most purposes, the features provided by this library are accessed using the
+following command:
+\begin{command}{\tikzmath\texttt{\{}\meta{statements}\texttt{\}}}
+ This command process a series of \meta{statements} which can represent
+ assignments, function definitions, conditional evaluation, and iterations.
+ It provides, in effect, a miniature mathematical language to perform basic
+ mathematical operations. Perhaps the most important thing to remember is
+ that \emph{every statement should end with a semi-colon}. This is likely to
+ be the most common reason why the |\tikzmath| command fails.
+ %
\begin{codeexample}[]
\tikzmath{
% Adapted from http://www.cs.northwestern.edu/academics/courses/110/html/fib_rec.html
@@ -81,14 +74,14 @@
};
}
\end{codeexample}
-
+ %
\end{command}
In addition to this command the following key is provided:
-
+
\begin{key}{/tikz/evaluate={\meta{statements}}}
- This key simply executes |\tikzmath{|\meta{statements}|}|.
-
+ This key simply executes |\tikzmath{|\meta{statements}|}|.
+ %
\begin{codeexample}[]
\tikz[x=0.25cm,y=0.25cm,
evaluate={
@@ -105,27 +98,24 @@ In addition to this command the following key is provided:
\fill [red!\a{\i,\j}!yellow] (\i,\j) rectangle ++(1, 1);
\end{codeexample}
-
-
+ %
\end{key}
-
- The following sections describe the miniature language that this
- library provides and can be used in the |\tikzmath| command and the |evaluate| key.
- The language consists only of simple keywords and expressions but
- the mini-parser allows you to format code in a reasonably versatile
- way (much like the |tikz| parser) except that
- \emph{all the keywords must be followed by at least one space}.
- This is the second most important thing to remember (after
- remembering to insert semi-colons at the end of every statement).
+The following sections describe the miniature language that this library
+provides and can be used in the |\tikzmath| command and the |evaluate| key.
+The language consists only of simple keywords and expressions but the
+mini-parser allows you to format code in a reasonably versatile way (much like
+the |tikz| parser) except that \emph{all the keywords must be followed by at
+least one space}. This is the second most important thing to remember (after
+remembering to insert semi-colons at the end of every statement).
\subsection{Assignment}
-
- In the simplest case, you will want to evaluate an expression
- and assign it to a macro, or a \TeX\ count or dimension register.
- In this case, use of the |math| library is straightforward:
+In the simplest case, you will want to evaluate an expression and assign it to
+a macro, or a \TeX\ count or dimension register. In this case, use of the
+|math| library is straightforward:
+%
\begin{codeexample}[]
\newcount\mycount
\newdimen\mydimen
@@ -138,11 +128,10 @@ In addition to this command the following key is provided:
\a, \b, \the\mycount, \the\mydimen
\end{codeexample}
-
- In addition, \TeX-macros (\emph{not} \TeX\ registers)
- can be suffixed with an index, similar to
- indices in mathematical notation, for example, $x_1$, $x_2$, $x_3$:
-
+In addition, \TeX-macros (\emph{not} \TeX\ registers) can be suffixed with an
+index, similar to indices in mathematical notation, for example, $x_1$, $x_2$,
+$x_3$:
+%
\begin{codeexample}[]
\tikzmath{
\x1 = 3+4; \x2 = 30+40; \x3 = 300+400;
@@ -150,9 +139,9 @@ In addition to this command the following key is provided:
\x1, \x2, \x3
\end{codeexample}
- The index does not have to be a number. By using braces |{}|,
- more sophisticated indices can be created:
-
+The index does not have to be a number. By using braces |{}|, more
+sophisticated indices can be created:
+%
\begin{codeexample}[]
\tikzmath{
\c{air} = 340; \c{water} = 1435; \c{steel} = 6100;
@@ -160,57 +149,53 @@ In addition to this command the following key is provided:
\foreach \medium in {air,steel}{The speed of sound in \medium\ is \c{\medium} m/s. }
\end{codeexample}
- You should not, however, try to mix indexed and non-indexed variables. Once
- an assignment is made using an index, the |math| library expects
- all instances of the variable on the right hand side of an assignment
- to be followed by an index. This effect is reversed if you
- subsequently make an assignment to the variable without an index: the |math| library
- (or to be precise the \pgfname\ math-engine)
- will then ignore any index following the variable on the right hand side
- of an assignment.
+You should not, however, try to mix indexed and non-indexed variables. Once an
+assignment is made using an index, the |math| library expects all instances of
+the variable on the right hand side of an assignment to be followed by an
+index. This effect is reversed if you subsequently make an assignment to the
+variable without an index: the |math| library (or to be precise the \pgfname\
+math-engine) will then ignore any index following the variable on the right
+hand side of an assignment.
- In some cases, you may wish to assign a value or expression to a variable
- without evaluating it with the \pgfname\ math-engine. In this case, you
- can use the following keyword:
+In some cases, you may wish to assign a value or expression to a variable
+without evaluating it with the \pgfname\ math-engine. In this case, you can use
+the following keyword:
\begin{math-keyword}{{let} \meta{variable} \texttt{=} \meta{expression}\texttt{;}}
-
- This keyword assigns \meta{expression} to \meta{variable}
- without evaluation. The \meta{expression} is however fully
- expanded using |\edef|. Any spaces preceding \meta{expression}
- are removed, but any trailing spaces (before the semi-colon)
- are included.
-
+ This keyword assigns \meta{expression} to \meta{variable} without
+ evaluation. The \meta{expression} is however fully expanded using |\edef|.
+ Any spaces preceding \meta{expression} are removed, but any trailing spaces
+ (before the semi-colon) are included.
+ %
\begin{codeexample}[]
\tikzmath{
let \x = (5*4)+1;
- let \c1 = blue;
+ let \c1 = blue;
}
\x, ``\c1''
\end{codeexample}
+ %
\end{math-keyword}
-
+
+
\subsection{Integers, ``Real'' Numbers, and Coordinates}
-
- By default, assignments are made by evaluating expressions
- using the \pgfname\ math-engine and
- results are usually returned as number with a decimal point (unless you
- are assigning to a count register or use the |int| function).
- %
- As this is not always desirable, the |math| library allows
- variables -- which \emph{must} be \TeX\ macros -- to be `declared'
- as being a particular `type'. The library recognizes three types:
- integers (numbers without a decimal point),
- real numbers (numbers with a decimal point\footnote{Strictly speaking, due to the
- finite range and precision of \TeX\ numerical capabilities, the term ``real'' is
- not correct.}), and coordinates.
-
- To declare a variable as being one of the three types,
- you can use the keywords shown below. It is important to remember
- that by telling the |math| library you want it to do a
- particular assignment for a variable, it will also do the same
- assignment when the variable is indexed.
-
+
+By default, assignments are made by evaluating expressions using the \pgfname\
+math-engine and results are usually returned as number with a decimal point
+(unless you are assigning to a count register or use the |int| function).
+%
+As this is not always desirable, the |math| library allows variables -- which
+\emph{must} be \TeX\ macros -- to be `declared' as being a particular `type'.
+The library recognizes three types: integers (numbers without a decimal point),
+real numbers (numbers with a decimal point\footnote{Strictly speaking, due to
+the finite range and precision of \TeX\ numerical capabilities, the term
+``real'' is not correct.}), and coordinates.
+
+To declare a variable as being one of the three types, you can use the
+keywords shown below. It is important to remember that by telling the |math|
+library you want it to do a particular assignment for a variable, it will also
+do the same assignment when the variable is indexed.
+%
\begin{codeexample}[]
\tikzmath{
integer \x;
@@ -219,60 +204,51 @@ In addition to this command the following key is provided:
\x1, \x2, \x3
\end{codeexample}
+%But, if you want integer results without using a count register or the
+%|int| function, you can use a keyword to indicate this:
-% But, if you want integer results without using a count register or the
-% |int| function, you can use a keyword to indicate this:
-
-\begin{math-keyword}{{integer} \meta{variable}\opt{\texttt{,}
-\meta{additional variables}}\texttt{;}}
-
- The |integer| keyword indicates that assignments to the \meta{variable} or
- the comma separated list of \meta{additional variables} should be
- truncated (not rounded) to integers. The variables should be ordinary
- macros -- \emph{not} \TeX\ registers. In addition the variables
- should \emph{not} be indexed.
-
+\begin{math-keyword}{{integer} \meta{variable}\opt{\texttt{,} \meta{additional variables}}\texttt{;}}
+ The |integer| keyword indicates that assignments to the \meta{variable} or
+ the comma separated list of \meta{additional variables} should be truncated
+ (not rounded) to integers. The variables should be ordinary macros --
+ \emph{not} \TeX\ registers. In addition the variables should \emph{not} be
+ indexed.
+ %
\begin{codeexample}[]
-\tikzmath{
- integer \x, \y, \z;
- \x = 4*5+6;
+\tikzmath{
+ integer \x, \y, \z;
+ \x = 4*5+6;
\y = sin(30)*4;
\z = log10(512) / log10(2);
- print {$x=\x$, $y=\y$, $z=\z$};
+ print {$x=\x$, $y=\y$, $z=\z$};
}
\end{codeexample}
-
+ %
\end{math-keyword}
-\begin{math-keyword}{{int} \meta{variable}\opt{\texttt{,}
-\meta{additional variables}}\texttt{;}}
- Short version of the |integer| keyword.
+\begin{math-keyword}{{int} \meta{variable}\opt{\texttt{,} \meta{additional variables}}\texttt{;}}
+ Short version of the |integer| keyword.
\end{math-keyword}
- Having declared a variable as an integer, the |math| library will
- continue to assign only integers to that variable within the
- current \TeX\ scope. If you wish to assign non-integer (i.e., \emph{real})
- numbers to the same variable, the following keyword can be used.
+Having declared a variable as an integer, the |math| library will continue to
+assign only integers to that variable within the current \TeX\ scope. If you
+wish to assign non-integer (i.e., \emph{real}) numbers to the same variable,
+the following keyword can be used.
-\begin{math-keyword}{{real} \meta{variable}\opt{\texttt{,}
-\meta{additional variables}}\texttt{;}}
- The |real| keyword ensures that assignments \meta{variable}
- (and \meta{additional variables}) will not be truncated to integers.
+\begin{math-keyword}{{real} \meta{variable}\opt{\texttt{,} \meta{additional variables}}\texttt{;}}
+ The |real| keyword ensures that assignments \meta{variable} (and
+ \meta{additional variables}) will not be truncated to integers.
\end{math-keyword}
-
- In order to take advantage of |math| library interface to the
- |calc| library you must indicate that a variable is to be assigned
- coordinates, using the following keyword.
-
-\begin{math-keyword}{{coordinate}
-\meta{variable}\opt{\texttt{,}
-\meta{additional variables}}\texttt{;}}%
-
- This keyword enables \tikzname-style coordinates such as |(2cm,3pt)| or
- |(my node.east)| to be parsed and
- assigned to \meta{variable} in the form $x,y$, which can then be used
- in a |tikzpicture|:
+In order to take advantage of |math| library interface to the |calc| library
+you must indicate that a variable is to be assigned coordinates, using the
+following keyword.
+
+\begin{math-keyword}{{coordinate} \meta{variable}\opt{\texttt{,} \meta{additional variables}}\texttt{;}}
+ This keyword enables \tikzname-style coordinates such as |(2cm,3pt)| or
+ |(my node.east)| to be parsed and assigned to \meta{variable} in the form
+ $x,y$, which can then be used in a |tikzpicture|:
+ %
\begin{codeexample}[]
\tikzmath{
coordinate \c;
@@ -280,12 +256,11 @@ In addition to this command the following key is provided:
}
\tikz\draw (0,0) -- (\c);
\end{codeexample}
-
- If the \tikzname\ |calc| library is loaded,
- coordinate calculations can be performed;
- the coordinate expression does not have to be
- surrounded by |($|\ldots|$)|.
-
+
+ If the \tikzname\ |calc| library is loaded, coordinate calculations can be
+ performed; the coordinate expression does not have to be surrounded by
+ |($|\ldots|$)|.
+ %
\begin{codeexample}[]
\tikzmath{
coordinate \c, \d;
@@ -294,16 +269,14 @@ In addition to this command the following key is provided:
}
\tikz\draw (\c) -- (\d);
\end{codeexample}
-
- In addition to assigning the $x$ and $y$ coordinates to \meta{variable}
- (possibly with an optional index), two further
- variables are defined. The first takes the name of \meta{variable}
- (e.g., |\c|) suffixed with |x| (i.e., |\cx|) and is assigned the
- $x$ coordinate of |\c|.
- The second takes the name of \meta{variable}
- suffixed with |y| (i.e., |\cy|) and is assigned the
- $y$ coordinate of |\c|.
+ In addition to assigning the $x$ and $y$ coordinates to \meta{variable}
+ (possibly with an optional index), two further variables are defined. The
+ first takes the name of \meta{variable} (e.g., |\c|) suffixed with |x|
+ (i.e., |\cx|) and is assigned the $x$ coordinate of |\c|. The second takes
+ the name of \meta{variable} suffixed with |y| (i.e., |\cy|) and is assigned
+ the $y$ coordinate of |\c|.
+ %
\begin{codeexample}[]
\tikzmath{
coordinate \c;
@@ -312,36 +285,28 @@ In addition to this command the following key is provided:
}
\tikz\draw (\cx1,\cy1) -- (\cx2,\cy1) -- (\cx2,\cy2) -- (\cx1,\cy2);
\end{codeexample}
-
+ %
\end{math-keyword}
-%\begin{math-keyword}{{point}
-%\meta{variable}\opt{\texttt{,}
-%\meta{additional variables}}\texttt{;}}%
-%
-% The |point| keyword is a synonym for the |coordinate| keyword
-% and performs the same function.
+%\begin{math-keyword}{{point} \meta{variable}\opt{\texttt{,} \meta{additional variables}}\texttt{;}}
+% The |point| keyword is a synonym for the |coordinate| keyword and performs
+% the same function.
%\end{math-keyword}
-
+
\subsection{Repeating Things}
-\begin{math-keyword}{{for} \meta{variable} \texttt{in
-\{}\meta{list}\texttt{\}\{}\meta{expressions}\texttt{\};}}
-
- This is a ``trimmed down'' version of the |\foreach| command available
- as part of \pgfname\ and \tikzname, but cannot currently be used
- outside of the |\tikzmath| command.
- It is important to note the following:
-
-\begin{itemize}
-
-\item
- Every value in \meta{list} is evaluated using the \pgfname\ mathematical
- engine. However, if an item in \meta{list} contains a comma, it \emph{must} be
- surrounded
- by braces, for example, |{mod(5, 2)}|.
-
+\begin{math-keyword}{{for} \meta{variable} \texttt{in \{}\meta{list}\texttt{\}\{}\meta{expressions}\texttt{\};}}
+ This is a ``trimmed down'' version of the |\foreach| command available as
+ part of \pgfname\ and \tikzname, but cannot currently be used outside of
+ the |\tikzmath| command. It is important to note the following:
+ %
+ \begin{itemize}
+ \item Every value in \meta{list} is evaluated using the \pgfname\
+ mathematical engine. However, if an item in \meta{list} contains a
+ comma, it \emph{must} be surrounded by braces, for example,
+ |{mod(5, 2)}|.
+ %
\begin{codeexample}[]
\tikzmath{
int \x, \v;
@@ -350,121 +315,96 @@ In addition to this command the following key is provided:
\v=\v*2;
};
print {$x=\x, v=\v$};
-}
+}
\end{codeexample}
-
-\item
- Because each item is evaluated, you cannot
- use \tikzname\ coordinates in \meta{list}.
-
-\item
- Only single variable assignment is supported.
-
-\item
- The ``dots notation'' (e.\,g., |1,2,...,9|) can be used in \meta{list},
- but is not as sophisticated as the \pgfname\ |\foreach| command.
- In particular, contextual replacement is not possible.
-
-\item
- Assignments that occur in the loop body \emph{are not scoped}.
- They last beyond the body of each iteration and the end of the |for|
- statement. This includes the values assigned to the \meta{variable}.
-
+ %
+ \item Because each item is evaluated, you cannot use \tikzname\
+ coordinates in \meta{list}.
+ \item Only single variable assignment is supported.
+ \item The ``dots notation'' (e.\,g., |1,2,...,9|) can be used in
+ \meta{list}, but is not as sophisticated as the \pgfname\
+ |\foreach| command. In particular, contextual replacement is not
+ possible.
+ \item Assignments that occur in the loop body \emph{are not scoped}.
+ They last beyond the body of each iteration and the end of the
+ |for| statement. This includes the values assigned to the
+ \meta{variable}.
+ %
\begin{codeexample}[]
\tikzmath{
int \x, \y;
\y = 0;
for \x1 in {1,...,5}{
for \x2 in {10,20,...,50}{
- \y = \y+\x1*\x2;
+ \y = \y+\x1*\x2;
};
};
}
$x_1=\x1, x_2=\x2, y=\y$
\end{codeexample}
-
-
-
-
-
-\end{itemize}
-
+ \end{itemize}
\end{math-keyword}
-
-
-
-
-
-
\subsection{Branching Statements}
- Sometimes you may wish to execute different statements
- depending on the value of an expression. In this
- case the following keyword can be used:
+Sometimes you may wish to execute different statements depending on the value
+of an expression. In this case the following keyword can be used:
\begin{math-keyword}{{if} \meta{condition} \texttt{then \{}\meta{if-non-zero-statements}\texttt{\};}}
-
- This keyword executes \meta{if-non-zero-statements} if the expression in \meta{condition}
- evaluates to any value other than zero.
-
+ This keyword executes \meta{if-non-zero-statements} if the expression in
+ \meta{condition} evaluates to any value other than zero.
\end{math-keyword}
\begin{math-keyword}{{if} \meta{condition} \texttt{then \{}\meta{if-non-zero-statements}\texttt{\}} \texttt{else} \texttt{\{}\meta{if-zero-statements}\texttt{\}}\texttt{;}}
-
- This keyword executes \meta{if-non-zero-statements} if the expression in \meta{condition}
- evaluates to any value other than zero and the \meta{if-zero-statements} are executed if
- the expression in \meta{condition} evaluates to zero.
-
+ This keyword executes \meta{if-non-zero-statements} if the expression in
+ \meta{condition} evaluates to any value other than zero and the
+ \meta{if-zero-statements} are executed if the expression in
+ \meta{condition} evaluates to zero.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\tikzmath{
int \x;
for \k in {0,10,...,350}{
- if \k>260 then { let \c = orange; } else {
+ if \k>260 then { let \c = orange; } else {
if \k>170 then { let \c = blue; } else {
if \k>80 then { let \c = red; } else {
let \c = green; }; }; };
{
- \path [fill=\c!50, draw=\c] (\k:0.5cm) -- (\k:1cm) --
+ \path [fill=\c!50, draw=\c] (\k:0.5cm) -- (\k:1cm) --
(\k+5:1cm) -- (\k+5:0.5cm) -- cycle;
};
};
}
\end{tikzpicture}
\end{codeexample}
+ %
\end{math-keyword}
+
\subsection{Declaring Functions}
- You can add functions by using the following keywords:
+You can add functions by using the following keywords:
\begin{math-keyword}{{function} \meta{name}\texttt{(}\meta{arguments}\texttt{) \{} \meta{definition} \texttt{\};}}
-
- This keyword works much like the |declare function| provided by the
- \pgfname\ math-engine.
- 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
- comma separated \TeX\ macros such as |\x|, or |\y| (it is not
- possible to declare functions that take variable numbers of arguments).
- If the function
- takes no arguments then the parentheses need not be used.
- It is very important to note that the arrays that the
- \pgfname\ math engine supports
- \emph{cannot currently be passed as arguments to functions}.
-
-
- The function \meta{definition} should be a sequence of statements
- that can be parsed by the |\tikzmath| command and
- should use the commands specified in the \meta{arguments}.
- The |return| keyword (described below) should be used to indicate
- the value returned by the function.
- %
- Although \meta{definition} can take any statements accepted by
- |\tikzmath|, it is not advisable try to define functions inside other
- functions.
-
+ This keyword works much like the |declare function| provided by the
+ \pgfname\ math-engine. 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 comma separated \TeX\ macros such as |\x|, or |\y| (it is not possible
+ to declare functions that take variable numbers of arguments). If the
+ function takes no arguments then the parentheses need not be used. It is
+ very important to note that the arrays that the \pgfname\ math engine
+ supports \emph{cannot currently be passed as arguments to functions}.
+
+ The function \meta{definition} should be a sequence of statements that can
+ be parsed by the |\tikzmath| command and should use the commands specified
+ in the \meta{arguments}. The |return| keyword (described below) should be
+ used to indicate the value returned by the function.
+ %
+ Although \meta{definition} can take any statements accepted by |\tikzmath|,
+ it is not advisable try to define functions inside other functions.
+ %
\begin{codeexample}[]
\tikzmath{
function product(\x,\y) {
@@ -477,32 +417,27 @@ $x_1=\x1, x_2=\x2, y=\y$
print { $\i\times \j = \k$ };
}
\end{codeexample}
-
+ %
\end{math-keyword}
\begin{math-keyword}{{return} \meta{expression}\texttt{;}}
-
- This keyword should be used as the last executed statement
- in a function definition to indicate the value that should be
- returned.
-
+ This keyword should be used as the last executed statement in a function
+ definition to indicate the value that should be returned.
\end{math-keyword}
\subsection{Executing Code Outside the Parser}
-
- Sometimes you may wish to do ``something'' outside the parser,
- perhaps display some intermediate result or execute some code.
- In this case
- you have two options. Firstly, the following keyword can be used:
-
+
+Sometimes you may wish to do ``something'' outside the parser, perhaps display
+some intermediate result or execute some code. In this case you have two
+options. Firstly, the following keyword can be used:
+
\begin{math-keyword}{{print} \texttt{\{}\meta{code}\texttt{\};}}
-
- Execute \meta{code} immediately. This is intended as convenience
- keyword for displaying information in a document (analogous to
- the |print| command in real programming languages).
- The \meta{code} is executed inside a \TeX\ group.
-
+ Execute \meta{code} immediately. This is intended as convenience keyword
+ for displaying information in a document (analogous to the |print| command
+ in real programming languages). The \meta{code} is executed inside a \TeX\
+ group.
+ %
\begin{codeexample}[]
\tikzmath{
int \x, \y, \z;
@@ -513,19 +448,16 @@ $x_1=\x1, x_2=\x2, y=\y$
};
}
\end{codeexample}
-
+ %
\end{math-keyword}
-
- Secondly, if a statement begins with a brace |{|, then
- everything up to the closing brace |}| is collected
- and executed (the closing brace \emph{must}
- be followed by a semi-colon).
- Like the |print| keyword, the contents of the braces
- is executed inside a \TeX\ group.
- Unlike the |print| keyword, the brace notation can be used in
- functions so that |tikz| path commands can be safely executed
- inside a |tikzpicture|.
-
+
+Secondly, if a statement begins with a brace |{|, then everything up to the
+closing brace |}| is collected and executed (the closing brace \emph{must} be
+followed by a semi-colon). Like the |print| keyword, the contents of the braces
+is executed inside a \TeX\ group. Unlike the |print| keyword, the brace
+notation can be used in functions so that |tikz| path commands can be safely
+executed inside a |tikzpicture|.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
@@ -538,10 +470,3 @@ $x_1=\x1, x_2=\x2, y=\y$
}
\end{tikzpicture}
\end{codeexample}
-
-
-
-
-
-
-\endinput
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 2a697d768e7..5eaed540fa0 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
@@ -11,26 +11,26 @@
\section{Matrix Library}
\begin{tikzlibrary}{matrix}
- This library package defines additional styles and options for
- creating matrices.
+ This library package defines additional styles and options for creating
+ matrices.
\end{tikzlibrary}
\subsection{Matrices of Nodes}
-A \emph{matrix of nodes} is a \tikzname\ matrix in which each cell
-contains a node. In this case it is bothersome having to write
-|\node{| at the beginning of each cell and |};| at the end of each
-cell. The following key simplifies typesetting such matrices.
+A \emph{matrix of nodes} is a \tikzname\ matrix in which each cell contains a
+node. In this case it is bothersome having to write |\node{| at the beginning
+of each cell and |};| at the end of each cell. The following key simplifies
+typesetting such matrices.
\begin{key}{/tikz/matrix of nodes}
- Conceptually, this key adds |\node{| at the beginning and |};| at
- the end of each cell and sets the |anchor| of the node to
- |base|. Furthermore, it adds the option |name| option to each node,
- 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|.
+ Conceptually, this key adds |\node{| at the beginning and |};| at the end
+ of each cell and sets the |anchor| of the node to |base|. Furthermore, it
+ adds the option |name| option to each node, 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|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\matrix (magic) [matrix of nodes]
@@ -44,13 +44,13 @@ cell. The following key simplifies typesetting such matrices.
\end{tikzpicture}
\end{codeexample}
- You may wish to add options to certain nodes in the matrix. This can
- be achieved in three ways.
- \begin{enumerate}
- \item You can modify, say, the
- |row 2 column 3| style to pass special options to this particular
- cell.
-
+ You may wish to add options to certain nodes in the matrix. This can be
+ achieved in three ways.
+ %
+ \begin{enumerate}
+ \item You can modify, say, the |row 2 column 3| style to pass special
+ options to this particular cell.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[row 2 column 3/.style=red]
\matrix [matrix of nodes]
@@ -61,10 +61,11 @@ 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.
+ %
+ \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.
+ %
{\catcode`\|=12
\begin{codeexample}[]
\begin{tikzpicture}
@@ -77,11 +78,13 @@ cell. The following key simplifies typesetting such matrices.
\end{tikzpicture}
\end{codeexample}
}
- You can also use an option like \verb!|[red] (seven)|! to give a
- different name to the node.
+ %
+ You can also use an option like \verb!|[red] (seven)|! to give a
+ different name to the node.
- Note that the |&| character also takes an optional argument, which
- is an extra column skip.
+ Note that the |&| character also takes an optional argument, which
+ is an extra column skip.
+ %
{\catcode`\|=12
\begin{codeexample}[]
\begin{tikzpicture}
@@ -94,12 +97,12 @@ cell. The following key simplifies typesetting such matrices.
\end{tikzpicture}
\end{codeexample}
}
- \item If your cell starts with a |\path| command or any command that
- expands to |\path|, which includes |\draw|, |\node|, |\fill| and
- others, the |\node{| startup code and the |};| code are
- suppressed. This means that for this particular cell you can
- provide totally different contents.
-
+ \item If your cell starts with a |\path| command or any command that
+ expands to |\path|, which includes |\draw|, |\node|, |\fill| and
+ others, the |\node{| startup code and the |};| code are suppressed.
+ This means that for this particular cell you can provide totally
+ different contents.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [matrix of nodes]
@@ -110,13 +113,14 @@ cell. The following key simplifies typesetting such matrices.
};
\end{tikzpicture}
\end{codeexample}
- \end{enumerate}
+ \end{enumerate}
\end{key}
\begin{key}{/tikz/matrix of math nodes}
- This style is almost the same as the previous style, only |$| is %$
- added at the beginning and at the end of each node, so math mode
- will be switched on in all nodes.
+ This style is almost the same as the previous style, only |$| is added %$
+ at the beginning and at the end of each node, so math mode will be switched
+ on in all nodes.
+ %
{\catcode`\|=12
\begin{codeexample}[]
\begin{tikzpicture}
@@ -132,10 +136,10 @@ cell. The following key simplifies typesetting such matrices.
\end{key}
\begin{key}{/tikz/nodes in empty cells=\meta{true or false} (default true)}
- When set to |true|, a node (with empty contents) is put in empty
- cells. Normally, empty cells are just, well, empty. The style can be
- used together with both a |matrix of nodes| and a
- |matrix of math nodes|.
+ When set to |true|, a node (with empty contents) is put in empty cells.
+ Normally, empty cells are just, well, empty. The style can be used together
+ with both a |matrix of nodes| and a |matrix of math nodes|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [matrix of math nodes,nodes={circle,draw}]
@@ -146,6 +150,7 @@ cell. The following key simplifies typesetting such matrices.
};
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [matrix of math nodes,nodes={circle,draw},nodes in empty cells]
@@ -156,20 +161,22 @@ cell. The following key simplifies typesetting such matrices.
};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\subsection{End-of-Lines and End-of-Row Characters in Matrices of Nodes}
-Special care must be taken about the usage of the |\\| command inside
-a matrix of nodes. The reason is that this character is overloaded in
-\TeX: On the one hand, it is used to denote the end of a line in
-normal text; on the other hand it is used to denote the end of a row
-in a matrix. Now, if a matrix contains node which in turn may have
-multiple lines, it is unclear which meaning of |\\| should be used.
+Special care must be taken about the usage of the |\\| command inside a matrix
+of nodes. The reason is that this character is overloaded in \TeX: On the one
+hand, it is used to denote the end of a line in normal text; on the other hand
+it is used to denote the end of a row in a matrix. Now, if a matrix contains
+node which in turn may have multiple lines, it is unclear which meaning of |\\|
+should be used.
-This problem arises only when you use the |text width| option of
-nodes. Suppose you write a line like
+This problem arises only when you use the |text width| option of nodes. Suppose
+you write a line like
+%
\begin{codeexample}[code only]
\matrix [text width=5cm,matrix of nodes]
{
@@ -177,27 +184,28 @@ nodes. Suppose you write a line like
second row & hmm \\
};
\end{codeexample}
-This leaves \TeX\ trying to riddle out how many rows this matrix
-should have. Do you want two rows with the upper right cell containing
-a two-line text. Or did you mean a three row matrix with the second
-row having only one cell?
+%
+This leaves \TeX\ trying to riddle out how many rows this matrix should have.
+Do you want two rows with the upper right cell containing a two-line text. Or
+did you mean a three row matrix with the second row having only one cell?
Since \TeX\ is not clairvoyant, the following rules are used:
+%
\begin{enumerate}
-\item Inside a matrix, the |\\| command, by default, signals the end
- of the row, not the end of a line in a cell.
-\item However, there is an exception to this rule: If a cell
- starts with a \TeX-group (this is, with |{|), % }
- 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.
+ \item Inside a matrix, the |\\| command, by default, signals the end of the
+ row, not the end of a line in a cell.
+ \item However, there is an exception to this rule: If a cell starts with a
+ \TeX-group (this is, with |{|), 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.
\end{enumerate}
-The net effect of these rules is the following: Normally, |\\| is an
-end-of-row indicator; if you want to use it as an end-of-line
-indicator in a cell, just put the whole cell in curly braces. The
-following example illustrates the difference:
+The net effect of these rules is the following: Normally, |\\| is an end-of-row
+indicator; if you want to use it as an end-of-line indicator in a cell, just
+put the whole cell in curly braces. The following example illustrates the
+difference:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [matrix of nodes,nodes={text width=16mm,draw}]
@@ -217,27 +225,28 @@ following example illustrates the difference:
\end{tikzpicture}
\end{codeexample}
-Note that this system is not fool-proof. If you write things like
-|a&b{c\\d}\\| in a matrix of nodes, an error will result (because the
-second cell did not start with a brace, so |\\| retained its normal
-meaning and, thus, the second cell contained the text |b{c|, which is
-not balanced with respect to the number of braces).
+Note that this system is not fool-proof. If you write things like |a&b{c\\d}\\|
+in a matrix of nodes, an error will result (because the second cell did not
+start with a brace, so |\\| retained its normal meaning and, thus, the second
+cell contained the text |b{c|, which is not balanced with respect to the number
+of braces).
+
\subsection{Delimiters}
-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|
-and so on. In particular, you can add delimiters to any |rectangle|
-box. They are implemented by ``measuring the height'' of the node and
-then adding a delimiter of the correct size to the left or right using
-some after node magic.
+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| and so on. In particular, you
+can add delimiters to any |rectangle| box. They are implemented by ``measuring
+the height'' of the node and then adding a delimiter of the correct size to the
+left or right using some after node magic.
\begin{key}{/tikz/left delimiter=\meta{delimiter}}
- This option can be given to a any node that has the standard anchors
- |north|, |south| and so on. The \meta{delimiter} can be any
- delimiter that is acceptable to \TeX's |\left| command.
+ This option can be given to a any node that has the standard anchors
+ |north|, |south| and so on. The \meta{delimiter} can be any delimiter that
+ is acceptable to \TeX's |\left| command.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [matrix of math nodes,left delimiter=(,right delimiter=\}]
@@ -256,13 +265,14 @@ some after node magic.
\end{tikzpicture}
\end{codeexample}
- \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}
+ \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}
- \begin{stylekey}{/tikz/every left delimiter (initially \normalfont empty)}
- This style is additionally executed for every left delimiter.
+ \begin{stylekey}{/tikz/every left delimiter (initially \normalfont empty)}
+ This style is additionally executed for every left delimiter.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[every left delimiter/.style={red,xshift=1ex},
@@ -275,20 +285,21 @@ some after node magic.
};
\end{tikzpicture}
\end{codeexample}
- \end{stylekey}
+ \end{stylekey}
\end{key}
\begin{key}{/tikz/right delimiter=\meta{delimiter}}
- Works as above.
- \begin{stylekey}{/tikz/every right delimiter (initially \normalfont empty)}
Works as above.
- \end{stylekey}
+ %
+ \begin{stylekey}{/tikz/every right delimiter (initially \normalfont empty)}
+ Works as above.
+ \end{stylekey}
\end{key}
-
\begin{key}{/tikz/above delimiter=\meta{delimiter}}
- This option allows you to add a delimiter above the node. It is
- implemented by rotating a left delimiter.
+ This option allows you to add a delimiter above the node. It is implemented
+ by rotating a left delimiter.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [matrix of math nodes,%
@@ -302,20 +313,19 @@ some after node magic.
\end{tikzpicture}
\end{codeexample}
- \begin{stylekey}{/tikz/every above delimiter (initially \normalfont empty)}
- Works as above.
- \end{stylekey}
+ \begin{stylekey}{/tikz/every above delimiter (initially \normalfont empty)}
+ Works as above.
+ \end{stylekey}
\end{key}
\begin{key}{/tikz/below delimiter=\meta{delimiter}}
- Works as above.
- \begin{stylekey}{/tikz/every below delimiter (initially \normalfont empty)}
Works as above.
- \end{stylekey}
+ \begin{stylekey}{/tikz/every below delimiter (initially \normalfont empty)}
+ Works as above.
+ \end{stylekey}
\end{key}
-
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
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 a01c56b50bc..47bc68db890 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
@@ -7,98 +7,106 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Mindmap Drawing Library}
\begin{tikzlibrary}{mindmap}
- This packages provides styles for drawing mindmap diagrams.
+ This packages provides styles for drawing mindmap diagrams.
\end{tikzlibrary}
+
\subsection{Overview}
-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
-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
-the page and is drawn as a huge circle, ellipse, or cloud. The related
-concepts then ``leave'' this root concept via branch-like tendrils.
-
-The mindmap library of \tikzname\ produces mindmaps that look a bit
-different from the standard mindmaps: While the big root concept is
-still a circle, related concepts are also depicted as (smaller)
-circles. The related concepts are linked to the root concept via
-organic-looking connections. The overall effect is visually rather
-pleasing, but readers may not immediately think of a mindmap when they
-see a picture created with this library.
-
-Although it is not strictly necessary, you will usually create
-mindmaps using \tikzname's tree mechanism and some of the styles and
-macros of the package work best when used inside trees. However, it is
-still possible and sometimes necessary to treat parts of a mindmap as
-a graph with arbitrary edges and this is also possible.
+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
+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 the page and is drawn as a
+huge circle, ellipse, or cloud. The related concepts then ``leave'' this root
+concept via branch-like tendrils.
+
+The mindmap library of \tikzname\ produces mindmaps that look a bit different
+from the standard mindmaps: While the big root concept is still a circle,
+related concepts are also depicted as (smaller) circles. The related concepts
+are linked to the root concept via organic-looking connections. The overall
+effect is visually rather pleasing, but readers may not immediately think of a
+mindmap when they see a picture created with this library.
+
+Although it is not strictly necessary, you will usually create mindmaps using
+\tikzname's tree mechanism and some of the styles and macros of the package
+work best when used inside trees. However, it is still possible and sometimes
+necessary to treat parts of a mindmap as a graph with arbitrary edges and this
+is also possible.
\subsection{The Mindmap Style}
-Every mindmap should be put in a scope or a picture where the
-|mindmap| style is used. This style installs some internal settings.
+Every mindmap should be put in a scope or a picture where the |mindmap| style
+is used. This style installs some internal settings.
\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.
+ 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.
+ %
\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).
- \begin{stylekey}{/tikz/every mindmap}
- This style is included by the |mindmap| style. Change this style to
- add special settings to your mindmaps.
+ %
+ The sizes of concepts are predefined in such a way that a 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.
+ %
\begin{codeexample}[]
\tikz[large mindmap,concept color=red!50]
\node [concept] {Root concept}
child[grow=right] {node[concept] {Child concept}};
\end{codeexample}
- \end{stylekey}
+ \end{stylekey}
- \paragraph{Remark:} Note that |mindmap| redefines |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
+ \paragraph{Remark:}
+ Note that |mindmap| redefines |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
- |level 1 concept/.append style={font=\small}|
+ |level 1 concept/.append style={font=\small}|
- \noindent or
+ \noindent or
- |level 2 concept/.append style={sibling distance=90}|
+ |level 2 concept/.append style={sibling distance=90}|
- \noindent \emph{after} the |mindmap| style.
+ \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.
+ 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, fonts and distances so that a medium-sized
- mindmap will fit on an A3 page (A3 pages are twice as large as A4
- pages).
+ 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 A3 page (A3 pages are twice as large as A4 pages).
\end{stylekey}
+
\begin{stylekey}{/tikz/huge mindmap}
- This style causes concepts to be even bigger and it is best used with
- A2 paper and above.
+ This style causes concepts to be even bigger and it is best used with A2
+ paper and above.
\end{stylekey}
\subsection{Concepts Nodes}
-The basic entities of mindmaps are called \emph{concepts} in
-\tikzname. A concept is a node of style |concept| and it must be
-circular for some of the connection macros to work.
+The basic entities of mindmaps are called \emph{concepts} in \tikzname. A
+concept is a node of style |concept| and it must be circular for some of the
+connection macros to work.
\subsubsection{Isolated Concepts}
@@ -106,67 +114,67 @@ circular for some of the connection macros to work.
The following styles influence how isolated concepts are rendered:
\begin{stylekey}{/tikz/concept}
- This style should be used with all nodes that are concepts, although
- some styles like |extra concept| install this style automatically.
+ This style should be used with all nodes that are concepts, although some
+ styles like |extra concept| install this style automatically.
- 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.
+ 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}[]
\tikz[mindmap,concept color=red!50] \node [concept] {Some concept};
\end{codeexample}
- \begin{stylekey}{/tikz/every concept}
- In order to change the appearance of concept nodes, you should
- change this style. Note, however, that the color of a concept should
- be uniform for some of the connection bar stuff to work, so you
- should not change the color or the draw/fill state of concepts using
- this option. It is mostly useful for changing the text color and
- font.
- \end{stylekey}
-
- \begin{key}{/tikz/concept color=\meta{color}}
- This option tells \tikzname\ which color should be used for filling
- and stroking concepts. The difference between this option and just
- setting |every concept| to the desired color is that this option
- allows \tikzname\ to keep track of the colors used for
- concepts. This is important when you \emph{change} the color between
- two connected concepts. In this case, \tikzname\ can automatically
- create a shading that provides a smooth transition between the old
- and the new concept color; we will come back to this in the next
- section.
- \end{key}
+ \begin{stylekey}{/tikz/every concept}
+ In order to change the appearance of concept nodes, you should change
+ this style. Note, however, that the color of a concept should be
+ uniform for some of the connection bar stuff to work, so you should not
+ change the color or the draw/fill state of concepts using this option.
+ It is mostly useful for changing the text color and font.
+ \end{stylekey}
+
+ \begin{key}{/tikz/concept color=\meta{color}}
+ This option tells \tikzname\ which color should be used for filling and
+ stroking concepts. The difference between this option and just setting
+ |every concept| to the desired color is that this option allows
+ \tikzname\ to keep track of the colors used for concepts. This is
+ important when you \emph{change} the color between two connected
+ concepts. In this case, \tikzname\ can automatically create a shading
+ that provides a smooth transition between the old and the new concept
+ color; we will come back to this in the next section.
+ \end{key}
\end{stylekey}
\begin{stylekey}{/tikz/extra concept}
- This style is intended for concepts that are not part of the
- ``mindmap tree,'' but stand beside it. Typically, they will have a
- subdued color or be smaller. In order to have these concepts appear
- in a uniform way and in order to indicate in the code that these
- concepts are additional, you can use this style.
+ This style is intended for concepts that are not part of the ``mindmap
+ tree'', but stand beside it. Typically, they will have a subdued color or
+ be smaller. In order to have these concepts appear in a uniform way and in
+ order to indicate in the code that these concepts are additional, you can
+ use this style.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[mindmap,concept color=blue!80]
\node [concept] {Root concept};
\node [extra concept] at (10,0) {extra concept};
\end{tikzpicture}
\end{codeexample}
- \begin{stylekey}{/tikz/every extra concept}
- Change this style to change the appearance of extra concepts.
- \end{stylekey}
+ %
+ \begin{stylekey}{/tikz/every extra concept}
+ Change this style to change the appearance of extra concepts.
+ \end{stylekey}
\end{stylekey}
\subsubsection{Concepts in Trees}
-As pointed out earlier, \tikzname\ assumes that your mindmap is built
-using the |child| facilities of \tikzname. There are numerous options
-that influence how concepts are rendered at the different levels of a
-tree.
+As pointed out earlier, \tikzname\ assumes that your mindmap is built using the
+|child| facilities of \tikzname. There are numerous options that influence how
+concepts are rendered at the different levels of a tree.
\begin{stylekey}{/tikz/root concept}
- This style is used for the roots of mindmap trees. By adding
- something to this, you can change how the root of a mindmap will be
- rendered.
+ This style is used for the roots of mindmap trees. By adding something to
+ this, you can change how the root of a mindmap will be rendered.
+ %
\begin{codeexample}[]
\tikz
[root concept/.append style={concept color=blue!80,minimum size=3.5cm},
@@ -174,14 +182,14 @@ tree.
\node [concept] {Root concept};
\end{codeexample}
- Note that styles like |large mindmap| redefine these styles, so you
- should add something to this style only inside the picture.
+ Note that styles like |large mindmap| redefine these styles, so you should
+ add something to this style only inside the picture.
\end{stylekey}
\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.
+ 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.
+ %
\begin{codeexample}[]
\tikz
[root concept/.append style={concept color=blue!80},
@@ -192,29 +200,31 @@ tree.
child[grow=0 ] {node[concept] {child}};
\end{codeexample}
\end{stylekey}
+
\begin{stylekey}{/tikz/level 2 concept}
- Works like |level 1 concept|, only for second level children.
+ Works like |level 1 concept|, only for second level children.
\end{stylekey}
+
\begin{stylekey}{/tikz/level 3 concept}
- Works like |level 1 concept|.
+ Works like |level 1 concept|.
\end{stylekey}
+
\begin{stylekey}{/tikz/level 4 concept}
- Works like |level 1 concept|. Note that there are no fifth and
- higher level styles, you need to modify |level 5| directly in such
- cases.
+ Works like |level 1 concept|. Note that there are no fifth and higher level
+ styles, you need to modify |level 5| directly in such cases.
\end{stylekey}
\begin{key}{/tikz/concept color=\meta{color}}
- We saw already that this option is used to change the color of
- concepts. We now have a look at its effect when used on child nodes
- of a concept. Normally, this option simply changes the color of the
- children. However, when the option is given as an option to the
- |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.
-
- Here is an example:
+ We saw already that this option is used to change the color of concepts. We
+ now have a look at its effect when used on child nodes of a concept.
+ Normally, this option simply changes the color of the children. However,
+ when the option is given as an option to the |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.
+
+ Here is an example:
+ %
\begin{codeexample}[]
\tikz[mindmap,concept color=blue!80]
\node [concept] {Root concept}
@@ -222,9 +232,9 @@ tree.
child[concept color=orange,grow=0] {node[concept] {Child concept}};
\end{codeexample}
- In order to have a concept color which changes with the hierarchy level, a tiny bit of magic is needed:
- % FIXME : is this a bug in the software!? The root concept is
- % black!?
+ In order to have a concept color which changes with the hierarchy level, a
+ tiny bit of magic is needed:
+% FIXME: is this a bug in the software!? The root concept is black!?
\begin{codeexample}[]
\tikz[mindmap,text=white,
root concept/.style={concept color=blue},
@@ -234,27 +244,28 @@ tree.
child[grow=30] {node[concept] {child}}
child[grow=0 ] {node[concept] {child}};
\end{codeexample}
+ %
\end{key}
+
\subsection{Connecting Concepts}
\subsubsection{Simple Connections}
-The easiest way to connect two concepts is to draw a line between
-them. In order to give such lines a consistent appearance, it is
-recommendable to use the following style when drawing such lines:
+The easiest way to connect two concepts is to draw a line between them. In
+order to give such lines a consistent appearance, it is recommendable to use
+the following style when drawing such lines:
\begin{stylekey}{/tikz/concept connection}
- This style can be used for lines between two concepts. Feel free to
- redefine this style.
+ This style can be used for lines between two concepts. Feel free to
+ redefine this style.
\end{stylekey}
-A problem arises when you need to connect concepts after the main
-mindmap has been drawn. In this case you will want the connection
-lines to lie \emph{behind} the main mindmap. However, you can draw the
-lines only after the coordinates of the concepts have been
-determined. In this case you should place the connecting lines on a
-background layer as in the following example:
+A problem arises when you need to connect concepts after the main mindmap has
+been drawn. In this case you will want the connection lines to lie
+\emph{behind} the main mindmap. However, you can draw the lines only after the
+coordinates of the concepts have been determined. In this case you should place
+the connecting lines on a background layer as in the following example:
\begin{codeexample}[]
\begin{tikzpicture}
@@ -277,38 +288,43 @@ background layer as in the following example:
\subsubsection{The Circle Connection Bar Decoration}
-Instead of a simple line between two concepts, you can also add a bar
-between the two nodes that has slightly organic ends. These bars are
-also used by default as the edges from parents in the mindmap tree.
+Instead of a simple line between two concepts, you can also add a bar between
+the two nodes that has slightly organic ends. These bars are also used by
+default as the edges from parents in the mindmap tree.
-For the drawing of the bars a special decoration is used, which is defined
-in the mindmap library:
+For the drawing of the bars a special decoration is used, which is defined in
+the mindmap library:
\begin{decoration}{circle connection bar}
- This decoration can be used to connect two circles. The start of the
- to-be-decorated path should lie on the border of the first circle,
- the end should lie on the border of the second circle. The following
- two decoration keys should be initialized with the sizes of the circles:
- \begin{itemize}
- \item |start radius|
- \item |end radius|
- \end{itemize}
- Furthermore, the following two decoration keys influence the decoration:
- \begin{itemize}
- \item |amplitude|
- \item |angle|
- \end{itemize}
- The decoration turns a straight line into a path that starts on the border of the
- 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.
-
- Here is an example that should make this clearer:
+ This decoration can be used to connect two circles. The start of the
+ to-be-decorated path should lie on the border of the first circle, the end
+ should lie on the border of the second circle. The following two decoration
+ keys should be initialized with the sizes of the circles:
+ %
+ \begin{itemize}
+ \item |start radius|
+ \item |end radius|
+ \end{itemize}
+ %
+ Furthermore, the following two decoration keys influence the decoration:
+ %
+ \begin{itemize}
+ \item |amplitude|
+ \item |angle|
+ \end{itemize}
+ %
+ The decoration turns a straight line into a path that starts on the border
+ of the 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.
+
+ Here is an example that should make this clearer:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[decoration={start radius=1cm,end radius=.5cm,amplitude=2mm,angle=30}]
- \fill[blue!20] (0,0) circle (1cm);
+ \fill[blue!20] (0,0) circle (1cm);
\fill[red!20] (2.5,0) circle (.5cm);
\filldraw [draw=red,fill=black,
@@ -316,75 +332,76 @@ in the mindmap library:
\end{tikzpicture}
\end{codeexample}
- As can be seen, the decorated path consists of three parts and is not really
- useful for drawing. However, if you fill the decorated path only, and if you
- use the same color as for the circles, the result is better.
+ As can be seen, the decorated path consists of three parts and is not
+ really useful for drawing. However, if you fill the decorated path only,
+ and if you use the same color as for the circles, the result is better.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[blue!50,decoration={start radius=1cm,
end radius=.5cm,amplitude=2mm,angle=30}]
- \fill (0,0) circle (1cm);
- \fill (2.5,0) circle (.5cm);
+ \fill (0,0) circle (1cm);
+ \fill (2.5,0) circle (.5cm);
\fill [decorate,decoration=circle connection bar] (1,0) -- (2,0);
\end{tikzpicture}
\end{codeexample}
- In the above example you may notice the small white line between the
- circles and the decorated path. This is due to rounding
- errors. Unfortunately, for larger distances, the errors can
- accumulate quite strongly, especially since \tikzname\ and \TeX\ are
- not very good at computing square roots. For this reason, it is a
- 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| of one or two points (for very
- large distances you may need line width up to 4pt).
+ In the above example you may notice the small white line between the
+ circles and the decorated path. This is due to rounding errors.
+ Unfortunately, for larger distances, the errors can accumulate quite
+ strongly, especially since \tikzname\ and \TeX\ are not very good at
+ computing square roots. For this reason, it is a 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| of
+ one or two points (for very large distances you may need line width up to
+ 4pt).
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[blue!50,decoration={start radius=1cm,
end radius=.5cm,amplitude=2mm,angle=30}]
- \fill (0,0) circle (1cm+1pt);
- \fill (2.4,0) circle (.5cm+1pt);
+ \fill (0,0) circle (1cm+1pt);
+ \fill (2.4,0) circle (.5cm+1pt);
\fill [decorate,decoration=circle connection bar] (1,0) -- (1.9,0);
\end{tikzpicture}
\end{codeexample}
- % FIXME : this paragraph appears to be deprecated:
- %Note the slightly strange |outer sep=0pt|. This is needed so that
- %the decorated path lies on the border of the filled circle, not on the
- %border of the stroked circle (which is slightly larger and this
- %slightly larger size is exactly what we wish to use to cover up the
- %rounding errors).
+ % FIXME: this paragraph appears to be deprecated:
+ %Note the slightly strange |outer sep=0pt|. This is needed so that
+ %the decorated path lies on the border of the filled circle, not on the
+ %border of the stroked circle (which is slightly larger and this
+ %slightly larger size is exactly what we wish to use to cover up the
+ %rounding errors).
\end{decoration}
-
\subsubsection{The Circle Connection Bar To-Path}
-The |circle connection bar| decoration is a bit complicated to
-use. Especially specifying the radii is quite bothersome (the
-amplitude and the angle can be set once and for all). For this reason,
-the mindmap library defines a special to-path that performs the
-necessary computations for you.
+The |circle connection bar| decoration is a bit complicated to use. Especially
+specifying the radii is quite bothersome (the amplitude and the angle can be
+set once and for all). For this reason, the mindmap library defines a special
+to-path that performs the necessary computations for you.
\begin{stylekey}{/tikz/circle connection bar}
- This style installs a rather involved to-path. Unlike normal
- to-paths, this path requires that the start and the target of the
- to-path are named nodes of shape |circle| -- if this is not the case,
- this path will produce errors.
-
- Assuming that the start and the target are circles, the to-path will
- first compute the radii of these circles (by measuring the distance
- 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 connection bar|. Finally, the following style is
- included:
- \begin{stylekey}{/tikz/every circle connection bar}
- Redefine this style to change the appearance of circle connection
- bar to-paths.
- \end{stylekey}
+ This style installs a rather involved to-path. Unlike normal to-paths, this
+ path requires that the start and the target of the to-path are named nodes
+ of shape |circle| -- if this is not the case, this path will produce
+ errors.
+
+ Assuming that the start and the target are circles, the to-path will first
+ compute the radii of these circles (by measuring the distance 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 connection bar|. Finally, the following style is included:
+ %
+ \begin{stylekey}{/tikz/every circle connection bar}
+ 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]
\node (n1) at (0,0) [circle,minimum size=2cm,fill,draw,thick] {};
@@ -393,23 +410,24 @@ necessary computations for you.
\path (n1) to[circle connection bar] (n2);
\end{tikzpicture}
\end{codeexample}
- Note that it is not a good idea to have more than one |to| operation
- together with the option |circle connection bar| in a single
- |\path|. Use the |edge| operation, instead, for creating multiple
- connections and this operation creates a new scope for each edge.
+ %
+ Note that it is not a good idea to have more than one |to| operation
+ together with the option |circle connection bar| in a single |\path|. Use
+ the |edge| operation, instead, for creating multiple connections and this
+ operation creates a new scope for each edge.
\end{stylekey}
-In a mindmap we sometimes want colors to change from one concept color
-to another. Then, the connection bar should, ideally, consist of a
-smooth transition between these two colors. Getting this right using
-shadings is a bit tricky if you try this ``by hand,'' so the mindmap
-library provides a special option for facilitating this procedure.
-
-\begin{key}{/tikz/circle connection bar switch color=|from (|\meta{first
- color}|) to (|\meta{second color}|)|}
- This style works similarly to the |circle connection bar|. The only
- difference is that instead of filling the path with a single color a
- shading is used.
+In a mindmap we sometimes want colors to change from one concept color to
+another. Then, the connection bar should, ideally, consist of a smooth
+transition between these two colors. Getting this right using shadings is a bit
+tricky if you try this ``by hand'', so the mindmap library provides a special
+option for facilitating this procedure.
+
+\begin{key}{/tikz/circle connection bar switch color=|from (|\meta{first color}|) to (|\meta{second color}|)|}
+ This style works similarly to the |circle connection bar|. The only
+ difference is that instead of filling the path with a single color a
+ shading is used.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[outer sep=0pt]
\node (n1) at (0,0) [circle,minimum size=2cm,fill,draw,thick,red] {};
@@ -418,27 +436,29 @@ library provides a special option for facilitating this procedure.
\path (n1) to[circle connection bar switch color=from (red) to (blue)] (n2);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\subsubsection{Tree Edges}
-Most of the time, concepts in a mindmap are connected automatically
-when the mindmap is built as a tree. The reason is that the |mindmap|
-installs a |circle connection bar| path as the |edge from parent path|. Also, the |mindmap| option takes care of things like setting the
-correct |draw| and |outer sep| settings and some other stuff.
-
-In detail, the |mindmap| option sets the |edge from parent path| to a
-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 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.
+Most of the time, concepts in a mindmap are connected automatically when the
+mindmap is built as a tree. The reason is that the |mindmap| installs a
+|circle connection bar| path as the |edge from parent path|. Also, the
+|mindmap| option takes care of things like setting the correct |draw| and
+|outer sep| settings and some other stuff.
+
+In detail, the |mindmap| option sets the |edge from parent path| to a 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 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.
Here is an example of a tree built in this way:
-
+%
\begin{codeexample}[]
\begin{tikzpicture}
\path[mindmap,concept color=black,text=white]
@@ -466,20 +486,19 @@ Here is an example of a tree built in this way:
\end{codeexample}
-
\subsection{Adding Annotations}
-An \emph{annotation} is some text outside a mindmap that, unlike an
-extra concept, simply explains something in the mindmap. The following
-style is mainly intended to help readers of the code see that a node
-in an annotation node.
+An \emph{annotation} is some text outside a mindmap that, unlike an extra
+concept, simply explains something in the mindmap. The following style is
+mainly intended to help readers of the code see that a node in an annotation
+node.
\begin{stylekey}{/tikz/annotation}
- This style indicates that a node is an annotation node. It includes
- the style |every annotation|, which allows you to change this style
- in a convenient fashion.
+ This style indicates that a node is an annotation node. It includes the
+ style |every annotation|, which allows you to change this style in a
+ convenient fashion.
+ %
\begin{codeexample}[]
-
\begin{tikzpicture}
[mindmap,concept color=blue!80,
every annotation/.style={fill=red!20}]
@@ -489,13 +508,13 @@ in an annotation node.
{The root concept is, in general, the most important concept.};
\end{tikzpicture}
\end{codeexample}
- \begin{stylekey}{/tikz/every annotation}
- This style is included by |annotation|.
- \end{stylekey}
+ %
+ \begin{stylekey}{/tikz/every annotation}
+ This style is included by |annotation|.
+ \end{stylekey}
\end{stylekey}
-
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-patterns.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-patterns.tex
index 42d4555213a..281dee5b5de 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-patterns.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-patterns.tex
@@ -12,20 +12,20 @@
\label{section-library-patterns}
\begin{pgflibrary}{patterns}
- The package defines patterns for filling areas.
+ The package defines patterns for filling areas.
\end{pgflibrary}
\newcommand\patternindex[1]{%
\index{#1@\protect\texttt{#1} pattern}%
\index{Patterns!#1@\protect\texttt{#1}}%
- \texttt{#1}&
+ \texttt{#1}&
\begin{tikzpicture}[baseline=.5ex]
% Background
\pattern [path fading=west,pattern=checkerboard light gray]
(0,0) rectangle (5cm,2em);
-
+
\pattern [pattern=#1,pattern color=black] (0,0) rectangle +(1.5cm,2em);
\pattern [pattern=#1,pattern color=blue] (1.75,0) rectangle +(1.5cm,2em);
\pattern [pattern=#1,pattern color=red] (3.5,0) rectangle +(1.5cm,2em);
@@ -35,53 +35,54 @@
\newcommand\patternindexinherentlycolored[1]{%
\index{#1@\protect\texttt{#1} pattern}%
\index{Patterns!#1@\protect\texttt{#1}}%
- \texttt{#1}&
+ \texttt{#1}&
\begin{tikzpicture}[baseline=.5ex]
% Background
\pattern [path fading=west,pattern=checkerboard light gray]
(0,0) rectangle (5cm,2em);
-
+
\pattern [pattern=#1,pattern color=blue] (0,0) rectangle +(5cm,2em);
\end{tikzpicture} \\[1ex]
}
+
\subsection{Form-Only Patterns}
\begin{tabular}{ll}
- \emph{Pattern name} & \emph{Example (pattern in black, blue, and red
- on faded checkerboard)} \\
- \patternindex{horizontal lines}
- \patternindex{vertical lines}
- \patternindex{north east lines}
- \patternindex{north west lines}
- \patternindex{grid}
- \patternindex{crosshatch}
- \patternindex{dots}
- \patternindex{crosshatch dots}
- \patternindex{fivepointed stars}
- \patternindex{sixpointed stars}
- \patternindex{bricks}
- \patternindex{checkerboard}
+ \emph{Pattern name}
+ & \emph{Example (pattern in black, blue, and red on faded checkerboard)} \\
+ \patternindex{horizontal lines}
+ \patternindex{vertical lines}
+ \patternindex{north east lines}
+ \patternindex{north west lines}
+ \patternindex{grid}
+ \patternindex{crosshatch}
+ \patternindex{dots}
+ \patternindex{crosshatch dots}
+ \patternindex{fivepointed stars}
+ \patternindex{sixpointed stars}
+ \patternindex{bricks}
+ \patternindex{checkerboard}
\end{tabular}
-
-\subsection{Inherently Colored Patterns}
+\subsection{Inherently Colored Patterns}
+
\begin{tabular}{ll}
- \emph{Pattern name} & \emph{Example} \\
- \patternindexinherentlycolored{checkerboard light gray}
- \patternindexinherentlycolored{horizontal lines light gray}
- \patternindexinherentlycolored{horizontal lines gray}
- \patternindexinherentlycolored{horizontal lines dark gray}
- \patternindexinherentlycolored{horizontal lines light blue}
- \patternindexinherentlycolored{horizontal lines dark blue}
- \patternindexinherentlycolored{crosshatch dots gray}
- \patternindexinherentlycolored{crosshatch dots light steel blue}
+ \emph{Pattern name} & \emph{Example} \\
+ \patternindexinherentlycolored{checkerboard light gray}
+ \patternindexinherentlycolored{horizontal lines light gray}
+ \patternindexinherentlycolored{horizontal lines gray}
+ \patternindexinherentlycolored{horizontal lines dark gray}
+ \patternindexinherentlycolored{horizontal lines light blue}
+ \patternindexinherentlycolored{horizontal lines dark blue}
+ \patternindexinherentlycolored{crosshatch dots gray}
+ \patternindexinherentlycolored{crosshatch dots light steel blue}
\end{tabular}
-
-%%% 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 9807c3542d3..ccf03560917 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,23 +11,21 @@
\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.
\begin{stylekey}{/tikz/place}
- This style indicates that a node is a place of a Petri net. Usually,
- the text of the node should be empty since places do not contain any
- text. You should use the |label| option to add text outside the node
- like its name or its capacity. You should use the |tokens| options,
- explained in Section~\ref{section-tokens}, to add tokens inside the
- place.
-
+ This style indicates that a node is a place of a Petri net. Usually, the
+ text of the node should be empty since places do not contain any text. You
+ should use the |label| option to add text outside the node 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) {};
@@ -35,9 +33,10 @@ The package defines a style for drawing places of Petri nets.
\end{tikzpicture}
\end{codeexample}
- \begin{stylekey}{/tikz/every place}
- This style is evoked by the style |place|. To change the
- appearance of places, you can change this style.
+ \begin{stylekey}{/tikz/every place}
+ This style is evoked by the style |place|. To change the appearance of
+ places, you can change this style.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[every place/.style={draw=blue,fill=blue!20,thick,minimum size=9mm}]
@@ -46,25 +45,22 @@ The package defines a style for drawing places of Petri nets.
label=below:$p_2\ge1$,right=of p1] (p2) {};
\end{tikzpicture}
\end{codeexample}
- \end{stylekey}
+ \end{stylekey}
\end{stylekey}
-
-
\subsection{Transitions}
-Transitions are also nodes. They should be drawn using the following
-style:
+Transitions are also nodes. They should be drawn using the following style:
\begin{stylekey}{/tikz/transition}
- This style indicates that a node is a transition. As for places, the
- text of a transition should be empty and the |label| option should
- be used for adding labels.
-
- To connect a transition to places, you can use the |edge| command as
- in the following example:
+ This style indicates that a node is a transition. As for places, the text
+ of a transition should be empty and the |label| option should be used for
+ adding labels.
+ 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) {};
@@ -76,47 +72,46 @@ style:
\end{tikzpicture}
\end{codeexample}
- \begin{stylekey}{/tikz/every transition}
- This style is evoked by the style |transition|.
- \end{stylekey}
-
- \begin{stylekey}{/tikz/pre}
- This style can be used with paths leading \emph{from} a transition
- \emph{to} a place to indicate that the place is in the pre-set of
- the transition. By default, this style is |<-,shorten <=1pt|, but
- feel free to redefine it.
- \end{stylekey}
-
- \begin{stylekey}{/tikz/post}
- This style is also used with paths leading \emph{from} a transition
- \emph{to} a place, but this time the place is in the post-set of
- the transition. Again, feel free to redefine it.
- \end{stylekey}
-
- \begin{stylekey}{/tikz/pre and post}
- This style is to be used to indicate that a place is both in the
- pre- and post-set of a transition.
- \end{stylekey}
+ \begin{stylekey}{/tikz/every transition}
+ This style is evoked by the style |transition|.
+ \end{stylekey}
+
+ \begin{stylekey}{/tikz/pre}
+ This style can be used with paths leading \emph{from} a transition
+ \emph{to} a place to indicate that the place is in the pre-set of the
+ transition. By default, this style is |<-,shorten <=1pt|, but feel free
+ to redefine it.
+ \end{stylekey}
+
+ \begin{stylekey}{/tikz/post}
+ This style is also used with paths leading \emph{from} a transition
+ \emph{to} a place, but this time the place is in the post-set of the
+ transition. Again, feel free to redefine it.
+ \end{stylekey}
+
+ \begin{stylekey}{/tikz/pre and post}
+ This style is to be used to indicate that a place is both in the pre-
+ and post-set of a transition.
+ \end{stylekey}
\end{stylekey}
\subsection{Tokens}
\label{section-tokens}
-Interestingly, the most complicated aspect of drawing Petri nets in
-\tikzname\ turns out to be the placement of tokens.
+Interestingly, the most complicated aspect of drawing Petri nets in \tikzname\
+turns out to be the placement of tokens.
-Let us start with a single token. They are also nodes and there is a
-simple style for typesetting them.
+Let us start with a single token. They are also nodes and there is a simple
+style for typesetting them.
\begin{stylekey}{/tikz/token}
- This style indicates that a node is a token. By default, this causes
- the node to be a small black circle. Unlike places and transitions,
- it \emph{does} make sense to provide text for the token node. Such
- 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|).
-
+ This style indicates that a node is a token. By default, this causes the
+ node to be a small black circle. Unlike places and transitions, it
+ \emph{does} make sense to provide text for the token node. Such 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) {};
@@ -126,28 +121,28 @@ simple style for typesetting them.
\node[token] at (p2) {$y$};
\end{tikzpicture}
\end{codeexample}
- \begin{stylekey}{/tikz/every token}
- Change this style to change the appearance of tokens.
- \end{stylekey}
+ %
+ \begin{stylekey}{/tikz/every token}
+ Change this style to change the appearance of tokens.
+ \end{stylekey}
\end{stylekey}
-In the above example, it is bothersome that we need an extra command
-for the token node. Worse, when we have \emph{two} tokens on a node,
-it is difficult to place both nodes inside the node without overlap.
+In the above example, it is bothersome that we need an extra command for the
+token node. Worse, when we have \emph{two} tokens on a node, it is difficult to
+place both nodes inside the node without overlap.
The Petri net library offers a solution to this problem: The
|children are tokens| style.
-
\begin{stylekey}{/tikz/children are tokens}
- The idea behind this style is to use trees mechanism for placing
- tokens. Every token lying on a place is treated as a child of the
- node. Normally this would have the effect that the tokens are placed
- below the place and they would be connected to the place by an
- edge. The |children are tokens| style, however, redefines the growth
- function of trees such that it places the children next to each
- other inside (or, rather, on top) of the place node. Additionally,
- the edge from the parent node is not drawn.
+ The idea behind this style is to use trees mechanism for placing tokens.
+ Every token lying on a place is treated as a child of the node. Normally
+ this would have the effect that the tokens are placed below the place and
+ they would be connected to the place by an edge. The |children are tokens|
+ style, however, redefines the growth function of trees such that it places
+ the children next to each other inside (or, rather, on top) of the place
+ node. Additionally, the edge from the parent node is not drawn.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node[place,label=above:$p_1$] {}
@@ -158,19 +153,19 @@ The Petri net library offers a solution to this problem: The
\end{tikzpicture}
\end{codeexample}
- In detail, what happens is the following: Tree growth functions tell
- \tikzname\ where it should place the children of nodes. These
- functions get passed the number of children that a node has an the
- number of the child that should be placed. The special tree growth
- function for tokens has a special mapping for each possible number
- of children up to nine children. This mapping decides for each child
- where it should be placed on top of the place. For example, a single
- child is placed directly on top of the place. Two children are
- placed next to each other, separated by the |token distance|. Three
- children are placed in a triangle whose side lengths are
- |token distance|; and so on up to nine tokens. If you wish to place
- more than nice tokens on a place, you will have to write your own
- placement code.
+ In detail, what happens is the following: Tree growth functions tell
+ \tikzname\ where it should place the children of nodes. These functions get
+ passed the number of children that a node has an the number of the child
+ that should be placed. The special tree growth function for tokens has a
+ special mapping for each possible number of children up to nine children.
+ This mapping decides for each child where it should be placed on top of the
+ place. For example, a single child is placed directly on top of the place.
+ Two children are placed next to each other, separated by the
+ |token distance|. Three children are placed in a triangle whose side
+ lengths are |token distance|; and so on up to nine tokens. If you wish to
+ place more than nice tokens on a place, you will have to write your own
+ placement code.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node[place,label=above:$p_2$] {}
@@ -182,9 +177,10 @@ The Petri net library offers a solution to this problem: The
\end{tikzpicture}
\end{codeexample}
- \begin{key}{/tikz/token distance=\meta{distance}}
- This specifies the distance between the centers of the tokens in the
- arrangements of the option |children are tokens|.
+ \begin{key}{/tikz/token distance=\meta{distance}}
+ This specifies the distance between the centers of the tokens in the
+ arrangements of the option |children are tokens|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node[place,label=above:$p_3$] {}
@@ -195,20 +191,21 @@ The Petri net library offers a solution to this problem: The
child {node [token] {}};
\end{tikzpicture}
\end{codeexample}
- \end{key}
+ \end{key}
\end{stylekey}
-The |children are tokens| option gives you a lot of flexibility, but
-it is a bit cumbersome to use. For this reason there are some options
-that help in standard situations. They all use |children are tokens|
-internally, so any change to, say, the |every token| style will
-affect how these options depict tokens.
+The |children are tokens| option gives you a lot of flexibility, but it is a
+bit cumbersome to use. For this reason there are some options that help in
+standard situations. They all use |children are tokens| internally, so any
+change to, say, the |every token| style will affect how these options depict
+tokens.
\begin{key}{/tikz/tokens=\meta{number}}
- This option is given to a |place| node, not to a |token| node. The
- effect of this option is to add \meta{number} many child nodes to
- the place, each having the style |token|. Thus, the following two
- pieces of codes have the same effect:
+ This option is given to a |place| node, not to a |token| node. The effect
+ of this option is to add \meta{number} many child nodes to the place, each
+ having the style |token|. Thus, the following two pieces of codes have the
+ same effect:
+ %
\begin{codeexample}[]
\tikz
\node[place] {}
@@ -219,9 +216,11 @@ affect how these options depict tokens.
\tikz
\node[place,tokens=3] {};
\end{codeexample}
- It is legal to say |tokens=0|, no tokens are drawn in this
- case. This option does not handle ten or more tokens correctly. If
- you need this many tokens, you will have to program your own code.
+ %
+ It is legal to say |tokens=0|, no tokens are drawn in this case. This
+ option does not handle ten or more tokens correctly. If you need this many
+ tokens, you will have to program your own code.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every place/.style={minimum size=9mm}]
@@ -231,22 +230,28 @@ affect how these options depict tokens.
\node [place,tokens=\tokennumber] at (\x,\y) {};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/colored tokens=\meta{color list}}
- This option, which must also be given when a place node is being
- created, gets a list of colors as parameter. It will then add as
- many tokens to the place as there are colors in this list, each filled correspondingly.
+ This option, which must also be given when a place node is being created,
+ gets a list of colors as parameter. It will then add as many tokens to the
+ place as there are colors in this list, each filled correspondingly.
+ %
\begin{codeexample}[]
\tikz \node[place,colored tokens={black,black,red,blue}] {};
\end{codeexample}
+ %
\end{key}
+
\begin{key}{/tikz/structured tokens=\meta{token texts}}
- This option, which must again be passed to a place, gets a list of
- texts for tokens. For each text, a new token will be added to the place.
+ This option, which must again be passed to a place, gets a list of texts
+ for tokens. For each text, a new token will be added to the place.
+ %
\begin{codeexample}[]
\tikz \node[place,structured tokens={$x$,$y$,$z$}] {};
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every place/.style={minimum size=9mm}]
@@ -256,14 +261,14 @@ affect how these options depict tokens.
\node [place,structured tokens={1,...,\tokennumber}] at (\x,\y) {};
\end{tikzpicture}
\end{codeexample}
- If you use lots of structured tokens, consider redefining the
- |every token| style so that the tokens are larger.
+ %
+ If you use lots of structured tokens, consider redefining the |every token|
+ style so that the tokens are larger.
\end{key}
\subsection{Examples}
-
\begin{codeexample}[]
\begin{tikzpicture}[yscale=-1.6,xscale=1.5,thick,
every transition/.style={draw=red,fill=red!20,minimum size=3mm},
@@ -314,6 +319,7 @@ affect how these options depict tokens.
\end{codeexample}
Here is the same net once more, but with these styles changes:
+%
\begin{codeexample}[code only]
\begin{tikzpicture}[yscale=-1.1,thin,>=stealth,
every transition/.style={fill,minimum width=1mm,minimum height=3.5mm},
@@ -337,36 +343,37 @@ Here is the same net once more, but with these styles changes:
\node[token] at (m1f) {}; \node[token] at (m2f) {};
\node[token] at (h1) {};
- \node[transition] at (1.5,1.5) {} edge [pre] (p1) edge [post] (p2);
- \node[transition] at (1.5,2.5) {} edge[pre] (p2) edge[pre] (m1f)
- edge[post] (p3) edge[post] (m1t);
- \node[transition] at (1.5,3.3) {} edge [pre] (p3) edge [post] (p4)
- edge [pre and post] (h1);
- \node[transition] at (1.5,3.7) {} edge [pre] (p3) edge [pre] (h2)
+ \node[transition] at (1.5,1.5) {} edge [pre] (p1) edge [post] (p2);
+ \node[transition] at (1.5,2.5) {} edge [pre] (p2) edge [pre] (m1f)
+ edge [post] (p3) edge [post] (m1t);
+ \node[transition] at (1.5,3.3) {} edge [pre] (p3) edge [post] (p4)
+ edge [pre and post] (h1);
+ \node[transition] at (1.5,3.7) {} edge [pre] (p3) edge [pre] (h2)
edge [post] (p4) edge [post] (h1.west);
- \node[transition] at (1.5,4.3) {} edge [pre] (p4) edge [post] (p5)
- edge [pre and post] (m2f);
- \node[transition] at (1.5,4.7) {} edge [pre] (p4) edge [post] (p5)
- edge [pre and post] (h2);
- \node[transition] at (1.5,5.5) {} edge [pre] (p5) edge [pre] (m1t)
+ \node[transition] at (1.5,4.3) {} edge [pre] (p4) edge [post] (p5)
+ edge [pre and post] (m2f);
+ \node[transition] at (1.5,4.7) {} edge [pre] (p4) edge [post] (p5)
+ edge [pre and post] (h2);
+ \node[transition] at (1.5,5.5) {} edge [pre] (p5) edge [pre] (m1t)
edge [post] (p6) edge [post] (m1f);
- \node[transition] at (1.5,6.5) {} edge [pre] (p6) edge [post] (p1.south east);
- \node[transition] at (6.5,1.5) {} edge [pre] (q1) edge [post] (q2);
- \node[transition] at (6.5,2.5) {} edge [pre] (q2) edge [pre] (m2f)
+ \node[transition] at (1.5,6.5) {} edge [pre] (p6) edge [post] (p1.south east);
+ \node[transition] at (6.5,1.5) {} edge [pre] (q1) edge [post] (q2);
+ \node[transition] at (6.5,2.5) {} edge [pre] (q2) edge [pre] (m2f)
edge [post] (q3) edge [post] (m2t);
- \node[transition] at (6.5,3.3) {} edge [pre] (q3) edge [post] (q4)
- edge [pre and post] (h2);
- \node[transition] at (6.5,3.7) {} edge [pre] (q3) edge [pre] (h1)
+ \node[transition] at (6.5,3.3) {} edge [pre] (q3) edge [post] (q4)
+ edge [pre and post] (h2);
+ \node[transition] at (6.5,3.7) {} edge [pre] (q3) edge [pre] (h1)
edge [post] (q4) edge [post] (h2.east);
- \node[transition] at (6.5,4.3) {} edge [pre] (q4) edge [post] (q5)
- edge [pre and post] (m1f);
- \node[transition] at (6.5,4.7) {} edge [pre] (q4) edge [post] (q5)
- edge [pre and post] (h1);
- \node[transition] at (6.5,5.5) {} edge [pre] (q5) edge [pre] (m2t)
+ \node[transition] at (6.5,4.3) {} edge [pre] (q4) edge [post] (q5)
+ edge [pre and post] (m1f);
+ \node[transition] at (6.5,4.7) {} edge [pre] (q4) edge [post] (q5)
+ edge [pre and post] (h1);
+ \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);
+ \node[transition] at (6.5,6.5) {} edge [pre] (q6) edge [post] (q1.south west);
\end{tikzpicture}
+
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
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 127aa229972..cf20bc84760 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
@@ -12,29 +12,29 @@
\label{section-library-plothandlers}
\begin{pgflibrary}{plothandlers}
- This library packages defines additional plot handlers, see
- Section~\ref{section-plot-handlers} for an introduction to plot
- handlers. The additional handlers are described in the following.
+ This library packages defines additional plot handlers, see
+ Section~\ref{section-plot-handlers} for an introduction to plot handlers.
+ The additional handlers are described in the following.
- This library is loaded automatically by \tikzname.
+ This library is loaded automatically by \tikzname.
\end{pgflibrary}
\subsection{Curve Plot Handlers}
-
+
\begin{command}{\pgfplothandlercurveto}
- This handler will issue a |\pgfpathcurveto| command for each point of
- the plot, \emph{except} possibly for the first. As for the line-to
- handler, what happens with the first point can be specified using
- |\pgfsetmovetofirstplotpoint| or |\pgfsetlinetofirstplotpoint|.
-
- Obviously, the |\pgfpathcurveto| command needs, in addition to the
- points on the path, some control points. These are generated
- automatically using a somewhat ``dumb'' algorithm: Suppose you have
- three points $x$, $y$, and $z$ on the curve such that $y$ is between
- $x$ and $z$:
+ This handler will issue a |\pgfpathcurveto| command for each point of the
+ plot, \emph{except} possibly for the first. As for the line-to handler,
+ what happens with the first point can be specified using
+ |\pgfsetmovetofirstplotpoint| or |\pgfsetlinetofirstplotpoint|.
+
+ Obviously, the |\pgfpathcurveto| command needs, in addition to the points
+ on the path, some control points. These are generated automatically using a
+ somewhat ``dumb'' algorithm: Suppose you have three points $x$, $y$, and
+ $z$ on the curve such that $y$ is between $x$ and $z$:
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlercurveto
\pgfplotstreamstart
@@ -46,25 +46,23 @@
\end{tikzpicture}
\end{codeexample}
- In order to determine the control points of the curve at the point
- $y$, the handler computes the vector $z-x$ and scales it by the
- tension factor (see below). Let us call the resulting vector
- $s$. Then $y+s$ and $y-s$ will be the control points around $y$. The
- first control point at the beginning of the curve will be the
- beginning itself, once more; likewise the last control point is the
- end itself.
+ In order to determine the control points of the curve at the point $y$, the
+ handler computes the vector $z-x$ and scales it by the tension factor (see
+ below). Let us call the resulting vector $s$. Then $y+s$ and $y-s$ will be
+ the control points around $y$. The first control point at the beginning of
+ the curve will be the beginning itself, once more; likewise the last
+ control point is the end itself.
\end{command}
\begin{command}{\pgfsetplottension\marg{value}}
- Sets the factor used by the curve plot handlers to determine the
- distance of the control points from the points they control. The
- higher the curvature of the curve points, the higher this value
- should be. A value of $1$ will cause four points at quarter
- positions of a circle to be connected using a circle. The default is
- $0.5$.
-
+ Sets the factor used by the curve plot handlers to determine the distance
+ of the control points from the points they control. The higher the
+ curvature of the curve points, the higher this value should be. A value of
+ $1$ will cause four points at quarter positions of a circle to be connected
+ using a circle. The default is $0.5$.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfsetplottension{0.75}
\pgfplothandlercurveto
@@ -76,15 +74,15 @@
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgfplothandlerclosedcurve}
- This handler works like the curve-to plot handler, only it will
- add a new part to the current path that is a closed curve through
- the plot points.
+ This handler works like the curve-to plot handler, only it will add a new
+ part to the current path that is a closed curve through the plot points.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlerclosedcurve
\pgfplotstreamstart
@@ -95,16 +93,21 @@
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
+
\subsection{Constant Plot Handlers}
-There are several plot handlers which produce piecewise constant interpolations between successive points:
+
+There are several 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.
+ 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}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlerconstantlineto
\pgfplotstreamstart
@@ -115,13 +118,15 @@ There are several plot handlers which produce piecewise constant interpolations
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfplothandlerconstantlinetomarkright}
-A variant of |\pgfplothandlerconstantlineto| which places its mark on
-the right line ends.
+ A variant of |\pgfplothandlerconstantlineto| which places its mark on the
+ right line ends.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlerconstantlinetomarkright
\pgfplotstreamstart
@@ -132,13 +137,15 @@ the right line ends.
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfplothandlerconstantlinetomarkmid}
-A variant of |\pgfplothandlerconstantlineto| which places its mark on
-the center of the line.
+ A variant of |\pgfplothandlerconstantlineto| which places its mark on the
+ center of the line.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlerconstantlinetomarkmid
\pgfplotstreamstart
@@ -149,14 +156,21 @@ the center of the line.
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
- The plot handler always connects two data points by a horizontal line starting from the previous data points, followed by a vertical line in the middle between the two data points, followed by a horizontal line between the middle and the current data point. This results in a symmetric constant plot handler for constant mesh width.
+ %
+ The plot handler always connects two data points by a horizontal line
+ starting from the previous data points, followed by a vertical line in the
+ middle between the two data points, followed by a horizontal line between
+ the middle and the current data point. This results in a symmetric constant
+ plot handler for constant mesh width.
\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.
+ 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}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlerjumpmarkleft
\pgfplotstreamstart
@@ -167,13 +181,16 @@ the center of the line.
\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.
+ 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}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlerjumpmarkright
\pgfplotstreamstart
@@ -184,13 +201,17 @@ the center of the line.
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfplothandlerjumpmarkmid}
- This handler works like the |\pgfplothandlerconstantlinetomarkmid|, but it will
- produce a non-connected, piecewise constant path to connect the points. If there are any plot marks, they will be placed in the center of the horizontal line segment..
+ This handler works like the |\pgfplothandlerconstantlinetomarkmid|, but it
+ will produce a non-connected, piecewise constant path to connect the
+ points. If there are any plot marks, they will be placed in the center of
+ the horizontal line segment..
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlerjumpmarkmid
\pgfplotstreamstart
@@ -201,22 +222,22 @@ the center of the line.
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
- See |\pgfplothandlerconstantlinetomarkmid| for details.
+ %
+ See |\pgfplothandlerconstantlinetomarkmid| for details.
\end{command}
+
\subsection{Comb Plot Handlers}
-There are three ``comb'' plot handlers. Their name stems from the fact
-that the plots they produce look like ``combs'' (more or less).
+There are three ``comb'' plot handlers. Their name stems from the fact that the
+plots they produce look like ``combs'' (more or less).
\begin{command}{\pgfplothandlerxcomb}
- This handler converts each point in the plot stream into a line from
- the $y$-axis to the point's coordinate, resulting in a ``horizontal
- comb.''
-
-
+ This handler converts each point in the plot stream into a line from the
+ $y$-axis to the point's coordinate, resulting in a ``horizontal comb''.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlerxcomb
\pgfplotstreamstart
@@ -227,17 +248,17 @@ that the plots they produce look like ``combs'' (more or less).
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgfplothandlerycomb}
- This handler converts each point in the plot stream into a line from
- the $x$-axis to the point's coordinate, resulting in a ``vertical
- comb.''
-
- This handler is useful for creating ``bar diagrams.''
+ This handler converts each point in the plot stream into a line from the
+ $x$-axis to the point's coordinate, resulting in a ``vertical comb''.
+
+ This handler is useful for creating ``bar diagrams''.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlerycomb
\pgfplotstreamstart
@@ -248,14 +269,15 @@ that the plots they produce look like ``combs'' (more or less).
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfplothandlerpolarcomb}
- This handler converts each point in the plot stream into a line from
- the origin to the point's coordinate.
-
+ This handler converts each point in the plot stream into a line from the
+ origin to the point's coordinate.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlerpolarcomb
\pgfplotstreamstart
@@ -266,17 +288,17 @@ that the plots they produce look like ``combs'' (more or less).
\pgfusepath{stroke}
\end{tikzpicture}
\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.
+\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
@@ -290,36 +312,36 @@ returns ``zeros'' for coordinate~$y$. They are used as follows.
\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.
+ This zero level stream always returns \marg{dimension} instead of $x=0$pt.
- It is used for |xcomb| and |xbar|.
+ 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.
+ This zero level stream always returns \marg{dimension} instead of $y=0$pt.
- It is used for |ycomb| and |ybar|.
+ 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).
+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.
-
+ 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}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlerybar
\pgfplotstreamstart
@@ -330,15 +352,16 @@ bars (or pattern bars).
\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.
-
+ 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}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlerxbar
\pgfplotstreamstart
@@ -349,39 +372,39 @@ bars (or pattern bars).
\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.
+\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.
+\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|.
+ 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.
-
+ 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}
+\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
@@ -394,48 +417,53 @@ bars (or pattern bars).
\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.
+ 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.
+ 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{factor} (initially 0.5)}
- \keyalias{tikz}
- Sets the \emph{relative} shift of |\pgfplothandlerxbarinterval| and
- |\pgfplothandlerybarinterval| to \meta{factor}. 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.
+\keyalias{tikz}
+ Sets the \emph{relative} shift of |\pgfplothandlerxbarinterval| and
+ |\pgfplothandlerybarinterval| to \meta{factor}. 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.
+\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)
+\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);
@@ -460,25 +488,27 @@ interval). The $y$~value of the last point will be ignored.
\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$.
+ %
+ 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{Gapped Plot Handlers}
+\subsection{Gapped Plot Handlers}
\label{section-plot-gapped}
-
\begin{command}{\pgfplothandlergaplineto}
- This handler will connect the points of the plots by straight line
- segments. However, at the start and the end of the lines there will
- be a small gap, given by the following key:
- \begin{key}{/pgf/gap around stream point=\meta{dimension} (initially 1.5pt)}
- The \meta{dimension} by which the lines between consecutive stream
- points are shortened at the beginning and end.
- \end{key}
+ This handler will connect the points of the plots by straight line
+ segments. However, at the start and the end of the lines there will be a
+ small gap, given by the following key:
+ %
+ \begin{key}{/pgf/gap around stream point=\meta{dimension} (initially 1.5pt)}
+ The \meta{dimension} by which the lines between consecutive stream
+ points are shortened at the beginning and end.
+ \end{key}
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\pgfplothandlergaplineto
\pgfplotstreamstart
\pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
@@ -488,14 +518,15 @@ interval). The $y$~value of the last point will be ignored.
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgfplothandlergapcycle}
- Works like |\pgfplothandlergaplineto|, but the last point is
- connected to the first in the same fashion:
+ Works like |\pgfplothandlergaplineto|, but the last point is connected to
+ the first in the same fashion:
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\pgfplothandlergapcycle
\pgfplotstreamstart
\pgfplotstreampoint{\pgfpoint{0cm}{0cm}}
@@ -505,27 +536,27 @@ interval). The $y$~value of the last point will be ignored.
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-\subsection{Mark Plot Handler}
+\subsection{Mark Plot Handler}
\label{section-plot-marks}
\begin{command}{\pgfplothandlermark\marg{mark code}}
- This command will execute the \meta{mark code} for some points of the
- plot, but each time the coordinate transformation matrix will be
- set up such that the origin is at the position of the point to be
- plotted. This way, if the \meta{mark code} draws a little circle
- around the origin, little circles will be drawn at some point of the
- plot.
-
- By default, a mark is drawn at all points of the plot. However, two
- parameters $r$ and $p$ influence this. First, only every $r$th mark
- is drawn. Second, the first mark drawn is the $p$th. These
- parameters can be influenced using the commands below.
-
+ This command will execute the \meta{mark code} for some points of the plot,
+ but each time the coordinate transformation matrix will be set up such that
+ the origin is at the position of the point to be plotted. This way, if the
+ \meta{mark code} draws a little circle around the origin, little circles
+ will be drawn at some point of the plot.
+
+ By default, a mark is drawn at all points of the plot. However, two
+ parameters $r$ and $p$ influence this. First, only every $r$th mark is
+ drawn. Second, the first mark drawn is the $p$th. These parameters can be
+ influenced using the commands below.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlermark{\pgfpathcircle{\pgfpointorigin}{4pt}\pgfusepath{stroke}}
\pgfplotstreamstart
@@ -537,32 +568,31 @@ interval). The $y$~value of the last point will be ignored.
\end{tikzpicture}
\end{codeexample}
- Typically, the \meta{code} will be |\pgfuseplotmark{|\meta{plot mark
- name}|}|, where \meta{plot mark name} is the name of a
- predefined plot mark.
+ Typically, the \meta{code} will be |\pgfuseplotmark{|\meta{plot mark
+ name}|}|, where \meta{plot mark name} is the name of a predefined plot
+ mark.
\end{command}
\begin{command}{\pgfsetplotmarkrepeat\marg{repeat}}
- Sets the $r$ parameter to \meta{repeat}, that is, only every $r$th
- mark will be drawn.
+ Sets the $r$ parameter to \meta{repeat}, that is, only every $r$th mark
+ will be drawn.
\end{command}
\begin{command}{\pgfsetplotmarkphase\marg{phase}}
- Sets the $p$ parameter to \meta{phase}, that is, the first mark to
- be drawn is the $p$th, followed by the $(p+r)$th, then the
- $(p+2r)$th, and so on.
+ Sets the $p$ parameter to \meta{phase}, that is, the first mark to be drawn
+ is the $p$th, followed by the $(p+r)$th, then the $(p+2r)$th, and so on.
\end{command}
\begin{command}{\pgfplothandlermarklisted\marg{mark code}\marg{index list}}
- This command works similar to the previous one. However, marks will
- only be placed at those indices in the given \meta{index list}. The
- syntax for the list is the same as for the |\foreach| statement. For
- example, if you provide the list |1,3,...,25|, a mark will be placed
- only at every second point. Similarly, |1,2,4,8,16,32| yields marks
- only at those points that are powers of two.
-
+ This command works similar to the previous one. However, marks will only be
+ placed at those indices in the given \meta{index list}. The syntax for the
+ list is the same as for the |\foreach| statement. For example, if you
+ provide the list |1,3,...,25|, a mark will be placed only at every second
+ point. Similarly, |1,2,4,8,16,32| yields marks only at those points that
+ are powers of two.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlermarklisted
{\pgfpathcircle{\pgfpointorigin}{4pt}\pgfusepath{stroke}}
@@ -575,15 +605,15 @@ interval). The $y$~value of the last point will be ignored.
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfuseplotmark\marg{plot mark name}}
- Draws the given \meta{plot mark name} at the origin. The \meta{plot
- mark name} must have been previously declared using
- |\pgfdeclareplotmark|.
-
+ Draws the given \meta{plot mark name} at the origin. The \meta{plot mark
+ name} must have been previously declared using |\pgfdeclareplotmark|.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlermark{\pgfuseplotmark{pentagon}}
\pgfplotstreamstart
@@ -594,16 +624,16 @@ interval). The $y$~value of the last point will be ignored.
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfdeclareplotmark\marg{plot mark name}\marg{code}}
- Declares a plot mark for later used with the |\pgfuseplotmark|
- command.
-
+ Declares a plot mark for later used with the |\pgfuseplotmark| command.
+ %
\begin{codeexample}[]
\pgfdeclareplotmark{my plot mark}
- {\pgfpathcircle{\pgfpoint{0cm}{1ex}}{1ex}\pgfusepathqstroke}
-\begin{tikzpicture}
+ {\pgfpathcircle{\pgfpoint{0cm}{1ex}}{1ex}\pgfusepathqstroke}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfplothandlermark{\pgfuseplotmark{my plot mark}}
\pgfplotstreamstart
@@ -614,21 +644,21 @@ interval). The $y$~value of the last point will be ignored.
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgfsetplotmarksize\marg{dimension}}
- This command sets the \TeX\ dimension |\pgfplotmarksize| to
- \meta{dimension}. This dimension is a ``recommendation'' for plot
- mark code at which size the plot mark should be drawn; plot mark
- code may choose to ignore this \meta{dimension} altogether. For
- circles, \meta{dimension} should be the radius, for other shapes it
- should be about half the width/height.
-
- The predefined plot marks all take this dimension into account.
-
+ This command sets the \TeX\ dimension |\pgfplotmarksize| to
+ \meta{dimension}. This dimension is a ``recommendation'' for plot mark code
+ at which size the plot mark should be drawn; plot mark code may choose to
+ ignore this \meta{dimension} altogether. For circles, \meta{dimension}
+ should be the radius, for other shapes it should be about half the
+ width/height.
+
+ The predefined plot marks all take this dimension into account.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
+\begin{tikzpicture}
\draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z};
\pgfsetplotmarksize{1ex}
\pgfplothandlermark{\pgfuseplotmark{*}}
@@ -640,25 +670,25 @@ interval). The $y$~value of the last point will be ignored.
\pgfusepath{stroke}
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{textoken}{\pgfplotmarksize}
- A \TeX\ dimension that is a ``recommendation'' for the size of plot
- marks.
+ A \TeX\ dimension that is a ``recommendation'' for the size of plot marks.
\end{textoken}
-The following plot marks are predefined (the filling color has been
-set to yellow):
+The following plot marks are predefined (the filling color has been set to
+yellow):
\medskip
\begin{tabular}{lc}
- \plotmarkentry{*}
- \plotmarkentry{x}
- \plotmarkentry{+}
+ \plotmarkentry{*}
+ \plotmarkentry{x}
+ \plotmarkentry{+}
\end{tabular}
-%%% 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-marks.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-plot-marks.tex
index 8dbef923854..5abc0ff16fe 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
@@ -11,86 +11,100 @@
\section{Plot Mark Library}
\begin{pgflibrary}{plotmarks}
- This library defines a number of plot marks.
+ This library defines a number of plot marks.
\end{pgflibrary}
-This library defines the following plot marks in
-addition to |*|, |x|, and |+| (the filling color has been set to a
-dark yellow):
+This library defines the following plot marks in addition to |*|, |x|, and |+|
+(the filling color has been set to a dark yellow):
{
\catcode`\|=12
\medskip
\begin{tabular}{lc}
- \plotmarkentry{-}
- \index{*vbar@\protect\texttt{\protect\myvbar} plot mark}%
- \index{Plot marks!*vbar@\protect\texttt{\protect\myvbar}}
- \texttt{\char`\\pgfuseplotmark\char`\{\declare{|}\char`\}} &
- \tikz\draw[color=black!25] plot[mark=|,mark options={fill=yellow,draw=black}]
- coordinates {(0,0) (.5,0.2) (1,0) (1.5,0.2)};\\
- \plotmarkentry{o}
- \plotmarkentry{asterisk}
- \plotmarkentry{star}
- \plotmarkentry{10-pointed star}
- \plotmarkentry{oplus}
- \plotmarkentry{oplus*}
- \plotmarkentry{otimes}
- \plotmarkentry{otimes*}
- \plotmarkentry{square}
- \plotmarkentry{square*}
- \plotmarkentry{triangle}
- \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}
+ \plotmarkentry{-}
+ \index{*vbar@\protect\texttt{\protect\myvbar} plot mark}%
+ \index{Plot marks!*vbar@\protect\texttt{\protect\myvbar}}
+ %
+ \texttt{\char`\\pgfuseplotmark\char`\{\declare{|}\char`\}} &
+ \tikz\draw [color=black!25] plot [
+ mark=|,mark options={fill=yellow,draw=black}
+ ] coordinates {(0,0) (.5,0.2) (1,0) (1.5,0.2)};\\
+ \plotmarkentry{o}
+ \plotmarkentry{asterisk}
+ \plotmarkentry{star}
+ \plotmarkentry{10-pointed star}
+ \plotmarkentry{oplus}
+ \plotmarkentry{oplus*}
+ \plotmarkentry{otimes}
+ \plotmarkentry{otimes*}
+ \plotmarkentry{square}
+ \plotmarkentry{square*}
+ \plotmarkentry{triangle}
+ \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}|.
+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}|.
\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.
+ 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|.
+ Changes the text shown by |mark=text|.
- With |/pgf/text mark=m|: \pgfkeys{/pgf/text mark=m}\showit{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}
+ 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.
+ 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 as node=\marg{boolean} (initially false)}
- Configures how |mark=text| will be drawn: either as |\node| or as |\pgftext|.
+ 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.
+ The first choice is highly flexible and possibly slow, the second is very
+ fast and usually enough.
\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|.
+ 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=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.
+ 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}
}
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
index 9bc9b6fd57f..2e5d0b0186c 100644
--- 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
@@ -7,148 +7,236 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Profiler Library}
-{\noindent {\emph{by Christian Feuers\"anger}}}
+
+{\noindent {\emph{by Christian Feuersänger}}}
\begin{pgflibrary}{profiler}
- A library to simplify the optimization of runtime speed of \TeX\ programs.
+ A library to simplify the optimization of runtime speed of \TeX\ programs.
- It relies on the |pdftex| primitive
- \declareandlabel{\pdfelapsedtime}\footnote{The primitive is
- emulated in lua\TeX.} to count (fractional) seconds and counts total time and self time for macro invocations.
+ It relies on the |pdftex| primitive
+ \declareandlabel{\pdfelapsedtime}\footnote{The primitive is emulated in
+ lua\TeX.} 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
+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.
+%
+\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, tikz syntax=false]
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:
+%
+\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, tikz syntax=false]
-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
+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 exciting: 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|.
+%
+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 exciting: 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 works with |pdftex| and |luatex|. Furthermore, it requires
-a more or less recent version of |pdftex| which supports the |\pdfelapsedtime| directive.
+
+The library works with |pdftex| and |luatex|. Furthermore, it requires a more
+or less recent version of |pdftex| 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.
+
+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}.
+ 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.
+ 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}.
+ 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.
+ 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.
+ 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:
+ 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}}
+\pgfprofilenewforcommandpattern{\mymacro}{#1\to#2\in#3}{{#1}\to{#2}\in{#3}}
\end{codeexample}
-Note that |\pgfprofilenewforcommand| is a special case of |\pgfprofilenewforcommandpattern|:
+ 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}}
+\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.
+ %
+ 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}.
+ 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 all given arguments.
+ This is only available for profiler entries for commands (those created by
+ |\pgfprofilenewforcommand| for example). It will also show all given
+ 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.
+ 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.
+ 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.
-
+ 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|.
+ 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.
+ 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.
+ 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|.
+ 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}|.
+ 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.
+ 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.
+ 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-rdf.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-rdf.tex
new file mode 100644
index 00000000000..d972c80c5ae
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-rdf.tex
@@ -0,0 +1,1040 @@
+% Copyright 2016 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{Resource Description Framework Library}
+\label{section-library-rdf}
+\label{section-tikz-rdf}
+
+With \todosp{why two labels? Both don't seem to be used.} certain output
+formats (in particular, with \textsc{svg}), \tikzname\ can add \emph{semantic
+annotations} to an output file. Consider as an example the drawing of a finite
+automaton. In your \TeX\ code, you might have a nice description of the
+automaton like the following:
+%
+\begin{codeexample}[code only]
+\tikz[automaton] \graph { a[state, initial] ->[transition] b [state] ->[transition] c[state, final] };
+\end{codeexample}
+%
+This description of the automaton carries a lot of ``semantic information''
+like the information that the node |a| is not just some node, but actually the
+initial state of the automaton, while |c| is a final state. Unfortunately, in
+the output produced \tikzname, this information is normally ``lost'': In the
+output, |a| is only a short text, possibly with a circle drawn around it; but
+there is no information that \emph{this} text and \emph{this} circle together
+form the state of an automaton.
+
+As a human (more precisely, as a computer scientist), you might ``see'' that
+the text and the circle form a state, but most software will have a very hard
+time retrieving this semantic information from the output. In particular, it is
+more or less impossible to design a search engine that you can query to find,
+say, ``all automata with three states'' in a document.
+
+This is the point were \emph{semantic annotations} come in. These are small
+labels or ``hints'' in the \emph{output} that tell you (and, more importantly,
+a program) that the text and the circle together form a state of an automaton.
+There is a standard for specifying such annotations (``resource description
+framework annotations'', abbreviated \textsc{rdf}a) and \tikzname\ provides a
+way of adding such annotations to an output file using the |rdf engine| key,
+explained in a moment. Note, however, that the output format must support such
+annotations; currently \tikzname\ only supports \textsc{svg}.
+
+
+\subsection{Starting the RDF Engine}
+
+\begin{tikzlibrary}{rdf}
+ You need to load this library for the keys described in the following.
+ However, even when this library is loaded, \textsc{rdf} information is only
+ written to the output inside scopes where the following key is set:
+ %
+ \begin{key}{/tikz/rdf engine on}
+ Switches ``on'' the generation of \textsc{rdf} information for the
+ current \TeX\ scope. The idea is that libraries can internally use the
+ |rdf engine| key (explained below) a lot in order to provide good
+ semantic information in the output when desired, but need not worry
+ that this will bloat output files since users have to use this key
+ explicitly to include semantic information in the output.
+ \end{key}
+\end{tikzlibrary}
+
+\begin{key}{/tikz/rdf engine=\meta{rdf keys}}
+ This key only has an effect when |rdf engine on| is called, otherwise the
+ argument is silently ignored. The \meta{rdf keys} get executed with the
+ path prefix |/tikz/rdf engine| at the beginning of the current scope (for a
+ node, at the beginning of the node's scope). Depending on which keys are
+ used, semantic information gets to be added to the output.
+
+ Note that you cannot simply the keys with path prefix |/tikz/rdf engine|
+ directly since they need to be executed at very specific times during
+ \tikzname's processing of scopes. Always call those keys via this key.
+\end{key}
+
+The following key is useful for generally setting the prefix for a larger
+number of annotations:
+
+\begin{key}{/tikz/rdf engine/prefix=\meta{prefix: iri}}
+ Inside the current scope, you can use \meta{prefix}|:| inside curies
+ (compact universal resource identifier expressions, see the \textsc{rdfa}
+ specification) as an abbreviation for the \meta{iri}. (It has the same
+ effect as the |prefix| attribute in \textsc{rdf}a.) You can use this key
+ several times for a given scope.
+ %
+\begin{codeexample}[code only]
+\scoped [rdf engine = {
+ prefix = {rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns\tikzrdfhashmark},
+ prefix = {automata: http://www.tcs.uni-luebeck.de/ontologies/2016/04/28/automata/},
+ statement = { ..., predicate = rdf:type, object = automata:state },
+ statement = { ..., predicate = rdf:type, object = automata:final },
+ }] ...
+\end{codeexample}
+ %
+ The above could also be written more verbosely as
+ %
+\begin{codeexample}[code only]
+\scoped [rdf engine = {
+ statement = { ...,
+ predicate = http://www.w3.org/1999/02/22-rdf-syntax-ns\tikzrdfhashmark type,
+ object = http://www.tcs.uni-luebeck.de/ontologies/2016/04/28/automata/state }
+ },
+ statement = { ...,
+ predicate = http://www.w3.org/1999/02/22-rdf-syntax-ns\tikzrdfhashmark type,
+ object = http://www.tcs.uni-luebeck.de/ontologies/2016/04/28/automata/final }
+ }] ...
+\end{codeexample}
+
+ The use of the command |\tikzrdfhashmark| is necessary since \TeX\ assigns
+ a special meaning to hash marks. The command simple expands to a ``normal''
+ hash mark for use in texts.
+ %
+ \begin{command}{\tikzrdfhashmark}
+ Expands to |#| with catcode 11.
+ \end{command}
+\end{key}
+
+
+\subsection{Creating Statements}
+
+\tikzname's method of adding semantic information to an output is based on the
+principles underlying the \emph{resource description framework} (\textsc{rdf}).
+In this framework, all semantic information is encoded using a large graph
+consisting of nodes and connecting directed edges, but the nodes are called
+\emph{resources} and the edges are called \emph{statements}. A resource is
+identified by an \textsc{iri}, an \emph{internationalized resource identifier,}
+which basically looks like the well-known \textsc{url}s, but allows additional
+Unicode characters. Note that these \textsc{iri}s do not need to point to
+``real'' webpages, they are just a way of conceptually identifying resources
+uniquely and permanently. Similarly, each edge (statement) of the \textsc{rdf}
+graph has such an \textsc{iri} attached to it, which identifies the ``flavour''
+of the arc.
+
+In a ``mathematical'' graph, each edge has a ``tail'' and a ``head'' vertex and
+a label, but in the context of the resource description framework these notions
+are called differently: As mentioned before, an edge is called a
+\emph{statement}, the tail of this edge is called the \emph{subject}, the head
+is called the \emph{object} (in the linguistic sense), and the label is called
+the \emph{predicate}. Thus, a statement is -- quite fittingly -- a triple
+``subject predicate object''.
+
+Note that in the \textsc{rdf} framework \emph{all} semantic information must be
+encoded using statements of this fixed kind. Many semantic notions are easy to
+store in this way such as ``Albert Einstein was a physicist'' (``Albert
+Einstein'' is the subject, ``was'' is the predicate, ``a physicist'' is the
+object), but other notions do not fit well like ``The automaton has states
+$q_1$, $q_2$, $q_a$, and $q_b$'' since there are several objects in the
+statement. Nevertheless, all information must be encoded as simple statements
+with a single subject, a single predicate, and a single object.
+
+You add an \textsc{rdf} statement to the output file using the following key:
+
+\begin{key}{/tikz/rdf engine/statement=\marg{options}}
+ Each use of this key will add one \textsc{rdf} statement to the output
+ file. The \meta{options} will be executed with the path prefix
+ |/tikz/rdf engine/statements| and must use the three keys |subject|,
+ |predicate|, and |object| to specify the three components of the statement
+ (these keys can, however, be called by styles internally, so not all
+ statements will explicitly set these three keys). Note that \emph{all three
+ must always be set}, it is \emph{not} possible to setup, say, just a
+ subject for a scope and then omit the subject for statements inside the
+ scope. (However, using styles you can setup things in such a way that a
+ certain subject is used for several statements.)
+ %
+\begin{codeexample}[code only]
+\tikz [rdf engine = {
+ statement = {
+ subject = http://www.example.org/persons/Einstein,
+ predicate = http://www.example.org/predicates/isA,
+ object = http://www.example.org/professions/physicist
+ },
+ statement = {
+ subject = http://www.example.org/persons/Curie,
+ predicate = http://www.example.org/predicates/isA,
+ object = http://www.example.org/professions/physicist
+ }}] { ... }
+\end{codeexample}
+
+ The statements are normally added at the beginning of the scope where the
+ |rdf enging| command is used (except when the |object| is |scope content|,
+ which is explained later). This means that when you use |prefix| inside an
+ |rdf engine| command, it will apply to all statements, regardless of the
+ order.
+
+ \begin{key}{/tikz/rdf engine/statements/subject=\meta{subject}}
+ Sets the subject of the to-be-created statement. The \meta{subject} can
+ be in one of two possible formats:
+ %
+ \begin{enumerate}
+ \item A curie (a \emph{compact universal resource identifier
+ expression,} see the \textsc{rdfa} specification for details).
+ Examples are standard \textsc{url}s like
+ |http://www.example.org|, but also text like |#my_automaton|.
+ Note that in order to include a hashmark in a curie you should
+ use the command |\tikzrdfhashmark|, which expands to a hash
+ mark (\TeX\ treats hash marks in a special way, which is why
+ this command is used here).
+ \item When the \meta{subject} starts with an opening parenthesis,
+ that is, with ``|(|'', the \meta{subject} must have the form
+ |(|\meta{node or scope name}|)|. In this case, the \meta{node
+ or scope name} must be the name of an already existing node
+ (the current node or scope is considered as ``existing'' here).
+ Then, the curie |#|\meta{id} is used as subject, where the
+ \meta{id} is a unique internal identifier for the node.
+
+ As an example, suppose you wish to specify that a node has some
+ other node as child, you could write the following:
+ %
+\begin{codeexample}[code only]
+\tikz [ rdf engine = { prefix = { rels: http://www.example.org/relations/} } ] {
+ \node (fritz) { Fritz };
+ \node (heinz) at (2,0) { Heinz };
+ \draw [->] (fritz) -- (heinz)
+ [rdf engine = {
+ statement = {
+ subject = (fritz),
+ predicate = rels:isSonOf,
+ object = (heinz)
+ } } ];
+}
+\end{codeexample}
+ \end{enumerate}
+ %
+ You can use a macro as \meta{subject}, it will be expanded before the
+ above syntax check is done.
+
+ If you use the |subject| key several times inside a single |statement|
+ command, (only) the last subject is used.
+ \end{key}
+
+ \begin{key}{/tikz/rdf engine/statements/predicate=\meta{predicate}}
+ Sets the predicate for the statement. The syntax is exactly the same as
+ for the subject. Unlike for subjects, you can use the predicate key
+ several times inside a single statement and the uses will
+ ``accumulate'' and several statements are created, namely one statement
+ for each use of |predicate| for the subject and object specified inside
+ the use of |statement|. This behavior is not very systematic (it
+ violates the rule ``one statement per |statement|'') and you should
+ normally use the |statement| once for each use of the |predicate|
+ key. However, in conjunction with the object |scope content| it is
+ necessary to allow this behavior.
+ \end{key}
+
+ \begin{key}{/tikz/rdf engine/statements/object=\meta{object}}
+ Sets the object for the statement. The syntax allowed for the
+ \meta{object} is as follows:
+ %
+ \begin{enumerate}
+ \item As for |subject| and |predicate| you can use a curie here.
+ This is the default unless one of the following special cases
+ is used:
+ \item As for |subject| and |predicate|, you can use the syntax
+ |(|\meta{name of node or scope}|)| to create and use a curie
+ for the node or scope.
+ \item If the \meta{object} starts with |"|, it must have the syntax
+ |"|\meta{literals}|"|. In this case, the object of the
+ statement is not a curie (not a normal ``resource'') but the
+ string of \meta{literals} given.
+ \item If the \meta{object} is the text ``|scope content|'', the
+ object of the statement is actually the whole contents of the
+ scope to which this statement is attached.
+ \item The two previous cases can be combined in the form of an
+ object of the form |"|\meta{literals}|" and scope content|. In
+ this case, the contents of the scope is ``normally'' the
+ object, but this gets ``overruled'' by the \meta{literals}.
+ Formally, this means that the object is the \meta{literals},
+ but the intended semantics is that the object is the scope
+ content, only for further processing it should be considered to
+ be \meta{literals}. A typical example is the case where the
+ scope content is, say, the text ``January 1st, 2000'' but the
+ \meta{literals} are set to |2000-01-01|, which is easier for
+ software to process:
+ %
+\begin{codeexample}[code only]
+\node [rdf engine = {
+ statement = {
+ subject = ...,
+ predicate = dc:Date,
+ object = "2000-01-01" and scope content
+ } } ] { January 1st, 2000 };
+\end{codeexample}
+ \end{enumerate}
+ %
+ For the last two cases, only one statement may be given per scope that
+ has the |scope content| as its object; if more than one is given, the
+ last one wins. This is the reason why several uses of |predicate| are
+ allowed in a |statement|.
+ \end{key}
+
+ \begin{key}{/tikz/rdf engine/statements/has type=\meta{type}}
+ This style is a shorthand for |predicate=rdf:type| and
+ |object=|\meta{type}.
+ \end{key}
+\end{key}
+
+
+\subsection{Creating Resources}
+
+In \textsc{rdf} statements, when you can use the name of a \tikzname\ scope or
+node surrounded by parenthesis, a curie is inserted into the output that
+references this scope or node. While this makes it easy to describe
+relationships between existing nodes, in library code (\textsc{rdf} generation
+code added to library styles and gets executed as a ``byproduct'') there are
+two situations where this method is insufficient:
+%
+\begin{enumerate}
+ \item You may sometimes wish to create additional resources in the
+ \textsc{rdf} graph that are not represented by any concrete node or
+ scope in the \tikzname\ picture. For instance, a finite automaton has a
+ set of states and a set of transitions, but neither of these
+ ``containers'' has any concrete representation in the output. One
+ could, of course, create ``dummy scopes'' for this purpose, but this is
+ rather hard to do inside styles of a library.
+ \item You may not know the name of the current scope in library code. For
+ instance, a style like |state|, which can be added to a node to
+ indicate that the node is supposed to be a state in a finite automaton,
+ might contain something like the following code:
+ %
+\begin{codeexample}[code only]
+state/.style = {
+ draw, circle, minimum size = ...,
+ rdf engine = {
+ subject = ???,
+ predicate = rdf:type,
+ object = automata:state
+ }
+}
+\end{codeexample}
+ %
+ The problem is, of course, what should be passed to the |subject|. We
+ cannot even write something like |(\tikz@fig@name)| since no name may
+ have been set for the state.
+\end{enumerate}
+
+Each of the above problems is solved by a special keys:
+
+\begin{key}{/tikz/rdf engine/get new resource curie=\meta{macro}}
+ The \meta{macro} will be set to a new unique curie that can be used
+ anywhere where a curie is allowed. Here is an example how we can add a
+ state and a transition container to an automaton, both of which have no
+ corresponding scope in \tikzname.
+ %
+\begin{codeexample}[code only]
+\tikz [ name = my automaton,
+ rdf engine = {
+ get new resource curie = \statecurie,
+ get new resource curie = \transitiocurie,
+ statement = {
+ subject = (my automaton),
+ predicate = automata:hasStateSet,
+ object = \statecurie },
+ statement = {
+ subject = \statecurie,
+ hat type = automata:stateSet },
+ statement = {
+ subject = (my automaton),
+ predicate = automata:hasTransitionSet,
+ object = \transitiocurie },
+ statement = {
+ subject = \transitiocurie,
+ hat type = automata:transitionSet } } ] { ... }
+\end{codeexample}
+ %
+ The \meta{macro} will be valid for the whole scope.
+\end{key}
+
+\begin{key}{/tikz/rdf engine/get scope curie=\meta{macro}}
+ The \meta{macro} will be set to a unique curie that represents the scope or
+ node. If the scope is named (using the |name| key or the special
+ parenthesis syntax for nodes) and this name is later referenced in another
+ statement, the same curie will be generated. Note how in the following code
+ no name is given for the automaton, which means that the whole \textsc{rdf}
+ code could be moved inside a style like |finite automaton| or something
+ similar.
+ %
+\begin{codeexample}[code only]
+\tikz [ rdf engine = {
+ get new resource curie = \statecurie,
+ get new resource curie = \transitiocurie,
+ get scope curie = \automatoncurie,
+ statement = {
+ subject = \automatoncurie,
+ predicate = automata:hasStateSet,
+ object = \statecurie },
+ statement = {
+ subject = \statecurie,
+ hat type = automata:stateSet },
+ statement = {
+ subject = \automatoncurie,
+ predicate = automata:hasTransitionSet,
+ object = \transitiocurie },
+ statement = {
+ subject = \transitiocurie,
+ hat type = automata:transitionSet } } ] { ... }
+\end{codeexample}
+ %
+ The \meta{macro} will be valid for the whole scope.
+\end{key}
+
+The following key builds on the above keys:
+%
+\begin{key}{/tikz/rdf engine/scope is new context}
+ This key executes |get scope curie=\tikzrdfcontext|, thereby setting the
+ macro |\tikzrdfcontext| to the current scope. The idea is the key is used
+ with ``major resources'' and that keys can use this macro as the |subject|
+ of statements if no subject is given explicitly. For instance, a |title|
+ key might be defined as follows:
+ %
+\begin{codeexample}[code only]
+title/.style = {
+ rdf engine = { statement = {
+ subject = \tikzrdfcontext,
+ predicate = dc:Title,
+ object = "#1"
+} } }
+\end{codeexample}
+ %
+\end{key}
+
+
+\subsection{Creating Containers}
+
+A \emph{container} is a resource that represents a set or a sequence of
+elements. In \textsc{rdf} this is modeled by having a statement say that the
+type of the resource is something special like |rdf:Seq| and then for each
+member resource of the container add a statement saying that the container has
+as its $i$th member the member resource. Here is an example of a container
+with two elements:
+%
+\begin{codeexample}[code only]
+\tikz {
+ \node (safe) { Safe }
+ child { node (coins) {Coins} }
+ child { node (gold) {Gold} };
+
+ \scoped [rdf engine = {
+ statement = {
+ subject = (safe),
+ has type = rdf:Seq
+ },
+ statement = {
+ subject = (safe),
+ predicate = rdf:_1,
+ object = (coins)
+ },
+ statement = {
+ subject = (safe),
+ predicate = rdf:_2,
+ object = (gold)
+ } }];
+}
+\end{codeexample}
+
+However, the above code is error-prone and does not integrate well with styles
+and libraries. For this reason, \tikzname\ offers some styles that may help in
+creating containers:
+
+\begin{key}{/tikz/rdf engine/statements/is a container}
+ Add this key to a statement in order to tell \tikzname\ that it should
+ setup a special counter for the subject of the statement that keeps track
+ of the container's children.
+\end{key}
+
+\begin{key}{/tikz/rdf engine/statements/has as member}
+ This key may only be added to statements whose subject was previously used
+ as a subject in a statement containing the |is a container| key. In this
+ case, the internal counter will be increased and the predicate will be set
+ to |rdf:_|\meta{count}. This means that we can write the above code as:
+ %
+\begin{codeexample}[code only]
+\tikz { ...
+
+ \scoped [rdf engine = {
+ statement = {
+ subject = (safe),
+ has type = rdf:Seq,
+ is a container,
+ },
+ statement = {
+ subject = (safe),
+ has as member,
+ object = (coins)
+ },
+ statement = {
+ subject = (safe),
+ has as member,
+ object = (gold)
+ } }];
+}
+\end{codeexample}
+ %
+\end{key}
+
+\begin{key}{/tikz/rdf engine/statements/is a sequence}
+ This is a shorthand for |predicate = rdf:Seq, is a container|. In the above
+ example we could say:
+ %
+\begin{codeexample}[code only]
+\tikz { ...
+
+ \scoped [rdf engine = {
+ statement = {
+ subject = (safe),
+ is a sequence
+ },
+ ... } ]; }
+\end{codeexample}
+ %
+\end{key}
+
+\begin{key}{/tikz/rdf engine/statements/is a bag}
+ This is a shorthand for |predicate = rdf:Bag, is a container|.
+\end{key}
+
+\begin{key}{/tikz/rdf engine/statements/is an alternative}
+ This is a shorthand for |predicate = rdf:Alt, is a container|.
+\end{key}
+
+
+\subsection{Creating Semantic Information Inside Styles and Libraries}
+
+\begingroup
+
+The \textsc{rdf} library was designed in such a way that normal document
+authors do not need to use the keys of the library explicitly, except possibly
+for saying |rdf engine on| somewhere at the beginning. Instead, library authors
+should include the necessary commands to generate \textsc{rdf} information that
+is then automatically included in the output. Furthermore, if the author does
+not ``switch on'' the generation of \textsc{rdf} information, all uses of
+|rdf engine| will simply be ignored silently and neither the speed of
+compilation nor the size of the generated files is impacted.
+
+
+\subsubsection{An Example Library for Drawing Finite Automata}
+
+In the following, we have a look at how a library might be augmented by
+\textsc{rdf} generation keys. The library we augment is a (fictitious) library
+for drawing finite automata. The library offers the following styles:
+%
+\begin{enumerate}
+ \item |dfa| and |nfa| can be added to a scope to indicate that the scope
+ contains a deterministic or a nondeterministic finite automaton.
+ \item |state| can be added to a node to indicate that the node is a state
+ in the automaton.
+ \item |initial| and |final| are used to indicate that a state is an initial
+ or final state, which should be rendered in a special way.
+ \item |transition| can be added to an edge to indicate that there is a
+ transition in the automaton from the first state to the second state.
+ The style takes a parameter which is the symbol read by the automaton.
+\end{enumerate}
+
+Here are some possible definitions of these keys that do not (yet) generate
+\textsc{rdf} information:
+%
+\begin{codeexample}[code only, setup code]
+\tikzset {
+ dfa/.style = { semithick, > = To [sep] },
+ nfa/.style = { semithick, > = To [sep] },
+ state/.style = { circle, draw, minimum size = 1cm },
+ final/.style = { double },
+ initial/.style = { draw = red }, % to keep things simple
+ transition/.style = { edge label = {$#1$} } }
+\end{codeexample}
+
+The library could be used as follows:
+%
+\begin{codeexample}[width=5cm]
+\tikz [dfa]
+ \graph [math nodes, grow right = 1.5cm] {
+ q_0 [state, initial] -> [transition = a]
+ q_1 [state] -> [transition = b, loop above]
+ q_1 -> [transition = a]
+ q_2 [state, final]
+ };
+\end{codeexample}
+
+
+\subsubsection{Adding Semantic Information About the Automata as a Whole}
+
+Let us change the different keys so that they add \textsc{rdf} information to
+the output. For this, we first need an ontology that defines notions like
+``state'' or ``deterministic finite automaton''. For the purposes of this
+example, we just assume that such an ontology exists at
+|http://www.tcs.uni-luebeck.de/ontologies/automata/|. The new definition of the
+|dfa| key might start as follows (we will extend these later on):
+%
+\begin{codeexample}[code only]
+dfa/.style = {
+ semithick, > = To [sep], % as before,
+ rdf engine = {
+ %
+ % Setup prefix:
+ prefix = { automata: http://www.tcs.uni-luebeck.de/ontologies/automata/ },
+ %
+ % Get the curie of the automaton and store it in a macro for later use:
+ get scope curie = \mylibAutomatonCurie,
+ %
+ % Make a statement that the resource is, indeed, an automaton:
+ statement = {
+ subject = \mylibAutomatonCurie,
+ has type = automata:types/automaton },
+ %
+ % Make a statement that the automaton is deterministic:
+ statement = {
+ subject = \mylibAutomatonCurie,
+ predicate = automata:properties/deterministic,
+ object = "yes" } } }
+\end{codeexample}
+
+The definition of the style |nfa| would be exactly the same as for |dfa|,
+except, of course, that the last statement would have |"no"| as object. Note
+that the original styles |dfa| and |nfa| has identical definitions since,
+indeed, there is no ``visual'' difference between the two. In contrast, the
+\textsc{rdf} information stores this information in the output.
+
+
+\subsubsection{Adding Semantic Information About the States}
+
+We next augment the styles for creating states and marking them as final or
+initial. We could do the following (note that we do not setup the prefix since
+this has been done by the surrounding |dfa| or |nfa| key):
+%
+\begin{codeexample}[code only]
+state/.style = {
+ circle, draw, minimum size = 1cm, % as before,
+ rdf engine = {
+ get scope curie = \mylibStateCurie,
+ statement = {
+ subject = \mylibStateCurie,
+ has type = automata:types/state },
+ statement = {
+ subject = \mylibStateCurie,
+ predicate = rdf:value,
+ object = scope content } } }
+\end{codeexample}
+
+The first statement tells us that the circle with its contents is a state (and
+not just ``any'' fancy circle). The second statement tells us that the
+``value'' of this state is the content. One might argue that, instead, only the
+number itself (like ``$q_0$'' or perhaps only ``$0$'') should be the ``value''
+or, perhaps, a different property should actually be used (like
+|automata:stateNumber| or something like that). However, these are questions of
+ontological modeling, not of the use of the \textsc{rdf} engine.
+
+What is definitely missing from the above definition is a link between the
+automaton resource and the state resource. Note that the state's rendering code
+will be inside the scope of the automaton, so, in a sense, the state is
+``inside'' the automaton in the output. However, the nesting of scopes is
+\emph{not} part of the \textsc{rdf} graph; we must make these relationships
+explicit using statements. One way to achieve this would be to add the
+following to the |state| style:
+%
+\begin{codeexample}[code only]
+ statement = {
+ subject = \mylibAutomatonCurie,
+ predicate = automata:hasAsAState,
+ object = \mylibStateCurie }
+\end{codeexample}
+
+Note that we can access the macro |\mylibAutomatonCurie| here since this will
+have been setup by the surrounding |dfa| or |nfa| key. While the above is
+possible and legitimate, we will see a better solution using containers in a
+moment (``better'' in the sense that the ontological model is easier to process
+by software).
+
+The two styles |final| and |initial| are easy to augment:
+%
+\begin{codeexample}[code only]
+final/.style = {
+ double, % as before,
+ rdf engine = {
+ get scope curie = \mylibStateCurie,
+ statement = {
+ subject = \mylibStateCurie,
+ has type = automata:properties/final } } }
+\end{codeexample}
+
+Note that when we write |node [state, final] ...| the state now has two types:
+It has type |automata:types/state| and also |automata:properties/final|. This
+is perfectly legitimate. Also note that I added |get scope curie| to the above
+definition, which may seem superfluous since the |state| style already executes
+this key to get a curie for the state resource. However, users should be free
+to write |node [final, state] ...| and, now, the |final| key will be executed
+first.
+
+The style for |initial| is the same as for |final| only with a different type.
+
+
+\subsubsection{Adding Semantic Information About the Transitions}
+
+A transition is, essentially, a labeled edge from a state to another state. It
+may seem tempting to model them as a statement with the first state as its
+subject and the second state as the object and the transition's symbol as the
+label (turned into a curie in some appropriate way). However, closer inspection
+shows that this is not a good way of modeling transitions: In essence, it is
+just coincidence that the \textsc{rdf} graph happens to be a directed graph
+and, at the same time, the thing we describe by it (the automaton) can also be
+viewed as a directed graph. If, for instance, we consider alternating automata
+where a transition can involve more than two states, the simple model breaks
+down.
+
+The ``right'' way of modeling a transition is to treat the transition as a
+resource of its own and then make statements like ``the transition has this
+state as its old state''. This turns out to be relatively easy to achieve:
+%
+\begin{codeexample}[code only]
+transition/.style = {
+ edge label = {#1}, % as before,
+ rdf engine = {
+ get scope curie = \mylibTransitionCurie,
+ statement = {
+ subject = \mylibTransitionCurie,
+ has type = automata:types/transition },
+ statement = {
+ subject = \mylibTransitionCurie,
+ predicate = automata:properties/symbolReadFromTape,
+ object = "#1" },
+ statement = {
+ subject = \mylibTransitionCurie,
+ predicate = automata:relations/oldState,
+ object = (\tikztostart) },
+ statement = {
+ subject = \mylibTransitionCurie,
+ predicate = automata:relations/newState,
+ object = (\tikztotarget) } } }
+\end{codeexample}
+
+
+\subsubsection{Using Containers}
+
+As a last step we wish to organize the states and transitions using containers.
+As explained earlier, we can easily add statements linking our automaton to the
+states and to the transitions, but the \textsc{rdf} standard has standard way
+of specifying that a set of resources form a logical sequence: containers.
+
+In case automata contained \emph{only} states, we could setup the automaton
+itself to be the container and the states to be its elements. However, the
+automaton has states and transitions and in this example I would like to keep
+these in separate containers. Thus, we must create two containers and then make
+statements that the automaton contains these two containers. Since these
+containers do not have any accompanying visual representation, we use the
+|get new resource curie| key to create new resources that are purely for
+descriptive purposes inside the \textsc{rdf} graph:
+%
+\begin{codeexample}[code only]
+dfa/.style = {
+ semithick, > = To [sep], % as before,
+ rdf engine = {
+ prefix = { automata: http://www.tcs.uni-luebeck.de/ontologies/automata/ },
+ get scope curie = \mylibAutomatonCurie,
+ statement = { ... as before that automaton has type automata:types/automaton ... },
+ statement = { ... as before that automaton is deterministic ... },
+ get new resource curie = \mylibStateContainerCurie,
+ statement = {
+ subject = \mylibStateContainerCurie,
+ is a sequence },
+ statement = {
+ subject = \mylibAutomatonCurie,
+ predicate = automata:relations/hasAsStateContainer,
+ object = \mylibStateContainerCurie },
+ get new resource curie = \mylibTransitionContainerCurie,
+ statement = {
+ subject = \mylibTransitionContainerCurie,
+ is a sequence },
+ statement = {
+ subject = \mylibAutomatonCurie,
+ predicate = automata:relations/hasAsTransitionContainer,
+ object = \mylibTransitionContainerCurie } } }
+\end{codeexample}
+
+We can now modify the |state| style as follows:
+%
+\begin{codeexample}[code only]
+state/.style = {
+ circle, draw, minimum size = 1cm, % as before,
+ rdf engine = {
+ get scope curie = \mylibStateCurie,
+ statement = { ... as before ... },
+ statement = { ... as before ... },
+ statement = {
+ subject = \mylibStateContainerCurie,
+ has as member,
+ object = \mylibStateCurie } } }
+\end{codeexample}
+
+The modification for the |transition| style is similar:
+%
+\begin{codeexample}[code only]
+transition/.style = {
+ edge label = {#1}, % as before,
+ rdf engine = {
+ get scope curie = \mylibTransitionCurie,
+ statement = { ... as before ... },
+ statement = { ... as before ... },
+ statement = { ... as before ... },
+ statement = { ... as before ... },
+ statement = {
+ subject = \mylibTransitionContainerCurie,
+ has as member,
+ object = \mylibTransitionCurie } } }
+\end{codeexample}
+
+
+\subsubsection{The Resulting RDF Graph}
+
+Putting it all together, we now get the following library code:
+%
+\begin{codeexample}[setup code, multipage]
+\tikzset {
+ dfa/.style = {
+ semithick, > = To [sep], % as before,
+ rdf engine = {
+ prefix = { automata: http://www.tcs.uni-luebeck.de/ontologies/automata/ },
+ get scope curie = \mylibAutomatonCurie,
+ statement = {
+ subject = \mylibAutomatonCurie,
+ has type = automata:types/automaton },
+ statement = {
+ subject = \mylibAutomatonCurie,
+ predicate = automata:properties/deterministic,
+ object = "yes" },
+ get new resource curie = \mylibStateContainerCurie,
+ statement = {
+ subject = \mylibStateContainerCurie,
+ is a sequence },
+ statement = {
+ subject = \mylibAutomatonCurie,
+ predicate = automata:relations/hasAsStateContainer,
+ object = \mylibStateContainerCurie },
+ get new resource curie = \mylibTransitionContainerCurie,
+ statement = {
+ subject = \mylibTransitionContainerCurie,
+ is a sequence },
+ statement = {
+ subject = \mylibAutomatonCurie,
+ predicate = automata:relations/hasAsTransitionContainer,
+ object = \mylibTransitionContainerCurie } } },
+ state/.style = {
+ circle, draw, minimum size = 1cm, % as before,
+ rdf engine = {
+ get scope curie = \mylibStateCurie,
+ statement = {
+ subject = \mylibStateCurie,
+ has type = automata:types/state },
+ statement = {
+ subject = \mylibStateCurie,
+ predicate = rdf:value,
+ object = scope content },
+ statement = {
+ subject = \mylibStateContainerCurie,
+ has as member,
+ object = \mylibStateCurie } } },
+ initial/.style = {
+ draw = red, % as before,
+ rdf engine = {
+ get scope curie = \mylibStateCurie,
+ statement = {
+ subject = \mylibStateCurie,
+ has type = automata:properties/initial } } },
+ final/.style = {
+ double, % as before,
+ rdf engine = {
+ get scope curie = \mylibStateCurie,
+ statement = {
+ subject = \mylibStateCurie,
+ has type = automata:properties/final } } },
+ transition/.style = {
+ edge label = {$#1$}, % as before,
+ rdf engine = {
+ get scope curie = \mylibTransitionCurie,
+ statement = {
+ subject = \mylibTransitionCurie,
+ has type = automata:types/transition },
+ statement = {
+ subject = \mylibTransitionCurie,
+ predicate = automata:properties/symbolReadFromTape,
+ object = "#1" },
+ statement = {
+ subject = \mylibTransitionCurie,
+ predicate = automata:relations/oldState,
+ object = (\tikztostart) },
+ statement = {
+ subject = \mylibTransitionCurie,
+ predicate = automata:relations/newState,
+ object = (\tikztotarget) },
+ statement = {
+ subject = \mylibTransitionContainerCurie,
+ has as member,
+ object = \mylibTransitionCurie } } }
+}
+\end{codeexample}
+
+\emph{Using} this code is still ``as easy as before'', indeed, the code for
+creating the automaton is perfectly unchanged:
+%
+\begin{codeexample}[width=5cm]
+\tikzset { rdf engine on }
+\tikz [dfa]
+ \graph [math nodes, grow right = 1.5cm] {
+ q_0 [state, initial] -> [transition = a]
+ q_1 [state] -> [transition = b, loop above]
+ q_1 -> [transition = a]
+ q_2 [state, final]
+ };
+\end{codeexample}
+
+Let us now have a look at the result. If the above is processed using \TeX\ and
+transformed to \textsc{svg} code, the following results (reformatted and
+slightly simplified):
+%
+\begin{codeexample}[multipage]
+<g id="pgf3" prefix=" automata: http://www.tcs.uni-luebeck.de/ontologies/automata/ ">
+ <!-- The automaton -->
+ <g about="#pgf3" property="rdf:type" resource="automata:types/automaton" />
+ <g about="#pgf3" property="automata:properties/deterministic" content="yes" />
+ <g about="#pgf4" property="rdf:type" resource="rdf:Seq" />
+ <g about="#pgf3" property="automata:relations/hasAsStateContainer" resource="#pgf4" />
+ <g about="#pgf5" property="rdf:type" resource="rdf:Seq" />
+ <g about="#pgf3" property="automata:relations/hasAsTransitionContainer" resource="#pgf5" />
+ <g id="pgf6" about="#pgf6" property="rdf:value">
+ <!-- State $q_0$ -->
+ <g about="#pgf6" property="rdf:type" resource="automata:types/state" />
+ <g about="#pgf4" property="rdf:_1" resource="#pgf6" />
+ <g about="#pgf6" property="rdf:type" resource="automata:properties/initial" />
+ <g stroke="#f00"> <!-- Red Line -->
+ <path id="pgf6bp" d="M 14.22636 0.0 C 14.22636 7.8571 7.8571 14.22636 0.0 14.22636 ..." />
+ ...
+ </g>
+ </g>
+ <g id="pgf7" about="#pgf7" property="rdf:value">
+ <!-- State $q_1$ -->
+ <g about="#pgf7" property="rdf:type" resource="automata:types/state" />
+ <g about="#pgf4" property="rdf:_2" resource="#pgf7" />
+ <path id="pgf7bp" d="M 56.90549 0.0 C 56.90549 7.8571 50.53622 14.22636 42.67912 14.22636 ..." />
+ ...
+ </g>
+ <g id="pgf8" >
+ <!-- Transition from $q_0$ to $q_1$ -->
+ <g about="#pgf8" property="rdf:type" resource="automata:types/transition" />
+ <g about="#pgf8" property="automata:properties/symbolReadFromTape" content="a" />
+ <g about="#pgf8" property="automata:relations/oldState" resource="#pgf6" />
+ <g about="#pgf8" property="automata:relations/newState" resource="#pgf7" />
+ <g about="#pgf5" property="rdf:_1" resource="#pgf8" />
+ <path id="pgf8p" d="M 14.52637 0.0 L 26.49275 0.0"/>
+ ...
+ </g>
+ <g id="pgf11" >
+ <!-- Transition loop at $q_1$ -->
+ <g about="#pgf11" property="rdf:type" resource="automata:types/transition" />
+ <g about="#pgf11" property="automata:properties/symbolReadFromTape" content="b" />
+ <g about="#pgf11" property="automata:relations/oldState" resource="#pgf7" />
+ <g about="#pgf11" property="automata:relations/newState" resource="#pgf7" />
+ <g about="#pgf5" property="rdf:_2" resource="#pgf11" />
+ <path id="pgf11p" d="M 38.91211 14.05888 C 33.07051 35.8591 51.00113 36.72765 47.05392 16.66444"/>
+ ...
+ </g>
+ <g id="pgf12" about="#pgf12" property="rdf:value">
+ <!-- State $q_2$ -->
+ <g about="#pgf12" property="rdf:type" resource="automata:types/state" />
+ <g about="#pgf4" property="rdf:_3" resource="#pgf12" />
+ <g about="#pgf12" property="rdf:type" resource="automata:properties/final" />
+ <g stroke-width="1.80002"> <!-- Double Line -->
+ <path id="pgf12bp" d="M 99.58461 0.0 C 99.58461 7.8571 93.21535 14.22636 85.35825 14.22636 ..." />
+ ...
+ </g>
+ </g>
+ <g id="pgf13" >
+ <!-- Transition from $q_1$ to $q_2$ -->
+ <g about="#pgf13" property="rdf:type" resource="automata:types/transition" />
+ <g about="#pgf13" property="automata:properties/symbolReadFromTape" content="a" />
+ <g about="#pgf13" property="automata:relations/oldState" resource="#pgf7" />
+ <g about="#pgf13" property="automata:relations/newState" resource="#pgf12" />
+ <g about="#pgf5" property="rdf:_3" resource="#pgf13" />
+ <path id="pgf13p" d="M 57.20549 0.0 L 69.17188 0.0"/>
+ ...
+ </g>
+</g>
+\end{codeexample}
+
+When this code is processed by some \textsc{rdf}a tool, the following graph
+will result where the blue nodes represent resources:
+
+\ifluatex
+\else
+ This example can only be typeset using Lua\TeX.
+ \endgroup\expandafter\endinput
+\fi
+
+{
+ \newbox\myboxa
+ \setbox\myboxa=\hbox{\tiny {\tikz\node[circle, draw=red, fill=white] {$q_0$};}}
+ \newbox\myboxb
+ \setbox\myboxb=\hbox{\tiny {\tikz\node[circle, draw,fill=white] {$q_1$};}}
+ \newbox\myboxc
+ \setbox\myboxc=\hbox{\tiny {\tikz\node[circle, draw,fill=white, double] {$q_2$};}}
+ \catcode`\_=11
+ \begin{tikzpicture}[font=\tiny\ttfamily, > = {Stealth [round, sep]}]
+ \graph [layered layout, sibling sep=1mm, sibling distance=0pt,
+ resource/.style = {align=left,font=\footnotesize\ttfamily, draw = blue, thick, fill=blue!20, rounded corners},
+ predicate/.style = {align=right,font=\scriptsize\ttfamily,fill=black!5,rotate=90,anchor=mid east, rounded corners},
+ tail anchor=south, head anchor=north] {
+ pgf3/\#pgf3[resource] -- /"rdf:type"[predicate] -> automaton[as={automata:\\types/\\automaton},resource];
+ pgf3/\#pgf3[resource] -- /"automata:\\properties/deterministic"[predicate] -> /{"yes"}[resource];
+ pgf4/\#pgf4[resource] -- /"rdf:type"[predicate] -> rdf:Seq[resource];
+ pgf3/\#pgf3[resource] -- /"automata:\\relations/\\hasAsStateContainer"[predicate] -> pgf4[resource];
+ pgf5/\#pgf5[resource] -- /"rdf:type"[predicate] -> rdf:Seq[resource];
+ pgf3/\#pgf3[resource] -- /"atuomata:\\relations/\\hasAsTransitionContainer"[predicate] -> pgf5[resource];
+ pgf6/\#pgf6[resource] -- /"rdf:value"[predicate] -> /[as={\box\myboxa},resource];
+ pgf6/\#pgf6[resource] -- /"rdf:type"[predicate] -> state/"automata:\\types/state"[resource];
+ pgf4/\#pgf4[resource] -- /"rdf:_1"[predicate] -> pgf6[resource];
+ pgf6/\#pgf6[resource] -- /"rdf:type"[predicate] -> initial/"automata:\\properties/\\initial"[resource];
+ pgf7/\#pgf7[resource] -- /"rdf:value"[predicate] -> /[as={\box\myboxb},resource];
+ pgf7/\#pgf7[resource] -- /"rdf:type"[predicate] -> state/"automata:\\types/state"[resource];
+ pgf4/\#pgf4[resource] -- /"rdf:_2"[predicate] -> pgf7[resource];
+ pgf12/\#pgf12[resource] -- /"rdf:value"[predicate] -> /[as={\box\myboxc},resource];
+ pgf12/\#pgf12[resource] -- /"rdf:type"[predicate] -> state/"automata:\\types/state"[resource];
+ pgf4/\#pgf4[resource] -- /"rdf:_3"[predicate] -> pgf12[resource];
+ pgf12/\#pgf12[resource] -- /"rdf:type"[predicate] -> final/"automata:\\properties/\\final"[resource];
+ pgf8/\#pgf8[resource] -- /"rdf:type"[predicate] -> transition/"automata:\\types/\\transition"[resource];
+ pgf8/\#pgf8[resource] -- /"automata:\\properties/\\symbolReadFromTape"[predicate] -> /{"a"}[resource];
+ pgf8/\#pgf8[resource] -- /"automata:\\relations/oldState"[predicate] -> pgf6[resource];
+ pgf8/\#pgf8[resource] -- /"automata:\\relations/newState"[predicate] -> pgf7[resource];
+ pgf5/\#pgf5[resource] -- /"rdf:_1"[predicate] -> pgf8[resource];
+ pgf11/\#pgf11[resource] -- /"rdf:type"[predicate] -> transition/"automata:\\types/\\transition"[resource];
+ pgf11/\#pgf11[resource] -- /"automata:\\properties/\\symbolReadFromTape"[predicate] -> /{"b"}[resource];
+ pgf11/\#pgf11[resource] -- /"automata:\\relations/oldState"[predicate] -> pgf7[resource];
+ pgf11/\#pgf11[resource] -- /"automata:\\relations/newState"[predicate] -> pgf7[resource];
+ pgf5/\#pgf5[resource] -- /"rdf:_2"[predicate] -> pgf11[resource];
+ pgf13/\#pgf13[resource] -- /"rdf:type"[predicate] -> transition/"automata:\\types/\\transition"[resource];
+ pgf13/\#pgf13[resource] -- /"automata:\\properties/\\symbolReadFromTape"[predicate] -> /{"a"}[resource];
+ pgf13/\#pgf13[resource] -- /"automata:\\relations/oldState"[predicate] -> pgf7[resource];
+ pgf13/\#pgf13[resource] -- /"automata:\\relations/newState"[predicate] -> pgf12[resource];
+ pgf5/\#pgf5[resource] -- /"rdf:_3"[predicate] -> pgf13[resource];
+ };
+\end{tikzpicture}
+}
+
+\endgroup
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
index 2d7d9648ef5..5d3ebbc995b 100644
--- 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
@@ -12,89 +12,83 @@
\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.
+ 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.
+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 sets 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}
-
+ 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 sets 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:
-
+ \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}
+\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|
-
+ 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);
@@ -102,20 +96,17 @@ even when this library is not used.
\shade[ball color=black] (2,0) circle (2ex);
\end{tikzpicture}
\end{codeexample}
- \end{key}
+ \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.
-
+ 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,
@@ -123,103 +114,105 @@ even when this library is not used.
(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)}
- Works like |lower left|.
- \end{key}
- \begin{key}{/tikz/upper right=\meta{color} (initially white)}
- Works like |lower left|.
- \end{key}
- \begin{key}{/tikz/lower right=\meta{color} (initially white)}
- Works like |lower left|.
- \end{key}
-\end{shading}
+ \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)}
+ Works like |lower left|.
+ \end{key}
+
+ \begin{key}{/tikz/upper right=\meta{color} (initially white)}
+ Works like |lower left|.
+ \end{key}
+ \begin{key}{/tikz/lower right=\meta{color} (initially white)}
+ Works like |lower left|.
+ \end{key}
+\end{shading}
\begin{shading}{color wheel}
- \label{shading-color-wheel}
- This shading fills the path with a 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:
+ %
+ 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.
+ 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.
+ 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).
-
+ 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.
-
+ 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}
+ \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{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{key}
\end{shading}
-%%% 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-shadows.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shadows.tex
index 94e7487b1d7..93b6feaced7 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shadows.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shadows.tex
@@ -7,102 +7,102 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Shadows Library}
\label{section-libs-shadows}
\begin{pgflibrary}{shadows}
- This library defines styles that help adding a (partly) transparent
- shadow to a path or node.
+ This library defines styles that help adding a (partly) transparent shadow
+ to a path or node.
\end{pgflibrary}
\subsection{Overview}
-A \emph{shadow} is usually a black or gray area that is drawn behind a
-path or a node, thereby adding visual depth to a picture. The |shadows|
-library defines options that make it easy to add shadows to
-paths. Internally, these options are based on using the |preaction|
-option to use a path twice: Once for drawing the shadow (slightly
-shifted) and once for actually using the path.
+A \emph{shadow} is usually a black or gray area that is drawn behind a path or
+a node, thereby adding visual depth to a picture. The |shadows| library defines
+options that make it easy to add shadows to paths. Internally, these options
+are based on using the |preaction| option to use a path twice: Once for drawing
+the shadow (slightly shifted) and once for actually using the path.
-Note that you can only add shadows to \emph{paths}, not to whole
-scopes.
+Note that you can only add shadows to \emph{paths}, not to whole scopes.
-In addition to the general |shadow| option, there exist special
-options like |circular shadow|. These can only (sensibly) be used with
-a special kind of path (for |circular shadow|, a circle) and, thus,
-they are not as general. The advantage is, however, that they are
-more visually pleasing since these shadows blend smoothly with the
-background. Note that these special shadows use fadings, which few
-printers will support.
+In addition to the general |shadow| option, there exist special options like
+|circular shadow|. These can only (sensibly) be used with a special kind of
+path (for |circular shadow|, a circle) and, thus, they are not as general. The
+advantage is, however, that they are more visually pleasing since these shadows
+blend smoothly with the background. Note that these special shadows use
+fadings, which few printers will support.
\subsection{The General Shadow Option}
The shadows are internally created by using a single option called
-|general shadow|. The different options like |drop shadow| or
-|copy shadow| only differ in the commands that they preset.
-
-You will not need to use this option directly under normal
-circumstances.
+|general shadow|. The different options like |drop shadow| or |copy shadow|
+only differ in the commands that they preset.
+You will not need to use this option directly under normal circumstances.
\begin{key}{/tikz/general shadow=\meta{shadow options} (default \normalfont empty)}
- This option should be given to a |\path| or a |node|. It has the
- following effect: Before the path is used normally, it is used once
- with the \meta{shadow options} in force. Furthermore, when the path
- is ``preused'' in this way, it is shifted and scaled a little bit.
-
- In detail, the following happens: A |preaction| is used to
- paint the path in a special manner before it is actually
- painted. This ``special'' manner is as follows: The options in
- \meta{shadow options} are used for painting this path. Typically,
- the \meta{shadow options} will contain options like |fill=black| to
- create, say, a black shadow. Furthermore, after the \meta{shadow
- options} have been set up, the following extra canvas
- transformations are applied to the path: It is scaled by
- |shadow scale| (with the origin of scaling at the path's center) and
- it is shifted by |shadow xshift| and |shadow yshift|.
-
- Note that since scaling and shifting is done using canvas
- transformations, shadows are not taken into account when the
- picture's bounding box is computed.
+ This option should be given to a |\path| or a |node|. It has the following
+ effect: Before the path is used normally, it is used once with the
+ \meta{shadow options} in force. Furthermore, when the path is ``preused''
+ in this way, it is shifted and scaled a little bit.
+
+ In detail, the following happens: A |preaction| is used to paint the path
+ in a special manner before it is actually painted. This ``special'' manner
+ is as follows: The options in \meta{shadow options} are used for painting
+ this path. Typically, the \meta{shadow options} will contain options like
+ |fill=black| to create, say, a black shadow. Furthermore, after the
+ \meta{shadow options} have been set up, the following extra canvas
+ transformations are applied to the path: It is scaled by |shadow scale|
+ (with the origin of scaling at the path's center) and it is shifted by
+ |shadow xshift| and |shadow yshift|.
+
+ Note that since scaling and shifting is done using canvas transformations,
+ shadows are not taken into account when the picture's bounding box is
+ computed.
+ %
\begin{codeexample}[]
\tikz [even odd rule]
- \draw [general shadow={fill=red}] (0,0) circle (.5) (0.5,0) circle (.5);
+ \draw [general shadow={fill=red}] (0,0) circle (.5) (0.5,0) circle (.5);
\end{codeexample}
-
- \begin{key}{/tikz/shadow scale=\meta{factor} (initially 1)}
- Shadows are scaled by \meta{factor}.
+
+ \begin{key}{/tikz/shadow scale=\meta{factor} (initially 1)}
+ Shadows are scaled by \meta{factor}.
+ %
\begin{codeexample}[]
\tikz [even odd rule]
\draw [general shadow={fill=red,shadow scale=1.25}]
- (0,0) circle (.5) (0.5,0) circle (.5);
+ (0,0) circle (.5) (0.5,0) circle (.5);
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/shadow xshift=\meta{dimension} (initially 0pt)}
- Shadows are shifted horizontally by \meta{dimension}.
+ \end{key}
+ %
+ \begin{key}{/tikz/shadow xshift=\meta{dimension} (initially 0pt)}
+ Shadows are shifted horizontally by \meta{dimension}.
+ %
\begin{codeexample}[]
\tikz [even odd rule]
\draw [general shadow={fill=red,shadow xshift=-5pt}]
- (0,0) circle (.5) (0.5,0) circle (.5);
+ (0,0) circle (.5) (0.5,0) circle (.5);
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/shadow yshift=\meta{dimension} (initially 0pt)}
- Shadows are shifted vertically by \meta{dimension}.
- \end{key}
+ \end{key}
+ %
+ \begin{key}{/tikz/shadow yshift=\meta{dimension} (initially 0pt)}
+ Shadows are shifted vertically by \meta{dimension}.
+ \end{key}
\end{key}
-
\subsection{Shadows for Arbitrary Paths and Shapes}
\subsubsection{Drop Shadows}
\begin{key}{/tikz/drop shadow=\meta{shadow options} (default \normalfont empty)}
- This option adds a drop shadow to a |\path| or a
- |node|. It uses the |general shadow| and passes the \meta{shadow
- options} to it, plus, before them, the following extra options:
+ This option adds a drop shadow to a |\path| or a |node|. It uses the
+ |general shadow| and passes the \meta{shadow options} to it, plus, before
+ them, the following extra options:
+ %
\begin{codeexample}[code only]
shadow scale=1, shadow xshift=.5ex, shadow yshift=-.5ex,
opacity=.5, fill=black!50, every shadow
@@ -110,8 +110,9 @@ circumstances.
\begin{codeexample}[]
\tikz [even odd rule]
- \filldraw [drop shadow,fill=white] (0,0) circle (.5) (0.5,0) circle (.5);
+ \filldraw [drop shadow,fill=white] (0,0) circle (.5) (0.5,0) circle (.5);
\end{codeexample}
+
\begin{codeexample}[]
\begin{tikzpicture}
\foreach \i in {1,...,4}
@@ -123,43 +124,45 @@ circumstances.
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
\filldraw [drop shadow={opacity=1},fill=white]
- (1,2) circle (.5) (1.5,2) circle (.5);
+ (1,2) circle (.5) (1.5,2) circle (.5);
\filldraw [drop shadow={opacity=0.25},fill=white]
- (1,.5) circle (.5) (1.5,.5) circle (.5);
+ (1,.5) circle (.5) (1.5,.5) circle (.5);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{stylekey}{/tikz/every shadow (initially \normalfont empty)}
- This style is executed in addition to any \meta{shadow options} for
- each shadow. Use this style to reconfigure the way shadows are
- drawn.
+ This style is executed in addition to any \meta{shadow options} for each
+ shadow. Use this style to reconfigure the way shadows are drawn.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}[every shadow/.style={opacity=.8,fill=blue!50!black}]
- \filldraw [drop shadow,fill=white] (0,0) circle (.5) (0.5,0) circle (.5);
+\begin{tikzpicture}[every shadow/.style={opacity=.8,fill=blue!50!black}]
+ \filldraw [drop shadow,fill=white] (0,0) circle (.5) (0.5,0) circle (.5);
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
-
\subsubsection{Copy Shadows}
-A \emph{copy shadow} is not really a shadow. Rather, it looks like
-another copy of the path drawn behind the path and a little bit
-offset. This creates the visual impression of having multiple copies
-of the path/object present.
+A \emph{copy shadow} is not really a shadow. Rather, it looks like another copy
+of the path drawn behind the path and a little bit offset. This creates the
+visual impression of having multiple copies of the path/object present.
\begin{key}{/tikz/copy shadow=\meta{shadow options} (default \normalfont empty)}
- This shadow installs the following default options:
+ This shadow installs the following default options:
+ %
\begin{codeexample}[code only]
shadow scale=1, shadow xshift=.5ex, shadow yshift=-.5ex, every shadow
\end{codeexample}
- Furthermore, the options |fill=|\meta{fill color} and
- |draw=|\meta{draw color} are also set, where the \meta{fill color}
- and \meta{draw color} are the fill and draw colors used for the main
- path.
+ %
+ Furthermore, the options |fill=|\meta{fill color} and |draw=|\meta{draw
+ color} are also set, where the \meta{fill color} and \meta{draw color} are
+ the fill and draw colors used for the main path.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node [copy shadow,fill=blue!20,draw=blue,thick] {Hello World!};
@@ -179,11 +182,13 @@ of the path/object present.
{Hello World!};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/double copy shadow=\meta{shadow options} (default \normalfont empty)}
- This shadow works like a |copy shadow|, only the shadow is added
- twice, the second time with the double |xshift| and |yshift|.
+ This shadow works like a |copy shadow|, only the shadow is added twice, the
+ second time with the double |xshift| and |yshift|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node [double copy shadow,fill=blue!20,draw=blue,thick] {Hello World!};
@@ -201,18 +206,20 @@ of the path/object present.
{Hello World!};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\subsection{Shadows for Special Paths and Nodes}
-The shadows in this section should normally be added only to paths
-that have a special shape. They will look strange with other shapes.
+The shadows in this section should normally be added only to paths that have a
+special shape. They will look strange with other shapes.
\begin{key}{/tikz/circular drop shadow=\meta{shadow options}}
- This shadow works like a drop shadow, only it adds a circular
- fading to the shadow. This means that the shadow will fade out at
- the border. The following options are preset for this shadow:
+ This shadow works like a drop shadow, only it adds a circular fading to the
+ shadow. This means that the shadow will fade out at the border. The
+ following options are preset for this shadow:
+ %
\begin{codeexample}[code only]
shadow scale=1.1, shadow xshift=.3ex, shadow yshift=-.3ex,
fill=black, path fading={circle with fuzzy edge 15 percent},
@@ -226,13 +233,14 @@ that have a special shape. They will look strange with other shapes.
at (\i*45:1) {Circle \i};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\begin{key}{/tikz/circular glow=\meta{shadow options}}
- This shadow works much like the |circular shadow|, only it is not
- shifted. This creates a visual effect of a ``glow'' behind the
- circle. The following options are preset for this shadow:
+ This shadow works much like the |circular shadow|, only it is not shifted.
+ This creates a visual effect of a ``glow'' behind the circle. The following
+ options are preset for this shadow:
+ %
\begin{codeexample}[code only]
shadow scale=1.25, shadow xshift=0pt, shadow yshift=0pt,
fill=black, path fading={circle with fuzzy edge 15 percent},
@@ -246,6 +254,7 @@ that have a special shape. They will look strange with other shapes.
at (\i*45:1) {Circle \i};
\end{tikzpicture}
\end{codeexample}
+
\begin{codeexample}[]
\begin{tikzpicture}
\foreach \i in {1,...,8}
@@ -253,6 +262,7 @@ that have a special shape. They will look strange with other shapes.
at (\i*45:1) {Circle \i};
\end{tikzpicture}
\end{codeexample}
+
\begin{codeexample}[]
\begin{tikzpicture}
\foreach \i in {1,...,8}
@@ -260,8 +270,10 @@ that have a special shape. They will look strange with other shapes.
at (\i*45:1) {Circle \i};
\end{tikzpicture}
\end{codeexample}
- An especially interesting effect can be achieved by only using the
- glow and not filling the path:
+ %
+ An especially interesting effect can be achieved by only using the glow and
+ not filling the path:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\foreach \i in {1,...,8}
@@ -269,10 +281,11 @@ that have a special shape. They will look strange with other shapes.
at (\i*45:1) {Circle \i};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-%%% 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-shapes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-shapes.tex
index 3beaf544170..be536402d33 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
@@ -11,23 +11,22 @@
\section{Shape Library}
\label{section-libs-shapes}
-
\subsection{Overview}
-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
-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
-|shapes.geometric| or |shapes.misc| directly.
+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 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 |shapes.geometric| or
+|shapes.misc| directly.
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}
-In all of the examples presented in this section, the following
-|shape example| style is used:
+In all of the examples presented in this section, the following |shape example|
+style is used:
+%
\begin{codeexample}[code only]
\tikzset{
shape example/.style= {color = black!30,
@@ -39,18 +38,20 @@ In all of the examples presented in this section, the following
}
\end{codeexample}
+
\subsection{Predefined Shapes}
\label{section-predefined-shapes}
-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.
+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.
\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.
+ 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.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -66,14 +67,16 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
\begin{shape}{rectangle}
- This shape, which is the standard, is a rectangle around the
- text. The inner and outer separations (see
- Section~\ref{section-shape-seps}) influence the white space around
- the text. The following figure shows the anchors this
- shape defines; the anchors |10| and |130| are example of border anchors.
+ This shape, which is the standard, is a rectangle around the text. The
+ inner and outer separations (see Section~\ref{section-shape-seps})
+ influence the white space around the text. The following figure shows the
+ anchors this shape defines; the anchors |10| and |130| are example of
+ border anchors.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -89,35 +92,31 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
-
\subsection{Geometric Shapes}
\begin{pgflibrary}{shapes.geometric}
- This library defines different shapes that correspond to basic
- geometric objects like ellipses or polygons.
+ This library defines different shapes that correspond to basic geometric
+ objects like ellipses or polygons.
\end{pgflibrary}
-
\begin{shape}{diamond}
- 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).
-
- \begin{key}{/pgf/aspect=\meta{value} (initially 1.0)}
- 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}
+ 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).
- The following figure shows the anchors this
- shape defines; the anchors |10| and |130| are example of border
- anchors.
+ \begin{key}{/pgf/aspect=\meta{value} (initially 1.0)}
+ 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}
@@ -133,12 +132,14 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
\begin{shape}{ellipse}
- This shape is an ellipse tightly fitting the text box, if no inner
- separation is given. The following figure shows the anchors this
- shape defines; the anchors |10| and |130| are example of border anchors.
+ This shape is an ellipse tightly fitting the text box, if no inner
+ separation is given. The following figure shows the anchors this shape
+ defines; the anchors |10| and |130| are example of border anchors.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -154,26 +155,22 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
-
-
-
-
\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
- addition to the natural dimensions of the node contents (which
- includes any |inner sep|.
-
-\begin{codeexample}[]
-\begin{tikzpicture}
- \tikzstyle{every node}=[trapezium, draw]
+ 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 addition to
+ the natural dimensions of the node contents (which includes any
+ |inner sep|.
+ %
+\begin{codeexample}[]
+\begin{tikzpicture}[every node/.style={trapezium, draw}]
\node at (0,2) {A};
\node[trapezium left angle=75, trapezium right angle=45]
at (0,1) {B};
@@ -182,27 +179,26 @@ 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. To use these keys in \tikzname, simply remove the
+ \declare{|/pgf/|} path.
- 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)}
- Sets the lower internal angle of the left side.
- \end{key}
-
- \begin{key}{/pgf/trapezium right angle=\meta{angle} (initially 60)}
- Sets the lower internal angle of the right side.
- \end{key}
+ \begin{key}{/pgf/trapezium left angle=\meta{angle} (initially 60)}
+ Sets the lower internal angle of the left 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}.
- \end{stylekey}
+ \begin{key}{/pgf/trapezium right angle=\meta{angle} (initially 60)}
+ Sets the lower internal angle of the right side.
+ \end{key}
- Regardless of the rotation of the shape border, the width
- and height of the trapezium are as follows:
+ \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}.
+ \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},
shape border uses incircle, shape border rotate=60]
@@ -214,13 +210,12 @@ shapes define a standard set of anchors.
\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
- enlarged.
-
+ \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 enlarged.
+ %
\begin{codeexample}[]
\tikzset{my node/.style={trapezium, fill=#1!20, draw=#1!75, text=black}}
\begin{tikzpicture}
@@ -231,9 +226,9 @@ shapes define a standard set of anchors.
\end{tikzpicture}
\end{codeexample}
- By setting \meta{boolean} to |true|, the trapezium can be stretched
- horizontally or vertically.
-
+ 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}
@@ -244,13 +239,13 @@ shapes define a standard set of anchors.
\node [my node=blue, minimum width=1.5cm] at (2, 0) {C};
\end{tikzpicture}
\end{codeexample}
-\end{key}
-
- \begin{key}{/pgf/trapezium stretches body=\meta{boolean} (default true)}
- 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.
+ \end{key}
+ \begin{key}{/pgf/trapezium stretches body=\meta{boolean} (default true)}
+ 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}
@@ -262,11 +257,11 @@ shapes define a standard set of anchors.
at (1.5,1.75) {C};
\end{tikzpicture}
\end{codeexample}
- \end{key}
-
- The anchors for the trapezium are shown below. The anchor |160| is an
- example of a border anchor.
+ \end{key}
+ The anchors for the trapezium are shown below. The anchor |160| is an
+ example of a border anchor.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -286,21 +281,21 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\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
- Section~\ref{section-rotating-shape-borders}.
- The anchors for the |semicircle| shape are shown below.
- Anchor |30| is an example of a border anchor.
-
+ This shape is a semicircle, which tightly fits the node contents. 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. 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]
- {Semicircle\vrule width 1pt height 2cm};
+ {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,
@@ -312,21 +307,17 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
-
-
-
-
\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
- polygon is \emph{always} constructed using the incircle, whose
- radius is calculated to tightly fit the node contents (including
- any |inner sep|).
-
+ 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}{
@@ -335,13 +326,12 @@ shapes define a standard set of anchors.
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
- circumcircle, that is, the circle that passes through all the
- corners of the polygon border.
+\end{codeexample}
+ 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}[]
\begin{tikzpicture}
\foreach \a in {3,...,7}{
@@ -349,18 +339,18 @@ shapes define a standard set of anchors.
\node[regular polygon, regular polygon sides=\a, minimum size=1cm, draw] at (\a*2,0) {};
}
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
- There is a \pgfname{} key to set the number of sides for the regular
- polygon.
- To use this key in \tikzname, simply remove the \declare{|/pgf/|} path.
-
- \begin{key}{/pgf/regular polygon sides=\meta{integer} (initially 5)}
- \end{key}
+ There is a \pgfname{} key to set the number of sides for the regular
+ polygon. To use this key in \tikzname, simply remove the \declare{|/pgf/|}
+ path.
- The anchors for a regular polygon shape are shown below.
- The anchor |75| is an example of a border anchor.
+ \begin{key}{/pgf/regular polygon sides=\meta{integer} (initially 5)}
+ \end{key}
+ 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}
@@ -376,25 +366,22 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
-
+ %
\end{shape}
\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
- star is \emph{always} constructed using the incircle.
-
- A star should be thought of as having a 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
- diameter of the circumcircle.
+ 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 star is \emph{always} constructed using the incircle.
+ A star should be thought of as having a 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 diameter of
+ the circumcircle.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (2,2);
@@ -405,31 +392,31 @@ shapes define a standard set of anchors.
\end{tikzpicture}
\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.
+ 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 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 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
- inner radius is increased to maintain the ratio.
- \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 inner radius is
+ increased to maintain the ratio.
+ \end{key}
- 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}[]
+ 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]
@@ -439,27 +426,23 @@ shapes define a standard set of anchors.
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,
- north east/below, south east/above, north west/below, south west/above}
+ west/above, east/above, north/below, south/above,
+ north east/below, south east/above, north west/below, south west/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}{isosceles triangle}
- 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
- always considered as follows:
-
+ 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
+ always considered as follows:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[>=stealth, every node/.style={text=black},
shape border uses incircle, shape border rotate=-30]
@@ -471,21 +454,19 @@ shapes define a standard set of anchors.
\end{tikzpicture}
\end{codeexample}
- There are \pgfname{} keys to customize this shape.
- To use these keys in \tikzname, simply remove the \declare{|/pgf/|}
- path.
+ 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 30)}
- 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
- height will increase the width (and vice versa), in order to keep the
- apex angle the same.
+ \begin{key}{/pgf/isosceles triangle apex angle=\meta{angle} (initially 30)}
+ 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 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,
@@ -496,11 +477,11 @@ shapes define a standard set of anchors.
\node[paint=\c, minimum width=\a cm] at (2,0) {};
}
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
- However, by setting \meta{boolean} to |true|, minimum width and
- height can be applied independently.
-
+ 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,
@@ -511,16 +492,15 @@ shapes define a standard set of anchors.
\node[paint=\c, minimum width=\a cm, minimum height=1.5cm] at (3,0) {};
}
\end{tikzpicture}
-\end{codeexample}
-\end{key}
-
- 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
- 90 degrees. Note also that the |center| anchor
- does not necessarily correspond to any kind of geometric center.
-
+\end{codeexample}
+ \end{key}
+
+ 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 90 degrees. Note also that the |center| anchor does not
+ necessarily correspond to any kind of geometric center.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -539,53 +519,43 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
-
-
-
-
-
\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}.
- 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/|}
- path.
-
- \begin{key}{/pgf/kite upper vertex angle=\meta{angle} (initially 120)}
- Sets the upper internal angle of the kite.
- \end{key}
-
- \begin{key}{/pgf/kite lower vertex angle=\meta{angle} (initially 60)}
- Sets the lower internal angle of the kite.
- \end{key}
-
- \begin{key}{/pgf/kite vertex angles=\meta{angle specification}}
- This key sets the keys for both the upper and lower vertex angles
- (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
- be the same.
- \end{key}%
-
-\begin{codeexample}[]
-\begin{tikzpicture}
- \tikzstyle{every node}=[kite, draw]
+ 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/|} path.
+
+ \begin{key}{/pgf/kite upper vertex angle=\meta{angle} (initially 120)}
+ Sets the upper internal angle of the kite.
+ \end{key}
+
+ \begin{key}{/pgf/kite lower vertex angle=\meta{angle} (initially 60)}
+ Sets the lower internal angle of the kite.
+ \end{key}
+
+ \begin{key}{/pgf/kite vertex angles=\meta{angle specification}}
+ This key sets the keys for both the upper and lower vertex angles (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 be the same.
+ \end{key}
+ %
+\begin{codeexample}[]
+\begin{tikzpicture}[every node/.style={kite, draw}]
\node[kite upper vertex angle=135, kite lower vertex angle=70] at (0,0) {A};
\node[kite vertex angles=90 and 45] at (1,0) {B};
\node[kite vertex angles=60] at (2,0) {C};
\end{tikzpicture}
\end{codeexample}
-
- The anchors for the |kite| are shown below. Anchor |110| is an
- example of a border anchor.
-
+ The anchors for the |kite| are shown below. Anchor |110| is an example of a
+ border anchor.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -604,24 +574,20 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
-
\begin{shape}{dart}
+ 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 the dart points (unless other
+ transformations have been applied).
-
- 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
- the dart points (unless other transformations have been applied).
-
- 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/|}
- path.
-
+ 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/|} path.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node[dart, draw, gray, shape border uses incircle, shape border rotate=45]
@@ -633,17 +599,18 @@ shapes define a standard set of anchors.
\end{tikzpicture}
\end{codeexample}
- \begin{key}{/pgf/dart tip angle=\meta{angle} (initially 45)}
- Sets the angle at the tip of the dart.
- \end{key}
-
- \begin{key}{/pgf/dart tail angle=\meta{angle} (initially 135)}
- Sets 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
- example of a border anchor.
+ \begin{key}{/pgf/dart tip angle=\meta{angle} (initially 45)}
+ Sets the angle at the tip of the dart.
+ \end{key}
+
+ \begin{key}{/pgf/dart tail angle=\meta{angle} (initially 135)}
+ Sets 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 example of a border
+ anchor.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -661,46 +628,41 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
-
-
-
\begin{shape}{circular sector}
-
- 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
- been applied).
-
+ 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 been applied).
+ %
\begin{codeexample}[]
-\begin{tikzpicture}
- \tikzstyle{every node}=[circular sector, shape border uses incircle, draw];
+\begin{tikzpicture}[
+ every node/.style={circular sector, shape border uses incircle, draw},
+]
\node at (0,0) {A};
\node [shape border rotate=30] at (1.5,0) {A};
\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/|}
- path.
-
- \begin{key}{/pgf/circular sector angle=\meta{angle} (initially 60)}
- Sets the central angle of the sector.
- \end{key}
-
- The anchors for the circular sector shape are shown below.
- Anchor |30| is an example of a border anchor.
-
+ 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)}
+ Sets the central angle of the sector.
+ \end{key}
+
+ The anchors for the circular sector shape are shown below. Anchor |30| is
+ an example of a border anchor.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
\node[name=s,shape=circular sector, style=shape example, inner sep=1cm]
- {Circular Sector\vrule width 1pt height 2cm};
+ {Circular Sector\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
{sector center/above, arc start/below, arc end/below, arc center/below,
center/above, base/below, mid/right, text/below,
@@ -711,26 +673,24 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
-
-
-
\begin{shape}{cylinder}
- 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}.
-
+ 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}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node[cylinder, draw, shape aspect=.5] {ABC};
\end{tikzpicture}
\end{codeexample}
-
- 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.
+ 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[>=stealth]
\node [cylinder, gray!50, rotate=30, draw,
@@ -742,10 +702,10 @@ shapes define a standard set of anchors.
\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
- width will stretch the curved ends.
-
+ Enlarging the shape to some minimum height will stretch only the body of
+ the cylinder. By contrast, enlarging the shape to some minimum width will
+ stretch the curved ends.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[shape aspect=.5]
\tikzset{every node/.style={cylinder, shape border rotate=90, draw}}
@@ -754,14 +714,14 @@ shapes define a standard set of anchors.
\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
- to some minimum width.
+ 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 to some
+ minimum width.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[]
\tikzset{every node/.style={cylinder, shape border rotate=90, draw}}
@@ -770,18 +730,16 @@ shapes define a standard set of anchors.
\node [aspect=0.25] at (2,0) {C};
\end{tikzpicture}
\end{codeexample}
+ \end{key}
-\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
- be implicity or explicitly set to |none|).
- Internally, this key sets the \TeX-if
- |\ifpgfcylinderusescustomfill| appropriately.
-\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 be implicity or
+ explicitly set to |none|). Internally, this key sets the \TeX-if
+ |\ifpgfcylinderusescustomfill| appropriately.
+ \end{key}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[aspect=0.5]
\node [cylinder, cylinder uses custom fill, cylinder end fill=red!50,
@@ -789,24 +747,22 @@ shapes define a standard set of anchors.
\end{tikzpicture}
\end{codeexample}
-\begin{key}{/pgf/cylinder end fill=\meta{color} (initially white)}
- Sets the color for the end of the cylinder.
-\end{key}
-\begin{key}{/pgf/cylinder body fill=\meta{color} (initially white)}
- Sets the color for the body of the cylinder.
-\end{key}
-
+ \begin{key}{/pgf/cylinder end fill=\meta{color} (initially white)}
+ Sets the color for the end of the cylinder.
+ \end{key}
- The anchors of this shape are shown below (anchor |160| is an
- example of a border anchor). Note that 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
- 2-dimensional representation of the cylinder top.
-
+ \begin{key}{/pgf/cylinder body fill=\meta{color} (initially white)}
+ Sets the color for the body of the cylinder.
+ \end{key}
+ The anchors of this shape are shown below (anchor |160| is an example of a
+ border anchor). Note that 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 2-dimensional representation of the cylinder top.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -825,82 +781,73 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
-
-
+ %
\end{shape}
-
-
-
-
\subsection{Symbol Shapes}
\begin{pgflibrary}{shapes.symbols}
- This library defines shapes that can be used for drawing symbols
- like a forbidden sign or a cloud.
+ This library defines shapes that can be used for drawing symbols like a
+ forbidden sign or a cloud.
\end{pgflibrary}
-
-
\begin{shape}{correct forbidden sign}
- This shape places the node inside a circle with a diagonal from the
- upper left to the lower 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.
-
+ This shape places the node inside a circle with a diagonal from the upper
+ left to the lower 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 [correct forbidden sign,line width=1ex,draw=red,fill=white] {Smoking};
\end{tikzpicture}
\end{codeexample}
- The shape inherits all anchors from the |circle| shape.
+ The shape inherits all anchors from the |circle| shape.
\end{shape}
\begin{shape}{forbidden sign}
- This shape is like |correct forbidden sign|, only the line goes from
- the lower left to the upper right. The strange naming of these
- shapes is for historical reasons.
-
+ This shape is like |correct forbidden sign|, only the line goes from the
+ lower left to the upper right. The strange naming of these shapes is for
+ historical reasons.
+ %
\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.
+ 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}
+ 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 aspect=\meta{factor} (default 1.5)}
- The length of the handle as a multiple of the circle radius.
- \end{key}
+ \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}[]
\begin{tikzpicture}
\node [magnifying glass,line width=1ex,draw] {huge};
\end{tikzpicture}
\end{codeexample}
- The shape inherits all anchors from the |circle| shape.
+ %
+ 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
- (strictly speaking, using an ellipse which tightly fits the node
- contents -- including any |inner sep|).
-
+ 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|).
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node[cloud, draw, fill=gray!20, aspect=2] {ABC};
@@ -908,46 +855,44 @@ shapes define a standard set of anchors.
\end{tikzpicture}
\end{codeexample}
- 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
- \tikzname{}, simply remove the \declare{|/pgf/|} path).
-
- \begin{key}{/pgf/cloud puffs=\meta{integer} (initially 10)}
- Sets the number of puffs for the cloud.
- \end{key}
-
- \begin{key}{/pgf/cloud puff arc=\meta{angle} (initially 135)}
- Sets 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 circumstances where it may
- be undesirable to continually specify the |aspect| for the cloud.
- Therefore, the following key is implemented:
-
- \begin{key}{/pgf/cloud ignores aspect=\meta{boolean} (default true)}
- Instruct \pgfname{} to ignore the |aspect| key. Internally, the
- \TeX-if |\ifpgfcloudignoresaspect| is set appropriately. The initial
- value is |false|.
+ 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 \tikzname{}, simply
+ remove the \declare{|/pgf/|} path).
+
+ \begin{key}{/pgf/cloud puffs=\meta{integer} (initially 10)}
+ Sets the number of puffs for the cloud.
+ \end{key}
+
+ \begin{key}{/pgf/cloud puff arc=\meta{angle} (initially 135)}
+ Sets 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 circumstances where it may be undesirable to
+ continually specify the |aspect| for the cloud. Therefore, the following
+ key is implemented:
+
+ \begin{key}{/pgf/cloud ignores aspect=\meta{boolean} (default true)}
+ Instruct \pgfname{} to ignore the |aspect| key. Internally, the \TeX-if
+ |\ifpgfcloudignoresaspect| is set appropriately. The initial value is
+ |false|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[aspect=1, every node/.style={cloud, cloud puffs=11, draw}]
\node [fill=gray!20] {rain};
\node [cloud ignores aspect, fill=white] at (1.5,0) {snow};
\end{tikzpicture}
-\end{codeexample}
-
- \end{key}
-
-
- 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
- aspect specification is applied.
-
+\end{codeexample}
+ \end{key}
+
+ 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 aspect specification is
+ applied.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
@@ -956,10 +901,10 @@ shapes define a standard set of anchors.
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.
+ The anchors for the cloud shape are shown below for a cloud with eleven
+ puffs. Anchor 70 is an example of a border anchor.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -977,38 +922,34 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
-
-
-
-
-
\begin{shape}{starburst}
-
- This shape is a randomly generated elliptical star,
- which supports the rotation of the shape border as described in
- Section~\ref{section-rotating-shape-borders}.
+ This shape is a randomly generated elliptical star, which supports the
+ rotation 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!};
\end{tikzpicture}
-\end{codeexample}
- Like the |star| shape, the starburst should be thought of as having a set
- of inner points and outer points. The inner points lie on the ellipse
- 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
- 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.
-
+\end{codeexample}
+ %
+ Like the |star| shape, the starburst should be thought of as having a set
+ of inner points and outer points. The inner points lie on the ellipse 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 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] grid(3,2);
@@ -1017,29 +958,29 @@ shapes define a standard set of anchors.
\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
- \declare{|/pgf/|} path.
-
- \begin{key}{/pgf/starburst points=\meta{integer} (initially 17)}
- Sets the number of outer points for the starburst.
- \end{key}
- \begin{key}{/pgf/starburst point height=\meta{length} (initially .5cm)}
- Sets 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)}
- Sets 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
- 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.
- Anchor |80| is an example of a border anchor.
+ There are \pgfname{} keys to control the drawing of the starburst shape. To
+ use these keys in \tikzname, simply remove the \declare{|/pgf/|} path.
+
+ \begin{key}{/pgf/starburst points=\meta{integer} (initially 17)}
+ Sets the number of outer points for the starburst.
+ \end{key}
+ %
+ \begin{key}{/pgf/starburst point height=\meta{length} (initially .5cm)}
+ Sets 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)}
+ Sets 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 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.
+ Anchor |80| is an example of a border anchor.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -1060,16 +1001,16 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
\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
- points extend the node contents (which include the |inner sep|).
-
+ 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 points extend the node contents
+ (which include the |inner sep|).
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[every node/.style={signal, draw, text=white, signal to=nowhere}]
@@ -1078,43 +1019,41 @@ shapes define a standard set of anchors.
\end{tikzpicture}
\end{codeexample}
- 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)}
- Sets 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)}
- Sets which sides take an inward pointer (i.e., that points towards the
- 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.
-
- \end{key}
-
- \begin{key}{/pgf/signal to=\meta{direction}\space\opt{and \meta{opposite direction}} (initially east)}
- Sets which sides take an outward pointer (i.e., that points away from
- 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
- 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
- possible for a signal to have an outward point to the left, and also
- have an inward point from below.
-
- The anchors for the signal shape are shown below. Anchor |70| is an
- example of a border anchor.
+ 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)}
+ Sets 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)}
+ Sets which sides take an inward pointer (i.e., that points towards the
+ 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.
+ \end{key}
+
+ \begin{key}{/pgf/signal to=\meta{direction}\space\opt{and \meta{opposite direction}} (initially east)}
+ Sets which sides take an outward pointer (i.e., that points away from
+ 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 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 possible for a signal to have an outward point
+ to the left, and also have an inward point from below.
+
+ The anchors for the signal shape are shown below. Anchor |70| is an example
+ of a border anchor.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -1132,18 +1071,13 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
-
+ %
\end{shape}
-
-
-
-
\begin{shape}{tape}
- This shape is a rectangle with optional, ``bendy'' top and bottom
- sides, which tightly fits the node contents (including the
- |inner sep|).
-
+ This shape is a rectangle with optional, ``bendy'' top and bottom sides,
+ which tightly fits the node contents (including the |inner sep|).
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node[tape, draw]{ABCD};
@@ -1151,18 +1085,17 @@ shapes define a standard set of anchors.
\end{tikzpicture}
\end{codeexample}
- 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):
+ 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)}
- Specifies 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|.
-
+ \begin{key}{/pgf/tape bend top=\meta{bend style} (initially in and out)}
+ Specifies 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|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[-stealth]
\node[tape, draw, gray, minimum width=2cm](t){Tape};
@@ -1173,29 +1106,27 @@ shapes define a standard set of anchors.
\end{tikzpicture}
\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
- think of a single use for such a combination.
-
+ 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]
+\begin{tikzpicture}[every node/.style={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{key}
+
+ \begin{key}{/pgf/tape bend bottom=\meta{bend style} (initially in and out)}
+ Specifies how the bottom side bends.
+ \end{key}%
- \end{key}
-
- \begin{key}{/pgf/tape bend bottom=\meta{bend style} (initially in and out)}
- Specifies how the bottom side bends.
- \end{key}%
-
- \begin{key}{/pgf/tape bend height=\meta{length} (initially 5pt)}
- Sets the total height for a side with a bend.
-
+ \begin{key}{/pgf/tape bend height=\meta{length} (initially 5pt)}
+ Sets the total height for a side with a bend.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[>=stealth]
\draw [help lines] grid(3,2);
@@ -1205,13 +1136,12 @@ shapes define a standard set of anchors.
node [at end, above, black]{tape bend height};
\end{tikzpicture}
\end{codeexample}
+ \end{key}
- \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 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).
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -1228,63 +1158,53 @@ shapes define a standard set of anchors.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
-
-\end{shape}%
-
-
+ %
+\end{shape}
\begin{shape}{magnetic tape}
-
- This shape represents a `magnetic tape' or any sequential data store
- that is sometimes used in flowcharts. It is essentially a circle with a
- little tail:
-
+ This shape represents a `magnetic tape' or any sequential data store that
+ is sometimes used in flowcharts. It is essentially a circle with a little
+ tail:
+ %
\begin{codeexample}[]
\tikz\node [magnetic tape, draw] (A) {A};
\end{codeexample}
- The following keys can be used to customise the |magnetic tape|
- shape:
+ The following keys can be used to customise the |magnetic tape| shape:
-
-\begin{key}{/pgf/magnetic tape tail extend=\meta{distance} (initially 0cm)}
-
- This key sets how far the tail extends beyond the radius of
- the tape. Negative values will be ignored.
-
+ \begin{key}{/pgf/magnetic tape tail extend=\meta{distance} (initially 0cm)}
+ This key sets how far the tail extends beyond the radius of the tape.
+ Negative values will be ignored.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={magnetic tape, draw}]
\node [magnetic tape tail extend=0cm] at (0,0) {A};
\node [magnetic tape tail extend=0.25cm] at (0,1) {B};
\end{tikzpicture}
\end{codeexample}
-\end{key}
-
+ \end{key}
-
-\begin{key}{/pgf/magnetic tape tail=\meta{proportion} (initially 0.15)}
-
- This key sets the thickness of the `tail' to be \meta{proportion}
- times the radius of the shape. The \meta{proportion} should be
- between |0.0| and |1.0|.
-
+ \begin{key}{/pgf/magnetic tape tail=\meta{proportion} (initially 0.15)}
+ This key sets the thickness of the `tail' to be \meta{proportion} times
+ the radius of the shape. The \meta{proportion} should be between |0.0|
+ and |1.0|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={magnetic tape, draw}]
\node [magnetic tape tail=0.5, magnetic tape tail extend=0.5cm] {A};
\node [magnetic tape tail=0.25] at (0,1) {B};
\end{tikzpicture}
\end{codeexample}
-\end{key}
+ \end{key}
-
- The following figure shows the anchors this shape defines;
- the anchors 10 and 130 are example of border anchors.
-
+ 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=magnetic tape,shape example,inner sep=0.75cm,
-magnetic tape tail extend=0.5cm]
+magnetic tape tail extend=0.5cm]
{Magnetic Tape\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
{north west/above left, north/above, north east/above right,
@@ -1298,26 +1218,26 @@ magnetic tape tail extend=0.5cm]
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
\subsection{Arrow Shapes}
\begin{pgflibrary}{shapes.arrows}
- This library defines arrow shapes. Note that an arrow shape is
- something quite different from a (normal) arrow tip: It is a shape
- that just ``happens'' to ``look like'' an arrow. In particular, you
- cannot use these shapes as arrow tips.
+ This library defines arrow shapes. Note that an arrow shape is something
+ quite different from a (normal) arrow tip: It is a shape that just
+ ``happens'' to ``look like'' an arrow. In particular, you cannot use these
+ shapes as arrow tips.
\end{pgflibrary}
\begin{shape}{single arrow}
- This shape is an arrow, which tightly fits the node 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 in which direction the arrow
- points (provided no other rotational transformations are applied).
-
+ This shape is an arrow, which tightly fits the node 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 in which direction the arrow points (provided no other
+ rotational transformations are applied).
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={single arrow, draw},
rotate border/.style={shape border uses incircle, shape border rotate=#1}]
@@ -1327,11 +1247,10 @@ magnetic tape tail extend=0.5cm]
\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
- tail.
-
+ 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,
rotate border/.style={shape border uses incircle, shape border rotate=#1}]
@@ -1344,21 +1263,19 @@ magnetic tape tail extend=0.5cm]
\end{tikzpicture}
\end{codeexample}
- There are \pgfname{} keys that can be used to customize this shape (to
- use these keys in \tikzname{}, simply remove the \declare{|/pgf/|}
- path).
-
-\begin{key}{/pgf/single arrow tip angle=\meta{angle} (initially 90)}
- Sets the angle for the arrow tip. Enlarging the arrow to some
- minimum width may increase the height of the shape to maintain
- this angle.
-\end{key}
+ There are \pgfname{} keys that can be used to customize this shape (to use
+ these keys in \tikzname{}, simply remove the \declare{|/pgf/|} path).
-\begin{key}{/pgf/single arrow head extend=\meta{length} (initially .5cm)}
- 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{key}{/pgf/single arrow tip angle=\meta{angle} (initially 90)}
+ Sets the angle for the arrow tip. Enlarging the arrow to some minimum
+ width may increase the height of the shape to maintain this angle.
+ \end{key}
+ \begin{key}{/pgf/single arrow head extend=\meta{length} (initially .5cm)}
+ 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]
@@ -1369,21 +1286,21 @@ magnetic tape tail extend=0.5cm]
\end{codeexample}
\end{key}
-\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{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};
\node [fill=blue!50, single arrow head indent=1ex] at (1.5,0) {arrow 2};
\end{tikzpicture}
\end{codeexample}
-\end{key}
-
- The anchors for this shape are shown below (anchor |20| is an
- example of a border anchor).
+ \end{key}
+ The anchors for this shape are shown below (anchor |20| is an example of a
+ border anchor).
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -1401,30 +1318,25 @@ magnetic tape tail extend=0.5cm]
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
-
+ %
\end{shape}
-
-
-
-
\begin{shape}{double arrow}
- This shape is a double arrow, which tightly fits the node contents
- (including any |inner sep|), and supports the rotation of the shape
- border, as described in Section~\ref{section-rotating-shape-borders}.
-
-
+ This shape is a double arrow, which tightly fits the node contents
+ (including any |inner sep|), and supports the rotation of the shape border,
+ as described in Section~\ref{section-rotating-shape-borders}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={double arrow, draw}]
\node [double arrow, draw] {Left or Right};
\end{tikzpicture}
\end{codeexample}
- 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 tip-to-tip distance.
-
+ 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 tip-to-tip
+ distance.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[>=stealth,
rotate border/.style={shape border uses incircle, shape border rotate=#1}]
@@ -1437,39 +1349,36 @@ magnetic tape tail extend=0.5cm]
\end{tikzpicture}
\end{codeexample}
- 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).
+ 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)}
- Sets the angle for the arrow tip. Enlarging the arrow to some
- minimum width may increase the height of the shape to maintain
- this angle.
-\end{key}
+ \begin{key}{/pgf/double arrow tip angle=\meta{angle} (initially 90)}
+ Sets the angle for the arrow tip. Enlarging the arrow to some minimum
+ width may increase the height of the shape to maintain this angle.
+ \end{key}
-\begin{key}{/pgf/double arrow head extend=\meta{length} (initially .5cm)}
- This sets the distance between the shaft of the arrow and the outer
- end of the arrow heads. This may change if the shape is enlarged to
- some minimum width.
-\end{key}
+ \begin{key}{/pgf/double arrow head extend=\meta{length} (initially .5cm)}
+ This sets the distance between the shaft of the arrow and the outer end
+ of the arrow heads. This may change if the shape is enlarged to some
+ minimum width.
+ \end{key}
-\begin{key}{/pgf/double arrow head indent=\meta{length} (initially 0cm)}
- This moves the point where the arrow heads join the shaft of the
- arrow \emph{towards} the arrow tips, by \meta{length}.
- \begin{codeexample}[]
+ \begin{key}{/pgf/double arrow head indent=\meta{length} (initially 0cm)}
+ This moves the point where the arrow heads join the shaft of the arrow
+ \emph{towards} the arrow tips, by \meta{length}.
+ %
+\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={double arrow, draw=none, rotate=-60}]
\node [fill=red!50] {arrow 1};
\node [fill=blue!50, double arrow head indent=1ex] at (1.5,0) {arrow 2};
\end{tikzpicture}
\end{codeexample}
-\end{key}
-
-
- The anchors for this shape are shown below (anchor |20| is an
- example of a border anchor).
-
+ \end{key}
+ The anchors for this shape are shown below (anchor |20| is an example of a
+ border anchor).
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -1487,15 +1396,13 @@ magnetic tape tail extend=0.5cm]
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
-
-
-
\begin{shape}{arrow box}
-This shape is a rectangle with optional arrows which extend from the
-four sides.
-
+ This shape is a rectangle with optional arrows which extend from the four
+ sides.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node[arrow box, draw] {A};
@@ -1504,82 +1411,80 @@ four sides.
\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
-the length of each arrow independently, from either the border of the
-rectangle (the default) or the center of the rectangle.
-
+ 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 the
+ length of each arrow independently, from either the border of the rectangle
+ (the default) or the center of the rectangle.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
- \tikzset{box/.style={arrow box, fill=#1}}
- \draw [help lines] grid(3,2);
+ \tikzset{box/.style={arrow box, fill=#1}}
+ \draw [help lines] grid(3,2);
\node[box=blue!50, arrow box arrows={east:2cm}] at (1,1.5){One};
\node[box=red!50, arrow box arrows={east:2cm from center}] at (1,0.5){Two};
\end{tikzpicture}
\end{codeexample}
-There are various \pgfname{} keys for drawing this shape (to use these
-keys in \tikzname, simply remove the \declare{/pgf/} path).
+ 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)}
- Sets the angle at the arrow tip for all four arrows.
+ Sets the angle at the arrow tip for all four arrows.
\end{key}
\begin{key}{/pgf/arrow box head extend=\meta{length} (initially .125cm)}
- Sets the distance the arrow head extends away from the shaft
- of the arrow. This applies to all arrows.
+ Sets the distance the arrow head extends away from the shaft of the arrow.
+ This applies to all arrows.
\end{key}
\begin{key}{/pgf/arrow box head indent=\meta{length} (initially 0cm)}
- Moves the point where the arrow head joins the shaft of the arrow
- \emph{towards} the arrow tip. This applies to all arrows.
+ Moves the point where the arrow head joins the shaft of the arrow
+ \emph{towards} the arrow tip. This applies to all arrows.
\end{key}
\begin{key}{/pgf/arrow box shaft width=\meta{length} (initially .125cm)}
- Sets the width of the shaft of all arrows.
+ Sets the width of the shaft of all arrows.
\end{key}
\begin{key}{/pgf/arrow box north arrow=\meta{distance} (initially .5cm)}
- Sets the distance the north arrow extends from the node. By default this
- is from the border of the shape, but by using the additional keyword
- |from center|, the distance will be measured from the center of the
- shape. If \meta{distance} is |0pt| or a negative distance, the arrow
- will not be drawn.
+ Sets the distance the north arrow extends from the node. By default this is
+ from the border of the shape, but by using the additional keyword
+ |from center|, the distance will be measured from the center of the shape.
+ If \meta{distance} is |0pt| or a negative distance, the arrow will not be
+ drawn.
\end{key}
\begin{key}{/pgf/arrow box south arrow=\meta{distance} (initially .5cm)}
- Sets the distance the south arrow extends from the node.
+ Sets the distance the south arrow extends from the node.
\end{key}
\begin{key}{/pgf/arrow box east arrow=\meta{distance} (initially .5cm)}
- Sets the distance the east arrow extends from the node.
+ Sets the distance the east arrow extends from the node.
\end{key}
\begin{key}{/pgf/arrow box west arrow=\meta{distance} (initially .5cm)}
- Sets the distance the west arrow extends from the node.
+ Sets the distance the west arrow extends from the node.
\end{key}
\begin{key}{/pgf/arrow box arrows={\ttfamily\char`\{}\meta{list}{\ttfamily\char`\}}}
- Sets 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 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).
- Any sides not specified will not be drawn with an arrow.
+ Sets 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 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). 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
-to the center of the appropriate side.
-
+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 to the
+center of the appropriate side.
+%
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -1604,24 +1509,23 @@ to the center of the appropriate side.
node[\placement, rotate=-90] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
-
+%
\end{shape}
-
\subsection{Shapes with Multiple Text Parts}
\begin{pgflibrary}{shapes.multipart}
- This library defines general-purpose shapes that are composed of
- multiple (text) parts.
+ This library defines general-purpose shapes that are composed of multiple
+ (text) parts.
\end{pgflibrary}
\begin{shape}{circle split}
- 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.
-
+ 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]
@@ -1633,9 +1537,9 @@ to the center of the appropriate side.
\end{tikzpicture}
\end{codeexample}
- The shape inherits all anchors from the |circle| shape and defines
- the |lower| anchor in addition. See also the
- following figure:
+ The shape inherits all anchors from the |circle| shape and defines the
+ |lower| anchor in addition. See also the following figure:
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -1651,13 +1555,13 @@ to the center of the appropriate side.
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.
-
+ 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]
@@ -1684,14 +1588,15 @@ to the center of the appropriate side.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
-
\begin{shape}{ellipse split}
- 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 anchors for this shape are shown below. Anchor |60| is a border anchor.
+ 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 anchors for this shape are shown below.
+ Anchor |60| is a border anchor.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -1706,13 +1611,13 @@ to the center of the appropriate side.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
-
\begin{shape}{rectangle split}
- This shape is a rectangle which can be split either horizontally
- or vertically into several parts.
-
+ This shape is a rectangle which can be split either horizontally or
+ vertically into several parts.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[my shape/.style={
rectangle split, rectangle split parts=#1, draw, anchor=center}]
@@ -1727,48 +1632,42 @@ to the center of the appropriate side.
\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, it 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 meet any
- |minimum width| requirements, but any |minimum height| will be ignored.
- Conversely when split horizontally, |minimum height| requirements
- will be met, 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 needed, the boxes should be allocated in advance as
- described above.
-
+ 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,
+ it 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 meet any |minimum width|
+ requirements, but any |minimum height| will be ignored. Conversely when
+ split horizontally, |minimum height| requirements will be met, 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 needed, the boxes should
+ be allocated in advance as described above.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every text node part/.style={align=center}]
\node[rectangle split, rectangle split parts=3, draw, text width=2.75cm]
@@ -1781,19 +1680,19 @@ these extra boxes, the following key is provided:
getName():String};
\end{tikzpicture}
\end{codeexample}
-\end{key}
+ \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}
-
- \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{key}{/pgf/rectangle split horizontal=\opt{\meta{boolean}} (default true)}
+ This key determines whether the rectangle is split horizontally or
+ vertically
+ \end{key}
+ \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}[every node/.style={draw, anchor=text, rectangle split,
rectangle split parts=3}]
@@ -1802,36 +1701,35 @@ these extra boxes, the following key is provided:
{text \nodepart{second} \nodepart{third}third};
\end{tikzpicture}
\end{codeexample}
- \end{key}
-%
- \begin{key}{/pgf/rectangle split empty part width=\meta{length} (initially 1ex)}
- Sets 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 width=\meta{length} (initially 1ex)}
+ Sets 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)}
- Sets 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)}
- Sets 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)}
- Sets the alignment of the boxes inside the node parts.
- 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).
-
- 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{key}{/pgf/rectangle split empty part height=\meta{length} (initially 1ex)}
+ Sets 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)}
+ Sets 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)}
+ Sets the alignment of the boxes inside the node parts. 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).
+
+ 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\x{one \nodepart{two} 2 \nodepart{three} three \nodepart{four} 4}
\begin{tikzpicture}[
@@ -1844,14 +1742,13 @@ these extra boxes, the following key is provided:
\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 make 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.
-
-
+ 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 make 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}[
@@ -1864,35 +1761,31 @@ these extra boxes, the following key is provided:
\node[rectangle split part align=base] at (0,-3.75) {\x};
\end{tikzpicture}
\end{codeexample}
+ \end{key}
- \end{key}
-
- \begin{key}{/pgf/rectangle split draw splits=\opt{\meta{boolean}} (default true)}
- Sets whether the line or lines between node parts will be drawn.
- Internally, this sets the \TeX-if |\ifpgfrectanglesplitdrawsplits|
- appropriately.
- \end{key}
-
- \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
- 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
- |\ifpgfrectanglesplitusecustomfill| appropriately.
- \end{key}
+ \begin{key}{/pgf/rectangle split draw splits=\opt{\meta{boolean}} (default true)}
+ Sets whether the line or lines between node parts will be drawn.
+ Internally, this sets the \TeX-if |\ifpgfrectanglesplitdrawsplits|
+ appropriately.
+ \end{key}
- \begin{key}{/pgf/rectangle split part fill={\ttfamily\char`\{}\meta{list}{\ttfamily\char`\}} (initially white)}
- Sets the custom fill color for each node part shape.
- The items 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{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 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
+ |\ifpgfrectanglesplitusecustomfill| appropriately.
+ \end{key}
+ \begin{key}{/pgf/rectangle split part fill={\ttfamily\char`\{}\meta{list}{\ttfamily\char`\}} (initially white)}
+ Sets the custom fill color for each node part shape. The items 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}}
@@ -1902,22 +1795,21 @@ these extra boxes, the following key is provided:
\node[rectangle split part fill={red!50}] at (2.25,0) {};
\end{tikzpicture}
\end{codeexample}
+ \end{key}
-\end{key}
-
- 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 the 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 the 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,
inner ysep=0.75cm]
{\nodepart{text}text\nodepart{two}two
- \nodepart{three}three\nodepart{four}four};
+ \nodepart{three}three\nodepart{four}four};
\foreach \anchor/\placement in
{text/left, text east/above, text west/above,
two/left, two east/above, two west/above,
@@ -1933,51 +1825,41 @@ these extra boxes, the following key is provided:
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
-
-
+ %
\end{shape}
-
-
-
-
\subsection{Callout Shapes}
\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.
-
+ 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
-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
-minimum size of the shape, and also when positioning anchors.
-
+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 minimum
+size of the shape, and also when positioning anchors.
+%
\begin{codeexample}[]
\begin{tikzpicture}[remember picture]
\node[ellipse callout, draw] (hallo) {Hallo!};
\end{tikzpicture}
\end{codeexample}
-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
-other hand, is much simpler: it points to the specified coordinate
-absolutely (and can even point to named coordinates in different
+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 other hand, is much simpler: it points to the specified
+coordinate absolutely (and can even point to named coordinates in different
pictures).
-
-
+%
\begin{codeexample}[]
\begin{tikzpicture}[remember picture, note/.style={rectangle callout, fill=#1}]
\draw [help lines] grid(3,2);
@@ -1988,85 +1870,72 @@ pictures).
\end{tikzpicture}
\end{codeexample}
-
-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
-on whether they are being used in \pgfname{} or \tikzname{}.
-
+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 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`\}})}
-
- Sets the vector of the callout pointer `relative' to the callout
- shape.
-
+ Sets the vector of the callout pointer `relative' to the callout shape.
\end{key}
\begin{key}{/pgf/callout absolute pointer=\meta{coordinate}}
-
- Sets the vector of the callout pointer absolutely within the picture.
-
+ Sets the vector of the callout pointer absolutely within the picture.
\end{key}
-
-
\begin{key}{/tikz/callout relative pointer=\meta{coordinate} (initially {(315:.5cm)})}
- The \tikzname{} version of the |callout relative pointer| key. Here,
- \meta{coordinate} can be specified using the \tikzname{} format for
- coordinates.
+ The \tikzname{} version of the |callout relative pointer| key. Here,
+ \meta{coordinate} can be specified using the \tikzname{} format for
+ coordinates.
\end{key}
\begin{key}{/tikz/callout absolute pointer=\meta{coordinate}}
- The \tikzname{} version of the |callout absolute pointer| key. Here,
- \meta{coordinate} can be specified using the \tikzname{} format for
- coordinates.
+ The \tikzname{} version of the |callout absolute pointer| key. Here,
+ \meta{coordinate} can be specified using the \tikzname{} format for
+ coordinates.
\end{key}
- It is also possible to shorten the pointer by some distance, using
- the following key:
-
+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)}
- Moves the callout pointer towards the center of the callout's main
- shape by \meta{distance}.
-
+ Moves the callout pointer towards the center of the callout's main shape by
+ \meta{distance}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
- \tikzset{callout/.style={ellipse callout, callout pointer arc=30,
- callout absolute pointer={#1}}}
+ \tikzset{callout/.style={ellipse callout, callout pointer arc=30,
+ 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]
at (0,.5) {B};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
-\begin{shape}{rectangle callout}%
-
- 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
- key:
+\begin{shape}{rectangle callout}
+ 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 key:
+ \begin{key}{/pgf/callout pointer width=\meta{length} (initially .25cm)}
+ Sets the width of the pointer at the border of the rectangle.
+ \end{key}
-\begin{key}{/pgf/callout pointer width=\meta{length} (initially .25cm)}
- Sets 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 to be used to used to position the shape as it is
- calculated whilst the shape is being drawn.
-
+ 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 to 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]
- {Rectangle Callout\vrule width 1pt height 2cm};
+ {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,
@@ -2079,37 +1948,31 @@ on whether they are being used in \pgfname{} or \tikzname{}.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
+\end{shape}
-\end{shape}%
-
-
-\begin{shape}{ellipse callout}%
-
- This shape is a callout whose main shape is an ellipse, which
- tightly fits the node contents (including any |inner sep|).
- It uses the |absolute callout pointer|,
- |relative callout pointer| and |callout pointer shorten| keys, and
- also the following key:
+\begin{shape}{ellipse callout}
+ This shape is a callout whose main shape is an ellipse, which tightly fits
+ the node contents (including any |inner sep|). 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)}
+ Sets the width of the pointer at the border of the ellipse according to
+ an arc of length \meta{angle}.
+ \end{key}
-\begin{key}{/pgf/callout pointer arc=\meta{angle} (initially 15)}
- Sets the width of the 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
- when placing anchors and the |pointer| anchor can only be
- used to position the shape when the relative anchor is
- specified.
-
+ 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 and
+ the |pointer| anchor can only be 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]
- {Ellipse Callout\vrule width 1pt height 2cm};
+ {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,
@@ -2122,17 +1985,15 @@ on whether they are being used in \pgfname{} or \tikzname{}.
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
-
+ %
\end{shape}
-
\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
-result.
-
+ 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,
@@ -2140,46 +2001,43 @@ result.
\end{tikzpicture}
\end{codeexample}
-The |cloud callout| supports the |absolute callout pointer|,
-|relative callout pointer| and |callout pointer shorten| keys, as
-described above.
-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)}
- Sets the size of the first segment in the pointer (i.e., the segment
- nearest the main cloud shape). There are three possible forms for
- \meta{value}:
- \begin{itemize}
- \item
- 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
- $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
- fractions of the width and height of the main shape. The keyword
- |of callout| cannot be omitted.
- \end{itemize}
-\end{key}
-
-\begin{key}{/pgf/callout pointer end size=\meta{value} (initially .1 of callout)}
- Sets the size of the last ellipse in the pointer.
-\end{key}
-
-\begin{key}{/pgf/callout pointer segments=\meta{number} (initially 2)}
- Sets 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
-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.
-
+ The |cloud callout| supports the |absolute callout pointer|,
+ |relative callout pointer| and |callout pointer shorten| keys, as described
+ above. 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)}
+ Sets the size of the first segment in the pointer (i.e., the segment
+ nearest the main cloud shape). There are three possible forms for
+ \meta{value}:
+ %
+ \begin{itemize}
+ \item 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 $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
+ fractions of the width and height of the main shape. The
+ keyword |of callout| cannot be omitted.
+ \end{itemize}
+ \end{key}
+
+ \begin{key}{/pgf/callout pointer end size=\meta{value} (initially .1 of callout)}
+ Sets the size of the last ellipse in the pointer.
+ \end{key}
+
+ \begin{key}{/pgf/callout pointer segments=\meta{number} (initially 2)}
+ Sets 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 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.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -2198,27 +2056,23 @@ of the last segment is drawn at the |pointer| anchor.
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
-\end{codeexample}%
+\end{codeexample}
+ %
\end{shape}
-
-
-
-
-
\subsection{Miscellaneous Shapes}
\begin{pgflibrary}{shapes.misc}
- This library defines general-purpose shapes that do not fit into the
- previous categories.
+ This library defines general-purpose shapes that do not fit into the
+ previous categories.
\end{pgflibrary}
\begin{shape}{cross out}
- This shape ``crosses out'' the node. Its foreground path are simply
- two diagonal lines between the corners of the node's bounding
- box. Here is an example:
-
+ This shape ``crosses out'' the node. Its foreground path are simply two
+ diagonal lines 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);
@@ -2226,13 +2080,15 @@ of the last segment is drawn at the |pointer| anchor.
\end{tikzpicture}
\end{codeexample}
- A useful application is inside text as in the following example:
+ 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:
+ This shape inherits all anchors from the |rectangle| shape, see also the
+ following figure:
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -2248,41 +2104,36 @@ Cross \tikz[baseline] \node [cross out,draw,anchor=text] {me}; out!
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{shape}
\begin{shape}{strike out}
- 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.
-
+ 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!
\end{codeexample}
- See the |cross out| shape for the anchors.
+ See the |cross out| shape for the anchors.
\end{shape}
-
-
-
\begin{shape}{rounded rectangle}
- This shape is a rectangle which can have optionally rounded sides.
-
+ This shape is a rectangle which can have optionally rounded sides.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node[rounded rectangle, draw, fill=red!20]{Hallo};
\end{tikzpicture}
\end{codeexample}
- There are keys to specify how the sides are rounded (to use
- these keys in \tikzname, simply remove the \declare{|/pgf/|} path).
+ There are keys to specify how the sides are rounded (to use these keys in
+ \tikzname, simply remove the \declare{|/pgf/|} path).
-
-\begin{key}{/pgf/rounded rectangle arc length=\meta{angle} (initially 180)}
-
- Sets the length of the arcs for the rounded ends. Recommended values
- for \meta{angle} are between |90| and |180|.
-
+ \begin{key}{/pgf/rounded rectangle arc length=\meta{angle} (initially 180)}
+ Sets the length of the arcs for the rounded ends. Recommended values
+ for \meta{angle} are between |90| and |180|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\matrix[row sep=5pt, every node/.style={draw, rounded rectangle}]{
@@ -2291,44 +2142,43 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
\node[rounded rectangle arc length=90] {90}; \\};
\end{tikzpicture}
\end{codeexample}
+ \end{key}
-\end{key}
-
-\begin{key}{/pgf/rounded rectangle west arc=\meta{arc type} (initially convex)}
- Sets the style of the rounding for the left side. The permitted values
- for \meta{arc type} are |concave|, |convex|, or |none|.
-
+ \begin{key}{/pgf/rounded rectangle west arc=\meta{arc type} (initially convex)}
+ Sets the style of the rounding for the left side. The permitted values
+ for \meta{arc type} are |concave|, |convex|, or |none|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\matrix[row sep=5pt, every node/.style={draw, rounded rectangle}]{
- \node[rounded rectangle west arc=concave] {Concave}; \\
- \node[rounded rectangle west arc=convex] {Convex}; \\
- \node[rounded rectangle left arc=none] {None}; \\};
+ \node[rounded rectangle west arc=concave] {Concave}; \\
+ \node[rounded rectangle west arc=convex] {Convex}; \\
+ \node[rounded rectangle left arc=none] {None}; \\};
\end{tikzpicture}
\end{codeexample}
-\end{key}
+ \end{key}
-\begin{stylekey}{/pgf/rounded rectangle left arc=\meta{arc type}}
- Alternative key for specifying the west arc.
-\end{stylekey}
+ \begin{stylekey}{/pgf/rounded rectangle left arc=\meta{arc type}}
+ Alternative key for specifying the west arc.
+ \end{stylekey}
-\begin{key}{/pgf/rounded rectangle east arc=\meta{arc type} (initially convex)}
- Sets the style of the rounding for the east side.
-\end{key}
+ \begin{key}{/pgf/rounded rectangle east arc=\meta{arc type} (initially convex)}
+ Sets the style of the rounding for the east side.
+ \end{key}
-\begin{stylekey}{/pgf/rounded rectangle right arc=\meta{arc type}}
- Alternative key for specifying the east arc.
-\end{stylekey}
+ \begin{stylekey}{/pgf/rounded rectangle right arc=\meta{arc type}}
+ Alternative key for specifying the east arc.
+ \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
- |center| anchor will not be the precise center of the shape.
-
+ 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 |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]
- {Rounded Rectangle\vrule width 1pt height 2cm};
+ {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,
@@ -2340,14 +2190,12 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
-
+ %
\end{shape}
-
\begin{shape}{chamfered rectangle}
-
- This shape is a rectangle with optionally chamfered corners.
-
+ This shape is a rectangle with optionally chamfered corners.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node[chamfered rectangle, white, fill=red, double=red, draw, very thick]
@@ -2355,12 +2203,12 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
\end{tikzpicture}
\end{codeexample}
- There are \pgfname{} keys to specify how this shape is drawn (to use
- these keys in \tikzname{} simply remove the \declare{|/pgf/|} path).
+ There are \pgfname{} keys to specify how this shape is drawn (to use these
+ keys in \tikzname{} simply remove the \declare{|/pgf/|} path).
-\begin{key}{/pgf/chamfered rectangle angle=\meta{angle} (initially 45)}
- Sets the angle \emph{from the vertical} for the chamfer.
-
+ \begin{key}{/pgf/chamfered rectangle angle=\meta{angle} (initially 45)}
+ Sets the angle \emph{from the vertical} for the chamfer.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\tikzset{every node/.style={chamfered rectangle, draw}}
@@ -2368,16 +2216,15 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
\node[chamfered rectangle angle=60] at (1.5,0) {123};
\end{tikzpicture}
\end{codeexample}
-\end{key}
-
-\begin{key}{/pgf/chamfered rectangle xsep=\meta{length} (initially .666ex)}
- Sets 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
- \meta{length} is ignored and the chamfered edges are drawn so that
- they meet in the middle.
+ \end{key}
+ \begin{key}{/pgf/chamfered rectangle xsep=\meta{length} (initially .666ex)}
+ Sets 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
+ \meta{length} is ignored and the chamfered edges are drawn so that they
+ meet in the middle.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\tikzset{every node/.style={chamfered rectangle, draw}}
@@ -2385,30 +2232,28 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
\node[chamfered rectangle xsep=2cm] at (1.5,0) {456};
\end{tikzpicture}
\end{codeexample}
-
-\end{key}
-
-\begin{key}{/pgf/chamfered rectangle ysep=\meta{length} (initially .666ex)}
- Sets 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}
+ \end{key}
-\begin{key}{/pgf/chamfered rectangle sep=\meta{length} (initially .666ex)}
- Sets both the |xsep| and |ysep| simultaneously.
-\end{key}
+ \begin{key}{/pgf/chamfered rectangle ysep=\meta{length} (initially .666ex)}
+ Sets 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}
-\begin{key}{/pgf/chamfered rectangle corners=\meta{list} (initially chamfer all)}
- Specifies 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
- \meta{list} are automatically not chamfered. Two additional values
- |chamfer all| and |chamfer none|, are also permitted.
+ \begin{key}{/pgf/chamfered rectangle sep=\meta{length} (initially .666ex)}
+ Sets both the |xsep| and |ysep| simultaneously.
+ \end{key}
+ \begin{key}{/pgf/chamfered rectangle corners=\meta{list} (initially chamfer all)}
+ Specifies 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 \meta{list} are automatically not
+ chamfered. Two additional values |chamfer all| and |chamfer none|, are
+ also permitted.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\tikzset{every node/.style={chamfered rectangle, draw}}
@@ -2416,12 +2261,11 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
\node[chamfered rectangle corners={north east, south east}] at (1.5,0) {789};
\end{tikzpicture}
\end{codeexample}
-\end{key}
-
+ \end{key}
- The anchors for this shape are shown below (anchor |60| is an example
- of a border angle.
-
+ The anchors for this shape are shown below (anchor |60| is an example of a
+ border angle.
+ %
\begin{codeexample}[]
\Huge
\begin{tikzpicture}
@@ -2441,11 +2285,10 @@ Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out!
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
-
+ %
\end{shape}
-
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
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
index 3f4aad69293..b20b312e0e8 100644
--- 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
@@ -12,18 +12,18 @@
\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).
+ 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:
-
+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}]
@@ -52,99 +52,100 @@ magnified as if you were looking through a spyglass:
\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.
-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:
+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 you
- 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.
+ \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 you
+ 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:
+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.
+ \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.
-
+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 others. 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|, this is a shortcut for |minimum size|.
- \end{key}
- \begin{key}{/tikz/height=\meta{dimension}}
- Inside a |spy scope|, this is a shortcut for |minimum height|.
- \end{key}
- \begin{key}{/tikz/width=\meta{dimension}}
- Inside a |spy scope|, 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.''
-
+ 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 others. 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|, this is a shortcut for |minimum size|.
+ \end{key}
+ %
+ \begin{key}{/tikz/height=\meta{dimension}}
+ Inside a |spy scope|, this is a shortcut for |minimum height|.
+ \end{key}
+ %
+ \begin{key}{/tikz/width=\meta{dimension}}
+ Inside a |spy scope|, 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,
@@ -164,78 +165,81 @@ computed automatically.
\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}
- \texttt{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 is 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{command}{\spy \opt{\oarg{options}} |on| \meta{coordinate} \texttt{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 is 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}]
@@ -247,32 +251,38 @@ computed automatically.
\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:
+ %
+ 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}
@@ -288,30 +298,32 @@ computed automatically.
\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
+ %
+ \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.
+ \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}]
@@ -323,36 +335,35 @@ computed automatically.
\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|.
+ 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 set up 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.
-
+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 set up 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}]
@@ -363,13 +374,13 @@ and the spy-on nodes in some special way.
\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{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}]
@@ -380,15 +391,14 @@ and the spy-on nodes in some special way.
\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:
+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.
-
+ 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}]
@@ -400,15 +410,16 @@ nodes:
\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:
-
+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={
@@ -428,9 +439,9 @@ spy-on node and the |magnifying glass| shape for the spy-in node:
\end{tikzpicture}
\end{codeexample}
-With the magnifying glass, you can also put it ``on top'' of the
-picture itself:
-
+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},
@@ -445,6 +456,7 @@ picture itself:
\end{tikzpicture}
\end{codeexample}
+
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
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
index ea6b2a73263..120eb1d9a7a 100644
--- 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
@@ -12,37 +12,35 @@
\label{section-library-svg-path}
\begin{pgflibrary}{svg.path}
- This library defines a command that allows you to specify a path
- using the \textsc{svg}-syntax.
+ This library defines a command that allows you to specify a path using the
+ \textsc{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.
+ 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 are, 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,
- neither are arcs spanning degrees that are multiples of
- $90^{\circ}$.
- \item The dimensionless units of \textsc{svg} are always interpreted
- as 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}
+ 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 are,
+ 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ézier curves, both quadratic and cubic, are not affected, neither
+ are arcs spanning degrees that are multiples of $90^{\circ}$.
+ \item The dimensionless units of \textsc{svg} are always interpreted as
+ 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 16\,000 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
@@ -50,9 +48,11 @@
\pgfusepath{stroke}
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
-%%% 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-through.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-through.tex
index 39a0ea04bda..1222d1ec036 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-through.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-through.tex
@@ -9,27 +9,23 @@
\section{Through Library}
-
\label{section-through-library}
-
\begin{tikzlibrary}{through}
- This library defines keys for creating shapes that go through given
- points.
+ This library defines keys for creating shapes that go through given points.
\end{tikzlibrary}
-
\begin{key}{/tikz/circle through=\meta{coordinate}}
-
- When this key is given as an option to a node, the following
- happens:
- \begin{enumerate}
- \item The |inner sep| and the |outer sep| are set to zero.
- \item The shape is set to |circle|.
- \item The |minimum size| is set such that the circle around the
- center of the node (which is specified using |at|), goes through
- \meta{coordinate}.
- \end{enumerate}
+ When this key is given as an option to a node, the following happens:
+ %
+ \begin{enumerate}
+ \item The |inner sep| and the |outer sep| are set to zero.
+ \item The shape is set to |circle|.
+ \item The |minimum size| is set such that the circle around the center
+ of the node (which is specified using |at|), goes through
+ \meta{coordinate}.
+ \end{enumerate}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -37,11 +33,11 @@
\node [draw] at (1,1) [circle through={(a)}] {$c$};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
-%%% 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-trees.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-trees.tex
index 7fd7974023c..92f20809216 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
@@ -9,38 +9,38 @@
\section{Tree Library}
-
\label{section-tree-library}
-
\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 |trees| defines two new growth
-functions. They are installed using the following options:
-
-\begin{key}{/tikz/grow via three points=\texttt{one child at (}\meta{x}%
- \texttt{) and two children at (}\meta{y}\texttt{) and (}\meta{z}|)|}
- This option installs a growth function that works as follows: If a
- parent node has just one child, this child is placed at \meta{x}. If
- the parent node has two children, these are placed at \meta{y} and
- \meta{z}. If the parent node has more than two children, the
- children are placed at points that are linearly extrapolated from
- the three points \meta{x}, \meta{y}, and \meta{z}. In detail, the
- position is $x + \frac{n-1}{2}(y-x) + (c-1)(z-y)$, where $n$ is the
- number of children and $c$ is the number of the current child
- (starting with~$1$).
-
- The net effect of all this is that if you have a certain ``linear
- arrangement'' in mind and use this option to specify the placement
- of a single child and of two children, then any number of children
- will be placed correctly.
-
- Here are some arrangements based on this growth function. We start
- with a simple ``above'' arrangement:
+The package |trees| defines two new growth functions. They are installed using
+the following options:
+
+\begin{key}{/tikz/grow via three points=\texttt{one child at (}\meta{x}
+ \texttt{) and two children at (}\meta{y}\texttt{) and (}\meta{z}|)|%
+}
+ This option installs a growth function that works as follows: If a parent
+ node has just one child, this child is placed at \meta{x}. If the parent
+ node has two children, these are placed at \meta{y} and \meta{z}. If the
+ parent node has more than two children, the children are placed at points
+ that are linearly extrapolated from the three points \meta{x}, \meta{y},
+ and \meta{z}. In detail, the position is $x + \frac{n-1}{2}(y-x) +
+ (c-1)(z-y)$, where $n$ is the number of children and $c$ is the number of
+ the current child (starting with~$1$).
+
+ The net effect of all this is that if you have a certain ``linear
+ arrangement'' in mind and use this option to specify the placement of a
+ single child and of two children, then any number of children will be
+ placed correctly.
+
+ Here are some arrangements based on this growth function. We start with a
+ simple ``above'' arrangement:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[grow via three points={%
one child at (0,1) and two children at (-.5,1) and (.5,1)}]
@@ -51,8 +51,9 @@ functions. They are installed using the following options:
\end{tikzpicture}
\end{codeexample}
- The next arrangement places children above, but ``grows only to the
- right.''
+ The next arrangement places children above, but ``grows only to the
+ right''.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[grow via three points={%
one child at (0,1) and two children at (0,1) and (1,1)}]
@@ -63,8 +64,8 @@ functions. They are installed using the following options:
\end{tikzpicture}
\end{codeexample}
- In the final arrangement, the children are placed along a line going
- down and right.
+ In the final arrangement, the children are placed along a line going down
+ and right.
\begin{codeexample}[]
\begin{tikzpicture}[grow via three points={%
one child at (-1,-.5) and two children at (-1,-.5) and (0,-.75)}]
@@ -75,22 +76,24 @@ functions. They are installed using the following options:
\end{tikzpicture}
\end{codeexample}
- These examples should make it clear how you can create new styles to
- arrange your children along a line.
+ These examples should make it clear how you can create new styles to
+ arrange your children along a line.
\end{key}
\begin{key}{/tikz/grow cyclic}
- This style causes the children to be arranged ``on a circle.'' For
- this, the children are placed at distance |\tikzleveldistance| from
- the parent node, but not on a straight line, but on points on a
- circle. Instead of a sibling distance, there is a |sibling angle|
- that denotes the angle between two given children.
- \begin{key}{/tikz/sibling angle=\meta{angle}}
- Sets the angle between siblings in the |grow cyclic| style.
- \end{key}
- Note that this function will rotate the coordinate system of the
- children to ensure that the grandchildren will grow in the right
- direction.
+ This style causes the children to be arranged ``on a circle''. For this,
+ the children are placed at distance |\tikzleveldistance| from the parent
+ node, but not on a straight line, but on points on a circle. Instead of a
+ sibling distance, there is a |sibling angle| that denotes the angle between
+ two given children.
+ %
+ \begin{key}{/tikz/sibling angle=\meta{angle}}
+ Sets the angle between siblings in the |grow cyclic| style.
+ \end{key}
+ %
+ Note that this function will rotate the coordinate system of the children
+ to ensure that the grandchildren will grow in the right direction.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[grow cyclic,
@@ -103,18 +106,20 @@ functions. They are installed using the following options:
{child foreach \x in {1,2,3}}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/clockwise from=\meta{angle}}
- 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.
-
- Note that this function will not rotate the coordinate system.
+ 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.
+
+ Note that this function will not rotate the coordinate system.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node {root}
@@ -125,22 +130,25 @@ functions. They are installed using the following options:
child {node {$-60$}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/counterclockwise from=\meta{angle}}
- Works the same way as |clockwise from|, but sibling angles are added
- instead of subtracted.
+ Works the same way as |clockwise from|, but sibling angles are added
+ instead of subtracted.
\end{key}
+
\subsection{Edges From Parent}
-The following styles can be used to modify how the edges from parents
-are drawn:
+The following styles can be used to modify how the edges from parents 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.
+ 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node {root}
@@ -152,11 +160,13 @@ are drawn:
};
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/edge from parent fork right}
- This style behaves similarly, only it will first draw its edge to
- the right.
+ This style behaves similarly, only it will first draw its edge to the
+ right.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node {root}
@@ -168,14 +178,15 @@ are drawn:
};
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/edge from parent fork left}
- Behaves similarly to the previous styles.
+ Behaves similarly to the previous styles.
\end{stylekey}
\begin{stylekey}{/tikz/edge from parent fork up}
- Behaves similarly to the previous styles.
+ Behaves similarly to the previous styles.
\end{stylekey}
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
index 46198942e5a..6c1187e0c33 100644
--- 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
@@ -7,97 +7,101 @@
%
% 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.
+ 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.
+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 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.
+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|.
+ 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.
+ 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 set up the |to path| used by turtles. By setting
- this style you can change the to-path:
+ 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 set up 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{codeexample}
+ \end{stylekey}
\end{key}
\begin{key}{/tikz/turtle/fd}
- An abbreviation for the |forward| key.
+ 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.
+ 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.
+ 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.
+ Turns the turtle left by the given angle.
\end{key}
\begin{key}{/tikz/turtle/lt}
- An abbreviation for the |left| key.
+ 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.
+ Turns the turtle right by the given angle.
\end{key}
\begin{key}{/tikz/turtle/rt}
- An abbreviation for the |right| key.
+ An abbreviation for the |right| key.
\end{key}
Turtle graphics are especially nice in conjunction with the |\foreach|
@@ -111,8 +115,3 @@ statement:
[turtle={forward,right=144}]
};
\end{codeexample}
-
-\endinput
-
-
-
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-views.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-views.tex
new file mode 100644
index 00000000000..c7724e72c47
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-views.tex
@@ -0,0 +1,127 @@
+% Copyright 2016 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{Views Library}
+\label{section-library-views}
+
+\begin{tikzlibrary}{views}
+ This library is used for creating \emph{views}, which are transformations
+ of a part of a picture so that this part ``fits'' into a ``viewbox''.
+ Mostly, views are useful in conjunction with animations.
+\end{tikzlibrary}
+
+A \emph{view} is essentially a ``window'' through which you see a graphic. To
+establish a view, you specify a rectangle -- which is the window -- and another
+rectangle surrounding the to-be-viewed graphic. The graphic will then be
+rescaled and shifted in such a way that the to-be-viewed rectangle matches the
+view's rectangle as well as possible. Note that establishing a view causes a
+\emph{canvas} transformation to be installed, not a coordinate transformation.
+
+View boxes are only seldom needed in normal graphics; you may prefer to use
+coordinate transformations or the |spy| library. Their main application is with
+animations since you can \emph{animate} the to-be-viewed rectangle. This makes
+it easy to create animations in which you zoom in, zoom out, and pan a graphic.
+
+\begin{key}{/tikz/meet=\meta{to-be-viewed corner}
+ \opt{|rectangle|} \meta{to-be-viewed corner} \opt{|at|
+ \meta{window corner} |rectangle| \meta{window corner}}%
+}
+ Use this key with a scope to establish a view for the scope. In the
+ argument to the |meet| key, both |rectangle| texts are optional. Also,
+ everything following |at| is optional; when it is missing, the \meta{window
+ corner}s are assumed to be the same as the \meta{to-be-viewed corner}s. The
+ latter are two corners of a rectangle that should be transformed in such a
+ way that it fits inside the rectangle described by the two window corners.
+
+ More precisely, at the beginning of the scope a canvas transformation is
+ installed that scales and translates the canvas is such a way that
+ %
+ \begin{enumerate}
+ \item the center of the to-be-viewed rectangle lies at the center of
+ the window rectangle and
+ \item the to-be-viewed rectangle has maximum size that it still fits
+ inside the window rectangle.
+ \end{enumerate}
+ %
+\begin{codeexample}[]
+\tikz {
+ \draw [red, very thick] (0,0) rectangle (20mm,20mm);
+ \begin{scope}[meet = {(0.5,0.5) (2.5,1.5) at (0,0) (2,2)}]
+ \draw [blue, very thick] (5mm,5mm) rectangle (25mm,15mm);
+ \draw [thick] (1,1) circle [x radius=5mm, y radius=10mm] node {Hi};
+ \end{scope} }
+\end{codeexample}
+ %
+\begin{codeexample}[]
+\tikz {
+ \draw [red, very thick] (0,0) rectangle (20mm,20mm);
+ \begin{scope}[slice = {(0.5,0.5) (2.5,1.5) at (0,0) (2,2)}]
+ \draw [blue, very thick] (5mm,5mm) rectangle (25mm,15mm);
+ \draw [thick] (1,1) circle [x radius=5mm, y radius=10mm] node {Hi};
+ \end{scope} }
+\end{codeexample}
+
+ As mentioned earlier, the main use of views is in conjunction with
+ animations. In order to animate a view, you specify the scope containing
+ the |meet| command as the target object and then animate its |:view|
+ attribute:
+ %
+\begin{codeexample}[]
+\tikz [animate = {
+ my scope:view = {
+ begin on = { click, of next = here },
+ 0s = "{(0.5,0.5) (2.5,1.5)}",
+ 2s = "{(0.5,0) (1.5,2)}", forever
+ }}] {
+ \draw [red, fill=red!20, very thick, name=here]
+ (0,0) rectangle (20mm,20mm);
+ \begin{scope}[name = my scope,
+ meet = {(0.5,0.5) (2.5,1.5) at (0,0) (2,2)}]
+ \draw [blue, very thick] (5mm,5mm) rectangle (25mm,15mm);
+ \draw [thick] (1,1) circle [x radius=5mm, y radius=10mm] node {Hi};
+ \end{scope} }
+\end{codeexample}
+ %
+ You can, of course, also specify the animation using the |animate myself:|
+ key when you specify the animation inside the scope:
+ %
+\begin{codeexample}[]
+\tikz [animate = {
+ my scope:view = {
+ }}] {
+ \draw [red, fill=red!20, very thick, name=here]
+ (0,0) rectangle (20mm,20mm);
+ \begin{scope}[animate = { myself: = { :view = {
+ begin on = { click, of = here },
+ 0s = "{(0.5,0.5) (2.5,1.5)}",
+ 2s = "{(0.5,0) (1.5,2)}", forever }}},
+ slice = {(0.5,0.5) (2.5,1.5) at (0,0) (2,2)}]
+ \draw [blue, very thick] (5mm,5mm) rectangle (25mm,15mm);
+ \draw [thick] (1,1) circle [x radius=5mm, y radius=10mm] node {Hi};
+ \end{scope} }
+\end{codeexample}
+ %
+\end{key}
+
+\begin{key}{/tikz/view}
+ This is an alias for |/tikz/meet|.
+\end{key}
+
+\begin{key}{/tikz/slice=\meta{to-be-viewed corner}
+ \opt{|rectangle|} \meta{to-be-viewed corner} \opt{|at|
+ \meta{window corner} |rectangle| \meta{window corner}}%
+}
+ This key works exactly like |meet|, only the second rule is changed:
+ %
+ \begin{enumerate}
+ \item[$2'$.] the to-be-viewed rectangle has minimal size that it
+ encompasses all of the window rectangle.
+ \end{enumerate}
+\end{key}
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 14a3179e8e5..c78b5f85ce4 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
@@ -11,354 +11,327 @@
\section{Licenses and Copyright}
\label{section-license}
-
\subsection{Which License Applies?}
-Different parts of the \pgfname\ package are distributed under
-different licenses:
-
+Different parts of the \pgfname\ package are distributed under different
+licenses:
+%
\begin{enumerate}
-\item The \emph{code} of the package is dual-license. This means that
- you can decide which license you wish to use when using the
- \pgfname\ package. The two options are:
- \begin{enumerate}
- \item You can use the \textsc{gnu} Public License, version 2.
- \item You can use the \LaTeX\ Project Public License, version 1.3c.
- \end{enumerate}
-\item The \emph{documentation} of the package is also dual-license. Again,
- you can choose between two options:
- \begin{enumerate}
- \item You can use the \textsc{gnu} Free Documentation License, version 1.2.
- \item You can use the \LaTeX\ Project Public License, version 1.3c.
- \end{enumerate}
+ \item The \emph{code} of the package is dual-license. This means that you
+ can decide which license you wish to use when using the \pgfname\
+ package. The two options are:
+ %
+ \begin{enumerate}
+ \item You can use the \textsc{gnu} Public License, version 2.
+ \item You can use the \LaTeX\ Project Public License, version
+ 1.3c.
+ \end{enumerate}
+ \item The \emph{documentation} of the package is also dual-license.
+ Again, you can choose between two options:
+ %
+ \begin{enumerate}
+ \item You can use the \textsc{gnu} Free Documentation License,
+ version 1.2.
+ \item You can use the \LaTeX\ Project Public License, version
+ 1.3c.
+ \end{enumerate}
\end{enumerate}
-The ``documentation of the package'' refers to all files in the
-subdirectory |doc| of the |pgf| package. A detailed listing can be
-found in the file |doc/generic/pgf/licenses/manifest-documentation.txt|.
-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|.
+The ``documentation of the package'' refers to all files in the subdirectory
+|doc| of the |pgf| package. A detailed listing can be found in the file
+|doc/generic/pgf/licenses/manifest-documentation.txt|. 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 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.
+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.
-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.''
+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.''
\subsection{The GNU Public License, Version 2}
\subsubsection{Preamble}
-The licenses for most software are designed to take away your freedom to
-share and change it. By contrast, the \textsc{gnu} General Public License is
-intended to guarantee your freedom to share and change free software---to
-make sure the software is free for all its users. This General Public
-License applies to most of the Free Software Foundation's software and to
-any other program whose authors commit to using it. (Some other Free
-Software Foundation software is covered by the \textsc{gnu} Library
-General Public License instead.) You can apply it to your programs, too.
-
-When we speak of free software, we are referring to freedom, not price.
-Our General Public Licenses are designed to make sure that you have the
-freedom to distribute copies of free software (and charge for this service
-if you wish), that you receive source code or can get it if you want it,
-that you can change the software or use pieces of it in new free programs;
-and that you know you can do these things.
-
-To protect your rights, we need to make restrictions that forbid anyone to
-deny you these rights or to ask you to surrender the rights. These
-restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-For example, if you distribute copies of such a program, whether gratis or
-for a fee, you must give the recipients all the rights that you have. You
-must make sure that they, too, receive or can get the source code. And
-you must show them these terms so they know their rights.
+The licenses for most software are designed to take away your freedom to share
+and change it. By contrast, the \textsc{gnu} General Public License is
+intended to guarantee your freedom to share and change free software---to make
+sure the software is free for all its users. This General Public License
+applies to most of the Free Software Foundation's software and to any other
+program whose authors commit to using it. (Some other Free Software Foundation
+software is covered by the \textsc{gnu} Library General Public License
+instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our
+General Public Licenses are designed to make sure that you have the freedom to
+distribute copies of free software (and charge for this service if you wish),
+that you receive source code or can get it if you want it, that you can change
+the software or use pieces of it in new free programs; and that you know you
+can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny
+you these rights or to ask you to surrender the rights. These restrictions
+translate to certain responsibilities for you if you distribute copies of the
+software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for
+a fee, you must give the recipients all the rights that you have. You must
+make sure that they, too, receive or can get the source code. And you must
+show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2)
-offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
+offer you this license which gives you legal permission to copy, distribute
+and/or modify the software.
Also, for each author's protection and ours, we want to make certain that
-everyone understands that there is no warranty for this free software. If
-the software is modified by someone else and passed on, we want its
-recipients to know that what they have is not the original, so that any
-problems introduced by others will not reflect on the original authors'
-reputations.
-
-Finally, any free program is threatened constantly by software patents.
-We wish to avoid the danger that redistributors of a free program will
-individually obtain patent licenses, in effect making the program
-proprietary. To prevent this, we have made it clear that any patent must
-be licensed for everyone's free use or not licensed at all.
-
-The precise terms and conditions for copying, distribution and
-modification follow.
-
-\subsubsection{Terms and Conditions For Copying, Distribution and
- Modification}
-
-\begin{enumerate}
-
-\addtocounter{enumi}{-1}
-
-\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
-any such program or work, and a ``work based on the Program'' means either
-the Program or any derivative work under copyright law: that is to say, a
-work containing the Program or a portion of it, either verbatim or with
-modifications and/or translated into another language. (Hereinafter,
-translation is included without limitation in the term ``modification''.)
-Each licensee is addressed as ``you''.
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-\item You may copy and distribute verbatim copies of the Program's source
- code as you receive it, in any medium, provided that you conspicuously
- and appropriately publish on each copy an appropriate copyright notice
- and disclaimer of warranty; keep intact all the notices that refer to
- this License and to the absence of any warranty; and give any other
- recipients of the Program a copy of this License along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and you
-may at your option offer warranty protection in exchange for a fee.
-
-\item
-You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-\begin{enumerate}
-
-\item
-You must cause the modified files to carry prominent notices stating that
-you changed the files and the date of any change.
-
-\item
-You must cause any work that you distribute or publish, that in
-whole or in part contains or is derived from the Program or any
-part thereof, to be licensed as a whole at no charge to all third
-parties under the terms of this License.
-
-\item
-If the modified program normally reads commands interactively
-when run, you must cause it, when started running for such
-interactive use in the most ordinary way, to print or display an
-announcement including an appropriate copyright notice and a
-notice that there is no warranty (or else, saying that you provide
-a warranty) and that users may redistribute the program under
-these conditions, and telling the user how to view a copy of this
-License. (Exception: if the Program itself is interactive but
-does not normally print such an announcement, your work based on
-the Program is not required to print an announcement.)
-
-\end{enumerate}
-
+everyone understands that there is no warranty for this free software. If the
+software is modified by someone else and passed on, we want its recipients to
+know that what they have is not the original, so that any problems introduced
+by others will not reflect on the original authors' reputations.
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
+Finally, any free program is threatened constantly by software patents. We wish
+to avoid the danger that redistributors of a free program will individually
+obtain patent licenses, in effect making the program proprietary. To prevent
+this, we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
+The precise terms and conditions for copying, distribution and modification
+follow.
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-\item
-You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
+\subsubsection{Terms and Conditions For Copying, Distribution and Modification}
\begin{enumerate}
-
-\item
-Accompany it with the complete corresponding machine-readable
-source code, which must be distributed under the terms of Sections
-1 and 2 above on a medium customarily used for software interchange; or,
-
-\item
-Accompany it with a written offer, valid for at least three
-years, to give any third party, for a charge no more than your
-cost of physically performing source distribution, a complete
-machine-readable copy of the corresponding source code, to be
-distributed under the terms of Sections 1 and 2 above on a medium
-customarily used for software interchange; or,
-
-\item
-Accompany it with the information you received as to the offer
-to distribute corresponding source code. (This alternative is
-allowed only for noncommercial distribution and only if you
-received the program in object code or executable form with such
-an offer, in accord with Subsubsection b above.)
-
+ \addtocounter{enumi}{-1}
+ \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 any such program or work, and a ``work based on the
+ Program'' means either the Program or any derivative work under
+ copyright law: that is to say, a work containing the Program or a
+ portion of it, either verbatim or with modifications and/or
+ translated into another language. (Hereinafter, translation is
+ included without limitation in the term ``modification''.) Each
+ licensee is addressed as ``you''.
+
+ Activities other than copying, distribution and modification are not
+ covered by this License; they are outside its scope. The act of
+ running the Program is not restricted, and the output from the
+ Program is covered only if its contents constitute a work based on
+ the Program (independent of having been made by running the Program).
+ Whether that is true depends on what the Program does.
+ \item You may copy and distribute verbatim copies of the Program's source
+ code as you receive it, in any medium, provided that you
+ conspicuously and appropriately publish on each copy an appropriate
+ copyright notice and disclaimer of warranty; keep intact all the
+ notices that refer to this License and to the absence of any
+ warranty; and give any other recipients of the Program a copy of this
+ License along with the Program.
+
+ You may charge a fee for the physical act of transferring a copy, and
+ you may at your option offer warranty protection in exchange for a
+ fee.
+ \item You may modify your copy or copies of the Program or any portion of
+ it, thus forming a work based on the Program, and copy and distribute
+ such modifications or work under the terms of Section 1 above,
+ provided that you also meet all of these conditions:
+ %
+ \begin{enumerate}
+ \item You must cause the modified files to carry prominent
+ notices stating that you changed the files and the date of
+ any change.
+ \item You must cause any work that you distribute or publish,
+ that in whole or in part contains or is derived from the
+ Program or any part thereof, to be licensed as a whole at
+ no charge to all third parties under the terms of this
+ License.
+ \item If the modified program normally reads commands
+ interactively when run, you must cause it, when started
+ running for such interactive use in the most ordinary way,
+ to print or display an announcement including an
+ appropriate copyright notice and a notice that there is no
+ warranty (or else, saying that you provide a warranty) and
+ that users may redistribute the program under these
+ conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive
+ but does not normally print such an announcement, your work
+ based on the Program is not required to print an
+ announcement.)
+ \end{enumerate}
+ %
+ These requirements apply to the modified work as a whole. If
+ identifiable sections of that work are not derived from the Program,
+ and can be reasonably considered independent and separate works in
+ themselves, then this License, and its terms, do not apply to those
+ sections when you distribute them as separate works. But when you
+ distribute the same sections as part of a whole which is a work based
+ on the Program, the distribution of the whole must be on the terms of
+ this License, whose permissions for other licensees extend to the
+ entire whole, and thus to each and every part regardless of who wrote
+ it.
+
+ Thus, it is not the intent of this section to claim rights or contest
+ your rights to work written entirely by you; rather, the intent is to
+ exercise the right to control the distribution of derivative or
+ collective works based on the Program.
+
+ In addition, mere aggregation of another work not based on the
+ Program with the Program (or with a work based on the Program) on a
+ volume of a storage or distribution medium does not bring the other
+ work under the scope of this License.
+ \item You may copy and distribute the Program (or a work based on it,
+ under Section~2) in object code or executable form under the terms of
+ Sections~1 and 2 above provided that you also do one of the
+ following:
+ %
+ \begin{enumerate}
+ \item Accompany it with the complete corresponding
+ machine-readable source code, which must be distributed
+ under the terms of Sections~1 and 2 above on a medium
+ customarily used for software interchange; or,
+ \item Accompany it with a written offer, valid for at least
+ three years, to give any third party, for a charge no more
+ than your cost of physically performing source
+ distribution, a complete machine-readable copy of the
+ corresponding source code, to be distributed under the
+ terms of Sections~1 and 2 above on a medium customarily
+ used for software interchange; or,
+ \item Accompany it with the information you received as to the
+ offer to distribute corresponding source code. (This
+ alternative is allowed only for noncommercial distribution
+ and only if you received the program in object code or
+ executable form with such an offer, in accord with
+ Subsubsection~b above.)
+ \end{enumerate}
+ %
+ The source code for a work means the preferred form of the work for
+ making modifications to it. For an executable work, complete source
+ code means all the source code for all modules it contains, plus any
+ associated interface definition files, plus the scripts used to
+ control compilation and installation of the executable. However, as
+ a special exception, the source code distributed need not include
+ anything that is normally distributed (in either source or binary
+ form) with the major components (compiler, kernel, and so on) of the
+ operating system on which the executable runs, unless that component
+ itself accompanies the executable.
+
+ If distribution of executable or object code is made by offering
+ access to copy from a designated place, then offering equivalent
+ access to copy the source code from the same place counts as
+ distribution of the source code, even though third parties are not
+ compelled to copy the source along with the object code.
+ \item You may not copy, modify, sublicense, or distribute the Program
+ except as expressly provided under this License. Any attempt
+ otherwise to copy, modify, sublicense or distribute the Program is
+ void, and will automatically terminate your rights under this
+ License. However, parties who have received copies, or rights, from
+ you under this License will not have their licenses terminated so
+ long as such parties remain in full compliance.
+ \item You are not required to accept this License, since you have not
+ signed it. However, nothing else grants you permission to modify or
+ distribute the Program or its derivative works. These actions are
+ prohibited by law if you do not accept this License. Therefore, by
+ modifying or distributing the Program (or any work based on the
+ Program), you indicate your acceptance of this License to do so, and
+ all its terms and conditions for copying, distributing or modifying
+ the Program or works based on it.
+ \item Each time you redistribute the Program (or any work based on the
+ Program), the recipient automatically receives a license from the
+ original licensor to copy, distribute or modify the Program subject
+ to these terms and conditions. You may not impose any further
+ restrictions on the recipients' exercise of the rights granted
+ herein. You are not responsible for enforcing compliance by third
+ parties to this License.
+ \item If, as a consequence of a court judgment or allegation of patent
+ infringement or for any other reason (not limited to patent issues),
+ conditions are imposed on you (whether by court order, agreement or
+ otherwise) that contradict the conditions of this License, they do
+ not excuse you from the conditions of this License. If you cannot
+ distribute so as to satisfy simultaneously your obligations under
+ this License and any other pertinent obligations, then as a
+ consequence you may not distribute the Program at all. For example,
+ if a patent license would not permit royalty-free redistribution of
+ the Program by all those who receive copies directly or indirectly
+ through you, then the only way you could satisfy both it and this
+ License would be to refrain entirely from distribution of the
+ Program.
+
+ If any portion of this section is held invalid or unenforceable under
+ any particular circumstance, the balance of the section is intended
+ to apply and the section as a whole is intended to apply in other
+ circumstances.
+
+ It is not the purpose of this section to induce you to infringe any
+ patents or other property right claims or to contest validity of any
+ such claims; this section has the sole purpose of protecting the
+ integrity of the free software distribution system, which is
+ implemented by public license practices. Many people have made
+ generous contributions to the wide range of software distributed
+ through that system in reliance on consistent application of that
+ system; it is up to the author/donor to decide if he or she is
+ willing to distribute software through any other system and a
+ licensee cannot impose that choice.
+
+ This section is intended to make thoroughly clear what is believed to
+ be a consequence of the rest of this License.
+ \item If the distribution and/or use of the Program is restricted in
+ certain countries either by patents or by copyrighted interfaces, the
+ original copyright holder who places the Program under this License
+ may add an explicit geographical distribution limitation excluding
+ those countries, so that distribution is permitted only in or among
+ countries not thus excluded. In such case, this License incorporates
+ the limitation as if written in the body of this License.
+ \item The Free Software Foundation may publish revised and/or new
+ versions of the General Public License from time to time. Such new
+ versions will be similar in spirit to the present version, but may
+ differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+ Program specifies a version number of this License which applies to
+ it and ``any later version'', you have the option of following the
+ terms and conditions either of that version or of any later version
+ published by the Free Software Foundation. If the Program does not
+ specify a version number of this License, you may choose any version
+ ever published by the Free Software Foundation.
+ \item If you wish to incorporate parts of the Program into other free
+ programs whose distribution conditions are different, write to the
+ author to ask for permission. For software which is copyrighted by
+ the Free Software Foundation, write to the Free Software Foundation;
+ we sometimes make exceptions for this. Our decision will be guided
+ by the two goals of preserving the free status of all derivatives of
+ our free software and of promoting the sharing and reuse of software
+ generally.
\end{enumerate}
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-\item
-You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-\item
-You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-\item
-Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-\item
-If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-\item
-If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-\item
-The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and ``any
-later version'', you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-\item
-If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-\end{enumerate}
-
\subsubsection{No Warranty}
\begin{enumerate}
-
-\addtocounter{enumi}{9}
-
-\item
-Because the program is licensed free of charge, there is no warranty
-for the program, to the extent permitted by applicable law. Except when
-otherwise stated in writing the copyright holders and/or other parties
-provide the program ``as is'' without warranty of any kind, either expressed
-or implied, including, but not limited to, the implied warranties of
-merchantability and fitness for a particular purpose. The entire risk as
-to the quality and performance of the program is with you. Should the
-program prove defective, you assume the cost of all necessary servicing,
-repair or correction.
-
-\item
-In no event unless required by applicable law or agreed to in writing
-will any copyright holder, or any other party who may modify and/or
-redistribute the program as permitted above, be liable to you for damages,
-including any general, special, incidental or consequential damages arising
-out of the use or inability to use the program (including but not limited
-to loss of data or data being rendered inaccurate or losses sustained by
-you or third parties or a failure of the program to operate with any other
-programs), even if such holder or other party has been advised of the
-possibility of such damages.
+ \addtocounter{enumi}{9}
+ \item Because the program is licensed free of charge, there is no
+ warranty for the program, to the extent permitted by applicable law.
+ Except when otherwise stated in writing the copyright holders and/or
+ other parties provide the program ``as is'' without warranty of any
+ kind, either expressed or implied, including, but not limited to, the
+ implied warranties of merchantability and fitness for a particular
+ purpose. The entire risk as to the quality and performance of the
+ program is with you. Should the program prove defective, you assume
+ the cost of all necessary servicing, repair or correction.
+ \item In no event unless required by applicable law or agreed to in
+ writing will any copyright holder, or any other party who may modify
+ and/or redistribute the program as permitted above, be liable to you
+ for damages, including any general, special, incidental or
+ consequential damages arising out of the use or inability to use the
+ program (including but not limited to loss of data or data being
+ rendered inaccurate or losses sustained by you or third parties or a
+ failure of the program to operate with any other programs), even if
+ such holder or other party has been advised of the possibility of
+ such damages.
\end{enumerate}
@@ -371,7 +344,7 @@ possibility of such damages.
% The file lppl.tex, some minor typographic changes:
%
-% $Id: pgfmanual-en-license.tex,v 1.5 2010/10/12 14:32:38 ludewich Exp $
+% $Id$
%
% Copyright 1999 2002-2006 LaTeX3 Project
% Everyone is allowed to distribute verbatim copies of this
@@ -432,383 +405,368 @@ possibility of such damages.
\begin{LPPLicense}
- \providecommand{\LPPLsection}{\section*}
- \providecommand{\LPPLsubsection}{\subsection*}
- \providecommand{\LPPLsubsubsection}{\subsubsection*}
- \providecommand{\LPPLparagraph}{\paragraph*}
- \providecommand*{\LPPLfile}[1]{\texttt{#1}}
- \providecommand*{\LPPLdocfile}[1]{`\LPPLfile{#1.tex}'}
- \providecommand*{\LPPL}{\textsc{lppl}}
-
- \LPPLsection{The \LaTeX\ Project Public License, Version 1.3c 2006-05-20}
- \label{LPPL:LPPL}
-
-% \textbf{Copyright 1999, 2002--2006 \LaTeX3 Project}
-% \begin{quotation}
-% Everyone is allowed to distribute verbatim copies of this
-% license document, but modification of it is not allowed.
-% \end{quotation}
+ \providecommand{\LPPLsection}{\section*}
+ \providecommand{\LPPLsubsection}{\subsection*}
+ \providecommand{\LPPLsubsubsection}{\subsubsection*}
+ \providecommand{\LPPLparagraph}{\paragraph*}
+ \providecommand*{\LPPLfile}[1]{\texttt{#1}}
+ \providecommand*{\LPPLdocfile}[1]{`\LPPLfile{#1.tex}'}
+ \providecommand*{\LPPL}{\textsc{lppl}}
+
+ \LPPLsection{The \LaTeX\ Project Public License, Version 1.3c 2006-05-20}
+ \label{LPPL:LPPL}
+
+% \textbf{Copyright 1999, 2002--2006 \LaTeX3 Project}
+% \begin{quotation}
+% Everyone is allowed to distribute verbatim copies of this
+% license document, but modification of it is not allowed.
+% \end{quotation}
+
+ \LPPLsubsection{Preamble}
+ \label{LPPL:Preamble}
+
+ The \LaTeX\ Project Public License (\LPPL) is the primary license 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 it even if your work is unrelated to \TeX.
+
+ The section `\textsc{whether and how to distribute works under this
+ license}', below, gives instructions, examples, and recommendations for
+ authors who are considering distributing their works under this license.
+
+ This license gives conditions under which a work may be distributed and
+ modified, as well as conditions under which modified versions of that work
+ may be distributed.
+
+ We, the \LaTeX3 Project, believe that the conditions below give you the
+ freedom to make and distribute modified versions of your work that conform
+ with whatever technical specifications you wish while maintaining the
+ availability, integrity, and reliability of that work. If you do not see
+ how to achieve your goal while meeting these conditions, then read the
+ document \LPPLdocfile{cfgguide} and \LPPLdocfile{modguide} in the base
+ \LaTeX\ distribution for suggestions.
+
+
+ \LPPLsubsection{Definitions}
+ \label{LPPL:Definitions}
+
+ In this license document the following terms are used:
+
+ \begin{description}
+ \item[Work] Any work being distributed under this License.
+ \item[Derived Work] Any work that under any applicable law is
+ derived from the Work.
+ \item[Modification] Any procedure that produces a Derived Work under
+ any applicable law -- for example, the production of a file
+ containing an original file associated with the Work or a
+ significant portion of such a file, either verbatim or with
+ modifications and/or translated into another language.
+ \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 Work
+ accessible by file transfer protocols such as \textsc{ftp} or
+ \textsc{http} or by shared file systems such as Sun's Network File
+ System (\textsc{nfs}).
+ \item[Compiled Work] A version of the Work that has been processed
+ into a form where it is directly usable on a computer system.
+ This processing may include using installation facilities provided
+ by the Work, transformations of the Work, copying of components of
+ the Work, or other activities. Note that modification of any
+ installation facilities provided by the Work constitutes
+ modification of the Work.
+ \item[Current Maintainer] A person or persons nominated as such
+ within the Work. If there is no such explicit nomination then it
+ is the `Copyright Holder' under any applicable law.
+ \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
+ interactively. Unless explicitly specified when applying the
+ license to the Work, the only applicable Base Interpreter is a
+ `\LaTeX-Format' or in the case of files belonging to the
+ `\LaTeX-format' a program implementing the `\TeX{} language'.
+ \end{description}
+
+
+ \LPPLsubsection{Conditions on Distribution and Modification}
+ \label{LPPL:Conditions}
- \LPPLsubsection{Preamble}
- \label{LPPL:Preamble}
-
- The \LaTeX\ Project Public License (\LPPL) is the primary license
- 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
- it even if your work is unrelated to \TeX.
-
- The section `\textsc{whether and how to distribute works under this
- license}', below, gives instructions, examples, and
- recommendations
- for authors who are considering distributing their works under this
- license.
-
- This license gives conditions under which a work may be distributed
- and modified, as well as conditions under which modified versions of
- that work may be distributed.
-
- We, the \LaTeX3 Project, believe that the conditions below give you
- the freedom to make and distribute modified versions of your work
- that conform with whatever technical specifications you wish while
- maintaining the availability, integrity, and reliability of that
- work. If you do not see how to achieve your goal while meeting
- these conditions, then read the document \LPPLdocfile{cfgguide} and
- \LPPLdocfile{modguide} in the base \LaTeX\ distribution for suggestions.
-
-
- \LPPLsubsection{Definitions}
- \label{LPPL:Definitions}
-
- In this license document the following terms are used:
-
- \begin{description}
- \item[Work] Any work being distributed under this License.
-
- \item[Derived Work] Any work that under any applicable law is
- derived from the Work.
-
- \item[Modification] Any procedure that produces a Derived Work under
- any applicable law -- for example, the production of a file
- containing an original file associated with the Work or a
- significant portion of such a file, either verbatim or with
- modifications and/or translated into another language.
-
- \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
- Work accessible by file transfer protocols such as \textsc{ftp} or
- \textsc{http} or by shared file systems such as Sun's Network File
- System (\textsc{nfs}).
-
- \item[Compiled Work] A version of the Work that has been processed
- into a form where it is directly usable on a computer system.
- This processing may include using installation facilities provided
- by the Work, transformations of the Work, copying of components of
- the Work, or other activities. Note that modification of any
- installation facilities provided by the Work constitutes
- modification of the Work.
-
- \item[Current Maintainer] A person or persons nominated as such
- within the Work. If there is no such explicit nomination then it
- is the `Copyright Holder' under any applicable law.
-
- \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
- interactively. Unless explicitly specified when applying the
- license to the Work, the only applicable Base Interpreter is a
- `\LaTeX-Format' or in the case of files belonging to the
- `\LaTeX-format' a program implementing the `\TeX{} language'.
- \end{description}
-
- \LPPLsubsection{Conditions on Distribution and Modification}
- \label{LPPL:Conditions}
-
- \begin{enumerate}
- \item Activities other than distribution and/or modification of the
- Work are not covered by this license; they are outside its scope.
- In particular, the act of running the Work is not restricted and
- no requirements are made concerning any offers of support for the
- Work.
-
- \item\label{LPPL:item:distribute} You may distribute a complete, unmodified
- copy of the Work as you received it. Distribution of only part of
- the Work is considered modification of the Work, and no right to
- distribute such a Derived Work may be assumed under the terms of
- this clause.
-
- \item You may distribute a Compiled Work that has been generated
- from a complete, unmodified copy of the Work as distributed under
- Clause~\ref{LPPL:item:distribute} above, as long as that Compiled Work is
- distributed in such a way that the recipients may install the
- Compiled Work on their system exactly as it would have been
- installed if they generated a Compiled Work directly from the
- Work.
-
- \item\label{LPPL:item:currmaint} If you are the Current Maintainer of the
- Work, you may, without restriction, modify the Work, thus creating
- a Derived Work. You may also distribute the Derived Work without
- restriction, including Compiled Works generated from the Derived
- Work. Derived Works distributed in this manner by the Current
- Maintainer are considered to be updated versions of the Work.
-
- \item If you are not the Current Maintainer of the Work, you may
- modify your copy of the Work, thus creating a Derived Work based
- on the Work, and compile this Derived Work, thus creating a
- Compiled Work based on the Derived Work.
-
- \item\label{LPPL:item:conditions} If you are not the Current Maintainer of the
- Work, you may distribute a Derived Work provided the following
- conditions are met for every component of the Work unless that
- component clearly states in the copyright notice that it is exempt
- from that condition. Only the Current Maintainer is allowed to
- add such statements of exemption to a component of the Work.
- \begin{enumerate}
- \item If a component of this Derived Work can be a direct
- replacement for a component of the Work when that component is
- used with the Base Interpreter, then, wherever this component of
- the Work identifies itself to the user when used interactively
- with that Base Interpreter, the replacement component of this
- 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
- limited to) the reporting and handling of errors, to recipients
- of the Derived Work unless those persons have stated explicitly
- that they do provide such support for the Derived Work.
-
- \item You distribute at least one of the following with the Derived Work:
- \begin{enumerate}
- \item A complete, unmodified copy of the Work; if your
- distribution of a modified component is made by offering
- access to copy the modified component from a designated place,
- then offering equivalent access to copy the Work from the same
- or some similar place meets this condition, even though third
- parties are not compelled to copy the Work along with the
- modified component;
-
- \item Information that is sufficient to obtain a complete,
- unmodified copy of the Work.
- \end{enumerate}
- \end{enumerate}
- \item If you are not the Current Maintainer of the Work, you may
- distribute a Compiled Work generated from a Derived Work, as long
- as the Derived Work is distributed to all recipients of the
- Compiled Work, and as long as the conditions of
- Clause~\ref{LPPL:item:conditions}, above, are met with regard to the Derived
- Work.
-
- \item The conditions above are not intended to prohibit, and hence
- do not apply to, the modification, by any method, of any component
- so that it becomes identical to an updated version of that
- component of the Work as it is distributed by the Current
- Maintainer under Clause~\ref{LPPL:item:currmaint}, above.
-
- \item Distribution of the Work or any Derived Work in an alternative
- format, where the Work or that Derived Work (in whole or in part)
- 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
- provided that license itself honors the conditions listed in
- 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
- the restrictions in Clause~\ref{LPPL:item:conditions} above, concerning
- changes from the Work.
+ \item Activities other than distribution and/or modification of the
+ Work are not covered by this license; they are outside its scope.
+ In particular, the act of running the Work is not restricted and
+ no requirements are made concerning any offers of support for the
+ Work.
+ \item\label{LPPL:item:distribute} You may distribute a complete,
+ unmodified copy of the Work as you received it. Distribution of
+ only part of the Work is considered modification of the Work, and
+ no right to distribute such a Derived Work may be assumed under the
+ terms of this clause.
+ \item You may distribute a Compiled Work that has been generated from
+ a complete, unmodified copy of the Work as distributed under
+ Clause~\ref{LPPL:item:distribute} above, as long as that Compiled
+ Work is distributed in such a way that the recipients may install
+ the Compiled Work on their system exactly as it would have been
+ installed if they generated a Compiled Work directly from the Work.
+ \item\label{LPPL:item:currmaint} If you are the Current Maintainer of
+ the Work, you may, without restriction, modify the Work, thus
+ creating a Derived Work. You may also distribute the Derived Work
+ without restriction, including Compiled Works generated from the
+ Derived Work. Derived Works distributed in this manner by the
+ Current Maintainer are considered to be updated versions of the
+ Work.
+ \item If you are not the Current Maintainer of the Work, you may modify
+ your copy of the Work, thus creating a Derived Work based on the
+ Work, and compile this Derived Work, thus creating a Compiled Work
+ based on the Derived Work.
+ \item\label{LPPL:item:conditions} If you are not the Current Maintainer
+ of the Work, you may distribute a Derived Work provided the
+ following conditions are met for every component of the Work unless
+ that component clearly states in the copyright notice that it is
+ exempt from that condition. Only the Current Maintainer is allowed
+ to add such statements of exemption to a component of the Work.
+ %
+ \begin{enumerate}
+ \item If a component of this Derived Work can be a direct
+ replacement for a component of the Work when that component
+ is used with the Base Interpreter, then, wherever this
+ component of the Work identifies itself to the user when
+ used interactively with that Base Interpreter, the
+ replacement component of this 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 limited to) the reporting and handling
+ of errors, to recipients of the Derived Work unless those
+ persons have stated explicitly that they do provide such
+ support for the Derived Work.
+ \item You distribute at least one of the following with the
+ Derived Work:
+ %
+ \begin{enumerate}
+ \item A complete, unmodified copy of the Work; if your
+ distribution of a modified component is made by
+ offering access to copy the modified component from
+ a designated place, then offering equivalent access
+ to copy the Work from the same or some similar
+ place meets this condition, even though third
+ parties are not compelled to copy the Work along
+ with the modified component;
+ \item Information that is sufficient to obtain a
+ complete, unmodified copy of the Work.
+ \end{enumerate}
+ \end{enumerate}
+ %
+ \item If you are not the Current Maintainer of the Work, you may
+ distribute a Compiled Work generated from a Derived Work, as long
+ as the Derived Work is distributed to all recipients of the
+ Compiled Work, and as long as the conditions of
+ Clause~\ref{LPPL:item:conditions}, above, are met with regard to
+ the Derived Work.
+ \item The conditions above are not intended to prohibit, and hence do
+ not apply to, the modification, by any method, of any component so
+ that it becomes identical to an updated version of that component
+ of the Work as it is distributed by the Current Maintainer under
+ Clause~\ref{LPPL:item:currmaint}, above.
+ \item Distribution of the Work or any Derived Work in an alternative
+ format, where the Work or that Derived Work (in whole or in part)
+ 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 provided that license itself honors the conditions
+ listed in 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
+ the restrictions in Clause~\ref{LPPL:item:conditions} above,
+ concerning changes from the Work.
+ \end{enumerate}
+ %
+ \item This license places no restrictions on works that are unrelated
+ to the Work, nor does this license place any restrictions on
+ aggregating such works with the Work by any means.
+ \item Nothing in this license is intended to, or may be used to, prevent
+ complete compliance by all parties with all applicable laws.
\end{enumerate}
- \item This license places no restrictions on works that are
- unrelated to the Work, nor does this license place any
- restrictions on aggregating such works with the Work by any means.
-
- \item Nothing in this license is intended to, or may be used to,
- prevent complete compliance by all parties with all applicable
- laws.
- \end{enumerate}
-
- \LPPLsubsection{No Warranty}
- \label{LPPL:Warranty}
-
- There is no warranty for the Work. Except when otherwise stated in
- writing, the Copyright Holder provides the Work `as is', without
- warranty of any kind, either expressed or implied, including, but
- not limited to, the implied warranties of merchantability and
- fitness for a particular purpose. The entire risk as to the quality
- and performance of the Work is with you. Should the Work prove
- defective, you assume the cost of all necessary servicing, repair,
- or correction.
-
- In no event unless required by applicable law or agreed to in
- writing will The Copyright Holder, or any author named in the
- components of the Work, or any other party who may distribute and/or
- modify the Work as permitted above, be liable to you for damages,
- including any general, special, incidental or consequential damages
- arising out of any use of the Work or out of inability to use the
- Work (including, but not limited to, loss of data, data being
- rendered inaccurate, or losses sustained by anyone as a result of
- any failure of the Work to operate with any other programs), even if
- the Copyright Holder or said author or said other party has been
- advised of the possibility of such damages.
-
- \LPPLsubsection{Maintenance of The Work}
- \label{LPPL:Maintenance}
-
- The Work has the status `author-maintained' if the Copyright Holder
- explicitly and prominently states near the primary copyright notice
- in the Work that the Work can only be maintained by the Copyright
- Holder or simply that it is `author-maintained'.
-
- The Work has the status `maintained' if there is a Current
- Maintainer who has indicated in the Work that they are willing to
- receive error reports for the Work (for example, by supplying a
- valid e-mail address). It is not required for the Current Maintainer
- to acknowledge or act upon these error reports.
-
- The Work changes from status `maintained' to `unmaintained' if there
- is no Current Maintainer, or the person stated to be Current
- Maintainer of the work cannot be reached through the indicated means
- of communication for a period of six months, and there are no other
- significant signs of active maintenance.
-
- You can become the Current Maintainer of the Work by agreement with
- any existing Current Maintainer to take over this role.
-
- If the Work is unmaintained, you can become the Current Maintainer
- of the Work through the following steps:
- \begin{enumerate}
- \item Make a reasonable attempt to trace the Current Maintainer (and
- the Copyright Holder, if the two differ) through the means of an
- Internet or similar search.
- \item If this search is successful, then enquire whether the Work is
- still maintained.
- \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
- intention to take over maintenance. (If the Work is a \LaTeX{}
- work, this could be done, for example, by posting to
- \texttt{comp.text.tex}.)
- \end{enumerate}
- \item {}
+
+
+ \LPPLsubsection{No Warranty}
+ \label{LPPL:Warranty}
+
+ There is no warranty for the Work. Except when otherwise stated in
+ writing, the Copyright Holder provides the Work `as is', without warranty
+ of any kind, either expressed or implied, including, but not limited to,
+ the implied warranties of merchantability and fitness for a particular
+ purpose. The entire risk as to the quality and performance of the Work is
+ with you. Should the Work prove defective, you assume the cost of all
+ necessary servicing, repair, or correction.
+
+ In no event unless required by applicable law or agreed to in writing will
+ The Copyright Holder, or any author named in the components of the Work, or
+ any other party who may distribute and/or modify the Work as permitted
+ above, be liable to you for damages, including any general, special,
+ incidental or consequential damages arising out of any use of the Work or
+ out of inability to use the Work (including, but not limited to, loss of
+ data, data being rendered inaccurate, or losses sustained by anyone as a
+ result of any failure of the Work to operate with any other programs), even
+ if the Copyright Holder or said author or said other party has been advised
+ of the possibility of such damages.
+
+
+ \LPPLsubsection{Maintenance of The Work}
+ \label{LPPL:Maintenance}
+
+ The Work has the status `author-maintained' if the Copyright Holder
+ explicitly and prominently states near the primary copyright notice in the
+ Work that the Work can only be maintained by the Copyright Holder or simply
+ that it is `author-maintained'.
+
+ The Work has the status `maintained' if there is a Current Maintainer who
+ has indicated in the Work that they are willing to receive error reports
+ for the Work (for example, by supplying a valid e-mail address). It is not
+ required for the Current Maintainer to acknowledge or act upon these error
+ reports.
+
+ The Work changes from status `maintained' to `unmaintained' if there is no
+ Current Maintainer, or the person stated to be Current Maintainer of the
+ work cannot be reached through the indicated means of communication for a
+ period of six months, and there are no other significant signs of active
+ maintenance.
+
+ You can become the Current Maintainer of the Work by agreement with any
+ existing Current Maintainer to take over this role.
+
+ If the Work is unmaintained, you can become the Current Maintainer of the
+ Work through the following steps:
+ %
\begin{enumerate}
- \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
- upon announcement.
+ \item Make a reasonable attempt to trace the Current Maintainer (and
+ the Copyright Holder, if the two differ) through the means of an
+ Internet or similar search.
+ \item If this search is successful, then enquire whether the Work is
+ still maintained.
+ %
+ \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 intention to take over maintenance. (If the
+ Work is a \LaTeX{} work, this could be done, for example,
+ by posting to \texttt{comp.text.tex}.)
+ \end{enumerate}
+ %
+ \item {}
+ \begin{enumerate}
+ \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 upon announcement.
+ \end{enumerate}
+ %
+ \item\label{LPPL:item:change} If you make an `intention
+ announcement' as described in~\ref{LPPL:item:intention} above and
+ after three months your intention is challenged neither by the
+ 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} or~\ref{LPPL:item:change},
+ then that Current Maintainer must become or remain the Current
+ Maintainer upon request provided they then update their
+ communication data within one month.
\end{enumerate}
- \item\label{LPPL:item:change} If you make an `intention
- announcement' as described in~\ref{LPPL:item:intention} above and
- after three months your intention is challenged neither by the
- 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}
- or~\ref{LPPL:item:change}, then that Current Maintainer must
- become or remain the Current Maintainer upon request provided they
- then update their communication data within one month.
- \end{enumerate}
- A change in the Current Maintainer does not, of itself, alter the
- fact that the Work is distributed under the \LPPL\ license.
-
- If you become the Current Maintainer of the Work, you should
- immediately provide, within the Work, a prominent and unambiguous
- statement of your status as Current Maintainer. You should also
- announce your new status to the same pertinent community as
- in~\ref{LPPL:item:intention} above.
-
- \LPPLsubsection{Whether and How to Distribute Works under This License}
- \label{LPPL:Distribute}
-
- This section contains important instructions, examples, and
- recommendations for authors who are considering distributing their
- works under this license. These authors are addressed as `you' in
- this section.
-
- \LPPLsubsubsection{Choosing This License or Another License}
- \label{LPPL:Choosing}
-
- If for any part of your work you want or need to use
- \emph{distribution} conditions that differ significantly from those
- in this license, then do not refer to this license anywhere in your
- work but, instead, distribute your work under a different license.
- You may use the text of this license as a model for your own
- license, but your license should not refer to the \LPPL\ or
- otherwise give the impression that your work is distributed under
- the \LPPL.
-
- The document \LPPLdocfile{modguide} in the base \LaTeX\ distribution
- explains the motivation behind the conditions of this license. It
- explains, for example, why distributing \LaTeX\ under the
- \textsc{gnu} General Public License (\textsc{gpl}) was considered
- inappropriate. Even if your work is unrelated to \LaTeX, the
- discussion in \LPPLdocfile{modguide} may still be relevant, and authors
- intending to distribute their works under any license are encouraged
- to read it.
-
- \LPPLsubsubsection{A Recommendation on Modification Without Distribution}
- \label{LPPL:WithoutDistribution}
-
- It is wise never to modify a component of the Work, even for your
- own personal use, without also meeting the above conditions for
- distributing the modified component. While you might intend that
- such modifications will never be distributed, often this will happen
- by accident -- you may forget that you have modified that component;
- or it may not occur to you when allowing others to access the
- modified version that you are thus distributing it and violating the
- conditions of this license in ways that could have legal
- implications and, worse, cause problems for the community. It is
- therefore usually in your best interest to keep your copy of the
- Work identical with the public one. Many works provide ways to
- control the behavior of that work without altering any of its
- licensed components.
-
- \LPPLsubsubsection{How to Use This License}
- \label{LPPL:HowTo}
-
- To use this license, place in each of the components of your work
- both an explicit copyright notice including your name and the year
- the work was authored and/or last substantially modified. Include
- also a statement that the distribution and/or modification of that
- component is constrained by the conditions in this license.
-
- Here is an example of such a notice and statement:
+ %
+ A change in the Current Maintainer does not, of itself, alter the fact that
+ the Work is distributed under the \LPPL\ license.
+
+ If you become the Current Maintainer of the Work, you should immediately
+ provide, within the Work, a prominent and unambiguous statement of your
+ status as Current Maintainer. You should also announce your new status to
+ the same pertinent community as in~\ref{LPPL:item:intention} above.
+
+
+ \LPPLsubsection{Whether and How to Distribute Works under This License}
+ \label{LPPL:Distribute}
+
+ This section contains important instructions, examples, and recommendations
+ for authors who are considering distributing their works under this
+ license. These authors are addressed as `you' in this section.
+
+
+ \LPPLsubsubsection{Choosing This License or Another License}
+ \label{LPPL:Choosing}
+
+ If for any part of your work you want or need to use \emph{distribution}
+ conditions that differ significantly from those in this license, then do
+ not refer to this license anywhere in your work but, instead, distribute
+ your work under a different license. You may use the text of this license
+ as a model for your own license, but your license should not refer to the
+ \LPPL\ or otherwise give the impression that your work is distributed under
+ the \LPPL.
+
+ The document \LPPLdocfile{modguide} in the base \LaTeX\ distribution
+ explains the motivation behind the conditions of this license. It
+ explains, for example, why distributing \LaTeX\ under the \textsc{gnu}
+ General Public License (\textsc{gpl}) was considered inappropriate. Even
+ if your work is unrelated to \LaTeX, the discussion in
+ \LPPLdocfile{modguide} may still be relevant, and authors intending to
+ distribute their works under any license are encouraged to read it.
+
+
+ \LPPLsubsubsection{A Recommendation on Modification Without Distribution}
+ \label{LPPL:WithoutDistribution}
+
+ It is wise never to modify a component of the Work, even for your own
+ personal use, without also meeting the above conditions for distributing
+ the modified component. While you might intend that such modifications
+ will never be distributed, often this will happen by accident -- you may
+ forget that you have modified that component; or it may not occur to you
+ when allowing others to access the modified version that you are thus
+ distributing it and violating the conditions of this license in ways that
+ could have legal implications and, worse, cause problems for the community.
+ It is therefore usually in your best interest to keep your copy of the Work
+ identical with the public one. Many works provide ways to control the
+ behavior of that work without altering any of its licensed components.
+
+
+ \LPPLsubsubsection{How to Use This License}
+ \label{LPPL:HowTo}
+
+ To use this license, place in each of the components of your work both an
+ explicit copyright notice including your name and the year the work was
+ authored and/or last substantially modified. Include also a statement that
+ the distribution and/or modification of that component is constrained by
+ the conditions in this license.
+
+ Here is an example of such a notice and statement:
+ %
\begin{verbatim}
%% pig.dtx
%% Copyright 2005 M. Y. Name
@@ -829,62 +787,57 @@ possibility of such damages.
% 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
- `\LPPLfile{pig.sty}' (the last being generated from
- `\LPPLfile{pig.dtx}' using `\LPPLfile{pig.ins}'), the `Base
- Interpreter' referring to any `\LaTeX-Format', and both `Copyright
- Holder' and `Current Maintainer' referring to the person `M. Y.
- Name'.
-
- If you do not want the Maintenance section of \LPPL\ to apply to
- your Work, change `maintained' above into `author-maintained'.
- However, we recommend that you use `maintained' as the Maintenance
- section was added in order to ensure that your Work remains useful
- to the community even when you can no longer maintain and support it
- yourself.
-
- \LPPLsubsubsection{Derived Works That Are Not Replacements}
- \label{LPPL:NotReplacements}
-
- Several clauses of the \LPPL\ specify means to provide reliability
- and stability for the user community. They therefore concern
- themselves with the case that a Derived Work is intended to be used
- as a (compatible or incompatible) replacement of the original
- Work. If this is not the case (e.g., if a few lines of code are
- reused for a completely different task), then clauses 6b and 6d
- shall not apply.
-
- \LPPLsubsubsection{Important Recommendations}
- \label{LPPL:Recommendations}
-
- \LPPLparagraph{Defining What Constitutes the Work}
-
- The \LPPL\ requires that distributions of the Work contain all the
- files of the Work. It is therefore important that you provide a way
- for the licensee to determine which files constitute the Work. This
- could, for example, be achieved by explicitly listing all the files
- of the Work near the copyright notice of each file or by using a
- line such as:
+ 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 `\LPPLfile{pig.sty}' (the
+ last being generated from `\LPPLfile{pig.dtx}' using `\LPPLfile{pig.ins}'),
+ the `Base Interpreter' referring to any `\LaTeX-Format', and both
+ `Copyright Holder' and `Current Maintainer' referring to the person `M. Y.
+ Name'.
+
+ If you do not want the Maintenance section of \LPPL\ to apply to your Work,
+ change `maintained' above into `author-maintained'. However, we recommend
+ that you use `maintained' as the Maintenance section was added in order to
+ ensure that your Work remains useful to the community even when you can no
+ longer maintain and support it yourself.
+
+
+ \LPPLsubsubsection{Derived Works That Are Not Replacements}
+ \label{LPPL:NotReplacements}
+
+ Several clauses of the \LPPL\ specify means to provide reliability and
+ stability for the user community. They therefore concern themselves with
+ the case that a Derived Work is intended to be used as a (compatible or
+ incompatible) replacement of the original Work. If this is not the case
+ (e.g., if a few lines of code are reused for a completely different task),
+ then clauses 6b and 6d shall not apply.
+
+
+ \LPPLsubsubsection{Important Recommendations}
+ \label{LPPL:Recommendations}
+
+ \LPPLparagraph{Defining What Constitutes the Work}
+
+ The \LPPL\ requires that distributions of the Work contain all the files of
+ the Work. It is therefore important that you provide a way for the
+ licensee to determine which files constitute the Work. This could, for
+ example, be achieved by explicitly listing all the files of the Work near
+ the copyright notice of each file or by using a line such as:
+ %
\begin{verbatim}
% This work consists of all files listed in manifest.txt.
\end{verbatim}
- in that place. In the absence of an unequivocal list it might be
- impossible for the licensee to determine what is considered by you
- to comprise the Work and, in such a case, the licensee would be
- entitled to make reasonable conjectures as to which files comprise
- the Work.
-
+ %
+ in that place. In the absence of an unequivocal list it might be
+ impossible for the licensee to determine what is considered by you to
+ comprise the Work and, in such a case, the licensee would be entitled to
+ make reasonable conjectures as to which files comprise the Work.
\end{LPPLicense}
-
-
\subsection{GNU Free Documentation License, Version 1.2, November 2002}
\label{label_fdl}
-
% \textbf{Copyright 2000,2001,2002 Free Software Foundation, Inc.}\par
% 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
% \begin{quotation}
@@ -894,396 +847,349 @@ possibility of such damages.
\subsubsection{Preamble}
-The purpose of this License is to make a manual, textbook, or other
-functional and useful document ``free'' in the sense of freedom: to
-assure everyone the effective freedom to copy and redistribute it,
-with or without modifying it, either commercially or noncommercially.
-Secondarily, this License preserves for the author and publisher a way
-to get credit for their work, while not being considered responsible
-for modifications made by others.
-
-This License is a kind of ``copyleft'', which means that derivative
-works of the document must themselves be free in the same sense. It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does. But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book. We recommend this License
-principally for works whose purpose is instruction or reference.
+The purpose of this License is to make a manual, textbook, or other functional
+and useful document ``free'' in the sense of freedom: to assure everyone the
+effective freedom to copy and redistribute it, with or without modifying it,
+either commercially or noncommercially. Secondarily, this License preserves for
+the author and publisher a way to get credit for their work, while not being
+considered responsible for modifications made by others.
+
+This License is a kind of ``copyleft'', which means that derivative works of
+the document must themselves be free in the same sense. It complements the GNU
+General Public License, which is a copyleft license designed for free software.
+
+We have designed this License in order to use it for manuals for free software,
+because free software needs free documentation: a free program should come with
+manuals providing the same freedoms that the software does. But this License
+is not limited to software manuals; it can be used for any textual work,
+regardless of subject matter or whether it is published as a printed book. We
+recommend this License principally for works whose purpose is instruction or
+reference.
+
\subsubsection{Applicability and definitions}
-This License applies to any manual or other work, in any medium, that
-contains a notice placed by the copyright holder saying it can be
-distributed under the terms of this License. Such a notice grants a
-world-wide, royalty-free license, unlimited in duration, to use that
-work under the conditions stated herein. The \textbf{``Document''}, below,
-refers to any such manual or work. Any member of the public is a
-licensee, and is addressed as \textbf{``you''}. You accept the license if you
-copy, modify or distribute the work in a way requiring permission
-under copyright law.
+This License applies to any manual or other work, in any medium, that contains
+a notice placed by the copyright holder saying it can be distributed under the
+terms of this License. Such a notice grants a world-wide, royalty-free
+license, unlimited in duration, to use that work under the conditions stated
+herein. The \textbf{``Document''}, below, refers to any such manual or work.
+Any member of the public is a licensee, and is addressed as \textbf{``you''}.
+You accept the license if you copy, modify or distribute the work in a way
+requiring permission under copyright law.
A \textbf{``Modified Version''} of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A \textbf{``Secondary Section''} is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall subject
-(or to related matters) and contains nothing that could fall directly
-within that overall subject. (Thus, if the Document is in part a
-textbook of mathematics, a Secondary Section may not explain any
-mathematics.) The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
+Document or a portion of it, either copied verbatim, or with modifications
+and/or translated into another language.
+
+A \textbf{``Secondary Section''} is a named appendix or a front-matter section
+of the Document that deals exclusively with the relationship of the publishers
+or authors of the Document to the Document's overall subject (or to related
+matters) and contains nothing that could fall directly within that overall
+subject. (Thus, if the Document is in part a textbook of mathematics, a
+Secondary Section may not explain any mathematics.) The relationship could be
+a matter of historical connection with the subject or with related matters, or
+of legal, commercial, philosophical, ethical or political position regarding
them.
The \textbf{``Invariant Sections''} are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License. If a
-section does not fit the above definition of Secondary then it is not
-allowed to be designated as Invariant. The Document may contain zero
-Invariant Sections. If the Document does not identify any Invariant
-Sections then there are none.
-
-The \textbf{``Cover Texts''} are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License. A Front-Cover Text may
-be at most 5 words, and a Back-Cover Text may be at most 25 words.
+are designated, as being those of Invariant Sections, in the notice that says
+that the Document is released under this License. If a section does not fit
+the above definition of Secondary then it is not allowed to be designated as
+Invariant. The Document may contain zero Invariant Sections. If the Document
+does not identify any Invariant Sections then there are none.
+
+The \textbf{``Cover Texts''} are certain short passages of text that are
+listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License. A Front-Cover Text may be at most
+5 words, and a Back-Cover Text may be at most 25 words.
A \textbf{``Transparent''} copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, that is suitable for revising the document
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters. A copy made in an otherwise Transparent file
-format whose markup, or absence of markup, has been arranged to thwart
-or discourage subsequent modification by readers is not Transparent.
-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 % 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
-include proprietary formats that can be read and edited only by
-proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML, PostScript or PDF produced by some word
-processors for output purposes only.
+represented in a format whose specification is available to the general public,
+that is suitable for revising the document straightforwardly with generic text
+editors or (for images composed of pixels) generic paint programs or (for
+drawings) some widely available drawing editor, and that is suitable for input
+to text formatters or for automatic translation to a variety of formats
+suitable for input to text formatters. A copy made in an otherwise Transparent
+file format whose markup, or absence of markup, has been arranged to thwart or
+discourage subsequent modification by readers is not Transparent. 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 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 include proprietary formats that can be read and
+edited only by proprietary word processors, SGML or XML for which the DTD
+and/or processing tools are not generally available, and the machine-generated
+HTML, PostScript or PDF produced by some word processors for output purposes
+only.
The \textbf{``Title Page''} means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page. For works in
-formats which do not have any title page as such, ``Title Page'' means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
+plus such following pages as are needed to hold, legibly, the material this
+License requires to appear in the title page. For works in formats which do
+not have any title page as such, ``Title Page'' means the text near the most
+prominent appearance of the work's title, preceding the beginning of the body
+of the text.
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''},
+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''}.)
-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.
+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.
+
+The Document may include Warranty Disclaimers next to the notice which states
+that this License applies to the Document. These Warranty Disclaimers are
+considered to be included by reference in this License, but only as regards
+disclaiming warranties: any other implication that these Warranty Disclaimers
+may have is void and has no effect on the meaning of this License.
-The Document may include Warranty Disclaimers next to the notice which
-states that this License applies to the Document. These Warranty
-Disclaimers are considered to be included by reference in this
-License, but only as regards disclaiming warranties: any other
-implication that these Warranty Disclaimers may have is void and has
-no effect on the meaning of this License.
\subsubsection{Verbatim Copying}
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no other
-conditions whatsoever to those of this License. You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute. However, you may accept
-compensation in exchange for copies. If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
+You may copy and distribute the Document in any medium, either commercially or
+noncommercially, provided that this License, the copyright notices, and the
+license notice saying this License applies to the Document are reproduced in
+all copies, and that you add no other conditions whatsoever to those of this
+License. You may not use technical measures to obstruct or control the reading
+or further copying of the copies you make or distribute. However, you may
+accept compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section~3.
+
+You may also lend copies, under the same conditions stated above, and you may
+publicly display copies.
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
\subsubsection{Copying in Quantity}
-If you publish printed copies (or copies in media that commonly have
-printed covers) of the Document, numbering more than 100, and the
-Document's license notice requires Cover Texts, you must enclose the
-copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover. Both covers must also clearly and legibly identify
-you as the publisher of these copies. The front cover must present
-the full title with all words of the title equally prominent and
-visible. You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a computer-network location from which the general network-using
-public has access to download using public-standard network protocols
-a complete Transparent copy of the Document, free of added material.
-If you use the latter option, you must take reasonably prudent steps,
-when you begin distribution of Opaque copies in quantity, to ensure
-that this Transparent copy will remain thus accessible at the stated
-location until at least one year after the last time you distribute an
-Opaque copy (directly or through your agents or retailers) of that
-edition to the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to give
-them a chance to provide you with an updated version of the Document.
+If you publish printed copies (or copies in media that commonly have printed
+covers) of the Document, numbering more than 100, and the Document's license
+notice requires Cover Texts, you must enclose the copies in covers that carry,
+clearly and legibly, all these Cover Texts: Front-Cover Texts on the front
+cover, and Back-Cover Texts on the back cover. Both covers must also clearly
+and legibly identify you as the publisher of these copies. The front cover
+must present the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition. Copying with
+changes limited to the covers, as long as they preserve the title of the
+Document and satisfy these conditions, can be treated as verbatim copying in
+other respects.
+
+If the required texts for either cover are too voluminous to fit legibly, you
+should put the first ones listed (as many as fit reasonably) on the actual
+cover, and continue the rest onto adjacent pages.
+
+If you publish or distribute Opaque copies of the Document numbering more than
+100, you must either include a machine-readable Transparent copy along with
+each Opaque copy, or state in or with each Opaque copy a computer-network
+location from which the general network-using public has access to download
+using public-standard network protocols a complete Transparent copy of the
+Document, free of added material. If you use the latter option, you must take
+reasonably prudent steps, when you begin distribution of Opaque copies in
+quantity, to ensure that this Transparent copy will remain thus accessible at
+the stated location until at least one year after the last time you distribute
+an Opaque copy (directly or through your agents or retailers) of that edition
+to the public.
+
+It is requested, but not required, that you contact the authors of the Document
+well before redistributing any large number of copies, to give them a chance to
+provide you with an updated version of the Document.
-\subsubsection{Modifications}
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it. In addition, you must do these things in the Modified Version:
+\subsubsection{Modifications}
+You may copy and distribute a Modified Version of the Document under the
+conditions of sections 2 and 3 above, provided that you release the Modified
+Version under precisely this License, with the Modified Version filling the
+role of the Document, thus licensing distribution 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.]
- 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
- publisher of the Modified Version as given on the Title Page. If
- there is no section Entitled ``History'' in the Document, create one
- 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
- the network locations given in the Document for previous versions
- it was based on. These may be placed in the ``History'' section.
- 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.
+ \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 publisher of the Modified Version as given on the Title Page. If
+ there is no section Entitled ``History'' in the Document, create one
+ 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
+ the network locations given in the Document for previous versions it
+ was based on. These may be placed in the ``History'' section. 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}
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant. To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section Entitled ``Endorsements'', provided it contains
-nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version. Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity. If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
+If the Modified Version includes new front-matter sections or appendices that
+qualify as Secondary Sections and contain no material copied from the Document,
+you may at your option designate some or all of these sections as invariant.
+To do this, add their titles to the list of Invariant Sections in the Modified
+Version's license notice. These titles must be distinct from any other section
+titles.
+
+You may add a section Entitled ``Endorsements'', provided it contains nothing
+but endorsements of your Modified Version by various parties--for example,
+statements of peer review or that the text has been approved by an organization
+as the authoritative definition of a standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a passage
+of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts
+in the Modified Version. Only one passage of Front-Cover Text and one of
+Back-Cover Text may be added by (or through arrangements made by) any one
+entity. If the Document already includes a cover text for the same cover,
+previously added by you or by arrangement made by the same entity you are
+acting on behalf of, you may not add another; but you may replace the old one,
+on explicit permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License give
+permission to use their names for publicity for or to assert or imply
+endorsement of any Modified Version.
+
\subsubsection{Combining Documents}
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice, and that you preserve all their Warranty Disclaimers.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy. If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
+You may combine the Document with other documents released under this License,
+under the terms defined in section 4 above for modified versions, provided that
+you include in the combination all of the Invariant Sections of all of the
+original documents, unmodified, and list them all as Invariant Sections of your
+combined work in its license notice, and that you preserve all their Warranty
+Disclaimers.
+
+The combined work need only contain one copy of this License, and multiple
+identical Invariant Sections may be replaced with a single copy. If there are
+multiple Invariant Sections with the same name but different contents, make the
+title of each such section unique by adding at the end of it, in parentheses,
+the name of the original author or publisher of that section if known, or else
+a unique number. Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
-In the combination, you must combine any sections Entitled ``History''
-in the various original documents, forming one section Entitled
-``History''; likewise combine any sections Entitled ``Acknowledgements'',
-and any sections Entitled ``Dedications''. You must delete all sections
-Entitled ``Endorsements''.
+In the combination, you must combine any sections Entitled ``History'' in the
+various original documents, forming one section Entitled ``History''; likewise
+combine any sections Entitled ``Acknowledgements'', and any sections Entitled
+``Dedications''. You must delete all sections Entitled ``Endorsements''.
\subsubsection{Collection of Documents}
You may make a collection consisting of the Document and other documents
-released under this License, and replace the individual copies of this
-License in the various documents with a single copy that is included in
-the collection, provided that you follow the rules of this License for
-verbatim copying of each of the documents in all other respects.
+released under this License, and replace the individual copies of this License
+in the various documents with a single copy that is included in the collection,
+provided that you follow the rules of this License for verbatim copying of each
+of the documents in all other respects.
-You may extract a single document from such a collection, and distribute
-it individually under this License, provided you insert a copy of this
-License into the extracted document, and follow this License in all
-other respects regarding verbatim copying of that document.
+You may extract a single document from such a collection, and distribute it
+individually under this License, provided you insert a copy of this License
+into the extracted document, and follow this License in all other respects
+regarding verbatim copying of that document.
\subsubsection{Aggregating with independent Works}
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, is called an ``aggregate'' if the copyright
-resulting from the compilation is not used to limit the legal rights
-of the compilation's users beyond what the individual works permit.
-When the Document is included in an aggregate, this License does not
-apply to the other works in the aggregate which are not themselves
-derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one half of
-the entire aggregate, the Document's Cover Texts may be placed on
-covers that bracket the Document within the aggregate, or the
-electronic equivalent of covers if the Document is in electronic form.
-Otherwise they must appear on printed covers that bracket the whole
-aggregate.
+A compilation of the Document or its derivatives with other separate and
+independent documents or works, in or on a volume of a storage or distribution
+medium, is called an ``aggregate'' if the copyright resulting from the
+compilation is not used to limit the legal rights of the compilation's users
+beyond what the individual works permit. When the Document is included in an
+aggregate, this License does not apply to the other works in the aggregate
+which are not themselves derivative works of the Document.
+If the Cover Text requirement of section 3 is applicable to these copies of the
+Document, then if the Document is less than one half of the entire aggregate,
+the Document's Cover Texts may be placed on covers that bracket the Document
+within the aggregate, or the electronic equivalent of covers if the Document is
+in electronic form. Otherwise they must appear on printed covers that bracket
+the whole aggregate.
\subsubsection{Translation}
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections. You may include a
-translation of this License, and all the license notices in the
-Document, and any Warranty Disclaimers, provided that you also include
-the original English version of this License and the original versions
-of those notices and disclaimers. In case of a disagreement between
-the translation and the original version of this License or a notice
-or disclaimer, the original version will prevail.
-
-If a section in the Document is Entitled ``Acknowledgements'',
-``Dedications'', or ``History'', the requirement (section 4) to Preserve
-its Title (section 1) will typically require changing the actual
-title.
+Translation is considered a kind of modification, so you may distribute
+translations of the Document under the terms of section 4. Replacing Invariant
+Sections with translations requires special permission from their copyright
+holders, but you may include translations of some or all Invariant Sections in
+addition to the original versions of these Invariant Sections. You may include
+a translation of this License, and all the license notices in the Document, and
+any Warranty Disclaimers, provided that you also include the original English
+version of this License and the original versions of those notices and
+disclaimers. In case of a disagreement between the translation and the
+original version of this License or a notice or disclaimer, the original
+version will prevail.
+
+If a section in the Document is Entitled ``Acknowledgements'', ``Dedications'',
+or ``History'', the requirement (section 4) to Preserve its Title (section 1)
+will typically require changing the actual title.
\subsubsection{Termination}
-You may not copy, modify, sublicense, or distribute the Document except
-as expressly provided for under this License. Any other attempt to
-copy, modify, sublicense or distribute the Document is void, and will
-automatically terminate your rights under this License. However,
-parties who have received copies, or rights, from you under this
-License will not have their licenses terminated so long as such
-parties remain in full compliance.
+You may not copy, modify, sublicense, or distribute the Document except as
+expressly provided for under this License. Any other attempt to copy, modify,
+sublicense or distribute the Document is void, and will automatically terminate
+your rights under this License. However, parties who have received copies, or
+rights, from you under this License will not have their licenses terminated so
+long as such parties remain in full compliance.
\subsubsection{Future Revisions of this License}
-The Free Software Foundation may publish new, revised versions
-of the GNU Free Documentation License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns. See
-http://www.gnu.org/copyleft/.
+The Free Software Foundation may publish new, revised versions of the GNU Free
+Documentation License from time to time. Such new versions will be similar in
+spirit to the present version, but may differ in detail to address new problems
+or concerns. See http://www.gnu.org/copyleft/.
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License ``or any later version'' applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation. If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation.
+Each version of the License is given a distinguishing version number. If the
+Document specifies that a particular numbered version of this License ``or any
+later version'' applies to it, you have the option of following the terms and
+conditions either of that specified version or of any later version that has
+been published (not as a draft) by the Free Software Foundation. If the
+Document does not specify a version number of this License, you may choose any
+version ever published (not as a draft) by the Free Software Foundation.
\subsubsection{Addendum: How to use this License for your documents}
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
+To use this License in a document you have written, include a copy of the
+License in the document and put the following copyright and license notices
+just after the title page:
\bigskip
\begin{quote}
@@ -1297,8 +1203,8 @@ license notices just after the title page:
\end{quote}
\bigskip
-If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the ``with \dots\ Texts.'' line with this:
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace
+the ``with \dots\ Texts''. line with this:
\bigskip
\begin{quote}
@@ -1308,15 +1214,13 @@ replace the ``with \dots\ Texts.'' line with this:
\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.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.
+If you have Invariant Sections without Cover Texts, or some other combination
+of the three, merge those two alternatives to suit the situation.
+If your document contains nontrivial examples of program code, we recommend
+releasing these examples in parallel under your choice of free software
+license, such as the GNU General Public License, to permit their use in free
+software.
%%% Local Variables:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-body.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-body.tex
index d34656b688f..78b72d5ab8c 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-body.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-body.tex
@@ -183,7 +183,7 @@
{
\vbox{}
\vskip0pt plus 1fill
- F\"ur meinen Vater, damit er noch viele sch\"one \TeX-Graphiken
+ Für meinen Vater, damit er noch viele schöne \TeX-Graphiken
erschaffen kann.
\vskip1em
\hfill\emph{Till}
@@ -193,26 +193,25 @@
Copyright 2007 to 2013 by Till Tantau
\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;
- with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
- A copy of the license is included in the section entitled \textsc{gnu}
- Free Documentation License.
+ 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; with no Invariant Sections, no Front-Cover Texts, and no
+ Back-Cover Texts. A copy of the license is included in the section entitled
+ \textsc{gnu} Free Documentation License.
\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.
+ 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
- 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.
+ 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.
\vbox{}
\clearpage
@@ -221,14 +220,15 @@
\title{\bfseries The \tikzname\ and {\Large PGF} Packages\\
\large Manual for version \pgfversion\\[1mm]
-\large\href{http://sourceforge.net/projects/pgf}{\texttt{http://sourceforge.net/projects/pgf}}}
+\large\href{https://sourceforge.net/projects/pgf}{\texttt{https://sourceforge.net/projects/pgf}}}
\author{Till Tantau\footnote{Editor of this documentation. Parts of
this documentation have been written by other authors as indicated
in these parts or chapters and in Section~\ref{section-authors}.}\\
- \normalsize Institut f\"ur Theoretische Informatik\\[-1mm]
- \normalsize Universit\"at zu L\"ubeck}
+ \normalsize Institut für Theoretische Informatik\\[-1mm]
+ \normalsize Universität zu Lübeck}
\maketitle
+\label{table-of-contents}
\tableofcontents
@@ -238,18 +238,17 @@
\include{pgfmanual-en-introduction}
+
\part{Tutorials and Guidelines}
{\Large \emph{by Till Tantau}}
\bigskip
-\noindent
-To help you get started with \tikzname, instead of a long installation
-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.
+\noindent To help you get started with \tikzname, instead of a long
+installation 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.
\vskip3cm
@@ -258,6 +257,7 @@ some guidelines on how you should proceed when creating graphics using
(0,0) -- (0,2) -- (1,3.25) -- (2,2) -- (2,0) -- (0,2) -- (2,2) -- (0,0) -- (2,0);
\end{codeexample}
+
\include{pgfmanual-en-tutorial}
\include{pgfmanual-en-tutorial-nodes}
\include{pgfmanual-en-tutorial-Euclid}
@@ -273,11 +273,10 @@ some guidelines on how you should proceed when creating graphics using
\bigskip
-\noindent
-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.
+\noindent 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.
\vskip1cm
@@ -313,11 +312,13 @@ installation, read the present part.
\end{tikzpicture}
\end{codeexample}
+
\include{pgfmanual-en-installation}
\include{pgfmanual-en-license}
\include{pgfmanual-en-drivers}
+
\part{Ti\emph{k}Z ist \emph{kein} Zeichenprogramm}
\label{part-tikz}
@@ -331,24 +332,24 @@ installation, read the present part.
\begin{tikzpicture}[angle radius=.75cm]
- \node (A) at (-2,0) [red,left] {$A$};
+ \node (A) at (-2,0) [red,left] {$A$};
\node (B) at ( 3,.5) [red,right] {$B$};
- \node (C) at (-2,2) [blue,left] {$C$};
- \node (D) at ( 3,2.5) [blue,right] {$D$};
- \node (E) at (60:-5mm) [below] {$E$};
- \node (F) at (60:3.5cm) [above] {$F$};
+ \node (C) at (-2,2) [blue,left] {$C$};
+ \node (D) at ( 3,2.5) [blue,right] {$D$};
+ \node (E) at (60:-5mm) [below] {$E$};
+ \node (F) at (60:3.5cm) [above] {$F$};
\coordinate (X) at (intersection cs:first line={(A)--(B)}, second line={(E)--(F)});
\coordinate (Y) at (intersection cs:first line={(C)--(D)}, second line={(E)--(F)});
-
- \path
+
+ \path
(A) edge [red, thick] (B)
(C) edge [blue, thick] (D)
(E) edge [thick] (F)
- pic ["$\alpha$", draw, fill=yellow] {angle = F--X--A}
- pic ["$\beta$", draw, fill=green!30] {angle = B--X--F}
- pic ["$\gamma$", draw, fill=yellow] {angle = E--Y--D}
- pic ["$\delta$", draw, fill=green!30] {angle = C--Y--E};
+ pic ["$\alpha$", draw, fill=yellow] {angle = F--X--A}
+ pic ["$\beta$", draw, fill=green!30] {angle = B--X--F}
+ pic ["$\gamma$", draw, fill=yellow] {angle = E--Y--D}
+ pic ["$\delta$", draw, fill=green!30] {angle = C--Y--E};
\node at ($ (D)!.5!(B) $) [right=1cm,text width=6cm,rounded corners,fill=red!20,inner sep=1ex]
{
@@ -360,7 +361,6 @@ installation, read the present part.
\end{codeexample}
-
\include{pgfmanual-en-tikz-design}
\include{pgfmanual-en-tikz-scopes}
\include{pgfmanual-en-tikz-coordinates}
@@ -376,6 +376,8 @@ installation, read the present part.
\include{pgfmanual-en-tikz-transparency}
\include{pgfmanual-en-tikz-decorations}
\include{pgfmanual-en-tikz-transformations}
+\include{pgfmanual-en-tikz-animations}
+
\part{Graph Drawing}
@@ -385,11 +387,9 @@ installation, read the present part.
\bigskip
\noindent
-\emph{Graph drawing algorithms} do the tough work of computing a
-layout of a graph for you. \tikzname\ comes with powerful
-such algorithms, but you can also implement new algorithms in the
-Lua programming language.
-\vskip1cm
+\emph{Graph drawing algorithms} do the tough work of computing a layout of a
+graph for you. \tikzname\ comes with powerful such algorithms, but you can also
+implement new algorithms in the Lua programming language. \vskip1cm
\ifluatex
\begin{codeexample}[graphic=white]
@@ -410,14 +410,15 @@ Lua programming language.
"CB Unix 1" -> "CB Unix 2" -> "CB Unix 3" -> { "Unix/TS++", "PDP-11 Sys V" };
{ "USG 2.0" -> "USG 3.0", "PWB 2.0", "Unix/TS 1.0" } -> "Unix/TS 3.0";
{ "Unix/TS++", "CB Unix 3", "Unix/TS 3.0" } -> "TS 4.0" -> "System V.0" -> "System V.2" -> "System V.3";
- };
+ };
\end{codeexample}
\else
-You need to use Lua\TeX\ to typeset this part of the manual (and,
-also, to use algorithmic graph drawing).
+ You need to use Lua\TeX\ to typeset this part of the manual (and, also, to
+ use algorithmic graph drawing).
\fi
+
\include{pgfmanual-en-gd-overview}
\include{pgfmanual-en-gd-usage-tikz}
\include{pgfmanual-en-gd-usage-pgf}
@@ -428,7 +429,7 @@ also, to use algorithmic graph drawing).
\include{pgfmanual-en-gd-phylogenetics}
\include{pgfmanual-en-gd-edge-routing}
%
-% XXX : disabled because of
+% XXX : disabled because of
% 1. compile-time dependencies which are hard to resolve
% 2. it is "hardly usable anyway" (TT)
%\include{pgfmanual-en-gd-ogdf}
@@ -436,7 +437,8 @@ also, to use algorithmic graph drawing).
\include{pgfmanual-en-gd-algorithms-in-c}
\include{pgfmanual-en-gd-display-layer}
\include{pgfmanual-en-gd-binding-layer}
-
+
+
\part{Libraries}
\label{part-libraries}
@@ -446,11 +448,10 @@ also, to use algorithmic graph drawing).
\bigskip
\noindent
-In this part the library packages are documented. They
-provide additional predefined graphic objects like new arrow heads or
-new plot marks, but sometimes also extensions of the basic \pgfname\
-or \tikzname\ system. The libraries are not loaded by default since
-many users will not need them.
+In this part the library packages are documented. They provide additional
+predefined graphic objects like new arrow heads or new plot marks, but
+sometimes also extensions of the basic \pgfname\ or \tikzname\ system. The
+libraries are not loaded by default since many users will not need them.
\medskip
\noindent
@@ -511,6 +512,8 @@ many users will not need them.
\end{minipage}
\end{codeexample}
+
+\include{pgfmanual-en-library-3d}
\include{pgfmanual-en-library-angles}
\include{pgfmanual-en-library-arrows}
\include{pgfmanual-en-library-automata}
@@ -537,6 +540,7 @@ many users will not need them.
\include{pgfmanual-en-library-plot-handlers}
\include{pgfmanual-en-library-plot-marks}
\include{pgfmanual-en-library-profiler}
+\include{pgfmanual-en-library-rdf}
\include{pgfmanual-en-library-shadings}
\include{pgfmanual-en-library-shadows}
\include{pgfmanual-en-library-shapes}
@@ -546,6 +550,8 @@ many users will not need them.
\include{pgfmanual-en-library-through}
\include{pgfmanual-en-library-trees}
\include{pgfmanual-en-library-turtle}
+\include{pgfmanual-en-library-views}
+
\part{Data Visualization}
@@ -582,6 +588,7 @@ data [format=function] {
};
\end{codeexample}
+
\include{pgfmanual-en-dv-introduction}
\include{pgfmanual-en-dv-main}
\include{pgfmanual-en-dv-formats}
@@ -592,6 +599,7 @@ data [format=function] {
\include{pgfmanual-en-dv-backend}
+
\part{Utilities}
\label{part-utilities}
@@ -600,10 +608,10 @@ data [format=function] {
\bigskip
\noindent
-The utility packages are not directly involved in creating graphics,
-but you may find them useful nonetheless. All of them either directly
-depend on \pgfname\ or they are designed to work well together with
-\pgfname\ even though they can be used in a stand-alone way.
+The utility packages are not directly involved in creating graphics, but you
+may find them useful nonetheless. All of them either directly depend on
+\pgfname\ or they are designed to work well together with \pgfname\ even though
+they can be used in a stand-alone way.
\vskip2cm
\medskip
@@ -629,6 +637,7 @@ depend on \pgfname\ or they are designed to work well together with
\end{tikzpicture}
\end{codeexample}
+
\include{pgfmanual-en-pgfkeys}
\include{pgfmanual-en-pgffor}
\include{pgfmanual-en-pgfcalendar}
@@ -637,6 +646,7 @@ depend on \pgfname\ or they are designed to work well together with
\include{pgfmanual-en-module-parser}
+
\part{Mathematical and Object-Oriented Engines}
{\Large \emph{by Mark Wibrow and Till Tantau}}
@@ -644,24 +654,21 @@ depend on \pgfname\ or they are designed to work well together with
\bigskip
\noindent
-\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
-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\ 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
+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.
-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}.
+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]
@@ -686,6 +693,7 @@ object-oriented programming in \TeX. It allows the definition of
}
\end{codeexample}
+
\include{pgfmanual-en-math-design}
\include{pgfmanual-en-math-parsing}
\include{pgfmanual-en-math-commands}
@@ -694,6 +702,7 @@ object-oriented programming in \TeX. It allows the definition of
\include{pgfmanual-en-oo}
+
\part{The Basic Layer}
{\Large \emph{by Till Tantau}}
@@ -747,12 +756,12 @@ object-oriented programming in \TeX. It allows the definition of
\include{pgfmanual-en-base-layers}
\include{pgfmanual-en-base-shadings}
\include{pgfmanual-en-base-transparency}
+\include{pgfmanual-en-base-animations}
\include{pgfmanual-en-base-internalregisters}
\include{pgfmanual-en-base-quick}
-
\part{The System Layer}
\label{part-system}
@@ -762,15 +771,15 @@ object-oriented programming in \TeX. It allows the definition of
\bigskip
\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.
+\emph{system layer}. This interface provides a complete abstraction of 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.
+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.
-In the following it is assumed that you are familiar with the basic
-workings of the |graphics| package and that you know what
-\TeX-drivers are and how they work.
+In the following it is assumed that you are familiar with the basic workings of
+the |graphics| package and that you know what \TeX-drivers are and how they
+work.
\vskip1cm
\begin{codeexample}[graphic=white]
@@ -798,10 +807,12 @@ workings of the |graphics| package and that you know what
\end{tikzpicture}
\end{codeexample}
+
\include{pgfmanual-en-pgfsys-overview}
\include{pgfmanual-en-pgfsys-commands}
\include{pgfmanual-en-pgfsys-paths}
\include{pgfmanual-en-pgfsys-protocol}
+\include{pgfmanual-en-pgfsys-animations}
@@ -835,7 +846,6 @@ workings of the |graphics| package and that you know what
\end{document}
-
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "~/pgf/doc/generic/pgf/version-for-luatex/en/pgfmanual"
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-preamble.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-preamble.tex
index df6b0b97708..5515cc8b7ed 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-preamble.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-main-preamble.tex
@@ -19,16 +19,17 @@
\usepackage{hyperref}
\hypersetup{%
- colorlinks=false, % use true to enable colors below:
- linkcolor=blue,%red,
- filecolor=blue,%magenta,
- urlcolor=blue,%cyan,
- citecolor=blue,
- pdfborder=0 0 0,
+ colorlinks=false, % use true to enable colors below:
+ linkcolor=blue,%red,
+ filecolor=blue,%magenta,
+ urlcolor=blue,%cyan,
+ citecolor=blue,
+ pdfborder=0 0 0,
}
% We need lots of libraries...
\usetikzlibrary{
+ 3d,
arrows,
arrows.spaced,
arrows.meta,
@@ -89,7 +90,10 @@
graphs.standard,
quotes,
math,
- angles
+ angles,
+ views,
+ animations,
+ rdf,
}
\usepackage{ifluatex}
@@ -121,9 +125,9 @@
\ifgdccodeogdf
\usegdlibrary{pgf_gd_ogdf_c_SimpleDemoOGDF,ogdf}
\fi
-
+
\fi
-
+
\fi
\def\LuaTeX{Lua\TeX}%
@@ -165,13 +169,21 @@
% pgfmanual-en-macros.tex defines an environment named filedescription
\let\filedescription\relax
\usepackage[utf8]{luainputenc}
-\else
+\else
\usepackage[utf8]{inputenc}
\fi
\usepackage{amsmath}
-\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
+\graphicspath{{../../images/}}
+\input{../../macros/pgfmanual-en-macros}
+
+\usepackage{todonotes}
+\newcommand\todosp[2][]{% % Stefan Pinnow
+ \todo[
+ disable,
+ color=blue!40,
+ #1]{#2}
+}
\makeindex
@@ -219,6 +231,139 @@
\index{Data formats|see{Formats}}
+% Animations:
+
+\tikzset{make snapshot if necessary}
+
+
+%% -----------------------------------------------------------------------------
+%\includeonly{
+%% pgfmanual-en-introduction,
+%% pgfmanual-en-tutorial,
+%% pgfmanual-en-tutorial-nodes,
+%% pgfmanual-en-tutorial-Euclid,
+%% pgfmanual-en-tutorial-chains,
+%% pgfmanual-en-tutorial-map,
+%% pgfmanual-en-guidelines,
+%% pgfmanual-en-installation,
+%% pgfmanual-en-license,
+%% pgfmanual-en-drivers,
+%% pgfmanual-en-tikz-design,
+%% pgfmanual-en-tikz-scopes,
+%% pgfmanual-en-tikz-coordinates,
+%% pgfmanual-en-tikz-paths,
+%% pgfmanual-en-tikz-actions,
+%% pgfmanual-en-tikz-arrows,
+%% pgfmanual-en-tikz-shapes,
+%% pgfmanual-en-tikz-pics,
+%% pgfmanual-en-tikz-graphs,
+%% pgfmanual-en-tikz-matrices,
+%% pgfmanual-en-tikz-trees,
+%% pgfmanual-en-tikz-plots,
+%% pgfmanual-en-tikz-transparency,
+%% pgfmanual-en-tikz-decorations,
+%% pgfmanual-en-tikz-transformations,
+%% pgfmanual-en-tikz-animations,
+%% pgfmanual-en-gd-overview,
+%% pgfmanual-en-gd-usage-tikz,
+%% pgfmanual-en-gd-usage-pgf,
+%% pgfmanual-en-gd-trees,
+%% pgfmanual-en-gd-layered,
+%% pgfmanual-en-gd-force,
+%% pgfmanual-en-gd-circular,
+%% pgfmanual-en-gd-phylogenetics,
+%% pgfmanual-en-gd-edge-routing,
+%%% pgfmanual-en-gd-ogdf,
+%% pgfmanual-en-gd-algorithm-layer,
+%% pgfmanual-en-gd-algorithms-in-c,
+%% pgfmanual-en-gd-display-layer,
+%% pgfmanual-en-gd-binding-layer,
+%% pgfmanual-en-library-angles,
+%% pgfmanual-en-library-arrows,
+%% pgfmanual-en-library-automata,
+%% pgfmanual-en-library-babel,
+%% pgfmanual-en-library-backgrounds,
+%% pgfmanual-en-library-calc,
+%% pgfmanual-en-library-calendar,
+%% pgfmanual-en-library-chains,
+%% pgfmanual-en-library-circuits,
+%% pgfmanual-en-library-decorations,
+%% pgfmanual-en-library-er,
+%% pgfmanual-en-library-external,
+%% pgfmanual-en-library-fadings,
+%% pgfmanual-en-library-fit,
+%% pgfmanual-en-library-fixedpoint,
+%% pgfmanual-en-library-fpu,
+%% pgfmanual-en-library-lsystems,
+%% pgfmanual-en-library-math,
+%% pgfmanual-en-library-matrices,
+%% pgfmanual-en-library-mindmaps,
+%% pgfmanual-en-library-folding,
+%% pgfmanual-en-library-patterns,
+%% pgfmanual-en-library-petri,
+%% pgfmanual-en-library-plot-handlers,
+%% pgfmanual-en-library-plot-marks,
+%% pgfmanual-en-library-profiler,
+%% pgfmanual-en-library-rdf,
+%% pgfmanual-en-library-shadings,
+%% pgfmanual-en-library-shadows,
+%% pgfmanual-en-library-shapes,
+%% pgfmanual-en-library-spy,
+%% pgfmanual-en-library-svg-path,
+%% pgfmanual-en-library-edges,
+%% pgfmanual-en-library-through,
+%% pgfmanual-en-library-trees,
+%% pgfmanual-en-library-turtle,
+%% pgfmanual-en-library-views,
+%% pgfmanual-en-dv-introduction,
+%% pgfmanual-en-dv-main,
+%% pgfmanual-en-dv-formats,
+%% pgfmanual-en-dv-axes,
+%% pgfmanual-en-dv-visualizers,
+%% pgfmanual-en-dv-stylesheets,
+%% pgfmanual-en-dv-polar,
+%% pgfmanual-en-dv-backend,
+%% pgfmanual-en-pgfkeys,
+%% pgfmanual-en-pgffor,
+%% pgfmanual-en-pgfcalendar,
+%% pgfmanual-en-pages,
+%% pgfmanual-en-xxcolor,
+%% pgfmanual-en-module-parser,
+%% pgfmanual-en-math-design,
+%% pgfmanual-en-math-parsing,
+%% pgfmanual-en-math-commands,
+%% pgfmanual-en-math-algorithms,
+%% pgfmanual-en-math-numberprinting,
+%% pgfmanual-en-oo,
+%% pgfmanual-en-base-design,
+%% pgfmanual-en-base-scopes,
+%% pgfmanual-en-base-points,
+%% pgfmanual-en-base-paths,
+%% pgfmanual-en-base-decorations,
+%% pgfmanual-en-base-actions,
+%% pgfmanual-en-base-arrows,
+%% pgfmanual-en-base-nodes,
+%% pgfmanual-en-base-matrices,
+%% pgfmanual-en-base-transformations,
+%% pgfmanual-en-base-patterns,
+%% pgfmanual-en-base-images,
+%% pgfmanual-en-base-external,
+%% pgfmanual-en-base-plots,
+%% pgfmanual-en-base-layers,
+%% pgfmanual-en-base-shadings,
+%% pgfmanual-en-base-transparency,
+%% pgfmanual-en-base-animations,
+%% pgfmanual-en-base-internalregisters,
+%% pgfmanual-en-base-quick,
+%% pgfmanual-en-pgfsys-overview,
+%% pgfmanual-en-pgfsys-commands,
+%% pgfmanual-en-pgfsys-paths,
+%% pgfmanual-en-pgfsys-protocol,
+%% pgfmanual-en-pgfsys-animations,
+%}
+%% -----------------------------------------------------------------------------
+
+
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "~/pgf/doc/generic/pgf/version-for-luatex/en/pgfmanual"
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 55df7111ae1..8853888a5c8 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
@@ -7,8 +7,9 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\input pgfmanual-en-main-preamble.tex
-\input pgfmanual-en-main-body.tex
+\input{pgfmanual-en-main-preamble.tex}
+\input{pgfmanual-en-main-body.tex}
+
%%% Local Variables:
%%% mode: latex
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 7a30162a1ca..1acec247f8f 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
@@ -9,53 +9,45 @@
\section{Customizing the Mathematical Engine}
-
\label{pgfmath-reimplement}
+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.
-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.
+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:
+To add a new function to the math engine the following command can be used:
\begin{command}{\pgfmathdeclarefunction\opt{|*|}\marg{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
- lowercase letters, numbers or the underscore |_|. In line with
- many programming languages, a function name cannot begin with a
- number or contain any spaces. The function may not have been
- declared earlier, unless the optional star (|*|) is provided, which
- forces an ``overwriting'' of the function by the new function. Note
- that you \emph{should never change the arity of standard functions}
- and you should normally use |\pgfmathredeclarefunction|, which
- does not allow you to do anything wrong here.
-
- 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 a variable number of 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.
-
+ This will set up the parser to recognize a function called \meta{name}. The
+ name of the function can consist of, uppercase or lowercase letters,
+ numbers or the underscore |_|. In line with many programming languages, a
+ function name cannot begin with a number or contain any spaces. The
+ function may not have been declared earlier, unless the optional star (|*|)
+ is provided, which forces an ``overwriting'' of the function by the new
+ function. Note that you \emph{should never change the arity of standard
+ functions} and you should normally use |\pgfmathredeclarefunction|,
+ which does not allow you to do anything wrong here.
+
+ 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 a variable number of
+ 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}{
@@ -69,78 +61,71 @@ used:
\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 a ``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 function's
- 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.
-
- 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.
+ 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 a ``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 function's
+ 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.
+
+ 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.
+ 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.
+ %
\begin{codeexample}[]
\makeatletter
\pgfmathdeclarefunction{foo}{1}{
@@ -161,21 +146,22 @@ To redefine a function use the following command:
\pgfmathparse{foo(42)}\pgfmathresult
\makeatother
\end{codeexample}
+ %
\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 |pgfmath|.
+ \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 |pgfmath|.
- 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{}:
+ 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:
-
+ 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);
@@ -187,24 +173,21 @@ To redefine a function use the following command:
\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:
-
+ 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={
@@ -220,5 +203,5 @@ To redefine a function use the following command:
plot [domain=0:360, samples=144, smooth] (\x,{speech(\x)});
\end{tikzpicture}
\end{codeexample}
-
+ %
\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 fe42eacac4c..c6c0fef02cb 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,58 +7,58 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\section{Additional Mathematical Commands}
+\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 many of these computations are listed
-above in Section~\ref{pgfmath-functions}. \pgfname{} also provides
-some additional commands which are shown below:
+Instead of parsing and evaluating complex expressions, you can also use the
+mathematical engine to evaluate a single mathematical 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 arithmetic functions}
\label{pgfmath-commands-basic}
-In addition to the commands described in
-Section~\ref{pgfmath-functions-basic}, the following command is
-provided:
+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}$. This provides
- greatest accuracy when \mvar{x} is small.
+\begin{command}{\pgfmathreciprocal\marg{x}}
+ Defines |\pgfmathresult| as $1\div\meta{x}$. This provides greatest
+ accuracy when \mvar{x} is small.
\end{command}
+
\subsection{Comparison and logical functions}
-In addition to the commands described in
-Section~\ref{pgfmath-functions-comparison},
-the following command was provided by Christian Feuers\"anger:
+In addition to the commands described in
+Section~\ref{pgfmath-functions-comparison}, the following command was provided
+by Christian Feuers\"anger:
-\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.
+\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}
-\subsection{Pseudo-Random Numbers}
+\subsection{Pseudo-Random Numbers}
\label{pgfmath-random}
-In addition to the commands described in
-Section~\ref{pgfmath-functions-random},
-the following commands are provided:
+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
- $2^{31}-1$. This uses a linear congruency generator, based on ideas
- of Erich Janka.
+ Defines |\pgfmathresult| as a pseudo-random integer between 1 and
+ $2^{31}-1$. This uses a linear congruency generator, based on ideas of
+ Erich Janka.
\end{command}
\begin{command}{\pgfmathrandominteger\marg{macro}\marg{minimum}\marg{maximum}}
- This defines \meta{macro} as a pseudo-randomly generated integer from
- the range \meta{minimum} to \meta{maximum} (inclusive).
-
+ This defines \meta{macro} as a pseudo-randomly generated integer from the
+ range \meta{minimum} to \meta{maximum} (inclusive).
+ %
\begin{codeexample}[]
\begin{pgfpicture}
\foreach \x in {1,...,50}{
@@ -68,18 +68,19 @@ the following commands are provided:
\color{blue!40!white}
\pgfsetstrokecolor{blue!80!black}
\pgfusepath{stroke, fill}
- }
+ }
\end{pgfpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfmathdeclarerandomlist\marg{list name}\{\marg{item-1}\marg{item 2}...\}}
- This creates a list of items with the name \meta{list name}.
+ This creates a list of items with the name \meta{list name}.
\end{command}
\begin{command}{\pgfmathrandomitem\marg{macro}\marg{list name}}
- Select an item from a random list \meta{list name}. The
- selected item is placed in \meta{macro}.
+ Select an item from a random list \meta{list name}. The
+ selected item is placed in \meta{macro}.
\end{command}
\begin{codeexample}[]
@@ -94,117 +95,113 @@ the following commands are provided:
\color{\c!40!white}
\pgfsetstrokecolor{\c!80!black}
\pgfusepath{stroke, fill}
- }
+ }
\end{pgfpicture}
\end{codeexample}
\begin{command}{\pgfmathsetseed\marg{integer}}
- Explicitly sets the seed for the pseudo-random number generator. By
- default it is set to the value of |\time|$\times$|\year|.
+ Explicitly sets the seed for the pseudo-random number generator. By default
+ it is set to the value of |\time|$\times$|\year|.
\end{command}
-
\subsection{Base Conversion}
-
\label{pgfmath-bases}
-\pgfname{} provides limited support for conversion between
-\emph{representations} of numbers. Currently the numbers must be
-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.
+\pgfname{} provides limited support for conversion between
+\emph{representations} of numbers. Currently the numbers must be 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},
+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
- case.
+ Defines \meta{macro} as the result of converting \meta{number} from base
+ \meta{base} to base 10. Alphabetic digits can be upper or lower case.
\medskip{\def\medskip{}
\begin{codeexample}[]
\pgfmathbasetodec\mynumber{107f}{16} \mynumber
\end{codeexample}
-
- \noindent Note that, as usual in \TeX, the braces around an argument can be omitted if the argument is just a single token (a macro name is a single token).
-
+ \noindent Note that, as usual in \TeX, the braces around an argument can be
+ omitted if the argument is just a single token (a macro name is a single
+ token).
+ %
\begin{codeexample}[]
\pgfmathbasetodec\mynumber{33FC}{20} \mynumber
\end{codeexample}
}\medskip
-
+ %
\end{command}
\begin{command}{\pgfmathdectobase\marg{macro}\marg{number}\marg{base}}
- Defines \meta{macro} as the result of converting \meta{number} from
- base 10 to base \meta{base}. Any resulting alphabetic digits are in
- \emph{lower case}.
-
+ Defines \meta{macro} as the result of converting \meta{number} from base 10
+ to base \meta{base}. Any resulting alphabetic digits are in \emph{lower
+ case}.
+ %
\begin{codeexample}[]
\pgfmathdectobase\mynumber{65535}{16} \mynumber
\end{codeexample}
-
+ %
\end{command}
\begin{command}{\pgfmathdectoBase\marg{macro}\marg{number}\marg{base}}
- Defines \meta{macro} as the result of converting \meta{number} from
- base 10 to base \meta{base}. Any resulting alphabetic digits are in
- \emph{upper case}.
-
+ Defines \meta{macro} as the result of converting \meta{number} from base 10
+ to base \meta{base}. Any resulting alphabetic digits are in \emph{upper
+ case}.
+ %
\begin{codeexample}[]
\pgfmathdectoBase\mynumber{65535}{16} \mynumber
\end{codeexample}
-
+ %
\end{command}
\begin{command}{\pgfmathbasetobase\marg{macro}\marg{number}\marg{base-1}\marg{base-2}}
- Defines \meta{macro} as the result of converting \meta{number} from
- base \meta{base-1} to base \meta{base-2}. Alphabetic digits in
- \meta{number} can be upper or lower case, but any resulting
- alphabetic digits are in \emph{lower case}.
-
+ Defines \meta{macro} as the result of converting \meta{number} from base
+ \meta{base-1} to base \meta{base-2}. Alphabetic digits in \meta{number} can
+ be upper or lower case, but any resulting alphabetic digits are in
+ \emph{lower case}.
+ %
\begin{codeexample}[]
\pgfmathbasetobase\mynumber{11011011}{2}{16} \mynumber
\end{codeexample}
-
+ %
\end{command}
\begin{command}{\pgfmathbasetoBase\marg{macro}\marg{number}\marg{base-1}\marg{base-2}}
- Defines \meta{macro} as the result of converting \meta{number} from
- base \meta{base-1} to base \meta{base-2}. Alphabetic digits in
- \meta{number} can be upper or lower case, but any resulting
- alphabetic digits are in \emph{upper case}.
-
+ Defines \meta{macro} as the result of converting \meta{number} from base
+ \meta{base-1} to base \meta{base-2}. Alphabetic digits in \meta{number} can
+ be upper or lower case, but any resulting alphabetic digits are in
+ \emph{upper case}.
+ %
\begin{codeexample}[]
\pgfmathbasetoBase\mynumber{121212}{3}{12} \mynumber
\end{codeexample}
-
+ %
\end{command}
-
\begin{command}{\pgfmathsetbasenumberlength\marg{integer}}
- Sets the number of digits in the result of a base conversion to
- \meta{integer}. If the result of a conversion has less digits
- than this number, it is prefixed with zeros.
-
+ Sets the number of digits in the result of a base conversion to
+ \meta{integer}. If the result of a conversion has less digits than this
+ number, it is prefixed with zeros.
+ %
\begin{codeexample}[]
\pgfmathsetbasenumberlength{8}
\pgfmathdectobase\mynumber{15}{2} \mynumber
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfmathtodigitlist\marg{macro}\marg{number}}
-
- This command converts \meta{number} into a comma-separated
- list of digits and stores the result in \meta{macro}.
- The \marg{number} is \emph{not} parsed before processing.
-
+ This command converts \meta{number} into a comma-separated list of digits
+ and stores the result in \meta{macro}. The \marg{number} is \emph{not}
+ parsed before processing.
+ %
\begin{codeexample}[]
\pgfmathsetbasenumberlength{8}
\begin{tikzpicture}[x=0.25cm, y=0.25cm]
@@ -216,35 +213,34 @@ the following commands are provided:
}
\end{tikzpicture}
\end{codeexample}
-
+ %
\end{command}
\subsection{Angle Computations}
-Unlike the rest of the math engine, which is a ``standalone'' package,
-the following commands only work in conjunction with the core of
-\pgfname.
-
-
+Unlike the rest of the math engine, which is a ``standalone'' package, the
+following commands only work in conjunction with the core of \pgfname.
\begin{command}{\pgfmathanglebetweenpoints\marg{p}\marg{q}}
- Returns the angle of a line from \meta{p} to \meta{q} relative to a
- line going straight right from \meta{p}.
-
+ Returns the angle of a line from \meta{p} to \meta{q} relative to a line
+ going straight right from \meta{p}.
+ %
\begin{codeexample}[]
\pgfmathanglebetweenpoints{\pgfpoint{1cm}{3cm}}{\pgfpoint{2cm}{4cm}}
\pgfmathresult
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfmathanglebetweenlines\marg{$p_1$}\marg{$q_1$}\marg{$p_2$}\marg{$q_2$}}
- Returns the clockwise angle between a line going through $p_1$ and
- $q_1$ and a line going through $p_2$ and $q_2$.
-
+ Returns the clockwise angle between a line going through $p_1$ and $q_1$
+ and a line going through $p_2$ and $q_2$.
+ %
\begin{codeexample}[]
\pgfmathanglebetweenlines{\pgfpoint{1cm}{3cm}}{\pgfpoint{2cm}{4cm}}
- {\pgfpoint{0cm}{1cm}}{\pgfpoint{1cm}{0cm}}
+ {\pgfpoint{0cm}{1cm}}{\pgfpoint{1cm}{0cm}}
\pgfmathresult
\end{codeexample}
+ %
\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 59295dc7c9d..43a93b08b5f 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
@@ -8,46 +8,42 @@
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-
\section{Design Principles}
-\pgfname{} needs to perform many computations while typesetting a
-picture. For this, \pgfname\ relies on a mathematical engine, which
-can also be used independently of \pgfname, but which is distributed
-as part of the \pgfname\ package nevertheless. Basically, the engine
-provides a parsing mechanism similar to the \calcname{} package so
-that expressions like |2*3cm+5cm| can be parsed; but the \pgfname\
-engine is more powerful and can be extended and enhanced.
-
-\pgfname{} provides enhanced functionality, which permits the parsing
-of mathematical operations involving integers and non-integers
-with or without units. Furthermore, various functions, including
-trigonometric functions and random number generators can also be
-parsed (see Section~\ref{pgfmath-parsing}).
-The \calcname{} macros |\setlength| and friends have \pgfname{} versions
-which can parse these operations and functions
-(see Section~\ref{pgfmath-registers}). Additionally, each operation
-and function has an independent \pgfname{} command associated with it
-(see Section~\ref{pgfmath-commands}), and can be
-accessed outside the parser.
-
-The mathematical engine of \pgfname\ is implicitly used whenever you
-specify a number or dimension in a higher-level macro. For instance,
-you can write |\pgfpoint{2cm+4cm/2}{3cm*sin(30)}| or
-suchlike. However, the mathematical engine can also be used
-independently of the \pgfname\ core, that is, you can also just load
-it to get access to a mathematical parser.
+\pgfname{} needs to perform many computations while typesetting a picture. For
+this, \pgfname\ relies on a mathematical engine, which can also be used
+independently of \pgfname, but which is distributed as part of the \pgfname\
+package nevertheless. Basically, the engine provides a parsing mechanism
+similar to the \calcname{} package so that expressions like |2*3cm+5cm| can be
+parsed; but the \pgfname\ engine is more powerful and can be extended and
+enhanced.
+
+\pgfname{} provides enhanced functionality, which permits the parsing of
+mathematical operations involving integers and non-integers with or without
+units. Furthermore, various functions, including trigonometric functions and
+random number generators can also be parsed (see
+Section~\ref{pgfmath-parsing}). The \calcname{} macros |\setlength| and friends
+have \pgfname{} versions which can parse these operations and functions (see
+Section~\ref{pgfmath-registers}). Additionally, each operation and function has
+an independent \pgfname{} command associated with it (see
+Section~\ref{pgfmath-commands}), and can be accessed outside the parser.
+
+The mathematical engine of \pgfname\ is implicitly used whenever you specify a
+number or dimension in a higher-level macro. For instance, you can write
+|\pgfpoint{2cm+4cm/2}{3cm*sin(30)}| or suchlike. However, the mathematical
+engine can also be used independently of the \pgfname\ core, that is, you can
+also just load it to get access to a mathematical parser.
\subsection{Loading the Mathematical Engine}
-The mathematical engine of \pgfname\ is loaded automatically by
-\pgfname, but if you wish to use the mathematical engine but you do
-not need \pgfname\ itself, you can load the following package:
+The mathematical engine of \pgfname\ is loaded automatically by \pgfname, but
+if you wish to use the mathematical engine but you do 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}
@@ -55,56 +51,45 @@ not need \pgfname\ itself, you can load the following package:
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
- the command |\pgfmathparse|. This command parses a mathematical
- expression and evaluates it.
-
- Additionally, the top layer also defines some additional functions
- 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
- 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
- the computations. These can be changed (and possibly be made more
- efficient) without affecting the higher layers.
+ \item The top layer, which you will typically use directly, provides the
+ command |\pgfmathparse|. This command parses a mathematical expression
+ and evaluates it.
+
+ Additionally, the top layer also defines some additional functions
+ 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 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 the
+ computations. These can be changed (and possibly be made more
+ efficient) without affecting the higher layers.
\end{enumerate}
-
\subsection{Efficiency and Accuracy of the Mathematical Engine}
-Currently, the mathematical algorithms are all implemented in \TeX.
-This poses some intriguing programming challenges as \TeX{} is a
-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 your
-purposes, you will have to replace the algorithms in the
-implementation layer.
-
-All the fancy mathematical ``bells-and-whistles'' that the parser
-provides, come with an additional processing cost, and in some
-instances, such as simply setting a length to |1cm|, with no other
-operations involved, the additional processing time is undesirable.
-To overcome this, the following feature is implemented: when no
-mathematical operations are required, an expression
-can be preceded by |+|. This will bypass the parsing process and the
-assignment will be orders of magnitude faster. This feature
-\emph{only} works with the macros for setting registers described in
-Section~\ref{pgfmath-registers}.
-
+Currently, the mathematical algorithms are all implemented in \TeX. This poses
+some intriguing programming challenges as \TeX{} is a 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 your purposes, you will have to replace the
+algorithms in the implementation layer.
+
+All the fancy mathematical ``bells-and-whistles'' that the parser provides,
+come with an additional processing cost, and in some instances, such as simply
+setting a length to |1cm|, with no other operations involved, the additional
+processing time is undesirable. To overcome this, the following feature is
+implemented: when no mathematical operations are required, an expression can be
+preceded by |+|. This will bypass the parsing process and the assignment will
+be orders of magnitude faster. This feature \emph{only} works with the macros
+for setting registers described in Section~\ref{pgfmath-registers}.
+%
\begin{codeexample}[code only]
\pgfmathsetlength\mydimen{1cm} % parsed : slower.
\pgfmathsetlength\mydimen{+1cm} % not parsed : much faster.
\end{codeexample}
-
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
index c3afcc8b234..9cd4a9a6dd6 100644
--- 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
@@ -1,32 +1,33 @@
-\section{Number Printing}
-\label{pgfmath-numberprinting}%
+\section{Number Printing}
+\label{pgfmath-numberprinting}
-{\emph{An extension by Christian Feuers\"anger}}
+{\emph{An extension by Christian Feuersänger}}
\medskip
\noindent
-\pgfname\ supports number printing in different styles and rounds to arbitrary precision.
+\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 \meta{x}. The
- input number \meta{x} is parsed using |\pgfmathfloatparsenumber|
- which allows arbitrary precision.
+ Generates pretty-printed output for the (real) number \meta{x}. The input
+ number \meta{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}|]|\meta{x}.
+ 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}|]|\meta{x}.
\end{command}
\begin{command}{\pgfmathprintnumberto\marg{x}\marg{macro}}
- Returns the resulting number into \meta{macro}
- instead of typesetting it directly.
+ Returns the resulting number into \meta{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.
-
+ 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}
@@ -36,14 +37,13 @@
\pgfmathprintnumber{123456.12345}
\end{codeexample}
- See section~\ref{sec:number:styles} for how to change the
- appearance.
+ 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.
-
+ 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}
@@ -52,8 +52,10 @@
\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).
+ %
+ 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}
@@ -62,16 +64,14 @@
\pgfmathprintnumber{123456.12345}
\end{codeexample}
- See section~\ref{sec:number:styles} for how to change the
- appearance.
+ 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).
-
+ 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}
@@ -81,14 +81,13 @@
\pgfmathprintnumber{123456.12345}
\end{codeexample}
-See section~\ref{sec:number:styles} for how to change the exponential
-display style.
+ 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.
-
+ 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}
@@ -97,26 +96,28 @@ display style.
\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).
+ %
+ 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.
+ 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.
+ 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.
-
+ /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}
@@ -125,22 +126,26 @@ display style.
\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 the scientific format can be
- adjusted with |sci precision| if necessary.
+ %
+ 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 the scientific format can be adjusted with |sci precision| if
+ necessary.
\end{keylist}
\begin{keylist}{/pgf/number format/relative*=\meta{exponent base 10}}
- Configures |\pgfmathprintnumber| to format numbers relative to an
- order of magnitude, $10^r$, where $r$ is an integer number.
+ Configures |\pgfmathprintnumber| to format numbers relative to an order of
+ magnitude, $10^r$, where $r$ is an integer number.
+
+ This key addresses different use-cases.
+
+ \paragraph{First use-case:}
- This key addresses different use-cases.
-
- \paragraph{First use-case:} provide a unified format for a
- \emph{sequence} of numbers. Consider the following test:
+ provide a unified format for a \emph{sequence} of numbers. Consider the
+ following test:
+ %
\begin{codeexample}[]
\pgfkeys{/pgf/number format/relative*={1}}
\pgfmathprintnumber{6.42e-16}\hspace{1em}
@@ -149,24 +154,26 @@ display style.
\pgfmathprintnumber{20.6}\hspace{1em}
\pgfmathprintnumber{87}
\end{codeexample}
- \noindent With any other style, the |6.42e-16| would have been
- formatted as an isolated number. Here, it is rounded to |0| because
- when viewed relative to $10^1$ (the exponent $1$ is the argument for
- |relative|), it has no significant digits.
-
+ %
+ \noindent With any other style, the |6.42e-16| would have been formatted as
+ an isolated number. Here, it is rounded to |0| because when viewed relative
+ to $10^1$ (the exponent $1$ is the argument for |relative|), it has no
+ significant digits.
+ %
\begin{codeexample}[]
\pgfkeys{/pgf/number format/relative*={2}}
\pgfmathprintnumber{123.345}\hspace{1em}
\pgfmathprintnumber{0.0012}\hspace{1em}
\pgfmathprintnumber{0.0014}\hspace{1em}
\end{codeexample}
- \noindent The example above applies the initial |precision=2| to
- |123.345| -- relative to $100$. Two significant digits of |123.345|
- relative to $100$ are |123|. Note that the ``$2$ significant digits
- of |123.345|'' translates to ``round |1.2345| to $2$ digits'', which
- would yield |1.2300|. Similarly, the other two numbers are |0|
- compared to $100$ using the given |precision|.
-
+ %
+ \noindent The example above applies the initial |precision=2| to |123.345|
+ -- relative to $100$. Two significant digits of |123.345| relative to $100$
+ are |123|. Note that the ``$2$ significant digits of |123.345|'' translates
+ to ``round |1.2345| to $2$ digits'', which would yield |1.2300|. Similarly,
+ the other two numbers are |0| compared to $100$ using the given
+ |precision|.
+ %
\begin{codeexample}[]
\pgfkeys{/pgf/number format/relative*={-3}}
\pgfmathprintnumber{123.345}\hspace{1em}
@@ -174,81 +181,87 @@ display style.
\pgfmathprintnumber{0.0014}\hspace{1em}
\end{codeexample}
- \paragraph{Second use-case:} improve rounding in the presence of
- \emph{inaccurate} numbers. Let us suppose that some
- limited-precision arithmetics resulted in the result |123456999|
- (like the |fpu| of \pgfname). You know that its precision is about
- five or six significant digits. And you want to provide a fixed
- point output. In this case, the trailing digits |....999| are a
- numerical artifact due to the limited precision. Use
- |relative*=3,precision=0| to eliminate the artifacts:
+ \paragraph{Second use-case:}
+
+ improve rounding in the presence of \emph{inaccurate} numbers. Let us
+ suppose that some limited-precision arithmetics resulted in the result
+ |123456999| (like the |fpu| of \pgfname). You know that its precision is
+ about five or six significant digits. And you want to provide a fixed point
+ output. In this case, the trailing digits |....999| are a numerical
+ artifact due to the limited precision. Use |relative*=3,precision=0| to
+ eliminate the artifacts:
+ %
\begin{codeexample}[]
\pgfkeys{/pgf/number format/.cd,relative*={3},precision=0}
\pgfmathprintnumber{123456999}\hspace{1em}
\pgfmathprintnumber{123456999.12}
\end{codeexample}
- \noindent Here, |precision=0| means that we inspect |123456.999| and
- round that number to $0$ digits. Finally, we move the period back to
- its initial position. Adding |relative style=fixed| results in fixed
- point output format:
+ %
+ \noindent Here, |precision=0| means that we inspect |123456.999| and round
+ that number to $0$ digits. Finally, we move the period back to its initial
+ position. Adding |relative style=fixed| results in fixed point output
+ format:
+ %
\begin{codeexample}[]
\pgfkeys{/pgf/number format/.cd,relative*={3},precision=0,relative style=fixed}
\pgfmathprintnumber{123456999}\hspace{1em}
\pgfmathprintnumber{123456999.12}
\end{codeexample}
- \noindent Note that there is another alternative for this use-case
- which is discussed later: the |fixed relative| style.
+ %
+ \noindent Note that there is another alternative for this use-case which is
+ discussed later: the |fixed relative| style.
+ %
\begin{codeexample}[]
\pgfkeys{/pgf/number format/.cd,fixed relative,precision=6}
\pgfmathprintnumber{123456999}\hspace{1em}
\pgfmathprintnumber{123456999.12}
\end{codeexample}
-
- You might wonder why there is an asterisk in the key's name. The
- short answer is: there is also a \declareandlabel{/pgf/number
- format/relative} number printer which does unexpected things. The
- key |relative*| repairs this. Existing code will still use the old
- behavior.
-
- Technically, the key works as follows: as already explained above,
- |relative*=3| key applied to |123456999.12| moves the period by
- three positions and analyzes |123456.99912|. Mathematically
- speaking, we are given a number $x = \pm m \cdot 10^e$ and we
- attempt to apply |relative*=|$r$. The method then rounds $x / 10^r$
- to |precision| digits. Afterwards, it multiplies the result by
- $10^r$ and typesets it.
+
+ You might wonder why there is an asterisk in the key's name. The short
+ answer is: there is also a \declareandlabel{/pgf/number format/relative}
+ number printer which does unexpected things. The key |relative*| repairs
+ this. Existing code will still use the old behavior.
+
+ Technically, the key works as follows: as already explained above,
+ |relative*=3| key applied to |123456999.12| moves the period by three
+ positions and analyzes |123456.99912|. Mathematically speaking, we are
+ given a number $x = \pm m \cdot 10^e$ and we attempt to apply
+ |relative*=|$r$. The method then rounds $x / 10^r$ to |precision| digits.
+ Afterwards, it multiplies the result by $10^r$ and typesets it.
\end{keylist}
\begin{stylekey}{/pgf/number format/every relative}
- A style which configures how the |relative| method finally displays
- its results.
+ A style which configures how the |relative| method finally displays its
+ results.
- The initial configuration is
+ The initial configuration is
+ %
\begin{codeexample}[code only]
\pgfkeys{/pgf/number format/every relative/.style=std}
\end{codeexample}
- Note that rounding is turned off when the resulting style is being
- evaluated (since |relative| already rounded the number).
+ Note that rounding is turned off when the resulting style is being
+ evaluated (since |relative| already rounded the number).
- Although supported, I discourage from using |fixed zerofill| or
- |sci zerofill| in this context -- it may lead to a suggestion of higher
- precision than is actually used (because |fixed zerofill| might
- simply add |.00| although there was a different information before
- |relative| rounded the result).
+ Although supported, I discourage from using |fixed zerofill| or
+ |sci zerofill| in this context -- it may lead to a suggestion of higher
+ precision than is actually used (because |fixed zerofill| might simply add
+ |.00| although there was a different information before |relative| rounded
+ the result).
\end{stylekey}
\begin{key}{/pgf/number format/relative style=\marg{options}}
- The same as |every relative/.append style=|\marg{options}.
+ The same as |every relative/.append style=|\marg{options}.
\end{key}
\begin{keylist}{/pgf/number format/fixed relative}
- Configures |\pgfmathprintnumber| to format numbers in a similar way
- to the |fixed| style, but the |precision| is interpreted relatively
- to the number's exponent.
+ Configures |\pgfmathprintnumber| to format numbers in a similar way to the
+ |fixed| style, but the |precision| is interpreted relatively to the
+ number's exponent.
- The motivation is to get the same rounding effect as for |sci|, but
- to display the number in the |fixed| style:
+ The motivation is to get the same rounding effect as for |sci|, but to
+ display the number in the |fixed| style:
+ %
\begin{codeexample}[]
\pgfkeys{/pgf/number format/.cd,fixed relative,precision=3}
\pgfmathprintnumber{1000.0123}\hspace{1em}
@@ -259,35 +272,33 @@ display style.
\pgfmathprintnumber{1003.75}\hspace{1em}
\pgfmathprintnumber{1006.75}\hspace{1em}
\end{codeexample}
-
- The effect of |fixed relative| is that the number is rounded to
- \emph{exactly} the first \meta{precision} non-zero digits, no matter
- how many leading zeros the number might have.
-
- Use |fixed relative| if you want |fixed| and if you know that only
- the first $n$ digits are correct. Use |sci| if you need a scientific
- display style and only the first $n$ digits are correct.
-
- Note that |fixed relative| ignores the |fixed zerofill| flag.
-
- See also the |relative*| key. Note that the
- |relative=|\marg{exponent} key explicitly moves the period to some
- designated position before it attempts to round the
- number. Afterwards, it ``rounds from the right'', i.e.\ it rounds to
- that explicitly chosen digit position. In contrast to that,
- |fixed relative| ``rounds from the left'': it takes the \emph{first}
- non-zero digit, temporarily places the period after this digit, and
- rounds that number. The rounding style |fixed| leaves the period
- where it is, and rounds everything behind that digit. The |sci|
- style is similar to |fixed relative|.
-\end{keylist}
+ The effect of |fixed relative| is that the number is rounded to
+ \emph{exactly} the first \meta{precision} non-zero digits, no matter how
+ many leading zeros the number might have.
-\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.
+ Use |fixed relative| if you want |fixed| and if you know that only the
+ first $n$ digits are correct. Use |sci| if you need a scientific display
+ style and only the first $n$ digits are correct.
+
+ Note that |fixed relative| ignores the |fixed zerofill| flag.
+
+ See also the |relative*| key. Note that the |relative=|\marg{exponent} key
+ explicitly moves the period to some designated position before it attempts
+ to round the number. Afterwards, it ``rounds from the right'', i.e.\ it
+ rounds to that explicitly chosen digit position. In contrast to that,
+ |fixed relative| ``rounds from the left'': it takes the \emph{first}
+ non-zero digit, temporarily places the period after this digit, and rounds
+ that number. The rounding style |fixed| leaves the period where it is, and
+ rounds everything behind that digit. The |sci| style is similar to |fixed
+ relative|.
+\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}
@@ -296,27 +307,29 @@ display style.
\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.
+ 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.
+ 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|.
+ 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).
+ 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}
@@ -325,11 +338,12 @@ display style.
\pgfmathprintnumber{24415.98123}\hspace{1em}
\pgfmathprintnumber{123456.12345}
\end{codeexample}
+ %
\end{key}
\begin{key}{/pgf/number format/frac}
- Displays numbers as fractionals.
-
+ Displays numbers as fractionals.
+ %
\begin{codeexample}[width=3cm]
\pgfkeys{/pgf/number format/frac}
\pgfmathprintnumber{0.333333333333333}\hspace{1em}
@@ -348,13 +362,14 @@ display style.
\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 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{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}
@@ -363,11 +378,13 @@ display style.
\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.
+ \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}
@@ -376,237 +393,260 @@ display style.
\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/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.
+ 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.
+ 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).
+ Use |sci precision={}| to restore the initial configuration (which uses the
+ argument provided to |precision| for all number styles).
\end{key}
\begin{key}{/pgf/number format/read comma as period=\mchoice{true,false} (initially false)}
- This is one of the few keys which allows to customize the number parser. If this switch is turned on, a comma is read just as a period.
+ This is one of the few keys which allows to customize the number parser. If
+ this switch is turned on, a comma is read just as a period.
+ %
\begin{codeexample}[]
\pgfkeys{/pgf/number format/read comma as period}
\pgfmathprintnumber{1234,56}
\end{codeexample}
- This is typically undesired as it can cause side--effects with math parsing instructions. However, it is supported to format input numbers or input tables. Consider |use comma| to typeset the result with a comma as well.
+ %
+ This is typically undesired as it can cause side-effects with math parsing
+ instructions. However, it is supported to format input numbers or input
+ tables. Consider |use comma| to typeset the result with a comma as well.
+ %
\begin{codeexample}[]
\pgfkeys{/pgf/number format/.cd,
- read comma as period,
- use comma}
+ read comma as period,
+ use comma}
\pgfmathprintnumber{1234,56}
\end{codeexample}
+ %
\end{key}
+
\subsection{Changing display styles}%
-\label{sec:number: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.
+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).
+ 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|.
+ 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|.
+ 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).
-
+ 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={}}
+ 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={}}
+ 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={.}}
+ 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={,}}
+ 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={{{,}}}}
+ fixed,
+ fixed zerofill,
+ precision=2,
+ set thousands separator={{{,}}}}
\pgfmathprintnumber{1234567890}
\end{codeexample}
- The last example employs commas and disables the default
- comma-spacing.
+ %
+ 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|.
+ 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|.
+ Just another name for |set thousands separator|.
\end{stylekey}
\begin{key}{/pgf/number format/1000 sep in fractionals=\marg{boolean} (initially false)}
- Configures whether the fractional part should also be grouped into
- groups of three digits.
+ Configures whether the fractional part should also be grouped into groups
+ of three digits.
- The value |true| will active the |1000 sep| for both, integer and
- fractional parts. The value |false| will active |1000 sep| only for the integer part.
+ The value |true| will active the |1000 sep| for both, integer and
+ fractional parts. The value |false| will active |1000 sep| only for the
+ integer part.
+ %
\begin{codeexample}[]
\pgfkeys{/pgf/number format/.cd,
- fixed,
- precision=999,
- set thousands separator={\,},
- 1000 sep in fractionals,
- }
+ fixed,
+ precision=999,
+ set thousands separator={\,},
+ 1000 sep in fractionals,
+ }
\pgfmathprintnumber{1234.1234567}
\end{codeexample}
+ %
\begin{codeexample}[]
\pgfkeys{/pgf/number format/.cd,
- fixed,fixed zerofill,
- precision=9,
- set thousands separator={\,},
- 1000 sep in fractionals,
- }
+ fixed,fixed zerofill,
+ precision=9,
+ set thousands separator={\,},
+ 1000 sep in fractionals,
+ }
\pgfmathprintnumber{1234.1234567}
\end{codeexample}
+ %
\end{key}
\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$.
+ 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}
+ 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}
+ 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}
+ 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).
+ %
+ \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.
-
+ 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.
-
+ 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.
+ 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.}
+ 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}
+ 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 the display of plus signs for non-negative
- numbers.
+ Enables or disables the display of plus signs for non-negative numbers.
+ %
\begin{codeexample}[]
\pgfkeys{/pgf/number format/showpos}
\pgfmathprintnumber{12.345}
@@ -621,190 +661,214 @@ display style generates proper \TeX-code.
\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}.
+ 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.
-
+ 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|'.
+ 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.
-
+ 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}'.
-
+ 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 little space.
-
+ Typesets the exponent as subscript for any number displayed in scientific
+ format. This style requires very little 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 little space.
-
+ Typesets the exponent as superscript for any number displayed in scientific
+ format. This style requires very little 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}
-
+ 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}}}}
+ /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.
+ %
+ 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.
+ 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/retain unit mantissa=\mchoice{true,false} (initially true)}
+ Allows to omit a unit mantissa.
+ %
+\begin{codeexample}[]
+\pgfkeys{
+ /pgf/number format/.cd,
+ sci, retain unit mantissa=false}
+\pgfmathprintnumber{10.5};
+\pgfmathprintnumber{10};
+\pgfmathprintnumber{1010};
+\pgfmathprintnumber[precision=1]{-1010};
+\end{codeexample}
+ %
+ The feature is applied after rounding to the desired precision: if the
+ remaining mantissa is equal to~$1$, it will be omitted. It applies to all
+ styles involving the scientific format (including |std|).
+\end{key}
\begin{key}{/pgf/number format/\protect\atmarktext 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.
+ 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.
+ This key should never be used to change the decimal separator!
+ Use |dec sep| instead.
\end{key}
\begin{key}{/pgf/number format/\protect\atmarktext 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.
+ 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!
+ 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}
+ 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.
+ 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}
+ /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.
+ %
+ 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 intend to write
- output files.
+ 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 intend 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$.
+% \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%
+% #1{\cdot}#2%
% }%
% \def\myfixedpointstyle#1{%
-% \pgfutilensuremath{%
-% \ifpgfmathfloatroundhasperiod
-% \expandafter\myfixedpointstyleimpl#1\relax
-% \else
-% #1%
-% \fi
-% }%
+% \pgfutilensuremath{%
+% \ifpgfmathfloatroundhasperiod
+% \expandafter\myfixedpointstyleimpl#1\relax
+% \else
+% #1%
+% \fi
+% }%
% }
% \pgfkeys{/my own fixed point style/.code={%
-% \let\pgfmathprintnumber@fixed@style=\myfixedpointstyle}
+% \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.
+% 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:
+% \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'
+% % 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},
+% \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 8cdadabe281..7cb2392d659 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
@@ -6,306 +6,274 @@
% 2. under the GNU Free Documentation License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-%
-\section{Mathematical Expressions}
+\section{Mathematical Expressions}
\label{pgfmath-syntax}
-The easiest way of using \pgfname's mathematical engine is to provide
-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 can 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, in addition, 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
+The easiest way of using \pgfname's mathematical engine is to provide 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 can 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, in addition, 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
-explained.
+In the present section, the high-level macros for parsing an expression are
+explained first, then the syntax for expression is explained.
\subsection{Parsing Expressions}
-
\label{pgfmath-registers}
-
\label{pgfmath-parsing}
\subsubsection{Commands}
-The basic command for invoking the parser of \pgfname's mathematical
-engine is the following:
+The \todosp{why 2 labels?}basic command for invoking the parser of \pgfname's
+mathematical engine is the following:
\begin{command}{\pgfmathparse\marg{expression}}
- This macro parses \meta{expression} and returns the result without
- units in the macro |\pgfmathresult|.
-
- \example |\pgfmathparse{2pt+3.5pt}| will set |\pgfmathresult| to the
- text |5.5|.
-
- In the following, the special properties of this command are
- explained. The exact syntax of mathematical expressions is explained
- in Sections \ref{pgfmath-operators} and~\ref{pgfmath-functions}.
-
- \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. All numbers
- with units are converted to points first. See
- Section~\ref{pgfmath-units} for details on units.
- \item
- The parser will 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.
-
- \item
- The $\varepsilon$-TeX\ extensions |\dimexpr|, |\numexpr|, |\glueexpr|, and
- |\muexpr| are recognized and evaluated. The values they
- result in will be used in the further evaluation, as if you had
- put |\the| before them.
-
- \item
- Parenthesis can be used to change the order of the evaluation.
-
- \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.
-
- \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|).
-
- \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.
-
- \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
- An integer with prefix |0b| or |0B| is interpreted as a binary
- number and is automatically converted to base 10.
-
- \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.
-
- \end{itemize}
-
+ This macro parses \meta{expression} and returns the result without units in
+ the macro |\pgfmathresult|.
+
+ \example |\pgfmathparse{2pt+3.5pt}| will set |\pgfmathresult| to the text
+ |5.5|.
+
+ In the following, the special properties of this command are explained. The
+ exact syntax of mathematical expressions is explained in Sections
+ \ref{pgfmath-operators} and~\ref{pgfmath-functions}.
+ %
+ \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. All numbers with
+ units are converted to points first. See
+ Section~\ref{pgfmath-units} for details on units.
+ \item The parser will 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.
+ \item The $\varepsilon$-TeX\ extensions |\dimexpr|, |\numexpr|,
+ |\glueexpr|, and |\muexpr| are recognized and evaluated. The values
+ they result in will be used in the further evaluation, as if you
+ had put |\the| before them.
+ \item Parenthesis can be used to change the order of the evaluation.
+ \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.
+ \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|).
+ \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.
+ \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 An integer with prefix |0b| or |0B| is interpreted as a binary
+ number and is automatically converted to base 10.
+ \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.
+ \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, 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 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.
+ 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
+ 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}{\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 always, without units). The result of the custom
- action should be used to redefine |\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.
-
+ 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
+ always, without units). The result of the custom action should be used to
+ redefine |\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 use wrapper commands,
-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.
+Instead of the |\pgfmathparse| macro you can also use wrapper commands, 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.
-The effect of the following commands is always local to the current
-\TeX\ scope.
+The effect of the following commands is always local to the current \TeX\
+scope.
\begin{command}{\pgfmathsetlength\marg{register}\marg{expression}}
- Basically, this command sets the length of the \TeX{}
- \meta{register} to the value specified by
- \meta{expression}. However, there is some fine print:
-
- First, in case \meta{expression} starts with a |+|, a simple \TeX\
- assignment is done. In particular, \meta{register} can be a glue
- register and \meta{expression} be something like |+1pt plus 1fil|
- and the \meta{register} will be assigned the expected value.
-
- Second, when the \meta{expression} does not start with |+|, it is
- first parsed using |\pgfmathparse|, resulting in a (dimensionless)
- value |\pgfmathresult|. Now, if the parser encountered the unit |mu|
- somewhere in the expression, it assumes that \meta{register} is a
- |\muskip| register and will try to assign to \meta{register} the
- value |\pgfmathresult| followed by |mu|. Otherwise, in case |mu| was
- not encountered, it is assumed that \meta{register} is a dimension
- register or a glue register and we assign |\pgfmathresult| followed
- by |pt| to it.
-
- The net effect of the above is that you can write things like
+ Basically, this command sets the length of the \TeX{} \meta{register} to
+ the value specified by \meta{expression}. However, there is some fine
+ print:
+
+ First, in case \meta{expression} starts with a |+|, a simple \TeX\
+ assignment is done. In particular, \meta{register} can be a glue register
+ and \meta{expression} be something like |+1pt plus 1fil| and the
+ \meta{register} will be assigned the expected value.
+
+ Second, when the \meta{expression} does not start with |+|, it is first
+ parsed using |\pgfmathparse|, resulting in a (dimensionless) value
+ |\pgfmathresult|. Now, if the parser encountered the unit |mu| somewhere in
+ the expression, it assumes that \meta{register} is a |\muskip| register and
+ will try to assign to \meta{register} the value |\pgfmathresult| followed
+ by |mu|. Otherwise, in case |mu| was not encountered, it is assumed that
+ \meta{register} is a dimension register or a glue register and we assign
+ |\pgfmathresult| followed by |pt| to it.
+
+ The net effect of the above is that you can write things like
+ %
\begin{codeexample}[]
\muskipdef\mymuskip=0
- \pgfmathsetlength{\mymuskip}{1mu+3*4mu} \the\mymuskip
+ \pgfmathsetlength{\mymuskip}{1mu+3*4mu} \the\mymuskip
\end{codeexample}
-\begin{codeexample}[]
- \dimendef\mydimen=0
+ %
+\begin{codeexample}[]
+ \dimendef\mydimen=0
\pgfmathsetlength{\mydimen}{1pt+3*4pt} \the\mydimen
\end{codeexample}
-\begin{codeexample}[]
- \skipdef\myskip=0
+ %
+\begin{codeexample}[]
+ \skipdef\myskip=0
\pgfmathsetlength{\myskip}{1pt+3*4pt} \the\myskip
\end{codeexample}
- One thing that will \emph{not} work is
- |\pgfmathsetlength{\myskip}{1pt plus 1fil}| since the parser does
- not support fill's. You can, however, use the |+| notation in this
- case:
-\begin{codeexample}[]
- \skipdef\myskip=0
+ One thing that will \emph{not} work is
+ |\pgfmathsetlength{\myskip}{1pt plus 1fil}| since the parser does not
+ support fill's. You can, however, use the |+| notation in this case:
+ %
+\begin{codeexample}[]
+ \skipdef\myskip=0
\pgfmathsetlength{\myskip}{+1pt plus 1fil} \the\myskip
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfmathaddtolength\marg{register}\marg{expression}}
- Adds the value of \meta{expression} to the \TeX{}
- \meta{register}. All of the special consideration mentioned for
- |\pgfmathsetlength| also apply here in the same way.
+ Adds the value of \meta{expression} to the \TeX{} \meta{register}. All of
+ the special consideration mentioned for |\pgfmathsetlength| also apply here
+ in the same way.
\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{}
- \meta{count register}.
+ 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
- \meta{counter}.
+ Adds the \emph{truncated} value of \meta{expression} to \meta{counter}.
\end{command}
\begin{command}{\pgfmathsetmacro\marg{macro}\marg{expression}}
- Defines \meta{macro} as the value of \meta{expression}. The result
- is a decimal without units.
+ Defines \meta{macro} as the value of \meta{expression}. The result is a
+ decimal without units.
\end{command}
\begin{command}{\pgfmathsetlengthmacro\marg{macro}\marg{expression}}
- Defines \meta{macro} as the value of \meta{expression}
- \LaTeX{} \emph{in points}.
+ Defines \meta{macro} as the value of \meta{expression} \LaTeX{} \emph{in
+ points}.
\end{command}
\begin{command}{\pgfmathtruncatemacro\marg{macro}\marg{expression}}
- Defines \meta{macro} as the truncated value of \meta{expression}.
+ Defines \meta{macro} as the truncated value of \meta{expression}.
\end{command}
\subsubsection{Considerations Concerning Units}
\label{pgfmath-units}
-As was explained earlier, the parser commands like |\pgfmathparse|
-will always return a result without units in it and all dimensions
-that have a unit like |10pt| or |1in| will first be converted to \TeX\
-points (|pt|) and, then, the unit is dropped.
+As was explained earlier, the parser commands like |\pgfmathparse| will always
+return a result without units in it and all dimensions that have a unit like
+|10pt| or |1in| will first be converted to \TeX\ points (|pt|) and, then, the
+unit is dropped.
-Sometimes it is useful, nevertheless, to find out whether an
-expression or not. For this, you can use the following commands:
+Sometimes it is useful, nevertheless, to find out whether an expression or not.
+For this, you can use the following commands:
{\let\ifpgfmathunitsdeclared\relax
\begin{command}{\ifpgfmathunitsdeclared}
After a call of |\pgfmathparse| this if will be true exactly if
some unit was encountered in the expression. It is always set
globally in each call.
-
+
Note that \emph{any} ``mentioning'' of a unit inside an
expression will set this \TeX-if to true. In particular, even an
expressionlike |2pt/1pt|, which arguably should be considered
``scalar'' or ``unit-free'' will still have this \TeX-if set to
true. However, see the |scalar| function for a way to change
- this.
+ this.
\end{command}
}
\begin{math-function}{scalar(\mvar{value})}
- \mathcommand
-
- This function is the identity function on its input, but it will
- reset the \TeX-if |\ifpgfmathunitsdeclared|. Thus, it can be used to
- indicate that the given \meta{value} should be considered as a
- ``scalar'' even when it contains units; but note that it will work
- even when the \meta{value} is a string or something else. The only
- effect of this function is to clear the unit declaration.
-
+\mathcommand
+ This function is the identity function on its input, but it will reset the
+ \TeX-if |\ifpgfmathunitsdeclared|. Thus, it can be used to indicate that
+ the given \meta{value} should be considered as a ``scalar'' even when it
+ contains units; but note that it will work even when the \meta{value} is a
+ string or something else. The only effect of this function is to clear the
+ unit declaration.
+ %
\begin{codeexample}[]
\pgfmathparse{scalar(1pt/2pt)} \pgfmathresult\
\ifpgfmathunitsdeclared with \else without \fi unit
\end{codeexample}
- Note, however, that this command (currently) really just clears the
- \TeX-if as the input is scanned from left-to-right. Thus, even if
- there is a use of a unit before the |scalar| function is used, the
- \TeX-if will be cleared:
-
+ Note, however, that this command (currently) really just clears the \TeX-if
+ as the input is scanned from left-to-right. Thus, even if there is a use of
+ a unit before the |scalar| function is used, the \TeX-if will be cleared:
+ %
\begin{codeexample}[]
\pgfmathparse{1pt+scalar(1pt)} \pgfmathresult\
\ifpgfmathunitsdeclared with \else without \fi unit
\end{codeexample}
- The other way round, a use of a unit after the |scalar| function
- will set the units once more.
+ The other way round, a use of a unit after the |scalar| function will set
+ the units once more.
+ %
\begin{codeexample}[]
\pgfmathparse{scalar(1pt)+1pt} \pgfmathresult\
\ifpgfmathunitsdeclared with \else without \fi unit
\end{codeexample}
- For these reasons, you should use the function only on the outermost
- level of an expression.
-
- A typical use of this function is the following:
+ For these reasons, you should use the function only on the outermost level
+ of an expression.
+
+ A typical use of this function is the following:
+ %
\begin{codeexample}[]
\tikz{
\coordinate["$A$"] (A) at (2,2);
@@ -319,12 +287,13 @@ expression or not. For this, you can use the following commands:
\draw (A) -- (D);
}
\end{codeexample}
+ %
\end{math-function}
-A special kind of units are \TeX's ``math units'' (|mu|). It will
-be treated as if |pt| had been used, but you can
-check whether an expression contained a math unit using the
-following:
+A special kind of units are \TeX's ``math units'' (|mu|). It will be treated as
+if |pt| had been used, but you can check whether an expression contained a math
+unit using the following:
+%
{\let\ifpgfmathmathunitsdeclared\relax
\begin{command}{\ifpgfmathmathunitsdeclared}
This \TeX-if is similar to |\ifpgfmathunitsdeclared|, but it
@@ -333,181 +302,165 @@ following:
be set to true. The |scalar| function has no effect on this \TeX-if.
\end{command}
}
-
+
+
\subsection{Syntax for Mathematical Expressions: Operators}
-The syntax for the expressions recognized by |\pgfmathparse| and
-friends is rather straightforward. Let us start with the operators.
+The syntax for the expressions recognized by |\pgfmathparse| and friends is
+rather straightforward. Let us start with the operators.
\label{pgfmath-operators}
-The following operators (presented in the context in which they are used)
-are recognized:
-
+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}.
+ Adds \mvar{x} to \mvar{y}.
\end{math-operator}
\begin{math-operator}{-}{infix}{subtract}
- Subtracts \mvar{y} from \mvar{x}.
+ Subtracts \mvar{y} from \mvar{x}.
\end{math-operator}
\begin{math-operator}{-}{prefix}{neg}
- Reverses the sign of \mvar{x}.
+ Reverses the sign of \mvar{x}.
\end{math-operator}
\begin{math-operator}{*}{infix}{multiply}
- Multiples \mvar{x} by \mvar{y}.
+ Multiples \mvar{x} by \mvar{y}.
\end{math-operator}
\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.
+ 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}
\begin{math-operator}{\char`\^}{infix}{pow}
- Raises \mvar{x} to the power \mvar{y}.
+ Raises \mvar{x} to the power \mvar{y}.
\end{math-operator}
\begin{math-operator}{\protect\exclamationmarktext}{postfix}{factorial}
- Calculates the factorial of \mvar{x}.
+ Calculates the factorial of \mvar{x}.
\end{math-operator}
\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.
+ 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.
-
+ |?| 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.
+ 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.
+ 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.
+ Returns |1| if \mvar{x}$<$\mvar{y}, |0| otherwise.
\end{math-operator}
\begin{math-operator}{\protect\exclamationmarktext=}{infix}{notequal}
- Returns |1| if \mvar{x}$\neq$\mvar{y}, |0| otherwise.
+ 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.
+ 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.
+ 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.
+ 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.
+ \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}{\protect\exclamationmarktext}{prefix}{not}
- Returns |1| if \mvar{x} evaluates to zero, |0| otherwise.
+ Returns |1| if \mvar{x} evaluates to zero, |0| otherwise.
\end{math-operator}
-
\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|.
-
+ 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}|.
-
+ 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}[]
\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-operators}
\begin{math-operators}{\char`\[}{\char`\]}{array access}{array}
-
-|[| 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.
-
+ |[| 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.
+ %
\begin{codeexample}[]
\def\myarray{{7,-3,4,-9,11}}
\pgfmathparse{\myarray[3]} \pgfmathresult
\end{codeexample}
-If the array is defined to have multiple dimensions, then the array
-access operators can be immediately repeated.
-
+ If the array is defined to have multiple dimensions, then the array access
+ operators can be immediately repeated.
+ %
\begin{codeexample}[]
\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-operators}
-
\begin{math-operators}{\char`\"}{\char`\"}{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.
-
+ 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}[]
\def\x{5}
\foreach \y in {0,10}{
@@ -515,14 +468,11 @@ calculations are unlikely to be possible with the result.
\x\ is \pgfmathresult\ than \y.
}
\end{codeexample}
-
+ %
\end{math-operators}
-
-
\subsection{Syntax for Mathematical Expressions: Functions}
-
\label{pgfmath-functions}
The following functions are recognized:
@@ -542,138 +492,129 @@ The following functions are recognized:
\end{tikzpicture}
\bigskip
-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.
+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}
+\subsubsection{Basic arithmetic functions}
\label{pgfmath-functions-basic}
\begin{math-function}{add(\mvar{x},\mvar{y})}
\mathcommand
-
- Adds $x$ and $y$.
-
+ Adds $x$ and $y$.
+ %
\begin{codeexample}[]
\pgfmathparse{add(75,6)} \pgfmathresult
\end{codeexample}
+ %
\end{math-function}
\begin{math-function}{subtract(\mvar{x},\mvar{y})}
\mathcommand
-
- Subtract $x$ from $y$.
-
+ Subtract $x$ from $y$.
+ %
\begin{codeexample}[]
\pgfmathparse{subtract(75,6)} \pgfmathresult
\end{codeexample}
+ %
\end{math-function}
\begin{math-function}{neg(\mvar{x})}
\mathcommand
-
- This returns $-\mvar{x}$.
-
+ This returns $-\mvar{x}$.
+ %
\begin{codeexample}[]
\pgfmathparse{neg(50)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{multiply(\mvar{x},\mvar{y})}
\mathcommand
-
- Multiply $x$ by $y$.
-
+ Multiply $x$ by $y$.
+ %
\begin{codeexample}[]
\pgfmathparse{multiply(75,6)} \pgfmathresult
\end{codeexample}
+ %
\end{math-function}
\begin{math-function}{divide(\mvar{x},\mvar{y})}
\mathcommand
-
- Divide $x$ by $y$.
-
+ Divide $x$ by $y$.
+ %
\begin{codeexample}[]
\pgfmathparse{divide(75,6)} \pgfmathresult
\end{codeexample}
+ %
\end{math-function}
\begin{math-function}{div(\mvar{x},\mvar{y})}
\mathcommand
-
- Divide $x$ by $y$ and round to the nearest integer
-
+ Divide $x$ by $y$ and return the integer part of the result.
+ %
\begin{codeexample}[]
\pgfmathparse{div(75,9)} \pgfmathresult
\end{codeexample}
+ %
\end{math-function}
\begin{math-function}{factorial(\mvar{x})}
\mathcommand
-
- Return \mvar{x}!.
-
+ Return \mvar{x}!.
+ %
\begin{codeexample}[]
\pgfmathparse{factorial(5)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{sqrt(\mvar{x})}
\mathcommand
-
- Calculates $\sqrt{\textrm{\mvar{x}}}$.
-
+ Calculates $\sqrt{\textrm{\mvar{x}}}$.
+ %
\begin{codeexample}[]
\pgfmathparse{sqrt(10)} \pgfmathresult
\end{codeexample}
\begin{codeexample}[]
-\pgfmathparse{sqrt(8765.432)} \pgfmathresult
+\pgfmathparse{sqrt(8765.432)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{pow(\mvar{x},\mvar{y})}
\mathcommand
-
- 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\text{ln}(x)}$.
-
+ 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{codeexample}[]
\pgfmathparse{pow(2,7)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
-
\begin{math-function}{e}
\mathcommand
-
- Returns the value 2.718281828.
+ Returns the value 2.718281828.
+ %
{
\catcode`\^=7
-
\begin{codeexample}[]
\pgfmathparse{(e^2-e^-2)/2} \pgfmathresult
\end{codeexample}
-
}
\end{math-function}
\begin{math-function}{exp(\mvar{x})}
\mathcommand
+{ \catcode`\^=7
-{
-\catcode`\^=7
-
- Maclaurin series for $e^x$.
-}
+ Maclaurin series for $e^x$.
+}
\begin{codeexample}[]
\pgfmathparse{exp(1)} \pgfmathresult
\end{codeexample}
@@ -681,20 +622,15 @@ example, |\pgfmathadd|, but there are some notable exceptions.
\begin{codeexample}[]
\pgfmathparse{exp(2.34)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
-
\begin{math-function}{ln(\mvar{x})}
\mathcommand
-
-{
-\catcode`\^=7
-
- An approximation for $\ln(\textrm{\mvar{x}})$.
- This uses an algorithm of Rouben Rostamian, and coefficients
- suggested by Alain Matthes.
-}
+{ \catcode`\^=7
+ An approximation for $\ln(\textrm{\mvar{x}})$. This uses an algorithm of
+ Rouben Rostamian, and coefficients suggested by Alain Matthes.
+}
\begin{codeexample}[]
\pgfmathparse{ln(10)} \pgfmathresult
\end{codeexample}
@@ -702,36 +638,33 @@ example, |\pgfmathadd|, but there are some notable exceptions.
\begin{codeexample}[]
\pgfmathparse{ln(exp(5))} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{log10(\mvar{x})}
\mathcommand[logten(\mvar{x})]
-
- An approximation for $\log_{10}(\textrm{\mvar{x}})$.
-
+ An approximation for $\log_{10}(\textrm{\mvar{x}})$.
+ %
\begin{codeexample}[]
\pgfmathparse{log10(100)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{log2(\mvar{x})}
\mathcommand[logtwo(\mvar{x})]
-
- An approximation for $\log_2(\textrm{\mvar{x}})$.
-
+ An approximation for $\log_2(\textrm{\mvar{x}})$.
+ %
\begin{codeexample}[]
\pgfmathparse{log2(128)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{abs(\mvar{x})}
\mathcommand
-
- Evaluates the absolute value of $x$.
-
+ Evaluates the absolute value of $x$.
+ %
\begin{codeexample}[]
\pgfmathparse{abs(-5)} \pgfmathresult
\end{codeexample}
@@ -739,15 +672,15 @@ example, |\pgfmathadd|, but there are some notable exceptions.
\begin{codeexample}[]
\pgfmathparse{-abs(4*-3)} \pgfmathresult
\end{codeexample}
+ %
\end{math-function}
\begin{math-function}{mod(\mvar{x},\mvar{y})}
\mathcommand
-
- 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}}}$.
-
+ 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{mod(20,6)} \pgfmathresult
\end{codeexample}
@@ -755,26 +688,24 @@ example, |\pgfmathadd|, but there are some notable exceptions.
\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.
-
+ 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}
\begin{math-function}{sign(\mvar{x})}
\mathcommand
-
- Returns the sign of $x$.
-
+ Returns the sign of $x$.
+ %
\begin{codeexample}[]
\pgfmathparse{sign(-5)} \pgfmathresult
\end{codeexample}
@@ -786,22 +717,19 @@ example, |\pgfmathadd|, but there are some notable exceptions.
\begin{codeexample}[]
\pgfmathparse{sign(5)} \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|).
-
+ 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}
@@ -809,14 +737,13 @@ example, |\pgfmathadd|, but there are some notable exceptions.
\begin{codeexample}[]
\pgfmathparse{round(398/12)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{floor(\mvar{x})}
\mathcommand
-
- Rounds \mvar{x} down to the nearest integer.
-
+ Rounds \mvar{x} down to the nearest integer.
+ %
\begin{codeexample}[]
\pgfmathparse{floor(32.5/17)} \pgfmathresult
\end{codeexample}
@@ -828,13 +755,13 @@ example, |\pgfmathadd|, but there are some notable exceptions.
\begin{codeexample}[]
\pgfmathparse{floor(-398/12)} \pgfmathresult
\end{codeexample}
+ %
\end{math-function}
\begin{math-function}{ceil(\mvar{x})}
\mathcommand
-
- Rounds \mvar{x} up to the nearest integer.
-
+ Rounds \mvar{x} up to the nearest integer.
+ %
\begin{codeexample}[]
\pgfmathparse{ceil(32.5/17)} \pgfmathresult
\end{codeexample}
@@ -846,106 +773,96 @@ example, |\pgfmathadd|, but there are some notable exceptions.
\begin{codeexample}[]
\pgfmathparse{ceil(-398/12)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{int(\mvar{x})}
\mathcommand
-
- Returns the integer part of \mvar{x}.
-
+ Returns the integer part of \mvar{x}.
+ %
\begin{codeexample}[]
\pgfmathparse{int(32.5/17)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{frac(\mvar{x})}
\mathcommand
-
- Returns the fractional part of \mvar{x}.
-
+ 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.
-
+ Ensures \mvar{x} contains a decimal point.
+ %
\begin{codeexample}[]
\pgfmathparse{real(4)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\subsubsection{Integer arithmetics functions}
-
\label{pgfmath-functions-integerarithmetics}
\begin{math-function}{gcd(\mvar{x},\mvar{y})}
\mathcommand
-
- Computes the greatest common divider of \mvar{x} and \mvar{y}.
-
+ Computes the greatest common divider of \mvar{x} and \mvar{y}.
+ %
\begin{codeexample}[]
\pgfmathparse{gcd(42,56)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{isodd(\mvar{x})}
\mathcommand
-
- Returns |1| if the integer part of \mvar{x} is odd. Otherwise, returns |0|.
-
+ Returns |1| if the integer part of \mvar{x} is odd. Otherwise, returns |0|.
+ %
\begin{codeexample}[]
-\pgfmathparse{isodd(2)} \pgfmathresult,
+\pgfmathparse{isodd(2)} \pgfmathresult,
\pgfmathparse{isodd(3)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{iseven(\mvar{x})}
\mathcommand
-
- Returns |1| if the integer part of \mvar{x} is even. Otherwise, returns |0|.
-
+ Returns |1| if the integer part of \mvar{x} is even. Otherwise, returns |0|.
+ %
\begin{codeexample}[]
-\pgfmathparse{iseven(2)} \pgfmathresult,
+\pgfmathparse{iseven(2)} \pgfmathresult,
\pgfmathparse{iseven(3)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{isprime(\mvar{x})}
\mathcommand
-
- Returns |1| if the integer part of \mvar{x} is prime. Otherwise, returns |0|.
-
+ Returns |1| if the integer part of \mvar{x} is prime. Otherwise, returns |0|.
+ %
\begin{codeexample}[]
-\pgfmathparse{isprime(1)} \pgfmathresult,
+\pgfmathparse{isprime(1)} \pgfmathresult,
\pgfmathparse{isprime(2)} \pgfmathresult,
\pgfmathparse{isprime(31)} \pgfmathresult,
\pgfmathparse{isprime(64)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\subsubsection{Trigonometric functions}
-
\label{pgfmath-functions-trigonometric}
\begin{math-function}{pi}
\mathcommand
-
- Returns the value $\pi=3.141592654$.
-
+ Returns the value $\pi=3.141592654$.
+ %
\begin{codeexample}[]
\pgfmathparse{pi} \pgfmathresult
\end{codeexample}
@@ -953,37 +870,35 @@ example, |\pgfmathadd|, but there are some notable exceptions.
\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.
-
+ Convert \mvar{x} to radians. \mvar{x} is assumed to be in degrees.
+ %
\begin{codeexample}[]
\pgfmathparse{rad(90)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{deg(\mvar{x})}
\mathcommand
-
- Convert \mvar{x} to degrees. \mvar{x} is assumed to be in radians.
-
+ Convert \mvar{x} to degrees. \mvar{x} is assumed to be in radians.
+ %
\begin{codeexample}[]
\pgfmathparse{deg(3*pi/2)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{sin(\mvar{x})}
\mathcommand
-
- Sine of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
- radians.
-
+ %
+ Sine of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
+ radians.
+ %
\begin{codeexample}[]
\pgfmathparse{sin(60)} \pgfmathresult
\end{codeexample}
@@ -991,15 +906,14 @@ example, |\pgfmathadd|, but there are some notable exceptions.
\begin{codeexample}[]
\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
- radians.
-
+ Cosine of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
+ radians.
+ %
\begin{codeexample}[]
\pgfmathparse{cos(60)} \pgfmathresult
\end{codeexample}
@@ -1007,15 +921,14 @@ example, |\pgfmathadd|, but there are some notable exceptions.
\begin{codeexample}[]
\pgfmathparse{cos(pi/3 r)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{tan(\mvar{x})}
\mathcommand
-
- Tangent of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
- radians.
-
+ Tangent of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
+ radians.
+ %
\begin{codeexample}[]
\pgfmathparse{tan(45)} \pgfmathresult
\end{codeexample}
@@ -1023,94 +936,87 @@ example, |\pgfmathadd|, but there are some notable exceptions.
\begin{codeexample}[]
\pgfmathparse{tan(2*pi/8 r)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
-
\begin{math-function}{sec(\mvar{x})}
\mathcommand
-
- Secant of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
- radians.
-
+ Secant of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
+ radians.
+ %
\begin{codeexample}[]
\pgfmathparse{sec(45)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{cosec(\mvar{x})}
\mathcommand
-
- Cosecant of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
- radians.
-
+ Cosecant of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
+ radians.
+ %
\begin{codeexample}[]
\pgfmathparse{cosec(30)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{cot(\mvar{x})}
\mathcommand
-
- Cotangent of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
- radians.
-
+ Cotangent of \mvar{x}. By employing the |r| operator, \mvar{x} can be in
+ radians.
+ %
\begin{codeexample}[]
\pgfmathparse{cot(15)} \pgfmathresult
\end{codeexample}
-
+ %
\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$.
-
+ Arcsine of \mvar{x}. The result is in degrees and in the range $\pm90^\circ$.
+ %
\begin{codeexample}[]
\pgfmathparse{asin(0.7071)} \pgfmathresult
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{acos(\mvar{x})}
\mathcommand
-
- Arccosine of \mvar{x} in degrees. The result is in the range $[0^\circ,180^\circ]$.
-
+ Arccosine of \mvar{x} in degrees. The result is in the range $[0^\circ,180^\circ]$.
+ %
\begin{codeexample}[]
\pgfmathparse{acos(0.5)} \pgfmathresult
\end{codeexample}
-
+ %
\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
\end{codeexample}
-
+ %
\end{math-function}
\begin{math-function}{atan2(\mvar{y},\mvar{x})}
\mathcommand[atantwo(\mvar{y},\mvar{x})]
-
- Arctangent of $y\div x$ in degrees. This also takes into account the
- quadrants.
-
+ 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}
\begin{key}{/pgf/trig format=\mchoice{deg,rad} (initially deg)}
- Allows to define whether trigonometric math functions (i.e.\ all in this subsection) operate with degrees or with radians.
-
+ Allows to define whether trigonometric math functions (i.e.\ all in this
+ subsection) operate with degrees or with radians.
+ %
\begin{codeexample}[]
\pgfmathparse{cos(45)} \pgfmathresult
\end{codeexample}
@@ -1118,200 +1024,195 @@ example, |\pgfmathadd|, but there are some notable exceptions.
\pgfkeys{/pgf/trig format=rad}
\pgfmathparse{cos(pi/2)} \pgfmathresult
\end{codeexample}
-
- The initial configuration |trig format=deg| is the base of \pgfname: almost all of it is based on degrees.
-
- Specifying |trig format=rad| is most useful for data visualization where the angles are typically given in radians. However, it is applied to all trigonometric functions for which the option applies, including any drawing instructions which operate on angles.
+
+ The initial configuration |trig format=deg| is the base of \pgfname: almost
+ all of it is based on degrees.
+
+ Specifying |trig format=rad| is most useful for data visualization where
+ the angles are typically given in radians. However, it is applied to all
+ trigonometric functions for which the option applies, including any drawing
+ instructions which operate on angles.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
- \draw[-stealth]
- (0:1) -- (45:1) -- (90:1) -- (135:1) -- (180:1);
+ \draw[-stealth]
+ (0:1) -- (45:1) -- (90:1) -- (135:1) -- (180:1);
- \draw[-stealth,trig format=rad,red]
- (pi:1) -- (5/4*pi:1) -- (6/4*pi:1) -- (7/4*pi:1) -- (2*pi:1);
+ \draw[-stealth,trig format=rad,red]
+ (pi:1) -- (5/4*pi:1) -- (6/4*pi:1) -- (7/4*pi:1) -- (2*pi:1);
\end{tikzpicture}
\end{codeexample}
-
- \paragraph{Warning:} At the time of this writing, this feature is ``experimental''. Please handle it with care: there may be path instructions or libraries in \pgfname\ which rely on |trig format=deg|. The intented usage of |trig format=rad| is for local scopes -- and as option for data visualization.
+
+ \paragraph{Warning:}
+ At the time of this writing, this feature is ``experimental''. Please
+ handle it with care: there may be path instructions or libraries in
+ \pgfname\ which rely on |trig format=deg|. The intended usage of
+ |trig format=rad| is for local scopes -- and as option for data
+ visualization.
\end{key}
\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.
-
+ 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.
-
+ 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.
-
+ 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.
-
+ 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.
-
+ 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.
-
+ 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.
-
+ This returns |1| if \mvar{x} and \mvar{y} both evaluate to non-zero values.
+ Otherwise |0| is returned.
+ %
\begin{codeexample}[]
\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.
-
+ This returns |1| if either \mvar{x} or \mvar{y} evaluate to non-zero
+ values. Otherwise |0| is returned.
+ %
\begin{codeexample}[]
-\pgfmathparse{and(5>4,6>7)} \pgfmathresult
+\pgfmathparse{or(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|.
-
+ This returns |1| if $\mvar{x}=0$, otherwise |0|.
+ %
\begin{codeexample}[]
\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.
-
+ 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|.
-
+ 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|.
-
+ 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$ with a uniform distribution.
-
+ Generates a pseudo-random number between $0$ and $1$ with a uniform
+ distribution.
+ %
\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$ with a uniform distribution.
-
+ Generates a pseudo-random number between $-1$ and $1$ with a uniform
+ distribution.
+ %
\begin{codeexample}[]
\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 uniform 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{}|.
-
+ This function takes zero, one or two arguments. If there are zero
+ arguments, a uniform 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}
@@ -1323,194 +1224,178 @@ example, |\pgfmathadd|, but there are some notable exceptions.
\begin{codeexample}[]
\foreach \x in {1,...,10}{\pgfmathparse{random(232,762)}\pgfmathresult, }
\end{codeexample}
+ %
\end{math-function}
-\subsubsection{Base conversion functions}
+\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.
-
+ 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{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.
-
+ 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 an
- octal representation.
- No further calculation should be attempted with the result, as
- the parser can only process numbers converted to base 10.
+ Convert \mvar{x}{} (assumed to be an integer in base 10) to an 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.
-
+ 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}
+\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.
-
+ 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.
-
+ 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 of Rouben Rostamian
+ Calculates $\sqrt{\left(\textrm{\mvar{x}}^2+\textrm{\mvar{y}}^2\right)}$.
+ This uses a polynomial approximation, based on ideas of 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|.
-
+ 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:
+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}%
-
+ 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}%
-
+ 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}
+ %
- 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}{} from 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).
-
+ Return the width of a \TeX{} (horizontal) box containing \mvar{x}. The
+ quote characters are necessary to prevent \mvar{x}{} from 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}
- Note that results of this method are provided in points.
+ Note that results of this method are provided in points.
\end{math-function}
\begin{math-function}{height("\mvar{x}")}
\mathcommand
-
- Return the height of a box containing \mvar{x}.
-
+ 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}.
-
+ 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
index f2ac87509d9..4967587a306 100644
--- 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
@@ -8,43 +8,40 @@
% 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.
+ 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, possibly a state-switch occurs. The parsing process ends when a
-final state has been reached.
+This module provides commands for defining a parser that scans some given text
+letter-by-letter. For each letter, some code is executed and, possibly 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|.
+ 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}
@@ -57,40 +54,38 @@ final state has been reached.
\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
- persists 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.
+ 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 persists 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}.
+ 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
index 7f11f1d06e0..bd1f11d01f6 100644
--- 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
@@ -8,114 +8,104 @@
% 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.
+ 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.
-
+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}, \emph{object identities}, and (thanks to Sa\v o \v
-Zivanovi\'c) \emph{inheritance} and \emph{overloading.}
-
-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.
+\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}, \emph{object
+identities}, and (thanks to Sa\v o \v Zivanovi\'c) \emph{inheritance} and
+\emph{overloading.}
+
+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.
+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).
+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:
+We start with the definition of the |stamp| class. This is done using the
+|\pgfooclass| macro:
\begin{command}{\pgfooclass\opt{|(|\meta{list of superclasses}|)|}\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{list of superclasses} is
- optional just like the parenthesis around it.
-
- 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 set up 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.
+ 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{list of superclasses} is optional just like the parenthesis around
+ it.
+
+ 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 set up 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
@@ -135,47 +125,45 @@ the |\pgfooclass| macro:
% We can now create objects of type "stamp"
\end{codeexample}
- Concerning the list of base classes, the Method Resolution Order
- (\textsc{mro}) is computed using the C3 algorithm also used in Python, v2.3
- and higher. The linearization computed by the algorithm respects
- both local precedence ordering and monotonicity. Resolution of both
- methods and attributes depends on the \textsc{mro}: when a method method name
- is called on an object of class $C$, the system invokes method
- method name from the first class in the \textsc{mro} of $C$ which defines
- method method name; when an object is created, each attribute |attr|
- is initialized to the value specified in the first class in the \textsc{mro}
- of $C$ which declares attribute |attr|.
+ Concerning the list of base classes, the Method Resolution Order
+ (\textsc{mro}) is computed using the C3 algorithm also used in Python, v2.3
+ and higher. The linearization computed by the algorithm respects both
+ local precedence ordering and monotonicity. Resolution of both methods and
+ attributes depends on the \textsc{mro}: when a method method name is called
+ on an object of class $C$, the system invokes method method name from the
+ first class in the \textsc{mro} of $C$ which defines method method name;
+ when an object is created, each attribute |attr| is initialized to the
+ value specified in the first class in the \textsc{mro} of $C$ which
+ declares attribute |attr|.
\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.
-
+|\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:
+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}.
+\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.
+ 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.
+ Here is an example in which three stamp objects are created.
+ %
\begin{codeexample}[code only]
-\pgfoonew \firststamp = new stamp()
-\pgfoonew \secondstamp = new stamp()
+\pgfoonew \firststamp=new stamp()
+\pgfoonew \secondstamp=new stamp()
{
- \pgfoonew \thirdstamp = new stamp()
+ \pgfoonew \thirdstamp=new stamp()
...
}
% \thirdstamp no longer exists, but \firststamp and \secondstamp do
@@ -183,108 +171,100 @@ peculiar syntax:
% 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 given, 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.
+ The optional \meta{object handle or attribute} can either be an
+ \meta{object handle} or an \meta{attribute}. When an \meta{object handle}
+ is given, 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() {
+ \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.
+ 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:
+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 either the
- same name as the class or having the name |init| is called the
- \emph{constructor} of the class. 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 by differing numbers of parameters 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. Also, a
- class can (re)implement a method from a superclass.
-
- 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 set up in such a way that it references the object
- for which the method is executed.
+ 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 either the same name
+ as the class or having the name |init| is called the \emph{constructor} of
+ the class. 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 by differing numbers of parameters 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. Also, a class can (re)implement a method from
+ a superclass.
+
+ 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 set up in such a way that
+ it references the 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:
+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}\opt{|.|\meta{super
- class}}|.|\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}. The method is the one
- defined in the class of the object or, if it is not defined there,
- the method defined in the superclasses of the object's class (if
- there are several superclasses that define the same method, the
- method resolution order is used to determine which one gets
- called). If the optional \meta{super class} is specified, the method
- implementation of that class will be used rather than the
- implementation in the object's class. 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.
-
+ \pgfmanualentryheadline{\meta{object handle}\opt{|.|\meta{super class}}|.|\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}. The method is the one defined in
+ the class of the object or, if it is not defined there, the method defined
+ in the superclasses of the object's class (if there are several
+ superclasses that define the same method, the method resolution order is
+ used to determine which one gets called). If the optional \meta{super
+ class} is specified, the method implementation of that class will be used
+ rather than the implementation in the object's class. 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
@@ -306,17 +286,17 @@ Java or C++ syntax:
\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.
-
+ 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 well-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
@@ -336,49 +316,45 @@ Java or C++ syntax:
}
}
\end{codeexample}
- \end{command}
+ \end{command}
\end{pgfmanualentry}
-
-\begin{command}{\pgfoosuper|(|\meta{class},\meta{object
- handle}|).|\meta{method name}|(|\meta{arguments}|)|}
- This macro gives you finer control over which method gets invoked in
- case of multiple inheritance. This macro calls \meta{method name} of
- the object specified by \meta{object handle}, but which
- implementation of the method is called is determined as follows: it
- will be the implementation in the first class (in the method
- resolution order) after \meta{class} that defines \meta{method
- name}.
+\begin{command}{\pgfoosuper|(|\meta{class},\meta{object handle}|).|\meta{method name}|(|\meta{arguments}|)|}
+ This macro gives you finer control over which method gets invoked in case
+ of multiple inheritance. This macro calls \meta{method name} of the object
+ specified by \meta{object handle}, but which implementation of the method
+ is called is determined as follows: it will be the implementation in the
+ first class (in the method resolution order) after \meta{class} that
+ defines \meta{method name}.
\end{command}
+
\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.
+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.
+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{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
@@ -405,43 +381,60 @@ To declare an attribute you should use the |\attribute| command:
}
}
\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.
+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}.
+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}.
+ 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}{\pgfooeset\marg{attribute}\marg{value}}
+ Performs the same action as |\pgfooset| but in an |\edef| full expansion
+ context.
+\end{command}
+
+\begin{command}{\pgfooappend\marg{attribute}\marg{value}}
+ This method adds the given \meta{value} to the \meta{attribute} at the end.
+\end{command}
+
+\begin{command}{\pgfooprefix\marg{attribute}\marg{value}}
+ This method adds the given \meta{value} to the \meta{attribute} at the
+ beginning.
\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.
+ 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.
+ 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)
@@ -450,11 +443,13 @@ reasons. Instead, a set of special macros is used, all of which can
{\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}.
+ Reads the current value of \meta{attribute} and stores the result in
+ \meta{macro}.
+ %
\begin{codeexample}[code only]
...
\method get rotation (#1) {
@@ -465,37 +460,39 @@ reasons. Instead, a set of special macros is used, all of which can
\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.
+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.
+ \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:
+ 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()
@@ -507,137 +504,129 @@ Let us have a look at the last two methods.
\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.
+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.
+ 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 method, called |get handle|, which is also
-used to create object handles.
+There is a second predefined method, 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.
+ 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 Object Class}
-
\label{section-object}
-The object-oriented module predefines a basic class |object| that can
-be used as a base class in different context.
+The object-oriented module predefines a basic class |object| that can be used
+as a base class in different context.
\begin{ooclass}{object}
- This class current only implements one method:
-
- \begin{method}{copy(\meta{handle})}
- Creates a new object and initializes the values of its (declared)
- attributes to the values of the original. The method takes one
- argument: a control sequence which receives the handle of the
- copy.
- \end{method}
+ This class current only implements one method:
+
+ \begin{method}{copy(\meta{handle})}
+ Creates a new object and initializes the values of its (declared)
+ attributes to the values of the original. The method takes one
+ argument: a control sequence which receives the handle of the copy.
+ \end{method}
\end{ooclass}
\subsection{The Signal Class}
-
\label{section-signals}
-In addition to the basic mechanism for defining and using classes and
-object, the class |signal| is predefined. It implements a so-called
-signal--slot mechanism.
+In addition to the basic mechanism for defining and using classes and object,
+the class |signal| is predefined. It 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: From 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, one 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:
+ This class is used to implement a simple signal--slot mechanism. The idea
+ is the following: From 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, one 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
+ after 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() {
@@ -651,52 +640,51 @@ signal--slot mechanism.
\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}.
+ \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{method}
\end{ooclass}
\subsection{Implementation Notes}
-For the curious, here are some notes on how the oo-system is
-implemented:
-
+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 set up and restore the
- current object number to the number of the object being called.
+ \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 set up 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 452690a36d0..1975199a802 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
@@ -10,38 +10,36 @@
\section{Page Management}
-This section describes the |pgfpages| package. Although this package
-is not concerned with creating pictures, its implementation relies so
-heavily on \pgfname\ that it is documented here. Currently, |pgfpages|
-only works with \LaTeX, but if you are adventurous, feel free to hack
-the code so that it also works with plain \TeX.
-
-The aim of |pgfpages| is to provide a flexible way of putting multiple
-pages on a single page \emph{inside \TeX}. Thus, |pgfpages| is quite
-different from useful tools like |psnup| or |pdfnup| insofar as it
-creates its output in a single pass. Furthermore, it works uniformly
-with both |latex| and |pdflatex|, making it easy to put multiple pages
-on a single page without any fuss.
-
-A word of warning: \emph{using |pgfpages| will destroy
- hyperlinks}. Actually, the hyperlinks are not destroyed, only they
-will appear at totally wrong positions on the final output. This is
-due to a fundamental flaw in the \pdf\ specification: In \pdf\ the
-bounding rectangle of a hyperlink is given in ``absolute
-page coordinates'' and translations or rotations do not affect
-them. Thus, the transformations applied by |pgfpages| to put the pages
-where you want them are (cannot, even) be applied to the coordinates
-of hyperlinks. It is unlikely that this will change in the foreseeable
-future.
+This section describes the |pgfpages| package. Although this package is not
+concerned with creating pictures, its implementation relies so heavily on
+\pgfname\ that it is documented here. Currently, |pgfpages| only works with
+\LaTeX, but if you are adventurous, feel free to hack the code so that it also
+works with plain \TeX.
+
+The aim of |pgfpages| is to provide a flexible way of putting multiple pages on
+a single page \emph{inside \TeX}. Thus, |pgfpages| is quite different from
+useful tools like |psnup| or |pdfnup| insofar as it creates its output in a
+single pass. Furthermore, it works uniformly with both |latex| and |pdflatex|,
+making it easy to put multiple pages on a single page without any fuss.
+
+A word of warning: \emph{using |pgfpages| will destroy hyperlinks}. Actually,
+the hyperlinks are not destroyed, only they will appear at totally wrong
+positions on the final output. This is due to a fundamental flaw in the \pdf\
+specification: In \pdf\ the bounding rectangle of a hyperlink is given in
+``absolute page coordinates'' and translations or rotations do not affect them.
+Thus, the transformations applied by |pgfpages| to put the pages where you want
+them are (cannot, even) be applied to the coordinates of hyperlinks. It is
+unlikely that this will change in the foreseeable future.
\subsection{Basic Usage}
-The internals of |pgfpages| are complex since the package can do all
-sorts of interesting tricks. For this reason, so-called \emph{layouts}
-are predefined that set up all option in appropriate ways.
+The internals of |pgfpages| are complex since the package can do all sorts of
+interesting tricks. For this reason, so-called \emph{layouts} are predefined
+that set up all option in appropriate ways.
You use a layout as follows:
+%
\begin{codeexample}[code only]
\documentclass{article}
@@ -55,23 +53,22 @@ This text is shown on the right.
\end{document}
\end{codeexample}
-The layout |2 on 1| puts two pages on a single page. The option
-|a4paper| tells |pgfpages| that the \emph{resulting} page (called the
-\emph{physical} page in the following) should be |a4paper| and it
-should be landscape (which is quite logical since putting two portrait
-pages next to each other gives a landscape page). Normally, the
-\emph{logical} pages, that is, the pages that \TeX\ ``thinks'' that it
-is typesetting, will have the same sizes, but this need not be the
-case. |pgfpages| will automatically scale down the logical pages such
+The layout |2 on 1| puts two pages on a single page. The option |a4paper| tells
+|pgfpages| that the \emph{resulting} page (called the \emph{physical} page in
+the following) should be |a4paper| and it should be landscape (which is quite
+logical since putting two portrait pages next to each other gives a landscape
+page). Normally, the \emph{logical} pages, that is, the pages that \TeX\
+``thinks'' that it is typesetting, will have the same sizes, but this need not
+be the case. |pgfpages| will automatically scale down the logical pages such
that two logical pages fit next to each other inside a DIN A4 page.
-The |border shrink| tells |pgfpages| that it should add an additional
-5mm to the shrinking such that a 5mm-wide border is shown around the
-resulting logical pages.
-
-As a second example, let us put two pages produced by the
-\textsc{beamer} class on a single page:
+The |border shrink| tells |pgfpages| that it should add an additional 5mm to
+the shrinking such that a 5mm-wide border is shown around the resulting logical
+pages.
+As a second example, let us put two pages produced by the \textsc{beamer} class
+on a single page:
+%
\begin{codeexample}[code only]
\documentclass{beamer}
@@ -88,24 +85,23 @@ As a second example, let us put two pages produced by the
\end{document}
\end{codeexample}
-Note that we do not use the |landscape| option since \textsc{beamer}'s
-logical pages are already in landscape mode and putting two landscape
-pages on top of each other results in a portrait page. However, if you
-had used the |4 on 1| layout, you would have had to add |landscape|
-once more, using the |8 on 1| you must not, using |16 on 1| you need
-it yet again. And, no, there is no |32 on 1| layout.
-
-Another word of caution: \emph{using |pgfpages| will produce wrong
- page numbers in the |.aux| file}. The reason is that \TeX\
-instantiates the page numbers when writing an |.aux| file only when
-the physical page is shipped out. Fortunately, this problem is easy to
-fix: First, typeset our file normally without using the
-|\pgfpagesuselayout| command (just put the comment marker |%| before it)
-Then, rerun \TeX\ with the |\pgfpagesuselayout| command included and add
-the command |\nofiles|. This command ensures that the |.aux| file is
-not modified, which is exactly what you want. So, to typeset the above
-example, you should actually first \TeX\ the following file:
-
+Note that we do not use the |landscape| option since \textsc{beamer}'s logical
+pages are already in landscape mode and putting two landscape pages on top of
+each other results in a portrait page. However, if you had used the |4 on 1|
+layout, you would have had to add |landscape| once more, using the |6 on 1| or
+|8 on 1| you must not, using |16 on 1| you need it yet again. And, no, there is
+no |32 on 1| layout.
+
+Another word of caution: \emph{using |pgfpages| will produce wrong page numbers
+in the |.aux| file}. The reason is that \TeX\ instantiates the page numbers
+when writing an |.aux| file only when the physical page is shipped out.
+Fortunately, this problem is easy to fix: First, typeset our file normally
+without using the |\pgfpagesuselayout| command (just put the comment marker |%|
+before it) Then, rerun \TeX\ with the |\pgfpagesuselayout| command included and
+add the command |\nofiles|. This command ensures that the |.aux| file is not
+modified, which is exactly what you want. So, to typeset the above example, you
+should actually first \TeX\ the following file:
+%
\begin{codeexample}[code only]
\documentclass{article}
@@ -119,7 +115,9 @@ This text is shown on the left.
This text is shown on the right.
\end{document}
\end{codeexample}
+%
and then typeset
+%
\begin{codeexample}[code only]
\documentclass{article}
@@ -134,21 +132,22 @@ This text is shown on the right.
\end{document}
\end{codeexample}
-The final basic example is the |resize to| layout (it works a bit like
-a hypothetical |1 on 1| layout). This layout resizes the logical page
-such that is fits the specified physical size. Since this does not
-change the page numbering, you need not worry about the |.aux| files
-with this layout. For example, adding the following lines will ensure
-that the physical output will fit on DIN A4 paper:
+The final basic example is the |resize to| layout (it works a bit like a
+hypothetical |1 on 1| layout). This layout resizes the logical page such that
+is fits the specified physical size. Since this does not change the page
+numbering, you need not worry about the |.aux| files with this layout. For
+example, adding the following lines will ensure that the physical output will
+fit on DIN A4 paper:
+%
\begin{codeexample}[code only]
\usepackage{pgfpages}
\pgfpagesuselayout{resize to}[a4paper]
\end{codeexample}
-This can be very useful when you have to handle lots of papers that
-are typeset for, say, letter paper and you have an A4 printer or the
-other way round. For example, the following article will be fit for
-printing on letter paper:
+This can be very useful when you have to handle lots of papers that are typeset
+for, say, letter paper and you have an A4 printer or the other way round. For
+example, the following article will be fit for printing on letter paper:
+%
\begin{codeexample}[code only]
\documentclass[a4paper]{article}
%% a4 is currently the logical size and also the physical size
@@ -164,120 +163,108 @@ printing on letter paper:
\end{codeexample}
-
\subsection{The Predefined Layouts}
-This section explains the predefined layouts in more detail. You
-select a layout using the following command:
+This section explains the predefined layouts in more detail. You select a
+layout using the following command:
+%
\begin{command}{\pgfpagesuselayout\marg{layout}\oarg{options}}
- Installs the specified \meta{layout} with the given \meta{options}. The predefined layouts and their permissible options are
- explained below.
+ Installs the specified \meta{layout} with the given \meta{options}. The
+ predefined layouts and their permissible options are explained below.
- If this function is called multiple times, only the last call
- ``wins.'' You can thereby overwrite any previous settings. In
- particular, layouts \emph{do not} accumulate.
+ If this function is called multiple times, only the last call ``wins''. You
+ can thereby overwrite any previous settings. In particular, layouts
+ \emph{do not} accumulate.
- \example |\pgfpagesuselayout{resize to}[a4paper]|
+ \example |\pgfpagesuselayout{resize to}[a4paper]|
\end{command}
\begin{pgflayout}{resize to}
- This layout is used to resize every logical page to a specified
- physical size. To determine the target size, the following options
- may be given:
- \begin{itemize}
- \item
- \declare{|physical paper height=|\meta{size}} sets the
- height of the physical page size to \meta{size}.
- \item
- \declare{|physical paper width=|\meta{size}} sets the
- width of the physical Pappe size to \meta{size}.
- \item
- \declare{|a0paper|} sets the physical page size to DIN A0 paper.
- \item
- \declare{|a1paper|} sets the physical page size to DIN A1 paper.
- \item
- \declare{|a2paper|} sets the physical page size to DIN A2 paper.
- \item
- \declare{|a3paper|} sets the physical page size to DIN A3 paper.
- \item
- \declare{|a4paper|} sets the physical page size to DIN A4 paper.
- \item
- \declare{|a5paper|} sets the physical page size to DIN A5 paper.
- \item
- \declare{|a6paper|} sets the physical page size to DIN A6 paper.
- \item
- \declare{|letterpaper|} sets the physical page size to the
- American letter paper size.
- \item
- \declare{|legalpaper|} sets the physical page size to the
- American legal paper size.
- \item
- \declare{|executivepaper|} sets the physical page size to the
- American executive paper size.
- \item
- \declare{|landscape|} swaps the height and the width of the
- physical paper.
- \item
- \declare{|border shrink=|\meta{size}} additionally reduces the
- size of the logical page on the physical page by \meta{size}.
- \end{itemize}
+ This layout is used to resize every logical page to a specified physical
+ size. To determine the target size, the following options may be given:
+ %
+ \begin{itemize}
+ \item \declare{|physical paper height=|\meta{size}} sets the height of
+ the physical page size to \meta{size}.
+ \item \declare{|physical paper width=|\meta{size}} sets the width of
+ the physical Pappe size to \meta{size}.
+ \item \declare{|a0paper|} sets the physical page size to DIN A0 paper.
+ \item \declare{|a1paper|} sets the physical page size to DIN A1 paper.
+ \item \declare{|a2paper|} sets the physical page size to DIN A2 paper.
+ \item \declare{|a3paper|} sets the physical page size to DIN A3 paper.
+ \item \declare{|a4paper|} sets the physical page size to DIN A4 paper.
+ \item \declare{|a5paper|} sets the physical page size to DIN A5 paper.
+ \item \declare{|a6paper|} sets the physical page size to DIN A6 paper.
+ \item \declare{|letterpaper|} sets the physical page size to the
+ American letter paper size.
+ \item \declare{|legalpaper|} sets the physical page size to the
+ American legal paper size.
+ \item \declare{|executivepaper|} sets the physical page size to the
+ American executive paper size.
+ \item \declare{|landscape|} swaps the height and the width of the
+ physical paper.
+ \item \declare{|border shrink=|\meta{size}} additionally reduces the
+ size of the logical page on the physical page by \meta{size}.
+ \end{itemize}
\end{pgflayout}
\begin{pgflayout}{2 on 1}
- Puts two logical pages alongside each other on each physical page if
- the logical height is larger than the logical width (logical pages
- are in portrait mode). Otherwise, two
- logical pages are put on top of each other (logical pages are in
- landscape mode). When using this layout, it is advisable to use the
- |\nofiles| command, but this is not done automatically.
-
- The same \meta{options} as for the |resize to| layout can be used,
- plus the following option:
- \begin{itemize}
- \item
- \declare{|odd numbered pages right|}
- places the first page on the right.
- \end{itemize}
+ Puts two logical pages alongside each other on each physical page if the
+ logical height is larger than the logical width (logical pages are in
+ portrait mode). Otherwise, two logical pages are put on top of each other
+ (logical pages are in landscape mode). When using this layout, it is
+ advisable to use the |\nofiles| command, but this is not done
+ automatically.
+
+ The same \meta{options} as for the |resize to| layout can be used, plus the
+ following option:
+ %
+ \begin{itemize}
+ \item \declare{|odd numbered pages right|} places the first page on the
+ right.
+ \end{itemize}
\end{pgflayout}
-
\begin{pgflayout}{4 on 1}
- Puts four logical pages on a single physical page.
- The same \meta{options} as for the |resize to| layout can be used.
+ Puts four logical pages on a single physical page. The same \meta{options}
+ as for the |resize to| layout can be used.
+\end{pgflayout}
+
+\begin{pgflayout}{6 on 1}
+ Puts six logical pages on a single physical page.
\end{pgflayout}
\begin{pgflayout}{8 on 1}
- Puts eight logical pages on a single physical page. As for |2 on 1| and |4 on 1|,
- the orientation depends on whether the logical pages are in
- landscape mode or in portrait mode.
+ Puts eight logical pages on a single physical page. As for |2 on 1| and
+ |4 on 1|, the orientation depends on whether the logical pages are in
+ landscape mode or in portrait mode.
\end{pgflayout}
\begin{pgflayout}{16 on 1}
- This is for the \textsc{ceo}.
+ This is for the \textsc{ceo}.
\end{pgflayout}
\begin{pgflayout}{rounded corners}
- \label{layout-rounded-corners}
- This layout adds ``rounded corners'' to every page, which,
- supposedly, looks nicer during presentations with projectors
- (personally, I doubt this). This is done by (possibly) resizing the
- page to the physical page size. Then four black rectangles are
- 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 drawn and clipped against the
- clipping region.
-
- Note that every logical page should fill its background for this to
- work.
-
- In addition to the \meta{options} that can be given to |resize to|,
- the following options may be given.
- \begin{itemize}
- \item \declare{|corner width=|\meta{size}} specifies the size of
- the corner.
- \end{itemize}
-
- \begin{codeexample}[code only]
+\label{layout-rounded-corners}
+ This layout adds ``rounded corners'' to every page, which, supposedly,
+ looks nicer during presentations with projectors (personally, I doubt
+ this). This is done by (possibly) resizing the page to the physical page
+ size. Then four black rectangles are 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 drawn and clipped against the
+ clipping region.
+
+ Note that every logical page should fill its background for this to work.
+
+ In addition to the \meta{options} that can be given to |resize to|, the
+ following options may be given.
+ %
+ \begin{itemize}
+ \item \declare{|corner width=|\meta{size}} specifies the size of the
+ corner.
+ \end{itemize}
+ %
+\begin{codeexample}[code only]
\documentclass{beamer}
\usepackage{pgfpages}
\pgfpagesuselayout{rounded corners}[corner width=5pt]
@@ -285,60 +272,56 @@ select a layout using the following command:
...
\end{document}
\end{codeexample}
+ %
\end{pgflayout}
\begin{pgflayout}{two screens with lagging second}
- This layout puts two logical pages alongside each other. The second
- page always shows what the main
- page showed on the previous physical page. Thus, the second page
- ``lags behind'' the main page. This can be useful when you have two
- projectors attached to your computer and can show different parts of
- a physical page on different projectors.
-
- The following \meta{options} may be given:
- \begin{itemize}
- \item \declare{|second right|} puts the second page right of the
- main page. This will make the physical pages twice as wide
- as the logical pages, but it will retain the height.
- \item \declare{|second left|} puts the second page left,
- otherwise it behaves the same as |second right|.
- \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|.
- \end{itemize}
+ This layout puts two logical pages alongside each other. The second page
+ always shows what the main page showed on the previous physical page. Thus,
+ the second page ``lags behind'' the main page. This can be useful when you
+ have two projectors attached to your computer and can show different parts
+ of a physical page on different projectors.
+
+ The following \meta{options} may be given:
+ %
+ \begin{itemize}
+ \item \declare{|second right|} puts the second page right of the main
+ page. This will make the physical pages twice as wide as the
+ logical pages, but it will retain the height.
+ \item \declare{|second left|} puts the second page left, otherwise it
+ behaves the same as |second right|.
+ \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|.
+ \end{itemize}
\end{pgflayout}
\begin{pgflayout}{two screens with optional second}
- This layout works similarly to
- |two screens with lagging second|. The difference is that the
- contents of the second screen only changes when one of the commands
- |\pgfshipoutlogicalpage{2}|\marg{box} or
- |\pgfcurrentpagewillbelogicalpage{2}| is called. The first puts the
- given \meta{box} on the second page. The second specifies that the
- current page should be put there, once it is finished.
-
- The same options as for |two screens with lagging second| may be
- given.
+ This layout works similarly to |two screens with lagging second|. The
+ difference is that the contents of the second screen only changes when one
+ of the commands |\pgfshipoutlogicalpage{2}|\marg{box} or
+ |\pgfcurrentpagewillbelogicalpage{2}| is called. The first puts the given
+ \meta{box} on the second page. The second specifies that the current page
+ should be put there, once it is finished.
+
+ The same options as for |two screens with lagging second| may be given.
\end{pgflayout}
+You can define your own predefined layouts using the following command:
+\begin{command}{\pgfpagesdeclarelayout\marg{layout}\marg{before actions}\marg{after actions}}
+ This command predefines a \meta{layout} that can later be installed using
+ the |\pgfpagesuselayout| command.
-You can define your own predefined layouts using the following
-command:
-
-\begin{command}{\pgfpagesdeclarelayout\marg{layout}\marg{before
- actions}\marg{after actions}}
- This command predefines a \meta{layout} that can later be installed
- using the |\pgfpagesuselayout| command.
+ When |\pgfpagesuselayout|\marg{layout}\oarg{options} is called, the
+ following happens: First, the \meta{before actions} are executed. They can
+ be used, for example, to set up default values for keys. Next,
+ |\setkeys{pgfpagesuselayoutoption}|\marg{options} is executed. Finally, the
+ \meta{after actions} are executed.
- When |\pgfpagesuselayout|\marg{layout}\oarg{options} is called, the
- following happens: First, the \meta{before actions} are
- executed. They can be used, for example, to set up default values for
- keys. Next, |\setkeys{pgfpagesuselayoutoption}|\marg{options} is
- executed. Finally, the \meta{after actions} are executed.
-
- Here is an example:
+ Here is an example:
+ %
\begin{codeexample}[code only]
\pgfpagesdeclarelayout{resize to}
{
@@ -360,58 +343,55 @@ command:
}%
}
\end{codeexample}
+ %
\end{command}
-
-
\subsection{Defining a Layout}
-If none of the predefined layouts meets your problem or if you wish to
-modify them, you can create layouts from scratch. This section
-explains how this is done.
+If none of the predefined layouts meets your problem or if you wish to modify
+them, you can create layouts from scratch. This section explains how this is
+done.
-Basically, |pgfpages| hooks into \TeX's |\shipout| function. This
-function is called whenever \TeX\ has completed typesetting a page and
-wishes to send this page to the |.dvi| or |.pdf| file. The |pgfpages|
-package redefines this command. Instead of sending the page to the output
-file, |pgfpages| stores it in an internal box and then acts as if the
-page had been output. When \TeX\ tries to output the next page using
-|\shipout|, this call is once more intercepted and the page is stored
-in another box. These boxes are called \emph{logical pages}.
+Basically, |pgfpages| hooks into \TeX's |\shipout| function. This function is
+called whenever \TeX\ has completed typesetting a page and wishes to send this
+page to the |.dvi| or |.pdf| file. The |pgfpages| package redefines this
+command. Instead of sending the page to the output file, |pgfpages| stores it
+in an internal box and then acts as if the page had been output. When \TeX\
+tries to output the next page using |\shipout|, this call is once more
+intercepted and the page is stored in another box. These boxes are called
+\emph{logical pages}.
At some point, enough logical pages have been accumulated such that a
-\emph{physical page} can be output. When this happens, |pgfpages|
-possibly scales, rotates, and translates the logical pages (and
-possibly even does further modifications) and then puts them at
-certain positions of the \emph{physical} page. Once this page is fully
-assembled, the ``real'' or ``original'' |\shipout| is called to
-send the physical page to the output file.
-
-In reality, things are slightly more complicated. First, once a
-physical page has been shipped out, the logical pages are usually
-voided, but this need not be the case. Instead, it is possible that
-certain logical pages just retain their contents after the physical
-page has been shipped out and these pages need not be filled once more
-before a physical shipout can occur. However, the contents of these
-logical pages can still be changed using special commands. It is also
-possible that after a shipout certain logical pages are filled with
-the contents of \emph{other} logical pages.
-
-A \emph{layout} defines for each logical page where it will go on the
-physical page and which further modifications should be done. The
-following two commands are used to define the layout:
+\emph{physical page} can be output. When this happens, |pgfpages| possibly
+scales, rotates, and translates the logical pages (and possibly even does
+further modifications) and then puts them at certain positions of the
+\emph{physical} page. Once this page is fully assembled, the ``real'' or
+``original'' |\shipout| is called to send the physical page to the output file.
+
+In reality, things are slightly more complicated. First, once a physical page
+has been shipped out, the logical pages are usually voided, but this need not
+be the case. Instead, it is possible that certain logical pages just retain
+their contents after the physical page has been shipped out and these pages
+need not be filled once more before a physical shipout can occur. However, the
+contents of these logical pages can still be changed using special commands. It
+is also possible that after a shipout certain logical pages are filled with the
+contents of \emph{other} logical pages.
+
+A \emph{layout} defines for each logical page where it will go on the physical
+page and which further modifications should be done. The following two commands
+are used to define the layout:
\begin{command}{\pgfpagesphysicalpageoptions\marg{options}}
- This command sets the characteristics of the ``physical'' page. For
- example, it is used to specify how many logical pages there are and
- how many logical pages must be accumulated before a physical page is
- shipped out. How each individual logical page is typeset is
- specified using the command |\pgfpageslogicalpageoptions|, described
- later.
-
- \example A layout for putting two portrait pages on a single
- landscape page:
+ This command sets the characteristics of the ``physical'' page. For
+ example, it is used to specify how many logical pages there are and how
+ many logical pages must be accumulated before a physical page is shipped
+ out. How each individual logical page is typeset is specified using the
+ command |\pgfpageslogicalpageoptions|, described later.
+
+ \example A layout for putting two portrait pages on a single landscape
+ page:
+ %
\begin{codeexample}[code only]
\pgfpagesphysicalpageoptions
{%
@@ -434,72 +414,70 @@ following two commands are used to define the layout:
}%
\end{codeexample}
- The following \meta{options} may be set:
- \begin{itemize}
- \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
- 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 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
- page $\meta{first} +1$ and so on, until the logical page
- \meta{last} is also filled. Once this happens, a physical shipout
- occurs and the process starts once more.
-
- Note that logical pages that lie outside the interval between
- \meta{first} and \meta{last} are filled only indirectly or when
- special commands are used.
-
- By default, \meta{last} equals \meta{logical pages}.
- \item \declare{|current logical shipout=|\meta{current}} changes
- an internal counter such that \TeX's next logical shipout will be
- stored in logical page \meta{current}.
-
- This option can be used to ``warp'' the logical page filling
- mechanism to a certain page. You can both skip logical pages and
- overwrite already filled logical pages. After the logical page
- \meta{current} has been filled, the internal counter is
- incremented normally as if the logical page \meta{current} had
- been ``reached'' normally. If you specify a \meta{current} larger
- than \meta{last}, a physical shipout will occur after the logical
- page \meta{current} has been filled.
- \item
- \declare{|physical height=|\meta{height}}
- specifies the height of the physical pages. This height is
- typically different from the normal |\paperheight|, which is used
- by \TeX\ for its typesetting and page breaking purposes.
- \item
- \declare{|physical width=|\meta{width}}
- specifies the physical width.
- \end{itemize}
+ The following \meta{options} may be set:
+ \begin{itemize}
+ \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 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 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 page
+ $\meta{first} +1$ and so on, until the logical page \meta{last} is
+ also filled. Once this happens, a physical shipout occurs and the
+ process starts once more.
+
+ Note that logical pages that lie outside the interval between
+ \meta{first} and \meta{last} are filled only indirectly or when
+ special commands are used.
+
+ By default, \meta{last} equals \meta{logical pages}.
+ \item \declare{|current logical shipout=|\meta{current}} changes an
+ internal counter such that \TeX's next logical shipout will be
+ stored in logical page \meta{current}.
+
+ This option can be used to ``warp'' the logical page filling
+ mechanism to a certain page. You can both skip logical pages and
+ overwrite already filled logical pages. After the logical page
+ \meta{current} has been filled, the internal counter is incremented
+ normally as if the logical page \meta{current} had been ``reached''
+ normally. If you specify a \meta{current} larger than \meta{last},
+ a physical shipout will occur after the logical page \meta{current}
+ has been filled.
+ \item \declare{|physical height=|\meta{height}} specifies the height of
+ the physical pages. This height is typically different from the
+ normal |\paperheight|, which is used by \TeX\ for its typesetting
+ and page breaking purposes.
+ \item \declare{|physical width=|\meta{width}} specifies the physical
+ width.
+ \end{itemize}
\end{command}
\begin{command}{\pgfpageslogicalpageoptions\marg{logical page number}\marg{options}}
- This command is used to specify where the logical page number
- \meta{logical page number} will be placed on the physical page. In
- addition, this command can be used to install additional ``code'' to
- be executed when this page is put on the physical page.
-
- The number \meta{logical page number} should be between 1 and
- \meta{logical pages}, which has previously been installed using the
- |\pgfpagesphysicalpageoptions| command.
-
- The following \meta{options} may be given:
- \begin{itemize}
- \item
- \declare{|center=|\meta{pgf point}}
- specifies the center of the logical page inside the physical page
- as a \pgfname-point. The origin of the coordinate system of the
- physical page is at the \emph{lower} left corner.
-
+ This command is used to specify where the logical page number \meta{logical
+ page number} will be placed on the physical page. In addition, this command
+ can be used to install additional ``code'' to be executed when this page is
+ put on the physical page.
+
+ The number \meta{logical page number} should be between 1 and \meta{logical
+ pages}, which has previously been installed using the
+ |\pgfpagesphysicalpageoptions| command.
+
+ The following \meta{options} may be given:
+ %
+ \begin{itemize}
+ \item \declare{|center=|\meta{pgf point}} specifies the center of the
+ logical page inside the physical page as a \pgfname-point. The
+ origin of the coordinate system of the physical page is at the
+ \emph{lower} left corner.
+ %
\begin{codeexample}[code only]
\pgfpageslogicalpageoptions{1}
{% center logical page on middle of left side
@@ -508,150 +486,134 @@ following two commands are used to define the layout:
resized height=\pgfphysicalheight,%
}
\end{codeexample}
-
- \item
- \declare{|resized width=|\meta{size}}
- specifies the width that the logical page should have \emph{at
- most} on the physical page. To achieve this width, the pages is
- scaled down appropriately \emph{or more}. The ``or more'' part
- can happen if the |resize height| option is also used. In this
- case, the scaling is chosen such that both the specified height
- and width are met. The aspect ratio of a logical page is not
- modified.
- \item
- \declare{|resized height=|\meta{height}}
- specifies the maximum height of the logical page.
- \item
- \declare{|original width=|\meta{width}}
- specifies the width the \TeX\ ``thinks'' that the logical page
- has. This width is |\paperwidth| at the point of invocation, by
- default. Note that setting this width to something different from
- |\paperwidth| does \emph{not} change the |\pagewidth| during
- \TeX's typesetting. You have to do that yourself.
-
- You need this option only for special logical pages that have
- a height or width different from the normal one and for which you
- will (later on) set these sizes yourself.
- \item
- \declare{|original height=|\meta{height}}
- works like |original width|.
- \item
- \declare{|scale=|\meta{factor}}
- scales the page by at least the given \meta{factor}. A
- \meta{factor} of |0.5| will half the size of the page, a factor or
- |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.
- \item
- \declare{|xscale=|\meta{factor}}
- scales the logical page along the $x$-axis by the given
- \meta{factor}. This scaling is done independently of any other
- scaling. Mostly, this option is useful for a factor of |-1|, which
- flips the page along the $y$-axis. The aspect ratio is not kept.
- \item
- \declare{|yscale=|\meta{factor}}
- works like |xscale|, only for the $y$-axis.
- \item
- \declare{|rotation=|\meta{degree}}
- rotates the page by \meta{degree} around its center. Use a degree
- of |90| or |-90| to go from portrait to landscape and back. The
- rotation need not be a multiple of |90|.
- \item
- \declare{|copy from=|\meta{logical page number}}.
- 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}.
-
- \example Have logical page 2 retain its contents:
+ %
+ \item \declare{|resized width=|\meta{size}} specifies the width that
+ the logical page should have \emph{at most} on the physical page.
+ To achieve this width, the pages is scaled down appropriately
+ \emph{or more}. The ``or more'' part can happen if the
+ |resize height| option is also used. In this case, the scaling is
+ chosen such that both the specified height and width are met. The
+ aspect ratio of a logical page is not modified.
+ \item \declare{|resized height=|\meta{height}} specifies the maximum
+ height of the logical page.
+ \item \declare{|original width=|\meta{width}} specifies the width the
+ \TeX\ ``thinks'' that the logical page has. This width is
+ |\paperwidth| at the point of invocation, by default. Note that
+ setting this width to something different from |\paperwidth| does
+ \emph{not} change the |\pagewidth| during \TeX's typesetting. You
+ have to do that yourself.
+
+ You need this option only for special logical pages that have a
+ height or width different from the normal one and for which you
+ will (later on) set these sizes yourself.
+ \item \declare{|original height=|\meta{height}} works like
+ |original width|.
+ \item \declare{|scale=|\meta{factor}} scales the page by at least the
+ given \meta{factor}. A \meta{factor} of |0.5| will half the size of
+ the page, a factor or |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.
+ \item \declare{|xscale=|\meta{factor}} scales the logical page along
+ the $x$-axis by the given \meta{factor}. This scaling is done
+ independently of any other scaling. Mostly, this option is useful
+ for a factor of |-1|, which flips the page along the $y$-axis. The
+ aspect ratio is not kept.
+ \item \declare{|yscale=|\meta{factor}} works like |xscale|, only for
+ the $y$-axis.
+ \item \declare{|rotation=|\meta{degree}} rotates the page by
+ \meta{degree} around its center. Use a degree of |90| or |-90| to
+ go from portrait to landscape and back. The rotation need not be a
+ multiple of |90|.
+ \item \declare{|copy from=|\meta{logical page number}}. 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}.
+
+ \example Have logical page 2 retain its contents:
+ %
\begin{codeexample}[code only]
\pgfpageslogicalpageoptions{2}{copy from=2}
\end{codeexample}
- \example Let logical page 2 show what logical page 1 showed on the
- just-shipped-out physical page:
+ \example Let logical page 2 show what logical page 1 showed on the
+ just-shipped-out physical page:
+ %
\begin{codeexample}[code only]
\pgfpageslogicalpageoptions{2}{copy from=1}
\end{codeexample}
- \item
- \declare{|border shrink|=\meta{size}}
- specifies an additional reduction of the size to which the page is
- page is scaled.
- \item
- \declare{|border code|=\meta{code}}.
- When this option is given, the \meta{code} is executed before the
- page box is inserted with a path preinstalled that is a rectangle
- around the current logical page. Thus, setting \meta{code} to
- |\pgfstroke| draws a rectangle around the logical page. Setting
- \meta{code} to |\pgfsetlinewidth{3pt}\pgfstroke| results in a
- thick (ugly) frame. Adding dashes and filling can result in
- arbitrarily funky and distracting borders.
-
- You can also call |\pgfdiscardpath| and add your own path
- construction code (for example to paint a rectangle with rounded
- corners). The coordinate system is set up in such a way that a
- rectangle starting at the origin and having the height and width
- of \TeX-box 0 will result in a rectangle filling exactly the
- logical page currently being put on the physical page. The logical
- page is inserted \emph{after} these commands have been executed.
-
- \example Add a rectangle around the page:
+ %
+ \item \declare{|border shrink|=\meta{size}} specifies an additional
+ reduction of the size to which the page is page is scaled.
+ \item \declare{|border code|=\meta{code}}. When this option is given,
+ the \meta{code} is executed before the page box is inserted with a
+ path preinstalled that is a rectangle around the current logical
+ page. Thus, setting \meta{code} to |\pgfstroke| draws a rectangle
+ around the logical page. Setting \meta{code} to
+ |\pgfsetlinewidth{3pt}\pgfstroke| results in a thick (ugly) frame.
+ Adding dashes and filling can result in arbitrarily funky and
+ distracting borders.
+
+ You can also call |\pgfdiscardpath| and add your own path
+ construction code (for example to paint a rectangle with rounded
+ corners). The coordinate system is set up in such a way that a
+ rectangle starting at the origin and having the height and width of
+ \TeX-box 0 will result in a rectangle filling exactly the logical
+ page currently being put on the physical page. The logical page is
+ inserted \emph{after} these commands have been executed.
+
+ \example Add a rectangle around the page:
+ %
\begin{codeexample}[code only]
\pgfpageslogicalpageoptions{1}{border code=\pgfstroke}
\end{codeexample}
- \item
- \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}.
- \end{itemize}
+ %
+ \item \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}.
+ \end{itemize}
\end{command}
-
-
\subsection{Creating Logical Pages}
-Logical pages are created whenever \TeX\ thinks that a page is full
-and performs a |\shipout| command. This will cause |pgfpages| to store
-the box that was supposed to be shipped out internally until enough
-logical pages have been collected such that a physical shipout can
-occur.
+Logical pages are created whenever \TeX\ thinks that a page is full and
+performs a |\shipout| command. This will cause |pgfpages| to store the box that
+was supposed to be shipped out internally until enough logical pages have been
+collected such that a physical shipout can occur.
-Normally, whenever a logical shipout occurs, that current page is
-stored in logical page number \meta{current logical page}. This
-counter is then incremented, until it is larger than \meta{last
- logical shipout}. You can, however, directly change the value of
-\meta{current logical page} by calling |\pgfpagesphysicalpageoptions|.
+Normally, whenever a logical shipout occurs, that current page is stored in
+logical page number \meta{current logical page}. This counter is then
+incremented, until it is larger than \meta{last logical shipout}. You can,
+however, directly change the value of \meta{current logical page} by calling
+|\pgfpagesphysicalpageoptions|.
-Another way to set the contents of a logical page is to use the
-following command:
+Another way to set the contents of a logical page is to use the following
+command:
\begin{command}{\pgfpagesshipoutlogicalpage\marg{number}\meta{box}}
- This command sets to logical page \meta{number} to \meta{box}. The
- \meta{box} should be the code of a \TeX\ box command. This command
- does not influence the counter \meta{current logical page} and does
- not cause a physical shipout.
-
+ This command sets to logical page \meta{number} to \meta{box}. The
+ \meta{box} should be the code of a \TeX\ box command. This command does not
+ influence the counter \meta{current logical page} and does not cause a
+ physical shipout.
+ %
\begin{codeexample}[code only]
\pgfpagesshipoutlogicalpage{0}\vbox{Hi!}
\end{codeexample}
- This command can be used to set the contents of logical pages that
- are normally not filled.
+ This command can be used to set the contents of logical pages that are
+ normally not filled.
\end{command}
-The final way of setting a logical page is using the following
-command:
+The final way of setting a logical page is using the following 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.
-
+ 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.
+ %
\begin{codeexample}[code only]
\pgfpagesuselayout{two screens with optional second}
...
@@ -664,8 +626,10 @@ Text that goes to second page
Text for main page.
\end{codeexample}
+ %
\end{command}
+
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
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 220955bc514..c22c2c2884a 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
@@ -14,30 +14,30 @@
This section describes the package |pgfcalendar|.
\begin{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 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
- (integer) number of days that have elapsed since the initial epoch
- at noon Universal Time (UT) Monday, January 1, 4713 BC in the
- proleptic Julian calendar.'' The package also provides a function
- for converting a Julian day number to an ISO-format date.
-
- Julian day numbers make it very easy to work with days. For
- example, the date ten days in the future of 2008-02-20 can
- be computed by converting this date to a Julian day number, adding
- 10, and then converting it back. Also, the day of week of a given
- date can be computed by taking the Julian day number modulo~7.
- \item It provides a macro for typesetting a calendar. This macro
- 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 configurations for
- typesetting calendars based on this command.
- \end{enumerate}
+ This package can be used independently of \pgfname. It has two purposes:
+ %
+ \begin{enumerate}
+ \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 (integer)
+ number of days that have elapsed since the initial epoch at noon
+ Universal Time (UT) Monday, January 1, 4713 BC in the proleptic
+ Julian calendar''. The package also provides a function for
+ converting a Julian day number to an ISO-format date.
+
+ Julian day numbers make it very easy to work with days. For
+ example, the date ten days in the future of 2008-02-20 can be
+ computed by converting this date to a Julian day number, adding 10,
+ and then converting it back. Also, the day of week of a given date
+ can be computed by taking the Julian day number modulo~7.
+ \item It provides a macro for typesetting a calendar. This macro 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 configurations for
+ typesetting calendars based on this command.
+ \end{enumerate}
\end{package}
@@ -46,191 +46,188 @@ This section describes the package |pgfcalendar|.
\subsubsection{Conversions Between Date Types}
\begin{command}{\pgfcalendardatetojulian\marg{date}\marg{counter}}
- This macro converts a date in a format to be described in a moment
- to the Julian day number in the Gregorian calendar. The \meta{date}
- should expand to a string of the following form:
- \begin{enumerate}\label{calendar-date-format}
- \item It should start with a number representing the year. Use
- |\year| for the current year, that is, the year the file is being
- typeset.
- \item The year must be followed by a hyphen.
- \item Next should come a number representing the month. Use |\month|
- for the current month. You can, but need not, use leading
- zeros. For example, |02| represents February, just like |2|.
- \item The month must also be followed by a hyphen.
- \item Next you must either provide a day of month (again, a number
- and, again, |\day| yields the current day of month) or the keyword
- |last|. This keyword refers to the last day of the month, which is
- automatically computed (and which is a bit tricky to compute,
- especially for February).
- \item Optionally, you can next provide a plus sign followed by
- positive or negative number. This number of days will be added to
- the computed date.
- \end{enumerate}
-
- Here are some examples:
- \begin{itemize}
- \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| 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.
-
- \newcount\mycount
- \example |\pgfcalendardatetojulian{2007-01-14}{\mycount}| sets
- |\mycount| to
- \pgfcalendardatetojulian{2007-01-14}{\mycount}\the\mycount.
+ This macro converts a date in a format to be described in a moment to the
+ Julian day number in the Gregorian calendar. The \meta{date} should expand
+ to a string of the following form:
+ %
+ \begin{enumerate}
+ \label{calendar-date-format}
+ \item It should start with a number representing the year. Use |\year|
+ for the current year, that is, the year the file is being typeset.
+ \item The year must be followed by a hyphen.
+ \item Next should come a number representing the month. Use |\month|
+ for the current month. You can, but need not, use leading zeros.
+ For example, |02| represents February, just like |2|.
+ \item The month must also be followed by a hyphen.
+ \item Next you must either provide a day of month (again, a number and,
+ again, |\day| yields the current day of month) or the keyword
+ |last|. This keyword refers to the last day of the month, which is
+ automatically computed (and which is a bit tricky to compute,
+ especially for February).
+ \item Optionally, you can next provide a plus sign followed by positive
+ or negative number. This number of days will be added to the
+ computed date.
+ \end{enumerate}
+
+ Here are some examples:
+ %
+ \begin{itemize}
+ \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| 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.
+
+ \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 macro}\marg{month macro}\marg{day macro}}
+ This command converts a Julian day number to an ISO-date. The \meta{Julian
+ day} must be a number or \TeX\ counter, the \meta{year macro}, \meta{month
+ macro} and \meta{day macro} must be \TeX\ macro names. They will be set to
+ numbers representing the year, month, and day of the given Julian day in
+ the Gregorian calendar.
-\end{command}
+ The \meta{year macro} will be assigned the year without leading zeros. Note
+ that this macro will produce year 0 (as opposed to other calendars, where
+ year 0 does not exist). However, if you really need calendars for before
+ the year 1, it is expected that you know what you are doing anyway.
+
+ The \meta{month macro} gets assigned a two-digit number representing the
+ month (with a leading zero, if necessary). Thus, the macro is set to |01|
+ for January.
-\begin{command}{\pgfcalendarjuliantodate\marg{Julian day}\marg{year
- macro}\marg{month macro}\marg{day macro}}
- This command converts a Julian day number to an ISO-date. The
- \meta{Julian day} must be a number or \TeX\ counter, the \meta{year macro},
- \meta{month macro} and \meta{day macro} must be \TeX\ macro
- names. They will be set to numbers representing the year, month, and
- day of the given Julian day in the Gregorian calendar.
-
- The \meta{year macro} will be assigned the year without leading
- zeros. Note that this macro will produce year 0 (as opposed to other
- calendars, where year 0 does not exist). However, if you really need
- calendars for before the year 1, it is expected that you know what
- you are doing anyway.
-
- The \meta{month macro} gets assigned a two-digit number representing
- the month (with a leading zero, if necessary). Thus, the macro is
- set to |01| for January.
-
- The \meta{day macro} gets assigned a two-digit number representing
- the day of the month (again, possibly with a leading zero).
-
- To convert a Julian day number to an ISO-date you use code like the
- following:
+ The \meta{day macro} gets assigned a two-digit number representing the day
+ of the month (again, possibly with a leading zero).
+
+ To convert a Julian day number to an ISO-date you use code like the
+ following:
+ %
\begin{verbatim}
\pgfcalendardatetojulian{2454115}{\myyear}{\mymonth}{\myday}
\edef\isodate{\myyear-\mymonth-\myday}
\end{verbatim}
- The above code sets |\isodate| to
- \pgfcalendarjuliantodate{2454115}{\myyear}{\mymonth}{\myday}%
- \edef\isodate{\myyear-\mymonth-\myday}\texttt{\isodate}.
+ %
+ The above code sets |\isodate| to
+ \pgfcalendarjuliantodate{2454115}{\myyear}{\mymonth}{\myday}%
+ \edef\isodate{\myyear-\mymonth-\myday}\texttt{\isodate}.
\end{command}
-
\begin{command}{\pgfcalendarjuliantoweekday\marg{Julian day}\marg{week day counter}}
- This command converts a Julian day to a week day by computing the
- day modulo 7. The \meta{week day counter} must be a \TeX\
- counter. It will be set to 0 for a Monday, to 1 for a Tuesday, and
- so on.
-
- \example |\pgfcalendarjuliantoweekday{2454115}{\mycount}| sets
- |\mycount| to
- \pgfcalendarjuliantoweekday{2454115}{\mycount}\the\mycount\ (it was a Sunday).
+ This command converts a Julian day to a week day by computing the day
+ modulo 7. The \meta{week day counter} must be a \TeX\ counter. It will be
+ set to 0 for a Monday, to 1 for a Tuesday, and so on.
+
+ \example |\pgfcalendarjuliantoweekday{2454115}{\mycount}| sets
+ |\mycount| to
+ \pgfcalendarjuliantoweekday{2454115}{\mycount}\the\mycount\ (it was a Sunday).
\end{command}
\subsubsection{Checking Dates}
-
\begin{command}{\pgfcalendarifdate\marg{date}\marg{tests}\marg{code}\marg{else code}}
- \label{pgfcalendarifdate}
- This command is used to execute code based on properties of
- \meta{date}. The \meta{date} must be a date in ISO-format. For
- this date, the \meta{tests} are checked (to be detailed later)
- and if one of the tests succeeds, the \meta{code} is
- executed. If none of the tests succeeds, the \meta{else code} is
- executed.
-
- \example |\pgfcalendarifdate{2007-02-07}{Wednesday}{Is a Wednesday}{Is not a Wednesday}|
- yields \texttt{\pgfcalendarifdate{2007-02-07}{Wednesday}{Is a
- Wednesday}{Is not a Wednesday}}.
-
- The \meta{tests} is a comma-separated list of key-value
- pairs. The following are defined by default:
- \begin{itemize}
- \itemcalendaroption{all} This test is passed by all dates.
- \itemcalendaroption{Monday} This test is passed by all dates that
- are Mondays.
- \itemcalendaroption{Tuesday} as above.
- \itemcalendaroption{Wednesday} as above.
- \itemcalendaroption{Thursday} as above.
- \itemcalendaroption{Friday} as above.
- \itemcalendaroption{Saturday} as above.
- \itemcalendaroption{Sunday} as above.
- \itemcalendaroption{workday} Passed by Mondays, Tuesdays,
- Wednesdays, Thursdays, and Fridays.
- \itemcalendaroption{weekend} Passed by 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
- first case, the test is passed if \meta{date} is the same as
- \meta{reference}. In the second case, the test is passed if the
- month and day part of \meta{date} is the same as \meta{reference}.
-
- For example, the test |equals=2007-01-10| will only be passed by this
- particular date. The test |equals=05-01| will be passed by every first
- of May on any year.
- \itemcalendaroption{at least}|=|\meta{reference} This test works
- similarly to the |equals| test, only it is checked whether
- \meta{date} is equal to \meta{reference} or to any later
- date. Again, the \meta{reference} can be a full date like
- |2007-01-01| or a short version like |07-01|. For example,
- |at least=07-01| is true for every day in the second half of any
- year.
- \itemcalendaroption{at most}|=|\meta{reference} as above.
- \itemcalendaroption{between}|=|\meta{start reference}| and |\meta{end
- reference} This test checks whether the current date lies between
- the two given reference dates. Both full and short version may be
- given.
-
- For example |between=2007-01-01 and 2007-02-28| is true for the days
- in January and February of 2007.
-
- For another example, |between=05-01 and 05-07| is true for the
- days of the first week of May of any year.
- \itemcalendaroption{day of month}|=|\meta{number} Passed by the day
- of month of the \meta{date} that is \meta{number}. For example, the test
- |day of month=1| is passed by every first of every month.
- \itemcalendaroption{end of month}\opt{|=|\meta{number}} Passed by
- the day of month of the \meta{date} that is \meta{number} from the
- end of the month. For example, the test |end of month=1| is passed
- by the last day of every month, the test |end of month=2| is passed
- by the second last day of every month. If \meta{number} is omitted,
- it is assumed to be |1|.
- \end{itemize}
-
- In addition to the above checks, you can also define new checks. To
- do so, you must add a new key to the path |/pgf/calendar/| using
- the |\pgfkeys| command. The job of the
- code of this new key is to possibly set the \TeX-if |\ifpgfcalendarmatches| to true (if it is
- already true, no action should be taken) to indicate that the
- \meta{date} passes the test setup by this new key.
-
- In order to perform the test, the key code needs to know the date
- that should be checked. The date is available through a macro, but a
- whole bunch of additional information about this date is also
- available through the following macros:
- \begin{itemize}
- \item |\pgfcalendarifdatejulian|
- is the Julian day number of the \meta{date} to be checked.
- \item |\pgfcalendarifdateweekday|
- is the weekday of the \meta{date} to be checked.
- \item |\pgfcalendarifdateyear|
- is the year of the \meta{date} to be checked.
- \item |\pgfcalendarifdatemonth|
- is the month of the \meta{date} to be checked.
- \item |\pgfcalendarifdateday|
- is the day of month of the \meta{date} to be checked.
- \end{itemize}
-
- For example, let us define a new key that checks whether the
- \meta{date} is a Workers day (May 1st). This can be done as
- follows:
+\label{pgfcalendarifdate}
+ This command is used to execute code based on properties of \meta{date}.
+ The \meta{date} must be a date in ISO-format. For this date, the
+ \meta{tests} are checked (to be detailed later) and if one of the tests
+ succeeds, the \meta{code} is executed. If none of the tests succeeds, the
+ \meta{else code} is executed.
+
+ \example |\pgfcalendarifdate{2007-02-07}{Wednesday}{Is a Wednesday}{Is not a Wednesday}|
+ yields \texttt{\pgfcalendarifdate{2007-02-07}{Wednesday}{Is a Wednesday}{Is
+ not a Wednesday}}.
+
+ The \meta{tests} is a comma-separated list of key--value pairs. The
+ following are defined by default:
+ %
+ \begin{itemize}
+ \itemcalendaroption{all} This test is passed by all dates.
+ \itemcalendaroption{Monday} This test is passed by all dates that are
+ Mondays.
+ \itemcalendaroption{Tuesday} as above.
+ \itemcalendaroption{Wednesday} as above.
+ \itemcalendaroption{Thursday} as above.
+ \itemcalendaroption{Friday} as above.
+ \itemcalendaroption{Saturday} as above.
+ \itemcalendaroption{Sunday} as above.
+ \itemcalendaroption{workday} Passed by Mondays, Tuesdays, Wednesdays,
+ Thursdays, and Fridays. \itemcalendaroption{weekend} Passed by
+ 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
+ first case, the test is passed if \meta{date} is the same as
+ \meta{reference}. In the second case, the test is passed if the
+ month and day part of \meta{date} is the same as \meta{reference}.
+
+ For example, the test |equals=2007-01-10| will only be passed by
+ this particular date. The test |equals=05-01| will be passed by
+ every first of May on any year.
+ \itemcalendaroption{at least}|=|\meta{reference} This test works
+ similarly to the |equals| test, only it is checked whether
+ \meta{date} is equal to \meta{reference} or to any later date.
+ Again, the \meta{reference} can be a full date like |2007-01-01| or
+ a short version like |07-01|. For example, |at least=07-01| is true
+ for every day in the second half of any year.
+ \itemcalendaroption{at most}|=|\meta{reference} as above.
+ \itemcalendaroption{between}|=|\meta{start reference}| and |\meta{end
+ reference} This test checks whether the current date lies between
+ the two given reference dates. Both full and short version may be
+ given.
+
+ For example |between=2007-01-01 and 2007-02-28| is true for the
+ days in January and February of 2007.
+
+ For another example, |between=05-01 and 05-07| is true for the days
+ of the first week of May of any year.
+ \itemcalendaroption{day of month}|=|\meta{number} Passed by the day of
+ month of the \meta{date} that is \meta{number}. For example, the
+ test |day of month=1| is passed by every first of every month.
+ \itemcalendaroption{end of month}\opt{|=|\meta{number}} Passed by the
+ day of month of the \meta{date} that is \meta{number} from the end
+ of the month. For example, the test |end of month=1| is passed by
+ the last day of every month, the test |end of month=2| is passed by
+ the second last day of every month. If \meta{number} is omitted, it
+ is assumed to be |1|.
+ \end{itemize}
+
+ In addition to the above checks, you can also define new checks. To do so,
+ you must add a new key to the path |/pgf/calendar/| using the |\pgfkeys|
+ command. The job of the code of this new key is to possibly set the \TeX-if
+ |\ifpgfcalendarmatches| to true (if it is already true, no action should be
+ taken) to indicate that the \meta{date} passes the test setup by this new
+ key.
+
+ In order to perform the test, the key code needs to know the date that
+ should be checked. The date is available through a macro, but a whole bunch
+ of additional information about this date is also available through the
+ following macros:
+ %
+ \begin{itemize}
+ \item |\pgfcalendarifdatejulian| is the Julian day number of the
+ \meta{date} to be checked.
+ \item |\pgfcalendarifdateweekday| is the weekday of the \meta{date} to
+ be checked.
+ \item |\pgfcalendarifdateyear| is the year of the \meta{date} to be
+ checked.
+ \item |\pgfcalendarifdatemonth| is the month of the \meta{date} to be
+ checked.
+ \item |\pgfcalendarifdateday| is the day of month of the \meta{date} to
+ be checked.
+ \end{itemize}
+
+ For example, let us define a new key that checks whether the \meta{date} is
+ a Workers day (May 1st). This can be done as follows:
+ %
\begin{verbatim}
\pgfkeys{/pgf/calendar/workers day/.code=%
{
@@ -241,144 +238,137 @@ This section describes the package |pgfcalendar|.
\fi
}}
\end{verbatim}
+ %
\end{command}
\subsubsection{Typesetting Dates}
-
-
-
\begin{command}{\pgfcalendarweekdayname\marg{week day number}}
- This command expands to a textual representation of the day of week,
- given by the \meta{week day number}. Thus,
- |\pgfcalendarweekdayname{0}| expands to |Monday| if the current
- language is English and to |Montag| if the current language is
- German, and so on. See Section~\ref{section-calendar-locale} for
- more details on translations.
-
- \example |\pgfcalendarweekdayname{2}| yields
- \texttt{\pgfcalendarweekdayname{2}}.
+ This command expands to a textual representation of the day of week, given
+ by the \meta{week day number}. Thus, |\pgfcalendarweekdayname{0}| expands
+ to |Monday| if the current language is English and to |Montag| if the
+ current language is German, and so on. See
+ Section~\ref{section-calendar-locale} for more details on translations.
+
+ \example |\pgfcalendarweekdayname{2}| yields
+ \texttt{\pgfcalendarweekdayname{2}}.
\end{command}
-
\begin{command}{\pgfcalendarweekdayshortname\marg{week day number}}
- This command works similarly to the previous command, only an
- abbreviated version of the week day is produced.
+ 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}}.
+ \example |\pgfcalendarweekdayshortname{2}| yields
+ \texttt{\pgfcalendarweekdayshortname{2}}.
\end{command}
-
\begin{command}{\pgfcalendarmonthname\marg{month number}}
- This command expands to a textual representation of the month, which
- is given by the \meta{month number}.
+ This command expands to a textual representation of the month, which is
+ given by the \meta{month number}.
- \example |\pgfcalendarmonthname{12}| yields
- \texttt{\pgfcalendarmonthname{12}}.
+ \example |\pgfcalendarmonthname{12}| yields
+ \texttt{\pgfcalendarmonthname{12}}.
\end{command}
-
\begin{command}{\pgfcalendarmonthshortname\marg{month number}}
- As above, only an abbreviated version is produced.
+ As above, only an abbreviated version is produced.
- \example |\pgfcalendarmonthshortname{12}| yields
- \texttt{\pgfcalendarmonthshortname{12}}.
+ \example |\pgfcalendarmonthshortname{12}| yields
+ \texttt{\pgfcalendarmonthshortname{12}}.
\end{command}
-
\subsubsection{Localization}
-
\label{section-calendar-locale}
-All textual representations of week days or months (like ``Monday'' or
-``February'') are wrapped with |\translate| commands from the
-|translator| package (it this package is not loaded, no translation
-takes place). Furthermore, the |pgfcalendar| package will try to load
-the |translator-months-dictionary|, if the |translator| package is
-loaded.
-The net effect of all this is that all dates will be translated to the
-current language setup in the |translator| package. See the
-documentation of this package for more details.
+All textual representations of week days or months (like ``Monday'' or
+``February'') are wrapped with |\translate| commands from the |translator|
+package (it this package is not loaded, no translation takes place).
+Furthermore, the |pgfcalendar| package will try to load the
+|translator-months-dictionary|, if the |translator| package is loaded.
+The net effect of all this is that all dates will be translated to the current
+language setup in the |translator| package. See the documentation of this
+package for more details.
\subsection{Typesetting Calendars}
-\begin{command}{\pgfcalendar\marg{prefix}\marg{start date}\marg{end
- date}\marg{rendering code}}
- This command can be used to typeset a calendar. It is a very general
- command, the actual work has to be done by giving clever
- implementations of \meta{rendering code}. Note that this macro need
- \emph{not} be called inside a |{pgfpicture}| environment (even
- though it typically will be) and you can use it to typeset calendars
- in normal \TeX\ or using packages other than \pgfname.
-
- \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
- 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.
-
- The different calls of the \meta{rending code} are not
- surrounded by \TeX\ groups (though you can do so yourself, of
- course). This means that settings can accumulate between different
- calls, which is often desirable and useful.
-
- \medskip
- \textbf{Information about the current date.}
- Inside the \meta{rendering code}, different macros can be access:
-
- \begin{itemize}
- \item |\pgfcalendarprefix|
- 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).
- \item |\pgfcalendarbeginjulian|
- Julian day number of \meta{start date}.
- \item |\pgfcalendarendiso|
- 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
- Julian day number of the day currently being rendered.
- \item |\pgfcalendarcurrentweekday| The weekday
- (a number with zero representing Monday) of the current date.
- \item |\pgfcalendarcurrentyear| The year of the current date.
- \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
- (always two digits).
- \end{itemize}
-
- \medskip
- {\bfseries The |\ifdate| command.}
- Inside the |\pgfcalendar| the macro |\ifdate| is available
- locally:
- \begin{command}{\ifdate\marg{tests}\marg{code}\marg{else code}}
+\begin{command}{\pgfcalendar\marg{prefix}\marg{start date}\marg{end date}\marg{rendering code}}
+ This command can be used to typeset a calendar. It is a very general
+ command, the actual work has to be done by giving clever implementations of
+ \meta{rendering code}. Note that this macro need \emph{not} be called
+ inside a |{pgfpicture}| environment (even though it typically will be) and
+ you can use it to typeset calendars in normal \TeX\ or using packages other
+ than \pgfname.
+
+
+ \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 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.
+
+ The different calls of the \meta{rending code} are not surrounded by \TeX\
+ groups (though you can do so yourself, of course). This means that settings
+ can accumulate between different calls, which is often desirable and
+ useful.
+
+
+ \medskip
+ \textbf{Information about the current date.}
+ Inside the \meta{rendering code}, different macros can be access:
+ %
+ \begin{itemize}
+ \item |\pgfcalendarprefix| 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).
+ \item |\pgfcalendarbeginjulian| Julian day number of \meta{start date}.
+ \item |\pgfcalendarendiso| 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 Julian day
+ number of the day currently being rendered.
+ \item |\pgfcalendarcurrentweekday| The weekday (a number with zero
+ representing Monday) of the current date.
+ \item |\pgfcalendarcurrentyear| The year of the current date.
+ \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
+ (always two digits).
+ \end{itemize}
+
+
+ \medskip
+ {\bfseries The |\ifdate| command.}
+ Inside the |\pgfcalendar| the macro |\ifdate| is available locally:
+ %
+ \begin{command}{\ifdate\marg{tests}\marg{code}\marg{else code}}
\label{ifdate}%
- This command has the same effect as calling |\pgfcalendarifdate|
- for the current date.
- \end{command}
-
- \medskip
- \textbf{Examples.}
- In a first example, let us create a very simple calendar: It just
- lists the dates in a certain range.
+ This command has the same effect as calling |\pgfcalendarifdate|
+ for the current date.
+ \end{command}
+
+
+ \medskip
+ \textbf{Examples.}
+ 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\ }
\end{codeexample}
- Let us now make this a little more interesting: Let us add a line
- break after each Sunday.
+ %
+ Let us now make this a little more interesting: Let us add a line break
+ after each Sunday.
+ %
\begin{codeexample}[vbox,ignorespaces]
\pgfcalendar{cal}{2007-01-20}{2007-02-10}
{
@@ -386,9 +376,11 @@ documentation of this package for more details.
\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
- horizontally using a skip.
+ %
+ 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
+ horizontally using a skip.
+ %
\begin{codeexample}[vbox,ignorespaces]
\pgfcalendar{cal}{2007-01-20}{2007-02-10}
{%
@@ -397,7 +389,9 @@ documentation of this package for more details.
\ifdate{Sunday}{\par}{}%
}
\end{codeexample}
- Let us now typeset two complete months.
+ %
+ Let us now typeset two complete months.
+ %
\begin{codeexample}[vbox,ignorespaces]
\pgfcalendar{cal}{2007-01-01}{2007-02-28}{%
\ifdate{day of month=1}{
@@ -414,7 +408,9 @@ 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}
\pgfcalendar{cal}{2007-01-20}{2007-02-10}{%
@@ -428,46 +424,47 @@ documentation of this package for more details.
\draw (cal-2007-01-21) -- (cal-2007-02-03);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgfcalendarshorthand\marg{kind}\marg{representation}}
- \label{pgfcalendarshorthand}
- This command can be used inside a |\pgfcalendar|, where it will
- expand to a representation of the current day, month, year or day of
- week, depending on whether \meta{kind} is |d|, |m|, |y| or |w|. The
- \meta{representation} can be one of the following: |-|, |=|, |0|,
- |.|, and |t|. They have the following meanings:
- \begin{itemize}
- \item The minus sign selects the shortest numerical representation
- possible (no leading zeros).
- \item The equal sign also selects the shortest numerical
- representation, but a space is added to single digit days and
- months (thereby ensuring that they have the same length as other
- days).
- \item The zero digit selects a two-digit numerical representation
- for days and months. For years it is allowed, but has no effect.
- \item The letter |t| selects a textual representation.
- \item The dot selects an abbreviated textual representation.
- \end{itemize}
- Normally, you should say |\let\%=\pgfcalendarshorthand| locally, so
- that you can write |\%wt| instead of the much more cumbersome
- |\pgfcalendarshorthand{w}{t}|.
-
+\label{pgfcalendarshorthand}
+ This command can be used inside a |\pgfcalendar|, where it will expand to a
+ representation of the current day, month, year or day of week, depending on
+ whether \meta{kind} is |d|, |m|, |y| or |w|. The \meta{representation} can
+ be one of the following: |-|, |=|, |0|, |.|, and |t|. They have the
+ following meanings:
+ %
+ \begin{itemize}
+ \item The minus sign selects the shortest numerical representation
+ possible (no leading zeros).
+ \item The equal sign also selects the shortest numerical
+ representation, but a space is added to single digit days and
+ months (thereby ensuring that they have the same length as other
+ days).
+ \item The zero digit selects a two-digit numerical representation for
+ days and months. For years it is allowed, but has no effect.
+ \item The letter |t| selects a textual representation.
+ \item The dot selects an abbreviated textual representation.
+ \end{itemize}
+ %
+ Normally, you should say |\let\%=\pgfcalendarshorthand| locally, so that
+ you can write |\%wt| instead of the much more cumbersome
+ |\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}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgfcalendarsuggestedname}
- This macro expands to a suggested name for nodes representing days
- in a calendar. If the \meta{prefix} is empty, it expands to the
- empty string, otherwise it expands to the \meta{prefix} of the
- 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|.
+ This macro expands to a suggested name for nodes representing days in a
+ calendar. If the \meta{prefix} is empty, it expands to the empty string,
+ otherwise it expands to the \meta{prefix} of the 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|.
\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 770f0c89dc3..a8ddbd9194a 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
@@ -11,42 +11,40 @@
\section{Repeating Things: The Foreach Statement}
\label{section-foreach}
-This section describes the package |pgffor|, which is loaded
-automatically by \tikzname, but not by \pgfname:
+This section describes the package |pgffor|, which is loaded automatically by
+\tikzname, but not by \pgfname:
\begin{package}{pgffor}
- This package can be used independently of \pgfname, but works
- particularly well together with \pgfname\ and \tikzname. It defines
- two new commands: |\foreach| and |\breakforeach|.
+ This package can be used independently of \pgfname, but works particularly
+ well together with \pgfname\ and \tikzname. It defines two new commands:
+ |\foreach| and |\breakforeach|.
\end{package}
-\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.
-
- In the easiest case, \meta{variables} is a single \TeX-command like
- |\x| or |\point|. (If you want to have some fun, you can also use
- active characters. If you do not know what active characters are,
- you are blessed.)
-
- 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.
-
- Finally, in the easiest case, \meta{commands} is some \TeX-text in
- curly braces.
-
- With all these assumptions, the |\foreach| statement will execute
- the \meta{commands} repeatedly, once for every element of the
- \meta{list}. Each time the \meta{commands} are executed, the
- \meta{variable} will be set to the current value of the list
- item.
+\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.
+ In the easiest case, \meta{variables} is a single \TeX-command like |\x| or
+ |\point|. (If you want to have some fun, you can also use active
+ characters. If you do not know what active characters are, you are
+ blessed.)
+
+ 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.
+
+ Finally, in the easiest case, \meta{commands} is some \TeX-text in curly
+ braces.
+
+ With all these assumptions, the |\foreach| statement will execute the
+ \meta{commands} repeatedly, once for every element of the \meta{list}. Each
+ time the \meta{commands} are executed, the \meta{variable} will be set to
+ the current value of the list item.
+ %
\begin{codeexample}[]
\foreach \x in {1,2,3,0} {[\x]}
\end{codeexample}
@@ -56,36 +54,34 @@ automatically by \tikzname, but not by \pgfname:
\foreach \x in \mylist {[\x]}
\end{codeexample}
- Note that in each execution of \meta{commands} the
- \meta{commands} are put in a \TeX\ group. This means that
- \emph{local changes to counters inside \meta{commands} do not
- persist till the next iteration}. For instance, if you add 1 to a
- counter inside \meta{commands} locally, then in the next iteration
- the counter will have the same value it had at the beginning of the
- first iteration. You have to add |\global| if you wish changes to
- persist from iteration to iteration.
-
- \medskip
- \textbf{Syntax for the commands.}
- Let us move on to a more complicated setting. The first
- complication occurs when the \meta{commands} are not some text in
- curly braces. If the |\foreach| statement does not encounter an
- opening brace, it will instead scan everything up to the next
- semicolon and use this as \meta{commands}. This is most useful in
- situations like the following:
-
+ Note that in each execution of \meta{commands} the \meta{commands} are put
+ in a \TeX\ group. This means that \emph{local changes to counters inside
+ \meta{commands} do not persist till the next iteration}. For instance, if
+ you add 1 to a counter inside \meta{commands} locally, then in the next
+ iteration the counter will have the same value it had at the beginning of
+ the first iteration. You have to add |\global| if you wish changes to
+ persist from iteration to iteration.
+
+
+ \medskip
+ \textbf{Syntax for the commands.}
+ Let us move on to a more complicated setting. The first complication occurs
+ when the \meta{commands} are not some text in curly braces. If the
+ |\foreach| statement does not encounter an opening brace, it will instead
+ scan everything up to the next semicolon and use this as \meta{commands}.
+ This is most useful in situations like the following:
+ %
\begin{codeexample}[]
\tikz
\foreach \x in {0,1,2,3}
\draw (\x,0) circle (0.2cm);
\end{codeexample}
- However, the ``reading till the next semicolon'' is not the whole
- truth. There is another rule: If a |\foreach| statement is directly
- followed by another |\foreach| statement, this second foreach
- statement is collected as \meta{commands}. This allows you to write
- the following:
-
+ However, the ``reading till the next semicolon'' is not the whole truth.
+ There is another rule: If a |\foreach| statement is directly followed by
+ another |\foreach| statement, this second foreach statement is collected as
+ \meta{commands}. This allows you to write the following:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\foreach \x in {0,1,2,3}
@@ -97,99 +93,96 @@ automatically by \tikzname, but not by \pgfname:
\end{tikzpicture}
\end{codeexample}
- \medskip
- \textbf{The dots notation.}
- The second complication concerns the \meta{list}. If this
- \meta{list} contains the list item ``|...|'', this list item is replaced
- by the ``missing values.'' More precisely, the following happens:
-
- Normally, when a list item |...| is encountered, there should
- already have been \emph{two} list items before it, which where
- numbers. Examples of \emph{numbers} are |1|, |-10|, or
- |-0.24|. Let us call these numbers $x$ and $y$ and let $d := y-x$ be
- their difference. Next, there should also be one number following
- the three dots, let us call this number~$z$.
-
- In this situation, the part of the list reading
- ``$x$|,|$y$|,...,|$z$'' is replaced by ``$x$, $x+d$, $x+2d$, $x+3d$,
- \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.
-
- Perhaps it is best to explain this by some examples: The following
- \meta{list} have the same effects:
-
- |\foreach \x in {1,2,...,6} {\x, }| yields \foreach \x in {1,2,...,6} {\x, }
-
- |\foreach \x in {1,2,3,...,6} {\x, }| yields \foreach \x in {1,2,3,...,6} {\x, }
-
- |\foreach \x in {1,3,...,11} {\x, }| yields \foreach \x in {1,3,...,11} {\x, }
-
- |\foreach \x in {1,3,...,10} {\x, }| yields \foreach \x in {1,3,...,10} {\x, }
-
- |\foreach \x in {0,0.1,...,0.5} {\x, }| yields \foreach \x in {0,0.1,...,0.5} {\x, }
-
- |\foreach \x in {a,b,9,8,...,1,2,2.125,...,2.5} {\x, }| yields \foreach \x in {a,b,9,8,...,1,2,2.125,...,2.5} {\x, }
-
- As can be seen, for fractional steps that are not multiples of
- $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 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
- larger than $x$ and is set to $-1$ if $z$ is smaller:
-
- |\foreach \x in {1,...,6} {\x, }| yields \foreach \x in {1,...,6} {\x, }
-
- |\foreach \x in {9,...,3.5} {\x, }| yields \foreach \x in {9,...,3.5} {\x, }
-
-
- There is a yet another 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
- |(0,1)| do. In this case, you should put the items containing commas
- in braces as in |{(0,1)}|. However, since pairs are such a natural
- and useful case, they get a special treatment by the |\foreach|
- statement. When a list item starts with a |(| everything up to the
- next |)| is made part of the item. Thus, we can write things like
- the following:
+ \medskip
+ \textbf{The dots notation.}
+ The second complication concerns the \meta{list}. If this \meta{list}
+ contains the list item ``|...|'', this list item is replaced by the
+ ``missing values''. More precisely, the following happens:
+
+ Normally, when a list item |...| is encountered, there should already have
+ been \emph{two} list items before it, which where numbers. Examples of
+ \emph{numbers} are |1|, |-10|, or |-0.24|. Let us call these numbers $x$
+ and $y$ and let $d := y-x$ be their difference. Next, there should also be
+ one number following the three dots, let us call this number~$z$.
+
+ In this situation, the part of the list reading ``$x$|,|$y$|,...,|$z$'' is
+ replaced by ``$x$, $x+d$, $x+2d$, $x+3d$, \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.
+
+ Perhaps it is best to explain this by some examples: The following
+ \meta{list} have the same effects:
+
+ |\foreach \x in {1,2,...,6} {\x, }| yields \foreach \x in {1,2,...,6} {\x, }
+
+ |\foreach \x in {1,2,3,...,6} {\x, }| yields \foreach \x in {1,2,3,...,6} {\x, }
+
+ |\foreach \x in {1,3,...,11} {\x, }| yields \foreach \x in {1,3,...,11} {\x, }
+
+ |\foreach \x in {1,3,...,10} {\x, }| yields \foreach \x in {1,3,...,10} {\x, }
+
+ |\foreach \x in {0,0.1,...,0.5} {\x, }| yields \foreach \x in {0,0.1,...,0.5} {\x, }
+
+ |\foreach \x in {a,b,9,8,...,1,2,2.125,...,2.5} {\x, }| yields \foreach \x in {a,b,9,8,...,1,2,2.125,...,2.5} {\x, }
+
+ As can be seen, for fractional steps that are not multiples of $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 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 larger than $x$ and is set to $-1$ if
+ $z$ is smaller:
+
+ |\foreach \x in {1,...,6} {\x, }| yields \foreach \x in {1,...,6} {\x, }
+
+ |\foreach \x in {9,...,3.5} {\x, }| yields \foreach \x in {9,...,3.5} {\x, }
+
+ There is a yet another 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 |(0,1)|
+ do. In this case, you should put the items containing commas in braces as
+ in |{(0,1)}|. However, since pairs are such a natural and useful case, they
+ get a special treatment by the |\foreach| statement. When a list item
+ starts with a |(| everything up to the next |)| is made part of the item.
+ Thus, we can write things like the following:
+ %
\begin{codeexample}[]
\tikz
\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 |foreach| and |\foreach| (both have the
- same effect) inside a path construction. In such a case, the
- \meta{commands} must be path construction commands. Here are two
- examples:
+ \medskip
+ \textbf{Using the foreach-statement inside paths.}
+ \tikzname\ allows you to use |foreach| and |\foreach| (both have the same
+ effect) inside a path construction. In such a case, the \meta{commands}
+ must be path construction commands. Here are two examples:
+ %
\begin{codeexample}[]
\tikz
\draw (0,0)
@@ -202,35 +195,35 @@ automatically by \tikzname, but not by \pgfname:
\tikz \draw foreach \p in {1,...,3} {(\p,1)--(\p,3) (1,\p)--(3,\p)};
\end{codeexample}
- Note that the |node| and |pic| path commands also support the
- |foreach| statement in special ways.
-
- \medskip
- \textbf{Multiple variables.}
- You will often wish to iterate over two variables at the same
- time. Since you can nest |\foreach| loops, this is normally
- straight-forward. However, you sometimes wish variables to
- iterate ``simultaneously.'' For example, we might be given a list of
- edges that connect two coordinates and might wish to iterate over
- these edges. While doing so, we would like the source and target of
- the edges to be set to two different variables.
-
- To achieve this, you can use the following syntax: The
- \meta{variables} may not only be a single \TeX-variable. Instead, it
- can also be a list of variables separated by slashes (|/|). In this
- case the list items can also be lists of values separated by
- slashes.
-
- Assuming that the \meta{variables} and the list items are lists of
- values, each time the \meta{commands} are executed, each of the
- variables in \meta{variables} is set to one part of the list making
- up the current list item. Here is an example to clarify this:
-
- \example |\foreach \x / \y in {1/2,a/b} {``\x\ and \y''}| yields
- \foreach \x / \y in {1/2,a/b} {``\x\ and \y''}.
-
- If some entry in the \meta{list} does not have ``enough'' slashes,
- the last entry will be repeated. Here is an example:
+ Note that the |node| and |pic| path commands also support the |foreach|
+ statement in special ways.
+
+
+ \medskip
+ \textbf{Multiple variables.}
+ You will often wish to iterate over two variables at the same time. Since
+ you can nest |\foreach| loops, this is normally straight-forward. However,
+ you sometimes wish variables to iterate ``simultaneously''. For example, we
+ might be given a list of edges that connect two coordinates and might wish
+ to iterate over these edges. While doing so, we would like the source and
+ target of the edges to be set to two different variables.
+
+ To achieve this, you can use the following syntax: The \meta{variables} may
+ not only be a single \TeX-variable. Instead, it can also be a list of
+ variables separated by slashes (|/|). In this case the list items can also
+ be lists of values separated by slashes.
+
+ Assuming that the \meta{variables} and the list items are lists of values,
+ each time the \meta{commands} are executed, each of the variables in
+ \meta{variables} is set to one part of the list making up the current list
+ item. Here is an example to clarify this:
+
+ \example |\foreach \x / \y in {1/2,a/b} {``\x\ and \y''}| yields
+ \foreach \x / \y in {1/2,a/b} {``\x\ and \y''}.
+
+ If some entry in the \meta{list} does not have ``enough'' slashes, the last
+ entry will be repeated. Here is an example:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\foreach \x/\xtext in {0,...,3,2.72 / e}
@@ -238,7 +231,8 @@ automatically by \tikzname, but not by \pgfname:
\end{tikzpicture}
\end{codeexample}
- Here are more useful examples:
+ Here are more useful examples:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
% Define some coordinates:
@@ -293,30 +287,30 @@ automatically by \tikzname, but not by \pgfname:
\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 be 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}.
+ \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 be 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}
@@ -325,38 +319,37 @@ automatically by \tikzname, but not by \pgfname:
\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}.
-
+ 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}.
-
+ %
+ \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}.
-
+ %
+ \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}
@@ -364,18 +357,16 @@ automatically by \tikzname, but not by \pgfname:
\node [draw, top color=white, bottom color=blue!50, minimum size=0.666cm]
at (\xi,-\yi) {$\mathstrut\x\y$};
\end{codeexample}
-\end{key}
-
+ %
+ \end{key}
\end{command}
-
\begin{command}{\breakforeach}
- If this command is given inside a |\foreach| command, no further
- 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.
-
+ If this command is given inside a |\foreach| command, no further 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\foreach \x in {1,...,4}
@@ -389,5 +380,5 @@ automatically by \tikzname, but not by \pgfname:
}
\end{tikzpicture}
\end{codeexample}
-
+ %
\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 423fac92e88..392e2298142 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
@@ -11,423 +11,431 @@
\section{Key Management}
\label{section-keys}
-This section describes the package |pgfkeys|. It is loaded
-automatically by both \pgfname\ and \tikzname.
+This section describes the package |pgfkeys|. It is loaded automatically by
+both \pgfname\ and \tikzname.
\begin{package}{pgfkeys}
- 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. % pgfkey --> pgfkeys?
+ 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| \todosp{pgfkey --> pgfkeys?} if |pgfmod| is not loaded.
\end{package}
-
\subsection{Introduction}
\subsubsection{Comparison to Other Packages}
-The |pgfkeys| package defines a key--value management system that is in
-some sense similar to the more light-weight |keyval| system and the
-improved |xkeyval| system. However, |pgfkeys| uses a slightly
-different philosophy than these systems and it will coexist peacefully
-with both of them.
-
-The main differences between |pgfkeys| and |xkeyval| are the
-following:
+The |pgfkeys| package defines a key--value management system that is in some
+sense similar to the more light-weight |keyval| system and the improved
+|xkeyval| system. However, |pgfkeys| uses a slightly different philosophy than
+these systems and it will coexist peacefully with both of them.
+The main differences between |pgfkeys| and |xkeyval| are the following:
+%
\begin{itemize}
-\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 |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.
-\item |pgfkeys| supports styles. This means that keys can just stand
- for other keys (which can stand for other keys in turn or which can
- also just execute some code). \tikzname\ uses this mechanism heavily.
-\item |pgfkeys| supports multi-argument key code. This can, however,
- be emulated in |keyval|.
-\item |pgfkeys| supports handlers. These are call-backs that are
- called when a key is not known. They are very flexible, in fact even
- defining keys in different ways is handled by, well, handlers.
+ \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 |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.
+ \item |pgfkeys| supports styles. This means that keys can just stand for
+ other keys (which can stand for other keys in turn or which can also
+ just execute some code). \tikzname\ uses this mechanism heavily.
+ \item |pgfkeys| supports multi-argument key code. This can, however, be
+ emulated in |keyval|.
+ \item |pgfkeys| supports handlers. These are call-backs that are called
+ when a key is not known. They are very flexible, in fact even
+ defining keys in different ways is handled by, well, handlers.
\end{itemize}
\subsubsection{Quick Guide to Using the Key Mechanism}
-The following quick guide to \pgfname's key mechanism only treats the
-most commonly used features. For an in-depth discussion of what is
-going on, please consult the remainder of this section.
+The following quick guide to \pgfname's key mechanism only treats the most
+commonly used features. For an in-depth discussion of what is going on, please
+consult the remainder of this section.
-Keys are organized in a large tree that is reminiscent of the Unix
-file tree. A typical key might be, say, |/tikz/coordinate system/x|
-or just |/x|. Again as in Unix, when you specify keys you can provide
-the complete path of the key, but you usually just provide the name of
-the key (corresponding to the file name without any path) and the path
-is added automatically.
+Keys are organized in a large tree that is reminiscent of the Unix file tree. A
+typical key might be, say, |/tikz/coordinate system/x| or just |/x|. Again as
+in Unix, when you specify keys you can provide the complete path of the key,
+but you usually just provide the name of the key (corresponding to the file
+name without any path) and the path is added automatically.
-Typically (but not necessarily) some code is associated with a key. To
-execute this code, you use the |\pgfkeys| command. This command takes
-a list of so-called key--value pairs. Each pair is of the form
-\meta{key}|=|\meta{value}. For each pair the |\pgfkeys| command will
-execute the code stored for the \meta{key} with its parameter set to
-\meta{value}.
+Typically (but not necessarily) some code is associated with a key. To execute
+this code, you use the |\pgfkeys| command. This command takes a list of
+so-called key--value pairs. Each pair is of the form \meta{key}|=|\meta{value}.
+For each pair the |\pgfkeys| command will execute the code stored for the
+\meta{key} with its parameter set to \meta{value}.
Here is a typical example of how the |\pgfkeys| command is used:
+%
\begin{codeexample}[code only]
\pgfkeys{/my key=hallo,/your keys/main key=something\strange,
key name without path=something else}
\end{codeexample}
-Now, to set the code that is stored in a key you do not need to learn
-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:
+Now, to set the code that is stored in a key you do not need to learn 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:
+%
\begin{codeexample}[]
\pgfkeys{/my key/.code=The value is '#1'.}
\pgfkeys{/my key=hi!}
\end{codeexample}
-As you can see, in the first line we defined the code for the key
-|/my key|. In the second line we executed this code with the parameter
-set to |hi!|.
+%
+As you can see, in the first line we defined the code for the key |/my key|. In
+the second line we executed this code with the parameter 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.
+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.
+%
\begin{codeexample}[]
\pgfkeys{/my key/.code 2 args=The values are '#1' and '#2'.}
\pgfkeys{/my key={a1}{a2}}
\end{codeexample}
-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|.
+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|.
+%
\begin{codeexample}[]
\pgfkeys{/my key/.code=(#1)}
\pgfkeys{/my key/.default=hello}
\pgfkeys{/my key=hallo,/my key}
\end{codeexample}
-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|.
-
-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
-used on a key, all subsequent keys {\itshape in the current call of
- |\pgfkeys| only} are automatically prefixed with this path, if
-necessary.
+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|.
+
+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
+used on a key, all subsequent keys {\itshape in the current call of |\pgfkeys|
+only} are automatically prefixed with this path, if necessary.
Here is an example:
+%
\begin{codeexample}[code only]
\pgfkeys{/tikz/.cd,line width=1cm,line cap=round}
\end{codeexample}
-This makes it easy to define commands like |\tikzset|, which could be
-defined as follows (the actual definition is a bit faster, but the
-effect is the same):
+%
+This makes it easy to define commands like |\tikzset|, which could be defined
+as follows (the actual definition is a bit faster, but the effect is the same):
+%
\begin{codeexample}[code only]
\def\tikzset#1{\pgfkeys{/tikz/.cd,#1}}
\end{codeexample}
-When a key is handled, instead of executing some code, the key can
-also cause further keys to be executed. Such keys will be called
-\emph{styles}. A style is, in essence, just a key list that should be
-executed whenever the style is executed. Here is an example:
+When a key is handled, instead of executing some code, the key can also cause
+further keys to be executed. Such keys will be called \emph{styles}. A style
+is, in essence, just a key list that should be executed whenever the style is
+executed. Here is an example:
+%
\begin{codeexample}[]
\pgfkeys{/a/.code=(a:#1)}
\pgfkeys{/b/.code=(b:#1)}
\pgfkeys{/my style/.style={/a=foo,/b=bar,/a=#1}}
\pgfkeys{/my style=wow}
\end{codeexample}
-As the above example shows, styles can also be paramaterized, just like
-the normal code keys.
+%
+As the above example shows, styles can also be parameterized, just like the
+normal code keys.
-As a typical use of styles, suppose we wish to set up the key |/tikz|
-so that it will change the default path to |/tikz|. This can be
-achieved as follows:
+As a typical use of styles, suppose we wish to set up the key |/tikz| so that
+it will change the default path to |/tikz|. This can be achieved as follows:
+%
\begin{codeexample}[code only]
\pgfkeys{/tikz/.style=/tikz/.cd}
\pgfkeys{tikz,line width=1cm,draw=red}
\end{codeexample}
-Note that when |\pgfkeys| is executed, the default path is set
-to~|/|. This means that the first |tikz| will be completed to
-|/tikz|. Then |/tikz| is a style and, thus, replaced by |/tikz/.cd|,
-which changes the default path to |/tikz|. Thus, the |line width| is
-correctly prefixed with |/tikz|.
+Note that when |\pgfkeys| is executed, the default path is set to~|/|. This
+means that the first |tikz| will be completed to |/tikz|. Then |/tikz| is a
+style and, thus, replaced by |/tikz/.cd|, which changes the default path to
+|/tikz|. Thus, the |line width| is correctly prefixed with |/tikz|.
+
\subsection{The Key Tree}
-The |pgfkeys| package organizes keys in a so-called \emph{key
- tree}. This tree will be familiar to anyone who has used a Unix
-operating system: A key is addressed by a path, which consists of
-different parts separated by slashes. A typical key might be
-|/tikz/line width| or just |/tikz| or something more complicated like
-|/tikz/cs/x/.store in|.
-
-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).
-
-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
-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
-is a full key and it is not modified; if it does not start with
-a slash, then the default path is automatically prefixed.
-
-Note that the default path is not the same as a search path. In
-particular, the default path is just a single path. When a partial key
-is given, only this single default path is prefixed; |pgfkeys| does
-not try to look up the key in different parts of a search path. It is,
-however, possible to emulate search paths, but a much more
-complicated mechanism must be used.
-
-When you set keys (to be explained in a moment), you can freely mix
-partial and full keys and you can change the default path. This makes
-it possible to temporarily use keys from another part of the key tree
-(this turns out to be a very useful feature).
-
-Each key (may) store some \emph{tokens} and there exist commands,
-described below, for setting, getting, and changing the tokens stored
-in a key. However, you will only very seldom use these commands
-directly. Rather, the standard way of using keys is the |\pgfkeys|
-command or some command that uses it internally like, say,
-|\tikzset|. So, you may wish to skip the following commands and
+The |pgfkeys| package organizes keys in a so-called \emph{key tree}. This tree
+will be familiar to anyone who has used a Unix operating system: A key is
+addressed by a path, which consists of different parts separated by slashes. A
+typical key might be |/tikz/line width| or just |/tikz| or something more
+complicated like |/tikz/cs/x/.store in|.
+
+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).
+
+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 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 is a full key and
+it is not modified; if it does not start with a slash, then the default path is
+automatically prefixed.
+
+Note that the default path is not the same as a search path. In particular, the
+default path is just a single path. When a partial key is given, only this
+single default path is prefixed; |pgfkeys| does not try to look up the key in
+different parts of a search path. It is, however, possible to emulate search
+paths, but a much more complicated mechanism must be used.
+
+When you set keys (to be explained in a moment), you can freely mix partial and
+full keys and you can change the default path. This makes it possible to
+temporarily use keys from another part of the key tree (this turns out to be a
+very useful feature).
+
+Each key (may) store some \emph{tokens} and there exist commands, described
+below, for setting, getting, and changing the tokens stored in a key. However,
+you will only very seldom use these commands directly. Rather, the standard way
+of using keys is the |\pgfkeys| command or some command that uses it internally
+like, say, |\tikzset|. So, you may wish to skip the following commands and
continue with the next subsection.
\begin{command}{\pgfkeyssetvalue\marg{full key}\marg{token text}}
- Stores the \meta{token text} in the \meta{full key}. The \meta{full key}
- may not be a partial key, so no default-path-adding is done. The
- \meta{token text} can be arbitrary tokens and may even contain things
- like |#| or unbalanced \TeX-ifs.
+ Stores the \meta{token text} in the \meta{full key}. The \meta{full key}
+ may not be a partial key, so no default-path-adding is done. The
+ \meta{token text} can be arbitrary tokens and may even contain things like
+ |#| or unbalanced \TeX-ifs.
+ %
\begin{codeexample}[]
\pgfkeyssetvalue{/my family/my key}{Hello, world!}
\pgfkeysvalueof{/my family/my key}
\end{codeexample}
- The setting of a key is always local to the current \TeX\ group.
+ The setting of a key is always local to the current \TeX\ group.
\end{command}
\begin{command}{\pgfkeyslet\marg{full key}\marg{macro}}
- Performs a |\let| statement so the \meta{full key} points to the
- contents of \meta{macro}.
+ Performs a |\let| statement so the \meta{full key} points to the contents
+ of \meta{macro}.
+ %
\begin{codeexample}[]
\def\helloworld{Hello, world!}
\pgfkeyslet{/my family/my key}{\helloworld}
\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.
+ %
+ You should never let a key be equal to |\relax|. Such a key may or may not
+ be indistinguishable from an undefined key.
\end{command}
\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|.
+ 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|.
+ %
\begin{codeexample}[]
\pgfkeyssetvalue{/my family/my key}{Hello, world!}
\pgfkeysgetvalue{/my family/my key}{\helloworld}
\helloworld
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfkeysvalueof\marg{full key}}
- Inserts the value stored in \meta{full key} at the current position
- into the text.
-
+ Inserts the value stored in \meta{full key} at the current position into
+ the text.
+ %
\begin{codeexample}[]
\pgfkeyssetvalue{/my family/my key}{Hello, world!}
\pgfkeysvalueof{/my family/my key}
\end{codeexample}
+ %
\end{command}
-
\begin{command}{\pgfkeysifdefined\marg{full key}\marg{if}\marg{else}}
- Checks whether this key was previously set using either
- |\pgfkeyssetvalue| or |\pgfkeyslet|. If so, the code in \meta{if} is
- executed, otherwise the code in \meta{else}.
-
- 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.
+ Checks whether this key was previously set using either |\pgfkeyssetvalue|
+ or |\pgfkeyslet|. If so, the code in \meta{if} is executed, otherwise the
+ code in \meta{else}.
+
+ 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.
+ %
\begin{codeexample}[]
\pgfkeyssetvalue{/my family/my key}{Hello, world!}
\pgfkeysifdefined{/my family/my key}{yes}{no}
\end{codeexample}
+ %
\end{command}
\subsection{Setting Keys}
-Settings keys is done using a powerful command called |\pgfkeys|. This
-command takes a list of so-called \emph{key--value pairs}. These are
-pairs of the form \meta{key}|=|\meta{value}. The principle idea is the
-following: For each pair in the list, some \emph{action} is
-taken. This action can be one of the following:
-
+Settings keys is done using a powerful command called |\pgfkeys|. This command
+takes a list of so-called \emph{key--value pairs}. These are pairs of the form
+\meta{key}|=|\meta{value}. The principle idea is the following: For each pair
+in the list, some \emph{action} is taken. This action can be one of the
+following:
+%
\begin{enumerate}
-\item A command is executed whose argument(s) are \meta{value}. This
- command is stored in a special subkey of \meta{key}.
-\item The \meta{value} is stored in the \meta{key} itself.
-\item If the key's name (the part after the last slash) 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.
+ \item A command is executed whose argument(s) are \meta{value}. This
+ command is stored in a special subkey of \meta{key}.
+ \item The \meta{value} is stored in the \meta{key} itself.
+ \item If the key's name (the part after the last slash) 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.
\end{enumerate}
-Additionally, if the \meta{value} is missing, a default value may or
-may not be substituted. Before we plunge into all the details,
-let us have a quick look at the command itself.
+Additionally, if the \meta{value} is missing, a default value may or may not be
+substituted. Before we plunge into all the details, let us have a quick look at
+the command itself.
\begin{command}{\pgfkeys\marg{key list}}
- The \meta{key list} should be a list of key--value pairs, separated
- by commas. A key--value pair can have the following two forms:
- \meta{key}|=|\meta{value} or just \meta{key}. Any spaces around the
- \meta{key} or around the \meta{value} are removed. It is permissible
- to surround both the \meta{key} or the \meta{value} in curly braces,
- which are also removed. Especially putting the \meta{value} in curly
- braces needs to be done quite often, namely whenever the \meta{value}
- contains an equal-sign or a comma.
-
- The key--value pairs in the list are handled in the order they
- appear. How this handling is done, exactly, is described in the rest
- of this section.
-
- If a \meta{key} is a partial key, the current value of the default
- path is prefixed to the \meta{key} and this ``upgraded'' key is
- 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.
-
- 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
- path will not change when you call |\pgfkeys| while executing code
- for a key (which is exactly what you want).
+ The \meta{key list} should be a list of key--value pairs, separated by
+ commas. A key--value pair can have the following two forms:
+ \meta{key}|=|\meta{value} or just \meta{key}. Any spaces around the
+ \meta{key} or around the \meta{value} are removed. It is permissible to
+ surround both the \meta{key} or the \meta{value} in curly braces, which are
+ also removed. Especially putting the \meta{value} in curly braces needs to
+ be done quite often, namely whenever the \meta{value} contains an
+ equal-sign or a comma.
+
+ The key--value pairs in the list are handled in the order they appear. How
+ this handling is done, exactly, is described in the rest of this section.
+
+ If a \meta{key} is a partial key, the current value of the default path is
+ prefixed to the \meta{key} and this ``upgraded'' key is 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.
+
+ 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 path will not
+ change when you call |\pgfkeys| while executing code for a key (which is
+ exactly what you want).
\end{command}
\begin{command}{\pgfqkeys\marg{default path}\marg{key list}}
- 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.
+ 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.
\end{command}
\begin{command}{\pgfkeysalso\marg{key list}}
- This command has exactly the same effect as |\pgfkeys|, only the
- default path is not modified before or after the keys are being
- set. This command is mainly intended to be called by the code that
- is being processed for a key.
+ This command has exactly the same effect as |\pgfkeys|, only the default
+ path is not modified before or after the keys are being set. This command
+ is mainly intended to be called by the code that is being processed for a
+ key.
\end{command}
\begin{command}{\pgfqkeysalso\marg{default path}\marg{key list}}
- This command has the same effect as |\pgfkeysalso{|\meta{default
- path}|/.cd,|\meta{key list}|}|, it is only quicker. Changing the
- default path inside a |\pgfkeyalso| is dangerous, so use with
- care. A rather safe place to call this command is at the beginning
- of a \TeX\ group.
+ This command has the same effect as |\pgfkeysalso{|\meta{default
+ path}|/.cd,|\meta{key list}|}|, it is only quicker. Changing the default
+ path inside a |\pgfkeyalso| is dangerous, so use with care. A rather safe
+ place to call this command is at the beginning of a \TeX\ group.
\end{command}
\subsubsection{First Char Syntax Detection}
\label{sec:pgf:first:char:syntax}
-Usually, keys are of the form \meta{key}|=|\meta{value} and how such
-keys are handled is discussed in the rest of this section. However, it
-is also possible to setup a different syntax for certain parts of the
-input to |\pgfkeys|. Since this is a rather advanced option, most
-readers may wish to skip the following discussion upon first reading;
-it is discussed here because this special syntax detection is the very
-first thing that is done when a key is processed, before any of the
-following operations are performed.
-
-The |\pgfkeys| command and its variants decompose their input into a
-list of \meta{string}s that are separated by commas. By default, each
-such \meta{string} must either have the form \meta{key}|=|\meta{value}
-or of the form \meta{key} with the value-part missing. However, you
-might wish to interpret some of these strings differently. For
-instance, when a \meta{string} has the form |"|\meta{text}|"|, you
-might wish the \meta{string} to be interpreted as if one had written
-|label text={|\meta{text}|}|. Then, people could write
+Usually, keys are of the form \meta{key}|=|\meta{value} and how such keys are
+handled is discussed in the rest of this section. However, it is also possible
+to setup a different syntax for certain parts of the input to |\pgfkeys|. Since
+this is a rather advanced option, most readers may wish to skip the following
+discussion upon first reading; it is discussed here because this special syntax
+detection is the very first thing that is done when a key is processed, before
+any of the following operations are performed.
+
+The |\pgfkeys| command and its variants decompose their input into a list of
+\meta{string}s that are separated by commas. By default, each such
+\meta{string} must either have the form \meta{key}|=|\meta{value} or of the
+form \meta{key} with the value-part missing. However, you might wish to
+interpret some of these strings differently. For instance, when a \meta{string}
+has the form |"|\meta{text}|"|, you might wish the \meta{string} to be
+interpreted as if one had written |label text={|\meta{text}|}|. Then, people
+could write
+%
\begin{codeexample}[code only]
\myset{red, "main valve", thick}
\end{codeexample}
+%
instead of the more cumbersome
+%
\begin{codeexample}[code only]
\myset{red, label text=main valve, thick}
\end{codeexample}
-An example where such a syntax reinterpretation is done is the
-|quotes| library, which allows you to write things like
+%
+An example where such a syntax reinterpretation is done is the |quotes|
+library, which allows you to write things like
+%
\begin{codeexample}[]
\tikz \graph { a ->["1" red] b ->["0"] c };
\end{codeexample}
+%
\noindent instead of the somewhat longer
+%
\begin{codeexample}[]
\tikz \graph { a ->[edge node={node[red,auto]{1}}] b ->[edge label=0] c };
\end{codeexample}
-In order to detect whether a \meta{string} has a special syntax, you
-can request that the \emph{first character} of \meta{string} is
-analysed by the key parser. If this first character matches a
-character that has been flagged as a special character, the
-\meta{string} is not interpreted as a usual key--value pair. Instead,
-\meta{string} is passed as a parameter to a special macro that should
-take care of the \meta{string}. After this macro has finished, the
+In order to detect whether a \meta{string} has a special syntax, you can
+request that the \emph{first character} of \meta{string} is analysed by the key
+parser. If this first character matches a character that has been flagged as a
+special character, the \meta{string} is not interpreted as a usual key--value
+pair. Instead, \meta{string} is passed as a parameter to a special macro that
+should take care of the \meta{string}. After this macro has finished, the
parsing continues with the \meta{next string} in the list.
-In order to setup a special syntax handling for \meta{strings} that
-begin with a certain character, two things need to be done:
+In order to setup a special syntax handling for \meta{strings} that begin with
+a certain character, two things need to be done:
+%
\begin{enumerate}
-\item First, the whole first char syntax detection must be ``switched
- on,'' since, by default, it is turned off for efficiency reasons
- (the overhead is rather small, however). This is done by setting the
- following key:
- \begin{key}{/handlers/first char syntax=\opt{\meta{true or false}}
- (default true, initially false)}
- \end{key}
-\item Second, in order to handle strings starting with a certain
- \meta{character} in a special way, you need to store a macro in the
- following key:
- \begin{key}{/handlers/first char syntax/\meta{meaning of character}}
- The \meta{meaning of character} should be the text that \TeX's
- command |\meaning| returns for a macro that has been |\let| to the
- \meta{character}. For instance, when strings starting with |"|
- should be treated in a special way, the \meta{meaning of
- character} would be the string |the character "| since this is
- what \TeX\ writes when you say
+ \item First, the whole first char syntax detection must be ``switched on'',
+ since, by default, it is turned off for efficiency reasons (the
+ overhead is rather small, however). This is done by setting the
+ following key:
+ %
+ \begin{key}{/handlers/first char syntax=\opt{\meta{true or false}} (default true, initially false)}
+ \end{key}
+ \item Second, in order to handle strings starting with a certain
+ \meta{character} in a special way, you need to store a macro in the
+ following key:
+ %
+ \begin{key}{/handlers/first char syntax/\meta{meaning of character}}
+ The \meta{meaning of character} should be the text that \TeX's
+ command |\meaning| returns for a macro that has been |\let| to the
+ \meta{character}. For instance, when strings starting with |"|
+ should be treated in a special way, the \meta{meaning of character}
+ would be the string |the character "| since this is what \TeX\
+ writes when you say
+ %
\begin{codeexample}[]
\let\mycharacter="
-\meaning\mycharacter
+\meaning\mycharacter
\end{codeexample}
- Now, the key |/handlers/first char syntax/|\meta{meaning of
- character} should be setup (using |\pgfkeyssetvalue| or using
- the |.initial| handler) to store a \meta{macro name}.
-
- If this is the case and if \meta{string} starts with the
- \meta{character} (blanks at the beginning of \meta{string} are
- deleted prior to this test), then \meta{macro name} is called with
- \meta{string} as its argument.
+ %
+ Now, the key |/handlers/first char syntax/|\meta{meaning of
+ character} should be setup (using |\pgfkeyssetvalue| or using the
+ |.initial| handler) to store a \meta{macro name}.
+
+ If this is the case and if \meta{string} starts with the
+ \meta{character} (blanks at the beginning of \meta{string} are
+ deleted prior to this test), then \meta{macro name} is called with
+ \meta{string} as its argument.
\end{key}
\end{enumerate}
-Let us now have a look at an example. We install two handlers, one for
-strings starting with |"| and one for strings starting with |<|.
-
+Let us now have a look at an example. We install two handlers, one for strings
+starting with |"| and one for strings starting with |<|.
+%
\begin{codeexample}[]
\pgfkeys{
/handlers/first char syntax=true,
@@ -441,11 +449,11 @@ strings starting with |"| and one for strings starting with |<|.
\ttfamily \pgfkeys{"foo", <bar>}
\end{codeexample}
-Naturally, in the above examples, the two handling macros did not do
-something particularly exciting. In the next example, we setup a more
-elaborate macro that mimics a small part the behaviour of the |quotes|
-library, only for single quotes:
-
+Naturally, in the above examples, the two handling macros did not do something
+particularly exciting. In the next example, we setup a more elaborate macro
+that mimics a small part the behaviour of the |quotes| library, only for single
+quotes:
+%
\begin{codeexample}[]
\pgfkeys{
/handlers/first char syntax=true,
@@ -457,16 +465,16 @@ library, only for single quotes:
\tikz \node [circle, 'foo', draw] {bar};
\end{codeexample}
-Note that in the above example, the macro |\mysinglequotemacro| gets
-passed the complete string, including the single quotes. It is the job
-of the macro to get rid of them, if this is necessary.
+Note that in the above example, the macro |\mysinglequotemacro| gets passed the
+complete string, including the single quotes. It is the job of the macro to get
+rid of them, if this is necessary.
The first char syntax detection allows you to perform rather powerful
-transformations on the syntax of keys -- provided you can ``pin down''
-the syntax on the first character. In the following example, you can
-write expressions in parentheses in front of a key--value pair and the
-pair will only be executed when the expression evaluates to true:
-
+transformations on the syntax of keys -- provided you can ``pin down'' the
+syntax on the first character. In the following example, you can write
+expressions in parentheses in front of a key--value pair and the pair will only
+be executed when the expression evaluates to true:
+%
\begin{codeexample}[]
\pgfkeys{
/handlers/first char syntax=true,
@@ -490,70 +498,65 @@ pair will only be executed when the expression evaluates to true:
\subsubsection{Default Arguments}
The arguments of the |\pgfkeys| command can either be of the form
-\meta{key}|=|\meta{value} or of the form \meta{key} with the
-value-part missing. In the second case, the |\pgfkeys| will try to
-provide a \emph{default value} for the \meta{value}. If such a default
-value is defined, it will be used as if you had written
-\meta{key}|=|\meta{default value}.
+\meta{key}|=|\meta{value} or of the form \meta{key} with the value-part
+missing. In the second case, the |\pgfkeys| will try to provide a \emph{default
+value} for the \meta{value}. If such a default 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
-Section~\ref{section-default-handlers} and you may wish to skip
-the following details.
+described; however, you should normally use the handlers |/.default| and
+|/.value required| as described in Section~\ref{section-default-handlers} and
+you may wish to skip the following details.
-When |\pgfkeys| encounters a \meta{key} without an equal-sign, the
-following happens:
+When |\pgfkeys| encounters a \meta{key} without an equal-sign, the following
+happens:
+%
\begin{enumerate}
-\item The input is replaced by \meta{key}|=\pgfkeysnovalue|. In
- particular, the commands |\pgfkeys{my key}| and
- % FIXME : there is a bug in the pretty printer ... fix it and get rid of '||' here:
- |\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.
-\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
- |/my key/.@def| exists.
-\item If the key \meta{key}|/.@def| exists, then the tokens stored in
- this key are used as \meta{value}.
-\item If the key does not exist, then |\pgfkeysnovalue| is used as the
- \meta{value}.
-\item At the end, if the \meta{value} is now equal to
- |\pgfkeysvaluerequired|, then the code (or something fairly equivalent)
- |\pgfkeys{/errors/value required=|\meta{key}|{}}|
- is executed. Thus, by changing this key you can change the error
- message that is printed or you can handle the missing value in some
- other way.
+ \item The input is replaced by \meta{key}|=\pgfkeysnovalue|. In particular,
+ the commands |\pgfkeys{my key}| and
+ % FIXME: there is a bug in the pretty printer ... fix it and get rid of '||' here:
+ |\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.
+ \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 |/my key/.@def|
+ exists.
+ \item If the key \meta{key}|/.@def| exists, then the tokens stored in this
+ key are used as \meta{value}.
+ \item If the key does not exist, then |\pgfkeysnovalue| is used as the
+ \meta{value}.
+ \item At the end, if the \meta{value} is now equal to
+ |\pgfkeysvaluerequired|, then the code (or something fairly equivalent)
+ |\pgfkeys{/errors/value required=|\meta{key}|{}}| is executed. Thus, by
+ changing this key you can change the error message that is printed or
+ you can handle the missing value in some other way.
\end{enumerate}
-
\subsubsection{Keys That Execute Commands}
\label{section-key-code}
-After the transformation process described in the previous subsection,
-we arrive at a key of the form \meta{key}=\meta{value}, where
-\meta{key} is a full key. Different things can now happen, but always
-the macro |\pgfkeyscurrentkey| will have been set up to expand to the
-text of the \meta{key} that is currently being processed.
-
-The first things that is tested is whether the key \meta{key}|/.@cmd|
-exists. If this is the case, then it is assumed that this key stores
-the code of a macro and this macro is executed. The argument of this
-macro is \meta{value} directly followed by |\pgfeov|, which stands for
-``end of value.'' The \meta{value} is not surrounded by braces. After
-this code has been executed, |\pgfkeys| continues with the next key in
-the \meta{key list}.
-
-It may seem quite peculiar that the macro stored in the key
-\meta{key}|/.@cmd| is not simply executed with the argument
-|{|\meta{value}|}|. However, the approach taken in the |pgfkeys|
-packages allows for more flexibility. For instance, assume that you
-have a key that expects a \meta{value} of the form
+After the transformation process described in the previous subsection, we
+arrive at a key of the form \meta{key}=\meta{value}, where \meta{key} is a full
+key. Different things can now happen, but always the macro |\pgfkeyscurrentkey|
+will have been set up to expand to the text of the \meta{key} that is currently
+being processed.
+
+The first things that is tested is whether the key \meta{key}|/.@cmd| exists.
+If this is the case, then it is assumed that this key stores the code of a
+macro and this macro is executed. The argument of this macro is \meta{value}
+directly followed by |\pgfeov|, which stands for ``end of value''. The
+\meta{value} is not surrounded by braces. After this code has been executed,
+|\pgfkeys| continues with the next key in the \meta{key list}.
+
+It may seem quite peculiar that the macro stored in the key \meta{key}|/.@cmd|
+is not simply executed with the argument |{|\meta{value}|}|. However, the
+approach taken in the |pgfkeys| packages allows for more flexibility. For
+instance, assume that you have a key that expects a \meta{value} of the form
``\meta{text}|+|\meta{more text}'' and wishes to store \meta{text} and
-\meta{more text} in two different macros. This can be achieved as
-follows:
+\meta{more text} in two different macros. This can be achieved as follows:
+%
\begin{codeexample}[]
\def\mystore#1+#2\pgfeov{\def\a{#1}\def\b{#2}}
\pgfkeyslet{/my key/.@cmd}{\mystore}
@@ -562,21 +565,20 @@ follows:
|\a| is \a, |\b| is \b.
\end{codeexample}
-Naturally, defining the code to be stored in a key in the above manner
-is too awkward. The following commands simplify things a bit, but the
-usual manner of setting up code for a key is to use one of the
-handlers described in Section~\ref{section-code-handlers}.
+Naturally, defining the code to be stored in a key in the above manner is too
+awkward. The following commands simplify things a bit, but the usual manner of
+setting up code for a key is to use one of the handlers described in
+Section~\ref{section-code-handlers}.
\begin{command}{\pgfkeysdef\marg{key}\marg{code}}
- This command temporarily defines a \TeX-macro with the argument list
- |#1\pgfeov| and then lets \meta{key}|/.@cmd| be equal to this
- macro. The net effect of all this is that you have then set up code
- for the key \meta{key} so that when you write
- |\pgfkeys{|\meta{key}|=|\meta{value}|}|, then the \meta{code} is
- executed with all occurrences of |#1| in \meta{code} being replaced
- by \meta{value}. (This behaviour is quite similar to the
- |\define@key| command of |keyval| and |xkeyval|).
-
+ This command temporarily defines a \TeX-macro with the argument list
+ |#1\pgfeov| and then lets \meta{key}|/.@cmd| be equal to this macro. The
+ net effect of all this is that you have then set up code for the key
+ \meta{key} so that when you write |\pgfkeys{|\meta{key}|=|\meta{value}|}|,
+ then the \meta{code} is executed with all occurrences of |#1| in
+ \meta{code} being replaced by \meta{value}. (This behaviour is quite
+ similar to the |\define@key| command of |keyval| and |xkeyval|).
+ %
\begin{codeexample}[]
\pgfkeysdef{/my key}{#1, #1.}
\pgfkeys{/my key=hello}
@@ -584,17 +586,16 @@ handlers described in Section~\ref{section-code-handlers}.
\end{command}
\begin{command}{\pgfkeysedef\marg{key}\marg{code}}
- This command works like |\pgfkeysdef|, but it uses |\edef| rather
- than |\def| when defining the key macro. If you do not know the
- difference between the two, then you will not need this command;
- and if you know the difference, then you will know when you need this
- command.
+ This command works like |\pgfkeysdef|, but it uses |\edef| rather than
+ |\def| when defining the key macro. If you do not know the difference
+ between the two, then you will not need this command; and if you know the
+ difference, then you will know when you need this command.
\end{command}
\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 count} between $0$ and $9$ (inclusive).
-
+ This command works like |\pgfkeysdef|, but it allows you to provide 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=
@@ -603,86 +604,89 @@ handlers described in Section~\ref{section-code-handlers}.
|\a| is `\a', |\b| is `\b'.
\end{codeexample}
- The resulting key will expect exactly \marg{argument count} arguments.
+ %
+ 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|.
+ 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.
-
+ 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}}
\pgfkeys{/my key=hello+world}
|\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.}.
+ %
+ 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}}
- The |\edef| version of |\pgfkeysdefargs|.
+ The |\edef| version of |\pgfkeysdefargs|.
\end{command}
\subsubsection{Keys That Store Values}
-Let us continue with what happens when |\pgfkeys| processes the
-current key and the subkey \meta{key}|/.@cmd| is not defined. Then
-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}.
+Let us continue with what happens when |\pgfkeys| processes the current key and
+the subkey \meta{key}|/.@cmd| is not defined. Then 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}.
\subsubsection{Keys That Are Handled}
\label{section-key-handlers}
-If neither the \meta{key} itself nor the subkey \meta{key}|/.@cmd| are
-defined, then the \meta{key} cannot be processed ``all by itself.''
-Rather, a \meta{handler} is needed for this key. Most of the power of
-|pgfkeys| comes from the proper use of such handlers.
+If neither the \meta{key} itself nor the subkey \meta{key}|/.@cmd| are defined,
+then the \meta{key} cannot be processed ``all by itself''. Rather, a
+\meta{handler} is needed for this key. Most of the power of |pgfkeys| comes
+from the proper use of such handlers.
-Recall that the \meta{key} is always a full key (if it was not
-originally, it has already been upgraded at this point to a full
-key). It decomposed into two parts:
+Recall that the \meta{key} is always a full key (if it was not originally, it
+has already been upgraded at this point to a full key). It decomposed into two
+parts:
\begin{enumerate}
-\item The \meta{path} of \meta{key} (everything
- before the last slash) is stored in the macro |\pgfkeyscurrentpath|.
-\item The \meta{name} of \meta{key} (everything
- after the last slash) is stored in the macro |\pgfkeyscurrentname|.
-
- 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.
+ \item The \meta{path} of \meta{key} (everything before the last slash) is
+ stored in the macro |\pgfkeyscurrentpath|.
+ \item The \meta{name} of \meta{key} (everything after the last slash) is
+ stored in the macro |\pgfkeyscurrentname|.
+
+ 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.
\end{enumerate}
-(For efficiency reasons, these two macros are only set up at this point;
-so when code is executed for a key in the ``usual'' manner then these
-macros are not set up.)
+(For efficiency reasons, these two macros are only set up at this point; so
+when code is executed for a key in the ``usual'' manner then these macros are
+not set up.)
The |\pgfkeys| command now checks whether the key
-|/handlers/|\meta{name}|/.@cmd| exists. If so, it should store a command
-and this command is executed exactly in the same manner as described
-in Section~\ref{section-key-code}.
-Thus, this code gets the \meta{value} that was originally intended for
-\meta{key} as its argument, followed by |\pgfeov|.
-It is the job of the handlers to do something useful with the
-\meta{value}.
-
-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
-|/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
-|\pgfkeyscurrentpath|. It can then lookup which value is stored in
-this key and print it.
-
+|/handlers/|\meta{name}|/.@cmd| exists. If so, it should store a command and
+this command is executed exactly in the same manner as described in
+Section~\ref{section-key-code}. Thus, this code gets the \meta{value} that was
+originally intended for \meta{key} as its argument, followed by |\pgfeov|. It
+is the job of the handlers to do something useful with the \meta{value}.
+
+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 |/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
+|\pgfkeyscurrentpath|. It can then lookup which value is stored in this key and
+print it.
+%
\begin{codeexample}[code only]
\pgfkeysdef{/handlers/.print to log}
{%
@@ -693,40 +697,41 @@ this key and print it.
...
\pgfkeys{/my key/.print to log}
\end{codeexample}
-The above code will print |Hi!| in the log, provided the macro
-|\writetolog| is set up appropriately.
-
-For a more interesting handler, let us program a handler that will
-set up a key so that when the key is used, some code is executed. This
-code is given as \meta{value}. All the handler must do is to call
-|\pgfkeysdef| for the path of the key (which misses the handler's
-name) and assign the parameter value to it.
+%
+The above code will print |Hi!| in the log, provided the macro |\writetolog| is
+set up appropriately.
+
+For a more interesting handler, let us program a handler that will set up a key
+so that when the key is used, some code is executed. This code is given as
+\meta{value}. All the handler must do is to call |\pgfkeysdef| for the path of
+the key (which misses the handler's name) and assign the parameter value to it.
+%
\begin{codeexample}[]
\pgfkeysdef{/handlers/.my code}{\pgfkeysdef{\pgfkeyscurrentpath}{#1}}
\pgfkeys{/my key/.my code=(#1)}
\pgfkeys{/my key=hallo}
\end{codeexample}
-There are some parameters for handled keys which prove to be useful in some (possibly rare) special cases:
+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}).
+ 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. }}
@@ -750,78 +755,77 @@ There are some parameters for handled keys which prove to be useful in some (pos
% '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}
+ %
+ 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.
+\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, nor its |.@cmd| subkey nor
-a handler is defined. In this case, it is checked whether
-the key \meta{current path}|/.unknown/.@cmd| exists. Thus, when you try to
-use the key |/tikz/strange|, then it is checked whether
-|/tikz/.unknown/.@cmd| exists. If this key exists (which it does), it is
-executed. This code can then try to make sense of the key. For
-instance, the handler for \tikzname\ will try to interpret the key's
-name as a color or as an arrow specification or as a \pgfname\
-option.
-
-You can set up unknown key handlers for your own keys by simply setting
-the code of the key \meta{my path prefix}|/.unknown|. This also allows
-you to set up ``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
-for in |/a|, |/b|, and |/b/c|. We set up a key |/my search path| for
-this:
+For some keys, neither the key, nor its |.@cmd| subkey nor a handler is
+defined. In this case, it is checked whether the key \meta{current
+path}|/.unknown/.@cmd| exists. Thus, when you try to use the key
+|/tikz/strange|, then it is checked whether |/tikz/.unknown/.@cmd| exists. If
+this key exists (which it does), it is executed. This code can then try to make
+sense of the key. For instance, the handler for \tikzname\ will try to
+interpret the key's name as a color or as an arrow specification or as a
+\pgfname\ option.
+
+You can set up unknown key handlers for your own keys by simply setting the
+code of the key \meta{my path prefix}|/.unknown|. This also allows you to set
+up ``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 for in |/a|, |/b|, and |/b/c|. We set up a key
+|/my search path| for this:
+%
\begin{codeexample}[code only]
\pgfkeys{/my search path/.unknown/.code=
{%
@@ -835,33 +839,36 @@ 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|. Before you start implementing
-search paths using this pattern, consider the |/.search also| handler
-discussed below.
+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.
-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,
+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/|!
+%
+\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|:
+|/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=
{%
@@ -893,66 +900,67 @@ using |handler config|:
\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.
+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
-also define new ones as described in Section~\ref{section-key-handlers}.
+We now describe which key handlers are defined by default. You can also define
+new ones as described in Section~\ref{section-key-handlers}.
\subsubsection{Handlers for Path Management}
\begin{handler}{{.cd}}
- This handler causes the default path to be set to \meta{key}. Note that
- the default path is reset at the beginning of each call to
- |\pgfkeys| to be equal to~|/|.
+ This handler causes the default path to be set to \meta{key}. Note that the
+ default path is reset at the beginning of each call to |\pgfkeys| to be
+ equal to~|/|.
- \example |\pgfkeys{/tikz/.cd,...}|
+ \example |\pgfkeys{/tikz/.cd,...}|
\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:
+ 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}
\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.
+ %
+ 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.
\end{handler}
-
\subsubsection{Setting Defaults}
\label{section-default-handlers}
\begin{handler}{{.default}|=|\meta{value}}
- Sets the default value of \meta{key} to \meta{value}. This means
- that whenever no value is provided in a call to |\pgfkeys|, then
- this \meta{value} will be used instead.
+ Sets the default value of \meta{key} to \meta{value}. This means that
+ whenever no value is provided in a call to |\pgfkeys|, then this
+ \meta{value} will be used instead.
- \example |\pgfkeys{/width/.default=1cm}|
+ \example |\pgfkeys{/width/.default=1cm}|
\end{handler}
\begin{handler}{{.value required}}
- This handler causes the error message key |/erros/value required| to
- be issued whenever the \meta{key} is used without a value.
+ This handler causes the error message key |/erros/value required| to be
+ issued whenever the \meta{key} is used without a value.
- \example |\pgfkeys{/width/.value required}|
+ \example |\pgfkeys{/width/.value required}|
\end{handler}
\begin{handler}{{.value forbidden}}
- This handler causes the error message key |/erros/value forbidden|
- to be issued whenever the \meta{key} is used with a value.
+ This handler causes the error message key |/erros/value forbidden| to be
+ issued whenever the \meta{key} is used with a value.
- 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.
+ 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.
+ %
\begin{codeexample}[code only]
\pgfkeys{/my key/.code=I do not want an argument!}
\pgfkeys{/my key/.value forbidden}
@@ -960,6 +968,7 @@ also define new ones as described in Section~\ref{section-key-handlers}.
\pgfkeys{/my key} % Ok
\pgfkeys{/my key=foo} % Error
\end{codeexample}
+ %
\end{handler}
@@ -969,113 +978,111 @@ also define new ones as described in Section~\ref{section-key-handlers}.
A number of handlers exist for defining the code of keys.
\begin{handler}{{.code}|=|\meta{code}}
- This handler executes |\pgfkeysdef| with the parameters \meta{key}
- and \meta{code}. This means that, afterwards, whenever the
- \meta{key} is used, the \meta{code} gets executed. More precisely,
- when \meta{key}|=|\meta{value} is encountered in a key list,
- \meta{code} is executed with any occurrence of |#1| replaced by
- \meta{value}. As always, if no \meta{value} is given, the default
- value is used, if defined, or the special value |\pgfkeysnovalue|.
-
- It is permissible that \meta{code} calls the command |\pgfkeys|. It
- is also permissible the \meta{code} calls the command
- |\pgfkeysalso|, which is useful for styles, see below.
-
+ This handler executes |\pgfkeysdef| with the parameters \meta{key} and
+ \meta{code}. This means that, afterwards, whenever the \meta{key} is used,
+ the \meta{code} gets executed. More precisely, when
+ \meta{key}|=|\meta{value} is encountered in a key list, \meta{code} is
+ executed with any occurrence of |#1| replaced by \meta{value}. As always,
+ if no \meta{value} is given, the default value is used, if defined, or the
+ special value |\pgfkeysnovalue|.
+
+ It is permissible that \meta{code} calls the command |\pgfkeys|. It is also
+ permissible the \meta{code} calls the command |\pgfkeysalso|, which is
+ useful for styles, see below.
+ %
\begin{codeexample}[code only]
\pgfkeys{/par indent/.code={\parindent=#1},/par indent/.default=2em}
\pgfkeys{/par indent=1cm}
...
\pgfkeys{/par indent}
\end{codeexample}
+ %
\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
- 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,
- \meta{value} could be |{first}{second}|. Then \meta{code} is
- executed with any occurrence of |#1| replaced |first| and any
- occurrence of |#2| replaced by |second|.
-
+ 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, \meta{value} could be
+ |{first}{second}|. Then \meta{code} is executed with any occurrence of |#1|
+ replaced |first| and any occurrence of |#2| replaced by |second|.
+ %
\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.
+ %
+ 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|.
+ 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
- rather than a |\def| to define the macro.
+ 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).
+ 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.
+ %
+ 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.
+ 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 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.
-
+ 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).
+
+ 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
- rather than a |\def| to define the macro.
+ This handler works like |/.code args|, only an |\edef| is used rather than
+ a |\def| to define the macro.
\end{handler}
-
There are also handlers for modifying existing keys.
\begin{handler}{{.add code}|=|\marg{prefix code}\marg{append code}}
- This handler adds code to an existing key. The \meta{prefix code} is
- added to the code stored in \meta{key}|/.@cmd| at the beginning, the
- \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|.
-
+ This handler adds code to an existing key. The \meta{prefix code} is added
+ to the code stored in \meta{key}|/.@cmd| at the beginning, the \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|.
+ %
\begin{codeexample}[code only]
\pgfkeys{/par indent/.code={\parindent=#1}}
\newdimen\myparindent
@@ -1084,39 +1091,40 @@ There are also handlers for modifying existing keys.
\pgfkeys{/par indent=1cm} % This will set both \parindent and
% \myparindent to 1cm
\end{codeexample}
+ %
\end{handler}
\begin{handler}{{.prefix code}|=|\meta{prefix code}}
- This handler is a shortcut for \meta{key}|/.add code={|\meta{prefix
- code}|}{}|. That is, this handler adds the \meta{prefix code} at
- the beginning of the code stored in \meta{key}|/.@cmd|.
+ This handler is a shortcut for \meta{key}|/.add code={|\meta{prefix
+ code}|}{}|. That is, this handler adds the \meta{prefix code} at the
+ beginning of the code stored in \meta{key}|/.@cmd|.
\end{handler}
\begin{handler}{{.append code}|=|\meta{append code}}
- This handler is a shortcut for \meta{key}|/.add code={}{|\meta{append
- code}|}{}|.
+ This handler is a shortcut for \meta{key}|/.add code={}{|\meta{append
+ code}|}{}|.
\end{handler}
\subsubsection{Defining Styles}
-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 parameterized just like normal code.
+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 parameterized just
+like normal code.
\begin{handler}{{.style}|=|\meta{key list}}
- This handler sets things up so that whenever \meta{key}|=|\meta{value} is
- encountered in a key list, then the \meta{key list}, with every
- occurrence of |#1| replaced by \meta{value}, is processed
- instead. As always, if no \meta{value} is given, the default
- value is used, if defined, or the special value |\pgfkeysnovalue|.
-
- 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.
-
+ This handler sets things up so that whenever \meta{key}|=|\meta{value} is
+ encountered in a key list, then the \meta{key list}, with every occurrence
+ of |#1| replaced by \meta{value}, is processed instead. As always, if no
+ \meta{value} is given, the default value is used, if defined, or the
+ special value |\pgfkeysnovalue|.
+
+ 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.
+ %
\begin{codeexample}[code only]
\pgfkeys{/par indent/.code={\parindent=#1}}
\pgfkeys{/no indent/.style={/par indent=0pt}}
@@ -1125,62 +1133,68 @@ list. Styles can be parameterized just like normal code.
...
\pgfkeys{/normal indent}
\end{codeexample}
- The following example shows a parameterized 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};
\node [outline=blue] at (0,-1) {blue box};
\end{tikzpicture}
\end{codeexample}
+ %
\end{handler}
\begin{handler}{{.estyle}|=|\meta{key list}}
- 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.
+ 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}
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
- \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}.
+ 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}.
+ %
\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}}
\pgfkeys{/page size={30cm}{20cm}}
\end{codeexample}
+ %
\end{handler}
\begin{handler}{{.estyle 2 args}|=|\meta{key list}}
- This handler works like |/.style 2 args|, only an |\edef| is used
- rather than a |\def| to define the macro.
+ 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.
+ 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
- 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
- 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
- list} are processed.
+ 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 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 list} are
+ processed.
+ %
\begin{codeexample}[code only]
\pgfkeys{/par indent/.code={\parindent=#1}}
\pgfkeys{/par indent/.add style={}{/my key=#1}}
@@ -1188,34 +1202,35 @@ For styles the corresponding handlers as for normal code exist:
\pgfkeys{/par indent=1cm} % This will set \parindent and
% then execute /my key=#1
\end{codeexample}
+ %
\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}
\subsubsection{Defining Value-, Macro-, If- and Choice-Keys}
For some keys, the code that should be executed for them is rather
-``specialized.'' For instance, it happens often that the code for a
-key just sets a certain \TeX-if to true or false. For these cases,
-predefined handlers make it easier to install the necessary code.
+``specialized''. For instance, it happens often that the code for a key just
+sets a certain \TeX-if to true or false. For these cases, predefined handlers
+make it easier to install the necessary code.
-However, we start with some handlers that are used to manage the value
-that is directly stored in a key.
+However, we start with some handlers that are used to manage the value that is
+directly stored in a key.
\begin{handler}{{.initial}|=|\meta{value}}
- This handler sets the value of \meta{key} to \meta{value}. Note that
- no subkeys are involved. After this handler has been used, by the
- rules governing keys, you can subsequently change the value of the
- \meta{key} by just writing \meta{key}|=|\meta{value}. Thus, this
- handler is used to set the initial value of key.
-
+ This handler sets the value of \meta{key} to \meta{value}. Note that no
+ subkeys are involved. After this handler has been used, by the rules
+ governing keys, you can subsequently change the value of the \meta{key} by
+ just writing \meta{key}|=|\meta{value}. Thus, this handler is used to set
+ the initial value of key.
+ %
\begin{codeexample}[code only]
\pgfkeys{/my key/.initial=red}
% "/my key" now stores the value "red"
@@ -1223,57 +1238,58 @@ that is directly stored in a key.
% "/my key" now stores the value "blue"
\end{codeexample}
- Note that with this configuration, writing |\pgfkeys{/my key}| will not
- have the effect you might expect (namely that |blue| is inserted
- into the main text). Rather, |/my key| will be promoted to
- |/my key=\pgfkeysnovalue| and, thus, |\pgfkeysnovalue| will be
- stored in |/my key|.
+ Note that with this configuration, writing |\pgfkeys{/my key}| will not
+ have the effect you might expect (namely that |blue| is inserted into the
+ main text). Rather, |/my key| will be promoted to |/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}.
-
+ Executes a |\let| command so that \meta{macro} contains the contents stored
+ in \meta{key}.
+ %
\begin{codeexample}[]
\pgfkeys{/my key/.initial=red}
\pgfkeys{/my key=blue}
\pgfkeys{/my key/.get=\mymacro}
\mymacro
\end{codeexample}
+ %
\end{handler}
\begin{handler}{{.add}|=|\marg{prefix value}\marg{append value}}
- Adds the \meta{prefix value} and the beginning and the \meta{append
- value} at the end of the value stored in \meta{key}.
+ Adds the \meta{prefix value} and the beginning and the \meta{append 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}.
+ 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}.
+ 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.
+ 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
-value in the key itself.
+\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 value in the key
+itself.
\begin{handler}{{.store in}|=|\meta{macro}}
- 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}.
+ 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}.
+ %
\begin{codeexample}[]
\pgfkeys{/text/.store in=\mytext}
\def\a{world}
@@ -1281,13 +1297,14 @@ value in the key itself.
\def\a{Gruffalo}
\mytext
\end{codeexample}
+ %
\end{handler}
\begin{handler}{{.estore in}|=|\meta{macro}}
- 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}.
+ 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}.
+ %
\begin{codeexample}[]
\pgfkeys{/text/.estore in=\mytext}
\def\a{world}
@@ -1295,19 +1312,19 @@ value in the key itself.
\def\a{Gruffalo}
\mytext
\end{codeexample}
+ %
\end{handler}
-In another common situation a key is used to set a \TeX-if to true or
-false.
+In another common situation a key is used to set a \TeX-if to true or 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,
- the code |\|\meta{\TeX-if name}\meta{value} is executed, which sets
- the \TeX-if accordingly.
+ 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, the code |\|\meta{\TeX-if name}\meta{value} is executed, which
+ sets the \TeX-if accordingly.
+ %
\begin{codeexample}[]
\newif\iftheworldisflat
\pgfkeys{/flat world/.is if=theworldisflat}
@@ -1318,19 +1335,19 @@ false.
Round?
\fi
\end{codeexample}
+ %
\end{handler}
-The next handler deals with the problem when a
-\meta{key}|=|\meta{value} makes sense only for a small set of possible
-\meta{value}s. For instance, the line cap can only be |rounded| or
-|rect| or |butt|, but nothing else. For this situation the following
-handler is useful.
+The next handler deals with the problem when a \meta{key}|=|\meta{value} makes
+sense only for a small set of possible \meta{value}s. For instance, the line
+cap can only be |rounded| or |rect| or |butt|, but nothing else. For this
+situation the following handler is useful.
\begin{handler}{{.is choice}}
- This handler sets things up so that writing \meta{key}|=|\meta{value}
- will cause the subkey \meta{key}|/|\meta{value} to be executed. So,
- each of the different possible choices should be given by a subkey
- of \meta{key}.
+ This handler sets things up so that writing \meta{key}|=|\meta{value} will
+ cause the subkey \meta{key}|/|\meta{value} to be executed. So, each of the
+ different possible choices should be given by a subkey of \meta{key}.
+ %
\begin{codeexample}[code only]
\pgfkeys{/line cap/.is choice}
\pgfkeys{/line cap/round/.style={\pgfsetbuttcap}}
@@ -1340,30 +1357,31 @@ handler is useful.
...
\draw [/line cap=butt] ...
\end{codeexample}
- If the subkey \meta{key}|/|\meta{value} does not exist, the error
- key |/errors/unknown choice value| is executed.
+ %
+ If the subkey \meta{key}|/|\meta{value} does not exist, the error key
+ |/errors/unknown choice value| is executed.
\end{handler}
\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
-can even use things like |#1| or unbalanced \TeX-ifs inside
-\meta{value}. However, sometimes you want the \meta{value} to be
-expanded before it is used. For instance, \meta{value} might be a
-macro name like |\mymacro| and you do not want |\mymacro| to be used
-as the macro, but rather the \emph{contents} of |\mymacro|. Thus,
-instead of using \meta{value}, you wish to use whatever \meta{value}
-expands to. Instead of using some fancy |\expandafter| hackery, you
-can use the following handlers:
+\meta{value} ``as is''. Indeed, great care is taken to ensure that you can even
+use things like |#1| or unbalanced \TeX-ifs inside \meta{value}. However,
+sometimes you want the \meta{value} to be expanded before it is used. For
+instance, \meta{value} might be a macro name like |\mymacro| and you do not
+want |\mymacro| to be used as the macro, but rather the \emph{contents} of
+|\mymacro|. Thus, instead of using \meta{value}, you wish to use whatever
+\meta{value} expands to. Instead of using some fancy |\expandafter| hackery,
+you can use the following handlers:
\begin{handler}{{.expand once}|=|\meta{value}}
- This handler expands \meta{value} once (more precisely, it executes
- an |\expandafter| command on the first token of \meta{value}) and
- then process the resulting \meta{result} as if you had written
- \meta{key}|=|\meta{result}. Note that if \meta{key} contains a
- handler itself, this handler will be called normally.
+ This handler expands \meta{value} once (more precisely, it executes an
+ |\expandafter| command on the first token of \meta{value}) and then process
+ the resulting \meta{result} as if you had written
+ \meta{key}|=|\meta{result}. Note that if \meta{key} contains a handler
+ itself, this handler will be called normally.
+ %
\begin{codeexample}[]
\def\a{bottom}
\def\b{\a}
@@ -1385,44 +1403,47 @@ Key 3:& \pgfkeys{/key3} \\
Key 4:& \pgfkeys{/key4}
\end{tabular}
\end{codeexample}
+ %
\end{handler}
\begin{handler}{{.expand twice}|=|\meta{value}}
- This handler works like saying \meta{key}|/.expand once/.expand once=|\meta{value}.
+ This handler works like saying
+ \meta{key}|/.expand once/.expand once=|\meta{value}.
\end{handler}
\begin{handler}{{.expanded}|=|\meta{value}}
- This handler will completely expand \meta{value} (using |\edef|)
- before processing \meta{key}|=|\meta{result}.
+ This handler will completely expand \meta{value} (using |\edef|) 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.
+ 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 Forwarding}
\begin{handler}{{.forward to}|=|\meta{another key}}
- This handler causes the \meta{key} to ``forward'' its argument to
- \meta{another key}. When the \meta{key} is used, its normal code
- will be executed first. Then, the value is (additionally) passed to
- \meta{another key}. If the \meta{key} has not yet been defined prior
- to the use of |.forward to|, it will be defined then (and do nothing by
- itself, expect for forwarding it to \meta{key name}). The
- \meta{another key} must be a fully qualified key name.
+ This handler causes the \meta{key} to ``forward'' its argument to
+ \meta{another key}. When the \meta{key} is used, its normal code will be
+ executed first. Then, the value is (additionally) passed to \meta{another
+ key}. If the \meta{key} has not yet been defined prior to the use of
+ |.forward to|, it will be defined then (and do nothing by itself, expect
+ for forwarding it to \meta{key name}). The \meta{another key} must be a
+ fully qualified key name.
+ %
\begin{codeexample}[]
\pgfkeys{
/a/.code=(a:#1),
@@ -1432,14 +1453,14 @@ Key 4:& \pgfkeys{/key4}
}
\pgfkeys{/b=1} \pgfkeys{/c=2}
\end{codeexample}
+ %
\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}.
-
+ 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'}}
@@ -1452,24 +1473,26 @@ Key 4:& \pgfkeys{/key4}
\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 knew what she 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| cannot 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}
+ 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 knew what she 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| cannot 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'}}
@@ -1488,15 +1511,17 @@ Key 4:& \pgfkeys{/key4}
\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 to keys
- that 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
+ 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 to keys that 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
@@ -1516,7 +1541,9 @@ Key 4:& \pgfkeys{/key4}
}
}
\end{codeexample}
- \item |\pgfkeys{/path/.search also={/tikz,/pgf}}| is equivalent to
+ %
+ \item |\pgfkeys{/path/.search also={/tikz,/pgf}}| is equivalent to
+ %
\begin{codeexample}[code only]
\pgfkeys{/path/.unknown/.code={%
\ifpgfkeysaddeddefaultpath
@@ -1539,117 +1566,127 @@ Key 4:& \pgfkeys{/key4}
}
}
\end{codeexample}
- \end{enumerate}
+ \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
+ 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{Handlers for Testing Keys}
\begin{handler}{{.try}|=|\meta{value}}
- 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,
- 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.
+ 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, 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.
+ %
\begin{codeexample}[]
\pgfkeys{/a/.code=(a:#1)}
\pgfkeys{/b/.code=(b:#1)}
\pgfkeys{/x/.try=hmm,/a/.try=hallo,/b/.try=welt}
\end{codeexample}
+ %
\end{handler}
\begin{handler}{{.retry}|=|\meta{value}}
- 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''.
+ 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''.
+ %
\begin{codeexample}[]
\pgfkeys{/a/.code=(a:#1)}
\pgfkeys{/b/.code=(b:#1)}
\pgfkeys{/x/.try=hmm,/a/.retry=hallo,/b/.retry=welt}
\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 handler will only try to set a key if ``the last attempt failed''. Furthermore, this here is the last such attempt.
+ This handler works like |/.retry|, only it will invoke the usual handlers
+ for unknowns keys if |\||ifpgfkeyssuccess| is false. Thus, this handler
+ 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}
\begin{handler}{{.show value}}
- This handler executes a |\show| command on the value stored in
- \meta{key}. This is useful mostly for debugging.
+ This handler executes a |\show| command on the value stored in \meta{key}.
+ This is useful mostly for debugging.
- \example |\pgfkeys{/my/obscure key/.show value}|
+ \example |\pgfkeys{/my/obscure key/.show value}|
\end{handler}
\begin{handler}{{.show code}}
- This handler executes a |\show| command on the code stored in
- \meta{key}|/.@cmd|. This is useful mostly for debugging.
+ This handler executes a |\show| command on the code stored in
+ \meta{key}|/.@cmd|. This is useful mostly for debugging.
- \example |\pgfkeys{/my/obscure key/.show code}|
+ \example |\pgfkeys{/my/obscure key/.show code}|
\end{handler}
-The following key is not a handler, but it also commonly used for
-inspecting things:
+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}.
- % FIXME : there is a bug in the pretty printer ... fix it!
- \example \verb|\pgfkeys{some key=some value,/utils/exec=\show\hallo,obscure key=obscure}|
+ % FIXME: there is a bug in the pretty printer ... fix it!
+ \example \verb|\pgfkeys{some key=some value,/utils/exec=\show\hallo,obscure key=obscure}|
\end{key}
\subsection{Error Keys}
-In certain situations errors can occur, like using an undefined
-key. In these situations error keys are executed. They should store a
-macro that gets two arguments: The first is the offending key
-(possibly only after macro expansion), the second is the value that
-was passed as a parameter (also possibly only after macro expansion).
+In certain situations errors can occur, like using an undefined key. In these
+situations error keys are executed. They should store a macro that gets two
+arguments: The first is the offending key (possibly only after macro
+expansion), the second is the value that was passed as a parameter (also
+possibly only after macro expansion).
-Currently, error keys are simply executed. In the future it might be a
-good idea to have different subkeys that are executed depending on the
-language currently set so that users get a localized error message.
+Currently, error keys are simply executed. In the future it might be a good
+idea to have different subkeys that are executed depending on the 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.
+ This key is executed whenever an \meta{offending key} is used without a
+ value when a value is actually required.
\end{key}
\begin{key}{/errors/value forbidden=\marg{offending key}\marg{value}}
- This key is executed whenever a key is used with a value when a
- value is actually forbidden.
+ This key is executed whenever a key is used with a value when a value is
+ actually forbidden.
\end{key}
\begin{key}{/errors/boolean expected=\marg{offending key}\marg{value}}
- This key is executed whenever a key set up using |/.is if| gets called
- with a \meta{value} other than |true| or |false|.
+ This key is executed whenever a key set up 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 set up using the |/.is choice| handler that is not defined.
+ This key is executed whenever a choice is used as a \meta{value} for a key
+ set up 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.
+ This key is executed whenever a key is unknown and no specific |/.unknown|
+ handler is found.
\end{key}
-\input pgfmanual-en-pgfkeysfiltered.tex
+
+\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
index be115418442..d93c8b8c0e2 100644
--- 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
@@ -1,100 +1,150 @@
+
\subsection{Key Filtering}
\begingroup
-{\small \emph{An extension by Christian Feuers\"anger}}
+{\small \emph{An extension by Christian Feuersänger}}
\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.
+\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.
-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
+
+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,
+ /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),
+ /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
+\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
+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,
+ /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.
+%
+\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.
- 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').
+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.
- 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.
+\subsubsection{Setting Filters}
- 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.
+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.
+\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}.
+ 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.
+ 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}.
+ 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{}
@@ -104,48 +154,74 @@ The command |\pgfkeysfiltered| is the main tool to process only selected options
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.
+\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}.
+ A variant of |\pgfkeysalsofiltered| which loads its key list from
+ \marg{macro}.
\end{command}
\begin{handler}{{.install key filter}|=|\meta{optional arguments}}
- This handler installs 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:
+ This handler installs 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:
+ %
+ 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 list in braces like |{{first}{second}}|.
+ %
+ If a key filter requires more than one argument, you need to provide the
+ complete argument list in braces like |{{first}{second}}|.
- You can also use |\pgfkeysinstallkeyfilter|\meta{full key}\meta{optional arguments}, it has the same effect.
+ 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.
+ 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'.
+ 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.
+ 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.
+ 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.
+
+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}.
+ 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{}
@@ -154,118 +230,174 @@ Each option for which key filters decided to skip them is handed over to a `key
Remaining options: `\remainingoptions'.
\end{codeexample}
- This example uses the same keys as defined in the intro section~\ref{section-key-filter-example}.
+ %
+ 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.
+ 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).
+ 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.
+\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|.
-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)$).
+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}.
+ 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.
+ 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.
+ 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}).
+ 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.
+ 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.
+ 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.
+ 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
+ /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.
+ %
+ 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.
+ 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.
+ 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).
+ 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
+ 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}|.
+ |/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
+ 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}|.
+ |/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.
+\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.
+ 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|.
+%
+\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|.
+\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.
+ 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|.
+%
+\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 \meta{path}. It returns true for every key whose key path is equal to \meta{path}. It also returns true for any unknown key, that means unknown keys are processed using the standard unknown handlers of \pgfname.
+ Install this key filter to process only options belonging to the key tree
+ \meta{path}. It returns true for every key whose key path is equal to
+ \meta{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)},
@@ -274,10 +406,14 @@ There are some more key filters which have nothing to do with family handling.
/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}.
+ 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)},
@@ -285,121 +421,156 @@ There are some more key filters which have nothing to do with family handling.
/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}.
+ 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}}
+ {/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.
+ %
+ 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.
-
+ 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.
-
+ 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.
+ This key filter returns always true.
\end{key}
\begin{key}{/pgf/key filters/false}
- This key filter returns always false (including unknown keys).
+ 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.
+ 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 the environment. If key filtering is not active, this has no effect at all.
+\label{section-key-filter-api}
+
+\begin{plainenvironment}{{pgfkeysinterruptkeyfilter}}
+ Temporarily disables key filtering inside the environment. If key filtering
+ is not active, this has no effect at all.
- Please note that no \TeX-group is introduced.
+ 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.
+ 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}|}}|.
+\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}|}}|.
+\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}|.
+\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}|/.deactivate family}|.
+\begin{command}{\pgfkeysdeactivatefamily\marg{family name}}
+ Equivalent to |\pgfkeys{|\meta{family name}|/.deactivate 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 deactivates each family in \meta{family list}.
+\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 deactivates 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}.
+ 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.
+\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}.
+\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}|}|.
+\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|).
+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|.
-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.
+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.
+%
+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}.
+ 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-animations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-animations.tex
new file mode 100644
index 00000000000..7ac5b4f795e
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-animations.tex
@@ -0,0 +1,1510 @@
+% Copyright 2016 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{Animation System Layer}
+\label{section-pgfsys-anim}
+
+\makeatletter
+
+\def\animationexample#1#2#3{%
+ \tikz[fill=blue!25, draw=blue, ultra thick] {
+ \pgfidrefnextuse{\objid}{#1}
+ \pgfsysanimkeywhom{\objid}{#2}
+ \pgfidrefnextuse{\nodeid}{node}
+ \pgfsysanimkeyevent{\nodeid}{}{click}{}{begin}
+ #3
+ \node [font=\footnotesize, circle, fill, draw, align=center]
+ (node) {Click \\ here};
+ }%
+}
+
+In conjunction with the right output format (namely \textsc{svg}), you can
+specify that certain parts of you graphics can be animated. For this, there are
+a number of commands that cover, currently, what \textsc{svg 1.1} can do
+regarding animations. For a detailed introduction to animations, please see
+Section~\ref{section-base-animations}; the current section assumes that you are
+familiar with the concepts explained there.
+
+The animation system consists of two layer itself: Commands starting with
+|\pgfsys@anim...| and commands starting with |\pgfsysanim|. These work as
+follows:
+%
+\begin{enumerate}
+ \item The commands starting with |\pgfsys@anim...| insert the actual
+ animation commands into the output stream. A driver must implement
+ these commands.
+ \item The command starting with |\pgfsysanim...| provide an. These
+ commands, which are the ones that should be called by higher layers,
+ implement the snapshot mechanism: When the command
+ |\pgfsysanimsnapshot| is used, the |\pgfsysanim...| commands do
+ \emph{not} call the |\pgfsys@anim...| commands but, instead, insert
+ non-animation commands to show the values of the attributes at the
+ snapshot's time. To use this abstraction layer, you have to load the
+ file |pgfsysanimations.code.tex|, which is not loaded by default (but
+ is loaded by the \pgfname\ module |animations|).
+\end{enumerate}
+
+The bottom line is that if you wish to implement a new driver, you need to
+implement the |\pgfsys@anim...| commands, if you use the animation layer, you
+call the |\pgfsysanim...| commands.
+
+
+\subsection{Animations and Snapshots}
+
+To add an animation to a graphic, use the following command (as described
+above, the first command is the one you actually call, the second is the one a
+driver implements):
+
+\begin{command}{\pgfsysanimate\marg{attribute}}
+\end{command}
+
+\begin{command}{\pgfsys@animate\marg{attribute}}
+ The system layer animation subsystem follows the following philosophy: An
+ animation always concerns an \emph{attribute} of a \emph{graphic object}. A
+ \emph{timeline} specifies how the attribute changes its value over time.
+ Finally, a set of \emph{keys} configures the animation as a whole like
+ whether the timeline repeats or a event that triggers the start of the
+ animation. The four parts of an animation, namely the \emph{attribute}, the
+ \emph{graphic object}, the \emph{timeline}, and the \emph{keys}, are
+ specified in different ways:
+ %
+ \begin{enumerate}
+ \item You choose the \emph{attribute} using the system layer command
+ |\pgfsysanimate|.
+ \item The \emph{graphic object} whose attribute is to be animated is
+ \emph{always} specified by naming the ID of the graphic object
+ \emph{before} this object is created, see
+ Section~\ref{section-sys-id}. (However, in the context of
+ \tikzname, it suffices that the animation is given in the object's
+ options since these are executed before the actual object is
+ created).
+ \item The \emph{timeline} is specified using the commands
+ |\pgfsysanimkeytime|, which specifies a time in seconds, and
+ |\pgfsys@animation@val...|, which specify a value at this
+ particular time. The timeline specifies for a sequence of times the
+ values the attribute will have at these times. In between these
+ \emph{key times,} the value is interpolated.
+ \item The \emph{animation keys} are specified by commands starting
+ |\pgfsys@animation@...| and have the following effect: They set
+ some property (like, say, whether the animation repeats or whether
+ its effect is additive) to a given value \emph{for the current
+ \TeX\ scope,} but do not create any animations. Rather, when
+ |\pgfsysanimate| is called, a snapshot of the current values of all
+ animation keys is taken and added to this animation of the
+ attribute.
+
+ When you set an animation key to a value, this will replace the
+ value previously stored for the key (all keys are empty by default
+ at the beginning).
+
+ Note that animation keys are local to \TeX\ scopes, not graphics
+ scopes; indeed, they have little to do with the settings of the
+ graphics scope other than the fact that a graphic scope is also a
+ \TeX\ scope and thereby influence the values of these keys.
+ \end{enumerate}
+
+ A typical example of how all of this works is the following:
+ %
+\begin{codeexample}[code only]
+\pgfsysanimkeyrepeatindefinite % Both of the following animations
+ % repeat indefinitely
+{
+ \pgfsysanimkeywhom{\someid}{}% The id of a later object
+ \pgfsysanimkeyevent{}{}{click}{0}{begin}% Begin on a click ...
+ \pgfsysanimkeytime{5}{1}{1}{0}{0} % Timeline starts after 5s
+ \pgfsysanimvalscalar{0} % With a value of 0
+ \pgfsysanimkeytime{8}{1}{1}{0}{0} % Timeline ends after 8s
+ \pgfsysanimvalscalar{0.9} % With a value of 0.9
+ \pgfsysanimate{fillopacity}% ... and the attribute is the fill opacity
+}
+{
+ \pgfsysanimkeywhom{\someid}{}% The id of a later object
+ \pgfsysanimkeyoffset{0}{begin}% Begin right away ...
+ \pgfsysanimkeytime{1}{1}{1}{0}{0} % Timeline starts after 1s
+ \pgfsysanimvalcurrent % With the current value
+ \pgfsysanimkeytime{5}{1}{1}{0}{0} % Timeline ends after 5s
+ \pgfsysanimvaldimension{5pt} % With a value of 5pt
+ \pgfsysanimate{linewidth}% ... and the attribute is the line width
+}
+\end{codeexample}
+ %
+ As a real-life example, consider the following definitions, which will be
+ used in many examples in the rest of this section: Both take three
+ parameters: The \pgfname/\tikzname\ name of a to-be animated object, a type
+ (relevant for objects that have subtypes or parts), and some code for
+ triggering the actual animation. The animation will always start when the
+ button is clicked. The second macro sets up things in such a way that the
+ animation will last two seconds, while the first leaves the timing open.
+ %
+\begin{codeexample}[code only]
+\def\animationexample#1#2#3{
+ \tikz[fill=blue!25, draw=blue, ultra thick] {
+ \pgfidrefnextuse{\objid}{#1}
+ \pgfsysanimkeywhom{\objid}{#2}
+ \pgfidrefnextuse{\nodeid}{node}
+ \pgfsysanimkeyevent{\nodeid}{}{click}{}{begin}
+ #3
+ \node [font=\scriptsize, circle, fill, draw, align=center]
+ (node) {Click \\ here};
+ }
+}
+\end{codeexample}
+ %
+ Now the example, where the circle will disappear, when clicked:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{1}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{0}
+ \pgfsysanimate{opacity}
+}
+\end{codeexample}
+ %
+\end{command}
+
+The ``opposite'' of |\pgfsysanimate| is the following command:
+
+\begin{command}{\pgfsysanimsnapshot\marg{time}}
+ Use this command in a scope prior to calling any other commands documented
+ in this section concerning the configuration of animations. In this case,
+ all uses of |\pgfsysanimate| inside the \TeX\ scope no longer insert an
+ animation into the output file. Instead, a ``snapshot'' is inserted of what
+ the animation ``would like at time \meta{time}''. For instance, if an
+ animation inserts a movement of an object by 4cm over a time of 2s and you
+ take a snapshot with $\meta{time} = 2\mathrm s$, you get a picture in which
+ the object is moved by 1cm.
+
+ A lot of care has been taken to make the output produced by the snapshot be
+ as close as possible as what the animation really would look like at time
+ \meta{time}, but note the following restrictions:
+ %
+ \begin{enumerate}
+ \item Interactive events of all kinds (like |click| or |mouseover|)
+ make little sense for snapshots, which are created once and for all
+ during the typesetting of the document. For this reason, all events
+ are ignored for snapshots (even sync bases, and |begin| and |end|
+ events, which might make some sense also in a snapshot setting).
+
+ However, there is one command which helps you with ``simulating''
+ the effect of events:
+ %
+ \begin{command}{\pgfsysanimkeysnapshotstart\marg{time offset}}
+ This command specifies that for the current animation the
+ ``moment |0s|'' of the timeline is at \meta{time offset}. Thus,
+ it works like |\pgfsysanimkeyoffset|, only the offset is now
+ solely for the snapshot timeline. It has no effect on the
+ actual animation.
+ \end{command}
+ %
+ \item The command |\pgfsysanimvalcurrent| cannot be used with snapshots
+ since \pgfname\ has no chance of computing the correct current
+ value. You always have to specify the start value explicitly.
+ \item The computation of time splines (entry and exit splines) and the
+ accumulation of values after a large number of repeats may not be
+ numerically stable.
+ \end{enumerate}
+ %
+\begin{codeexample}[width=5cm]
+\foreach \t in {0.5,1,1.5,2} {
+ \pgfsysanimsnapshot{\t}
+ \tikz {
+ \pgfidrefnextuse{\objid}{node}
+ \pgfsysanimkeywhom{\objid}{}
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{1}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{0}
+ \pgfsysanimate{opacity}
+ \node (node) [draw = blue, very thick, fill=blue!20, circle] {Hi};
+ }
+}
+\end{codeexample}
+ %
+\end{command}
+
+\begin{command}{\pgfsysanimsnapshotafter\marg{time}}
+ Works like the previous command, only the ``moment'' that \meta{time}
+ refers to is conceptually $\meta{time} + \epsilon$: When timeline specifies
+ several values for \meta{time}, this command will select the last value at
+ \meta{time}, while |\pgfsnapshot| will select the first value at
+ \meta{time}. Similarly, when a timeline ends at \meta{time}, |\pgfsnapshot|
+ will select the last value of the timeline while |\pgfsnapshotafter| will
+ not apply the animation any more.
+\end{command}
+
+
+\subsection{Commands for Animating an Attribute: Color, Opacity, Visibility, Staging}
+
+The commands from this and the next sections specify that some attribute should
+be animated. We start with rather basic animation attributes for color,
+visibility, and opacity.
+
+\begin{sysanimateattribute}{opacity}
+ Adds an animation of the opacity to the graphic object specified using
+ |\pgfsysanimkeywhom|. If the driver supports this, this is a bit different
+ from animating the fill and stroke opacities individually: Paths are
+ treated as transparency groups for this key. Typically, ``this is what you
+ want''.
+
+ Specify values with |\pgfsysanimvalscalar|.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{1}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{0}
+ \pgfsysanimate{opacity}
+}
+\end{codeexample}
+ %
+\end{sysanimateattribute}
+
+\begin{sysanimateattribute}{fillopacity}
+ Adds an animation of only the opacity of fill operations.
+
+ Specify values with |\pgfsysanimvalscalar|.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{1}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{0}
+ \pgfsysanimate{fillopacity}
+}
+\end{codeexample}
+ %
+\end{sysanimateattribute}
+
+\begin{sysanimateattribute}{strokeopacity}
+ Adds an animation of only the opacity of draw (stroke) operations.
+
+ Specify values with |\pgfsysanimvalscalar|.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{1}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{0}
+ \pgfsysanimate{strokeopacity}
+}
+\end{codeexample}
+ %
+\end{sysanimateattribute}
+
+\begin{sysanimateattribute}{visibility}
+ Adds an animation of the ``visibility''.
+
+ Specify values with |\pgfsysanimvaltext|. However, only two values are
+ allowed: |visible| and |hidden|.
+ %
+\begin{codeexample}[animation list={-1,0,1,2,3}]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltext{hidden}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltext{hidden}
+ \pgfsysanimate{visibility}
+}
+\end{codeexample}
+ %
+\end{sysanimateattribute}
+
+\begin{sysanimateattribute}{strokecolor}
+ Adds an animation of the stroke color.
+
+ Specify values with |\pgfsysanimvalcolorrgb| and friends.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalcolorrgb{0}{0}{0}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalcolorrgb{1}{0}{0}
+ \pgfsysanimate{strokecolor}
+}
+\end{codeexample}
+ %
+\end{sysanimateattribute}
+
+\begin{sysanimateattribute}{fillcolor}
+ Adds an animation of the fill color.
+
+ Specify values with |\pgfsysanimvalcolorrgb| and friends.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalcolorrgb{0}{0}{0}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalcolorrgb{1}{0}{0}
+ \pgfsysanimate{fillcolor}
+}
+\end{codeexample}
+ %
+\end{sysanimateattribute}
+
+
+\subsection{Commands for Animating an Attribute: Paths and Their Rendering}
+
+The following attributes influence paths and how they are rendered.
+
+\begin{sysanimateattribute}{path}
+ Adds an animation of the path itself. That means that the path will morph
+ its form from one path to another. When morphing a path, all ``values'',
+ which are the paths, must consist of the \emph{exact same} path
+ construction commands; they may only differ with respect to the numbers
+ used in these descriptions.
+
+ Specify values with |\pgfsysanimvalpath|.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2},animation bb={(0.9,-0.1)rectangle(2.1,1.1)}]
+\animationexample{my path}{path}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalpath{\pgfsys@moveto{1cm}{0cm}%
+ \pgfsys@lineto{1cm}{1cm}%
+ \pgfsys@lineto{2cm}{0cm}}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalpath{\pgfsys@moveto{1cm}{1cm}%
+ \pgfsys@lineto{2cm}{1cm}%
+ \pgfsys@lineto{1cm}{0cm}}
+ \pgfsysanimate{path}
+ \filldraw [ultra thick,draw=blue,fill=blue!20, name=my path]
+ (1,0) -- (1,1) -- (2,0); }
+\end{codeexample}
+
+ You can attach arrow tips to paths that are animated and these arrow tips
+ will correctly ``rotate and move along'' with the path's end points
+ \emph{if} you take the following points into considerations:
+ %
+ \begin{itemize}
+ \item Arrow tips that ``rotate and move along'' with a path must be
+ specified using a special animation command, see below. The normal
+ arrow tips added to a path would \emph{not} be animated
+ automatically and, indeed, if you add arrow tips to a path using
+ |\pgfsetarrows| and then animate the path, you will get an error
+ message.
+ \item Internally, the arrow tips that ``rotate and move along'' are
+ drawn using so-called \emph{markers.} These are little graphic
+ objects that can be added to the start and end of paths and that
+ are automatically rotated and move along with the path.
+
+ In principle, the rendering rules used by \textsc{svg} for markers
+ are the same as for normal arrow tips: The markers are rotated and
+ moved so that the point along a tangent of the path at the start or
+ end of the path. However, when it comes to special cases such as a
+ path with multiple segments, a path with degenerate segments, a
+ closed path, and so on, the rules used by for instance \textsc{svg}
+ may differ from the placement that \pgfname\ will compute.
+
+ Thus, it is best to add arrow tips only to ``normal'' paths
+ consisting of a single open path segment whose ends can be
+ shortened a bit without causing degeneration.
+ \item When an arrow tip is added to a path, the path must typically be
+ shortened a bit so that the \emph{tip} of the arrow ends where the
+ path would usually end. This shortening is not done by the system
+ layer for to-be-animated paths; you must compute and then animate
+ these shortened paths yourself. (However, the basic layer animation
+ module will do this for you, so you only have to worry about this
+ when you use the system layer directly.)
+ \end{itemize}
+
+ Let us now have a look at how we add arrow tip markers:
+ %
+ \begin{command}{\pgfsysanimkeytipmarkers\marg{start marker}\marg{end marker}}
+ \end{command}
+ %
+ \begin{command}{\pgfsys@animation@tip@markers\marg{start marker}\marg{end marker}}
+ This command specifies that during a path animation the two markers
+ provided as parameters should be added (and rotated and moved along
+ with the path) at the start and end. The \meta{start marker} must
+ either be empty (in which case no marker is added at the start) or it
+ must be a macro storing a value returned by the command
+ |\pgfsys@marker@declare|. In this case, the marker declared symbol will
+ be added to the start during the animation. The same situation applies
+ to the end of the path.
+
+ As pointed out earlier, only arrow tips / markers added to paths using
+ this command will be animated along with the path. In particular, you
+ should \emph{not} add arrow tips to to-be-animated paths using
+ |\pgfsetarrow|. However, when you use a base value
+ (|\pgfsys@animation@base|) to set a path, the arrow tips will also be
+ added to this base path.
+
+ To sum up, the ``correct'' way of adding arrow tips to a path that is
+ animated is to proceed as follows:
+ %
+ \begin{enumerate}
+ \item You specify arrow tips for a path using this command.
+ \item You specify times and values of the to-be-animated path,
+ shortened as necessary to accommodate the length of the arrow
+ tips.
+ \item You specify the first (or, possibly, some other) value in the
+ time--value sequence as a base value.
+ \item You create a path animation that applies to a future path.
+ \item You create this future path as an empty path without arrow
+ tips and draw it. Because of the setting of the base value,
+ instead of the empty path the base path will be used as the
+ ``real'' path and the animation's arrow tips will be added as
+ arrow tips.
+ \end{enumerate}
+
+ When you have more than one animation for a given path, these different
+ animations may use different arrow tips / markers. This allows you to
+ animate (change) which arrow tip is used on a path over time.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2},animation bb={(0.7,-0.3)rectangle(2.3,1.3)}]
+% Declare a marker:
+\pgfsys@marker@declare\mymarker{%
+ \pgfscope%
+ \pgfsetcolor{red!75}%
+ \pgfpathmoveto{\pgfpoint{0pt}{5pt}}\pgfpathlineto{\pgfpoint{8pt}{0pt}}%
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}\pgfpathclose%
+ \pgfusepathqfill%
+ \endpgfscope%
+ \pgfpathmoveto{\pgfpoint{0pt}{5pt}}\pgfpathlineto{\pgfpoint{8pt}{0pt}}%
+ \pgfpathlineto{\pgfpoint{0pt}{-5pt}}\pgfpathclose%
+ \pgfusepathqstroke%
+}%
+\animationexample{my path}{path}{
+ \pgfsysanimkeytipmarkers{\mymarker}{\mymarker}
+ \pgfsysanimkeybase
+ \pgfsysanimvalpath{\pgfsys@moveto{1cm}{0cm}%
+ \pgfsys@lineto{1cm}{1cm}%
+ \pgfsys@lineto{2cm}{0cm}}
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalpath{\pgfsys@moveto{1cm}{0cm}%
+ \pgfsys@lineto{1cm}{1cm}%
+ \pgfsys@lineto{2cm}{0cm}}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalpath{\pgfsys@moveto{1cm}{1cm}%
+ \pgfsys@lineto{2cm}{1cm}%
+ \pgfsys@lineto{1cm}{0cm}}
+ \pgfsysanimate{path}
+ \filldraw [ultra thick,draw=blue,fill=blue!20, name=my path];
+ \path (1,0) (2,1);}
+\end{codeexample}
+ \end{command}
+\end{sysanimateattribute}
+
+\begin{sysanimateattribute}{linewidth}
+ Adds an animation of the line width.
+
+ Specify values with |\pgfsysanimvaldimension|.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaldimension{1pt}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaldimension{10pt}
+ \pgfsysanimate{linewidth}
+}
+\end{codeexample}
+ %
+\end{sysanimateattribute}
+
+\begin{sysanimateattribute}{dash}
+ Adds an animation of the dash phase and pattern (like |\pgfsys@setdash|).
+
+ Specify values with |\pgfsysanimvaldash|.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaldash{1pt,10pt}{0pt}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaldash{10pt,3pt}{0pt}
+ \pgfsysanimate{dash}
+}
+\end{codeexample}
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaldash{1cm,1pt}{0pt}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaldash{1cm,1pt}{1cm}
+ \pgfsysanimate{dash}
+}
+\end{codeexample}
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaldash{3pt,1pt}{0pt}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaldash{1pt,3pt}{10pt}
+ \pgfsysanimate{dash}
+}
+\end{codeexample}
+ %
+\end{sysanimateattribute}
+
+
+\subsection{Commands for Animating an Attribute: Transformations and Views}
+
+The commands in this section allow you to animate the canvas transformation
+matrix of a scope. However, there is one command that needs to be explained
+first.
+
+\begin{command}{\pgfsysanimkeycanvastransform\marg{pre}\marg{post}}
+\end{command}
+%
+\begin{command}{\pgfsys@animation@canvas@transform\marg{pre}\marg{post}}
+ In order to animate the canvas, you specify that, for instance, the canvas
+ should be shifted over, say, one second by 2cm from left to right. In order
+ to specify this, you specify that an additional shift should be added to
+ the canvas transformation matrix that starts out as $(0,0)$ and ends at
+ $(2\,\mathrm{cm},0)$. However, it is not immediately clear what ``to the
+ right'' or $(2\,\mathrm{cm},0)$ actually means: ``Right'' relative to the
+ paper? ``Right'' relative to the coordinate system at the point when the
+ animation is created? ``Right'' relative to the object's local coordinate
+ system?
+
+ Using this command you can specify the coordinate system relative to which
+ all canvas animations are specified. In detail, when you add an animation
+ $a$ of the canvas of an object foo, the following happens:
+ %
+ \begin{enumerate}
+ \item We start with the canvas transformation matrix that is installed
+ when the object starts. More precisely, this is the canvas
+ transformation matrix that is in force when the command
+ |\pgfsys@begin@idscope| is called for the object. The canvas
+ transformation matrix that is in force when the animation is
+ created (which is typically ``way before'' the object is created
+ and may even be in a totally different graphics scope) is
+ irrelevant for the animation.
+ \item Now, when the object is created, the code \meta{pre} is executed.
+ It should call |\pgfsys@transformcm| at most once. This canvas
+ transformation is added to the object's canvas transformation.
+ \item Now, the animation $a$ of the canvas is relative to the resulting
+ canvas transformation. That means, when the animation shifts the
+ object ``to the right'' the animation will actually be along the
+ current direction of ``right'' in the canvas transformation
+ resulting from the two transformations above.
+ \item Finally, at the point of creation of the to-be-animation object
+ the code \meta{post} is executed. Again, the code should call
+ |\pgfsys@transformcm| at most once. The resulting transformation is
+ also added to the object's canvas transformation, but does
+ \emph{not} influence the animation.
+ \end{enumerate}
+
+ The net effect of the above is that, normally, you use the \meta{pre} code
+ to setup a transformation matrix relative to which you wish to perform your
+ animation and, normally, you use \meta{post} to undo this transformation
+ (using the inverted matrix) to ensure that when no animation is in force,
+ the object is placed at the same position as if no animation were used.
+
+ Let us now have a look at some examples. We use the following macro, which
+ takes a pre and a post code and animates a red ball over 1cm to the right
+ in two seconds and rotates the blue ball over 90$^\circ$ around the origin.
+ The ball is placed at $(1,0)$.
+ %
+\begin{codeexample}[code only]
+\def\animationcanvasexample#1#2{%
+ \animationexample{ball}{}{%
+ \pgfsysanimkeycanvastransform{#1}{#2}%
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}%
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{1cm}{0cm}%
+ \pgfsysanimate{translate}
+ \fill [ball color=red,name=ball] (1,0) circle [radius=3mm]; }
+ \animationexample{ball}{}{%
+ \pgfsysanimkeycanvastransform{#1}{#2}%
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{0}%
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{90}%
+ \pgfsysanimate{rotate}
+ \fill [ball color=blue,name=ball] (1,0) circle [radius=3mm]; } }
+\end{codeexample}
+ %
+\def\animationcanvasexample#1#2{%
+ \animationexample{ball}{}{%
+ \pgfsysanimkeycanvastransform{#1}{#2}%
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}%
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{1cm}{0cm}%
+ \pgfsysanimate{translate}
+ \fill [ball color=red,name=ball] (1,0) circle [radius=3mm]; }
+ \animationexample{ball}{}{%
+ \pgfsysanimkeycanvastransform{#1}{#2}%
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{0}%
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{90}%
+ \pgfsysanimate{rotate}
+ \fill [ball color=blue,name=ball] (1,0) circle [radius=3mm]; } }
+
+\begin{codeexample}[width=9.9cm,animation list={0.5,1,1.5,2}]
+\animationcanvasexample
+{}
+{}
+\end{codeexample}
+ %
+\begin{codeexample}[width=9.9cm,animation list={0.5,1,1.5,2}]
+\animationcanvasexample
+{\pgfsys@transformshift{10mm}{0mm}}
+{\pgfsys@transformshift{-10mm}{0mm}}
+\end{codeexample}
+ %
+\begin{codeexample}[width=9.9cm,animation list={0.5,1,1.5,2}]
+\animationcanvasexample
+{\pgfsys@transformcm{0.5}{0.5}{-0.5}{0.5}
+ {0pt}{0pt}}
+{}
+\end{codeexample}
+ %
+\begin{codeexample}[width=9.9cm,animation list={0.5,1,1.5,2}]
+\animationcanvasexample
+{\pgfsys@transformcm{0.5}{0.5}{-0.5}{0.5}
+ {0pt}{0pt}}
+{\pgfsys@transformcm{1}{-1}{1}{1}
+ {0pt}{0pt}}
+\end{codeexample}
+ %
+\end{command}
+
+\begin{sysanimateattribute}{translate}
+ Adds an (additional) translate animation. Effectively, this causes the
+ group to be shifted to different positions.
+
+ Specify values with |\pgfsysanimvaltranslate|.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}%
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{5mm}{-1cm}
+ \pgfsysanimate{translate}
+}
+\end{codeexample}
+ %
+\end{sysanimateattribute}
+
+\begin{sysanimateattribute}{scale}
+ Adds an animation of the scaling relative to the origin. This causes a
+ scaling of the canvas, including fonts and line widths.
+
+ Specify values with |\pgfsysanimvalscale|.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalscale{1}{1}%
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalscale{0.5}{2}
+ \pgfsysanimate{scale}
+}
+\end{codeexample}
+ %
+\end{sysanimateattribute}
+
+\begin{sysanimateattribute}{rotate}
+ Adds a rotation animation around the origin.
+
+ Specify values with |\pgfsysanimvalscalar|.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{0}%
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{90}
+ \pgfsysanimate{rotate}
+}
+\end{codeexample}
+ %
+\end{sysanimateattribute}
+
+\begin{sysanimateattribute}{skewx}
+ Adds an animation of a skewing of the canvas along the $x$-axis. Unlike the
+ |slant| options of \tikzname, the skew is given in degrees.
+
+ Specify values with |\pgfsysanimvalscalar|.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{0}%
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{45}
+ \pgfsysanimate{skewx}
+}
+\end{codeexample}
+ %
+\end{sysanimateattribute}
+
+\begin{sysanimateattribute}{skewy}
+ Adds an animation of a skewing of the canvas along the $y$-axis.
+
+ Specify values with |\pgfsysanimvalscalar|.
+\end{sysanimateattribute}
+
+\begin{sysanimateattribute}{motion}
+ Works a bit like |\pgfsysanimvaltranslate|: It also adds an animated shift
+ transformation of the canvas. However, instead of specifying some shift
+ coordinates as values, you now specify a whole path (which may include
+ curves). The effect is that an animated translate transformation for the
+ different points on this path gets installed. Furthermore, if you use
+ |\pgfsysanimkeyrotatealong|, an additional adaptive rotation transformation
+ will be added so that the animated graphic scope ``points along'' the path.
+
+ You specify the path along which you wish to move objects along using
+ |\pgfsysanimkeymovealong|. You use the timeline to specify how far the
+ object gets moved along this path using scalar values where |0| is the
+ beginning of the path and |1| is the end. Thus, setting the timeline to the
+ scalar value of |0| at time $t_0$ and to |1| at time $t_1$ will cause the
+ object o move along the complete path between times $t_0$ and $t_1$.
+
+ Specify values with |\pgfsysanimvalscalar|.
+
+ \begin{command}{\pgfsysanimkeymovealong\marg{path}}
+ \end{command}
+ %
+ \begin{command}{\pgfsys@animation@movealong\marg{path}}
+ Defines the \meta{path} along which the motion will occur. It will
+ simply be executed and must call |\pgfsys@lineto| and similar
+ path-construction commands, but should not call other commands.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2},render instead={
+\animationexample{node}{}{
+ \pgfsysanimkeymovealong{
+ \pgfsyssoftpath@movetotoken{0pt}{0pt}
+ \pgfsyssoftpath@linetotoken{0pt}{-5mm}
+ \pgfsyssoftpath@curvetosupportatoken{0pt}{-1cm}%
+ \pgfsyssoftpath@curvetosupportbtoken{0pt}{-1cm}%
+ \pgfsyssoftpath@curvetotoken{-5mm}{-1cm} }
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{0}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{1}
+ \pgfsysanimate{motion}
+}
+ }]
+\animationexample{node}{}{
+ \pgfsysanimkeymovealong{
+ \pgfsyssoftpath@movetotoken{0pt}{0pt}
+ \pgfsyssoftpath@linetotoken{0pt}{-5mm}
+ \pgfsyssoftpath@curvetosupportatoken{0pt}{-1cm}%
+ \pgfsyssoftpath@curvetosupportbtoken{0pt}{-1cm}%
+ \pgfsyssoftpath@curvetotoken{-5mm}{-1cm} }
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{0}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{1}
+ \pgfsysanimate{motion}
+}
+\end{codeexample}
+ \end{command}
+
+ \begin{command}{\pgfsysanimkeynorotatealong}
+ \end{command}
+ %
+ \begin{command}{\pgfsys@animation@norotatealong}
+ Indicates that no additional rotation should be added during the
+ movement. This is the default.
+ \end{command}
+
+ \begin{command}{\pgfsysanimkeyrotatealong}
+ \end{command}
+ %
+ \begin{command}{\pgfsys@animation@rotatealong}
+ Indicates that the to-be-animated group should be rotated automatically
+ so that it points along the path as time progresses. This option is
+ only applicable to motion animations.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2},render instead={
+\animationexample{node}{}{
+ \pgfsysanimkeyrotatealong
+ \pgfsysanimkeymovealong{
+ \pgfsyssoftpath@movetotoken{0pt}{0pt}
+ \pgfsyssoftpath@linetotoken{0pt}{-5mm}
+ \pgfsyssoftpath@curvetosupportatoken{0pt}{-1cm}%
+ \pgfsyssoftpath@curvetosupportbtoken{0pt}{-1cm}%
+ \pgfsyssoftpath@curvetotoken{-5mm}{-1cm} }
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{0}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{1}
+ \pgfsysanimate{motion}
+}}]
+\animationexample{node}{}{
+ \pgfsysanimkeyrotatealong
+ \pgfsysanimkeymovealong{%
+ \pgfsyssoftpath@movetotoken{0pt}{0pt}%
+ \pgfsyssoftpath@linetotoken{0pt}{-5mm}%
+ \pgfsyssoftpath@curvetosupportatoken{0pt}{-1cm}%
+ \pgfsyssoftpath@curvetosupportbtoken{0pt}{-1cm}%
+ \pgfsyssoftpath@curvetotoken{-5mm}{-1cm}}
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{0}%
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalscalar{1}
+ \pgfsysanimate{motion}
+}
+\end{codeexample}
+ \end{command}
+\end{sysanimateattribute}
+
+\begin{sysanimateattribute}{viewbox}
+ Adds an animation of the view box. The graphic scope to which this
+ animation is added must have been created using |\pgfsys@viewboxmeet| or
+ |\pgfsys@viewboxslice|; adding it to other scopes has no effect. Note that
+ this command does \emph{not} change or animate the scope's transformation
+ matrix -- it only animates the ``what we see through the view box''.
+
+ Specify values with |\pgfsysanimvalviewbox|.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2},width=5cm,animation
+ bb={(0.9,-2.1) rectangle (3.1,2.1)}]
+\animationexample{my view}{view}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvalviewbox{-10mm}{-20mm}{10mm}{20mm}%
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvalviewbox{15mm}{-15mm}{27mm}{8mm}%
+ \pgfsysanimate{viewbox}
+ \scoped [xshift=2cm] {
+ \draw [red] (-1,-2) rectangle (1,2) node [font=\scriptsize,
+ below left, align=right] {original\\ view\\ box};
+ \scoped [meet={(-1,-2) (1,2)}, name=my view] {
+ \draw (-5mm,-15mm) rectangle (7mm,8mm)
+ node [font=\scriptsize, align=right, below left]
+ {target\\ view\\ box}; ;
+ \filldraw (0,0) circle [radius=3mm];
+} } }
+\end{codeexample}
+ %
+\end{sysanimateattribute}
+
+
+\subsection{Commands for Specifying the Target Object}
+
+\begin{command}{\pgfsysanimkeywhom\marg{id}\marg{type}}
+\end{command}
+%
+\begin{command}{\pgfsys@animation@whom\marg{id}\marg{type}}
+ Sets the target of the animation. The \marg{id} must previously have been
+ created using |\pgfsys@new@id|, \marg{type} must be a type (the empty type
+ is also allowed). See Section~\ref{section-sys-id} for details on ids and
+ types.
+\end{command}
+
+
+\subsection{Commands for Specifying Timelines: Specifying Times}
+
+Animations are specified using \emph{timelines}, which are functions mapping
+times to values for these times. The functions are cubic splines, which are
+specified using time--value pairs plus control points.
+
+In order to specify a time--value pair, you first use the command
+|\pgfsysanimkeytime| to specify a time. Next, you use |\pgfsysanimval...| to
+specify a value, which adds the time--value pair to the timeline. Note that the
+times must be given in non-decreasing order. Between time--value pairs, the
+values are interpolated using a spline.
+
+The first and last times of the timeline are a bit special: The timeline starts
+on the first time and the duration of the timeline is the difference between
+the first and last time. ``Starting'' on the start time actually means that any
+beginnings (see the commands for specifying beginnings and endings) get as
+offset the start time; similarly end times are offset by this value.
+
+\begin{command}{\pgfsysanimkeytime\marg{time}\marg{entry spline
+ control x}\marg{entry spline control y}\marg{exit spline
+ control x}\marg{exit spline control y}%
+}
+\end{command}
+\begin{command}{\pgfsys@animation@time\marg{time}\marg{entry spline
+ control x}\marg{entry spline control y}\marg{exit spline
+ control x}\marg{exit spline control y}%
+}
+ The \meta{time} is a number representing seconds (so |0.5| means 500\,ms).
+
+ The spline between a time--value pair and the next is specified using the
+ four parameters following the time. The first two of these specify the
+ second control point of the interval preceding the time--value pair (called
+ the ``entry'' control point), the last two parameters specify the first
+ control point of the interval following the pair (called the ``exit''
+ control point). Consider for instance, the following calls:
+ %
+\begin{codeexample}[code only]
+\pgfsysanimkeytime{10}{0.1}{0.2}{0.3}{0.4}
+\pgfsysanimvalscalar{100}
+\pgfsysanimkeytime{15}{0.5}{0.6}{0.7}{0.8}
+\pgfsysanimvalscalar{200}
+\end{codeexample}
+ %
+ This will create (at least) the time interval $[10\,\mathrm s,15\,\mathrm
+ s]$ and the control points for this interval will be $(0.3,0.4)$ and
+ $(0.5,0.6)$.
+
+ Control points are specified in a different ``coordinate'' system from the
+ time--value pairs themselves: While the time--value pairs are specified
+ using a number representing seconds and a value using some special
+ commands, the control points are specified as numbers between $0$ and $1$,
+ each time representing a fraction of the time interval or the value
+ interval. In the example, the time interval is $[10\,\mathrm s,15\,\mathrm
+ s]$ and the value interval is $[100,200]$. This means that a control point
+ of $(0.3,0.4)$ actually refers to the time--value $(11.5\,\mathrm s,140)$.
+ The ``time--value curve'' in the interval thus ``\texttt{(10s,100) ..
+ controls (11.5s,140) and (12.5s,160) .. (15s,200)}''.
+
+ Note that by setting the control points always to $(1,1)$ and $(0,0)$ you
+ get a linear interpolation between time--value pairs.
+
+ Two special cases are the following: When the two last parameters, the exit
+ spline, take the special values |stay| and |0|, the attribute's value
+ ``stays'' until the next value for the next time (it then ``jumps'' to the
+ next value then). This corresponds, roughly, to an ``infinite'' \meta{exit
+ spline control x}. Similarly, when the entry spline parameters take the
+ special values |jump| and |1|, the value immediately jumps from the
+ previous value to the next value when the previous value was specified.
+\end{command}
+
+\begin{command}{\pgfsysanimkeybase}
+\end{command}
+%
+\begin{command}{\pgfsys@animation@base}
+ This command can be used in any place where |\pgfsys@animation@time| is
+ usually used. The effect is that the next value does not become part of the
+ timeline, but will become the value used for the attribute when no
+ animation is active. (Normally, when the animation is not active, no value
+ is set at all and the value is inherited from the surrounding scope.)
+\end{command}
+
+It may happen that there is more than one timeline active that is ``trying to
+modify'' a given attribute. In this case, the following rules are used to
+determine, which timeline ``wins'':
+%
+\begin{enumerate}
+ \item If no animation is active at the current time (all animation either
+ have not yet started or they have already ended), then the base value
+ given in the animation encountered last in the code is used. (If there
+ are no base values, the attribute is taken from the surrounding scope.)
+ \item If there are several active animations, the one that has started last
+ is used and the its value is used.
+ \item If there are several active animations that have started at the same
+ time, the one that comes last in the code is used.
+\end{enumerate}
+
+Note that these rules do not apply to transformations of the canvas since these
+are always additive (or, phrased differently, they are always all active and
+the effects accumulate).
+
+
+\subsection{Commands for Specifying Timelines: Specifying Values}
+
+The following commands are used to specify the values of a timeline. Each use
+of one of the following commands adds one time--value pair to the timeline.
+Which of the commands must be used depends on the type of the to-be-animated
+attribute (see the |\pgfsysanimate| command instances, which list the command
+that must be used).
+
+\begin{command}{\pgfsysanimvalcurrent}
+\end{command}
+\begin{command}{\pgfsys@animation@val@current}
+ Creates a time--value pairs where the value is the current value that the
+ attribute has. This command can only be used in conjunction with ``real''
+ animations, when you use it with a snapshot an error is raised.
+\end{command}
+
+\begin{command}{\pgfsysanimvaltext\marg{text}}
+\end{command}
+\begin{command}{\pgfsys@animation@val@text\marg{text}}
+ Creates a time--value pairs where the value is some text. Which texts are
+ permissible depends on the to-be-animated attribute.
+\end{command}
+
+\begin{command}{\pgfsysanimvalscalar\marg{number}}
+\end{command}
+\begin{command}{\pgfsys@animation@val@scalar\marg{number}}
+ Creates a time--value pairs where the value is a number like |0.5| or
+ |-2.25|.
+\end{command}
+
+\begin{command}{\pgfsysanimvaldimension\marg{dimension}}
+\end{command}
+\begin{command}{\pgfsys@animation@val@dimension\marg{dimension}}
+ Creates a time--value pairs where the value is a \TeX\ dimension like
+ |0.5pt| or |-2in|.
+\end{command}
+
+\begin{command}{\pgfsysanimvalcolorrgb\marg{red}\marg{green}\marg{blue}}
+\end{command}
+\begin{command}{\pgfsys@animation@val@color@rgb\marg{red}\marg{green}\marg{blue}}
+ Creates a time--value pairs where the value is color specified by three
+ fractional values between 0 and 1 for the red, the green, and the blue
+ part.
+\end{command}
+
+\begin{command}{\pgfsysanimvalcolorcmyk\marg{cyan}\marg{magenta}\marg{yellow}\marg{black}}
+\end{command}
+\begin{command}{\pgfsys@animation@val@color@cmyk\marg{cyan}\marg{magenta}\marg{yellow}\marg{black}}
+ Creates a time--value pairs where the value is color specified by four
+ fractional values between 0 and 1 for the cyan, magenta, yellow, and black
+ part.
+\end{command}
+
+\begin{command}{\pgfsysanimvalcolorcmy\marg{cyan}\marg{magenta}\marg{yellow}}
+\end{command}
+\begin{command}{\pgfsys@animation@val@color@cmy\marg{cyan}\marg{magenta}\marg{yellow}}
+ Like the |\pgfsysanimvalcolorcmyk| only without the black part.
+\end{command}
+
+\begin{command}{\pgfsysanimvalcolorgray\marg{gray value}}
+\end{command}
+\begin{command}{\pgfsys@animation@val@color@gray\marg{gray value}}
+ Creates a time--value pairs where the value is gray value (a
+ fraction between 0 and 1).
+\end{command}
+
+\begin{command}{\pgfsysanimvalpath\marg{low-level path construction commands}}
+\end{command}
+\begin{command}{\pgfsys@animation@val@path\marg{low-level path construction command}}
+ Creates a time--value pairs where the value is path. The \meta{low-level
+ commands} must consist of a sequence of path construction commands like
+ |\pgfsys@lineto| or |\pgfsyssoftpath@linetotoken| (more precisely, the
+ commands must form a list of \TeX\ tokens and dimensions surrounded by
+ braces). For each call of this command, the sequence of tokens and numbers
+ must be the some. During the animation, only and exactly the numbers will
+ be interpolated.
+\end{command}
+
+\begin{command}{\pgfsysanimvaltranslate\marg{x dimension}\marg{y dimension}}
+\end{command}
+\begin{command}{\pgfsys@animation@val@translate\marg{x dimension}\marg{y dimension}}
+ Creates a time--value pairs where the value is a coordinate. The dimensions
+ must be \TeX\ dimensions.
+\end{command}
+
+\begin{command}{\pgfsysanimvalscale\marg{x scale}\marg{y scale}}
+\end{command}
+\begin{command}{\pgfsys@animation@val@scale\marg{x scale}\marg{y scale}}
+ Creates a time--value pairs where the value is pair of scalar values.
+\end{command}
+
+\begin{command}{\pgfsysanimvalviewbox\marg{$x_1$}\marg{$y_1$}\marg{$x_2$}\marg{$y_2$}}
+\end{command}
+\begin{command}{\pgfsys@animation@val@viewbox\marg{$x_1$}\marg{$y_1$}\marg{$x_2$}\marg{$y_2$}}
+ Creates a time--value pairs where the value is view box. The lower left
+ corner is given by $(x_1,y_1)$, consisting of two \TeX\ dimensions, and the
+ upper right corner is $(x_2,y_2)$.
+\end{command}
+
+\begin{command}{\pgfsysanimvaldash\marg{pattern}\marg{phase}}
+\end{command}
+\begin{command}{\pgfsys@animation@val@dash\marg{pattern}\marg{phase}}
+ Creates a time--value pairs where the value is dash pattern and phase with
+ the same syntax as |\pgfsys@setdash|.
+\end{command}
+
+
+\subsection{Commands for Specifying Timing: Repeats}
+
+\begin{command}{\pgfsysanimkeyrepeat{number of times}}
+\end{command}
+\begin{command}{\pgfsys@animation@repeat\marg{number of times}}
+ Specifies that the animation should repeat the specified \meta{number of
+ times}, which may be a fractional number.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyrepeat{2.5}
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\end{command}
+
+\begin{command}{\pgfsysanimkeyrepeatindefinite}
+\end{command}
+\begin{command}{\pgfsys@animation@repeat@indefinite}
+ Specifies that the animation should repeat indefinitely.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyrepeatindefinite
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\end{command}
+
+\begin{command}{\pgfsysanimkeyrepeatdur\meta{seconds}}
+\end{command}
+\begin{command}{\pgfsys@animation@repeat@dur\meta{seconds}}
+ Specifies that the animation should repeat until \meta{seconds} have
+ elapsed.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyrepeatdur{5}
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\end{command}
+
+
+\subsection{Commands for Specifying Timing: Beginning and Ending}
+
+Normally, animations start when a graphic is displayed. Using the following
+commands, you can change this behavior: For instance, you can specify that the
+animation should start when, say, some button has been pressed or a key has
+been hit. Similarly, you can also use the commands to specify that the
+animation should stop early, for instance when a button is pressed.
+
+Note that all of the commands for specifying a nonstandard begin (or end) of an
+animation's timeline refer to when the time $0\,\mathrm s$ of the timeline
+should actually be. If the first time--value point for a timeline is at, say,
+2\,s and you specify that the begin of the animation is one second after the
+click of a button, the attribute will attain the value specified by the
+time--value point three seconds after the button has been pressed.
+
+All of the following commands take either the text |begin| or |end| as their
+last argument.
+
+You can call the commands several times. This will result in several different
+possible beginnings (or endings).
+
+\begin{command}{\pgfsysanimkeyoffset\marg{time offset}\marg{begin or end}}
+\end{command}
+\begin{command}{\pgfsys@animation@offset\marg{time offset}\marg{begin or end}}
+ Specifies that (in addition to any other beginnings or endings) the
+ animation's timeline should begin (or end) \meta{time offset} many seconds
+ after the graphic is shown. For instance, in the next example the animation
+ will start automatically after 5\,s \emph{or} when then button is pressed.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm,render
+ instead={
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyoffset{5}{begin}
+ \pgfsysanimkeysnapshotstart{5}
+ \pgfsysanimate{translate} }
+ }]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyoffset{5}{begin}
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\end{command}
+
+\begin{command}{\pgfsysanimkeysyncbegin\marg{sync base id}\marg{type}\marg{time offset}\marg{begin or end}}
+\end{command}
+\begin{command}{\pgfsys@animation@syncbegin\marg{sync base id}\marg{type}\marg{time offset}\marg{begin or end}}
+ Specifies that the animation should begin \meta{time offset} many seconds
+ after the \meta{sync base id} with the given \meta{type} has begun. Here,
+ the \meta{sync base id} must have been obtained using |\pgfsys@new@id|.
+
+ The idea behind a sync base is that you setup an animation and name it,
+ other animations can start alongside this animation. An animation whose
+ sole purpose is to orchestrate other animations in this way is called a
+ \emph{sync base}.
+\end{command}
+
+\begin{command}{\pgfsysanimkeysyncend\marg{sync base id}\marg{type}\marg{time offset}\marg{begin or end}}
+\end{command}
+\begin{command}{\pgfsys@animation@syncend\marg{sync base id}\marg{type}\marg{time offset}\marg{begin or end}}
+ Works like |\pgfsysanimkeysyncbegin| only the animation begin (or ends)
+ when the sync base ends.
+\end{command}
+
+\begin{command}{\pgfsysanimkeyevent\marg{id}\marg{type}\marg{event name}\marg{time offset}\marg{begin or end}}
+\end{command}
+\begin{command}{\pgfsys@animation@event\marg{id}\marg{type}\marg{event name}\marg{time offset}\marg{begin or end}}
+ Specifies that the animation should begin (or end) \meta{time offset} many
+ seconds after a certain \emph{event} has occurred. Which events are
+ possible depends on the specific output language, here are the events
+ currently supported in \textsc{svg}:
+ %
+ \begin{itemize}
+ \item |click| occurs when the object with the given \meta{id} and
+ \meta{type} has been clicked.
+ \item |focusin| and |focusout| occur when the focus enters or leaves
+ the object.
+ \item |mouseup|, |mousedown|, |mouseover|, |mousemove|, and |mouseout|
+ occur when the mouse is pressed up or down on the object, moved
+ onto the object, moved over the object, or moved off the object.
+ \end{itemize}
+ %
+\begin{codeexample}[width=2cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyevent{\nodeid}{}{mouseup}{}{begin}
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\begin{codeexample}[width=2cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyevent{\nodeid}{}{mousedown}{}{begin}
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\begin{codeexample}[width=2cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyevent{\nodeid}{}{mouseover}{}{begin}
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\begin{codeexample}[width=2cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyevent{\nodeid}{}{mousemove}{}{begin}
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\begin{codeexample}[width=2cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyevent{\nodeid}{}{mouseout}{}{begin}
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\end{command}
+
+\begin{command}{\pgfsysanimkeyrepeatevent\marg{id}\marg{type}\marg{repeat count}\marg{time offset}\marg{begin or end}}
+\end{command}
+\begin{command}{\pgfsys@animation@repeat@event\marg{id}\marg{type}\marg{repeat count}\marg{time offset}\marg{begin or end}}
+ The animation begins (or end) with a certain offset when another animation
+ has reached a certain repeat count.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-5mm}
+ \pgfsysanimkeyrepeatdur{5}
+ \pgfsys@new@id{\animationid}
+ \pgfsys@use@id{\animationid}
+ \pgfsysanimate{translate}
+ \global\let\animationid\animationid }
+\tikz {
+ \pgfidrefnextuse{\objid}{other}
+ \pgfsysanimkeyrepeatevent{\animationid}{}{2}{0}{begin}
+ \pgfsysanimkeysnapshotstart{4}
+ \pgfsysanimkeywhom{\objid}{}
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-5mm}
+ \pgfsysanimate{translate}
+ \node [fill=red, text=white, circle] (other) {Other}; }
+\end{codeexample}
+ %
+\end{command}
+
+\begin{command}{\pgfsysanimkeyaccesskey\marg{character}\marg{time offset}\marg{begin or end}}
+\end{command}
+\begin{command}{\pgfsys@animation@accesskey\marg{character}\marg{time offset}\marg{begin or end}}
+ Begin or end the animation when a certain key is pressed. Note that this
+ event may not be supported by some browsers for security reasons (prevent
+ key loggers).
+ %
+\begin{codeexample}[width=2cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyaccesskey{s}{}{begin}
+ \pgfsysanimate{translate}
+}
+\end{codeexample}
+ %
+\end{command}
+
+
+\subsection{Commands for Specifying Timing: Restart Behaviour}
+
+\begin{command}{\pgfsysanimkeyrestartalways}
+\end{command}
+\begin{command}{\pgfsys@animation@restart@always}
+ Defines that the animation can be restarted at any time. This is the
+ default.
+ %
+\begin{codeexample}[width=2cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyrestartalways
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\end{command}
+
+\begin{command}{\pgfsysanimkeyrestartnever}
+\end{command}
+\begin{command}{\pgfsys@animation@restart@never}
+ Defines that the animation cannot be restarted once it has run.
+ %
+\begin{codeexample}[width=2cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyrestartnever
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\end{command}
+
+\begin{command}{\pgfsysanimkeyrestartwhennotactive}
+\end{command}
+\begin{command}{\pgfsys@animation@restart@whennotactive}
+ Defines that the animation cannot be restarted while it is running.
+ %
+\begin{codeexample}[width=2cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyrestartwhennotactive
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\end{command}
+
+\begin{command}{\pgfsysanimkeyfreezeatend}
+\end{command}
+\begin{command}{\pgfsys@animation@freezeatend}
+ When an animation ends, the question is whether the ``effect'' of the
+ animation (like changing a color or translating the coordinate system)
+ should disappear or ``remain in force''. Using this key, you specify that
+ at the end of the animation the last value of the attributes stays in
+ effect.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyfreezeatend
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\end{command}
+
+\begin{command}{\pgfsysanimkeyremoveatend}
+\end{command}
+\begin{command}{\pgfsys@animation@removeatend{}}
+ The opposite of |\pgfsysanimkeyfreezeatend|. This is the default.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-1cm}
+ \pgfsysanimkeyremoveatend
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\end{command}
+
+
+\subsection{Commands for Specifying Accumulation}
+
+Animations specify how an attribute of an object changes over time. When more
+than one animation changes the same value at the same time, the last value
+given for the attribute ``wins'', except for animations of the canvas, which
+always accumulate. Additionally, when a repeat is specified for an attribute,
+during each repeat the values can add up:
+
+\begin{command}{\pgfsysanimkeyaccumulate{}}
+\end{command}
+\begin{command}{\pgfsys@animation@accumulate{}}
+ Specifies that each repeat of an animation works as if the last values
+ attained during previous repeats are added to the current value.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-5mm}
+ \pgfsysanimkeyaccumulate
+ \pgfsysanimkeyrepeatdur{5}
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\end{command}
+
+\begin{command}{\pgfsysanimkeynoaccumulate{}}
+\end{command}
+\begin{command}{\pgfsys@animation@noaccumulate{}}
+ Specifies that each repeat resets the to-be-animated value. This is the
+ default.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5,6,7,8},width=6cm]
+\animationexample{node}{}{
+ \pgfsysanimkeytime{0}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{0cm}
+ \pgfsysanimkeytime{2}{1}{1}{0}{0}
+ \pgfsysanimvaltranslate{0cm}{-5mm}
+ \pgfsysanimkeynoaccumulate
+ \pgfsysanimkeyrepeatdur{5}
+ \pgfsysanimate{translate} }
+\end{codeexample}
+ %
+\end{command}
+
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: "pgfmanual"
+%%% End:
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 7030e1f96ac..ae982952815 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
@@ -12,31 +12,27 @@
\makeatletter
-
\subsection{Beginning and Ending a Stream of System Commands}
-A ``user'' of the \pgfname\ system layer (like the basic layer or a
-frontend) will interface with the system layer by calling a stream of
-commands starting with |\pgfsys@|. From the system layer's point of
-view, these commands form a long stream. Between calls to the system
-layer, control goes back to the user.
+A ``user'' of the \pgfname\ system layer (like the basic layer or a frontend)
+will interface with the system layer by calling a stream of commands starting
+with |\pgfsys@|. From the system layer's point of view, these commands form a
+long stream. Between calls to the system layer, control goes back to the user.
-The driver files implement system layer commands by inserting
-|\special| commands that implement the desired operation. For example,
-|\pgfsys@stroke| will be mapped to |\special{pdf: S}| by the driver
-file for |pdftex|.
+The driver files implement system layer commands by inserting |\special|
+commands that implement the desired operation. For example, |\pgfsys@stroke|
+will be mapped to |\special{pdf: S}| by the driver file for |pdftex|.
-For many drivers, when such a stream of specials starts, it is
-necessary to install an appropriate transformation and perhaps perform
-some more bureaucratic tasks. For this reason, every stream will start
-with a |\pgfsys@beginpicture| and will end with a corresponding ending
-command.
+For many drivers, when such a stream of specials starts, it is necessary to
+install an appropriate transformation and perhaps perform some more
+bureaucratic tasks. For this reason, every stream will start with a
+|\pgfsys@beginpicture| and will end with a corresponding ending command.
\begin{command}{\pgfsys@beginpicture}
- Called at the beginning of a |{pgfpicture}|. This command should
- ``set up things.''
+ Called at the beginning of a |{pgfpicture}|. This command should ``set up
+ things''.
- Most drivers will need to implement this command.
+ Most drivers will need to implement this command.
\end{command}
\begin{command}{\pgfsys@endpicture}
@@ -46,148 +42,167 @@ command.
\end{command}
\begin{command}{\pgfsys@typesetpicturebox\marg{box}}
- Called \emph{after} a |{pgfpicture}| has been typeset. The picture
- will have been put in box \meta{box}. This command should insert the
- box into the normal text. The box \meta{box} will still be a ``raw''
- 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.
+ Called \emph{after} a |{pgfpicture}| has been typeset. The picture will
+ have been put in box \meta{box}. This command should insert the box into
+ the normal text. The box \meta{box} will still be a ``raw'' 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.
- This command has a default implementation and need not be
- implemented by a driver file.
+ This command has a default implementation and need not be implemented by a
+ driver file.
\end{command}
\begin{command}{\pgfsys@beginpurepicture}
- 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.
+ 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.
- This command has a default implementation and need not be
- implemented by a driver file.
+ 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}|.
+ Called at the end of a ``pure'' |{pgfpicture}|.
- This command has a default implementation and need not be
- implemented by a driver file.
+ This command has a default implementation and need not be implemented by a
+ driver file.
\end{command}
-Inside a stream it is sometimes necessary to ``escape'' back into
-normal typesetting mode; for example to insert some normal text, but
-with all of the current transformations and clippings being in
-force. For this escaping, the following command is used:
+Inside a stream it is sometimes necessary to ``escape'' back into normal
+typesetting mode; for example to insert some normal text, but with all of the
+current transformations and clippings being in 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}|.
+ Called to insert a (horizontal) TeX box inside a |{pgfpicture}|.
- Most drivers will need to (re-)implement this command.
+ 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 coordinate transformation
- matrix synced with the canvas transformation matrix.
+ Called to insert a (horizontal) TeX box inside a |{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
- implementation of this command will use a ``TeX-translation'' for
- the translation part of the transformation matrix. This will ensure
- that hyperlinks ``survive'' at least translations. On the other
- hand, a driver may choose to revert to a simpler
- implementation. This is done, for example, for the \textsc{svg}
- implementation, where a \TeX-translation makes no sense.
+ This command should do the same as if you used |\pgflowlevelsynccm|
+ followed by |\pgfsys@hbox|. However, the default implementation of this
+ command will use a ``TeX-translation'' for the translation part of the
+ transformation matrix. This will ensure that hyperlinks ``survive'' at
+ least translations. On the other hand, a driver may choose to revert to a
+ simpler implementation. This is done, for example, for the \textsc{svg}
+ implementation, where a \TeX-translation makes no sense.
\end{command}
\begin{command}{\pgfsys@pictureboxsynced\marg{box number}}
- Basically, this should do the same as doing a (scoped) low level sync
- followed by inserting the box \meta{box number} directly into the
- output stream. However, the default implementation uses
- |\pgfsys@hboxsynced| in conjunction with |\pgfsys@beginpicture| to
- ensure that, if possible, hyperlinks survive in
- \textsc{pdf}s. Drivers that are sensitive to picture-in-picture
- scopes should replace this implementation by
+ Basically, this should do the same as doing a (scoped) low level sync
+ followed by inserting the box \meta{box number} directly into the output
+ stream. However, the default implementation uses |\pgfsys@hboxsynced| in
+ conjunction with |\pgfsys@beginpicture| to ensure that, if possible,
+ hyperlinks survive in \textsc{pdf}s. Drivers that are sensitive to
+ picture-in-picture scopes should replace this implementation by
+ %
\begin{codeexample}[code only]
\pgfsys@beginscope\pgflowlevelsynccm\box#1\pgfsys@endscope
\end{codeexample}
+ %
\end{command}
+\subsection{Scoping System Commands}
+
+The scoping commands are used to keep changes of the graphics state 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 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.
+
+ This command is protocolled, see Section~\ref{section-protocols}.
+\end{command}
+
+\begin{command}{\pgfsys@endscope}
+ Restores the last saved graphic state.
+
+ This command is protocolled, see Section~\ref{section-protocols}.
+\end{command}
+
\subsection{Path Construction System Commands}
\begin{command}{\pgfsys@moveto\marg{x}\marg{y}}
- This command is used to start a path at a specific point
- $(x,y)$ or to move the current point of the current path to $(x,y)$
- without drawing anything upon stroking (the current path is
- ``interrupted'').
-
- Both \meta{x} and \meta{y} are given as \TeX\ dimensions. It is the
- driver's job to transform these to the coordinate system of the
- backend. Typically, this means converting the \TeX\ dimension into a
- dimensionless multiple of $\frac{1}{72}\mathrm{in}$. The function
- |\pgf@sys@bp| helps with this conversion.
-
- \example Draw a line from $(10\mathrm{pt},10\mathrm{pt})$ to the
- origin of the picture.
+ This command is used to start a path at a specific point $(x,y)$ or to move
+ the current point of the current path to $(x,y)$ without drawing anything
+ upon stroking (the current path is ``interrupted'').
+
+ Both \meta{x} and \meta{y} are given as \TeX\ dimensions. It is the
+ driver's job to transform these to the coordinate system of the backend.
+ Typically, this means converting the \TeX\ dimension into a dimensionless
+ multiple of $\frac{1}{72}\mathrm{in}$. The function |\pgf@sys@bp| helps
+ with this conversion.
+
+ \example Draw a line from $(10\mathrm{pt},10\mathrm{pt})$ to the origin of
+ the picture.
+ %
\begin{codeexample}[code only]
\pgfsys@moveto{10pt}{10pt}
\pgfsys@lineto{0pt}{0pt}
\pgfsys@stroke
\end{codeexample}
- This command is protocolled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
-
\begin{command}{\pgfsys@lineto\marg{x}\marg{y}}
- Continue the current path to $(x,y)$ with
- a straight line.
+ Continue the current path to $(x,y)$ with a straight line.
- This command is protocolled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
-
\begin{command}{\pgfsys@curveto\marg{$x_1$}\marg{$y_1$}\marg{$x_2$}\marg{$y_2$}\marg{$x_3$}\marg{$y_3$}}
- Continue the current path to $(x_3,y_3)$
- with a B\'ezier curve that has the two control points $(x_1,y_1)$ and $(x_2,y_2)$.
+ Continue the current path to $(x_3,y_3)$ with a Bézier curve that has the
+ two control points $(x_1,y_1)$ and $(x_2,y_2)$.
- \example Draw a good approximation of a quarter circle:
+ \example Draw a good approximation of a quarter circle:
+ %
\begin{codeexample}[code only]
\pgfsys@moveto{10pt}{0pt}
\pgfsys@curveto{10pt}{5.55pt}{5.55pt}{10pt}{0pt}{10pt}
\pgfsys@stroke
\end{codeexample}
- This command is protocolled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
-
\begin{command}{\pgfsys@rect\marg{x}\marg{y}\marg{width}\marg{height}}
- Append a rectangle to the current path whose lower left corner is
- at $(x,y)$ and whose width and height in
- big points are given by \meta{width} and \meta{height}.
+ Append a rectangle to the current path whose lower left corner is at
+ $(x,y)$ and whose width and height in big points are given by \meta{width}
+ and \meta{height}.
- 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.
+ 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.
- This command is protocolled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
-
\begin{command}{\pgfsys@closepath}
- Close the current path. This results in joining the current point of
- the path with the point specified by the last |\pgfsys@moveto|
- operation. Typically, this is preferable over using |\pgfsys@lineto|
- to the last point specified by a |\pgfsys@moveto|, since the line
- starting at this point and the line ending at this point will be
- smoothly joined by |\pgfsys@closepath|.
-
- \example Consider
+ Close the current path. This results in joining the current point of the
+ path with the point specified by the last |\pgfsys@moveto| operation.
+ Typically, this is preferable over using |\pgfsys@lineto| to the last point
+ specified by a |\pgfsys@moveto|, since the line starting at this point and
+ the line ending at this point will be smoothly joined by
+ |\pgfsys@closepath|.
+
+ \example Consider
+ %
\begin{codeexample}[code only]
\pgfsys@moveto{0pt}{0pt}
\pgfsys@lineto{10bp}{10bp}
@@ -195,7 +210,9 @@ force. For this escaping, the following command is used:
\pgfsys@closepath
\pgfsys@stroke
\end{codeexample}
- and
+ %
+ and
+ %
\begin{codeexample}[code only]
\pgfsys@moveto{0bp}{0bp}
\pgfsys@lineto{10bp}{10bp}
@@ -204,879 +221,1060 @@ force. For this escaping, the following command is used:
\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.
+ 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 protocolled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
-
-
\subsection{Canvas Transformation System Commands}
\begin{command}{\pgfsys@transformcm\marg{a}\marg{b}\marg{c}\marg{d}\marg{e}\marg{f}}
- 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
+ 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
- \example |\pgfsys@transformcm{1}{0}{0}{1}{1cm}{1cm}|.
+ \example |\pgfsys@transformcm{1}{0}{0}{1}{1cm}{1cm}|.
- This command is protocolled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
-
\begin{command}{\pgfsys@transformshift\marg{x displacement}\marg{y displacement}}
- This command will change the origin of the canvas to $(x,y)$.
+ This command will change the origin of the canvas to $(x,y)$.
- This command has a default implementation and need not be
- implemented by a driver file.
+ This command has a default implementation and need not be implemented by a
+ driver file.
- This command is protocolled, 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}}
- This command will scale the canvas (and everything that is drawn)
- by a factor of \meta{x scale} in the $x$-direction and \meta{y
- scale} in the $y$-direction. Note that this applies to
- everything, including lines. So a scaled line will have a different
- width and may even have a different width when going along the
- $x$-axis and when going along the $y$-axis, if the scaling is
- different in these directions. Usually, you do not want this.
+ This command will scale the canvas (and everything that is drawn) by a
+ factor of \meta{x scale} in the $x$-direction and \meta{y scale} in the
+ $y$-direction. Note that this applies to everything, including lines. So a
+ scaled line will have a different width and may even have a different width
+ when going along the $x$-axis and when going along the $y$-axis, if the
+ scaling is different in these directions. Usually, you do not want this.
- This command has a default implementation and need not be
- implemented by a driver file.
+ This command has a default implementation and need not be implemented by a
+ driver file.
- This command is protocolled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
+\begin{command}{\pgfsys@viewboxmeet\marg{$x_1$}\marg{$y_1$}\marg{$x_2$}\marg{$y_2$}%
+ \marg{$x'_1$}\marg{$y'_1$}\marg{$x'_2$}\marg{$y'_2$}%
+}
+ Starts a ``view box'' scope, which must be ended using |\pgfsys@endviewbox|
+ later on (with matching scopes).
-\subsection{Stroking, Filling, and Clipping System Commands}
+ The effect of this command is as follows: Consider the rectangles $R$ with
+ lower left corner $(x_1,y_1)$ and upper right corner $(x_2,y_2)$ and $R'$
+ with corners $(x'_1,y'_1)$ and $(x'_2,y'_2)$. The command will install a
+ canvas translation and uniform scaling such that $R'$ then has the same
+ center as~$R$ and additionally, has maximum size such that it still fits
+ inside~$R$. (Think of this as ``viewing'' $R'$ through $R$ such that the
+ aspect ratio is kept.)
-\begin{command}{\pgfsys@stroke}
- Stroke the current path (as if it were drawn with a pen). A number
- of graphic state parameters influence this, which can be
- set using appropriate system commands described later.
-
- \begin{description}
- \item[Line width]
- The ``thickness'' of the line. A width of 0 is the thinnest width
- renderable on the device. On a high-resolution printer this may
- become invisible and should be avoided. A good choice is 0.4pt,
- which is the default.
-
- \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
- lines exactly at the end (or start) point without anything
- added. A rectangular cap ends the lines like the butt cap, but the
- 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
- lines and then fills the join minimally so that it becomes
- 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 has a default implementation. Its main purpose is to allow
+ animations of the view box; for static drawings it is better to compute the
+ necessary transformations directly.
+\end{command}
- This command is protocolled, see Section~\ref{section-protocols}.
+\begin{command}{\pgfsys@viewboxslice\marg{$x_1$}\marg{$y_1$}\marg{$x_2$}\marg{$y_2$}%
+ \marg{$x'_1$}\marg{$y'_1$}\marg{$x'_2$}\marg{$y'_2$}%
+}
+ Works like the previous command, but now $R'$ has minimal size such that it
+ encompasses all of $R$.
\end{command}
+\begin{command}{\pgfsys@endviewbox}
+ Ends a viewbox previously started using |\pgfsys@viewboxmeet| or the
+ |...slice| variant.
+\end{command}
+
+
+\subsection{Stroking, Filling, and Clipping System Commands}
+
+\begin{command}{\pgfsys@stroke}
+ Stroke the current path (as if it were drawn with a pen). A number of
+ graphic state parameters influence this, which can be set using appropriate
+ system commands described later.
+ %
+ \begin{description}
+ \item[Line width] The ``thickness'' of the line. A width of 0 is the
+ thinnest width renderable on the device. On a high-resolution
+ printer this may become invisible and should be avoided. A good
+ choice is 0.4pt, which is the default.
+ \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 lines exactly at the end (or start) point without anything
+ added. A rectangular cap ends the lines like the butt cap, but the
+ 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 lines and then fills the join minimally so that it becomes
+ 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 protocolled, see Section~\ref{section-protocols}.
+\end{command}
\begin{command}{\pgfsys@closestroke}
- This command should have the same effect as first closing the path
- and then stroking it.
+ This command should have the same effect as first closing the path and then
+ stroking it.
- This command has a default implementation and need not be
- implemented by a driver file.
+ This command has a default implementation and need not be implemented by a
+ driver file.
- This command is protocolled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@fill}
- This command fills the area surrounded by the current path. If the
- path has not yet been closed, it is closed prior to filling. The
- path itself is not stroked. For self-intersecting paths or paths
- consisting of multiple parts, the nonzero winding number rule is
- 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.)
-
- 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.
-
- \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.
- \end{description}
-
- 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 protocolled, see Section~\ref{section-protocols}.
+ This command fills the area surrounded by the current path. If the path has
+ not yet been closed, it is closed prior to filling. The path itself is not
+ stroked. For self-intersecting paths or paths consisting of multiple parts,
+ the nonzero winding number rule is 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.)
+
+ 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.
+ \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.
+ \end{description}
+
+ 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 protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@fillstroke}
- First, the path is filled, then the path is stroked. If the fill and
- stroke colors are the same (or if they are not specified and the
- current color is used), this yields almost the same as a
- |\pgfsys@fill|. However, due to the line thickness of the stroked
- path, the fill-stroked area will be slightly larger.
+ First, the path is filled, then the path is stroked. If the fill and stroke
+ colors are the same (or if they are not specified and the current color is
+ used), this yields almost the same as a |\pgfsys@fill|. However, due to the
+ line thickness of the stroked path, the fill-stroked area will be slightly
+ larger.
- 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.
+ 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 protocolled, 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.
+ 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.
- This command is protocolled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
-
\begin{command}{\pgfsys@clipnext}
- This command should be issued after a path has been constructed, but
- before it has been stroked and/or filled or discarded. When the
- command is used, the next stroking/filling/discarding command will
- first be executed normally. Then, afterwards, the just-used path
- will be used for subsequent clipping. If there has already been a
- clipping region, this region is intersected with the new clipping
- path (the clipping cannot get bigger). The nonzero winding number
- rule is used to determine whether a point is inside or outside the
- clipping area or the even-odd rule, depending on whether
- |\ifpgfsys@eorule| holds.
+ This command should be issued after a path has been constructed, but before
+ it has been stroked and/or filled or discarded. When the command is used,
+ the next stroking/filling/discarding command will first be executed
+ normally. Then, afterwards, the just-used path will be used for subsequent
+ clipping. If there has already been a clipping region, this region is
+ intersected with the new clipping path (the clipping cannot get bigger).
+ The nonzero winding number rule is used to determine whether a point is
+ inside or outside the clipping area or the even-odd rule, depending on
+ whether |\ifpgfsys@eorule| holds.
\end{command}
-
-
\subsection{Graphic State Option System Commands}
\begin{command}{\pgfsys@setlinewidth\marg{width}}
- Sets the width of lines, when stroked, to \meta{width}, which must
- be a \TeX\ dimension.
+ Sets the width of lines, when stroked, to \meta{width}, which must be a
+ \TeX\ dimension.
- This command is protocolled, 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|.
+ Sets the cap to a butt cap. See |\pgfsys@stroke|.
- This command is protocolled, 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|.
+ Sets the cap to a round cap. See |\pgfsys@stroke|.
- This command is protocolled, 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|.
+ Sets the cap to a rectangular cap. See |\pgfsys@stroke|.
- This command is protocolled, 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|.
+ Sets the join to a miter join. See |\pgfsys@stroke|.
- This command is protocolled, 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.
+ 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 protocolled, 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|.
+ Sets the join to a round join. See |\pgfsys@stroke|.
- This command is protocolled, 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|.
+ Sets the join to a bevel join. See |\pgfsys@stroke|.
- This command is protocolled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@setdash\marg{pattern}\marg{phase}}
- Sets the dashing patter. \meta{pattern} should be a list of \TeX\
- dimensions separated by commas. \meta{phase} should be a
- single dimension.
-
- \example |\pgfsys@setdash{3pt,3pt}{0pt}|
-
- The list of values in \meta{pattern} is used to determine the
- lengths of the ``on'' and ``off'' phases of the dashing. For example, if \meta{pattern} is |3bp,4bp|, then the dashing
- pattern is ``3bp on followed by 4bp off, followed by 3bp on,
- 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
- 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''
+ Sets the dashing patter. \meta{pattern} should be a list of \TeX\
+ dimensions separated by commas. \meta{phase} should be a single dimension.
- This command is protocolled, see Section~\ref{section-protocols}.
+ \example |\pgfsys@setdash{3pt,3pt}{0pt}|
+
+ The list of values in \meta{pattern} is used to determine the lengths of
+ the ``on'' and ``off'' phases of the dashing. For example, if
+ \meta{pattern} is |3bp,4bp|, then the dashing pattern is ``3bp on followed
+ by 4bp off, followed by 3bp on, 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 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 protocolled, see Section~\ref{section-protocols}.
\end{command}
{\let\ifpgfsys@eorule=\relax
\begin{command}{\ifpgfsys@eorule}
- Determines whether the even odd rule is used for filling and
- clipping or not.
+ Determines whether the even odd rule is used for filling and clipping or
+ not.
\end{command}
}
\subsection{Color System Commands}
-The \pgfname\ system layer provides a number of system commands for
-setting colors. These command coexist with commands from the |color|
-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 separately. Also, plain \TeX\ profits from the
-fact that \pgfname\ can set colors.
-
-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.
+The \pgfname\ system layer provides a number of system commands for setting
+colors. These command coexist with commands from the |color| 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 separately. Also, plain \TeX\
+profits from the fact that \pgfname\ can set colors.
+
+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
- red/green/blue tuple (numbers between 0 and 1).
+ Sets the color used for stroking and filling operations to the given
+ red/green/blue tuple (numbers between 0 and 1).
- This command is protocolled, 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).
+ Sets the color used for stroking operations to the given red/green/blue
+ tuple (numbers between 0 and 1).
- \example Make stroked text dark red: |\pgfsys@color@rgb@stroke{0.5}{0}{0}|
+ \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|.
+ The special stroking color is only used if the stroking color has been set
+ since the last |\color| or |\pgfsys@color@...| command. Thus, each |\color|
+ command will reset both the stroking and filling colors by calling
+ |\pgfsys@color@reset|.
- This command is protocolled, 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}}
- Sets the color used for filling operations to the given
- red/green/blue tuple (numbers between 0 and 1). This color may be
- different from the stroking color.
+ Sets the color used for filling operations to the given red/green/blue
+ tuple (numbers between 0 and 1). This color may be different from the
+ stroking color.
- This command is protocolled, 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
- cmyk tuple (numbers between 0 and 1).
+ Sets the color used for stroking and filling operations to the given cmyk
+ tuple (numbers between 0 and 1).
- This command is protocolled, 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 cmyk tuple
- (numbers between 0 and 1).
+ Sets the color used for stroking operations to the given cmyk tuple
+ (numbers between 0 and 1).
- This command is protocolled, 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 cmyk tuple
- (numbers between 0 and 1).
+ Sets the color used for filling operations to the given cmyk tuple (numbers
+ between 0 and 1).
- This command is protocolled, 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
- cmy tuple (numbers between 0 and 1).
+ Sets the color used for stroking and filling operations to the given cmy
+ tuple (numbers between 0 and 1).
- This command is protocolled, 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 cmy tuple
- (numbers between 0 and 1).
+ Sets the color used for stroking operations to the given cmy tuple (numbers
+ between 0 and 1).
- This command is protocolled, 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 cmy tuple
- (numbers between 0 and 1).
+ Sets the color used for filling operations to the given cmy tuple (numbers
+ between 0 and 1).
- This command is protocolled, 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.
+ 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 protocolled, 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.
+ Sets the color used for stroking operations to the given black value, where
+ 0 means black and 1 means white.
- This command is protocolled, 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.
+ Sets the color used for filling operations to the given black value, where
+ 0 means black and 1 means white.
- This command is protocolled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
\begin{command}{\pgfsys@color@reset}
- This command will be called when the |\color| command is used. It
- should purge any internal settings of stroking and filling
- color. After this call, till the next use of a command like
- |\pgfsys@color@rgb@fill|, the current color installed by the
- |\color| command should be used.
-
- If the \TeX-if |\pgfsys@color@reset@inorder| is set to true, this
- command may ``assume'' that any call to a color command that sets
- the fill or stroke color came ``before'' the call to this command
- and may try to optimize the output accordingly.
-
- An example of an incorrect ``out of order'' call would be using
- |\pgfsys@color@reset| at the beginning of a box that is constructed
- using |\setbox|. Then, when the box is constructed, no special fill
- 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.
+ This command will be called when the |\color| command is used. It should
+ purge any internal settings of stroking and filling color. After this call,
+ till the next use of a command like |\pgfsys@color@rgb@fill|, the current
+ color installed by the |\color| command should be used.
+
+ If the \TeX-if |\pgfsys@color@reset@inorder| is set to true, this command
+ may ``assume'' that any call to a color command that sets the fill or
+ stroke color came ``before'' the call to this command and may try to
+ optimize the output accordingly.
+
+ An example of an incorrect ``out of order'' call would be using
+ |\pgfsys@color@reset| at the beginning of a box that is constructed using
+ |\setbox|. Then, when the box is constructed, no special fill 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.
\end{command}
\begin{command}{\pgfsys@color@reset@inordertrue}
- Sets the optimized ``in order'' version of the color resetting. This
- is the default.
+ Sets the optimized ``in order'' version of the color resetting. This is the
+ default.
\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}}
- This slightly obscure command causes the color stack to be
- tricked. When called, this command should set the current color to
- \meta{\LaTeX\ color} without causing any change in the color stack.
+ This slightly obscure command causes the color stack to be tricked. When
+ called, this command should set the current color to \meta{\LaTeX\ color}
+ without causing any change in the color stack.
- \example |\pgfsys@color@unstacked{red}|
+ \example |\pgfsys@color@unstacked{red}|
\end{command}
-
-
\subsection{Pattern System Commands}
-
\begin{command}{\pgfsys@declarepattern
\marg{name}\marg{$x_1$}\marg{$y_1$}\marg{$x_2$}\marg{$y_2$}
- \marg{$x$ step}\marg{$y$ step}\marg{code}\marg{flag}}
- This command declares a new colored or uncolored pattern, depending
- on whether \meta{flag} is |0|, which means uncolored, or |1|, which
- means colored. Uncolored patterns have no inherent color, the color
- is provided when they are set. Colored patters have an inherent
- color.
+ \marg{$x$ step}\marg{$y$ step}\marg{code}\marg{flag}%
+}
+ This command declares a new colored or uncolored pattern, depending on
+ whether \meta{flag} is |0|, which means uncolored, or |1|, which means
+ colored. Uncolored patterns have no inherent color, the color is provided
+ when they are set. Colored patters have an inherent color.
- The \meta{name} is a name for later use when the pattern is to be
- shown. The pairs $(x_1,y_1)$ and $(x_2,y_2)$ must describe a
- bounding box of the pattern \meta{code}.
+ The \meta{name} is a name for later use when the pattern is to be shown.
+ The pairs $(x_1,y_1)$ and $(x_2,y_2)$ must describe a bounding box of the
+ pattern \meta{code}.
- The tiling step of the pattern is given by \meta{$x$ step} and
- \meta{$y$ step}.
+ The tiling step of the pattern is given by \meta{$x$ step} and \meta{$y$
+ step}.
- \example
+ \example
+ %
\begin{codeexample}[code only]
\pgfsys@declarepattern{hori}{-.5pt}{0pt}{.5pt}{3pt}{3pt}{3pt}
{\pgfsys@moveto{0pt}{0pt}\pgfsys@lineto{0pt}{3pt}\pgfsys@stroke}
{0}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfsys@setpatternuncolored\marg{name}\marg{red}\marg{green}\marg{blue}}
- Sets the fill color to the pattern named \meta{name}. This pattern
- must previously have been declared with \meta{flag} set to |0|. The
- color of the pattern is given in the parameters \meta{red},
- \meta{green}, and \meta{blue} in the usual way.
+ Sets the fill color to the pattern named \meta{name}. This pattern must
+ previously have been declared with \meta{flag} set to |0|. The color of the
+ pattern is given in the parameters \meta{red}, \meta{green}, and
+ \meta{blue} in the usual way.
- The fill color ``pattern'' will persist till the next color command
- that modifies the fill color.
+ The fill color ``pattern'' will persist till the next color command that
+ modifies the fill color.
\end{command}
\begin{command}{\pgfsys@setpatterncolored\marg{name}}
- Sets the fill color to the pattern named \meta{name}. This pattern
- must have been declared with the |1| flag.
+ Sets the fill color to the pattern named \meta{name}. This pattern must
+ have been declared with the |1| flag.
\end{command}
+\subsection{Image System Commands}
-\subsection{Scoping System Commands}
-
-The scoping commands are used to keep changes of the graphics state
-local.
+The system layer provides some commands for image inclusion.
-\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
- the old values will be restored after |\pgfsys@endscope| is used.
+\begin{command}{\pgfsys@imagesuffixlist}
+ This macro should expand to a list of suffixes, separated by `:', that will
+ be tried when searching for an image.
- \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.
+ \example |\def\pgfsys@imagesuffixlist{eps:epsi:ps}|
+\end{command}
- This command is protocolled, see Section~\ref{section-protocols}.
+\begin{command}{\pgfsys@defineimage}
+ 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.
+ \item\declare{|\pgf@imagewidth|} Will be set to the desired (scaled)
+ width of the image.
+ \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 only one 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:
+ %
+ \begin{itemize}
+ \item \declare{|\pgf@imagepage|} The desired page number to be
+ extracted from a multi-page ``image''.
+ \item\declare{|\pgf@imagemask|} 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.
+ \end{itemize}
+
+ The command should now set up 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.
+
+ This command has a default implementation and need not be implemented by a
+ driver file.
\end{command}
-\begin{command}{\pgfsys@endscope}
- Restores the last saved graphic state.
- This command is protocolled, see Section~\ref{section-protocols}.
-\end{command}
+\subsection{Shading System Commands}
+\begin{command}{\pgfsys@horishading\marg{name}\marg{height}\marg{specification}}
+ Declares a horizontal shading for later use. The effect of this 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.
+ \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 specification as specified in Section~\ref{section-shadings}. The
+ 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.
+\end{command}
+\begin{command}{\pgfsys@vertshading\marg{name}\marg{width}\marg{specification}}
+ Like the horizontal version, only for vertical shadings. This time, the
+ height of the shading is implicit in \meta{specification} and the width is
+ given as \meta{width}.
+\end{command}
+\begin{command}{\pgfsys@radialshading\marg{name}\marg{starting point}\marg{specification}}
+ Declares a radial shading. Like the previous macros, this command should
+ set up the macro |\@pgfshading|\meta{name}|!|, which upon invocation should
+ insert a radial shading whose size is implicit in \meta{specification}.
+ The parameter \meta{starting point} is a \pgfname\ point specifying the
+ inner starting point of the shading.
+\end{command}
-\subsection{Image System Commands}
+\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 should set up the
+ macro |\@pgfshading|\meta{name}|!| so that it will produce a box containing
+ the desired shading.
-The system layer provides some commands for image inclusion.
+ Parameter \meta{name} is the name of the shading. Parameter \meta{type 4
+ function} is a Postscript-like function (type 4 function of the PDF
+ specification) as described in Section~3.9.4 of the PDF specification
+ version 1.7. Parameters \meta{lower left corner} and \meta{upper right
+ corner} are \pgfname\ points that specifies the lower left and upper right
+ corners of the shading, respectively.
-\begin{command}{\pgfsys@imagesuffixlist}
- This macro should expand to a list of suffixes, separated by `:',
- that will be tried when searching for an image.
+ When \meta{type 4 function} is evaluated, the coordinate of the current
+ point will be on the (virtual) PostScript stack in bp units. After the
+ function has been evaluated, the stack should consist of three numbers (not
+ integers! -- the Apple PDF renderer is broken in this regard, so add cvrs
+ at the end if needed) that represent the red, green, and blue components of
+ the color.
- \example |\def\pgfsys@imagesuffixlist{eps:epsi:ps}|
+ A buggy function will result is \emph{totally unpredictable chaos} during
+ rendering.
\end{command}
-\begin{command}{\pgfsys@defineimage}
- 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:
+\subsection{Transparency System Commands}
- \begin{itemize}
- \item\declare{|\pgf@filename|}
- File name of the image to be defined.
+\begin{command}{\pgfsys@opacity\marg{value}}
+ Sets the opacity of all operations, treating stroking and filling as a
+ transparency group. Some drivers support this operations, others do not and
+ set the fill and stroke individually. This difference can only be seen when
+ a path is stroked and filled at the same time: When the drawing and fill
+ opacities are set individually, the effect of filling and drawing a path at
+ the same time is the same as first filling the path and then drawing it. On
+ the other, if the opacity is set using this command, the effect should
+ rather be that same as first filling and then drawing the path without any
+ opacity in an off-screen area and then copying the result to the target
+ area with a homogeneous opacity of \meta{value}.
- \item\declare{|\pgf@imagewidth|}
- Will be set to the desired (scaled) width of the image.
+ Since \textsc{pdf} does not support this form of opacity, this command is
+ only present on the system layer and not supported in the basic layer.
+\end{command}
- \item\declare{|\pgf@imageheight|}
- Will be set to the desired (scaled) height of the image.
+\begin{command}{\pgfsys@stroke@opacity\marg{value}}
+ Sets the opacity of stroking operations.
+\end{command}
- If this macro and also the height macro are empty, the image
- should have its ``natural'' size.
+\begin{command}{\pgfsys@fill@opacity\marg{value}}
+ Sets the opacity of filling operations.
+\end{command}
- If only one of them is specified, the undefined value the
- image is scaled so that the aspect ratio is kept.
+\begin{command}{\pgfsys@blend@mode\marg{value}}
+ Sets the blend mode, see Section~7.2.4 of the \textsc{pdf} Specification,
+ Version~1.7.
+\end{command}
- If both are set, the image is scaled in both directions
- independently, possibly changing the aspect ratio.
- \end{itemize}
+\begin{command}{\pgfsys@transparencygroupfrombox\marg{box}}
+ 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 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.
+\end{command}
- The following macros presumable mostly make sense for drivers that
- can handle \pdf:
+A transparency group can be \emph{isolated} and/or a \emph{knockout} group (see
+Sections~7.3.4 and 7.3.5 of the \textsc{pdf} Specification Version~1.7). Which
+of these is the case is dictated by the current settings of the following two
+ifs, which must be set before the above command is called:
- \begin{itemize}
- \item \declare{|\pgf@imagepage|}
- The desired page number to be extracted from a multi-page
- ``image.''
+{\let\ifpgfsys@transparency@group@isolated=\relax
+\begin{command}{\ifpgfsys@transparency@group@isolated}
+ Determines whether a transparency group should be isolated.
+\end{command}
+}
- \item\declare{|\pgf@imagemask|}
- 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.
+{\let\ifpgfsys@transparency@group@knockout=\relax
+\begin{command}{\ifpgfsys@transparency@group@knockout}
+ Determines whether a transparency group is a knockout group or not.
+\end{command}
+}
- \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.
- \end{itemize}
+\begin{command}{\pgfsys@fadingfrombox\marg{name}\marg{box}}
+ Declares the fading \meta{name}. The \meta{box} is a \TeX-box. Its
+ content's luminosity determines the opacity of the resulting fading. This
+ means that the lighter a pixel inside the box, the more opaque the fading
+ will be at this position.
+\end{command}
- The command should now set up 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.
+\begin{command}{\pgfsys@usefading\meta{name}\marg{a}\marg{b}\marg{c}\marg{d}\marg{e}\marg{f}}
+ Installs a previously declared fading \meta{name} in the current graphics
+ state. Afterwards, all drawings will be masked by the 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
+ transformation should not apply to the following graphics, however.
+\end{command}
- This command has a default implementation and need not be
- implemented by a driver file.
+\begin{command}{\pgfsys@definemask}
+ This command declares a fading (known as a soft mask in this context) based
+ on an image and for usage with images. It works similar to
+ |\pgfsys@defineimage|: Certain macros are set when 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:
+ %
+ \begin{itemize}
+ \item \declare{|\pgf@filename|}
+ File name of the mask to be defined.
+ \item \declare{|\pgf@maskmatte|}
+ The so-called matte of the mask (see the \pdf\ documentation for
+ details). The matte is a color specification consisting of 1, 3 or
+ 4 numbers between 0 and 1. The number of numbers depends on the
+ number of color channels in the image (not in the mask!). It will
+ be assumed that the image has been preblended with this color.
+ \end{itemize}
\end{command}
+\subsection{Animation Commands}
-\subsection{Shading System Commands}
+The animation system layer command (|\pgfsys@anim...|) are described in a
+separate section, Section~\ref{section-pgfsys-anim}.
-\begin{command}{\pgfsys@horishading\marg{name}\marg{height}\marg{specification}}
- Declares a horizontal shading for later use. The effect of this
- 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.
+\subsection{Object Identification System Commands}
+\label{section-sys-id}
+
+The system layer provides commands for adding identification labels (ids) to
+different objects in a graphic. These can be used for hyperlinking, which is
+needed for instance in conjunction with animations.
- \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
- specification as specified in Section~\ref{section-shadings}. The
- shading specification implicitly fixes the width of the shading.
+The following ``objects'' can get an id assigned to them:
+%
+\begin{enumerate}
+ \item Graphic scopes (namely when |\pgfsys@begin@idscope| is called),
+ \item view boxes (namely when |\pgfsys@viewboxmeet| or
+ |\pgfsys@viewboxslice| are called),
+ \item paths (namely when |\pgfsys@fill|, |\pgfsys@stroke|, and so on are
+ called),
+ \item text boxes (namely when |\pgfsys@hbox| or |\pgfsys@hboxsynced| is
+ called), and
+ \item animations (namely when |\pgfsys@animate| is called).
+\end{enumerate}
+
+Creating and using ids is a two-step process. First, you create the id using
+|\pgfsys@new@id|, which stores a fresh id in a macro. You can now pass this id
+around and clone it. Then, at some point, you wish one of the above objects to
+actually get this id. For this, you use |\pgfsys@use@id| just \emph{before} the
+object since this command always influences the \emph{next} object.
+
+The basic id management gets more powerful when you use \emph{id types}. The
+idea is as follows: In reality, the objects from above do not get assigned only
+an id, but rather a combination of an id and a type -- and you can set the type
+independently of the id. This is used, for instance, to allow easy access to
+the different parts of a node in animations: Each node has a single id, but
+consists of several graphic objects (normally, at least a background path and a
+text). Each of these uses the same underlying id of the node, but the path has
+the type |path| (actually |background.path|) while the text has the type
+|text|. The advantage is that for each node only one id must be stored instead
+of a great number of the many different possible parts of a node.
- When |\@pgfshading|\meta{name}|!| is invoked, it should insert a box
- of height \meta{height} and the width implicit in the shading
- declaration.
+\begin{command}{\pgfsys@new@id\marg{macro}}
+ Creates a new id for later use and stores it in \meta{macro}. It is an
+ internal text created by the driver and may not be changed or modified.
\end{command}
+\begin{command}{\pgfsys@use@id\marg{id}}
+ ``Uses'' an id previously created using |\pgfsys@new@id|. This causes the
+ \emph{next} graphic object to get the \meta{id} (not the current one). Once
+ used, the id-type-pair becomes \emph{invalid} and will not be attached to
+ any other graphics objects. It is, however, not an error to try this. If
+ \meta{id} is empty, no id-type-pair is attached to the next object.
+\end{command}
-\begin{command}{\pgfsys@vertshading\marg{name}\marg{width}\marg{specification}}
- Like the horizontal version, only for vertical shadings. This time,
- the height of the shading is implicit in \meta{specification} and
- the width is given as \meta{width}.
+\begin{command}{\pgfsys@use@type\marg{type}}
+ Changes the type used with the next graphic object. As mentioned earlier,
+ the id assigned to the next object is actually a pair consisting of the
+ currently used id and the currently used type.
\end{command}
-\begin{command}{\pgfsys@radialshading\marg{name}\marg{starting point}\marg{specification}}
- Declares a radial shading. Like the previous macros, this command
- should set up the macro |\@pgfshading|\meta{name}|!|, which upon
- invocation should insert a radial shading whose size is implicit in
- \meta{specification}.
+\begin{command}{\pgfsys@append@type\marg{text}}
+ Appends the \meta{text} to the current type.
+\end{command}
- The parameter \meta{starting point} is a \pgfname\ point
- specifying the inner starting point of the shading.
+\begin{command}{\pgfsys@push@type}
+ Pushes the current type on a global ``stack of types'' without opening a
+ \TeX\ scope. The is useful when you temporarily wish to change the type
+ (for instance, by appending something to it), but you cannot create a new
+ scope.
\end{command}
+\begin{command}{\pgfsys@pop@type}
+ Restores the most recently pushed type.
+\end{command}
-\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
- should set up the macro |\@pgfshading|\meta{name}|!| so that it will
- produce a box containing the desired shading.
+\begin{command}{\pgfsys@begin@idscope}
+ Starts a (graphics) scope whose sole purpose is to assign it an
+ id-type-pair so that it can be referenced later. Note that this command
+ does not always produce a graphics scope: If not id is currently in use or
+ if the id-type-pair has already been used, a graphic scope may or may not
+ be created as defined by the driver (but always a \TeX\ scope). This allows
+ drivers to minimize the number of graphic scopes created.
- Parameter \meta{name} is the name of the shading. Parameter
- \meta{type 4 function} is a
- Postscript-like function (type 4 function of the PDF specification)
- as described in Section 3.9.4 of the PDF specification version 1.7.
- Parameters \meta{lower left corner} and \meta{upper right corner} are
- \pgfname\ points that specifies the lower left and upper right
- corners of the shading, respectively.
+ When an id scope is created, any code that has been ``attached'' to it
+ using |\pgfsys@attach@to@id| gets executed, see that command.
- When \meta{type 4 function} is evaluated, the coordinate of the current
- point will be on the (virtual) PostScript stack in bp units. After
- the function has been evaluated, the stack should consist of three
- numbers (not integers! -- the Apple PDF renderer is broken in this
- regard, so add cvrs at the end if needed) that represent the red,
- green, and blue components of the color.
+ Note that |\pgfsys@beginscope| does not use the current id-type-pair. You
+ need to call this command to attach an id to a group.
+\end{command}
- A buggy function will result is \emph{totally unpredictable chaos} during
- rendering.
+\begin{command}{\pgfsys@end@idscope}
+ Ends the graphics id scope started by |\pgfsys@end@idscope|. It must nest
+ correctly with other graphic scopes and \TeX\ scopes.
\end{command}
+\begin{command}{\pgfsys@attach@to@id\marg{id}\marg{type}\marg{begin code}\marg{end code}\marg{setup code}}
+ Attaches codes to the \meta{id}-\meta{type}-pair, where \meta{id} must have
+ been created using |\pgfsys@new@id|. The effect is that just before the id
+ scope for this pair is created, the \meta{setup code} is executed, then the
+ scope is started, then the \meta{begin code} is executed at the beginning,
+ and, finally, \meta{end code} gets executed just before the scope ends.
+ Multiple calls of this macro accumulated.
+\end{command}
-\subsection{Transparency System Commands}
+\subsection{Resource Description Framework Annotations (RDFa)}
+\label{section-sys-rdf}
-\begin{command}{\pgfsys@stroke@opacity\marg{value}}
- Sets the opacity of stroking operations.
-\end{command}
+With certain output formats (in particular, with \textsc{svg}) you can insert
+annotations into the output file following the standard set by the
+\emph{resource description framework} (\textsc{rdf}), please consult the
+literature on \textsc{rdf} for an introduction to resource descriptions and
+ontologies.
-\begin{command}{\pgfsys@fill@opacity\marg{value}}
- Sets the opacity of filling operations.
+The support for \textsc{rdf} annotations works as follows in \pgfname: You use
+the following commands before you create an id scope (using
+|\pgfsys@begin@idscope|). Then the attributes set by the commands will be added
+as an annotation to that object. Here is an example:
+%
+\begin{codeexample}[code only]
+\pgfsys@rdf@resource{/fruits/apple}
+\pgfsys@begin@idscope
+ ...
+\pgfsys@end@idscope
+\end{codeexample}
+
+If \textsc{svg} output is produced, this results in the following code in the
+\textsc{svg} file:
+%
+\begin{codeexample}[code only]
+<g resource="/fruits/apple">
+ ...
+</g>
+\end{codeexample}
+
+Note that a call to |\pgfsys@begin@idscope| adds all the set attributes, but
+then clears the settings (globally). Thus, you should set all attributes more
+or less right before the id scope is created. For most of these command, if you
+call them multiple times before starting the id scope, the ``last call wins'',
+that is, later values overwrite earlier ones. In contrast, for the commands
+|\pgfsys@rdf@property|, |\pgfsys@rdf@rel|, |\pgfsys@rdf@rev|, as well as
+|\pgfsys@rdf@typeof|, the calls accumulate, that is, the texts passed in each
+call will all be added to the output, properly separated to form a list of
+values. Consider for instance:
+%
+\begin{codeexample}[code only]
+\pgfsys@rdf@resource{/fruits/apple}
+\pgfsys@rdf@resource{/fruits/watermelon}
+\pgfsys@rdf@property{http://foo.com/props/juicy}
+\pgfsys@rdf@property{http://foo.com/props/green}
+\pgfsys@begin@idscope
+ ...
+\pgfsys@end@idscope
+\end{codeexample}
+
+In the resulting id scope, we will have:
+%
+\begin{codeexample}[code only]
+<g resource="/fruits/watermelon"
+ property="http://foo.com/props/juicy http://foo.com/props/green">
+ ...
+</g>
+\end{codeexample}
+
+\begin{command}{\pgfsys@rdf@about\marg{text}}
+ Adds the \textsc{rdf} attribute |about="|\meta{text}|"| to the next id
+ scope (please see the \textsc{rdf}a specification for details on the
+ semantics of |about| in the context of the resource description framework).
\end{command}
-\begin{command}{\pgfsys@blend@mode\marg{value}}
- Sets the blend mode, see Section 7.2.4 of the \textsc{pdf}
- Specification, Version 1.7.
+The following commands work the same way as the above command, except that the
+set attribute is different. Please see the \textsc{rdf}a specification for
+details on these attributes. Note that the |\pgfsys@rdf@inlist| command is the
+only one that takes no argument.
+
+\begin{command}{\pgfsys@rdf@content\marg{text}}
\end{command}
-\begin{command}{\pgfsys@transparencygroupfrombox\marg{box}}
- 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 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.
-\end{command}
-
-A transparency group can be \emph{isolated} and/or a \emph{knockout}
-group (see Sections 7.3.4 and 7.3.5 of the \textsc{pdf}
-Specification Version 1.7). Which of these is the case is dictated
-by the current settings of the following two ifs, which must be set
-before the above command is called:
-
-{\let\ifpgfsys@transparency@group@isolated=\relax
-\begin{command}{\ifpgfsys@transparency@group@isolated}
- Determines whether a transparency group should be isolated.
+\begin{command}{\pgfsys@rdf@datatype\marg{text}}
\end{command}
-}
-{\let\ifpgfsys@transparency@group@knockout=\relax
-\begin{command}{\ifpgfsys@transparency@group@knockout}
- Determines whether a transparency group is a knockout group or not.
+\begin{command}{\pgfsys@rdf@href\marg{text}}
\end{command}
-}
+\begin{command}{\pgfsys@rdf@inlist}
+\end{command}
-
-\begin{command}{\pgfsys@fadingfrombox\marg{name}\marg{box}}
- Declares the fading \meta{name}. The \meta{box} is a \TeX-box. Its
- content's luminosity determines the opacity of the resulting
- fading. This means that the lighter a pixel inside the box, the more
- opaque the fading will be at this position.
+\begin{command}{\pgfsys@rdf@prefix\marg{text}}
\end{command}
-\begin{command}{\pgfsys@usefading\meta{name}\marg{a}\marg{b}\marg{c}\marg{d}\marg{e}\marg{f}}
- Installs a previously declared fading \meta{name} in the current
- graphics state. Afterwards, all drawings will be masked by the
- 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 transformation should not
- apply to the following graphics, however.
+\begin{command}{\pgfsys@rdf@property\marg{text}}
\end{command}
+\begin{command}{\pgfsys@rdf@rel\marg{text}}
+\end{command}
-\begin{command}{\pgfsys@definemask}
- This command declares a fading (known as a soft mask in this
- context) based on an image and for usage with images. It
- works similar to |\pgfsys@defineimage|: Certain macros are set when
- 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:
+\begin{command}{\pgfsys@rdf@resource\marg{text}}
+\end{command}
- \begin{itemize}
- \item \declare{|\pgf@filename|}
- File name of the mask to be defined.
+\begin{command}{\pgfsys@rdf@rev\marg{text}}
+\end{command}
- \item \declare{|\pgf@maskmatte|}
- The so-called matte of the mask (see the \pdf\ documentation for
- details). The matte is a color specification consisting of 1, 3 or
- 4 numbers between 0 and 1. The number of numbers depends on the
- number of color channels in the image (not in the mask!). It will
- be assumed that the image has been preblended with this color.
- \end{itemize}
+\begin{command}{\pgfsys@rdf@src\marg{text}}
\end{command}
+\begin{command}{\pgfsys@rdf@typeof\marg{text}}
+\end{command}
+\begin{command}{\pgfsys@rdf@vocab\marg{text}}
+\end{command}
\subsection{Reusable Objects System Commands}
\begin{command}{\pgfsys@invoke\marg{literals}}
- This command gets protocolled literals and should insert them into
- the |.pdf| or |.dvi| file using an appropriate |\special|.
+ This command gets protocolled literals and should insert them into the
+ |.pdf| or |.dvi| file using an appropriate |\special|.
\end{command}
-\begin{command}{\pgfsys@defobject\marg{name}\marg{lower
- left}\marg{upper right}\marg{code}}
- Declares an object for later use. The idea is that the object can be
- 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.
+\begin{command}{\pgfsys@defobject\marg{name}\marg{lower left}\marg{upper right}\marg{code}}
+ Declares an object for later use. The idea is that the object can be
+ 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
- should not be too fancy.
+ 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 should not be too
+ fancy.
- This command has a default implementation and need not be
- implemented by a driver file.
+ This command has a default implementation and need not be implemented by a
+ driver file.
\end{command}
\begin{command}{\pgfsys@useobject\marg{name}\marg{extra code}}
- Renders a previously declared object. The first parameter is the
- 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.
+ Renders a previously declared object. The first parameter is the 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.
- This command has a default implementation and need not be
- implemented by a driver file.
+ This command has a default implementation and need not be implemented by a
+ driver file.
+\end{command}
+
+\begin{command}{\pgfsys@marker@declare\marg{macro}\marg{code}}
+ Declares a \emph{marker} symbol for later use. The command is very similar
+ to |\pgfsys@defobject|, but the use case is slightly different: The graphic
+ object defined using the \meta{code} is stored in such a way that it can be
+ used as an \emph{arrow tip marker symbol} in animations. The \meta{macro}
+ is set to an identifier by which the marker can be referenced later on.
+
+ This command has a default implementation and need not be implemented by a
+ driver file.
+\end{command}
+
+\begin{command}{\pgfsys@marker@use\marg{macro}}
+ Adds the marker object referenced by the \meta{macro} to the current
+ output.
+
+ This command has a default implementation and need not be implemented by a
+ driver file.
\end{command}
\subsection{Invisibility System Commands}
-All drawing or stroking or text rendering between calls of the
-following commands should be suppressed. A similar effect can be
-achieved by clipping against an empty region, but the following
-commands do not open a graphics scope and can be opened and closed
-``orthogonally'' to other scopes.
+All drawing or stroking or text rendering between calls of the following
+commands should be suppressed. A similar effect can be achieved by clipping
+against an empty region, but the following commands do not open a graphics
+scope and can be opened and closed ``orthogonally'' to other scopes.
\begin{command}{\pgfsys@begininvisible}
- Between this command and the closing |\pgfsys@endinvisible| all
- 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.
+ Between this command and the closing |\pgfsys@endinvisible| all 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.
- This command has a default implementation and need not be
- implemented by a driver file.
+ This command has a default implementation and need not be implemented by a
+ driver file.
- This command is protocolled, 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.
+ Ends the invisibility section, unless invisibility blocks have been nested.
+ In this case, only the ``last'' one restores visibility.
- This command has a default implementation and need not be
- implemented by a driver file.
+ This command has a default implementation and need not be implemented by a
+ driver file.
- This command is protocolled, see Section~\ref{section-protocols}.
+ This command is protocolled, see Section~\ref{section-protocols}.
\end{command}
-
\subsection{Page Size Commands}
-The following commands can be used to set the page size of a document
-in a ``portable'' way. Note, however, that many packages also (try to)
-set the page size.
+The following commands can be used to set the page size of a document in a
+``portable'' way. Note, however, that many packages also (try to) set the page
+size.
-These commands are typically not given inside a |{pgfpicture}|, but on
-the outer level of compilation.
+These commands are typically not given inside a |{pgfpicture}|, but on the
+outer level of compilation.
\begin{command}{\pgfsys@papersize\marg{width}\marg{height}}
- Inserts the necessary |\special|s for the current driver into the
- output stream to ``locally'' change the page size. Whether such a
- ``local'' change is possible depends strongly on the driver. For
- instance, |dvips| will honor the first call to this command that is
- part of the shipped-out document and will ignore all other uses. In
- contrast, |pdftex| will use the current value of the paper size for
- each page and, additionally, setting the papersize is local to the
- current \TeX\ group.
+ Inserts the necessary |\special|s for the current driver into the output
+ stream to ``locally'' change the page size. Whether such a ``local'' change
+ is possible depends strongly on the driver. For instance, |dvips| will
+ honor the first call to this command that is part of the shipped-out
+ document and will ignore all other uses. In contrast, |pdftex| will use the
+ current value of the paper size for each page and, additionally, setting
+ the papersize is local to the current \TeX\ group.
\end{command}
\begin{command}{\pgfsys@global@papersize\marg{width}\marg{height}}
- Like the previous command, only for drivers where setting the paper
- size parameters is a \TeX-group-local operation, |\global| is
- prefixed to the setting of the page sizes.
+ Like the previous command, only for drivers where setting the paper size
+ parameters is a \TeX-group-local operation, |\global| is prefixed to the
+ setting of the page sizes.
\end{command}
\begin{command}{\pgfsys@thepageheight}
- This macro expands to the current page's height, provided \LaTeX\ is
- used, otherwise a best guess is returned (currently just |\the\vsize|).
+ This macro expands to the current page's height, provided \LaTeX\ is used,
+ otherwise a best guess is returned (currently just |\the\vsize|).
\end{command}
\begin{command}{\pgfsys@thepagewidth}
- As above.
+ As above.
\end{command}
+
\subsection{Position Tracking Commands}
-The following commands are used to determine the position of text on a
-page. This is a rather complicated process in general since at the
-moment when the text is read by \TeX, the final position cannot be
-determined, yet. For example, the text might be put in a box which is
-later put in the headline or perhaps in the footline or perhaps even
-on a different page.
-
-For these reasons, position tracking is typically a two-stage
-process. In a first stage you indicate that a certain position is of
-interest by \emph{marking} it. This will (depending on the details of
-the backend driver) cause page coordinates or this position to be
-written to an |.aux| file when the page is shipped. Possibly, the
-position might also be determined at an even later stage. Then, on a
-second run of \TeX, the position is read from the |.aux| file and can
-be used.
+The following commands are used to determine the position of text on a page.
+This is a rather complicated process in general since at the moment when the
+text is read by \TeX, the final position cannot be determined, yet. For
+example, the text might be put in a box which is later put in the headline or
+perhaps in the footline or perhaps even on a different page.
+
+For these reasons, position tracking is typically a two-stage process. In a
+first stage you indicate that a certain position is of interest by
+\emph{marking} it. This will (depending on the details of the backend driver)
+cause page coordinates or this position to be written to an |.aux| file when
+the page is shipped. Possibly, the position might also be determined at an even
+later stage. Then, on a second run of \TeX, the position is read from the
+|.aux| file and can be used.
\begin{command}{\pgfsys@markposition\marg{name}}
- Marks a position on the page. This command should be given while
- normal typesetting is done such as in
+ Marks a position on the page. This command should be given while normal
+ typesetting is done such as in
+ %
\begin{codeexample}[code only]
The value of $x$ is \pgfsys@markposition{here}important.
\end{codeexample}
- It causes the position |here| to be saved when the page is shipped
- out.
+ %
+ It causes the position |here| to be saved when the page is shipped out.
\end{command}
\begin{command}{\pgfsys@getposition\marg{name}\marg{macro}}
- This command retrieves a position that has been marked on an earlier
- run of \TeX\ on the current file. The \meta{macro} must be a macro
- name such as |\mymacro|. It will be redefined such that it is
- \begin{itemize}
- \item either just |\relax| or
- \item a |\pgfpoint...| command.
- \end{itemize}
- The first case will happen when the position has not been marked at
- all or when the file is typeset for the first time, when the
- coordinates are not yet available.
-
- In the second case, executing \meta{macro} yields the position on
- the page that is to be interpreted as follows: A coordinate like
- |\pgfpoint{2cm}{3cm}| means ``2cm to the right and 3cm up from the
- origin of the page.'' The position of the origin of the page is not
- guaranteed to be at the lower left corner, it is only guaranteed
- that all pictures on a page use the same origin.
-
- To determine the lower left corner of a page, you can call
- |\pgfsys@getposition| with \meta{name} set to the special name
- |pgfpageorigin|. By shifting all positions by the amount returned by
- this call you can position things absolutely on a page.
-
- \example Referencing a point of the page:
+ This command retrieves a position that has been marked on an earlier run of
+ \TeX\ on the current file. The \meta{macro} must be a macro name such as
+ |\mymacro|. It will be redefined such that it is
+ %
+ \begin{itemize}
+ \item either just |\relax| or
+ \item a |\pgfpoint...| command.
+ \end{itemize}
+ %
+ The first case will happen when the position has not been marked at all or
+ when the file is typeset for the first time, when the coordinates are not
+ yet available.
+
+ In the second case, executing \meta{macro} yields the position on the page
+ that is to be interpreted as follows: A coordinate like
+ |\pgfpoint{2cm}{3cm}| means ``2cm to the right and 3cm up from the origin
+ of the page''. The position of the origin of the page is not guaranteed to
+ be at the lower left corner, it is only guaranteed that all pictures on a
+ page use the same origin.
+
+ To determine the lower left corner of a page, you can call
+ |\pgfsys@getposition| with \meta{name} set to the special name
+ |pgfpageorigin|. By shifting all positions by the amount returned by this
+ call you can position things absolutely on a page.
+
+ \example Referencing a point of the page:
+ %
\begin{codeexample}[code only]
The value of $x$ is \pgfsys@markposition{here}important.
@@ -1098,28 +1296,29 @@ Lots of text.
\pgfusepath{draw}
\end{pgfpicture}}
\end{codeexample}
+ %
\end{command}
\subsection{Internal Conversion Commands}
-The system commands take \TeX\ dimensions as input, but the dimensions
-that have to be inserted into \pdf\ and PostScript files need to be
-dimensionless values that are interpreted as multiples of
-$\frac{1}{72}\mathrm{in}$. For example, the \TeX\ dimension $2bp$
-should be inserted as |2| into a \pdf\ file and the \TeX\ dimension
-$10\mathrm{pt}$ as |9.9626401|. To make this conversion easier, the following
-command may be useful:
+The system commands take \TeX\ dimensions as input, but the dimensions that
+have to be inserted into \pdf\ and PostScript files need to be dimensionless
+values that are interpreted as multiples of $\frac{1}{72}\mathrm{in}$. For
+example, the \TeX\ dimension $2bp$ should be inserted as |2| into a \pdf\ file
+and the \TeX\ dimension $10\mathrm{pt}$ as |9.9626401|. To make this conversion
+easier, the following command may be useful:
\begin{command}{\pgf@sys@bp\marg{dimension}}
- Inserts how many multiples of $\frac{1}{72}\mathrm{in}$ the
- \meta{dimension} is into the current protocol stream (buffered).
+ Inserts how many multiples of $\frac{1}{72}\mathrm{in}$ the
+ \meta{dimension} is into the current protocol stream (buffered).
- \example |\pgf@sys@bp{\pgf@x}| or |\pgf@sys@bp{1cm}|.
+ \example |\pgf@sys@bp{\pgf@x}| or |\pgf@sys@bp{1cm}|.
\end{command}
-Note that this command is \emph{not} a system command that can/needs
-to be overwritten by a driver.
+Note that this command is \emph{not} a system command that can/needs to be
+overwritten by a driver.
+
%%% Local Variables:
%%% mode: latex
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-overview.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-overview.tex
index 93951723868..ac6c3f1dca7 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-overview.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-overview.tex
@@ -8,77 +8,72 @@
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-
\section{Design of the System Layer}
\makeatletter
-
\subsection{Driver Files}
\label{section-pgfsys}
-The \pgfname\ system layer mainly consists of a large number of
-commands starting with |\pgfsys@|. These commands will be called
-\emph{system commands} in the following. The higher layers
-``interface'' with the system layer by calling these commands. The
-higher layers should never use |\special| commands directly or even
-check whether |\pdfoutput| is defined. Instead, all drawing requests
-should be ``channeled'' through the system commands.
+The \pgfname\ system layer mainly consists of a large number of commands
+starting with |\pgfsys@|. These commands will be called \emph{system commands}
+in the following. The higher layers ``interface'' with the system layer by
+calling these commands. The higher layers should never use |\special| commands
+directly or even check whether |\pdfoutput| is defined. Instead, all drawing
+requests should be ``channeled'' through the system commands.
The system layer is loaded and set up by the following package:
\begin{package}{pgfsys}
- This file provides ``default implementations'' of all system
- commands, but most simply produce a warning that they are not
- implemented. The actual implementations of the system commands for a
- particular driver like, say, |pdftex| reside in files called
- |pgfsys-xxxx.sty|, where |xxxx| is the driver name. These will be
- called \emph{driver files} in the following.
-
- When |pgfsys.sty| is loaded, it will try to determine which driver
- is used by loading |pgf.cfg|. This file should set up the macro
- |\pgfsysdriver| appropriately. The |pgfsys.sty| will input the
- appropriate |pgfsys-|\meta{drivername}|.sty|.
+ This file provides ``default implementations'' of all system commands, but
+ most simply produce a warning that they are not implemented. The actual
+ implementations of the system commands for a particular driver like, say,
+ |pdftex| reside in files called |pgfsys-xxxx.sty|, where |xxxx| is the
+ driver name. These will be called \emph{driver files} in the following.
+
+ When |pgfsys.sty| is loaded, it will try to determine which driver is used
+ by loading |pgf.cfg|. This file should set up the macro |\pgfsysdriver|
+ appropriately. The |pgfsys.sty| will input the appropriate
+ |pgfsys-|\meta{drivername}|.sty|.
\end{package}
\begin{command}{\pgfsysdriver}
- This macro should expand to the name of the driver to be used by
- |pgfsys|. The default from |pgf.cfg| is |pgfsys-\Gin@driver|. This
- is very likely to be correct if you are using \LaTeX. For plain
- \TeX, the macro will be set to |pgfsys-pdftex.def| if |pdftex| is
- used and to |pgfsys-dvips.def| otherwise.
+ This macro should expand to the name of the driver to be used by |pgfsys|.
+ The default from |pgf.cfg| is |pgfsys-\Gin@driver|. This is very likely to
+ be correct if you are using \LaTeX. For plain \TeX, the macro will be set
+ to |pgfsys-pdftex.def| if |pdftex| is used and to |pgfsys-dvips.def|
+ otherwise.
\end{command}
\begin{filedescription}{pgf.cfg}
- This file should set up the command |\pgfsysdriver| correctly. If
- |\pgfsysdriver| is already set to some value, the driver normally
- should not change it. Otherwise, it should make a ``good guess'' at
- which driver will be appropriate.
+ This file should set up the command |\pgfsysdriver| correctly. If
+ |\pgfsysdriver| is already set to some value, the driver normally should
+ not change it. Otherwise, it should make a ``good guess'' at which driver
+ will be appropriate.
\end{filedescription}
-
The currently supported backend drivers are discussed in
-Section~\ref{section-drivers}.
+Section~\ref{section-drivers}.
\subsection{Common Definition Files}
-Some drivers share many |\pgfsys@| commands. For the reason, files
-defining these ``common'' commands are available. These files are
-\emph{not} usable alone.
+Some drivers share many |\pgfsys@| commands. For the reason, files defining
+these ``common'' commands are available. These files are \emph{not} usable
+alone.
\begin{filedescription}{pgfsys-common-postscript}
- This file defines some |\pgfsys@| commands so that they produce
- appropriate PostScript code.
+ This file defines some |\pgfsys@| commands so that they produce appropriate
+ PostScript code.
\end{filedescription}
\begin{filedescription}{pgfsys-common-pdf}
- This file defines some |\pgfsys@| commands so that they produce
- appropriate \textsc{pdf} code.
+ This file defines some |\pgfsys@| commands so that they produce appropriate
+ \textsc{pdf} code.
\end{filedescription}
-%%% 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-paths.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-paths.tex
index a59b203b28d..e432823121d 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-paths.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-pgfsys-paths.tex
@@ -8,233 +8,210 @@
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-
\section{The Soft Path Subsystem}
-
\label{section-soft-paths}
\makeatletter
+This section describes a set of commands for creating \emph{soft paths} as
+opposed to the commands of the previous section, which created \emph{hard
+paths}. A soft path is a path that can still be ``changed'' or ``molded''. Once
+you (or the \pgfname\ system) is satisfied with a soft path, it is turned into
+a hard path, which can be inserted into the resulting |.pdf| or |.ps| file.
-This section describes a set of commands for creating \emph{soft
- paths} as opposed to the commands of the previous section, which
-created \emph{hard paths}. A soft path is a path that can still be
-``changed'' or ``molded.'' Once you (or the \pgfname\ system) is
-satisfied with a soft path, it is turned into a hard path, which can
-be inserted into the resulting |.pdf| or |.ps| file.
-
-Note that the commands described in this section are ``high-level'' in
-the sense that they are not implemented in driver files, but rather
-directly by the \pgfname-system layer. For this reason, the commands for
-creating soft paths do not start with |\pgfsys@|, but rather with
-|\pgfsyssoftpath@|. On the other hand, as a user you will never use
-these commands directly, they are described as part of the
-low-level interface.
-
+Note that the commands described in this section are ``high-level'' in the
+sense that they are not implemented in driver files, but rather directly by the
+\pgfname-system layer. For this reason, the commands for creating soft paths do
+not start with |\pgfsys@|, but rather with |\pgfsyssoftpath@|. On the other
+hand, as a user you will never use these commands directly, they are described
+as part of the low-level interface.
\subsection{Path Creation Process}
-When the user writes a command like |\draw (0bp,0bp) -- (10bp,0bp);|
-quite a lot happens behind the scenes:
+When the user writes a command like |\draw (0bp,0bp) -- (10bp,0bp);| quite a
+lot happens behind the scenes:
+%
\begin{enumerate}
-\item
- The frontend command is translated by \tikzname\ into commands
- of the basic layer. In essence, the command is translated to
- something like
+ \item The frontend command is translated by \tikzname\ into commands of the
+ basic layer. In essence, the command is translated to something like
+ %
\begin{codeexample}[code only]
\pgfpathmoveto{\pgfpoint{0bp}{0bp}}
\pgfpathlineto{\pgfpoint{10bp}{0bp}}
\pgfusepath{stroke}
\end{codeexample}
-\item
- The |\pgfpathxxxx| commands do \emph{not} directly call ``hard''
- commands like |\pgfsys@xxxx|. Instead, the command |\pgfpathmoveto|
- invokes a special command called |\pgfsyssoftpath@moveto| and
- |\pgfpathlineto| invokes |\pgfsyssoftpath@lineto|.
-
- The |\pgfsyssoftpath@xxxx| commands, which are described below,
- construct a soft path. Each time such a command is used, special
- tokens are added to the end of an internal macro that stores the
- soft path currently being constructed.
-\item
- When the |\pgfusepath| is encountered, the soft path stored in
- the internal macro is ``invoked.'' Only now does a special macro
- iterate over the soft path. For each line-to or move-to
- operation on this path it calls an appropriate |\pgfsys@moveto| or
- |\pgfsys@lineto| in order to, finally, create the desired hard path,
- namely, the string of literals in the |.pdf| or |.ps| file.
-\item
- After the path has been invoked, |\pgfsys@stroke| is called to
- insert the literal for stroking the path.
+ %
+ \item The |\pgfpathxxxx| commands do \emph{not} directly call ``hard''
+ commands like |\pgfsys@xxxx|. Instead, the command |\pgfpathmoveto|
+ invokes a special command called |\pgfsyssoftpath@moveto| and
+ |\pgfpathlineto| invokes |\pgfsyssoftpath@lineto|.
+
+ The |\pgfsyssoftpath@xxxx| commands, which are described below,
+ construct a soft path. Each time such a command is used, special tokens
+ are added to the end of an internal macro that stores the soft path
+ currently being constructed.
+ \item When the |\pgfusepath| is encountered, the soft path stored in the
+ internal macro is ``invoked''. Only now does a special macro iterate
+ over the soft path. For each line-to or move-to operation on this path
+ it calls an appropriate |\pgfsys@moveto| or |\pgfsys@lineto| in order
+ to, finally, create the desired hard path, namely, the string of
+ literals in the |.pdf| or |.ps| file.
+ \item After the path has been invoked, |\pgfsys@stroke| is called to insert
+ the literal for stroking the path.
\end{enumerate}
-Why such a complicated process? Why not have |\pgfpathlineto| directly
-call |\pgfsys@lineto| and be done with it? There are two reasons:
+Why such a complicated process? Why not have |\pgfpathlineto| directly call
+|\pgfsys@lineto| and be done with it? There are two reasons:
+%
\begin{enumerate}
-\item
- The \pdf\ specification requires that a path is not interrupted by
- any non-path-construction commands. Thus, the following code will
- result in a corrupted |.pdf|:
+ \item The \pdf\ specification requires that a path is not interrupted by
+ any non-path-construction commands. Thus, the following code will
+ result in a corrupted |.pdf|:
+ %
\begin{codeexample}[code only]
\pgfsys@moveto{0}{0}
\pgfsys@setlinewidth{1}
\pgfsys@lineto{10}{0}
\pgfsys@stroke
\end{codeexample}
- Such corrupt code is \emph{tolerated} by most viewers, but not
- always. It is much better to create only (reasonably) legal code.
-\item
- A soft path can still be changed, while a hard path is fixed. For
- example, one can still change the starting and end points of a soft
- path or do optimizations on it. Such transformations are not possible
- on hard paths.
+ %
+ Such corrupt code is \emph{tolerated} by most viewers, but not always.
+ It is much better to create only (reasonably) legal code.
+ \item A soft path can still be changed, while a hard path is fixed. For
+ example, one can still change the starting and end points of a soft
+ path or do optimizations on it. Such transformations are not possible
+ on hard paths.
\end{enumerate}
\subsection{Starting and Ending a Soft Path}
-No special action must be taken in order to start the creation of a
-soft path. Rather, each time a command like |\pgfsyssoftpath@lineto|
-is called, a special token is added to the (global) current soft path
-being constructed.
+No special action must be taken in order to start the creation of a soft path.
+Rather, each time a command like |\pgfsyssoftpath@lineto| is called, a special
+token is added to the (global) current soft path being constructed.
-However, you can access and change the current soft path. In this way,
-it is possible to store a soft path, to manipulate it, or to invoke
-it.
+However, you can access and change the current soft path. In this way, it is
+possible to store a soft path, to manipulate it, or to invoke it.
\begin{command}{\pgfsyssoftpath@getcurrentpath\marg{macro name}}
- This command will store the current soft path in \meta{macro name}.
+ This command will store the current soft path in \meta{macro name}.
\end{command}
\begin{command}{\pgfsyssoftpath@setcurrentpath\marg{macro name}}
- This command will set the current soft path to be the path stored in
- \meta{macro name}. This macro should store a path that has
- previously been extracted using the |\pgfsyssoftpath@getcurrentpath|
- command and has possibly been modified subsequently.
+ This command will set the current soft path to be the path stored in
+ \meta{macro name}. This macro should store a path that has previously been
+ extracted using the |\pgfsyssoftpath@getcurrentpath| command and has
+ possibly been modified subsequently.
\end{command}
\begin{command}{\pgfsyssoftpath@invokecurrentpath}
- This command will turn the current soft path in a ``hard'' path. To
- do so, it iterates over the soft path and calls an appropriate
- |\pgfsys@xxxx| command for each element of the path. Note that the
- current soft path is \emph{not changed} by this command. Thus, in
- order to start a new soft path after the old one has been invoked
- and is no longer needed, you need to set the current soft path to be
- empty. This may seem strange, but it is often useful to immediately
- use the last soft path again.
+ This command will turn the current soft path in a ``hard'' path. To do so,
+ it iterates over the soft path and calls an appropriate |\pgfsys@xxxx|
+ command for each element of the path. Note that the current soft path is
+ \emph{not changed} by this command. Thus, in order to start a new soft path
+ after the old one has been invoked and is no longer needed, you need to set
+ the current soft path to be empty. This may seem strange, but it is often
+ useful to immediately use the last soft path again.
\end{command}
\begin{command}{\pgfsyssoftpath@flushcurrentpath}
- This command will invoke the current soft path and then set it to be
- empty.
+ This command will invoke the current soft path and then set it to be empty.
\end{command}
-
\subsection{Soft Path Creation Commands}
\begin{command}{\pgfsyssoftpath@moveto\marg{x}\marg{y}}
- This command appends a ``move-to'' segment to the current soft
- path. The coordinates \meta{x} and \meta{y} are given as normal
- \TeX\ dimensions.
+ This command appends a ``move-to'' segment to the current soft path. The
+ coordinates \meta{x} and \meta{y} are given as normal \TeX\ dimensions.
- \example One way to draw a line:
+ \example One way to draw a line:
+ %
\begin{codeexample}[code only]
\pgfsyssoftpath@moveto{0pt}{0pt}
\pgfsyssoftpath@lineto{10pt}{10pt}
\pgfsyssoftpath@flushcurrentpath
\pgfsys@stroke
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfsyssoftpath@lineto\marg{x}\marg{y}}
- Appends a ``line-to'' segment to the current soft path.
+ Appends a ``line-to'' segment to the current soft path.
\end{command}
\begin{command}{\pgfsyssoftpath@curveto\marg{a}\marg{b}\marg{c}\marg{d}\marg{x}\marg{y}}
- Appends a ``curve-to'' segment to the current soft path with controls
- $(a,b)$ and $(c,d)$.
+ Appends a ``curve-to'' segment to the current soft path with controls
+ $(a,b)$ and $(c,d)$.
\end{command}
\begin{command}{\pgfsyssoftpath@rect\marg{lower left x}\marg{lower left y}\marg{width}\marg{height}}
- Appends a rectangle segment to the current soft path.
+ Appends a rectangle segment to the current soft path.
\end{command}
\begin{command}{\pgfsyssoftpath@closepath}
- Appends a ``close-path'' segment to the current soft path.
+ Appends a ``close-path'' segment to the current soft path.
\end{command}
-
-
\subsection{The Soft Path Data Structure}
-A soft path is stored in a standardized way, which makes it possible to
-modify it before it becomes ``hard.'' Basically, a soft path is a long
-sequence of triples. Each triple starts with a \emph{token} that
-identifies what is going on. This token is followed by two dimensions in
-braces. For example, the following is a soft path that means ``the
-path starts at $(0\mathrm{bp}, 0\mathrm{bp})$ and then
-continues in a straight line to $(10\mathrm{bp},
-0\mathrm{bp})$.''
-
+A soft path is stored in a standardized way, which makes it possible to modify
+it before it becomes ``hard''. Basically, a soft path is a long sequence of
+triples. Each triple starts with a \emph{token} that identifies what is going
+on. This token is followed by two dimensions in braces. For example, the
+following is a soft path that means ``the path starts at $(0\mathrm{bp},
+0\mathrm{bp})$ and then continues in a straight line to $(10\mathrm{bp},
+0\mathrm{bp})$''.
+%
\begin{codeexample}[code only]
\pgfsyssoftpath@movetotoken{0bp}{0bp}\pgfsyssoftpath@linetotoken{10bp}{0bp}
\end{codeexample}
-A curve-to is hard to express in this way since we need six numbers to
-express it, not two. For this reasons, a curve-to is expressed using
-three triples as follows: The command
+A curve-to is hard to express in this way since we need six numbers to express
+it, not two. For this reasons, a curve-to is expressed using three triples as
+follows: The command
+%
\begin{codeexample}[code only]
\pgfsyssoftpath@curveto{1bp}{2bp}{3bp}{4bp}{5bp}{6bp}
\end{codeexample}
-\noindent
-results in the following three triples:
+%
+\noindent results in the following three triples:
+%
\begin{codeexample}[code only]
\pgfsyssoftpath@curvetosupportatoken{1bp}{2bp}
\pgfsyssoftpath@curvetosupportbtoken{3bp}{4bp}
\pgfsyssoftpath@curvetotoken{5bp}{6bp}
\end{codeexample}
-These three triples must always ``remain together.'' Thus, a lonely
+These three triples must always ``remain together''. Thus, a lonely
|supportbtoken| is forbidden.
In details, the following tokens exist:
+%
\begin{itemize}
-\item
- \declare{|\pgfsyssoftpath@movetotoken|} indicates a move-to
- operation. The two following numbers indicate the position to which
- the current point should be moved.
-\item
- \declare{|\pgfsyssoftpath@linetotoken|} indicates a line-to
- operation.
-\item
- \declare{|\pgfsyssoftpath@curvetosupportatoken|} indicates the first
- control point of a curve-to operation. The triple must be followed
- by a |\pgfsyssoftpath@curvetosupportbtoken|.
-\item
- \declare{|\pgfsyssoftpath@curvetosupportbtoken|} indicates the second
- control point of a curve-to operation. The triple must be followed
- by a |\pgfsyssoftpath@curvetotoken|.
-\item
- \declare{|\pgfsyssoftpath@curvetotoken|} indicates the target
- of a curve-to operation.
-\item
- \declare{|\pgfsyssoftpath@rectcornertoken|} indicates the corner of
- a rectangle on the soft path. The triple must be followed
- by a |\pgfsyssoftpath@rectsizetoken|.
-\item
- \declare{|\pgfsyssoftpath@rectsizetoken|} indicates the size of
- a rectangle on the soft path.
-\item
- \declare{|\pgfsyssoftpath@closepath|} indicates that the subpath
- begun with the last move-to operation should be closed. The parameter
- numbers are currently not important, but if set to anything
- different from |{0pt}{0pt}|, they should be set to the coordinate of
- the original move-to operation to which the path ``returns'' now.
+ \item \declare{|\pgfsyssoftpath@movetotoken|} indicates a move-to
+ operation. The two following numbers indicate the position to which the
+ current point should be moved.
+ \item \declare{|\pgfsyssoftpath@linetotoken|} indicates a line-to
+ operation.
+ \item \declare{|\pgfsyssoftpath@curvetosupportatoken|} indicates the first
+ control point of a curve-to operation. The triple must be followed by a
+ |\pgfsyssoftpath@curvetosupportbtoken|.
+ \item \declare{|\pgfsyssoftpath@curvetosupportbtoken|} indicates the second
+ control point of a curve-to operation. The triple must be followed by a
+ |\pgfsyssoftpath@curvetotoken|.
+ \item \declare{|\pgfsyssoftpath@curvetotoken|} indicates the target of a
+ curve-to operation.
+ \item \declare{|\pgfsyssoftpath@rectcornertoken|} indicates the corner of a
+ rectangle on the soft path. The triple must be followed by a
+ |\pgfsyssoftpath@rectsizetoken|.
+ \item \declare{|\pgfsyssoftpath@rectsizetoken|} indicates the size of a
+ rectangle on the soft path.
+ \item \declare{|\pgfsyssoftpath@closepath|} indicates that the subpath
+ begun with the last move-to operation should be closed. The parameter
+ numbers are currently not important, but if set to anything different
+ from |{0pt}{0pt}|, they should be set to the coordinate of the original
+ move-to operation to which the path ``returns'' now.
\end{itemize}
-
-
-
-
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 dcd21793278..4d3615e79d1 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
@@ -7,80 +7,79 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\section{The Protocol Subsystem}
+\section{The Protocol Subsystem}
\label{section-protocols}
\makeatletter
-This section describes commands for \emph{protocolling} literal text
-created by \pgfname. The idea is that some literal text, like the string
-of commands used to draw an arrow head, will be used over and over
-again in a picture. It is then much more efficient to compute the
-necessary literal text just once and to quickly insert it ``in a
-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 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 protocolled commands into the |.pdf| or |.dvi| file.
-
-Only those |\pgfsys@| commands can be protocolled that use the
-command |\pgfsysprotocol@literal| internally. For example, the
-definition of |\pgfsys@moveto| in |pgfsys-common-pdf.def| is
+This section describes commands for \emph{protocolling} literal text created by
+\pgfname. The idea is that some literal text, like the string of commands used
+to draw an arrow head, will be used over and over again in a picture. It is
+then much more efficient to compute the necessary literal text just once and to
+quickly insert it ``in a 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 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 protocolled
+commands into the |.pdf| or |.dvi| file.
+
+Only those |\pgfsys@| commands can be protocolled that use 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}}
\end{codeexample}
-All ``normal'' system-level commands can be protocolled. However,
-commands for creating or invoking shadings, images, or whole pictures
-require special |\special|'s and cannot be protocolled.
+%
+All ``normal'' system-level commands can be protocolled. However, commands for
+creating or invoking shadings, images, or whole pictures require special
+|\special|'s and cannot be protocolled.
\begin{command}{\pgfsysprotocol@literalbuffered\marg{literal text}}
- Adds the \meta{literal text} to the current protocol, after it has
- been ``|\edef|ed.'' This command will always be protocolled.
+ Adds the \meta{literal text} to the current protocol, after it has been
+ ``|\edef|ed''. This command will always be protocolled.
\end{command}
\begin{command}{\pgfsysprotocol@literal\marg{literal text}}
- First calls |\pgfsysprotocol@literalbuffered| on \meta{literal
- text}. Then, if protocolling is currently switched off, the
- \meta{literal text} is passed on to |\pgfsys@invoke|.
+ First calls |\pgfsysprotocol@literalbuffered| on \meta{literal text}. Then,
+ if protocolling is currently switched off, the \meta{literal text} is
+ passed on to |\pgfsys@invoke|.
\end{command}
\begin{command}{\pgfsysprotocol@bufferedtrue}
- Turns on protocolling. All subsequent calls of
- |\pgfsysprotocol@literal| will append their argument to the current
- protocol.
+ Turns on protocolling. All subsequent calls of |\pgfsysprotocol@literal|
+ will append their argument to the current protocol.
\end{command}
\begin{command}{\pgfsysprotocol@bufferedfalse}
- Turns off protocolling. Subsequent calls of
- |\pgfsysprotocol@literal| directly insert their argument into the
- current |.pdf| or |.ps|.
+ Turns off protocolling. Subsequent calls of |\pgfsysprotocol@literal|
+ directly insert their argument into the current |.pdf| or |.ps|.
- Note that if the current protocol is not empty when protocolling is
- switched off, the next call to |\pgfsysprotocol@literal| will first
- flush the current protocol, that is, insert it into the file.
+ Note that if the current protocol is not empty when protocolling is
+ switched off, the next call to |\pgfsysprotocol@literal| will first flush
+ the current protocol, that is, insert it into the file.
\end{command}
\begin{command}{\pgfsysprotocol@getcurrentprotocol\marg{macro name}}
- Stores the current protocol in \meta{macro name} for later use.
+ Stores the current protocol in \meta{macro name} for later use.
\end{command}
\begin{command}{\pgfsysprotocol@setcurrentprotocol\marg{macro name}}
- Sets the current protocol to \meta{macro name}.
+ Sets the current protocol to \meta{macro name}.
\end{command}
\begin{command}{\pgfsysprotocol@invokecurrentprotocol}
- Inserts the text stored in the current protocol into the |.pdf| or
- |.dvi| file. This does \emph{not} change the current protocol.
+ Inserts the text stored in the current protocol into the |.pdf| or |.dvi|
+ file. This does \emph{not} change the current protocol.
\end{command}
\begin{command}{\pgfsysprotocol@flushcurrentprotocol}
- First inserts the current protocol, then sets the current protocol
- to the empty string.
+ First inserts the current protocol, then sets the current protocol to the
+ empty string.
\end{command}
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 bb201599575..cad08b6b71b 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
@@ -7,45 +7,45 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Actions on Paths}
\subsection{Overview}
-Once a path has been constructed, different things can be done with
-it. It can be drawn (or stroked) with a ``pen,'' it can be filled with
-a color or shading, it can be used for clipping subsequent drawing, it
-can be used to specify the extend of the picture---or any
-combination of these actions at the same time.
-
-To decide what is to be done with a path, two methods can be
-used. First, you can use a special-purpose command like |\draw| to
-indicate that the path should be drawn. However, commands like |\draw|
-and |\fill| are just abbreviations for special cases of the more
-general method: Here, the |\path| command is used to specify the
-path. Then, options encountered on the path indicate what should be
+Once a path has been constructed, different things can be done with it. It can
+be drawn (or stroked) with a ``pen'', it can be filled with a color or shading,
+it can be used for clipping subsequent drawing, it can be used to specify the
+extend of the picture -- or any combination of these actions at the same time.
+
+To decide what is to be done with a path, two methods can be used. First, you
+can use a special-purpose command like |\draw| to indicate that the path should
+be drawn. However, commands like |\draw| and |\fill| are just abbreviations for
+special cases of the more general method: Here, the |\path| command is used to
+specify the path. Then, options encountered on the path indicate what should be
done with the path.
-For example, |\path (0,0) circle (1cm);| means ``This is a path
-consisting of a circle around the origin. Do not do anything with it
-(throw it away).'' However, if the option |draw| is encountered
-anywhere on the path, the circle will be drawn. ``Anywhere'' is any
-point on the path where an option can be given, which is everywhere
-where a path command like |circle (1cm)| or |rectangle (1,1)| or even
-just |(0,0)| would also be allowed. Thus, the following commands all
-draw the same circle:
+For example, |\path (0,0) circle (1cm);| means: ``This is a path consisting of
+a circle around the origin. Do not do anything with it (throw it away).''
+However, if the option |draw| is encountered anywhere on the path, the circle
+will be drawn. ``Anywhere'' is any point on the path where an option can be
+given, which is everywhere where a path command like |circle (1cm)| or
+|rectangle (1,1)| or even just |(0,0)| would also be allowed. Thus, the
+following commands all draw the same circle:
+%
\begin{codeexample}[code only]
\path [draw] (0,0) circle (1cm);
\path (0,0) [draw] circle (1cm);
\path (0,0) circle (1cm) [draw];
\end{codeexample}
-Finally, |\draw (0,0) circle (1cm);| also draws a path, because
-|\draw| is an abbreviation for |\path [draw]| and thus the command
-expands to the first line of the above example.
+%
+Finally, |\draw (0,0) circle (1cm);| also draws a path, because |\draw| is an
+abbreviation for |\path [draw]| and thus the command 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:
+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:
+%
\begin{codeexample}[code only]
\path [draw,fill] (0,0) circle (1cm);
\path [draw] [fill] (0,0) circle (1cm);
@@ -55,229 +55,246 @@ all have the same effect:
\filldraw (0,0) circle (1cm);
\end{codeexample}
-In the following subsection the different actions that
-can be performed on a path are explained. The following commands are abbreviations for
-certain sets of actions, but for many useful combinations there are no
-abbreviations:
+In the following subsection the different actions that can be performed on a
+path are explained. The following commands are abbreviations for certain sets
+of actions, but for many useful combinations there are no abbreviations:
\begin{command}{\draw}
- Inside |{tikzpicture}| this is an abbreviation for |\path[draw]|.
+ Inside |{tikzpicture}| this is an abbreviation for |\path[draw]|.
\end{command}
\begin{command}{\fill}
- Inside |{tikzpicture}| this is an abbreviation for |\path[fill]|.
+ Inside |{tikzpicture}| this is an abbreviation for |\path[fill]|.
\end{command}
\begin{command}{\filldraw}
- Inside |{tikzpicture}| this is an abbreviation for |\path[fill,draw]|.
+ Inside |{tikzpicture}| this is an abbreviation for |\path[fill,draw]|.
\end{command}
\begin{command}{\pattern}
- Inside |{tikzpicture}| this is an abbreviation for |\path[pattern]|.
+ Inside |{tikzpicture}| this is an abbreviation for |\path[pattern]|.
\end{command}
\begin{command}{\shade}
- Inside |{tikzpicture}| this is an abbreviation for |\path[shade]|.
+ Inside |{tikzpicture}| this is an abbreviation for |\path[shade]|.
\end{command}
\begin{command}{\shadedraw}
- Inside |{tikzpicture}| this is an abbreviation for |\path[shade,draw]|.
+ Inside |{tikzpicture}| this is an abbreviation for |\path[shade,draw]|.
\end{command}
\begin{command}{\clip}
- Inside |{tikzpicture}| this is an abbreviation for |\path[clip]|.
+ Inside |{tikzpicture}| this is an abbreviation for |\path[clip]|.
\end{command}
\begin{command}{\useasboundingbox}
- Inside |{tikzpicture}| this is an abbreviation for |\path[use as bounding box]|.
+ Inside |{tikzpicture}| this is an abbreviation for |\path[use as bounding box]|.
\end{command}
-
\subsection{Specifying a Color}
The most unspecific option for setting colors is the following:
-
+%
\begin{key}{/tikz/color=\meta{color name}}
- \indexoption{color option}%
- This option sets the color that is used for fill, drawing, and text
- inside the current scope. Any special settings for filling colors or
- drawing colors are immediately ``overruled'' by this option.
-
- 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 allowed. Here is an example:
+ \indexoption{color option}%
+ This option sets the color that is used for fill, drawing, and text inside
+ the current scope. Any special settings for filling colors or drawing
+ colors are immediately ``overruled'' by this option.
+ 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 allowed. Here is an example:
+ %
\begin{codeexample}[]
\tikz \fill[color=red!20] (0,0) circle (1ex);
\end{codeexample}
- It is possible to ``leave out'' the |color=| part and you can also
- write:
+ It is possible to ``leave out'' the |color=| part and you can also write:
+ %
\begin{codeexample}[]
\tikz \fill[red!20] (0,0) circle (1ex);
\end{codeexample}
- What happens is that every option that \tikzname\ does not know, like
- |red!20|, gets a ``second chance'' as a color name.
-
- For plain \TeX\ users, it is not so easy to specify colors since
- plain \TeX\ has no ``standardized'' color naming
- mechanism. Because of this, \pgfname\ emulates the |xcolor| package,
- though the emulation is \emph{extremely basic} (more precisely, what
- I could hack together in two hours or so). The emulation allows you
- to do the following:
- \begin{itemize}
- \item Specify a new color using |\definecolor|. Only the two color
- 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''
- (use multiple |\colorlet| for more fancy colors).
- \example |\colorlet{lightgray}{black!25}|
- \item Use |\color|\marg{color name} to set the color in the current
- \TeX\ group. |\aftergroup|-hackery is used to restore the color
- after the group.
- \end{itemize}
+ %
+ What happens is that every option that \tikzname\ does not know, like
+ |red!20|, gets a ``second chance'' as a color name.
+
+ For plain \TeX\ users, it is not so easy to specify colors since plain
+ \TeX\ has no ``standardized'' color naming mechanism. Because of this,
+ \pgfname\ emulates the |xcolor| package, though the emulation is
+ \emph{extremely basic} (more precisely, what I could hack together in two
+ hours or so). The emulation allows you to do the following:
+ %
+ \begin{itemize}
+ \item Specify a new color using |\definecolor|. Only the two color
+ 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'' (use
+ multiple |\colorlet| for more fancy colors).
+ %
+ \example |\colorlet{lightgray}{black!25}|
+ \item Use |\color|\marg{color name} to set the color in the current
+ \TeX\ group. |\aftergroup|-hackery is used to restore the color
+ after the group.
+ \end{itemize}
\end{key}
-As pointed out above, the |color=| option applies to ``everything''
-(except to shadings), which is not always what you want. Because of
-this, there are several more specialized color options. For example,
-the |draw=| option sets the color used for drawing, but does not
-modify the color used for filling. These color options are documented
-where the path action they influence is described.
+As pointed out above, the |color=| option applies to ``everything'' (except to
+shadings), which is not always what you want. Because of this, there are
+several more specialized color options. For example, the |draw=| option sets
+the color used for drawing, but does not modify the color used for filling.
+These color options are documented where the path action they influence is
+described.
\subsection{Drawing a Path}
You can draw a path using the following option:
+%
\begin{key}{/tikz/draw=\meta{color} (default \normalfont is scope's color setting)}
- Causes the path to be drawn. ``Drawing'' (also known as
- ``stroking'') can be thought of as picking up a pen and moving it
- along the path, thereby leaving ``ink'' on the canvas.
-
- There are numerous parameters that influence how a line is drawn,
- like the thickness or the dash pattern. These options are explained
- below.
-
- If the optional \meta{color} argument is given, drawing is done
- using the given \meta{color}. This color can be different from the
- current filling color, which allows you to draw and fill a path with
- different colors. If no \meta{color} argument is given, the last
- usage of the |color=| option is used.
-
- 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.
-
- 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
- |{scope}| or |{tikzpicture}| environment. However, this will
- \emph{not} cause all paths to be drawn. Instead, this just sets the
- \meta{color} to be used for drawing paths inside the environment.
-
+ Causes the path to be drawn. ``Drawing'' (also known as ``stroking'') can
+ be thought of as picking up a pen and moving it along the path, thereby
+ leaving ``ink'' on the canvas.
+
+ There are numerous parameters that influence how a line is drawn, like the
+ thickness or the dash pattern. These options are explained below.
+
+ If the optional \meta{color} argument is given, drawing is done using the
+ given \meta{color}. This color can be different from the current filling
+ color, which allows you to draw and fill a path with different colors. If
+ no \meta{color} argument is given, the last usage of the |color=| option is
+ used.
+
+ 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.
+
+ 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 |{scope}| or
+ |{tikzpicture}| environment. However, this will \emph{not} cause all paths
+ to be drawn. Instead, this just sets the \meta{color} to be used for
+ drawing paths inside the environment.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\path[draw=red] (0,0) -- (1,1) -- (2,1) circle (10pt);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
+The following subsections list the different options that influence how a path
+is drawn. All of these options only have an effect if the |draw| option is
+given (directly or indirectly).
-The following subsections list the different options that influence
-how a path is drawn. All of these options only have an effect if the
-|draw| option is given (directly or indirectly).
\subsubsection{Graphic Parameters: Line Width, Line Cap, and Line Join}
-
\label{section-cap-joins}
\begin{key}{/tikz/line width=\meta{dimension} (initially 0.4pt)}
- Specifies the line width. Note the space.
-
+ Specifies the line width. Note the space.
+ %
\begin{codeexample}[]
\tikz \draw[line width=5pt] (0,0) -- (1cm,1.5ex);
\end{codeexample}
+ %
\end{key}
-There are a number of predefined styles that provide more ``natural''
-ways of setting the line width. You can also redefine these
-styles.
+There are a number of predefined styles that provide more ``natural'' ways of
+setting the line width. You can also redefine these styles.
\begin{stylekey}{/tikz/ultra thin}
- Sets the line width to 0.1pt.
+ Sets the line width to 0.1pt.
+ %
\begin{codeexample}[]
\tikz \draw[ultra thin] (0,0) -- (1cm,1.5ex);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/very thin}
- Sets the line width to 0.2pt.
+ Sets the line width to 0.2pt.
+ %
\begin{codeexample}[]
\tikz \draw[very thin] (0,0) -- (1cm,1.5ex);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/thin}
- Sets the line width to 0.4pt.
+ Sets the line width to 0.4pt.
+ %
\begin{codeexample}[]
\tikz \draw[thin] (0,0) -- (1cm,1.5ex);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/semithick}
- Sets the line width to 0.6pt.
+ Sets the line width to 0.6pt.
+ %
\begin{codeexample}[]
\tikz \draw[semithick] (0,0) -- (1cm,1.5ex);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/thick}
- Sets the line width to 0.8pt.
+ Sets the line width to 0.8pt.
+ %
\begin{codeexample}[]
\tikz \draw[thick] (0,0) -- (1cm,1.5ex);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/very thick}
- Sets the line width to 1.2pt.
+ Sets the line width to 1.2pt.
+ %
\begin{codeexample}[]
\tikz \draw[very thick] (0,0) -- (1cm,1.5ex);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/ultra thick}
- Sets the line width to 1.6pt.
+ Sets the line width to 1.6pt.
+ %
\begin{codeexample}[]
\tikz \draw[ultra thick] (0,0) -- (1cm,1.5ex);
\end{codeexample}
+ %
\end{stylekey}
-
-\label{section-line-cap}
-
+ \label{section-line-cap}
\begin{key}{/tikz/line cap=\meta{type} (initially butt)}
- Specifies how lines ``end.'' Permissible \meta{type} are |round|,
- |rect|, and |butt|. They have the following effects:
-
+ Specifies how lines ``end''. Permissible \meta{type} are |round|, |rect|,
+ and |butt|. They have the following effects:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\begin{scope}[line width=10pt]
- \draw[line cap=rect] (0,0 ) -- (1,0);
- \draw[line cap=butt] (0,.5) -- (1,.5);
- \draw[line cap=round] (0,1 ) -- (1,1);
+ \draw[line cap=round] (0,1 ) -- +(1,0);
+ \draw[line cap=butt] (0,.5) -- +(1,0);
+ \draw[line cap=rect] (0,0 ) -- +(1,0);
\end{scope}
\draw[white,line width=1pt]
- (0,0 ) -- (1,0) (0,.5) -- (1,.5) (0,1 ) -- (1,1);
+ (0,0 ) -- +(1,0) (0,.5) -- +(1,0) (0,1 ) -- +(1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/line join=\meta{type} (initially miter)}
- Specifies how lines ``join.'' Permissible \meta{type} are |round|,
- |bevel|, and |miter|. They have the following effects:
-
+ Specifies how lines ``join''. Permissible \meta{type} are |round|, |bevel|,
+ and |miter|. They have the following effects:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[line width=10pt]
\draw[line join=round] (0,0) -- ++(.5,1) -- ++(.5,-1);
@@ -287,13 +304,12 @@ styles.
\end{tikzpicture}
\end{codeexample}
- \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
- more than \meta{factor} times the line width, the miter join is
- replaced by a bevel join.
-
+ \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 more than \meta{factor}
+ times the line width, the miter join is replaced by a bevel join.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[line width=5pt]
\draw (0,0) -- ++(5,.5) -- ++(-5,.5);
@@ -301,191 +317,214 @@ styles.
\useasboundingbox (14,0); % make bounding box bigger
\end{tikzpicture}
\end{codeexample}
- \end{key}
+ \end{key}
\end{key}
+
\subsubsection{Graphic Parameters: Dash Pattern}
\begin{key}{/tikz/dash pattern=\meta{dash pattern}}
- Sets the dashing pattern. The syntax is the same as in
- \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''.
-
+ Sets the dashing pattern. The syntax is the same as in \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''.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[dash pattern=on 2pt off 3pt on 4pt off 4pt]
\draw (0pt,0pt) -- (3.5cm,0pt);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/dash phase=\meta{dash phase} (initially 0pt)}
- Shifts the start of the dash pattern by \meta{phase}.
-
+ Shifts the start of the dash pattern by \meta{phase}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[dash pattern=on 20pt off 10pt]
\draw[dash phase=0pt] (0pt,3pt) -- (3.5cm,3pt);
\draw[dash phase=10pt] (0pt,0pt) -- (3.5cm,0pt);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-As for the line thickness, some predefined styles allow you to set the
-dashing conveniently.
+\begin{key}{/tikz/dash=\meta{dash pattern}|phase|\meta{dash phase}}
+ Sets the dashing pattern and phase at the same time.
+ %
+\begin{codeexample}[]
+\begin{tikzpicture}
+ \draw [dash=on 20pt off 10pt phase 0pt] (0pt,3pt) -- (3.5cm,3pt);
+ \draw [dash=on 20pt off 10pt phase 10pt] (0pt,0pt) -- (3.5cm,0pt);
+\end{tikzpicture}
+\end{codeexample}
+ %
+\end{key}
-\begin{stylekey}{/tikz/solid}
- Shorthand for setting a solid line as ``dash pattern.'' This is the default.
+As for the line thickness, some predefined styles allow you to set the dashing
+conveniently.
+\begin{stylekey}{/tikz/solid}
+ Shorthand for setting a solid line as ``dash pattern''. This is the default.
+ %
\begin{codeexample}[]
\tikz \draw[solid] (0pt,0pt) -- (50pt,0pt);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/dotted}
- Shorthand for setting a dotted dash pattern.
-
+ Shorthand for setting a dotted dash pattern.
+ %
\begin{codeexample}[]
\tikz \draw[dotted] (0pt,0pt) -- (50pt,0pt);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/densely dotted}
- Shorthand for setting a densely dotted dash pattern.
-
+ Shorthand for setting a densely dotted dash pattern.
+ %
\begin{codeexample}[]
\tikz \draw[densely dotted] (0pt,0pt) -- (50pt,0pt);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/loosely dotted}
- Shorthand for setting a loosely dotted dash pattern.
-
+ Shorthand for setting a loosely dotted dash pattern.
+ %
\begin{codeexample}[]
\tikz \draw[loosely dotted] (0pt,0pt) -- (50pt,0pt);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/dashed}
- Shorthand for setting a dashed dash pattern.
-
+ Shorthand for setting a dashed dash pattern.
+ %
\begin{codeexample}[]
\tikz \draw[dashed] (0pt,0pt) -- (50pt,0pt);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/densely dashed}
- Shorthand for setting a densely dashed dash pattern.
-
+ Shorthand for setting a densely dashed dash pattern.
+ %
\begin{codeexample}[]
\tikz \draw[densely dashed] (0pt,0pt) -- (50pt,0pt);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/loosely dashed}
- Shorthand for setting a loosely dashed dash pattern.
-
+ Shorthand for setting a loosely dashed dash pattern.
+ %
\begin{codeexample}[]
\tikz \draw[loosely dashed] (0pt,0pt) -- (50pt,0pt);
\end{codeexample}
+ %
\end{stylekey}
-
\begin{stylekey}{/tikz/dash dot}
- Shorthand for setting a dashed and dotted dash pattern.
-
+ Shorthand for setting a dashed and dotted dash pattern.
+ %
\begin{codeexample}[]
\tikz \draw[dash dot] (0pt,0pt) -- (50pt,0pt);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/densely dash dot}
- Shorthand for setting a densely dashed and dotted dash pattern.
-
+ Shorthand for setting a densely dashed and dotted dash pattern.
+ %
\begin{codeexample}[]
\tikz \draw[densely dash dot] (0pt,0pt) -- (50pt,0pt);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/loosely dash dot}
- Shorthand for setting a loosely dashed and dotted dash pattern.
-
+ Shorthand for setting a loosely dashed and dotted dash pattern.
+ %
\begin{codeexample}[]
\tikz \draw[loosely dash dot] (0pt,0pt) -- (50pt,0pt);
\end{codeexample}
+ %
\end{stylekey}
-
\begin{stylekey}{/tikz/dash dot dot}
- Shorthand for setting a dashed and dotted dash pattern with more dots.
-
+ Shorthand for setting a dashed and dotted dash pattern with more dots.
+ %
\begin{codeexample}[]
\tikz \draw[dash dot dot] (0pt,0pt) -- (50pt,0pt);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/densely dash dot dot}
- Shorthand for setting a densely dashed and dotted dash pattern with more dots.
-
+ Shorthand for setting a densely dashed and dotted dash pattern with more dots.
+ %
\begin{codeexample}[]
\tikz \draw[densely dash dot dot] (0pt,0pt) -- (50pt,0pt);
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/loosely dash dot dot}
- Shorthand for setting a loosely dashed and dotted dash pattern with more dots.
-
+ Shorthand for setting a loosely dashed and dotted dash pattern with more dots.
+ %
\begin{codeexample}[]
\tikz \draw[loosely dash dot dot] (0pt,0pt) -- (50pt,0pt);
\end{codeexample}
+ %
\end{stylekey}
\subsubsection{Graphic Parameters: Draw Opacity}
-When a line is drawn, it will normally ``obscure'' everything behind
-it as if you had used perfectly opaque ink. It is also possible to ask
-\tikzname\ to use an ink that is a little bit (or a big bit)
-transparent using the |draw opacity| option. This is explained in
-Section~\ref{section-tikz-transparency} on transparency in more detail.
-
+When a line is drawn, it will normally ``obscure'' everything behind it as if
+you had used perfectly opaque ink. It is also possible to ask \tikzname\ to use
+an ink that is a little bit (or a big bit) transparent using the |draw opacity|
+option. This is explained in Section~\ref{section-tikz-transparency} on
+transparency in more detail.
\subsubsection{Graphic Parameters: Double Lines and Bordered Lines}
\begin{key}{/tikz/double=\meta{core color} (default white)}
- This option causes ``two'' lines to be drawn instead of a single
- one. However, this is not what really happens. In reality, the path
- is drawn twice. First, with the normal drawing color, secondly with
- the \meta{core color}, which is normally |white|. Upon the second
- drawing, the line width is reduced. The net effect is that it
- appears as if two lines had been drawn and this works well even with
- complicated, curved paths:
-
+ This option causes ``two'' lines to be drawn instead of a single one.
+ However, this is not what really happens. In reality, the path is drawn
+ twice. First, with the normal drawing color, secondly with the \meta{core
+ color}, which is normally |white|. Upon the second drawing, the line width
+ is reduced. The net effect is that it appears as if two lines had been
+ drawn and this works well even with complicated, curved paths:
+ %
\begin{codeexample}[]
\tikz \draw[double]
plot[smooth cycle] coordinates{(0,0) (1,1) (1,0) (0,1)};
\end{codeexample}
- You can also use the doubling option to create an effect in which a
- line seems to have a certain ``border'':
-
+ You can also use the doubling option to create an effect in which a line
+ seems to have a certain ``border'':
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) -- (1,1);
\draw[draw=white,double=red,very thick] (0,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\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
- 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
- ``selects'' the |double| option.
-
+ Sets the distance the ``two'' lines are spaced apart. In reality, 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 ``selects'' the |double| option.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[very thick,double] (0,0) arc (180:90:1cm);
@@ -493,77 +532,82 @@ Section~\ref{section-tikz-transparency} on transparency in more detail.
\draw[thin,double distance=2pt] (2,0) arc (180:90:1cm);
\end{tikzpicture}
\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, but
- 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.
-
+ This option works like |double distance|, only the distance is not the
+ distance between (inner) borders of the two main lines, but 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.
+ 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}
-
\subsection{Adding Arrow Tips to a Path}
\label{section-arrow-tip-action}
-In different situations, \tikzname\ will add arrow tips to the end of
-a path. For this to happen, a number of different things need to be
-specified:
-
+In different situations, \tikzname\ will add arrow tips to the end of a path.
+For this to happen, a number of different things need to be specified:
+%
\begin{enumerate}
-\item You must have used the |arrows| key, explained in detail in
- Section~\ref{section-tikz-arrows}, to setup which kinds of arrow
- tips you would like.
-\item The path may not be closed (like a circle or a rectangle) and,
- if it consists of several subpath, further restrictions apply as
- explained in Section~\ref{section-tikz-arrows}.
-\item The |tips| key must be set to an appropriate value, see
- Section~\ref{section-tikz-arrows} once more.
+ \item You must have used the |arrows| key, explained in detail in
+ Section~\ref{section-tikz-arrows}, to setup which kinds of arrow tips
+ you would like.
+ \item The path may not be closed (like a circle or a rectangle) and, if
+ it consists of several subpath, further restrictions apply as
+ explained in Section~\ref{section-tikz-arrows}.
+ \item The |tips| key must be set to an appropriate value, see
+ Section~\ref{section-tikz-arrows} once more.
\end{enumerate}
-For the current section on paths, it is only important that when you
-add the |tips| option to a path that is not drawn, arrow tips will
-still be added at the beginning and at the end of the current
-path. This is true even when ``only'' arrow tips get drawn for a path
-without drawing the path itself. Here is an example:
+For the current section on paths, it is only important that when you add the
+|tips| option to a path that is not drawn, arrow tips will still be added at
+the beginning and at the end of the current path. This is true even when
+``only'' arrow tips get drawn for a path without drawing the path itself. Here
+is an example:
+%
\begin{codeexample}[width=2cm]
\tikz \path[tips, -{Latex[open,length=10pt,bend]}] (0,0) to[bend left] (1,0);
\end{codeexample}
+%
\begin{codeexample}[width=2cm]
\tikz \draw[tips, -{Latex[open,length=10pt,bend]}] (0,0) to[bend left] (1,0);
\end{codeexample}
@@ -571,21 +615,22 @@ without drawing the path itself. Here is an example:
\subsection{Filling a Path}
\label{section-rules}
+
To fill a path, use the following option:
+%
\begin{key}{/tikz/fill=\meta{color} (default \normalfont is scope's color setting)}
- This option causes the path to be filled. All unclosed parts of the
- path are first closed, if necessary. Then, the area enclosed by the
- path is filled with the current filling color, which is either the
- last color set using the general |color=| option or the optional
- color \meta{color}. For self-intersection paths and for paths
- consisting of several closed areas, the ``enclosed area'' is
- somewhat complicated to define and two different definitions exist,
- namely the nonzero winding number rule and the even odd rule, see
- the explanation of these options, below.
-
- Just as for the |draw| option, setting \meta{color} to |none|
- disables filling locally.
-
+ This option causes the path to be filled. All unclosed parts of the path
+ are first closed, if necessary. Then, the area enclosed by the path is
+ filled with the current filling color, which is either the last color set
+ using the general |color=| option or the optional color \meta{color}. For
+ self-intersection paths and for paths consisting of several closed areas,
+ the ``enclosed area'' is somewhat complicated to define and two different
+ definitions exist, namely the nonzero winding number rule and the even odd
+ rule, see the explanation of these options, below.
+
+ Just as for the |draw| option, setting \meta{color} to |none| disables
+ filling locally.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\fill (0,0) -- (1,1) -- (2,1);
@@ -595,15 +640,15 @@ To fill a path, use the following option:
\end{tikzpicture}
\end{codeexample}
- If the |fill| option is used together with the |draw| option (either
- because both are given as options or because a |\filldraw| command
- 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
- |fill|: A ``filldrawn'' area will be slightly larger than a filled
- area because of the thickness of the ``pen.''
-
+ If the |fill| option is used together with the |draw| option (either
+ because both are given as options or because a |\filldraw| command 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 |fill|: A ``filldrawn'' area
+ will be slightly larger than a filled area because of the thickness of the
+ ``pen''.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[fill=yellow!80!black,line width=5pt]
\filldraw (0,0) -- (1,1) -- (2,1);
@@ -612,59 +657,57 @@ To fill a path, use the following option:
\filldraw (8,0) -- (9,1) -- (10,0) circle (.5cm);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\subsubsection{Graphic Parameters: Fill Pattern}
-
\label{section-fill-pattern}
-Instead of filling a path with a single solid color, it is also
-possible to fill it with a \emph{tiling pattern}. Imagine a small tile
-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
- 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 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
-change the size or orientation of a pattern without declaring a new
-pattern. For complicated cases, it may be easier to use two nested
-|\foreach| statements to simulate a pattern, but patterns are rendered
-\emph{much} more quickly than simulated ones.
-\begin{key}{/tikz/pattern=\meta{name} (default \normalfont is scope's pattern)}
- This option causes the path to be filled with a pattern. If the
- \meta{name} is given, this pattern is used, otherwise the pattern
- set in the enclosing scope is used. As for the |draw| and |fill|
- options, setting \meta{name} to |none| disables filling locally.
+Instead of filling a path with a single solid color, it is also possible to
+fill it with a \emph{tiling pattern}. Imagine a small tile 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 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 patterns do not have any colors of their own,
+but when it is used the current \emph{pattern color} is used as its color.
- The pattern works like a fill color. In particular, setting a new
- fill color will fill the path with a solid color once more.
+Patterns are not overly flexible. In particular, it is not possible to change
+the size or orientation of a pattern without declaring a new pattern. For
+complicated cases, it may be easier to use two nested |\foreach| statements to
+simulate a pattern, but patterns are rendered \emph{much} more quickly than
+simulated ones.
- Strangely, no \meta{name}s are permissible by default. You need to
- load for instance the |patterns| library, see
- Section~\ref{section-library-patterns}, to install predefined
- patterns.
+\begin{key}{/tikz/pattern=\meta{name} (default \normalfont is scope's pattern)}
+ This option causes the path to be filled with a pattern. If the \meta{name}
+ is given, this pattern is used, otherwise the pattern set in the enclosing
+ scope is used. As for the |draw| and |fill| options, setting \meta{name} to
+ |none| disables filling locally.
+
+ The pattern works like a fill color. In particular, setting a new 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 the |patterns| library, see
+ Section~\ref{section-library-patterns}, to install predefined patterns.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[pattern=dots] (0,0) circle (1cm);
\draw[pattern=fivepointed stars] (0,0) rectangle (3,1);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\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.
-
+ This option is used to set the color to be used for form-only 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);
@@ -679,26 +722,27 @@ pattern. For complicated cases, it may be easier to use two nested
\pattern[pattern color=white,pattern=bricks] \mypath;
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\subsubsection{Graphic Parameters: Interior Rules}
-The following two options can be used to decide how interior points
-should be determined:
+The following two options can be used to decide how interior points should be
+determined:
+%
\begin{key}{/tikz/nonzero rule}
- If this rule is used (which is the default), the following method is
- used to determine whether a given point is ``inside'' the path: From
- the point, shoot a ray in some direction towards infinity (the
- direction is chosen such that no strange borderline cases
- occur). Then the ray may hit the path. Whenever it hits the path, we
- increase or decrease a counter, which is initially zero. If the ray
- hits the path as the path goes ``from left to right'' (relative to
- the ray), the counter is increased, otherwise it is decreased. Then,
- at the end, we check whether the counter is nonzero (hence the
- name). If so, the point is deemed to lie ``inside,'' otherwise it is
- ``outside.'' Sounds complicated? It is.
-
+ If this rule is used (which is the default), the following method is used
+ to determine whether a given point is ``inside'' the path: From the point,
+ shoot a ray in some direction towards infinity (the direction is chosen
+ such that no strange borderline cases occur). Then the ray may hit the
+ path. Whenever it hits the path, we increase or decrease a counter, which
+ is initially zero. If the ray hits the path as the path goes ``from left to
+ right'' (relative to the ray), the counter is increased, otherwise it is
+ decreased. Then, at the end, we check whether the counter is nonzero (hence
+ the name). If so, the point is deemed to lie ``inside'', otherwise it is
+ ``outside''. Sounds complicated? It is.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\filldraw[fill=yellow!80!black]
@@ -726,20 +770,21 @@ should be determined:
\end{scope}
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/even odd rule}
- This option causes a different method to be used for determining the
- inside and outside of paths. While it is less flexible, it turns out
- to be more intuitive.
-
- With this method, we also shoot rays from the point for which we
- wish to determine whether it is inside or outside the filling
- area. However, this time we only count how often we ``hit'' the path
- and declare the point to be ``inside'' if the number of hits is odd.
+ This option causes a different method to be used for determining the inside
+ and outside of paths. While it is less flexible, it turns out to be more
+ intuitive.
- Using the even-odd rule, it is easy to ``drill holes'' into a path.
+ With this method, we also shoot rays from the point for which we wish to
+ determine whether it is inside or outside the filling area. However, this
+ time we only count how often we ``hit'' the path 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=yellow!80!black,even odd rule]
@@ -747,57 +792,58 @@ should be determined:
\draw[->] (0.5,0.5) -- +(0,1) [above] node{crossings: $1+1 = 2$};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\subsubsection{Graphic Parameters: Fill Opacity}
-
\label{section-fill-opacity}
-Analogously to the |draw opacity|, you can also set the fill opacity. Please see Section~\ref{section-tikz-transparency} for more
-details.
+
+Analogously to the |draw opacity|, you can also set the fill opacity. Please
+see Section~\ref{section-tikz-transparency} for more 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:
+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 no 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}
-
+ 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 no 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);
@@ -839,23 +885,23 @@ this process much easier:
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\subsection{Shading a Path}
-You can shade a path using the |shade| option. A shading is like a
-filling, only the shading changes its color smoothly from one color to
-another.
+You can shade a path using the |shade| option. A shading is like a filling,
+only the shading changes its color smoothly from one color to another.
\begin{key}{/tikz/shade}
- Causes the path to be shaded using the currently selected shading
- (more on this later). If this option is used together with the
- |draw| option, then the path is first shaded, then drawn.
-
- It is not an error to use this option together with the |fill|
- option, but it makes no sense.
+ Causes the path to be shaded using the currently selected shading (more on
+ this later). If this option is used together with the |draw| option, then
+ the path is first shaded, then drawn.
+ It is not an error to use this option together with the |fill| option, but
+ it makes no sense.
+ %
\begin{codeexample}[]
\tikz \shade (0,0) circle (1ex);
\end{codeexample}
@@ -863,98 +909,95 @@ another.
\begin{codeexample}[]
\tikz \shadedraw (0,0) circle (1ex);
\end{codeexample}
+ %
\end{key}
-For some shadings it is not really clear how they can ``fill'' the
-path. For example, the |ball| shading normally looks like this: \tikz
-\shade[shading=ball] (0,0) circle (0.75ex);. How is this supposed to
+For some shadings it is not really clear how they can ``fill'' the path. For
+example, the |ball| shading normally looks like this:
+\tikz \shade[shading=ball] (0,0) circle (0.75ex);. How is this supposed to
shade a rectangle? Or a triangle?
-To solve this problem, the predefined shadings like |ball| or |axis|
-fill a large rectangle completely in a sensible way. Then, when the
-shading is used to ``shade'' a path, what actually happens is that the
-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.
-
-The default shading is a smooth transition from gray
-to white and from top to bottom. However, other shadings are also
-possible, for example a shading that will sweep a color from the
-center to the corners outward. To choose the shading, you can use the
-|shading=| option, which will also automatically invoke the |shade|
-option. Note that this does \emph{not} change the shading color, only
-the way the colors sweep. For changing the colors, other options are
-needed, which are explained below.
+To solve this problem, the predefined shadings like |ball| or |axis| fill a
+large rectangle completely in a sensible way. Then, when the shading is used to
+``shade'' a path, what actually happens is that the 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.
+
+The default shading is a smooth transition from gray to white and from top to
+bottom. However, other shadings are also possible, for example a shading that
+will sweep a color from the center to the corners outward. To choose the
+shading, you can use the |shading=| option, which will also automatically
+invoke the |shade| option. Note that this does \emph{not} change the shading
+color, only the way the colors sweep. For changing the colors, other options
+are needed, which are explained below.
\begin{key}{/tikz/shading=\meta{name}}
- This selects a shading named \meta{name}. The following shadings are
- predefined: |axis|, |radial|, and |ball|.
+ This selects a shading named \meta{name}. The following shadings are
+ predefined: |axis|, |radial|, and |ball|.
+ %
\begin{codeexample}[]
\tikz \shadedraw [shading=axis] (0,0) rectangle (1,1);
\tikz \shadedraw [shading=radial] (0,0) rectangle (1,1);
\tikz \shadedraw [shading=ball] (0,0) circle (.5cm);
\end{codeexample}
- The shadings as well as additional shadings are described in more
- detail in Section~\ref{section-library-shadings}.
+ 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 correct shading type,
- see the following example
+ 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 correct shading type, see the
+ following example
+ %
\begin{codeexample}[]
\tikz \shadedraw [left color=red,right color=blue]
(0,0) rectangle (1,1);
\end{codeexample}
- 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
- angle. For example, we can turn a top-to-bottom axis shading into a
- left-to-right shading by rotating it by $90^\circ$.
+ 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 angle. For
+ example, we can turn a top-to-bottom axis shading into a left-to-right
+ shading by rotating it by $90^\circ$.
+ %
\begin{codeexample}[]
\tikz \shadedraw [shading=axis,shading angle=90] (0,0) rectangle (1,1);
\end{codeexample}
- \end{key}
+ \end{key}
\end{key}
-You can also define new shading types yourself. However, for this, you
-need to use the basic layer directly, which is, well, more basic and
-harder to use. Details on how to create a shading appropriate for
-filling paths are given in Section~\ref{section-shading-a-path}.
-
+You can also define new shading types yourself. However, for this, you need to
+use the basic layer directly, which is, well, more basic and harder to use.
+Details on how to create a shading appropriate for filling paths are given in
+Section~\ref{section-shading-a-path}.
\subsection{Establishing a Bounding Box}
-\pgfname\ is reasonably good at keeping track of the size of your picture
-and reserving just the right amount of space for it in the main
-document. However, in some cases you may want to say things like
-``do not count this for the picture size'' or ``the picture is
-actually a little large.'' For this you can use the option
-|use as bounding box| or the command |\useasboundingbox|, which is just
-a shorthand for |\path[use as bounding box]|.
+\pgfname\ is reasonably good at keeping track of the size of your picture and
+reserving just the right amount of space for it in the main document. However,
+in some cases you may want to say things like ``do not count this for the
+picture size'' or ``the picture is actually a little large''. For this you can
+use the option |use as bounding box| or the command |\useasboundingbox|, which
+is just a shorthand for |\path[use as bounding box]|.
\begin{key}{/tikz/use as bounding box}
- Normally, when this option is given on a path, the bounding box of
- the present path is used to determine the size of the picture and
- 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 (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
- doing the clipping, only making \pgfname\ treat everything as if it
- were clipped.
+ Normally, when this option is given on a path, the bounding box of the
+ present path is used to determine the size of the picture and 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 (consider the
+ |\pgfresetboundingbox| command to reset the previous bounding box).
- The first application of this option is to have a |{tikzpicture}|
- overlap with the main text:
+ In a sense, |use as bounding box| has the same effect as clipping all
+ subsequent drawing against the current path -- without actually doing the
+ clipping, only making \pgfname\ treat everything as if it were clipped.
+ The first application of this option is to have a |{tikzpicture}| overlap
+ with the main text:
+ %
\begin{codeexample}[]
Left of picture\begin{tikzpicture}
\draw[use as bounding box] (2,0) rectangle (3,1);
@@ -962,9 +1005,9 @@ Left of picture\begin{tikzpicture}
\end{tikzpicture}right of picture.
\end{codeexample}
- In a second application this option can be used to get better
- control over the white space around the picture:
-
+ 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}
@@ -974,23 +1017,21 @@ Left of picture
right of picture.
\end{codeexample}
- Note: If this option is used on a path inside a \TeX\ group (scope),
- the effect ``lasts'' only until the end of the scope. Again, this
- behavior is the same as for clipping.
-
+ Note: If this option is used on a path inside a \TeX\ group (scope), the
+ effect ``lasts'' only until 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.
+ 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
-bounding box.
-
-Similarly, the |current path bounding box| node has the |rectangle|
-shape and the size of the bounding box of the current path.
-
+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 bounding box.
+Similarly, the |current path bounding box| node has the |rectangle| shape and
+the size of the bounding box of the current path.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw[red] (0,0) circle (2pt);
@@ -1006,104 +1047,136 @@ shape and the size of the bounding box of the current path.
\end{tikzpicture}
\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:
+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}:
+ 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}%
+ \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.
+ %
+ 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|:
+ 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$};
+ \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$};
+ \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$};
+ \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$};
+ \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.
+
+ 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).
+ 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|:
+ 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}%
+ \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).
+ %
+ 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.
+ 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).
+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.
+ 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)}
-\emph{Clipping path} means that all painting on the page is restricted
-to a certain area. This area need not be rectangular, rather an
-arbitrary path can be used to specify this area. The |clip| option,
-explained below, is used to specify the region that is to be used for
-clipping.
-
-A \emph{fading} (a term that I propose, fadings are commonly known
-as soft masks, transparency masks, opacity masks or soft clips) is
-similar to clipping, but a fading allows parts of the picture to be
-only ``half clipped.'' This means that a fading can specify that newly
-painted pixels should be partly transparent. The specification
-and handling of fadings is a bit complex and it is detailed in
-Section~\ref{section-tikz-transparency}, which is devoted to
+\emph{Clipping path} means that all painting on the page is restricted to a
+certain area. This area need not be rectangular, rather an arbitrary path can
+be used to specify this area. The |clip| option, explained below, is used to
+specify the region that is to be used for clipping.
+
+A \emph{fading} (a term that I propose, fadings are commonly known as soft
+masks, transparency masks, opacity masks or soft clips) is similar to clipping,
+but a fading allows parts of the picture to be only ``half clipped''. This
+means that a fading can specify that newly painted pixels should be partly
+transparent. The specification and handling of fadings is a bit complex and it
+is detailed in Section~\ref{section-tikz-transparency}, which is devoted to
transparency in general.
\begin{key}{/tikz/clip}
- This option causes all subsequent drawings to be clipped against the
- current path and the size of subsequent paths will not be important
- for the picture size. If you clip against a self-intersecting path,
- the even-odd rule or the nonzero winding number rule is used to
- determine whether a point is inside or outside the clipping region.
-
- The clipping path is a graphic state parameter, so it will be reset
- at the end of the current scope. Multiple clippings accumulate, that
- is, clipping is always done against the intersection of all clipping
- areas that have been specified inside the current scopes. The only
- way of enlarging the clipping area is to end a |{scope}|.
-
+ This option causes all subsequent drawings to be clipped against the
+ current path and the size of subsequent paths will not be important for the
+ picture size. If you clip against a self-intersecting path, the even-odd
+ rule or the nonzero winding number rule is used to determine whether a
+ point is inside or outside the clipping region.
+
+ The clipping path is a graphic state parameter, so it will be reset at the
+ end of the current scope. Multiple clippings accumulate, that is, clipping
+ is always done against the intersection of all clipping areas that have
+ been specified inside the current scopes. The only way of enlarging the
+ clipping area is to end a |{scope}|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[clip] (0,0) circle (1cm);
@@ -1111,12 +1184,12 @@ transparency in general.
\end{tikzpicture}
\end{codeexample}
- It is usually a \emph{very} good idea to apply the |clip| option only
- 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]|.
+ It is usually a \emph{very} good idea to apply the |clip| option only 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]|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\clip (0,0) circle (1cm);
@@ -1124,9 +1197,9 @@ transparency in general.
\end{tikzpicture}
\end{codeexample}
- To keep clipping local, use |{scope}| environments as in the
- following example:
-
+ To keep clipping local, use |{scope}| environments as in the following
+ example:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) -- ( 0:1cm);
@@ -1146,48 +1219,45 @@ transparency in general.
\end{tikzpicture}
\end{codeexample}
- There is a slightly annoying catch: You cannot specify certain graphic
- options for the command used for clipping. For example, in the above
- 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.
+ There is a slightly annoying catch: You cannot specify certain graphic
+ options for the command used for clipping. For example, in the above 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.
\end{key}
-
\subsection{Doing Multiple Actions on a Path}
-If more than one of the basic actions like drawing, clipping and
-filling are requested, they are automatically applied in a sensible
-order: First, a path is filled, then drawn, and then clipped (although
-it took Apple two mayor revisions of their operating system to get
-this right\dots). Sometimes, however, you need finer control over what
-is done with a path. For instance, you might wish to first fill a path
-with a color, then repaint the path with a pattern and then repaint it
-with yet another pattern. In such cases you can use the following two
-options:
+If more than one of the basic actions like drawing, clipping and filling are
+requested, they are automatically applied in a sensible order: First, a path is
+filled, then drawn, and then clipped (although it took Apple two mayor
+revisions of their operating system to get this right\dots). Sometimes,
+however, you need finer control over what is done with a path. For instance,
+you might wish to first fill a path with a color, then repaint the path with a
+pattern and then repaint it with yet another pattern. In such cases you can use
+the following two options:
\begin{key}{/tikz/preaction=\meta{options}}
- This option can be given to a |\path| command (or to derived
- commands like |\draw| which internally call |\path|). Similarly to
- options like |draw|, this option only has an effect when given to a
- |\path| or as part of the options of a |node|; as an option to a
- |{scope}| it has no effect.
-
- When this option is used on a |\path|, the effect is the following:
- When the path has been completely constructed and is about to be
- used, a scope is created. Inside this scope, the path is used but
- not with the original path options, but with \meta{options}
- instead. Then, the path is used in the usual manner. In other words,
- the path is used twice: Once with \meta{options} in force and then
- again with the normal path options in force.
-
- Here is an example in which the path consists of a rectangle. The
- main action is to draw this path in red (which is why we see a red
- rectangle). However, the preaction is to draw the path in blue,
- which is why we see a blue rectangle behind the red rectangle.
+ This option can be given to a |\path| command (or to derived commands like
+ |\draw| which internally call |\path|). Similarly to options like |draw|,
+ this option only has an effect when given to a |\path| or as part of the
+ options of a |node|; as an option to a |{scope}| it has no effect.
+
+ When this option is used on a |\path|, the effect is the following: When
+ the path has been completely constructed and is about to be used, a scope
+ is created. Inside this scope, the path is used but not with the original
+ path options, but with \meta{options} instead. Then, the path is used in
+ the usual manner. In other words, the path is used twice: Once with
+ \meta{options} in force and then again with the normal path options in
+ force.
+
+ Here is an example in which the path consists of a rectangle. The main
+ action is to draw this path in red (which is why we see a red rectangle).
+ However, the preaction is to draw the path in blue, which is why we see a
+ blue rectangle behind the red rectangle.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -1198,13 +1268,13 @@ options:
\end{tikzpicture}
\end{codeexample}
- Note that when the preactions are preformed, then the path is
- already ``finished.'' In particular, applying a coordinate
- transformation to the path has no effect. By comparison, applying a
- canvas transformation does have an effect. Let us use this to add a
- ``shadow'' to a path. For this, we use the preaction to fill the
- path in gray, shifted a bit to the right and down:
-
+ Note that when the preactions are preformed, then the path is already
+ ``finished''. In particular, applying a coordinate transformation to the
+ path has no effect. By comparison, applying a canvas transformation does
+ have an effect. Let us use this to add a ``shadow'' to a path. For this, we
+ use the preaction to fill the path in gray, shifted a bit to the right and
+ down:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -1216,19 +1286,18 @@ options:
\end{tikzpicture}
\end{codeexample}
- Naturally, you would normally create a style |shadow| that contains
- the above code. The shadow library, see
- Section~\ref{section-libs-shadows}, contains predefined shadows of
- this kind.
+ Naturally, you would normally create a style |shadow| that contains the
+ above code. The shadow library, see Section~\ref{section-libs-shadows},
+ contains predefined shadows of this kind.
- It is possible to use the |preaction| option multiple times. In this
- case, for each use of the |preaction| option, the path is used again
- (thus, the \meta{options} do not accumulate in a single usage of the
- path). The path is used in the order of |preaction| options given.
+ It is possible to use the |preaction| option multiple times. In this case,
+ for each use of the |preaction| option, the path is used again (thus, the
+ \meta{options} do not accumulate in a single usage of the path). The path
+ is used in the order of |preaction| options given.
- 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.
+ 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -1241,9 +1310,10 @@ options:
\end{tikzpicture}
\end{codeexample}
- A complicated application is shown in the following example, where
- the path is used several times with different fadings and shadings
- to create a special visual effect:
+ A complicated application is shown in the following example, where the path
+ is used several times with different fadings and shadings to create a
+ special visual effect:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[
@@ -1279,20 +1349,22 @@ options:
text=white] at (1,1.5) {Small};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/postaction=\meta{options}}
- The postactions work in the same way as the preactions, only they
- are applied \emph{after} the main action has been taken. Like
- preactions, multiple |postaction| options may be given to a |\path|
- command, in which case the path is reused several times, each time
- with a different set of options in force.
+ The postactions work in the same way as the preactions, only they are
+ applied \emph{after} the main action has been taken. Like preactions,
+ multiple |postaction| options may be given to a |\path| command, in which
+ case the path is reused several times, each time with a different set of
+ options in force.
- If both pre- and postactions are specified, then the preactions are
- taken first, then the main action, and then the post actions.
+ If both pre- and postactions are specified, then the preactions are taken
+ first, then the main action, and then the post actions.
- In the first example, we use a postaction to draw the path, after it
- has already been drawn:
+ In the first example, we use a postaction to draw the path, after it has
+ already been drawn:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -1303,8 +1375,8 @@ options:
\end{tikzpicture}
\end{codeexample}
- In another example, we use a postaction to ``colorize'' a path:
-
+ In another example, we use a postaction to ``colorize'' a path:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -1316,19 +1388,19 @@ options:
(1,2) circle (5mm);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\subsection{Decorating and Morphing a Path}
-Before a path is used, it is possible to first ``decorate'' and/or
-``morph'' it. Morphing means that the path is replaced by another path
-that is 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.
+Before a path is used, it is possible to first ``decorate'' and/or ``morph''
+it. Morphing means that the path is replaced by another path that is 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.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) rectangle (3,2);
@@ -1337,8 +1409,9 @@ example the path is drawn twice: Once normally and then in a morphed
\end{tikzpicture}
\end{codeexample}
-Naturally, we could have combined this into a single command using
-pre- or postaction. It is also possible to deform shapes:
+Naturally, we could have combined this into a single command using pre- or
+postaction. It is also possible to deform shapes:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\node [circular drop shadow={shadow scale=1.05},minimum size=3.13cm,
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-animations.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-animations.tex
new file mode 100644
index 00000000000..4d58fa6d79b
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-animations.tex
@@ -0,0 +1,2602 @@
+% Copyright 2015 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{Animations}
+\label{section-tikz-animations}
+
+\begin{tikzlibrary}{animations}
+ This library must be loaded in order to use animations with \tikzname.
+\end{tikzlibrary}
+
+
+\subsection{Introduction}
+
+An \emph{animation} changes the appearance of some part of a graphic over time.
+The archetypical animation is, of course, a \emph{movement} of some part of a
+picture, but a change of, say, the opacity of a path is also an animation.
+\tikzname\ allows you to specify such animations using special keys and
+notations.
+%
+\begin{codeexample}[width=8cm,animation list={0.7,1.4,2.1,2.8},animation scale=.25]
+\begin{tikzpicture}[
+ animate/orbit/.style 2 args = {
+ myself:shift = {
+ along = {
+ (0,0) circle [radius=#1]
+ } sloped in #2s/10,
+ repeats }} ]
+
+ \node :color = {0s = "orange",
+ 2s = "red",
+ 4s = "orange",
+ repeats}
+ {Sun};
+
+ \begin{scope}[animate={orbit={2.5cm}{365}}]
+ \node {Earth};
+ \node [animate={orbit={1cm}{28}}] {Moon};
+ \end{scope}
+
+ \useasboundingbox (-3.8,-3.8) (3.8,3.8);
+\end{tikzpicture}
+\end{codeexample}
+
+Adding an animation to a \tikzname\ picture is done as follows:
+%
+\begin{enumerate}
+ \item \emph{Before} or \emph{in the options of} the to-be-animated object
+ you specify the object together with an \emph{attribute} that you wish
+ to animate. Attributes are things like the fill color or the line width
+ or the position of the object.
+ \item You specify \emph{when} this attribute should have \emph{which}
+ values using a so-called \emph{timeline}. This is just a curve that
+ specifies for each point in time which value the attribute should have.
+ \item You can additionally use further options to configure the animation,
+ for instance you can specify that the animation should repeat or that
+ it should only start when a certain object is clicked.
+\end{enumerate}
+
+As a simple example, let us move a circle within thirty seconds by three
+centimeters to the left:
+%
+\begin{codeexample}[width=2cm]
+\tikz \draw :xshift = {0s = "0cm", 30s = "-3cm", repeats} (0,0) circle (5mm);
+\end{codeexample}
+
+As can be seen, a special syntax is used in several places: Entries with a
+colon such as |:xshift| specify an attribute, values are specified in quotation
+marks. This syntax will be explained in more detail later on.
+
+
+\subsubsection{Animations Change Attributes}
+
+Before we plunge into the details of how animations are specified, it is
+important to understand what \tikzname\ actually does when creating an
+animation: It does \emph{not} (as all other animation packages do) precompute a
+sequence of pictures that are later somehow displayed in rapid succession.
+Neither does it insert an external video into the document. Rather, a
+\tikzname\ animation is just an ``annotation'' in the output that a certain
+attribute of a certain object should change over time in some specific way when
+the object is displayed. It is the job of the document viewer application to
+actually compute and display the animation. The big advantage of this approach
+is that animations neither increase the output file sizes noticeably nor do
+they really slow down \TeX: The hard and complicated calculations are done by
+the viewer application. The disadvantage is, of course, that a document viewer
+application must understand the annotations and actually compute and display
+the animations. The \textsc{svg} format is a format for which this is possible,
+the popular \textsc{pdf} format is not. For the \textsc{svg} format, there are
+actually different possible ways of ``formulating'' the animations (using
+\textsc{smil} or \textsc{css} or JavaScript) and they have different advantages
+and disadvantages.
+
+To make a long story short: \tikzname\ animations currently work only with
+\textsc{svg} output (and use the \textsc{smil} ``flavor'' of describing
+animations). In future, it may well happen that other ``flavor'' of describing
+animations will be added, but it is very unlikely that \textsc{pdf} will ever
+support animations in a useful way.
+
+It is, however, possible to create ``snapshots'' of an animation and insert
+these into \textsc{pdf} files (or any other kind of file including \textsc{svg}
+files), see Section~\ref{section-anim-snap} for details. Snapshots are also
+useful for creating ``printed versions'' of animations and all of the small
+sequences of pictures in the manual that are used for showing what an animation
+key does have been creating using snapshots.
+
+
+\subsubsection{Limitations of the Animation System}
+
+There are a certain limitations of the animation system that you should keep in
+mind when considering how and when to use it:
+%
+\begin{enumerate}
+ \item As pointed out earlier, animations require a specific output format
+ (currently only \textsc{svg} is supported).
+ \item It is extremely difficult to animate ``lines between moving nodes''
+ correctly. Consider code like |\draw(a)--(b);| where |a| and |b| are
+ nodes. Now, when you animate the position of~|(a)|, the line connecting
+ |(a)| and |(b)| will, unfortunately, not ``move along'' automatically
+ (but it is easy to move the whole group of |(a)|, |(b)|, and the
+ connecting ling as whole). You must ``cheat'' and introduce some
+ ``virtual'' nodes, which leads to rather complex and bloated code.
+ \item Animation are taken into consideration for bounding box computations,
+ but only for shifts, not for rotations, scaling, or skewing and also
+ possibly not when multiple shifts are active at the same time for the
+ same object.
+\end{enumerate}
+
+
+\subsubsection{Concepts: (Graphic) Objects}
+
+During an animation an attribute of a certain ``object'' changes over time. The
+term ``object'' is deliberately a bit vague since there are numerous different
+``things'' whose attributes can change. In detail, the following objects have
+attributes that can be animated:
+%
+\begin{enumerate}
+ \item Nodes, which are created by the |\node| command (and, also,
+ internally by commands such as |\graph|). For nodes, different parts of
+ the node can be animated separately; for instance, you can animate the
+ color of the background path, but also the color of the text, and also
+ the color of the foreground path (though most nodes do not have a
+ foreground path) and also the color of different text parts (though
+ only few nodes have multiple text parts).
+ \item Graphic scopes, which are created by numerous command, including the
+ |{scope}| environment, the |\scopes| command, but also |\tikz| itself
+ creates a graphic scope and so does each node and even each path.
+ \item View boxes, which can only be created using the |view| library.
+ \item Paths, which you create using the |\path| command or commands like
+ |\draw| that call |\path| internally. However, the (usually background)
+ path of a node can also be animated. Note that ``animating the path''
+ really means that the path itself should change over time; in essence,
+ you can ``warp'' a path over time.
+\end{enumerate}
+
+In all of these cases, you must either specify the animation inside the
+object's options using |animate| or use the |name| key to name the object and,
+then, refer to it in an |animate|. For nodes you can, of course, use the
+|(|\meta{node name}|)| syntax to name the node. Recall that you must
+\emph{always} specify the animation \emph{before} the object is created; it is
+not possible to animate an already created object.
+
+There is a special syntax for choosing the object of an animation, see
+Section~\ref{section-anim-syntax-obj}, but you can also use the |object| key to
+choose them directly, see Section~\ref{section-anim-def-obj}.
+
+
+\subsubsection{Concepts: Attributes}
+
+In addition to the to-be-animated object, you must also choose an
+\emph{attribute} that you wish to animate. Attributes are things like the color
+of an object, the position, but also things like the line width. The syntax for
+choosing attributes and the list of attributes will be explained in detail
+later on.
+
+Most attributes correspond directly to attributes that are directly supported
+by the backend driver (\textsc{svg}), but this is not always the case. For
+instance, for a node, \tikzname\ differentiates between the fill color, the
+draw (stroke) color, and the text color, while \textsc{svg} treats the text
+color are a special case of the fill color. \tikzname\ will do some internal
+mappings to ensure that you can animate the ``\tikzname\ attributes'' even when
+they are not directly supported.
+
+The same syntax that is used for specifying object is also used to specify
+attributes, see Section~\ref{section-anim-syntax-obj}, but you could also set
+them directly using the |attribute| key see
+Section~\ref{section-anim-def-attr}.
+
+
+\subsubsection{Concepts: Timelines}
+
+Once an object and an attribute have been chosen, a \emph{timeline} needs to be
+established. This is, essentially, a curve that specifies for each ``moment in
+time'' which value the attribute should have.
+
+A timeline has a \emph{start} and an \emph{end}, but the start need not be the
+``moment zero'' (we will come to that) and may even be negative, while the end
+may be at infinity. You specify the timeline by specifying for certain points
+in time what the value is at that moment; for all other moments the value is
+then interpolated. For instance, if you specify that the attribute |:xshift|
+(the ``horizontal position'' of the object) is 0\,mm at time 5\,s and 10\,mm at
+time 10\,s, then at 7.5\,s it will be 5\,mm and at 9\,s it will be 8\,mm
+(assuming a linear interpolation). The resulting optical effect will be that
+the object \emph{smoothly moves} by one centimeter to the right over a period
+of five seconds, starting five seconds after ``moment zero''.
+
+Now, what is the ``moment zero'', the ``beginning of an animation''? If nothing
+else is specified, an animation starts immediately when the graphic is shown
+and this is the moment zero relative to which the timeline is measured.
+However, it is also possible to change this. In particular, you can specify
+that the moment zero is when a particular \emph{event} occurs such as the user
+clicking on another object or another animation ending or starting.
+
+The interpolation of values is not always a straightforward affair. Firstly,
+for certain kinds of values is not clear how an interpolation should be
+computed. How does one interpolate between two paths? Between the colors red
+and green? Between the values |"true"| and |"false"|? In these cases, one must
+define carefully what the interpolation should be. Secondly, you may wish to
+use a non-linear interpolation, which is useful for ``easing'' motions: The
+visual effect of the movement specified above is that the object sits still
+from moment $0$ for five seconds, then there is an ``infinite acceleration''
+causing the object to suddenly move at the speed of 2\,mm per second, then
+there is no acceleration at all for five seconds, causing the object to move
+for one centimeter, followed by an ``infinite negative acceleration'' that
+makes the object come to a full stop. As a viewer you experience these infinite
+accelerations as ``unrealistic'', spoiling the effect of watching a (virtual)
+physical process. Non-linear interpolations allow you to avoid this effect.
+
+Just as for specifying objects and attributes, there is also a special syntax
+for specifying times and values.
+
+
+\subsection{Creating an Animation}
+
+\subsubsection{The Animate Key}
+
+In order to animate a picture, you create timelines for all objects and
+attributes that change during the animation. The key |animate| is used for
+creating these timelines.
+
+\begin{key}{/tikz/animate=\meta{animation specification}}
+ You must place all specifications of animations inside uses of |animate|.
+ You can, and usually should, place the specification of all timelines of a
+ single picture inside a single use of this key since it will reset the time
+ and the fork time (explained in Section~\ref{section-anim-def-times}). You
+ can, however, use this key several times, in principle. Note that if you
+ animate the same attribute of the same object in two different uses of
+ |animate|, two separate timelines will result (and complicated rules are
+ used to determine which one ``wins'' in case they specify conflicting
+ values for the attribute at different times).
+
+ The key can be used at all places where a \tikzname\ key is used; typically
+ you will use it with a |{scope}| environment, inside the options of a node,
+ or directly with the |\tikz| command:
+ %
+\begin{codeexample}[animation list = {0.5,1,1.5,2}]
+\tikz \node [fill, text = white, animate = {
+ myself:fill = {0s = "red", 2s = "blue", begin on = click }}] {Click me};
+\end{codeexample}
+ %
+\begin{codeexample}[animation list = {0.5,1,1.5,2}]
+\tikz [animate = {a node:fill = {0s = "red", 2s = "blue",
+ begin on = click}}]
+ \node (a node) [fill, text = white] {Click me};
+\end{codeexample}
+
+ The details of what, exactly, happens in the \meta{animation specification}
+ will be described in the rest of this section. However, basically, an
+ \meta{animation specification} is just a sequence of normal \tikzname\
+ key--value pairs that get executed with the path prefix |/tikz/animate| and
+ with some special syntax handlers installed. In particular, you can define
+ styles for this key path and use them. For instance, we can define a
+ |shake| animation like this:
+ %
+\begin{codeexample}[width=4cm]
+\tikzset{
+ animate/shake/.style = {myself:xshift = { begin on=click,
+ 0s = "0mm", 50ms = "#1", 150ms = "-#1", 250ms = "#1", 300ms = "0mm" }}}
+\tikz \node [fill = blue!20, draw=blue, very thick, circle,
+ animate = {shake = 1mm}] {Shake};
+\tikz \node [fill = blue!20, draw=blue, very thick, circle,
+ animate = {shake = 2mm}] {SHAKE};
+\end{codeexample}
+
+ Note that, as stressed earlier, you can only use the |animate| key to
+ specify animations for objects that do not yet exist. The node and object
+ names mentioned in a specification always refer to ``upcoming'' objects;
+ already existing objects of the same name are not influenced.
+
+ You can use the |name| key inside |animate| to ``name'' the animation. Once
+ named, you can later reference the animation in other animations; for
+ instance, you can say that another animation should start when the present
+ animation has ended.
+\end{key}
+
+
+\subsubsection{Timeline Entries}
+
+The ``job'' of the options passed to the |animate| key is to specify the
+timelines of the animation of (a part of) a picture. For each object and each
+attribute there may or may not be a timeline and, if present, the timeline
+consist of sequences of pairs of times and values. Thus, the most basic entity
+of an animation specification is a tuple consisting of five parts, which are
+selected by five different keys:
+%
+\begin{itemize}
+ \item |object| for selecting the object,
+ \item |attribute| for selecting the attribute,
+ \item |id| for selecting the timeline id (explained in
+ Section~\ref{section-anim-def-id}),
+ \item |time| for selecting a time, and
+ \item |value| for selecting a value.
+\end{itemize}
+%
+When all of these parts have been set up (using the above keys, which will be
+explained in more detail in a moment), you can use the following key to create
+an entry:
+
+\begin{key}{/tikz/animate/entry}
+ Each time this key is used in the options of |animate|, \tikzname\ checks
+ whether the five keys |object|, |attribute|, |id|, |time|, and |value| are
+ set. If one of them is not set, nothing happens. (The |id| key is set to
+ the value |default| by default, all other keys must be set explicitly.)
+
+ If all of these keys are set, a \emph{time--value} pair is created and
+ added to the timeline of attribute of the object. Additionally, all options
+ starting with |/tikz/animate/options/|, which also influence the timeline
+ like |begin on|, are also added to the timeline of the object--attribute
+ pair.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [animate = {
+ object = node, attribute = fill, time = 0s, value = red, entry,
+ object = node, attribute = fill, time = 2s, value = blue, entry,
+ object = node, attribute = fill, begin on = click, entry}]
+ \node (node) [fill, text=white] { Click me };
+\end{codeexample}
+ %
+ In the above example, it would not have been necessary the specify the
+ object and the attribute in each line, they retain their values unless they
+ are overwritten. Thus, we could also have written:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [animate = {
+ object = node, attribute = fill, time = 0s, value = red, entry,
+ time = 2s, value = blue, entry,
+ begin on = click, entry}]
+ \node (node) [fill, text=white] { Click me };
+\end{codeexample}
+ %
+ Note, however, that in both examples we actually add the time--value pair
+ $(2\mathrm{s}, \mathrm{blue})$ twice since the |time| and |value| keys also
+ retain their settings and, thus, for the third |entry| they have the same
+ values as before and a new pair is added. While this superfluous pair is
+ not a problem in the example (it has no visual effect), we will see later
+ on how such pairs can be avoided by using the |scope| key.
+
+ A sequence of calls of |entry| can freely switch between objects and
+ attributes (that is, between timelines), but the times for any given
+ timeline must be given in non-decreasing order:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [animate = {
+ object = node, attribute = fill, time = 0s, value = red, entry,
+ object = node2, attribute = draw, entry,
+ object = node, attribute = fill, time = 2s, value = blue, entry,
+ object = node2, attribute = draw, entry,
+ object = node, attribute = fill, begin on = click, entry,
+ object = node2, attribute = draw, begin on = click, entry}] {
+ \node (node) [fill, text=white] { Node 1 };
+ \node (node2) [draw, ultra thick] at (0,-1) { Node 2 };
+}
+\end{codeexample}
+ %
+ In the above example, we could not have exchanged the first two lines of
+ the |animate| options with the third and fourth line since the values for
+ time |0s| must come before the values for time |2s|.
+\end{key}
+
+In the following, we have a closer look at the five keys the influence the
+|entry| key and then have a look at ways of grouping keys more easily.
+
+
+\subsubsection{Specifying Objects}
+\label{section-anim-def-obj}
+
+You use the |object| key to select the object(s) to which the next use of
+|entry| applies. There is also a special syntax for this, which is explained in
+Section~\ref{section-anim-syntax-obj}.
+
+\begin{key}{/tikz/animate/object=\meta{list of objects}}
+ The \meta{list of objects} is a comma-separated list of strings of the form
+ \meta{object}\opt{|.|\meta{type}}. All of the objects in the list are
+ selected as to-be-animate object for the next use of the |entry| key. The
+ objects referred to by \meta{object} will be the \emph{next} objects with
+ the |name| key set to \meta{object}. You can apply the |name| key to nodes
+ (where you can also use the special parentheses-syntax and put the name in
+ parentheses, it has the same effect), but also to scopes and paths. (The
+ |name path| key is not the same as |name|; it is an older key from the
+ intersections package and not related.)
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [animate = { object = b, :fill = {0s = "red", 2s = "blue",
+ begin on = click }}] {
+ \node (a) [fill, text = white, minimum width=1.5cm] at (0,1cm) {a};
+ \node (b) [fill, text = white, minimum width=1.5cm] at (0,5mm) {b};
+ \node (c) [fill, text = white, minimum width=1.5cm] at (0,0mm) {c}; }
+\end{codeexample}
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [animate = { object = b, :fill = {0s = "red", 2s = "blue",
+ begin on = click },
+ object = c, :fill = {0s = "green", 2s = "blue",
+ begin on = click } }] {
+ \scoped [name = a, yshift=1cm] \fill (0,0) rectangle (1.5cm,2mm);
+ \scoped [name = b, yshift=5mm] \fill (0,0) rectangle (1.5cm,2mm);
+ \scoped [name = c, yshift=0mm] \fill (0,0) rectangle (1.5cm,2mm); }
+\end{codeexample}
+
+ If the \meta{object} name is never used later in the file, no animation is
+ created.
+
+ The \meta{object} may also be the special text |myself|. In this case, the
+ referenced object is the scope or object to which the |animate| key is
+ given. If an object is named |myself| (as in |\node (myself) ...|), you
+ cannot reference this node using the |object| key, |myself| \emph{always}
+ refers to the object where the |animate| key is given (of course, you can
+ animate the node named |myself| by placing the |animate| key inside the
+ options of this node; you only cannot ``remotely'' add an animation to it).
+
+ The \meta{object} may be followed by a dot and a \emph{type}. This is need
+ in rare cases where you want to animate only a special ``part'' of an
+ object that is not accessible in other ways. Normally, \tikzname\ takes
+ care of choosing these types automatically, you only need to set these ``if
+ you know what you are doing''.
+\end{key}
+
+
+\subsubsection{Specifying Attributes}
+\label{section-anim-def-attr}
+
+\begin{key}{/tikz/animate/attribute=\meta{list of attributes}}
+ The list of attributes must be a comma-separated list of attribute names.
+ The timelines specified later will apply to all of these attributes (and to
+ all objects previously selected using |object|). Possible attributes
+ include colors, positions, line width, but even the paths themselves. The
+ exact list of possible attributes is documented in
+ Section~\ref{section-anim-attrs}.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [animate = {attribute = fill, n: = { 0s = "red", 2s = "blue",
+ begin on = click } }]
+ \node (n) [fill, text = white] {The node};
+\end{codeexample}
+\end{key}
+
+
+\subsubsection{Specifying IDs}
+\label{section-anim-def-id}
+
+\begin{key}{/tikz/animate/id=\meta{id} (initially default)}
+ Timelines are use to defined how the values of an attribute of an object
+ change over time. In many cases, you will have at most one timeline for
+ each object--attribute pair, but, sometimes, you may wish to have more than
+ one timeline for the same object and the same attribute. For instance, you
+ might have a timeline that specifies a changing |shift| of a node in some
+ direction and, at the same time, another timeline that specifies an
+ additional |shift| in some other direction(s). The problem is that there is
+ only one |shift| attribute and it would be difficult to compute the joint
+ effect of the two timelines.
+
+ For this purpose, timelines are actually identified not only by the
+ object--attribute pair but, in reality, by the triple consisting of the
+ object, the attribute, and the value of this key. We can now specify two
+ separate timelines:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [animate = {
+ id = 1, n:shift = { 0s = "{(0,0)}", 2s = "{(0,5mm)}", begin on = click },
+ id = 2, n:shift = { 0s = "{(0,0)}", 2s = "{(5mm,0)}", begin on = click }
+}]
+ \node (n) [fill = blue!20, draw=blue, very thick] {The node};
+\end{codeexample}
+
+ The default value of |id| is |default|.
+\end{key}
+
+Because of the possibility of creating multiple timelines for the same
+attribute, it may happen that there is more than one timeline active that is
+``trying to modify'' a given attribute. In this case, the following rules are
+used to determine, which timeline ``wins'':
+%
+\begin{enumerate}
+ \item If no animation is active at the current time (all animation either
+ have not yet started or they have already ended), then the |base| value
+ given in the animation encountered last in the code is used. (If there
+ are no base values, the attribute is taken from the surrounding scope
+ and the animations have ``no effect''.)
+ \item If there are several active animations, the one that has started last
+ is used and its value is used.
+ \item If there are several active animations that have started at the same
+ time, the one that comes last in the code is used.
+\end{enumerate}
+
+Note that these rules do not apply to transformations of the canvas since these
+are always additive (or, phrased differently, they are always all active and
+the effects accumulate).
+
+
+\subsubsection{Specifying Times}
+\label{section-anim-def-times}
+
+\begin{key}{/tikz/animate/time=\meta{time}\opt{|later|}}
+ Sets the time for the next time--value pair in a call of |entry| to
+ \meta{time} plus the current fork time. The text |later| is optional. Both
+ ``fork times'' and the optional |later| will be explained in a moment.
+
+ \medskip\textbf{Time Parsing.}
+ The \meta{time} is parsed using the command |\pgfparsetime|, which is
+ essentially the same as the usual math parser of \tikzname, and the result
+ is interpreted as a time in seconds. Thus, a \meta{time} of |2+3| means ``5
+ seconds'' and a \meta{time} of |2*(2.1)| means ``4.2 seconds''. (You could
+ even specify silly times like |1in|, which results in the time ``72.27
+ seconds''. Please do not do that.) The ``essentially'' refers to the fact
+ that some extras are installed when the time parser is running:
+ %
+ \begin{itemize}
+ \item The postfix operator |s| is added, which has no effect. Thus,
+ when you write |5s| you get the same results as |5|, which is
+ exactly 5 seconds as desired.
+ \item The postfix operator |ms| is added, which divides a number by
+ 1000, so |2ms| equals 0.002s.
+ \item The postfix operator |min| is added, which multiplies a number by
+ 60.
+ \item The postfix operator |h| is added, which multiplies a number by
+ 3600.
+ \item The infix operator |:| is redefined, so that it multiplies its
+ first argument by 60 and adds the second. This implies that |1:20|
+ equals 80s and |01:00:00| equals 3600s.
+ \item The parsing of octal numbers is switched off to allow things like
+ |01:08| for 68s.
+ \end{itemize}
+
+ Note that you cannot use the colon syntax for times in things like
+ |01:20 = "0"| would (falsely) be interpreted as: ``For the object named |01|
+ and its attribute named |20|, do something.'' You can, however, use |01:20|
+ in arguments to the |time| key, meaning that you would have to write
+ instead: |time = 1:20, "0"|, possibly surround by a |scope|.
+
+ \medskip\textbf{Relative Times.}
+ You can suffix a |time| key with ``|later|''. In this case, the \meta{time}
+ is interpreted as an offset to the time in the previous use of the time
+ key:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :fill = { begin on = click,
+ 0s = "white",
+ 500ms later = "red",
+ 500ms later = "green", % same as 1s = "-5mm"
+ 500ms later = "blue"} % same as 1.5s = "-2.5mm"
+ [fill=blue!20, draw=blue, very thick, circle] {Click me};
+\end{codeexample}
+
+ In reality, the offset is not taken to just any previous use of the |time|
+ key, but to the most recent use of this key or of the |resume| key in the
+ current local \TeX\ scope. Here is an example:
+ %
+\begin{codeexample}[code only]
+time = 2s,
+time = 1s later, % same as time = 3s
+time = 500ms later, % same as time = 3.5s
+time = 4s,
+time = 1s later, % same as time = 5s
+scope = { % opens a local scope
+ time = 1s later, % same as time = 6s
+ time = 10s
+ time = 1s later % same as time = 11s
+}, % closes the scope, most recent time is 5s once more
+time = 2s later % same as time = 7s
+\end{codeexample}
+
+ \medskip\textbf{Fork Times.}
+ The time meant by the value \meta{time} passed to the |time| key is not
+ used directly. Rather, \tikzname\ adds the current \emph{fork time} to it,
+ which is |0s| by default. You can change the fork time using the following
+ key:
+ %
+ \begin{key}{/tikz/animate/fork=\meta{t} (default 0s later)}
+ Sets the fork time for the local scope to \meta{t} and sets the current
+ time to |0s|. In this scope, when you use ``absolute'' times like |0s|
+ or |2s|, you actually refer to later times that have started as
+ \meta{t}.
+
+ One application of forks is in the definition of keys that add a
+ certain part to a longer animation. Consider for instance the
+ definition of a |hilight| key:
+ %
+\begin{codeexample}[animation list={1.05,1.1,1.15,1.2,2.05,2.1,2.15,2.2}]
+\tikz [animate/highlight/.style = {
+ scope = { fork = #1,
+ :fill = { 0s = "black", 0.1s = "white", 0.2s = "black"} }
+ }]
+ \node [animate = { myself: = {
+ :fill = { 0s = "black", begin on = click },
+ highlight = 1s, highlight = 2s } },
+ fill = blue, text=white, very thick, circle] { Click me };
+\end{codeexample}
+ %
+ In the above example, we could also have written |0.1s later| instead
+ of |0.2s| and, indeed, the whole style could have been defined using
+ only times with |later|, eliminating the need for the |fork| key.
+ However, using forks you can specify absolute times for things
+ happening in a conceptual ``subprocess'' and also relative times. The
+ name |fork| for the key is also borrowed from operating system theory,
+ where a ``fork'' is the spawning of an independent process.
+ \end{key}
+
+ \medskip\textbf{Remembering and Resuming Times.}
+ When you have a complicated animation with a long timeline, you will
+ sometimes wish to start some animation when some other animation has
+ reached a certain moment; but this moment is only reached through heavy use
+ of |later| times and/or forks. In such situations, the following keys are
+ useful:
+ %
+ \begin{key}{/tikz/animate/remember=\meta{macroname}}
+ This key stores the current time (the time of the last use of the
+ |time| key) globally in the macro \meta{macroname}. This time will
+ include the offset of the fork time:
+ %
+\begin{codeexample}[code only]
+time = 2s,
+fork = 2s later, % fork time is now 4s
+time = 1s, % local time is 1s, absolute time is 5s (1s + fork time)
+time = 1s later, % local time is 2s, absolute time is 6s (2s + fork time)
+remember = \mytime % \mytime is now 6s
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/tikz/animate/resume=\meta{absolute time}}
+ The \meta{absolute time} is evaluated using |\pgfparsetime| and, then,
+ the current time is set to the resulting time minus the fork time. When
+ the \meta{absolute time} is a macro previously set using |remember|,
+ the net effect of this is that we return to the exact ``moment'' in the
+ global time line when |remember| was used.
+ %
+\begin{codeexample}[code only]
+fork = 4s,
+time = 1s,
+remember = \mytime % \mytime is now 5s
+fork = 2s, % fork time is now 2s, local time is 0s
+resume = \mytime % fork time is still 2s, local time is 3s
+\end{codeexample}
+ %
+ Using resume you can easily implement a ``join'' operation for forked
+ times. You simply remember the times at the ends of the forks and then
+ resume the maximum time of these remembered times:
+ %
+\begin{codeexample}[code only]
+scope = {
+ fork,
+ time = 1s later,
+ ...
+ remember = \forka
+},
+scope = {
+ fork,
+ time = 5s later,
+ ...
+ remember = \forkb
+},
+scope = {
+ fork,
+ time = 2s later,
+ ...
+ remember = \forkc
+},
+resume = {max(\forka,\forkb,\forkc)} % "join" the three forks
+\end{codeexample}
+ \end{key}
+\end{key}
+
+
+\subsubsection{Values}
+\label{section-anim-def-values}
+
+\begin{key}{/tikz/animate/value=\meta{value}}
+ This key sets the value of the next time--value pair created by |entry| to
+ \meta{value}. The syntax of the \meta{value} is not fixed, it depends on
+ the type of the attribute. For instance, for an attribute like |opacity|
+ the \meta{value} must be an expression that can be evaluated to a number
+ between 0 and 1; for the attribute |color| the \meta{value} must, instead,
+ be a color; and so on. Take care that when a value contains a comma, you
+ must surround it by braces as in |"{(1,1)}"|.
+
+ The allowed texts for the \meta{value} is always the same as the one you
+ would pass to the \tikzname\ option of the same name. For instance, since
+ the \tikzname\ option |shift| expects a coordinate, you use coordinates as
+ \meta{value} with the usual \tikzname\ syntax (including all sorts of
+ extensions, the animation system calls the standard \tikzname\ parsing
+ routines). The same is true of dimensions, scalar values, colors, and so
+ on.
+
+ In addition to the values normally use for setting the attribute, you can
+ also (sometimes) use the special text |current value| as \meta{value}. This
+ means that the value of the point in the timeline should be whatever the
+ value the attribute has at the beginning of the timeline. For instance,
+ when you write
+ %
+\begin{codeexample}[code only]
+animate = { obj:color = { 0s = "current value", 2s = "white" } }
+\end{codeexample}
+ %
+ the color of |obj| will change from whatever color it currently has to
+ white in two seconds. This is especially useful when several animations are
+ triggered by user events and the current color of |obj| cannot be
+ determined beforehand.
+
+ There are several limitations on the use of the text |current value|, which
+ had to be imposed partly because of the limited support of this feature in
+ \textsc{svg}:
+ %
+ \begin{itemize}
+ \item You can use |current value| only with the first time in a
+ timeline.
+ \item You can only have two times in a timeline that starts with
+ |current value|.
+ \item You cannot use |current value| for timelines of which you wish to
+ take a snapshot.
+ \end{itemize}
+\end{key}
+
+
+\subsubsection{Scopes}
+\label{section-anim-scopes}
+
+When you specify multiple timelines at the same time, it is often useful and
+sometimes even necessary to have keys be set only locally. The following key
+makes this easy:
+
+\begin{key}{/tikz/animate/scope=\meta{options}}
+ Executed the \meta{options} inside a \TeX\ scope. In particular, all
+ settings made inside the scope have no effect after the end of the |scope|.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node [animate = { myself: = { begin on = click,
+ scope = { attribute = fill, repeats = 3, 0s = "red", 2s = "red!50" },
+ scope = { attribute = draw, 0s = "red", 2s = "red!50" }
+ }},
+ fill=blue!20, draw=blue, very thick, circle] {Click me};
+\end{codeexample}
+
+ Without the use of the |scope| key, the |repeats| key would also affect the
+ draw attribute.
+\end{key}
+
+While the |scope| key is useful for structuring timeline code, it also keeps
+the current time local to the scope, that is, if you use something like
+|1s later| after the scope, this will refer to one second after the last use of
+|time| \emph{before} the scope. The times set inside the |scope| do not matter.
+While this is desirable effect for forks, you may also sometimes wish to
+synchronize the local time after the scope with the last time reached in the
+scope. The following key makes this easy:
+
+\begin{key}{/tikz/animate/sync=\meta{options}}
+ A shorthand for |scope={| \meta{options} |, remember=\temp},resume=\temp|
+ where |\temp| is actually an internal name. The effect is that after a
+ |sync| the local time just continues as if the scope where not present --
+ but regarding everything else the effects are local to the |sync| scope.
+\end{key}
+
+
+\subsection{Syntactic Simplifications}
+\label{section-anim-syntax-animate}
+
+In the previous subsection we saw how timelines can be created by specifying
+the individual entries of the timelines sequentially. However, most of the time
+you will wish to use a simpler syntax that makes it easier to specify
+animations. This syntax is only available inside the |animate| key (it is
+switched on at the beginning) and consists of three ``parts'': The colon
+syntax, the time syntax, and the quote syntax.
+
+
+\subsubsection{The Colon Syntax I: Specifying Objects and Attributes}
+\label{section-anim-syntax-obj}
+
+Inside the \meta{animation specification} passed to the |animate| key, you can
+specify an object and an attribute of this object using the following syntax,
+whose use is detected by the presence of a colon inside a key:
+%
+\begin{quote}
+ \normalfont
+ \opt{\meta{object name(s)}}|:|\opt{\meta{attribute(s)}}
+ |={|\meta{options}|}|
+
+ or
+
+ \opt{\meta{object
+ name(s)}}|:|\opt{\meta{attribute(s)}}|_|\opt{\meta{id}}
+ |={|\meta{options}|}|
+\end{quote}
+%
+In the place to the left of an equal sign, where you would normally use a key,
+you can instead place an object name and an attribute separated by a colon.
+Additionally, the attribute may be followed by an underscore and an \meta{id},
+which identifies the timeline (see Section~\ref{section-anim-def-id}).
+
+Each of these values may be missing, in which case it is not changed from its
+previous value.
+
+The effect of the above code is the same as:
+%
+\begin{quote}
+ \normalfont
+ |sync = { object = |\meta{objects}|, attribute = |\meta{attribute}|, id = |\meta{id}|, |\meta{options}|, entry }|
+\end{quote}
+%
+although when the object, the attribute, or the id is left empty in the colon
+syntax, the corresponding setting will be missing in the above call of |sync|.
+Note that because of the |sync| the last time used inside the \meta{options}
+will be available afterwards as the last time. Also note that an |entry| is
+added at the end, so any settings of keys like |begin| or |repeats| inside the
+\meta{options} will get added to the timeline.
+
+Let us now have a look at some examples. First, we set the \meta{object name}
+to |mynode| and |othernode| and the \meta{attribute} to |opacity| and to
+|color|:
+%
+\begin{codeexample}[code only]
+animate = {
+ mynode:opacity = { 0s = "1", 5s = "0" },
+ mynode:color = { 0s = "red", 5s = "blue" },
+ othernode:opacity = { 0s = "1", 5s = "0" },
+}
+\end{codeexample}
+
+Next, we do the same, but ``in two steps'': First, we set the object to
+|my node|, but leave the attribute open and, then, set the attribute, but leave
+the object:
+%
+\begin{codeexample}[code only]
+animate = {
+ mynode: = {
+ :opacity = { 0s = "1", 5s = "0" },
+ :color = { 0s = "red", 5s = "blue" }
+ },
+ othernode:opacity = { 0s = "1", 5s = "0" },
+}
+\end{codeexample}
+%
+Note how both in |mynode:| and in |:opacity| and |:color| you must provide the
+colon. Its presence signals that an object--attribute pair is being specified;
+only now either the object or the attribute is missing.
+
+We can also do it the other way round:
+%
+\begin{codeexample}[code only]
+animate = {
+ :opacity = {
+ mynode: = { 0s = "1", 5s = "0" },
+ othernode: = { 0s = "1", 5s = "0" }
+ },
+ mynode:color = { 0s = "red", 5s = "blue" }
+}
+\end{codeexample}
+%
+Finally, if several objects should get the exact same values, we can also group
+them:
+%
+\begin{codeexample}[code only]
+animate = {
+ {mynode,othernode}:opacity = { 0s = "1", 5s = "0" },
+ mynode:color = { 0s = "red", 5s = "blue" }
+}
+\end{codeexample}
+
+As mentioned earlier, all references to objects will be interpreted to future
+objects, never to objects already created. Furthermore, also as mentioned
+earlier, \tikzname\ allows you to specify |myself| as \meta{object}, which is
+interpreted as the scope or node where the |animate| is given (you cannot
+animate a node or scope named |myself|, this special name always refers to the
+current node). In order to have all attributes refer to the current object, you
+write:
+%
+\begin{codeexample}[code only]
+\begin{scope} [animate = {
+ myself: = { % Animate the attribute of the scope
+ :opacity = { ... },
+ :xshift = { ... }
+ }
+ }]
+ ...
+\end{scope}
+\end{codeexample}
+
+The list of permissible attributes is given in
+Section~\ref{section-anim-attrs}.
+
+
+\subsubsection{The Colon Syntax II: Animating Myself}
+
+A frequent use of the |animate| key is for animating attributes of the current
+object |myself|. In these cases, it is a bit length to write
+%
+\begin{codeexample}[code only]
+[animate = { myself: = { :some attribute = {...} } } ]
+\end{codeexample}
+%
+\noindent in the options of a node or a scope. For this reason, \tikzname\
+allows you to use a special syntax with nodes and scopes:
+%
+\begin{enumerate}
+ \item In a \meta{node specification}, which is everything following a
+ |node| command up to the content of the node (which is surrounded by
+ curly braces), you can write
+ %
+ \begin{quote}
+ |:some attribute = {|\meta{options}|}|
+ \end{quote}
+ %
+ and this will have the same effect as if you had written
+ %
+ \begin{quote}
+ |[animate = { myself: = { :some attribute = {|\meta{options}|}}}]|
+ \end{quote}
+ %
+ Note that you can use this syntax repeatedly, but each use creates a
+ new use of the |animate| key, resulting in a new timeline. In order to
+ create complex timelines for several objects, use the |animate| key.
+ \item For the commands |\tikz|, |\scoped| and the environments
+ |{tikzpicture}| and |{scope}|, when they are followed immediately by
+ %
+ \begin{quote}
+ |:some attribute = {|\meta{options}|}|
+ \end{quote}
+ %
+ then
+ %
+ \begin{quote}
+ |animate = { myself: = { :some attribute = {|\meta{options}|}}}|
+ \end{quote}
+ %
+ is added to the options of the command or scope. Again, you can use the
+ syntax repeatedly. Note that when an opening square bracket is
+ encountered, this special parsing stops.
+\end{enumerate}
+
+Let us have a look at some examples. First, we use the syntax to set the fill
+opacity of a node:
+%
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node
+ :fill opacity = { 0s="1", 2s="0", begin on=click }
+ [fill = blue!20, draw = blue, ultra thick, circle] {Here!};
+\end{codeexample}
+%
+Next, we additionally rotate the node:
+%
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node
+ :fill opacity = { 0s="1", 2s="0", begin on=click }
+ :rotate = { 0s="0", 2s="90", begin on=click }
+ [fill = blue!20, draw = blue, ultra thick, circle] {Here!};
+\end{codeexample}
+%
+Note that there is no comma between consecutive uses of the colon syntax in
+this case. We could have exchanged the order of the options and the uses of the
+colon syntax:
+%
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node
+ :fill opacity = { 0s="1", 2s="0", begin on=click }
+ [fill = blue!20, draw = blue, ultra thick, circle]
+ :rotate = { 0s="0", 2s="90", begin on=click } {Here!};
+\end{codeexample}
+
+We can also use the special syntax with the |\tikz| command itself:
+%
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz :fill opacity = { 0s="1", 2s="0", begin on=click }
+ :rotate = { 0s="0", 2s="90", begin on=click }
+ [ultra thick]
+ \node [fill = blue!20, draw = blue, circle] {Here!};
+\end{codeexample}
+
+Note that we could \emph{not} have moved the |[ultra thick]| options before
+|:rotate| since the options in square brackets end the special parsing.
+
+
+\subsubsection{The Time Syntax: Specifying Times}
+
+For each object--attribute pair you must specify the \emph{timeline} of the
+attribute. This is a curve that specifies for each ``moment in time'' which
+value the attribute should have. In the simplest case, you specify such a
+time--value pair as follows:
+%
+\begin{quote}
+ \normalfont
+ \meta{time} |="|\meta{value}|"|
+\end{quote}
+
+When you specify time--value pairs, you must specify the times in chronological
+order (so earlier times come first), but you may specify the same time several
+times (this is useful in situations where you have a ``jump'' from one value to
+another at a certain moment in time: you first specify the value ``from which
+the attribute jumps'' and then you specify the value ``to which the attribute
+jumps'' for the same moment).
+
+The above syntax is just a special case of a more general situation. Let us
+start with the times. The general syntax for specifying times is as follows:
+%
+\begin{quote}
+ \normalfont
+ \meta{time} \opt{|=| \meta{options}}
+\end{quote}
+
+Here, \meta{time} is a text that ``looks like a time'', which means that:
+%
+\begin{enumerate}
+ \item It is not a key and does not contain a colon and does not start with
+ a quotation mark.
+ \item It starts with a digit, a plus or minus sing, a dot, or a
+ parenthesis.
+\end{enumerate}
+
+If these two things are the case, the above code is transformed to the
+following call:
+%
+\begin{quote}
+ \normalfont
+ |sync = {time = |\meta{time}|, |\meta{options}|, entry}|
+\end{quote}
+
+
+\subsubsection{The Quote Syntax: Specifying Values}
+
+We saw already in several examples that values are put in quotation marks
+(similar to the way this is done in \textsc{xml}). This quote syntax is as
+follows:
+%
+\begin{quote}
+ \normalfont
+ |"|\meta{value}|"| \opt{|base|} \opt{|=| \meta{options}}
+\end{quote}
+
+This syntax is triggered whenever a key starts with a quotation mark%
+\footnote{Of catcode 12 for those knowledgeable of such things.} (and note that
+when the \meta{value} contains a comma, you have to surround it by curly braces
+\emph{inside} the quotation marks as in |"{(1,1)}"|). Then, the following code
+is executed:
+%
+\begin{quote}
+ \normalfont
+ |sync = {value = |\meta{value}|, |\meta{options}|, entry}|
+\end{quote}
+
+This means that when you write |1s = "red"|, what actually happens is that
+\tikzname\ executes the following:
+%
+\begin{codeexample}[code only]
+sync = { time = 1s, sync = { value = red, entry }, entry }
+\end{codeexample}
+%
+Note that the second entry has no effect since no value is specified and the
+|entry| key only ``takes action'' when both a time and a value have been
+specified. Thus, only the innermost |entry| does, indeed, create a time--value
+pair as desired.
+
+In addition to the above, if you have added |base| after the closing quote, the
+following gets executed before the above |sync|:
+%
+\begin{quote}
+ \normalfont
+ |base = {value = |\meta{value}|}|
+\end{quote}
+
+This makes it easy to specify base values for timelines.
+
+Interestingly, instead of |1s="red"| you can also write |"red"=1s|. Let us now
+have a look at situations where this can be useful.
+
+
+\subsubsection{Timesheets}
+
+Using the |sync| key or using the three different syntactic constructs
+introduced earlier (the color syntax, the time syntax, the value syntax), you
+can organize the specification of an animation in different ways. Basically,
+the two most useful ways are the following:
+%
+\begin{enumerate}
+ \item You first select an object and an attribute for which you wish to
+ establish a timeline and then provide the time--value pairs in a
+ sequence:
+ %
+\begin{codeexample}[code only]
+animate = {
+ obj:color = {
+ 0s = "red",
+ 2s = "blue",
+ 1s later = "green",
+ 1s later = "green!50!black",
+ 10s = "black"
+ }
+}
+\end{codeexample}
+ %
+ When you specify timelines for several attributes of the same object,
+ you can group these together:
+ %
+\begin{codeexample}[code only]
+animate = {
+ obj: = {
+ :color = { 0s = "red", 2s = "green" },
+ :opacity = { 0s = "1", 2s = "0" }
+ }
+}
+\end{codeexample}
+ %
+ In this way of specifying animations the ``object comes first''.
+ \item Alternatively, you can also group the animation by time and, for each
+ ``moment'' (known as \emph{keyframes}) you specify which values the
+ attributes of the object(s) have:
+ %
+\begin{codeexample}[code only]
+animate = {
+ 0s = {
+ obj:color = "red",
+ obj:opacity = "1"
+ },
+ 2s = {
+ obj:color = "green",
+ obj:opacity = "0"
+ }
+}
+\end{codeexample}
+ %
+ Naturally, in this case it would have been better to ``move the object
+ outside'':
+ %
+\begin{codeexample}[code only]
+animate = {
+ obj: = {
+ 0s = {
+ :color = "red",
+ :opacity = "1"
+ },
+ 2s = {
+ :color = "green",
+ :opacity = "0"
+ }
+ }
+}
+\end{codeexample}
+ %
+ When there are several objects involved, we can mix all of these
+ approaches:
+ %
+\begin{codeexample}[code only]
+animate = {
+ 0s = {
+ obj: = {
+ :color = "red",
+ :opacity = "1"
+ },
+ main node: = {
+ :color = "black"
+ }
+ },
+ 2s = {
+ obj: = {
+ :color = "green",
+ :opacity = "0"
+ },
+ main node: = {
+ :color = "white"
+ }
+ }
+}
+\end{codeexample}
+ %
+\end{enumerate}
+
+
+\subsection{The Attributes That Can Be Animated}
+\label{section-anim-attrs}
+
+The following \meta{attributes} are permissible (actually, the attribute names
+do not include a colon, but since they will almost always be used with the
+colon syntax, it makes it easier to identify them):
+%
+\begin{itemize}
+ \itemsep0pt
+ \item |:dash phase|
+ \item |:dash pattern|
+ \item |:dash|
+ \item |:draw opacity|
+ \item |:draw|
+ \item |:fill opacity|
+ \item |:fill|
+ \item |:line width|
+ \item |:opacity|
+ \item |:position|
+ \item |:path|
+ \item |:rotate|
+ \item |:scale|
+ \item |:stage|
+ \item |:text opacity|
+ \item |:text|
+ \item |:translate|
+ \item |:view|
+ \item |:visible|
+ \item |:xscale|
+ \item |:xshift|
+ \item |:xskew|
+ \item |:xslant|
+ \item |:yscale|
+ \item |:yshift|
+ \item |:yskew|
+ \item |:yslant|
+\end{itemize}
+
+These attributes are detailed in the following sections, but here is a quick
+overview of those that do not have a \tikzname\ key of the same name (and which
+thus do not just animate the attribute set using this key):
+%
+\begin{itemize}
+ \item |:shift| allows you to add an animated shifting of the canvas, just
+ like \tikzname's |shift| key. However, in conjunction with the |along|
+ key, you can also specify the shifting along a path rather than via a
+ timeline of coordinates.
+ \item |:position| works similar to |:shift|, only the coordinates are not
+ relative movements (no ``shifts''), but refer to ``absolute positions''
+ in the picture.
+ \item |:path| allows you to animate a path (it will morph). The ``values''
+ are now paths themselves.
+ \item |:view| allows you to animate the view box of a view.
+ \item |:visible| decides whether an object is visible at all.
+ \item |:stage| is identical to |:visible|, but when the object is not
+ animated, it will be hidden by default.
+\end{itemize}
+
+
+\subsubsection{Animating Color, Opacity, and Visibility}
+\label{section-animation-painting}
+
+You can animate the color of the target object of an animation using the
+attributes |fill|, |draw|, and |text|. When the target of a color animation is
+a scope, you animate the color ``used in this scope'' for filling or stroking.
+However, when an object inside the scope has its color set explicitly, this
+color overrules the color of the scope.
+
+\begin{tikzanimateattribute}{fill, draw}
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz :fill = {0s = "red", 2s = "blue", begin on = click}
+ [text = white, fill = orange ] {
+ \node [fill] at (0mm,0) {A};
+ \node [fill] at (5mm,0) {B};
+ \node [fill = green!50!black ] at (1cm,0) {C};
+}
+\end{codeexample}
+\end{tikzanimateattribute}
+
+\begin{tikzanimateattribute}{text}
+ The |text| attribute only applies to nodes and you need to directly animate
+ the |text| attribute of each node individually.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [my anim/.style={ animate = {
+ myself:text = {0s = "red", 2s = "blue", begin on = click}}},
+ text = white, fill = orange ] {
+ \node [fill, my anim] at (0,0) {A};
+ \node [fill, my anim] at (1,0) {B};
+}
+\end{codeexample}
+ %
+ Unlike the |fill| and |draw| colors, you cannot animate the |text| color
+ for scopes:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz [animate = {myself:text = {0s = "red", 2s = "blue",
+ begin on = click}},
+ text = white, fill = orange ] {
+ \node [fill] at (0,0) {A};
+ \node [fill] at (1,0) {B};
+}
+\end{codeexample}
+ %
+\end{tikzanimateattribute}
+
+\begin{tikzanimateattribute}{color}
+ The |color| attribute is not really an attribute. Rather, it is a shorthand
+ for |{draw,fill,text}|. This means that |color| does not start a separate
+ timeline, but continues the |draw| timeline, the |fill| timeline, and the
+ |text| timeline.
+\end{tikzanimateattribute}
+
+\begin{tikzanimateattribute}{opacity, fill opacity, stroke opacity}
+ Similarly to the color, you can also set the opacity used for filling and
+ for drawing using the attributes |fill opacity| and |draw opacity|, which
+ are exactly the same as the usual \tikzname\ keys of the same names.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :fill opacity = { 0s="1", 2s="0", begin on=click }
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+ %
+ Unlike colors, where there is no joint attribute for filling and stroking,
+ there is a single |opacity| attribute in addition to the above two
+ attributes. If supported by the driver, it treats the graphic object to
+ which it is applied as a transparency group. In essence, ``this attribute
+ does what you want'' at least in most situations.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :opacity = { 0s="1", 2s="0", begin on=click }
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+ %
+\end{tikzanimateattribute}
+
+\begin{tikzanimateattribute}{visible, stage}
+ The difference between the |visible| attribute and an opacity of |0| is
+ that an invisible object cannot be clicked and does not need to be
+ rendered. The (only) two possible values for this attribute are |false| and
+ |true|.
+ %
+\begin{codeexample}[animation list={1,2,3,4}]
+\tikz :visible = {begin on=click, 0s="false", 2s="false"}
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+\end{codeexample}
+
+ This |stage| attribute is the same as the |visible| attribute, only
+ |base="false"| is set by default. This means that the object is \emph{only}
+ visible when you explicitly during the time the entries are set to |true|.
+ The idea behind the name ``stage'' is that the object is normally ``off
+ stage'' and when you explicitly set the ``stage attribute'' to |true| the
+ object ``enters'' the stage and ``leaves'' once more when it is no longer
+ ``on stage''.
+ %
+\begin{codeexample}[animation list={-1,0,1,2,3},animation bb={(1.3,-0.7) rectangle (2.7,0.7)}]
+\tikz [animate = {example:stage = {
+ begin on = {click, of next=node},
+ 0s="true", 2s="true" }}] {
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+ \node at (2,0) (example) [fill = blue!20, circle] {Effect};
+}
+\end{codeexample}
+\end{tikzanimateattribute}
+
+
+\subsubsection{Animating Paths and their Rendering}
+\label{section-animation-paths}
+
+The attributes of the appearance of a path that you can animate include the
+line width and the dash pattern, the path itself, as well as the arrow tips
+attached to the paths. Animating the line width and the dash pattern is easy
+since the animation attributes simply have that same names as the properties
+that they animate and the syntax for setting is also the same:
+
+\begin{tikzanimateattribute}{line width}
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :line width = { 0s="1pt", 2s="5mm", begin on=click}
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+ %
+ Note that you must specify number (or expressions that evaluate to numbers)
+ as values, you cannot say |thin| or |thick| (these are styles, internally,
+ and you also cannot say |line width=thick|).
+\end{tikzanimateattribute}
+
+\begin{tikzanimateattribute}{dash, dash phase, dash phase}
+ The values for an animation of the dashing are specifications (see the
+ |dash| key for details) consisting of a sequence of |on| and |off| numbers.
+ In each value of the animation the length of these sequences \emph{must} be
+ identical. The interpolation of the values is done for each position of the
+ sequences individually, and also on the phase.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :dash = { 0s="on 10pt off 1pt phase 0pt",
+ 2s="on 1pt off 10pt phase 0pt", begin on=click}
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :dash = { 0s="on 1cm off 1pt phase 0pt",
+ 2s="on 1cm off 1pt phase 1cm", begin on=click}
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+
+ This |dash pattern| key allows you to animate the dash phase only. However,
+ due to the way dashing is handled by certain drivers, the dash pattern is
+ also set, namely to the current dash pattern that is in force when the
+ animation is created.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :dash phase = { 0s="0pt", 2s="1cm", begin on=click}
+ [fill = blue!20, draw = blue, ultra thick, circle, dashed] {Click me!};
+\end{codeexample}
+ %
+\end{tikzanimateattribute}
+
+The above attributes ``only'' influence how the path is rendered. You can,
+however, also animate the path itself:
+
+\begin{tikzanimateattribute}{path}
+ When you animate a path, the values are, of course, paths themselves:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :path = {
+ 0s = "{(0,-1) .. controls (0,0) and (0,0) .. (0,1) -- (1,1)}",
+ 2s = "{(0,-1) .. controls (-1,0) and (-1,0) .. (-1,1) -- (.5,-1)}",
+ begin on=click }
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+ %
+ There a number of things to keep in mind when you animate a path:
+ %
+ \begin{itemize}
+ \item The path ``values'' are parsed and executed in an especially
+ protected scope to ensure that they have only little side effects,
+ but you should not do ``fancy things'' on these paths.
+ \item As for the dash pattern, you must ensure that all paths in the
+ timeline have the same structure (same sequence of path
+ construction commands); only the coordinates may differ. In
+ particular, you cannot say that the path at |1s| is a rectangle
+ using |rectangle| and at |2s| is a circle using |circle|. Instead,
+ you would have to ensure that at both times the path consists of
+ appropriate Bézier curves (which is cumbersome as the following
+ example shows, where we used the fact that a circle consists of
+ four Bézier curves):
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :path = {
+ 0s = "{(0,0) circle [radius=1cm]}",
+ 2s = "{(0,0)
+ (1,0) .. controls +(0,0) and +(0,0) .. (0,1)
+ .. controls +(0,0) and +(0,0) .. (-1,0)
+ .. controls +(0,0) and +(0,0) .. (0,-1)
+ .. controls +(0,0) and +(0,0) .. (1,0)
+ -- cycle (0,0)}",
+ begin on=click}
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+ %
+ \item You must specify arrow tips for an animated path in a special
+ way, namely using the |arrows| key for \emph{animations}, not the
+ normal |arrows| key (see below).
+ \end{itemize}
+\end{tikzanimateattribute}
+
+\begin{key}{/tikz/animate/arrows=\meta{arrow spec}}
+ This key only has an effect on |:path| animations. It causes the arrow tips
+ specified in \meta{arrow spec} to be added to the path during the animation
+ (the syntax is the same as for the normal |arrows| key). If you have
+ several different animations for a paths, these may contain different arrow
+ tips, but each animation must stick to one kind of arrow tips.
+
+ What happens internally when this key is used is the following: The
+ specified arrow tips are rendered internally as so-called \emph{markers,}
+ which are small graphics that can be placed at the beginning and ends of
+ paths and which ``rotate along'' as a path changes. Note that these markers
+ are used \emph{only} in the context of animated paths, the arrow tips of
+ normal, ``static'' paths are drawn without the use of markers. Normally,
+ there is no visual difference between an arrow tip drawn using markers or
+ those drawn for static paths, but in rare cases there may be differences.
+ You should only add arrows to open path consisting of a single segment with
+ sufficiently long first and last segments (so that \tikzname\ can shorten
+ these segments correctly when necessary).
+
+ As pointed out earlier, the only way to add arrow tips to a path that is
+ animated is using this key, you can \emph{not} say something like
+ %
+\begin{codeexample}[code only]
+\draw :path = { 1s = "{(0,0) -- (1,0)}", 2s = "{(0,1) -- (1,0)}" }
+ [->] (0,0) -- (1,0);
+\end{codeexample}
+ %
+ This will raise an error since you try to animate a path (|:path = ...|)
+ that has normal arrow tips attached (|[->]|).
+
+ Instead, you must specify the arrow tips inside the animation command:
+ %
+\begin{codeexample}[code only]
+\draw :path = { 1s = "{(0,0) -- (1,0)}", 2s = "{(0,1) -- (1,0)}", arrows = -> }
+ (0,0) -- (1,0);
+\end{codeexample}
+
+ However, the above code now has a big shortcoming: While the animation is
+ \emph{not} running, \emph{no} arrow tip is shown (the |arrows| key only
+ applies to the animation.
+
+ The trick is to use the |base| key. It allows you to install a path as the
+ ``base'' path that is used when no animation is running and the arrows
+ specified for the animation will also be used for the base. All told, the
+ ``correct'' way to specify the animation is the following (note that no
+ static path is specified, any specified path would be overruled by the
+ |base| path anyway):
+ %
+\begin{codeexample}[code only]
+\draw :path = { 1s = "{(0,0) -- (1,0)}" base, 2s = "{(0,1) -- (1,0)}", arrows = -> };
+\end{codeexample}
+
+ Here is an example:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2},animation bb={(-0.1,-0.1) rectangle (1.1,1.1)}]
+\tikz [very thick] {
+ \node (node) at (-2,0)
+ [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+ \draw :path = {
+ 0s = "{(0,0) to[out=90, in=180] (.5,1) to[out=0, in=90] (.5,.5)}" base,
+ 2s = "{(1,0) to[out=180, in=180] (.25,.5) to[out=0, in=180] (1,.5)}",
+ arrows = <.<->, begin on = {click, of=node} }; }
+\end{codeexample}
+ %
+\end{key}
+
+\begin{key}{/tikz/animate/shorten < = \meta{dimension}}
+\end{key}
+
+\begin{key}{/tikz/animate/shorten > = \meta{dimension}}
+ For animated paths, just as the key |arrows| has to be passed to the
+ animation (to |:path|) instead of to the static path, the keys |shorten >|
+ and |shorten <| also have to be passed to the |:path| key.
+\end{key}
+
+
+\subsubsection{Animating Transformations: Relative Transformations}
+
+In order to animate the canvas transformation matrix, you do not animate an
+attribute called ``|:transform|''. Rather, there are several attributes that
+all manipulate the canvas transformation matrix in different ways. These keys,
+taken in appropriate combination, allow you to achieve any particular canvas
+transformation matrix. All keys that animate the transformation matrix always
+accumulate.
+
+Let us start with the ``standard'' attributes that are also available as keys
+in \tikzname:
+
+\begin{tikzanimateattribute}{scale, xscale, yscale}
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :scale = { 0s="1", 2s="0.2", begin on=click}
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+\end{tikzanimateattribute}
+
+\begin{tikzanimateattribute}{rotate}
+ The |rotate| key adds an animation of the rotation:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :rotate = { 0s="45", 2s="90", begin on=click}
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+ %
+ Note that there is no |rotate around| attribute, but you can use the
+ |origin| key to change the origin of the rotation.
+\end{tikzanimateattribute}
+
+\begin{tikzanimateattribute}{xskew, yskew, xslant, yslant}
+ The keys add an animation of the skew (given in degrees) or slant (given as
+ in the |xslant| and |yslant| key):
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :xskew = { 0s="0", 2s="45", begin on=click}
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :xslant = { 0s="-1", 2s="1", begin on=click}
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+ %
+\end{tikzanimateattribute}
+
+\begin{tikzanimateattribute}{xshift, yshift}
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :shift = { 0s="{(0,0)}", 2s="{(5mm,-5mm)}",
+ begin on=click}
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :xshift = { 0s="0pt", 2s="5mm", begin on=click}
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+ %
+\end{tikzanimateattribute}
+
+\begin{tikzanimateattribute}{shift}
+ This |:shift| attribute can be animated in two ways. First, you can simply
+ specify a sequence of coordinates in the same way as you would use the
+ |shift| key in \tikzname:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz \node :shift = { 0s = "{(0,0)}", 2s = "{(5mm,-5mm)}",
+ begin on = click }
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+
+ However, you can also specify the sequence of positions along which the
+ shift should occur in a different way, namely by \emph{specifying a path
+ along which the object should be moved.} This is often not only more
+ natural to do, but also allows you to specify movements along curves.
+
+ \begin{key}{/tikz/animate/options/along=\marg{path}\meta{|sloped| or
+ |upright|}\opt{| in|\meta{time}}%
+ }
+ Use this key with a |:shift| (or a |:position|) to make \tikzname\
+ shift the object by the coordinates along the \meta{path}. When this
+ key is used, the values may no longer be coordinates, but must be
+ fractions of the distance along the path. A value of |"0"| refers to
+ the beginning of the path and |"1"| refers to the end:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \draw [help lines] (-0.2,-0.2) grid (2.2,1.2);
+ \draw (1,.5) circle [radius=1mm];
+ \node :shift = {
+ along = {(0,0) circle[radius=5mm]} upright,
+ 0s="0", 2s=".25", begin on=click }
+ at (1,.5) [fill = blue, opacity=.5, circle] {Click};
+}
+\end{codeexample}
+ \end{key}
+
+ Following the \meta{path}, which must be put in braces, you must either
+ specify |upright| or |sloped|. In the first case, the to-be-animated object
+ is moved along the path normally (and stays ``upright''), whereas when you
+ use |sloped|, the object will be continuously rotated so that it always
+ points along the path.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \draw [help lines] (-0.2,-0.2) grid (2.2,1.2);
+ \draw (1,.5) circle [radius=1mm];
+ \node :shift = {
+ along = {(0,0) circle[radius=5mm]} sloped,
+ 0s="0", 2s=".25", begin on=click }
+ at (1,.5) [fill = blue, opacity=.5, circle] {Click};
+}
+\end{codeexample}
+
+ In most motion animations that use |along|, you will set the value for |0s|
+ to |"0"| and the value for some specific \meta{time} to |"1"|. Because of
+ this, you can add |in| \meta{time} after the path, to achieve exactly this
+ effect.
+\end{tikzanimateattribute}
+
+For the above attributes, it is not immediately clear which coordinate system
+should be used for the animation. That is, when you move an object 1cm ``to the
+right'', where is ``the right''? By default, movements and transformations like
+|:shift| or |:scale| are relative to the \emph{animation coordinate system,}
+which defaults to the local coordinate system of the to-be-animated object.
+Consider the following example:
+%
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \draw [help lines] (-0.2,-0.2) grid (2.2,2.2);
+ \node :rotate = { 0s="0", 2s="45", begin on=click}
+ at (1,1) [fill = blue!20, draw = blue, ultra thick] {Click me};
+}
+\end{codeexample}
+%
+Note how the node rotates around its center even though this center is at
+position |(1,1)| in the picture's coordinate system. This is because |at (1,1)|
+actually only does a shift of the coordinate system and the node is then drawn
+at the origin of this shifted coordinate system. Since this shifted coordinate
+system becomes the animation coordinate system, the rotation ``around the
+origin'' is actually a rotation around the origin of the animation coordinate
+system, which is at |(1,1)| in the picture's coordinate system.
+
+Let us, by comparison, do a rotation of a scope surrounding the node where the
+origin is not (yet) shifted:
+%
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \draw [help lines] (-0.2,-0.2) grid (2.2,2.2);
+ \scoped :rotate = { 0s="0", 2s="45", begin on={click, of next=n} }
+ \node (n) at (1,1) [fill = blue!20, draw = blue, ultra thick] {Click me};
+}
+\end{codeexample}
+%
+Now the rotation is really around the origin of the picture.
+
+Most of the time the animation coordinate system will be setup in the way ``you
+expect'', but you can modify it using the following keys:
+
+\begin{key}{/tikz/animate/options/origin=\meta{coordinate}}
+ Shifts the animation coordinate system by \meta{coordinate}. This has the
+ effect that the ``origin'' for scalings and rotations gets shifted by this
+ amount. In the following example, the point around which the rotation is
+ done is the right border at |(2,1)| since the origin of the animation is at
+ |(1,1)| relative to the picture's origin and the |origin| key shifts it one
+ centimeter to the right.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \draw [help lines] (-0.2,-0.2) grid (2.2,2.2);
+ \node :rotate = { 0s="0", 2s="45", begin on=click,
+ origin = {(1,0)}}
+ at (1,1) [fill = blue!20, draw = blue, ultra thick] {Click me};
+}
+\end{codeexample}
+ %
+\end{key}
+
+\begin{key}{/tikz/animate/options/transform=\meta{transformation keys}}
+ While the |origin| key does only a shift, the |transform| key allows you to
+ add an arbitrary transformation to the animation coordinate system using
+ keys like |shift|, |rotate| or even |reset cm| and |cm|. In particular,
+ |origin=|\meta{c} has the same effect as |transform| |=|
+ |{shift=|\meta{c}|}|. Note that the transformation only influences the
+ animation, not the object itself.
+
+ As an example, when you say |transform={scale=2}|, an |:xshift| with a
+ value of |"1cm"| will actually shift the object by 2cm. Similarly, after
+ you say |transform={rotate=90,scale=2}|, the same |:xshift| of |"1cm"| will
+ actually shift the object by 2cm upwards.
+
+ Note that, internally, \tikzname\ has to invert the transformation matrix
+ resulting from the \meta{transformation keys} (plus the original animation
+ transformation matrix), which can by numerically instable when you use
+ ill-conditioned transformations.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \draw [help lines] (-0.2,-0.2) grid (2.2,2.2);
+ \node :xshift = { 0s="0cm", 2s="5mm", begin on=click,
+ transform = {rotate=-90} }
+ at (1,1) [fill = blue!20, draw = blue, ultra thick] {Click me};
+}
+\end{codeexample}
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \draw [help lines] (-0.2,-0.2) grid (2.2,2.2);
+ \node :xshift = { 0s="0cm", 2s="5mm", begin on=click,
+ transform = {rotate=-45, scale=2} }
+ at (1,1) [fill = blue!20, draw = blue, ultra thick] {Click me};
+}
+\end{codeexample}
+ %
+\end{key}
+
+
+\subsubsection{Animating Transformations: Positioning}
+
+The attributes for specifying transformations and, in particular, the |:shift|
+attribute are always expressed in the local animation coordinate system. This
+makes it easy to ``shift around a node a little bit'', but makes it hard to
+move a node ``from one position to another'' since coordinates need to be
+expressed relative to the node's coordinate system, which leads to all sorts of
+problems: Suppose you wish to have a node move from $(1,1)$ to $(2,1)$ and then
+to $(2,0)$. Now, if the node has already been placed at $(1,1)$ in the usual
+manner using |at|, then from the ``node's point of view'' you need to move the
+node to $(0,0)$, $(1,0)$, and $(1,-1)$. To make matters worse, when you use
+named coordinates as in
+%
+\begin{codeexample}[code only]
+\coordinate(A) at (1,1);
+\coordinate(B) at (2,1);
+\coordinate(C) at (2,0);
+\end{codeexample}
+%
+and then say that the movement should be from |(A)| to |(B)| to |(C)|, what
+should you expect? On the one hand, |(A)| and |(1,1)| should normally be
+interchangeable; on the other hand, |(A)| is a specific point in the plane, no
+matter from which coordinate system we look at it. It turns out that \tikzname\
+will stick to the second interpretation and actually turn |(A)| into |(0,0)|
+when it is parsed in the local coordinate system of a node starting at |(A)| --
+while |(1,1)| will stay the same.
+
+Because of all these confusing effects, there is another attribute |:position|,
+which is similar to a |:shift|, but the coordinates are not interpreted in the
+local coordinate system of the node, but in the coordinate system that is in
+force when the |animate| key is used. For a node, this is \emph{prior} to the
+setup of the node's coordinate system and, thus, usually the picture's
+coordinate system.
+
+\begin{tikzanimateattribute}{position}
+ Compare the two animations, one with |:position|, one with |:shift|.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \draw [help lines] (-0.2,-0.2) grid (2.2,1.2);
+ \draw (1,.5) circle [radius=1mm] (1.5,0) circle [radius=1mm];
+ \node :position = { 0s="{(1,.5)}", 2s="{(1.5,0)}", begin on=click }
+ at (1,.5) [fill = blue, opacity=.5, circle] {Click};
+}
+\end{codeexample}
+ %
+ Compare this to a shift:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \draw [help lines] (-0.2,-0.2) grid (2.2,1.2);
+ \draw (1,.5) circle [radius=1mm] (1.5,0) circle [radius=1mm];
+ \node :shift = { 0s="{(1,.5)}", 2s="{(1.5,0)}", begin on=click }
+ at (1,.5) [fill = blue, opacity=.5, circle] {Click};
+}
+\end{codeexample}
+ %
+ You can use the |along| key with |:position| in the same way as with
+ |:shift|, which is especially useful for specifying that a node ``travels''
+ between positions of the canvas:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \draw [help lines] (-0.2,-0.2) grid (2.2,1.2);
+ \draw (1,1) circle [radius=1mm] (1.5,0) circle [radius=1mm];
+ \node :position = {
+ along = {(1,1) to[bend left] (1.5,0)} sloped in 2s,
+ begin on = click }
+ at (1,1) [fill = blue, opacity=.5, circle] {Click};
+}
+\end{codeexample}
+ %
+\end{tikzanimateattribute}
+
+
+\subsubsection{Animating Transformations: Views}
+\label{section-animation-views}
+
+The final method of changing the transformation matrix is to animate a
+\emph{view}.
+
+\begin{tikzanimateattribute}{view}
+ A view is a canvas transformation that shifts and scales the canvas in such
+ a way that a certain rectangle ``matches'' another rectangle: The idea is
+ that you ``look through'' a ``window'' (the view) and ``see'' a certain
+ area of the canvas. View animation do not allow you to do anything that
+ cannot also be done using the |shift| and |scale| keys in combination, but
+ it often much more natural to animate which area of a graphic you wish to
+ see than to compute and animate a scaling and shift explicitly.
+
+ In order to use a view, you first need to create a view, which is done
+ using the |meet| or |slice| keys from the |views| library, see
+ Section~\ref{section-library-views}. You can then animate the view using
+ the |view| attribute. The values passed to the |entry| key follow the same
+ syntax as the views in the view library (though you only animate the
+ to-be-viewed rectangle).
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2},animation bb={(1.1,-0.9) rectangle (2.9,0.9)}]
+\tikz [very thick] {
+ \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+
+ \draw [green!50!black] (1.2,-0.8) rectangle (2.7,0.8);
+ \begin{scope}[view = {(0,0) (2,2) at (1.2,-0.8) (2.7,0.8)},
+ animate = {myself:view = {
+ begin on = {click, of=node},
+ 0s = "{(0,0) (2,2)}",
+ 2s = "{(1,1) (1.5,1.5)}" }}]
+ \draw [red] (10mm,10mm) rectangle (15mm,15mm);
+ \node at (10mm,10mm) [circle, fill=red, text=white, font=\tiny] {red};
+ \end{scope}
+}
+\end{codeexample}
+ %
+\end{tikzanimateattribute}
+
+
+\subsection{Controlling the Timeline}
+\label{section-anim-timeline}
+
+We can already specify timelines by giving a sequence of times in
+non-decreasing order along with corresponding values. In this section we have a
+look at further options that allow us to extend or control the timeline.
+
+
+\subsubsection{Before and After the Timeline: Value Filling}
+
+When you specify the timeline, you specify it for a certain interval
+$[t_1,t_2]$. By default, outside this interval the animation has no effect on
+the to-be-animated attribute. The following keys allows you to change this:
+
+\begin{key}{/tikz/animate/base=\meta{options}}
+ A ``base'' value is a value that is used for the attribute whenever the
+ timeline is \emph{not} active:
+ %
+\begin{codeexample}[animation list = {0.5,1,1.5,2,2.5}]
+\tikz \node [fill = green, text = white] :fill =
+ { 1s = "red", 2s = "blue", base = "orange", begin on = click }
+ {Click me};
+\end{codeexample}
+
+ Syntactically, the |base| key works much like special time syntax: It sets
+ up a local |sync| scope and executes the \meta{options} in it and creates
+ an |entry|. However, instead of setting the |time| attribute to a time, it
+ sets it to a special value that tells \tikzname\ that when the entry is
+ created, the current \meta{value} should be used as the |base| value.
+
+ This means that you can write |base = "orange"| as in the above example to
+ set the base. However, you can also use the |base| key in other ways; most
+ noticeably, you can use it \emph{after} some value:
+ %
+\begin{codeexample}[animation list = {0.5,1,1.5,2,2.5}]
+\tikz \node [fill = green, text = white] :fill =
+ { 1s = {"red" = base}, 2s = "blue", begin on = click }
+ {Click me};
+\end{codeexample}
+
+ Instead of using |base| as a key, you can also add |base| directly after
+ the quotes of a value. This is particularly useful for setting up a base
+ value that is also used in a timeline:
+ %
+\begin{codeexample}[animation list = {0.5,1,1.5,2,2.5}]
+\tikz \node [fill = green, text = white] :fill =
+ { 1s = "red" base, 2s = "blue", begin on = click }
+ {Click me};
+\end{codeexample}
+ %
+\end{key}
+
+\begin{key}{/tikz/animate/options/forever}
+ This key causes the timeline to continue ``forever'' after the last time
+ with the last value. You can also think of this as having the animation
+ ``freeze'' at the end.
+ %
+\begin{codeexample}[animation list = {0.5,1,1.5,2,2.5}]
+\tikz \node :fill = { 1s="red", 2s="blue", forever, begin on=click}
+ [fill = green!50!black, text = white] {Click me};
+\end{codeexample}
+ %
+\begin{codeexample}[animation list = {0.5,1,1.5,2,2.5}]
+\tikz \node [fill = green!50!black, text = white]
+ :fill = { 1s = "red", 2s = "blue", begin on = click }
+ {Click me};
+\end{codeexample}
+ %
+\end{key}
+
+\begin{key}{/tikz/animate/options/freeze}
+ An alias for |forever|.
+\end{key}
+
+
+\subsubsection{Beginning and Ending Timelines}
+\label{section-anim-begin-end}
+
+The \meta{time} used with the first use of the |entry| key in a timeline is the
+start time and the \meta{time} in the last |entry| key is the stop time.
+However, this leaves open then question of when the whole timeline is to be
+started: The moment the document is opened? When the page is displayed? When
+the user scrolls to the to-be-animated object? When some other object is
+clicked? The key |begin|, and also the key |end|, allow you to specify answers
+to these questions.
+
+\begin{key}{/tikz/animate/options/begin=\meta{time}}
+ This key specifies when the ``moment |0s|'' should be relative to the
+ moment when the current graphic is first displayed. You can use this key
+ multiple times, in this case the timeline is restarted for each of the
+ times specified (if it is already running, it will be reset). If no |begin|
+ key is given at all, the effect is the same as if |begin=0s| had been
+ specified.
+
+ It is permissible to set \meta{time} to a negative value.
+
+ Note that this key has no effect for snapshots.
+\end{key}
+
+\begin{key}{/tikz/animate/options/end=\meta{time}}
+ This key will truncate the timeline so that it ends \meta{time} after the
+ display of the graphic, provided the timeline begins before the specified
+ end time. For instance, if you specify a timeline starting at 2\,s and
+ ending at 5\,s and you set |begin| to 1\,s and |end| to 4\,s, the timeline
+ will run, relative to the moment when the graphic is displayed from 3\,s to
+ 4\,s.
+ %
+\begin{codeexample}[]
+\tikz \node [fill = green!50!black, text = white]
+ :rotate = { 1s = "0", 5s = "90", begin = 2s, end = 4s }
+ {Click me};
+\end{codeexample}
+ %
+\end{key}
+
+Instead of specifying the beginning of the timeline relative to the moment to
+to-be-animated graphic is displayed, you can also set the ``moment |0s|'' to
+the moment a specific \emph{event} happens using the following key:
+
+\begin{key}{/tikz/animate/options/begin on=\meta{options}}
+ The \meta{options} will be executed with the path |/pgf/animation/events|
+ and will cause a new beginning to be added to the list of possible
+ beginnings for the timeline (so the uses of this key accumulate). Each
+ ``beginning'' is just another possible ``moment |0s|'' for the timeline.
+ For instance, when the \meta{options} are set to |click|, then each time
+ the graph is clicked a moment |0s| starts for the timeline.
+
+ Most events are ``caused'' or ``happen to'' some object. For instance, the
+ |click| event happens when you click on a certain object. In order to
+ specify this object, use the following two keys inside the \meta{options}:
+ |of| and |of next|. If neither of these keys are given, the to-be-animated
+ object is used.
+
+ \begin{key}{/pgf/animation/events/of=\meta{id}\opt{|.|\meta{type}}}
+ This specifies a graphic object id in the same way as the |whom| key,
+ also with an optional \meta{type}. This is the object that ``causes''
+ the event to happen.
+
+ Unlike the |whom| key, which always refers to a not-yet-existing
+ object, this key always refers to an already existing object, namely to
+ the most recent use of the \meta{id}. In the following example, the
+ referenced object is the node with the label |2| since it is the most
+ recently referenced node with \meta{id} |X|.
+ %
+\begin{codeexample}[width=3cm]
+\tikz [very thick] {
+ \node (X) at (1,1.2) [fill = blue!20, draw = blue, circle] {1};
+ \node (X) at (1,0.4) [fill = orange!20, draw = orange, circle] {2};
+ \node (node) :rotate = {0s="0", 2s="90", begin on = {click, of = X}}
+ [fill = red!20, draw = red, rectangle] {Anim};
+ \node (X) at (1,-0.4) [fill = blue!20, draw = blue, circle] {3};
+ \node (X) at (1,-1.2) [fill = blue!20, draw = blue, circle] {4}; }
+\end{codeexample}
+ \end{key}
+
+ \begin{key}{/pgf/animation/events/of next=\meta{id}\opt{|.|\meta{type}}}
+ This key works like the |of| key, only it refers to a future (actually,
+ the next) object with the given \meta{id}, not to a previous one. This,
+ in the next example, the referenced node is the one with label |3|.
+ %
+\begin{codeexample}[width=3cm]
+\tikz [very thick] {
+ \node (X) at (1,1.2) [fill = blue!20, draw = blue, circle] {1};
+ \node (X) at (1,0.4) [fill = blue!20, draw = blue, circle] {2};
+ \node (node) :rotate = {
+ 0s="0", 2s="90", begin on = {click, of next = X}}
+ [fill = red!20, draw = red, rectangle] {Anim};
+ \node (X) at (1,-0.4) [fill = orange!20, draw = orange, circle] {3};
+ \node (X) at (1,-1.2) [fill = blue!20, draw = blue, circle] {4}; }
+\end{codeexample}
+ \end{key}
+
+ The following key allows you to specify the event that should cause the
+ animation to start:
+ %
+ \begin{key}{/pgf/animation/events/event=\meta{event name}}
+ Specifies the name of the event whose occurrence should start the
+ timeline. Which events are supported depends on the device on which the
+ animation is displayed, the output format (\textsc{svg} or some other
+ format), and the setup of scripts, but here is a list of events
+ supported by ``plain \textsc{svg}'': |click|, |focusin|, |focusout|,
+ |mousedown|, |mouseup|, |mouseover|, |mousemove|, |mouseout|, |begin|,
+ |end|. However, the following keys make using these events simpler:
+ %
+ \begin{key}{/pgf/animate/events/click}
+ This is a shorthand for |event=click|. This event gets triggered
+ when the user clicks on the triggering object with a mouse (or
+ something equivalent).
+ %
+\begin{codeexample}[width=2cm]
+\tikz \node :rotate = { 0s="0", 2s="90", begin on = {click}}
+ [fill = blue!20, draw = blue, circle, ultra thick] {Here!};
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/pgf/animation/events/mouse down}
+ Shorthand for |event=mousedown|. The event gets triggered when the
+ user presses a mouse button down on the object.
+ %
+\begin{codeexample}[width=2cm]
+\tikz \node :rotate = { 0s="0", 2s="90", begin on = {mouse down}}
+ [fill = blue!20, draw = blue, circle, ultra thick] {Here!};
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/pgf/animation/events/mouse up}
+ Shorthand for |event=mouseup| and gets triggered, of course, when a
+ pressed button is released on the object.
+ %
+\begin{codeexample}[width=2cm]
+\tikz \node :rotate = { 0s="0", 2s="90", begin on = {mouse up} }
+ [fill = blue!20, draw = blue, circle, ultra thick] {Here!};
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/pgf/animation/events/mouse over}
+ Shorthand for |event=mouseover|. The event gets triggered the
+ moment the mouse cursor moves over the object.
+ %
+\begin{codeexample}[width=2cm]
+\tikz \node :rotate = { 0s="0", 2s="90", begin on = {mouse over} }
+ [fill = blue!20, draw = blue, circle, ultra thick] {Here!};
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/pgf/animation/events/mouse move}
+ Shorthand for |event=mousemove|. The event gets triggered lots of
+ times, namely each time the mouse moves while being ``over'' the
+ object.
+ %
+\begin{codeexample}[width=2cm]
+\tikz \node :rotate = { 0s="0", 2s="90", begin on = {mouse move} }
+ [fill = blue!20, draw = blue, circle, ultra thick] {Here!};
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/pgf/animation/events/mouse out}
+ Shorthand for |event=mouseout|. The opposite of |mouse over|:
+ triggered when the mouse leaves the object.
+ %
+\begin{codeexample}[width=2cm]
+\tikz \node :rotate = { 0s="0", 2s="90", begin on = {mouse out} }
+ [fill = blue!20, draw = blue, circle, ultra thick] {Here!};
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/pgf/animation/events/begin}
+ Shorthand for |event=begin|. The ``begin'' refers to the beginning
+ of another animation, namely the one referenced by |of| or
+ |of whom|. This means that the current animation will begin when
+ some other animation begins.
+ %
+\begin{codeexample}[width=2cm]
+\tikz \node [animate = {
+ myself:rotate = { 0s="0", 2s="90", begin on = {begin, of next=anim}},
+ myself:xshift = { 0s="0mm", 2s="5mm", begin on = {click}, name=anim}
+ },
+ fill = blue!20, draw = blue, circle, ultra thick] {Here!};
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/pgf/animation/events/end}
+ Shorthand for |event=end|. Again, the ``end'' refers to the end of
+ another animation, namely the one referenced by |of| or |of whom|.
+ This means that the current animation will \emph{begin} when some
+ other animation \emph{ends}.
+ %
+\begin{codeexample}[width=2cm]
+\tikz \node [animate = {
+ myself:rotate = { 0s="0", 2s="90", begin on = {end, of next=anim}},
+ myself:xshift = { 0s="0mm", 2s="5mm", begin on = {click}, name=anim }
+ },
+ fill = blue!20, draw = blue, circle, ultra thick] {Here!};
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/pgf/animation/events/focus in}
+ This is a shorthand for |event=focusin|. This event gets triggered
+ when the graphic object gets the focus (this usually makes sense
+ only for text input fields).
+ \end{key}
+ %
+ \begin{key}{/pgf/animation/events/focus out}
+ This is a shorthand for |event=focusout|.
+ \end{key}
+ \end{key}
+
+ In addition to the events specified using the generic |event| key, there
+ are two further events that take a parameter:
+ %
+ \begin{key}{/pgf/animation/events/repeat=\meta{number}}
+ The event is triggered when a repeating animation has been repeated
+ \meta{number} times.
+ %
+\begin{codeexample}[
+ animation list={
+ 0.333/\frac{1}{3},0.666/\frac{2}{3},1,
+ 1.333/1\frac{1}{3},1.666/1\frac{2}{3},2,
+ 2.333/2\frac{1}{3},2.666/2\frac{2}{3},3,
+ 3.333/2\frac{1}{3},3.666/2\frac{2}{3},4}]
+\tikz
+ \node [animate = { myself: = {
+ :rotate = { 0s="0", 2s="90", begin on = {repeat = 2, of next = anim },
+ begin snapshot = 2 },
+ :xshift = { 0s="0mm", 2s="5mm", begin on=click, name=anim, repeats=4 }}},
+ fill = blue!20, draw = blue, circle, ultra thick] {Here!};
+\end{codeexample}
+ \end{key}
+
+ \begin{key}{/pgf/animation/events/key=\meta{key}}
+ The event is triggered when the keyboard key \meta{key} has been
+ pressed. For security reasons, a viewer may suppress this.
+ \end{key}
+
+ Having specified the event, you can also specify a delay relative to this
+ event:
+
+ \begin{key}{/pgf/animation/events/delay=\meta{time}}
+ Specifies that the timeline should not start with the event, but,
+ rather, be delayed by \meta{time}.
+ \end{key}
+\end{key}
+
+When you use |begin on| to start an animation when a certain event is
+triggered, it is not clear what should happen when the event is triggered
+\emph{again}. Should this be ignored completely? Should it only be ignored
+while the animation is running? The following key allows you to specify when
+should happen:
+
+\begin{key}{/tikz/animate/options/restart=\meta{choice} (default true)}
+ You can set \meta{choice} to one of the following:
+ %
+ \begin{itemize}
+ \item |true| means that the animation will restart each time the event
+ is triggered. If the animation is already running, it will be reset
+ to its beginning.
+ \item |false| means that once the animation has started once, it will
+ never be restarted.
+ %
+\begin{codeexample}[width=2cm]
+\tikz \node :rotate = { 0s="0", 2s="90",
+ restart = false, begin on = {click}}
+ [fill = blue!20, draw = blue, circle, ultra thick] {Here!};
+\end{codeexample}
+ %
+ \item |never| means the same as |false|.
+ \item |when not active| means that the animation will restart when the
+ event is triggered, but \emph{not} while the animation is running.
+ %
+\begin{codeexample}[width=2cm]
+\tikz \node :rotate = { 0s="0", 2s="90",
+ restart = when not active, begin on = {click}}
+ [fill = blue!20, draw = blue, circle, ultra thick] {Here!};
+\end{codeexample}
+ \end{itemize}
+\end{key}
+
+Just like |begin on| specifies when a timeline begins relative to some event,
+the |end on| allows you to stop is early when some event happens:
+
+\begin{key}{/tikz/animate/options/end on=\meta{options}}
+ Works exactly like |begin on|, one possible end of the timeline is
+ specified using the \meta{options}.
+\end{key}
+
+
+\subsubsection{Repeating Timelines and Accumulation}
+
+\begin{key}{/tikz/animate/options/repeats=\meta{specification}}
+ Use this key to specify that the timeline animation should repeat at the
+ end. The \meta{specification} must consist of two parts, each of which may
+ be empty. The first part is one of the following:
+ %
+ \begin{itemize}
+ \item Empty, in which case the timeline repeats forever.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5}]
+\tikz \node :rotate = { 0s = "0", 2s = "90",
+ repeats, begin on = click }
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+ %
+ \item A \meta{number} (like |2| or |3.25|), in which case the timeline
+ repeats \meta{number} times.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5}]
+\tikz \node :rotate = { 0s = "0", 2s = "90",
+ repeats = 1.75, begin on = click }
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+ %
+ \item The text ``|for| \meta{time}'' (like |for 2s| or |for 300ms|), in
+ which case the timeline repeats however often necessary so that it
+ stops exactly after \meta{time}.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5}]
+\tikz \node :rotate = { 0s = "0", 2s = "90",
+ repeats = for 3.5s, begin on = click }
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+ \end{itemize}
+ %
+ The second part of the specification must be one of the following:
+ %
+ \begin{itemize}
+ \item Empty, in which case each time the timeline is restarted, the
+ attribute's value undergoes the same series of values it did
+ previously.
+ \item The text |accumulating|. This has the effect that each time the
+ timeline is restarted, the last values specified by the timeline is
+ \emph{added} to the value from the previous iteration(s). A typical
+ example is an animation that shifts a scope by, say, 1\,cm over a
+ time of 1\,s. Now, if you repeat this five times, normally the
+ scope will shift 1\,cm for 1\,s then ``jump back'', shift again,
+ jump back, and so on for five times. In contrast, when the repeats
+ are accumulating, the scope will move by 5\,cm over 5\,s in total.
+ %
+\begin{codeexample}[animation list={1,2,3,4,5}]
+\tikz \node :rotate = { 0s = "0", 2s = "90", begin on = click,
+ repeats = accumulating }
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+ %
+\begin{codeexample}[animation list={1,2,3,4,5}]
+\tikz \node :rotate = { 0s = "0", 2s = "90", begin on = click,
+ repeats = for 4s accumulating }
+ [fill = blue!20, draw = blue, ultra thick, circle] {Click me!};
+\end{codeexample}
+ \end{itemize}
+\end{key}
+
+\begin{key}{/tikz/animate/options/repeat=\meta{specification}}
+ An alias for |repeats|.
+\end{key}
+
+
+\subsubsection{Smoothing and Jumping Timelines}
+\label{section-anim-smooth}
+
+Your specification of the timeline will consist of a sequence of times along
+with values that the attribute should have at these ``key times''. Between
+these key times, the attribute's value needs to be interpolated.
+
+Suppose that an animation is supposed to interpolate a attribute's value
+between the two values |50| and |100| over a time of 10\,s. The simplest way of
+doing so is to do a linear interpolation, where the value as, say, 1\,s is 55,
+at 2\,s it is 60, and so on. Unfortunately, the linear interpolation does not
+``look'' nice in many cases since the acceleration of a linear interpolation is
+zero during the animation, but infinite at the beginning and at the end; which
+looks ``jerky''.
+
+To avoid this, you can specify that the time--attribute curve should not be a
+straight line, but rather a curve. You specify this curve using a spline. The
+most logical ``coordinate rectangle'' used for this spline in our example would
+be |(0s,50)| and |(10s,100)| and we would like to specify something like
+%
+\begin{codeexample}[code only]
+ (0s,50) .. controls (5s,50) and (9s,100) .. (10s,100)
+\end{codeexample}
+%
+This would result in a time--attribute curve where the attribute at |50|
+changes slowly at 0\,s and also arrives slowly at |100| at 10\,s, but speeds up
+between these values.
+
+We call the first control point |(5s,50)| the ``exit control'' and call
+|(9s,100)| the ``entry control'': The first control dictates how quickly or
+slowly a time point is left, the second dictates how quickly or slowly we enter
+the next one.
+
+The control points are, however, not specified in the coordinate system
+indicated above. Rather, the rectangle |(0s,50)| to |(10s, 100)| gets
+normalized to |(0,0)| to |(1,1)|. The control point |(5s,50)| would thus become
+|(0.5,0)| and |(9s,100)| becomes |(0.9,1)|.
+
+\begin{key}{/tikz/animate/options/exit control=\marg{time fraction}\marg{value fraction}}
+ Specifies an exit control using two values as above. The spline from above
+ would be specified as follows:
+ %
+\begin{codeexample}[code only]
+exit control={0.5}{0},
+entry control={0.9}{1},
+0s = "50",
+10s = "100"
+\end{codeexample}
+
+ Note that the curve specified using exit and entry controls must be
+ ``well-behaved'' in the sense that exactly one value must be specified for
+ each point in time in the time interval.
+
+ In the next three example, we first specify a ``smooth'' exit from the
+ start position, then a smooth arrival at the end position, and, finally
+ both.
+ %
+\begin{codeexample}[animation list={0.333/\frac{1}{3},0.666/\frac{2}{3},1,1.333/1\frac{1}{3},1.666/1\frac{2}{3}}]
+\tikz {
+ \foreach \i in {0,0.1,...,1} \draw (-0.9,.9-\i) -- ++(1.8,0);
+ \node :yshift = { begin on = click,
+ 0s = { exit control = {1}{0}, "0cm" },
+ 1s = "-5mm",
+ 2s = "-10mm" }
+ [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+
+\begin{codeexample}[animation list={0.333/\frac{1}{3},0.666/\frac{2}{3},1,1.333/1\frac{1}{3},1.666/1\frac{2}{3}}]
+\tikz {
+ \foreach \i in {0,0.1,...,1} \draw (-0.9,.9-\i) -- ++(1.8,0);
+ \node :yshift = { begin on = click,
+ 0s = "0cm",
+ 1s = "-5mm",
+ 2s = { entry control = {0}{1}, "-10mm" } }
+ [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+
+\begin{codeexample}[animation list={0.333/\frac{1}{3},0.666/\frac{2}{3},1,1.333/1\frac{1}{3},1.666/1\frac{2}{3}}]
+\tikz {
+ \foreach \i in {0,0.1,...,1} \draw (-0.9,.9-\i) -- ++(1.8,0);
+ \node :yshift = { begin on = click,
+ 0s = { exit control = {1}{0}, "0cm" },
+ 1s = "-5mm",
+ 2s = { entry control = {0}{1}, "-10mm" } }
+ [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+ %
+\end{key}
+
+\begin{key}{/tikz/animate/options/entry control=\marg{time fraction}\marg{value fraction}}
+ Works like |exit control|.
+\end{key}
+
+\begin{key}{/tikz/animate/options/ease in=\marg{fraction} (default 0.5)}
+ A shorthand for |entry control={1-|\meta{fraction}|}{1}|.
+\end{key}
+
+\begin{key}{/tikz/animate/options/ease out=\marg{fraction} (default 0.5)}
+ A shorthand for |exit control={|\meta{fraction}|}{1}|.
+\end{key}
+
+\begin{key}{/tikz/animate/options/ease=\marg{fraction} (default 0.5)}
+ A shorthand for |ease in=|\meta{fraction}|, ease out=|\meta{fraction}.
+
+ Note that since for the first time the entry control is ignored and,
+ similarly, for the last time the exit control is ignored, using the |ease|
+ key with an animation having only two times is particularly easy, since we
+ only need to set |ease| once:
+ %
+\begin{codeexample}[animation list={0.333/\frac{1}{3},0.666/\frac{2}{3},1,1.333/1\frac{1}{3},1.666/1\frac{2}{3}}]
+\tikz {
+ \foreach \i in {0,0.1,...,1} \draw (-0.9,.9-\i) -- ++(1.8,0);
+ \node :yshift = { begin on = click, ease, 0s = "0cm", 2s = "-10mm" }
+ [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+ %
+\end{key}
+
+The opposite of having a smooth curve between two values, is to have a ``jump''
+from one value to the next. There are two keys for this:
+
+\begin{key}{/tikz/animate/options/stay}
+ Specifies that inside the time interval the value ``stays put'' at the
+ first value till the end of the interval, where it will jump to the second
+ value. This is similar to an exit control where the curve is ``infinitely
+ flat''.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2,2.5}]
+\tikz {
+ \foreach \i in {0,0.1,...,1} \draw (-0.9,.9-\i) -- ++(1.8,0);
+ \node :yshift = { begin on = click,
+ 0s = "0cm",
+ 1s = {stay, "-5mm"},
+ 2s = "-10mm" }
+ [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+ %
+\end{key}
+
+\begin{key}{/tikz/animate/options/jump}
+ Works like the |stay| key, but will cause the value to ``jump to'' the new
+ value right at the beginning of the time interval. It is similar to an
+ entry control specifying a ``flat'' curve.
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2,2.5}]
+\tikz {
+ \foreach \i in {0,0.1,...,1} \draw (-0.9,.9-\i) -- ++(1.8,0);
+ \node :yshift = { begin on = click,
+ 0s = "0cm",
+ 1s = {jump, "-5mm"},
+ 2s = "-10mm" }
+ [fill = blue!20, draw = blue, very thick, circle] {Click me!};
+}
+\end{codeexample}
+ %
+\end{key}
+
+
+\subsection{Snapshots}
+\label{section-anim-snap}
+
+Snapshots are a way of taking a ``photographic snapshot'' of an animation at a
+certain time and then insert these into \textsc{pdf} files (or, for that
+matter, Postscript files or files in any other format, including \textsc{svg}):
+You specify a time like |2s| and then \tikzname\ will compute what the
+animation ``would look like after 2s'' and insert the necessary graphics
+command for rendering the graphic objects in the correct way. Since this
+computation is done by \tikzname\ and since only ``normal'' graphics command
+are inserted into the output, snapshots work with all output formats.
+
+Apart from providing a fallback for \textsc{pdf}, snapshots are very useful by
+themselves: They make it easy to ``show'' how an animation unfolds on paper.
+For this, you simply typeset the same picture with the same animation several
+times (using a simple |\foreach| loop), but each time you set a different
+snapshot time. This will result in a sequence of pictures that depict the
+animation at different points in time and which can then be inserted alongside
+each other into the printed document. This approach has been used with the
+examples of animations in this manual.
+%
+\begin{codeexample}[]
+\foreach \t in {0.5, 1, 1.5, 2}
+ \tikz [make snapshot of = \t]
+ \fill :fill = {0s="black", 2s="red"} (0,0) circle [radius = 5mm];
+\end{codeexample}
+
+Creating snapshots is done using the following key:
+
+\begin{key}{/tikz/make snapshot of=\meta{time}}
+ When this key is used in a \TeX\ scope, animation commands given in the
+ scope do not add animation code to the output. Instead, \tikzname\ computes
+ the values the attributes of the animation would have at the specified
+ \meta{time} and inserts the necessary system layer command to set the
+ attribute to the computed values (some care has been taken to make this
+ computation match the computations done by viewer applications as best as
+ possible).
+ %
+\begin{codeexample}[]
+\tikz [make snapshot of = 1s] {
+ \fill :fill = { 0s = "black", 2s = "white" } (0,0) rectangle ++(1,1);
+ \fill :fill = { 1s = "black", 3s = "white" } (2,0) rectangle ++(1,1);
+}
+\end{codeexample}
+
+ The moment \meta{time} is best thought of as \meta{time} seconds after the
+ ``moment zero'' where all timelines start by default. Now, ``real''
+ animation may start at different time through user interaction, which
+ clearly makes no sense for snapshots. Nevertheless, you will sometimes wish
+ to have more control over when a timeline starts for the purposes of taking
+ snapshots. You can use the following key for this:
+
+ \begin{key}{/tikz/animate/options/begin snapshot=\meta{start time}}
+ Use this key on a timeline to specify that, only for purposes of taking
+ snapshots, the timeline starts at \meta{start time} rather than at
+ ``moment zero''. (Think of this as saying that the animation starts
+ when a virtual user clicks on the animation and this click occurs
+ \meta{start time} seconds after the general ``moment zero'', causing
+ the animation to ``lag behind'' by this amount of time.)
+ Computationally, for the timeline the \meta{start time} is subtracted
+ from the snapshot's \meta{time} when the value needs to be determined:
+ %
+\begin{codeexample}[]
+\tikz [make snapshot of = 1s] {
+ \fill :fill = { 0s = "black", 2s = "white",
+ begin snapshot = 1s } (0,0) rectangle ++(1,1);
+ \fill :fill = { 1s = "black", 3s = "white" } (2,0) rectangle ++(1,1);
+}
+\end{codeexample}
+ \end{key}
+
+ The computations of the values the animation ``would have'' are done
+ entirely by \tikzname, which has the big advantage is that no support from
+ the viewer application or the output format is needed -- snapshots work
+ with all output formats, not just with \textsc{svg}. However, computations
+ done by \tikzname\ are not always very precise and can be slow because of
+ \TeX's limitations. In addition, there are some further limitations when it
+ comes to \tikzname's computation of snapshot values:
+ %
+ \begin{itemize}
+ \item As mentioned above, except for |begin snapshot|, other commands
+ for specifying the beginning or end of a timeline based on user
+ interaction make no sense for timelines: The keys |begin|,
+ |begin on|, |end|, and |end on| are silently ignored.
+ \item The value |current value| for a value is forbidden since this
+ value is almost impossible to compute by \tikzname.
+ \item Accumulating repeats of a motion are (currently) not supported,
+ but should not rely on this.
+ \end{itemize}
+
+ When \meta{time} is empty, ``snapshot taking'' is switched off and
+ animation commands are inserted once more.
+\end{key}
+
+\begin{key}{/tikz/make snapshot after=\meta{time}}
+ Works exactly like |make snapshot of|, only the \meta{time} is interpreted
+ as $\meta{time} + \epsilon$. This only makes a difference at the end of a
+ timeline and when there are two or more values specified for the same time:
+ When there are several values specified for time~$t$, a normal snapshot for
+ time~$t$ uses the first value given for the attribute. In contrast, this
+ command would use the last one given. Similarly, when an animation timeline
+ ends at time $t$, a normal snapshot of time $t$ would use the last value of
+ the timeline, while this key would not apply the animation at all (it has
+ already ended at time $t + \epsilon$).
+ %
+\begin{codeexample}[]
+\tikz [make snapshot of = 2s]
+ \fill :fill = { 0s = "green", 2s = "red" } (0,0) rectangle ++(1,1);
+\tikz [make snapshot after = 2s]
+ \fill :fill = { 0s = "green", 2s = "red" } (0,0) rectangle ++(1,1);
+\end{codeexample}
+ %
+\end{key}
+
+\begin{key}{/tikz/make snapshot if necessary=\meta{time} (default 0s)}
+ This key makes a snapshot of \meta{time} only when the output format does
+ not provide support for animations; if the output format supports
+ animations (like \textsc{svg}), then the command has no effect and
+ animations are created normally.
+
+ This manual is typeset with the following being set once are for all in
+ preamble:
+ %
+\begin{codeexample}[code only]
+\tikzset{make snapshot if necessary}
+\end{codeexample}
+
+ Because of this setting, in the \textsc{pdf} version of this document, all
+ animations are shown at the value they would have at moment~$0s$. In
+ contrast, in the \textsc{svg} version, the animations are created normally.
+
+ In both versions, the smaller pictures showing how the animation proceeds
+ over time are created using |make snapshot of| for the indicated times.
+\end{key}
+
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: "pgfmanual"
+%%% End:
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-arrows.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-arrows.tex
index 6e6f87da9c8..bf9bfd8a4a1 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-arrows.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-arrows.tex
@@ -10,18 +10,16 @@
\section{Arrows}
\label{section-tikz-arrows}
-
\subsection{Overview}
-\tikzname\ allows you to add (multiple) arrow tips to the end of
-lines as in \tikz [baseline] \draw [->>]%<<
-(0,.5ex) -- (3ex,.5ex); or in \tikz [baseline] \draw [-{Latex[]}]
-(0,.5ex) -- (3ex,.5ex);. It is possible to change which arrow tips are
-used ``on-the-fly,'' you can have several arrow tips in a row, and you
-can change the appearance of each of them individually using a special
-syntax. The following example is a perhaps slightly ``excessive''
-demonstration of what you can do (you need to load the |arrows.meta|
-library for it to work):
+\tikzname\ allows you to add (multiple) arrow tips to the end of lines as in
+\tikz [baseline] \draw [->>] (0,.5ex) -- (3ex,.5ex); or in \tikz [baseline]
+\draw [-{Latex[]}] (0,.5ex) -- (3ex,.5ex);. It is possible to change which
+arrow tips are used ``on-the-fly'', you can have several arrow tips in a row,
+and you can change the appearance of each of them individually using a special
+syntax. The following example is a perhaps slightly ``excessive'' demonstration
+of what you can do (you need to load the |arrows.meta| library for it to work):
+%
\begin{codeexample}[]
\tikz {
\node [circle,draw] (A) {A};
@@ -29,7 +27,7 @@ library for it to work):
\draw [draw = blue, thick,
arrows={
- Computer Modern Rightarrow [sep]
+ Computer Modern Rightarrow [sep]
- Latex[blue!50,length=8pt,bend,line width=0pt]
Stealth[length=8pt,open,bend,sep]}]
(A) edge [bend left=45] (B)
@@ -37,70 +35,64 @@ library for it to work):
}
\end{codeexample}
-There are a number of predefined generic arrow tip kinds whose
-appearance you can modify in many ways using various options. It is
-also possible to define completely new arrow tip kinds, see
-Section~\ref{section-arrows}, but doing this is somewhat harder than
-configuring an existing kind (it is like the difference between using
-a font at different sizes or faces like italics, compared to
-designing a new font yourself).
-
-In the present section, we go over the various ways in which you can
-configure which particular arrow tips are \emph{used.} The glorious
-details of how new arrow tips can be defined are explained in
-Section~\ref{section-arrows}.
-
-At the end of the present section, Section~\ref{section-arrows-meta},
-you will find a description of the different predefined arrow tips
-from the |arrows.meta| library.
-
-\emph{Remark:} Almost all of the features described in the following
-were introduced in version 3.0 of \tikzname. For compatibility
-reasons, the old arrow tips are still available. To differentiate
-between the old and new arrow tips, the following rule is used: The
-new, more powerful arrow tips start with an uppercase letter as in
-|Latex|, compared to the old arrow tip |latex|.
-
-\emph{Remark:} The libraries |arrows| and |arrows.spaced| are
-deprecated. Use |arrows.meta| instead/additionally, which allows you
-to do all that the old libraries offered, plus much more. However, the
-old libraries still work and you can even mix old and new arrow tips
-(only, the old arrow tips cannot be configured in the ways described
-in the rest of this section; saying |scale=2| for a |latex| arrow has
-no effect for instance, while for |Latex| arrows it doubles their size
-as one would expect.)
+There are a number of predefined generic arrow tip kinds whose appearance you
+can modify in many ways using various options. It is also possible to define
+completely new arrow tip kinds, see Section~\ref{section-arrows}, but doing
+this is somewhat harder than configuring an existing kind (it is like the
+difference between using a font at different sizes or faces like italics,
+compared to designing a new font yourself).
+
+In the present section, we go over the various ways in which you can configure
+which particular arrow tips are \emph{used}. The glorious details of how new
+arrow tips can be defined are explained in Section~\ref{section-arrows}.
+
+At the end of the present section, Section~\ref{section-arrows-meta}, you will
+find a description of the different predefined arrow tips from the
+|arrows.meta| library.
+
+\emph{Remark:} Almost all of the features described in the following were
+introduced in version 3.0 of \tikzname. For compatibility reasons, the old
+arrow tips are still available. To differentiate between the old and new arrow
+tips, the following rule is used: The new, more powerful arrow tips start with
+an uppercase letter as in |Latex|, compared to the old arrow tip |latex|.
+
+\emph{Remark:} The libraries |arrows| and |arrows.spaced| are deprecated. Use
+|arrows.meta| instead/additionally, which allows you to do all that the old
+libraries offered, plus much more. However, the old libraries still work and
+you can even mix old and new arrow tips (only, the old arrow tips cannot be
+configured in the ways described in the rest of this section; saying |scale=2|
+for a |latex| arrow has no effect for instance, while for |Latex| arrows it
+doubles their size as one would expect.)
\subsection{Where and When Arrow Tips Are Placed}
\label{section-arrow-tips-where}
-In order to add arrow tips to the lines you draw, the following
-conditions must be met:
-
+In order to add arrow tips to the lines you draw, the following conditions must
+be met:
+%
\begin{enumerate}
-\item You have specified that arrow tips should be added to
- lines, using the |arrows| key or its short form.
-\item You set the |tips| key to some value that causes tips to be
- drawn (to be explained later).
-\item You do not use the |clip| key (directly or indirectly) with the
- current path.
-\item The path actually has two ``end points'' (it is not
- ``closed'').
+ \item You have specified that arrow tips should be added to lines, using
+ the |arrows| key or its short form.
+ \item You set the |tips| key to some value that causes tips to be drawn
+ (to be explained later).
+ \item You do not use the |clip| key (directly or indirectly) with the
+ current path.
+ \item The path actually has two ``end points'' (it is not ``closed'').
\end{enumerate}
-Let us start with an introduction to the basics of the |arrows| key:
+Let us start with an introduction to the basics of the |arrows| key:
-\begin{key}{/tikz/arrows=\meta{start arrow specification}|-|\meta{end
- arrow specification}}
- This option sets the arrow tip(s) to be used at the start and end of
- lines. An empty value as in |->| for the start indicates that no
- arrow tip should be drawn at the start.%
- \indexoption{arrows}
-
- \emph{Note: Since the arrow option is so often used, you can leave
- out the text |arrows=|.} What happens is that every (otherwise
- unknown) option that contains a |-| is interpreted as an arrow specification.
+\begin{key}{/tikz/arrows=\meta{start arrow specification}|-|\meta{end arrow specification}}
+ This option sets the arrow tip(s) to be used at the start and end of lines.
+ An empty value as in |->| for the start indicates that no arrow tip should
+ be drawn at the start.%
+ \indexoption{arrows}
+ \emph{Note: Since the arrow option is so often used, you can leave out the
+ text |arrows=|.} What happens is that every (otherwise unknown) option that
+ contains a |-| is interpreted as an arrow specification.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[->] (0,0) -- (1,0);
@@ -108,113 +100,113 @@ Let us start with an introduction to the basics of the |arrows| key:
\end{tikzpicture}
\end{codeexample}
- In the above example, the first start specification is empty and the
- second is |>|. The end specifications are |>| for the first line and
- |Stealth| for the second line. Note that it makes a difference
- whether |>| is used in a start specification or in an end
- specification: In an end specification it creates, as one would
- expect, a pointed tip at the end of the line. In the start
- specification, however, it creates a ``reversed'' version if this
- arrow -- which happens to be what one would expect here.
-
- The above specifications are very simple and only select a single
- arrow tip without any special configuration options, resulting in
- the ``natural'' versions of these arrow tips. It is also possible to
- ``configure'' arrow tips in many different ways, as explained in
- detail in Section~\ref{section-arrow-config} below by adding options
- in square brackets following the arrow tip kind:
+ In the above example, the first start specification is empty and the second
+ is |>|. The end specifications are |>| for the first line and |Stealth| for
+ the second line. Note that it makes a difference whether |>| is used in a
+ start specification or in an end specification: In an end specification it
+ creates, as one would expect, a pointed tip at the end of the line. In the
+ start specification, however, it creates a ``reversed'' version if this
+ arrow -- which happens to be what one would expect here.
+ The above specifications are very simple and only select a single arrow tip
+ without any special configuration options, resulting in the ``natural''
+ versions of these arrow tips. It is also possible to ``configure'' arrow
+ tips in many different ways, as explained in detail in
+ Section~\ref{section-arrow-config} below by adding options in square
+ brackets following the arrow tip kind:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[-{Stealth[red]}] (0,0) -- (1,0);
\end{tikzpicture}
\end{codeexample}
- Note that in the example I had to surround the end specification by
- braces. This is necessary so that \tikzname\ does not mistake the
- closing square bracket of the |Stealth| arrow tip's options for the
- end of the options of the |\draw| command. In general, you often
- need to add braces when specifying arrow tips except for simple case
- like |->| or |<<->|, which are pretty frequent, though. When in
- doubt, say |arrows={|\meta{start spec}|-|\meta{end spec}|}|, that
- will always work.
+ Note that in the example I had to surround the end specification by braces.
+ This is necessary so that \tikzname\ does not mistake the closing square
+ bracket of the |Stealth| arrow tip's options for the end of the options of
+ the |\draw| command. In general, you often need to add braces when
+ specifying arrow tips except for simple case like |->| or |<<->|, which are
+ pretty frequent, though. When in doubt, say
+ |arrows={|\meta{start spec}|-|\meta{end spec}|}|, that will always work.
- It is also possible to specify multiple (different) arrow tips in a
- row inside a specification, see Section~\ref{section-arrow-spec}
- below for details.
+ It is also possible to specify multiple (different) arrow tips in a row
+ inside a specification, see Section~\ref{section-arrow-spec} below for
+ details.
\end{key}
-As was pointed out earlier, to add arrow tips to a path, the path must
-have ``end points'' and not be ``closed'' -- otherwise adding arrow
-tips makes little sense, after all. However, a path can actually
-consist of several subpath, which may be open or not and may even
-consist of only a single point (a single move-to). In this case, it is
-not immediately obvious, where arrow heads should be placed. The
-actual rules that \tikzname\ uses are goverened by the setting of the
-key |tips|:
+As was pointed out earlier, to add arrow tips to a path, the path must have
+``end points'' and not be ``closed'' -- otherwise adding arrow tips makes
+little sense, after all. However, a path can actually consist of several
+subpath, which may be open or not and may even consist of only a single point
+(a single move-to). In this case, it is not immediately obvious, where arrow
+heads should be placed. The actual rules that \tikzname\ uses are governed by
+the setting of the key |tips|:
\begin{key}{/pgf/tips=\meta{value} (default true, initially on draw)}
- \keyalias{tikz}
-
- This key governs in what situations arrow tips are added to a
- path. The following \meta{values} are permissible:
- \begin{itemize}
- \item |true| (the value used when no \meta{value} is specified)
- \item |proper|
- \item |on draw| (the initial value, if the key has not yet been used
- at all)
- \item |on proper draw|
- \item |never| or |false| (same effect)
- \end{itemize}
-
- Firstly, there are a whole bunch of situations where the setting of
- these (or other) options causes no arrow tips to be shown:
- \begin{itemize}
- \item If no arrow tips have been specified (for instance, by having
- said |arrows=-|), no arrow tips are drawn.
- \item If the |clip| option is set, no arrow tips are drawn.
- \item If |tips| has been set to |never| or |false|, no arrow tips are drawn.
- \item If |tips| has been set to |on draw| or |on proper draw|, but
- the |draw| option is not set, no arrow tips are drawn.
- \item If the path is empty (as in |\path ;|), no arrow tips are drawn.
- \item If at least one of the subpaths of a path is closed (|cycle| is
- used somewhere or something like |circle| or |rectangle|), arrow
- tips are never drawn anywhere -- even if there are open subpaths.
- \end{itemize}
-
- Now, if we pass all of the above tests, we must have a closer look
- at the path. All its subpaths must now be open and there must be at
- least one subpath. We conside the last one. Arrow tips will only be
- added to this last subpath.
-
- \begin{enumerate}
- \item If this last subpath not degenerate (all coordinates on the
- subpath are the same as in a single ``move-to'' |\path (0,0);| or
- in a ``move-to'' followed by a ``line-to'' to the same position as
- in |\path (1,2) -- (1,2)|), arrow tips are added to this last
- subpath now.
- \item If the last subpath is degenerate, we add arrow tips pointing
- upward at the single coordinate mentioned in the path, but only
- for |tips| begin set to |true| or to |on draw| -- and not for
- |proper| nor for |on proper draw|. In other words, ``proper''
- suppresses arrow tips on degenerate paths.
- \end{enumerate}
+ \keyalias{tikz}
+ This key governs in what situations arrow tips are added to a path. The
+ following \meta{values} are permissible:
+ %
+ \begin{itemize}
+ \item |true| (the value used when no \meta{value} is specified)
+ \item |proper|
+ \item |on draw| (the initial value, if the key has not yet been used
+ at all)
+ \item |on proper draw|
+ \item |never| or |false| (same effect)
+ \end{itemize}
+
+ Firstly, there are a whole bunch of situations where the setting of
+ these (or other) options causes no arrow tips to be shown:
+ %
+ \begin{itemize}
+ \item If no arrow tips have been specified (for instance, by having
+ said |arrows=-|), no arrow tips are drawn.
+ \item If the |clip| option is set, no arrow tips are drawn.
+ \item If |tips| has been set to |never| or |false|, no arrow tips are
+ drawn.
+ \item If |tips| has been set to |on draw| or |on proper draw|, but
+ the |draw| option is not set, no arrow tips are drawn.
+ \item If the path is empty (as in |\path ;|), no arrow tips are
+ drawn.
+ \item If at least one of the subpaths of a path is closed (|cycle| is
+ used somewhere or something like |circle| or |rectangle|), arrow
+ tips are never drawn anywhere -- even if there are open subpaths.
+ \end{itemize}
+
+ Now, if we pass all of the above tests, we must have a closer look at the
+ path. All its subpaths must now be open and there must be at least one
+ subpath. We consider the last one. Arrow tips will only be added to this
+ last subpath.
+
+ \begin{enumerate}
+ \item If this last subpath not degenerate (all coordinates on the
+ subpath are the same as in a single ``move-to'' |\path (0,0);| or
+ in a ``move-to'' followed by a ``line-to'' to the same position
+ as in |\path (1,2) -- (1,2)|), arrow tips are added to this last
+ subpath now.
+ \item If the last subpath is degenerate, we add arrow tips pointing
+ upward at the single coordinate mentioned in the path, but only
+ for |tips| begin set to |true| or to |on draw| -- and not for
+ |proper| nor for |on proper draw|. In other words, ``proper''
+ suppresses arrow tips on degenerate paths.
+ \end{enumerate}
\begin{codeexample}[]
% No path, no arrow tips:
-\tikz [<->] \draw;
+\tikz [<->] \draw;
\end{codeexample}
\begin{codeexample}[]
% Degenerate path, draw arrow tips (but no path, it is degenerate...)
-\tikz [<->] \draw (0,0);
+\tikz [<->] \draw (0,0);
\end{codeexample}
\begin{codeexample}[]
% Degenerate path, tips=proper suppresses arrows
-\tikz [<->] \draw [tips=proper] (0,0);
+\tikz [<->] \draw [tips=proper] (0,0);
\end{codeexample}
\begin{codeexample}[]
% Normal case:
-\tikz [<->] \draw (0,0) -- (1,0);
+\tikz [<->] \draw (0,0) -- (1,0);
\end{codeexample}
\begin{codeexample}[]
% Two subpaths, only second gets tips
@@ -234,66 +226,59 @@ key |tips|:
\end{codeexample}
\end{key}
-One common pitfall when arrow tips are added to a path should be
-addressed right here at the beginning: When \tikzname\ positions an
-arrow tip at the start, for all its computations it only takes into
-account the first segment of the subpath to which the arrow tip is
-added. This ``first segment'' is the first line-to or curve-to operation (or arc
-or parabola or a similar operation) of the path; but note that
-decorations like |snake| will add many small line segments to
-paths. The important point
-is that if this first segment is very small, namely smaller that the
-arrow tip itself, strange things may result. As will be explained in
-Section~\ref{section-arrow-flex}, \tikzname\ will modify the path by
-shortening the first segment and shortening a segment below its length
-may result in strange effects. Similarly, for tips at the end of a
+One common pitfall when arrow tips are added to a path should be addressed
+right here at the beginning: When \tikzname\ positions an arrow tip at the
+start, for all its computations it only takes into account the first segment of
+the subpath to which the arrow tip is added. This ``first segment'' is the
+first line-to or curve-to operation (or arc or parabola or a similar operation)
+of the path; but note that decorations like |snake| will add many small line
+segments to paths. The important point is that if this first segment is very
+small, namely smaller that the arrow tip itself, strange things may result. As
+will be explained in Section~\ref{section-arrow-flex}, \tikzname\ will modify
+the path by shortening the first segment and shortening a segment below its
+length may result in strange effects. Similarly, for tips at the end of a
subpath, only the last segment is considered.
-The bottom line is that wherever an arrow tip is added to a path, the
-line segment where it is added should be ``long enough.''
-
-
+The bottom line is that wherever an arrow tip is added to a path, the line
+segment where it is added should be ``long enough''.
\subsection{Arrow Keys: Configuring the Appearance of a Single Arrow Tip}
\label{section-arrow-config}
-For standard arrow tip kinds, like |Stealth| or |Latex| or |Bar|,
-you can easily change their size, aspect ratio, color, and other
-parameters. This is similar to selecting a font face from a font
-family: \emph{``This text''} is not just typeset in the font
-``Computer Modern,'' but rather in ``Computer Modern, italic face,
-11pt size, medium weight, black color, no underline, \dots''
-Similarly, an arrow tip is not just a ``Stealth'' arrow tip, but
-rather a ``Stealth arrow tip at its natural size, flexing, but not
-bending along the path, miter line caps, draw and fill colors
-identical to the path draw color, \dots''
-
-Just as most programs make it easy to ``configure'' which font should
-be used at a certain point in a text, \tikzname\ tries to make it easy
-to specify which configuration of an arrow tip should be used. You use
-\emph{arrow keys}, where a certain parameter like the |length| of an
-arrow is set to a given value using the standard key--value
-syntax. You can provide several arrow keys following an arrow tip kind
-in an arrow tip specification as in
+For standard arrow tip kinds, like |Stealth| or |Latex| or |Bar|, you can
+easily change their size, aspect ratio, color, and other parameters. This is
+similar to selecting a font face from a font family: \emph{``This text''} is
+not just typeset in the font ``Computer Modern'', but rather in ``Computer
+Modern, italic face, 11pt size, medium weight, black color, no underline,
+\dots'' Similarly, an arrow tip is not just a ``Stealth'' arrow tip, but rather
+a ``Stealth arrow tip at its natural size, flexing, but not bending along the
+path, miter line caps, draw and fill colors identical to the path draw color,
+\dots''
+
+Just as most programs make it easy to ``configure'' which font should be used
+at a certain point in a text, \tikzname\ tries to make it easy to specify which
+configuration of an arrow tip should be used. You use \emph{arrow keys}, where
+a certain parameter like the |length| of an arrow is set to a given value using
+the standard key--value syntax. You can provide several arrow keys following an
+arrow tip kind in an arrow tip specification as in
|Stealth[length=4pt,width=2pt]|.
-While selecting a font may be easy, \emph{designing} a new font is a
-highly creative and difficult process and more often than not, not all
-faces of a font are available on any given system. The difficulties
-involved in designing a new arrow tip are somewhat similar to designing a new
-letter for a font and, thus, it may also happen that not all
-configuration options are actually implemented for a given arrow
-tip. Naturally, for the standard arrow tips, all configuration options
-are available -- but for special-purpose arrow tips it may well happen
-that an arrow tip kind simply ``ignores'' some of the configurations
-given by you.
+While selecting a font may be easy, \emph{designing} a new font is a highly
+creative and difficult process and more often than not, not all faces of a font
+are available on any given system. The difficulties involved in designing a new
+arrow tip are somewhat similar to designing a new letter for a font and, thus,
+it may also happen that not all configuration options are actually implemented
+for a given arrow tip. Naturally, for the standard arrow tips, all
+configuration options are available -- but for special-purpose arrow tips it
+may well happen that an arrow tip kind simply ``ignores'' some of the
+configurations given by you.
Some of the keys explained in the following are defined in the library
-|arrows.meta|, others are always available. This has to do with the
-question of whether the arrow key needs to be supported directly in the
-\pgfname\ core or not. In general, the following explanations assume
-that |arrows.meta| has been loaded.
+|arrows.meta|, others are always available. This has to do with the question of
+whether the arrow key needs to be supported directly in the \pgfname\ core or
+not. In general, the following explanations assume that |arrows.meta| has been
+loaded.
\subsubsection{Size}
@@ -303,12 +288,13 @@ undoubtedly its size. The following two keys are the main keys that
are important in this context:
\begin{key}{/pgf/arrow keys/length=\meta{dimension}| |\opt{\meta{line width factor}}%
- | |\opt{\meta{outer factor}}}
- \label{length-arrow-key}%
- This parameter is usually the most important parameter that governs
- the size of an arrow tip: The \meta{dimension} that you provide
- dictates the distance from the ``very tip'' of the arrow to its
- ``back end'' along the line:
+ | |\opt{\meta{outer factor}}}
+ \label{length-arrow-key}%
+ This parameter is usually the most important parameter that governs the
+ size of an arrow tip: The \meta{dimension} that you provide dictates the
+ distance from the ``very tip'' of the arrow to its ``back end'' along the
+ line:
+ %
\begin{codeexample}[]
\tikz{
\draw [-{Stealth[length=5mm]}] (0,0) -- (2,0);
@@ -328,51 +314,46 @@ are important in this context:
}
\end{codeexample}
- \medskip
- \noindent \textbf{The Line Width Factors.}
- Following the \meta{dimension}, you may put a space followed by a
- \meta{line width factor}, which must be a plain number (no |pt| or
- |cm| following). When you provide such a number, the size of the
- arrow tip is not just \meta{dimension}, but rather $\meta{dimension}
- + \meta{line width factor}\cdot w$ where
- $w$ is the width of the to-be-drawn path. This
- makes it easy to vary the size of an arrow tip in accordance with
- the line width -- usually a very good idea since thicker lines will
- need thicker arrow tips.
-
- As an example, when you write |length=0pt 5|, the length of the
- arrow will be exactly five times the current line width. As another
- example, the default length of a |Latex| arrow is
- |length=3pt 4.5 0.8|. Let us ignore the 0.8 for a moment; the
- |4pt 4.5| then means that for the standard line width of
- |0.4pt|, the length of a |Latex| arrow will be exactly 4.8pt (3pt
- plus 4.5 times |0.4pt|).
-
- Following the line width factor, you can additionally provide an
- \meta{outer factor}, again preceded by a space (the |0.8| in the
- above example). This factor is
- taken into consideration only when the |double| option is used, that
- is, when a so-called ``inner line width''. For a double line, we can
- identify three different ``line widths'', namely the inner line
- width $w_i$, the line width $w_o$ of the two outer lines, and the
- ``total line width'' $w_t = w_i + 2w_o$. In the below examples, we
- have $w_i = 3\mathrm{pt}$, $w_o=1\mathrm{pt}$, and $w_t =
- 5\mathrm{pt}$. It is not immediately clear
- which of these line widths should be considered as $w$ in the above
- formula $\meta{dimension} + \meta{line width factor}\cdot w$ for the
- computation of the length. One can argue both for $w_t$ and also for
- $w_o$. Because of this, you use the \meta{outer factor} to
- decide on one of them or even
- mix them: \tikzname\ sets $w = \meta{outer factor} w_o +
- (1-\meta{outer factor})w_t$. Thus, when the outer factor is $0$, as
- in the first of the following examples and as is the default when it
- is not specified, the computed $w$ will be the total
- line width $w_t = 5\mathrm{pt}$. Since
- $w=5\mathrm{pt}$, we get a total length of $15pt$ in the first
- example (because of the factor |3|). In contrast, in the last
- example, the outer factor is 1 and, thus, $w = w_o = \mathrm{1pt}$ and the
- resulting length is 3pt. Finally, for the middle case, the ``middle'' between 5pt and
- 1pt is 3pt, so the length is 9pt.
+ \medskip
+ \noindent \textbf{The Line Width Factors.}
+ Following the \meta{dimension}, you may put a space followed by a
+ \meta{line width factor}, which must be a plain number (no |pt| or |cm|
+ following). When you provide such a number, the size of the arrow tip is
+ not just \meta{dimension}, but rather $\meta{dimension} + \meta{line width
+ factor}\cdot w$ where $w$ is the width of the to-be-drawn path. This makes
+ it easy to vary the size of an arrow tip in accordance with the line width
+ -- usually a very good idea since thicker lines will need thicker arrow
+ tips.
+
+ As an example, when you write |length=0pt 5|, the length of the arrow will
+ be exactly five times the current line width. As another example, the
+ default length of a |Latex| arrow is |length=3pt 4.5 0.8|. Let us ignore
+ the 0.8 for a moment; the |4pt 4.5| then means that for the standard line
+ width of |0.4pt|, the length of a |Latex| arrow will be exactly 4.8pt (3pt
+ plus 4.5 times |0.4pt|).
+
+ Following the line width factor, you can additionally provide an
+ \meta{outer factor}, again preceded by a space (the |0.8| in the above
+ example). This factor is taken into consideration only when the |double|
+ option is used, that is, when a so-called ``inner line width''. For a
+ double line, we can identify three different ``line widths'', namely the
+ inner line width $w_i$, the line width $w_o$ of the two outer lines, and
+ the ``total line width'' $w_t = w_i + 2w_o$. In the below examples, we have
+ $w_i = 3\mathrm{pt}$, $w_o=1\mathrm{pt}$, and $w_t = 5\mathrm{pt}$. It is
+ not immediately clear which of these line widths should be considered as
+ $w$ in the above formula $\meta{dimension} + \meta{line width factor}\cdot
+ w$ for the computation of the length. One can argue both for $w_t$ and also
+ for $w_o$. Because of this, you use the \meta{outer factor} to decide on
+ one of them or even mix them: \tikzname\ sets $w = \meta{outer factor} w_o
+ + (1-\meta{outer factor})w_t$. Thus, when the outer factor is $0$, as in
+ the first of the following examples and as is the default when it is not
+ specified, the computed $w$ will be the total line width $w_t =
+ 5\mathrm{pt}$. Since $w=5\mathrm{pt}$, we get a total length of $15pt$ in
+ the first example (because of the factor |3|). In contrast, in the last
+ example, the outer factor is 1 and, thus, $w = w_o = \mathrm{1pt}$ and the
+ resulting length is 3pt. Finally, for the middle case, the ``middle''
+ between 5pt and 1pt is 3pt, so the length is 9pt.
+ %
\begin{codeexample}[]
\tikz \draw [line width=1pt, double distance=3pt,
arrows = {-Latex[length=0pt 3 0]}] (0,0) -- (1,0);
@@ -386,22 +367,23 @@ are important in this context:
arrows = {-Latex[length=0pt 3 1]} ] (0,0) -- (1,0);
\end{codeexample}
- \medskip
- \noindent \textbf{The Exact Length.}
- For an arrow tip kind that is just an outline that is filled with a
- color, the specified length should \emph{exactly} equal the distance
- from the tip to the back end. However, when the arrow tip is drawn
- by stroking a line, it is no longer obvious whether the |length|
- should refer to the extend of the stroked lines' path or of the
- resulting pixels (which will be wider because of the thickness of
- the stroking pen). The rules are as follows:
- \begin{enumerate}
- \item If the arrow tip consists of a closed path (like |Stealth| or
- |Latex|), imagine the arrow tip drawn from left to right using a
- miter line cap. Then the |length| should be the horizontal
- distance from the first drawn ``pixel'' to the last drawn
- ``pixel''. Thus, the thickness of the stroked line and also the
- miter ends should be taken into account:
+ \medskip
+ \noindent \textbf{The Exact Length.}
+ For an arrow tip kind that is just an outline that is filled with a color,
+ the specified length should \emph{exactly} equal the distance from the tip
+ to the back end. However, when the arrow tip is drawn by stroking a line,
+ it is no longer obvious whether the |length| should refer to the extend of
+ the stroked lines' path or of the resulting pixels (which will be wider
+ because of the thickness of the stroking pen). The rules are as follows:
+ %
+ \begin{enumerate}
+ \item If the arrow tip consists of a closed path (like |Stealth| or
+ |Latex|), imagine the arrow tip drawn from left to right using a
+ miter line cap. Then the |length| should be the horizontal
+ distance from the first drawn ``pixel'' to the last drawn
+ ``pixel''. Thus, the thickness of the stroked line and also the
+ miter ends should be taken into account:
+ %
\begin{codeexample}[]
\tikz{
\draw [line width=1mm, -{Stealth[length=10mm, open]}]
@@ -409,12 +391,14 @@ are important in this context:
\draw [|<->|] (2,.6) -- node[above=1mm] {10mm} ++(-10mm,0);
}
\end{codeexample}
- \item If, in the above case, the arrow is drawn using a round line
- join (see Section~\ref{section-arrow-key-caps} for details on how
- to select this), the size of the arrow should still be the same as
- in the first case (that is, as if a miter join were used). This
- creates some ``visual consistency'' if the two modes are mixed or
- if you later one change the mode.
+ %
+ \item If, in the above case, the arrow is drawn using a round line
+ join (see Section~\ref{section-arrow-key-caps} for details on how
+ to select this), the size of the arrow should still be the same
+ as in the first case (that is, as if a miter join were used).
+ This creates some ``visual consistency'' if the two modes are
+ mixed or if you later one change the mode.
+ %
\begin{codeexample}[]
\tikz{
\draw [line width=1mm, -{Stealth[length=10mm, open, round]}]
@@ -422,22 +406,23 @@ are important in this context:
\draw [|<->|] (2,.6) -- node[above=1mm] {10mm} ++(-10mm,0);
}
\end{codeexample}
- As the above example shows, however, a rounded arrow will still
- exactly ``tip'' the point where the line should end (the point
- |(2,0)| in the above case). It is only the scaling of the arrow
- that is not affected.
+ %
+ As the above example shows, however, a rounded arrow will still
+ exactly ``tip'' the point where the line should end (the point
+ |(2,0)| in the above case). It is only the scaling of the arrow
+ that is not affected.
\end{enumerate}
\end{key}
\begin{key}{/pgf/arrow keys/width=\meta{dimension}| |\opt{\meta{line width factor}}%
- | |\opt{\meta{outer factor}}}
- This key works line the |length| key, only it specifies the
- ``width'' of the arrow tip; so if width and length are identical, the
- arrow will just touch the borders of a square. (An exception to this
- rule are ``halved'' arrow tips, see
- Section~\ref{section-arrow-key-harpoon}.) The meaning of the two
- optional factor numbers following the \meta{dimension} is the same
- as for the |length| key.
+ | |\opt{\meta{outer factor}}}
+ This key works line the |length| key, only it specifies the ``width'' of
+ the arrow tip; so if width and length are identical, the arrow will just
+ touch the borders of a square. (An exception to this rule are ``halved''
+ arrow tips, see Section~\ref{section-arrow-key-harpoon}.) The meaning of
+ the two optional factor numbers following the \meta{dimension} is the same
+ as for the |length| key.
+ %
\begin{codeexample}[]
\tikz \draw [arrows = {-Latex[width=10pt, length=10pt]}] (0,0) -- (1,0);
\end{codeexample}
@@ -448,50 +433,53 @@ are important in this context:
\begin{key}{/pgf/arrow keys/width'=\meta{dimension}| |\opt{\meta{length
factor}| |\opt{\meta{line width factor}}}}
- The key (note the prime) has a similar effect as the |width|
- key. The difference is that the second, still optional paraemter
- \meta{length factor} specifies the width of the key not as a
- multiple of the line width, but as a multiple of the arrow length.
-
- The idea is that if you write, say, |width'=0pt 0.5|, the width of
- the arrow will be half its length. Indeed, for standard arrow tips
- like |Stealth| the default width is specified in this way so that if
- you change the length of an arrow tip, you also change the width in
- such a way that the aspect ratio of the arrow tip is kept. The other
- way round, if you modify the factor in |width'| without changing the
- length, you change the aspect ratio of the arrow tip.
-
- Note that later changes of the length are taken into account for the
- computation. For instance, if you write
+ The key (note the prime) has a similar effect as the |width| key. The
+ difference is that the second, still optional parameter \meta{length
+ factor} specifies the width of the key not as a multiple of the line width,
+ but as a multiple of the arrow length.
+
+ The idea is that if you write, say, |width'=0pt 0.5|, the width of the
+ arrow will be half its length. Indeed, for standard arrow tips like
+ |Stealth| the default width is specified in this way so that if you change
+ the length of an arrow tip, you also change the width in such a way that
+ the aspect ratio of the arrow tip is kept. The other way round, if you
+ modify the factor in |width'| without changing the length, you change the
+ aspect ratio of the arrow tip.
+
+ Note that later changes of the length are taken into account for the
+ computation. For instance, if you write
+ %
\begin{codeexample}[code only]
-length = 10pt, width'=5pt 2, length=7pt
+length = 10pt, width'=5pt 2, length=7pt
\end{codeexample}
- the resulting width will be $19\mathrm{pt} = 5\mathrm{pt} + 2\cdot
- 7\mathrm{pt}$.
-
+ %
+ the resulting width will be $19\mathrm{pt} = 5\mathrm{pt} + 2\cdot
+ 7\mathrm{pt}$.
+ %
\begin{codeexample}[]
\tikz \draw [arrows = {-Latex[width'=0pt .5, length=10pt]}] (0,0) -- (1,0);
\end{codeexample}
\begin{codeexample}[]
\tikz \draw [arrows = {-Latex[width'=0pt .5, length=15pt]}] (0,0) -- (1,0);
\end{codeexample}
- The third, also optional, parameter allows you to add a multiple of
- the line width to the value computed in terms of the length.
+ %
+ The third, also optional, parameter allows you to add a multiple of the
+ line width to the value computed in terms of the length.
\end{key}
\begin{key}{/pgf/arrow keys/inset=\meta{dimension}| |\opt{\meta{line width factor}}%
- | |\opt{\meta{outer factor}}}
- The key is relevant only for some arrow tips such as the |Stealth|
- arrow tip. It specifies a distance by which something inside the
- arrow tip is set inwards; for the |Stealth| arrow tip it is the
- distance by which the back angle is moved inwards.
-
- The computation of the distance works in the same way as for
- |length| and |width|: To the \meta{dimension} we add \meta{line
- width factor} times that line width, where the line width is
- computed based on the \meta{outer factor} as described for the
- |length| key.
+ | |\opt{\meta{outer factor}}}
+ The key is relevant only for some arrow tips such as the |Stealth| arrow
+ tip. It specifies a distance by which something inside the arrow tip is set
+ inwards; for the |Stealth| arrow tip it is the distance by which the back
+ angle is moved inwards.
+
+ The computation of the distance works in the same way as for |length| and
+ |width|: To the \meta{dimension} we add \meta{line width factor} times that
+ line width, where the line width is computed based on the \meta{outer
+ factor} as described for the |length| key.
+ %
\begin{codeexample}[]
\tikz \draw [arrows = {-Stealth[length=10pt, inset=5pt]}] (0,0) -- (1,0);
\end{codeexample}
@@ -499,46 +487,42 @@ length = 10pt, width'=5pt 2, length=7pt
\tikz \draw [arrows = {-Stealth[length=10pt, inset=2pt]}] (0,0) -- (1,0);
\end{codeexample}
- For most arrows for which there is no ``natural inset'' like, say,
- |Latex|, this key has no effect.
+ For most arrows for which there is no ``natural inset'' like, say, |Latex|,
+ this key has no effect.
\end{key}
-
\begin{key}{/pgf/arrow keys/inset'=\meta{dimension}| |\opt{\meta{length factor}}| |\opt{\meta{line width factor}}}
- This key works like |inset|, only like |width'| the second parameter
- is a factor of the arrow length rather than of the line width. For
- instance, the |Stealth| arrow sets |inset'| to |0pt 0.325| to ensure
- that the inset is always at $13/40$th of the arrow length if nothing
- else is specified.
+ This key works like |inset|, only like |width'| the second parameter is a
+ factor of the arrow length rather than of the line width. For instance, the
+ |Stealth| arrow sets |inset'| to |0pt 0.325| to ensure that the inset is
+ always at $13/40$th of the arrow length if nothing else is specified.
\end{key}
-
-
\begin{key}{/pgf/arrow keys/angle=\meta{angle}|:|\meta{dimension}%
- | |\opt{\meta{line width factor}}%
- | |\opt{\meta{outer factor}}}
- This key sets the |length| and the |width| of an arrow tip at the
- same time. The lenght will be the cosine of \meta{angle}, while the
- width will be twice the sine of half the \meta{angle} (this slightly
- awkward rule ensures that a |Stealth| arrow will have an opening
- angle of \meta{angle} at its tip if this option is used). As for the
- |length| key, if the optional factors are given, they add a certain
- multiple of the line width to the \meta{dimension} before the sine
- and cosines are computed.
+ | |\opt{\meta{line width factor}}%
+ | |\opt{\meta{outer factor}}}
+ This key sets the |length| and the |width| of an arrow tip at the same
+ time. The length will be the cosine of \meta{angle}, while the width will
+ be twice the sine of half the \meta{angle} (this slightly awkward rule
+ ensures that a |Stealth| arrow will have an opening angle of \meta{angle}
+ at its tip if this option is used). As for the |length| key, if the
+ optional factors are given, they add a certain multiple of the line width
+ to the \meta{dimension} before the sine and cosines are computed.
+ %
\begin{codeexample}[]
\tikz \draw [arrows = {-Stealth[inset=0pt, angle=90:10pt]}] (0,0) -- (1,0);
\end{codeexample}
\begin{codeexample}[]
\tikz \draw [arrows = {-Stealth[inset=0pt, angle=30:10pt]}] (0,0) -- (1,0);
\end{codeexample}
+ %
\end{key}
-
\begin{key}{/pgf/arrow keys/angle'=\meta{angle}}
- Sets the width of the arrow to twice the tangent of $\meta{angle}/2$
- times the arrow length. This results in an arrow tip with an opening
- angle of \meta{angle} at its tip and with the specified |length|
- unchanged.
+ Sets the width of the arrow to twice the tangent of $\meta{angle}/2$ times
+ the arrow length. This results in an arrow tip with an opening angle of
+ \meta{angle} at its tip and with the specified |length| unchanged.
+ %
\begin{codeexample}[]
\tikz \draw [arrows = {-Stealth[inset=0pt, length=10pt, angle'=90]}]
(0,0) -- (1,0);
@@ -547,82 +531,89 @@ length = 10pt, width'=5pt 2, length=7pt
\tikz \draw [arrows = {-Stealth[inset=0pt, length=10pt, angle'=30]}]
(0,0) -- (1,0);
\end{codeexample}
+ %
\end{key}
\subsubsection{Scaling}
-In the previous section we saw that there are many options for getting
-``fine control'' overt the length and width of arrow tips. However, in
-some cases, you do not really care whether the arrow tip is 4pt long
-or 4.2pt long, you ``just want it to be a little bit larger than
-usual.'' In such cases, the following keys are useful:
+In the previous section we saw that there are many options for getting ``fine
+control'' overt the length and width of arrow tips. However, in some cases, you
+do not really care whether the arrow tip is 4pt long or 4.2pt long, you ``just
+want it to be a little bit larger than usual''. In such cases, the following
+keys are useful:
\begin{key}{/pgf/arrows keys/scale=\meta{factor} (initially 1)}
- After all the other options listed in the previous (and also the
- following sections) have been processed, \tikzname\ applies a
- \emph{scaling} to the computed length, inset, and width of the arrow
- tip (and, possibly, to other size parameters defined by
- special-purpose arrow tip kinds). Everything is simply scaled by the
- given \meta{factor}.
+ After all the other options listed in the previous (and also the following
+ sections) have been processed, \tikzname\ applies a \emph{scaling} to the
+ computed length, inset, and width of the arrow tip (and, possibly, to other
+ size parameters defined by special-purpose arrow tip kinds). Everything is
+ simply scaled by the given \meta{factor}.
+ %
\begin{codeexample}[]
\tikz {
\draw [arrows = {-Stealth[]}] (0,1) -- (1,1);
\draw [arrows = {-Stealth[scale=1.5]}] (0,0.5) -- (1,0.5);
\draw [arrows = {-Stealth[scale=2]}] (0,0) -- (1,0);
}
-\end{codeexample}
- Note that scaling has \emph{no} effect on the line width (as usual)
- and also not on the arrow padding (the |sep|).
+\end{codeexample}
+ %
+ Note that scaling has \emph{no} effect on the line width (as usual) and
+ also not on the arrow padding (the |sep|).
\end{key}
-You can get even more fine-grained control over scaling using the
-following keys (the |scale| key is just a shorthand for setting both
-of the following keys simultaneously):
+You can get even more fine-grained control over scaling using the following
+keys (the |scale| key is just a shorthand for setting both of the following
+keys simultaneously):
\begin{key}{/pgf/arrows keys/scale length=\meta{factor} (initially 1)}
- This factor works like |scale|, only it is applied only to
- dimensions ``along the axis of the arrow,'' that is, to the length
- and to the inset, but not to the width.
+ This factor works like |scale|, only it is applied only to dimensions
+ ``along the axis of the arrow'', that is, to the length and to the inset,
+ but not to the width.
+ %
\begin{codeexample}[]
\tikz {
\draw [arrows = {-Stealth[]}] (0,1) -- (1,1);
\draw [arrows = {-Stealth[scale length=1.5]}] (0,0.5) -- (1,0.5);
\draw [arrows = {-Stealth[scale length=2]}] (0,0) -- (1,0);
}
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
\begin{key}{/pgf/arrows keys/scale width=\meta{factor} (initially 1)}
- Like |scale length|, but for dimensions related to the width.
+ Like |scale length|, but for dimensions related to the width.
+ %
\begin{codeexample}[]
\tikz {
\draw [arrows = {-Stealth[]}] (0,1) -- (1,1);
\draw [arrows = {-Stealth[scale width=1.5]}] (0,0.5) -- (1,0.5);
\draw [arrows = {-Stealth[scale width=2]}] (0,0) -- (1,0);
}
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
\subsubsection{Arc Angles}
-A few arrow tips consist mainly of arcs, whose length can be
-specified. For these arrow tips, you use the following key:
+A few arrow tips consist mainly of arcs, whose length can be specified. For
+these arrow tips, you use the following key:
\begin{key}{/pgf/arrow keys/arc=\meta{degrees} (initially 180)}
- Sets the angle of arcs in arrows to \meta{degrees}. Note that this key
- is quite different from the |angle| key, which is ``just a
- fancy way of setting the length and width.'' In contrast, the |arc|
- key is used to set the degrees of arcs that are part of an arrow
- tip:
+ Sets the angle of arcs in arrows to \meta{degrees}. Note that this key is
+ quite different from the |angle| key, which is ``just a fancy way of
+ setting the length and width''. In contrast, the |arc| key is used to set
+ the degrees of arcs that are part of an arrow tip:
+ %
\begin{codeexample}[]
\tikz [ultra thick] {
\draw [arrows = {-Hooks[]}] (0,1) -- (1,1);
\draw [arrows = {-Hooks[arc=90]}] (0,0.5) -- (1,0.5);
\draw [arrows = {-Hooks[arc=270]}] (0,0) -- (1,0);
}
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
@@ -631,47 +622,49 @@ specified. For these arrow tips, you use the following key:
You can ``slant'' arrow tips using the following key:
\begin{key}{/pgf/arrow keys/slant=\meta{factor} (initially 0)}
- Slanting is used to create an ``italics'' effect for arrow tips: All
- arrow tips get ``slanted'' a little bit relative to the axis of the
- arrow:
+ Slanting is used to create an ``italics'' effect for arrow tips: All arrow
+ tips get ``slanted'' a little bit relative to the axis of the arrow:
+ %
\begin{codeexample}[]
\tikz {
\draw [arrows = {->[]}] (0,1) -- (1,1);
\draw [arrows = {->[slant=.5]}] (0,0.5) -- (1,0.5);
\draw [arrows = {->[slant=1]}] (0,0) -- (1,0);
}
-\end{codeexample}
- There is one thing to note about slanting: Slanting is done using a
- so-called ``canvas transformation'' and has no effect on
- positioning of the arrow tip. In particular, if an arrow tip gets
- slanted so strongly that it starts to protrude over the arrow tip
- end, this does not change the positioning of the arrow tip.
+\end{codeexample}
+ %
+ There is one thing to note about slanting: Slanting is done using a
+ so-called ``canvas transformation'' and has no effect on positioning of
+ the arrow tip. In particular, if an arrow tip gets slanted so strongly that
+ it starts to protrude over the arrow tip end, this does not change the
+ positioning of the arrow tip.
- Here is another example where slanting is used to match italic text:
+ Here is another example where slanting is used to match italic text:
+ %
\begin{codeexample}[]
\tikz [>={[slant=.3] To[] To[]}]
- \graph [math nodes] { A -> B <-> C };
+ \graph [math nodes] { A -> B <-> C };
\end{codeexample}
+ %
\end{key}
-
\subsubsection{Reversing, Halving, Swapping}
\label{section-arrow-key-harpoon}
\begin{key}{/pgf/arrow keys/reverse}
- Adding this key to an arrow tip will ``reverse its direction'' so
- that is points in the opposite direction (but is still at that end of the
- line where the non-reversed arrow tip would have been drawn; so only
- the tip is reversed). For most arrow tips, this just results in an
- internal flip of a coordinate system, but some arrow tips actually
- use a slightly different version of the tip for reversed arrow tips
- (namely when the joining of the tip with the line would look
- strange). All of this happens automatically, so you do not need to
- worry about this.
-
- If you apply this key twice, the effect cancels, which is useful for
- the definition of shorthands (which will be discussed later).
+ Adding this key to an arrow tip will ``reverse its direction'' so that is
+ points in the opposite direction (but is still at that end of the line
+ where the non-reversed arrow tip would have been drawn; so only the tip is
+ reversed). For most arrow tips, this just results in an internal flip of a
+ coordinate system, but some arrow tips actually use a slightly different
+ version of the tip for reversed arrow tips (namely when the joining of the
+ tip with the line would look strange). All of this happens automatically,
+ so you do not need to worry about this.
+
+ If you apply this key twice, the effect cancels, which is useful for the
+ definition of shorthands (which will be discussed later).
+ %
\begin{codeexample}[width=3cm]
\tikz [ultra thick] \draw [arrows = {-Stealth[reversed]}] (0,0) -- (1,0);
\end{codeexample}
@@ -681,74 +674,75 @@ You can ``slant'' arrow tips using the following key:
\end{key}
\begin{key}{/pgf/arrow keys/harpoon}
- The key requests that only the ``left half'' of the arrow tip should
- drawn:
+ The key requests that only the ``left half'' of the arrow tip should drawn:
+ %
\begin{codeexample}[width=3cm]
\tikz [ultra thick] \draw [arrows = {-Stealth[harpoon]}] (0,0) -- (1,0);
\end{codeexample}
\begin{codeexample}[width=3cm]
\tikz [ultra thick] \draw [arrows = {->[harpoon]}] (0,0) -- (1,0);
\end{codeexample}
- Unlike the |reverse| key, which all arrows tip kinds support at
- least in a basic way, designers of arrow tips really need to take
- this key into account in their arrow tip code and often a lot of
- special attention needs to do be paid to this key in the
- implementation. For this reason, only some arrow tips will support
- it.
+ %
+ Unlike the |reverse| key, which all arrows tip kinds support at least in a
+ basic way, designers of arrow tips really need to take this key into
+ account in their arrow tip code and often a lot of special attention needs
+ to do be paid to this key in the implementation. For this reason, only some
+ arrow tips will support it.
\end{key}
\begin{key}{/pgf/arrow keys/swap}
- This key flips that arrow tip along the axis of the line. It makes
- sense only for asymmetric arrow tips like the harpoons created using
- the |harpoon| option.
+ This key flips that arrow tip along the axis of the line. It makes sense
+ only for asymmetric arrow tips like the harpoons created using the
+ |harpoon| option.
+ %
\begin{codeexample}[width=3cm]
\tikz [ultra thick] \draw [arrows = {-Stealth[harpoon]}] (0,0) -- (1,0);
\end{codeexample}
\begin{codeexample}[width=3cm]
\tikz [ultra thick] \draw [arrows = {-Stealth[harpoon,swap]}] (0,0) -- (1,0);
\end{codeexample}
- Swapping is always possible, no special code is needed on behalf of
- an arrow tip implementer.
+ %
+ Swapping is always possible, no special code is needed on behalf of an
+ arrow tip implementer.
\end{key}
\begin{key}{/pgf/arrow keys/left}
- A shorthand for |harpoon|.
+ A shorthand for |harpoon|.
\end{key}
\begin{key}{/pgf/arrow keys/right}
- A shorthand for |harpoon, swap|.
+ A shorthand for |harpoon, swap|.
+ %
\begin{codeexample}[width=3cm]
\tikz [ultra thick] \draw [arrows = {-Stealth[left]}] (0,0) -- (1,0);
\end{codeexample}
\begin{codeexample}[width=3cm]
\tikz [ultra thick] \draw [arrows = {-Stealth[right]}] (0,0) -- (1,0);
\end{codeexample}
+ %
\end{key}
\subsubsection{Coloring}
-Arrow tips are drawn using the same basic mechanisms as normal paths,
-so arrow tips can be stroked (drawn) and/or filled. However, we
-usually want the color of arrow tips to be identical to the color used
-to draw the path, even if a different color is used for filling the
-path. On the other hand, we may also sometimes wish to use a special
-color for the arrow tips that is different from both the line and fill
-colors of the main path.
-
-The following options allow you to configure how arrow tips are
-colored:
-
-\begin{key}{/pgf/arrow keys/color=\meta{color or empty} (initially
- \normalfont empty)}
- Normally, an arrow tip gets the same color as the path to which it
- is attached. More precisely, it will get the current ``draw color'',
- also known as ``stroke color,'' which you can set using
- |draw=|\meta{some color}. By adding the option |color=| to an arrow
- tip (note that an ``empty'' color is specified in this way), you ask
- that the arrow tip gets this default draw color of the path. Since
- this is the default behaviour, you usually do not need to specify
- anything:
+Arrow tips are drawn using the same basic mechanisms as normal paths, so arrow
+tips can be stroked (drawn) and/or filled. However, we usually want the color
+of arrow tips to be identical to the color used to draw the path, even if a
+different color is used for filling the path. On the other hand, we may also
+sometimes wish to use a special color for the arrow tips that is different from
+both the line and fill colors of the main path.
+
+The following options allow you to configure how arrow tips are colored:
+
+\begin{key}{/pgf/arrow keys/color=\meta{color or empty} (initially \normalfont empty)}
+ Normally, an arrow tip gets the same color as the path to which it is
+ attached. More precisely, it will get the current ``draw color'', also
+ known as ``stroke color'', which you can set using |draw=|\meta{some
+ color}. By adding the option |color=| to an arrow tip (note that an
+ ``empty'' color is specified in this way), you ask that the arrow tip gets
+ this default draw color of the path. Since this is the default behaviour,
+ you usually do not need to specify anything:
+ %
\begin{codeexample}[width=3cm]
\tikz [ultra thick] \draw [red, arrows = {-Stealth}] (0,0) -- (1,0);
\end{codeexample}
@@ -756,9 +750,10 @@ colored:
\tikz [ultra thick] \draw [blue, arrows = {-Stealth}] (0,0) -- (1,0);
\end{codeexample}
- Now, when you provide a \meta{color} with this option, you request
- that the arrow tip should get this color \emph{instead} of the color
- of the main path:
+ Now, when you provide a \meta{color} with this option, you request that the
+ arrow tip should get this color \emph{instead} of the color of the main
+ path:
+ %
\begin{codeexample}[width=3cm]
\tikz [ultra thick] \draw [red, arrows = {-Stealth[color=blue]}] (0,0) -- (1,0);
\end{codeexample}
@@ -766,118 +761,123 @@ colored:
\tikz [ultra thick] \draw [red, arrows = {-Stealth[color=black]}] (0,0) -- (1,0);
\end{codeexample}
- Similar to the |color| option used in normal \tikzname\ options, you
- may omit the |color=| part of the option. Whenever an \meta{arrow key}
- is encountered that \tikzname\ does not recognize, it will test whether
- the key is the name of a color and, if so, execute
- |color=|\meta{arrow key}. So, the first of the above examples can be
- rewritten as follows:
+ Similar to the |color| option used in normal \tikzname\ options, you may
+ omit the |color=| part of the option. Whenever an \meta{arrow key} is
+ encountered that \tikzname\ does not recognize, it will test whether the
+ key is the name of a color and, if so, execute |color=|\meta{arrow key}.
+ So, the first of the above examples can be rewritten as follows:
+ %
\begin{codeexample}[width=3cm]
\tikz [ultra thick] \draw [red, arrows = {-Stealth[blue]}] (0,0) -- (1,0);
\end{codeexample}
- The \meta{color} will apply both to any drawing and filling
- operations used to construct the path. For instance, even though the
- |Stealth| arrow tips looks like a filled quadrilateral, it is
- actually constructed by drawing a quadrilateral and then filling it
- in the same color as the drawing (see the |fill| option below to
- see the difference).
+ The \meta{color} will apply both to any drawing and filling operations used
+ to construct the path. For instance, even though the |Stealth| arrow tips
+ looks like a filled quadrilateral, it is actually constructed by drawing a
+ quadrilateral and then filling it in the same color as the drawing (see the
+ |fill| option below to see the difference).
- When |color| is set to an empty text, the drawing color is
- always used to fill the arrow tips, even if a different color is
- specified for filling the path:
+ When |color| is set to an empty text, the drawing color is always used to
+ fill the arrow tips, even if a different color is specified for filling the
+ path:
+ %
\begin{codeexample}[width=3cm]
\tikz [ultra thick] \draw [draw=red, fill=red!50, arrows = {-Stealth[length=10pt]}]
(0,0) -- (1,1) -- (2,0);
\end{codeexample}
- As you can see in the above example, the filled area is not quite
- what you might have expected. The reason is that the path was
- actually internally shortened a bit so that the end of the ``fat
- line'' as inside the arrow tip and we get a ``clear'' arrow tip.
+ %
+ As you can see in the above example, the filled area is not quite what you
+ might have expected. The reason is that the path was actually internally
+ shortened a bit so that the end of the ``fat line'' as inside the arrow tip
+ and we get a ``clear'' arrow tip.
- In general, it is a good idea not to add arrow tips to paths that
- are filled.
+ In general, it is a good idea not to add arrow tips to paths that are
+ filled.
\end{key}
\begin{key}{/pgf/arrow keys/fill=\meta{color or |none|}}
- Use this key to explicitly set the color used for filling the arrow
- tips. This color can be different from the color used to draw
- (stroke) the arrow tip:
+ Use this key to explicitly set the color used for filling the arrow tips.
+ This color can be different from the color used to draw (stroke) the arrow
+ tip:
+ %
\begin{codeexample}[width=3cm]
\tikz {
\draw [help lines] (0,-.5) grid [step=1mm] (1,.5);
\draw [thick, red, arrows = {-Stealth[fill=white,length=15pt]}] (0,0) -- (1,0);
}
\end{codeexample}
- You can also specify the special ``color'' |none|. In this case, the
- arrow tip is not filled at all (not even with white):
+ %
+ You can also specify the special ``color'' |none|. In this case, the arrow
+ tip is not filled at all (not even with white):
+ %
\begin{codeexample}[width=3cm]
\tikz {
\draw [help lines] (0,-.5) grid [step=1mm] (1,.5);
\draw [thick, red, arrows = {-Stealth[fill=none,length=15pt]}] (0,0) -- (1,0);
}
\end{codeexample}
- Note that such ``open'' arrow tips are a bit difficult to draw in
- some case: The problem is that the line must be shortened by just
- the right amount so that it ends exactly on the back end of the
- arrow tip. In some cases, especially when double lines are used,
- this will not be possible.
-
- \begin{key}{/pgf/arrow keys/open}
- A shorthand for |fill=none|.
- \end{key}
-
- When you use both the |color| and |fill| option, the |color| option
- must come first since it will reset the filling to the color
- specified for drawing.
+ %
+ Note that such ``open'' arrow tips are a bit difficult to draw in some
+ case: The problem is that the line must be shortened by just the right
+ amount so that it ends exactly on the back end of the arrow tip. In some
+ cases, especially when double lines are used, this will not be possible.
+
+ \begin{key}{/pgf/arrow keys/open}
+ A shorthand for |fill=none|.
+ \end{key}
+
+ When you use both the |color| and |fill| option, the |color| option must
+ come first since it will reset the filling to the color specified for
+ drawing.
+ %
\begin{codeexample}[width=3cm]
\tikz {
\draw [help lines] (0,-.5) grid [step=1mm] (1,.5);
- \draw [thick, red, arrows = {-Stealth[color=blue, fill=white, length=15pt]}]
+ \draw [thick, red, arrows = {-Stealth[color=blue, fill=white, length=15pt]}]
(0,0) -- (1,0);
}
\end{codeexample}
- Note that by setting |fill| to the special color |pgffillcolor|, you
- can cause the arrow tips to be filled using the color used to fill
- the main path. (This special color is always available and always
- set to the current filling color of the graphic state.):
+ Note that by setting |fill| to the special color |pgffillcolor|, you can
+ cause the arrow tips to be filled using the color used to fill the main
+ path. (This special color is always available and always set to the current
+ filling color of the graphic state.):
+ %
\begin{codeexample}[width=3cm]
\tikz [ultra thick] \draw [draw=red, fill=red!50,
arrows = {-Stealth[length=15pt, fill=pgffillcolor]}]
(0,0) -- (1,1) -- (2,0);
\end{codeexample}
+ %
\end{key}
\subsubsection{Line Styling}
\label{section-arrow-key-caps}
-Arrow tips are created by drawing and possibly filling a path that
-makes up the arrow tip. When \tikzname\ draws a path, there are
-different ways in which such a path can be drawn (such as
-dashing). Three particularly important parameters are the line join,
-the line cap, see Section~\ref{section-line-cap} for an introduction,
-and the line width (thickness)
+Arrow tips are created by drawing and possibly filling a path that makes up the
+arrow tip. When \tikzname\ draws a path, there are different ways in which such
+a path can be drawn (such as dashing). Three particularly important parameters
+are the line join, the line cap, see Section~\ref{section-line-cap} for an
+introduction, and the line width (thickness).
-\tikzname\ resets the line cap and line join each time it draws an
-arrow tip since you usually do not want their settings to ``spill
-over'' to the way the arrow tips are drawn. You can, however, change
-there values explicitly for an arrow tip:
+\tikzname\ resets the line cap and line join each time it draws an arrow tip
+since you usually do not want their settings to ``spill over'' to the way the
+arrow tips are drawn. You can, however, change there values explicitly for an
+arrow tip:
\begin{key}{/pgf/arrow keys/line cap=\meta{|round| or |butt|}}
- Sets the line cap of all lines that are drawn in the arrow to a
- round cap or a butt cap. (Unlike for normal lines, the |rect| cap is
- not allowed.) Naturally, this key has no effect for arrows whose
- paths are closed.
-
- Each arrow tip has a default value for the line cap, which can
- be overruled using this option.
-
- Changing the cap should have no effect on the size of the
- arrow. However, it will have an effect on where the exact ``tip'' of
- the arrow is since this will always be exactly at the end of the
- arrow:
+ Sets the line cap of all lines that are drawn in the arrow to a round cap
+ or a butt cap. (Unlike for normal lines, the |rect| cap is not allowed.)
+ Naturally, this key has no effect for arrows whose paths are closed.
+
+ Each arrow tip has a default value for the line cap, which can be overruled
+ using this option.
+
+ Changing the cap should have no effect on the size of the arrow. However,
+ it will have an effect on where the exact ``tip'' of the arrow is since
+ this will always be exactly at the end of the arrow:
+ %
\begin{codeexample}[width=3cm]
\tikz [line width=2mm]
\draw [arrows = {-Computer Modern Rightarrow[line cap=butt]}]
@@ -898,13 +898,14 @@ there values explicitly for an arrow tip:
\draw [arrows = {-Bracket[reversed,line cap=round]}]
(0,0) -- (1,0);
\end{codeexample}
+ %
\end{key}
\begin{key}{/pgf/arrow keys/line join=\meta{|round| or |miter|}}
- Sets the line join to round or miter (|bevel| is not allowed). This
- time, the key only has an effect on paths that have ``corners'' in
- them. The same rules as for |line cap| apply: the size is not
- affects, but the tip end is:
+ Sets the line join to round or miter (|bevel| is not allowed). This time,
+ the key only has an effect on paths that have ``corners'' in them. The same
+ rules as for |line cap| apply: the size is not affects, but the tip end is:
+ %
\begin{codeexample}[width=3cm]
\tikz [line width=2mm]
\draw [arrows = {-Computer Modern Rightarrow[line join=miter]}]
@@ -925,12 +926,15 @@ there values explicitly for an arrow tip:
\draw [arrows = {-Bracket[reversed,line join=round]}]
(0,0) -- (1,0);
\end{codeexample}
-\end{key}
+ %
+\end{key}
The following keys set both of the above:
+
\begin{key}{/pgf/arrow keys/round}
- A shorthand for |line cap=round, line join=round|, resulting in
- ``rounded'' arrow heads.
+ A shorthand for |line cap=round, line join=round|, resulting in ``rounded''
+ arrow heads.
+ %
\begin{codeexample}[width=3cm]
\tikz [line width=2mm]
\draw [arrows = {-Computer Modern Rightarrow[round]}] (0,0) -- (1,0);
@@ -939,11 +943,12 @@ The following keys set both of the above:
\tikz [line width=2mm]
\draw [arrows = {-Bracket[reversed,round]}] (0,0) -- (1,0);
\end{codeexample}
+ %
\end{key}
\begin{key}{/pgf/arrow keys/sharp}
- A shorthand for |line cap=butt, line join=miter|, resulting in
- ``sharp'' or ``pointed'' arrow heads.
+ A shorthand for |line cap=butt, line join=miter|, resulting in ``sharp'' or
+ ``pointed'' arrow heads.
\begin{codeexample}[width=3cm]
\tikz [line width=2mm]
\draw [arrows = {-Computer Modern Rightarrow[sharp]}] (0,0) -- (1,0);
@@ -952,49 +957,47 @@ The following keys set both of the above:
\tikz [line width=2mm]
\draw [arrows = {-Bracket[reversed,sharp]}] (0,0) -- (1,0);
\end{codeexample}
+ %
\end{key}
-
You can also set the width of lines used inside arrow tips:
\begin{key}{/pgf/arrow keys/line width=\meta{dimension}| |\opt{\meta{line width factor}}%
- | |\opt{\meta{outer factor}}}
- This key sets the line width inside an arrow tip for drawing
- (out)lines of the arrow tip. When you set this width to |0pt|, which
- makes sense only for closed tips, the arrow tip is only filled. This
- can result in better rendering of some small arrow tips and in case
- of bend arrow tips (because the line joins will also be bend and not
- ``mitered''.)
-
- The meaning of the factors is as usual the same as for |length| or |width|.
-
+ | |\opt{\meta{outer factor}}}
+ This key sets the line width inside an arrow tip for drawing (out)lines of
+ the arrow tip. When you set this width to |0pt|, which makes sense only for
+ closed tips, the arrow tip is only filled. This can result in better
+ rendering of some small arrow tips and in case of bend arrow tips (because
+ the line joins will also be bend and not ``mitered''.)
+
+ The meaning of the factors is as usual the same as for |length| or |width|.
+ %
\begin{codeexample}[width=2cm]
\tikz \draw [arrows = {-Latex[line width=0.1pt, fill=white, length=10pt]}] (0,0) -- (1,0);
\end{codeexample}
\begin{codeexample}[width=2cm]
\tikz \draw [arrows = {-Latex[line width=1pt, fill=white, length=10pt]}] (0,0) -- (1,0);
\end{codeexample}
+ %
\end{key}
-
\begin{key}{/pgf/arrow keys/line width'=\meta{dimension}| |\opt{\meta{length factor}}}
- Works like |line width| only the factor is with respect to the |length|.
+ Works like |line width| only the factor is with respect to the |length|.
\end{key}
-\subsubsection{Bending and Flexing}
+\subsubsection{Bending and Flexing}
\label{section-arrow-flex}
-Up to now, we have only added arrow tip to the end of straight lines,
-which is in some sense ``easy.'' Things get far more difficult, if the
-line to which we wish to end an arrow tip is curved. In the following,
-we have a look at the different actions that can be taken and how they
-can be configured.
+Up to now, we have only added arrow tip to the end of straight lines, which is
+in some sense ``easy''. Things get far more difficult, if the line to which we
+wish to end an arrow tip is curved. In the following, we have a look at the
+different actions that can be taken and how they can be configured.
To get a feeling for the difficulties involved, consider the following
-situation: We have a ``gray wall'' at the $x$-coordinate of and a
-red line that ends in its middle.
-
+situation: We have a ``gray wall'' at the $x$-coordinate of and a red line that
+ends in its middle.
+%
\begin{codeexample}[]
\def\wall{ \fill [fill=black!50] (1,-.5) rectangle (2,.5);
\pattern [pattern=bricks] (1,-.5) rectangle (2,.5);
@@ -1006,9 +1009,9 @@ red line that ends in its middle.
\end{tikzpicture}
\end{codeexample}
-Now we wish to add a blue open arrow tip the red line like, say,
-|Stealth[length=1cm,open,blue]|:
-
+Now we wish to add a blue open arrow tip the red line like, say,
+|Stealth[length=1cm,open,blue]|:
+%
\def\wall{ \fill [fill=black!50] (1,-.5) rectangle (2,.5);
\pattern [pattern=bricks] (1,-.5) rectangle (2,.5);
\draw [line width=1pt] (1cm+.5pt,-.5) -- ++(0,1); }
@@ -1021,35 +1024,35 @@ Now we wish to add a blue open arrow tip the red line like, say,
\end{codeexample}
There are several noteworthy things about the blue arrow tip:
+%
\begin{enumerate}
-\item Notice that the red line no longer goes all the way to the
- wall. Indeed, the red line ends more or less exactly where it meets
- the blue line, leaving the arrow tip empty. Now, recall that the red
- line was supposed to be the path |(-2,0)--(1,0)|; however, this path
- has obviously become much shorter (by 6.25mm to be precise). This
- effect is called \emph{path shortening} in \tikzname.
-\item The very tip of the arrow just ``touches'' the wall, even we
- zoom out a lot. This point, where the original path ended and where
- the arrow tip should now lie, is called the \emph{tip end} in
- \tikzname.
-\item Finally, the point where the red line touches the blue line is
- the point where the original path ``visually ends.'' Notice that
- this is not the same as the point that lies at a distance of the
- arrow's |length| from the wall -- rather it lies at a distance of
- |length| minus the |inset|. Let us call this point the \emph{visual
+ \item Notice that the red line no longer goes all the way to the wall.
+ Indeed, the red line ends more or less exactly where it meets the
+ blue line, leaving the arrow tip empty. Now, recall that the red line
+ was supposed to be the path |(-2,0)--(1,0)|; however, this path has
+ obviously become much shorter (by 6.25mm to be precise). This effect
+ is called \emph{path shortening} in \tikzname.
+ \item The very tip of the arrow just ``touches'' the wall, even we zoom
+ out a lot. This point, where the original path ended and where the
+ arrow tip should now lie, is called the \emph{tip end} in \tikzname.
+ \item Finally, the point where the red line touches the blue line is the
+ point where the original path ``visually ends''. Notice that this is
+ not the same as the point that lies at a distance of the arrow's
+ |length| from the wall -- rather it lies at a distance of |length|
+ minus the |inset|. Let us call this point the \emph{visual
end} of the arrow.
\end{enumerate}
-As pointed out earlier, for straight lines, shortening the path and
-rotating and shifting the arrow tip so that it ends precisely at the
-tip end and the visual end lies on a line from the tip end to the
-start of the line is relatively easy.
-
-For curved lines, things are much more difficult and \tikzname\ copes
-with the difficulties in different ways, depending on which options
-you add to arrows. Here is now a curved red line to which we wish to
-add our arrow tip (the original straight red line is shown in light red):
+As pointed out earlier, for straight lines, shortening the path and rotating
+and shifting the arrow tip so that it ends precisely at the tip end and the
+visual end lies on a line from the tip end to the start of the line is
+relatively easy.
+For curved lines, things are much more difficult and \tikzname\ copes with the
+difficulties in different ways, depending on which options you add to arrows.
+Here is now a curved red line to which we wish to add our arrow tip (the
+original straight red line is shown in light red):
+%
\begin{codeexample}[]
\begin{tikzpicture}
\wall
@@ -1058,32 +1061,31 @@ add our arrow tip (the original straight red line is shown in light red):
\end{tikzpicture}
\end{codeexample}
-The first way of dealing with curved lines is dubbed the ``quick
-and dirty'' way (although the option for selecting this option is
-politely just called ``|quick|'' \dots):
+The first way of dealing with curved lines is dubbed the ``quick and dirty''
+way (although the option for selecting this option is politely just called
+``|quick|'' \dots):
\begin{key}{/pgf/arrow keys/quick}
- Recall that curves in \tikzname\ are actually B\'ezier curves, which
- means that they start and end at certain points and we specify two
- vectors, one for the start and one for the end, that provide
- tangents to the curve at these points. In particular, for the end of
- the curve, there is a point called the \emph{second support point}
- of the curve such that a tangent to the curve at the end goes
- through this point. In our above example, the second support point
- is at the middle of the light red line and, indeed, a tangent to the
- red line at the point touching the wall is perfectly horizontal.
-
- In order to add our arrow tip to the curved path, our first
- objective is to ``shorten'' the path by 6.25mm. Unfortunately, this
- is now much more difficult than for a straight path. When the
- |quick| option is added to an arrow tip (it is also
- the default if no special libraries are loaded), we cheat somewhat:
- Instead of really moving along 6.25mm along the path, we simply
- shift the end of the curve by 6.25mm \emph{along the tangent} (which
- is easy to compute). We also have to shift the second support point
- by the same amount to ensure that the line still has the same
- tangent at the end. This will result in the following:
-
+ Recall that curves in \tikzname\ are actually Bézier curves, which means
+ that they start and end at certain points and we specify two vectors, one
+ for the start and one for the end, that provide tangents to the curve at
+ these points. In particular, for the end of the curve, there is a point
+ called the \emph{second support point} of the curve such that a tangent to
+ the curve at the end goes through this point. In our above example, the
+ second support point is at the middle of the light red line and, indeed, a
+ tangent to the red line at the point touching the wall is perfectly
+ horizontal.
+
+ In order to add our arrow tip to the curved path, our first objective is to
+ ``shorten'' the path by 6.25mm. Unfortunately, this is now much more
+ difficult than for a straight path. When the |quick| option is added to an
+ arrow tip (it is also the default if no special libraries are loaded), we
+ cheat somewhat: Instead of really moving along 6.25mm along the path, we
+ simply shift the end of the curve by 6.25mm \emph{along the tangent} (which
+ is easy to compute). We also have to shift the second support point by the
+ same amount to ensure that the line still has the same tangent at the end.
+ This will result in the following:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\wall
@@ -1093,19 +1095,19 @@ politely just called ``|quick|'' \dots):
\end{tikzpicture}
\end{codeexample}
- They main problem with the above picture is that the red line is no
- longer equal to the original red line (notice much sharper curvature
- near its end). In our example this is not such a bad thing, but it
- certainly ``not a nice thing'' that adding arrow tips to a curve
- changes the overall shape of the curves. This is especially
- bothersome if there are several similar curves that have different
- arrow heads. In this case, the similar curves now suddenly look
- different.
+ They main problem with the above picture is that the red line is no longer
+ equal to the original red line (notice much sharper curvature near its
+ end). In our example this is not such a bad thing, but it certainly ``not a
+ nice thing'' that adding arrow tips to a curve changes the overall shape of
+ the curves. This is especially bothersome if there are several similar
+ curves that have different arrow heads. In this case, the similar curves
+ now suddenly look different.
- Another big problem with the above approach is that it works only
- well if there is only a single arrow tip. When there are multiple
- ones, simply shifting them along the tangent as the |quick| option
- does produces less-than-satisfactory results:
+ Another big problem with the above approach is that it works only well if
+ there is only a single arrow tip. When there are multiple ones, simply
+ shifting them along the tangent as the |quick| option does produces
+ less-than-satisfactory results:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\wall
@@ -1114,42 +1116,43 @@ politely just called ``|quick|'' \dots):
(-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0);
\end{tikzpicture}
\end{codeexample}
- Note that the third arrow tip does not really lie on the curve any
- more.
+ %
+ Note that the third arrow tip does not really lie on the curve any more.
\end{key}
-Because of the shortcomings of the |quick| key, more powerful
-mechanisms for shortening lines and rotating arrows tips have been
-implemented. To use them, you need to load the following library:
+Because of the shortcomings of the |quick| key, more powerful mechanisms for
+shortening lines and rotating arrows tips have been implemented. To use them,
+you need to load the following library:
\begin{tikzlibrary}{bending}
- Load this library to use the |flex|, |flex'|, or |bending| arrow
- keys. When this library is loaded, |flex| becomes the default mode
- that is used with all paths, unless |quick| is explicitly selected
- for the arrow tip.
+ Load this library to use the |flex|, |flex'|, or |bending| arrow keys. When
+ this library is loaded, |flex| becomes the default mode that is used with
+ all paths, unless |quick| is explicitly selected for the arrow tip.
\end{tikzlibrary}
\begin{key}{/pgf/arrow keys/flex=\opt{\meta{factor}} (default 1)}
- When the |bending| library is loaded, this key is applied
- to all arrow tips by default. It has the following effect:
- \begin{enumerate}
- \item Instead of simply shifting the visual end of the arrow along
- the tangent of the curve's end, we really move it along the curve
- by the necessary distance. This operation is more expensive than
- the |quick| operation -- but not \emph{that} expensive, only
- expensive enough so that it is not selected by default for all
- arrow tips. Indeed, some compromises are made in the
- implementation where accuracy was traded for speed, so the
- distance by which the line end is shifted is not necessarily
- \emph{exactly} 6.25mm; only something reasonably close.
- \item The supports of the line are updated accordingly so that the
- shortened line will still follow \emph{exactly} the original
- line. This means that the curve deformation effect caused by the
- |quick| command does not happen here.
- \item Next, the arrow tip is rotated and shifted as follows: First,
- we shift it so that its tip is exactly at the tip end, where the
- original line ended. Then, the arrow is rotated so the \emph{the
- visual end lies on the line}:
+ When the |bending| library is loaded, this key is applied to all arrow tips
+ by default. It has the following effect:
+ %
+ \begin{enumerate}
+ \item Instead of simply shifting the visual end of the arrow along
+ the tangent of the curve's end, we really move it along the curve
+ by the necessary distance. This operation is more expensive than
+ the |quick| operation -- but not \emph{that} expensive, only
+ expensive enough so that it is not selected by default for all
+ arrow tips. Indeed, some compromises are made in the
+ implementation where accuracy was traded for speed, so the
+ distance by which the line end is shifted is not necessarily
+ \emph{exactly} 6.25mm; only something reasonably close.
+ \item The supports of the line are updated accordingly so that the
+ shortened line will still follow \emph{exactly} the original
+ line. This means that the curve deformation effect caused by the
+ |quick| command does not happen here.
+ \item Next, the arrow tip is rotated and shifted as follows: First,
+ we shift it so that its tip is exactly at the tip end, where the
+ original line ended. Then, the arrow is rotated so the \emph{the
+ visual end lies on the line}:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\wall
@@ -1158,29 +1161,28 @@ implemented. To use them, you need to load the following library:
(-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0);
\end{tikzpicture}
\end{codeexample}
- \end{enumerate}
-
- As can be seen in the example, the |flex| option gives a result that
- is visually pleasing and does not deform the path.
-
- There is, however, one possible problem with the |flex| option: The
- arrow tip no longer points along the tangent of the end of the
- path. This may or may not be a problem, put especially for larger
- arrow tips readers will use the orientation of the arrow head to
- gauge the direction of the tangent of the line. If this tangent is
- important (for example, if it should be horizontal), then it may be
- necessary to enforce that the arrow tip ``really points in the
- direction of the tangent.
-
- To achieve this, the |flex| option takes an optional \meta{factor}
- parameter, which defaults to |1|. This factor specifies how much the
- arrow tip should be rotated: If set to |0|, the arrow points exactly
- along a tangent to curve at its tip. If set to |1|, the arrow point
- exactly along a line from the visual end point on the curve to the
- tip. For values in the middle, we interpolate the rotation between
- these two extremes; so |flex=.5| will rotate the arrow's visual end
- ``halfway away from the tangent towards the actual position on the
- line.''
+ \end{enumerate}
+
+ As can be seen in the example, the |flex| option gives a result that is
+ visually pleasing and does not deform the path.
+
+ There is, however, one possible problem with the |flex| option: The arrow
+ tip no longer points along the tangent of the end of the path. This may or
+ may not be a problem, put especially for larger arrow tips readers will use
+ the orientation of the arrow head to gauge the direction of the tangent of
+ the line. If this tangent is important (for example, if it should be
+ horizontal), then it may be necessary to enforce that the arrow tip
+ ``really points in the direction of the tangent''.
+
+ To achieve this, the |flex| option takes an optional \meta{factor}
+ parameter, which defaults to |1|. This factor specifies how much the arrow
+ tip should be rotated: If set to |0|, the arrow points exactly along a
+ tangent to curve at its tip. If set to |1|, the arrow point exactly along a
+ line from the visual end point on the curve to the tip. For values in the
+ middle, we interpolate the rotation between these two extremes; so
+ |flex=.5| will rotate the arrow's visual end ``halfway away from the
+ tangent towards the actual position on the line''.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\wall
@@ -1197,9 +1199,11 @@ implemented. To use them, you need to load the following library:
(-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0);
\end{tikzpicture}
\end{codeexample}
- Note how in the above examples the red line is visible inside the
- open arrow tip. Open arrow tips do not go well with a flex value
- other than~|1|. Here is a more realistic use of the |flex=0| key:
+ %
+ Note how in the above examples the red line is visible inside the open
+ arrow tip. Open arrow tips do not go well with a flex value other than~|1|.
+ Here is a more realistic use of the |flex=0| key:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\wall
@@ -1208,9 +1212,10 @@ implemented. To use them, you need to load the following library:
(-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0);
\end{tikzpicture}
\end{codeexample}
- If there are several arrow tips on a path, the |flex| option
- positions them independently, so that each of them lies optimally on
- the path:
+ %
+ If there are several arrow tips on a path, the |flex| option positions them
+ independently, so that each of them lies optimally on the path:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\wall
@@ -1219,17 +1224,17 @@ implemented. To use them, you need to load the following library:
(-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\begin{key}{/pgf/arrow keys/flex'=\opt{\meta{factor}} (default 1)}
- The |flex'| key is almost identical to the |flex| key. The only
- difference is that a factor of |1| corresponds to rotating the arrow
- tip so that the instead of the visual end, the ``ultimate back end''
- of the arrow tip lies on the red path. In the example instead of
- having the arrow tip at a distance of |6.25mm| from the tip lie on
- the path, we have the point at a distance of |1cm| from the tip lie
- on the path:
+ The |flex'| key is almost identical to the |flex| key. The only difference
+ is that a factor of |1| corresponds to rotating the arrow tip so that the
+ instead of the visual end, the ``ultimate back end'' of the arrow tip lies
+ on the red path. In the example instead of having the arrow tip at a
+ distance of |6.25mm| from the tip lie on the path, we have the point at a
+ distance of |1cm| from the tip lie on the path:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\wall
@@ -1238,12 +1243,14 @@ implemented. To use them, you need to load the following library:
(-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0);
\end{tikzpicture}
\end{codeexample}
- Otherwise, the factor works as for |flex| and, indeed |flex=0| and
- |flex'=0| have the same effect.
+ %
+ Otherwise, the factor works as for |flex| and, indeed |flex=0| and
+ |flex'=0| have the same effect.
- The main use of this option is not so much with an arrow tip like
- |Stealth| but rather with tips like the standard |>| in the context
- of a strongly curved line:
+ The main use of this option is not so much with an arrow tip like |Stealth|
+ but rather with tips like the standard |>| in the context of a strongly
+ curved line:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\wall
@@ -1252,14 +1259,16 @@ implemented. To use them, you need to load the following library:
(0,-.5) .. controls (1,-.5) and (0.5,0) .. (1,0);
\end{tikzpicture}
\end{codeexample}
- In the example, the |flex| option does not really flex the arrow
- since for a tip like the Computer Modern arrow, the visual end is
- the same as the arrow tip -- after all, the red line does, indeed, end
- almost exactly where it used to end.
+ %
+ In the example, the |flex| option does not really flex the arrow since for
+ a tip like the Computer Modern arrow, the visual end is the same as the
+ arrow tip -- after all, the red line does, indeed, end almost exactly where
+ it used to end.
- Nevertheless, you may feel that the arrow tip looks ``wrong'' in the sense that it
- should be rotated. This is exactly what the |flex'| option does
- since it allows us to align the ``back end'' of the tip with the red line:
+ Nevertheless, you may feel that the arrow tip looks ``wrong'' in the sense
+ that it should be rotated. This is exactly what the |flex'| option does
+ since it allows us to align the ``back end'' of the tip with the red line:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\wall
@@ -1268,25 +1277,23 @@ implemented. To use them, you need to load the following library:
(0,-.5) .. controls (1,-.5) and (0.5,0) .. (1,0);
\end{tikzpicture}
\end{codeexample}
- In the example, I used |flex'=.75| so as not to overpronounce the
- effect. Usually, you will have to fiddle with it sometime to get the
- ``perfectly aligned arrow tip,'' but a value of |.75| is usually a
- good start.
+ %
+ In the example, I used |flex'=.75| so as not to overpronounce the effect.
+ Usually, you will have to fiddle with it sometime to get the ``perfectly
+ aligned arrow tip'', but a value of |.75| is usually a good start.
\end{key}
-
-
\begin{key}{/pgf/arrow keys/bend}
- \emph{Bending} an arrow tip is a radical solution to the problem of
- positioning arrow tips on a curved line: The arrow tip is no longer
- ``rigid'' but the drawing itself will now bend along the curve. This
- has the advantage that all the problems of flexing with wrong
- tangents and overflexing disappear. The downsides are longer
- computation times (bending an arrow is \emph{much} more expensive
- that flexing it, let alone than quick mode) and also the fact that
- excessive bending can lead to ugly arrow tips. On the other hand,
- for most arrow tips their bend version are visually quite pleasing
- and create a sophisticated look:
+ \emph{Bending} an arrow tip is a radical solution to the problem of
+ positioning arrow tips on a curved line: The arrow tip is no longer
+ ``rigid'' but the drawing itself will now bend along the curve. This has
+ the advantage that all the problems of flexing with wrong tangents and
+ overflexing disappear. The downsides are longer computation times (bending
+ an arrow is \emph{much} more expensive that flexing it, let alone than
+ quick mode) and also the fact that excessive bending can lead to ugly arrow
+ tips. On the other hand, for most arrow tips their bend version are
+ visually quite pleasing and create a sophisticated look:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\wall
@@ -1294,7 +1301,7 @@ implemented. To use them, you need to load the following library:
\draw [red,line width=1mm,-{Stealth[length=20pt,bend]}]
(-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\begin{codeexample}[]
\begin{tikzpicture}
\wall
@@ -1302,7 +1309,7 @@ implemented. To use them, you need to load the following library:
\draw [red,line width=1mm,-{[bend,sep]>>>}]
(-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
\begin{codeexample}[]
\begin{tikzpicture}
\wall
@@ -1310,169 +1317,164 @@ implemented. To use them, you need to load the following library:
\draw [red,line width=1mm,-{Stealth[bend,round,length=20pt]}]
(0,-.5) .. controls (1,-.5) and (0.25,0) .. (1,0);
\end{tikzpicture}
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
-
-
-
-
\subsection{Arrow Tip Specifications}
\label{section-arrow-spec}
\subsubsection{Syntax}
-When you select the arrow tips for the start and the end of a path,
-you can specify a whole sequence of arrow tips, each having its own
-local options. At the beginning of this section, it was pointed out
-that the syntax for selecting the start and end arrow tips is the
-following:
-
+When you select the arrow tips for the start and the end of a path, you can
+specify a whole sequence of arrow tips, each having its own local options. At
+the beginning of this section, it was pointed out that the syntax for selecting
+the start and end arrow tips is the following:
+%
\begin{quote}
- \meta{start specification}|-|\meta{end specification}
+ \meta{start specification}|-|\meta{end specification}
\end{quote}
-We now have a closer look at what these specifications may look
-like. The general syntax of the \meta{start specification} is as
-follows:
+We now have a closer look at what these specifications may look like. The
+general syntax of the \meta{start specification} is as follows:
+%
\begin{quote}
- \opt{|[|\meta{options for all tips}|]|} \meta{first arrow tip spec}
- \meta{second arrow tip spec} \meta{third arrow tip spec} \dots
+ \opt{|[|\meta{options for all tips}|]|} \meta{first arrow tip spec}
+ \meta{second arrow tip spec} \meta{third arrow tip spec} \dots
\end{quote}
-As can be seen, an arrow tip specification may start with some options
-in brackets. If this is the case, the \meta{options for all tips}
-will, indeed, be applied to all arrow tips that follow. (We will see,
-in a moment, that there are even more places where options may be
-specified and a list of the ordering in which the options are applied
-will be given later.)
-
-The main part of a specification is taken up by a sequence of
-individual arrow tip specifications. Such a specification can be of
-three kinds:
-
+%
+As can be seen, an arrow tip specification may start with some options in
+brackets. If this is the case, the \meta{options for all tips} will, indeed, be
+applied to all arrow tips that follow. (We will see, in a moment, that there
+are even more places where options may be specified and a list of the ordering
+in which the options are applied will be given later.)
+
+The main part of a specification is taken up by a sequence of individual arrow
+tip specifications. Such a specification can be of three kinds:
+%
\begin{enumerate}
-\item It can be of the form \meta{arrow tip kind name}|[|\meta{options}|]|.
-\item It can be of the form \meta{shorthand}|[|\meta{options}|]|.
-\item It can be of the form \meta{single char shorthand}\opt{|[|\meta{options}|]|}. Note that only for this form the
- brackets are optional.
+ \item It can be of the form \meta{arrow tip kind
+ name}|[|\meta{options}|]|.
+ \item It can be of the form \meta{shorthand}|[|\meta{options}|]|.
+ \item It can be of the form \meta{single char
+ shorthand}\opt{|[|\meta{options}|]|}. Note that only for this form
+ the brackets are optional.
\end{enumerate}
The easiest kind is the first one: This adds an arrow tip of the kind
\meta{arrow tip kind name} to the sequence of arrow tips with the
-\meta{options} applied to it at the start (for the \meta{start
- specification}) or at the end (for the \meta{end
- specification}). Note that for the \meta{start specification} the
-first arrow tip specified in this way will be at the very start of the
-curve, while for the \meta{end specification} the ordering is
-reversed: The last arrow tip specified will be at the very end of the
-curve. This implies that a specification like
+\meta{options} applied to it at the start (for the \meta{start specification})
+or at the end (for the \meta{end specification}). Note that for the \meta{start
+specification} the first arrow tip specified in this way will be at the very
+start of the curve, while for the \meta{end specification} the ordering is
+reversed: The last arrow tip specified will be at the very end of the curve.
+This implies that a specification like
+%
\begin{quote}
-|Stealth[] Latex[] - Latex[] Stealth[]|
+ |Stealth[] Latex[] - Latex[] Stealth[]|
\end{quote}
-will give perfectly symmetric arrow tips on a line (as one would
-expect).
-
-It is important that even if there are no \meta{options} for an arrow
-tip, the square brackets still need to be written to indicate the end
-of the arrow tip's name. Indeed, the opening brackets are used to
-divide the arrow tip specification into names.
-
-Instead of a \meta{arrow tip kind name}, you may also provide the name
-of a so-called \emph{shorthand}. Shorthands look like normal arrow tip
-kind names and, indeed, you will often be using shorthands without
-noticing that you do. The idea is that instead of, say,
-|Computer Modern Rightarrow| you might wish to just write |Rightarrow|
-or perhaps just |To| or even just |>|. For this, you can create a
-shorthand that tells \tikzname\ that whenever this shorthand is used,
-another arrow tip kind is meant. (Actually, shorthands are somewhat
-more powerful, we have a detailed look at them in
-Section~\ref{section-arrow-tip-macro}.) For shorthands, the same rules
-apply as for normal arrow tip kinds: You \emph{need} to provide
-brackets so that \tikzname\ can find the end of the name inside a
-longer specification.
-
-The third kind of arrow tip specifications consist of just a single
-letter like |>| or |)| or |*| or even |o| or |x| (but you may not use
-|[|, |]|, or |-| since they will confuse the parser). These single
-letter arrow specifications will invariably be shorthands that select
-some ``real'' arrow tip instead. An important feature of single letter
-arrow tips is that they do \emph{not} need to be followed by options
-(but they may).
+%
+will give perfectly symmetric arrow tips on a line (as one would expect).
+
+It is important that even if there are no \meta{options} for an arrow tip, the
+square brackets still need to be written to indicate the end of the arrow tip's
+name. Indeed, the opening brackets are used to divide the arrow tip
+specification into names.
+
+Instead of a \meta{arrow tip kind name}, you may also provide the name of a
+so-called \emph{shorthand}. Shorthands look like normal arrow tip kind names
+and, indeed, you will often be using shorthands without noticing that you do.
+The idea is that instead of, say, |Computer Modern Rightarrow| you might wish
+to just write |Rightarrow| or perhaps just |To| or even just |>|. For this, you
+can create a shorthand that tells \tikzname\ that whenever this shorthand is
+used, another arrow tip kind is meant. (Actually, shorthands are somewhat more
+powerful, we have a detailed look at them in
+Section~\ref{section-arrow-tip-macro}.) For shorthands, the same rules apply as
+for normal arrow tip kinds: You \emph{need} to provide brackets so that
+\tikzname\ can find the end of the name inside a longer specification.
+
+The third kind of arrow tip specifications consist of just a single letter like
+|>| or |)| or |*| or even |o| or |x| (but you may not use |[|, |]|, or |-|
+since they will confuse the parser). These single letter arrow specifications
+will invariably be shorthands that select some ``real'' arrow tip instead. An
+important feature of single letter arrow tips is that they do \emph{not} need
+to be followed by options (but they may).
Now, since we can use any letter for single letter shorthands, how can
-\tikzname\ tell whether by |foo[]| we mean an arrow tip kind |foo|
-without any options or whether we mean an arrow tip called |f|,
-followed by two arrow tips called |o|? Or perhaps an arrow tip called
-|f| followed by an arrow tip called |oo|? To solve this problem, the
-following rule is used to determine which of the three possible
-specifications listed above applies: First, we check whether
-everything from the current position up to the next opening bracket
-(or up to the end) is the name of an arrow tip or of a shorthand. In
-our case, |foo| would first be tested under this rule. Only if |foo|
-is neither the name of an arrow tip kind nor of a shorthand does
-\tikzname\ consider the first letter of the specification, |f| in our
-case. If this is not the name of a shorthand, an error is
-raised. Otherwise the arrow tip corresponding to |f| is added to the
-list of arrow tips and the process restarts with the rest. Thus, we
-would next text whether |oo| is the name of an arrow tip or shorthand
-and, if not, whether |o| is such a name.
-
-All of the above rules mean that you can rather easily specify arrow
-tip sequences if they either mostly consist of single letter names or
-of longer names. Here are some examples:
-
+\tikzname\ tell whether by |foo[]| we mean an arrow tip kind |foo| without any
+options or whether we mean an arrow tip called |f|, followed by two arrow tips
+called |o|? Or perhaps an arrow tip called |f| followed by an arrow tip called
+|oo|? To solve this problem, the following rule is used to determine which of
+the three possible specifications listed above applies: First, we check whether
+everything from the current position up to the next opening bracket (or up to
+the end) is the name of an arrow tip or of a shorthand. In our case, |foo|
+would first be tested under this rule. Only if |foo| is neither the name of an
+arrow tip kind nor of a shorthand does \tikzname\ consider the first letter of
+the specification, |f| in our case. If this is not the name of a shorthand, an
+error is raised. Otherwise the arrow tip corresponding to |f| is added to the
+list of arrow tips and the process restarts with the rest. Thus, we would next
+text whether |oo| is the name of an arrow tip or shorthand and, if not, whether
+|o| is such a name.
+
+All of the above rules mean that you can rather easily specify arrow tip
+sequences if they either mostly consist of single letter names or of longer
+names. Here are some examples:
+%
\begin{itemize}
-\item |->>>| is interpreted as three times the |>| shorthand since
- |>>>| is not the name of any arrow tip kind (and neither is |>>|).
-\item |->[]>>| has the same effect as the above.
-\item |-[]>>>| also has the same effect.%>>
-\item |->[]>[]>[]| so does this.
-\item |->Stealth| yields an arrow tip |>| followed by a |Stealth|
- arrow at the end.
-\item |-Stealth>| is illegal since there is no arrow tip |Stealth>|
- and since |S| is also not the name of any arrow tip.
-\item |-Stealth[] >| is legal and does what was presumably meant in the previous item.
-\item |< Stealth-| is legal and is the counterpart to |-Stealth[] >|.
-\item |-Stealth[length=5pt] Stealth[length=6pt]| selects two stealth
- arrow tips, but at slightly different sizes for the end of lines.
+ \item |->>>| is interpreted as three times the |>| shorthand since |>>>| is
+ not the name of any arrow tip kind (and neither is |>>|).
+ \item |->[]>>| has the same effect as the above.
+ \item |-[]>>>| also has the same effect.
+ \item |->[]>[]>[]| so does this.
+ \item |->Stealth| yields an arrow tip |>| followed by a |Stealth| arrow
+ at the end.
+ \item |-Stealth>| is illegal since there is no arrow tip |Stealth>| and
+ since |S| is also not the name of any arrow tip.
+ \item |-Stealth[] >| is legal and does what was presumably meant in the
+ previous item.
+ \item |< Stealth-| is legal and is the counterpart to |-Stealth[] >|.
+ \item |-Stealth[length=5pt] Stealth[length=6pt]| selects two stealth
+ arrow tips, but at slightly different sizes for the end of lines.
\end{itemize}
-
-An interesting question concerns how flexing and bending interact with
-multiple arrow tips: After all, flexing and quick mode use different
-ways of shortening the path so we cannot really mix them. The
-following rule is used: We check, independently for the start and the
-end specifications, whether at least one arrow tip in them uses one of
-the options |flex|, |flex'|, or |bend|. If so, all |quick| settings in
-the other arrow tips are ignored and treated as if |flex| had been
-selected for them, too.
+An interesting question concerns how flexing and bending interact with multiple
+arrow tips: After all, flexing and quick mode use different ways of shortening
+the path so we cannot really mix them. The following rule is used: We check,
+independently for the start and the end specifications, whether at least one
+arrow tip in them uses one of the options |flex|, |flex'|, or |bend|. If so,
+all |quick| settings in the other arrow tips are ignored and treated as if
+|flex| had been selected for them, too.
\subsubsection{Specifying Paddings}
-When you provide several arrow tips in a row, all of them are added to
-the start or end of the line:
+When you provide several arrow tips in a row, all of them are added to the
+start or end of the line:
+%
\begin{codeexample}[]
\tikz \draw [<<<->>>>] (0,0) -- (2,0);
\end{codeexample}
-The question is now what will be distance between them? For this, the
+%
+The question now is what will be the distance between them? For this, the
following arrow key is important:
+
\begin{key}{/pgf/arrow keys/sep=\meta{dimension}| |\opt{\meta{line
- width factor}}| |\opt{\meta{outer factor}} (default 0.88pt .3 1)}
- When a sequence of arrow tips is specified in an arrow tip
- specification for the end of the line, the arrow tips are normally
- arranged in such a way that the tip of each arrow ends exactly at
- the ``back end'' of the next arrow tip (for start specifications,
- the ordering is inverted, of course). Now, when the |sep| option is
- set, instead of exactly touching the back end of the next arrow, the
- specified \meta{dimension} is added as additional space (the
- distance may also be negative, resulting in an overlap of the arrow
- tips). The optional factors have the same meaning as for the
- |length| key, see that key for details.
-
- Let us now have a look at some examples. First, we use two arrow
- tips with different separations between them:
+ width factor}}| |\opt{\meta{outer factor}} (default 0.88pt .3 1)%
+}
+ When a sequence of arrow tips is specified in an arrow tip specification
+ for the end of the line, the arrow tips are normally arranged in such a way
+ that the tip of each arrow ends exactly at the ``back end'' of the next
+ arrow tip (for start specifications, the ordering is inverted, of course).
+ Now, when the |sep| option is set, instead of exactly touching the back end
+ of the next arrow, the specified \meta{dimension} is added as additional
+ space (the distance may also be negative, resulting in an overlap of the
+ arrow tips). The optional factors have the same meaning as for the |length|
+ key, see that key for details.
+
+ Let us now have a look at some examples. First, we use two arrow tips with
+ different separations between them:
+ %
\begin{codeexample}[]
\tikz {
\draw [-{>[sep=1pt]>[sep= 2pt]>}] (0,1.0) -- (1,1.0);
@@ -1481,54 +1483,54 @@ following arrow key is important:
}
\end{codeexample}
- You can also specify a |sep| for the last arrow tip in the sequence
- (for end specifications, otherwise for the first arrow tip). In this
- case, this first arrow tip will not exactly ``touch'' the point
- where the path ends, but will rather leave the specified amount of
- space. This is usually quite desirable.
+ You can also specify a |sep| for the last arrow tip in the sequence (for
+ end specifications, otherwise for the first arrow tip). In this case, this
+ first arrow tip will not exactly ``touch'' the point where the path ends,
+ but will rather leave the specified amount of space. This is usually quite
+ desirable.
+ %
\begin{codeexample}[]
\tikz {
\node [draw] (A) {A};
\node [draw] (B) [right=of A] {B};
-
+
\draw [-{>>[sep=2pt]}] (A) to [bend left=45] (B);
\draw [- >> ] (A) to [bend right=45] (B);
}
\end{codeexample}
- Indeed, adding a |sep| to an arrow tip is \emph{very} desirable, so
- you will usually write something like |>={To[sep]}| somewhere near
- the start of your files.
+ %
+ Indeed, adding a |sep| to an arrow tip is \emph{very} desirable, so you
+ will usually write something like |>={To[sep]}| somewhere near the start of
+ your files.
- One arrow tip kind can be quite useful in this context: The arrow
- tip kind |_|. It draws nothing and has zero length, \emph{but}
- it has |sep| set as a default option. Since it is a single letter
- shorthand, you can write short and clean ``code'' in this way:
-\begin{codeexample}[]
+ One arrow tip kind can be quite useful in this context: The arrow tip kind
+ |_|. It draws nothing and has zero length, \emph{but} it has |sep| set as a
+ default option. Since it is a single letter shorthand, you can write short
+ and clean ``code'' in this way:
+ %
+\begin{codeexample}[]
\tikz \draw [->_>] (0,0) -- (1,0);
\end{codeexample}
-\begin{codeexample}[]
+\begin{codeexample}[]
\tikz \draw [->__>] (0,0) -- (1,0);
\end{codeexample}
- However, using the |sep| option will be faster than using the |_|
- arrow tip and it also allows you to specify the desired length
- directly.
+ %
+ However, using the |sep| option will be faster than using the |_| arrow tip
+ and it also allows you to specify the desired length directly.
\end{key}
-
\subsubsection{Specifying the Line End}
-In the previous examples of sequences of arrow tips, the line of the
-path always ended at the last of the arrow tips (for end
-specifications) or at the first of the arrow tips (for start
-specifications). Often, this is what you may want, but not
-always. Fortunately, it is quite easy to specify the desired end of
-the line: The special single char shorthand |.| is reserved to
-indicate that last arrow that is still part of the line; in other
-words, the line will stop at the last arrow before |.| is encountered
-(for end specifications) are at the first arrow following |.| (for
-start specifications).
-%>>
+In the previous examples of sequences of arrow tips, the line of the path
+always ended at the last of the arrow tips (for end specifications) or at the
+first of the arrow tips (for start specifications). Often, this is what you may
+want, but not always. Fortunately, it is quite easy to specify the desired end
+of the line: The special single char shorthand |.| is reserved to indicate that
+last arrow that is still part of the line; in other words, the line will stop
+at the last arrow before |.| is encountered (for end specifications) are at the
+first arrow following |.| (for start specifications).
+%
\begin{codeexample}[]
\tikz [very thick] \draw [<<<->>>] (0,0) -- (2,0);
\end{codeexample}
@@ -1542,137 +1544,142 @@ start specifications).
\tikz [very thick] \draw [<<.<->.>>] (0,0) to [bend left] (2,0);
\end{codeexample}
-It is permissible that there are several dots in a specification, in
-this case the first one ``wins'' (for end specifications, otherwise
-the last one).
+It is permissible that there are several dots in a specification, in this case
+the first one ``wins'' (for end specifications, otherwise the last one).
-Note that |.| is parsed as any other shorthand. In particular, if you
-wish to add a dot after a normal arrow tip kind name, you need to add
-brackets:
+Note that |.| is parsed as any other shorthand. In particular, if you wish to
+add a dot after a normal arrow tip kind name, you need to add brackets:
+%
\begin{codeexample}[]
\tikz [very thick] \draw [-{Stealth[] . Stealth[] Stealth[]}] (0,0) -- (2,0);
\end{codeexample}
-Adding options to |.| is permissible, but they have no effect. In
-particular, |sep| has no effect since a dot is not an arrow.
-
-
+%
+Adding options to |.| is permissible, but they have no effect. In particular,
+|sep| has no effect since a dot is not an arrow.
\subsubsection{Defining Shorthands}
\label{section-arrow-tip-macro}
-It is often desirable to create ``shorthands'' for the names of arrow
-tips that you are going to use very often. Indeed, in most documents
-you will only need a single arrow tip kind and it would be useful that
-you could refer to it just as |>| in your arrow tip specifications. As
-another example, you might constantly wish to switch between a filled
-and a non-filled circle as arrow tips and would like to use |*| and
-|o| are shorthands for these case. Finally, you might just like to
-shorten a long name like |Computer Modern Rightarrow| down to just,
-say |To| or something similar.
+It is often desirable to create ``shorthands'' for the names of arrow tips that
+you are going to use very often. Indeed, in most documents you will only need a
+single arrow tip kind and it would be useful that you could refer to it just as
+|>| in your arrow tip specifications. As another example, you might constantly
+wish to switch between a filled and a non-filled circle as arrow tips and would
+like to use |*| and |o| are shorthands for these case. Finally, you might just
+like to shorten a long name like |Computer Modern Rightarrow| down to just, say
+|To| or something similar.
-All of these case can be addressed by defining appropriate
-shorthands. This is done using the following handler:
+All of these case can be addressed by defining appropriate shorthands. This is
+done using the following handler:
\begin{handler}{{.tip}{=\meta{end specification}}}
- Defined the \meta{key} as a name that can be used inside arrow tip
- specifications. If the \meta{key} has a path before it, this path is
- ignored (so there is only one ``namespace'' for arrow
- tips). Whenever it is used, it will be replaced by the \meta{end
- specification}. Note that you must \emph{always} provide
- (only) an end specification; when the \meta{key} is used inside a
- start specification, the ordering and the meaning of the keys inside
- the \meta{end specification} are translated automatically.
-
+ Defined the \meta{key} as a name that can be used inside arrow tip
+ specifications. If the \meta{key} has a path before it, this path is
+ ignored (so there is only one ``namespace'' for arrow tips). Whenever it is
+ used, it will be replaced by the \meta{end specification}. Note that you
+ must \emph{always} provide (only) an end specification; when the \meta{key}
+ is used inside a start specification, the ordering and the meaning of the
+ keys inside the \meta{end specification} are translated automatically.
+ \todosp{remaining instance of bug \#473}
+ %
\begin{codeexample}[]
\tikz [foo /.tip = {Stealth[sep]. >>}]
- \draw [-foo] (0,0) -- (2,0);
+ \draw [-foo] (0,0) -- (2,0);
\end{codeexample}
\begin{codeexample}[]
\tikz [foo /.tip = {Stealth[sep] Latex[sep]},
bar /.tip = {Stealth[length=10pt,open]}]
- \draw [-{foo[red] . bar}] (0,0) -- (2,0);
-\end{codeexample}
-
- In the last of the examples, we used |foo[red]| to make the arrows
- red. Any options given to a shorthand upon use will be passed on to
- the actual arrows tip for which the shorthand stands. Thus, we could
- also have written |Stealth[sep,red]| |Latex[sep,red]| instead of
- |foo[red]|. In other words, the ``replacement'' of a shorthand by
- its ``meaning'' is a semantic replacement rather than a syntactic
- replacement. In particular, the \meta{end specification} will be
- parsed immediately when the shorthand is being defined. However,
- this applies only to the options inside the specification, whose
- values are evaluated immediately. In contrast, which actual arrow
- tip kind is meant by a given shorthand used inside the \meta{end
- specification} is resolved only up each use of the shorthand. This
- means that when you write
- \begin{quote}
- |dup /.tip = >>|
- \end{quote}
- and then later write
- \begin{quote}
- |> /.tip = whatever|
- \end{quote}
- then |dup| will have the effect as if you had written
- |whatever[]whatever[]|. You will find that this behaviour is
- what one would expect.
-
- There is one problem we have not yet addressed: The asymmetry of
- single letter arrow tips like |>| or |)|. When someone writes
-\begin{codeexample}[]
-\tikz \draw [<->] (0,0) -- (1,0);
-\end{codeexample}
- we rightfully expect one arrow tip pointing left at the left end and
- an arrow tip pointing right at the right end. However, compare
-\begin{codeexample}[]
-\tikz \draw [>->] (0,0) -- (1,0);
-\end{codeexample}
-\begin{codeexample}[]
-\tikz \draw [Stealth-Stealth] (0,0) -- (1,0);
-\end{codeexample}
- In both cases, we have \emph{identical} text in the start and end
- specifications, but in the first case we rightfully expect the left
- arrow to be flipped.
-
- The solution to this problem is that it is possible to define
- two names for the same arrow tip, namely one that is used inside
- start specifications and one for end specifications. Now, we can
- decree that the ``name of |>|'' inside start specifications is
- simply |<| and the above problems disappear.
-
- To specify different names for a shorthand in start and end
- specifications, use the following syntax: Instead of \meta{key}, you
- use \meta{name in start specifications}|-|\meta{name in end
- specifications}. Thus, to set the |>| key correctly, you actually
- need to write
-\begin{codeexample}[]
-\tikz [<-> /.tip = Stealth] \draw [<->>] (0,0) -- (1,0);
-\end{codeexample}
-\begin{codeexample}[]
-\tikz [<-> /.tip = Latex] \draw [>-<] (0,0) -- (1,0);
-\end{codeexample}
-
- Note that the above also works even though we have not set |<| as an
- arrow tip name for end specifications! The reason this works is that
- the \tikzname\ (more precisely, \pgfname) actually uses the
- following definition internally:
- \begin{quote}
- |>-< /.tip = >[reversed]|
- \end{quote}
- Translation: ``When |<| is used in an end specification, please
- replace it by |>|, but reversed. Also, when |>| is used in a start
- specification, we also mean this inverted |>|.''
-
- By default, |>| is a shorthand for |To| and |To| is a shorthand for
- |to| (an arrow from the old libraries) when |arrows.meta| is not
- loaded library. When |arrow.meta| is loaded, |To| is redefined to
- mean the same as
- |Computer Modern Rightarrow|.
+ \draw [-{foo[red] . bar}] (0,0) -- (2,0);
+\end{codeexample}
+
+ In the last of the examples, we used |foo[red]| to make the arrows red. Any
+ options given to a shorthand upon use will be passed on to the actual
+ arrows tip for which the shorthand stands. Thus, we could also have written
+ |Stealth[sep,red]| |Latex[sep,red]| instead of |foo[red]|. In other words,
+ the ``replacement'' of a shorthand by its ``meaning'' is a semantic
+ replacement rather than a syntactic replacement. In particular, the
+ \meta{end specification} will be parsed immediately when the shorthand is
+ being defined. However, this applies only to the options inside the
+ specification, whose values are evaluated immediately. In contrast, which
+ actual arrow tip kind is meant by a given shorthand used inside the
+ \meta{end specification} is resolved only up each use of the shorthand.
+ This means that when you write
+ %
+ \begin{quote}
+ |dup /.tip = >>|
+ \end{quote}
+ %
+ and then later write
+ %
+ \begin{quote}
+ |> /.tip = whatever|
+ \end{quote}
+ %
+ then |dup| will have the effect as if you had written
+ |whatever[]whatever[]|. You will find that this behaviour is what one would
+ expect.
+
+ There is one problem we have not yet addressed: The asymmetry of single
+ letter arrow tips like |>| or |)|. When someone writes
+ %
+\begin{codeexample}[]
+\tikz \draw [<->] (0,0) -- (1,0);
+\end{codeexample}
+ %
+ we rightfully expect one arrow tip pointing left at the left end and an
+ arrow tip pointing right at the right end. However, compare
+ %
+\begin{codeexample}[]
+\tikz \draw [>->] (0,0) -- (1,0);
+\end{codeexample}
+\begin{codeexample}[]
+\tikz \draw [Stealth-Stealth] (0,0) -- (1,0);
+\end{codeexample}
+ %
+ In both cases, we have \emph{identical} text in the start and end
+ specifications, but in the first case we rightfully expect the left arrow
+ to be flipped.
+
+ The solution to this problem is that it is possible to define two names for
+ the same arrow tip, namely one that is used inside start specifications and
+ one for end specifications. Now, we can decree that the ``name of |>|''
+ inside start specifications is simply |<| and the above problems disappear.
+
+ To specify different names for a shorthand in start and end specifications,
+ use the following syntax: Instead of \meta{key}, you use \meta{name in
+ start specifications}|-|\meta{name in end specifications}. Thus, to set the
+ |>| key correctly, you actually need to write
+ %
+\begin{codeexample}[]
+\tikz [<-> /.tip = Stealth] \draw [<->>] (0,0) -- (1,0);
+\end{codeexample}
+\begin{codeexample}[]
+\tikz [<-> /.tip = Latex] \draw [>-<] (0,0) -- (1,0);
+\end{codeexample}
+
+ Note that the above also works even though we have not set |<| as an arrow
+ tip name for end specifications! The reason this works is that the
+ \tikzname\ (more precisely, \pgfname) actually uses the following
+ definition internally:
+ %
+ \begin{quote}
+ |>-< /.tip = >[reversed]|
+ \end{quote}
+ %
+ Translation: ``When |<| is used in an end specification, please replace it
+ by |>|, but reversed. Also, when |>| is used in a start specification, we
+ also mean this inverted |>|.''
+
+ By default, |>| is a shorthand for |To| and |To| is a shorthand for |to|
+ (an arrow from the old libraries) when |arrows.meta| is not loaded library.
+ When |arrow.meta| is loaded, |To| is redefined to mean the same as
+ |Computer Modern Rightarrow|.
\end{handler}
\begin{key}{/tikz/>=\meta{end arrow specification}}
- This is a short way of saying |<->/.tip=|\meta{end arrow specification}.
+ This is a short way of saying |<->/.tip=|\meta{end arrow specification}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[scale=2,ultra thick]
\begin{scope}[>=Latex]
@@ -1685,150 +1692,149 @@ shorthands. This is done using the following handler:
\end{scope}
\end{tikzpicture}
\end{codeexample}
-
+ %
\end{key}
-
\subsubsection{Scoping of Arrow Keys}
\label{section-arrow-scopes}
-There are numerous places where you can specify keys for an arrow
-tip. There is, however, one final place that we have not yet
-mentioned:
+There are numerous places where you can specify keys for an arrow tip. There
+is, however, one final place that we have not yet mentioned:
\begin{key}{/tikz/arrows=|[|\meta{arrow keys}|]|}
- The |arrows| key, which is normally used to set the arrow tips for
- the current scope, can also be used to set some arrow keys for the
- current scope. When the argument to |arrows| starts with an opening
- bracket and only otherwise contains one further closing bracket at
- the very end, this semantic of the |arrow| key is assumed.
-
- The \meta{arrow keys} will be set for the rest of current
- scope. This is useful for generally setting some design parameters
- or for generally switching on, say, bending as in:
+ The |arrows| key, which is normally used to set the arrow tips for the
+ current scope, can also be used to set some arrow keys for the current
+ scope. When the argument to |arrows| starts with an opening bracket and
+ only otherwise contains one further closing bracket at the very end, this
+ semantic of the |arrow| key is assumed.
+
+ The \meta{arrow keys} will be set for the rest of current scope. This is
+ useful for generally setting some design parameters or for generally
+ switching on, say, bending as in:
+ %
\begin{codeexample}[code only]
-\tikz [arrows={[bend]}] ... % Bend all arrows
+\tikz [arrows={[bend]}] ... % Bend all arrows
\end{codeexample}
+ %
\end{key}
-We can now summarize which arrow keys are applied in what order when
-an arrow tip is used:
+We can now summarize which arrow keys are applied in what order when an arrow
+tip is used:
+%
\begin{enumerate}
-\item First, the so-called \emph{defaults} are applied, which are
- values for the different parameters of a key. They are fixed in the
- definition of the key and cannot be changed. Since they are executed
- first, they are only the ultimate fallback.
-\item The \meta{keys} from the use of |arrows=[|\meta{keys}|]| in all
- enclosing scopes.
-\item Recursively, the \meta{keys} provided with the arrow
- tip inside shorthands.
-\item The keys provided at the beginning of an arrow tip specification
- in brackets.
-\item The keys provided directly next to the arrow tip inside the
- specification.
+ \item First, the so-called \emph{defaults} are applied, which are values
+ for the different parameters of a key. They are fixed in the
+ definition of the key and cannot be changed. Since they are executed
+ first, they are only the ultimate fallback.
+ \item The \meta{keys} from the use of |arrows=[|\meta{keys}|]| in all
+ enclosing scopes.
+ \item Recursively, the \meta{keys} provided with the arrow tip inside
+ shorthands.
+ \item The keys provided at the beginning of an arrow tip specification in
+ brackets.
+ \item The keys provided directly next to the arrow tip inside the
+ specification.
\end{enumerate}
-
-
\subsection{Reference: Arrow Tips}
\label{section-arrows-meta}
\begin{pgflibrary}{arrows.meta}
- This library defines a large number of standard ``meta'' arrow
- tips. ``Meta'' means that you can configure these arrow tips in many
- different ways like changing their size or their line caps and joins
- and many other details.
-
- The only reason this library is not loaded by default is for
- compatibility with older versions of \tikzname. You can, however,
- safely load and use this library alongside the older libraries
- |arrows| and |arrows.spaced|.
+ This library defines a large number of standard ``meta'' arrow tips.
+ ``Meta'' means that you can configure these arrow tips in many different
+ ways like changing their size or their line caps and joins and many other
+ details.
+
+ The only reason this library is not loaded by default is for compatibility
+ with older versions of \tikzname. You can, however, safely load and use
+ this library alongside the older libraries |arrows| and |arrows.spaced|.
\end{pgflibrary}
-
-The different arrow tip kinds defined in the |arrows.meta| library can
-be classified in different groups:
+The different arrow tip kinds defined in the |arrows.meta| library can be
+classified in different groups:
+%
\begin{itemize}
-\item \emph{Barbed} arrow tips consist mainly of lines that ``point
- backward'' from the tip of the arrow and which are not filled. For
- them, filling has no effect. A typical example is \tikz [baseline]
- \draw (0,.5ex) -- (1.5em,.5ex) [-Straight Barb];. Here is the list
- of defined arrow tips:
-
- \begin{arrowexamples}
- \arrowexample Arc Barb[]
- \arrowexample Bar[]
- \arrowexample Bracket[]
- \arrowexample Hooks[]
- \arrowexample Parenthesis[]
- \arrowexample Straight Barb[]
- \arrowexample Tee Barb[]
- \end{arrowexamples}
-
- All of these arrow tips can be configured and resized in many
- different ways as described in the following. Above, they are shown at
- their ``natural'' sizes, which are chosen in such a way that for a
- line width of 0.4pt their width matches the height
- of a letter ``x'' in Computer Modern at 11pt (with some
- ``overshooting'' to create visual consistency).
-\item \emph{Mathematical} arrow tips are actually a subclass of the
- barbed arrow tips, but we list them separately. They contain arrow
- tips that look exactly like the tips of arrows used in mathematical
- fonts such as the |\to|-symbol $\to$ from standard \TeX.
- \begin{arrowexamples}
- \arrowexample Classical TikZ Rightarrow[]
- \arrowexample Computer Modern Rightarrow[]
- \arrowexampledouble Implies[]
- \arrowexample To[]
- \end{arrowexamples}
- The |To| arrow tip is a shorthand for |Computer Modern Rightarrow|
- when |arrows.meta| is loaded.
-\item \emph{Geometric} arrow tips consist of a filled shape like a
- kite or a circle or a ``stealth-fighter-like'' shape. A typical
- example is \tikz [baseline] \draw (0,.5ex) -- (1.5em,.5ex)
- [-Stealth];. These arrow tips can also be used in an ``open''
- variant as in \tikz [baseline] \draw (0,.5ex) -- (1.5em,.5ex)
- [-{Stealth[open]}];.
-
- \begin{arrowexamples}
- \arrowexample Circle[]
- \arrowexample Diamond[]
- \arrowexample Ellipse[]
- \arrowexample Kite[]
- \arrowexample Latex[]
- \arrowexample Latex[round]
- \arrowexample Rectangle[]
- \arrowexample Square[]
- \arrowexample Stealth[]
- \arrowexample Stealth[round]
- \arrowexample Triangle[]
- \arrowexample Turned Square[]
- \end{arrowexamples}
-
- Here are the ``open'' variants:
-
- \begin{arrowexamples}
- \arrowexample Circle[open]
- \arrowexample Diamond[open]
- \arrowexample Ellipse[open]
- \arrowexample Kite[open]
- \arrowexample Latex[open]
- \arrowexample Latex[round,open]
- \arrowexample Rectangle[open]
- \arrowexample Square[open]
- \arrowexample Stealth[open]
- \arrowexample Stealth[round,open]
- \arrowexample Triangle[open]
- \arrowexample Turned Square[open]
- \end{arrowexamples}
-
- Note that ``open'' arrow tips are not the same as ``filled with
- white,'' which is also available (just say |fill=white|). The
- difference is that the background will ``shine through'' an open
- arrow, while a filled arrow always obscures the background:
-
+ \item \emph{Barbed} arrow tips consist mainly of lines that ``point
+ backward'' from the tip of the arrow and which are not filled. For
+ them, filling has no effect. A typical example is \tikz [baseline]
+ \draw (0,.5ex) -- (1.5em,.5ex) [-Straight Barb];. Here is the list of
+ defined arrow tips:
+ %
+ \begin{arrowexamples}
+ \arrowexample Arc Barb[]
+ \arrowexample Bar[]
+ \arrowexample Bracket[]
+ \arrowexample Hooks[]
+ \arrowexample Parenthesis[]
+ \arrowexample Straight Barb[]
+ \arrowexample Tee Barb[]
+ \end{arrowexamples}
+
+ All of these arrow tips can be configured and resized in many different
+ ways as described in the following. Above, they are shown at their
+ ``natural'' sizes, which are chosen in such a way that for a line width
+ of 0.4pt their width matches the height of a letter ``x'' in Computer
+ Modern at 11pt (with some ``overshooting'' to create visual
+ consistency).
+ \item \emph{Mathematical} arrow tips are actually a subclass of the
+ barbed arrow tips, but we list them separately. They contain arrow
+ tips that look exactly like the tips of arrows used in mathematical
+ fonts such as the |\to|-symbol $\to$ from standard \TeX.
+ %
+ \begin{arrowexamples}
+ \arrowexample Classical TikZ Rightarrow[]
+ \arrowexample Computer Modern Rightarrow[]
+ \arrowexampledouble Implies[]
+ \arrowexample To[]
+ \end{arrowexamples}
+ %
+ The |To| arrow tip is a shorthand for |Computer Modern Rightarrow| when
+ |arrows.meta| is loaded.
+ \item \emph{Geometric} arrow tips consist of a filled shape like a kite
+ or a circle or a ``stealth-fighter-like'' shape. A typical example is
+ \tikz [baseline] \draw (0,.5ex) -- (1.5em,.5ex) [-Stealth];. These
+ arrow tips can also be used in an ``open'' variant as in \tikz
+ [baseline] \draw (0,.5ex) -- (1.5em,.5ex) [-{Stealth[open]}];.
+ %
+ \begin{arrowexamples}
+ \arrowexample Circle[]
+ \arrowexample Diamond[]
+ \arrowexample Ellipse[]
+ \arrowexample Kite[]
+ \arrowexample Latex[]
+ \arrowexample Latex[round]
+ \arrowexample Rectangle[]
+ \arrowexample Square[]
+ \arrowexample Stealth[]
+ \arrowexample Stealth[round]
+ \arrowexample Triangle[]
+ \arrowexample Turned Square[]
+ \end{arrowexamples}
+
+ Here are the ``open'' variants:
+ %
+ \begin{arrowexamples}
+ \arrowexample Circle[open]
+ \arrowexample Diamond[open]
+ \arrowexample Ellipse[open]
+ \arrowexample Kite[open]
+ \arrowexample Latex[open]
+ \arrowexample Latex[round,open]
+ \arrowexample Rectangle[open]
+ \arrowexample Square[open]
+ \arrowexample Stealth[open]
+ \arrowexample Stealth[round,open]
+ \arrowexample Triangle[open]
+ \arrowexample Turned Square[open]
+ \end{arrowexamples}
+
+ Note that ``open'' arrow tips are not the same as ``filled with
+ white'', which is also available (just say |fill=white|). The
+ difference is that the background will ``shine through'' an open
+ arrow, while a filled arrow always obscures the background:
+ %
\begin{codeexample}[]
\tikz {
\shade [left color=white, right color=red!50] (0,0) rectangle (4,1);
@@ -1838,314 +1844,300 @@ be classified in different groups:
}
\end{codeexample}
-\item \emph{Cap} arrow tips are used to add a ``cap'' to the end of a
- line. The graphic languages underlying \tikzname\ (\textsc{pdf},
- \textsc{postscript} or \textsc{svg}) all support three basic types
- of line caps on a very low level: round, rectangular, and ``butt.''
- Using cap arrow tips, you can add new caps to lines and use
- different caps for the end and the start. An example is the line
- \tikz [baseline] \draw [line width=1ex, {Round
- Cap[reversed]}-{Triangle Cap[] . Fast Triangle[] Fast Triangle[]}]
- (0,0.5ex) -- (2em,0.5ex);.
- \begin{arrowcapexamples}
- \arrowcapexample Butt Cap[]
- \arrowcapexample Fast Round[]
- \arrowcapexample Fast Triangle[]
- \arrowcapexample Round Cap[]
- \arrowcapexample Triangle Cap[]
- \end{arrowcapexamples}
-\item \emph{Special} arrow tips are used for some specific purpose and
- do not fit into the above categories.
- \begin{arrowexamples}
- \arrowexample Rays[]
- \arrowexample Rays[n=8]
- \end{arrowexamples}
+ \item \emph{Cap} arrow tips are used to add a ``cap'' to the end of a
+ line. The graphic languages underlying \tikzname\ (\textsc{pdf},
+ \textsc{postscript} or \textsc{svg}) all support three basic types of
+ line caps on a very low level: round, rectangular, and ``butt''.
+ Using cap arrow tips, you can add new caps to lines and use different
+ caps for the end and the start. An example is the line \tikz
+ [baseline] \draw [line width=1ex, {Round Cap[reversed]}-{Triangle
+ Cap[] . Fast Triangle[] Fast Triangle[]}] (0,0.5ex) -- (2em,0.5ex);.
+ %
+ \begin{arrowcapexamples}
+ \arrowcapexample Butt Cap[]
+ \arrowcapexample Fast Round[]
+ \arrowcapexample Fast Triangle[]
+ \arrowcapexample Round Cap[]
+ \arrowcapexample Triangle Cap[]
+ \end{arrowcapexamples}
+ \item \emph{Special} arrow tips are used for some specific purpose and do
+ not fit into the above categories.
+ %
+ \begin{arrowexamples}
+ \arrowexample Rays[]
+ \arrowexample Rays[n=8]
+ \end{arrowexamples}
\end{itemize}
+
\subsubsection{Barbed Arrow Tips}
-\begin{arrowtip}{Arc Barb}
- {
- This arrow tip attaches an arc to the end of the line whose angle
- is given by the |arc| option. The
- |length| and |width| parameters refer to the size of the arrow tip
- for |arc| set to 180 degrees, which is why in the example for
- |arc=210| the actual length is larger than the specified
- |length|. The line width is taken into account
- for the computation of the length and width. Use the |round|
- option to add round caps to the end of the arcs.
- }
- {length=1.5cm,arc=210}
- {length=1.5cm,width=3cm}
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[arc=120]
- \arrowexample[arc=270]
- \arrowexample[length=2pt]
- \arrowexample[length=2pt,width=5pt]
- \arrowexample[line width=2pt]
- \arrowexample[reversed]
- \arrowexample[round]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[harpoon,reversed]
- \arrowexample[red]
- \end{arrowexamples}
- The following options have no effect: |open|, |fill|.
-
- On |double| lines, the arrow tip will not look correct.
+\begin{arrowtip}{Arc Barb}{
+ This arrow tip attaches an arc to the end of the line whose angle is given
+ by the |arc| option. The |length| and |width| parameters refer to the size
+ of the arrow tip for |arc| set to 180 degrees, which is why in the example
+ for |arc=210| the actual length is larger than the specified |length|. The
+ line width is taken into account for the computation of the length and
+ width. Use the |round| option to add round caps to the end of the arcs.
+}%
+{length=1.5cm,arc=210}%
+{length=1.5cm,width=3cm}
+
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[arc=120]
+ \arrowexample[arc=270]
+ \arrowexample[length=2pt]
+ \arrowexample[length=2pt,width=5pt]
+ \arrowexample[line width=2pt]
+ \arrowexample[reversed]
+ \arrowexample[round]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[harpoon,reversed]
+ \arrowexample[red]
+ \end{arrowexamples}
+ %
+ The following options have no effect: |open|, |fill|.
+
+ On |double| lines, the arrow tip will not look correct.
\end{arrowtip}
-
\begin{arrowtipsimple}{Bar}
- A simple bar. This is a simple instance of |Tee Barb| for length zero.
+ A simple bar. This is a simple instance of |Tee Barb| for length zero.
\end{arrowtipsimple}
-\begin{arrowtip}{Bracket}
- {
- This is an instance of the |Tee Barb| arrow tip that results in
- something resembling a bracket. Just like the |Parenthesis| arrow
- tip, a |Bracket| is not modelled from a text square bracket, but
- rather its size has been chosen so that it fits with the other
- arrow tips.
- }
- {}
- {}
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[reversed]
- \arrowexample[round]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[harpoon,reversed]
- \arrowexample[red]
- \end{arrowexamples}
- The following options have no effect: |open|, |fill|.
-
- On |double| lines, the arrow tip will not look correct.
+\begin{arrowtip}{Bracket}{
+ This is an instance of the |Tee Barb| arrow tip that results in something
+ resembling a bracket. Just like the |Parenthesis| arrow tip, a |Bracket| is
+ not modelled from a text square bracket, but rather its size has been
+ chosen so that it fits with the other arrow tips.
+}%
+{}%
+{}
+
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[reversed]
+ \arrowexample[round]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[harpoon,reversed]
+ \arrowexample[red]
+ \end{arrowexamples}
+ %
+ The following options have no effect: |open|, |fill|.
+
+ On |double| lines, the arrow tip will not look correct.
\end{arrowtip}
-\begin{arrowtip}{Hooks}
- {
- This arrow tip attaches two ``hooks'' to the end of the line. The
- |length| and |width| parameters refer to the size of the arrow tip
- if both arcs are 180 degrees; in the example the arc is 210
- degrees and, thus, the arrow is actually longer that the |length|
- dictates. The line width is taken into account for the computation
- of the length and width. The |arc| option is used to specify the
- angle of the arcs. Use the |round| option to add round caps to the
- end of the arcs.
- }
- {length=1cm,width=3.5cm,arc=210}
- {length=1cm,width=3.5cm}
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[arc=120]
- \arrowexample[arc=270]
- \arrowexample[length=2pt]
- \arrowexample[length=2pt,width=5pt]
- \arrowexample[line width=2pt]
- \arrowexample[reversed]
- \arrowexample[round]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[harpoon,reversed]
- \arrowexample[red]
- \end{arrowexamples}
- The following options have no effect: |open|, |fill|.
-
- On |double| lines, the arrow tip will not look correct.
+\begin{arrowtip}{Hooks}{
+ This arrow tip attaches two ``hooks'' to the end of the line. The |length|
+ and |width| parameters refer to the size of the arrow tip if both arcs are
+ 180 degrees; in the example the arc is 210 degrees and, thus, the arrow is
+ actually longer that the |length| dictates. The line width is taken into
+ account for the computation of the length and width. The |arc| option is
+ used to specify the angle of the arcs. Use the |round| option to add round
+ caps to the end of the arcs.
+}%
+{length=1cm,width=3.5cm,arc=210}%
+{length=1cm,width=3.5cm}
+
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[arc=120]
+ \arrowexample[arc=270]
+ \arrowexample[length=2pt]
+ \arrowexample[length=2pt,width=5pt]
+ \arrowexample[line width=2pt]
+ \arrowexample[reversed]
+ \arrowexample[round]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[harpoon,reversed]
+ \arrowexample[red]
+ \end{arrowexamples}
+ %
+ The following options have no effect: |open|, |fill|.
+
+ On |double| lines, the arrow tip will not look correct.
\end{arrowtip}
-
-\begin{arrowtip}{Parenthesis}
- {
- This arrow tip is an instantiation of the |Arc Barb| so that it
- resembles a parenthesis. However, the idea is not to recreate a
- ``real'' parenthesis as it is used in text, but rather a ``bow''
- at a size that harmonizes with the other arrow tips at their
- default sizes.
- }
- {}
- {}
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[reversed]
- \arrowexample[round]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[harpoon,reversed]
- \arrowexample[red]
- \end{arrowexamples}
- The following options have no effect: |open|, |fill|.
-
- On |double| lines, the arrow tip will not look correct.
+\begin{arrowtip}{Parenthesis}{
+ This arrow tip is an instantiation of the |Arc Barb| so that it resembles a
+ parenthesis. However, the idea is not to recreate a ``real'' parenthesis as
+ it is used in text, but rather a ``bow'' at a size that harmonizes with the
+ other arrow tips at their default sizes.
+}%
+{}%
+{}
+
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[reversed]
+ \arrowexample[round]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[harpoon,reversed]
+ \arrowexample[red]
+ \end{arrowexamples}
+ %
+ The following options have no effect: |open|, |fill|.
+
+ On |double| lines, the arrow tip will not look correct.
\end{arrowtip}
-\begin{arrowtip}{Straight Barb}
- {
- This is the ``archetypal'' arrow head, consisting of just two
- straight lines. The |length| and |width| parameters refer to the
- horizontal and vertical distances between the points on the path
- making up the arrow tip. As can be seen, the line width of the
- arrow tip's path is not taken into account.
- The |angle| option is particularly useful to set
- the opening angle at the tip of the arrow head. The |round| option
- gives a ``softer'' or ``rounder'' version of the arrow tip.
- }
- {length=2cm,width=3cm}
- {length=2cm/-4mm,width=3cm}
-
- \begin{arrowexamples}
- \arrowexample[]
-% \arrowexampledouble[]
- \arrowexampledup[]
- \arrowexampledupdot[]
- \arrowexample[length=5pt]
- \arrowexample[length=5pt,width=5pt]
- \arrowexample[line width=2pt]
- \arrowexample[reversed]
- \arrowexample[angle=60:2pt 3]
- \arrowexample[round]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[harpoon,reversed]
- \arrowexample[red]
- \end{arrowexamples}
- The following options have no effect: |open|, |fill|.
-
- On |double| lines, the arrow tip will not look correct.
+\begin{arrowtip}{Straight Barb}{
+ This is the ``archetypal'' arrow head, consisting of just two straight
+ lines. The |length| and |width| parameters refer to the horizontal and
+ vertical distances between the points on the path making up the arrow tip.
+ As can be seen, the line width of the arrow tip's path is not taken into
+ account. The |angle| option is particularly useful to set the opening angle
+ at the tip of the arrow head. The |round| option gives a ``softer'' or
+ ``rounder'' version of the arrow tip.
+}%
+{length=2cm,width=3cm}%
+{length=2cm/-4mm,width=3cm}
+
+ \begin{arrowexamples}
+ \arrowexample[]
+% \arrowexampledouble[]
+ \arrowexampledup[]
+ \arrowexampledupdot[]
+ \arrowexample[length=5pt]
+ \arrowexample[length=5pt,width=5pt]
+ \arrowexample[line width=2pt]
+ \arrowexample[reversed]
+ \arrowexample[angle=60:2pt 3]
+ \arrowexample[round]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[harpoon,reversed]
+ \arrowexample[red]
+ \end{arrowexamples}
+ %
+ The following options have no effect: |open|, |fill|.
+
+ On |double| lines, the arrow tip will not look correct.
\end{arrowtip}
-
-\begin{arrowtip}{Tee Barb}
- {
- This arrow tip attaches a little ``T'' on both sides of the
- tip. The arrow |inset| dictates the distance from the back end to
- the middle of the stem of the T. When the inset is equal to the
- length, the arrow tip is drawn as a single line, not as three
- lines (this is important for the ``round'' version since, then,
- the corners get rounded).
- }
- {length=1.5cm,width=3cm,inset=1cm}
- {length=1.5cm,width=3cm,inset=1cm}
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[inset=0pt]
- \arrowexample[inset'=0pt 1]
- \arrowexample[line width=2pt]
- \arrowexample[round]
- \arrowexample[round,inset'=0pt 1]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[harpoon,reversed]
- \arrowexample[red]
- \end{arrowexamples}
- The following options have no effect: |open|, |fill|.
-
- On |double| lines, the arrow tip will not look correct.
+\begin{arrowtip}{Tee Barb}{
+ This arrow tip attaches a little ``T'' on both sides of the tip. The arrow
+ |inset| dictates the distance from the back end to the middle of the stem
+ of the T. When the inset is equal to the length, the arrow tip is drawn as
+ a single line, not as three lines (this is important for the ``round''
+ version since, then, the corners get rounded).
+}%
+{length=1.5cm,width=3cm,inset=1cm}%
+{length=1.5cm,width=3cm,inset=1cm}
+
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[inset=0pt]
+ \arrowexample[inset'=0pt 1]
+ \arrowexample[line width=2pt]
+ \arrowexample[round]
+ \arrowexample[round,inset'=0pt 1]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[harpoon,reversed]
+ \arrowexample[red]
+ \end{arrowexamples}
+ %
+ The following options have no effect: |open|, |fill|.
+
+ On |double| lines, the arrow tip will not look correct.
\end{arrowtip}
-
\subsubsection{Mathematical Barbed Arrow Tips}
-
-\begin{arrowtip}{Classical TikZ Rightarrow}
- {
- This arrow tip is the ``old'' or ``classical'' arrow tip that used
- to be the standard in \tikzname\ in earlier versions. It was
- modelled on an old version of the tip of \texttt{\string\rightarrow}
- ($\rightarrow$) of the Computer Modern fonts. However, this ``old
- version'' was really old, Donald
- Knuth (the designer of both \TeX\ and of the Computer Modern
- fonts) replaced the arrow tip of the mathematical fonts
- in~1992.
- }
- {length=1cm,width=2cm}
- {length=1cm,width=2cm}
- The main problem with this arrow tip is that it is ``too small''
- at its natural size. I recommend using the new \texttt{Computer Modern
- Rightarrow} arrow tip instead, which matches the current
- $\to$. This new version is also the default used as |>| and as
- |To|, now.
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[length=3pt]
- \arrowexample[sharp]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[harpoon,reversed]
- \arrowexample[red]
- \end{arrowexamples}
- The following options have no effect: |open|, |fill|.
-
- On |double| lines, the arrow tip will not look correct.
+\begin{arrowtip}{Classical TikZ Rightarrow}{
+ This arrow tip is the ``old'' or ``classical'' arrow tip that used to be
+ the standard in \tikzname\ in earlier versions. It was modelled on an old
+ version of the tip of \texttt{\string\rightarrow} ($\rightarrow$) of the
+ Computer Modern fonts. However, this ``old version'' was really old, Donald
+ Knuth (the designer of both \TeX\ and of the Computer Modern fonts)
+ replaced the arrow tip of the mathematical fonts in~1992.
+}%
+{length=1cm,width=2cm}%
+{length=1cm,width=2cm}
+
+ The main problem with this arrow tip is that it is ``too small'' at its
+ natural size. I recommend using the new \texttt{Computer Modern Rightarrow}
+ arrow tip instead, which matches the current $\to$. This new version is
+ also the default used as |>| and as |To|, now.
+ %
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[length=3pt]
+ \arrowexample[sharp]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[harpoon,reversed]
+ \arrowexample[red]
+ \end{arrowexamples}
+ %
+ The following options have no effect: |open|, |fill|.
+
+ On |double| lines, the arrow tip will not look correct.
\end{arrowtip}
-\begin{arrowtip}{Computer Modern Rightarrow}
- {
- For a line width of 0.4pt (the default), this arrow tip looks very
- much like \texttt{\string\rightarrow} ($\to$) of the Computer Modern math
- fonts. However, it is not a ``perfect'' match: the line caps and
- joins of the ``real'' $\to$ are rounded differently from this
- arrow tip; but it takes a keen eye to notice the difference. When
- the |arrow.meta| library is loaded, this arrow tip becomes the
- default of |To| and, thus, is used whenever |>| is used (unless,
- of course, you redefined |>|).
- }
- {length=1cm,width=2cm}
- {length=1cm,width=2cm}
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[length=3pt]
- \arrowexample[sharp]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[harpoon,reversed]
- \arrowexample[red]
- \end{arrowexamples}
- The following options have no effect: |open|, |fill|.
-
- On |double| lines, the arrow tip will not look correct.
+\begin{arrowtip}{Computer Modern Rightarrow}{
+ For a line width of 0.4pt (the default), this arrow tip looks very much
+ like \texttt{\string\rightarrow} ($\to$) of the Computer Modern math fonts.
+ However, it is not a ``perfect'' match: the line caps and joins of the
+ ``real'' $\to$ are rounded differently from this arrow tip; but it takes a
+ keen eye to notice the difference. When the |arrow.meta| library is loaded,
+ this arrow tip becomes the default of |To| and, thus, is used whenever |>|
+ is used (unless, of course, you redefined |>|).
+}%
+{length=1cm,width=2cm}%
+{length=1cm,width=2cm}
+
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[length=3pt]
+ \arrowexample[sharp]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[harpoon,reversed]
+ \arrowexample[red]
+ \end{arrowexamples}
+ %
+ The following options have no effect: |open|, |fill|.
+
+ On |double| lines, the arrow tip will not look correct.
\end{arrowtip}
-
-
\begin{arrowtipsimple}{Implies}
- This arrow tip makes only sense in conjunction with the |double|
- option. The idea is that you attach it to a double line to get
- something that looks like \TeX's \texttt{\string\implies} arrow
- ($\implies$). A typical use of this arrow tip is
+ This arrow tip makes only sense in conjunction with the |double| option.
+ The idea is that you attach it to a double line to get something that looks
+ like \TeX's \texttt{\string\implies} arrow ($\implies$). A typical use of
+ this arrow tip is
+ %
\begin{codeexample}[]
\tikz \graph [clockwise=3, math nodes,
edges = {double equal sign distance, -Implies}] {
@@ -2153,433 +2145,399 @@ be classified in different groups:
"\alpha" -> "\beta" -> "\gamma" -> "\alpha"
};
\end{codeexample}
- \begin{arrowexamples}
- \arrowexampledouble[]
- \arrowexampledouble[red]
- \end{arrowexamples}
+ %
+ \begin{arrowexamples}
+ \arrowexampledouble[]
+ \arrowexampledouble[red]
+ \end{arrowexamples}
\end{arrowtipsimple}
\begin{arrowtipsimple}{To}
- This is a shorthand for |Computer Modern Rightarrow| when the
- |arrow.meta| library is loaded. Otherwise, it is a shorthand for the
- classical \tikzname\ rightarrow.
+ This is a shorthand for |Computer Modern Rightarrow| when the |arrow.meta|
+ library is loaded. Otherwise, it is a shorthand for the classical
+ \tikzname\ rightarrow.
\end{arrowtipsimple}
-
-
\subsubsection{Geometric Arrow Tips}
-
-
-\begin{arrowtip}{Circle}
- {
- Although this tip is called ``circle,'' you can also use it to
- draw ellipses if you set the length and width to different
- values. Neither |round| nor |reversed| has any effect on this
- arrow tip.
- }
- {length=2cm,width=2cm}
- {length=2cm,width=2cm}
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[open]
- \arrowexample[length=3pt]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[red]
- \end{arrowexamples}
+\begin{arrowtip}{Circle}{
+ Although this tip is called ``circle'', you can also use it to draw
+ ellipses if you set the length and width to different values. Neither
+ |round| nor |reversed| has any effect on this arrow tip.
+}%
+{length=2cm,width=2cm}%
+{length=2cm,width=2cm}
+
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[open]
+ \arrowexample[length=3pt]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[red]
+ \end{arrowexamples}
\end{arrowtip}
\begin{arrowtipsimple}{Diamond}
- This is an instance of |Kite| where the length is larger than the
- width.
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[]
- \arrowexampledupdot[]
- \arrowexample[open]
- \arrowexample[length=10pt]
- \arrowexample[round]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[red]
- \arrowexample[fill=red!50]
- \end{arrowexamples}
+ This is an instance of |Kite| where the length is larger than the width.
+ %
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[]
+ \arrowexampledupdot[]
+ \arrowexample[open]
+ \arrowexample[length=10pt]
+ \arrowexample[round]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[red]
+ \arrowexample[fill=red!50]
+ \end{arrowexamples}
\end{arrowtipsimple}
\begin{arrowtipsimple}{Ellipse}
- This is a shorthand for a ``circle'' that is twice as wide as high.
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[open]
- \arrowexample[length=10pt]
- \arrowexample[round]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[red]
- \arrowexample[fill=red!50]
- \end{arrowexamples}
+ This is a shorthand for a ``circle'' that is twice as wide as high.
+
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[open]
+ \arrowexample[length=10pt]
+ \arrowexample[round]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[red]
+ \arrowexample[fill=red!50]
+ \end{arrowexamples}
\end{arrowtipsimple}
-
-\begin{arrowtip}{Kite}
- {
- This arrow tip consists of four lines that form a ``kite.'' The
- |inset| prescribed how far the width-axis of the kite is removed
- from the back end. Note that the inset cannot be negative, use a
- |Stealth| arrow tip for this.
- }
- {length=3cm,width=2cm,inset=1cm}
- {length=3cm,width=2cm,inset=1cm}
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[open]
- \arrowexample[length=6pt,width=4pt]
- \arrowexample[length=6pt,width=4pt,inset=1.5pt]
- \arrowexample[round]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[red]
- \end{arrowexamples}
+\begin{arrowtip}{Kite}{
+ This arrow tip consists of four lines that form a ``kite''. The |inset|
+ prescribed how far the width-axis of the kite is removed from the back end.
+ Note that the inset cannot be negative, use a |Stealth| arrow tip for this.
+}%
+{length=3cm,width=2cm,inset=1cm}%
+{length=3cm,width=2cm,inset=1cm}
+
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[open]
+ \arrowexample[length=6pt,width=4pt]
+ \arrowexample[length=6pt,width=4pt,inset=1.5pt]
+ \arrowexample[round]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[red]
+ \end{arrowexamples}
\end{arrowtip}
-
-\begin{arrowtip}{Latex}
- {
- This arrow tip is the same as the arrow tip used in \LaTeX's
- standard pictures (via the \texttt{\string\vec} command), if you
- set the length to 4pt. The default size for this arrow tip was set
- slightly larger so that it fits better with the other geometric
- arrow tips.
- }
- {length=3cm,width=2cm}
- {length=3cm,width=2cm}
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[open]
- \arrowexample[length=4pt]
- \arrowexample[round]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[red]
- \end{arrowexamples}
+\begin{arrowtip}{Latex}{
+ This arrow tip is the same as the arrow tip used in \LaTeX's standard
+ pictures (via the \texttt{\string\vec} command), if you set the length to
+ 4pt. The default size for this arrow tip was set slightly larger so that it
+ fits better with the other geometric arrow tips.
+}%
+{length=3cm,width=2cm}%
+{length=3cm,width=2cm}
+
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[open]
+ \arrowexample[length=4pt]
+ \arrowexample[round]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[red]
+ \end{arrowexamples}
\end{arrowtip}
\begin{arrowtipsimple}{LaTeX}
- Another spelling for the |Latex| arrow tip.
+ Another spelling for the |Latex| arrow tip.
\end{arrowtipsimple}
-
-
-\begin{arrowtip}{Rectangle}
- {
- A rectangular arrow tip. By default, it is twice as long as high.
- }
- {length=3cm,width=2cm}
- {length=3cm,width=2cm}
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[open]
- \arrowexample[length=4pt]
- \arrowexample[round]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[red]
- \end{arrowexamples}
+\begin{arrowtip}{Rectangle}{
+ A rectangular arrow tip. By default, it is twice as long as high.
+}%
+{length=3cm,width=2cm}%
+{length=3cm,width=2cm}
+
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[open]
+ \arrowexample[length=4pt]
+ \arrowexample[round]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[red]
+ \end{arrowexamples}
\end{arrowtip}
-
\begin{arrowtipsimple}{Square}
- An instance of the |Rectangle| whose width is identical to the length.
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[open]
- \arrowexample[length=4pt]
- \arrowexample[round]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[red]
- \end{arrowexamples}
+ An instance of the |Rectangle| whose width is identical to the length.
+ %
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[open]
+ \arrowexample[length=4pt]
+ \arrowexample[round]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[red]
+ \end{arrowexamples}
\end{arrowtipsimple}
-
-
-\begin{arrowtip}{Stealth}
- {
+\begin{arrowtip}{Stealth}{
This arrow tip is similar to a |Kite|, only the |inset| now counts
- ``inwards.'' Because of that sharp angles, for this arrow tip is
- makes quite a difference, visually, if use the |round|
- option. Also, using the |harpoon| option (or |left| or |right|)
- will \emph{lengthen} the arrow tip because of the even sharper
- corner at the tip.
- }
- {length=3cm,width=2cm,inset=1cm}
- {length=3cm,width=2cm,inset=1cm}
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[open]
- \arrowexample[length=6pt,width=4pt]
- \arrowexample[length=6pt,width=4pt,inset=1.5pt]
- \arrowexample[round]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[red]
- \end{arrowexamples}
+ ``inwards''. Because of that sharp angles, for this arrow tip is makes
+ quite a difference, visually, if use the |round| option. Also, using the
+ |harpoon| option (or |left| or |right|) will \emph{lengthen} the arrow tip
+ because of the even sharper corner at the tip.
+}%
+{length=3cm,width=2cm,inset=1cm}%
+{length=3cm,width=2cm,inset=1cm}
+
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[open]
+ \arrowexample[length=6pt,width=4pt]
+ \arrowexample[length=6pt,width=4pt,inset=1.5pt]
+ \arrowexample[round]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[red]
+ \end{arrowexamples}
\end{arrowtip}
-
\begin{arrowtipsimple}{Triangle}
- An instance of a |Kite| with zero inset.
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[open]
- \arrowexample[length=4pt]
- \arrowexample[angle=45:1pt 3]
- \arrowexample[angle=60:1pt 3]
- \arrowexample[angle=90:1pt 3]
- \arrowexample[round]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[red]
- \end{arrowexamples}
+ An instance of a |Kite| with zero inset.
+ %
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[open]
+ \arrowexample[length=4pt]
+ \arrowexample[angle=45:1pt 3]
+ \arrowexample[angle=60:1pt 3]
+ \arrowexample[angle=90:1pt 3]
+ \arrowexample[round]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[red]
+ \end{arrowexamples}
\end{arrowtipsimple}
\begin{arrowtipsimple}{Turned Square}
- An instance of a |Kite| with identical width and height and mid-inset.
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[open]
- \arrowexample[length=4pt]
- \arrowexample[round]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[red]
- \end{arrowexamples}
+ An instance of a |Kite| with identical width and height and mid-inset.
+ %
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[open]
+ \arrowexample[length=4pt]
+ \arrowexample[round]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[red]
+ \end{arrowexamples}
\end{arrowtipsimple}
-
\subsubsection{Caps}
-Recall that a \emph{cap} is a way of ending a line. The graphic
-languages underlying \tikzname\ (\textsc{pdf}, \textsc{postscript} or
-\textsc{svg}) all support three basic types of line caps on a very low
-level: round, rectangular, and ``butt.'' Using cap arrow tips, you can
-add new caps to lines and use different caps for the end and the
-start.
-
+Recall that a \emph{cap} is a way of ending a line. The graphic languages
+underlying \tikzname\ (\textsc{pdf}, \textsc{postscript} or \textsc{svg}) all
+support three basic types of line caps on a very low level: round, rectangular,
+and ``butt''. Using cap arrow tips, you can add new caps to lines and use
+different caps for the end and the start.
\begin{arrowtipsimple}{Butt Cap}
- This arrow tip ends the line ``in the normal way'' with a straight
- end. This arrow tip is only need to ``cover up'' the actual line
- cap, if this happens to differ from the normal cap. In the following
- example, the line cap is ``round'', but, nevertheless, the right end
- is a ``butt'' cap:
-
+ This arrow tip ends the line ``in the normal way'' with a straight end.
+ This arrow tip is only need to ``cover up'' the actual line cap, if this
+ happens to differ from the normal cap. In the following example, the line
+ cap is ``round'', but, nevertheless, the right end is a ``butt'' cap:
+ %
\begin{codeexample}[]
-\tikz \draw [line width=1ex, line cap=round, -Butt Cap] (0,0) -- (1,0);
+\tikz \draw [line width=1ex, line cap=round, -Butt Cap] (0,0) -- (1,0);
\end{codeexample}
+ %
\end{arrowtipsimple}
-
-\begin{arrowcap}{Fast Round}
- {
+\begin{arrowcap}{Fast Round}{
This arrow tip is not really a cap, you use it in conjunction with
- (typically) the |Round Cap|. The idea is that you end your line
- using the round cap and then add several \texttt{Fast
- Round}s. As for |Round Cap|, the |length| parameter
- dictates the length is the length of the ``main part,'' the
- inset sets the length of a line that comes before this tip.
- }
- {length=5mm,inset=1cm}
- {length=5mm,inset=-1cm}
- {-15mm}
-
+ (typically) the |Round Cap|. The idea is that you end your line using the
+ round cap and then add several \texttt{Fast Round}s. As for |Round Cap|,
+ the |length| parameter dictates the length is the length of the ``main
+ part'', the inset sets the length of a line that comes before this tip.
+}%
+{length=5mm,inset=1cm}%
+{length=5mm,inset=-1cm}%
+{-15mm}
+
\begin{codeexample}[]
\tikz \draw [line width=1ex,
-{Round Cap []. Fast Round[] Fast Round[]}]
- (0,0) -- (1,0);
+ (0,0) -- (1,0);
\end{codeexample}
- Note that in conjunction with the |bend| option, this works even
- quite well for curves:
+ %
+ Note that in conjunction with the |bend| option, this works even quite well
+ for curves:
+ %
\begin{codeexample}[]
\tikz [f/.tip = Fast Round] % shorthand
\draw [line width=1ex, -{[bend] Round Cap[] . f f f}]
- (0,0) to [bend left] (1,0);
-\end{codeexample}
-
- \begin{arrowcapexamples}
- \arrowcapexample[]
- \arrowcapexample[reversed]
- \arrowcapexample[cap angle=60]
- \arrowcapexample[cap angle=60,inset=5pt]
- \arrowcapexample[length=.5ex]
- \arrowcapexample[slant=.3]
- \end{arrowcapexamples}
+ (0,0) to [bend left] (1,0);
+\end{codeexample}
+
+ \begin{arrowcapexamples}
+ \arrowcapexample[]
+ \arrowcapexample[reversed]
+ \arrowcapexample[cap angle=60]
+ \arrowcapexample[cap angle=60,inset=5pt]
+ \arrowcapexample[length=.5ex]
+ \arrowcapexample[slant=.3]
+ \end{arrowcapexamples}
\end{arrowcap}
+\begin{arrowcap}{Fast Triangle}{
+ This arrow tip works like |Fast Round|, only for triangular caps.
+}%
+{length=5mm,inset=1cm}%
+{length=5mm,inset=-1cm}%
+{-15mm}
-\begin{arrowcap}{Fast Triangle}
- {
- This arrow tip works like |Fast Round|, only for triangular caps.
- }
- {length=5mm,inset=1cm}
- {length=5mm,inset=-1cm}
- {-15mm}
-
\begin{codeexample}[]
\tikz \draw [line width=1ex,
-{Triangle Cap []. Fast Triangle[] Fast Triangle[]}]
- (0,0) -- (1,0);
+ (0,0) -- (1,0);
\end{codeexample}
- Again, this tip works well for curves:
+ %
+ Again, this tip works well for curves:
+ %
\begin{codeexample}[]
\tikz [f/.tip = Fast Triangle] % shorthand
\draw [line width=1ex, -{[bend] Triangle Cap[] . f f f}]
- (0,0) to [bend left] (1,0);
-\end{codeexample}
-
- \begin{arrowcapexamples}
- \arrowcapexample[]
- \arrowcapexample[reversed]
- \arrowcapexample[cap angle=60]
- \arrowcapexample[cap angle=60,inset=5pt]
- \arrowcapexample[length=.5ex]
- \arrowcapexample[slant=.3]
- \end{arrowcapexamples}
-\end{arrowcap}
-
-
+ (0,0) to [bend left] (1,0);
+\end{codeexample}
-\begin{arrowcap}{Round Cap}
- {
- This arrow tip ends the line using a half circle or, if the length
- has been modified, a half-ellipse.
- }
- {length=5mm}
- {length=5mm}
- {-5mm}
- \begin{arrowcapexamples}
- \arrowcapexample[]
- \arrowcapexample[reversed]
- \arrowcapexample[length=.5ex]
- \arrowcapexample[slant=.3]
- \end{arrowcapexamples}
+ \begin{arrowcapexamples}
+ \arrowcapexample[]
+ \arrowcapexample[reversed]
+ \arrowcapexample[cap angle=60]
+ \arrowcapexample[cap angle=60,inset=5pt]
+ \arrowcapexample[length=.5ex]
+ \arrowcapexample[slant=.3]
+ \end{arrowcapexamples}
\end{arrowcap}
+\begin{arrowcap}{Round Cap}{
+ This arrow tip ends the line using a half circle or, if the length has been
+ modified, a half-ellipse.
+ }%
+{length=5mm}%
+{length=5mm}%
+{-5mm}
+
+ \begin{arrowcapexamples}
+ \arrowcapexample[]
+ \arrowcapexample[reversed]
+ \arrowcapexample[length=.5ex]
+ \arrowcapexample[slant=.3]
+ \end{arrowcapexamples}
+\end{arrowcap}
-\begin{arrowcap}{Triangle Cap}
- {
- This arrow tip ends the line using a triangle whose length is
- given by the |length| option.
- }
- {length=5mm}
- {length=5mm}
- {-5mm}
-
- You can get any angle you want at the tip by specifying a length
- that is an appropriate multiple of the line width. The following
- options does this computation for you:
- \begin{key}{/pgf/arrow keys/cap angle=\meta{angle}}
- Sets |length| to an appropriate multiple of the line width so that
- the angle of a |Triangle Cap| is exactly \meta{angle} at the tip.
- \end{key}
-
- \begin{arrowcapexamples}
- \arrowcapexample[]
- \arrowcapexample[reversed]
- \arrowcapexample[cap angle=60]
- \arrowcapexample[cap angle=60,reversed]
- \arrowcapexample[length=.5ex]
- \arrowcapexample[slant=.3]
- \end{arrowcapexamples}
+\begin{arrowcap}{Triangle Cap}{
+ This arrow tip ends the line using a triangle whose length is given by the
+ |length| option.
+}%
+{length=5mm}%
+{length=5mm}%
+{-5mm}
+
+ You can get any angle you want at the tip by specifying a length that is an
+ appropriate multiple of the line width. The following options does this
+ computation for you:
+ %
+ \begin{key}{/pgf/arrow keys/cap angle=\meta{angle}}
+ Sets |length| to an appropriate multiple of the line width so that the
+ angle of a |Triangle Cap| is exactly \meta{angle} at the tip.
+ \end{key}
+
+ \begin{arrowcapexamples}
+ \arrowcapexample[]
+ \arrowcapexample[reversed]
+ \arrowcapexample[cap angle=60]
+ \arrowcapexample[cap angle=60,reversed]
+ \arrowcapexample[length=.5ex]
+ \arrowcapexample[slant=.3]
+ \end{arrowcapexamples}
\end{arrowcap}
\subsubsection{Special Arrow Tips}
-\begin{arrowtip}{Rays}
- {
- This arrow tip attaches a ``bundle of rays'' to the tip. The
- number of evenly spaced rays is given by the |n| arrow key (see
- below). When the number is even, the rays will lie to the left and
- to the right of the direction of the arrow; when the number is
- odd, the rays are rotated in such a way that one of them points
- perpendicular to the direction of the arrow (this is to ensure
- that no ray points in the direction of the line, which would look
- strange). The |length| and |width| describe the length and width
- of an ellipse into which the rays fit.
- }
- {length=3cm,width=3cm,n=6}
- {length=3cm,width=3cm}
-
- \begin{arrowexamples}
- \arrowexample[]
- \arrowexampledup[sep]
- \arrowexampledupdot[sep]
- \arrowexample[width'=0pt 2]
- \arrowexample[round]
- \arrowexample[n=2]
- \arrowexample[n=3]
- \arrowexample[n=4]
- \arrowexample[n=5]
- \arrowexample[n=6]
- \arrowexample[n=7]
- \arrowexample[n=8]
- \arrowexample[n=9]
- \arrowexample[slant=.3]
- \arrowexample[left]
- \arrowexample[right]
- \arrowexample[left,n=5]
- \arrowexample[right,n=5]
- \arrowexample[red]
- \end{arrowexamples}
+\begin{arrowtip}{Rays}{
+ This arrow tip attaches a ``bundle of rays'' to the tip. The number of
+ evenly spaced rays is given by the |n| arrow key (see below). When the
+ number is even, the rays will lie to the left and to the right of the
+ direction of the arrow; when the number is odd, the rays are rotated in
+ such a way that one of them points perpendicular to the direction of the
+ arrow (this is to ensure that no ray points in the direction of the line,
+ which would look strange). The |length| and |width| describe the length and
+ width of an ellipse into which the rays fit.
+}%
+{length=3cm,width=3cm,n=6}%
+{length=3cm,width=3cm}
+
+ \begin{arrowexamples}
+ \arrowexample[]
+ \arrowexampledup[sep]
+ \arrowexampledupdot[sep]
+ \arrowexample[width'=0pt 2]
+ \arrowexample[round]
+ \arrowexample[n=2]
+ \arrowexample[n=3]
+ \arrowexample[n=4]
+ \arrowexample[n=5]
+ \arrowexample[n=6]
+ \arrowexample[n=7]
+ \arrowexample[n=8]
+ \arrowexample[n=9]
+ \arrowexample[slant=.3]
+ \arrowexample[left]
+ \arrowexample[right]
+ \arrowexample[left,n=5]
+ \arrowexample[right,n=5]
+ \arrowexample[red]
+ \end{arrowexamples}
\end{arrowtip}
+
\begin{key}{/pgf/arrow keys/n=\meta{number} (initially 4)}
- Sets the number of rays in a |Rays| arrow tip.
+ Sets the number of rays in a |Rays| arrow tip.
\end{key}
-
-
-\endinput
-
-
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 154533e680c..8ffafad7f54 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
@@ -7,42 +7,43 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\section{Specifying Coordinates}
+\section{Specifying Coordinates}
\subsection{Overview}
-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
+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}|)|}.
-The \meta{coordinate specification} specifies coordinates using one of
-many different possible \emph{coordinate systems}. Examples are the
-Cartesian coordinate system or polar coordinates or spherical
-coordinates. No matter which coordinate system is used, in the end, a
-specific point on the canvas is represented by the coordinate.
+The \meta{coordinate specification} specifies coordinates using one of many
+different possible \emph{coordinate systems}. Examples are the Cartesian
+coordinate system or polar coordinates or spherical coordinates. No matter
+which coordinate system is used, in the end, a specific point on the canvas is
+represented by the coordinate.
There are two ways of specifying which coordinate system should be used:
+%
\begin{description}
-\item[Explicitly] You can specify the coordinate system explicitly. To
- do so, you give the name of the coordinate system at the beginning,
- followed by |cs:|, which stands for ``coordinate system,'' followed
- by a specification of the coordinate using the key-value
- syntax. Thus, the general syntax for \meta{coordinate specification}
- in the explicit case is |(|\meta{coordinate system}| cs:|\meta{list
- of key-value pairs specific to the coordinate system}|)|.
-\item[Implicitly] The explicit specification is often too verbose when
- numerous coordinates should be given. Because of this, for the
- coordinate systems that you are likely to use often a special syntax
- is provided. \tikzname\ will notice when you use a coordinate
- specified in a special syntax and will choose the correct coordinate
- system automatically.
+ \item[Explicitly] You can specify the coordinate system explicitly. To do
+ so, you give the name of the coordinate system at the beginning,
+ followed by |cs:|, which stands for ``coordinate system'', followed by
+ a specification of the coordinate using the key--value syntax. Thus,
+ the general syntax for \meta{coordinate specification} in the explicit
+ case is |(|\meta{coordinate system}| cs:|\meta{list of key--value pairs
+ specific to the coordinate system}|)|.
+ \item[Implicitly] The explicit specification is often too verbose when
+ numerous coordinates should be given. Because of this, for the
+ coordinate systems that you are likely to use often a special syntax
+ is provided. \tikzname\ will notice when you use a coordinate
+ specified in a special syntax and will choose the correct coordinate
+ system automatically.
\end{description}
-Here is an example in which explicit the coordinate systems are
-specified explicitly:
+Here is an example in which explicit the coordinate systems are specified
+explicitly:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -50,7 +51,9 @@ specified explicitly:
-- (canvas polar cs:radius=2cm,angle=30);
\end{tikzpicture}
\end{codeexample}
+%
In the next example, the coordinate systems are implicit:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -58,10 +61,11 @@ In the next example, the coordinate systems are implicit:
\end{tikzpicture}
\end{codeexample}
-It is possible to give options that apply only to a single
-coordinate, although this makes sense for transformation options
-only. To give transformation options for a single coordinate, give
-these options at the beginning in brackets:
+It is possible to give options that apply only to a single coordinate, although
+this makes sense for transformation options only. To give transformation
+options for a single coordinate, give these options at the beginning in
+brackets:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -80,23 +84,21 @@ these options at the beginning in brackets:
Let us start with the basic coordinate systems.
\begin{coordinatesystem}{canvas}
- The simplest way of specifying a coordinate is to use the |canvas|
- coordinate system. You provide a dimension $d_x$ using the |x=|
- option and another dimension $d_y$ using the |y=| option. The position on
- the canvas is located at the position that is $d_x$ to the right and
- $d_y$ above the origin.
-
- \begin{key}{/tikz/cs/x=\meta{dimension} (initially 0pt)}
- Distance by which the coordinate
- is to the right of the origin. You can also write things like
- |1cm+2pt| since the mathematical engine is used to evaluate the
- \meta{dimension}.
- \end{key}
-
- \begin{key}{/tikz/cs/y=\meta{dimension} (initially 0pt)}
- Distance by which the coordinate
- is above the origin.
- \end{key}
+ The simplest way of specifying a coordinate is to use the |canvas|
+ coordinate system. You provide a dimension $d_x$ using the |x=| option and
+ another dimension $d_y$ using the |y=| option. The position on the canvas
+ is located at the position that is $d_x$ to the right and $d_y$ above the
+ origin.
+
+ \begin{key}{/tikz/cs/x=\meta{dimension} (initially 0pt)}
+ Distance by which the coordinate is to the right of the origin. You can
+ also write things like |1cm+2pt| since the mathematical engine is used
+ to evaluate the \meta{dimension}.
+ \end{key}
+
+ \begin{key}{/tikz/cs/y=\meta{dimension} (initially 0pt)}
+ Distance by which the coordinate is above the origin.
+ \end{key}
\begin{codeexample}[]
\begin{tikzpicture}
@@ -107,9 +109,10 @@ Let us start with the basic coordinate systems.
\end{tikzpicture}
\end{codeexample}
- 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)|.
+ 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)|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -118,28 +121,31 @@ Let us start with the basic coordinate systems.
\fill (2cm,-5mm+2pt) circle (2pt);
\end{tikzpicture}
\end{codeexample}
+ %
\end{coordinatesystem}
-
\begin{coordinatesystem}{xyz}
- The |xyz| coordinate system allows you to specify a point as a
- multiple of three vectors called the $x$-, $y$-, and
- $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(-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:
- \begin{key}{/tikz/cs/x=\meta{factor} (initially 0)}
- Factor by which the $x$-vector is multiplied.
- \end{key}
- \begin{key}{/tikz/cs/y=\meta{factor} (initially 0)}
- Works like |x|.
- \end{key}
- \begin{key}{/tikz/cs/z=\meta{factor} (initially 0)}
- Works like |x|.
- \end{key}
+ The |xyz| coordinate system allows you to specify a point as a multiple of
+ three vectors called the $x$-, $y$-, and $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(-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:
+ %
+ \begin{key}{/tikz/cs/x=\meta{factor} (initially 0)}
+ Factor by which the $x$-vector is multiplied.
+ \end{key}
+ %
+ \begin{key}{/tikz/cs/y=\meta{factor} (initially 0)}
+ Works like |x|.
+ \end{key}
+ %
+ \begin{key}{/tikz/cs/z=\meta{factor} (initially 0)}
+ Works like |x|.
+ \end{key}
\begin{codeexample}[]
\begin{tikzpicture}[->]
@@ -149,9 +155,9 @@ Let us start with the basic coordinate systems.
\end{tikzpicture}
\end{codeexample}
- This coordinate system can also be selected implicitly. To do so,
- you just provide two or three comma-separated factors (not
- dimensions).
+ This coordinate system can also be selected implicitly. To do so, you just
+ provide two or three comma-separated factors (not dimensions).
+ %
\begin{codeexample}[]
\begin{tikzpicture}[->]
\draw (0,0) -- (1,0);
@@ -159,101 +165,104 @@ Let us start with the basic coordinate systems.
\draw (0,0) -- (0,0,1);
\end{tikzpicture}
\end{codeexample}
+ %
\end{coordinatesystem}
-\emph{Note:} It is possible to use coordinates like |(1,2cm)|, which
-are neither |canvas| coordinates nor |xyz| coordinates. The rule is
-the following: If a coordinate is of the implicit form
-|(|\meta{x}|,|\meta{y}|)|, then \meta{x} and \meta{y} are checked,
-independently, whether they have a dimension or whether they are
-dimensionless. If both have a dimension, the |canvas| coordinate
-system is used. If both lack a dimension, the |xyz| coordinate system
-is used. If \meta{x} has a dimension and \meta{y} has not, then the
-sum of two coordinate |(|\meta{x}|,0pt)| and |(0,|\meta{y}|)| is
-used. If \meta{y} has a dimension and \meta{x} has not, then the sum
-of two coordinate |(|\meta{x}|,0)| and |(0pt,|\meta{y}|)| is used.
-
-\emph{Note furthermore:} An expression like |(2+3cm,0)| does
-\emph{not} mean the same as |(2cm+3cm,0)|. Instead, if \meta{x} or
-\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|.
+\emph{Note:} It is possible to use coordinates like |(1,2cm)|, which are
+neither |canvas| coordinates nor |xyz| coordinates. The rule is the following:
+If a coordinate is of the implicit form |(|\meta{x}|,|\meta{y}|)|, then
+\meta{x} and \meta{y} are checked, independently, whether they have a dimension
+or whether they are dimensionless. If both have a dimension, the |canvas|
+coordinate system is used. If both lack a dimension, the |xyz| coordinate
+system is used. If \meta{x} has a dimension and \meta{y} has not, then the sum
+of two coordinate |(|\meta{x}|,0pt)| and |(0,|\meta{y}|)| is used. If \meta{y}
+has a dimension and \meta{x} has not, then the sum of two coordinate
+|(|\meta{x}|,0)| and |(0pt,|\meta{y}|)| is used.
+
+\emph{Note furthermore:} An expression like |(2+3cm,0)| does \emph{not} mean
+the same as |(2cm+3cm,0)|. Instead, if \meta{x} or \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|.
\begin{coordinatesystem}{canvas polar}
- The |canvas polar| coordinate system allows you to specify
- polar coordinates. You provide an angle using the |angle=| option
- and a radius using the |radius=| option. This yields the point on
- the canvas that is at the given radius distance from the origin at
- the given degree. An angle of zero degrees to the right, a degree of
- 90 upward.
- \begin{key}{/tikz/cs/angle=\meta{degrees}}
- The angle of the coordinate.
- The angle must always be given in degrees and should be between
- $-360$ and $720$.
- \end{key}
- \begin{key}{/tikz/cs/radius=\meta{dimension}}
- The distance from the origin.
- \end{key}
- \begin{key}{/tikz/cs/x radius=\meta{dimension}}
- A polar coordinate is,
- after all, just a point on a circle of the given \meta{radius}. When
- you provide an $x$-radius and also a $y$-radius, you specify an
- ellipse instead of a circle. The |radius| option has the same effect
- as specifying identical |x radius| and |y radius| options.
- \end{key}
- \begin{key}{/tikz/cs/y radius=\meta{dimension}}
- Works like |x radius|.
- \end{key}
+ The |canvas polar| coordinate system allows you to specify polar
+ coordinates. You provide an angle using the |angle=| option and a radius
+ using the |radius=| option. This yields the point on the canvas that is at
+ the given radius distance from the origin at the given degree. An angle of
+ zero degrees to the right, a degree of 90 upward.
+ %
+ \begin{key}{/tikz/cs/angle=\meta{degrees}}
+ The angle of the coordinate. The angle must always be given in degrees
+ and should be between $-360$ and $720$.
+ \end{key}
+ %
+ \begin{key}{/tikz/cs/radius=\meta{dimension}}
+ The distance from the origin.
+ \end{key}
+ %
+ \begin{key}{/tikz/cs/x radius=\meta{dimension}}
+ A polar coordinate is, after all, just a point on a circle of the given
+ \meta{radius}. When you provide an $x$-radius and also a $y$-radius,
+ you specify an ellipse instead of a circle. The |radius| option has the
+ same effect as specifying identical |x radius| and |y radius| options.
+ \end{key}
+ %
+ \begin{key}{/tikz/cs/y radius=\meta{dimension}}
+ Works like |x radius|.
+ \end{key}
+ %
\begin{codeexample}[]
\tikz \draw (0,0) -- (canvas polar cs:angle=30,radius=1cm);
\end{codeexample}
- 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)|.
-
+ 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)|.
+ %
\begin{codeexample}[]
\tikz \draw (0cm,0cm) -- (30:1cm) -- (60:1cm) -- (90:1cm)
-- (120:1cm) -- (150:1cm) -- (180:1cm);
\end{codeexample}
- Two different radii are specified by writing |(30:1cm and 2cm)|.
+ Two different radii are specified by writing |(30:1cm and 2cm)|.
- For the implicit form, instead of an angle given as a number you can
- also use certain words. For example, |up| is the same as |90|, so
- that you can write |\tikz \draw (0,0) -- (2ex,0pt) -- +(up:1ex);|
- and get \tikz \draw (0,0) -- (2ex,0pt) -- +(up:1ex);. Apart from |up|
- you can use |down|, |left|, |right|, |north|, |south|, |west|, |east|,
- |north east|, |north west|, |south east|, |south west|, all of which
- have their natural meaning.
+ For the implicit form, instead of an angle given as a number you can also
+ use certain words. For example, |up| is the same as |90|, so that you can
+ write |\tikz \draw (0,0) -- (2ex,0pt) -- +(up:1ex);| and get
+ \tikz \draw (0,0) -- (2ex,0pt) -- +(up:1ex);. Apart from |up| you can use
+ |down|, |left|, |right|, |north|, |south|, |west|, |east|, |north east|,
+ |north west|, |south east|, |south west|, all of which have their natural
+ meaning.
\end{coordinatesystem}
\begin{coordinatesystem}{xyz polar}
- This coordinate system work similarly to the |canvas polar|
- system. However, the radius and the angle are interpreted in the
- $xy$-coordinate system, not in the canvas system. More detailed,
- consider the circle or ellipse whose half axes are given by the
- current $x$-vector and the current $y$-vector. Then, consider the
- point that lies at a given angle on this ellipse, where an angle of
- zero is the same as the $x$-vector and an angle of 90 is the
- $y$-vector. Finally, multiply the resulting vector by the given
- radius factor. Voil\`a.
- \begin{key}{/tikz/cs/angle=\meta{degrees}}
- The angle of the coordinate
- interpreted in the ellipse whose axes are the $x$-vector and the
- $y$-vector.
- \end{key}
- \begin{key}{/tikz/cs/radius=\meta{factor}}
- A factor by which the $x$-vector
- and $y$-vector are multiplied prior to forming the ellipse.
- \end{key}
- \begin{key}{/tikz/cs/x radius=\meta{dimension}} A specific factor by
- which only the $x$-vector is multiplied.
- \end{key}
- \begin{key}{/tikz/cs/y radius=\meta{dimension}}
- Works like |x radius|.
- \end{key}
+ This coordinate system work similarly to the |canvas polar| system.
+ However, the radius and the angle are interpreted in the $xy$-coordinate
+ system, not in the canvas system. More detailed, consider the circle or
+ ellipse whose half axes are given by the current $x$-vector and the current
+ $y$-vector. Then, consider the point that lies at a given angle on this
+ ellipse, where an angle of zero is the same as the $x$-vector and an angle
+ of 90 is the $y$-vector. Finally, multiply the resulting vector by the
+ given radius factor. Voil\`a.
+ %
+ \begin{key}{/tikz/cs/angle=\meta{degrees}}
+ The angle of the coordinate interpreted in the ellipse whose axes are
+ the $x$-vector and the $y$-vector.
+ \end{key}
+ %
+ \begin{key}{/tikz/cs/radius=\meta{factor}}
+ A factor by which the $x$-vector and $y$-vector are multiplied prior to
+ forming the ellipse.
+ \end{key}
+ %
+ \begin{key}{/tikz/cs/x radius=\meta{dimension}}
+ A specific factor by which only the $x$-vector is multiplied.
+ \end{key}
+ %
+ \begin{key}{/tikz/cs/y radius=\meta{dimension}}
+ Works like |x radius|.
+ \end{key}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[x=1.5cm,y=1cm]
\draw[help lines] (0cm,0cm) grid (3cm,2cm);
@@ -270,53 +279,53 @@ by interpreting them as |pt|. So, |2+3cm| is the same dimension as
\end{tikzpicture}
\end{codeexample}
- The implicit version of this option is the same as the implicit
- version of |canvas polar|, only you do not provide a unit.
+ The implicit version of this option is the same as the implicit version of
+ |canvas polar|, only you do not provide a unit.
\begin{codeexample}[]
\tikz[x={(0cm,1cm)},y={(-1cm,0cm)}]
\draw (0,0) -- (30:1) -- (60:1) -- (90:1)
-- (120:1) -- (150:1) -- (180:1);
\end{codeexample}
+ %
\end{coordinatesystem}
\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.
+ 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.
\end{coordinatesystem}
\subsubsection{Barycentric Systems}
\label{section-barycentric-coordinates}
-In the barycentric coordinate system a point is expressed as the
-linear combination of multiple vectors. The idea is that you specify
-vectors $v_1$, $v_2$, \dots, $v_n$ and numbers $\alpha_1$, $\alpha_2$,
-\dots, $\alpha_n$. Then the barycentric coordinate specified by these
-vectors and numbers is
+In the barycentric coordinate system a point is expressed as the linear
+combination of multiple vectors. The idea is that you specify vectors $v_1$,
+$v_2$, \dots, $v_n$ and numbers $\alpha_1$, $\alpha_2$, \dots, $\alpha_n$. Then
+the barycentric coordinate specified by these vectors and numbers is
+%
\begin{align*}
- \frac{\alpha_1 v_1 + \alpha_2 v_2 + \cdots + \alpha_n v_n}{\alpha_1
- + \alpha_2 + \cdots + \alpha_n}
+ \frac{\alpha_1 v_1 + \alpha_2 v_2 + \cdots + \alpha_n v_n}{\alpha_1
+ + \alpha_2 + \cdots + \alpha_n}
\end{align*}
The |barycentric cs| allows you to specify such coordinates easily.
\begin{coordinatesystem}{barycentric}
- For this coordinate system, the \meta{coordinate specification}
- 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).
-
- The specified coordinate is now computed as follows: Each pair
- provides one vector and a number. The vector is the |center| anchor
- of the \meta{node name}. The number is the \meta{number}. Note that
- (currently) you cannot specify a different anchor, so that in order
- to use, say, the |north| anchor of a node you first have to create a
- new coordinate at this north anchor. (Using for instance
- \texttt{\string\coordinate (mynorth) at (mynode.north);}.)
-
+ For this coordinate system, the \meta{coordinate specification} 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).
+
+ The specified coordinate is now computed as follows: Each pair provides one
+ vector and a number. The vector is the |center| anchor of the \meta{node
+ name}. The number is the \meta{number}. Note that (currently) you cannot
+ specify a different anchor, so that in order to use, say, the |north|
+ anchor of a node you first have to create a new coordinate at this north
+ anchor. (Using for instance \texttt{\string\coordinate (mynorth) at
+ (mynode.north);}.)
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\coordinate (content) at (90:3cm);
@@ -342,30 +351,35 @@ The |barycentric cs| allows you to specify such coordinates easily.
\node at (barycentric cs:content=1 ,structure=0.05,form=0.05) {ASCII};
\end{tikzpicture}
\end{codeexample}
+ %
\end{coordinatesystem}
+
\subsubsection{Node Coordinate System}
\label{section-node-coordinates}
-In \pgfname\ and in \tikzname\ it is quite easy to define a node that you
-wish to reference at a later point. Once you have defined a node,
-there are different ways of referencing points of the node. To do so,
-you use the following coordinate system:
+In \pgfname\ and in \tikzname\ it is quite easy to define a node that you wish
+to reference at a later point. Once you have defined a node, there are
+different ways of referencing points of the node. To do so, you use the
+following coordinate system:
\begin{coordinatesystem}{node}
- This coordinate system is used to reference a specific point inside
- or on the border of a previously defined node. It can be used in
- different ways, so let us go over them one by one.
-
- You can use three options to specify which coordinate you mean:
- \begin{key}{/tikz/cs/name=\meta{node name}}
- Specifies the node that you wish to use to specify a coordinate.
- The \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:
+ This coordinate system is used to reference a specific point inside or on
+ the border of a previously defined node. It can be used in different ways,
+ so let us go over them one by one.
+
+ You can use three options to specify which coordinate you mean:
+ %
+ \begin{key}{/tikz/cs/name=\meta{node name}}
+ Specifies the node that you wish to use to specify a coordinate. The
+ \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:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node (shape) at (0,2) [draw] {|class Shape|};
@@ -380,12 +394,13 @@ you use the following coordinate system:
|- (0,1) -| (node cs:name=shape,anchor=south);
\end{tikzpicture}
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/cs/angle=\meta{degrees}}
- It is also possible to provide an angle \emph{instead} of an
- anchor. This coordinate refers to a point of the node's
- border where a ray shot from the center
- in the given angle hits the border. Here is an example:
+ \end{key}
+ %
+ \begin{key}{/tikz/cs/angle=\meta{degrees}}
+ It is also possible to provide an angle \emph{instead} of an anchor.
+ This coordinate refers to a point of the node's border where a ray shot
+ from the center in the given angle hits the border. Here is an example:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node (start) [draw,shape=ellipse] {start};
@@ -394,12 +409,12 @@ you use the following coordinate system:
.. controls +(\angle:1cm) and +(-1,0) .. (2.5,0);
\end{tikzpicture}
\end{codeexample}
- \end{key}
-
- 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:
+ \end{key}
+ 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:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\path (0,0) node(a) [ellipse,rotate=10,draw] {An ellipse}
@@ -408,35 +423,34 @@ you use the following coordinate system:
\end{tikzpicture}
\end{codeexample}
- \tikzname\ will be reasonably clever at determining the border points that
- you ``mean,'' but, naturally, this may fail in some situations. If
- \tikzname\ fails to determine an appropriate border point, the center will
- be used instead.
-
- Automatic computation of anchors works only with the line-to operations
- |--|, the vertical/horizontal versions \verb!|-! and \verb!-|!, and
- 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
- example:
-
+ \tikzname\ will be reasonably clever at determining the border points that
+ you ``mean'', but, naturally, this may fail in some situations. If
+ \tikzname\ fails to determine an appropriate border point, the center will
+ be used instead.
+
+ Automatic computation of anchors works only with the line-to operations
+ |--|, the vertical/horizontal versions \verb!|-! and \verb!-|!, and 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 example:
+ %
\begin{codeexample}[]
\tikz \draw (0,0) node(x) [draw] {Text}
rectangle (1,1)
(node cs:name=x) -- +(1,1);
\end{codeexample}
-Similarly, in the following examples both control points are $(1,1)$:
-
+ Similarly, in the following examples both control points are $(1,1)$:
+ %
\begin{codeexample}[]
\tikz \draw (0,0) node(x) [draw] {X}
(2,0) node(y) {Y}
@@ -444,12 +458,13 @@ Similarly, in the following examples both control points are $(1,1)$:
(node cs:name=y);
\end{codeexample}
- The implicit way of specifying the node coordinate system is to
- simply use the name of the node in parentheses as in |(a)| or to
- specify a name together with an anchor or an angle separated by a
- dot as in |(a.north)| or |(a.10)|.
+ The implicit way of specifying the node coordinate system is to simply use
+ the name of the node in parentheses as in |(a)| or to specify a name
+ together with an anchor or an angle separated by a dot as in |(a.north)| or
+ |(a.10)|.
- Here is a more complete example:
+ Here is a more complete example:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[fill=blue!20]
\draw[help lines] (-1,-2) grid (6,3);
@@ -462,17 +477,19 @@ Similarly, in the following examples both control points are $(1,1)$:
\draw[thick,blue,<->] (b) .. controls +(right:2cm) and +(down:1cm) .. (d);
\end{tikzpicture}
\end{codeexample}
+ %
\end{coordinatesystem}
-
+% -----------------------------------------------------------------------------
% 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
@@ -489,7 +506,7 @@ Similarly, in the following examples both control points are $(1,1)$:
% 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`\}}}
@@ -499,7 +516,7 @@ Similarly, in the following examples both control points are $(1,1)$:
% 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)}
@@ -508,19 +525,19 @@ Similarly, in the following examples both control points are $(1,1)$:
% 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}%
@@ -534,7 +551,7 @@ Similarly, in the following examples both control points are $(1,1)$:
% |(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
@@ -548,59 +565,62 @@ Similarly, in the following examples both control points are $(1,1)$:
% \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}
+% -----------------------------------------------------------------------------
\subsubsection{Tangent Coordinate Systems}
\begin{coordinatesystem}{tangent}
- This coordinate system, which is available only when the \tikzname\
- library |calc| is loaded, allows you to compute the point that lies
- tangent to a shape. In detail, consider a \meta{node} and a
- \meta{point}. Now, draw a straight line from the \meta{point} so
- that it ``touches'' the \meta{node} (more formally, so that it is
- \emph{tangent} to this \meta{node}). The point where the line
- touches the shape is the point referred to by the |tangent|
- 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.
- \end{key}
- \begin{key}{/tikz/cs/point=\meta{point}}
- 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}
-
- 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|
- \end{itemize}
-
+ This coordinate system, which is available only when the \tikzname\ library
+ |calc| is loaded, allows you to compute the point that lies tangent to a
+ shape. In detail, consider a \meta{node} and a \meta{point}. Now, draw a
+ straight line from the \meta{point} so that it ``touches'' the \meta{node}
+ (more formally, so that it is \emph{tangent} to this \meta{node}). The
+ point where the line touches the shape is the point referred to by the
+ |tangent| 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.
+ \end{key}
+ %
+ \begin{key}{/tikz/cs/point=\meta{point}}
+ 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}
+
+ 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|
+ \end{itemize}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -614,36 +634,31 @@ Similarly, in the following examples both control points are $(1,1)$:
\end{tikzpicture}
\end{codeexample}
- There is no implicit syntax for this 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
-their special syntax is fixed, it is possible and quite easy to define
-new explicitly named coordinate systems. For this, the following
-commands are used:
+While the set of coordinate systems that \tikzname\ can parse via their special
+syntax is fixed, it is possible and quite easy to define new explicitly named
+coordinate systems. For this, the following commands are used:
\begin{command}{\tikzdeclarecoordinatesystem\marg{name}\marg{code}}
- This command declares a new coordinate system named \meta{name} that
- can later on be used by writing
- |(|\meta{name}| cs:|\meta{arguments}|)|. When \tikzname\ encounters a coordinate
- specified in this way, the \meta{arguments} are passed to
- \meta{code} as argument |#1|.
-
- It is now the job of \meta{code} to make sense of the
- \meta{arguments}. At the end of \meta{code}, the two \TeX\ dimensions
- |\pgf@x| and |\pgf@y| should be have the $x$- and $y$-canvas
- coordinate of the coordinate.
-
- It is not necessary, but customary, to parse \meta{arguments} using
- the key-value syntax. However, you can also parse it in any way you
- like.
-
- In the following example, a coordinate system |cylindrical| is
- defined.
+ This command declares a new coordinate system named \meta{name} that can
+ later on be used by writing |(|\meta{name}| cs:|\meta{arguments}|)|. When
+ \tikzname\ encounters a coordinate specified in this way, the
+ \meta{arguments} are passed to \meta{code} as argument |#1|.
+
+ It is now the job of \meta{code} to make sense of the \meta{arguments}. At
+ the end of \meta{code}, the two \TeX\ dimensions |\pgf@x| and |\pgf@y|
+ should be have the $x$- and $y$-canvas coordinate of the coordinate.
+
+ It is not necessary, but customary, to parse \meta{arguments} using the
+ key--value syntax. However, you can also parse it in any way you like.
+
+ In the following example, a coordinate system |cylindrical| is defined.
+ %
\begin{codeexample}[]
\makeatletter
\define@key{cylindricalkeys}{angle}{\def\myangle{#1}}
@@ -660,53 +675,53 @@ commands are used:
\fill (cylindrical cs:angle=\num,radius=1,z=\num) circle (1pt);
\end{tikzpicture}
\end{codeexample}
+ %
\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.
+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.
+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$-co\-or\-di\-nate 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:
-
+ 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$-co\-or\-di\-nate 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$};
@@ -721,16 +736,16 @@ coordinate system.
\end{tikzpicture}
\end{codeexample}
- Note that in \declare{|(|\meta{c}\verb! |- !\meta{d}|)|} the
- coordinates \meta{c} and \meta{d} are \emph{not} surrounded by
- parentheses. If they need to be complicated expressions (like a
- computation using the |$|-syntax), %$
- you must surround them with braces; parentheses will then be added
- around them.
+ Note that in \declare{|(|\meta{c}\verb! |- !\meta{d}|)|} the coordinates
+ \meta{c} and \meta{d} are \emph{not} surrounded by parentheses. If they
+ need to be complicated expressions (like a computation using the
+ |$|-syntax), you must surround them with braces; parentheses will then be %$
+ added around them.
- As an example, let us specify a point that lies horizontally at the
- middle of the line from $A$ to~$B$ and vertically at the middle of
- the line from $C$ to~$D$:
+ As an example, let us specify a point that lies horizontally at the middle
+ of the line from $A$ to~$B$ and vertically at the middle of the line from
+ $C$ to~$D$:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node (A) at (0,1) {A};
@@ -742,52 +757,54 @@ coordinate system.
\draw (C) -- (D) node [midway] {x};
\node at ({$(A)!.5!(B)$} -| {$(C)!.5!(D)$}) {X};
-\end{tikzpicture}
+\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 of
- lots of very small segments such as plots or decorated paths.
+ 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 of 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:
+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 (note that this is a \emph{different} key from the |name| key, which only
+attaches a hyperlink target to a path, but does not store the path in a way the
+is useful for the intersection computation):
\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}.
+ /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.
-
+ 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);
@@ -799,22 +816,22 @@ To find the intersection of named paths, the following key is used:
\end{tikzpicture}
\end{codeexample}
-The following keys can be used in \meta{options}:
+ 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/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/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 means that the total number of intersections found
- will be stored in \meta{macro}.
-\end{key}
+ \begin{key}{/tikz/intersection/total=\meta{macro}}
+ This key means that the total number of intersections found will be
+ stored in \meta{macro}.
+ \end{key}
\begin{codeexample}[]
\begin{tikzpicture}
@@ -828,16 +845,15 @@ The following keys can be used in \meta{options}:
\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{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);
@@ -850,14 +866,14 @@ The following keys can be used in \meta{options}:
\end{tikzpicture}
\end{codeexample}
- You can also use the |...| notation of the |\foreach| statement
- inside the \meta{comma-separated list}.
+ 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:
+ 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);
@@ -869,16 +885,16 @@ The following keys can be used in \meta{options}:
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.
-
+ \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);
@@ -892,23 +908,19 @@ which should be one of the paths mentioned in the
}
\end{tikzpicture}
\end{codeexample}
-
- \end{key}
+ \end{key}
\end{key}
-
-
\subsection{Relative and Incremental Coordinates}
-
\subsubsection{Specifying Relative Coordinates}
-You can prefix coordinates by |++| to make them ``relative.'' A
-coordinate such as |++(1cm,0pt)| means ``1cm to the right of the
-previous position, making this the new current position.'' Relative
-coordinates are often useful in ``local'' contexts:
-
+You can prefix coordinates by |++| to make them ``relative''. A coordinate such
+as |++(1cm,0pt)| means ``1cm to the right of the previous position, making this
+the new current position''. Relative coordinates are often useful in ``local''
+contexts:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) -- ++(1,0) -- ++(0,1) -- ++(-1,0) -- cycle;
@@ -917,11 +929,10 @@ coordinates are often useful in ``local'' contexts:
\end{tikzpicture}
\end{codeexample}
-Instead of |++| you can also use a single |+|. This also specifies a
-relative coordinate, but it does not ``update'' the current point for
-subsequent usages of relative coordinates. Thus, you can use this
-notation to specify numerous points, all relative to the same
-``initial'' point:
+Instead of |++| you can also use a single |+|. This also specifies a relative
+coordinate, but it does not ``update'' the current point for subsequent usages
+of relative coordinates. Thus, you can use this notation to specify numerous
+points, all relative to the same ``initial'' point:
\begin{codeexample}[]
\begin{tikzpicture}
@@ -931,19 +942,17 @@ notation to specify numerous points, all relative to the same
\end{tikzpicture}
\end{codeexample}
-There is a special situation, where relative coordinates are
-interpreted differently. If you use a relative coordinate as a control
-point of a B\'ezier curve, the following rule applies: First, a relative
-first control point is taken relative to the beginning of the
-curve. Second, a relative second control point is taken relative to
-the end of the curve. Third, a relative end point of a curve is taken
-relative to the start of the curve.
-
-This special behavior makes it easy to specify that a curve should
-``leave or arrive from a certain direction'' at the start or end. In
-the following example, the curve ``leaves'' at $30^\circ$ and
-``arrives'' at $60^\circ$:
+There is a special situation, where relative coordinates are interpreted
+differently. If you use a relative coordinate as a control point of a Bézier
+curve, the following rule applies: First, a relative first control point is
+taken relative to the beginning of the curve. Second, a relative second control
+point is taken relative to the end of the curve. Third, a relative end point of
+a curve is taken relative to the start of the curve.
+This special behavior makes it easy to specify that a curve should ``leave or
+arrive from a certain direction'' at the start or end. In the following
+example, the curve ``leaves'' at $30^\circ$ and ``arrives'' at $60^\circ$:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw (1,0) .. controls +(30:1cm) and +(60:1cm) .. (3,-1);
@@ -955,27 +964,29 @@ the following example, the curve ``leaves'' at $30^\circ$ and
\subsubsection{Rotational Relative Coordinates}
-You may sometimes wish to specify points relative not only to the
-previous point, but additionally relative to the tangent entering the
-previous point. For this, the following key is useful:
+You may sometimes wish to specify points relative not only to the previous
+point, but additionally relative to the tangent entering the previous point.
+For this, the following key is useful:
\begin{key}{/tikz/turn}
- This key can be given as an option to a \meta{coordinate} as in the
- following example:
+ This key can be given as an option to a \meta{coordinate} as in the
+ following example:
+ %
\begin{codeexample}[]
-\tikz \draw (0,0) -- (1,1) -- ([turn]-45:1cm) -- ([turn]-30:1cm);
+\tikz \draw (0,0) -- (1,1) -- ([turn]-45:1cm) -- ([turn]-30:1cm);
\end{codeexample}
- The effect of this key is to locally shift the coordinate system so
- that the last point reached is at the origin and the coordinate
- system is ``turned'' so that the $x$-axis points in the direction of
- a tangent entering the last point. This means, in effect, that when
- you use polar coordinates of the form \meta{relative
- angle}|:|\meta{distance} together with the |turn| option, you
- specify a point that lies at \meta{distance} from the last point in
- the direction of the last tangent entering the last point, but with
- a rotation of \meta{relative angle}.
-
- This key also works with curves \dots
+ %
+ The effect of this key is to locally shift the coordinate system so that
+ the last point reached is at the origin and the coordinate system is
+ ``turned'' so that the $x$-axis points in the direction of a tangent
+ entering the last point. This means, in effect, that when you use polar
+ coordinates of the form \meta{relative angle}|:|\meta{distance} together
+ with the |turn| option, you specify a point that lies at \meta{distance}
+ from the last point in the direction of the last tangent entering the last
+ point, but with a rotation of \meta{relative angle}.
+
+ This key also works with curves \dots
+ %
\begin{codeexample}[]
\tikz [delta angle=30, radius=1cm]
\draw (0,0) arc [start angle=0] -- ([turn]0:1cm)
@@ -985,55 +996,58 @@ previous point. For this, the following key is useful:
\begin{codeexample}[]
\tikz \draw (0,0) to [bend left] (2,1) -- ([turn]0:1cm);
\end{codeexample}
-
- \dots and with plots \dots
+ %
+ \dots and with plots \dots
+ %
\begin{codeexample}[]
\tikz \draw plot coordinates {(0,0) (1,1) (2,0) (3,0) } -- ([turn]30:1cm);
\end{codeexample}
- Although the above examples use polar coordinates with |turn|, you
- can also use any normal coordinate. For instance, |([turn]1,1)| will
- append a line of length $\sqrt 2$ that is turns by $45^\circ$
- relative to the tangent to the last point.
+ Although the above examples use polar coordinates with |turn|, you can also
+ use any normal coordinate. For instance, |([turn]1,1)| will append a line
+ of length $\sqrt 2$ that is turns by $45^\circ$ relative to the tangent to
+ the last point.
+ %
\begin{codeexample}[]
\tikz \draw (0.5,0.5) -| (2,1) -- ([turn]1,1)
.. controls ([turn]0:1cm) .. ([turn]-90:1cm);
\end{codeexample}
+ %
\end{key}
\subsubsection{Relative Coordinates and Scopes}
\label{section-scopes-relative}
-An interesting question is, how do relative coordinates behave in the
-presence of scopes? That is, suppose we use curly braces in a path to
-make part of it ``local,'' how does that affect the current position?
-On the one hand, the current position certainly changes since the
-scope only affects options, not the path itself. On the other hand, it
-may be useful to ``temporarily escape'' from the updating of the
-current point.
+
+An interesting question is, how do relative coordinates behave in the presence
+of scopes? That is, suppose we use curly braces in a path to make part of it
+``local'', how does that affect the current position? On the one hand, the
+current position certainly changes since the scope only affects options, not
+the path itself. On the other hand, it may be useful to ``temporarily escape''
+from the updating of the current point.
Since both interpretations of how the current point and scopes should
-``interact'' are useful, there is a (local!) option that allows you to
-decide which you need.
-
-\begin{key}{/tikz/current point is local=\opt{\meta{boolean}} (initially
- false)}
- Normally, the scope path operation has no effect on the current
- point. That is, curly braces on a path have no effect on the current
- position:
+``interact'' are useful, there is a (local!) option that allows you to decide
+which you need.
+
+\begin{key}{/tikz/current point is local=\opt{\meta{boolean}} (initially false)}
+ Normally, the scope path operation has no effect on the current point. That
+ is, curly braces on a path have no effect on the current position:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) -- ++(1,0) -- ++(0,1) -- ++(-1,0);
\draw[red] (2,0) -- ++(1,0) { -- ++(0,1) } -- ++(-1,0);
\end{tikzpicture}
\end{codeexample}
- If you set this key to |true|, this behaviour changes. In this case,
- at the end of a group created on a path, the last current position
- reverts to whatever value it had at the beginning of the scope. More
- precisely, when \tikzname\ encounters |}| on a path, it checks
- whether at this particular moment the key is set to |true|. If so,
- the current position reverts to the value is had when the matching
- |{| was read.
+ %
+ If you set this key to |true|, this behaviour changes. In this case, at the
+ end of a group created on a path, the last current position reverts to
+ whatever value it had at the beginning of the scope. More precisely, when
+ \tikzname\ encounters |}| on a path, it checks whether at this particular
+ moment the key is set to |true|. If so, the current position reverts to the
+ value is had when the matching |{| was read.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) -- ++(1,0) -- ++(0,1) -- ++(-1,0);
@@ -1041,8 +1055,9 @@ decide which you need.
{ [current point is local] -- ++(0,1) } -- ++(-1,0);
\end{tikzpicture}
\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.
+ %
+ 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}
@@ -1050,16 +1065,15 @@ decide which you need.
\label{tikz-lib-calc}
\begin{tikzlibrary}{calc}
- You need to load this library in order to use the coordinate
- calculation functions described in the present section.
+ You need to load this library in order to use the coordinate calculation
+ functions described in the present section.
\end{tikzlibrary}
-
-It is possible to do some basic calculations that involve
-coordinates. In essence, you can add and subtract coordinates, scale
-them, compute midpoints, and do projections. For instance,
-|($(a) + 1/3*(1cm,0)$)| is the coordinate that is $1/3 \text{cm}$ to the right
-of the point |a|:
+It is possible to do some basic calculations that involve coordinates. In
+essence, you can add and subtract coordinates, scale them, compute midpoints,
+and do projections. For instance, |($(a) + 1/3*(1cm,0)$)| is the coordinate
+that is $1/3 \text{cm}$ to the right of the point |a|:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -1070,13 +1084,12 @@ of the point |a|:
\end{codeexample}
-
\subsubsection{The General Syntax}
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 %$
@@ -1084,20 +1097,20 @@ indicate that a ``mathematical computation'' is involved. However, the |$| %$
has no other effect, in particular, no mathematical text is typeset.
The \meta{coordinate computation} has the following structure:
+%
\begin{enumerate}
-\item
- It starts with
- \begin{quote}
- \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}}
- \end{quote}
-\item
- This is once more followed by |+| or |-| and another of the above
- modified coordinate; and so on.
+ \item It starts with
+ %
+ \begin{quote}
+ \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}}
+ \end{quote}
+ \item This is once more followed by |+| or |-| and another of the above
+ modified coordinate; and so on.
\end{enumerate}
In the following, the syntax of factors and of the different modifiers
@@ -1106,29 +1119,28 @@ is explained in detail.
\subsubsection{The Syntax of Factors}
-The \meta{factor}s are optional and detected
-by checking whether the \meta{coordinate computation} starts with a
-|(|. Also, after each $\pm$ a \meta{factor} is present if, and only
-if, the |+| or |-| sign is not directly followed by~|(|.
-
-If a \meta{factor} is present, it is evaluated using the
-|\pgfmathparse| macro. This means that you can use pretty complicated
-computations inside a factor. A \meta{factor} may even contain opening
-parentheses, which creates a complication: How does \tikzname\ know
-where a \meta{factor} ends and where a coordinate starts? For
-instance, if the beginning of a \meta{coordinate computation} is
-|2*(3+4|\dots, it is not clear whether |3+4| is part of a
-\meta{coordinate} or part of a \meta{factor}. Because of this, the
-following rule is used: Once it has been determined, that a
-\meta{factor} is present, in principle, the \meta{factor} contains
-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} in curly braces. This can
-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}:
+The \meta{factor}s are optional and detected by checking whether the
+\meta{coordinate computation} starts with a |(|. Also, after each $\pm$ a
+\meta{factor} is present if, and only if, the |+| or |-| sign is not directly
+followed by~|(|.
+
+If a \meta{factor} is present, it is evaluated using the |\pgfmathparse| macro.
+This means that you can use pretty complicated computations inside a factor. A
+\meta{factor} may even contain opening parentheses, which creates a
+complication: How does \tikzname\ know where a \meta{factor} ends and where a
+coordinate starts? For instance, if the beginning of a \meta{coordinate
+computation} is |2*(3+4|\dots, it is not clear whether |3+4| is part of a
+\meta{coordinate} or part of a \meta{factor}. Because of this, the following
+rule is used: Once it has been determined, that a \meta{factor} is present, in
+principle, the \meta{factor} contains 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} in curly braces. This can 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}:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -1141,33 +1153,33 @@ exactly one \meta{factor} and one \meta{coordinate}:
\end{codeexample}
-
\subsubsection{The Syntax of Partway Modifiers}
-A \meta{coordinate} can be followed by different \meta{modifiers}. The
-first kind of modifier is the \emph{partway modifier}. The syntax
-(which is loosely inspired by Uwe Kern's |xcolor| package) is the
-following:
+A \meta{coordinate} can be followed by different \meta{modifiers}. The first
+kind of modifier is the \emph{partway modifier}. The syntax (which is loosely
+inspired by Uwe Kern's |xcolor| package) is the following:
+%
\begin{quote}
- \meta{coordinate}\declare{|!|\meta{number}|!|\opt{\meta{angle}|:|}\meta{second coordinate}}
+ \meta{coordinate}\declare{|!|\meta{number}|!|\opt{\meta{angle}|:|}\meta{second coordinate}}
\end{quote}
+%
One could write for instance
+%
\begin{codeexample}[code only]
(1,2)!.75!(3,4)
\end{codeexample}
-The meaning of this is: ``Use the coordinate that is three quarters on
-the way from |(1,2)| to |(3,4)|.'' In general, \meta{coordinate
- x}|!|\meta{number}|!|\meta{coordinate y} yields the coordinate
-$(1-\meta{number})\meta{coordinate x} + \meta{number} \meta{coordinate
- y}$. Note that this is a bit different from the way the
-\meta{number} is interpreted in the |xcolor| package: First, you use a
-factor between $0$ and $1$, not a percentage, and, second, as the
-\meta{number} approaches $1$, we approach the second coordinate, not
-the first. It is permissible to use a \meta{number} that is smaller
-than $0$ or larger than $1$. The \meta{number} is evaluated using the
-|\pgfmathparse| command and, thus, it can involve complicated
-computations.
-
+%
+The meaning of this is: ``Use the coordinate that is three quarters on the way
+from |(1,2)| to |(3,4)|.'' In general, \meta{coordinate
+x}|!|\meta{number}|!|\meta{coordinate y} yields the coordinate $(1 -
+\meta{number})\meta{coordinate x} + \meta{number} \meta{coordinate y}$. Note
+that this is a bit different from the way the \meta{number} is interpreted in
+the |xcolor| package: First, you use a factor between $0$ and $1$, not a
+percentage, and, second, as the \meta{number} approaches $1$, we approach the
+second coordinate, not the first. It is permissible to use a \meta{number} that
+is smaller than $0$ or larger than $1$. The \meta{number} is evaluated using
+the |\pgfmathparse| command and, thus, it can involve complicated computations.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -1179,16 +1191,16 @@ computations.
\end{tikzpicture}
\end{codeexample}
-The \meta{second coordinate} may be prefixed by an \meta{angle},
-separated with a colon, as in |(1,1)!.5!60:(2,2)|. The general meaning
-of \meta{a}|!|\meta{factor}|!|\meta{angle}|:|\meta{b} is ``First,
-consider the line from \meta{a} to \meta{b}. Then rotate this line by
-\meta{angle} \emph{around the point \meta{a}}. Then the two endpoints
-of this line will be \meta{a} and some point \meta{c}. Use this point
-\meta{c} for the subsequent computation, namely the partway
-computation.''
+The \meta{second coordinate} may be prefixed by an \meta{angle}, separated with
+a colon, as in |(1,1)!.5!60:(2,2)|. The general meaning of
+\meta{a}|!|\meta{factor}|!|\meta{angle}|:|\meta{b} is: ``First, consider the
+line from \meta{a} to \meta{b}. Then rotate this line by \meta{angle}
+\emph{around the point \meta{a}}. Then the two endpoints of this line will be
+\meta{a} and some point \meta{c}. Use this point \meta{c} for the subsequent
+computation, namely the partway computation.''
Here are two examples:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,3);
@@ -1206,7 +1218,6 @@ Here are two examples:
\end{tikzpicture}
\end{codeexample}
-
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (4,4);
@@ -1216,10 +1227,9 @@ Here are two examples:
\end{tikzpicture}
\end{codeexample}
-
-You can repeatedly apply modifiers. That is, after any modifier
-you can add another (possibly different) modifier.
-
+You can repeatedly apply modifiers. That is, after any modifier you can add
+another (possibly different) modifier.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -1233,16 +1243,18 @@ you can add another (possibly different) modifier.
\subsubsection{The Syntax of Distance Modifiers}
-A \emph{distance modifier} has nearly the same syntax as a partway
-modifier, only you use a \meta{dimension} (something like |1cm|)
-instead of a \meta{factor} (something like |0.5|):
+A \emph{distance modifier} has nearly the same syntax as a partway modifier,
+only you use a \meta{dimension} (something like |1cm|) instead of a
+\meta{factor} (something like |0.5|):
+%
\begin{quote}
- \meta{coordinate}\declare{|!|\meta{dimension}|!|\opt{\meta{angle}|:|}\meta{second coordinate}}
+ \meta{coordinate}\declare{|!|\meta{dimension}|!|\opt{\meta{angle}|:|}\meta{second coordinate}}
\end{quote}
When you write \meta{a}|!|\meta{dimension}|!|\meta{b}, this means the
-following: Use the point that is distanced \meta{dimension} from
-\meta{a} on the straight line from \meta{a} to \meta{b}. Here is an example:
+following: Use the point that is distanced \meta{dimension} from \meta{a} on
+the straight line from \meta{a} to \meta{b}. Here is an example:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -1254,15 +1266,15 @@ following: Use the point that is distanced \meta{dimension} from
\end{tikzpicture}
\end{codeexample}
-As before, if you use a \meta{angle}, the \meta{second coordinate} is
-rotated by this much around the \meta{coordinate} before it is used.
+As before, if you use a \meta{angle}, the \meta{second coordinate} is rotated
+by this much around the \meta{coordinate} before it is used.
-The combination of an \meta{angle} of |90| degrees with a distance can
-be used to ``offset'' a point relative to a line. Suppose, for
-instance, that you have computed a point |(c)| that lies somewhere on
-a line from |(a)| to~|(b)| and you now wish to offset this point by
-|1cm| so that the distance from this offset point to the line is
-|1cm|. This can be achieved as follows:
+The combination of an \meta{angle} of |90| degrees with a distance can be used
+to ``offset'' a point relative to a line. Suppose, for instance, that you have
+computed a point |(c)| that lies somewhere on a line from |(a)| to~|(b)| and
+you now wish to offset this point by |1cm| so that the distance from this
+offset point to the line is |1cm|. This can be achieved as follows:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -1280,26 +1292,27 @@ a line from |(a)| to~|(b)| and you now wish to offset this point by
\end{codeexample}
-
\subsubsection{The Syntax of Projection Modifiers}
-The projection modifier is also similar to the above modifiers: It also
-gives a point on a line from the \meta{coordinate} to the \meta{second
- coordinate}. However, the \meta{number} or \meta{dimension} is replaced by a
+The projection modifier is also similar to the above modifiers: It also gives a
+point on a line from the \meta{coordinate} to the \meta{second coordinate}.
+However, the \meta{number} or \meta{dimension} is replaced by a
\meta{projection coordinate}:
+%
\begin{quote}
- \meta{coordinate}\declare{|!|\meta{projection coordinate}|!|\opt{\meta{angle}|:|}\meta{second coordinate}}
+ \meta{coordinate}\declare{|!|\meta{projection coordinate}|!|\opt{\meta{angle}|:|}\meta{second coordinate}}
\end{quote}
Here is an example:
+%
\begin{codeexample}[code only]
(1,2)!(0,5)!(3,4)
\end{codeexample}
-The effect is the following: We project the \meta{projection
- coordinate} orthogonally onto the line from \meta{coordinate} to
-\meta{second coordinate}. This makes it easy to compute projected
-points:
+The effect is the following: We project the \meta{projection coordinate}
+orthogonally onto the line from \meta{coordinate} to \meta{second coordinate}.
+This makes it easy to compute projected 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 5c1276b02cb..1600e6f5378 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
@@ -7,17 +7,15 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\section{Decorated Paths}
+\section{Decorated Paths}
\label{section-tikz-decorations}
-
\subsection{Overview}
-Decorations are a general concept to make (sub)paths ``more
-interesting.'' Before we have a look at the details, let us have a
-look at some examples:
-
+Decorations are a general concept to make (sub)paths ``more interesting''.
+Before we have a look at the details, let us have a look at some examples:
+%
\begin{codeexample}[]
\begin{tikzpicture}[thick]
\draw (0,3) -- (3,3);
@@ -55,103 +53,103 @@ look at some examples:
\end{tikzpicture}
\end{codeexample}
-The general idea of decorations is the following: First, you construct
-a path using the usual path construction commands. The resulting path
-is, in essence, a series of straight and curved lines. Instead of
-directly using this path for filling or drawing, you can then specify
-that it should form the basis for a decoration. In this case,
-depending on which decoration you use, a new path is constructed
-``along'' the path you specified. For instance, with the |zigzag|
-decoration, the new path is a zigzagging line that goes along the old
-path.
-
-Let us have a look at an example: In the first picture, we see a path
-that consists of a line, an arc, and a line. In the second picture,
-this path has been used as the basis of a decoration.
-
+The general idea of decorations is the following: First, you construct a path
+using the usual path construction commands. The resulting path is, in essence,
+a series of straight and curved lines. Instead of directly using this path for
+filling or drawing, you can then specify that it should form the basis for a
+decoration. In this case, depending on which decoration you use, a new path is
+constructed ``along'' the path you specified. For instance, with the |zigzag|
+decoration, the new path is a zigzagging line that goes along the old path.
+
+Let us have a look at an example: In the first picture, we see a path that
+consists of a line, an arc, and a line. In the second picture, this path has
+been used as the basis of a decoration.
+%
\begin{codeexample}[]
\tikz \fill
[fill=blue!20,draw=blue,thick] (0,0) -- (2,1) arc (90:-90:.5) -- cycle;
\end{codeexample}
+%
\begin{codeexample}[]
\tikz \fill [decorate,decoration={zigzag}]
[fill=blue!20,draw=blue,thick] (0,0) -- (2,1) arc (90:-90:.5) -- cycle;
\end{codeexample}
-It is also possible to decorate only a subpath (the exact syntax will
-be explained later in this section).
+It is also possible to decorate only a subpath (the exact syntax will be
+explained later in this section).
+%
\begin{codeexample}[]
\tikz \fill [decoration={zigzag}]
[fill=blue!20,draw=blue,thick] (0,0) -- (2,1)
decorate { arc (90:-90:.5) } -- cycle;
\end{codeexample}
-The |zigzag| decoration will be called a \emph{path
- morphing} decoration because it morphs a path into a different, but
-topologically equivalent path. Not all decorations are path
-morphing; rather there are three kinds of decorations.
-
+The |zigzag| decoration will be called a \emph{path morphing} decoration
+because it morphs a path into a different, but topologically equivalent path.
+Not all decorations are path morphing; rather there are three kinds of
+decorations.
\begin{enumerate}
-\item The just-mentioned \emph{path morphing} decorations morph the
- 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.
-
- 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
- by a path consisting of a sequence of crosses. Note how in the
- following example filling the path has no effect since the path
- consist only of (numerous) unconnected straight line subpaths:
+ \item The just-mentioned \emph{path morphing} decorations morph the 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.
+
+ 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 by a path consisting
+ of a sequence of crosses. Note how in the following example filling the
+ path has no effect since the path consist only of (numerous)
+ unconnected straight line subpaths:
+ %
\begin{codeexample}[]
\tikz \fill [decorate,decoration={crosses}]
[fill=blue!20,draw=blue,thick] (0,0) -- (2,1) arc (90:-90:.5) -- cycle;
\end{codeexample}
- 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
- \emph{side effects}. For instance, they might ``write some text''
- along the (removed) path or they might place nodes along this
- path. Note that for such decorations the path usage command for the
- main path have no influence on how the decoration looks like.
-
+ 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 \emph{side
+ effects}. For instance, they might ``write some text'' along the
+ (removed) path or they might place nodes along this path. Note that for
+ such decorations the path usage command for the main path have no
+ influence on how the decoration looks like.
+ %
\begin{codeexample}[]
\tikz \fill [decorate,decoration={text along path,
text=This is a text along a path. Note how the path is lost.}]
[fill=blue!20,draw=blue,thick] (0,0) -- (2,1) arc (90:-90:.5) -- cycle;
\end{codeexample}
+ %
\end{enumerate}
Decorations are defined in different decoration libraries, see
-Section~\ref{section-library-decorations} for details. It is also
-possible to define your own decorations, see
-Section~\ref{section-base-decorations}, but you need to use the
-\pgfname\ basic layer and a bit of theory is involved.
-
-Decorations can be used to decorate already decorated paths. In the
-following three graphics, we start with a simple path, then decorate
-it once, and then decorate the decorated path once more.
+Section~\ref{section-library-decorations} for details. It is also possible to
+define your own decorations, see Section~\ref{section-base-decorations}, but
+you need to use the \pgfname\ basic layer and a bit of theory is involved.
+Decorations can be used to decorate already decorated paths. In the following
+three graphics, we start with a simple path, then decorate it once, and then
+decorate the decorated path once more.
+%
\begin{codeexample}[]
\tikz \fill [fill=blue!20,draw=blue,thick]
(0,0) rectangle (3,2);
\end{codeexample}
+%
\begin{codeexample}[]
\tikz \fill [fill=blue!20,draw=blue,thick]
decorate[decoration={zigzag,segment length=10mm,amplitude=2.5mm}]
{ (0,0) rectangle (3,2) };
\end{codeexample}
+%
\begin{codeexample}[]
\tikz \fill [fill=blue!20,draw=blue,thick]
decorate[decoration={crosses,segment length=2mm}] {
@@ -161,37 +159,34 @@ it once, and then decorate the decorated path once more.
};
\end{codeexample}
-One final word of warning: Decorations can be pretty slow to
-typeset and they can be inaccurate. The reason is that \pgfname\ has
-to a \emph{lot} of rather difficult computations in the background and
-\TeX\ is not very good at doing math. Decorations are fastest when
-applied to straight line segments, but even then they are much slower
-than other alternatives. For instance, the |ticks| decoration can be
-simulated by clever use of a dashing pattern and the dashing pattern
-will literally be thousands of times faster to typeset. However, for
+One final word of warning: Decorations can be pretty slow to typeset and they
+can be inaccurate. The reason is that \pgfname\ has to a \emph{lot} of rather
+difficult computations in the background and \TeX\ is not very good at doing
+math. Decorations are fastest when applied to straight line segments, but even
+then they are much slower than other alternatives. For instance, the |ticks|
+decoration can be simulated by clever use of a dashing pattern and the dashing
+pattern will literally be thousands of times faster to typeset. However, for
most decorations there are no real alternatives.
\begin{tikzlibrary}{decorations}
- In order to use decorations, you first have to load a decoration
- library. This |decoration| library defines the basic options
- described in the following, but it does not define any new
- decorations. This is done by libraries like
- |decorations.text|. Since these more specialized libraries include
- the |decoration| library automatically, you usually do not have to
- bother about it.
+ In order to use decorations, you first have to load a decoration library.
+ This |decoration| library defines the basic options described in the
+ following, but it does not define any new decorations. This is done by
+ libraries like |decorations.text|. Since these more specialized libraries
+ include the |decoration| library automatically, you usually do not have to
+ bother about it.
\end{tikzlibrary}
-
\subsection{Decorating a Subpath Using the Decorate Path Command}
-The most general way to decorate a (sub)path is the following path
-command.
+The most general way to decorate a (sub)path is the following path command.
\begin{pathoperation}{decorate}{\opt{\oarg{options}}\marg{subpath}}
- This path operation causes the \meta{subpath} to be
- decorated using the current decoration. Depending on the decoration,
- this may or may not extend the current path.
+ This path operation causes the \meta{subpath} to be decorated using the
+ current decoration. Depending on the decoration, this may or may not extend
+ the current path.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
@@ -199,16 +194,17 @@ command.
{ (0,0) .. controls (0,2) and (3,0) .. (3,2) |- (0,0) };
\end{tikzpicture}
\end{codeexample}
- The path can include straight lines, curves,
- rectangles, arcs, circles, ellipses, and even already decorated
- paths (that is, you can nest applications of the |decorate| path
- command, see below).
+ %
+ The path can include straight lines, curves, rectangles, arcs, circles,
+ ellipses, and even already decorated paths (that is, you can nest
+ applications of the |decorate| path command, see below).
- Due to the limits on the precision in \TeX, some inaccuracies in
- positioning when crossing input segment boundaries may occasionally be
- found.
+ Due to the limits on the precision in \TeX, some inaccuracies in
+ positioning when crossing input segment boundaries may occasionally be
+ found.
- You can use nodes normally inside the \meta{subpath}.
+ You can use nodes normally inside the \meta{subpath}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
@@ -219,21 +215,21 @@ command.
\end{tikzpicture}
\end{codeexample}
- The following key is used to select the decoration and also to
- select further ``rendering options'' for the decoration.
-
- \begin{key}{/pgf/decoration=\meta{decoration options}}
- \keyalias{tikz}
- This option is used to specify which decoration is used and how it
- will look like. Note that this key will \emph{not} cause any
- decorations to be applied, immediately. It takes the |decorate| path
- command or the |decorate| option to actually decorate a path. The
- |decoration| option is only used to specify which decoration should
- be used, in principle. You can also use this option at the
- beginning of a picture or a scope to specify the decoration to be
- used with each invocation of the |decorate| path
- command. Naturally, any local options of the |decorate| path
- command override these ``global'' options.
+ The following key is used to select the decoration and also to select
+ further ``rendering options'' for the decoration.
+
+ \begin{key}{/pgf/decoration=\meta{decoration options}}
+ \keyalias{tikz}
+ This option is used to specify which decoration is used and how it will
+ look like. Note that this key will \emph{not} cause any decorations to
+ be applied, immediately. It takes the |decorate| path command or the
+ |decorate| option to actually decorate a path. The |decoration| option
+ is only used to specify which decoration should be used, in principle.
+ You can also use this option at the beginning of a picture or a scope
+ to specify the decoration to be used with each invocation of the
+ |decorate| path command. Naturally, any local options of the |decorate|
+ path command override these ``global'' options.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=zigzag]
\draw decorate {(0,0) -- (3,2)};
@@ -241,21 +237,23 @@ command.
\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 strongly depend 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.
+ 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 strongly
+ depend 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}
\draw [help lines] grid (3,2);
@@ -263,9 +261,11 @@ command.
{ (0,0) .. controls (0,2) and (3,0) .. (3,2) };
\end{tikzpicture}
\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:
+ %
+ Since this option is used so often, you can also leave out the
+ |name=| part. Thus, the above example can be rewritten more
+ succinctly:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] grid (3,2);
@@ -273,21 +273,22 @@ command.
{ (0,0) .. controls (0,2) and (3,0) .. (3,2) };
\end{tikzpicture}
\end{codeexample}
- In general, when \meta{decoration options} are parsed, for each
- unknown key it is checked whether that key happens to be a
- (meta-)decoration and, if so, the |name| option is executed for
- this key.
+ %
+ In general, when \meta{decoration options} are parsed, for each
+ unknown key it is checked whether that key happens to be a
+ (meta-)decoration and, if so, the |name| option is executed for
+ this key.
+ \end{key}
+
+ Further options allow you to adjust the position of decorations
+ relative to the to-be-decorated path. See
+ Section~\ref{section-decorations-adjust} below for details.
\end{key}
- Further options allow you to adjust the position of decorations
- relative to the to-be-decorated path. See
- Section~\ref{section-decorations-adjust} below for details.
- \end{key}
-
- 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.
-
+ 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}]
@@ -296,14 +297,15 @@ command.
\end{tikzpicture}
\end{codeexample}
- It is permissible to nest |decorate| commands. In this case, the
- path resulting from the first decoration process is used as the
- to-be-decorated path for the second decoration process. This is
- especially useful for drawing fractals. The |Koch snowflake|
- 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.
+ It is permissible to nest |decorate| commands. In this case, the path
+ resulting from the first decoration process is used as the to-be-decorated
+ path for the second decoration process. This is especially useful for
+ drawing fractals. The |Koch snowflake| 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=Koch snowflake,draw=blue,fill=blue!20,thick]
\filldraw (0,0) -- ++(60:1) -- ++(-60:1) -- cycle ;
@@ -311,34 +313,34 @@ command.
\filldraw decorate{ decorate{ (0,-2.5) -- ++(60:1) -- ++(-60:1) -- cycle }};
\end{tikzpicture}
\end{codeexample}
+ %
\end{pathoperation}
-
\subsection{Decorating a Complete Path}
-You may sometimes wish to decorate a path over whose construction you
-have no control. For instance, the path of the background of a node is
-created without having a chance to issue a |decorate| path
-command. In such cases you can use the following option, which allows
-you to decorate a path ``after the fact.''
+You may sometimes wish to decorate a path over whose construction you have no
+control. For instance, the path of the background of a node is created without
+having a chance to issue a |decorate| path command. In such cases you can use
+the following option, which allows you to decorate a path ``after the fact''.
\begin{key}{/tikz/decorate=\opt{\meta{boolean}} (default true)}
- When this key is set, the whole path is decorated after it has been
- finished. The decoration used for decorating the path is set via the
- |decoration| way, in exactly the same way as for the |decorate| path
- command. Indeed, the following two commands have the same effect:
- \begin{enumerate}
- \item |\path decorate[|\meta{options}|] {|\meta{path}|};|
- \item |\path [decorate,|\meta{options}|] |\meta{path}|;|
- \end{enumerate}
- The main use or the |decorate| option is the you can also use it
- with the nodes. It then causes the background path of the node to be
- decorated. Note that you can decorate a background path only once in
- this manner. That is, in contrast to the |decorate| path command you
- cannot apply this option twice (this would just set it to |true|,
- once more).
-
+ When this key is set, the whole path is decorated after it has been
+ finished. The decoration used for decorating the path is set via the
+ |decoration| way, in exactly the same way as for the |decorate| path
+ command. Indeed, the following two commands have the same effect:
+ %
+ \begin{enumerate}
+ \item |\path decorate[|\meta{options}|] {|\meta{path}|};|
+ \item |\path [decorate,|\meta{options}|] |\meta{path}|;|
+ \end{enumerate}
+ %
+ The main use or the |decorate| option is the you can also use it with the
+ nodes. It then causes the background path of the node to be decorated. Note
+ that you can decorate a background path only once in this manner. That is,
+ in contrast to the |decorate| path command you cannot apply this option
+ twice (this would just set it to |true|, once more).
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=zigzag]
\draw [help lines] (0,0) grid (3,5);
@@ -352,12 +354,12 @@ you to decorate a path ``after the fact.''
\end{tikzpicture}
\end{codeexample}
- In the last example, the |text along path| decoration removes the
- path. In such cases it is useful to use a pre- or postaction to
- 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.
+ In the last example, the |text along path| decoration removes the path. In
+ such cases it is useful to use a pre- or postaction to 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[decoration=zigzag]
\node at (1.5,1) [inner sep=6mm,fill=red!20,ellipse,
@@ -365,8 +367,10 @@ you to decorate a path ``after the fact.''
{text along path,text={This is getting silly}}}] {Ellipse};
\end{tikzpicture}
\end{codeexample}
- Here is more useful example, where a postaction is used to add the
- path after the main path has been drawn.
+ %
+ Here is more useful example, where a postaction is used to add the path
+ after the main path has been drawn.
+ %
% \catcode`\|12 % !?
\begin{codeexample}[]
\begin{tikzpicture}
@@ -377,28 +381,28 @@ you to decorate a path ``after the fact.''
(0,1) arc (180:-180:1.5cm and 1cm);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\subsection{Adjusting Decorations}
-
\label{section-decorations-adjust}
\subsubsection{Positioning Decorations Relative to the To-Be-Decorate Path}
-The following option, which are only available with \tikzname, allow
-you to modify the positioning of decorations relative to the
-to-be-decorated path.
+The following option, which are only available with \tikzname, allow you to
+modify the positioning of decorations relative to the to-be-decorated path.
\begin{key}{/pgf/decoration/raise=\meta{dimension} (initially 0pt)}
- The segments of the decoration are raised by \meta{dimension}
- relative to the to-be-decorated path. More precisely, the segments
- of the path are offset by this much ``to the left'' of the path as
- we travel along the path. This raising is done after and in addition
- to any transformations set using the |transform| option (see below).
-
- A negative \meta{dimension} will offset the decoration ``to the
- right'' of the to-be-decorated path.
+ The segments of the decoration are raised by \meta{dimension} relative to
+ the to-be-decorated path. More precisely, the segments of the path are
+ offset by this much ``to the left'' of the path as we travel along the
+ path. This raising is done after and in addition to any transformations set
+ using the |transform| option (see below).
+
+ A negative \meta{dimension} will offset the decoration ``to the right'' of
+ the to-be-decorated path.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -410,12 +414,14 @@ to-be-decorated path.
{ (0,0) -- (1,1) arc (90:0:2 and 1) };
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/pgf/decoration/mirror=\opt{\meta{boolean}}}
- Causes the segments of the decoration to be mirrored along the
- to-be-decorated path. This is done after and in addition to any
- transformations set using the |transform| and/or |raise| options.
+ Causes the segments of the decoration to be mirrored along the
+ to-be-decorated path. This is done after and in addition to any
+ transformations set using the |transform| and/or |raise| options.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node (a) {A};
@@ -426,18 +432,19 @@ to-be-decorated path.
\draw[decorate,decoration={brace,mirror,raise=5pt},blue] (a) -- (b);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\begin{key}{/pgf/decoration/transform=\meta{transformations}}
- This key allows you to specify general \meta{transformations} to be
- applied to the segments of a decoration. These transformations are
- applied before and independently of |raise| and |mirror|
- transformations. The \meta{transformations} should be normal
- \tikzname\ transformations like |shift| or |rotate|.
-
- In the following example the |shift only| transformation is used to
- make sure that the crosses are \emph{not} sloped along the path.
+ This key allows you to specify general \meta{transformations} to be applied
+ to the segments of a decoration. These transformations are applied before
+ and independently of |raise| and |mirror| transformations. The
+ \meta{transformations} should be normal \tikzname\ transformations like
+ |shift| or |rotate|.
+
+ In the following example the |shift only| transformation is used to make
+ sure that the crosses are \emph{not} sloped along the path.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -448,36 +455,39 @@ to-be-decorated path.
{ (0,0) -- (1,1) arc (90:0:2 and 1) };
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\subsubsection{Starting and Ending Decorations Early or Late}
-You sometimes may wish to ``end'' a decoration a bit early on the
-path. For instance, you might wish a |snake| decoration to stop 5mm
-before the end of the path and to continue in a straight line. There
-are different ways of achieving this effect, but the easiest may be
-the |pre| and |post| options, which only have an effect in
-\tikzname. Note, however, that they can only be used with decorations,
-not with meta-decorations.
+You sometimes may wish to ``end'' a decoration a bit early on the path. For
+instance, you might wish a |snake| decoration to stop 5mm before the end of the
+path and to continue in a straight line. There are different ways of achieving
+this effect, but the easiest may be the |pre| and |post| options, which only
+have an effect in \tikzname. Note, however, that they can only be used with
+decorations, not with meta-decorations.
\begin{key}{/pgf/decoration/pre=\meta{decoration} (initially lineto)}
- This key sets a decoration that should be used before the main
- decoration starts. The \meta{decoration} will be used for a length
- of |pre length|, which |0pt| by default. Thus, for the |pre| option
- to have any effect, you also need to set the |pre length| option.
+ This key sets a decoration that should be used before the main decoration
+ starts. The \meta{decoration} will be used for a length of |pre length|,
+ which |0pt| by default. Thus, for the |pre| option to have any effect, you
+ also need to set the |pre length| option.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\tikz [decoration={zigzag,pre=lineto,pre length=1cm}]
\draw [decorate] (0,0) -- (2,1) arc (90:0:1);
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\tikz [decoration={zigzag,pre=moveto,pre length=1cm}]
\draw [decorate] (0,0) -- (2,1) arc (90:0:1);
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\tikz [decoration={zigzag,pre=crosses,pre length=1cm}]
@@ -485,43 +495,43 @@ not with meta-decorations.
\end{tikzpicture}
\end{codeexample}
- 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.
+ 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\tikz [decoration={zigzag,pre length=3cm}]
\draw [decorate] (0,0) -- (2,1) arc (90:0:1);
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\tikz [decoration={zigzag,pre=curveto,pre length=3cm}]
\draw [decorate] (0,0) -- (2,1) arc (90:0:1);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/pgf/decoration/pre length=\meta{dimension} (initially 0pt)}
- This key sets the distance along which the pre-decoration should be
- used. If you do not need/wish a pre-decoration, set this key to
- |0pt| (exactly this string, not just to something that evaluates to
- the same things such as |0cm|).
+ This key sets the distance along which the pre-decoration should be used.
+ If you do not need/wish a pre-decoration, set this key to |0pt| (exactly
+ this string, not just to something that evaluates to the same things such
+ as |0cm|).
\end{key}
-\begin{key}{/pgf/decorations/post=\meta{decoration} (initially
- lineto)}
- Works like |pre|, only for the end of the decoration.
+\begin{key}{/pgf/decorations/post=\meta{decoration} (initially lineto)}
+ 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.
+\begin{key}{/pgf/decorations/post length=\meta{dimension} (initially 0pt)}
+ 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:
-
+%
\begin{codeexample}[]
\begin{tikzpicture}
[decoration=snake,
@@ -532,7 +542,3 @@ Here is a typical example that shows how these keys can be used:
\draw[->,decorate,line around=1cm] (0,-1cm) -- ++(3,0);
\end{tikzpicture}
\end{codeexample}
-
-
-
-\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 48a2f06a467..607a55fb434 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
@@ -7,157 +7,155 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Design Principles}
-This section describes the design principles behind the \tikzname\
-frontend, where \tikzname\ means ``\tikzname\ ist \emph{kein}
-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
+This section describes the design principles behind the \tikzname\ frontend,
+where \tikzname\ means ``\tikzname\ ist \emph{kein} 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.
-The commands and syntax of \tikzname\ were influenced by several
-sources. The basic command names and the notion of path operations is
-taken from \textsc{metafont}, the option mechanism comes from
-\textsc{pstricks}, the notion of styles is reminiscent of
-\textsc{svg}, the graph syntax is taken from \textsc{graphviz}. To make it
-all work together, some compromises were necessary. I also added some
-ideas of my own, like coordinate transformations.
+The commands and syntax of \tikzname\ were influenced by several sources. The
+basic command names and the notion of path operations is taken from
+\textsc{metafont}, the option mechanism comes from \textsc{pstricks}, the
+notion of styles is reminiscent of \textsc{svg}, the graph syntax is taken from
+\textsc{graphviz}. To make it all work together, some compromises were
+necessary. I also added some ideas of my own, like coordinate transformations.
The following basic design principles underlie \tikzname:
+%
\begin{enumerate}
-\item Special syntax for specifying points.
-\item Special syntax for path specifications.
-\item Actions on paths.
-\item Key-value syntax for graphic parameters.
-\item Special syntax for nodes.
-\item Special syntax for trees.
-\item Special syntax for graphs.
-\item Grouping of graphic parameters.
-\item Coordinate transformation system.
+ \item Special syntax for specifying points.
+ \item Special syntax for path specifications.
+ \item Actions on paths.
+ \item Key--value syntax for graphic parameters.
+ \item Special syntax for nodes.
+ \item Special syntax for trees.
+ \item Special syntax for graphs.
+ \item Grouping of graphic parameters.
+ \item Coordinate transformation system.
\end{enumerate}
-
\subsection{Special Syntax For Specifying Points}
-\tikzname\ provides a special syntax for specifying points and
-coordinates. In the simplest case, you provide two \TeX\ dimensions,
-separated by commas, in round brackets as in |(1cm,2pt)|.
+\tikzname\ provides a special syntax for specifying points and coordinates. In
+the simplest case, you provide two \TeX\ dimensions, 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''.
-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.''
+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 goes 1cm to the right
+and the unit $y$-vector goes 1cm upward.
-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
-goes 1cm to the right and the unit $y$-vector goes 1cm upward.
+By specifying three numbers as in |(1,1,1)| you specify a point in \pgfname's
+$xyz$-coordinate system.
-By specifying three numbers as in |(1,1,1)| you specify a point in
-\pgfname's $xyz$-coordinate system.
+It is also possible to use an anchor of a previously defined shape as in
+|(first node.south)|.
-It is also possible to use an anchor of a previously defined shape
-as in |(first node.south)|.
+You can add two plus signs before a coordinate as in |++(1cm,0pt)|. This means
+``1cm to the right of the last point used''. This allows you to easily specify
+relative movements. For example, |(1,0) ++(1,0) ++(0,1)| specifies the three
+coordinates |(1,0)|, then |(2,0)|, and |(2,1)|.
-You can add two plus signs before a coordinate as in
-|++(1cm,0pt)|. This means ``1cm to the right of the last point
-used.'' This allows you to easily specify relative movements. For
-example, |(1,0) ++(1,0) ++(0,1)| specifies the three coordinates
-|(1,0)|, then |(2,0)|, and |(2,1)|.
+Finally, instead of two plus signs, you can also add a single one. This also
+specifies a point in a relative manner, but it does not ``change'' the current
+point used in subsequent relative commands. For example, |(1,0) +(1,0) +(0,1)|
+specifies the three coordinates |(1,0)|, then |(2,0)|, and |(1,1)|.
-Finally, instead of two plus signs, you can also add a single
-one. This also specifies a point in a relative manner, but it does
-not ``change'' the current point used in subsequent relative
-commands. For example, |(1,0) +(1,0) +(0,1)| specifies the three
-coordinates |(1,0)|, then |(2,0)|, and |(1,1)|.
\subsection{Special Syntax For Path Specifications}
-When creating a picture using \tikzname, your main job is the
-specification of \emph{paths}. A path is a series of straight or curved
-lines, which need not be connected. \tikzname\ makes it easy to
-specify paths, partly using the syntax of \textsc{metapost}. For
-example, to specify a triangular path you use
+When creating a picture using \tikzname, your main job is the specification of
+\emph{paths}. A path is a series of straight or curved lines, which need not be
+connected. \tikzname\ makes it easy to specify paths, partly using the syntax
+of \textsc{metapost}. For example, to specify a triangular path you use
+%
\begin{codeexample}[code only]
(5pt,0pt) -- (0pt,0pt) -- (0pt,5pt) -- cycle
\end{codeexample}
-and you get \tikz \draw (5pt,0pt) -- (0pt,0pt) -- (0pt,5pt) -- cycle;
-when you draw this path.
+%
+and you get \tikz \draw (5pt,0pt) -- (0pt,0pt) -- (0pt,5pt) -- cycle; when you
+draw this path.
+
\subsection{Actions on Paths}
-A path is just a series of straight and curved lines, but it is not
-yet specified what should happen with it. One can \emph{draw} a
-path, \emph{fill} a path, \emph{shade} it, \emph{clip} it, or do any
-combination of these. Drawing (also known as \emph{stroking}) can be
-thought of as taking a pen of a certain thickness and moving it
-along the path, thereby drawing on the canvas. Filling means that
-the interior of the path is filled with a uniform color. Obviously,
-filling makes sense only for \emph{closed} paths and a path is
-automatically closed prior to filling, if necessary.
-
-Given a path as in |\path (0,0) rectangle (2ex,1ex);|, you can draw
-it by adding the |draw| option as in
-|\path[draw] (0,0) rectangle (2ex,1ex);|, which yields \tikz \path[draw]
-(0,0) rectangle (2ex,1ex);. The |\draw| command is just an abbreviation for
-|\path[draw]|. To fill a path, use the |fill| option or the |\fill|
-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 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.
-
-\tikzname\ allows you to use different colors for filling and
-stroking.
-
-\subsection{Key-Value Syntax for Graphic Parameters}
-
-Whenever \tikzname\ draws or fills a path, a large number of graphic
-parameters influences the rendering. Examples include the colors
-used, the dashing pattern, the clipping area, the line width, and
-many others. In \tikzname, all these options are specified as lists
-of so called key-value pairs, as in |color=red|, that are
-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;
+A path is just a series of straight and curved lines, but it is not yet
+specified what should happen with it. One can \emph{draw} a path, \emph{fill} a
+path, \emph{shade} it, \emph{clip} it, or do any combination of these. Drawing
+(also known as \emph{stroking}) can be thought of as taking a pen of a certain
+thickness and moving it along the path, thereby drawing on the canvas. Filling
+means that the interior of the path is filled with a uniform color. Obviously,
+filling makes sense only for \emph{closed} paths and a path is automatically
+closed prior to filling, if necessary.
+
+Given a path as in |\path (0,0) rectangle (2ex,1ex);|, you can draw it by
+adding the |draw| option as in |\path[draw] (0,0) rectangle (2ex,1ex);|, which
+yields \tikz \path[draw] (0,0) rectangle (2ex,1ex);. The |\draw| command is
+just an abbreviation for |\path[draw]|. To fill a path, use the |fill| option
+or the |\fill| 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 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.
+
+\tikzname\ allows you to use different colors for filling and stroking.
+
+
+\subsection{Key--Value Syntax for Graphic Parameters}
+
+Whenever \tikzname\ draws or fills a path, a large number of graphic parameters
+influences the rendering. Examples include the colors used, the dashing
+pattern, the clipping area, the line width, and many others. In \tikzname, all
+these options are specified as lists of so called key--value pairs, as in
+|color=red|, that are 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) -- (0,1) -- cycle;
\end{codeexample}
+
\subsection{Special Syntax for Specifying Nodes}
-\tikzname\ introduces a special syntax for adding text or, more
-generally, nodes to a graphic. When you specify a path, add nodes as
-in the following example:
+
+\tikzname\ introduces a special syntax for adding text or, more generally,
+nodes to a graphic. When you specify a path, add nodes as in the following
+example:
+%
\begin{codeexample}[]
\tikz \draw (1,1) node {text} -- (2,2);
\end{codeexample}
-Nodes are inserted at the current position of
-the path, but either \emph{after} (the default) or \emph{before} the
-complete path is rendered. When special options are given, as in
-|\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.''
+%
+Nodes are inserted at the current position of the path, but either \emph{after}
+(the default) or \emph{before} the complete path is rendered. When special
+options are given, as in |\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''.
-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
-parentheses outside the text as in |node[circle](name){text}|.
+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 parentheses outside the
+text as in |node[circle](name){text}|.
-Predefined shapes include |rectangle|, |circle|, and |ellipse|, but
-it is possible (though a bit challenging) to define new shapes.
+Predefined shapes include |rectangle|, |circle|, and |ellipse|, but it is
+possible (though a bit challenging) to define new shapes.
-\subsection{Special Syntax for Specifying Trees}
-The ``node syntax'' can also be used to draw tress: 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.
+\subsection{Special Syntax for Specifying Trees}
+The ``node syntax'' can also be used to draw tress: 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.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\node {root}
@@ -168,11 +166,11 @@ children in turn.
};
\end{tikzpicture}
\end{codeexample}
-
-Since trees are made up from nodes, it is possible to use options to
-modify the way trees are drawn. Here are two examples of the above tree,
-redrawn with different options:
-
+%
+Since trees are made up from nodes, it is possible to use options to modify the
+way trees are drawn. Here are two examples of the above tree, redrawn with
+different options:
+%
\begin{codeexample}[]
\begin{tikzpicture}
[edge from parent fork down, sibling distance=15mm, level distance=15mm,
@@ -203,43 +201,42 @@ redrawn with different options:
\end{codeexample}
-
\subsection{Special Syntax for Graphs}
-The |\node| command gives you fine control over where nodes should be
-placed, what text they should use, and what they should look
-like. However, when you draw a graph, you typically need to create
-numerous fairly similar nodes that only differ with respect to the
-name they show. In these cases, the |graph| syntax can be used, which
-is another syntax layer build ``on top'' of the node syntax.
-
+The |\node| command gives you fine control over where nodes should be placed,
+what text they should use, and what they should look like. However, when you
+draw a graph, you typically need to create numerous fairly similar nodes that
+only differ with respect to the name they show. In these cases, the |graph|
+syntax can be used, which is another syntax layer build ``on top'' of the node
+syntax.
+%
\begin{codeexample}[]
\tikz \graph [grow down, branch right] {
root -> { left, right -> {child, child} }
};
\end{codeexample}
-The syntax of the |graph| command extends the so-called
-\textsc{dot}-notation used in the popular \textsc{graphviz} program.
+%
+The syntax of the |graph| command extends the so-called \textsc{dot}-notation
+used in the popular \textsc{graphviz} program.
-Depending on the version of \TeX\ you use (it must allow you to call
-Lua code, which is the case for Lua\TeX), you can also ask \tikzname\
-to do automatically compute good positions for the nodes of a graph
-using one of several integrated \emph{graph drawing algorithms}.
+Depending on the version of \TeX\ you use (it must allow you to call Lua code,
+which is the case for Lua\TeX), you can also ask \tikzname\ to do automatically
+compute good positions for the nodes of a graph using one of several integrated
+\emph{graph drawing algorithms}.
\subsection{Grouping of Graphic Parameters}
-Graphic parameters should often apply to several path drawing or
-filling commands. For example, we may wish to draw numerous lines all
-with the same line width of 1pt. For this, we put these commands
-in a |{scope}| environment that takes the desired graphic options
-as an optional parameter. Naturally, the specified graphic
-parameters apply only to the drawing and filling commands inside the
-environment. Furthermore, nested |{scope}| environments or
-individual drawing commands can override the graphic parameters of
-outer |{scope}| environments. In the following example, three red
-lines, two green lines, and one blue line are drawn:
-
+Graphic parameters should often apply to several path drawing or filling
+commands. For example, we may wish to draw numerous lines all with the same
+line width of 1pt. For this, we put these commands in a |{scope}| environment
+that takes the desired graphic options as an optional parameter. Naturally, the
+specified graphic parameters apply only to the drawing and filling commands
+inside the environment. Furthermore, nested |{scope}| environments or
+individual drawing commands can override the graphic parameters of outer
+|{scope}| environments. In the following example, three red lines, two green
+lines, and one blue line are drawn:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\begin{scope}[color=red]
@@ -255,25 +252,23 @@ lines, two green lines, and one blue line are drawn:
\end{tikzpicture}
\end{codeexample}
-The |{tikzpicture}| environment itself also behaves like a
-|{scope}| environment, that is, you can specify graphic parameters
-using an optional argument. These optional apply to all commands in
-the picture.
+The |{tikzpicture}| environment itself also behaves like a |{scope}|
+environment, that is, you can specify graphic parameters using an optional
+argument. These optional apply to all commands in the picture.
\subsection{Coordinate Transformation System}
-\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
-details on the difference between coordinate transformations and
-canvas transformations see Section~\ref{section-design-transformations}.)
+\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 details on the difference between
+coordinate transformations and canvas transformations see
+Section~\ref{section-design-transformations}.)
The syntax is set up in such a way that it is harder to use canvas
-transformations than coordinate transformations. There are two reasons
-for this: First, the canvas transformation must be used with great
-care and often results in ``bad'' graphics with changing line width
-and text in wrong sizes. Second, \pgfname\ loses track of where nodes
-and shapes are positioned when canvas transformations are used.
-So, in almost all circumstances, you should use coordinate
-transformations rather than canvas transformations.
+transformations than coordinate transformations. There are two reasons for
+this: First, the canvas transformation must be used with great care and often
+results in ``bad'' graphics with changing line width and text in wrong sizes.
+Second, \pgfname\ loses track of where nodes and shapes are positioned when
+canvas transformations are used. So, in almost all circumstances, you should
+use coordinate transformations rather than canvas transformations.
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-graphs.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-graphs.tex
index e9643c75744..36c4469d10c 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-graphs.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-graphs.tex
@@ -8,26 +8,26 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Specifying Graphs}
\label{section-library-graphs}
-
\subsection{Overview}
-\tikzname\ offers a powerful path command for specifying how the nodes
-in a graph are connected by edges and arcs: The |graph| path
-command, which becomes available when you load the |graphs| library.
+\tikzname\ offers a powerful path command for specifying how the nodes in a
+graph are connected by edges and arcs: The |graph| path command, which becomes
+available when you load the |graphs| library.
\begin{tikzlibrary}{graphs}
- The package must be loaded to use the |graph| path command.
+ The package must be loaded to use the |graph| path command.
\end{tikzlibrary}
-In this section, by \emph{graph} we refer to a set of nodes together
-with some edges (sometimes also called arcs, in case they are
-directed) such as the following:
-
+In this section, by \emph{graph} we refer to a set of nodes together with some
+edges (sometimes also called arcs, in case they are directed) such as the
+following:
+%
\begin{codeexample}[]
-\tikz \graph { a -> {b, c} -> d };
+\tikz \graph { a -> {b, c} -> d };
\end{codeexample}
\begin{codeexample}[]
@@ -59,7 +59,7 @@ directed) such as the following:
\begin{codeexample}[width=6.6cm]
\tikz [>={To[sep]}, rotate=90, xscale=-1,
mark/.style={fill=black!50}, mark/.default=]
- \graph [trie, simple,
+ \graph [trie, simple,
nodes={circle,draw},
edges={nodes={
inner sep=1pt, anchor=mid,
@@ -80,29 +80,28 @@ directed) such as the following:
},
{ [edges=red] % highlight one path
root -> f -> a -> n
- }
+ }
};
\end{codeexample}
-The nodes of a graph are normal \tikzname\ nodes, the edges are
-normal lines drawn between nodes. There is nothing in the |graph|
-library that you cannot do using the normal |\node| and the |edge|
-commands. Rather, its purpose is to offer a concise and powerful way of
-\emph{specifying} which nodes are present
-and how they are connected. The |graph| library only offers simple
-methods for specifying \emph{where} the nodes should be shown, its
-main strength is in specifying which nodes and edges are present in
-principle. The problem of finding ``good positions on the canvas'' for
-the nodes of a graph is left to \emph{graph drawing algorithms}, which
-are covered in Part~\ref{part-gd} of this manual and which
-are not part of the |graphs| library; indeed, these algorithms can be
-used also with graphs specified using |node| and |edge|
-commands. \ifluatex
-As an example, consider the above drawing of a trie, which is drawn
-without using the graph drawing libraries. Its layout can be
-somewhat improved by loading the |layered| graph drawing library,
-saying |\tikz[layered layout,...|, and then using Lua\TeX, resulting
-in the following drawing of the same graph:
+The nodes of a graph are normal \tikzname\ nodes, the edges are normal lines
+drawn between nodes. There is nothing in the |graph| library that you cannot do
+using the normal |\node| and the |edge| commands. Rather, its purpose is to
+offer a concise and powerful way of \emph{specifying} which nodes are present
+and how they are connected. The |graph| library only offers simple methods for
+specifying \emph{where} the nodes should be shown, its main strength is in
+specifying which nodes and edges are present in principle. The problem of
+finding ``good positions on the canvas'' for the nodes of a graph is left to
+\emph{graph drawing algorithms}, which are covered in Part~\ref{part-gd} of
+this manual and which are not part of the |graphs| library; indeed, these
+algorithms can be used also with graphs specified using |node| and |edge|
+commands.
+%
+\ifluatex
+As an example, consider the above drawing of a trie, which is drawn without
+using the graph drawing libraries. Its layout can be somewhat improved by
+loading the |layered| graph drawing library, saying |\tikz[layered layout,...|,
+and then using Lua\TeX, resulting in the following drawing of the same graph:
\medskip
\tikz [layered layout, >={To[sep]}, rotate=90, xscale=-1,
@@ -127,104 +126,101 @@ in the following drawing of the same graph:
},
{ [edges=red] % highlight one path
root -> f -> a -> n
- }
+ }
};
\medskip
\fi
-The |graph| library uses a syntax that is quite different from the
-normal \tikzname\ syntax for specifying nodes. The reason for this is
-that for many medium-sized graphs it can become quite cumbersome to
-specify all the nodes using |\node| repeatedly and then using a great
-number of |edge| command; possibly with complicated |\foreach|
-statements. Instead, the syntax of the |graph| library is loosely
-inspired by the \textsc{dot} format, which is quite useful for
-specifying medium-sized graphs, with some extensions on top.
-
+The |graph| library uses a syntax that is quite different from the normal
+\tikzname\ syntax for specifying nodes. The reason for this is that for many
+medium-sized graphs it can become quite cumbersome to specify all the nodes
+using |\node| repeatedly and then using a great number of |edge| command;
+possibly with complicated |\foreach| statements. Instead, the syntax of the
+|graph| library is loosely inspired by the \textsc{dot} format, which is quite
+useful for specifying medium-sized graphs, with some extensions on top.
\subsection{Concepts}
-The present section aims at giving a quick overview of the main
-concepts behind the |graph| command. The exact syntax is explained in
-more detail in later sections.
+The present section aims at giving a quick overview of the main concepts behind
+the |graph| command. The exact syntax is explained in more detail in later
+sections.
\subsubsection{Concept: Node Chains}
-The basic way of specifying a graph is to write down a \emph{node
- chain} as in the following example:
-
+The basic way of specifying a graph is to write down a \emph{node chain} as in
+the following example:
+%
\begin{codeexample}[]
\tikz [every node/.style = draw]
- \graph { foo -> bar -> blub };
+ \graph { foo -> bar -> blub };
\end{codeexample}
-As can be seen, the text |foo -> bar -> my node| creates three nodes,
-one with the text |foo|, one with |bar| and one with the text
-|blub|. These nodes are connected by arrows, which are caused by
-the |->| between the node texts. Such a sequence of node texts and
-arrows between them is called a \emph{chain} in the following.
+As can be seen, the text |foo -> bar -> my node| creates three nodes, one with
+the text |foo|, one with |bar| and one with the text |blub|. These nodes are
+connected by arrows, which are caused by the |->| between the node texts. Such
+a sequence of node texts and arrows between them is called a \emph{chain} in
+the following.
Inside a graph there can be more than one chain:
-
+%
\begin{codeexample}[]
\tikz \graph {
a -> b -> c;
d -> e -> f;
g -> f;
-};
+};
\end{codeexample}
-Multiple chains are separated by a semicolon or a comma (both have
-exactly the same effect). As the example shows, when a node text is
-seen for the second time, instead of creating a new node, a connection
-is created to the already existing node.
-
-When a node like |f| is created, both the node name and the node text
-are identical by default. This is not always desirable and can be
-changed by using the |as| key or by providing another text after
-a slash:
+Multiple chains are separated by a semicolon or a comma (both have exactly the
+same effect). As the example shows, when a node text is seen for the second
+time, instead of creating a new node, a connection is created to the already
+existing node.
+When a node like |f| is created, both the node name and the node text are
+identical by default. This is not always desirable and can be changed by using
+the |as| key or by providing another text after a slash:
+%
\begin{codeexample}[]
\tikz \graph {
x1/$x_1$ -> x2 [as=$x_2$, red] -> x34/{$x_3,x_4$};
x1 -> [bend left] x34;
-};
+};
\end{codeexample}
-When you wish to use a node name that contains special symbols like
-commas or dashes, you must surround the node name by quotes. This
-allows you to use quite arbitrary text as a ``node name'':
+When you wish to use a node name that contains special symbols like commas or
+dashes, you must surround the node name by quotes. This allows you to use quite
+arbitrary text as a ``node name'':
+%
\begin{codeexample}[]
\tikz \graph {
"$x_1$" -> "$x_2$"[red] -> "$x_3,x_4$";
"$x_1$" ->[bend left] "$x_3,x_4$";
-};
+};
\end{codeexample}
\subsubsection{Concept: Chain Groups}
-Multiple chains that are separated by a semicolon or a comma and that
-are surrounded by curly braces form what will be called a \emph{chain
- group} or just a \emph{group}. A group in itself has no special
-effect. However, things get interesting when you write down a node or
-even a whole group and connect it to another group. In this case, the
-``exit points'' of the first node or group get connected to the
-``entry points'' of the second node or group:
-
+Multiple chains that are separated by a semicolon or a comma and that are
+surrounded by curly braces form what will be called a \emph{chain group} or
+just a \emph{group}. A group in itself has no special effect. However, things
+get interesting when you write down a node or even a whole group and connect it
+to another group. In this case, the ``exit points'' of the first node or group
+get connected to the ``entry points'' of the second node or group:
+%
\begin{codeexample}[]
\tikz \graph {
a -> {
b -> c,
d -> e
} -> f
-};
+};
\end{codeexample}
Chain groups make it easy to create tree structures:
-
+%
\begin{codeexample}[width=10cm]
\tikz
\graph [grow down,
@@ -242,10 +238,11 @@ Chain groups make it easy to create tree structures:
};
\end{codeexample}
-As can be seen, the placement is not particularly nice by default, use
-the algorithms from the graph drawing libraries to get a better
-layout. For instance, adding |tree layout| to the above code results in the
-following somewhat more pleasing rendering:
+As can be seen, the placement is not particularly nice by default, use the
+algorithms from the graph drawing libraries to get a better layout. For
+instance, adding |tree layout| to the above code results in the following
+somewhat more pleasing rendering:
+%
\ifluatex
\medskip
@@ -262,64 +259,62 @@ following somewhat more pleasing rendering:
}
};
\else
-(You need to use Lua\TeX\ to typeset this graphic.)
+ (You need to use Lua\TeX\ to typeset this graphic.)
\fi
-\subsubsection{Concept: Edge Labels and Styles}
-When connectors like |->| or |--| are used to connect nodes or whole
-chain groups, one or more edges will typically be created. These edges
-can be styles easily by providing options in square brackets directly
-after these connectors:
+\subsubsection{Concept: Edge Labels and Styles}
+When connectors like |->| or |--| are used to connect nodes or whole chain
+groups, one or more edges will typically be created. These edges can be styles
+easily by providing options in square brackets directly after these connectors:
+%
\begin{codeexample}[]
\tikz \graph {
a ->[red] b --[thick] {c, d};
};
\end{codeexample}
-Using the quotes syntax, see Section~\ref{section-label-quotes},
-you can even add labels to the edges easily by putting the labels in
-quotes:
-
+Using the quotes syntax, see Section~\ref{section-label-quotes}, you can even
+add labels to the edges easily by putting the labels in quotes:
+%
\begin{codeexample}[]
\tikz \graph {
a ->[red, "foo"] b --[thick, "bar"] {c, d};
};
\end{codeexample}
-For the first edge, the effect is as desired, however
-between |b| and the group |{c,d}| two edges are inserted and the
-options |thick| and the label option |"bar"| is applied to both of
-them. While this is the correct and consistent behaviour, we typically
-might wish to specify different labels for the edge going from |b| to
-|c| and the edge going from |b| to |d|. To achieve this effect, we can
-no longer specify the label as part of the options of |--|. Rather, we
-must pass the desired label to the nodes |c| and |d|, but we must
-somehow also indicate that these options actually ``belong'' to the
-edge ``leading to'' to nodes. This is achieved by preceding the
-options with a greater-than sign:
-
+For the first edge, the effect is as desired, however between |b| and the group
+|{c,d}| two edges are inserted and the options |thick| and the label option
+|"bar"| is applied to both of them. While this is the correct and consistent
+behaviour, we typically might wish to specify different labels for the edge
+going from |b| to |c| and the edge going from |b| to |d|. To achieve this
+effect, we can no longer specify the label as part of the options of |--|.
+Rather, we must pass the desired label to the nodes |c| and |d|, but we must
+somehow also indicate that these options actually ``belong'' to the edge
+``leading to'' to nodes. This is achieved by preceding the options with a
+greater-than sign:
+%
\begin{codeexample}[]
\tikz \graph {
a -> b -- {c [> "foo"], d [> "bar"']};
};
\end{codeexample}
-Symmetrically, preceding the options by |<| causes the options and
-labels to apply to the ``outgoing'' edges of the node:
-
+Symmetrically, preceding the options by |<| causes the options and labels to
+apply to the ``outgoing'' edges of the node:
+%
\begin{codeexample}[]
\tikz \graph {
a [< red] -> b -- {c [> blue], d [> "bar"']};
};
\end{codeexample}
-This syntax allows you to easily create trees with special edge
-labels as in the following example of a treap:
-
+This syntax allows you to easily create trees with special edge labels as in
+the following example of a treap:
+%
\begin{codeexample}[]
-\tikz
+\tikz
\graph [edge quotes={fill=white,inner sep=1pt},
grow down, branch right, nodes={circle,draw}] {
"" -> h [>"9"] -> {
@@ -333,37 +328,33 @@ labels as in the following example of a treap:
\end{codeexample}
-
\subsubsection{Concept: Node Sets}
-When you write down some node text inside a |graph| command, a new
-node is created by default unless this node has already been created
-inside the same |graph| command. In particular, if a node has
-already been declared outside of the current |graph| command, a new
-node of the same name gets created.
-
-This is not always the desired behaviour. Often, you may wish to make
-nodes part of a graph than have already been defined prior to the use
-of the |graph| command. For this, simply surround a node name by
-parentheses. This will cause a reference to be created to an already
-existing node:
+When you write down some node text inside a |graph| command, a new node is
+created by default unless this node has already been created inside the same
+|graph| command. In particular, if a node has already been declared outside of
+the current |graph| command, a new node of the same name gets created.
+This is not always the desired behaviour. Often, you may wish to make nodes
+part of a graph than have already been defined prior to the use of the |graph|
+command. For this, simply surround a node name by parentheses. This will cause
+a reference to be created to an already existing node:
+%
\begin{codeexample}[]
\tikz {
\node (a) at (0,0) {A};
\node (b) at (1,0) {B};
\node (c) at (2,0) {C};
-
+
\graph { (a) -> (b) -> (c) };
}
\end{codeexample}
-You can even go a step further: A whole collection of nodes can all be
-flagged to belong to a \emph{node set} by adding the option
-|set=|\meta{node set name}. Then, inside a |graph| command, you can
-collectively refer to these nodes by surrounding the node set name in
-parentheses:
-
+You can even go a step further: A whole collection of nodes can all be flagged
+to belong to a \emph{node set} by adding the option |set=|\meta{node set name}.
+Then, inside a |graph| command, you can collectively refer to these nodes by
+surrounding the node set name in parentheses:
+%
\begin{codeexample}[]
\tikz [new set=my nodes] {
\node [set=my nodes, circle, draw] at (1,1) {A};
@@ -378,13 +369,12 @@ parentheses:
\subsubsection{Concept: Graph Macros}
-Often, a graph will consist -- at least in parts -- of standard
-parts. For instance, a graph might contain a cycle of certain size or
-a path or a clique. To facilitate specifying such graphs, you can
-define a \emph{graph macro}. Once a graph macro has been defined, you
-can use the name of the graph to make a copy of the graph part of the
-graph currently being specified:
-
+Often, a graph will consist -- at least in parts -- of standard parts. For
+instance, a graph might contain a cycle of certain size or a path or a clique.
+To facilitate specifying such graphs, you can define a \emph{graph macro}. Once
+a graph macro has been defined, you can use the name of the graph to make a
+copy of the graph part of the graph currently being specified:
+%
\begin{codeexample}[]
\tikz \graph { subgraph K_n [n=6, clockwise] };
\end{codeexample}
@@ -393,173 +383,181 @@ graph currently being specified:
\tikz \graph { subgraph C_n [n=5, clockwise] -> mid };
\end{codeexample}
-The library |graphs.standard| defines a number of such graphs,
-including the complete clique $K_n$ on $n$ nodes, the complete
-bipartite graph $K_{n,m}$ with shores sized $n$ and $m$, the cycle
-$C_n$ on $n$ nodes, the path $P_n$ on $n$ nodes, and the independent
-set $I_n$ on $n$ nodes.
+The library |graphs.standard| defines a number of such graphs, including the
+complete clique $K_n$ on $n$ nodes, the complete bipartite graph $K_{n,m}$ with
+shores sized $n$ and $m$, the cycle $C_n$ on $n$ nodes, the path $P_n$ on $n$
+nodes, and the independent set $I_n$ on $n$ nodes.
\subsubsection{Concept: Graph Expressions and Color Classes}
-When a graph is being constructed using the |graph| command, it is
-constructed recursively by uniting smaller graphs to larger
-graphs. During this recursive union process the nodes
-of the graph get implicitly \emph{colored} (conceptually) and you can
-also explicitly assign colors to individual nodes and even change the
-colors as the graph is being specified. All nodes having the same
-color form what is called a \emph{color class}.
-
-The power of color class is that special \emph{connector operators}
-allow you to add edges between nodes having certain colors. For instance,
-saying |clique=red| at the beginning of a group will
-cause all nodes that have been flagged as being (conceptually) ``red''
-to be connected as a clique. Similarly, saying
-|complete bipartite={red}{green}| will cause edges to be added
-between all red and all green nodes. More advanced connectors, like
-the |butterfly| connector, allow you to add edges between color
-classes in a fancy manner.
-
+When a graph is being constructed using the |graph| command, it is constructed
+recursively by uniting smaller graphs to larger graphs. During this recursive
+union process the nodes of the graph get implicitly \emph{colored}
+(conceptually) and you can also explicitly assign colors to individual nodes
+and even change the colors as the graph is being specified. All nodes having
+the same color form what is called a \emph{color class}.
+
+The power of color class is that special \emph{connector operators} allow you
+to add edges between nodes having certain colors. For instance, saying
+|clique=red| at the beginning of a group will cause all nodes that have been
+flagged as being (conceptually) ``red'' to be connected as a clique. Similarly,
+saying |complete bipartite={red}{green}| will cause edges to be added between
+all red and all green nodes. More advanced connectors, like the |butterfly|
+connector, allow you to add edges between color classes in a fancy manner.
+%
\begin{codeexample}[]
\tikz [x=8mm, y=6mm, circle]
\graph [nodes={fill=blue!70}, empty nodes, n=8] {
subgraph I_n [name=A] --[butterfly={level=4}]
subgraph I_n [name=B] --[butterfly={level=2}]
subgraph I_n [name=C] --[butterfly]
- subgraph I_n [name=D] --
- subgraph I_n [name=E]
+ subgraph I_n [name=D] --
+ subgraph I_n [name=E]
};
\end{codeexample}
-
\subsection{Syntax of the Graph Path Command}
\subsubsection{The Graph Command}
-In order to construct a graph, you should use the |graph| path
-command, which can be used anywhere on a path at any place where
-you could also use a command like, say, |plot| or |--|.
+In order to construct a graph, you should use the |graph| path command, which
+can be used anywhere on a path at any place where you could also use a command
+like, say, |plot| or |--|.
\begin{command}{\graph}
- Inside a |{tikzpicture}| this is an abbreviation for |\path graph|.
+ Inside a |{tikzpicture}| this is an abbreviation for |\path graph|.
\end{command}
\begin{pathoperation}{graph}{\opt{\oarg{options}}\meta{group specification}}
- When this command is encountered on a path, the construction of the
- current path is suspended (similarly to an |edge| command or a
- |node| command). In a local scope, the \meta{options} are first
- executed with the key path |/tikz/graphs| using the following
- command:
- \begin{command}{\tikzgraphsset\marg{options}}
- Executes the \meta{options} with the path prefix |/tikz/graphs|.
- \end{command}
- Apart from the keys explained in the following, further permissible
- keys will be listed during the course of the rest of this section.
-
- \begin{stylekey}{/tikz/graphs/every graph}
- This style is executed at the beginning of every |graph| path
- command prior to the \meta{options}.
- \end{stylekey}
-
- Once the scope has been set up and once the \meta{options} have been
- executed, a parser starts to parse the \meta{group
- specification}. The exact syntax of such a group specification
- in explained in detail in
- Section~\ref{section-library-graphs-group-spec}. Basically, a group
- specification is a list of chain specifications, separated by commas
- or semicolons.
-
- Depending on the content of the \meta{group specification}, two
- things will happen:
- \begin{enumerate}
- \item A number of new nodes may be created. These will be inserted
- into the picture in the same order as if they had been created
- using multiple |node| path commands at the place where the |graph|
- path command was used. In other words, all nodes created in a
- |graph| path command will be painted on top of any nodes created
- earlier in the path and behind any nodes created later in the
- path. Like normal nodes, the newly created nodes always lie on top
- of the path that is currently being created (which is often
- empty, for instance when the |\graph| command is used).
- \item Edges between the nodes may be added. They are added in the
- same order as if the |edge| command had been used at the position
- where the |graph| command is being used.
- \end{enumerate}
-
- Let us now have a look at some common keys that may be used inside
- the \meta{options}:
- \begin{key}{/tikz/graphs/nodes=\meta{options}}
- This option causes the \meta{options} to be applied to each newly
- created node inside the \meta{group specification}.
- \begin{codeexample}[]
-\tikz \graph [nodes=red] { a -> b -> c };
- \end{codeexample}
- Multiple uses of this key accumulate.
- \end{key}
- \begin{key}{/tikz/graphs/edges=\meta{options}}
- This option causes the \meta{options} to be applied to each newly
- created edge inside the \meta{group specification}.
- \begin{codeexample}[]
-\tikz \graph [edges={red,thick}] { a -> b -> c };
- \end{codeexample}
- Again, multiple uses of this key accumulate.
- \end{key}
- \begin{key}{/tikz/graphs/edge=\meta{options}}
- This is an alias for |edges|.
- \end{key}
-
- \begin{key}{/tikz/graphs/edge node=\meta{node specification}}
- This key specifies that the \meta{node specification} should be
- added to each newly created edge as an implicitly placed node.
- \begin{codeexample}[]
-\tikz \graph [edge node={node [red, near end] {X}}] { a -> b -> c };
- \end{codeexample}
- Again, multiple uses of this key accumulate.
- \begin{codeexample}[]
+ When this command is encountered on a path, the construction of the current
+ path is suspended (similarly to an |edge| command or a |node| command). In
+ a local scope, the \meta{options} are first executed with the key path
+ |/tikz/graphs| using the following command:
+ %
+ \begin{command}{\tikzgraphsset\marg{options}}
+ Executes the \meta{options} with the path prefix |/tikz/graphs|.
+ \end{command}
+ %
+ Apart from the keys explained in the following, further permissible keys
+ will be listed during the course of the rest of this section.
+
+ \begin{stylekey}{/tikz/graphs/every graph}
+ This style is executed at the beginning of every |graph| path command
+ prior to the \meta{options}.
+ \end{stylekey}
+
+ Once the scope has been set up and once the \meta{options} have been
+ executed, a parser starts to parse the \meta{group specification}. The
+ exact syntax of such a group specification in explained in detail in
+ Section~\ref{section-library-graphs-group-spec}. Basically, a group
+ specification is a list of chain specifications, separated by commas or
+ semicolons.
+
+ Depending on the content of the \meta{group specification}, two things will
+ happen:
+ %
+ \begin{enumerate}
+ \item A number of new nodes may be created. These will be inserted into
+ the picture in the same order as if they had been created using
+ multiple |node| path commands at the place where the |graph| path
+ command was used. In other words, all nodes created in a |graph|
+ path command will be painted on top of any nodes created earlier in
+ the path and behind any nodes created later in the path. Like
+ normal nodes, the newly created nodes always lie on top of the path
+ that is currently being created (which is often empty, for instance
+ when the |\graph| command is used).
+ \item Edges between the nodes may be added. They are added in the same
+ order as if the |edge| command had been used at the position where
+ the |graph| command is being used.
+ \end{enumerate}
+
+ Let us now have a look at some common keys that may be used inside the
+ \meta{options}:
+ %
+ \begin{key}{/tikz/graphs/nodes=\meta{options}}
+ This option causes the \meta{options} to be applied to each newly
+ created node inside the \meta{group specification}.
+ %
+\begin{codeexample}[]
+\tikz \graph [nodes=red] { a -> b -> c };
+\end{codeexample}
+ %
+ Multiple uses of this key accumulate.
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/edges=\meta{options}}
+ This option causes the \meta{options} to be applied to each newly
+ created edge inside the \meta{group specification}.
+ %
+\begin{codeexample}[]
+\tikz \graph [edges={red,thick}] { a -> b -> c };
+\end{codeexample}
+ %
+ Again, multiple uses of this key accumulate.
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/edge=\meta{options}}
+ This is an alias for |edges|.
+ \end{key}
+
+ \begin{key}{/tikz/graphs/edge node=\meta{node specification}}
+ This key specifies that the \meta{node specification} should be added
+ to each newly created edge as an implicitly placed node.
+ %
+\begin{codeexample}[]
+\tikz \graph [edge node={node [red, near end] {X}}] { a -> b -> c };
+\end{codeexample}
+ %
+ Again, multiple uses of this key accumulate.
+ %
+\begin{codeexample}[]
\tikz \graph [edge node={node [near end] {X}},
- edge node={node [near start] {Y}}] { a -> b -> c };
- \end{codeexample}
- \end{key}
-
- \begin{key}{/tikz/graphs/edge label=\meta{text}}
- This key is an abbreviation for
- |edge node=node[auto]{|\meta{text}|}|. The net effect is that the
- |text| is placed next to the newly created edges.
- \begin{codeexample}[]
-\tikz \graph [edge label=x] { a -> b -> {c,d} };
- \end{codeexample}
- \end{key}
-
- \begin{key}{/tikz/graphs/edge label'=\meta{text}}
- This key is an abbreviation for
- |edge node=node[auto,swap]{|\meta{text}|}|.
- \begin{codeexample}[]
+ edge node={node [near start] {Y}}] { a -> b -> c };
+\end{codeexample}
+ \end{key}
+
+ \begin{key}{/tikz/graphs/edge label=\meta{text}}
+ This key is an abbreviation for |edge node=node[auto]{|\meta{text}|}|.
+ The net effect is that the |text| is placed next to the newly created
+ edges.
+ %
+\begin{codeexample}[]
+\tikz \graph [edge label=x] { a -> b -> {c,d} };
+\end{codeexample}
+ \end{key}
+
+ \begin{key}{/tikz/graphs/edge label'=\meta{text}}
+ This key is an abbreviation for |edge node=node[auto,swap]{|\meta{text}|}|.
+ %
+\begin{codeexample}[]
\tikz \graph [edge label=out, edge label'=in]
- { subgraph C_n [clockwise, n=5] };
- \end{codeexample}
- \end{key}
+ { subgraph C_n [clockwise, n=5] };
+\end{codeexample}
+ \end{key}
\end{pathoperation}
\subsubsection{Syntax of Group Specifications}
\label{section-library-graphs-group-spec}
-A \meta{group specification} inside a |graph| path command has the
-following syntax:
+A \meta{group specification} inside a |graph| path command has the following
+syntax:
+%
\begin{quote}
- |{|\opt{\oarg{options}}\meta{list of chain specifications}|}|
+ |{|\opt{\oarg{options}}\meta{list of chain specifications}|}|
\end{quote}
-The \meta{chain specifications} must contain chain specifications,
-whose syntax is detailed in the next section, separated by either
-commas or semicolons; you can freely mix them.
-It is permissible to use empty lines (which are mapped to |\par|
-commands internally) to structure the chains visually, they are simply
-ignored by the parser.
-
-In the following example, the group specification consists of three
-chain specifications, namely of |a -> b|, then |c| alone, and finally
-|d -> e -> f|:
+%
+The \meta{chain specifications} must contain chain specifications, whose syntax
+is detailed in the next section, separated by either commas or semicolons; you
+can freely mix them. It is permissible to use empty lines (which are mapped to
+|\par| commands internally) to structure the chains visually, they are simply
+ignored by the parser.
+
+In the following example, the group specification consists of three chain
+specifications, namely of |a -> b|, then |c| alone, and finally |d -> e -> f|:
+%
\begin{codeexample}[]
\tikz \graph {
a -> b,
@@ -568,13 +566,14 @@ chain specifications, namely of |a -> b|, then |c| alone, and finally
d -> e -> f
};
\end{codeexample}
+%
The above has the same effect as the more compact group specification
|{a->b,c,d->e->f}|.
-Commas are used to detect where chain specifications end. However, you
-will often wish to use a comma also inside the options of a single
-node like in the following example:
-
+Commas are used to detect where chain specifications end. However, you will
+often wish to use a comma also inside the options of a single node like in the
+following example:
+%
\begin{codeexample}[]
\tikz \graph {
a [red, draw] -> b [blue, draw],
@@ -582,20 +581,18 @@ node like in the following example:
};
\end{codeexample}
-Note that the above example works as expected: The first comma inside
-the option list of |a| is \emph{not} interpreted as the end of the
-chain specification ``|a [red|''. Rather, commas inside square
-brackets are ``protected'' against being interpreted as separators of
-group specifications.
-
-The \meta{options} that can be given at the beginning of a group
-specification are local to the group. They are executed with the path
-prefix |/tikz/graphs|. Note that for the outermost group specification
-of a graph it makes no difference whether the options are passed to
-the |graph| command or whether they are given at the beginning of this
-group. However, for groups nested inside other groups, it does make a
-difference:
+Note that the above example works as expected: The first comma inside the
+option list of |a| is \emph{not} interpreted as the end of the chain
+specification ``|a [red|''. Rather, commas inside square brackets are
+``protected'' against being interpreted as separators of group specifications.
+The \meta{options} that can be given at the beginning of a group specification
+are local to the group. They are executed with the path prefix |/tikz/graphs|.
+Note that for the outermost group specification of a graph it makes no
+difference whether the options are passed to the |graph| command or whether
+they are given at the beginning of this group. However, for groups nested
+inside other groups, it does make a difference:
+%
\begin{codeexample}[]
\tikz \graph {
a -> { [nodes=red] % the option is local to these nodes:
@@ -607,16 +604,15 @@ difference:
\medskip
\textbf{Using foreach.}
-There is special support for the |\foreach| statement inside groups:
-You may use the statement inside a group
-specification at any place where a \meta{chain specification} would
-normally go. In this case, the |\foreach| statement is executed and
-for each iteration the content of the statement's body is treated and
-parsed as a new chain specification.
-
+There is special support for the |\foreach| statement inside groups: You may
+use the statement inside a group specification at any place where a \meta{chain
+specification} would normally go. In this case, the |\foreach| statement is
+executed and for each iteration the content of the statement's body is treated
+and parsed as a new chain specification.
+%
\begin{codeexample}[]
\tikz \graph [math nodes, branch down=5mm] {
- a -> {
+ a -> {
\foreach \i in {1,2,3} {
a_\i -> { x_\i, y_\i }
},
@@ -627,34 +623,35 @@ parsed as a new chain specification.
\medskip
\textbf{Using macros.}
-In some cases you may wish to use macros and \TeX\ code to compute
-which nodes and edges are present in a group. You cannot use macros in
-the normal way inside a graph specification since the parser does not
-expand macros as it scans for the start and end of groups and node
-names. Rather, only after commas, semicolons, and hyphens have already
-been detected and only after all other parsing decisions have been
-made will macros be expanded. At this point, when a macro expands to,
-say |a,b|, this will not result in two nodes to be created since the
-parsing is already done. For these reasons, a special key is needed to
-make it possible to ``compute'' which nodes should be present in a
+In some cases you may wish to use macros and \TeX\ code to compute which nodes
+and edges are present in a group. You cannot use macros in the normal way
+inside a graph specification since the parser does not expand macros as it
+scans for the start and end of groups and node names. Rather, only after
+commas, semicolons, and hyphens have already been detected and only after all
+other parsing decisions have been made will macros be expanded. At this point,
+when a macro expands to, say |a,b|, this will not result in two nodes to be
+created since the parsing is already done. For these reasons, a special key is
+needed to make it possible to ``compute'' which nodes should be present in a
group.
\begin{key}{/tikz/graph/parse=\meta{text}}
- This key can only be used inside the \meta{options} of a \meta{group
- specification}. Its effect is that the \meta{text} is inserted at
- the beginning of the current group as if you had entered it there.
- Naturally, it makes little sense to just write down some static
- \meta{text} since you could just as well directly place it at the
- beginning of the group. The real power of this command stems from
- the fact that the keys mechanism allows you to say, for instance,
- |parse/.expand once| to insert the text stored in some macro into
- the group.
-\begin{codeexample}[]
-\def\mychain{ a -> b -> c; }
+ This key can only be used inside the \meta{options} of a \meta{group
+ specification}. Its effect is that the \meta{text} is inserted at the
+ beginning of the current group as if you had entered it there. Naturally,
+ it makes little sense to just write down some static \meta{text} since you
+ could just as well directly place it at the beginning of the group. The
+ real power of this command stems from the fact that the keys mechanism
+ allows you to say, for instance, |parse/.expand once| to insert the text
+ stored in some macro into the group.
+ %
+\begin{codeexample}[]
+\def\mychain{ a -> b -> c; }
\tikz \graph { [parse/.expand once=\mychain] d -> e };
\end{codeexample}
- In the following, more fancy example we use a loop to create a chain
- of dynamic length.
+ %
+ In the following, more fancy example we use a loop to create a chain of
+ dynamic length.
+ %
\begin{codeexample}[]
\def\mychain#1{
\def\mytext{1}
@@ -668,151 +665,167 @@ group.
}
\tikz \graph { [my chain=4] };
\end{codeexample}
- Multiple uses of this key accumulate, that is, all the \text{text}s
- given in the different uses is inserted in the order it is given.
+ %
+ Multiple uses of this key accumulate, that is, all the \text{text}s given
+ in the different uses is inserted in the order it is given.
\end{key}
\subsubsection{Syntax of Chain Specifications}
-A \meta{chain specification} has the following syntax: It consists of
-a sequence of \meta{node specifications}, where subsequent node
-specifications are separated by \meta{edge specifications}. Node
-specifications, which typically consist of some text, are discussed in
-the next section in more detail. They normally represent a single node
-that is either newly created or exists already, but they may also
-specify a whole set of nodes.
-
-An \meta{edge specification} specifies \emph{which} of the node(s) to
-the left of the edge specification should be connected to which
-node(s) to the right of it and it also specifies in which direction
-the connections go. In the following, we only discuss how the
-direction is chosen, the powerful mechanism behind choosing which
-nodes should be connect is detailed in
+A \meta{chain specification} has the following syntax: It consists of a
+sequence of \meta{node specifications}, where subsequent node specifications
+are separated by \meta{edge specifications}. Node specifications, which
+typically consist of some text, are discussed in the next section in more
+detail. They normally represent a single node that is either newly created or
+exists already, but they may also specify a whole set of nodes.
+
+An \meta{edge specification} specifies \emph{which} of the node(s) to the left
+of the edge specification should be connected to which node(s) to the right of
+it and it also specifies in which direction the connections go. In the
+following, we only discuss how the direction is chosen, the powerful mechanism
+behind choosing which nodes should be connect is detailed in
Section~\ref{section-library-graphs-color-classes}.
-The syntax of an edge specification is always one of the following
-five possibilities:
-
+The syntax of an edge specification is always one of the following five
+possibilities:
+%
\begin{quote}
- |->| \opt{\oarg{options}}\\
- |--| \opt{\oarg{options}}\\
- |<-| \opt{\oarg{options}}\\
- |<->| \opt{\oarg{options}}\\
- |-!-| \opt{\oarg{options}}
+ |->| \opt{\oarg{options}}\\
+ |--| \opt{\oarg{options}}\\
+ |<-| \opt{\oarg{options}}\\
+ |<->| \opt{\oarg{options}}\\
+ |-!-| \opt{\oarg{options}}
\end{quote}
The first four correspond to a directed edge, an undirected edge, a
-``backward'' directed edge, and a bidirected edge, respectively. The
-fifth edge specification means that there should be no edge (this
-specification can be used together with the |simple| option to remove
-edges that have previously been added, see
-Section~\ref{section-library-graphs-simple}).
+``backward'' directed edge, and a bidirected edge, respectively. The fifth edge
+specification means that there should be no edge (this specification can be
+used together with the |simple| option to remove edges that have previously
+been added, see Section~\ref{section-library-graphs-simple}).
Suppose the nodes \meta{left nodes} are to the left of the \meta{edge
- specification} and \meta{right nodes} are to the right and suppose
-we have written |->| between them. Then the following happens:
+specification} and \meta{right nodes} are to the right and suppose we have
+written |->| between them. Then the following happens:
+%
\begin{enumerate}
-\item The \meta{options} are executed (inside a local scope) with the
- path |/tikz/graphs|. These options may setup the connector algorithm
- (see below) and may also use keys like |edge| or |edge label| to
- specify how the edge should look like. As a convenience, whenever an
- unknown key is encountered for the path |/tikz/graphs|, the key is
- passed to the |edge| key. This means that you can directly use
- options like |thick| or |red| inside the \meta{options} and they
- will apply to the edge as expected.
-\item The chosen connector algorithm, see
- Section~\ref{section-library-graphs-color-classes}, is used to
- compute from which of the \meta{left nodes} an edge should lead to
- which of the \meta{right nodes}. Suppose that $(l_1,r_1)$, \dots,
- $(l_n,r_n)$ is the list of node pairs that result (so there should
- be an edge between $l_1$ and $r_1$ and another edge between $l_2$
- and $r_2$ and so on).
-\item For each pair $(l_i,r_i)$ an edge is created. This is done by
- calling the following key (for the edge specification |->|, other
- keys are executed for the other kinds of specifications):
- \begin{key}{/tikz/graphs/new ->=\marg{left node}\marg{right node}\marg{edge options}\marg{edge nodes}}
- This key will be called for a |->| edge specification with the
- following four parameters:
- \begin{enumerate}
- \item \meta{left node} is the name of the ``left'' node, that is,
- the name of $l_i$.
- \item \meta{right node} is the name of the right node.
- \item \meta{edge options} are the accumulated options from all
- calls of |/tikz/graph/edges| in groups that surround the edge
- specification.
- \item \meta{edge nodes} is text like |node {A} node {B}| that
- specifies some nodes that should be put as labels on the edge
- using \tikzname's implicit positioning mechanism.
- \end{enumerate}
- By default, the key executes the following code:
- \begin{quote}
- |\path [->,every new ->]|\\
- \hbox{}\quad|(|\meta{left node}|\tikzgraphleftanchor) edge [|%
- \meta{edge options}|]| \meta{edge nodes}||\\
- \hbox{}\quad|(|\meta{right node}|\tikzgraphrightanchor);|
- \end{quote}
- You are welcome to change the code underlying the key.
- \begin{stylekey}{/tikz/every new ->}
- This key gets executed by default for a |new ->|.
- \end{stylekey}
- \end{key}
- \begin{key}{/tikz/graphs/left anchor=\meta{anchor}}
- This anchor is used for the node that is to the left of an edge
- specification. Setting this anchor to the empty string means that
- no special anchor is used (which is the default). The
- \meta{anchor} is stored in the macro |\tikzgraphleftanchor| with a
- leading dot.
- \begin{codeexample}[]
+ \item The \meta{options} are executed (inside a local scope) with the path
+ |/tikz/graphs|. These options may setup the connector algorithm (see
+ below) and may also use keys like |edge| or |edge label| to specify how
+ the edge should look like. As a convenience, whenever an unknown key is
+ encountered for the path |/tikz/graphs|, the key is passed to the
+ |edge| key. This means that you can directly use options like |thick|
+ or |red| inside the \meta{options} and they will apply to the edge as
+ expected.
+ \item The chosen connector algorithm, see
+ Section~\ref{section-library-graphs-color-classes}, is used to compute
+ from which of the \meta{left nodes} an edge should lead to which of the
+ \meta{right nodes}. Suppose that $(l_1,r_1)$, \dots, $(l_n,r_n)$ is the
+ list of node pairs that result (so there should be an edge between
+ $l_1$ and $r_1$ and another edge between $l_2$ and $r_2$ and so on).
+ \item For each pair $(l_i,r_i)$ an edge is created. This is done by calling
+ the following key (for the edge specification |->|, other keys are
+ executed for the other kinds of specifications):
+ %
+ \begin{key}{/tikz/graphs/new ->=\marg{left node}\marg{right node}\marg{edge options}\marg{edge nodes}}
+ This key will be called for a |->| edge specification with the
+ following four parameters:
+ %
+ \begin{enumerate}
+ \item \meta{left node} is the name of the ``left'' node, that
+ is, the name of $l_i$.
+ \item \meta{right node} is the name of the right node.
+ \item \meta{edge options} are the accumulated options from all
+ calls of |/tikz/graph/edges| in groups that surround the
+ edge specification.
+ \item \meta{edge nodes} is text like |node {A} node {B}| that
+ specifies some nodes that should be put as labels on the
+ edge using \tikzname's implicit positioning mechanism.
+ \end{enumerate}
+ %
+ By default, the key executes the following code:
+ %
+ \begin{quote}
+ |\path [->,every new ->]|\\
+ \hbox{}\quad|(|\meta{left node}|\tikzgraphleftanchor) edge [|%
+ \meta{edge options}|]| \meta{edge nodes}||\\
+ \hbox{}\quad|(|\meta{right node}|\tikzgraphrightanchor);|
+ \end{quote}
+ %
+ You are welcome to change the code underlying the key.
+ %
+ \begin{stylekey}{/tikz/every new ->}
+ This key gets executed by default for a |new ->|.
+ \end{stylekey}
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/left anchor=\meta{anchor}}
+ This anchor is used for the node that is to the left of an edge
+ specification. Setting this anchor to the empty string means that
+ no special anchor is used (which is the default). The \meta{anchor}
+ is stored in the macro |\tikzgraphleftanchor| with a leading dot.
+ %
+\begin{codeexample}[]
\tikz \graph {
{a,b,c} -> [complete bipartite] {e,f,g}
};
- \end{codeexample}
- \begin{codeexample}[]
+\end{codeexample}
+ %
+\begin{codeexample}[]
\tikz \graph [left anchor=east, right anchor=west] {
{a,b,c} -- [complete bipartite] {e,f,g}
};
- \end{codeexample}
- \end{key}
- \begin{key}{/tikz/graphs/right anchor=\meta{anchor}}
- Works like |left anchor|, only for |\tikzgraphrightanchor|.
- \end{key}
- For the other three kinds of edge specifications, the following keys
- will be called:
- \begin{key}{/tikz/graphs/new --=\marg{left node}\marg{right node}\marg{edge options}\marg{edge nodes}}
- This key is called for |--| with the same parameters as above. The
- only difference in the definition is that in the |\path| command
- the |->| gets replaced by |-|.
- \begin{stylekey}{/tikz/every new --}
- \end{stylekey}
- \end{key}
- \begin{key}{/tikz/graphs/new <->=\marg{left node}\marg{right node}\marg{edge options}\marg{edge nodes}}
- Called for |<->| with the same parameters as above. The |->| is
- replaced by |<-|
- \begin{stylekey}{/tikz/every new <->}
- \end{stylekey}
- \end{key}
- \begin{key}{/tikz/graphs/new <-=\marg{left node}\marg{right node}\marg{edge options}\marg{edge nodes}}
- Called for |<-| with the same parameters as above.%
- \footnote{You might
- wonder why this key is needed: It seems more logical at first
- sight to just call |new edge directed| with swapped first
- parameters. However, a positioning
- algorithm might wish to take the fact into account that an edge is
- ``backward'' rather than ``forward'' in order to
- improve the layout. Also, different arrow heads might be used.}
- \begin{stylekey}{/tikz/every new <-}
- \end{stylekey}
- \end{key}
- \begin{key}{/tikz/graphs/new -\protect\exclamationmarktext-=\marg{left node}\marg{right node}\marg{edge options}\marg{edge nodes}}
- Called for |-!-| with the same parameters as above. Does nothing
- by default.
- \end{key}
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/right anchor=\meta{anchor}}
+ Works like |left anchor|, only for |\tikzgraphrightanchor|.
+ \end{key}
+ %
+ For the other three kinds of edge specifications, the following keys
+ will be called:
+ %
+ \begin{key}{/tikz/graphs/new --=\marg{left node}\marg{right node}\marg{edge options}\marg{edge nodes}}
+ This key is called for |--| with the same parameters as above. The
+ only difference in the definition is that in the |\path| command
+ the |->| gets replaced by |-|.
+ %
+ \begin{stylekey}{/tikz/every new --}
+ \end{stylekey}
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/new <->=\marg{left node}\marg{right node}\marg{edge options}\marg{edge nodes}}
+ Called for |<->| with the same parameters as above. The |->| is
+ replaced by |<-|
+ %
+ \begin{stylekey}{/tikz/every new <->}
+ \end{stylekey}
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/new <-=\marg{left node}\marg{right node}\marg{edge options}\marg{edge nodes}}
+ Called for |<-| with the same parameters as above.%
+ \footnote{%
+ You might wonder why this key is needed: It seems more logical
+ at first sight to just call |new edge directed| with swapped
+ first parameters. However, a positioning algorithm might wish
+ to take the fact into account that an edge is ``backward''
+ rather than ``forward'' in order to improve the layout. Also,
+ different arrow heads might be used.
+ }
+ %
+ \begin{stylekey}{/tikz/every new <-}
+ \end{stylekey}
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/new -\protect\exclamationmarktext-=\marg{left node}\marg{right node}\marg{edge options}\marg{edge nodes}}
+ Called for |-!-| with the same parameters as above. Does nothing by
+ default.
+ \end{key}
\end{enumerate}
-Here is an example that shows the default rendering of the different
-edge specifications:
-
+Here is an example that shows the default rendering of the different edge
+specifications:
+%
\begin{codeexample}[]
\tikz \graph [branch down=5mm] {
a -> b;
@@ -820,66 +833,61 @@ edge specifications:
e <- f;
g <-> h;
i -!- j;
-};
+};
\end{codeexample}
-
\subsubsection{Syntax of Node Specifications}
-
\label{section-library-graphs-node-spec}
-Node specifications are the basic building blocks of a graph
-specification. There are three different possible kinds of node
-specifications, each of which has a different syntax:
-
+Node specifications are the basic building blocks of a graph specification.
+There are three different possible kinds of node specifications, each of which
+has a different syntax:
+%
\begin{description}
-\item[Direct Node Specification]
- \ \\
- \opt{|"|}\meta{node name}\opt{|"|}\opt{|/|\opt{|"|}\meta{text}\opt{|"|}} \opt{\oarg{options}}\\
- (note that the quotation marks are optional and only needed when the
- \meta{node name} contains special symbols)
-\item[Reference Node Specification]
- \ \\
- |(|\meta{node name or node set name}|)|
-\item[Group Node Specification]
- \ \\
- \meta{group specification}
+ \item[Direct Node Specification]
+ \ \\
+ \opt{|"|}\meta{node name}\opt{|"|}\opt{|/|\opt{|"|}\meta{text}\opt{|"|}} \opt{\oarg{options}}\\
+ (note that the quotation marks are optional and only needed when the
+ \meta{node name} contains special symbols)
+ \item[Reference Node Specification]
+ \ \\
+ |(|\meta{node name or node set name}|)|
+ \item[Group Node Specification]
+ \ \\
+ \meta{group specification}
\end{description}
-The rule for determining which of the possible kinds is meant is
-as follows: If the node specification starts with an opening
-parenthesis, a reference node specification is meant; if it starts
-with an opening curly brace, a group specification is meant; and in
-all other cases a direct node specification is meant.
+The rule for determining which of the possible kinds is meant is as follows: If
+the node specification starts with an opening parenthesis, a reference node
+specification is meant; if it starts with an opening curly brace, a group
+specification is meant; and in all other cases a direct node specification is
+meant.
\medskip
-\textbf{Direct Node Specifications.} If after reading the first symbol
-of a node specification is has been detected to be \emph{direct},
-\tikzname\ will collect all text up to the next edge
-specification and store it as the \meta{node name}; however, square
-brackets are used to indicate options and a slash ends the \meta{node
- name} and start a special \meta{text} that is used as a
-rendering text instead of the original \meta{node name}.
-
-Due to the way the parsing works and due to the restrictions on node
-names, most special characters are forbidding inside the \meta{node
- name}, including commas, semicolons, hyphens, braces, dots,
-parentheses, slashes, dashes, and more (but spaces, single
-underscores, and the hat character \emph{are} allowed). To use special
-characters in the name of a node, you can optionally surround the
-\meta{node name} and/or the \meta{text} by quotation marks. In this
-case, you can use all of the special symbols once more. The details
-of what happens, exactly, when the \meta{node name} is surrounded by
-quotation marks is explained later; surrounding the \meta{text} by
-quotation marks has essentially the same effect as surrounding it by
-curly braces.
-
-Once the node name has been determined, it is checked whether the same
-node name was already used inside the current graph. If this is the
-case, then we say that the already existing node is \emph{referenced};
-otherwise we say that the node is \emph{fresh}.
-
+\textbf{Direct Node Specifications.} If after reading the first symbol of a
+node specification is has been detected to be \emph{direct}, \tikzname\ will
+collect all text up to the next edge specification and store it as the
+\meta{node name}; however, square brackets are used to indicate options and a
+slash ends the \meta{node name} and start a special \meta{text} that is used as
+a rendering text instead of the original \meta{node name}.
+
+Due to the way the parsing works and due to the restrictions on node names,
+most special characters are forbidding inside the \meta{node name}, including
+commas, semicolons, hyphens, braces, dots, parentheses, slashes, dashes, and
+more (but spaces, single underscores, and the hat character \emph{are}
+allowed). To use special characters in the name of a node, you can optionally
+surround the \meta{node name} and/or the \meta{text} by quotation marks. In
+this case, you can use all of the special symbols once more. The details of
+what happens, exactly, when the \meta{node name} is surrounded by quotation
+marks is explained later; surrounding the \meta{text} by quotation marks has
+essentially the same effect as surrounding it by curly braces.
+
+Once the node name has been determined, it is checked whether the same node
+name was already used inside the current graph. If this is the case, then we
+say that the already existing node is \emph{referenced}; otherwise we say that
+the node is \emph{fresh}.
+%
\begin{codeexample}[]
\tikz \graph {
a -> b; % both are fresh
@@ -887,25 +895,26 @@ otherwise we say that the node is \emph{fresh}.
};
\end{codeexample}
-This behaviour of deciding whether a node is fresh or referenced can,
-however, be modified by using the following keys:
-\begin{key}{/tikz/graphs/use existing node=\opt{\meta{true or
- false}} (default true)}
- When this key is set to |true|, all nodes will be considered to the
- referenced, no node will be fresh. This option is useful if you have
- already created all the nodes of a graph prior to using the |graph|
- command and you now only wish to connect the nodes.
+This behaviour of deciding whether a node is fresh or referenced can, however,
+be modified by using the following keys:
+%
+\begin{key}{/tikz/graphs/use existing nodes=\opt{\meta{true or false}} (default true)}
+ When this key is set to |true|, all nodes will be considered to the
+ referenced, no node will be fresh. This option is useful if you have
+ already created all the nodes of a graph prior to using the |graph| command
+ and you now only wish to connect the nodes. It also implies that an error
+ is raised if you reference a node which has not been defined previously.
\end{key}
-\begin{key}{/tikz/graphs/fresh nodes=\opt{\meta{true or
- false}} (default true)}
- When this key is set to |true|, all nodes will be considered to be
- fresh. This option is useful when you create for instance a tree
- with many identical nodes.
- When a node name is encountered that was already used previously,
- a new name is chosen is follows: An apostrophe (|'|) is appended
- repeatedly until a node name is found that has not yet been
- used:
+\begin{key}{/tikz/graphs/fresh nodes=\opt{\meta{true or false}} (default true)}
+ When this key is set to |true|, all nodes will be considered to be fresh.
+ This option is useful when you create for instance a tree with many
+ identical nodes.
+
+ When a node name is encountered that was already used previously, a new
+ name is chosen is follows: An apostrophe (|'|) is appended repeatedly until
+ a node name is found that has not yet been used:
+ %
\begin{codeexample}[]
\tikz \graph [branch down=5mm] {
{ [fresh nodes]
@@ -914,20 +923,22 @@ however, be modified by using the following keys:
b -> {c, c},
b -> {c, c},
}
- },
+ },
b' -- b''
};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/graphs/number nodes=\opt{\meta{start number}} (default 1)}
- When this key is used in a scope, each encountered node name will
- get appended a new number, starting with \meta{start}. Typically,
- this ensures that all node names are different. Between the original
- node name and the appended number, the setting of the following will
- be inserted:
- \begin{key}{/tikz/graphs/number nodes sep=\meta{text} (initially \normalfont space)}
- \end{key}
+ When this key is used in a scope, each encountered node name will get
+ appended a new number, starting with \meta{start}. Typically, this ensures
+ that all node names are different. Between the original node name and the
+ appended number, the setting of the following will be inserted:
+ %
+ \begin{key}{/tikz/graphs/number nodes sep=\meta{text} (initially \normalfont space)}
+ \end{key}
+ %
\begin{codeexample}[]
\tikz \graph [branch down=5mm] {
{ [number nodes]
@@ -936,41 +947,43 @@ however, be modified by using the following keys:
b -> {c, c},
b -> {c, c},
}
- },
+ },
b 2 -- b 5
};
\end{codeexample}
+ %
\end{key}
-When a fresh node has been detected, a new node is created in the
-inside a protecting scope. For this, the current
-placement strategy is asked to compute a default position for the
-node, see Section~\ref{section-library-graphs-placement} for
-details. Then, the command
+When a fresh node has been detected, a new node is created in the inside a
+protecting scope. For this, the current placement strategy is asked to compute
+a default position for the node, see
+Section~\ref{section-library-graphs-placement} for details. Then, the command
+%
\begin{quote}
- |\node (|\meta{full node name}|) [|\meta{node options}|] {|\meta{text}|};|
+ |\node (|\meta{full node name}|) [|\meta{node options}|] {|\meta{text}|};|
\end{quote}
+%
is called. The different parameters are as follows:
+%
\begin{itemize}
-\item
- The \meta{full node name} is normally the \meta{node name} that has
- been determined as described before. However, there are two exceptions:
-
- First, if the \meta{node name} is empty (which happens when there
- is no \meta{node name} before the slash), then a fresh internal node
- name is created and used as
- \meta{full node name}. This name is guaranteed to be different from all
- node names used in this or any other graph. Thus, a direct node
- starting with a slash represents an anonymous fresh node.
-
- Second, you can use the following key to prefix the \meta{node name}
- inside the \meta{full node name}:
-
- \begin{key}{/tikz/graphs/name=\meta{text}}
- This key prepends the \meta{text}, followed by a separating symbol
- (a space by default), to all
- \meta{node name}s inside a \meta{full node name}. Repeated calls
- of this key accumulate, leading to ever-longer ``name paths'':
+ \item The \meta{full node name} is normally the \meta{node name} that has
+ been determined as described before. However, there are two exceptions:
+
+ First, if the \meta{node name} is empty (which happens when there is no
+ \meta{node name} before the slash), then a fresh internal node name is
+ created and used as \meta{full node name}. This name is guaranteed to
+ be different from all node names used in this or any other graph. Thus,
+ a direct node starting with a slash represents an anonymous fresh node.
+
+ Second, you can use the following key to prefix the \meta{node name}
+ inside the \meta{full node name}:
+
+ \begin{key}{/tikz/graphs/name=\meta{text}}
+ This key prepends the \meta{text}, followed by a separating symbol
+ (a space by default), to all \meta{node name}s inside a \meta{full
+ node name}. Repeated calls of this key accumulate, leading to
+ ever-longer ``name paths'':
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\graph {
@@ -980,20 +993,22 @@ is called. The different parameters are as follows:
\draw [red] (second 1) circle [radius=3mm];
\end{tikzpicture}
\end{codeexample}
- Note that, indeed, in the above example six nodes are created even
- though the first and second set of nodes have the same \meta{node
- name}. The reason is that the full names of the six nodes are
- all different. Also note that only the \meta{node name} is used as
- the node text, not the full name. This can be changed as described
- later on.
+ %
+ Note that, indeed, in the above example six nodes are created even
+ though the first and second set of nodes have the same \meta{node
+ name}. The reason is that the full names of the six nodes are all
+ different. Also note that only the \meta{node name} is used as the
+ node text, not the full name. This can be changed as described
+ later on.
- This key can be used repeatedly, leading to ever longer node names.
- \end{key}
+ This key can be used repeatedly, leading to ever longer node names.
+ \end{key}
- \begin{key}{/tikz/graphs/name separator=\meta{symbols} (initially \string\space)}
- Changes the symbol that is used to separate the \meta{text} from
- the \meta{node name}. The default is |\space|, resulting in a
- space.
+ \begin{key}{/tikz/graphs/name separator=\meta{symbols} (initially \string\space)}
+ Changes the symbol that is used to separate the \meta{text} from
+ the \meta{node name}. The default is |\space|, resulting in a
+ space.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\graph [name separator=] { % no separator
@@ -1003,6 +1018,7 @@ is called. The different parameters are as follows:
\draw [red] (second1) circle [radius=3mm];
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\graph [name separator=-] {
@@ -1012,110 +1028,127 @@ is called. The different parameters are as follows:
\draw [red] (second-1) circle [radius=3mm];
\end{tikzpicture}
\end{codeexample}
- \end{key}
-\item
- The \meta{node options} are
- \begin{enumerate}
- \item The options that have accumulated in calls to |nodes| from
- the surrounding scopes.
- \item The local \meta{options}.
- \end{enumerate}
- The options are executed with the path prefix |/tikz/graphs|, but
- any unknown key is executed with the prefix |/tikz|. This means, in
- essence, that some esoteric keys are more difficult to use inside
- the options and that any key with the prefix |/tikz/graphs| will
- take precedence over a key with the prefix |/tikz|.
-\item The \meta{text} that is passed to the |\node| command is
- computed as follows: First, you can use the following key to
- directly set the \meta{text}:
- \begin{key}{/tikz/graphs/as=\meta{text}}
- The \meta{text} is used as the text of the node. This allows you
- to provide a text for the node that differs arbitrarily from the
- name of the node.
- \begin{codeexample}[]
+ \end{key}
+ \item The \meta{node options} are
+ %
+ \begin{enumerate}
+ \item The options that have accumulated in calls to |nodes| from
+ the surrounding scopes.
+ \item The local \meta{options}.
+ \end{enumerate}
+ %
+ The options are executed with the path prefix |/tikz/graphs|, but any
+ unknown key is executed with the prefix |/tikz|. This means, in
+ essence, that some esoteric keys are more difficult to use inside the
+ options and that any key with the prefix |/tikz/graphs| will take
+ precedence over a key with the prefix |/tikz|.
+ \item The \meta{text} that is passed to the |\node| command is computed as
+ follows: First, you can use the following key to directly set the
+ \meta{text}:
+ %
+ \begin{key}{/tikz/graphs/as=\meta{text}}
+ The \meta{text} is used as the text of the node. This allows you to
+ provide a text for the node that differs arbitrarily from the name
+ of the node.
+ %
+\begin{codeexample}[]
\tikz \graph { a [as=$x$] -- b [as=$y_5$] -> c [red, as={a--b}] };
- \end{codeexample}
- This key always takes precedence over all of the mechanisms
- described below.
- \end{key}
- In case the |as| key is not used, a default text
- is chosen as follows: First, when a direct node specification
- contains a slash (or, for historical reasons, a double underscore),
- the text to the right of the slash (or double underscore) is stored
- in the macro |\tikzgraphnodetext|; if
- there is no slash, the \meta{node name} is stored in
- |\tikzgraphnodetext|, instead. Then, the current value of the
- following key is used as \meta{text}:
- \begin{key}{/tikz/graphs/typeset=\meta{code}}
- The macro or code stored in this key is used as the
- \meta{text} if the node. Inside the \meta{code}, the following
- macros are available:
- \begin{command}{\tikzgraphnodetext}
- This macro expands to the \meta{text} to the right of the double
- underscore or slash in a direct node specification or, if there
- is no slash, to the \meta{node name}.
- \end{command}
- \begin{command}{\tikzgraphnodename}
- This macro expands to the name of the current node with the
- path.
- \end{command}
- \begin{command}{\tikzgraphnodepath}
- This macro expands to the current path of the node. These
- paths result from the use of the |name| key as described above.
- \end{command}
- \begin{command}{\tikzgraphnodefullname}
- This macro contains the concatenation of the above two.
- \end{command}
- \end{key}
- By default, the typesetter is just set to |\tikzgraphnodetext|,
- which means that the default text of a node is its name. However,
- it may be useful to change this: For instance, you might wish that
- the text of all graph nodes is, say, surrounded by parentheses:
- \begin{codeexample}[]
+\end{codeexample}
+ %
+ This key always takes precedence over all of the mechanisms
+ described below.
+ \end{key}
+ %
+ In case the |as| key is not used, a default text is chosen as follows:
+ First, when a direct node specification contains a slash (or, for
+ historical reasons, a double underscore), the text to the right of the
+ slash (or double underscore) is stored in the macro
+ |\tikzgraphnodetext|; if there is no slash, the \meta{node name} is
+ stored in |\tikzgraphnodetext|, instead. Then, the current value of the
+ following key is used as \meta{text}:
+ %
+ \begin{key}{/tikz/graphs/typeset=\meta{code}}
+ The macro or code stored in this key is used as the \meta{text} if
+ the node. Inside the \meta{code}, the following macros are
+ available:
+ %
+ \begin{command}{\tikzgraphnodetext}
+ This macro expands to the \meta{text} to the right of the
+ double underscore or slash in a direct node specification or,
+ if there is no slash, to the \meta{node name}.
+ \end{command}
+ %
+ \begin{command}{\tikzgraphnodename}
+ This macro expands to the name of the current node without the
+ path.
+ \end{command}
+ %
+ \begin{command}{\tikzgraphnodepath}
+ This macro expands to the current path of the node. These paths
+ result from the use of the |name| key as described above.
+ \end{command}
+ %
+ \begin{command}{\tikzgraphnodefullname}
+ This macro contains the concatenation of the above two.
+ \end{command}
+ \end{key}
+ %
+ By default, the typesetter is just set to |\tikzgraphnodetext|, which
+ means that the default text of a node is its name. However, it may be
+ useful to change this: For instance, you might wish that the text of
+ all graph nodes is, say, surrounded by parentheses:
+ %
+\begin{codeexample}[]
\tikz \graph [typeset=(\tikzgraphnodetext)]
{ a -> b -> c };
- \end{codeexample}
- A more advanced macro might take apart the node text and render it
- differently:
- \begin{codeexample}[]
+\end{codeexample}
+ %
+ A more advanced macro might take apart the node text and render it
+ differently:
+ %
+\begin{codeexample}[]
\def\mytypesetter{\expandafter\myparser\tikzgraphnodetext\relax}
\def\myparser#1 #2 #3\relax{%
$#1_{#2,\dots,#3}$
}
\tikz \graph [typeset=\mytypesetter, grow down]
{ a 1 n -> b 2 m -> c 4 nm };
- \end{codeexample}
- The following styles install useful predefined typesetting macros:
- \begin{key}{/tikz/graphs/empty nodes}
- Just sets |typeset| to nothing, which causes all nodes to have an
- empty text (unless, of course, the |as| option is used):
- \begin{codeexample}[]
-\tikz \graph [empty nodes, nodes={circle, draw}] { a -> {b, c} };
- \end{codeexample}
- \end{key}
- \begin{key}{/tikz/graphs/math nodes}
- Sets |typeset| to |$\tikzgraphnodetext$|, which causes all nodes
- names to be typeset in math mode:
- \begin{codeexample}[]
-\tikz \graph [math nodes, nodes={circle, draw}] { a_1 -> {b^2, c_3^n} };
- \end{codeexample}
- \end{key}
+\end{codeexample}
+ %
+ The following styles install useful predefined typesetting macros:
+ %
+ \begin{key}{/tikz/graphs/empty nodes}
+ Just sets |typeset| to nothing, which causes all nodes to have an
+ empty text (unless, of course, the |as| option is used):
+ %
+\begin{codeexample}[]
+\tikz \graph [empty nodes, nodes={circle, draw}] { a -> {b, c} };
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/math nodes}
+ Sets |typeset| to |$\tikzgraphnodetext$|, which causes all nodes
+ names to be typeset in math mode:
+ %
+\begin{codeexample}[]
+\tikz \graph [math nodes, nodes={circle, draw}] { a_1 -> {b^2, c_3^n} };
+\end{codeexample}
+ \end{key}
\end{itemize}
-If a node is referenced instead of fresh, then this node becomes the
-node that will be connected by the preceding or following edge
-specification to other
-nodes. The \meta{options} are executed even for a referenced node, but
-they cannot be used to change the appearance of the node (because the
-node exists already). Rather, the \meta{options} can only be used to
-change the logical coloring of the node, see
-Section~\ref{section-library-graphs-color-classes} for details.
+If a node is referenced instead of fresh, then this node becomes the node that
+will be connected by the preceding or following edge specification to other
+nodes. The \meta{options} are executed even for a referenced node, but they
+cannot be used to change the appearance of the node (because the node exists
+already). Rather, the \meta{options} can only be used to change the logical
+coloring of the node, see Section~\ref{section-library-graphs-color-classes}
+for details.
\medskip
-\textbf{Quoted Node Names.} When the \meta{node name} and/or the
-\meta{text} of a node is surrounded by quotation marks, you can use
-all sorts of special symbols as part of the text that are
-normally forbidden:
+\textbf{Quoted Node Names.} When the \meta{node name} and/or the \meta{text} of
+a node is surrounded by quotation marks, you can use all sorts of special
+symbols as part of the text that are normally forbidden:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\graph [grow right=2cm] {
@@ -1126,96 +1159,98 @@ normally forbidden:
\end{tikzpicture}
\end{codeexample}
-In detail, for the following happens when qutation marks are
-encountered at the beginning of a node name or its text:
+In detail, for the following happens when quotation marks are encountered at
+the beginning of a node name or its text:
+%
\begin{itemize}
-\item Everything following the quotation mark up to the next single
- quotation mark is collected into a macro \meta{collected}. All sorts
- of special characters, including commas, square brackets, dashes,
- and even backslashes are allowed here. Basically, the only
- restriction is that braces must be balanced.
-\item A double quotation mark (|""|) does not count as the ``next
- single quotation mark.'' Rather, it is replaced by a single
- quotation mark. For instance, |"He said, ""Hello world."""| would be
- stored inside \meta{collected} as |He said, "Hello world."|
- However, this rule applies only on the outer-most level of
- braces. Thus, in
+ \item Everything following the quotation mark up to the next single
+ quotation mark is collected into a macro \meta{collected}. All sorts of
+ special characters, including commas, square brackets, dashes, and even
+ backslashes are allowed here. Basically, the only restriction is that
+ braces must be balanced.
+ \item A double quotation mark (|""|) does not count as the ``next single
+ quotation mark''. Rather, it is replaced by a single quotation mark.
+ For instance, |"He said, ""Hello world."""| would be stored inside
+ \meta{collected} as |He said, "Hello world."| However, this rule
+ applies only on the outer-most level of braces. Thus, in
+ %
\begin{codeexample}[code only]
"He {said, ""Hello world.""}"
\end{codeexample}
- we would get |He {said, ""Hello world.""}| as \meta{collected}.
-\item ``The next single quotation mark'' refers to the next
- quotation mark on the current level of braces, so in
- |"hello {"} world"|, the next quotation mark would be the one
- following |world|.
+ %
+ we would get |He {said, ""Hello world.""}| as \meta{collected}.
+ \item ``The next single quotation mark'' refers to the next quotation mark
+ on the current level of braces, so in |"hello {"} world"|, the next
+ quotation mark would be the one following |world|.
\end{itemize}
-Now, once the \meta{collected} text has been gather, it is used as
-follows: When used as \meta{text} (what is actually displayed), it is
-just used ``as is''. When it is used as \meta{node name}, however, the
-following happens: Every ``special character'' in \meta{collected} is
-replaced by its Unicode name, surrounded by |@|-signs. For instance,
-if \meta{collected} is |Hello, world!|, the \meta{node name} is the
-somewhat longer text |Hello@COMMA@ world@EXCLAMATION MARK@|. Admittedly,
-referencing such a node from outside the graph is
-cumbersome, but when you use exactly the same \meta{collected} text
-once more, the same \meta{node name} will result. The
+Now, once the \meta{collected} text has been gather, it is used as follows:
+When used as \meta{text} (what is actually displayed), it is just used ``as
+is''. When it is used as \meta{node name}, however, the following happens:
+Every ``special character'' in \meta{collected} is replaced by its Unicode
+name, surrounded by |@|-signs. For instance, if \meta{collected} is
+|Hello, world!|, the \meta{node name} is the somewhat longer text
+|Hello@COMMA@ world@EXCLAMATION MARK@|. Admittedly, referencing such a node
+from outside the graph is cumbersome, but when you use exactly the same
+\meta{collected} text once more, the same \meta{node name} will result. The
following characters are considered ``special'':
+%
\begin{quote}
- \texttt{\char`\|}|$&^~_[](){}/.-,+*'`!":;<=>?@#%\{}|%$
+ \texttt{\char`\|}|$&^~_[](){}/.-,+*'`!":;<=>?@#%\{}|%$
\end{quote}
-These are exactly the Unicode character with a decimal code number
-between 33 and 126 that are neither digits nor letters.
-
+%
+These are exactly the Unicode character with a decimal code number between 33
+and 126 that are neither digits nor letters.
\medskip
-\textbf{Reference Node Specifications.} A reference node specification
-is a node specification that starts with an opening parenthesis. In
-this case, parentheses must surround a \meta{name} as in |(foo)|,
-where |foo| is the \meta{name}. The following will now happen:
-
+\textbf{Reference Node Specifications.} A reference node specification is a
+node specification that starts with an opening parenthesis. In this case,
+parentheses must surround a \meta{name} as in |(foo)|, where |foo| is the
+\meta{name}. The following will now happen:
+%
\begin{enumerate}
-\item It is tested whether \meta{name} is the name of a currently
- active \emph{node set}. This case will be discussed in a moment.
-\item Otherwise, the \meta{name} is interpreted and treated as a
- referenced node, but independently of whether the node has already
- been fresh in the current graph or not. In other words, the node
- must have been defined either already inside the graph (in which
- case the parenthesis are more or less superfluous) or it must have
- been defined outside the current picture.
-
- The way the referenced node is handled is the same way as for a
- direct node that is a referenced node.
-
- If the node does not already exist, an error message is printed.
+ \item It is tested whether \meta{name} is the name of a currently active
+ \emph{node set}. This case will be discussed in a moment.
+ \item Otherwise, the \meta{name} is interpreted and treated as a referenced
+ node, but independently of whether the node has already been fresh in
+ the current graph or not. In other words, the node must have been
+ defined either already inside the graph (in which case the parenthesis
+ are more or less superfluous) or it must have been defined outside the
+ current picture.
+
+ The way the referenced node is handled is the same way as for a direct
+ node that is a referenced node.
+
+ If the node does not already exist, an error message is printed.
\end{enumerate}
-Let us now have a look at node sets. Inside a |{tikzpicture}| you can
-locally define a \emph{node set} by using the following key:
+Let us now have a look at node sets. Inside a |{tikzpicture}| you can locally
+define a \emph{node set} by using the following key:
+%
\begin{key}{/tikz/new set=\meta{set name}}
- This will setup a node set named \meta{set name} within the current
- scope. Inside the scope, you can add nodes to the node set using the
- |set| key. If a node set of the same name already exists in the
- current scope, it will be reset and made empty for the current
- scope.
+ This will setup a node set named \meta{set name} within the current scope.
+ Inside the scope, you can add nodes to the node set using the |set| key. If
+ a node set of the same name already exists in the current scope, it will be
+ reset and made empty for the current scope.
- Note that this command has the path |/tikz| and is normally used
- \emph{outside} the |graph| command.
+ Note that this command has the path |/tikz| and is normally used
+ \emph{outside} the |graph| command.
\end{key}
+%
\begin{key}{/tikz/set=\meta{set name}}
- This key can be used as an option with a |node| command. The
- \meta{set name} must be the name of a node set that has previously
- been created inside some enclosing scope via the |new set| key. The
- effect is that the current node is added to the node set.
-\end{key}
-
-When you use a |graph| command inside a scope where some node set
-called \meta{set name} is defined, then inside this |graph| command
-you use |(|\meta{set name}|)| to reference \emph{all} of the nodes in
-the node set. The effect is the same as if instead of the reference to
-the set name you had created a group specification containing a list
-of references to all the nodes that are part of the node set.
-
+ This key can be used as an option with a |node| command. The \meta{set
+ name} must be the name of a node set that has previously been created
+ inside some enclosing scope via the |new set| key. The effect is that the
+ current node is added to the node set.
+\end{key}
+
+When you use a |graph| command inside a scope where some node set called
+\meta{set name} is defined, then inside this |graph| command you use
+|(|\meta{set name}|)| to reference \emph{all} of the nodes in the node set. The
+effect is the same as if instead of the reference to the set name you had
+created a group specification containing a list of references to all the nodes
+that are part of the node set.
+%
\begin{codeexample}[]
\begin{tikzpicture}[new set=red, new set=green, shorten >=2pt]
\foreach \i in {1,2,3} {
@@ -1230,18 +1265,17 @@ of references to all the nodes that are part of the node set.
\end{tikzpicture}
\end{codeexample}
-There is an interesting caveat with referencing node sets: Suppose
-that at the beginning of a graph you just say |(foo);| where |foo| is
-a set name. Unless you have specified special options, this will cause
-the following to happen: A group is created whose members are all the
-nodes of the node set |foo|. These nodes become referenced nodes, but
-otherwise nothing happens since, by default, the nodes of a group are
-not connected automatically. However, the referenced nodes have now
-been referenced inside the graph, you can thus subsequently access
-them as if they had been defined inside the graph. Here is an example
-showing how you can create nodes outside a |graph| command and then
-connect them inside as if they had been declared inside:
-
+There is an interesting caveat with referencing node sets: Suppose that at the
+beginning of a graph you just say |(foo);| where |foo| is a set name. Unless
+you have specified special options, this will cause the following to happen: A
+group is created whose members are all the nodes of the node set |foo|. These
+nodes become referenced nodes, but otherwise nothing happens since, by default,
+the nodes of a group are not connected automatically. However, the referenced
+nodes have now been referenced inside the graph, you can thus subsequently
+access them as if they had been defined inside the graph. Here is an example
+showing how you can create nodes outside a |graph| command and then connect
+them inside as if they had been declared inside:
+%
\begin{codeexample}[]
\begin{tikzpicture}[new set=import nodes]
\begin{scope}[nodes={set=import nodes}] % make all nodes part of this set
@@ -1258,50 +1292,48 @@ connect them inside as if they had been declared inside:
\end{tikzpicture}
\end{codeexample}
-
\medskip
-\textbf{Group Node Specifications.}
-At a place where a node specification should go, you can also instead
-provide a group specification. Since nodes specifications are part of
-chain specifications, which in turn are part of group specifications,
-this is a recursive definition.
-
+\textbf{Group Node Specifications.} At a place where a node specification
+should go, you can also instead provide a group specification. Since nodes
+specifications are part of chain specifications, which in turn are part of
+group specifications, this is a recursive definition.
+%
\begin{codeexample}[]
\tikz \graph { a -> {b,c,d} -> {e -> {f,g}, h} };
\end{codeexample}
-As can be seen in the above example, when two groups of nodes are
-connected via an edge specification, it is not immediately obvious
-which connecting edges are added. This is detailed in
-Section~\ref{section-library-graphs-color-classes}.
-
+As can be seen in the above example, when two groups of nodes are connected via
+an edge specification, it is not immediately obvious which connecting edges are
+added. This is detailed in Section~\ref{section-library-graphs-color-classes}.
\subsubsection{Specifying Tries}
-In computer science, a \emph{trie} is a special kind of tree, where
-for each node and each symbol of an alphabet, there is at most one
-child of the node labeled with this symbol.
+In computer science, a \emph{trie} is a special kind of tree, where for each
+node and each symbol of an alphabet, there is at most one child of the node
+labeled with this symbol.
-The |trie| key is useful for drawing tries, but it can also be used in
-other situations. What it does, essentially, is to prepend the node
-names of all nodes \emph{before} the current node of the current chain
-to the node's name. This will often make it easier or more natural to
-specify graphs in which several nodes have the same label.
+The |trie| key is useful for drawing tries, but it can also be used in other
+situations. What it does, essentially, is to prepend the node names of all
+nodes \emph{before} the current node of the current chain to the node's name.
+This will often make it easier or more natural to specify graphs in which
+several nodes have the same label.
\begin{key}{/tikz/graphs/trie=\opt{\meta{true or false}} (default true, initially false)}
- If this key is set to |true|, after a node has been created on a
- chain, the |name| key is executed with the node's \meta{node
- name}. Thus, all nodes later on this chain have the ``path'' of
- nodes leading to this node as their name. This means, in particular,
- that
- \begin{enumerate}
- \item two nodes of the same name but in different parts of a chain
- will be different,
- \item while if another chain starts with the same nodes, no new
- nodes get created.
- \end{enumerate}
- In total, this is exactly the behaviour you would expect of a trie:
+ If this key is set to |true|, after a node has been created on a chain, the
+ |name| key is executed with the node's \meta{node name}. Thus, all nodes
+ later on this chain have the ``path'' of nodes leading to this node as
+ their name. This means, in particular, that
+ %
+ \begin{enumerate}
+ \item two nodes of the same name but in different parts of a chain will
+ be different,
+ \item while if another chain starts with the same nodes, no new nodes
+ get created.
+ \end{enumerate}
+ %
+ In total, this is exactly the behaviour you would expect of a trie:
+ %
\begin{codeexample}[]
\tikz \graph [trie] {
a -> {
@@ -1311,12 +1343,13 @@ specify graphs in which several nodes have the same label.
}
};
\end{codeexample}
- You can even ``reiterate'' over a path in conjunction with the
- |simple| option. However, in this case, the default placement
- strategies will not work and you will need options like
- |layered layout| from the graph drawing libraries, which need
- Lua\TeX.
-\ifluatex
+ %
+ You can even ``reiterate'' over a path in conjunction with the |simple|
+ option. However, in this case, the default placement strategies will not
+ work and you will need options like |layered layout| from the graph drawing
+ libraries, which need Lua\TeX.
+ %
+\ifluatex
\begin{codeexample}[]
\tikz \graph [trie, simple, layered layout] {
a -> b -> a,
@@ -1324,8 +1357,10 @@ specify graphs in which several nodes have the same label.
a -> {d,a}
};
\end{codeexample}
- In the following example, we setup the |typeset| key so that it
- shows the complete names of the nodes:
+ %
+ In the following example, we setup the |typeset| key so that it shows the
+ complete names of the nodes:
+ %
\begin{codeexample}[]
\tikz \graph [trie, simple, layered layout,
typeset=\tikzgraphnodefullname] {
@@ -1335,8 +1370,10 @@ specify graphs in which several nodes have the same label.
};
\end{codeexample}
\fi
- You can also use the |trie| key locally and later reference nodes
- using their full name:
+ %
+ You can also use the |trie| key locally and later reference nodes using
+ their full name:
+ %
\begin{codeexample}[]
\tikz \graph {
{ [trie, simple]
@@ -1348,82 +1385,77 @@ specify graphs in which several nodes have the same label.
a b ->[red] a c a
};
\end{codeexample}
+ %
\end{key}
\subsection{Quick Graphs}
-
\label{section-library-graphs-quick}
-The graph syntax is powerful, but this power comes at a price: parsing
-the graph syntax, which is done by \TeX, can take some time. Normally,
-the parsing is fast enough that you will not notice it, but it can be
-bothersome when you have graphs with hundreds of nodes as happens
-frequently when nodes are generated algorithmically by some other
-program. Fortunately, when another program generated a graph
-specification, we typically do not need the full power of the graph
-syntax. Rather, a small subset of the graph syntax would suffice that
-allows to specify nodes and edges. For these reasons, the is a special
-``quick'' version of the graph syntax.
-
-Note, however, that using this syntax will usually at most halve the
-time needed to parse a graph. Thus, it really mostly makes sense in
-conjunction with large, algorithmically generated graphs.
+The graph syntax is powerful, but this power comes at a price: parsing the
+graph syntax, which is done by \TeX, can take some time. Normally, the parsing
+is fast enough that you will not notice it, but it can be bothersome when you
+have graphs with hundreds of nodes as happens frequently when nodes are
+generated algorithmically by some other program. Fortunately, when another
+program generated a graph specification, we typically do not need the full
+power of the graph syntax. Rather, a small subset of the graph syntax would
+suffice that allows to specify nodes and edges. For these reasons, the is a
+special ``quick'' version of the graph syntax.
+
+Note, however, that using this syntax will usually at most halve the time
+needed to parse a graph. Thus, it really mostly makes sense in conjunction with
+large, algorithmically generated graphs.
\begin{key}{/tikz/graphs/quick}
- When you provide this key with a graph, the syntax of graph
- specifications gets restricted. You are no longer allowed to use
- certain features of the graph syntax; but all features that are
- still allowed are also allowed in the same way when you do not
- provide the |quick| option. Thus, leaving out the |quick| option
- will never hurt.
-
- Since the syntax is so severely restricted, it is easier to explain
- which aspects of the graph syntax \emph{will} still work:
-
- \begin{enumerate}
- \item
- A quick graph consists of a sequence of either nodes, edges sequences, or
- groups. These are separated by commas or semicolons.
- \item
- Every node is of the form
-
- \begin{quote}
- |"|\meta{node name}|"|\opt{|/"|\meta{node text}|"[|\meta{options}|]|}
- \end{quote}
-
- The quotation marks are mandatory. The part |/"|\meta{node
- text}|"| may be missing, in which case the node name is used as
- the node text. The \meta{options} may also be missing. The
- \meta{node name} may not contain any ``funny'' characters (unlike
- in the normal graph command).
- \item
- Every chain is of the form
-
- \begin{quote}
- \meta{node spec} \meta{connector} \meta{node spec}
- \meta{connector} \dots \meta{connector} \meta{node spec}|;|
- \end{quote}
-
- Here, the \meta{node spec} are node specifications as described
- above, the \meta{connector} is one of the four connectors |->|,
- |<-|, |--|, and |<->| (the connector |-!-| is not allowed since
- the |simple| option is also not allowed). Each connector may be
- followed by options in square brackets. The semicolon may be
- replaced by a comma.
- \item
- Every group is of the form
-
- \begin{quote}
- |{ [|\meta{options}|]| \meta{chains and groups} |};|
- \end{quote}
- The \meta{options} are compulsory. The semicolon can, again, be
- replaced by a comma.
- \item
- The |number nodes| option will work as expected.
- \end{enumerate}
-
- Here is a typical way this syntax might be used:
+ When you provide this key with a graph, the syntax of graph specifications
+ gets restricted. You are no longer allowed to use certain features of the
+ graph syntax; but all features that are still allowed are also allowed in
+ the same way when you do not provide the |quick| option. Thus, leaving out
+ the |quick| option will never hurt.
+
+ Since the syntax is so severely restricted, it is easier to explain which
+ aspects of the graph syntax \emph{will} still work:
+ %
+ \begin{enumerate}
+ \item A quick graph consists of a sequence of either nodes, edges
+ sequences, or groups. These are separated by commas or semicolons.
+ \item Every node is of the form
+ %
+ \begin{quote}
+ |"|\meta{node name}|"|\opt{|/"|\meta{node text}|"[|\meta{options}|]|}
+ \end{quote}
+
+ The quotation marks are mandatory. The part |/"|\meta{node text}|"|
+ may be missing, in which case the node name is used as the node
+ text. The \meta{options} may also be missing. The \meta{node name}
+ may not contain any ``funny'' characters (unlike in the normal
+ graph command).
+ \item Every chain is of the form
+ %
+ \begin{quote}
+ \meta{node spec} \meta{connector} \meta{node spec}
+ \meta{connector} \dots \meta{connector} \meta{node spec}|;|
+ \end{quote}
+
+ Here, the \meta{node spec} are node specifications as described
+ above, the \meta{connector} is one of the four connectors |->|,
+ |<-|, |--|, and |<->| (the connector |-!-| is not allowed since the
+ |simple| option is also not allowed). Each connector may be
+ followed by options in square brackets. The semicolon may be
+ replaced by a comma.
+ \item Every group is of the form
+ %
+ \begin{quote}
+ |{ [|\meta{options}|]| \meta{chains and groups} |};|
+ \end{quote}
+ %
+ The \meta{options} are compulsory. The semicolon can, again, be
+ replaced by a comma.
+ \item The |number nodes| option will work as expected.
+ \end{enumerate}
+
+ Here is a typical way this syntax might be used:
+ %
\begin{codeexample}[]
\tikz \graph [quick] { "a" --["foo"] "b"[x=1] };
\end{codeexample}
@@ -1435,77 +1467,78 @@ conjunction with large, algorithmically generated graphs.
};
\end{codeexample}
- Let us now have a look at the most important things that will
- \emph{not} work when the |quick| option is used:
+ Let us now have a look at the most important things that will \emph{not}
+ work when the |quick| option is used:
- \begin{itemize}
- \item Connecting a node and a group as in |a->{b,c}|.
- \item Node names without quotation marks as in |a--b|.
- \item Everything described in subsequent subsections, which includes
- subgraphs (graph macros), graph sets, graph color classes,
- anonymous nodes, the |fresh nodes| option, sublayouts, simple
- graphs, edge annotations.
- \item Placement strategies -- you either have to define all node
- positions explicitly using |at=| or |x=| and |y=| or you must use
- a graph drawing algorithm like |layered layout|.
- \end{itemize}
+ \begin{itemize}
+ \item Connecting a node and a group as in |a->{b,c}|.
+ \item Node names without quotation marks as in |a--b|.
+ \item Everything described in subsequent subsections, which includes
+ subgraphs (graph macros), graph sets, graph color classes,
+ anonymous nodes, the |fresh nodes| option, sublayouts, simple
+ graphs, edge annotations.
+ \item Placement strategies -- you either have to define all node
+ positions explicitly using |at=| or |x=| and |y=| or you must use a
+ graph drawing algorithm like |layered layout|.
+ \end{itemize}
\end{key}
\subsection{Simple Versus Multi-Graphs}
-
\label{section-library-graphs-simple}
The |graph| library allows you to construct both simple graphs and
-multi-graphs. In a simple graph there can be at most one edge between
-any two vertices, while in a multi-graph there can be multiple edges
-(hence the name). The two keys |multi| and |simple| allow you to
-switch (even locally inside on of the graph's scopes) between which
-kind of graph is being constructed. By default, the |graph| command
-produces a multi-graph since these are faster to construct.
+multi-graphs. In a simple graph there can be at most one edge between any two
+vertices, while in a multi-graph there can be multiple edges (hence the name).
+The two keys |multi| and |simple| allow you to switch (even locally inside on
+of the graph's scopes) between which kind of graph is being constructed. By
+default, the |graph| command produces a multi-graph since these are faster to
+construct.
\begin{key}{/tikz/graphs/multi}
- When this edge is set for a whole graph (which is the default) or
- just for a group (which is useful if the whole graph is simple in
- general, but a part is a multi-graph), then when you specify an edge
- between two nodes several times, several such edges get created:
-
+ When this edge is set for a whole graph (which is the default) or just for
+ a group (which is useful if the whole graph is simple in general, but a
+ part is a multi-graph), then when you specify an edge between two nodes
+ several times, several such edges get created:
+ %
\begin{codeexample}[]
\tikz \graph [multi] { % "multi" is not really necessary here
a ->[bend left, red] b;
a ->[bend right, blue] b;
};
\end{codeexample}
- In case |multi| is used for a scope inside a larger scope where the
- |simple| option is specified, then inside the local |multi| scope
- edges are immediately created and they are completely ignored when
- it comes to deciding which kind of edges should be present in the
- surrounding simple graph. From the surrounding scope's point of view
- it is as if the local |multi| graph contained no edges at all.
+ %
+ In case |multi| is used for a scope inside a larger scope where the
+ |simple| option is specified, then inside the local |multi| scope edges are
+ immediately created and they are completely ignored when it comes to
+ deciding which kind of edges should be present in the surrounding simple
+ graph. From the surrounding scope's point of view it is as if the local
+ |multi| graph contained no edges at all.
- This means, in particular, that you can use the |multi| option with
- a single edge to ``enforce'' this edge to be present in a simple
- graph.
+ This means, in particular, that you can use the |multi| option with a
+ single edge to ``enforce'' this edge to be present in a simple graph.
\end{key}
\begin{key}{/tikz/graphs/simple}
- In contrast a multi-graph, in a simple graph, at most one edge gets
- created for every pair of vertices:
+ In contrast a multi-graph, in a simple graph, at most one edge gets created
+ for every pair of vertices:
+ %
\begin{codeexample}[]
\tikz \graph [simple]{
a ->[bend left, red] b;
a ->[bend right, blue] b;
};
\end{codeexample}
- As can be seen, the second edge ``wins'' over the first edge. The
- general rule is as follows: In a simple graph, whenever an edge
- between two vertices is specified multiple times, only the very last
- specification and its options will actually be executed.
-
- The real power of the |simple| option lies in the fact that you can
- first create a complicated graph and then later redirect and otherwise
- modify edges easily:
+ %
+ As can be seen, the second edge ``wins'' over the first edge. The general
+ rule is as follows: In a simple graph, whenever an edge between two
+ vertices is specified multiple times, only the very last specification and
+ its options will actually be executed.
+ The real power of the |simple| option lies in the fact that you can first
+ create a complicated graph and then later redirect and otherwise modify
+ edges easily:
+ %
\begin{codeexample}[]
\tikz \graph [simple, grow right=2cm] {
{a,b,c,d} ->[complete bipartite] {e,f,g,h};
@@ -1514,14 +1547,13 @@ produces a multi-graph since these are faster to construct.
};
\end{codeexample}
- One particularly interesting kind of edge specification for a simple
- graph is |-!-|. Recall that this is used to indicate that ``no
- edge'' should be added between certain nodes. In a multi-graph, this
- key usually has no effect (unless the key |new -!-| has been
- redefined) and is pretty superfluous. In a simple graph, however, it
- counts as an edge kind and you can thus use it to remove an edge
- that been added previously:
-
+ One particularly interesting kind of edge specification for a simple graph
+ is |-!-|. Recall that this is used to indicate that ``no edge'' should be
+ added between certain nodes. In a multi-graph, this key usually has no
+ effect (unless the key |new -!-| has been redefined) and is pretty
+ superfluous. In a simple graph, however, it counts as an edge kind and you
+ can thus use it to remove an edge that been added previously:
+ %
\begin{codeexample}[]
\tikz \graph [simple] {
subgraph K_n [n=8, clockwise];
@@ -1534,155 +1566,151 @@ produces a multi-graph since these are faster to construct.
};
\end{codeexample}
- Creating a graph such as the above in other fashions is pretty
- awkward.
+ Creating a graph such as the above in other fashions is pretty awkward.
- For every unordered pair $\{u,v\}$ of vertices at most one edge will
- be created in a simple graph. In particular, when you say |a -> b|
- and later also |a <- b|, then only the edge |a <- b| will be
- created. Similarly, when you say |a -> b| and later |b -> a|, then
- only the edge |b -> a| will be created.
+ For every unordered pair $\{u,v\}$ of vertices at most one edge will be
+ created in a simple graph. In particular, when you say |a -> b| and later
+ also |a <- b|, then only the edge |a <- b| will be created. Similarly, when
+ you say |a -> b| and later |b -> a|, then only the edge |b -> a| will be
+ created.
- The power of the |simple| command comes at a certain cost: As the
- graph is being constructed, a (sparse) array is created that keeps
- track for each edge of the last edge being specified. Then, at the
- end of the scope containing the |simple| command, for every pair of
- vertices the edge is created. This is implemented by two nested
- loops iterating over all possible pairs of vertices -- which may
- take quite a while in a graph of, say, 1000 vertices.
- Internally, the |simple| command is implemented as an operator that
- adds the edges when it is called, but
- this should be unimportant in normal situations.
+ The power of the |simple| command comes at a certain cost: As the graph is
+ being constructed, a (sparse) array is created that keeps track for each
+ edge of the last edge being specified. Then, at the end of the scope
+ containing the |simple| command, for every pair of vertices the edge is
+ created. This is implemented by two nested loops iterating over all
+ possible pairs of vertices -- which may take quite a while in a graph of,
+ say, 1000 vertices. Internally, the |simple| command is implemented as an
+ operator that adds the edges when it is called, but this should be
+ unimportant in normal situations.
\end{key}
-
-
\subsection{Graph Edges: Labeling and Styling}
-When the |graph| library creates an edge between two nodes in a graph,
-the appearance (called ``styling'' in \tikzname) can be specified in
-different ways. Sometimes you will simply wish to say ``the edges
-between these two groups of node should be red,'' but sometimes you
-may wish to say ``this particular edge going into this node should be
-red.'' In the following, different ways of specifying such styling
-requirements are discussed. Note that adding labels to edges is, from
-\tikzname's point of view, almost the same as styling edges, since
-they are also specified using options.
+When the |graph| library creates an edge between two nodes in a graph, the
+appearance (called ``styling'' in \tikzname) can be specified in different
+ways. Sometimes you will simply wish to say ``the edges between these two
+groups of node should be red'', but sometimes you may wish to say ``this
+particular edge going into this node should be red''. In the following,
+different ways of specifying such styling requirements are discussed. Note that
+adding labels to edges is, from \tikzname's point of view, almost the same as
+styling edges, since they are also specified using options.
\subsubsection{Options For All Edges Between Two Groups}
-When you write |... ->[options] ...| somewhere inside your graph
-specification, this typically cause one or more edges to be created
-between the nodes in the chain group before the |->| and the nodes in
-the chain group following it. The |options| are applied to all of
-them. In particular, if you use the |quotes| library and you write
-some text in quotes inside the |options|, this text will be added as a
-label to each edge:
-
+When you write |... ->[options] ...| somewhere inside your graph specification,
+this typically cause one or more edges to be created between the nodes in the
+chain group before the |->| and the nodes in the chain group following it. The
+|options| are applied to all of them. In particular, if you use the |quotes|
+library and you write some text in quotes inside the |options|, this text will
+be added as a label to each edge:
+%
\begin{codeexample}[]
-\tikz
+\tikz
\graph [edge quotes=near start] {
{ a, b } -> [red, "x", complete bipartite] { c, d };
};
\end{codeexample}
-As documented in the |quotes| library in more detail, you can easily
-modify the appearance of edge labels created using the quotes syntax
-by adding options after the closing quotes:
-
+As documented in the |quotes| library in more detail, you can easily modify the
+appearance of edge labels created using the quotes syntax by adding options
+after the closing quotes:
+%
\begin{codeexample}[]
\tikz \graph {
a ->["x"] b ->["y"'] c ->["z" red] d;
};
\end{codeexample}
-The following options make it easy to setup the styling of nodes
-created in this way:
-
+The following options make it easy to setup the styling of nodes created in
+this way:
+%
\begin{key}{/tikz/graphs/edge quotes=\opt{\meta{options}}}
- A shorthand for setting the style |every edge quotes| to \meta{options}.
+ A shorthand for setting the style |every edge quotes| to \meta{options}.
\begin{codeexample}[]
\tikz \graph [edge quotes={blue,auto}] {
a ->["x"] b ->["y"'] c ->["b" red] d;
};
\end{codeexample}
+%
\end{key}
\begin{key}{/tikz/graphs/edge quotes center}
- A shorthand for |edge quotes| to |anchor=center|.
+ A shorthand for |edge quotes| to |anchor=center|.
+ %
\begin{codeexample}[]
\tikz \graph [edge quotes center] {
a ->["x"] b ->["y"] c ->["z" red] d;
};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/graphs/edge quotes mid}
- A shorthand for |edge quotes| to |anchor=mid|.
+ A shorthand for |edge quotes| to |anchor=mid|.
+ %
\begin{codeexample}[]
\tikz \graph [edge quotes mid] {
a ->["x"] b ->["y"] c ->["z" red] d;
};
\end{codeexample}
+ %
\end{key}
-
\subsubsection{Changing Options For Certain Edges}
-
Consider the following tree-like graph:
-
+%
\begin{codeexample}[]
\tikz \graph { a -> {b,c} };
\end{codeexample}
-Suppose we wish to specify that the edge from |a| to |b| should be
-red, while the edge from |a| to |c| should be blue. The difficulty
-lies in the fact that \emph{both} edges are created by the single |->|
-operator and we can only add one of these option |red| or |blue| to
-the operator.
-
-There are several ways to solve this problem. First, we can simply
-split up the specification and specify the two edges separately:
+Suppose we wish to specify that the edge from |a| to |b| should be red, while
+the edge from |a| to |c| should be blue. The difficulty lies in the fact that
+\emph{both} edges are created by the single |->| operator and we can only add
+one of these option |red| or |blue| to the operator.
+There are several ways to solve this problem. First, we can simply split up the
+specification and specify the two edges separately:
+%
\begin{codeexample}[]
\tikz \graph {
a -> [red] b;
a -> [blue] c;
-};
+};
\end{codeexample}
-While this works quite well, we can no longer use the nice chain group
-syntax of the |graphs| library. For the rather simple graph |a->{b,c}|
-this is not a big problem, but if you specify a tree with, say, 30
-nodes it is really worthwhile being able to specify the tree ``in its
-natural form in the \TeX\ code'' rather than having to list all of the
-edges explicitly. Also, as can be seen in the above example, the
-node placement is changed, which is not always desirable.
-
-One can sidestep this problem using the |simple| option: This option
-allows you to first specify a graph and then, later on, replace edges
-by other edges and, thereby, provide new options:
-
+%
+While this works quite well, we can no longer use the nice chain group syntax
+of the |graphs| library. For the rather simple graph |a->{b,c}| this is not a
+big problem, but if you specify a tree with, say, 30 nodes it is really
+worthwhile being able to specify the tree ``in its natural form in the \TeX\
+code'' rather than having to list all of the edges explicitly. Also, as can be
+seen in the above example, the node placement is changed, which is not always
+desirable.
+
+One can sidestep this problem using the |simple| option: This option allows you
+to first specify a graph and then, later on, replace edges by other edges and,
+thereby, provide new options:
+%
\begin{codeexample}[]
\tikz \graph [simple] {
a -> {b,c};
a -> [red] b;
a -> [blue] c;
-};
+};
\end{codeexample}
-The first line is the original specification of the tree, while the
-following two lines replace some edges of the tree (in this case, all
-of them) by edges with special options. While this method is slower
-and in the above example creates even longer code, it is very useful
-if you wish to, say, highlight a path in a larger tree: First specify
-the tree normally and, then, ``respecify'' the path or paths with some
-other edge options in force. In the following example, we use this to
-highlight a whole subtree of a larger tree:
-
+The first line is the original specification of the tree, while the following
+two lines replace some edges of the tree (in this case, all of them) by edges
+with special options. While this method is slower and in the above example
+creates even longer code, it is very useful if you wish to, say, highlight a
+path in a larger tree: First specify the tree normally and, then, ``respecify''
+the path or paths with some other edge options in force. In the following
+example, we use this to highlight a whole subtree of a larger tree:
+ %
\begin{codeexample}[]
\tikz \graph [simple] {
% The larger tree, no special options in force
@@ -1690,37 +1718,36 @@ highlight a whole subtree of a larger tree:
b -> {c,d},
e -> {f,g},
h
- },
+ },
{ [edges=red] % Now highlight a part of the tree
a -> e -> {f,g}
}
-};
+};
\end{codeexample}
-
\subsubsection{Options For Incoming and Outgoing Edges}
-When you use the syntax |... ->[options] ...| to specify options, you
-specify options for the ``connections between two sets of nodes''. In
-many cases, however, it will be more natural to specify options ``for
-the edges lead to or coming from a certain node'' and you will want to
-specify these options ``at the node''. Returning to the example of the
-graph |a->{b,c}| where we want a red edge between |a| and |b| and a
-blue edge between |a| and |c|, this could also be phrased as follows:
-``Make the edge leading to |b| red and make the edge leading to |c|
-blue.''
-
-For this situation, the |graph| library offers a number of special
-keys, which are documented in the following. However, most of the time
-you will not use these keys directly, but, rather, use a special
-syntax explained in Section~\ref{section-syntax-outgoing-incoming}.
+When you use the syntax |... ->[options] ...| to specify options, you specify
+options for the ``connections between two sets of nodes''. In many cases,
+however, it will be more natural to specify options ``for the edges lead to or
+coming from a certain node'' and you will want to specify these options ``at
+the node''. Returning to the example of the graph |a->{b,c}| where we want a
+red edge between |a| and |b| and a blue edge between |a| and |c|, this could
+also be phrased as follows: ``Make the edge leading to |b| red and make the
+edge leading to |c| blue''.
+
+For this situation, the |graph| library offers a number of special keys, which
+are documented in the following. However, most of the time you will not use
+these keys directly, but, rather, use a special syntax explained in
+Section~\ref{section-syntax-outgoing-incoming}.
\begin{key}{/tikz/graphs/target edge style=\meta{options}}
- This key can (only) be used with a \emph{node} inside a graph
- specification. When used, the \meta{options} will be added to every
- edge that is created by a connector like |->| in which the node is a
- \emph{target}. Consider the following example:
+ This key can (only) be used with a \emph{node} inside a graph
+ specification. When used, the \meta{options} will be added to every edge
+ that is created by a connector like |->| in which the node is a
+ \emph{target}. Consider the following example:
+ %
\begin{codeexample}[]
\tikz \graph {
{ a, b } ->
@@ -1728,12 +1755,13 @@ syntax explained in Section~\ref{section-syntax-outgoing-incoming}.
{ e, f }
};
\end{codeexample}
- In the example, only when the edge from |a| to |c| is created, |c|
- is the ``target'' of the edge. Thus, only this edge becomes red.
-
- When an edge already has options set directly, the \meta{options}
- are executed after these direct options, thus, they ``overrule''
- them:
+ %
+ In the example, only when the edge from |a| to |c| is created, |c| is the
+ ``target'' of the edge. Thus, only this edge becomes red.
+
+ When an edge already has options set directly, the \meta{options} are
+ executed after these direct options, thus, they ``overrule'' them:
+ %
\begin{codeexample}[]
\tikz \graph {
{ a, b } -> [blue, thick]
@@ -1741,10 +1769,11 @@ syntax explained in Section~\ref{section-syntax-outgoing-incoming}.
{ e, f }
};
\end{codeexample}
-
- The \meta{options} set in this way will stay attached to the node,
- so also for edges created later on that lead to the node will have
- these options set:
+
+ The \meta{options} set in this way will stay attached to the node, so also
+ for edges created later on that lead to the node will have these options
+ set:
+ %
\begin{codeexample}[]
\tikz \graph {
{ a, b } ->
@@ -1754,15 +1783,16 @@ syntax explained in Section~\ref{section-syntax-outgoing-incoming}.
};
\end{codeexample}
- Multiple uses of this key accumulate. However, you may sometimes
- also wish to ``clear'' these options for a key since at some later
- point you no longer wish the \meta{options} to be added when some
- further edges are added. This can be achieved using the following
- key:
- \begin{key}{/tikz/graphs/target edge clear}
- Clears all \meta{options} for edges with the node as a target and
- also edge labels (see below) for this node.
- \end{key}
+ Multiple uses of this key accumulate. However, you may sometimes also wish
+ to ``clear'' these options for a key since at some later point you no
+ longer wish the \meta{options} to be added when some further edges are
+ added. This can be achieved using the following key:
+ %
+ \begin{key}{/tikz/graphs/target edge clear}
+ Clears all \meta{options} for edges with the node as a target and
+ also edge labels (see below) for this node.
+ \end{key}
+ %
\begin{codeexample}[]
\tikz \graph {
{ a, b } ->
@@ -1770,13 +1800,14 @@ syntax explained in Section~\ref{section-syntax-outgoing-incoming}.
b -> c[target edge clear]
};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/graphs/target edge node=\meta{node specification}}
- This key works like |target edge style|, only the \meta{node
- specification} will not be added as options to any newly created
- edges with the current node as their target, but rather it will be
- added as a node specification.
+ This key works like |target edge style|, only the \meta{node specification}
+ will not be added as options to any newly created edges with the current
+ node as their target, but rather it will be added as a node specification.
+ %
\begin{codeexample}[]
\tikz \graph {
{ a, b } ->
@@ -1784,14 +1815,16 @@ syntax explained in Section~\ref{section-syntax-outgoing-incoming}.
{ e, f }
};
\end{codeexample}
- As for |target edge style| multiple uses of this key accumulate and
- the key |target edge clear| will (also) clear all target edge nodes
- that have been set for a node earlier on.
+ %
+ As for |target edge style| multiple uses of this key accumulate and the key
+ |target edge clear| will (also) clear all target edge nodes that have been
+ set for a node earlier on.
\end{key}
\begin{key}{/tikz/graphs/source edge style=\meta{options}}
- Works exactly like |target edge style|, only now the \meta{options}
- are only added when the node is a source of a newly created edge:
+ Works exactly like |target edge style|, only now the \meta{options} are
+ only added when the node is a source of a newly created edge:
+ %
\begin{codeexample}[]
\tikz \graph {
{ a, b } ->
@@ -1799,70 +1832,78 @@ syntax explained in Section~\ref{section-syntax-outgoing-incoming}.
{ e, f }
};
\end{codeexample}
- If both for the source and also for the target of an edge
- \meta{options} have been specified, the options are applied in the
- following order:
- \begin{enumerate}
- \item First come the options from the edge itself.
- \item Then come the options contributed by the source node using
- this key.
- \item Then come the options contributed by the target node using
- |target node style|.
- \end{enumerate}
+ %
+ If both for the source and also for the target of an edge \meta{options}
+ have been specified, the options are applied in the following order:
+ %
+ \begin{enumerate}
+ \item First come the options from the edge itself.
+ \item Then come the options contributed by the source node using this
+ key.
+ \item Then come the options contributed by the target node using
+ |target node style|.
+ \end{enumerate}
+ %
\begin{codeexample}[]
\tikz \graph {
a [source edge style=red] ->[green]
b [target edge style=blue] % blue wins
};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/graphs/source edge node=\meta{node specification}}
- Works like |source edge style| and |target edge node|.
+ Works like |source edge style| and |target edge node|.
\end{key}
\begin{key}{/tikz/graphs/source edge clear=\meta{node specification}}
- Works like |target edge clear|.
+ Works like |target edge clear|.
\end{key}
-
\subsubsection{Special Syntax for Options For Incoming and Outgoing Edges}
\label{section-syntax-outgoing-incoming}
-The keys |target node style| and its friends are powerful, but a bit
-cumbersome to write down. For this reason, the |graphs| library
-introduces a special syntax that is based on what I call the
-``first-char syntax'' of keys. Inside the options of a node inside a
-graph, the following special rules apply:
+The keys |target node style| and its friends are powerful, but a bit cumbersome
+to write down. For this reason, the |graphs| library introduces a special
+syntax that is based on what I call the ``first-char syntax'' of keys. Inside
+the options of a node inside a graph, the following special rules apply:
+%
\begin{enumerate}
-\item Whenever an option starts with |>|, the rest of the options are
- passed to |target edge style|. For instance, when you write
- |a[>red]|, then this has the same effect as if you had written
+ \item Whenever an option starts with |>|, the rest of the options are
+ passed to |target edge style|. For instance, when you write |a[>red]|,
+ then this has the same effect as if you had written
+ %
\begin{codeexample}[code only]
-a[target edge style={red}]
+a[target edge style={red}]
\end{codeexample}
-\item Whenever an options starts with |<|, the rest of the options are
- passed to |source edge style|.
-\item In both of the above case, in case the options following the |>|
- or |<| sign start with a quote, the created edge label is passed to
- |source edge node| or |target edge node|, respectively.
+ %
+ \item Whenever an options starts with |<|, the rest of the options are
+ passed to |source edge style|.
+ \item In both of the above case, in case the options following the |>| or
+ |<| sign start with a quote, the created edge label is passed to
+ |source edge node| or |target edge node|, respectively.
- This is exactly what you want to happen.
+ This is exactly what you want to happen.
\end{enumerate}
-Additionally, the following styles provide shorthands for ``clearing''
-the target and source options:
+%
+Additionally, the following styles provide shorthands for ``clearing'' the
+target and source options:
+%
\begin{key}{/tikz/graphs/clear >}
- A more easy-to-remember shorthand for |target edge clear|.
+ A more easy-to-remember shorthand for |target edge clear|.
\end{key}
+%
\begin{key}{/tikz/graphs/clear <}
- A more easy-to-remember shorthand for |source edge clear|.
+ A more easy-to-remember shorthand for |source edge clear|.
\end{key}
-These mechanisms make it especially easy to create trees in which the
-edges are labeled in some special way:
+These mechanisms make it especially easy to create trees in which the edges are
+labeled in some special way:
+%
\begin{codeexample}[]
-\tikz
+\tikz
\graph [edge quotes={fill=white,inner sep=1pt},
grow down, branch right] {
/ -> h [>"9"] -> {
@@ -1878,10 +1919,11 @@ edges are labeled in some special way:
\subsubsection{Placing Node Texts on Incoming Edges}
-Normally, the text of a node is shown (only) inside the node. In some
-case, for instance when drawing certain kind of trees, the nodes
-themselves should not get any text, but rather the edge leading to the
-node should be labeled as in the following example:
+Normally, the text of a node is shown (only) inside the node. In some case, for
+instance when drawing certain kind of trees, the nodes themselves should not
+get any text, but rather the edge leading to the node should be labeled as in
+the following example:
+%
\begin{codeexample}[]
\tikz \graph [empty nodes]
{
@@ -1889,87 +1931,90 @@ node should be labeled as in the following example:
a [>"a"],
b [>"b"] -> {
c [>"c"],
- d [>"d"]
+ d [>"d"]
}
}
};
\end{codeexample}
-As the example shows, it is a bit cumbersome that we have to label the
-nodes and then specify the same text once more using the incoming edge
-syntax.
+%
+As the example shows, it is a bit cumbersome that we have to label the nodes
+and then specify the same text once more using the incoming edge syntax.
-For these cases, it would be better if the text of the node where not
-used with the node but, rather, be passed directly to the incoming or
-the outgoing edge. The following styles do exactly this:
+For these cases, it would be better if the text of the node where not used with
+the node but, rather, be passed directly to the incoming or the outgoing edge.
+The following styles do exactly this:
\begin{key}{/tikz/graphs/put node text on incoming edges=\opt{\meta{options}}}
- When this key is used with a node or a group, the following happens:
- \begin{enumerate}
- \item The command |target edge node={node[|\meta{options}|]{\tikzgraphnodetext}}|
- is executed. This means that all incoming edges of the node get a
- label with the text that would usually be displayed in the
- node. You can use keys like |math nodes| normally.
- \item The command |as={}| is executed. This means that the node
- itself will display nothing.
- \end{enumerate}
- Here is an example that show how this command is used.
+ When this key is used with a node or a group, the following happens:
+ %
+ \begin{enumerate}
+ \item The command
+ |target edge node={node[|\meta{options}|]{\tikzgraphnodetext}}| is
+ executed. This means that all incoming edges of the node get a
+ label with the text that would usually be displayed in the node.
+ You can use keys like |math nodes| normally.
+ \item The command |as={}| is executed. This means that the node itself
+ will display nothing.
+ \end{enumerate}
+ %
+ Here is an example that show how this command is used.
+ %
\begin{codeexample}[]
\tikz \graph [put node text on incoming edges,
math nodes, nodes={circle,draw}]
{ a -> b -> {c, d} };
\end{codeexample}
+ %
\end{key}
-\begin{key}{/tikz/graphs/put node text on outgoing
- edges=\opt{\meta{options}}}
- Works like the previous key, only with |target| replaced by |source|.
+\begin{key}{/tikz/graphs/put node text on outgoing edges=\opt{\meta{options}}}
+ Works like the previous key, only with |target| replaced by |source|.
\end{key}
-
\subsection{Graph Operators, Color Classes, and Graph Expressions}
\label{section-library-graphs-color-classes}
-\tikzname's |graph| command employs a powerful mechanism for
-adding edges between nodes and sets of nodes. To a graph theorist,
-this mechanism may be known as a \emph{graph expression}: A graph is
-specified by starting with small graphs and then applying
-\emph{operators} to them that form larger graphs and that connect and
-recolor colored subsets of the graph's node in different ways.
+\tikzname's |graph| command employs a powerful mechanism for adding edges
+between nodes and sets of nodes. To a graph theorist, this mechanism may be
+known as a \emph{graph expression}: A graph is specified by starting with small
+graphs and then applying \emph{operators} to them that form larger graphs and
+that connect and recolor colored subsets of the graph's node in different ways.
\subsubsection{Color Classes}
-
\label{section-library-graph-coloring}
-\tikzname\ keeps track of a \emph{(multi)coloring} of the graph as it
-is being constructed. This does not mean that the
-actual color of the nodes on the page will be different, rather, in
-the following we refer to ``logical'' colors in the way graph
-theoreticians do. These ``logical'' colors are only important while
-the graph is being constructed and they are ``thrown away'' at the end
-of the construction. The actual (``physical'') colors of the nodes are
-set independently of these logical colors.
+\tikzname\ keeps track of a \emph{(multi)coloring} of the graph as it is being
+constructed. This does not mean that the actual color of the nodes on the page
+will be different, rather, in the following we refer to ``logical'' colors in
+the way graph theoreticians do. These ``logical'' colors are only important
+while the graph is being constructed and they are ``thrown away'' at the end of
+the construction. The actual (``physical'') colors of the nodes are set
+independently of these logical colors.
As a graph is being constructed, each node can be part of one or more
overlapping \emph{color classes}. So, unlike what is sometimes called a
-\emph{legal coloring}, the logical colorings that \tikzname\ keeps
-track of may assign multiple colors to the same node and two nodes
-connected by an edge may well have the same color.
+\emph{legal coloring}, the logical colorings that \tikzname\ keeps track of may
+assign multiple colors to the same node and two nodes connected by an edge may
+well have the same color.
-Color classes must be declared prior to use. This is done using the
-following key:
+Color classes must be declared prior to use. This is done using the following
+key:
+%
\begin{key}{/tikz/graphs/color class=\meta{color class name}}
- This sets up a new color class called \meta{color class name}. Nodes
- and whole groups of nodes can now be colored with \meta{color class
- name}. This is done using the following keys, which become
- available inside the current scope:
- \begin{key}{/tikz/graphs/\meta{color class name}}
- This key internally uses the |operator| command to setup an
- operator that will cause all nodes of the current group to get the
- ``logical color'' \meta{color class name}. Nodes retain this color
- in all encompassing scopes, unless it is explicitly changed (see
- below) or unset (again, see below).
+ This sets up a new color class called \meta{color class name}. Nodes and
+ whole groups of nodes can now be colored with \meta{color class name}. This
+ is done using the following keys, which become
+ available inside the current scope:
+ %
+ \begin{key}{/tikz/graphs/\meta{color class name}}
+ This key internally uses the |operator| command to setup an operator
+ that will cause all nodes of the current group to get the ``logical
+ color'' \meta{color class name}. Nodes retain this color in all
+ encompassing scopes, unless it is explicitly changed (see below) or
+ unset (again, see below).
+ %
\begin{codeexample}[]
\tikz \graph [color class=red] {
[cycle=red] % causes all "logically" red nodes to be connected in
@@ -1980,6 +2025,7 @@ following key:
e
};
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \graph [color class=red, color class=green,
math nodes, clockwise, n=5] {
@@ -1988,161 +2034,177 @@ following key:
{ [green] g_1, g_2, g_3 }
};
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/graphs/not \meta{color class name}}
- Sets up an operator for the current scope so that all nodes in it
- loose the color \meta{color class name}. You can also use
- |!|\meta{color class name} as an alias for this key.
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/not \meta{color class name}}
+ Sets up an operator for the current scope so that all nodes in it loose
+ the color \meta{color class name}. You can also use |!|\meta{color
+ class name} as an alias for this key.
+ %
\begin{codeexample}[]
\tikz \graph [color class=red, color class=green,
math nodes, clockwise, n=5] {
[complete bipartite={red}{green}]
{ [red] r_1, r_2 },
{ [green] g_1, g_2, g_3 },
- g_2 [recolor green by=red]
+ g_2 [not green]
};
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/graphs/recolor \meta{color class name} by=\meta{new color}}
- Causes all keys having color \meta{color class name} to get
- \meta{new color} instead. They loose having color \meta{color
- class name}, but other colors are not affected.
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/recolor \meta{color class name} by=\meta{new color}}
+ Causes all keys having color \meta{color class name} to get \meta{new
+ color} instead. They loose having color \meta{color class name}, but
+ other colors are not affected.
+ %
\begin{codeexample}[]
\tikz \graph [color class=red, color class=green,
math nodes, clockwise, n=5] {
[complete bipartite={red}{green}]
{ [red] r_1, r_2 },
{ [green] g_1, g_2, g_3 },
- g_2 [not green]
+ g_2 [recolor green by=red]
};
\end{codeexample}
- \end{key}
+ \end{key}
\end{key}
The following color classes are available by default:
+%
\begin{itemize}
-\item
- Color class |all|. Every node is part of this class by default. This
- is useful to access all nodes of a (sub)graph, since you can simply
- access all nodes of this color class.
-\item
- Color classes |source| and |target|. These classes are used to
- identify nodes that lead ``into'' a group of nodes and nodes from
- which paths should ``leave'' the group. Details on how these colors
- are assigned are explained in
- Section~\ref{section-library-graphs-join}. By saying |not source| or
- |not target| with a node, you can influence how it is connected:
- \begin{codeexample}[]
-\tikz \graph { a -> { b, c, d } -> e };
+ \item Color class |all|. Every node is part of this class by default. This
+ is useful to access all nodes of a (sub)graph, since you can simply
+ access all nodes of this color class.
+ \item Color classes |source| and |target|. These classes are used to
+ identify nodes that lead ``into'' a group of nodes and nodes from which
+ paths should ``leave'' the group. Details on how these colors are
+ assigned are explained in Section~\ref{section-library-graphs-join}. By
+ saying |not source| or |not target| with a node, you can influence how
+ it is connected:
+ %
+\begin{codeexample}[]
+\tikz \graph { a -> { b, c, d } -> e };
\end{codeexample}
\begin{codeexample}[]
-\tikz \graph { a -> { b[not source], c, d[not target] } -> e };
+\tikz \graph { a -> { b[not source], c, d[not target] } -> e };
\end{codeexample}
-\item
- Color classes |source'| and |target'|. These are temporary colors
- that are also explained in
- Section~\ref{section-library-graphs-join}.
+ %
+ \item Color classes |source'| and |target'|. These are temporary colors
+ that are also explained in Section~\ref{section-library-graphs-join}.
\end{itemize}
-
\subsubsection{Graph Operators on Groups of Nodes}
-Recall that the |graph| command constructs graphs recursively from
-nested \meta{group specifications}. Each such \meta{group
- specification} describes a subset of the nodes of the final graph. A
-\emph{graph operator} is an algorithm that gets the nodes of a group
-as input and (typically) adds edges between these nodes in some
-sensible way. For instance, the |clique| operator will simply add
-edges between all nodes of the group.
+Recall that the |graph| command constructs graphs recursively from nested
+\meta{group specifications}. Each such \meta{group specification} describes a
+subset of the nodes of the final graph. A \emph{graph operator} is an algorithm
+that gets the nodes of a group as input and (typically) adds edges between
+these nodes in some sensible way. For instance, the |clique| operator will
+simply add edges between all nodes of the group.
\begin{key}{/tikz/graphs/operator=\meta{code}}
- This key has an effect in three places:
- \begin{enumerate}
- \item It can be used in the \meta{options} of a \meta{direct node specification}.
- \item It can be used in the \meta{options} of a \meta{group
- specification}.
- \item It can be used in the \meta{options} of an \meta{edge specification}.
- \end{enumerate}
- The first case is a special case of the second, since it is treated
- like a group specification containing a single node. The last case
- is more complicated and discussed in the next section.
- So, let us focus on the second case.
-
- Even though the \meta{options} of a group are given at the beginning
- of the \meta{group specification}, the \meta{code} is only executed
- when the group has been parsed completely and all its nodes have
- been identified. If you use the |operator| multiple times in the
- \meta{options}, the effect accumulates, that is, all code passed to
- the different calls of |operator| gets executed in the order it is
- encountered.
-
- The \meta{code} can do ``whatever it wants,'' but it will typically
- add edges between certain nodes. You can configure what kind of
- edges (directed, undirected, etc.) are created by using the
- following keys:
- \begin{key}{/tikz/graphs/default edge kind=\meta{value} (initially --)}
- This key stores one of the five edge kinds |--|, |<-|, |->|,
- |<->|, and |-!-|. When an operator wishes to create a new edge, it
- should typically set
+ This key has an effect in three places:
+ %
+ \begin{enumerate}
+ \item It can be used in the \meta{options} of a \meta{direct node
+ specification}.
+ \item It can be used in the \meta{options} of a \meta{group
+ specification}.
+ \item It can be used in the \meta{options} of an \meta{edge
+ specification}.
+ \end{enumerate}
+ %
+ The first case is a special case of the second, since it is treated like a
+ group specification containing a single node. The last case is more
+ complicated and discussed in the next section. So, let us focus on the
+ second case.
+
+ Even though the \meta{options} of a group are given at the beginning of the
+ \meta{group specification}, the \meta{code} is only executed when the group
+ has been parsed completely and all its nodes have been identified. If you
+ use the |operator| multiple times in the \meta{options}, the effect
+ accumulates, that is, all code passed to the different calls of |operator|
+ gets executed in the order it is encountered.
+
+ The \meta{code} can do ``whatever it wants'', but it will typically add
+ edges between certain nodes. You can configure what kind of edges
+ (directed, undirected, etc.) are created by using the following keys:
+ %
+ \begin{key}{/tikz/graphs/default edge kind=\meta{value} (initially -\/-)}
+ This key stores one of the five edge kinds |--|, |<-|, |->|, |<->|, and
+ |-!-|. When an operator wishes to create a new edge, it should
+ typically set
+ %
\begin{codeexample}[code only]
-\tikzgraphsset{new \pfkeysvalueof{/tikz/graphs/default edge kind}=...}
-\end{codeexample}
- While this key can be set explicitly, it may be more convenient to
- use the abbreviating keys listed below. Also, this key is
- automatically set to the current value of \meta{edge
- specification} when a joining operator is called, see the
- discussion of joining operators in
- Section~\ref{section-library-graphs-join}.
- \end{key}
- \begin{key}{/tikz/graphs/--}
- Sets the |default edge kind| to |--|.
-\begin{codeexample}[]
-\tikz \graph { subgraph K_n [--, n=5, clockwise, radius=6mm] };
-\end{codeexample}
- \end{key}
- \begin{key}{/tikz/graphs/->}
- Sets the |default edge kind| to |->|.
-\begin{codeexample}[]
-\tikz \graph { subgraph K_n [->, n=5, clockwise, radius=6mm] };
-\end{codeexample}
- \end{key}
- \begin{key}{/tikz/graphs/<-}
- Sets the |default edge kind| to |<-|.
-\begin{codeexample}[]
-\tikz \graph { subgraph K_n [<-, n=5, clockwise, radius=6mm] };
-\end{codeexample}
- \end{key}
- \begin{key}{/tikz/graphs/<->}
- Sets the |default edge kind| to |<->|.
-\begin{codeexample}[]
-\tikz \graph { subgraph K_n [<->, n=5, clockwise, radius=6mm] };
-\end{codeexample}
- \end{key}
- \begin{key}{/tikz/graphs/-\protect\exclamationmarktext-}
- Sets the |default edge kind| to |-!-|.
- \end{key}
-
- When the \meta{code} of an operator is executed, the following
- commands can be used to find the nodes that should be connected:
- \begin{command}{\tikzgraphforeachcolorednode\marg{color name}\marg{macro}}
- When this command is called inside \meta{code}, the following will
- happen: \tikzname\ will iterate over all nodes inside the
- just-specified group that have the color \meta{color name}. The
- order in which they are iterated over is the order in which they
- appear inside the group specification (if a node is encountered
- several times inside the specification, only the first occurrence
- counts). Then, for each node the \meta{macro} is executed with the
- node's name as the only argument.
-
- In the following example we use an operator to connect every
- node colored |all| inside the subgroup to he node |root|.
- \begin{codeexample}[]
-\def\myconnect#1{\tikzset{graphs/new ->={root}{#1}{}{}}}
+\tikzgraphsset{new \pfkeysvalueof{/tikz/graphs/default edge kind}=...}
+\end{codeexample}
+ %
+ While this key can be set explicitly, it may be more convenient to use
+ the abbreviating keys listed below. Also, this key is automatically set
+ to the current value of \meta{edge specification} when a joining
+ operator is called, see the discussion of joining operators in
+ Section~\ref{section-library-graphs-join}.
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/--}
+ Sets the |default edge kind| to |--|.
+ %
+\begin{codeexample}[]
+\tikz \graph { subgraph K_n [--, n=5, clockwise, radius=6mm] };
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/->}
+ Sets the |default edge kind| to |->|.
+ %
+\begin{codeexample}[]
+\tikz \graph { subgraph K_n [->, n=5, clockwise, radius=6mm] };
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/<-}
+ Sets the |default edge kind| to |<-|.
+ %
+\begin{codeexample}[]
+\tikz \graph { subgraph K_n [<-, n=5, clockwise, radius=6mm] };
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/<->}
+ Sets the |default edge kind| to |<->|.
+ %
+\begin{codeexample}[]
+\tikz \graph { subgraph K_n [<->, n=5, clockwise, radius=6mm] };
+\end{codeexample}
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/-\protect\exclamationmarktext-}
+ Sets the |default edge kind| to |-!-|.
+ \end{key}
+
+ When the \meta{code} of an operator is executed, the following commands can
+ be used to find the nodes that should be connected:
+ %
+ \begin{command}{\tikzgraphforeachcolorednode\marg{color name}\marg{macro}}
+ When this command is called inside \meta{code}, the following will
+ happen: \tikzname\ will iterate over all nodes inside the
+ just-specified group that have the color \meta{color name}. The order
+ in which they are iterated over is the order in which they appear
+ inside the group specification (if a node is encountered several times
+ inside the specification, only the first occurrence counts). Then, for
+ each node the \meta{macro} is executed with the node's name as the only
+ argument.
+
+ In the following example we use an operator to connect every node
+ colored |all| inside the subgroup to he node |root|.
+ %
+\begin{codeexample}[]
+\def\myconnect#1{\tikzset{graphs/new ->={root}{#1}{}{}}}
\begin{tikzpicture}
\node (root) at (-1,-1) {root};
-
+
\graph {
x,
{
@@ -2151,26 +2213,26 @@ edges between all nodes of the group.
}
};
\end{tikzpicture}
- \end{codeexample}
- \end{command}
-
- \begin{command}{\tikzgraphpreparecolor\marg{color
- name}\marg{counter}\marg{prefix}}
- This command is used to ``prepare'' the nodes of a certain color
- for random access. The effect is the following: It is counted how
- many nodes there are having color \meta{color name} in the current
- group and the result is stored in \meta{counter}. Next, macros
- named \meta{prefix}|1|, \meta{prefix}|2|, and so on are defined,
- that store the names of the first, second, third, and so on node
- having the color \meta{color name}.
-
- The net effect is that after you have prepared a color, you can
- quickly iterate over them. This is especially useful when you
- iterate over several color at the same time.
-
- As an example, let us create an operator then adds a zig-zag path
- between two color classes:
- \begin{codeexample}[]
+\end{codeexample}
+ \end{command}
+
+ \begin{command}{\tikzgraphpreparecolor\marg{color name}\marg{counter}\marg{prefix}}
+ This command is used to ``prepare'' the nodes of a certain color for
+ random access. The effect is the following: It is counted how many
+ nodes there are having color \meta{color name} in the current group and
+ the result is stored in \meta{counter}. Next, macros named
+ \meta{prefix}|1|, \meta{prefix}|2|, and so on are defined, that store
+ the names of the first, second, third, and so on node having the color
+ \meta{color name}.
+
+ The net effect is that after you have prepared a color, you can quickly
+ iterate over them. This is especially useful when you iterate over
+ several color at the same time.
+
+ As an example, let us create an operator then adds a zig-zag path
+ between two color classes:
+ %
+\begin{codeexample}[]
\newcount\leftshorecount \newcount\rightshorecount
\newcount\mycount \newcount\myothercount
\def\zigzag{
@@ -2187,7 +2249,7 @@ edges between all nodes of the group.
\advance\myothercount by1\relax%
\tikzgraphsset{new <-=
{\csname left shore prefix\the\myothercount\endcsname}
- {\csname right shore prefix\the\mycount\endcsname}{}{}}
+ {\csname right shore prefix\the\mycount\endcsname}{}{}}
\ifnum\myothercount<\leftshorecount\relax
\repeat
}
@@ -2199,160 +2261,159 @@ edges between all nodes of the group.
};
\end{tikzpicture}
\end{codeexample}
- Naturally, in order to turn the above code into a usable operator,
- some more code would be needed (like default values and taking
- care of shores of different sizes).
- \end{command}
+ %
+ Naturally, in order to turn the above code into a usable operator, some
+ more code would be needed (like default values and taking care of
+ shores of different sizes).
+ \end{command}
\end{key}
-There are a number of predefined operators, like |clique| or |cycle|,
-see the reference Section~\ref{section-library-graphs-reference} for a
-complete list.
-
+There are a number of predefined operators, like |clique| or |cycle|, see the
+reference Section~\ref{section-library-graphs-reference} for a complete list.
\subsubsection{Graph Operators for Joining Groups}
\label{section-library-graphs-join}
-When you join two nodes |foo| and |bar| by the edge specification
-|->|, it is fairly obvious, what should happen: An edge from |(foo)|
-to |(bar)| should be created. However, suppose we use an edge
-specification between two node sets like |{a,b,c}| and |{d,e,f}|. In
-this case, it is not so clear which edges should be created. One might
-argue that all possible edges from any node in the first set to any node
-in the second set should be added. On the other hand, one might also
-argue that only a matching between these two sets should be
-created. Things get even more muddy when a longer chain of node sets
-are joined.
-
-Instead of fixing how edges are created between two node sets,
-\tikzname\ takes a somewhat more general, but also more complicated
-approach, which can be broken into two parts. In the following, assume
-that the following chain specification is given:
+When you join two nodes |foo| and |bar| by the edge specification |->|, it is
+fairly obvious, what should happen: An edge from |(foo)| to |(bar)| should be
+created. However, suppose we use an edge specification between two node sets
+like |{a,b,c}| and |{d,e,f}|. In this case, it is not so clear which edges
+should be created. One might argue that all possible edges from any node in the
+first set to any node in the second set should be added. On the other hand, one
+might also argue that only a matching between these two sets should be created.
+Things get even more muddy when a longer chain of node sets are joined.
+
+Instead of fixing how edges are created between two node sets, \tikzname\ takes
+a somewhat more general, but also more complicated approach, which can be
+broken into two parts. In the following, assume that the following chain
+specification is given:
+%
\begin{quote}
- \meta{spec$_1$} \meta{edge specification} \meta{spec$_2$}
+ \meta{spec$_1$} \meta{edge specification} \meta{spec$_2$}
\end{quote}
+%
An example might be |{a,b,c} -> {d, e->f}|.
\medskip
-\textbf{The source and target vertices.} Let us start with the
-question of which vertices of the first node set should be connected to
-vertices in the second node set.
-
-There are two predefined special color classes that are used for this:
-|source| and |target|. For every group specification, some vertices
-are colored as |source| vertices and some vertices are |target|
-vertices (a node can both be a target and a source). Initially, every
-vertex is both a source and a target, but that can change as we will
-see in a moment.
-
-The intuition behind source and target vertices is that, in some
-sense, edges ``from the outside'' lead into the group via the source
-vertices and lead out of the group via the target vertices. To be more
-precise, the following happens:
+\textbf{The source and target vertices.} Let us start with the question of
+which vertices of the first node set should be connected to vertices in the
+second node set.
+
+There are two predefined special color classes that are used for this: |source|
+and |target|. For every group specification, some vertices are colored as
+|source| vertices and some vertices are |target| vertices (a node can both be a
+target and a source). Initially, every vertex is both a source and a target,
+but that can change as we will see in a moment.
+
+The intuition behind source and target vertices is that, in some sense, edges
+``from the outside'' lead into the group via the source vertices and lead out
+of the group via the target vertices. To be more precise, the following
+happens:
+%
\begin{enumerate}
-\item The target vertices of the first group are connected to
- the source vertices of the second group.
-\item In the group resulting from the union of the nodes from
- \meta{spec$_1$} and \meta{spec$_2$}, the source vertices are only
- those from the first group, and the target vertices are only those
- from the second group.
+ \item The target vertices of the first group are connected to the source
+ vertices of the second group.
+ \item In the group resulting from the union of the nodes from
+ \meta{spec$_1$} and \meta{spec$_2$}, the source vertices are only those
+ from the first group, and the target vertices are only those from the
+ second group.
\end{enumerate}
Let us go over the effect of these rules for the example
-|{a,b,c} -> {d, e->f}|. First, each individual node is initially both
-a |source| and a |target| vertex. Then, in |{a,b,c}| all nodes are
-still both source and target vertices since just grouping vertices
-does not change their colors. Now, in |e->f| something interesting
-happens for the first time: the target vertices of the ``group'' |e|
-(which is just the node |e|) are connected to the source vertices of
-the ``group'' |f|. This means, that an edge is added from |e| to
-|f|. Then, in the resulting group |e->f| the only source vertex is |e|
-and the only target vertex is |f|. This implies that in the group
+|{a,b,c} -> {d, e->f}|. First, each individual node is initially both a
+|source| and a |target| vertex. Then, in |{a,b,c}| all nodes are still both
+source and target vertices since just grouping vertices does not change their
+colors. Now, in |e->f| something interesting happens for the first time: the
+target vertices of the ``group'' |e| (which is just the node |e|) are connected
+to the source vertices of the ``group'' |f|. This means, that an edge is added
+from |e| to |f|. Then, in the resulting group |e->f| the only source vertex is
+|e| and the only target vertex is |f|. This implies that in the group
|{d,e->f}| the sources are |d| and |e| and the targets are |d| and~|f|.
-Now, in |{a,b,c} -> {d,e->f}| the targets of |{a,b,c}| (which are all
-three of them) are connected to the sources of |{d,e->f}| (which are
-just |d| and~|e|). Finally, in the whole graph only |a|, |b|, and |c|
-are sources while only |d| and |f| are targets.
-
+Now, in |{a,b,c} -> {d,e->f}| the targets of |{a,b,c}| (which are all three of
+them) are connected to the sources of |{d,e->f}| (which are just |d| and~|e|).
+Finally, in the whole graph only |a|, |b|, and |c| are sources while only |d|
+and |f| are targets.
+%
\begin{codeexample}[]
-\def\hilightsource#1{\fill [green, opacity=.25] (#1) circle [radius=2mm]; }
-\def\hilighttarget#1{\fill [red, opacity=.25] (#1) circle [radius=2mm]; }
+\def\hilightsource#1{\fill [green, opacity=.25] (#1) circle [radius=2mm]; }
+\def\hilighttarget#1{\fill [red, opacity=.25] (#1) circle [radius=2mm]; }
\tikz \graph
[operator=\tikzgraphforeachcolorednode{source}{\hilightsource},
operator=\tikzgraphforeachcolorednode{target}{\hilighttarget}]
{ {a,b,c} -> {d, e->f} };
\end{codeexample}
-The next objective is to make more precise what it means that ``the
-targets of the first graph'' and the ``sources of the second graph''
-should be connected. We know already of a general way of connecting
-nodes of a graph: operators! Thus, we use an operator for this job.
-For instance, the |complete bipartite| operator adds an edge from every node
-having a certain color to every node have a certain other color. This
-is exactly what we need here: The first color is ``the color |target|
-restricted to the nodes of the first graph'' and the second color is
-``the color |source| restricted to the nodes of the second graph.''
-
-However, we cannot really specify that only nodes from a certain
-subgraph are meant -- the |operator| machinery only operates on all
-nodes of the current graph. For this reason, what really happens is
-the following: When the |graph| command encounters \meta{spec$_1$}
-\meta{edge specification} \meta{spec$_2$}, it first computes and
-colors the nodes of the first and the second specification
-independently. Then, the |target| nodes of the first graph are
-recolored to |target'| and the |source| nodes of the second graph are
-recolored to |source'|. Then, the two graphs are united into one
-graph and a \emph{joining operator} is executed, which should add
-edges between |target'| and |source'|. Once this is done,
-the colors |target'| and |source'| get erased. Note that in the
-resulting graph only the |source| nodes from the first graph are still
-|source| nodes and likewise for the |target| nodes of the second graph.
-
+The next objective is to make more precise what it means that ``the targets of
+the first graph'' and the ``sources of the second graph'' should be connected.
+We know already of a general way of connecting nodes of a graph: operators!
+Thus, we use an operator for this job. For instance, the |complete bipartite|
+operator adds an edge from every node having a certain color to every node have
+a certain other color. This is exactly what we need here: The first color is
+``the color |target| restricted to the nodes of the first graph'' and the
+second color is ``the color |source| restricted to the nodes of the second
+graph''.
+
+However, we cannot really specify that only nodes from a certain subgraph are
+meant -- the |operator| machinery only operates on all nodes of the current
+graph. For this reason, what really happens is the following: When the |graph|
+command encounters \meta{spec$_1$} \meta{edge specification} \meta{spec$_2$},
+it first computes and colors the nodes of the first and the second
+specification independently. Then, the |target| nodes of the first graph are
+recolored to |target'| and the |source| nodes of the second graph are recolored
+to |source'|. Then, the two graphs are united into one graph and a
+\emph{joining operator} is executed, which should add edges between |target'|
+and |source'|. Once this is done, the colors |target'| and |source'| get
+erased. Note that in the resulting graph only the |source| nodes from the first
+graph are still |source| nodes and likewise for the |target| nodes of the
+second graph.
\medskip
-\textbf{The joining operators.} The job of a joining operator is
-to add edges between nodes colored |target'| and |source'|. The
-following rule is used to determine which operator should be chosen
-for performing this job:
+\textbf{The joining operators.} The job of a joining operator is to add edges
+between nodes colored |target'| and |source'|. The following rule is used to
+determine which operator should be chosen for performing this job:
+%
\begin{enumerate}
-\item If the \meta{edge specification} explicitly sets the |operator|
- key to something non-empty (and also not to |\relax|), then the
- \meta{code} of this |operator| call is used.
-\item Otherwise, the current value of the following key is used:
- \begin{key}{/tikz/graphs/default edge operator=\meta{key}}
- This key stores the name of a \meta{key} that is executed for every
- \meta{edge specification} whose \meta{options} do not contain the
- |operator| key.
+ \item If the \meta{edge specification} explicitly sets the |operator| key
+ to something non-empty (and also not to |\relax|), then the \meta{code}
+ of this |operator| call is used.
+ \item Otherwise, the current value of the following key is used:
+ %
+ \begin{key}{/tikz/graphs/default edge operator=\meta{key} (initially matching and star)}
+ This key stores the name of a \meta{key} that is executed for every
+ \meta{edge specification} whose \meta{options} do not contain the
+ |operator| key.
+ %
\begin{codeexample}[]
\tikz \graph [default edge operator=matching] {
{a, b} ->[matching and star]
{c, d, e} --[complete bipartite]
- {f, g, h} --
+ {f, g, h} --
{i, j, k}
-};
+};
\end{codeexample}
- \end{key}
+ \end{key}
\end{enumerate}
A typical joining operator is |complete bipartite|. It takes the names of two
-color classes as input and adds edges from all vertices of the first
-class to all vertices of the second class. Now, the trick is that the
-default value for the |complete bipartite| key is |{target'}{source'}|. Thus,
-if you just write |->[complete bipartite]|, the same happens as if you had
-written
+color classes as input and adds edges from all vertices of the first class to
+all vertices of the second class. Now, the trick is that the default value for
+the |complete bipartite| key is |{target'}{source'}|. Thus, if you just write
+|->[complete bipartite]|, the same happens as if you had written
+%
\begin{quote}
-|->[complete bipartite={target'}{source'}]|
+ |->[complete bipartite={target'}{source'}]|
\end{quote}
-This is exactly what we want to happen. The same default values are
-also set for other joining operators like |matching| or |butterfly|.
-
-Even though an operator like |complete bipartite| is typically used
-together with an edge specification, it can also be used as a normal
-operator together with a group specification. In this case, however,
-the color classes must be named explicitly:
+%
+This is exactly what we want to happen. The same default values are also set
+for other joining operators like |matching| or |butterfly|.
+Even though an operator like |complete bipartite| is typically used together
+with an edge specification, it can also be used as a normal operator together
+with a group specification. In this case, however, the color classes must be
+named explicitly:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\graph [color class=red, color class=green, math nodes]
@@ -2366,43 +2427,40 @@ the color classes must be named explicitly:
A list of predefined joining operators can be found in the reference
Section~\ref{section-library-graphs-reference}.
-The fact that joining operators can also be used as normal operators
-leads to a subtle problem: A normal operator will typically use the
-current value of |default edge kind| to decide which kind of edges
-should be put between the identified vertices, while a joining
-operator should, naturally, use the kind of edge specified by the
-\meta{edge specification}. This problem is solved as follows: Like a
-normal operator, a joining operator should also use the current value
-of |default edge kind| for the edges it produces. The trick is that
-this will automatically be set to the current \meta{edge
- specification} when the operator explicitly in the \meta{options} of
-the edge specification or implicitly in the |default edge operator|.
-
-
+The fact that joining operators can also be used as normal operators leads to a
+subtle problem: A normal operator will typically use the current value of
+|default edge kind| to decide which kind of edges should be put between the
+identified vertices, while a joining operator should, naturally, use the kind
+of edge specified by the \meta{edge specification}. This problem is solved as
+follows: Like a normal operator, a joining operator should also use the current
+value of |default edge kind| for the edges it produces. The trick is that this
+will automatically be set to the current \meta{edge specification} when the
+operator explicitly in the \meta{options} of the edge specification or
+implicitly in the |default edge operator|.
\subsection{Graph Macros}
\label{section-library-graphs-macros}
-A \emph{graph macro} is a small graph that is inserted at some point
-into the graph that is currently being constructed. There is special
-support for such graph macros in \tikzname. You might wonder why this
-is necessary -- can't one use \TeX's normal macro mechanism? The
-answer is ``no'': one cannot insert new nodes into a graph using
-normal macros because the chains, groups, and nodes are determined
-prior to macro expansion. Thus, any macro encountered where some node
-text should go will only be expanded when this node is being named and
+A \emph{graph macro} is a small graph that is inserted at some point into the
+graph that is currently being constructed. There is special support for such
+graph macros in \tikzname. You might wonder why this is necessary -- can't one
+use \TeX's normal macro mechanism? The answer is ``no'': one cannot insert new
+nodes into a graph using normal macros because the chains, groups, and nodes
+are determined prior to macro expansion. Thus, any macro encountered where some
+node text should go will only be expanded when this node is being named and
typeset.
A graph macro is declared using the following key:
\begin{key}{/tikz/graphs/declare=\marg{graph name}\marg{specification}}
- This key declares that \meta{graph name} can subsequently be used as
- a replacement for a \meta{node name}. Whenever the \meta{graph name}
- is used in the following, a graph group will be inserted instead
- whose content is exactly \meta{specification}. In case \meta{graph
- name} is used together with some \meta{options}, they are executed
- prior to inserting the \meta{specification}.
+ This key declares that \meta{graph name} can subsequently be used as a
+ replacement for a \meta{node name}. Whenever the \meta{graph name} is used
+ in the following, a graph group will be inserted instead whose content is
+ exactly \meta{specification}. In case \meta{graph name} is used together
+ with some \meta{options}, they are executed prior to inserting the
+ \meta{specification}.
+ %
\begin{codeexample}[]
\tikz \graph [branch down=4mm, declare={claw}{1 -- {2,3,4}}] {
a;
@@ -2410,19 +2468,21 @@ A graph macro is declared using the following key:
b;
};
\end{codeexample}
- In the next example, we use a key to configure a subgraph:
+ %
+ In the next example, we use a key to configure a subgraph:
+ %
\begin{codeexample}[]
\tikz \graph [ n/.code=\def\n{#1}, branch down=4mm,
declare={star}{root -- { \foreach \i in {1,...,\n} {\i} }}]
{ star [n=5]; };
\end{codeexample}
- Actually, the |n| key is already defined internally for a similar
- purpose.
+ %
+ Actually, the |n| key is already defined internally for a similar purpose.
- As a last example, let us define a somewhat more complicated graph
- macro.
+ As a last example, let us define a somewhat more complicated graph macro.
+ %
\begin{codeexample}[]
-\newcount\mycount
+\newcount\mycount
\tikzgraphsset{
levels/.store in=\tikzgraphlevel,
levels=1,
@@ -2447,11 +2507,13 @@ A graph macro is declared using the following key:
}
\tikz \graph [grow down=5mm, branch right=5mm] { bintree [levels=5] };
\end{codeexample}
+ %
\end{key}
-Note that when you use a graph macro several time inside the same
-graph, you will typically have to use the |name| option so that
-different copies of the subgraph are created:
+Note that when you use a graph macro several time inside the same graph, you
+will typically have to use the |name| option so that different copies of the
+subgraph are created:
+%
\begin{codeexample}[]
\tikz \graph [branch down=4mm, declare={claw}{1 -- {2,3,4}}] {
claw [name=left],
@@ -2460,67 +2522,71 @@ different copies of the subgraph are created:
\end{codeexample}
You will find a list of useful graph macros in the reference section,
-Section~\ref{section-library-graphs-reference-macros}.
+Section~\ref{section-library-graphs-reference-macros}.
\subsection{Online Placement Strategies}
\label{section-library-graphs-placement}
-The main job of the |graph| library is to make it easy to specify
-which nodes are present in a graph and how they are connected. In
-contrast, it is \emph{not} the primary job of the library to compute
-good positions for nodes in a graph -- use for instance a |\matrix|,
-specify good positions ``by hand'' or use the graph drawing
-facilities. Nevertheless, some basic support for automatic node
-placement is provided for simple cases. The graph library will provide
-you with information about the position of nodes inside their groups
-and chains.
-
-As a graph is being constructed, a \emph{placement strategy} is used
-to determine a (reasonably good) position for the nodes as they are
-created. These placement strategies get some information about what
-\tikzname\ has already seen concerning the already constructed nodes,
-but it gets no information concerning the upcoming nodes. Because of
-this lack of information concerning the future, the strategies need to
-be what is called an \emph{online strategy} in computer science. (The
-opposite are \emph{offline strategies}, which get information about
-the whole graph and all the sizes of the nodes in it. The graph
-drawing libraries employ such offline strategies.)
+The main job of the |graph| library is to make it easy to specify which nodes
+are present in a graph and how they are connected. In contrast, it is
+\emph{not} the primary job of the library to compute good positions for nodes
+in a graph -- use for instance a |\matrix|, specify good positions ``by hand''
+or use the graph drawing facilities. Nevertheless, some basic support for
+automatic node placement is provided for simple cases. The graph library will
+provide you with information about the position of nodes inside their groups
+and chains.
+
+As a graph is being constructed, a \emph{placement strategy} is used to
+determine a (reasonably good) position for the nodes as they are created. These
+placement strategies get some information about what \tikzname\ has already
+seen concerning the already constructed nodes, but it gets no information
+concerning the upcoming nodes. Because of this lack of information concerning
+the future, the strategies need to be what is called an \emph{online strategy}
+in computer science. (The opposite are \emph{offline strategies}, which get
+information about the whole graph and all the sizes of the nodes in it. The
+graph drawing libraries employ such offline strategies.)
Strategies are selected using keys like |no placement| or
|Cartesian placement|. It is permissible to use different strategies inside
-different parts of a graph, even though the different strategies do
-not always work together in perfect harmony.
+different parts of a graph, even though the different strategies do not always
+work together in perfect harmony.
\subsubsection{Manual Placement}
\label{section-graphs-xy}
\begin{key}{/tikz/graphs/no placement}
- This strategy simply ``switches off'' the whole placement
- mechanism, causing all nodes to be placed at the origin by
- default. You need to use this strategy if you position nodes ``by
- hand''. For this, you can use the |at| key, the |shift| keys:
+ This strategy simply ``switches off'' the whole placement mechanism,
+ causing all nodes to be placed at the origin by default. You need to use
+ this strategy if you position nodes ``by hand''. For this, you can use the
+ |at| key, the |shift| keys:
+ %
\begin{codeexample}[]
\tikz \graph [no placement]
{
a[at={(0:0)}] -> b[at={(1,0)}] -> c[yshift=1cm];
};
\end{codeexample}
- Since the syntax and the many braces and parentheses are a bit
- cumbersome, the following two keys might also be useful:
- \begin{key}{/tikz/graphs/x=\meta{x dimension}}
- When you use this key, it will have the same effect as if you had written
- |at={(|\meta{x dimension}|,|\meta{y dimension}|)}|, where \meta{y
- dimension} is a value set using the |y| key:
+ %
+ Since the syntax and the many braces and parentheses are a bit cumbersome,
+ the following two keys might also be useful:
+ %
+ \begin{key}{/tikz/graphs/x=\meta{x dimension}}
+ When you use this key, it will have the same effect as if you had
+ written |at={(|\meta{x dimension}|,|\meta{y dimension}|)}|, where
+ \meta{y dimension} is a value set using the |y| key:
+ %
\begin{codeexample}[]
\tikz \graph [no placement]
{
a[x=0,y=0] -> b[x=1,y=0] -> c[x=0,y=1];
};
\end{codeexample}
- Note that you can specify an |x| or a |y| key for a whole scope
- and then vary only the other key:
+ %
+ Note that you can specify an |x| or a |y| key for a whole scope and
+ then vary only the other key:
+ %
\begin{codeexample}[]
\tikz \graph [no placement]
{
@@ -2530,35 +2596,35 @@ not always work together in perfect harmony.
};
};
\end{codeexample}
- Note that these keys have the path |/tikz/graphs/|, so they will
- be available inside |graph|s and will not clash with the usual |x|
- and |y| keys of \tikzname, which are used to specify the basic
- lengths of vectors.
- \end{key}
- \begin{key}{/tikz/graphs/y=\meta{y dimension}}
- See above.
- \end{key}
+ %
+ Note that these keys have the path |/tikz/graphs/|, so they will be
+ available inside |graph|s and will not clash with the usual |x| and |y|
+ keys of \tikzname, which are used to specify the basic lengths of
+ vectors.
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/y=\meta{y dimension}}
+ See above.
+ \end{key}
\end{key}
-
-
\subsubsection{Placement on a Grid}
\begin{key}{/tikz/graphs/Cartesian placement}
- This strategy is the default strategy. It works, roughly, as
- follows: For each new node on a chain, advance a ``logical width''
- counter and for each new node in a group, advance a ``logical
- depth'' counter. When a chain contains a whole group, then the
- ``logical width'' taken up by the group is the maximum over the
- logical widths taken up by the chains inside the group; and
- symmetrically the logical depth of a chain is the maximum of the
- depths of the groups inside it.
-
- This slightly confusing explanation is perhaps best exemplified. In
- the below example, the two numbers indicate the two logical width
- and depth of each node as computed by the |graph| library. Just
- ignore the arcane code that is used to print these numbers.
+ This strategy is the default strategy. It works, roughly, as follows: For
+ each new node on a chain, advance a ``logical width'' counter and for each
+ new node in a group, advance a ``logical depth'' counter. When a chain
+ contains a whole group, then the ``logical width'' taken up by the group is
+ the maximum over the logical widths taken up by the chains inside the
+ group; and symmetrically the logical depth of a chain is the maximum of the
+ depths of the groups inside it.
+
+ This slightly confusing explanation is perhaps best exemplified. In the
+ below example, the two numbers indicate the two logical width and depth of
+ each node as computed by the |graph| library. Just ignore the arcane code
+ that is used to print these numbers.
+ %
\begin{codeexample}[]
\tikz
\graph [nodes={align=center, inner sep=1pt}, grow right=7mm,
@@ -2576,17 +2642,20 @@ not always work together in perfect harmony.
} -> j,
k -> l
};
-\end{codeexample}
- You will find a detailed description of how these logical units are
- computed, exactly, in Section~\ref{section-library-graphs-new-online}.
-
- Now, even though we talk about ``widths'' and ``depths'' and even
- though by default a graph ``grows'' to the right and down, this is
- by no means fixed. Instead, you can use the following keys to change
- how widths and heights are interpreted:
- \begin{key}{/tikz/graphs/chain shift=\meta{coordinate} (initially {(1,0)})}
- Under the regime of the |Cartesian placement| strategy, each node is
- shifted by the current logical width times this \meta{coordinate}.
+\end{codeexample}
+ %
+ You will find a detailed description of how these logical units are
+ computed, exactly, in Section~\ref{section-library-graphs-new-online}.
+
+ Now, even though we talk about ``widths'' and ``depths'' and even though by
+ default a graph ``grows'' to the right and down, this is by no means fixed.
+ Instead, you can use the following keys to change how widths and heights
+ are interpreted:
+ %
+ \begin{key}{/tikz/graphs/chain shift=\meta{coordinate} (initially {(1,0)})}
+ Under the regime of the |Cartesian placement| strategy, each node is
+ shifted by the current logical width times this \meta{coordinate}.
+ %
\begin{codeexample}[]
\tikz \graph [chain shift=(45:1)] {
a -> b -> c;
@@ -2594,10 +2663,12 @@ not always work together in perfect harmony.
f -> g -> h;
};
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/graphs/group shift=\meta{coordinate} (initially {(0,-1)})}
- Like for |chain shift|, each node is shifted by the current
- logical depth times this \meta{coordinate}.
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/group shift=\meta{coordinate} (initially {(0,-1)})}
+ Like for |chain shift|, each node is shifted by the current logical
+ depth times this \meta{coordinate}.
+ %
\begin{codeexample}[]
\tikz \graph [chain shift=(45:7mm), group shift=(-45:7mm)] {
a -> b -> c;
@@ -2605,152 +2676,183 @@ not always work together in perfect harmony.
f -> g -> h;
};
\end{codeexample}
- \end{key}
+ \end{key}
\end{key}
-
\begin{key}{/tikz/graphs/grow up=\meta{distance} (default 1)}
- Sets the |chain shift| to |(|\meta{distance}|,0)|, so that chains
- ``grow upward.'' The distance by which the center of each new
- element is removed from the center of the previous one is
- \meta{distance}.
+ Sets the |chain shift| to |(|\meta{distance}|,0)|, so that chains ``grow
+ upward''. The distance by which the center of each new element is removed
+ from the center of the previous one is \meta{distance}.
+ %
\begin{codeexample}[]
-\tikz \graph [grow up=7mm] { a -> b -> c};
+\tikz \graph [grow up=7mm] { a -> b -> c};
\end{codeexample}
+ %
\end{key}
+
\begin{key}{/tikz/graphs/grow down=\meta{distance} (default 1)}
- Like |grow up|.
+ Like |grow up|.
+ %
\begin{codeexample}[]
-\tikz \graph [grow down=7mm] { a -> b -> c};
+\tikz \graph [grow down=7mm] { a -> b -> c};
\end{codeexample}
+ %
\end{key}
+
\begin{key}{/tikz/graphs/grow left=\meta{distance} (default 1)}
- Like |grow up|.
+ Like |grow up|.
+ %
\begin{codeexample}[]
-\tikz \graph [grow left=7mm] { a -> b -> c};
+\tikz \graph [grow left=7mm] { a -> b -> c};
\end{codeexample}
+ %
\end{key}
+
\begin{key}{/tikz/graphs/grow right=\meta{distance} (default 1)}
- Like |grow up|.
+ Like |grow up|.
+ %
\begin{codeexample}[]
-\tikz \graph [grow right=7mm] { a -> b -> c};
+\tikz \graph [grow right=7mm] { a -> b -> c};
\end{codeexample}
+ %
\end{key}
+
\begin{key}{/tikz/graphs/branch up=\meta{distance} (default 1)}
- Sets the |group shift| so that groups ``branch upward.'' The
- distance by which the center of each new element is removed from
- the center of the previous one is \meta{distance}.
+ Sets the |group shift| so that groups ``branch upward''. The distance by
+ which the center of each new element is removed from the center of the
+ previous one is \meta{distance}.
+ %
\begin{codeexample}[]
-\tikz \graph [branch up=7mm] { a -> b -> {c, d, e} };
+\tikz \graph [branch up=7mm] { a -> b -> {c, d, e} };
\end{codeexample}
- Note that when you draw a tree, the |branch ...| keys specify how
- siblings (or adjacent branches) are arranged, while the |grow ...|
- keys specify in which direction the branches ``grow''.
+ %
+ Note that when you draw a tree, the |branch ...| keys specify how siblings
+ (or adjacent branches) are arranged, while the |grow ...| keys specify in
+ which direction the branches ``grow''.
\end{key}
+
\begin{key}{/tikz/graphs/branch down=\meta{distance} (default 1)}
+%
\begin{codeexample}[]
-\tikz \graph [branch down=7mm] { a -> b -> {c, d, e}};
+\tikz \graph [branch down=7mm] { a -> b -> {c, d, e}};
\end{codeexample}
+%
\end{key}
+
\begin{key}{/tikz/graphs/branch left=\meta{distance} (default 1)}
+%
\begin{codeexample}[]
-\tikz \graph [branch left=7mm, grow down=7mm] { a -> b -> {c, d, e}};
+\tikz \graph [branch left=7mm, grow down=7mm] { a -> b -> {c, d, e}};
\end{codeexample}
+%
\end{key}
+
\begin{key}{/tikz/graphs/branch right=\meta{distance} (default 1)}
+%
\begin{codeexample}[]
-\tikz \graph [branch right=7mm, grow down=7mm] { a -> b -> {c, d, e}};
+\tikz \graph [branch right=7mm, grow down=7mm] { a -> b -> {c, d, e}};
\end{codeexample}
+%
\end{key}
-The following keys place nodes in a $N\times M$ grid.
+The following keys place nodes in a $N\times M$ grid.
+%
\begin{key}{/tikz/graphs/grid placement}
- This key works similar to |Cartesian placement|. As for that placement
- strategy, a node has logical width and depth 1. However, the computed
- total width and depth are mapped to a $N\times M$ grid.
- The values of $N$ and $M$ depend on the size of the graph and the
- value of |wrap after|. The number of columns $M$ is either set to
- |wrap after| explicitly or computed automatically as
- $\sqrt{\verb!|V|!}$. $N$ is the number of rows needed to lay out the
- graph in a grid with $M$ columns.
+ This key works similar to |Cartesian placement|. As for that placement
+ strategy, a node has logical width and depth 1. However, the computed total
+ width and depth are mapped to a $N\times M$ grid. The values of $N$ and $M$
+ depend on the size of the graph and the value of |wrap after|. The number
+ of columns $M$ is either set to |wrap after| explicitly or computed
+ automatically as $\sqrt{\verb!|V|!}$. $N$ is the number of rows needed to
+ lay out the graph in a grid with $M$ columns.
+ %
\begin{codeexample}[]
% An example with 6 nodes, 3 columns and therefor 2 rows
\tikz \graph [grid placement] { subgraph I_n[n=6, wrap after=3] };
\end{codeexample}
+ %
\begin{codeexample}[]
% An example with 9 nodes with columns and rows computed automatically
\tikz \graph [grid placement] { subgraph Grid_n [n=9] };
\end{codeexample}
+ %
\begin{codeexample}[]
% Directions can be changed
\tikz \graph [grid placement, branch up, grow left] { subgraph Grid_n [n=9] };
\end{codeexample}
- In case a user-defined graph instead of a pre-defined
- |subgraph| is to be layed out using |grid placement|, |n| has to be
- specified explicitly:
+ %
+ In case a user-defined graph instead of a pre-defined |subgraph| is to be
+ laid out using |grid placement|, |n| has to be specified explicitly:
+ %
\begin{codeexample}[]
-\tikz \graph [grid placement] {
- [n=6, wrap after=3]
- a -- b -- c -- d -- e -- f
+\tikz \graph [grid placement] {
+ [n=6, wrap after=3]
+ a -- b -- c -- d -- e -- f
};
\end{codeexample}
+ %
\end{key}
-
\subsubsection{Placement Taking Node Sizes Into Account}
Options like |grow up| or |branch right| do not take the sizes of the
-to-be-positioned nodes into account -- all nodes are placed quite
-``dumbly'' at grid positions. It turns out that the
-|Cartesian placement| can also be used to place notes in such a way
-that their height and/or width is taken into account. Note, however,
-that while the following options may yield an adequate placement in
-many situations, when you need advanced alignments you should use a
-|matrix| or advanced offline strategies to place the nodes.
-
+to-be-positioned nodes into account -- all nodes are placed quite ``dumbly'' at
+grid positions. It turns out that the |Cartesian placement| can also be used to
+place notes in such a way that their height and/or width is taken into account.
+Note, however, that while the following options may yield an adequate placement
+in many situations, when you need advanced alignments you should use a |matrix|
+or advanced offline strategies to place the nodes.
\begin{key}{/tikz/graphs/grow right sep=\meta{distance} (default 1em)}
- This key has several effects, but let us start with the bottom line:
- Nodes along a chain are placed in such a way that the left end of a
- new node is \meta{distance} from the right end of the previous node:
+ This key has several effects, but let us start with the bottom line: Nodes
+ along a chain are placed in such a way that the left end of a new node is
+ \meta{distance} from the right end of the previous node:
+ %
\begin{codeexample}[]
\tikz \graph [grow right sep, left anchor=east, right anchor=west] {
start -- {
long text -- {short, very long text} -- more text,
long -- longer -- longest
} -- end
-};
+};
\end{codeexample}
- What happens internally is the following: First, the |anchor| of the
- nodes is set to |west| (or |north west| or |south west|, see
- below). Second, the logical width of a node is no
- longer |1|, but set to the actual width of the node (which we define
- as the horizontal difference between the |west| anchor and the
- |east| anchor) in points. Third, the |chain shift| is set to
- |(1pt,0pt)|.
+ %
+ What happens internally is the following: First, the |anchor| of the nodes
+ is set to |west| (or |north west| or |south west|, see below). Second, the
+ logical width of a node is no longer |1|, but set to the actual width of
+ the node (which we define as the horizontal difference between the |west|
+ anchor and the |east| anchor) in points. Third, the |chain shift| is set to
+ |(1pt,0pt)|.
\end{key}
+
\begin{key}{/tikz/graphs/grow left sep=\meta{distance} (default 1em)}
+%
\begin{codeexample}[]
-\tikz \graph [grow left sep] { long -- longer -- longest };
+\tikz \graph [grow left sep] { long -- longer -- longest };
\end{codeexample}
+%
\end{key}
+
\begin{key}{/tikz/graphs/grow up sep=\meta{distance} (default 1em)}
\begin{codeexample}[]
\tikz \graph [grow up sep] {
a / $a=x$ --
b / {$b=\displaystyle \int_0^1 x dx$} --
c [draw, circle, inner sep=7mm]
-};
+};
\end{codeexample}
+%
\end{key}
+
\begin{key}{/tikz/graphs/grow down sep=\meta{distance} (default 1em)}
- As above.
+ As above.
\end{key}
\begin{key}{/tikz/graphs/branch right sep=\meta{distance} (default 1em)}
- This key works like |grow right sep|, only it affects groups rather
- than chains.
+ This key works like |grow right sep|, only it affects groups rather than
+ chains.
+ %
\begin{codeexample}[]
\tikz \graph [grow down, branch right sep] {
start -- {
@@ -2758,14 +2860,15 @@ many situations, when you need advanced alignments you should use a
long -- longer -- longest,
some text -- a -- b
} -- end
-};
+};
\end{codeexample}
- When both this key and, say, |grow down sep| are set, instead of the
- |west| anchor, the |north west| anchor will be selected
- automatically.
+ %
+ When both this key and, say, |grow down sep| are set, instead of the |west|
+ anchor, the |north west| anchor will be selected automatically.
\end{key}
\begin{key}{/tikz/graphs/branch left sep=\meta{distance} (default 1em)}
+%
\begin{codeexample}[]
\tikz \graph [grow down sep, branch left sep] {
start -- {
@@ -2773,37 +2876,40 @@ many situations, when you need advanced alignments you should use a
long -- longer,
some text -- a -- b
} -- end
-};
+};
\end{codeexample}
+%
\end{key}
\begin{key}{/tikz/graphs/branch up sep=\meta{distance} (default 1em)}
+%
\begin{codeexample}[]
-\tikz \graph [branch up sep] { a, b, c[draw, circle, inner sep=7mm] };
+\tikz \graph [branch up sep] { a, b, c[draw, circle, inner sep=7mm] };
\end{codeexample}
+%
\end{key}
\begin{key}{/tikz/graphs/branch down sep=\meta{distance} (default 1em)}
\end{key}
-
\subsubsection{Placement On a Circle}
-The following keys place nodes on circles. Note that, typically, you
-do not use |circular placement| directly, but rather use one of the
-two keys |clockwise| or |counterclockwise|.
+The following keys place nodes on circles. Note that, typically, you do not use
+|circular placement| directly, but rather use one of the two keys |clockwise|
+or |counterclockwise|.
\begin{key}{/tikz/graphs/circular placement}
- This key works quite similar to |Cartesian placement|. As for that
- placement strategy, a node has logical width and depth |1|. However,
- the computed total width and depth are mapped to polar coordinates
- rather than Cartesian coordinates.
-
- \begin{key}{/tikz/graphs/chain polar shift=|(|\meta{angle}|:|\meta{radius}|)| (initially {(0:1)})}
- Under the regime of the |circular placement| strategy, each node
- on a chain is shifted by |(|\meta{logical
- width}\meta{angle}|:|\meta{logical width}\meta{angle}|)|.
+ This key works quite similar to |Cartesian placement|. As for that
+ placement strategy, a node has logical width and depth |1|. However, the
+ computed total width and depth are mapped to polar coordinates rather than
+ Cartesian coordinates.
+
+ \begin{key}{/tikz/graphs/chain polar shift=|(|\meta{angle}|:|\meta{radius}|)| (initially {(0:1)})}
+ Under the regime of the |circular placement| strategy, each node on a
+ chain is shifted by
+ |(|\meta{logical width}\meta{angle}|:|\meta{logical width}\meta{angle}|)|.
+ %
\begin{codeexample}[]
\tikz \graph [circular placement] {
a -> b -> c;
@@ -2811,11 +2917,13 @@ two keys |clockwise| or |counterclockwise|.
f -> g -> h;
};
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/graphs/group polar shift=|(|\meta{angle}|:|\meta{radius}|)| (initially {(45:0)})}
- Like for |group shift|, each node
- on a chain is shifted by |(|\meta{logical
- depth}\meta{angle}|:|\meta{logical depth}\meta{angle}|)|.
+ %
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/group polar shift=|(|\meta{angle}|:|\meta{radius}|)| (initially {(45:0)})}
+ Like for |group shift|, each node on a chain is shifted by
+ |(|\meta{logical depth}\meta{angle}|:|\meta{logical depth}\meta{angle}|)|.
+ %
\begin{codeexample}[]
\tikz \graph [circular placement, group polar shift=(30:0)] {
a -> b -> c;
@@ -2823,6 +2931,7 @@ two keys |clockwise| or |counterclockwise|.
f -> g -> h;
};
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \graph [circular placement,
chain polar shift=(30:0),
@@ -2832,67 +2941,75 @@ two keys |clockwise| or |counterclockwise|.
f -- g -- h;
};
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/graphs/radius=\meta{dimension} (initially 1cm)}
- This is an initial value that is added to the total computed
- radius when the polar shift of a node has been
- calculated. Essentially, this key allows you to set the
- \meta{radius} of the innermost circle.
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/radius=\meta{dimension} (initially 1cm)}
+ This is an initial value that is added to the total computed radius
+ when the polar shift of a node has been calculated. Essentially, this
+ key allows you to set the \meta{radius} of the innermost circle.
+ %
\begin{codeexample}[]
\tikz \graph [circular placement, radius=5mm] { a, b, c, d };
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \graph [circular placement, radius=1cm] { a, b, c, d };
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/graphs/phase=\meta{angle} (initially 90)}
- This is an initial value that is added to the total computed
- angle when the polar shift of a node has been
- calculated.
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/phase=\meta{angle} (initially 90)}
+ This is an initial value that is added to the total computed angle when
+ the polar shift of a node has been calculated.
+ %
\begin{codeexample}[]
\tikz \graph [circular placement] { a, b, c, d };
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \graph [circular placement, phase=0] { a, b, c, d };
\end{codeexample}
- \end{key}
+ \end{key}
\end{key}
\label{key-graphs-clockwise}%
\begin{key}{/tikz/graphs/clockwise=\meta{number} (default \string\tikzgraphVnum)}
- This key sets the |group shift| so that if there are exactly
- \meta{number} many nodes in a group, they will form a complete
- circle. If you do not provide a \meta{number}, the current value of
- |\tikzgraphVnum| is used, which is exactly what you want when you
- use predefined graph macros like |subgraph K_n|.
+ This key sets the |group shift| so that if there are exactly \meta{number}
+ many nodes in a group, they will form a complete circle. If you do not
+ provide a \meta{number}, the current value of |\tikzgraphVnum| is used,
+ which is exactly what you want when you use predefined graph macros like
+ |subgraph K_n|.
+ %
\begin{codeexample}[]
\tikz \graph [clockwise=4] { a, b, c, d };
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \graph [clockwise] { subgraph K_n [n=5] };
\end{codeexample}
+ %
\end{key}
\label{key-graphs-counterclockwise}%
\begin{key}{/tikz/graphs/counterclockwise=\meta{number} (default \string\tikzgraphVnum)}
- Works like |clockwise|, only the direction is inverted.
+ Works like |clockwise|, only the direction is inverted.
\end{key}
\subsubsection{Levels and Level Styles}
-As a graph is being parsed, the |graph| command keeps track of a
-parameter called the \emph{level} of a node. Provided that the graph
-is actually constructed in a tree-like manner, the level is exactly
-equal to the level of the node inside this tree.
+As a graph is being parsed, the |graph| command keeps track of a parameter
+called the \emph{level} of a node. Provided that the graph is actually
+constructed in a tree-like manner, the level is exactly equal to the level of
+the node inside this tree.
\begin{key}{/tikz/graphs/placement/level}
- This key stores a number that is increased for each element on a
- chain, but gets reset at the end of a group:
+ This key stores a number that is increased for each element on a chain, but
+ gets reset at the end of a group:
+ %
\begin{codeexample}[]
\tikz \graph [ branch down=5mm, typeset=
\tikzgraphnodetext:\pgfkeysvalueof{/tikz/graphs/placement/level}]
-{
+{
a -> {
b,
c -> {
@@ -2904,30 +3021,31 @@ equal to the level of the node inside this tree.
}
};
\end{codeexample}
- Unlike the parameters |depth| and |width| described in the next
- section, the key |level| is always available.
+ %
+ Unlike the parameters |depth| and |width| described in the next section,
+ the key |level| is always available.
\end{key}
-In addition to keeping track of the value of the |level| key, the
-|graph| command also executes the following keys whenever it creates a
-node:
+In addition to keeping track of the value of the |level| key, the |graph|
+command also executes the following keys whenever it creates a node:
\begin{stylekey}{/tikz/graph/level=\meta{level}}
- This key gets executed for each newly created node with \meta{level}
- set to the current level of the node. You can use this key to, say,
- reconfigure the node distance or the node color.
+ This key gets executed for each newly created node with \meta{level} set to
+ the current level of the node. You can use this key to, say, reconfigure
+ the node distance or the node color.
\end{stylekey}
\begin{stylekey}{/tikz/graph/level \meta{level}}
- This key also gets executed for each newly created node with
- \meta{level} set to the current level of the node.
+ This key also gets executed for each newly created node with \meta{level}
+ set to the current level of the node.
+ %
\begin{codeexample}[]
\tikz \graph [
branch down=5mm,
level 1/.style={nodes=red},
level 2/.style={nodes=green!50!black},
level 3/.style={nodes=blue}]
-{
+{
a -> {
b,
c -> {
@@ -2939,13 +3057,14 @@ node:
}
};
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \graph [
branch down=5mm,
level 1/.style={grow right=2cm},
level 2/.style={grow right=1cm},
level 3/.style={grow right=5mm}]
-{
+{
a -> {
b,
c -> {
@@ -2957,26 +3076,26 @@ node:
}
};
\end{codeexample}
+ %
\end{stylekey}
-
\subsubsection{Defining New Online Placement Strategies}
-
\label{section-library-graphs-new-online}
-In the following the details of how to define a new placement strategy
-are explained. Most readers may wish to skip this section.
+In the following the details of how to define a new placement strategy are
+explained. Most readers may wish to skip this section.
-As a graph specification is being parsed, the |graph| library will keep
-track of different numbers that identify the positions of the
-nodes. Let us start with what happens on a chain. First, the following
-counter is increased for each element of the chain:
+As a graph specification is being parsed, the |graph| library will keep track
+of different numbers that identify the positions of the nodes. Let us start
+with what happens on a chain. First, the following counter is increased for
+each element of the chain:
+%
\begin{key}{/tikz/graphs/placement/element count}
- This key stores a number that tells us the position of the node on
- the current chain. However, you only have access to this value
- inside the code passed to the macro |compute position|, explained
- later on.
+ This key stores a number that tells us the position of the node on the
+ current chain. However, you only have access to this value inside the code
+ passed to the macro |compute position|, explained later on.
+ %
\begin{codeexample}[]
\tikz \graph [
grow right sep, typeset=\tikzgraphnodetext:\mynum,
@@ -2987,39 +3106,42 @@ counter is increased for each element of the chain:
d -> {e, f->h} -> j
};
\end{codeexample}
- As can be seen, each group resets the element counter.
+ %
+ As can be seen, each group resets the element counter.
\end{key}
-The second value that is computed is more complicated to explain, but
-it also gives more interesting information:
+The second value that is computed is more complicated to explain, but it also
+gives more interesting information:
+%
\begin{key}{/tikz/graphs/placement/width}
- This key stores the ``logical width'' of the nodes parsed up to now
- in the current group or chain (more precisely, parsed since the last
- call of |place| in an enclosing group). This is not necessarily the
- ``total physical width'' of the nodes, but rather a number
- representing how ``big'' the elements prior to the current element
- were. This \emph{may} be their width, but it may also be their
- height or even their number (which, incidentally, is the default).
- You can use the |width| to perform shifts or rotations of
- to-be-created nodes (to be explained later).
-
- The logical width is defined recursively as follows. First, the
- width of a single node is computed by calling the following key:
- \begin{key}{/tikz/graphs/placement/logical node width=\meta{full
- node name}}
- This key is called to compute a physical or logical width of the
- node \meta{full node name}. You can change the code of this
- key. The code should return the computed value in the macro
- |\pgfmathresult|. By default, this key returns |1|.
- \end{key}
- The width of a chain is the sum of the widths of its elements. The
- width of a group is the maximum of the widths of its elements.
-
- To get a feeling what the above rules imply in practice, let us
- first have a look at an example where each node has logical width
- and height |1| (which is the default). The arcane options at the
- beginning of the code just setup things so that the computed width
- and depth of each node is displayed at the bottom of each node.
+ This key stores the ``logical width'' of the nodes parsed up to now in the
+ current group or chain (more precisely, parsed since the last call of
+ |place| in an enclosing group). This is not necessarily the ``total
+ physical width'' of the nodes, but rather a number representing how ``big''
+ the elements prior to the current element were. This \emph{may} be their
+ width, but it may also be their height or even their number (which,
+ incidentally, is the default). You can use the |width| to perform shifts or
+ rotations of to-be-created nodes (to be explained later).
+
+ The logical width is defined recursively as follows. First, the width of a
+ single node is computed by calling the following key:
+ %
+ \begin{key}{/tikz/graphs/placement/logical node width=\meta{full node name}}
+ This key is called to compute a physical or logical width of the node
+ \meta{full node name}. You can change the code of this key. The code
+ should return the computed value in the macro |\pgfmathresult|. By
+ default, this key returns |1|.
+ \end{key}
+ %
+ The width of a chain is the sum of the widths of its elements. The width of
+ a group is the maximum of the widths of its elements.
+
+ To get a feeling what the above rules imply in practice, let us first have
+ a look at an example where each node has logical width and height |1|
+ (which is the default). The arcane options at the beginning of the code
+ just setup things so that the computed width and depth of each node is
+ displayed at the bottom of each node.
+ %
\begin{codeexample}[]
\tikz
\graph [nodes={align=center, inner sep=1pt}, grow right=7mm,
@@ -3038,11 +3160,12 @@ it also gives more interesting information:
k -> l
};
\end{codeexample}
- In the next example the ``logical'' width and depth actually match
- the ``physical'' width and height. This is caused by the
- |grow right sep| option, which internally sets the
- |logical node width| key so that it returns the width of its
- parameter in points.
+ %
+ In the next example the ``logical'' width and depth actually match the
+ ``physical'' width and height. This is caused by the |grow right sep|
+ option, which internally sets the |logical node width| key so that it
+ returns the width of its parameter in points.
+ %
\begin{codeexample}[]
\tikz
\graph [grow right sep, branch down sep, nodes={align=left, inner sep=1pt},
@@ -3059,15 +3182,18 @@ it also gives more interesting information:
} -> j,
k -> l
};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
Symmetrically to chains, as a group is being constructed, counters are
-available for the number of chains encountered so far in the current
-group and for the logical depth of the current group:
+available for the number of chains encountered so far in the current group and
+for the logical depth of the current group:
+%
\begin{key}{/tikz/graphs/placement/element count}
- This key stores a number that tells us the sequence number of the
- chain in the current group.
+ This key stores a number that tells us the sequence number of the
+ chain in the current group.
+ %
\begin{codeexample}[]
\tikz \graph [
grow right sep, branch down=5mm, typeset=\tikzgraphnodetext:\mynum,
@@ -3079,50 +3205,49 @@ group and for the logical depth of the current group:
g -> h
};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/graphs/placement/depth}
- Similarly to the |width| key, this key stores the ``logical depth''
- of the nodes parsed up to now in the current group or chain and, also
- similarly, this key may or may not be related to the actual
- depth/height of the current node.
- As for the |width|, the exact definition is as follows: For a single
- node, the depth is computed by the following key:
- \begin{key}{/tikz/graphs/placement/logical node depth=\meta{full
- node name}}
- The code behind this key should return the ``logical height'' of
- the node \meta{full node name} in the macro |\pgfmathresult|.
- \end{key}
- Second, the depth of a group is the sum of the depths of its
- elements. Third, the depth of a chain is the maximum of the depth of
- its elements.
-\end{key}
-
-The |width|, |depth|, |element count|, and |chain count| keys get
-updated automatically, but do not have an effect by themselves. This
-is to the following two keys:
+ Similarly to the |width| key, this key stores the ``logical depth'' of the
+ nodes parsed up to now in the current group or chain and, also similarly,
+ this key may or may not be related to the actual depth/height of the
+ current node. As for the |width|, the exact definition is as follows: For a
+ single node, the depth is computed by the following key:
+ %
+ \begin{key}{/tikz/graphs/placement/logical node depth=\meta{full node name}}
+ The code behind this key should return the ``logical height'' of the
+ node \meta{full node name} in the macro |\pgfmathresult|.
+ \end{key}
+ %
+ Second, the depth of a group is the sum of the depths of its elements.
+ Third, the depth of a chain is the maximum of the depth of its elements.
+\end{key}
+
+The |width|, |depth|, |element count|, and |chain count| keys get updated
+automatically, but do not have an effect by themselves. This is to the
+following two keys:
\begin{key}{/tikz/graphs/placement/compute position=\meta{code}}
- The \meta{code} is called by the |graph| command just prior to
- creating a new node (the exact moment when this key is called is
- detailed in the description of the |place| key). When the
- \meta{code} is called, all of the keys described above will hold
- numbers computed in the way described above.
-
- The job of the \meta{code} is to setup node options appropriately so
- that the to-be-created node will be placed correctly. Thus, the
- \meta{code} should typically set the key
- |nodes={shift=|\meta{coordinate}|}| where \meta{coordinate} is the
- computed position for the node. The \meta{code} could
- also set other options like, say, the color of a node depending on
- its depth.
-
- The following example appends some code to the standard code of
- |compute position| so that ``deeper'' nodes of a tree are
- lighter. (Naturally, the same effect could be achieved much more
- easily using the |level| key.)
-\begin{codeexample}[]
-\newcount\mycount
+ The \meta{code} is called by the |graph| command just prior to creating a
+ new node (the exact moment when this key is called is detailed in the
+ description of the |place| key). When the \meta{code} is called, all of the
+ keys described above will hold numbers computed in the way described above.
+
+ The job of the \meta{code} is to setup node options appropriately so that
+ the to-be-created node will be placed correctly. Thus, the \meta{code}
+ should typically set the key |nodes={shift=|\meta{coordinate}|}| where
+ \meta{coordinate} is the computed position for the node. The \meta{code}
+ could also set other options like, say, the color of a node depending on
+ its depth.
+
+ The following example appends some code to the standard code of
+ |compute position| so that ``deeper'' nodes of a tree are lighter.
+ (Naturally, the same effect could be achieved much more easily using the
+ |level| key.)
+ %
+\begin{codeexample}[]
+\newcount\mycount
\def\lightendeepernodes{
\pgfmathsetcount{\mycount}{
100-20*\pgfkeysvalueof{/tikz/graphs/placement/width}
@@ -3143,103 +3268,109 @@ is to the following two keys:
}
};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/graphs/placement/place}
- Executing this key has two effects: First, the key
- |compute position| is called to compute a good
- position for future nodes (usually, these ``future nodes'' are just
- a single node that is created immediately). Second, all of the above
- counters like |depth| or |width| are reset (but not |level|).
+ Executing this key has two effects: First, the key |compute position| is
+ called to compute a good position for future nodes (usually, these ``future
+ nodes'' are just a single node that is created immediately). Second, all of
+ the above counters like |depth| or |width| are reset (but not |level|).
- There are two places where this key is sensibly called: First, just
- prior to creating a node, which happens automatically. Second, when
- you change the online strategy. In this case, the computed width and
- depth values from one strategy typically make no sense in the other
- strategy, which is why the new strategy should proceed ``from a
- fresh start.'' In this case, the implicit call of |compute position|
- ensures that the new strategy gets the last place the old strategy
- would have used as its starting point, while the computation of its
- positions is now relative to this new starting point.
+ There are two places where this key is sensibly called: First, just prior
+ to creating a node, which happens automatically. Second, when you change
+ the online strategy. In this case, the computed width and depth values from
+ one strategy typically make no sense in the other strategy, which is why
+ the new strategy should proceed ``from a fresh start''. In this case, the
+ implicit call of |compute position| ensures that the new strategy gets the
+ last place the old strategy would have used as its starting point, while
+ the computation of its positions is now relative to this new starting
+ point.
- For these reasons, when an online strategy like
- |Cartesian placement| is called, this key gets called
- implicitly. You will rarely need to call this key directly, except
- when you define a new online strategy.
+ For these reasons, when an online strategy like |Cartesian placement| is
+ called, this key gets called implicitly. You will rarely need to call this
+ key directly, except when you define a new online strategy.
\end{key}
-
\subsection{Reference: Predefined Elements}
-
\label{section-library-graphs-reference}
-
\subsubsection{Graph Macros}
\label{section-library-graphs-reference-macros}
-\begin{tikzlibrary}{graph.standard}
- This library defines a number of graph macros that are often used in
- the literature. When new graphs are added to this collection, they
- will follow the definitions in the Mathematica program, see
- |mathworld.wolfram.com/topics/SimpleGraphs.html|.
+\begin{tikzlibrary}{graphs.standard}
+ This library defines a number of graph macros that are often used in the
+ literature. When new graphs are added to this collection, they will follow
+ the definitions in the Mathematica program, see
+ \url{mathworld.wolfram.com/topics/SimpleGraphs.html}.
\end{tikzlibrary}
-
\begin{graph}{subgraph I\_n}
- This graph consists just of $n$ unconnected vertices. The following
- key is used to specify the set of these vertices:
- \begin{key}{/tikz/graphs/V=\marg{list of vertices}}
- Sets a list of vertex names for use with graphs like
- |subgraph I_n| and also other graphs. This list is available in
- the macro |\tikzgraphV|. The number of elements of this list is
- available in |\tikzgraphVnum|.
- \end{key}
- \begin{key}{/tikz/graphs/n=\meta{number}}
- This is an abbreviation for
- |V={1,...,|\meta{number}|}, name shore V={name=V}|.
- \end{key}
+ This graph consists just of $n$ unconnected vertices. The following key is
+ used to specify the set of these vertices:
+ %
+ \begin{key}{/tikz/graphs/V=\marg{list of vertices}}
+ Sets a list of vertex names for use with graphs like |subgraph I_n| and
+ also other graphs. This list is available in the macro |\tikzgraphV|.
+ The number of elements of this list is available in |\tikzgraphVnum|.
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/n=\meta{number}}
+ This is an abbreviation for
+ |V={1,...,|\meta{number}|}, name shore V/.style={name=V}|.
+ \end{key}
+ %
\begin{codeexample}[]
\tikz \graph [branch right, nodes={draw, circle}]
- { subgraph I_n [V={a,b,c}] };
+ { subgraph I_n [V={a,b,c}] };
\end{codeexample}
- This graph is not particularly exciting by itself. However, it is
- often used to introduce nodes into a graph that are then connected
- as in the following example:
+ %
+ This graph is not particularly exciting by itself. However, it is often
+ used to introduce nodes into a graph that are then connected as in the
+ following example:
+ %
\begin{codeexample}[]
-\tikz \graph [clockwise, clique] { subgraph I_n [n=4] };
+\tikz \graph [clockwise, clique] { subgraph I_n [n=4] };
\end{codeexample}
+ %
\end{graph}
-
\begin{graph}{subgraph I\_nm}
- This graph consists of two sets of once $n$ unconnected vertices and
- then $m$ unconnected vertices. The first set consists of the
- vertices set by the key |V|, the other set consists of the vertices
- set by the key |W|.
-\begin{codeexample}[]
-\tikz \graph { subgraph I_nm [V={1,2,3}, W={a,b,c}] };
-\end{codeexample}
- In order to set the graph path name of the two
- sets, the following keys get executed:
- \begin{stylekey}{/tikz/graphs/name shore V (initially \normalfont empty)}
- Set this style to, say, |name=my V set| in order to set a
- name for the |V| set.
- \end{stylekey}
- \begin{stylekey}{/tikz/graphs/name shore W (initially \normalfont empty)}
- Same as for |name shore V|.
- \end{stylekey}
- \begin{key}{/tikz/graphs/W=\marg{list of vertices}}
- Sets the list of vertices for the |W| set. The elements and
- their number are available in the macros |\tikzgraphW| and
- |\tikzgraphWnum|, respectively.
- \end{key}
- \begin{key}{/tikz/graphs/m=\meta{number}}
- This is an abbreviation for
- |W={1,...,|\meta{number}|}, name shore W={name=W}|.
- \end{key}
- The main purpose of this subgraph is to setup the nodes in a
- bipartite graph:
+ This graph consists of two sets of once $n$ unconnected vertices and then
+ $m$ unconnected vertices. The first set consists of the vertices set by the
+ key |V|, the other set consists of the vertices set by the key |W|.
+ %
+\begin{codeexample}[]
+\tikz \graph { subgraph I_nm [V={1,2,3}, W={a,b,c}] };
+\end{codeexample}
+ %
+ In order to set the graph path name of the two sets, the following keys get
+ executed:
+ %
+ \begin{stylekey}{/tikz/graphs/name shore V (initially \normalfont empty)}
+ Set this style to, say, |name=my V set| in order to set a name for the
+ |V| set.
+ \end{stylekey}
+ %
+ \begin{stylekey}{/tikz/graphs/name shore W (initially \normalfont empty)}
+ Same as for |name shore V|.
+ \end{stylekey}
+ %
+ \begin{key}{/tikz/graphs/W=\marg{list of vertices}}
+ Sets the list of vertices for the |W| set. The elements and their
+ number are available in the macros |\tikzgraphW| and |\tikzgraphWnum|,
+ respectively.
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/m=\meta{number}}
+ This is an abbreviation for
+ |W={1,...,|\meta{number}|}, name shore W/.style={name=W}|.
+ \end{key}
+ %
+ The main purpose of this subgraph is to setup the nodes in a bipartite
+ graph:
+ %
\begin{codeexample}[]
\tikz \graph {
subgraph I_nm [n=3, m=4];
@@ -3247,78 +3378,87 @@ is to the following two keys:
V 1 -- { W 2, W 3 };
V 2 -- { W 1, W 3 };
V 3 -- { W 1, W 4 };
-};
+};
\end{codeexample}
+ %
\end{graph}
\begin{graph}{subgraph K\_n}
- This graph is the complete clique on the vertices from the |V| key.
+ This graph is the complete clique on the vertices from the |V| key.
+ %
\begin{codeexample}[]
-\tikz \graph [clockwise] { subgraph K_n [n=7] };
+\tikz \graph [clockwise] { subgraph K_n [n=7] };
\end{codeexample}
+ %
\end{graph}
-
\begin{graph}{subgraph K\_nm}
- This graph is the complete bipartite graph with the two shores |V|
- and |W| as in |subgraph I_nm|.
+ This graph is the complete bipartite graph with the two shores |V| and |W|
+ as in |subgraph I_nm|.
+ %
\begin{codeexample}[]
\tikz \graph [branch right, grow down]
- { subgraph K_nm [V={6,...,9}, W={b,...,e}] };
+ { subgraph K_nm [V={6,...,9}, W={b,...,e}] };
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \graph [simple, branch right, grow down]
{
subgraph K_nm [V={1,2,3}, W={a,b,c,d}, ->];
subgraph K_nm [V={2,3}, W={b,c}, <-];
-};
+};
\end{codeexample}
+ %
\end{graph}
\begin{graph}{subgraph P\_n}
- This graph is the path on the vertices in |V|.
+ This graph is the path on the vertices in |V|.
+ %
\begin{codeexample}[]
-\tikz \graph [branch right] { subgraph P_n [n=3] };
+\tikz \graph [branch right] { subgraph P_n [n=3] };
\end{codeexample}
+ %
\end{graph}
-
\begin{graph}{subgraph C\_n}
- This graph is the cycle on the vertices in |V|.
+ This graph is the cycle on the vertices in |V|.
+ %
\begin{codeexample}[]
-\tikz \graph [clockwise] { subgraph C_n [n=7, ->] };
+\tikz \graph [clockwise] { subgraph C_n [n=7, ->] };
\end{codeexample}
+ %
\end{graph}
-
\begin{graph}{subgraph Grid\_n}
- This graph is a grid of the vertices in |V|.
- \begin{key}{/tikz/graphs/wrap after=\meta{number}}
- Defines the number of nodes placed in a single row of the grid. This
- value implicitly defines the number of grid columns as well.
- In the following example a |grid placement| is used to visualize the
- edges created between the nodes of a |Grid_n| |subgraph| using
- different values for |wrap after|.
- \begin{codeexample}[]
+ This graph is a grid of the vertices in |V|.
+ %
+ \begin{key}{/tikz/graphs/wrap after=\meta{number}}
+ Defines the number of nodes placed in a single row of the grid. This
+ value implicitly defines the number of grid columns as well. In the
+ following example a |grid placement| is used to visualize the edges
+ created between the nodes of a |Grid_n| |subgraph| using different
+ values for |wrap after|.
+ %
+\begin{codeexample}[]
\tikz \graph [grid placement] { subgraph Grid_n [n=3,wrap after=1] };
\tikz \graph [grid placement] { subgraph Grid_n [n=3,wrap after=3] };
- \end{codeexample}
- \begin{codeexample}[]
+\end{codeexample}
+ %
+\begin{codeexample}[]
\tikz \graph [grid placement] { subgraph Grid_n [n=4,wrap after=2] };
\tikz \graph [grid placement] { subgraph Grid_n [n=4] };
- \end{codeexample}
+\end{codeexample}
\end{key}
\end{graph}
-
% TODO: Implement the Grid_nm subgraph described here:
%
%\begin{graph}{subgraph Grid\_nm}
% This graph is a grid built from the cartesian product of the two node
% sets |V| and |W| which are either defined using the keys
% |/tikz/graphs/V| and |/tikz/graphs/W| or |/tikz/graphs/n| and
-% |/tikz/graphs/m| or a mixture of both.
-%
+% |/tikz/graphs/m| or a mixture of both.
+%
% The resulting |Grid_nm| subgraph has $n$ ``rows'' and $m$ ``columns'' and
% the nodes are named |V i W j| with $1\le i\le n$ and $1\le j\le n$.
% The names of the two shores |V| and |W| can be changed as described in
@@ -3330,18 +3470,17 @@ is to the following two keys:
%\end{graph}
-
\subsubsection{Group Operators}
-The following keys use the |operator| key to setup operators that
-connect the vertices of the current group having a certain color in a
-specific way.
+The following keys use the |operator| key to setup operators that connect the
+vertices of the current group having a certain color in a specific way.
\begin{key}{/tikz/graphs/clique=\meta{color} (default all)}
- Adds an edge between all vertices of the current group having the
- (logical) color \meta{color}. Since, by default, this color is set
- to |all|, which is a color that all nodes get by default, when you
- do not specify anything, all nodes will be connected.
+ Adds an edge between all vertices of the current group having the (logical)
+ color \meta{color}. Since, by default, this color is set to |all|, which is
+ a color that all nodes get by default, when you do not specify anything,
+ all nodes will be connected.
+ %
\begin{codeexample}[]
\tikz \graph [clockwise, n=5] {
a,
@@ -3350,164 +3489,178 @@ specific way.
[clique]
c, d, e
}
-};
+};
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \graph [color class=red, clockwise, n=5] {
[clique=red, ->]
a, b[red], c[red], d, e[red]
-};
+};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/graphs/induced independent set=\meta{color} (default all)}
- This key is the ``opposite'' of a |clique|: It removes all edges in
- the current group having belonging to color class \meta{color}. More
- precisely, an edge of kind |-!-| is added for each pair of
- vertices. This means that edge only get removed if you specify the
- |simple| option.
+ This key is the ``opposite'' of a |clique|: It removes all edges in the
+ current group having belonging to color class \meta{color}. More precisely,
+ an edge of kind |-!-| is added for each pair of vertices. This means that
+ edge only get removed if you specify the |simple| option.
\begin{codeexample}[]
\tikz \graph [simple] {
subgraph K_n [<->, n=7, clockwise]; % create lots of edges
-
+
{ [induced independent set] 1, 3, 4, 5, 6 }
-};
+};
\end{codeexample}
+ %
\end{key}
-
\begin{key}{/tikz/graphs/cycle=\meta{color} (default all)}
- Connects the nodes colored \meta{color} is a cyclic fashion. The
- ordering is the ordering in which they appear in the whole graph
- specification.
+ Connects the nodes colored \meta{color} is a cyclic fashion. The ordering
+ is the ordering in which they appear in the whole graph specification.
+ %
\begin{codeexample}[]
\tikz \graph [clockwise, n=6, phase=60] {
{ [cycle, ->] a, b, c },
{ [cycle, <-] d, e, f }
-};
+};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/graphs/induced cycle=\meta{color} (default all)}
- While the |cycle| command will only add edges, this key will also
- remove all other edges between the nodes of the cycle, provided we
- are constructing a |simple| graph.
+ While the |cycle| command will only add edges, this key will also remove
+ all other edges between the nodes of the cycle, provided we are
+ constructing a |simple| graph.
+ %
\begin{codeexample}[]
\tikz \graph [simple] {
subgraph K_n [n=7, clockwise]; % create lots of edges
-
+
{ [induced cycle, ->, edge=red] 2, 3, 4, 6, 7 },
-};
+};
\end{codeexample}
+ %
\end{key}
-
+
\begin{key}{/tikz/graphs/path=\meta{color} (default all)}
- Works like |cycle|, only there is no edge from the last to the first
- vertex.
+ Works like |cycle|, only there is no edge from the last to the first
+ vertex.
+ %
\begin{codeexample}[]
\tikz \graph [clockwise, n=6] {
{ [path, ->] a, b, c },
{ [path, <-] d, e, f }
-};
+};
\end{codeexample}
+ %
\end{key}
+
\begin{key}{/tikz/graphs/induced path=\meta{color} (default all)}
- Works like |induced cycle|, only there is no edge from the last to the first
- vertex.
+ Works like |induced cycle|, only there is no edge from the last to the
+ first vertex.
+ %
\begin{codeexample}[]
\tikz \graph [simple] {
subgraph K_n [n=7, clockwise]; % create lots of edges
-
+
{ [induced path, ->, edges=red] 2, 3, 4, 6, 7 },
-};
+};
\end{codeexample}
+ %
\end{key}
\subsubsection{Joining Operators}
The following keys are typically used as options of an \meta{edge
- specification}, but can also be called in a group specification
-(however, then, the colors need to be set explicitly).
+specification}, but can also be called in a group specification (however, then,
+the colors need to be set explicitly).
-\begin{key}{/tikz/graphs/complete bipartite=\meta{from color}\meta{to
- color} (default \char`\{source'\char`\}\char`\{target'\char`\})}
- Adds all possible edges from every node having color \meta{from color}
- to every node having color \meta{to color}:
+\begin{key}{/tikz/graphs/complete bipartite=\meta{from color}\meta{to color} (default \char`\{source'\char`\}\char`\{target'\char`\})}
+ Adds all possible edges from every node having color \meta{from color} to
+ every node having color \meta{to color}:
+ %
\begin{codeexample}[]
\tikz \graph { {a, b} ->[complete bipartite]
{c, d, e} --[complete bipartite]
{g, h, i, j} --[complete bipartite]
- k };
+ k };
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \graph [color class=red, color class=green, clockwise, n=6] {
[complete bipartite={red}{green}, ->]
a [red], b[red], c[red], d[green], e[green], f[green]
};
\end{codeexample}
+ %
\end{key}
+
\begin{key}{/tikz/graphs/induced complete bipartite}
- Works like the |complete bipartite| operator, but in a |simple|
- graph any edges between the vertices in either shore are removed
- (more precisely, they get replaced by |-!-| edges).
+ Works like the |complete bipartite| operator, but in a |simple| graph any
+ edges between the vertices in either shore are removed (more precisely,
+ they get replaced by |-!-| edges).
+ %
\begin{codeexample}[]
\tikz \graph [simple] {
subgraph K_n [n=5, clockwise]; % Lots of edges
-
+
{2, 3} ->[induced complete bipartite] {4, 5}
};
-\end{codeexample}
+\end{codeexample}
+ %
\end{key}
-\begin{key}{/tikz/graphs/matching=\meta{from color}\meta{to
- color} (default \char`\{source'\char`\}\char`\{target'\char`\})}
- This joining operator forms a maximum
- \emph{matching} between the nodes of the two sets of nodes having
- colors \meta{from color} and \meta{to color}, respectively. The first node of
- the from set is connected to the first node of to set, the second
- node of the from set is connected to the second node of the to set,
- and so on. If the sets have the same
- size, what results is what graph theoreticians call a \emph{perfect
- matching}, otherwise only a maximum, but not perfect matching
- results.
+
+\begin{key}{/tikz/graphs/matching=\meta{from color}\meta{to color} (default \char`\{source'\char`\}\char`\{target'\char`\})}
+ This joining operator forms a maximum \emph{matching} between the nodes of
+ the two sets of nodes having colors \meta{from color} and \meta{to color},
+ respectively. The first node of the from set is connected to the first node
+ of to set, the second node of the from set is connected to the second node
+ of the to set, and so on. If the sets have the same size, what results is
+ what graph theoreticians call a \emph{perfect matching}, otherwise only a
+ maximum, but not perfect matching results.
+ %
\begin{codeexample}[]
\tikz \graph {
{a, b, c} ->[matching]
{d, e, f} --[matching]
{g, h} --[matching]
{i, j, k}
-};
+};
\end{codeexample}
+ %
\end{key}
-\begin{key}{/tikz/graphs/matching and star=\meta{from color}\meta{to
- color} (default \char`\{source'\char`\}\char`\{target'\char`\})}
- The |matching and star| connector works like the |matching|
- connector, only it behaves differently when the two to-be-connected
- sets have different size. In this case, all the surplus nodes get
- connected to the last node of the other set, resulting in what is known
- as a \emph{star} in graph theory. This simple rule allows
- for some powerful effects (since this connector is the default,
- there is no need to add it here):
- \begin{codeexample}[]
-\tikz \graph { a -> {b, c} -> {d, e} -- f};
- \end{codeexample}
- The |matching and star| connector also makes it easy to create trees and
- series-parallel graphs.
+\begin{key}{/tikz/graphs/matching and star=\meta{from color}\meta{to color} (default \char`\{source'\char`\}\char`\{target'\char`\})}
+ The |matching and star| connector works like the |matching| connector, only
+ it behaves differently when the two to-be-connected sets have different
+ size. In this case, all the surplus nodes get connected to the last node of
+ the other set, resulting in what is known as a \emph{star} in graph theory.
+ This simple rule allows for some powerful effects (since this connector is
+ the one initially set, there is no need to add it here):
+ %
+\begin{codeexample}[]
+\tikz \graph { a -> {b, c} -> {d, e} -- f};
+\end{codeexample}
+ %
+ The |matching and star| connector also makes it easy to create trees and
+ series-parallel graphs.
\end{key}
\begin{key}{/tikz/graphs/butterfly=\opt{\meta{options}}}
- The |butterfly| connector is used to create the kind of connections
- present between layers of a so-called \emph{butterfly network}.
- As for other connectors, two sets of nodes are connected, which are
- the nodes having color |target'| and |source'| by default. In a
- \emph{level $l$} connection, the first $l$ nodes of the first set
- are connected to the second $l$ nodes of the second set, while the
- second $l$ nodes of the first set get connected to the first $l$
- nodes of the second set. Then, for next $2l$ nodes of both sets a
- similar kind of connection is installed. Additionally, each node
- gets connected to the corresponding node in the other set with the
- same index (as in a |matching|):
+ The |butterfly| connector is used to create the kind of connections present
+ between layers of a so-called \emph{butterfly network}. As for other
+ connectors, two sets of nodes are connected, which are the nodes having
+ color |target'| and |source'| by default. In a \emph{level $l$} connection,
+ the first $l$ nodes of the first set are connected to the second $l$ nodes
+ of the second set, while the second $l$ nodes of the first set get
+ connected to the first $l$ nodes of the second set. Then, for next $2l$
+ nodes of both sets a similar kind of connection is installed. Additionally,
+ each node gets connected to the corresponding node in the other set with
+ the same index (as in a |matching|):
+ %
\begin{codeexample}[]
\tikz \graph [left anchor=east, right anchor=west,
branch down=4mm, grow right=15mm] {
@@ -3516,24 +3669,27 @@ The following keys are typically used as options of an \meta{edge
subgraph I_n [n=12, name=C]
};
\end{codeexample}
- Unlike most joining operators, the colors of the nodes in the first
- and the second set are not passed as parameters to the |butterfly|
- key. Rather, they can be set using the \meta{options}, which are
- executed with the path prefix |/tikz/graphs/butterfly|.
- \begin{key}{/tikz/graphs/butterfly/level=\meta{level} (initially 1)}
- Sets the level $l$ for the connections.
- \end{key}
- \begin{key}{/tikz/graphs/butterfly/from=\meta{color} (initially target')}
- Sets the color class of the from nodes.
- \end{key}
- \begin{key}{/tikz/graphs/butterfly/to=\meta{color} (initially source')}
- Sets the color class of the to nodes.
- \end{key}
-\end{key}
-
-
-
-%%% Local Variables:
+ %
+ Unlike most joining operators, the colors of the nodes in the first and the
+ second set are not passed as parameters to the |butterfly| key. Rather,
+ they can be set using the \meta{options}, which are executed with the path
+ prefix |/tikz/graphs/butterfly|.
+ %
+ \begin{key}{/tikz/graphs/butterfly/level=\meta{level} (initially 1)}
+ Sets the level $l$ for the connections.
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/butterfly/from=\meta{color} (initially target')}
+ Sets the color class of the from nodes.
+ \end{key}
+ %
+ \begin{key}{/tikz/graphs/butterfly/to=\meta{color} (initially source')}
+ Sets the color class of the to nodes.
+ \end{key}
+\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-tikz-matrices.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-matrices.tex
index 051ede9e9c6..e8c5a77dc9a 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
@@ -7,53 +7,49 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\section{Matrices and Alignment}
+\section{Matrices and Alignment}
\label{section-matrices}
\subsection{Overview}
-When creating pictures, one often faces the problem of correctly
-aligning parts of the picture. For example, you might wish that the
-|baseline|s of certain nodes should be on the same line and some
-further nodes should be below these nodes with, say, their centers on
-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 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
-little picture or a node. The sizes of the cells are automatically
-adjusted such that they are large enough to contain all the cell
-contents.
+When creating pictures, one often faces the problem of correctly aligning parts
+of the picture. For example, you might wish that the |baseline|s of certain
+nodes should be on the same line and some further nodes should be below these
+nodes with, say, their centers on 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
+explained in the current section.
-Matrices are a powerful tool and they need to be handled with some care.
-For impatient readers who skip the rest of this section: you
-\emph{must} end \emph{every} row with |\\|. In particular, the last
-row \emph{must} be ended with |\\|.
+A \tikzname\ matrix is similar to \LaTeX's |{tabular}| or |{array}|
+environment, only instead of text each cell contains a little picture or a
+node. The sizes of the cells are automatically adjusted such that they are
+large enough to contain all the cell contents.
-Many of the ideas implemented in \tikzname's matrix support are due to
-Mark Wibrow -- many thanks to Mark at this point!
+Matrices are a powerful tool and they need to be handled with some care. For
+impatient readers who skip the rest of this section: you \emph{must} end
+\emph{every} row with |\\|. In particular, the last row \emph{must} be ended
+with |\\|.
+Many of the ideas implemented in \tikzname's matrix support are due to Mark
+Wibrow -- many thanks to Mark at this point!
\subsection{Matrices are Nodes}
-Matrices are special in many ways, but for most purposes matrices are
-treated like nodes. This means, that you use the |node| path command
-to create a matrix and you only use a special option, namely the
-|matrix| option, to signal that the node will contain a
-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.
+Matrices are special in many ways, but for most purposes matrices are treated
+like nodes. This means, that you use the |node| path command to create a matrix
+and you only use a special option, namely the |matrix| option, to signal that
+the node will contain a 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.
\begin{key}{/tikz/matrix=\meta{true or false} (default true)}
- This option can be passed to a |node| path command. It signals that
- the node will contain a matrix.
+ This option can be passed to a |node| path command. It signals that the
+ node will contain a matrix.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (4,2);
@@ -66,67 +62,65 @@ matrix.
\draw [very thick,->] (0,0) |- (my matrix.west);
\end{tikzpicture}
\end{codeexample}
- The exact syntax of the matrix is explained in the course of this
- section.
- \begin{stylekey}{/tikz/every matrix (initially \normalfont empty)}
- This style is used in every matrix.
- \end{stylekey}
+ %
+ The exact syntax of the matrix is explained in the course of this section.
+ %
+ \begin{stylekey}{/tikz/every matrix (initially \normalfont empty)}
+ This style is used in every matrix.
+ \end{stylekey}
\end{key}
-Even more so than nodes, matrices will often be the only object on a
-path. Because of this, there is a special abbreviation for creating matrices:
+Even more so than nodes, matrices will often be the only object on a path.
+Because of this, there is a special abbreviation for creating matrices:
\begin{command}{\matrix}
- Inside |{tikzpicture}| this is an abbreviation for |\path node[matrix]|.
+ Inside |{tikzpicture}| this is an abbreviation for |\path node[matrix]|.
\end{command}
-Even though matrices are nodes, some options do not have the same
-effect as for normal nodes:
+Even though matrices are nodes, some options do not have the same effect as for
+normal nodes:
+%
\begin{enumerate}
-\item Rotations and scaling have no effect on a matrix as a whole
- (however, you can still transform the contents of the cells
- 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.
-\item All options starting with |text| such as |text width| have no
- effect.
+ \item Rotations and scaling have no effect on a matrix as a whole (however,
+ you can still transform the contents of the cells 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.
+ \item All options starting with |text| such as |text width| have no effect.
\end{enumerate}
-
\subsection{Cell Pictures}
\label{section-tikz-cell-pictures}
-A matrix consists of rows of \emph{cells}. Each row (including the
-last one!) is ended by the command |\\|. The character |&| is used
-to separate cells. Inside each cell, you must place commands for
-drawing a picture, called the \emph{cell picture} in the
-following. (However, cell pictures are not enclosed in a complete
-|{pgfpicture}| environment, they are a bit more light-weight. The main
-difference is that cell pictures cannot have layers.) It is not
-necessary to specify beforehand how many rows or columns there are
-going to be and if a row contains less cell pictures than another
-line, empty cells are automatically added as needed.
+A matrix consists of rows of \emph{cells}. Each row (including the last one!)
+is ended by the command |\\|. The character |&| is used to separate cells.
+Inside each cell, you must place commands for drawing a picture, called the
+\emph{cell picture} in the following. (However, cell pictures are not enclosed
+in a complete |{pgfpicture}| environment, they are a bit more light-weight. The
+main difference is that cell pictures cannot have layers.) It is not necessary
+to specify beforehand how many rows or columns there are going to be and if a
+row contains less cell pictures than another line, empty cells are
+automatically added as needed.
-\subsubsection{Alignment of Cell Pictures}
-For each cell picture a bounding box is computed. These bounding boxes
-and the origins of the cell pictures determine how the cells are
-aligned. Let us start with the rows: Consider the cell pictures on the first
-row. Each has a bounding box and somewhere inside this bounding box
-the origin of the cell picture can be found (the origin might even lie
-outside the bounding box, but let us ignore this problem for the
-moment). The cell pictures are then shifted around such that all
-origins lie on the same horizontal line. This may make it necessary to
-shift some cell pictures upwards and others downwards, but it can be
-done and this yields the vertical alignment of the cell pictures this
-row. The top of the row is then given by the top of the ``highest''
-cell picture in the row, the bottom of the row is given by the bottom
-of the lowest cell picture. (To be more precise, the height of the row
-is the maximum $y$-value of any of the bounding boxes and the depth of
-the row is the negated minimum $y$-value of the bounding boxes).
+\subsubsection{Alignment of Cell Pictures}
+For each cell picture a bounding box is computed. These bounding boxes and the
+origins of the cell pictures determine how the cells are aligned. Let us start
+with the rows: Consider the cell pictures on the first row. Each has a bounding
+box and somewhere inside this bounding box the origin of the cell picture can
+be found (the origin might even lie outside the bounding box, but let us ignore
+this problem for the moment). The cell pictures are then shifted around such
+that all origins lie on the same horizontal line. This may make it necessary to
+shift some cell pictures upwards and others downwards, but it can be done and
+this yields the vertical alignment of the cell pictures this row. The top of
+the row is then given by the top of the ``highest'' cell picture in the row,
+the bottom of the row is given by the bottom of the lowest cell picture. (To be
+more precise, the height of the row is the maximum $y$-value of any of the
+bounding boxes and the depth of the row is the negated minimum $y$-value of the
+bounding boxes).
+%
\begin{codeexample}[]
\begin{tikzpicture}
[every node/.style={draw=black,anchor=base,font=\huge}]
@@ -147,7 +141,7 @@ bottom of the first row touches the top of the second row (unless a
|row sep| is used to add a bit of space). Then the bottom of the
second row touches the top of the third row, and so on. Typically,
each row will have an individual height and depth.
-
+%
\begin{codeexample}[]
\begin{tikzpicture}
[every node/.style={draw=black,anchor=base}]
@@ -166,22 +160,20 @@ each row will have an individual height and depth.
\end{tikzpicture}
\end{codeexample}
-Let us now have a look at the columns. The rules for how the pictures
-on any given column are aligned are very similar to the row
-alignment: Consider all cell pictures in the first column. Each is
-shifted horizontally such that the origins lie on the same vertical
-line. Then, the left end of the column is at the left end of the
-bounding box that protrudes furthest to the left. The right end of the
-column is at the right end of the bounding box that protrudes furthest
-to the right. This fixes the horizontal alignment of the cell pictures
-in the first column and the same happens the cell pictures in the
-other columns. Then, the right end of the first column touches the
-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 an implementation
-detail.)
-
+Let us now have a look at the columns. The rules for how the pictures on any
+given column are aligned are very similar to the row alignment: Consider all
+cell pictures in the first column. Each is shifted horizontally such that the
+origins lie on the same vertical line. Then, the left end of the column is at
+the left end of the bounding box that protrudes furthest to the left. The right
+end of the column is at the right end of the bounding box that protrudes
+furthest to the right. This fixes the horizontal alignment of the cell pictures
+in the first column and the same happens the cell pictures in the other
+columns. Then, the right end of the first column touches the 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
+an implementation detail.)
+%
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={draw}]
\matrix [draw=red]
@@ -205,23 +197,21 @@ detail.)
\end{codeexample}
-
\subsubsection{Setting and Adjusting Column and Row Spacing}
-There are different ways of setting and adjusting the spacing between
-columns and rows. First, you can use the options |column sep| and
-|row sep| to set a default spacing for all rows and all
-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.
+There are different ways of setting and adjusting the spacing between columns
+and rows. First, you can use the options |column sep| and |row sep| to set a
+default spacing for all rows and all 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.
\begin{key}{/tikz/column sep=\meta{spacing list}}
- This option sets a default space that is added between every two
- columns. This space can be positive or negative and is zero by
- default. The \meta{spacing list} normally contains a single
- dimension like |2pt|.
+ This option sets a default space that is added between every two columns.
+ This space can be positive or negative and is zero by default. The
+ \meta{spacing list} normally contains a single dimension like |2pt|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [draw,column sep=1cm,nodes=draw]
@@ -236,25 +226,25 @@ the column or row or between their borders.
node [above,midway] {1cm};
\end{tikzpicture}
\end{codeexample}
- More generally, the \meta{spacing list} may contain a whole list of
- numbers, separated by commas, and occurrences of the two key words
- |between origins| and |between borders|. The effect of specifying
- such a list is the following: First, all numbers occurring in the
- list are simply added to compute the final spacing. Second,
- 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
- 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
- origins of all the cells in the second column is exactly the given
- distance.
-
- \emph{The }|between origins|\emph{ 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.}
-
+ %
+ More generally, the \meta{spacing list} may contain a whole list of
+ numbers, separated by commas, and occurrences of the two key words
+ |between origins| and |between borders|. The effect of specifying such a
+ list is the following: First, all numbers occurring in the list are simply
+ added to compute the final spacing. Second, 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 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 origins of all the cells in the second column is exactly the given
+ distance.
+
+ \emph{The }|between origins|\emph{ 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]
@@ -266,13 +256,15 @@ the column or row or between their borders.
\draw [<->,red,thick] (a.center) -- (b.center) node [above,midway] {1cm};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/row sep=\meta{spacing list}}
- This option works like |column sep|, only for rows. Here, too, you
- can specify whether the space is added between the lower end of the
- first row and the upper end of the second row, or whether the space
- is computed between the origins of the two rows.
+ This option works like |column sep|, only for rows. Here, too, you can
+ specify whether the space is added between the lower end of the first row
+ and the upper end of the second row, or whether the space is computed
+ between the origins of the two rows.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [draw,row sep=1cm,nodes=draw]
@@ -284,6 +276,7 @@ the column or row or between their borders.
\draw [<->,red,thick] (a.south) -- (b.north) node [right,midway] {1cm};
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [draw,row sep={1cm,between origins},nodes=draw]
@@ -295,15 +288,16 @@ the column or row or between their borders.
\draw [<->,red,thick] (a.center) -- (b.center) node [right,midway] {1cm};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-The row-end command |\\| allows you to provide an optional
-argument, which must be a dimension. This dimension will be added to
-the list in |row sep|. This means that, firstly, any numbers you list
-in this argument will be added as an extra row separation between the
-line being ended and the next line and, secondly, you can use the
-keywords |between origins| and |between borders| to locally overrule
-the standard setting for this line pair.
+The row-end command |\\| allows you to provide an optional argument, which must
+be a dimension. This dimension will be added to the list in |row sep|. This
+means that, firstly, any numbers you list in this argument will be added as an
+extra row separation between the line being ended and the next line and,
+secondly, you can use the keywords |between origins| and |between borders| to
+locally overrule the standard setting for this line pair.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [row sep=1mm]
@@ -319,14 +313,14 @@ the standard setting for this line pair.
\end{tikzpicture}
\end{codeexample}
-The cell separation character |&| also takes an optional
-argument, which must also be a spacing list. This spacing list is
-added to the |column sep| having a similar effect as the option for
-the |\\| command for rows.
+The cell separation character |&| also takes an optional argument, which must
+also be a spacing list. This spacing list is added to the |column sep| having a
+similar effect as the option for 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.
+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.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [draw,nodes=draw,column sep=1mm]
@@ -337,6 +331,7 @@ of this option in later rows have no effect.
};
\end{tikzpicture}
\end{codeexample}
+%
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [draw,nodes=draw,column sep=1mm]
@@ -348,6 +343,7 @@ of this option in later rows have no effect.
\draw [<->,red,thick] (a.center) -- (b.center) node [above,midway] {11mm};
\end{tikzpicture}
\end{codeexample}
+%
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [draw,nodes=draw,column sep={1cm,between origins}]
@@ -362,39 +358,34 @@ of this option in later rows have no effect.
\end{codeexample}
-
-
\subsubsection{Cell Styles and Options}
-The following styles and options are useful for changing the appearance
-of all cell pictures:
+The following styles and options are useful for changing the appearance of all
+cell pictures:
\begin{stylekey}{/tikz/every cell=\marg{row}\marg{column} (initially \normalfont empty)}
- This style is installed at the beginning of each cell picture with
- the two parameters being the current \meta{row} and \meta{column} of
- the cell. Note that setting this style to |draw| will \emph{not}
- cause all nodes to be drawn since the |draw| option has to be passed
- to each node individually.
-
- Inside this style (and inside all cells), the current \meta{row} and
- \meta{column} number are also accessible via the counters
- |\pgfmatrixcurrentrow| and |\pgfmatrixcurrentcolumn|.
+ This style is installed at the beginning of each cell picture with the two
+ parameters being the current \meta{row} and \meta{column} of the cell. Note
+ that setting this style to |draw| will \emph{not} cause all nodes to be
+ drawn since the |draw| option has to be passed to each node individually.
+
+ Inside this style (and inside all cells), the current \meta{row} and
+ \meta{column} number are also accessible via the counters
+ |\pgfmatrixcurrentrow| and |\pgfmatrixcurrentcolumn|.
\end{stylekey}
\begin{key}{/tikz/cells=\meta{options}}
- This key adds the \meta{options} to the style |every cell|. It is mainly
- just a shorthand for the code
- |every cell/.append style=|\meta{options}.
+ This key adds the \meta{options} to the style |every cell|. It is mainly
+ just a shorthand for the code |every cell/.append style=|\meta{options}.
\end{key}
\begin{key}{/tikz/nodes=\meta{options}}
- This key adds the \meta{options} to the style |every node|. It is mainly
- just a shorthand for the code |every node/.append style=|\meta{options}.
-
- 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}.
+ This key adds the \meta{options} to the style |every node|. It is mainly
+ just a shorthand for the code |every node/.append style=|\meta{options}.
+ 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}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [nodes={fill=blue!20,minimum size=5mm}]
@@ -405,42 +396,43 @@ of all cell pictures:
};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-The next set of styles can be used to change the appearance of certain
-rows, columns, or cells. If more than one of these styles is defined,
-they are executed in the below order (the |every cell| style is
-executed before all of the below).
+The next set of styles can be used to change the appearance of certain rows,
+columns, or cells. If more than one of these styles is defined, they are
+executed in the below order (the |every cell| style is executed before all of
+the below).
+ %
\begin{stylekey}{/tikz/column \meta{number}}
- This style is used for every cell in column \meta{number}.
+ This style is used for every cell in column \meta{number}.
\end{stylekey}
\begin{stylekey}{/tikz/every odd column}
- This style is used for every cell in an odd column.
+ This style is used for every cell in an odd column.
\end{stylekey}
\begin{stylekey}{/tikz/every even column}
- This style is used for every cell in an even column.
+ This style is used for every cell in an even column.
\end{stylekey}
\begin{stylekey}{/tikz/row \meta{number}}
- This style is used for every cell in row \meta{number}.
+ This style is used for every cell in row \meta{number}.
\end{stylekey}
\begin{stylekey}{/tikz/every odd row}
- This style is used for every cell in an odd row.
+ This style is used for every cell in an odd row.
\end{stylekey}
\begin{stylekey}{/tikz/every even row}
- This style is used for every cell in an even row.
+ This style is used for every cell in an even row.
\end{stylekey}
\begin{stylekey}{/tikz/row \meta{row number} column \meta{column number}}
- This style is used for the cell in row \meta{row number} and column
- \meta{column number}.
+ This style is used for the cell in row \meta{row number} and column
+ \meta{column number}.
\end{stylekey}
-
-
+%
\begin{codeexample}[]
\begin{tikzpicture}
[row 1/.style={red},
@@ -456,9 +448,9 @@ executed before all of the below).
\end{tikzpicture}
\end{codeexample}
-You can use the |column |\meta{number} option to change the alignment
-for different columns.
-
+You can use the |column |\meta{number} option to change the alignment for
+different columns.
+%
\begin{codeexample}[]
\begin{tikzpicture}
[column 1/.style={anchor=base west},
@@ -473,21 +465,22 @@ for different columns.
\end{tikzpicture}
\end{codeexample}
-
-In many matrices all cell pictures have nearly the same code. For
-example, cells typically start with |\node{| and end |};|. The
-following options allow you to execute such code in all cells:
+In many matrices all cell pictures have nearly the same code. For example,
+cells typically start with |\node{| and end |};|. The following options allow
+you to execute such code in all cells:
\begin{key}{/tikz/execute at begin cell=\meta{code}}
- The code will be executed at the beginning of each nonempty cell.
+ The code will be executed at the beginning of each nonempty cell.
\end{key}
+%
\begin{key}{/tikz/execute at end cell=\meta{code}}
- The code will be executed at the end of each nonempty cell.
+ The code will be executed at the end of each nonempty cell.
\end{key}
+%
\begin{key}{/tikz/execute at empty cell=\meta{code}}
- The code will be executed inside each empty cell.
+ The code will be executed inside each empty cell.
\end{key}
-
+%
\begin{codeexample}[]
\begin{tikzpicture}
[matrix of nodes/.style={
@@ -502,6 +495,7 @@ following options allow you to execute such code in all cells:
};
\end{tikzpicture}
\end{codeexample}
+%
\begin{codeexample}[]
\begin{tikzpicture}
[matrix of nodes/.style={
@@ -518,27 +512,24 @@ following options allow you to execute such code in all cells:
\end{tikzpicture}
\end{codeexample}
-The |matrix| library defines a number of styles that make use of the
-above options.
-
-
+The |matrix| library defines a number of styles that make use of the above
+options.
\subsection{Anchoring a Matrix}
-Since matrices are nodes, they can be anchored in the usual fashion
-using the |anchor| option. However, there are two ways to influence
-this placement further. First, the following option is often useful:
+Since matrices are nodes, they can be anchored in the usual fashion using the
+|anchor| option. However, there are two ways to influence this placement
+further. First, the following option is often useful:
\begin{key}{/tikz/matrix anchor=\meta{anchor}}
- This option has the same effect as |anchor|, but the option applies
- only to the matrix itself, not to the cells inside. If you just say
- |anchor=north| as an option to the matrix node, all nodes inside
- matrix will also have this anchor, unless it is explicitly set
- differently for each node. By comparison, |matrix anchor| sets the
- anchor for the matrix, but for the nodes inside the value of
- |anchor| remain unchanged.
-
+ This option has the same effect as |anchor|, but the option applies only to
+ the matrix itself, not to the cells inside. If you just say |anchor=north|
+ as an option to the matrix node, all nodes inside matrix will also have
+ this anchor, unless it is explicitly set differently for each node. By
+ comparison, |matrix anchor| sets the anchor for the matrix, but for the
+ nodes inside the value of |anchor| remain unchanged.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [matrix anchor=west] at (0,0)
@@ -555,22 +546,22 @@ this placement further. First, the following option is often useful:
};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-The second way to anchor a matrix is to use \emph{an anchor of a node
- inside the matrix}. For this, the |anchor| option has a special
-effect when given as an argument to a matrix:
+The second way to anchor a matrix is to use \emph{an anchor of a node inside
+the matrix}. For this, the |anchor| option has a special effect when given as
+an argument to a matrix:
\begin{key}{/tikz/anchor=\meta{anchor or node.anchor}}
- Normally, the argument of this option refers to anchor of the matrix
- node, which is the node that includes all of the stuff of the
- matrix. However, you can also provide an argument of the form
- \meta{node}|.|\meta{anchor} where \meta{node} must be node defined
- inside the matrix and \meta{anchor} is an anchor of this node. In
- this case, the whole matrix is shifted around in such a way that
- this particular anchor of this particular node lies at the |at|
- position of the matrix. The same is true for |matrix anchor|.
-
+ Normally, the argument of this option refers to anchor of the matrix node,
+ which is the node that includes all of the stuff of the matrix. However,
+ you can also provide an argument of the form \meta{node}|.|\meta{anchor}
+ where \meta{node} must be node defined inside the matrix and \meta{anchor}
+ is an anchor of this node. In this case, the whole matrix is shifted around
+ in such a way that this particular anchor of this particular node lies at
+ the |at| position of the matrix. The same is true for |matrix anchor|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -583,6 +574,7 @@ effect when given as an argument to a matrix:
\draw (inner node.south) circle (1pt);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
@@ -590,21 +582,20 @@ effect when given as an argument to a matrix:
Even though \tikzname\ seems to use |&| to separate cells, \pgfname\ actually
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
-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}|
-environments. In this case you can use the following option to avoid
-having to type |\pgfmatrixnextcell| each time:
+|\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 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}| environments. In this case you can use the following
+option to avoid having to type |\pgfmatrixnextcell| each time:
\begin{key}{/tikz/ampersand replacement=\meta{macro name or empty}}
- If a macro name is provided, this macro will be defined to be equal
- to |\pgfmatrixnextcell| inside matrices and |&| will not be made
- active. For instance, you could say |ampersand replacement=\&| and
- then use |\&| to separate columns as in the following example:
+ If a macro name is provided, this macro will be defined to be equal to
+ |\pgfmatrixnextcell| inside matrices and |&| will not be made active. For
+ instance, you could say |ampersand replacement=\&| and then use |\&| to
+ separate columns as in the following example:
+ %
\begin{codeexample}[]
\tikz
\matrix [ampersand replacement=\&]
@@ -613,14 +604,15 @@ having to type |\pgfmatrixnextcell| each time:
\draw (0.2,0) circle (2mm); \& \fill[red] (0,0) circle (3mm); \\
};
\end{codeexample}
+ %
\end{key}
\subsection{Examples}
-The following examples are adapted from code by Mark Wibrow. The first
-two redraw pictures from Timothy van Zandt's PStricks documentation:
-
+The following examples are adapted from code by Mark Wibrow. The first two
+redraw pictures from Timothy van Zandt's PStricks documentation:
+%
{\catcode`\|=12
\begin{codeexample}[]
\begin{tikzpicture}
@@ -691,11 +683,11 @@ two redraw pictures from Timothy van Zandt's PStricks documentation:
\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,
-and C.~Harris, Neurofuzzy identification of an autonomous underwater
-vehicle, \emph{International Journal of Systems Science}, 1999, 30, 901--913.
-
+The following example is adapted from code written by Kjell Magne 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,
@@ -740,6 +732,7 @@ vehicle, \emph{International Journal of Systems Science}, 1999, 30, 901--913.
\end{codeexample}
}
+
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
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 02456c9c869..340a5cef081 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
@@ -7,104 +7,111 @@
%
% 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
-follow a special syntax, which is described in the subsections of the
-present section.
-
+A \emph{path} is a series of straight and curved line segments. It is specified
+following a |\path| command and the specification must follow a special syntax,
+which is described in the subsections of the present section.
\begin{command}{\path\meta{specification}|;|}
- This command is available only inside a |{tikzpicture}| environment.
-
- The \meta{specification} is a long stream of \emph{path
- operations}. Most of these path operations tell \tikzname\ how the path
- is built. For example, when you write |--(0,0)|, you use a
- \emph{line-to operation} and it means ``continue the path from
- wherever you are to the origin.''
-
- At any point where \tikzname\ expects a path operation, you can also
- give some graphic options, which is a list of options in brackets,
- such as |[rounded corners]|. These options can have different
- effects:
- \begin{enumerate}
- \item
- Some options take ``immediate'' effect and apply to all subsequent
- path operations on the path. For example, the |rounded corners|
- option will round all following corners, but not the corners
- ``before'' and if the |sharp corners| is given later on the path
- (in a new set of brackets), the rounding effect will end.
-
+ This command is available only inside a |{tikzpicture}| environment.
+
+ The \meta{specification} is a long stream of \emph{path operations}. Most
+ of these path operations tell \tikzname\ how the path is built. For
+ example, when you write |--(0,0)|, you use a \emph{line-to operation} and
+ it means ``continue the path from wherever you are to the origin''.
+
+ At any point where \tikzname\ expects a path operation, you can also give
+ some graphic options, which is a list of options in brackets, such as
+ |[rounded corners]|. These options can have different effects:
+ %
+ \begin{enumerate}
+ \item Some options take ``immediate'' effect and apply to all
+ subsequent path operations on the path. For example, the
+ |rounded corners| option will round all following corners, but not
+ the corners ``before'' and if the |sharp corners| is given later on
+ the path (in a new set of brackets), the rounding effect will end.
+ %
\begin{codeexample}[]
\tikz \draw (0,0) -- (1,1)
[rounded corners] -- (2,0) -- (3,1)
[sharp corners] -- (3,0) -- (2,1);
\end{codeexample}
- Another example are the transformation options, which also apply
- only to subsequent coordinates.
- \item
- The options that have immediate effect can be ``scoped'' by
- putting part of a path in curly braces. For example, the above
- example could also be written as follows:
-
+ %
+ Another example are the transformation options, which also apply
+ only to subsequent coordinates.
+ \item The options that have immediate effect can be ``scoped'' by
+ putting part of a path in curly braces. For example, the above
+ example could also be written as follows:
+ %
\begin{codeexample}[]
\tikz \draw (0,0) -- (1,1)
{[rounded corners] -- (2,0) -- (3,1)}
-- (3,0) -- (2,1);
\end{codeexample}
- \item
- Some options only apply to the path as a whole. For example, the
- |color=| option for determining the color used for, say, drawing
- 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'':
-
+ %
+ \item Some options only apply to the path as a whole. For example,
+ the |color=| option for determining the color used for, say,
+ drawing 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)
[color=blue] -- (3,0) -- (2,1);
\end{codeexample}
- Most options are of this type. In the above example, we would have
- had to ``split up'' the path into several |\path| commands:
+ Most options are of this type. In the above example, we would
+ have had to ``split up'' the path into several |\path| commands:
+ %
\begin{codeexample}[]
\tikz{\draw (0,0) -- (1,1);
\draw [color=red] (2,0) -- (3,1);
\draw [color=blue] (3,0) -- (2,1);}
\end{codeexample}
- \end{enumerate}
-
- 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
- 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
- specification starts with |node|. Basically, the effect is to
- typeset the node's text as normal \TeX\ text and to place
- it at the ``current location'' on the path. The details are explained
- in Section~\ref{section-nodes}.
-
- Note, however, that the nodes are \emph{not} part of the path in any
- way. Rather, after everything has been done with the path what is
- 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.
-
- 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
- be useful for (temporarily) adding, say, the |draw| option to
- everything in a scope.
+ \end{enumerate}
+
+ 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 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 specification
+ starts with |node|. Basically, the effect is to typeset the node's text as
+ normal \TeX\ text and to place it at the ``current location'' on the path.
+ The details are explained in Section~\ref{section-nodes}.
+
+ Note, however, that the nodes are \emph{not} part of the path in any way.
+ Rather, after everything has been done with the path what is 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.
+
+ \begin{key}{/tikz/name=\meta{path name}}
+ Assigns a name to the path for reference (specifically, for reference
+ in animations; for reference in intersections, use the |name path|
+ command, which has a different purpose, see the |intersections| library
+ for details). Since the name is a ``high-level'' name (drivers never
+ know of it), you can use spaces, number, letters, or whatever you like
+ when naming a path, but the name may \emph{not} contain any punctuation
+ like a dot, a comma, or a colon.
+ \end{key}
+
+ 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 be
+ useful for (temporarily) adding, say, the |draw| option to everything
+ in a scope.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[fill=yellow!80!black, % only sets the color
@@ -113,92 +120,89 @@ present section.
\shade (2,0) rectangle +(1,1);
\end{tikzpicture}
\end{codeexample}
- \end{stylekey}
-
+ \end{stylekey}
\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.
+ 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]|.
+ %
+ 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.
+ 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.
+ %
+ 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|.
+ 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}
-The perhaps simplest operation is the move-to operation, which is
-specified by just giving a coordinate where a path operation is
-expected.
+The perhaps simplest operation is the move-to operation, which is specified by
+just giving a coordinate where a path operation is expected.
\begin{pathoperation}[noindex]{}{\meta{coordinate}}
- \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
- 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
- path that is not connected to any of the previous segments.
-
+ \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 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 path that is not connected to any of the previous
+ segments.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) --(2,0) (0,1) --(2,1);
\end{tikzpicture}
\end{codeexample}
- In the specification |(0,0) --(2,0) (0,1) --(2,1)| two move-to
- operations are specified: |(0,0)| and |(0,1)|. The other two
- operations, namely |--(2,0)| and |--(2,1)| are line-to operations,
- described next.
+ In the specification |(0,0) --(2,0) (0,1) --(2,1)| two move-to operations
+ are specified: |(0,0)| and |(0,1)|. The other two operations, namely
+ |--(2,0)| and |--(2,1)| are line-to operations, described next.
\end{pathoperation}
-There is special coordinate called |current subpath start| that is
-always at the position of the last move-to operation on the current
-path.
-
+There is special coordinate called |current subpath start| that is always at
+the position of the last move-to operation on the current path.
+%
\begin{codeexample}[]
\tikz [line width=2mm]
\draw (0,0) -- (1,0) -- (1,1)
-- (0,1) -- (current subpath start);
\end{codeexample}
-Note how in the above example the path is not closed (as |--cycle|
-would do). Rather, the line just starts and ends at the origin without
-being a closed path.
+Note how in the above example the path is not closed (as |--cycle| would do).
+Rather, the line just starts and ends at the origin without being a closed
+path.
\subsection{The Line-To Operation}
@@ -206,20 +210,20 @@ being a closed path.
\subsubsection{Straight Lines}
\begin{pathoperation}{--}{\meta{coordinate or cycle}}
- The line-to operation extends the current path from the current
- point in a straight line to the given \meta{coordinate} (the ``or
- cycle'' part is explained in a moment). The ``current
- point'' is the endpoint of the previous drawing operation or the point
- specified by a prior move-to operation.
-
- When a line-to operation is used and some path segment has just been
- constructed, for example by another line-to operation, the two line
- segments become joined. This means that if they are drawn, the point
- where they meet is ``joined'' smoothly. To appreciate the difference,
- consider the following two examples: In the left example, the path
- consists of two path segments that are not joined, but they happen to
- share a point, while in the right example a smooth join is shown.
-
+ The line-to operation extends the current path from the current point in a
+ straight line to the given \meta{coordinate} (the ``or cycle'' part is
+ explained in a moment). The ``current point'' is the endpoint of the
+ previous drawing operation or the point specified by a prior move-to
+ operation.
+
+ When a line-to operation is used and some path segment has just been
+ constructed, for example by another line-to operation, the two line
+ segments become joined. This means that if they are drawn, the point where
+ they meet is ``joined'' smoothly. To appreciate the difference, consider
+ the following two examples: In the left example, the path consists of two
+ path segments that are not joined, but they happen to share a point, while
+ in the right example a smooth join is shown.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[line width=10pt]
\draw (0,0) --(1,1) (1,1) --(2,0);
@@ -228,18 +232,17 @@ being a closed path.
\end{tikzpicture}
\end{codeexample}
- Instead of a coordinate following the two minus signs, you can also
- use the text |cycle|. This causes the straight line from the current
- point to go to the last point specified by a move-to operation. Note
- that this need not be the beginning of the path. Furthermore, a
- smooth join is created between the first segment created after the
- last move-to operation and the straight line appended by the cycle
- operation.
-
- Consider the following example. In the left example, two triangles are
- created using three straight lines, but they are not joined at the
- ends. In the second example cycle operations are used.
-
+ Instead of a coordinate following the two minus signs, you can also use the
+ text |cycle|. This causes the straight line from the current point to go to
+ the last point specified by a move-to operation. Note that this need not be
+ the beginning of the path. Furthermore, a smooth join is created between
+ the first segment created after the last move-to operation and the straight
+ line appended by the cycle operation.
+
+ Consider the following example. In the left example, two triangles are
+ created using three straight lines, but they are not joined at the ends. In
+ the second example cycle operations are used.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[line width=10pt]
\draw (0,0) -- (1,1) -- (1,0) -- (0,0) (2,0) -- (3,1) -- (3,0) -- (2,0);
@@ -247,31 +250,31 @@ being a closed path.
\useasboundingbox (0,1.5); % make bounding box higher
\end{tikzpicture}
\end{codeexample}
+ %
\end{pathoperation}
-Writing |cycle| instead of a coordinate at the end of a path operation
-is possible with all path operations that end with a coordinate (such
-as |--| or |..| or |sin| or |grid|, but not |graph| or |plot|).
-In all cases, the effect is that the coordinate of the last moveto is
-used as the coordinate expected by the path operation and that a
-smooth join is added. (What actually happens that the text |cycle|
-used with any path operation other than |--| gets replaced by
+Writing |cycle| instead of a coordinate at the end of a path operation is
+possible with all path operations that end with a coordinate (such as |--| or
+|..| or |sin| or |grid|, but not |graph| or |plot|). In all cases, the effect
+is that the coordinate of the last moveto is used as the coordinate expected by
+the path operation and that a smooth join is added. (What actually happens that
+the text |cycle| used with any path operation other than |--| gets replaced by
|(current subpath start)--cycle|.)
\subsubsection{Horizontal and Vertical Lines}
-Sometimes you want to connect two points via straight lines that are
-only horizontal and vertical. For this, you can use two path
-construction operations.
+Sometimes you want to connect two points via straight lines that are only
+horizontal and vertical. For this, you can use two path construction
+operations.
{\catcode`\|=12
\begin{pathoperation}[noindex]{-|}{\meta{coordinate or cycle}}
- \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.''
-
+ \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}[]
\begin{tikzpicture}
\draw (0,0) node(a) [draw] {A} (1,1) node(b) [draw] {B};
@@ -279,44 +282,44 @@ construction operations.
\draw[color=red] (a.east) -| (2,1.5) -| (b.north);
\end{tikzpicture}
\end{codeexample}
- Instead of a coordinate you can also write \verb!cycle! to close the
- path:
+ %
+ Instead of a coordinate you can also write \verb!cycle! to close the path:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[ultra thick]
\draw (0,0) -- (1,1) -| cycle;
\end{tikzpicture}
\end{codeexample}
\end{pathoperation}
+
\begin{pathoperation}[noindex]{|-}{\meta{coordinate or cycle}}
- \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.''
+ \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}
}
\subsection{The Curve-To Operation}
-The curve-to operation allows you to extend a path using a B\'ezier
-curve.
+The curve-to operation allows you to extend a path using a Bézier curve.
\begin{pathoperation}{..}{\declare{|controls|}\meta{c}\opt{|and|\meta{d}}\declare{|..|\meta{y or cycle}}}
- This operation extends the current path from the current
- point, let us call it $x$, via a curve to a point~$y$ (if, instead
- of a coordinate you say |cycle| at the end, $y$ will be the
- coordinate of the last move-to operation).
- The curve is a cubic B\'ezier 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
- through $c$. Similarly, the curve ends at $y$, ``coming from'' the
- other control point,~$d$. The larger the distance between $x$ and~$c$
- and between $d$ and~$y$, the larger the curve will be.
-
- If the ``|and|\meta{d}'' part is not given, $d$ is assumed to be
- equal to $c$.
-
+ This operation extends the current path from the current point, let us call
+ it $x$, via a curve to a point~$y$ (if, instead of a coordinate you say
+ |cycle| at the end, $y$ will be the coordinate of the last move-to
+ operation). 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 through $c$.
+ Similarly, the curve ends at $y$, ``coming from'' the other control
+ point,~$d$. The larger the distance between $x$ and~$c$ and between $d$
+ and~$y$, the larger the curve will be.
+
+ If the ``|and|\meta{d}'' part is not given, $d$ is assumed to be equal to
+ $c$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[line width=10pt] (0,0) .. controls (1,1) .. (4,0)
@@ -331,10 +334,10 @@ curve.
\end{tikzpicture}
\end{codeexample}
- As with the line-to operation, it makes a difference whether two curves
- are joined because they resulted from consecutive curve-to or line-to
- operations, or whether they just happen to have a common (end) point:
-
+ As with the line-to operation, it makes a difference whether two curves are
+ joined because they resulted from consecutive curve-to or line-to
+ operations, or whether they just happen to have a common (end) point:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[line width=10pt]
\draw (0,0) -- (1,1) (1,1) .. controls (1,0) and (2,0) .. (2,0);
@@ -342,21 +345,20 @@ curve.
(0,0) -- (1,1) .. controls (1,0) and (2,0) .. (2,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{pathoperation}
-
\subsection{The Rectangle Operation}
-A rectangle can obviously be created using four straight lines and a
-cycle operation. However, since rectangles are needed so often, a
-special syntax is available for them.
+A rectangle can obviously be created using four straight lines and a cycle
+operation. However, since rectangles are needed so often, a special syntax is
+available for them.
\begin{pathoperation}{rectangle}{\meta{corner or cycle}}
- When this operation is used, one corner will be the current point,
- another corner is given by \meta{corner}, which becomes the new
- current point.
-
+ When this operation is used, one corner will be the current point, another
+ corner is given by \meta{corner}, which becomes the new current point.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) rectangle (1,1);
@@ -364,29 +366,30 @@ special syntax is available for them.
\end{tikzpicture}
\end{codeexample}
- Just for consistency, you can also use |cycle| instead of a
- coordinate, but it is a bit unclear what use this might have.
+ Just for consistency, you can also use |cycle| instead of a coordinate, but
+ it is a bit unclear what use this might have.
\end{pathoperation}
\subsection{Rounding Corners}
-All of the path construction operations mentioned up to now are
-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.
+All of the path construction operations mentioned up to now are 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.
+ %
\begin{codeexample}[]
\tikz \draw [rounded corners] (0,0) -- (1,1)
-- (2,0) .. controls (3,1) .. (4,0);
\end{codeexample}
- 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|.
-
+ 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|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[color=gray,very thin] (10pt,15pt) circle[radius=10pt];
@@ -394,10 +397,9 @@ influenced by the following option:
\end{tikzpicture}
\end{codeexample}
- You can switch the rounded corners on and off ``in the middle of
- path'' and different corners in the same path can have different
- corner radii:
-
+ You can switch the rounded corners on and off ``in the middle of path'' and
+ different corners in the same path can have different corner radii:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) [rounded corners=10pt] -- (1,1) -- (2,1)
@@ -406,65 +408,66 @@ influenced by the following option:
\end{tikzpicture}
\end{codeexample}
-Here is a rectangle with rounded corners:
+ Here is a rectangle with rounded corners:
+ %
\begin{codeexample}[]
\tikz \draw[rounded corners=1ex] (0,0) rectangle (20pt,2ex);
\end{codeexample}
- You should be aware, that there are several pitfalls when using this
- option. First, the rounded corner will only be an arc (part of a
- circle) if the angle is $90^\circ$. In other cases, the rounded
- corner will still be round, but ``not as nice.''
+ You should be aware, that there are several pitfalls when using this
+ option. First, the rounded corner will only be an arc (part of a circle) if
+ the angle is $90^\circ$. In other cases, the rounded corner will still be
+ round, but ``not as nice''.
- Second, if there are very short line segments in a path, the
- ``rounding'' may cause inadvertent effects. In such case it may be
- necessary to temporarily switch off the rounding using
- |sharp corners|.
+ Second, if there are very short line segments in a path, the ``rounding''
+ may cause inadvertent effects. In such case it may be necessary to
+ temporarily switch off the rounding using |sharp corners|.
\end{key}
\begin{key}{/tikz/sharp corners}
- This options switches off any rounding on subsequent corners of the
- path.
+ This options switches off any rounding on subsequent corners of the path.
\end{key}
-
\subsection{The Circle and Ellipse Operations}
-Circles and ellipses are common path elements for which there is a
-special path operation.
+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.
+ 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];
@@ -472,88 +475,92 @@ special path operation.
\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):
+ 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}
- The following style is used with every circle:
- \begin{stylekey}{/tikz/every circle}
- You can use this key to set up, say, a default radius for every
- circle. The key will also be used with the |ellipse| operation.
- \end{stylekey}
+ The following style is used with every circle:
+ %
+ \begin{stylekey}{/tikz/every circle}
+ You can use this key to set up, say, a default radius for every circle.
+ The key will also be used with the |ellipse| operation.
+ \end{stylekey}
- In case you feel that the names |radius| and |x radius| are too long
- for your taste, you can easily created shorter aliases:
+ 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.
+ %
+ 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.
+ 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 [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.
+The \emph{arc operation} allows you to add an arc to the current path.
+%
\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}[]
+ 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}[radius=1cm]
\draw (0,0) arc[start angle=180, end angle=90]
-- (2,.5) arc[start angle=90, delta angle=-90];
@@ -575,49 +582,45 @@ path.
\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.
+ 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.
+You can add a grid to the current path using the |grid| path operation.
\begin{pathoperation}{grid}{\opt{\oarg{options}}\meta{corner or cycle}}
- This operations adds a grid filling a rectangle whose two corners
- are given by \meta{corner} and by the previous coordinate. (Instead
- of a coordinate you can also say |cycle| to use the position of the
- last move-to as the corner coordinate, but it not very natural to
- do so.) corner Thus, the
- typical way in which a grid is drawn is |\draw (1,1) grid (3,3);|,
- which yields a grid filling the rectangle whose corners are at
- $(1,1)$ and $(3,3)$. All coordinate transformations apply to the
- grid.
-
+ This operations adds a grid filling a rectangle whose two corners are given
+ by \meta{corner} and by the previous coordinate. (Instead of a coordinate
+ you can also say |cycle| to use the position of the last move-to as the
+ corner coordinate, but it not very natural to do so.) corner Thus, the
+ typical way in which a grid is drawn is |\draw (1,1) grid (3,3);|, which
+ yields a grid filling the rectangle whose corners are at $(1,1)$ and
+ $(3,3)$. All coordinate transformations apply to the grid.
+ %
\begin{codeexample}[]
\tikz[rotate=30] \draw[step=1mm] (0,0) grid (2,2);
\end{codeexample}
- 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:
-
-\begin{key}{/tikz/step=\meta{number or dimension or coordinate}
- (initially 1cm)}
- Sets the stepping in both the
- $x$ and $y$-direction. If a dimension is provided, this is used
- directly. If a number is provided, this number is interpreted in the
- $xy$-coordinate system. For example, if you provide the number |2|,
- then the $x$-step is twice the $x$-vector and the $y$-step is twice
- the $y$-vector set by the |x=| and |y=| options. Finally, if you
- provide a coordinate, then the $x$-part of this coordinate will be
- used as the $x$-step and the $y$-part will be used as the
- $y$-coordinate.
-
+ 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:
+ %
+ \begin{key}{/tikz/step=\meta{number or dimension or coordinate} (initially 1cm)}
+ Sets the stepping in both the $x$ and $y$-direction. If a dimension is
+ provided, this is used directly. If a number is provided, this number
+ is interpreted in the $xy$-coordinate system. For example, if you
+ provide the number |2|, then the $x$-step is twice the $x$-vector and
+ the $y$-step is twice the $y$-vector set by the |x=| and |y=| options.
+ Finally, if you provide a coordinate, then the $x$-part of this
+ coordinate will be used as the $x$-step and the $y$-part will be used
+ as the $y$-coordinate.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[x=.5cm]
\draw[thick] (0,0) grid [step=1] (3,2);
@@ -629,66 +632,72 @@ operation.
\end{tikzpicture}
\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
- $x$-step and the $y$-step is the following: As the $x$- and
- $y$-steps we use the $x$- and $y$-components or the following two
- 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}
+ 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
+ $x$-step and the $y$-step is the following: As the $x$- and $y$-steps
+ we use the $x$- and $y$-components or the following two 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{y-grid-step-dimension})$.
+
+ If the $x$-step or $y$-step is $0$ or negative the corresponding lines
+ are not drawn.
+ \end{key}
-\begin{key}{/tikz/xstep=\meta{dimension or number} (initially 1cm)}
- Sets the stepping in the $x$-direction.
+ \begin{key}{/tikz/xstep=\meta{dimension or number} (initially 1cm)}
+ Sets the stepping in the $x$-direction.
+ %
\begin{codeexample}[]
-\tikz \draw (0,0) grid [xstep=.5,ystep=.75] (3,2);
+\begin{tikzpicture}
+ \draw (0,0) grid [xstep=.5,ystep=.75] (3,2);
+ \draw[ultra thick] (0,0) grid [ystep=0] (3,2);
+\end{tikzpicture}
\end{codeexample}
-\end{key}
+ \end{key}
-\begin{key}{/tikz/ystep=\meta{dimension or number} (initially 1cm)}
- Sets the stepping in the $y$-direction.
-\end{key}
+ \begin{key}{/tikz/ystep=\meta{dimension or number} (initially 1cm)}
+ Sets the stepping in the $y$-direction.
+ \end{key}
- It is important to note that the grid is always ``phased'' such that
- it contains the point $(0,0)$ if that point happens to be inside the
- rectangle. Thus, the grid does \emph{not} always have an intersection
- at the corner points; this occurs only if the corner points are
- multiples of the stepping. Note that due to rounding errors, the
- ``last'' lines of a grid may be omitted. In this case, you have to
- add an epsilon to the corner points.
-
- The following style is useful for drawing grids:
-\begin{stylekey}{/tikz/help lines (initially {line width=0.2pt,gray})}
- This style makes lines ``subdued'' by using thin gray lines for
- them. However, this style is not installed automatically and you
- have to say for example:
+ It is important to note that the grid is always ``phased'' such that it
+ contains the point $(0,0)$ if that point happens to be inside the
+ rectangle. Thus, the grid does \emph{not} always have an intersection at
+ the corner points; this occurs only if the corner points are multiples of
+ the stepping. Note that due to rounding errors, the ``last'' lines of a
+ grid may be omitted. In this case, you have to add an epsilon to the corner
+ points.
+
+ The following style is useful for drawing grids:
+ %
+ \begin{stylekey}{/tikz/help lines (initially {line width=0.2pt,gray})}
+ This style makes lines ``subdued'' by using thin gray lines for them.
+ However, this style is not installed automatically and you have to say
+ for example:
+ %
\begin{codeexample}[]
\tikz \draw[help lines] (0,0) grid (3,3);
\end{codeexample}
-\end{stylekey}
-
+ \end{stylekey}
\end{pathoperation}
-
\subsection{The Parabola Operation}
-The |parabola| path operation continues the current path with a
-parabola. A parabola is a (shifted and scaled) curve defined by the
-equation $f(x) = x^2$ and looks like this: \tikz \draw (-1ex,1.5ex)
-parabola[parabola height=-1.5ex] +(2ex,0ex);.
+The |parabola| path operation continues the current path with a parabola. A
+parabola is a (shifted and scaled) curve defined by the equation $f(x) = x^2$
+and looks like this: \tikz \draw (-1ex,1.5ex) parabola[parabola height=-1.5ex]
++(2ex,0ex);.
\begin{pathoperation}{parabola}{\opt{\oarg{options}|bend|\meta{bend
coordinate}}\meta{coordinate or cycle}}
- This operation adds a parabola through the current point and the
- given \meta{coordinate} or, if |cycle| is used instead of coordinate
- at the end, the \meta{coordinate} is set to the position of the last
- move-to and the path gets closed after the parabola. 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.
-
+ This operation adds a parabola through the current point and the given
+ \meta{coordinate} or, if |cycle| is used instead of coordinate at the end,
+ the \meta{coordinate} is set to the position of the last move-to and the
+ path gets closed after the parabola. 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) rectangle (1,1.5)
@@ -697,42 +706,42 @@ parabola[parabola height=-1.5ex] +(2ex,0ex);.
(0,0) parabola[bend at end] (1,1.5);
\draw[xshift=3cm] (0,0) rectangle (1,1.5)
(0,0) parabola bend (.75,1.75) (1,1.5);
-
+
\draw[yshift=-2cm] (1,1.5) --
(0,0) parabola cycle;
\end{tikzpicture}
\end{codeexample}
- The following options influence parabolas:
-\begin{key}{/tikz/bend=\meta{coordinate}}
- Has the same effect as saying |bend|\meta{coordinate} outside the
- \meta{options}. The option specifies that the bend of the parabola
- should be at the given \meta{coordinate}. You have to take care
- yourself that the bend position is a ``valid'' position; which means
- that if there is no parabola of the form $f(x) = a x^2 + b x + c$
- that goes through the old current point, the given bend, and the new
- current point, the result will not be a parabola.
-
- There is one special property of the \meta{coordinate}: When a
- relative coordinate is given like |+(0,0)|, the position relative
- to this coordinate is ``flexible.'' More precisely, this
- position lies somewhere on a line from the old current point to the
- new current point. The exact position depends on the next
- option.
-\end{key}
+ The following options influence parabolas:
+ %
+ \begin{key}{/tikz/bend=\meta{coordinate}}
+ Has the same effect as saying |bend|\meta{coordinate} outside the
+ \meta{options}. The option specifies that the bend of the parabola
+ should be at the given \meta{coordinate}. You have to take care
+ yourself that the bend position is a ``valid'' position; which means
+ that if there is no parabola of the form $f(x) = a x^2 + b x + c$ that
+ goes through the old current point, the given bend, and the new current
+ point, the result will not be a parabola.
+
+ There is one special property of the \meta{coordinate}: When a relative
+ coordinate is given like |+(0,0)|, the position relative to this
+ coordinate is ``flexible''. More precisely, this position lies
+ somewhere on a line from the old current point to the new current
+ point. The exact position depends on the next option.
+ \end{key}
-\begin{key}{/tikz/bend pos=\meta{fraction}}
- Specifies where the ``previous'' point is relative to which the bend
- is calculated. The previous point will be at the \meta{fraction}th
- part of the line from the old current point to the new current
- point.
-
- The idea is the following: If you say |bend pos=0| and
- |bend +(0,0)|, the bend will be at the old current point. If you say
- |bend pos=1| and |bend +(0,0)|, the bend will be at the new current
- point. If you say |bend pos=0.5| and |bend +(0,2cm)| the bend will
- be 2cm above the middle of the line between the start and end
- point. This is most useful in situations such as the following:
+ \begin{key}{/tikz/bend pos=\meta{fraction}}
+ Specifies where the ``previous'' point is relative to which the bend is
+ calculated. The previous point will be at the \meta{fraction}th part of
+ the line from the old current point to the new current point.
+
+ The idea is the following: If you say |bend pos=0| and |bend +(0,0)|,
+ the bend will be at the old current point. If you say |bend pos=1| and
+ |bend +(0,0)|, the bend will be at the new current point. If you say
+ |bend pos=0.5| and |bend +(0,2cm)| the bend will be 2cm above the
+ middle of the line between the start and end point. This is most useful
+ in situations such as the following:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -740,88 +749,89 @@ parabola[parabola height=-1.5ex] +(2ex,0ex);.
\end{tikzpicture}
\end{codeexample}
- In the above example, the |bend +(0,2)| essentially means ``a
- parabola that is 2cm high'' and |+(3,0)| means ``and 3cm wide.''
- Since this situation arises often, there is a special shortcut
- option:
- \begin{key}{/tikz/parabola height=\meta{dimension}}
- This option has the same effect as
- |[bend pos=0.5,bend={+(0pt,|\meta{dimension}|)}]|.
+ In the above example, the |bend +(0,2)| essentially means ``a parabola
+ that is 2cm high'' and |+(3,0)| means ``and 3cm wide''. Since this
+ situation arises often, there is a special shortcut option:
+ %
+ \begin{key}{/tikz/parabola height=\meta{dimension}}
+ This option has the same effect as
+ |[bend pos=0.5,bend={+(0pt,|\meta{dimension}|)}]|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\draw (-1,0) parabola[parabola height=2cm] +(3,0);
\end{tikzpicture}
\end{codeexample}
- \end{key}
-\end{key}
-
-The following styles are useful shortcuts:
-\begin{stylekey}{/tikz/bend at start}
- This places the bend at the start of a
- parabola. It is a shortcut for the following options:
- |bend pos=0,bend={+(0,0)}|.
-\end{stylekey}
+ \end{key}
+ \end{key}
-\begin{stylekey}{/tikz/bend at end}
- This places the bend at the end of a parabola.
-\end{stylekey}
+ The following styles are useful shortcuts:
+ %
+ \begin{stylekey}{/tikz/bend at start}
+ This places the bend at the start of a parabola. It is a shortcut for
+ the following options: |bend pos=0,bend={+(0,0)}|.
+ \end{stylekey}
+ \begin{stylekey}{/tikz/bend at end}
+ This places the bend at the end of a parabola.
+ \end{stylekey}
\end{pathoperation}
\subsection{The Sine and Cosine Operation}
-The |sin| and |cos| operations are similar to the |parabola|
-operation. They, too, can be used to draw (parts of) a sine or cosine
-curve.
+The |sin| and |cos| operations are similar to the |parabola| operation. They,
+too, can be used to draw (parts of) a sine or cosine curve.
\begin{pathoperation}{sin}{\meta{coordinate or cycle}}
- The effect of |sin| is to draw a scaled and shifted version of a sine
- curve in the interval $[0,\pi/2]$. The scaling and shifting is done in
- such a way that the start of the sine curve in the interval is at the
- old current point and that the end of the curve in the interval is at
- \meta{coordinate}. Here is an example that should clarify this:
-
+ The effect of |sin| is to draw a scaled and shifted version of a sine curve
+ in the interval $[0,\pi/2]$. The scaling and shifting is done in such a way
+ that the start of the sine curve in the interval is at the old current
+ point and that the end of the curve in the interval is at
+ \meta{coordinate}. Here is an example that should clarify this:
+ %
\begin{codeexample}[]
\tikz \draw (0,0) rectangle (1,1) (0,0) sin (1,1)
(2,0) rectangle +(1.57,1) (2,0) sin +(1.57,1);
\end{codeexample}
+ %
\end{pathoperation}
\begin{pathoperation}{cos}{\meta{coordinate or cycle}}
- This operation works similarly, only a cosine in the interval
- $[0,\pi/2]$ is drawn. By correctly alternating |sin| and |cos|
- operations, you can create a complete sine or cosine curve:
-
+ This operation works similarly, only a cosine in the interval $[0,\pi/2]$
+ is drawn. By correctly alternating |sin| and |cos| operations, you can
+ create a complete sine or cosine curve:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[xscale=1.57]
\draw (0,0) sin (1,1) cos (2,0) sin (3,-1) cos (4,0) sin (5,1);
\draw[color=red] (0,1.5) cos (1,0) sin (2,-1.5) cos (3,0) sin (4,1.5) cos (5,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{pathoperation}
-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$.
+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.
+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}}\marg{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 move-to 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 set up, say, some transformations.
-
+ 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 move-to 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 set up, say, some transformations.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\filldraw [fill=red!20] (0,1) svg[scale=2] {h 10 v 10 h -10}
@@ -831,70 +841,66 @@ consult this specification for details.
\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.
+ 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.
- Instead of curly braces, you can also use quotation marks to
- indicate the start and end of the \textsc{svg} path.
+ Instead of curly braces, you can also use quotation marks to indicate the
+ start and end of the \textsc{svg} path.
- \emph{Warning:} The arc operations (|a| and |A|) are numerically
- instable. 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).
+ \emph{Warning:} The arc operations (|a| and |A|) are numerically instable.
+ 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}
-The |plot| operation can be used to append a line or curve to the path
-that goes through a large number of coordinates. These coordinates are
-either given in a simple list of coordinates, read from some file, or
-they are computed on the fly.
+The |plot| operation can be used to append a line or curve to the path that
+goes through a large number of coordinates. These coordinates are either given
+in a simple list of coordinates, read from some file, or they are computed on
+the fly.
+
+Since the syntax and the behaviour of this command are a bit complex, they are
+described in the separated Section~\ref{section-tikz-plots}.
-Since the syntax and the behaviour of this command are a bit complex,
-they are described in the separated Section~\ref{section-tikz-plots}.
\subsection{The To Path Operation}
-The |to| operation is used to add a user-defined path
-from the previous coordinate to the following coordinate. When you
-write |(a) to (b)|, a straight line is added from |a|
-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.
+The |to| operation is used to add a user-defined path from the previous
+coordinate to the following coordinate. When you write |(a) to (b)|, a straight
+line is added from |a| 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.
\begin{pathoperation}{to}{\opt{|[|\meta{options}|]|}
- \opt{\meta{nodes}} \meta{coordinate or cycle}}
-
- This path operation inserts the path currently 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 set up how the path
- will be rendered.
-
- Before the |to path| is inserted, a number of macros are set up that
- can ``help'' the |to path|. These are |\tikztostart|,
- |\tikztotarget|, and |\tikztonodes|; they are explained in the
- following.
-
- \medskip
- \textbf{Start and Target Coordinates.}\ \
- The |to| operation is always followed by a \meta{coordinate}, called
- the target coordinate, or the text |cycle|, in which case the last
- move-to is used as a coordinate and the path gets closed. The macro
- |\tikztotarget| is set to this coordinate (without its
- parentheses). There is also a \emph{start coordinate}, which is the
- coordinate preceding the |to| operation. This coordinate can be
- accessed via the macro |\tikztostart|. In the following example, for
- the first |to|, the 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|. For the
- third, they are set to |a| and |current subpath start|.
-
+ \opt{\meta{nodes}} \meta{coordinate or cycle}}
+ This path operation inserts the path currently 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 set up how the path will be rendered.
+
+ Before the |to path| is inserted, a number of macros are set up that can
+ ``help'' the |to path|. These are |\tikztostart|, |\tikztotarget|, and
+ |\tikztonodes|; they are explained in the following.
+
+ \medskip
+ \textbf{Start and Target Coordinates.}\ \
+ The |to| operation is always followed by a \meta{coordinate}, called the
+ target coordinate, or the text |cycle|, in which case the last move-to is
+ used as a coordinate and the path gets closed. The macro |\tikztotarget| is
+ set to this coordinate (without its parentheses). There is also a
+ \emph{start coordinate}, which is the coordinate preceding the |to|
+ operation. This coordinate can be accessed via the macro |\tikztostart|. In
+ the following example, for the first |to|, the 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|. For the third,
+ they are set to |a| and |current subpath start|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -906,17 +912,15 @@ trigger a special path to be used instead of the straight line.
\end{tikzpicture}
\end{codeexample}
-
- \medskip
- \textbf{Nodes on to--paths.}\ \
- 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)|
- (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:
-
+ \medskip
+ \textbf{Nodes on to--paths.}\ \
+ 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)| (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:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) to node [sloped,above] {x} (3,2);
@@ -925,15 +929,15 @@ trigger a special path to be used instead of the straight line.
\end{tikzpicture}
\end{codeexample}
- Instead of writing the node between the |to| keyword and the
- target coordinate, you may also use the following keys to create
- such nodes:
- \begin{key}{/tikz/edge node=\meta{node specification}}
- This key can be used inside the \meta{options} of a |to| path
- command. It will add the \meta{node specification} to the list of
- nodes to be placed on the connecting line, just as if you had
- written the \meta{node specification} directly after the |to|
- keyword:
+ Instead of writing the node between the |to| keyword and the target
+ coordinate, you may also use the following keys to create such nodes:
+ %
+ \begin{key}{/tikz/edge node=\meta{node specification}}
+ This key can be used inside the \meta{options} of a |to| path command.
+ It will add the \meta{node specification} to the list of nodes to be
+ placed on the connecting line, just as if you had written the
+ \meta{node specification} directly after the |to| keyword:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) to [edge node={node [sloped,above] {x}}] (3,2);
@@ -942,102 +946,120 @@ trigger a special path to be used instead of the straight line.
edge node={node [sloped,above] {x}}] (3,2);
\end{tikzpicture}
\end{codeexample}
- This key is mostly useful to create labels automatically using
- other keys.
- \end{key}
- \begin{key}{/tikz/edge label=\meta{text}}
- A shorthand for |edge node={node[auto]{|\meta{text}|}}|.
+ %
+ This key is mostly useful to create labels automatically using other
+ keys.
+ \end{key}
+ %
+ \begin{key}{/tikz/edge label=\meta{text}}
+ A shorthand for |edge node={node[auto]{|\meta{text}|}}|.
+ %
\begin{codeexample}[]
\tikz \draw (0,0) to [edge label=x] (3,2);
\end{codeexample}
- \end{key}
- \begin{key}{/tikz/edge label'=\meta{text}}
- A shorthand for |edge node={node[auto,swap]{|\meta{text}|}}|.
+ \end{key}
+ %
+ \begin{key}{/tikz/edge label'=\meta{text}}
+ A shorthand for |edge node={node[auto,swap]{|\meta{text}|}}|.
+ %
\begin{codeexample}[]
\tikz \draw (0,0) to [edge label=x, edge label'=y] (3,2);
\end{codeexample}
- \end{key}
-
- When the |quotes| library is loaded, additional ways of specifying
- nodes on to--paths become available, see Section~\ref{section-edge-quotes}.
-
- \medskip
- \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.
+ \end{key}
+
+ When the |quotes| library is loaded, additional ways of specifying nodes on
+ to--paths become available, see Section~\ref{section-edge-quotes}.
+
+ \medskip
+ \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.
+ %
\begin{codeexample}[]
\tikz[every to/.style={bend left}]
\draw (0,0) to (3,2);
\end{codeexample}
- Note that, as explained below, every to path is implicitly
- surrounded by curly braces. This means that options like |draw|
- given in an |every to| do not actually influence the path. You can
- fix this by using the |append after command| option:
+ %
+ Note that, as explained below, every to path is implicitly surrounded
+ by curly braces. This means that options like |draw| given in an
+ |every to| do not actually influence the path. You can fix this by
+ using the |append after command| option:
+ %
\begin{codeexample}[]
\tikz[every to/.style={append after command={[draw,dashed]}}]
\draw (0,0) to (3,2);
\end{codeexample}
- \end{stylekey}
-
- \medskip
- \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
- straight line to, say, a curve.
-
- The path used is set using the following option:
- \begin{key}{/tikz/to path=\meta{path}}
- Whenever an |to| operation is used, the \meta{path} is
- inserted. More precisely, the following path is added:
-
- \begin{quote}
- |{[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|.
-
- Inside the \meta{path}, different macros are used to reference the
- from- and to-coordinates. In detail, these are:
- \begin{itemize}
- \item \declareandlabel{\tikztostart} will expand to the from-coordinate
- (without the parentheses).
- \item \declareandlabel{\tikztotarget} will expand to the to-coordinate.
- \item \declareandlabel{\tikztonodes} will expand to the nodes between
- the |to| operation and the coordinate. Furthermore, these
- nodes will have the |pos| option set implicitly.
- \end{itemize}
-
- Let us have a look at a simple example. The standard straight line
- for a |to| is achieved by the following \meta{path}:
- \begin{quote}
- |-- (\tikztotarget) \tikztonodes|
- \end{quote}
-
- Indeed, this is the default setting for the path. When we write
- |(a) to (b)|, the \meta{path} will expand to |(a) -- (b)|, when
- we write
- \begin{quote}
- |(a) to[red] node {x} (b)|
- \end{quote}
- the \meta{path} will expand to
- \begin{quote}
- |(a) -- (b) node[red] {x}|
- \end{quote}
-
- It is not possible to specify the path
- \begin{quote}
- |-- \tikztonodes (\tikztotarget)|
- \end{quote}
- since \tikzname\ does not allow one to have a macro after |--|
- that expands to a node.
-
- Now let us have a look at how we can modify the \meta{path}
- sensibly. The simplest way is to use a curve.
+ \end{stylekey}
+ \medskip
+ \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 straight line to,
+ say, a curve.
+
+ The path used is set using the following option:
+ %
+ \begin{key}{/tikz/to path=\meta{path}}
+ Whenever a |to| operation is used, the \meta{path} is inserted. More
+ precisely, the following path is added:
+ %
+ \begin{quote}
+ |{[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|.
+
+ Inside the \meta{path}, different macros are used to reference the
+ from- and to-coordinates. In detail, these are:
+ %
+ \begin{itemize}
+ \item \declareandlabel{\tikztostart} will expand to the
+ from-coordinate (without the parentheses).
+ \item \declareandlabel{\tikztotarget} will expand to the
+ to-coordinate.
+ \item \declareandlabel{\tikztonodes} will expand to the nodes
+ between the |to| operation and the coordinate. Furthermore,
+ these nodes will have the |pos| option set implicitly.
+ \end{itemize}
+
+ Let us have a look at a simple example. The standard straight line for
+ a |to| is achieved by the following \meta{path}:
+ %
+ \begin{quote}
+ |-- (\tikztotarget) \tikztonodes|
+ \end{quote}
+
+ Indeed, this is the default setting for the path. When we write
+ |(a) to (b)|, the \meta{path} will expand to |(a) -- (b)|, when we
+ write
+ %
+ \begin{quote}
+ |(a) to[red] node {x} (b)|
+ \end{quote}
+ %
+ the \meta{path} will expand to
+ %
+ \begin{quote}
+ |(a) -- (b) node[red] {x}|
+ \end{quote}
+
+ It is not possible to specify the path
+ %
+ \begin{quote}
+ |-- \tikztonodes (\tikztotarget)|
+ \end{quote}
+ %
+ since \tikzname\ does not allow one to have a macro after |--| that
+ expands to a node.
+
+ 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}]
@@ -1051,8 +1073,8 @@ trigger a special path to be used instead of the straight line.
\end{tikzpicture}
\end{codeexample}
- Here is another example:
-
+ Here is another example:
+ %
\begin{codeexample}[]
\tikzset{
my loop/.style={to path={
@@ -1068,100 +1090,100 @@ trigger a special path to be used instead of the straight line.
\end{tikzpicture}
\end{codeexample}
- \begin{key}{/tikz/execute at begin to=\meta{code}}
- The \meta{code} is executed prior to the |to|. This can be used to
- draw one or more additional paths or to do additional
- computations.
- \end{key}
-
- \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}
+ \begin{key}{/tikz/execute at begin to=\meta{code}}
+ The \meta{code} is executed prior to the |to|. This can be used to
+ draw one or more additional paths or to do additional computations.
+ \end{key}
+ \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}
- \begin{stylekey}{/tikz/every to (initially \normalfont empty)}
- This style is installed at the beginning of every to.
- \end{stylekey}
- \end{key}
+ \begin{stylekey}{/tikz/every to (initially \normalfont empty)}
+ This style is installed at the beginning of every to.
+ \end{stylekey}
+ \end{key}
\end{pathoperation}
-There are a number of predefined |to path|s, see
-Section~\ref{library-to-paths} for a reference.
+There are a number of predefined |to path|s, see Section~\ref{library-to-paths}
+for a reference.
\subsection{The Foreach Operation}
\begin{pathoperation}{foreach}{\meta{variables}\opt{\oarg{options}} |in|
- \marg{path commands}}
- The |foreach| operation can be used to repeatedly insert the
- \meta{path commands} into the current path. Naturally, the
- \meta{path commands} should internally reference some of the
- \meta{variables} so that you do not insert exactly the same path
- repeatedly, but rather variations. For historical reasons, you can
- also write |\foreach| instead of |foreach|.
+ \marg{path commands}}
+ The |foreach| operation can be used to repeatedly insert the \meta{path
+ commands} into the current path. Naturally, the \meta{path commands} should
+ internally reference some of the \meta{variables} so that you do not insert
+ exactly the same path repeatedly, but rather variations. For historical
+ reasons, you can also write |\foreach| instead of |foreach|.
+ %
\begin{codeexample}[]
\tikz \draw (0,0) foreach \x in {1,...,3} { -- (\x,1) -- (\x,0) };
\end{codeexample}
- See Section~\ref{section-foreach} for more details on the
- for-each-command.
+ %
+ See Section~\ref{section-foreach} for more details on the for-each-command.
\end{pathoperation}
+
\subsection{The Let Operation}
-The \emph{let operation} is the first of a number of path operations
-that do not actually extend that path, but have different, mostly
-local, effects.
+The \emph{let operation} is the first of a number of path operations that do
+not actually extend that path, but have different, mostly 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
- 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
- contents of these registers using the macros |\p|, |\x|, |\y|, and
- |\n|.
-
- The first kind of permissible \meta{assignment}s have the following
- form:
- \begin{quote}
- |\n|\meta{number register}|={|\meta{formula}|}|
- \end{quote}
- When an assignment has this form, the \meta{formula} is evaluated
- using the |\pgfmathparse| operation. The result is stored in the
- \meta{number register}. If the \meta{formula} involves a dimension
- anywhere (as in |2*3cm/2|), then the \meta{number register} stores
- 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|.
-
- Let us call the path that follows a let operation its
- \emph{body}. Inside the body, the |\n| macro can be used to access
- the register.
- \begin{command}{\n\marg{number register}}
- When this macro is used on the left-hand side of an |=|-sign in a
- let operation, it has no effect and is just there for
- readability. When the macro is used on the right-hand side of an
- |=|-sign or in the body of the let operation, then it expands to
- the value stored in the \meta{number register}. This will either
- be a dimensionless number like |2.0| or a dimension like |5.6pt|.
-
- For instance, if we say |let \n1={1pt+2pt}, \n2={1+2} in ...|, then
- inside the |...| part the macro |\n1| will expand to |3pt| and
- |\n2| expands to |3|.
- \end{command}
-
- The second kind of \meta{assignments} have the following form:
- \begin{quote}
- |\p|\meta{point register}|={|\meta{formula}|}|
- \end{quote}
- Point position registers store a single point, consisting
- of an $x$-part and a $y$-part measured in \TeX\ points (|pt|). In
- particular, point registers do not store nodes or node names.
- Here is an example:
+ \opt{|,|\meta{assignment}}%
+ \opt{|,|\meta{assignment}\dots}\declare{| in |}}
+ 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
+ contents of these registers using the macros |\p|, |\x|, |\y|, and
+ |\n|.
+
+ The first kind of permissible \meta{assignment}s have the following form:
+ %
+ \begin{quote}
+ |\n|\meta{number register}|={|\meta{formula}|}|
+ \end{quote}
+ %
+ When an assignment has this form, the \meta{formula} is evaluated using the
+ |\pgfmathparse| operation. The result is stored in the \meta{number
+ register}. If the \meta{formula} involves a dimension anywhere (as in
+ |2*3cm/2|), then the \meta{number register} stores 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|.
+
+ Let us call the path that follows a let operation its \emph{body}. Inside
+ the body, the |\n| macro can be used to access the register.
+ %
+ \begin{command}{\n\marg{number register}}
+ When this macro is used on the left-hand side of an |=|-sign in a let
+ operation, it has no effect and is just there for readability. When the
+ macro is used on the right-hand side of an |=|-sign or in the body of
+ the let operation, then it expands to the value stored in the
+ \meta{number register}. This will either be a dimensionless number like
+ |2.0| or a dimension like |5.6pt|.
+
+ For instance, if we say |let \n1={1pt+2pt}, \n2={1+2} in ...|, then
+ inside the |...| part the macro |\n1| will expand to |3pt| and |\n2|
+ expands to |3|.
+ \end{command}
+
+ The second kind of \meta{assignments} have the following form:
+ %
+ \begin{quote}
+ |\p|\meta{point register}|={|\meta{formula}|}|
+ \end{quote}
+ %
+ Point position registers store a single point, consisting of an $x$-part
+ and a $y$-part measured in \TeX\ points (|pt|). In particular, point
+ registers do not store nodes or node names. Here is an example:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -1171,37 +1193,37 @@ local, effects.
\end{tikzpicture}
\end{codeexample}
- \begin{command}{\p\marg{point register}}
- When this macro is used on the left-hand side of an |=|-sign in a
- let operation, it has no effect and is just there for
- readability. When the macro is used on the right-hand side of an
- |=|-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.
-
- For instance, if we say |let \p1=(1pt,1pt+2pt) in ...|, then
- inside the |...| part the macro |\p1| will expand to exactly the
- seven characters ``1pt,3pt''. This means that you when you write
- |(\p1)|, this expands to |(1pt,3pt)|, which is presumably exactly
- what you intended.
- \end{command}
- \begin{command}{\x\marg{point register}}
- This macro expands just to the $x$-part of the point
- register. If we say as above, as we did above,
- |let \p1=(1pt,1pt+2pt) in ...|, then
- inside the |...| part the macro |\x1| expands to |1pt|.
- \end{command}
- \begin{command}{\y\marg{point register}}
- Works like |\x|, only for the $y$-part.
- \end{command}
- Note that the above macros are available only inside a let
- 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
- second point. Naturally, using the \verb!|-! notation, this could be
- written much more compactly.
+ \begin{command}{\p\marg{point register}}
+ When this macro is used on the left-hand side of an |=|-sign in a let
+ operation, it has no effect and is just there for readability. When the
+ macro is used on the right-hand side of an |=|-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.
+
+ For instance, if we say |let \p1=(1pt,1pt+2pt) in ...|, then inside the
+ |...| part the macro |\p1| will expand to exactly the seven characters
+ ``1pt,3pt''. This means that you when you write |(\p1)|, this expands
+ to |(1pt,3pt)|, which is presumably exactly what you intended.
+ \end{command}
+ %
+ \begin{command}{\x\marg{point register}}
+ This macro expands just to the $x$-part of the point register. If we
+ say as above, as we did above, |let \p1=(1pt,1pt+2pt) in ...|, then
+ inside the |...| part the macro |\x1| expands to |1pt|.
+ \end{command}
+ %
+ \begin{command}{\y\marg{point register}}
+ Works like |\x|, only for the $y$-part.
+ \end{command}
+ %
+ Note that the above macros are available only inside a let 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 second
+ point. Naturally, using the \verb!|-! notation, this could be written much
+ more compactly.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -1215,9 +1237,10 @@ local, effects.
\end{tikzpicture}
\end{codeexample}
- Note that the effect of a let operation is local to the body of the
- let operation. If you wish to access a computed coordinate outside
- the body, you must use a |coordinate| path operation:
+ Note that the effect of a let operation is local to the body of the let
+ operation. If you wish to access a computed coordinate outside the body,
+ you must use a |coordinate| path operation:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
@@ -1237,8 +1260,9 @@ local, effects.
\end{tikzpicture}
\end{codeexample}
- For a more useful application of the let operation, let us draw a
- circle that touches a given line:
+ For a more useful application of the let operation, let us draw a circle
+ that touches a given line:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,3);
@@ -1254,71 +1278,87 @@ local, effects.
in circle [at=(c), radius=\n1];
\end{tikzpicture}
\end{codeexample}
+ %
\end{pathoperation}
\subsection{The Scoping Operation}
-When \tikzname\ encounters and opening or a closing brace (|{| or~|}|) at
-some point where a path operation should come, it will open or close a
-scope. All options that can be applied ``locally'' will be scoped
-inside the scope. For example, if you apply a transformation like
-|[xshift=1cm]| inside the scoped area, the shifting only applies to
-the scope. On the other hand, an option like |color=red| does not have
-any effect inside a scope since it can only be applied to the path as
-a whole.
+When \tikzname\ encounters and opening or a closing brace (|{| or~|}|) at some
+point where a path operation should come, it will open or close a scope. All
+options that can be applied ``locally'' will be scoped inside the scope. For
+example, if you apply a transformation like |[xshift=1cm]| inside the scoped
+area, the shifting only applies to the scope. On the other hand, an option like
+|color=red| does not have any effect inside a scope since it can only be
+applied to the path as a whole.
-Concerning the effect of scopes on relative coordinates,
-please see Section~\ref{section-scopes-relative}.
+Concerning the effect of scopes on relative coordinates, please see
+Section~\ref{section-scopes-relative}.
\subsection{The Node and Edge Operations}
-The |node| operation adds 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
-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
-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.
+The |node| operation adds 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 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 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}.
+Since these operations are quite complex, they are described in the separate
+Section~\ref{section-nodes}.
\subsection{The Graph Operation}
-The |graph| operation can be used to specify easily how a large number
-of nodes are connected. This operation is documented in a separate
-section, see Section~\ref{section-library-graphs}.
+The |graph| operation can be used to specify easily how a large number of nodes
+are connected. This operation is documented in a separate section, see
+Section~\ref{section-library-graphs}.
\subsection{The Pic Operation}
-The |pic| operation is used to insert a ``short picture'' (hence the
-``short'' name) at the current position of the path. This operation is
-somewhat similar to the |node| operation and discussed in detail in
-Section~\ref{section-pics}.
+The |pic| operation is used to insert a ``short picture'' (hence the ``short''
+name) at the current position of the path. This operation is somewhat similar
+to the |node| operation and discussed in detail in Section~\ref{section-pics}.
+
+
+\subsection{The Attribute Animation Operation}
+
+\begin{pathoperation}{:}{\meta{animation attribute}|=|\marg{options}}
+ This path operation has the same effect as if you had said:
+ %
+ \begin{quote}
+ |[animate = { myself:|\meta{animate attribute}|=|\marg{options}|} ]|
+ \end{quote}
+ %
+ This causes an animation of \meta{animate attribute} to be added to the
+ current path, see Section~\ref{section-tikz-animations} for details.
+ %
+\begin{codeexample}[width=2cm]
+\tikz \draw :xshift = {0s = "0cm", 30s = "-3cm", repeats} (0,0) circle (5mm);
+\end{codeexample}
+ %
+\end{pathoperation}
\subsection{The PGF-Extra Operation}
-In some cases you may need to ``do some calculations or some other
-stuff'' while a path is constructed. For this, you would like to
-suspend the construction of the path and suspend \tikzname's parsing
-of the path, you would then like to have some \TeX\ code executed, and
-would then like to resume the parsing of the path. This effect can be
-achieved using the following path operation |\pgfextra|. Note that
-this operation should only be used by real experts and should only be
-used deep inside clever macros, not on normal paths.
+In some cases you may need to ``do some calculations or some other stuff''
+while a path is constructed. For this, you would like to suspend the
+construction of the path and suspend \tikzname's parsing of the path, you would
+then like to have some \TeX\ code executed, and would then like to resume the
+parsing of the path. This effect can be achieved using the following path
+operation |\pgfextra|. Note that this operation should only be used by real
+experts and should only be used deep inside clever macros, not on normal paths.
\begin{command}{\pgfextra\marg{code}}
- This command may only be used inside a \tikzname\ path. There it is
- used like a normal path operation. The construction of the path is
- temporarily suspended and the \meta{code} is executed. Then, the
- path construction is resumed.
-
+ This command may only be used inside a \tikzname\ path. There it is used
+ like a normal path operation. The construction of the path is temporarily
+ suspended and the \meta{code} is executed. Then, the path construction is
+ resumed.
+ %
\begin{codeexample}[]
\newdimen\mydim
\begin{tikzpicture}
@@ -1326,16 +1366,17 @@ used deep inside clever macros, not on normal paths.
\draw (0pt,\mydim) \pgfextra{\mydim=2cm} -- (0pt,\mydim);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
\begin{command}{\pgfextra \meta{code} \texttt{\char`\\endpgfextra}}
- This is an alternative syntax for the |\pgfextra| command. If the
- code following |\pgfextra| does not start with a brace, the
- \meta{code} is executed until |\endpgfextra| is encountered. What
- actually happens is that when |\pgfextra| is not followed by a
- brace, this completely shuts down the \tikzname\ parser and
- |\endpgfextra| is a normal macro that restarts the parser.
-
+ This is an alternative syntax for the |\pgfextra| command. If the code
+ following |\pgfextra| does not start with a brace, the \meta{code} is
+ executed until |\endpgfextra| is encountered. What actually happens is that
+ when |\pgfextra| is not followed by a brace, this completely shuts down the
+ \tikzname\ parser and |\endpgfextra| is a normal macro that restarts the
+ parser.
+ %
\begin{codeexample}[]
\newdimen\mydim
\begin{tikzpicture}
@@ -1344,4 +1385,5 @@ used deep inside clever macros, not on normal paths.
\pgfextra \mydim=2cm \endpgfextra -- (0pt,\mydim);
\end{tikzpicture}
\end{codeexample}
+ %
\end{command}
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-pics.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-pics.tex
index b4ba727c1d0..c18b7a61766 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-pics.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-tikz-pics.tex
@@ -7,28 +7,27 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\section{Pics: Small Pictures on Paths}
+\section{Pics: Small Pictures on Paths}
\label{section-pics}
\subsection{Overview}
-A ``pic'' is a ``short picture'' (hence the short name\dots) that can
-be inserted anywhere in \tikzname\ picture where you could also insert
-a node. Similarly to nodes, pics have a ``shape'' (called \emph{type}
-to avoid confusion) that someone has defined. Each time a pic of a
-specified type is used, the type's code is executed, resulting in some
-drawings to be added to the current picture. The syntax for adding
-nodes and adding pics to a picture are also very similar. The core
-difference is that pics are typically more complex than nodes and may
-consist of a whole bunch of nodes themselves together with complex
-paths joining them.
-
-As a very simple example, suppose we want to define a pic type
-|seagull| that just draw ``two bumps.'' The code for this definition
-is quite easy:
+A ``pic'' is a ``short picture'' (hence the short name\dots) that can be
+inserted anywhere in \tikzname\ picture where you could also insert a node.
+Similarly to nodes, pics have a ``shape'' (called \emph{type} to avoid
+confusion) that someone has defined. Each time a pic of a specified type is
+used, the type's code is executed, resulting in some drawings to be added to
+the current picture. The syntax for adding nodes and adding pics to a picture
+are also very similar. The core difference is that pics are typically more
+complex than nodes and may consist of a whole bunch of nodes themselves
+together with complex paths joining them.
+
+As a very simple example, suppose we want to define a pic type |seagull| that
+just draw ``two bumps''. The code for this definition is quite easy:
+%
\begin{codeexample}[code only]
-\tikzset{
+\tikzset{
seagull/.pic={
% Code for a "seagull". Do you see it?...
\draw (-3mm,0) to [bend left] (0,0) to [bend left] (3mm,0);
@@ -36,13 +35,12 @@ is quite easy:
}
\end{codeexample}
-The first line just tells \TeX\ that you set some \tikzname\ options
-for the current scope (which is the whole document); you could put
-|seagull/.pic=...| anywhere else where \tikzname\ options are allowed
-(which is just about anywhere). We have now defined a |seagull| pic
-type and can use it as follows:
-
-\tikzset{
+The first line just tells \TeX\ that you set some \tikzname\ options for the
+current scope (which is the whole document); you could put |seagull/.pic=...|
+anywhere else where \tikzname\ options are allowed (which is just about
+anywhere). We have now defined a |seagull| pic type and can use it as follows:
+%
+\tikzset{
seagull/.pic={
% Code for a "seagull". Do you see it?...
\draw (-3mm,0) to [bend left] (0,0) to [bend left] (3mm,0);
@@ -57,91 +55,94 @@ type and can use it as follows:
-- (2,1) pic [red] {seagull};
\end{codeexample}
-As can be see, defining new types of pics is much easier than defining
-new shapes for nodes; but see Section~\ref{section-new-pic-types}
-for the fine details.
-
-Since defining new pics types is easier than defining new node shapes
-and since using pics is as easy as using nodes, why should you use
-nodes at all? There are chiefly two reasons:
+As can be see, defining new types of pics is much easier than defining new
+shapes for nodes; but see Section~\ref{section-new-pic-types} for the fine
+details.
+Since defining new pics types is easier than defining new node shapes and since
+using pics is as easy as using nodes, why should you use nodes at all? There
+are chiefly two reasons:
+%
\begin{enumerate}
-\item Unlike nodes, pics cannot be referenced later on. You \emph{can}
- reference nodes that are inside a pic, but not ``the pic itself.''
- In particular, you cannot draw lines between pics the way you
- can draw them between nodes. In general, whenever it makes sense
- that some drawing could conceivably be connected to other
- node-like-things, then a node is better than a pic.
-\item If pics are used to emulate the full power of a node (which is
- possible, in principle), they will be slower to construct and take
- up more memory than a node achieving the same effect.
+ \item Unlike nodes, pics cannot be referenced later on. You \emph{can}
+ reference nodes that are inside a pic, but not ``the pic itself''. In
+ particular, you cannot draw lines between pics the way you can draw
+ them between nodes. In general, whenever it makes sense that some
+ drawing could conceivably be connected to other node-like-things, then
+ a node is better than a pic.
+ \item If pics are used to emulate the full power of a node (which is
+ possible, in principle), they will be slower to construct and take up
+ more memory than a node achieving the same effect.
\end{enumerate}
-Despite these drawbacks, pics are an excellent choice for creating
-highly configurable reusable pieces of drawings that can be inserted
-into larger contexts.
+Despite these drawbacks, pics are an excellent choice for creating highly
+configurable reusable pieces of drawings that can be inserted into larger
+contexts.
\subsection{The Pic Syntax}
\begin{command}{\pic}
- Inside |{tikzpicture}| this is an abbreviation for |\path pic|.
+ Inside |{tikzpicture}| this is an abbreviation for |\path pic|.
\end{command}
-The syntax for adding a pic to a picture is very similar to the syntax
-used for nodes (indeed, internally the same parser code is used). The
-main difference is that instead of a node contents you provide the
-picture's type between the braces:
-
-\begin{pathoperation}{pic}{\opt{\meta{foreach statements}}%
- \opt{|[|\meta{options}|]|}\opt{|(|\meta{prefix}|)|}%
- \opt{|at(|\meta{coordinate}|)|}\opt{\marg{pic type}}}
-
- Adds a pic to the current \tikzname\ picture of the specified
- \meta{pic type}. The effect is, basically, that some code associated
- with the \meta{pic type} is executed (how this works, exactly, is explained
- later). This code can consist of arbitrary \tikzname\ code. As for
- nodes, the current path will not be modified by this path command,
- all drawings produced by the code are ``external'' to the path the
- same way neither a node nor its border are part of the path on which
- they are specified.
-
- Just like the |node| command, this path operation is somewhat
- complex and we go over it step by step.
-
- \medskip
- \textbf{Order of the parts of the specification.}
- Just like for nodes, everything between ``|pic|'' and the opening
- brace of the \meta{pic type} is optional and can be given in any
- order. If there are \meta{foreach statements}, they must come
- first, directly following ``|pic|.'' As for nodes, the ``end'' of
- the pic specification is normally detected by the presence of the
- opening brace. You can, however, use the |pic type|
- option to specify the pic type as an option.
-
- \begin{key}{/tikz/pic type=\meta{pic type}}
- This key sets the pic type of the current~|pic|. When this option
- is used inside an option block of a |pic|, the parsing of the
- |pic| ends immediately and no pic type in braces is expected. (In
- other words, this option behaves exactly like the |node contents|
- option and, indeed, the two are interchangeable.)
+The syntax for adding a pic to a picture is very similar to the syntax used for
+nodes (indeed, internally the same parser code is used). The main difference is
+that instead of a node contents you provide the picture's type between the
+braces:
+
+\begin{pathoperation}{pic}{
+ \opt{\meta{foreach statements}}
+ \opt{|[|\meta{options}|]|}
+ \opt{|(|\meta{prefix}|)|}
+ \opt{|at(|\meta{coordinate}|)|}
+ \opt{|:|\meta{animation attribute}|=|\marg{options}}
+ \opt{\marg{pic type}}%
+}
+ Adds a pic to the current \tikzname\ picture of the specified \meta{pic
+ type}. The effect is, basically, that some code associated with the
+ \meta{pic type} is executed (how this works, exactly, is explained later).
+ This code can consist of arbitrary \tikzname\ code. As for nodes, the
+ current path will not be modified by this path command, all drawings
+ produced by the code are ``external'' to the path the same way neither a
+ node nor its border are part of the path on which they are specified.
+
+ Just like the |node| command, this path operation is somewhat complex and
+ we go over it step by step.
+
+ \medskip
+ \textbf{Order of the parts of the specification.}
+ Just like for nodes, everything between ``|pic|'' and the opening brace of
+ the \meta{pic type} is optional and can be given in any order. If there are
+ \meta{foreach statements}, they must come first, directly following
+ ``|pic|''. As for nodes, the ``end'' of the pic specification is normally
+ detected by the presence of the opening brace. You can, however, use the
+ |pic type| option to specify the pic type as an option.
+
+ \begin{key}{/tikz/pic type=\meta{pic type}}
+ This key sets the pic type of the current~|pic|. When this option is
+ used inside an option block of a |pic|, the parsing of the |pic| ends
+ immediately and no pic type in braces is expected. (In other words,
+ this option behaves exactly like the |node contents| option and,
+ indeed, the two are interchangeable.)
+ %
\begin{codeexample}[]
\tikz {
\path (0,0) pic [pic type = seagull]
(1,0) pic {seagull};
}
\end{codeexample}
- \end{key}
-
- \medskip
- \textbf{The location of a pic.}
- Just like nodes, pics are placed at the last position mentioned on
- the path or, when |at| is used, at a specified position. ``Placing''
- a pic somewhere actually means that the coordinate system is
- translated (shifted) to this last position. This means that inside
- of the pic type's code any mentioning of the origin refers to the
- last position used on the path or to the specified |at|.
-
+ \end{key}
+
+ \medskip
+ \textbf{The location of a pic.}
+ Just like nodes, pics are placed at the last position mentioned on the path
+ or, when |at| is used, at a specified position. ``Placing'' a pic somewhere
+ actually means that the coordinate system is translated (shifted) to this
+ last position. This means that inside of the pic type's code any mentioning
+ of the origin refers to the last position used on the path or to the
+ specified |at|.
+ %
\begin{codeexample}[]
\tikz { % different ways of placing pics
\draw [help lines] (0,0) grid (3,2);
@@ -151,88 +152,88 @@ picture's type between the braces:
}
\end{codeexample}
- As for nodes, except for the described shifting, the coordinate
- system of a pic is reset prior to executing the pic type's
- code. This can be changed using the |transform shape| option, which
- has the same effect as for nodes: The ``outer'' transformation gets
- applied to the node:
+ As for nodes, except for the described shifting, the coordinate system of a
+ pic is reset prior to executing the pic type's code. This can be changed
+ using the |transform shape| option, which has the same effect as for nodes:
+ The ``outer'' transformation gets applied to the node:
+ %
\begin{codeexample}[]
-\tikz [scale=2] {
+\tikz [scale=2] {
\pic at (0,0) {seagull};
\pic at (1,0) [transform shape] {seagull};
}
\end{codeexample}
- When the \meta{options} contain transformation commands like |scale|
- or |rotate|, these transformations always apply to the pic:
+ When the \meta{options} contain transformation commands like |scale| or
+ |rotate|, these transformations always apply to the pic:
+ %
\begin{codeexample}[]
-\tikz [rotate=30] {
+\tikz [rotate=30] {
\pic at (0,0) {seagull};
\pic at (1,0) [rotate=90] {seagull};
}
\end{codeexample}
- Just like nodes, pics can also be positioned implicitly and,
- somewhat unsurprisingly, the same rules concerning positioning and
- sloping apply:
+ Just like nodes, pics can also be positioned implicitly and, somewhat
+ unsurprisingly, the same rules concerning positioning and sloping apply:
+ %
\begin{codeexample}[]
\tikz \draw
- (0,0) to [bend left]
- pic [near start] {seagull}
+ (0,0) to [bend left]
+ pic [near start] {seagull}
pic {seagull}
pic [sloped, near end] {seagull} (4,0);
\end{codeexample}
-
- \medskip
- \textbf{The options of a node.}
- As always, any given \meta{options} apply only to the pic and have
- no effect outside. As for nodes, most ``outside'' options also apply
- to the pics, but not the ``action'' options like |draw| or
- |fill|. These must be given in the \meta{options} of the pic.
-
- \medskip
- \textbf{The code of a pic.}
- As stated earlier, the main job of a pic is to execute some code in
- a scope that is shifted according to the last point on the path or
- to the |at| position specified in the pic. It was also claimed that
- this code is specified by the \meta{pic type}. However, this
- specification is somewhat indirect. What really happens is the
- following: When a |pic| is encountered, the current path is
- suspended and a new internal scope is started. The \meta{options}
- are executed and also the \meta{pic type} (as explained
- in a moment). After all this is done, the code stored in the following key
- gets executed:
-
- \begin{key}{/tikz/pics/code=\meta{code}}
- This key stores the \meta{code} that should be drawn in the
- current pic. Normally, setting this key is done by the \meta{pic
- type}, but you can also set it in the \meta{options} and leave
- the \meta{pic type} empty:
+
+ \medskip
+ \textbf{The options of a node.}
+ As always, any given \meta{options} apply only to the pic and have no
+ effect outside. As for nodes, most ``outside'' options also apply to the
+ pics, but not the ``action'' options like |draw| or |fill|. These must be
+ given in the \meta{options} of the pic.
+
+ \medskip
+ \textbf{The code of a pic.}
+ As stated earlier, the main job of a pic is to execute some code in a scope
+ that is shifted according to the last point on the path or to the |at|
+ position specified in the pic. It was also claimed that this code is
+ specified by the \meta{pic type}. However, this specification is somewhat
+ indirect. What really happens is the following: When a |pic| is
+ encountered, the current path is suspended and a new internal scope is
+ started. The \meta{options} are executed and also the \meta{pic type} (as
+ explained in a moment). After all this is done, the code stored in the
+ following key gets executed:
+
+ \begin{key}{/tikz/pics/code=\meta{code}}
+ This key stores the \meta{code} that should be drawn in the current
+ pic. Normally, setting this key is done by the \meta{pic type}, but you
+ can also set it in the \meta{options} and leave the \meta{pic type}
+ empty:
+ %
\begin{codeexample}[]
\tikz \pic [pics/code={\draw (-3mm,0) to[bend left] (0,0)
to[bend left] (3mm,0);}]
{}; % no pic type specified
\end{codeexample}
- \end{key}
-
- Now, how does the \meta{pic type} set |pics/code|? It turns out that
- the \meta{pic type} is actually just a list of keys that are
- executed with the prefix |/tikz/pics/|. In the above examples, this
- ``list of keys'' just consisted of the single key ``|seagull|'' that
- did not take any arguments, but, in principle, you could provide any
- arbitrary text understood by |\pgfkeys| here. This means that when
- we write |pic{seagull}|, \tikzname\ will execute the key
- |/tikz/pics/seagull|. It turns out, see
- Section~\ref{section-new-pic-types}, that this key is just a style
- set to |code={\draw(-3mm,0)...;}|. Thus, |pic{seagull}| will cause
- the |pics/code| key to be set to the text needed to draw the
- seagull.
-
- Indeed, you can also use the \meta{pic type} simply to set the
- |code| of the pic. This is useful for cases when you have some code
- that you ``just want to execute, but do not want to define a new pic
- type.'' Here is a typical example where we use pics to add some
- markings to a path:
+ \end{key}
+
+ Now, how does the \meta{pic type} set |pics/code|? It turns out that the
+ \meta{pic type} is actually just a list of keys that are executed with the
+ prefix |/tikz/pics/|. In the above examples, this ``list of keys'' just
+ consisted of the single key ``|seagull|'' that did not take any arguments,
+ but, in principle, you could provide any arbitrary text understood by
+ |\pgfkeys| here. This means that when we write |pic{seagull}|, \tikzname\
+ will execute the key |/tikz/pics/seagull|. It turns out, see
+ Section~\ref{section-new-pic-types}, that this key is just a style set to
+ |code={\draw(-3mm,0)...;}|. Thus, |pic{seagull}| will cause the |pics/code|
+ key to be set to the text needed to draw the
+ seagull.
+
+ Indeed, you can also use the \meta{pic type} simply to set the |code| of
+ the pic. This is useful for cases when you have some code that you ``just
+ want to execute, but do not want to define a new pic type''. Here is a
+ typical example where we use pics to add some markings to a path:
+ %
\begin{codeexample}[]
\tikz \draw (0,0) .. controls(1,0) and (2,1) .. (3,1)
foreach \t in {0, 0.1, ..., 1} {
@@ -240,21 +241,22 @@ picture's type between the braces:
};
\end{codeexample}
-
- In our seagull example, we always explicitly used |\draw| to draw
- the seagull. This implies that when a user writes something
- |pic[fill]{seagull}| in the hope of having a ``filled'' seagull,
- nothing special will happen: The |\draw| inside the pic explicitly
- states that the path should be drawn, not filled, and the fact that
- in the surrounding scope the |fill| option is set has no effect.
- The following key can be used to change this:
- \begin{key}{/tikz/pic actions}
- This key is a style that can be used (only) inside the code of a
- pic. There, it will set the ``action'' keys set inside the
- \meta{options} of the pic (``actions'' are drawing, filling,
- shading, and clipping or any combination thereof).
-
- To see how this key works, let us define the following pic:
+ In our seagull example, we always explicitly used |\draw| to draw the
+ seagull. This implies that when a user writes something
+ |pic[fill]{seagull}| in the hope of having a ``filled'' seagull, nothing
+ special will happen: The |\draw| inside the pic explicitly states that the
+ path should be drawn, not filled, and the fact that in the surrounding
+ scope the |fill| option is set has no effect. The following key can be used
+ to change this:
+ %
+ \begin{key}{/tikz/pic actions}
+ This key is a style that can be used (only) inside the code of a pic.
+ There, it will set the ``action'' keys set inside the \meta{options} of
+ the pic (``actions'' are drawing, filling, shading, and clipping or any
+ combination thereof).
+
+ To see how this key works, let us define the following pic:
+ %
\begin{codeexample}[code only]
\tikzset{
my pic/.pic = {
@@ -263,9 +265,11 @@ picture's type between the braces:
}
}
\end{codeexample}
- In the code, whether or not the circle gets drawn/filled/shaded
- depends on which options where given to the |pic| command when it
- is used. In contrast, the rectangle will always (just) be drawn.
+ %
+ In the code, whether or not the circle gets drawn/filled/shaded
+ depends on which options where given to the |pic| command when it
+ is used. In contrast, the rectangle will always (just) be drawn.
+ %
\tikzset{
my pic/.pic = {
\path [pic actions] (0,0) circle[radius=3mm];
@@ -280,19 +284,19 @@ picture's type between the braces:
\tikz \pic [draw, shading=ball] {my pic}; \space
\tikz \pic [fill=red!50] {my pic};
\end{codeexample}
- \end{key}
-
- \medskip
- \textbf{Code executed behind or in front of the path.}
- As for nodes, a pic can be ``behind'' the current path or ``in front
- of it'' and, just as for nodes, the two options |behind path| and
- |in front of path| are used to specify which is meant. In detail, if
- |node| and |pic| are both used repeatedly on a path, in the
- resulting picture we first see all nodes and pics with the
- |behind path| option set in the order they appear on the path (nodes
- and pics are interchangeable in this regard), then comes the path,
- and then come all nodes and pics that are in front of the path in
- the order they appeared.
+ \end{key}
+
+ \medskip
+ \textbf{Code executed behind or in front of the path.}
+ As for nodes, a pic can be ``behind'' the current path or ``in front of
+ it'' and, just as for nodes, the two options |behind path| and
+ |in front of path| are used to specify which is meant. In detail, if |node|
+ and |pic| are both used repeatedly on a path, in the resulting picture we
+ first see all nodes and pics with the |behind path| option set in the order
+ they appear on the path (nodes and pics are interchangeable in this
+ regard), then comes the path, and then come all nodes and pics that are in
+ front of the path in the order they appeared.
+ %
\begin{codeexample}[]
\tikz \fill [fill=blue!20]
(1,1)
@@ -301,87 +305,91 @@ picture's type between the braces:
-- (3,1) pic [rotate=30] {seagull}
-- (2,1) pic [red, behind path] {seagull};
\end{codeexample}
- In contrast to nodes, a pic need not only be completely behind
- the path or in front of the path as specified by the user. Instead,
- a pic type may also specify that a certain part of the drawing
- should always be behind the path and it may specify that a certain
- other part should always be before the path. For this, the values of
- the following keys are relevant:
-
- \begin{key}{/tikz/pics/foreground code=\meta{code}}
- This key stores \meta{code} that will always be drawn in front of
- the current path, even when |behind path| is used. If
- |behind path| is not used and |code| is (also) set, the code of
- |code| is
- drawn first, following by the foreground \meta{code}.
- \end{key}
-
- \begin{key}{/tikz/pics/background code=\meta{code}}
- Like |foreground code|, only that the \meta{code} is always put
- behind the path, never in front of it.
- \end{key}
-
- \medskip
- \textbf{The foreach statement for pics.}
- As for nodes, a pic specification may start with |foreach|. The
- effect and semantics are the same as for nodes.
+ %
+ In contrast to nodes, a pic need not only be completely behind the path or
+ in front of the path as specified by the user. Instead, a pic type may also
+ specify that a certain part of the drawing should always be behind the path
+ and it may specify that a certain other part should always be before the
+ path. For this, the values of the following keys are relevant:
+
+ \begin{key}{/tikz/pics/foreground code=\meta{code}}
+ This key stores \meta{code} that will always be drawn in front of the
+ current path, even when |behind path| is used. If |behind path| is not
+ used and |code| is (also) set, the code of |code| is drawn first,
+ following by the foreground \meta{code}.
+ \end{key}
+
+ \begin{key}{/tikz/pics/background code=\meta{code}}
+ Like |foreground code|, only that the \meta{code} is always put behind
+ the path, except when the |behind path| option is applied to the pic,
+ then the background code is drawn in front of the ``behind path'' code.
+ \end{key}
+
+ \medskip
+ \textbf{The foreach statement for pics.}
+ As for nodes, a pic specification may start with |foreach|. The effect and
+ semantics are the same as for nodes.
+ %
\begin{codeexample}[]
\tikz \pic foreach \x in {1,2,3} at (\x,0) {seagull};
\end{codeexample}
- \medskip
- \textbf{Styles for pics.}
- The following styles influence how nodes are rendered:
- \begin{stylekey}{/tikz/every pic (initially \normalfont empty)}
- This style is installed at the beginning of every pic.
+ \medskip
+ \textbf{Styles for pics.}
+ The following styles influence how nodes are rendered:
+ %
+ \begin{stylekey}{/tikz/every pic (initially \normalfont empty)}
+ This style is installed at the beginning of every pic.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={draw}]
\draw (0,0) node {A} -- (1,1) node {B};
\end{tikzpicture}
\end{codeexample}
- \end{stylekey}
-
-
- \medskip
- \textbf{Name scopes.}
- You can specify a \meta{name} for a pic using the key
- |name=|\meta{name} or by giving the name in parenthesis inside the
- pic's specification. The effect of this is, for once, quite
- different from what happens for nodes: All that happens is that
- |name prefix| is set to \meta{name} at the beginning of the pic.
-
- The |name prefix| key was already introduced in the description of
- the |node| command: It allows you to set some text that is prefixed
- to all nodes in a scope. For pics this makes particular sense: All
- nodes defined by a pic's code can be referenced from outside the pic
- with the prefix provided.
-
- To see how this works, let us add some nodes to the code of the
- seagull:
+ \end{stylekey}
+
+ \medskip
+ \textbf{Name scopes.}
+ You can specify a \meta{name} for a pic using the key |name=|\meta{name} or
+ by giving the name in parenthesis inside the pic's specification. The
+ effect of this is, for once, quite different from what happens for nodes:
+ All that happens is that |name prefix| is set to \meta{name} at the
+ beginning of the pic.
+
+ The |name prefix| key was already introduced in the description of the
+ |node| command: It allows you to set some text that is prefixed to all
+ nodes in a scope. For pics this makes particular sense: All nodes defined
+ by a pic's code can be referenced from outside the pic with the prefix
+ provided.
+
+ To see how this works, let us add some nodes to the code of the seagull:
+ %
\begin{codeexample}[code only]
-\tikzset{
+\tikzset{
seagull/.pic={
% Code for a "seagull". Do you see it?...
\coordinate (-left wing) at (-3mm,0);
\coordinate (-head) at (0,0);
\coordinate (-right wing) at (3mm,0);
-
+
\draw (-left wing) to [bend left] (0,0) (-head) to [bend left] (-right wing);
}
}
\end{codeexample}
-\tikzset{
+ %
+\tikzset{
seagull/.pic={
% Code for a "seagull". Do you see it?...
\coordinate (-left wing) at (-3mm,0);
\coordinate (-head) at (0,0);
\coordinate (-right wing) at (3mm,0);
-
+
\draw (-left wing) to [bend left] (0,0) (-head) to [bend left] (-right wing);
}
}
- Now, we can use it as follows:
+ Now, we can use it as follows:
+ %
\begin{codeexample}[code only]
\tikz {
\pic (Emma) {seagull};
@@ -391,63 +399,90 @@ picture's type between the braces:
}
\end{codeexample}
- Sometimes, you may also wish your pic to access nodes outside the
- pic (typically, because they are given as parameters). In this case,
- the name prefix gets in the way since the nodes outside the picture
- do not have this prefix. The trick is to locally reset the name
- prefix to the value it had outside the picture, which is achieved
- using the following style:
-
- \begin{key}{/tikz/name prefix ..}
- This key is available only inside the code of a pic. There, it
- (locally) changes the name prefix to the value it had outside the
- pic. This allows you to access nodes outside the current pic.
- \end{key}
-
+ Sometimes, you may also wish your pic to access nodes outside the pic
+ (typically, because they are given as parameters). In this case, the name
+ prefix gets in the way since the nodes outside the picture do not have this
+ prefix. The trick is to locally reset the name prefix to the value it had
+ outside the picture, which is achieved using the following style:
+
+ \begin{key}{/tikz/name prefix ..}
+ This key is available only inside the code of a pic. There, it
+ (locally) changes the name prefix to the value it had outside the pic.
+ This allows you to access nodes outside the current pic.
+ \end{key}
+
+ \medskip
+ \textbf{Animations for pics.}
+ Just as for nodes, you can use the attribute--colon syntax to add an
+ animation to a pic:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz {
+ \pic :rotate={0s="0", 20s="90"} {seagull};
+ \pic at (1.5,1.5) {seagull};
+}
+\end{codeexample}
+ %
+ Naturally, you can also use animations in the code of a picture:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2},width=3cm]
+\begin{tikzpicture} [flapping seagull/.pic={
+ \draw (0,0) :path={
+ 0s= {"{(180:3mm) to [bend left] (0,0) to [bend left] (0:3mm)}"=base},
+ 1s= "{(160:3mm) to [bend left] (0,0) to [bend left] (20:3mm)}",
+ 2s= "{(180:3mm) to [bend left] (0,0) to [bend left] (0:3mm)}",
+ repeats };
+ }]
+ \pic :rotate={0s="0", 20s="90"} {flapping seagull};
+ \pic at (1.5,1.5) {flapping seagull};
+\end{tikzpicture}
+\end{codeexample}
+ %
\end{pathoperation}
-
There are two general purpose keys that pics may find useful:
\begin{key}{/tikz/pic text=\meta{text}}
- This macro stores the \meta{text} in the macro |\tikzpictext|, which
- is |\let| to |\relax| by default. Setting the |pic text| to some
- value is the ``preferred'' way of communicating a (single) piece of
- text that should become part of a pic (typically of a node). In
- particular, the |quotes| library maps quoted parameters to this key.
+ This macro stores the \meta{text} in the macro |\tikzpictext|, which is
+ |\let| to |\relax| by default. Setting the |pic text| to some value is the
+ ``preferred'' way of communicating a (single) piece of text that should
+ become part of a pic (typically of a node). In particular, the |quotes|
+ library maps quoted parameters to this key.
\end{key}
\begin{key}{/tikz/pic text options=\meta{options}}
- This macro stores the \meta{options} in the macro
- |\tikzpictextoptions|, which is |\let| to the empty string by
- default. The |quotes| library maps options for quoted parameters to
- this key.
+ This macro stores the \meta{options} in the macro |\tikzpictextoptions|,
+ which is |\let| to the empty string by default. The |quotes| library maps
+ options for quoted parameters to this key.
\end{key}
-
\subsubsection{The Quotes Syntax}
\label{section-pic-quotes}
-When you load the |quotes| library, you can use the ``quotes syntax''
-inside the options of a pic. Recall that for nodes this syntax is used
-to add a label to a node. For pics, the quotes syntax is used to set
-the |pic text| key. Whether or not the pic type's code takes this key
-into consideration is, however, up to the key.
+When you load the |quotes| library, you can use the ``quotes syntax'' inside
+the options of a pic. Recall that for nodes this syntax is used to add a label
+to a node. For pics, the quotes syntax is used to set the |pic text| key.
+Whether or not the pic type's code takes this key into consideration is,
+however, up to the key.
-In detail, when the |quotes| library is loaded, each time a key--value
-pair in a list of options passed to an |pic| starts with |"|, the
-key--value pair must actually be a string of the following form:
+In detail, when the |quotes| library is loaded, each time a key--value pair in
+a list of options passed to an |pic| starts with |"|, the key--value pair must
+actually be a string of the following form:
+%
\begin{quote}
- |"|\meta{text}|"|\opt{|'|}\opt{\meta{options}}
+ |"|\meta{text}|"|\opt{|'|}\opt{\meta{options}}
\end{quote}
+%
This string is transformed into the following:
+%
\begin{quote}
- |every pic quotes/.try,pic text=|\meta{text}|, pic text options={|\meta{options}|}|
+ |every pic quotes/.try,pic text=|\meta{text}|, pic text options={|\meta{options}|}|
\end{quote}
-As example of a pic type that takes these values into account is the
-|angle| pic type:
+As example of a pic type that takes these values into account is the |angle|
+pic type:
+%
\begin{codeexample}[]
\tikz \draw (3,0) coordinate (A)
-- (0,1) coordinate (B)
@@ -455,20 +490,23 @@ As example of a pic type that takes these values into account is the
pic [draw, "$\alpha$"] {angle};
\end{codeexample}
-As described in Section~\ref{section-label-quotes}, the apostrophe
-becomes part of the \meta{options}, when present. As can be seen
-above, the following style is executed:
+As described in Section~\ref{section-label-quotes}, the apostrophe becomes part
+of the \meta{options}, when present. As can be seen above, the following style
+is executed:
+%
\begin{stylekey}{/tikz/every pic quotes (initially \normalfont empty)}
\end{stylekey}
+
\subsection{Defining New Pic Types}
\label{section-new-pic-types}
-As explained in the description of the |pic| command, in order to
-define a new pic type you need to
+As explained in the description of the |pic| command, in order to define a new
+pic type you need to
+%
\begin{enumerate}
-\item define a key with the path prefix |/tikz/pics| that
-\item sets the key |/tikz/pics/code| to the code of the pic.
+ \item define a key with the path prefix |/tikz/pics| that
+ \item sets the key |/tikz/pics/code| to the code of the pic.
\end{enumerate}
It turns out that this is easy enough to achieve using styles:
@@ -476,7 +514,7 @@ It turns out that this is easy enough to achieve using styles:
\begin{codeexample}[code only]
\tikzset{
pics/seagull/.style ={
- % Ok, this is the key that should, when
+ % Ok, this is the key that should, when
% executed, set the code key:
code = { %
\draw (...) ... ;
@@ -485,10 +523,9 @@ It turns out that this is easy enough to achieve using styles:
}
\end{codeexample}
-Even though the above pattern is easy enough, there is a special
-so-called key handler that allows us to write even simpler code,
-namely:
-
+Even though the above pattern is easy enough, there is a special so-called key
+handler that allows us to write even simpler code, namely:
+%
\begin{codeexample}[code only]
\tikzset{
seagull/.pic = {
@@ -498,28 +535,27 @@ namely:
\end{codeexample}
\begin{handler}{{.pic}|=|\meta{some code}}
- This handler can only be used with a key with the prefix |/tikz/|,
- so just should normally use it only as an option to a \tikzname\
- command or to the |\tikzset| command. It takes the \meta{key}'s path
- and, inside that path, it replaces |/tikz/| by |/tikz/pics/| (so,
- basically, it adds the ``missing'' |pics| part of the path). Then,
- it sets up things so that the resulting name to key is a style that
- executes |code=some code|.
+ This handler can only be used with a key with the prefix |/tikz/|, so just
+ should normally use it only as an option to a \tikzname\ command or to the
+ |\tikzset| command. It takes the \meta{key}'s path and, inside that path,
+ it replaces |/tikz/| by |/tikz/pics/| (so, basically, it adds the
+ ``missing'' |pics| part of the path). Then, it sets up things so that the
+ resulting name to key is a style that executes |code=some code|.
\end{handler}
-In almost all cases, the |.pic| key handler will suffice to setup
-keys. However, there are cases where you really need to use the first
-version using |.style| and |code=|:
+In almost all cases, the |.pic| key handler will suffice to setup keys.
+However, there are cases where you really need to use the first version using
+|.style| and |code=|:
+%
\begin{itemize}
-\item Whenever your pic type needs to set the foreground or the
- background code.
-\item In case of complicated arguments given to the keys.
+ \item Whenever your pic type needs to set the foreground or the background
+ code.
+ \item In case of complicated arguments given to the keys.
\end{itemize}
-As an example, let us define a simple pic that draws a filled circle
-behind the path. Furthermore, we make the circle's radius a parameter
-of the pic:
-
+As an example, let us define a simple pic that draws a filled circle behind the
+path. Furthermore, we make the circle's radius a parameter of the pic:
+%
\begin{codeexample}[]
\tikzset{
pics/my circle/.style = {
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 944eeca1a12..3859a65f5c0 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
@@ -7,104 +7,99 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\section{Plots of Functions}
+\section{Plots of Functions}
\label{section-tikz-plots}
-A warning before we get started: \emph{If you are looking for an easy
- way to create a normal plot of a function with scientific axes,
- ignore this section and instead look at the |pgfplots| package or at
- the |datavisualization| command from Part~\ref{part-dv}.}
+A warning before we get started: \emph{If you are looking for an easy way to
+create a normal plot of a function with scientific axes, ignore this section
+and instead look at the |pgfplots| package or at the |datavisualization|
+command from Part~\ref{part-dv}.}
-\subsection{Overview}
+\subsection{Overview}
\label{section-why-pgname-for-plots}
-\tikzname\ can be used to create plots of functions, a job that is
-normally handled by powerful programs like \textsc{gnuplot} or
-\textsc{mathematica}. These programs can produce
-two different kinds of output: First, they can output a complete plot
-picture in a certain format (like \pdf) that includes all low-level
-commands necessary for drawing the complete plot (including axes and
-labels). Second, they can usually also produce ``just plain data'' in
-the form of a long list of coordinates. Most of the powerful programs
-consider it a to be ``a bit boring'' to just output tabled data and
-very much prefer to produce fancy pictures. Nevertheless, when coaxed,
-they can also provide the plain data.
+\tikzname\ can be used to create plots of functions, a job that is normally
+handled by powerful programs like \textsc{gnuplot} or \textsc{mathematica}.
+These programs can produce two different kinds of output: First, they can
+output a complete plot picture in a certain format (like \pdf) that includes
+all low-level commands necessary for drawing the complete plot (including axes
+and labels). Second, they can usually also produce ``just plain data'' in the
+form of a long list of coordinates. Most of the powerful programs consider it a
+to be ``a bit boring'' to just output tabled data and very much prefer to
+produce fancy pictures. Nevertheless, when coaxed, they can also provide the
+plain data.
The advantage of creating plots directly using \tikzname\ is
-\emph{consistency:} Plots created using \tikzname\ will automatically
-have the same styling and fonts as those used in the rest of a
-document -- something that is hard to do right when an external
-program gets involved. Other problems people encounter with external
-programs include: Formulas will look different, if they can be
-rendered at all; line widths will usually be too thick or too thin;
-scaling effects upon inclusion can create a mismatch between sizes in
-the plot and sizes in the text; the automatic grid generated by most
-programs is mostly distracting; the automatic ticks generated by most
-programs are cryptic numerics (try adding a tick reading ``$\pi$'' at
-the right point); most programs make it very easy to create ``chart
-junk'' in a most convenient fashion; arrows and plot marks will almost
-never match the arrows used in the rest of the document. This list is
-not exhaustive, unfortunately.
+\emph{consistency:} Plots created using \tikzname\ will automatically have the
+same styling and fonts as those used in the rest of a document -- something
+that is hard to do right when an external program gets involved. Other problems
+people encounter with external programs include: Formulas will look different,
+if they can be rendered at all; line widths will usually be too thick or too
+thin; scaling effects upon inclusion can create a mismatch between sizes in the
+plot and sizes in the text; the automatic grid generated by most programs is
+mostly distracting; the automatic ticks generated by most programs are cryptic
+numerics (try adding a tick reading ``$\pi$'' at the right point); most
+programs make it very easy to create ``chart junk'' in a most convenient
+fashion; arrows and plot marks will almost never match the arrows used in the
+rest of the document. This list is not exhaustive, unfortunately.
There are basically three ways of creating plots using \tikzname:
-
+%
\begin{enumerate}
-\item Use the |plot| path operation. How this works is explained in
- the present section. This is the most ``basic'' of the three options
- and forces you to do a lot of things ``by hand'' like adding axes or
- ticks.
-\item Use the |datavisualization| path command, which is documented in
- Part~\ref{part-dv}. This command is much more powerful than the
- |plot| path operation and produces complete plots including axes and
- ticks. The downside is that you cannot use it to ``just'' quickly
- plot a simple curve (or, more precisely, it is hard to use it in
- this way).
-\item Use the |pgfplots| package, which is basically an alternative to
- the |datavisualization| command. While the underlying philosophy of
- this package is not as ``ambitious'' as that of the command
- |datavisualization|, it is somewhat more mature, has a
- simpler design, and wider support base.
+ \item Use the |plot| path operation. How this works is explained in the
+ present section. This is the most ``basic'' of the three options and
+ forces you to do a lot of things ``by hand'' like adding axes or ticks.
+ \item Use the |datavisualization| path command, which is documented in
+ Part~\ref{part-dv}. This command is much more powerful than the |plot|
+ path operation and produces complete plots including axes and ticks.
+ The downside is that you cannot use it to ``just'' quickly plot a
+ simple curve (or, more precisely, it is hard to use it in this way).
+ \item Use the |pgfplots| package, which is basically an alternative to the
+ |datavisualization| command. While the underlying philosophy of this
+ package is not as ``ambitious'' as that of the command
+ |datavisualization|, it is somewhat more mature, has a simpler design,
+ and wider support base.
\end{enumerate}
\subsection{The Plot Path Operation}
The |plot| path operation can be used to append a line or curve to the path
-that goes through a large number of coordinates. These coordinates are
-either given in a simple list of coordinates, read from some file, or
-they are computed on the fly.
+that goes through a large number of coordinates. These coordinates are either
+given in a simple list of coordinates, read from some file, or they are
+computed on the fly.
The syntax of the |plot| comes in different versions.
\begin{pathoperation}{--plot}{\meta{further arguments}}
- This operation plots the curve through the coordinates specified in
- the \meta{further arguments}. The current (sub)path is simply
- continued, that is, a line-to operation to the first point of the
- curve is implicitly added. The details of the \meta{further
- arguments} will be explained in a moment.
+ This operation plots the curve through the coordinates specified in the
+ \meta{further arguments}. The current (sub)path is simply continued, that
+ is, a line-to operation to the first point of the curve is implicitly
+ added. The details of the \meta{further arguments} will be explained in a
+ moment.
\end{pathoperation}
\begin{pathoperation}{plot}{\meta{further arguments}}
- This operation plots the curve through the coordinates specified in
- the \meta{further arguments} by first ``moving'' to the first
- coordinate of the curve.
+ This operation plots the curve through the coordinates specified in the
+ \meta{further arguments} by first ``moving'' to the first coordinate of the
+ curve.
\end{pathoperation}
-The \meta{further arguments} are used in different ways to
-specifying the coordinates of the points to be plotted:
-
+The \meta{further arguments} are used in different ways to specifying the
+coordinates of the points to be plotted:
+%
\begin{enumerate}
-\item
- \opt{|--|}|plot|\oarg{local options}\declare{|coordinates{|\meta{coordinate
- 1}\meta{coordinate 2}\dots\meta{coordinate $n$}|}|}
-\item
- \opt{|--|}|plot|\oarg{local options}\declare{|file{|\meta{filename}|}|}
-\item
- \opt{|--|}|plot|\oarg{local options}\declare{\meta{coordinate expression}}
-\item
- \opt{|--|}|plot|\oarg{local options}\declare{|function{|\meta{gnuplot formula}|}|}
+ \item \opt{|--|}|plot|\oarg{local
+ options}\declare{|coordinates{|\meta{coordinate 1}\meta{coordinate
+ 2}\dots\meta{coordinate $n$}|}|}
+ \item \opt{|--|}|plot|\oarg{local
+ options}\declare{|file{|\meta{filename}|}|}
+ \item \opt{|--|}|plot|\oarg{local options}\declare{\meta{coordinate
+ expression}}
+ \item \opt{|--|}|plot|\oarg{local options}\declare{|function{|\meta{gnuplot
+ formula}|}|}
\end{enumerate}
These different ways are explained in the following.
@@ -112,15 +107,14 @@ These different ways are explained in the following.
\subsection{Plotting Points Given Inline}
-Points can be given directly in the \TeX-file
-as in the following example:
-
+Points can be given directly in the \TeX-file as in the following example:
+%
\begin{codeexample}[]
\tikz \draw plot coordinates {(0,0) (1,1) (2,0) (3,1) (2,1) (10:2cm)};
\end{codeexample}
Here is an example showing the difference between |plot| and |--plot|:
-
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) -- (1,1) plot coordinates {(2,0) (4,0)};
@@ -132,29 +126,28 @@ Here is an example showing the difference between |plot| and |--plot|:
\subsection{Plotting Points Read From an External File}
-The second way of specifying points is to put them in an external
-file named \meta{filename}. Currently, the only file format that
-\tikzname\ allows is the following: Each line of the \meta{filename}
-should contain one line starting with two numbers, separated by a
-space. A line may also be empty or, if it starts with |#| or |%| it is
-considered empty. For such lines, a ``new data set'' is started,
-typically resulting in a new subpath being started in the plot (see
-Section~\ref{section-plot-jumps} on how to change this behaviour, if
-necessary). For lines containing two numbers, they must be separated
-by a space. They may be following by arbitrary text, which is ignored,
-\emph{except} if it is |o| or |u|. In the first case, the point is
-considered to be an \emph{outlier} and normally also results in a new
-subpath being started. In the second case, the point is considered to
-be \emph{undefined}, which also results in a new subpath being
-started. Again, see Section~\ref{section-plot-jumps} on how to change
-this, if necessary. (This is exactly the format that \textsc{gnuplot}
-produces when you say |set terminal table|.)
-
+The second way of specifying points is to put them in an external file named
+\meta{filename}. Currently, the only file format that \tikzname\ allows is the
+following: Each line of the \meta{filename} should contain one line starting
+with two numbers, separated by a space. A line may also be empty or, if it
+starts with |#| or |%| it is considered empty. For such lines, a ``new data
+set'' is started, typically resulting in a new subpath being started in the
+plot (see Section~\ref{section-plot-jumps} on how to change this behaviour, if
+necessary). For lines containing two numbers, they must be separated by a
+space. They may be following by arbitrary text, which is ignored, \emph{except}
+if it is |o| or |u|. In the first case, the point is considered to be an
+\emph{outlier} and normally also results in a new subpath being started. In the
+second case, the point is considered to be \emph{undefined}, which also results
+in a new subpath being started. Again, see Section~\ref{section-plot-jumps} on
+how to change this, if necessary. (This is exactly the format that
+\textsc{gnuplot} produces when you say |set terminal table|.)
+%
\begin{codeexample}[]
\tikz \draw plot[mark=x,smooth] file {plots/pgfmanual-sine.table};
\end{codeexample}
The file |plots/pgfmanual-sine.table| reads:
+%
\begin{codeexample}[code only]
#Curve 0, 20 points
#x y type
@@ -166,7 +159,9 @@ The file |plots/pgfmanual-sine.table| reads:
9.47368 -0.04889 i
10.00000 -0.54402 i
\end{codeexample}
+%
It was produced from the following source, using |gnuplot|:
+%
\begin{codeexample}[code only]
set table "../plots/pgfmanual-sine.table"
set format "%.5f"
@@ -174,61 +169,60 @@ set samples 20
plot [x=0:10] sin(x)
\end{codeexample}
-The \meta{local options} of the |plot| operation are local to each
-plot and do not affect other plots ``on the same path.'' For example,
-|plot[yshift=1cm]| will locally shift the plot 1cm upward. Remember,
-however, that most options can only be applied to paths as a
-whole. For example, |plot[red]| does not have the effect of making the
-plot red. After all, you are trying to ``locally'' make part of the
-path red, which is not possible.
+The \meta{local options} of the |plot| operation are local to each plot and do
+not affect other plots ``on the same path''. For example, |plot[yshift=1cm]|
+will locally shift the plot 1cm upward. Remember, however, that most options
+can only be applied to paths as a whole. For example, |plot[red]| does not have
+the effect of making the plot red. After all, you are trying to ``locally''
+make part of the path red, which is not possible.
+
\subsection{Plotting a Function}
\label{section-tikz-plot}
-When you plot a function, the coordinates of the plot data can be
-computed by evaluating a mathematical expression. Since \pgfname\
-comes with a mathematical engine, you can specify this expression and
-then have \tikzname\ produce the desired coordinates for you,
-automatically.
-
-Since this case is quite common when plotting a function, the syntax
-is easy: Following the |plot| command and its local options, you
-directly provide a \meta{coordinate expression}. It looks like a
-normal coordinate, but inside you may use a special macro, which is
-|\x| by default, but this can be changed using the |variable|
-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 parenthesis.
-
-The following options influence how the \meta{coordinate expression}
-is evaluated:
+When you plot a function, the coordinates of the plot data can be computed by
+evaluating a mathematical expression. Since \pgfname\ comes with a mathematical
+engine, you can specify this expression and then have \tikzname\ produce the
+desired coordinates for you, automatically.
+
+Since this case is quite common when plotting a function, the syntax is easy:
+Following the |plot| command and its local options, you directly provide a
+\meta{coordinate expression}. It looks like a normal coordinate, but inside you
+may use a special macro, which is |\x| by default, but this can be changed
+using the |variable| 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 parenthesis.
+
+The following options influence how the \meta{coordinate expression} is
+evaluated:
+%
\begin{key}{/tikz/variable=\meta{macro} (initially x)}
- Sets the macro whose value is set to the different values when
- \meta{coordinate expression} is evaluated.
+ Sets the macro whose value is set to the different values when
+ \meta{coordinate expression} is evaluated.
\end{key}
\begin{key}{/tikz/samples=\meta{number} (initially 25)}
- Sets the number of samples used in the plot.
+ Sets the number of samples used in the plot.
\end{key}
\begin{key}{/tikz/domain=\meta{start}|:|\meta{end} (initially -5:5)}
- Sets the domain from which the samples are taken.
+ Sets the domain from which the samples are taken.
\end{key}
\begin{key}{/tikz/samples at=\meta{sample list}}
- This option specifies a list of positions for which the
- variable should be evaluated. For instance, you can say
- |samples at={1,2,8,9,10}| to have the variable evaluated exactly for
- values $1$, $2$, $8$, $9$, and $10$. You can use the |\foreach|
- syntax, so you can use |...| inside the \meta{sample list}.
+ This option specifies a list of positions for which the variable should be
+ evaluated. For instance, you can say |samples at={1,2,8,9,10}| to have the
+ variable evaluated exactly for values $1$, $2$, $8$, $9$, and $10$. You can
+ use the |\foreach| syntax, so you can use |...| inside the \meta{sample
+ list}.
- When this option is used, the |samples| and |domain| option are
- overruled. The other way round, setting either |samples| or
- |domain| will overrule this option.
+ When this option is used, the |samples| and |domain| option are overruled.
+ The other way round, setting either |samples| or |domain| will overrule
+ this option.
\end{key}
-
+%
\begin{codeexample}[]
\begin{tikzpicture}[domain=0:4]
\draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9);
@@ -257,87 +251,77 @@ is evaluated:
\subsection{Plotting a Function Using Gnuplot}
\label{section-tikz-gnuplot}
-Often, you will want to plot points that are given via a function like
-$f(x) = x \sin x$. Unfortunately, \TeX\ does not really have enough
-computational power to generate the points of such a function
-efficiently (it is a text processing program, after all). However,
-if you allow it, \TeX\ can try to call external programs that can
-easily produce the necessary points. Currently, \tikzname\ knows how to
-call \textsc{gnuplot}.
+Often, you will want to plot points that are given via a function like $f(x) =
+x \sin x$. Unfortunately, \TeX\ does not really have enough computational power
+to generate the points of such a function efficiently (it is a text processing
+program, after all). However, if you allow it, \TeX\ can try to call external
+programs that can 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
-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 your 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,
+|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 your 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
-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}|.
+|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}|.
For the plotting mechanism to work, two conditions must be met:
+%
\begin{enumerate}
-\item
- You must have allowed \TeX\ to call external programs. This is often
- switched off by default since this is a security risk (you might,
- without knowing, run a \TeX\ file that calls all sorts of ``bad''
- commands). To enable this ``calling external programs'' a command
- line option must be given to the \TeX\ program. Usually, it is
- called something like |shell-escape| or |enable-write18|. For
- example, for my |pdflatex| the option |--shell-escape| can be
- given.
-\item
- You must have installed the |gnuplot| program and \TeX\ must find it
- when compiling your file.
+ \item You must have allowed \TeX\ to call external programs. This is often
+ switched off by default since this is a security risk (you might,
+ without knowing, run a \TeX\ file that calls all sorts of ``bad''
+ commands). To enable this ``calling external programs'' a command line
+ option must be given to the \TeX\ program. Usually, it is called
+ something like |shell-escape| or |enable-write18|. For example, for my
+ |pdflatex| the option |--shell-escape| can be given.
+ \item You must have installed the |gnuplot| program and \TeX\ must find it
+ when compiling your file.
\end{enumerate}
-Unfortunately, these conditions will not always be met. Especially if
-you pass some source to a coauthor and the coauthor does not have
-\textsc{gnuplot} installed, he or she will have trouble compiling your
-files.
-
-For this reason, \tikzname\ behaves differently when you compile your
-graphic for the second time: If upon reaching
-|plot[id=|\meta{id}|] function{...}| the file \meta{prefix}\meta{id}|.table|
-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:
+Unfortunately, these conditions will not always be met. Especially if you pass
+some source to a coauthor and the coauthor does not have \textsc{gnuplot}
+installed, he or she will have trouble compiling your files.
+
+For this reason, \tikzname\ behaves differently when you compile your graphic
+for the second time: If upon reaching |plot[id=|\meta{id}|] function{...}| the
+file \meta{prefix}\meta{id}|.table| 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:
+%
\begin{enumerate}
-\item
- If you pass a bundle of your |.tex| file and all |.gnuplot| and
- |.table| files to someone else, that person can \TeX\ the |.tex|
- file without having to have |gnuplot| installed.
-\item
- If the |\write18| feature is switched off for security reasons (a
- good idea), then, upon the first compilation of the |.tex| file, the
- |.gnuplot| will still be generated, but not the |.table|
- file. You can then simply call |gnuplot| ``by hand'' for each
- |.gnuplot| file, which will produce all necessary |.table| files.
-\item
- If you change the function that you wish to plot or its
- domain, \tikzname\ will automatically try to regenerate the |.table|
- file.
-\item
- If, out of laziness, you do not provide an |id|, the same |.gnuplot|
- will be used for different plots, but this is not a problem since
- the |.table| will automatically be regenerated for each plot
- on-the-fly. \emph{Note: If you intend to share your files with
- someone else, always use an id, so that the file can by typeset
- without having \textsc{gnuplot} installed.} Also, having unique ids
- for each plot will improve compilation speed since no external
- programs need to be called, unless it is really necessary.
+ \item If you pass a bundle of your |.tex| file and all |.gnuplot| and
+ |.table| files to someone else, that person can \TeX\ the |.tex| file
+ without having to have |gnuplot| installed.
+ \item If the |\write18| feature is switched off for security reasons (a
+ good idea), then, upon the first compilation of the |.tex| file, the
+ |.gnuplot| will still be generated, but not the |.table| file. You can
+ then simply call |gnuplot| ``by hand'' for each |.gnuplot| file, which
+ will produce all necessary |.table| files.
+ \item If you change the function that you wish to plot or its domain,
+ \tikzname\ will automatically try to regenerate the |.table| file.
+ \item If, out of laziness, you do not provide an |id|, the same |.gnuplot|
+ will be used for different plots, but this is not a problem since the
+ |.table| will automatically be regenerated for each plot on-the-fly.
+ \emph{Note: If you intend to share your files with someone else, always
+ use an id, so that the file can by typeset without having
+ \textsc{gnuplot} installed.} Also, having unique ids for each plot will
+ improve compilation speed since no external programs need to be called,
+ unless it is really necessary.
\end{enumerate}
When you use |plot function{|\meta{gnuplot formula}|}|, the \meta{gnuplot
- formula} must be given in the |gnuplot| syntax, whose details are
-beyond the scope of this manual. Here is the ultra-condensed
-essence: Use |x| as the variable and use the C-syntax for normal
-plots, use |t| as the variable for parametric plots. Here are some examples:
-
+formula} must be given in the |gnuplot| syntax, whose details are beyond the
+scope of this manual. Here is the ultra-condensed essence: Use |x| as the
+variable and use the C-syntax for normal 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);
@@ -351,215 +335,225 @@ plots, use |t| as the variable for parametric plots. Here are some examples:
\end{tikzpicture}
\end{codeexample}
-
-The plot is influenced by the following options: First, the options
-|samples| and |domain| explained earlier. Second, there are some more
-specialized options.
+The plot is 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{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
- the following:
+ 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 the following:
+ %
\begin{codeexample}[]
\tikz \draw[scale=0.5,domain=-3.141:3.141,smooth]
plot[parametric,id=parametric-example] function{t*sin(t),t*cos(t)};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/range=\meta{start}|:|\meta{end}}
- This key sets the range of the plot. If set, all points whose
- $y$-coordinates lie outside this range will be considered to be
- outliers and will cause jumps in the plot, by default:
+ This key sets the range of the plot. If set, all points whose
+ $y$-coordinates lie outside this range will be considered to be outliers
+ and will cause jumps in the plot, by default:
+ %
\begin{codeexample}[]
\tikz \draw[scale=0.5,domain=-3.141:3.141, samples=100, smooth, range=-3:3]
plot[id=tan-example] function{tan(x)};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/yrange=\meta{start}|:|\meta{end}}
- Same as |range|.
+ Same as |range|.
\end{key}
\begin{key}{/tikz/xrange=\meta{start}|:|\meta{end}}
- Set the $x$-range. This makes sense only for parametric plots.
+ Set the $x$-range. This makes sense only for parametric plots.
+ %
\begin{codeexample}[]
\tikz \draw[scale=0.5,domain=-3.141:3.141,smooth,xrange=0:1]
plot[parametric,id=parametric-example-cut] function{t*sin(t),t*cos(t)};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/id=\meta{id}}
- Sets the identifier of the current plot. This should be a unique
- identifier for each plot (though things will also work if it is not,
- but not as well, see the explanations above). The \meta{id} will be
- part of a filename, so it should not contain anything fancy like |*|
- or |$|.%$
+ Sets the identifier of the current plot. This should be a unique identifier
+ for each plot (though things will also work if it is not, but not as well,
+ see the explanations above). The \meta{id} will be part of a filename, so
+ it should not contain anything fancy like |*| or |$|.%$
\end{key}
\begin{key}{/tikz/prefix=\meta{prefix}}
- The \meta{prefix} is put before each plot file name. The default is
- |\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.
+ The \meta{prefix} is put before each plot file name. The default is
+ |\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.
\end{key}
\begin{key}{/tikz/raw gnuplot}
- This key causes the \meta{gnuplot formula} to be passed on to
- \textsc{gnuplot} without setting up the samples or the |plot|
- operation. Thus, you could write
+ This key causes the \meta{gnuplot formula} to be passed on to
+ \textsc{gnuplot} without setting up the samples or the |plot| operation.
+ Thus, you could write
+ %
\begin{codeexample}[code only]
plot[raw gnuplot,id=raw-example] function{set samples 25; plot sin(x)}
\end{codeexample}
- 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
- and use the |file|-syntax to include the table ``by hand.''
+ %
+ 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 and use the
+ |file|-syntax to include the table ``by hand''.
\end{key}
The following styles influence the plot:
+%
\begin{stylekey}{/tikz/every plot (initially \normalfont empty)}
- This style is installed in each plot, that is, as if you always said
+ This style is installed in each plot, that is, as if you always said
+ %
\begin{codeexample}[code only]
plot[every plot,...]
\end{codeexample}
- This is most useful for globally setting a prefix for all plots by saying:
+ %
+ This is most useful for globally setting a prefix for all plots by saying:
+ %
\begin{codeexample}[code only]
\tikzset{every plot/.style={prefix=plots/}}
\end{codeexample}
+ %
\end{stylekey}
-
\subsection{Placing Marks on the Plot}
-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.
+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.
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 |plotmarks| is
- loaded. Section~\ref{section-plot-marks} lists the available plot
- marks.
+ 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 |plotmarks| is loaded.
+ Section~\ref{section-plot-marks} lists the available plot marks.
- One plot mark is special: the |ball| plot mark is available only
- in \tikzname. The |ball color| option 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.
+ One plot mark is special: the |ball| plot mark is available only in
+ \tikzname. The |ball color| option 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}
- \end{tabular}
+ \begin{tabular}{lc}
+ Option & Effect \\
+ \hline
+ \vrule height14pt width0pt \plotmarkentrytikz{ball}
+ \end{tabular}
\end{key}
\begin{key}{/tikz/mark repeat=\meta{r}}
- This option tells \tikzname\ that only every $r$th mark should be
- drawn.
-
+ 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}
+ %
\end{key}
\begin{key}{/tikz/mark phase=\meta{p}}
- 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.
-
+ 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}
+ %
\end{key}
\begin{key}{/tikz/mark indices=\meta{list}}
- 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.
-
+ 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};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/mark size=\meta{dimension}}
- Sets the size of the plot marks. For circular plot marks,
- \meta{dimension} is the radius, for other plot marks
- \meta{dimension} should be about half the width and height.
+ Sets the size of the plot marks. For circular plot marks, \meta{dimension}
+ is the radius, for other plot marks \meta{dimension} should be about half
+ the width and height.
- 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.
+ 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.
\end{key}
\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.
+ This style is installed before drawing plot marks. For example, you can
+ scale (or otherwise transform) the plot mark or set its color.
\end{stylekey}
\begin{key}{/tikz/mark options=\meta{options}}
- Redefines |every mark| such that it sets \marg{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|).
+ Disables markers (the same as |mark=none|).
\end{stylekey}
+%
\begin{stylekey}{/tikz/no markers}
- Disables markers (the same as |mark=none|).
+ Disables markers (the same as |mark=none|).
\end{stylekey}
-
\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,
-it will connect these points by straight lines. However, you can also
-use options to change the behavior of |plot|.
+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, it will connect
+these points by straight lines. However, you can also use options to change the
+behavior of |plot|.
\begin{key}{/tikz/sharp plot}
- This is the default and causes the points to be connected by
- straight lines. This option is included only so that you can
- ``switch back'' if you ``globally'' install, say, |smooth|.
+ This is the default and causes the points to be connected by straight
+ lines. This option is included only so that you can ``switch back'' if you
+ ``globally'' install, say, |smooth|.
\end{key}
\begin{key}{/tikz/smooth}
- This option causes the points on the path to be connected using a
- smooth curve:
-
+ This option causes the points on the path to be connected using a smooth
+ curve:
+ %
\begin{codeexample}[]
\tikz\draw plot[smooth] file{plots/pgfmanual-sine.table};
\end{codeexample}
- Note that the smoothing algorithm is not very intelligent. You will
- get the best results if the bending angles are small, that is, less
- than about $30^\circ$ and, even more importantly, if the distances
- between points are about the same all over the plotting path.
+ Note that the smoothing algorithm is not very intelligent. You will get the
+ best results if the bending angles are small, that is, less than about
+ $30^\circ$ and, even more importantly, if the distances between points are
+ about the same all over the plotting path.
\end{key}
\begin{key}{/tikz/tension=\meta{value}}
- This option influences how ``tight'' the smoothing is. A lower value
- will result in sharper corners, a higher value in more ``round''
- 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.
-
+ This option influences how ``tight'' the smoothing is. A lower value will
+ result in sharper corners, a higher value in more ``round'' 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]
@@ -570,93 +564,103 @@ use options to change the behavior of |plot|.
coordinates{(0,0) (1,1) (2,0) (1,-1)};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/smooth cycle}
- This option causes the points on the path to be connected using a
- closed smooth curve.
-
+ This option causes the points on the path to be connected using a closed
+ smooth curve.
+ %
\begin{codeexample}[]
\tikz[scale=0.5]
\draw plot[smooth cycle] coordinates{(0,0) (1,0) (2,1) (1,2)}
plot coordinates{(0,0) (1,0) (2,1) (1,2)} -- cycle;
\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:
-
+ 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|.
+ 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:
+ 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/const plot mark mid}
- A variant of |/tikz/const plot| which places its mark in the middle
- of the horizontal lines:
+ A variant of |/tikz/const plot| which places its mark in the middle of the
+ horizontal lines:
+ %
\begin{codeexample}[]
\tikz\draw plot[const plot mark mid,mark=*] file{plots/pgfmanual-sine.table};
\end{codeexample}
- More precisely, it generates vertical lines in the middle between
- each pair of consecutive points. If the mesh width is constant, this
- leads to symmetrically placed marks (``middle'').
+ %
+ More precisely, it generates vertical lines in the middle between each pair
+ of consecutive points. If the mesh width is constant, this leads to
+ symmetrically placed marks (``middle'').
\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:
-
+ 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:
-
+ 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/jump mark mid}
- 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 in the middle of the horizontal line
- segments:
-
+ 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 in the middle of the horizontal line segments:
+ %
\begin{codeexample}[]
-\tikz\draw plot[jump mark right, mark=*] file{plots/pgfmanual-sine.table};
+\tikz\draw plot[jump mark mid, mark=*] file{plots/pgfmanual-sine.table};
\end{codeexample}
- In case of non--constant mesh widths, the same remarks as for |const plot mark mid| apply.
+ In case of non-constant mesh widths, the same remarks as for
+ |const plot mark mid| apply.
\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
- the plot a straight line is added to the path from the $x$-axis to the point,
- resulting in a sort of ``comb'' or ``bar diagram.''
-
+ This option causes the |plot| operation to interpret the plotting points
+ differently. Instead of connecting them, for each point of the plot a
+ straight line is added to the path from the $x$-axis to the point,
+ resulting in a sort of ``comb'' or ``bar diagram''.
+ %
\begin{codeexample}[]
\tikz\draw[ultra thick] plot[ycomb,thin,mark=*] file{plots/pgfmanual-sine.table};
\end{codeexample}
@@ -669,34 +673,35 @@ use options to change the behavior of |plot|.
plot coordinates{(0,1.2) (.5,1.3) (1,.5) (1.5,.2) (2,.5)};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\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)};
\end{codeexample}
+ %
\end{key}
-
\begin{key}{/tikz/polar comb}
- This option causes a line from the origin to the point to be added
- to the path for each plot point.
-
+ This option causes a line from the origin to the point to be added to the
+ path for each plot point.
+ %
\begin{codeexample}[]
\tikz \draw plot[polar comb,
mark=pentagon*,mark options={fill=white,draw=red},mark size=4pt]
coordinates {(0:1cm) (30:1.5cm) (160:.5cm) (250:2cm) (-60:.8cm)};
\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.
-
+ 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}
@@ -709,59 +714,61 @@ use options to change the behavior of |plot|.
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}.
+ %
+ 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.
-
+ 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:
-
+ 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.
+ %
+ 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 widths, which is
- explained in the plot handler library documentation,
- section~\ref{section-plotlib-bar-handlers}. Please refer to
- page~\pageref{key-bar-interval-width}.
+ You can configure relative shifts and relative bar widths, 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.
-
+ 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
- added to the actual path. This can be useful for quickly adding some
- marks to a path.
-
+ This option causes only marks to be shown; no path segments are added to
+ the actual path. This can be useful for quickly adding some marks to a
+ path.
+ %
\begin{codeexample}[]
\tikz \draw (0,0) sin (1,1) cos (2,0)
plot[only marks,mark=x] coordinates{(0,0) (1,1) (2,0) (3,-1)};
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 07d04943cc8..61f0aafb81b 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
@@ -7,146 +7,139 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\section[Hierarchical Structures: Package, Environments, Scopes, and Styles]
-{Hierarchical Structures:\\
- Package, Environments, Scopes, and Styles}
-The present section explains how your files should be structured when
-you use \tikzname. On the top level, you need to include the |tikz|
-package. In the main text, each graphic needs to be put in a
-|{tikzpicture}| environment. Inside these environments, you can use
-|{scope}| environments to create internal groups. Inside the scopes
-you use |\path| commands to actually draw something. On all levels
-(except for the package level), graphic options can be given that
-apply to everything within the environment.
+\section[Hierarchical Structures: Package, Environments, Scopes, and Styles]
+ {Hierarchical Structures:\\
+ Package, Environments, Scopes, and Styles}
+The present section explains how your files should be structured when you use
+\tikzname. On the top level, you need to include the |tikz| package. In the
+main text, each graphic needs to be put in a |{tikzpicture}| environment.
+Inside these environments, you can use |{scope}| environments to create
+internal groups. Inside the scopes you use |\path| commands to actually draw
+something. On all levels (except for the package level), graphic options can be
+given that apply to everything within the environment.
\subsection{Loading the Package and the Libraries}
\begin{package}{tikz}
- This package does not have any options.
+ This package does not have any options.
- This will automatically load the \pgfname\ and the |pgffor| package.
+ This will automatically load the \pgfname\ and the |pgffor| package.
- \pgfname\ needs to know what \TeX\ driver you are intending to use. In
- most cases \pgfname\ is clever enough to determine the correct driver
- for you; this is true in particular if you use \LaTeX. One
- 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|.
+ \pgfname\ needs to know what \TeX\ driver you are intending to use. In most
+ cases \pgfname\ is clever enough to determine the correct driver for you;
+ this is true in particular if you use \LaTeX. One 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|.
\end{package}
-
\begin{command}{\usetikzlibrary\marg{list of libraries}}
- Once \tikzname\ has been loaded, you can 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, which is something Con\TeX t users will
- like. If you try to load a library a second time, nothing will
- happen.
-
- \example |\usetikzlibrary{arrows.meta}|
-
- The above command will load a whole bunch of extra arrow tip
- definitions.
-
- What this command does is to load the file
- |tikzlibrary|\meta{library}|.code.tex| for each \meta{library} in
- the \meta{list of libraries}. If this file does not exist, the file
- |pgflibrary|\meta{library}|.code.tex| is loaded instead. If this
- file also does not exist, an error message is printed. Thus, to
- write your own library file, all you need to do is to place a file
- of the appropriate name somewhere where \TeX\ can find it. \LaTeX,
- plain \TeX, and Con\TeX t users can then use your library.
+ Once \tikzname\ has been loaded, you can 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, which is something Con\TeX t users will like. If you try to load
+ a library a second time, nothing will happen.
+
+ \example |\usetikzlibrary{arrows.meta}|
+
+ The above command will load a whole bunch of extra arrow tip definitions.
+
+ What this command does is to load the file
+ |tikzlibrary|\meta{library}|.code.tex| for each \meta{library} in the
+ \meta{list of libraries}. If this file does not exist, the file
+ |pgflibrary|\meta{library}|.code.tex| is loaded instead. If this file also
+ does not exist, an error message is printed. Thus, to write your own
+ library file, all you need to do is to place a file of the appropriate name
+ somewhere where \TeX\ can find it. \LaTeX, plain \TeX, and Con\TeX t users
+ can then use your library.
\end{command}
-
\subsection{Creating a Picture}
\subsubsection{Creating a Picture Using an Environment}
-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.
-
-In \tikzname, the way graphics are rendered is strongly influenced by
-graphic options. For example, there is an option for setting the color used
-for drawing, another for setting the color used for filling, and also
-more obscure ones like the option for setting the prefix used in the
-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.
-
-\begin{environment}{{tikzpicture}\opt{\oarg{options}}}
- All \tikzname\ commands should be given inside this
- environment, except for the |\tikzset| command. Unlike other
- 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.
-
- When this environment is encountered, the \meta{options} are
- parsed, see Section~\ref{section-graphic-options}. All options given
- here will apply to the whole picture.
-
- Next, the contents of the environment is processed and the graphic
- commands therein are put into a box. Non-graphic text is suppressed
- as well as possible, but non-\pgfname\ commands inside a
- |{tikzpicture}| environment should not produce any ``output'' since
- this may totally scramble the positioning system of the backend
- drivers. The suppressing of normal text, by the way, is done by
- temporarily switching the font to |\nullfont|. You can, however,
- ``escape back'' to normal \TeX\ typesetting. This happens, for
- example, when you specify a node.
-
- At the end of the environment, \pgfname\ tries to make a good guess
- at the size of a bounding box of the graphic and
- 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
- 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, control points of a curve often lie far
- ``outside'' the curve and make the bounding box too large. In this
- case, you should use the |[use as bounding box]| option.
-
- The following key influences the baseline of the resulting
- picture:
- \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
- lower end of the picture is at $-.5\mathrm{ex} - 0.2\mathrm{pt}$
- (the 0.2pt are half the line width, which is 0.4pt) and that the
- upper end is at $.5\mathrm{ex}+.5\mathrm{pt}$. Then, the lower end
- will be put on the baseline, resulting in the following:
- \tikz\draw(0,0)circle(.5ex);.
-
- Using this option, you can specify that the picture should be
- raised or lowered such that the height \meta{dimension} is on the
- baseline. For example, |\tikz[baseline=0pt]\draw(0,0)circle(.5ex);|
- yields \tikz[baseline=0pt]\draw(0,0)circle(.5ex); since, now, the
- baseline is on the height of the $x$-axis.
-
- This options is often useful for ``inlined'' graphics as in
+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.
+
+In \tikzname, the way graphics are rendered is strongly influenced by graphic
+options. For example, there is an option for setting the color used for
+drawing, another for setting the color used for filling, and also more obscure
+ones like the option for setting the prefix used in the 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.
+
+\begin{environment}{{tikzpicture}\opt{\meta{animations spec}}\opt{\oarg{options}}}
+ All \tikzname\ commands should be given inside this environment, except for
+ the |\tikzset| command. You cannot use graphics commands like the low-level
+ command |\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.
+
+ When this environment is encountered, the \meta{options} are parsed, see
+ Section~\ref{section-graphic-options}. All options given here will apply to
+ the whole picture. Before the options you can specify animation commands,
+ provided that the |animations| library is loaded, see
+ Section~\ref{section-tikz-animations} for details.
+
+ Next, the contents of the environment is processed and the graphic commands
+ therein are put into a box. Non-graphic text is suppressed as well as
+ possible, but non-\pgfname\ commands inside a |{tikzpicture}| environment
+ should not produce any ``output'' since this may totally scramble the
+ positioning system of the backend drivers. The suppressing of normal text,
+ by the way, is done by temporarily switching the font to |\nullfont|. You
+ can, however, ``escape back'' to normal \TeX\ typesetting. This happens,
+ for example, when you specify a node.
+
+ At the end of the environment, \pgfname\ tries to make a good guess at the
+ size of a bounding box of the graphic and then resizes the picture box such
+ that the box has this size. To ``make its guess'', every time \pgfname\
+ encounters a coordinate, it updates the bounding box's size such that it
+ encompasses all these 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, control points of a curve often lie far ``outside'' the curve and
+ make the bounding box too large. In this case, you should use the |[use as
+ bounding box]| option.
+
+ The following key influences the baseline of the resulting picture:
+ %
+ \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 lower
+ end of the picture is at $-.5\mathrm{ex} - 0.2\mathrm{pt}$ (the 0.2pt
+ are half the line width, which is 0.4pt) and that the upper end is at
+ $.5\mathrm{ex}+.5\mathrm{pt}$. Then, the lower end will be put on the
+ baseline, resulting in the following: \tikz\draw(0,0)circle(.5ex);.
+
+ Using this option, you can specify that the picture should be raised or
+ lowered such that the height \meta{dimension} is on the baseline. For
+ example, |\tikz[baseline=0pt]\draw(0,0)circle(.5ex);| yields
+ \tikz[baseline=0pt]\draw(0,0)circle(.5ex); since, now, the baseline is
+ on the height of the $x$-axis.
+
+ This options is often useful for ``inlined'' graphics as in
+ %
\begin{codeexample}[]
$A \mathbin{\tikz[baseline] \draw[->>] (0pt,.5ex) -- (3ex,.5ex);} B$
\end{codeexample}
- Instead of a \meta{dimension} you can also provide a coordinate in
- parentheses. Then the effect is to put the baseline on the
- $y$-coordinate that the given \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
- to the $y$-coordinate of the resulting point. This makes it easy
- to reference the $y$-coordinate of, say, the baseline of nodes.
+ Instead of a \meta{dimension} you can also provide a coordinate in
+ parentheses. Then the effect is to put the baseline on the
+ $y$-coordinate that the given \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 to the
+ $y$-coordinate of the resulting point. This makes it easy to reference
+ the $y$-coordinate of, say, the baseline of nodes.
+ %
\begin{codeexample}[]
Hello
\tikz[baseline=(X.base)]
@@ -158,28 +151,28 @@ 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}}
- This option causes \meta{code} to be executed
- at the beginning of the picture. This option must be
- given in the argument of the |{tikzpicture}| environment itself
- since this option will not have an effect otherwise. After all,
- the picture has already ``started'' later on. The effect of
- multiply setting this option accumulates.
-
- This option is mainly used in styles like the |every picture|
- style to execute certain code at the start of a picture.
- \end{key}
-
- \begin{key}{/tikz/execute at end picture=\meta{code}}
- This option installs \meta{code} that will be executed
- at the end of the picture. Using this option multiple times will
- cause the code to accumulate. This option must also be given in
- the optional argument of the |{tikzpicture}| environment.
+ Use |baseline=default| to reset the |baseline| option to its initial
+ configuration.
+ \end{key}
+
+ \begin{key}{/tikz/execute at begin picture=\meta{code}}
+ This option causes \meta{code} to be executed at the beginning of the
+ picture. This option must be given in the argument of the
+ |{tikzpicture}| environment itself since this option will not have an
+ effect otherwise. After all, the picture has already ``started'' later
+ on. The effect of multiply setting this option accumulates.
+
+ This option is mainly used in styles like the |every picture| style to
+ execute certain code at the start of a picture.
+ \end{key}
+
+ \begin{key}{/tikz/execute at end picture=\meta{code}}
+ This option installs \meta{code} that will be executed at the end of
+ the picture. Using this option multiple times will cause the code to
+ accumulate. This option must also be given in the optional argument of
+ the |{tikzpicture}| environment.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[execute at end picture=%
{
@@ -193,111 +186,108 @@ Top align:
\node at (2,1) {Y};
\end{tikzpicture}
\end{codeexample}
- \end{key}
-
- All options ``end'' at the end of the picture. To set an option
- ``globally'' change the following style:
- \begin{stylekey}{/tikz/every picture (initially \normalfont empty)}
- This style is installed at the beginning of each picture.
+ \end{key}
+
+ All options ``end'' at the end of the picture. To set an option
+ ``globally'' change the following style:
+ %
+ \begin{stylekey}{/tikz/every picture (initially \normalfont empty)}
+ This style is installed at the beginning of each picture.
+ %
\begin{codeexample}[code only]
\tikzset{every picture/.style=semithick}
\end{codeexample}
- \end{stylekey}
+ \end{stylekey}
- Note that you should not use |\tikzset| to set options directly. For
- instance, if you want to use a line width of |1pt| by default, do
- not try to say |\tikzset{line width=1pt}| at the beginning of your
- document. This will not work since the line width is changed in many
- places. Instead, say
+ Note that you should not use |\tikzset| to set options directly. For
+ instance, if you want to use a line width of |1pt| by default, do not try
+ to say |\tikzset{line width=1pt}| at the beginning of your document. This
+ will not work since the line width is changed in many places. Instead, say
+ %
\begin{codeexample}[code only]
\tikzset{every picture/.style={line width=1pt}}
\end{codeexample}
- This will have the desired effect.
+ %
+ This will have the desired effect.
\end{environment}
In other \TeX\ formats, you should use the following commands instead:
\begin{plainenvironment}{{tikzpicture}\opt{\oarg{options}}}
- This is the plain \TeX\ version of the environment.
+ This is the plain \TeX\ version of the environment.
\end{plainenvironment}
\begin{contextenvironment}{{tikzpicture}\opt{\oarg{options}}}
- This is the Con\TeX t version of the environment.
+ This is the Con\TeX t version of the environment.
\end{contextenvironment}
\subsubsection{Creating a Picture Using a Command}
-The following command is an alternative to |{tikzpicture}| that is
-particular useful for graphics consisting of a single or few
-commands.
+The following command is an alternative to |{tikzpicture}| that is particular
+useful for graphics consisting of a single or few commands.
-\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).
+\begin{command}{\tikz\opt{\meta{animations spec}}\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).
+ 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).
- \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);}
- \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);
\end{command}
\subsubsection{Handling Catcodes and the Babel Package}
-Inside a \tikzname\ picture, most symbols need to have the category
-code 12 (normal text) in order to ensure that the parser works
-properly. This is typically not the case when packages like |babel|
-are used, which change catcodes aggressively.
+Inside a \tikzname\ picture, most symbols need to have the category code 12
+(normal text) in order to ensure that the parser works properly. This is
+typically not the case when packages like |babel| are used, which change
+catcodes aggressively.
-To solve this problem, \tikzname\ provides a small library also called
-|babel| (which can, however, also be used together with any other
-package that globally changes category codes). What it does is to
-reset the category codes at the beginning of every |{tikzpicture}| and
-to restore them at the beginning of every node. In almost all cases,
-this is exactly would you would expect and need, so I recommend to
-always load this library by saying |\usetikzlibrary{babel}|. For
-details on what, exactly, happens with the category codes, see
-Section~\ref{section-library-babel}.
+To solve this problem, \tikzname\ provides a small library also called |babel|
+(which can, however, also be used together with any other package that globally
+changes category codes). What it does is to reset the category codes at the
+beginning of every |{tikzpicture}| and to restore them at the beginning of
+every node. In almost all cases, this is exactly what you would expect and
+need, so I recommend to always load this library by saying
+|\usetikzlibrary{babel}|. For details on what, exactly, happens with the
+category codes, see Section~\ref{section-library-babel}.
\subsubsection{Adding a Background}
By default, pictures do not have any background, that is, they are
-``transparent'' on all parts on which you do not draw
-anything. You may instead wish to have a colored background behind
-your picture or a black frame around it or lines above and below it or
-some other kind of decoration.
+``transparent'' on all parts on which you do not draw anything. You may instead
+wish to have a colored background behind your picture or a black frame around
+it or lines above and below it or 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}.
+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}.
\subsection{Using Scopes to Structure a Picture}
-Inside a |{tikzpicture}| environment you can create scopes
-using the |{scope}| environment. This environment is available only
-inside the |{tikzpicture}| environment, so once more, there is little
-chance of doing anything wrong.
+Inside a |{tikzpicture}| environment you can create scopes using the |{scope}|
+environment. This environment is available only inside the |{tikzpicture}|
+environment, so once more, there is little chance of doing anything wrong.
-\subsubsection{The Scope Environment}
-\begin{environment}{{scope}\opt{\oarg{options}}}
- All \meta{options} are local to the \meta{environment
- contents}. Furthermore, the clipping path is also local to the
- environment, that is, any clipping done inside the environment
- ``ends'' at its end.
+\subsubsection{The Scope Environment}
+\begin{environment}{{scope}\opt{\meta{animations spec}}\opt{\oarg{options}}}
+ All \meta{options} are local to the \meta{environment contents}.
+ Furthermore, the clipping path is also local to the environment, that is,
+ any clipping done inside the environment ``ends'' at its end.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[ultra thick]
\begin{scope}[red]
@@ -313,50 +303,61 @@ chance of doing anything wrong.
\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.
- \end{stylekey}
-
- The following options are useful for scopes:
- \begin{key}{/tikz/execute at begin scope=\meta{code}}
- This option install some code that will be executed
- at the beginning of the scope. This option must be
- given in the argument of the |{scope}| environment.
-
- The effect applies only to the current scope, not to subscopes.
- \end{key}
- \begin{key}{/tikz/execute at end scope=\meta{code}}
- 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.
-
- Again, the effect applies only to the current scope, not to subscopes.
- \end{key}
+ \begin{key}{/tikz/name=\meta{scope name}}
+ Assigns a name to a scope reference in animations. The name is a
+ ``high-level'' name that drivers do not see, so you can use spaces,
+ number, letters, in a name, but you should \emph{not} use any
+ punctuation like a dot, a comma, or a colon.
+ \end{key}
+
+ The following style influences scopes:
+ %
+ \begin{stylekey}{/tikz/every scope (initially \normalfont empty)}
+ This style is installed at the beginning of every scope.
+ \end{stylekey}
+
+ The following options are useful for scopes:
+ %
+ \begin{key}{/tikz/execute at begin scope=\meta{code}}
+ This option install some code that will be executed at the beginning of
+ the scope. This option must be given in the argument of the |{scope}|
+ environment.
+
+ The effect applies only to the current scope, not to subscopes.
+ \end{key}
+
+ \begin{key}{/tikz/execute at end scope=\meta{code}}
+ 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.
+
+ Again, the effect applies only to the current scope, not to subscopes.
+ \end{key}
\end{environment}
-\begin{plainenvironment}{{scope}\opt{\oarg{options}}}
- Plain \TeX\ version of the environment.
+\begin{plainenvironment}{{scope}\opt{\meta{animations spec}}\opt{\oarg{options}}}
+ Plain \TeX\ version of the environment.
\end{plainenvironment}
-\begin{contextenvironment}{{scope}\opt{\oarg{options}}}
- Con\TeX t version of the environment.
+\begin{contextenvironment}{{scope}\opt{\meta{animations spec}}\opt{\oarg{options}}}
+ Con\TeX t version of the environment.
\end{contextenvironment}
\subsubsection{Shorthand for Scope Environments}
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.
+ This library defines a shorthand for starting and ending |{scope}|
+ 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
-a single brace, provided the single brace is followed by options in
-square brackets:
+When this library is loaded, the following happens: At certain places inside a
+\tikzname\ picture, it is allowed to start a scope just using a single brace,
+provided the single brace is followed by options in square brackets:
+%
\begin{codeexample}[]
\begin{tikzpicture}
{ [ultra thick]
@@ -374,68 +375,67 @@ square brackets:
\end{tikzpicture}
\end{codeexample}
-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.
+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.
-The ``certain places'' where an opening brace has this special meaning
-are the following: First, right after the semicolon that ends a path. Second,
-right after the end of a scope. Third, right at the beginning of a
-scope, which includes the beginning of a picture. Also note that some
-square bracket must follow, otherwise the brace is treated as a normal
-\TeX\ scope.
+The ``certain places'' where an opening brace has this special meaning are the
+following: First, right after the semicolon that ends a path. Second, right
+after the end of a scope. Third, right at the beginning of a scope, which
+includes the beginning of a picture. Also note that some square bracket must
+follow, otherwise the brace is treated as a normal \TeX\ scope.
\subsubsection{Single Command Scopes}
-In some situations it is useful to create a scope for a single
-command. For instance, when you wish to use algorithm graph drawing
-in order to layout a tree, the path of the tree needs to be surrounded
-by a scope whose only purpose is to take a key that selects a layout
-for the scope. Similarly, in order to put something on a background
-layer, a scope needs to be created. In such cases, where it will
-cumbersome to create a |\begin{scope}| and |\end{scope}| pair just for
-a single command, the |\scoped| command may be useful:
-
-\begin{command}{\scoped\opt{\oarg{options}}\meta{path command}}
- This command works like |\tikz|, only you can use it inside a
- |{tikzpicture}|. It will take the following \meta{path command} and
- put it inside a |{scope}| with the \meta{options} set. The
- \meta{path command} may either be a single command ended by a
- semicolon or it may contain multiple commands, but then they must be
- surrounded by curly braces.
- \begin{codeexample}[]
+In some situations it is useful to create a scope for a single command. For
+instance, when you wish to use algorithm graph drawing in order to layout a
+tree, the path of the tree needs to be surrounded by a scope whose only purpose
+is to take a key that selects a layout for the scope. Similarly, in order to
+put something on a background layer, a scope needs to be created. In such
+cases, where it will cumbersome to create a |\begin{scope}| and |\end{scope}|
+pair just for a single command, the |\scoped| command may be useful:
+
+\begin{command}{\scoped\opt{\meta{animations spec}}\opt{\oarg{options}}\meta{path command}}
+ This command works like |\tikz|, only you can use it inside a
+ |{tikzpicture}|. It will take the following \meta{path command} and
+ put it inside a |{scope}| with the \meta{options} set. The
+ \meta{path command} may either be a single command ended by a
+ semicolon or it may contain multiple commands, but then they must be
+ surrounded by curly braces.
+ %
+\begin{codeexample}[]
\begin{tikzpicture}
\node [fill=white] at (1,1) {Hello world};
\scoped [on background layer]
\draw (0,0) grid (3,2);
\end{tikzpicture}
- \end{codeexample}
+\end{codeexample}
+ %
\end{command}
\subsubsection{Using Scopes Inside Paths}
-The |\path| command, which is described in much more detail in later
-sections, also takes graphic options. These options are local to the
-path. Furthermore, it is possible to create local scopes within a
-path simply by using curly braces as in
+The |\path| command, which is described in much more detail in later sections,
+also takes graphic options. These options are local to the path. Furthermore,
+it is possible to create local scopes within a path simply by using curly
+braces as in
+%
\begin{codeexample}[]
\tikz \draw (0,0) -- (1,1)
{[rounded corners] -- (2,0) -- (3,1)}
-- (3,0) -- (2,1);
\end{codeexample}
-Note that many options apply only to the path as a whole and cannot be
-scoped in this way. For example, it is not possible to scope the
-|color| of the path. See the explanations in the section on paths for
-more details.
-
-Finally, certain elements that you specify in the argument to the
-|\path| command also take local options. For example, a node
-specification takes options. In this case, the options apply only to
-the node, not to the surrounding path.
+Note that many options apply only to the path as a whole and cannot be scoped
+in this way. For example, it is not possible to scope the |color| of the path.
+See the explanations in the section on paths for more details.
+Finally, certain elements that you specify in the argument to the |\path|
+command also take local options. For example, a node specification takes
+options. In this case, the options apply only to the node, not to the
+surrounding path.
\subsection{Using Graphic Options}
@@ -443,59 +443,56 @@ the node, not to the surrounding path.
\subsubsection{How Graphic Options Are Processed}
-Many commands and environments of \tikzname\ accept
-\emph{options}. These options are so-called \emph{key lists}. To
-process the options, the following command is used, which you can also
-call yourself. Note that it is usually better not to call this command
-directly, since this will ensure that the effect of options are local
-to a well-defined scope.
+Many commands and environments of \tikzname\ accept \emph{options}. These
+options are so-called \emph{key lists}. To process the options, the following
+command is used, which you can also call yourself. Note that it is usually
+better not to call this command directly, since this will ensure that the
+effect of options are local to a well-defined scope.
\begin{command}{\tikzset\marg{options}}
- This command will process the \meta{options} using the |\pgfkeys|
- command, documented in detail in Section~\ref{section-keys}, with
- the default path set to |/tikz|. Under normal circumstances, the
- \meta{options} will be lists of comma-separated pairs of the form
- \meta{key}|=|\meta{value}, but more fancy things can happen when you
- use the power of the |pgfkeys| mechanism, see
- Section~\ref{section-keys} once more.
-
- When a pair \meta{key}|=|\meta{value} is processed, the following
- happens:
- \begin{enumerate}
- \item If the \meta{key} is a full key (starts with a slash) it is
- handled directly as described in Section~\ref{section-keys}.
- \item Otherwise (which is usually the case), it is checked whether
- |/tikz/|\meta{key} is a key and, if so, it is executed.
- \item Otherwise, it is checked whether |/pgf/|\meta{key} is a key
- and, if so, it is executed.
- \item Otherwise, it is checked whether \meta{key} is a color and, if
- so, |color=|\meta{key} is executed.
- \item Otherwise, it is checked whether \meta{key} contains a dash
- and, if so, |arrows=|\meta{key} is executed.
- \item Otherwise, it is checked whether \meta{key} is the name of a
- shape and, if so, |shape=|\meta{key} is executed.
- \item Otherwise, an error message is printed.
- \end{enumerate}
-
- Note that by the above description, all keys starting with |/tikz|
- and also all keys starting with |/pgf| can be used as \meta{key}s in
- an \meta{options} list.
+ This command will process the \meta{options} using the |\pgfkeys| command,
+ documented in detail in Section~\ref{section-keys}, with the default path
+ set to |/tikz|. Under normal circumstances, the \meta{options} will be
+ lists of comma-separated pairs of the form \meta{key}|=|\meta{value}, but
+ more fancy things can happen when you use the power of the |pgfkeys|
+ mechanism, see Section~\ref{section-keys} once more.
+
+ When a pair \meta{key}|=|\meta{value} is processed, the following happens:
+ %
+ \begin{enumerate}
+ \item If the \meta{key} is a full key (starts with a slash) it is
+ handled directly as described in Section~\ref{section-keys}.
+ \item Otherwise (which is usually the case), it is checked whether
+ |/tikz/|\meta{key} is a key and, if so, it is executed.
+ \item Otherwise, it is checked whether |/pgf/|\meta{key} is a key
+ and, if so, it is executed.
+ \item Otherwise, it is checked whether \meta{key} is a color and, if
+ so, |color=|\meta{key} is executed.
+ \item Otherwise, it is checked whether \meta{key} contains a dash
+ and, if so, |arrows=|\meta{key} is executed.
+ \item Otherwise, it is checked whether \meta{key} is the name of a
+ shape and, if so, |shape=|\meta{key} is executed.
+ \item Otherwise, an error message is printed.
+ \end{enumerate}
+
+ Note that by the above description, all keys starting with |/tikz| and also
+ all keys starting with |/pgf| can be used as \meta{key}s in an
+ \meta{options} list.
\end{command}
\subsubsection{Using Styles to Manage How Pictures Look}
-There is a way of organizing sets of graphic options ``orthogonally''
-to the normal scoping mechanism. For example, you might wish all your
-``help lines'' to be drawn in a certain way like, say, gray and thin
-(do \emph{not} dash them, that distracts). For this, you can use
-\emph{styles}.
-
-A style is a key that, when used, causes a set of graphic options to
-be processed. Once a style has been defined, it can be used like any
-other key. For example, the predefined |help lines| style, which you
-should use for lines in the background like grid lines or construction
-lines.
+There is a way of organizing sets of graphic options ``orthogonally'' to the
+normal scoping mechanism. For example, you might wish all your ``help lines''
+to be drawn in a certain way like, say, gray and thin (do \emph{not} dash them,
+that distracts). For this, you can use \emph{styles}.
+
+A style is a key that, when used, causes a set of graphic options to be
+processed. Once a style has been defined, it can be used like any other key.
+For example, the predefined |help lines| style, which you should use for lines
+in the background like grid lines or construction lines.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) grid +(2,2);
@@ -503,21 +500,23 @@ lines.
\end{tikzpicture}
\end{codeexample}
-Defining styles is also done using options. Suppose we wish to define
-a style called |my style| and when this style is used, we want the
-draw color to be set to |red| and the fill color be set to
-|red!20|. To achieve this, we use the following option:
+Defining styles is also done using options. Suppose we wish to define a style
+called |my style| and when this style is used, we want the draw color to be set
+to |red| and the fill color be set to |red!20|. To achieve this, we use the
+following option:
+%
\begin{codeexample}[code only]
my style/.style={draw=red,fill=red!20}
\end{codeexample}
-The meaning of the curious |/.style| is the following: ``The key
-|my style| should not be used here but, rather, be defined. So, set up
-things such that using the key |my style| will, in the following, have
-the same effect as if we had written |draw=red,fill=red!20| instead.''
+The meaning of the curious |/.style| is the following: ``The key |my style|
+should not be used here but, rather, be defined. So, set up things such that
+using the key |my style| will, in the following, have the same effect as if we
+had written |draw=red,fill=red!20| instead.''
-Returning to the help lines example, suppose we prefer blue help
-lines. This could be achieved as follows:
+Returning to the help lines example, suppose we prefer blue help lines. This
+could be achieved as follows:
+%
\begin{codeexample}[]
\begin{tikzpicture}[help lines/.style={blue!50,very thin}]
\draw (0,0) grid +(2,2);
@@ -525,9 +524,10 @@ lines. This could be achieved as follows:
\end{tikzpicture}
\end{codeexample}
-Naturally, one of the main ideas behind styles is that they can be
-used in different pictures. In this case, we have to use the
-|\tikzset| command somewhere at the beginning.
+Naturally, one of the main ideas behind styles is that they can be 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}}
% ...
@@ -537,28 +537,29 @@ used in different pictures. In this case, we have to use the
\end{tikzpicture}
\end{codeexample}
-Since styles are just special cases of |pgfkeys|'s general style
-facility, you can actually do quite a bit more. Let us start with
-adding options to an already existing style. This is done using
-|/.append style| instead of |/.style|:
+Since styles are just special cases of |pgfkeys|'s general style facility, you
+can actually do quite a bit more. Let us start with adding options to an
+already existing style. This is done using |/.append style| instead of
+|/.style|:
+%
\begin{codeexample}[]
\begin{tikzpicture}[help lines/.append style=blue!50]
\draw (0,0) grid +(2,2);
\draw[help lines] (2,0) grid +(2,2);
\end{tikzpicture}
\end{codeexample}
+%
In the above example, the option |blue!50| is appended to the style
-|help lines|, which now has the same effect as
-|black!50,very thin,blue!50|. Note that two colors are set, so the
-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 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
-shows how this can be used.
-
+|help lines|, which now has the same effect as |black!50,very thin,blue!50|.
+Note that two colors are set, so the 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 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 shows how this can be used.
+%
\begin{codeexample}[]
\begin{tikzpicture}[outline/.style={draw=#1,thick,fill=#1!50}]
\node [outline=red] at (0,1) {red};
@@ -566,9 +567,9 @@ shows how this can be used.
\end{tikzpicture}
\end{codeexample}
-For parameterized styles you can also set a \emph{default} value using
-the |/.default| handler:
-
+For parameterized styles you can also set a \emph{default} value using the
+|/.default| handler:
+%
\begin{codeexample}[]
\begin{tikzpicture}[outline/.style={draw=#1,thick,fill=#1!50},
outline/.default=black]
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 612ca23d1c4..bce298b285a 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
@@ -7,124 +7,123 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\section{Nodes and Edges}
+\section{Nodes and Edges}
\label{section-nodes}
\subsection{Overview}
-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.
-
-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 just before or after
-the path has been drawn.
-
-In Section~\ref{section-nodes-basic} the basic syntax of the node
-operation is explained, followed in Section~\ref{section-nodes-multi}
-by the syntax for multi-part nodes, which are nodes that contain
-several different text parts. After this, the different options for
-the text in nodes are explained. In
-Section~\ref{section-nodes-anchors} the concept of \emph{anchors} is
-introduced along with their usage. In
-Section~\ref{section-nodes-transformations} the different ways
-transformations affect nodes are
-studied. Sections~\ref{section-nodes-placing-1}
-and~\ref{section-nodes-placing-2} are about placing nodes on or next
-to straight lines and curves.
-Section~\ref{section-nodes-connecting} explains 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.
+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.
+
+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
+just before or after the path has been drawn.
+
+In Section~\ref{section-nodes-basic} the basic syntax of the node operation is
+explained, followed in Section~\ref{section-nodes-multi} by the syntax for
+multi-part nodes, which are nodes that contain several different text parts.
+After this, the different options for the text in nodes are explained. In
+Section~\ref{section-nodes-anchors} the concept of \emph{anchors} is introduced
+along with their usage. In Section~\ref{section-nodes-transformations} the
+different ways transformations affect nodes are studied.
+Sections~\ref{section-nodes-placing-1} and~\ref{section-nodes-placing-2} are
+about placing nodes on or next to straight lines and curves.
+Section~\ref{section-nodes-connecting} explains 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.
\subsection{Nodes and Their Shapes}
-
\label{section-nodes-basic}
-In the simplest case, a node is just some text that is
-placed at some coordinate. However, a node can also have a border
-drawn around it or have a more complex background and
-foreground. Indeed, some nodes do not have a text at all, but consist
-solely of the background. You can name nodes so that you can reference
-their coordinates later in the same picture or, if certain precautions
-are taken as explained in Section~\ref{section-cross-picture-tikz},
+In the simplest case, a node is just some text that is placed at some
+coordinate. However, a node can also have a border drawn around it or have a
+more complex background and foreground. Indeed, some nodes do not have a text
+at all, but consist solely of the background. You can name nodes so that you
+can reference their coordinates later in the same picture or, if certain
+precautions are taken as explained in Section~\ref{section-cross-picture-tikz},
also in different pictures.
There are no special \TeX\ commands for adding a node to a picture; rather,
-there is path operation called |node| for this. Nodes are created
-whenever \tikzname\ encounters |node| or |coordinate| at a point on a
-path where it would expect a normal path operation (like |-- (1,1)| or
-|rectangle (1,1)|). It is also possible to give node specifications
-\emph{inside} certain path operations as explained later.
-
-The node operation is typically followed by some options, which apply
-only to the node. Then, you can optionally \emph{name} the node by
-providing a name in parentheses. Lastly, for the |node| operation you
-must provide some label text for the node in curly braces, while for
-the |coordinate| operation you may not. The node is placed at the
-current position of the path either \emph{after the path has been
- drawn} or (more seldomly and only if you add the |behind path|
-option) \emph{just before the path is drawn.} Thus, all nodes are
-drawn ``on top'' or ``behind'' the path and are retained until the
-path is complete. If there are several nodes on a path, perhaps some
-behind and some on top of the path, first come the nodes behind the
-path in the order they were encountered, then comes that path, and
-then come the remaining node, again in the order they are
-encountered.
-
+there is path operation called |node| for this. Nodes are created whenever
+\tikzname\ encounters |node| or |coordinate| at a point on a path where it
+would expect a normal path operation (like |-- (1,1)| or |rectangle (1,1)|). It
+is also possible to give node specifications \emph{inside} certain path
+operations as explained later.
+
+The node operation is typically followed by some options, which apply only to
+the node. Then, you can optionally \emph{name} the node by providing a name in
+parentheses. Lastly, for the |node| operation you must provide some label text
+for the node in curly braces, while for the |coordinate| operation you may not.
+The node is placed at the current position of the path either \emph{after the
+path has been drawn} or (more seldomly and only if you add the |behind path|
+option) \emph{just before the path is drawn.} Thus, all nodes are drawn ``on
+top'' or ``behind'' the path and are retained until the path is complete. If
+there are several nodes on a path, perhaps some behind and some on top of the
+path, first come the nodes behind the path in the order they were encountered,
+then comes that path, and then come the remaining node, again in the order they
+are encountered.
+%
\begin{codeexample}[]
\tikz \fill [fill=yellow!80!black]
- (0,0) node {first node}
+ (0,0) node {first node}
-- (1,1) node[behind path] {second node}
-- (2,0) node {third node};
\end{codeexample}
+
\subsubsection{Syntax of the Node Command}
The syntax for specifying nodes is the following:
-\begin{pathoperation}{node}{\opt{\meta{foreach statements}}%
- \opt{|[|\meta{options}|]|}\opt{|(|\meta{name}|)|}%
- \opt{|at(|\meta{coordinate}|)|}\opt{\marg{node contents}}}
- Since this path operation is one of the most involved around, let us
- go over it step by step.
-
- \medskip
- \textbf{Order of the parts of the specification.}
- Everything between ``|node|'' and the opening brace of a node is
- optional. If there are \meta{foreach statements}, they must come
- first, directly following ``|node|.'' Other than that, the ordering
- of all the other elements of a node specification (the
- \meta{options}, the \meta{name}, and \meta{coordinate}) is
- arbitrary, indeed, there can be multiple occurrences of any of these
- elements (although only for options this makes much sense).
-
- \medskip
- \textbf{The text of a node.}
- At the end of a node, you must (normally) provide some \meta{node contents}
- in curly braces; indeed, the ``end'' of the node specification is
- detected by the opening curly brace. For normal nodes it is possible to use
- ``fragile'' stuff inside the \meta{node contents} like the |\verb|
- command (for the technically savvy: code inside the \meta{node
- contents} is allowed to change catcodes; however, this rule does
- not apply to ``nodes on a path'' to be discussed later).
-
- Instead of giving \meta{node contents} at the end of the node in
- curly braces, you can also use the following key:
- \begin{key}{/tikz/node contents=\meta{node contents}}
+%
+\begin{pathoperation}{node}{
+ \opt{\meta{foreach statements}}
+ \opt{|[|\meta{options}|]|}
+ \opt{|(|\meta{name}|)|}
+ \opt{|at(|\meta{coordinate}|)|}
+ \opt{|:|\meta{animation attribute}|=|\marg{options}}
+ \opt{\marg{node contents}}%
+}
+ Since this path operation is one of the most involved around, let us go
+ over it step by step.
+
+ \medskip
+ \textbf{Order of the parts of the specification.}
+ Everything between ``|node|'' and the opening brace of a node is optional.
+ If there are \meta{foreach statements}, they must come first, directly
+ following ``|node|''. Other than that, the ordering of all the other
+ elements of a node specification (the \meta{options}, the \meta{name},
+ \meta{coordinate}, and \meta{animation attribute}) is arbitrary, indeed,
+ there can be multiple occurrences of any of these elements (although for
+ the name and the coordinate this makes no sense).
+
+ \medskip
+ \textbf{The text of a node.}
+ At the end of a node, you must (normally) provide some \meta{node contents}
+ in curly braces; indeed, the ``end'' of the node specification is detected
+ by the opening curly brace. For normal nodes it is possible to use
+ ``fragile'' stuff inside the \meta{node contents} like the |\verb| command
+ (for the technically savvy: code inside the \meta{node contents} is allowed
+ to change catcodes; however, this rule does not apply to ``nodes on a
+ path'' to be discussed later).
+
+ Instead of giving \meta{node contents} at the end of the node in curly
+ braces, you can also use the following key:
+ %
+ \begin{key}{/tikz/node contents=\meta{node contents}}
\label{option-node-contents}%
- This key sets the contents of the node to the given text as if
- you had given it at the end in curly braces. When the option is
- used inside the options of a node, the parsing of the node stops
- immediately after the end of the option block. In particular, the
- option block cannot be followed by further option blocks or curly
- braces (or, rather, these do not count as part of the node
- specification.) Also note that the \meta{node contents} may not
- contain fragile stuff since the catcodes get fixed upon reading
- the options. Here is an example:
+ This key sets the contents of the node to the given text as if you had
+ given it at the end in curly braces. When the option is used inside the
+ options of a node, the parsing of the node stops immediately after the
+ end of the option block. In particular, the option block cannot be
+ followed by further option blocks or curly braces (or, rather, these do
+ not count as part of the node specification.) Also note that the
+ \meta{node contents} may not contain fragile stuff since the catcodes
+ get fixed upon reading the options. Here is an example:
+ %
\begin{codeexample}[]
\tikz {
\path (0,0) node [red] {A}
@@ -133,38 +132,38 @@ The syntax for specifying nodes is the following:
(3,0) node [node contents=D] ;
}
\end{codeexample}
+ %
\end{key}
- \medskip
- \textbf{Specifying the location of the node.}
- Nodes are placed at the last position mentioned on the path. The
- effect of adding ``|at|'' to a node
- specification is that the coordinate given after |at| is used
- instead. The |at| syntax is not available when a node is given
- inside a path operation (it would not make any sense there).
-
- \begin{key}{/tikz/at=\meta{coordinate}}
- 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.
- \end{key}
-
- Another aspect of the ``location'' of a node is whether it appears
- \emph{in front of} or \emph{behind} the current path. You can change
- which of these two possibilities happens on a node-by-node basis
- using the following keys:
- \begin{key}{/tikz/behind path}
- When this key is set, either as a local option for the node or
- some surrounding scope, the node will be drawn behind the current
- path. For this, \tikzname\ collects all nodes defined on the
- current path with this option set and then inserts all of them, in
- the order they appear, just before it draws the path. Thus,
- several nodes with this option set may obscure one anther, but
- never the path itself. ``Just before it draws the path'' actually
- means that the nodes are inserted into the page output just before
- any pre-actions are applied to the path (see below for what
- pre-actions are).
+ \medskip
+ \textbf{Specifying the location of the node.}
+ Nodes are placed at the last position mentioned on the path. The effect of
+ adding ``|at|'' to a node specification is that the coordinate given after
+ |at| is used instead. The |at| syntax is not available when a node is given
+ inside a path operation (it would not make any sense there).
+
+ \begin{key}{/tikz/at=\meta{coordinate}}
+ 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.
+ \end{key}
+
+ Another aspect of the ``location'' of a node is whether it appears \emph{in
+ front of} or \emph{behind} the current path. You can change which of these
+ two possibilities happens on a node-by-node basis using the following keys:
+ %
+ \begin{key}{/tikz/behind path}
+ When this key is set, either as a local option for the node or some
+ surrounding scope, the node will be drawn behind the current path. For
+ this, \tikzname\ collects all nodes defined on the current path with
+ this option set and then inserts all of them, in the order they appear,
+ just before it draws the path. Thus, several nodes with this option set
+ may obscure one another, but never the path itself. ``Just before it
+ draws the path'' actually means that the nodes are inserted into the
+ page output just before any pre-actions are applied to the path (see
+ below for what pre-actions are).
+ %
\begin{codeexample}[]
\tikz \fill [fill=blue!50, draw=blue, very thick]
(0,0) node [behind path, fill=red!50] {first node}
@@ -172,59 +171,59 @@ The syntax for specifying nodes is the following:
-- (1.5,1) node [behind path, fill=brown!50] {third node}
-- (0,1) node [ fill=blue!30] {fourth node};
\end{codeexample}
-
- Note that |behind path| only applies to the current path; not to
- the current scope or picture. To put a node ``behind everything''
- you need to use layers and options like |on background layer|, see
- the background library in Section~\ref{section-tikz-backgrounds}.
- \end{key}
-
- \begin{key}{/tikz/in front of path}
- This is the opposite of |behind path|: It causes nodes to be drawn
- on top of the path. Since this is the default behaviour, you
- usually do not need this option; it is only needed when an
- enclosing scope has used |behind path| and you now wish to
- ``switch back'' to the normal behaviour.
- \end{key}
-
- \medskip
- \textbf{The name of a node.}
- 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.
-
- \begin{key}{/tikz/name=\meta{node name}}
- Assigns a name to the node for later reference. Since this is a
- ``high-level'' name (drivers never know of it), you can use spaces,
- number, letters, or whatever you like when naming a node. Thus, you
- 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.
- \end{key}
-
- \begin{key}{/tikz/alias=\meta{another node name}}
- This option allows you to provide another name for the
- node. Giving this option multiple times will allow you to access
- the node via several aliases. Using the |node also| syntax,
- you can also assign an alias name to a node at a later point, see
- Section~\ref{section-node-also}.
- \end{key}
-
- \medskip
- \textbf{The options of a node.}
- The \meta{options} is an optional list of options that \emph{apply
- only to the node} and have no effect outside. The other way round,
- most ``outside'' options also apply to the node, but not all. For
- example, the ``outside'' rotation does not apply to nodes (unless some
- special options are used, sigh). Also, the outside path action, like
- |draw| or |fill|, never applies to the node and must be given in the
- node (unless some special other options are used, deep sigh).
-
- \medskip
- \textbf{The shape of a node.}
- As mentioned before, we can add a border and even a background to a
- node:
+
+ Note that |behind path| only applies to the current path; not to the
+ current scope or picture. To put a node ``behind everything'' you need
+ to use layers and options like |on background layer|, see the
+ background library in Section~\ref{section-tikz-backgrounds}.
+ \end{key}
+
+ \begin{key}{/tikz/in front of path}
+ This is the opposite of |behind path|: It causes nodes to be drawn on
+ top of the path. Since this is the default behaviour, you usually do
+ not need this option; it is only needed when an enclosing scope has
+ used |behind path| and you now wish to ``switch back'' to the normal
+ behaviour.
+ \end{key}
+
+ \medskip
+ \textbf{The name of a node.}
+ 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.
+
+ \begin{key}{/tikz/name=\meta{node name}}
+ Assigns a name to the node for later reference. Since this is a
+ ``high-level'' name (drivers never know of it), you can use spaces,
+ number, letters, or whatever you like when naming a node. Thus, you 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.
+ \end{key}
+
+ \begin{key}{/tikz/alias=\meta{another node name}}
+ This option allows you to provide another name for the node. Giving
+ this option multiple times will allow you to access the node via
+ several aliases. Using the |node also| syntax, you can also assign an
+ alias name to a node at a later point, see
+ Section~\ref{section-node-also}.
+ \end{key}
+
+ \medskip
+ \textbf{The options of a node.}
+ The \meta{options} is an optional list of options that \emph{apply only to
+ the node} and have no effect outside. The other way round, most ``outside''
+ options also apply to the node, but not all. For example, the ``outside''
+ rotation does not apply to nodes (unless some special options are used,
+ sigh). Also, the outside path action, like |draw| or |fill|, never applies
+ to the node and must be given in the node (unless some special other
+ options are used, deep sigh).
+
+ \medskip
+ \textbf{The shape of a node.}
+ As mentioned before, we can add a border and even a background to a node:
+ %
\begin{codeexample}[]
\tikz \fill[fill=yellow!80!black]
(0,0) node {first node}
@@ -232,12 +231,12 @@ The syntax for specifying nodes is the following:
-- (0,2) node[fill=red!20,draw,double,rounded corners] {third node};
\end{codeexample}
- 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 one of the
- |shapes.geometric| library for the latter shape):
-
+ 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 one of the
+ |shapes.geometric| library for the latter shape):
+ %
\begin{codeexample}[]
\tikz \fill[fill=yellow!80!black]
(0,0) node {first node}
@@ -245,73 +244,98 @@ The syntax for specifying nodes is the following:
-- (0,2) node[circle,fill=red!20] {third node};
\end{codeexample}
- There are many more shapes available such as, say, a shape for a
- resistor or a large arrow, see the |shapes| library in
- Section~\ref{section-libs-shapes} for details.
-
- To select the shape of a node, the following option is used:
- \begin{key}{/tikz/shape=\meta{shape name} (initially rectangle)}
- Select the shape either of the current node or, when this option is
- not given inside a node but somewhere outside, the shape of all
- nodes in the current scope.%
- \indexoption{\meta{shape name}}
-
- Since this option is used often, you can leave out the
- |shape=|. When \tikzname\ encounters an option like |circle|
- that it does not know, it will, after everything else has failed,
- 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|,
- |circle|, |coordinate|. Details of these shapes, like their anchors
- and size options, are discussed in Section~\ref{section-the-shapes}.
- \end{key}
-
- \medskip
- \textbf{The foreach statement for nodes.}
- At the beginning of a node specification (and only there) you can provide multiple
- \meta{foreach statements}, each of which has the form |foreach| \meta{var}
- |in| |{|\meta{list}|}| (note that there is no slash before
- |foreach|). When they are given, instead of a single node, multiple
- nodes will be created: The \meta{var} will iterate over all values
- of \meta{list} and for each of them, a new node is created. These
- nodes are all created using all the text following the \meta{foreach
- statements}, but in each copy the \meta{var} will have the current
- value of the current element in the \meta{list}.
-
- As an example, the following two codes have the same effect:
+ There are many more shapes available such as, say, a shape for a resistor
+ or a large arrow, see the |shapes| library in
+ Section~\ref{section-libs-shapes} for details.
+
+ To select the shape of a node, the following option is used:
+ %
+ \begin{key}{/tikz/shape=\meta{shape name} (initially rectangle)}
+ Select the shape either of the current node or, when this option is not
+ given inside a node but somewhere outside, the shape of all nodes in
+ the current scope.%
+ \indexoption{\meta{shape name}}
+
+ Since this option is used often, you can leave out the |shape=|. When
+ \tikzname\ encounters an option like |circle| that it does not know, it
+ will, after everything else has failed, 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|, |circle|,
+ |coordinate|. Details of these shapes, like their anchors and size
+ options, are discussed in Section~\ref{section-the-shapes}.
+ \end{key}
+
+ \medskip
+ \textbf{Animating a node.}
+ When you say |:|\meta{animation attribute}|={|\meta{options}|}|, an
+ \emph{animation} of the specified attribute is added to the node.
+ Animations are discussed in detail in
+ Section~\ref{section-tikz-animations}. Here is a typical example of how
+ this syntax can be used:
+ %
+\begin{codeexample}[animation list={0.5,1,1.5,2}]
+\tikz
+ \node :fill opacity = { 0s="1", 2s="0", begin on=click }
+ :rotate = { 0s="0", 2s="90", begin on=click }
+ [fill = blue!20, draw = blue, ultra thick, circle]
+ {Click me!};
+\end{codeexample}
+
+ \medskip
+ \textbf{The foreach statement for nodes.}
+ At the beginning of a node specification (and only there) you can provide
+ multiple \meta{foreach statements}, each of which has the form |foreach|
+ \meta{var} |in| |{|\meta{list}|}| (note that there is no slash before
+ |foreach|). When they are given, instead of a single node, multiple nodes
+ will be created: The \meta{var} will iterate over all values of \meta{list}
+ and for each of them, a new node is created. These nodes are all created
+ using all the text following the \meta{foreach statements}, but in each
+ copy the \meta{var} will have the current value of the current element in
+ the \meta{list}.
+
+ As an example, the following two codes have the same effect:
+ %
\begin{codeexample}[]
\tikz \draw (0,0) node foreach \x in {1,2,3} at (\x,0) {\x};
\end{codeexample}
\begin{codeexample}[]
\tikz \draw (0,0) node at (1,0) {1} node at (2,0) {2} node at (3,0) {3};
\end{codeexample}
- When you provide several |foreach| statements, they work like
- ``nested loops'':
+%
+ When you provide several |foreach| statements, they work like ``nested
+ loops'':
+ %
\begin{codeexample}[]
\tikz \node foreach \x in {1,...,4} foreach \y in {1,2,3}
[draw] at (\x,\y) {\x,\y};
\end{codeexample}
- As the example shows, a \meta{list} can contain ellipses (three
- dots) to indicated that a larger number of numbers is meant. Indeed,
- you can use the full power of the |\foreach| command here, including
- multiple parameters and options, see Section~\ref{section-foreach}.
+ %
+ As the example shows, a \meta{list} can contain ellipses (three dots) to
+ indicated that a larger number of numbers is meant. Indeed, you can use the
+ full power of the |\foreach| command here, including multiple parameters
+ and options, see Section~\ref{section-foreach}.
- \medskip
- \textbf{Styles for nodes.}
- The following styles influence how nodes are rendered:
- \begin{stylekey}{/tikz/every node (initially \normalfont empty)}
- This style is installed at the beginning of every node.
+ \medskip
+ \textbf{Styles for nodes.}
+ The following styles influence how nodes are rendered:
+ %
+ \begin{stylekey}{/tikz/every node (initially \normalfont empty)}
+ 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};
\end{tikzpicture}
\end{codeexample}
- \end{stylekey}
- \begin{stylekey}{/tikz/every \meta{shape} node (initially \normalfont empty)}
- These styles are installed at the beginning of a node of a given
- \meta{shape}. For example, |every rectangle node| is used for
- rectangle nodes, and so on.
+ \end{stylekey}
+ %
+ \begin{stylekey}{/tikz/every \meta{shape} node (initially \normalfont empty)}
+ These styles are installed at the beginning of a node of a given
+ \meta{shape}. For example, |every rectangle node| is used for rectangle
+ nodes, and so on.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[every rectangle node/.style={draw},
@@ -319,24 +343,47 @@ The syntax for specifying nodes is the following:
\draw (0,0) node[rectangle] {A} -- (1,1) node[circle] {B};
\end{tikzpicture}
\end{codeexample}
- \end{stylekey}
-
- \medskip
- \textbf{Name scopes.}
- It turns out that the name of a node can further be influenced using
- two keys:
- \begin{key}{/tikz/name prefix=\meta{text} (initially \normalfont empty)}
- The value of this key is prefixed to every node inside the
- current scope. This includes both the naming of the node (via
- the |name| key or via the implicit |(|\meta{name}|)| syntax) as
- well as any referencing of the node. Outside the scope,
- the nodes can (and need to) be referenced using ``full name''
- consisting of the prefix and the node name.
-
- The net effect of this is that you can set the name prefix at
- the beginning of a scope to some value and then use short and
- simple names for the nodes inside the scope. Later, outside the
- scope, you can reference the nodes via their full name:
+ \end{stylekey}
+
+ \begin{key}{/tikz/execute at begin node=\meta{code}}
+ This option causes \meta{code} to be executed at the beginning of a
+ node. Using this option multiple times will cause the code to
+ accumulate.
+ \end{key}
+
+ \begin{key}{/tikz/execute at end node=\meta{code}}
+ This option installs \meta{code} that will be executed at the end of
+ the node. Using this option multiple times will cause the code to
+ accumulate.
+ %
+\begin{codeexample}[]
+\begin{tikzpicture}
+ [execute at begin node={A},
+ execute at end node={D}]
+ \node[execute at begin node={B}] {C};
+\end{tikzpicture}
+\end{codeexample}
+ %
+ \end{key}
+
+ \medskip
+ \textbf{Name scopes.}
+ It turns out that the name of a node can further be influenced using two
+ keys:
+ %
+ \begin{key}{/tikz/name prefix=\meta{text} (initially \normalfont empty)}
+ The value of this key is prefixed to every node inside the current
+ scope. This includes both the naming of the node (via the |name| key or
+ via the implicit |(|\meta{name}|)| syntax) as well as any referencing
+ of the node. Outside the scope, the nodes can (and need to) be
+ referenced using ``full name'' consisting of the prefix and the node
+ name.
+
+ The net effect of this is that you can set the name prefix at the
+ beginning of a scope to some value and then use short and simple names
+ for the nodes inside the scope. Later, outside the scope, you can
+ reference the nodes via their full name:
+ %
\begin{codeexample}[]
\tikz {
\begin{scope}[name prefix = top-]
@@ -349,68 +396,67 @@ The syntax for specifying nodes is the following:
\node (B) at (1,0) {B};
\draw (A) -- (B);
\end{scope}
-
- \draw [red] (top-A) -- (bottom-B);
+
+ \draw [red] (top-A) -- (bottom-B);
}
\end{codeexample}
- As can be seen, name prefixing makes it easy to write
- ``recycable'' code.
- \end{key}
- \begin{key}{/tikz/name suffix=\meta{text} (initially \normalfont empty)}
- Works as |name prefix|, only the \meta{text} is appended to
- every node name in the current scope.
- \end{key}
+ %
+ As can be seen, name prefixing makes it easy to write reusable code.
+ \end{key}
+ %
+ \begin{key}{/tikz/name suffix=\meta{text} (initially \normalfont empty)}
+ Works as |name prefix|, only the \meta{text} is appended to every node
+ name in the current scope.
+ \end{key}
\end{pathoperation}
There is a special syntax for specifying ``light-weight'' nodes:
\begin{pathoperation}{coordinate}{\opt{|[|\meta{options}|]|}|(|\meta{name}|)|\opt{|at(|\meta{coordinate}|)|}}
- This has the same effect as
+ This has the same effect as
- |\node[shape=coordinate]|\verb|[|\meta{options}|](|\meta{name}|)at(|\meta{coordinate}|){}|,
+ |\node[shape=coordinate]|\verb|[|\meta{options}|](|\meta{name}|)at(|\meta{coordinate}|){}|,
- where the |at| part may be omitted.
+ where the |at| part may be omitted.
\end{pathoperation}
-Since nodes are often the only path operation on paths, there are two
-special commands for creating paths containing only a node:
+Since nodes are often the only path operation on paths, there are two special
+commands for creating paths containing only a node:
\begin{command}{\node}
- Inside |{tikzpicture}| this is an abbreviation for |\path node|.
+ Inside |{tikzpicture}| this is an abbreviation for |\path node|.
\end{command}
\begin{command}{\coordinate}
- Inside |{tikzpicture}| this is an abbreviation for |\path coordinate|.
+ Inside |{tikzpicture}| this is an abbreviation for |\path coordinate|.
\end{command}
\subsubsection{Predefined Shapes}
-
\label{section-nodes-predefined}
-
\label{section-the-shapes}
-\pgfname\ and \tikzname\ define three shapes, by default:
+\pgfname\ \todosp{why two labels for the same point? The first doesn't seem to
+be used anywhere} and \tikzname\ define three shapes, by default:
+%
\begin{itemize}
-\item
- |rectangle|,
-\item
- |circle|, and
-\item
- |coordinate|.
+ \item |rectangle|,
+ \item |circle|, and
+ \item |coordinate|.
\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.
-
-\label{section-tikz-coordinate-shape}
-The |coordinate| shape is handled in a special way by \tikzname. When
-a node |x| whose shape is |coordinate| is used as a coordinate |(x)|,
-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:
+%
+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.
+
+\label{section-tikz-coordinate-shape}%
+The |coordinate| shape is handled in a special way by \tikzname. When a node
+|x| whose shape is |coordinate| is used as a coordinate |(x)|, 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:
+%
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={draw}]
\path[yshift=1.5cm,shape=rectangle]
@@ -426,29 +472,25 @@ demonstrates the difference:
\end{codeexample}
-
\subsubsection{Common Options: Separations, Margins, Padding and
- Border Rotation}
-
+ Border Rotation}
\label{section-shape-seps}
\label{section-shape-common-options}
-The exact behaviour of shapes differs, shapes defined for more
-special purposes (like a, say, transistor shape) will have even more
-custom behaviors. However, there are some options that apply to most
-shapes:
+The \todosp{why two labels for the same point?} exact behaviour of shapes
+differs, shapes defined for more special purposes (like a, say, transistor
+shape) will have even more custom behaviors. However, there are some options
+that apply to most shapes:
\begin{key}{/pgf/inner sep=\meta{dimension} (initially .3333em)}
- \keyalias{tikz}
- An additional (invisible) separation space of \meta{dimension} will
- be added inside the shape, between the text and the shape's
- background path. The effect is as if you had added appropriate
- horizontal and vertical skips at the beginning and end of the text
- to make it a bit ``larger.''
-
- For those familiar with \textsc{css}, this is the same as
- \emph{padding}.
+ \keyalias{tikz}
+ An additional (invisible) separation space of \meta{dimension} will be
+ added inside the shape, between the text and the shape's background path.
+ The effect is as if you had added appropriate horizontal and vertical skips
+ at the beginning and end of the text to make it a bit ``larger''.
+ For those familiar with \textsc{css}, this is the same as \emph{padding}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) node[inner sep=0pt,draw] {tight}
@@ -456,31 +498,31 @@ shapes:
(0cm,4em) node[fill=yellow!80!black] {default};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/pgf/inner xsep=\meta{dimension} (initially .3333em)}
- \keyalias{tikz}
- Specifies the inner separation in the $x$-direction, only.
+ \keyalias{tikz}
+ Specifies the inner separation in the $x$-direction, only.
\end{key}
\begin{key}{/pgf/inner ysep=\meta{dimension} (initially .3333em)}
- \keyalias{tikz}
- Specifies the inner separation in the $y$-direction, only.
+ \keyalias{tikz}
+ Specifies the inner separation in the $y$-direction, only.
\end{key}
\begin{key}{/pgf/outer sep=\meta{dimension or ``auto''}}
- \keyalias{tikz}
- This option adds an additional (invisible) separation space of
- \meta{dimension} outside the background path. The main effect of
- this option is that all anchors will move a little ``to the
- outside.''
+ \keyalias{tikz}
+ This option adds an additional (invisible) separation space of
+ \meta{dimension} outside the background path. The main effect of this
+ option is that all anchors will move a little ``to the outside''.
- For those familiar with \textsc{css}, this is same as \emph{margin}.
+ For those familiar with \textsc{css}, this is same as \emph{margin}.
- The default for this option is half the line width. When the default
- is used and when the background path is draw, the anchors will lie
- exactly on the ``outside border'' of the path (not on the path
- itself).
+ The default for this option is half the line width. When the default is
+ used and when the background path is draw, the anchors will lie exactly on
+ the ``outside border'' of the path (not on the path itself).
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[line width=5pt]
@@ -493,30 +535,29 @@ shapes:
\draw[->] (1,-1) -- (s);
\end{tikzpicture}
\end{codeexample}
-
- As the above example demonstrates, the standard settings for the
- outer sep are not always ``correct.'' First, when a shape is filled,
- but not drawn, the outer sep should actually be |0|. Second, when a
- node is scaled, for instance by a factor of 5, the outer separation
- also gets scaled by a factor of 5, while the line width stays at its
- original width; again causing problems.
-
- In such cases, you can say |outer sep=auto| to make \tikzname\
- \emph{try} to compensate for the effects described above. This is
- done by, firstly, setting the outer sep to |0| when no drawing is
- done and, secondly, setting the outer separations to half the line
- width (as before) times two adjustment factors, one for the
- horizontal separations and one for the vertical
- separations (see Section~\ref{section-adjustment-transformations}
- for details on these factors). Note, however, that these factors can
- compensate only for transformations that are either scalings plus
- rotations or scalings with different magnitudes in the horizontal
- and the vertical direction. If you apply slanting, the factors will
- only approximate the correct values.
-
- In general, it is a good idea to say |outer sep=auto| at some early
- stage. It is not the default mainly for compatibility with earlier
- versions.
+
+ As the above example demonstrates, the standard settings for the outer sep
+ are not always ``correct''. First, when a shape is filled, but not drawn,
+ the outer sep should actually be |0|. Second, when a node is scaled, for
+ instance by a factor of 5, the outer separation also gets scaled by a
+ factor of 5, while the line width stays at its original width; again
+ causing problems.
+
+ In such cases, you can say |outer sep=auto| to make \tikzname\ \emph{try}
+ to compensate for the effects described above. This is done by, firstly,
+ setting the outer sep to |0| when no drawing is done and, secondly, setting
+ the outer separations to half the line width (as before) times two
+ adjustment factors, one for the horizontal separations and one for the
+ vertical separations (see Section~\ref{section-adjustment-transformations}
+ for details on these factors). Note, however, that these factors can
+ compensate only for transformations that are either scalings plus rotations
+ or scalings with different magnitudes in the horizontal and the vertical
+ direction. If you apply slanting, the factors will only approximate the
+ correct values.
+
+ In general, it is a good idea to say |outer sep=auto| at some early stage.
+ It is not the default mainly for compatibility with earlier versions.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[outer sep=auto]
\draw[line width=5pt]
@@ -529,140 +570,137 @@ shapes:
\draw[->] (1,-1) -- (s);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\begin{key}{/pgf/outer xsep=\meta{dimension} (initially .5\string\pgflinewidth)}
- \keyalias{tikz}
- Specifies the outer separation in the $x$-direction, only. This
- value will be overwritten when |outer sep| is set, either to the
- value given there or a computed value in case of |auto|.
+ \keyalias{tikz}
+ Specifies the outer separation in the $x$-direction, only. This value will
+ be overwritten when |outer sep| is set, either to the value given there or
+ a computed value in case of |auto|.
\end{key}
\begin{key}{/pgf/outer ysep=\meta{dimension} (initially .5\string\pgflinewidth)}
- \keyalias{tikz}
- Specifies the outer separation in the $y$-direction, only.
+ \keyalias{tikz}
+ Specifies the outer separation in the $y$-direction, only.
\end{key}
-
\begin{key}{/pgf/minimum height=\meta{dimension} (initially 0pt)}
- \keyalias{tikz}
- 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
- appropriately. However, if the text is already larger than
- \meta{dimension}, the shape will not be shrunk.
+ \keyalias{tikz}
+ 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 appropriately. However, if the
+ text is already larger than \meta{dimension}, the shape will not be shrunk.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) node[minimum height=1cm,draw] {1cm}
(2,0) node[minimum height=0cm,draw] {0cm};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/pgf/minimum width=\meta{dimension} (initially 0pt)}
- \keyalias{tikz}
- Same as |minimum height|, only for the width.
+ \keyalias{tikz}
+ Same as |minimum height|, only for the width.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) node[minimum height=2cm,minimum width=3cm,draw] {$3 \times 2$};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/pgf/minimum size=\meta{dimension}}
- \keyalias{tikz}
- Sets both the minimum height and width at the same time.
+ \keyalias{tikz}
+ Sets both the minimum height and width at the same time.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) node[minimum size=2cm,draw] {square};
\draw (0,-2) node[minimum size=2cm,draw,circle] {circle};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/pgf/shape aspect=\meta{aspect ratio}}
- \keyalias{tikz}
- Sets a desired aspect ratio for the shape. For the |diamond| shape,
- this option sets the ratio between width and height of the shape.
+ \keyalias{tikz}
+ Sets a desired aspect ratio for the shape. For the |diamond| shape, this
+ option sets the ratio between width and height of the shape.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) node[shape aspect=1,diamond,draw] {aspect 1};
\draw (0,-2) node[shape aspect=2,diamond,draw] {aspect 2};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-\label{section-rotating-shape-borders}
+ \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
-node contents, but \emph{in addition} to any other transformations.
-
+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,
- inner sep=1pt, draw]
+\tikzset{every node/.style={dart, shape border uses incircle,
+ inner sep=1pt, draw}}
\tikz \node foreach \a/\b/\c in {A/0/0, B/45/0, C/0/45, D/45/45}
[shape border rotate=\b, rotate=\c] at (\b/36,-\c/36) {\a};
\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 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
-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
-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.
-
-\begin{codeexample}[]
-\tikzstyle{every node}=[isosceles triangle, draw]
+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 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 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.
+%
+\begin{codeexample}[]
+\tikzset{every node/.style={isosceles triangle, draw}}
\begin{tikzpicture}
\node {abc};
\node [shape border uses incircle] at (2,0) {abc};
\end{tikzpicture}
\end{codeexample}
-There are \pgfname{} keys that 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
- incircle. If no value is given \meta{boolean} will take the default
- value |true|.
-\end{key}
+There are \pgfname{} keys that 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 incircle. If
+ no value is given \meta{boolean} will take the default value |true|.
+\end{key}
\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
- 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.
+ \keyalias{tikz}
+ Rotates the border of a shape independently of the node contents, 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.
\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
-other anchors do:
-
+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}[]
-\tikzstyle{every node}=[shape=trapezium, draw, shape border uses incircle]
+\tikzset{every node/.style={shape=trapezium, draw, shape border uses incircle}}
\begin{tikzpicture}
\node at (0,0) (A) {A};
\node [shape border rotate=30] at (1.5,0) (B) {B};
@@ -674,42 +712,36 @@ 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.
\subsection{Multi-Part Nodes}
-
\label{section-nodes-multi}
-Most nodes just have a single simple text label. However, nodes of a
-more complicated shape might be made up from several \emph{node
- parts}. For example, in automata theory a so-called Moore state has
-a state name, drawn in the upper part of the state circle, and an
-output text, drawn in the lower part of the state circle. These two
-parts are quite independent. Similarly, a \textsc{uml} class shape
-would have a name part, a method part, and an attributes
-part. Different molecule shapes might use parts for the different atoms
-to be drawn at the different positions, and so on.
-
-Both \pgfname\ and \tikzname\ support such multipart nodes. On the
-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:
+Most nodes just have a single simple text label. However, nodes of a more
+complicated shape might be made up from several \emph{node parts}. For example,
+in automata theory a so-called Moore state has a state name, drawn in the upper
+part of the state circle, and an output text, drawn in the lower part of the
+state circle. These two parts are quite independent. Similarly, a \textsc{uml}
+class shape would have a name part, a method part, and an attributes part.
+Different molecule shapes might use parts for the different atoms to be drawn
+at the different positions, and so on.
-\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. The \meta{options}
- will be local to this part.
+Both \pgfname\ and \tikzname\ support such multipart nodes. On the 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\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. The \meta{options} will be local to this part.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node [circle split,draw,double,fill=red!20]
@@ -723,36 +755,36 @@ different node parts by using the following command:
\end{tikzpicture}
\end{codeexample}
- You will have to lookup which parts are defined by a shape.
+ You will have to lookup which parts are defined by a shape.
- The following styles influences node parts:
- \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}.
+ The following styles influences node parts:
+ %
+ \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}.
+ %
\begin{codeexample}[]
\tikz [every lower node part/.style={red}]
\node [circle split,draw] {$q_1$ \nodepart{lower} $00$};
\end{codeexample}
- \end{stylekey}
+ \end{stylekey}
\end{command}
-
\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 specifically
-set the color used for text using the following option:
+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 specifically set the color used for text
+using the following option:
\begin{key}{/tikz/text=\meta{color}}
- Sets the color to be used for text labels. A |color=| option
- will immediately override this option.
+ Sets the color to be used for text labels. A |color=| option will
+ immediately override this option.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[red] (0,0) -- +(1,1) node[above] {red};
@@ -760,46 +792,52 @@ set the color used for text using the following option:
\draw (2,0) -- +(1,1) node[above,red] {red};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-Just like the color itself, you may also wish to set the opacity of
-the text only. For this, use the |text opacity| option, which
-is detailed in Section~\ref{section-tikz-transparency}.
+Just like the color itself, you may also wish to set the opacity of the text
+only. For this, use the |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. Naturally,
-you can just use a font command like |\small| or |\rm| at the
-beginning of a node. However, the following two options make it easier
-to set the font used in nodes on a general basis. Let us start with:
+Next, you may wish to adjust the font used for the text. Naturally, you can
+just use a font command like |\small| or |\rm| at the beginning of a node.
+However, the following two options make it easier to set the font used in nodes
+on a general basis. Let us start with:
\begin{key}{/tikz/node font=\meta{font commands}}
- This option sets the font used for all text used in a node.
+ This option sets the font used for all text used in a node.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[node font=\itshape] (1,0) -- +(1,1) node[above] {italic};
\end{tikzpicture}
\end{codeexample}
- Since the \meta{font commands} are executed at a very early stage in
- the construction of the node, the font selected using this command
- will also dictate the values of dimensions defined in terms of |em|
- or |ex|. For instance, when the |minimum height| of a node is |3em|,
- the actual height will be (at least) three times the line distance
- selected by the \meta{font commands}:
+ %
+ Since the \meta{font commands} are executed at a very early stage in the
+ construction of the node, the font selected using this command will also
+ dictate the values of dimensions defined in terms of |em| or |ex|. For
+ instance, when the |minimum height| of a node is |3em|, the actual height
+ will be (at least) three times the line distance selected by the \meta{font
+ commands}:
\begin{codeexample}[]
\tikz \node [node font=\tiny, minimum height=3em, draw] {tiny};
\tikz \node [node font=\small, minimum height=3em, draw] {small};
\end{codeexample}
+ %
\end{key}
The other font command is:
-
+%
\begin{key}{/tikz/font=\meta{font commands}}
- Sets the font used for the text inside nodes. However, this font
- will \emph{not} (yet) be installed when any of the dimensions of the
- node are being computed, so dimensions like |1em| will be with
- respect to the font used outside the node (usually the font that was
- in force when the picture started).
+ Sets the font used for the text inside nodes. However, this font will
+ \emph{not} (yet) be installed when any of the dimensions of the node are
+ being computed, so dimensions like |1em| will be with respect to the font
+ used outside the node (usually the font that was in force when the picture
+ started).
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node [font=\itshape] {italic};
@@ -811,34 +849,35 @@ The other font command is:
\tikz \node [font=\small, minimum height=3em, draw] {small};
\end{codeexample}
- A useful example of how the |font| option can be used is the
- following:
-
+ A useful example of how the |font| option can be used is the following:
+ %
\begin{codeexample}[]
\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}
- As can be seen, the font can be changed for each node part. This
- does \emph{not} work with the |node font| command since, as the name
- suggests, this command can only be used to select the ``overall''
- font for the node and this is done very early.
+ As can be seen, the font can be changed for each node part. This does
+ \emph{not} work with the |node font| command since, as the name suggests,
+ this command can only be used to select the ``overall'' font for the node
+ and this is done very early.
\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 put in one long line (in an |\hbox|, to be precise) and the node
-will become as wide as necessary.
+Normally, when a node is typeset, all the text you give in the braces is put in
+one long line (in an |\hbox|, to be precise) and the node will become as wide
+as necessary.
-From time to time you may wish to create nodes that contain multiple
-lines of text. There are three different ways of achieving this:
+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:
+ \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}[width=5cm]
\tikz \node [draw] {
\begin{tabular}{cc}
@@ -847,119 +886,134 @@ lines of text. There are three different ways of achieving this:
\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.
+ %
+ 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.
+ %
+ The |\\| command takes an optional extra space as an argument in square
+ brackets.
+ %
\begin{codeexample}[]
\tikz \node[fill=yellow!80!black,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.
+ %
+ \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
- (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 (|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|.
+ This option will put the text of a node in a box of the given width
+ (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
+ (|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=yellow!80!black,text width=3cm]
{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.
+ %
+ Setting \meta{dimension} to an empty string causes the automatic line
+ breaking to be disabled.
\end{key}
\begin{key}{/tikz/align=\meta{alignment option}}
- This key is used to set up 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{alignment option}. 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{alignment option} and the resulting node's width
- will be minimal to encompass the resulting lines.
-
- In detail, you can set \meta{alignment option} 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.
+ This key is used to set up 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{alignment option}. 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{alignment option} and the resulting node's
+ width will be minimal to encompass the resulting lines.
+
+ In detail, you can set \meta{alignment option} 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 \node[fill=yellow!80!black,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:
+ %
+ For alignment with line breaking, the same will happen only the
+ lines will now, additionally, be broken automatically:
+ %
\begin{codeexample}[]
\tikz \node[fill=yellow!80!black,text width=3cm,align=left]
{This is a demonstration text for showing how line breaking works.};
\end{codeexample}
-
- \item[|align=|\declare{\texttt{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.
+ %
+ \item[|align=|\declare{\texttt{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 \node[fill=yellow!80!black,text width=3cm,align=flush left]
{This is a demonstration text for showing how line breaking works.};
\end{codeexample}
-
- \item[|align=|\declare{|right|}]
- Works like |left|, only for right alignment.
+ %
+ \item[|align=|\declare{|right|}] Works like |left|, only for right
+ alignment.
+ %
\begin{codeexample}[]
\tikz \node[fill=yellow!80!black,align=right]
{This is a\\ demonstration text for\\ alignments.};
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \node[fill=yellow!80!black,text width=3cm,align=right]
{This is a demonstration text for showing how line breaking works.};
\end{codeexample}
-
- \item[|align=|\declare{\texttt{flush right}}]
- Works like |flush left|, only for right alignment.
+ %
+ \item[|align=|\declare{\texttt{flush right}}] Works like |flush left|,
+ only for right alignment.
+ %
\begin{codeexample}[]
\tikz \node[fill=yellow!80!black,text width=3cm,align=flush right]
{This is a demonstration text for showing how line breaking works.};
\end{codeexample}
-
- \item[|align=|\declare{|center|}]
- Works like |left| or |right|, only for centered alignment.
+ %
+ \item[|align=|\declare{|center|}] Works like |left| or |right|, only
+ for centered alignment.
+ %
\begin{codeexample}[]
\tikz \node[fill=yellow!80!black,align=center]
{This is a\\ demonstration text for\\ alignments.};
@@ -969,44 +1023,41 @@ Let us now first have a look at the |text width| command.
{This is a demonstration text for showing how line breaking works.};
\end{codeexample}
- There is one annoying problem with the |center|
- alignment (but not with |flush center| and the other options): If
- you specify a large line width and the node text
- fits on a single line and is, in fact, much shorter than the
- specified |text width|, an underfull horizontal box will
- result. Unfortunately, this cannot be avoided, due to the way
- \TeX\ works (more precisely, I have thought long and hard about this
- and have not been able to figure out a sensible way to avoid this).
- For this reason, \tikzname\ switches off horizontal badness
- warnings inside boxes with |align=center|. Since this will also
- suppress some ``wanted'' warnings, there is also an option for
- switching the warnings on once more:
-
- \begin{key}{/tikz/badness warnings for centered text=\meta{true or
- false} (initially false)}
- If set to true, normal badness warnings will be issued for
- centered boxes. Note that you may get annoying warnings for
- perfectly normal boxes, namely whenever the box is very large
- and the contents is not long enough to fill the box
- sufficiently.
- \end{key}
-
- \item[|align=|\declare{\texttt{flush center}}]
- Works like |flush left| or |flush right|, only for center
- alignment. Because of all the trouble that results from the
- |center| option in conjunction with narrow lines, I suggest picking
- this option rather than |center| \emph{unless} you have longer
- text, in which case |center| will give the typographically better
- results.
+ There is one annoying problem with the |center| alignment (but not
+ with |flush center| and the other options): If you specify a large
+ line width and the node text fits on a single line and is, in fact,
+ much shorter than the specified |text width|, an underfull
+ horizontal box will result. Unfortunately, this cannot be avoided,
+ due to the way \TeX\ works (more precisely, I have thought long and
+ hard about this and have not been able to figure out a sensible way
+ to avoid this). For this reason, \tikzname\ switches off horizontal
+ badness warnings inside boxes with |align=center|. Since this will
+ also suppress some ``wanted'' warnings, there is also an option for
+ switching the warnings on once more:
+ %
+ \begin{key}{/tikz/badness warnings for centered text=\meta{true or false} (initially false)}
+ If set to true, normal badness warnings will be issued for
+ centered boxes. Note that you may get annoying warnings for
+ perfectly normal boxes, namely whenever the box is very large
+ and the contents is not long enough to fill the box
+ sufficiently.
+ \end{key}
+ \item[|align=|\declare{\texttt{flush center}}] Works like |flush left|
+ or |flush right|, only for center alignment. Because of all the
+ trouble that results from the |center| option in conjunction with
+ narrow lines, I suggest picking this option rather than |center|
+ \emph{unless} you have longer text, in which case |center| will
+ give the typographically better results.
+ %
\begin{codeexample}[]
\tikz \node[fill=yellow!80!black,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 rather broad nodes.
+ %
+ \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 rather broad nodes.
{%
\hbadness=10000
\begin{codeexample}[]
@@ -1014,130 +1065,124 @@ Let us now first have a look at the |text width| command.
{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}
+ 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{macro storing a 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{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{macro storing a 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|
+ %
+ 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.
+ 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.
+ 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.
+ 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
-node is at least the given height (this option is described in more
-detail later). Second, you can use the option |text height|, which
-sets the height of the text itself, more precisely, of the \TeX\ text
-box of the text. Note that the |text height| typically is not the
-height of the shape's box: In addition to the |text height|, an
-internal |inner sep| is added as extra space and the text depth is
-also taken into account.
+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 node is at least
+the given height (this option is described in more detail later). Second, you
+can use the option |text height|, which sets the height of the text itself,
+more precisely, of the \TeX\ text box of the text. Note that the |text height|
+typically is not the height of the shape's box: In addition to the
+|text height|, an internal |inner sep| is added as extra space and the text
+depth is also taken into account.
-I recommend using |minimum size| instead of |text height| except for
-special situations.
+I recommend using |minimum size| instead of |text height| except for special
+situations.
\begin{key}{/tikz/text height=\meta{dimension}}
- Sets the height of the text boxes in shapes. Thus, when you write
- something like |node {text}|, the |text| is first typeset, resulting
- in some box of a certain height. This height is then replaced by the
- height |text height|. The resulting box is then used to determine
- the size of the shape, which will typically be larger. When you
- write |text height=| without specifying anything, the ``natural''
- size of the text box remains unchanged.
+ Sets the height of the text boxes in shapes. Thus, when you write something
+ like |node {text}|, the |text| is first typeset, resulting in some box of a
+ certain height. This height is then replaced by the height |text height|.
+ The resulting box is then used to determine the size of the shape, which
+ will typically be larger. When you 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};
\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.
+ 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.
\end{key}
-
\subsection{Positioning Nodes}
-
\label{section-nodes-anchors}
When you place a node at some coordinate, the node is centered on this
-coordinate by default. This is often undesirable and it would be
-better to have the node to the right or above the actual coordinate.
+coordinate by default. This is often undesirable and it would be better to have
+the node to the right or above the actual coordinate.
\subsubsection{Positioning Nodes Using Anchors}
-\pgfname\ uses a so-called anchoring mechanism to give you a very fine
-control over the placement. The idea is simple: Imagine a node of
-rectangular shape of a certain size. \pgfname\ defines numerous anchor
-positions in the shape. For example to upper right corner is called,
-well, not ``upper right anchor,'' but the |north east| anchor of the
-shape. The center of the shape has an anchor called |center| on top of
-it, and so on. Here are some examples (a complete list is given in
-Section~\ref{section-the-shapes}).
+\pgfname\ uses a so-called anchoring mechanism to give you a very fine control
+over the placement. The idea is simple: Imagine a node of rectangular shape of
+a certain size. \pgfname\ defines numerous anchor positions in the shape. For
+example to upper right corner is called, well, not ``upper right anchor'', but
+the |north east| anchor of the shape. The center of the shape has an anchor
+called |center| on top of it, and so on. Here are some examples (a complete
+list is given in Section~\ref{section-the-shapes}).
\medskip\noindent
\begin{tikzpicture}
@@ -1150,37 +1195,35 @@ Section~\ref{section-the-shapes}).
(x.base) circle (2pt) node[below] {|base|};
\end{tikzpicture}
-Now, when you place a node at a certain coordinate, you can ask \tikzname\
-to place the node shifted around in such a way that a certain
-anchor is at the coordinate. In the following example, we ask \tikzname\
-to shift the first node such that its |north east| anchor is at
-coordinate |(0,0)| and that the |west| anchor of the second node is at
-coordinate |(1,1)|.
-
+Now, when you place a node at a certain coordinate, you can ask \tikzname\ to
+place the node shifted around in such a way that a certain anchor is at the
+coordinate. In the following example, we ask \tikzname\ to shift the first node
+such that its |north east| anchor is at coordinate |(0,0)| and that the |west|
+anchor of the second node is at coordinate |(1,1)|.
+%
\begin{codeexample}[]
\tikz \draw (0,0) node[anchor=north east] {first node}
rectangle (1,1) node[anchor=west] {second node};
\end{codeexample}
-Since the default anchor is |center|, the default behaviour is to
-shift the node in such a way that it is centered on the current
-position.
+Since the default anchor is |center|, the default behaviour is to shift the
+node in such a way that it is centered on the current position.
\begin{key}{/tikz/anchor=\meta{anchor name}}
- Causes the node to be shifted such that it's anchor \meta{anchor
- name} lies on the current coordinate.
+ Causes the node to be shifted such that it's anchor \meta{anchor name} lies
+ on the current coordinate.
- The only anchor that is present in all shapes is |center|. However,
- most shapes will at least define anchors in all ``compass
- 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 only anchor that is present in all shapes is |center|. However, most
+ shapes will at least define anchors in all ``compass 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
- multiple nodes that have different heights and depth. Here is an
- example:
+ 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 multiple
+ nodes that have different heights and depth. Here is an example:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[scale=3,transform shape]
% First, center alignment -> wobbles
@@ -1191,71 +1234,76 @@ position.
\draw[anchor=mid] (0,0) node{x} -- (0.5,0) node{y} -- (1,0) node{t};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\subsubsection{Basic Placement Options}
-Unfortunately, while perfectly logical, it is often rather
-counter-intuitive that in order to place a node \emph{above} a given
-point, you need to specify the |south| anchor. For this reason, there
-are some useful options that allow you to select the standard anchors
-more intuitively:
+Unfortunately, while perfectly logical, it is often rather counter-intuitive
+that in order to place a node \emph{above} a given point, you need to specify
+the |south| anchor. For this reason, there are some useful options that allow
+you to select the standard anchors 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}.
+ Does the same as |anchor=south|. If the \meta{offset} is specified, the
+ node is additionally shifted upwards by the given \meta{offset}.
+ %
\begin{codeexample}[]
\tikz \fill (0,0) circle (2pt) node[above] {above};
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz \fill (0,0) circle (2pt) node[above=2pt] {above};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/below=\meta{offset} (default 0pt)}
- Similar to |above|.
+ Similar to |above|.
\end{key}
\begin{key}{/tikz/left=\meta{offset} (default 0pt)}
- Similar to |above|.
+ Similar to |above|.
\end{key}
\begin{key}{/tikz/right=\meta{offset} (default 0pt)}
- Similar to |above|.
+ Similar to |above|.
\end{key}
\begin{key}{/tikz/above left}
- Does the same as |anchor=south east|. Note that giving both |above|
- and |left| options does not have the same effect as |above left|,
- rather only the last |left| ``wins.'' Actually, this option also
- 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.)
+ Does the same as |anchor=south east|. Note that giving both |above| and
+ |left| options does not have the same effect as |above left|, rather only
+ the last |left| ``wins''. Actually, this option also 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.)
+ %
\begin{codeexample}[]
\tikz \fill (0,0) circle (2pt) node[above left] {above left};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/above right}
- Similar to |above left|.
+ Similar to |above left|.
+ %
\begin{codeexample}[]
\tikz \fill (0,0) circle (2pt) node[above right] {above right};
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/below left}
- Similar to |above left|.
+ Similar to |above left|.
\end{key}
+
\begin{key}{/tikz/below right}
- Similar to |above left|.
+ Similar to |above left|.
\end{key}
\begin{key}{/tikz/centered}
- A shorthand for |anchor=center|.
+ A shorthand for |anchor=center|.
\end{key}
% A second set of options behaves similarly, namely the |above of|,
@@ -1278,13 +1326,13 @@ more intuitively:
% \end{tikzpicture}
% \end{codeexample}
% \end{key}
-
+%
% \begin{key}{/tikz/above left of=\meta{node}}
% Works like |above of|, only the node is now put above and left. The
% |node distance| is the Euclidean distance between the two nodes, not
% the $L_1$-distance.
% \end{key}
-
+%
% \begin{key}{/tikz/above right of=\meta{node}}
% Works similarly.
% \end{key}
@@ -1310,48 +1358,50 @@ more intuitively:
% \end{key}
-
\subsubsection{Advanced Placement Options}
While the standard placement options suffice for simple cases, the
|positioning| library offers more convenient placement options.
\begin{tikzlibrary}{positioning}
- The library defines additional options for placing nodes
- conveniently. It also redefines the standard options like |above| so
- that they give you better control of node placement.
+ The library defines additional options for placing nodes conveniently. It
+ also redefines the standard options like |above| so that they give you
+ better control of node placement.
\end{tikzlibrary}
When this library is loaded, the options like |above| or |above left| behave
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 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
- \meta{of-part}. Let us start with the \meta{shifting part}, which
- can have three forms:
- \begin{enumerate}
- \item It can simply be a \declare{\meta{dimension}} (or a mathematical
- expression that evaluates to a dimension) like |2cm| or
- |3cm/2+4cm|. In this case, the following happens: the node's
- anchor is set to |south| and the node is vertically shifted
- upwards by \meta{dimension}.
+ With the |positioning| library loaded, the |above| option does not 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 \meta{of-part}. Let us start with the
+ \meta{shifting part}, which can have three forms:
+ %
+ \begin{enumerate}
+ \item It can simply be a \declare{\meta{dimension}} (or a mathematical
+ expression that evaluates to a dimension) like |2cm| or
+ |3cm/2+4cm|. In this case, the following happens: the node's anchor
+ is set to |south| and the node is vertically shifted upwards by
+ \meta{dimension}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (2,2);
\node at (1,1) [above=2pt+3pt,draw] {above};
\end{tikzpicture}
\end{codeexample}
- This use of the |above| option is the same as if the |positioning|
- library were not loaded.
- \item It can be a \declare{\meta{number}} (that is, any mathematical
- expression that does not include a unit like |pt| or
- |cm|). Examples are |2| or |3+sin(60)|. In this case, the anchor
- is also set to |south| and the node is vertically shifted by
- the vertical component of the coordinate |(0,|\meta{number}|)|.
+ %
+ This use of the |above| option is the same as if the |positioning|
+ library were not loaded.
+ \item It can be a \declare{\meta{number}} (that is, any mathematical
+ expression that does not include a unit like |pt| or |cm|).
+ Examples are |2| or |3+sin(60)|. In this case, the anchor is also
+ set to |south| and the node is vertically shifted by the vertical
+ component of the coordinate |(0,|\meta{number}|)|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (2,2);
@@ -1359,19 +1409,21 @@ differently.
% south border of the node is now 2mm above (1,1)
\end{tikzpicture}
\end{codeexample}
- \item It can be of the form \declare{\meta{number or
- dimension 1}| and |\meta{number or dimension 2}}. This specification
- does not make particular sense for the |above| option, it is much
- more useful for options like |above left|. The reason it is
- allowed for the |above| option is that it is sometimes
- automatically used, as explained later.
-
- The effect of this option is the following. First, the point
- |(|\meta{number or dimension 2}|,|\meta{number or dimension 1}|)|
- is computed (note the inversed order), using the normal rules for
- evaluating such a coordinate, yielding some position. Then, the
- node is shifted by the vertical component of this point. The
- anchor is set to |south|.
+ %
+ \item It can be of the form
+ \declare{\meta{number or dimension 1}| and |\meta{number or dimension 2}}.
+ This specification does not make particular sense for the |above|
+ option, it is much more useful for options like |above left|. The
+ reason it is allowed for the |above| option is that it is sometimes
+ automatically used, as explained later.
+
+ The effect of this option is the following. First, the point
+ |(|\meta{number or dimension 2}|,|\meta{number or dimension 1}|)|
+ is computed (note the inverted order), using the normal rules for
+ evaluating such a coordinate, yielding some position. Then, the
+ node is shifted by the vertical component of this point. The anchor
+ is set to |south|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (2,2);
@@ -1379,19 +1431,22 @@ differently.
% south border of the node is also 2mm above (1,1)
\end{tikzpicture}
\end{codeexample}
- \end{enumerate}
- The \meta{shifting part} can optionally be followed by a
- \meta{of-part}, which has one of the following forms:
- \begin{enumerate}
- \item The \meta{of-part} can be \declareandlabel{of}| |\meta{coordinate},
- where \meta{coordinate} is \emph{not} in parentheses and it is
- \emph{not} just a node name. An example would be
- |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|.
-
- Here is a basic example:
+ \end{enumerate}
+ %
+ The \meta{shifting part} can optionally be followed by a \meta{of-part},
+ which has one of the following forms:
+ %
+ \begin{enumerate}
+ \item The \meta{of-part} can be
+ \declareandlabel{of}| |\meta{coordinate}, where \meta{coordinate} is
+ \emph{not} in parentheses and it is \emph{not} just a node name. An
+ example would be |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|.
+
+ Here is a basic example:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style=draw]
\draw[help lines] (0,0) grid (2,2);
@@ -1401,26 +1456,30 @@ differently.
\node [above=1cm of somenode.north] {\tiny 1cm of somenode.north};
\end{tikzpicture}
\end{codeexample}
- As can be seen the |above=5mm of somenode.north east| option does,
- indeed, place the node 5mm above the north east anchor of
- |somenode|. The same effect could have been achieved writing
- |above=5mm| followed by |at=(somenode.north east)|.
-
- If the \meta{shifting-part} is missing, the shift is not zero, but
- rather the value of the |node distance| key is used, see below.
- \item The \meta{of-part} can be |of |\meta{node name}. An
- example would be |of somenode|. In this case, the following
- 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|.
- \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
- \meta{node name}'s north border is exactly the given distance.
+ %
+ As can be seen the |above=5mm of somenode.north east| option does,
+ indeed, place the node 5mm above the north east anchor of
+ |somenode|. The same effect could have been achieved writing
+ |above=5mm| followed by |at=(somenode.north east)|.
+
+ If the \meta{shifting-part} is missing, the shift is not zero, but
+ rather the value of the |node distance| key is used, see below.
+ \item The \meta{of-part} can be |of |\meta{node name}. An example would
+ be |of somenode|. In this case, the following 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|.
+ \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 \meta{node
+ name}'s north border is exactly the given distance.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style=draw]
\draw[help lines] (0,0) grid (2,2);
@@ -1432,19 +1491,23 @@ differently.
node [midway,right,draw=none] {1cm};
\end{tikzpicture}
\end{codeexample}
- It is possible to change the behaviour of this
- \meta{specification} rather drastically, using the following key:
- \begin{key}{/tikz/on grid=\meta{boolean} (initially false)}
- When this key is set to |true|, an \meta{of-part} of the
- current form behaves differently: The anchors set for the
- current node as well as the anchor used for the other \meta{node name} are set to |center|.
-
- This has the following effect: When you say
- |above=1cm of somenode| with |on grid| set to true, the new node
- 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.
+ %
+ It is possible to change the behaviour of this \meta{specification}
+ rather drastically, using the following key:
+ %
+ \begin{key}{/tikz/on grid=\meta{boolean} (initially false)}
+ When this key is set to |true|, an \meta{of-part} of the
+ current form behaves differently: The anchors set for the
+ current node as well as the anchor used for the other
+ \meta{node name} are set to |center|.
+
+ This has the following effect: When you say
+ |above=1cm of somenode| with |on grid| set to true, the new
+ node 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style=draw]
\draw[help lines] (0,0) grid (2,3);
@@ -1460,13 +1523,13 @@ differently.
\node (c2) [on grid,above=1cm of b2] {a};
\end{tikzpicture}
\end{codeexample}
- \end{key}
- \end{enumerate}
+ \end{key}
+ \end{enumerate}
- \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}.
+ \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}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style=draw,node distance=5mm]
\draw[help lines] (0,0) grid (2,3);
@@ -1484,51 +1547,54 @@ differently.
\end{scope}
\end{tikzpicture}
\end{codeexample}
- \end{key}
+ \end{key}
\end{key}
\begin{key}{/tikz/below=\opt{\meta{specification}}}
- This key is redefined in the same manner as |above|.
+ This key is redefined in the same manner as |above|.
\end{key}
\begin{key}{/tikz/left=\opt{\meta{specification}}}
- This key is redefined in the same manner as |above|, only all
- vertical shifts are replaced by horizontal shifts.
+ This key is redefined in the same manner as |above|, only all vertical
+ shifts are replaced by horizontal shifts.
\end{key}
\begin{key}{/tikz/right=\opt{\meta{specification}}}
- This key is redefined in the same manner as |left|.
+ This key is redefined in the same manner as |left|.
\end{key}
\begin{key}{/tikz/above left=\opt{\meta{specification}}}
- This key is also redefined in a manner similar to the above, but
- behaviour of the \meta{shifting part} is more complicated:
- \begin{enumerate}
- \item When the \meta{shifting part} is of the form \meta{number or
- dimension}| and |\meta{number or dimension}, it has
- (essentially) the effect of shifting the node vertically upwards
- by the first \meta{number or dimension} and to the left by the
- second. To be more precise, the coordinate |(|\meta{second number
- or dimension}|,|\meta{first number or dimension}|)| is computed
- and then the node is shifted vertically by the $y$-part of
- the resulting coordinate and horizontally be the negated $x$-part
- of the result. (This is exactly what you expect, except possibly
- when you have used the |x| and |y| options to modify the
- |xy|-coordinate system so that the unit vectors no longer point
- in the expected directions.)
- \item When the \meta{shifting part} is of the form \meta{number or
- dimension}, the node is shifted by this \meta{number or
- dimension} in the direction of $135^\circ$. This means that
- there is a difference between a \meta{shifting part} of |1cm| and
- of |1cm and 1cm|: In the second case, the node is shifted by 1cm
- upward and 1cm to the left; in the first case it is shifted by
- $\frac{1}{2}\sqrt{2}$cm upward and by the same amount to the
- 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.
- \end{enumerate}
- The following example should help to illustrate the difference:
+ This key is also redefined in a manner similar to the above, but behaviour
+ of the \meta{shifting part} is more complicated:
+ %
+ \begin{enumerate}
+ \item When the \meta{shifting part} is of the form
+ \meta{number or dimension}| and |\meta{number or dimension}, it has
+ (essentially) the effect of shifting the node vertically upwards by
+ the first \meta{number or dimension} and to the left by the second.
+ To be more precise, the coordinate |(|\meta{second number or
+ dimension}|,|\meta{first number or dimension}|)| is computed and
+ then the node is shifted vertically by the $y$-part of the
+ resulting coordinate and horizontally be the negated $x$-part of
+ the result. (This is exactly what you expect, except possibly when
+ you have used the |x| and |y| options to modify the |xy|-coordinate
+ system so that the unit vectors no longer point in the expected
+ directions.)
+ \item When the \meta{shifting part} is of the form \meta{number or
+ dimension}, the node is shifted by this \meta{number or dimension}
+ in the direction of $135^\circ$. This means that there is a
+ difference between a \meta{shifting part} of |1cm| and of
+ |1cm and 1cm|: In the second case, the node is shifted by 1cm
+ upward and 1cm to the left; in the first case it is shifted by
+ $\frac{1}{2}\sqrt{2}$cm upward and by the same amount to the 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.
+ \end{enumerate}
+ %
+ The following example should help to illustrate the difference:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={draw,circle}]
\draw[help lines] (0,0) grid (2,5);
@@ -1548,6 +1614,7 @@ differently.
\end{scope}
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={draw,rectangle}]
\draw[help lines] (0,0) grid (2,5);
@@ -1567,6 +1634,7 @@ differently.
\end{scope}
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={draw,rectangle},on grid]
\draw[help lines] (0,0) grid (4,4);
@@ -1586,27 +1654,31 @@ differently.
\end{scope}
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/below left=\opt{\meta{specification}}}
- Works similar to |above left|.
+ Works similar to |above left|.
\end{key}
+
\begin{key}{/tikz/above right=\opt{\meta{specification}}}
- Works similar to |above left|.
+ Works similar to |above left|.
\end{key}
+
\begin{key}{/tikz/below right=\opt{\meta{specification}}}
- Works similar to |above left|.
+ Works similar to |above left|.
\end{key}
-The |positioning| package also introduces the following new placement
-keys:
+The |positioning| package also introduces the following new placement keys:
+%
\begin{key}{/tikz/base left=\opt{\meta{specification}}}
- This key works like the |left| key, only instead of the |east| anchor,
- the |base east| anchor is used and, when the second form of an
- \meta{of-part} is used, the corresponding |base west| anchor.
+ This key works like the |left| key, only instead of the |east| anchor, the
+ |base east| anchor is used and, when the second form of an \meta{of-part}
+ is used, the corresponding |base west| anchor.
- This key is useful for chaining together nodes so that their base
- lines are aligned.
+ This key is useful for chaining together nodes so that their base lines are
+ aligned.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[node distance=1ex]
\draw[help lines] (0,0) grid (3,1);
@@ -1620,50 +1692,48 @@ keys:
\node (y) [base right=of a] {y};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
+
\begin{key}{/tikz/base right=\opt{\meta{specification}}}
- Works like |base left|.
+ Works like |base left|.
\end{key}
\begin{key}{/tikz/mid left=\opt{\meta{specification}}}
- Works like |base left|, but with |mid east| and |mid west| anchors
- instead of |base east| and |base west|.
+ Works like |base left|, but with |mid east| and |mid west| anchors instead
+ of |base east| and |base west|.
\end{key}
+
\begin{key}{/tikz/mid right=\opt{\meta{specification}}}
- Works like |mid left|.
+ Works like |mid left|.
\end{key}
-
-
\subsubsection{Advanced Arrangements of Nodes}
-The simple |above| and |right| options may not always suffice for
-arranging a large number of nodes. For such situations \tikzname\
-offers libraries that make positioning easier: The |graphdrawing|
-library and the |matrix| library. These libraries for positioning
-nodes are described in two separate Sections~\ref{section-matrices}
-and~\ref{section-intro-gd}.
+The simple |above| and |right| options may not always suffice for arranging a
+large number of nodes. For such situations \tikzname\ offers libraries that
+make positioning easier: The |graphdrawing| library and the |matrix| library.
+These libraries for positioning nodes are described in two separate
+Sections~\ref{section-matrices} and~\ref{section-intro-gd}.
\subsection{Fitting Nodes to a Set of Coordinates}
-
\label{section-nodes-fitting}
-It is sometimes desirable that the size and position of a node is not
-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 and, afterwards, parts of the
-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 the details. The idea is
-that you may give the |fit| option to a node. The |fit| option expects
-a list of coordinates (one after the other without commas) as its
-parameter. The effect will be that the node's text area has exactly
-the necessary size so that it contains all the given coordinates. Here
-is an example:
-
+It is sometimes desirable that the size and position of a node is not 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
+and, afterwards, parts of the 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 the details. The idea is that you may
+give the |fit| option to a node. The |fit| option expects a list of coordinates
+(one after the other without commas) as its parameter. The effect will be that
+the node's text area has exactly the necessary size so that it contains all the
+given coordinates. Here is an example:
+%
\begin{codeexample}[]
\begin{tikzpicture}[level distance=8mm]
\node (root) {root}
@@ -1678,9 +1748,9 @@ is an example:
\end{tikzpicture}
\end{codeexample}
-If you want to fill the fitted node you will usually have to place it
-on a background layer.
-
+If you want to fill the fitted node you will usually have to place it on a
+background layer.
+%
\begin{codeexample}[]
\begin{tikzpicture}[level distance=8mm]
\node (root) {root}
@@ -1697,32 +1767,31 @@ on a background layer.
\end{tikzpicture}
\end{codeexample}
-\subsection{Transformations}
+\subsection{Transformations}
\label{section-nodes-transformations}
+It is possible to transform nodes, but, by default, transformations do not
+apply to nodes. The reason is that you usually do \emph{not} want your text to
+be scaled or rotated even if the main graphic is transformed. Scaling text is
+evil, rotating slightly less so.
-It is possible to transform nodes, but, by default, transformations do
-not apply to nodes. The reason is that you usually do \emph{not} want
-your text to be scaled or rotated even if the main graphic is
-transformed. Scaling text is evil, rotating slightly less so.
-
-However, sometimes you \emph{do} wish to transform a node, for
-example, it certainly sometimes makes sense to rotate a node by
-90 degrees. There are two ways to achieve this:
-
+However, sometimes you \emph{do} wish to transform a node, for example, it
+certainly sometimes makes sense to rotate a node by 90 degrees. There are two
+ways to achieve this:
+%
\begin{enumerate}
-\item
- You can use the following option:
- \begin{key}{/tikz/transform shape}
- Causes the current ``external'' transformation matrix to be
- applied to the shape. For example, if you said
- |\tikz[scale=3]| and then say |node[transform shape] {X}|, you
- will get a ``huge'' X in your graphic.
- \end{key}
-\item
- You can give transformation options \emph{inside} the option list of
- the node. \emph{These} transformations always apply to the node.
+ \item You can use the following option:
+ %
+ \begin{key}{/tikz/transform shape}
+ Causes the current ``external'' transformation matrix to be applied
+ to the shape. For example, if you said |\tikz[scale=3]| and then
+ say |node[transform shape] {X}|, you will get a ``huge'' X in your
+ graphic.
+ \end{key}
+ \item You can give transformation options \emph{inside} the option list of
+ the node. \emph{These} transformations always apply to the node.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[every node/.style={draw}]
\draw[help lines](0,0) grid (3,2);
@@ -1734,22 +1803,23 @@ example, it certainly sometimes makes sense to rotate a node by
(2,0) node[transform shape,rotate=90,scale=1.5] {B};
\end{tikzpicture}
\end{codeexample}
+ %
\end{enumerate}
-
-Even though \tikzname\ currently does not allow you to configure
-so-called \emph{nonlinear transformations,} see
-Section~\ref{section-nonlinear-transformations}, there is an option
-that influences how nodes are transformed when nonlinear
-transformations are in force:
-
+Even though \tikzname\ currently does not allow you to configure so-called
+\emph{nonlinear transformations,} see
+Section~\ref{section-nonlinear-transformations}, there is an option that
+influences how nodes are transformed when nonlinear transformations are in
+force:
+%
\begin{key}{/tikz/transform shape nonlinear=\opt{\meta{true or false}} (initially false)}
- When set to true, \tikzname\ will try to apply any current nonlinear
- transformation also to nodes. Typically, for the text in nodes this
- is not possible in general, in such cases a linear approximation of
- the nonlinear transformation is used. For more details, see
- Section~\ref{section-nonlinear-transformations}.
-\makeatletter
+ When set to true, \tikzname\ will try to apply any current nonlinear
+ transformation also to nodes. Typically, for the text in nodes this is not
+ possible in general, in such cases a linear approximation of the nonlinear
+ transformation is used. For more details, see
+ Section~\ref{section-nonlinear-transformations}.
+ %
+\makeatletter
\begin{codeexample}[]
\begin{tikzpicture}
% Install a nonlinear transformation:
@@ -1762,54 +1832,53 @@ transformations are in force:
% Draw something:
\draw [help lines] (0,-30pt) grid [step=10pt] (80pt,30pt);
-
+
\foreach \x in {0,20,...,80}
\node [fill=red!20] at (\x pt, -20pt) {\x};
-
+
\foreach \x in {0,20,...,80}
\node [fill=blue!20, transform shape nonlinear] at (\x pt, 20pt) {\x};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\subsection{Placing Nodes on a Line or Curve Explicitly}
-
\label{section-nodes-placing-1}
-Until now, we always placed node on a coordinate that is mentioned in
-the path. Often, however, we wish to place nodes on ``the middle'' of
-a line and we do not wish to compute these coordinates ``by hand.''
-To facilitate such placements, \tikzname\ allows you to specify that a
-certain node should be somewhere ``on'' a line. There are two ways of
-specifying this: Either explicitly by using the |pos| option or
-implicitly by placing the node ``inside'' a path operation. These two
-ways are described in the following.
+Until now, we always placed node on a coordinate that is mentioned in the path.
+Often, however, we wish to place nodes on ``the middle'' of a line and we do
+not wish to compute these coordinates ``by hand''. To facilitate such
+placements, \tikzname\ allows you to specify that a certain node should be
+somewhere ``on'' a line. There are two ways of specifying this: Either
+explicitly by using the |pos| option or implicitly by placing the node
+``inside'' a path operation. These two ways are described in the following.
-\label{section-pos-option}
+ \label{section-pos-option}
\begin{key}{/tikz/pos=\meta{fraction}}
- When this option is given, the node is not anchored on the last
- coordinate. Rather, it is anchored on some point on the line from
- the previous coordinate to the current point. The \meta{fraction}
- dictates how ``far'' on the line the point should be. A
- \meta{fraction} of 0 is the previous coordinate, 1 is the current
- one, everything else is in between. In particular, 0.5 is the
- middle.
+ When this option is given, the node is not anchored on the last coordinate.
+ Rather, it is anchored on some point on the line from the previous
+ coordinate to the current point. The \meta{fraction} dictates how ``far''
+ on the line the point should be. A \meta{fraction} of 0 is the previous
+ coordinate, 1 is the current one, everything else is in between. In
+ particular, 0.5 is the middle.
- Now, what is ``the previous line''? This depends on the previous
- path construction operation.
+ Now, what is ``the previous line''? This depends on the previous path
+ construction operation.
- In the simplest case, the previous path operation was a ``line-to''
- operation, that is, a |--|\meta{coordinate} operation:
+ In the simplest case, the previous path operation was a ``line-to''
+ operation, that is, a |--|\meta{coordinate} operation:
+ %
\begin{codeexample}[]
\tikz \draw (0,0) -- (3,1)
node[pos=0]{0} node[pos=0.5]{1/2} node[pos=0.9]{9/10};
\end{codeexample}
- For the |arc| operation, the position is simply the corresponding
- position on the arc:
+ For the |arc| operation, the position is simply the corresponding position
+ on the arc:
+ %
\begin{codeexample}[]
\tikz {
\draw [help lines] (0,0) grid (3,2);
@@ -1818,26 +1887,26 @@ ways are described in the following.
}
\end{codeexample}
- The next case is the curve-to operation (the |..| operation). In this
- case, the ``middle'' of the curve, that is, the position |0.5| is
- not necessarily the point at the exact half distance on the
- line. Rather, it is some point at ``time'' 0.5 of a point traveling
- from the start of the curve, where it is at time 0, to the end of
- the curve, which it reaches at time 0.5. The ``speed'' of the point
- depends on the length of the support vectors (the vectors that
- 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\'ezier curves if you are intrigued.
+ The next case is the curve-to operation (the |..| operation). In this case,
+ the ``middle'' of the curve, that is, the position |0.5| is not necessarily
+ the point at the exact half distance on the line. Rather, it is some point
+ at ``time'' 0.5 of a point traveling from the start of the curve, where it
+ is at time 0, to the end of the curve, which it reaches at time 0.5. The
+ ``speed'' of the point depends on the length of the support vectors (the
+ vectors that 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.
+ %
\begin{codeexample}[]
\tikz \draw (0,0) .. controls +(right:3.5cm) and +(right:3.5cm) .. (0,3)
node foreach \p in {0,0.125,...,1} [pos=\p]{\p};
\end{codeexample}
- Another interesting case are the horizontal/vertical line-to operations
- \verb!|-! and \verb!-|!. For them, the position (or time) |0.5| is
- exactly the corner point.
-
+ Another interesting case are the horizontal/vertical line-to operations
+ \verb!|-! and \verb!-|!. For them, the position (or time) |0.5| is exactly
+ the corner point.
+ %
\begin{codeexample}[]
\tikz \draw (0,0) |- (3,1)
node[pos=0]{0} node[pos=0.5]{1/2} node[pos=0.9]{9/10};
@@ -1848,25 +1917,24 @@ ways are described in the following.
node[pos=0]{0} node[pos=0.5]{1/2} node[pos=0.9]{9/10};
\end{codeexample}
- For all other path construction operations, \emph{the position
- placement does not work}, currently.
+ For all other path construction operations, \emph{the position placement
+ does not work}, currently.
\end{key}
\begin{key}{/tikz/auto=\opt{\meta{direction}} (default \normalfont is scope's setting)}
- This option causes an anchor positions to be calculated
- automatically according to the following rule. Consider a line
- between to points. If the \meta{direction} is |left|, then the
- anchor is chosen such that the node is to the left of this line. If
- the \meta{direction} is |right|, then the node is to the right of
- this line. Leaving out \meta{direction} causes automatic placement
- to be enabled with the last value of |left| or |right| used. A
- \meta{direction} of |false| disables automatic placement. This
- happens also whenever an anchor is given explicitly by the
- |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.
-
+ This option causes an anchor positions to be calculated automatically
+ according to the following rule. Consider a line between to points. If the
+ \meta{direction} is |left|, then the anchor is chosen such that the node is
+ to the left of this line. If the \meta{direction} is |right|, then the node
+ is to the right of this line. Leaving out \meta{direction} causes automatic
+ placement to be enabled with the last value of |left| or |right| used. A
+ \meta{direction} of |false| disables automatic placement. This happens also
+ whenever an anchor is given explicitly by the |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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[scale=.8,auto=left,every node/.style={circle,fill=blue!20}]
@@ -1884,12 +1952,14 @@ ways are described in the following.
node[midway,fill=red!20] {\from--\to};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/swap}
- This option exchanges the roles of |left| and |right| in automatic
- placement. That is, if |left| is the current |auto| placement,
- |right| is set instead and the other way round.
+ This option exchanges the roles of |left| and |right| in automatic
+ placement. That is, if |left| is the current |auto| placement, |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);
@@ -1901,6 +1971,7 @@ ways are described in the following.
[pos=\pos,fill=blue!20] {\pos};
\end{tikzpicture}
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,auto]
\draw[help lines] (0,0) grid (3,2);
@@ -1918,50 +1989,57 @@ ways are described in the following.
edge [loop below] node {1} ();
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/'}
- This is a very short alias for |swap|.
+ This is a very short alias for |swap|.
\end{key}
\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
- 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.
+ This option causes the node to be rotated such that a horizontal 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.
+ %
\begin{codeexample}[]
\tikz \draw (0,0) .. controls +(up:2cm) and +(left:2cm) .. (1,3)
node foreach \p in {0,0.25,...,1} [sloped,above,pos=\p]{\p};
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[->]
\draw (0,0) -- (2,0.5) node[midway,sloped,above] {$x$};
\draw (2,-.5) -- (0,0) node[midway,sloped,below] {$y$};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\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)
node foreach \p in {0,0.25,...,1} [sloped,above,pos=\p]{\p};
\end{codeexample}
+ %
\begin{codeexample}[]
\begin{tikzpicture}[->,allow upside down]
\draw (0,0) -- (2,0.5) node[midway,sloped,above] {$x$};
\draw (2,-.5) -- (0,0) node[midway,sloped,below] {$y$};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
There exist styles for specifying positions a bit less ``technically'':
+
\begin{stylekey}{/tikz/midway}
- This has the same effect as |pos=0.5|.
+ This has the same effect as |pos=0.5|.
+ %
\begin{codeexample}[]
\tikz \draw (0,0) .. controls +(up:2cm) and +(left:3cm) .. (1,5)
node[at end] {\texttt{at end}}
@@ -1972,68 +2050,64 @@ There exist styles for specifying positions a bit less ``technically'':
node[very near start] {\texttt{very near start}}
node[at start] {\texttt{at start}};
\end{codeexample}
+ %
\end{stylekey}
\begin{stylekey}{/tikz/near start}
- Set to |pos=0.25|.
+ Set to |pos=0.25|.
\end{stylekey}
\begin{stylekey}{/tikz/near end}
- Set to |pos=0.75|.
+ Set to |pos=0.75|.
\end{stylekey}
\begin{stylekey}{/tikz/very near start}
- Set to |pos=0.125|.
+ Set to |pos=0.125|.
\end{stylekey}
\begin{stylekey}{/tikz/very near end}
- Set to |pos=0.875|.
+ Set to |pos=0.875|.
\end{stylekey}
\begin{stylekey}{/tikz/at start}
- Set to |pos=0|.
+ Set to |pos=0|.
\end{stylekey}
\begin{stylekey}{/tikz/at end}
- Set to |pos=1|.
+ Set to |pos=1|.
\end{stylekey}
\subsection{Placing Nodes on a Line or Curve Implicitly}
-
\label{section-nodes-placing-2}
-When you wish to place a node on the line |(0,0) -- (1,1)|,
-it is natural to specify the node not following the |(1,1)|, but
-``somewhere in the middle.'' This is, indeed, possible and you can
-write |(0,0) -- node{a} (1,1)| to place a node midway between |(0,0)| and
-|(1,1)|.
-
-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,
-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,
-but with the |pos| option set.
+When you wish to place a node on the line |(0,0) -- (1,1)|, it is natural to
+specify the node not following the |(1,1)|, but ``somewhere in the middle''.
+This is, indeed, possible and you can write |(0,0) -- node{a} (1,1)| to place a
+node midway between |(0,0)| and |(1,1)|.
+
+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, 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, but with
+the |pos| option set.
There are two things to note about this: When a node specification is
-``stored,'' its catcodes become fixed. This means that you cannot use
-overly complicated verbatim text in them. If you really need, say, a
-verbatim text, you will have to put it in a normal node following the
-coordinate and add the |pos| option.
-
-Second, which |pos| is chosen for the node? The position is inherited
-from the surrounding scope. However, this holds only for nodes
-specified in this implicit way. Thus, if you add the option
-|[near end]| to a scope, this does not mean that \emph{all} nodes given
-in this scope will be put on near the end of lines. Only the nodes
-for which an implicit |pos| is added will be placed near the
-end. Typically, this is what you want. Here are some examples that
+``stored'', its catcodes become fixed. This means that you cannot use overly
+complicated verbatim text in them. If you really need, say, a verbatim text,
+you will have to put it in a normal node following the coordinate and add the
+|pos| option.
+
+Second, which |pos| is chosen for the node? The position is inherited from the
+surrounding scope. However, this holds only for nodes specified in this
+implicit way. Thus, if you add the option |[near end]| to a scope, this does
+not mean that \emph{all} nodes given in this scope will be put on near the end
+of lines. Only the nodes for which an implicit |pos| is added will be placed
+near the end. Typically, this is what you want. Here are some examples that
should make this clearer:
-
+%
\begin{codeexample}[]
\begin{tikzpicture}[near end]
\draw (0cm,4em) -- (3cm,4em) node{A};
@@ -2044,20 +2118,20 @@ should make this clearer:
\end{codeexample}
Like the line-to operation, the curve-to operation |..| also allows you to
-specify nodes ``inside'' the operation. After both the first |..| and
-also after the second |..| you can place node specifications. Like for
-the |--| operation, these will be collected and then reinserted after
-the operation with the |pos| option set.
+specify nodes ``inside'' the operation. After both the first |..| and also
+after the second |..| you can place node specifications. Like for the |--|
+operation, these will be collected and then reinserted after the operation with
+the |pos| option set.
\subsection{The Label and Pin Options}
\subsubsection{Overview}
-In addition to the |node| path operation, the two options |label| and
-|pin| can be used to ``add a node next to another node''. As an
-example, suppose we want to draw a graph in which the nodes are
-small circles:
+In addition to the |node| path operation, the two options |label| and |pin| can
+be used to ``add a node next to another node''. As an example, suppose we want
+to draw a graph in which the nodes are small circles:
+%
\begin{codeexample}[]
\tikz [circle] {
\node [draw] (s) {};
@@ -2067,14 +2141,14 @@ small circles:
}
\end{codeexample}
-Now, in the above example, suppose we wish to indicate that the first
-node is the start node and the last node is the target node. We could
-write |\node (s) {$s$};|, but this would enlarge the first
-node. Rather, we want the ``$s$'' to be placed next to the node. For
-this, we need to create \emph{another} node, but next to the existing
-node. The |label| and |pin| option allow us to do exactly this without
-having to use the cumbersome |node| syntax:
-
+Now, in the above example, suppose we wish to indicate that the first node is
+the start node and the last node is the target node. We could write
+|\node (s) {$s$};|, but this would enlarge the first node. Rather, we want the
+``$s$'' to be placed next to the node. For this, we need to create
+\emph{another} node, but next to the existing node. The |label| and |pin|
+option allow us to do exactly this without having to use the cumbersome |node|
+syntax:
+%
\begin{codeexample}[]
\tikz [circle] {
\node [draw] (s) [label=$s$] {};
@@ -2084,77 +2158,82 @@ having to use the cumbersome |node| syntax:
}
\end{codeexample}
+
\subsubsection{The Label Option}
\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, 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 of either the node or the scope).
-
- The difference can be seen in the following example:
+ \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, 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 of 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| is computed. It is determined
- in such a way that the |label 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 detail, when the computed
- border point is at $0^\circ$, the anchor |west| will be
- used. Similarly, when the border point is at $90^\circ$, the
- anchor |south| will be used, and so on for $180^\circ$ and
- $270^\circ$.
-
- For angles between these ``major'' angles, like
- $30^\circ$ or $110^\circ$, combined anchors, like |south west| for
- $30^\circ$ or |south east| for $110^\circ$, are used. However, for
- angles close to the major angles, (differing by up to $2^\circ$
- from the major angle), the anchor for the major angle is
- used. Thus, a label at a border point for $2^\circ$ will have the
- anchor |west|, while a label for $3^\circ$ will have the anchor
- |south west|, resulting in a ``jump'' of the anchor. You can set
- the anchor ``by hand'' using the |anchor| key or indirect keys
- like |left|.
-\begin{codeexample}[]
-\tikz
+ \end{key}
+ \item Then, an anchor point for the |label node| is computed. It is
+ determined in such a way that the |label 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 detail, when the computed
+ border point is at $0^\circ$, the anchor |west| will be used.
+ Similarly, when the border point is at $90^\circ$, the anchor
+ |south| will be used, and so on for $180^\circ$ and $270^\circ$.
+
+ For angles between these ``major'' angles, like $30^\circ$ or
+ $110^\circ$, combined anchors, like |south west| for $30^\circ$ or
+ |south east| for $110^\circ$, are used. However, for angles close
+ to the major angles, (differing by up to $2^\circ$ from the major
+ angle), the anchor for the major angle is used. Thus, a label at a
+ border point for $2^\circ$ will have the anchor |west|, while a
+ label for $3^\circ$ will have the anchor |south west|, resulting in
+ a ``jump'' of the anchor. You can set the anchor ``by hand'' using
+ the |anchor| key or indirect keys like |left|.
+ %
+\begin{codeexample}[]
+\tikz
\node [circle, draw,
label=default,
label=60:$60^\circ$,
@@ -2164,22 +2243,23 @@ having to use the cumbersome |node| syntax:
label={[below]180:$180^\circ$},
label={[centered]135:$115^\circ$}] {my circle};
\end{codeexample}
- \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.
+ \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}
+ \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
- do so, you need to add braces around the whole argument of the
- |label| option and this is also the case if you have brackets or
- commas or semicolons or anything special in the \meta{text}.
+ 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 do so, you
+ need to add braces around the whole argument of the |label| option and this
+ is also the case if you have brackets or commas or semicolons or anything
+ special in the \meta{text}.
+ %
\begin{codeexample}[]
\tikz \node [circle,draw,label={[red]above:X}] {my circle};
\end{codeexample}
@@ -2191,62 +2271,73 @@ having to use the cumbersome |node| syntax:
\end{tikzpicture}
\end{codeexample}
- If you provide multiple |label| options, then multiple extra label
- nodes are added in the order they are given.
+ If you provide multiple |label| options, then multiple extra label nodes
+ are added in the order they are given.
- The following styles influence how labels are drawn:
- \begin{key}{/tikz/label distance=\meta{distance} (initially 0pt)}
- The \meta{distance} is additionally inserted between the main node
- and the label node.
+ The following styles influence how labels are drawn:
+ %
+ \begin{key}{/tikz/label distance=\meta{distance} (initially 0pt)}
+ The \meta{distance} is additionally inserted between the main node and
+ the label node.
+ %
\begin{codeexample}[]
\tikz[label distance=5mm]
\node [circle,draw,label=right:X,
label=above right:Y,
label=above:Z] {my circle};
\end{codeexample}
- \end{key}
- \begin{stylekey}{/tikz/every label (initially \normalfont empty)}
- This style is used in every node created by the |label|
- option. The default is |draw=none,fill=none|.
- \end{stylekey}
+ \end{key}
+ %
+ \begin{stylekey}{/tikz/every label (initially \normalfont empty)}
+ This style is used in every node created by the |label| option. The
+ default is |draw=none,fill=none|.
+ \end{stylekey}
\end{key}
-See Section~\ref{section-label-quotes} for an easier
-syntax for specifying nodes.
+See Section~\ref{section-label-quotes} for an easier syntax for specifying
+nodes.
+
\subsubsection{The Pin Option}
\begin{key}{/tikz/pin=\opt{|[|\meta{options}|]|}\meta{angle}|:|\meta{text}}
- This option is quite similar to the |label| option, but there is
- one difference: In addition to adding an 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:
+ This option is quite similar to the |label| option, but there is one
+ difference: In addition to adding an 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:
+ %
\begin{codeexample}[]
\tikz \node [circle,fill=blue!50,minimum size=1cm,pin=60:$q_0$] {};
\end{codeexample}
- The meaning of the \meta{options} and the \meta{angle} and the
- \meta{text} is exactly the same as for the |node| option. Only, the
- options and styles the influence the way pins look are different:
- \begin{key}{/tikz/pin distance=\meta{distance} (initially 3ex)}
- This \meta{distance} is used instead of the |label distance| for
- the distance between the main node and the label node.
+ The meaning of the \meta{options} and the \meta{angle} and the \meta{text}
+ is exactly the same as for the |node| option. Only, the options and styles
+ the influence the way pins look are different:
+ %
+ \begin{key}{/tikz/pin distance=\meta{distance} (initially 3ex)}
+ This \meta{distance} is used instead of the |label distance| for the
+ distance between the main node and the label node.
+ %
\begin{codeexample}[]
\tikz[pin distance=1cm]
\node [circle,draw,pin=right:X,
pin=above right:Y,
pin=above:Z] {my circle};
\end{codeexample}
- \end{key}
- \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| options.
+ %
+ \end{key}
+
+ \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| options.
+ %
\begin{codeexample}[]
\tikz [pin distance=15mm,
every pin edge/.style={<-,shorten <=1pt,decorate,
@@ -2255,70 +2346,77 @@ syntax for specifying nodes.
pin=above right:Y,
pin=above:Z] {my circle};
\end{codeexample}
- \end{stylekey}
+ \end{stylekey}
- \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.
+ \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.
+ %
\begin{codeexample}[]
\tikz[pin distance=10mm]
\node [circle,draw,pin={[pin edge={blue,thick}]right:X},
pin=above:Z] {my circle};
\end{codeexample}
+ %
\begin{codeexample}[]
\tikz [every pin edge/.style={},
initial/.style={pin={[pin distance=5mm,
pin edge={<-,shorten <=1pt}]left:start}}]
\node [circle,draw,initial] {my circle};
\end{codeexample}
- \end{key}
+ \end{key}
\end{key}
\subsubsection{The Quotes Syntax}
\label{section-label-quotes}
-The |label| and |pin| option provide a syntax for
-creating nodes next to existing nodes, but this syntax is often a
-bit too verbose. By including the following library, you get access to
-an even more concise syntax:
+The |label| and |pin| option provide a syntax for creating nodes next to
+existing nodes, but this syntax is often a bit too verbose. By including the
+following library, you get access to an even more concise syntax:
\begin{tikzlibrary}{quotes}
- Enables the quotes syntax for labels, pins, edge nodes, and pic
- texts.
+ Enables the quotes syntax for labels, pins, edge nodes, and pic texts.
\end{tikzlibrary}
-Let us start with the basics of what this library does: Once loaded,
-inside the options of a |node| command, instead of the usual
-\meta{key}|=|\meta{value} pairs, you may also provide strings of the
-following form (the actual syntax slightly more general, see the
-detailed descriptions later on):
+Let us start with the basics of what this library does: Once loaded, inside the
+options of a |node| command, instead of the usual \meta{key}|=|\meta{value}
+pairs, you may also provide strings of the following form (the actual syntax
+slightly more general, see the detailed descriptions later on):
+%
\begin{quote}
- |"|\meta{text}|"|\opt{\meta{options}}
+ |"|\meta{text}|"|\opt{\meta{options}}
\end{quote}
-The \meta{options} must be surrounded in curly braces when they
-contain a comma, otherwise the curly braces are optional. The may be
-preceded by an optional space.
+%
+The \meta{options} must be surrounded in curly braces when they contain a
+comma, otherwise the curly braces are optional. The may be preceded by an
+optional space.
-When a \meta{string} of the above form is encountered inside the
-options of a |node|, then it is internally transformed to
+When a \meta{string} of the above form is encountered inside the options of a
+|node|, then it is internally transformed to
+%
+% (the double vertical bar after = is needed to avoid the two opening brackets
+% being typeset in italics)
\begin{quote}
- |label={[|\meta{options}|]|\meta{text}|}|
+ |label=||{[|\meta{options}|]|\meta{text}|}|
\end{quote}
Let us have a look at an example:
+%
\begin{codeexample}[]
\tikz \node ["my label" red, draw] {my node};
\end{codeexample}
+%
The above has the same effect as the following:
+%
\begin{codeexample}[]
\tikz \node [label={[red]my label}, draw] {my node};
\end{codeexample}
-Here are further examples, one where no \meta{options} are added
-to the |label|, one where a position is specified, and examples with
-more complicated options in curly braces:
-
+Here are further examples, one where no \meta{options} are added to the
+|label|, one where a position is specified, and examples with more complicated
+options in curly braces:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\matrix [row sep=5mm] {
@@ -2327,148 +2425,158 @@ more complicated options in curly braces:
\node [draw, "label" centered] {C}; \\
\node [draw, "label" color=red] {D}; \\
\node [draw, "label" {red,draw,thick}] {E}; \\
- };
+ };
\end{tikzpicture}
\end{codeexample}
-Let us now have a more detailed look at what which commands this
-library provides:
+Let us now have a more detailed look at what which commands this library
+provides:
\begin{key}{/tikz/quotes mean label}
- When this option is used (which is the default when this library is
- loaded), then, as described above, inside the options of a node a
- special syntax check is done.
-
- \medskip
- \noindent\textbf{The syntax.}
- For each string in the list of options
- it is tested whether it starts with a quotation mark (note that this
- will never happen for normal keys since the normal keys of
- \tikzname\ do not start with quotation marks). When this happens,
- the \meta{string} should not be a key--value pair, but, rather, must
- have the form:
- \begin{quote}
- |"|\meta{text}|"|\opt{|'|}\opt{\meta{options}}
- \end{quote}
-
- (We will discuss the optional apostrophe in a moment. It is not
- really important for the current option, but only for
- edge labels, which are discussed later).
-
- \medskip
- \noindent\textbf{Transformation to a label option.}
- When a \meta{string} has the above form, it is treated (almost) as
- if you had written
- \begin{quote}
- |label={[|\meta{options}|]|\meta{text}|}|
- \end{quote}
- instead. The ``almost'' refers to the following additional feature:
- In reality, before the \meta{options} are executed inside the
- |label| command, the direction keys |above|, |left|, |below right|
- and so on are redefined so that |above| is a shorthand for
- |label position=90| and similarly for the other keys. The net effect
- is that in order to specify the position of the \meta{text} relative
- to the main node you can just put something like |left| or
- |above right| inside the \meta{options}:
-\begin{codeexample}[]
-\tikz
+ When this option is used (which is the default when this library is
+ loaded), then, as described above, inside the options of a node a special
+ syntax check is done.
+
+ \medskip
+ \noindent\textbf{The syntax.}
+ For each string in the list of options it is tested whether it starts with
+ a quotation mark (note that this will never happen for normal keys since
+ the normal keys of \tikzname\ do not start with quotation marks). When this
+ happens, the \meta{string} should not be a key--value pair, but, rather,
+ must have the form:
+ %
+ \begin{quote}
+ |"|\meta{text}|"|\opt{|'|}\opt{\meta{options}}
+ \end{quote}
+
+ (We will discuss the optional apostrophe in a moment. It is not really
+ important for the current option, but only for edge labels, which are
+ discussed later).
+
+ \medskip
+ \noindent\textbf{Transformation to a label option.}
+ When a \meta{string} has the above form, it is treated (almost) as if you
+ had written
+ %
+ \begin{quote}
+ |label={[|\meta{options}|]|\meta{text}|}|
+ \end{quote}
+ %
+ instead. The ``almost'' refers to the following additional feature: In
+ reality, before the \meta{options} are executed inside the |label| command,
+ the direction keys |above|, |left|, |below right| and so on are redefined
+ so that |above| is a shorthand for |label position=90| and similarly for
+ the other keys. The net effect is that in order to specify the position of
+ the \meta{text} relative to the main node you can just put something like
+ |left| or |above right| inside the \meta{options}:
+ %
+\begin{codeexample}[]
+\tikz
\node ["$90^\circ$" above, "$180^\circ$" left, circle, draw] {circle};
\end{codeexample}
- Alternatively, you can also use \meta{direction}|:|\meta{actual
- text} as your \meta{text}. This works since the |label| command
- allows you to specify a direction at the beginning when it is
- separated by a colon:
+ Alternatively, you can also use \meta{direction}|:|\meta{actual text} as
+ your \meta{text}. This works since the |label| command allows you to
+ specify a direction at the beginning when it is separated by a colon:
+ %
\begin{codeexample}[]
-\tikz
+\tikz
\node ["90:$90^\circ$", "left:$180^\circ$", circle, draw] {circle};
\end{codeexample}
- Arguably, placing |above| or |left| behind the \meta{text} seems
- more natural than having it inside the \meta{text}.
+ %
+ Arguably, placing |above| or |left| behind the \meta{text} seems more
+ natural than having it inside the \meta{text}.
- In addition to the above, before the \meta{options} are executed,
- the following style is also executed:
- \begin{stylekey}{/tikz/every label quotes}
+ In addition to the above, before the \meta{options} are executed, the
+ following style is also executed:
+ %
+ \begin{stylekey}{/tikz/every label quotes}
\begin{codeexample}[]
\tikz [every label quotes/.style=red]
\node ["90:$90^\circ$", "left:$180^\circ$", circle, draw] {circle};
\end{codeexample}
- \end{stylekey}
-
- \medskip
- \noindent\textbf{Handling commas and colons inside the text.}
- The \meta{text} may not contain a comma, unless it is inside curly
- braces. The reason is that the key handler separates the total
- options of a |node| along the commas it finds. So, in order to have
- text containing a comma, just add curly braces around either the
- comma or just around the whole \meta{text}:
+ \end{stylekey}
+
+ \medskip
+ \noindent\textbf{Handling commas and colons inside the text.}
+ The \meta{text} may not contain a comma, unless it is inside curly braces.
+ The reason is that the key handler separates the total options of a |node|
+ along the commas it finds. So, in order to have text containing a comma,
+ just add curly braces around either the comma or just around the whole
+ \meta{text}:
+ %
\begin{codeexample}[]
\tikz \node ["{yes, we can}", draw] {foo};
\end{codeexample}
- The same is true for a colon, only in this case you may need to
- surround specifically the colon by curly braces to stop the |label|
- option from interpreting everything before the colon as a direction:
+ %
+ The same is true for a colon, only in this case you may need to surround
+ specifically the colon by curly braces to stop the |label| option from
+ interpreting everything before the colon as a direction:
+ %
\begin{codeexample}[]
\tikz \node ["yes{:} we can", draw] {foo};
\end{codeexample}
- \medskip
- \noindent\textbf{The optional apostrophe.}
- Following the closing quotation marks in a \meta{string} there may
- (but need
- not) be a single quotation mark (an apostrophe), possibly surrounded
- by whitespaces. If it is present, it is simply added to the
- \meta{options} as another option (and, indeed, a single apostrophe
- is a legal option in \tikzname, it is a shorthand for |swap|):
-
- \begin{tabular}{ll}
- String & has the same effect as \\\hline
- |"foo"'| & |"foo" {'}| \\
- |"foo"' red| & |"foo" {',red}| \\
- |"foo"'{red}| & |"foo" {',red}| \\
- |"foo"{',red}| & |"foo" {',red}| \\
- |"foo"{red,'}| & |"foo" {red,'}| \\
- |"foo"{'red}| & |"foo" {'red}| (illegal; there is no key |'red|)\\
- |"foo" red'| & |"foo" {red'}| (illegal; there is no key |red'|)\\
- \end{tabular}
+ \medskip
+ \noindent\textbf{The optional apostrophe.}
+ Following the closing quotation marks in a \meta{string} there may (but
+ need not) be a single quotation mark (an apostrophe), possibly surrounded
+ by whitespaces. If it is present, it is simply added to the \meta{options}
+ as another option (and, indeed, a single apostrophe is a legal option in
+ \tikzname, it is a shorthand for |swap|):
+
+ \begin{tabular}{ll}
+ String & has the same effect as \\\hline
+ |"foo"'| & |"foo" {'}| \\
+ |"foo"' red| & |"foo" {',red}| \\
+ |"foo"'{red}| & |"foo" {',red}| \\
+ |"foo"{',red}| & |"foo" {',red}| \\
+ |"foo"{red,'}| & |"foo" {red,'}| \\
+ |"foo"{'red}| & |"foo" {'red}| (illegal; there is no key |'red|)\\
+ |"foo" red'| & |"foo" {red'}| (illegal; there is no key |red'|)\\
+ \end{tabular}
\end{key}
\begin{key}{/tikz/quotes mean pin}
- This option has exactly the same effect as |quotes mean label|, only
- instead of transforming quoted text to the |label| option, they get
- transformed to the |pin| option:
+ This option has exactly the same effect as |quotes mean label|, only
+ instead of transforming quoted text to the |label| option, they get
+ transformed to the |pin| option:
+ %
\begin{codeexample}[]
\tikz [quotes mean pin]
\node ["$90^\circ$" above, "$180^\circ$" left, circle, draw] {circle};
-\end{codeexample}
- Instead of |every label quotes|, the following style is executed
- with each such pin:
- \begin{stylekey}{/tikz/every pin quotes}
- \end{stylekey}
+\end{codeexample}
+ %
+ Instead of |every label quotes|, the following style is executed
+ with each such pin:
+ %
+ \begin{stylekey}{/tikz/every pin quotes}
+ \end{stylekey}
\end{key}
If instead of |label|s or |pin|s you would like quoted strings to be
-interpreted in a different manner, you can also define your own
-handlers:
+interpreted in a different manner, you can also define your own handlers:
\begin{key}{/tikz/node quotes mean=\meta{replacement}}
- This key allows you to define your own handler for quotes
- options. Inside the options of a |node|, whenever a key--value pair
- with the syntax
- \begin{quote}
- |"|\meta{text}|"|\opt{|'|}\opt{\meta{options}}
- \end{quote}
- is encountered, the following happens: The above string gets
- replaced by \meta{replacement} where inside the \meta{replacement}
- the parameter |#1| is \meta{text} and |#2| is \meta{options}. If the
- apostrophe is present (see also the discussion of
- |quotes mean label|), the \meta{options} start with |',|.
-
- The \meta{replacement} is then parsed normally as options (using
- |\pgfkeys|).
-
- Here is an example, where the quotes are used to define labels that
- are automatically named according to the |text|:
+ This key allows you to define your own handler for quotes options. Inside
+ the options of a |node|, whenever a key--value pair with the syntax
+ %
+ \begin{quote}
+ |"|\meta{text}|"|\opt{|'|}\opt{\meta{options}}
+ \end{quote}
+ %
+ is encountered, the following happens: The above string gets replaced by
+ \meta{replacement} where inside the \meta{replacement} the parameter |#1|
+ is \meta{text} and |#2| is \meta{options}. If the apostrophe is present
+ (see also the discussion of |quotes mean label|), the \meta{options} start
+ with |',|.
+
+ The \meta{replacement} is then parsed normally as options (using
+ |\pgfkeys|).
+
+ Here is an example, where the quotes are used to define labels that are
+ automatically named according to the |text|:
+ %
\begin{codeexample}[]
\tikzset{node quotes mean={label={[#2,name={#1}]#1}}}
@@ -2477,47 +2585,47 @@ handlers:
\draw (1) -- (2);
}
\end{codeexample}
+ %
\end{key}
-Some further options provided by the |quotes| library concern labels
-next to edges rather than nodes and they are described in
-Section~\ref{section-edge-quotes}.
+Some further options provided by the |quotes| library concern labels next to
+edges rather than nodes and they are described in
+Section~\ref{section-edge-quotes}.
-\subsection{Connecting Nodes: Using Nodes as Coordinates}
+\subsection{Connecting Nodes: Using Nodes as Coordinates}
\label{section-nodes-connecting}
-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
+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|.
+%
\begin{enumerate}
-\item
- Once the node |x| has been defined, you can use
- |(x.|\meta{anchor}|)| wherever you would normally use a normal
- coordinate. This will yield the position at which the given
- \meta{anchor} is in the picture. Note that transformations do not
- apply to this coordinate, that is, |(x.north)| will be the northern
- anchor of |x| even if you have said |scale=3| or |xshift=4cm|. This
- is usually what you would expect.
-\item
- You can also just use |(x)| as a coordinate. In most cases, this
- gives the same coordinate as |(x.center)|. Indeed, if the |shape| of
- |x| is |coordinate|, then |(x)| and |(x.center)| have exactly the
- same effect.
-
- However, for most other shapes, some path construction operations like
- |--| try to be ``clever'' when they are asked to draw a line
- from such a coordinate or to such a coordinate. When you say
- |(x)--(1,1)|, the |--| path operation will not draw a line from the center
- of |x|, but \emph{from the border} of |x| in the direction going
- towards |(1,1)|. Likewise, |(1,1)--(x)| will also have the line
- end on the border in the direction coming from |(1,1)|.
-
- In addition to |--|, the curve-to path operation |..| and the path
- operations \verb!-|! and \verb!|-! will also handle nodes without
- anchors correctly. Here is an example, see also
- Section~\ref{section-node-coordinates}:
+ \item Once the node |x| has been defined, you can use |(x.|\meta{anchor}|)|
+ wherever you would normally use a normal coordinate. This will yield
+ the position at which the given \meta{anchor} is in the picture. Note
+ that transformations do not apply to this coordinate, that is,
+ |(x.north)| will be the northern anchor of |x| even if you have said
+ |scale=3| or |xshift=4cm|. This is usually what you would expect.
+ \item You can also just use |(x)| as a coordinate. In most cases, this
+ gives the same coordinate as |(x.center)|. Indeed, if the |shape| of
+ |x| is |coordinate|, then |(x)| and |(x.center)| have exactly the same
+ effect.
+
+ However, for most other shapes, some path construction operations like
+ |--| try to be ``clever'' when they are asked to draw a line from such
+ a coordinate or to such a coordinate. When you say |(x)--(1,1)|, the
+ |--| path operation will not draw a line from the center of |x|, but
+ \emph{from the border} of |x| in the direction going towards |(1,1)|.
+ Likewise, |(1,1)--(x)| will also have the line end on the border in the
+ direction coming from |(1,1)|.
+
+ In addition to |--|, the curve-to path operation |..| and the path
+ operations \verb!-|! and \verb!|-! will also handle nodes without
+ anchors correctly. Here is an example, see also
+ Section~\ref{section-node-coordinates}:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\path (0,0) node (x) {Hello World!}
@@ -2528,58 +2636,54 @@ Section~\ref{section-node-coordinates}. Suppose you have said
\draw[->,orange] (x) .. controls +(up:1cm) and +(left:1cm) .. node[above,sloped] {label} (y);
\end{tikzpicture}
\end{codeexample}
+ %
\end{enumerate}
-
-
\subsection{Connecting Nodes: Using the Edge Operation}
-
\label{section-nodes-edges}
\subsubsection{Basic Syntax of the Edge Operation}
-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 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
-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
-several |to| and/or |node| operations in the main path, each
-creates its own path(s) and they are drawn in the order that they
-are encountered on the main path.
-
-\begin{pathoperation}{edge}{\opt{|[|\meta{options}|]|}
- \opt{\meta{nodes}} |(|\meta{coordinate}|)|}
- The effect of the |edge| operation is that after the main path the
- following path is added to the picture:
- \begin{quote}
- |\path[every edge,|\meta{options}|] (\tikztostart) |\meta{path}|;|
- \end{quote}
- Here, \meta{path} is the |to path|. Note that, unlike the path added
- by the |to| operation, the |(\tikztostart)| is added before the
- \meta{path} (which is unnecessary for the |to| operation, since this
- 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.
- 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 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:
-
+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 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 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 several |edge|
+and/or |node| operations in the main path, each creates its own path(s) and
+they are drawn in the order that they are encountered on the main path.
+
+\begin{pathoperation}{edge}{\opt{|[|\meta{options}|]|} \opt{\meta{nodes}} |(|\meta{coordinate}|)|}
+ The effect of the |edge| operation is that after the main path the
+ following path is added to the picture:
+ %
+ \begin{quote}
+ |\path[every edge,|\meta{options}|] (\tikztostart) |\meta{path}|;|
+ \end{quote}
+ %
+ Here, \meta{path} is the |to path|. Note that, unlike the path added by the
+ |to| operation, the |(\tikztostart)| is added before the \meta{path} (which
+ is unnecessary for the |to| operation, since this 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. 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 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$};
@@ -2592,9 +2696,9 @@ are encountered on the main path.
\end{tikzpicture}
\end{codeexample}
- A different way of specifying the above graph using the |edge|
- operation is the following:
-
+ A different way of specifying the above graph using the |edge| operation is
+ the following:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node foreach \name/\angle in {a/0,b/90,c/180,d/270}
@@ -2609,9 +2713,9 @@ are encountered on the main path.
\end{tikzpicture}
\end{codeexample}
- As can be seen, the path of the |edge| operation inherits the
- options from the main path, but you can locally overrule them.
-
+ As can be seen, the path of the |edge| operation inherits the options from
+ the main path, but you can locally overrule them.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node foreach \name/\angle in {a/0,b/90,c/180,d/270}
@@ -2627,91 +2731,100 @@ are encountered on the main path.
\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 (initially draw)}
- Executed for each |edge|.
+ Instead of |every to|, the style |every edge| is installed at the beginning
+ of the main path.
+ %
+ \begin{stylekey}{/tikz/every edge (initially draw)}
+ Executed for each |edge|.
+ %
\begin{codeexample}[]
-\begin{tikzpicture}[every to/.style={draw,dashed}]
+\begin{tikzpicture}[every edge/.style={draw,dashed}]
\path (0,0) edge (3,2);
\end{tikzpicture}
\end{codeexample}
- \end{stylekey}
+ \end{stylekey}
\end{pathoperation}
\subsubsection{Nodes on Edges: Quotes Syntax}
\label{section-edge-quotes}
-The standard way of specifying nodes that are placed ``on'' an edge
-(or on a to-path; all of the following is also true for to--paths) is
-to put node specifications after the |edge| keyword, but before the
-target coordinate. Another way is to use the |edge node| option and
-its friends. Yet another way is to use the quotes syntax.
+The standard way of specifying nodes that are placed ``on'' an edge (or on a
+to-path; all of the following is also true for to--paths) is to put node
+specifications after the |edge| keyword, but before the target coordinate.
+Another way is to use the |edge node| option and its friends. Yet another way
+is to use the quotes syntax.
-The syntax is essentially the same as for labels added to nodes as
-described in Section~\ref{section-label-quotes} and you also need to
-load the |quotes| library.
+The syntax is essentially the same as for labels added to nodes as described in
+Section~\ref{section-label-quotes} and you also need to load the |quotes|
+library.
-In detail, when the |quotes| library is loaded, each time a key--value
-pair in a list of options passed to an |edge| or a |to| path command
-starts with |"|, the key--value pair must actually be a string of the
-following form:
+In detail, when the |quotes| library is loaded, each time a key--value pair in
+a list of options passed to an |edge| or a |to| path command starts with |"|,
+the key--value pair must actually be a string of the following form:
+%
\begin{quote}
- |"|\meta{text}|"|\opt{|'|}\opt{\meta{options}}
+ |"|\meta{text}|"|\opt{|'|}\opt{\meta{options}}
\end{quote}
+%
This string is transformed into the following:
+%
\begin{quote}
- |edge node=node [every edge quotes,|\meta{options}|]{|\meta{text}|}|
+ |edge node=node [every edge quotes,|\meta{options}|]{|\meta{text}|}|
\end{quote}
-As described in Section~\ref{section-label-quotes}, the apostrophe
-becomes part of the \meta{options}, when present.
+%
+As described in Section~\ref{section-label-quotes}, the apostrophe becomes part
+of the \meta{options}, when present.
The following style is important for the placement of the labels:
+
\begin{stylekey}{/tikz/every edge quotes (initially auto)}
- This style is |auto| by default, which causes labels specified using
- the quotes-syntax to be placed next to the edges. Unless the setting
- of |auto| has been changed, they will be placed to the left.
+ This style is |auto| by default, which causes labels specified using the
+ quotes-syntax to be placed next to the edges. Unless the setting of |auto|
+ has been changed, they will be placed to the left.
+ %
\begin{codeexample}[]
\tikz \draw (0,0) edge ["left", ->] (2,0);
\end{codeexample}
- In order to place all labels to the right by default, change this
- style to |auto=right|:
+ In order to place all labels to the right by default, change this style to
+ |auto=right|:
+ %
\begin{codeexample}[]
\tikz [every edge quotes/.style={auto=right}]
\draw (0,0) edge ["right", ->] (2,0);
\end{codeexample}
- To place all nodes ``on'' the edge, just make this style empty (and,
- possibly, make your labels opaque):
+ To place all nodes ``on'' the edge, just make this style empty (and,
+ possibly, make your labels opaque):
+ %
\begin{codeexample}[]
\tikz [every edge quotes/.style={fill=white,font=\footnotesize}]
\draw (0,0) edge ["mid", ->] (2,1);
\end{codeexample}
+ %
\end{stylekey}
-You may often wish to place some edge nodes to the right of edges and
-some to the left. For this, the special treatment of the apostrophe is
-particularly convenient: Recall that in \tikzname\ there is an option
-just called |'|, which is a shorthand for |swap|. Now, following the
-closing quotation mark come the options of an edge node. Thus, if the
-closing quotation mark is followed by an apostrophe, the |swap| option
-will be added to the edge label, causing it is be placed on the other
-side. Because of the special treatment, you can even add another
-option like |near end| after the apostrophe without having to add
-curly braces and commas:
-
+You may often wish to place some edge nodes to the right of edges and some to
+the left. For this, the special treatment of the apostrophe is particularly
+convenient: Recall that in \tikzname\ there is an option just called |'|, which
+is a shorthand for |swap|. Now, following the closing quotation mark come the
+options of an edge node. Thus, if the closing quotation mark is followed by an
+apostrophe, the |swap| option will be added to the edge label, causing it is be
+placed on the other side. Because of the special treatment, you can even add
+another option like |near end| after the apostrophe without having to add curly
+braces and commas:
+%
\begin{codeexample}[]
-\tikz
+\tikz
\draw (0,0) edge ["left", "right"',
"start" near start,
"end"' near end] (4,0);
\end{codeexample}
-In order to modify the distance between the edge labels and the edge,
-you should consider introducing some styles:
-
+In order to modify the distance between the edge labels and the edge, you
+should consider introducing some styles:
+%
\begin{codeexample}[]
\tikz [tight/.style={inner sep=1pt}, loose/.style={inner sep=.7em}]
\draw (0,0) edge ["left" tight,
@@ -2721,96 +2834,100 @@ you should consider introducing some styles:
\subsection{Referencing Nodes Outside the Current Picture}
-
\label{section-cross-picture-tikz}
\subsubsection{Referencing a Node in a Different Picture}
-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.
+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.
To reference nodes in different pictures, proceed as follows:
+%
\begin{enumerate}
-\item You need to add the |remember picture| option to all pictures
- that contain nodes that you wish to reference and also to all
- pictures from which you wish to reference a node in another
- picture.
-\item You need to add the |overlay| option to paths or to whole
- pictures that contain references to nodes in different
- pictures. (This option switches the computation of the
- bounding box off.)
-\item You need to use a driver that supports picture remembering and
- you need to run \TeX\ twice.
+ \item You need to add the |remember picture| option to all pictures that
+ contain nodes that you wish to reference and also to all pictures from
+ which you wish to reference a node in another picture.
+ \item You need to add the |overlay| option to paths or to whole pictures
+ that contain references to nodes in different pictures. (This option
+ switches the computation of the bounding box off.)
+ \item You need to use a driver that supports picture remembering and you
+ need to run \TeX\ twice.
\end{enumerate}
+%
(For more details on what is going on behind the scenes, see
Section~\ref{section-cross-pictures-pgf}.)
Let us have a look at the effect of these options.
+%
\begin{key}{/tikz/remember picture=\meta{boolean} (initially false)}
- This option tells \tikzname\ that it should attempt to remember the
- position of the current picture on the page. This attempt may fail
- depending on which backend driver is used. Also, even if remembering
- works, the position may only be available on a second run of \TeX.
+ This option tells \tikzname\ that it should attempt to remember the
+ position of the current picture on the page. This attempt may fail
+ 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 remembering works, you may consider saying
+ Provided that remembering works, you may consider saying
+ %
\begin{codeexample}[code only]
-\tikzstyle{every picture}+=[remember picture]
+\tikzset{every picture/.append style={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
- is not very much. Then, you do not have to worry about remembered
- pictures at all.
+ %
+ to make \tikzname\ remember all pictures. This will add one line in the
+ |.aux| file for each picture in your document -- which typically is not
+ very much. Then, you do not have to worry about remembered pictures at all.
\end{key}
\begin{key}{/tikz/overlay=\meta{boolean} (default true)}
- This option is mainly intended for use when nodes in other pictures
- are referenced, but you can also use it in other situations. The
- effect of this option is that everything within the current scope is
- not taken into consideration when the bounding box of the current
- picture is computed.
-
- You need to specify this option on all paths (or at least on all
- parts of paths) that contain a reference to a node in another
- picture. The reason is that, otherwise, \tikzname\ will attempt to
- make the current picture large enough to encompass \emph{the node in
- the other picture}. However, on a second run of \TeX\ this will
- create an even bigger picture, leading to larger and larger
- pictures. Unless you know what you are doing, I suggest specifying
- the |overlay| option with all pictures that contain references to
- other pictures.
+ This option is mainly intended for use when nodes in other pictures are
+ referenced, but you can also use it in other situations. The effect of this
+ option is that everything within the current scope is not taken into
+ consideration when the bounding box of the current picture is computed.
+
+ You need to specify this option on all paths (or at least on all parts of
+ paths) that contain a reference to a node in another picture. The reason is
+ that, otherwise, \tikzname\ will attempt to make the current picture large
+ enough to encompass \emph{the node in the other picture}. However, on a
+ second run of \TeX\ this will create an even bigger picture, leading to
+ larger and larger pictures. Unless you know what you are doing, I suggest
+ specifying the |overlay| option with all pictures that contain references
+ to other pictures.
\end{key}
-Let us now have a look at a few examples. These examples work only if
-this document is processed with a driver that supports picture
-remembering.
+Let us now have a look at a few examples. These examples work only if this
+document is processed with a driver that supports picture remembering.
\medskip
-\noindent\begin{minipage}{\textwidth}
-Inside the current text we place two pictures, containing nodes named
-|n1| and |n2|, using
+\noindent%
+\begin{minipage}{\textwidth}
+Inside the current text we place two pictures, containing nodes named |n1| and
+|n2|, using
+%
\begin{codeexample}[code only]
\tikz[remember picture] \node[circle,fill=red!50] (n1) {};
\end{codeexample}
-which yields \tikz[remember picture] \node[circle,fill=red!50] (n1)
-{};, and
+%
+which yields \tikz[remember picture] \node[circle,fill=red!50] (n1) {};, and
+%
\begin{codeexample}[code only]
\tikz[remember picture] \node[fill=blue!50] (n2) {};
\end{codeexample}
-yielding the node \tikz[remember picture] \node[fill=blue!50] (n2)
-{};. To connect these nodes, we create another picture using the
-|overlay| option and also the |remember picture| option.
+%
+yielding the node \tikz[remember picture] \node[fill=blue!50] (n2) {};. To
+connect these nodes, we create another picture using the |overlay| option and
+also the |remember picture| option.
+%
\begin{codeexample}[]
\begin{tikzpicture}[remember picture,overlay]
\draw[->,very thick] (n1) -- (n2);
\end{tikzpicture}
\end{codeexample}
-Note that the last picture is seemingly empty. What happens is that it
-has zero size and contains an arrow that lies well outside its bounds.
-As a last example, we connect a node in another picture to the first
-two nodes. Here, we provide the |overlay| option only with the line
-that we do not wish to count as part of the picture.
+%
+Note that the last picture is seemingly empty. What happens is that it has zero
+size and contains an arrow that lies well outside its bounds. As a last
+example, we connect a node in another picture to the first two nodes. Here, we
+provide the |overlay| option only with the line that we do not wish to count as
+part of the picture.
+%
\begin{codeexample}[]
\begin{tikzpicture}[remember picture]
\node (c) [circle,draw] {Big circle};
@@ -2824,18 +2941,17 @@ that we do not wish to count as part of the picture.
\subsubsection{Referencing the Current Page Node -- Absolute Positioning}
-There is a special node called |current page| that can be used to
-access the current page. It is a node of shape rectangle whose
-|south west| anchor is the lower left corner of the page and whose
-|north east| anchor is the upper right corner of the page. While this
-node is handled in a special way internally, you can reference it as
-if it were defined in some remembered picture other than the current
-one. Thus, by giving the |remember picture| and the |overlay|
-options to a picture, you can position nodes \emph{absolutely} on a
-page.
+There is a special node called |current page| that can be used to access the
+current page. It is a node of shape rectangle whose |south west| anchor is the
+lower left corner of the page and whose |north east| anchor is the upper right
+corner of the page. While this node is handled in a special way internally, you
+can reference it as if it were defined in some remembered picture other than
+the current one. Thus, by giving the |remember picture| and the |overlay|
+options to a picture, you can position nodes \emph{absolutely} on a page.
-The first example places some text in the lower left corner of the
-current page:
+The first example places some text in the lower left corner of the current
+page:
+%
\begin{codeexample}[]
\begin{tikzpicture}[remember picture,overlay]
\node [xshift=1cm,yshift=1cm] at (current page.south west)
@@ -2848,6 +2964,7 @@ current page:
\end{codeexample}
The next example adds a circle in the middle of the page.
+%
\begin{codeexample}[]
\begin{tikzpicture}[remember picture,overlay]
\draw [line width=1mm,opacity=.25]
@@ -2855,9 +2972,9 @@ The next example adds a circle in the middle of the page.
\end{tikzpicture}
\end{codeexample}
-The final example overlays some text over the page (depending on where
-this example is found on the page, the text may also be behind the
-page).
+The final example overlays some text over the page (depending on where this
+example is found on the page, the text may also be behind the page).
+%
\begin{codeexample}[]
\begin{tikzpicture}[remember picture,overlay]
\node [rotate=60,scale=10,text opacity=0.2]
@@ -2866,66 +2983,65 @@ page).
\end{codeexample}
-
\subsection{Late Code and Late Options}
\label{section-node-also}
-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. For this, the following version of the |node| path
-command can be used:
+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. For this, the following
+version of the |node| path command can be used:
\begin{pathoperation}{node also}{\opt{|[|\meta{late options}|]|}|(|\meta{name}|)|}
- Note that the \meta{name} is compulsory and that \emph{no} text may
- be given. Also, the ordering of options and node label must be as above.
-
- The effect of the above is the following effect: The node
- \meta{name} must already be existing. Now, the \meta{late 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 these ``late''
- options. However, giving the |append after command| and
- |prefix after command| options inside
- the \meta{late 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
- already been constructed.
-
+ Note that the \meta{name} is compulsory and that \emph{no} text may be
+ given. Also, the ordering of options and node label must be as above.
+
+ The effect of the above is the following effect: The node \meta{name} must
+ already be existing. Now, the \meta{late 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 these ``late'' options. However, giving the
+ |append after command| and |prefix after command| options inside the
+ \meta{late 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 already been
+ constructed.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node [draw,circle] (a) {Hello};
\node also [label=above:world] (a);
\end{tikzpicture}
\end{codeexample}
+ %
\end{pathoperation}
-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:
+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.
+ Expands to the last node on the path.
\end{command}
Instead of the |node also| syntax, you can also the following option:
\begin{key}{/tikz/late options=\meta{options}}
- This option can be given on a path (but not as an argument to a
- |node| path command) and has the same effect as the |node also| path
- command. Inside the \meta{options}, you should use the |name| option
- to specify the node for which you wish to add late options:
-
+ This option can be given on a path (but not as an argument to a |node| path
+ command) and has the same effect as the |node also| path command. Inside
+ the \meta{options}, you should use the |name| option to specify the node
+ for which you wish to add late options:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node [draw,circle] (a) {Hello};
\path [late options={name=a, label=above:world}];
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
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 a02a9111430..fcd5ef673c6 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
@@ -7,89 +7,79 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Transformations}
-\pgfname\ has a powerful transformation mechanism that is similar to
-the transformation capabilities of \textsc{metafont}. The present
-section explains how you can access it in \tikzname.
+\pgfname\ has a powerful transformation mechanism that is similar to the
+transformation capabilities of \textsc{metafont}. The present section explains
+how you can access it in \tikzname.
\subsection{The Different Coordinate Systems}
It is a long process from a coordinate like, say, $(1,2)$ or
-$(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.
-
-In detail, (at least) the following transformations are applied to a
-coordinate like $(1,2)$ before a point on the screen is chosen:
+$(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.
+
+In detail, (at least) the following transformations are applied to a coordinate
+like $(1,2)$ before a point on the screen is chosen:
+%
\begin{enumerate}
-\item
- \pgfname\ interprets a coordinate like $(1,2)$ in its
- $xy$-coordinate system as ``add the current $x$-vector once and the
- 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
- inside the picture.
-\item
- The backend driver (like |dvips| or |pdftex|) adds transformation
- commands such that the coordinate is shifted to the correct position in
- \TeX's page coordinate system.
-\item
- \textsc{pdf} (or PostScript) apply the canvas transformation
- matrix to the point, which can once more change the position on the
- 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.
+ \item \pgfname\ interprets a coordinate like $(1,2)$ in its
+ $xy$-coordinate system as ``add the current $x$-vector once and the
+ 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
+ inside the picture.
+ \item The backend driver (like |dvips| or |pdftex|) adds transformation
+ commands such that the coordinate is shifted to the correct position in
+ \TeX's page coordinate system.
+ \item \textsc{pdf} (or PostScript) apply the canvas transformation matrix
+ to the point, which can once more change the position on the 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.
\end{enumerate}
-In reality, the process is even more involved, but the above should
-give the idea: A point is constantly transformed by changes of the
-coordinate system.
+In reality, the process is even more involved, but the above should give the
+idea: A point is constantly transformed by changes of the coordinate system.
-In \tikzname, you only have access to the first two coordinate systems:
-The $xy$-coordinate system and the coordinate transformation matrix
-(these will be explained later). \pgfname\ also allows you to change
-the canvas transformation matrix, but you have to use commands of
-the core layer directly to do so and you ``better know what you are
-doing'' when you do this. The moment you start modifying the
-canvas matrix, \pgfname\ immediately loses track of all
-coordinates and shapes, anchors, and bounding box computations will no
-longer work.
+In \tikzname, you only have access to the first two coordinate systems: The
+$xy$-coordinate system and the coordinate transformation matrix (these will be
+explained later). \pgfname\ also allows you to change the canvas transformation
+matrix, but you have to use commands of the core layer directly to do so and
+you ``better know what you are doing'' when you do this. The moment you start
+modifying the canvas matrix, \pgfname\ immediately loses track of all
+coordinates and shapes, anchors, and bounding box computations will no longer
+work.
\subsection{The XY- and XYZ-Coordinate Systems}
\label{section-xyz}
The first and easiest coordinate systems are \pgfname's $xy$- and
-$xyz$-coordinate systems. The idea is very simple: Whenever you
-specify a coordinate like |(2,3)| this means $2v_x + 3v_y$, where
-$v_x$ is the current \emph{$x$-vector} and $v_y$ is the current
-\emph{$y$-vector}. Similarly, the coordinate |(1,2,3)| means $v_x +
-2v_y + 3v_z$.
+$xyz$-coordinate systems. The idea is very simple: Whenever you specify a
+coordinate like |(2,3)| this means $2v_x + 3v_y$, where $v_x$ is the current
+\emph{$x$-vector} and $v_y$ is the current \emph{$y$-vector}. Similarly, the
+coordinate |(1,2,3)| means $v_x + 2v_y + 3v_z$.
-Unlike other packages, \pgfname\ does not insist that $v_x$ actually
-has a $y$-component of $0$, that is, that it is a horizontal
-vector. Instead, the $x$-vector can point anywhere you
-want. Naturally, \emph{normally} you will want the $x$-vector to point
-horizontally.
+Unlike other packages, \pgfname\ does not insist that $v_x$ actually has a
+$y$-component of $0$, that is, that it is a horizontal vector. Instead, the
+$x$-vector can point anywhere you want. Naturally, \emph{normally} you will
+want the $x$-vector to point horizontally.
-One undesirable effect of this flexibility is that it is not possible
-to provide mixed coordinates as in $(1,2\mathrm{pt})$. Life is hard.
+One undesirable effect of this flexibility is that it is not possible to
+provide mixed coordinates as in $(1,2\mathrm{pt})$. Life is hard.
-To change the $x$-, $y$-, and $z$-vectors, you can use the following
-options:
+To change the $x$-, $y$-, and $z$-vectors, you can use the following 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 set up to point
- \meta{value} to the right, that is, to $(\meta{value},0pt)$.
-
+ If \meta{value} is a dimension, the $x$-vector of \pgfname's
+ $xyz$-coordinate system is set up to point \meta{value} to the right, that
+ is, to $(\meta{value},0pt)$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) -- +(1,0);
@@ -101,15 +91,15 @@ options:
\tikz \draw[x=1.5cm] (0,0) grid (2,2);
\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,
- the $x$-vector is only used to determine the coordinate of the upper
- right corner of the grid.
-
- 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.
+ 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, the
+ $x$-vector is only used to determine the coordinate of the upper right
+ corner of the grid.
+ 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) -- (1,0);
@@ -117,9 +107,9 @@ options:
\end{tikzpicture}
\end{codeexample}
- You can use this, for example, to exchange the meaning of the $x$- and
- $y$-coordinate.
-
+ You can use this, for example, to exchange the meaning of the $x$- and
+ $y$-coordinate.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[smooth]
\draw plot coordinates{(1,0) (2,0.5) (3,0) (3,1)};
@@ -127,17 +117,18 @@ options:
plot coordinates{(1,0) (2,0.5) (3,0) (3,1)};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/y=\meta{value} (initially 1cm)}
- Works like the |x=| option, only if \meta{value} is a dimension, the
- resulting vector points to $(0,\meta{value})$.
+ Works like the |x=| option, only if \meta{value} is a dimension, the
+ resulting vector points to $(0,\meta{value})$.
\end{key}
\begin{key}{/tikz/z=\meta{value} (initially \normalfont$-3.85$mm)}
- Works like the |y=| option, but now a dimension is the point
- $(\meta{value},\meta{value})$.
-
+ Works like the |y=| option, but now a dimension is the point
+ $(\meta{value},\meta{value})$.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[z=-1cm,->,thick]
\draw[color=red] (0,0,0) -- (1,0,0);
@@ -145,30 +136,28 @@ options:
\draw[color=orange] (0,0,0) -- (0,0,1);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\subsection{Coordinate Transformations}
\pgfname\ and \tikzname\ allow you to specify \emph{coordinate
- transformations}. Whenever you specify a coordinate as in |(1,0)| or
-|(1cm,1pt)| or |(30:2cm)|, this coordinate is first
-``reduced'' to a position of the form ``$x$ points to the right and
- $y$ points upwards.'' For example, |(1in,5pt)| is reduced to
-``$72\frac{72}{100}$ points to the right and 5 points upwards'' and
-|(90:100pt)| means ``0pt to the right and 100 points upwards.''
-
-The next step is to apply the current \emph{coordinate transformation
- matrix} to the coordinate. For example, the coordinate
-transformation matrix might currently be set such that it adds a
-certain constant to the $x$ value. Also, it might be set up such that
-it, say, exchanges the $x$ and $y$ value. In general, any
-``standard'' transformation like translation, rotation, slanting, or
-scaling or any combination thereof is possible. (Internally, \pgfname\
-keeps track of a coordinate transformation matrix very much like the
-concatenation matrix used by \textsc{pdf} or PostScript.)
-
+transformations}. Whenever you specify a coordinate as in |(1,0)| or
+|(1cm,1pt)| or |(30:2cm)|, this coordinate is first ``reduced'' to a position
+of the form ``$x$ points to the right and $y$ points upwards''. For example,
+|(1in,5pt)| is reduced to ``$72\frac{72}{100}$ points to the right and 5 points
+upwards'' and |(90:100pt)| means ``0pt to the right and 100 points upwards''.
+
+The next step is to apply the current \emph{coordinate transformation matrix}
+to the coordinate. For example, the coordinate transformation matrix might
+currently be set such that it adds a certain constant to the $x$ value. Also,
+it might be set up such that it, say, exchanges the $x$ and $y$ value. In
+general, any ``standard'' transformation like translation, rotation, slanting,
+or scaling or any combination thereof is possible. (Internally, \pgfname\ keeps
+track of a coordinate transformation matrix very much like the concatenation
+matrix used by \textsc{pdf} or PostScript.)
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -181,42 +170,41 @@ concatenation matrix used by \textsc{pdf} or PostScript.)
\end{tikzpicture}
\end{codeexample}
-The most important aspect of the coordinate transformation matrix is
-\emph{that it applies to coordinates only!} In particular, the
-coordinate transformation has no effect on things like the line width
-or the dash pattern or the shading angle. In certain cases, it is not
-immediately clear whether the coordinate transformation matrix
-\emph{should} apply to a certain dimension. For example, should the
-coordinate transformation matrix apply to grids? (It does.) And what
-about the size of arced corners? (It does not.) The general rule is
-``If there is no `coordinate' involved, even `indirectly,' the matrix
-is not applied.'' However, sometimes, you simply have to try or look
-it up in the documentation whether the matrix will be applied.
-
-Setting the matrix cannot be done directly. Rather, all you can do is
-to ``add'' another transformation to the current matrix. However, all
-transformations are local to the current \TeX-group. All
-transformations are added using graphic options, which are described
-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.
-
+The most important aspect of the coordinate transformation matrix is \emph{that
+it applies to coordinates only!} In particular, the coordinate transformation
+has no effect on things like the line width or the dash pattern or the shading
+angle. In certain cases, it is not immediately clear whether the coordinate
+transformation matrix \emph{should} apply to a certain dimension. For example,
+should the coordinate transformation matrix apply to grids? (It does.) And what
+about the size of arced corners? (It does not.) The general rule is: ``If there
+is no `coordinate' involved, even `indirectly', the matrix is not applied.''.
+However, sometimes, you simply have to try or look it up in the documentation
+whether the matrix will be applied.
+
+Setting the matrix cannot be done directly. Rather, all you can do is to
+``add'' another transformation to the current matrix. However, all
+transformations are local to the current \TeX-group. All transformations are
+added using graphic options, which are described 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.
+%
\begin{codeexample}[]
\tikz \draw (0,0) rectangle (1,0.5) [xshift=2cm] (0,0) rectangle (1,0.5);
\end{codeexample}
A final word of warning: You should refrain from using ``aggressive''
-transformations like a scaling of a factor of 10000. The reason is
-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).
+transformations like a scaling of a factor of 10\,000. The reason is 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).
\begin{key}{/tikz/shift={\ttfamily\char`\{}\meta{coordinate}{\ttfamily\char`\}}}
- Adds the \meta{coordinate} to all coordinates.
+ Adds the \meta{coordinate} to all coordinates.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -225,19 +213,19 @@ singular (if you do not know what singular matrices are, you are blessed).
\draw[shift={(30:1cm)},red] (0,0) -- (1,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/shift only}
- This option does not take any parameter. Its effect is to cancel all
- current transformations except for the shifting. This means that the
- origin will remain where it is, but any rotation around the origin
- or scaling relative to the origin or skewing will no longer have an
- effect.
-
- 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.
-
+ This option does not take any parameter. Its effect is to cancel all
+ current transformations except for the shifting. This means that the origin
+ will remain where it is, but any rotation around the origin or scaling
+ relative to the origin or skewing will no longer have an effect.
+
+ 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -246,10 +234,12 @@ singular (if you do not know what singular matrices are, you are blessed).
\draw[rotate=30,xshift=2cm,shift only,red] (0,0) -- (1,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\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);
@@ -258,16 +248,17 @@ singular (if you do not know what singular matrices are, you are blessed).
\draw[xshift=-10pt,red] (0,0) -- (1,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/yshift=\meta{dimension}}
- Adds \meta{dimension} to the $y$ value of all coordinates.
+ Adds \meta{dimension} to the $y$ value of all coordinates.
\end{key}
\begin{key}{/tikz/scale=\meta{factor}}
- Multiplies all coordinates by the given \meta{factor}. The
- \meta{factor} should not be excessively large in absolute terms or
- very close to zero.
+ Multiplies all coordinates by the given \meta{factor}. The \meta{factor}
+ should not be excessively large in absolute terms or very close to zero.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -276,11 +267,13 @@ singular (if you do not know what singular matrices are, you are blessed).
\draw[scale=-1,red] (0,0) -- (1,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/scale around={\ttfamily\char`\{}\meta{factor}|:|\meta{coordinate}{\ttfamily\char`\}}}
- Scales the coordinate system by \meta{factor}, with the ``origin
- of scaling'' centered on \meta{coordinate} rather than the origin.
+ Scales the coordinate system by \meta{factor}, with the ``origin of
+ scaling'' centered on \meta{coordinate} rather than the origin.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -289,11 +282,12 @@ singular (if you do not know what singular matrices are, you are blessed).
\draw[scale around={2:(1,1)},red] (0,0) -- (1,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/xscale=\meta{factor}}
- Multiplies only the $x$-value of all coordinates by the given
- \meta{factor}.
+ Multiplies only the $x$-value of all coordinates by the given
+ \meta{factor}.
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -302,14 +296,16 @@ singular (if you do not know what singular matrices are, you are blessed).
\draw[xscale=-1,red] (0,0) -- (1,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/yscale=\meta{factor}}
- Multiplies only the $y$-value of all coordinates by \meta{factor}.
+ Multiplies only the $y$-value of all coordinates by \meta{factor}.
\end{key}
\begin{key}{/tikz/xslant=\meta{factor}}
- Slants the coordinate horizontally by the given \meta{factor}:
+ Slants the coordinate horizontally by the given \meta{factor}:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -318,11 +314,12 @@ singular (if you do not know what singular matrices are, you are blessed).
\draw[xslant=-1,red] (0,0) -- (1,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\begin{key}{/tikz/yslant=\meta{factor}}
- Slants the coordinate vertically by the given \meta{factor}:
+ Slants the coordinate vertically by the given \meta{factor}:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -331,11 +328,12 @@ singular (if you do not know what singular matrices are, you are blessed).
\draw[yslant=-1,red] (0,0) -- (1,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\begin{key}{/tikz/rotate=\meta{degree}}
- Rotates the coordinate system by \meta{degree}:
+ Rotates the coordinate system by \meta{degree}:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -344,11 +342,13 @@ singular (if you do not know what singular matrices are, you are blessed).
\draw[rotate=-20,red] (0,0) -- (1,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/rotate around={\ttfamily\char`\{}\meta{degree}|:|\meta{coordinate}{\ttfamily\char`\}}}
- Rotates the coordinate system by \meta{degree} around the point
- \meta{coordinate}.
+ Rotates the coordinate system by \meta{degree} around the point
+ \meta{coordinate}.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -357,18 +357,16 @@ singular (if you do not know what singular matrices are, you are blessed).
\draw[rotate around={-20:(1,1)},red] (0,0) -- (1,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\begin{key}{/tikz/rotate around x=\meta{angle}}
-
- This key sets the $x$, $y$ and $z$ vectors of the \pgfname\
- $xyz$-coordinate system so that they
- are rotated by \meta{angle} around the axis corresponding
- to the $x$-vector.
- The rotation is applied so that when looking towards the origin
- along this axis, positive angles result in an anticlockwise rotation.
-
+ This key sets the $x$, $y$ and $z$ vectors of the \pgfname\
+ $xyz$-coordinate system so that they are rotated by \meta{angle} around the
+ axis corresponding to the $x$-vector. The rotation is applied so that when
+ looking towards the origin along this axis, positive angles result in an
+ anticlockwise rotation.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[>=stealth]
\draw [->] (0,0,0) -- (2,0,0) node [at end, right] {$x$};
@@ -380,19 +378,16 @@ singular (if you do not know what singular matrices are, you are blessed).
\draw [blue, rotate around x=90] (0,0,0) -- (1,1,0) -- (1,0,0);
\end{tikzpicture}
\end{codeexample}
-
+ %
\end{key}
-
\begin{key}{/tikz/rotate around y=\meta{angle}}
-
- This key sets the $x$, $y$ and $z$ vectors of the \pgfname\
- $xyz$-coordinate system so that they
- are rotated by \meta{angle} around the axis corresponding
- to the $y$-vector.
- The rotation is applied so that when looking towards the origin
- along this axis, positive angles result in an anticlockwise rotation.
-
+ This key sets the $x$, $y$ and $z$ vectors of the \pgfname\
+ $xyz$-coordinate system so that they are rotated by \meta{angle} around
+ the axis corresponding to the $y$-vector. The rotation is applied so that
+ when looking towards the origin along this axis, positive angles result in
+ an anticlockwise rotation.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[>=stealth]
\draw [->] (0,0,0) -- (2,0,0) node [at end, right] {$x$};
@@ -404,19 +399,16 @@ singular (if you do not know what singular matrices are, you are blessed).
\draw [blue, rotate around y=-90] (0,0,0) -- (1,1,0) -- (1,0,0);
\end{tikzpicture}
\end{codeexample}
-
+ %
\end{key}
-
\begin{key}{/tikz/rotate around z=\meta{angle}}
-
- This key sets the $x$, $y$ and $z$ vectors of the \pgfname\
- $xyz$-coordinate system so that they
- are rotated by \meta{angle} around the axis corresponding
- to the $z$-vector.
- The rotation is applied so that when looking towards the origin
- along this axis, positive angles result in an anticlockwise rotation.
-
+ This key sets the $x$, $y$ and $z$ vectors of the \pgfname\
+ $xyz$-coordinate system so that they are rotated by \meta{angle} around the
+ axis corresponding to the $z$-vector. The rotation is applied so that when
+ looking towards the origin along this axis, positive angles result in an
+ anticlockwise rotation.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[>=stealth]
\draw [->] (0,0,0) -- (2,0,0) node [at end, right] {$x$};
@@ -428,19 +420,18 @@ singular (if you do not know what singular matrices are, you are blessed).
\draw [blue, rotate around z=90] (0,0) -- (1,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
-
+ %
\end{key}
-
\begin{key}{/tikz/cm={\ttfamily\char`\{}\meta{$a$}|,|\meta{$b$}|,|\meta{$c$}|,|\meta{$d$}|,|\meta{coordinate}{\ttfamily\char`\}}}
- applies the following transformation to all coordinates: Let $(x,y)$
- be the coordinate to be transformed and let \meta{coordinate}
- specify the point $(t_x,t_y)$. Then the new coordinate is given by
- $\left(\begin{smallmatrix} a & c \\ b & d\end{smallmatrix}\right)
- \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.
+ applies the following transformation to all coordinates: Let $(x,y)$ be the
+ coordinate to be transformed and let \meta{coordinate} specify the point
+ $(t_x,t_y)$. Then the new coordinate is given by
+ $\left(\begin{smallmatrix} a & c \\ b & d\end{smallmatrix}\right)
+ \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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -449,56 +440,53 @@ singular (if you do not know what singular matrices are, you are blessed).
\draw[cm={0,1,1,0,(1cm,1cm)},red] (0,0) -- (1,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/reset cm}
- Completely resets the coordinate transformation matrix to the
- identity matrix. This will destroy not only the transformations
- applied in the current scope, but also all transformations inherited
- from surrounding scopes. Do not use this option, unless you really,
- really know what you are doing.
+ Completely resets the coordinate transformation matrix to the identity
+ matrix. This will destroy not only the transformations applied in the
+ current scope, but also all transformations inherited from surrounding
+ scopes. Do not use this option, unless you really, really know what you are
+ doing.
\end{key}
-
-
\subsection{Canvas Transformations}
A \emph{canvas transformation}, see
-Section~\ref{section-design-transformations} for details, is best
-thought of as a transformation in which the drawing canvas is
-stretched or rotated. Imaging writing something on a balloon (the
-canvas) and then blowing air into the balloon: Not only does the text
-become larger, the thin lines also become larger. In particular, if
-you scale the canvas by a factor of two, all lines are twice as
-thick.
-
-Canvas transformations should be used with great care. In most
-circumstances you do \emph{not} want line widths to change in a
-picture as this creates visual inconsistency.
-
-Just as important, when
-you use canvas transformations \emph{\pgfname\ loses track of
- positions of nodes and of picture sizes} since it does not take the
-effect of canvas transformations into account when it computes
-coordinates of nodes (do not, however, rely on this; it may change in
-the future).
-
-Finally, note that a canvas transformation always applies to a path as
-a whole, it is not possible (as for coordinate transformations) to use
-different transformations in different parts of a path.
-
-In short, you should not use canvas transformations unless you really
-know what you are doing.
+Section~\ref{section-design-transformations} for details, is best thought of as
+a transformation in which the drawing canvas is stretched or rotated. Imaging
+writing something on a balloon (the canvas) and then blowing air into the
+balloon: Not only does the text become larger, the thin lines also become
+larger. In particular, if you scale the canvas by a factor of two, all lines
+are twice as thick.
+
+Canvas transformations should be used with great care. In most circumstances
+you do \emph{not} want line widths to change in a picture as this creates
+visual inconsistency.
+
+Just as important, when you use canvas transformations \emph{\pgfname\ loses
+track of positions of nodes and of picture sizes} since it does not take the
+effect of canvas transformations into account when it computes coordinates of
+nodes (do not, however, rely on this; it may change in the future).
+
+Finally, note that a canvas transformation always applies to a path as a whole,
+it is not possible (as for coordinate transformations) to use different
+transformations in different parts of a path.
+
+In short, you should not use canvas transformations unless you really know what
+you are doing.
\begin{key}{/tikz/transform canvas=\meta{options}}
- The \meta{options} should contain coordinate transformations options
- like |scale| or |xshift|. Multiple options can be given, their
- effects accumulate in the usual manner. The effect of these
- \meta{options} (immediately) changes the current canvas
- transformation matrix. The coordinate transformation matrix is not
- changed. Tracking of the picture size is (locally) switched off and
- the node coordinate will no longer be correct.
+ The \meta{options} should contain coordinate transformations options like
+ |scale| or |xshift|. Multiple options can be given, their effects
+ accumulate in the usual manner. The effect of these \meta{options}
+ (immediately) changes the current canvas transformation matrix. The
+ coordinate transformation matrix is not changed. Tracking of the picture
+ size is (locally) switched off and the node coordinate will no longer be
+ correct.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
@@ -507,4 +495,5 @@ know what you are doing.
\draw[transform canvas={rotate=180},red] (0,0) -- (1,1) -- (1,0);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
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 3891d152987..8d817df5aeb 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
@@ -9,153 +9,147 @@
\section{Transparency}
-
\label{section-tikz-transparency}
-
\subsection{Overview}
-Normally, when you paint something using any of \tikzname's commands
-(this includes stroking, filling, shading, patterns, and images), the
-newly painted objects totally obscure whatever was painted earlier in
-the same area.
-
-You can change this behaviour by using something that can be thought
-of as ``(semi)transparent colors.'' Such colors do not completely
-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 present section, we start with the different ways of specifying
-``how transparent'' newly drawn objects should be. The simplest way is
-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.
+Normally, when you paint something using any of \tikzname's commands (this
+includes stroking, filling, shading, patterns, and images), the newly painted
+objects totally obscure whatever was painted earlier in the same area.
-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.
+You can change this behaviour by using something that can be thought of as
+``(semi)transparent colors''. Such colors do not completely 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.
-\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.
+In the present section, we start with the different ways of specifying ``how
+transparent'' newly drawn objects should be. The simplest way is 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 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.
+\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.
-\subsection{Specifying a Uniform Opacity}
-Specifying a stroke and/or fill opacity is quite easy using the
-following options.
+\subsection{Specifying a Uniform Opacity}
+Specifying a stroke and/or fill opacity is quite easy using the following
+options.
\begin{key}{/tikz/draw opacity=\meta{value}}
- This option sets ``how transparent'' lines should be. A value of |1|
- means ``fully opaque'' or ``not transparent at all,'' a value of |0|
- means ``fully transparent'' or ``invisible.'' A value of |0.5|
- 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 sets ``how transparent'' lines should be. A value of |1| means
+ ``fully opaque'' or ``not transparent at all'', a value of |0| means
+ ``fully transparent'' or ``invisible''. A value of |0.5| yields lines that
+ are semitransparent.
+ Note that when you use PostScript as your output format, this option works
+ only with recent versions of Ghostscript.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[line width=1ex]
\draw (0,0) -- (3,1);
\filldraw [fill=yellow!80!black,draw opacity=0.5] (1,0) rectangle (2,1);
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-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.
+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.
\begin{key}{/tikz/opacity=\meta{value}}
- Sets both the drawing and filling opacity to \meta{value}.
-
- The following predefined styles make it easier to use this option:
- \begin{stylekey}{/tikz/transparent}
- Makes everything totally transparent and, hence, invisible.
+ Sets both the drawing and filling opacity to \meta{value}.
+ The following predefined styles make it easier to use this option:
+ %
+ \begin{stylekey}{/tikz/transparent}
+ Makes everything totally transparent and, hence, invisible.
+ %
\begin{codeexample}[]
\tikz{\fill[red] (0,0) rectangle (1,0.5);
\fill[transparent,red] (0.5,0) rectangle (1.5,0.25); }
\end{codeexample}
- \end{stylekey}
-
- \begin{stylekey}{/tikz/ultra nearly transparent}
- Makes everything, well, ultra nearly transparent.
+ \end{stylekey}
+ \begin{stylekey}{/tikz/ultra nearly transparent}
+ Makes everything, well, ultra nearly transparent.
+ %
\begin{codeexample}[]
\tikz{\fill[red] (0,0) rectangle (1,0.5);
\fill[ultra nearly transparent] (0.5,0) rectangle (1.5,0.25); }
\end{codeexample}
- \end{stylekey}
+ \end{stylekey}
- \begin{stylekey}{/tikz/very nearly transparent}
+ \begin{stylekey}{/tikz/very nearly transparent}
\begin{codeexample}[]
\tikz{\fill[red] (0,0) rectangle (1,0.5);
\fill[very nearly transparent] (0.5,0) rectangle (1.5,0.25); }
\end{codeexample}
- \end{stylekey}
+ \end{stylekey}
- \begin{stylekey}{/tikz/nearly transparent}
+ \begin{stylekey}{/tikz/nearly transparent}
\begin{codeexample}[]
\tikz{\fill[red] (0,0) rectangle (1,0.5);
\fill[nearly transparent] (0.5,0) rectangle (1.5,0.25); }
\end{codeexample}
- \end{stylekey}
+ \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}
+ \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}
+ \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); }
\end{codeexample}
- \end{stylekey}
+ \end{stylekey}
- \begin{stylekey}{/tikz/ultra nearly opaque}
+ \begin{stylekey}{/tikz/ultra nearly opaque}
\begin{codeexample}[]
\tikz{\fill[red] (0,0) rectangle (1,0.5);
\fill[ultra nearly opaque] (0.5,0) rectangle (1.5,0.25); }
\end{codeexample}
- \end{stylekey}
+ \end{stylekey}
- \begin{stylekey}{/tikz/opaque}
- This yields completely opaque drawings, which is the default.
+ \begin{stylekey}{/tikz/opaque}
+ This yields completely opaque drawings, which is the default.
+ %
\begin{codeexample}[]
\tikz{\fill[red] (0,0) rectangle (1,0.5);
\fill[opaque] (0.5,0) rectangle (1.5,0.25); }
\end{codeexample}
- \end{stylekey}
+ \end{stylekey}
\end{key}
-
\begin{key}{/tikz/fill opacity=\meta{value}}
- This option sets the opacity of fillings. In addition to filling
- 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 sets the opacity of fillings. In addition to filling
+ 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[thick,fill opacity=0.5]
\filldraw[fill=red] (0:1cm) circle (12mm);
@@ -172,10 +166,12 @@ option |opacity| sets both at the same time.
\node[fill opacity=0.5] at (3,2) {\huge B};
\end{tikzpicture}
\end{codeexample}
+ %
\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);
@@ -185,13 +181,12 @@ option |opacity| sets both at the same time.
at (1.5,0) {Lower node};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
-Note the following effect: If you set up a certain opacity for stroking
-or filling and you stroke or fill the same area twice, the effect
-accumulates:
-
+Note the following effect: If you set up a certain opacity for stroking or
+filling and you stroke or fill the same area twice, the effect accumulates:
+%
\begin{codeexample}[]
\begin{tikzpicture}[fill opacity=0.5]
\fill[red] (0,0) circle (1);
@@ -203,41 +198,37 @@ Often, this is exactly what you intend, but not always. You can use
transparency groups, see the end of this section, to change this.
-
\subsection{Blend Modes}
\label{section-blend-modes}
-A \emph{blend mode} specifies how colors mix when you paint on a
-canvas. Normally, if you paint a red box on a green circle, the red
-color will completely replace the green circle. However, in some
-situations you might also wish the red color to somehow ``mix'' or
-``blend'' with the green circle. We already saw that, using transparency,
-we can draw something without completely obscuring the
-background. \emph{Blending} is a similar operation, only here we mix
-colors in more complicated ways.
+A \emph{blend mode} specifies how colors mix when you paint on a canvas.
+Normally, if you paint a red box on a green circle, the red color will
+completely replace the green circle. However, in some situations you might also
+wish the red color to somehow ``mix'' or ``blend'' with the green circle. We
+already saw that, using transparency, we can draw something without completely
+obscuring the background. \emph{Blending} is a similar operation, only here we
+mix colors in more complicated ways.
-\emph{Note:} Blending is a rather ``advanced'' feature of
-\textsc{pdf}. Most renderers, let alone printers, will have trouble
-rendering blending correctly.
+\emph{Note:} Blending is a rather ``advanced'' feature of \textsc{pdf}. Most
+renderers, let alone printers, will have trouble rendering blending correctly.
\begin{key}{/tikz/blend mode=\meta{mode}}
- Sets the current blend mode to \meta{mode}. Here \meta{mode} must be
- one of the modes listed below. More details on these modes can also
- be found in Section 7.2.4 of the \textsc{pdf} Specification, version 1.7.
-
- In the following example, the blend mode is only used and set inside
- a transparency group (see also
- Section~\ref{section-transparency-groups}). This is because most
- renderers (viewing
- programs) have trouble rendering blending correctly otherwise. For
- instance, at the time of writing, the versions of Adobe's Reader and
- Apple's Preview render the following drawing very differently, if
- the transparency group is not used in the following example.
-
+ Sets the current blend mode to \meta{mode}. Here \meta{mode} must be one of
+ the modes listed below. More details on these modes can also be found in
+ Section~7.2.4 of the \textsc{pdf} Specification, version~1.7.
+
+ In the following example, the blend mode is only used and set inside a
+ transparency group (see also Section~\ref{section-transparency-groups}).
+ This is because most renderers (viewing programs) have trouble rendering
+ blending correctly otherwise. For instance, at the time of writing, the
+ versions of Adobe's Reader and Apple's Preview render the following drawing
+ very differently, if the transparency group is not used in the following
+ example.
+ %
\begin{codeexample}[]
\tikz {
\begin{scope}[transparency group]
- \begin{scope}[blend mode=screen]
+ \begin{scope}[blend mode=screen]
\fill[red!90!black] ( 90:.6) circle (1);
\fill[green!80!black] (210:.6) circle (1);
\fill[blue!90!black] (330:.6) circle (1);
@@ -246,16 +237,15 @@ rendering blending correctly.
}
\end{codeexample}
- Because of the trouble with rendering blending correctly outside
- transparency groups, there is a special key that establishes a
- transparency group and sets a blend mode simultaneously:
-
- \begin{key}{/tikz/blend group=\meta{mode}}
- This key can only be used with a scope (like
- |transparency group|). It will cause the current scope to become a
- transparency group and, inside this group, the blend mode will be
- set to \meta{mode}.
+ Because of the trouble with rendering blending correctly outside
+ transparency groups, there is a special key that establishes a transparency
+ group and sets a blend mode simultaneously:
+ \begin{key}{/tikz/blend group=\meta{mode}}
+ This key can only be used with a scope (like |transparency group|). It
+ will cause the current scope to become a transparency group and, inside
+ this group, the blend mode will be set to \meta{mode}.
+ %
\begin{codeexample}[]
\tikz [blend group=screen] {
\fill[red!90!black] ( 90:.6) circle (1);
@@ -263,186 +253,177 @@ rendering blending correctly.
\fill[blue!90!black] (330:.6) circle (1);
}
\end{codeexample}
- \end{key}
-
- Here is an overview of the effects of the different available blend
- modes. In the examples, we always have three circles drawn on
- top of each other (as in the example code earlier): We start with a
- triple of pure red, green, and blue. Below it, we have a triple of
- light versions of these three colors (|red!50|, |green!50|, and
- |blue!50|). Next comes the triple yellow, cyan, and magenta; again
- with a triple of light versions below it. The large example consists
- of three balls (produced using |ball color|) having the colors red,
- green, and blue, are drawn on top of each other just like the
- circles.
-
- \definecolor{rg}{rgb}{1,1,0}
- \definecolor{gb}{rgb}{0,1,1}
- \definecolor{br}{rgb}{1,0,1}
-
- \def\makeline#1#2#3{\leavevmode
- \hbox to 4cm{#1\hss}\ \hbox to
- 2cm{#2\hss}\ \begin{minipage}[t]{9cm}\raggedright#3\end{minipage}\par
- \textcolor{black!25}{\hrule height1pt}
- }
-
- \def\showmode#1#2{
- \makeline{
- \tikz [blend mode=#1,baseline=-.5ex] {
- \fill[red] ( 90:.5em) circle (.75em);
- \fill[green] (210:.5em) circle (.75em);
- \fill[blue] (330:.5em) circle (.75em);
- \scoped[yshift=-2.5em]{
- \fill[red!50] ( 90:.5em) circle (.75em);
- \fill[green!50] (210:.5em) circle (.75em);
- \fill[blue!50] (330:.5em) circle (.75em);
- }
+ \end{key}
+
+ Here is an overview of the effects of the different available blend modes.
+ In the examples, we always have three circles drawn on top of each other
+ (as in the example code earlier): We start with a triple of pure red,
+ green, and blue. Below it, we have a triple of light versions of these
+ three colors (|red!50|, |green!50|, and |blue!50|). Next comes the triple
+ yellow, cyan, and magenta; again with a triple of light versions below it.
+ The large example consists of three balls (produced using |ball color|)
+ having the colors red, green, and blue, are drawn on top of each other just
+ like the circles.
+
+ \definecolor{rg}{rgb}{1,1,0}
+ \definecolor{gb}{rgb}{0,1,1}
+ \definecolor{br}{rgb}{1,0,1}
+
+ \def\makeline#1#2#3{\leavevmode
+ \hbox to 40mm{#1\hss}\ \hbox to
+ 20.5mm{#2\hss}\ \begin{minipage}[t]{88.5mm}\raggedright#3\end{minipage}\par
+ \textcolor{black!25}{\hrule height1pt}
}
- \tikz [blend mode=#1,baseline=-.5ex] {
- \fill[rg] ( 90:.5em) circle (.75em);
- \fill[gb] (210:.5em) circle (.75em);
- \fill[br] (330:.5em) circle (.75em);
- \scoped[yshift=-2.5em]{
- \fill[rg!50] ( 90:.5em) circle (.75em);
- \fill[gb!50] (210:.5em) circle (.75em);
- \fill[br!50] (330:.5em) circle (.75em);
- }
+
+ \def\showmode#1#2{
+ \makeline{
+ \tikz [blend mode=#1,baseline=-.5ex] {
+ \fill[red] ( 90:.5em) circle (.75em);
+ \fill[green] (210:.5em) circle (.75em);
+ \fill[blue] (330:.5em) circle (.75em);
+ \scoped[yshift=-2.5em]{
+ \fill[red!50] ( 90:.5em) circle (.75em);
+ \fill[green!50] (210:.5em) circle (.75em);
+ \fill[blue!50] (330:.5em) circle (.75em);
+ }
+ }
+ \tikz [blend mode=#1,baseline=-.5ex] {
+ \fill[rg] ( 90:.5em) circle (.75em);
+ \fill[gb] (210:.5em) circle (.75em);
+ \fill[br] (330:.5em) circle (.75em);
+ \scoped[yshift=-2.5em]{
+ \fill[rg!50] ( 90:.5em) circle (.75em);
+ \fill[gb!50] (210:.5em) circle (.75em);
+ \fill[br!50] (330:.5em) circle (.75em);
+ }
+ }
+ \tikz [blend mode=#1,baseline=-.5ex+1.25em] {
+ \shade[ball color=red] ( 90:1em) circle (1.5em);
+ \shade[ball color=green] (210:1em) circle (1.5em);
+ \shade[ball color=blue] (330:1em) circle (1.5em);
+ }}{\verb|#1|}{#2}%
+ % this argument was changed from {|#1|}
+ % --> see <https://sourceforge.net/p/pgf/bugs/486/>
}
- \tikz [blend mode=#1,baseline=-.5ex+1.25em] {
- \shade[ball color=red] ( 90:1em) circle (1.5em);
- \shade[ball color=green] (210:1em) circle (1.5em);
- \shade[ball color=blue] (330:1em) circle (1.5em);
- }}{|#1|}{#2}}
-
- \medskip
- \makeline{\emph{Example}}{\emph{Mode}}{\emph{Explanations quoted from Table 7.2 of the
- \textsc{pdf} Specification, Version 1.7}}
- \showmode{normal}{When painting a pixel with a some color (called
- the ``source color''), the background color
- (called the ``backdrop'') is completely ignored.}
- \showmode{multiply}{Multiplies the backdrop and source color
- values. The result color is always at least as dark as
- either of the two constituent colors. Multiplying any color with
- black produces black; multiplying with white leaves the original
- color unchanged. Painting successive overlapping objects with a
- color other than black or white produces progressively darker
- colors.}
- \showmode{screen}{Multiplies the complements of the backdrop and
- source color values, then complements the result. The
- result color is always
- at least as light as either of the two constituent
- colors. Screening any color with white produces white; screening
- with black leaves the original color unchanged. The effect is
- similar to projecting multiple photographic slides
- simultaneously onto a single screen.}
- \showmode{overlay}{Multiplies or screens the colors, depending on
- the backdrop color value. Source colors overlay the backdrop
- while preserving its highlights and shadows. The backdrop color
- is not replaced but is mixed with the source color to reflect
- the lightness or darkness of the backdrop.}
- \showmode{darken}{Selects the darker of the backdrop and source
- colors. The backdrop is replaced with the source where the
- source is darker; otherwise, it is left unchanged.}
- \showmode{lighten}{Selects the lighter of the backdrop and source
- colors. The backdrop is replaced with the source where the
- source is lighter; otherwise, it is left unchanged.}
- \showmode{color dodge}{Brightens the backdrop color to reflect the
- source color. Painting with black produces no changes.}
- \showmode{color burn}{Darkens the backdrop color to reflect the
- source color. Painting with white produces no change.}
- \showmode{hard light}{Multiplies or screens the colors, depending
- on the source color value. The effect is similar to shining a
- harsh spotlight on the backdrop.}
- \showmode{soft light}{Darkens or lightens the colors, depending on
- the source color value. The effect is similar to shining a
- diffused spotlight on the backdrop.}
- \showmode{difference}{Subtracts the darker of the two constituent
- colors from the lighter color. Painting with white inverts the
- backdrop color; painting with black produces no change.}
- \showmode{exclusion}{Produces an effect similar to that of the
- Difference mode but lower in contrast. Painting with white
- inverts the backdrop color; painting with black produces no
- change.}
- \showmode{hue}{Creates a color with the hue of the source color
- and the saturation and luminosity of the backdrop color.}
- \showmode{saturation}{Creates a color with the saturation of the
- source color and the hue and luminosity of the backdrop
- color. Painting with this mode in an area of the backdrop that
- is a pure gray (no saturation) produces no change.}
- \showmode{color}{Creates a color with the hue and saturation of
- the source color and the luminosity of the backdrop color. This
- preserves the gray levels of the backdrop and is useful for
- coloring monochrome images or tinting color images.}
- \showmode{luminosity}{Creates a color with the luminosity of the
- source color and the hue and saturation of the backdrop
- color. This produces an inverse effect to that of the Color
- mode.}
-
-\end{key}
+ \medskip
+ \makeline{\emph{Example}}{\emph{Mode}}{\emph{Explanations quoted from
+ Table~7.2 of the \textsc{pdf} Specification, Version~1.7}}
+ \showmode{normal}{When painting a pixel with a some color (called the
+ ``source color''), the background color (called the ``backdrop'') is
+ completely ignored.}
+ \showmode{multiply}{Multiplies the backdrop and source color values. The
+ result color is always at least as dark as either of the two
+ constituent colors. Multiplying any color with black produces black;
+ multiplying with white leaves the original color unchanged. Painting
+ successive overlapping objects with a color other than black or white
+ produces progressively darker colors.}
+ \showmode{screen}{Multiplies the complements of the backdrop and source
+ color values, then complements the result. The result color is always
+ at least as light as either of the two constituent colors. Screening
+ any color with white produces white; screening with black leaves the
+ original color unchanged. The effect is similar to projecting multiple
+ photographic slides simultaneously onto a single screen.}
+ \showmode{overlay}{Multiplies or screens the colors, depending on the
+ backdrop color value. Source colors overlay the backdrop while
+ preserving its highlights and shadows. The backdrop color is not
+ replaced but is mixed with the source color to reflect the lightness or
+ darkness of the backdrop.}
+ \showmode{darken}{Selects the darker of the backdrop and source colors. The
+ backdrop is replaced with the source where the source is darker;
+ otherwise, it is left unchanged.}
+ \showmode{lighten}{Selects the lighter of the backdrop and source colors.
+ The backdrop is replaced with the source where the source is lighter;
+ otherwise, it is left unchanged.}
+ \showmode{color dodge}{Brightens the backdrop color to reflect the source
+ color. Painting with black produces no changes.}
+ \showmode{color burn}{Darkens the backdrop color to reflect the source
+ color. Painting with white produces no change.}
+ \showmode{hard light}{Multiplies or screens the colors, depending on the
+ source color value. The effect is similar to shining a harsh spotlight
+ on the backdrop.}
+ \showmode{soft light}{Darkens or lightens the colors, depending on the
+ source color value. The effect is similar to shining a diffused
+ spotlight on the backdrop.}
+ \showmode{difference}{Subtracts the darker of the two constituent colors
+ from the lighter color. Painting with white inverts the backdrop color;
+ painting with black produces no change.}
+ \showmode{exclusion}{Produces an effect similar to that of the Difference
+ mode but lower in contrast. Painting with white inverts the backdrop
+ color; painting with black produces no change.}
+ \showmode{hue}{Creates a color with the hue of the source color and the
+ saturation and luminosity of the backdrop color.}
+ \showmode{saturation}{Creates a color with the saturation of the source
+ color and the hue and luminosity of the backdrop color. Painting with
+ this mode in an area of the backdrop that is a pure gray (no
+ saturation) produces no change.}
+ \showmode{color}{Creates a color with the hue and saturation of the source
+ color and the luminosity of the backdrop color. This preserves the gray
+ levels of the backdrop and is useful for coloring monochrome images or
+ tinting color images.}
+ \showmode{luminosity}{Creates a color with the luminosity of the source
+ color and the hue and saturation of the backdrop color. This produces
+ an inverse effect to that of the Color mode.}
+\end{key}
\subsection{Fadings}
For complicated graphics, uniform transparency settings are not always
-sufficient. Suppose, for instance, that while you paint a picture, you
-want the transparency to vary smoothly from completely opaque to
-completely transparent. This is a ``shading-like'' transparency. For
-such a form of transparency I will use the term \emph{fading} (as a
-noun). They are also known as \emph{soft masks}, \emph{opacity masks},
-\emph{masks}, or \emph{soft clips}.
+sufficient. Suppose, for instance, that while you paint a picture, you want the
+transparency to vary smoothly from completely opaque to completely transparent.
+This is a ``shading-like'' transparency. For such a form of transparency I will
+use the term \emph{fading} (as a noun). They are also known as \emph{soft
+masks}, \emph{opacity masks}, \emph{masks}, or \emph{soft clips}.
\subsubsection{Creating Fadings}
-How do we specify a fading? This is a bit of an art since the
-underlying mechanism is quite powerful, but a bit difficult to use.
-
-Let us start with a bit of terminology. A \emph{fading} specifies for
-each point of an area the transparency of that 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.
-
-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 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
-fading picture is completely opaque in the fading and a black point of
-the fading picture is completely transparent in the fading. (The
-background of the fading picture is always transparent in the fading
-as if the background were black.)
-
-It is rather counter-intuitive that a \emph{white} pixel of the fading
-picture will be \emph{opaque} in the fading and a \emph{black} pixel
-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{percentage} percent 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},
-namely the library |fadings|. So, to use them, you have to say
-|\usetikzlibrary{fadings}| first.
+How do we specify a fading? This is a bit of an art since the underlying
+mechanism is quite powerful, but a bit difficult to use.
+
+Let us start with a bit of terminology. A \emph{fading} specifies for each
+point of an area the transparency of that 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.
+
+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
+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 fading picture is completely opaque in the fading and a
+black point of the fading picture is completely transparent in the fading. (The
+background of the fading picture is always transparent in the fading as if the
+background were black.)
+
+It is rather counter-intuitive that a \emph{white} pixel of the fading picture
+will be \emph{opaque} in the fading and a \emph{black} pixel 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{percentage} percent 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}, namely the library
+|fadings|. So, to use them, you have to say |\usetikzlibrary{fadings}| first.
\begin{environment}{{tikzfadingfrompicture}\oarg{options}}
- This command works like a |{tikzpicture}|, only the picture is not
- shown, but instead a fading is defined based on this picture. To set
- the name of the picture, use the |name| option (which is normally
- used to set the name of a node).
- \begin{key}{/tikz/name=\marg{name}}
- 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 gets more and more
- transparent from left to right, but is 50\% transparent for a large
- circle in the middle.
+ This command works like a |{tikzpicture}|, only the picture is not shown,
+ but instead a fading is defined based on this picture. To set the name of
+ the picture, use the |name| option (which is normally used to set the name
+ of a node).
+ %
+ \begin{key}{/tikz/name=\marg{name}}
+ 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 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]
@@ -461,9 +442,10 @@ namely the library |fadings|. So, to use them, you have to say
\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.''
+ %
+ 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''.
+ %
\begin{codeexample}[]
\begin{tikzfadingfrompicture}[name=tikz]
\node [text=transparent!20]
@@ -483,31 +465,32 @@ namely the library |fadings|. So, to use them, you have to say
\end{codeexample}
}%
- The same effect can also be achieved using knockout groups, see
- Section~\ref{section-transparency-groups}.
+ The same effect can also be achieved using knockout groups, see
+ Section~\ref{section-transparency-groups}.
\end{environment}
\begin{plainenvironment}{{tikzfadingfrompicture}\oarg{options}}
- The plain\TeX\ version of the environment.
+ The plain\TeX\ version of the environment.
\end{plainenvironment}
\begin{contextenvironment}{{tikzfadingfrompicture}\oarg{options}}
- The Con\TeX t version of the environment.
+ The Con\TeX t version of the environment.
\end{contextenvironment}
\begin{command}{\tikzfading\oarg{options}}
- This command is used to define a fading similarly to the way a
- 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
- you wish to use,
- \item extra options for setting the colors of the shading (typically
- you will set them to the color |transparent!|\meta{percentage}).
- \end{enumerate}
- Then, a new fading named \meta{name} will be created based on the
- shading.
-
+ This command is used to define a fading similarly to the way a 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 you
+ wish to use,
+ \item extra options for setting the colors of the shading (typically
+ you will set them to the color |transparent!|\meta{percentage}).
+ \end{enumerate}
+ %
+ Then, a new fading named \meta{name} will be created based on the shading.
+ %
\begin{codeexample}[]
\tikzfading[name=fade right,
left color=transparent!0,
@@ -539,15 +522,15 @@ 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{command}
-
\subsubsection{Fading a Path}
-A 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.
+A 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.
\pgfdeclarefading{fade down}{%
\tikzset{top color=pgftransparent!0,bottom color=pgftransparent!100}
@@ -559,14 +542,14 @@ 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
- \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
- specify |none| as \meta{name}, in which case fading for the path
- will be switched off in case it has been switched on by previous
- options or styles.
+ This option tells \tikzname\ that the current path should be faded 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 specify |none| as \meta{name}, in which case
+ fading for the path will be switched off in case it has been switched on by
+ previous options or styles.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[path fading=south]
% Checker board
@@ -582,19 +565,20 @@ fading for the current scope or path.
\end{tikzpicture}
\end{codeexample}
- \begin{key}{/tikz/fit fading=\meta{boolean} (default true, initially true)}
- When set to |true|, the fading is shifted and resized (in exactly
- the same way as a shading) so that it covers the current
- 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 ``punch out'' something.
- \end{key}
+ \begin{key}{/tikz/fit fading=\meta{boolean} (default true, initially true)}
+ When set to |true|, the fading is shifted and resized (in exactly the
+ same way as a shading) so that it covers the current 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 ``punch
+ out'' something.
+ \end{key}
- \begin{key}{/tikz/fading transform=\meta{transformation options}}
- The \meta{transformation options} are applied to the fading before
- it is used. For instance, if \meta{transformation options} is set
- to |rotate=90|, the fading is rotated by 90 degrees.
+ \begin{key}{/tikz/fading transform=\meta{transformation options}}
+ The \meta{transformation options} are applied to the fading before it
+ is used. For instance, if \meta{transformation options} is set to
+ |rotate=90|, the fading is rotated by 90 degrees.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[path fading=fade down]
% Checker board
@@ -607,15 +591,15 @@ fading for the current scope or path.
(3,0.75) ellipse (.75 and .5);
\end{tikzpicture}
\end{codeexample}
- \end{key}
-
- \begin{key}{/tikz/fading angle=\meta{degree}}
- A shortcut for |fading transform={rotate=|\meta{degree}|}|.
- \end{key}
+ \end{key}
- Note that you can ``fade just about anything.'' In particular, you
- can fade a shading.
+ \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
@@ -626,9 +610,9 @@ fading for the current scope or path.
\end{tikzpicture}
\end{codeexample}
- The |fade inside| of the following example is more transparent in the middle than on the
- outside.
-
+ The |fade inside| of the following example is more transparent in the
+ middle than on the outside.
+ %
\begin{codeexample}[]
\tikzfading[name=fade inside,
inner color=transparent!80,
@@ -643,13 +627,14 @@ fading for the current scope or path.
\end{tikzpicture}
\end{codeexample}
- Note that adding the |path fading| option to a node fades the
- (background) path, not the text itself. To fade the text, you need
- to use a scope fading (see below).
+ Note that adding the |path fading| option to a node fades the (background)
+ path, not the text itself. To fade the text, you need to use a scope fading
+ (see below).
\end{key}
-Note that using fadings in conjunction with patterns can create
-visually rather pleasing effects:
+Note that using fadings in conjunction with patterns can create visually rather
+pleasing effects:
+%
\begin{codeexample}[]
\tikzfading[name=middle,
top color=transparent!50,
@@ -672,31 +657,29 @@ visually rather pleasing effects:
\subsubsection{Fading a Scope}
-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
-works in a similar way: You add the |scope fading| option to a path in
-a scope -- typically the first one -- and then all subsequent drawings
-in the scope are faded. You will use a |transparency group| in
-conjunction, see the end of this section.
+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 works in a similar way: You add the
+|scope fading| option to a path in a scope -- typically the first one -- and
+then all subsequent drawings 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 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
- in the current scope, not just to the current path. In this regard,
- the option works very much like the |clip| option. (Note, however,
- that, unlike the |clip| option, fadings to not accumulate unless a
- transparency group is used.)
-
- The keys |fit fading| and |fading transform| have the same effect as
- for |path fading|. Also that, just as for |path fading|, providing
- 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.
-
+ 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 in the current scope, not just to the
+ current path. In this regard, the option works very much like the |clip|
+ option. (Note, however, that, unlike the |clip| option, fadings to not
+ accumulate unless a transparency group is used.)
+
+ The keys |fit fading| and |fading transform| have the same effect as for
+ |path fading|. Also that, just as for |path fading|, providing 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);
@@ -715,8 +698,9 @@ conjunction, see the end of this section.
\end{tikzpicture}
\end{codeexample}
- In the following example we resize the fading to the size of the
- whole picture:
+ In the following example we resize the fading to the size of the whole
+ picture:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\fill [black!20] (-2,-2) rectangle (2,2);
@@ -731,7 +715,8 @@ conjunction, see the end of this section.
\end{tikzpicture}
\end{codeexample}
- Scope fadings are also needed if you wish to fade a node.
+ Scope fadings are also needed if you wish to fade a node.
+ %
\begin{codeexample}[]
\tikz \node [scope fading=south,fading angle=45,text width=3.5cm]
{
@@ -740,17 +725,16 @@ conjunction, see the end of this section.
other ways.
};
\end{codeexample}
-
+ %
\end{key}
\subsection{Transparency Groups}
\label{section-transparency-groups}
-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.
-
+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.
+%
\begin{codeexample}[]
\begin{tikzpicture}[opacity=.5]
\draw [line width=5mm] (0,0) -- (2,2);
@@ -768,7 +752,7 @@ the desired effect.
\end{codeexample}
Transparency groups are used to render them correctly:
-
+%
\begin{codeexample}[]
\begin{tikzpicture}[opacity=.5]
\begin{scope}[transparency group]
@@ -790,22 +774,21 @@ Transparency groups are used to render them correctly:
\end{codeexample}
\begin{key}{/tikz/transparency group=\oarg{options}}
- This option can be given to a |scope|. It will have the following
- effect: The scope's contents is stroked\,/\penalty0\,filled
- ``ignoring any outside transparency.'' This means, all previous
- transparency settings are ignored (you can still set transparency
- inside the group, but never mind). For instance, in the forbidden
- sign example, the whole sign is first painted (conceptually) like
- the image on the left hand side. Note that some pixels of the sign
- 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
- \emph{fill} transparency settings are now applied to the resulting
- 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.
-
+ This option can be given to a |scope|. It will have the following effect:
+ The scope's contents is stroked\,/\penalty0\,filled ``ignoring any outside
+ transparency''. This means, all previous transparency settings are ignored
+ (you can still set transparency inside the group, but never mind). For
+ instance, in the forbidden sign example, the whole sign is first painted
+ (conceptually) like the image on the left hand side. Note that some pixels
+ of the sign 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 \emph{fill}
+ transparency settings are now applied to the resulting 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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\pattern[pattern=checkerboard,pattern color=black!15](-1,-1) rectangle (3,1);
@@ -818,13 +801,13 @@ Transparency groups are used to render them correctly:
\end{tikzpicture}
\end{codeexample}
- Note that in the example, the |opacity=.5| is not active inside the
- transparency group: The group is only established at beginning of
- the scope and all options given to the |{scope}| environment are set
- before the group is established. To change the opacity \emph{inside}
- the group, you need to open another scope inside it or use the
- |opacity| key with a command inside the group:
-
+ Note that in the example, the |opacity=.5| is not active inside the
+ transparency group: The group is only established at beginning of the scope
+ and all options given to the |{scope}| environment are set before the group
+ is established. To change the opacity \emph{inside} the group, you need to
+ open another scope inside it or use the |opacity| key with a command inside
+ the group:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\pattern[pattern=checkerboard,pattern color=black!15](-1,-1) rectangle (3,1);
@@ -839,21 +822,22 @@ Transparency groups are used to render them correctly:
\end{tikzpicture}
\end{codeexample}
- The \meta{options} are a list of comma-separated options:
- \begin{itemize}
- \item \declare{|knockout|} When this option is given inside the
- \meta{options}, the group becomes a so-called \emph{knockout}
- group. This means, essentially, that inside the group everything
- is painted as if the ``opacity'' of a line or area were just
- another color channel. In particular, if you paint a pixel with
- opacity $0$ inside a knockout group, this pixel becomes perfectly
- transparent immediately. In contrast, painting a pixel with
- something of opacity 0 normally has no effect.
+ The \meta{options} are a list of comma-separated options:
+ %
+ \begin{itemize}
+ \item \declare{|knockout|} When this option is given inside the
+ \meta{options}, the group becomes a so-called \emph{knockout}
+ group. This means, essentially, that inside the group everything is
+ painted as if the ``opacity'' of a line or area were just another
+ color channel. In particular, if you paint a pixel with opacity $0$
+ inside a knockout group, this pixel becomes perfectly transparent
+ immediately. In contrast, painting a pixel with something of
+ opacity $0$ normally has no effect.
- Not all renderers, let alone printers, will support
- this. At the time of writing, Apple's Preview will not show the
- following correctly (you should see the text \tikzname\ in the
- middle):
+ Not all renderers, let alone printers, will support this. At the
+ time of writing, Apple's Preview will not show the following
+ correctly (you should see the text \tikzname\ in the middle):
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\shade [left color=red,right color=blue] (-2,-1) rectangle (2,1);
@@ -864,35 +848,34 @@ Transparency groups are used to render them correctly:
\end{scope}
\end{tikzpicture}
\end{codeexample}
- In the example, we first draw a large shading and then, inside the
- transparency group ``overwrite'' most of this shading by a big
- white rectangle. The interesting part is the text of the node,
- which has opacity |0|. Normally, this would mean that nothing is
- shown. However, in a knockout group, we ``paint'' the text with an
- ``opacity zero'' color. The effect is that part of the totally
- opaque white rectangle gets overwritten by a perfectly transparent
- area (namely exactly the area taken up by the pixels of the
- text). When this whole knockout group is then placed on top of the
- shading, the shading will ``shine through'' at the knocked-out
- pixels.
-
- \item \declare{|isolated|}|=false| A group can be isolated or
- not. By default, they are isolated, since this is typically what you
- want. For details on what isolated groups are, exactly, see
- Section~7.3.4 of the \textsc{pdf} Specification, version 1.7.
- \end{itemize}
-
- Note that when a transparency group is created, \tikzname\ must
- correctly determine the size of the material inside the
- group. Usually, this is no problem, but when you use things like
- |overlay| or |transform canvas|, trouble may result. In this case,
- please consult Section~\ref{section-transparency} on how to sidestep
- this problem in such cases.
+ %
+ In the example, we first draw a large shading and then, inside the
+ transparency group ``overwrite'' most of this shading by a big
+ white rectangle. The interesting part is the text of the node,
+ which has opacity |0|. Normally, this would mean that nothing is
+ shown. However, in a knockout group, we ``paint'' the text with an
+ ``opacity zero'' color. The effect is that part of the totally
+ opaque white rectangle gets overwritten by a perfectly transparent
+ area (namely exactly the area taken up by the pixels of the text).
+ When this whole knockout group is then placed on top of the
+ shading, the shading will ``shine through'' at the knocked-out
+ pixels.
+
+ \item \declare{|isolated|}|=false| A group can be isolated or not. By
+ default, they are isolated, since this is typically what you want.
+ For details on what isolated groups are, exactly, see Section~7.3.4
+ of the \textsc{pdf} Specification, version~1.7.
+ \end{itemize}
+
+ Note that when a transparency group is created, \tikzname\ must correctly
+ determine the size of the material inside the group. Usually, this is no
+ problem, but when you use things like |overlay| or |transform canvas|,
+ trouble may result. In this case, please consult
+ Section~\ref{section-transparency} on how to sidestep this problem in such
+ cases.
\end{key}
-
-
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual"
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 cdf2cf45456..91d2030c385 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
@@ -7,15 +7,15 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\section{Making Trees Grow}
+\section{Making Trees Grow}
\label{section-trees}
-
\subsection{Introduction to the Child Operation}
-\emph{Trees} are a common way of visualizing hierarchical
-structures. A simple tree looks like this:
+\emph{Trees} are a common way of visualizing hierarchical structures. A simple
+tree looks like this:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\node {root}
@@ -27,13 +27,13 @@ structures. A simple tree looks like this:
\end{tikzpicture}
\end{codeexample}
-Admittedly, in reality trees are more likely to grow \emph{upward} and
-not downward as above. You can tell whether the author of a paper is a
-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 specified as
-follows:
+Admittedly, in reality trees are more likely to grow \emph{upward} and not
+downward as above. You can tell whether the author of a paper is a
+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 specified as follows:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\node {root} [grow'=up]
@@ -45,65 +45,69 @@ follows:
\end{tikzpicture}
\end{codeexample}
-In \tikzname, there are two ways of specifying trees: Using either the
-|graph| path operation, which is covered in
-Section~\ref{section-library-graphs}, or using the |child| path
-operation, which is covered in the present section. Both methods have
-their advantages.
+In \tikzname, there are two ways of specifying trees: Using either the |graph|
+path operation, which is covered in Section~\ref{section-library-graphs}, or
+using the |child| path operation, which is covered in the present section. Both
+methods have their advantages.
-In \tikzname, trees are specified by adding \emph{children} to a
-node on a path using the |child| operation:
+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}}}
- 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
- that).
-
- When a |node| operation like |node {X}| is followed by |child|,
- \tikzname\ starts counting the number of child nodes that follow the
- original |node {X}|. For this, it scans the input and stores away each
- |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.
-
- Once the children have been collected and counted, \tikzname\ starts
- generating the child nodes. For each child of a parent node
- \tikzname\ computes an appropriate position where the child is
- placed. For each child, the coordinate system is transformed so that
- the origin is at this position. Then the \meta{child path} is
- drawn. Typically, the child path just consists of a |node|
- specification, which results in a node being drawn at the child's
- position. Finally, an edge is drawn from the first node in the
- \meta{child path} to the parent node.
-
- The optional |foreach| part (note that there is no backslash before
- |foreach|) allows you to specify multiple children in a single
- |child| command. The idea is the following: A |\foreach| statement
- is (internally) used to iterate over the list of \meta{values}. For
- 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
+ \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 that).
+
+ When a |node| operation like |node {X}| is followed by |child|, \tikzname\
+ starts counting the number of child nodes that follow the original
+ |node {X}|. For this, it scans the input and stores away each |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.
+
+ Once the children have been collected and counted, \tikzname\ starts
+ generating the child nodes. For each child of a parent node \tikzname\
+ computes an appropriate position where the child is placed. For each child,
+ the coordinate system is transformed so that the origin is at this
+ position. Then the \meta{child path} is drawn. Typically, the child path
+ just consists of a |node| specification, which results in a node being
+ drawn at the child's position. Finally, an edge is drawn from the first
+ node in the \meta{child path} to the parent node.
+
+ The optional |foreach| part (note that there is no backslash before
+ |foreach|) allows you to specify multiple children in a single |child|
+ command. The idea is the following: A |\foreach| statement is (internally)
+ used to iterate over the list of \meta{values}. For 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
+ %
\begin{codeexample}[code only]
node {root} child [red] foreach \name in {1,2} {node {\name}}
\end{codeexample}
- the effect will be the same as if you had said
+ %
+ the effect will be the same as if you had said
+ %
\begin{codeexample}[code only]
node {root} child[red] {node {1}} child[red] {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}
- the effect will be the same as for
+ %
+ the effect will be the same as for
+ %
\begin{codeexample}[code only]
node {root} child[left] {node[left] {1}} child[right] {node[right] {2}}
\end{codeexample}
- You can nest things as in the following example:
+ You can nest things as in the following example:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[level distance=4mm,level/.style={sibling distance=8mm/#1}]
@@ -114,30 +118,29 @@ node {root} child[left] {node[left] {1}} child[right] {node[right] {2}}
\end{tikzpicture}
\end{codeexample}
- The details and options for this operation are described in the rest
- of this present section.
+ The details and options for this operation are described in the rest of
+ this present section.
\end{pathoperation}
-
\subsection{Child Paths and Child Nodes}
-For each |child| of a root node, its \meta{child path} is inserted at
-a specific location in the picture (the placement rules are discussed
-in Section~\ref{section-tree-placement}). The first node in the
-\meta{child path}, if it exists, is special and called the \emph{child
- node}. If there is no first node in the \meta{child path}, that is,
-if the \meta{child path} is missing (including the curly braces) or if
-it does not start with |node| or with |coordinate|, then an empty
-child node of shape |coordinate| is automatically added.
-
-Consider the example |\node {x} child {node {y}} child;|. For the
-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
-around, or use options to influence how it is rendered.
+For each |child| of a root node, its \meta{child path} is inserted at a
+specific location in the picture (the placement rules are discussed in
+Section~\ref{section-tree-placement}). The first node in the \meta{child path},
+if it exists, is special and called the \emph{child node}. If there is no first
+node in the \meta{child path}, that is, if the \meta{child path} is missing
+(including the curly braces) or if it does not start with |node| or with
+|coordinate|, then an empty child node of shape |coordinate| is automatically
+added.
+
+Consider the example |\node {x} child {node {y}} child;|. For the 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 around, or
+use options to influence how it is rendered.
+%
\begin{codeexample}[]
\begin{tikzpicture}[sibling distance=15mm]
\node[rectangle,draw] {root}
@@ -147,14 +150,13 @@ around, or use options to influence how it is rendered.
\end{tikzpicture}
\end{codeexample}
-In many cases, the \meta{child path} will just consist of a
-specification of a child node and, possibly, children of this child
-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:
-
+In many cases, the \meta{child path} will just consist of a specification of a
+child node and, possibly, children of this child 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:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\node {root}
@@ -163,56 +165,49 @@ is an example:
\end{tikzpicture}
\end{codeexample}
-
-At the end of the \meta{child path} you may add a special path
-operation called |edge from parent|. If this operation is not given by
-yourself somewhere on the path, it will be automatically added at the
-end. This option causes a connecting edge from the parent node to the
-child node to be added to the path. By giving options to this
-operation you can influence how the edge is rendered. Also, nodes
-following the |edge from parent| operation will be placed on this
+At the end of the \meta{child path} you may add a special path operation called
+|edge from parent|. If this operation is not given by yourself somewhere on the
+path, it will be automatically added at the end. This option causes a
+connecting edge from the parent node to the child node to be added to the path.
+By giving options to this operation you can influence how the edge is rendered.
+Also, nodes following the |edge from parent| operation will be placed on this
edge, see Section~\ref{section-edge-from-parent} for details.
To sum up:
+%
\begin{enumerate}
-\item
- The child path starts with a node specification. If it is not there,
- it is added automatically.
-\item
- The child path ends with a |edge from parent| operation, possibly
- followed by nodes to be put on this edge. If the operation is not
- given at the end, it is added automatically.
+ \item The child path starts with a node specification. If it is not there,
+ it is added automatically.
+ \item The child path ends with a |edge from parent| operation, possibly
+ followed by nodes to be put on this edge. If the operation is not given
+ at the end, it is added automatically.
\end{enumerate}
-
\subsection{Naming Child Nodes}
-Child nodes can be named like any other node using either the |name|
-option or the special syntax in which the name of the node is placed
-in round parentheses between the |node| operation and the node's
-text.
+Child nodes can be named like any other node using either the |name| option or
+the special syntax in which the name of the node is placed in round parentheses
+between the |node| operation and the node's text.
-If you do not assign a name to a child node, \tikzname\ will
-automatically assign a name as follows: Assume that the name of the
-parent node is, say, |parent|. (If you did not assign a
-name to the parent, \tikzname\ will do so itself, but that name will
-not be user-accessible.) The first child
-of |parent| will be named |parent-1|, the second child is named
-|parent-2|, and so on.
+If you do not assign a name to a child node, \tikzname\ will automatically
+assign a name as follows: Assume that the name of the parent node is, say,
+|parent|. (If you did not assign a name to the parent, \tikzname\ will do so
+itself, but that name will not be user-accessible.) The first child of |parent|
+will be named |parent-1|, the second child is named |parent-2|, and so on.
-This naming convention works recursively. If the second child
-|parent-2| has children, then the first of these children will be
-called |parent-2-1| and the second |parent-2-2| and so on.
+This naming convention works recursively. If the second child |parent-2| has
+children, then the first of these children will be called |parent-2-1| and the
+second |parent-2-2| and so on.
If you assign a name to a child node yourself, no name is generated
automatically (the node does not have two names). However, ``counting
-continues,'' which means that the third child of |parent| is called
-|parent-3| independently of whether you have assigned names to the
-first and/or second child of |parent|.
+continues'', which means that the third child of |parent| is called |parent-3|
+independently of whether you have assigned names to the first and/or second
+child of |parent|.
Here is an example:
-
+%
\begin{codeexample}[]
\begin{tikzpicture}[sibling distance=15mm]
\node (root) {root}
@@ -228,13 +223,13 @@ Here is an example:
\end{tikzpicture}
\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
-example:
-
+Each |child| may have its own \meta{options}, which apply to ``the whole
+child'', including all of its grandchildren. Here is an example:
+%
\begin{codeexample}[]
\begin{tikzpicture}
[thick,level 1/.style={sibling distance=15mm},
@@ -245,10 +240,10 @@ example:
\end{tikzpicture}
\end{codeexample}
-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.
-
+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}
@@ -256,11 +251,13 @@ this, the edges in the following tree are black, not red.
child;
\end{tikzpicture}
\end{codeexample}
- This raises the problem of how to set options for \emph{all}
- children. Naturally, you could always set options for the whole path
- as in |\path [red] node {root} child child;| but this is bothersome
- in some situations. Instead, it is easier to give the options
- \emph{before the first child} as follows:
+%
+This raises the problem of how to set options for \emph{all} children.
+Naturally, you could always set options for the whole path as in
+|\path [red] node {root} child child;| but this is bothersome in some
+situations. Instead, it is easier to give the options \emph{before the first
+child} as follows:
+%
\begin{codeexample}[]
\begin{tikzpicture}[thick]
\node [red] {root}
@@ -271,24 +268,20 @@ this, the edges in the following tree are black, not red.
\end{codeexample}
Here is the set of rules:
+%
\begin{enumerate}
-\item
- Options for the whole tree are given before the root node.
-\item
- Options for the root node are given directly to the |node| operation
- of the root.
-\item
- Options for all children can be given between the root node and the
- first child.
-\item
- Options applying to a specific child path are given as options to
- the |child| operation.
-\item
- Options applying to the node of a child, but not to the whole child
- path, are given as options to the |node| command inside the
- \meta{child path}.
+ \item Options for the whole tree are given before the root node.
+ \item Options for the root node are given directly to the |node| operation
+ of the root.
+ \item Options for all children can be given between the root node and the
+ first child.
+ \item Options applying to a specific child path are given as options to the
+ |child| operation.
+ \item Options applying to the node of a child, but not to the whole child
+ path, are given as options to the |node| command inside the \meta{child
+ path}.
\end{enumerate}
-
+%
\begin{codeexample}[code only]
\begin{tikzpicture}
\scoped
@@ -306,24 +299,25 @@ Here is the set of rules:
\end{codeexample}
There are additional styles that influence how children are rendered:
+%
\begin{stylekey}{/tikz/every child (initially \normalfont empty)}
- This style is used at the beginning of each child, as if you had
- given the style's contents as options to the |child| operation.
+ This style is used at the beginning of each child, as if you had given the
+ style's contents as options to the |child| operation.
\end{stylekey}
\begin{stylekey}{/tikz/every child node (initially \normalfont empty)}
- This style is used at the beginning of each child node in addition
- to the |every node| style.
+ This style is used at the beginning of each child node in addition to the
+ |every node| style.
\end{stylekey}
\begin{stylekey}{/tikz/level=\meta{number} (initially \normalfont empty)}
- This style is executed at the beginning of each set of children, where
- \meta{number} is the current level in the current tree. For example,
- when you say |\node {x} child child;|, then |level=1| is
- used before the first |child|. The style or code of this key will be
- passed \meta{number} as its first parameter. If this first |child|
- has children itself, then |level=2| would be used for them.
-
+ This style is executed at the beginning of each set of children, where
+ \meta{number} is the current level in the current tree. For example, when
+ you say |\node {x} child child;|, then |level=1| is used before the first
+ |child|. The style or code of this key will be passed \meta{number} as its
+ first parameter. If this first |child| has children itself, then |level=2|
+ would be used for them.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[level/.style={sibling distance=20mm/#1}]
\node {root}
@@ -331,13 +325,14 @@ There are additional styles that influence how children are rendered:
child { child child child };
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
\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|.
-
+ 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|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[level 1/.style={sibling distance=20mm},
@@ -347,57 +342,52 @@ There are additional styles that influence how children are rendered:
child { child child child };
\end{tikzpicture}
\end{codeexample}
+ %
\end{stylekey}
-
\subsection{Placing Child Nodes}
-
\label{section-tree-placement}
\subsubsection{Basic Idea}
-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
-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.
-
-In basic \tikzname, when you do not make use of the graph drawing
-facilities explained in Part~\ref{part-gd}, a comparatively simple
-approach is taken to placing the
-children. In order to compute a child's position, all that is taken
-into account is the number of the current child in the list of
-children and the number of children in this list. Thus, if a node has
-five children, then there is a fixed position for the first child, a
-position for the second child, and so on. These positions \emph{do not
- depend on the size of the children} and, hence, children can easily
-overlap. However, since you can use options to shift individual
-children a bit, this is not as great a problem as it may seem.
-
-Although the placement of the children only depends on their number in
-the list of children and the total number of children, everything else
-about the placement is highly configurable. You can change the
-distance between children (appropriately called the
-|sibling distance|) and the distance between levels of the tree. These
-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.
+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 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.
+
+In basic \tikzname, when you do not make use of the graph drawing facilities
+explained in Part~\ref{part-gd}, a comparatively simple approach is taken to
+placing the children. In order to compute a child's position, all that is taken
+into account is the number of the current child in the list of children and the
+number of children in this list. Thus, if a node has five children, then there
+is a fixed position for the first child, a position for the second child, and
+so on. These positions \emph{do not depend on the size of the children} and,
+hence, children can easily overlap. However, since you can use options to shift
+individual children a bit, this is not as great a problem as it may seem.
+
+Although the placement of the children only depends on their number in the list
+of children and the total number of children, everything else about the
+placement is highly configurable. You can change the distance between children
+(appropriately called the |sibling distance|) and the distance between levels
+of the tree. These 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.
-\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
-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
-is given by the |level distance|.
+\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 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 is given by the |level distance|.
+%
{\catcode`\|=12
\begin{codeexample}[]
\begin{tikzpicture}[sibling distance=15mm, level distance=15mm]
@@ -419,11 +409,11 @@ 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
- on which its children are arranged. When given to a single child,
- this will set the distance for this child only.
-
+ This key determines the distance between different levels of the 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}
@@ -453,12 +443,13 @@ is given by the |level distance|.
child;
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/sibling distance=\meta{distance} (initially 15mm)}
- This key specifies the distance between the anchors of the
- children of a parent node.
-
+ This key specifies the distance between the anchors of the children of a
+ parent node.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[level distance=4mm,
@@ -504,39 +495,37 @@ is given by the |level distance|.
};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-
\begin{key}{/tikz/grow=\meta{direction}}
- This key is used to define the \meta{direction} in which the tree
- will grow. The \meta{direction} can either be an angle in degrees or
- one of the following special text strings: |down|, |up|, |left|,
- |right|, |north|, |south|, |east|, |west|, |north east|,
- |north west|, |south east|, and |south west|. All of these have
- ``their obvious meaning,'' so, say, |south west| is the same as the
- angle $-135^\circ$.
-
- As a side effect, this option installs the default growth function.
-
- In addition to setting the direction, this option also has a
- seemingly strange effect: It sets the sibling distance for the
- current level to |0pt|, but leaves the sibling distance for later
- levels unchanged.
-
- This somewhat strange behaviour has a highly desirable effect: If
- you give this option before the list of children of a node starts,
- the ``current level'' is still the parent level. Each child will be
- on a later level and, hence, the sibling distance will be as
- specified originally. This will cause the children to be neatly
- aligned in a line orthogonal to the given \meta{direction}. However,
- if you give this option locally to a single child, then ``current
- level'' will be the same as the child's level. The zero sibling
- distance will then cause the child to be placed exactly at a point
- at distance |level distance| in the direction
- \meta{direction}. However, the children of the child will be placed
- ``normally'' on a line orthogonal to the \meta{direction}.
-
- These placement effects are best demonstrated by some examples:
+ This key is used to define the \meta{direction} in which the tree will
+ grow. The \meta{direction} can either be an angle in degrees or one of the
+ following special text strings: |down|, |up|, |left|, |right|, |north|,
+ |south|, |east|, |west|, |north east|, |north west|, |south east|, and
+ |south west|. All of these have ``their obvious meaning'', so, say,
+ |south west| is the same as the angle $-135^\circ$.
+
+ As a side effect, this option installs the default growth function.
+
+ In addition to setting the direction, this option also has a seemingly
+ strange effect: It sets the sibling distance for the current level to
+ |0pt|, but leaves the sibling distance for later levels unchanged.
+
+ This somewhat strange behaviour has a highly desirable effect: If you give
+ this option before the list of children of a node starts, the ``current
+ level'' is still the parent level. Each child will be on a later level and,
+ hence, the sibling distance will be as specified originally. This will
+ cause the children to be neatly aligned in a line orthogonal to the given
+ \meta{direction}. However, if you give this option locally to a single
+ child, then ``current level'' will be the same as the child's level. The
+ zero sibling distance will then cause the child to be placed exactly at a
+ point at distance |level distance| in the direction \meta{direction}.
+ However, the children of the child will be placed ``normally'' on a line
+ orthogonal to the \meta{direction}.
+
+ These placement effects are best demonstrated by some examples:
+ %
\begin{codeexample}[]
\tikz \node {root} [grow=right] child child;
\end{codeexample}
@@ -585,26 +574,26 @@ is given by the |level distance|.
child[grow=100,<-] {node[above] {the middle is here}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\begin{key}{/tikz/grow'=\meta{direction}}
- This key has the same effect as |grow|, only the children are
- arranged in the opposite order.
+ This key has the same effect as |grow|, only the children are arranged in
+ the opposite order.
\end{key}
\subsubsection{Missing Children}
-Sometimes one or more of the children of a node are ``missing.'' Such
-a missing child will count as a child with respect to the total number
-of children and also with respect to the current child count, but it
-will not be rendered.
+Sometimes one or more of the children of a node are ``missing''. Such a missing
+child will count as a child with respect to the total number of children and
+also with respect to the current child count, but it will not be rendered.
\begin{key}{/tikz/missing=\meta{true or false} (default true)}
- If this option is given to a child, the current child counter is
- increased, but the child is otherwise ignored. In particular, the
- normal contents of the child is completely ignored.
-
+ If this option is given to a child, the current child counter is increased,
+ but the child is otherwise ignored. In particular, the normal contents of
+ the child is completely ignored.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[level distance=10mm,sibling distance=5mm]
\node {root} [grow=down]
@@ -616,22 +605,23 @@ will not be rendered.
child { node {6} };
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
\subsubsection{Custom Growth Functions}
\begin{key}{/tikz/growth parent anchor=\meta{anchor} (initially center)}
- This key allows you to specify which anchor of the parent node is
- 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. ``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}.
-
- In the following example, the two red lines both have length |1cm|.
+ This key allows you to specify which anchor of the parent node is 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. ``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}.
+
+ In the following example, the two red lines both have length |1cm|.
+ %
\begin{codeexample}[]
\begin{tikzpicture}[level distance=1cm]
\node [rectangle,draw] (a) at (0,0) {root}
@@ -645,8 +635,9 @@ will not be rendered.
\end{tikzpicture}
\end{codeexample}
- In the next example, the top and bottom nodes are aligned at the top
- and the bottom, respectively.
+ In the next example, the top and bottom nodes are aligned at the top and
+ the bottom, respectively.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[level distance=2cm,growth parent anchor=north,
@@ -658,58 +649,56 @@ will not be rendered.
\node at (2,0) {big root} child {node {\large big}};
\end{tikzpicture}
\end{codeexample}
+ %
\end{key}
-\begin{key}{/tikz/growth function=\meta{macro name} (initially
- \normalfont an internal function)}
- This rather low-level option allows you to set a new growth
- function. The \meta{macro name} must be the name of a macro without
- parameters. This macro will be called for each child of a node. The
- initial function is an internal function that corresponds to
- downward growth.
-
- The effect of executing the macro should be the following: It should
- transform the coordinate system in such a way that the origin
- becomes the place where the current child should be anchored. When
- the macro is called, the current coordinate system will be set up
- such that the anchor of the parent node is in the origin. Thus, in
- each call, the \meta{macro name} must essentially do a shift to the
- child's origin. When the macro is called, the \TeX\ counter
- |\tikznumberofchildren| will be set to the total number of children
- of the parent node and the counter |\tikznumberofcurrentchild| will
- be set to the number of the current child.
-
- The macro may, in addition to shifting the coordinate system, also
- transform the coordinate system further. For example, it could be
- rotated or scaled.
-
- Additional growth functions are defined in the library, see
- Section~\ref{section-tree-library}.
+\begin{key}{/tikz/growth function=\meta{macro name} (initially \normalfont an internal function)}
+ This rather low-level option allows you to set a new growth function. The
+ \meta{macro name} must be the name of a macro without parameters. This
+ macro will be called for each child of a node. The initial function is an
+ internal function that corresponds to downward growth.
+
+ The effect of executing the macro should be the following: It should
+ transform the coordinate system in such a way that the origin becomes the
+ place where the current child should be anchored. When the macro is called,
+ the current coordinate system will be set up such that the anchor of the
+ parent node is in the origin. Thus, in each call, the \meta{macro name}
+ must essentially do a shift to the child's origin. When the macro is
+ called, the \TeX\ counter |\tikznumberofchildren| will be set to the total
+ number of children of the parent node and the counter
+ |\tikznumberofcurrentchild| will be set to the number of the current child.
+
+ The macro may, in addition to shifting the coordinate system, also
+ transform the coordinate system further. For example, it could be rotated
+ or scaled.
+
+ Additional growth functions are defined in the library, see
+ Section~\ref{section-tree-library}.
\end{key}
-
\subsection{Edges From the Parent Node}
-
\label{section-edge-from-parent}
-Every child node is connected to its parent node via a special kind of
-edge called the |edge from parent|. This edge is added to the
-\meta{child path} when the following path operation is encountered:
+Every child node is connected to its parent node via a special kind of edge
+called the |edge from parent|. This edge is added to the \meta{child path} when
+the following path operation is encountered:
\begin{pathoperation}{edge from parent}{\opt{\oarg{options}}}
- This path operation can only be used inside \meta{child paths} and
- should be given at the end, possibly followed by \meta{node
- specifications} like |node {a}|. If a \meta{child path} does not
- contain this operation, it will be added at the end of the
- \meta{child path} automatically.
-
- By default, this operation does the following:
- \begin{enumerate}
- \item The following style is executed:
- \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.
+ This path operation can only be used inside \meta{child paths} and should
+ be given at the end, possibly followed by \meta{node specifications} like
+ |node {a}|. If a \meta{child path} does not contain this operation, it will
+ be added at the end of the \meta{child path} automatically.
+
+ By default, this operation does the following:
+ %
+ \begin{enumerate}
+ \item The following style is executed:
+ %
+ \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.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
[edge from parent/.style={draw,red,thick}]
@@ -721,28 +710,32 @@ edge called the |edge from parent|. This edge is added to the
};
\end{tikzpicture}
\end{codeexample}
- \end{stylekey}
- \item Next, the \meta{options} are executed.
- \item Next, the text stored in the following key is inserted:
- \begin{key}{/tikz/edge from parent path=\meta{path} (initially
- \normalfont code shown below)}
- This option allows you to set the |edge from parent path| to a new
- path. Initially, this path is the following:
+ \end{stylekey}
+ \item Next, the \meta{options} are executed.
+ \item Next, the text stored in the following key is inserted:
+ %
+ \begin{key}{/tikz/edge from parent path=\meta{path} (initially \normalfont code shown below)}
+ This option 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)
\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
- to the parent node, in this case an internal name is automatically
- generated. The |\tikzchildnode| is a macro that expands to the
- name of the child node. The two |...anchor| macros are empty by
- default. So, what is essentially inserted is just the path segment
- |(\tikzparentnode) -- (\tikzchildnode)|; which is exactly an edge
- from the parent to the child.
-
- You can modify this edge from parent path to achieve all sorts of
- effects. For example, we could replace the straight line by a
- curve as follows:
+ %
+ 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 to the parent node, in this case an internal name is
+ automatically generated. The |\tikzchildnode| is a macro that
+ expands to the name of the child node. The two |...anchor|
+ macros are empty by default. So, what is essentially inserted
+ is just the path segment
+ |(\tikzparentnode) -- (\tikzchildnode)|; which is exactly an
+ edge from the parent to the child.
+
+ You can modify this edge from parent path to achieve all sorts
+ of effects. For example, we could replace the straight line by
+ a curve as follows:
+ %
\begin{codeexample}[]
\begin{tikzpicture}[level distance=15mm, sibling distance=15mm,
edge from parent path=
@@ -757,24 +750,30 @@ edge called the |edge from parent|. This edge is added to the
\end{tikzpicture}
\end{codeexample}
- Further useful |edge from parent path|s are defined in the tree
- library, see Section~\ref{section-tree-library}.
-
- The nodes in a \meta{node specification} following the
- |edge from parent| path command get executed as if the |pos| option
- had been added to all these nodes, see also Section~\ref{section-pos-option}.
+ Further useful |edge from parent path|s are defined in the tree
+ library, see Section~\ref{section-tree-library}.
+
+ The nodes in a \meta{node specification} following the
+ |edge from parent| path command get executed as if the |pos|
+ option had been added to all these nodes, see also
+ Section~\ref{section-pos-option}.
- As an example, consider the following code:
+ As an example, consider the following code:
+ %
\begin{codeexample}[code only]
\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:
+ %
+ The |edge to parent| operation and the following |node|
+ operation will, together, have the same effect as if we had
+ said:
+ %
\begin{codeexample}[code only]
(root) -- (child) node [pos=0.5] {label}
\end{codeexample}
- Here is a more complicated example:
+ Here is a more complicated example:
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node {root}
@@ -797,18 +796,22 @@ edge called the |edge from parent|. This edge is added to the
};
\end{tikzpicture}
\end{codeexample}
-
- As said before, the anchors in the default |edge from parent path|
- are empty. However, you can set them using the following keys:
- \begin{key}{/tikz/child anchor=\meta{anchor} (initially border)}
- 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
- border at an automatically calculated position.
+
+ As said before, the anchors in the default
+ |edge from parent path| are empty. However, you can set them
+ using the following keys:
+ %
+ \begin{key}{/tikz/child anchor=\meta{anchor} (initially border)}
+ 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 border at an automatically calculated
+ position.
+ %
\begin{codeexample}[]
\begin{tikzpicture}
\node {root}
@@ -820,45 +823,45 @@ edge called the |edge from parent|. This edge is added to the
};
\end{tikzpicture}
\end{codeexample}
- \end{key}
-
- \begin{key}{/tikz/parent anchor=\meta{anchor} (initially border)}
- This option works the same way as the |child anchor|, only for
- the parent.
- \end{key}
- \end{key}
- \end{enumerate}
-
- All of the above describes the standard functioning of the
- |edge from parent| command. You may, however, sometimes need even
- more fine-grained control (the graph drawing engine needs it, for
- instance). In such cases the following key gives you complete
- control:
- \begin{key}{/tikz/edge from parent macro=\meta{macro}}
- The \meta{macro} gets expanded each time the |edge from parent|
- path operation is used. This \meta{macro} must take two parameters
- and must expand to some text that is subsequently parsed by the
- parser. The first parameter will be the set of \meta{options} that
- where passed to the |edge from parent| command, the second
- parameter will be the \meta{node specifications} that following
- the command.
-
- The standard behaviour of drawing a straight line from the parent
- node to the child node could be achieved by setting the
- \meta{macro} to the following:
+ \end{key}
+
+ \begin{key}{/tikz/parent anchor=\meta{anchor} (initially border)}
+ This option works the same way as the |child anchor|, only
+ for the parent.
+ \end{key}
+ \end{key}
+ \end{enumerate}
+
+ All of the above describes the standard functioning of the
+ |edge from parent| command. You may, however, sometimes need even more
+ fine-grained control (the graph drawing engine needs it, for instance). In
+ such cases the following key gives you complete control:
+ %
+ \begin{key}{/tikz/edge from parent macro=\meta{macro}}
+ The \meta{macro} gets expanded each time the |edge from parent| path
+ operation is used. This \meta{macro} must take two parameters and must
+ expand to some text that is subsequently parsed by the parser. The
+ first parameter will be the set of \meta{options} that where passed to
+ the |edge from parent| command, the second parameter will be the
+ \meta{node specifications} that following the command.
+
+ The standard behaviour of drawing a straight line from the parent node
+ to the child node could be achieved by setting the \meta{macro} to the
+ following:
+ %
\begin{codeexample}[code only]
\def\mymacro#1#2{
[style=edge from parent, #1]
(\tikzparentnode\tikzparentanchor) -- #2 (\tikzchildnode\tikzchildanchor)
}
\end{codeexample}
- Note that |#2| is placed between |--| and the node to ensure that
- nodes are put ``on top'' of the line.
- \end{key}
+ %
+ Note that |#2| is placed between |--| and the node to ensure that nodes
+ are put ``on top'' of the line.
+ \end{key}
\end{pathoperation}
-
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pgfmanual-pdftex-version"
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 e8717cf9718..c35deca1f82 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
@@ -10,28 +10,28 @@
\section{Tutorial: Euclid's Amber Version of the \emph{Elements}}
-In this third tutorial we have a look at how \tikzname\ can be used to
-draw geometric constructions.
-
-Euclid is currently quite busy writing his new book series, whose
-working title is ``Elements'' (Euclid is not quite sure whether this
-title will convey the message of the series to future generations
-correctly, but he intends to change the title before it goes to the
-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 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
-entitled ``Book I, Proposition I'' to an amber version.
+In this third tutorial we have a look at how \tikzname\ can be used to draw
+geometric constructions.
+
+Euclid is currently quite busy writing his new book series, whose working title
+is ``Elements'' (Euclid is not quite sure whether this title will convey the
+message of the series to future generations correctly, but he intends to change
+the title before it goes to the 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 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 entitled ``Book I,
+Proposition I'' to an amber version.
+
\subsection{Book I, Proposition I}
-The drawing on his papyrus looks like this:\footnote{The text is taken
-from the wonderful interactive version of Euclid's Elements by David
-E. Joyce, to be found on his website at Clark University.}
+The drawing on his papyrus looks like this:\footnote{The text is taken from the
+wonderful interactive version of Euclid's Elements by David E. Joyce, to be
+found on his website at Clark University.}
\bigskip
\noindent
@@ -41,21 +41,21 @@ E. Joyce, to be found on his website at Clark University.}
\def\C{\textcolor{output}{$C$}}
\def\D{$D$}
\def\E{$E$}
-
+
\colorlet{input}{blue!80!black}
\colorlet{output}{red!70!black}
\colorlet{triangle}{orange}
-
+
\coordinate [label=left:\A]
(A) at ($ (0,0) + .1*(rand,rand) $);
\coordinate [label=right:\B]
(B) at ($ (1.25,0.25) + .1*(rand,rand) $);
\draw [input] (A) -- (B);
-
+
\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)] {};
-
+
\path [name intersections={of=D and E,by={[label=above:\C]C}}];
\draw [output] (A) -- (C);
@@ -67,7 +67,7 @@ E. Joyce, to be found on his website at Clark University.}
\begin{pgfonlayer}{background}
\fill[triangle!80] (A) -- (C) -- (B) -- cycle;
\end{pgfonlayer}
-
+
\node [below right,text width=10cm,align=justify] at (4,3)
{
\small
@@ -78,7 +78,7 @@ E. Joyce, to be found on his website at Clark University.}
\vskip1em
Let \A\B\ be the given \textcolor{input}{finite straight line}. It
is required to construct an \textcolor{triangle}{equilateral
- triangle} on the \textcolor{input}{straight line}~\A\B.
+ triangle} on the \textcolor{input}{straight line}~\A\B.
Describe the circle \B\C\D\ with center~\A\ and radius \A\B. Again
describe the circle \A\C\E\ with center~\B\ and radius \B\A. Join the
@@ -89,26 +89,27 @@ E. Joyce, to be found on his website at Clark University.}
therefore \A\C\ equals \A\B. Again, since the point \B\ is the
center of the circle \C\A\E, therefore \B\C\ equals \B\A. But
\A\C\ was proved equal to \A\B, therefore each of the straight
- lines \A\C\ and \B\C\ equals \A\B. And
+ lines \A\C\ and \B\C\ equals \A\B. And
things which equal the same thing also equal one another,
therefore \A\C\ also equals \B\C. Therefore the three straight
- lines \A\C, \A\B, and \B\C\ equal one another.
+ lines \A\C, \A\B, and \B\C\ equal one another.
Therefore the \textcolor{triangle}{triangle} \A\B\C\ is
equilateral, and it has been constructed on the given finite
- \textcolor{input}{straight line}~\A\B.
+ \textcolor{input}{straight line}~\A\B.
};
\end{tikzpicture}
\bigskip
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|, |intersections|,
-|through|, and |backgrounds|. Depending on which format he uses,
-Euclid would use one of the following in the preamble:
+\subsubsection{Setting up the Environment}
+As in the previous tutorials, Euclid needs to load \tikzname, together with
+some libraries. These libraries are |calc|, |intersections|, |through|, and
+|backgrounds|. Depending on which format he uses, Euclid would use one of the
+following in the preamble:
+%
\begin{codeexample}[code only]
% For LaTeX:
\usepackage{tikz}
@@ -130,17 +131,17 @@ Euclid would use one of the following in the preamble:
\subsubsection{The Line \emph{AB}}
-The first part of the picture that Euclid wishes to draw is the line
-$AB$. That is easy enough, something like |\draw (0,0) -- (2,1);|
-might do. However, Euclid does not wish to reference the two points
-$A$ and $B$ as $(0,0)$ and $(2,1)$ subsequently. Rather, he wishes to
-just write |A| and |B|. Indeed, the whole point of his book is that
-the points $A$ and $B$ can be arbitrary and all other points (like
-$C$) are constructed in terms of their positions. It would not do
-if Euclid were to write down the coordinates of $C$ explicitly.
-
-So, Euclid starts with defining two coordinates using the
-|\coordinate| command:
+The first part of the picture that Euclid wishes to draw is the line $AB$. That
+is easy enough, something like |\draw (0,0) -- (2,1);| might do. However,
+Euclid does not wish to reference the two points $A$ and $B$ as $(0,0)$ and
+$(2,1)$ subsequently. Rather, he wishes to just write |A| and |B|. Indeed, the
+whole point of his book is that the points $A$ and $B$ can be arbitrary and all
+other points (like $C$) are constructed in terms of their positions. It would
+not do if Euclid were to write down the coordinates of $C$ explicitly.
+
+So, Euclid starts with defining two coordinates using the |\coordinate|
+command:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\coordinate (A) at (0,0);
@@ -150,9 +151,10 @@ So, Euclid starts with defining two coordinates using the
\end{tikzpicture}
\end{codeexample}
-That was easy enough. What is missing at this point are the labels for
-the coordinates. Euclid does not want them \emph{on} the points, but
-next to them. He decides to use the |label| option:
+That was easy enough. What is missing at this point are the labels for the
+coordinates. Euclid does not want them \emph{on} the points, but next to them.
+He decides to use the |label| option:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\coordinate [label=left:\textcolor{blue}{$A$}] (A) at (0,0);
@@ -162,73 +164,68 @@ next to them. He decides to use the |label| option:
\end{tikzpicture}
\end{codeexample}
-At this point, Euclid decides that it would be even nicer if the
-points $A$ and $B$ were in some sense ``random.'' Then, neither Euclid
-nor the reader can make the mistake of taking ``anything for granted''
-concerning these position of these points. Euclid is pleased to learn
-that there is a |rand| function in \tikzname\ that does exactly what
-he needs: It produces a number between $-1$ and $1$. Since \tikzname\
-can do a bit of math, Euclid can change the coordinates of the points
-as follows:
+At this point, Euclid decides that it would be even nicer if the points $A$ and
+$B$ were in some sense ``random''. Then, neither Euclid nor the reader can make
+the mistake of taking ``anything for granted'' concerning these position of
+these points. Euclid is pleased to learn that there is a |rand| function in
+\tikzname\ that does exactly what he needs: It produces a number between $-1$
+and $1$. Since \tikzname\ can do a bit of math, Euclid can change the
+coordinates of the points as follows:
+%
\begin{codeexample}[code only]
\coordinate [...] (A) at (0+0.1*rand,0+0.1*rand);
\coordinate [...] (B) at (1.25+0.1*rand,0.25+0.1*rand);
\end{codeexample}
-This works fine. However, Euclid is not quite satisfied since he would
-prefer that the ``main coordinates'' $(0,0)$ and $(1.25,0.25)$ are
-``kept separate'' from the perturbation
-$0.1(\mathit{rand},\mathit{rand})$. This means, he would like to
-specify that coordinate $A$ as ``The point that is at $(0,0)$ plus one
-tenth of the vector $(\mathit{rand},\mathit{rand})$.''
-
-It turns out that the |calc| library allows him to do exactly this
-kind of computation. When this library is loaded, you can use special
-coordinates that start with |($| and end with |$)| rather than just
-|(| and~|)|. Inside these special coordinates you can give a linear
-combination of coordinates. (Note that the dollar signs are only
-intended to signal that a ``computation'' is going on; no mathematical
-typesetting is done.)
+This works fine. However, Euclid is not quite satisfied since he would prefer
+that the ``main coordinates'' $(0,0)$ and $(1.25,0.25)$ are ``kept separate''
+from the perturbation $0.1(\mathit{rand},\mathit{rand})$. This means, he would
+like to specify that coordinate $A$ as ``the point that is at $(0,0)$ plus one
+tenth of the vector $(\mathit{rand},\mathit{rand})$''.
-The new code for the coordinates is the following:
+It turns out that the |calc| library allows him to do exactly this kind of
+computation. When this library is loaded, you can use special coordinates that
+start with |($| and end with |$)| rather than just |(| and~|)|. Inside these
+special coordinates you can give a linear combination of coordinates. (Note
+that the dollar signs are only intended to signal that a ``computation'' is
+going on; no mathematical typesetting is done.)
+The new code for the coordinates is the following:
+%
\begin{codeexample}[code only]
\coordinate [...] (A) at ($ (0,0) + .1*(rand,rand) $);
\coordinate [...] (B) at ($ (1.25,0.25) + .1*(rand,rand) $);
\end{codeexample}
-Note that if a coordinate in such a computation has a factor (like
-|.1|), you must place a |*| directly before the opening parenthesis of
-the coordinate. You can nest such computations.
-
+Note that if a coordinate in such a computation has a factor (like |.1|), you
+must place a |*| directly before the opening parenthesis of the coordinate. You
+can nest such computations.
\subsubsection{The Circle Around \emph{A}}
-The first tricky construction is the circle around~$A$. We will see
-later how to do this in a very simple manner, but first let us do it
-the ``hard'' way.
-
-The idea is the following: We draw a circle around the point $A$ whose
-radius is given by the length of the line $AB$. The difficulty lies in
-computing the length of this line.
-
-Two ideas ``nearly'' solve this problem: First, we can write
-|($ (A) - (B) $)| for the vector that is the difference between $A$
-and~$B$. All we need is the length of this vector. Second, given two
-numbers $x$ and $y$, one can write |veclen(|$x$|,|$y$|)| inside a
-mathematical expression. This gives the value $\sqrt{x^2+y^2}$, which
-is exactly the desired length.
-
-The only remaining problem is to access the $x$- and $y$-coordinate of
-the vector~$AB$. For this, we need a new concept: the \emph{let
- operation}. A let operation can be given anywhere on a path where a
-normal path operation like a line-to or a move-to is expected. The
-effect of a let operation is to evaluate some coordinates and to
-assign the results to special macros. These macros make it easy to
-access the $x$- and $y$-coordinates of the coordinates.
+The first tricky construction is the circle around~$A$. We will see later how
+to do this in a very simple manner, but first let us do it the ``hard'' way.
+
+The idea is the following: We draw a circle around the point $A$ whose radius
+is given by the length of the line $AB$. The difficulty lies in computing the
+length of this line.
+
+Two ideas ``nearly'' solve this problem: First, we can write |($ (A) - (B) $)|
+for the vector that is the difference between $A$ and~$B$. All we need is the
+length of this vector. Second, given two numbers $x$ and $y$, one can write
+|veclen(|$x$|,|$y$|)| inside a mathematical expression. This gives the value
+$\sqrt{x^2+y^2}$, which is exactly the desired length.
+
+The only remaining problem is to access the $x$- and $y$-coordinate of the
+vector~$AB$. For this, we need a new concept: the \emph{let operation}. A let
+operation can be given anywhere on a path where a normal path operation like a
+line-to or a move-to is expected. The effect of a let operation is to evaluate
+some coordinates and to assign the results to special macros. These macros make
+it easy to access the $x$- and $y$-coordinates of the coordinates.
Euclid would write the following:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\coordinate [label=left:$A$] (A) at (0,0);
@@ -242,31 +239,34 @@ Euclid would write the following:
\end{tikzpicture}
\end{codeexample}
-Each assignment in a let operation starts with |\p|, usually followed
-by a \meta{digit}. Then comes an equal sign and a coordinate. The
-coordinate is evaluated and the result is stored internally. From
-then on you can use the following expressions:
+Each assignment in a let operation starts with |\p|, usually followed by a
+\meta{digit}. Then comes an equal sign and a coordinate. The coordinate is
+evaluated and the result is stored internally. From then on you can use the
+following expressions:
+%
\begin{enumerate}
-\item |\x|\meta{digit} yields the $x$-coordinate of the resulting point.
-\item |\y|\meta{digit} yields the $y$-coordinate of the resulting
- point.
-\item |\p|\meta{digit} yields the same as |\x|\meta{digit}|,\y|\meta{digit}.
+ \item |\x|\meta{digit} yields the $x$-coordinate of the resulting point.
+ \item |\y|\meta{digit} yields the $y$-coordinate of the resulting point.
+ \item |\p|\meta{digit} yields the same as
+ |\x|\meta{digit}|,\y|\meta{digit}.
\end{enumerate}
-You can have multiple assignments in a let operation, just separate
-them with commas. In later assignments you can already use the results
-of earlier assignments.
-
-Note that |\p1| is not a coordinate in the usual sense. Rather, it
-just expands to a string like |10pt,20pt|. So, you cannot write, for
-instance, |(\p1.center)| since this would just expand to
-|(10pt,20pt.center)|, which makes no sense.
-
-Next, we want to draw both circles at the same time. Each time the
-radius is |veclen(\x1,\y1)|. It seems natural to compute this radius
-only once. For this, we can also use a let operation: Instead of
-writing |\p1 = ...|, we write |\n2 = ...|. Here, ``n'' stands for
-``number'' (while ``p'' stands for ``point''). The assignment of a
-number should be followed by a number in curly braces.
+%
+You can have multiple assignments in a let operation, just separate them with
+commas. In later assignments you can already use the results of earlier
+assignments.
+
+Note that |\p1| is not a coordinate in the usual sense. Rather, it just expands
+to a string like |10pt,20pt|. So, you cannot write, for instance,
+|(\p1.center)| since this would just expand to |(10pt,20pt.center)|, which
+makes no sense.
+
+Next, we want to draw both circles at the same time. Each time the radius is
+|veclen(\x1,\y1)|. It seems natural to compute this radius only once. For this,
+we can also use a let operation: Instead of writing |\p1 = ...|, we write
+|\n2 = ...|. Here, ``n'' stands for ``number'' (while ``p'' stands for
+``point''). The assignment of a number should be followed by a number in curly
+braces.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\coordinate [label=left:$A$] (A) at (0,0);
@@ -280,13 +280,14 @@ number should be followed by a number in curly braces.
(B) circle (\n2);
\end{tikzpicture}
\end{codeexample}
-In the above example, you may wonder, what |\n1| would yield? The
-answer is that it would be undefined -- the |\p|, |\x|, and |\y|
-macros refer to the same logical point, while the |\n| macro has ``its
-own namespace.'' We could even have replaced |\n2| in the example by
-|\n1| and it would still work. Indeed, the digits following these
-macros are just normal \TeX\ parameters. We could also use a longer
-name, but then we have to use curly braces:
+%
+In the above example, you may wonder, what |\n1| would yield? The answer is
+that it would be undefined -- the |\p|, |\x|, and |\y| macros refer to the same
+logical point, while the |\n| macro has ``its own namespace''. We could even
+have replaced |\n2| in the example by |\n1| and it would still work. Indeed,
+the digits following these macros are just normal \TeX\ parameters. We could
+also use a longer name, but then we have to use curly braces:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\coordinate [label=left:$A$] (A) at (0,0);
@@ -301,19 +302,18 @@ name, but then we have to use curly braces:
\end{tikzpicture}
\end{codeexample}
-At the beginning of this section it was promised that there is an
-easier way to create the desired circle. The trick is to use the
-|through| library. As the name suggests, it contains code for creating
-shapes that go through a given point.
-
-The option that we are looking for is |circle through|. This option is
-given to a \emph{node} and has the following effects: First, it causes
-the node's inner and outer separations to be set to zero. Then it sets
-the shape of the node to |circle|. Finally, it sets the radius of the
-node such that it goes through the parameter given to
-|circle through|. This radius is computed in essentially the same way
-as above.
-
+At the beginning of this section it was promised that there is an easier way to
+create the desired circle. The trick is to use the |through| library. As the
+name suggests, it contains code for creating shapes that go through a given
+point.
+
+The option that we are looking for is |circle through|. This option is given to
+a \emph{node} and has the following effects: First, it causes the node's inner
+and outer separations to be set to zero. Then it sets the shape of the node to
+|circle|. Finally, it sets the radius of the node such that it goes through the
+parameter given to |circle through|. This radius is computed in essentially the
+same way as above.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\coordinate [label=left:$A$] (A) at (0,0);
@@ -327,20 +327,18 @@ as above.
\subsubsection{The Intersection of the Circles}
-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
-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'').
+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 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);
@@ -352,7 +350,7 @@ themselves, but nodes and their paths live in different
% 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);
@@ -360,12 +358,12 @@ themselves, but nodes and their paths live in different
\end{tikzpicture}
\end{codeexample}
-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$:
-
+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);
@@ -385,31 +383,29 @@ picture, it is just a small step to computing the bisection of the line $AB$:
\end{codeexample}
-
\subsubsection{The Complete Code}
-Back to Euclid's code. He introduces a few macros to make life
-simpler, like a |\A| macro for typesetting a blue $A$. He also uses the
-|background| layer for drawing the triangle behind everything at the
-end.
-
+Back to Euclid's code. He introduces a few macros to make life simpler, like a
+|\A| macro for typesetting a blue $A$. He also uses the |background| layer for
+drawing the triangle behind everything at the end.
+%
\begin{codeexample}[]
\begin{tikzpicture}[thick,help lines/.style={thin,draw=black!50}]
\def\A{\textcolor{input}{$A$}} \def\B{\textcolor{input}{$B$}}
\def\C{\textcolor{output}{$C$}} \def\D{$D$}
\def\E{$E$}
-
+
\colorlet{input}{blue!80!black} \colorlet{output}{red!70!black}
\colorlet{triangle}{orange}
-
+
\coordinate [label=left:\A] (A) at ($ (0,0) + .1*(rand,rand) $);
\coordinate [label=right:\B] (B) at ($ (1.25,0.25) + .1*(rand,rand) $);
\draw [input] (A) -- (B);
-
+
\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)] {};
-
+
\path [name intersections={of=D and E,by={[label=above:\C]C}}];
\draw [output] (A) -- (C) -- (B);
@@ -420,7 +416,7 @@ end.
\begin{pgfonlayer}{background}
\fill[triangle!80] (A) -- (C) -- (B) -- cycle;
\end{pgfonlayer}
-
+
\node [below right, text width=10cm,align=justify] at (4,3) {
\small\textbf{Proposition I}\par
\emph{To construct an \textcolor{triangle}{equilateral triangle}
@@ -443,9 +439,9 @@ The second proposition in the Elements is the following:
\def\E{$E$} \def\F{$F$}
\def\G{$G$} \def\H{$H$}
\def\K{$K$} \def\L{\textcolor{output}{$L$}}
-
+
\colorlet{input}{blue!80!black} \colorlet{output}{red!70!black}
-
+
\coordinate [label=left:\A] (A) at ($ (0,0) + .1*(rand,rand) $);
\coordinate [label=right:\B] (B) at ($ (1,0.2) + .1*(rand,rand) $);
\coordinate [label=above:\C] (C) at ($ (1,2) + .1*(rand,rand) $);
@@ -473,22 +469,22 @@ The second proposition in the Elements is the following:
\foreach \point in {A,B,C,D,G,L}
\fill [black,opacity=.5] (\point) circle (2pt);
-
+
\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
- one end at a \textcolor{orange}{given point}.}
+ given \textcolor{input}{straight line} with
+ one end at a \textcolor{orange}{given point}.}
\par\vskip1em
Let \A\ be the given point, and \B\C\ the given
- \textcolor{input}{straight line}.
+ \textcolor{input}{straight line}.
It is required to place a \textcolor{output}{straight line} equal
to the given \textcolor{input}{straight line} \B\C\ with one end
- at the point~\A.
+ at the point~\A.
Join the straight line \A\B\ from the point \A\ to the point \B, and
construct the equilateral triangle \D\A\B\ on it.
-
+
Produce the straight lines \A\E\ and \B\F\ in a straight line with
\D\A\ and \D\B. Describe the circle \C\G\H\ with center \B\ and
radius \B\C, and again, describe the circle \G\K\L\ with center
@@ -501,35 +497,33 @@ The second proposition in the Elements is the following:
\B\G. But \B\C\ was also proved equal to \B\G, therefore each of
the straight lines \A\L\ and \B\C\ equals \B\G. And things which
equal the same thing also equal one another, therefore \A\L\ also
- equals \B\C.
-
+ equals \B\C.
+
Therefore the \textcolor{output}{straight line} \A\L\ equal to the
given \textcolor{input}{straight line} \B\C\ has been placed with
- one end at the \textcolor{orange}{given point}~\A.
+ one end at the \textcolor{orange}{given point}~\A.
};
\end{tikzpicture}
-
-
\subsubsection{Using Partway Calculations for the Construction of \emph{D}}
-Euclid's construction starts with ``referencing'' Proposition~I for
-the construction of the point~$D$. Now, while we could simply repeat the
-construction, it seems a bit bothersome that one has to draw all these
-circles and do all these complicated constructions.
-
-For this reason, \tikzname\ supports some simplifications. First,
-there is a simple syntax for computing a point that is ``partway'' on
-a line from $p$ to~$q$: You place these two points in a coordinate
-calculation -- remember, they start with |($| and end with |$)| -- and
-then combine them using |!|\meta{part}|!|. A \meta{part} of |0| refers
-to the \emph{first} coordinate, a \meta{part} of |1| refers to the
-second coordinate, and a value in between refers to a point on the
-line from $p$ to~$q$. Thus, the syntax is similar to the |xcolor|
-syntax for mixing colors.
+Euclid's construction starts with ``referencing'' Proposition~I for the
+construction of the point~$D$. Now, while we could simply repeat the
+construction, it seems a bit bothersome that one has to draw all these circles
+and do all these complicated constructions.
+
+For this reason, \tikzname\ supports some simplifications. First, there is a
+simple syntax for computing a point that is ``partway'' on a line from $p$
+to~$q$: You place these two points in a coordinate calculation -- remember,
+they start with |($| and end with |$)| -- and then combine them using
+|!|\meta{part}|!|. A \meta{part} of |0| refers to the \emph{first} coordinate,
+a \meta{part} of |1| refers to the second coordinate, and a value in between
+refers to a point on the line from $p$ to~$q$. Thus, the syntax is similar to
+the |xcolor| syntax for mixing colors.
Here is the computation of the point in the middle of the line $AB$:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\coordinate [label=left:$A$] (A) at (0,0);
@@ -539,18 +533,16 @@ Here is the computation of the point in the middle of the line $AB$:
\end{tikzpicture}
\end{codeexample}
-The computation of the point $D$ in Euclid's second proposition is a
-bit more complicated. It can be expressed as follows: Consider the
-line from $X$ to $B$. Suppose we
-rotate this line around $X$ for 90$^\circ$ and then stretch it by a
-factor of $\sin(60^\circ) \cdot 2$. This yields the desired point~$D$. We
-can do the stretching using the partway modifier above, for the
-rotation we need a new modifier: the rotation modifier. The idea is
-that the second coordinate in a partway computation can be prefixed by
-an angle. Then the partway point is computed normally (as if no angle
-were given), but the resulting point is rotated by this angle around
-the first point.
-
+The computation of the point $D$ in Euclid's second proposition is a bit more
+complicated. It can be expressed as follows: Consider the line from $X$ to $B$.
+Suppose we rotate this line around $X$ for 90$^\circ$ and then stretch it by a
+factor of $\sin(60^\circ) \cdot 2$. This yields the desired point~$D$. We can
+do the stretching using the partway modifier above, for the rotation we need a
+new modifier: the rotation modifier. The idea is that the second coordinate in
+a partway computation can be prefixed by an angle. Then the partway point is
+computed normally (as if no angle were given), but the resulting point is
+rotated by this angle around the first point.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\coordinate [label=left:$A$] (A) at (0,0);
@@ -563,10 +555,9 @@ the first point.
\end{tikzpicture}
\end{codeexample}
-Finally, it is not necessary to explicitly name the point $X$. Rather,
-again like in the |xcolor| package, it is possible to chain partway
-modifiers:
-
+Finally, it is not necessary to explicitly name the point $X$. Rather, again
+like in the |xcolor| package, it is possible to chain partway modifiers:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\coordinate [label=left:$A$] (A) at (0,0);
@@ -581,12 +572,11 @@ modifiers:
\subsubsection{Intersecting a Line and a Circle}
-The next step in the construction is to draw a circle around $B$
-through $C$, which is easy enough to do using the |circle through|
-option. Extending the lines $DA$ and $DB$ can be done using partway
-calculations, but this time with a part value outside the range
-$[0,1]$:
-
+The next step in the construction is to draw a circle around $B$ through $C$,
+which is easy enough to do using the |circle through| option. Extending the
+lines $DA$ and $DB$ can be done using partway calculations, but this time with
+a part value outside the range $[0,1]$:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\coordinate [label=left:$A$] (A) at (0,0);
@@ -601,19 +591,18 @@ $[0,1]$:
\end{tikzpicture}
\end{codeexample}
-We now face the problem of finding the point $G$, which is the
-intersection of the line $BF$ and the circle $H$. One way is to use
-yet another variant of the partway computation: Normally, a partway
-computation has the form \meta{p}|!|\meta{factor}|!|\meta{q},
-resulting in the point $(1-\meta{factor})\meta{p} +
-\meta{factor}\meta{q}$. Alternatively, instead of \meta{factor} you
-can also use a \meta{dimension} between the points. In this case, you
-get the point that is \meta{dimension} away from \meta{p} on the
+We now face the problem of finding the point $G$, which is the intersection of
+the line $BF$ and the circle $H$. One way is to use yet another variant of the
+partway computation: Normally, a partway computation has the form
+\meta{p}|!|\meta{factor}|!|\meta{q}, resulting in the point
+$(1-\meta{factor})\meta{p} + \meta{factor}\meta{q}$. Alternatively, instead of
+\meta{factor} you can also use a \meta{dimension} between the points. In this
+case, you get the point that is \meta{dimension} away from \meta{p} on the
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 for
-computing $H$:
+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 for computing $H$:
+%
{\tikzexternaldisable
\begin{codeexample}[pre={
\begin{tikzpicture}
@@ -632,10 +621,10 @@ computing $H$:
\fill[red,opacity=.5] (G) circle (2pt);
\end{codeexample}
-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.
-
+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}
\coordinate [label=left:$A$] (A) at (0,0);
@@ -654,6 +643,7 @@ to compute the intersections.
\end{codeexample}
}%
+
\subsubsection{The Complete Code}
\begin{codeexample}[]
@@ -663,9 +653,9 @@ to compute the intersections.
\def\E{$E$} \def\F{$F$}
\def\G{$G$} \def\H{$H$}
\def\K{$K$} \def\L{\textcolor{output}{$L$}}
-
+
\colorlet{input}{blue!80!black} \colorlet{output}{red!70!black}
-
+
\coordinate [label=left:\A] (A) at ($ (0,0) + .1*(rand,rand) $);
\coordinate [label=right:\B] (B) at ($ (1,0.2) + .1*(rand,rand) $);
\coordinate [label=above:\C] (C) at ($ (1,2) + .1*(rand,rand) $);
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 e6b05fd6bd7..c6ba16ff87f 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
@@ -10,17 +10,18 @@
\section{Tutorial: Diagrams as Simple Graphs}
-In this tutorial we have a look at how graphs and matrices can be used
-to typeset a diagram.
-
-Ilka, who just got tenure for her professorship on Old and
-Lovable Programming Languages, has recently dug up a technical report entitled
-\emph{The Programming Language Pascal} in the dusty cellar of the
-library of her university. Having been created in the good old times
-using pens and rules, it looks like this\footnote{The shown diagram was not scanned, but
- rather typeset using \tikzname. The jittering lines were created
- using the |random steps| decoration.}:
-
+In this tutorial we have a look at how graphs and matrices can be used to
+typeset a diagram.
+
+Ilka, who just got tenure for her professorship on Old and Lovable Programming
+Languages, has recently dug up a technical report entitled \emph{The
+Programming Language Pascal} in the dusty cellar of the library of her
+university. Having been created in the good old times using pens and rules, it
+looks like this%
+\footnote{The shown diagram was not scanned, but rather typeset using
+\tikzname. The jittering lines were created using the |random steps|
+decoration.}:
+%
\tikzset{
nonterminal/.style={
% The shape:
@@ -99,9 +100,8 @@ using pens and rules, it looks like this\footnote{The shown diagram was not scan
\end{tikzpicture}
\medskip
-For her next lecture, Ilka decides to redo this diagram, but this time
-perhaps a bit cleaner and perhaps also bit ``cooler.''
-
+For her next lecture, Ilka decides to redo this diagram, but this time perhaps
+a bit cleaner and perhaps also bit ``cooler''.
\medskip
\noindent\begin{tikzpicture}[point/.style={coordinate},>=stealth',thick,draw=black!50,
@@ -155,29 +155,27 @@ perhaps a bit cleaner and perhaps also bit ``cooler.''
\end{tikzpicture}
}\medskip
-Having read the previous tutorials, Ilka knows already how to set up
-the environment for her diagram, namely using a |tikzpicture|
-environment. She wonders which libraries she will need. She decides
-that she will postpone the decision and add the necessary libraries as
-needed as she constructs the picture.
+Having read the previous tutorials, Ilka knows already how to set up the
+environment for her diagram, namely using a |tikzpicture| environment. She
+wonders which libraries she will need. She decides that she will postpone the
+decision and add the necessary libraries as needed as she constructs the
+picture.
\subsection{Styling the Nodes}
-The bulk of this tutorial will be about arranging the nodes and
-connecting them using chains, but let us start with setting up styles
-for the nodes.
-
-There are two kinds of nodes in the diagram, namely what theoreticians
-like to call \emph{terminals} and \emph{nonterminals}. For the
-terminals, Ilka decides to use a black color, which visually shows
-that ``nothing needs to be done about them.'' The nonterminals, which
-still need to be ``processed'' further, get a bit of red mixed in.
-
-Ilka starts with the simpler nonterminals, as there are no rounded
-corners involved. Naturally, she sets up a style:
+The bulk of this tutorial will be about arranging the nodes and connecting them
+using chains, but let us start with setting up styles for the nodes.
+There are two kinds of nodes in the diagram, namely what theoreticians like to
+call \emph{terminals} and \emph{nonterminals}. For the terminals, Ilka decides
+to use a black color, which visually shows that ``nothing needs to be done
+about them''. The nonterminals, which still need to be ``processed'' further,
+get a bit of red mixed in.
+Ilka starts with the simpler nonterminals, as there are no rounded corners
+involved. Naturally, she sets up a style:
+%
\begin{codeexample}[]
\begin{tikzpicture}[
nonterminal/.style={
@@ -198,20 +196,20 @@ corners involved. Naturally, she sets up a style:
\node [nonterminal] {unsigned integer};
\end{tikzpicture}
\end{codeexample}
-Ilka is pretty proud of the use of the |minimum size| option: As the
-name suggests, this option ensures that the node is at least 6mm by
-6mm, but it will expand in size as necessary to accommodate longer
-text. By giving this option to all nodes, they will all have the same
-height of 6mm.
-
-Styling the terminals is a bit more difficult because of the round
-corners. Ilka has several options how she can achieve them. One way
-is to use the |rounded corners| option. It gets a dimension as
-parameter and causes all corners to be replaced by little arcs with
-the given dimension as radius. By setting the radius to 3mm, she will
-get exactly what she needs: circles, when the shapes are, indeed,
-exactly 6mm by 6mm and otherwise half circles on the sides:
-
+%
+Ilka is pretty proud of the use of the |minimum size| option: As the name
+suggests, this option ensures that the node is at least 6mm by 6mm, but it will
+expand in size as necessary to accommodate longer text. By giving this option
+to all nodes, they will all have the same height of 6mm.
+
+Styling the terminals is a bit more difficult because of the round corners.
+Ilka has several options how she can achieve them. One way is to use the
+|rounded corners| option. It gets a dimension as parameter and causes all
+corners to be replaced by little arcs with the given dimension as radius. By
+setting the radius to 3mm, she will get exactly what she needs: circles, when
+the shapes are, indeed, exactly 6mm by 6mm and otherwise half circles on the
+sides:
+%
\begin{codeexample}[]
\begin{tikzpicture}[node distance=5mm,
terminal/.style={
@@ -227,11 +225,12 @@ exactly 6mm by 6mm and otherwise half circles on the sides:
\end{tikzpicture}
\end{codeexample}
-Another possibility is to use a shape that is specially made for
-typesetting rectangles with arcs on the sides (she has to use the
-|shapes.misc| library to use it). This shape gives Ilka
-much more control over the appearance. For instance, she could have an
-arc only on the left side, but she will not need this.
+Another possibility is to use a shape that is specially made for typesetting
+rectangles with arcs on the sides (she has to use the |shapes.misc| library to
+use it). This shape gives Ilka much more control over the appearance. For
+instance, she could have an arc only on the left side, but she will not need
+this.
+%
\begin{codeexample}[]
\begin{tikzpicture}[node distance=5mm,
terminal/.style={
@@ -247,8 +246,10 @@ arc only on the left side, but she will not need this.
\node (E) [terminal,right=of digit] {E};
\end{tikzpicture}
\end{codeexample}
-At this point, she notices a problem. The baseline of the text in the
-nodes is not aligned:
+%
+At this point, she notices a problem. The baseline of the text in the nodes is
+not aligned:
+%
\begin{codeexample}[]
\begin{tikzpicture}[node distance=5mm]
\node (dot) [terminal] {.};
@@ -263,19 +264,20 @@ nodes is not aligned:
(-.5,\y3) -- (3.5,\y3);
\end{tikzpicture}
\end{codeexample}
-\noindent (Ilka has moved the style definition to the preamble by
-saying |\tikzset{terminal/.style=...}|, so that she can use it in all
-pictures.)
+%
+\noindent (Ilka has moved the style definition to the preamble by saying
+|\tikzset{terminal/.style=...}|, so that she can use it in all pictures.)
For the |digit| and the |E| the difference in the baselines is almost
-imperceptible, but for the dot the problem is quite severe: It looks
-more like a multiplication dot than a period.
+imperceptible, but for the dot the problem is quite severe: It looks more like
+a multiplication dot than a period.
Ilka toys with the idea of using the |base right=of...| option rather than
-|right=of...| to align the nodes in such a way that the baselines
-are all on the same line (the |base right| option places a node
-right of something so that the baseline is right of the baseline of
-the other object). However, this does not have the desired effect:
+|right=of...| to align the nodes in such a way that the baselines are all on
+the same line (the |base right| option places a node right of something so that
+the baseline is right of the baseline of the other object). However, this does
+not have the desired effect:
+%
\begin{codeexample}[]
\begin{tikzpicture}[node distance=5mm]
\node (dot) [terminal] {.};
@@ -283,14 +285,15 @@ the other object). However, this does not have the desired effect:
\node (E) [terminal,base right=of digit] {E};
\end{tikzpicture}
\end{codeexample}
-The nodes suddenly ``dance around''! There is no hope of changing the
-position of text inside a node using anchors. Instead, Ilka must use a
-trick: The problem of mismatching baselines is caused by the fact that
-|.| and |digit| and |E| all have different heights and depth. If they
-all had the same, they would all be positioned vertically in the same
-manner. So, all Ilka needs to do is to use the |text height| and
-|text depth| options to explicitly specify a height and depth for the
-nodes.
+%
+The nodes suddenly ``dance around''! There is no hope of changing the position
+of text inside a node using anchors. Instead, Ilka must use a trick: The
+problem of mismatching baselines is caused by the fact that |.| and |digit| and
+|E| all have different heights and depth. If they all had the same, they would
+all be positioned vertically in the same manner. So, all Ilka needs to do is to
+use the |text height| and |text depth| options to explicitly specify a height
+and depth for the nodes.
+%
\begin{codeexample}[]
\begin{tikzpicture}[node distance=5mm,
text height=1.5ex,text depth=.25ex]
@@ -301,34 +304,35 @@ nodes.
\end{codeexample}
-
\subsection{Aligning the Nodes Using Positioning Options}
-Ilka now has the ``styling'' of the nodes ready. The next problem is
-to place them in the right places. There are several ways to do
-this. The most straightforward is to simply explicitly place the nodes
-at certain coordinates ``calculated by hand.'' For very simple
-graphics this is perfectly alright, but it has several disadvantages:
+Ilka now has the ``styling'' of the nodes ready. The next problem is to place
+them in the right places. There are several ways to do this. The most
+straightforward is to simply explicitly place the nodes at certain coordinates
+``calculated by hand''. For very simple graphics this is perfectly alright, but
+it has several disadvantages:
+%
\begin{enumerate}
-\item For more difficult graphics, the calculation may become
- complicated.
-\item Changing the text of the nodes may make it necessary to
- 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.
+ \item For more difficult graphics, the calculation may become
+ complicated.
+ \item Changing the text of the nodes may make it necessary to 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.
\end{enumerate}
-For these reasons, Ilka decides to try out different ways of arranging
-the nodes on the page.
+For these reasons, Ilka decides to try out different ways of arranging the
+nodes on the page.
-The first method is the use of \emph{positioning options}. To use
-them, you need to load the |positioning| library. This gives you
-access to advanced implementations of options like |above| or |left|,
-since you can now say |above=of some node| in order to place a node
-above of |some node|, with the borders separated by |node distance|.
+The first method is the use of \emph{positioning options}. To use them, you
+need to load the |positioning| library. This gives you access to advanced
+implementations of options like |above| or |left|, since you can now say
+|above=of some node| in order to place a node above of |some node|, with the
+borders separated by |node distance|.
Ilka can use this to draw the place the nodes in a long row:
+%
\tikzset{terminal/.append style={text height=1.5ex,text depth=.25ex}}
\tikzset{nonterminal/.append style={text height=1.5ex,text
depth=.25ex}}
@@ -344,17 +348,17 @@ Ilka can use this to draw the place the nodes in a long row:
\end{tikzpicture}
\end{codeexample}
-For the plus and minus nodes, Ilka is a bit startled by their
-placements. Shouldn't they be more to the right? The reason they are
-placed in that manner is the following: The |north east| anchor of the
-|E| node lies at the ``upper start of the right arc,'' which, a bit
-unfortunately in this case, happens to be the top of the
-node. Likewise, the |south west| anchor of the |+| node is actually at
-its bottom and, indeed, the horizontal and vertical distances between
-the top of the |E| node and the bottom of the |+| node are both 5mm.
-
-There are several ways of fixing this problem. The
-easiest way is to simply add a little bit of horizontal shift by hand:
+For the plus and minus nodes, Ilka is a bit startled by their placements.
+Shouldn't they be more to the right? The reason they are placed in that manner
+is the following: The |north east| anchor of the |E| node lies at the ``upper
+start of the right arc'', which, a bit unfortunately in this case, happens to
+be the top of the node. Likewise, the |south west| anchor of the |+| node is
+actually at its bottom and, indeed, the horizontal and vertical distances
+between the top of the |E| node and the bottom of the |+| node are both 5mm.
+
+There are several ways of fixing this problem. The easiest way is to simply add
+a little bit of horizontal shift by hand:
+%
\begin{codeexample}[]
\begin{tikzpicture}[node distance=5mm and 5mm]
\node (E) [terminal] {E};
@@ -364,9 +368,10 @@ easiest way is to simply add a little bit of horizontal shift by hand:
\end{tikzpicture}
\end{codeexample}
-A second way is to revert back to the idea of using a normal rectangle
-for the terminals, but with rounded corners. Since corner rounding
-does not affect anchors, she gets the following result:
+A second way is to revert back to the idea of using a normal rectangle for the
+terminals, but with rounded corners. Since corner rounding does not affect
+anchors, she gets the following result:
+%
\begin{codeexample}[]
\begin{tikzpicture}[node distance=5mm and 5mm,terminal/.append style={rectangle,rounded corners=3mm}]
\node (E) [terminal] {E};
@@ -375,15 +380,16 @@ does not affect anchors, she gets the following result:
\node (ui2) [nonterminal,below right=of plus] {unsigned integer};
\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
-others. Consider for instance the ``repeat'' line around the
-|digit|. One way of describing this line is to say ``it starts a
-little to the right of |digit| than goes down and then goes to the
-left and finally ends at a point a little to the left of |digit|.''
-Ilka can put this into code as follows:
+Now that the nodes have been placed, Ilka needs to add connections. Here, some
+connections are more difficult than others. Consider for instance the
+``repeat'' line around the |digit|. One way of describing this line is to say
+``it starts a little to the right of |digit| than goes down and then goes to
+the left and finally ends at a point a little to the left of |digit|''. Ilka
+can put this into code as follows:
+%
\begin{codeexample}[]
\begin{tikzpicture}[node distance=5mm and 5mm]
\node (dot) [terminal] {.};
@@ -405,11 +411,12 @@ Ilka can put this into code as follows:
\end{tikzpicture}
\end{codeexample}
-Since Ilka needs this ``go up/down then horizontally and then up/down
-to a target'' several times, it seems sensible to define a special
-\emph{to-path} for this. Whenever the |edge| command is used, it
-simply adds the current value of |to path| to the path. So, Ilka can
-set up a style that contains the correct path:
+Since Ilka needs this ``go up/down then horizontally and then up/down to a
+target'' several times, it seems sensible to define a special \emph{to-path}
+for this. Whenever the |edge| command is used, it simply adds the current value
+of |to path| to the path. So, Ilka can set up a style that contains the correct
+path:
+%
\begin{codeexample}[]
\begin{tikzpicture}[node distance=5mm and 5mm,
skip loop/.style={to path={-- ++(0,-.5) -| (\tikztotarget)}}]
@@ -424,11 +431,11 @@ set up a style that contains the correct path:
\end{tikzpicture}
\end{codeexample}
-Ilka can even go a step further and make her |skip look| style
-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.''
+Ilka can even go a step further and make her |skip look| style 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''.
+%
\begin{codeexample}[]
\begin{tikzpicture}[node distance=5mm and 5mm,
skip loop/.style={to path={-- ++(0,#1) -| (\tikztotarget)}}]
@@ -446,19 +453,19 @@ middle between the nodes.''
\subsection{Aligning the Nodes Using Matrices}
-Ilka is still bothered a bit by the placement of the plus and minus
-nodes. Somehow, having to add an explicit |xshift| seems too much like
-cheating.
+Ilka is still bothered a bit by the placement of the plus and minus nodes.
+Somehow, having to add an explicit |xshift| seems too much like cheating.
-A perhaps better way of positioning the nodes is to use a
-\emph{matrix}. In \tikzname\ matrices can be used to align quite
-arbitrary graphical objects in rows and columns. The syntax is very
-similar to the use of arrays and tables in \TeX\ (indeed, internally
-\TeX\ tables are used, but a lot of stuff is going on additionally).
+A perhaps better way of positioning the nodes is to use a \emph{matrix}. In
+\tikzname\ matrices can be used to align quite arbitrary graphical objects in
+rows and columns. The syntax is very similar to the use of arrays and tables in
+\TeX\ (indeed, internally \TeX\ tables are used, but a lot of stuff is going on
+additionally).
-In Ilka's graphic, there will be three rows: One row containing only
-the plus node, one row containing the main nodes and one row
-containing only the minus node.
+In Ilka's graphic, there will be three rows: One row containing only the plus
+node, one row containing the main nodes and one row containing only the minus
+node.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\matrix[row sep=1mm,column sep=5mm] {
@@ -476,13 +483,15 @@ containing only the minus node.
};
\end{tikzpicture}
\end{codeexample}
-That was easy! By toying around with the row and columns separations,
-Ilka can achieve all sorts of pleasing arrangements of the nodes.
+%
+That was easy! By toying around with the row and columns separations, Ilka can
+achieve all sorts of pleasing arrangements of the nodes.
-Ilka now faces the same connecting problem as before. This time, she
-has an idea: She adds small nodes (they will be turned into
-coordinates later on and be invisible) at all the places
-where she would like connections to start and end.
+Ilka now faces the same connecting problem as before. This time, she has an
+idea: She adds small nodes (they will be turned into coordinates later on and
+be invisible) at all the places where she would like connections to start and
+end.
+%
\begin{codeexample}[]
\begin{tikzpicture}[point/.style={circle,inner sep=0pt,minimum size=2pt,fill=red},
skip loop/.style={to path={-- ++(0,#1) -| (\tikztotarget)}}]
@@ -506,31 +515,30 @@ where she would like connections to start and end.
(p2) edge [->,skip loop=5mm] (p6);
\end{tikzpicture}
\end{codeexample}
+%
Now, it's only a small step to add all the missing edges.
-
\subsection{The Diagram as a Graph}
-Matrices allow Ilka to align the nodes nicely, but the connections are
-not quite perfect. The problem is that the code does not really
-reflect the paths that underlie the diagram. For this, it seems
-natural enough to Ilka to use the |graph| library since, after all,
-connecting nodes by edges is exactly what happens in a graph.
-The |graph| library can both be used to connect nodes that have
-already been created, but it can also be used to create nodes ``on the
+Matrices allow Ilka to align the nodes nicely, but the connections are not
+quite perfect. The problem is that the code does not really reflect the paths
+that underlie the diagram. For this, it seems natural enough to Ilka to use the
+|graph| library since, after all, connecting nodes by edges is exactly what
+happens in a graph. The |graph| library can both be used to connect nodes that
+have already been created, but it can also be used to create nodes ``on the
fly'' and these processes can also be mixed.
\subsubsection{Connecting Already Positioned Nodes}
-Ilka has already a fine method for positioning her nodes (using a
-|matrix|), so all that she needs is an easy way of specifying the
-edges. For this, she uses the |\graph| command (which is actually just
-a shorthand for |\path graph|). It allows her to write down edges
-between them in a simple way (the macro |\matrixcontent| contains
-exactly the matrix content from the previous example; no need to
-repeat it here):
+Ilka has already a fine method for positioning her nodes (using a |matrix|), so
+all that she needs is an easy way of specifying the edges. For this, she uses
+the |\graph| command (which is actually just a shorthand for |\path graph|). It
+allows her to write down edges between them in a simple way (the macro
+|\matrixcontent| contains exactly the matrix content from the previous example;
+no need to repeat it here):
+%
\def\matrixcontent{
% First row:
\& \& \& \& \& \& \& \& \& \& \& \node (plus) [terminal] {+};\\
@@ -551,7 +559,7 @@ repeat it here):
hv path/.style={to path={-| (\tikztotarget)}},
vh path/.style={to path={|- (\tikztotarget)}}]
\matrix[row sep=1mm,column sep=2mm] { \matrixcontent };
-
+
\graph {
(p1) -> (ui1) -- (p2) -> (dot) -- (p3) -> (digit) -- (p4)
-- (p5) -- (p6) -> (e) -- (p7) -- (p8) -> (ui2) -- (p9) -> (p10);
@@ -564,23 +572,22 @@ repeat it here):
\end{tikzpicture}
\end{codeexample}
-This is already pretty near to the desired result, just a few
-``finishing touches'' are needed to style the edges more nicely.
-
-However, Ilka does not have the feeling that the |graph| command is
-all that hot in the example. It certainly does cut down on the number
-of characters she has to write, but the overall graph structure is not
-that much clear -- it is still mainly a list of paths through the
-graph. It would be nice to specify that, say, there the path from
-|(p7)| sort of splits to |(plus)| and |(minus)| and then merges once
-more at |(p8)|. Also, all these parentheses are bit hard to type.
-
-It turns out that edges from a node to a whole group of nodes are
-quite easy to specify, as shown in the next example. Additionally, by
-using the |use existing nodes| option, Ilka can also leave out all the
-parentheses (again, some options have been moved outside to keep the
-examples shorter):
-
+This is already pretty near to the desired result, just a few ``finishing
+touches'' are needed to style the edges more nicely.
+
+However, Ilka does not have the feeling that the |graph| command is all that
+hot in the example. It certainly does cut down on the number of characters she
+has to write, but the overall graph structure is not that much clear -- it is
+still mainly a list of paths through the graph. It would be nice to specify
+that, say, there the path from |(p7)| sort of splits to |(plus)| and |(minus)|
+and then merges once more at |(p8)|. Also, all these parentheses are bit hard
+to type.
+
+It turns out that edges from a node to a whole group of nodes are quite easy to
+specify, as shown in the next example. Additionally, by using the
+|use existing nodes| option, Ilka can also leave out all the parentheses
+(again, some options have been moved outside to keep the examples shorter):
+%
\begin{codeexample}[pre={\tikzset{ampersand replacement=\&,point/.style={coordinate},
skip loop/.style={to path={-- ++(0,##1) -| (\tikztotarget)}},
hv path/.style={to path={-| (\tikztotarget)}},
@@ -589,7 +596,7 @@ examples shorter):
every new ->/.style={shorten >=1pt},
graphs/every graph/.style={edges=rounded corners}]
\matrix[column sep=4mm] { \matrixcontent };
-
+
\graph [use existing nodes] {
p1 -> ui1 -- p2 -> dot -- p3 -> digit -- p4 -- p5 -- p6 -> e -- p7 -- p8 -> ui2 -- p9 -> p10;
p4 ->[skip loop=-5mm] p3;
@@ -603,31 +610,35 @@ examples shorter):
\subsubsection{Creating Nodes Using the Graph Command}
-Ilka has heard that the |graph| command is also supposed to make it
-easy to create nodes, not only to connect them. This is, indeed,
-correct: When the |use existing node| option is not used and when a
-node name is not surrounded by parentheses, then \tikzname\ will
-actually create a node whose name and text is the node name:
+Ilka has heard that the |graph| command is also supposed to make it easy to
+create nodes, not only to connect them. This is, indeed, correct: When the
+|use existing nodes| option is not used and when a node name is not surrounded
+by parentheses, then \tikzname\ will actually create a node whose name and text
+is the node name:
+%
\begin{codeexample}[]
-\tikz \graph [grow right=2cm] { unsigned integer -> d -> digit -> E };
+\tikz \graph [grow right=2cm] { unsigned integer -> d -> digit -> E };
\end{codeexample}
-Not quite perfect, but we are getting somewhere. First, let us change
-the positioning algorithm by saying |grow right sep|, which causes new
-nodes to be placed to the right of the previous nodes with a certain
-fixed separation (|1em| by default). Second, we add some options to
-make the node ``look nice''. Third, note the funny |d| node above: Ilka
-tried writing just |.| there first, but got some error messages. The
-reason is that a node cannot be called |.| in \tikzname, so she had to
-choose a different name -- which is not good, since she wants a dot to
-be shown! The trick is to put the dot in quotation marks, this allows
-you to use ``quite arbitrary text'' as a node name:
+%
+Not quite perfect, but we are getting somewhere. First, let us change the
+positioning algorithm by saying |grow right sep|, which causes new nodes to be
+placed to the right of the previous nodes with a certain fixed separation
+(|1em| by default). Second, we add some options to make the node ``look nice''.
+Third, note the funny |d| node above: Ilka tried writing just |.| there first,
+but got some error messages. The reason is that a node cannot be called |.| in
+\tikzname, so she had to choose a different name -- which is not good, since
+she wants a dot to be shown! The trick is to put the dot in quotation marks,
+this allows you to use ``quite arbitrary text'' as a node name:
+
\begin{codeexample}[]
\tikz \graph [grow right sep] {
unsigned integer[nonterminal] -> "."[terminal] -> digit[terminal] -> E[terminal]
-};
+};
\end{codeexample}
-Now comes the fork to the plus and minus signs. Here, Ilka can use the
-grouping mechanism of the |graph| command to create a split:
+%
+Now comes the fork to the plus and minus signs. Here, Ilka can use the grouping
+mechanism of the |graph| command to create a split:
+%
\begin{codeexample}[]
\tikz \graph [grow right sep] {
unsigned integer [nonterminal] ->
@@ -640,29 +651,28 @@ grouping mechanism of the |graph| command to create a split:
"-" [terminal]
} ->
ui2/unsigned integer [nonterminal]
-};
+};
\end{codeexample}
-Let us see, what is happening here. We want two |unsigned integer|
-nodes, but if we just were to use this text twice, then \tikzname\
-would have noticed that the same name was used already in the current
-graph and, being smart (actually too smart in this case), would have
-created an edge back to the already-created node. Thus, a fresh name
-is needed here. However, Ilka also cannot just write
-|unsigned integer2|, because she wants the original text to be shown,
-after all! The trick is to use a slash inside the node name: In
-order to ``render'' the node, the text following the slash
-is used instead of the node name, which is the text before the
-slash. Alternatively, the |as| option can be used, which also
-allows you to specify how a node should be rendered.
-
-It turns out that Ilka does not need to invent a name like
-|ui2| for a node that she will not reference again
-anyway. In this case, she can just leave out the name (write nothing
-before |/|), which always stands for a ``fresh, anonymous'' node name.
-
-Next, Ilka needs to add some coordinates in between of some nodes
-where the back-loops should got and she needs to shift the nodes a
-bit:
+%
+Let us see, what is happening here. We want two |unsigned integer| nodes, but
+if we just were to use this text twice, then \tikzname\ would have noticed that
+the same name was used already in the current graph and, being smart (actually
+too smart in this case), would have created an edge back to the already-created
+node. Thus, a fresh name is needed here. However, Ilka also cannot just write
+|unsigned integer2|, because she wants the original text to be shown, after
+all! The trick is to use a slash inside the node name: In order to ``render''
+the node, the text following the slash is used instead of the node name, which
+is the text before the slash. Alternatively, the |as| option can be used, which
+also allows you to specify how a node should be rendered.
+
+It turns out that Ilka does not need to invent a name like |ui2| for a node
+that she will not reference again anyway. In this case, she can just leave out
+the name (write nothing before |/|), which always stands for a ``fresh,
+anonymous'' node name.
+
+Next, Ilka needs to add some coordinates in between of some nodes where the
+back-loops should got and she needs to shift the nodes a bit:
+%
\begin{codeexample}[pre={\tikzset{
skip loop/.style={to path={-- ++(0,##1) -| (\tikztotarget)}},
hv path/.style={to path={-| (\tikztotarget)}},
@@ -699,20 +709,19 @@ bit:
\end{tikzpicture}
\end{codeexample}
-All that remains to be done is to somehow get rid of the strange
-curves between the |E| and the unsigned integer. They are caused by
-\tikzname's attempt at creating an edge that first goes vertical and
-then horizontal but is actually just horizontal. Additionally, the
-edge should not really be pointed; but it seems difficult to get rid
-of this since the \emph{other} edges from |q1|, namely to |plus| and
-|minus| should be pointed.
-
-It turns out that there is a nice way of solving this problem: You can
-specify that a graph is |simple|. This means that there can be at most
-one edge between any two nodes. Now, if you specify an edge twice, the
-options of the second specification ``win.'' Thus, by adding two more
-lines that ``correct'' these edges, we get the final diagram with its
-complete code:
+All that remains to be done is to somehow get rid of the strange curves between
+the |E| and the unsigned integer. They are caused by \tikzname's attempt at
+creating an edge that first goes vertical and then horizontal but is actually
+just horizontal. Additionally, the edge should not really be pointed; but it
+seems difficult to get rid of this since the \emph{other} edges from |q1|,
+namely to |plus| and |minus| should be pointed.
+
+It turns out that there is a nice way of solving this problem: You can specify
+that a graph is |simple|. This means that there can be at most one edge between
+any two nodes. Now, if you specify an edge twice, the options of the second
+specification ``win''. Thus, by adding two more lines that ``correct'' these
+edges, we get the final diagram with its complete code:
+%
\begin{codeexample}[]
\tikz [>=stealth', black!50, text=black, thick,
every new ->/.style = {shorten >=1pt},
@@ -725,7 +734,7 @@ complete code:
bottom color=red!50!black!20, font=\itshape, text height=1.5ex,text depth=.25ex},
terminal/.style = {
rounded rectangle, minimum size=6mm, very thick, draw=black!50, top color=white,
- bottom color=black!20, font=\ttfamily, text height=1.5ex, text depth=.25ex},
+ bottom color=black!20, font=\ttfamily, text height=1.5ex, text depth=.25ex},
shape = coordinate
]
\graph [grow right sep, branch down=7mm, simple] {
@@ -745,23 +754,23 @@ complete code:
\end{codeexample}
-
+%% TODOsp: a commented subsection
% \subsection{Using Chains}
-
+%
% Matrices allow Ilka to align the nodes nicely, but the connections are
% not quite perfect. The problem is that the code does not really
% reflect the paths that underlie the diagram.
-
-
+%
+%
% For this reason, Ilka decides to try out \emph{chains} by including
% the |chain| library. Basically, a chain is just a sequence of
% (usually) connected nodes. The nodes can already have been constructed
% or they can be constructed as the chain is constructed (or these
% processes can be mixed).
-
+%
% \subsubsection{Creating a Simple Chain}
-
-
+%
+%
% Ilka starts with creating a chain from scratch. For this, she starts a
% chain using the |start chain| option in a scope. Then, inside the
% scope, she uses the |on chain| option on nodes to add them to the
@@ -776,11 +785,11 @@ complete code:
% \end{tikzpicture}
% \end{codeexample}
% (Ilka will add the plus and minus nodes later.)
-
+%
% As can be seen, the nodes of a chain are placed in a row. This can be
% changed, for instance by saying |start chain=going below| we get a
% chain where each node is below the previous one.
-
+%
% The next step is to \emph{join} the nodes of the chain. For this, we
% add the |join| option to each node. This joins the node with the
% previous node (for the first node nothing happens).
@@ -805,10 +814,10 @@ complete code:
% \node [nonterminal] {unsigned integer};
% \end{tikzpicture}
% \end{codeexample}
-
-
+%
+%
% \subsubsection{Branching and Joining a Chain}
-
+%
% It is now time to add the plus and minus signs. They obviously
% \emph{branch off} the main chain. For this reason, we start a branch
% for them using the |start branch| option.
@@ -827,7 +836,7 @@ complete code:
% \node [nonterminal,join=with plus,join=with minus] {unsigned integer};
% \end{tikzpicture}
% \end{codeexample}
-
+%
% Let us see, what is going on here. First, the |start branch| begins a
% branch, starting with the node last created on the current chain,
% which is the |E| node in our case. This is implicitly also the first
@@ -838,18 +847,18 @@ complete code:
% to be placed above and right of the |E| node. It is automatically
% joined to its predecessor on the branch by the implicit |join|
% 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 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
% additional |join| options get a special |with| parameter. This allows
% you to join a node with a node other than the predecessor on the
% chain. The |with| should be followed by the name of a node.
-
+%
% Since Ilka will need scopes more often in the following, she includes
% the |scopes| library. This allows her to replace |\begin{scope}|
% simply by an opening brace and |\end{scope}| by the corresponding
@@ -860,7 +869,7 @@ complete code:
% |chain/|\meta{branch}|-|\meta{i}. The \meta{i} can be replaced by
% |begin| and |end| to reference the first and (currently) last node on
% the chain.
-
+%
% \begin{codeexample}[]
% \begin{tikzpicture}[start chain,node distance=5mm, every on chain/.style={join}, every join/.style={->}]
% \node [on chain,nonterminal] {unsigned integer};
@@ -876,8 +885,8 @@ complete code:
% \node [nonterminal,on chain,join=with chain/plus-end,join=with chain/minus-end] {unsigned integer};
% \end{tikzpicture}
% \end{codeexample}
-
-
+%
+%
% The next step is to add intermediate coordinate nodes in the same
% manner as Ilka did for the matrix. For them, we change the |join|
% style slightly, namely for these nodes we do not want an arrow
@@ -885,7 +894,7 @@ complete code:
% |every join| style or, which is what is done in the below example, by
% giving the desired style using |join=by ...|, where |...| is the style
% to be used for the join.
-
+%
% \begin{codeexample}[]
% \begin{tikzpicture}[start chain,node distance=5mm and 2mm,
% every node/.style={on chain},
@@ -911,14 +920,14 @@ complete code:
% \node [point] {};
% \end{tikzpicture}
% \end{codeexample}
-
-
+%
+%
% \subsubsection{Chaining Together Already Positioned Nodes}
-
+%
% The final step is to add the missing arrows. We can also use branches
% for them (even though we do not have to, but it is good practice and
% they exhibit the structure of the diagram in the code).
-
+%
% Let us start with the repeat loop around the |digit|. This can be
% thought of as a branch that starts at the point after the digit and
% that ends at the point before the digit. However, we have already
@@ -927,7 +936,7 @@ complete code:
% command. This command must be followed by a coordinate that contains a
% 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 ->},
@@ -943,18 +952,18 @@ complete code:
% \node [point] {};
% \end{tikzpicture}
% \end{codeexample}
-
-
+%
+%
% \subsubsection{Combined Use of Matrices and Chains}
-
+%
% Ilka's final idea is to combine matrices and chains in the following
% manner: She will use a matrix to position the nodes. However, to show
% the logical ``flow structure'' inside the diagram, she will create
% chains and branches that show what is going on.
-
+%
% Ilka starts with the matrix we had earlier, only with slightly adapted
% styles. Then she writes down the main chain and its branches:
-
+%
% \begin{codeexample}[]
% \begin{tikzpicture}[point/.style={coordinate},>=stealth',thick,draw=black!50,
% tip/.style={->,shorten >=1pt},every join/.style={rounded corners},
@@ -975,7 +984,7 @@ complete code:
% % Third row:
% & & & & & & & & & & & \node (minus)[terminal] {-};\\
% };
-
+%
% { [start chain]
% \chainin (p1);
% \chainin (ui1) [join=by tip];
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
index 99a173f9e39..e3af1d3b5fe 100644
--- 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
@@ -10,110 +10,105 @@
\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.
+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.
+ \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
-set up the environment. Johannes is going to use the
-|mindmap| library and since he wishes to show a calendar, he will also need
-the |calendar| library. In order to put something
-on a background layer, it seems like a good idea to also include the
+As always, Johannes will have to include the right libraries and set up the
+environment. Johannes is going to use the |mindmap| library and since he wishes
+to show a calendar, he will also need the |calendar| library. In order to put
+something on a background layer, it seems like a good idea to also include the
|backgrounds| library.
\subsection{Introduction to Trees}
-The first choice Johannes must make is whether he will organize the
-concepts as 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 first choice Johannes must make is whether he will organize the concepts as
+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:
-
+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}
+ \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
+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
@@ -147,27 +142,28 @@ writes down the following:
};
\end{codeexample}
-Well, that did not quite work out as expected (although, what,
-exactly, did one expect?). There are two problems:
+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.
+ \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:
-
+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},
@@ -202,37 +198,32 @@ options set, which he found more or less by trial-and-error:
... % 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 |trees| library you also get access to additional growth
-strategies such as a ``circular'' growth:
-
-
+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 |trees| 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,
@@ -269,42 +260,38 @@ strategies such as a ``circular'' growth:
... % as before
\end{codeexample}
-
-Johannes is pleased to learn that he can access and manipulate the
-nodes of the 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.
+Johannes is pleased to learn that he can access and manipulate the nodes of the
+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 set up the sibling \emph{angle} (rather than a
-sibling distance) to specify the angle between sibling concepts.
-
+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 set up 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,
@@ -350,21 +337,19 @@ sibling distance) to specify the angle between sibling concepts.
... % 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.
-
-
+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,
@@ -421,37 +406,34 @@ option to make \tikzname\ insert this text with every node.
\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 be encircled with a thick black line and the children are
-connected to the central concept via bars.
-
+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 be encircled
+with a thick black line and the children are connected to the central concept
+via bars.
+%
\begin{codeexample}[render instead={
\begin{tikzpicture}
[mindmap,
@@ -525,17 +507,16 @@ connected to the central concept via bars.
\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) set up 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.
-
+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)
+set up 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}[
@@ -614,25 +595,22 @@ concepts, just to make things look a bit more fancy.
\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 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:
-
+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 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}
@@ -644,10 +622,10 @@ name all concepts of the tree in the following manner:
...
\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.
-
+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);
@@ -726,21 +704,19 @@ by defining |every annotation| appropriately.
\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).
-
+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) {
@@ -833,40 +809,36 @@ we will, however, need it later on).
\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.
+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 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:
+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 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,
@@ -910,29 +882,26 @@ space:
\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 to 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''.
-
+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 to 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}
@@ -944,29 +913,26 @@ since it produces a list of days that go ``downward''.
\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:
-
-
+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:
@@ -986,9 +952,9 @@ lecture's title next to the date when the lecture will be held:
\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):
-
+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}
@@ -1008,13 +974,11 @@ example, only the new part of the definition is used):
\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.
-
+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}
@@ -1046,13 +1010,12 @@ beginning of each month.
\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:
@@ -1070,7 +1033,7 @@ First comes the definition of the |\lecture| command:
\end{codeexample}
This is followed by the main mindmap setup\dots
-
+%
\begin{codeexample}[code only]
\noindent
\begin{tikzpicture}
@@ -1123,7 +1086,9 @@ This is followed by the main mindmap setup\dots
};
\end{scope}
\end{codeexample}
+%
Now comes the calendar code:
+%
\begin{codeexample}[code only]
\tiny
\calendar [day list downward,
@@ -1138,7 +1103,9 @@ Now comes the calendar code:
\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
@@ -1153,7 +1120,9 @@ The lecture annotations:
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);
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 b9a97e2046e..26f9805b6a0 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 Tilo Tantau
+% Copyright 2006 by Till Tantau
%
% This file may be distributed and/or modified
%
@@ -7,27 +7,27 @@
%
% 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.
+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 content with
-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 his Petri nets should also be drawn using a
-graphic program. One of the professors at his institute recommends
-\tikzname\ for this and Hagen decides to give it a try.
+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 content with 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 his Petri nets should also
+be drawn using a graphic program. One of the professors at his institute
+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:
-
+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,
@@ -119,26 +119,24 @@ capacities. The graphic should look like this, ideally:
\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.
+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 |backgrounds|
-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.
+Hagen will need to load several libraries: The |arrows| library for the special
+arrow tip used in the graphic, the |decorations.pathmorphing| library for the
+``snaking line'' in the middle, the |backgrounds| 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
@@ -156,7 +154,7 @@ When using \LaTeX\ use:
\subsubsection{Setting up the Environment in Plain \TeX}
When using plain \TeX\ use:
-
+%
\begin{codeexample}[code only]
%% Plain TeX file
\input tikz.tex
@@ -173,7 +171,8 @@ When using plain \TeX\ use:
\subsubsection{Setting up the Environment in Con\TeX t}
-When using Con\TeX, use:
+When using Con\TeX t, use:
+%
\begin{codeexample}[code only]
%% ConTeXt file
\usemodule[tikz]
@@ -187,41 +186,39 @@ When using Con\TeX, use:
\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 is 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 some 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
+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 is 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 some 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] {}
@@ -232,51 +229,45 @@ use three nodes of shape |circle| and two nodes of shape
\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 built. 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.'' The 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.
-
+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 built. 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.'' The 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:
+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] {}
@@ -287,11 +278,11 @@ last coordinate. Hagen can then write the following:
\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:
-
+Now Hagen is still left with a single empty path, but at least the path no
+longer contains strange move-to's. 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] {};
@@ -302,18 +293,17 @@ be improved further: The |\node| command is an abbreviation for
\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.
-
+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:
-
+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] {};
@@ -324,14 +314,14 @@ different colors, resulting in the following code:
\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:
+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},
@@ -347,13 +337,13 @@ places and another style for transitions:
\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 that \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:
-
+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 that \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,
@@ -367,22 +357,20 @@ adds some space around the text. The amount is set using the option
\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 node 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.
-
+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 node 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,
@@ -398,24 +386,22 @@ the automatically added space.
\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.
+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 to 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.
+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 to 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},
@@ -433,17 +419,17 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\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:
+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},
@@ -461,17 +447,16 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
}
-
\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:
-
+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},
@@ -488,28 +473,27 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\end{codeexample}
}
-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
-|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 as 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.
+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 |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 as 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:
+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.
+ \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},
@@ -527,17 +511,19 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\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|.
+ %
+ 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},
@@ -554,21 +540,25 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\end{tikzpicture}
\end{codeexample}
}
- It is also possible to give multiple |label| options, this causes
- multiple labels to be drawn.
+ %
+ 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.
+ %
+ 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},
@@ -588,20 +578,18 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\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:
-
+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},
@@ -619,9 +607,9 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\end{codeexample}
}
-Next, let us tackle the curve from |waiting| to |enter critical|. This
-can be specified using curves and controls:
-
+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},
@@ -641,13 +629,13 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\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:
+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},
@@ -667,25 +655,22 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\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 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:
-
+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 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:
+%
{
\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
inner sep=0pt,minimum size=6mm},
@@ -704,11 +689,10 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\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 bent to the right:
-
+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 bent to the right:
+%
{
\tikzset{place/.style={circle,draw=blue!50,fill=blue!20,thick,
inner sep=0pt,minimum size=6mm},
@@ -728,17 +712,15 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\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 it has some nice consequences. For example, every edge can have
-its own arrow tips and its own color and so on and, still, all the
-edges can be given on the same path. This allows Hagen to write the
-following:
-
-
+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 it has some nice
+consequences. For example, every edge can have its own arrow tips and its own
+color and so on 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},
@@ -758,13 +740,12 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
\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:
+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},
@@ -794,17 +775,14 @@ transition/.style={rectangle,draw=black!50,fill=black!20,thick,
}
-
-
\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:
-
+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]
@@ -819,18 +797,16 @@ general example:
\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.
+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},
@@ -858,32 +834,27 @@ post/.style={->,shorten >=1pt,>=stealth',semithick}}
}
-
\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 snaked line, 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.
+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 snaked line, 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.
-
+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,
@@ -892,11 +863,11 @@ options.
\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.
-
+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,
@@ -911,10 +882,9 @@ command to enforce the line breaks at the desired positions.
\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:
-
+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,
@@ -929,34 +899,31 @@ for him:
\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 scope with the
-|on background layer| option. 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 given 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.
-
+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 scope with the
+|on background layer| option. 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 given 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},
@@ -989,19 +956,17 @@ post/.style={->,shorten >=1pt,>=stealth',semithick}}
}
-
\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.
+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,
@@ -1012,9 +977,9 @@ specify the colors of places and transitions.
\end{codeexample}
Now comes the code for the nets:
-
+%
{
-\tikzset{%
+\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},
@@ -1049,7 +1014,7 @@ Now comes the code for the nets:
{
\tikzset{
-every place/.style= {minimum size=6mm,thick,draw=blue!75,fill=blue!20},
+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},
@@ -1091,7 +1056,7 @@ every picture/.style={on grid,node distance=1.3cm,>=stealth',bend angle=45,auto}
}
The code for the background and the snake is the following:
-
+%
\begin{codeexample}[code only]
\begin{scope}[on background layer]
\node (r1) [fill=black!10,rounded corners,fit=(w1)(w2)(e1)(e2)(l1)(l2)] {};
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 07f6784f54c..614177a7fa5 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
@@ -7,45 +7,43 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
\section{Tutorial: A Picture for Karl's Students}
-This tutorial is intended for new users of \tikzname. It
-does not give an exhaustive account of all the features of \tikzname,
-just of those that you are likely to use right away.
-
-Karl is a math and chemistry high-school teacher. He used to create
-the graphics in his worksheets and exams using \LaTeX's |{picture}|
-environment. While the results were acceptable, creating the graphics
-often turned out to be a lengthy process. Also, there tended to be
-problems with lines having slightly wrong angles and circles also
-seemed to be hard to get right. Naturally, his students could not care
-less whether the lines had the exact right angles and they find
-Karl's exams too difficult no matter how nicely they were drawn. But
+This tutorial is intended for new users of \tikzname. It does not give an
+exhaustive account of all the features of \tikzname, just of those that you are
+likely to use right away.
+
+Karl is a math and chemistry high-school teacher. He used to create the
+graphics in his worksheets and exams using \LaTeX's |{picture}| environment.
+While the results were acceptable, creating the graphics often turned out to be
+a lengthy process. Also, there tended to be problems with lines having slightly
+wrong angles and circles also seemed to be hard to get right. Naturally, his
+students could not care less whether the lines had the exact right angles and
+they find Karl's exams too difficult no matter how nicely they were drawn. But
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
-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
-all a bit strange and \tikzname\ seems to indicate that the package
-does not do what he needs. However, having used \textsc{gnu}
-software for quite some time and ``\textsc{gnu} not being Unix,''
+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 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 all a bit strange and \tikzname\ seems to
+indicate that the package does not do what he needs. However, having used
+\textsc{gnu} software for quite some time and ``\textsc{gnu} not being Unix'',
there seems to be hope yet. His son assures him that \tikzname's name is
-intended to warn people that \tikzname\ is not a program that you can
-use to draw graphics with your mouse or tablet. Rather, it is more
-like a ``graphics language.''
+intended to warn people that \tikzname\ is not a program that you can use to
+draw graphics with your mouse or tablet. Rather, it is more like a ``graphics
+language''.
\subsection{Problem Statement}
-Karl wants to put a graphic on the next worksheet for his
-students. He is currently teaching his students about sine and
-cosine. What he would like to have is something that looks like this
-(ideally):
-
+Karl wants to put a graphic on the next worksheet for his students. He is
+currently teaching his students about sine and cosine. What he would like to
+have is something that looks like this (ideally):
+%
\noindent
\begin{tikzpicture}
[scale=3,line cap=round,
@@ -124,16 +122,16 @@ cosine. What he would like to have is something that looks like this
\subsection{Setting up the Environment}
-In \tikzname, to draw a picture, at the start of the picture
-you need to tell \TeX\ or \LaTeX\ that you want to start a picture. In
-\LaTeX\ this is done using the environment |{tikzpicture}|, in plain
-\TeX\ you just use |\tikzpicture| to start the picture and
-|\endtikzpicture| to end it.
+In \tikzname, to draw a picture, at the start of the picture you need to tell
+\TeX\ or \LaTeX\ that you want to start a picture. In \LaTeX\ this is done
+using the environment |{tikzpicture}|, in plain \TeX\ you just use
+|\tikzpicture| to start the picture and |\endtikzpicture| to end it.
+
\subsubsection{Setting up the Environment in \LaTeX}
Karl, being a \LaTeX\ user, thus sets up his file as follows:
-
+%
\begin{codeexample}[code only]
\documentclass{article} % say
\usepackage{tikz}
@@ -146,9 +144,9 @@ We are working on
\end{document}
\end{codeexample}
-When executed, that is, run via |pdflatex| or via |latex| followed by
-|dvips|, the resulting will contain something that looks like this:
-
+When executed, that is, run via |pdflatex| or via |latex| followed by |dvips|,
+the resulting will contain something that looks like this:
+%
\begin{codeexample}[width=7cm]
We are working on
\begin{tikzpicture}
@@ -157,39 +155,38 @@ We are working on
\end{tikzpicture}.
\end{codeexample}
-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.
+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.
-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
-basic \pgfname\ system. The basic layer, which is also described in this
-manual, is somewhat more, well, basic and thus harder to use. The
-frontend makes things easier by providing a simpler syntax.
+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 basic \pgfname\ system.
+The basic layer, which is also described in this manual, is somewhat more,
+well, basic and thus harder to use. The frontend makes things easier by
+providing a simpler syntax.
-Inside the environment there are two |\draw| commands. They mean:
-``The path, which is specified following the command up to the
-semicolon, should be drawn.'' The first path is specified
-as |(-1.5,0) -- (0,1.5)|, which means ``a straight line from the point
-at position $(-1.5,0)$ to the point at position $(0,1.5)$.'' Here, the
-positions are specified within a special coordinate system in which,
-initially, one unit is 1cm.
+Inside the environment there are two |\draw| commands. They mean: ``The path,
+which is specified following the command up to the semicolon, should be
+drawn.'' The first path is specified as |(-1.5,0) -- (0,1.5)|, which means ``a
+straight line from the point at position $(-1.5,0)$ to the point at position
+$(0,1.5)$''. Here, the positions are specified within a special coordinate
+system in which, initially, one unit is 1cm.
-Karl is quite pleased to note that the environment automatically
-reserves enough space to encompass the picture.
+Karl is quite pleased to note that the environment automatically reserves
+enough space to encompass the picture.
\subsubsection{Setting up the Environment in Plain \TeX}
-Karl's wife Gerda, who also happens to be a math teacher, is not a
-\LaTeX\ user, but uses plain \TeX\ since she prefers to do things
-``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|.
+Karl's wife Gerda, who also happens to be a math teacher, is not a \LaTeX\
+user, but uses plain \TeX\ since she prefers to do things ``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|.
Thus, she would use:
+%
\begin{codeexample}[code only]
%% Plain TeX file
\input tikz.tex
@@ -204,24 +201,22 @@ We are working on
\bye
\end{codeexample}
-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
-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|.
-
+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 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|.
\subsubsection{Setting up the Environment in Con\TeX t}
-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|.
+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|.
His version of the example looks like this:
+%
\begin{codeexample}[code only]
%% ConTeXt file
\usemodule[tikz]
@@ -235,55 +230,51 @@ His version of the example looks like this:
\stoptext
\end{codeexample}
-Hans will now typeset this file in the usual way using
-|texexec| or |context|.
-
+Hans will now typeset this file in the usual way using |texexec| or |context|.
\subsection{Straight Path Construction}
-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
-coordinates of the start position as a point in round brackets, as in
-|(0,0)|. This is followed by a series of ``path extension
-operations.'' The simplest is |--|, which we used already. It must be
-followed by another coordinate and it extends the path in a straight
-line to this new position. For example, if we were to turn the two
-paths of the axes into one path, the following would result:
-
+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 coordinates of the start position as a point
+in round brackets, as in |(0,0)|. This is followed by a series of ``path
+extension operations''. The simplest is |--|, which we used already. It must be
+followed by another coordinate and it extends the path in a straight line to
+this new position. For example, if we were to turn the two paths of the axes
+into one path, the following would result:
+%
\begin{codeexample}[]
\tikz \draw (-1.5,0) -- (1.5,0) -- (0,-1.5) -- (0,1.5);
\end{codeexample}
Karl is a bit confused by the fact that there is no |{tikzpicture}|
-environment, here. Instead, the little command |\tikz| is used. This
-command either takes one argument (starting with an opening brace as in
-|\tikz{\draw (0,0) -- (1.5,0)}|, which yields \tikz{\draw (0,0)
- --(1.5,0);}) or collects everything up to the next semicolon and
-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.
-
+environment, here. Instead, the little command |\tikz| is used. This command
+either takes one argument (starting with an opening brace as in
+|\tikz{\draw (0,0) -- (1.5,0)}|, which yields \tikz{\draw (0,0) --(1.5,0);}) or
+collects everything up to the next semicolon and 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.
\subsection{Curved Path Construction}
-The next thing Karl wants to do is to draw the circle. For this,
-straight lines obviously will not do. Instead, we need some way to
-draw curves. For this, \tikzname\ provides a special syntax. One or two
-``control points'' are needed. The math behind them is not quite
-trivial, but here is the basic idea: Suppose you are at point $x$ and
-the first control point is $y$. Then the curve will start ``going in
-the direction of~$y$ at~$x$,'' that is, the tangent of the curve at $x$
-will point toward~$y$. Next, suppose the curve should end at $z$ and
-the second support point is $w$. Then the curve will, indeed, end at
-$z$ and the tangent of the curve at point $z$ will go through $w$.
+The next thing Karl wants to do is to draw the circle. For this, straight lines
+obviously will not do. Instead, we need some way to draw curves. For this,
+\tikzname\ provides a special syntax. One or two ``control points'' are needed.
+The math behind them is not quite trivial, but here is the basic idea: Suppose
+you are at point $x$ and the first control point is $y$. Then the curve will
+start ``going in the direction of~$y$ at~$x$'', that is, the tangent of the
+curve at $x$ will point toward~$y$. Next, suppose the curve should end at $z$
+and the second support point is $w$. Then the curve will, indeed, end at $z$
+and the tangent of the curve at point $z$ will go through $w$.
Here is an example (the control points have been added for clarity):
+%
\begin{codeexample}[]
\begin{tikzpicture}
\filldraw [gray] (0,0) circle [radius=2pt]
@@ -294,14 +285,13 @@ Here is an example (the control points have been added for clarity):
\end{tikzpicture}
\end{codeexample}
-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
-twice.
+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 twice.
So, Karl can now add the first half circle to the picture:
-
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw (-1.5,0) -- (1.5,0);
@@ -311,38 +301,38 @@ So, Karl can now add the first half circle to the picture:
\end{tikzpicture}
\end{codeexample}
-Karl is happy with the result, but finds specifying circles in this
-way to be extremely awkward. Fortunately, there is a much simpler way.
+Karl is happy with the result, but finds specifying circles in this way to be
+extremely awkward. Fortunately, there is a much simpler way.
\subsection{Circle Path Construction}
-In order to draw a circle, the path construction operation |circle| can
-be used. This operation is followed by a radius in brackets as in
-the following example: (Note that the previous position is used as the
-\emph{center} of the circle.)
-
+In order to draw a circle, the path construction operation |circle| can be
+used. This operation is followed by a radius in brackets as in the following
+example: (Note that the previous position is used as the \emph{center} of the
+circle.)
+%
\begin{codeexample}[]
\tikz \draw (0,0) circle [radius=10pt];
\end{codeexample}
-You can also append an ellipse to the path using the |ellipse|
-operation. Instead of a single radius you can specify two of them:
-
+You can also append an ellipse to the path using the |ellipse| operation.
+Instead of a single radius you can specify two of them:
+%
\begin{codeexample}[]
\tikz \draw (0,0) ellipse [x radius=20pt, y radius=10pt];
\end{codeexample}
-To draw an ellipse whose axes are not horizontal and vertical, but
-point in an arbitrary direction (a ``turned ellipse'' like \tikz
-\draw[rotate=30] (0,0) ellipse [x radius=6pt, y radius=3pt];) you can use
-transformations, which are explained later. The code for the little
-ellipse is |\tikz \draw[rotate=30] (0,0) ellipse [x radius=6pt, y radius=3pt];|, by
-the way.
+To draw an ellipse whose axes are not horizontal and vertical, but point in an
+arbitrary direction (a ``turned ellipse'' like \tikz \draw[rotate=30] (0,0)
+ellipse [x radius=6pt, y radius=3pt];) you can use transformations, which are
+explained later. The code for the little ellipse is
+|\tikz \draw[rotate=30] (0,0) ellipse [x radius=6pt, y radius=3pt];|, by the
+way.
So, returning to Karl's problem, he can write
|\draw (0,0) circle [radius=1cm];| to draw the circle:
-
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw (-1.5,0) -- (1.5,0);
@@ -351,27 +341,24 @@ So, returning to Karl's problem, he can write
\end{tikzpicture}
\end{codeexample}
-
-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.
-
-
+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.
\subsection{Rectangle Path Construction}
-The next things we would like to have is the grid in the background.
-There are several ways to produce it. For example, one might draw lots of
-rectangles. Since rectangles are so common, there is a special syntax
-for them: To add a rectangle to the current path, use the |rectangle|
-path construction operation. This operation should be followed by another
-coordinate and will append a rectangle to the path such that the
-previous coordinate and the next coordinates are corners of the
-rectangle. So, let us add two rectangles to the picture:
-
+The next things we would like to have is the grid in the background. There are
+several ways to produce it. For example, one might draw lots of rectangles.
+Since rectangles are so common, there is a special syntax for them: To add a
+rectangle to the current path, use the |rectangle| path construction operation.
+This operation should be followed by another coordinate and will append a
+rectangle to the path such that the previous coordinate and the next
+coordinates are corners of the rectangle. So, let us add two rectangles to the
+picture:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw (-1.5,0) -- (1.5,0);
@@ -382,31 +369,28 @@ rectangle. So, let us add two rectangles to the picture:
\end{tikzpicture}
\end{codeexample}
-While this may be nice in other situations, this is not really leading
-anywhere with Karl's problem: First, we would need an awful lot of
-these rectangles and then there is the border that is not ``closed.''
-
-So, Karl is about to resort to simply drawing four vertical and four
-horizontal lines using the nice |\draw| command, when he learns that
-there is a |grid| path construction operation.
+While this may be nice in other situations, this is not really leading anywhere
+with Karl's problem: First, we would need an awful lot of these rectangles and
+then there is the border that is not ``closed''.
+So, Karl is about to resort to simply drawing four vertical and four horizontal
+lines using the nice |\draw| command, when he learns that there is a |grid|
+path construction operation.
\subsection{Grid Path Construction}
-The |grid| path operation adds a grid to the current path. It will add
-lines making up a grid that fills the rectangle whose one corner is
-the current point and whose other corner is the point following the
-|grid| operation. For example, the code
-|\tikz \draw[step=2pt] (0,0) grid (10pt,10pt);| produces \tikz
-\draw[step=2pt] (0,0) grid (10pt,10pt);. Note how the optional
-argument for |\draw| can be used to specify a grid width (there are
-also |xstep| and |ystep| to define the steppings independently). As
-Karl will learn soon, there are \emph{lots} of things that can be
-influenced using such options.
+The |grid| path operation adds a grid to the current path. It will add lines
+making up a grid that fills the rectangle whose one corner is the current point
+and whose other corner is the point following the |grid| operation. For
+example, the code |\tikz \draw[step=2pt] (0,0) grid (10pt,10pt);| produces
+\tikz \draw[step=2pt] (0,0) grid (10pt,10pt);. Note how the optional argument
+for |\draw| can be used to specify a grid width (there are also |xstep| and
+|ystep| to define the steppings independently). As Karl will learn soon, there
+are \emph{lots} of things that can be influenced using such options.
For Karl, the following code could be used:
-
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw (-1.5,0) -- (1.5,0);
@@ -416,15 +400,14 @@ For Karl, the following code could be used:
\end{tikzpicture}
\end{codeexample}
-Having another look at the desired picture, Karl notices that it would
-be nice for the grid to be more subdued. (His son told him that grids
-tend to be distracting if they are not subdued.) To subdue the grid,
-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.
-
+Having another look at the desired picture, Karl notices that it would be nice
+for the grid to be more subdued. (His son told him that grids tend to be
+distracting if they are not subdued.) To subdue the grid, 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.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4);
@@ -437,46 +420,47 @@ top.
\subsection{Adding a Touch of Style}
-Instead of the options |gray,very thin| Karl could also have
-said |help lines|. \emph{Styles} are predefined sets of options
-that can be used to organize how a graphic is drawn. By saying
-|help lines| you say ``use the style that I (or someone else)
-has set for drawing help lines.'' If Karl decides, at some later
-point, that grids should be drawn, say, using the color |blue!50|
-instead of |gray|, he could provide the following option somewhere:
+Instead of the options |gray,very thin| Karl could also have said |help lines|.
+\emph{Styles} are predefined sets of options that can be used to organize how a
+graphic is drawn. By saying |help lines| you say ``use the style that I (or
+someone else) has set for drawing help lines''. If Karl decides, at some later
+point, that grids should be drawn, say, using the color |blue!50| instead of
+|gray|, he could provide the following option somewhere:
+%
\begin{codeexample}[code only]
help lines/.style={color=blue!50,very thin}
\end{codeexample}
-The effect of this ``style setter'' is that in the current
-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.
-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
+%
+The effect of this ``style setter'' is that in the current 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. 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
+%
\begin{codeexample}[code only]
\tikzset{help lines/.style=very thin}
\end{codeexample}
-To build a hierarchy of styles you can have one style use
-another. So in order to define a style |Karl's grid| that is based on
-the |grid| style Karl could say
+To build a hierarchy of styles you can have one style use another. So in order
+to define a style |Karl's grid| that is based on the |grid| style Karl could
+say
+%
\begin{codeexample}[code only]
\tikzset{Karl's grid/.style={help lines,color=blue!50}}
...
\draw[Karl's grid] (0,0) grid (5,5);
\end{codeexample}
-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 parameterize his grid so that, by
-default, it is blue, but he could also use another color.
-
+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 parameterize his grid so that, by default, it is blue, but he could also
+use another color.
+%
\begin{codeexample}[code only]
\begin{tikzpicture}
[Karl's grid/.style ={help lines,color=#1!50},
@@ -490,53 +474,46 @@ default, it is blue, but he could also use another color.
\subsection{Drawing Options}
-Karl wonders what other options there are that influence how a path is
-drawn. He saw already that the |color=|\meta{color} option can be used
-to set the line's color. The option |draw=|\meta{color} does nearly
-the same, only it sets the color for the lines only and a different
-color can be used for filling (Karl will need this when he fills the
-arc for the angle).
-
-He saw that the style |very thin| yields very thin lines. Karl is not
-really surprised by this and neither is he surprised to learn that |thin|
-yields thin lines, |thick| yields thick lines, |very thick| yields
-very thick lines, |ultra thick| yields really, really thick lines and
-|ultra thin| yields lines that are so thin that low-resolution printers
-and displays will have trouble showing them. He wonders what gives
-lines of ``normal'' thickness. It turns out that |thin| is the correct
-choice, since it gives the same thickness as \TeX's |\hrule|
-command. Nevertheless, Karl would like to know whether there is
-anything ``in the middle'' between |thin| and |thick|. There is:
-|semithick|.
-
-Another useful thing one can do with lines is to dash or dot them. For
-this, the two styles |dashed| and |dotted| can be used, yielding
-\tikz[baseline] \draw[dashed] (0,.5ex) -- ++(2em,0pt); and
-\tikz[baseline] \draw[dotted] (0,.5ex)
--- ++(2em,0pt);. Both options also exist in a loose and a dense
-version, called |loosely dashed|, |densely dashed|, |loosely dotted|,
-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.
-
+Karl wonders what other options there are that influence how a path is drawn.
+He saw already that the |color=|\meta{color} option can be used to set the
+line's color. The option |draw=|\meta{color} does nearly the same, only it sets
+the color for the lines only and a different color can be used for filling
+(Karl will need this when he fills the arc for the angle).
+
+He saw that the style |very thin| yields very thin lines. Karl is not really
+surprised by this and neither is he surprised to learn that |thin| yields thin
+lines, |thick| yields thick lines, |very thick| yields very thick lines,
+|ultra thick| yields really, really thick lines and |ultra thin| yields lines
+that are so thin that low-resolution printers and displays will have trouble
+showing them. He wonders what gives lines of ``normal'' thickness. It turns out
+that |thin| is the correct choice, since it gives the same thickness as \TeX's
+|\hrule| command. Nevertheless, Karl would like to know whether there is
+anything ``in the middle'' between |thin| and |thick|. There is: |semithick|.
+
+Another useful thing one can do with lines is to dash or dot them. For this,
+the two styles |dashed| and |dotted| can be used, yielding \tikz[baseline]
+\draw[dashed] (0,.5ex) -- ++(2em,0pt); and \tikz[baseline] \draw[dotted]
+(0,.5ex) -- ++(2em,0pt);. Both options also exist in a loose and a dense
+version, called |loosely dashed|, |densely dashed|, |loosely dotted|, 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.
\subsection{Arc Path Construction}
-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 is followed by options in
-brackets that specify the arc. An example would be \texttt{arc[start
- angle=10, end angle=80, radius=10pt]}, which means exactly what it
-says. Karl obviously
-needs an arc from $0^\circ$ to $30^\circ$. The radius should be
-something relatively small, perhaps around one third of the circle's
-radius. 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.''
-
+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 is followed by options in brackets that specify the arc. An
+example would be \texttt{arc[start angle=10, end angle=80, radius=10pt]}, which
+means exactly what it says. Karl obviously needs an arc from $0^\circ$ to
+$30^\circ$. The radius should be something relatively small, perhaps around one
+third of the circle's radius. 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''.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4);
@@ -547,12 +524,12 @@ position. So, we first have to ``get there.''
\end{tikzpicture}
\end{codeexample}
-Karl thinks this is really a bit small and he cannot continue unless
-he learns how to do scaling. For this, he can add the |[scale=3]|
-option. He could add this option to each |\draw| command, but that
-would be awkward. Instead, he adds it to the whole environment, which
-causes this option to apply to everything within.
-
+Karl thinks this is really a bit small and he cannot continue unless he learns
+how to do scaling. For this, he can add the |[scale=3]| option. He could add
+this option to each |\draw| command, but that would be awkward. Instead, he
+adds it to the whole environment, which causes this option to apply to
+everything within.
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
\draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4);
@@ -563,25 +540,24 @@ causes this option to apply to everything within.
\end{tikzpicture}
\end{codeexample}
-As for circles, you can specify ``two'' radii in order to get an
-elliptical arc.
-
+As for circles, you can specify ``two'' radii in order to get an elliptical
+arc.
+%
\begin{codeexample}[]
- \tikz \draw (0,0)
- arc [start angle=0, end angle=315,
+ \tikz \draw (0,0)
+ arc [start angle=0, end angle=315,
x radius=1.75cm, y radius=1cm];
\end{codeexample}
\subsection{Clipping a Path}
-In order to save space in this manual, it would be nice to clip Karl's
-graphics a bit so that we can focus on the ``interesting''
-parts. Clipping is pretty easy in \tikzname. You can use the |\clip|
-command to clip all subsequent drawing. It works like |\draw|, only it
-does not draw anything, but uses the given path to clip everything
-subsequently.
-
+In order to save space in this manual, it would be nice to clip Karl's graphics
+a bit so that we can focus on the ``interesting'' parts. Clipping is pretty
+easy in \tikzname. You can use the |\clip| command to clip all subsequent
+drawing. It works like |\draw|, only it does not draw anything, but uses the
+given path to clip everything subsequently.
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
\clip (-0.1,-0.2) rectangle (1.1,0.75);
@@ -593,14 +569,13 @@ subsequently.
\end{tikzpicture}
\end{codeexample}
-You can also do both at the same time: Draw \emph{and} clip a
-path. For this, use the |\draw| command and add the |clip|
-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:
-
+You can also do both at the same time: Draw \emph{and} clip a path. For this,
+use the |\draw| command and add the |clip| 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:
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
\clip[draw] (0.5,0.5) circle (.6cm);
@@ -615,27 +590,25 @@ and |\clip| is a shorthand for |\path[clip]| and you could also say
\subsection{Parabola and Sine Path Construction}
-Although Karl does not need them for his picture, he is pleased to
-learn that there are |parabola| and |sin| and |cos| path operations for
-adding parabolas and sine and cosine curves to the current path. For the
-|parabola| operation, the current point will lie on the parabola as
-well as the point given after the parabola operation. Consider
-the following example:
-
+Although Karl does not need them for his picture, he is pleased to learn that
+there are |parabola| and |sin| and |cos| path operations for adding parabolas
+and sine and cosine curves to the current path. For the |parabola| operation,
+the current point will lie on the parabola as well as the point given after the
+parabola operation. Consider the following example:
+%
\begin{codeexample}[]
\tikz \draw (0,0) rectangle (1,1) (0,0) parabola (1,1);
\end{codeexample}
It is also possible to place the bend somewhere else:
-
+%
\begin{codeexample}[]
\tikz \draw[x=1pt,y=1pt] (0,0) parabola bend (4,16) (6,12);
\end{codeexample}
The operations |sin| and |cos| add a sine or cosine curve in the interval
-$[0,\pi/2]$ such that the previous current point is at the start of
-the curve and the curve ends at the given end point. Here are two
-examples:
+$[0,\pi/2]$ such that the previous current point is at the start of the curve
+and the curve ends at the given end point. Here are two examples:
\begin{codeexample}[]
A sine \tikz \draw[x=1ex,y=1ex] (0,0) sin (1.57,1); curve.
\end{codeexample}
@@ -646,13 +619,12 @@ A sine \tikz \draw[x=1ex,y=1ex] (0,0) sin (1.57,1); curve.
\end{codeexample}
-
\subsection{Filling and Drawing}
-Returning to the picture, Karl now wants the angle to be ``filled''
-with a very light green. For this he uses |\fill| instead of
-|\draw|. Here is what Karl does:
-
+Returning to the picture, Karl now wants the angle to be ``filled'' with a very
+light green. For this he uses |\fill| instead of |\draw|. Here is what Karl
+does:
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
\clip (-0.1,-0.2) rectangle (1.1,0.75);
@@ -665,24 +637,25 @@ with a very light green. For this he uses |\fill| instead of
\end{tikzpicture}
\end{codeexample}
-The color |green!20!white| means 20\% green and 80\% white mixed
-together. Such color expression are possible since \tikzname\ uses Uwe
-Kern's |xcolor| package, see the documentation of that package for
-details on color expressions.
+The color |green!20!white| means 20\% green and 80\% white mixed together. Such
+color expression are possible since \tikzname\ uses Uwe Kern's |xcolor|
+package, see the documentation of that package for details on color
+expressions.
-What would have happened, if Karl had not ``closed'' the path using
-|--(0,0)| at the end? In this case, the path is closed automatically,
-so this could have been omitted. Indeed, it would even have been
-better to write the following, instead:
+What would have happened, if Karl had not ``closed'' the path using |--(0,0)|
+at the end? In this case, the path is closed automatically, so this could have
+been omitted. Indeed, it would even have been better to write the following,
+instead:
+%
\begin{codeexample}[code only]
\fill[green!20!white] (0,0) -- (3mm,0mm)
arc [start angle=0, end angle=30, radius=3mm] -- cycle;
\end{codeexample}
-The |--cycle| causes the current path to be closed (actually the
-current part of the current path) by smoothly joining the first and
-last point. To appreciate the difference, consider the following
-example:
-
+%
+The |--cycle| causes the current path to be closed (actually the current part
+of the current path) by smoothly joining the first and last point. To
+appreciate the difference, consider the following example:
+%
\begin{codeexample}[]
\begin{tikzpicture}[line width=5pt]
\draw (0,0) -- (1,0) -- (1,1) -- (0,0);
@@ -691,12 +664,11 @@ example:
\end{tikzpicture}
\end{codeexample}
-You can also fill and draw a path at the same time using the
-|\filldraw| command. This will first draw the path, then fill it. This
-may not seem too useful, but you can specify different colors to be
-used for filling and for stroking. These are specified as optional
-arguments like this:
-
+You can also fill and draw a path at the same time using the |\filldraw|
+command. This will first draw the path, then fill it. This may not seem too
+useful, but you can specify different colors to be used for filling and for
+stroking. These are specified as optional arguments like this:
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
\clip (-0.1,-0.2) rectangle (1.1,0.75);
@@ -710,21 +682,20 @@ arguments like this:
\end{codeexample}
-
\subsection{Shading}
-Karl briefly considers the possibility of making the angle ``more
-fancy'' by \emph{shading} it. Instead of filling the area 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:
-
+Karl briefly considers the possibility of making the angle ``more fancy'' by
+\emph{shading} it. Instead of filling the area 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:
+%
\begin{codeexample}[]
\tikz \shade (0,0) rectangle (2,1) (3,0.5) circle (.5cm);
\end{codeexample}
-The default shading is a smooth transition from gray to white. To
-specify different colors, you can use options:
-
+%
+The default shading is a smooth transition from gray to white. To specify
+different colors, you can use options:
+%
\begin{codeexample}[]
\begin{tikzpicture}[rounded corners,ultra thick]
\shade[top color=yellow,bottom color=black] (0,0) rectangle +(2,1);
@@ -735,7 +706,7 @@ specify different colors, you can use options:
\end{codeexample}
For Karl, the following might be appropriate:
-
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
\clip (-0.1,-0.2) rectangle (1.1,0.75);
@@ -749,35 +720,34 @@ For Karl, the following might be appropriate:
\end{tikzpicture}
\end{codeexample}
-However, he wisely decides that shadings usually only distract without
-adding anything to the picture.
+However, he wisely decides that shadings usually only distract without adding
+anything to the picture.
\subsection{Specifying Coordinates}
-Karl now wants to add the sine and cosine lines. He knows already that
-he can use the |color=| option to set the lines' colors. So, what is
-the best way to specify the coordinates?
-
-There are different ways of specifying coordinates. The easiest way is
-to say something like |(10pt,2cm)|. This means 10pt in $x$-direction
-and 2cm in $y$-directions. Alternatively, you can also leave out the
-units as in |(1,2)|, which means ``one times the current $x$-vector
-plus twice the current $y$-vector.'' These vectors default to 1cm in
-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.''
-
-You can add a single |+| sign in front of a coordinate or two of
-them as in |+(0cm,1cm)| or |++(2cm,0cm)|. Such coordinates are interpreted
-differently: The first form means ``1cm upwards from the previous
-specified position'' and the second means ``2cm to the right of the
-previous specified position, making this the new specified position.''
-For example, we can draw the sine line as follows:
-
+Karl now wants to add the sine and cosine lines. He knows already that he can
+use the |color=| option to set the lines' colors. So, what is the best way to
+specify the coordinates?
+
+There are different ways of specifying coordinates. The easiest way is to say
+something like |(10pt,2cm)|. This means 10pt in $x$-direction and 2cm in
+$y$-directions. Alternatively, you can also leave out the units as in |(1,2)|,
+which means ``one times the current $x$-vector plus twice the current
+$y$-vector''. These vectors default to 1cm in 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''.
+
+You can add a single |+| sign in front of a coordinate or two of them as in
+|+(0cm,1cm)| or |++(2cm,0cm)|. Such coordinates are interpreted differently:
+The first form means ``1cm upwards from the previous specified position'' and
+the second means ``2cm to the right of the previous specified position, making
+this the new specified position''. For example, we can draw the sine line as
+follows:
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
\clip (-0.1,-0.2) rectangle (1.1,0.75);
@@ -791,18 +761,17 @@ For example, we can draw the sine line as follows:
\end{tikzpicture}
\end{codeexample}
-Karl used the fact $\sin 30^\circ = 1/2$. However, he very much
-doubts that his students know this, so it would be nice to have a way
-of specifying ``the point straight down from |(30:1cm)| that lies on
-the $x$-axis.'' This is, indeed, possible using a special syntax: Karl
-can write \verb!(30:1cm |- 0,0)!. In general, the meaning of
-|(|\meta{p}\verb! |- !\meta{q}|)| is ``the intersection of a vertical
-line through $p$ and a horizontal line through $q$.''
+Karl used the fact $\sin 30^\circ = 1/2$. However, he very much doubts that his
+students know this, so it would be nice to have a way of specifying ``the point
+straight down from |(30:1cm)| that lies on the $x$-axis''. This is, indeed,
+possible using a special syntax: Karl can write \verb!(30:1cm |- 0,0)!. In
+general, the meaning of |(|\meta{p}\verb! |- !\meta{q}|)| is ``the intersection
+of a vertical 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:
-
+\verb!(30:1cm |- 0,0) -- (0,0)!. Another way is the following: we ``continue''
+from where the sine ends:
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
\clip (-0.1,-0.2) rectangle (1.1,0.75);
@@ -817,17 +786,16 @@ Next, let us draw the cosine line. One way would be to say
\end{tikzpicture}
\end{codeexample}
-Note that there is no |--| between |(30:1cm)| and |++(0,-0.5)|. In
-detail, this path is interpreted as follows: ``First, the |(30:1cm)|
-tells me to move by pen to $(\cos 30^\circ,1/2)$. Next, there comes
-another coordinate specification, so I move my pen there without drawing
-anything. This new point is half a unit down from the last position,
-thus it is at $(\cos 30^\circ,0)$. Finally, I move the pen to the
-origin, but this time drawing something (because of the |--|).''
-
-To appreciate the difference between |+| and |++| consider the
-following example:
+Note that there is no |--| between |(30:1cm)| and |++(0,-0.5)|. In detail, this
+path is interpreted as follows: ``First, the |(30:1cm)| tells me to move by pen
+to $(\cos 30^\circ,1/2)$. Next, there comes another coordinate specification,
+so I move my pen there without drawing anything. This new point is half a unit
+down from the last position, thus it is at $(\cos 30^\circ,0)$. Finally, I move
+the pen to the origin, but this time drawing something (because of the |--|).''
+To appreciate the difference between |+| and |++| consider the following
+example:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\def\rectanglepath{-- ++(1cm,0cm) -- ++(0cm,1cm) -- ++(-1cm,0cm) -- cycle}
@@ -837,7 +805,7 @@ following example:
\end{codeexample}
By comparison, when using a single |+|, the coordinates are different:
-
+%
\begin{codeexample}[]
\begin{tikzpicture}
\def\rectanglepath{-- +(1cm,0cm) -- +(1cm,1cm) -- +(0cm,1cm) -- cycle}
@@ -849,6 +817,7 @@ 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 |+|):
+%
\begin{codeexample}[]
\tikz \draw (0,0) rectangle +(1,1) (1.5,0) rectangle +(1,1);
\end{codeexample}
@@ -856,35 +825,33 @@ economically like this (either with a single of a double |+|):
\subsection{Intersecting Paths}
-Karl is left with the line for $\tan \alpha$, which seems difficult to
-specify using transformations and polar coordinates. The first -- and
-easiest -- thing he can do is so simply use the coordinate
-|(1,{tan(30)})| since \tikzname's math engine knows how to compute
-things like |tan(30)|. Note the added braces since, otherwise,
-\tikzname's parser would think that the first closing parenthesis ends
-the coordinate (in general, you need to add braces around components
-of coordinates when these components contain parentheses).
-
-Karl can, however, also use a more elaborate, but also more
-``geometric'' way of computing the length of the orange line: He can
-specify intersections 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)|. Such
-computations are made available by the |intersections| library.
-
-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.
-
+Karl is left with the line for $\tan \alpha$, which seems difficult to specify
+using transformations and polar coordinates. The first -- and easiest -- thing
+he can do is so simply use the coordinate |(1,{tan(30)})| since \tikzname's
+math engine knows how to compute things like |tan(30)|. Note the added braces
+since, otherwise, \tikzname's parser would think that the first closing
+parenthesis ends the coordinate (in general, you need to add braces around
+components of coordinates when these components contain parentheses).
+
+Karl can, however, also use a more elaborate, but also more ``geometric'' way
+of computing the length of the orange line: He can specify intersections 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)|. Such computations are made available
+by the |intersections| library.
+
+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.
+%
\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
+% (add `\usetikzlibrary{intersections}' after loading tikz in the preamble)
\draw [name intersections={of=upward line and sloped line, by=x}]
[very thick,orange] (1,0) -- (x);
\end{codeexample}
@@ -893,14 +860,14 @@ later reference.
\subsection{Adding Arrow Tips}
Karl now wants to add the little arrow tips at the end of the axes. He has
-noticed that in many plots, even in scientific journals, these arrow tips
-seem to be missing, presumably because the generating programs cannot
-produce them. Karl thinks arrow tips belong at the end of axes. His
-son agrees. His students do not care about arrow tips.
-
-It turns out that adding arrow tips is pretty easy: Karl adds the option
-|->| to the drawing commands for the axes:
+noticed that in many plots, even in scientific journals, these arrow tips seem
+to be missing, presumably because the generating programs cannot produce them.
+Karl thinks arrow tips belong at the end of axes. His son agrees. His students
+do not care about arrow tips.
+It turns out that adding arrow tips is pretty easy: Karl adds the option |->|
+to the drawing commands for the axes:
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
\clip (-0.1,-0.2) rectangle (1.1,1.51);
@@ -920,17 +887,16 @@ It turns out that adding arrow tips is pretty easy: Karl adds the option
\end{tikzpicture}
\end{codeexample}
-If Karl had used the option |<-| instead of |->|, arrow tips would
-have been put at the beginning of the path. The option |<->| puts
-arrow tips at both ends of the path.
-
-There are certain restrictions to the kind of paths to which arrow tips
-can be added. As a rule of thumb, you can add arrow tips only to a
-single open ``line.'' For example, you cannot add tips to,
-say, a rectangle or a circle. However, you can add arrow
-tips to curved paths and to paths that have several segments, as in
-the following examples:
+If Karl had used the option |<-| instead of |->|, arrow tips would have been
+put at the beginning of the path. The option |<->| puts arrow tips at both ends
+of the path.
+There are certain restrictions to the kind of paths to which arrow tips can be
+added. As a rule of thumb, you can add arrow tips only to a single open
+``line''. For example, you cannot add tips to, say, a rectangle or a circle.
+However, you can add arrow tips to curved paths and to paths that have several
+segments, as in the following examples:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw [<->] (0,0) arc [start angle=180, end angle=30, radius=10pt];
@@ -938,57 +904,55 @@ the following examples:
\end{tikzpicture}
\end{codeexample}
-Karl has a more detailed look at the arrow that \tikzname\ puts at the
-end. It looks like this when he zooms it: \tikz[baseline]
-\draw[->,line width=1pt] (0pt,.5ex) -- ++(10pt,0pt);. The shape seems
-vaguely familiar and, indeed, this is exactly the end of \TeX's
-standard arrow used in something like $f\colon A \to B$.
-
-Karl likes the arrow, especially since it is not ``as thick'' as the
-arrows offered by many other packages. However, he expects that,
-sometimes, he might need to use some other kinds of arrow.
-To do so, Karl can say |>=|\meta{kind of end arrow tip}, where
-\meta{kind of end arrow tip} is a special arrow tip specification. For
-example, if Karl says |>=Stealth|, then he tells \tikzname\
+Karl has a more detailed look at the arrow that \tikzname\ puts at the end. It
+looks like this when he zooms it: \tikz[baseline] \draw[->,line width=1pt]
+(0pt,.5ex) -- ++(10pt,0pt);. The shape seems vaguely familiar and, indeed, this
+is exactly the end of \TeX's standard arrow used in something like $f\colon A
+\to B$.
+
+Karl likes the arrow, especially since it is not ``as thick'' as the arrows
+offered by many other packages. However, he expects that, sometimes, he might
+need to use some other kinds of arrow. To do so, Karl can say |>=|\meta{kind of
+end arrow tip}, where \meta{kind of end arrow tip} 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:
-
+\todosp{remaining instance of bug \#473}
+%
\begin{codeexample}[]
\begin{tikzpicture}[>=Stealth]
\draw [->] (0,0) arc [start angle=180, end angle=30, radius=10pt];
\draw [<<-,very thick] (1,0) -- (1.5cm,10pt) -- (2cm,0pt) -- (2.5cm,10pt);
\end{tikzpicture}
-\end{codeexample}%>>
+\end{codeexample}
Karl wonders whether such a military name for the arrow type is really
-necessary. He is not really mollified when his son tells him that
-Microsoft's PowerPoint uses the same name. He decides to have his
-students discuss this at some point.
+necessary. He is not really mollified when his son tells him that Microsoft's
+PowerPoint uses the same name. He decides to have his students discuss this at
+some point.
-In addition to |Stealth| there are several other predefined kinds of
-arrow tips Karl can choose from, see Section~\ref{section-arrows}. Furthermore,
-he can define arrows types himself, if he needs new ones.
+In addition to |Stealth| there are several other predefined kinds of arrow tips
+Karl can choose from, see Section~\ref{section-arrows}. Furthermore, he can
+define arrows types himself, if he needs new ones.
\subsection{Scoping}
-Karl saw already that there are numerous graphic options that affect how
-paths are rendered. Often, he would like to apply certain options to
-a whole set of graphic commands. For example, Karl might wish to draw
-three paths using a |thick| pen, but would like everything else to
-be drawn ``normally.''
-
-If Karl wishes to set a certain graphic option for the whole picture,
-he can simply pass this option to the |\tikz| command or to the
-|{tikzpicture}| environment (Gerda would pass the options to
-|\tikzpicture| and Hans passes them to |\starttikzpicture|). However,
-if Karl wants to apply graphic options to a local group, he put these
-commands inside a |{scope}| environment (Gerda uses |\scope| and
-|\endscope|, Hans uses |\startscope| and |\stopscope|). This
-environment takes graphic options as an optional argument and these
-options apply to everything inside the scope, but not to anything outside.
+Karl saw already that there are numerous graphic options that affect how paths
+are rendered. Often, he would like to apply certain options to a whole set of
+graphic commands. For example, Karl might wish to draw three paths using a
+|thick| pen, but would like everything else to be drawn ``normally''.
-Here is an example:
+If Karl wishes to set a certain graphic option for the whole picture, he can
+simply pass this option to the |\tikz| command or to the |{tikzpicture}|
+environment (Gerda would pass the options to |\tikzpicture| and Hans passes
+them to |\starttikzpicture|). However, if Karl wants to apply graphic options
+to a local group, he put these commands inside a |{scope}| environment (Gerda
+uses |\scope| and |\endscope|, Hans uses |\startscope| and |\stopscope|). This
+environment takes graphic options as an optional argument and these options
+apply to everything inside the scope, but not to anything outside.
+Here is an example:
+%
\begin{codeexample}[]
\begin{tikzpicture}[ultra thick]
\draw (0,0) -- (0,1);
@@ -1000,58 +964,51 @@ Here is an example:
\end{tikzpicture}
\end{codeexample}
-Scoping has another interesting effect: Any changes to the clipping
-area are local to the scope. Thus, if you say |\clip| somewhere inside
-a scope, the effect of the |\clip| command ends at the end of the
-scope. This is useful since there is no other way of ``enlarging'' the
-clipping area.
-
-Karl has also already seen that giving options to commands like
-|\draw| apply only to that command. It turns out that the situation is
-slightly more complex. First, options to a command like |\draw| are
-not really options to the command, but they are ``path options'' and
-can be given anywhere on the path. So, instead of
-|\draw[thin] (0,0) -- (1,0);| one can also write
-|\draw (0,0) [thin] -- (1,0);| or |\draw (0,0) -- (1,0) [thin];|; all
-of these have the same effect. This might seem strange since in the
-last case, it would appear that the |thin| should take effect only
-``after'' the line from $(0,0)$ to $(1,0)$ has been drawn. However,
-most graphic options only apply to the whole path. Indeed, if you say
-both |thin| and |thick| on the same path, the last option given will
-``win.''
-
-When reading the above, Karl notices that only ``most'' graphic
-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.
-
+Scoping has another interesting effect: Any changes to the clipping area are
+local to the scope. Thus, if you say |\clip| somewhere inside a scope, the
+effect of the |\clip| command ends at the end of the scope. This is useful
+since there is no other way of ``enlarging'' the clipping area.
+
+Karl has also already seen that giving options to commands like |\draw| apply
+only to that command. It turns out that the situation is slightly more complex.
+First, options to a command like |\draw| are not really options to the command,
+but they are ``path options'' and can be given anywhere on the path. So,
+instead of |\draw[thin] (0,0) -- (1,0);| one can also write
+|\draw (0,0) [thin] -- (1,0);| or |\draw (0,0) -- (1,0) [thin];|; all of these
+have the same effect. This might seem strange since in the last case, it would
+appear that the |thin| should take effect only ``after'' the line from $(0,0)$
+to $(1,0)$ has been drawn. However, most graphic options only apply to the
+whole path. Indeed, if you say both |thin| and |thick| on the same path, the
+last option given will ``win''.
+
+When reading the above, Karl notices that only ``most'' graphic 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.
\subsection{Transformations}
-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 final position on
-the page.
+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 final position on the page.
-\tikzname\ provides numerous options that allow you to transform
-coordinates in \tikzname's private coordinate system. For example, the
-|xshift| option allows you to shift all subsequent points by a certain
-amount:
+\tikzname\ provides numerous options that allow you to transform coordinates in
+\tikzname's private coordinate system. For example, the |xshift| option allows
+you to shift all subsequent points by a certain amount:
\begin{codeexample}[]
\tikz \draw (0,0) -- (0,0.5) [xshift=2pt] (0,0) -- (0,0.5);
\end{codeexample}
-It is important to note that you can change transformation ``in the
-middle of a path,'' a feature that is not supported by \pdf\
-or PostScript. The reason is that \tikzname\ keeps track of its own
-transformation matrix.
+It is important to note that you can change transformation ``in the middle of a
+path'', a feature that is not supported by \pdf\ or PostScript. The reason is
+that \tikzname\ keeps track of its own transformation matrix.
Here is a more complicated example:
+%
\begin{codeexample}[]
\begin{tikzpicture}[even odd rule,rounded corners=2pt,x=10pt,y=10pt]
\filldraw[fill=yellow!80!black] (0,0) rectangle (1,1)
@@ -1060,48 +1017,45 @@ Here is a more complicated example:
\end{tikzpicture}
\end{codeexample}
-The most useful transformations are |xshift| and |yshift| for
-shifting, |shift| for shifting to a given point as in |shift={(1,0)}|
-or |shift={+(0,0)}| (the braces are necessary so that \TeX\ does not
-mistake the comma for separating options), |rotate| for rotating by a
-certain angle (there is also a |rotate around| for rotating around a
-given point), |scale| for scaling by a certain factor, |xscale| and
-|yscale| for scaling only in the $x$- or $y$-direction (|xscale=-1| is
-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.
-
+The most useful transformations are |xshift| and |yshift| for shifting, |shift|
+for shifting to a given point as in |shift={(1,0)}| or |shift={+(0,0)}| (the
+braces are necessary so that \TeX\ does not mistake the comma for separating
+options), |rotate| for rotating by a certain angle (there is also a
+|rotate around| for rotating around a given point), |scale| for scaling by a
+certain factor, |xscale| and |yscale| for scaling only in the $x$- or
+$y$-direction (|xscale=-1| is 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.
\subsection{Repeating Things: For-Loops}
-Karl's next aim is to add little ticks on the axes at positions $-1$,
-$-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 |\multido| command. All of these can be used together with
-\tikzname, so if you are familiar with them, feel free to
-use them. \tikzname\ introduces yet another command, called |\foreach|,
-which I introduced since I could never remember the syntax of the other
-packages. |\foreach| is defined in the package |pgffor| and can be used
+Karl's next aim is to add little ticks on the axes at positions $-1$, $-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 |\multido| command.
+All of these can be used together with \tikzname, so if you are familiar with
+them, feel free to use them. \tikzname\ introduces yet another command, called
+|\foreach|, which I introduced since I could never remember the syntax of the
+other packages. |\foreach| is defined in the package |pgffor| and can be used
independently \tikzname, but \tikzname\ includes it automatically.
In its basic form, the |\foreach| command is easy to use:
+%
\begin{codeexample}[]
\foreach \x in {1,2,3} {$x =\x$, }
\end{codeexample}
-The general syntax is |\foreach| \meta{variable}| in {|\meta{list of
- values}|} |\meta{commands}. Inside the \meta{commands}, the
-\meta{variable} will be assigned to the different values. If the
-\meta{commands} do not start with a brace, everything up to the
-next semicolon is used as \meta{commands}.
+The general syntax is
+|\foreach| \meta{variable}| in {|\meta{list of values}|} |\meta{commands}.
+Inside the \meta{commands}, the \meta{variable} will be assigned to the
+different values. If the \meta{commands} do not start with a brace, everything
+up to the next semicolon is used as \meta{commands}.
For Karl and the ticks on the axes, he could use the following code:
-
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
\clip (-0.1,-0.2) rectangle (1.1,1.51);
@@ -1119,36 +1073,36 @@ For Karl and the ticks on the axes, he could use the following code:
\end{tikzpicture}
\end{codeexample}
-As a matter of fact, there are many different ways of creating the
-ticks. For example, Karl could have put the |\draw ...;| inside curly
-braces. He could also have used, say,
+As a matter of fact, there are many different ways of creating the ticks. For
+example, Karl could have put the |\draw ...;| inside curly braces. He could
+also have used, say,
+%
\begin{codeexample}[code only]
\foreach \x in {-1,-0.5,1}
\draw[xshift=\x cm] (0pt,-1pt) -- (0pt,1pt);
\end{codeexample}
-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
-a large number of values (which must, however, be dimensionless
-real numbers) as in the following example:
-
+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 a large number of values (which must,
+however, be dimensionless real numbers) as in the following example:
+%
\begin{codeexample}[]
\tikz \foreach \x in {1,...,10}
\draw (\x,0) circle (0.4cm);
\end{codeexample}
-If you provide \emph{two} numbers before the |...|, the |\foreach|
-statement will use their difference for the stepping:
-
+If you provide \emph{two} numbers before the |...|, the |\foreach| statement
+will use their difference for the stepping:
+%
\begin{codeexample}[]
\tikz \foreach \x in {-1,-0.5,...,1}
\draw (\x cm,-1pt) -- (\x cm,1pt);
\end{codeexample}
We can also nest loops to create interesting effects:
-
+%
\begin{codeexample}[]
\begin{tikzpicture}
\foreach \x in {1,2,...,5,7,8,...,12}
@@ -1160,31 +1114,28 @@ We can also nest loops to create interesting effects:
\end{tikzpicture}
\end{codeexample}
-The |\foreach| statement can do even trickier stuff, but the above
-gives the idea.
-
-
+The |\foreach| statement can do even trickier stuff, but the above 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!
-
-\tikzname\ offers an easy-to-use and powerful system for adding text and,
-more generally, complex shapes to a picture at specific positions. The
-basic idea is the following: When \tikzname\ is constructing a path and
-encounters the keyword |node| in the middle of a path, it
-reads a \emph{node specification}. The keyword |node| is typically
-followed by some options and then some text between curly braces. This
-text is put inside a normal \TeX\ box (if the node specification
-directly follows a coordinate, which is usually the case, \tikzname\ is
-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.
-
+Karl is, by now, quite satisfied with the picture. However, the most 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 basic idea is
+the following: When \tikzname\ is constructing a path and encounters the
+keyword |node| in the middle of a path, it reads a \emph{node specification}.
+The keyword |node| is typically followed by some options and then some text
+between curly braces. This text is put inside a normal \TeX\ box (if the node
+specification directly follows a coordinate, which is usually the case,
+\tikzname\ is 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.
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) rectangle (2,2);
@@ -1194,17 +1145,16 @@ path has been completely drawn/filled/shaded/clipped/whatever.
\end{tikzpicture}
\end{codeexample}
-Obviously, Karl would not only like to place nodes \emph{on} the last
-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,
-the |south| anchor is at the bottom and the |north east| anchor is in
-the upper right corner. When you give the option |anchor=north|, the
-text will be placed such that this northern anchor will lie on the
-current position and the text is, thus, below the current
-position. Karl uses this to draw the ticks as follows:
-
+Obviously, Karl would not only like to place nodes \emph{on} the last 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, the |south| anchor is at the bottom and the |north east|
+anchor is in the upper right corner. When you give the option |anchor=north|,
+the text will be placed such that this northern anchor will lie on the current
+position and the text is, thus, below the current position. Karl uses this to
+draw the ticks as follows:
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
\clip (-0.6,-0.2) rectangle (0.6,1.51);
@@ -1221,38 +1171,35 @@ position. Karl uses this to draw the ticks as follows:
\end{tikzpicture}
\end{codeexample}
-This is quite nice, already. Using these anchors, Karl can now add
-most of the other text elements. However, Karl thinks that, though
-``correct,'' it is quite counter-intuitive that in order to place something
-\emph{below} a given point, he has to use the \emph{north} anchor. For
-this reason, there is an option called |below|, which does the
-same as |anchor=north|. Similarly, |above right| does the same as
-|anchor=south west|. In addition, |below| takes an optional
-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.
-
-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
-nice capabilities of \TeX\ and \tikzname, partly because for positions
-like $1/3$ or $\pi$ it is certainly very much preferable to have the
-``mathematical'' tick there instead of just the ``numeric'' tick.
-His students, on the other hand, prefer $0.5$ over $1/2$
-since they are not too fond of fractions in general.
-
-Karl now faces a problem: For the |\foreach| statement, the position
-|\x| should still be given as |0.5| since \tikzname\ will not know where
-|\frac{1}{2}| is supposed to be. On the other hand, the typeset text
-should really be |\frac{1}{2}|. To solve this problem, |\foreach|
-offers a special syntax: Instead of having one variable |\x|, Karl can
-specify two (or even more) variables separated by a slash as in
-|\x / \xtext|. Then, the elements in the set over which |\foreach|
-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:
-
+This is quite nice, already. Using these anchors, Karl can now add most of the
+other text elements. However, Karl thinks that, though ``correct'', it is quite
+counter-intuitive that in order to place something \emph{below} a given point,
+he has to use the \emph{north} anchor. For this reason, there is an option
+called |below|, which does the same as |anchor=north|. Similarly, |above right|
+does the same as |anchor=south west|. In addition, |below| takes an optional
+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.
+
+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 nice capabilities
+of \TeX\ and \tikzname, partly because for positions like $1/3$ or $\pi$ it is
+certainly very much preferable to have the ``mathematical'' tick there instead
+of just the ``numeric'' tick. His students, on the other hand, prefer $0.5$
+over $1/2$ since they are not too fond of fractions in general.
+
+Karl now faces a problem: For the |\foreach| statement, the position |\x|
+should still be given as |0.5| since \tikzname\ will not know where
+|\frac{1}{2}| is supposed to be. On the other hand, the typeset text should
+really be |\frac{1}{2}|. To solve this problem, |\foreach| offers a special
+syntax: Instead of having one variable |\x|, Karl can specify two (or even
+more) variables separated by a slash as in |\x / \xtext|. Then, the elements in
+the set over which |\foreach| 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:
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
\clip (-0.6,-0.2) rectangle (0.6,1.51);
@@ -1269,26 +1216,22 @@ will be used again. So, here is the new code for the ticks:
\end{tikzpicture}
\end{codeexample}
-Karl is quite pleased with the result, but his son points out that
-this is still not perfectly satisfactory: The grid and the circle
-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.
-
-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
-the line.'' To do so, instead of specifying the label
-|node {$\sin\alpha$}| directly after one of the endpoints of the line
-(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
-this. Also, options like |near start| and |near end| can be used to
-modify this position:
-
-
+Karl is quite pleased with the result, but his son points out that this is
+still not perfectly satisfactory: The grid and the circle 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.
+
+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 the line''. To do so,
+instead of specifying the label |node {$\sin\alpha$}| directly after one of
+the endpoints of the line (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 this. Also, options like |near start| and |near end| can be used
+to modify this position:
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
\clip (-2,-0.2) rectangle (2,0.8);
@@ -1319,10 +1262,9 @@ modify this position:
\end{tikzpicture}
\end{codeexample}
-You can also position labels on curves and, by adding the |sloped|
-option, have them rotated such that they match the line's slope. Here
-is an example:
-
+You can also position labels on curves and, by adding the |sloped| option, have
+them rotated such that they match the line's slope. Here is an example:
+%
\begin{codeexample}[]
\begin{tikzpicture}
\draw (0,0) .. controls (6,1) and (9,1) ..
@@ -1332,12 +1274,11 @@ is an example:
\end{tikzpicture}
\end{codeexample}
-It remains to draw the explanatory text at the right of the
-picture. The main difficulty here lies in limiting the width of the
-text ``label,'' which is quite long, so that line breaking is
-used. Fortunately, Karl can use the option |text width=6cm| to get the
-desired effect. So, here is the full code:
-
+It remains to draw the explanatory text at the right of the picture. The main
+difficulty here lies in limiting the width of the text ``label'', which is
+quite long, so that line breaking is used. Fortunately, Karl can use the option
+|text width=6cm| to get the desired effect. So, here is the full code:
+%
\begin{codeexample}[code only]
\begin{tikzpicture}
[scale=3,line cap=round,
@@ -1402,35 +1343,32 @@ desired effect. So, here is the full code:
\end{codeexample}
-
\subsection{Pics: The Angle Revisited}
-Karl expects that the code of certain parts of the picture he created
-might be so useful that he might wish to reuse them in the
-future. A natural thing to do is to create \TeX\ macros that store
-the code he wishes to reuse. However, \tikzname\ offers another way
-that is integrated directly into its parser: pics!
-
-A ``pic'' is ``not quite a full picture,'' hence the short name. The
-idea is that a pic is simply some code that you can add to a picture
-at different places using the |pic| command whose syntax is almost
-identical to the |node| command. The main difference is that instead
-of specifying some text in curly braces that should be shown, you
-specify the name of a predefined picture that should be shown.
-
-Defining new pics is easy enough, see Section~\ref{section-pics}, but
-right now we just want to use one such predefined pic: the |angle|
-pic. As the name suggests, it is a small drawing of an angle
-consisting of a little wedge and an arc together with some text (Karl
-needs to load the |angle| library and the |quotes| for the following
-examples). What makes this pic useful is the fact that the size of the
-wedge will be computed automatically.
-
-The |angle| pic draws an angle between the two lines $BA$ and $BC$,
-where $A$, $B$, and $C$ are three coordinates. In our case, $B$ is the
-origin, $A$ is somewhere on the $x$-axis and $C$ is somewhere on a
-line at $30^\circ$.
-
+Karl expects that the code of certain parts of the picture he created might be
+so useful that he might wish to reuse them in the future. A natural thing to do
+is to create \TeX\ macros that store the code he wishes to reuse. However,
+\tikzname\ offers another way that is integrated directly into its parser:
+pics!
+
+A ``pic'' is ``not quite a full picture'', hence the short name. The idea is
+that a pic is simply some code that you can add to a picture at different
+places using the |pic| command whose syntax is almost identical to the |node|
+command. The main difference is that instead of specifying some text in curly
+braces that should be shown, you specify the name of a predefined picture that
+should be shown.
+
+Defining new pics is easy enough, see Section~\ref{section-pics}, but right now
+we just want to use one such predefined pic: the |angle| pic. As the name
+suggests, it is a small drawing of an angle consisting of a little wedge and an
+arc together with some text (Karl needs to load the |angles| library and the
+|quotes| for the following examples). What makes this pic useful is the fact
+that the size of the wedge will be computed automatically.
+
+The |angle| pic draws an angle between the two lines $BA$ and $BC$, where $A$,
+$B$, and $C$ are three coordinates. In our case, $B$ is the origin, $A$ is
+somewhere on the $x$-axis and $C$ is somewhere on a line at $30^\circ$.
+%
\begin{codeexample}[]
\begin{tikzpicture}[scale=3]
\coordinate (A) at (1,0);
@@ -1440,18 +1378,17 @@ line at $30^\circ$.
\draw (A) -- (B) -- (C)
pic [draw=green!50!black, fill=green!20, angle radius=9mm,
"$\alpha$"] {angle = A--B--C};
-\end{tikzpicture}
+\end{tikzpicture}
\end{codeexample}
Let us see, what is happening here. First we have specified three
-\emph{coordinates} using the |\coordinate| command. It allows us to
-name a specific coordinate in the picture. Then comes something that
-starts as a normal |\draw|, but then comes the |pic| command. This
-command gets lots of options and, in curly braces, comes the most
-important point: We specify that we want to add an |angle| pic and
-this angle should be between the points we named |A|, |B|, and |C| (we
-could use other names). Note that the text that we want to be shown in
-the pic is specified in quotes inside the options of the |pic|, not
-inside the curly braces.
-
-To learn more about pics, please see Section~\ref{section-pics}. \ No newline at end of file
+\emph{coordinates} using the |\coordinate| command. It allows us to name a
+specific coordinate in the picture. Then comes something that starts as a
+normal |\draw|, but then comes the |pic| command. This command gets lots of
+options and, in curly braces, comes the most important point: We specify that
+we want to add an |angle| pic and this angle should be between the points we
+named |A|, |B|, and |C| (we could use other names). Note that the text that we
+want to be shown in the pic is specified in quotes inside the options of the
+|pic|, not inside the curly braces.
+
+To learn more about pics, please see Section~\ref{section-pics}.
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-xxcolor.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-xxcolor.tex
index 603d46945b3..2a114913a68 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-xxcolor.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-xxcolor.tex
@@ -10,32 +10,29 @@
\section{Extended Color Support}
-This section documents the package \texttt{xxcolor}, which is
-currently distributed as part of \pgfname. This package extends the
-\texttt{xcolor} package, written by Uwe Kern, which in turn extends
-the \texttt{color} package. I hope that the commands in
-\texttt{xxcolor} will some day migrate to \texttt{xcolor}, such that
-this package becomes superfluous.
+This section documents the package \texttt{xxcolor}, which is currently
+distributed as part of \pgfname. This package extends the \texttt{xcolor}
+package, written by Uwe Kern, which in turn extends the \texttt{color} package.
+I hope that the commands in \texttt{xxcolor} will some day migrate to
+\texttt{xcolor}, such that this package becomes superfluous.
-The main aim of the \texttt{xxcolor} package is to provide an
-environment inside which all colors are ``washed out'' or ``dimmed.''
-This is useful in numerous situations and must typically be achieved
-in a roundabout manner if such an environment is not available.
+The main aim of the \texttt{xxcolor} package is to provide an environment
+inside which all colors are ``washed out'' or ``dimmed''. This is useful in
+numerous situations and must typically be achieved in a roundabout manner if
+such an environment is not available.
\begin{environment}{{colormixin}\marg{mix-in specification}}
- The mix-in specification is applied to all colors inside
- the environment. At the beginning of the environment, the mix-in is
- applied to the current color, i.\,e., the color that was in effect
- before the environment started. A mix-in specification is a number
- between 0 and 100 followed by an exclamation mark and a color
- name. When a |\color| command is
- encountered inside a mix-in environment, the number states what
- percentage of the desired color should be used. The rest is
- ``filled up'' with the color given in the mix-in
- specification. Thus, a mix-in specification like |90!blue|
- will mix in 10\% of blue into everything, whereas |25!white| will
- make everything nearly white.
-
+ The mix-in specification is applied to all colors inside the environment.
+ At the beginning of the environment, the mix-in is applied to the current
+ color, i.\,e., the color that was in effect before the environment started.
+ A mix-in specification is a number between 0 and 100 followed by an
+ exclamation mark and a color name. When a |\color| command is encountered
+ inside a mix-in environment, the number states what percentage of the
+ desired color should be used. The rest is ``filled up'' with the color
+ given in the mix-in specification. Thus, a mix-in specification like
+ |90!blue| will mix in 10\% of blue into everything, whereas |25!white| will
+ make everything nearly white.
+ %
\begin{codeexample}[width=4cm]
\begin{minipage}{3.5cm}\raggedright
\color{red}Red text,%
@@ -51,26 +48,25 @@ in a roundabout manner if such an environment is not available.
and back to red.
\end{minipage}%
\end{codeexample}
+ %
\end{environment}
-Note that the environment only changes colors that have been installed
-using the standard \LaTeX\ |\color| command. In particular,
-the colors in images are not changed. There is, however, some support
-offered by the commands |\pgfuseimage| and
-|\pgfuseshading|. If the first command is invoked
-inside a |colormixin| environment with the parameter, say,
-|50!black| on an image with the name |foo|, the command
-will first check whether there is also a defined image with the name
-|foo.!50!black|. If so, this image is used instead. This allows
-you to provide a different image for this case. If you nest
-|colormixin| environments, the different mix-ins are all appended. For
-example, inside the inner environment of
-the above example, |\pgfuseimage{foo}| would first check whether
-there exists an image named |foo.!25!white!25!black|.
+Note that the environment only changes colors that have been installed using
+the standard \LaTeX\ |\color| command. In particular, the colors in images are
+not changed. There is, however, some support offered by the commands
+|\pgfuseimage| and |\pgfuseshading|. If the first command is invoked inside a
+|colormixin| environment with the parameter, say, |50!black| on an image with
+the name |foo|, the command will first check whether there is also a defined
+image with the name |foo.!50!black|. If so, this image is used instead. This
+allows you to provide a different image for this case. If you nest |colormixin|
+environments, the different mix-ins are all appended. For example, inside the
+inner environment of the above example, |\pgfuseimage{foo}| would first check
+whether there exists an image named |foo.!25!white!25!black|.
\begin{command}{\colorcurrentmixin}
- Expands to the current accumulated mix-in. Each nesting of a
- |colormixin| adds a mix-in to this list.
+ Expands to the current accumulated mix-in. Each nesting of a |colormixin|
+ adds a mix-in to this list.
+ %
\begin{codeexample}[]
\begin{minipage}{\linewidth-6pt}\raggedright
\begin{colormixin}{75!white}
@@ -84,8 +80,5 @@ there exists an image named |foo.!25!white!25!black|.
\end{colormixin}
\end{minipage}
\end{codeexample}
+ %
\end{command}
-
-
-
-
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 6ac2cd93235..ab87b3b3215 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
@@ -11,11 +11,14 @@ pgfmanual.idx:
pgfmanual.ind: pgfmanual.idx
makeindex $(doc).idx
-pgfmanual.pdf: $(doc).tex $(doc).ind
+pgfmanual.pdf: $(doc).tex $(doc).ind revisionfile
(TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
(egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
dvipdfm -p a4 $(doc)
+revisionfile:
+ cd ../../../../.. && ./scripts/pgf/pgfrevisionfile.sh
+
clean:
rm -f \
plots/* \
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfm/en/pgfmanual.tex b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfm/en/pgfmanual.tex
index f406fcc5e87..fc202c6fef9 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfm/en/pgfmanual.tex
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfm/en/pgfmanual.tex
@@ -10,7 +10,7 @@
\documentclass[a4paper]{ltxdoc}
% pgf version is defined in \pgfversion in file
-% generic/pgf/utilities/pgfrcs.code.tex
+% generic/pgf/utilities/pgfrcs.code.tex
\input{../pgfmanual-dvipdfm.cfg}
\input{../../text-en/pgfmanual-en-main.tex}
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
index aa777e23e39..22bcba0d762 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/Makefile
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/Makefile
@@ -3,20 +3,29 @@ doc = pgfmanual
latex = latex -shell-escape
TEXINPUTS := ../../text-en:$(TEXINPUTS)
-all: $(doc).pdf
+all: $(doc).pdf revisionfile
pgfmanual.idx:
touch pgfmanual.idx
-pgfmanual.ind: pgfmanual.idx
+pgfmanual.ind: pgfmanual.idx revisionfile
makeindex $(doc).idx
-pgfmanual.pdf: $(doc).tex $(doc).ind
+pgfmanual.pdf: $(doc).tex $(doc).ind revisionfile
mkdir -p plots
(TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
(egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
dvipdfmx -p a4 $(doc)
+test: $(doc)-test.tex $(doc).ind revisionfile
+ mkdir -p plots
+ TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc)-test.tex
+ (egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc)-test.tex) || true
+ dvipdfmx -p a4 $(doc)-test
+
+revisionfile:
+ cd ../../../../.. && ./scripts/pgf/pgfrevisionfile.sh
+
clean:
rm -f \
plots/* \
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual-test.tex b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual-test.tex
index c4d74a3e8da..0143e045158 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual-test.tex
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvipdfmx/en/pgfmanual-test.tex
@@ -17,9 +17,6 @@
\begin{document}
-\hypertarget{foo}{Bar}
-\hyperlink{foo}{to bar}
-
-\tikz [transparency group] \node {Smoking};
+\include{pgfmanual-en-tikz-animations}
\end{document}
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
index 987b9fdf9c4..18c793c5ef1 100644
--- 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
@@ -10,7 +10,7 @@
\documentclass[a4paper]{ltxdoc}
% pgf version is defined in \pgfversion in file
-% generic/pgf/utilities/pgfrcs.code.tex
+% 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-dvips/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/Makefile
index 285575a6f4b..88da447a91b 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
@@ -11,12 +11,21 @@ pgfmanual.idx:
pgfmanual.ind: pgfmanual.idx
makeindex $(doc).idx
-pgfmanual.ps: $(doc).tex $(doc).ind
+pgfmanual.ps: $(doc).tex $(doc).ind revisionfile
TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex
(egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
dvips -o $(doc).ps $(doc).dvi
gs -dNOPAUSE -sDEVICE=pdfwrite -dBATCH -dCompatibilityLevel=1.4 -sOutputFile=$(doc).pdf $(doc).ps
+test: $(doc)-test.tex $(doc).ind revisionfile
+ TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc)-test.tex
+ (egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc)-test.tex) || true
+ dvips -o $(doc)-test.ps $(doc)-test.dvi
+ gs -dNOPAUSE -sDEVICE=pdfwrite -dBATCH -dCompatibilityLevel=1.4 -sOutputFile=$(doc)-test.pdf $(doc)-test.ps
+
+revisionfile:
+ cd ../../../../.. && ./scripts/pgf/pgfrevisionfile.sh
+
clean:
rm -f \
plots/* \
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/pgfmanual-test.tex b/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/pgfmanual-test.tex
new file mode 100644
index 00000000000..2cc03e5cd9a
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/pgfmanual-test.tex
@@ -0,0 +1,23 @@
+% 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-dvips.cfg}
+\input{../../text-en/pgfmanual-en-main-preamble.tex}
+
+\begin{document}
+
+\include{pgfmanual-en-tikz-animations}
+
+\end{document}
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/pgfmanual.tex b/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/pgfmanual.tex
index 588c88a2450..10e7f9c75b2 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/pgfmanual.tex
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvips/en/pgfmanual.tex
@@ -11,7 +11,7 @@
% pgf version is defined in \pgfversion in file
-% generic/pgf/utilities/pgfrcs.code.tex
+% generic/pgf/utilities/pgfrcs.code.tex
\input{../pgfmanual-dvips.cfg}
\input{../../text-en/pgfmanual-en-main.tex}
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/Makefile
new file mode 100644
index 00000000000..d598bdc8348
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/Makefile
@@ -0,0 +1,55 @@
+rerun = "(There were undefined references|Rerun to get (cross-references|the bars) right)"
+doc = pgfmanual
+latex = lualatex --output-format=dvi
+TEXINPUTS := ../../text-en:$(TEXINPUTS)
+
+all: $(doc).svg
+
+test: pgfmanual-test.svg
+
+test-no-fonts: pgfmanual-test-no-font.svg
+
+pgfmanual.idx:
+ touch pgfmanual.idx
+
+pgfmanual.ind: pgfmanual.idx
+ makeindex $(doc).idx
+
+pgfmanual.svg: $(doc).tex $(doc).ind revisionfile
+ TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex
+ dvisvgm --no-merge --output=%f-%4p.svg --page=1- --bbox=a4 --linkmark=none $(doc)
+
+pgfmanual-no-font.svg: $(doc).tex $(doc).ind revisionfile
+ TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex
+ dvisvgm --no-fonts --output=%f-%4p.svg --page=1- --bbox=a4 --linkmark=none $(doc)
+
+pgfmanual-test.svg: $(doc)-test.tex $(doc).ind revisionfile
+ TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc)-test.tex
+ dvisvgm --no-merge --output=%f-%4p.svg --page=1- --bbox=a4 --linkmark=none $(doc)-test
+
+pgfmanual-test-merged.svg: $(doc)-test.tex $(doc).ind revisionfile
+ TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc)-test.tex
+ dvisvgm --output=%f-%4p.svg --page=1- --bbox=a4 --linkmark=none $(doc)-test
+
+pgfmanual-test-no-font.svg: $(doc)-test.tex $(doc).ind revisionfile
+ TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc)-test.tex
+ dvisvgm --no-fonts --output=%f-%4p.svg --page=1- --bbox=a4 --linkmark=none $(doc)-test
+
+revisionfile:
+ cd ../../../../.. && ./scripts/pgf/pgfrevisionfile.sh
+
+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-dvisvgm/en/color.cfg b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/color.cfg
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/color.cfg
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual-test.html b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual-test.html
new file mode 100644
index 00000000000..8b35d8f265d
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual-test.html
@@ -0,0 +1,5 @@
+<html>
+<head><title>PGF and TikZ, Manual for Version 3.0.1 - CVS</title></head>
+<body><object width="100%" type="image/svg+xml"
+ data="pgfmanual-test-0001.svg"></object></body>
+</html>
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual-test.tex b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual-test.tex
new file mode 100644
index 00000000000..a36c232025a
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual-test.tex
@@ -0,0 +1,27 @@
+% Copyright 2015 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,dvisvgm]{ltxdoc}
+
+% pgf version is defined in \pgfversion in file
+% generic/pgf/utilities/pgfrcs.code.tex
+
+\input{../pgfmanual-dvisvgm.cfg}
+\input{../../text-en/pgfmanual-en-main-preamble.tex}
+
+\begin{document}
+
+\label{table-of-contents}
+\tableofcontents
+
+\include{pgfmanual-en-tikz-animations}
+\include{pgfmanual-en-base-animations}
+\include{pgfmanual-en-pgfsys-animations}
+
+\end{document}
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual.html b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual.html
new file mode 100644
index 00000000000..6d30d893aca
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html lang="en" dir="ltr">
+<head>
+<meta charset="UTF-8" />
+<title>PGF and TikZ, Manual for Version 3.0.1 - CVS</title>
+<body>
+ <object width="100%" type="image/svg+xml" data="pgfmanual-0001.svg">
+ </object>
+</body>
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual.tex b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/pgfmanual.tex
new file mode 100644
index 00000000000..03aa953fa25
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/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,dvisvgm]{ltxdoc}
+
+% pgf version is defined in \pgfversion in file
+% generic/pgf/utilities/pgfrcs.code.tex
+
+\input{../pgfmanual-dvisvgm.cfg}
+\input{../../text-en/pgfmanual-en-main.tex}
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-asymptotic-example.table b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-asymptotic-example.table
new file mode 100644
index 00000000000..173ab5e9c77
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-asymptotic-example.table
@@ -0,0 +1,204 @@
+#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-dvisvgm/en/plots/pgf-exp.table b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-exp.table
new file mode 100644
index 00000000000..8e728570397
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-exp.table
@@ -0,0 +1,29 @@
+#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-dvisvgm/en/plots/pgf-parametric-example.table b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-parametric-example.table
new file mode 100644
index 00000000000..de0c383ddde
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-parametric-example.table
@@ -0,0 +1,29 @@
+#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-dvisvgm/en/plots/pgf-sin.table b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-sin.table
new file mode 100644
index 00000000000..9ab8f2c8d56
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-sin.table
@@ -0,0 +1,29 @@
+#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-dvisvgm/en/plots/pgf-tan-example.table b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-tan-example.table
new file mode 100644
index 00000000000..63beeda4b7a
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-tan-example.table
@@ -0,0 +1,104 @@
+
+#Curve 0 of 1, 100 points
+#x y type
+-3.14100 0.00059 i
+-3.07755 0.06413 i
+-3.01409 0.12820 i
+-2.95064 0.19331 i
+-2.88718 0.26005 i
+-2.82373 0.32902 i
+-2.76027 0.40094 i
+-2.69682 0.47663 i
+-2.63336 0.55704 i
+-2.56991 0.64335 i
+-2.50645 0.73701 i
+-2.44300 0.83989 i
+-2.37955 0.95436 i
+-2.31609 1.08360 i
+-2.25264 1.23197 i
+-2.18918 1.40553 i
+-2.12573 1.61314 i
+-2.06227 1.86816 i
+-1.99882 2.19188 i
+-1.93536 2.62036 i
+-1.87191 3.22003 o
+-1.80845 4.12820 o
+-1.74500 5.68222 o
+-1.68155 8.99247 o
+-1.61809 21.12830 o
+-1.55464 -61.87594 o
+-1.49118 -12.53398 o
+-1.42773 -6.94188 o
+-1.36427 -4.77302 o
+-1.30082 -3.61357 o
+-1.23736 -2.88713 i
+-1.17391 -2.38590 i
+-1.11045 -2.01664 i
+-1.04700 -1.73126 i
+-0.98355 -1.50245 i
+-0.92009 -1.31351 i
+-0.85664 -1.15368 i
+-0.79318 -1.01569 i
+-0.72973 -0.89443 i
+-0.66627 -0.78621 i
+-0.60282 -0.68828 i
+-0.53936 -0.59856 i
+-0.47591 -0.51542 i
+-0.41245 -0.43755 i
+-0.34900 -0.36390 i
+-0.28555 -0.29357 i
+-0.22209 -0.22582 i
+-0.15864 -0.15998 i
+-0.09518 -0.09547 i
+-0.03173 -0.03174 i
+0.03173 0.03174 i
+0.09518 0.09547 i
+0.15864 0.15998 i
+0.22209 0.22582 i
+0.28555 0.29357 i
+0.34900 0.36390 i
+0.41245 0.43755 i
+0.47591 0.51542 i
+0.53936 0.59856 i
+0.60282 0.68828 i
+0.66627 0.78621 i
+0.72973 0.89443 i
+0.79318 1.01569 i
+0.85664 1.15368 i
+0.92009 1.31351 i
+0.98355 1.50245 i
+1.04700 1.73126 i
+1.11045 2.01664 i
+1.17391 2.38590 i
+1.23736 2.88713 i
+1.30082 3.61357 o
+1.36427 4.77302 o
+1.42773 6.94188 o
+1.49118 12.53398 o
+1.55464 61.87594 o
+1.61809 -21.12830 o
+1.68155 -8.99247 o
+1.74500 -5.68222 o
+1.80845 -4.12820 o
+1.87191 -3.22003 o
+1.93536 -2.62036 i
+1.99882 -2.19188 i
+2.06227 -1.86816 i
+2.12573 -1.61314 i
+2.18918 -1.40553 i
+2.25264 -1.23197 i
+2.31609 -1.08360 i
+2.37955 -0.95436 i
+2.44300 -0.83989 i
+2.50645 -0.73701 i
+2.56991 -0.64335 i
+2.63336 -0.55704 i
+2.69682 -0.47663 i
+2.76027 -0.40094 i
+2.82373 -0.32902 i
+2.88718 -0.26005 i
+2.95064 -0.19331 i
+3.01409 -0.12820 i
+3.07755 -0.06413 i
+3.14100 -0.00059 i
+
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-x.table b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-x.table
new file mode 100644
index 00000000000..329b9fa56b5
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgf-x.table
@@ -0,0 +1,29 @@
+#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-dvisvgm/en/plots/pgfmanual-sine.table b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgfmanual-sine.table
new file mode 100644
index 00000000000..9d5d248a561
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgfmanual-sine.table
@@ -0,0 +1,24 @@
+#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-dvisvgm/en/plots/pgfplotgnuplot-example.table b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgfplotgnuplot-example.table
new file mode 100644
index 00000000000..a4e517898a8
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/en/plots/pgfplotgnuplot-example.table
@@ -0,0 +1,104 @@
+#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-dvisvgm/pgfmanual-dvisvgm.cfg b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/pgfmanual-dvisvgm.cfg
new file mode 100644
index 00000000000..e6e29e1fda5
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-dvisvgm/pgfmanual-dvisvgm.cfg
@@ -0,0 +1,336 @@
+% Copyright 2016 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.
+
+\def\pgfsysdriver{pgfsys-dvisvgm.def}
+
+\usepackage[hypertex]{hyperref}
+\makeatletter
+\expandafter\g@addto@macro\csname ttfamily \endcsname{\ignoreligaturesinfont\font\relax}
+\makeatother
+
+\usepackage{graphicx,xcolor}
+
+\def\graphicsdvisvgmtext{dvisvgm.def}
+
+\expandafter\ifx\csname Gin@driver\endcsname\graphicsdvisvgmtext
+\else
+ \PackageError{manual}{You must use dvisvgm.def as your graphics driver}
+\fi
+
+% Make sure to compile this using lualatex.
+
+
+% Add forward button to each page:
+
+\usepackage{everyshi}
+
+\makeatletter
+\newbox\pgfmanualbuttonbox
+\newcount\pgfmanualcount
+\newdimen\mydim
+
+\EveryShipout{%%
+ \setbox255=\vbox{%
+ \pgfkeys{/pgf/fpu=false}%
+ \@tempdima=\ht255\relax%
+ \unvbox255%
+ \vskip-\@tempdima%
+ \pgfmanualaddforwardbackward%
+ \pgfmanualaddtoc%
+ }%
+}
+
+\def\pgfmanualaddforwardbackward{%
+ % Adds page forward and page backward buttons at the left and right
+ % end of each page
+ \let\protect=\relax%
+ \pgfmanualcount=\c@page%
+ \advance\pgfmanualcount by-1\relax%
+ \ifnum\pgfmanualcount>0\relax%
+ \begin{pgfpicture}{1in}{-1in}{1in}{-1in}
+ \special{dvisvgm:raw <g pointer-events="all" visibility="hidden">}
+ \pgftext[top,left]{\href{\jobname-\pgfmanualpadded{\pgfmanualcount}.svg}{{\color{white}\vrule width 2cm height \paperheight}}}
+ \special{dvisvgm:raw </g>}
+ \end{pgfpicture}%
+ \fi%
+ \advance\pgfmanualcount by2\relax%
+ \begin{pgfpicture}{-\paperwidth+1in}{-1in}{-\paperwidth+1in}{-1in}
+ \special{dvisvgm:raw <g pointer-events="all" visibility="hidden">}
+ \pgftext[top,right]{\href{\jobname-\pgfmanualpadded{\pgfmanualcount}.svg}{\color{white}{\vrule width 2cm height \paperheight}}}
+ \special{dvisvgm:raw </g>}
+ \end{pgfpicture}%
+}
+
+\newbox\chapterbox
+
+\newcount\pgfmanualpartcount
+\newcount\pgfmanualsectioncount
+\newcount\pgfmanualsubsectioncount
+\newcount\pgfmanualsubsubsectioncount
+
+\newcount\pgfmanualtempcount
+
+\newtoks\toctoks
+{% Read toc into \toctoks
+
+ \global\toctoks{
+ \global\pgfmanualpartcount0\relax
+ \global\pgfmanualsectioncount0\relax
+ \global\pgfmanualsubsectioncount0\relax
+ \global\pgfmanualsubsubsectioncount0\relax
+ }
+
+ \def\contentsline#1#2#3#4{%
+ \expandafter\let\expandafter\pgfmanualhandler\csname pgfmanualhandlekind#1\endcsname%
+ \ifx\pgfmanualhandler\relax%
+ \PackageError{manual}{Unknown contents level '#1'}{}%
+ \else%
+ \pgfmanualhandler{#2}{#3}{#4}%%
+ \fi%
+ \ignorespaces%
+ }
+
+ \def\pgfmanualhandlekindpart#1#2#3{%
+ \pgfmanualtempcount#2\relax%
+ \advance\pgfmanualtempcount by-1\relax%
+ \edef\pgfmanualtemponepagebefore{\the\pgfmanualtempcount}%
+ \pgfmanualtempcount\pgfmanualpartcount\relax%
+ \advance\pgfmanualtempcount by-1\relax%
+ \expandafter\xdef\csname pgfmanualpartendpage\the\pgfmanualpartcount\endcsname{\pgfmanualtemponepagebefore}%
+ \global\advance\pgfmanualpartcount by1\relax%
+ \expandafter\gdef\csname pgfmanualpartstartpage\the\pgfmanualpartcount\endcsname{#2}%
+ \expandafter\global\expandafter\toctoks\expandafter{\the\toctoks\pgfmanualtypesetpart{#1}{#2}}%
+ }
+ \def\pgfmanualhandlekindsection#1#2#3{%
+ \pgfmanualtempcount#2\relax%
+ \advance\pgfmanualtempcount by-1\relax%
+ \edef\pgfmanualtemponepagebefore{\the\pgfmanualtempcount}%
+ \pgfmanualtempcount\pgfmanualsectioncount\relax%
+ \advance\pgfmanualtempcount by-1\relax%
+ \expandafter\xdef\csname pgfmanualsectionendpage\the\pgfmanualsectioncount\endcsname{\pgfmanualtemponepagebefore}%
+ \global\advance\pgfmanualsectioncount by1\relax%
+ \expandafter\gdef\csname pgfmanualsectionstartpage\the\pgfmanualsectioncount\endcsname{#2}%
+ \expandafter\global\expandafter\toctoks\expandafter{\the\toctoks\pgfmanualtypesetsection{#1}{#2}}%
+ }
+ \def\pgfmanualhandlekindsubsection#1#2#3{%
+ \pgfmanualtempcount#2\relax%
+ \advance\pgfmanualtempcount by-1\relax%
+ \edef\pgfmanualtemponepagebefore{\the\pgfmanualtempcount}%
+ \pgfmanualtempcount\pgfmanualsubsectioncount\relax%
+ \advance\pgfmanualtempcount by-1\relax%
+ \expandafter\xdef\csname pgfmanualsubsectionendpage\the\pgfmanualsubsectioncount\endcsname{\pgfmanualtemponepagebefore}%
+ \global\advance\pgfmanualsubsectioncount by1\relax%
+ \expandafter\gdef\csname pgfmanualsubsectionstartpage\the\pgfmanualsubsectioncount\endcsname{#2}%
+ \expandafter\global\expandafter\toctoks\expandafter{\the\toctoks\pgfmanualtypesetsubsection{#1}{#2}}%
+ }
+ \def\pgfmanualhandlekindsubsubsection#1#2#3{%
+ \pgfmanualtempcount#2\relax%
+ \advance\pgfmanualtempcount by-1\relax%
+ \edef\pgfmanualtemponepagebefore{\the\pgfmanualtempcount}%
+ \pgfmanualtempcount\pgfmanualsubsubsectioncount\relax%
+ \advance\pgfmanualtempcount by-1\relax%
+ \expandafter\xdef\csname pgfmanualsubsubsectionendpage\the\pgfmanualsubsubsectioncount\endcsname{\pgfmanualtemponepagebefore}%
+ \global\advance\pgfmanualsubsubsectioncount by1\relax%
+ \expandafter\gdef\csname pgfmanualsubsubsectionstartpage\the\pgfmanualsubsubsectioncount\endcsname{#2}%
+ \expandafter\global\expandafter\toctoks\expandafter{\the\toctoks\pgfmanualtypesetsubsubsection{#1}{#2}}%
+ }
+ \def\pgfmanualhandlekindparagraph#1#2#3{%
+ % ignore
+ }
+
+ \input{\jobname.toc}%
+}
+
+{\catcode`\#=11
+\gdef\pgfmanualhashmark{#}
+}
+
+\def\pgfmanualaddifnotempty#1#2{%
+ \ifvoid#1%
+ \else%
+ \setbox#1=\vtop{%
+ \hsize\mydim%
+ \leavevmode{\strut#2}%
+ \unvbox#1%
+ }%
+ \fi%
+}
+
+\definecolor{tocbackground}{rgb}{0.99,0.99,0.97}
+
+\def\pgfmanualpickpage#1#2#3#4#5{%
+ \c@pgf@counta#2\relax%
+ \xdef\pgfmanualtocpage{\the\c@pgf@counta}%
+}
+
+\def\pgfmanualaddtoc{%
+ \begingroup
+ \expandafter\let\expandafter\pgfmanualtemp\csname r@table-of-contents\endcsname%
+ \ifx\pgfmanualtemp\relax%
+ \def\pgfmanualtocpage{1}%
+ \else%
+ \expandafter\pgfmanualpickpage\pgfmanualtemp%
+ \fi%
+ \let\numberline\pgfmanualpagetocnumberline%
+ \mydim\paperwidth\advance\mydim by-3cm%
+ \mydim=\mydim\relax%
+ \footnotesize%
+ \setbox\chapterbox=\box\voidb@x%
+ \pgfmanualpagetoctobox{\chapterbox}{\pgfmanualpagetocline{\pgfmanualtocpage}{\Large\textbf{Contents}\vrule
+ width0pt height7mmdepth2.5mm}{0cm}{tocbackground}}%
+ \the\toctoks%
+ \begin{pgfpicture}{1in-1.5cm}{-1in}{1in-1.5cm}{-1in}
+ \pgftext[top,left]{\vbox{%
+ \nointerlineskip%
+ \parskip0pt%
+ \hsize=\mydim%
+ \leftskip0pt%
+ \rightskip0pt%
+ \parindent0pt%
+ \special{dvisvgm:raw
+ <style type="text/css">
+ \pgfmanualhashmark toc:hover \pgfmanualhashmark content { visibility: visible }
+ </style>
+ <g id="toc" opacity=".97">
+ }%
+ \special{dvisvgm:raw <g pointer-events="all" visibility="hidden">}
+ {\color{white}{\vrule width\mydim height 2cm}}\break%
+ \special{dvisvgm:raw </g> }%
+ \hbox{}\vskip-2.6cm\break\leavevmode%
+ \special{dvisvgm:raw
+ <g id="content" visibility="hidden">
+ }%
+ \box\chapterbox\break%
+ \hbox{}\vskip-2pt\break%
+ {\color{tocbackground}{\vrule width\mydim height 5mm}}\break%
+ \special{dvisvgm:raw </g> }%
+ \special{dvisvgm:raw </g> }
+ }}%
+ \end{pgfpicture}
+ \endgroup
+}
+\def\pgfmanualpadded#1{%
+ \ifnum#1<1000 0\fi%
+ \ifnum#1<100 0\fi%
+ \ifnum#1<10 0\fi%
+ \the#1%
+}
+
+\def\pgfmanualpagetocnumberline#1{}
+\def\pgfmanualpagetoctobox#1#2{%
+ \setbox#1=\vtop{%
+ \unvbox#1%
+ #2}%
+}
+\newdimen\pgfmanualtoclineskip
+\pgfmanualtoclineskip1.5pt
+\def\pgfmanualpagetocline#1#2#3#4{%
+ \pgfmanualtempcount#1%
+ \vskip-1pt%
+ \hbox{\href{\jobname-\pgfmanualpadded{\pgfmanualtempcount}.svg}{%
+ \fboxsep0pt%
+ \colorbox{#4}{\vbox{%
+ \vskip\pgfmanualtoclineskip
+ \hsize\mydim%
+ \leftskip#3%
+ \advance\leftskip by5mm%
+ \rightskip1em plus1fil%
+ \advance\rightskip by5mm%
+ \noindent\strut#2\strut}}}}%
+}
+
+
+\newif\ifpgfmanualbetweentest
+
+\def\pgfmanualifin#1#2#3#4{%
+ \pgfmanualbetweentestfalse
+ \expandafter\let\expandafter\pgfmanualstartnum\csname pgfmanual#1startpage\expandafter\the\csname pgfmanual#1count\endcsname\endcsname%
+ \ifx\pgfmanualstartnum\relax%
+ \def\pgfmanualstartnum{-1}%
+ \fi%
+ \expandafter\let\expandafter\pgfmanualendnum\csname pgfmanual#1endpage\expandafter\the\csname pgfmanual#1count\endcsname\endcsname%
+ \ifx\pgfmanualendnum\relax%
+ \def\pgfmanualendnum{1000000000}%
+ \fi%
+ \ifnum\pgfmanualstartnum>\pgfmanualendnum\relax%
+ \let\pgfmanualendnum\pgfmanualstartnum%
+ \fi%
+ \ifnum\pgfmanualstartnum>#2\relax%
+ \else%
+ \ifnum\pgfmanualendnum<#2\relax%
+ \else%
+ \pgfmanualbetweentesttrue%
+ \fi%
+ \fi%
+ \ifpgfmanualbetweentest%
+ #3%
+ \else
+ #4%
+ \fi%
+}
+
+\def\pgfmanualtypesetpart#1#2{%
+ \pgfmanualcleanuppart#1\relax%
+ \global\advance\pgfmanualpartcount by1\relax%
+ \pgfmanualifin{part}{\c@page}{\global\let\pgfmanualthispart\pgfmanualparttext}{}%
+ \pgfmanualpagetoctobox{\chapterbox}{%
+ \pgfmanualpagetocline{#2}{%
+ \pgfmanualifin{part}{\c@page}{\bfseries\pgfmanualparttext}{\pgfmanualparttext}%
+ }{1.5cm}{tocbackground}}%
+}
+\def\pgfmanualcleanuppart#1\hspace#2#3\relax{%
+ \def\pgfmanualparttext{\llap{\hbox to 1.5cm{Part #1\hss}}#3}%
+}
+
+\def\pgfmanualtypesetsection#1#2{%
+ \global\advance\pgfmanualsectioncount by1\relax%
+ \pgfmanualifin{part}{\c@page}{%
+ \pgfmanualifin{section}{\c@page}{\gdef\pgfmanualthischapter{#1}}{}%
+ \pgfmanualpagetoctobox{\chapterbox}{%
+ \def\numberline##1{\llap{##1\hskip3mm}}%
+ \pgfmanualpagetocline{#2}{%
+ \pgfmanualifin{section}{\c@page}{\bfseries\itshape#1}{\itshape#1}%
+ }{1.5cm}{tocbackground}}%
+ }{}%
+}
+\def\pgfmanualtypesetsubsection#1#2{%
+ \global\advance\pgfmanualsubsectioncount by1\relax%
+ \pgfmanualifin{part}{\c@page}{%
+ \pgfmanualifin{section}{\c@page}{%
+ \pgfmanualpagetoctobox{\chapterbox}{%
+ \pgfmanualextraskip5mm%
+ \pgfmanualpagetocline{#2}{
+ \pgfmanualifin{subsection}{\c@page}{\bfseries}{}#1%
+ }{2cm}{tocbackground}}%
+ }{}%
+ }{}%
+}
+\def\pgfmanualtypesetsubsubsection#1#2{%
+ \global\advance\pgfmanualsubsubsectioncount by1\relax%
+ \pgfmanualifin{part}{\c@page}{%
+ \pgfmanualifin{section}{\c@page}{%
+ \pgfmanualextraskip10mm%
+ \pgfmanualpagetoctobox{\chapterbox}{\pgfmanualpagetocline{#2}{%
+ \pgfmanualifin{subsubsection}{\c@page}{\bfseries}{}\itshape#1%
+ }{2.5cm}{tocbackground}}%
+ }{}%
+ }{}%
+}
+\def\pgfmanualsplitnumberline#1{%
+ \pgfmanualsplitnumberline@#1\relax%
+}
+\def\pgfmanualsplitnumberline@#1.#2\relax{%
+ \llap{#1\rlap{.#2}\hskip3mm\hskip\pgfmanualextraskip}%
+}
+\newdimen\pgfmanualextraskip
+
+\makeatother
+
+
+
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-luatex/en/Makefile b/Master/texmf-dist/doc/generic/pgf/version-for-luatex/en/Makefile
index e06c0a44737..e1d6e9a23d0 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-luatex/en/Makefile
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-luatex/en/Makefile
@@ -5,27 +5,29 @@ TEXINPUTS := ../../text-en:../../images:$(TEXINPUTS)
all: $(doc).pdf
-dist: FORCE
- $(latex) -shell-escape --jobname=pgfmanual '\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
+dist: all
+
pgfmanual.ind: pgfmanual.idx
makeindex $(doc).idx
-pgfmanual.pdf: $(doc).tex $(doc).ind
+pgfmanual.pdf: $(doc).tex $(doc).ind revisionfile
TEXINPUTS="$(TEXINPUTS)" $(latex) -shell-escape '$(linkcode)' $(doc).tex
(egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
@echo "Use 'make dist' to generate auto-xrefs."
-test: $(doc)-test.tex $(doc).ind
+test: $(doc)-test.tex $(doc).ind revisionfile
TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc)-test.tex
(egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc)-test.tex) || true
@echo "Use 'make dist' to generate auto-xrefs."
+
+revisionfile:
+ cd ../../../../.. && ./scripts/pgf/pgfrevisionfile.sh
+
+
FORCE:
clean:
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-luatex/en/pgfmanual-test.tex b/Master/texmf-dist/doc/generic/pgf/version-for-luatex/en/pgfmanual-test.tex
index ca68f3411ed..2535ba15fe4 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-luatex/en/pgfmanual-test.tex
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-luatex/en/pgfmanual-test.tex
@@ -17,41 +17,6 @@
\begin{document}
-
-\begin{codeexample}[graphic=white]
-\tikz \datavisualization [scientific axes=clean]
-[
- visualize as smooth line=Gaussian,
- Gaussian={pin in data={text={$e^{-x^2}$},when=x is 1}}
-]
-data [format=function] {
- var x : interval [-7:7] samples 51;
- func y = exp(-\value x*\value x);
-}
-[
- visualize as scatter,
- legend={south east outside},
- scatter={
- style={mark=*,mark size=1.4pt},
- label in legend={text={
- $\sum_{i=1}^{10} x_i$, where $x_i \sim U(-1,1) $}}}
-]
-data [format=function] {
- var i : interval [0:1] samples 20;
- func y = 0;
- func x = (rand + rand + rand + rand + rand +
- rand + rand + rand + rand + rand);
-};
-\end{codeexample}
-
-\include{pgfmanual-en-dv-introduction}
-\include{pgfmanual-en-dv-main}
-\include{pgfmanual-en-dv-formats}
-\include{pgfmanual-en-dv-axes}
-\include{pgfmanual-en-dv-visualizers}
-\include{pgfmanual-en-dv-stylesheets}
-\include{pgfmanual-en-dv-polar}
-\include{pgfmanual-en-dv-backend}
-
+\include{pgfmanual-en-tikz-animations}
\end{document}
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-luatex/en/pgfmanual.tex b/Master/texmf-dist/doc/generic/pgf/version-for-luatex/en/pgfmanual.tex
index d1c6389a5c7..9c8808cab83 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-luatex/en/pgfmanual.tex
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-luatex/en/pgfmanual.tex
@@ -10,7 +10,20 @@
\documentclass[a4paper]{ltxdoc}
% pgf version is defined in \pgfversion in file
-% generic/pgf/utilities/pgfrcs.code.tex
+% generic/pgf/utilities/pgfrcs.code.tex
\input{../pgfmanual-luatex.cfg}
\input{../../text-en/pgfmanual-en-main.tex}
+
+
+
+% =============================================================================
+% ToDo for Stefan Pinnow
+%
+% - search and replace for
+% - $x$-coordinate --> $x$ coordinate
+% (and similar)
+% - to-path vs. to--path
+%
+% - remove "spurious" spaces when loading libraries
+% (similar to <https://sourceforge.net/p/pgf/bugs/374/>)
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-luatex/pgfmanual-luatex.cfg b/Master/texmf-dist/doc/generic/pgf/version-for-luatex/pgfmanual-luatex.cfg
index 87f7a939757..7b57d3ed418 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-luatex/pgfmanual-luatex.cfg
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-luatex/pgfmanual-luatex.cfg
@@ -10,5 +10,8 @@
\usepackage[hyphens]{url}
\usepackage[pdfborder={0 0 0}]{hyperref}
+\makeatletter
+\expandafter\g@addto@macro\csname ttfamily \endcsname{\ignoreligaturesinfont\font\relax}
+\makeatother
% Just make sure to compile this using lualatex.
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 dabca5ae516..7644b304303 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
@@ -5,7 +5,7 @@ TEXINPUTS := ../../text-en:../../images:$(TEXINPUTS)
all: $(doc).pdf
-dist: FORCE
+dist: FORCE revisionfile
$(latex) --jobname=pgfmanual '\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."
@@ -16,11 +16,14 @@ pgfmanual.idx:
pgfmanual.ind: pgfmanual.idx
makeindex $(doc).idx
-pgfmanual.pdf: $(doc).tex $(doc).ind
+pgfmanual.pdf: $(doc).tex $(doc).ind revisionfile
TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex
(egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
@echo "Use 'make dist' to generate auto-xrefs."
+revisionfile:
+ cd ../../../../.. && ./scripts/pgf/pgfrevisionfile.sh
+
FORCE:
clean:
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/pgfmanual.tex b/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/pgfmanual.tex
index ea1e725b795..e1eb4e99427 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/pgfmanual.tex
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/en/pgfmanual.tex
@@ -10,7 +10,7 @@
\documentclass[a4paper]{ltxdoc}
% pgf version is defined in \pgfversion in file
-% generic/pgf/utilities/pgfrcs.code.tex
+% generic/pgf/utilities/pgfrcs.code.tex
\input{../pgfmanual-pdftex.cfg}
\input{../../text-en/pgfmanual-en-main.tex}
diff --git a/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/pgfmanual-pdftex.cfg b/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/pgfmanual-pdftex.cfg
index 0beedab340c..bea9f8d862f 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/pgfmanual-pdftex.cfg
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-pdftex/pgfmanual-pdftex.cfg
@@ -10,5 +10,8 @@
\usepackage[hyphens]{url}
\usepackage[pdfborder={0 0 0}]{hyperref}
+\makeatletter
+\expandafter\g@addto@macro\csname ttfamily \endcsname{\pdfnoligatures\font\relax}
+\makeatother
% Just make sure to compile this using pdfelatex.
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 aebb669ae2e..432571b8616 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
@@ -9,9 +9,12 @@ pgfmanual.idx:
pgfmanual.ind: pgfmanual.idx
makeindex $(doc).idx
-pgfmanual.html: $(doc).tex $(doc).ind
+pgfmanual.html: $(doc).tex $(doc).ind revisionfile
TEXINPUTS="$(TEXINPUTS)" htlatex $(doc).tex
+revisionfile:
+ cd ../../../../.. && ./scripts/pgf/pgfrevisionfile.sh
+
clean:
rm -f \
plots/* \
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 ca3fce8d28f..1c3bb46633b 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
@@ -11,10 +11,13 @@ pgfmanual.idx:
pgfmanual.ind: pgfmanual.idx
makeindex $(doc).idx
-pgfmanual.ps: $(doc).tex $(doc).ind
+pgfmanual.ps: $(doc).tex $(doc).ind revisionfile
TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex
(egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
+revisionfile:
+ cd ../../../../.. && ./scripts/pgf/pgfrevisionfile.sh
+
clean:
rm -f \
plots/* \
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
index 4b0b147f908..b0043d04578 100644
--- a/Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/Makefile
+++ b/Master/texmf-dist/doc/generic/pgf/version-for-xetex/en/Makefile
@@ -11,11 +11,14 @@ pgfmanual.idx:
pgfmanual.ind: pgfmanual.idx
makeindex $(doc).idx
-pgfmanual.pdf: $(doc).tex $(doc).ind
+pgfmanual.pdf: $(doc).tex $(doc).ind revisionfile
(TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
(egrep -q $(rerun) $(doc).log && TEXINPUTS="$(TEXINPUTS)" $(latex) $(doc).tex) || true
xdvipdfmx -p a4 $(doc)
+revisionfile:
+ cd ../../../../.. && ./scripts/pgf/pgfrevisionfile.sh
+
clean:
rm -f \
plots/* \
diff --git a/Master/texmf-dist/source/generic/pgf/testsuite/mathtest/unittest_luamathparser.tex b/Master/texmf-dist/source/generic/pgf/testsuite/mathtest/unittest_luamathparser.tex
index 62ede4b9647..ee144598943 100644
--- a/Master/texmf-dist/source/generic/pgf/testsuite/mathtest/unittest_luamathparser.tex
+++ b/Master/texmf-dist/source/generic/pgf/testsuite/mathtest/unittest_luamathparser.tex
@@ -2,7 +2,7 @@
\makeatletter
\usepackage{pgf}
-\usepgflibrary{luamath}
+\usepgflibrary{luamath,fpu}
\begin{document}
@@ -38,15 +38,23 @@ X
%\tracingmacros=2 \tracingcommands=2
%
\newif\ifcomparewithtex
+\newif\ifcomparewithfpu
\pgfkeys{
/ut/compare with TeX/.is if=comparewithtex,
/ut/compare with TeX=true,
+ /ut/compare with fpu/.is if=comparewithfpu,
+ /ut/compare with fpu=true,
/ut/.search also={/pgf/luamath},
/pgf/luamath/show error message=true,
/pgf/luamath/enable TeX fallback=false,
}
\newcount\numErrors
+
+% #1: options
+% #2: expression
+% #3: expected result
+% #4: expected 'units declared' (1 or 0)
\def\parsertest{\pgfutil@ifnextchar[\parsertest@{\parsertest@[]}}%
\def\parsertest@[#1]#2#3#4{%
\begingroup
@@ -58,6 +66,7 @@ X
\else
\def\actualunitsdeclared{0}%
\fi
+ %
\ifcomparewithtex
\ifpgfluamathusedTeXfallback
\let\expectedTeX=\actual
@@ -101,6 +110,7 @@ X
%
\if1\success
\ifcomparewithtex
+ % check against PGF's basic layer as reference:
\dimen0=\actual pt %
\dimen1=\expectedTeX pt %
\advance\dimen0 by-\dimen1
@@ -124,6 +134,32 @@ X
\message{WARNING for #2 : matches ALL expectations, but TeX's output does NOT match TeX expected units declared (TeX returns \actualTeXunitsdeclared, expectation = LUA is \actualunitsdeclared)^^J}%
\fi
\fi
+ %
+ \ifcomparewithfpu
+ % check that FPU works as well. This
+ % * tests the FPU
+ % * tests that FPU values can be injected into the LUA backend:
+ \begingroup
+ \pgfkeys{/pgf/fpu,/pgf/fpu/output format=float}%
+ \pgfmathparse{#2}%
+ \xdef\actualfpu{\pgfmathresult}%
+ \ifpgfmathunitsdeclared
+ \xdef\actualfpuunitsdeclared{1}%
+ \else
+ \xdef\actualfpuunitsdeclared{0}%
+ \fi
+ \endgroup
+ %
+ \pgfkeys{/pgf/luamath/output format=fixed}%
+ \pgfluamathparse{abs(\actual - \actualfpu) > 0.004}%
+ \ifdim\pgfmathresult pt=1pt
+ \def\success{0}%
+ \pgfluamathparse{abs(\actual - \actualfpu)}%
+ \message{FAILURE for #2 : matches expectations, but does NOT match output of FPU (error \pgfmathresult). fpu=\actualfpu\space lua=\actual^^J}%
+ \global\advance\numErrors by1
+ \fi
+ \fi
+ %
\fi
%
\message{#2 = \actual\space (pgf=\expectedTeX) \if1\success OK\else FAILURE\fi^^J}%
@@ -207,6 +243,7 @@ end
\parsertest{sin(2*pi r)}{-0.0}{0}
\parsertest{1.5707963267949r + 1.5707963267949r}{180.0}{0}
\parsertest{1 ? 42 : 0}{42.0}{0}
+\parsertest{0 ? 42 : 0}{0.0}{0}
\parsertest{-1 + 1 ? 42 : 0}{0.0}{0}
\parsertest{1 + (1 ? 42 : 0)}{43.0}{0}
\parsertest{1 ? 42 : 0 ? 5 : 6}{5.0}{0}
@@ -243,24 +280,41 @@ end
\parsertest{atan(1)}{45.0}{0}
\parsertest{atan2(-4,3)}{-53.130102}{0}
% \parsertest{bin(1)}{1.0}{0}
-\parsertest{ceil(0.1)}{1.0}{0}
\parsertest{cos(60)}{0.5}{0}
\parsertest{cosec(30)}{2.0}{0}
\parsertest{cosh(0.5)}{1.127626}{0}
\parsertest{cot(15)}{3.732051}{0}
\parsertest{deg(2*pi)}{360.0}{0}
% \parsertest{depth(1)}{1.0}{0}
-\parsertest{div(1,2)}{0.0}{0}
+\parsertest[compare with fpu=false]{div(1,2)}{0.0}{0}
\parsertest{divide(1,2)}{0.5}{0}
\parsertest{e}{2.718282}{0}
\parsertest{equal(1,2)}{0.0}{0}
\parsertest{factorial(3)}{6.0}{0}
\parsertest{false}{0.0}{0}
+\parsertest{floor(0)}{0.0}{0}
\parsertest{floor(0.6)}{0.0}{0}
+\parsertest{floor(1.6)}{1.0}{0}
+\parsertest{floor(1)}{1.0}{0}
+\parsertest{floor(100)}{100.0}{0}
+\parsertest{floor(-100)}{-100.0}{0}
\parsertest{floor(-0.6)}{-1.0}{0}
-\parsertest{frac(1.1)}{0.1}{0}
-\parsertest{frac(-1.1)}{0.1}{0}
-\parsertest{gcd(42,56)}{14.0}{0}
+\parsertest{floor(-1.6)}{-2.0}{0}
+\parsertest{floor(-15000.6)}{-15001.0}{0}
+\parsertest{floor(15000.6)}{15000.0}{0}
+\parsertest{ceil(0)}{0.0}{0}
+\parsertest{ceil(0.6)}{1.0}{0}
+\parsertest{ceil(1.6)}{2.0}{0}
+\parsertest{ceil(-0.6)}{-0.0}{0}
+\parsertest{ceil(-1.6)}{-1.0}{0}
+\parsertest{ceil(1)}{1.0}{0}
+\parsertest{ceil(100)}{100.0}{0}
+\parsertest{ceil(-100)}{-100.0}{0}
+\parsertest{ceil(-15000.6)}{-15000.0}{0}
+\parsertest{ceil(15000.6)}{15001.0}{0}
+\parsertest[compare with fpu=false]{frac(1.1)}{0.1}{0}
+\parsertest[compare with fpu=false]{frac(-1.1)}{0.1}{0}
+\parsertest[compare with fpu=false]{gcd(42,56)}{14.0}{0}
\parsertest{greater(1,0)}{1.0}{0}
% \parsertest{height(1)}{1.0}{0}
% \parsertest{hex(1)}{1.0}{0}
@@ -268,9 +322,9 @@ end
\parsertest{int(1.2)}{1.0}{0}
\parsertest{int(-1.2)}{-1.0}{0}
\parsertest{ifthenelse(1,2,3)}{2.0}{0}
-\parsertest{iseven(2)}{1.0}{0}
+\parsertest[compare with fpu=false]{iseven(2)}{1.0}{0}
\parsertest{isodd(1)}{1.0}{0}
-\parsertest{isprime(3)}{1.0}{0}
+\parsertest[compare with fpu=false]{isprime(3)}{1.0}{0}
\parsertest{less(1,2)}{1.0}{0}
\parsertest{ln(e)}{1.0}{0}
\parsertest{log10(100)}{2.0}{0}
@@ -279,7 +333,7 @@ end
\parsertest{min(1,2)}{1.0}{0}
\parsertest{mod(20,6)}{2.0}{0}
\parsertest{mod(-100,30)}{-10.0}{0}
-\parsertest{Mod(-100,30)}{20.0}{0}
+\parsertest[compare with fpu=false]{Mod(-100,30)}{20.0}{0}
\parsertest{multiply(1,2)}{2.0}{0}
\parsertest{neg(1)}{-1.0}{0}
\parsertest{not(1)}{0.0}{0}
@@ -293,7 +347,7 @@ end
\parsertest{rad(180)}{3.141593}{0}
% done below \parsertest{rand(1)}{1.0}{0}
% done below \parsertest{random(1)}{1.0}{0}
-\parsertest{real(1)}{1.0}{0}
+\parsertest[compare with fpu=false]{real(1)}{1.0}{0}
% done below \parsertest{rnd(1)}{1.0}{0}
\parsertest{round(1.5)}{2.0}{0}
\parsertest{round(1.2)}{1.0}{0}
@@ -313,6 +367,21 @@ end
\parsertest{veclen(12,5)}{13.0}{0}
%\parsertest{width(1)}{1.0}{0}
+\parsertest{0 <0.1 && 4 <0.1}{0.0}{0}
+\parsertest{0 <0.1 || 4 <0.1}{1.0}{0}
+{
+\pgfkeys{/pgf/declare function={
+ xx=4;
+ yy=4;
+}}
+\parsertest{abs(xx-yy)<0.1 ? -42 : 42}{-42.0}{0}
+\parsertest{abs(xx-yy)<0.1 || abs(xx-0.5)<0.1}{1.0}{0}
+\parsertest{0 <0.1 || 4 <0.1}{1.0}{0}
+\parsertest{(abs(xx-yy)<0.1) || (abs(xx-0.5)<0.1)}{1.0}{0}
+\parsertest{abs(xx-yy)<0.1 || abs(xx-0.5)<0.1 ? -42 : 42}{-42.0}{0}
+\parsertest{4 < 2 || 5==5 ? -42 : 42}{-42.0}{0}
+}
+
\parsertest{1pt}{1.0}{1}
\parsertest{1mm}{2.845261}{1}
\parsertest{1cm}{28.452744}{1}
@@ -330,7 +399,7 @@ end
\count1=43
% this is actually UNSUPPORTED by TeX:
-\parsertest[compare with TeX=false]{\count1}{43.0}{0}
+\parsertest[compare with TeX=false,compare with fpu=false]{\count1}{43.0}{0}
%
\newdimen\luamathparse@dimen
\luamathparse@dimen=42pt
@@ -342,7 +411,7 @@ end
\parsertest{1*\luamathparse@count}{42.0}{0}
% this is a BUG in TeX, but works in LUA...:
-\parsertest[compare with TeX=false]{0.5\luamathparse@count}{21.0}{0}
+\parsertest[compare with TeX=false,compare with fpu=false]{0.5\luamathparse@count}{21.0}{0}
%
\setbox0=\hbox{1233}
\parsertest{\wd0}{20.000061}{1}
@@ -373,22 +442,26 @@ end
\begingroup
\pgfmathdeclarefunction{testfct}{0}{\def\pgfmathresult{42.42}}
-\parsertest[parser,compare with TeX=false,show error message=false]{testfct}{}{0}
+\parsertest[parser,compare with TeX=false,compare with fpu=false,show error message=false]{testfct}{}{0}
\parsertest[parser,enable TeX fallback]{testfct}{42.42}{0}
+
+\def\macro{1234}
+\pgfkeys{/pgf/declare function={res(\x)=\x*\macro;}}
+\parsertest[enable TeX fallback=true]{res(1)}{1234.0}{0}
\endgroup
% Check that setseed is communicated to LUA:
\pgfmathsetseed{123}
-\parsertest[compare with TeX=false]{rnd}{0.788318}{0}
-\parsertest[compare with TeX=false]{rnd}{0.203068}{0}
-\parsertest[compare with TeX=false]{rand}{-0.302874}{0}
-\parsertest[compare with TeX=false]{rand}{-0.276781}{0}
-\parsertest[compare with TeX=false]{random}{0.134639}{0}
-\parsertest[compare with TeX=false]{random}{0.375968}{0}
-\parsertest[compare with TeX=false]{random(4)}{2.0}{0}
-\parsertest[compare with TeX=false]{random(4)}{1.0}{0}
-\parsertest[compare with TeX=false]{random(4,10)}{10.0}{0}
-\parsertest[compare with TeX=false]{random(4,10)}{8.0}{0}
+\parsertest[compare with TeX=false,compare with fpu=false]{rnd}{0.788318}{0}
+\parsertest[compare with TeX=false,compare with fpu=false]{rnd}{0.203068}{0}
+\parsertest[compare with TeX=false,compare with fpu=false]{rand}{-0.302874}{0}
+\parsertest[compare with TeX=false,compare with fpu=false]{rand}{-0.276781}{0}
+\parsertest[compare with TeX=false,compare with fpu=false]{random}{0.134639}{0}
+\parsertest[compare with TeX=false,compare with fpu=false]{random}{0.375968}{0}
+\parsertest[compare with TeX=false,compare with fpu=false]{random(4)}{2.0}{0}
+\parsertest[compare with TeX=false,compare with fpu=false]{random(4)}{1.0}{0}
+\parsertest[compare with TeX=false,compare with fpu=false]{random(4,10)}{10.0}{0}
+\parsertest[compare with TeX=false,compare with fpu=false]{random(4,10)}{8.0}{0}
\begingroup
% Check that 'trig format' is property communicated to LUA and
@@ -429,13 +502,52 @@ end
\parsertest{mu2}{42.0}{0}
\endgroup
% should have been clean up:
-\parsertest[show error message=false,compare with TeX=false]{mu2}{}{0}
+\parsertest[show error message=false,compare with TeX=false,compare with fpu=false]{mu2}{}{0}
% ... but this should NOT have been cleaned up!
\parsertest{mu1(5,2)}{25.0}{0}
\endgroup
% should have been clean up:
-\parsertest[show error message=false,compare with TeX=false]{mu1(-5,2)}{}{0}
+\parsertest[show error message=false,compare with TeX=false,compare with fpu=false]{mu1(-5,2)}{}{0}
+
+
+\def\pgfmathifexpressionTest#1{%
+ \pgfmathifexpression{1000>999}{%
+ % ok
+ \message{PASSED for mathifexpression(1000>999) #1: = '\pgfmathresult'^^J}%
+ }{%
+ \message{FAILURE for mathifexpression(1000>999) #1: = '\pgfmathresult'^^J}%
+ \global\advance\numErrors by1
+ }%
+}
+
+\pgfmathifexpressionTest{basicmath}
+
+
+\begingroup
+\pgfkeys{/pgf/fpu}%
+\pgfmathifexpressionTest{fpu}
+\endgroup
+
+\begingroup
+\pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed}%
+\pgfmathifexpressionTest{fpu output fixed}
+\endgroup
+
+\begingroup
+\pgfkeys{/pgf/fpu,/pgf/fpu/output format=sci}%
+\pgfmathifexpressionTest{fpu output sci}
+\endgroup
+
+\begingroup
+\pgfkeys{/pgf/luamath/parser}%
+\pgfmathifexpressionTest{luamath}
+\endgroup
+
+\begingroup
+\pgfkeys{/pgf/luamath/parser,/pgf/luamath/output format=float}%
+\pgfmathifexpressionTest{luamath output float}
+\endgroup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
% NO MORE TEST CASES HERE!
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 8a7ab4a2862..cae780ebfba 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
@@ -7,9 +7,10 @@
%
% 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.7 2010/04/11 07:09:19 ludewich Exp $
+\ProvidesPackageRCS{pgfcore.code.tex}
\newif\ifpgf@draftmode
+\def\pgf@typeout{\immediate\write0}
\input pgfmath.code.tex
@@ -28,8 +29,9 @@
\input pgfcorelayers.code.tex
\input pgfcoretransparency.code.tex
\input pgfcorepatterns.code.tex
+\input pgfcorerdf.code.tex
\pgfutil@ifundefined{pgf@texdist@protect}{%
- \def\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 887e86e00e7..843a8cd23f4 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.43 2015/05/14 14:43:05 cfeuersaenger Exp $
+\ProvidesFileRCS{pgfcorearrows.code.tex}
@@ -19,7 +19,7 @@
%
% This command is used to define a new arrow tip kind. For more
% details on the description of the keys, please see the pgfmanual.
-%
+%
% name = Name of the arrow. If the name contains a dash
% (hyphen), the text before the hyphen is the start name
% and the text behind it the end name.
@@ -36,7 +36,7 @@
% will then be available inside the "code". Values needed
% only for the "... end" keys and the convex hull do not
% need to be saved since these are also executed only
-% once.
+% once.
% drawing code = Code for drawing the arrow. When the cache key is set to
% true, which is the default, the code will be protocolled
% and the resulting code is inserted using \pgflowlevelobj.
@@ -56,10 +56,10 @@
% arrow tip was already installed with the same macro
% names (and caching is true), the cached code is
% used. Note that when you use dimensions here, add \the.
-%
-% Inside the setup code, the following macros are available:
%
-% \pgfarrowsettipend
+% Inside the setup code, the following macros are available:
+%
+% \pgfarrowssettipend
% The code should draw an arrow pointing "right along the x
% axis". The "tip" key specifies how far the arrow goes
% along the x axis, that is, it should be the x coordinate
@@ -69,20 +69,20 @@
% "\pgfarrowresult", which is \let to be equal to
% \pgf@x. A \relax will be added after the code provided
% here, so you can write things like "\pgfarrowresult=1pt".
-% \pgfarrowsetbackend
+% \pgfarrowssetbackend
% The leftmost x-coordinate that is still part of the
% arrow tip (the "back end" of the arrow"). This coordinate
% will be used when multiple arrow tips are
% composed. Defaults to 0pt.
-% \pgfarrowsetlineend
+% \pgfarrowssetlineend
% The x-coordinate where a line should stop inside the arrow
% tip so that it gets "obscured" by the arrow. Defaults to 0pt.
-% \pgfarrowsetvisualtipend
+% \pgfarrowssetvisualtipend
% When the arrow tip is drawn in flex mode, it is rotated
% such that the x-coordinates of "visual tip end" and "visual
-% back end" lie on the path. Defaults to \pgfarrowsettipend.
-% \pgfarrowsetvisualbackend
-% See above. Defaults to \pgfarrowsetbackend
+% back end" lie on the path. Defaults to \pgfarrowssettipend.
+% \pgfarrowssetvisualbackend
+% See above. Defaults to \pgfarrowssetbackend
\def\pgfdeclarearrow#1{%
\let\pgf@decl@arrow@defaults\pgfutil@empty%
@@ -136,10 +136,10 @@
\expandafter\let\csname pgf@ar@do@cache@\pgf@decl@arrow@name@end\endcsname\pgf@decl@arrow@cache%
\else%
\pgferror{Arrow tip '\pgf@decl@arrow@name@end' was already
- defined with key 'means' previously and you cannot change this}%
+ defined with key 'means' previously and you cannot change this}%
\fi%
\else%
- \pgferror{You cannot set both the 'means' and also the 'drawing code'
+ \pgferror{You cannot set both the 'means' and also the 'drawing code'
keys for arrow tip '\pgf@decl@arrow@name@end'}%
\fi%
\fi%
@@ -185,11 +185,11 @@
% Handler for defining arrow tips:
-%
+%
% Description:
-%
+%
% When you write "my name/.tip = arrow spec", this has the same
-% effect as writeing \pgfdeclarearrow{name = my name, means = arrow spec}.
+% effect as writing \pgfdeclarearrow{name = my name, means = arrow spec}.
\pgfkeys{/handlers/.tip/.code=%
\expandafter\expandafter\expandafter\pgf@arrows@unravel\pgfkeyscurrentpath/\pgf@stop%
@@ -201,11 +201,11 @@
% Draw an arrow
-%
+%
% #1 = arrow specification
-%
+%
% Description:
-%
+%
% Draws the arrow in the given specification (and "end"
% specification). The arrow will be drawn such that it touches the
% origin "from the left", that is, the arrow will lie completely in
@@ -223,14 +223,14 @@
% Compute the length of an arrow
-%
+%
% #1 = arrow specification
-%
+%
% Description:
-%
+%
% In \pgf@x, this will return the total length of the arrow given as
% #1, in \pgf@xa it will return the distance from the tip to the line
-% end.
+% end.
\def\pgfarrowtotallength#1{%
{%
@@ -250,10 +250,10 @@
% #1 = An arrow specification
%
% Description:
-%
+%
% An "arrow specification" is a sequence of names of meta arrow tips
% together with options in brackets. In detail:
-%
+%
% In #1, consider the text from the start up to the first bracket. If
% this text is the name of a (meta) arrow tip, we use this arrow tip
% with the provided options. If it is the name of a arrow tip
@@ -261,8 +261,8 @@
% each arrow tip inside the shorthand. If the text is neither or the
% above, the first letter of text is treated as a shorthand without
% options.
-%
-% The special arrow tip "." is used to indicate the end of the line.
+%
+% The special arrow tip "." is used to indicate the end of the line.
%
% \pgfsetarrowsend{stealth[reversed]}
% \pgfsetarrowsend{stealth[length=1pt] . stealth[length=2pt]}
@@ -322,11 +322,11 @@
\fi%
\fi%
\fi%
- \expandafter\pgf@next\pgf@temp[%
+ \expandafter\pgf@next\pgf@temp[%
}
\def\pgf@arrows@empty[#1]{%
- \pgfutil@ifnextchar\pgf@stop\pgf@arrows@parser@done\pgfarrows@parser%
+ \pgfutil@ifnextchar\pgf@stop\pgf@arrows@parser@done\pgfarrows@parser%
}
\def\pgf@arrows@single@char@parser#1{%
@@ -343,13 +343,13 @@
\let\pgf@temp\pgf@untranslated%
\let\pgf@next\pgf@arrows@unknown%
\else%
- \let\pgf@next\pgf@arrows@shorthand@parsed%
+ \let\pgf@next\pgf@arrows@shorthand@parsed%
\fi%
\else%
- \let\pgf@next\pgf@arrows@meta@parsed%
+ \let\pgf@next\pgf@arrows@meta@parsed%
\fi
\fi
- \expandafter\pgf@next\pgf@temp[]%
+ \expandafter\pgf@next\pgf@temp[]%
}
\def\pgf@arrows@unknown#1[]#2[#3]{%
\pgferror{Unknown arrow tip kind '#1#2'}%
@@ -357,12 +357,12 @@
\def\pgf@arrows@meta@parsed#1[#2]{%
% Ok, run the keys #2. This will add commands to \pgf@arrows@options:
- %
+ %
\let\pgf@arrows@options\pgf@arrows@options@initial%
\pgfkeys{/pgf/arrow keys/.cd,#2}%
% Append the arrow and its options to the arrow tip sequence:
\expandafter\pgf@arrows@meta@set\expandafter{\pgf@arrows@options}{#1}{\pgf@arrow@handle}%
- \pgfutil@ifnextchar\pgf@stop\pgf@arrows@parser@done\pgfarrows@parser%
+ \pgfutil@ifnextchar\pgf@stop\pgf@arrows@parser@done\pgfarrows@parser%
}
\def\pgf@arrows@parser@done#1{%
@@ -370,7 +370,7 @@
\def\pgf@arrows@dot@parsed#1[#2]{%
\pgf@arrows@append@to@tips{\pgf@arrow@handle@dot}%
- \pgfutil@ifnextchar\pgf@stop\pgf@arrows@parser@done\pgfarrows@parser%
+ \pgfutil@ifnextchar\pgf@stop\pgf@arrows@parser@done\pgfarrows@parser%
}
\def\pgf@arrows@meta@set#1#2#3{%
@@ -385,7 +385,7 @@
\fi%
\expandafter\expandafter\expandafter\def%
\expandafter\expandafter\expandafter\pgf@arrow@tip@sequence%
- \expandafter\expandafter\expandafter{\expandafter\pgf@tempa\pgf@tempb}%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@tempa\pgf@tempb}%
}
\def\pgf@arrows@shorthand@parsed#1[#2]{%
@@ -398,7 +398,7 @@
\expandafter\expandafter\expandafter\pgf@arrows@meta@set\expandafter\expandafter\expandafter{%
\expandafter\pgf@arrows@options\expandafter}\expandafter{\csname pgf@ar@means@#1\endcsname}{\pgf@arrow@handle@shorthand}%
\fi%
- \pgfutil@ifnextchar\pgf@stop\pgf@arrows@parser@done\pgfarrows@parser%
+ \pgfutil@ifnextchar\pgf@stop\pgf@arrows@parser@done\pgfarrows@parser%
}
@@ -426,7 +426,7 @@
% #1 = An arrow specification
%
% Description:
-%
+%
% This works like \pgfsetarrowsend, only the order of the tips in the
% arrow specification is reversed and the "reversed names" are used.
%
@@ -517,14 +517,14 @@
},
fill/.value required,
open/.style={fill=none},
- .unknown/.code={
+ .unknown/.code={
\expandafter\pgfutil@in@\expandafter!\expandafter{\pgfkeyscurrentname}%
\ifpgfutil@in@%
% this is a color!
\expandafter\pgfarrowsaddtooptions\expandafter{\expandafter\def\expandafter\pgf@arrows@stroke@color\expandafter{\pgfkeyscurrentname}}%
\else%
\pgfutil@doifcolorelse{\pgfkeyscurrentname}
- {%
+ {%
\expandafter\pgfarrowsaddtooptions\expandafter{\expandafter\def\expandafter\pgf@arrows@stroke@color\expandafter{\pgfkeyscurrentname}}%
}
{%
@@ -586,7 +586,7 @@
\pgf@x#1%
\ifdim\pgfinnerlinewidth>0pt%
\pgf@arrows@inner@line@width@dep{#2}{#3}%
- \else%
+ \else%
\advance\pgf@x by#2\pgflinewidth%
\fi%
}
@@ -618,12 +618,12 @@
\def\pgf@arrow@id@count{0}%
% Compute the arrow id of an arrow
-%
+%
% #1 = arrow name
% #2 = options
-%
+%
% Description:
-%
+%
% Returns the an id in \pgf@arrow@id that identifies the instantiation
% of the given arrow. If the arrow was not instantiated, this happens now.
@@ -637,7 +637,7 @@
% 3. Local:
#2\relax%
% 4. Nested:
- \pgf@arrows@nested@options%
+ \pgf@arrows@nested@options%
% 5. Last options:
\pgf@arrows@late@options%
% 6. Scaling:
@@ -658,6 +658,7 @@
\expandafter\global\expandafter\let\csname\pgf@arrow@fullname{#1}\endcsname\pgf@arrow@id@count%
\global\let\pgf@arrow@id\pgf@arrow@id@count%
{%
+ \pgfclearid%
\csname pgf@ar@setup@#1\endcsname%
% Handle reversal
\ifpgfarrowreversed%
@@ -773,12 +774,12 @@
\def\pgfarrowssetvisualbackend#1{\pgf@x#1\edef\pgf@arrows@the@visualbackend{\the\pgf@x}}
-% Internal computatin of the line end (shortening) for an arrow
-%
+% Internal computation of the line end (shortening) for an arrow
+%
% #1 = arrow tip list
-%
+%
% Description:
-%
+%
% \pgf@xa will contain the necessary path shortening for the given
% arrow tip list, \pgf@xb will contain the total length of the arrow
% tip list (sum of the differences between tip end and back end plus
@@ -820,15 +821,52 @@
+\def\pgf@arrow@rigid@arrow#1#2{%
+ {%
+ \pgf@xb=#2%
+ \pgftransformxshift{-\pgf@xb}%
+ \let\pgf@arrow@handle\pgf@arrow@rigid
+ \let\pgf@arrow@handle@dot\relax%
+ #1%
+ }%
+}
+
+
+\def\pgf@arrow@rigid#1#2{%
+ % Prepare:
+ {%
+ \pgfarrows@getid{#1}{#2}%
+ % Do shift:
+ \expandafter\expandafter\expandafter\pgf@arrow@drawer@shift\csname pgf@ar@ends@\pgf@arrow@id\endcsname%
+ % Do slant:
+ \ifdim\pgfarrows@slant pt=0pt%
+ \else%
+ \pgftransformxslant{\pgfarrows@slant}%
+ \fi%
+ % do swap:
+ \ifpgfarrowswap%
+ \pgftransformyscale{-1}%
+ \fi%
+ {%
+ \csname pgf@ar@saves@\pgf@arrow@id\endcsname%
+ \pgf@arrows@rigid@hull%
+ }%
+ \expandafter}%
+ % Transform to next tip:
+ \expandafter\pgftransformxshift\expandafter{\the\pgf@xc}%
+}
+
+
+
% Draw an arrow
-%
+%
% #1 = arrow tip list
% #2 = total length of the arrow (the value of \pgf@xb computed by
% \pgf@arrow@compute@shortening)
-%
+%
% Description:
-%
+%
% Draws an arrow tip list. The coordinate system must have been
% transformed so that the to-be-drawn arrow points right and should
% "end" at the origin.
@@ -850,7 +888,7 @@
\pgfarrows@getid{#1}{#2}%
% Do shift:
\expandafter\expandafter\expandafter\pgf@arrow@drawer@shift\csname pgf@ar@ends@\pgf@arrow@id\endcsname%
- % Do slant:
+ % Do slant:
\ifdim\pgfarrows@slant pt=0pt%
\else%
\pgftransformxslant{\pgfarrows@slant}%
@@ -866,7 +904,7 @@
\pgflowlevelsynccm\csname pgf@ar@cache@\pgf@arrow@id\endcsname%
\endpgfscope%
\pgf@arrows@rigid@hull%
- }%
+ }%
\expandafter}%
% Transform to next tip:
\expandafter\pgftransformxshift\expandafter{\the\pgf@xc}%
@@ -890,7 +928,7 @@
\pgf@arrows@color@setup@restore@std@colors
\pgfsetfillcolor{pgfstrokecolor}%
\fi%
- \else%
+ \else%
\pgf@arrows@color@setup@restore@std@colors
\pgfsetfillcolor{\pgf@arrows@fill@color}%
\fi%
@@ -958,12 +996,13 @@
}
+
% Sets arrows
%
% #1 = An arrow specification of the form
% <start spec>-<end spec>. This will call \pgfsetstartarrow{start
% spec} and \pgfsetendarrow{end spec}.
-%
+%
% Alternatively, it may be of the form [options]. In this case,
% the arrow options are set for the local scope and all arrows in
% the current scope will have these options set.
@@ -986,7 +1025,7 @@
\pgfutil@ifnextchar\pgf@stop{%
\let\pgf@arrows@options\pgf@arrows@options@scope%
\pgfkeys{/pgf/arrow keys/.cd,#1}%
- \let\pgf@arrows@options@scope\pgf@arrows@options%
+ \let\pgf@arrows@options@scope\pgf@arrows@options%
% Ok, setup the options
\pgfutil@gobble%
}{%
@@ -999,10 +1038,9 @@
-
%
% Predefined arrows:
-%
+%
% A dot is used to indicate the end of the line:
@@ -1036,7 +1074,7 @@
-% Compatibility with old arrow system:
+% Compatibility with old arrow system:
\pgfkeys {}
@@ -1054,7 +1092,7 @@
\def\pgfsetarrowoptions#1#2{\expandafter\def\csname pgf@arrow@compat@opt@#1\endcsname{#2}}
\def\pgfgetarrowoptions#1{\csname pgf@arrow@compat@opt@#1\endcsname}
\def\pgfarrowsdeclare#1#2#3#4{%
- \pgfdeclarearrow{ name ={#1}-{#2}, setup code ={#3}, drawing code={#4}, parameters/.expand once={\csname pgf@arrow@compat@opt@#2\endcsname}}
+ \pgfdeclarearrow{ name ={#1}-{#2}, setup code ={#3}, drawing code={#4}, parameters/.expand once={\csname pgf@arrow@compat@opt@#2\endcsname}}%
\expandafter\def\csname pgf@arrow@compat@opt@#2\endcsname{0}}
\def\pgfarrowsleftextend#1{\pgfmathsetlength\pgf@xa{#1}\pgfarrowssetbackend{\pgf@xa}}
\def\pgfarrowsrightextend#1{\pgfmathsetlength\pgf@xb{#1}\pgfarrowssettipend{\pgf@xb}}
@@ -1213,5 +1251,3 @@
\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
index 31fa80f3635..8e150972a97 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.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/pgfcoreexternal.code.tex,v 1.21 2014/07/09 14:01:22 cfeuersaenger Exp $
+\ProvidesFileRCS{pgfcoreexternal.code.tex}
@@ -51,8 +51,8 @@
% 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".
+% the name of a declared 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"
@@ -80,7 +80,7 @@
%
% 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.
+% the graphic called \jobname will be typeset.
%
% Example:
%
@@ -128,7 +128,7 @@
% this context anyway).
%
% This here works well:
- \immediate\write16{Package TikZ externalization: calling \string\geometry{driver=none} during externalization.^^J}%
+ \pgf@typeout{Package TikZ externalization: calling \string\geometry{driver=none} during externalization.^^J}%
\geometry{driver=none}%
}%
}%
@@ -141,7 +141,7 @@
\let\pgfexternal@nofiles@=\relax
\def\relax{\relax}%
%
- % suppress generation of LaTeX .aux, .toc etc files.
+ % 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
@@ -211,7 +211,7 @@
\AtBeginDocument{
- \let\beginpgfgraphicnamed=\pgf@externalbegin% overwrite definition of pgfexternal.tex if necessary
+ \let\beginpgfgraphicnamed=\pgf@externalbegin% overwrite definition of pgfexternal.tex if necessary
\let\endpgfgraphicnamed=\unskip
}
@@ -227,7 +227,7 @@
\else%
\let\pgf@next=\pgf@replacepicturebygraphic%
\fi%
- \pgf@next%
+ \pgf@next%
}
\long\def\pgf@replacepicturebygraphic#1\endpgfgraphicnamed{%
@@ -262,12 +262,12 @@
% Reads the .dpth file which contains meta data of the external
% picture.
-%
+%
% This command handles the following stuff:
% - it defines \pgfexternaldepth . The macro contains the contents of
% a line which does not start with a control sequence (for example a
% line containing '50pt')
-% - it defines \pgfexternaltrimleft and \pgfexternaltrimright
+% - it defines \pgfexternaltrimleft and \pgfexternaltrimright
% - it checks if the .dpth file contains content stored by means of
% \pgfexternalstorecommand. If so, the argument of
% \pgfexternalstorecommand will be restored.
@@ -339,11 +339,11 @@
\toks0={#1}%
% believe it or not, but the
% \def\dpthimport{...}\dpthimport *makes* a
- % difference! In ensures any occuring `##' characters are properly expanded to `#'.
+ % difference! In ensures any occurring `##' characters are properly expanded to `#'.
\immediate\write\@auxout{%
\noexpand\def\noexpand\dpthimport{\the\toks0}\noexpand\dpthimport}%
}%
- \fi
+ \fi
}%
\fi
\else% it is the depth (which is simply a number for backwards compatibility)
@@ -352,7 +352,7 @@
}%
% Stores '#1' (expanded!) into the .dpth file of the currently
-% exported image.
+% exported image.
%
% This command has only an effect if an image is being exported.
%
@@ -369,12 +369,12 @@
% Grab operation: If jobname matches the graphic name, typeset this
-% picture normall.
+% picture normal.
% 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
+ \ifpgfexternal@aux@in@dpth
\begingroup
\pgf@external@init@aux@in@dpth
\let\G@refundefinedtrue=\pgf@external@grab@refundefinedtrue
@@ -394,11 +394,16 @@
\begingroup
\def\n{\pgfexternal@hat\pgfexternal@hat J}%
\pgfexternalstorecommand{%
+ \pgf@external@grab@refundefinedtrue@code
\noexpand\immediate\noexpand\write16{\pgf@external@grab@refundefinedtrue@warning}%
\noexpand\G@refundefinedtrue
}%
\endgroup
}%
+
+% A hook. will be overwritten by \usetikzlibrary{external}
+\def\pgf@external@grab@refundefinedtrue@code{}
+
\def\pgf@external@grab@refundefinedtrue@warning{%
LaTeX Warning: External picture `\pgfactualjobname' contains undefined references\noexpand\on@line.\n
}%
@@ -456,7 +461,7 @@
\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
+ % 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
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 a0a7ac9651e..7b11d45d630 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.12 2014/11/02 21:38:01 cfeuersaenger Exp $
+\ProvidesFileRCS{pgfcoregraphicstate.code.tex}
% Globals
@@ -77,6 +77,7 @@
% \pgfsetmiterlimit{3}
\def\pgfsetmiterlimit#1{%
+ \ifdim#1pt<1pt\pgferror{miter limit cannot be less than 1}\fi%
\pgfsys@setmiterlimit{#1}%
\ignorespaces}
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 1f2d6ea5d17..710ece1fa80 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.18 2013/07/15 15:41:24 tantau Exp $
+\ProvidesFileRCS{pgfcoreimage.code.tex}
@@ -22,7 +22,7 @@
%
% This command declares an image file for later use. Even if the image
% is used several times in the document, in PDF it will only be stored
-% once.
+% once.
%
% Example:
%
@@ -41,7 +41,7 @@
\ifx\pgf@filename\pgfutil@empty%
\expandafter\pgf@findfile\pgfsys@imagesuffixlist:+{#3}%
\else%
- \pgfkeys{/pgf/images/page=}% make page empty
+ \pgfkeys{/pgf/images/page=}% make page empty
\fi%
\ifx\pgf@filename\pgfutil@empty%
\pgfwarning%
@@ -60,8 +60,8 @@
\pgfkeys{
- /pgf/images/draft/.is if=pgf@draftmode,
- /pgf/images/draft/.default=true}
+ /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}
@@ -99,7 +99,7 @@
\ifx\pgf@imageheight\pgfutil@empty%
\pgfwarning{Missing height for image "#1" ("#2") in draft mode. Using 1cm instead}%
\edef\pgf@imageheight{1cm}%
- \fi%
+ \fi%
\ifx\pgf@imagepage\pgfutil@empty\else\edef\pgf@imagepagetext{ page \pgf@imagepage}\fi%
\edef\pgf@image{%
\hbox to \pgf@imagewidth{%
@@ -117,7 +117,7 @@
% Declare a soft mask
%
% #1 = optional argument: matte specification. default matte is
-% white.
+% white.
% #2 = name of the mask for later use
% #3 = filename without extension, automatic extensions are .pdf,
% .jpg, and .png for PDF. Postscript is not supported.
@@ -171,7 +171,7 @@
\expandafter\global\expandafter\let\csname pgf@image@#1!\endcsname=\pgf@temp%
}
-
+
% Use an image
%
% #1 = name of a previously declared image
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 880b41c4a30..1c7c01d1eac 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.7 2013/07/18 17:07:38 tantau Exp $
+\ProvidesFileRCS{pgfcorelayers.code.tex}
% Creates a new pgf layer
@@ -44,7 +44,24 @@
%
% \pgfsetlayers{background,main}
-\def\pgfsetlayers#1{\edef\pgf@layerlist{#1}}
+\def\pgfsetlayers#1{%
+ \let\pgf@layerlist\pgfutil@empty%
+ \pgf@dosetlayer#1,,\relax%
+}
+
+\def\pgf@dosetlayer#1,#2,\relax{%
+ \ifx\pgf@layerlist\pgfutil@empty%
+ \edef\pgf@layerlist{\pgfutil@trimspaces{#1}}%
+ \else
+ \edef\pgf@layerlist{\pgf@layerlist,\pgfutil@trimspaces{#1}}%
+ \fi
+ \def\pgf@test{#2}%
+ \ifx\pgf@test\pgfutil@empty%
+ \else%
+ \pgf@dosetlayer#2,\relax%
+ \fi%
+}
+
\pgfsetlayers{main}
% Adds code to a layer
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex
index 557558d82ef..1cbdfa0dd22 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.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/pgfcoreobjects.code.tex,v 1.2 2006/10/11 15:22:25 tantau Exp $
+\ProvidesFileRCS{pgfcoreobjects.code.tex}
% Object reuse
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 60cede3f006..c5b9ee1e99a 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.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/pgfcorepathconstruct.code.tex,v 1.29 2013/10/07 15:51:46 tantau Exp $
+\ProvidesFileRCS{pgfcorepathconstruct.code.tex}
\newdimen\pgf@path@lastx
@@ -22,9 +22,9 @@
%
% #1 = in-size of arc
% #2 = out-size of arc
-%
+%
% Description:
-%
+%
% This command influences path construction command like
% \pgfpathlineto or \pgfpatharc. It will cause the corners at the end
% of these commands to be replaced by little arcs. If the
@@ -33,9 +33,9 @@
% the quarter circle will instead by a quarter ellipse. If the angle
% is different from 90 degrees, a deformed quarter circle will
% result, which may or may not be desirable. For a ``perfect'' arc you
-% must use the \pgfpatharc command.
-%
-%
+% must use the \pgfpatharc command.
+%
+%
% Example: One rounded corner.
%
% \pgfpathmoveto{\pgfpointxy{0}{0}}
@@ -80,7 +80,7 @@
% The following protocol the passed sizes and all the corresponding
% softpath commands. The nonlinear transformation (nlt) module
-% overwrites these commands.
+% overwrites these commands.
\def\pgf@lt@moveto#1#2{%
\pgf@protocolsizes{#1}{#2}%
@@ -110,7 +110,7 @@
% Move current point to #1.
%
% #1 = new current point
-%
+%
% Example:
%
% \pgfpathmoveto{\pgfxy(0,0)}
@@ -169,7 +169,7 @@
% Append a line from the current point to #1 to the current path.
%
% #1 = end of line
-%
+%
% Example:
%
% \pgfpathmoveto{\pgfxy(0,0)}
@@ -213,7 +213,7 @@
% #1 = first control point
% #2 = second control point
% #3 = end point
-%
+%
% Example:
%
% \pgfpathmoveto{\pgfpointxy{0}{0}}
@@ -241,7 +241,7 @@
%
% #1 = control point
% #2 = end point
-%
+%
% Example:
%
% \pgfpathmoveto{\pgfpointxy{0}{0}}
@@ -279,7 +279,7 @@
% #1 = angle of first point
% #2 = angle of second point
% #3 = radius or x-radius/y-radius
-%
+%
% Example:
%
% \pgfpathmoveto{\pgfxy(0,0)}
@@ -347,7 +347,7 @@
\pgfutil@tempdima=\pgf@arc@radius@a pt%
\pgfutil@tempdimb=\pgf@arc@radius@b pt%
%
- \pgf@xa=\pgf@arc@local@angle@a\relax%
+ \pgf@xa=\pgf@arc@local@angle@a\relax%
\pgf@xb=\pgf@arc@local@angle@b\relax%
\advance\pgf@xb by-\pgf@xa\relax%
\ifdim\pgf@xb<0pt\relax%
@@ -368,7 +368,7 @@
\else%
\advance\pgf@xa by -90pt\relax%
\fi%
- \edef\pgf@arc@angle{\pgf@sys@tonumber{\pgf@xa}}%
+ \edef\pgf@arc@angle{\pgf@sys@tonumber{\pgf@xa}}%
\pgfpointtransformed{\pgfpointpolar{\pgf@arc@angle}{\pgfutil@tempdima and \pgfutil@tempdimb}}%
\advance\pgf@x by-\pgf@pt@x%
\advance\pgf@y by-\pgf@pt@y%
@@ -412,7 +412,7 @@
% #2 = angle of second point
% #3 = first axis
% #4 = second axis
-%
+%
% Example:
%
% \pgfpathmoveto{\pgfxy(0,0)}
@@ -428,7 +428,7 @@
-% Append an arc to the current point that ends at a given position.
+% Append an arc to the current point that ends at a given position.
%
% #1 = x-radius
% #2 = y-radius
@@ -442,18 +442,18 @@
% 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.
+% 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}}
@@ -461,10 +461,10 @@
{%
% 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
@@ -487,11 +487,11 @@
\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}
@@ -504,15 +504,15 @@
%
% 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{
@@ -524,8 +524,8 @@
}
\edef\pgf@arcto@xaprime{\pgf@sys@tonumber\pgf@x}
\edef\pgf@arcto@yaprime{\pgf@sys@tonumber\pgf@y}
- %
- % Compute Lambda
+ %
+ % Compute Lambda
%
\pgfmathsetmacro\pgf@arcto@frac@x{\pgf@arcto@xaprime/\pgf@arcto@rx}
\pgfmathsetmacro\pgf@arcto@frac@y{\pgf@arcto@yaprime/\pgf@arcto@ry}
@@ -537,9 +537,9 @@
\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
- %
+ %
+ % 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}
@@ -548,9 +548,9 @@
\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'.
- %
+ %
+ % 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}
@@ -595,9 +595,9 @@
\pgfmathsetmacro\pgf@arcto@cyprime{
-\pgf@arcto@factor*\pgf@arcto@ry@over@rx*\pgf@arcto@xaprime
}
- %
- % Step 6: Ok, now compute cx,cy
- %
+ %
+ % Step 6: Ok, now compute cx,cy
+ %
\pgftransformreset
\pgftransformrotate{\pgf@arcto@phi}
\pgf@process{
@@ -613,9 +613,9 @@
}
\edef\pgf@arcto@cx{\the\pgf@x}
\edef\pgf@arcto@cy{\the\pgf@y}
- %
- % Step 7: Compute start angle:
- %
+ %
+ % 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)}
@@ -624,9 +624,9 @@
\ifdim\pgf@arcto@vec@y pt<0pt
\pgfmathsetmacro\pgf@arcto@theta@start{-\pgf@arcto@theta@start}
\fi
- %
- % Step 8: Compute end angle:
- %
+ %
+ % 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)}
@@ -695,190 +695,190 @@
% #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
+% \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}
+% {\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}%
- %
+ \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}%
+ %
+ %
+ \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.
+ %
+ \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
+ \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
+ \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
}
@@ -894,7 +894,7 @@
% #1 = center
% #2 = first axis
% #3 = second axis
-%
+%
% Example:
%
% % Add a circle of radius 3cm around the origin
@@ -980,7 +980,7 @@
\advance\pgf@x by\pgf@xc%
\advance\pgf@y by\pgf@yc%
\advance\pgf@xb by\pgf@xc%
- \advance\pgf@yb by\pgf@yc%
+ \advance\pgf@yb by\pgf@yc%
\pgf@temp%
\pgf@nlt@curveto{\pgf@xc}{\pgf@yc}{\pgf@x}{\pgf@y}{\pgf@xb}{\pgf@yb}%
}%
@@ -1001,7 +1001,7 @@
\advance\pgf@x by\pgf@xc%
\advance\pgf@y by\pgf@yc%
\advance\pgf@xa by\pgf@xc%
- \advance\pgf@ya by\pgf@yc%
+ \advance\pgf@ya by\pgf@yc%
\pgf@temp%
\pgf@nlt@curveto{\pgf@xc}{\pgf@yc}{\pgf@x}{\pgf@y}{\pgf@xa}{\pgf@ya}%
}%
@@ -1015,10 +1015,10 @@
%
% #1 = center
% #2 = radius
-%
+%
% Example:
%
-% % Append a circle of radius 3cm around the the point (1,1)
+% % Append a circle of radius 3cm around the point (1,1)
% \pgfpathcircle{\pgxy(1,1)}{3cm}
\def\pgfpathcircle#1#2{\pgfpathellipse{#1}{\pgfpoint{#2}{0pt}}{\pgfpoint{0pt}{#2}}}
@@ -1030,7 +1030,7 @@
%
% #1 = lower left corner point of rectangle
% #2 = width and height vector
-%
+%
% Example:
%
% % A rectangle with corners (2,2) and (3,3)
@@ -1082,7 +1082,7 @@
%
% #1 = one corner of the rectangle
% #2 = opposite corner of the rectangle
-%
+%
% Example:
%
% % A rectangle with corners (2,2) and (3,3)
@@ -1103,13 +1103,13 @@
%
% #1 = first corner point of grid
% #2 = second corner point of grid
-%
-% Options:
-%
+%
+% Options:
+%
% stepx = x-step dimension (default 1cm)
% stepy = y-step dimension (default 1cm)
-% step = dimesion vector
-%
+% step = dimension vector
+%
% Example:
%
% \pgfsetlinewidth{0.8pt}
@@ -1146,75 +1146,82 @@
\pgf@yb=\pgf@ya%
\pgf@ya=\pgf@y%
\fi%
- \c@pgf@counta=\pgf@ya\relax%
- \c@pgf@countb=\pgf@yc\relax%
- \divide\c@pgf@counta by\c@pgf@countb\relax%
- \pgfutil@tempdima=\c@pgf@counta\pgf@yc\relax%
- \ifdim\pgfutil@tempdima<\pgf@ya%
+ \ifdim \pgf@yc > .01pt\relax% if to draw horizontal lines
+ \c@pgf@counta=\pgf@ya\relax%
+ \c@pgf@countb=\pgf@yc\relax%
+ \divide\c@pgf@counta by\c@pgf@countb\relax%
+ \pgfutil@tempdima=\c@pgf@counta\pgf@yc\relax%
+ \ifdim\pgfutil@tempdima<\pgf@ya%
+ \advance\pgfutil@tempdima by\pgf@yc%
+ \fi%
+ \pgfutil@tempdimb\pgf@x
+ \pgfutil@loop% horizontal lines
+ {%
+ \pgf@xa=\pgfutil@tempdimb%
+ \pgf@ya=\pgfutil@tempdima%
+ \pgf@pos@transform{\pgf@xa}{\pgf@ya}
+ \pgf@nlt@moveto{\pgf@xa}{\pgf@ya}%
+ \pgf@xa=\pgf@xb%
+ \pgf@ya=\pgfutil@tempdima%
+ \pgf@pos@transform{\pgf@xa}{\pgf@ya}
+ \pgf@nlt@lineto{\pgf@xa}{\pgf@ya}%
+ }%
\advance\pgfutil@tempdima by\pgf@yc%
+ \ifdim\pgfutil@tempdima<\pgf@yb%
+ \pgfutil@repeat%
+ \advance\pgfutil@tempdima by-0.01pt\relax%
+ \ifdim\pgfutil@tempdima<\pgf@yb%
+ {%
+ \pgf@xa=\pgfutil@tempdimb%
+ \pgf@ya=\pgfutil@tempdima%
+ \pgf@pos@transform{\pgf@xa}{\pgf@ya}
+ \pgf@nlt@moveto{\pgf@xa}{\pgf@ya}%
+ \pgf@xa=\pgf@xb%
+ \pgf@ya=\pgfutil@tempdima%
+ \pgf@pos@transform{\pgf@xa}{\pgf@ya}
+ \pgf@nlt@lineto{\pgf@xa}{\pgf@ya}%
+ }%
+ \fi%
\fi%
- \pgfutil@tempdimb\pgf@x
- \pgfutil@loop% horizontal lines
- {%
- \pgf@xa=\pgfutil@tempdimb%
- \pgf@ya=\pgfutil@tempdima%
- \pgf@pos@transform{\pgf@xa}{\pgf@ya}
- \pgf@nlt@moveto{\pgf@xa}{\pgf@ya}%
- \pgf@xa=\pgf@xb%
- \pgf@ya=\pgfutil@tempdima%
- \pgf@pos@transform{\pgf@xa}{\pgf@ya}
- \pgf@nlt@lineto{\pgf@xa}{\pgf@ya}%
- }%
- \advance\pgfutil@tempdima by\pgf@yc%
- \ifdim\pgfutil@tempdima<\pgf@yb%
- \pgfutil@repeat%
- \advance\pgfutil@tempdima by-0.01pt\relax%
- \ifdim\pgfutil@tempdima<\pgf@yb%
- {%
- \pgf@xa=\pgfutil@tempdimb%
- \pgf@ya=\pgfutil@tempdima%
- \pgf@pos@transform{\pgf@xa}{\pgf@ya}
- \pgf@nlt@moveto{\pgf@xa}{\pgf@ya}%
- \pgf@xa=\pgf@xb%
- \pgf@ya=\pgfutil@tempdima%
- \pgf@pos@transform{\pgf@xa}{\pgf@ya}
- \pgf@nlt@lineto{\pgf@xa}{\pgf@ya}%
- }%
- \fi%
- \c@pgf@counta=\pgfutil@tempdimb\relax%
- \c@pgf@countb=\pgf@xc\relax%
- \divide\c@pgf@counta by\c@pgf@countb\relax%
- \pgfutil@tempdimb=\c@pgf@counta\pgf@xc\relax%
- \ifdim\pgfutil@tempdimb<\pgf@xa%
- \advance\pgfutil@tempdimb by\pgf@xc%
- \fi%
- \pgfutil@loop% vertical lines
- {%
- \pgf@xc=\pgfutil@tempdimb%
- \pgf@yc=\pgf@ya%
- \pgf@pos@transform{\pgf@xc}{\pgf@yc}
- \pgf@nlt@moveto{\pgf@xc}{\pgf@yc}%
- \pgf@xc=\pgfutil@tempdimb%
- \pgf@yc=\pgf@yb%
- \pgf@pos@transform{\pgf@xc}{\pgf@yc}
- \pgf@nlt@lineto{\pgf@xc}{\pgf@yc}%
- }%
- \advance\pgfutil@tempdimb by\pgf@xc%
- \ifdim\pgfutil@tempdimb<\pgf@xb%
- \pgfutil@repeat%
- \advance\pgfutil@tempdimb by-0.01pt\relax%
- \ifdim\pgfutil@tempdimb<\pgf@xb%
- {%
- \pgf@xc=\pgfutil@tempdimb%
- \pgf@yc=\pgf@ya%
- \pgf@pos@transform{\pgf@xc}{\pgf@yc}
- \pgf@nlt@moveto{\pgf@xc}{\pgf@yc}%
- \pgf@xc=\pgfutil@tempdimb%
- \pgf@yc=\pgf@yb%
- \pgf@pos@transform{\pgf@xc}{\pgf@yc}
- \pgf@nlt@lineto{\pgf@xc}{\pgf@yc}%
- }%
+ \ifdim \pgf@xc > .01pt\relax% if to draw vertical lines
+ \c@pgf@counta=\pgf@xa\relax%
+ \c@pgf@countb=\pgf@xc\relax%
+ \divide\c@pgf@counta by\c@pgf@countb\relax%
+ \pgfutil@tempdimb=\c@pgf@counta\pgf@xc\relax%
+ \ifdim\pgfutil@tempdimb<\pgf@xa%
+ \advance\pgfutil@tempdimb by\pgf@xc%
+ \fi%
+ \pgfutil@loop% vertical lines
+ {%
+ \pgf@xc=\pgfutil@tempdimb%
+ \pgf@yc=\pgf@ya%
+ \pgf@pos@transform{\pgf@xc}{\pgf@yc}
+ \pgf@nlt@moveto{\pgf@xc}{\pgf@yc}%
+ \pgf@xc=\pgfutil@tempdimb%
+ \pgf@yc=\pgf@yb%
+ \pgf@pos@transform{\pgf@xc}{\pgf@yc}
+ \pgf@nlt@lineto{\pgf@xc}{\pgf@yc}%
+ }%
+ \advance\pgfutil@tempdimb by\pgf@xc%
+ \ifdim\pgfutil@tempdimb<\pgf@xb%
+ \pgfutil@repeat%
+ \advance\pgfutil@tempdimb by-0.01pt\relax%
+ \ifdim\pgfutil@tempdimb<\pgf@xb%
+ {%
+ \pgf@xc=\pgfutil@tempdimb%
+ \pgf@yc=\pgf@ya%
+ \pgf@pos@transform{\pgf@xc}{\pgf@yc}
+ \pgf@nlt@moveto{\pgf@xc}{\pgf@yc}%
+ \pgf@xc=\pgfutil@tempdimb%
+ \pgf@yc=\pgf@yb%
+ \pgf@pos@transform{\pgf@xc}{\pgf@yc}
+ \pgf@nlt@lineto{\pgf@xc}{\pgf@yc}%
+ }%
+ \fi%
\fi%
+ \pgf@process{#3}%
+ \pgf@pos@transform{\pgf@x}{\pgf@y}%
+ \pgf@nlt@moveto{\pgf@x}{\pgf@y}%
}
@@ -1223,20 +1230,20 @@
%
% #1 = bend (relative to current point)
% #2 = end point (relative to bend point)
-%
+%
% Description:
-%
+%
% This command appends a half-parabola that starts at the current point
% and has its bend at #1+current point. Then, a second parabola is
% appended that starts at #1+current point, where it also has its
% minimum/maximum, and ends at #1+current point+#2, which becomes the
-% new current point.
-%
+% new current point.
+%
% By setting #2 = (0,0) you draw only a half parabola that goes from the
% current point to the bend; by setting #1 = (0,0)
% you draw a half parabola that going to current point + #2 and has its
-% bend at the current point.
-%
+% bend at the current point.
+%
% Examples:
%
% % Half-parabola going ``up and right''
@@ -1264,7 +1271,7 @@
\ifdim\pgf@yb=0pt\relax%
\pgfutil@tempswafalse%
\fi%
- \fi%
+ \fi%
{%
\ifpgfutil@tempswa%
\pgf@arccornersfalse
@@ -1276,7 +1283,7 @@
\pgfutil@tempswafalse%
\fi%
\fi%
- \ifpgfutil@tempswa
+ \ifpgfutil@tempswa
{%
\pgf@pt@x=\pgf@path@lastx%
\pgf@pt@y=\pgf@path@lasty%
@@ -1299,8 +1306,8 @@
{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
}%
\fi%
- }%
-}
+ }%
+}
@@ -1308,12 +1315,12 @@
% Append a sine curve between 0 and \pi/2 to the path.
%
% #1 = vector, describing the width and height of the curve
-%
+%
% Description:
-%
+%
% This command appends a sine curve in the interval 0 and \pi/2 to the
% current path. The sine curve ends at currentpoint+#1.
-%
+%
% Examples:
%
% % One complete sine in the interval [0,\pi]
@@ -1329,16 +1336,16 @@
\pgf@pt@x=\pgf@path@lastx% evil trickery to transform to the last point
\pgf@pt@y=\pgf@path@lasty%
\pgfpathcurveto%
- {\pgfqpoint{.31831\pgf@xc}{.5\pgf@yc}}% found by trial and error
- {\pgfqpoint{.63503\pgf@xc}{\pgf@yc}}% found by trial and error
+ {\pgfqpoint{.3260\pgf@xc}{.5120\pgf@yc}}%
+ {\pgfqpoint{.6380\pgf@xc}{\pgf@yc}}%
{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
- }%
-}
+ }%
+}
% Append a cosine curve between 0 and \pi/2 to the path.
%
% #1 = vector, describing the width and height of the curve
-%
+%
% Examples:
%
% % One complete sine in the interval [0,\pi]
@@ -1354,11 +1361,11 @@
\pgf@pt@x=\pgf@path@lastx% evil trickery to transform to the last point
\pgf@pt@y=\pgf@path@lasty%
\pgfpathcurveto%
- {\pgfqpoint{.36497\pgf@xc}{0pt}}% found by trial and error
- {\pgfqpoint{.68169\pgf@xc}{.5\pgf@yc}}% found by trial and error
+ {\pgfqpoint{.3620\pgf@xc}{0pt}}%
+ {\pgfqpoint{.6740\pgf@xc}{.4880\pgf@yc}}%
{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
- }%
-}
+ }%
+}
@@ -1371,7 +1378,7 @@
% #5 - second control
% #6 - end point of the curve
%
-% There are two versions, \pgfpathcurvebetweentime and
+% There are two versions, \pgfpathcurvebetweentime and
% \pgfpathcurvebetweentimecontinue. The latter does not insert a
% moveto to the first point.
%
@@ -1395,7 +1402,7 @@
\def\pgf@@@pathcurvebetweentime#1#2#3#4#5{%
% Q1 = P1.
- \pgf@process{#2}%
+ \pgf@process{#2}%
\pgf@xc=\pgf@x%
\pgf@yc=\pgf@y%
% Q2 = P1 + t*(P2-P1).
@@ -1417,7 +1424,7 @@
\pgf@process{%
\pgf@process{#4}%
\pgf@xa=#1\pgf@x%
- \pgf@ya=#1\pgf@y%
+ \pgf@ya=#1\pgf@y%
%
\pgf@process{#3}%
\pgf@xc=\pgf@x%
@@ -1428,7 +1435,7 @@
\pgf@x=\pgf@xb%
\pgf@y=\pgf@yb%
\advance\pgf@x by#1\pgf@xa%
- \advance\pgf@y by#1\pgf@ya%
+ \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%
@@ -1437,7 +1444,7 @@
\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}}%
+ \pgf@process{\pgfpointcurveattime{#1}{#2}{#3}{#4}{#5}}%
\ifx#1\pgf@time@t%
% First time round...
\pgfmathdivide@{\pgf@time@s}{\pgf@time@t}%
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 b9c47231afa..0f52985c194 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex
@@ -7,20 +7,20 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex,v 1.9 2013/09/09 10:05:41 tantau Exp $
+\ProvidesFileRCS{pgfcorepathprocessing.code.tex}
% Split a path at the last subpath of a path
%
% #1 = a macro that stores a path
-%
+%
% Description:
%
% This command will split the path into two parts:
%
% \pgfprocessresultpathprefix
% The part of the path before the last subpath.
-%
+%
% \pgfprocessresultpathsuffix
% The last subpath on the path.
%
@@ -31,7 +31,7 @@
\def\pgfprocesssplitpath#1{%
\let\pgfprocessresultpathprefix\pgfutil@empty%
\let\pgfprocessresultpathsuffix\pgfutil@empty%
- \let\pgf@next\pgf@process@split%
+ \let\pgf@next\pgf@process@split%
\expandafter\pgf@process@split#1\pgfsyssoftpath@movetotoken{}{}\pgf@stop%
}
@@ -51,13 +51,13 @@
% Split a subpath at the end
-%
+%
% #1 = a macro that stores an open subpath that contains at least two
% path commands (so, not just a moveto);
-%
+%
% Description:
-%
-% Splits the supath into two parts:
+%
+% Splits the subpath into two parts:
%
% \pgfprocessresultsubpathsuffix
% This macro contains the last two "relevant" path commands: The end
@@ -87,7 +87,7 @@
\expandafter\def\expandafter\pgfprocessresultsubpathsuffix\expandafter{\pgfprocessresultsubpathsuffix#1{#2}{#3}}%
\let\pgf@next\pgfutil@gobble%
\else%
- \pgf@split@movetrue%
+ \pgf@split@movetrue%
\ifx#1\pgfsyssoftpath@curvetosupportatoken%
\pgf@split@movefalse%
\else
@@ -122,7 +122,7 @@
% put in the pgfpoint-macros \pgfpointfirstonpath,
% \pgfpointsecondonpath, \pgfpointsecondlastonpath, and
% \pgfpointlastonpath. If the path is empty, these macros are set to
-% \pgfpointorigin.
+% \pgfpointorigin.
%
% Example:
%
@@ -131,7 +131,7 @@
% \pgfsyssoftpath@curveto{20}{20}{30}{30}{40}{40}
% \pgfsyssoftpath@getcurrentpath\mypath
% \pgfprocesspathextractpoints\mypath
-%
+%
% % \pgfpointfirstonpath is now \pgfpoint{0}{0}
% % \pgfpointsecondonpath is now \pgfpoint{10bp}{10bp}
% % \pgfpointsecondlastonpath is now \pgfpoint{30bp}{30bp}
@@ -234,7 +234,7 @@
\pgf@proc@todo%
}
-
+
% Resolve specialround
%
% #1 = a macro that stores a path
@@ -243,7 +243,7 @@
% Description:
%
% Resolves all specialround tokens. When such a token is encountered,
-% the objective is to replace the next corner by a rounded corner.
+% the objective is to replace the next corner by a rounded corner.
%
\def\pgfprocessround#1#2{%
@@ -264,7 +264,7 @@
}
-\def\pgf@@processround#1#2{%
+\def\pgf@@processround#1#2{%
\let\pgfprocess@newpath\pgfutil@empty%
\let\pgfprocess@moveto\pgfutil@empty%
\let\pgfprocess@firstto\pgfutil@empty%
@@ -309,7 +309,7 @@
\let\next=\pgfprocess@round%
\fi%
\fi%
- \next%
+ \next%
}
\def\pgfprocess@specialround#1#2#3{%
@@ -322,7 +322,7 @@
\let\next=\pgfprocess@specialroundcope%
\else%
\ifx#1\pgfsyssoftpath@curvetosupportatoken%
- % Ok, round a curveto.
+ % Ok, round a curveto.
\let\next=\pgfprocess@specialroundcurveto%
\else%
\ifx#1\pgfsyssoftpath@closepathtoken%
@@ -343,17 +343,17 @@
\pgf@yc=#6%
\let\next=\pgfprocess@@specialround%
\else%
- \ifx#4\pgfsyssoftpath@curvetosupportatoken%
+ \ifx#4\pgfsyssoftpath@curvetosupportatoken%
\pgf@xc=#5%
\pgf@yc=#6%
\let\next=\pgfprocess@@specialround%
\else%
- \ifx#4\pgfsyssoftpath@closepathtoken%
+ \ifx#4\pgfsyssoftpath@closepathtoken%
\pgf@xc=#5%
\pgf@yc=#6%
\let\next=\pgfprocess@@specialround%
\else
- \ifx#4\pgfsyssoftpath@specialroundtoken%
+ \ifx#4\pgfsyssoftpath@specialroundtoken%
\let\next=\pgfprocess@@findrightcoordinates%
\fi%
\fi%
@@ -445,7 +445,7 @@
\expandafter\expandafter\expandafter\noexpand\expandafter\pgfprocess@@specialclosemoveto\pgfprocess@moveto%
}%
\fi%
- \fi%
+ \fi%
\next%
}
@@ -462,7 +462,7 @@
\def\pgfprocess@cleanupafterclose#1#2#3{%
\edef\pgfprocess@moveto{\noexpand\pgfsyssoftpath@movetotoken{\the\pgf@xc}{\the\pgf@yc}}%
\edef\pgf@marshal{\noexpand\pgfprocess@round\noexpand\pgfsyssoftpath@closepathtoken{\the\pgf@xc}{\the\pgf@yc}}%
- \pgf@marshal%
+ \pgf@marshal%
}
@@ -546,7 +546,7 @@
\pgfsyssoftpath@addtocurrentpath{#1{#2}{#3}}%
\fi%
\pgf@next#4%
-}
+}
\def\pgf@replace@handle@move{%
\pgfsyssoftpath@getcurrentpath\pgf@restpath%
@@ -559,5 +559,5 @@
% Redo first.
\let\pgf@@next=\pgf@replaceprocessfirst%
}
-
+
\endinput
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 0c36d3c1a4f..4ca277c9923 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.24 2014/11/02 21:38:01 cfeuersaenger Exp $
+\ProvidesFileRCS{pgfcorepathusage.code.tex}
% Stroke/fill/clip/etc. the current path. Depending on the options,
@@ -15,7 +15,7 @@
% are given, the path is stroked. If multiple options are given, all
% of them are performed (in a sensible order).
%
-% #1 = action(s) to be applied to the current path. Valid actions are:
+% #1 = action(s) to be applied to the current path. Valid actions are:
% stroke - strokes the path.
% draw - strokes the path and adds arrow tips.
% tips - adds arrow tips.
@@ -101,11 +101,11 @@
\let\pgf@up@action=\pgfutil@empty%
\ifx\pgf@up@clip\pgfutil@empty%
\else%
- % only clipping
+ % only clipping
\let\pgf@up@action=\pgfsys@discardpath%
\fi%
\fi%
- \fi%
+ \fi%
\pgfsyssoftpath@getcurrentpath\pgf@last@processed@path
\pgfprocessround{\pgf@last@processed@path}{\pgf@last@processed@path}% change the path
\pgfsyssoftpath@setcurrentpath\pgf@last@processed@path%
@@ -139,7 +139,7 @@
\ifnum\pgf@tips@mode=4\relax%
\pgf@up@draw@arrows@only%
\fi%
- \else%
+ \else%
\pgfsyssoftpath@invokecurrentpath%
\pgf@up@action%
\fi%
@@ -149,13 +149,16 @@
\pgfprocesscheckclosed{\pgf@arrowpath}{\pgfutil@tempswafalse}%
\pgf@path@check@proper%
\ifpgfutil@tempswa%
+ \pgf@check@for@arrow@and@animation%
\pgf@prepare@end@of@path%
\begingroup%
\pgf@prepare@start@of@path%
\fi%
- \pgfsyssoftpath@invokecurrentpath%
+ \pgfsyssoftpath@invokecurrentpath%
\pgf@up@action%
- \pgf@stroke@inner@line@if@needed%
+ \ifdim\pgfinnerlinewidth>0pt\relax%
+ \pgf@stroke@inner@line%
+ \fi%
\ifpgfutil@tempswa%
\pgf@add@arrow@at@start%
\endgroup%
@@ -186,6 +189,7 @@
\pgfprocesscheckclosed{\pgf@arrowpath}{\pgfutil@tempswafalse}%
\pgf@path@check@proper%
\ifpgfutil@tempswa%
+ \pgf@check@for@arrow@and@animation%
\pgf@prepare@end@of@path%
\begingroup%
\pgf@prepare@start@of@path%
@@ -195,6 +199,22 @@
\fi%
}
+\def\pgf@check@for@arrow@and@animation{\pgfsys@if@fresh@currentid{\pgf@check@for@arrow@and@animation@}{}}%
+\def\pgf@check@for@arrow@and@animation@{%
+ \expandafter\ifx\csname pgfsysanim@path@is@animated@\pgf@sys@id@current@id @\pgfsys@current@type\endcsname\pgfutil@empty%
+ % Ok, an animation is here!
+ \ifx\pgf@end@tip@sequence\pgfutil@empty%
+ \ifx\pgf@start@tip@sequence\pgfutil@empty%
+ \else%
+ \pgf@check@for@arrow@and@animation@error%
+ \fi%
+ \else%
+ \pgf@check@for@arrow@and@animation@error%
+ \fi%
+ \fi%
+}
+\def\pgf@check@for@arrow@and@animation@error{\pgferror{Animated path may not have normal arrow tips. Use a base path with arrow tips}}
+
\def\pgf@path@check@proper{%
\ifpgfutil@tempswa%
\ifnum\pgf@tips@mode>2\relax%
@@ -203,7 +223,6 @@
\fi%
}
-
\def\pgf@path@check@proper@{%
{%
\pgf@x0pt\pgf@y\pgf@x%
@@ -234,24 +253,20 @@
-\def\pgf@stroke@inner@line@if@needed{%
- \ifdim\pgfinnerlinewidth>0pt\relax%
- \let\pgf@temp@save=\pgf@strokecolor@global
- \pgfsys@beginscope%
- {%
- \pgfsys@setlinewidth{\pgfinnerlinewidth}%
- \pgfsetstrokecolor{\pgfinnerstrokecolor}%
- \pgfsyssoftpath@invokecurrentpath%
- \pgfsys@stroke%
- }%
- \pgfsys@endscope%
- \global\let\pgf@strokecolor@global=\pgf@temp@save
- \fi%
+\def\pgf@stroke@inner@line{%
+ \let\pgf@temp@save=\pgf@strokecolor@global
+ \pgfsys@beginscope%
+ {%
+ \pgfsys@setlinewidth{\pgfinnerlinewidth}%
+ \pgfsetstrokecolor{\pgfinnerstrokecolor}%
+ \pgfsyssoftpath@invokecurrentpath%
+ \pgfsys@stroke%
+ }%
+ \pgfsys@endscope%
+ \global\let\pgf@strokecolor@global=\pgf@temp@save
}
\let\pgf@prepare@start@of@path\relax%
-\let\pgf@add@arrow@at@end\relax%
-\let\pgf@add@arrow@at@start\relax%
@@ -278,11 +293,11 @@
-%
-%
-% Handling the end of a path
-%
-%
+%
+%
+% Handling the end of a path
+%
+%
% The "handling" consists of first testing whether we need to do
% anything at all, namely because either an arrow tip should be drawn
% at the end or because the path should be shortened at the end. If
@@ -296,20 +311,23 @@
% (step 0) and, if so, split the path (step 1), extract the interesting points from
% the path (step 2), prepare further computations (step 3), shorten
% the path (step 4) if necessary, and add the arrow tip (step 4 in
-% macro \pgf@add@arrow@at@end, which is called later).
+% macro \pgf@add@arrow@at@end, which is called later).
\def\pgf@prepare@end@of@path{%
\let\pgfprocessresultpathsuffix\relax% flag that nothing has happened...
\let\pgfprocessresultsubpathsuffix\relax%
\pgfsyssoftpath@getcurrentpath\pgf@arrowpath%
- %
+ %
% Step 0 start:
- %
- % Do we need to worry about the end?
- %
+ %
+ % Do we need to worry about the end?
+ %
\ifx\pgf@arrowpath\pgfutil@empty\else%
\pgf@worryfalse%
- \ifx\pgf@end@tip@sequence\pgfutil@empty\else\pgf@worrytrue\fi% Yes, worry if we have to draw an arrow
+ \ifx\pgf@end@tip@sequence\pgfutil@empty%
+ \else%
+ \pgf@worrytrue% Yes, worry if we have to draw an arrow
+ \fi%
\pgf@precise@shorteningfalse%
\pgf@arrow@compute@shortening\pgf@end@tip@sequence%
\advance\pgf@xa by\pgf@shorten@end@additional%
@@ -317,28 +335,28 @@
\ifdim\pgf@xa=0pt\relax\else\pgf@worrytrue\fi% Also, worry if shortening is requested
\edef\pgf@path@shortening@distance{\the\pgf@xa}%
\edef\pgf@arrow@tip@total@length{\the\pgf@xb}%
- %
+ %
% Step 0 done.
- %
+ %
\ifpgf@worry%
% Ok, need to "worry" about the end, either because we need to
% shorten it or to draw an arrow head.
%
% Step 1: Split
- %
+ %
\pgfprocesssplitpath{\pgf@arrowpath}%
\pgfprocesssplitsubpath{\pgfprocessresultpathsuffix}%
- %
+ %
% Step 2: extract
%
\expandafter\pgf@parse@end\pgfprocessresultsubpathsuffix\pgf@stop\pgf@stop\pgf@stop%
- %
- % Step 3: prep
- %
+ %
+ % Step 3: prep
+ %
\pgf@prep@end%
- %
+ %
% Step 4: shorten
- %
+ %
\ifdim\pgf@path@shortening@distance=0pt\else\pgf@do@shorten@end\fi%
\expandafter\expandafter\expandafter\def%
\expandafter\expandafter\expandafter\pgf@arrowpath%
@@ -376,7 +394,7 @@
\def\pgfpointlastonpath{\pgfqpoint{#5}{#6}}%
\let\pgfpointfourthlastonpath\relax%
\let\pgfpointthirdlastonpath\relax%
- \let\pgf@next\pgf@parse@end@gobble@three%
+ \let\pgf@next\pgf@parse@end@gobble@three%
\let\pgf@do@shorten@end\pgf@do@shorten@straightend%
\let\pgf@do@draw@end\pgf@do@draw@straightend%
\let\pgf@prep@end\pgf@prep@straightend%
@@ -394,8 +412,8 @@
\fi%
}
-%
-% Preps
+%
+% Preps
%
\def\pgf@prep@movetoend{%
\pgf@process{\pgfpointlastonpath}%
@@ -422,7 +440,7 @@
}
-%
+%
% Line shortening for straight lines:
%
\def\pgf@do@shorten@straightend{%
@@ -433,21 +451,21 @@
}
-%
+%
% Draw an end arrow by calling an appropriate subfunction, if necessary
-%
+%
\def\pgf@add@arrow@at@end{%
\ifx\pgf@arrowpath\pgfutil@empty\else%
\ifx\pgf@end@tip@sequence\pgfutil@empty\else%
\pgf@do@draw@end%
- \fi%
+ \fi%
\fi%
}
-%
+%
% Draw an end arrow at the end of a straight line
-%
+%
\def\pgf@do@draw@straightend{%
{%
\pgftransformreset%
@@ -458,29 +476,31 @@
-%
-%
-% Handling the start of a path
-%
-%
+
+
+%
+%
+% Handling the start of a path
+%
+%
% The "handling" is similar to the case for the start of the path. We
% may be able to skip the splitting if that was done already for the
% end. Otherwise, things are basically the same.
%
% Prepare the start of the path: Test whether anything must be done
-% (step 0) and, if so, split the path (step 1) if necesssary, extract
+% (step 0) and, if so, split the path (step 1) if necessary, extract
% the interesting points from the path (step 2), prepare computations
% (step 3) needed for both shortening and tip adding, shorten the path
% (step 4), and add the arrow tip (step 5 in macro
-% \pgf@add@arrow@at@start, which is called later).
+% \pgf@add@arrow@at@start, which is called later).
\def\pgf@prepare@start@of@path{%
- %
+ %
% Step 0 start:
- %
- % Do we need to worry about the start?
- %
+ %
+ % Do we need to worry about the start?
+ %
\ifx\pgf@arrowpath\pgfutil@empty\else%
\pgf@worryfalse%
\ifx\pgf@start@tip@sequence\pgfutil@empty\else\pgf@worrytrue\fi% Yes, worry if we have to draw an arrow
@@ -491,30 +511,30 @@
\ifdim\pgf@xa=0pt\relax\else\pgf@worrytrue\fi% Also, worry if shortening is requested
\edef\pgf@path@shortening@distance{\the\pgf@xa}%
\edef\pgf@arrow@tip@total@length{\the\pgf@xb}%
- %
+ %
% Step 0 done.
- %
+ %
\ifpgf@worry%
% Ok, need to "worry" about the start, either because we need to
% shorten it or to draw an arrow head.
%
% Step 1: Split
- %
+ %
\ifx\pgfprocessresultpathsuffix\relax%
% Ok, still need to compute the split:
\pgfprocesssplitpath{\pgf@arrowpath}%
\fi%
- %
+ %
% Step 2: extract
%
\expandafter\pgf@parse@start\pgfprocessresultpathsuffix\pgf@stop\pgf@stop\pgf@stop%
- %
+ %
% Step 3: prep
%
\pgf@prep@start%
- %
+ %
% Step 4: shorten
- %
+ %
\ifdim\pgf@path@shortening@distance=0pt\else\pgf@do@shorten@start\fi%
\expandafter\expandafter\expandafter\def%
\expandafter\expandafter\expandafter\pgf@arrowpath%
@@ -549,7 +569,7 @@
\let\pgf@prep@start\pgf@prep@straightstart%
\fi%
\else% A straight line -> great!
- \let\pgf@next\pgf@parse@start@till@stop%
+ \let\pgf@next\pgf@parse@start@till@stop%
\let\pgf@do@shorten@start\pgf@do@shorten@straightstart%
\let\pgf@do@draw@start\pgf@do@draw@straightstart%
\let\pgf@prep@start\pgf@prep@straightstart%
@@ -571,8 +591,8 @@
\def\pgfsubpathend{#1{#2}{#3}#4{#5}{#6}#7}%
}
-%
-% Preps
+%
+% Preps
%
\def\pgf@prep@movetostart{%
\pgf@process{\pgfpointfirstonpath}%
@@ -598,7 +618,7 @@
\pgf@ya\pgf@y%
}
-%
+%
% Line shortening for straight lines:
%
\def\pgf@do@shorten@straightstart{%
@@ -609,21 +629,21 @@
}
-%
+%
% Draw a start arrow by calling an appropriate subfunction, if necessary
-%
+%
\def\pgf@add@arrow@at@start{%
\ifx\pgf@arrowpath\pgfutil@empty\else%
\ifx\pgf@start@tip@sequence\pgfutil@empty\else%
\pgf@do@draw@start%
- \fi%
+ \fi%
\fi%
}
-%
+%
% Draw an start arrow at the start of a straight line
-%
+%
\def\pgf@do@draw@straightstart{%
{%
\pgftransformreset%
@@ -639,8 +659,3 @@
\endinput%
-
-
-
-
-
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 54b5afcf6ae..d2186d66bc2 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.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/pgfcorepatterns.code.tex,v 1.5 2013/11/07 15:45:46 tantau Exp $
+\ProvidesFileRCS{pgfcorepatterns.code.tex}
% Creates a new uncolored pattern
%
@@ -110,16 +110,16 @@
\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}}%
+ \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}}%
+ \def\pgf@marshal{\pgf@declarepatternmutable{#1}}%
\expandafter\pgf@marshal\expandafter{\pgf@pattern@tempvars}{#2}{#3}{#4}{#5}{3}%
}
@@ -177,7 +177,7 @@
\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}%
+ \expandafter\gdef\csname pgf@pattern@type@#1\endcsname{7}%
}{\pgferror{The pattern `#1' is already defined}}%
}
@@ -218,7 +218,7 @@
{%
\pgf@ifpatternismutable{#1}%
{%
- % So, a mutable pattern. Check to see if the pattern
+ % 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%
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 b546d5df40f..57db0d20ba2 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.27 2013/10/07 15:51:46 tantau Exp $
+\ProvidesFileRCS{pgfcorepoints.code.tex}
\newdimen\pgf@picminx
\newdimen\pgf@picmaxx
@@ -34,18 +34,18 @@
% \pgfextract@process\myarcpoint{\pgfpointpolar{30}{5cm and 2cm}}
\def\pgfextract@process#1#2{%
- \pgf@process{#2}%
- \edef#1{\noexpand\pgf@x=\the\pgf@x\noexpand\relax\noexpand\pgf@y=\the\pgf@y\noexpand\relax}%
+ \pgf@process{#2}%
+ \edef#1{\noexpand\global\pgf@x=\the\pgf@x\noexpand\relax\noexpand\global\pgf@y=\the\pgf@y\noexpand\relax}%
}
% This needed until old shapes code changed.
\let\pgfsavepgf@process\pgfextract@process%
% Return a point
-%
-% #1 = x-coordinate of the point
-% #2 = y-coordinate of the point
-%
+%
+% #1 = x-coordinate of the point
+% #2 = y-coordinate of the point
+%
% x = #1
% y = #2
%
@@ -59,10 +59,10 @@
% Quickly a point
-%
+%
% #1 = x-coordinate of the point (no calculations done)
% #2 = y-coordinate of the point (no calculations done)
-%
+%
% x = #1
% y = #2
%
@@ -70,12 +70,12 @@
%
% \pgfpathmoveto{\pgfqpoint{2pt}{3cm}}
-\def\pgfqpoint#1#2{\pgf@x=#1\pgf@y=#2}
+\def\pgfqpoint#1#2{\global\pgf@x=#1\relax\global\pgf@y=#2\relax}
% Return the origin.
-%
+%
% x = 0
% y = 0
%
@@ -83,12 +83,12 @@
%
% \pgfpathmoveto{\pgfpointorigin}
-\def\pgfpointorigin{\pgf@x=0pt\pgf@y=\pgf@x\ignorespaces}
+\def\pgfpointorigin{\global\pgf@x=0pt \global\pgf@y=\pgf@x\ignorespaces}
% Return a transformed point
-%
+%
% #1 = a point
%
% Description:
@@ -108,18 +108,18 @@
\def\pgfpointtransformed#1{%
\pgf@process{%
#1%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
+ \pgf@pos@transform@glob%
}%
}
% Return the difference vector of two points.
-%
-% #1 = start of vector
-% #2 = end of vector
-%
-% x = x-component of difference
-% y = y-component of difference
+%
+% #1 = start of vector
+% #2 = end of vector
+%
+% x = x-component of difference
+% y = y-component of difference
%
% Example:
%
@@ -130,14 +130,14 @@
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
\pgf@process{#2}%
- \advance\pgf@x by-\pgf@xa\relax%
- \advance\pgf@y by-\pgf@ya\relax\ignorespaces}
-
-% Add two vectors.
-%
-% #1 = first vector
-% #2 = second vector
-%
+ \global\advance\pgf@x by-\pgf@xa\relax%
+ \global\advance\pgf@y by-\pgf@ya\relax\ignorespaces}
+
+% Add two vectors.
+%
+% #1 = first vector
+% #2 = second vector
+%
% x = x-component of addition
% y = y-component of addition
%
@@ -150,15 +150,15 @@
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
\pgf@process{#2}%
- \advance\pgf@x by\pgf@xa%
- \advance\pgf@y by\pgf@ya}
+ \global\advance\pgf@x by\pgf@xa%
+ \global\advance\pgf@y by\pgf@ya}
% Multiply a vector by a factor.
-%
-% #1 = factor
-% #2 = vector
+%
+% #1 = factor
+% #2 = vector
%
% Example:
%
@@ -167,20 +167,20 @@
\def\pgfpointscale#1#2{%
\pgf@process{#2}%
\pgfmathparse{#1}%
- \pgf@x=\pgfmathresult\pgf@x%
- \pgf@y=\pgfmathresult\pgf@y%
+ \global\pgf@x=\pgfmathresult\pgf@x%
+ \global\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%
+ \global\pgf@x=#1\pgf@x%
+ \global\pgf@y=#1\pgf@y%
}
% The intersection of two lines
-%
+%
% #1 = point on first line
% #2 = another point on first line
% #3 = point on second line
@@ -196,9 +196,9 @@
\def\pgfpointintersectionoflines#1#2#3#4{%
{%
- %
+ %
% Compute orthogonal vector to #1--#2
- %
+ %
\pgf@process{#2}%
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
@@ -226,12 +226,12 @@
%
\pgf@xc=\pgf@sys@tonumber{\pgf@ya}\pgf@x%
\advance\pgf@xc by\pgf@sys@tonumber{\pgf@xa}\pgf@y%
- %
+ %
% The orthogonal vector is (\pgf@ya,\pgf@xa)
- %
- %
+ %
+ %
% Compute orthogonal vector to #3--#4
- %
+ %
\pgf@process{#4}%
\pgf@xb=\pgf@x%
\pgf@yb=\pgf@y%
@@ -259,12 +259,12 @@
%
\pgf@yc=\pgf@sys@tonumber{\pgf@yb}\pgf@x%
\advance\pgf@yc by\pgf@sys@tonumber{\pgf@xb}\pgf@y%
- %
+ %
% The orthogonal vector is (\pgf@yb,\pgf@xb)
- %
- % Setup transformation matrx (this is just to use the matrix
+ %
+ % Setup transformation matrix (this is just to use the matrix
% inversion)
- %
+ %
\pgfsettransform{{\pgf@sys@tonumber\pgf@ya}{\pgf@sys@tonumber\pgf@yb}{\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgf@xb}{0pt}{0pt}}%
\pgftransforminvert%
\pgf@process{\pgfpointtransformed{\pgfpoint{\pgf@xc}{\pgf@yc}}}%
@@ -273,7 +273,7 @@
% The intersection of two circles
-%
+%
% #1 = center of first circle
% #2 = center of second circle
% #3 = radius of first circle
@@ -404,7 +404,7 @@
\pgf@xb=\pgf@sys@tonumber{\dimen0}\dimen9%
\pgf@xb=-\pgf@xb%
\advance\pgf@y by\pgf@xb\relax%
- \else%
+ \else%
% x = a + ek/p - (f/p)sqrt(r^2 - k^2)
\pgf@x=\pgf@xa%
\advance\pgf@x by\pgf@sys@tonumber{\dimen0}\dimen8\relax%
@@ -426,13 +426,13 @@
% Returns point on a line from #2 to #3 at time #1.
-%
+%
% #1 = a time, where 0 is the start and 1 is the end
% #2 = start point
-% #3 = end point
-%
+% #3 = end point
+%
% x = x-component of #1*start + (1-#1)*end
-% y = y-component of #1*start + (1-#1)*end
+% y = y-component of #1*start + (1-#1)*end
% xa/ya = #1*start + (1-#1)*end
% xb/yb = start point
% xc/yc = end point
@@ -454,21 +454,21 @@
\pgfmathsetmacro\pgf@temp{#1}%
\advance\pgf@xa by-\pgf@x%
\advance\pgf@ya by-\pgf@y%
- \advance\pgf@x by\pgf@temp\pgf@xa%
- \advance\pgf@y by\pgf@temp\pgf@ya%
+ \global\advance\pgf@x by\pgf@temp\pgf@xa%
+ \global\advance\pgf@y by\pgf@temp\pgf@ya%
}
% Move point #2 #1 many units in the direction of #3.
-%
+%
% #1 = a distance
% #2 = start point
-% #3 = end point
+% #3 = end point
%
% Description:
%
% Computes
-%
+%
% x/y = start + #1*(normalise(end-start))
%
% and additionally
@@ -490,27 +490,27 @@
\pgf@process{#3}%
\pgf@xc\pgf@x%
\pgf@yc\pgf@y%
- \advance\pgf@x by-\pgf@xb\relax%
- \advance\pgf@y by-\pgf@yb\relax%
+ \global\advance\pgf@x by-\pgf@xb\relax%
+ \global\advance\pgf@y by-\pgf@yb\relax%
\pgf@process{\pgfpointnormalised{}}% x/y = normalised vector
\pgf@ya=\pgf@xa\relax%
\pgf@xa=\pgf@sys@tonumber{\pgf@x}\pgf@xa%
\pgf@ya=\pgf@sys@tonumber{\pgf@y}\pgf@ya%
- \pgf@x=\pgf@xb\relax%
- \pgf@y=\pgf@yb\relax%
- \advance\pgf@x by\pgf@xa\relax%
- \advance\pgf@y by\pgf@ya\relax%
+ \global\pgf@x=\pgf@xb\relax%
+ \global\pgf@y=\pgf@yb\relax%
+ \global\advance\pgf@x by\pgf@xa\relax%
+ \global\advance\pgf@y by\pgf@ya\relax%
}
% Returns point on a curve from #2 to #5 with controls #3 and #4 at time #1.
-%
+%
% #1 = a time
% #2 = start point
% #3 = first control point
% #4 = second control point
-% #5 = end point
-%
+% #5 = end point
+%
% x = x-component of place on the curve at time t
% y = y-component of place on the curve at time t
%
@@ -528,8 +528,8 @@
\def\pgfpointcurveattime#1#2#3#4#5{%
\pgfmathparse{#1}%
\let\pgf@time@s=\pgfmathresult%
- \pgf@x=\pgfmathresult pt%
- \pgf@x=-\pgf@x%
+ \global\pgf@x=\pgfmathresult pt%
+ \global\pgf@x=-\pgf@x%
\advance\pgf@x by 1pt%
\edef\pgf@time@t{\pgf@sys@tonumber{\pgf@x}}%
\pgf@process{#5}%
@@ -543,30 +543,30 @@
\pgf@ya=\pgf@y%
\pgf@process{#2}%
% First iteration:
- \pgf@x=\pgf@time@t\pgf@x\advance\pgf@x by\pgf@time@s\pgf@xa%
- \pgf@y=\pgf@time@t\pgf@y\advance\pgf@y by\pgf@time@s\pgf@ya%
+ \global\pgf@x=\pgf@time@t\pgf@x\global\advance\pgf@x by\pgf@time@s\pgf@xa%
+ \global\pgf@y=\pgf@time@t\pgf@y\global\advance\pgf@y by\pgf@time@s\pgf@ya%
\pgf@xa=\pgf@time@t\pgf@xa\advance\pgf@xa by\pgf@time@s\pgf@xb%
\pgf@ya=\pgf@time@t\pgf@ya\advance\pgf@ya by\pgf@time@s\pgf@yb%
\pgf@xb=\pgf@time@t\pgf@xb\advance\pgf@xb by\pgf@time@s\pgf@xc%
\pgf@yb=\pgf@time@t\pgf@yb\advance\pgf@yb by\pgf@time@s\pgf@yc%
% Second iteration:
- \pgf@x=\pgf@time@t\pgf@x\advance\pgf@x by\pgf@time@s\pgf@xa%
- \pgf@y=\pgf@time@t\pgf@y\advance\pgf@y by\pgf@time@s\pgf@ya%
+ \global\pgf@x=\pgf@time@t\pgf@x\global\advance\pgf@x by\pgf@time@s\pgf@xa%
+ \global\pgf@y=\pgf@time@t\pgf@y\global\advance\pgf@y by\pgf@time@s\pgf@ya%
\pgf@xa=\pgf@time@t\pgf@xa\advance\pgf@xa by\pgf@time@s\pgf@xb%
\pgf@ya=\pgf@time@t\pgf@ya\advance\pgf@ya by\pgf@time@s\pgf@yb%
% Save x/y
\pgf@xb=\pgf@x%
\pgf@yb=\pgf@y%
% Third iteration:
- \pgf@x=\pgf@time@t\pgf@x\advance\pgf@x by\pgf@time@s\pgf@xa%
- \pgf@y=\pgf@time@t\pgf@y\advance\pgf@y by\pgf@time@s\pgf@ya%
+ \global\pgf@x=\pgf@time@t\pgf@x\global\advance\pgf@x by\pgf@time@s\pgf@xa%
+ \global\pgf@y=\pgf@time@t\pgf@y\global\advance\pgf@y by\pgf@time@s\pgf@ya%
}
% Returns point on an arc at a certain "time"
-%
-% #1 = a time
+%
+% #1 = a time
% #2 = center of a ellipse
% #3 = 0-degree exis of the ellipse
% #4 = 90-degree exis of the ellipse
@@ -589,8 +589,8 @@
\pgfmathsetmacro\pgf@angle@start{#5}%
\pgfmathsetmacro\pgf@angle@end{#6}%
\pgfmathparse{#1}%
- \pgf@x=\pgfmathresult pt%
- \pgf@x=-\pgf@x%
+ \global\pgf@x=\pgfmathresult pt%
+ \global\pgf@x=-\pgf@x%
\advance\pgf@x by 1pt%
\pgfmathsetmacro\pgf@angle@mid{\pgf@angle@end*\pgfmathresult+\pgf@angle@start*\pgf@sys@tonumber{\pgf@x}}%
\pgfmathcos@{\pgf@angle@mid}%
@@ -605,11 +605,11 @@
\pgf@process{\pgfpointadd{\pgfpointscale{\pgf@angle@sin}{\pgf@angle@zero@axis}}%
{\pgfpointscale{-\pgf@angle@cos}{\pgf@angle@ninety@axis}}}%
\ifdim\pgf@angle@start pt>\pgf@angle@end pt%
- \pgf@xa=\pgf@x%
- \pgf@ya=\pgf@y%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
\else%
- \pgf@xa=-\pgf@x%
- \pgf@ya=-\pgf@y%
+ \pgf@xa=-\pgf@x%
+ \pgf@ya=-\pgf@y%
\fi%
% Compute position
\pgf@process{\pgfpointadd{#2}{%
@@ -632,12 +632,12 @@
% A polar coordinate
%
% #1 = a degree
-% #2 = a radius -- either a dimension or two dimensions separated by
-% " and ".
+% #2 = a radius -- either a dimension or two dimensions separated by
+% " and ".
%
% x = (first dimension in #2) * cos(#1)
% y = (second dimension in #2) * sin(#2)
-%
+%
% Example:
%
% \pgfpathmoveto{\pgfpointpolar{30}{1cm}}
@@ -649,29 +649,29 @@
\pgf@polar@#2\@@%
\else%
\pgf@polar@#2 and #2\@@%
- \fi%
+ \fi%
\pgfmathparse{#1}%
\let\pgfpoint@angle=\pgfmathresult%
\pgfmathcos@{\pgfpoint@angle}%
- \pgf@x=\pgfmathresult\pgf@x%
+ \global\pgf@x=\pgfmathresult\pgf@x%
\pgfmathsin@{\pgfpoint@angle}%
- \pgf@y=\pgfmathresult\pgf@y%
+ \global\pgf@y=\pgfmathresult\pgf@y%
}
\def\pgf@polar@#1and #2\@@{%
\pgfmathsetlength{\pgf@y}{#2}%
- \pgfmathsetlength{\pgf@x}{#1}%
+ \pgfmathsetlength{\pgf@x}{#1}%
}
% Quick version of the polar coordinate method
\def\pgfqpointpolar#1#2{%
- \pgf@x=#2%
- \pgf@y=\pgf@x%
+ \global\pgf@x=#2%
+ \global\pgf@y=\pgf@x%
\pgfmathcos@{#1}%
- \pgf@x=\pgfmathresult\pgf@x%
+ \global\pgf@x=\pgfmathresult\pgf@x%
\pgfmathsin@{#1}%
- \pgf@y=\pgfmathresult\pgf@y\relax%
+ \global\pgf@y=\pgfmathresult\pgf@y\relax%
}
@@ -680,11 +680,11 @@
% A polar coordinate in the xy plane.
%
% #1 = a degree
-% #2 = a radius given as a number or two radi
+% #2 = a radius given as a number or two radii
%
% result = (first dim in #2) * x-vector * cos(#1) +
% (second dim in #2) * y-vector * sin(#1)
-%
+%
% Example:
%
% \pgfpathmoveto{\pgfpointpolarxy{30}{2}}
@@ -695,17 +695,17 @@
\pgf@polarxy@#2\@@%
\else%
\pgf@polarxy@#2and #2\@@%
- \fi%
+ \fi%
\pgfmathparse{#1}%
\let\pgfpoint@angle=\pgfmathresult%
\pgfmathcos@{\pgfpoint@angle}%
\pgf@xa=\pgfmathresult\pgf@xa%
\pgfmathsin@{\pgfpoint@angle}%
\pgf@ya=\pgfmathresult\pgf@ya%
- \pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@xx%
- \advance\pgf@x by \pgf@sys@tonumber{\pgf@ya}\pgf@yx%
- \pgf@y=\pgf@sys@tonumber{\pgf@xa}\pgf@xy%
- \advance\pgf@y by \pgf@sys@tonumber{\pgf@ya}\pgf@yy}
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@xx%
+ \global\advance\pgf@x by \pgf@sys@tonumber{\pgf@ya}\pgf@yx%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xa}\pgf@xy%
+ \global\advance\pgf@y by \pgf@sys@tonumber{\pgf@ya}\pgf@yy}
\def\pgf@polarxy@#1and #2\@@{%
\pgfmathsetlength{\pgf@xa}{#1}%
@@ -721,7 +721,7 @@
% #3 = a height given as a number
%
% result = #2*(x-vector * cos(#1) + y-vector * sin(#1)) + #3*z-vector
-%
+%
% Example:
%
% \pgfpathmoveto{\pgfpointcylindrical{30}{2}{1}}
@@ -729,8 +729,8 @@
\def\pgfpointcylindrical#1#2#3{%
\pgfpointpolarxy{#1}{#2}%
\pgfmathparse{#3}%
- \advance\pgf@x by \pgfmathresult\pgf@zx%
- \advance\pgf@y by \pgfmathresult\pgf@zy}
+ \global\advance\pgf@x by \pgfmathresult\pgf@zx%
+ \global\advance\pgf@y by \pgfmathresult\pgf@zy}
% A spherical coordinate.
@@ -740,7 +740,7 @@
% #3 = a radius
%
% result = #3*(cos(#2)*(x-vector * cos(#1) + y-vector * sin(#1)) + sin(#2)*z-vector)
-%
+%
% Example:
%
% \pgfpathmoveto{\pgfpointspherical{30}{30}{2}}
@@ -764,33 +764,33 @@
\advance\pgf@xc by \pgfmathresult\pgf@zx%
\advance\pgf@yc by \pgfmathresult\pgf@zy%
\pgfmathparse{#3}%
- \pgf@x=\pgfmathresult\pgf@xc%
- \pgf@y=\pgfmathresult\pgf@yc\relax%
+ \global\pgf@x=\pgfmathresult\pgf@xc%
+ \global\pgf@y=\pgfmathresult\pgf@yc\relax%
}
% Store the vector #1 * x-vec + #2 * y-vec
%
% #1 = a factor for the x-vector
-% #2 = a factor fot the y-vector
+% #2 = a factor for the y-vector
%
% x = x-component of result vector
% y = y-component of result vector
%
% Description:
-%
+%
% This command can be used to create a new coordinate system
% without using the rotate/translate/scale commands. This
% may be useful, if you do not want arrows and line width to
% be scaled/transformed together with the coordinate system.
-%
+%
% Example:
%
% % Create a slanted rectangle
%
% \pgfsetxvec{\pgfpoint{1cm}{1cm}}
% \pgfsetyvec{\pgfpoint{0cm}{1cm}}
-%
+%
% \pgfpathmoveto{\pgfpointxy{0}{0}}
% \pgfpathlineto{\pgfpointxy{1}{0}}
% \pgfpathlineto{\pgfpointxy{1}{1}}
@@ -802,40 +802,40 @@
\let\pgftemp@x=\pgfmathresult%
\pgfmathparse{#2}%
\let\pgftemp@y=\pgfmathresult%
- \pgf@x=\pgftemp@x\pgf@xx%
- \advance\pgf@x by \pgftemp@y\pgf@yx%
- \pgf@y=\pgftemp@x\pgf@xy%
- \advance\pgf@y by \pgftemp@y\pgf@yy}
+ \global\pgf@x=\pgftemp@x\pgf@xx%
+ \global\advance\pgf@x by \pgftemp@y\pgf@yx%
+ \global\pgf@y=\pgftemp@x\pgf@xy%
+ \global\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}
+ \global\pgf@x=#1\pgf@xx%
+ \global\advance\pgf@x by #2\pgf@yx%
+ \global\pgf@y=#1\pgf@xy%
+ \global\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
-% #2 = a factor fot the y-vector
-% #3 = a factor fot the z-vector
+% #2 = a factor for the y-vector
+% #3 = a factor for the z-vector
%
% x = x-component of result vector
% y = y-component of result vector
%
%
% Description:
-%
+%
% This command allows you to use a 3d coordinate system.
-%
+%
%
% Example:
%
% % Draw a cubus
-%
+%
% \pgfline{\pgfpointxyz{0}{0}{0}}{\pgfpointxyz{0}{0}{1}}
% \pgfline{\pgfpointxyz{0}{1}{0}}{\pgfpointxyz{0}{1}{1}}
% \pgfline{\pgfpointxyz{1}{0}{0}}{\pgfpointxyz{1}{0}{1}}
@@ -856,23 +856,23 @@
\let\pgftemp@y=\pgfmathresult%
\pgfmathparse{#3}%
\let\pgftemp@z=\pgfmathresult%
- \pgf@x=\pgftemp@x\pgf@xx%
- \advance\pgf@x by \pgftemp@y\pgf@yx%
- \advance\pgf@x by \pgftemp@z\pgf@zx%
- \pgf@y=\pgftemp@x\pgf@xy%
- \advance\pgf@y by \pgftemp@y\pgf@yy%
- \advance\pgf@y by \pgftemp@z\pgf@zy}
+ \global\pgf@x=\pgftemp@x\pgf@xx%
+ \global\advance\pgf@x by \pgftemp@y\pgf@yx%
+ \global\advance\pgf@x by \pgftemp@z\pgf@zx%
+ \global\pgf@y=\pgftemp@x\pgf@xy%
+ \global\advance\pgf@y by \pgftemp@y\pgf@yy%
+ \global\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}
+ \global\pgf@x=#1\pgf@xx%
+ \global\advance\pgf@x by #2\pgf@yx%
+ \global\advance\pgf@x by #3\pgf@zx%
+ \global\pgf@y=#1\pgf@xy%
+ \global\advance\pgf@y by #2\pgf@yy%
+ \global\advance\pgf@y by #3\pgf@zy}
@@ -946,7 +946,7 @@
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
\ifdim\pgf@x<0pt\relax% move into first quadrant
- \pgf@x=-\pgf@x%
+ \global\pgf@x=-\pgf@x%
\fi%
\ifdim\pgf@y<0pt\relax%
\pgf@y=-\pgf@y%
@@ -958,29 +958,29 @@
\ifnum\c@pgf@counta=0\relax%
\c@pgf@counta=1\relax%
\fi%
- \divide\pgf@x by\c@pgf@counta%
- \divide\pgf@y by\c@pgf@counta%
+ \global\divide\pgf@x by\c@pgf@counta%
+ \global\divide\pgf@y by\c@pgf@counta%
\divide\pgf@xa by\c@pgf@counta%
\divide\pgf@ya by\c@pgf@counta%
% ok.
- \pgf@x=.125\pgf@x%
- \pgf@y=.125\pgf@y%
+ \global\pgf@x=.125\pgf@x%
+ \global\pgf@y=.125\pgf@y%
\c@pgf@counta=\pgf@x%
\c@pgf@countb=\pgf@y%
\multiply\c@pgf@countb by 100%
\ifnum\c@pgf@counta<64\relax%
- \pgf@x=1pt\relax%
- \pgf@y=0pt\relax%
+ \global\pgf@x=1pt\relax%
+ \global\pgf@y=0pt\relax%
\else%
\divide\c@pgf@countb by \c@pgf@counta%
- \pgf@x=\csname pgf@cosfrac\the\c@pgf@countb\endcsname pt%
+ \global\pgf@x=\csname pgf@cosfrac\the\c@pgf@countb\endcsname pt%
\pgf@xc=8192pt%
\divide\pgf@xc by\c@pgf@counta%
- \pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@ya%
- \pgf@y=\pgf@sys@tonumber{\pgf@x}\pgf@y%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@ya%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@x}\pgf@y%
\fi%
\ifdim\pgf@xa<0pt%
- \pgf@x=-\pgf@x%
+ \global\pgf@x=-\pgf@x%
\fi%
\else% x <= y
% make point small
@@ -989,29 +989,29 @@
\ifnum\c@pgf@counta=0\relax%
\c@pgf@counta=1\relax%
\fi%
- \divide\pgf@x by\c@pgf@counta%
- \divide\pgf@y by\c@pgf@counta%
+ \global\divide\pgf@x by\c@pgf@counta%
+ \global\divide\pgf@y by\c@pgf@counta%
\divide\pgf@xa by\c@pgf@counta%
\divide\pgf@ya by\c@pgf@counta%
% ok.
- \pgf@x=.125\pgf@x%
- \pgf@y=.125\pgf@y%
+ \global\pgf@x=.125\pgf@x%
+ \global\pgf@y=.125\pgf@y%
\c@pgf@counta=\pgf@y%
\c@pgf@countb=\pgf@x%
\multiply\c@pgf@countb by 100%
\ifnum\c@pgf@counta<64\relax%
- \pgf@y=1pt\relax%
- \pgf@x=0pt\relax%
+ \global\pgf@y=1pt\relax%
+ \global\pgf@x=0pt\relax%
\else%
\divide\c@pgf@countb by \c@pgf@counta%
- \pgf@y=\csname pgfmath@cosfrac@\the\c@pgf@countb\endcsname pt%
+ \global\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%
- \pgf@x=\pgf@sys@tonumber{\pgf@y}\pgf@x%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@xc}\pgf@xa%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@y}\pgf@x%
\fi%
\ifdim\pgf@ya<0pt%
- \pgf@y=-\pgf@y%
+ \global\pgf@y=-\pgf@y%
\fi%
\fi\ignorespaces%
}
@@ -1043,10 +1043,10 @@
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
\ifnum\pgf@xa<0\relax% move into first quadrant
- \pgf@x=-\pgf@x%
+ \global\pgf@x=-\pgf@x%
\fi%
\ifnum\pgf@ya<0\relax%
- \pgf@y=-\pgf@y%
+ \global\pgf@y=-\pgf@y%
\fi%
\pgf@xc=.125\pgf@x%
\pgf@yc=.125\pgf@y%
@@ -1054,62 +1054,62 @@
\c@pgf@countb=\pgf@yc%
\ifnum\c@pgf@countb<\c@pgf@counta%
\ifnum\c@pgf@counta<255\relax%
- \pgf@y=\pgf@yb\relax%
- \pgf@x=0pt\relax%
+ \global\pgf@y=\pgf@yb\relax%
+ \global\pgf@x=0pt\relax%
\else%
\pgf@xc=8192pt%
\divide\pgf@xc by\c@pgf@counta% \pgf@xc = 1/\pgf@x
- \pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@y%
- \pgf@y=\pgf@sys@tonumber{\pgf@xb}\pgf@y%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@y%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xb}\pgf@y%
\ifnum\pgf@y<\pgf@yb%
- \pgf@x=\pgf@xb%
+ \global\pgf@x=\pgf@xb%
\else% rats, calculate intersection on upper side
\ifnum\c@pgf@countb<255\relax%
- \pgf@x=\pgf@xb\relax%
- \pgf@y=0pt\relax%
+ \global\pgf@x=\pgf@xb\relax%
+ \global\pgf@y=0pt\relax%
\else%
\pgf@yc=8192pt%
\divide\pgf@yc by\c@pgf@countb% \pgf@xc = 1/\pgf@x
- \pgf@x=\pgf@sys@tonumber{\pgf@yc}\pgf@x%
- \pgf@x=\pgf@sys@tonumber{\pgf@yb}\pgf@x%
- \pgf@y=\pgf@yb%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@yc}\pgf@x%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@yb}\pgf@x%
+ \global\pgf@y=\pgf@yb%
\fi%
- \fi%
+ \fi%
\fi%
\else%
\ifnum\c@pgf@countb<255\relax%
- \pgf@x=\pgf@xb\relax%
- \pgf@y=0pt\relax%
+ \global\pgf@x=\pgf@xb\relax%
+ \global\pgf@y=0pt\relax%
\else%
\pgf@yc=8192pt%
\divide\pgf@yc by\c@pgf@countb% \pgf@xc = 1/\pgf@x
- \pgf@x=\pgf@sys@tonumber{\pgf@yc}\pgf@x%
- \pgf@x=\pgf@sys@tonumber{\pgf@yb}\pgf@x%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@yc}\pgf@x%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@yb}\pgf@x%
\ifnum\pgf@x<\pgf@xb%
- \pgf@y=\pgf@yb%
+ \global\pgf@y=\pgf@yb%
\else%
\ifnum\c@pgf@counta<255\relax%
- \pgf@y=\pgf@yb\relax%
- \pgf@x=0pt\relax%
+ \global\pgf@y=\pgf@yb\relax%
+ \global\pgf@x=0pt\relax%
\else%
\pgf@xc=8192pt%
\divide\pgf@xc by\c@pgf@counta% \pgf@xc = 1/\pgf@x
- \pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@y%
- \pgf@y=\pgf@sys@tonumber{\pgf@xb}\pgf@y%
- \pgf@x=\pgf@xb%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@y%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xb}\pgf@y%
+ \global\pgf@x=\pgf@xb%
\fi%
- \fi%
+ \fi%
\fi%
- \fi%
- \ifnum\pgf@xa<0\relax\pgf@x=-\pgf@x\fi%
- \ifnum\pgf@ya<0\relax\pgf@y=-\pgf@y\fi%
+ \fi%
+ \ifnum\pgf@xa<0\relax\global\pgf@x=-\pgf@x\fi%
+ \ifnum\pgf@ya<0\relax\global\pgf@y=-\pgf@y\fi%
}
% An approximation to a point on an ellipse in a certain
-% direction. Will be exact only if the ellipse is a circle.
+% direction. Will be exact only if the ellipse is a circle.
%
% #1 = a point pointing in some direction
% #2 = upper right corner of a bounding box for the ellipse
@@ -1128,44 +1128,44 @@
\pgf@ya=\pgf@y%
\ifdim\pgf@xa=\pgf@ya% circle. that's easy!
\pgf@process{\pgfpointnormalised{#1}}%
- \pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@x%
- \pgf@y=\pgf@sys@tonumber{\pgf@xa}\pgf@y%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@x%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xa}\pgf@y%
\else%
\ifdim\pgf@xa<\pgf@ya%
% Ok, first, let's compute x/y:
\c@pgf@countb=\pgf@ya%
\divide\c@pgf@countb by65536\relax%
- \divide\pgf@x by\c@pgf@countb%
- \divide\pgf@y by\c@pgf@countb%
+ \global\divide\pgf@x by\c@pgf@countb%
+ \global\divide\pgf@y by\c@pgf@countb%
\pgf@xc=\pgf@x%
\pgf@yc=8192pt%
- \pgf@y=.125\pgf@y%
+ \global\pgf@y=.125\pgf@y%
\c@pgf@countb=\pgf@y%
\divide\pgf@yc by\c@pgf@countb%
\pgf@process{#1}%
- \pgf@y=\pgf@sys@tonumber{\pgf@yc}\pgf@y%
- \pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@y%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@yc}\pgf@y%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@y%
\pgf@process{\pgfpointnormalised{}}%
- \pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@x%
- \pgf@y=\pgf@sys@tonumber{\pgf@ya}\pgf@y%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@x%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@ya}\pgf@y%
\else%
% Ok, now let's compute y/x:
\c@pgf@countb=\pgf@xa%
\divide\c@pgf@countb by65536\relax%
- \divide\pgf@x by\c@pgf@countb%
- \divide\pgf@y by\c@pgf@countb%
+ \global\divide\pgf@x by\c@pgf@countb%
+ \global\divide\pgf@y by\c@pgf@countb%
\pgf@yc=\pgf@y%
\pgf@xc=8192pt%
- \pgf@x=.125\pgf@x%
+ \global\pgf@x=.125\pgf@x%
\c@pgf@countb=\pgf@x%
\divide\pgf@xc by\c@pgf@countb%
\pgf@process{#1}%
- \pgf@x=\pgf@sys@tonumber{\pgf@yc}\pgf@x%
- \pgf@x=\pgf@sys@tonumber{\pgf@xc}\pgf@x%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@yc}\pgf@x%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@xc}\pgf@x%
\pgf@process{\pgfpointnormalised{}}%
- \pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@x%
- \pgf@y=\pgf@sys@tonumber{\pgf@ya}\pgf@y%
- \fi%
+ \global\pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@x%
+ \global\pgf@y=\pgf@sys@tonumber{\pgf@ya}\pgf@y%
+ \fi%
\fi%
}
@@ -1174,7 +1174,7 @@
% Extract the x-coordinate of a point to a dimensions
-%
+%
% #1 = a TeX dimension
% #2 = a point
%
@@ -1190,7 +1190,7 @@
% Extract the y-coordinate of a point to a dimensions
-%
+%
% #1 = a TeX dimension
% #2 = a point
%
@@ -1205,11 +1205,10 @@
#1=\pgf@y\relax}
-% Stores the most recently used (x,y) coordinates into two macros, #1
-% and #2.
+% 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}%
+ \edef#1{\the\pgf@x}%
+ \edef#2{\the\pgf@y}%
}%
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 d5817ce4282..21e115846fc 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.3 2008/10/09 16:46:56 tantau Exp $
+\ProvidesFileRCS{pgfcorequick.code.tex}
% Quick version of basic drawing commands. Most high-level commands
% are not available if these commands are used.
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex
new file mode 100644
index 00000000000..ae7e5351716
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex
@@ -0,0 +1,228 @@
+% Copyright 2016 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{pgfcorerdf.code.tex}
+
+
+
+%
+%
+% The Resource Description Framework (RDF) is a method of enriching
+% output files with semantic information. In PGF, you can use the
+% following commands to create RDF information that will be inserted
+% into the output, provided the output format allows this (SVG
+% does). You call any of these commands before an ID-scope and it will
+% attach the attribute(s) to this id scope.
+%
+%
+% Example:
+%
+% ...
+% \pgfrdftypeof{http://purl.org/dc/dcmitype/Image}
+% \pgfrdfresource{/paper/figures/1}
+% \pgfidscope
+% % This ID scope will be flagged as the resource "/paper/figures/1"
+% % and typeof "Image" from the Dublin Core.
+% ...
+% \endidscope
+
+
+
+
+
+% Adds the rdf attribute "about" with value #1 to the next
+% idscope.
+%
+% #1 = A URL
+%
+% Description:
+%
+% The RDF-spec says: "a SafeCURIEorCURIEorIRI, used for stating what
+% the data is about (a 'subject' in RDF terminology);"
+
+\def\pgfrdfabout#1{\pgfsys@rdf@about{#1}}
+
+
+
+% Adds the rdf attribute content with value #1 to the next
+% idscope.
+%
+% #1 = A URL
+%
+% Description:
+%
+% The RDF-spec says: "a CDATA string, for supplying machine-readable
+% content for a literal (a 'literal object', in RDF terminology);"
+
+\def\pgfrdfcontent#1{\pgfsys@rdf@content{#1}}
+
+
+
+% Adds the rdf attribute datatype with value #1 to the next
+% idscope.
+%
+% #1 = A URL
+%
+% Description:
+%
+% The RDF-spec says: "a TERMorCURIEorAbsIRI representing a datatype,
+% to express the datatype of a literal;"
+
+\def\pgfrdfdatatype#1{\pgfsys@rdf@datatype{#1}}
+
+
+
+% Adds the rdf attribute href with value #1 to the next idscope
+% The RDF-spec says: "a traditionally navigable IRI for
+% expressing the partner resource of a relationship (a 'resource object', in RDF terminology);"
+
+\def\pgfrdfhref#1{\pgfsys@rdf@href{#1}}
+
+
+
+% Adds the rdf attribute inlist to the next idscope.
+%
+% Description:
+%
+% The RDF-spec says: "An attribute used to indicate that the object
+% associated with a rel or property attribute on the same element is
+% to be added to the list for that predicate. Presence of this
+% attribute causes a list to be created if it does not already exist."
+
+\def\pgfrdfinlist{\pgfsys@rdf@inlist}
+
+
+
+
+% Adds #1 to the list of the rdf prefix attribute to the next
+% idscope.
+%
+% #1 = A URL
+%
+% Description:
+%
+% Can be called several times, in which case all values of #1 are
+% concatenated with whitespaces. The RDF-spec says: "a white space
+% separated list of prefix-name IRI pairs of the form NCName ':' ' '+
+% xsd:anyURI"
+
+\def\pgfrdfprefix#1{\pgfsys@rdf@prefix{#1}}
+
+
+
+
+% Adds #1 to the list of the rdf property attribute to the next
+% idscope.
+%
+% #1 = A URL
+%
+% Description:
+%
+% Can be called repeatedly. The RDF-spec says: "a white space
+% separated list of TERMorCURIEorAbsIRIs, used for expressing
+% relationships between a subject and either a resource object if
+% given or some literal text (also a 'predicate');"
+
+\def\pgfrdfproperty#1{\pgfsys@rdf@property{#1}}
+
+
+
+% Adds #1 to the list of the rdf rel attribute to the next
+% next idscope.
+%
+% #1 = A URL
+%
+% Description:
+%
+% Can be called repeatedly. The RDF-spec says: "a white space
+% separated list of TERMorCURIEorAbsIRIs, used for expressing
+% relationships between two resources ('predicates' in RDF
+% terminology);"
+
+\def\pgfrdfrel#1{\pgfsys@rdf@rel{#1}}
+
+
+% Adds the rdf attribute resource with value #1 to the next idscope.
+%
+% #1 = A URL
+%
+% Description:
+%
+% The RDF-spec says: "a SafeCURIEorCURIEorIRI for expressing the
+% partner resource of a relationship that is not intended to be
+% navigable (e.g., a 'clickable' link) (also an 'object');"
+
+\def\pgfrdfresource#1{\pgfsys@rdf@resource{#1}}
+
+
+
+
+% Adds #1 to the list of the rdf rev attribute to the next
+% idscope.
+%
+% #1 = A URL
+%
+% Description:
+%
+% Can be called repeatedly. The RDF-spec says: "a white space
+% separated list of TERMorCURIEorAbsIRIs, used for expressing reverse
+% relationships between two resources (also 'predicates');
+
+\def\pgfrdfrev#1{\pgfsys@rdf@rev{#1}}
+
+
+
+
+% Adds an rdf attribute src with value #1 to the next idscope.
+%
+% #1 = A URL
+%
+% Description:
+%
+% The RDF-spec says: "an IRI for expressing the partner resource of a
+% relationship when the resource is embedded (also a 'resource object');"
+
+\def\pgfrdfsrc#1{\pgfsys@rdf@src{#1}}
+
+
+
+
+% Adds #1 to the list of the rdf typeof attribute to the next
+% idscope.
+%
+% #1 = A URL
+%
+% Description:
+%
+% Can be called repeatedly. The RDF-spec says: "a white space
+% separated list of TERMorCURIEorAbsIRIs that indicate the RDF type(s)
+% to associate with a subject;"
+
+\def\pgfrdftypeof#1{\pgfsys@rdf@typeof{#1}}
+
+
+
+
+% Adds an rdf attribute vocab with value #1 to the next idscope.
+%
+% #1 = A URL
+%
+% Description:
+%
+% The RDF-spec says: "an IRI that defines the mapping to use when a
+% TERM is referenced in an attribute value. See General Use of Terms
+% in Attributes and the section on Vocabulary Expansion."
+
+\def\pgfrdfvocab#1{\pgfsys@rdf@vocab{#1}}
+
+
+
+
+
+\endinput
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 02687fc29c3..50a820f6126 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.46 2015/05/08 10:23:50 tantau Exp $
+\ProvidesFileRCS{pgfcorescopes.code.tex}
% Globals
@@ -37,7 +37,7 @@
% Pgf scope environment. All changes of the graphic state are local to
% the scope.
-%
+%
% Example:
%
% \begin{pgfscope}
@@ -64,30 +64,30 @@
% Quickly insert a box can contain normal TeX text at the origin.
-%
+%
% #1 = box of width/height and depth 0pt
-%
+%
% Example:
%
% \pgfqbox{\mybox}
\def\pgfqbox#1{%
\pgfsys@hbox#1%
-}
+}
% Insert a box that can contain normal TeX text at the origin, but
% with the current coordinate transformation matrix synced with the
% low-level transformation matrix.
-%
+%
% #1 = box of width/height and depth 0pt
%
% In essence, this command does the same as if you first said
% \pgflowlevelsynccm and then \pgfqbox. However, pgf will use a
% ``TeX-translation'' for the translation part of the transformation
% cm. This will ensure that hyperlinks ``survive'' at least
-% translations.
-%
+% translations.
+%
% Example:
%
% \pgfqboxsynced{\mybox}
@@ -99,11 +99,11 @@
% Puts some text in a box and inserts it with the current
% transformations applied.
-%
+%
% #1 = List of optional positioning. Possible values are ``left'', ``right'',
% ``top'', ``bottom'' and ``base''.
% #2 = TeX text. May contain verbatims.
-%
+%
% Example:
%
% \pgftransformshift{\pgfpoint{1cm}{0cm}}
@@ -173,7 +173,7 @@
\def\pgf@textdone{%
\endpgfinterruptpicture%
\egroup%
- \pgf@@maketextafter%
+ \pgf@@maketextafter%
}
\long\def\pgf@makehbox#1{%
@@ -248,10 +248,10 @@
\def\endpgfpicture{%
\ifpgfrememberpicturepositiononpage%
\hbox to0pt{\pgfsys@markposition{\pgfpictureid}}%
- \fi%
+ \fi%
% ok, now let's position the box
\ifdim\pgf@picmaxx=-16000pt\relax%
- % empty picture. make size 0.
+ % empty picture. make size 0.
\global\pgf@picmaxx=0pt\relax%
\global\pgf@picminx=0pt\relax%
\global\pgf@picmaxy=0pt\relax%
@@ -261,14 +261,14 @@
\pgf@relevantforpicturesizefalse%
\pgf@process{\pgf@baseline}%
\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.
@@ -282,7 +282,7 @@
\egroup%
\pgf@restore@layerlist@from@global
\pgf@insertlayers%
- \endgroup%
+ \endgroup%
\pgfsys@discardpath%
\endgroup%
\pgfsys@endscope%
@@ -328,7 +328,7 @@
%
% Sets the baseline of the picture to the y-coordinate of a given
% point. However, the point will be evaluated *at the end of the
-% picture*.
+% picture*.
%
% Example:
%
@@ -434,7 +434,7 @@
% The environment can be used to insert some drawing commands while
% constructing a path. The drawing commands inside the environment
% will not interfere with the path being constructed ``outside.''
-% However, you must ward against graphic state changes using a scope.
+% However, you must ward against graphic state changes using a scope.
%
% Example: Draw two parallel lines
%
@@ -458,7 +458,6 @@
\pgfsyssoftpath@setcurrentpath\pgfutil@empty%
\edef\pgfscope@linewidth{\the\pgflinewidth}%
\let\pgf@interrupt@lastmoveto=\pgfsyssoftpath@lastmoveto%
- \let\pgf@interrupt@nlt@infos=\pgf@nlt@infos%
\begingroup%
}
\def\endpgfinterruptpath
@@ -470,7 +469,6 @@
\global\pgf@path@lastx\pgf@interrupt@savex%
\global\pgf@path@lasty\pgf@interrupt@savey%
\global\let\pgfsyssoftpath@lastmoveto\pgf@interrupt@lastmoveto%
- \global\let\pgf@nlt@infos=\pgf@interrupt@nlt@infos%
\endgroup%
}
@@ -483,9 +481,9 @@
% The environment can be used to temporarily setup a new bounding box
% computation. The bounding box will be made empty at the beginning of
% the environment and will be reset to its old value after the
-% environment.
+% environment.
%
-% Example:
+% Example:
%
% \begin{pgfinterruptboundinbox}
% \pgfmoveto{\pgfpoint{1cm}{0cm}}
@@ -519,6 +517,190 @@
+% Creates an id scope.
+%
+% Description:
+%
+% An id scope is not (conceptually) a graphic scope, but a scope that
+% has a unique name or "id". This id can be used as a reference point
+% for instance for a hyperlink or for an animation (currently, only
+% SVG supports ids, all other drivers ignore id scopes).
+%
+% Prior to using \pgfidscope, call \pgfuseid to install an
+% id (and possibly \pgfusetype). The scope will then get this id and,
+% likely, a graphic scope is installed. If \pgfuseid has not been
+% called or if you try to call \pgfidscope again for the same id,
+% nothing happens (except for a \TeX\ group being established).
+
+\def\pgfidscope{\pgfsys@begin@idscope}
+\def\endpgfidscope{\pgfsys@end@idscope}
+
+\let\startpgfidscope\pgfidscope
+\let\stoppgfidscope\pgfendidscope
+
+
+
+
+% Use an id on the next graphic object
+%
+% #1 = a name
+%
+% The next scope or path can be the target of an animation command or
+% a hyperlink.
+
+\def\pgfuseid#1{%
+ \edef\pgf@temp{#1}%
+ \ifx\pgf@temp\pgfutil@empty%
+ \else%
+ \pgf@lookup@id{#1}%
+ \pgfsys@use@id{\pgf@next@id}%
+ \expandafter\xdef\csname pgf@id@names@#1\endcsname{{\pgf@next@id}{}}%
+ \fi%
+}
+
+\def\pgf@lookup@id#1{%
+ \expandafter\let\expandafter\pgf@id@name\csname pgf@id@names@#1\endcsname%
+ \ifx\pgf@id@name\relax%
+ \let\pgf@prev@id\pgfutil@empty%
+ \let\pgf@next@id\pgfutil@empty%
+ \else%
+ \expandafter\pgf@id@parse\pgf@id@name%
+ \fi%
+ \ifx\pgf@next@id\pgfutil@empty%
+ \pgfsys@new@id\pgf@next@id%
+ \expandafter\xdef\csname pgf@id@names@#1\endcsname{{\pgf@prev@id}{\pgf@next@id}}%
+ \fi%
+}
+\def\pgf@id@parse#1#2{%
+ \def\pgf@prev@id{#1}%
+ \def\pgf@next@id{#2}%
+}
+
+
+
+% Clear the current id
+%
+% Description:
+%
+% Sets the current id to be empty so that it cannot be referenced.
+
+\def\pgfclearid{%
+ \pgfsys@clear@id%
+}
+
+
+% Get the id that will be given to a name upon the next use
+%
+% #1 = a macro
+% #2 = a name
+%
+% Description:
+%
+% #1 will get the id that will be used by \pgfuseid next time for the
+% given name.
+
+\def\pgfidrefnextuse#1#2{%
+ \edef\pgf@temp{#2}\ifx\pgf@temp\pgfutil@empty\pgferror{Missing name reference for ``\string#1''}\fi%
+ \pgf@lookup@id{#2}%
+ \let#1\pgf@next@id%
+}
+
+
+% Get the id was last used
+%
+% #1 = a macro
+% #2 = a name
+%
+% Description:
+%
+% #1 will get the id that was last used by \pgfuseid for #2.
+
+\def\pgfidrefprevuse#1#2{%
+ \edef\pgf@temp{#2}\ifx\pgf@temp\pgfutil@empty\pgferror{Missing name reference for ``\string#1''}\fi%
+ \pgf@lookup@id{#2}%
+ \let#1\pgf@prev@id%
+}
+
+
+% Use a type
+%
+% #1 = an id type; when starting with a dot, it is added to the
+% current type.
+%
+% The next scope or path can be the target of an animation command or
+% a hyperlink.
+
+\def\pgfusetype#1{%
+ \edef\pgf@temp{#1}%
+ \expandafter\pgfutil@ifnextchar\expandafter.\expandafter\pgf@id@use@type@add\expandafter\pgf@id@use@type@replace\pgf@temp\pgf@stop
+}
+\def\pgf@id@use@type@add.#1\pgf@stop{\pgfsys@append@type{#1}}
+\def\pgf@id@use@type@replace#1\pgf@stop{\pgfsys@use@type{#1}}
+
+% Push the current type on a global stack
+%
+% Description:
+%
+% The current type is pushed onto a global type stack. It can be
+% restored using \pgfpoptype.
+
+\def\pgfpushtype{\pgfsys@push@type}
+
+
+% Pop a type from the type stack
+%
+% Description:
+%
+% Restores the most current value from the type stack.
+
+\def\pgfpoptype{\pgfsys@pop@type}
+
+
+
+
+% Alias an id locally or globally
+%
+% #1 = the alias name
+% #2 = a existing id name
+%
+% Description:
+%
+% Creates an alias of a name
+
+\def\pgfaliasid#1#2{%
+ \expandafter\let\expandafter\pgf@temp\csname pgf@id@names@#2\endcsname%
+ \expandafter\let\csname pgf@id@names@#1\endcsname\pgf@temp%
+}
+\def\pgfgaliasid#1#2{%
+ \expandafter\let\expandafter\pgf@temp\csname pgf@id@names@#2\endcsname%
+ \expandafter\global\expandafter\let\csname pgf@id@names@#1\endcsname\pgf@temp%
+}
+
+
+% Check whether a name has been forward-referenced
+%
+% #1 = a name
+% #2 = what to do, when has been forward-referenced
+% #3 = what to do otherwise
+%
+% Description:
+%
+% Depending on whether #1 has been forward-referenced, #2 or #3 will be executed.
+
+\def\pgfifidreferenced#1#2#3{%
+ \expandafter\let\expandafter\pgf@id@name\csname pgf@id@names@#1\endcsname%
+ \ifx\pgf@id@name\relax%
+ #3%
+ \else
+ \expandafter\pgf@id@parse\pgf@id@name%
+ \ifx\pgf@next@id\pgfutil@empty%
+ #3%
+ \else%
+ #2%
+ \fi%
+ \fi%
+}
+
% Interrupts a picture
%
@@ -528,7 +710,7 @@
% normal TeX mode. All sorts of things are saved and restored by this
% environment.
%
-% WARNING: Using this environment in conjuction with low level
+% WARNING: Using this environment in conjunction with low level
% transformations can *strongly* upset the typesetting. Typically, the
% contents of this environment should have size/height/depth 0pt in
% the end.
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 86bd57c32fe..971752304a7 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.15 2013/07/15 14:24:02 tantau Exp $
+\ProvidesFileRCS{pgfcoreshade.code.tex}
%
% Parsing functions
@@ -170,11 +170,11 @@
% "rgb(1cm)=(1,0,0)". Multiple specifications are separated by a
% semicolon and a space. At least two specifications must be
% given. The specified positions must be given in increasing
-% order.
+% order.
%
% Description:
%
-% The optional dependecies have the following effect: If present, it
+% The optional dependencies have the following effect: If present, it
% should consist of a list of colors, separated by commas. Each time
% the shading is used, these colors will be reevaluated. It will be
% checked whether the colors still have their "original meaning". If
@@ -204,12 +204,12 @@
\fi}
-% Declares a vertical shading for later use.
+% Declares a vertical shading for later use.
%
-% #1 = optinal dependecies
+% #1 = optional dependencies
% #2 = name of the shading for later use
% #3 = height of the shading
-% #4 = color specification
+% #4 = color specification
%
% Example:
%
@@ -234,12 +234,12 @@
\fi}
-% Declares a radial shading for later use.
+% Declares a radial shading for later use.
%
% #1 = optional dependencies
% #2 = name of the shading for later use
% #3 = center of inner circle
-% #4 = color specification
+% #4 = color specification
%
% Description:
%
@@ -248,7 +248,7 @@
% radius is the start of the color specification. The
% center of the outer circle is at the center of the whole shading,
% whose radius is the end of the color specification. For example,
-% suppose the color specification is "rgb(1cm)=(1,1,1); rgb(2cm)=(0,0,0)".
+% suppose the color specification is "rgb(1cm)=(1,1,1); rgb(2cm)=(0,0,0)".
% Then the shading would be 4cm times 4cm large. The inner circle would
% have diameter 1cm and the outer circle would have diameter 2cm. The
% outer circle would be centered in the middle of the shading, whereas
@@ -279,14 +279,14 @@
-% Declares a functional shading for later use.
+% Declares a functional shading for later use.
%
-% #1 = optional dependecies
+% #1 = optional dependencies
% #2 = name of the shading for later use
% #3 = lower left corner of the shading as a pgfpoint.
% #4 = upper right corner of the shading as a pgfpoint.
% #5 = Preparation code
-% #6 = a PDF type 4 function (restricted Postscript function), see the
+% #6 = a PDF type 4 function (restricted Postscript function), see the
% PDF-specification 1.7, section 3.9.4
%
% Description:
@@ -297,7 +297,7 @@
% color as an output. Note that the function is evaluated by the
% *renderer*, not by PGF or TeX or someone else at compile-time. This
% means that the evaluation of this function has to be done *extremely
-% quickly* and the funciton should be *very simple*. For this reason,
+% quickly* and the function should be *very simple*. For this reason,
% only a very restricted set of operations are possible in the
% function (see 3.9.4 of the PDF-spec 1.7). Also functions should be
% kept small. Any errors in the function will only be noticed by the
@@ -318,9 +318,9 @@
%
% Because of the rather difficult PostScript syntax, use this macro
% only *if you know what you are doing* (or if you are advanterous, of
-% course).
+% course).
%
-% As for other shadings, the optional depencies argument is used to
+% As for other shadings, the optional dependencies argument is used to
% determine whether a shading needs to be recalculated when a color
% has changed.
%
@@ -331,10 +331,10 @@
% Inside the PostScript function #6 you cannot use colors
% directly. Rather, you must push the color components on the
% stack. For this, it is useful to call \pgfshadergb in the startup
-% code #4. The macro takes a color name as input and stores the color's
+% code #4. 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.
+% a stack) in a macro.
%
% Example:
%
@@ -412,7 +412,7 @@
% Inserts a box into the text that contains a previously defined
-% shading.
+% shading.
%
% #1 = Name of a shading
%
@@ -467,7 +467,7 @@
\ifpgfpicture%
\pgfsys@shadinginsidepgfpicture{#1}%
\else%
- \pgfsys@shadingoutsidepgfpicture{#1}%
+ \pgfsys@shadingoutsidepgfpicture{#1}%
\fi%
}
@@ -533,7 +533,7 @@
\ifdim\pgf@pathminx=16000pt%
\pgfwarning{No path specified that can be filled}%
\else%
- \begingroup%
+ \begingroup%
% Calculate center:
\pgf@xb=.5\pgf@pathmaxx%
\advance\pgf@xb by.5\pgf@pathminx%
@@ -573,7 +573,7 @@
\fi%
\pgfuseshading{#1}%
\pgfsys@endscope%
- \fi%
+ \fi%
\endgroup%
\fi%
}
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 5e13c6cb660..961c657e8cd 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.20 2015/08/07 10:17:34 cfeuersaenger Exp $
+\ProvidesFileRCS{pgfcoretransformations.code.tex}
% Position transformations
@@ -34,7 +34,7 @@
% \pgfgettransform\mytransform
\def\pgfgettransform#1{%
- \edef#1{{\pgf@pt@aa}{\pgf@pt@ab}{\pgf@pt@ba}{\pgf@pt@bb}{\the\pgf@pt@x}{\the\pgf@pt@y}}
+ \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
@@ -50,7 +50,7 @@
% \pgfgettransform\aa\ab\ba\bb\shiftx\shifty
%
% ->
-%
+%
% \pgftransformcm\aa\ab\ba\bb{\pgfqpoint{\shiftx}{\shifty}}
%
% or
@@ -127,6 +127,18 @@
\advance#1 by\pgf@pt@x%
\advance#2 by\pgf@pt@y%
}
+\def\pgf@pos@transform@glob{%
+ \ifpgf@pt@identity%
+ \else%
+ \pgf@pt@temp=\pgf@x%
+ \global\pgf@x=\pgf@pt@aa\pgf@x%
+ \global\advance\pgf@x by\pgf@pt@ba\pgf@y%
+ \global\pgf@y=\pgf@pt@bb\pgf@y%
+ \global\advance\pgf@y by\pgf@pt@ab\pgf@pt@temp%
+ \fi%
+ \global\advance\pgf@x by\pgf@pt@x%
+ \global\advance\pgf@y by\pgf@pt@y%
+}
% Invert the current transformation matrix
@@ -135,7 +147,7 @@
%
% This command replaces the current transformation matrix by its
% inverse. The inversion is not very exact if the matrix is nearly
-% singular.
+% singular.
%
% Example:
%
@@ -196,7 +208,7 @@
% PGF-Level concatenation of the transformation matrix with a given
-% matrix.
+% matrix.
%
% #1 - #5 = a concatenation matrix (see pdf spec). Entry #5 is a
% translation point.
@@ -213,7 +225,7 @@
%
% \pgftransformcm{1}{0}{0}{1}{\pgfpoint{100pt}{0pt}} % 100pt to the right.
%
-% \pgftransformcm{2}{0}{0}{2}{\pgfpointorigin} % double in in size
+% \pgftransformcm{2}{0}{0}{2}{\pgfpointorigin} % double in size
% \pgfpathmoveto{\pgfpoint{0cm}{0cm}}
% \pgfpathlineto{\pgflineto{1cm}{1cm}} % actually 2cm/2cm
@@ -280,7 +292,7 @@
% triangle are called "origin", "x" and "y" are given. After this
% transformation has been applied, the canvas origin is at "origin",
% the vector (1pt,0pt) lies at "x" and the vector (0pt,1pt) lies at
-% "y".
+% "y".
%
% #1 = origin
% #2 = x
@@ -419,14 +431,14 @@
%
% \ifpgfallowupsidedowattime decides whether the transformation should
% be done in such a way that the text is always ``upright,'' that is,
-% text drawn in this coordiante system is never upside-down.
+% text drawn in this coordinate system is never upside-down.
%
% \ifpgfresetnontranslationattime decides whether the coordinate
% system of an xxxattime transformation command should be reset
% (concerning the non-translations) before a possible rotation is
% applied. This is useful, for example, if the main coordinate system
% is scaled by, say, a factor of 2 and you do not want that to apply
-% to the text, but you do want the rotation to applyu.
+% to the text, but you do want the rotation to apply.
\newif\ifpgfslopedattime
\newif\ifpgfallowupsidedownattime
@@ -469,7 +481,7 @@
\advance\pgf@yc by-\pgf@yb%
\ifpgfallowupsidedownattime%
\else%
- \ifdim\pgf@xc<0pt%
+ \ifdim\pgf@xc<0pt%
\pgf@xc=-\pgf@xc%
\pgf@yc=-\pgf@yc%
\fi%
@@ -503,7 +515,7 @@
% }
\def\pgftransformarcaxesattime#1#2#3#4#5#6{%
- \pgfpointarcaxesattime{#1}{#2}{#3}{#4}{#5}{#6}%
+ \pgfpointarcaxesattime{#1}{#2}{#3}{#4}{#5}{#6}%
\pgftransformshift{\pgfqpoint{\pgf@x}{\pgf@y}}%
\ifpgfresetnontranslationattime%
\pgftransformresetnontranslations%
@@ -612,10 +624,10 @@
% Computes transformations adjustments for the current transformation
-% matrix
+% matrix
%
% Description:
-%
+%
% This command is used when you install a transformation matrix that
% scales everything by a certain factor, but you still wish to draw
% something with "an absolute size". Suppose for instance that you
@@ -624,18 +636,18 @@
% if you do not reset the transformation matrix, you can draw a line
% of logical length 2.5mm, which will then get scaled to a line of
% 1cm.
-%
+%
% Things get more difficult in case you scale things only, say,
-% vertically. In this case, the adjustement necessary for horizontal
+% vertically. In this case, the adjustment necessary for horizontal
% lines is different from the one needed for vertical lines.
-%
+%
% This function computes the necessary scaling factors and puts them
% in the macros \pgfhorizontaltransformationadjustment and
% \pgfverticaltransformationadjustment.
-%
+%
% Note that the "right" way to draw a line of absolute length 1cm in a
% transformed coordinate system is to first compute the start point
-% and to then reset the transformation matrix. The transofmration
+% and to then reset the transformation matrix. The transformation
% adjustments computed here are important only in situations where you
% cannot do this, for instance when an "outer xsep" must be set.
@@ -660,7 +672,7 @@
\let\pgfhorizontaltransformationadjustment\pgf@temp@hori%
\let\pgfverticaltransformationadjustment\pgf@temp@vert%
\fi%
-}
+}
\let\pgfhorizontaltransformationadjustment\pgf@one@text
\let\pgfverticaltransformationadjustment\pgf@one@text
@@ -685,12 +697,12 @@
{\pgf@pt@x}{\pgf@pt@y}%
\pgftransformreset%
\pgf@relevantforpicturesizefalse%
-}
+}
% Causes a transformation command to be applied to the ``lowlevel''
-% transformation matrix.
+% transformation matrix.
%
% #1 - a high-level transformation command
%
@@ -706,7 +718,7 @@
%
% \pgflowlevel{\pgftransformcm{1}{0}{0}{1}{\pgfpoint{100pt}{0pt}}} % 100bp to the right.
%
-% \begin{pgflowlevelscope}{\pgftransformcm{2}{0}{0}{2}{\pgfpointorigin}} % double in in size
+% \begin{pgflowlevelscope}{\pgftransformcm{2}{0}{0}{2}{\pgfpointorigin}} % double in size
% \pgfmoveto{\pgfpoint{0cm}{0cm}}
% \pgflineto{\pgflineto{1cm}{1cm}} % actually 2cm/2cm
% \end{pgflowlevelscope}
@@ -727,6 +739,74 @@
+% View boxes
+
+% Establishes a view box scope
+%
+% #1 and #2 = two opposite corners of the source rectangle
+% #3 and #4 = two opposite corners of the target rectangle
+% #5 = "meet" or "slice"
+%
+% Description:
+%
+% Inside the viewbox scope, the source rectangle will be translated
+% and scaled so that it becomes centered on the target rectangle and
+% will, for "meet", be as large as possible so that it fits inside the
+% target and, for "slice", be as small as possible so that it
+% encompasses the target.
+
+\def\pgfviewboxscope#1#2#3#4#5{%
+ {% Compute rectangle corners
+ \pgf@process{#1}%
+ \pgf@pos@transform@glob
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{#2}%
+ \pgf@pos@transform@glob
+ \ifdim\pgf@x<\pgf@xa%
+ \pgf@xb\pgf@x%
+ \pgf@xc\pgf@xa%
+ \else%
+ \pgf@xb\pgf@xa%
+ \pgf@xc\pgf@x%
+ \fi%
+ \ifdim\pgf@y<\pgf@ya%
+ \pgf@yb\pgf@y%
+ \pgf@yc\pgf@ya%
+ \else%
+ \pgf@yb\pgf@ya%
+ \pgf@yc\pgf@y%
+ \fi%
+ \pgf@process{#3}%
+ \pgf@pos@transform@glob
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{#4}%
+ \pgf@pos@transform@glob
+ \ifdim\pgf@x<\pgf@xa%
+ \else%
+ \pgfutil@tempdima\pgf@x
+ \pgf@x\pgf@xa%
+ \pgf@xa\pgfutil@tempdima%
+ \fi%
+ \ifdim\pgf@y<\pgf@ya%
+ \else%
+ \pgfutil@tempdima\pgf@y
+ \pgf@y\pgf@ya%
+ \pgf@ya\pgfutil@tempdima%
+ \fi%
+ \pgfusetype{.view}%
+ \edef\pgf@marshal{\expandafter\noexpand\csname pgfsys@viewbox#5\endcsname{\the\pgf@x}{\the\pgf@y}{\the\pgf@xa}{\the\pgf@ya}{\the\pgf@xb}{\the\pgf@yb}{\the\pgf@xc}{\the\pgf@yc}}%
+ \pgf@marshal%
+ }%
+ \pgf@relevantforpicturesizefalse%
+}
+
+\def\endpgfviewboxscope{\pgfsys@endviewbox}
+
+\let\startpgfviewboxscope=\pgfviewboxscope
+\let\stoppgfviewboxscope=\endpgfviewboxscope
+
% Forward declarations for nonlinear stuff (have no effect till module
% nonlineartransformations is loaded)
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex
index 47484997af7..181450ac27a 100644
--- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex
@@ -7,13 +7,13 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoretransparency.code.tex,v 1.5 2013/09/30 18:30:15 tantau Exp $
+\ProvidesFileRCS{pgfcoretransparency.code.tex}
% Sets the opacity of stroking operations.
-%
+%
% #1 = opacity, where 1 means fully opaque and 0 means fully
-% transparent.
+% transparent.
%
% Example:
%
@@ -25,9 +25,9 @@
% Sets the opacity of stroking operations.
-%
+%
% #1 = opacity, where 1 means fully opaque and 0 means fully
-% transparent.
+% transparent.
%
% Example:
%
@@ -40,8 +40,8 @@
% Sets the current blend mode. See Section 7.2.4 of the PDF
-% Specification 1.7 for an introduction to blend modes in general.
-%
+% Specification 1.7 for an introduction to blend modes in general.
+%
% #1 = One of the following modes, see also section 7.2.4 of the
% PDF Specification 1.7. (The PGF names, which are all lowercase with
% spaces as usual, must be mapped to the PDF or SVG by the drivers.)
@@ -81,7 +81,7 @@
% the TeX box. The mask can later be used to mask other graphics.
%
% The box is used to determine where the mask is opaque: At the
-% beginning, the mask is completely transparent. Whereever the box
+% beginning, the mask is completely transparent. Wherever the box
% contains something (like text or a picture or whatever), the
% luminosity of the text/graphic is used to determine how opaque the
% point will be. The greater the luminosity, the more opaque. The net
@@ -121,7 +121,7 @@
% Description:
%
% The command should be used *inside* a pgfpicture to install a
-% fading. The fading is a part of the graphic state. (This command
+% fading. The fading is a part of the graphic state. (This command
% works much like \pgfsetstrokeopacity).
%
% The mask will be centered on the origin. The transformation code #2 is
@@ -153,7 +153,7 @@
% the additional transformation #2 is applied. Finally, the mask is
% made part of the graphic state (as with \pgfsetfading). The path
% used for computation purposes only -- it is not drawn or otherwise
-% used.
+% used.
%
% If no transformations occur, the lower left corner of the path will
% lie on (25bp, 25bp), the upper right corner on (75bp, 75bp).
@@ -253,13 +253,13 @@
%
% This takes groups pgf commands inside a pgfpicture in a transparency
% group. This means that any transparency settings apply to commands a
-% whole. For instance, if a box contains two overlapping black
+% whole. For instance, if a box contains two overlapping black
% circles and you draw them 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.
%
-%
+%
\def\pgftransparencygroup{%
\pgfutil@ifnextchar[{\pgftransparencygroup@}{\pgftransparencygroup@[]}%
@@ -277,7 +277,7 @@
isolated/.is if=pgfsys@transparency@group@isolated,
knockout/.is if=pgfsys@transparency@group@knockout
}
-
+
\def\endpgftransparencygroup{%
\egroup%
% Now compute the correct position. This is a bit tricky...
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
index e8aeabd2468..56a5340f99e 100644
--- 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
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usetikzlibrary{decorations.markings,calc}
+\usetikzlibrary{calc,decorations.markings}%
%
@@ -23,7 +23,7 @@
\def\tikz@lib@circ@end{-- (\tikztotarget) \tikztonodes}
}
}
-}
+}%
\newif\iftikz@lib@circ@on@to
@@ -75,10 +75,10 @@
\pgfkeysalso{#1}
\fi
}
-}
+}%
\newcount\tikz@lib@circ@count
-\def\tikz@zero@text{0.0}
-\def\tikz@one@text{1.0}
+\def\tikz@zero@text{0.0}%
+\def\tikz@one@text{1.0}%
\def\tikz@lib@circ@compute@direction#1{%
\tikz@scan@one@point\tikz@lib@circ@save@start(\tikztostart)%
@@ -86,9 +86,9 @@
\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}}
+}%
+\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,
@@ -100,7 +100,7 @@
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
-}
+}%
%
@@ -126,7 +126,7 @@
% 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.
+ % symbols of kind #1.
%
% every #1
% This style will be included with every symbols of this kind and
@@ -154,7 +154,7 @@
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
@@ -199,7 +199,7 @@
/utils/exec={\pgfsetarrowoptions{direction ee}{.4*\the\tikzcircuitssizeunit+.3*\the\pgflinewidth}},
>=direction ee
}
-}
+}%
@@ -211,7 +211,7 @@
point down/.style={rotate=-90},
point left/.style={rotate=180},
point right/.style={}
-}
+}%
@@ -225,7 +225,7 @@
circuit symbol filled/.style={draw,fill=black},
circuit symbol lines/.style={draw},
circuit symbol wires/.style={draw},
-}
+}%
@@ -242,28 +242,25 @@
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.
+ % 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'/.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={[label position=below,every info/.try,every #4/.try,#1]$\mathrm{#2#3}$}}}
-\def\tikz@lib@circ@lab@slopedp[#1]#2\pgf@stop#3#4{\tikzset{label={[label
-position=below,every info/.try,every #4/.try,transform shape,#1]$\mathrm{#2#3}$}}}
+\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={[label position=below,every info/.try,every #4/.try,#1]$\mathrm{#2#3}$}}}%
+\def\tikz@lib@circ@lab@slopedp[#1]#2\pgf@stop#3#4{\tikzset{label={[label position=below,every info/.try,every #4/.try,transform shape,#1]$\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={[label position=below,every info/.try,#1]#2}}}
-\def\tikz@lib@circ@lab@slopedp@plain[#1]#2\pgf@stop{\tikzset{label={[label
-position=below,every info/.try,transform shape,#1]#2}}}
+\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={[label position=below,every info/.try,#1]#2}}}%
+\def\tikz@lib@circ@lab@slopedp@plain[#1]#2\pgf@stop{\tikzset{label={[label position=below,every info/.try,transform shape,#1]#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
index 1de9232e63c..75457107643 100644
--- 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
@@ -7,10 +7,10 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usetikzlibrary{circuits.ee}
-\usetikzlibrary{arrows}
+\usetikzlibrary{arrows}%
+\usetikzlibrary{circuits.ee}%
-\usepgflibrary{shapes.gates.ee.IEC}
+\usepgflibrary{shapes.gates.ee.IEC}%
%
@@ -38,8 +38,8 @@
set current source graphic = current source IEC graphic,
set make contact graphic = make contact IEC graphic,
set break contact graphic = break contact IEC graphic,
- }
-}
+ },
+}%
%
@@ -51,7 +51,7 @@
circuit symbol open,
circuit symbol size=width 4 height 1,
shape=rectangle ee,
- transform shape
+ transform shape,
},
var resistor IEC graphic/.style={
circuit symbol lines,
@@ -59,9 +59,9 @@
shape=var resistor IEC,
transform shape,
outer sep=0pt,
- cap=round
- }
-}
+ cap=round,
+ },
+}%
@@ -76,15 +76,15 @@
transform shape,
shape=inductor IEC,
outer sep=0pt,
- cap=round
+ cap=round,
},
var inductor IEC graphic/.style={
circuit symbol filled,
circuit symbol size=width 4 height 1,
transform shape,
- shape=rectangle ee
- }
-}
+ shape=rectangle ee,
+ },
+}%
@@ -97,9 +97,9 @@
circuit symbol lines,
circuit symbol size=width .5 height 2,
transform shape,
- shape=capacitor IEC
- }
-}
+ shape=capacitor IEC,
+ },
+}%
@@ -112,9 +112,9 @@
circuit symbol lines,
circuit symbol size=width .75 height 2,
transform shape,
- shape=ground IEC
- }
-}
+ shape=ground IEC,
+ },
+}%
@@ -129,9 +129,9 @@
circuit symbol size=width .5 height 2.5,
transform shape,
shape=battery IEC,
- transform shape
- }
-}
+ transform shape,
+ },
+}%
@@ -156,9 +156,9 @@
},
var diode IEC graphic/.style={
diode IEC graphic,
- circuit symbol filled
- }
-}
+ circuit symbol filled,
+ },
+}%
\tikzset{
%
@@ -175,9 +175,9 @@
},
var Zener diode IEC graphic/.style={
Zener diode IEC graphic,
- circuit symbol filled
- }
-}
+ circuit symbol filled,
+ },
+}%
\tikzset{
%
@@ -197,9 +197,9 @@
},
var Schottky diode IEC graphic/.style={
Schottky diode IEC graphic,
- circuit symbol filled
- }
-}
+ circuit symbol filled,
+ },
+}%
\tikzset{
%
@@ -217,12 +217,12 @@
},
var tunnel diode IEC graphic/.style={
tunnel diode IEC graphic,
- circuit symbol filled
- }
-}
+ circuit symbol filled,
+ },
+}%
\tikzset{
- %
+ %
% backward diode
%
backward diode IEC graphic/.style={
@@ -239,9 +239,9 @@
},
var backward diode IEC graphic/.style={
backward diode IEC graphic,
- circuit symbol filled
- }
-}
+ circuit symbol filled,
+ },
+}%
\tikzset{
@@ -256,9 +256,9 @@
},
var breakdown diode IEC graphic/.style={
breakdown diode IEC graphic,
- circuit symbol filled
- }
-}
+ circuit symbol filled,
+ },
+}%
@@ -271,15 +271,15 @@
circuit symbol filled,
circuit symbol size=width .5 height .5,
shape=circle ee,
- outer sep=.25\pgflinewidth
+ 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
-% }
-}
+% outer sep=.25\pgflinewidth,
+% },
+}%
%
@@ -298,9 +298,9 @@
\pgfpathlineto{\pgfpointpolar{135}{1pt}}
\pgfusepathqstroke
},
- transform shape
- }
-}
+ transform shape,
+ },
+}%
%
@@ -317,7 +317,7 @@
\pgfpathlineto{\pgfqpoint{0pt}{1pt}}
\pgfusepathqstroke
},
- transform shape
+ transform shape,
},
voltage source IEC graphic/.style={
circuit symbol lines,
@@ -328,9 +328,9 @@
\pgfpathlineto{\pgfqpoint{1pt}{0pt}}
\pgfusepathqstroke
},
- transform shape
- }
-}
+ transform shape,
+ },
+}%
@@ -345,7 +345,7 @@
transform shape,
shape=make contact IEC,
outer sep=0pt,
- cap=round
+ cap=round,
},
var make contact IEC graphic/.style={
circuit symbol wires,
@@ -353,9 +353,9 @@
transform shape,
shape=var make contact IEC,
outer sep=0pt,
- cap=round
- }
-}
+ cap=round,
+ },
+}%
\tikzset{
@@ -365,12 +365,11 @@
transform shape,
shape=break contact IEC,
outer sep=0pt,
- cap=round
+ 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
index d8337acefcd..9a7108aebfb 100644
--- 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
@@ -8,8 +8,8 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usetikzlibrary{circuits}
-\usepgflibrary{shapes.gates.ee}
+\usetikzlibrary{circuits}%
+\usepgflibrary{shapes.gates.ee}%
%
@@ -20,7 +20,7 @@
circuit,
every circuit ee/.try
}
-}
+}%
%
@@ -50,7 +50,7 @@
%
set current direction graphic = current direction ee graphic,
set current direction' graphic = current direction' ee graphic,
-}
+}%
%
@@ -68,7 +68,7 @@
circuit declare unit={voltampere}{VA},
circuit declare unit={watt}{W},
circuit declare unit={hertz}{Hz},
-}
+}%
@@ -85,7 +85,7 @@
>=direction ee,
direction ee arrow = direction ee,
}
-}
+}%
@@ -103,7 +103,7 @@
current direction ee graphic,
rotate=180
}
-}
+}%
@@ -137,8 +137,7 @@
[shift=(\tikzlastnode.center)]
(-1.5\tikzcircuitssizeunit,1.5\tikzcircuitssizeunit) edge[line to] (1.5\tikzcircuitssizeunit,-1.5\tikzcircuitssizeunit)
}
-}
+}%
\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
index 4fe276ff0a0..c0168992532 100644
--- 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
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usetikzlibrary{circuits.logic.US}
+\usetikzlibrary{circuits.logic.US}%
\tikzset{
circuit logic CDH/.style =
@@ -16,14 +16,13 @@
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
index 64d1f764b71..54a1068eb4c 100644
--- 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
@@ -7,8 +7,8 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usetikzlibrary{circuits.logic}
-\usepgflibrary{shapes.gates.logic.IEC}
+\usetikzlibrary{circuits.logic}%
+\usepgflibrary{shapes.gates.logic.IEC}%
%
@@ -37,7 +37,7 @@
not gate IEC symbol = {$\scriptstyle1$},
buffer gate IEC symbol = {$\scriptstyle1$},
},
-}
+}%
%
@@ -54,7 +54,7 @@
inner sep=.5ex
}
}
-}
+}%
\tikzset{
@@ -68,9 +68,8 @@
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
index 1f724912549..76d48c863ab 100644
--- 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
@@ -7,8 +7,8 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usetikzlibrary{circuits.logic}
-\usepgflibrary{shapes.gates.logic.US}
+\usetikzlibrary{circuits.logic}%
+\usepgflibrary{shapes.gates.logic.US}%
%
@@ -28,7 +28,7 @@
set not gate graphic = not gate US graphic,
set buffer gate graphic = buffer gate US graphic
}
-}
+}%
%
@@ -45,7 +45,7 @@
transform shape
}
}
-}
+}%
\tikzset{
@@ -57,9 +57,8 @@
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
index 0fc662f92c5..fb896e6a065 100644
--- 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
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usetikzlibrary{circuits}
+\usetikzlibrary{circuits}%
@@ -22,7 +22,7 @@
logic gate inverted radius=.25\tikzcircuitssizeunit,
every circuit logic/.try,
}
-}
+}%
@@ -39,8 +39,7 @@
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
index 8018de58018..a01a5720c54 100644
--- 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
@@ -7,9 +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/datavisualization/tikzlibrarydatavisualization.3d.code.tex,v 1.1 2008/12/17 22:48:46 tantau Exp $
+\ProvidesFileRCS{tikzlibrarydatavisualization.3d.code.tex}
-\usetikzlibrary{datavisualization}
+\usetikzlibrary{datavisualization}%
@@ -38,9 +38,9 @@
% visualize ticks={common={x axis={goto=0},y axis={goto=0},direction axis=y axis}}
},
new line plot,
- every school book plot/.try
- }
-}
+ every school book plot/.try,
+ },
+}%
% A 3d version of the scientific plot
@@ -58,23 +58,22 @@
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}}
+ 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}}
+ 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}}
+ visualize axis={x axis={goto=max},y axis={goto=max}},
},
- new line plot
- }
-}
-
+ 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
index 40fa0e87169..3eefe0f81a7 100644
--- 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
@@ -7,10 +7,10 @@
%
% 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 $
+\ProvidesFileRCS{tikzlibrarydatavisualization.barcharts.code.tex}
-\usetikzlibrary{datavisualization}
-\usepgflibrary{datavisualization.barcharts}
+\usetikzlibrary{datavisualization}%
+\usepgflibrary{datavisualization.barcharts}%
\tikzdatavisualizationset{%
@@ -37,7 +37,7 @@
},
},
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
index ba79c22b33f..7f26cc00177 100644
--- 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
@@ -7,15 +7,15 @@
%
% 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.48 2015/05/18 17:01:16 tantau Exp $
+\ProvidesFileRCS{tikzlibrarydatavisualization.code.tex}
-\usepgfmodule{datavisualization}
-\usetikzlibrary{backgrounds}
+\usepgfmodule{datavisualization}%
+\usetikzlibrary{backgrounds}%
\tikzset{/tikz/data visualization/.is family,
/tikz/data visualization/.unknown/.code={
- \let\tikz@dv@key\pgfkeyscurrentname%
+ \let\tikz@dv@key\pgfkeyscurrentname%
\pgfkeys{/tikz/\tikz@dv@key/.try={#1}}%
\ifpgfkeyssuccess%
\else%
@@ -25,17 +25,17 @@
},
/tikz/data visualization/data/.unknown/.code={%
% Redirect to /pgf/data
- \let\tikz@dv@key\pgfkeyscurrentname%
+ \let\tikz@dv@key\pgfkeyscurrentname%
\pgfkeys{/pgf/data/\tikz@dv@key/.try={#1}}%
\ifpgfkeyssuccess%
\else%
\edef\pgf@temp{/errors/unknown key={/pgf/data/\tikz@dv@key}}%
\expandafter\pgfkeys\expandafter{\pgf@temp{#1}}%
\fi%
- }
-}
+ },
+}%
-\def\tikzdatavisualizationset{\pgfqkeys{/tikz/data visualization}}
+\def\tikzdatavisualizationset{\pgfqkeys{/tikz/data visualization}}%
@@ -53,7 +53,7 @@
% "data" blocks.
%
% Syntax: data [options] % options specify an external source
-% Syntax: data [options] { inline data }
+% Syntax: data [options] { inline data }
%
% The optional arguments may either specify an
% external data source or the data may follow inline.
@@ -67,7 +67,7 @@
%
% Syntax: data set [options] {name} = { ... }
% Syntax: data set [options] {name} += { ... }
-% Syntax: data set [options] {name}
+% Syntax: data set [options] {name}
%
% The first syntax allows you to define a data set. The data block
% inside {...} will be stored inside the data set
@@ -83,7 +83,7 @@
%
% A block starting with "info" or "info'" may contain any code. It
% will be executed after the visualization (info) or before the
-% visualization (info').
+% visualization (info').
%
%
% Options blocks.
@@ -176,9 +176,9 @@
\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{%
+\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{%
@@ -195,25 +195,25 @@
}%
}%
}%
-}
+}%
\def\tikz@lib@dv@parse@end;{%
% Go!
\tikz@main@dv.survey()%
\tikz@main@dv.visualize()%
\endgroup%
\tikz@path@do@at@end%
-}
-\def\tikz@lib@dv@handle@par\par{\tikz@lib@dv@parse@loop}
+}%
+\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}%
\pgf@dv@do@adddata{\pgfkeysvalueof{/pgf/data visualization/obj}.add data({{\begingroup\pgfkeys{/pgf/data/.cd,/pgf/every data/.try,#1}}})}%
@@ -224,30 +224,30 @@
\tikzerror{Opening brace expected}%
\tikz@lib@dv@parse@loop%
}%
-}
+}%
\def\tikz@lib@dv@handle@endscope{%
\pgf@dv@do@adddata{\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{%
\pgfutil@ifnextchar g{\tikz@lib@dv@handle@data@group}{%
\pgfutil@ifnextchar p{\tikz@lib@dv@handle@data@point}{%
- \pgfdata}}}
+ \pgfdata}}}%
-\def\tikz@lib@dv@handle@data@group group{\pgfutil@ifnextchar[{\tikz@lib@dv@handle@data@group@opt}{\tikz@lib@dv@handle@data@group@opt[]}}%}
+\def\tikz@lib@dv@handle@data@group group{\pgfutil@ifnextchar[{\tikz@lib@dv@handle@data@group@opt}{\tikz@lib@dv@handle@data@group@opt[]}}%}%
\def\tikz@lib@dv@handle@data@group@opt[#1]#2{%
\pgfutil@ifnextchar={\tikz@lib@dv@handle@data@group@def{#1}{#2}}{%
\pgfutil@ifnextchar+{\tikz@lib@dv@handle@data@group@extend{#1}{#2}}{%
- \tikz@lib@dv@handle@data@group@use{#1}{#2}}}}
+ \tikz@lib@dv@handle@data@group@use{#1}{#2}}}}%
\def\tikz@lib@dv@handle@data@group@def#1#2={%
\pgfkeys{/pgf/data/new group=#2}%
\tikz@lib@dv@handle@data@group@extend{#1}{#2}+=%
-}
+}%
\def\tikz@lib@dv@handle@data@group@extend#1#2+={%
\pgfutil@ifnextchar\bgroup{
@@ -260,40 +260,40 @@
\tikzerror{Opening brace expected}%
\tikz@lib@dv@parse@loop%
}%
-}
+}%
\def\tikz@lib@dv@handle@data@group@use#1#2{%
\pgfdata[#1,use group=#2]%
-}
+}%
-\def\tikz@lib@dv@handle@data@point point{\pgfutil@ifnextchar[{\tikz@lib@dv@handle@data@point@opt}{\tikz@lib@dv@handle@data@point@opt[]}}%]
+\def\tikz@lib@dv@handle@data@point point{\pgfutil@ifnextchar[{\tikz@lib@dv@handle@data@point@opt}{\tikz@lib@dv@handle@data@point@opt[]}}%]%
\def\tikz@lib@dv@handle@data@point@opt[#1]{%
- \pgf@dv@do@adddata{\pgfkeysvalueof{/pgf/data visualization/obj}.add data({{\bgroup\pgfkeys{/data point/.cd,#1}\pgfdatapoint\egroup}})}%
- \tikz@lib@dv@parse@loop%
-}
+ \pgf@dv@do@adddata{\pgfkeysvalueof{/pgf/data visualization/obj}.add data({{\bgroup\pgfkeys{/data point/.cd,#1}\pgfdatapoint\egroup}})}%
+ \tikz@lib@dv@parse@loop%
+}%
\def\tikz@lib@dv@handle@info info{%
- \pgfutil@ifnextchar'{\tikz@lib@dv@handle@info@prime}{\tikz@lib@dv@handle@info@noprime}}
+ \pgfutil@ifnextchar'{\tikz@lib@dv@handle@info@prime}{\tikz@lib@dv@handle@info@noprime}}%
\def\tikz@lib@dv@handle@info@noprime{%
- \pgfutil@ifnextchar[{\tikz@lib@dv@handle@info@block@opt}{\tikz@lib@dv@handle@info@block@opt[]}}%}
+ \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
-}
+}%
\def\tikz@lib@dv@handle@info@prime'{%
- \pgfutil@ifnextchar[{\tikz@lib@dv@handle@info@block@opt@prime}{\tikz@lib@dv@handle@info@block@opt@prime[]}}%}
+ \pgfutil@ifnextchar[{\tikz@lib@dv@handle@info@block@opt@prime}{\tikz@lib@dv@handle@info@block@opt@prime[]}}%}%
\def\tikz@lib@dv@handle@info@block@opt@prime[#1]#2{%
\tikz@main@dv.before 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}}
+\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}),
@@ -304,26 +304,26 @@
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}),
-}
+}%
\def\tikz@lib@dv@alias@dv@bb{
\pgfnodealias{data bounding box}{data visualization bounding box}%
\pgfkeys{/pgf/freeze local bounding box=data bounding box}%
-}
+}%
%
% The data point key
%
\tikzdatavisualizationset{
data point/.code={
- \pgf@dv@do@adddata{\pgfkeysvalueof{/pgf/data visualization/obj}.add data({{\bgroup\pgfkeys{/data point/.cd,#1}\pgfdatapoint\egroup}})}%
+ \pgf@dv@do@adddata{\pgfkeysvalueof{/pgf/data visualization/obj}.add data({{\bgroup\pgfkeys{/data point/.cd,#1}\pgfdatapoint\egroup}})}%
}
-}
+}%
%
-% Object setup
+% Object setup
%
% The following key is used to create objects for the rendering
@@ -348,10 +348,10 @@
% The following styles may be useful:
%
% arg1 from key = use the contents of the given key as arg1. Similar
-% for other args
+% 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
+% object. Similar for other args
\tikzdatavisualizationset{%
new object/.code={%
@@ -368,7 +368,7 @@
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}%
@@ -406,8 +406,8 @@
\fi%
\tikz@dv@new@after%
\fi
-}
-\def\tikz@lib@notused{\tikz@lib@notused}
+}%
+\def\tikz@lib@notused{\tikz@lib@notused}%
\def\tikz@dv@add@arg#1#2{%
\ifx#2\tikz@lib@notused%
@@ -416,7 +416,7 @@
\expandafter\expandafter\expandafter\pgf@marshal%
\expandafter\expandafter\expandafter{\expandafter\pgf@marshal#1#2}%
\fi%
-}
+}%
\tikzdatavisualizationset{%
new object/parse/.cd,
@@ -449,12 +449,12 @@
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}%
-}
+}%
@@ -472,7 +472,7 @@
{%
\tikzset{/data point/.cd,#1}%
\pgfpointdvlocaldatapoint%
-}
+}%
@@ -592,21 +592,21 @@
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@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}}},
+ 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}}},
@@ -615,19 +615,19 @@
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{
@@ -656,7 +656,7 @@
font=\pgfutil@font@small,
}
}
-}
+}%
\tikzset{
@@ -707,22 +707,22 @@
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},
- %
+ %
ticks and grid/.style={\tikz@dv@axis/ticks at/.append={,#1},\tikz@dv@axis/grid at/.append={,#1}},
- %
+ %
% Visualizing axis labels
- %
+ %
visualize label/.code=\expandafter\tikz@lib@dv@lv\expandafter{\tikz@dv@axis}{#1},
-}
+}%
-\def\tikz@lib@dv@auto@attribute{\tikz@lib@dv@auto@attribute}
+\def\tikz@lib@dv@auto@attribute{\tikz@lib@dv@auto@attribute}%
% Range options
\tikzdatavisualizationset{
axis options/.cd,
- %
- % Including a value in the range
+ %
+ % Including a value in the range
%
include value/.style={%
/tikz/data visualization/before survey/.expanded={%
@@ -732,9 +732,9 @@
}%
}%
},
- %
+ %
% Directly setting the min or max
- %
+ %
min value/.style={
/tikz/data visualization/at end survey/.expanded={%
\noexpand\pgfkeysgetvalue{\tikz@dv@axis/scaling mapper}\noexpand\tikz@dv@axis@mapper%
@@ -747,13 +747,13 @@
\noexpand\tikz@lib@dv@set\noexpand\tikz@dv@axis@mapper{#1}{max}%
}
},
-}
+}%
\def\tikz@lib@dv@set#1#2#3{%
\pgfdvmathenter{\pgf@dv@value}{#2}%
#1.get in range interval()%
\pgfdvinrangeinterval.let #3(\pgf@dv@value)%
-}
+}%
% Layer options
\tikzdatavisualizationset{
@@ -761,7 +761,7 @@
ticks layer/.style=on background layer,
ticks node layer/.style=,
grid layer/.style=on background layer,
-}
+}%
% Axis visualization
@@ -773,7 +773,7 @@
\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]
@@ -793,7 +793,7 @@
}
};
\endscope
-}
+}%
\def\tikz@dv@goto#1#2{%
\edef\pgf@@temp{#2}%
@@ -814,23 +814,23 @@
\pgfkeysvalueof{#1/scaling mapper}.set in to(#2)%
\fi%
\fi%
-}
+}%
\def\tikz@dv@goto@pos#1#2{%
\pgfkeyssetvalue{/data point/\pgfkeysvalueof{#1/attribute}/out pos}{#2}%
-}
+}%
+
+\def\tikz@lib@dv@padded@min@text{padded min}%
+\def\tikz@lib@dv@padded@max@text{padded max}%
-\def\tikz@lib@dv@padded@min@text{padded min}
-\def\tikz@lib@dv@padded@max@text{padded max}
-
\def\tikz@lib@dv@special@at#1#2{%
% Ok, calculate direction vector:
\tikzpointandanchordirection{\pgfkeysvalueof{#1/scaling mapper}.set in to(min)}{\pgfkeysvalueof{#1/scaling mapper}.set in to(max)}
\tikzset{anchor/.expanded=#2}
-}
+}%
-% Ticks visualization
+% Ticks visualization
%
% #1 = name of axis on which ticks should be shown
% #2 = options for the visualization
@@ -842,7 +842,7 @@
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%
@@ -867,7 +867,7 @@
\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:
@@ -896,7 +896,7 @@
\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[count=\tikz@dv@tick@count] in \tikz@dv@at@list
+ \foreach \tikz@dv@tick@pos[count=\tikz@dv@tick@count] in \tikz@dv@at@list
{
\ifx\tikz@dv@tick@pos\pgfutil@empty
\c@pgf@counta=\tikz@dv@tick@count\relax%
@@ -948,32 +948,32 @@
\path [/tikz/data visualization/styling] (\tikz@dv@max@tick) \tikz@dv@handle@tick{\tikz@dv@max@anchor};
\endscope
\fi
- \fi
+ \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%
+ \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}%
@@ -981,7 +981,7 @@
\pgfkeysvalueof{/tikz/data visualization/tick prefix}%
\pgfkeys{/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
@@ -996,7 +996,7 @@
\fi
\expandafter}%
\tikz@dv@tick@marshal
-}
+}%
\def\tikz@lib@handle@at@style{%
@@ -1016,7 +1016,7 @@
\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}%
@@ -1025,7 +1025,7 @@
% Bingo!
\expandafter\gdef\expandafter\tikz@dv@lib@this@at@style\expandafter{\tikz@dv@lib@this@at@style,#3}%
\fi%
-}
+}%
% Help function
@@ -1042,12 +1042,12 @@
\tikz@auto@anchor@prime
\xdef\tikz@dv@min@anchor{\tikz@anchor}
}
-}
+}%
-% Grid visualization
+% Grid visualization
%
% #1 = name of axis on which grid lines should be shown
% #2 = options for the visualization
@@ -1059,7 +1059,7 @@
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:
@@ -1090,7 +1090,7 @@
\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
+ \foreach \tikz@dv@grid@pos in \tikz@dv@at@list
{
\ifx\tikz@dv@grid@pos\pgfutil@empty
\else
@@ -1110,7 +1110,7 @@
\endscope
}
\fi
-}
+}%
@@ -1120,15 +1120,15 @@
-%
-% Label visualization
+%
+% 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:
@@ -1140,14 +1140,14 @@
\expandafter\tikz@lib@dv@parse@node\tikz@dv@lib@label\pgf@stop
\endscope
\fi
-}
+}%
-\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{\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{
\tikzdatavisualizationset{#1}
- \pgftransformshift{\pgfpointdvlocaldatapoint}%
+ \pgftransformshift{\pgfpointdvlocaldatapoint}%
\node [/tikz/data visualization/node styling] {#2};
-}
+}%
@@ -1164,8 +1164,8 @@
tick typesetter/.code=\pgfmathprintnumber{#1},
tick prefix/.initial=,
tick suffix/.initial=,
- tick unit/.style={tick suffix={$\,\rm#1$}},% this is an alias
-}
+ tick unit/.style={tick suffix={$\,\pgfutil@font@normalfont#1$}},% this is an alias
+}%
\def\tikz@lib@dv@compute@at@linear{%
% Setup about:
@@ -1221,14 +1221,14 @@
\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%
+ \repeat%
\tikzdatavisualizationset{major/.expanded={at={\tikz@lib@dv@ats}},minor/.expanded={at={\tikz@lib@dv@minor@ats}}}%
}{%
\pgfdvmathexitbyserializing{\tikz@temp}{\pgfdvmin}%
\tikzdatavisualizationset{major/.expanded={at={\tikz@temp}}}%
- }%
+ }%
\fi%
-}
+}%
\newif\iftikz@lib@dv@continue
\def\tikz@lib@dv@subloop{
@@ -1243,13 +1243,13 @@
\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}},
@@ -1265,7 +1265,7 @@
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()%
@@ -1287,18 +1287,18 @@
\ifdim\pgf@xc<10pt%
\pgfmathfloatcreate{\tikz@lib@dv@flags}{\pgf@sys@tonumber{\pgf@xc}}{\tikz@lib@dv@exp}%
\else
- \begingroup
- \c@pgf@countd=\tikz@lib@dv@exp
- \advance\c@pgf@countd by1
- \edef\tikz@lib@dv@exp{\the\c@pgf@countd}%
- \pgfmath@smuggleone\tikz@lib@dv@exp
- \endgroup
- \divide\pgf@xc by 10\relax
+ \begingroup
+ \c@pgf@countd=\tikz@lib@dv@exp
+ \advance\c@pgf@countd by1
+ \edef\tikz@lib@dv@exp{\the\c@pgf@countd}%
+ \pgfmath@smuggleone\tikz@lib@dv@exp
+ \endgroup
+ \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
-}
+}%
@@ -1319,7 +1319,7 @@
\tikz@dv@axis/scaling/default=1 at 0 and 10 at 1,
exponential steps
}
-}
+}%
\def\tikz@lib@dv@compute@at@log{%
% Setup about:
@@ -1376,10 +1376,10 @@
\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%
+ \repeat%
\tikzdatavisualizationset{major/.expanded={at={\tikz@lib@dv@ats}},minor/.expanded={at={\tikz@lib@dv@minor@ats}}}%
\fi%
-}
+}%
\newif\iftikz@lib@dv@continue
@@ -1407,7 +1407,7 @@
\fi%
\pgfmathfloattofixed{\pgfmathresult}
\let\tikz@lib@dv@step=\pgfmathresult
-}
+}%
@@ -1431,7 +1431,7 @@
#1/scaling/default/.initial=0 at 0 and 1 at 1cm,
#1/unit vector/.initial=\pgfqpoint{1pt}{0pt},
}
-}
+}%
\tikzset{
/tikz/data visualization/axis options/.cd,
@@ -1439,11 +1439,11 @@
length/.style={\tikz@dv@axis/scaling=min at 0 and max at #1},
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}
@@ -1452,14 +1452,14 @@
\else%
\tikz@dv@parse@unit@length@#1per1units\pgf@stop%
\fi%
-}
+}%
\def\tikz@dv@parse@unit@length@#1per#2units\pgf@stop{
\pgfkeysalso{\tikz@dv@axis/scaling=0 at 0 and #2 at #1}
-}
+}%
-%
-% Common visualizer interface
+%
+% Common visualizer interface
%
\tikzdatavisualizationset{
@@ -1492,7 +1492,7 @@
},
style sheet/.style={/data point/set/.style sheet={#1}},
/pgf/data/set/.style={/data point/set=#1},
-}
+}%
\tikzdatavisualizationset{
new sub visualizer/.style n args={4}{
@@ -1516,14 +1516,14 @@
/tikz/data visualization/visualizers/#4/#1/styling/.style=,
/tikz/data visualization/visualizers/#4/#1/label in legend options/.style={#3},
}
-}
+}%
\def\tikz@do@visualizer#1#2{%
\tikzdatavisualizationset{
#2=#1
}
-}
+}%
\newcount\tikzdvvisualizercounter
@@ -1542,12 +1542,12 @@
polygon/.style={straight cycle},% alias
gap line/.style={@set={\pgfplothandlergaplineto}{default label in legend path}},
gap cycle/.style={@set={\pgfplothandlergapcycle}{gap circular label in legend line}}
-}
+}%
-%
-% Label visualizer
+%
+% Label visualizer
%
\tikzdatavisualizationset{
@@ -1595,7 +1595,7 @@
},
% Label style
text colored/.style={node style={text=visualizer color}}
-}
+}%
\def\tikz@create@label@count#1{
\tikzdatavisualizationset{
@@ -1607,7 +1607,7 @@
after creation={\tikzdvobj.set filter(\pgfdvvisualizerfilter{#1})}
}
}
-}
+}%
\pgfkeys{
/tikz/data visualization/visualizer label options/.cd,
@@ -1635,7 +1635,7 @@
text colored/.style=/tikz/data visualization/text colored,
pin angle/.store in=\tikz@lib@dv@pin@dir,
pin length/.style={node style={pin distance={#1}}},
-}
+}%
\let\tikz@lib@dv@pin@sign\pgfutil@empty
@@ -1688,8 +1688,8 @@
#1/anchor/.initial=west,
#1/at/.initial=(data visualization bounding box.east),
#1/matrix node styling/.style={row sep=0pt,column sep=.8em},
- %
- %
+ %
+ %
%
#1/.code={
\let\tikz@temp\tikz@dv@legend%
@@ -1703,12 +1703,12 @@
new legend,
main 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
@@ -1731,9 +1731,9 @@
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
- %
+ %
+ % Where to put the legend
+ %
anchor/.style={\tikz@dv@legend/anchor={#1}},
at/.style={\tikz@dv@legend/at={#1}},
% Outer placements
@@ -1789,9 +1789,9 @@
anchor=south,
},
every new legend/.style={east outside,label style=text right},
- %
+ %
% Inner placements
- %
+ %
% First, styling
every legend inside/.style={
opaque=white,
@@ -1905,19 +1905,19 @@
anchor=north east,
every legend inside
},
- %
%
- %
- % Label text styling
- %
+ %
+ %
+ % Label text styling
+ %
label style/.style={
matrix node style={/tikz/data visualization/every label in legend/.append style={#1}}
},
- %
- % Styling
+ %
+ % Styling
%
matrix node style/.style={\tikz@dv@legend/matrix node styling/.append style={#1}},
-}
+}%
\tikzdatavisualizationset{
@@ -1925,25 +1925,25 @@
\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
+ \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 data set label}
\pgfkeys{/tikz/data visualization/legend entry options/.cd,
/tikz/data visualization/every label in legend,#1}%
- \pgfkeysgetvalue{/tikz/data visualization/legend entry options/text}\tikz@dv@temp@lab
+ \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/visualizer in legend styling}\tikz@dv@temp@visual@styling
@@ -1959,18 +1959,18 @@
\fi
\endscope
\endscope
-}
+}%
-\def\tikz@dv@pre@height{\hbox{\vrule height .75em width0pt}}
-\def\tikz@dv@post@height{\hbox{\vrule depth .25em width0pt}}
+\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=main legend,
@@ -1978,9 +1978,9 @@
visualizer in legend/.initial=,
visualizer in legend styling/.initial=,
visualizer in legend style/.style={visualizer in legend styling/.append={,#1}},
- %
+ %
% Legend visualizers for plots
- %
+ %
text right/.style={
node style={anchor=mid west,inner ysep=1pt,inner xsep=0pt,reset cm,xshift=.333em},
visualizer in legend style={reset cm},
@@ -1995,7 +1995,7 @@
/utils/exec=\tikz@lib@dv@text@onlytrue
},
text colored/.style=/tikz/data visualization/text colored,
-}
+}%
\let\tikz@lib@dv@pin@dir\pgfutil@empty
\newif\iftikz@lib@dv@text@only
@@ -2028,7 +2028,7 @@
style/.style={/tikz/data visualization/visualizers/\tikz@visualizer/styling/.append style={,#1}},
label in legend options/.style={/tikz/data visualization/visualizers/\tikz@visualizer/label in legend options/.append style={,#1}},
ignore style sheets/.style={/tikz/data visualization/visualizers/\tikz@visualizer/signal/.code=,/utils/exec=\advance\tikzdvvisualizercounter by -1\relax},
-}
+}%
\def\tikz@dv@new@label@in@legend@for@visualizer#1#2{
\tikzdatavisualizationset{
@@ -2043,7 +2043,7 @@
#2,
}
}
-}
+}%
\def\tikz@dv@legend@entry@as@example{
\pgfkeysgetvalue{/data point/set}{\tikz@visualizer}
@@ -2063,7 +2063,7 @@
{ \pgfplotstreampoint{\expandafter\tikz@scan@one@point\expandafter\pgfutil@firstofone\coordinate} }
\pgfplotstreamend
\pgfkeysvalueof{/data point/\tikz@visualizer/execute at end}
-}
+}%
\tikzdatavisualizationset{
@@ -2098,7 +2098,7 @@
([xshift=-1em]270:.9em and .35ex),%
([xshift=-1em]315:.9em and .35ex)},%
label in legend mark coordinates={([xshift=-1em]120:.9em and .35ex),([xshift=-1em]-60:.9em and .35ex)},
- },
+ },
gap circular label in legend line/.style={
label in legend line coordinates={%
([xshift=-1em,yshift=.2ex]90:1.4ex and 0.9ex),%
@@ -2112,15 +2112,15 @@
([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{
-}
+}%
@@ -2171,7 +2171,7 @@
#1={no lines}
},
visualize as scatter/.default=scatter
-}
+}%
\def\tikz@dv@plot@mark@maker{
\let\tikz@options=\pgfutil@empty%
@@ -2183,7 +2183,7 @@
\else
\pgfplothandlermark{\tikz@transform\pgfuseplotmark{\tikz@plot@mark}}
\fi
-}
+}%
@@ -2211,13 +2211,13 @@
#1={}
},
visualize as rectangles/.default=rectangles,
- %
- %
+ %
+ %
%
visualizer options/.cd,
attribute 1/.style={/data point/\tikz@visualizer/attribute 1=#1},
attribute 2/.style={/data point/\tikz@visualizer/attribute 2=#1},
-}
+}%
@@ -2231,14 +2231,14 @@
{ \pgfplotstreampoint{\expandafter\tikz@scan@one@point\expandafter\pgfutil@firstofone\coordinate} }
\pgfplotstreamend
\pgfkeysvalueof{/data point/\tikz@visualizer/execute at end}
-}
+}%
%
% Style sheets
-%
+%
% Style sheet handler
@@ -2248,20 +2248,20 @@
\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,
@@ -2274,7 +2274,7 @@
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}
{
@@ -2336,8 +2336,8 @@
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}
@@ -2349,7 +2349,7 @@
4/.style={visualizer color=green!60!black},
5/.style={visualizer color=orange!80!black},
6/.style={visualizer color=black!60}
-}
+}%
\pgfdvdeclarestylesheet{cross marks}
@@ -2361,56 +2361,56 @@
4/.style={mark=Mercedes star flipped,every mark/.append style=thin,mark size=2pt},
5/.style={mark=star,every mark/.append style=thin,mark size=2pt},
6/.style={mark=10-pointed star,every mark/.append style={line width=.3pt,mark size=1.8pt}}
-}
+}%
\pgfdvdeclarestylesheet{* mark}
{
default style/.style={mark=*,every mark/.append style=thin,mark size=1.4pt},
-}
+}%
\pgfdvdeclarestylesheet{dot mark}
{
default style/.style={mark=*,every mark/.append style=thin,mark size=0.6pt},
-}
+}%
\pgfdvdeclarestylesheet{o mark}
{
default style/.style={mark=o,every mark/.append style=thin,mark size=1.4pt},
-}
+}%
% 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}
+\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{vary 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}
-\tikzdvdeclarestylesheetcolorseries{gray scale}{hsb}{0,0,-.34}{0,0,.34}
+\tikzdvdeclarestylesheetcolorseries{vary 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}%
+\tikzdvdeclarestylesheetcolorseries{gray scale}{hsb}{0,0,-.34}{0,0,.34}%
@@ -2442,7 +2442,7 @@
v axis={attribute=v,unit vector={(0cm,1pt)}}
},
uv axes/.style={u axis={#1},v axis={#1}},
-}
+}%
\tikzdatavisualizationset{
xyz Cartesian cabinet/.style={
@@ -2457,12 +2457,12 @@
w axis={attribute=w,unit vector={(-0.353553pt,-0.353553pt)}}
}
uvw axes/.style={u axis={#1},v axis={#1},w axis={#1}},
-}
+}%
-%
-% Create a new axis system
+%
+% Create a new axis system
%
\tikzdatavisualizationset{
@@ -2477,7 +2477,7 @@
#4,
}
}
-}
+}%
% The school book axes
@@ -2489,9 +2489,9 @@
% 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.
+% instance.
\tikzdatavisualizationset{
new axis system={school book axes}{%
@@ -2527,7 +2527,7 @@
},
school book axes/.cd,
% Possible axis positionings:
- %
+ %
% Place labels at the ends of the axes
%
standard labels/.style={
@@ -2546,11 +2546,11 @@
}
}
},
- %
- % Basic unit
- %
+ %
+ % Basic unit
+ %
unit/.initial=1,
-}
+}%
@@ -2559,7 +2559,7 @@
%
% 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.
+% this given rectangle.
\tikzdatavisualizationset{
new axis system={scientific axes}{%
@@ -2641,8 +2641,8 @@
}
},
% Possible axis positionings:
- %
- % Place axes labels below and left, where left label is rotated
+ %
+ % Place axes labels below and left, where left label is rotated
%
standard labels/.style={
/tikz/data visualization/@make labels/.style={
@@ -2668,7 +2668,7 @@
}
}
},
- %
+ %
% Place axes labels below and left, no rotation
%
upright labels/.style={
@@ -2693,9 +2693,9 @@
}
}
}
- }
+ }
},
- %
+ %
% Place axes at the ends of the axes
%
end labels/.style={
@@ -2722,9 +2722,8 @@
}
}
}
-}
+}%
\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
index 4a4d0896ec8..40632212a0d 100644
--- 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
@@ -7,10 +7,10 @@
%
% 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 $
+\ProvidesFileRCS{tikzlibrarydatavisualization.formats.functions.code.tex}
-\usetikzlibrary{datavisualization}
-\usepgflibrary{datavisualization.formats.functions}
+\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
index 1615f0d1bfc..137e9964cb7 100644
--- 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
@@ -7,10 +7,10 @@
%
% 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.8 2011/05/06 11:15:33 tantau Exp $
+\ProvidesFileRCS{tikzlibrarydatavisualization.polar.code.tex}
-\usetikzlibrary{datavisualization}
-\usepgflibrary{datavisualization.polar}
+\usetikzlibrary{datavisualization}%
+\usepgflibrary{datavisualization.polar}%
\tikzdatavisualizationset{%
@@ -32,13 +32,13 @@
/tikz/data visualization/#1/unit vector 90 degrees/.initial=\pgfqpoint{0pt}{1pt},
},
new polar axes/.default={angle axis}{radius axis}
-}
+}%
\def\tikz@lib@dv@polar@a#1{
\pgfkeyssetvalue{\tikz@dv@axis/unit vector 0 degrees}{#1}
-}
+}%
\def\tikz@lib@dv@polar@b#1{
\pgfkeyssetvalue{\tikz@dv@axis/unit vector 90 degrees}{#1}
-}
+}%
@@ -54,7 +54,7 @@
},
degrees/.style={\tikz@dv@axis/scaling=0 at 0 and 1 at 1},
radians/.style={\tikz@dv@axis/scaling=0 at 0 and 0.03141592653589793 at 1.8},
-}
+}%
@@ -150,27 +150,27 @@
},
major={
options at=6.2831985e0 as [{style={draw=none},no tick text}],
- options at=6.2831192e0 as [{style={draw=none},no tick text}],
- options at=6.2830794e0 as [{style={draw=none},no tick text}],
- options at=6.2828787e0 as [{style={draw=none},no tick text}],
- options at=6.2831598e0 as [{style={draw=none},no tick text}],
+ options at=6.2831192e0 as [{style={draw=none},no tick text}],
+ options at=6.2830794e0 as [{style={draw=none},no tick text}],
+ options at=6.2828787e0 as [{style={draw=none},no tick text}],
+ options at=6.2831598e0 as [{style={draw=none},no tick text}],
options at=-3.1415991e0 as [{style={draw=none},no tick text}],
options at=-3.1415802e0 as [{style={draw=none},no tick text}],
options at=-3.1415602e0 as [{style={draw=none},no tick text}],
options at=-3.14153961e0 as [{style={draw=none},no tick text}],
options at=-3.1414406e0 as [{style={draw=none},no tick text}],
- }
+ }
}
}
},
@make labels/.style={},
-}
+}%
\tikzdatavisualizationset{
scientific polar axes/.cd,
- %
- %
- %
+ %
+ %
+ %
outer ticks/.style={
/tikz/data visualization/@make axes/.style={
radius axis={
@@ -233,8 +233,8 @@
/tikz/data visualization/@visualize zero/.style={@clean visualize zero={##1}},
},
radius/.initial=3.25cm,
- %
- % First quadrant
+ %
+ % First quadrant
%
0 to pi half/.style={
@setup axes/.style={
@@ -282,8 +282,8 @@
}
}
},
- %
- % Fourth quadrant
+ %
+ % Fourth quadrant
%
-pi half to 0/.style={
@setup axes/.style={
@@ -331,8 +331,8 @@
}
}
},
- %
- % Upper half
+ %
+ % Upper half
%
0 to pi/.style={
@setup axes/.style={
@@ -388,8 +388,8 @@
}
}
},
- %
- % Lower half
+ %
+ % Lower half
%
lower half/.style={
@setup axes/.style={
@@ -417,7 +417,7 @@
}
}
},
- %
+ %
% Right half
%
-pi half to pi half/.style={
@@ -474,8 +474,8 @@
}
}
},
- %
- % Left half
+ %
+ % Left half
%
left half/.style={
@setup axes/.style={
@@ -503,9 +503,9 @@
}
}
},
- %
- % Full circle
- %
+ %
+ % Full circle
+ %
0 to 2pi/.style={
@setup axes/.style={
angle axis={min value=0, max value=6.283185307179586},
@@ -542,7 +542,7 @@
@clean radius axes at={{0}{low}{high}{}{}}
}
},
-}
+}%
@@ -557,7 +557,7 @@
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}
-}
+}%
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
index 69736423596..127b9805f23 100644
--- 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
@@ -7,14 +7,14 @@
%
% 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 $
+\ProvidesFileRCS{tikzlibrarydatavisualization.sparklines.code.tex}
-\usetikzlibrary{datavisualization}
+\usetikzlibrary{datavisualization}%
-%
+%
% Sparklines (not yet usable...)
%
@@ -29,10 +29,9 @@
},
new line plot,
every spark line plot/.try
- }
-}
+ }
+}%
\endinput
-
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
index 3f17447fdda..27f0ed4aba5 100644
--- 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
@@ -8,14 +8,14 @@
%
% 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.44 2015/06/05 12:41:59 tantau Exp $
+\ProvidesFileRCS{tikzlibrarygraphs.code.tex}
-%
-% Interface keys
+%
+% Interface keys
%
-\def\tikzgraphsset{\pgfqkeys{/tikz/graphs}}
+\def\tikzgraphsset{\pgfqkeys{/tikz/graphs}}%
\tikzgraphsset{
new ->/.code n args={4}{%
@@ -40,18 +40,18 @@
edge[#3] #4
(#2\tikzgraphrightanchor);
}
-}
+}%
\def\tikz@lib@graph@store@anchor#1#2{%
- \def\tikz@temp{#1}
+ \def\tikz@temp{#1}%
\ifx\tikz@temp\pgfutil@empty%
\let#2\tikz@temp%
\else%
- \def\tikz@temp{.#1}
+ \def\tikz@temp{.#1}%
\let#2\tikz@temp%
- \fi%
-}
+ \fi%
+}%
\tikzgraphsset{
default edge kind/.initial=--,
@@ -65,17 +65,17 @@
right anchor/.code=\tikz@lib@graph@store@anchor{#1}{\tikzgraphrightanchor},
left anchor=,
right anchor=
-}
+}%
%
% Keys for using nodes declared outside a graph inside a graph as if
% it were declared there
-%
+%
\tikzgraphsset{
use existing nodes/.is if=tikz@lib@graph@all
-}
+}%
\tikzset{
new set/.code={
@@ -88,13 +88,13 @@
\expandafter\expandafter\expandafter\pgfutil@g@addto@macro\expandafter\pgf@temp\expandafter{\expandafter\tikz@lg@do\expandafter{\tikz@fig@name}}%
}%
},%
-}
+}%
\newif\iftikz@lib@graph@all
-%
-% Simple versus multi graphs
+%
+% Simple versus multi graphs
%
\tikzgraphsset{
simple/.code={
@@ -108,7 +108,7 @@
multi/.code={
\tikz@lib@graph@simplefalse%
}
-}
+}%
\newif\iftikz@lib@graph@simple
@@ -118,17 +118,17 @@
% #3 = to
% #4 = options
% #5 = edge nodes
- %
+ %
% Ok, first, test, whether edge exists:
\ifcsname tikz@lg@e@#3@#2\endcsname%
\expandafter\global\expandafter\let\csname tikz@lg@e@#3@#2\endcsname\relax% reset
\fi%
\expandafter\gdef\csname tikz@lg@e@#2@#3\endcsname{\tikz@lib@graph@make@simple@edge{#1}{#2}{#3}{#4}{#5}}%
-}
+}%
\def\tikz@lib@graph@make@simple@edge#1#2#3#4#5{%
\pgfqkeys{/tikz/graphs}{new #1={#2}{#3}{#4}{#5}}%
-}
+}%
\def\tikz@lib@graph@simple@done{%
@@ -137,26 +137,26 @@
\let\tikz@lg@do\tikz@lib@graph@simple@node%
\tikz@lib@graph@node@list
}%
-}
+}%
\def\tikz@lib@graph@simple@node#1{%
{%
\def\tikz@lib@graph@simple@from@node{#1}%
\let\tikz@lg@do\tikz@lib@graph@simple@other@node%
\tikz@lib@graph@node@list%
- }%
-}
+ }%
+}%
\def\tikz@lib@graph@simple@other@node#1{%
\ifcsname tikz@lg@e@\tikz@lib@graph@simple@from@node @#1\endcsname%
\csname tikz@lg@e@\tikz@lib@graph@simple@from@node @#1\endcsname%
\expandafter\global\expandafter\let\csname tikz@lg@e@\tikz@lib@graph@simple@from@node @#1\endcsname\relax%
\fi%
-}
+}%
-%
-% Basic options
+%
+% Basic options
%
\tikzgraphsset{
@@ -172,7 +172,7 @@
@operators/.initial=,
operator/.style={/tikz/graphs/@operators/.append={#1}},
@extra group options/.style=,
-}
+}%
\def\tikzgraphinvokeoperator#1{%
@@ -184,16 +184,16 @@
}%
\tikz@lib@graph@temp%
\global\let\tikz@lib@graph@temp\relax%
-}
+}%
-%
-% The parser
+%
+% The parser
%
\def\tikz@lib@graph@parser{%
\pgfutil@ifnextchar[{\tikz@lib@graph@parser@}{\tikz@lib@graph@parser@[]}%]
-}
+}%
\def\tikz@lib@graph@parser@[#1]{%
\setbox\tikz@whichbox=\hbox\bgroup%
@@ -208,7 +208,7 @@
\else%
\expandafter\tikz@lib@graphs@normal@main%
\fi%
-}
+}%
\long\def\tikz@lib@graphs@normal@main#1{%
\pgfkeysgetvalue{/tikz/graphs/@operators}\tikz@lib@graph@outer@operators%
@@ -220,11 +220,11 @@
\tikz@lib@graph@start@hint@group%
\tikz@lib@graph@parse@group{#1}%
\tikz@lib@graph@end@hint@group
- \tikz@lib@graph@outer@operators%
+ \tikz@lib@graph@outer@operators%
\let\tikz@lg@do=\tikz@lib@graph@cleanup%
\tikz@lib@graph@node@list%
\tikz@lib@graph@main@done%
-}
+}%
\def\tikz@lib@graph@main@done{%
\endgroup%
@@ -234,7 +234,7 @@
\egroup%
\egroup%
\tikz@lib@graph@parser@done%
-}
+}%
@@ -245,13 +245,13 @@
\pgfkeyssetvalue{/tikz/graphs/placement/local width}{0}%
\pgfkeyssetvalue{/tikz/graphs/placement/chain count}{0}%
\pgfkeyssetvalue{/tikz/graphs/placement/element count}{0}%
-}
+}%
\def\tikz@lib@graph@end@hint@group{%
% Get local depth and width outside
\xdef\tikz@lib@graph@group@depth{\pgfkeysvalueof{/tikz/graphs/placement/local depth}}
\xdef\tikz@lib@graph@group@width{\pgfkeysvalueof{/tikz/graphs/placement/local width}}
-}
+}%
\def\tikz@lib@graph@hint@aftergroup{%
\pgfkeysgetvalue{/tikz/graphs/placement/width}\tikz@temp@h%
@@ -263,13 +263,13 @@
\pgfkeyslet{/tikz/graphs/placement/width}\tikz@temp@h%
\pgfkeyslet{/tikz/graphs/placement/local width}\tikz@temp@lh%
\pgfkeyslet{/tikz/graphs/placement/local depth}\tikz@temp@lw%
- %
+ %
\pgfkeysgetvalue{/tikz/graphs/placement/element count}\tikz@temp%
\c@pgf@counta=\tikz@temp\relax%
\advance\c@pgf@counta by1\relax%
\edef\tikz@temp{\the\c@pgf@counta}%
- \pgfkeyslet{/tikz/graphs/placement/element count}\tikz@temp%
-}
+ \pgfkeyslet{/tikz/graphs/placement/element count}\tikz@temp%
+}%
\def\tikz@lib@graph@placement@update{%
\pgfkeys{/tikz/graphs/placement/logical node depth/.expand once=\tikz@lib@graph@name}
@@ -286,13 +286,13 @@
\pgfkeyslet{/tikz/graphs/placement/width}\tikz@temp@h%
\pgfkeyslet{/tikz/graphs/placement/local width}\tikz@temp@lh%
\pgfkeyslet{/tikz/graphs/placement/local depth}\tikz@temp@lw%
- %
+ %
\pgfkeysgetvalue{/tikz/graphs/placement/element count}\tikz@temp%
\c@pgf@counta=\tikz@temp\relax%
\advance\c@pgf@counta by1\relax%
\edef\tikz@temp{\the\c@pgf@counta}%
- \pgfkeyslet{/tikz/graphs/placement/element count}\tikz@temp%
-}
+ \pgfkeyslet{/tikz/graphs/placement/element count}\tikz@temp%
+}%
\def\tikz@lib@graph@placement@after@chain@update{%
\pgfkeysgetvalue{/tikz/graphs/placement/depth}\tikz@temp@w%
@@ -304,18 +304,18 @@
\pgfkeyslet{/tikz/graphs/placement/depth}\tikz@temp@w%
\pgfkeyslet{/tikz/graphs/placement/local width}\tikz@temp@lh%
\pgfkeyslet{/tikz/graphs/placement/local depth}\tikz@temp@lw%
- %
+ %
\pgfkeysgetvalue{/tikz/graphs/placement/chain count}\tikz@temp%
\c@pgf@counta=\tikz@temp\relax%
\advance\c@pgf@counta by1\relax%
\edef\tikz@temp{\the\c@pgf@counta}%
- \pgfkeyslet{/tikz/graphs/placement/chain count}\tikz@temp%
-}
+ \pgfkeyslet{/tikz/graphs/placement/chain count}\tikz@temp%
+}%
%
% Parse a group
-%
+%
\long\def\tikz@lib@graph@parse@group#1{
\let\tikz@lib@graph@group@qa\pgfutil@empty%
@@ -324,16 +324,16 @@
\let\tikz@lib@graph@group@cont\pgfutil@empty%
\let\tikz@lib@graph@group@conta\pgfutil@empty%
\tikz@lib@graph@group@check#1\par\pgf@stop@eogroup%
-}
+}%
-%
-% Start of a group
+%
+% Start of a group
%
\def\tikz@lib@graph@group@check{%
\pgfutil@ifnextchar[\tikz@lib@graph@group@opt{\tikz@lib@graph@group@opt[]}%]
-}
+}%
\def\tikz@lib@graph@group@opt[#1]{%
\let\tikz@lib@graph@parse@extras\pgfutil@empty%
@@ -344,38 +344,38 @@
@extra group options/.style=,%
#1}%
\expandafter\tikz@lib@graph@par\tikz@lib@graph@parse@extras%
-}
+}%
\tikzgraphsset{
parse/.code={\expandafter\def\expandafter\tikz@lib@graph@parse@extras\expandafter{\tikz@lib@graph@parse@extras#1}},
-}
+}%
-%
-% Remove \par
+%
+% Remove \par
%
\def\tikz@lib@graph@par{%
\pgfutil@ifnextchar\bgroup{\tikz@lib@graph@par@@}{\tikz@lib@graph@par@}%
-}
+}%
\long\def\tikz@lib@graph@par@#1\par{%
\pgfutil@ifnextchar\pgf@stop@eogroup{%
\expandafter\tikz@lib@graph@quotes\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%
}%
-}
+}%
\long\def\tikz@lib@graph@par@@#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@quotes{%
\pgfutil@ifnextchar\bgroup{\tikz@lib@graph@quotes@@}{\tikz@lib@graph@quotes@}%
}%
@@ -386,30 +386,30 @@
\expandafter\def\expandafter\tikz@lib@graph@group@q\expandafter{\tikz@lib@graph@group@q#1"}%
\tikz@lib@graph@quotes@cont%
}%
-}
+}%
\def\tikz@lib@graph@quotes@cont#1"#2"{%
\pgfutil@ifnextchar\pgf@stop@eogroup{%
\tikz@lib@graph@passon{{#1}"#2}}{%
\expandafter\def\expandafter\tikz@lib@graph@group@q\expandafter{\tikz@lib@graph@group@q{#1}"#2"}%
\tikz@lib@graph@quotes@cont}%
-}
+}%
\def\tikz@lib@graph@quotes@@#1{%
\expandafter\def\expandafter\tikz@lib@graph@group@q\expandafter{\tikz@lib@graph@group@q{#1}}%
\tikz@lib@graph@quotes%
-}
+}%
-%
+%
% Replace ..."..."... by ..."{...}"... (active version)
%
-{
+{%
\catcode`\"=13\relax
\gdef\tikz@lib@graph@passon#1{\expandafter\tikz@lib@graph@quotesactive\tikz@lib@graph@group@q#1"}%
-
+
\gdef\tikz@lib@graph@quotesactive{%
\pgfutil@ifnextchar\bgroup{\tikz@lib@graph@quotesactive@@}{\tikz@lib@graph@quotesactive@}%
}%
@@ -420,27 +420,27 @@
\expandafter\def\expandafter\tikz@lib@graph@group@qa\expandafter{\tikz@lib@graph@group@qa#1"}%
\tikz@lib@graph@quotesactive@cont%
}%
- }
-
+ }%
+
\gdef\tikz@lib@graph@quotesactive@cont#1"#2"{%
\pgfutil@ifnextchar\pgf@stop@eogroup{%
\expandafter\tikz@lib@graph@encloser\tikz@lib@graph@group@qa{#1}"#2[}{%
\expandafter\def\expandafter\tikz@lib@graph@group@qa\expandafter{\tikz@lib@graph@group@qa{#1}"#2"}%
\tikz@lib@graph@quotesactive@cont}%
- }
-
+ }%
+
\gdef\tikz@lib@graph@quotesactive@@#1{%
\expandafter\def\expandafter\tikz@lib@graph@group@qa\expandafter{\tikz@lib@graph@group@qa{#1}}%
\tikz@lib@graph@quotesactive%
- }
-}
+ }%
+}%
-%
+%
% Replace ...[...]... by ...[{...}]...
-%
+%
\def\tikz@lib@graph@encloser{%
\pgfutil@ifnextchar\bgroup{\tikz@lib@graph@encloser@@}{\tikz@lib@graph@encloser@}%
}%
@@ -451,45 +451,45 @@
\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}%
-}
+}%
\def\tikz@lib@graph@encloser@@#1{%
\expandafter\def\expandafter\tikz@lib@graph@group@cont\expandafter{\tikz@lib@graph@group@cont{#1}}%
\tikz@lib@graph@encloser%
-}
+}%
-%
-% Replace ; by ,
+%
+% Replace ; by ,
%
\def\tikz@lib@graph@semi{%
\pgfutil@ifnextchar\bgroup{\tikz@lib@graph@semi@@}{\tikz@lib@graph@semi@}%
-}
+}%
\def\tikz@lib@graph@semi@#1;{%
\pgfutil@ifnextchar\pgf@stop@eogroup{%
\expandafter\tikz@lib@graph@main@parser\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%
}%
-}
+}%
\def\tikz@lib@graph@semi@@#1{%
\expandafter\def\expandafter\tikz@lib@graph@group@conta\expandafter{\tikz@lib@graph@group@conta{#1}}%
\tikz@lib@graph@semi%
-}
+}%
-%
-% Main parse
+%
+% Main parse
%
\def\tikz@lib@graph@main@parser{%
@@ -499,23 +499,23 @@
\let\tikz@lib@graph@stored@actions\pgfutil@empty%
\let\tikz@lib@graph@node@list\pgfutil@empty% reset
\tikz@lib@graph@main@parser@start%
-}
+}%
\def\tikz@lib@graph@main@parser@start{%
\pgfutil@ifnextchar\bgroup{\tikz@lib@graph@protect@group}{\tikz@lib@graph@main@parser@cont}%
-}
+}%
\def\tikz@lib@graph@protect@group#1{% skip space
\pgfutil@ifnextchar\relax{\tikz@lib@graph@main@parser@cont{{#1}}}{\tikz@lib@graph@main@parser@cont{{#1}}}%
-}
+}%
-\def\tikz@lib@graph@main@parser@cont{\tikz@lib@graph@check@quotes\tikz@lib@graph@main@parser@cont@normal}
+\def\tikz@lib@graph@main@parser@cont{\tikz@lib@graph@check@quotes\tikz@lib@graph@main@parser@cont@normal}%
\def\tikz@lib@graph@main@parser@cont@normal#1,{%
\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%
-}
+}%
@@ -524,50 +524,50 @@
\def\tikz@lib@graph@check@quotes#1{%
\let\tikz@lib@graph@cont@quote#1%
\pgfutil@ifnextchar"{\begingroup\pgfkeys@temptoks{}\pgfutil@empty\tikz@lib@graph@quote@parser}{\tikz@lib@graph@check@quotes@active}%
-}
-{
+}%
+{%
\catcode`\"=13\relax
\gdef\tikz@lib@graph@check@quotes@active{%
\pgfutil@ifnextchar"{\begingroup\pgfkeys@temptoks{}\pgfutil@empty\tikz@lib@graph@quote@parser@active}{\tikz@lib@graph@cont@quote}%
- }
+ }%
\gdef\tikz@lib@graph@quote@parser@active"#1"{%
\pgfkeys@temptoks\expandafter{\the\pgfkeys@temptoks #1}%
\pgfutil@ifnextchar"{\pgfkeys@temptoks\expandafter{\the\pgfkeys@temptoks "}\tikz@lib@graph@quote@parser@active}{\tikz@lib@graph@quote@parser@done}%
- }
-}
+ }%
+}%
\def\tikz@lib@graph@quote@parser"#1"{%
\pgfkeys@temptoks\expandafter{\the\pgfkeys@temptoks #1}%
\pgfutil@ifnextchar"{\pgfkeys@temptoks\expandafter{\the\pgfkeys@temptoks "}\tikz@lib@graph@quote@parser}{\tikz@lib@graph@quote@parser@done}%
-}
+}%
\def\tikz@lib@graph@quote@parser@done{%
{\expandafter\scantokens\expandafter{%
\expandafter\expandafter\expandafter\tikzlibgraphactivations\expandafter\expandafter\expandafter\tikzlibgraphdoedef\expandafter{\the\pgfkeys@temptoks}%
}}%
- {\expandafter\scantokens\expandafter{\expandafter\tikzlibgraphactivationsbrace\expandafter\xdef\expandafter\tikzlibgraphreplaced\expandafter<\tikzlibgraphreplaced>\catcode`\}=2\relax}}%
+ {\expandafter\scantokens\expandafter{\expandafter\tikzlibgraphactivationsbrace\expandafter\xdef\expandafter\tikzlibgraphreplaced\expandafter<\tikzlibgraphreplaced>\catcode`\}=2\relax}}%
\edef\tikzlibgraphreplaced{\expandafter\detokenize\expandafter{\tikzlibgraphreplaced}}
\pgfutil@ifnextchar/\tikz@lib@graph@quotes@slash\tikz@lib@graph@quotes@no@slash%
-}
+}%
\def\tikz@lib@graph@quotes@no@slash{%
\expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter%
\tikz@smuggle\expandafter\expandafter\expandafter{\expandafter\tikzlibgraphreplaced\expandafter/\expandafter{\the\pgfkeys@temptoks}}%
\expandafter\endgroup\expandafter\tikz@lib@graph@cont@quote\tikz@smuggle%
-}
+}%
\def\tikz@lib@graph@quotes@slash/{%
\pgfutil@ifnextchar/% Ah, double slash...
{\tikz@lib@graph@quotes@no@slash/}{\expandafter\endgroup\expandafter\tikz@lib@graph@cont@quote\tikzlibgraphreplaced/}%
-}
-\def\tikzlibgraphdoedef{\xdef\tikzlibgraphreplaced}
+}%
+\def\tikzlibgraphdoedef{\xdef\tikzlibgraphreplaced}%
\def\tikz@lib@prepare@active#1#2#3{%
{%
\catcode`#1=13\relax%
\scantokens{\gdef\tikzlibgraphactivator{\def#2{@#3@}}}%
- }
- \pgfutil@g@addto@macro\tikzlibgraphactivations{\catcode`#1=13\relax}
- \expandafter\pgfutil@g@addto@macro\expandafter\tikzlibgraphactivations\expandafter{\tikzlibgraphactivator}
-}
+ }%
+ \pgfutil@g@addto@macro\tikzlibgraphactivations{\catcode`#1=13\relax}%
+ \expandafter\pgfutil@g@addto@macro\expandafter\tikzlibgraphactivations\expandafter{\tikzlibgraphactivator}%
+}%
\let\tikzlibgraphactivations\pgfutil@empty
@@ -575,7 +575,7 @@
% Remove \outer from \+ for plain TeX
%
-\outer\def\tikz@lib@outer@test{\tabalign}
+\outer\def\tikz@lib@outer@test{\tabalign}%
\ifx\+\tikz@lib@outer@test
\def\+{\tabalign}
\fi
@@ -612,69 +612,69 @@
\tikz@lib@prepare@active{\#}{#}{NUMBER SIGN}
}
-\pgfutil@g@addto@macro\tikzlibgraphactivations{\catcode`\\=13\relax}
-{
+\pgfutil@g@addto@macro\tikzlibgraphactivations{\catcode`\\=13\relax}%
+{%
\catcode`\|=0\relax
\catcode`\\=13\relax
- |pgfutil@g@addto@macro|tikzlibgraphactivations{|def\{@REVERSE SOLIDUS@}}
-}
-{
- \gdef\tikzlibgraphscommercialat{@COMMERCIAL AT@}
- \let\g=\pgfutil@g@addto@macro
+ |pgfutil@g@addto@macro|tikzlibgraphactivations{|def\{@REVERSE SOLIDUS@}}%
+}%
+{%
+ \gdef\tikzlibgraphscommercialat{@COMMERCIAL AT@}%
+ \let\g=\pgfutil@g@addto@macro
\catcode`\@=13\relax
- \g\tikzlibgraphactivations{\catcode`\@=13\relax\let@=\tikzlibgraphscommercialat}
-}
+ \g\tikzlibgraphactivations{\catcode`\@=13\relax\let@=\tikzlibgraphscommercialat}%
+}%
\def\tikzlibgraphactivationsbrace{%
\catcode`\{=13\relax%
\catcode`\}=13\relax%
\catcode`\<=1\relax%
\catcode`\>=2\relax%
-}
-{
+}%
+{%
\catcode`\{=13\relax%
\catcode`\}=13\relax%
\catcode`\<=1\relax%
\catcode`\>=2\relax%
\pgfutil@g@addto@macro\tikzlibgraphactivationsbrace<\def{<@LEFT CURLY BRACE@>> %}
\pgfutil@g@addto@macro\tikzlibgraphactivationsbrace<\def}<@RIGHT CURLY BRACE@>> %{
->
+>%
% A normal node
% First, check for special quote syntax:
-\def\tikz@lib@graph@node{\tikz@lib@graph@check@quotes\tikz@lib@graph@node@normal}
+\def\tikz@lib@graph@node{\tikz@lib@graph@check@quotes\tikz@lib@graph@node@normal}%
\def\tikz@lib@graph@node@normal#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}%
+ %
+ % 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{%
@@ -685,52 +685,52 @@
}%
}%
}%
-}
+}%
\def\tikz@lib@graph@undirected@arrow-{%
\def\tikz@lib@graph@arrow@type{--}%
\tikz@lib@graph@after@arrow%
-}
+}%
\def\tikz@lib@graph@forward@arrow>{%
\def\tikz@lib@graph@arrow@type{->}%
\tikz@lib@graph@after@arrow%
-}
+}%
\def\tikz@lib@graph@bi@arrow>{%
\def\tikz@lib@graph@arrow@type{<->}%
\tikz@lib@graph@after@arrow%
-}
+}%
\def\tikz@lib@graph@no@arrow!-{%
\def\tikz@lib@graph@arrow@type{-!-}%
\tikz@lib@graph@after@arrow%
-}
+}%
\def\tikz@lib@graph@back@arrow{%
\pgfutil@ifnextchar>{\tikz@lib@graph@bi@arrow}{%
\def\tikz@lib@graph@arrow@type{<-}%
\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
+ %
+ % Ok, first recolor
%
\tikzgraphinvokeoperator{recolor source by=source''}
\tikzgraphinvokeoperator{recolor target by=target'}
% 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}}%
- %
+ %
\tikzgdeventgroupcallback{descendants}%
\tikz@lib@graph@parse@one%
-}
+}%
\def\tikz@lib@graph@joiner#1#2{%
\tikzgraphinvokeoperator{recolor source by=source'}
@@ -749,35 +749,35 @@
\pgf@temp%
}%
\tikzgraphinvokeoperator{not source',not target'}
-}
+}%
\def\tikz@lib@graph@unknown@edge@option#1{%
\def\tikz@temp{/tikz/graphs/@edges styling/.append=}
\expandafter\expandafter\expandafter\pgfkeys%
\expandafter\expandafter\expandafter{\expandafter\tikz@temp\expandafter{\expandafter,\pgfkeyscurrentname={#1}}}
-}
+}%
\def\tikz@lib@graph@graph@done\pgf@stop@eodashes{%
% Get local depth and width outside
\xdef\tikz@lib@graph@chain@depth{\pgfkeysvalueof{/tikz/graphs/placement/local depth}}
\xdef\tikz@lib@graph@chain@width{\pgfkeysvalueof{/tikz/graphs/placement/local width}}
% Get node list outside...
- \expandafter%
+ \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}%
% Compute new local depth and width of group...
\tikz@lib@graph@placement@after@chain@update
- %
+ %
\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{%
\pgfkeysvalueof{/tikz/graphs/@operators}%
-}
+}%
@@ -786,14 +786,14 @@
%
\def\tikz@lib@graph@grab@name{%
\pgfutil@ifnextchar\foreach\tikz@lib@graph@do@foreach\tikz@lib@graph@parse@node@text%
-}
+}%
\def\tikz@lib@graph@do@foreach\foreach#1in{%
\pgfutil@ifnextchar\bgroup{\tikz@lib@graph@do@foreach@normal{#1}}{\def\tikz@temp{#1}\tikz@lib@graph@do@foreach@macro}%
-}
+}%
\def\tikz@lib@graph@do@foreach@macro#1{%
\expandafter\expandafter\expandafter\tikz@lib@graph@do@foreach@normal\expandafter\tikz@temp\expandafter{#1}%
-}
+}%
\def\tikz@lib@graph@do@foreach@normal#1#2#3\pgf@stop{%
% Ok, we do a parse on a foreach loop.
@@ -823,13 +823,13 @@
% TODO: Need to also save hints!
\global\let\tikz@lib@graph@node@list@saved\tikz@lib@graph@node@list%
}%
- \expandafter%
+ \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}%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@lib@graph@node@list\tikz@lib@graph@node@list@saved}%
\expandafter\tikz@lib@graph@setup@placement\tikz@lib@graph@saved@placement%
-}
+}%
\def\tikz@lib@graph@setup@placement#1#2#3#4#5#6{%
\pgfkeyssetvalue{/tikz/graphs/placement/local depth}{#1}%
@@ -838,15 +838,15 @@
\pgfkeyssetvalue{/tikz/graphs/placement/element count}{#4}%
\pgfkeyssetvalue{/tikz/graphs/placement/width}{#5}%
\pgfkeyssetvalue{/tikz/graphs/placement/depth}{#6}%
-}
+}%
\def\tikz@lib@graph@parse@node@text#1\pgf@stop{%
- %
- % Ok, first test whether #1 contains "//"
- %
+ %
+ % Ok, first test whether #1 contains "//"
+ %
\pgfutil@in@{//}{#1 }
\ifpgfutil@in@%
- % Ok, a layout node:
+ % Ok, a layout node:
\tikz@lib@parse@layout@node#1\pgf@stop%
\else%
\tikz@lib@graph@fake@nodefalse
@@ -854,7 +854,7 @@
\def\tikz@lib@graph@empty@node@parsed{\tikzgdeventcallback{node}{}}%
\tikz@lib@parse@normal@node#1[\pgf@stop%
\fi%
-}
+}%
\newif\iftikzgraphsautonumbernodes
\newcount\tikz@lib@auto@number
@@ -865,16 +865,16 @@
\edef\tikz@lib@graph@name@only{\tikz@lib@graph@name@only\tikz@lib@auto@sep\the\tikz@lib@auto@number}%
\global\advance\tikz@lib@auto@number by1\relax%
\fi%
-}
+}%
-%
-% Parse the normal part of a node (name and, possibly, text after slash)
-%
+%
+% Parse the normal part of a node (name and, possibly, text after slash)
+%
\def\tikz@lib@parse@normal@node#1[{
- %
- % Test whether #1 contains "/" or "__"
- %
+ %
+ % Test whether #1 contains "/" or "__"
+ %
\pgfutil@in@{/}{#1}%
\ifpgfutil@in@%
\tikz@lib@parse@node@with@slash#1\pgf@stop%
@@ -888,25 +888,25 @@
\edef\tikz@lib@graph@name{\tikz@lib@graph@path\tikz@lib@graph@name@only}%
\fi%
\fi%
- \tikz@lib@graph@handle@node@cont%
-}
+ \tikz@lib@graph@handle@node@cont%
+}%
\def\tikz@lib@parse@node@with@slash#1/{
\pgfkeys@spdef\tikz@lib@graph@name@only{#1}%
\ifx\tikz@lib@graph@name@only\pgfutil@empty%
\global\advance\tikz@fig@count by1\relax
\edef\tikz@lib@graph@name@only{tikz@f@\the\tikz@fig@count}%
- \fi%
+ \fi%
\edef\tikz@lib@graph@name{\tikz@lib@graph@path\tikz@lib@graph@name@only}%
\pgfutil@ifnextchar"\tikz@lg@slash@quote{\pgfutil@ifnextchar\tikz@active@quotes@token\tikz@lg@slash@quote@active\tikz@lg@slash@cont}
-}
+}%
\def\tikz@lg@slash@quote"#1"#2\pgf@stop{%
\iftikz@handle@active@nodes%
\def\tikz@lib@graph@node@text{\scantokens{#1}}%
\else
\def\tikz@lib@graph@node@text{#1}%
\fi%
-}
+}%
{\catcode`\"=13\relax
\gdef\tikz@lg@slash@quote@active"#1"#2\pgf@stop{%
\iftikz@handle@active@nodes%
@@ -914,27 +914,27 @@
\else
\def\tikz@lib@graph@node@text{#1}%
\fi%
- }
-}
+ }%
+}%
\def\tikz@lg@slash@cont#1\pgf@stop{%
\iftikz@handle@active@nodes%
\def\tikz@lib@graph@node@text{\scantokens{#1}}%
\else
\def\tikz@lib@graph@node@text{#1}%
\fi%
-}
+}%
-\def\tikz@lib@parse@node@with@doubleunder#1__{\tikz@lib@parse@node@with@slash{#1}/}
+\def\tikz@lib@parse@node@with@doubleunder#1__{\tikz@lib@parse@node@with@slash{#1}/}%
\def\tikz@lg@find@fresh@name{%
\edef\tikz@lib@graph@name@only{\tikz@lib@graph@name@only'}%
\edef\tikz@lib@graph@name{\tikz@lib@graph@path\tikz@lib@graph@name@only}%
\tikz@lg@if@local@node{\tikz@lib@graph@name}{\tikz@lg@find@fresh@name}{}%
-}
+}%
-%
-% We have now parsed everything up to the opening "[". We continue
+%
+% We have now parsed everything up to the opening "[". We continue
%
\def\tikz@lib@graph@handle@node@cont{%
@@ -952,22 +952,22 @@
\expandafter\tikz@lib@graph@node@opt\expandafter[\expandafter]\expandafter[%
\fi%
}{\tikz@lib@graph@node@opt[}%
-}
+}%
\def\tikzgraphnodeas@default{%
\tikz@lib@graph@typesetter%
-}
+}%
\let\tikz@lib@graph@empty@node@parsed\relax%
\def\tikz@lib@graph@node@opt[#1]#2[\pgf@stop{%
\tikz@lib@graph@node@parsed{#1}%
-}
+}%
-\def\tikz@lib@graph@node@empty@done\pgf@stop{\tikz@lib@graph@empty@node@parsed}
+\def\tikz@lib@graph@node@empty@done\pgf@stop{\tikz@lib@graph@empty@node@parsed}%
-%
-% Parse a layout node
+%
+% Parse a layout node
%
\def\tikz@lib@parse@layout@node#1//{%
@@ -975,33 +975,33 @@
\let\tikz@lib@graph@node@parsed\tikz@lib@layout@node@parsed%
\let\tikz@lib@graph@empty@node@parsed\tikz@lib@graph@empty@layout@node@parsed
\tikz@lib@parse@normal@node#1[\pgf@stop%
-}
+}%
\newif\ifpgf@lib@graph@empty@layout@node
\def\tikz@lib@layout@node@parsed{%
\tikz@lib@layout@parse@rest%
-}
+}%
\def\tikz@lib@graph@empty@layout@node@parsed{%
\pgf@lib@graph@empty@layout@nodetrue
\tikz@lib@layout@parse@rest{}%
-}
+}%
\def\tikz@lib@layout@parse@rest#1{%
\def\tikz@lib@layout@node@options{#1}%
\pgfutil@ifnextchar[{\tikz@lib@layout@node@opt}{\tikz@lib@layout@node@opt[]}%}
-}
+}%
\def\tikz@lib@layout@node@parsed#1{%
\def\tikz@lib@layout@node@options{#1}%
\pgfutil@ifnextchar[{\tikz@lib@layout@node@opt}{\tikz@lib@layout@node@opt[]}%}
-}
+}%
\def\tikz@lib@layout@node@opt[#1]{%
\def\tikz@lib@layout@options{#1}%
\pgfutil@ifnextchar\bgroup{\tikz@lib@layout@start}{\tikzerror{Opening brace at beginning of sublayout expected}}%
-}
+}%
%
@@ -1029,7 +1029,7 @@
\c@pgf@counta=\tikz@temp\relax%
\advance\c@pgf@counta by1\relax%
\edef\tikz@temp{\the\c@pgf@counta}%
- \pgfkeyslet{/tikz/graphs/placement/level}\tikz@temp%
+ \pgfkeyslet{/tikz/graphs/placement/level}\tikz@temp%
\tikzgraphsset{
level/.try=\pgfkeysvalueof{/tikz/graphs/placement/level},
level \pgfkeysvalueof{/tikz/graphs/placement/level}/.try
@@ -1059,7 +1059,7 @@
/tikz/graphs/@nodes styling,%
#1}%
\pgfkeysgetvalue{/tikz/graphs/@operators}\tikz@lib@graph@op@save%
- \global\let\tikz@lib@graph@op@save\tikz@lib@graph@op@save%
+ \global\let\tikz@lib@graph@op@save\tikz@lib@graph@op@save%
}%
\else%
\node [%
@@ -1089,30 +1089,30 @@
\iftikz@lib@graph@trie\tikzgraphsset{name=\tikz@lib@graph@name@only}\fi%
\else
% The name of the node is a graph name
- \tikz@lib@graph@handle@graph{#1}%
+ \tikz@lib@graph@handle@graph{#1}%
\fi
- \fi%
-}
+ \fi%
+}%
\newif\iftikz@lib@graph@fake@node
\newif\iftikz@lib@graph@use@list
\def\tikz@lib@graph@test@use@list{%
\pgfutil@ifnextchar({\tikz@lib@graph@use@list@grap}{\tikz@lib@graph@test@use@list@done}%)
-}
+}%
-\def\tikz@lib@graph@test@use@list@done#1\pgf@stop{\tikz@lib@graph@use@listfalse}
-\def\tikz@lib@graph@use@list@grap(#1)\pgf@stop{\def\tikz@lib@graph@use@list{#1}\tikz@lib@graph@use@listtrue}
+\def\tikz@lib@graph@test@use@list@done#1\pgf@stop{\tikz@lib@graph@use@listfalse}%
+\def\tikz@lib@graph@use@list@grap(#1)\pgf@stop{\def\tikz@lib@graph@use@list{#1}\tikz@lib@graph@use@listtrue}%
-%
-% Typeset a layout node
+%
+% Typeset a layout node
%
\def\tikz@lib@layout@start#1#2\pgf@stop{%
\tikz@lib@ensure@gd@loaded%
% Parameters are:
- %
+ %
% Node name is \tikz@lib@graph@name@only
% Node text is \tikz@lib@graph@node@text
% Node options are \tikz@lib@layout@node@options
@@ -1130,8 +1130,8 @@
\fi%
\fi%
\edef\tikz@lib@graph@name{\tikz@lib@graph@path\tikz@lib@graph@name@only}%
- %
- % Prepare tikz node options
+ %
+ % Prepare tikz node options
%
\expandafter\expandafter\expandafter\def%
\expandafter\expandafter\expandafter\tikz@lib@layout@node@options\expandafter\expandafter\expandafter{\expandafter\tikz@lib@layout@startup@node@options\tikz@lib@layout@node@options,}%
@@ -1147,8 +1147,8 @@
\expandafter\expandafter\expandafter{%
\expandafter\tikz@lib@graph@node@text\expandafter}\expandafter{\tikz@lib@layout@node@options}
\fi%
- %
- % Here comes the scope:
+ %
+ % Here comes the scope:
%
\expandafter\expandafter\expandafter\scope\expandafter\expandafter\expandafter[\expandafter\tikz@lib@layout@node@options@prefix\tikz@lib@layout@options]
\tikzgdeventgroupcallback{array}%
@@ -1162,33 +1162,33 @@
\tikz@lib@graph@node@list%
\def\tikz@lg@old@col{\tikz@lgc@target@true}%
\tikz@lib@graph@node@list%
- \expandafter%
+ \expandafter%
\endscope\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@hint@aftergroup%
-}
+}%
\def\tikz@lib@make@subgraph@node#1#2#3{%
\pgfgdsubgraphnode{#1}{#3}{\pgfgdsubgraphnodecontents{#2}}%
-}
+}%
\def\tikz@lib@layout@startup@node@options{%
/utils/exec=\tikzlibignorecomparisonsINTERNAL,
/tikz/graphs/.cd,%
redirect unknown to tikz,%
anchor=base,%
/tikz/every subgraph node/.try,%
-}
+}%
\def\tikzlibignorecomparisonsINTERNAL{%
\pgfkeys{/handlers/first char syntax=true}
\pgfkeyssetvalue{/handlers/first char syntax/the character >}{\pgfutil@gobble}%
\pgfkeyssetvalue{/handlers/first char syntax/the character <}{\pgfutil@gobble}%
-}
-\def\tikz@lib@layout@node@options@prefix{graphs/.cd,}
+}%
+\def\tikz@lib@layout@node@options@prefix{graphs/.cd,}%
\ifx\tikz@lib@ensure@gd@loaded\pgfutil@undefined%
-\def\tikz@lib@ensure@gd@loaded{\tikzerror{You must say \string\usetikzlibrary{graphdrawing} to use the (sub)layout syntax}}
+\def\tikz@lib@ensure@gd@loaded{\tikzerror{You must say \string\usetikzlibrary{graphdrawing} to use the (sub)layout syntax}}%
\fi
\def\tikz@lg@local@node@handle#1{%
@@ -1198,46 +1198,46 @@
\tikzgdlatenodeoptionacallback{\tikz@lib@graph@name}%
\node also[graphs/redirect unknown to tikz,/tikz/graphs/.cd,#1](\tikz@lib@graph@name);%
\pgfkeysvalueof{/tikz/graphs/@operators}%
-}
+}%
\tikzgraphsset{redirect unknown to tikz/.style={
/tikz/graphs/.unknown/.code={%
- \let\tikz@key\pgfkeyscurrentname%
+ \let\tikz@key\pgfkeyscurrentname%
\pgfkeys{tikz/.cd,\tikz@key={##1},/tikz/graphs/.cd}%
}}
-}
+}%
\def\tikz@lib@activate@source@target@edge@syntax{%
\pgfkeys{/handlers/first char syntax=true}
\pgfkeyssetvalue{/handlers/first char syntax/the character >}{\tikz@lg@parse@more}%
\pgfkeyssetvalue{/handlers/first char syntax/the character <}{\tikz@lg@parse@less}%
-}
+}%
-\def\tikz@lg@parse@less#1{\tikz@lg@parse@less@#1\pgf@stop}
-\def\tikz@lg@parse@less@<{\pgfutil@ifnextchar"{\tikz@lg@parse@quote{source}}{\tikz@lg@parse@noquote{source}}}
-\def\tikz@lg@parse@more#1{\tikz@lg@parse@more@#1\pgf@stop}
-\def\tikz@lg@parse@more@>{\pgfutil@ifnextchar"{\tikz@lg@parse@quote{target}}{\tikz@lg@parse@noquote{target}}}
+\def\tikz@lg@parse@less#1{\tikz@lg@parse@less@#1\pgf@stop}%
+\def\tikz@lg@parse@less@<{\pgfutil@ifnextchar"{\tikz@lg@parse@quote{source}}{\tikz@lg@parse@noquote{source}}}%
+\def\tikz@lg@parse@more#1{\tikz@lg@parse@more@#1\pgf@stop}%
+\def\tikz@lg@parse@more@>{\pgfutil@ifnextchar"{\tikz@lg@parse@quote{target}}{\tikz@lg@parse@noquote{target}}}%
-\def\tikz@lg@parse@noquote#1#2\pgf@stop{{\tikzgraphsset{#1 edge style={#2}}}}
+\def\tikz@lg@parse@noquote#1#2\pgf@stop{{\tikzgraphsset{#1 edge style={#2}}}}%
\def\tikz@lg@parse@quote#1#2\pgf@stop{%
{\tikzgraphsset{/tikz/node quotes mean={#1 edge node={node [every edge quotes,##2]{##1}}},/utils/exec=\tikz@enable@node@quotes,#2}}%
-}
+}%
\tikzgraphsset{
clear >/.style=target edge clear,
clear </.style=source edge clear
-}
+}%
% Positioning
-\def\tikz@lib@graph@x{0}
-\def\tikz@lib@graph@y{0}
+\def\tikz@lib@graph@x{0}%
+\def\tikz@lib@graph@y{0}%
\tikzgraphsset{
x/.code=\def\tikz@lib@graph@x{#1}\tikz@lib@graphs@check@at,
y/.code=\def\tikz@lib@graph@y{#1}\tikz@lib@graphs@check@at
-}
+}%
\def\tikz@lib@graphs@check@at{%
\expandafter\expandafter\expandafter\def%
\expandafter\expandafter\expandafter\tikz@temp%
@@ -1246,7 +1246,7 @@
\expandafter\expandafter\expandafter{\expandafter\tikz@lib@graph@x\expandafter}%
\expandafter,\expandafter{\tikz@lib@graph@y})}%
\pgfqkeys{/tikz}{at/.expand once=\tikz@temp}%
-}
+}%
\newif\iftikz@lib@graph@trie
@@ -1259,24 +1259,24 @@
edge quotes/.style={/tikz/every edge quotes/.style={#1}},
edge quotes center/.style={edge quotes={anchor=center}},
edge quotes mid/.style={edge quotes={anchor=mid}}
-}
+}%
\def\tikz@lg@make@edge@node#1#2{%
\def\pgf@marshal{node[#2]}%
\expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@marshal\expandafter\expandafter\expandafter{\expandafter\pgf@marshal\expandafter{\tikzgraphnodetext}}%
\pgfkeysalso{#1 edge node/.expand once=\pgf@marshal,as=}%
-}
+}%
\newif\iftikz@lib@graph@fresh@node
-\tikzgraphsset{fresh nodes/.is if=tikz@lib@graph@fresh@node}
+\tikzgraphsset{fresh nodes/.is if=tikz@lib@graph@fresh@node}%
\tikzgraphsset{number nodes/.code=%
\pgfmathsetcount\tikz@lib@auto@number{#1}%
\tikzgraphsautonumbernodestrue,%
number nodes/.default=1,%
number nodes sep/.code=\def\tikz@lib@auto@sep{#1}
-}
-\def\tikz@lib@auto@sep{\space}
+}%
+\def\tikz@lib@auto@sep{\space}%
\newif\iftikz@lib@graph@node@created
@@ -1284,26 +1284,26 @@
% 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}}
+ \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
-}
+ \fi
+}%
\def\tikz@lib@graph@do@use#1{%
\tikz@lg@init@color{#1}{\tikz@lgc@all@true\tikz@lgc@source@true\tikz@lgc@target@true}%
-}
+}%
\tikzgraphsset{
typeset/.store in=\tikz@lib@graph@typesetter,
math nodes/.style={/tikz/graphs/typeset=$\tikzgraphnodetext$},
empty nodes/.style={/tikz/graphs/typeset=},
typeset=\tikzgraphnodetext
-}
+}%
-%
-% Handle scope
+%
+% Handle scope
%
\def\tikz@lib@graph@scope#1{
\begingroup%
@@ -1312,7 +1312,7 @@
\tikz@lib@graph@start@hint@group%
\tikz@lib@graph@parse@group{#1}%
\tikz@lib@graph@end@hint@group%
- \expandafter%
+ \expandafter%
\endgroup%
\expandafter\expandafter\expandafter\def%
\expandafter\expandafter\expandafter\tikz@lib@graph@node@list%
@@ -1324,7 +1324,7 @@
\tikzerror{One of the arrow types <-, --, ->, -!-, or <-> expected}%
}%
}%
-}
+}%
\def\tikz@lib@graph@scope@minus-{
\pgfutil@ifnextchar>\tikz@lib@graph@forward@arrow{%
@@ -1337,20 +1337,20 @@
}%
}%
}%
-}
+}%
\def\tikz@lib@graph@scope@less<-{\tikz@lib@graph@back@arrow}%
-%
-% Predefining graphs
-%
+%
+% Predefining graphs
+%
\tikzgraphsset{
declare/.code 2 args={\expandafter\def\csname tikz@lib@graph@def@#1\endcsname{\tikz@lib@graph@do@graph{#2}}}%
-}
+}%
\def\tikz@lib@graph@handle@graph#1{%
\begingroup%
@@ -1359,17 +1359,17 @@
\tikz@lib@graph@start@hint@group%
\csname tikz@lib@graph@def@\tikz@lib@graph@name@only\endcsname%
\tikz@lib@graph@end@hint@group%
- \expandafter%
+ \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}%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@lib@graph@node@list\tikz@lib@graph@node@list}%
\tikz@lib@graph@hint@aftergroup%
-}
+}%
\def\tikz@lib@graph@do@graph#1{%
\tikz@lib@graph@parse@group{#1}%
-}
+}%
\let\tikz@lib@graph@path\pgfutil@empty
@@ -1379,13 +1379,13 @@
name/.code={%
\edef\tikz@lib@graph@path{\tikz@lib@graph@path#1\tikz@lib@graph@name@separator}%
}%
-}
+}%
%
% Colors
-%
-\def\tikz@lg@newif{\csname newif\endcsname}
+%
+\def\tikz@lg@newif{\csname newif\endcsname}%
\tikzgraphsset{
as/.code=\def\tikzgraphnodeas{#1},%
color class/.style={%
@@ -1415,17 +1415,17 @@
color class=target,
color class=target',
color class=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%
\ifcsname tikz@lgca@@#1\endcsname\expandafter\global\expandafter\let\csname tikz@lgca@@#1\endcsname\relax\fi%
\ifcsname tikz@lgcb@@#1\endcsname\expandafter\global\expandafter\let\csname tikz@lgcb@@#1\endcsname\relax\fi%
-}
+}%
\def\tikz@lg@colorize#1{%
\expandafter\let\expandafter\pgf@temp\csname tikz@lgc@#1\endcsname%
@@ -1434,14 +1434,14 @@
\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%
@@ -1454,14 +1454,14 @@
\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%
-}
+}%
@@ -1479,25 +1479,25 @@
\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@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}
+\def\tikz@lib@reset@temp{\let\pgf@temp\iffalse}%
-%
-% Handle connection annotations
+%
+% Handle connection annotations
%
\def\tikz@lib@annotate@#1#2#3#4{%
\expandafter\ifx\csname tikz@lgc#1@@#2\endcsname\relax%
\expandafter\gdef\csname tikz@lgc#1@@#2\endcsname{{#3}{#4}}%
- \else%
+ \else%
\expandafter\expandafter\expandafter\tikz@lib@annotate@read\csname tikz@lgc#1@@#2\endcsname{#3}{#4}%
\expandafter\global\expandafter\let\csname tikz@lgc#1@@#2\endcsname\pgf@temp%
\fi%
-}
-\def\tikz@lib@annotate@read#1#2#3#4{\def\pgf@temp{{#1,#3}{#2#4}}}
+}%
+\def\tikz@lib@annotate@read#1#2#3#4{\def\pgf@temp{{#1,#3}{#2#4}}}%
\tikzgraphsset{
source edge style/.code=\tikz@lib@annotate@{a}{\tikz@lib@graph@name}{#1}{},
@@ -1525,7 +1525,7 @@
\expandafter
}\expandafter%
\def\expandafter\tikz@lib@graph@node@list\expandafter{\tikz@lg@packed}%
-}
+}%
\def\tikz@lg@packer#1{%
\expandafter\ifx\csname tikz@lg@p@#1\endcsname\pgf@stop%
@@ -1533,7 +1533,7 @@
\expandafter\let\csname tikz@lg@p@#1\endcsname\pgf@stop%
\expandafter\def\expandafter\tikz@lg@packed\expandafter{\tikz@lg@packed\tikz@lg@do{#1}}
\fi
-}
+}%
%
% Color functions
@@ -1543,11 +1543,11 @@
%
% #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
+% macro should take a single parameter, which will be set
% to the node's name.
\def\tikzgraphforeachcolorednode#1#2{%
@@ -1555,8 +1555,8 @@
\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%
-}
+ \tikz@lib@graph@node@list%
+}%
\def\tikz@lg@pick#1{
{%
\csname tikz@lgc@#1\endcsname%
@@ -1567,18 +1567,18 @@
\fi%
}%
\iftikz@color@test\tikz@lib@graph@action{#1}\fi%
-}
+}%
-% Prepare a color
+% 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,
@@ -1587,7 +1587,7 @@
% 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
@@ -1599,18 +1599,18 @@
\tikz@lib@graph@count0\relax
\def\tikz@lib@graph@prefix{#3}%
\tikzgraphforeachcolorednode{#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
+%
+% The bipartite connector
%
\tikzgraphsset{
@@ -1625,21 +1625,21 @@
complete bipartite={#1}{#2}
},
induced complete bipartite/.default={target'}{source'},
-}
+}%
\def\tikz@lib@graph@bipartite@outer#1{%
\def\tikz@lib@graph@from{#1}%
{%
\tikzgraphforeachcolorednode{\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#1#2{%
\pgfkeysgetvalue{/tikz/graphs/@edges styling}\pgf@temp
@@ -1652,7 +1652,7 @@
\expandafter\expandafter\expandafter{\expandafter\pgf@temp\tikz@lib@add@temp}%
\expandafter\expandafter\expandafter\tikz@lib@graph@default@new@edge@%
\expandafter\expandafter\expandafter{\expandafter\pgf@temp\expandafter}\expandafter{\pgf@temp@b}{#1}{#2}%
-}
+}%
\def\tikz@lib@graph@default@new@edge@#1#2#3#4{%
\iftikz@lib@graph@simple%
\edef\tikz@temp{{\pgfkeysvalueof{/tikz/graphs/default edge kind}}{#3}{#4}}
@@ -1660,24 +1660,24 @@
\else%
\pgfkeys{/tikz/graphs/.cd,new \pgfkeysvalueof{/tikz/graphs/default edge kind}={#3}{#4}{#1}{#2}}%
\fi%
-}
+}%
\def\tikz@lib@graph@add@edge@annotations#1#2{%
\ifcsname tikz@lgc#1@@#2\endcsname%
\expandafter\let\expandafter\tikz@lg@temp@\csname tikz@lgc#1@@#2\endcsname%
\ifx\tikz@lg@temp@\relax\else
\expandafter\tikz@lib@graph@add@edge@annotations@\tikz@lg@temp@%
- \let\tikz@lib@add@temp\tikz@lib@final@edge@style
+ \let\tikz@lib@add@temp\tikz@lib@final@edge@style
\fi%
\fi%
-}
+}%
\def\tikz@lib@graph@add@edge@annotations@#1#2{
\expandafter\def\expandafter\pgf@temp\expandafter{\pgf@temp,#1}%
\expandafter\def\expandafter\pgf@temp@b\expandafter{\pgf@temp@b#2}%
-}
-\def\tikz@lib@final@edge@style{,after source and target edge/.try}
+}%
+\def\tikz@lib@final@edge@style{,after source and target edge/.try}%
-%
-% The clique connector
+%
+% The clique connector
%
\tikzgraphsset{
@@ -1686,7 +1686,7 @@
\tikz@lg@clique@loop%
}},
clique/.default=all
-}
+}%
\def\tikz@lg@clique@loop{%
\ifnum\c@pgf@counta=0\relax%
@@ -1696,7 +1696,7 @@
\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%
@@ -1704,11 +1704,11 @@
\tikz@lib@graph@default@new@edge{\csname tikz@lg\the\c@pgf@countb\endcsname}{\csname tikz@lg\the\c@pgf@counta\endcsname}%
\expandafter\tikz@lg@clique@loop@inner%
\fi%
-}
+}%
-%
-% The independent set connector
+%
+% The independent set connector
%
\tikzgraphsset{
@@ -1720,7 +1720,7 @@
\pgfkeyslet{/tikz/graphs/default edge kind}\tikz@lg@default%
}},
induced independent set/.default=all
-}
+}%
\def\tikz@lg@indep@loop{%
\ifnum\c@pgf@counta=0\relax%
@@ -1730,7 +1730,7 @@
\advance\c@pgf@counta by-1\relax%
\expandafter\tikz@lg@indep@loop%
\fi%
-}
+}%
\def\tikz@lg@indep@loop@inner{%
\advance\c@pgf@countb by-1\relax%
@@ -1738,22 +1738,22 @@
\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@indep@loop@inner%
\fi%
-}
+}%
-%
-% The path connector
+%
+% The path connector
%
\tikzgraphsset{
path/.style={operator={%
\let\tikz@lg@prev\relax%
\tikzgraphforeachcolorednode{#1}\tikz@lib@graph@path@do%
- }},
+ }},
path/.default=all,
induced path/.style={induced independent set={#1},path={#1}},
induced path/.default=all,
-}
+}%
\def\tikz@lib@graph@path@do#1{%
\ifx\tikz@lg@prev\relax%
@@ -1761,11 +1761,11 @@
\tikz@lib@graph@default@new@edge{\tikz@lg@prev}{#1}%
\fi
\def\tikz@lg@prev{#1}%
-}
+}%
-%
-% The cycle connector
+%
+% The cycle connector
%
\tikzgraphsset{
@@ -1781,7 +1781,7 @@
cycle/.default=all,
induced cycle/.style={induced independent set={#1},cycle={#1}},
induced cycle/.default=all,
-}
+}%
\def\tikz@lib@graph@cycle@do#1{%
\ifx\tikz@lg@prev\relax%
@@ -1791,13 +1791,13 @@
\tikz@lib@graph@default@new@edge{\tikz@lg@prev}{#1}%
\def\tikz@lg@prev{#1}%
\fi%
-}
+}%
-%
-% The matching and star connector
+%
+% The matching and star connector
%
\tikzgraphsset{
@@ -1811,7 +1811,7 @@
}%
},
matching and star/.default={target'}{source'}
-}
+}%
\def\tikz@lib@graph@flow@do#1{%
\advance\c@pgf@countb by1\relax%
@@ -1822,7 +1822,7 @@
\tikz@lib@graph@default@new@edge{\csname tikz@lg\the\c@pgf@countb\endcsname}{#1}%
\fi%
\def\tikz@lg@prev{#1}%
-}
+}%
\def\tikz@lib@graph@flow@rest{%
\ifnum\c@pgf@countb<\c@pgf@counta\relax%
@@ -1832,12 +1832,12 @@
\expandafter\tikz@lib@graph@flow@rest%
\fi%
\fi%
-}
+}%
-%
-% The matching connector
+%
+% The matching connector
%
\tikzgraphsset{
@@ -1849,7 +1849,7 @@
}%
},
matching/.default={target'}{source'}
-}
+}%
\def\tikz@lib@graph@matching@do#1{%
\advance\c@pgf@countb by1\relax%
@@ -1857,14 +1857,14 @@
\else%
\tikz@lib@graph@default@new@edge{\csname tikz@lg\the\c@pgf@countb\endcsname}{#1}%
\fi%
-}
+}%
-%
-% The butterfly connector
+%
+% The butterfly connector
%
\tikzgraphsset{
@@ -1889,7 +1889,7 @@
butterfly/to/.initial=source',
butterfly'/.style={operator={}{\tikz@butterfly@primetrue\pgfkeysalso{butterfly={#1}}}},
butterfly'/.default=,
-}
+}%
\newif\iftikz@butterfly@prime
@@ -1924,15 +1924,15 @@
\c@pgf@countc=\c@pgf@counta\relax%
\fi%
\tikz@lib@graph@default@new@edge{\csname tikz@lg\the\c@pgf@countc\endcsname}{#1}%
-}
+}%
-%
-% The no edges connector
%
-\tikzgraphsset{no edges/.style={operator=\relax}}
+% The no edges connector
+%
+\tikzgraphsset{no edges/.style={operator=\relax}}%
@@ -1949,7 +1949,7 @@
}%
},
grid/.default=all
-}
+}%
\def\tikzgraphpreparewrapafter{%
\pgfkeysgetvalue{/tikz/graphs/wrap after}\tikz@temp%
@@ -1960,7 +1960,7 @@
\else%
\edef\tikzgraphwrapafter{\tikz@temp}
\fi%
-}
+}%
\def\tikz@lg@grid@loop{%
\ifnum\c@pgf@counta=0\relax%
@@ -1982,7 +1982,7 @@
\advance\c@pgf@counta by-1\relax%
\expandafter\tikz@lg@grid@loop%
\fi%
-}
+}%
@@ -1992,32 +1992,32 @@
% It is not the job of the graph library to compute good positions for
% nodes in a graph. However, some basic support is provided for simple
% cases.
-%
+%
% The idea is at follows: Graphs are specified hierarchically. For
% instance, consider the following graph specification:
-%
+%
% graph { a, b, c -> d -> {e -> f -> g, h} -> i, j -> k }
-%
+%
% Here, we have the *group* {e->f->g,h} inside the larger graph
% specification. Each group consists of sequence of *chains* like
% e->f->g or j->k.
-%
+%
% In order to facilitate the automatic positioning of nodes, the graph
% library will provide you with information about the position of
% nodes inside their groups and chains.
-%
+%
% As a chain is being parsed, a counter stored in
% /tikz/graphs/placement/element count is available that is advanced for
-% each element in the chain.
-%
+% each element in the chain.
+%
% Additionally, a counter stored in placement/width is
% available. This "logical" width is defined recursively as follows: The
% width of a single node is computed by calling the key
% placement/logical node width, which should return a real or logical
-% width of the node passed as a parameter in the macor \pgfmathresult. The
+% width of the node passed as a parameter in the macro \pgfmathresult. The
% width of a chain is the sum of the widths of its elements. The
% width of a group is the maximum of the widths of its elements.
-%
+%
%
% Symmetrically, as a group is being constructed, a counter stored in
% placement/chain count is available that is advanced for each chain
@@ -2025,21 +2025,21 @@
% recursively as follows: For a single node, the depth is
% computed by the key placement/logical node depth. The depth
% of a group is the sum of the depths of its elements. The depth of a
-% chain is the maximum of the depth of its elements.
+% chain is the maximum of the depth of its elements.
+%
%
-%
% The above keys get updated automatically. You should setup the key
% placement/compute position such that it uses the above keys to
% compute a good position for a new node based on the above
% keys. Typically, this key should execute node={shift=(...)} to setup
% the necessary shift for a new node.
-%
+%
% The key placement/compute position should not be called
% directly. Instead, the key placement/place should be used. This key
% has two effects: First, it calls placement/compute position. Second,
% it resets the length and normal counters. It will setup a completely
% new counting of lengths and counters inside the current scope.
-%
+%
% The placmenet/place key is executed automatically whenever a new
% node is automatically created. Furthermore, placement strategies
% will call this key.
@@ -2064,20 +2064,20 @@
level/.initial=0,
logical node depth/.code=\def\pgfmathresult{1},
logical node width/.code=\def\pgfmathresult{1},
-}
+}%
\def\tikz@lib@graph@reset@locals{%
\gdef\tikz@lib@graph@group@depth{0}%
\gdef\tikz@lib@graph@group@width{0}%
-}
+}%
-% Arrange nodes evenly
-%
+% Arrange nodes evenly
+%
% This strategy works as follows: You specify a "chain shift vector"
% and a "group shift vector". Then each new element on a chain is
% shifted by the chain shift vector relative to the previous element
-% on the chain. Similarly for each new element of a group.
+% on the chain. Similarly for each new element of a group.
\tikzgraphsset{
Cartesian placement/.style={
@@ -2142,9 +2142,9 @@
placement/logical node depth/.code=\def\pgfmathresult{1}
},
branch down/.default=1,
- %
- % Sep shifts
- %
+ %
+ % Sep shifts
+ %
grow right sep/.style={
Cartesian placement,
chain shift={(1pt,0)},
@@ -2217,26 +2217,26 @@
nodes={anchor=\csname tikz@lib@graph@auto@\tikz@lib@graph@auto@h @\tikz@lib@graph@auto@v\endcsname},
/utils/exec=\def\tikz@lib@graph@auto@v{#1}
},
- %
- %
+ %
+ %
no placement/.style={
placement/place,
placement/compute position/.code=%
}
-}
+}%
-\def\tikz@lib@graph@auto@h{center}
-\def\tikz@lib@graph@auto@v{center}
+\def\tikz@lib@graph@auto@h{center}%
+\def\tikz@lib@graph@auto@v{center}%
-\def\tikz@lib@graph@auto@center@center{center}
-\def\tikz@lib@graph@auto@west@center{west}
-\def\tikz@lib@graph@auto@east@center{east}
-\def\tikz@lib@graph@auto@center@north{north}
-\def\tikz@lib@graph@auto@west@north{north west}
-\def\tikz@lib@graph@auto@east@north{north east}
-\def\tikz@lib@graph@auto@center@south{south}
-\def\tikz@lib@graph@auto@west@south{south west}
-\def\tikz@lib@graph@auto@east@south{south east}
+\def\tikz@lib@graph@auto@center@center{center}%
+\def\tikz@lib@graph@auto@west@center{west}%
+\def\tikz@lib@graph@auto@east@center{east}%
+\def\tikz@lib@graph@auto@center@north{north}%
+\def\tikz@lib@graph@auto@west@north{north west}%
+\def\tikz@lib@graph@auto@east@north{north east}%
+\def\tikz@lib@graph@auto@center@south{south}%
+\def\tikz@lib@graph@auto@west@south{south west}%
+\def\tikz@lib@graph@auto@east@south{south east}%
\def\tikz@lib@graph@linear@pos{%
\pgfkeysgetvalue{/tikz/graphs/chain shift}\tikz@temp
@@ -2251,29 +2251,29 @@
\advance\pgf@ya by\pgf@y%
\edef\tikz@lib@graph@shift{(\the\pgf@xa,\the\pgf@ya)}
\pgfkeys{/tikz/graphs/nodes/.expanded={shift={\tikz@lib@graph@shift}}}
-}
+}%
\def\tikz@lib@graph@width@sep#1#2{%
\pgf@process{\pgfpointdiff{\pgfpointanchor{#1}{west}}{\pgfpointanchor{#1}{east}}}%
\pgfmathparse{#2+\the\pgf@x}%
-}
+}%
\def\tikz@lib@graph@depth@sep#1#2{%
\pgf@process{\pgfpointdiff{\pgfpointanchor{#1}{south}}{\pgfpointanchor{#1}{north}}}%
\pgfmathparse{#2+\the\pgf@y}%
-}
+}%
-% Circular arrangements
-%
+% Circular arrangements
+%
% This strategy works a bit like the arrange evenly strategy, but in
% polar coordinates. Both for the chains and the groups you specify a
% polar shift, which must be in the form "(delta degree:delta
% distance)". For each element in a chain, the delta degree is added
% to the chain degree, likewise for each element the delta distance is
% added. Similarly for groups.
-%
+%
% There is an initial degree and radius, stored in the key "phase" and
% "radius".
@@ -2298,7 +2298,7 @@
group polar shift/.initial={(60:0)},
radius/.initial=1cm,
phase/.initial=90,
-}
+}%
\def\tikz@lib@graph@circular@pos{%
\pgfkeysgetvalue{/tikz/graphs/chain polar shift}\tikz@temp
@@ -2316,13 +2316,13 @@
\pgfmathsetmacro\tikz@temp{\the\pgf@xa+\pgfkeysvalueof{/tikz/graphs/phase}}%
\edef\tikz@lib@graph@shift{(\tikz@temp:\the\pgf@ya)}
\pgfkeys{/tikz/graphs/nodes/.expanded={shift={\tikz@lib@graph@shift}}}
-}
+}%
\def\tikz@lib@graph@decompose@polar(#1:#2){%
\pgfmathsetlength\pgf@x{#1}%
\pgfmathsetlength\pgf@y{#2}%
-}
+}%
% Grid arrangements
@@ -2332,7 +2332,7 @@
placement/place,
placement/compute position/.code=\tikz@lib@graph@grid@pos,%
},
-}
+}%
\def\tikz@lib@graph@grid@pos{%
@@ -2355,33 +2355,33 @@
\pgfkeysgetvalue{/tikz/graphs/group shift}\tikz@temp%
\expandafter\tikz@scan@one@point\expandafter\tikz@lib@graph@grid@pos@a\tikz@temp%
\pgfkeysgetvalue{/tikz/graphs/chain shift}\tikz@temp%
- \expandafter\tikz@scan@one@point\expandafter\tikz@lib@graph@grid@pos@b\tikz@temp%
+ \expandafter\tikz@scan@one@point\expandafter\tikz@lib@graph@grid@pos@b\tikz@temp%
%
% apply the shift
%
\edef\tikz@lib@graph@shift{(\the\pgf@xa,\the\pgf@ya)}
\pgfkeys{/tikz/graphs/nodes/.expanded={shift={\tikz@lib@graph@shift}}}
-}
+}%
-\def\tikz@lib@graph@grid@pos@a#1{\pgf@process{\pgfpointscale{\tikz@temp@row}{#1}}\pgf@xa=\pgf@x\relax\pgf@ya=\pgf@y\relax}
+\def\tikz@lib@graph@grid@pos@a#1{\pgf@process{\pgfpointscale{\tikz@temp@row}{#1}}\pgf@xa=\pgf@x\relax\pgf@ya=\pgf@y\relax}%
\def\tikz@lib@graph@grid@pos@b#1{\pgf@process{\pgfpointscale{\tikz@temp@col}{#1}}%
\advance\pgf@xa by\pgf@x\relax
- \advance\pgf@ya by\pgf@y\relax}
+ \advance\pgf@ya by\pgf@y\relax}%
\tikzgraphsset{
% Grids:
wrap after/.initial=0,
% Node sets:
V/.code={%
- \def\tikzgraphV{#1}
- \c@pgf@counta=0\foreach \tikz@dummy in {#1} {\global\advance\c@pgf@counta by1\relax}
+ \def\tikzgraphV{#1}%
+ \c@pgf@counta=0\foreach \tikz@dummy in {#1} {\global\advance\c@pgf@counta by1\relax}%
\edef\tikzgraphVnum{\the\c@pgf@counta}
},
V={1},
n/.style={V={1,...,#1},name shore V/.style={name=V}},
W/.code={%
- \def\tikzgraphW{#1}
- \c@pgf@counta=0\foreach \tikz@dummy in {#1} {\global\advance\c@pgf@counta by1\relax}
+ \def\tikzgraphW{#1}%
+ \c@pgf@counta=0\foreach \tikz@dummy in {#1} {\global\advance\c@pgf@counta by1\relax}%
\edef\tikzgraphWnum{\the\c@pgf@counta}
},
W={1},
@@ -2389,7 +2389,7 @@
% Shores:
name shore V/.style=,
name shore W/.style=,
-}
+}%
@@ -2439,7 +2439,7 @@
%
%
% Things that are allowed in the normal syntax, but not in the quick
-% syntax, include:
+% syntax, include:
%
% - Connecting a node and a group as in a->{b,c}.
% - Node names without quotation marks.
@@ -2464,7 +2464,7 @@
%
%
-\tikzgraphsset{quick/.is if=tikz@graph@quick}
+\tikzgraphsset{quick/.is if=tikz@graph@quick}%
\newif\iftikz@graph@quick
\def\tikz@lib@graphs@parse@quick@graph{
@@ -2475,21 +2475,21 @@
\let\tikzgraphnodepath\pgfutil@empty%
\tikz@q@outertrue%
\afterassignment\tikz@lib@graphs@quick@main\let\pgf@temp=%
-}
+}%
\newcount\tikz@qnode@count
\newif\iftikz@q@outer
\def\tikz@lib@graphs@quick@main{%
\afterassignment\tikz@lib@graphs@quick@handle\let\pgf@let@token=%
-}
+}%
\def\tikz@lib@graphs@quick@handle{%
\ifx\pgf@let@token"%
\expandafter\tikz@lib@graphs@quick@first@node%
\else%
\expandafter\tikz@lib@graphs@quick@other%
\fi%
-}
+}%
\def\tikz@lib@graphs@quick@other{%
\let\tikz@next\tikz@lib@graphs@quick@error%
\ifx\pgf@let@token\egroup%
@@ -2502,22 +2502,22 @@
\let\tikz@next\tikz@lib@graphs@quick@main%
\fi%
\fi
- \fi%
+ \fi%
\tikz@next%
-}
+}%
-\def\tikz@lib@graphs@quick@error#1{\tikzerror{Unexpected token '\string#1' in quick graph syntax}\tikz@lib@graphs@quick@main}
+\def\tikz@lib@graphs@quick@error#1{\tikzerror{Unexpected token '\string#1' in quick graph syntax}\tikz@lib@graphs@quick@main}%
\def\tikz@lib@graphs@quick@start@group{%
\pgfutil@ifnextchar[\tikz@lib@graphs@quick@start@group@{\tikzerror{Group
in quick graph syntax must start with options.}}
-}
+}%
\def\tikz@lib@graphs@quick@start@group@[#1]{%
\begingroup%
\tikz@q@outerfalse%
\tikzgraphsset{#1}%
\tikz@lib@graphs@quick@main%
-}
+}%
\def\tikz@lib@graphs@quick@end@group{%
\iftikz@q@outer%
\endgroup%
@@ -2526,27 +2526,27 @@
\ifnum\tikz@qnode@count>0\relax%
\expandafter\global\expandafter\let\csname tikz@gr@q@@\csname tikz@gr@qn@@\the\tikz@qnode@count\endcsname\endcsname\relax%
\expandafter\global\expandafter\let\csname tikz@gr@qn@@\the\tikz@qnode@count\endcsname\relax%
- \global\advance\tikz@qnode@count by-1\relax%
+ \global\advance\tikz@qnode@count by-1\relax%
\pgfutil@repeat%
\expandafter\tikz@lib@graph@main@done%
\else%
\endgroup%
- \expandafter\tikz@lib@graphs@end@group@%
- \fi%
-}
+ \expandafter\tikz@lib@graphs@end@group@%
+ \fi%
+}%
\def\tikz@lib@graphs@end@group@{%
\pgfutil@ifnextchar;{\expandafter\tikz@lib@graphs@quick@main\pgfutil@gobble}{%
\pgfutil@ifnextchar,{\expandafter\tikz@lib@graphs@quick@main\pgfutil@gobble}{%
\tikzerror{Graph groups in quick syntax must be followed by a semicolon or a comma.}%
}%
}%
-}
+}%
\def\tikz@lib@graphs@quick@first@node{%
\let\tikz@quick@prev@node\relax%
\tikz@lib@graphs@quick@node%
-}
+}%
\def\tikz@lib@graphs@quick@node#1"{%
\def\tikzgraphnodename{#1}%
@@ -2556,14 +2556,14 @@
\global\advance\tikz@lib@auto@number by1\relax%
\fi
\pgfutil@ifnextchar/\tikz@lib@graphs@quick@text\tikz@lib@graphs@quick@opt%
-}
+}%
\def\tikz@lib@graphs@quick@text/"#1"{%
\def\tikzgraphnodetext{#1}%
\tikz@lib@graphs@quick@opt%
-}
+}%
\def\tikz@lib@graphs@quick@opt{%
\pgfutil@ifnextchar[\tikz@lib@graphs@quick@withopt{\tikz@lib@graphs@quick@withopt[]}%]
-}
+}%
\def\tikz@lib@graphs@quick@withopt[#1]{%
% Test, whether node already exists
\expandafter\ifx\csname tikz@gr@q@@\tikzgraphnodename\endcsname\relax%
@@ -2583,56 +2583,56 @@
\tikzgraphnodeas%
};%
\else%
- %
+ %
% Handle late options and operators
\tikzgdlatenodeoptionacallback{\tikzgraphnodename}%
\node also[graphs/redirect unknown to tikz,/tikz/graphs/.cd,#1](\tikzgraphnodename);%
\fi%
- % Connect, if necessary
+ % Connect, if necessary
\tikz@lig@graph@quikc@make@edge@if@necessary%
\tikz@lib@graphs@quick@scan@after@node%
-}
+}%
\def\tikz@lig@graph@quikc@make@edge@if@necessary{%
\ifx\tikz@quick@prev@node\relax%
\else%
\tikz@lib@graphs@quick@make@edge%
\fi%
-}
+}%
\def\tikz@lib@graphs@quick@scan@after@node{%
\pgfutil@ifnextchar,\tikz@lib@graphs@quick@comma{%
\pgfutil@ifnextchar;\tikz@lib@graphs@quick@semi{%
\pgfutil@ifnextchar\egroup{\tikz@lib@graphs@quick@semi;}{%
\pgfutil@ifnextchar\par{\expandafter\tikz@lib@graphs@quick@scan@after@node\tikz@lib@graphs@quick@gobble@par}%
- \tikz@lib@graphs@quick@connector}}}%
-}
+ \tikz@lib@graphs@quick@connector}}}%
+}%
\long\def\tikz@lib@graphs@quick@gobble@par#1{}%
-\def\tikz@lib@graphs@quick@comma,{\tikz@lib@graphs@quick@main}
-\def\tikz@lib@graphs@quick@semi;{\tikz@lib@graphs@quick@main}
+\def\tikz@lib@graphs@quick@comma,{\tikz@lib@graphs@quick@main}%
+\def\tikz@lib@graphs@quick@semi;{\tikz@lib@graphs@quick@main}%
\def\tikz@lib@graphs@quick@connector#1#2{%
\def\tikz@lib@graphs@quick@edge@kind{#1#2}%
\pgfutil@ifnextchar>\tikz@lib@graphs@back@edge{%
\pgfutil@ifnextchar[\tikz@lib@graphs@quick@connector@handle@opt{\tikz@lib@graphs@quick@connector@handle@opt[]}%]
}%
-}
+}%
\def\tikz@lib@graphs@back@edge#1{%
\expandafter\def\expandafter\tikz@lib@graphs@quick@edge@kind\expandafter{\tikz@lib@graphs@quick@edge@kind#1}%
\pgfutil@ifnextchar[\tikz@lib@graphs@quick@connector@handle@opt{\tikz@lib@graphs@quick@connector@handle@opt[]}%]
-}
+}%
\def\tikz@lib@graphs@quick@connector@handle@opt[#1]{%
\def\tikz@lib@graphs@quick@edge@options{#1}%
\let\tikz@quick@prev@node\tikzgraphnodename%
\tikz@lib@graphs@quick@scan@after@connector%
-}
+}%
\def\tikz@lib@graphs@quick@scan@after@connector{%
\pgfutil@ifnextchar\par{\expandafter\tikz@lib@graphs@quick@scan@after@connector\tikz@lib@graphs@quick@gobble@par}{%
\pgfutil@ifnextchar"{\expandafter\tikz@lib@graphs@quick@node\pgfutil@gobble}{%
\tikzerror{Quotation marks expected after edge connector}%
}%
}%
-}
+}%
\def\tikz@lib@graphs@quick@make@edge{%
{
@@ -2640,22 +2640,22 @@
\expandafter\expandafter\expandafter\tikz@lib@graphs@quick@make@edge@for%
\expandafter\expandafter\expandafter{\expandafter\tikz@quick@prev@node\expandafter}\expandafter{\tikzgraphnodename}%
}
-}
+}%
\def\tikz@lib@graphs@quick@make@edge@styling#1{%
\tikz@enable@edge@quotes%
\tikzgraphsset{.unknown/.code=\tikz@lib@graph@unknown@edge@option{##1},#1}%
-}
+}%
\def\tikz@lib@graphs@quick@make@edge@for#1#2{%
\pgfkeysgetvalue{/tikz/graphs/@edges styling}\pgf@tempa
\pgfkeysgetvalue{/tikz/graphs/@edges node}\pgf@temp@b
\expandafter\expandafter\expandafter\tikz@lib@graphs@quick@make@edge@for@with%
\expandafter\expandafter\expandafter{\expandafter\pgf@tempa\expandafter}\expandafter{\pgf@temp@b}{#1}{#2}%
-}
+}%
\def\tikz@lib@graphs@quick@make@edge@for@with#1#2#3#4{%
\tikzgraphsset{new \tikz@lib@graphs@quick@edge@kind={#3}{#4}{#1}{#2}}%
-}
+}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.standard.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.standard.code.tex
index a56702bcf96..bfceb3769a5 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.standard.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/graphs/tikzlibrarygraphs.standard.code.tex
@@ -8,7 +8,7 @@
%
% 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.standard.code.tex,v 1.9 2012/02/27 20:00:11 tantau Exp $
+\ProvidesFileRCS{tikzlibrarygraphs.standard.code.tex}
%
@@ -43,16 +43,16 @@
},
%
% A complete bipartite graph with shores V and W.
- %
+ %
declare={subgraph K_nm}%
{
- [color class=shore V,
+ [color class=shore V,
color class=shore W,
complete bipartite={shore V}{shore W}]
subgraph I_n [name shore V, shore V] -- [no edges]
subgraph I_n [name shore W, V/.expand once=\tikzgraphW, shore W]
},
- %
+ %
% A cycle with n nodes.
%
declare={subgraph C_n}%
@@ -60,9 +60,9 @@
[cycle]
subgraph I_n
},
- %
+ %
% A path with n nodes.
- %
+ %
declare={subgraph P_n}%
{
[path]
@@ -78,8 +78,8 @@
},
%
% A random graph according to the G_{n,p} model: For each pair of
- % vertices there is an edge between them with probability p.
- %
+ % vertices there is an edge between them with probability p.
+ %
p/.initial=0.5,
declare={subgraph G_np}%
{
@@ -105,8 +105,4 @@
[parse/.expand once=\tikz@lg@temp]
}
},
-}
-
-
-
-
+}%
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
index 50829d90f46..645191dbabf 100644
--- 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
@@ -37,6 +37,9 @@
\newif\iftikzexternal@export@enabled
\tikzexternal@export@enabledtrue
+% must be numeric!
+\gdef\c@tikzexternal@version{2}
+
% This 'if' can be used as part of the public user interface.
%
% It is set by the 'remake next' key.
@@ -138,7 +141,7 @@
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!
+ \pgfkeysalso{/tikz/external/figure list=false,/pgf/images/aux in dpth=true}%
},
mode/list and make/.code = {%
\def\tikzexternal@opmode{5}%
@@ -147,6 +150,9 @@
mode=convert with system call,
force remake/.is if=tikzexternal@force@remake,
force remake/.default=true,
+ %
+ % DEPRECATED: this here will work out-of-the box (provided that
+ % 'aux in dpth' is active):
failed ref warnings for/.initial={\ref,\cite,\pageref},
export next/.is if=tikzexternalexportnext,
export/.is if=tikzexternal@export@enabled,
@@ -268,6 +274,11 @@
up to date check=md5,
}
+\expandafter\def\csname tikzexternal@driver@pgfsys-luatex.def\endcsname{%
+ \pgfkeyssetvalue{/tikz/external/system call}{%
+ lualatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"%
+ }%
+}%
\expandafter\def\csname tikzexternal@driver@pgfsys-pdftex.def\endcsname{%
\pgfutil@IfUndefined{directlua}{%
\pgfkeyssetvalue{/tikz/external/system call}{%
@@ -444,8 +455,7 @@
\tikzexternalauxlock@getlockvalue
\if1\tikzexternallocked
\pgfexternalreadmainauxfalse
- % the main .aux file won't be read. Handle \ref commands:
- \tikzexternalauxlock@handleref
+ % the main .aux file won't be read right now.
\else
\pgfexternalreadmainauxtrue
\fi
@@ -484,79 +494,10 @@
}
-% 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.
-%
-% ATTENTION: this is used if and only if *all* references are broken
-% (because the .aux file is NOT read at all)!
-\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@gobble@opt{#1}}{\tikzexternalauxlock@handleref@repl@{#1}}%
-}%
-% silently discard the options. We merely need to generate a warning.
-\def\tikzexternalauxlock@handleref@gobble@opt#1[#2]{%
- % there may be more than one set of options (biblatex's \cite):
- \pgfutil@ifnextchar[{\tikzexternalauxlock@handleref@gobble@opt{#1}}{\tikzexternalauxlock@handleref@repl@{#1}}%
-}%
-\def\tikzexternalauxlock@handleref@repl@#1#2{%
- \tikzifexternalizingcurrent{%
- % note that '#1' is NO control sequence! it is a protected string
- \csname tikzexternalauxlock@handleref@orig@#1\endcsname{#2}%
- \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{#2}{\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.
- }%
+% this is a hook into pgfcoreexternal.code.tex:
+\def\pgf@external@grab@refundefinedtrue@code{%
+ \gdef\noexpand\tikzexternal@systemcall@reschedule@to@end@document{1}%
}%
-\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).
@@ -884,7 +825,7 @@
\fi
}{}%
\iftikzexternal@verboseio
- \immediate\write16{Writing '#1' to '\tikzexternal@realjob.figlist'.}%
+ \pgf@typeout{Writing '#1' to '\tikzexternal@realjob.figlist'.}%
\fi
\immediate\write\tikzexternal@outfile{#1}%
\if\tikzexternal@opmode5% mode='list and make'
@@ -901,7 +842,7 @@
\expandafter\tikzexternal@tempb\expandafter{\pgf@tempa}%
\let\pgf@tempa=\pgfretval
\iftikzexternal@verboseio
- \immediate\write16{Writing '#1' to '\tikzexternal@realjob.makefile'.}%
+ \pgf@typeout{Writing '#1' to '\tikzexternal@realjob.makefile'.}%
\fi
\global\tikzexternal@file@isuptodatetrue% only check for force remake:
\tikzexternal@checkforceremake%
@@ -912,7 +853,7 @@
\def\tikzexternal@list@and@make@prepare{%
\iftikzexternal@verboseio
- \immediate\write16{Opening '\tikzexternal@realjob.makefile' for writing.}%
+ \pgf@typeout{Opening '\tikzexternal@realjob.makefile' for writing.}%
\fi
\begingroup
% this makes \tikzexternal@outmakefile global:
@@ -937,7 +878,7 @@
\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. =====}}%
+ \AtEndDocument{\pgf@typeout{===== mode=`list and make': Use 'make -f \tikzexternal@realjob.makefile' to generate all images. Then, re-run (pdf)latex \tikzexternal@realjob. =====}}%
}%
}%
\def\tikzexternaldepext{dep}
@@ -1173,7 +1114,7 @@
\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.}%
+ \pgf@typeout{The command '\the\toks0' has been optimized away. Use '/tikz/external/optimize=false' to disable this.}%
\fi
\endgroup
\begingroup
@@ -1189,7 +1130,7 @@
}%
\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 the exported PDF. Use '/tikz/external/optimize=false' to disable this.}%
+ \pgf@typeout{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 the exported PDF. Use '/tikz/external/optimize=false' to disable this.}%
\fi
\endgroup
% we still need to invoke \end{<name>} in latex because \begin{<name>}
@@ -1226,7 +1167,7 @@
}
\long\def\tikzexternal@skipfigure@@#1{%
\iftikzexternal@verbose@optimize
- \immediate\write16{A tikzpicture has been optimized away. Use '/tikz/external/optimize=false' to disable this.}%
+ \pgf@typeout{A tikzpicture has been optimized away. Use '/tikz/external/optimize=false' to disable this.}%
\fi
\tikzexternal@closeenvironments
\pgfkeysvalueof{/tikz/external/optimize away text/.@cmd}tikzpicture\pgfeov%
@@ -1285,7 +1226,7 @@
}
\def\tikzexternal@forceremake@undefined@reference@handler{%
- \immediate\write16{===== 'mode=list and make': encountered undefined reference in current picture. Adding dependency to FORCEREMAKE. Rerun make to update the picture.' ========^^J}%
+ \pgf@typeout{===== 'mode=list and make': encountered undefined reference in current picture. Adding dependency to FORCEREMAKE. Rerun make to update the picture.' ========^^J}%
\tikzpicturedependsonfile{FORCEREMAKE}%
}%
@@ -1321,11 +1262,21 @@
\fi
}%
+\def\tikzexternal@externalizefig@before@grab{%
+ \pgfutil@IfUndefined{TP@holdbox}{%
+ }{%
+ % \usepackage[absolute]{textpos}
+ % populates this box -- and would inject unwanted material into our images. Reset it:
+ \global\setbox\TP@holdbox\vbox{}%
+ }%
+}%
+
\def\tikzexternal@externalizefig@GRAB{%
- \iftikzexternal@optimize
- \ifpgf@external@grabshipout
+ \ifpgf@external@grabshipout
+ \iftikzexternal@optimize
\tikzexternal@optimize@RESTORE
\fi
+ \tikzexternal@externalizefig@before@grab
\fi
\def\tikzpicture{%
\def\tikzpicture{% make sure that nested \tikzpicture are processed normally.
@@ -1438,59 +1389,83 @@
}%
\long\def\tikzexternal@externalizefig@systemcall@@#1{%
\tikzexternal@externalizefig@systemcall@uptodatecheck{#1}%
+ \tikzexternal@assemble@systemcall{\tikzexternal@curfilename}{\pgf@tempa}%
+ \global\let\tikzexternal@cursyscall=\pgf@tempa
+ \gdef\tikzexternal@typeset@picture@on@failure{1}%
\iftikzexternal@file@isuptodate
\iftikzexternal@verboseio
- \immediate\write16{===== Image '\tikzexternal@curfilename' is up-to-date. ======}%
+ \pgf@typeout{===== 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}%
+ \tikzexternal@externalizefig@systemcall@call{\tikzexternal@cursyscall}%
\tikzexternalauxlock@setlock0%
- \expandafter\tikzexternal@externalizefig@systemcall@assertsuccess\expandafter{\pgf@tempa}%
+ \expandafter\tikzexternal@externalizefig@systemcall@assertsuccess\expandafter{\tikzexternal@cursyscall}%
\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
+ \if1\tikzexternal@typeset@picture@on@failure
+ % 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
+ % Ah -- this picture failed, but the failure has already
+ % been handled somehow. Do not typeset it again!
+ %
+ % A use-case is that the picture has been rescheduled for
+ % \end{document}.
+ \gdef\tikzexternal@externalizefig@systemcall@next{\tikzexternal@closeenvironments}%
+ \fi
\else
% ok, take the image!
+ \gdef\tikzexternal@systemcall@reschedule@to@end@document{0}%
\expandafter\pgfincludeexternalgraphics\expandafter{\tikzexternal@curfilename}%
+ \if1\tikzexternal@systemcall@reschedule@to@end@document
+ \pgfutil@IfUndefined{AtVeryEndDocument}{%
+ }{%
+ \pgf@typeout{===== The previous system call resulted in undefined references inside of the output file. Rescheduling it for \string\end{document}. ========}%
+ \expandafter\tikzexternal@externalizefig@systemcall@reschedule\expandafter{\tikzexternal@cursyscall}%
+ }%
+ \fi
\gdef\tikzexternal@externalizefig@systemcall@next{\tikzexternal@closeenvironments}%
\fi
\tikzexternal@externalizefig@systemcall@next
}%
+\def\tikzexternal@externalizefig@systemcall@call#1{%
+ \iftikzexternal@verboseio
+ \pgf@typeout{===== 'mode=convert with system call': Invoking '#1' ========}%
+ \fi
+ \pgfutil@shellescape{#1}%
+}%
+
% Sets \iftikzexternal@file@isuptodate to false if one of the "force
% remake" things is active.
\def\tikzexternal@checkforceremake{%
@@ -1550,7 +1525,7 @@
\def\tikzexternal@check@uptodate@ext{.md5}
\def\tikzexternal@check@uptodate@mode@warn@fallback{%
- \message{! Package tikz Warning: The key 'up to date check=md5' is impossible, there is no macro to compute MD5. Falling back to 'up to date check=diff'.}%
+ \message{Package tikz Warning: The key 'up to date check=md5' is impossible, there is no macro to compute MD5. Falling back to 'up to date check=diff'.}%
%
% warn only once:
\global\let\tikzexternal@check@uptodate@mode@warn@fallback=\relax
@@ -1609,7 +1584,7 @@
\edef\tikzexternal@lastkey@normalized{\meaning\tikzexternal@lastkey}%
\edef\tikzexternal@lastkey@new@normalized{\meaning\tikzexternal@lastkey@new}%
\iftikzexternal@verboseuptodate
- \immediate\write16{Up-to-date check of \tikzexternal@curfilename: new \tikzexternal@lastkey@new@normalized; old \tikzexternal@lastkey@normalized.^^J}%
+ \pgf@typeout{Up-to-date check of \tikzexternal@curfilename: new \tikzexternal@lastkey@new@normalized; old \tikzexternal@lastkey@normalized.^^J}%
\fi
\ifx\tikzexternal@lastkey@normalized\tikzexternal@lastkey@new@normalized
\tikzexternal@file@isuptodatetrue
@@ -1631,11 +1606,9 @@
% It returns \iftikzexternal@file@isuptodate accordingly.
% #1: the picture-content
\long\def\tikzexternal@externalizefig@systemcall@uptodatecheck#1{%
+ \tikzexternal@check@uptodate@mode{#1}%
\tikzexternal@checkforceremake
\iftikzexternal@file@isuptodate
- \tikzexternal@check@uptodate@mode{#1}%
- \fi
- \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{}%
@@ -1654,14 +1627,70 @@
\xdef\pgf@tempa{\noexpand\pgf@findfile\pgfsys@imagesuffixlist:+{\tikzexternal@curfilename}}%
\pgf@tempa
\ifx\pgf@filename\pgfutil@empty%
- \tikzerror{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}{}%
+ \tikzexternal@externalizefig@systemcall@handleexception{#1}%
\fi
}%
+\def\tikzexternal@externalizefig@systemcall@handleexception@msg#1{%
+ \tikzerror{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}{}%
+}
+\def\tikzexternal@externalizefig@systemcall@handleexception@retry@later#1{%
+ \gdef\tikzexternal@systemcall@reschedule@to@end@document{0}%
+ \expandafter\pgfexternalreaddpth\expandafter{\tikzexternal@curfilename}%
+ \if1\tikzexternal@systemcall@reschedule@to@end@document
+ \pgfutil@IfUndefined{AtVeryEndDocument}{%
+ \tikzexternal@externalizefig@systemcall@handleexception@msg{#1}%
+ }{%
+ \pgf@typeout{===== The last system call resulted in an EMPTY output file. Maybe it is part of \string\ref. Rescheduling it for \string\end{document}. ========}%
+ \gdef\tikzexternal@typeset@picture@on@failure{0}%
+ \tikzexternal@externalizefig@systemcall@reschedule{#1}%
+ }%
+ \else
+ \tikzexternal@externalizefig@systemcall@handleexception@msg{#1}%
+ \fi
+}
+
+% reschedules the externalization of the current file to
+% \AtVeryEndDocument.
+%
+% This hook allows to execute code AFTER the main .aux file is
+% finished; it will even re-read the main aux file.
+\def\tikzexternal@externalizefig@systemcall@reschedule#1{%
+ \t@tikzexternal@tmpb={%
+ \global\let\tikzexternal@externalizefig@systemcall@handleexception=\tikzexternal@externalizefig@systemcall@handleexception@msg%
+ % ... no auxlocks!
+ \tikzexternal@externalizefig@systemcall@call{#1}%
+ \tikzexternal@externalizefig@systemcall@assertsuccess{#1}%
+ }%
+ \xdef\pgfutil@tempa{%
+ \noexpand\def\noexpand\tikzexternal@curfilename{\tikzexternal@curfilename}%
+ \the\t@tikzexternal@tmpb
+ }%
+ \expandafter\AtVeryEndDocument\expandafter{\pgfutil@tempa}%
+ \gdef\tikzexternal@has@rescheduled@something{1}%
+}%
+\let\tikzexternal@externalizefig@systemcall@handleexception=\tikzexternal@externalizefig@systemcall@handleexception@retry@later%
+
+\def\tikzexternal@has@rescheduled@something{0}%
+\pgfutil@IfUndefined{AtVeryEndDocument}{}{%
+ \AtVeryEndDocument{%
+ \if1\tikzexternal@has@rescheduled@something
+ \pgf@typeout{===== tikzexternal: \string\end{document} reached. Working on rescheduled images to resolve references... ========}%
+ \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
+ \begingroup
+ % overwrite .dpth file in order to flag the file as "need to be scheduled
+ % for \AtVeryEndDocument" :
+ \immediate\openout\pgf@plotwrite=\pgfactualjobname.dpth
+ \let\w@pgfexternal@auxout=\pgf@plotwrite
+ \pgfexternalstorecommand@isexporting{\gdef\noexpand\tikzexternal@systemcall@reschedule@to@end@document{1}}%
+ \immediate\closeout\pgf@plotwrite
+ \endgroup
\tikzexternal@assemble@systemcall{\pgfactualjobname}{\pgf@tempa}%
\toks0=\expandafter{\pgf@tempa}%
\tikzerror{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!?
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.code.tex
index c6c998e4b6a..aee687e274b 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary3d.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/tikzlibrary3d.code.tex,v 1.2 2013/07/17 10:36:34 tantau Exp $
+\ProvidesFileRCS{tikzlibrary3d.code.tex}
@@ -17,64 +17,67 @@
{%
\pgfset{/tikz/cs/.cd,angle=0,radius=0,z=0,#1}%
\pgfpointcylindrical{\tikz@cs@angle}{\tikz@cs@xradius}{\tikz@cs@z}%
-}
+}%
\tikzdeclarecoordinatesystem{xyz spherical}
{%
\pgfset{/tikz/cs/.cd,angle=0,radius=0,latitude=0,longitude=0,#1}%
\pgfpointspherical{\tikz@cs@angle}{\tikz@cs@latitude}{\tikz@cs@xradius}%
-}
+}%
-\pgfset{/tikz/cs/longitude/.store in=\tikz@cs@angle}
-\pgfset{/tikz/cs/latitude/.store in=\tikz@cs@latitude}
+\pgfset{/tikz/cs/longitude/.store in=\tikz@cs@angle}%
+\pgfset{/tikz/cs/latitude/.store in=\tikz@cs@latitude}%
% Options for transforming into a plane:
-\tikzoption{plane origin}{\def\tikz@plane@origin{\tikz@scan@one@point\pgfutil@firstofone#1}}
-\tikzoption{plane x}{\def\tikz@plane@x{\tikz@scan@one@point\pgfutil@firstofone#1}}
-\tikzoption{plane y}{\def\tikz@plane@y{\tikz@scan@one@point\pgfutil@firstofone#1}}
+\tikzoption{plane origin}{\def\tikz@plane@origin{\tikz@scan@one@point\pgfutil@firstofone#1}}%
+\tikzoption{plane x}{\def\tikz@plane@x{\tikz@scan@one@point\pgfutil@firstofone#1}}%
+\tikzoption{plane y}{\def\tikz@plane@y{\tikz@scan@one@point\pgfutil@firstofone#1}}%
\let\tikz@plane@origin=\pgfpointorigin
-\def\tikz@plain@x{\pgfpointxy{1}{0}}
-\def\tikz@plain@y{\pgfpointxy{0}{1}}
+\def\tikz@plane@x{\pgfpointxy{1}{0}}%
+\def\tikz@plane@y{\pgfpointxy{0}{1}}%
\tikzoption{canvas is plane}[]{
\tikz@canvas@is@plane
-}
-\tikzoption{canvas is xy plane at z}{%
- \tikz@addtransform{\pgftransformshift{\pgfpointxyz{0}{0}{#1}}}%
-}
+}%
+\tikzoption{canvas is xy plane at z}[]{%
+ \def\tikz@plane@origin{\pgfpointxyz{0}{0}{#1}}%
+ \def\tikz@plane@x{\pgfpointxyz{1}{0}{#1}}%
+ \def\tikz@plane@y{\pgfpointxyz{0}{1}{#1}}%
+ \tikz@canvas@is@plane
+}%
\tikzoption{canvas is yx plane at z}[]{%
\def\tikz@plane@origin{\pgfpointxyz{0}{0}{#1}}%
\def\tikz@plane@x{\pgfpointxyz{0}{1}{#1}}%
\def\tikz@plane@y{\pgfpointxyz{1}{0}{#1}}%
\tikz@canvas@is@plane
-}
+}%
\tikzoption{canvas is xz plane at y}[]{%
\def\tikz@plane@origin{\pgfpointxyz{0}{#1}{0}}%
\def\tikz@plane@x{\pgfpointxyz{1}{#1}{0}}%
\def\tikz@plane@y{\pgfpointxyz{0}{#1}{1}}%
\tikz@canvas@is@plane
-}
+}%
\tikzoption{canvas is zx plane at y}[]{%
\def\tikz@plane@origin{\pgfpointxyz{0}{#1}{0}}%
\def\tikz@plane@x{\pgfpointxyz{0}{#1}{1}}%
\def\tikz@plane@y{\pgfpointxyz{1}{#1}{0}}%
\tikz@canvas@is@plane
-}
+}%
\tikzoption{canvas is yz plane at x}[]{%
\def\tikz@plane@origin{\pgfpointxyz{#1}{0}{0}}%
\def\tikz@plane@x{\pgfpointxyz{#1}{1}{0}}%
\def\tikz@plane@y{\pgfpointxyz{#1}{0}{1}}%
\tikz@canvas@is@plane
-}
+}%
\tikzoption{canvas is zy plane at x}[]{%
\def\tikz@plane@origin{\pgfpointxyz{#1}{0}{0}}%
\def\tikz@plane@x{\pgfpointxyz{#1}{0}{1}}%
\def\tikz@plane@y{\pgfpointxyz{#1}{1}{0}}%
\tikz@canvas@is@plane
-}
+}%
@@ -99,7 +102,7 @@
\noexpand\pgfsetzvec{\noexpand\pgfpoint{0cm}{0cm}}%
}}%
\pgf@marshal%
-}
+}%
+
-
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryangles.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryangles.code.tex
index 2ac3ebc7b22..364468a2eb4 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryangles.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryangles.code.tex
@@ -1,4 +1,5 @@
% Copyright 2013 by Till Tantau
+% Copyright 2018 by Kroum Tzanev
%
% This file may be distributed and/or modified
%
@@ -7,26 +8,31 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryangles.code.tex,v 1.1 2013/08/28 15:24:27 tantau Exp $
+\ProvidesFileRCS{tikzlibraryangles.code.tex}
\tikzset{
pics/angle/.style = {
setup code = \tikz@lib@angle@parse#1\pgf@stop,
background code = \tikz@lib@angle@background#1\pgf@stop,
- foreground code = \tikz@lib@angle@foreground#1\pgf@stop,
+ foreground code = \tikz@lib@angle@foreground#1\pgf@stop,
+ },
+ pics/right angle/.style = {
+ setup code = \tikz@lib@angle@parse#1\pgf@stop,
+ background code = \tikz@lib@rightangle@background#1\pgf@stop,
+ foreground code = \tikz@lib@rightangle@foreground#1\pgf@stop,
},
pics/angle/.default=A--B--C,
angle eccentricity/.initial=.6,
- angle radius/.initial=5mm
-}
+ angle radius/.initial=5mm,
+}%
\def\tikz@lib@angle@background#1--#2--#3\pgf@stop{%
\path [name prefix ..] [pic actions, draw=none] (#2.center)
-- ++(\tikz@start@angle@temp:\tikz@lib@angle@rad pt)
arc [start angle=\tikz@start@angle@temp, end
angle=\tikz@end@angle@temp, radius=\tikz@lib@angle@rad pt] -- cycle;
-}
+}%
\def\tikz@lib@angle@foreground#1--#2--#3\pgf@stop{%
\path [name prefix ..] [pic actions, fill=none, shade=none]
@@ -39,8 +45,28 @@
eccentricity}*\tikz@lib@angle@rad pt)}]#2.center)}]}
\expandafter\pgf@temp\expandafter[\tikzpictextoptions]{\tikzpictext};%
\fi
-}
+}%
+
+\def\tikz@lib@rightangle@background#1--#2--#3\pgf@stop{%
+ \path [name prefix ..] [pic actions, draw=none] (#2.center)
+ -- ++(\tikz@start@angle@temp:\tikz@lib@angle@rad pt)
+ -- ++(\tikz@end@angle@temp:\tikz@lib@angle@rad pt)
+ -- ++(\tikz@start@angle@temp:-\tikz@lib@angle@rad pt)
+ -- cycle;
+}%
+\def\tikz@lib@rightangle@foreground#1--#2--#3\pgf@stop{%
+ \path [name prefix ..] [pic actions, fill=none, shade=none]
+ ([shift={(\tikz@start@angle@temp:\tikz@lib@angle@rad pt)}]#2.center)
+ -- ++(\tikz@end@angle@temp:\tikz@lib@angle@rad pt)
+ -- ++(\tikz@start@angle@temp:-\tikz@lib@angle@rad pt);
+ \ifx\tikzpictext\relax\else%
+ \def\pgf@temp{\node()[name prefix
+ ..,at={([shift={({.5*\tikz@start@angle@temp+.5*\tikz@end@angle@temp}:\pgfkeysvalueof{/tikz/angle
+ eccentricity}*sqrt(1/2)*\tikz@lib@angle@rad pt)}]#2.center)}]}
+ \expandafter\pgf@temp\expandafter[\tikzpictextoptions]{\tikzpictext};%
+ \fi
+}%
\def\tikz@lib@angle@parse#1--#2--#3\pgf@stop{%
% Compute radius:
@@ -64,8 +90,8 @@
\pgfmathsetmacro{\tikz@end@angle@temp}{atan2(\the\pgf@yc,\the\pgf@xc)}
\ifdim\tikz@end@angle@temp pt<\tikz@start@angle@temp pt%
\pgfmathsetmacro{\tikz@start@angle@temp}{\tikz@start@angle@temp-360}%
- \fi%
-}
+ \fi%
+}%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryanimations.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryanimations.code.tex
new file mode 100644
index 00000000000..f4dd1716932
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryanimations.code.tex
@@ -0,0 +1,904 @@
+% Copyright 2016 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{tikzlibraryanimations.code.tex}
+
+\usepgfmodule{animations}%
+
+
+
+% Scope syntax extension:
+
+\def\tikz@collect@scope@anims#1{%
+ \let\tikz@scope@anims\pgfutil@empty%
+ \let\tikz@collect@command#1%
+ \tikz@collect@scope@anims@parse%
+}%
+\def\tikz@collect@scope@anims@parse{%
+ \pgfutil@ifnextchar[{\tikz@collect@scope@anims@opt}{%
+ \pgfutil@ifnextchar:{\tikz@collect@scope@anims@go}{%
+ \tikz@collect@scope@anims@done}}%]
+}%
+\def\tikz@collect@scope@anims@done{%
+ \expandafter\tikz@collect@command\expandafter[\tikz@scope@anims]%
+}%
+\def\tikz@collect@scope@anims@opt[{%]
+ \expandafter\tikz@collect@command\expandafter[\tikz@scope@anims%]
+}%
+\def\tikz@collect@scope@anims@go:#1=#2{%
+ \expandafter\def\expandafter\tikz@scope@anims\expandafter{\tikz@scope@anims animate={myself:={:{#1}={#2}}},}%
+ \tikz@collect@scope@anims@parse%
+}%
+
+
+
+
+%
+% The main keys:
+%
+
+\def\tikzanimateset{\pgfqkeys{/tikz/animate}}%
+\tikzanimateset{
+ .code={
+ \pgfkeys{/handlers/first char syntax=true}
+ \pgfkeyssetvalue{/handlers/first char syntax/the character "}{\tikz@animation@value}%
+ \def\tikz@anim@t{0}%
+ \def\tikz@anim@t@base{0}%
+ \def\tikz@anim@t@current{0}%
+ \tikzanimateset{#1}
+ },
+ scope/.code=\tikz@anim@scope{#1}{}{},
+ sync/.code=\tikz@anim@sync@scope{#1}{}{},
+ entry/.code=\tikz@anim@make@entry,
+ object/.code=\tikz@anim@set@object{#1},
+ attribute/.code=\tikz@anim@set@attr{#1},
+ id/.code=\tikz@anim@set@id{#1},
+ time/.code=\tikz@anim@set@time{#1},
+ value/.code=\tikz@anim@add{\tikz@anim@value{#1}},%
+ remember/.code=\pgfmathadd@{\tikz@anim@t}{\tikz@anim@t@base}\global\let#1\pgfmathresult,
+ resume/.code=\tikz@anim@resume{#1},
+ fork/.code={\tikz@anim@parse@time{#1}\pgfmathadd@\tikz@anim@t\tikz@anim@t@base\let\tikz@anim@t@base\pgfmathresult\def\tikz@anim@t{0}},
+ fork/.default = 0later,
+ base/.style={scope={/utils/exec=\let\tikz@animation@time\tikz@anim@base@text,#1,entry}},
+}%
+
+\tikzset{
+ make snapshot of/.code=\edef\tikz@temp{#1}\ifx\tikz@temp\pgfutil@empty\else\pgfsnapshot{#1}\fi,
+ make snapshot after/.code=\edef\tikz@temp{#1}\ifx\tikz@temp\pgfutil@empty\else\pgfsnapshotafter{#1}\fi,
+ make snapshot if necessary/.code=\ifpgfsysanimationsupported\else\pgfsnapshot{#1}\fi,
+ make snapshot if necessary/.default=0s,
+}%
+
+\def\tikz@anim@scope#1#2#3{%
+ {#2\tikzanimateset{#1}#3}%
+}%
+\def\tikz@anim@sync@scope#1#2#3{%
+ {%
+ #2%
+ \tikzanimateset{#1}%
+ #3%
+ \pgfmathadd@{\tikz@anim@t}{\tikz@anim@t@base}%
+ \expandafter%
+ }\expandafter\pgfmathsubtract@\expandafter{\pgfmathresult}{\tikz@anim@t@base}%
+ \tikz@anim@set@time{\pgfmathresult}%
+}%
+
+\def\tikz@anim@set@time#1{%
+ \tikz@anim@parse@time{#1}%
+ \let\tikz@anim@t@current\tikz@anim@t%
+ \pgfmathadd@\tikz@anim@t\tikz@anim@t@base%
+ \let\tikz@animation@time\pgfmathresult%
+}%
+
+\def\tikz@anim@value#1{%
+ \def\tikz@anim@result{#1}
+ \ifx\tikz@anim@result\pgf@special@current@text%
+ \else%
+ \ifx\tikz@animation@parser\relax%
+ \else%
+ \tikz@animation@parser{#1}%
+ \fi%
+ \fi%
+}%
+
+
+\def\tikz@anim@resume#1{%
+ \pgfparsetime{#1}%
+ \pgfmathsubtract@{\pgftimeresult}{\tikz@anim@t@base}%
+ \tikz@anim@set@time{\pgfmathresult}%
+}%
+
+
+% The object--attribute entries are of the following forms:
+%
+% objects:attributes
+% objects:attributes_id
+%
+
+\def\tikz@animation@syntax@check#1#2{%
+ \def\tikz@animation@rest{#1}%
+ \expandafter\pgfutil@in@\expandafter:\expandafter{\tikz@key}%
+ \ifpgfutil@in@%
+ \expandafter\tikz@anim@parse@colon\tikz@key\pgf@stop%
+ \else%
+ #2%
+ \fi%
+}%
+
+\def\tikz@anim@parse@colon#1:#2\pgf@stop{%
+ \expandafter\tikz@anim@sync@scope\expandafter{\tikz@animation@rest}{%
+ \tikz@anim@set@object{#1}%
+ \pgfutil@in@_{#2}%
+ \ifpgfutil@in@%
+ \tikz@anim@parse@under#2\pgf@stop%
+ \else%
+ \tikz@anim@parse@under#2_\pgf@stop%
+ \fi%
+ }{\tikz@anim@make@entry}%
+}%
+
+\def\tikz@anim@parse@under#1_#2\pgf@stop{%
+ \tikz@anim@set@attr{#1}%
+ \tikz@anim@set@id{#2}%
+}%
+
+\def\tikz@anim@set@attr#1{%
+ \pgfkeys@spdef\tikz@anim@a{#1}%
+ \ifx\tikz@anim@a\pgfutil@empty%
+ \else%
+ \let\tikz@anim@tl@attributes\tikz@anim@a%
+ \fi%
+}%
+
+\def\tikz@anim@set@id#1{%
+ \pgfkeys@spdef\tikz@anim@a{#1}%
+ \ifx\tikz@anim@a\pgfutil@empty%
+ \else%
+ \let\tikz@anim@tl@id\tikz@anim@a%
+ \fi%
+}%
+
+\def\tikz@anim@set@object#1{%
+ \pgfkeys@spdef\tikz@anim@a{#1}%
+ \ifx\tikz@anim@a\pgfutil@empty%
+ \else%
+ \let\tikz@anim@tl@objects\tikz@anim@a%
+ \fi%
+}%
+
+
+%
+% Parsing of values
+%
+
+\def\tikz@animation@value#1{%
+ \tikz@animation@value@parser#1\pgf@stop%
+}%
+
+\def\tikz@animation@value@parser"#1"{%
+ \def\tikz@animation@value@head{#1}%
+ \pgfutil@ifnextchar\pgf@stop{\tikz@animation@value@rest=}{%
+ \pgfutil@ifnextchar b\tikz@animation@value@rest@base\tikz@animation@value@rest%
+ }%
+}%
+\def\tikz@animation@value@rest=#1\pgf@stop{%
+ \tikz@anim@sync@scope{#1}{\expandafter\tikz@anim@add\expandafter{\expandafter\tikz@anim@value\expandafter{\tikz@animation@value@head}}}{\tikz@anim@make@entry}%
+}%
+
+\def\tikz@animation@value@rest@base base{%
+ \tikz@anim@sync@scope{}{/utils/exec=\let\tikz@animation@time\tikz@anim@base@text\expandafter\tikz@anim@add\expandafter{\expandafter\tikz@anim@value\expandafter{\tikz@animation@value@head}}}{\tikz@anim@make@entry}%
+ \pgfutil@ifnextchar\pgf@stop{\tikz@animation@value@rest=}{\tikz@animation@value@rest}%
+}%
+
+
+
+
+%
+% The parsers
+%
+
+\def\tikz@anim@simple@parse#1{} % nothing to do, \def\tikz@anim@result{#1} is already done
+
+\def\tikz@anim@slant@parse#1{\pgfmathsetmacro\tikz@anim@result{atan(#1)}}%
+
+\def\tikz@anim@dashpattern@parse#1{%
+ \pgfmathsetmacro\tikz@anim@dash@phase{\tikz@dashphase}%
+ \def\tikz@dashpattern{}%
+ \expandafter\tikz@scandashon\pgfutil@gobble#1o\@nil%
+ \edef\tikz@anim@result{{\tikz@dashpattern}{\tikz@anim@dash@phase pt}}%
+}%
+\def\tikz@anim@dashoffset@parse#1{%
+ \pgfmathparse{#1}%
+ \edef\tikz@anim@result{{\tikz@dashpattern}{\pgfmathresult pt}}%
+}%
+\def\tikz@anim@dash@parse#1{%
+ \tikz@anim@dash@parse@#1\pgf@stop%
+}%
+\def\tikz@anim@dash@parse@#1phase#2\pgf@stop{%
+ \pgfmathsetmacro\tikz@anim@dash@phase{#2}%
+ \def\tikz@dashpattern{}%
+ \expandafter\tikz@scandashon\pgfutil@gobble#1o\@nil%
+ \edef\tikz@anim@result{{\tikz@dashpattern}{\tikz@anim@dash@phase pt}}%
+}%
+
+\def\tikz@anim@xshift@parse#1{\pgfmathparse{#1}\edef\tikz@anim@result{\noexpand\pgfqpoint{\pgfmathresult pt}{0pt}}}%
+\def\tikz@anim@yshift@parse#1{\pgfmathparse{#1}\edef\tikz@anim@result{\noexpand\pgfqpoint{0pt}{\pgfmathresult pt}}}%
+
+\def\tikz@anim@xscale@parse#1{\pgfmathparse{#1}\edef\tikz@anim@result{\pgfmathresult,1}}%
+\def\tikz@anim@yscale@parse#1{\pgfmathparse{#1}\edef\tikz@anim@result{1,\pgfmathresult}}%
+
+\def\tikz@anim@shift@parse#1{\tikz@scan@one@point\tikz@anim@do@shift#1}%
+\def\tikz@anim@do@shift#1{\def\tikz@anim@result{#1}}%
+
+\def\tikz@anim@position@parse#1{%
+ \begingroup%
+ \let\tikz@transform=\relax%
+ \pgf@xc-\pgf@pt@x%
+ \pgf@yc-\pgf@pt@y%
+ \pgfsettransform\tikz@anim@saved@transform%
+ \tikz@scan@one@point\tikz@anim@do@position#1}%
+\def\tikz@anim@do@position#1{%
+ \pgf@process{\pgfpointtransformed{#1}}%
+ \advance\pgf@x by\pgf@xc%
+ \advance\pgf@y by\pgf@yc%
+ \xdef\tikz@anim@temp{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
+ \endgroup%
+ \let\tikz@anim@result\tikz@anim@temp%
+}%
+
+\def\tikz@anim@view@parse#1{\tikz@anim@view@parse@#1\pgf@stop}%
+\def\tikz@anim@view@parse@{%
+ \pgfutil@ifnextchar({\tikz@scan@one@point\tikz@anim@view@parse@a}{\tikz@anim@view@node}%
+}%
+\def\tikz@anim@view@parse@a#1{%
+ \def\tikz@anim@result{{#1}}%
+ \pgfutil@ifnextchar r{\tikz@anim@view@parsed@rec}{\tikz@scan@one@point\tikz@anim@view@parse@b}%
+}%
+\def\tikz@anim@view@parsed@rec rectangle{\tikz@scan@one@point\tikz@anim@view@parse@b}%
+\def\tikz@anim@view@parse@b#1{%
+ \expandafter\def\expandafter\tikz@anim@result\expandafter{\tikz@anim@result{#1}}%
+ \pgfutil@ifnextchar\pgf@stop\pgfutil@gobble{\tikzerror{Wrong view syntax}}%
+}%
+\def\tikz@anim@view@node#1\pgf@stop{%
+ \expandafter\ifx\csname pgf@sh@ns@#1\endcsname\relax%
+ \tikzerror{Undefined node '#1'}%
+ \else%
+ % Compute a bounding box for the node:
+ {%
+ \pgf@process{\pgfpointanchor{#1}{west}}%
+ \pgf@xa\pgf@x \pgf@ya\pgf@y
+ \pgf@xb\pgf@x \pgf@yb\pgf@y
+ \pgf@process{\pgfpointanchor{#1}{north}}%
+ \ifdim\pgf@x<\pgf@xa \pgf@xa=\pgf@x\fi%
+ \ifdim\pgf@x>\pgf@xb \pgf@xb=\pgf@x\fi%
+ \ifdim\pgf@y<\pgf@ya \pgf@ya=\pgf@y\fi%
+ \ifdim\pgf@y>\pgf@yb \pgf@yb=\pgf@y\fi%
+ \pgf@process{\pgfpointanchor{#1}{south}}%
+ \ifdim\pgf@x<\pgf@xa \pgf@xa=\pgf@x\fi%
+ \ifdim\pgf@x>\pgf@xb \pgf@xb=\pgf@x\fi%
+ \ifdim\pgf@y<\pgf@ya \pgf@ya=\pgf@y\fi%
+ \ifdim\pgf@y>\pgf@yb \pgf@yb=\pgf@y\fi%
+ \pgf@process{\pgfpointanchor{#1}{east}}%
+ \ifdim\pgf@x<\pgf@xa \pgf@xa=\pgf@x\fi%
+ \ifdim\pgf@x>\pgf@xb \pgf@xb=\pgf@x\fi%
+ \ifdim\pgf@y<\pgf@ya \pgf@ya=\pgf@y\fi%
+ \ifdim\pgf@y>\pgf@yb \pgf@yb=\pgf@y\fi%
+ \xdef\tikz@anim@result{{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}{\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}}
+ }%
+ \fi%
+}%
+
+\def\tikz@anim@path@parse#1{%
+ {%
+ \setbox0=\hbox{{% protext against side effects
+ \pgfinterruptpath%
+ \expandafter\tikz@scan@next@command#1\pgf@stop%
+ \pgfsyssoftpath@getcurrentpath\tikz@anim@result%
+ \pgfprocessround{\tikz@anim@result}{\tikz@anim@result}%
+ \global\let\tikz@anim@result\tikz@anim@result%
+ \endpgfinterruptpath%
+ }}%
+ }%
+}%
+
+% The special along parser
+
+
+\def\tikz@anim@along#1#2{%
+ % Parse the path...
+ {%
+ \setbox0=\hbox{{% protect against side effects
+ \pgfinterruptpath%
+ \pgf@relevantforpicturesizefalse%
+ \iftikz@anim@is@position%
+ \let\tikz@transform=\relax%
+ \pgf@x-\pgf@pt@x%
+ \pgf@y-\pgf@pt@y%
+ \edef\tikz@anim@along@shift{\pgf@xc\the\pgf@x\pgf@yc\the\pgf@y}%
+ \pgfsettransformentries#1%
+ \else%
+ \pgftransformreset%
+ \fi
+ \tikz@scan@next@command#2\pgf@stop%
+ \pgfsyssoftpath@getcurrentpath\tikz@anim@parsed@path%
+ \pgfprocessround{\tikz@anim@parsed@path}{\tikz@anim@parsed@path}%
+ \iftikz@anim@is@position%
+ \tikz@anim@shift@path%
+ \global\let\tikz@anim@parsed@path\tikz@anim@patched@path%
+ \else%
+ \global\let\tikz@anim@parsed@path\tikz@anim@parsed@path%
+ \fi%
+ \endpgfinterruptpath%
+ }}%
+ }%
+ \pgfanimationset{along softpath/.expand once=\tikz@anim@parsed@path}%
+}%
+
+\def\tikz@anim@shift@path{%
+ \let\tikz@anim@patched@path\pgfutil@empty%
+ \tikz@anim@along@shift%
+ \expandafter\tikz@anim@shift@path@\tikz@anim@parsed@path\pgf@stop%
+}%
+\def\tikz@anim@shift@path@{%
+ \pgfutil@ifnextchar\pgf@stop\pgfutil@gobble{%
+ \pgfutil@ifnextchar\bgroup\tikz@anim@shift@path@sub\tikz@anim@shift@path@copy}%
+}%
+\def\tikz@anim@shift@path@copy#1{%
+ \expandafter\def\expandafter\tikz@anim@patched@path\expandafter{\tikz@anim@patched@path#1}%
+ \tikz@anim@shift@path@%
+}%
+\def\tikz@anim@shift@path@sub#1#2{%
+ \pgf@x#1%
+ \pgf@y#2%
+ \advance\pgf@x by\pgf@xc%
+ \advance\pgf@y by\pgf@yc%
+ \edef\tikz@temp{{\the\pgf@x}{\the\pgf@y}}%
+ \expandafter\tikz@anim@shift@path@copy\expandafter{\tikz@temp}%
+}%
+
+
+
+\def\tikz@anim@parse@origin#1{%
+ \tikz@scan@one@point\tikz@anim@parse@origin@#1\relax%
+}%
+\def\tikz@anim@parse@origin@#1{\tikz@anim@add{\pgfanimationset{origin={#1}}}}%
+
+
+% Internals
+
+\def\tikz@anim@tl@objects{}%
+\def\tikz@anim@tl@attributes{}%
+\def\tikz@anim@tl@id{default}%
+
+\let\tikz@anim@tl@exec@options\pgfutil@empty
+\let\tikz@anim@tl@early@options\pgfutil@empty
+
+\def\tikz@anim@add@early#1{\expandafter\def\expandafter\tikz@anim@tl@early@options\expandafter{\tikz@anim@tl@early@options#1}}%
+\def\tikz@anim@add@once@early#1{%
+ \global\advance\tikz@anim@once@count by1\relax%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\tikz@anim@tl@early@options%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@anim@tl@early@options\expandafter\tikz@anim@exec@once\expandafter{\the\tikz@anim@once@count}{#1}}%
+}%
+\def\tikz@anim@add#1{\expandafter\def\expandafter\tikz@anim@tl@exec@options\expandafter{\tikz@anim@tl@exec@options#1}}%
+\def\tikz@anim@add@once#1{%
+ \global\advance\tikz@anim@once@count by1\relax%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\tikz@anim@tl@exec@options%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@anim@tl@exec@options\expandafter\tikz@anim@exec@once\expandafter{\the\tikz@anim@once@count}{#1}}%
+}%
+\newcount\tikz@anim@once@count%
+\def\tikz@anim@exec@once#1#2{%
+ \expandafter\ifx\csname tikz@anim@once@#1\endcsname\pgf@stop%
+ \else%
+ \expandafter\let\csname tikz@anim@once@#1\endcsname\pgf@stop%
+ #2%
+ \fi%
+}%
+
+\newif\iftikz@anim@do@entry
+
+\def\tikz@anim@make@entry{%
+ \tikz@anim@do@entrytrue%
+ \ifx\tikz@anim@tl@objects\pgfutil@empty\tikz@anim@do@entryfalse\fi%
+ \ifx\tikz@anim@tl@attributes\pgfutil@empty\tikz@anim@do@entryfalse\fi%
+ \ifx\tikz@anim@tl@exec@options\pgfutil@empty\ifx\tikz@anim@tl@early@options\pgfutil@empty\tikz@anim@do@entryfalse\fi\fi%
+ \iftikz@anim@do@entry%
+ \foreach\tikz@anim@tl@object in\tikz@anim@tl@objects{%
+ \expandafter\tikzanimationattributesset\expandafter{\tikz@anim@tl@attributes}%
+ }%
+ \fi%
+}%
+
+\def\tikzanimationattributesset#1{\pgfqkeys{/tikz/animate/attributes}{#1}}%
+
+\tikzanimationattributesset{
+ .unknown/.code={
+ \let\tikz@anim@attribute@name\pgfkeyscurrentname
+ \expandafter\let\expandafter\pgf@temp\csname tikz@anim@def@pgf@attr@\tikz@anim@attribute@name\endcsname%
+ \ifx\pgf@temp\relax%
+ \tikzerror{Unknown animation attribute '\tikz@anim@attribute@name'}%
+ \else%
+ \expandafter\tikz@timeline@config\expandafter\tikz@anim@tl@object\expandafter\tikz@anim@attribute@name\expandafter\tikz@anim@tl@id\expandafter{\tikz@anim@configs}%
+ \edef\pgf@marshal{\noexpand\tikz@timeline@entry{\tikz@anim@tl@object}{\tikz@anim@attribute@name}{\tikz@anim@tl@id}}%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@marshal\expandafter\expandafter\expandafter{\expandafter\pgf@marshal\expandafter{\tikz@anim@tl@early@options}}%
+ \expandafter\expandafter\expandafter\pgf@marshal\expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter\tikz@anim@entry\expandafter\expandafter\expandafter{\expandafter\tikz@anim@tl@exec@options\expandafter\def\expandafter\tikz@animation@time\expandafter{\tikz@animation@time}}}%
+ \fi%
+ }
+}%
+\let\tikz@anim@configs\pgfutil@empty
+
+\def\tikz@anim@entry#1{%
+ % Reset splines and value:
+ \let\tikz@anim@result\pgfutil@empty%
+ \pgf@anim@reset@linear%
+ #1%
+ \ifx\tikz@anim@result\pgfutil@empty%
+ \else%
+ \ifx\tikz@animation@time\pgfutil@empty%
+ \else%
+ \ifx\tikz@animation@time\tikz@anim@base@text%
+ \expandafter\pgf@anim@base\expandafter{\tikz@anim@result}%
+ \else%
+ \expandafter\expandafter\expandafter\pgf@anim@entry%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@animation@time\expandafter}\expandafter{\tikz@anim@result}%
+ \fi%
+ \fi%
+ \fi%
+}%
+\let\tikz@animation@time\pgfutil@empty%
+\def\tikz@anim@base@text{base}%
+
+\tikzanimateset{
+ .unknown/.code={%
+ \let\tikz@key\pgfkeyscurrentname%
+ \tikz@animation@syntax@check{#1}{\tikz@anim@options{#1}}%
+ }
+}%
+
+
+\def\tikz@anim@options#1{
+ \let\tikz@anim@key\pgfkeyscurrentname%
+ \pgfqkeys{/tikz/animate/options}{\tikz@anim@key/.try={#1}}%
+ \ifpgfkeyssuccess%
+ \else%
+ \def\tikz@anim@unparsed@value{#1}%
+ \expandafter\tikz@anim@time@test\tikz@anim@key\pgf@stop%
+ \fi%
+}%
+
+\tikzanimateset{
+ options/.cd,
+ name/.code=\tikz@anim@add{\pgfanimationset{name={#1}}},
+ forever/.code=\tikz@anim@add{\pgfanimationset{freeze at end}},
+ freeze/.code=\tikz@anim@add{\pgfanimationset{freeze at end}},
+ restart/.code=\tikz@anim@add{\pgfanimationset{restart={#1}}},
+ repeats/.code=\tikz@anim@add{\pgfanimationset{repeats={#1}}},
+ repeats/.default=,
+ repeat/.code=\tikz@anim@add{\pgfanimationset{repeats={#1}}},
+ repeat/.default=,
+ begin/.code=\tikz@anim@add@once{\pgfanimationset{begin={#1}}},
+ end/.code=\tikz@anim@add@once{\pgfanimationset{end={#1}}},
+ begin on/.code=\tikz@anim@event{begin}{#1},
+ end on/.code=\tikz@anim@event{begin}{#1},
+ begin snapshot/.code=\tikz@anim@add{\pgfanimationset{begin snapshot={#1}}},
+ origin/.code=\tikz@anim@parse@origin{#1},
+ transform/.code=\tikz@anim@add{\pgfanimationset{transform={\let\tikz@transform\relax\tikzset{#1}}}},
+ along/.code=\tikz@anim@handle@along#1\pgf@stop,
+ entry control/.code=\tikz@anim@add{\pgfanimationset{entry control=#1}},
+ exit control/.code=\tikz@anim@add{\pgfanimationset{exit control=#1}},
+ stay/.code=\tikz@anim@add{\pgfanimationset{stay}},
+ jump/.code=\tikz@anim@add{\pgfanimationset{jump}},
+ ease/.style={
+ entry control={1-(#1)}{1},
+ exit control={#1}{0}
+ },
+ ease/.default=0.5,
+ ease in/.style={
+ entry control={1-(#1)}{1},
+ },
+ ease in/.default=0.5,
+ ease out/.style={
+ exit control={#1}{0},
+ },
+ ease out/.default=0.5,
+ arrows/.code=\tikz@anim@add@early{\pgfanimationset{arrows={#1}}},
+ shorten >/.code=\tikz@anim@add@early{\pgfanimationset{shorten >={#1}}},
+ shorten </.code=\tikz@anim@add@early{\pgfanimationset{snorten <={#1}}},
+}%
+\newif\iftikz@anim@along
+
+\def\tikz@anim@t{0}%
+
+\def\tikz@anim@handle@along#1{%
+ \pgfutil@ifnextchar s{\tikz@anim@handle@sloped{#1}}{\tikz@anim@handle@upright{#1}}%
+}%
+\def\tikz@anim@handle@sloped#1sloped{%
+ \pgfgettransform\tikz@anim@trans@pre%
+ \expandafter\tikz@anim@add@once%
+ \expandafter{%
+ \expandafter\tikz@anim@along\expandafter{\tikz@anim@trans@pre}{#1}%
+ \pgfsysanimkeycanvastransform{%
+ \pgf@xc\pgf@pt@x%
+ \pgf@yc\pgf@pt@y%
+ \pgftransformreset%
+ \pgf@pt@x\pgf@xc%
+ \pgf@pt@y\pgf@yc%
+ {\pgflowlevelsynccm}%
+ }{\pgftransforminvert\pgflowlevelsynccm}%
+ \pgfanimationset{rotate along=true}%
+ }%
+ \def\tikz@anim@configs{\tikz@anim@alongtrue}%
+ \tikz@anim@handle@in%
+}%
+\def\tikz@anim@handle@upright#1upright{%
+ \pgfgettransform\tikz@anim@trans@pre%
+ \expandafter\tikz@anim@add@once%
+ \expandafter{%
+ \expandafter\tikz@anim@along\expandafter{\tikz@anim@trans@pre}{#1}%
+ \pgfsysanimkeycanvastransform{}{}%
+ }%
+ \def\tikz@anim@configs{\tikz@anim@alongtrue}%
+ \tikz@anim@handle@in%
+}%
+\def\tikz@anim@handle@in{%
+ \pgfutil@ifnextchar i{\tikz@anim@handle@in@yes}{\tikz@anim@handle@in@no}%
+}%
+\def\tikz@anim@handle@in@no\pgf@stop{}%
+\def\tikz@anim@handle@in@yes in#1\pgf@stop{%
+ \tikzanimateset{scope={time=0,value=0,entry,time=#1,value=1,entry}}%
+}%
+
+
+
+\def\tikz@anim@event#1#2{%
+ {%
+ % evaluate #2 once to determine the id now
+ \let\pgf@anim@id\pgfutil@empty%
+ \pgfqkeys{/pgf/animation/events}{#2}%
+ \expandafter}%
+ \expandafter\def\expandafter\tikz@anim@temp@id\expandafter{\pgf@anim@id}%
+ \ifx\tikz@anim@temp@id\pgfutil@empty%
+ \def\tikz@temp{#1 on={of id=\tikz@anim@current@id,#2}}%
+ \else
+ \expandafter\tikz@anim@event@setter\expandafter{\tikz@anim@temp@id}{#1}{#2}%
+ \fi%
+ \expandafter\tikz@anim@add@once\expandafter{\expandafter\pgfanimationset\expandafter{\tikz@temp}}%
+}%
+\def\tikz@anim@event@setter#1#2#3{%
+ \def\tikz@temp{#2 on={#3,of id=#1}}%
+}%
+
+\def\tikz@anim@time@test#1#2\pgf@stop{%
+ \edef\tikz@temp{\meaning#1}%
+ \expandafter\ifx\csname tikz@anim@test@\tikz@temp\endcsname\relax%
+ \tikzerror{I do not know the timing key '#1#2' to which you passed '\tikz@anim@unparsed@value'}%
+ \else%
+ \expandafter\tikz@anim@sync@scope\expandafter{\tikz@anim@unparsed@value}{\tikz@anim@set@time{#1#2}}{\tikz@anim@make@entry}%
+ \fi%
+}%
+
+\def\tikz@anim@parse@time#1{%
+ \pgfutil@in@{later\pgf@stop}{#1\pgf@stop}%
+ \ifpgfutil@in@%
+ \tikz@anim@parse@later#1\pgf@stop%
+ \else%
+ \pgfparsetime{#1}\let\tikz@anim@t\pgftimeresult%
+ \fi%
+}%
+\def\tikz@anim@parse@later#1later\pgf@stop{%
+ \pgfparsetime{#1+\tikz@anim@t@current}\let\tikz@anim@t\pgftimeresult%
+}%
+
+\expandafter\let\csname tikz@anim@test@the character 0\endcsname\pgfutil@empty
+\expandafter\let\csname tikz@anim@test@the character 1\endcsname\pgfutil@empty
+\expandafter\let\csname tikz@anim@test@the character 2\endcsname\pgfutil@empty
+\expandafter\let\csname tikz@anim@test@the character 3\endcsname\pgfutil@empty
+\expandafter\let\csname tikz@anim@test@the character 4\endcsname\pgfutil@empty
+\expandafter\let\csname tikz@anim@test@the character 5\endcsname\pgfutil@empty
+\expandafter\let\csname tikz@anim@test@the character 6\endcsname\pgfutil@empty
+\expandafter\let\csname tikz@anim@test@the character 7\endcsname\pgfutil@empty
+\expandafter\let\csname tikz@anim@test@the character 8\endcsname\pgfutil@empty
+\expandafter\let\csname tikz@anim@test@the character 9\endcsname\pgfutil@empty
+\expandafter\let\csname tikz@anim@test@the character -\endcsname\pgfutil@empty
+\expandafter\let\csname tikz@anim@test@the character +\endcsname\pgfutil@empty
+\expandafter\let\csname tikz@anim@test@the character .\endcsname\pgfutil@empty
+\expandafter\let\csname tikz@anim@test@the character (\endcsname\pgfutil@empty
+
+
+
+
+
+% Configure an animation attribute
+%
+% #1 = tikz attribute name
+% #2 = configuration
+%
+% Description:
+%
+% Sets up internals for the tikz attribute.
+
+\def\tikzanimationdefineattribute#1#2{%
+ \expandafter\def\csname tikz@anim@def@pgf@attr@#1\endcsname{#1}%
+ \expandafter\let\csname tikz@anim@def@no@node@#1\endcsname\pgfutil@empty
+ \expandafter\let\csname tikz@anim@def@is@node@#1\endcsname\pgfutil@empty
+ \expandafter\let\csname tikz@anim@def@code@#1\endcsname\pgfutil@empty
+ \expandafter\let\csname tikz@anim@def@parser@#1\endcsname\tikz@anim@simple@parse
+ \def\tikz@anim@attr{#1}%
+ \pgfkeys{/tikz/animate/@attrdef/.cd,#2}%
+}%
+
+\pgfkeys{/tikz/animate/@attrdef/.cd,
+ pgf attribute name/.code=\expandafter\def\csname tikz@anim@def@pgf@attr@\tikz@anim@attr\endcsname{#1},
+ pgf attribute name scope/.code=\expandafter\def\csname tikz@anim@def@pgf@attr@@scope@\tikz@anim@attr\endcsname{#1},
+ pgf attribute name node/.code=\expandafter\def\csname tikz@anim@def@pgf@attr@@node@\tikz@anim@attr\endcsname{#1},
+ scope type/.code=\expandafter\def\csname tikz@anim@def@no@node@\tikz@anim@attr\endcsname{#1},
+ node type/.code=\expandafter\def\csname tikz@anim@def@is@node@\tikz@anim@attr\endcsname{#1},
+ code/.code=\expandafter\def\csname tikz@anim@def@code@\tikz@anim@attr\endcsname{#1},
+ setup/.code=\expandafter\def\csname tikz@anim@def@setup@\tikz@anim@attr\endcsname{#1},
+ parser/.code=\expandafter\def\csname tikz@anim@def@parser@\tikz@anim@attr\endcsname{#1},
+}%
+
+
+% Configure an animation attribute list
+%
+% #1 = tikz attribute list name
+% #2 = list of tikz attributes
+%
+% Description:
+%
+% Sets up internals for the tikz attribute.
+
+\def\tikzanimationdefineattributelist#1#2{%
+ \tikzanimationattributesset{#1/.style={#2}}%
+}%
+
+
+
+
+% Definition of the tikz attributes
+
+
+\tikzanimationdefineattributelist{color}{@color,text}%
+\tikzanimationdefineattribute{@color}{pgf attribute name=color,node type=.background}%
+\tikzanimationdefineattribute{dash pattern}{pgf attribute name=dash,parser=dashpattern, node type=.background}%
+\tikzanimationdefineattribute{dash phase}{pgf attribute name=dash,parser=dashoffset, node type=.background}%
+\tikzanimationdefineattribute{dash}{parser=dash, node type=.background}%
+\tikzanimationdefineattribute{draw opacity}{pgf attribute name=stroke opacity}%
+\tikzanimationdefineattribute{draw}{pgf attribute name=stroke, node type=.background}%
+\tikzanimationdefineattribute{fill opacity}{}%
+\tikzanimationdefineattribute{fill}{node type=.background}%
+\tikzanimationdefineattribute{line width}{node type=.background}%
+\tikzanimationdefineattribute{path}{pgf attribute name=softpath, scope type=.path, node type=.background.path, parser=path}%
+\tikzanimationdefineattribute{opacity}{}%
+\tikzanimationdefineattribute{position}{%
+ pgf attribute name=\iftikz@anim@along motion\else translate\fi,
+ parser=\iftikz@anim@along simple\else position\fi,
+ setup=\tikz@anim@position@setup,
+}%
+\tikzanimationdefineattribute{rotate}{}%
+\tikzanimationdefineattribute{scale}{}%
+\tikzanimationdefineattribute{shift}{
+ pgf attribute name=\iftikz@anim@along motion\else translate\fi,
+ parser=\iftikz@anim@along simple\else shift\fi
+}%
+\tikzanimationdefineattribute{stage}{}%
+\tikzanimationdefineattribute{text opacity}{pgf attribute name=fill opacity, node type=.text, pgf attribute name scope=none}%
+\tikzanimationdefineattribute{text}{pgf attribute name=color, node type=.text, pgf attribute name scope=none}%
+\tikzanimationdefineattribute{view}{scope type=.view, parser=view}%
+\tikzanimationdefineattribute{visible}{}%
+\tikzanimationdefineattribute{xshift}{pgf attribute name=translate, parser=xshift}%
+\tikzanimationdefineattribute{xscale}{pgf attribute name=scale, parser=xscale}%
+\tikzanimationdefineattribute{xskew}{}%
+\tikzanimationdefineattribute{xslant}{pgf attribute name=xskew, parser=slant}%
+\tikzanimationdefineattribute{yshift}{pgf attribute name=translate, parser=yshift}%
+\tikzanimationdefineattribute{yskew}{}%
+\tikzanimationdefineattribute{yslant}{pgf attribute name=yskew, parser=slant}%
+\tikzanimationdefineattribute{yscale}{pgf attribute name=scale, parser=yscale}%
+
+
+\def\tikz@anim@position@setup{%
+ \pgfgettransform\tikz@anim@saved@transform%
+ \expandafter\def\expandafter\tikz@temp\expandafter{%
+ \expandafter\def\expandafter\tikz@anim@saved@transform\expandafter{\tikz@anim@saved@transform}%
+ \pgfsysanimkeycanvastransform{}{}%
+ \tikz@anim@is@positiontrue%
+ }%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\tikz@anim@initial@options%
+ \expandafter\expandafter\expandafter{\expandafter\tikz@temp\tikz@anim@initial@options}%
+}%
+\newif\iftikz@anim@is@position
+
+
+% The TikZ animation callbacks
+%
+% Description:
+%
+% The callbacks called by tikz.code.tex whenever an object is
+% created. These callbacks will add the accumulated animation code.
+
+\def\tikz@anim@id@hook{%
+ \expandafter\ifx\csname tikz@anim@att@\tikz@id@name\endcsname\relax%
+ % No named animation:
+ % Now, check for auto animation:
+ \expandafter\ifx\csname tikz@anim@att@\tikz@auto@id\endcsname\relax%
+ \else%
+ % Auto animation%
+ \ifx\tikz@id@name\pgfutil@empty% Id set?
+ % No, so set it
+ \def\tikz@id@name{@auto}%
+ \fi%
+ \pgfidrefnextuse\tikz@anim@current@id\tikz@id@name%
+ \csname tikz@anim@att@\tikz@auto@id\endcsname%
+ \expandafter\global\expandafter\let\csname tikz@anim@att@\tikz@auto@id\endcsname\relax%
+ \fi%
+ \else%
+ % Named animation:
+ \pgfidrefnextuse\tikz@anim@current@id\tikz@id@name%
+ \csname tikz@anim@att@\tikz@id@name\endcsname%
+ \csname tikz@anim@att@\tikz@auto@id\endcsname% and unnamed animation
+ \expandafter\global\expandafter\let\csname tikz@anim@att@\tikz@id@name\endcsname\relax%
+ \expandafter\global\expandafter\let\csname tikz@anim@att@\tikz@auto@id\endcsname\relax%
+ \fi%
+}%
+
+% Add hook:
+\expandafter\def\expandafter\tikz@id@hook\expandafter{\tikz@id@hook\tikz@anim@id@hook}%
+
+
+
+% Attaches an animation to a named object (named in tikz)
+%
+% #1 = name of the object. If equal to the special text "myself", the
+% next created object is meant.
+% #2 = Animation code. When this code is executed, the following
+% things will be setup:
+%
+% \iftikz@is@node will be set to true or false
+% depending on whether the name references a node.
+%
+% \tikz@id@name will be set to the name of the object,
+% typically #1, except when #1 was ".", in this case another
+% name may have been used by the user, which will be used
+% instead.
+%
+% Description:
+%
+% After the call, the next time an object named #1 is created in TikZ
+% (using name=#1), the code #2 will be executed inside a scope to
+% create an animation of the object.
+
+\def\tikzanimationattachto#1#2{%
+ {%
+ \def\tikz@anim@name{#1}%
+ \ifx\tikz@anim@name\pgfutil@empty%
+ \tikzerror{Trying to attach an animation to an unnamed object. This should not happen.}%
+ \else%
+ \expandafter\ifx\csname tikz@anim@att@\tikz@anim@name\endcsname\relax%
+ \expandafter\gdef\csname tikz@anim@att@\tikz@anim@name\endcsname{#2}%
+ \else%
+ \expandafter\let\expandafter\tikz@temp\csname tikz@anim@att@\tikz@anim@name\endcsname%
+ \expandafter\def\expandafter\tikz@temp\expandafter{\tikz@temp#2}%
+ \expandafter\global\expandafter\let\csname tikz@anim@att@\tikz@anim@name\endcsname\tikz@temp%
+ \fi%
+ \fi%
+ }%
+}%
+\def\tikz@auto@id{myself}%
+\expandafter\let\csname tikz@anim@att@\tikz@auto@id\endcsname\relax%
+
+
+% Add config code to a timeline
+%
+% #1 = The object (may be "myself")
+% #2 = The attribute (see pgfanimateattribute)
+% #3 = Timeline sequence identifier
+% #4 = code
+%
+% Description:
+%
+% This commands adds the code to the timeline configuration, which is
+% code that gets executed before the rest of entries of the timeline
+% are executed.
+
+\def\tikz@timeline@config#1#2#3#4{%
+ \expandafter\def\expandafter\tikz@temp\expandafter{\csname tikz@a@conf@#1@#2@#3\endcsname}%
+ \expandafter\ifx\tikz@temp\relax%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\gdef\expandafter\expandafter\expandafter\tikz@temp\expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter\global\expandafter\let\tikz@temp\relax}%
+ \fi%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\gdef\expandafter\expandafter\expandafter\tikz@temp\expandafter\expandafter\expandafter{\tikz@temp#4}%
+}%
+
+
+
+% Add a timeline entry
+%
+% #1 = The object (may be "myself")
+% #2 = The attribute (see pgfanimateattribute)
+% #3 = Timeline sequence identifier
+% #4 = early code
+% #5 = later code
+%
+% Description:
+%
+% This command stores an option with a timeline of an object. For each
+% object--attribute--identifier tuple a timeline can be created, for
+% which the values of #4 and #5 are collected. Later on, \pgfanimateattribute
+% will be called for the pgf attribute associated with tikz attribute,
+% the type associated with it and initial code, followed by the
+% accumulated values of #4 and then the accumulated values of #5.
+
+\def\tikz@timeline@entry#1#2#3#4#5{%
+ % First, does the object have an animation already attached?
+ \expandafter\ifx\csname tikz@a@tlo@#1\endcsname\relax%
+ % No, first entry!
+ % Create call:
+ \edef\pgf@marshal{\noexpand\tikzanimationattachto{#1}{\expandafter\noexpand\csname tikz@a@tlo@#1\endcsname}}%
+ \pgf@marshal%
+ \expandafter\gdef\csname tikz@a@tlo@#1\endcsname{\tikz@anim@cleanup{#1}}%
+ \fi%
+ % Second, does the timeline exist?
+ \expandafter\ifx\csname tikz@a@tlc@#1@#2@#3\endcsname\relax%
+ % No, first entry!
+ \def\tikz@anim@initial@early@options{#4}%
+ \def\tikz@anim@initial@options{#5}%
+ \csname tikz@anim@def@setup@#2\endcsname%
+ % Create timeline...
+ \expandafter\global\expandafter\let\csname tikz@a@tlc@#1@#2@#3\endcsname\tikz@anim@initial@options%
+ \expandafter\global\expandafter\let\csname tikz@a@tld@#1@#2@#3\endcsname\tikz@anim@initial@early@options%
+ % ...and add to calls
+ \expandafter\let\expandafter\pgf@temp\csname tikz@a@tlo@#1\endcsname%
+ \expandafter\def\expandafter\pgf@temp@name\expandafter{\tikz@anim@create{#1}{#2}{#3}}%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@temp\expandafter\expandafter\expandafter{\expandafter\pgf@temp\pgf@temp@name}%
+ \expandafter\global\expandafter\let\csname tikz@a@tlo@#1\endcsname\pgf@temp%
+ \else%
+ % Add to timeline:
+ \expandafter\let\expandafter\pgf@temp\csname tikz@a@tld@#1@#2@#3\endcsname%
+ \expandafter\def\expandafter\pgf@temp\expandafter{\pgf@temp#4}%
+ \expandafter\global\expandafter\let\csname tikz@a@tld@#1@#2@#3\endcsname\pgf@temp%
+ \expandafter\let\expandafter\pgf@temp\csname tikz@a@tlc@#1@#2@#3\endcsname%
+ \expandafter\def\expandafter\pgf@temp\expandafter{\pgf@temp#5}%
+ \expandafter\global\expandafter\let\csname tikz@a@tlc@#1@#2@#3\endcsname\pgf@temp%
+ \fi%
+}%
+
+
+\def\tikz@anim@cleanup#1{%
+ \expandafter\global\expandafter\let\csname tikz@a@tlo@#1\endcsname\relax%
+}%
+
+\def\tikz@anim@create#1#2#3{%
+ \csname tikz@a@conf@#1@#2@#3\endcsname%
+ \iftikz@is@node%
+ \expandafter\let\expandafter\tikz@temp\csname tikz@anim@def@pgf@attr@@node@#2\endcsname%
+ \else%
+ \expandafter\let\expandafter\tikz@temp\csname tikz@anim@def@pgf@attr@@scope@#2\endcsname%
+ \fi%
+ \ifx\tikz@temp\relax%
+ \expandafter\let\expandafter\tikz@temp\csname tikz@anim@def@pgf@attr@#2\endcsname%
+ \fi%
+ \expandafter\pgfanimateattributecode\expandafter{\tikz@temp}{%
+ \iftikz@is@node%
+ \edef\tikz@anim@whom{\tikz@id@name\csname tikz@anim@def@is@node@#2\endcsname}%
+ \else%
+ \edef\tikz@anim@whom{\tikz@id@name\csname tikz@anim@def@no@node@#2\endcsname}%
+ \fi%
+ \pgfanimationset{whom=\tikz@anim@whom}%
+ \expandafter\let\expandafter\tikz@animation@parser\csname tikz@anim@\csname tikz@anim@def@parser@#2\endcsname @parse\endcsname%
+ \csname tikz@anim@def@code@#2\endcsname%
+ \csname tikz@a@tld@#1@#2@#3\endcsname%
+ \csname tikz@a@tlc@#1@#2@#3\endcsname%
+ }%
+ \expandafter\global\expandafter\let\csname tikz@a@tlc@#1@#2@#3\endcsname\relax%
+ \expandafter\global\expandafter\let\csname tikz@a@tld@#1@#2@#3\endcsname\relax%
+}%
+
+
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryarrows.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryarrows.code.tex
index 7926021f8e6..946f87455e7 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryarrows.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryarrows.code.tex
@@ -7,8 +7,8 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryarrows.code.tex,v 1.1 2008/01/09 17:57:15 tantau Exp $
+\ProvidesFileRCS{tikzlibraryarrows.code.tex}
-\usepgflibrary{arrows}
+\usepgflibrary{arrows}%
\endinput
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 d2aa190d618..93dc77be779 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,18 +7,18 @@
%
% 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.3 2008/07/14 10:30:36 tantau Exp $
+\ProvidesFileRCS{tikzlibraryautomata.code.tex}
-\usetikzlibrary{shapes.multipart}
+\usetikzlibrary{shapes.multipart}%
% Styles for states:
-\tikzstyle{every state}= []
+\tikzset{every state/.style= {}}%
-\tikzstyle{state without output}= [circle,draw,minimum size=2.5em,every state]
-\tikzstyle{state with output}= [circle split,draw,minimum size=2.5em,every state]
+\tikzset{state without output/.style= {circle,draw,minimum size=2.5em,every state}}%
+\tikzset{state with output/.style= {circle split,draw,minimum size=2.5em,every state}}%
-\tikzstyle{accepting by arrow}= [after node path=
+\tikzset{accepting by arrow/.style= {after node path=
{
{
[to path=
@@ -30,11 +30,11 @@
}]
edge ()
}
-}]
-\tikzstyle{every accepting by arrow}=[]
-\tikzstyle{accepting by double}= [double,outer sep=.5\pgflinewidth+.3pt] % .3pt is half double width distance
+}}}%
+\tikzset{every accepting by arrow/.style={}}%
+\tikzset{accepting by double/.style= {double,outer sep=.5\pgflinewidth+.3pt}} % .3pt is half double width distance
-\tikzstyle{initial by arrow}= [after node path=
+\tikzset{initial by arrow/.style= {after node path=
{
{
[to path=
@@ -45,60 +45,60 @@
-- (\tikztostart)}]
edge ()
}
-}]
-\tikzstyle{every initial by arrow}=[]
+}}}%
+\tikzset{every initial by arrow/.style={}}%
-\tikzstyle{initial by diamond}=[shape=diamond]
+\tikzset{initial by diamond/.style={shape=diamond}}%
-\tikzoption{initial text}{\tikzaddafternodepathoption{\def\tikz@initial@text{#1}}}
-\tikzoption{accepting text}{\tikzaddafternodepathoption{\def\tikz@accepting@text{#1}}}
+\tikzoption{initial text}{\tikzaddafternodepathoption{\def\tikz@initial@text{#1}}}%
+\tikzoption{accepting text}{\tikzaddafternodepathoption{\def\tikz@accepting@text{#1}}}%
-\tikzoption{initial where}{\tikzaddafternodepathoption{\csname tikz@initial@compute@#1\endcsname}}
-\tikzoption{accepting where}{\tikzaddafternodepathoption{\csname tikz@accepting@compute@#1\endcsname}}
+\tikzoption{initial where}{\tikzaddafternodepathoption{\csname tikz@initial@compute@#1\endcsname}}%
+\tikzoption{accepting where}{\tikzaddafternodepathoption{\csname tikz@accepting@compute@#1\endcsname}}%
-\tikzoption{initial distance}{\tikzaddafternodepathoption{\def\tikz@initial@distance{#1}}}
-\tikzoption{accepting distance}{\tikzaddafternodepathoption{\def\tikz@accepting@distance{#1}}}
+\tikzoption{initial distance}{\tikzaddafternodepathoption{\def\tikz@initial@distance{#1}}}%
+\tikzoption{accepting distance}{\tikzaddafternodepathoption{\def\tikz@accepting@distance{#1}}}%
-\def\tikz@initial@text{start}
-\def\tikz@accepting@text{}
+\def\tikz@initial@text{start}%
+\def\tikz@accepting@text{}%
-\def\tikz@initial@distance{3ex}
-\def\tikz@accepting@distance{3ex}
+\def\tikz@initial@distance{3ex}%
+\def\tikz@accepting@distance{3ex}%
-\def\tikz@initial@compute@above{\def\tikz@initial@angle{90}\def\tikz@initial@anchor{south}}
-\def\tikz@initial@compute@below{\def\tikz@initial@angle{270}\def\tikz@initial@anchor{north}}
-\def\tikz@initial@compute@left{\def\tikz@initial@angle{180}\def\tikz@initial@anchor{east}}
-\def\tikz@initial@compute@right{\def\tikz@initial@angle{0}\def\tikz@initial@anchor{west}}
+\def\tikz@initial@compute@above{\def\tikz@initial@angle{90}\def\tikz@initial@anchor{south}}%
+\def\tikz@initial@compute@below{\def\tikz@initial@angle{270}\def\tikz@initial@anchor{north}}%
+\def\tikz@initial@compute@left{\def\tikz@initial@angle{180}\def\tikz@initial@anchor{east}}%
+\def\tikz@initial@compute@right{\def\tikz@initial@angle{0}\def\tikz@initial@anchor{west}}%
-\def\tikz@initial@angle{180}
-\def\tikz@initial@anchor{east}
+\def\tikz@initial@angle{180}%
+\def\tikz@initial@anchor{east}%
-\def\tikz@accepting@compute@above{\def\tikz@accepting@angle{90}\def\tikz@accepting@anchor{south}}
-\def\tikz@accepting@compute@below{\def\tikz@accepting@angle{270}\def\tikz@accepting@anchor{north}}
-\def\tikz@accepting@compute@left{\def\tikz@accepting@angle{180}\def\tikz@accepting@anchor{east}}
-\def\tikz@accepting@compute@right{\def\tikz@accepting@angle{0}\def\tikz@accepting@anchor{west}}
+\def\tikz@accepting@compute@above{\def\tikz@accepting@angle{90}\def\tikz@accepting@anchor{south}}%
+\def\tikz@accepting@compute@below{\def\tikz@accepting@angle{270}\def\tikz@accepting@anchor{north}}%
+\def\tikz@accepting@compute@left{\def\tikz@accepting@angle{180}\def\tikz@accepting@anchor{east}}%
+\def\tikz@accepting@compute@right{\def\tikz@accepting@angle{0}\def\tikz@accepting@anchor{west}}%
-\def\tikz@accepting@angle{0}
-\def\tikz@accepting@anchor{west}
+\def\tikz@accepting@angle{0}%
+\def\tikz@accepting@anchor{west}%
-\tikzstyle{initial above}= [initial by arrow,initial where=above]
-\tikzstyle{initial below}= [initial by arrow,initial where=below]
-\tikzstyle{initial left}= [initial by arrow,initial where=left]
-\tikzstyle{initial right}= [initial by arrow,initial where=right]
+\tikzset{initial above/.style= {initial by arrow,initial where=above}}%
+\tikzset{initial below/.style= {initial by arrow,initial where=below}}%
+\tikzset{initial left/.style= {initial by arrow,initial where=left}}%
+\tikzset{initial right/.style= {initial by arrow,initial where=right}}%
-\tikzstyle{accepting above}= [accepting by arrow,accepting where=above]
-\tikzstyle{accepting below}= [accepting by arrow,accepting where=below]
-\tikzstyle{accepting left}= [accepting by arrow,accepting where=left]
-\tikzstyle{accepting right}= [accepting by arrow,accepting where=right]
+\tikzset{accepting above/.style= {accepting by arrow,accepting where=above}}%
+\tikzset{accepting below/.style= {accepting by arrow,accepting where=below}}%
+\tikzset{accepting left/.style= {accepting by arrow,accepting where=left}}%
+\tikzset{accepting right/.style= {accepting by arrow,accepting where=right}}%
% Defaults:
-\tikzstyle{state}= [state without output]
-\tikzstyle{accepting}= [accepting by double]
-\tikzstyle{initial}= [initial by arrow]
+\tikzset{state/.style= {state without output}}%
+\tikzset{accepting/.style= {accepting by double}}%
+\tikzset{initial/.style= {initial by arrow}}%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybabel.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybabel.code.tex
index 37b5ae20231..cf307cf6a8c 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybabel.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybabel.code.tex
@@ -7,11 +7,11 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybabel.code.tex,v 1.1 2013/06/24 11:49:06 tantau Exp $
+\ProvidesFileRCS{tikzlibrarybabel.code.tex}
\tikzset{
handle active characters in code,
- handle active characters in nodes
-}
+ handle active characters in nodes,
+}%
\endinput
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 6302b629ae4..690953b8054 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,13 +7,13 @@
%
% 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.3 2013/07/18 17:07:38 tantau Exp $
+\ProvidesFileRCS{tikzlibrarybackgrounds.code.tex}
% Layers
-\pgfdeclarelayer{background}
-\pgfsetlayers{background,main}
+\pgfdeclarelayer{background}%
+\pgfsetlayers{background,main}%
% Switch command
@@ -25,49 +25,49 @@
\tikz@options},
execute at end scope={\endpgfonlayer}
}
-}
+}%
% Main style
-\tikzstyle{background rectangle}= [draw]
-\tikzstyle{background top}= [draw]
-\tikzstyle{background bottom}= [draw]
-\tikzstyle{background left}= [draw]
-\tikzstyle{background right}= [draw]
-\tikzstyle{background grid}= [help lines,draw]
+\tikzset{background rectangle/.style= {draw}}%
+\tikzset{background top/.style= {draw}}%
+\tikzset{background bottom/.style= {draw}}%
+\tikzset{background left/.style= {draw}}%
+\tikzset{background right/.style= {draw}}%
+\tikzset{background grid/.style= {help lines,draw}}%
-\tikzoption{inner frame sep}{\def\tikz@framexsep{#1}\def\tikz@frameysep{#1}}
-\tikzoption{inner frame xsep}{\def\tikz@framexsep{#1}}
-\tikzoption{inner frame ysep}{\def\tikz@frameysep{#1}}
-\def\tikz@framexsep{1ex}
-\def\tikz@frameysep{1ex}
+\tikzoption{inner frame sep}{\def\tikz@framexsep{#1}\def\tikz@frameysep{#1}}%
+\tikzoption{inner frame xsep}{\def\tikz@framexsep{#1}}%
+\tikzoption{inner frame ysep}{\def\tikz@frameysep{#1}}%
+\def\tikz@framexsep{1ex}%
+\def\tikz@frameysep{1ex}%
-\tikzoption{outer frame sep}{\def\tikz@outerframexsep{#1}\def\tikz@outerframeysep{#1}}
-\tikzoption{outer frame xsep}{\def\tikz@outerframexsep{#1}}
-\tikzoption{outer frame ysep}{\def\tikz@outerframeysep{#1}}
-\def\tikz@outerframexsep{0ex}
-\def\tikz@outerframeysep{0ex}
+\tikzoption{outer frame sep}{\def\tikz@outerframexsep{#1}\def\tikz@outerframeysep{#1}}%
+\tikzoption{outer frame xsep}{\def\tikz@outerframexsep{#1}}%
+\tikzoption{outer frame ysep}{\def\tikz@outerframeysep{#1}}%
+\def\tikz@outerframexsep{0ex}%
+\def\tikz@outerframeysep{0ex}%
% Looseness
-\tikzstyle{loose background}= [inner frame sep=2ex]
-\tikzstyle{tight background}= [inner frame sep=0ex]
+\tikzset{loose background/.style= {inner frame sep=2ex}}%
+\tikzset{tight background/.style= {inner frame sep=0ex}}%
% Showing background styles
-\tikzstyle{framed}= [style=show background rectangle]
-\tikzstyle{gridded}= [style=show background grid]
+\tikzset{framed/.style= {style=show background rectangle}}%
+\tikzset{gridded/.style= {style=show background grid}}%
-\tikzstyle{show background rectangle}=[execute at end picture=\tikz@background@framed]
-\tikzstyle{show background top}= [execute at end picture=\tikz@background@top]
-\tikzstyle{show background bottom}= [execute at end picture=\tikz@background@bottom]
-\tikzstyle{show background left}= [execute at end picture=\tikz@background@left]
-\tikzstyle{show background right}= [execute at end picture=\tikz@background@right]
-\tikzstyle{show background grid}= [execute at end picture=\tikz@background@grid]
+\tikzset{show background rectangle/.style={execute at end picture=\tikz@background@framed}}%
+\tikzset{show background top/.style= {execute at end picture=\tikz@background@top}}%
+\tikzset{show background bottom/.style= {execute at end picture=\tikz@background@bottom}}%
+\tikzset{show background left/.style= {execute at end picture=\tikz@background@left}}%
+\tikzset{show background right/.style= {execute at end picture=\tikz@background@right}}%
+\tikzset{show background grid/.style= {execute at end picture=\tikz@background@grid}}%
% Implementation
@@ -100,49 +100,49 @@
\edef\tikz@bg@outermaxx{\the\pgf@xc}%
\edef\tikz@bg@outermaxy{\the\pgf@yc}%
\fi%
-}
+}%
\def\tikz@background@framed{%
\tikz@background@save%
\pgfonlayer{background}
\path[style=background rectangle] (\tikz@bg@minx,\tikz@bg@miny) rectangle (\tikz@bg@maxx,\tikz@bg@maxy);
\endpgfonlayer
-}
+}%
\def\tikz@background@top{%
\tikz@background@save%
\pgfonlayer{background}
\path[style=background top] (\tikz@bg@outerminx,\tikz@bg@maxy) -- (\tikz@bg@outermaxx,\tikz@bg@maxy);
\endpgfonlayer
-}
+}%
\def\tikz@background@bottom{%
\tikz@background@save%
\pgfonlayer{background}
\path[style=background bottom] (\tikz@bg@outerminx,\tikz@bg@miny) -- (\tikz@bg@outermaxx,\tikz@bg@miny);
\endpgfonlayer
-}
+}%
\def\tikz@background@left{%
\tikz@background@save%
\pgfonlayer{background}
\path[style=background left] (\tikz@bg@minx,\tikz@bg@outerminy) -- (\tikz@bg@minx,\tikz@bg@outermaxy);
\endpgfonlayer
-}
+}%
\def\tikz@background@right{%
\tikz@background@save%
\pgfonlayer{background}
\path[style=background right] (\tikz@bg@maxx,\tikz@bg@outerminy) -- (\tikz@bg@maxx,\tikz@bg@outermaxy);
\endpgfonlayer
-}
+}%
\def\tikz@background@grid{%
\tikz@background@save%
\pgfonlayer{background}
\path[style=background grid] (\tikz@bg@minx,\tikz@bg@miny) grid (\tikz@bg@maxx,\tikz@bg@maxy);
\endpgfonlayer
-}
+}%
+
-
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybending.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybending.code.tex
index 42a410ce4f5..be9c8bb707a 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybending.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybending.code.tex
@@ -7,9 +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/tikzlibrarybending.code.tex,v 1.2 2013/09/17 22:00:21 tantau Exp $
+\ProvidesFileRCS{tikzlibrarybending.code.tex}
-\usepgfmodule{bending}
-\tikzset{arrows=[flex]}
+\usepgfmodule{bending}%
+\tikzset{arrows=[flex]}%
\endinput
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 703494d2a64..561a725307f 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,12 +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/tikzlibrarycalc.code.tex,v 1.9 2013/07/15 12:05:31 tantau Exp $
+\ProvidesFileRCS{tikzlibrarycalc.code.tex}
%
%
% Part I: The let path command
-%
+%
%
@@ -21,11 +21,11 @@
%
% Currently (this may get more fancy in the future), the (coord)s are
% evaluated one by one. If the first evaluates to, say, (10pt,20pt),
-% the macro \p{name1} is set to "10pt,20pt" (without parantheses), the
+% the macro \p{name1} is set to "10pt,20pt" (without parentheses), the
% macro \x{name1} is set to "10pt" and the macro \y{name1} is set to
-% "20pt".
+% "20pt".
%
-% If you use a number for {name}, you need no parantheses, so you
+% If you use a number for {name}, you need no parentheses, so you
% could write:
%
% \draw let
@@ -40,7 +40,7 @@
\let\y=\tikz@cc@doy%
\let\n=\tikz@cc@don%
\pgfutil@ifnextchar i{\tikz@cc@stop@let}{\tikz@cc@handle@line}%
-}
+}%
\def\tikz@cc@handle@line{%
\pgfutil@ifnextchar\p{%
\tikz@cc@handle@coor%
@@ -51,34 +51,34 @@
\tikzerror{``\string\p'' or ``\string\n'' expected}%
}%
}%
-}
+}%
\def\tikz@cc@handle@num\n#1#2=#3{%
\pgfmathparse{#3}%
\expandafter\edef\csname tikz@cc@n@#1\endcsname{\pgfmathresult\ifpgfmathunitsdeclared pt\fi}
\pgfutil@ifnextchar,{\tikz@cc@handle@nextline}{\tikz@cc@stop@let}%
-}
+}%
\def\tikz@cc@handle@coor\p#1#2={%
\def\tikz@cc@coord@name{#1}%
\tikz@scan@one@point\tikz@cc@dolet%
-}
+}%
\def\tikz@cc@dolet#1{%
\pgf@process{#1}%
\expandafter\edef\csname tikz@cc@p@\tikz@cc@coord@name\endcsname{\the\pgf@x,\the\pgf@y}%
\expandafter\edef\csname tikz@cc@x@\tikz@cc@coord@name\endcsname{\the\pgf@x}%
\expandafter\edef\csname tikz@cc@y@\tikz@cc@coord@name\endcsname{\the\pgf@y}%
\pgfutil@ifnextchar,{\tikz@cc@handle@nextline}{\tikz@cc@stop@let}%
-}
+}%
\def\tikz@cc@handle@nextline,{%
\tikz@cc@handle@line%
-}
+}%
\def\tikz@cc@stop@let in{%
\tikz@scan@next@command%
}%
-\def\tikz@cc@dop#1{\csname tikz@cc@p@#1\endcsname}
-\def\tikz@cc@dox#1{\csname tikz@cc@x@#1\endcsname}
-\def\tikz@cc@doy#1{\csname tikz@cc@y@#1\endcsname}
-\def\tikz@cc@don#1{\csname tikz@cc@n@#1\endcsname}
+\def\tikz@cc@dop#1{\csname tikz@cc@p@#1\endcsname}%
+\def\tikz@cc@dox#1{\csname tikz@cc@x@#1\endcsname}%
+\def\tikz@cc@doy#1{\csname tikz@cc@y@#1\endcsname}%
+\def\tikz@cc@don#1{\csname tikz@cc@n@#1\endcsname}%
@@ -93,12 +93,12 @@
\begingroup%
%
% Parse main computation. It's a series of optional factors in front
- % of coordiantes.
- %
+ % of coordinates.
+ %
\pgf@xa=0pt% We accumulate the result in here.
\pgf@ya=0pt%
- \tikz@cc@parse+%
-}
+ \tikz@cc@parse+%
+}%
\def\tikz@cc@parse{%
\pgfutil@ifnextchar${%$
@@ -117,7 +117,7 @@
}%
}%
}%
-}
+}%
%
% The end is reached with $
@@ -126,7 +126,7 @@
\xdef\tikz@marshal{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
\endgroup%
\expandafter\tikz@cc@command\expandafter{\tikz@marshal}%
-}
+}%
%
@@ -135,15 +135,15 @@
\def\tikz@cc@add+{%
\def\tikz@cc@factor{1}%
\tikz@cc@factororcoordinate%
-}
+}%
\def\tikz@cc@sub-{%
\def\tikz@cc@factor{-1}%
\tikz@cc@factororcoordinate%
-}
+}%
%
% Check for a factor: If we see a (, its a coordinate...
-%
+%
\def\tikz@cc@factororcoordinate{%
\pgfutil@ifnextchar({%)
% Ok, found coordinate
@@ -151,7 +151,7 @@
}{%
\tikz@cc@parse@factor%
}%
-}
+}%
%
% ... otherwise it's a factor. It ends at ...*(
@@ -160,17 +160,17 @@
\pgfmathparse{#1*\tikz@cc@factor}%
\let\tikz@cc@factor=\pgfmathresult%
\tikz@cc@coordinate(%)
-}
+}%
\def\tikz@cc@coordinate{%
\tikz@scan@absolute\tikz@cc@after@coordinate%
-}
+}%
\def\tikz@cc@after@coordinate#1{%
\pgf@process{#1}%
\pgf@xb=\pgf@x%
\pgf@yb=\pgf@y%
\tikz@cc@mid@checks%
-}
+}%
%
@@ -182,7 +182,8 @@
\expandafter\tikz@cc@mid@checks@active
\else
\expandafter\tikz@cc@mid@checks@nonactive
- \fi}
+ \fi
+}%
\def\tikz@cc@mid@checks@nonactive{%
\pgfutil@ifnextchar!{%
@@ -192,7 +193,7 @@
\advance\pgf@ya by\tikz@cc@factor\pgf@yb
\tikz@cc@parse%
}%
-}
+}%
\def\tikz@cc@mid@nonactive!{%
\pgfutil@ifnextchar({%
@@ -200,7 +201,7 @@
}{%
\tikz@cc@mid@num@nonactive%
}%
-}
+}%
\begingroup
\catcode`\!=\active
@@ -212,7 +213,7 @@
\advance\pgf@ya by\tikz@cc@factor\pgf@yb
\tikz@cc@parse%
}%
- }
+ }%
\gdef\tikz@cc@mid@active!{%
\pgfutil@ifnextchar({%
@@ -220,7 +221,7 @@
}{%
\tikz@cc@mid@num@active%
}%
- }
+ }%
\endgroup
%
@@ -231,11 +232,11 @@
% is (b)
%
-\def\tikz@cc@mid@num@nonactive#1!{\tikz@cc@mid@num{#1}}
+\def\tikz@cc@mid@num@nonactive#1!{\tikz@cc@mid@num{#1}}%
\begingroup
\catcode`\!=\active
- \gdef\tikz@cc@mid@num@active#1!{\tikz@cc@mid@num{#1}}
+ \gdef\tikz@cc@mid@num@active#1!{\tikz@cc@mid@num{#1}}%
\endgroup
\def\tikz@cc@mid@num#1{%
@@ -249,7 +250,7 @@
\let\tikz@cc@mid@factor@one=\pgfmathresult%
\expandafter\tikz@cc@scan@rot\expandafter\tikz@cc@after@num%
\fi%
-}
+}%
\def\tikz@cc@after@num#1{%
\pgf@process{#1}%
@@ -258,7 +259,7 @@
\advance\pgf@xb by\tikz@cc@mid@factor\pgf@x%
\advance\pgf@yb by\tikz@cc@mid@factor\pgf@y%
\tikz@cc@mid@checks%
-}
+}%
@@ -277,7 +278,7 @@
\advance\pgf@xb by\tikz@cc@mid@unit\pgf@x%
\advance\pgf@yb by\tikz@cc@mid@unit\pgf@y%
\tikz@cc@mid@checks%
-}
+}%
%
% Projection case: (a)!(p)!(b)
@@ -302,13 +303,13 @@
\tikz@cc@scan@ex@nonactive}%
\fi
\tikz@next%
-}
+}%
-\def\tikz@cc@scan@ex@nonactive!{}
+\def\tikz@cc@scan@ex@nonactive!{}%
\begingroup
\catcode`\!=\active
- \gdef\tikz@cc@scan@ex@active!{}
+ \gdef\tikz@cc@scan@ex@active!{}%
\endgroup
\def\tikz@cc@after@project#1{%
@@ -326,7 +327,7 @@
\advance\pgf@xb by\pgf@sys@tonumber{\pgf@xc}\pgf@x%
\advance\pgf@yb by\pgf@sys@tonumber{\pgf@xc}\pgf@y%
\tikz@cc@mid@checks%
-}
+}%
%
% Rotational scanner: radius:(x)
@@ -336,7 +337,7 @@
\pgfutil@ifnextchar({%)
\tikz@scan@one@point#1% normal
}%
- {
+ {%
\def\tikz@cc@scan@rot@cmd{#1}%
\ifnum\the\catcode`\:=\active\relax
\expandafter\tikz@cc@scan@one@rot@active%
@@ -344,19 +345,19 @@
\expandafter\tikz@cc@scan@one@rot@nonactive%
\fi
}%
-}
+}%
\def\tikz@cc@scan@one@rot@nonactive#1:{%
\def\tikz@cc@scan@rot@angle{#1}%
\tikz@scan@one@point\tikz@cc@handle@rot%
-}
+}%
\begingroup
\catcode`\:=\active
\gdef\tikz@cc@scan@one@rot@active#1:{%
\def\tikz@cc@scan@rot@angle{#1}%
\tikz@scan@one@point\tikz@cc@handle@rot%
- }
+ }%
\endgroup
\def\tikz@cc@handle@rot#1{%
@@ -375,7 +376,7 @@
}%
\edef\tikz@marshal{\noexpand\tikz@cc@scan@rot@cmd{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}%
\tikz@marshal%
-}
+}%
@@ -383,32 +384,32 @@
%
%
% Part III: Calculation coordinate systems
-%
+%
%
% Tangent cs: Keys are a node and a point. Depending on the type of
-% node, the appropriate tanent computation should be done.
+% node, the appropriate tangent computation should be done.
\tikzdeclarecoordinatesystem{tangent}
{%
\tikzset{cs/.cd,#1}%
\expandafter\ifx\csname tikz@tangent@\tikz@cs@type\endcsname\relax%
- \tikzerror{I do not know how to compute the tangent to
+ \tikzerror{I do not know how to compute the tangent to
a \tikz@cs@type}%
\pgfpointorigin%
\else%
- \expandafter\tikz@scan@one@point\expandafter\tikz@lib@do@tangent\tikz@cs@point%
+ \expandafter\tikz@scan@one@point\expandafter\tikz@lib@do@tangent\tikz@cs@point%
\fi%
-}
+}%
-\tikzset{cs/node/.code=\tikz@cs@unpack{\tikz@cs@node}{\tikz@cs@type}{#1}}
-\tikzset{cs/point/.store in=\tikz@cs@point}
+\tikzset{cs/node/.code=\tikz@cs@unpack{\tikz@cs@node}{\tikz@cs@type}{#1}}%
+\tikzset{cs/point/.store in=\tikz@cs@point}%
-\def\tikz@lib@do@tangent{\csname tikz@tangent@\tikz@cs@type\endcsname}
+\def\tikz@lib@do@tangent{\csname tikz@tangent@\tikz@cs@type\endcsname}%
\def\tikz@tangent@coordinate#1{%
\pgfpointanchor{\tikz@cs@node}{center}%
-}
+}%
\def\tikz@tangent@circle#1{%
{%
@@ -464,7 +465,7 @@
\pgftransforminvert%
\pgf@process{\pgfpointtransformed{}}%
}%
-}
+}%
% Implementation of intersections
@@ -502,7 +503,7 @@
\pgftransforminvert%
\pgf@process{\pgfpointtransformed{}}%
}%
-}
+}%
\def\tikz@intersect@line@and@circle{%
@@ -553,10 +554,10 @@
% and add
\advance\pgf@xa by\pgf@sys@tonumber{\pgf@xc}\pgf@x%
\advance\pgf@ya by\pgf@sys@tonumber{\pgf@xc}\pgf@y%
- %
+ %
% Now, we have a triangle with a right angle at (xa,ya). The
% second point of the triangle is the origin. The third point is
- % sought.
+ % sought.
% Save x/y
\pgf@xc=\pgf@x%
\pgf@yc=\pgf@y%
@@ -601,7 +602,7 @@
\pgftransforminvert%
\pgf@process{\pgfpointtransformed{}}%
}%
-}
+}%
\def\tikz@intersect@circle@and@line{%
% Swap
@@ -610,5 +611,4 @@
\let\tikz@cs@line@a=\tikz@cs@line@b%
\tikz@intersect@line@and@circle%
}%
-}
-
+}%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalendar.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalendar.code.tex
index 02b4f00bb6f..f3e8439491f 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalendar.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarycalendar.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/tikzlibrarycalendar.code.tex,v 1.3 2013/07/15 12:05:31 tantau Exp $
+\ProvidesFileRCS{tikzlibrarycalendar.code.tex}
\pgfutil@usemodule{pgfcalendar}
@@ -40,7 +40,7 @@
-%
+%
% Options affecting some calendars:
%
@@ -48,7 +48,7 @@
% Shifts and skips
%
-% Shift between days
+% Shift between days
\tikzoption{day xshift}{\def\tikz@lib@cal@xshift{#1}}
\tikzoption{day yshift}{\def\tikz@lib@cal@yshift{#1}}
@@ -72,16 +72,16 @@
\tikzoption{day code}{\def\tikzdaycode{#1}}
\tikzoption{day text}{\def\tikzdaytext{#1}}
-\tikzoption{days}{\tikzstyle{every day}+=[#1]}
-\tikzstyle{every day}=[anchor=base east]
+\tikzoption{days}{\tikzset{every day/.append style={#1}}}
+\tikzset{every day/.style={anchor=base east}}
\tikzoption{month code}{\def\tikzmonthcode{#1}}
\tikzoption{month text}{\def\tikzmonthtext{#1}}
-\tikzstyle{every month}=[]
+\tikzset{every month/.style={}}
\tikzoption{year code}{\def\tikzyearcode{#1}}
\tikzoption{year text}{\def\tikzyeartext{#1}}
-\tikzstyle{every year}=[]
+\tikzset{every year/.style={}}
\def\tikzdaycode{\node[name=\pgfcalendarsuggestedname,every day]{\tikzdaytext};}
\def\tikzmonthcode{\node[every month]{\tikzmonthtext};}
@@ -93,7 +93,7 @@
% Internal option for storing the "width" of a calendar as a number of
-% days
+% days
\tikzoption{tikz@lib@cal@width}{\def\tikz@lib@cal@width{#1}}
@@ -103,7 +103,7 @@
% Days on a line
%
-\tikzstyle{day list downward}=[%
+\tikzset{day list downward/.style={%
execute before day scope={
\ifdate{day of month=1}{\ifdate{equals=\pgfcalendarbeginiso}{}
{%
@@ -112,11 +112,11 @@
\pgftransformyshift{-\pgf@y}
}%
}{}%
- },
+ },
execute after day scope={\pgfmathsetlength{\pgf@y}{\tikz@lib@cal@yshift}\pgftransformyshift{-\pgf@y}},
tikz@lib@cal@width=1
-]
-\tikzstyle{day list upward}=[%
+}}
+\tikzset{day list upward/.style={%
execute before day scope={
\ifdate{day of month=1}{\ifdate{equals=\pgfcalendarbeginiso}{}
{%
@@ -124,11 +124,11 @@
\pgftransformyshift{\tikz@lib@cal@month@yshift}%
}%
}{}%
- },
+ },
execute after day scope={\pgftransformyshift\tikz@lib@cal@yshift},
tikz@lib@cal@width=1
-]
-\tikzstyle{day list right}=[%
+}}
+\tikzset{day list right/.style={%
execute before day scope={
\ifdate{day of month=1}{\ifdate{equals=\pgfcalendarbeginiso}{}
{%
@@ -136,12 +136,12 @@
\pgftransformxshift{\tikz@lib@cal@month@xshift}%
}%
}{}%
- },
+ },
execute after day scope={\pgftransformxshift\tikz@lib@cal@xshift},
tikz@lib@cal@width=30% not quite right, but close enough in most cases...
-]
+}}
-\tikzstyle{day list left}=[%
+\tikzset{day list left/.style={%
execute before day scope={
\ifdate{day of month=1}{\ifdate{equals=\pgfcalendarbeginiso}{}
{%
@@ -150,13 +150,13 @@
\pgftransformxshift{-\pgf@x}%
}%
}{}%
- },
+ },
execute after day scope={
\pgfmathsetlength{\pgf@x}{\tikz@lib@cal@xshift}
\pgftransformxshift{-\pgf@x}%
},
tikz@lib@cal@width=30% not quite right, but close enough in most cases...
-]
+}}
@@ -164,7 +164,7 @@
% Week list
%
-\tikzstyle{week list}=[%
+\tikzset{week list/.style={%
execute before day scope={%
\ifdate{day of month=1}{\ifdate{equals=\pgfcalendarbeginiso}{}
{%
@@ -173,7 +173,7 @@
\pgftransformyshift{-\pgf@y}
}%
}{}%
- },
+ },
execute at begin day scope={%
\pgfmathsetlength\pgf@x{\tikz@lib@cal@xshift}%
\pgf@x=\pgfcalendarcurrentweekday\pgf@x%
@@ -186,7 +186,7 @@
}{}%
},
tikz@lib@cal@width=7
-]
+}}
@@ -194,7 +194,7 @@
% Month list
%
-\tikzstyle{month list}=[%
+\tikzset{month list/.style={%
execute before day scope={%
\ifdate{day of month=1}{\ifdate{equals=\pgfcalendarbeginiso}{}
{%
@@ -219,7 +219,7 @@
}%
\let\tikz@lib@cal@month@list@start=\pgf@temp%
}{}%
- },
+ },
execute at begin day scope={%
\pgfmathsetlength\pgf@xa{\tikz@lib@cal@xshift}%
\pgf@xb=\pgfcalendarcurrentday\pgf@xa%
@@ -228,7 +228,7 @@
\pgftransformxshift{\pgf@xb}%
},
tikz@lib@cal@width=37
-]
+}}
@@ -237,17 +237,17 @@
% Month labels
%
-\tikzstyle{month label left}=[%
+\tikzset{month label left/.style={%
execute before day scope={\ifdate{day of month=1}{\tikzmonthcode}{}},
every month/.append style={anchor=base east,xshift=-3.5ex}
-]
+}}
-\tikzstyle{month label left vertical}=[%
+\tikzset{month label left vertical/.style={%
execute before day scope={\ifdate{day of month=1}{\tikzmonthcode}{}},
every month/.append style={anchor=base east,xshift=-4.5ex,yshift=2.25ex,rotate=90}
-]
-
-\tikzstyle{month label right}=[%
+}}
+
+\tikzset{month label right/.style={%
execute before day scope={\ifdate{day of month=1}{%
{%
\pgfmathsetlength{\pgf@xa}{\tikz@lib@cal@xshift}%
@@ -256,9 +256,9 @@ execute before day scope={\ifdate{day of month=1}{%
\tikzmonthcode%
}}{}},
every month/.append style={anchor=base west,xshift=1ex}
-]
+}}
-\tikzstyle{month label right vertical}=[%
+\tikzset{month label right vertical/.style={%
execute before day scope={\ifdate{day of month=1}{%
{%
\pgfmathsetlength{\pgf@xa}{\tikz@lib@cal@xshift}%
@@ -267,9 +267,9 @@ execute before day scope={\ifdate{day of month=1}{%
\tikzmonthcode%
}}{}},
every month/.append style={anchor=base west,xshift=2ex,yshift=2.25ex,rotate=-90}
-]
+}}
-\tikzstyle{month label above centered}=[%
+\tikzset{month label above centered/.style={%
execute before day scope={%
\ifdate{day of month=1}{%
{
@@ -285,9 +285,9 @@ execute before day scope={\ifdate{day of month=1}{%
}
}{}},
every month/.append style={anchor=base}
-]
-
-\tikzstyle{month label above left}=[%
+}}
+
+\tikzset{month label above left/.style={%
execute before day scope={%
\ifdate{day of month=1}{%
{
@@ -298,11 +298,11 @@ execute before day scope={\ifdate{day of month=1}{%
}
}{}},
every month/.append style={anchor=base west}
-]
+}}
-\tikzstyle{month label above right}=[%
+\tikzset{month label above right/.style={%
execute before day scope={%
\ifdate{day of month=1}{%
{
@@ -316,9 +316,9 @@ execute before day scope={\ifdate{day of month=1}{%
}
}{}},
every month/.append style={anchor=base east}
-]
-
-\tikzstyle{month label below centered}=[%
+}}
+
+\tikzset{month label below centered/.style={%
execute before day scope={%
\ifdate{day of month=1}{%
{
@@ -334,9 +334,9 @@ execute before day scope={\ifdate{day of month=1}{%
}
}{}},
every month/.append style={anchor=base}
-]
-
-\tikzstyle{month label below left}=[%
+}}
+
+\tikzset{month label below left/.style={%
execute before day scope={%
\ifdate{day of month=1}{%
{
@@ -347,7 +347,7 @@ execute before day scope={\ifdate{day of month=1}{%
}
}{}},
every month/.append style={anchor=base west}
-]
+}}
@@ -370,37 +370,37 @@ execute before day scope={\ifdate{day of month=1}{%
}
\def\tikz@lib@cal@handle{%
- \let\@next=\tikz@lib@cal@expand%
+ \let\pgfutil@next=\tikz@lib@cal@expand%
\ifx\pgf@let@token;%
- \let\@next=\tikz@lib@cal@stop%
+ \let\pgfutil@next=\tikz@lib@cal@stop%
\else%
\ifx\pgf@let@token(%)
- \let\@next=\tikz@lib@cal@name%
+ \let\pgfutil@next=\tikz@lib@cal@name%
\else%
\ifx\pgf@let@token a%
- \let\@next=\tikz@lib@cal@at%
+ \let\pgfutil@next=\tikz@lib@cal@at%
\else%
\ifx\pgf@let@token[%
- \let\@next=\tikz@lib@cal@option%
+ \let\pgfutil@next=\tikz@lib@cal@option%
\else%
\ifx\pgf@let@token i%
- \let\@next=\tikz@lib@cal@if%
+ \let\pgfutil@next=\tikz@lib@cal@if%
\fi%
\fi%
\fi%
\fi%
\fi%
- \@next%
+ \pgfutil@next%
}
\def\tikz@lib@cal@expand{%
\advance\tikz@expandcount by -1%
\ifnum\tikz@expandcount<0\relax%
\tikzerror{Giving up on this calendar}%
- \let\@next=\tikz@lib@cal@end%
+ \let\pgfutil@next=\tikz@lib@cal@end%
\else%
- \let\@next=\tikz@lib@cal@@expand
+ \let\pgfutil@next=\tikz@lib@cal@@expand
\fi%
- \@next}
+ \pgfutil@next}
\def\tikz@lib@cal@@expand{\expandafter\tikz@lib@cal@scanner\pgf@let@token}
@@ -435,14 +435,14 @@ execute before day scope={\ifdate{day of month=1}{%
\pgftransformshift{\tikz@node@at}%
\expandafter\pgfcalendar\expandafter{\tikz@fig@name}{\tikz@lib@cal@start}{\tikz@lib@cal@end}%
{%
- \tikz@before@day%
+ \tikz@before@day%
\scope%
\tikz@atbegin@day%
\tikz@lib@cal@ifs%
\tikzdaycode%
\tikz@atend@day%
\endscope%
- \tikz@after@day%
+ \tikz@after@day%
}%
\endgroup%
}
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 e2d12a0931a..c02f5207044 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,9 +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.6 2013/07/15 12:05:31 tantau Exp $
+\ProvidesFileRCS{tikzlibrarychains.code.tex}
-\usetikzlibrary{positioning}
+\usetikzlibrary{positioning}%
\tikzset{start chain/.default=,
start chain/.code={%
@@ -52,8 +52,8 @@
\fi%
},
join/.code=\tikz@lib@parse@join{#1},
- join/.default={}%
-}
+ join/.default={}%
+}%
\def\tikz@lib@chain@parse#1{%
\pgfutil@in@{going }{#1}%
@@ -68,7 +68,7 @@
\let\tikz@lib@chain@direction\relax%
\fi%
\fi%
-}
+}%
\def\tikz@lib@chain@going#1going #2\pgf@stop{%
\def\tikz@lib@chain@name{#1}%
@@ -82,8 +82,8 @@
\else%
\tikz@lib@chain@place{#2}%
\fi%
- }%
-}
+ }%
+}%
\def\tikz@lib@chain@positioning#1placed #2\pgf@stop{%
\def\tikz@lib@chain@name{#1}%
@@ -93,7 +93,7 @@
\fi%
\tikz@lib@chain@is@goingfalse%
\def\tikz@lib@chain@direction{\tikz@lib@chain@place{#2}}%
-}
+}%
\newif\iftikz@lib@chain@is@going
@@ -103,18 +103,18 @@
\let\tikz@lib@chain@default@direction=\tikz@lib@chain@direction%
},%
/tikz/chain default direction=going right
-}
+}%
-\def\tikz@lib@current@chain{chain}
+\def\tikz@lib@current@chain{chain}%
-\pgfutil@g@addto@macro\tikz@node@reset@hook{\let\tikz@lib@chain@caller=\relax}
-\pgfutil@g@addto@macro\tikz@node@begin@hook{\tikz@lib@chain@caller}
+\pgfutil@g@addto@macro\tikz@node@reset@hook{\let\tikz@lib@chain@caller=\relax}%
+\pgfutil@g@addto@macro\tikz@node@begin@hook{\tikz@lib@chain@caller}%
\tikzset{
on chain/.default=,
on chain/.code=\tikz@lib@on@chain{#1}%
-}
-\def\tikz@lib@on@chain#1{%
+}%
+\def\tikz@lib@on@chain#1{%
\tikz@lib@chain@parse{#1}%
\ifx\tikz@lib@chain@name\pgfutil@empty%
\let\tikz@lib@chain@name\tikz@lib@current@chain%
@@ -137,7 +137,7 @@
\fi%
\edef\tikz@lib@chain@caller{\noexpand\tikz@lib@chain@last@found{\tikz@lib@chain@name}}%
\fi%
-}
+}%
\def\tikz@lib@chain@last@found#1{%
% Increase the count and set name, if necessary.
\c@pgf@counta\csname tikz@lib@chain@count@#1\endcsname\relax%
@@ -146,12 +146,12 @@
\expandafter\xdef\csname tikz@lib@chain@count@#1\endcsname{\the\c@pgf@counta}%
\ifnum\c@pgf@counta=1\relax%
\tikzset{alias/.expanded=#1-begin} % Define pseudostart
- \fi%
+ \fi%
\tikzset{alias/.expanded=#1-end} % Define pseudostart
\tikzset{alias/.expanded=#1-\the\c@pgf@counta} % Define pseudostart
\tikz@lib@chain@direction%
\tikzset{every on chain/.try}%
-}
+}%
\def\tikz@lib@chain@place#1{%
@@ -161,11 +161,11 @@
\else%
\tikzset{#1=of \tikzchainprevious}%
\fi%
-}
+}%
\def\tikz@lib@chain@strip#1 \pgf@stop{%
\def\tikz@lib@chain@name{#1}%
-}
+}%
\def\tikz@lib@parse@join#1{%
\def\tikz@temp{#1}%
@@ -184,18 +184,18 @@
\tikz@lib@parse@join@by#1\pgf@stop%
\fi%
\fi%
-}
+}%
\def\tikz@lib@parse@join@with@by with #1 by #2\pgf@stop{%
\tikzset{after node path={(#1)edge[every join,#2](\tikzchaincurrent)}}%
-}
+}%
\def\tikz@lib@parse@join@by by #1\pgf@stop{%
\tikzset{after node path={\ifx\tikzchainprevious\pgfutil@empty\else (\tikzchainprevious)edge[every join,#1](\tikzchaincurrent)\fi}}%
-}
-\tikzset{every join/.style=}
+}%
+\tikzset{every join/.style=}%
-\def\tikz@lib@chainin#1(#2){\pgfutil@ifnextchar[{\tikz@lib@chainin@{#2}}{\tikz@lib@chainin@{#2}[]}}%]
-\def\tikz@lib@chainin@#1[#2]{\path[late options={name=#1,on chain,every chain in/.try,#2}]}
+\def\tikz@lib@chainin#1(#2){\pgfutil@ifnextchar[{\tikz@lib@chainin@{#2}}{\tikz@lib@chainin@{#2}[]}}%]%
+\def\tikz@lib@chainin@#1[#2]{\path[late options={name=#1,on chain,every chain in/.try,#2}]}%
%
@@ -208,7 +208,7 @@
\pgfkeysalso{/tikz/start chain/.expand once=\tikz@lib@current@chain/#1}%
\path[late options={name=\tikz@lib@save@current-end,on chain}];%
}%
-}
-\tikzset{continue branch/.style={continue chain/.expand once=\tikz@lib@current@chain/#1}}
+}%
+\tikzset{continue branch/.style={continue chain/.expand once=\tikz@lib@current@chain/#1}}%
\endinput
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 b27783b0009..4e61360ee3b 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
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgfmodule{decorations}
+\usepgfmodule{decorations}%
% Define the basic decoration stuff for tikz. Load more libraries to
% "actually use" decorations
@@ -26,9 +26,9 @@
\else%
\let\tikz@dec@mirror=\relax%
\fi%
- \tikz@dec@trans%
+ \tikz@dec@trans%
},
- /pgf/decoration/mirror/.default=true,
+ /pgf/decoration/mirror/.default=true,
/pgf/decoration/transform/.code={%
{%
\pgftransformreset%
@@ -43,37 +43,37 @@
/pgf/decoration/post/.initial=lineto,
/pgf/decoration/pre length/.initial=0pt,
/pgf/decoration/post length/.initial=0pt,
-}
+}%
\let\tikz@decoration@name=\tikz@nonetext
-\def\tikz@dec@trans{\pgfsetdecorationsegmenttransformation{\tikz@dec@user@transform\tikz@dec@mirror\tikz@dec@shift}}
+\def\tikz@dec@trans{\pgfsetdecorationsegmenttransformation{\tikz@dec@user@transform\tikz@dec@mirror\tikz@dec@shift}}%
\let\tikz@dec@user@transform=\relax
\let\tikz@dec@shift=\relax
\let\tikz@dec@mirror=\relax
-\pgfdeclaremetadecoration{tikz@internal}{pre}{
+\pgfdeclaremetadecoration{tikz@internal}{pre}{%
\state{pre}[width=\pgfkeysvalueof{/pgf/decoration/pre length}, next state=main]
{
\tikz@dec@trans
\decoration{\pgfkeysvalueof{/pgf/decoration/pre}}
- }
+ }%
\state{main}[width=\pgfmetadecoratedremainingdistance-\pgfkeysvalueof{/pgf/decoration/post length}, next state=final]
{
\tikz@dec@trans
\decoration{\tikz@decoration@name}
- }
+ }%
\state{final}
{
\tikz@dec@trans
\decoration{\pgfkeysvalueof{/pgf/decoration/post}}
- }
-}
+ }%
+}%
\newif\iftikz@metadecoration
-\def\tikz@lib@dec@addtomacro#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
+\def\tikz@lib@dec@addtomacro#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}%
\def\tikz@lib@decoration[#1]{%
\begingroup%
@@ -99,7 +99,7 @@
\tikzerror{A decoration must begin with a brace}%
\tikz@enddecoration%
}%
-}
+}%
\def\tikz@lib@do@dec{%
% Ok, now what?
\pgfifmetadecoration{\tikz@decoration@name}%
@@ -113,7 +113,7 @@
\ifx\pgfdecorateexistingpath\pgfutil@empty%
\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%
@@ -129,7 +129,7 @@
\fi
\endgroup%
\setbox\tikz@tempbox=\box\tikz@lib@dec@box%
-}
+}%
\def\tikz@lib@dec@decorate@path{%
@@ -138,7 +138,7 @@
\pgfgetpath\tikz@lib@dec@currentpath%
\pgfsetpath\pgfutil@empty%
\pgfifmetadecoration{\tikz@decoration@name}
- {
+ {
\expandafter\pgfmetadecoration\expandafter{\tikz@decoration@name}%
\pgfsetpath\tikz@lib@dec@currentpath%
\endpgfmetadecoration%
@@ -156,9 +156,9 @@
}
}
\fi%
-}
+}%
-\def\tikz@lib@dec@zpttext{0pt}
+\def\tikz@lib@dec@zpttext{0pt}%
\newif\iftikz@lib@dec@temp
\def\tikz@lib@dec@startdecoration{%
@@ -178,7 +178,7 @@
\else%
\expandafter\pgfdecoration\expandafter{\expandafter{\tikz@decoration@name}{\pgfdecoratedpathlength}{}{}}%
\fi%
-}
+}%
\def\tikz@lib@dec@stopdecoration{%
\iftikz@lib@dec@temp%
@@ -186,7 +186,7 @@
\else%
\endpgfdecoration%
\fi%
-}
+}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.footprints.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.footprints.code.tex
index e4295c10ea7..fe42e8b09be 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.footprints.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.footprints.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usetikzlibrary{decorations}
-\usepgflibrary{decorations.footprints}
+\usetikzlibrary{decorations}%
+\usepgflibrary{decorations.footprints}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.fractals.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.fractals.code.tex
index dd247ac7e3f..9bd837911bc 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.fractals.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.fractals.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usetikzlibrary{decorations}
-\usepgflibrary{decorations.fractals}
+\usetikzlibrary{decorations}%
+\usepgflibrary{decorations.fractals}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.markings.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.markings.code.tex
index eecdfb6ad3f..23dcf61da73 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.markings.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.markings.code.tex
@@ -7,25 +7,25 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usetikzlibrary{decorations}
-\usepgflibrary{decorations.markings}
+\usetikzlibrary{decorations}%
+\usepgflibrary{decorations.markings}%
% Upgrade \arrow command
\def\pgf@lib@dec@doarrowhead{%
\pgfutil@ifnextchar[{\tikz@lib@dec@doarrowhead}{\tikz@lib@dec@doarrowhead[]}%]
-}
+}%
\def\tikz@lib@dec@doarrowhead[#1]#2{%
\scope[#1]
\pgf@lib@dec@arrowhead{1}{#2}%
\endscope
-}
+}%
\def\pgf@lib@dec@doarrowheadrev{%
\pgfutil@ifnextchar[{\tikz@lib@dec@doarrowheadrev}{\tikz@lib@dec@doarrowheadrev[]}%]
-}
+}%
\def\tikz@lib@dec@doarrowheadrev[#1]#2{%
\scope[#1]
\pgf@lib@dec@arrowhead{-1}{#2}%
\endscope
-}
+}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathmorphing.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathmorphing.code.tex
index 388f6395f8b..4d0eb26dd7a 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathmorphing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.pathmorphing.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usetikzlibrary{decorations}
-\usepgflibrary{decorations.pathmorphing}
+\usetikzlibrary{decorations}%
+\usepgflibrary{decorations.pathmorphing}%
\endinput
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 ec4c6001f55..cef15dcc5ec 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
@@ -7,30 +7,30 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usetikzlibrary{decorations}
-\usepgflibrary{decorations.pathreplacing}
+\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}%
-}
+ \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}
-}
+ /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/tikzlibrarydecorations.shapes.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.shapes.code.tex
index d9306058442..e1ad8a5e12b 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.shapes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.shapes.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usetikzlibrary{decorations}
-\usepgflibrary{decorations.shapes}
+\usetikzlibrary{decorations}%
+\usepgflibrary{decorations.shapes}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.text.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.text.code.tex
index b75fcc6a562..50b9ebcba67 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.text.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecorations.text.code.tex
@@ -7,67 +7,67 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usetikzlibrary{decorations}
-\usepgflibrary{decorations.text}
+\usetikzlibrary{decorations}%
+\usepgflibrary{decorations.text}%
% Code for the `text effects along path' decoration
% Some text constants
% To do: merge these with existing text constants
-\def\tikz@lib@dec@te@space@text{space}
-\def\tikz@lib@dec@align@left@text{left}
-\def\tikz@lib@dec@align@right@text{right}
-\def\tikz@lib@dec@align@center@text{center}
-\def\tikz@lib@dec@te@none@text{none}
+\def\tikz@lib@dec@te@space@text{space}%
+\def\tikz@lib@dec@align@left@text{left}%
+\def\tikz@lib@dec@align@right@text{right}%
+\def\tikz@lib@dec@align@center@text{center}%
+\def\tikz@lib@dec@te@none@text{none}%
% Some ifs
-\newif\iftikz@lib@dec@te@pathfromtext
-\newif\iftikz@lib@dec@te@segmentfromwidth
-\newif\iftikz@lib@dec@te@scaletexttopath
-\newif\iftikz@lib@dec@te@fittexttopath
-\newif\iftikz@lib@dec@te@wordsep
-\newif\iftikz@lib@dec@te@finalletter
+\newif\iftikz@lib@dec@te@pathfromtext%
+\newif\iftikz@lib@dec@te@segmentfromwidth%
+\newif\iftikz@lib@dec@te@scaletexttopath%
+\newif\iftikz@lib@dec@te@fittexttopath%
+\newif\iftikz@lib@dec@te@wordsep%
+\newif\iftikz@lib@dec@te@finalletter%
% Utility macros
-% To do: integrate with exisiting pgf macros
+% To do: integrate with existing pgf macros
\def\tikz@lib@dec@te@addto@macro#1#2{%
\expandafter\def\expandafter#1\expandafter{#1#2}%
-}
+}%
\def\tikz@lib@dec@te@namelet#1#2{%
\expandafter\expandafter\expandafter\let\expandafter\expandafter\csname\expandafter#1\expandafter\endcsname\expandafter=\csname#2\endcsname%
-}
+}%
\def\tikz@lib@dec@te@advancecountmacro#1#2{%
\pgfutil@tempcnta=#1\relax%
\advance\pgfutil@tempcnta by#2\relax%
\edef#1{\the\pgfutil@tempcnta}%
-}
+}%
\def\tikz@lib@dec@te@advancedimenmacro#1#2{%
\pgf@x=#1\relax%
\advance\pgf@x by#2\relax%
\edef#1{\the\pgf@x}%
-}
+}%
% Macros for defining and updating text parameters
\def\tikz@lib@dec@te@start@parameters#1{%
\expandafter\let\csname tikz@lib@dec@te@character@#1\endcsname=\pgfutil@empty%
-}
+}%
\def\tikz@lib@dec@te@addto@parameters#1#2{%
\expandafter\tikz@lib@dec@te@addto@macro\expandafter%
{\csname tikz@lib@dec@te@character@#1\endcsname}{#2}%
-}
+}%
\def\tikz@lib@dec@te@addmacroto@parameters#1#2{%
\def\tikz@lib@dec@te@marshal{\expandafter\tikz@lib@dec@te@addto@macro\expandafter%
{\csname tikz@lib@dec@te@character@#1\endcsname}}%
\expandafter\tikz@lib@dec@te@marshal\expandafter{\expandafter\def\expandafter#2\expandafter{#2}}%
-}
+}%
-\def\tikz@lib@dec@te@getparameters#1{\csname tikz@lib@dec@te@character@#1\endcsname}
+\def\tikz@lib@dec@te@getparameters#1{\csname tikz@lib@dec@te@character@#1\endcsname}%
@@ -124,12 +124,12 @@
\fi},
word separator=space,
character command/.code={%
- \def\tikz@lib@dec@te@tmp{#1}%
- \ifx\tikz@lib@dec@te@tmp\pgfutil@empty%
- \def\tikz@lib@dec@te@charactercommand{\tikz@lib@dec@te@charactertypesetonly}%
- \else%
- \def\tikz@lib@dec@te@charactercommand{#1}%
- \fi%
+ \def\tikz@lib@dec@te@tmp{#1}%
+ \ifx\tikz@lib@dec@te@tmp\pgfutil@empty%
+ \def\tikz@lib@dec@te@charactercommand{\tikz@lib@dec@te@charactertypesetonly}%
+ \else%
+ \def\tikz@lib@dec@te@charactercommand{#1}%
+ \fi%
},
character command=,
every character width/.style={/pgf/decoration/text effects/every character/.try},
@@ -146,14 +146,14 @@
repeat text/.store in=\tikz@lib@dec@te@repeattext,
repeat text/.default=-1,
repeat text=0,
-}
+}%
-\def\tikz@lib@dec@te@charactertypesetonly#1{#1}
+\def\tikz@lib@dec@te@charactertypesetonly#1{#1}%
\tikzset{%
text effects/.code={\pgfkeysalso{/pgf/decoration/text effects/.cd,#1}},
-}
+}%
@@ -163,7 +163,7 @@
% Prepare the decoration text
%
% This sets up all the character/letter/word, counts/totals
-% and caluclates the default width of the characters/text
+% and calculates the default width of the characters/text
% (which may be modified later).
%
\def\tikz@lib@dec@te@preparetext{%
@@ -201,13 +201,13 @@
\tikz@lib@dec@te@addto@parameters{\tikz@lib@dec@te@lastcharactercount}{\tikz@lib@dec@te@finallettertrue}%
\fi
\def\tikz@lib@dec@te@lettercount{0}%
- \tikz@lib@dec@te@addto@parameters{\tikz@lib@dec@te@charactercount}{\tikz@lib@dec@te@wordseptrue}%
+ \tikz@lib@dec@te@addto@parameters{\tikz@lib@dec@te@charactercount}{\tikz@lib@dec@te@wordseptrue}%
\else
\ifnum\tikz@lib@dec@te@lettercount=0\relax%
\tikz@lib@dec@te@advancecountmacro\tikz@lib@dec@te@wordcount{1}%
\fi%
\tikz@lib@dec@te@addto@parameters{\tikz@lib@dec@te@charactercount}{\tikz@lib@dec@te@finalletterfalse}%
- \tikz@lib@dec@te@advancecountmacro{\tikz@lib@dec@te@lettercount}{1}%
+ \tikz@lib@dec@te@advancecountmacro{\tikz@lib@dec@te@lettercount}{1}%
\tikz@lib@dec@te@addto@parameters{\tikz@lib@dec@te@charactercount}{\tikz@lib@dec@te@wordsepfalse}%
\expandafter\let\csname tikz@lib@dec@te@word \tikz@lib@dec@te@wordcount @lettercount\endcsname=\tikz@lib@dec@te@lettercount%
\fi%
@@ -241,10 +241,10 @@
\expandafter\edef\csname tikz@lib@dec@te@character@\pgfmathcounter @postwidth\endcsname{\the\pgf@x}%
\tikz@lib@dec@te@advancedimenmacro{\tikz@lib@dec@te@textwidth}{\tikz@lib@dec@te@characterwidth}%
\repeatpgfmathloop%
-}
+}%
% Does the category code of the space matter?
-\def\tikz@lib@dec@te@spacetoken{ }
+\def\tikz@lib@dec@te@spacetoken{ }%
\let\tikz@lib@dec@te@wordsep=\tikz@lib@dec@te@spacetoken
@@ -254,7 +254,7 @@
% Create macros \tikz@lib@dec@te@character@<n>@token containing
% the nth character.
%
-% Total number of characters is store in
+% Total number of characters is store in
% \tikz@lib@dec@te@chractertotal@count
%
\def\tikz@lib@dec@te@scancharacters#1{%
@@ -263,7 +263,7 @@
\expandafter\tikz@lib@dec@te@@scancharacters\tikz@lib@dec@te@text\tikz@lib@dec@te@scancharacters}%
\def\tikz@lib@dec@te@@scancharacters{%
- \futurelet\tikz@lib@dec@te@token\tikz@lib@dec@te@@@scancharacters}
+ \futurelet\tikz@lib@dec@te@token\tikz@lib@dec@te@@@scancharacters}%
\def\tikz@lib@dec@te@@@scancharacters{%
\ifx\tikz@lib@dec@te@token\tikz@lib@dec@te@scancharacters%
@@ -281,31 +281,31 @@
\fi%
\fi%
\tikz@lib@dec@te@next%
-}
+}%
\def\tikz@lib@dec@te@@@scancharacters@space{%
\let\tikz@lib@dec@te@character=\tikz@lib@dec@te@spacetoken%
\tikz@lib@dec@te@@@scancharacters@process%
\pgfutil@ifnextchar x\tikz@lib@dec@te@@scancharacters\tikz@lib@dec@te@@scancharacters%
-}
+}%
\def\tikz@lib@dec@te@@@scancharacters@bgroup#1{%
\def\tikz@lib@dec@te@character{{#1}}%
\tikz@lib@dec@te@@@scancharacters@process%
\tikz@lib@dec@te@@scancharacters%
-}
+}%
\def\tikz@lib@dec@te@@@scancharacters@normal#1{%
\def\tikz@lib@dec@te@character{#1}%
\tikz@lib@dec@te@@@scancharacters@process%
\tikz@lib@dec@te@@scancharacters%
-}
+}%
-\def\tikz@lib@dec@te@@@@scancharacters#1\tikz@lib@dec@te@scancharacters{}
+\def\tikz@lib@dec@te@@@@scancharacters#1\tikz@lib@dec@te@scancharacters{}%
-% Reverse the order of the scanned chracters in the text
+% Reverse the order of the scanned characters in the text
% (Actually reverse the ordering of the macros containing the characters)
\def\tikz@lib@dec@te@reversetext{%
\c@pgf@counta=\tikz@lib@dec@te@charactertotalcount%
@@ -317,7 +317,7 @@
\tikz@lib@dec@te@namelet{tikz@lib@dec@te@character@\the\c@pgf@counta @token}{tikz@lib@dec@te@tmp}%
\advance\c@pgf@counta by-1\relax%
\repeatpgfmathloop%
-}
+}%
% Group letters (i.e., anything that isn't the word separator)
% as single characters (words).
@@ -345,7 +345,7 @@
\fi%
\repeatpgfmathloop%
\edef\tikz@lib@dec@te@charactertotalcount{\the\c@pgf@counta}%
-}
+}%
% Get width of node containing only the current character.
@@ -362,7 +362,7 @@
\tikz@lib@dec@te@getcharacter@replacementwidth{\tikz@lib@dec@te@character}%
\let\tikz@lib@dec@te@characterwidth=\tikz@lib@dec@te@character@replacementwidth%
}%
-}
+}%
% Update the character parameters with the widths.
\def\tikz@lib@dec@te@addwidthstoparameters{%
@@ -376,13 +376,13 @@
\tikz@lib@dec@te@addmacroto@parameters{\pgfmathcounter}{\tikz@lib@dec@te@characterprewidth}%
\tikz@lib@dec@te@addmacroto@parameters{\pgfmathcounter}{\tikz@lib@dec@te@characterpostwidth}%
\repeatpgfmathloop%
-}
+}%
% Get the options to applied to a character node.
\def\tikz@lib@dec@te@addoptions#1{%
\expandafter\def\expandafter\tikz@lib@dec@te@options\expandafter{\tikz@lib@dec@te@options,#1}%
-}
+}%
\def\tikz@lib@dec@te@getoptions#1{%
\let\tikz@lib@dec@te@lastcharactercommand=\tikz@lib@dec@te@charactercommand%
@@ -433,23 +433,23 @@
\ifx\tikz@lib@dec@te@character\tikz@lib@dec@te@wordsep%
\tikz@lib@dec@te@addoptions{/pgf/decoration/text effects/every word separator/.try}%
\else%
- \ifnum\tikz@lib@dec@te@wordcount>0\relax%
- \edef\tikz@lib@dec@te@tmp{every word/.try, word \tikz@lib@dec@te@wordcount/.try}%
- \expandafter\tikz@lib@dec@te@addoptions\expandafter{\tikz@lib@dec@te@tmp}%
- \ifnum\tikz@lib@dec@te@lettercount>0\relax%
- \edef\tikz@lib@dec@te@tmp{every letter/.try,every \tikz@lib@dec@te@lettercount\space letter/.try}%
- \expandafter\tikz@lib@dec@te@addoptions\expandafter{\tikz@lib@dec@te@tmp}%
- \ifnum\tikz@lib@dec@te@lettercount=1\relax%
- \edef\tikz@lib@dec@te@tmp{every first letter/.try}%
- \expandafter\tikz@lib@dec@te@addoptions\expandafter{\tikz@lib@dec@te@tmp}%
- \fi%
- \iftikz@lib@dec@te@finalletter%
- \tikz@lib@dec@te@addoptions{every final letter/.try}%
- \fi%
- \fi%
- \fi%
+ \ifnum\tikz@lib@dec@te@wordcount>0\relax%
+ \edef\tikz@lib@dec@te@tmp{every word/.try, word \tikz@lib@dec@te@wordcount/.try}%
+ \expandafter\tikz@lib@dec@te@addoptions\expandafter{\tikz@lib@dec@te@tmp}%
+ \ifnum\tikz@lib@dec@te@lettercount>0\relax%
+ \edef\tikz@lib@dec@te@tmp{every letter/.try,every \tikz@lib@dec@te@lettercount\space letter/.try}%
+ \expandafter\tikz@lib@dec@te@addoptions\expandafter{\tikz@lib@dec@te@tmp}%
+ \ifnum\tikz@lib@dec@te@lettercount=1\relax%
+ \edef\tikz@lib@dec@te@tmp{every first letter/.try}%
+ \expandafter\tikz@lib@dec@te@addoptions\expandafter{\tikz@lib@dec@te@tmp}%
+ \fi%
+ \iftikz@lib@dec@te@finalletter%
+ \tikz@lib@dec@te@addoptions{every final letter/.try}%
+ \fi%
+ \fi%
+ \fi%
\fi%
-}
+}%
% Called by `late positioning' of the node
% to get the width of the bounding box
@@ -463,7 +463,7 @@
\advance\pgf@x by-\pgfpositionnodelaterminy\relax%
\fi%
\xdef\tikz@lib@dec@te@characterwidth@tmp{\the\pgf@x}%
-}
+}%
\def\tikz@lib@dec@te@drawcharacter{%
@@ -473,7 +473,7 @@
\pgfutil@ifundefined{tikz@lib@dec@te@character@replacements@\meaning\tikz@lib@dec@te@character @code}{%
\expandafter\node\expandafter[\tikz@lib@dec@te@options, scale=\tikz@lib@dec@scaledcharacterwidthfactor]{\hbox{\tikz@lib@dec@te@charactercommand{\tikz@lib@dec@te@character}}};%
}{\tikz@lib@dec@te@drawcharacter@replacement{\tikz@lib@dec@te@character}}%
-}
+}%
% Replace the character #1 with a character@replacement
%
@@ -482,7 +482,7 @@
\expandafter\tikzset\expandafter{\tikz@lib@dec@te@options}%
\csname tikz@lib@dec@te@character@replacements@\meaning#1@code\endcsname%
\endpgfscope%
-}
+}%
% Get the width of the character@replacement associated with
% the character #1
@@ -497,7 +497,7 @@
\endpgfpicture}%
\xdef\tikz@lib@dec@te@character@replacementwidth{\the\wd\tikz@lib@dec@te@box}%
\endpgfinterruptpicture%
-}
+}%
\def\tikz@lib@dec@scaledcharacterwidthfactor{1}%
@@ -508,26 +508,26 @@
% The width of the text and characters has already been calculated.
\else%
\let\tikz@lib@dec@te@text=\pgfdecorationtext%
- % Get the chracter tokens and the total number of characters.
+ % Get the character tokens and the total number of characters.
\tikz@lib@dec@te@preparetext%
\iftikz@lib@dec@te@scaletexttopath%
% OK, *scaling* text to path is easy.
% Simply divide the path length by the text width to
- % obtain the scaling factor which will be applied
+ % obtain the scaling factor which will be applied
% "at the last minute"...
\pgfmathdivide{\pgfdecoratedpathlength}{\tikz@lib@dec@te@textwidth}%
\let\tikz@lib@dec@scaledcharacterwidthfactor=\pgfmathresult%
\expandafter\pgfkeys\expandafter{\tikz@lib@dec@te@tmp}%
- % ... and recalulate the (pre and post) widths.
+ % ... and recalculate the (pre and post) widths.
\pgfmathloop
\ifnum\pgfmathcounter>\tikz@lib@dec@te@charactertotalcount%
\else%
\pgf@x=\csname tikz@lib@dec@te@character@\pgfmathcounter @prewidth\endcsname\relax%
- \pgf@x=\tikz@lib@dec@scaledcharacterwidthfactor\pgf@x%
+ \pgf@x=\tikz@lib@dec@scaledcharacterwidthfactor\pgf@x%
\expandafter\edef\csname tikz@lib@dec@te@character@\pgfmathcounter @prewidth\endcsname{\the\pgf@x}%
%
\pgf@x=\csname tikz@lib@dec@te@character@\pgfmathcounter @postwidth\endcsname\relax%
- \pgf@x=\tikz@lib@dec@scaledcharacterwidthfactor\pgf@x%
+ \pgf@x=\tikz@lib@dec@scaledcharacterwidthfactor\pgf@x%
\expandafter\edef\csname tikz@lib@dec@te@character@\pgfmathcounter @postwidth\endcsname{\the\pgf@x}%
\repeatpgfmathloop%
% Update parameters with thewidths.
@@ -536,7 +536,7 @@
\else%
\iftikz@lib@dec@te@fittexttopath%
% *Fitting* text is less easy.
- % The pre and post width of all except the first and last characters
+ % The pre and post width of all except the first and last characters
% must be recalculated.
% Only the post width of the first character and the pre width
% of the final character are scaled as these characters should be
@@ -554,18 +554,18 @@
\advance\pgf@y by-\pgf@xb%
%
\pgfmathdivide{\the\pgf@x}{\the\pgf@y}%
- \let\tikz@lib@dec@characterwidthscale=\pgfmathresult%
+ \let\tikz@lib@dec@characterwidthscale=\pgfmathresult%
\pgfmathloop
\ifnum\pgfmathcounter>\tikz@lib@dec@te@charactertotalcount\relax%
\else%
\ifnum\pgfmathcounter>1\relax%
\pgf@x=\csname tikz@lib@dec@te@character@\pgfmathcounter @prewidth\endcsname\relax%
- \pgf@x=\tikz@lib@dec@characterwidthscale\pgf@x%
+ \pgf@x=\tikz@lib@dec@characterwidthscale\pgf@x%
\expandafter\edef\csname tikz@lib@dec@te@character@\pgfmathcounter @prewidth\endcsname{\the\pgf@x}%
\fi%
\ifnum\pgfmathcounter<\tikz@lib@dec@te@charactertotalcount\relax%
\pgf@x=\csname tikz@lib@dec@te@character@\pgfmathcounter @postwidth\endcsname\relax%
- \pgf@x=\tikz@lib@dec@characterwidthscale\pgf@x%
+ \pgf@x=\tikz@lib@dec@characterwidthscale\pgf@x%
\expandafter\edef\csname tikz@lib@dec@te@character@\pgfmathcounter @postwidth\endcsname{\the\pgf@x}%
\fi%
\repeatpgfmathloop%
@@ -607,17 +607,17 @@
\fi%
\fi%
\fi%
-}
+}%
% Evil hack into the decoration code.
%
% If the path contains single move to and the `path from text'
-% key is set to true. The width of the text is calcuated here
+% key is set to true. The width of the text is calculated here
% and the (straight line) path automatically calculated.
%
\def\pgf@decorate@path@check@moveto#1{%
- \expandafter\pgf@decorate@path@@check@moveto#1\pgf@decorate@stop\pgf@decorate@@stop}
+ \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{%
@@ -644,19 +644,19 @@
\tikz@lib@dec@te@pathfromtextfalse%
#6%
\fi%
-}
+}%
-\pgfdeclaredecoration{text effects along path}{setup}{
+\pgfdeclaredecoration{text effects along path}{setup}{%
\state{setup}[width=+0pt, next state=scan, persistent precomputation={%
\tikz@lib@dec@te@state@setup@precomputation%
- \def\tikz@lib@dec@te@charactercount{0}%
- }]{}
+ \def\tikz@lib@dec@te@charactercount{0}%
+ }]{}%
%
\state{scan}[width=+0pt, next state=pre token, persistent precomputation={%
\tikz@lib@dec@te@advancecountmacro\tikz@lib@dec@te@charactercount{1}%
% Usual switch to final state is based on distance.
- % Here we also need it to be on the number of the
+ % Here we also need it to be on the number of the
% current character.
\ifnum\tikz@lib@dec@te@charactercount>\tikz@lib@dec@te@charactertotalcount\relax%
\ifnum\tikz@lib@dec@te@repeattext=0\relax%
@@ -668,15 +668,15 @@
\fi%
% Install parameters for this character.
\csname tikz@lib@dec@te@character@\tikz@lib@dec@te@charactercount\endcsname%
-}]{}
+}]{}%
%
-\state{pre token}[width=+\tikz@lib@dec@te@characterprewidth, next state=token]{}
+\state{pre token}[width=+\tikz@lib@dec@te@characterprewidth, next state=token]{}%
\state{token}[width=+0pt, next state=post token]
{%
\tikz@lib@dec@te@drawcharacter%
-}
-\state{post token}[width=+\tikz@lib@dec@te@characterpostwidth, next state=scan]{}
-}
+}%
+\state{post token}[width=+\tikz@lib@dec@te@characterpostwidth, next state=scan]{}%
+}%
% Parse styles for individual characters
@@ -688,9 +688,9 @@
\tikz@lib@dec@te@scancharacters{%
\pgfkeysalso{/pgf/decoration/text effects/character {\meaning\tikz@lib@dec@te@character}/.style={#2}}%
}%
-}
+}%
-% Parse replacment code for for individual characters
+% Parse replacement code for for individual characters
% #1 a string of characters (e.g., aieou{\"U}{\"a"})
% #2 the code to execute to each character.
%
@@ -699,6 +699,6 @@
\tikz@lib@dec@te@scancharacters{%
\expandafter\def\csname tikz@lib@dec@te@character@replacements@\meaning\tikz@lib@dec@te@character @code\endcsname{#2}%
}%
-}
+}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryer.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryer.code.tex
index fcacb5d4399..a2a80a5f49f 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryer.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryer.code.tex
@@ -7,32 +7,32 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryer.code.tex,v 1.2 2008/02/20 11:00:42 tantau Exp $
+\ProvidesFileRCS{tikzlibraryer.code.tex}
-\usetikzlibrary{shapes.geometric}
+\usetikzlibrary{shapes.geometric}%
% Styles for entity types:
-\tikzstyle{every entity}= []
-\tikzstyle{entity}= [rectangle,draw,
+\tikzset{every entity/.style= {}}%
+\tikzset{entity/.style= {rectangle,draw,
minimum height=2\baselineskip,
- minimum width=4\baselineskip,every entity]
+ minimum width=4\baselineskip,every entity}}%
% Styles for relationship types:
-\tikzstyle{every relationship}= []
-\tikzstyle{relationship}= [diamond,draw,
+\tikzset{every relationship/.style= {}}%
+\tikzset{relationship/.style= {diamond,draw,
minimum size=1.5\baselineskip,
inner sep=1pt,
- every relationship]
+ every relationship}}%
% Styles for relationship types:
-\tikzstyle{every attribute}= []
-\tikzstyle{attribute}= [minimum size=1.5\baselineskip,ellipse,draw,every attribute]
-\tikzstyle{key attribute}= [font=\itshape,attribute]
+\tikzset{every attribute/.style= {}}%
+\tikzset{attribute/.style= {minimum size=1.5\baselineskip,ellipse,draw,every attribute}}%
+\tikzset{key attribute/.style= {font=\itshape,attribute}}%
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 589c3356f65..bec6487b98a 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,9 +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/tikzlibraryfadings.code.tex,v 1.2 2009/11/15 18:53:00 ludewich Exp $
+\ProvidesFileRCS{tikzlibraryfadings.code.tex}
-\usepgflibrary{fadings}
+\usepgflibrary{fadings}%
%
% Environments for creating fadings
@@ -19,18 +19,18 @@
\begingroup%
\setbox\pgfpic=\hbox\bgroup%
\tikzpicture%
-}
+}%
\def\endtikzfadingfrompicture{%
\global\let\tikz@smuggle=\tikz@fig@name%
\endtikzpicture
\egroup%
\pgfdeclarefading{\tikz@smuggle}{\box\pgfpic}%
\endgroup%
-}
+}%
% This makes it easier to maintain compatibility with the external lib:
-\def\starttikzfadingfrompicture{\tikzfadingfrompicture}
-\def\stopttikzfadingfrompicture{\endtikzfadingfrompicture}
+\def\starttikzfadingfrompicture{\tikzfadingfrompicture}%
+\def\stopttikzfadingfrompicture{\endtikzfadingfrompicture}%
\def\tikzfading[#1]{%
{%
@@ -43,6 +43,6 @@
{\pgfuseshading{\tikz@shading}};
}%
}%
- \pgfdeclarefading{\tikz@smuggle}{\box\pgfpic}%
+ \pgfdeclarefading{\tikz@smuggle}{\box\pgfpic}%
}%
-}
+}%
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 ef6a88dc1a9..4f3dc6be3de 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,13 +7,13 @@
%
% 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.5 2013/07/12 17:33:49 tantau Exp $
+\ProvidesFileRCS{tikzlibraryfit.code.tex}
\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@rotate{0}%
\def\tikz@lib@fit#1{%
\pgf@xb=-16000pt\relax%
@@ -25,7 +25,7 @@
%
% Now iterate over the coordinates
\tikz@lib@fit@scan#1\pgf@stop%
- % Now, let's see what has happend
+ % Now, let's see what has happened
\ifdim\pgf@xa>\pgf@xa%
% Nothing... Ok, let's just ignore this.
\else%
@@ -39,7 +39,7 @@
\ifdim\tikz@lib@fit@rotate pt=0pt\relax%
{%
\pgftransforminvert%
- \pgf@pos@transform{\pgf@xa}{\pgf@ya}%
+ \pgf@pos@transform{\pgf@xa}{\pgf@ya}%
\global\pgf@xa\pgf@xa
\global\pgf@ya\pgf@ya
}
@@ -68,15 +68,16 @@
\pgf@x=\pgf@y%
\pgf@y=.5\pgf@y%
\pgfkeysalso{
+ /tikz/transform shape=false,
/tikz/text height/.expanded=\the\pgf@y-.5\dp\pgfnodeparttextbox,
/tikz/text depth/.expanded=\the\pgf@x-\noexpand\the\ht\pgfnodeparttextbox}%
\pgfkeysalso{every fit/.try}%
\fi%
-}
+}%
\def\tikz@lib@fit@scan{%
\pgfutil@ifnextchar\pgf@stop{\pgfutil@gobble}
- {\tikz@scan@one@point\tikz@lib@fit@scan@handle}}
+ {\tikz@scan@one@point\tikz@lib@fit@scan@handle}}%
\def\tikz@lib@fit@scan@handle#1{%
\iftikz@shapeborder%
@@ -89,7 +90,7 @@
\tikz@lib@fit@adjust{#1}%
\fi%
\tikz@lib@fit@scan%
-}
+}%
\def\tikz@lib@fit@adjust#1{%
\ifdim\tikz@lib@fit@rotate pt=0pt\relax%
@@ -108,7 +109,7 @@
\pgfsettransform\tikz@lib@fit@transform%
\pgf@pos@transform{\pgf@xc}{\pgf@yc}%
\global\pgf@x=\pgf@xc%
- \global\pgf@y=\pgf@yc%
+ \global\pgf@y=\pgf@yc%
}%
\fi%
\ifdim\pgf@x<\pgf@xa%
@@ -123,7 +124,7 @@
\ifdim\pgf@y>\pgf@yb%
\pgf@yb=\pgf@y%
\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
index 56d35c5008b..8560ecfb59b 100644
--- 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
@@ -7,4 +7,4 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgflibrary{fixedpointarithmetic}
+\usepgflibrary{fixedpointarithmetic}%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex
index 8cd08fc5cd0..143acd9e9e8 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex
@@ -8,17 +8,18 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfolding.code.tex,v 1.5 2015/08/03 08:39:35 cfeuersaenger Exp $
+\ProvidesFileRCS{tikzlibraryfolding.code.tex}
%
% Length of a standard line in a folding
-%
+%
-\tikzoption{folding line length}{\pgfmathsetlength\tikz@lib@fold@length{#1}}
+\tikzoption{folding line length}{\pgfmathsetlength\tikz@lib@fold@length{#1}}%
\newdimen\tikz@lib@fold@length
\tikz@lib@fold@length=2cm
+
% Faces
% -----
@@ -35,7 +36,7 @@
\scope[rotate=60]
#4
\endscope
-}
+}%
\def\tikz@lib@fold@square#1#2#3#4#5{%
\scope[xshift=.5\tikz@lib@fold@length,yshift=.5\tikz@lib@fold@length]
@@ -53,7 +54,7 @@
\scope[rotate=90]
#5
\endscope
-}
+}%
\def\tikz@lib@fold@pentagon#1#2#3#4#5#6{%
\scope[xshift=.5\tikz@lib@fold@length,yshift=0.68819\tikz@lib@fold@length]
@@ -74,7 +75,7 @@
\scope[shift={(108:\tikz@lib@fold@length)},rotate=36]
#6
\endscope
-}
+}%
\def\tikz@lib@fold@hexagon#1#2#3#4#5#6#7{%
\scope
@@ -113,7 +114,7 @@
rotate=60]
#7
\endscope
-}
+}%
\def\tikz@lib@fold@octagon#1#2#3#4#5#6#7#8#9{%
\scope[xshift=.5\tikz@lib@fold@length,yshift=1.20711\tikz@lib@fold@length]
@@ -143,7 +144,7 @@
\scope[xshift=-.70711\tikz@lib@fold@length,yshift=1.70711\tikz@lib@fold@length,rotate=45]
#9
\endscope
-}
+}%
\def\tikz@lib@fold@decagon#1#2#3#4#5#6#7{%
\scope[shift={(72:1.61803\tikz@lib@fold@length)}] %decagon inside a circle with radius the golden ratio has side length 1
@@ -192,7 +193,7 @@
#7
\endscope
\tikz@lib@fold@decagonbis
-}
+}%
\def\tikz@lib@fold@decagonbis#1#2#3#4{%
\scope
@@ -217,119 +218,119 @@
rotate=36]
#4
\endscope
-}
+}%
-\def\tikz@lib@fold@path{\draw[every fold](0,0) -- (\tikz@lib@fold@length,0pt);}
-\def\tikz@lib@fold@cut@path{\draw[every cut](0,0) -- (\tikz@lib@fold@length,0pt);}
+\def\tikz@lib@fold@path{\draw[every fold](0,0) -- (\tikz@lib@fold@length,0pt);}%
+\def\tikz@lib@fold@cut@path{\draw[every cut](0,0) -- (\tikz@lib@fold@length,0pt);}%
\def\tikz@lib@fold@ear@path{
\path[every ear] (0,0) -- (.5\tikz@lib@fold@length,.2\tikz@lib@fold@length) --(\tikz@lib@fold@length,0pt) --(0,0) -- cycle;
\draw[every fold](0,0) -- (\tikz@lib@fold@length,0pt);
- \draw[every cut] (0,0) -- (.5\tikz@lib@fold@length,.2\tikz@lib@fold@length) --(\tikz@lib@fold@length,0pt);}
+ \draw[every cut] (0,0) -- (.5\tikz@lib@fold@length,.2\tikz@lib@fold@length) --(\tikz@lib@fold@length,0pt);}%
\def\tikz@lib@fold@ear@custom@left@path#1{
\path[every ear] (0,0) -- (#1:.66\tikz@lib@fold@length) -- (\tikz@lib@fold@length,0pt) --(0,0) -- cycle;
\draw[every fold](0,0) -- (\tikz@lib@fold@length,0pt);
- \draw[every cut] (0,0) -- (#1:.66\tikz@lib@fold@length) -- (\tikz@lib@fold@length,0pt);}
+ \draw[every cut] (0,0) -- (#1:.66\tikz@lib@fold@length) -- (\tikz@lib@fold@length,0pt);}%
\def\tikz@lib@fold@ear@custom@right@path#1{
\path[every ear] (0,0) -- (\tikz@lib@fold@length,0pt) -- ++(-#1:-.66\tikz@lib@fold@length) --(0,0) -- cycle;
\draw[every fold](0,0) -- (\tikz@lib@fold@length,0pt);
- \draw[every cut] (\tikz@lib@fold@length,0pt) -- ++(-#1:-.66\tikz@lib@fold@length) -- (0,0);}
+ \draw[every cut] (\tikz@lib@fold@length,0pt) -- ++(-#1:-.66\tikz@lib@fold@length) -- (0,0);}%
-\tikzstyle{every ear}=[]
-\tikzstyle{every cut}=[]
-\tikzstyle{every fold}=[help lines]
+\tikzset{every ear/.style={}}%
+\tikzset{every cut/.style={}}%
+\tikzset{every fold/.style={help lines}}%
-\tikzoption{face 1}{\def\tikz@lib@fold@face@A{#1}}
-\tikzoption{face 2}{\def\tikz@lib@fold@face@B{#1}}
-\tikzoption{face 3}{\def\tikz@lib@fold@face@C{#1}}
-\tikzoption{face 4}{\def\tikz@lib@fold@face@D{#1}}
-\tikzoption{face 5}{\def\tikz@lib@fold@face@E{#1}}
-\tikzoption{face 6}{\def\tikz@lib@fold@face@F{#1}}
-\tikzoption{face 7}{\def\tikz@lib@fold@face@G{#1}}
-\tikzoption{face 8}{\def\tikz@lib@fold@face@H{#1}}
-\tikzoption{face 9}{\def\tikz@lib@fold@face@I{#1}}
-\tikzoption{face 10}{\def\tikz@lib@fold@face@J{#1}}
-\tikzoption{face 11}{\def\tikz@lib@fold@face@K{#1}}
-\tikzoption{face 12}{\def\tikz@lib@fold@face@L{#1}}
-\tikzoption{face 13}{\def\tikz@lib@fold@face@M{#1}}
-\tikzoption{face 14}{\def\tikz@lib@fold@face@N{#1}}
-\tikzoption{face 15}{\def\tikz@lib@fold@face@O{#1}}
-\tikzoption{face 16}{\def\tikz@lib@fold@face@P{#1}}
-\tikzoption{face 17}{\def\tikz@lib@fold@face@Q{#1}}
-\tikzoption{face 18}{\def\tikz@lib@fold@face@R{#1}}
-\tikzoption{face 19}{\def\tikz@lib@fold@face@S{#1}}
-\tikzoption{face 20}{\def\tikz@lib@fold@face@T{#1}}
-\tikzoption{face 21}{\def\tikz@lib@fold@face@U{#1}}
-\tikzoption{face 22}{\def\tikz@lib@fold@face@V{#1}}
-\tikzoption{face 23}{\def\tikz@lib@fold@face@W{#1}}
-\tikzoption{face 24}{\def\tikz@lib@fold@face@X{#1}}
-\tikzoption{face 25}{\def\tikz@lib@fold@face@Y{#1}}
-\tikzoption{face 26}{\def\tikz@lib@fold@face@Z{#1}}
-\tikzoption{face 27}{\def\tikz@lib@fold@face@AA{#1}}
-\tikzoption{face 28}{\def\tikz@lib@fold@face@AB{#1}}
-\tikzoption{face 29}{\def\tikz@lib@fold@face@AC{#1}}
-\tikzoption{face 30}{\def\tikz@lib@fold@face@AD{#1}}
-\tikzoption{face 31}{\def\tikz@lib@fold@face@AE{#1}}
-\tikzoption{face 32}{\def\tikz@lib@fold@face@AF{#1}}
-\tikzoption{face 33}{\def\tikz@lib@fold@face@AG{#1}}
-\tikzoption{face 34}{\def\tikz@lib@fold@face@AH{#1}}
-\tikzoption{face 35}{\def\tikz@lib@fold@face@AI{#1}}
-\tikzoption{face 36}{\def\tikz@lib@fold@face@AJ{#1}}
-\tikzoption{face 37}{\def\tikz@lib@fold@face@AK{#1}}
-\tikzoption{face 38}{\def\tikz@lib@fold@face@AL{#1}}
-\tikzoption{face 39}{\def\tikz@lib@fold@face@AM{#1}}
-\tikzoption{face 40}{\def\tikz@lib@fold@face@AN{#1}}
-\tikzoption{face 41}{\def\tikz@lib@fold@face@AO{#1}}
-\tikzoption{face 42}{\def\tikz@lib@fold@face@AP{#1}}
-\tikzoption{face 43}{\def\tikz@lib@fold@face@AQ{#1}}
-\tikzoption{face 44}{\def\tikz@lib@fold@face@AR{#1}}
-\tikzoption{face 45}{\def\tikz@lib@fold@face@AS{#1}}
-\tikzoption{face 46}{\def\tikz@lib@fold@face@AT{#1}}
-\tikzoption{face 47}{\def\tikz@lib@fold@face@AU{#1}}
-\tikzoption{face 48}{\def\tikz@lib@fold@face@AV{#1}}
-\tikzoption{face 49}{\def\tikz@lib@fold@face@AW{#1}}
-\tikzoption{face 50}{\def\tikz@lib@fold@face@AX{#1}}
-\tikzoption{face 51}{\def\tikz@lib@fold@face@AY{#1}}
-\tikzoption{face 52}{\def\tikz@lib@fold@face@AZ{#1}}
-\tikzoption{face 53}{\def\tikz@lib@fold@face@BA{#1}}
-\tikzoption{face 54}{\def\tikz@lib@fold@face@BB{#1}}
-\tikzoption{face 55}{\def\tikz@lib@fold@face@BC{#1}}
-\tikzoption{face 56}{\def\tikz@lib@fold@face@BD{#1}}
-\tikzoption{face 57}{\def\tikz@lib@fold@face@BE{#1}}
-\tikzoption{face 58}{\def\tikz@lib@fold@face@BF{#1}}
-\tikzoption{face 59}{\def\tikz@lib@fold@face@BG{#1}}
-\tikzoption{face 60}{\def\tikz@lib@fold@face@BH{#1}}
-\tikzoption{face 61}{\def\tikz@lib@fold@face@BI{#1}}
-\tikzoption{face 62}{\def\tikz@lib@fold@face@BJ{#1}}
-\tikzoption{face 63}{\def\tikz@lib@fold@face@BK{#1}}
-\tikzoption{face 64}{\def\tikz@lib@fold@face@BL{#1}}
-\tikzoption{face 65}{\def\tikz@lib@fold@face@BM{#1}}
-\tikzoption{face 66}{\def\tikz@lib@fold@face@BN{#1}}
-\tikzoption{face 67}{\def\tikz@lib@fold@face@BO{#1}}
-\tikzoption{face 68}{\def\tikz@lib@fold@face@BP{#1}}
-\tikzoption{face 69}{\def\tikz@lib@fold@face@BQ{#1}}
-\tikzoption{face 70}{\def\tikz@lib@fold@face@BR{#1}}
-\tikzoption{face 71}{\def\tikz@lib@fold@face@BS{#1}}
-\tikzoption{face 72}{\def\tikz@lib@fold@face@BT{#1}}
-\tikzoption{face 73}{\def\tikz@lib@fold@face@BU{#1}}
-\tikzoption{face 74}{\def\tikz@lib@fold@face@BV{#1}}
-\tikzoption{face 75}{\def\tikz@lib@fold@face@BW{#1}}
-\tikzoption{face 76}{\def\tikz@lib@fold@face@BX{#1}}
-\tikzoption{face 77}{\def\tikz@lib@fold@face@BY{#1}}
-\tikzoption{face 78}{\def\tikz@lib@fold@face@BZ{#1}}
-\tikzoption{face 79}{\def\tikz@lib@fold@face@CA{#1}}
-\tikzoption{face 80}{\def\tikz@lib@fold@face@CB{#1}}
-\tikzoption{face 81}{\def\tikz@lib@fold@face@CC{#1}}
-\tikzoption{face 82}{\def\tikz@lib@fold@face@CD{#1}}
-\tikzoption{face 83}{\def\tikz@lib@fold@face@CE{#1}}
-\tikzoption{face 84}{\def\tikz@lib@fold@face@CF{#1}}
-\tikzoption{face 85}{\def\tikz@lib@fold@face@CG{#1}}
-\tikzoption{face 86}{\def\tikz@lib@fold@face@CH{#1}}
-\tikzoption{face 87}{\def\tikz@lib@fold@face@CI{#1}}
-\tikzoption{face 88}{\def\tikz@lib@fold@face@CJ{#1}}
-\tikzoption{face 89}{\def\tikz@lib@fold@face@CK{#1}}
-\tikzoption{face 90}{\def\tikz@lib@fold@face@CL{#1}}
-\tikzoption{face 91}{\def\tikz@lib@fold@face@CM{#1}}
-\tikzoption{face 92}{\def\tikz@lib@fold@face@CN{#1}}
+\tikzoption{face 1}{\def\tikz@lib@fold@face@A{#1}}%
+\tikzoption{face 2}{\def\tikz@lib@fold@face@B{#1}}%
+\tikzoption{face 3}{\def\tikz@lib@fold@face@C{#1}}%
+\tikzoption{face 4}{\def\tikz@lib@fold@face@D{#1}}%
+\tikzoption{face 5}{\def\tikz@lib@fold@face@E{#1}}%
+\tikzoption{face 6}{\def\tikz@lib@fold@face@F{#1}}%
+\tikzoption{face 7}{\def\tikz@lib@fold@face@G{#1}}%
+\tikzoption{face 8}{\def\tikz@lib@fold@face@H{#1}}%
+\tikzoption{face 9}{\def\tikz@lib@fold@face@I{#1}}%
+\tikzoption{face 10}{\def\tikz@lib@fold@face@J{#1}}%
+\tikzoption{face 11}{\def\tikz@lib@fold@face@K{#1}}%
+\tikzoption{face 12}{\def\tikz@lib@fold@face@L{#1}}%
+\tikzoption{face 13}{\def\tikz@lib@fold@face@M{#1}}%
+\tikzoption{face 14}{\def\tikz@lib@fold@face@N{#1}}%
+\tikzoption{face 15}{\def\tikz@lib@fold@face@O{#1}}%
+\tikzoption{face 16}{\def\tikz@lib@fold@face@P{#1}}%
+\tikzoption{face 17}{\def\tikz@lib@fold@face@Q{#1}}%
+\tikzoption{face 18}{\def\tikz@lib@fold@face@R{#1}}%
+\tikzoption{face 19}{\def\tikz@lib@fold@face@S{#1}}%
+\tikzoption{face 20}{\def\tikz@lib@fold@face@T{#1}}%
+\tikzoption{face 21}{\def\tikz@lib@fold@face@U{#1}}%
+\tikzoption{face 22}{\def\tikz@lib@fold@face@V{#1}}%
+\tikzoption{face 23}{\def\tikz@lib@fold@face@W{#1}}%
+\tikzoption{face 24}{\def\tikz@lib@fold@face@X{#1}}%
+\tikzoption{face 25}{\def\tikz@lib@fold@face@Y{#1}}%
+\tikzoption{face 26}{\def\tikz@lib@fold@face@Z{#1}}%
+\tikzoption{face 27}{\def\tikz@lib@fold@face@AA{#1}}%
+\tikzoption{face 28}{\def\tikz@lib@fold@face@AB{#1}}%
+\tikzoption{face 29}{\def\tikz@lib@fold@face@AC{#1}}%
+\tikzoption{face 30}{\def\tikz@lib@fold@face@AD{#1}}%
+\tikzoption{face 31}{\def\tikz@lib@fold@face@AE{#1}}%
+\tikzoption{face 32}{\def\tikz@lib@fold@face@AF{#1}}%
+\tikzoption{face 33}{\def\tikz@lib@fold@face@AG{#1}}%
+\tikzoption{face 34}{\def\tikz@lib@fold@face@AH{#1}}%
+\tikzoption{face 35}{\def\tikz@lib@fold@face@AI{#1}}%
+\tikzoption{face 36}{\def\tikz@lib@fold@face@AJ{#1}}%
+\tikzoption{face 37}{\def\tikz@lib@fold@face@AK{#1}}%
+\tikzoption{face 38}{\def\tikz@lib@fold@face@AL{#1}}%
+\tikzoption{face 39}{\def\tikz@lib@fold@face@AM{#1}}%
+\tikzoption{face 40}{\def\tikz@lib@fold@face@AN{#1}}%
+\tikzoption{face 41}{\def\tikz@lib@fold@face@AO{#1}}%
+\tikzoption{face 42}{\def\tikz@lib@fold@face@AP{#1}}%
+\tikzoption{face 43}{\def\tikz@lib@fold@face@AQ{#1}}%
+\tikzoption{face 44}{\def\tikz@lib@fold@face@AR{#1}}%
+\tikzoption{face 45}{\def\tikz@lib@fold@face@AS{#1}}%
+\tikzoption{face 46}{\def\tikz@lib@fold@face@AT{#1}}%
+\tikzoption{face 47}{\def\tikz@lib@fold@face@AU{#1}}%
+\tikzoption{face 48}{\def\tikz@lib@fold@face@AV{#1}}%
+\tikzoption{face 49}{\def\tikz@lib@fold@face@AW{#1}}%
+\tikzoption{face 50}{\def\tikz@lib@fold@face@AX{#1}}%
+\tikzoption{face 51}{\def\tikz@lib@fold@face@AY{#1}}%
+\tikzoption{face 52}{\def\tikz@lib@fold@face@AZ{#1}}%
+\tikzoption{face 53}{\def\tikz@lib@fold@face@BA{#1}}%
+\tikzoption{face 54}{\def\tikz@lib@fold@face@BB{#1}}%
+\tikzoption{face 55}{\def\tikz@lib@fold@face@BC{#1}}%
+\tikzoption{face 56}{\def\tikz@lib@fold@face@BD{#1}}%
+\tikzoption{face 57}{\def\tikz@lib@fold@face@BE{#1}}%
+\tikzoption{face 58}{\def\tikz@lib@fold@face@BF{#1}}%
+\tikzoption{face 59}{\def\tikz@lib@fold@face@BG{#1}}%
+\tikzoption{face 60}{\def\tikz@lib@fold@face@BH{#1}}%
+\tikzoption{face 61}{\def\tikz@lib@fold@face@BI{#1}}%
+\tikzoption{face 62}{\def\tikz@lib@fold@face@BJ{#1}}%
+\tikzoption{face 63}{\def\tikz@lib@fold@face@BK{#1}}%
+\tikzoption{face 64}{\def\tikz@lib@fold@face@BL{#1}}%
+\tikzoption{face 65}{\def\tikz@lib@fold@face@BM{#1}}%
+\tikzoption{face 66}{\def\tikz@lib@fold@face@BN{#1}}%
+\tikzoption{face 67}{\def\tikz@lib@fold@face@BO{#1}}%
+\tikzoption{face 68}{\def\tikz@lib@fold@face@BP{#1}}%
+\tikzoption{face 69}{\def\tikz@lib@fold@face@BQ{#1}}%
+\tikzoption{face 70}{\def\tikz@lib@fold@face@BR{#1}}%
+\tikzoption{face 71}{\def\tikz@lib@fold@face@BS{#1}}%
+\tikzoption{face 72}{\def\tikz@lib@fold@face@BT{#1}}%
+\tikzoption{face 73}{\def\tikz@lib@fold@face@BU{#1}}%
+\tikzoption{face 74}{\def\tikz@lib@fold@face@BV{#1}}%
+\tikzoption{face 75}{\def\tikz@lib@fold@face@BW{#1}}%
+\tikzoption{face 76}{\def\tikz@lib@fold@face@BX{#1}}%
+\tikzoption{face 77}{\def\tikz@lib@fold@face@BY{#1}}%
+\tikzoption{face 78}{\def\tikz@lib@fold@face@BZ{#1}}%
+\tikzoption{face 79}{\def\tikz@lib@fold@face@CA{#1}}%
+\tikzoption{face 80}{\def\tikz@lib@fold@face@CB{#1}}%
+\tikzoption{face 81}{\def\tikz@lib@fold@face@CC{#1}}%
+\tikzoption{face 82}{\def\tikz@lib@fold@face@CD{#1}}%
+\tikzoption{face 83}{\def\tikz@lib@fold@face@CE{#1}}%
+\tikzoption{face 84}{\def\tikz@lib@fold@face@CF{#1}}%
+\tikzoption{face 85}{\def\tikz@lib@fold@face@CG{#1}}%
+\tikzoption{face 86}{\def\tikz@lib@fold@face@CH{#1}}%
+\tikzoption{face 87}{\def\tikz@lib@fold@face@CI{#1}}%
+\tikzoption{face 88}{\def\tikz@lib@fold@face@CJ{#1}}%
+\tikzoption{face 89}{\def\tikz@lib@fold@face@CK{#1}}%
+\tikzoption{face 90}{\def\tikz@lib@fold@face@CL{#1}}%
+\tikzoption{face 91}{\def\tikz@lib@fold@face@CM{#1}}%
+\tikzoption{face 92}{\def\tikz@lib@fold@face@CN{#1}}%
\let\tikz@lib@fold@face@A=\pgfutil@empty
@@ -426,102 +427,102 @@
\let\tikz@lib@fold@face@CN=\pgfutil@empty
-\tikzstyle{numbered faces}=[%
- face 1={\node{1};},
- face 2={\node{2};},
- face 3={\node{3};},
- face 4={\node{4};},
- face 5={\node{5};},
- face 6={\node{6};},
- face 7={\node{7};},
- face 8={\node{8};},
- face 9={\node{9};},
- face 10={\node{10};},
- face 11={\node{11};},
- face 12={\node{12};},
- face 13={\node{13};},
- face 14={\node{14};},
- face 15={\node{15};},
- face 16={\node{16};},
- face 17={\node{17};},
- face 18={\node{18};},
- face 19={\node{19};},
- face 20={\node{20};},
- face 21={\node{21};},
- face 22={\node{22};},
- face 23={\node{23};},
- face 24={\node{24};},
- face 25={\node{25};},
- face 26={\node{26};},
- face 27={\node{27};},
- face 28={\node{28};},
- face 29={\node{29};},
- face 30={\node{30};},
- face 31={\node{31};},
- face 32={\node{32};},
- face 33={\node{33};},
- face 34={\node{34};},
- face 35={\node{35};},
- face 36={\node{36};},
- face 37={\node{37};},
- face 38={\node{38};},
- face 39={\node{39};},
- face 40={\node{40};},
- face 41={\node{41};},
- face 42={\node{42};},
- face 43={\node{43};},
- face 44={\node{44};},
- face 45={\node{45};},
- face 46={\node{46};},
- face 47={\node{47};},
- face 48={\node{48};},
- face 49={\node{49};},
- face 50={\node{50};},
- face 51={\node{51};},
- face 52={\node{52};},
- face 53={\node{53};},
- face 54={\node{54};},
- face 55={\node{55};},
- face 56={\node{56};},
- face 57={\node{57};},
- face 58={\node{58};},
- face 59={\node{59};},
- face 60={\node{60};},
- face 61={\node{61};},
- face 62={\node{62};},
- face 63={\node{63};},
- face 64={\node{64};},
- face 65={\node{65};},
- face 66={\node{66};},
- face 67={\node{67};},
- face 68={\node{68};},
- face 69={\node{69};},
- face 70={\node{70};},
- face 71={\node{71};},
- face 72={\node{72};},
- face 73={\node{73};},
- face 74={\node{74};},
- face 75={\node{75};},
- face 76={\node{76};},
- face 77={\node{77};},
- face 78={\node{78};},
- face 79={\node{79};},
- face 80={\node{80};},
- face 81={\node{81};},
- face 82={\node{82};},
- face 83={\node{83};},
- face 84={\node{84};},
- face 85={\node{85};},
- face 86={\node{86};},
- face 87={\node{87};},
- face 88={\node{88};},
- face 89={\node{89};},
- face 90={\node{90};},
- face 91={\node{91};},
- face 92={\node{92};}]
-
+\tikzset{numbered faces/.style={%
+ face 1={\node{1};},
+ face 2={\node{2};},
+ face 3={\node{3};},
+ face 4={\node{4};},
+ face 5={\node{5};},
+ face 6={\node{6};},
+ face 7={\node{7};},
+ face 8={\node{8};},
+ face 9={\node{9};},
+ face 10={\node{10};},
+ face 11={\node{11};},
+ face 12={\node{12};},
+ face 13={\node{13};},
+ face 14={\node{14};},
+ face 15={\node{15};},
+ face 16={\node{16};},
+ face 17={\node{17};},
+ face 18={\node{18};},
+ face 19={\node{19};},
+ face 20={\node{20};},
+ face 21={\node{21};},
+ face 22={\node{22};},
+ face 23={\node{23};},
+ face 24={\node{24};},
+ face 25={\node{25};},
+ face 26={\node{26};},
+ face 27={\node{27};},
+ face 28={\node{28};},
+ face 29={\node{29};},
+ face 30={\node{30};},
+ face 31={\node{31};},
+ face 32={\node{32};},
+ face 33={\node{33};},
+ face 34={\node{34};},
+ face 35={\node{35};},
+ face 36={\node{36};},
+ face 37={\node{37};},
+ face 38={\node{38};},
+ face 39={\node{39};},
+ face 40={\node{40};},
+ face 41={\node{41};},
+ face 42={\node{42};},
+ face 43={\node{43};},
+ face 44={\node{44};},
+ face 45={\node{45};},
+ face 46={\node{46};},
+ face 47={\node{47};},
+ face 48={\node{48};},
+ face 49={\node{49};},
+ face 50={\node{50};},
+ face 51={\node{51};},
+ face 52={\node{52};},
+ face 53={\node{53};},
+ face 54={\node{54};},
+ face 55={\node{55};},
+ face 56={\node{56};},
+ face 57={\node{57};},
+ face 58={\node{58};},
+ face 59={\node{59};},
+ face 60={\node{60};},
+ face 61={\node{61};},
+ face 62={\node{62};},
+ face 63={\node{63};},
+ face 64={\node{64};},
+ face 65={\node{65};},
+ face 66={\node{66};},
+ face 67={\node{67};},
+ face 68={\node{68};},
+ face 69={\node{69};},
+ face 70={\node{70};},
+ face 71={\node{71};},
+ face 72={\node{72};},
+ face 73={\node{73};},
+ face 74={\node{74};},
+ face 75={\node{75};},
+ face 76={\node{76};},
+ face 77={\node{77};},
+ face 78={\node{78};},
+ face 79={\node{79};},
+ face 80={\node{80};},
+ face 81={\node{81};},
+ face 82={\node{82};},
+ face 83={\node{83};},
+ face 84={\node{84};},
+ face 85={\node{85};},
+ face 86={\node{86};},
+ face 87={\node{87};},
+ face 88={\node{88};},
+ face 89={\node{89};},
+ face 90={\node{90};},
+ face 91={\node{91};},
+ face 92={\node{92};}}}%
+
% The foldings defined here:
-
+
\tikzset{
pics/dodecahedron folding/.style = {code=\tikzfoldingdodecahedron[];},
pics/tetrahedron folding/.style = {code=\tikzfoldingtetrahedron[];},
@@ -538,13 +539,13 @@
pics/rhombicuboctahedron folding/.style = {code=\tikzfoldingrhombicuboctahedron[];},
pics/snub cube folding/.style = {code=\tikzfoldingsnubcube[];},
pics/icosidodecahedron folding/.style = {code=\tikzfoldingicosidodecahedron[];}
-}
+}%
+
-
% Platonic solids
% ---------------
-
+
\def\tikzfoldingdodecahedron#1[#2]#3;{%
\begingroup%
\tikzset{#2}%
@@ -633,9 +634,9 @@
{\tikz@lib@fold@cut@path}
}
\endgroup
-}
+}%
-%alternative dodecahedron: larger format possible
+%alternative dodecahedron: larger format possible
\def\tikzfoldingalternatedodecahedron#1[#2]#3;{%
\begingroup%
@@ -645,90 +646,90 @@
{\tikz@lib@fold@pentagon
{\tikz@lib@fold@face@B}
{\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@pentagon
- {\tikz@lib@fold@face@C}
- {\tikz@lib@fold@pentagon
- {\tikz@lib@fold@face@D}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@pentagon
- {\tikz@lib@fold@face@E}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@pentagon
+ {\tikz@lib@fold@face@C}
+ {\tikz@lib@fold@pentagon
+ {\tikz@lib@fold@face@D}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@pentagon
+ {\tikz@lib@fold@face@E}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@pentagon
+ {\tikz@lib@fold@face@F}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
{\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@pentagon
+ {\tikz@lib@fold@face@G}
{\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@pentagon
- {\tikz@lib@fold@face@F}
- {\tikz@lib@fold@ear@path}
{\tikz@lib@fold@ear@path}
{\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
{\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@pentagon
- {\tikz@lib@fold@face@G}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@ear@path}
- }
- }
+ }
+ }
}
{\tikz@lib@fold@ear@path}
{\tikz@lib@fold@pentagon
{\tikz@lib@fold@face@H}
- {\tikz@lib@fold@pentagon
- {\tikz@lib@fold@face@I}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@pentagon
- {\tikz@lib@fold@face@J}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@pentagon
- {\tikz@lib@fold@face@K}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@pentagon
- {\tikz@lib@fold@face@L}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- }
+ {\tikz@lib@fold@pentagon
+ {\tikz@lib@fold@face@I}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@pentagon
+ {\tikz@lib@fold@face@J}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@pentagon
+ {\tikz@lib@fold@face@K}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@pentagon
+ {\tikz@lib@fold@face@L}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ }
}
{\tikz@lib@fold@ear@path}
{\tikz@lib@fold@ear@path}
\endgroup
-}
+}%
-%tetrahedron
+%tetrahedron
\def\tikzfoldingtetrahedron#1[#2]#3;{%
\begingroup%
@@ -737,15 +738,15 @@
{\tikz@lib@fold@face@A}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@B}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@C}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@D}
@@ -754,53 +755,53 @@
{\tikz@lib@fold@cut@path}
}
\endgroup
-}
+}%
-%cube
+%cube
\def\tikzfoldingcube#1[#2]#3;{%
\begingroup%
\tikzset{#2}%
\tikz@lib@fold@square{\tikz@lib@fold@face@A}
{
- \tikz@lib@fold@square{\tikz@lib@fold@face@B}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
+ \tikz@lib@fold@square{\tikz@lib@fold@face@B}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
}
{
- \tikz@lib@fold@square{\tikz@lib@fold@face@C}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ \tikz@lib@fold@square{\tikz@lib@fold@face@C}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
{
- \tikz@lib@fold@square{\tikz@lib@fold@face@D}
- {
- \tikz@lib@fold@square{\tikz@lib@fold@face@E}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
+ \tikz@lib@fold@square{\tikz@lib@fold@face@D}
+ {
+ \tikz@lib@fold@square{\tikz@lib@fold@face@E}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
}
{
- \tikz@lib@fold@square{\tikz@lib@fold@face@F}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ \tikz@lib@fold@square{\tikz@lib@fold@face@F}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
\endgroup
-}
+}%
-%octahedron
+%octahedron
\def\tikzfoldingoctahedron#1[#2]#3;{%
\begingroup%
@@ -809,47 +810,47 @@
{\tikz@lib@fold@face@A}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@B}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@C}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@D}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@C}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@D}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
{\tikz@lib@fold@face@E}
{\tikz@lib@fold@ear@path}
{\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- }
+ {\tikz@lib@fold@ear@path}
+ }
}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@F}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@G}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@H}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@H}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
}
\endgroup
-}
+}%
-%icosahedron
+%icosahedron
\def\tikzfoldingicosahedron#1[#2]#3;{%
\begingroup%
@@ -858,109 +859,109 @@
{\tikz@lib@fold@face@A}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@B}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@C}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@D}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@E}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@F}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@G}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- }
- }
- }
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@C}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@D}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@E}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@F}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@G}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ }
+ }
+ }
{\tikz@lib@fold@path}
{\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@H}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@I}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@J}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@K}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@L}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@M}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@N}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- }
- }
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@I}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@J}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@K}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@L}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@M}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@N}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ }
+ }
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@O}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@P}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@Q}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@R}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@S}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@P}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@Q}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@R}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@S}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
{\tikz@lib@fold@face@T}
{\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- }
- }
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ }
+ }
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
}
\endgroup
-}
+}%
% Archimedean solids
% ------------------
-%truncated tetrahedron
+%truncated tetrahedron
\def\tikzfoldingtruncatedtetrahedron#1[#2]#3;{%
\begingroup%
@@ -969,58 +970,58 @@
{\tikz@lib@fold@face@A}
{\tikz@lib@fold@hexagon
{\tikz@lib@fold@face@B}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@C}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@hexagon
{\tikz@lib@fold@face@D}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@E}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@hexagon
{\tikz@lib@fold@face@F}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@G}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@G}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@H}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
\endgroup
-}
+}%
-%cuboctahedron
+%cuboctahedron
\def\tikzfoldingcuboctahedron#1[#2]#3;{%
\begingroup%
@@ -1029,80 +1030,80 @@
{\tikz@lib@fold@face@A}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@B}
- {\tikz@lib@fold@square
- {\tikz@lib@fold@face@C}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@D}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@square
- {\tikz@lib@fold@face@E}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@square
+ {\tikz@lib@fold@face@C}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@D}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@square
+ {\tikz@lib@fold@face@E}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
}
- }
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@F}
- {\tikz@lib@fold@square
- {\tikz@lib@fold@face@G}
+ {\tikz@lib@fold@square
+ {\tikz@lib@fold@face@G}
{\tikz@lib@fold@ear@path}
{\tikz@lib@fold@ear@path}
{\tikz@lib@fold@path}
{\tikz@lib@fold@ear@path}
}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@H}
- {\tikz@lib@fold@square
- {\tikz@lib@fold@face@I}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@J}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@square
+ {\tikz@lib@fold@face@I}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@J}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@triangle
{\tikz@lib@fold@face@K}
- {\tikz@lib@fold@square
- {\tikz@lib@fold@face@L}
- {\tikz@lib@fold@triangle
- {\tikz@lib@fold@face@M}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@square
+ {\tikz@lib@fold@face@L}
+ {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@face@M}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
{\tikz@lib@fold@face@N}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
\endgroup
-}
+}%
%truncated cube
@@ -1113,104 +1114,104 @@
{\tikz@lib@fold@face@A}
{\tikz@lib@fold@octagon
{\tikz@lib@fold@face@B}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@triangle
{\tikz@lib@fold@face@C}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@triangle
{\tikz@lib@fold@face@D}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
{\tikz@lib@fold@face@E}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@triangle
{\tikz@lib@fold@face@F}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
}
}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@octagon
{\tikz@lib@fold@face@G}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@triangle
{\tikz@lib@fold@face@H}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@octagon
{\tikz@lib@fold@face@I}
- {\tikz@lib@fold@octagon
+ {\tikz@lib@fold@octagon
{\tikz@lib@fold@face@J}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@triangle
{\tikz@lib@fold@face@K}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
{\tikz@lib@fold@face@L}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@octagon
{\tikz@lib@fold@face@M}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@triangle
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@triangle
{\tikz@lib@fold@face@N}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@cut@path}
\endgroup
-}
+}%
%truncated octahedron
@@ -1319,7 +1320,7 @@
{\tikz@lib@fold@ear@path}
{\tikz@lib@fold@cut@path}
\endgroup
-}
+}%
%rhombicuboctahedron
@@ -1476,7 +1477,7 @@
{\tikz@lib@fold@ear@path}
}
\endgroup
-}
+}%
%truncated cuboctahedron
@@ -1489,88 +1490,88 @@
{\tikz@lib@fold@face@B}
{\tikz@lib@fold@square
{\tikz@lib@fold@face@C}
- {\tikz@lib@fold@octagon
- {\tikz@lib@fold@face@D}
- {\tikz@lib@fold@square
- {\tikz@lib@fold@face@E}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@hexagon
- {\tikz@lib@fold@face@F}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@custom@right@path{15}}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@hexagon
- {\tikz@lib@fold@face@G}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@custom@left@path{15}}
- {\tikz@lib@fold@ear@path}
- }
- }
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@square
- {\tikz@lib@fold@face@H}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@square
- {\tikz@lib@fold@face@I}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@hexagon
- {\tikz@lib@fold@face@J}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@custom@right@path{15}}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@custom@left@path{15}}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@hexagon
- {\tikz@lib@fold@face@K}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@custom@right@path{15}}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@custom@left@path{15}}
- {\tikz@lib@fold@ear@path}
- }
+ {\tikz@lib@fold@octagon
+ {\tikz@lib@fold@face@D}
+ {\tikz@lib@fold@square
+ {\tikz@lib@fold@face@E}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@hexagon
+ {\tikz@lib@fold@face@F}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@custom@right@path{15}}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@hexagon
+ {\tikz@lib@fold@face@G}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@custom@left@path{15}}
+ {\tikz@lib@fold@ear@path}
+ }
+ }
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@square
+ {\tikz@lib@fold@face@H}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@square
+ {\tikz@lib@fold@face@I}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@hexagon
+ {\tikz@lib@fold@face@J}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@custom@right@path{15}}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@custom@left@path{15}}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@hexagon
+ {\tikz@lib@fold@face@K}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@custom@right@path{15}}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@custom@left@path{15}}
+ {\tikz@lib@fold@ear@path}
+ }
}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@square
{\tikz@lib@fold@face@L}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@path}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@square
{\tikz@lib@fold@face@M}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@cut@path}
}
@@ -1587,86 +1588,86 @@
{\tikz@lib@fold@face@O}
{\tikz@lib@fold@square
{\tikz@lib@fold@face@P}
- {\tikz@lib@fold@octagon
- {\tikz@lib@fold@face@Q}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@square
- {\tikz@lib@fold@face@R}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@square
- {\tikz@lib@fold@face@S}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@hexagon
- {\tikz@lib@fold@face@T}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@custom@right@path{15}}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@custom@left@path{15}}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@hexagon
- {\tikz@lib@fold@face@U}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@ear@custom@right@path{15}}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@custom@left@path{15}}
- {\tikz@lib@fold@ear@path}
- }
+ {\tikz@lib@fold@octagon
+ {\tikz@lib@fold@face@Q}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@square
+ {\tikz@lib@fold@face@R}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@square
+ {\tikz@lib@fold@face@S}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@hexagon
+ {\tikz@lib@fold@face@T}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@custom@right@path{15}}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@custom@left@path{15}}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@hexagon
+ {\tikz@lib@fold@face@U}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@ear@custom@right@path{15}}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@custom@left@path{15}}
+ {\tikz@lib@fold@ear@path}
+ }
}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@square
{\tikz@lib@fold@face@V}
- {\tikz@lib@fold@octagon
- {\tikz@lib@fold@face@W}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@octagon
+ {\tikz@lib@fold@face@W}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@path}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@square
{\tikz@lib@fold@face@X}
- {\tikz@lib@fold@octagon
- {\tikz@lib@fold@face@Y}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@octagon
+ {\tikz@lib@fold@face@Y}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
{\tikz@lib@fold@cut@path}
}
@@ -1680,9 +1681,9 @@
{\tikz@lib@fold@ear@path}
}
\endgroup
-}
+}%
-%snub cube
+%snub cube
\def\tikzfoldingsnubcube#1[#2]#3;{%
\begingroup%
@@ -1690,200 +1691,200 @@
\tikz@lib@fold@square{\tikz@lib@fold@face@A}
{
\tikz@lib@fold@triangle{\tikz@lib@fold@face@B}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@C}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@D}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {
- \tikz@lib@fold@square{\tikz@lib@fold@face@E}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@F}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@G}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@H}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- }
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@I}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@J}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- }
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@C}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@D}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {
+ \tikz@lib@fold@square{\tikz@lib@fold@face@E}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@F}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@G}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@H}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ }
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@I}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@J}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ }
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
{
\tikz@lib@fold@triangle{\tikz@lib@fold@face@K}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@L}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@M}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {
- \tikz@lib@fold@square{\tikz@lib@fold@face@N}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@O}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@P}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@Q}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- }
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@R}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@S}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- }
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@L}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@M}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {
+ \tikz@lib@fold@square{\tikz@lib@fold@face@N}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@O}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@P}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@Q}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ }
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@R}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@S}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ }
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
{
\tikz@lib@fold@triangle{\tikz@lib@fold@face@T}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@U}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@V}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {
- \tikz@lib@fold@square{\tikz@lib@fold@face@W}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@X}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@Y}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@Z}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- }
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@AA}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@AB}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- }
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@U}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@V}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {
+ \tikz@lib@fold@square{\tikz@lib@fold@face@W}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@X}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@Y}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@Z}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ }
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@AA}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@AB}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ }
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
{
\tikz@lib@fold@triangle{\tikz@lib@fold@face@AC}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@AD}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@AE}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {
- \tikz@lib@fold@square{\tikz@lib@fold@face@AF}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@AG}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@AH}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@AI}
- {
- \tikz@lib@fold@square{\tikz@lib@fold@face@AJ}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- }
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@AK}
- {\tikz@lib@fold@ear@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@ear@path}
- }
- {\tikz@lib@fold@path}
- {
- \tikz@lib@fold@triangle{\tikz@lib@fold@face@AL}
- {\tikz@lib@fold@cut@path}
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- }
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
- }
- {\tikz@lib@fold@path}
- {\tikz@lib@fold@cut@path}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@AD}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@AE}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {
+ \tikz@lib@fold@square{\tikz@lib@fold@face@AF}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@AG}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@AH}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@AI}
+ {
+ \tikz@lib@fold@square{\tikz@lib@fold@face@AJ}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ }
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@AK}
+ {\tikz@lib@fold@ear@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@ear@path}
+ }
+ {\tikz@lib@fold@path}
+ {
+ \tikz@lib@fold@triangle{\tikz@lib@fold@face@AL}
+ {\tikz@lib@fold@cut@path}
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ }
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
+ }
+ {\tikz@lib@fold@path}
+ {\tikz@lib@fold@cut@path}
}
\endgroup
-}
+}%
% icosidodecahedron
@@ -2074,4 +2075,4 @@
{\tikz@lib@fold@cut@path}
}
\endgroup
-}
+}%
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
index eda3ce51996..ad8d2671ee8 100644
--- 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
@@ -7,4 +7,4 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgflibrary{fpu}
+\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
index 361d961339b..f3e4f94144b 100644
--- 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
@@ -7,28 +7,28 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgflibrary{intersections}
+\usepgflibrary{intersections}%
% FIXME : the 'name path global' is not reset properly - and some
% following 'name path' will append to it rather that reset it.
\pgfkeys{%
/tikz/name path global/.code={%
- % reset any "old" variables inheritted from some other path
- % - we do not accidentally want to append to an old path with the
- % same name (or if someone provided the option twice)...
- \expandafter\global\expandafter\let\csname tikz@intersect@path@name@#1\endcsname=\relax
- \tikz@key@name@path{#1}{\gdef}%
+ % reset any "old" variables inherited from some other path
+ % - we do not accidentally want to append to an old path with the
+ % same name (or if someone provided the option twice)...
+ \expandafter\global\expandafter\let\csname tikz@intersect@path@name@#1\endcsname=\relax
+ \tikz@key@name@path{#1}{\gdef}%
},
/tikz/name path local/.code={%
\pgfkeys{/tikz/name path={#1}}%
},
/tikz/name path/.code={%
- % hm. Do we need this "reset old option" as in 'name path global'
- % for this case as well?
- \tikz@key@name@path{#1}{\def}%
+ % hm. Do we need this "reset old option" as in 'name path global'
+ % for this case as well?
+ \tikz@key@name@path{#1}{\def}%
},
-}
+}%
% #1: the name to assign.
% #2: one of '\def' or '\gdef'.
@@ -51,27 +51,27 @@
\expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\tikz@marshal%
\expandafter\expandafter\expandafter{\expandafter\tikz@marshal\expandafter{\tikz@intersect@temppath}}%
\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{%
+\def\tikz@intersect@finish{%
\ifx\tikz@intersect@namedpaths\pgfutil@empty%
\else%
\tikz@intersect@namedpaths%
- % FIXME : it is reasonable to reset this globally as it is global
- % in its nature. But the reset instruction should be moved to
- % \endscope or something related. Resetting it here breaks the
- % manual
+ % FIXME : it is reasonable to reset this globally as it is global
+ % in its nature. But the reset instruction should be moved to
+ % \endscope or something related. Resetting it here breaks the
+ % manual
\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
@@ -124,24 +124,24 @@
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%
-}
+ \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{%
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
index 4095f3a376c..89807c8e04d 100644
--- 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
@@ -7,75 +7,75 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgflibrary{lindenmayersystems}
+\usepgflibrary{lindenmayersystems}%
\def\tikz@@lsystem-system{%
- \pgfutil@ifnextchar[{\tikz@lsystem@options}{\tikz@lsystem@options[]}}
+ \pgfutil@ifnextchar[{\tikz@lsystem@options}{\tikz@lsystem@options[]}}%
\def\tikz@lsystem indenmayer system{%
- \pgfutil@ifnextchar[{\tikz@lsystem@options}{\tikz@lsystem@options[]}}
+ \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{#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}},
-}
+ 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
-}
+ 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,%
- }%
-}
+ \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%
-}
+ \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/tikzlibrarymath.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymath.code.tex
index 8ccdc64493a..bf95161576d 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymath.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarymath.code.tex
@@ -9,625 +9,631 @@
-\edef\tikz@math@at@catcode{\the\catcode`\@}
+\edef\tikz@math@at@catcode{\the\catcode`\@}%
\catcode`\@=11
-\def\tikz@math@gobblespaces#1{\pgfutil@ifnextchar x{#1}{#1}}
+\def\tikz@math@gobblespaces#1{\pgfutil@ifnextchar x{#1}{#1}}%
-\def\tikz@math@meaning@macro{macro}
-\def\tikz@math@meaning@dimen{dimen}
-\def\tikz@math@meaning@count{count}
-\def\tikz@math@meaning@null{null}
+\def\tikz@math@meaning@macro{macro}%
+\def\tikz@math@meaning@dimen{dimen}%
+\def\tikz@math@meaning@count{count}%
+\def\tikz@math@meaning@null{null}%
-\def\tikz@math@getmeaning#1{\expandafter\tikz@math@@getmeaning\meaning#1\tikz@math@getmeaning@stop}
+\def\tikz@math@getmeaning#1{\expandafter\tikz@math@@getmeaning\meaning#1\tikz@math@getmeaning@stop}%
\def\tikz@math@@getmeaning#1#2#3#4#5\tikz@math@getmeaning@stop{%
- \if#1u% undefined
- \let\tikz@math@meaning=\tikz@math@meaning@macro%
- \else%
- \if#1m%
- \let\tikz@math@meaning=\tikz@math@meaning@macro%
- \else%
- \if#2d%
- \let\tikz@math@meaning=\tikz@math@meaning@dimen%
- \else%
- \if#2c%
- \let\tikz@math@meaning=\tikz@math@meaning@count%
- \else%
- \if#3k% A skip. Treat like a dimen.
- \let\tikz@math@meaning=\tikz@math@meaning@dimen%
- \else%
- \let\tikz@math@meaning=\tikz@math@meaning@null%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
-}
-
-\def\tikz@math@firstoftwo#1#2{#1}
-\def\tikz@math@secondoftwo#1#2{#2}
+ \if#1u% undefined
+ \let\tikz@math@meaning=\tikz@math@meaning@macro%
+ \else%
+ \if#1m%
+ \let\tikz@math@meaning=\tikz@math@meaning@macro%
+ \else%
+ \if#2d%
+ \let\tikz@math@meaning=\tikz@math@meaning@dimen%
+ \else%
+ \if#2c%
+ \let\tikz@math@meaning=\tikz@math@meaning@count%
+ \else%
+ \if#3k% A skip. Treat like a dimen.
+ \let\tikz@math@meaning=\tikz@math@meaning@dimen%
+ \else%
+ \let\tikz@math@meaning=\tikz@math@meaning@null%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+}%
+
+\def\tikz@math@firstoftwo#1#2{#1}%
+\def\tikz@math@secondoftwo#1#2{#2}%
\def\tikz@math@getvarstring#1{%
- \begingroup%
- \escapechar=-1\relax%
- \expandafter\tikz@math@@getvarstring\string#1\tikz@math}
+ \begingroup%
+ \escapechar=-1\relax%
+ \expandafter\tikz@math@@getvarstring\string#1\tikz@math}%
\def\tikz@math@@getvarstring#1\tikz@math#2{%
- \endgroup%
- \def#2{#1}%
-}
+ \endgroup%
+ \def#2{#1}%
+}%
\long\def\tikz@math@collecttosemicolon@other#1#2;{%
- \def\tikz@math@collected{#2}#1}
+ \def\tikz@math@collected{#2}#1}%
\def\tikz@math@semicolon@other{;}%
{\catcode`\;=13
\long\gdef\tikz@math@collecttosemicolon@active#1#2;{%
- \def\tikz@math@collected{#2}#1}
+ \def\tikz@math@collected{#2}#1}%
\gdef\tikz@math@semicolon@active{;}%
-}
+}%
\def\tikz@math@setvartype#1#2{%
- \expandafter\let\csname tikz@math@var@vartype@\string#1\endcsname=#2%
-}
+ \expandafter\let\csname tikz@math@var@vartype@\string#1\endcsname=#2%
+}%
\def\tikz@math@getvartype#1#2{%
- \def\tikz@math@marshal{\let#1=}%
- \expandafter\tikz@math@marshal\csname
- tikz@math@var@vartype@\string#2\endcsname%
-}
+ \def\tikz@math@marshal{\let#1=}%
+ \expandafter\tikz@math@marshal\csname
+ tikz@math@var@vartype@\string#2\endcsname%
+}%
\def\tikz@math@ifvarcoordinate#1{%
- \expandafter\ifx\csname
- tikz@math@var@vartype@\string#1\endcsname\tikz@math@keyword@coordinate%
- \let\tikz@math@next=\tikz@math@firstoftwo%
- \else%
- \let\tikz@math@next=\tikz@math@secondoftwo%
- \fi%
- \tikz@math@next%
-}
+ \expandafter\ifx\csname
+ tikz@math@var@vartype@\string#1\endcsname\tikz@math@keyword@coordinate%
+ \let\tikz@math@next=\tikz@math@firstoftwo%
+ \else%
+ \let\tikz@math@next=\tikz@math@secondoftwo%
+ \fi%
+ \tikz@math@next%
+}%
\def\tikz@math@ifvarinteger#1{%
- \expandafter\ifx\csname
- tikz@math@var@vartype@\string#1\endcsname\tikz@math@keyword@integer%
- \let\tikz@math@next=\tikz@math@firstoftwo%
- \else%
- \let\tikz@math@next=\tikz@math@secondoftwo%
- \fi%
- \tikz@math@next%
-}
+ \expandafter\ifx\csname
+ tikz@math@var@vartype@\string#1\endcsname\tikz@math@keyword@integer%
+ \let\tikz@math@next=\tikz@math@firstoftwo%
+ \else%
+ \let\tikz@math@next=\tikz@math@secondoftwo%
+ \fi%
+ \tikz@math@next%
+}%
\def\tikz@math@setvarindexed#1{%
- \expandafter\let\csname
- tikz@math@var@subtype@\string#1\endcsname=\tikz@math@subtype@indexed%
-}
+ \expandafter\let\csname
+ tikz@math@var@subtype@\string#1\endcsname=\tikz@math@subtype@indexed%
+}%
\def\tikz@math@clearvarindexed#1{%
- \expandafter\let\csname tikz@math@var@subtype@\string#1\endcsname=\relax%
-}
+ \expandafter\let\csname tikz@math@var@subtype@\string#1\endcsname=\relax%
+}%
\def\tikz@math@ifvarindexed#1{%
- \expandafter\ifx\csname tikz@math@var@subtype@\string#1\endcsname\relax%
- \let\tikz@math@next=\tikz@math@secondoftwo%
- \else%
- \let\tikz@math@next=\tikz@math@firstoftwo%
- \fi%
- \tikz@math@next%
-}
+ \expandafter\ifx\csname tikz@math@var@subtype@\string#1\endcsname\relax%
+ \let\tikz@math@next=\tikz@math@secondoftwo%
+ \else%
+ \let\tikz@math@next=\tikz@math@firstoftwo%
+ \fi%
+ \tikz@math@next%
+}%
-\def\tikz@math@stop{@}
+\def\tikz@math@stop{@}%
\let\tikz@math@parse@hook@before=\pgfutil@empty
\let\tikz@math@parse@hook@after=\pgfutil@empty
\def\tikz@math{%
- \ifnum\catcode`\;=13\relax%
- \let\tikz@math@semicolon=\tikz@math@semicolon@active%
- \let\tikz@math@collecttosemicolon=\tikz@math@collecttosemicolon@active%
- \else%
- \let\tikz@math@semicolon=\tikz@math@semicolon@other%
- \let\tikz@math@collecttosemicolon=\tikz@math@collecttosemicolon@other%
- \fi%
- \tikz@math@parse@hook@before%
- \tikz@@math}
+ \ifnum\catcode`\;=13\relax%
+ \let\tikz@math@semicolon=\tikz@math@semicolon@active%
+ \let\tikz@math@collecttosemicolon=\tikz@math@collecttosemicolon@active%
+ \else%
+ \let\tikz@math@semicolon=\tikz@math@semicolon@other%
+ \let\tikz@math@collecttosemicolon=\tikz@math@collecttosemicolon@other%
+ \fi%
+ \tikz@math@parse@hook@before%
+ \tikz@@math}%
\long\def\tikz@@math#1{%
- \def\tikz@math@marshal{\tikz@math@parse#1}%
- \expandafter\expandafter\expandafter\tikz@math@marshal\expandafter\tikz@math@stop\tikz@math@semicolon}
-
-\def\tikz@math@parse{\pgfutil@ifnextchar\bgroup\tikz@math@@parse@bgroup\tikz@math@@parse@nobgroup}
+ \def\tikz@math@marshal{\tikz@math@parse#1}%
+ \expandafter\expandafter\expandafter\tikz@math@marshal\expandafter\tikz@math@stop\tikz@math@semicolon}%
+
+\def\tikz@math@parse{\pgfutil@ifnextchar\bgroup\tikz@math@@parse@bgroup\tikz@math@@parse@nobgroup}%
\def\tikz@math@@parse@bgroup{%
- \tikz@math@collecttosemicolon{%
- % MW: Don't know how reliable this test is.
- \ifx\pgf@selectfontorig\tikz@math@undefined%
- \begingroup\tikz@math@collected\endgroup%
- \else%
- \begingroup\csname nullfont\endcsname\tikz@math@collected\endgroup%
- \fi\tikz@math@parse}}
-
+ \tikz@math@collecttosemicolon{%
+ % MW: Don't know how reliable this test is.
+ \ifx\pgf@selectfontorig\tikz@math@undefined%
+ \begingroup\tikz@math@collected\endgroup%
+ \else%
+ \begingroup\csname nullfont\endcsname\tikz@math@collected\endgroup%
+ \fi\tikz@math@parse}}%
+
-\def\tikz@math@@parse@nobgroup{\tikz@math@collecttosemicolon{\tikz@math@@parse@@nobgroup}}
+\def\tikz@math@@parse@nobgroup{\tikz@math@collecttosemicolon{\tikz@math@@parse@@nobgroup}}%
\def\tikz@math@@parse@@nobgroup{%
- \let\tikz@math@tmp=\tikz@math@collected%
- \ifx\tikz@math@tmp\tikz@math@stop%
- \def\tikz@math@next{\expandafter\tikz@math@parse@finish\tikz@math@semicolon}%
- \else%
- \def\tikz@math@next{\expandafter\expandafter\expandafter\tikz@math@parse@keyword@check\expandafter\tikz@math@tmp\tikz@math@semicolon}%
- \fi%
- \tikz@math@next%
-}
+ \let\tikz@math@tmp=\tikz@math@collected%
+ \ifx\tikz@math@tmp\tikz@math@stop%
+ \def\tikz@math@next{\expandafter\tikz@math@parse@finish\tikz@math@semicolon}%
+ \else%
+ \def\tikz@math@next{\expandafter\expandafter\expandafter\tikz@math@parse@keyword@check\expandafter\tikz@math@tmp\tikz@math@semicolon}%
+ \fi%
+ \tikz@math@next%
+}%
\def\tikz@math@parse@finish{%
- \tikz@math@collecttosemicolon{\tikz@math@parse@hook@after}%
-}
+ \tikz@math@collecttosemicolon{\tikz@math@parse@hook@after}%
+}%
\newif\iftikz@math@let
\def\tikz@math@parse@keyword@check#1{%
- \tikz@math@letfalse%
- \tikz@math@getmeaning{#1}%
- \ifx\tikz@math@meaning\tikz@math@meaning@null%
- \let\tikz@math@next=\tikz@math@parse@keyword%
- \else%
- \let\tikz@math@next=\tikz@math@parse@nokeyword%
- \fi%
- \tikz@math@next#1}
+ \tikz@math@letfalse%
+ \tikz@math@getmeaning{#1}%
+ \ifx\tikz@math@meaning\tikz@math@meaning@null%
+ \let\tikz@math@next=\tikz@math@parse@keyword%
+ \else%
+ \let\tikz@math@next=\tikz@math@parse@nokeyword%
+ \fi%
+ \tikz@math@next#1}%
\def\tikz@math@parse@keyword{%
- \let\tikz@math@parsed@keyword=\pgfutil@empty%
- \futurelet\tikz@math@parse@token\tikz@math@@parse@keyword}
+ \let\tikz@math@parsed@keyword=\pgfutil@empty%
+ \futurelet\tikz@math@parse@token\tikz@math@@parse@keyword}%
\def\tikz@math@@parse@keyword{%
- \ifx\tikz@math@parse@token\pgfutil@sptoken%
- \let\tikz@math@next=\tikz@math@@@parse@keyword%
- \else%
- \ifx\tikz@math@parse@token(%
- \let\tikz@math@next=\tikz@math@@@parse@keyword%
- \else%
- \ifx\tikz@math@parse@token\bgroup%
- \let\tikz@math@next=\tikz@math@@@parse@keyword%
- \else%
- \let\tikz@math@next=\tikz@math@@@@parse@keyword%
- \fi%
- \fi%
- \fi%
- \tikz@math@next}
-
-\def\tikz@math@error#1{\pgfutil@packageerror{tikz}{tikz math library: #1}{}}
+ \ifx\tikz@math@parse@token\pgfutil@sptoken%
+ \let\tikz@math@next=\tikz@math@@@parse@keyword%
+ \else%
+ \ifx\tikz@math@parse@token(%
+ \let\tikz@math@next=\tikz@math@@@parse@keyword%
+ \else%
+ \ifx\tikz@math@parse@token\bgroup%
+ \let\tikz@math@next=\tikz@math@@@parse@keyword%
+ \else%
+ \let\tikz@math@next=\tikz@math@@@@parse@keyword%
+ \fi%
+ \fi%
+ \fi%
+ \tikz@math@next}%
+
+\def\tikz@math@error#1{\pgfutil@packageerror{tikz}{tikz math library: #1}{}}%
\def\tikz@math@@@parse@keyword{%
- \expandafter\ifx\csname tikz@math@process@keyword@\tikz@math@parsed@keyword\endcsname\relax%
- \expandafter\ifx\csname pgfmath\tikz@math@parsed@keyword\endcsname\relax%
- \tikz@math@error{Unknown function or keyword '\tikz@math@parsed@keyword'}%
- \else%
- \def\tikz@math@next{\tikz@math@collecttosemicolon{\tikz@math@function@noassign}}%
- \fi%
- \else%
- \expandafter\def\expandafter\tikz@math@next\expandafter{\csname tikz@math@process@keyword@\tikz@math@parsed@keyword\endcsname}%
- \fi%
- \tikz@math@next}
-
+ \expandafter\ifx\csname tikz@math@process@keyword@\tikz@math@parsed@keyword\endcsname\relax%
+ \expandafter\ifx\csname pgfmath\tikz@math@parsed@keyword\endcsname\relax%
+ \tikz@math@error{Unknown function or keyword '\tikz@math@parsed@keyword'}%
+ \else%
+ \def\tikz@math@next{\tikz@math@collecttosemicolon{\tikz@math@function@noassign}}%
+ \fi%
+ \else%
+ \expandafter\def\expandafter\tikz@math@next\expandafter{\csname tikz@math@process@keyword@\tikz@math@parsed@keyword\endcsname}%
+ \fi%
+ \tikz@math@next}%
+
\def\tikz@math@@@@parse@keyword#1{%
- \edef\tikz@math@parsed@keyword{\tikz@math@parsed@keyword#1}%
- \futurelet\tikz@math@parse@token\tikz@math@@parse@keyword%
-}
+ \edef\tikz@math@parsed@keyword{\tikz@math@parsed@keyword#1}%
+ \futurelet\tikz@math@parse@token\tikz@math@@parse@keyword%
+}%
\def\tikz@math@function@noassign{%
- \pgfmathparse{\tikz@math@parsed@keyword\tikz@math@collected}%
- \tikz@math@parse%
-}
-
-
-
-
-\def\tikz@math@process@keyword@count{\tikz@math@collecttosemicolon{\tikz@math@process@keyword@@count}}
+ \pgfmathparse{\tikz@math@parsed@keyword\tikz@math@collected}%
+ \tikz@math@parse%
+}%
+
+
+
+
+\def\tikz@math@process@keyword@count{\tikz@math@collecttosemicolon{\tikz@math@process@keyword@@count}}%
\def\tikz@math@process@keyword@@count{%
\def\tikz@math@assign@register{\csname newcount\endcsname}%
-\expandafter\tikz@math@gobblespaces\expandafter\tikz@math@process@registers\tikz@math@collected,@,}
+\expandafter\tikz@math@gobblespaces\expandafter\tikz@math@process@registers\tikz@math@collected,@,}%
-\def\tikz@math@process@keyword@length{\tikz@math@collecttosemicolon{\tikz@math@process@keyword@@length}}
+\def\tikz@math@process@keyword@length{\tikz@math@collecttosemicolon{\tikz@math@process@keyword@@length}}%
\def\tikz@math@process@keyword@@length{%
\def\tikz@math@assign@register{\csname newdimen\endcsname}%
\show\tikz@math@collected
-\expandafter\tikz@math@gobblespaces\expandafter\tikz@math@process@registers\tikz@math@collected,@,}
+\expandafter\tikz@math@gobblespaces\expandafter\tikz@math@process@registers\tikz@math@collected,@,}%
\def\tikz@math@process@registers#1#2,{%
- \def\tikz@math@var{#1}%
- \ifx\tikz@math@var\tikz@math@stop%
- \let\tikz@math@next=\tikz@math@parse%
- \else%
- \tikz@math@assign@register#1\relax%
- \let\tikz@math@next=\tikz@math@process@registers%
- \fi%
- \tikz@math@gobblespaces\tikz@math@next%
-}
+ \def\tikz@math@var{#1}%
+ \ifx\tikz@math@var\tikz@math@stop%
+ \let\tikz@math@next=\tikz@math@parse%
+ \else%
+ \tikz@math@assign@register#1\relax%
+ \let\tikz@math@next=\tikz@math@process@registers%
+ \fi%
+ \tikz@math@gobblespaces\tikz@math@next%
+}%
\def\tikz@math@process@keyword@if#1then{%
- \def\tikz@math@if@condition{#1}%
- \tikz@math@gobblespaces\tikz@math@parse@if@iftrue%
-}
+ \def\tikz@math@if@condition{#1}%
+ \tikz@math@gobblespaces\tikz@math@parse@if@iftrue%
+}%
\def\tikz@math@parse@if@iftrue#1{%
- \def\tikz@math@if@trueaction{#1}%
- \pgfutil@ifnextchar e{\tikz@math@parse@else}{\tikz@math@if@doif}}
+ \def\tikz@math@if@trueaction{#1}%
+ \pgfutil@ifnextchar e{\tikz@math@parse@else}{\tikz@math@if@doif}}%
-\def\tikz@math@parse@else else{\tikz@math@gobblespaces\tikz@math@if@doifelse}
+\def\tikz@math@parse@else else{\tikz@math@gobblespaces\tikz@math@if@doifelse}%
-\def\tikz@math@if@doif{\tikz@math@collecttosemicolon{\tikz@math@if@@doif}}
+\def\tikz@math@if@doif{\tikz@math@collecttosemicolon{\tikz@math@if@@doif}}%
\def\tikz@math@if@@doif{%
- \pgfmathparse{\tikz@math@if@condition}%
- \ifdim\pgfmathresult pt=0pt\relax%
- \else%
- \expandafter\tikz@math\expandafter{\tikz@math@if@trueaction}%
- \fi%
- \tikz@math@parse%
-}
-\def\tikz@math@if@doifelse{\tikz@math@collecttosemicolon{\tikz@math@if@@doifelse}}
+ \pgfmathparse{\tikz@math@if@condition}%
+ \ifpgfmathfloatparseactive%
+ \pgfmathfloattofixed{\pgfmathresult}%
+ \fi%
+ \ifdim\pgfmathresult pt=0pt\relax%
+ \else%
+ \expandafter\tikz@math\expandafter{\tikz@math@if@trueaction}%
+ \fi%
+ \tikz@math@parse%
+}%
+\def\tikz@math@if@doifelse{\tikz@math@collecttosemicolon{\tikz@math@if@@doifelse}}%
\def\tikz@math@if@@doifelse{%
- \pgfmathparse{\tikz@math@if@condition}%
- \let\tikz@math@if@falseaction=\tikz@math@collected%
- \ifdim\pgfmathresult pt=0pt\relax%
- \expandafter\tikz@math\expandafter{\tikz@math@if@falseaction}%
- \else%
- \expandafter\tikz@math\expandafter{\tikz@math@if@trueaction}%
- \fi%
- \tikz@math@parse%
-}
+ \pgfmathparse{\tikz@math@if@condition}%
+ \ifpgfmathfloatparseactive%
+ \pgfmathfloattofixed{\pgfmathresult}%
+ \fi%
+ \let\tikz@math@if@falseaction=\tikz@math@collected%
+ \ifdim\pgfmathresult pt=0pt\relax%
+ \expandafter\tikz@math\expandafter{\tikz@math@if@falseaction}%
+ \else%
+ \expandafter\tikz@math\expandafter{\tikz@math@if@trueaction}%
+ \fi%
+ \tikz@math@parse%
+}%
\def\tikz@math@process@keyword@let{%
- \tikz@math@lettrue%
- \tikz@math@gobblespaces\tikz@math@parse@nokeyword%
-}
+ \tikz@math@lettrue%
+ \tikz@math@gobblespaces\tikz@math@parse@nokeyword%
+}%
\def\tikz@math@parse@nokeyword#1{%
- \def\tikz@math@var{#1}%
- \tikz@math@getvarstring{#1}\tikz@math@varstring%
- \let\tikz@math@vartype=\pgfutil@empty%
- \ifx\tikz@math@var\tikz@math@stop%
- \let\tikz@math@next=\tikz@math@parse@finish%
- \else%
+ \def\tikz@math@var{#1}%
+ \tikz@math@getvarstring{#1}\tikz@math@varstring%
+ \let\tikz@math@vartype=\pgfutil@empty%
+ \ifx\tikz@math@var\tikz@math@stop%
+ \let\tikz@math@next=\tikz@math@parse@finish%
+ \else%
\ifx\tikz@math@semicolon\tikz@math@var%
- \let\tikz@math@next=\tikz@math@parse%
- \else%
- \let\tikz@math@next=\tikz@math@parse@index@check%
- \fi%
- \fi%
- \tikz@math@next}
+ \let\tikz@math@next=\tikz@math@parse%
+ \else%
+ \let\tikz@math@next=\tikz@math@parse@index@check%
+ \fi%
+ \fi%
+ \tikz@math@next}%
\def\tikz@math@parse@index@check{%
- \pgfutil@ifnextchar={\tikz@math@parse@noindex}{\tikz@math@parse@index}}
-
+ \pgfutil@ifnextchar={\tikz@math@parse@noindex}{\tikz@math@parse@index}}%
+
\def\tikz@math@parse@noindex{%
- \expandafter\tikz@math@clearvarindexed\tikz@math@var%
- \let\tikz@math@current@index=\pgfutil@empty%
- \tikz@math@parse@afterindex%
-}
+ \expandafter\tikz@math@clearvarindexed\tikz@math@var%
+ \let\tikz@math@current@index=\pgfutil@empty%
+ \tikz@math@parse@afterindex%
+}%
\def\tikz@math@parse@index#1{%
- \def\tikz@math@tmp{#1}%
- \expandafter\tikz@math@setvarindexed\tikz@math@var% {}
- \edef\tikz@math@current@index{#1}%
- \tikz@math@parse@afterindex%
-}
+ \def\tikz@math@tmp{#1}%
+ \expandafter\tikz@math@setvarindexed\tikz@math@var% {}
+ \edef\tikz@math@current@index{#1}%
+ \tikz@math@parse@afterindex%
+}%
\def\tikz@math@parse@afterindex#1={\tikz@math@gobblespaces\tikz@math@parse@assignment}%
-\def\tikz@math@parse@assignment{\tikz@math@collecttosemicolon{\tikz@math@parse@@assignment}}
+\def\tikz@math@parse@assignment{\tikz@math@collecttosemicolon{\tikz@math@parse@@assignment}}%
\def\tikz@math@parse@@assignment{%
- \expandafter\expandafter\expandafter\tikz@math@doassignment\expandafter\expandafter\expandafter%
- {\expandafter\tikz@math@var\expandafter}\expandafter{\tikz@math@collected}%
- \tikz@math@parse%
-}
+ \expandafter\expandafter\expandafter\tikz@math@doassignment\expandafter\expandafter\expandafter%
+ {\expandafter\tikz@math@var\expandafter}\expandafter{\tikz@math@collected}%
+ \tikz@math@parse%
+}%
-\def\tikz@math@dollar@char{$}
+\def\tikz@math@dollar@char{$}%
\def\tikz@math@dollar@char{$}% For annoying syntax highlighters
\def\tikz@math@doassignment#1#2{%
- \tikz@math@ifvarcoordinate{#1}{%
- \def\tikz@math@var{#1}% Unfortunately, we must do this again.
- \tikz@math@getvarstring{#1}\tikz@math@varstring% And this
- \expandafter\pgfutil@in@\tikz@math@dollar@char{#2}%
- \edef\tikz@math@expression{#2}%
- \ifpgfutil@in@%
- \expandafter\tikz@scan@one@point\expandafter\tikz@math@assign@coordinate\tikz@math@expression%
- \else%
- \expandafter\ifx\csname tikz@library@calc@loaded\endcsname\relax%
- \expandafter\tikz@scan@one@point\expandafter\tikz@math@assign@coordinate\tikz@math@expression%
- \else%
- \expandafter\tikz@scan@one@point\expandafter\tikz@math@assign@coordinate\expandafter%
- (\expandafter$\tikz@math@expression$)%
- \fi%
- \fi%
- }{%
- \iftikz@math@let% Not really a let
- \ifx\tikz@math@current@index\pgfutil@empty%
- \edef#1{#2}%
- \else%
- \edef\tikz@math@tmp{#2}%
- \expandafter\expandafter\expandafter\tikz@math@assign@index\expandafter\expandafter\expandafter%
- {\expandafter\tikz@math@varstring\expandafter}\expandafter{\tikz@math@tmp}%
- \fi%
- \tikz@math@letfalse%
- \else%
- \ifx\tikz@math@current@index\pgfutil@empty%
- \tikz@math@getmeaning{#1}%
- \ifx\tikz@math@meaning\tikz@math@meaning@dimen%
- \pgfmathsetlength{#1}{#2}%
- \let\tikz@math@last@assigned@value=\pgfmathresult%
- \else%
- \ifx\tikz@math@meaning\tikz@math@meaning@count%
- \pgfmathsetcount{#1}{#2}%
- \let\tikz@math@last@assigned@value=\pgfmathresult%
- \else%
- \tikz@math@ifvarinteger{#1}{\pgfmathparse{int(#2)}}{\pgfmathparse{#2}}%
- \let\tikz@math@last@assigned@value=\pgfmathresult%
- \let#1=\pgfmathresult%
- \fi%
- \fi%
- \else%
- \tikz@math@ifvarinteger{#1}{\pgfmathparse{int(#2)}}{\pgfmathparse{#2}}%
- \expandafter\tikz@math@assign@index\expandafter{\tikz@math@varstring}\pgfmathresult%
- \let\tikz@math@last@assigned@value=\pgfmathresult%
- \fi%
- \fi%
- }%
-}
+ \tikz@math@ifvarcoordinate{#1}{%
+ \def\tikz@math@var{#1}% Unfortunately, we must do this again.
+ \tikz@math@getvarstring{#1}\tikz@math@varstring% And this
+ \expandafter\pgfutil@in@\tikz@math@dollar@char{#2}%
+ \edef\tikz@math@expression{#2}%
+ \ifpgfutil@in@%
+ \expandafter\tikz@scan@one@point\expandafter\tikz@math@assign@coordinate\tikz@math@expression%
+ \else%
+ \expandafter\ifx\csname tikz@library@calc@loaded\endcsname\relax%
+ \expandafter\tikz@scan@one@point\expandafter\tikz@math@assign@coordinate\tikz@math@expression%
+ \else%
+ \expandafter\tikz@scan@one@point\expandafter\tikz@math@assign@coordinate\expandafter%
+ (\expandafter$\tikz@math@expression$)%
+ \fi%
+ \fi%
+ }{%
+ \iftikz@math@let% Not really a let
+ \ifx\tikz@math@current@index\pgfutil@empty%
+ \edef#1{#2}%
+ \else%
+ \edef\tikz@math@tmp{#2}%
+ \expandafter\expandafter\expandafter\tikz@math@assign@index\expandafter\expandafter\expandafter%
+ {\expandafter\tikz@math@varstring\expandafter}\expandafter{\tikz@math@tmp}%
+ \fi%
+ \tikz@math@letfalse%
+ \else%
+ \ifx\tikz@math@current@index\pgfutil@empty%
+ \tikz@math@getmeaning{#1}%
+ \ifx\tikz@math@meaning\tikz@math@meaning@dimen%
+ \pgfmathsetlength{#1}{#2}%
+ \let\tikz@math@last@assigned@value=\pgfmathresult%
+ \else%
+ \ifx\tikz@math@meaning\tikz@math@meaning@count%
+ \pgfmathsetcount{#1}{#2}%
+ \let\tikz@math@last@assigned@value=\pgfmathresult%
+ \else%
+ \tikz@math@ifvarinteger{#1}{\pgfmathparse{int(#2)}}{\pgfmathparse{#2}}%
+ \let\tikz@math@last@assigned@value=\pgfmathresult%
+ \let#1=\pgfmathresult%
+ \fi%
+ \fi%
+ \else%
+ \tikz@math@ifvarinteger{#1}{\pgfmathparse{int(#2)}}{\pgfmathparse{#2}}%
+ \expandafter\tikz@math@assign@index\expandafter{\tikz@math@varstring}\pgfmathresult%
+ \let\tikz@math@last@assigned@value=\pgfmathresult%
+ \fi%
+ \fi%
+ }%
+}%
\def\tikz@math@assign@index#1#2{%
- \expandafter\def\csname#1\endcsname##1{\csname
- tikz@math@var@indexed@#1@##1\endcsname}%
- \expandafter\edef\csname
- tikz@math@var@indexed@#1@\tikz@math@current@index\endcsname{#2}\relax%
-}
+ \expandafter\def\csname#1\endcsname##1{\csname
+ tikz@math@var@indexed@#1@##1\endcsname}%
+ \expandafter\edef\csname
+ tikz@math@var@indexed@#1@\tikz@math@current@index\endcsname{#2}\relax%
+}%
\def\tikz@math@assign@coordinate#1{%
- \pgf@process{#1}%
- \ifx\tikz@math@current@index\pgfutil@empty%
- \expandafter\edef\csname\tikz@math@varstring\endcsname{\the\pgf@x,\the\pgf@y}%
- \expandafter\edef\csname\tikz@math@varstring x\endcsname{\the\pgf@x}%
- \expandafter\edef\csname\tikz@math@varstring y\endcsname{\the\pgf@y}%
- \else%
- \expandafter\tikz@math@assign@index\expandafter{\tikz@math@varstring}{\the\pgf@x,\the\pgf@y}%
- \expandafter\tikz@math@assign@index\expandafter{\tikz@math@varstring x}{\the\pgf@x}%
- \expandafter\tikz@math@assign@index\expandafter{\tikz@math@varstring y}{\the\pgf@y}%
- \fi%
-}
+ \pgf@process{#1}%
+ \ifx\tikz@math@current@index\pgfutil@empty%
+ \expandafter\edef\csname\tikz@math@varstring\endcsname{\the\pgf@x,\the\pgf@y}%
+ \expandafter\edef\csname\tikz@math@varstring x\endcsname{\the\pgf@x}%
+ \expandafter\edef\csname\tikz@math@varstring y\endcsname{\the\pgf@y}%
+ \else%
+ \expandafter\tikz@math@assign@index\expandafter{\tikz@math@varstring}{\the\pgf@x,\the\pgf@y}%
+ \expandafter\tikz@math@assign@index\expandafter{\tikz@math@varstring x}{\the\pgf@x}%
+ \expandafter\tikz@math@assign@index\expandafter{\tikz@math@varstring y}{\the\pgf@y}%
+ \fi%
+}%
-\def\tikz@math@keyword@coordinate{coordinate}
+\def\tikz@math@keyword@coordinate{coordinate}%
\def\tikz@math@process@keyword@coordinate{%
- \let\tikz@math@vartype=\tikz@math@keyword@coordinate%
- \tikz@math@gobblespaces\tikz@math@process@vartypes%
-}
+ \let\tikz@math@vartype=\tikz@math@keyword@coordinate%
+ \tikz@math@gobblespaces\tikz@math@process@vartypes%
+}%
-\def\tikz@math@keyword@integer{integer}
+\def\tikz@math@keyword@integer{integer}%
\def\tikz@math@process@keyword@integer{%
- \let\tikz@math@vartype=\tikz@math@keyword@integer%
- \tikz@math@gobblespaces\tikz@math@process@vartypes%
-}
+ \let\tikz@math@vartype=\tikz@math@keyword@integer%
+ \tikz@math@gobblespaces\tikz@math@process@vartypes%
+}%
\def\tikz@math@process@keyword@int{%
- \tikz@math@process@keyword@integer%
-}
+ \tikz@math@process@keyword@integer%
+}%
-\def\tikz@math@keyword@real{real}
+\def\tikz@math@keyword@real{real}%
\def\tikz@math@process@keyword@real{%
- \let\tikz@math@vartype=\tikz@math@keyword@real%
- \tikz@math@gobblespaces\tikz@math@process@vartypes%
-}
+ \let\tikz@math@vartype=\tikz@math@keyword@real%
+ \tikz@math@gobblespaces\tikz@math@process@vartypes%
+}%
-\def\tikz@math@process@keyword@point{\tikz@math@process@keyword@coordinate}
+\def\tikz@math@process@keyword@point{\tikz@math@process@keyword@coordinate}%
-\def\tikz@math@process@vartypes{\tikz@math@collecttosemicolon{\tikz@math@process@@vartypes}}
+\def\tikz@math@process@vartypes{\tikz@math@collecttosemicolon{\tikz@math@process@@vartypes}}%
\def\tikz@math@process@@vartypes{%
- \expandafter\tikz@math@@process@vartypes\tikz@math@collected,@,\tikz@math%
-}
+ \expandafter\tikz@math@@process@vartypes\tikz@math@collected,@,\tikz@math%
+}%
\def\tikz@math@@process@vartypes#1#2,{%
- \def\tikz@math@var{#1}%
- \tikz@math@getvarstring{#1}\tikz@math@varstring%
- \ifx\tikz@math@var\tikz@math@stop%
- \let\tikz@math@next=\tikz@math@@@process@vartypes%
- \else%
- \expandafter\tikz@math@setvartype\tikz@math@var\tikz@math@vartype%
- \def\tikz@math@next{\tikz@math@gobblespaces\tikz@math@@process@vartypes}%
- \fi%
- \tikz@math@next%
-}
-
-\def\tikz@math@process@keyword@print{\tikz@math@collecttosemicolon{\tikz@math@process@keyword@@print}}
+ \def\tikz@math@var{#1}%
+ \tikz@math@getvarstring{#1}\tikz@math@varstring%
+ \ifx\tikz@math@var\tikz@math@stop%
+ \let\tikz@math@next=\tikz@math@@@process@vartypes%
+ \else%
+ \expandafter\tikz@math@setvartype\tikz@math@var\tikz@math@vartype%
+ \def\tikz@math@next{\tikz@math@gobblespaces\tikz@math@@process@vartypes}%
+ \fi%
+ \tikz@math@next%
+}%
+
+\def\tikz@math@process@keyword@print{\tikz@math@collecttosemicolon{\tikz@math@process@keyword@@print}}%
\def\tikz@math@process@keyword@@print{%
- \begingroup\tikz@math@collected\endgroup\tikz@math@parse%
-}
+ \begingroup\tikz@math@collected\endgroup\tikz@math@parse%
+}%
\def\tikz@math@@@process@vartypes#1\tikz@math{%
- \tikz@math@parse%
-}
+ \tikz@math@parse%
+}%
\newcount\tikz@math@for@depth
-\def\tikz@math@for@namedef#1{\expandafter\def\csname tikz@math@for@def@#1@\the\tikz@math@for@depth\endcsname}
-\def\tikz@math@for@nameedef#1{\expandafter\edef\csname tikz@math@for@def@#1@\the\tikz@math@for@depth\endcsname}
-\def\tikz@math@for@namelet#1{\expandafter\let\csname tikz@math@for@def@#1@\the\tikz@math@for@depth\endcsname}
+\def\tikz@math@for@namedef#1{\expandafter\def\csname tikz@math@for@def@#1@\the\tikz@math@for@depth\endcsname}%
+\def\tikz@math@for@nameedef#1{\expandafter\edef\csname tikz@math@for@def@#1@\the\tikz@math@for@depth\endcsname}%
+\def\tikz@math@for@namelet#1{\expandafter\let\csname tikz@math@for@def@#1@\the\tikz@math@for@depth\endcsname}%
\def\tikz@math@for@namegetvalue#1#2{%
- \def\tikz@math@marshal{\let#2=}%
- \expandafter\tikz@math@marshal\csname tikz@math@for@def@#1@\the\tikz@math@for@depth\endcsname}
+ \def\tikz@math@marshal{\let#2=}%
+ \expandafter\tikz@math@marshal\csname tikz@math@for@def@#1@\the\tikz@math@for@depth\endcsname}%
\def\tikz@math@process@keyword@for{%
- \tikz@math@for%
-}
+ \tikz@math@for%
+}%
\def\tikz@math@for@external{%
- \ifnum\catcode`\;=13\relax%
- \let\tikz@math@semicolon=\tikz@math@semicolon@active%
- \let\tikz@math@collecttosemicolon=\tikz@math@collecttosemicolon@active%
- \else%
- \let\tikz@math@semicolon=\tikz@math@semicolon@other%
- \let\tikz@math@collecttosemicolon=\tikz@math@collecttosemicolon@other%
- \fi
- \advance\tikz@math@for@depth by1\relax%
- \tikz@math@for@namedef{execute}{\tikz@math@for@external@execute}%
- \tikz@math@for@namedef{finished}{\relax}%
- \tikz@math@gobblespaces\tikz@math@for@parsevar}
-
-\def\tikz@math@for@external@execute#1{#1}
+ \ifnum\catcode`\;=13\relax%
+ \let\tikz@math@semicolon=\tikz@math@semicolon@active%
+ \let\tikz@math@collecttosemicolon=\tikz@math@collecttosemicolon@active%
+ \else%
+ \let\tikz@math@semicolon=\tikz@math@semicolon@other%
+ \let\tikz@math@collecttosemicolon=\tikz@math@collecttosemicolon@other%
+ \fi
+ \advance\tikz@math@for@depth by1\relax%
+ \tikz@math@for@namedef{execute}{\tikz@math@for@external@execute}%
+ \tikz@math@for@namedef{finished}{\relax}%
+ \tikz@math@gobblespaces\tikz@math@for@parsevar}%
+
+\def\tikz@math@for@external@execute#1{#1}%
\def\tikz@math@for{%
- \advance\tikz@math@for@depth by1\relax%
- \tikz@math@for@namedef{execute}{\tikz@math}%
- \tikz@math@for@namedef{finished}{\tikz@math@parse}%
- \tikz@math@gobblespaces\tikz@math@for@parsevar}
+ \advance\tikz@math@for@depth by1\relax%
+ \tikz@math@for@namedef{execute}{\tikz@math}%
+ \tikz@math@for@namedef{finished}{\tikz@math@parse}%
+ \tikz@math@gobblespaces\tikz@math@for@parsevar}%
\def\tikz@math@for@parsevar#1{%
- \tikz@math@for@namedef{var}{#1}%
- \tikz@math@for@parsein}
+ \tikz@math@for@namedef{var}{#1}%
+ \tikz@math@for@parsein}%
\def\tikz@math@getindex#1{%
- \tikz@math@@getindex#1\tikz@math@getindex\tikz@math@@getindex%
-}
+ \tikz@math@@getindex#1\tikz@math@getindex\tikz@math@@getindex%
+}%
-\def\tikz@math@@getindex#1#2\tikz@math@@getindex{#1}
+\def\tikz@math@@getindex#1#2\tikz@math@@getindex{#1}%
\def\tikz@math@for@parsein#1in{%
- \def\tikz@math@tmp{#1}%
- \ifx\tikz@math@tmp\pgfutil@empty%
- \tikz@math@for@namedef{index}{}%
- \else%
- \tikz@math@for@nameedef{index}{\tikz@math@getindex{#1}}%
- \fi%
- \tikz@math@gobblespaces\tikz@math@for@parselist%
-}
+ \def\tikz@math@tmp{#1}%
+ \ifx\tikz@math@tmp\pgfutil@empty%
+ \tikz@math@for@namedef{index}{}%
+ \else%
+ \tikz@math@for@nameedef{index}{\tikz@math@getindex{#1}}%
+ \fi%
+ \tikz@math@gobblespaces\tikz@math@for@parselist%
+}%
\long\def\tikz@math@for@parselist#1{%
- \edef\tikz@math@for@list{#1}%
- \tikz@math@collecttosemicolon{\tikz@math@for@parseaction}}
+ \edef\tikz@math@for@list{#1}%
+ \tikz@math@collecttosemicolon{\tikz@math@for@parseaction}}%
\def\tikz@math@for@parseaction{%
- \tikz@math@for@namedef{prevvalue}{}%
- \tikz@math@for@namedef{prevprevvalue}{}%
- \tikz@math@for@namelet{action}=\tikz@math@collected%
- \expandafter\tikz@math@for@scan\tikz@math@for@list,\tikz@math,\tikz@@math%
-}
+ \tikz@math@for@namedef{prevvalue}{}%
+ \tikz@math@for@namedef{prevprevvalue}{}%
+ \tikz@math@for@namelet{action}=\tikz@math@collected%
+ \expandafter\tikz@math@for@scan\tikz@math@for@list,\tikz@math,\tikz@@math%
+}%
-\def\tikz@math@token{\tikz@math}
+\def\tikz@math@token{\tikz@math}%
\def\tikz@math@for@scan#1,{%
- \def\tikz@math@for@value{#1}%
- \ifx\tikz@math@for@value\tikz@math@token%
- \let\tikz@math@next=\tikz@math@for@scan@end%
- \else%
- \ifx\tikz@math@for@value\pgfutil@empty%
- \let\tikz@math@next=\tikz@math@for@scan@end%
- \else%
- \pgfutil@in@{...}{#1}%
- \ifpgfutil@in@%
- \let\tikz@math@next=\tikz@math@for@scan@dots%
- \else%
- \tikz@math@for@namegetvalue{var}{\tikz@math@var}%
- \tikz@math@for@namegetvalue{index}{\tikz@math@current@index}%
- \tikz@math@for@namegetvalue{action}{\tikz@math@action}%
- \expandafter\tikz@math@getvarstring\expandafter{\tikz@math@var}\tikz@math@varstring%
- \expandafter\tikz@math@doassignment\expandafter{\tikz@math@var}{#1}%
- \tikz@math@for@namelet{value}=\tikz@math@last@assigned@value%
- \tikz@math@for@namegetvalue{execute}{\tikz@math@execute}%
- \expandafter\tikz@math@execute\expandafter{\tikz@math@action}%
- \tikz@math@for@namegetvalue{prevvalue}{\tikz@math@prevvalue}%
- \tikz@math@for@namelet{prevprevvalue}=\tikz@math@prevvalue%
- \tikz@math@for@namegetvalue{value}{\tikz@math@value}%
- \tikz@math@for@namelet{prevvalue}=\tikz@math@value%
- \let\tikz@math@next=\tikz@math@for@scan%
- \fi%
- \fi%
- \fi%
- \tikz@math@next%
-}
+ \def\tikz@math@for@value{#1}%
+ \ifx\tikz@math@for@value\tikz@math@token%
+ \let\tikz@math@next=\tikz@math@for@scan@end%
+ \else%
+ \ifx\tikz@math@for@value\pgfutil@empty%
+ \let\tikz@math@next=\tikz@math@for@scan@end%
+ \else%
+ \pgfutil@in@{...}{#1}%
+ \ifpgfutil@in@%
+ \let\tikz@math@next=\tikz@math@for@scan@dots%
+ \else%
+ \tikz@math@for@namegetvalue{var}{\tikz@math@var}%
+ \tikz@math@for@namegetvalue{index}{\tikz@math@current@index}%
+ \tikz@math@for@namegetvalue{action}{\tikz@math@action}%
+ \expandafter\tikz@math@getvarstring\expandafter{\tikz@math@var}\tikz@math@varstring%
+ \expandafter\tikz@math@doassignment\expandafter{\tikz@math@var}{#1}%
+ \tikz@math@for@namelet{value}=\tikz@math@last@assigned@value%
+ \tikz@math@for@namegetvalue{execute}{\tikz@math@execute}%
+ \expandafter\tikz@math@execute\expandafter{\tikz@math@action}%
+ \tikz@math@for@namegetvalue{prevvalue}{\tikz@math@prevvalue}%
+ \tikz@math@for@namelet{prevprevvalue}=\tikz@math@prevvalue%
+ \tikz@math@for@namegetvalue{value}{\tikz@math@value}%
+ \tikz@math@for@namelet{prevvalue}=\tikz@math@value%
+ \let\tikz@math@next=\tikz@math@for@scan%
+ \fi%
+ \fi%
+ \fi%
+ \tikz@math@next%
+}%
\newdimen\tikz@math@dimen
\def\tikz@math@for@scan@dots#1,{%
- \pgfmathparse{#1}\let\tikz@math@value=\pgfmathresult%
- \tikz@math@for@nameedef{endvalue}{\tikz@math@value}%
- \tikz@math@for@namegetvalue{prevvalue}{\tikz@math@prevvalue}%
- \tikz@math@for@namegetvalue{prevprevvalue}{\tikz@math@prevprevvalue}%
- \tikz@math@dimen=\tikz@math@prevvalue pt\relax%
- \ifx\tikz@math@prevprevvalue\pgfutil@empty%
- \ifdim\tikz@math@prevvalue pt<\tikz@math@value pt\relax%%
- \def\tikz@math@step{1pt}%
- \else%
- \def\tikz@math@step{-1pt}%
- \fi%
- \else%
- \tikz@math@dimen=\tikz@math@prevvalue pt\relax%
- \advance\tikz@math@dimen by-\tikz@math@prevprevvalue pt\relax%
- \edef\tikz@math@step{\the\tikz@math@dimen}%
- \fi%
- \ifdim\tikz@math@step<0pt\relax%
- \tikz@math@for@namedef{comparitor}{<}%
- \else%
- \tikz@math@for@namedef{comparitor}{>}%
- \fi%
- \tikz@math@for@nameedef{step}{\tikz@math@step}%
- \tikz@math@for@doloop%
-}
+ \pgfmathparse{#1}\let\tikz@math@value=\pgfmathresult%
+ \tikz@math@for@nameedef{endvalue}{\tikz@math@value}%
+ \tikz@math@for@namegetvalue{prevvalue}{\tikz@math@prevvalue}%
+ \tikz@math@for@namegetvalue{prevprevvalue}{\tikz@math@prevprevvalue}%
+ \tikz@math@dimen=\tikz@math@prevvalue pt\relax%
+ \ifx\tikz@math@prevprevvalue\pgfutil@empty%
+ \ifdim\tikz@math@prevvalue pt<\tikz@math@value pt\relax%%
+ \def\tikz@math@step{1pt}%
+ \else%
+ \def\tikz@math@step{-1pt}%
+ \fi%
+ \else%
+ \tikz@math@dimen=\tikz@math@prevvalue pt\relax%
+ \advance\tikz@math@dimen by-\tikz@math@prevprevvalue pt\relax%
+ \edef\tikz@math@step{\the\tikz@math@dimen}%
+ \fi%
+ \ifdim\tikz@math@step<0pt\relax%
+ \tikz@math@for@namedef{comparitor}{<}%
+ \else%
+ \tikz@math@for@namedef{comparitor}{>}%
+ \fi%
+ \tikz@math@for@nameedef{step}{\tikz@math@step}%
+ \tikz@math@for@doloop%
+}%
\def\tikz@math@for@doloop{%
- \tikz@math@for@namegetvalue{prevvalue}{\tikz@math@prevvalue}%
- \tikz@math@for@namegetvalue{step}{\tikz@math@step}%
- \tikz@math@for@namegetvalue{comparitor}{\tikz@math@comparitor}%
- \tikz@math@for@namegetvalue{endvalue}{\tikz@math@endvalue}%
- \tikz@math@dimen=\tikz@math@prevvalue pt\relax%
- \advance\tikz@math@dimen by\tikz@math@step\relax%
- \ifdim\tikz@math@dimen\tikz@math@comparitor\tikz@math@endvalue pt\relax%
- \let\tikz@math@next=\tikz@math@for@endloop%
- \else%
- \tikz@math@for@nameedef{value}{\pgfmath@tonumber{\tikz@math@dimen}}%
- \tikz@math@for@namegetvalue{var}{\tikz@math@var}%
- \expandafter\tikz@math@getvarstring\expandafter{\tikz@math@var}\tikz@math@varstring%
- \tikz@math@for@namegetvalue{index}{\tikz@math@current@index}%
- \tikz@math@for@namegetvalue{action}{\tikz@math@action}%
- \tikz@math@for@namegetvalue{value}{\tikz@math@value}%
- \expandafter\expandafter\expandafter\tikz@math@doassignment\expandafter\expandafter\expandafter%
- {\expandafter\tikz@math@var\expandafter}\expandafter{\tikz@math@value}%
- \tikz@math@for@namegetvalue{execute}{\tikz@math@execute}%
- \expandafter\tikz@math@execute\expandafter{\tikz@math@action}%
- \tikz@math@for@namegetvalue{prevvalue}{\tikz@math@prevvalue}%
- \tikz@math@for@namelet{prevprevvalue}=\tikz@math@prevvalue%
- \tikz@math@for@namegetvalue{value}{\tikz@math@value}%
- \tikz@math@for@namelet{prevvalue}=\tikz@math@value%
- \let\tikz@math@next=\tikz@math@for@doloop%
- \fi%
- \tikz@math@next%
-}
+ \tikz@math@for@namegetvalue{prevvalue}{\tikz@math@prevvalue}%
+ \tikz@math@for@namegetvalue{step}{\tikz@math@step}%
+ \tikz@math@for@namegetvalue{comparitor}{\tikz@math@comparitor}%
+ \tikz@math@for@namegetvalue{endvalue}{\tikz@math@endvalue}%
+ \tikz@math@dimen=\tikz@math@prevvalue pt\relax%
+ \advance\tikz@math@dimen by\tikz@math@step\relax%
+ \ifdim\tikz@math@dimen\tikz@math@comparitor\tikz@math@endvalue pt\relax%
+ \let\tikz@math@next=\tikz@math@for@endloop%
+ \else%
+ \tikz@math@for@nameedef{value}{\pgfmath@tonumber{\tikz@math@dimen}}%
+ \tikz@math@for@namegetvalue{var}{\tikz@math@var}%
+ \expandafter\tikz@math@getvarstring\expandafter{\tikz@math@var}\tikz@math@varstring%
+ \tikz@math@for@namegetvalue{index}{\tikz@math@current@index}%
+ \tikz@math@for@namegetvalue{action}{\tikz@math@action}%
+ \tikz@math@for@namegetvalue{value}{\tikz@math@value}%
+ \expandafter\expandafter\expandafter\tikz@math@doassignment\expandafter\expandafter\expandafter%
+ {\expandafter\tikz@math@var\expandafter}\expandafter{\tikz@math@value}%
+ \tikz@math@for@namegetvalue{execute}{\tikz@math@execute}%
+ \expandafter\tikz@math@execute\expandafter{\tikz@math@action}%
+ \tikz@math@for@namegetvalue{prevvalue}{\tikz@math@prevvalue}%
+ \tikz@math@for@namelet{prevprevvalue}=\tikz@math@prevvalue%
+ \tikz@math@for@namegetvalue{value}{\tikz@math@value}%
+ \tikz@math@for@namelet{prevvalue}=\tikz@math@value%
+ \let\tikz@math@next=\tikz@math@for@doloop%
+ \fi%
+ \tikz@math@next%
+}%
\def\tikz@math@for@endloop{%
-\tikz@math@for@scan}
+\tikz@math@for@scan}%
@@ -635,90 +641,90 @@
\def\tikz@math@for@scan@end#1\tikz@@math{%
\tikz@math@for@namegetvalue{finished}{\tikz@math@next}%
\advance\tikz@math@for@depth by-1\relax%
-\tikz@math@next}
+\tikz@math@next}%
\def\tikz@math@process@keyword@return{%
- \tikz@math@collecttosemicolon{\pgfmathparse{\tikz@math@collected}\tikz@math@parse}}
+ \tikz@math@collecttosemicolon{\pgfmathparse{\tikz@math@collected}\tikz@math@parse}}%
-\def\tikz@math@process@keyword@function{\tikz@math@collecttosemicolon{\tikz@math@process@keyword@@function}}
+\def\tikz@math@process@keyword@function{\tikz@math@collecttosemicolon{\tikz@math@process@keyword@@function}}%
\def\tikz@math@process@keyword@@function{%
- \let\tikz@math@function@name=\pgfutil@empty%
- \let\tikz@math@function@arguments=\pgfutil@empty%
- \let\tikz@math@function@body=\pgfutil@empty%
- \expandafter\expandafter\expandafter\tikz@math@@declarefunction\expandafter\tikz@math@collected\tikz@math@semicolon%
-}
+ \let\tikz@math@function@name=\pgfutil@empty%
+ \let\tikz@math@function@arguments=\pgfutil@empty%
+ \let\tikz@math@function@body=\pgfutil@empty%
+ \expandafter\expandafter\expandafter\tikz@math@@declarefunction\expandafter\tikz@math@collected\tikz@math@semicolon%
+}%
\def\tikz@math@@declarefunction{%
- \pgfutil@ifnextchar\bgroup\tikz@math@@@collectbody\tikz@math@@@declarefunction}
+ \pgfutil@ifnextchar\bgroup\tikz@math@@@collectbody\tikz@math@@@declarefunction}%
\def\tikz@math@@@declarefunction#1{%
- \if#1(%)
- \let\tikz@math@next=\tikz@math@@@collectarguments%
- \else%
- \expandafter\def\expandafter\tikz@math@function@name\expandafter{\tikz@math@function@name#1}%
- \let\tikz@math@next=\tikz@math@@declarefunction%
- \fi%
- \tikz@math@next%
-}
+ \if#1(%)
+ \let\tikz@math@next=\tikz@math@@@collectarguments%
+ \else%
+ \expandafter\def\expandafter\tikz@math@function@name\expandafter{\tikz@math@function@name#1}%
+ \let\tikz@math@next=\tikz@math@@declarefunction%
+ \fi%
+ \tikz@math@next%
+}%
\def\tikz@math@@@collectarguments#1){%
- \def\tikz@math@function@arguments{#1}%
- \tikz@math@@declarefunction%
-}
+ \def\tikz@math@function@arguments{#1}%
+ \tikz@math@@declarefunction%
+}%
\newtoks\tikz@math@toks
-\tikz@math@toks={#}
-\edef\tikz@math@char@hash{\the\tikz@math@toks}
-\tikz@math@toks={}
+\tikz@math@toks={#}%
+\edef\tikz@math@char@hash{\the\tikz@math@toks}%
+\tikz@math@toks={}%
-\def\tikz@math@@@collectbody{\tikz@math@collecttosemicolon{\tikz@math@@@@collectbody}}
+\def\tikz@math@@@collectbody{\tikz@math@collecttosemicolon{\tikz@math@@@@collectbody}}%
\def\tikz@math@@@@collectbody{%
- \tikz@math@toks={}%
- \c@pgf@counta=0\relax%
- \ifx\tikz@math@function@arguments\pgfutil@empty%
- \else%
- \expandafter\tikz@math@createargumentlist\tikz@math@function@arguments,,%
- \expandafter\tikz@math@addto@toks\expandafter{\tikz@math@collected}%
- \fi%
- \edef\tikz@math@local@temp{%
- \noexpand\pgfmathdeclarefunction{\tikz@math@function@name}{\the\c@pgf@counta}%
- {\noexpand\def\noexpand\return{0}\noexpand\tikz@math{\the\tikz@math@toks}}%
- }%
- \tikz@math@local@temp
- \tikz@math@parse%
-}
+ \tikz@math@toks={}%
+ \c@pgf@counta=0\relax%
+ \ifx\tikz@math@function@arguments\pgfutil@empty%
+ \else%
+ \expandafter\tikz@math@createargumentlist\tikz@math@function@arguments,,%
+ \expandafter\tikz@math@addto@toks\expandafter{\tikz@math@collected}%
+ \fi%
+ \edef\tikz@math@local@temp{%
+ \noexpand\pgfmathdeclarefunction{\tikz@math@function@name}{\the\c@pgf@counta}%
+ {\noexpand\def\noexpand\return{0}\noexpand\tikz@math{\the\tikz@math@toks}}%
+ }%
+ \tikz@math@local@temp
+ \tikz@math@parse%
+}%
\def\tikz@math@addto@toks#1{%
- \expandafter\tikz@math@toks\expandafter{\the\tikz@math@toks#1}}
+ \expandafter\tikz@math@toks\expandafter{\the\tikz@math@toks#1}}%
\def\tikz@math@createargumentlist{%
- \pgfutil@ifnextchar
- x\tikz@math@@createargumentlist\tikz@math@@createargumentlist}
+ \pgfutil@ifnextchar
+ x\tikz@math@@createargumentlist\tikz@math@@createargumentlist}%
-\def\tikz@math@comma{,}
+\def\tikz@math@comma{,}%
\def\tikz@math@@createargumentlist#1,{%
- \def\tikz@math@tmp{#1}%
- \ifx\tikz@math@tmp\pgfutil@empty%
- \let\tikz@math@next=\relax%
- \else%
- \advance\c@pgf@counta by1\relax%
- \tikz@math@addto@toks{#1=}%
- \expandafter\expandafter\expandafter\tikz@math@addto@toks\expandafter\expandafter\expandafter%
- {\expandafter\tikz@math@char@hash\the\c@pgf@counta;}%
- \let\tikz@math@next=\tikz@math@createargumentlist%
- \fi%
- \tikz@math@next%
-}
+ \def\tikz@math@tmp{#1}%
+ \ifx\tikz@math@tmp\pgfutil@empty%
+ \let\tikz@math@next=\relax%
+ \else%
+ \advance\c@pgf@counta by1\relax%
+ \tikz@math@addto@toks{#1=}%
+ \expandafter\expandafter\expandafter\tikz@math@addto@toks\expandafter\expandafter\expandafter%
+ {\expandafter\tikz@math@char@hash\the\c@pgf@counta;}%
+ \let\tikz@math@next=\tikz@math@createargumentlist%
+ \fi%
+ \tikz@math@next%
+}%
\let\tikzmath=\tikz@math
-\tikzset{evaluate/.code={\tikz@math{#1}}}
+\tikzset{evaluate/.code={\tikz@math{#1}}}%
\let\tikzmathfor=\tikz@math@for@external
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 eb2d65a33fc..90894ff206d 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,29 +7,29 @@
%
% 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.4 2013/07/12 22:01:58 tantau Exp $
+\ProvidesFileRCS{tikzlibrarymatrix.code.tex}
% A matrix of nodes contains a node in each cell.
-\tikzstyle{matrix of nodes}=[%
+\tikzset{matrix of nodes/.style={%
matrix,%
cells={anchor=base},%
execute at begin cell=\tikz@lib@matrix@start@cell,%
execute at end cell=\tikz@lib@matrix@end@cell,%
execute at empty cell=\tikz@lib@matrix@empty@cell,
execute at begin matrix=\iftikz@handle@active@code\tikz@orig@shorthands\fi,%
-]
+}}%
-\def\tikz@lib@matrix@empty@cell{\iftikz@lib@matrix@empty\node[name=\tikzmatrixname-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn]{};\fi}
+\def\tikz@lib@matrix@empty@cell{\iftikz@lib@matrix@empty\node[name=\tikzmatrixname-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn]{};\fi}%
\newif\iftikz@lib@matrix@plain
\def\tikz@lib@matrix@start@cell{%
- \pgfutil@ifnextchar|{\tikz@lib@matrix@with@options}{\tikz@lib@matrix@normal@start@cell}}
+ \pgfutil@ifnextchar|{\tikz@lib@matrix@with@options}{\tikz@lib@matrix@normal@start@cell}}%
\def\tikz@lib@matrix@with@options|#1|{\tikz@lib@matrix@plainfalse\node%
- [name=\tikzmatrixname-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn]#1\bgroup\tikz@lib@matrix@startup}
+ [name=\tikzmatrixname-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn]#1\bgroup\tikz@lib@matrix@startup}%
\def\tikz@lib@matrix@normal@start@cell{\pgfutil@ifnextchar\let{\tikz@lib@matrix@check}{\tikz@lib@matrix@plainfalse\node
@@ -38,14 +38,14 @@
\def\tikz@lib@matrix@check#1{% evil hackery to find out about start of path
\pgfutil@ifnextchar\tikz@signal@path{\tikz@lib@matrix@plaintrue\let}{\tikz@lib@matrix@plainfalse\node
[name=\tikzmatrixname-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn]\bgroup\tikz@lib@matrix@startup\let}%
-}
-
+}%
+
\def\tikz@lib@matrix@end@cell{%
\iftikz@lib@matrix@plain%
\else%
\expandafter\egroup\expandafter;%
- \fi%
-}
+ \fi%
+}%
\def\tikz@lib@matrix@startup{%
\pgfutil@ifnextchar\bgroup{%
@@ -56,28 +56,28 @@
\afterassignment\tikz@lib@matrix@smuggle%
\let\tikz@next}
{\let\\=\pgfmatrixendrow}%
-}
+}%
\def\tikz@lib@matrix@smuggle{%
\bgroup%
\let\\=\tikz@lib@matrix@saved@eol%
-}
+}%
% Fill empty nodes in a matrix of nodes
\newif\iftikz@lib@matrix@empty
-\tikzoption{nodes in empty cells}[true]{\csname tikz@lib@matrix@empty#1\endcsname}
+\tikzoption{nodes in empty cells}[true]{\csname tikz@lib@matrix@empty#1\endcsname}%
% Same as a matrix of nodes, but switch on math mode in each cell
-\tikzstyle{matrix of math nodes}=[%
+\tikzset{matrix of math nodes/.style={%
matrix of nodes,
nodes={%
execute at begin node=$,%
execute at end node=$%
}%
-]
+}}%
@@ -91,7 +91,7 @@
{north}%
{#1}%
{.}%
- {\pgf@y}}}}
+ {\pgf@y}}}}%
\tikzoption{right delimiter}{\tikzset{append after command={\tikz@delimiter%
{south west}%
@@ -101,7 +101,7 @@
{north}%
{.}%
{#1}%
- {\pgf@y}}}}
+ {\pgf@y}}}}%
\tikzoption{above delimiter}{\tikzset{append after command={\tikz@delimiter%
{south east}%
@@ -111,7 +111,7 @@
{east}%
{#1}%
{.}%
- {\pgf@x}}}}
+ {\pgf@x}}}}%
\tikzoption{below delimiter}{\tikzset{append after command={\tikz@delimiter%
{south west}%
@@ -121,7 +121,7 @@
{east}%
{.}%
{#1}%
- {\pgf@x}}}}
+ {\pgf@x}}}}%
\def\tikz@delimiter#1#2#3#4#5#6#7#8{%
\bgroup
@@ -133,12 +133,12 @@
}
\pgfextra{\global\let\tikz@last@fig@name=\tikz@save@last@fig@name}%
\egroup%
-}
+}%
-\tikzstyle{every delimiter}=[]
-\tikzstyle{every left delimiter}=[]
-\tikzstyle{every right delimiter}=[]
-\tikzstyle{every above delimiter}=[]
-\tikzstyle{every below delimiter}=[]
+\tikzset{every delimiter/.style={}}%
+\tikzset{every left delimiter/.style={}}%
+\tikzset{every right delimiter/.style={}}%
+\tikzset{every above delimiter/.style={}}%
+\tikzset{every below delimiter/.style={}}%
\endinput
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 4b6a952ac13..4dc97d1aacf 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,10 +7,10 @@
%
% 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.10 2013/07/16 12:43:14 tantau Exp $
+\ProvidesFileRCS{tikzlibrarymindmap.code.tex}
-\usetikzlibrary{trees,decorations}
+\usetikzlibrary{trees,decorations}%
% A decoration for connecting circle nodes
@@ -18,7 +18,7 @@
% Parameters: start radius, end radius, amplitude, angle
\pgfdeclaredecoration{circle connection bar}{initial}
-{
+{%
\state{initial}[width=0pt,next state=bar]
{
{
@@ -46,7 +46,7 @@
{\pgfpointpolar{\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/start radius}}}
\pgfpathclose
}
- }
+ }%
\state{bar}[width=0pt,next state=end]
{
\pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/decoration/start radius}}%
@@ -55,7 +55,7 @@
\pgfpathrectangle
{\pgfqpoint{.5\pgfutil@tempdima}{-.5\pgf@xc}}
{\pgfpoint{\pgfdecoratedremainingdistance+-.5\pgfutil@tempdimb+-.5\pgfutil@tempdima}{\pgf@xc}}
- }
+ }%
\state{end}[width=0pt,next state=final]
{
{
@@ -85,19 +85,19 @@
{\pgfpointpolar{\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/end radius}}}
\pgfpathclose
}
- }
+ }%
\state{final}
- {}
-}
+ {}%
+}%
-\pgfkeys{/pgf/decoration/angle=20}
+\pgfkeys{/pgf/decoration/angle=20}%
% To paths for connecting circle nodes
-\tikzstyle{circle connection bar}=
-[to path={
+\tikzset{circle connection bar/.style=
+{to path={
\pgfextra{%
\tikz@lib@mindmap@check{\tikztostart}%
\tikz@compute@circle@radii\tikz@compute@segmentamplitude%
@@ -107,8 +107,8 @@
{ -- (\tikztotarget) \tikztonodes}
},
append after command={[fill=\tikz@concept@color,draw=none]}
-]
-\tikzstyle{every circle connection bar}=[]
+}}%
+\tikzset{every circle connection bar/.style={}}%
\def\tikz@compute@circle@radii{%
\pgf@process{\pgfpointtransformed{\pgfpointanchor{\tikztostart}{center}}}%
@@ -121,7 +121,7 @@ append after command={[fill=\tikz@concept@color,draw=none]}
\pgf@process{\pgfpointtransformed{\pgfpointanchor{\tikztotarget}{west}}}%
\advance\pgf@xa by-\pgf@x%
\pgfkeys{/pgf/decoration/end radius/.expanded=\the\pgf@xa}%
-}
+}%
\def\tikz@compute@segmentamplitude{%
\pgf@x=\pgfkeysvalueof{/pgf/decoration/start radius}\relax%
\ifdim\pgf@x>\pgfkeysvalueof{/pgf/decoration/end radius}\relax%
@@ -129,7 +129,7 @@ append after command={[fill=\tikz@concept@color,draw=none]}
\fi%
\pgf@x=.175\pgf@x\relax%
\edef\pgfdecorationsegmentamplitude{\the\pgf@x}%
-}
+}%
@@ -137,7 +137,7 @@ append after command={[fill=\tikz@concept@color,draw=none]}
\def\tikz@lib@mindmap@check#1{%
\pgfutil@ifundefined{pgf@sh@ns@#1}%
- {\tikzerror{You are attempting to connect two things by a circle
+ {\tikzerror{You are attempting to connect two things by a circle
connection bar where one is not a node}}{%
\expandafter\ifx\csname pgf@sh@ns@#1\endcsname\tikz@lib@coordinate@text%
\tikzerror{You are attempting to connect node of shape
@@ -145,14 +145,14 @@ append after command={[fill=\tikz@concept@color,draw=none]}
'circle' or something similar, instead.}
\fi%
}
-}
+}%
-\def\tikz@lib@coordinate@text{coordinate}
+\def\tikz@lib@coordinate@text{coordinate}%
% Switch color in a mindmap
-\tikzoption{circle connection bar switch color}{\tikz@parse@switch#1\pgf@unique}
+\tikzoption{circle connection bar switch color}{\tikz@parse@switch#1\pgf@unique}%
\def\tikz@parse@switch from (#1) to (#2)\pgf@unique{%
\tikzset{to path={%
\pgfextra{%
@@ -167,7 +167,7 @@ append after command={[fill=\tikz@concept@color,draw=none]}
}%
[every circle connection bar]
decorate [decoration=circle connection bar]
- { -- (\tikztotarget) \tikztonodes}
+ { -- (\tikztotarget) \tikztonodes}
},
append after command={
[fill=none,draw=none,path picture=\tikz@lib@shade@pic]
@@ -176,7 +176,7 @@ append after command={[fill=\tikz@concept@color,draw=none]}
\pgfutil@colorlet{tikz@switch@to}{#2}%
}}
}
-}
+}%
\def\tikz@lib@shade@pic{%
% We have to draw the shading...
@@ -234,7 +234,7 @@ append after command={[fill=\tikz@concept@color,draw=none]}
\pgftransformxshift{50bp}
\pgflowlevelsynccm%
\pgfuseshading{tikz@shade@bar}
-}
+}%
\tikzoption{concept color}{%
\let\tikz@old@concept@color=\tikz@concept@color%
@@ -243,73 +243,73 @@ append after command={[fill=\tikz@concept@color,draw=none]}
to[circle connection bar switch color=from (\tikz@old@concept@color) to (#1)]
(\tikzchildnode)}
\def\tikz@concept@color{#1}%
-}
+}%
\pgfdeclarehorizontalshading[tikz@switch@from,tikz@switch@to]{tikz@shade@bar}{100bp}{%
color(0pt)=(tikz@switch@from);
- color(100bp)=(tikz@switch@to)}
+ color(100bp)=(tikz@switch@to)}%
% A concept node
-\tikzstyle{concept}= [circle,fill=\tikz@concept@color,draw=\tikz@concept@color,every concept]
-\tikzstyle{every concept}= []
+\tikzset{concept/.style= {circle,fill=\tikz@concept@color,draw=\tikz@concept@color,every concept}}%
+\tikzset{every concept/.style= {}}%
-\def\tikz@concept@color{black}
+\def\tikz@concept@color{black}%
-\tikzstyle{tikz@concept@setting}=[edge from parent path={(\tikzparentnode) to [circle connection bar] (\tikzchildnode)}]
-\tikzstyle{tikz@concept@color@set}=[]
+\tikzset{tikz@concept@setting/.style={edge from parent path={(\tikzparentnode) to [circle connection bar] (\tikzchildnode)}}}%
+\tikzset{tikz@concept@color@set/.style={}}%
-\tikzstyle{extra concept}= [concept color=black!50,level 2 concept,concept,every extra concept]
-\tikzstyle{every extra concept}=[]
+\tikzset{extra concept/.style= {concept color=black!50,level 2 concept,concept,every extra concept}}%
+\tikzset{every extra concept/.style={}}%
-\tikzstyle{concept connection}=[line width=1mm,shorten <=2mm,shorten >=2mm,cap=round,draw=black!50]
+\tikzset{concept connection/.style={line width=1mm,shorten <=2mm,shorten >=2mm,cap=round,draw=black!50}}%
% A mindmap
-\tikzstyle{mindmap}=
- [fill,draw,very thick,outer sep=0pt,inner sep=1pt,%
+\tikzset{mindmap/.style=
+ {fill,draw,very thick,outer sep=0pt,inner sep=1pt,%
every child/.append style={style=tikz@concept@setting,style=tikz@concept@color@set},%
root concept,
level 1/.append style={level 1 concept},
level 2/.append style={level 2 concept},
level 3/.append style={level 3 concept},
level 4/.append style={level 4 concept},
- text centered,%
+ text centered,%
segment angle=20,
style=every mindmap,
- ]
-\tikzstyle{every mindmap}=[]
-
-
-\tikzstyle{root concept}= [minimum size=4cm,text width=3.5cm,font=\pgfutil@font@large]
-\tikzstyle{level 1 concept}=[minimum size=2.25cm,
- level distance=5cm,
- text width=2cm,
- sibling angle=60,
- font=\pgfutil@font@small]
-\tikzstyle{level 2 concept}=[minimum size=1.75cm,%
- level distance=2.9cm,%
- text width=1.5cm,%
- sibling angle=60,%
- font=\pgfutil@font@footnotesize]
-\tikzstyle{level 3 concept}=[minimum size=1.15cm,%
- text width=1cm,%
- level distance=2.4cm,%
- sibling angle=30,%
- font=\pgfutil@font@tiny]
-\tikzstyle{level 4 concept}=[minimum size=0.9cm,%
- text width=0.7cm,
- level distance=1.85cm,%
- sibling angle=30,%
- font=\pgfutil@font@tiny]
-
-\tikzstyle{small mindmap}=
- [%
+ }}%
+\tikzset{every mindmap/.style={}}%
+
+
+\tikzset{root concept/.style= {minimum size=4cm,text width=3.5cm,font=\pgfutil@font@large}}%
+\tikzset{level 1 concept/.style={minimum size=2.25cm,
+ level distance=5cm,
+ text width=2cm,
+ sibling angle=60,
+ font=\pgfutil@font@small}}%
+\tikzset{level 2 concept/.style={minimum size=1.75cm,%
+ level distance=2.9cm,%
+ text width=1.5cm,%
+ sibling angle=60,%
+ font=\pgfutil@font@footnotesize}}%
+\tikzset{level 3 concept/.style={minimum size=1.15cm,%
+ text width=1cm,%
+ level distance=2.4cm,%
+ sibling angle=30,%
+ font=\pgfutil@font@tiny}}%
+\tikzset{level 4 concept/.style={minimum size=0.9cm,%
+ text width=0.7cm,
+ level distance=1.85cm,%
+ sibling angle=30,%
+ font=\pgfutil@font@tiny}}%
+
+\tikzset{small mindmap/.style=
+ {%
root concept/.style={minimum size=2.3cm,text width=2.1cm,font=\pgfutil@font@footnotesize},
level 1 concept/.style={%
minimum size=1.5cm,
@@ -324,18 +324,18 @@ append after command={[fill=\tikz@concept@color,draw=none]}
sibling angle=60,%
font=\pgfutil@font@tiny},%
level 3 concept/.style={%
- level 2 concept,
+ level 2 concept,
sibling angle=30,%
font=\pgfutil@font@tiny},%
level 4 concept/.style={%
- level 3 concept,
+ level 3 concept,
},
mindmap,%
- line width=2pt
- ]
-
-\tikzstyle{large mindmap}=
- [%
+ line width=2pt,
+ }}%
+
+\tikzset{large mindmap/.style=
+ {%
root concept/.style={minimum size=5.6cm,text width=4.5cm,font=\pgfutil@font@Large},
level 1 concept/.style={%
minimum size=3.2cm,
@@ -363,11 +363,11 @@ append after command={[fill=\tikz@concept@color,draw=none]}
sibling angle=30,%
font=\pgfutil@font@tiny},%
mindmap,%
- line width=2pt
- ]
-
-\tikzstyle{huge mindmap}=
- [%
+ line width=2pt,
+ }}%
+
+\tikzset{huge mindmap/.style=
+ {%
root concept/.style={minimum size=8cm,text width=7cm,font=\pgfutil@font@huge},
level 1 concept/.style={%
minimum size=4.5cm,
@@ -395,24 +395,23 @@ append after command={[fill=\tikz@concept@color,draw=none]}
sibling angle=30,%
font=\pgfutil@font@scriptsize},%
mindmap,%
- line width=3pt
- ]
-
+ line width=3pt,
+ }}%
+
% Annotations
-\tikzstyle{annotation}=[shape=rectangle,
- minimum size=0pt,
- text width=3.5cm,
- outer sep=1.5mm,
- inner sep=1mm,
- text badly ragged,
- rounded corners,
- font=\pgfutil@font@tiny,
- every annotation]
-\tikzstyle{every annotation}=[]
+\tikzset{annotation/.style={shape=rectangle,
+ minimum size=0pt,
+ text width=3.5cm,
+ outer sep=1.5mm,
+ inner sep=1mm,
+ text badly ragged,
+ rounded corners,
+ font=\pgfutil@font@tiny,
+ every annotation}}%
+\tikzset{every annotation/.style={}}%
\endinput
-
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex
index b6a0d3c9931..22ce51d8cbd 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex
@@ -7,11 +7,11 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.code.tex,v 1.2 2008/01/15 10:27:34 tantau Exp $
+\ProvidesFileRCS{tikzlibrarypatterns.code.tex}
-\usepgflibrary{patterns}
+\usepgflibrary{patterns}%
-\tikzoption{pattern color}{\edef\tikz@pattern@color{#1}}
+\tikzoption{pattern color}{\edef\tikz@pattern@color{#1}}%
\tikzoption{pattern}[]{%
\edef\tikz@temp{#1}%
\ifx\tikz@temp\tikz@nonetext%
@@ -24,8 +24,8 @@
\fi%
\tikz@addmode{\tikz@mode@filltrue}%
\fi%
-}
-\def\tikz@pattern@color{black}
-\def\tikz@pattern{dots}
+}%
+\def\tikz@pattern@color{black}%
+\def\tikz@pattern{dots}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.meta.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.meta.code.tex
index 6f8ec32f888..3b52136f708 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.meta.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarypatterns.meta.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgflibrary{patterns.meta}
+\usepgflibrary{patterns.meta}%
\tikzset{%
pattern color/.code=\edef\tikz@pattern@color{#1},
@@ -15,7 +15,7 @@
\edef\tikz@temp{#1}%
\ifx\tikz@temp\tikz@nonetext%
\tikz@addmode{\tikz@mode@fillfalse}%
- \else%
+ \else%
\ifx\tikz@temp\pgfutil@empty%
\else%
\tikz@addoption{\pgfsetfillpattern{#1}{\tikz@pattern@color}}%
@@ -24,14 +24,14 @@
\tikz@addmode{\tikz@mode@filltrue}%
\fi%
}
-}
+}%
-\def\tikz@pattern@color{black}
-\def\tikz@pattern{}
+\def\tikz@pattern@color{black}%
+\def\tikz@pattern{}%
\tikzset{patterns/.cd,
.unknown/.code={%
- \let\tikz@pat@key=\pgfkeyscurrentname%
+ \let\tikz@pat@key=\pgfkeyscurrentname%
\pgfkeys{/pgf/patterns/\tikz@pat@key/.try={#1}}%
},
bottom left/.style={/pgf/patterns/bottom left={\tikz@scan@one@point\pgf@pat@process#1}},
@@ -52,13 +52,13 @@
(\the\pgf@picmaxx+#1,\the\pgf@picmaxy+#1)
},
/tikz/patterns/tile size={%
- (\the\pgf@picmaxx-\the\pgf@picminx,
+ (\the\pgf@picmaxx-\the\pgf@picminx,
\the\pgf@picmaxy-\the\pgf@picminy)}}}%
}%
\let\pgf@pat@declarepost=\tikz@pat@installbb%
},
infer tile bounding box/.default=0pt,
-}
+}%
\def\tikzdeclarepattern#1{%
\begingroup%
@@ -78,18 +78,18 @@
}%
\pgfdeclarepattern{/tikz/patterns/.cd, #1}%
\endgroup%
- }
-
+ }%
+
\def\tikz@declarepattern@install{%
\let\tikz@compat@color@set=\tikz@compat@color@set@insidepatttern%
\tikz@installcommands%
-}
+}%
\let\tikz@compat@color@set@orig=\tikz@compat@color@set
\def\tikz@compat@color@set@insidepatttern#1{%
\tikz@compat@color@set@orig{#1}%
\pgfsetfillcolor{#1}\pgfsetstrokecolor{#1}%
-}
+}%
%%% Local Variables:
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 e67027eadfb..7241394d804 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,60 +7,60 @@
%
% 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.3 2013/07/17 08:56:23 tantau Exp $
+\ProvidesFileRCS{tikzlibrarypetri.code.tex}
% Styles for places:
-\tikzstyle{every place}= []
-\tikzstyle{place}= [circle,draw,inner sep=0pt,
- minimum size=5ex,
- every place]
+\tikzset{every place/.style= {}}%
+\tikzset{place/.style= {circle,draw,inner sep=0pt,
+ minimum size=5ex,
+ every place}}%
% Styles for transition:
-\tikzstyle{every transition}= []
-\tikzstyle{transition}= [rectangle,draw,inner sep=0pt,
- minimum size=4mm,
- every transition]
+\tikzset{every transition/.style= {}}%
+\tikzset{transition/.style= {rectangle,draw,inner sep=0pt,
+ minimum size=4mm,
+ every transition}}%
% Styles for relationship types:
-\tikzstyle{pre}= [<-,shorten <=1pt]
-\tikzstyle{post}= [->,shorten >=1pt]
-\tikzstyle{pre and post}= [<->,shorten >=1pt,shorten <=1pt]
+\tikzset{pre/.style= {<-,shorten <=1pt}}%
+\tikzset{post/.style= {->,shorten >=1pt}}%
+\tikzset{pre and post/.style= {<->,shorten >=1pt,shorten <=1pt}}%
% Styles for marks:
-\tikzstyle{every token}= []
-\tikzstyle{token}= [fill=black,draw=none,circle,
- inner sep=0.5pt,minimum size=1ex,
- text=white,font=\pgfutil@font@tiny,every token]
+\tikzset{every token/.style= {}}%
+\tikzset{token/.style= {fill=black,draw=none,circle,
+ inner sep=0.5pt,minimum size=1ex,
+ text=white,font=\pgfutil@font@tiny,every token}}%
-\tikzoption{token distance}{\def\tikz@token@distance{#1}}
-\def\tikz@token@distance{1.5ex}
+\tikzoption{token distance}{\def\tikz@token@distance{#1}}%
+\def\tikz@token@distance{1.5ex}%
-\tikzstyle{children are tokens}= [growth function=\tikz@grow@tokens,edge from parent path=]
+\tikzset{children are tokens/.style= {growth function=\tikz@grow@tokens,edge from parent path=}}%
\tikzoption{tokens}{%
\ifnum#1>0\relax%
\tikzset{append after command={}
{[children are tokens]child foreach \tikz@dummy in {1,...,#1} {node[token]{}}}}%
- \fi}
+ \fi}%
\tikzoption{colored tokens}{%
\tikzset{append after command={}%
{[children are tokens]child foreach \tikz@child@color in {#1} {node[token,\tikz@child@color]{}}}}%
- }
+ }%
\tikzoption{structured tokens}{%
\tikzset{append after command={}%
{[children are tokens]child foreach \tikzpetrichildname in {#1} {node[token]{\tikzpetrichildname}}}}%
- }
+ }%
\def\tikz@grow@tokens{%
@@ -70,77 +70,77 @@
\pgf@yc=0pt%
\csname tikz@grow@tokens@placer@\the\tikznumberofchildren @\the\tikznumberofcurrentchild\endcsname%
\pgftransformshift{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
-}
+}%
\def\tikz@def@grow@tokens#1#2#3#4{%
\expandafter\def\csname tikz@grow@tokens@placer@#1@#2\endcsname{%
\pgf@xc=#3\pgf@xa%
\pgf@yc=#4\pgf@ya}%
-}
+}%
% Single token
-\tikz@def@grow@tokens{1}{1}{0}{0}
+\tikz@def@grow@tokens{1}{1}{0}{0}%
% Two tokens
-\tikz@def@grow@tokens{2}{1}{-.5}{0}
-\tikz@def@grow@tokens{2}{2}{.5}{0}
+\tikz@def@grow@tokens{2}{1}{-.5}{0}%
+\tikz@def@grow@tokens{2}{2}{.5}{0}%
% Three tokens
-\tikz@def@grow@tokens{3}{1}{0} {0.57}
-\tikz@def@grow@tokens{3}{2}{-.5}{-.306025}
-\tikz@def@grow@tokens{3}{3}{.5} {-.306025}
+\tikz@def@grow@tokens{3}{1}{0} {0.57}%
+\tikz@def@grow@tokens{3}{2}{-.5}{-.306025}%
+\tikz@def@grow@tokens{3}{3}{.5} {-.306025}%
% Four tokens
-\tikz@def@grow@tokens{4}{1}{-.5}{.5}
-\tikz@def@grow@tokens{4}{2}{.5}{.5}
-\tikz@def@grow@tokens{4}{3}{-.5}{-.5}
-\tikz@def@grow@tokens{4}{4}{.5}{-.5}
+\tikz@def@grow@tokens{4}{1}{-.5}{.5}%
+\tikz@def@grow@tokens{4}{2}{.5}{.5}%
+\tikz@def@grow@tokens{4}{3}{-.5}{-.5}%
+\tikz@def@grow@tokens{4}{4}{.5}{-.5}%
% Five tokens
-\tikz@def@grow@tokens{5}{1}{0}{.85}
-\tikz@def@grow@tokens{5}{2}{-0.808398}{0.26266}
-\tikz@def@grow@tokens{5}{3}{0.808398}{0.26266}
-\tikz@def@grow@tokens{5}{4}{-0.499617}{-0.687664}
-\tikz@def@grow@tokens{5}{5}{0.499617}{-0.687664}
+\tikz@def@grow@tokens{5}{1}{0}{.85}%
+\tikz@def@grow@tokens{5}{2}{-0.808398}{0.26266}%
+\tikz@def@grow@tokens{5}{3}{0.808398}{0.26266}%
+\tikz@def@grow@tokens{5}{4}{-0.499617}{-0.687664}%
+\tikz@def@grow@tokens{5}{5}{0.499617}{-0.687664}%
% Six tokens
-\tikz@def@grow@tokens{6}{1}{-1}{.5}
-\tikz@def@grow@tokens{6}{2}{0}{.5}
-\tikz@def@grow@tokens{6}{3}{1}{.5}
-\tikz@def@grow@tokens{6}{4}{-1}{-.5}
-\tikz@def@grow@tokens{6}{5}{0}{-.5}
-\tikz@def@grow@tokens{6}{6}{1}{-.5}
+\tikz@def@grow@tokens{6}{1}{-1}{.5}%
+\tikz@def@grow@tokens{6}{2}{0}{.5}%
+\tikz@def@grow@tokens{6}{3}{1}{.5}%
+\tikz@def@grow@tokens{6}{4}{-1}{-.5}%
+\tikz@def@grow@tokens{6}{5}{0}{-.5}%
+\tikz@def@grow@tokens{6}{6}{1}{-.5}%
% Seven tokens
-\tikz@def@grow@tokens{7}{1}{0}{1}
-\tikz@def@grow@tokens{7}{2}{-1}{.5}
-\tikz@def@grow@tokens{7}{3}{0}{0}
-\tikz@def@grow@tokens{7}{4}{1}{.5}
-\tikz@def@grow@tokens{7}{5}{-1}{-.5}
-\tikz@def@grow@tokens{7}{6}{0}{-1}
-\tikz@def@grow@tokens{7}{7}{1}{-.5}
+\tikz@def@grow@tokens{7}{1}{0}{1}%
+\tikz@def@grow@tokens{7}{2}{-1}{.5}%
+\tikz@def@grow@tokens{7}{3}{0}{0}%
+\tikz@def@grow@tokens{7}{4}{1}{.5}%
+\tikz@def@grow@tokens{7}{5}{-1}{-.5}%
+\tikz@def@grow@tokens{7}{6}{0}{-1}%
+\tikz@def@grow@tokens{7}{7}{1}{-.5}%
% Eight tokens
-\tikz@def@grow@tokens{8}{1}{-.5}{1}
-\tikz@def@grow@tokens{8}{2}{.5}{1}
-\tikz@def@grow@tokens{8}{3}{-1}{0}
-\tikz@def@grow@tokens{8}{4}{0}{0}
-\tikz@def@grow@tokens{8}{5}{1}{0}
-\tikz@def@grow@tokens{8}{6}{-1}{-1}
-\tikz@def@grow@tokens{8}{7}{0}{-1}
-\tikz@def@grow@tokens{8}{8}{1}{-1}
+\tikz@def@grow@tokens{8}{1}{-.5}{1}%
+\tikz@def@grow@tokens{8}{2}{.5}{1}%
+\tikz@def@grow@tokens{8}{3}{-1}{0}%
+\tikz@def@grow@tokens{8}{4}{0}{0}%
+\tikz@def@grow@tokens{8}{5}{1}{0}%
+\tikz@def@grow@tokens{8}{6}{-1}{-1}%
+\tikz@def@grow@tokens{8}{7}{0}{-1}%
+\tikz@def@grow@tokens{8}{8}{1}{-1}%
% Eight tokens
-\tikz@def@grow@tokens{9}{1}{-1}{1}
-\tikz@def@grow@tokens{9}{2}{0}{1}
-\tikz@def@grow@tokens{9}{3}{1}{1}
-\tikz@def@grow@tokens{9}{4}{-1}{0}
-\tikz@def@grow@tokens{9}{5}{0}{0}
-\tikz@def@grow@tokens{9}{6}{1}{0}
-\tikz@def@grow@tokens{9}{7}{-1}{-1}
-\tikz@def@grow@tokens{9}{8}{0}{-1}
-\tikz@def@grow@tokens{9}{9}{1}{-1}
+\tikz@def@grow@tokens{9}{1}{-1}{1}%
+\tikz@def@grow@tokens{9}{2}{0}{1}%
+\tikz@def@grow@tokens{9}{3}{1}{1}%
+\tikz@def@grow@tokens{9}{4}{-1}{0}%
+\tikz@def@grow@tokens{9}{5}{0}{0}%
+\tikz@def@grow@tokens{9}{6}{1}{0}%
+\tikz@def@grow@tokens{9}{7}{-1}{-1}%
+\tikz@def@grow@tokens{9}{8}{0}{-1}%
+\tikz@def@grow@tokens{9}{9}{1}{-1}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplothandlers.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplothandlers.code.tex
index f38560bc6a0..6e1b497b65b 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplothandlers.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplothandlers.code.tex
@@ -7,8 +7,8 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplothandlers.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+\ProvidesFileRCS{tikzlibraryplothandlers.code.tex}
-\usepgflibrary{plothandlers}
+\usepgflibrary{plothandlers}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex
index 344db60fff0..3b2caac869a 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex
@@ -7,8 +7,8 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotmarks.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+\ProvidesFileRCS{tikzlibraryplotmarks.code.tex}
-\usepgflibrary{plotmarks}
+\usepgflibrary{plotmarks}%
\endinput
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 7a9066e691e..830212928d5 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,30 +7,30 @@
%
% 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.7 2008/10/06 09:35:29 tantau Exp $
+\ProvidesFileRCS{tikzlibrarypositioning.code.tex}
-\tikzset{above/.code=\tikz@lib@place@handle@{#1}{south}{0}{1}{north}{1}}
-\tikzset{above left/.code=\tikz@lib@place@handle@{#1}{south east}{-1}{1}{north west}{0.707106781}}
-\tikzset{above right/.code=\tikz@lib@place@handle@{#1}{south west}{1}{1}{north east}{0.707106781}}
-\tikzset{base left/.code =\tikz@lib@place@handle@{#1}{base east}{-1}{0}{base west}{1}}
-\tikzset{base right/.code=\tikz@lib@place@handle@{#1}{base west}{1}{0}{base east}{1}}
-\tikzset{below/.code=\tikz@lib@place@handle@{#1}{north}{0}{-1}{south}{1}}
-\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}{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}}
+\tikzset{above/.code=\tikz@lib@place@handle@{#1}{south}{0}{1}{north}{1}}%
+\tikzset{above left/.code=\tikz@lib@place@handle@{#1}{south east}{-1}{1}{north west}{0.707106781}}%
+\tikzset{above right/.code=\tikz@lib@place@handle@{#1}{south west}{1}{1}{north east}{0.707106781}}%
+\tikzset{base left/.code =\tikz@lib@place@handle@{#1}{base east}{-1}{0}{base west}{1}}%
+\tikzset{base right/.code=\tikz@lib@place@handle@{#1}{base west}{1}{0}{base east}{1}}%
+\tikzset{below/.code=\tikz@lib@place@handle@{#1}{north}{0}{-1}{south}{1}}%
+\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}{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
% Hook into resets:
-\pgfutil@g@addto@macro\tikz@node@reset@hook{\tikz@addtransform{\tikz@lib@pos@call}\let\tikz@lib@pos@call=\relax}
+\pgfutil@g@addto@macro\tikz@node@reset@hook{\tikz@addtransform{\tikz@lib@pos@call}\let\tikz@lib@pos@call=\relax}%
-\tikzset{on grid/.is if=tikz@lib@ignore@size}
+\tikzset{on grid/.is if=tikz@lib@ignore@size}%
-\tikzset{node distance=1cm and 1cm}
+\tikzset{node distance=1cm and 1cm}%
\def\tikz@lib@place@handle@#1#2#3#4#5#6{%
\def\tikz@anchor{#2}%
@@ -38,7 +38,7 @@
\edef\tikz@temp{#1}%
\def\tikz@lib@place@single@factor{#6}%
\expandafter\tikz@lib@place@handle@@\expandafter{\tikz@temp}{#3}{#4}{#5}%
-}
+}%
\def\tikz@lib@place@handle@@#1#2#3#4{%
\pgfutil@in@{of }{#1}%
\ifpgfutil@in@%
@@ -54,7 +54,7 @@
\pgf@y=#3\pgf@y%
\edef\tikz@lib@pos@call{\noexpand\pgftransformshift{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}%
\fi%
-}
+}%
\def\tikz@lib@place@parse@nums#1{%
\pgfutil@in@{and}{#1}%
@@ -65,7 +65,7 @@
\pgf@x=\tikz@lib@place@single@factor\pgf@x%
\pgf@y=\tikz@lib@place@single@factor\pgf@y%
\fi
-}
+}%
\def\tikz@lib@place@parse@nums@#1and#2\tikz@stop{%
\pgfmathparse{#2}%
\ifpgfmathunitsdeclared%
@@ -88,7 +88,7 @@
\fi%
\pgf@x=\pgf@xa%
\pgf@y=\pgf@ya%
-}
+}%
\def\tikz@lib@place@of#1of #2\tikz@stop#3{%
\def\tikz@temp{#1}%
@@ -97,7 +97,7 @@
\else%
\tikz@lib@place@of@{#1}{#2}{#3}%
\fi%
-}
+}%
\def\tikz@lib@place@of@#1#2#3{%
\tikz@scan@one@point\tikz@lib@place@remember(#2)%
\iftikz@shapeborder%
@@ -110,8 +110,8 @@
\fi%
\fi%
\edef\tikz@lib@place@nums{#1}%
-}
-\def\tikz@lib@place@remember#1{\def\tikz@node@at{#1}}
+}%
+\def\tikz@lib@place@remember#1{\def\tikz@node@at{#1}}%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex
index cab6be1f07b..99efbfeecae 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex
@@ -7,48 +7,48 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex,v 1.4 2014/03/21 19:52:38 tantau Exp $
+\ProvidesFileRCS{tikzlibraryquotes.code.tex}
-\def\tikz@quote@parser#1{\tikz@quote@@parser#1\pgf@stop}
+\def\tikz@quote@parser#1{\tikz@quote@@parser#1\pgf@stop}%
\def\tikz@quote@@parser"#1"{%
\pgfutil@ifnextchar\bgroup{%
\tikz@quote@@parser@group{#1}}{%
\pgfutil@ifnextchar'{%
\tikz@quote@@parser@apo{#1}}{%
- \tikz@quote@@parser@normal{#1}}}}
+ \tikz@quote@@parser@normal{#1}}}}%
\def\tikz@quote@@parser@apo#1'{%
- \pgfutil@ifnextchar\bgroup{\tikz@quote@@parser@apo@group{#1}}{\tikz@quote@@parser@apo@normal{#1}}}
+ \pgfutil@ifnextchar\bgroup{\tikz@quote@@parser@apo@group{#1}}{\tikz@quote@@parser@apo@normal{#1}}}%
\def\tikz@quote@@parser@group#1#2#3\pgf@stop{%
\expandafter\def\expandafter\tikz@temp\expandafter{\tikz@quotes@as{#1}{#2}}%
\expandafter\pgfkeysalso\expandafter{\tikz@temp}%
-}
+}%
\def\tikz@quote@@parser@normal#1#2\pgf@stop{%
\expandafter\def\expandafter\tikz@temp\expandafter{\tikz@quotes@as{#1}{#2}}%
\expandafter\pgfkeysalso\expandafter{\tikz@temp}%
-}
+}%
\def\tikz@quote@@parser@apo@group#1#2#3\pgf@stop{%
\expandafter\def\expandafter\tikz@temp\expandafter{\tikz@quotes@as{#1}{',#2}}%
\expandafter\pgfkeysalso\expandafter{\tikz@temp}%
-}
+}%
\def\tikz@quote@@parser@apo@normal#1#2\pgf@stop{%
\expandafter\def\expandafter\tikz@temp\expandafter{\tikz@quotes@as{#1}{',#2}}%
\expandafter\pgfkeysalso\expandafter{\tikz@temp}%
-}
+}%
-\pgfkeys{/handlers/first char syntax=true}
+\pgfkeys{/handlers/first char syntax=true}%
\def\tikz@enable@node@quotes{%
\pgfkeyssetvalue{/handlers/first char syntax/the character "}{\tikz@quote@parser}%
\let\tikz@quotes@as\tikz@node@quotes@as%
-}
+}%
\def\tikz@enable@edge@quotes{%
\pgfkeyssetvalue{/handlers/first char syntax/the character "}{\tikz@quote@parser}%
\let\tikz@quotes@as\tikz@edge@quotes@as%
-}
+}%
\def\tikz@enable@pic@quotes{%
\pgfkeyssetvalue{/handlers/first char syntax/the character "}{\tikz@quote@parser}%
\let\tikz@quotes@as\tikz@pic@quotes@as%
-}
+}%
\tikzset{
node quotes mean/.code={\def\tikz@node@quotes@as##1##2{#1}},
@@ -73,17 +73,17 @@
\pgfkeyslet{/tikz/below left/.@cmd}\tikz@label@@below@left
\pgfkeyslet{/tikz/below right/.@cmd}\tikz@label@@below@right
}
-}
+}%
-\def\tikz@label@@centered#1\pgfeov{\pgfkeysalso{label position=center,pin position=center}}
-\def\tikz@label@@above#1\pgfeov{\pgfkeysalso{label position=90,pin position=90}}
-\def\tikz@label@@below#1\pgfeov{\pgfkeysalso{label position=-90,pin position=-90}}
-\def\tikz@label@@left#1\pgfeov{\pgfkeysalso{label position=180,pin position=180}}
-\def\tikz@label@@right#1\pgfeov{\pgfkeysalso{label position=0,pin position=0}}
-\def\tikz@label@@above@left#1\pgfeov{\pgfkeysalso{label position=135,pin position=135}}
-\def\tikz@label@@below@left#1\pgfeov{\pgfkeysalso{label position=-135,pin position=-135}}
-\def\tikz@label@@above@right#1\pgfeov{\pgfkeysalso{label position=45,pin position=45}}
-\def\tikz@label@@below@right#1\pgfeov{\pgfkeysalso{label position=-45,pin position=-45}}
+\def\tikz@label@@centered#1\pgfeov{\pgfkeysalso{label position=center,pin position=center}}%
+\def\tikz@label@@above#1\pgfeov{\pgfkeysalso{label position=90,pin position=90}}%
+\def\tikz@label@@below#1\pgfeov{\pgfkeysalso{label position=-90,pin position=-90}}%
+\def\tikz@label@@left#1\pgfeov{\pgfkeysalso{label position=180,pin position=180}}%
+\def\tikz@label@@right#1\pgfeov{\pgfkeysalso{label position=0,pin position=0}}%
+\def\tikz@label@@above@left#1\pgfeov{\pgfkeysalso{label position=135,pin position=135}}%
+\def\tikz@label@@below@left#1\pgfeov{\pgfkeysalso{label position=-135,pin position=-135}}%
+\def\tikz@label@@above@right#1\pgfeov{\pgfkeysalso{label position=45,pin position=45}}%
+\def\tikz@label@@below@right#1\pgfeov{\pgfkeysalso{label position=-45,pin position=-45}}%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryrdf.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryrdf.code.tex
new file mode 100644
index 00000000000..60c87f0dff9
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryrdf.code.tex
@@ -0,0 +1,291 @@
+% Copyright 2016 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{tikzlibraryrdf.code.tex}
+
+
+
+\def\tikz@add@rdf@pre@option#1{\expandafter\def\expandafter\tikz@rdf@pre@options\expandafter{\tikz@rdf@pre@options#1}}%
+\def\tikz@add@rdf@post@option#1{\expandafter\def\expandafter\tikz@rdf@post@options\expandafter{\tikz@rdf@post@options#1}}%
+
+\let\tikz@rdf@pre@options\pgfutil@empty
+\let\tikz@rdf@post@options\pgfutil@empty
+
+\tikzset{
+ %
+ % Switching on the engine
+ %
+ rdf engine on/.code={%
+ \def\tikz@clear@rdf@options{\let\tikz@rdf@pre@options\pgfutil@empty\let\tikz@rdf@post@options\pgfutil@empty}%
+ \def\tikz@do@rdf@pre@options{\tikz@rdf@pre@options\let\tikz@rdf@pre@options\pgfutil@empty}%
+ \def\tikz@do@rdf@post@options{\tikz@rdf@post@options\let\tikz@rdf@post@options\pgfutil@empty}%
+ \pgfkeys{/tikz/rdf engine/.code=\tikz@add@rdf@pre@option{\pgfqkeys{/tikz/rdf engine}{##1}}}%
+ },
+ rdf engine/.cd,
+ %
+ every statement/.style=,
+ %
+ % Namespaces
+ %
+ prefix/.code=\pgfrdfprefix{#1},
+ %
+ % Core commands
+ %
+ statement/.code={%
+ {%
+ \pgfkeys{/tikz/rdf engine/every statement}%
+ \pgfqkeys{/tikz/rdf engine/statements}{#1}%
+ \iftikz@rdf@is@a@container\tikz@rdf@init@container\fi%
+ \iftikz@rdf@is@a@member\tikz@rdf@make@member\fi%
+ \tikz@rdf@make@triple%
+ \expandafter}\tikz@rdf@action%
+ },
+ get scope curie/.code={%
+ \ifx\tikz@id@name\pgfutil@empty%
+ \def\tikz@id@name{@rdf}%
+ \fi%
+ \pgfidrefnextuse\tikz@temp{\tikz@id@name}%
+ \edef#1{\tikzrdfhashmark\tikz@temp}%
+ },
+ get new resource curie/.code={%
+ \pgfsys@new@id\tikz@temp%
+ \edef#1{\tikzrdfhashmark\tikz@temp}%
+ },
+ scope is new context/.style={get scope curie=\tikzrdfcontext}
+}%
+
+\def\tikzrdfcontext{\tikzrdfhashmark}%empty by default
+
+\tikzset{
+ rdf engine/statements/.cd,
+ %
+ % Core properties of statements
+ %
+ subject/.code={%
+ \def\tikz@rdf@target{\tikz@rdf@subject}%
+ \tikz@rdf@parse{#1}%
+ },
+ predicate/.code={%
+ \def\tikz@rdf@target{\tikz@rdf@predicate}%
+ \tikz@rdf@parse{#1}%
+ },
+ object/.code={%
+ \let\tikz@rdf@object@literal\relax%
+ \let\tikz@rdf@object\relax%
+ \def\tikz@temp{#1}%
+ \ifx\tikz@temp\tikz@rdf@current@scope@text%
+ \tikz@rdf@object@scope@contenttrue%
+ \else%
+ \tikz@rdf@object@scope@contentfalse%
+ \def\tikz@rdf@target{\tikz@rdf@object}%
+ \tikz@rdf@parse{#1}%
+ \fi%
+ },
+ %
+ % Shorthands
+ %
+ has type/.style={predicate=rdf:type,object={#1}},
+ %
+ % Containers
+ %
+ is a bag/.style={has type=rdf:Bag, is a container},
+ is a sequence/.style={has type=rdf:Seq, is a container},
+ is an alternative/.style={has type=rdf:Alt, is a container},
+ %
+ is a container/.code={\tikz@rdf@is@a@containertrue},
+ %
+ has as member/.code={\tikz@rdf@is@a@membertrue},%
+}%
+
+\def\tikz@rdf@current@scope@text{scope content}%
+
+\let\tikz@rdf@subject\relax
+\let\tikz@rdf@predicate\pgfutil@empty
+\let\tikz@rdf@object\relax
+\let\tikz@rdf@object@literal\relax
+\let\tikz@rdf@container\relax
+
+\newif\iftikz@rdf@object@scope@content
+\newif\iftikz@rdf@is@a@container
+\newif\iftikz@rdf@is@a@member
+
+
+\def\tikz@rdf@parse#1{%
+ \edef\tikz@temp{#1}%
+ \expandafter\tikz@rdf@parse@#1\relax%
+}%
+
+\def\tikz@rdf@parse@{%
+ \pgfutil@ifnextchar({\tikz@rdf@parse@name}{%)
+ \pgfutil@ifnextchar"{\tikz@rdf@parse@literals}{%
+ \tikz@rdf@parse@curie%
+ }%
+ }%
+}%
+
+\def\tikz@rdf@parse@name(#1)\relax{%
+ \pgfidrefprevuse\tikz@rdf@the@id{#1}\expandafter\edef\tikz@rdf@target{\tikzrdfhashmark\tikz@rdf@the@id}%
+}%
+\def\tikz@rdf@parse@literals"#1"{%
+ \ifx\tikz@rdf@target\tikz@rdf@object@name%
+ \def\tikz@rdf@object@literal{#1}%
+ \else%
+ \tikzerror{Only RDF objects can be literals}%
+ \fi%
+ \pgfutil@ifnextchar\relax\pgfutil@gobble\tikz@rdf@parse@literals@rest%
+}%
+\def\tikz@rdf@parse@literals@rest and scope content\relax{%
+ \tikz@rdf@object@scope@contenttrue%
+}%
+
+\def\tikz@rdf@object@name{\tikz@rdf@object}%
+\def\tikz@rdf@parse@curie#1\relax{%
+ \expandafter\def\tikz@rdf@target{#1}%
+}%
+
+{%
+ \catcode`\#=11
+ \gdef\tikzrdfhashmark{#}%
+}%
+
+
+\def\tikz@rdf@make@triple{%
+ % First, ensure that subject, predicate and object are set:
+ \ifx\tikz@rdf@subject\relax%
+ \tikzerror{RDF statement misses subject}%
+ \else%
+ \ifx\tikz@rdf@predicate\relax%
+ \tikzerror{RDF statement misses predicate}%
+ \else%
+ \iftikz@rdf@object@scope@content%
+ \edef\tikz@marshal{\noexpand\tikz@rdf@make@content@triple{\tikz@rdf@subject}{\tikz@rdf@predicate}{\tikz@rdf@object@literal}}%
+ \tikz@marshal%
+ \else%
+ \ifx\tikz@rdf@object\relax%
+ \ifx\tikz@rdf@object@literal\relax%
+ \tikzerror{RDF statement misses object}%
+ \else%
+ \edef\tikz@marshal{\noexpand\tikz@rdf@make@literal@triple{\tikz@rdf@subject}{\tikz@rdf@predicate}{\tikz@rdf@object@literal}}%
+ \tikz@marshal%
+ \fi%
+ \else%
+ \edef\tikz@marshal{\noexpand\tikz@rdf@make@normal@triple{\tikz@rdf@subject}{\tikz@rdf@predicate}{\tikz@rdf@object}}%
+ \tikz@marshal%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+}%
+
+\def\tikz@rdf@make@content@triple#1#2#3{%
+ \def\tikz@rdf@action{%
+ \def\tikz@rdf@invoke@code{%
+ \def\tikz@temp{#3}%
+ \ifx\tikz@temp\tikz@rdf@object@literal@text\else%
+ \pgfrdfcontent{#3}%
+ \fi%
+ \pgfrdfabout{#1}%
+ \pgfrdfdatatype{rdf:XMLLiteral}%
+ \foreach \tikz@rdf@pred in {#2}{%
+ \ifx\tikz@rdf@pred\pgfutil@empty\else%
+ \expandafter\pgfrdfproperty\expandafter{\tikz@rdf@pred}%
+ \fi%
+ }%
+ }%
+ }%
+}%
+
+\def\tikz@rdf@make@literal@triple#1#2#3{%
+ \def\tikz@rdf@action{%
+ \tikz@add@rdf@post@option{%
+ {%
+ \pgfrdfabout{#1}%
+ \foreach \tikz@rdf@pred in {#2}{%
+ \ifx\tikz@rdf@pred\pgfutil@empty\else%
+ \expandafter\pgfrdfproperty\expandafter{\tikz@rdf@pred}%
+ \fi%
+ }%
+ \pgfrdfcontent{#3}%
+ \pgfidscope%
+ \endpgfidscope%
+ }%
+ }%
+ }%
+}%
+
+\def\tikz@rdf@make@normal@triple#1#2#3{%
+ \def\tikz@rdf@action{%
+ \tikz@add@rdf@post@option{%
+ {%
+ \pgfrdfabout{#1}%
+ \foreach \tikz@rdf@pred in {#2}{%
+ \ifx\tikz@rdf@pred\pgfutil@empty\else%
+ \expandafter\pgfrdfproperty\expandafter{\tikz@rdf@pred}%
+ \fi%
+ }%
+ \pgfrdfresource{#3}%
+ \pgfidscope%
+ \endpgfidscope%
+ }%
+ }%
+ }%
+}%
+
+\def\tikz@rdf@object@literal@text{\tikz@rdf@object@literal}%
+
+
+
+
+% Containers
+
+\def\tikz@rdf@init@container{%
+ \ifx\tikz@rdf@subject\relax%
+ \tikzerror{RDF statement misses subject}%
+ \else%
+ \expandafter\gdef\csname tikz@rdf@c@\tikz@rdf@subject\endcsname{0}%
+ \fi%
+}%
+
+
+\def\tikz@rdf@make@member{%
+ \ifx\tikz@rdf@subject\relax%
+ \tikzerror{RDF statement misses subject}%
+ \else%
+ % Get number:
+ \expandafter\let\expandafter\tikz@temp\csname tikz@rdf@c@\tikz@rdf@subject\endcsname%
+ \ifx\tikz@temp\relax%
+ \tikzerror{RDF subject is not a container}%
+ \else%
+ \c@pgf@counta\tikz@temp%
+ \advance\c@pgf@counta by1\relax%
+ \expandafter\xdef\csname tikz@rdf@c@\tikz@rdf@subject\endcsname{\the\c@pgf@counta}%
+ \edef\tikz@rdf@predicate{rdf:_\the\c@pgf@counta}%
+ \fi%
+ \fi%
+}%
+
+
+
+
+
+% Hooks:
+
+\let\tikz@rdf@invoke@code\relax
+
+\def\tikz@rdf@id@hook{%
+ \tikz@rdf@invoke@code%
+ \let\tikz@rdf@invoke@code\relax%
+}%
+
+% Add hook:
+\expandafter\def\expandafter\tikz@id@hook\expandafter{\tikz@id@hook\tikz@rdf@id@hook}%
+
+
+
+\endinput
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 808e34578d6..6245bf8ec1f 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,24 +7,24 @@
%
% 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.2 2008/06/27 17:00:24 vibrovski Exp $
+\ProvidesFileRCS{tikzlibraryscopes.code.tex}
% Redefine the after command hook...
\def\tikz@lib@scope@check{%
- \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%
- }%
- {}%
- }%
- }%
-}
+ \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{%
\pgfutil@ifnextchar[{%]
@@ -32,11 +32,11 @@
}{%
% false alarm
\bgroup%
- }%
-}
+ }%
+}%
\def\tikz@lib@scope@action[#1]{%
\scope[#1]\bgroup\aftergroup\endscope%
\tikz@lib@scope@check%
-}
+}%
\endinput
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
index 962d9956af9..c84fb467699 100644
--- 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
@@ -7,15 +7,15 @@
%
% 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 $
+\ProvidesFileRCS{tikzlibraryshadings.code.tex}
-\usepgflibrary{shadings}
+\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/tikzlibraryshadows.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadows.code.tex
index 424e19b8502..ebb2abf74c6 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadows.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshadows.code.tex
@@ -7,9 +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/tikzlibraryshadows.code.tex,v 1.3 2008/01/13 15:30:04 tantau Exp $
+\ProvidesFileRCS{tikzlibraryshadows.code.tex}
-\usetikzlibrary{fadings}
+\usetikzlibrary{fadings}%
% General options
@@ -17,7 +17,7 @@
/tikz/shadow scale/.initial=1,
/tikz/shadow xshift/.initial=0pt,
/tikz/shadow yshift/.initial=0pt,
-}
+}%
% Basic shadow style
\tikzset{
@@ -31,7 +31,7 @@
}
},
every shadow/.style={}
-}
+}%
@@ -51,7 +51,7 @@
#1
}
}
-}
+}%
%
@@ -70,7 +70,7 @@
#1
}
}
-}
+}%
@@ -90,7 +90,7 @@
#1,
}
}
-}
+}%
@@ -113,7 +113,7 @@
#1
}
}
-}
+}%
%
@@ -143,5 +143,4 @@
#1,
},
}
-}
-
+}%
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex
index f8d0604c965..20e2022c115 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex
@@ -7,10 +7,10 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.arrows.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+\ProvidesFileRCS{tikzlibraryshapes.arrows.code.tex}
-\usepgflibrary{shapes.arrows}
+\usepgflibrary{shapes.arrows}%
-\pgfkeys{/tikz/arrow box arrows/.code={\pgf@lib@arrowbox@parsearrows{#1}}}
+\pgfkeys{/tikz/arrow box arrows/.code={\pgf@lib@arrowbox@parsearrows{#1}}}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.callouts.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.callouts.code.tex
index 9bb2d738770..12b4953349f 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.callouts.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.callouts.code.tex
@@ -7,29 +7,29 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgflibrary{shapes.callouts}
+\usepgflibrary{shapes.callouts}%
\pgfkeys{/tikz/callout absolute pointer/.code={%
- \tikz@scan@one@point\tikz@lib@callout@checkforplus#1\relax%
- }%
-}
+ \tikz@scan@one@point\tikz@lib@callout@checkforplus#1\relax%
+ }%
+}%
\def\tikz@lib@callout@checkforplus#1{%
- \pgfutil@ifnextchar+{\def\tikz@lib@callout@originalpoint{#1}\tikz@lib@callout@scan@relative}%
- {\pgf@lib@callout@makeabsolutepointer{#1}}}%
+ \pgfutil@ifnextchar+{\def\tikz@lib@callout@originalpoint{#1}\tikz@lib@callout@scan@relative}%
+ {\pgf@lib@callout@makeabsolutepointer{#1}}}%
\def\tikz@lib@callout@scan@relative+{%
- \pgfutil@ifnextchar+{\tikz@lib@callout@scan@plusplus}{\tikz@lib@callout@scan@plus}}
-\def\tikz@lib@callout@scan@plusplus+{\tikz@scan@one@point\tikz@lib@callout@add}
-\def\tikz@lib@callout@scan@plus{\tikz@scan@one@point\tikz@lib@callout@add}
+ \pgfutil@ifnextchar+{\tikz@lib@callout@scan@plusplus}{\tikz@lib@callout@scan@plus}}%
+\def\tikz@lib@callout@scan@plusplus+{\tikz@scan@one@point\tikz@lib@callout@add}%
+\def\tikz@lib@callout@scan@plus{\tikz@scan@one@point\tikz@lib@callout@add}%
\def\tikz@lib@callout@add#1{%
- \expandafter\pgf@lib@callout@makeabsolutepointer\expandafter{%
- \expandafter\pgfpointadd\expandafter{\tikz@lib@callout@originalpoint}{#1}}%
+ \expandafter\pgf@lib@callout@makeabsolutepointer\expandafter{%
+ \expandafter\pgfpointadd\expandafter{\tikz@lib@callout@originalpoint}{#1}}%
}%
\pgfkeys{/tikz/callout relative pointer/.code={%
- \tikz@scan@one@point\pgf@lib@callout@makerelativepointer#1\relax%
- }%
-}
+ \tikz@scan@one@point\pgf@lib@callout@makerelativepointer#1\relax%
+ }%
+}%
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex
index 83c808071bf..0e1c84a287a 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex
@@ -7,13 +7,13 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+\ProvidesFileRCS{tikzlibraryshapes.code.tex}
-\usetikzlibrary{shapes.geometric}
-\usetikzlibrary{shapes.misc}
-\usetikzlibrary{shapes.symbols}
-\usetikzlibrary{shapes.arrows}
-\usetikzlibrary{shapes.callouts}
-\usetikzlibrary{shapes.multipart}
+\usetikzlibrary{shapes.geometric}%
+\usetikzlibrary{shapes.misc}%
+\usetikzlibrary{shapes.symbols}%
+\usetikzlibrary{shapes.arrows}%
+\usetikzlibrary{shapes.callouts}%
+\usetikzlibrary{shapes.multipart}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex
index ae11747144e..e41ddf83a00 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex
@@ -7,34 +7,32 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.IEC.code.tex,v 1.3 2008/01/27 11:39:49 vibrovski Exp $
+\ProvidesFileRCS{tikzlibraryshapes.gates.logic.IEC.code.tex}
-\usepgflibrary{shapes.gates.logic.IEC}
+\usepgflibrary{shapes.gates.logic.IEC}%
\tikzset{%
use IEC style logic gates/.code={%
- \tikzset{%
- and gate/.style={shape=and gate IEC},
- nand gate/.style={shape=nand gate IEC},
- or gate/.style={shape=or gate IEC},
- nor gate/.style={shape=nor gate IEC},
- xor gate/.style={shape=xor gate IEC},
- xnor gate/.style={shape=xnor gate IEC},
- not gate/.style={shape=not gate IEC},
- buffer gate/.style={shape=buffer gate IEC},
- and gate symbol/.style={and gate IEC symbol={##1}},
- nand gate symbol/.style={nand gate IEC symbol={##1}},
- or gate symbol/.style={or gate IEC symbol={##1}},
- nor gate symbol/.style={nor gate IEC symbol={##1}},
- xor gate symbol/.style={xor gate IEC symbol={##1}},
- xnor gate symbol/.style={xnor gate IEC symbol={##1}},
- not gate symbol/.style={not gate IEC symbol={##1}},
- buffer gate symbol/.style={buffer gate IEC symbol={##1}},
- logic gate symbol align/.style={/pgf/logic gate IEC symbol align={##1}},
- logic gate symbol color/.style={/pgf/logic gate IEC symbol color={##1}}
- }%
- }%
-}
+ \tikzset{%
+ and gate/.style={shape=and gate IEC},
+ nand gate/.style={shape=nand gate IEC},
+ or gate/.style={shape=or gate IEC},
+ nor gate/.style={shape=nor gate IEC},
+ xor gate/.style={shape=xor gate IEC},
+ xnor gate/.style={shape=xnor gate IEC},
+ not gate/.style={shape=not gate IEC},
+ buffer gate/.style={shape=buffer gate IEC},
+ and gate symbol/.style={and gate IEC symbol={##1}},
+ nand gate symbol/.style={nand gate IEC symbol={##1}},
+ or gate symbol/.style={or gate IEC symbol={##1}},
+ nor gate symbol/.style={nor gate IEC symbol={##1}},
+ xor gate symbol/.style={xor gate IEC symbol={##1}},
+ xnor gate symbol/.style={xnor gate IEC symbol={##1}},
+ not gate symbol/.style={not gate IEC symbol={##1}},
+ buffer gate symbol/.style={buffer gate IEC symbol={##1}},
+ logic gate symbol align/.style={/pgf/logic gate IEC symbol align={##1}},
+ logic gate symbol color/.style={/pgf/logic gate IEC symbol color={##1}}
+ }%
+ }%
+}%
\endinput
-
-
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex
index 0b8a744126b..99411f2b12f 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex
@@ -7,34 +7,34 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.gates.logic.US.code.tex,v 1.1 2008/01/25 08:26:00 vibrovski Exp $
+\ProvidesFileRCS{tikzlibraryshapes.gates.logic.US.code.tex}
-\usepgflibrary{shapes.gates.logic.US}
+\usepgflibrary{shapes.gates.logic.US}%
\tikzset{%
use US style logic gates/.code={%
- \tikzset{%
- and gate/.style={shape=and gate US},
- nand gate/.style={shape=nand gate US},
- or gate/.style={shape=or gate US},
- nor gate/.style={shape=nor gate US},
- xor gate/.style={shape=xor gate US},
- xnor gate/.style={shape=xnor gate US},
- not gate/.style={shape=not gate US},
- buffer gate/.style={shape=buffer gate US}
- }%
- },
- use CDH style logic gates/.code={%
- \tikzset{%
- and gate/.style={shape=and gate CDH},
- nand gate/.style={shape=nand gate CDH},
- or gate/.style={shape=or gate US},
- nor gate/.style={shape=nor gate US},
- xor gate/.style={shape=xor gate US},
- xnor gate/.style={shape=xnor gate US},
- not gate/.style={shape=not gate US},
- buffer gate/.style={shape=buffer gate US}
- }
- }
-}
+ \tikzset{%
+ and gate/.style={shape=and gate US},
+ nand gate/.style={shape=nand gate US},
+ or gate/.style={shape=or gate US},
+ nor gate/.style={shape=nor gate US},
+ xor gate/.style={shape=xor gate US},
+ xnor gate/.style={shape=xnor gate US},
+ not gate/.style={shape=not gate US},
+ buffer gate/.style={shape=buffer gate US}
+ }%
+ },
+ use CDH style logic gates/.code={%
+ \tikzset{%
+ and gate/.style={shape=and gate CDH},
+ nand gate/.style={shape=nand gate CDH},
+ or gate/.style={shape=or gate US},
+ nor gate/.style={shape=nor gate US},
+ xor gate/.style={shape=xor gate US},
+ xnor gate/.style={shape=xnor gate US},
+ not gate/.style={shape=not gate US},
+ buffer gate/.style={shape=buffer gate US}
+ }
+ }
+}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex
index dc5aad85554..ae3d6c7feb5 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex
@@ -7,8 +7,8 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.geometric.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+\ProvidesFileRCS{tikzlibraryshapes.geometric.code.tex}
-\usepgflibrary{shapes.geometric}
+\usepgflibrary{shapes.geometric}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex
index 10794a092d2..9a8c13f6221 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex
@@ -7,8 +7,8 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.misc.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+\ProvidesFileRCS{tikzlibraryshapes.misc.code.tex}
-\usepgflibrary{shapes.misc}
+\usepgflibrary{shapes.misc}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.code.tex
index 564c77f8a80..797a0e25523 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.code.tex
@@ -7,30 +7,30 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.multipart.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+\ProvidesFileRCS{tikzlibraryshapes.multipart.code.tex}
-\usepgflibrary{shapes.multipart}
+\usepgflibrary{shapes.multipart}%
\pgfkeys{/tikz/rectangle split/parts/.code={%
- \pgfkeys{/pgf/rectangle split parts=#1}%
- }%
-}
+ \pgfkeys{/pgf/rectangle split parts=#1}%
+ }%
+}%
\pgfkeys{/tikz/rectangle split use custom fill/.code={%
- \pgfkeys{/pgf/rectangle split use custom fill=#1}%
- \pgfkeys{/tikz/fill=none}}%
-}
+ \pgfkeys{/pgf/rectangle split use custom fill=#1}%
+ \pgfkeys{/tikz/fill=none}}%
+}%
-\pgfkeys{/tikz/rectangle split draw splits/.is if=pgfrectanglesplitdrawsplits}
+\pgfkeys{/tikz/rectangle split draw splits/.is if=pgfrectanglesplitdrawsplits}%
\pgfkeys{/tikz/rectangle split part align/.code={%
- \pgfkeys{/pgf/rectangle split part align={#1}}%
- }%
+ \pgfkeys{/pgf/rectangle split part align={#1}}%
+ }%
}%
\pgfkeys{/tikz/rectangle split part fill/.code={%
- \pgfkeys{/pgf/rectangle split part fill={#1}}%
- }%
+ \pgfkeys{/pgf/rectangle split part fill={#1}}%
+ }%
}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.symbols.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.symbols.code.tex
index f3b935dc0bc..6927d8dea40 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.symbols.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.symbols.code.tex
@@ -7,11 +7,11 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryshapes.symbols.code.tex,v 1.1 2008/01/09 17:57:16 tantau Exp $
+\ProvidesFileRCS{tikzlibraryshapes.symbols.code.tex}
\pgfkeysifdefined{/tikz/shape border uses incircle}{}{%
- \pgfkeys{/tikz/shape border uses incircle/.is if=pgfshapeborderusesincircle}}
-
-\usepgflibrary{shapes.symbols}
+ \pgfkeys{/tikz/shape border uses incircle/.is if=pgfshapeborderusesincircle}}%
+
+\usepgflibrary{shapes.symbols}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex
index 3fa9d3f8f46..64d6fc44f88 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex
@@ -7,13 +7,13 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex,v 1.7 2013/07/15 12:05:31 tantau Exp $
+\ProvidesFileRCS{tikzlibrarysnakes.code.tex}
\pgfwarning{Snakes have been superseded by
decorations. Please use the decoration libraries instead of the snakes
-library}
+library}%
-\usetikzlibrary{decorations.pathmorphing,decorations.pathreplacing,decorations.shapes}
+\usetikzlibrary{decorations.pathmorphing,decorations.pathreplacing,decorations.shapes}%
% Old snakes stuff:
@@ -29,48 +29,48 @@ library}
\tikz@snakedtrue%
\let\tikz@snake=\tikz@@snake%
\fi%
- \fi}
+ \fi}%
-\tikzoption{raise snake}{\def\pgf@snake@raise{\pgftransformyshift{#1}}}
+\tikzoption{raise snake}{\def\pgf@snake@raise{\pgftransformyshift{#1}}}%
\tikzoption{mirror snake}[true]{%
\csname if#1\endcsname
\def\pgf@snake@mirror{\pgftransformyscale{-1}}%
\else%
\let\pgf@snake@mirror=\pgfutil@empty%
\fi
-}
+}%
-\tikzoption{gap before snake}{\def\tikz@presnake{{moveto}{#1}{\noexpand\tikz@snake@install@trans}{}}}
-\tikzoption{line before snake}{\def\tikz@presnake{{lineto}{#1}{\noexpand\tikz@snake@install@trans}{}}}
+\tikzoption{gap before snake}{\def\tikz@presnake{{moveto}{#1}{\noexpand\tikz@snake@install@trans}{}}}%
+\tikzoption{line before snake}{\def\tikz@presnake{{lineto}{#1}{\noexpand\tikz@snake@install@trans}{}}}%
-\tikzoption{gap after snake}{\def\tikz@postsnake{{moveto}{#1}{\noexpand\tikz@snake@install@trans}{}}\def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}}
-\tikzoption{line after snake}{\def\tikz@postsnake{{lineto}{#1}{\noexpand\tikz@snake@install@trans}{}}\def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}}
+\tikzoption{gap after snake}{\def\tikz@postsnake{{moveto}{#1}{\noexpand\tikz@snake@install@trans}{}}\def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}}%
+\tikzoption{line after snake}{\def\tikz@postsnake{{lineto}{#1}{\noexpand\tikz@snake@install@trans}{}}\def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}}%
\tikzoption{gap around snake}{%
\def\tikz@presnake{{moveto}{#1}{\noexpand\tikz@snake@install@trans}{}}%
\def\tikz@postsnake{{moveto}{#1}{\noexpand\tikz@snake@install@trans}{}}%
\def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}%
-}
+}%
\tikzoption{line around snake}{%
\def\tikz@presnake{{lineto}{#1}{\noexpand\tikz@snake@install@trans}{}}%
\def\tikz@postsnake{{lineto}{#1}{\noexpand\tikz@snake@install@trans}{}}%
\def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}%
-}
+}%
\let\pgf@snake@mirror=\pgfutil@empty
\let\pgf@snake@raise=\pgfutil@empty
-\def\tikz@snake@install@trans{\pgfsetsnakesegmenttransformation{\pgf@snake@mirror\pgf@snake@raise}}
+\def\tikz@snake@install@trans{\pgfsetsnakesegmenttransformation{\pgf@snake@mirror\pgf@snake@raise}}%
-\def\tikz@snake{zigzag}
+\def\tikz@snake{zigzag}%
\let\tikz@presnake=\pgfutil@empty
\let\tikz@postsnake=\pgfutil@empty
-\def\tikz@mainsnakelength{\pgfsnakeremainingdistance}
+\def\tikz@mainsnakelength{\pgfsnakeremainingdistance}%
-\tikzstyle{snake triangles 45}= [snake=triangles,segment object length=2.41421356\pgfsnakesegmentamplitude]
-\tikzstyle{snake triangles 60}= [snake=triangles,segment object length=1.73205081\pgfsnakesegmentamplitude]
-\tikzstyle{snake triangles 90}= [snake=triangles,segment object length=\pgfsnakesegmentamplitude]
+\tikzset{snake triangles 45/.style= {snake=triangles,segment object length=2.41421356\pgfsnakesegmentamplitude}}%
+\tikzset{snake triangles 60/.style= {snake=triangles,segment object length=1.73205081\pgfsnakesegmentamplitude}}%
+\tikzset{snake triangles 90/.style= {snake=triangles,segment object length=\pgfsnakesegmentamplitude}}%
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
index 099448c5165..b23cf08caf2 100644
--- 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
@@ -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/tikzlibraryspy.code.tex,v 1.4 2011/05/19 08:56:54 tantau Exp $
+\ProvidesFileRCS{tikzlibraryspy.code.tex}
@@ -31,7 +31,7 @@
connect spies/.style={
spy connection path={\draw[thin] (tikzspyonnode) -- (tikzspyinnode);}
}
-}
+}%
\newbox\tikz@lib@spybox
@@ -61,21 +61,21 @@
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]
@@ -110,14 +110,14 @@
\endpgfpicture};}]#3{};
\tikz@lib@spy@path
\endscope
-}
+}%
\def\tikz@lib@spy@shift#1{%
\pgf@process{#1}%
\pgf@x=-\pgf@x%
\pgf@y=-\pgf@y%
\pgftransformshift{}%
-}
+}%
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
index f0eae010424..8b64ccc3ce7 100644
--- 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
@@ -7,14 +7,14 @@
%
% 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.2 2013/09/23 18:04:35 tantau Exp $
+\ProvidesFileRCS{tikzlibrarysvg.path.code.tex}
-\usepgflibrary{svg.path}
+\usepgflibrary{svg.path}%
-\def\tikz@svg@path vg{\pgfutil@ifnextchar[\tikz@svg@@path{\tikz@svg@@path[]}}%}
+\def\tikz@svg@path vg{\pgfutil@ifnextchar[\tikz@svg@@path{\tikz@svg@@path[]}}%}%
-\def\tikz@svg@@path[#1]{\pgfutil@ifnextchar"{\tikz@svg@@path@old{#1}}{\tikz@svg@@path@new{#1}}}
-\def\tikz@svg@@path@new#1#2{\tikz@svg@@path@old{#1}"#2"}
+\def\tikz@svg@@path[#1]{\pgfutil@ifnextchar"{\tikz@svg@@path@old{#1}}{\tikz@svg@@path@new{#1}}}%
+\def\tikz@svg@@path@new#1#2{\tikz@svg@@path@old{#1}"#2"}%
\def\tikz@svg@@path@old#1"#2"{
{%
\tikzset{#1}%
@@ -30,4 +30,4 @@
\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/tikzlibrarythrough.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarythrough.code.tex
index f369a23b830..cb634245327 100644
--- a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarythrough.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarythrough.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/tikzlibrarythrough.code.tex,v 1.1 2008/02/03 19:37:27 tantau Exp $
+\ProvidesFileRCS{tikzlibrarythrough.code.tex}
@@ -16,7 +16,7 @@
% Save transformations (correct?)
\pgfgettransform{\tikz@lib@saved@transform}%
\tikz@scan@one@point\tikz@lib@circle@through#1%
- }}
+ }}%
\def\tikz@lib@circle@through#1{%
\tikz@addoption{%
@@ -33,4 +33,4 @@
}%
\pgfset{/pgf/minimum size/.expanded=\tikz@lib@circle@size}%
}%
-} \ 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 ea87a5bd394..b719271d57e 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,31 +7,31 @@
%
% 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.2 2008/06/17 21:23:44 tantau Exp $
+\ProvidesFileRCS{tikzlibrarytopaths.code.tex}
% Move to
-\tikzstyle{move to}= [to path={(\tikztotarget) \tikztonodes}]
+\tikzset{move to/.style= {to path={(\tikztotarget) \tikztonodes}}}
% Straight to
-\tikzstyle{line to}= [to path={-- (\tikztotarget) \tikztonodes}]
+\tikzset{line to/.style= {to path={-- (\tikztotarget) \tikztonodes}}}
% Curved to
-\tikzstyle{every curve to}= []
-\tikzstyle{curve to}= [to path=\tikz@to@curve@path]
+\tikzset{every curve to/.style= {}}
+\tikzset{curve to/.style= {to path=\tikz@to@curve@path}}
-\tikzoption{bend angle}{\def\tikz@to@bend{#1}}
+\tikzoption{bend angle}{\pgfmathsetmacro\tikz@to@bend{#1}}
\tikzoption{bend left}[]{%
\def\pgf@temp{#1}%
\ifx\pgf@temp\pgfutil@empty%
\else%
- \def\tikz@to@bend{#1}%
+ \pgfmathsetmacro\tikz@to@bend{#1}%
\fi%
\let\tikz@to@out=\tikz@to@bend%
\c@pgf@counta=180\relax%
@@ -45,9 +45,10 @@
\def\pgf@temp{#1}%
\ifx\pgf@temp\pgfutil@empty%
\else%
- \def\tikz@to@bend{#1}%
+ \pgfmathsetmacro\tikz@to@bend{#1}%
\fi%
% Now, negate
+ \pgfmathsetmacro\tikz@to@out{\tikz@to@bend}
\c@pgf@counta=\tikz@to@bend\relax%
\c@pgf@counta=-\c@pgf@counta\relax%
\edef\tikz@to@out{\the\c@pgf@counta}%
@@ -158,7 +159,7 @@
\ifx\tikz@to@start@compute\tikz@to@start@compute@looseness%
\tikz@to@compute@distance%
\else%
- \ifx\tikz@from@start@compute\tikz@to@start@compute@looseness%
+ \ifx\tikz@from@start@compute\tikz@to@start@compute@looseness%
\tikz@to@compute@distance%
\fi%
\fi%
@@ -179,9 +180,9 @@
\pgf@process{\pgfpointdiff{\tikz@first@point}{\tikz@second@point}}%
\ifdim\pgf@x<0pt\pgf@xa=-\pgf@x\else\pgf@xa=\pgf@x\fi%
\ifdim\pgf@y<0pt\pgf@ya=-\pgf@y\else\pgf@ya=\pgf@y\fi%
- %
+ %
% Calculate length of second to first vector:
- %
+ %
\pgf@process{\pgfpointnormalised{\pgfqpoint{\pgf@xa}{\pgf@ya}}}%
\ifdim\pgf@x>\pgf@y%
\c@pgf@counta=\pgf@x%
@@ -255,10 +256,10 @@
\def\tikz@@@to@compute@relative#1{%
\def\tikz@toto{#1}%
\begingroup
- %
+ %
% Adjust start and target so that they lie on the border in the
% rotated coordinate system.
- %
+ %
\pgfutil@ifundefined{pgf@sh@ns@\tikztostart}
{%
\let\tikz@first@point=\tikz@tofrom%
@@ -363,18 +364,18 @@
% Loops
-\tikzstyle{loop}= [to path={
+\tikzset{loop/.style= {to path={
\pgfextra{\let\tikztotarget=\tikztostart}
[looseness=8,min distance=5mm,every loop]
\tikz@to@curve@path
- }]
+ }}}
-\tikzstyle{every loop}= [->,shorten >=1pt]
+\tikzset{every loop/.style= {->,shorten >=1pt}}
-\tikzstyle{loop right}= [right,out=15,in=-15,loop]
-\tikzstyle{loop above}= [above,out=105,in=75,loop]
-\tikzstyle{loop left}= [left,out=195,in=165,loop]
-\tikzstyle{loop below}= [below,out=285,in=255,loop]
+\tikzset{loop right/.style= {right,out=15,in=-15,loop}}
+\tikzset{loop above/.style= {above,out=105,in=75,loop}}
+\tikzset{loop left/.style= {left,out=195,in=165,loop}}
+\tikzset{loop below/.style= {below,out=285,in=255,loop}}
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 7d34c2d6819..830435a029b 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.2 2008/02/24 10:00:52 tantau Exp $
+\ProvidesFileRCS{tikzlibrarytrees.code.tex}
@@ -15,13 +15,13 @@
% Three point growth
%
-\tikzoption{grow via three points}{\let\tikz@grow=\tikz@grow@three\tikz@parse@three#1}
+\tikzoption{grow via three points}{\let\tikz@grow=\tikz@grow@three\tikz@parse@three#1}%
\def\tikz@parse@three one child at#1(#2)#3and two children at#4(#5)#6and#7(#8){%
\def\tikz@tree@one@child{\tikz@scan@one@point\pgf@process(#2)}
\def\tikz@tree@left@child{\tikz@scan@one@point\pgf@process(#5)}
\def\tikz@tree@right@child{\tikz@scan@one@point\pgf@process(#8)}
-}
+}%
\def\tikz@grow@three{%
\pgf@process{\tikz@tree@one@child}%
@@ -51,7 +51,7 @@
\advance\pgf@ya by\pgf@yc%
\edef\pgf@temp{\noexpand\pgftransformshift{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}}%
\pgf@temp%
-}
+}%
@@ -59,31 +59,27 @@
% Circle grow
%
-\tikzstyle{grow cyclic}=[growth function=\tikz@grow@circle]
+\tikzset{grow cyclic/.style={growth function=\tikz@grow@circle}}%
-\tikzset{sibling angle/.initial=20}
+\tikzset{sibling angle/.initial=20}%
\def\tikz@grow@circle{%
\pgftransformrotate{%
(\pgfkeysvalueof{/tikz/sibling angle})*(-.5-.5*\tikznumberofchildren+\tikznumberofcurrentchild)}%
\pgftransformxshift{\the\tikzleveldistance}%
-}
+}%
-\tikzoption{counterclockwise from}{\let\tikz@grow=\tikz@grow@circle@from\def\tikz@grow@circle@from@start{#1}}
+\tikzoption{counterclockwise from}{\let\tikz@grow=\tikz@grow@circle@from\def\tikz@grow@circle@from@start{#1}}%
\def\tikz@grow@circle@from{%
\pgftransformshift{\pgfpointpolar{\tikz@grow@circle@from@start+(\pgfkeysvalueof{/tikz/sibling angle})*(\tikznumberofcurrentchild-1)}{\the\tikzleveldistance}}%
-}
+}%
-\tikzoption{clockwise from}{\let\tikz@grow=\tikz@grow@circle@from@\def\tikz@grow@circle@from@start{#1}}
+\tikzoption{clockwise from}{\let\tikz@grow=\tikz@grow@circle@from@\def\tikz@grow@circle@from@start{#1}}%
\def\tikz@grow@circle@from@{%
\pgftransformshift{\pgfpointpolar{\tikz@grow@circle@from@start-(\pgfkeysvalueof{/tikz/sibling angle})*(\tikznumberofcurrentchild-1)}{\the\tikzleveldistance}}%
-}
-
-
-
-
+}%
@@ -91,18 +87,18 @@
% Connections
%
-\tikzstyle{edge from parent fork down}=
- [edge from parent path={(\tikzparentnode\tikzparentanchor) -- +(0pt,-.5\tikzleveldistance) -| (\tikzchildnode\tikzchildanchor)}]
+\tikzset{edge from parent fork down/.style=
+ {edge from parent path={(\tikzparentnode\tikzparentanchor) -- +(0pt,-.5\tikzleveldistance) -| (\tikzchildnode\tikzchildanchor)}}}%
+
+\tikzset{edge from parent fork up/.style=
+ {edge from parent path={(\tikzparentnode\tikzparentanchor) -- +(0pt,.5\tikzleveldistance) -| (\tikzchildnode\tikzchildanchor)}}}%
-\tikzstyle{edge from parent fork up}=
- [edge from parent path={(\tikzparentnode\tikzparentanchor) -- +(0pt,.5\tikzleveldistance) -| (\tikzchildnode\tikzchildanchor)}]
+\tikzset{edge from parent fork left/.style=
+ {edge from parent path={(\tikzparentnode\tikzparentanchor) -- +(-.5\tikzleveldistance,0pt) |- (\tikzchildnode\tikzchildanchor)}}}%
-\tikzstyle{edge from parent fork left}=
- [edge from parent path={(\tikzparentnode\tikzparentanchor) -- +(-.5\tikzleveldistance,0pt) |- (\tikzchildnode\tikzchildanchor)}]
+\tikzset{edge from parent fork right/.style=
+ {edge from parent path={(\tikzparentnode\tikzparentanchor) -- +(.5\tikzleveldistance,0pt) |- (\tikzchildnode\tikzchildanchor)}}}%
-\tikzstyle{edge from parent fork right}=
- [edge from parent path={(\tikzparentnode\tikzparentanchor) -- +(.5\tikzleveldistance,0pt) |- (\tikzchildnode\tikzchildanchor)}]
-
\endinput
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
index c0306b4d304..009a309e311 100644
--- 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
@@ -7,29 +7,29 @@
%
% 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 $
+\ProvidesFileRCS{tikzlibraryturtle.code.tex}
-\tikzset{turtle/.style={/tikz/turtle/.cd,#1}}
+\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}
+\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}
+\tikzset{turtle/distance/.initial=1cm}%
% The to path options that are used to move the turtle
-\tikzset{turtle/how/.style=}
+\tikzset{turtle/how/.style=}%
% Let the turtle jump home
-\tikzset{turtle/home/.style={/tikz/insert path={(0,0) [turtle/direction=90]}}}
+\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)}}
-}
+}%
@@ -38,11 +38,11 @@
\tikzset{
turtle/back/.default=\pgfkeysvalueof{/tikz/turtle/distance},
turtle/back/.style={turtle forward=-#1}
-}
+}%
-% Turns the turle left by the given number of degrees
+% Turns the turtle left by the given number of degrees
\tikzset{
turtle/left/.default=90,
turtle/left/.code={%
@@ -50,12 +50,12 @@
\ifdim\pgfmathresult pt>360pt\relax%
\pgfmathparse{\pgfmathresult-360}%
\fi%
- \global\let\tikz@lib@turtle@dir\pgfmathresult
+ \global\let\tikz@lib@turtle@dir\pgfmathresult
}
-}
+}%
-% Turns the turle left by the given number of degrees
+% Turns the turtle left by the given number of degrees
\tikzset{
turtle/right/.default=90,
turtle/right/.code={%
@@ -64,9 +64,9 @@
\ifdim\pgfmathresult pt<0pt\relax%
\pgfmathparse{\pgfmathresult+360}%
\fi%
- \global\let\tikz@lib@turtle@dir\pgfmathresult
+ \global\let\tikz@lib@turtle@dir\pgfmathresult
}
-}
+}%
% Shortcuts:
@@ -78,7 +78,7 @@
lt/.style={left=#1},
lt/.default=90,
rt/.style={right=#1},
- rt/.default=90}
+ rt/.default=90}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryviews.code.tex b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryviews.code.tex
new file mode 100644
index 00000000000..746dd60f638
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryviews.code.tex
@@ -0,0 +1,45 @@
+% Copyright 2015 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{tikzlibraryviews.code.tex}
+
+
+\tikzset{
+ meet/.style={execute at begin scope={\tikz@lib@view@parse{meet}#1\pgf@stop},execute at end scope={\endpgfviewboxscope}},
+ view/.style={meet = {#1}},
+ slice/.style={execute at begin scope={\tikz@lib@view@parse{slice}#1\pgf@stop},execute at end scope={\endpgfviewboxscope}},
+}%
+
+\def\tikz@lib@view@parse#1#2\pgf@stop{%
+ \tikz@scan@one@point\tikz@lib@view@a#2\pgf@stop%
+ \pgfviewboxscope{\tikz@lib@view@stored@a}{\tikz@lib@view@stored@b}{\tikz@lib@view@stored@c}{\tikz@lib@view@stored@d}{#1}%
+}%
+\def\tikz@lib@view@a#1{%
+ \def\tikz@lib@view@stored@a{#1}%
+ \pgfutil@ifnextchar r{\tikz@lib@view@a@rec}{\tikz@scan@one@point\tikz@lib@view@b}%
+}%
+\def\tikz@lib@view@a@rec rectangle{\tikz@scan@one@point\tikz@lib@view@b}%
+\def\tikz@lib@view@b#1{%
+ \def\tikz@lib@view@stored@b{#1}%
+ \pgfutil@ifnextchar\pgf@stop{%
+ \let\tikz@lib@view@stored@c\tikz@lib@view@stored@a%
+ \let\tikz@lib@view@stored@d\tikz@lib@view@stored@b%
+ \pgfutil@gobble%
+ }{\tikz@lib@view@b@at}%
+}%
+\def\tikz@lib@view@b@at at{\tikz@scan@one@point\tikz@lib@view@c}%
+\def\tikz@lib@view@c#1{%
+ \def\tikz@lib@view@stored@c{#1}%
+ \pgfutil@ifnextchar r{\tikz@lib@view@c@rec}{\tikz@scan@one@point\tikz@lib@view@d}%
+}%
+\def\tikz@lib@view@c@rec rectangle{\tikz@scan@one@point\tikz@lib@view@d}%
+\def\tikz@lib@view@d#1{\def\tikz@lib@view@stored@d{#1}\pgfutil@ifnextchar\pgf@stop\pgfutil@gobble{\tikzerror{Wrong syntax for meet or slice key}}}%
+
+
+\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 09d9a2fa122..7e3ff194bdf 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,7 +7,7 @@
%
% 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.151 2015/08/07 10:17:34 cfeuersaenger Exp $
+\ProvidesPackageRCS{tikz.code.tex}
\def\tikzerror#1{\pgfutil@packageerror{tikz}{#1}{}}
@@ -39,16 +39,15 @@
\newif\iftikz@snaked
\newif\iftikz@decoratepath
-% |\pgfutil@empty| is defined in \file{pgfutil-common.tex}.
-\let\tikz@options=\pgfutil@empty
+\let\tikz@options\pgfutil@empty
% |\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}}
+ \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}}
+ \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.
@@ -57,54 +56,55 @@
#1%
\else
\expandafter\def\expandafter\tikz@transform\expandafter{\tikz@transform#1}%
- \fi}
+ \fi
+}%
% TikZ options management.
% Setting up the tikz key family (key management needs
% \file{pgfkeys.code.tex});
-\pgfkeys{/tikz/.is family}
+\pgfkeys{/tikz/.is family}%
% |\tikzset| is a shortcut to set keys that belongs to the tikz
% family.
-\def\tikzset{\pgfqkeys{/tikz}}
+\def\tikzset{\pgfqkeys{/tikz}}%
% Note: |\tikzoption| is supported for compatibility only. |\tikzset|
% should be used instead.
\def\tikzoption#1{%
\pgfutil@ifnextchar[%]
- {\tikzoption@opt{#1}}{\tikzoption@noopt{#1}}}
+ {\tikzoption@opt{#1}}{\tikzoption@noopt{#1}}}%
\def\tikzoption@opt#1[#2]#3{%
\pgfkeysdef{/tikz/#1}{#3}%
- \pgfkeyssetvalue{/tikz/#1/.@def}{#2}}
+ \pgfkeyssetvalue{/tikz/#1/.@def}{#2}}%
\def\tikzoption@noopt#1#2{%
\pgfkeysdef{/tikz/#1}{#2}%
- \pgfkeyssetvalue{/tikz/#1/.@def}{\pgfkeysvaluerequired}}
+ \pgfkeyssetvalue{/tikz/#1/.@def}{\pgfkeysvaluerequired}}%
% Baseline options
\tikzoption{baseline}[0pt]{%
\pgfutil@ifnextchar(%)
- {\tikz@baseline@coordinate}{\tikz@baseline@simple}#1\@nil}
-\def\tikz@baseline@simple#1\@nil{\pgfsetbaseline{#1}}
+ {\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}}
+ \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}}
+\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}}%
-\def\tikz@semiaddlinewidth#1{\tikz@addoption{\pgfsetlinewidth{#1}}\pgfmathsetlength\pgflinewidth{#1}}
+\def\tikz@semiaddlinewidth#1{\tikz@addoption{\pgfsetlinewidth{#1}}\pgfmathsetlength\pgflinewidth{#1}}%
-\tikzoption{cap}{\tikz@addoption{\csname pgfset#1cap\endcsname}}
-\tikzoption{join}{\tikz@addoption{\csname pgfset#1join\endcsname}}
-\tikzoption{line cap}{\tikz@addoption{\csname pgfset#1cap\endcsname}}
-\tikzoption{line join}{\tikz@addoption{\csname pgfset#1join\endcsname}}
-\tikzoption{miter limit}{\tikz@addoption{\pgfsetmiterlimit{#1}}}
+\tikzoption{cap}{\tikz@addoption{\csname pgfset#1cap\endcsname}}%
+\tikzoption{join}{\tikz@addoption{\csname pgfset#1join\endcsname}}%
+\tikzoption{line cap}{\tikz@addoption{\csname pgfset#1cap\endcsname}}%
+\tikzoption{line join}{\tikz@addoption{\csname pgfset#1join\endcsname}}%
+\tikzoption{miter limit}{\tikz@addoption{\pgfsetmiterlimit{#1}}}%
\tikzoption{dash pattern}{% syntax: on 2pt off 3pt on 4pt ...
\def\tikz@temp{#1}%
@@ -116,23 +116,37 @@
\expandafter\tikz@scandashon\pgfutil@gobble#1o\@nil%
\edef\tikz@temp{{\tikz@dashpattern}{\noexpand\tikz@dashphase}}%
\expandafter\tikz@addoption\expandafter{\expandafter\pgfsetdash\tikz@temp}%
- \fi}
+ \fi}%
\tikzoption{dash phase}{%
\def\tikz@dashphase{#1}%
\edef\tikz@temp{{\tikz@dashpattern}{\noexpand\tikz@dashphase}}%
\expandafter\tikz@addoption\expandafter{\expandafter\pgfsetdash\tikz@temp}%
}%
-\def\tikz@dashphase{0pt}
-\def\tikz@dashpattern{}
+\tikzoption{dash}{\tikz@parse@full@dash#1\pgf@stop}%
+\def\tikz@parse@full@dash#1phase#2\pgf@stop{%
+ \def\tikz@dashphase{#2}%
+ \def\tikz@temp{#1}%
+ \ifx\tikz@temp\pgfutil@empty%
+ \def\tikz@dashpattern{}%
+ \tikz@addoption{\pgfsetdash{}{0pt}}%
+ \else%
+ \def\tikz@dashpattern{}%
+ \expandafter\tikz@scandashon\pgfutil@gobble#1o\@nil%
+ \edef\tikz@temp{{\tikz@dashpattern}{\noexpand\tikz@dashphase}}%
+ \expandafter\tikz@addoption\expandafter{\expandafter\pgfsetdash\tikz@temp}%
+ \fi%
+}%
+\def\tikz@dashphase{0pt}%
+\def\tikz@dashpattern{}%
\def\tikz@scandashon n#1o{%
\expandafter\def\expandafter\tikz@dashpattern\expandafter{\tikz@dashpattern{#1}}%
- \pgfutil@ifnextchar\@nil{\pgfutil@gobble}{\tikz@scandashoff}}
+ \pgfutil@ifnextchar\@nil{\pgfutil@gobble}{\tikz@scandashoff}}%
\def\tikz@scandashoff ff#1o{%
\expandafter\def\expandafter\tikz@dashpattern\expandafter{\tikz@dashpattern{#1}}%
- \pgfutil@ifnextchar\@nil{\pgfutil@gobble}{\tikz@scandashon}}
+ \pgfutil@ifnextchar\@nil{\pgfutil@gobble}{\tikz@scandashon}}%
-\tikzoption{draw opacity}{\tikz@addoption{\pgfsetstrokeopacity{#1}}}
+\tikzoption{draw opacity}{\tikz@addoption{\pgfsetstrokeopacity{#1}}}%
% Double draw options
\tikzoption{double}[]{%
@@ -146,7 +160,7 @@
\fi%
\tikz@addmode{\tikz@mode@doubletrue}%
\tikzset{every double/.try}%
- \fi}
+ \fi}%
\tikzoption{double distance}{%
\pgfmathsetlength{\pgf@x}{#1}%
\edef\tikz@double@setup{%
@@ -156,7 +170,7 @@
\noexpand\pgfsetlinewidth{\pgflinewidth}%
\noexpand\pgfsetinnerlinewidth{\the\pgf@x}%
}%
- \tikzset{double}}
+ \tikzset{double}}%
\def\tikz@double@setup{%
\pgf@x=2\pgflinewidth%
\advance\pgf@x by0.6pt%
@@ -175,28 +189,28 @@
\noexpand\pgfsetlinewidth{\pgflinewidth}%
\noexpand\pgfsetinnerlinewidth{\pgf@xa}%
}%
- \tikzset{double}}}
-\tikzset{double equal sign distance/.style={double distance between line centers=0.45ex}}
+ \tikzset{double}}}%
+\tikzset{double equal sign distance/.style={double distance between line centers=0.45ex}}%
% Fill options
-\tikzoption{even odd rule}[]{\tikz@addoption{\pgfseteorule}}
-\tikzoption{nonzero rule}[]{\tikz@addoption{\pgfsetnonzerorule}}
+\tikzoption{even odd rule}[]{\tikz@addoption{\pgfseteorule}}%
+\tikzoption{nonzero rule}[]{\tikz@addoption{\pgfsetnonzerorule}}%
-\tikzoption{fill opacity}{\tikz@addoption{\pgfsetfillopacity{#1}}}
+\tikzoption{fill opacity}{\tikz@addoption{\pgfsetfillopacity{#1}}}%
% Joined fill/draw options
-\tikzoption{opacity}{\tikz@addoption{\pgfsetstrokeopacity{#1}\pgfsetfillopacity{#1}}}
+\tikzoption{opacity}{\tikz@addoption{\pgfsetstrokeopacity{#1}\pgfsetfillopacity{#1}}}%
% Blend mode
-\tikzset{blend mode/.code={\tikz@addoption{\pgfsetblendmode{#1}}}}
+\tikzset{blend mode/.code={\tikz@addoption{\pgfsetblendmode{#1}}}}%
% Main color options
@@ -220,45 +234,45 @@
\pgfsetcolor{.}%
\pgfsys@color@reset@inordertrue%
}%
- \def\tikz@textcolor{#1}}
+ \def\tikz@textcolor{#1}}%
% Rounding options
-\tikzoption{rounded corners}[4pt]{\pgfsetcornersarced{\pgfpoint{#1}{#1}}}
-\tikzoption{sharp corners}[]{\pgfsetcornersarced{\pgfpointorigin}}
+\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=}
+\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
-\tikzoption{x}{\tikz@handle@vec{\pgfsetxvec}{\tikz@handle@x}#1\relax}
-\tikzoption{y}{\tikz@handle@vec{\pgfsetyvec}{\tikz@handle@y}#1\relax}
-\tikzoption{z}{\tikz@handle@vec{\pgfsetzvec}{\tikz@handle@z}#1\relax}
+\tikzoption{x}{\tikz@handle@vec{\pgfsetxvec}{\tikz@handle@x}#1\relax}%
+\tikzoption{y}{\tikz@handle@vec{\pgfsetyvec}{\tikz@handle@y}#1\relax}%
+\tikzoption{z}{\tikz@handle@vec{\pgfsetzvec}{\tikz@handle@z}#1\relax}%
-\def\tikz@handle@vec#1#2{\pgfutil@ifnextchar({\tikz@handle@coordinate#1}{\tikz@handle@single#2}}
-\def\tikz@handle@coordinate#1{\tikz@scan@one@point#1}
-\def\tikz@handle@single#1#2\relax{#1{#2}}
-\def\tikz@handle@x#1{\pgfsetxvec{\pgfpoint{#1}{0pt}}}
-\def\tikz@handle@y#1{\pgfsetyvec{\pgfpoint{0pt}{#1}}}
-\def\tikz@handle@z#1{\pgfsetzvec{\pgfpoint{#1}{#1}}}
+\def\tikz@handle@vec#1#2{\pgfutil@ifnextchar({\tikz@handle@coordinate#1}{\tikz@handle@single#2}}%
+\def\tikz@handle@coordinate#1{\tikz@scan@one@point#1}%
+\def\tikz@handle@single#1#2\relax{#1{#2}}%
+\def\tikz@handle@x#1{\pgfsetxvec{\pgfpoint{#1}{0pt}}}%
+\def\tikz@handle@y#1{\pgfsetyvec{\pgfpoint{0pt}{#1}}}%
+\def\tikz@handle@z#1{\pgfsetzvec{\pgfpoint{#1}{#1}}}%
% Transformation options
-\tikzoption{scale}{\tikz@addtransform{\pgftransformscale{#1}}}
-\tikzoption{scale around}{\tikz@addtransform{\def\tikz@aroundaction{\pgftransformscale}\tikz@doaround{#1}}}
-\tikzoption{xscale}{\tikz@addtransform{\pgftransformxscale{#1}}}
-\tikzoption{xslant}{\tikz@addtransform{\pgftransformxslant{#1}}}
-\tikzoption{yscale}{\tikz@addtransform{\pgftransformyscale{#1}}}
-\tikzoption{yslant}{\tikz@addtransform{\pgftransformyslant{#1}}}
-\tikzoption{rotate}{\tikz@addtransform{\pgftransformrotate{#1}}}
-\tikzoption{rotate around}{\tikz@addtransform{\def\tikz@aroundaction{\pgftransformrotate}\tikz@doaround{#1}}}
+\tikzoption{scale}{\tikz@addtransform{\pgftransformscale{#1}}}%
+\tikzoption{scale around}{\tikz@addtransform{\def\tikz@aroundaction{\pgftransformscale}\tikz@doaround{#1}}}%
+\tikzoption{xscale}{\tikz@addtransform{\pgftransformxscale{#1}}}%
+\tikzoption{xslant}{\tikz@addtransform{\pgftransformxslant{#1}}}%
+\tikzoption{yscale}{\tikz@addtransform{\pgftransformyscale{#1}}}%
+\tikzoption{yslant}{\tikz@addtransform{\pgftransformyslant{#1}}}%
+\tikzoption{rotate}{\tikz@addtransform{\pgftransformrotate{#1}}}%
+\tikzoption{rotate around}{\tikz@addtransform{\def\tikz@aroundaction{\pgftransformrotate}\tikz@doaround{#1}}}%
\def\tikz@doaround#1{%
\edef\tikz@temp{#1}% get rid of active stuff
\expandafter\tikz@doparseA\tikz@temp%
@@ -266,7 +280,7 @@
\def\tikz@doparseA#1:{%
\def\tikz@temp@rot{#1}%
\tikz@scan@one@point\tikz@doparseB%
-}
+}%
\def\tikz@doparseB#1{%
\pgf@process{#1}%
\pgf@xc=\pgf@x%
@@ -274,21 +288,21 @@
\pgftransformshift{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
\tikz@aroundaction{\tikz@temp@rot}%
\pgftransformshift{\pgfqpoint{-\pgf@xc}{-\pgf@yc}}%
-}
+}%
-\tikzoption{shift}{\tikz@addtransform{\tikz@scan@one@point\pgftransformshift#1\relax}}
-\tikzoption{xshift}{\tikz@addtransform{\pgftransformxshift{#1}}}
-\tikzoption{yshift}{\tikz@addtransform{\pgftransformyshift{#1}}}
-\tikzoption{cm}{\tikz@addtransform{\tikz@parse@cm#1\relax}}
-\tikzoption{reset cm}[]{\tikz@addtransform{\pgftransformreset}}
-\tikzoption{shift only}[]{\tikz@addtransform{\pgftransformresetnontranslations}}
+\tikzoption{shift}{\tikz@addtransform{\tikz@scan@one@point\pgftransformshift#1\relax}}%
+\tikzoption{xshift}{\tikz@addtransform{\pgftransformxshift{#1}}}%
+\tikzoption{yshift}{\tikz@addtransform{\pgftransformyshift{#1}}}%
+\tikzoption{cm}{\tikz@addtransform{\tikz@parse@cm#1\relax}}%
+\tikzoption{reset cm}[]{\tikz@addtransform{\pgftransformreset}}%
+\tikzoption{shift only}[]{\tikz@addtransform{\pgftransformresetnontranslations}}%
\def\tikz@parse@cm#1,#2,#3,#4,{%
\def\tikz@p@cm{{#1}{#2}{#3}{#4}}%
- \tikz@scan@one@point\tikz@parse@cmA}
+ \tikz@scan@one@point\tikz@parse@cmA}%
\def\tikz@parse@cmA#1{%
\expandafter\pgftransformcm\tikz@p@cm{#1}%
-}
+}%
\tikzset{transform canvas/.code=%
{%
@@ -303,7 +317,7 @@
\pgf@relevantforpicturesizefalse%
}%
}%
-}
+}%
\tikzset{turn/.code={%
\pgf@x=0pt%
@@ -318,21 +332,21 @@
{\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@ya}}%
{\pgf@sys@tonumber{\pgf@y}}{\pgf@sys@tonumber{\pgf@x}}{\pgfqpoint{\tikz@lastx}{\tikz@lasty}}%
}%
-}
+}%
\def\tikz@tangent@lookup{%
\pgfgetpath\tikz@temp%
\pgfprocesspathextractpoints\tikz@temp%
\pgfpointsecondlastonpath%
-}
+}%
% Code for rotating the xyz coordinate system
% around the x, y, or z vector.
%
\def\tikz@xyz@rotate@let{%
- \let\pgf@z=\pgf@yc
+ \let\pgf@z=\pgf@yc%
\let\pgf@za=\pgf@xc%
-}
+}%
\def\tikz@xyz@rotate@xyz@xaxis#1#2#3#4{%
\tikz@xyz@rotate@let%
@@ -345,7 +359,7 @@
\advance\pgf@y by-\tikz@xyz@sin\pgf@za%
\pgf@z=\tikz@xyz@sin\pgf@ya%
\advance\pgf@z by\tikz@xyz@cos\pgf@za%
-}
+}%
\def\tikz@xyz@rotate@xyz@yaxis#1#2#3#4{%
\tikz@xyz@rotate@let%
@@ -358,7 +372,7 @@
\advance\pgf@x by\tikz@xyz@sin\pgf@za%
\pgf@z=-\tikz@xyz@sin\pgf@xa%
\advance\pgf@z by\tikz@xyz@cos\pgf@za%
-}
+}%
\def\tikz@xyz@rotate@xyz@zaxis#1#2#3#4{%
\tikz@xyz@rotate@let%
@@ -371,7 +385,7 @@
\advance\pgf@x by-\tikz@xyz@sin\pgf@ya%
\pgf@y=\tikz@xyz@sin\pgf@xa%
\advance\pgf@y by\tikz@xyz@cos\pgf@ya%
-}
+}%
\tikzset{rotate around x/.code={%
\tikz@xyz@rotate@let%
@@ -399,23 +413,23 @@
\tikz@xyz@rotate@xyz@zaxis{0pt}{1pt}{0pt}{\tikz@xyz@angle}%
\pgfsetyvec{\pgfpointxyz{\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@y}}{\pgf@sys@tonumber{\pgf@z}}}%
\pgfsetxvec{\tikz@xyz@rotate@xvec}%
- }
-}
+ },
+}%
% Grid options
-\tikzoption{xstep}{\def\tikz@grid@x{#1}}
-\tikzoption{ystep}{\def\tikz@grid@y{#1}}
-\tikzoption{step}{\tikz@handle@vec{\tikz@step@point}{\tikz@step@single}#1\relax}
-\def\tikz@step@single#1{\def\tikz@grid@x{#1}\def\tikz@grid@y{#1}}
-\def\tikz@step@point#1{\pgf@process{#1}\edef\tikz@grid@x{\the\pgf@x}\edef\tikz@grid@y{\the\pgf@y}}
+\tikzoption{xstep}{\def\tikz@grid@x{#1}}%
+\tikzoption{ystep}{\def\tikz@grid@y{#1}}%
+\tikzoption{step}{\tikz@handle@vec{\tikz@step@point}{\tikz@step@single}#1\relax}%
+\def\tikz@step@single#1{\def\tikz@grid@x{#1}\def\tikz@grid@y{#1}}%
+\def\tikz@step@point#1{\pgf@process{#1}\edef\tikz@grid@x{\the\pgf@x}\edef\tikz@grid@y{\the\pgf@y}}%
-\def\tikz@grid@x{1cm}
-\def\tikz@grid@y{1cm}
+\def\tikz@grid@x{1cm}%
+\def\tikz@grid@y{1cm}%
% Current point updates
\newif\iftikz@current@point@local
-\tikzset{current point is local/.is if=tikz@current@point@local}
+\tikzset{current point is local/.is if=tikz@current@point@local}%
% Path usage options
\newif\iftikz@mode@double
@@ -428,16 +442,16 @@
\newif\iftikz@mode@fade@scope
\let\tikz@mode=\pgfutil@empty
-\def\tikz@nonetext{none}
+\def\tikz@nonetext{none}%
-\tikzoption{path only}[]{\let\tikz@mode=\pgfutil@empty}
+\tikzoption{path only}[]{\let\tikz@mode=\pgfutil@empty}%
\tikzset{
shade/.is choice,
shade/.default=true,
shade/true/.code=\tikz@addmode{\tikz@mode@shadetrue},
shade/false/.code=\tikz@addmode{\tikz@mode@shadefalse},
shade/none/.code=\tikz@addmode{\tikz@mode@shadefalse},
-}
+}%
\tikzoption{fill}[]{%
\edef\tikz@temp{#1}%
@@ -451,7 +465,7 @@
\fi%
\tikz@addmode{\tikz@mode@filltrue}%
\fi%
-}
+}%
\tikzoption{draw}[]{%
\edef\tikz@temp{#1}%
\ifx\tikz@temp\tikz@nonetext%
@@ -464,24 +478,24 @@
\fi%
\tikz@addmode{\tikz@mode@drawtrue}%
\fi%
-}
-\tikzoption{clip}[]{\tikz@addmode{\tikz@mode@cliptrue}}
-\tikzoption{use as bounding box}[]{\tikz@addmode{\tikz@mode@boundarytrue}}
+}%
+\tikzoption{clip}[]{\tikz@addmode{\tikz@mode@cliptrue}}%
+\tikzoption{use as bounding box}[]{\tikz@addmode{\tikz@mode@boundarytrue}}%
-\tikzoption{save path}{\tikz@addmode{\pgfsyssoftpath@getcurrentpath#1\global\let#1=#1}}
+\tikzoption{save path}{\tikz@addmode{\pgfsyssoftpath@getcurrentpath#1\global\let#1=#1}}%
\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}
+\tikzset{insert path/.code=\tikz@scan@next@command#1\pgf@stop}%
% Pattern options
\tikzset{pattern/.code=\tikzerror{You need to say \string\usetikzlibrary{patterns}},
- pattern color/.style=pattern}
+ pattern color/.style=pattern}%
% Path pictures
-\tikzset{path picture/.code=\tikz@addmode{\def\tikz@path@picture{#1}}}
+\tikzset{path picture/.code=\tikz@addmode{\def\tikz@path@picture{#1}}}%
% Fading options
\tikzset{path fading/.code={
@@ -496,7 +510,7 @@
\tikz@addmode{\tikz@mode@fade@pathtrue}%
\fi%
},
- path fading/.default=,
+ path fading/.default=,
scope fading/.code={
\def\tikz@temp{#1}%
\ifx\tikz@temp\tikz@nonetext%
@@ -509,83 +523,83 @@
\tikz@addmode{\tikz@mode@fade@scopetrue}%
\fi%
},
- scope fading/.default=}
-\tikzset{fit fading/.is if=tikz@fade@adjust}
-\tikzset{fading transform/.store in=\tikz@fade@transform}
-\tikzset{fading angle/.style={fading transform={rotate=#1}}}
+ scope fading/.default=}%
+\tikzset{fit fading/.is if=tikz@fade@adjust}%
+\tikzset{fading transform/.store in=\tikz@fade@transform}%
+\tikzset{fading angle/.style={fading transform={rotate=#1}}}%
-\newif\iftikz@fade@adjust
-\tikz@fade@adjusttrue
-\let\tikz@fade@transform\pgfutil@empty
+\newif\iftikz@fade@adjust%
+\tikz@fade@adjusttrue%
+\let\tikz@fade@transform\pgfutil@empty%
-\pgfutil@colorlet{transparent}{pgftransparent}
-\def\tikz@do@fade@transform{\let\tikz@transform=\relax\expandafter\tikzset\expandafter{\tikz@fade@transform}}
+\pgfutil@colorlet{transparent}{pgftransparent}%
+\def\tikz@do@fade@transform{\let\tikz@transform=\relax\expandafter\tikzset\expandafter{\tikz@fade@transform}}%
% Transparency groups
-\newif\iftikz@transparency@group
-\tikzset{/tikz/transparency group/.code=\tikz@transparency@grouptrue\def\tikz@transparency@group@options{isolated=true,#1}\let\tikz@blend@group\pgfutil@empty}
-\tikzset{/tikz/blend group/.code=\tikz@transparency@grouptrue\def\tikz@transparency@group@options{isolated=true}\def\tikz@blend@group{\pgfsetblendmode{#1}}}
+\newif\iftikz@transparency@group%
+\tikzset{/tikz/transparency group/.code=\tikz@transparency@grouptrue\def\tikz@transparency@group@options{isolated=true,#1}\let\tikz@blend@group\pgfutil@empty}%
+\tikzset{/tikz/blend group/.code=\tikz@transparency@grouptrue\def\tikz@transparency@group@options{isolated=true}\def\tikz@blend@group{\pgfsetblendmode{#1}}}%
\let\tikz@blend@group\pgfutil@empty
% Shading options
-\tikzoption{shading}{\def\tikz@shading{#1}\tikz@addmode{\tikz@mode@shadetrue}}
-\tikzoption{shading angle}{\def\tikz@shade@angle{#1}\tikz@addmode{\tikz@mode@shadetrue}}
+\tikzoption{shading}{\def\tikz@shading{#1}\tikz@addmode{\tikz@mode@shadetrue}}%
+\tikzoption{shading angle}{\def\tikz@shade@angle{#1}\tikz@addmode{\tikz@mode@shadetrue}}%
\tikzoption{top color}{%
\pgfutil@colorlet{tikz@axis@top}{#1}%
\pgfutil@colorlet{tikz@axis@middle}{tikz@axis@top!50!tikz@axis@bottom}%
- \def\tikz@shading{axis}\def\tikz@shade@angle{0}\tikz@addmode{\tikz@mode@shadetrue}}
+ \def\tikz@shading{axis}\def\tikz@shade@angle{0}\tikz@addmode{\tikz@mode@shadetrue}}%
\tikzoption{bottom color}{%
\pgfutil@colorlet{tikz@axis@bottom}{#1}%
\pgfutil@colorlet{tikz@axis@middle}{tikz@axis@top!50!tikz@axis@bottom}%
- \def\tikz@shading{axis}\def\tikz@shade@angle{0}\tikz@addmode{\tikz@mode@shadetrue}}
+ \def\tikz@shading{axis}\def\tikz@shade@angle{0}\tikz@addmode{\tikz@mode@shadetrue}}%
\tikzoption{middle color}{%
\pgfutil@colorlet{tikz@axis@middle}{#1}%
- \def\tikz@shading{axis}\tikz@addmode{\tikz@mode@shadetrue}}
+ \def\tikz@shading{axis}\tikz@addmode{\tikz@mode@shadetrue}}%
\tikzoption{left color}{%
\pgfutil@colorlet{tikz@axis@top}{#1}%
\pgfutil@colorlet{tikz@axis@middle}{tikz@axis@top!50!tikz@axis@bottom}%
- \def\tikz@shading{axis}\def\tikz@shade@angle{90}\tikz@addmode{\tikz@mode@shadetrue}}
+ \def\tikz@shading{axis}\def\tikz@shade@angle{90}\tikz@addmode{\tikz@mode@shadetrue}}%
\tikzoption{right color}{%
\pgfutil@colorlet{tikz@axis@bottom}{#1}%
\pgfutil@colorlet{tikz@axis@middle}{tikz@axis@top!50!tikz@axis@bottom}%
- \def\tikz@shading{axis}\def\tikz@shade@angle{90}\tikz@addmode{\tikz@mode@shadetrue}}
-\tikzoption{ball color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{ball}\tikz@addmode{\tikz@mode@shadetrue}}
-\tikzoption{inner color}{\pgfutil@colorlet{tikz@radial@inner}{#1}\def\tikz@shading{radial}\tikz@addmode{\tikz@mode@shadetrue}}
-\tikzoption{outer color}{\pgfutil@colorlet{tikz@radial@outer}{#1}\def\tikz@shading{radial}\tikz@addmode{\tikz@mode@shadetrue}}
+ \def\tikz@shading{axis}\def\tikz@shade@angle{90}\tikz@addmode{\tikz@mode@shadetrue}}%
+\tikzoption{ball color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{ball}\tikz@addmode{\tikz@mode@shadetrue}}%
+\tikzoption{inner color}{\pgfutil@colorlet{tikz@radial@inner}{#1}\def\tikz@shading{radial}\tikz@addmode{\tikz@mode@shadetrue}}%
+\tikzoption{outer color}{\pgfutil@colorlet{tikz@radial@outer}{#1}\def\tikz@shading{radial}\tikz@addmode{\tikz@mode@shadetrue}}%
-\def\tikz@shading{axis}
-\def\tikz@shade@angle{0}
+\def\tikz@shading{axis}%
+\def\tikz@shade@angle{0}%
\pgfdeclareverticalshading[tikz@axis@top,tikz@axis@middle,tikz@axis@bottom]{axis}{100bp}{%
color(0bp)=(tikz@axis@bottom);
color(25bp)=(tikz@axis@bottom);
color(50bp)=(tikz@axis@middle);
color(75bp)=(tikz@axis@top);
- color(100bp)=(tikz@axis@top)}
+ color(100bp)=(tikz@axis@top)}%
-\pgfutil@colorlet{tikz@axis@top}{gray}
-\pgfutil@colorlet{tikz@axis@middle}{gray!50!white}
-\pgfutil@colorlet{tikz@axis@bottom}{white}
+\pgfutil@colorlet{tikz@axis@top}{gray}%
+\pgfutil@colorlet{tikz@axis@middle}{gray!50!white}%
+\pgfutil@colorlet{tikz@axis@bottom}{white}%
\pgfdeclareradialshading[tikz@ball]{ball}{\pgfqpoint{-10bp}{10bp}}{%
color(0bp)=(tikz@ball!15!white);
color(9bp)=(tikz@ball!75!white);
color(18bp)=(tikz@ball!70!black);
color(25bp)=(tikz@ball!50!black);
- color(50bp)=(black)}
+ color(50bp)=(black)}%
-\pgfutil@colorlet{tikz@ball}{blue}
+\pgfutil@colorlet{tikz@ball}{blue}%
\pgfdeclareradialshading[tikz@radial@inner,tikz@radial@outer]{radial}{\pgfpointorigin}{%
color(0bp)=(tikz@radial@inner);
color(25bp)=(tikz@radial@outer);
- color(50bp)=(tikz@radial@outer)}
+ color(50bp)=(tikz@radial@outer)}%
-\pgfutil@colorlet{tikz@radial@inner}{gray}
-\pgfutil@colorlet{tikz@radial@outer}{white}
+\pgfutil@colorlet{tikz@radial@inner}{gray}%
+\pgfutil@colorlet{tikz@radial@outer}{white}%
% Pin options
@@ -598,10 +612,11 @@
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]%
- }%
-}
+ \toks0=\expandafter{\tikz@pin@edge@style@smuggle}%
+ \edef\pgf@marshal{\noexpand\tikzset{tikz@pin@options/.style={\the\toks0}}}%
+ \pgf@marshal
+ },%
+}%
\tikzset{%
pin/.code={%
@@ -617,7 +632,7 @@
{\tikz@parse@pin@nonactive}
{\tikz@parse@pin@nonactive[]}#1:\pgf@nil}%
\fi
- \tikz@next}}
+ \tikz@next}}%
\begingroup
\catcode`\:=\active\relax
@@ -625,8 +640,8 @@
\gdef\tikz@parse@pin@active@i#1{%
\pgfutil@ifnextchar[%]
{\tikz@parse@pin@active}
- {\tikz@parse@pin@active[]}#1:\pgf@nil}
-
+ {\tikz@parse@pin@active[]}#1:\pgf@nil}%
+
\long\gdef\tikz@parse@pin@active[#1]#2:#3\pgf@nil{%
\def\tikz@temp{#3}%
\ifx\tikz@temp\pgfutil@empty
@@ -634,7 +649,7 @@
\tikz@@parse@pin@active[#1]\tikz@pin@default@pos:#2:\pgf@nil%
\else
\tikz@@parse@pin@active[#1]#2:#3\pgf@nil%
- \fi}
+ \fi}%
\long\gdef\tikz@@parse@pin@active[#1]#2:#3:\pgf@nil{%
\tikzset{%
@@ -647,14 +662,14 @@
anchor=@auto,
#1,
append after command = {%
- (\tikz@save@last@node)
+ (\tikz@save@last@node)
edge [every pin edge,
tikz@pre@pin@edge,
- tikz@pin@options]
+ tikz@pin@options]
(\tikzlastnode)},
tikz@label@post = \tikz@pin@distance,
tikz@pin@post] {#3}
- \egroup}}}
+ \egroup}}}%
\endgroup
\long\def\tikz@parse@pin@nonactive[#1]#2:#3\pgf@nil{%
@@ -664,7 +679,7 @@
\tikz@@parse@pin@nonactive[#1]\tikz@pin@default@pos:#2:\pgf@nil%
\else
\tikz@@parse@pin@nonactive[#1]#2:#3\pgf@nil%
- \fi}
+ \fi}%
\long\def\tikz@@parse@pin@nonactive[#1]#2:#3:\pgf@nil{%
\tikzset{%
@@ -677,14 +692,14 @@
anchor=@auto,
#1,
append after command = {%
- (\tikz@save@last@node)
+ (\tikz@save@last@node)
edge [every pin edge,
tikz@pre@pin@edge,
- tikz@pin@options]
+ tikz@pin@options]
(\tikzlastnode)},
tikz@label@post = \tikz@pin@distance,
tikz@pin@post] {#3}
- \egroup}}}
+ \egroup}}}%
% Label and pin options
@@ -695,10 +710,10 @@
label position=above,
absolute/.is if=tikz@absolute,
tikz@label@angle/.store in=\tikz@label@angle
-}
+}%
\newif\iftikz@absolute
-\def\tikz@on@text{center}
+\def\tikz@on@text{center}%
\tikzset{tikz@label@post/.code 2 args={
\edef\tikz@label@angle{\tikz@label@angle}%
@@ -715,7 +730,7 @@
{\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}}}%
+ \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}}%
@@ -734,9 +749,9 @@
\fi%
\fi%
\fi%
- \iftikz@label@simple%
+ \iftikz@label@simple%
\tikz@compute@direction{\tikz@label@angle}%
- \tikz@addtransform{\pgftransformshift{\pgfpointpolar{\tikz@label@angle}{#1}}}%
+ \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}}}}}%
@@ -754,8 +769,8 @@
\fi%
\fi%
\fi}
-}
-
+}%
+
\newif\iftikz@label@simple%
\tikzset{%
@@ -772,7 +787,7 @@
{\tikz@parse@label@nonactive}
{\tikz@parse@label@nonactive[]}#1:\pgf@nil}%
\fi
- \tikz@next}}
+ \tikz@next}}%
\begingroup
\catcode`\:=\active\relax
@@ -780,8 +795,8 @@
\gdef\tikz@parse@label@active@i#1{%
\pgfutil@ifnextchar[%]
{\tikz@parse@label@active}
- {\tikz@parse@label@active[]}#1:\pgf@nil}
-
+ {\tikz@parse@label@active[]}#1:\pgf@nil}%
+
\gdef\tikz@parse@label@active[#1]#2:#3\pgf@nil{%
\def\tikz@temp{#3}%
\ifx\tikz@temp\pgfutil@empty
@@ -795,11 +810,11 @@
\tikz@@parse@label@active[#1]#2:#3\pgf@nil%
\fi
\fi
- }
+ }%
\gdef\tikz@@parse@label@active[#1]#2:#3:\pgf@nil{%
\tikzset{%
- append after command = {%
+ append after command = {%
\bgroup
[current point is local=true]
\pgfextra{\let\tikz@save@last@fig@name=\tikz@last@fig@name\tikz@node@is@a@labelfalse}
@@ -807,9 +822,9 @@
tikz@label@angle = #2,
anchor=@auto,
#1,
- tikz@label@post = \tikz@label@distance] {\iftikz@handle@active@nodes\expandafter\scantokens\else\expandafter\pgfutil@firstofone\fi{#3}}
+ tikz@label@post = \tikz@label@distance] {\iftikz@handle@active@nodes\expandafter\scantokens\else\expandafter\pgfutil@firstofone\fi{#3\ignorespaces}}
\pgfextra{\global\let\tikz@last@fig@name=\tikz@save@last@fig@name}
- \egroup}}}
+ \egroup}}}%
\endgroup
\def\tikz@parse@label@nonactive[#1]#2:#3\pgf@nil{%
@@ -825,30 +840,30 @@
\tikz@@parse@label@nonactive[#1]#2:#3\pgf@nil%
\fi
\fi
-}
+}%
\def\tikz@@parse@label@nonactive[#1]#2:#3:\pgf@nil{%
\tikzset{%
- append after command = {%
+ append after command = {%
\bgroup
[current point is local=true]
\pgfextra{\let\tikz@save@last@fig@name=\tikz@last@fig@name\tikz@node@is@a@labelfalse}
- node [every label,
+ node [every label,
tikz@label@angle = #2,
anchor=@auto,
#1,
- tikz@label@post = \tikz@label@distance] {\iftikz@handle@active@nodes\expandafter\scantokens\else\expandafter\pgfutil@firstofone\fi{#3}}
+ tikz@label@post = \tikz@label@distance] {\iftikz@handle@active@nodes\expandafter\scantokens\else\expandafter\pgfutil@firstofone\fi{#3\ignorespaces}}
\pgfextra{\global\let\tikz@last@fig@name=\tikz@save@last@fig@name}
- \egroup}}}
+ \egroup}}}%
-\expandafter\def\csname tikz@label@angle@is@right\endcsname{\def\tikz@label@angle{0}}
-\expandafter\def\csname tikz@label@angle@is@above right\endcsname{\def\tikz@label@angle{45}}
-\expandafter\def\csname tikz@label@angle@is@above\endcsname{\def\tikz@label@angle{90}}
-\expandafter\def\csname tikz@label@angle@is@above left\endcsname{\def\tikz@label@angle{135}}
-\expandafter\def\csname tikz@label@angle@is@left\endcsname{\def\tikz@label@angle{180}}
-\expandafter\def\csname tikz@label@angle@is@below left\endcsname{\def\tikz@label@angle{225}}
-\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}}
+\expandafter\def\csname tikz@label@angle@is@right\endcsname{\def\tikz@label@angle{0}}%
+\expandafter\def\csname tikz@label@angle@is@above right\endcsname{\def\tikz@label@angle{45}}%
+\expandafter\def\csname tikz@label@angle@is@above\endcsname{\def\tikz@label@angle{90}}%
+\expandafter\def\csname tikz@label@angle@is@above left\endcsname{\def\tikz@label@angle{135}}%
+\expandafter\def\csname tikz@label@angle@is@left\endcsname{\def\tikz@label@angle{180}}%
+\expandafter\def\csname tikz@label@angle@is@below left\endcsname{\def\tikz@label@angle{225}}%
+\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{%
\ifx\tikz@anchor\tikz@auto@text%
@@ -879,87 +894,87 @@
\else%
\def\tikz@anchor{west}%
\fi\fi\fi\fi\fi\fi\fi\fi%
- \fi%
-}
-\def\tikz@auto@text{@auto}
+ \fi%
+}%
+\def\tikz@auto@text{@auto}%
% General node options
\tikzset{
- name/.code={\edef\tikz@fig@name{\tikz@pp@name{#1}}},%
+ name/.code={\edef\tikz@fig@name{\tikz@pp@name{#1}}\let\tikz@id@name\tikz@fig@name},%
name prefix/.initial=,%
name suffix/.initial=%
-}
-\def\tikz@pp@name#1{\csname pgfk@/tikz/name prefix\endcsname#1\csname pgfk@/tikz/name suffix\endcsname}
+}%
+\def\tikz@pp@name#1{\csname pgfk@/tikz/name prefix\endcsname#1\csname pgfk@/tikz/name suffix\endcsname}%
\tikzset{
node contents/.code=\def\tikz@node@content{#1},
- pic type/.code=\def\tikz@node@content{#1}, % alias
-}
+ pic type/.code=\def\tikz@node@content{#1}, % alias
+}%
\tikzset{
behind path/.code=\def\tikz@whichbox{\tikz@figbox@bg},
in front of path/.code=\def\tikz@whichbox{\tikz@figbox}
-}
-\def\tikz@whichbox{\tikz@figbox}
+}%
+\def\tikz@whichbox{\tikz@figbox}%
-\tikzoption{at}{\tikz@scan@one@point\tikz@set@at#1}
+\tikzoption{at}{\tikz@scan@one@point\tikz@set@at#1}%
\def\tikz@set@at#1{\def\tikz@node@at{#1}}%
-\tikzoption{shape}{\edef\tikz@shape{#1}}
+\tikzoption{shape}{\edef\tikz@shape{#1}}%
-\tikzoption{nodes}{\tikzstyle{every node}+=[#1]}
+\tikzoption{nodes}{\tikzset{every node/.append style={#1}}}%
\tikzset{alias/.code={%
\tikz@fig@mustbenamed
- \begingroup
- \toks0=\expandafter{\tikz@alias}%
- \edef\pgf@temp{\noexpand\pgfnodealias{\tikz@pp@name{#1}}{\noexpand\tikz@fig@name}}%
- \toks1=\expandafter{\pgf@temp}%
- \xdef\pgf@marshal{%
- \noexpand\def\noexpand\tikz@alias{\the\toks0 \the\toks1 }%
- }%
- \endgroup
- \pgf@marshal
-}}
+ \begingroup
+ \toks0=\expandafter{\tikz@alias}%
+ \edef\pgf@temp{\noexpand\pgfnodealias{\tikz@pp@name{#1}}{\noexpand\tikz@fig@name}}%
+ \toks1=\expandafter{\pgf@temp}%
+ \xdef\pgf@marshal{%
+ \noexpand\def\noexpand\tikz@alias{\the\toks0 \the\toks1 }%
+ }%
+ \endgroup
+ \pgf@marshal
+}}%
% deprecated:
-\def\tikzaddafternodepathoption#1{#1\tikzset{prefix after command={\pgfextra{#1}}}}
-\tikzset{after node path/.style={append after command={#1}}}
+\def\tikzaddafternodepathoption#1{#1\tikzset{prefix after command={\pgfextra{#1}}}}%
+\tikzset{after node path/.style={append after command={#1}}}%
% Pic options
\newif\iftikz@node@is@pic
-\tikzset{pic text/.store in=\tikzpictext}
+\tikzset{pic text/.store in=\tikzpictext}%
\let\tikzpictext\relax
-\tikzset{pic text options/.store in=\tikzpictextoptions}
+\tikzset{pic text options/.store in=\tikzpictextoptions}%
\let\tikzpictextoptions\pgfutil@empty
% Anchoring
-\tikzoption{anchor}{\def\tikz@anchor{#1}\let\tikz@do@auto@anchor=\relax}
+\tikzoption{anchor}{\def\tikz@anchor{#1}\let\tikz@do@auto@anchor=\relax}%
-\tikzoption{left}[]{\def\tikz@anchor{east}\tikz@possibly@transform{x}{-}{#1}}
-\tikzoption{right}[]{\def\tikz@anchor{west}\tikz@possibly@transform{x}{}{#1}}
-\tikzoption{above}[]{\def\tikz@anchor{south}\tikz@possibly@transform{y}{}{#1}}
-\tikzoption{below}[]{\def\tikz@anchor{north}\tikz@possibly@transform{y}{-}{#1}}
+\tikzoption{left}[]{\def\tikz@anchor{east}\tikz@possibly@transform{x}{-}{#1}}%
+\tikzoption{right}[]{\def\tikz@anchor{west}\tikz@possibly@transform{x}{}{#1}}%
+\tikzoption{above}[]{\def\tikz@anchor{south}\tikz@possibly@transform{y}{}{#1}}%
+\tikzoption{below}[]{\def\tikz@anchor{north}\tikz@possibly@transform{y}{-}{#1}}%
\tikzoption{above left}[]%
{\def\tikz@anchor{south east}%
- \tikz@possibly@transform{x}{-}{#1}\tikz@possibly@transform{y}{}{#1}}
+ \tikz@possibly@transform{x}{-}{#1}\tikz@possibly@transform{y}{}{#1}}%
\tikzoption{above right}[]%
{\def\tikz@anchor{south west}%
- \tikz@possibly@transform{x}{}{#1}\tikz@possibly@transform{y}{}{#1}}
+ \tikz@possibly@transform{x}{}{#1}\tikz@possibly@transform{y}{}{#1}}%
\tikzoption{below left}[]%
{\def\tikz@anchor{north east}%
- \tikz@possibly@transform{x}{-}{#1}\tikz@possibly@transform{y}{-}{#1}}
+ \tikz@possibly@transform{x}{-}{#1}\tikz@possibly@transform{y}{-}{#1}}%
\tikzoption{below right}[]%
{\def\tikz@anchor{north west}%
- \tikz@possibly@transform{x}{}{#1}\tikz@possibly@transform{y}{-}{#1}}
-\tikzset{centered/.code=\def\tikz@anchor{center}}
-
-\tikzoption{node distance}{\def\tikz@node@distance{#1}}
-\def\tikz@node@distance{1cm}
+ \tikz@possibly@transform{x}{}{#1}\tikz@possibly@transform{y}{-}{#1}}%
+\tikzset{centered/.code=\def\tikz@anchor{center}}%
+
+\tikzoption{node distance}{\def\tikz@node@distance{#1}}%
+\def\tikz@node@distance{1cm}%
% The following are deprecated:
\tikzoption{above of}{\tikz@of{#1}{90}}%
@@ -976,17 +991,17 @@
\tikz@addtransform{%
\expandafter\tikz@extract@node@dist\tikz@node@distance and\pgf@stop%
\pgftransformshift{\pgfpointpolar{#2}{\tikz@extracted@node@distance}}}%
- \def\tikz@node@at{\pgfpointanchor{#1}{center}}}
+ \def\tikz@node@at{\pgfpointanchor{#1}{center}}}%
\def\tikz@extract@node@dist#1and#2\pgf@stop{%
- \def\tikz@extracted@node@distance{#1}}
+ \def\tikz@extracted@node@distance{#1}}%
\tikzset{
transform shape nonlinear/.is choice,
transform shape nonlinear/.default=true,
transform shape nonlinear/true/.code=\let\tikz@nlt\relax,
transform shape nonlinear/false/.code=\def\tikz@nlt{\pgfapproximatenonlineartranslation},
- transform shape nonlinear=false
-}
+ transform shape nonlinear=false,
+}%
\tikzoption{transform shape}[true]{%
@@ -996,7 +1011,7 @@
\else%
\pgfresetnontranslationattimetrue%
\fi%
-}
+}%
\newif\iftikz@fullytransformed
\pgfresetnontranslationattimetrue%
@@ -1012,30 +1027,30 @@
\pgfmathsetlength{\pgf@x}{#3}%
\pgf@x=#2\pgf@x\relax%
\edef\tikz@marshal{\noexpand\tikz@addtransform{%
- \expandafter\noexpand\csname pgftransform#1shift\endcsname{\the\pgf@x}}}%
+ \expandafter\noexpand\csname pgftransform#1shift\endcsname{\the\pgf@x}}}%
\tikz@marshal%
\fi%
-}
+}%
% Inter-picture options
\tikzoption{remember picture}[true]{\csname pgfrememberpicturepositiononpage#1\endcsname}
\tikzset{
- overlay/.is choice,
- overlay/true/.code={\pgf@relevantforpicturesizefalse},
- overlay/false/.code={\pgf@relevantforpicturesizetrue},
- overlay/.default=true
+ overlay/.is choice,
+ overlay/true/.code={\pgf@relevantforpicturesizefalse},
+ overlay/false/.code={\pgf@relevantforpicturesizetrue},
+ overlay/.default=true
}
% Line/curve label placement options
-\tikzoption{sloped}[true]{\csname pgfslopedattime#1\endcsname}
-\tikzoption{allow upside down}[true]{\csname pgfallowupsidedownattime#1\endcsname}
+\tikzoption{sloped}[true]{\csname pgfslopedattime#1\endcsname}%
+\tikzoption{allow upside down}[true]{\csname pgfallowupsidedownattime#1\endcsname}%
-\tikzoption{pos}{\edef\tikz@time{#1}\ifx\tikz@time\pgfutil@empty\else\pgfmathsetmacro\tikz@time{\tikz@time}\fi}
+\tikzoption{pos}{\edef\tikz@time{#1}\ifx\tikz@time\pgfutil@empty\else\pgfmathsetmacro\tikz@time{\tikz@time}\fi}%
-\tikzoption{auto}[]{\csname tikz@install@auto@anchor@#1\endcsname}
+\tikzoption{auto}[]{\csname tikz@install@auto@anchor@#1\endcsname}%
\tikzoption{swap}[]{%
\def\tikz@temp{left}%
\ifx\tikz@auto@anchor@direction\tikz@temp%
@@ -1043,39 +1058,39 @@
\else%
\def\tikz@auto@anchor@direction{left}%
\fi%
-}
-\tikzset{'/.style=swap} % shorthand
+}%
+\tikzset{'/.style=swap}% shorthand
-\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}}
-\def\tikz@install@auto@anchor@right{\let\tikz@do@auto@anchor=\tikz@auto@anchor@on\def\tikz@auto@anchor@direction{right}}
+\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}}%
+\def\tikz@install@auto@anchor@right{\let\tikz@do@auto@anchor=\tikz@auto@anchor@on\def\tikz@auto@anchor@direction{right}}%
\let\tikz@do@auto@anchor=\relax%
\def\tikz@auto@anchor@on{\csname tikz@auto@anchor@\tikz@auto@anchor@direction\endcsname}
-\def\tikz@auto@anchor@left{\tikz@auto@pre\tikz@auto@anchor\tikz@auto@post}
-\def\tikz@auto@anchor@right{\tikz@auto@pre\tikz@auto@anchor@prime\tikz@auto@post}
+\def\tikz@auto@anchor@left{\tikz@auto@pre\tikz@auto@anchor\tikz@auto@post}%
+\def\tikz@auto@anchor@right{\tikz@auto@pre\tikz@auto@anchor@prime\tikz@auto@post}%
-\def\tikz@auto@anchor@direction{left}
+\def\tikz@auto@anchor@direction{left}%
% Text options
-\tikzoption{text}{\def\tikz@textcolor{#1}}
-\tikzoption{font}{\def\tikz@textfont{#1}}
-\tikzoption{node font}{\def\tikz@node@textfont{#1}}
-\tikzoption{text opacity}{\def\tikz@textopacity{#1}}
-\tikzoption{text width}{\def\tikz@text@width{#1}}
-\tikzoption{text height}{\def\tikz@text@height{#1}}
-\tikzoption{text depth}{\def\tikz@text@depth{#1}}
+\tikzoption{text}{\def\tikz@textcolor{#1}}%
+\tikzoption{font}{\def\tikz@textfont{#1}}%
+\tikzoption{node font}{\def\tikz@node@textfont{#1}}%
+\tikzoption{text opacity}{\def\tikz@textopacity{#1}}%
+\tikzoption{text width}{\def\tikz@text@width{#1}}%
+\tikzoption{text height}{\def\tikz@text@height{#1}}%
+\tikzoption{text depth}{\def\tikz@text@depth{#1}}%
\tikzoption{text ragged}[]%
-{\def\tikz@text@action{\pgfutil@raggedright\rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax}}
-\tikzoption{text badly ragged}[]{\def\tikz@text@action{\pgfutil@raggedright\relax}}
+{\def\tikz@text@action{\pgfutil@raggedright\rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax}}%
+\tikzoption{text badly ragged}[]{\def\tikz@text@action{\pgfutil@raggedright\relax}}%
\tikzoption{text ragged left}[]%
-{\def\tikz@text@action{\pgfutil@raggedleft\leftskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax}}
-\tikzoption{text badly ragged left}[]{\def\tikz@text@action{\pgfutil@raggedleft\relax}}
-\tikzoption{text justified}[]{\def\tikz@text@action{\leftskip0pt\rightskip0pt\relax}}
+{\def\tikz@text@action{\pgfutil@raggedleft\leftskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax}}%
+\tikzoption{text badly ragged left}[]{\def\tikz@text@action{\pgfutil@raggedleft\relax}}%
+\tikzoption{text justified}[]{\def\tikz@text@action{\leftskip0pt\rightskip0pt\relax}}%
\tikzoption{text centered}[]{\def\tikz@text@action{%
\leftskip0pt plus2em%
\rightskip0pt plus2em%
@@ -1083,14 +1098,14 @@
\parfillskip=0pt%
\iftikz@warn@for@narrow@centered\else\hbadness10000\fi%
\let\\=\@centercr% for latex
- \relax}}
+ \relax}}%
\tikzoption{text badly centered}[]%
{\def\tikz@text@action{%
\let\\=\@centercr% for latex
\parfillskip=0pt%
\rightskip\pgfutil@flushglue%
- \leftskip\pgfutil@flushglue\relax}}
-\tikzset{badness warnings for centered text/.is if=tikz@warn@for@narrow@centered}
+ \leftskip\pgfutil@flushglue\relax}}%
+\tikzset{badness warnings for centered text/.is if=tikz@warn@for@narrow@centered}%
\newif\iftikz@warn@for@narrow@centered
\let\tikz@text@width=\pgfutil@empty
@@ -1101,7 +1116,7 @@
\let\tikz@textopacity=\pgfutil@empty
\let\tikz@node@textfont=\pgfutil@empty
-\def\tikz@text@action{\pgfutil@raggedright\rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax}
+\def\tikz@text@action{\pgfutil@raggedright\rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax}%
% Alignment
@@ -1115,23 +1130,23 @@
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}
+ 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}%
% Arrow options
-\tikzoption{arrows}{\tikz@processarrows{#1}}
+\tikzoption{arrows}{\tikz@processarrows{#1}}%
\tikzoption{>}{\pgfdeclarearrow{name=<->,means={#1}}}%
-\pgfdeclarearrow{name=|<->|, means={>[sep=0pt].|}}
+\pgfdeclarearrow{name=|<->|, means={>[sep=0pt].|}}%
-\tikzoption{shorten <}{\pgfsetshortenstart{#1}}
-\tikzoption{shorten >}{\pgfsetshortenend{#1}}
+\tikzoption{shorten <}{\pgfsetshortenstart{#1}}%
+\tikzoption{shorten >}{\pgfsetshortenend{#1}}%
\def\tikz@processarrows#1{%
\def\tikz@current@arrows{#1}%
@@ -1140,94 +1155,94 @@
\else%
\pgfsetarrows{#1}%
\fi%
-}
+}%
-\def\tikz@current@arrows{-}
+\def\tikz@current@arrows{-}%
% Parabola options
\tikzoption{bend}{\tikz@scan@one@point\tikz@set@parabola@bend#1\relax}%
-\tikzoption{bend pos}{\def\tikz@parabola@bend@factor{#1}}
+\tikzoption{bend pos}{\def\tikz@parabola@bend@factor{#1}}%
\tikzoption{parabola height}{%
\def\tikz@parabola@bend@factor{.5}%
- \def\tikz@parabola@bend{\pgfpointadd{\pgfpoint{0pt}{#1}}{\tikz@last@position@saved}}}
+ \def\tikz@parabola@bend{\pgfpointadd{\pgfpoint{0pt}{#1}}{\tikz@last@position@saved}}}%
-\def\tikz@parabola@bend{\tikz@last@position@saved}
-\def\tikz@parabola@bend@factor{0}
+\def\tikz@parabola@bend{\tikz@last@position@saved}%
+\def\tikz@parabola@bend@factor{0}%
-\def\tikz@set@parabola@bend#1{\def\tikz@parabola@bend{#1}}
+\def\tikz@set@parabola@bend#1{\def\tikz@parabola@bend{#1}}%
% Axis options
-\tikzoption{domain}{\edef\tikz@plot@domain{#1}\expandafter\tikz@plot@samples@recalc\tikz@plot@domain\relax}
-\tikzoption{range}{\def\tikz@plot@range{#1}}
-\tikzoption{yrange}{\def\tikz@plot@range{#1}}
+\tikzoption{domain}{\edef\tikz@plot@domain{#1}\expandafter\tikz@plot@samples@recalc\tikz@plot@domain\relax}%
+\tikzoption{range}{\def\tikz@plot@range{#1}}%
+\tikzoption{yrange}{\def\tikz@plot@range{#1}}%
\let\tikz@plot@range=\pgfutil@empty
-\tikzoption{xrange}{\def\tikz@plot@xrange{#1}}
+\tikzoption{xrange}{\def\tikz@plot@xrange{#1}}%
\let\tikz@plot@xrange=\pgfutil@empty
% Plot options
-\tikzoption{smooth}[]{\let\tikz@plot@handler=\pgfplothandlercurveto}
-\tikzoption{smooth cycle}[]{\let\tikz@plot@handler=\pgfplothandlerclosedcurve}
-\tikzoption{sharp plot}[]{\let\tikz@plot@handler\pgfplothandlerlineto}
-\tikzoption{sharp cycle}[]{\let\tikz@plot@handler\pgfplothandlerpolygon}
-
-\tikzoption{tension}{\pgfsetplottension{#1}}
-
-\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{const plot mark mid}[]{\let\tikz@plot@handler=\pgfplothandlerconstantlinetomarkmid}
-\tikzoption{jump mark right}[]{\let\tikz@plot@handler=\pgfplothandlerjumpmarkright}
-\tikzoption{jump mark mid}[]{\let\tikz@plot@handler=\pgfplothandlerjumpmarkmid}
-\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}}
-\tikzoption{id}{\def\tikz@plot@id{#1}}
-
-\tikzoption{samples}{\pgfmathsetmacro\tikz@plot@samples{max(2,#1)}\expandafter\tikz@plot@samples@recalc\tikz@plot@domain\relax}
-\tikzoption{samples at}{\def\tikz@plot@samplesat{#1}}
-\tikzoption{parametric}[true]{\csname tikz@plot@parametric#1\endcsname}
-
-\tikzoption{variable}{\def\tikz@plot@var{#1}}
-
-\tikzoption{only marks}[]{\let\tikz@plot@handler\pgfplothandlerdiscard}
+\tikzoption{smooth}[]{\let\tikz@plot@handler=\pgfplothandlercurveto}%
+\tikzoption{smooth cycle}[]{\let\tikz@plot@handler=\pgfplothandlerclosedcurve}%
+\tikzoption{sharp plot}[]{\let\tikz@plot@handler\pgfplothandlerlineto}%
+\tikzoption{sharp cycle}[]{\let\tikz@plot@handler\pgfplothandlerpolygon}%
+
+\tikzoption{tension}{\pgfsetplottension{#1}}%
+
+\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{const plot mark mid}[]{\let\tikz@plot@handler=\pgfplothandlerconstantlinetomarkmid}%
+\tikzoption{jump mark right}[]{\let\tikz@plot@handler=\pgfplothandlerjumpmarkright}%
+\tikzoption{jump mark mid}[]{\let\tikz@plot@handler=\pgfplothandlerjumpmarkmid}%
+\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}}%
+\tikzoption{id}{\def\tikz@plot@id{#1}}%
+
+\tikzoption{samples}{\pgfmathsetmacro\tikz@plot@samples{max(2,#1)}\expandafter\tikz@plot@samples@recalc\tikz@plot@domain\relax}%
+\tikzoption{samples at}{\def\tikz@plot@samplesat{#1}}%
+\tikzoption{parametric}[true]{\csname tikz@plot@parametric#1\endcsname}%
+
+\tikzoption{variable}{\def\tikz@plot@var{#1}}%
+
+\tikzoption{only marks}[]{\let\tikz@plot@handler\pgfplothandlerdiscard}%
\tikzoption{mark}{%
- \def\tikz@plot@mark{#1}%
- \def\tikz@temp{none}%
- \ifx\tikz@temp\tikz@plot@mark
- \let\tikz@plot@mark=\pgfutil@empty
- \fi
-}
+ \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}}
-\tikzoption{mark phase}{\pgfsetplotmarkphase{#1}}
-\tikzoption{mark repeat}{\pgfsetplotmarkrepeat{#1}}
+ 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}}%
+\tikzoption{mark phase}{\pgfsetplotmarkphase{#1}}%
+\tikzoption{mark repeat}{\pgfsetplotmarkrepeat{#1}}%
\let\tikz@mark@list=\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.5833333,...,5}
+\def\tikz@plot@samples{25}%
+\def\tikz@plot@domain{-5:5}%
+\def\tikz@plot@var{\x}%
+\def\tikz@plot@samplesat{-5,-4.5833333,...,5}%
\def\tikz@plot@samples@recalc#1:#2\relax{%
\begingroup
\pgfmathparse{#1}%
@@ -1251,11 +1266,11 @@
\fi%
\pgfmath@smuggleone\tikz@plot@samplesat
\endgroup
-}
+}%
-\def\tikz@plot@prefix{\jobname.}
-\def\tikz@plot@id{pgf-plot}
+\def\tikz@plot@prefix{\jobname.}%
+\def\tikz@plot@id{pgf-plot}%
\newif\iftikz@plot@parametric
\newif\iftikz@plot@raw@gnuplot
@@ -1264,11 +1279,11 @@
%
% To and edge options
%
-\tikzoption{to path}{\def\tikz@to@path{#1}}
+\tikzoption{to path}{\def\tikz@to@path{#1}}%
-\def\tikz@to@path{-- (\tikztotarget) \tikztonodes}
+\def\tikz@to@path{-- (\tikztotarget) \tikztonodes}%
-\tikzset{edge macro/.store in=\tikz@edge@macro}
+\tikzset{edge macro/.store in=\tikz@edge@macro}%
\let\tikz@edge@macro\pgfutil@empty
\tikzset{
@@ -1276,8 +1291,8 @@
\expandafter\def\expandafter\tikz@tonodes\expandafter{\tikz@tonodes #1}
},
edge label/.style={/tikz/edge node={node[auto]{#1}}},
- edge label'/.style={/tikz/edge node={node[auto,swap]{#1}}}
-}
+ edge label'/.style={/tikz/edge node={node[auto,swap]{#1}}},
+}%
% After command options
@@ -1289,36 +1304,36 @@
\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
-\pgfkeys{/tikz/missing/.is if=tikz@child@missing}
+\pgfkeys{/tikz/missing/.is if=tikz@child@missing}%
-\tikzset{edge from parent macro/.initial=\tikz@edge@from@parent@macro}
+\tikzset{edge from parent macro/.initial=\tikz@edge@from@parent@macro}%
\def\tikz@edge@from@parent@macro#1#2{
- [style=edge from parent, #1, /utils/exec=\tikz@node@is@a@labeltrue] \tikz@edge@to@parent@path #2}
+ [style=edge from parent, #1, /utils/exec=\tikz@node@is@a@labeltrue] \tikz@edge@to@parent@path #2}%
-\tikzoption{edge from parent path}{\def\tikz@edge@to@parent@path{#1}}
+\tikzoption{edge from parent path}{\def\tikz@edge@to@parent@path{#1}}%
-\tikzoption{parent anchor}{\def\tikzparentanchor{.#1}\ifx\tikzparentanchor\tikz@border@text\let\tikzparentanchor\pgfutil@empty\fi}
-\tikzoption{child anchor}{\def\tikzchildanchor{.#1}\ifx\tikzchildanchor\tikz@border@text\let\tikzchildanchor\pgfutil@empty\fi}
+\tikzoption{parent anchor}{\def\tikzparentanchor{.#1}\ifx\tikzparentanchor\tikz@border@text\let\tikzparentanchor\pgfutil@empty\fi}%
+\tikzoption{child anchor}{\def\tikzchildanchor{.#1}\ifx\tikzchildanchor\tikz@border@text\let\tikzchildanchor\pgfutil@empty\fi}%
-\tikzoption{level distance}{\pgfmathsetlength\tikzleveldistance{#1}}
-\tikzoption{sibling distance}{\pgfmathsetlength\tikzsiblingdistance{#1}}
+\tikzoption{level distance}{\pgfmathsetlength\tikzleveldistance{#1}}%
+\tikzoption{sibling distance}{\pgfmathsetlength\tikzsiblingdistance{#1}}%
-\tikzoption{growth function}{\let\tikz@grow=#1}
+\tikzoption{growth function}{\let\tikz@grow=#1}%
-\tikzset{grow siblings on line/.style={growth function=\tikz@grow@direction}}
+\tikzset{grow siblings on line/.style={growth function=\tikz@grow@direction}}%
-\tikzoption{growth parent anchor}{\def\tikz@growth@anchor{#1}}
+\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}}%
-\def\tikz@growth@anchor{center}
+\def\tikz@growth@anchor{center}%
\def\tikz@special@level{-1}% never
@@ -1341,30 +1356,30 @@
\edef\tikz@angle@grow@left{\the\c@pgf@counta}%
\advance\c@pgf@counta by180\relax%
\edef\tikz@angle@grow@right{\the\c@pgf@counta}%
-}
+}%
-\def\tikz@border@text{.border}
+\def\tikz@border@text{.border}%
\let\tikzparentanchor=\pgfutil@empty
\let\tikzchildanchor=\pgfutil@empty
-\def\tikz@edge@to@parent@path{(\tikzparentnode\tikzparentanchor) -- (\tikzchildnode\tikzchildanchor)}
+\def\tikz@edge@to@parent@path{(\tikzparentnode\tikzparentanchor) -- (\tikzchildnode\tikzchildanchor)}%
-\tikzleveldistance=15mm
-\tikzsiblingdistance=15mm
+\tikzleveldistance=15mm%
+\tikzsiblingdistance=15mm%
-\def\tikz@grow@direction@down{-90}
-\def\tikz@grow@direction@up{90}
-\def\tikz@grow@direction@left{180}
-\def\tikz@grow@direction@right{0}
+\def\tikz@grow@direction@down{-90}%
+\def\tikz@grow@direction@up{90}%
+\def\tikz@grow@direction@left{180}%
+\def\tikz@grow@direction@right{0}%
-\def\tikz@grow@direction@south{-90}
-\def\tikz@grow@direction@north{90}
-\def\tikz@grow@direction@west{180}
-\def\tikz@grow@direction@east{0}
+\def\tikz@grow@direction@south{-90}%
+\def\tikz@grow@direction@north{90}%
+\def\tikz@grow@direction@west{180}%
+\def\tikz@grow@direction@east{0}%
-\expandafter\def\csname tikz@grow@direction@north east\endcsname{45}
-\expandafter\def\csname tikz@grow@direction@north west\endcsname{135}
-\expandafter\def\csname tikz@grow@direction@south east\endcsname{-45}
-\expandafter\def\csname tikz@grow@direction@south west\endcsname{-135}
+\expandafter\def\csname tikz@grow@direction@north east\endcsname{45}%
+\expandafter\def\csname tikz@grow@direction@north west\endcsname{135}%
+\expandafter\def\csname tikz@grow@direction@south east\endcsname{-45}%
+\expandafter\def\csname tikz@grow@direction@south west\endcsname{-135}%
\def\tikz@grow@direction{%
\pgftransformshift{\pgfpointpolar{\tikz@angle@grow}{\tikzleveldistance}}%
@@ -1377,30 +1392,30 @@
\pgftransformshift{\pgfpointpolar{\tikz@angle@grow@left}{\pgfutil@tempdima}}%
\pgftransformshift{\pgfpointpolar{\tikz@angle@grow@right}{\tikznumberofcurrentchild\tikzsiblingdistance}}%
\fi%
-}
+}%
-\tikzset{grow=down}
+\tikzset{grow=down}%
% Snakes are in a lib:
-\tikzset{snake/.code=\tikzerror{You need to say \string\usetikzlibrary{snakes}}}
+\tikzset{snake/.code=\tikzerror{You need to say \string\usetikzlibrary{snakes}}}%
% Decorations
-\tikzset{decorate/.code=\tikzerror{You need to load a decoration library}}
+\tikzset{decorate/.code=\tikzerror{You need to load a decoration library}}%
% Matrix options
-\usepgfmodule{matrix}
+\usepgfmodule{matrix}%
-\tikzoption{matrix}[true]{\csname tikz@is@matrix#1\endcsname}
+\tikzoption{matrix}[true]{\csname tikz@is@matrix#1\endcsname}%
-\tikzoption{matrix anchor}{\def\tikz@matrix@anchor{#1}}
+\tikzoption{matrix anchor}{\def\tikz@matrix@anchor{#1}}%
-\tikzoption{column sep}{\def\pgfmatrixcolumnsep{#1}}
-\tikzoption{row sep}{\def\pgfmatrixrowsep{#1}}
+\tikzoption{column sep}{\def\pgfmatrixcolumnsep{#1}}%
+\tikzoption{row sep}{\def\pgfmatrixrowsep{#1}}%
-\tikzoption{cells}{\tikzstyle{every cell}+=[#1]}
+\tikzoption{cells}{\tikzset{every cell/.append style={#1}}}%
-\tikzoption{ampersand replacement}{\def\tikz@ampersand@replacement{#1}}
+\tikzoption{ampersand replacement}{\def\tikz@ampersand@replacement{#1}}%
\newif\iftikz@is@matrix
\let\tikz@matrix@anchor=\pgfutil@empty
@@ -1411,25 +1426,25 @@
\tikzset{%
handle active characters in code/.is if=tikz@handle@active@code,
handle active characters in nodes/.is if=tikz@handle@active@nodes,
-}
+}%
\newif\iftikz@handle@active@code
\newif\iftikz@handle@active@nodes
% Execute option
-\tikzoption{execute at begin picture}{\expandafter\def\expandafter\tikz@atbegin@picture\expandafter{\tikz@atbegin@picture#1}}
-\tikzoption{execute at end picture}{\expandafter\def\expandafter\tikz@atend@picture\expandafter{\tikz@atend@picture#1}}
-\tikzoption{execute at begin scope}{\expandafter\def\expandafter\tikz@atbegin@scope\expandafter{\tikz@atbegin@scope#1}}
-\tikzoption{execute at end scope}{\expandafter\def\expandafter\tikz@atend@scope\expandafter{\tikz@atend@scope#1}}
-\tikzoption{execute at begin to}{\expandafter\def\expandafter\tikz@atbegin@to\expandafter{\tikz@atbegin@to#1}}
-\tikzoption{execute at end to}{\expandafter\def\expandafter\tikz@atend@to\expandafter{\tikz@atend@to#1}}
-\tikzoption{execute at begin node}{\expandafter\def\expandafter\tikz@atbegin@node\expandafter{\tikz@atbegin@node#1}}
-\tikzoption{execute at end node}{\expandafter\def\expandafter\tikz@atend@node\expandafter{\tikz@atend@node#1}}
-\tikzoption{execute at begin matrix}{\expandafter\def\expandafter\tikz@atbegin@matrix\expandafter{\tikz@atbegin@matrix#1}}
-\tikzoption{execute at end matrix}{\expandafter\def\expandafter\tikz@atend@matrix\expandafter{\tikz@atend@matrix#1}}
-\tikzoption{execute at begin cell}{\expandafter\def\expandafter\tikz@atbegin@cell\expandafter{\tikz@atbegin@cell#1}}
-\tikzoption{execute at end cell}{\expandafter\def\expandafter\tikz@atend@cell\expandafter{\tikz@atend@cell#1}}
-\tikzoption{execute at empty cell}{\expandafter\def\expandafter\tikz@at@emptycell\expandafter{\tikz@at@emptycell#1}}
+\tikzoption{execute at begin picture}{\expandafter\def\expandafter\tikz@atbegin@picture\expandafter{\tikz@atbegin@picture#1}}%
+\tikzoption{execute at end picture}{\expandafter\def\expandafter\tikz@atend@picture\expandafter{\tikz@atend@picture#1}}%
+\tikzoption{execute at begin scope}{\expandafter\def\expandafter\tikz@atbegin@scope\expandafter{\tikz@atbegin@scope#1}}%
+\tikzoption{execute at end scope}{\expandafter\def\expandafter\tikz@atend@scope\expandafter{\tikz@atend@scope#1}}%
+\tikzoption{execute at begin to}{\expandafter\def\expandafter\tikz@atbegin@to\expandafter{\tikz@atbegin@to#1}}%
+\tikzoption{execute at end to}{\expandafter\def\expandafter\tikz@atend@to\expandafter{\tikz@atend@to#1}}%
+\tikzoption{execute at begin node}{\expandafter\def\expandafter\tikz@atbegin@node\expandafter{\tikz@atbegin@node#1}}%
+\tikzoption{execute at end node}{\expandafter\def\expandafter\tikz@atend@node\expandafter{\tikz@atend@node#1}}%
+\tikzoption{execute at begin matrix}{\expandafter\def\expandafter\tikz@atbegin@matrix\expandafter{\tikz@atbegin@matrix#1}}%
+\tikzoption{execute at end matrix}{\expandafter\def\expandafter\tikz@atend@matrix\expandafter{\tikz@atend@matrix#1}}%
+\tikzoption{execute at begin cell}{\expandafter\def\expandafter\tikz@atbegin@cell\expandafter{\tikz@atbegin@cell#1}}%
+\tikzoption{execute at end cell}{\expandafter\def\expandafter\tikz@atend@cell\expandafter{\tikz@atend@cell#1}}%
+\tikzoption{execute at empty cell}{\expandafter\def\expandafter\tikz@at@emptycell\expandafter{\tikz@at@emptycell#1}}%
\let\tikz@atbegin@picture=\pgfutil@empty
\let\tikz@atend@picture=\pgfutil@empty
@@ -1447,17 +1462,17 @@
% Pre and post actions
-\tikzset{preaction/.code=\expandafter\def\expandafter\tikz@preactions\expandafter{\tikz@preactions\tikz@extra@preaction{#1}}}
-\tikzset{postaction/.code=\expandafter\def\expandafter\tikz@postactions\expandafter{\tikz@postactions\tikz@extra@postaction{#1}}}
+\tikzset{preaction/.code=\expandafter\def\expandafter\tikz@preactions\expandafter{\tikz@preactions\tikz@extra@preaction{#1}}}%
+\tikzset{postaction/.code=\expandafter\def\expandafter\tikz@postactions\expandafter{\tikz@postactions\tikz@extra@postaction{#1}}}%
\let\tikz@preactions=\pgfutil@empty
\let\tikz@postactions=\pgfutil@empty
% Styles
-\tikzoption{set style}{\tikzstyle#1}
+\tikzoption{set style}{\tikzstyle#1}%
% Handled in a special way.
-\def\tikzstyle{\pgfutil@ifnextchar\bgroup\tikz@style@parseA\tikz@style@parseB}
-\def\tikz@style@parseB#1={\tikz@style@parseA{#1}=}
+\def\tikzstyle{\pgfutil@ifnextchar\bgroup\tikz@style@parseA\tikz@style@parseB}%
+\def\tikz@style@parseB#1={\tikz@style@parseA{#1}=}%
\def\tikz@style@parseA#1#2=#3[#4]{% check for an optional argument
\pgfutil@in@[{#2}%]
\ifpgfutil@in@%
@@ -1474,14 +1489,14 @@
\pgfkeys{/tikz/#1/.append style={#4}}%
\else%
\pgfkeys{/tikz/#1/.style={#4}}%
- \fi}
+ \fi}%
\def\tikz@style@parseD#1#2=#3{%
\pgfutil@in@+{#2}%
\ifpgfutil@in@%
\pgfkeys{/tikz/#1/.append style={#3}}%
\else%
\pgfkeys{/tikz/#1/.style={#3}}%
- \fi}
+ \fi}%
%
@@ -1490,86 +1505,103 @@
%
%
-\tikzstyle{help lines}= [color=gray,line width=0.2pt]
-
-\tikzstyle{every picture}= []
-\tikzstyle{every path}= []
-\tikzstyle{every scope}= []
-\tikzstyle{every plot}= []
-\tikzstyle{every node}= []
-\tikzstyle{every child}= []
-\tikzstyle{every child node}= []
-\tikzstyle{every to}= []
-\tikzstyle{every cell}= []
-\tikzstyle{every matrix}= []
-\tikzstyle{every edge}= [draw]
-\tikzstyle{every label}= [draw=none,fill=none]
-\tikzstyle{every pin}= [draw=none,fill=none]
-\tikzstyle{every pin edge}= [help lines]
-
-\tikzstyle{ultra thin}= [line width=0.1pt]
-\tikzstyle{very thin}= [line width=0.2pt]
-\tikzstyle{thin}= [line width=0.4pt]
-\tikzstyle{semithick}= [line width=0.6pt]
-\tikzstyle{thick}= [line width=0.8pt]
-\tikzstyle{very thick}= [line width=1.2pt]
-\tikzstyle{ultra thick}= [line width=1.6pt]
-
-\tikzstyle{solid}= [dash pattern=]
-\tikzstyle{dotted}= [dash pattern=on \pgflinewidth off 2pt]
-\tikzstyle{densely dotted}= [dash pattern=on \pgflinewidth off 1pt]
-\tikzstyle{loosely dotted}= [dash pattern=on \pgflinewidth off 4pt]
-\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{dash dot}= [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{densely dash dot}= [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{loosely dash dot}= [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{dash dot dot}= [dash pattern=on 3pt off 2pt on \the\pgflinewidth off 2pt on \the\pgflinewidth off 2pt]
-\tikzstyle{densely dash dot dot}= [dash pattern=on 3pt off 1pt on \the\pgflinewidth off 1pt on \the\pgflinewidth off 1pt]
-\tikzstyle{loosely dash dot dot}= [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]
-\tikzstyle{very nearly transparent}= [opacity=0.1]
-\tikzstyle{nearly transparent}= [opacity=0.25]
-\tikzstyle{semitransparent}= [opacity=0.5]
-\tikzstyle{nearly opaque}= [opacity=0.75]
-\tikzstyle{very nearly opaque}= [opacity=0.9]
-\tikzstyle{ultra nearly opaque}= [opacity=0.95]
-\tikzstyle{opaque}= [opacity=1]
-
-\tikzstyle{at start}= [pos=0]
-\tikzstyle{very near start}= [pos=0.125]
-\tikzstyle{near start}= [pos=0.25]
-\tikzstyle{midway}= [pos=0.5]
-\tikzstyle{near end}= [pos=0.75]
-\tikzstyle{very near end}= [pos=0.875]
-\tikzstyle{at end}= [pos=1]
-
-\tikzstyle{bend at start}= [bend pos=0,bend={+(0,0)}]
-\tikzstyle{bend at end}= [bend pos=1,bend={+(0,0)}]
-
-\tikzstyle{edge from parent}= [draw]
+\tikzset{help lines/.style= {color=gray,line width=0.2pt}}%
+
+\tikzset{every picture/.style= {}}%
+\tikzset{every path/.style= {}}%
+\tikzset{every scope/.style= {}}%
+\tikzset{every plot/.style= {}}%
+\tikzset{every node/.style= {}}%
+\tikzset{every child/.style= {}}%
+\tikzset{every child node/.style= {}}%
+\tikzset{every to/.style= {}}%
+\tikzset{every cell/.style= {}}%
+\tikzset{every matrix/.style= {}}%
+\tikzset{every edge/.style= {draw}}%
+\tikzset{every label/.style= {draw=none,fill=none}}%
+\tikzset{every pin/.style= {draw=none,fill=none}}%
+\tikzset{every pin edge/.style= {help lines}}%
+
+\tikzset{ultra thin/.style= {line width=0.1pt}}%
+\tikzset{very thin/.style= {line width=0.2pt}}%
+\tikzset{thin/.style= {line width=0.4pt}}%
+\tikzset{semithick/.style= {line width=0.6pt}}%
+\tikzset{thick/.style= {line width=0.8pt}}%
+\tikzset{very thick/.style= {line width=1.2pt}}%
+\tikzset{ultra thick/.style= {line width=1.6pt}}%
+
+\tikzset{solid/.style= {dash pattern=}}%
+\tikzset{dotted/.style= {dash pattern=on \pgflinewidth off 2pt}}%
+\tikzset{densely dotted/.style= {dash pattern=on \pgflinewidth off 1pt}}%
+\tikzset{loosely dotted/.style= {dash pattern=on \pgflinewidth off 4pt}}%
+\tikzset{dashed/.style= {dash pattern=on 3pt off 3pt}}%
+\tikzset{densely dashed/.style= {dash pattern=on 3pt off 2pt}}%
+\tikzset{loosely dashed/.style= {dash pattern=on 3pt off 6pt}}%
+\tikzset{dashdotted/.style= {dash pattern=on 3pt off 2pt on \the\pgflinewidth off 2pt}}%
+\tikzset{dash dot/.style= {dash pattern=on 3pt off 2pt on \the\pgflinewidth off 2pt}}%
+\tikzset{densely dashdotted/.style= {dash pattern=on 3pt off 1pt on \the\pgflinewidth off 1pt}}%
+\tikzset{densely dash dot/.style= {dash pattern=on 3pt off 1pt on \the\pgflinewidth off 1pt}}%
+\tikzset{loosely dashdotted/.style= {dash pattern=on 3pt off 4pt on \the\pgflinewidth off 4pt}}%
+\tikzset{loosely dash dot/.style= {dash pattern=on 3pt off 4pt on \the\pgflinewidth off 4pt}}%
+\tikzset{dashdotdotted/.style= {dash pattern=on 3pt off 2pt on \the\pgflinewidth off 2pt on \the\pgflinewidth off 2pt}}%
+\tikzset{densely dashdotdotted/.style= {dash pattern=on 3pt off 1pt on \the\pgflinewidth off 1pt on \the\pgflinewidth off 1pt}}%
+\tikzset{loosely dashdotdotted/.style= {dash pattern=on 3pt off 4pt on \the\pgflinewidth off 4pt on \the\pgflinewidth off 4pt}}%
+\tikzset{dash dot dot/.style= {dash pattern=on 3pt off 2pt on \the\pgflinewidth off 2pt on \the\pgflinewidth off 2pt}}%
+\tikzset{densely dash dot dot/.style= {dash pattern=on 3pt off 1pt on \the\pgflinewidth off 1pt on \the\pgflinewidth off 1pt}}%
+\tikzset{loosely dash dot dot/.style= {dash pattern=on 3pt off 4pt on \the\pgflinewidth off 4pt on \the\pgflinewidth off 4pt}}%
+
+
+\tikzset{transparent/.style= {opacity=0}}%
+\tikzset{ultra nearly transparent/.style={opacity=0.05}}%
+\tikzset{very nearly transparent/.style= {opacity=0.1}}%
+\tikzset{nearly transparent/.style= {opacity=0.25}}%
+\tikzset{semitransparent/.style= {opacity=0.5}}%
+\tikzset{nearly opaque/.style= {opacity=0.75}}%
+\tikzset{very nearly opaque/.style= {opacity=0.9}}%
+\tikzset{ultra nearly opaque/.style= {opacity=0.95}}%
+\tikzset{opaque/.style= {opacity=1}}%
+
+\tikzset{at start/.style= {pos=0}}%
+\tikzset{very near start/.style= {pos=0.125}}%
+\tikzset{near start/.style= {pos=0.25}}%
+\tikzset{midway/.style= {pos=0.5}}%
+\tikzset{near end/.style= {pos=0.75}}%
+\tikzset{very near end/.style= {pos=0.875}}%
+\tikzset{at end/.style= {pos=1}}%
+
+\tikzset{bend at start/.style= {bend pos=0,bend={+(0,0)}}}%
+\tikzset{bend at end/.style= {bend pos=1,bend={+(0,0)}}}%
+
+\tikzset{edge from parent/.style= {draw}}%
+
+
+
+% Animation callbacks
+\tikzset{
+ animate/.code=\tikzerror{You need to say \string\usetikzlibrary{animations} to use animations}
+}
+
+% ID callbacks
+\newif\iftikz@is@node
+\let\tikz@id@hook\pgfutil@empty
+\def\tikz@call@id@hook{\ifx\tikz@id@hook\pgfutil@empty\else\tikz@id@hook\pgfuseid{\tikz@id@name}\fi}%
+
+% RDF stuff
+\let\tikz@clear@rdf@options\relax
+\let\tikz@do@rdf@post@options\relax
+\let\tikz@do@rdf@pre@options\relax
%
% Setting keys
%
-\pgfkeys{/tikz/style/.style=#1}
+\pgfkeys{/tikz/style/.style=#1}%
\pgfkeys{/tikz/.unknown/.code=%
% Is it a pgf key?
- \let\tikz@key\pgfkeyscurrentname%
+ \let\tikz@key\pgfkeyscurrentname%
\pgfkeys{/pgf/\tikz@key/.try={#1}}%
\ifpgfkeyssuccess%
\else%
@@ -1580,7 +1612,7 @@
\edef\tikz@textcolor{\tikz@key}%
\else%
\pgfutil@doifcolorelse{\tikz@key}
- {%
+ {%
\expandafter\tikz@addoption\expandafter{\expandafter\tikz@compat@color@set\expandafter{\tikz@key}}%
\edef\tikz@textcolor{\tikz@key}%
}%
@@ -1594,8 +1626,7 @@
% Ok, third chance: A shape!
\expandafter\ifx\csname pgf@sh@s@\tikz@key\endcsname\relax%
\pgfkeys{/errors/unknown key/.expand
- once=\expandafter{\expandafter/\expandafter t\expandafter
- i\expandafter k\expandafter z\expandafter/\tikz@key}{#1}}%
+ once=\expandafter{\expandafter/\expandafter t\expandafter i\expandafter k\expandafter z\expandafter/\tikz@key}{#1}}%
\else%
\edef\tikz@shape{\tikz@key}%
\fi%
@@ -1603,14 +1634,14 @@
}%
\fi%
\fi%
-}
+}%
\def\tikz@compat@color@set#1{%
\pgfutil@color{#1}\pgfutil@colorlet{pgffillcolor}{#1}%
- \expandafter\let\expandafter\pgf@temp\csname\string\color@pgffillcolor\endcsname
+ \expandafter\let\expandafter\pgf@temp\csname\string\color@pgffillcolor\endcsname%
% for arrow tips:
\global\let\pgf@strokecolor@global=\pgf@temp
\global\let\pgf@fillcolor@global=\pgf@temp
-}
+}%
\def\tikz@startup@env{%
\ifnum\the\catcode`\;=\active\relax\expandafter\let\expandafter\tikz@origsemi\expandafter=\tikz@activesemicolon\fi%
@@ -1620,7 +1651,7 @@
\iftikz@handle@active@code%
\tikz@switchoff@shorthands%
\fi%
-}
+}%
%
% Main TikZ Environment
@@ -1629,7 +1660,7 @@
\def\tikzpicture{%
\begingroup%
\tikz@startup@env%
- \pgfutil@ifnextchar[\tikz@picture{\tikz@picture[]}}%}
+ \tikz@collect@scope@anims\tikz@picture}%
\def\tikz@picture[#1]{%
\pgfpicture%
\let\tikz@atbegin@picture=\pgfutil@empty%
@@ -1643,22 +1674,22 @@
\fi%
\expandafter\tikz@atbegin@picture%
\tikz@lib@scope@check%
-}
+}%
\def\endtikzpicture{%
\tikz@atend@picture%
\global\let\pgf@shift@baseline@smuggle=\pgf@baseline%
\global\let\pgf@trimleft@final@smuggle=\pgf@trimleft%
\global\let\pgf@trimright@final@smuggle=\pgf@trimright%
\global\let\pgf@remember@smuggle=\ifpgfrememberpicturepositiononpage%
- \pgf@remember@layerlist@globally
+ \pgf@remember@layerlist@globally
\endscope%
\let\pgf@baseline=\pgf@shift@baseline@smuggle%
\let\pgf@trimleft=\pgf@trimleft@final@smuggle%
\let\pgf@trimright=\pgf@trimright@final@smuggle%
\let\ifpgfrememberpicturepositiononpage=\pgf@remember@smuggle%
- \pgf@restore@layerlist@from@global
- \endpgfpicture\endgroup}
-
+ \pgf@restore@layerlist@from@global
+ \endpgfpicture\endgroup}%
+
% Inlined picture
%
@@ -1676,108 +1707,128 @@
\def\tikz{%
\begingroup%
\tikz@startup@env%
- \pgfutil@ifnextchar[{\tikz@opt}{\tikz@opt[]}}
-\def\tikz@opt[#1]{\tikzpicture[#1]\pgfutil@ifnextchar\bgroup{\tikz@}{\tikz@@single}}
-\def\tikz@{\bgroup\tikz@auto@end@pathtrue\aftergroup\endtikzpicture\aftergroup\endgroup\let\pgf@temp=}
+ \tikz@collect@scope@anims\tikz@opt}%
+\def\tikz@opt[#1]{\tikzpicture[#1]\pgfutil@ifnextchar\bgroup{\tikz@}{\tikz@@single}}%
+\def\tikz@{\bgroup\tikz@auto@end@pathtrue\aftergroup\endtikzpicture\aftergroup\endgroup\let\pgf@temp=}%
\def\tikz@@single#1{%
\expandafter\ifx\csname tikz@protected@command\string#1\endcsname\relax%
\expandafter\tikz@@%
\else%
\begingroup\def\tikz@path@do@at@end{\endgroup\endtikzpicture\endgroup}%
\fi%
- #1%
-}
-
-\expandafter\let\csname tikz@protected@command\string\draw\endcsname\pgfutil@empty
-\expandafter\let\csname tikz@protected@command\string\pattern\endcsname\pgfutil@empty
-\expandafter\let\csname tikz@protected@command\string\fill\endcsname\pgfutil@empty
-\expandafter\let\csname tikz@protected@command\string\filldraw\endcsname\pgfutil@empty
-\expandafter\let\csname tikz@protected@command\string\shade\endcsname\pgfutil@empty
-\expandafter\let\csname tikz@protected@command\string\shadedraw\endcsname\pgfutil@empty
-\expandafter\let\csname tikz@protected@command\string\clip\endcsname\pgfutil@empty
-\expandafter\let\csname tikz@protected@command\string\graph\endcsname\pgfutil@empty
-\expandafter\let\csname tikz@protected@command\string\useasboundingbox\endcsname\pgfutil@empty
-\expandafter\let\csname tikz@protected@command\string\node\endcsname\pgfutil@empty
-\expandafter\let\csname tikz@protected@command\string\coordinate\endcsname\pgfutil@empty
-\expandafter\let\csname tikz@protected@command\string\matrix\endcsname\pgfutil@empty
-\expandafter\let\csname tikz@protected@command\string\datavisualization\endcsname\pgfutil@empty
-\expandafter\let\csname tikz@protected@command\string\path\endcsname\pgfutil@empty
-\expandafter\let\csname tikz@protected@command\string\pic\endcsname\pgfutil@empty
+ #1%
+}%
+
+\expandafter\let\csname tikz@protected@command\string\draw\endcsname\pgfutil@empty%
+\expandafter\let\csname tikz@protected@command\string\pattern\endcsname\pgfutil@empty%
+\expandafter\let\csname tikz@protected@command\string\fill\endcsname\pgfutil@empty%
+\expandafter\let\csname tikz@protected@command\string\filldraw\endcsname\pgfutil@empty%
+\expandafter\let\csname tikz@protected@command\string\shade\endcsname\pgfutil@empty%
+\expandafter\let\csname tikz@protected@command\string\shadedraw\endcsname\pgfutil@empty%
+\expandafter\let\csname tikz@protected@command\string\clip\endcsname\pgfutil@empty%
+\expandafter\let\csname tikz@protected@command\string\graph\endcsname\pgfutil@empty%
+\expandafter\let\csname tikz@protected@command\string\useasboundingbox\endcsname\pgfutil@empty%
+\expandafter\let\csname tikz@protected@command\string\node\endcsname\pgfutil@empty%
+\expandafter\let\csname tikz@protected@command\string\coordinate\endcsname\pgfutil@empty%
+\expandafter\let\csname tikz@protected@command\string\matrix\endcsname\pgfutil@empty%
+\expandafter\let\csname tikz@protected@command\string\datavisualization\endcsname\pgfutil@empty%
+\expandafter\let\csname tikz@protected@command\string\path\endcsname\pgfutil@empty%
+\expandafter\let\csname tikz@protected@command\string\pic\endcsname\pgfutil@empty%
% Comment by TT: I hope I fixed the \tikz \foreach problem. The new
% version will take a conservative approach and will only do fancy
% stuff when the next keyword after \tikz is one of the following:
-% \draw, \fill, \filldraw, \graph, \matrix,
+% \draw, \fill, \filldraw, \graph, \matrix,
\def\tikz@@{%
\let\tikz@next=\tikz@collectnormalsemicolon%
\ifnum\the\catcode`\;=\active\relax%
\let\tikz@next=\tikz@collectactivesemicolon%
\fi%
- \tikz@next}
+ \tikz@next}%
\def\tikz@collectnormalsemicolon#1;{#1;\endtikzpicture\endgroup}
{
\catcode`\;=\active
\gdef\tikz@collectactivesemicolon#1;{#1;\endtikzpicture\endgroup}
-}
+}%
% End old code
-% Invokes '#1' if the command is invoked withing a tikzpicture and
+% Invokes '#1' if the command is invoked within a tikzpicture and
% '#2' if not.
\def\tikzifinpicture#1#2{%
- \pgfutil@ifundefined{filldraw}{#2}{#1}% TT: This is a wrong
+ \pgfutil@ifundefined{filldraw}{#2}{#1}% TT: This is a wrong
% test! Who uses this?...
}%
+
+\def\tikz@collect@scope@anims#1{%
+ \pgfutil@ifnextchar[#1{#1[]}%]
+}%
+
%
% Environment for scoping graphic state settings
%
-\def\tikz@scope@env{\pgfutil@ifnextchar[\tikz@@scope@env{\tikz@@scope@env[]}}
-\def\tikz@@scope@env[#1]{%
+\def\tikz@scope@env{%
\pgfscope%
\begingroup%
\let\tikz@atbegin@scope=\pgfutil@empty%
\let\tikz@atend@scope=\pgfutil@empty%
\let\tikz@options=\pgfutil@empty%
+ \tikz@clear@rdf@options%
\let\tikz@mode=\pgfutil@empty%
+ \let\tikz@id@name=\pgfutil@empty%
\tikz@transparency@groupfalse%
- \tikzset{every scope/.try,#1}%
+ \tikzset{every scope/.try}%
+ \tikz@collect@scope@anims\tikz@scope@opt%
+}%
+\def\tikz@scope@opt[#1]{%
+ \tikzset{#1}%
\tikz@options%
+ \tikz@do@rdf@pre@options%
\iftikz@transparency@group\expandafter\pgftransparencygroup\expandafter[\tikz@transparency@group@options]\tikz@blend@group\fi%
- \expandafter\tikz@atbegin@scope%
- \tikz@lib@scope@check%
-}
+ \tikz@is@nodefalse%
+ \tikz@call@id@hook%
+ \pgfidscope%
+ \tikz@do@rdf@post@options%
+ \begingroup%
+ \let\tikz@id@name\pgfutil@empty%
+ \expandafter\tikz@atbegin@scope%
+ \expandafter\pgfclearid%
+ \tikz@lib@scope@check%
+}%
\def\endtikz@scope@env{%
- \tikz@atend@scope%
+ \tikz@atend@scope%
+ \endgroup%
+ \endpgfidscope%
\iftikz@transparency@group\endpgftransparencygroup\fi%
\endgroup%
\endpgfscope%
\tikz@lib@scope@check%
-}
+}%
-\def\tikz@scoped{\pgfutil@ifnextchar[{\tikz@scoped@opt}{\tikz@scoped@opt[]}}
-\def\tikz@scoped@opt[#1]{\scope[#1]\pgfutil@ifnextchar\bgroup{\tikz@scoped@}{\tikz@scoped@@single}}
-\def\tikz@scoped@{\bgroup\tikz@auto@end@pathtrue\aftergroup\endscope\let\pgf@temp=}
+\def\tikz@scoped{\tikz@collect@scope@anims\tikz@scoped@opt}%
+\def\tikz@scoped@opt[#1]{\scope[#1]\pgfutil@ifnextchar\bgroup{\tikz@scoped@}{\tikz@scoped@@single}}%
+\def\tikz@scoped@{\bgroup\tikz@auto@end@pathtrue\aftergroup\endscope\let\pgf@temp=}%
\def\tikz@scoped@@single#1{%
\expandafter\ifx\csname tikz@scoped@protected@command\string#1\endcsname\relax%
\expandafter\tikz@scoped@@%
\else%
\begingroup\def\tikz@scoped@path@do@at@end{\endgroup\endscope}%
\fi%
- #1%
-}
+ #1%
+}%
\def\tikz@scoped@@{%
\let\tikz@scoped@next=\tikz@scoped@collectnormalsemicolon%
\ifnum\the\catcode`\;=\active\relax%
\let\tikz@scoped@next=\tikz@scoped@collectactivesemicolon%
\fi%
- \tikz@scoped@next}
+ \tikz@scoped@next}%
\def\tikz@scoped@collectnormalsemicolon#1;{#1;\endscope}
{
\catcode`\;=\active
\gdef\tikz@scoped@collectactivesemicolon#1;{#1;\endscope}
-}
-
+}%
+
% Install a shortcut command which is only valid inside of a
% tikzpicture.
@@ -1788,17 +1839,17 @@
% #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%
- }%
+ \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}%
- }%
+ \expandafter\def\expandafter\tikz@installcommands\expandafter{\tikz@installcommands
+ \def#1{#2}%
+ }%
}%
%
@@ -1836,33 +1887,33 @@
\let\path=\tikz@command@path%
\let\againpath=\tikz@command@againpath%
%
- \def\draw{\path[draw]}
- \def\pattern{\path[pattern]}
- \def\fill{\path[fill]}
- \def\filldraw{\path[fill,draw]}
- \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\pic{\tikz@path@overlay{pic}}
- \def\coordinate{\tikz@path@overlay{coordinate}}
- \def\matrix{\tikz@path@overlay{node[matrix]}}
- \def\calendar{\tikz@lib@cal@calendar}%
+ \def\draw{\path[draw]}%
+ \def\pattern{\path[pattern]}%
+ \def\fill{\path[fill]}%
+ \def\filldraw{\path[fill,draw]}%
+ \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\pic{\tikz@path@overlay{pic}}%
+ \def\coordinate{\tikz@path@overlay{coordinate}}%
+ \def\matrix{\tikz@path@overlay{node[matrix]}}%
+ \def\calendar{\tikz@lib@cal@calendar}%
\def\datavisualization{\tikz@lib@datavisualization}%
-}
+}%
\ifx\tikz@lib@cal@calendar\@undefined
-\def\tikz@lib@cal@calendar{\tikzerror{You need to say \string\usetikzlibrary{calendar} to use the \string\calendar{} command}}
+\def\tikz@lib@cal@calendar{\tikzerror{You need to say \string\usetikzlibrary{calendar} to use the \string\calendar{} command}}%
\fi
\ifx\tikz@lib@datavisualization\@undefined
-\def\tikz@lib@datavisualization{\tikzerror{You need to say \string\usetikzlibrary{datavisualization} to use the \string\datavisualization{} command}}
+\def\tikz@lib@datavisualization{\tikzerror{You need to say \string\usetikzlibrary{datavisualization} to use the \string\datavisualization{} command}}%
\fi
\def\tikz@path@overlay#1{%
\let\tikz@signal@path=\tikz@signal@path% for detection at begin of matrix cell
- \pgfutil@ifnextchar<{\tikz@path@overlayed{#1}}{\path #1}}
-\def\tikz@path@overlayed#1<#2>{\path<#2> #1}
+ \pgfutil@ifnextchar<{\tikz@path@overlayed{#1}}{\path #1}}%
+\def\tikz@path@overlayed#1<#2>{\path<#2> #1}%
\def\tikz@uninstallcommands{%
\let\scope=\tikz@origscope%
@@ -1887,18 +1938,18 @@
\let\calendar=\tikz@origcalendar%
\let\datavisualization=\tikz@origdv%
\let\graph=\tikz@origgraph%
-}
+}%
-{
+{%
\catcode`\;=12
- \gdef\tikz@nonactivesemicolon{;}
+ \gdef\tikz@nonactivesemicolon{;}%
\catcode`\:=12
- \gdef\tikz@nonactivecolon{:}
+ \gdef\tikz@nonactivecolon{:}%
\catcode`\|=12
- \gdef\tikz@nonactivebar{|}
+ \gdef\tikz@nonactivebar{|}%
\catcode`\!=12
- \gdef\tikz@nonactiveexlmark{!}
+ \gdef\tikz@nonactiveexlmark{!}%
\catcode`\;=\active
\catcode`\:=\active
\catcode`\|=\active
@@ -1915,8 +1966,8 @@
\def:{\tikz@nonactivecolon}%
\def|{\tikz@nonactivebar}%
\def!{\tikz@nonactiveexlmark}%
- }
-}
+ }%
+}%
\let\tikz@orig@shorthands\pgfutil@empty
\def\tikz@switchoff@shorthands{%
@@ -1950,32 +2001,32 @@
\catcode`\.12\relax%
\catcode`\$3\relax%
\fi%
-}
+}%
% Constructs a path and draws/fills them according to the current
-% settings.
+% settings.
\def\tikz@command@path{%
\let\tikz@signal@path=\tikz@signal@path% for detection at begin of matrix cell
\pgfutil@ifnextchar[{\tikz@check@earg}%]
- {\pgfutil@ifnextchar<{\tikz@doopt}{\tikz@@command@path}}}
+ {\pgfutil@ifnextchar<{\tikz@doopt}{\tikz@@command@path}}}%
\def\tikz@signal@path{\tikz@signal@path}%
\def\tikz@check@earg[#1]{%
\pgfutil@ifnextchar<{\tikz@swap@args[#1]}{\tikz@@command@path[#1]}}
-\def\tikz@swap@args[#1]<#2>{\tikz@command@path<#2>[#1]}
+\def\tikz@swap@args[#1]<#2>{\tikz@command@path<#2>[#1]}%
\def\tikz@doopt{%
\let\tikz@next=\tikz@eargnormalsemicolon%
\ifnum\the\catcode`\;=\active\relax%
\let\tikz@next=\tikz@eargactivesemicolon%
\fi%
- \tikz@next}
-\long\def\tikz@eargnormalsemicolon<#1>#2;{\alt<#1>{\tikz@@command@path#2;}{\tikz@path@do@at@end}}
+ \tikz@next}%
+\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;{\alt<#1>{\tikz@@command@path#2;}{\tikz@path@do@at@end}}
+ \long\global\def\tikz@eargactivesemicolon<#1>#2;{\alt<#1>{\tikz@@command@path#2;}{\tikz@path@do@at@end}}%
}
\def\tikz@@command@path{%
@@ -1985,6 +2036,7 @@
\setbox\tikz@figbox@bg=\box\pgfutil@voidb@x%
\let\tikz@path@do@at@end=\tikz@lib@scope@check%
\let\tikz@options=\pgfutil@empty%
+ \tikz@clear@rdf@options%
\let\tikz@mode=\pgfutil@empty%
\let\tikz@moveto@waiting=\relax%
\let\tikz@timer=\relax%
@@ -2004,53 +2056,54 @@
\tikz@lastysaved=0pt%
\tikzset{every path/.try}%
\tikz@scan@next@command%
-}
+}%
\def\tikz@scan@next@command{%
\ifx\tikz@collected@onpath\pgfutil@empty%
\else%
\tikz@invoke@collected@onpath%
\fi%
\afterassignment\tikz@handle\let\pgf@let@token=%
-}
+}%
\newcount\tikz@expandcount
+\let\tikz@collected@onpath=\pgfutil@empty%
% Central dispatcher for commands
\def\tikz@handle{%
- \let\@next=\tikz@expand%
+ \let\pgfutil@next=\tikz@expand%
\ifx\pgf@let@token(%)
- \let\@next=\tikz@movetoabs%
+ \let\pgfutil@next=\tikz@movetoabs%
\else%
\ifx\pgf@let@token+%
- \let\@next=\tikz@movetorel%
+ \let\pgfutil@next=\tikz@movetorel%
\else%
\ifx\pgf@let@token-%
- \let\@next=\tikz@lineto%
+ \let\pgfutil@next=\tikz@lineto%
\else%
\ifx\pgf@let@token.%
- \let\@next=\tikz@dot%
+ \let\pgfutil@next=\tikz@dot%
\else%
\ifx\pgf@let@token r%
- \let\@next=\tikz@rect%
+ \let\pgfutil@next=\tikz@rect%
\else%
\ifx\pgf@let@token n%
- \let\@next=\tikz@fig%
+ \let\pgfutil@next=\tikz@fig%
\else%
\ifx\pgf@let@token[%]
- \let\@next=\tikz@parse@options%
+ \let\pgfutil@next=\tikz@parse@options%
\else%
\ifx\pgf@let@token c%
- \let\@next=\tikz@cchar%
+ \let\pgfutil@next=\tikz@cchar%
\else%
\ifx\pgf@let@token\bgroup%
- \let\@next=\tikz@beginscope%
+ \let\pgfutil@next=\tikz@beginscope%
\else%
\ifx\pgf@let@token\egroup%
- \let\@next=\tikz@endscope%
+ \let\pgfutil@next=\tikz@endscope%
\else%
\ifx\pgf@let@token;%
- \let\@next=\tikz@finish%
+ \let\pgfutil@next=\tikz@finish%
\else%
- \let\@next=\tikz@handle@more%
+ \let\pgfutil@next=\tikz@handle@more%
\fi%
\fi%
\fi%
@@ -2062,72 +2115,76 @@
\fi%
\fi%
\fi%
- \@next%
-}
+ \pgfutil@next%
+}%
% Continued...
\def\tikz@handle@more{%
\ifx\pgf@let@token a%
- \let\@next=\tikz@arcA%
+ \let\pgfutil@next=\tikz@a@char%
\else%
\ifx\pgf@let@token e%
- \let\@next=\tikz@e@char%
+ \let\pgfutil@next=\tikz@e@char%
\else%
\ifx\pgf@let@token g%
- \let\@next=\tikz@g@char%
+ \let\pgfutil@next=\tikz@g@char%
\else%
\ifx\pgf@let@token s%
- \let\@next=\tikz@schar%
+ \let\pgfutil@next=\tikz@schar%
\else%
\ifx\pgf@let@token |%
- \let\@next=\tikz@vh@lineto%
+ \let\pgfutil@next=\tikz@vh@lineto%
\else%
\ifx\pgf@let@token p%
- \let\@next=\tikz@pchar%
+ \let\pgfutil@next=\tikz@pchar%
\pgfsetmovetofirstplotpoint%
\else%
\ifx\pgf@let@token t%
- \let\@next=\tikz@to%
+ \let\pgfutil@next=\tikz@to%
\else%
\ifx\pgf@let@token\pgfextra%
- \let\@next=\tikz@extra%
+ \let\pgfutil@next=\tikz@extra%
\else%
\ifx\pgf@let@token\foreach%
- \let\@next=\tikz@foreach%
+ \let\pgfutil@next=\tikz@foreach%
\else%
\ifx\pgf@let@token f%
- \let\@next=\tikz@fchar%
+ \let\pgfutil@next=\tikz@fchar%
\else%
\ifx\pgf@let@token\pgf@stop%
- \let\@next=\relax%
+ \let\pgfutil@next=\relax%
\else%
\ifx\pgf@let@token\par%
- \let\@next=\tikz@scan@next@command%
+ \let\pgfutil@next=\tikz@scan@next@command%
\else%
\ifx\pgf@let@token d%
- \let\@next=\tikz@decoration%
+ \let\pgfutil@next=\tikz@decoration%
\else%
\ifx\pgf@let@token l%
- \let\@next=\tikz@l@char%\tikz@let@command%
+ \let\pgfutil@next=\tikz@l@char%
\else%
- \let\@next=\tikz@expand%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
+ \ifx\pgf@let@token:%
+ \let\pgfutil@next=\tikz@colon@char%
+ \else%
+ \let\pgfutil@next=\tikz@expand%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
\fi%
\fi%
\fi%
\fi%
- \ifx\@next\tikz@expand\else\tikz@expandcount=100\relax\fi%
- \@next%
-}
+ \ifx\pgfutil@next\tikz@expand\else\tikz@expandcount=100\relax\fi%
+ \pgfutil@next%
+}%
\def\tikz@l@char{%
\pgfutil@ifnextchar e{\tikz@let@command}{%
@@ -2135,54 +2192,56 @@
\pgfutil@ifnextchar-{\tikz@@lsystem}{\tikz@expand}%
}%
}%
-}
+}%
\def\tikz@lsystem{%
\tikzerror{You need to say \string\usetikzlibrary{lindenmayersystems} to draw Lindenmayer systems}
-}
+}%
\def\tikz@@lsystem{%
\tikzerror{You need to say \string\usetikzlibrary{lindenmayersystems} to draw L-systems}
-}
+}%
-\def\tikz@pchar{\pgfutil@ifnextchar l{\tikz@plot}{\pgfutil@ifnextchar i{\tikz@subpicture}{\tikz@parabola}}}
+\def\tikz@pchar{\pgfutil@ifnextchar l{\tikz@plot}{\pgfutil@ifnextchar i{\tikz@subpicture}{\tikz@parabola}}}%
\def\tikz@cchar{%
\pgfutil@ifnextchar i{\tikz@circle}%
{\pgfutil@ifnextchar h{\tikz@children}{\tikz@cochar}}}%
\def\tikz@cochar o{%
- \pgfutil@ifnextchar o{\tikz@coordinate}{\tikz@cosine}}
+ \pgfutil@ifnextchar o{\tikz@coordinate}{\tikz@cosine}}%
\def\tikz@e@char{%
\pgfutil@ifnextchar l{\tikz@ellipse}{\tikz@@e@char}}%
+\def\tikz@a@char{%
+ \pgfutil@ifnextchar r{\tikz@arcA}{\tikzerror{Arc expected}}}%
\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@schar{\pgfutil@ifnextchar i{\tikz@sine}{\tikz@svg@path}}%
-\def\tikz@g@char r{\pgfutil@ifnextchar i{\tikz@grid}{\tikz@graph}}
+\def\tikz@g@char r{\pgfutil@ifnextchar i{\tikz@grid}{\tikz@graph}}%
% svg syntax
% svg[options] {...}
\def\tikz@svg@path{%
\tikzerror{You need to say \string\usetikzlibrary{svg.path} to use the svg path command}
-}
+}%
\def\tikz@finish{%
- % Rendering pipeline
- %
+ % Rendering pipeline
+ %
% Step 1: The path background box
%
\box\tikz@figbox@bg%
- %
+ %
% Step 2: Decorate path
- %
+ %
\iftikz@decoratepath%
\tikz@lib@dec@decorate@path%
\fi%
- %
+ %
% Step 3: Preactions
- %
+ %
\pgfsyssoftpath@getcurrentpath\tikz@actions@path%
\edef\tikz@restorepathsize{%
\global\pgf@pathmaxx=\the\pgf@pathmaxx%
@@ -2238,8 +2297,8 @@
\tikz@mode@fade@scopefalse%
\fi%
%
- % Step 3: Setup options
- %
+ % Step 5': Setup options
+ %
\ifx\tikz@options\pgfutil@empty%
\else%
\pgfsys@beginscope%
@@ -2248,7 +2307,18 @@
\begingroup%
\tikz@options%
\fi%
- %
+ \tikz@do@rdf@pre@options%
+ %
+ % Step 5'': Setup animations
+ %
+ \tikz@is@nodefalse%
+ \tikz@call@id@hook%
+ \iftikz@mode@clip\else%
+ \pgfidscope%
+ \tikz@do@rdf@post@options%
+ \begingroup%
+ \fi% open an animation scope here, unless clipping is done
+ %
% Step 6: Do a fill if shade or a path picture follows.
%
\iftikz@mode@fill%
@@ -2257,7 +2327,10 @@
\pgfprocessround{\tikz@temppath}{\tikz@temppath}% change the path
\pgfsyssoftpath@setcurrentpath\tikz@temppath%
\pgfsyssoftpath@invokecurrentpath%
+ \pgfpushtype%
+ \pgfusetype{.path fill}%
\pgfsys@fill%
+ \pgfpoptype%
\tikz@mode@fillfalse% no more filling...
\else%
\ifx\tikz@path@picture\pgfutil@empty%
@@ -2266,28 +2339,38 @@
\pgfprocessround{\tikz@temppath}{\tikz@temppath}% change the path
\pgfsyssoftpath@setcurrentpath\tikz@temppath%
\pgfsyssoftpath@invokecurrentpath%
+ \pgfpushtype%
+ \pgfusetype{.path fill}%
\pgfsys@fill%
+ \pgfpoptype%
\tikz@mode@fillfalse% no more filling...
\fi%
\fi%
\fi%
- %
+ %
% Step 7: Do a shade if necessary.
%
\iftikz@mode@shade%
\pgfsyssoftpath@getcurrentpath\tikz@temppath
\pgfprocessround{\tikz@temppath}{\tikz@temppath}% change the path
\pgfsyssoftpath@setcurrentpath\tikz@temppath%
+ \pgfpushtype%
+ \pgfusetype{.path shade}%
\pgfshadepath{\tikz@shading}{\tikz@shade@angle}%
+ \pgfpoptype%
\tikz@mode@shadefalse% no more shading...
\fi%
- %
+ %
% Step 8: Do a path picture if necessary.
%
\ifx\tikz@path@picture\pgfutil@empty%
\else%
\begingroup%
+ \pgfusetype{.path picture}%
+ \pgfidscope%
\pgfsys@beginscope%
+ \let\tikz@id@name\pgfutil@empty%
+ \pgfclearid%
\pgfsyssoftpath@getcurrentpath\tikz@temppath
\pgfprocessround{\tikz@temppath}{\tikz@temppath}% change the path
\pgfsyssoftpath@setcurrentpath\tikz@temppath%
@@ -2302,14 +2385,15 @@
}
\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%
+ \pgfinterruptpath%
\tikz@path@picture%
\endpgfinterruptpath%
\pgfsys@endscope%
+ \endpgfidscope%
\endgroup%
- \let\tikz@path@picture=\pgfutil@empty%
+ \let\tikz@path@picture=\pgfutil@empty%
\fi%
- %
+ %
% Step 9: Double stroke, if necessary
%
\iftikz@mode@draw%
@@ -2320,17 +2404,20 @@
\tikz@double@setup%
\fi%
\fi%
- %
+ %
% Step 10: Do stroke/fill/clip as needed
%
+ \pgfpushtype%
\edef\tikz@temp{\noexpand\pgfusepath{%
\iftikz@mode@fill fill,\fi%
\iftikz@mode@draw draw,\fi%
\iftikz@mode@clip clip\fi%
}}%
+ \pgfusetype{.path}%
\tikz@temp%
+ \pgfpoptype%
\tikz@mode@fillfalse% no more filling
- %
+ %
% Step 11: Double stroke, if necessary
%
\iftikz@mode@draw%
@@ -2344,11 +2431,15 @@
% Step 12: Postactions
%
\tikz@postactions%
- %
+ %
% Step 13: Add labels and nodes
%
\box\tikz@figbox%
%
+ % Step 14: Close animations
+ %
+ \iftikz@mode@clip\else\endgroup\endpgfidscope\fi%
+ %
% Step 14: Close option brace
%
\ifx\tikz@options\pgfutil@empty%
@@ -2370,9 +2461,10 @@
\endgroup%
\global\pgflinewidth=\tikzscope@linewidth%
\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}
+\def\tikz@path@do@at@end{\tikz@lib@scope@check}%
+\def\tikz@@pathtext{@path}%
\def\pgf@outer@auto@adjust@hook{%
{%
@@ -2380,11 +2472,11 @@
\tikz@mode%
\expandafter%
}%
- \iftikz@mode@draw\else%xxx
+ \iftikz@mode@draw\else%
\pgfkeyslet{/pgf/outer xsep}\pgf@zero@text
\pgfkeyslet{/pgf/outer ysep}\pgf@zero@text
\fi%
-}
+}%
% Extra actions
@@ -2398,7 +2490,7 @@
\tikz@restorepathsize%
\pgfsys@endscope%
}%
-}
+}%
\def\tikz@extra@postaction#1{%
{%
@@ -2410,36 +2502,36 @@
\pgf@resetpathsizes%
\pgfsys@endscope%
}%
-}
+}%
-\def\tikz@skip#1{\tikz@scan@next@command#1}
+\def\tikz@skip#1{\tikz@scan@next@command#1}%
\def\tikz@expand{%
\advance\tikz@expandcount by -1%
\ifnum\tikz@expandcount<0\relax%
\tikzerror{Giving up on this path. Did you forget a semicolon?}%
- \let\@next=\tikz@finish%
+ \let\pgfutil@next=\tikz@finish%
\else%
- \let\@next=\tikz@@expand
+ \let\pgfutil@next=\tikz@@expand
\fi%
- \@next}
+ \pgfutil@next}%
\def\tikz@@expand{%
- \expandafter\tikz@scan@next@command\pgf@let@token}
+ \expandafter\tikz@scan@next@command\pgf@let@token}%
-% Syntax for scopes:
+% Syntax for scopes:
% {scoped path commands}
\newif\iftikz@auto@end@path
-\def\tikz@beginscope{\begingroup\tikz@auto@end@pathfalse\tikz@scan@next@command}
+\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{%
+}%
+\def\tikz@@endscope{%
\global\setbox\tikz@tempbox=\box\tikz@figbox%
\global\setbox\tikz@tempbox@bg=\box\tikz@figbox@bg%
\global\let\tikz@tangent@temp\tikz@tangent%
@@ -2468,24 +2560,24 @@
\setbox\tikz@figbox=\box\tikz@tempbox%
\setbox\tikz@figbox@bg=\box\tikz@tempbox@bg%
\let\tikz@tangent\tikz@tangent@temp%
- \tikz@scan@next@command}
+ \tikz@scan@next@command}%
-% Syntax for pgfextra:
+% Syntax for pgfextra:
% \pgfextra {normal tex text}
% \pgfextra normal tex text \endpgfextra
-\def\tikz@extra{\pgfutil@ifnextchar\bgroup\tikz@@extra\relax}
-\long\def\tikz@@extra#1{#1\tikz@scan@next@command}
+\def\tikz@extra{\pgfutil@ifnextchar\bgroup\tikz@@extra\relax}%
+\long\def\tikz@@extra#1{#1\tikz@scan@next@command}%
\let\endpgfextra=\tikz@scan@next@command
-\def\pgfextra{pgfextra}
+\def\pgfextra{pgfextra}%
% Syntax for foreach:
%
% foreach \var in {list} {path text}
-%
+%
% or
%
% \foreach \var in {list} {path text}
@@ -2494,7 +2586,7 @@
%
% \draw (0,0) \foreach \x in {1,2,3} {-- (\x,0) circle (1cm)} -- (5,5);
-\def\tikz@fchar oreach{\tikz@foreach}
+\def\tikz@fchar oreach{\tikz@foreach}%
\def\tikz@foreach{%
\def\pgffor@beginhook{%
@@ -2530,10 +2622,10 @@
\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}
+ \foreach}%
+
-
-% Syntax for againpath:
+% Syntax for againpath:
% \againpath \somepathname
\def\tikz@command@againpath#1{%
@@ -2541,27 +2633,34 @@
\pgfsyssoftpath@getcurrentpath\tikz@temp%
\expandafter\pgfutil@g@addto@macro\expandafter\tikz@temp\expandafter{#1}%
\pgfsyssoftpath@setcurrentpath\tikz@temp%
- }
-}
+ }%
+}%
+
+% animation syntax
+% :attribute = {...}
+
+\def\tikz@colon@char#1=#2{%
+ \tikz@scan@next@command{[animate={myself:{#1}={#2}}]}%
+}%
%
% When this if is set, a just-scanned point is a shape and its border
% position still needs to be determined, depending on subsequent
-% commands.
+% commands.
%
\newif\iftikz@shapeborder
-% Syntax for moveto:
+% Syntax for moveto:
% <point>
-\def\tikz@movetoabs{\tikz@moveto(}
-\def\tikz@movetorel{\tikz@moveto+}
+\def\tikz@movetoabs{\tikz@moveto(}%
+\def\tikz@movetorel{\tikz@moveto+}%
\def\tikz@moveto{%
- \tikz@scan@one@point{\tikz@@moveto}}
+ \tikz@scan@one@point{\tikz@@moveto}}%
\def\tikz@@moveto#1{%
\tikz@make@last@position{#1}%
\iftikz@shapeborder%
@@ -2573,7 +2672,7 @@
\let\tikz@moveto@waiting=\relax%
\fi%
\tikz@scan@next@command%
-}
+}%
\let\tikz@moveto@waiting=\relax % normally, nothing is waiting...
@@ -2583,7 +2682,7 @@
\pgfpathmoveto{\tikz@last@position}%
\fi%
\let\tikz@moveto@waiting=\relax%
-}
+}%
\def\tikz@flush@moveto@toward#1#2#3{%
@@ -2600,22 +2699,22 @@
\pgfpathmoveto{\pgfqpoint{\pgf@x}{\pgf@y}}%
\fi%
\let\tikz@moveto@waiting=\relax%
-}
+}%
%
-% Collecting labels on the path
+% Collecting labels on the path
%
\def\tikz@collect@coordinate@onpath#1c{%
- \pgfutil@ifnextchar y{\tikz@cycle@expander@add#1}{\tikz@collect@coordinate@onpath@{#1}}}
+ \pgfutil@ifnextchar y{\tikz@cycle@expander@add#1}{\tikz@collect@coordinate@onpath@{#1}}}%
\def\tikz@collect@coordinate@onpath@#1oordinate{%
- \pgfutil@ifnextchar[{\tikz@@collect@coordinate@opt#1}{\tikz@@collect@coordinate@opt#1[]}}%}
+ \pgfutil@ifnextchar[{\tikz@@collect@coordinate@opt#1}{\tikz@@collect@coordinate@opt#1[]}}%}%
\def\tikz@@collect@coordinate@opt#1[#2]{%
\pgfutil@ifnextchar({\tikz@@collect@coordinate#1[#2]}{%
- \tikz@collect@label@onpath#1node[shape=coordinate,#2]{}}}%}
+ \tikz@collect@label@onpath#1node[shape=coordinate,#2]{}}}%}%
\def\tikz@@collect@coordinate#1[#2](#3){%
- \tikz@collect@label@onpath#1node[shape=coordinate,#2](#3){}}
+ \tikz@collect@label@onpath#1node[shape=coordinate,#2](#3){}}%
\newif\iftikz@collect@pic
@@ -2623,43 +2722,48 @@
\expandafter\def\expandafter\tikz@collected@onpath\expandafter{\tikz@collected@onpath node}%
\let\tikz@collect@cont#1%
\tikz@collect@picfalse%
- \tikz@collect@label@scan}
+ \tikz@collect@label@scan}%
\def\tikz@collect@pic@onpath#1pic{%
\expandafter\def\expandafter\tikz@collected@onpath\expandafter{\tikz@collected@onpath pic}%
\let\tikz@collect@cont#1
\tikz@collect@pictrue%
- \tikz@collect@label@scan}
+ \tikz@collect@label@scan}%
-\def\tikz@collect@label@scan{%
+\def\tikz@collect@label@scan{%
\pgfutil@ifnextchar f{\tikz@collect@nodes}{%
\pgfutil@ifnextchar({\tikz@collect@paran}%
{\pgfutil@ifnextchar[{\tikz@collect@options}%
- {\pgfutil@ifnextchar\bgroup{\tikz@collect@arg}%
- {\tikz@collect@cont}}}}%
-}%}}
+ {\pgfutil@ifnextchar:{\tikz@collect@animation}%
+ {\pgfutil@ifnextchar\bgroup{\tikz@collect@arg}%
+ {\tikz@collect@cont}}}}}%
+}%}}%
\def\tikz@collect@nodes foreach#1in{%
\expandafter\def\expandafter\tikz@collected@onpath\expandafter{\tikz@collected@onpath foreach#1in}%
\pgfutil@ifnextchar\bgroup\tikz@collect@nodes@group\tikz@collect@nodes@one%
-}
+}%
\def\tikz@collect@nodes@one#1{%
- \expandafter\def\expandafter\tikz@collected@onpath\expandafter{\tikz@collected@onpath #1}%
+ \expandafter\def\expandafter\tikz@collected@onpath\expandafter{\tikz@collected@onpath #1}%
\tikz@collect@label@scan%
-}
+}%
\def\tikz@collect@nodes@group#1{%
- \expandafter\def\expandafter\tikz@collected@onpath\expandafter{\tikz@collected@onpath{#1}}%
+ \expandafter\def\expandafter\tikz@collected@onpath\expandafter{\tikz@collected@onpath{#1}}%
\tikz@collect@label@scan%
-}
+}%
+\def\tikz@collect@animation#1=#2{%
+ \expandafter\def\expandafter\tikz@collected@onpath\expandafter{\tikz@collected@onpath#1={#2}}%
+ \tikz@collect@label@scan%
+}%
\def\tikz@collect@paran#1){%
\expandafter\def\expandafter\tikz@collected@onpath\expandafter{\tikz@collected@onpath#1)}%
\tikz@collect@label@scan%
-}
+}%
\def\tikz@collect@options#1]{%
\expandafter\def\expandafter\tikz@collected@onpath\expandafter{\tikz@collected@onpath#1]}%
\tikz@collect@label@scan%
-}
+}%
\def\tikz@collect@arg#1{%
\iftikz@handle@active@nodes%
\iftikz@collect@pic%
@@ -2671,7 +2775,7 @@
\expandafter\def\expandafter\tikz@collected@onpath\expandafter{\tikz@collected@onpath{#1}}%
\fi%
\tikz@collect@cont%
-}
+}%
\def\tikz@invoke@collected@onpath{%
\tikz@node@is@a@labeltrue%
@@ -2679,37 +2783,37 @@
\let\tikz@collected@onpath=\pgfutil@empty%
\expandafter\tikz@scan@next@command\tikz@temp\pgf@stop%
\tikz@node@is@a@labelfalse%
-}
+}%
%
% Macros for the cycle command
%
-\def\tikz@cycle@expander#1{\pgfutil@ifnextchar c{\tikz@cycle@expander@{#1}}{#1}}
-\def\tikz@cycle@expander@#1c{\pgfutil@ifnextchar y{\tikz@cycle@expander@add{#1}}{#1c}}
-\def\tikz@cycle@expander@add#1ycle{#1(current subpath start)--cycle}
+\def\tikz@cycle@expander#1{\pgfutil@ifnextchar c{\tikz@cycle@expander@{#1}}{#1}}%
+\def\tikz@cycle@expander@#1c{\pgfutil@ifnextchar y{\tikz@cycle@expander@add{#1}}{#1c}}%
+\def\tikz@cycle@expander@add#1ycle{#1(current subpath start)--cycle}%
-% Syntax for lineto:
+% Syntax for lineto:
% -- <point>
\def\tikz@lineto{%
\pgfutil@ifnextchar |%
{\expandafter\tikz@hv@lineto\pgfutil@gobble}%
{\expandafter\pgfutil@ifnextchar\tikz@activebar{\expandafter\tikz@hv@lineto\pgfutil@gobble}%
- {\expandafter\tikz@lineto@mid\pgfutil@gobble}}}
+ {\expandafter\tikz@lineto@mid\pgfutil@gobble}}}%
\def\tikz@lineto@mid{%
\pgfutil@ifnextchar n{\tikz@collect@label@onpath\tikz@lineto@mid}%
{%
\pgfutil@ifnextchar c{\tikz@close}{%
- \pgfutil@ifnextchar p{\tikz@lineto@plot@or@pic}{\tikz@scan@one@point{\tikz@@lineto}}}}}
+ \pgfutil@ifnextchar p{\tikz@lineto@plot@or@pic}{\tikz@scan@one@point{\tikz@@lineto}}}}}%
\def\tikz@lineto@plot@or@pic p{%
\pgfutil@ifnextchar i{\tikz@collect@pic@onpath\tikz@lineto@mid p}{%
\pgfsetlinetofirstplotpoint\tikz@plot}%
-}
+}%
\def\tikz@@lineto#1{%
% Record the starting point for later labels on the path:
\edef\tikz@timer@start{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}
@@ -2721,7 +2825,7 @@
\tikz@path@lineto{\tikz@last@position}%
\edef\tikz@timer@end{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
\tikz@make@last@position{#1}%
- \edef\tikz@moveto@waiting{\tikz@shapeborder@name}%
+ \edef\tikz@moveto@waiting{\tikz@shapeborder@name}%
\else%
% target is a reasonable point...
% Record the starting point for later labels on the path:
@@ -2733,7 +2837,7 @@
\let\tikz@timer=\tikz@timer@line%
\let\tikz@tangent\tikz@timer@start%
\tikz@scan@next@command%
-}
+}%
% snake or lineto?
\def\tikz@path@lineto#1{%
@@ -2745,7 +2849,7 @@
\else%
\pgfpathlineto{#1}%
\fi%
-}
+}%
% snake or lineto?
\def\tikz@path@close#1{%
@@ -2756,17 +2860,17 @@
}%
\fi%
\pgfpathclose%
-}
+}%
-% Syntax for lineto horizontal/vertical:
+% Syntax for lineto horizontal/vertical:
% -| <point>
\def\tikz@hv@lineto{%
\pgfutil@ifnextchar n{\tikz@collect@label@onpath\tikz@hv@lineto}{
\pgfutil@ifnextchar p{\tikz@collect@pic@onpath\tikz@hv@lineto}%
{\pgfutil@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@hv@lineto}%
- {\tikz@scan@one@point{\tikz@@hv@lineto}}}}}
+ {\tikz@scan@one@point{\tikz@@hv@lineto}}}}}%
\def\tikz@@hv@lineto#1{%
\edef\tikz@timer@start{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
\pgf@yc=\tikz@lasty%
@@ -2783,7 +2887,7 @@
\xdef\tikz@timer@end@temp{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}% move out of group
}%
\let\tikz@timer@end=\tikz@timer@end@temp%
- \edef\tikz@moveto@waiting{\tikz@shapeborder@name}%
+ \edef\tikz@moveto@waiting{\tikz@shapeborder@name}%
\else%
\tikz@path@lineto{\pgfqpoint{\tikz@lastx}{\pgf@yc}}%
\tikz@path@lineto{\tikz@last@position}%
@@ -2791,17 +2895,17 @@
\fi%
\let\tikz@timer=\tikz@timer@hvline%
\tikz@scan@next@command%
-}
+}%
-% Syntax for lineto vertical/horizontal:
+% Syntax for lineto vertical/horizontal:
% |- <point>
-\def\tikz@vh@lineto-{\tikz@vh@lineto@next}
+\def\tikz@vh@lineto-{\tikz@vh@lineto@next}%
\def\tikz@vh@lineto@next{%
\pgfutil@ifnextchar n{\tikz@collect@label@onpath\tikz@vh@lineto@next}{%
\pgfutil@ifnextchar p{\tikz@collect@pic@onpath\tikz@vh@lineto@next}%
{\pgfutil@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@vh@lineto@next}%
- {\tikz@scan@one@point\tikz@@vh@lineto}}}}
+ {\tikz@scan@one@point\tikz@@vh@lineto}}}}%
\def\tikz@@vh@lineto#1{%
\edef\tikz@timer@start{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
\pgf@xc=\tikz@lastx%
@@ -2818,7 +2922,7 @@
\xdef\tikz@timer@end@temp{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}% move out of group
}%
\let\tikz@timer@end=\tikz@timer@end@temp%
- \edef\tikz@moveto@waiting{\tikz@shapeborder@name}%
+ \edef\tikz@moveto@waiting{\tikz@shapeborder@name}%
\else%
\tikz@path@lineto{\pgfqpoint{\pgf@xc}{\tikz@lasty}}%
\tikz@path@lineto{\tikz@last@position}%
@@ -2826,9 +2930,9 @@
\fi%
\let\tikz@timer=\tikz@timer@vhline%
\tikz@scan@next@command%
-}
+}%
-% Syntax for cycle:
+% Syntax for cycle:
% -- cycle
\def\tikz@close c{%
\pgfutil@ifnextchar o{\tikz@collect@coordinate@onpath\tikz@lineto@mid c}% oops, a coordinate
@@ -2843,39 +2947,53 @@
\let\tikz@timer=\tikz@timer@line%
\let\tikz@tangent\tikz@timer@start%
\tikz@scan@next@command%
-}
+}%
-% Syntax for options:
+% Syntax for options:
% [options]
\def\tikz@parse@options#1]{%
\tikzset{#1}%
\tikz@scan@next@command%
-}
+}%
% Syntax for edges:
% edge [options] (coordinate)
% edge [options] node {node text} (coordinate)
+% edge :attribute={...} [options] node {node text} (coordinate)
\def\tikz@edge@plain{%
\begingroup%
\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}
+ \let\tikz@@to@local@options\pgfutil@empty%
+ \let\tikz@collected@onpath=\pgfutil@empty%
+ \tikz@to@or@edge}%
% Syntax for to paths:
% to [options] (coordinate)
% to [options] node {node text} (coordinate)
+% to :attribute={...} [options] node {node text} (coordinate)
\def\tikz@to o{%
\tikz@to@use@last@coordinate%
\let\tikz@to@or@edge@function=\tikz@do@to%
- \tikz@to@or@edge}
-
-\def\tikz@to@or@edge{\pgfutil@ifnextchar[\tikz@@to@or@edge{\tikz@@to@or@edge[]}}%}
-\def\tikz@@to@or@edge[#1]{%
- \def\tikz@@to@local@options{#1}%
+ \let\tikz@@to@local@options\pgfutil@empty%
\let\tikz@collected@onpath=\pgfutil@empty%
- \tikz@@to@collect%
-}
+ \tikz@to@or@edge}%
+
+\def\tikz@to@or@edge{%
+ \pgfutil@ifnextchar[{\tikz@to@or@edge@option}{%
+ \pgfutil@ifnextchar:{\tikz@to@or@edge@animation}{%
+ \tikz@@to@collect}}%]
+}%
+\def\tikz@to@or@edge@option[#1]{%
+ \expandafter\def\expandafter\tikz@@to@local@options\expandafter{\tikz@@to@local@options,#1}%
+ \tikz@to@or@edge%
+}%
+\def\tikz@to@or@edge@animation:#1=#2{%
+ \expandafter\def\expandafter\tikz@@to@local@options\expandafter{\tikz@@to@local@options,%
+ animate={myself:{#1}={#2}}}%
+ \tikz@to@or@edge%
+}%
\def\tikz@@to@collect{%
\pgfutil@ifnextchar(\tikz@@to@or@edge@coordinate%)
{\pgfutil@ifnextchar n{\tikz@collect@label@onpath\tikz@@to@collect}%
@@ -2884,7 +3002,7 @@
{\pgfutil@ifnextchar +{\tikz@scan@one@point\tikz@@to@or@edge@math}%
{\tikzerror{(, +, coordinate, pic, or node expected}%)
\tikz@@to@or@edge@coordinate()}}}}}%
-}
+}%
\def\tikz@@to@or@edge@coordinate({%
\pgfutil@ifnextchar${%$
@@ -2897,17 +3015,17 @@
\tikz@@to@or@edge@@coordinate(%
}%
}%
-}
-\def\tikz@@to@or@edge@math#1{%
+}%
+\def\tikz@@to@or@edge@math#1{%
\pgf@process{#1}%
\edef\tikztotarget{\the\pgf@x,\the\pgf@y}%
\tikz@to@or@edge@function%
-}
+}%
\def\tikz@@to@or@edge@@coordinate(#1){%
\def\tikztotarget{#1}%
\tikz@to@or@edge@function%
-}
+}%
\def\tikz@do@edge{%
\ifx\tikz@edge@macro\pgfutil@empty%
@@ -2919,10 +3037,14 @@
\pgfscope%
\let\tikz@transform=\pgfutil@empty%
\let\tikz@options=\pgfutil@empty%
+ \tikz@clear@rdf@options%
\let\tikz@tonodes=\tikz@collected@onpath%
\def\tikztonodes{{\pgfextra{\tikz@node@is@a@labeltrue}\tikz@tonodes}}%
\let\tikz@collected@onpath=\pgfutil@empty%
\tikz@options%
+ \tikz@do@rdf@pre@options%
+ \pgfidscope%
+ \tikz@do@rdf@post@options%
\tikz@transform%
\let\tikz@transform=\relax%
% Typeset node:
@@ -2932,6 +3054,7 @@
\path[style=every edge]\expandafter[\tikz@@to@local@options](\tikztostart)\tikz@to@path
\pgfextra{\global\let\tikz@after@path@smuggle=\tikz@after@path};%
\tikz@atend@to%
+ \endpgfidscope%
\endpgfscope%
\endpgfinterruptpath%
\egroup
@@ -2939,15 +3062,15 @@
\egroup%
\global\setbox\tikz@tempbox=\box\tikz@whichbox%
\expandafter\endgroup%
- \expandafter\setbox\tikz@whichbox=\box\tikz@tempbox%
+ \expandafter\setbox\tikz@whichbox=\box\tikz@tempbox%
\else%
\expandafter\expandafter\expandafter\tikz@edge@macro%
\expandafter\expandafter\expandafter{\expandafter\tikz@@to@local@options\expandafter}\expandafter{\tikz@collected@onpath}%
\endgroup%
\let\tikz@after@path@smuggle=\pgfutil@empty%
\fi%
- \expandafter\tikz@scan@next@command\tikz@after@path@smuggle%
-}
+ \expandafter\tikz@scan@next@command\tikz@after@path@smuggle%
+}%
\def\tikz@do@to{%
\let\tikz@tonodes=\tikz@collected@onpath%
@@ -2963,7 +3086,7 @@
\pgf@stop%
\expandafter\tikz@scan@next@command\expandafter%
}\tikz@after@path%
-}
+}%
\def\tikz@to@use@last@coordinate{%
@@ -2972,60 +3095,60 @@
\else%
\edef\tikztostart{\the\tikz@lastx,\the\tikz@lasty}%
\fi%
-}
+}%
\def\tikz@to@use@last@fig@name{%
\edef\tikztostart{\tikz@to@last@fig@name}%
-}
+}%
% Syntax for graph path command:
-% graph {...}
+% graph [options] {...}
% See the graph library for details
-\def\tikz@graph aph{\tikz@lib@graph@parser}
+\def\tikz@graph aph{\tikz@lib@graph@parser}%
-\def\tikz@lib@graph@parser{\pgfutil@ifnextchar[\tikz@graph@error{\tikz@graph@error[]}}%]
+\def\tikz@lib@graph@parser{\pgfutil@ifnextchar[\tikz@graph@error{\tikz@graph@error[]}}%]%
\def\tikz@graph@error[#1]#2{%
- \tikzerror{You need to say \string\usetikzlibrary{graphs} in order to use the graph syntax}%
+ \tikzerror{You need to say \string\usetikzlibrary{graphs} 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:
+% Syntax for edge from parent:
% edge from parent [options]
-\def\tikz@edgetoparent from parent{\pgfutil@ifnextchar[\tikz@@edgetoparent{\tikz@@edgetoparent[]}}%}
+\def\tikz@edgetoparent from parent{\pgfutil@ifnextchar[\tikz@@edgetoparent{\tikz@@edgetoparent[]}}%}%
\def\tikz@@edgetoparent[#1]{%
\let\tikz@edge@to@parent@needed=\pgfutil@empty%
\def\tikz@edgetoparent@options{#1}%
\begingroup%
\let\tikz@collected@onpath=\pgfutil@empty%
\tikz@edgetoparentcollect%
-}
+}%
\def\tikz@edgetoparentcollect{
\pgfutil@ifnextchar n{\tikz@collect@label@onpath\tikz@edgetoparentcollect}%
{%
- \expandafter%
+ \expandafter%
\endgroup%
- \expandafter\tikz@edgetoparent@rollout\expandafter{\tikz@collected@onpath}%
+ \expandafter\tikz@edgetoparent@rollout\expandafter{\tikz@collected@onpath}%
}
-}
+}%
\def\tikz@edgetoparent@rollout#1{%
\pgfkeysgetvalue{/tikz/edge from parent macro}\tikz@etop@temp
\expandafter\tikz@scan@next@command\expandafter\tikz@etop@temp\expandafter{\tikz@edgetoparent@options}{#1}%
-}
+}%
% Syntax for bezier curves
% .. controls(point) and (point) .. (target)
-% .. controls(point) .. (target)
+% .. controls(point) .. (target)
% .. (target) % currently not supported
\def\tikz@dot.{\tikz@@dot}%
@@ -3033,14 +3156,14 @@
\pgfutil@ifnextchar n{\tikz@collect@label@onpath\tikz@@dot}{%
\pgfutil@ifnextchar p{\tikz@collect@pic@onpath\tikz@@dot}%
{\pgfutil@ifnextchar c{\tikz@curveto@double}{\tikz@curveto@auto}}}%
-}
+}%
\def\tikz@curveto@double co{%
\pgfutil@ifnextchar o{\tikz@collect@coordinate@onpath\tikz@@dot co}
- {\tikz@cureveto@@double}}
+ {\tikz@cureveto@@double}}%
\def\tikz@cureveto@@double ntrols#1{%
\tikz@scan@one@point\tikz@curveA#1%
-}
+}%
\def\tikz@curveA#1{%
\edef\tikz@timer@start{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
{%
@@ -3052,29 +3175,29 @@
\pgfutil@ifnextchar a
{\tikz@curveBand}%
{\let\tikz@curve@second\tikz@curve@first\tikz@curveCdots}%
-}
+}%
\def\tikz@curveBand and{%
\tikz@scan@one@point\tikz@curveB%
-}
+}%
\def\tikz@curveB#1{%
\def\tikz@curve@second{#1}%
\tikz@curveCdots}
\def\tikz@curveCdots{%
- \afterassignment\tikz@curveCdot\let\@next=}
+ \afterassignment\tikz@curveCdot\let\pgfutil@next=}%
\def\tikz@curveCdot.{%
- \ifx\@next.%
+ \ifx\pgfutil@next.%
\else%
\tikzerror{Dot expected}%
\fi%
\tikz@updatecurrenttrue%
\tikz@curveCcheck%
-}
+}%
\def\tikz@curveCcheck{%
\pgfutil@ifnextchar n{\tikz@collect@label@onpath\tikz@curveCcheck}{%
\pgfutil@ifnextchar p{\tikz@collect@pic@onpath\tikz@curveCcheck}%
{\pgfutil@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@curveCcheck}
{\tikz@scan@one@point\tikz@curveC}}}%
-}
+}%
\def\tikz@curveC#1{%
\tikz@make@last@position{#1}%
\edef\tikz@curve@third{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
@@ -3095,7 +3218,7 @@
\pgfpathmoveto{\pgfqpoint{\pgf@x}{\pgf@y}}%
\fi%
\let\tikz@timer@cont@one=\tikz@curve@first%
- \let\tikz@timer@cont@two=\tikz@curve@second%
+ \let\tikz@timer@cont@two=\tikz@curve@second%
% Second, the end:
\iftikz@shapeborder%
% ok, target is a shape. recalculate third
@@ -3107,7 +3230,7 @@
\global\let\tikz@timer@end@temp=\tikz@curve@third% move out of group
}%
\let\tikz@timer@end=\tikz@timer@end@temp%
- \edef\tikz@moveto@waiting{\tikz@shapeborder@name}%
+ \edef\tikz@moveto@waiting{\tikz@shapeborder@name}%
\else%
\pgfpathcurveto{\tikz@curve@first}{\tikz@curve@second}{\tikz@curve@third}%
\let\tikz@timer@end=\tikz@curve@third
@@ -3116,11 +3239,11 @@
\let\tikz@timer=\tikz@timer@curve%
\let\tikz@tangent=\tikz@curve@second%
\tikz@scan@next@command%
-}
+}%
-% Syntax for rectangles:
-% rectangle <corner point>
+% Syntax for rectangles:
+% rectangle <corner point>
\def\tikz@rect ectangle{%
\tikz@flush@moveto%
\edef\tikz@timer@start{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
@@ -3132,16 +3255,16 @@
{
\pgf@xa=\tikz@lastx\relax%
\pgf@ya=\tikz@lasty\relax%
- \tikz@scan@one@point\tikz@rectB}}}}
+ \tikz@scan@one@point\tikz@rectB}}}}%
\def\tikz@rectB#1{%
\tikz@make@last@position{#1}%
\edef\tikz@timer@end{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
- \let\tikz@timer=\tikz@timer@line%
+ \let\tikz@timer=\tikz@timer@line%
\pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
\tikz@path@lineto{\pgfqpoint{\pgf@xa}{\tikz@lasty}}%
\tikz@path@lineto{\pgfqpoint{\tikz@lastx}{\tikz@lasty}}%
\tikz@path@lineto{\pgfqpoint{\tikz@lastx}{\pgf@ya}}%
- \iftikz@snaked%
+ \iftikz@snaked%
\tikz@path@lineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
\fi%
\pgfpathclose%
@@ -3149,17 +3272,17 @@
\def\pgfstrokehook{}%
\let\tikz@tangent\relax%
\tikz@scan@next@command%
-}
+}%
-% Syntax for grids:
-% grid <corner point>
+% Syntax for grids:
+% grid <corner point>
\def\tikz@grid id{%
\tikz@flush@moveto%
\pgf@xa=\tikz@lastx\relax%
\pgf@ya=\tikz@lasty\relax%
- \pgfutil@ifnextchar[{\tikz@gridA}{\tikz@gridA[]}}%}
+ \pgfutil@ifnextchar[{\tikz@gridA}{\tikz@gridA[]}}%}%
\def\tikz@gridA[#1]{%
\def\tikz@grid@options{#1}%
\tikz@cycle@expander{\tikz@scan@one@point\tikz@gridB}}%
@@ -3189,16 +3312,16 @@
{\pgfqpoint{\pgf@xa}{\pgf@ya}}{\pgfqpoint{\tikz@lastx}{\tikz@lasty}}%
\expandafter}%
\expandafter\tikz@scan@next@command\tikz@after@path%
-}
+}%
-% Syntax for plot:
+% Syntax for plot:
% plot [local options] ... % starts with a moveto
% -- plot [local options] ... % starts with a lineto
\def\tikz@plot lot{%
\tikz@flush@moveto%
- \pgfutil@ifnextchar[{\tikz@@plot}{\tikz@@plot[]}}%}
+ \pgfutil@ifnextchar[{\tikz@@plot}{\tikz@@plot[]}}%}%
\def\tikz@@plot[#1]{%
\let\tikz@tangent\tikz@tangent@lookup%
\begingroup%
@@ -3210,8 +3333,8 @@
{\pgfutil@ifnextchar c{\tikz@plot@scan@points}%
{\pgfutil@ifnextchar ({\tikz@plot@expression}{%
\tikzerror{Cannot parse this plotting data}%
- \endgroup}}}}
-\def\tikz@plot@f f{\pgfutil@ifnextchar i{\tikz@plot@file}{\tikz@plot@function}}
+ \endgroup}}}}%
+\def\tikz@plot@f f{\pgfutil@ifnextchar i{\tikz@plot@file}{\tikz@plot@function}}%
\def\tikz@plot@file ile#1{\def\tikz@plot@data{\pgfplotxyfile{#1}}\tikz@@@plot}%
\def\tikz@plot@scan@points coordinates#1{%
@@ -3220,18 +3343,18 @@
\pgfutil@ifnextchar\pgf@stop{\pgfplotstreamend\expandafter\tikz@@@plot\pgfutil@gobble}
{\tikz@scan@one@point\tikz@plot@next@point}%
#1\pgf@stop%
-}
+}%
\def\tikz@plot@next@point#1{%
\pgfplotstreampoint{#1}%
\pgfutil@ifnextchar\pgf@stop{\pgfplotstreamend\expandafter\tikz@@@plot\pgfutil@gobble}%
{\tikz@scan@one@point\tikz@plot@next@point}%
-}
+}%
\def\tikz@plot@function unction#1{%
- \def\tikz@plot@filename{\tikz@plot@prefix\tikz@plot@id}%
+ \def\tikz@plot@filename{\tikz@plot@prefix\tikz@plot@id}%
\iftikz@plot@raw@gnuplot%
\def\tikz@plot@data{\pgfplotgnuplot[\tikz@plot@filename]{#1}}%
\else%
- \iftikz@plot@parametric%
+ \iftikz@plot@parametric%
\def\tikz@plot@data{\pgfplotgnuplot[\tikz@plot@filename]{%
set samples \tikz@plot@samples;
set parametric;
@@ -3248,19 +3371,19 @@
\fi%
\fi%
\tikz@@@plot%
-}
+}%
\def\tikz@plot@no@resample{%
\pgfutil@IfFileExists{\tikz@plot@filename.table}%
{\def\tikz@plot@data{\pgfplotxyfile{\tikz@plot@filename.table}}}%
{}%
-}
+}%
\def\tikz@plot@expression(#1){%
\edef\tikz@plot@data{\noexpand\pgfplotfunction{\expandafter\noexpand\tikz@plot@var}{\tikz@plot@samplesat}}%
\expandafter\def\expandafter\tikz@plot@data\expandafter{\tikz@plot@data{\tikz@scan@one@point\pgfutil@firstofone(#1)}}%
\tikz@@@plot%
-}
+}%
\def\tikz@@@plot{%
\def\pgfplotlastpoint{\pgfpointorigin}%
@@ -3293,17 +3416,17 @@
\global\setbox\tikz@tempbox=\box\tikz@whichbox%
\global\let\tikz@after@path@smuggle=\tikz@after@path
\expandafter\endgroup%
- \expandafter\setbox\tikz@whichbox=\box\tikz@tempbox%
- \tikz@make@last@position{\tikz@@@temp}%
+ \expandafter\setbox\tikz@whichbox=\box\tikz@tempbox%
+ \tikz@make@last@position{\tikz@@@temp}%
\expandafter\tikz@scan@next@command\tikz@after@path@smuggle%
-}
+}%
\pgfdeclareplotmark{ball}
{%
\def\tikz@shading{ball}%
\shade (0pt,0pt) circle (\pgfplotmarksize);%
-}
+}%
@@ -3326,7 +3449,7 @@
\tikz@updatecurrenttrue%
\pgfpathcosine{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
\tikz@scan@next@command%
-}
+}%
% Syntax for sine curves:
% sin <end of quarter-period>
@@ -3346,22 +3469,22 @@
\tikz@updatecurrenttrue%
\pgfpathsine{\pgfqpoint{\pgf@xc}{\pgf@yc}}%
\tikz@scan@next@command%
-}
+}%
-% Syntax for parabolas:
+% Syntax for parabolas:
% parabola[options] bend <coordinate> <coordinate>
\def\tikz@parabola arabola{%
\let\tikz@tangent\tikz@tangent@lookup%
- \pgfutil@ifnextchar[{\tikz@parabola@options}{\tikz@parabola@options[]}}%}
+ \pgfutil@ifnextchar[{\tikz@parabola@options}{\tikz@parabola@options[]}}%}%
\def\tikz@parabola@options[#1]{%
\def\tikz@parabola@option{#1}%
- \pgfutil@ifnextchar b{\tikz@parabola@scan@bend}{\tikz@cycle@expander{\tikz@scan@one@point\tikz@parabola@semifinal}}}
-\def\tikz@parabola@scan@bend bend{\tikz@scan@one@point\tikz@parabola@scan@bendB}
+ \pgfutil@ifnextchar b{\tikz@parabola@scan@bend}{\tikz@cycle@expander{\tikz@scan@one@point\tikz@parabola@semifinal}}}%
+\def\tikz@parabola@scan@bend bend{\tikz@scan@one@point\tikz@parabola@scan@bendB}%
\def\tikz@parabola@scan@bendB#1{%
\def\tikz@parabola@bend{#1}%
\tikz@cycle@expander{\tikz@scan@one@point\tikz@parabola@semifinal}%
-}
+}%
\def\tikz@parabola@semifinal#1{%
\tikz@flush@moveto%
% Save original start:
@@ -3390,7 +3513,7 @@
\expandafter\endgroup%
\expandafter\expandafter\expandafter\pgfpathparabola\expandafter\tikz@parabola@b%
\expandafter\tikz@scan@next@command\tikz@after@path%
-}
+}%
% Syntax for circles:
@@ -3402,23 +3525,23 @@
% 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 ircle{\tikz@flush@moveto\tikz@@circle}%
+\def\tikz@ellipse llipse{\tikz@flush@moveto\tikz@@circle}%
\def\tikz@@circle{%
\let\tikz@tangent\relax%
\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@normal%
+ \let\pgfutil@next=\tikz@@circle@normal%
\else%
- \let\@next=\tikz@@circle@scanexpand%
+ \let\pgfutil@next=\tikz@@circle@scanexpand%
\fi%
- \@next%
+ \pgfutil@next%
}}%
-}
-\def\tikz@@circle@scanexpand{\expandafter\tikz@@circle}
-\def\tikz@@circle@normal{\tikz@circle@opt[]}
+}%
+\def\tikz@@circle@scanexpand{\expandafter\tikz@@circle}%
+\def\tikz@@circle@normal{\tikz@circle@opt[]}%
\def\tikz@circle@opt[#1]{%
{%
@@ -3430,7 +3553,7 @@
\tikz@do@circle{\pgfkeysvalueof{/tikz/x radius}}{\pgfkeysvalueof{/tikz/y radius}}
}%
\tikz@scan@next@command%
-}
+}%
\def\tikz@@@circle(#1){%
{%
@@ -3443,10 +3566,10 @@
\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%
@@ -3469,15 +3592,12 @@
\pgfpointxy{\tikz@ellipse@x}{0}}{\pgfpointxy{0}{\tikz@ellipse@y}}%
\fi%
\fi%
-}
+}%
-% Syntax 1 for arcs:
-% arc (start angle:end angle:radius)
+% Syntax for arcs:
+% arc [options]
%
-% Syntax 2 for arcs:
-% arc (start angle:end angle:x-radius and y-radius)
-%
-% radius can be dimensionless, then the arc is in the xy-coordinate system
+% (The syntax with parentheses is deprecated.)
\def\tikz@arcA rc{\tikz@flush@moveto\tikz@arc@cont}%
\def\tikz@arc@cont{%
\pgfutil@ifnextchar(%)
@@ -3487,16 +3607,16 @@
{%
\advance\tikz@expandcount by -10\relax% go down quickly
\ifnum\tikz@expandcount<0\relax%
- \let\@next=\tikz@@arc@normal%
+ \let\pgfutil@next=\tikz@@arc@normal%
\else%
- \let\@next=\tikz@@arc@scanexpand%
+ \let\pgfutil@next=\tikz@@arc@scanexpand%
\fi%
- \@next%
+ \pgfutil@next%
}%
}%
-}
-\def\tikz@@arc@scanexpand{\expandafter\tikz@arc@cont}
-\def\tikz@@arc@normal{\tikz@arc@opt[]}
+}%
+\def\tikz@@arc@scanexpand{\expandafter\tikz@arc@cont}%
+\def\tikz@@arc@normal{\tikz@arc@opt[]}%
\def\tikz@arc@opt[#1]{%
@@ -3508,7 +3628,7 @@
\ifx\tikz@s\pgfutil@empty%
\pgfmathsetmacro\tikz@s{\tikz@e-\tikz@d}
\else
- \ifx\tikz@e\pgfutil@empty%
+ \ifx\tikz@e\pgfutil@empty%
\pgfmathsetmacro\tikz@e{\tikz@s+\tikz@d}
\fi%
\fi%
@@ -3518,27 +3638,27 @@
{\pgfkeysvalueof{/tikz/y radius}}}%
}%
\pgf@marshal%
- \tikz@arcfinal%
-}
+ \tikz@arcfinal%
+}%
\def\tikz@@arcto(#1){%
\edef\tikz@temp{(#1)}%
\expandafter\tikz@@@arcto@check@slashand\tikz@temp%
-}
+}%
\def\tikz@@@arcto@check@slashand(#1:#2:#3){%
\pgfutil@in@{ and }{#3}%
- \ifpgfutil@in@%
+ \ifpgfutil@in@%
\tikz@parse@arc@and(#1:#2:#3)%
\else%
\tikz@parse@arc@and(#1:#2:{#3} and {#3})%
\fi%
- \tikz@arcfinal%
-}
+ \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{%
\let\tikz@tangent\tikz@tangent@lookup%
\edef\tikz@timer@start{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}%
@@ -3553,8 +3673,8 @@
\tikz@@@arcfinal{\pgfpatharc{\tikz@timer@start@angle}{\tikz@timer@end@angle}{\tikz@arc@x pt and \tikz@arc@y pt}}
{\pgfpointpolar{\tikz@timer@start@angle}{\tikz@arc@x pt and \tikz@arc@y pt}}
{\pgfpointpolar{\tikz@timer@end@angle}{\tikz@arc@x pt and \tikz@arc@y pt}}%
- \edef\tikz@timer@zero@axis{\noexpand\pgfqpoint{\tikz@arc@x pt}{0pt}}
- \edef\tikz@timer@ninety@axis{\noexpand\pgfqpoint{0pt}{\tikz@arc@y pt}}
+ \edef\tikz@timer@zero@axis{\noexpand\pgfqpoint{\tikz@arc@x pt}{0pt}}
+ \edef\tikz@timer@ninety@axis{\noexpand\pgfqpoint{0pt}{\tikz@arc@y pt}}
\else%
\tikzerror{You cannot mix dimensions and dimensionless values in an arc}%
\fi%
@@ -3567,12 +3687,12 @@
\tikz@@@arcfinal{\pgfpatharcaxes{\tikz@timer@start@angle}{\tikz@timer@end@angle}{\pgfpointxy{\tikz@arc@x}{0}}{\pgfpointxy{0}{\tikz@arc@y}}}
{\pgfpointpolarxy{\tikz@timer@start@angle}{\tikz@arc@x and \tikz@arc@y}}{\pgfpointpolarxy{\tikz@timer@end@angle}{\tikz@arc@x and \tikz@arc@y}}%
\pgf@process{\pgfpointxy{\tikz@arc@x}{0}}
- \edef\tikz@timer@zero@axis{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
+ \edef\tikz@timer@zero@axis{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
\pgf@process{\pgfpointxy{0}{\tikz@arc@y}}
- \edef\tikz@timer@ninety@axis{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
+ \edef\tikz@timer@ninety@axis{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}
\fi%
\fi%
-}
+}%
\def\tikz@@@arcfinal#1#2#3{%
#1%
@@ -3580,7 +3700,7 @@
\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}%
@@ -3593,40 +3713,40 @@
\tikz@lastysaved=\tikz@lasty%
\let\tikz@timer=\tikz@timer@arc%
\tikz@scan@next@command%
-}
+}%
% Syntax for coordinates:
% coordinate[options] (coordinate name) at (point)
% where ``at (point)'' is optional
\def\tikz@coordinate ordinate{%
- \pgfutil@ifnextchar[{\tikz@@coordinate@opt}{\tikz@@coordinate@opt[]}}
+ \pgfutil@ifnextchar[{\tikz@@coordinate@opt}{\tikz@@coordinate@opt[]}}%
\def\tikz@@coordinate@opt[#1]{%
\pgfutil@ifnextchar({\tikz@@coordinate[#1]}
- {\tikz@fig ode[shape=coordinate,#1]{}}}%}
+ {\tikz@fig ode[shape=coordinate,#1]{}}}%}%
\def\tikz@@coordinate[#1](#2){%
\pgfutil@ifnextchar a{\tikz@@coordinate@at[#1](#2)}
- {\tikz@fig ode[shape=coordinate,#1](#2){}}}
+ {\tikz@fig ode[shape=coordinate,#1](#2){}}}%
\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(%
-}
+}%
\def\tikz@@coordinate@at@math#1{%
\pgf@process{#1}%
\edef\tikz@temp{(\the\pgf@x,\the\pgf@y)}%
\expandafter\tikz@coordinate@caller\tikz@temp{}%
-}
-
+}%
+
% Syntax for nodes:
-% node foreach \var in {list} ... [options] (node name) at (pos) {label text}
+% node foreach \var in {list} ... :attribute={...} [options] (node name) at (pos) {label text}
%
-% all of [options], (node name), at(pos), and foreach are
+% all of :attribute, [options], (node name), at(pos), and foreach are
% optional. There can be multiple options and the ordering is not
% important as in node[draw] (a) [rotate=10] {text}, *except* that all
% foreach statements must come first.
@@ -3635,7 +3755,7 @@
%
\def\tikz@fig ode{%
\pgfutil@ifnextchar a\tikz@test@also{
- \pgfutil@ifnextchar f{\tikz@nodes@start}\tikz@normal@fig}}
+ \pgfutil@ifnextchar f{\tikz@nodes@start}\tikz@normal@fig}}%
\def\tikz@test@also a{\pgfutil@ifnextchar l\tikz@node@also{\tikz@normal@fig a}}%
\def\tikz@normal@fig{%
\edef\tikz@save@line@width{\the\pgflinewidth}%
@@ -3648,6 +3768,8 @@
\let\tikz@atend@scope=\pgfutil@empty%
\let\tikz@do@after@node=\tikz@scan@next@command%
\let\tikz@options=\pgfutil@empty%
+ \tikz@clear@rdf@options%
+ \let\tikz@id@name=\pgfutil@empty%
\let\tikz@after@path=\pgfutil@empty%
\let\tikz@transform=\pgfutil@empty%
\let\tikz@mode=\pgfutil@empty%
@@ -3670,21 +3792,23 @@
\pgfutil@ifnextchar a{\tikz@fig@scan@at}
{\pgfutil@ifnextchar({\tikz@fig@scan@name}
{\pgfutil@ifnextchar[{\tikz@fig@scan@options}%
- {\pgfutil@ifnextchar\bgroup{\tikz@fig@main}%
- {\tikzerror{A node must have a (possibly empty) label text}%
- \tikz@fig@main{}}}}}}%}}
+ {\pgfutil@ifnextchar:{\tikz@fig@scan@animation}%
+ {\pgfutil@ifnextchar\bgroup{\tikz@fig@main}%
+ {\tikzerror{A node must have a (possibly empty) label text}%
+ \tikz@fig@main{}}}}}}}%}}%
\def\tikz@fig@scan@at at{%
- \tikz@scan@one@point\tikz@@fig@scan@at}
+ \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){%
- \pgfkeysvalueof{/tikz/name/.@cmd}#1\pgfeov% CF : this is now ALWAYS consistent with 'name=' option; allows overrides.
- \tikz@@scan@fig}%
+ \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]{\iftikz@node@is@pic\tikz@enable@pic@quotes\else\tikz@enable@node@quotes\fi\tikzset{#1}\ifx\tikz@node@content\relax\expandafter\tikz@@scan@fig\else\tikz@expand@node@contents\fi}%
+\def\tikz@fig@scan@animation:#1=#2{\tikzset{animate={myself:{#1}={#2}}}\tikz@@scan@fig}%
\def\tikz@expand@node@contents{%
\expandafter\tikz@@scan@fig\expandafter{\tikz@node@content}%
-}
+}%
\let\tikz@node@reset@hook=\pgfutil@empty%
\let\tikz@node@begin@hook=\pgfutil@empty%
\def\tikz@fig@main{%
@@ -3693,58 +3817,63 @@
\expandafter\tikz@subpicture@handle%
\else%
\afterassignment\tikz@@fig@main\expandafter\let\expandafter\next\expandafter=%
- \fi}
+ \fi}%
\def\tikz@@fig@main{%
\pgfutil@ifundefined{pgf@sh@s@\tikz@shape}%
{\tikzerror{Unknown shape ``\tikz@shape.'' Using ``rectangle'' instead}%
\def\tikz@shape{rectangle}}%
{}%
\tikzset{every \tikz@shape\space node/.try}%
- \tikz@node@textfont%
+ \tikz@node@textfont%
\tikz@node@begin@hook%
\iftikz@is@matrix%
\let\tikz@next=\tikz@do@matrix%
\else%
\let\tikz@next=\tikz@do@fig%
\fi%
- \tikz@next%
-}
+ \tikz@next%
+}%
\let\tikz@nodepart@list\pgfutil@empty
-\def\tikz@do@fig{%
+\def\tikz@do@fig{%
% Ok, reset all node part boxes
\pgfutil@for\tikz@temp:=\tikz@nodepart@list\do{%
\expandafter\setbox\csname pgfnodepart\tikz@temp box\endcsname=\box\pgfutil@voidb@x%
}%
\setbox\pgfnodeparttextbox=\hbox%
\bgroup%
- \tikzset{every text node part/.try}%
- \ifx\tikz@textopacity\pgfutil@empty%
- \else%
- \pgfsetfillopacity{\tikz@textopacity}%
- \pgfsetstrokeopacity{\tikz@textopacity}%
- \fi%
\pgfinterruptpicture%
+ \pgfsys@begin@text%
+ \pgfsys@text@to@black@hook%
+ \tikzset{every text node part/.try}%
+ \ifx\tikz@textopacity\pgfutil@empty%
+ \else%
+ \pgfsetfillopacity{\tikz@textopacity}%
+ \pgfsetstrokeopacity{\tikz@textopacity}%
+ \fi%
\ifx\tikz@text@width\pgfutil@empty%
- \tikz@textfont%
+ \tikz@textfont%
\else%
\begingroup%
- \pgfmathsetlength{\pgf@x}{\tikz@text@width}%
+ \pgfmathsetlength{\pgf@x}{\tikz@text@width}%
\pgfutil@minipage[t]{\pgf@x}\leavevmode\hbox{}%
- \tikz@textfont%
+ \tikz@textfont%
\tikz@text@action%
\fi%
\tikz@atbegin@node%
\bgroup%
\aftergroup\unskip%
+ % Some color stuff has been moved from here to outside; this is
+ % necessary for support of dvisvgm and of animation
+ % snapshots.
\ifx\tikz@textcolor\pgfutil@empty%
\else%
\pgfutil@colorlet{.}{\tikz@textcolor}%
\fi%
- \pgfsetcolor{.}%
+ \pgfutil@color{.}%
\setbox\tikz@figbox=\box\pgfutil@voidb@x%
\setbox\tikz@figbox@bg=\box\pgfutil@voidb@x%
\tikz@uninstallcommands%
- \iftikz@handle@active@code%
+ \iftikz@handle@active@code%
\tikz@orig@shorthands%
\let\tikz@orig@shorthands\pgfutil@empty%
\fi%
@@ -3754,12 +3883,12 @@
\aftergroup\tikz@fig@collectresetcolor%
\tikz@halign@check%
\ignorespaces%
-}
+}%
\def\tikz@fig@collectresetcolor{%
% Hacks for special packages that mess with \aftergroup
\pgfutil@ifnextchar\reset@color% hack for color package
{\reset@color\afterassignment\tikz@fig@collectresetcolor\let\tikz@temp=}\tikz@fig@boxdone%
-}
+}%
\def\tikz@fig@boxdone{%
\tikz@atend@node%
\ifx\tikz@text@width\pgfutil@empty%
@@ -3767,13 +3896,14 @@
\pgfutil@endminipage%
\endgroup%
\fi%
+ \pgfsys@end@text%
\endpgfinterruptpicture%
\egroup%
\pgfutil@ifnextchar c{\tikz@fig@mustbenamed\tikz@fig@continue}%
{\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@path\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}%
@@ -3786,77 +3916,86 @@
\pgfscope%
\ifx\tikz@time\pgfutil@empty\let\tikz@time\tikz@time@for@matrix\fi%
\tikz@options%
- \setbox\tikz@figbox=\box\pgfutil@voidb@x%
- \setbox\tikz@figbox@bg=\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}%
- \ifpgfutil@in@%
- \expandafter\tikz@matrix@split\tikz@m@anchor\relax%
- \else%
- \def\tikz@matrix@shift{\pgfpointorigin}%
- \fi%
- \let\tikz@transform=\relax%
- \pgfmatrix%
- {\tikz@shape}%
- {\tikz@m@anchor}%
- {\tikz@fig@name}%
- {%
- \pgfutil@tempdima=\pgflinewidth%
- {\begingroup\tikz@finish}%
- \global\pgflinewidth=\pgfutil@tempdima%
- }%
- {\tikz@matrix@shift}%
- {%
- \tikz@matrix@make@active@ampersand%
- \def\pgfmatrixbegincode{%
- \pgfsys@beginscope%
- \tikz@common@matrix@code%
- \tikz@atbegin@cell%
- }%
- \def\tikz@common@matrix@code{%
- \let\tikz@options=\pgfutil@empty%
- \let\tikz@mode=\pgfutil@empty%
- \tikzset{every cell/.try={\the\pgfmatrixcurrentrow}{\the\pgfmatrixcurrentcolumn}}%
- \tikzset{column \the\pgfmatrixcurrentcolumn/.try}%
- \ifodd\pgfmatrixcurrentcolumn%
- \tikzset{every odd column/.try}%
- \else%
- \tikzset{every even column/.try}%
- \fi%
- \tikzset{row \the\pgfmatrixcurrentrow/.try}%
- \ifodd\pgfmatrixcurrentrow%
- \tikzset{every odd row/.try}%
- \else%
- \tikzset{every even row/.try}%
- \fi%
- \tikzset{row \the\pgfmatrixcurrentrow\space column \the\pgfmatrixcurrentcolumn/.try}%
- \tikz@options%
- }%
- \def\pgfmatrixendcode{%
- \tikz@atend@cell%
- \pgfsys@endscope%
- }%
- \def\pgfmatrixemptycode{%
- \pgfsys@beginscope%
- \tikz@common@matrix@code%
- \tikz@at@emptycell%
- \pgfsys@endscope%
+ \tikz@do@rdf@pre@options%
+ \tikz@is@nodefalse%
+ \tikz@call@id@hook%
+ \pgfidscope%
+ \tikz@do@rdf@post@options%
+ \begingroup%
+ \let\tikz@id@name\pgfutil@empty%
+ \pgfclearid%
+ \setbox\tikz@figbox=\box\pgfutil@voidb@x%
+ \setbox\tikz@figbox@bg=\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}%
+ \ifpgfutil@in@%
+ \expandafter\tikz@matrix@split\tikz@m@anchor\relax%
+ \else%
+ \def\tikz@matrix@shift{\pgfpointorigin}%
+ \fi%
+ \let\tikz@transform=\relax%
+ \pgfmatrix%
+ {\tikz@shape}%
+ {\tikz@m@anchor}%
+ {\tikz@fig@name}%
+ {%
+ \pgfutil@tempdima=\pgflinewidth%
+ {\begingroup\tikz@finish}%
+ \global\pgflinewidth=\pgfutil@tempdima%
}%
- \tikz@atbegin@matrix%
- \aftergroup\tikz@do@matrix@cont}%
- \bgroup%
-}
+ {\tikz@matrix@shift}%
+ {%
+ \tikz@matrix@make@active@ampersand%
+ \def\pgfmatrixbegincode{%
+ \pgfsys@beginscope%
+ \tikz@common@matrix@code%
+ \tikz@atbegin@cell%
+ }%
+ \def\tikz@common@matrix@code{%
+ \let\tikz@options=\pgfutil@empty%
+ \let\tikz@mode=\pgfutil@empty%
+ \tikzset{every cell/.try={\the\pgfmatrixcurrentrow}{\the\pgfmatrixcurrentcolumn}}%
+ \tikzset{column \the\pgfmatrixcurrentcolumn/.try}%
+ \ifodd\pgfmatrixcurrentcolumn%
+ \tikzset{every odd column/.try}%
+ \else%
+ \tikzset{every even column/.try}%
+ \fi%
+ \tikzset{row \the\pgfmatrixcurrentrow/.try}%
+ \ifodd\pgfmatrixcurrentrow%
+ \tikzset{every odd row/.try}%
+ \else%
+ \tikzset{every even row/.try}%
+ \fi%
+ \tikzset{row \the\pgfmatrixcurrentrow\space column \the\pgfmatrixcurrentcolumn/.try}%
+ \tikz@options%
+ }%
+ \def\pgfmatrixendcode{%
+ \tikz@atend@cell%
+ \pgfsys@endscope%
+ }%
+ \def\pgfmatrixemptycode{%
+ \pgfsys@beginscope%
+ \tikz@common@matrix@code%
+ \tikz@at@emptycell%
+ \pgfsys@endscope%
+ }%
+ \tikz@atbegin@matrix%
+ \aftergroup\tikz@do@matrix@cont}%
+ \bgroup%
+}%
\def\tikz@do@matrix@cont{%
- \tikz@atend@matrix%
+ \tikz@atend@matrix%
+ \endgroup%
+ \endpgfidscope%
\endpgfscope
\endpgfinterruptpath%
\egroup\egroup%
\egroup%
%
\tikz@node@finish%
-}
-
+}%
{%
\catcode`\&=13
\gdef\tikz@matrix@make@active@ampersand{%
@@ -3873,8 +4012,8 @@
\def\tikz@matrix@split#1.#2\relax{%
\def\tikz@m@anchor{text}%
\def\tikz@matrix@shift{\pgfpointanchor{#1}{#2}}%
-}
-
+}%
+
\def\tikz@fig@continue{%
\ifx\tikz@text@width\pgfutil@empty%
\else%
@@ -3896,28 +4035,49 @@
%
\tikz@node@transformations%
\tikz@nlt%
- %
+ %
\setbox\tikz@whichbox=\hbox{%
\unhbox\tikz@whichbox%
\hbox{{%
\pgfinterruptpath%
\pgfscope%
\tikz@options%
- \setbox\tikz@figbox=\box\pgfutil@voidb@x%
- \setbox\tikz@figbox@bg=\box\pgfutil@voidb@x%
- \pgfmultipartnode{\tikz@shape}{\tikz@anchor}{\tikz@fig@name}{%
- \pgfutil@tempdima=\pgflinewidth%
- {\begingroup\tikz@finish}%
- \global\pgflinewidth=\pgfutil@tempdima%
- }%
- \endpgfscope
+ \tikz@do@rdf@pre@options%
+ \tikz@is@nodetrue%
+ \tikz@call@id@hook%
+ \pgfidscope%
+ \tikz@do@rdf@post@options%
+ \let\tikz@id@name\pgfutil@empty%
+ \setbox\tikz@figbox=\box\pgfutil@voidb@x%
+ \setbox\tikz@figbox@bg=\box\pgfutil@voidb@x%
+ % Add color modifications to text box
+ \setbox\pgfnodeparttextbox=\hbox{{%
+ \pgfsys@begin@text% Colors moved here...
+ \ifx\tikz@textcolor\pgfutil@empty%
+ \else%
+ \pgfutil@colorlet{.}{\tikz@textcolor}%
+ \fi%
+ \pgfsetcolor{.}%
+ \pgfusetype{.text}%
+ \pgfidscope%
+ \box\pgfnodeparttextbox%
+ \endpgfidscope%
+ \pgfsys@end@text%
+ }}%
+ \pgfmultipartnode{\tikz@shape}{\tikz@anchor}{\tikz@fig@name}{%
+ \pgfutil@tempdima=\pgflinewidth%
+ {\begingroup\tikz@finish}%
+ \global\pgflinewidth=\pgfutil@tempdima%
+ }%
+ \endpgfidscope%
+ \endpgfscope%
\endpgfinterruptpath%
}}%
}%
%
\tikz@alias%
\tikz@node@finish%
-}
+}%
\def\tikz@fig@mustbenamed{%
@@ -3925,13 +4085,14 @@
% Assign a dummy name
\global\advance\tikz@fig@count by1\relax
\edef\tikz@fig@name{tikz@f@\the\tikz@fig@count}%
+ \let\tikz@id@name\tikz@fig@name%
\fi%
-}
+}%
\def\tikz@node@transformations{%
- %
+ %
% Possibly, we are ``online''
- %
+ %
\ifx\tikz@time\pgfutil@empty%
\pgftransformshift{\tikz@node@at}%
\iftikz@fullytransformed%
@@ -3944,9 +4105,9 @@
\fi%
% Invoke local transformations
\tikz@transform%
-}
+}%
-\def\tikz@node@finish{%
+\def\tikz@node@finish{%
\global\let\tikz@last@fig@name=\tikz@fig@name%
\global\let\tikz@after@path@smuggle=\tikz@after@path%
% shift box outside group
@@ -3959,10 +4120,10 @@
\tikz@do@after@path@smuggle%
\tikz@node@is@picfalse
\tikz@do@after@node%
-}
+}%
\let\tikz@fig@continue@orig=\tikz@fig@continue
-\def\tikz@do@after@node{\tikz@scan@next@command}
+\def\tikz@do@after@node{\tikz@scan@next@command}%
\def\tikz@do@after@path@smuggle{%
\let\tikz@to@last@fig@name=\tikz@last@fig@name%
@@ -3977,9 +4138,9 @@
\tikz@scan@next@command{\tikz@after@path@smuggle}\pgf@stop%
\fi%
\fi%
-}
+}%
-\def\tikz@call@late#1#2{\pgfnodepostsetupcode{#1}{\path[late options={name={#1},append after command={#2}}];}}
+\def\tikz@call@late#1#2{\pgfnodepostsetupcode{#1}{\path[late options={name={#1},append after command={#2}}];}}%
\newif\iftikz@do@align
@@ -3998,10 +4159,10 @@
\setbox\tikz@align@aligned@box=\box\pgfutil@voidb@x% void
\let\\=\tikz@align@newline%
\expandafter\tikz@start@align%
- \fi%
-}
-\def\tikz@align@newline{\pgfutil@protect\tikz@align@newline@}
-\def\tikz@align@newline@{\unskip\pgfutil@ifnextchar[\tikz@@align@newline{\tikz@@align@newline[0pt]}}%}
+ \fi%
+}%
+\def\tikz@align@newline{\pgfutil@protect\tikz@align@newline@}%
+\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
@@ -4011,12 +4172,12 @@
% 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%
@@ -4034,26 +4195,26 @@
\box\tikz@align@aligned@box%
\egroup%
}%
-}
-\def\tikz@align@continue{\tikz@@align@continue}
+}%
+\def\tikz@align@continue{\tikz@@align@continue}%
\let\tikz@@align@continue=\pgfutil@empty
-\def\tikz@node@also lso{\pgfutil@ifnextchar[\tikz@node@also@opt{\tikz@node@also@opt[]}}
+\def\tikz@node@also lso{\pgfutil@ifnextchar[\tikz@node@also@opt{\tikz@node@also@opt[]}}%
\def\tikz@node@also@opt[#1]{
\pgfutil@ifnextchar(%)
{\tikz@node@also@opt@cont[#1]}%
{\tikzerror{Syntax error in node also: ``('' expected.}%
\tikz@scan@next@command}%
-}
-\def\tikz@node@also@opt@cont[#1](#2){\tikzset{late options={name=#2,#1}}\tikz@scan@next@command}
-
+}%
+\def\tikz@node@also@opt@cont[#1](#2){\tikzset{late options={name=#2,#1}}\tikz@scan@next@command}%
+
% Syntax for parts of nodes:
% node ... {... \nodepart[options]{name} ... \nodepart{name} ...}
-\def\tikz@nodepart{\pgfutil@ifnextchar[\tikz@@nodepart{\tikz@@nodepart[]}}%}
+\def\tikz@nodepart{\pgfutil@ifnextchar[\tikz@@nodepart{\tikz@@nodepart[]}}%}%
\def\tikz@@nodepart[#1]#2{%
\tikz@atend@node%
\unskip%
@@ -4061,7 +4222,7 @@
\gdef\tikz@nodepart@name{#2}%
\global\let\tikz@fig@continue=\tikz@nodepart@continue%
\pgfutil@ifnextchar x{\egroup\relax}{\egroup\relax}% gobble spaces
-}
+}%
\def\tikz@nodepart@continue{%
\global\let\tikz@fig@continue=\tikz@fig@continue@orig%
\ifx\tikz@nodepart@list\pgfutil@empty%
@@ -4072,6 +4233,9 @@
% Now start new box:
\expandafter\setbox\csname pgfnodepart\tikz@nodepart@name box\endcsname=\hbox%
\bgroup%
+ \pgfinterruptpicture%
+ \pgfsys@begin@text%
+ \pgfsys@text@to@black@hook%
\tikzset{every \tikz@nodepart@name\space node part/.try}%
\expandafter\tikzset\expandafter{\tikz@nodepart@options}%
\ifx\tikz@textopacity\pgfutil@empty%
@@ -4079,27 +4243,27 @@
\pgfsetfillopacity{\tikz@textopacity}%
\pgfsetstrokeopacity{\tikz@textopacity}%
\fi%
- \pgfinterruptpicture%
+ % Colors moved here...
+ \ifx\tikz@textcolor\pgfutil@empty%
+ \else%
+ \pgfutil@colorlet{.}{\tikz@textcolor}%
+ \fi%
+ \pgfsetcolor{.}%
\ifx\tikz@text@width\pgfutil@empty%
- \tikz@textfont%
+ \tikz@textfont%
\else%
\begingroup%
\pgfmathsetlength{\pgf@x}{\tikz@text@width}%
\pgfutil@minipage[t]{\pgf@x}\leavevmode\hbox{}%
- \tikz@textfont%
+ \tikz@textfont%
\tikz@text@action%
\fi%
\bgroup%
\aftergroup\unskip%
- \ifx\tikz@textcolor\pgfutil@empty%
- \else%
- \pgfutil@colorlet{.}{\tikz@textcolor}%
- \fi%
- \pgfsetcolor{.}%
\setbox\tikz@figbox=\box\pgfutil@voidb@x%
\setbox\tikz@figbox@bg=\box\pgfutil@voidb@x%
\tikz@uninstallcommands%
- \iftikz@handle@active@code%
+ \iftikz@handle@active@code%
\tikz@orig@shorthands%
\let\tikz@orig@shorthands\pgfutil@empty%
\fi%
@@ -4110,12 +4274,12 @@
\aftergroup\tikz@fig@collectresetcolor%
\tikz@halign@check%
\ignorespaces%
-}
+}%
-%
+%
% Node foreach
-%
+%
\def\tikz@nodes@start{%
\let\tikz@nodes@list\pgfutil@empty%
@@ -4125,27 +4289,27 @@
\def\tikz@nodes@collect{node }%
\fi%
\tikz@nodes%
-}
+}%
\def\tikz@nodes foreach{\pgfutil@ifnextchar x\tikz@nodes@\tikz@nodes@}% get rid of spaces
\def\tikz@nodes@#1in{%
\expandafter\def\expandafter\tikz@nodes@list\expandafter{\tikz@nodes@list\foreach#1in}%
\pgfutil@ifnextchar\bgroup\tikz@nodes@group\tikz@nodes@one%
-}
+}%
\def\tikz@nodes@one#1{%
\expandafter\def\expandafter\tikz@nodes@list\expandafter{\tikz@nodes@list#1}%
\pgfutil@ifnextchar f\tikz@nodes\tikz@nodes@scan%
-}
+}%
\def\tikz@nodes@group#1{%
\expandafter\def\expandafter\tikz@nodes@list\expandafter{\tikz@nodes@list{#1}}%
\pgfutil@ifnextchar f\tikz@nodes\tikz@nodes@scan%
-}
+}%
\def\tikz@nodes@scan{%
\pgfutil@ifnextchar a{\tikz@nodes@at}%
{\pgfutil@ifnextchar({\tikz@nodes@name}%
{\pgfutil@ifnextchar[{\tikz@nodes@opt}%
{\pgfutil@ifnextchar\bgroup{\tikz@nodes@main}%
{\tikzerror{Nodes must have a (possibly empty) label text}%
- \tikz@fig@main{}}}}}}%}}
+ \tikz@fig@main{}}}}}}%}}%
\def\tikz@nodes@at at#1){%
\expandafter\def\expandafter\tikz@nodes@collect\expandafter{\tikz@nodes@collect at#1)}%
\tikz@nodes@scan}%
@@ -4179,14 +4343,14 @@
\setbox\tikz@figbox=\box\tikz@tempbox%
\setbox\tikz@figbox@bg=\box\tikz@tempbox@bg%
\tikz@scan@next@command%
-}
+}%
%
% "late" options can be used to "redo" a node
%
-\tikzset{late options/.code=\tikz@late@options{#1}}
+\tikzset{late options/.code=\tikz@late@options{#1}}%
\def\tikz@late@options#1{%
% Do a "virtual" node:
\begingroup%
@@ -4197,6 +4361,7 @@
\fi%
\tikz@is@matrixfalse%
\let\tikz@options=\pgfutil@empty%
+ \tikz@clear@rdf@options%
\let\tikz@after@path=\pgfutil@empty%
\let\tikz@afternodepathoptions=\pgfutil@empty%
\let\tikz@alias=\pgfutil@empty%
@@ -4204,7 +4369,7 @@
\tikz@decoratepathfalse%
\tikz@node@reset@hook%
\tikz@enable@node@quotes%
- \tikzset{every node/.try,#1}%
+ \tikzset{every node/.try,#1}%
\ifx\tikz@fig@name\pgfutil@empty%
\tikzerror{Late options must reference some existing node}%
\fi%
@@ -4215,7 +4380,7 @@
\global\let\tikz@after@path@smuggle=\tikz@after@path%
\endgroup%
\tikz@do@after@path@smuggle%
-}
+}%
% Auto placement
@@ -4223,19 +4388,23 @@
\def\tikz@auto@pre{%
\begingroup
\pgfresetnontranslationattimefalse
- \pgfslopedattimetrue%
+ \ifpgfslopedattime
+ \pgfslopedattimefalse%
+ \else
+ \pgfslopedattimetrue%
+ \fi
\pgfallowupsidedownattimetrue%
\tikz@timer%
- \pgf@x=\pgf@pt@aa pt%
+ \pgf@x=\pgf@pt@aa pt%
\pgf@y=\pgf@pt@ab pt%
\pgfpointnormalised{}%
-}
+}%
\def\tikz@auto@post{%
\global\let\tikz@anchor@smuggle=\tikz@anchor%
\endgroup%
\let\tikz@anchor=\tikz@anchor@smuggle%
-}
+}%
\def\tikz@auto@anchor{%
\ifdim\pgf@x>0.05pt%
@@ -4261,7 +4430,7 @@
\def\tikz@anchor{west}%
\fi%
\fi\fi%
-}
+}%
\def\tikz@auto@anchor@prime{%
\ifdim\pgf@x>0.05pt%
@@ -4287,16 +4456,16 @@
\def\tikz@anchor{east}%
\fi%
\fi\fi%
-}
+}%
%
% Callbacks: Please see the documentation of the graph drawing
% lib for info on these callbacks
%
-\def\tikzgdeventcallback#1#2{}
-\def\tikzgdeventgroupcallback#1{}
-\def\tikzgdlatenodeoptionacallback#1{}
+\def\tikzgdeventcallback#1#2{}%
+\def\tikzgdeventgroupcallback#1{}%
+\def\tikzgdlatenodeoptionacallback#1{}%
% Syntax for trees:
% node {...} child [options] {...} child [options] {...} ...
@@ -4306,22 +4475,22 @@
% Start collecting the children:
\let\tikz@children@list=\pgfutil@empty%
\tikznumberofchildren=0\relax%
- \tikz@collect@children c}
+ \tikz@collect@children c}%
-\def\tikz@collect@children{\pgfutil@ifnextchar c{\tikz@collect@children@cchar}{\tikz@children@collected}}
-\def\tikz@collect@children@cchar c{\pgfutil@ifnextchar h{\tikz@collect@child}{\tikz@children@collected c}}
-\def\tikz@collect@child hild{\pgfutil@ifnextchar[{\tikz@collect@childA}{\tikz@collect@childA[]}}%}
-\def\tikz@collect@childA[#1]{\pgfutil@ifnextchar f{\tikz@collect@children@foreach[#1]}{\tikz@collect@childB[#1]}}
+\def\tikz@collect@children{\pgfutil@ifnextchar c{\tikz@collect@children@cchar}{\tikz@children@collected}}%
+\def\tikz@collect@children@cchar c{\pgfutil@ifnextchar h{\tikz@collect@child}{\tikz@children@collected c}}%
+\def\tikz@collect@child hild{\pgfutil@ifnextchar[{\tikz@collect@childA}{\tikz@collect@childA[]}}%}%
+\def\tikz@collect@childA[#1]{\pgfutil@ifnextchar f{\tikz@collect@children@foreach[#1]}{\tikz@collect@childB[#1]}}%
\def\tikz@collect@childB[#1]{%
\advance\tikznumberofchildren by1\relax
\expandafter\def\expandafter\tikz@children@list\expandafter{\tikz@children@list \tikz@childnode[#1]}%
- \pgfutil@ifnextchar\bgroup{\tikz@collect@child@code}{\tikz@collect@child@code{}}}
+ \pgfutil@ifnextchar\bgroup{\tikz@collect@child@code}{\tikz@collect@child@code{}}}%
\def\tikz@collect@child@code#1{%
\expandafter\def\expandafter\tikz@children@list\expandafter{\tikz@children@list{#1}}%
\tikz@collect@children%
-}
+}%
\def\tikz@collect@children@foreach[#1]foreach#2in#3{%
- \pgfutil@ifnextchar\bgroup{\tikz@collect@children@foreachA{#1}{#2}{#3}}{\tikz@collect@children@foreachA{#1}{#2}{#3}{}}}
+ \pgfutil@ifnextchar\bgroup{\tikz@collect@children@foreachA{#1}{#2}{#3}}{\tikz@collect@children@foreachA{#1}{#2}{#3}{}}}%
\def\tikz@collect@children@foreachA#1#2#3#4{%
\expandafter\def\expandafter\tikz@children@list\expandafter
{\tikz@children@list\tikz@childrennodes[#1]{#2}{#3}{#4}}%
@@ -4332,15 +4501,16 @@
}%
\tikznumberofchildren=\c@pgf@counta%
\tikz@collect@children%
-}
+}%
\long\def\tikz@children@collected{%
\begingroup%
\advance\tikztreelevel by 1\relax%
\tikzgdeventgroupcallback{descendants}%
\let\tikz@options=\pgfutil@empty%
+ \tikz@clear@rdf@options%
\let\tikz@transform=\pgfutil@empty%
\tikzset{level/.try=\the\tikztreelevel,level \the\tikztreelevel/.try}%
- \tikz@transform%
+ \tikz@transform%
\let\tikz@transform=\relax%
\let\tikzparentnode=\tikz@last@fig@name%
\ifx\tikz@grow\relax\else%
@@ -4352,10 +4522,10 @@
\global\setbox\tikz@tempbox=\box\tikz@figbox%
\global\setbox\tikz@tempbox@bg=\box\tikz@figbox@bg%
\endgroup%
- \setbox\tikz@figbox=\box\tikz@tempbox%
- \setbox\tikz@figbox@bg=\box\tikz@tempbox@bg%
+ \setbox\tikz@figbox=\box\tikz@tempbox%
+ \setbox\tikz@figbox@bg=\box\tikz@tempbox@bg%
\tikz@scan@next@command%
-}
+}%
% Syntax for children:
%
@@ -4378,7 +4548,7 @@
\tikznumberofcurrentchild=\c@pgf@counta\relax%
\setbox\tikz@figbox=\box\tikz@tempbox%
\setbox\tikz@figbox@bg=\box\tikz@tempbox@bg%
-}
+}%
% Syntax for child:
@@ -4404,7 +4574,7 @@
\let\tikz@transform=\pgfutil@empty%
\tikzset{every child/.try,#1}%
\tikz@options%
- \tikz@transform%
+ \tikz@transform%
\let\tikz@transform=\relax%
\tikz@grow%
% Typeset node:
@@ -4429,12 +4599,12 @@
\egroup\egroup%
\egroup%
\fi%
-}
+}%
\def\tikz@parse@child@node{%
\pgfutil@ifnextchar n{\tikz@parse@child@node@n}%
{\pgfutil@ifnextchar c{\tikz@parse@child@node@c}%
- {\pgfutil@ifnextchar\pgf@stop\tikz@parse@child@node@rest\tikz@parse@child@node@expand}}}
+ {\pgfutil@ifnextchar\pgf@stop\tikz@parse@child@node@rest\tikz@parse@child@node@expand}}}%
\def\tikz@parse@child@node@expand{%
\advance\tikz@expandcount by-1\relax%
\ifnum\tikz@expandcount<0\relax%
@@ -4442,22 +4612,22 @@
\else%
\expandafter\expandafter\expandafter\tikz@parse@child@node%
\fi%
-}
-\def\tikz@parse@child@node@rest#1\pgf@stop{\tikz@expandcount=100\relax\def\tikz@child@node@rest{#1}}
-\def\tikz@parse@child@node@c c{\tikz@expandcount=100\pgfutil@ifnextchar o{\tikz@parse@child@node@co}{\tikz@parse@child@node@rest c}}
-\def\tikz@parse@child@node@co o{\pgfutil@ifnextchar o{\tikz@parse@child@node@coordinate}{\tikz@parse@child@node@rest co}}
+}%
+\def\tikz@parse@child@node@rest#1\pgf@stop{\tikz@expandcount=100\relax\def\tikz@child@node@rest{#1}}%
+\def\tikz@parse@child@node@c c{\tikz@expandcount=100\pgfutil@ifnextchar o{\tikz@parse@child@node@co}{\tikz@parse@child@node@rest c}}%
+\def\tikz@parse@child@node@co o{\pgfutil@ifnextchar o{\tikz@parse@child@node@coordinate}{\tikz@parse@child@node@rest co}}%
\def\tikz@parse@child@node@coordinate ordinate{%
\pgfutil@ifnextchar ({\tikz@@parse@child@node@coordinate}{%
\def\tikz@child@node@text{[shape=coordinate]{}}%
- \tikz@parse@child@node@rest}}%}
+ \tikz@parse@child@node@rest}}%}%
\def\tikz@@parse@child@node@coordinate(#1){%
\pgfutil@ifnextchar a{\tikz@p@c@n@c@at(#1)}{%
\def\tikz@child@node@text{[shape=coordinate,name=#1]{}}%
- \tikz@parse@child@node@rest}}
+ \tikz@parse@child@node@rest}}%
\def\tikz@p@c@n@c@at(#1)at#2({%
\def\tikz@child@node@text@pre{[shape=coordinate,name=#1]at}%
\tikz@scan@one@point\tikz@p@c@n@c@at@math(%
-}
+}%
\def\tikz@p@c@n@c@at@math#1{%
\pgf@process{#1}%
\edef\tikz@marshal{(\the\pgf@x,\the\pgf@y){}}%
@@ -4465,7 +4635,7 @@
\expandafter\expandafter\expandafter\tikz@child@node@text%
\expandafter\expandafter\expandafter{\expandafter\tikz@child@node@text@pre\tikz@marshal}%
\tikz@parse@child@node@rest%
-}
+}%
\def\tikz@parse@child@node@n node{\tikz@expandcount=100%
\let\tikz@child@node@text=\pgfutil@empty%
\tikz@p@c@s}%
@@ -4474,73 +4644,74 @@
{\pgfutil@ifnextchar ({\tikz@p@c@s@paran}
{\pgfutil@ifnextchar [{\tikz@p@c@s@bra}
{\pgfutil@ifnextchar \bgroup{\tikz@p@c@s@group}
- {\tikzerror{Cannot parse this node}}}}}}%}}
+ {\tikzerror{Cannot parse this node}}}}}}%}}%
\def\tikz@p@c@s@at at#1({%
\tikz@scan@one@point\tikz@p@c@s@at@math(%
-}
+}%
\def\tikz@p@c@s@at@math#1{%
\pgf@process{#1}%
\edef\tikz@marshal{ at(\the\pgf@x,\the\pgf@y)}%
\expandafter\expandafter\expandafter\def%
\expandafter\expandafter\expandafter\tikz@child@node@text%
\expandafter\expandafter\expandafter{\expandafter\tikz@child@node@text\tikz@marshal}
- \tikz@p@c@s}
+ \tikz@p@c@s}%
\def\tikz@p@c@s@paran(#1){%
\expandafter\def\expandafter\tikz@child@node@text\expandafter{\tikz@child@node@text(#1)}
- \tikz@p@c@s}
+ \tikz@p@c@s}%
\def\tikz@p@c@s@bra[#1]{%
\expandafter\def\expandafter\tikz@child@node@text\expandafter{\tikz@child@node@text[#1]}
- \tikz@p@c@s}
+ \tikz@p@c@s}%
\def\tikz@p@c@s@group#1{%
- \iftikz@handle@active@nodes%
+ \iftikz@handle@active@nodes%
\expandafter\def\expandafter\tikz@child@node@text\expandafter{\tikz@child@node@text{\scantokens{#1}}}%
\else%
\expandafter\def\expandafter\tikz@child@node@text\expandafter{\tikz@child@node@text{#1}}
\fi%
\tikz@parse@child@node@rest%
-}
+}%
-%
+%
% Syntax for decorated subpaths:
%
% decorate [option] { subpath }
%
\def\tikz@decoration ecorate{%
\pgfutil@ifnextchar[{\tikz@lib@decoration}{\tikz@lib@decoration[]}%]
-}
+}%
-\def\tikz@lib@decoration[#1]#2{\tikzerror{You need to load a decoration library}}
+\def\tikz@lib@decoration[#1]#2{\tikzerror{You need to load a decoration library}}%
% The decorate path command:
-\def\tikz@lib@dec@decorate@path{\tikzerror{You need to load a decoration library}}
+\def\tikz@lib@dec@decorate@path{\tikzerror{You need to load a decoration library}}%
-%
+%
% Syntax for let :
%
-% let \p1 = (coordinate), \p2 = (coordinate),... in
+% let \p1 = (coordinate), \p2 = (coordinate),... in
%
\def\tikz@let@command et#1in{%
\tikzerror{You need to say \string\usetikzlibrary{calc} to use the let command}%
-}
+ \tikz@scan@next@command%
+}%
%
% Syntax for pictures:
-%
+%
% as for nodes, but with "pic" instead of "node"
-%
+%
\newif\iftikz@node@is@pic
-\def\tikz@subpicture ic{\tikz@node@is@pictrue\tikz@scan@next@command node}
+\def\tikz@subpicture ic{\tikz@node@is@pictrue\tikz@scan@next@command node}%
\def\tikz@subpicture@handle#1{%
\pgfkeys@spdef\tikz@temp{#1}%
\expandafter\tikz@subpicture@handle@\expandafter{\tikz@temp}%
-}
+}%
\def\tikz@subpicture@handle@#1{
- \pgfkeys{/tikz/pics/.cd,#1}
+ \pgfkeys{/tikz/pics/.cd,#1}%
\tikz@node@transformations%
\let\tikz@transform=\relax%
\let\tikz@picmode\tikz@mode%
@@ -4570,7 +4741,7 @@
\egroup
\egroup%
\egroup%
- \fi%
+ \fi%
\pgfkeysgetvalue{/tikz/pics/foreground code}{\tikz@pic@code}
\ifx\tikz@pic@code\pgfutil@empty\else%
\setbox\tikz@figbox=\hbox\bgroup%
@@ -4592,7 +4763,7 @@
\egroup
\egroup%
\egroup%
- \fi%
+ \fi%
\pgfkeysgetvalue{/tikz/pics/background code}{\tikz@pic@code}
\ifx\tikz@pic@code\pgfutil@empty\else%
\setbox\tikz@figbox@bg=\hbox\bgroup%
@@ -4614,12 +4785,12 @@
\egroup
\egroup%
\egroup%
- \fi%
+ \fi%
\tikz@node@finish%
-}
+}%
\tikzset{
pic actions/.code=\tikz@addmode{\tikz@picmode}
-}
+}%
% Setting up the picture codes:
\tikzset{
@@ -4627,26 +4798,26 @@
pics/code/.initial=,
pics/background code/.initial=,
pics/foreground code/.initial=
-}
+}%
% Defining pictures:
-\def\tikzdeclarepic#1#2{\pgfkeys{/tikz/#1/.cd,#2}}
+\def\tikzdeclarepic#1#2{\pgfkeys{/tikz/#1/.cd,#2}}%
\pgfkeysdef{/handlers/.pic}{%
\edef\pgf@temp{\pgfkeyscurrentpath}%
\edef\pgf@temp{\expandafter\tikz@smuggle@pics@in\pgf@temp\pgf@stop}%
- \expandafter\pgfkeys\expandafter{\pgf@temp/.style={code={#1}}}
-}
-\def\tikz@smuggle@pics@in/tikz/#1\pgf@stop{/tikz/pics/#1}
+ \expandafter\pgfkeys\expandafter{\pgf@temp/.style={code={#1}}}%
+}%
+\def\tikz@smuggle@pics@in/tikz/#1\pgf@stop{/tikz/pics/#1}%
%
% Timers
-%
+%
\def\tikz@timer@line{%
\pgftransformlineattime{\tikz@time}{\tikz@timer@start}{\tikz@timer@end}%
-}
+}%
\def\tikz@timer@vhline{%
\ifdim\tikz@time pt<0.5pt% first half
@@ -4655,7 +4826,7 @@
\pgf@ya=\pgf@y%
\pgf@process{\tikz@timer@end}%
\pgf@xb=\tikz@time pt%
- \pgf@xb=2\pgf@xb%
+ \pgf@xb=2\pgf@xb%
\edef\tikz@marshal{\noexpand\pgftransformlineattime{\pgf@sys@tonumber{\pgf@xb}}{\noexpand\tikz@timer@start}{%
\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@y}}}%
\tikz@marshal%
@@ -4671,7 +4842,7 @@
{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@y}}{\noexpand\tikz@timer@end}}%
\tikz@marshal%
\fi%
-}
+}%
\def\tikz@timer@hvline{%
\ifdim\tikz@time pt<0.5pt% first half
@@ -4680,7 +4851,7 @@
\pgf@ya=\pgf@y%
\pgf@process{\tikz@timer@end}%
\pgf@xb=\tikz@time pt%
- \pgf@xb=2\pgf@xb%
+ \pgf@xb=2\pgf@xb%
\edef\tikz@marshal{\noexpand\pgftransformlineattime{\pgf@sys@tonumber{\pgf@xb}}{\noexpand\tikz@timer@start}{%
\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@ya}}}%
\tikz@marshal%
@@ -4696,11 +4867,11 @@
{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@ya}}{\noexpand\tikz@timer@end}}%
\tikz@marshal%
\fi%
-}
+}%
\def\tikz@timer@curve{%
\pgftransformcurveattime{\tikz@time}{\tikz@timer@start}{\tikz@timer@cont@one}{\tikz@timer@cont@two}{\tikz@timer@end}%
-}
+}%
\def\tikz@timer@arc{%
@@ -4721,13 +4892,13 @@
{\tikz@timer@zero@axis}%
{\tikz@timer@ninety@axis}%
{\tikz@timer@start@angle}{\tikz@timer@end@angle}%
-}
+}%
%
% Coordinate systems
-%
+%
\def\tikzdeclarecoordinatesystem#1#2{%
\expandafter\def\csname tikz@parse@cs@#1\endcsname(##1){%
@@ -4737,41 +4908,41 @@
}%
\let\tikz@shapeborder@name=\tikz@smubble@b%
\edef\tikz@return@coordinate{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}%
-}
+}%
\def\tikzaliascoordinatesystem#1#2{%
\edef\pgf@marshal{\noexpand\let\expandafter\noexpand\csname
tikz@parse@cs@#1\endcsname=\expandafter\noexpand\csname
tikz@parse@cs@#2\endcsname}%
\pgf@marshal%
-}
+}%
-% Default coodinate systems:
+% Default coordinate systems:
\tikzdeclarecoordinatesystem{canvas}
{%
\tikzset{cs/.cd,x=0pt,y=0pt,#1}%
\pgfpoint{\tikz@cs@x}{\tikz@cs@y}%
-}
+}%
\tikzdeclarecoordinatesystem{canvas polar}
{%
\tikzset{cs/.cd,angle=0,radius=0cm,#1}%
\pgfpointpolar{\tikz@cs@angle}{\tikz@cs@xradius and \tikz@cs@yradius}%
-}
+}%
\tikzdeclarecoordinatesystem{xyz}
{%
\tikzset{cs/.cd,x=0,y=0,z=0,#1}%
\pgfpointxyz{\tikz@cs@x}{\tikz@cs@y}{\tikz@cs@z}%
-}
+}%
\tikzdeclarecoordinatesystem{xyz polar}
{%
\tikzset{cs/.cd,angle=0,radius=0,#1}%
\pgfpointpolarxy{\tikz@cs@angle}{\tikz@cs@xradius and \tikz@cs@yradius}%
-}
-\tikzaliascoordinatesystem{xy polar}{xyz polar}
+}%
+\tikzaliascoordinatesystem{xy polar}{xyz polar}%
\tikzdeclarecoordinatesystem{node}
@@ -4791,14 +4962,14 @@
\else%
\pgfpointanchor{\tikz@pp@name{\tikz@cs@node}}{\tikz@cs@anchor}%
\fi%
-}
+}%
% Intersection coordinates
-\tikzset{cs/first line/.code=\def\tikz@cs@line@a{#1}\def\tikz@cs@type@a{line}}
-\tikzset{cs/second line/.code=\def\tikz@cs@line@b{#1}\def\tikz@cs@type@b{line}}
+\tikzset{cs/first line/.code=\def\tikz@cs@line@a{#1}\def\tikz@cs@type@a{line}}%
+\tikzset{cs/second line/.code=\def\tikz@cs@line@b{#1}\def\tikz@cs@type@b{line}}%
-\tikzset{cs/first node/.code=\tikz@cs@unpack{\tikz@cs@node@a}{\tikz@cs@type@a}{#1}}
-\tikzset{cs/second node/.code=\tikz@cs@unpack{\tikz@cs@node@b}{\tikz@cs@type@b}{#1}}
+\tikzset{cs/first node/.code=\tikz@cs@unpack{\tikz@cs@node@a}{\tikz@cs@type@a}{#1}}%
+\tikzset{cs/second node/.code=\tikz@cs@unpack{\tikz@cs@node@b}{\tikz@cs@type@b}{#1}}%
\def\tikz@cs@unpack#1#2#3{%
\expandafter\ifx\csname pgf@sh@ns@#3\endcsname\relax%
@@ -4807,12 +4978,12 @@
\def#1{#3}%
\edef#2{\csname pgf@sh@ns@#3\endcsname}%
\fi%
-}
+}%
-\tikzset{cs/solution/.initial=1}
+\tikzset{cs/solution/.initial=1}%
-\tikzset{cs/horizontal line through/.store in=\tikz@cs@hori@line}
-\tikzset{cs/vertical line through/.store in=\tikz@cs@vert@line}
+\tikzset{cs/horizontal line through/.store in=\tikz@cs@hori@line}%
+\tikzset{cs/vertical line through/.store in=\tikz@cs@vert@line}%
\tikzdeclarecoordinatesystem{intersection}
{%
@@ -4825,7 +4996,7 @@
\else%
\csname tikz@intersect@\tikz@cs@type@a @and@\tikz@cs@type@b\endcsname%
\fi%
-}
+}%
\def\tikz@intersect@line@and@line{%
\expandafter\tikz@scan@one@point\expandafter\tikz@parse@line\tikz@cs@line@a%
@@ -4841,14 +5012,14 @@
{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}}%
\pgf@marshal%
-}
+}%
\def\tikz@parse@line#1--{%
\pgf@process{#1}%
\pgf@xc=\pgf@x%
\pgf@yc=\pgf@y%
\tikz@scan@one@point\pgf@process%
-}
+}%
\tikzdeclarecoordinatesystem{perpendicular}
@@ -4857,7 +5028,7 @@
\expandafter\tikz@scan@one@point\expandafter\tikz@parse@intersection@a\tikz@cs@hori@line%
\expandafter\tikz@scan@one@point\expandafter\tikz@parse@intersection@b\tikz@cs@vert@line%
\pgfqpoint{\the\pgf@xb}{\the\pgf@ya}
-}
+}%
\tikzdeclarecoordinatesystem{barycentric}
{%
@@ -4870,7 +5041,7 @@
\global\pgf@x=\pgfmathresult\pgf@xa%
\global\pgf@y=\pgfmathresult\pgf@ya%
}%
-}
+}%
\def\tikz@bary@dolist#1=#2,{%
\def\tikz@temp{#1}%
@@ -4883,17 +5054,17 @@
\advance\pgf@xb by\pgfmathresult pt%
\expandafter\tikz@bary@dolist%
\fi%
-}
+}%
-\tikzset{cs/x/.store in=\tikz@cs@x}
-\tikzset{cs/y/.store in=\tikz@cs@y}
-\tikzset{cs/z/.store in=\tikz@cs@z}
-\tikzset{cs/angle/.store in=\tikz@cs@angle}
-\tikzset{cs/x radius/.store in=\tikz@cs@xradius}
-\tikzset{cs/y radius/.store in=\tikz@cs@yradius}
-\tikzset{cs/radius/.style={/tikz/cs/x radius=#1,/tikz/cs/y radius=#1}}
-\tikzset{cs/name/.store in=\tikz@cs@node}
-\tikzset{cs/anchor/.store in=\tikz@cs@anchor}
+\tikzset{cs/x/.store in=\tikz@cs@x}%
+\tikzset{cs/y/.store in=\tikz@cs@y}%
+\tikzset{cs/z/.store in=\tikz@cs@z}%
+\tikzset{cs/angle/.store in=\tikz@cs@angle}%
+\tikzset{cs/x radius/.store in=\tikz@cs@xradius}%
+\tikzset{cs/y radius/.store in=\tikz@cs@yradius}%
+\tikzset{cs/radius/.style={/tikz/cs/x radius=#1,/tikz/cs/y radius=#1}}%
+\tikzset{cs/name/.store in=\tikz@cs@node}%
+\tikzset{cs/anchor/.store in=\tikz@cs@anchor}%
@@ -4903,8 +5074,8 @@
% Last position visited
-\def\tikz@last@position{\pgfqpoint{\tikz@lastx}{\tikz@lasty}}
-\def\tikz@last@position@saved{\pgfqpoint{\tikz@lastxsaved}{\tikz@lastysaved}}
+\def\tikz@last@position{\pgfqpoint{\tikz@lastx}{\tikz@lasty}}%
+\def\tikz@last@position@saved{\pgfqpoint{\tikz@lastxsaved}{\tikz@lastysaved}}%
% Make given point the last position visited
\def\tikz@make@last@position#1{%
@@ -4916,45 +5087,45 @@
\tikz@lastysaved=\pgf@y\relax%
\fi%
\tikz@updatecurrenttrue%
-}
+}%
\newif\iftikz@updatecurrent
\tikz@updatecurrenttrue
-% Scanner: Scans a point or a relative point.
+% Scanner: Scans a point or a relative point.
% It then calls the first parameter with the argument set to an
% appropriate pgf command representing that point.
\def\tikz@scan@one@point#1{%
\let\tikz@to@use@whom=\tikz@to@use@last@coordinate%
\tikz@shapeborderfalse%
- \pgfutil@ifnextchar+{\tikz@scan@relative#1}{\tikz@scan@absolute#1}}
+ \pgfutil@ifnextchar+{\tikz@scan@relative#1}{\tikz@scan@absolute#1}}%
\def\tikz@scan@absolute#1{%
\pgfutil@ifnextchar({\tikz@scan@@absolute#1}%)
{%
\advance\tikz@expandcount by -1%
\ifnum\tikz@expandcount<0\relax%
- \let\@next=\tikz@@scangiveup%
+ \let\pgfutil@next=\tikz@@scangiveup%
\else%
- \let\@next=\tikz@@scanexpand%
+ \let\pgfutil@next=\tikz@@scanexpand%
\fi%
- \@next{#1}%
+ \pgfutil@next{#1}%
}%
-}
-\def\tikz@@scanexpand#1{\expandafter\tikz@scan@one@point\expandafter#1}
-\def\tikz@@scangiveup#1{\tikzerror{Cannot parse this coordinate}#1{\pgfpointorigin}}
+}%
+\def\tikz@@scanexpand#1{\expandafter\tikz@scan@one@point\expandafter#1}%
+\def\tikz@@scangiveup#1{\tikzerror{Cannot parse this coordinate}#1{\pgfpointorigin}}%
\def\tikz@scan@@absolute#1({%
\pgfutil@ifnextchar[% uhoh... options!
{\def\tikz@scan@point@recall{#1}\tikz@scan@options}%
{\tikz@@@scan@@absolute#1(}%
-}
+}%
\def\tikz@scan@options[#1]#2{%
\def\tikz@scan@point@options{#1}%
\tikz@@@scan@@absolute\tikz@scan@handle@options(#2%
-}
+}%
\def\tikz@scan@handle@options#1{%
{%
@@ -4967,15 +5138,15 @@
\pgf@process{\pgfpointtransformed{#1}}%
\xdef\tikz@marshal{\expandafter\noexpand\tikz@scan@point@recall{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}%
}%
- \tikz@marshal%
-}
+ \tikz@marshal%
+}%
\def\tikz@ensure@dollar@catcode{%
\ifnum\catcode`\$=3 %
\else
\tikzerror{Sorry, some package has redefined the meaning of the
math-mode dollar sign. This is incompatible with tikz and its calc
- library and might cause unrecoverable errors}%
+ library and might cause unrecoverable errors}%
% only show error once:
\global\let\tikz@ensure@dollar@catcode=\relax
\fi
@@ -4986,50 +5157,50 @@
\pgfutil@ifnextchar{$}%$
{\tikz@parse@calculator#1(}
{\tikz@scan@no@calculator#1(}%
-}
+}%
\def\tikz@scan@no@calculator#1(#2){%
\edef\tikz@temp{(#2)}%
\expandafter\tikz@@scan@@no@calculator\expandafter#1\tikz@temp%
-}
+}%
\def\tikz@@scan@@no@calculator#1(#2){%
\pgfutil@in@{cs:}{#2}%
\ifpgfutil@in@%
- \let\@next\tikz@parse@coordinatesystem%
+ \let\pgfutil@next\tikz@parse@coordinatesystem%
\else%
\pgfutil@in@{intersection }{#2}%
\ifpgfutil@in@%
- \let\@next\tikz@parse@intersection%
+ \let\pgfutil@next\tikz@parse@intersection%
\else%
\pgfutil@in@|{#2}%
\ifpgfutil@in@
\pgfutil@in@{-|}{#2}%
\ifpgfutil@in@
- \let\@next\tikz@parse@hv%
+ \let\pgfutil@next\tikz@parse@hv%
\else%
- \let\@next\tikz@parse@vh%
+ \let\pgfutil@next\tikz@parse@vh%
\fi%
\else%
\pgfutil@in@:{#2}%
\ifpgfutil@in@
- \let\@next\tikz@parse@polar%
+ \let\pgfutil@next\tikz@parse@polar%
\else%
\pgfutil@in@,{#2}%
- \ifpgfutil@in@%
- \let\@next\tikz@parse@regular%
+ \ifpgfutil@in@%
+ \let\pgfutil@next\tikz@parse@regular%
\else%
- \let\@next\tikz@parse@node%
+ \let\pgfutil@next\tikz@parse@node%
\fi%
\fi%
\fi%
\fi%
\fi%
- \@next#1(#2)%
-}
+ \pgfutil@next#1(#2)%
+}%
\def\tikz@parse@calculator#1($#2$){%
\tikzerror{You need to say \string\usetikzlibrary{calc} for coordinate calculation}%
#1{\pgfpointorigin}%
-}
+}%
\def\tikz@parse@coordinatesystem#1(#2 cs:#3){%
\let\tikz@return@coordinate=\pgfpointorigin%
@@ -5037,20 +5208,20 @@
{\tikzerror{Unknown coordinate system '#2'}}
{\csname tikz@parse@cs@#2\endcsname(#3)}%
\expandafter#1\expandafter{\tikz@return@coordinate}%
-}
+}%
\newif\iftikz@isdimension
\def\tikz@checkunit#1{%
\pgfmathparse{#1}%
\let\iftikz@isdimension=\ifpgfmathunitsdeclared%
-}
+}%
\def\tikz@parse@polar#1(#2:#3){%
\pgfutil@ifundefined{tikz@polar@dir@#2}
{\tikz@@parse@polar#1({#2}:{#3})}
{\tikz@@parse@polar#1(\csname tikz@polar@dir@#2\endcsname:{#3})}%
-}
+}%
\def\tikz@@parse@polar#1(#2:#3){%
\pgfutil@in@{ and }{#3}%
\ifpgfutil@in@%
@@ -5059,7 +5230,7 @@
\edef\tikz@args{({#2}:{#3} and {#3})}%
\fi%
\expandafter\tikz@@@parse@polar\expandafter#1\tikz@args%
-}
+}%
\def\tikz@@@parse@polar#1(#2:#3 and #4){%
\tikz@checkunit{#3}%
\iftikz@isdimension%
@@ -5080,69 +5251,65 @@
\fi%
\fi%
\tikz@next%
-}
-\def\tikz@polar@dir@up{90}
-\def\tikz@polar@dir@down{-90}
-\def\tikz@polar@dir@left{180}
-\def\tikz@polar@dir@right{0}
-\def\tikz@polar@dir@north{90}
-\def\tikz@polar@dir@south{-90}
-\def\tikz@polar@dir@east{0}
-\def\tikz@polar@dir@west{180}
-\expandafter\def\csname tikz@polar@dir@north east\endcsname{45}
-\expandafter\def\csname tikz@polar@dir@north west\endcsname{135}
-\expandafter\def\csname tikz@polar@dir@south east\endcsname{-45}
-\expandafter\def\csname tikz@polar@dir@south west\endcsname{-135}
-
-
-% 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.
-%
-% MW:
+}%
+\def\tikz@polar@dir@up{90}%
+\def\tikz@polar@dir@down{-90}%
+\def\tikz@polar@dir@left{180}%
+\def\tikz@polar@dir@right{0}%
+\def\tikz@polar@dir@north{90}%
+\def\tikz@polar@dir@south{-90}%
+\def\tikz@polar@dir@east{0}%
+\def\tikz@polar@dir@west{180}%
+\expandafter\def\csname tikz@polar@dir@north east\endcsname{45}%
+\expandafter\def\csname tikz@polar@dir@north west\endcsname{135}%
+\expandafter\def\csname tikz@polar@dir@south east\endcsname{-45}%
+\expandafter\def\csname tikz@polar@dir@south west\endcsname{-135}%
+
+
+% 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.
+% 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}}%
-}
+ \pgfutil@ifnextchar\bgroup{\tikz@@parse@regular#1{#2}}{\tikz@@@parse@regular#1{#2}}%
+}%
\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}}}}
-
+ \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){%
\pgfutil@in@,{#3}%
- \ifpgfutil@in@%
+ \ifpgfutil@in@%
\tikz@parse@splitxyz{#1}{#2}#3,%
\else%
\tikz@checkunit{#2}%
\iftikz@isdimension%
\tikz@checkunit{#3}%
\iftikz@isdimension%
- \def\@next{#1{\pgfpoint{#2}{#3}}}%
+ \def\pgfutil@next{#1{\pgfpoint{#2}{#3}}}%
\else%
- \def\@next{#1{\pgfpointadd{\pgfpoint{#2}{0pt}}{\pgfpointxy{0}{#3}}}}%
+ \def\pgfutil@next{#1{\pgfpointadd{\pgfpoint{#2}{0pt}}{\pgfpointxy{0}{#3}}}}%
\fi%
\else%
\tikz@checkunit{#3}%
\iftikz@isdimension%
- \def\@next{#1{\pgfpointadd{\pgfpoint{0pt}{#3}}{\pgfpointxy{#2}{0}}}}%
+ \def\pgfutil@next{#1{\pgfpointadd{\pgfpoint{0pt}{#3}}{\pgfpointxy{#2}{0}}}}%
\else%
- \def\@next{#1{\pgfpointxy{#2}{#3}}}%
+ \def\pgfutil@next{#1{\pgfpointxy{#2}{#3}}}%
\fi%
\fi%
\fi%
- \@next%
-}
+ \pgfutil@next%
+}%
\def\tikz@parse@splitxyz#1#2#3,#4,{%
- \def\@next{#1{\pgfpointxyz{#2}{#3}{#4}}}%
-}
+ \def\pgfutil@next{#1{\pgfpointxyz{#2}{#3}{#4}}}%
+}%
-\def\tikz@coordinate@text{coordinate}
+\def\tikz@coordinate@text{coordinate}%
\def\tikz@parse@node#1(#2){%
\pgfutil@in@.{#2}% Ok, flag this
@@ -5151,7 +5318,7 @@
\else%
\tikz@calc@anchor#2.center\tikz@stop% to be on the save side, in
% case iftikz@shapeborder is ignored...
- \expandafter\ifx\csname pgf@sh@ns@#2\endcsname\tikz@coordinate@text%
+ \expandafter\ifx\csname pgf@sh@ns@\tikz@pp@name{#2}\endcsname\tikz@coordinate@text%
\else
\tikz@shapebordertrue%
\def\tikz@shapeborder@name{\tikz@pp@name{#2}}%
@@ -5159,11 +5326,11 @@
\fi%
\edef\tikz@marshal{\noexpand#1{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}%
\tikz@marshal%
-}
+}%
\def\tikz@calc@anchor#1.#2\tikz@stop{%
\pgfpointanchor{\tikz@pp@name{#1}}{#2}%
-}
+}%
\def\tikz@parse@hv#1(#2){%
@@ -5183,11 +5350,11 @@
\fi%
\fi%
\fi%
- \tikz@next#1(#2)}
-\def\tikz@parse@hvboth#1(#2 -| #3){\tikz@parse@vhdone#1({#3}|-{#2})}
-\def\tikz@parse@hvleft#1(#2 -|#3){\tikz@parse@vhdone#1({#3}|-{#2})}
-\def\tikz@parse@hvright#1(#2-| #3){\tikz@parse@vhdone#1({#3}|-{#2})}
-\def\tikz@parse@hvdone#1(#2-|#3){\tikz@parse@vhdone#1({#3}|-{#2})}
+ \tikz@next#1(#2)}%
+\def\tikz@parse@hvboth#1(#2 -| #3){\tikz@parse@vhdone#1({#3}|-{#2})}%
+\def\tikz@parse@hvleft#1(#2 -|#3){\tikz@parse@vhdone#1({#3}|-{#2})}%
+\def\tikz@parse@hvright#1(#2-| #3){\tikz@parse@vhdone#1({#3}|-{#2})}%
+\def\tikz@parse@hvdone#1(#2-|#3){\tikz@parse@vhdone#1({#3}|-{#2})}%
\def\tikz@parse@vh#1(#2){%
\pgfutil@in@{ |- }{#2}%
@@ -5206,10 +5373,10 @@
\fi%
\fi%
\fi%
- \tikz@next#1(#2)}
-\def\tikz@parse@vhboth#1(#2 |- #3){\tikz@parse@vhdone#1({#2}|-{#3})}
-\def\tikz@parse@vhleft#1(#2 |-#3){\tikz@parse@vhdone#1({#2}|-{#3})}
-\def\tikz@parse@vhright#1(#2|- #3){\tikz@parse@vhdone#1({#2}|-{#3})}
+ \tikz@next#1(#2)}%
+\def\tikz@parse@vhboth#1(#2 |- #3){\tikz@parse@vhdone#1({#2}|-{#3})}%
+\def\tikz@parse@vhleft#1(#2 |-#3){\tikz@parse@vhdone#1({#2}|-{#3})}%
+\def\tikz@parse@vhright#1(#2|- #3){\tikz@parse@vhdone#1({#2}|-{#3})}%
\def\tikz@parse@vhdone#1(#2|-#3){%
{%
\tikz@@@scan@@absolute\tikz@parse@vh@mid(#2)%
@@ -5217,9 +5384,9 @@
\xdef\tikz@marshal{\noexpand#1{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}}%
}%
\tikz@marshal%
-}
-\def\tikz@parse@vh@mid#1{\pgf@process{#1}\pgf@xa=\pgf@x}
-\def\tikz@parse@vh@end#1{\pgf@process{#1}\pgf@ya=\pgf@y}
+}%
+\def\tikz@parse@vh@mid#1{\pgf@process{#1}\pgf@xa=\pgf@x}%
+\def\tikz@parse@vh@end#1{\pgf@process{#1}\pgf@ya=\pgf@y}%
\def\tikz@parse@intersection#1(intersection{%
\pgfutil@ifnextchar o{%
@@ -5227,7 +5394,7 @@
}{%
\tikz@parse@main@intersection#1%
}%
-}
+}%
\def\tikz@parse@main@intersection#1#2of #3 and #4){%
\tikzset{cs/solution=#2}%
\pgfutil@in@{--}{#3}%
@@ -5245,36 +5412,36 @@
\tikz@parse@cs@intersection()% advanced hackery...
\edef\pgf@marshal{\noexpand#1{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}%
\pgf@marshal%
-}
+}%
\def\tikz@reparse@line#1#2--#3\pgf@stop{%
\tikzset{cs/#1 line={(#2)--(#3)}}%
-}
+}%
-\def\tikz@parse@intersection@a#1{\pgf@process{#1}\pgf@xa=\pgf@x\pgf@ya=\pgf@y}
-\def\tikz@parse@intersection@b#1{\pgf@process{#1}\pgf@xb=\pgf@x\pgf@yb=\pgf@y}
+\def\tikz@parse@intersection@a#1{\pgf@process{#1}\pgf@xa=\pgf@x\pgf@ya=\pgf@y}%
+\def\tikz@parse@intersection@b#1{\pgf@process{#1}\pgf@xb=\pgf@x\pgf@yb=\pgf@y}%
\def\tikz@scan@relative#1+{%
- \pgfutil@ifnextchar+{\tikz@scan@plusplus#1}{\tikz@scan@oneplus#1}}
+ \pgfutil@ifnextchar+{\tikz@scan@plusplus#1}{\tikz@scan@oneplus#1}}%
\def\tikz@scan@plusplus#1+{%
\def\tikz@doafter{#1}%
\tikz@scan@absolute\tikz@add%
-}
+}%
\def\tikz@add#1{%
\tikz@doafter{\pgfpointadd{#1}{\tikz@last@position@saved}}%
-}
+}%
\def\tikz@scan@oneplus#1{%
\def\tikz@doafter{#1}%
\tikz@updatecurrentfalse%
\tikz@scan@absolute\tikz@add%
-}
+}%
-%
+%
% Quote handling
-%
+%
\let\tikz@enable@node@quotes\relax
\let\tikz@enable@edge@quotes\relax
@@ -5287,16 +5454,16 @@
% Include a library file.
%
% #1 = List of names of library file.
-%
+%
% Description:
%
% This command includes a list of TikZ library files. For each file X in the
% list, the file tikzlibraryX.code.tex is included, provided this has
-% not been done earlier.
+% not been done earlier.
%
% For the convenience of Context users, both round and square brackets
% are possible for the argument.
-%
+%
% If no file tikzlibraryX.code.tex exists, the file
% pgflibraryX.code.tex is tried instead. If this file, also, does not
% exist, an error message is printed.
@@ -5306,8 +5473,8 @@
% \usetikzlibrary{arrows}
% \usetikzlibrary[patterns,topaths]
-\def\usetikzlibrary{\pgfutil@ifnextchar[{\use@tikzlibrary}{\use@@tikzlibrary}}%}
-\def\use@tikzlibrary[#1]{\use@@tikzlibrary{#1}}
+\def\usetikzlibrary{\pgfutil@ifnextchar[{\use@tikzlibrary}{\use@@tikzlibrary}}%}%
+\def\use@tikzlibrary[#1]{\use@@tikzlibrary{#1}}%
\def\use@@tikzlibrary#1{%
\edef\pgf@list{#1}%
\pgfutil@for\pgf@temp:=\pgf@list\do{%
@@ -5338,12 +5505,12 @@
\fi%
\fi
}%
-}
+}%
% Always-present libraries:
-\usetikzlibrary{topaths}
+\usetikzlibrary{topaths}%
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf.lua
index 0ffbaf53c13..da0aba39121 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf.lua,v 1.3 2013/04/04 20:43:44 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua
index b813ccab603..cf94454a494 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd.lua,v 1.1 2012/11/27 17:24:23 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings.lua
index 8f72092e4e9..410da3af455 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/bindings.lua,v 1.1 2012/11/27 17:24:23 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/Binding.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/Binding.lua
index f062c7a54c5..5b60d90ccd6 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/Binding.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/Binding.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/bindings/Binding.lua,v 1.6 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/BindingToPGF.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/BindingToPGF.lua
index 0ad475fbf3e..90519e23d55 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/BindingToPGF.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/bindings/BindingToPGF.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/bindings/BindingToPGF.lua,v 1.11 2015/06/08 21:58:24 tantau Exp $
+-- @release $Header$
@@ -63,10 +63,16 @@ require("pgf.gd.bindings").BindingToPGF = BindingToPGF
-- Imports
local lib = require "pgf.gd.lib"
+local Coordinate = require "pgf.gd.model.Coordinate"
+local Path = require "pgf.gd.model.Path"
+
-- The implementation
-- Forward
local table_in_pgf_syntax
+local animations_in_pgf_syntax
+local path_in_pgf_syntax
+local coordinate_in_pgf_syntax
@@ -140,7 +146,7 @@ function BindingToPGF:renderVertex(v)
local info = assert(self.storage[v], "thou shalt not modify the syntactic digraph")
tex.print(
string.format(
- "\\pgfgdcallbackrendernode{%s}{%.12fpt}{%.12fpt}{%.12fpt}{%.12fpt}{%.12fpt}{%.12fpt}{%s}",
+ "\\pgfgdcallbackrendernode{%s}{%.12fpt}{%.12fpt}{%.12fpt}{%.12fpt}{%.12fpt}{%.12fpt}{%s}{%s}",
'not yet positionedPGFINTERNAL' .. v.name,
info.x_min,
info.x_max,
@@ -148,7 +154,8 @@ function BindingToPGF:renderVertex(v)
info.y_max,
v.pos.x,
v.pos.y,
- info.box_count))
+ info.box_count,
+ animations_in_pgf_syntax(v.animations)))
end
function BindingToPGF:retrieveBox(index, box_num)
@@ -230,6 +237,7 @@ function BindingToPGF:renderEdge(e)
end
callback [#callback + 1] = '}'
+ callback [#callback + 1] = '{' .. animations_in_pgf_syntax(e.animations) .. '}'
-- hand TikZ code over to TeX
tex.print(table.concat(callback))
@@ -276,5 +284,91 @@ function table_in_pgf_syntax (t)
end
+function animations_in_pgf_syntax (a)
+ return
+ table.concat(
+ lib.imap(
+ a,
+ function(animation)
+ return "\\pgfanimateattribute{" .. animation.attribute .. "}{whom=pgf@gd," ..
+ table.concat(
+ lib.imap (
+ animation.entries,
+ function (entry)
+ return "entry={" .. entry.t .. "s}{" .. to_pgf(entry.value) .. "}"
+ end
+ ), ",") ..
+ "," ..
+ table.concat(
+ lib.imap(
+ animation.options or {},
+ function(table)
+ if table.value then
+ return table.key .. "={" .. to_pgf(table.value) .. "}"
+ else
+ return table.key
+ end
+ end), ",")
+ .. "}"
+ end)
+ )
+end
+
+
+function to_pgf(x)
+ if type (x) == "table" then
+ if getmetatable(x) == Coordinate then
+ return coordinate_in_pgf_syntax(x)
+ elseif getmetatable(x) == Path then
+ return path_in_pgf_syntax(x)
+ else
+ error("illegal table in value of a key to be passed back to pgf")
+ end
+ else
+ return tostring(x)
+ end
+end
+
+function path_in_pgf_syntax (p)
+
+ local s = {}
+
+ local i = 1
+ while i <= #p do
+ local c = p[i]
+ assert (type(c) == "string", "illegal path operand")
+
+ if c == "lineto" then
+ i = i + 1
+ local d = rigid(p[i])
+ s [#s + 1] = '\\pgfpathlineto{\\pgfqpoint{' .. to_pt(d.x) .. '}{' .. to_pt(d.y) .. '}}'
+ i = i + 1
+ elseif c == "moveto" then
+ i = i + 1
+ local d = rigid(p[i])
+ s [#s + 1] = '\\pgfpathmoveto{\\pgfqpoint{' .. to_pt(d.x) .. '}{' .. to_pt(d.y) .. '}}'
+ i = i + 1
+ elseif c == "closepath" then
+ s [#s + 1] = '\\pgfpathclose'
+ i = i + 1
+ elseif c == "curveto" then
+ local d1, d2, d3 = rigid(p[i+1]), rigid(p[i+2]), rigid(p[i+3])
+ i = i + 3
+ s [#s + 1] = '\\pgfpathcurveto{\\pgfqpoint{' .. to_pt(d1.x) .. '}{' .. to_pt(d1.y) .. '}}{\\pgfqpoint{'
+ .. to_pt(d2.x) .. '}{' .. to_pt(d2.y) .. '}}{\\pgfqpoint{'
+ .. to_pt(d3.x) .. '}{' .. to_pt(d3.y) .. '}}'
+ i = i + 1
+ else
+ error("illegal operation in edge path")
+ end
+ end
+
+ return table.concat(s)
+end
+
+function coordinate_in_pgf_syntax(c)
+ return '\\pgfqpoint{'..to_pt(c.x) .. '}{'.. to_pt(c.y) .. '}'
+end
+
-return BindingToPGF \ No newline at end of file
+return BindingToPGF
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular.lua
index 0249c9130af..cddfd96dfd4 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/circular.lua,v 1.1 2012/11/27 17:24:23 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/Tantau2012.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/Tantau2012.lua
index 1966a3066c5..8e0d7d5bc66 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/Tantau2012.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/Tantau2012.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/circular/Tantau2012.lua,v 1.9 2014/03/19 09:20:57 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua
index d3c267394c4..e532e783e11 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/circular/doc.lua,v 1.1 2014/03/19 09:20:57 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
local documentation = require 'pgf.gd.doc'.documentation
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/library.lua
index ac229a8e0d0..016cfe483f7 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/circular/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/circular/library.lua,v 1.2 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control.lua
index 3492510d242..a3bec1fef38 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control.lua,v 1.1 2012/11/27 17:24:23 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Anchoring.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Anchoring.lua
index a3f5de83194..ccbb097583c 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Anchoring.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Anchoring.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/Anchoring.lua,v 1.7 2014/03/19 09:20:58 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua
index f5475227245..dec07caaccd 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentAlign.lua,v 1.4 2013/05/23 20:01:25 tantau Exp $
+-- @release $Header$
local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDirection.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDirection.lua
index 39df30ab248..a84800d94cf 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDirection.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDirection.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDirection.lua,v 1.2 2013/05/23 20:01:25 tantau Exp $
+-- @release $Header$
local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua
index 30f5630ce52..5bf473e9c6a 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentDistance.lua,v 1.2 2013/05/23 20:01:25 tantau Exp $
+-- @release $Header$
local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentOrder.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentOrder.lua
index 63a8896e8a4..0cad5d7d9b5 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentOrder.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentOrder.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/ComponentOrder.lua,v 1.3 2013/05/23 20:01:25 tantau Exp $
+-- @release $Header$
local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Components.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Components.lua
index 0d1d2b1bf48..9d9621e6da4 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Components.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Components.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/Components.lua,v 1.3 2013/05/23 20:01:25 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Distances.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Distances.lua
index 046940d84f3..c1b64729fab 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Distances.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Distances.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/Distances.lua,v 1.5 2013/05/23 20:01:25 tantau Exp $
+-- @release $Header$
local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua
index bb2fd065b24..be1666b255b 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua,v 1.3 2013/05/23 20:01:25 tantau Exp $
+-- @release $Header$
local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/LayoutPipeline.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/LayoutPipeline.lua
index 7a6a910dfa0..c998ca490aa 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/LayoutPipeline.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/LayoutPipeline.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/LayoutPipeline.lua,v 1.13 2014/03/19 09:20:58 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/NodeAnchors.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/NodeAnchors.lua
index b159f21eef2..e7d44d7d10e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/NodeAnchors.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/NodeAnchors.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/NodeAnchors.lua,v 1.3 2013/10/08 09:21:17 tantau Exp $
+-- @release $Header$
local declare = require "pgf.gd.interface.InterfaceToAlgorithms".declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua
index a3205a06dbe..10f5ecdf471 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/Orientation.lua,v 1.2 2013/05/23 20:01:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Sublayouts.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Sublayouts.lua
index c10df7a0696..c28d12db563 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Sublayouts.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/Sublayouts.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/Sublayouts.lua,v 1.4 2013/09/23 20:04:26 tantau Exp $
+-- @release $Header$
local function full_print(g, pref)
local s = ""
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
index ac2b186f5d5..2d8317bd72d 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua,v 1.1 2014/03/19 09:20:58 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
local documentation = require 'pgf.gd.doc'.documentation
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua
index fbb3a33857d..e25e0cd628e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/control/library.lua,v 1.9 2013/05/23 20:01:26 tantau Exp $
+-- @release $Header$
-- Load declarations from:
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua
index 748eee9429a..0b8d9e324fb 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Cluster.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Edge.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Edge.lua
index 22ba62e04af..7d6369d2bc9 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Edge.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Edge.lua
@@ -9,7 +9,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Edge.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Graph.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Graph.lua
index 43b886787c4..23712278990 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Graph.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Graph.lua
@@ -9,7 +9,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Graph.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Iterators.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Iterators.lua
index 8e29d78667a..9e41e1124ee 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Iterators.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Iterators.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Iterators.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Node.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Node.lua
index 89e8a2e68fa..84d3d3ee11f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Node.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Node.lua
@@ -9,7 +9,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Node.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Vector.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Vector.lua
index ab94ebe9686..ef8500b5aeb 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Vector.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Vector.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/deprecated/Vector.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
--- Vector class
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc.lua
index 5d02603943c..428091a9ae4 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc.lua,v 1.2 2013/03/20 17:16:38 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased.lua
index 7dfd9179648..37878cd20f4 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased.lua,v 1.1 2013/03/07 22:28:37 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua
index 3f2b9bc2e30..0d987f7c5b6 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FMMMLayout.lua,v 1.2 2013/10/09 19:46:59 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FastMultipoleEmbedder.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FastMultipoleEmbedder.lua
index 8fe64399c91..4b676aff121 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FastMultipoleEmbedder.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FastMultipoleEmbedder.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/FastMultipoleEmbedder.lua,v 1.1 2013/03/15 15:04:41 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/GEMLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/GEMLayout.lua
index d564af44dfa..674bc996f14 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/GEMLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/GEMLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/GEMLayout.lua,v 1.2 2013/10/07 18:43:25 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/MultilevelLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/MultilevelLayout.lua
index 783ab8b4bff..4dc8d3b3fc7 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/MultilevelLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/MultilevelLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/MultilevelLayout.lua,v 1.1 2013/03/15 15:04:41 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFR.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFR.lua
index 2c5ae1bc293..b71d6629c13 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFR.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFR.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFR.lua,v 1.1 2013/11/07 15:43:35 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFRExact.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFRExact.lua
index 8d4462d0815..a79d94f7e2a 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFRExact.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFRExact.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderFRExact.lua,v 1.1 2013/11/07 15:43:35 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderKK.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderKK.lua
index a2882845c98..0d130b19235 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderKK.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderKK.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/SpringEmbedderKK.lua,v 1.1 2013/11/07 15:43:35 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/BarycenterPlacer.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/BarycenterPlacer.lua
index 20ca3ce3d12..55ac157e302 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/BarycenterPlacer.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/BarycenterPlacer.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/BarycenterPlacer.lua,v 1.1 2013/03/15 15:04:41 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/CirclePlacer.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/CirclePlacer.lua
index 0cda25ca466..1ef3e4914cb 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/CirclePlacer.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/CirclePlacer.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/CirclePlacer.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/EdgeCoverMerger.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/EdgeCoverMerger.lua
index 9623b70d89e..82af7b56366 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/EdgeCoverMerger.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/EdgeCoverMerger.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/EdgeCoverMerger.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/IndependentSetMerger.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/IndependentSetMerger.lua
index 15e11ff91c7..e65a9f41fe6 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/IndependentSetMerger.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/IndependentSetMerger.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/IndependentSetMerger.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.lua
index 352a1f5400a..7e5e261f55f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/LocalBiconnectedMerger.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MatchingMerger.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MatchingMerger.lua
index eb52badcc55..e7f8144e3bb 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MatchingMerger.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MatchingMerger.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MatchingMerger.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MedianPlacer.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MedianPlacer.lua
index 50be16489c2..10a8ba58994 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MedianPlacer.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MedianPlacer.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/MedianPlacer.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomMerger.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomMerger.lua
index 4d8bfd179de..aafb8afd2ad 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomMerger.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomMerger.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomMerger.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomPlacer.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomPlacer.lua
index 779e992bb83..a0c9738fa17 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomPlacer.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomPlacer.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/RandomPlacer.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarMerger.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarMerger.lua
index 081067143da..99ff4c621d3 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarMerger.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarMerger.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarMerger.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarPlacer.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarPlacer.lua
index 21eb1f122ee..eb186a56157 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarPlacer.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarPlacer.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/SolarPlacer.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/ZeroPlacer.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/ZeroPlacer.lua
index f4dcfc632cc..e7722fd669a 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/ZeroPlacer.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/ZeroPlacer.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/energybased/multilevelmixer/ZeroPlacer.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered.lua
index 6dfa6a46575..77a679d2be2 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered.lua,v 1.2 2013/03/07 18:17:14 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/BarycenterHeuristic.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/BarycenterHeuristic.lua
index f0e20321e86..5e4138eecef 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/BarycenterHeuristic.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/BarycenterHeuristic.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/BarycenterHeuristic.lua,v 1.1 2013/03/07 18:17:14 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/CoffmanGrahamRanking.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/CoffmanGrahamRanking.lua
index b5fd3ba6669..e2c09f21242 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/CoffmanGrahamRanking.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/CoffmanGrahamRanking.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/CoffmanGrahamRanking.lua,v 1.1 2013/03/05 23:44:30 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/DfsAcyclicSubgraph.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/DfsAcyclicSubgraph.lua
index 4a4935e4aea..eced60b2ed6 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/DfsAcyclicSubgraph.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/DfsAcyclicSubgraph.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/DfsAcyclicSubgraph.lua,v 1.1 2013/03/05 23:44:30 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastHierarchyLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastHierarchyLayout.lua
index af593f6d972..4d45270a01f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastHierarchyLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastHierarchyLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastHierarchyLayout.lua,v 1.2 2013/03/07 22:28:37 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastSimpleHierarchyLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastSimpleHierarchyLayout.lua
index 1798cb7e0df..719e6035699 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastSimpleHierarchyLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastSimpleHierarchyLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/FastSimpleHierarchyLayout.lua,v 1.1 2013/03/07 18:17:14 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyCycleRemoval.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyCycleRemoval.lua
index c0b407bb050..788baece4ff 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyCycleRemoval.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyCycleRemoval.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyCycleRemoval.lua,v 1.1 2013/03/05 23:44:30 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyInsertHeuristic.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyInsertHeuristic.lua
index f6c59ac2125..a8cd94ef197 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyInsertHeuristic.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyInsertHeuristic.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/GreedyInsertHeuristic.lua,v 1.1 2013/03/07 18:17:14 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/LongestPathRanking.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/LongestPathRanking.lua
index 65dd5176f8b..e81bb2e1c30 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/LongestPathRanking.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/LongestPathRanking.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/LongestPathRanking.lua,v 1.1 2013/03/05 23:44:30 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/MedianHeuristic.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/MedianHeuristic.lua
index 5ad07881fe1..b37480ac78c 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/MedianHeuristic.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/MedianHeuristic.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/MedianHeuristic.lua,v 1.1 2013/03/07 18:17:14 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/OptimalRanking.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/OptimalRanking.lua
index e694de6e790..64eb7eadd80 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/OptimalRanking.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/OptimalRanking.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/OptimalRanking.lua,v 1.1 2013/03/05 23:44:30 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SiftingHeuristic.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SiftingHeuristic.lua
index 6231ab49249..f54f0c33462 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SiftingHeuristic.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SiftingHeuristic.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SiftingHeuristic.lua,v 1.1 2013/03/07 18:17:14 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SplitHeuristic.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SplitHeuristic.lua
index fc897d71c51..1579c7153d9 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SplitHeuristic.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SplitHeuristic.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SplitHeuristic.lua,v 1.1 2013/03/07 18:17:14 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua
index d887b6c6bad..ef68a1db0db 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/layered/SugiyamaLayout.lua,v 1.4 2013/10/09 19:47:00 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout.lua
index e9c2c427774..bdf85e9905e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout.lua,v 1.1 2013/03/15 15:04:41 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/BalloonLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/BalloonLayout.lua
index 9a8dd45a641..bca8edd9ebc 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/BalloonLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/BalloonLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/BalloonLayout.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/CircularLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/CircularLayout.lua
index 4cada7886b4..5c8a926384e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/CircularLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/CircularLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/misclayout/CircularLayout.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/AcyclicSubgraphModule.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/AcyclicSubgraphModule.lua
index 97d3a7f0191..b2bb7e1d24c 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/AcyclicSubgraphModule.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/AcyclicSubgraphModule.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/AcyclicSubgraphModule.lua,v 1.1 2013/03/05 23:44:30 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/HierarchyLayoutModule.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/HierarchyLayoutModule.lua
index 9ee6a534eb4..a0292530cdb 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/HierarchyLayoutModule.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/HierarchyLayoutModule.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/HierarchyLayoutModule.lua,v 1.1 2013/03/07 22:28:37 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/InitialPlacer.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/InitialPlacer.lua
index 7fc5c535f2d..328a2806db8 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/InitialPlacer.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/InitialPlacer.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/InitialPlacer.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/MultilevelBuilder.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/MultilevelBuilder.lua
index d79f1c41fc7..9604c986409 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/MultilevelBuilder.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/MultilevelBuilder.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/MultilevelBuilder.lua,v 1.1 2013/03/15 15:04:43 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/RankingModule.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/RankingModule.lua
index 672a3375358..8dce27a3355 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/RankingModule.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/RankingModule.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/RankingModule.lua,v 1.1 2013/03/05 23:44:30 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/TwoLayerCrossMin.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/TwoLayerCrossMin.lua
index edc96e7b49f..877cba47f60 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/TwoLayerCrossMin.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/TwoLayerCrossMin.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/module/TwoLayerCrossMin.lua,v 1.1 2013/03/07 22:28:37 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity.lua
index 66835b6f012..c653bdc6b60 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity.lua,v 1.1 2013/05/23 20:01:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity/PlanarizationLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity/PlanarizationLayout.lua
index bceba167894..516d119f553 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity/PlanarizationLayout.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity/PlanarizationLayout.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/doc/ogdf/planarity/PlanarizationLayout.lua,v 1.1 2013/05/23 20:01:26 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples.lua
index bf6907bddb1..de33c0ed371 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/examples.lua,v 1.1 2012/11/27 17:24:23 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleDemo.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleDemo.lua
index cff5d95253a..da850ff0dea 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleDemo.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleDemo.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleDemo.lua,v 1.6 2013/12/20 14:44:46 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua
index 2becd305cf1..8eb9d7d7019 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleEdgeDemo.lua,v 1.3 2013/12/20 14:44:46 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua
index 1e3bd381e79..270ecce2c90 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/examples/SimpleHuffman.lua,v 1.5 2013/12/20 14:44:46 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/library.lua
index 0c8038d3148..85e74970095 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/examples/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/examples/library.lua,v 1.2 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GraphAnimationCoordination.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GraphAnimationCoordination.lua
new file mode 100644
index 00000000000..2dd23937fe1
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GraphAnimationCoordination.lua
@@ -0,0 +1,638 @@
+-- Copyright 2015 by Malte Skambath
+--
+-- This file may be distributed an/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 information
+
+
+--
+--
+-- @field.visible_objects An array which stores for each supernode a mapping
+-- of snapshots to the related visible snapshot nodes.
+-- Note that these mappings may differ from the supergraph
+-- because if there are two snapshot nodes in consecutive snapshots
+-- then the first can be shown for a longer time period to
+-- put aside some fade animations.
+-- @field is_first A table storing for each snapshot node or snapshot arc if it
+-- appears in its snapshot. This means that in the previous snapshot
+-- there is no corresponding arc or node.
+-- @field is_last A table storing for each snapshot node or arc if there
+-- is no representative in the next snapshot.
+-- @field move_on_enter A table which stores for each snapshot object if it is in
+-- motion while it appears in its snapshot.
+-- @field move_on_leave A table which stores for each snapshot object if it is in
+-- motion while switching to the next snapshot
+-- @field last_rep
+-- A table which stores for every snapshot node if the representing (visible) node
+-- disappears with the next snapshot.
+--
+-- @field previous_node The same as |next_node| just for the previous node
+-- @field next_node A Storage to map each snapshot node to the next node in the
+-- following snapshot related to the same supernode.
+-- If in the next snapshot there is node following snapshot node
+-- then the value is nil.
+--
+local GraphAnimationCoordination = {}
+
+-- Imports
+local lib = require "pgf.gd.lib"
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+local Storage = require "pgf.gd.lib.Storage"
+local Coordinate = require "pgf.gd.model.Coordinate"
+
+
+declare {
+ key = "modified",
+ type = "boolean",
+ Initial = false,
+ documentation = [["
+ This key specifies, if a supernode changed its
+ visual properties since the last snapshot.
+ The default value is |false| and prevent the algorithm
+ to produce a lot of unnecessary animations.
+ "]]
+}
+
+declare {
+ key = "unmodified",
+ use = {
+ { key = "modified", boolean = false},
+ },
+}
+
+
+---
+declare {
+ key = "minimum rest time",
+ type = "number",
+ initial = 0.5,
+ documentation = [["
+ This key specifies a minimum time in which a single node
+ has to be prohibited to be animated.
+ For a node with minimum rest time of 1s that exists in a snapshot
+ at time $t$ this means that all animations including movements and fadings
+ are only allowed before $t$-0.5s and after $t$+0.5s.
+ "]],
+}
+
+declare {
+ key = "maximum motion time",
+ type = "number",
+ initial = math.huge,
+ documentation = [["
+ Use this key if you want to limit the time during nodes are allowed to move
+ when they changing their positions.
+ "]],
+}
+
+declare {
+ key = "overlapping transition",
+ type = "boolean",
+ initial = true,
+ documentation = [["
+ Use this key if you want to allow that the fade animations for or dissappearing nodes may occurs while the mid time between two snapshots. If false then the appearing ends on the midtime and the disappering starts in this moment.
+ "]]
+}
+
+---
+declare {
+ key = "default evolving graph animation",
+ algorithm = GraphAnimationCoordination,
+ phase = "evolving graph animation",
+ phase_default = true,
+ summary = [["
+ This phase animates all vertices including movements and
+ fade in or fade out animations given an evolving graph as sequence
+ of single snapshot graphs.
+ "]],
+ documentation = [["
+ This phase animates all vertices including movements and
+ fade in or fade out animations given an evolving graph as sequence
+ of single snapshot graphs.
+
+ Your algorithm needs to work on evolving graphs and has to use
+ the |evolving graph animation| phase. You do not need to use
+ this key by yourself then because this key starts the default
+ algorithm algorithm of the phase.
+
+ \begin{codeexample}[]
+ local ga_class = self.digraph.options.algorithm_phases['evolving graph animation']
+ -- animate graph
+ ga_class.new {
+ main_algorithm = self,
+ supergraph = supergraph,
+ digraph = self.digraph,
+ ugraph = self.ugraph
+ }:run()
+ \end{codeexample}
+
+ This algorithm and phase require a supergraph instance and the original digraph and ugraph.
+ Note that you have to set the layout of the snapshot nodes before running algorithms of this
+ is useful.
+
+ "]],
+}
+
+-- Helpfunctions
+
+--
+-- Appends a move animation to a given snapshot object such that the
+-- object moves from one point to another on a straight line. Note
+-- that the coordinates of the two points are given as relative
+-- coordinates to the current origin of the object.
+--
+-- This means if we want to move a node 1cm to the right the value of
+-- |c_from| has to be (0,0) while |c_to| must be (1,0). The argument
+-- |c_from| is usefull for a node which has a position but its
+-- previous node related to the same supervertex is at a different
+-- position. Then we can use this argument to move the new node to
+-- its origin position for smooth transitions.
+--
+-- @field object The snapshot object which should be moved
+--
+-- @field c_from The coordinate where the animation starts
+--
+-- @field c_to The coordinate where the animation should end
+--
+-- @field t_start The time when the movement starts.
+--
+-- @field t_end The time when the animation stops.
+local function append_move_animation(object, c_from, c_to, t_start, t_end)
+ if not object then return end
+ assert(object, "no object to animate")
+ if ((c_from.x~=c_to.x) or (c_from.y~=c_to.y))then
+ local animations = object.animations or {}
+ local c1 = Coordinate.new((2*c_from.x+c_to.x)/3,(2*c_from.y+c_to.y)/3)
+ local c2 = Coordinate.new((c_from.x+2*c_to.x)/3,(c_from.y+2*c_to.y)/3)
+ local t1 = (7*t_start + 5*t_end)/12
+ local t2 = (5*t_start + 7*t_end)/12
+ table.insert(animations, {
+ attribute = "translate",
+ entries = {
+ { t = t_start, value = c_from},
+-- { t = t1, value = c1 },
+-- { t = t2, value = c2 },
+ { t = t_end, value = c_to }
+ },
+ options = { { key = "freeze at end", },
+-- {key = "entry control", value="0}{1",}
+ }
+ })
+ object.animations = animations
+ end
+end
+
+local function append_fade_animation(object, v_start, v_end, t_start, t_end)
+ local animations = object.animations or {}
+
+ if v_start == 0 then
+ table.insert(animations, {
+ attribute = "stage",
+ entries = { { t = t_start, value = "true"}, },
+ options = { { key = "freeze at end" } }
+ })
+ elseif v_end == 0 and nil then
+ table.insert(animations, {
+ attribute = "stage",
+ entries = { { t = t_end, value = "false"}, },
+ options = { --{ key = "freeze at end" }
+ }
+ })
+ end
+
+ table.insert(animations, {
+ attribute = "opacity",
+ entries = {
+ { t = t_start, value = v_start },
+ { t = t_end, value = v_end } },
+ options = { { key = "freeze at end" } }
+ })
+ object.animations = animations
+end
+
+--
+-- check if the difference/vector between two pairs (a1,a2),(b1,b2) of points
+-- is the same.
+local function eq_offset(a1, a2, b1, b2)
+ local dx = ((a1.x-a2.x) - (b1.x-b2.x))
+ local dy = ((a1.y-a2.y) - (b1.y-b2.y))
+ if dx<0 then dx = -dx end
+ if dy<0 then dy = -dy end
+ return dx<0.001 and dy<0.001
+end
+
+--
+-- Check if two arcs connect a pair of nodes at the same position.
+-- This can be used as an indicator that two consecutive arcs
+-- can be representet by the same arc object.
+--
+local function eq_arc(arc1, arc2)
+ if not arc1 or not arc2 then
+ return false
+ end
+ return eq_offset(arc1.tail.pos, arc1.head.pos, arc2.tail.pos, arc2.head.pos)
+end
+
+
+-- Implementation
+
+function GraphAnimationCoordination:run()
+ assert(self.supergraph, "no supergraph defined")
+
+ self.is_first = Storage.new()
+ self.is_last = Storage.new()
+ self.last_rep = Storage.new()
+ self.move_on_enter = Storage.new()
+ self.move_on_leave = Storage.new()
+ self.previous_node = Storage.new()
+ self.next_node = Storage.new()
+ self.visible_objects = Storage.new()
+
+
+ self:precomputeNodes()
+ self:precomputeEdges()
+ self:animateNodeAppearing()
+ self:animateEdgeAppearing()
+ self:generateNodeMotions()
+ self:generateEdgeMotions()
+end
+
+function GraphAnimationCoordination:generateNodeMotions(node_types)
+ local supergraph = self.supergraph
+ local graph = self.digraph
+
+ for _, supervertex in ipairs(self.supergraph.vertices) do
+ local lj = -1
+ local last_v = nil
+ local last_time = nil
+ for j, s in ipairs(supergraph.snapshots) do
+ local vertex = supergraph:getSnapshotVertex(supervertex, s)
+
+ if lj == j-1 and vertex and last_v then
+ local mrt1 = last_v.options["minimum rest time"]/2
+ local mrt2 = vertex.options["minimum rest time"]/2
+
+ local s1 = Coordinate.new(0,0)
+ local e1 = Coordinate.new(vertex.pos.x-last_v.pos.x,-vertex.pos.y+last_v.pos.y)
+
+ local s2 = Coordinate.new(-vertex.pos.x+last_v.pos.x,vertex.pos.y-last_v.pos.y)
+ local e2 = Coordinate.new(0,0)
+
+ local t_end = s.timestamp - math.max(0, mrt2)
+ local t_start = last_time + math.max(0,mrt1)
+
+ local representative = self.visible_objects[supervertex][s]
+ if representative == vertex then
+ append_move_animation(vertex, s2, e2, t_start, t_end)
+ append_move_animation(last_v, s1, e1, t_start, t_end)
+ else
+ append_move_animation(representative,s1,e1,t_start,t_end)
+ end
+ end
+ last_time = s.timestamp
+ lj = j
+ last_v = vertex
+ end
+ end
+end
+
+
+
+
+
+function GraphAnimationCoordination:generateEdgeMotions()
+ local supergraph = self.supergraph
+ local graph = self.digraph
+
+ for i, arc in ipairs(supergraph.arcs) do
+ local head = arc.head
+ local tail = arc.tail
+
+ local last_arc = nil
+ local last_time = nil
+ local last_v = nil
+ local last_w = nil
+
+ for j, s in ipairs(supergraph.snapshots) do
+ local v = supergraph:getSnapshotVertex(tail,s)
+ local w = supergraph:getSnapshotVertex(head,s)
+
+ if v and w then
+ local this_arc = graph:arc(v,w) --or graph:arc(w,v)
+ if this_arc then
+ if this_arc and last_arc then
+ local mrt1 = last_v.options["minimum rest time"]/2
+ local mrt2 = v.options["minimum rest time"]/2
+
+ local s1 = Coordinate.new(0,0)--lv.pos
+ local e1 = Coordinate.new(v.pos.x-last_v.pos.x,-v.pos.y+last_v.pos.y)
+
+ local s2 = Coordinate.new(-v.pos.x+last_v.pos.x,v.pos.y-last_v.pos.y)
+ local e2 = Coordinate.new(0,0)
+
+ local t_end = s.timestamp - math.max(0,mrt2)
+ local t_start = last_time + math.max(0,mrt1)
+
+ local representative = self.visible_objects[arc][s]
+ if representative == this_arc then
+ append_move_animation(last_arc, s1, e1, t_start,t_end)
+ append_move_animation(this_arc, s2, e2, t_start,t_end)
+ else
+ append_move_animation(representative,s1,e1,t_start,t_end)
+ end
+ this_arc = representative
+ end
+ last_arc = this_arc
+ last_v = v
+ last_time = s.timestamp
+ else
+ last_arc = nil
+ end
+ else
+ last_arc = nil
+ end
+ end
+ end
+end
+
+--
+--
+-- @field t_transition The mid time between two snapshot times.
+-- @field fade_duration The duration of the fade animation
+-- @field overlapping A boolean defining if the animation occurs
+-- beofre and after the mid time (true) or if it
+-- starts/end only in one interval (false)
+-- @field closing A boolean specifieng if this is a outfading time
+local function compute_fade_times(t_transition, fade_duration, overlapping, closing)
+
+ if overlapping then
+ t_start = t_transition - fade_duration / 2
+ t_end = t_transition + fade_duration / 2
+ else
+ if closing then
+ t_start = t_transition - fade_duration
+ t_end = t_transition
+ else
+ t_start = t_transition
+ t_end = t_transition + fade_duration
+ end
+ end
+ return {t_start = t_start, t_end = t_end}
+end
+
+function GraphAnimationCoordination:animateNodeAppearing()
+ local supergraph = self.supergraph
+ for i,vertex in ipairs(self.ugraph.vertices) do
+ local snapshot = supergraph:getSnapshot(vertex)
+ local interval = snapshot.interval
+ local supernode = supergraph:getSupervertex(vertex)
+ local representative = self.visible_objects[supernode][snapshot]
+ local overlapping_in = true -- init true for crossfading
+ local overlapping_out= true
+ local minimum_rest_time = math.max(0,vertex.options["minimum rest time"])
+ local allow_overlapping = vertex.options["overlapping transition"]
+ local fadein_duration = 0.01
+ local fadeout_duration = 0.01
+
+ if self.is_first[vertex] then
+ fadein_duration = self.ugraph.options["fadein time"]
+ overlapping_in = false or allow_overlapping
+ end
+ if self.is_last[vertex] then
+ fadeout_duration = self.ugraph.options["fadeout time"]
+ overlapping_out = false or allow_overlapping
+ end
+
+ if fadein_duration == math.huge or fadein_duration<0 then
+ fadein_duration = (interval.to-interval.from-minimum_rest_time)/2
+ if overlapping then fadein_duration = fadein_duration * 2 end
+ end
+ if fadeout_duration == math.huge or fadeout_duration<0 then
+ fadeout_duration = (interval.to-interval.from-minimum_rest_time)/2
+ if overlapping then fadeout_duration = fadeout_duration*2 end
+ end
+
+ local fin = compute_fade_times(interval.from, fadein_duration, overlapping_in, false)
+ local fout = compute_fade_times(interval.to, fadeout_duration, overlapping_out, true)
+
+ vertex.animations = vertex.animations or {}
+
+ if representative~= vertex then
+ table.insert(vertex.animations,{
+ attribute = "stage",
+ entries = { { t = 0, value = "false"}, },
+ options = {}
+ })
+ end
+
+ if interval.from > -math.huge and (vertex == representative or self.is_first[vertex]) then
+ -- only appears if the snapshot node is its own repr. or if in the prev snapshot is
+ -- no representative.
+ append_fade_animation(representative, 0, 1, fin.t_start, fin.t_end)
+ end
+ if interval.to < math.huge and (self.is_last[vertex] or self.last_rep[vertex]) then
+ -- The snapshot node only disappears when the node is not visible
+ -- in the next or (this=)last snapshot:
+ append_fade_animation(representative, 1, 0, fout.t_start, fout.t_end)
+ end
+ end
+end
+
+
+
+function GraphAnimationCoordination:animateEdgeAppearing()
+ local supergraph = self.supergraph
+ local graph = self.digraph
+ for _,edge in ipairs(graph.arcs) do
+ local snapshot = supergraph:getSnapshot(edge.head)
+ local int = snapshot.interval
+ local superarc = supergraph:getSuperarc(edge)
+ local representative = self.visible_objects[superarc][snapshot] or edge
+
+ local minimum_rest_time = math.max(0,edge.head.options["minimum rest time"]/2,
+ edge.tail.options["minimum rest time"]/2)
+
+ local appears = math.max(int.from, int.from)
+ local disappears = math.min(int.to, int.to)
+
+ local overlapping_in = true -- init true for crossfading
+ local overlapping_out= true
+ local fadein_duration = 0.01
+ local fadeout_duration = 0.01
+ local allow_overlapping = (edge.tail.options["overlapping transition"] and edge.head.options["overlapping transition"])
+
+ if self.is_first[edge] and not self.move_on_enter[edge] and not self.move_on_enter[edge.head] then
+ fadein_duration = self.ugraph.options["fadein time"]
+ overlapping_in = false or allow_overlapping
+ end
+
+ if self.is_last[edge] and not self.move_on_leave[edge] then
+ fadeout_duration = self.ugraph.options["fadeout time"]
+ overlapping_out = false or allow_overlapping
+ end
+
+
+ if self.is_first[edge]
+ and (self.move_on_enter[edge.head]
+ or self.move_on_enter[edge.tail] )
+ then
+ appears = snapshot.timestamp - minimum_rest_time
+ end
+ if self.is_last[edge] and
+ (self.move_on_leave[edge.head]
+ or self.move_on_leave[edge.tail]
+ ) then
+ disappears = snapshot.timestamp + minimum_rest_time
+ end
+
+ local fin = compute_fade_times(appears, fadein_duration, overlapping_in,false)
+ local fout = compute_fade_times(disappears,fadeout_duration,overlapping_out,true)
+
+ edge.animations = edge.animations or {}
+
+ if representative~=edge then
+ table.insert(edge.animations,{
+ attribute = "stage",
+ entries = { { t = 0, value = "false"}, },
+ options = {}})
+ end
+
+ -- Fade in:
+ if appears > -math.huge and (edge == representative or self.is_first[edge]) then
+ append_fade_animation(representative, 0, 1, fin.t_start, fin.t_end )
+ end
+
+ -- Fade out:
+ if disappears < math.huge and (self.is_last[edge] or self.last_rep[edge])then
+ append_fade_animation(representative, 1, 0, fout.t_start,fout.t_end )
+ end
+
+ end
+
+end
+
+function GraphAnimationCoordination:precomputeNodes()
+ local supergraph = self.supergraph
+
+ for _, supernode in ipairs(supergraph.vertices) do
+
+ local vis_nodes = {}
+ self.visible_objects[supernode] = vis_nodes
+
+ local any_previous_node = nil
+ local previous_representant = nil
+ local node_before = nil
+
+ for i, s in ipairs(supergraph.snapshots) do
+ local node = supergraph:getSnapshotVertex(supernode, s)
+
+ if node then
+ -- assume the node is the last node
+ self.is_last[node] = true
+
+ if node.options["modified"] then
+ -- modified
+ vis_nodes[s] = node
+ previous_representant = node
+ if any_previous_node then
+ self.last_rep[any_previous_node] = true
+ end
+ else
+ -- unmodified
+ previous_representant = previous_representant or node
+ vis_nodes[s] = previous_representant
+ end
+ any_previous_node = node
+
+ if node_before then
+ self.is_last[node_before] = false
+ self.previous_node[node] = node_before
+ self.next_node[node_before] = node
+
+ local do_move = (( node.pos.x ~= node_before.pos.x )
+ or (node.pos.y ~= node_before.pos.y))
+ self.move_on_enter[node] = do_move
+ self.move_on_leave[node_before] = do_move
+ else
+ self.is_first[node] = true
+ end
+ node_before = node
+ else
+ node_before = nil
+ end
+ end
+ end
+end
+
+function GraphAnimationCoordination:precomputeEdges()
+ -- 1. classify arcs (appearing, disappearing)
+ for _, arc in ipairs(self.digraph.arcs) do
+ local head = arc.head
+ local tail = arc.tail
+ if not ( self.is_first[head] or self.is_first[tail]) then
+ if not self.digraph:arc(self.previous_node[tail], self.previous_node[head]) then
+ -- new arc connects existing nodes
+ self.is_first[arc] = true
+ end
+ else
+ -- arc and at least one node is new.
+ self.is_first[arc] = true
+ end
+ if not ( self.is_last[head] or self.is_last[tail]) then
+ if not self.digraph:arc(self.next_node[tail],self.next_node[head]) then
+ -- arc disappears while nodes are still in the next snapshot
+ self.is_last[arc] = true
+ end
+ else
+ -- arc and at least one node disappears in the next snapshot
+ self.is_last[arc] = true
+ end
+ self.move_on_enter[arc] = self.move_on_enter[head] or self.move_on_enter[tail]
+ self.move_on_leave[arc] = self.move_on_leave[head] or self.move_on_leave[tail]
+ end
+
+ -- 2. precompute the unmodified edges
+ local supergraph = self.supergraph
+
+ for _, superarc in ipairs(supergraph.arcs) do
+ local vis_objects = {}
+ self.visible_objects[superarc] = vis_objects
+
+ local previous_arc
+ local previous_representant
+
+ for _, s in ipairs(supergraph.arc_snapshots[superarc]) do
+ local head = supergraph:getSnapshotVertex(superarc.head, s)
+ local tail = supergraph:getSnapshotVertex(superarc.tail, s)
+ -- use the digraph because the snapshot arc is not syncted
+ local arc = self.digraph:arc(tail, head)
+
+ local modified = false
+ local opt_array = arc:optionsArray('modified')
+ for i = 1,#opt_array.aligned do
+ modified = modified or opt_array[i]
+ end
+
+ if modified or
+ not eq_arc(arc, previous_arc) or self.is_first[arc] then
+ --modified
+ previous_representant = arc
+ vis_objects[s] = arc
+ if previous_arc then
+ self.last_rep[previous_arc] = true
+ end
+ else
+ -- unmodified
+ previous_representant = previous_representant or arc
+ vis_objects[s] = previous_representant
+ end
+ previous_arc = arc
+ end
+ end
+end
+-- Done
+
+return GraphAnimationCoordination
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GreedyTemporalCycleRemoval.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GreedyTemporalCycleRemoval.lua
new file mode 100644
index 00000000000..17c46aa352c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/GreedyTemporalCycleRemoval.lua
@@ -0,0 +1,177 @@
+-- Copyright 2015 by Malte Skambath
+--
+-- This file may be distributed an/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 information
+
+
+local GreedyTemporalCycleRemoval = {}
+
+-- Imports
+local lib = require "pgf.gd.lib"
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+
+local Vertex = require "pgf.gd.model.Vertex"
+local Digraph = require "pgf.gd.model.Digraph"
+local Coordinate = require "pgf.gd.model.Coordinate"
+
+local PriorityQueue = require "pgf.gd.lib.PriorityQueue"
+
+-- Keys
+
+---
+
+declare {
+ key = "split critical arc head",
+ type = "boolean",
+ initial = true,
+ summary = "Specifies, that for a critical the tail node is separated"
+}
+
+---
+
+declare {
+ key = "split critical arc tail",
+ type = "boolean",
+ initial = true,
+ summary = "Specifies, that for a critical the tail node is separated"
+}
+
+---
+
+declare {
+ key = "greedy temporal cycle removal",
+ algorithm = GreedyTemporalCycleRemoval,
+ phase = "temporal cycle removal",
+ phase_default = true,
+ summary = [["
+ A temporal dependency cycle is a cyclic path in the supergraph of
+ an evolving graph. Use this key if you want remove all temporal
+ dependency cycles by a greedy strategy which incrementally inserts
+ edge checks if this edge creates a cycle and splits at least one node
+ into two supernode at a given time.
+ "]],
+ documentation = [["
+ See ToDo
+ "]]
+}
+
+-- Helpfunctions
+local function reachable(graph, v, w)
+ local visited = {}
+ local queue = PriorityQueue.new()
+ queue:enqueue(v,1)
+ while not queue:isEmpty() do
+ local vertex = queue:dequeue()
+ if vertex==w then
+ return true
+ end
+ local outgoings = graph:outgoing(vertex)
+ for _, e in ipairs(outgoings) do
+ local head = e.head
+ if not visited[head] then
+ visited[head] = true
+ if head == w then
+ return true
+ else
+ queue:enqueue(head,1)
+ end
+ end
+ end
+ end
+ return false
+end
+
+-- Implementation
+
+function GreedyTemporalCycleRemoval:run()
+ local supergraph = assert(self.supergraph, "no supergraph passed")
+ local digraph = assert(self.digraph, "no digraph passed to the phase")
+ local split_tail = digraph.options["split critical arc tail"]
+ local split_head = digraph.options["split critical arc head"]
+ assert(split_tail or split_head, "without splitting nodes dependency cycles cannot be removed.")
+
+ self:iterativeCycleRemoval(supergraph, split_tail, split_head)
+end
+
+--
+-- Resolves all dependencies by splitting supernodes into multiple supernodes.
+-- To resolve a cycle each edge will be inserted into a dependency graph
+-- successively. Each time such edge closes a cycle the head and tail will
+-- be splitet at the related snapshot.
+--
+-- @param supergraph
+--
+function GreedyTemporalCycleRemoval:iterativeCycleRemoval(supergraph, split_tail, split_head)
+ -- Build up the global dependency graph
+ -- A supernode v directly depends on another supernode w iff
+ -- there is a snapshot in which w is a child of w
+ local dependency_graph = Digraph.new(supergraph)
+ local stable_arcs = {}
+ for i, snapshot in ipairs(supergraph.snapshots) do
+ --local tree = snapshot.spanning_tree
+ for _,tree in ipairs(snapshot.spanning_trees) do
+ local new_arcs = {}
+
+ for _, e in ipairs(tree.arcs) do
+ if e.head.kind ~= "dummy" and e.tail.kind~="dummy" then
+ table.insert(new_arcs, e)
+
+ local sv = supergraph:getSupervertex(e.tail)
+ local sw = supergraph:getSupervertex(e.head)
+ local dep_arc = dependency_graph:arc(sv, sw)
+
+
+ if (not dep_arc) then
+ -- check if the edge v->w closes a cycle in the dependencygraph
+ --pgf.debug{dependency_graph}
+ local cycle_arc = reachable(dependency_graph, sw, sv)
+ dep_arc = dependency_graph:connect(sv,sw)
+-- texio.write("\ncheck ".. sv.name.."->" .. sw.name)
+ if cycle_arc then
+ if split_tail then
+ supergraph:splitSupervertex(sv, { [1]=snapshot })
+ end
+ if split_head then
+ supergraph:splitSupervertex(sw, { [1]=snapshot })
+ end
+
+ -- rebuild dependency graph
+ dependency_graph = Digraph.new(supergraph)
+
+ for _, arc in ipairs(stable_arcs) do
+ dependency_graph:connect(arc.tail, arc.head)
+ end
+
+ for _, arc in ipairs(new_arcs) do
+ local sv = supergraph:getSupervertex(arc.tail)
+ local sw = supergraph:getSupervertex(arc.head)
+ dependency_graph:connect(sv, sw)
+ end
+ end -- end of resovle cycle_arc
+ end
+ end
+ end
+ -- Stable Arcs:
+ for _, arc in ipairs(new_arcs) do
+
+ local sv = supergraph:getSupervertex(arc.tail)
+ local sw = supergraph:getSupervertex(arc.head)
+ local deparc = dependency_graph:arc(sv, sw)
+-- if not deparc or not stable_arcs[deparc] then
+-- stable_arcs[deparc] = true
+ table.insert(stable_arcs, deparc)
+-- end
+
+ end
+ end -- end for spanning_tree
+ end -- end for snapshot
+end
+
+
+-- Done
+
+return GreedyTemporalCycleRemoval
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Skambath2016.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Skambath2016.lua
new file mode 100644
index 00000000000..23bbdf36a8c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Skambath2016.lua
@@ -0,0 +1,875 @@
+-- Copyright 2015 by Malte Skambath
+--
+-- This file may be distributed an/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 information
+--
+
+-- Imports
+require "pgf.gd.trees.ChildSpec"
+
+local Digraph = require "pgf.gd.model.Digraph"
+local Vertex = require "pgf.gd.model.Vertex"
+
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+local layered = require "pgf.gd.layered"
+local tlayered = require "pgf.gd.experimental.evolving.layered"
+local SpanningTreeComputation = require "pgf.gd.trees.SpanningTreeComputation"
+local lib = require "pgf.gd.lib"
+
+local Storage = require "pgf.gd.lib.Storage"
+local PriorityQueue = require "pgf.gd.lib.PriorityQueue"
+
+local Supergraph = require "pgf.gd.experimental.evolving.Supergraph"
+
+local LayoutPipeline = require "pgf.gd.control.LayoutPipeline"
+local Direct = require "pgf.gd.lib.Direct"
+
+--
+--
+local Skambath2016 = {}
+
+
+---
+declare {
+ key = "animated tree layout",
+ algorithm = Skambath2016,
+ postconditions = {
+ upward_oriented = true
+ },
+ documentation_in = "pgf.gd.evolving.doc"
+}
+
+---
+declare {
+ key = "animated binary tree layout",
+ use = {
+ { key = "animated tree layout" },
+ { key = "minimum number of children", value = 2 },
+ { key = "significant sep", value = 0 },
+ },
+
+ documentation_in = "pgf.gd.evolving.doc"
+}
+
+---
+declare {
+ key = "extended animated binary tree layout",
+ use = {
+ { key = "animated tree layout" },
+ { key = "minimum number of children", value=2 },
+ { key = "missing nodes get space" },
+ { key = "significant sep", value = 0 }
+ },
+ documentation_in = "pgf.gd.evolving.doc"
+}
+
+
+
+
+
+-- Helpfunctions
+
+---
+-- Borders models the borderlines / the line of border vertices
+-- of a tree or subtree structure which can change over time.
+-- Each ordered and rooted tree or subtree has vertices per layer for which they
+-- are on the outer places. On the left or respectivly on the right.
+-- The field |left| and |right| stores the both borderlines.
+-- A \emph{borderline} is an array. This array contains for each layer of the tree
+-- a table mapping a given snapshot to the related border-vertex of the layer
+-- in the snapshot.
+--
+-- @field left
+-- @field right
+--
+local Borders = {}
+Borders.__index = Borders
+
+
+-- Namespace
+
+--require("pgf.gd.experimental.evolving").Borders = Borders
+
+
+--- Create a new tree border description.
+--
+--
+function Borders.new()
+ return setmetatable( {left = {}, right = {}}, Borders )
+end
+
+function Borders:addBoth(layer, snapshot, vertex)
+ local lleft = self.left[layer] or {}
+ local lright = self.right[layer] or {}
+ assert(not lleft[snapshot] and not lright[snapshot], "borders already defined for given layer and snapshot")
+ lleft[snapshot] = vertex
+ lright[snapshot] = vertex
+ self.left[layer] = lleft
+ self.right[layer] = lright
+end
+
+function Borders:appendBelow(level, borders)
+ assert(borders, "invalid argument for borders. Value must not be 'nil'.")
+ assert((#self.left == #self.right) and (#self.left == level), "cannot be appended")
+ local new_level = borders:getLevel()
+ for i = 1, new_level do
+ self.left[i + level] = borders.left[i]
+ self.right[i + level] = borders.right[i]
+ end
+end
+
+---
+--
+-- @return the number of levels in which bordervertices exists.
+function Borders:getLevel()
+ assert(#self.left == #self.right, "different levels")
+ return #self.left
+end
+
+function Borders.copyBordersAtSnapshot(source, target, snapshot)
+ local source_level = source:getLevel()
+ for i = 1, source_level do
+ level_border_left = target.left[i] or {}
+ level_border_right = target.right[i] or {}
+ assert(not level_border_left[snapshot] and not level_border_right[snapshot],
+ "border for a given snapshat already defined")
+ level_border_left[snapshot] = source.left[i][snapshot]
+ level_border_right[snapshot] = source.right[i][snapshot]
+ target.left[i] = level_border_left
+ target.right[i] = level_border_right
+ end
+end
+
+--
+-- Adapt existing borders with the borders of a group which will be
+-- placed on the right next to the existing borders. For each level
+-- and time in which the group has a border the borders on the right
+-- will be replaced with this border. If it is not existing in the old
+-- borders then also the left border will be adapted
+--
+-- @param borders The existing borders. These will be modified with
+-- the borders of
+--
+-- @param group_borders The borders of the group
+--
+-- @param snapshots All snapshots in which checking for distances is necessary.
+--
+local function adapt_borders(borders, group_borders, snapshots, ignore_dummies)
+ for level = 1, group_borders:getLevel() do
+ local l = borders.left[level] or {}
+ local r = borders.right[level] or {}
+ for _, s in pairs(snapshots) do
+ if ignore_dummies then
+ local gls,grs = group_borders.left[level][s], group_borders.right[level][s]
+ if gls~=nil then
+ if gls.kind~="dummy" then
+ l[s] = l[s] or gls
+ end
+ end
+ if grs~=nil then
+ if grs.kind~="dummy" then
+ r[s] = grs or r[s]
+ end
+ end
+ else
+ l[s] = l[s] or group_borders.left[level][s]
+ r[s] = group_borders.right[level][s] or r[s]
+ end
+
+ end
+ borders.left[level] = l
+ borders.right[level] = r
+ end
+
+end
+
+--
+-- Shift all vertices of a group and their descendants
+-- for a certain length into horizontal direction.
+--
+-- @param shift the length all involved vertices
+-- should be shifted in horizontal direction
+--
+--
+-- @param group A group of the spanning trees that should be shifted.
+-- A group entry has to map snapshots to root nodes
+--
+-- @param snapshots An array of at least all snapshots in which the group
+-- has a vertex
+--
+-- @param descendants A table or Storage storing the list of descendants
+-- for each vertex
+--
+-- @return the highest x-coordinate of vertices in the group after the shift.
+-- If there is no vertex which was shifted then -math.huge
+-- will be returned
+--
+local function shift_group(shift, group, snapshots, descendants)
+ assert(group,"no group passed")
+ assert(shift~=math.huge and shift ~=-math.huge,
+ "shift must be a valid finit length")
+ local shifted = {} -- remember which vertex was shifted during this run
+ local anchor = -math.huge
+ for _, s in ipairs(snapshots) do
+ local v = group[s]
+ if not shifted[v] and v then
+ v.pos.x = v.pos.x + shift
+ shifted[v] = true
+
+ -- also shift all descendants of the group vertex
+ for _, d in ipairs(descendants[v]) do
+ if not shifted[d] then
+ d.pos.x = d.pos.x + shift
+ shifted[d] = true
+ end
+ end
+ anchor = math.max(anchor, v.pos.x )
+ end
+ end
+ return anchor
+end
+
+--
+-- Traverse through the spanneng tree |tree| of a snapshot and sort
+-- the child nodes into groups. A group summarises for a given parent
+-- node all children node over time that are at the same child
+-- position. The k-th child group groups[i] maps each snapshot to the
+-- k-th node in the related snapshot.
+--
+--
+-- @field supergraph the supergraph
+--
+-- @field tree the tree or spanning tree to decide the indices of the
+-- child nodes
+--
+-- @field childgroups a Storage which contains the list of childgroups
+-- for each supernode
+--
+-- @field snapshot
+--
+local function precompute_childgroups(supergraph, tree, node, childgroups, snapshot)
+ local outgoings = tree:outgoing(node)
+ if #outgoings > 0 then
+ local supervertex = supergraph:getSupervertex(node)
+ local groups = childgroups[supervertex] or {}
+ for i, e in ipairs(outgoings) do
+
+ group = groups[i] or {}
+ assert(e.head, "no edge")
+ group[snapshot] = e.head
+ groups[i] = group
+ precompute_childgroups(supergraph, tree, e.head, childgroups, snapshot)
+ end
+ assert(supervertex, "no mv")
+ childgroups[supervertex] = groups
+ end
+end
+
+--
+-- Use this function to compute the horizontal positions of all
+-- vertices in a tree by accumulation of the relative shifts on the
+-- path from the root to the vertex recursively.
+--
+-- @param tree the tree in which the vertice's position should be
+-- computed.
+--
+-- @param vertex the next vertex that gets its absolute coordinate.
+--
+-- @param shifts a Storage, which stores for each node the relative
+-- shift between the vertex and its parent.
+--
+-- @param abs_shift the sum of all relative shifts on the path from
+-- the root to the vertex.
+--
+local function accumulate_hpos(tree, vertex, shifts, abs_shift)
+ local new_shift = abs_shift + shifts[vertex]
+ local test = vertex.pos.x
+ vertex.pos.x = new_shift
+-- if vertex.pos.x - test > 0.0001 then texio.write("X")end
+ local outgoings = tree:outgoing(vertex)
+ for _, e in ipairs(outgoings) do
+ accumulate_hpos(tree, e.head, shifts, new_shift)
+ end
+end
+
+
+local function get_next(border_pair, next)
+ local nl = next.left[border_pair.left]
+ local nr = next.right[border_pair.right]
+ assert ((nl and nr) or (not nl and not nr))
+ return {left = nl, right = nr,
+ }
+end
+
+local function add_shift(abs_shift, border_pair, next)
+ abs_shift.left = abs_shift.left + next.left_shift[border_pair.left]
+ abs_shift.right = abs_shift.right + next.right_shift[border_pair.right]
+end
+
+--
+-- Given a tree, computes the required distance between the i-th and the (i+1)-th subtree
+-- of the vertex |snapshot_vertex|.
+--
+-- @param shifts a Storage, which contains for each vertex the relative horizontal shift
+-- to its parent vertex.
+--
+function Skambath2016:computeRequiredDistance(tree, vertex, i, shifts, next)
+ local outgoings = tree:outgoing(vertex)
+-- texio.write("\n::"..vertex.name.. " "..i.."|"..(i+1))
+ if #outgoings > 0 then
+ local clumb = {left = outgoings[1].head,right = outgoings[i].head}
+ if clumb.right.kind=="dummy" then shifts[clumb.right] = 0 end
+ local v0 = outgoings[i].head
+ local v1 = outgoings[i+1].head
+ local shift = layered.ideal_sibling_distance(self.adjusted_bb, self.ugraph, v0, v1) + shifts[clumb.right]
+ local last0 = {left = clumb.left, right = clumb.right}
+ local last1 = {left = v1, right = v1}
+ local next0 = get_next(last0, next)
+ local next1 = get_next(last1, next)
+ local abs_shift0 = {left = shifts[clumb.left], right = shifts[clumb.right]}
+ local abs_shift1 = {left = 0, right = 0}
+
+ while (next0.left and next1.left) do
+ add_shift(abs_shift0, last0, next)
+ add_shift(abs_shift1, last1, next)
+
+ shift = math.max(shift,
+ layered.ideal_sibling_distance(self.adjusted_bb,
+ self.ugraph,
+ next0.right,
+ next1.left)
+ + abs_shift0.right - abs_shift1.left)
+-- texio.write("\n | "..(next0.right.name or "dummy").."<->"..(next1.left.name or "dummy").." :\t"..shift)
+ last0, last1 = next0, next1
+ next0 = get_next(next0, next)
+ next1 = get_next(next1, next)
+ end
+ return shift, {l0 = last0, l1 = last1, n0 = next0, n1 = next1,abs_shift1 = abs_shift1,abs_shift0=abs_shift0}
+ -- end
+ else
+ return 0
+ end
+end
+
+local function apply_shift(tree, vertex, i, shifts, next, border_ptr, shift)
+ local outgoings = tree:outgoing(vertex)
+-- texio.write("\n" .. (vertex.name or "dummy")..": ".. shift )
+ if #outgoings >= (i+1) then
+ assert(border_ptr, "unexpected error")
+ local last0 = border_ptr.l0
+ local last1 = border_ptr.l1
+ local next0 = border_ptr.n0
+ local next1 = border_ptr.n1
+ local abs0 = border_ptr.abs_shift0
+ local abs1 = border_ptr.abs_shift1
+ local vbase = outgoings[1].head -- before centering the 1st vertex is at x=0
+ local v0 = outgoings[i].head
+ local v1 = outgoings[i+1].head
+ if v0.kind=="dummy" then shifts[v0] = 0 end
+ shifts[v1] = shifts[vbase] + shift
+ if next0.left then
+ assert(next0.right and next0.left, "failA")
+ -- pointer from T_i to T_{i+0}
+ next.right[last1.right] = next0.right
+ next.right_shift[last1.right] = - shift - abs1.right + (abs0.right + next.right_shift[last0.right])
+ elseif next1.right then
+ assert(next1.right and next1.left, "")
+ -- pointer from T_{i+0} to T_i
+ -- texio.write(last0.left .." -> " ..next1.left)
+ next.left[last0.left] = next1.left
+-- pgf.debug{last0,abs0,abs1,last1}
+ next.left_shift[last0.left] = shift - abs0.left + (abs1.left + next.left_shift[last1.left] )
+
+ else
+ -- both trees have the same height
+ end
+ end
+end
+
+-- Implementation
+
+function Skambath2016:run()
+ local layers = Storage.new()
+ local descendants = Storage.new()
+ local childgroups = Storage.new()
+
+ local phases = self.digraph.options.algorithm_phases
+
+ local so_class = phases['supergraph optimization']
+ local ga_class = phases['evolving graph animation']
+ local cr_class = phases['temporal cycle removal']
+
+ self.extended_version = self.digraph.options['missing nodes get space']
+ self.supergraph = Supergraph.generateSupergraph(self.digraph)
+ local supergraph_original = Supergraph.generateSupergraph(self.digraph)
+
+ -- optimize graph by splitting nodes by trivial criteria
+ so_class.new {
+ main_algorithm = self,
+ supergraph = self.supergraph,
+ digraph = self.digraph,
+ ugraph = self.ugraph
+ }:run()
+
+
+ self:precomputeSpanningTrees()
+
+ -- Resolve cyclic dependencies if exists.
+ cr_class.new {
+ main_algorithm = self,
+ supergraph = self.supergraph,
+ digraph = self.digraph,
+ }:run()
+
+
+
+ self:precomputeDescendants(layers, descendants)
+ self:precomputeChildgroups(childgroups)
+
+ self:computeHorizontalLayout(childgroups, descendants)
+-- self:computeHorizontalLayoutFast()
+
+ -- vertical positions
+ tlayered.arrange_layers_by_baselines(layers,
+ self.adjusted_bb,
+ self.ugraph,
+ self.supergraph.snapshots,
+ self.supergraph.vertex_snapshots)
+
+ -- animate graph
+ ga_class.new {
+ main_algorithm = self,
+ supergraph = supergraph_original,
+ digraph = self.digraph,
+ ugraph = self.ugraph
+ }:run()
+end
+
+--
+-- Compute the required shift value for a second tree to garuantee
+-- a required node distance.
+-- @field right_borders The Border data structure for the right border of
+-- the left tree
+-- @field left_borders The Border data structure for the left border of
+-- the right tree
+-- @field selected_snapshots if you set this value with an array of snapshots
+-- only the predefined snapshots are used in the border
+-- computation.
+--
+function Skambath2016:computeMinShift(right_borders, left_borders, selected_snapshots)
+ local shift = -math.huge
+ local max_level = math.min(#right_borders, #left_borders)
+ local first_shift = 0
+ local snapshots = selected_snapshots or self.supergraph.snapshots
+
+ for layer = 1, max_level do
+ local rb, lb = right_borders[layer], left_borders[layer]
+ for _,s in ipairs(snapshots) do
+
+ local v1,v2 = rb[s],lb[s]
+ if v1 and v2 then
+ local local_shift = layered.ideal_sibling_distance(self.adjusted_bb, self.ugraph, v1, v2) + v1.pos.x - v2.pos.x
+ shift = math.max(shift, local_shift)
+ end
+ end
+ if layer == 1 then
+ first_shift = shift
+ end
+ end
+
+ local is_significant = false
+
+ if max_level > 1 and shift<=first_shift then
+ -- if the necessary shift of the subtrees
+ -- is the minimum required shift between two
+ -- nodes than a node is significant
+ is_significant = true
+ end
+
+ if shift <= -math.huge then
+ shift = 0
+ end
+
+ if is_significant then
+ shift = shift + self.ugraph.options['significant sep']
+ end
+
+ return shift
+end
+
+
+--
+-- The main algorithm: This method computes the layout for each vertex.
+-- For this all supervertices are visited in a topological order to their dependency.
+-- If a . This requires the supergraph to be acyclic. If this is not the case
+-- the calling process has to remove all cycles otherwise the x-coordinate will
+-- not be computed for every vertex.
+--
+function Skambath2016:computeHorizontalLayout(groups, descendants)
+ local subtree_borders = Storage.new()
+ local dep_counter = {}
+ local visited = {}
+ local queue = PriorityQueue.new()
+ local dependency_graph = Digraph.new()
+ for _, vertex in ipairs(self.supergraph.vertices) do
+ dep_counter[vertex] = 0
+ dependency_graph:add {vertex}
+ end
+
+ -- 1. Initialize Dependencies
+
+ for _, snapshot in ipairs(self.supergraph.snapshots) do
+ for _, spanning_tree in ipairs(snapshot.spanning_trees) do
+ for _, arc in ipairs(spanning_tree.arcs) do
+
+ local head = self.supergraph:getSupervertex(arc.head)
+ local tail = self.supergraph:getSupervertex(arc.tail)
+
+ if(head and tail) then
+ if not dependency_graph:arc(tail, head) then
+ dependency_graph:connect(tail, head)
+ dep_counter[tail] = dep_counter[tail] + 1
+ end
+ end
+ end
+ end
+ end
+
+ -- 2. Find independent vertices
+ for _, vertex in ipairs(dependency_graph.vertices) do
+ local outgoings = dependency_graph:outgoing(vertex)
+ if #outgoings == 0 then
+ queue:enqueue(vertex, 1)
+ end
+ end
+
+ -- 2.
+ while not queue:isEmpty() do
+ local vertex = queue:dequeue()
+ local vertex_snapshots = self.supergraph:getSnapshots(vertex)
+
+ -- a. Resolve dependencies on this vertex:
+ local incomings = dependency_graph:incoming(vertex)
+ for _, e in ipairs(incomings) do
+ dep_counter[e.tail] = dep_counter[e.tail] - 1
+ if dep_counter[e.tail] == 0 then
+ queue:enqueue(e.tail, 1)
+ end
+ end
+
+ -- b. Compute borders of this supervertex:
+ local vertex_borders = Borders.new()
+ for _, s in ipairs(vertex_snapshots) do
+ local snapshot_vertex = self.supergraph:getSnapshotVertex(vertex, s)
+ vertex_borders:addBoth(1, s, snapshot_vertex)
+ snapshot_vertex.pos.x = 0
+ snapshot_vertex.pos.y = 0
+ end
+
+ local vertex_groups = groups[vertex]
+ local last_pos_x = 0
+ if vertex_groups then
+ -- c. Compute borders of groups:
+ local all_group_borders = {}
+ for i, group in ipairs(vertex_groups) do
+ local group_boders = Borders.new()
+ for _,s in ipairs(vertex_snapshots) do
+ local child = group[s]
+ if child then
+ local child_borders
+ if not (child.kind == "dummy") then
+ local superchild = self.supergraph:getSupervertex(child)
+ child_borders = subtree_borders[superchild] or Borders.new()
+ else
+ child_borders = Borders.new()
+ child_borders:addBoth(1, s, child)
+ end
+ assert(child.pos~=math.huge, "invalid child pos")
+ shift_group(-child.pos.x,{[s]=child},{[1]=s}, descendants)
+ Borders.copyBordersAtSnapshot(child_borders, group_boders, s)
+ end
+ end
+ all_group_borders[i] = group_boders
+ end
+
+ -- d. Place groups and merge borders of groups:
+ local last_group = nil
+ last_pos_x = 0
+ local merged_borders = Borders.new()
+ local final_borders = Borders.new()
+ for i, group in ipairs(vertex_groups) do
+ local group_borders = all_group_borders[i]
+ if last_group_borders then
+ -- i. compute minimal shift
+
+ local shift
+ shift = self:computeMinShift(merged_borders.right, group_borders.left)
+
+
+ assert(shift ~= math.huge and shift~=-math.huge, "invalid shift")
+
+ -- ii. shift group
+ local anchor = shift_group(shift, group,vertex_snapshots, descendants)
+ last_pos_x = anchor
+ end
+ last_group_borders = group_borders
+
+ -- iii. adapt borders
+ adapt_borders(merged_borders,
+ group_borders,
+ self.supergraph.snapshots)
+ adapt_borders(final_borders,
+ group_borders,
+ self.supergraph.snapshots,
+ not self.extended_version)
+ end -- for (group)
+ vertex_borders:appendBelow(1, final_borders)
+ end
+ -- e. store borders:
+ assert(last_pos_x~=math.huge and last_pos_x~=-math.huge, "invalid position")
+ local x = ((last_pos_x) - 0)/2 + 0
+ assert(x~=math.huge and x~=-math.huge, "invalid position")
+ for _,s in ipairs(vertex_snapshots) do
+ local snapshot_vertex = self.supergraph:getSnapshotVertex(vertex, s)
+ snapshot_vertex.pos.x = x
+ end
+
+ subtree_borders[vertex] = vertex_borders
+ end
+
+ -- align roots
+ for _, s in ipairs(self.supergraph.snapshots) do
+ local lastroot
+ local rborder
+ for i, spanning_tree in ipairs(s.spanning_trees) do
+ local root = spanning_tree.root
+ local rootborders = subtree_borders[self.supergraph:getSupervertex(root)]
+ shift_group(-root.pos.x,{[s]=root},{[1]=s}, descendants)
+ if i>1 then
+ local l = subtree_borders[self.supergraph:getSupervertex(lastroot)]
+ local r = rootborders
+ shift = math.max(self:computeMinShift(l.right, r.left, {[1]=s}),
+ self:computeMinShift(rborder.right,r.left, {[1]=s}))
+ shift_group(shift,{[s]=root},{[1]=s}, descendants)
+ else
+ rborder = Borders.new()
+ end
+ adapt_borders(rborder,rootborders,self.supergraph.snapshots,false)
+ lastroot = root
+ end
+ end
+end
+
+--
+-- The main algorithm: This method computes the layout for each vertex.
+-- For this all supervertices are visited in a topological order to their dependency.
+-- If a . This requires the supergraph to be acyclic. If this is not the case
+-- the calling process has to remove all cycles otherwise the x-coordinate will
+-- not be computed for every vertex.
+--
+function Skambath2016:computeHorizontalLayoutFast()
+ local all_trees = Storage.new()
+ local dep_counter = {}
+ local visited = {}
+ local queue = PriorityQueue.new()
+ local dependency_graph = Digraph.new()
+ local shifts = Storage.new()
+ local next = Storage.new()
+ for _, vertex in ipairs(self.supergraph.vertices) do
+ dep_counter[vertex] = 0
+ dependency_graph:add {vertex}
+ end
+
+
+ -- I. Initialize Dependencies (Build Dependency Graph)
+ for _, snapshot in ipairs(self.supergraph.snapshots) do
+ for _, spanning_tree in ipairs(snapshot.spanning_trees) do
+ table.insert(all_trees, spanning_tree)
+ shifts[spanning_tree] = Storage.new()
+ next[spanning_tree] = {left= Storage.new(),
+ right= Storage.new(),
+ left_shift = Storage.new(),
+ right_shift = Storage.new()
+ }
+
+ for _, arc in ipairs(spanning_tree.arcs) do
+ local head = self.supergraph:getSupervertex(arc.head)
+ local tail = self.supergraph:getSupervertex(arc.tail)
+
+ if(head and tail) then
+ if not dependency_graph:arc(tail, head) then
+ dependency_graph:connect(tail, head)
+ dep_counter[tail] = dep_counter[tail] + 1
+ end
+ end
+ end
+ end
+ end
+
+ -- II. Visit vertices in topological ordering
+ -- Find independent vertices
+ for _, vertex in ipairs(dependency_graph.vertices) do
+ local outgoings = dependency_graph:outgoing(vertex)
+ if #outgoings == 0 then
+ queue:enqueue(vertex, 1)
+ end
+ end
+
+ while not queue:isEmpty() do
+ -- Next node in topological order
+ local vertex = queue:dequeue()
+-- texio.write("\n\n --- "..vertex.name .. " ---")
+ --pgf.debug{next}
+ local vertex_snapshots = self.supergraph:getSnapshots(vertex)
+
+ -- a. Resolve dependencies on this vertex:
+ local incomings = dependency_graph:incoming(vertex)
+ for _, e in ipairs(incomings) do
+ dep_counter[e.tail] = dep_counter[e.tail] - 1
+ if dep_counter[e.tail] == 0 then
+ queue:enqueue(e.tail, 1)
+ end
+ end
+
+ -- b. Compute maximum number of children over time:
+ local num_children = 0
+ for _, s in ipairs(vertex_snapshots) do
+ local v = self.supergraph:getSnapshotVertex(vertex, s)
+ local tree = s.spanning_trees[1]
+ num_children = math.max(num_children, #(tree:outgoing(v)))
+ shifts[tree][v] = 0
+ end
+
+ -- c. Shift all subtrees in all snapshots:
+ local hlp_ptr = Storage.new()
+ local max_shift = 0
+ for i = 1, (num_children - 1) do
+ -- i) Compute the necessary shift between the i-th and (i+1)-th subtrees (per snapshot):
+ local min_shift = 0
+ for t, s in ipairs(vertex_snapshots) do
+ local snapshot_vertex = self.supergraph:getSnapshotVertex(vertex, s)
+ local tree = s.spanning_trees[1]
+ local req_shift, hptr
+ req_shift, hptr = self:computeRequiredDistance(tree,
+ snapshot_vertex,
+ i,
+ shifts[tree],
+ next[tree]
+ )
+ hlp_ptr[t] = hptr
+-- texio.write(" -> \t"..req_shift)
+ min_shift = math.max(min_shift, req_shift)
+ end
+
+-- texio.write("\n \t\t".. min_shift )
+
+ -- ii) Synchronize distance between neigbored subtrees and apply shifts
+ for t, s in ipairs(vertex_snapshots) do
+ local snapshot_vertex = self.supergraph:getSnapshotVertex(vertex, s)
+ local tree = s.spanning_trees[1]
+ apply_shift(tree, snapshot_vertex, i, shifts[tree], next[tree], hlp_ptr[t], min_shift)
+ end
+
+ max_shift = min_shift
+ end
+
+ for t, s in ipairs(vertex_snapshots) do
+ local snapshot_vertex = self.supergraph:getSnapshotVertex(vertex, s)
+ local tree = s.spanning_trees[1]
+ local outgoings = tree:outgoing(snapshot_vertex)
+
+-- next[tree].left[snapshot_vertex] = outgoings[1].head
+
+
+ for i = 1,#outgoings do
+ if i==1 then
+ next[tree].left_shift[snapshot_vertex] = - max_shift / 2
+ next[tree].left[snapshot_vertex]= outgoings[i].head
+ end
+ shifts[tree][outgoings[i].head] = shifts[tree][outgoings[i].head] - max_shift / 2
+ next[tree].right[snapshot_vertex] = outgoings[i].head
+ next[tree].right_shift[snapshot_vertex] = shifts[tree][outgoings[i].head]
+ end
+
+ end
+
+ end -- end while (all vertices have been processed)
+
+ -- III. Accumulate absolute horizontal coordinates
+ for _, tree in ipairs(all_trees) do
+ accumulate_hpos(tree, tree.root, shifts[tree], 0)
+ end
+end
+
+
+
+
+function Skambath2016:precomputeTreeDescendants(tree, node, depth, layers, descendants)
+ local my_descendants = { node }
+
+ for _,arc in ipairs(tree:outgoing(node)) do
+ local head = arc.head
+ self:precomputeTreeDescendants(tree, head, depth+1, layers, descendants)
+ for _,d in ipairs(descendants[head]) do
+ my_descendants[#my_descendants + 1] = d
+ end
+ end
+ layers[node] = depth
+ descendants[node] = my_descendants
+end
+
+function Skambath2016:precomputeDescendants(layers, descendants)
+ for _,snapshot in ipairs(self.supergraph.snapshots) do
+ for _, spanning_tree in ipairs(snapshot.spanning_trees) do
+ self:precomputeTreeDescendants(spanning_tree, spanning_tree.root, 1, layers, descendants)
+ end
+ end
+end
+
+
+--
+--
+--
+function Skambath2016:precomputeChildgroups(childgroups)
+ for _,s in ipairs(self.supergraph.snapshots) do
+ for _,spanning_tree in ipairs(s.spanning_trees) do
+ precompute_childgroups(self.supergraph, spanning_tree, spanning_tree.root, childgroups, s)
+ end
+ end
+end
+
+--
+-- Compute a for each connected component of each
+-- snapshot and appends the result for a snapshot s to
+-- the array s.spanning_trees.
+--
+function Skambath2016:precomputeSpanningTrees()
+ local events = assert(self.scope.events,
+ "no events found for the spanning tree computation")
+
+ for i, s in ipairs(self.supergraph.snapshots) do
+ -- The involved snapshot graph:
+ local s_copy = Digraph.new(s)
+ for _,a in ipairs(s.arcs) do
+ local new_a = s_copy:connect(a.tail,a.head)
+ new_a.syntactic_edges = a.syntactic_edges
+ end
+ s.spanning_trees = s.spanning_trees or {}
+ -- Step 1: Decompose the snapshot into its connected components
+ local syntactic_components = LayoutPipeline.decompose(s_copy)
+ for i, syntactic_component in ipairs (syntactic_components) do
+ local tree = SpanningTreeComputation.computeSpanningTree(syntactic_component, true, events)
+ s.spanning_trees[i] = tree
+ end
+ end
+end
+
+return Skambath2016
+
+
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Supergraph.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Supergraph.lua
new file mode 100644
index 00000000000..490b8b3191d
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/Supergraph.lua
@@ -0,0 +1,570 @@
+-- Copyright 2015 by Malte Skambath
+--
+-- This file may be distributed an/or modified
+--
+-- 1. under the LaTeX Project Public License and/or
+-- 2. under the GNU Public License
+--
+
+-- Imports
+local lib = require "pgf.gd.lib"
+
+local Vertex = require "pgf.gd.model.Vertex"
+local Digraph = require "pgf.gd.model.Digraph"
+local Storage = require "pgf.gd.lib.Storage"
+
+
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+
+---
+-- Each |Supergraph| instance is a |Digraph| instance which represents
+-- the graph by union operation on all graphs G_i of an evolving graph
+-- $G=(G_1, G_2, \dots, G_n)$. Additional to that all references to
+-- the snapshot-graphs are shared such that is possible to get access
+-- to all vertices for each snapshot graph in a sequence. A vertex of
+-- an evolving graph may exists at different times, thus in in
+-- different snapshots. Each vertex will be a vertex in the supergraph
+-- and if there is a single snapshot in which two vertices are
+-- connected by an edge they are connected in the supergraph.
+--
+-- Note that in TikZ a \emph{node} is more than a single dot. A node
+-- has a content and different properties like background-color or a
+-- shape. Formally this can be modelled by function mapping vertices
+-- to their properties. For evolving graphs this could be done in the
+-- same way. As this is difficult to be realised in PGF because there
+-- is no basic support for time dependend properties on nodes, each
+-- vertex will be displayed over time by different single
+-- (snapshot-)nodes which can have different visual properties. This
+-- means for a vertex which we call |supervertex| in the following we
+-- will have a (snapshot-)node for each time stamp.
+--
+-- \medskip
+-- \noindent\emph{Snapshots.}
+-- Since an evolving graph is a sequence of different snapshot-graphs
+-- $G_i$ each snapshot is assigned to a time
+--
+--
+-- @field vertex_snapshots This storage maps each pgf-node to the snapshots
+-- in which they are visible.
+--
+-- @field supervertices This storage maps each pgf-node to its supervertex
+-- which represents all pgf-vertices assigned to the same node
+--
+-- @field supervertices_by_id This storage maps a node identifier to the
+-- related supervertex such that PGF-nodes which belonging to
+-- the same superverticex can be identified
+--
+-- @field snapshots An array of all snapshots. Sorted in ascending order
+-- over the timestamps of the snapshots.
+--
+-- @field arc_snapshots A table storing all snapshots of a supervertex in which
+-- the related nodes are connected. Using a snapshot as key you can check
+-- if a given snapshot is in the array.
+--
+-- Assume we want to iterate over all snapshots
+-- for a certain pair of supernodes in which they are connected
+-- by an arc. The arc_snapshots storage helps in this case:
+-- \begin{codeexample}[code only, tikz syntax=false]
+-- local supergraph = Supergraph.generateSupergraph(self.digraph)
+-- local u = supergraph.vertices[1]
+-- local v = supergraph.vertices[2]
+--
+-- local snapshots = supergraph.arc_snapshots[supergraph:arc(u, v)]
+-- for _, snapshot in ipairs(snapshots) do
+-- do_something(snapshot)
+-- end
+-- \end{codeexample}
+--
+local Supergraph = lib.class { base_class = Digraph }
+
+-- Namespace
+--require("pgf.gd.experimental.evolving").Supergraph = Supergraph
+
+Supergraph.__index =
+ function (t, k)
+ if k == "arcs" then
+ return Digraph.__index(t,k)
+ else
+ return rawget(Supergraph, k) or rawget(Digraph, k)
+ end
+ end
+
+function Supergraph.new(initial)
+ local supergraph = Digraph.new(initial)
+ setmetatable(supergraph, Supergraph)
+
+ supergraph.vertex_snapshots = Storage.new()
+ supergraph.supervertices = Storage.new()
+ supergraph.supervertices_by_id = {}
+ supergraph.arc_snapshots = Storage.newTableStorage()
+
+ return supergraph
+
+end
+
+
+local get_snapshot
+
+---
+-- Generate or extract a snapshot instance for a given snapshot time.
+--
+-- @param snapshots An array of all existing snapshots
+-- @param timestamps A table which maps known timestamps to their
+-- related snapshots
+-- @param ugraph The ugraph of the underlying graph structure
+-- @param snapshot_time
+--
+-- @return The snapshot instance found in the snapshots array for the
+-- wanted timestamp snapshot_time if it does'nt exists a new snapshot
+-- will be generated and added to the arrays
+--
+function get_snapshot(snapshots, timestamps, ugraph, snapshot_time)
+ local snapshot
+ local snapshot_idx = timestamps[snapshot_time]
+
+ if not snapshot_idx then
+ -- store snapshot if it doesn't exists
+ snapshot_idx = timestamps.n + 1
+ timestamps[snapshot_time] = snapshot_idx
+ timestamps.n = timestamps.n + 1
+ snapshot = Digraph.new {
+ syntactic_digraph = ugraph.syntactic_digraph,
+ options = ugraph.options
+ }
+ snapshot.timestamp = snapshot_time
+ snapshots[snapshot_idx] = snapshot
+ else
+ snapshot = snapshots[snapshot_idx]
+ end
+ assert(snapshot~=nil, "an unexpected error occured")
+ return snapshot
+end
+
+
+---
+-- Generate a new supergraph to describe the whole evolving graph by
+-- collecting all temporal information from the digraph and the node
+-- options. All nodes in the |digraph| require a |snapshot| and
+-- a |supernode| option. To identify a (snapshot-)node with its
+-- supernode and snapshot.
+--
+-- @param digraph
+--
+-- @return The supergraph which is a |Digraph| that has a supervertex
+-- for each set of snapshot-vertices with the same |supernode|
+-- attribute.
+--
+function Supergraph.generateSupergraph(digraph)
+ local new_supergraph
+ new_supergraph = Supergraph.new {
+ syntactic_digraph = digraph.syntactic_digraph,
+ options = digraph.options,
+ digraph = digraph,
+ }
+
+ -- array to store the supervertices for a given vertex name
+ local local_snapshots = {} -- array to store each snapshot graphs
+
+ local timestamps = { n = 0 } -- set of snapshot times
+
+ -- separate and assign vertices to their snapshots and supervertives
+ for i,vertex in ipairs(digraph.vertices) do
+ local snapshot_time = assert(vertex.options["snapshot"], "Missing option 'snapshot' for vertex ".. vertex.name ..". ")
+ local supernode_name = assert(vertex.options["supernode"], "Missing option 'supernode' for vertex"..vertex.name..". ")
+
+ local snapshot = get_snapshot(local_snapshots, timestamps, digraph, snapshot_time)
+ local supervertex = new_supergraph.supervertices_by_id[supernode_name]
+
+ if not supervertex then
+ -- first appeareance of the supernode id
+ supervertex = Vertex.new {
+ kind = "super",
+ name = supernode_name
+ }
+ supervertex.snapshots = {}
+ supervertex.subvertex = {}
+ new_supergraph.supervertices_by_id[supernode_name] = supervertex
+ new_supergraph:add{supervertex}
+
+ supervertex.options = {}
+ supervertex.options = vertex.options
+ end
+
+ snapshot:add{vertex}
+
+ new_supergraph.supervertices[vertex] = supervertex
+ new_supergraph.vertex_snapshots[vertex] = snapshot
+ new_supergraph:addSnapshotVertex(supervertex, snapshot, vertex)
+ end
+
+ -- Create edges
+ for i, e in ipairs(digraph.arcs) do
+ local u,v = e.tail, e.head
+ local snapshot_tail = new_supergraph.vertex_snapshots[e.tail]
+ local snapshot_head = new_supergraph.vertex_snapshots[e.head]
+
+ assert(snapshot_head == snapshot_tail, "Arcs must connect nodes that exist at the same time.")
+
+ -- connect in the snapshot graph
+ local arc = snapshot_tail:connect(u,v)
+
+ -- connect in the supergraph:
+ local super_tail = new_supergraph.supervertices[u]
+ local super_head = new_supergraph.supervertices[v]
+
+ new_supergraph:assignToSuperarc(super_tail, super_head, snapshot_tail)
+ end
+
+ -- snapshots in temporal order
+ table.sort(local_snapshots,
+ function(s1,s2)
+ return s1.timestamp < s2.timestamp
+ end )
+
+ local previous_snapshot
+
+ for i,s in ipairs(local_snapshots) do
+ local start = -math.huge
+ if previous_snapshot then
+ start = (s.timestamp - previous_snapshot.timestamp) / 2 + previous_snapshot.timestamp
+ previous_snapshot.interval.to = start
+ end
+ s.interval = { from = start , to = math.huge }
+ previous_snapshot = s
+ end
+
+ new_supergraph.snapshots = local_snapshots
+ new_supergraph.snapshots_indices = Storage.new()
+
+ for i, s in ipairs(new_supergraph.snapshots) do
+ new_supergraph.snapshots_indices[s] = i
+ end
+
+ return new_supergraph
+end
+
+
+function Supergraph:getSnapshotStaticDuration(snapshot)
+ assert(snapshot, "a snapshot as parameter expected, but got nil")
+ local idur = snapshot.interval.to - snapshot.interval.from
+ assert(idur, "unexpected nil-value")
+ local d1 = snapshot.interval.to - snapshot.timestamp
+ local d2 = snapshot.timestamp - snapshot.interval.from
+ local dm = math.min(d1,d2)
+ if (idur >= math.huge and dm < math.huge) then
+ return dm -- [-\infty,t] or [t,\infty]
+ elseif idur >= math.huge then
+ return 0 -- only one snapshot [-\infty,\infty]
+ else
+ return d1 + d2 -- [t_1, t_2]
+ end
+end
+
+---
+-- Get the durations of the graph in which snapshots are given which is exactly
+-- the time between the first and the last defined snapshot
+--
+-- @return The time between the last and first snapshot in seconds
+function Supergraph:getDuration()
+ local first_snapshot = self.snapshots[1]
+ local last_snapshot = self.snapshots[#self.snapshots]
+ return last_snapshot.timestamp - first_snapshot.timestamp
+end
+
+---
+--
+-- @return The ratio of the time of a snapshot related to the global duration of the whole
+-- evlolving trees. (The time between the last and first snapshot)
+function Supergraph:getSnapshotRelativeDuration(snapshot)
+ if self:getDuration() == 0 then
+ return 1
+ else
+ return self:getSnapshotStaticDuration(snapshot) / self:getDuration()
+ end
+end
+
+---
+-- Give the supervertex for a certain pgf-vertex (vertex of a snapshot)
+--
+-- @param vertex A vertex of a snapshot.
+--
+-- @return A supervertex in the supergraph for the given vertex, nil if no
+-- supervertex was assigned before.
+--
+function Supergraph:getSupervertex(vertex)
+ assert(vertex, "vertex required")
+ assert(self.supervertices, "supervertex table is not defined")
+ return self.supervertices[vertex]
+end
+
+function Supergraph:getSuperarc(arc)
+ local superhead = self:getSupervertex(arc.head)
+ local supertail = self:getSupervertex(arc.tail)
+ local arc = assert(self:arc(supertail, superhead),"unexpected problem")
+ return arc
+end
+
+function Supergraph:getSnapshots(supervertex)
+ return supervertex.snapshots
+end
+
+---
+-- Find the snapshot-instance for a given pgf-vertex
+-- (which is a vertex for one certain snapshot)
+--
+-- @param vertex A vertex for which you want to get the related snapshot
+--
+-- @return The snapshot which contains the given vertex as vertex.
+function Supergraph:getSnapshot(vertex)
+ return self.vertex_snapshots[vertex]
+end
+
+---
+-- For a given supervertex get the related vertex for a snapshot
+--
+-- @param supervertex
+--
+-- @param snapshot
+--
+-- @return The vertex of the supervertex at the specified snapshot
+--
+function Supergraph:getSnapshotVertex(supervertex, snapshot)
+ assert(supervertex, "supervertex must not be nil")
+ assert(snapshot, "snapshot must not be nil")
+ return supervertex.subvertex[snapshot]
+end
+
+
+function Supergraph:consecutiveSnapshots(snapshot1, snapshot2, n)
+ assert(snapshot1 and snapshot2, "no snapshot passed")
+ local idx1 = self.snapshots_indices[snapshot1] --or -1
+ local idx2 = self.snapshots_indices[snapshot2] --or -1
+ local d = n or 1
+
+ return (idx2-idx1 <= d) or (idx1-idx2 <= d)
+end
+
+function Supergraph:consecutive(vertex1, vertex2, n)
+ local s1 = self:getSnapshot(vertex1)
+ local s2 = self:getSnapshot(vertex2)
+ return self:consecutiveSnapshots(s1, s2, n)
+end
+
+---
+-- Write pack all position information to the nodes of each snapshot
+-- such that all nodes with the same supervertex have the same position
+--
+-- @param ugraph An undirected graph for which the vertices should get
+-- their positions from the supergraph.
+--
+function Supergraph:sharePositions(ugraph, ignore)
+
+ for _,vertex in ipairs(ugraph.vertices) do
+ if not ignore then
+ vertex.pos.x = self.supervertices[vertex].pos.x
+ vertex.pos.y = self.supervertices[vertex].pos.y
+ else
+ if not ignore.x then
+ vertex.pos.x = self.supervertices[vertex].pos.x
+ end
+ if not ignore.y then
+ vertex.pos.y = self.supervertices[vertex].pos.y
+ end
+ end
+
+
+ end
+end
+
+function Supergraph:onAllSnapshotvertices(f, ugraph)
+ for _,vertex in ipairs(ugraph.vertices) do
+ local snapshot_vertex = self.supertvertices[vertex]
+ if snapshot_vertex then
+ f(vertex, snapshot_vertex)
+ end
+ end
+end
+
+---
+-- Split a supervertex into new supervertices such that
+-- for a given snapshot there is a new pseudo-supervertex.
+-- This pseudo-supervertex will be assigned to all snapshots
+-- after the given snapshot.
+-- All snapshots of a new pseudo-supervertex are removed from
+-- the original vertex.
+-- If a supervertex has no subvertices then it will not be added to the graph.
+--
+-- @param supervertex The supervertex which should be splitted.
+--
+-- @param snapshots An array of snapshots at which the supervertex
+-- should be splitted into a new one with the corresponding pgf-vertices.
+-- If there are more than one snapshots passed to the function
+-- for each snapshot there will be a new pseudo-vertex
+--
+function Supergraph:splitSupervertex(supervertex, snapshots)
+ assert(supervertex, "no supervertex defined")
+ -- snapshots in temporal order
+ table.sort(snapshots,
+ function(s1,s2)
+ return s1.timestamp < s2.timestamp
+ end )
+
+ assert(#snapshots~=0)
+
+ local edit_snapshots = supervertex.snapshots
+ local first_removed = math.huge
+ local rem_arcs = {}
+ for i = 1, #snapshots do
+ local s_first = self.snapshots_indices[snapshots[i]]
+ first_removed = math.min(s_first,first_removed)
+ local s_last
+ if i==#snapshots then
+ s_last = #self.snapshots
+ else
+ s_last = self.snapshots_indices[snapshots[i+1]]-1
+ end
+
+ local pseudovertex = Vertex.new {
+ kind = "super",
+ name = supervertex.name.."*"..i,
+ subvertex = {},
+ snapshots = {}
+ }
+
+ local has_subvertices = false
+
+ for j = s_first, s_last do
+ local s = self.snapshots[j]
+ local vertex = self:getSnapshotVertex(supervertex, s)
+ if vertex then
+ self.supervertices[vertex] = pseudovertex
+ self:addSnapshotVertex(pseudovertex, s, vertex)
+ self:removeSnapshotVertex(supervertex, s)
+
+ if not has_subvertices then
+ has_subvertices = true
+ self:add{pseudovertex}
+ end
+
+ -- update edges:
+ local incoming = self.digraph:incoming(vertex)
+ local outgoing = self.digraph:outgoing(vertex)
+
+ for _, arc in ipairs(incoming) do
+ local tail = self.supervertices[arc.tail]
+ local head = self.supervertices[arc.head]
+ self:assignToSuperarc(tail, pseudovertex, s)
+
+ local super_arc = self:arc(tail, supervertex)
+ if not rem_arcs[super_arc] then
+ table.insert(rem_arcs, {arc = super_arc, snapshot = s})
+ rem_arcs[super_arc] = true
+ end
+ end
+
+ for _, arc in ipairs(outgoing) do
+ local tail = self.supervertices[arc.tail]
+ local head = self.supervertices[arc.head]
+ self:assignToSuperarc(pseudovertex, head, s)
+
+ local super_arc = self:arc(supervertex, head)
+ if not rem_arcs[super_arc] then
+ table.insert(rem_arcs, {arc = super_arc, snapshot = s})
+ rem_arcs[super_arc] = true
+ end
+ end
+ end
+ end
+ end
+
+ if first_removed ~= math.huge then
+ for _, removed_arc in ipairs(rem_arcs) do
+ local snapshots = self.arc_snapshots[removed_arc.arc]
+ for i=#snapshots,1,-1 do
+ local s = snapshots[i]
+ if s.timestamp >= removed_arc.snapshot.timestamp then
+ table.remove(snapshots, i)
+ end
+ end
+
+ if #snapshots==0 then
+ self:disconnect(removed_arc.arc.tail, removed_arc.arc.head)
+ end
+ end
+ end
+end
+
+-- function Supergraph:reloadArcSnapshots()
+-- for _, arc in ipairs(self.digraph.arcs) do
+-- local snapshot = self:getSnapshot(arc.head)
+-- local superarc = self:getSuperarc(arc)
+-- texio.write("\n"..arc.tail.name..">"..arc.head.name)
+-- self.arc_snapshots[superarc] = snapshot
+-- end
+-- end
+
+---
+-- Remove the binding of a vertex at a certain snapshot from its assigned
+-- supervertex.
+-- This requires time $O(n)$ where $n$ is the number of nodes actually
+-- assigned to the supervertex.
+function Supergraph:removeSnapshotVertex(supervertex, snapshot)
+ assert(supervertex and snapshot,"missing argument: the supervertex and snapshot must not be nil")
+
+ -- remove reference to snapshot
+ for i = #supervertex.snapshots,1,-1 do
+ if supervertex.snapshots[i] == snapshot then
+ table.remove(supervertex.snapshots, i)
+ end
+ end
+ -- remove vertex at snapshot
+ supervertex.subvertex[snapshot] = nil
+end
+
+---
+-- Assign a vertex to a snapshot vertex of this supergraph.
+-- This requires time $O(1)$
+-- @param supervertex
+--
+-- @param snapshot
+--
+-- @param vertex The vertex which should be assigned to the supervertex
+-- for the given snapshot.
+--
+function Supergraph:addSnapshotVertex(supervertex, snapshot, vertex)
+ supervertex.subvertex[snapshot] = vertex
+ table.insert(supervertex.snapshots, snapshot)
+end
+
+---
+-- Assign a given snapshot to the superarc between two supernodes.
+-- If still no arc between those nodes exists a new edges will
+-- be created.
+-- This requires time $O(n)$ where $n$ is the number of snapshots already
+-- assigned to the given arc.
+--
+-- @param super_tail The tail of the directed arc in the supergraph.
+--
+-- @param super_head The head of the directed arc in the supergraph.
+--
+-- @param snapshot A snapshot in which both nodes are connected.
+--
+-- @return The arc which was created or updated.
+--
+function Supergraph:assignToSuperarc(super_tail, super_head, snapshot)
+ assert(self:contains(super_tail) and self:contains(super_head),
+ "tried to connect supernodes not in the supergraph")
+
+ local super_arc = self:arc(super_tail, super_head)
+ if not super_arc then
+ super_arc = self:connect(super_tail, super_head)
+ end
+
+ table.insert(self.arc_snapshots[super_arc], snapshot)
+ self.arc_snapshots[super_arc][snapshot] = true
+
+ return super_arc
+end
+
+return Supergraph
+
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/SupergraphVertexSplitOptimization.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/SupergraphVertexSplitOptimization.lua
new file mode 100644
index 00000000000..2295e60513b
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/SupergraphVertexSplitOptimization.lua
@@ -0,0 +1,196 @@
+-- Copyright 2015 by Malte Skambath
+--
+-- This file may be distributed an/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 information
+
+
+local SupergraphVertexSplitOptimization = {}
+
+-- Imports
+local lib = require "pgf.gd.lib"
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+
+local Vertex = require "pgf.gd.model.Vertex"
+local Digraph = require "pgf.gd.model.Digraph"
+local Coordinate = require "pgf.gd.model.Coordinate"
+
+declare {
+ key = "split me",
+ type = "boolean",
+ initial = false
+}
+
+declare {
+ key = "split on disappearing",
+ type = "boolean",
+ initial = true
+}
+
+declare {
+ key = "split on disjoint neighbors",
+ type = "boolean",
+ initial = false
+}
+
+declare {
+ key = "split on disjoint children",
+ type = "boolean",
+ initial = false
+}
+
+declare {
+ key = "split on disjoint parents",
+ type = "boolean",
+ initial = false
+}
+
+declare {
+ key = "split all supervertices",
+ type = "boolean",
+ initial = false
+}
+
+declare {
+ key = "unbound vertex splitting",
+ algorithm = SupergraphVertexSplitOptimization,
+ phase = "supergraph optimization",
+ phase_default = true,
+ summary = [["
+ Use this key if you want to disable animations.
+ Instead of producing animations the evolving graph animation phasephase animates all vertices including movements and
+ fade in or fade out animations.
+ "]],
+ documentation = [["
+ See ToDo
+ "]]
+}
+
+
+
+-- Helpfunctions
+
+
+-- Implementation
+
+function SupergraphVertexSplitOptimization:run()
+ local supergraph = assert(self.supergraph, "no supergraph passed")
+
+ local split_on_dissapearing = self.digraph.options["split on disappearing"]
+ local split_on_no_common_neighbor = self.digraph.options["split on disjoint neighbors"]
+ local split_on_no_common_child = self.digraph.options["split on disjoint children"]
+ local split_on_no_common_parent = self.digraph.options["split on disjoint parents"]
+ local split_all = self.digraph.options["split all supervertices"]
+
+ for _, supernode in ipairs(supergraph.vertices) do
+ -- follow trace of the supernode
+ local snapshots = supergraph:getSnapshots(supernode)
+ local splitsnapshots = {}
+
+ for i=2, #snapshots do
+ local s = snapshots[i]
+ local s_prev = snapshots[i - 1]
+ local can_split = false
+
+ if supergraph:consecutiveSnapshots(s_prev, s) then
+ local v1 = supergraph:getSnapshotVertex(supernode, s_prev)
+ local v2 = supergraph:getSnapshotVertex(supernode, s)
+ local is_child1 = {}
+ local is_parent1 = {}
+ local is_neighbor1 = {}
+
+ local incoming1 = s_prev:incoming(v1)
+ local outgoing1 = s_prev:outgoing(v1)
+
+ for _,e in ipairs(incoming1) do
+ local p = supergraph:getSupervertex(e.tail)
+ if p then
+ is_parent1[p] = true
+ is_neighbor1[p] = true
+ end
+ end
+
+ for _,e in ipairs(outgoing1) do
+ local p = supergraph:getSupervertex(e.head)
+ if p then
+ is_child1[p] = true
+ is_neighbor1[p] = true
+ end
+ end
+
+ local incoming2 = s:incoming(v2)
+ local outgoing2 = s:outgoing(v2)
+
+ no_common_parent = true
+ no_common_child = true
+ no_common_neighbor = true
+ for _,e in ipairs(incoming2) do
+ local p = supergraph:getSupervertex(e.tail)
+ if p then
+ if is_neighbor1[p] then
+ no_common_neighbor = false
+ end
+ if is_parent1[p] then
+ no_common_parent = false
+ end
+ if (not no_common_neighbor) and (not no_common_parent) then
+ break
+ end
+ end
+ end
+
+ for _,e in ipairs(outgoing2) do
+ local p = supergraph:getSupervertex(e.head)
+ if p then
+ if is_neighbor1[p] then
+ no_common_neighbor = false
+ end
+ if is_child1[p] then
+ no_common_child = false
+ end
+ if (not no_common_neighbor) and (not no_common_child) then
+ break
+ end
+ end
+ end
+
+
+
+ if no_common_neighbor and split_on_no_common_neighbor then
+ can_split = true
+ --texio.write("[N@".. s.timestamp .."]")
+ end
+ if no_common_parent and split_on_no_common_parent then
+ can_split = true
+ --texio.write("[P@".. s.timestamp .."]")
+ end
+ if no_common_child and split_on_no_common_child then
+ can_split = true
+ --texio.write("[N@".. s.timestamp .."]")
+ end
+ if v2.options["split me"] then
+ can_split = true
+ end
+ else
+ can_split = true
+ --texio.write("[R@".. s.timestamp .."]")
+ end
+ if can_split or split_all then
+ table.insert(splitsnapshots, s)
+ end
+ end
+ if #splitsnapshots>0 then
+ supergraph:splitSupervertex(supernode, splitsnapshots)
+ end
+ end
+end
+
+
+
+
+-- Done
+
+return SupergraphVertexSplitOptimization
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/TimeSpec.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/TimeSpec.lua
new file mode 100644
index 00000000000..13d453f1fd6
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/TimeSpec.lua
@@ -0,0 +1,60 @@
+-- Copyright 2015 by Malte Skambath
+--
+-- 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 information
+
+
+-- Imports
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+
+---
+
+declare {
+ key = "snapshot",
+ type = "time",
+ initial = "0s",
+ summary = "The time of the snapshot in which a PGF node should be visible.",
+ documentation = [["
+ This option defines the time in seconds when respectively in which
+ state or snapshot of the graph the PGF represents a graph node.
+"]]
+}
+
+---
+
+declare {
+ key = "supernode",
+ type = "string",
+ initial = "null",
+ summary = "A unique name for a node a given PGF node should be assigned to.",
+ documentation = [["
+ Because it should be possible that nodes can change their
+ appearance, they are represented by separate PGF nodes in each
+ snapshot. To identify PGF nodes of the same supernode we have to
+ specify this key.
+"]]
+}
+
+---
+
+declare {
+ key = "fadein time",
+ type = "time",
+ initial = "0.5s",
+ summary = [["The time in seconds it should take that a nodes will be fade in
+ when it disappears in the graph"]],
+}
+
+---
+
+declare {
+ key = "fadeout time",
+ type = "time",
+ initial = "0.5s",
+ summary = "",
+ documentation = "The same as |fadein time| but for disappearing nodes."
+}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/doc.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/doc.lua
new file mode 100644
index 00000000000..801e3808bb4
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/doc.lua
@@ -0,0 +1,116 @@
+-- Copyright 2012 by Malte Skambath
+--
+-- This file may be distributed an/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 information
+
+--
+
+
+local key = require 'pgf.gd.doc'.key
+local documentation = require 'pgf.gd.doc'.documentation
+local summary = require 'pgf.gd.doc'.summary
+local example = require 'pgf.gd.doc'.example
+
+
+--------------------------------------------------------------------
+key "animated tree layout"
+
+summary "This layout uses the Reingold--Tilform method for drawing trees."
+
+documentation
+[[
+A method to create layouts for evolving graphs as an SVG animation.The Reingold--Tilford method is a standard method for drawing
+trees. It is described in:
+
+The algorithm, which is based on the Reingold--Tilford algorithm and
+its implementation in |graphdrawing.trees|, is introduced in my Masthesis:
+\begin{itemize}
+\item
+ M.\ Skambath,
+ \newblock Algorithmic Drawing of Evolving Trees, Masterthesis, 2016
+\end{itemize}
+
+You can use the same known graph macros as for other graph drawing
+algorithms in Ti\emph{k}Z. In addition all keys and features that
+are available for the static tree algorithm can be used:
+
+\begin{codeexample}[animation list={1,1.5,2,2.5,3,3.5,4}]
+ \tikz \graph[animated binary tree layout,
+ nodes={draw,circle}, auto supernode,
+ ] {
+ {[when=1] 15 -> {10 -> { ,11}, 20 }},
+ {[when=2] 15 -> {10 -> {3,11}, 20 }},
+ {[when=3] 15 -> {10 -> {3, }, 20 }},
+ {[when=4] 15 -> {10 -> {3, }, 20 -> 18 }},
+ };
+\end{codeexample}
+]]
+
+
+example
+[[
+\tikz[animated binary tree layout]
+ \graph[nodes={draw,circle}, auto supernode] {
+ {[when=1] 15 -> {10 -> { ,11}, 20 }},
+ {[when=2] 15 -> {10 -> {3,11}, 20 }},
+ {[when=3] 15 -> {10 -> {3, }, 20 }},
+ {[when=4] 15 -> {10 -> {3, }, 20 -> 18 }},
+ };
+]]
+--------------------------------------------------------------------
+
+
+
+--------------------------------------------------------------------
+
+--------------------------------------------------------------------
+
+
+
+--------------------------------------------------------------------
+key "animated binary tree layout"
+
+summary
+[[ A layout based on the Reingold--Tilford method for drawing
+binary trees. ]]
+
+documentation
+[[
+This key executes:
+\begin{enumerate}
+\item |animated tree layout|, thereby selecting the Reingold--Tilford method,
+\item |minimum number of children=2|, thereby ensuring the all nodes
+ have (at least) two children or none at all, and
+\end{enumerate}
+]]
+
+
+example
+[[
+]]
+
+example
+[[
+]]
+--------------------------------------------------------------------
+
+
+
+--------------------------------------------------------------------
+key "extended animated binary tree layout"
+
+summary
+[[ This algorithm is similar to |animated binary tree layout|, only the
+option \texttt{missing nodes get space} is executed and the
+\texttt{significant sep} is zero. ]]
+
+example
+[[
+]]
+--------------------------------------------------------------------
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua
new file mode 100644
index 00000000000..dc1e8ab571c
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/layered.lua
@@ -0,0 +1,107 @@
+-- Copyright 2012 by Till Tantau
+-- Copyright 2015 by Malte Skambath
+--
+-- This file may be distributed an/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 information
+
+
+
+
+local temporallayered = {}
+
+-- Namespace
+
+--require("pgf.gd").layered = layered
+--require("pgf.gd.experimental.evolving").layered = layered
+
+-- Import
+local lib = require "pgf.gd.lib"
+local Storage = require "pgf.gd.lib.Storage"
+local layered = require "pgf.gd.layered"
+
+--
+-- This file defines some basic functions to compute and/or set the
+-- ideal distances between nodes of any kind of layered drawing of a
+-- graph.
+
+
+
+---
+-- Position nodes in layers using baselines
+--
+-- @param layers A |Storage| object assigning layers to vertices.
+-- @param paddings A |Storage| object storing the computed distances
+-- (paddings).
+-- @param graph The graph in which the nodes reside
+-- @param snapshots The list of snapshots over which the overlaying evolving
+-- graph exists
+function temporallayered.arrange_layers_by_baselines (layers, paddings, graph, snapshots, vertex_snapshots)
+ assert(vertex_snapshots, "vertex_snapshots must not be nil")
+ --local layer_vertices = Storage.newTableStorage()
+ local snapshots_layers = Storage.newTableStorage()
+ local count_layers = 0
+ -- Decompose into layers:
+ for _,v in ipairs(graph.vertices) do
+ local layer_vertices = snapshots_layers[vertex_snapshots[v]] or {}
+ if layer_vertices[layers[v]] == nil then
+ assert( layers[v], "layer of node " .. v.name .. " has not been computed.")
+ layer_vertices[layers[v]] = {}
+ end
+ table.insert(layer_vertices[layers[v]], v)
+ count_layers = math.max(count_layers, layers[v])
+ end
+
+ if count_layers > 0 then
+
+
+ -- Now compute ideal distances and store
+ local height = 0
+
+ for _, s in ipairs(snapshots) do
+ local layer_vertices = snapshots_layers[s]
+ if #layer_vertices > 0 then -- sanity check
+ for _,v in ipairs(layer_vertices[1]) do
+ v.pos.y = 0
+ end
+ end
+ end
+
+ for i=2, count_layers do
+ local distance = 0
+ for _, s in ipairs(snapshots) do
+ local layer_vertices = snapshots_layers[s]
+ if #layer_vertices >= i then
+ distance = math.max(
+ distance,
+ layered.baseline_distance(
+ paddings,
+ s,
+ layer_vertices[i-1],
+ layer_vertices[i]))
+ end
+ end
+
+ height = height + distance
+
+ for _, s in ipairs(snapshots) do
+ local layer_vertices = snapshots_layers[s]
+ if #layer_vertices >= i then
+ for _,v in ipairs(layer_vertices[i]) do
+ v.pos.y = height
+ end
+ end
+ end
+ end
+ end
+end
+
+
+
+
+-- Done
+
+return temporallayered
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/library.lua
new file mode 100644
index 00000000000..bb50eaf2cb5
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/experimental/evolving/library.lua
@@ -0,0 +1,33 @@
+-- Copyright 2016 by Malte Skambath
+--
+-- This file may be distributed an/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 information
+
+
+
+-- @library
+
+local evolving -- Library name
+
+-- Load dependencies:
+require "pgf.gd.trees.ChildSpec"
+require "pgf.gd.trees.ReingoldTilford1981"
+require "pgf.gd.layered"
+
+-- Load declarations from:
+require "pgf.gd.experimental.evolving.TimeSpec"
+require "pgf.gd.experimental.evolving.Supergraph"
+
+-- Load preprocessing/optimization phases from:
+require "pgf.gd.experimental.evolving.SupergraphVertexSplitOptimization"
+require "pgf.gd.experimental.evolving.GreedyTemporalCycleRemoval"
+
+-- Load postprocessing/graph animation phases from:
+require "pgf.gd.experimental.evolving.GraphAnimationCoordination"
+
+-- Load algorithms from:
+require "pgf.gd.experimental.evolving.Skambath2016"
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force.lua
index cb30ec17914..71efda1b35d 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force.lua,v 1.1 2012/11/27 17:24:23 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/CoarseGraph.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/CoarseGraph.lua
index c9739dcaf63..6cd46c60eb2 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/CoarseGraph.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/CoarseGraph.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/CoarseGraph.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
--- A class for handling "coarse" versions of a graph. Such versions contain
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/Control.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/Control.lua
deleted file mode 100644
index 113f54b7ace..00000000000
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/Control.lua
+++ /dev/null
@@ -1,28 +0,0 @@
--- Copyright 2012 by Till Tantau
---
--- This file may be distributed an/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 information
-
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/Control.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
-
-
--- Imports
-local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
-
-
----
--- @section subsection {Controlling and Configuring Force-Based Algorithms}
---
--- All force-based algorithms are based on
--- a general pattern which we detail in the following. Numerous options
--- can be used to influence the behaviour of this general pattern; more
--- specific options that apply only to individual algorithms are
--- explained along with these algorithms.
---
--- @end
-
-
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua
index 330f401d5b5..17cd121b85e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlCoarsening.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlDeclare.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlDeclare.lua
new file mode 100644
index 00000000000..6d80fff6aa6
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlDeclare.lua
@@ -0,0 +1,41 @@
+-- Copyright 2012 by Till Tantau
+--
+-- This file may be distributed an/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 information
+
+-- @release $Header$
+
+
+-- Imports
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+
+
+---
+-- @section subsection {Controlling and Configuring Force-Based Algorithms}
+--
+-- All force-based algorithms are based on
+-- a general pattern which we detail in the following. Numerous options
+-- can be used to influence the behaviour of this general pattern; more
+-- specific options that apply only to individual algorithms are
+-- explained along with these algorithms.
+--
+-- The vertices are initially laid out in a random configuration.
+-- Then the configuration is annealed to find a configuration of
+-- minimal energy. To avoid getting stuck in a local minimum or at a
+-- saddle point, random forces are added. All of this makes the final
+-- layout extremely susceptible to changes in the random numbers. To
+-- achieve a certain stability of the results, you should fix the
+-- random seed. However, in the recent past Lua has switched its
+-- random number generator, which means that you won't get the same
+-- sequence of random numbers as in a previous version, even for
+-- identical seed. If you rely on the long-term stability of vertex
+-- placement, you should consider using a different layout. With the
+-- spring layout you have to assume that the layout will be random.
+--
+-- @end
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua
index d708bd6d7b7..7bd118d7b85 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua
index f07f23aeac3..b845d9d1f89 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlIteration.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua
index 2ef55169bca..9252f7b1cb8 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlSprings.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua
index 6b93f311290..b62be10c0a5 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlStart.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/QuadTree.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/QuadTree.lua
index 1a7d0abf25a..4e511746bb2 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/QuadTree.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/QuadTree.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/QuadTree.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
--- An implementation of a quad trees.
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalHu2006.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalHu2006.lua
index 54ceddcc25a..9fa709a8053 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalHu2006.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalHu2006.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalHu2006.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
local SpringElectricalHu2006 = {}
@@ -97,7 +97,11 @@ function SpringElectricalHu2006:run()
-- initialize node weights
for _,node in ipairs(self.graph.nodes) do
- node.weight = node:getOption('electric charge')
+ if node:getOption('electric charge') ~= nil then
+ node.weight = node:getOption('electric charge')
+ else
+ node.weight = 1
+ end
end
-- initialize edge weights
@@ -171,7 +175,7 @@ function SpringElectricalHu2006:run()
-- set the spring length to the average edge length of the initial layout
spring_length = 0
- for _,e in ipairs(coarse_graph.graph.edges) do
+ for _,edge in ipairs(coarse_graph.graph.edges) do
spring_length = spring_length + edge.nodes[1].pos:minus(edge.nodes[2].pos):norm()
end
spring_length = spring_length / #coarse_graph.graph.edges
@@ -205,7 +209,7 @@ function SpringElectricalHu2006:computeInitialLayout(graph, spring_length)
-- position the loose node relative to the fixed node, with
-- the displacement (random direction) matching the spring length
- local direction = Vector.new{x = math.random(1, spring_length), y = math.random(1, spring_length)}
+ local direction = Vector.new{x = lib.random(1, spring_length), y = lib.random(1, spring_length)}
local distance = 3 * spring_length * self.graph_density * math.sqrt(self.graph_size) / 2
local displacement = direction:normalized():timesScalar(distance)
@@ -218,7 +222,7 @@ function SpringElectricalHu2006:computeInitialLayout(graph, spring_length)
-- use a random positioning technique
local function positioning_func(n)
local radius = 3 * spring_length * self.graph_density * math.sqrt(self.graph_size) / 2
- return math.random(-radius, radius)
+ return lib.random(-radius, radius)
end
-- compute initial layout based on the random positioning technique
@@ -518,4 +522,4 @@ end
-- done
-return SpringElectricalHu2006 \ No newline at end of file
+return SpringElectricalHu2006
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalLayouts.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalLayouts.lua
index f8854e71618..df7dc70a745 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalLayouts.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalLayouts.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalLayouts.lua,v 1.4 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalWalshaw2000.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalWalshaw2000.lua
index 25782bc9c3c..02fd09a72d9 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalWalshaw2000.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalWalshaw2000.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringElectricalWalshaw2000.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
@@ -127,7 +127,11 @@ function SpringElectricalWalshaw2000:run()
-- initialize node weights
for _,node in ipairs(self.graph.nodes) do
- node.weight = node:getOption('electric charge')
+ if node:getOption('electric charge') ~= nil then
+ node.weight = node:getOption('electric charge')
+ else
+ node.weight = 1
+ end
-- a node is charged if its weight derives from the default setting
-- of 1 (where it has no influence on the forces)
@@ -212,7 +216,7 @@ function SpringElectricalWalshaw2000:computeInitialLayout(graph, spring_length)
-- position the loose node relative to the fixed node, with
-- the displacement (random direction) matching the spring length
- local direction = Vector.new{x = math.random(1, 2), y = math.random(1, 2)}
+ local direction = Vector.new{x = lib.random(1, 2), y = lib.random(1, 2)}
local distance = 3 * spring_length * self.graph_density * math.sqrt(self.graph_size) / 2
local displacement = direction:normalized():timesScalar(distance)
@@ -227,7 +231,7 @@ function SpringElectricalWalshaw2000:computeInitialLayout(graph, spring_length)
-- use the random positioning technique
local function positioning_func(n)
local radius = 3 * spring_length * self.graph_density * math.sqrt(self.graph_size) / 2
- return math.random(-radius, radius)
+ return lib.random(-radius, radius)
end
-- compute initial layout based on the random positioning technique
@@ -513,4 +517,4 @@ end
-- done
-return SpringElectricalWalshaw2000 \ No newline at end of file
+return SpringElectricalWalshaw2000
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua
index 35dc21008fb..b53bc9bff98 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $
+-- @release $Header$
@@ -64,7 +64,6 @@ local lib = require("pgf.gd.lib")
-
function SpringHu2006:run()
-- Setup some parameters
@@ -214,7 +213,7 @@ function SpringHu2006:computeInitialLayout(graph, spring_length)
-- position the loose node relative to the fixed node, with
-- the displacement (random direction) matching the spring length
- local direction = Vector.new{x = math.random(1, spring_length), y = math.random(1, spring_length)}
+ local direction = Vector.new{x = lib.random(1, spring_length), y = lib.random(1, spring_length)}
local distance = 1.8 * spring_length * self.graph_density * math.sqrt(self.graph_size) / 2
local displacement = direction:normalized():timesScalar(distance)
@@ -226,7 +225,7 @@ function SpringHu2006:computeInitialLayout(graph, spring_length)
-- use a random positioning technique
local function positioning_func(n)
local radius = 2 * spring_length * self.graph_density * math.sqrt(self.graph_size) / 2
- return math.random(-radius, radius)
+ return lib.random(-radius, radius)
end
-- compute initial layout based on the random positioning technique
@@ -384,4 +383,4 @@ end
-- done
-return SpringHu2006 \ No newline at end of file
+return SpringHu2006
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringLayouts.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringLayouts.lua
index ab0126d7fcd..5554410816e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringLayouts.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringLayouts.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringLayouts.lua,v 1.4 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/library.lua
index af3a1a62c27..be0faf465c1 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/library.lua,v 1.4 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
@@ -109,7 +109,7 @@
local force -- Library name
-- Load declarations from:
-require "pgf.gd.force.Control"
+require "pgf.gd.force.ControlDeclare"
require "pgf.gd.force.ControlStart"
require "pgf.gd.force.ControlIteration"
require "pgf.gd.force.ControlSprings"
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface.lua
index bd53ae4376b..df2649521b2 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/interface.lua,v 1.1 2012/11/27 17:24:24 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceCore.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceCore.lua
index 8de6d96d48d..8dfbae44850 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceCore.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceCore.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceCore.lua,v 1.6 2014/02/24 10:40:32 tantau Exp $
+-- @release $Header$
@@ -117,6 +117,13 @@ local factors = {
[""]=1,
}
+local time_factors = {
+ s=1,
+ ms=0.001,
+ min=60,
+ h=3600
+}
+
local directions = {
down = -90,
up = 90,
@@ -157,6 +164,9 @@ function InterfaceCore.convert(s,t)
elseif t == "length" then
local num, dim = string.match(s, "([%d.]+)(.*)")
return tonumber(num) * assert(factors[dim], "unknown unit")
+ elseif t == "time" then
+ local num, dim = string.match(s, "([%d.]+)(.*)")
+ return tonumber(num) * assert(time_factors[dim], "unknown time unit")
elseif t == "string" then
return s
elseif t == "canvas coordinate" or t == "coordinate" then
@@ -178,4 +188,4 @@ end
-- Done
-return InterfaceCore \ No newline at end of file
+return InterfaceCore
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToAlgorithms.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToAlgorithms.lua
index 0ea7bacf96a..f1b203e550c 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToAlgorithms.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToAlgorithms.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToAlgorithms.lua,v 1.18 2014/02/24 10:40:32 tantau Exp $
+-- @release $Header$
@@ -283,6 +283,8 @@ end
-- a dimension like |cm| attached to it). It is the job of the display
-- layer to map this to a number in ``\TeX\ points,'' that is, to a
-- multiple of $1/72.27$th of an inch.
+-- \item |time| A ``time'' in the sense of |\pgfparsetime|. Examples
+-- are |6s| or |0.1min| or |6000ms|, all of which will map to |6|.
-- \item |string| Some text. Will be mapped to a Lua |string|.
-- \item |canvas coordinate| A position on the canvas. Will be mapped
-- to a |model.Coordinate|.
@@ -957,4 +959,4 @@ end
-- Done
-return InterfaceToAlgorithms \ No newline at end of file
+return InterfaceToAlgorithms
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToC.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToC.lua
index 37db0b3d91e..2aeb2e6a7aa 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToC.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToC.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToC.lua,v 1.7 2014/02/24 10:40:32 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua
index a636e79b8ea..c0ddf0dc8ce 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/interface/InterfaceToDisplay.lua,v 1.14 2014/03/19 09:20:59 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/Scope.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/Scope.lua
index 7826e77e6ae..438925a2213 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/Scope.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/interface/Scope.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/interface/Scope.lua,v 1.2 2013/02/08 17:14:05 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered.lua
index e5b4b5f1747..dd897fbe8ac 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered.lua,v 1.2 2013/02/08 17:14:04 tantau Exp $
+--- @release $Header$
local layered = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CrossingMinimizationGansnerKNV1993.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CrossingMinimizationGansnerKNV1993.lua
index 86baaf14c33..3fe3eac2552 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CrossingMinimizationGansnerKNV1993.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CrossingMinimizationGansnerKNV1993.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/CrossingMinimizationGansnerKNV1993.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990a.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990a.lua
index 8e5111cfb72..55207b845d3 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990a.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990a.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990a.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990b.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990b.lua
index deaae695246..218ecbd2099 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990b.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990b.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalBergerS1990b.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
local CycleRemovalBergerS1990b = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalEadesLS1993.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalEadesLS1993.lua
index 6ff83ceae39..ffb919b2092 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalEadesLS1993.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalEadesLS1993.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalEadesLS1993.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalGansnerKNV1993.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalGansnerKNV1993.lua
index a2ee9c01863..b480b7c4e70 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalGansnerKNV1993.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalGansnerKNV1993.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/CycleRemovalGansnerKNV1993.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
local CycleRemovalGansnerKNV1993 = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/EdgeRoutingGansnerKNV1993.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/EdgeRoutingGansnerKNV1993.lua
index 649db1e54b6..c451f74116e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/EdgeRoutingGansnerKNV1993.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/EdgeRoutingGansnerKNV1993.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/EdgeRoutingGansnerKNV1993.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NetworkSimplex.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NetworkSimplex.lua
index abc17477bac..40078405f90 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NetworkSimplex.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NetworkSimplex.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/NetworkSimplex.lua,v 1.2 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodePositioningGansnerKNV1993.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodePositioningGansnerKNV1993.lua
index ce0fab4efe7..3af15ad1593 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodePositioningGansnerKNV1993.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodePositioningGansnerKNV1993.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodePositioningGansnerKNV1993.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingGansnerKNV1993.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingGansnerKNV1993.lua
index e941029b3d3..4a53acf8646 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingGansnerKNV1993.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingGansnerKNV1993.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingGansnerKNV1993.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
local NodeRankingGansnerKNV1993 = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingMinimumHeight.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingMinimumHeight.lua
index 38f52f6ba7f..8aa98bd03ad 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingMinimumHeight.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingMinimumHeight.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/NodeRankingMinimumHeight.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
local NodeRankingMinimumHeight = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Ranking.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Ranking.lua
index 8b2527edd5f..228039b536f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Ranking.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Ranking.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/Ranking.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Sugiyama.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Sugiyama.lua
index 4d1e0ae47ed..3ab9596322d 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Sugiyama.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/Sugiyama.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/Sugiyama.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/crossing_minimization.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/crossing_minimization.lua
index 16e3b1653de..6bede7eb015 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/crossing_minimization.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/crossing_minimization.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/crossing_minimization.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/cycle_removal.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/cycle_removal.lua
index e201de6da4a..63c43f5b14f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/cycle_removal.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/cycle_removal.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/cycle_removal.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/edge_routing.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/edge_routing.lua
index e2cb40f68b3..b790d527e3d 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/edge_routing.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/edge_routing.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/edge_routing.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/library.lua
index a3c03b7283e..9f681929ecb 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/library.lua,v 1.3 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_positioning.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_positioning.lua
index d53b0873a3f..8fa55f9cbb9 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_positioning.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_positioning.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_positioning.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_ranking.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_ranking.lua
index 3a1098d6c03..7aef0bde5fc 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_ranking.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_ranking.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/layered/node_ranking.lua,v 1.3 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib.lua
index aaa7f648a51..bcd4f6cfc1e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib.lua,v 1.6 2014/02/24 10:40:32 tantau Exp $
+-- @release $Header$
@@ -209,7 +209,7 @@ function lib.random_permutation(n)
p[i] = i
end
for i=1,n-1 do
- local j = math.random(i,n)
+ local j = lib.random(i,n)
p[i], p[j] = p[i], p[j]
end
return p
@@ -394,6 +394,28 @@ function lib.ondemand(filename, table, name)
end
+
+---
+-- This implements the legacy random number generator of Lua 5.2 in
+-- pure Lua. This is needed for Lua 5.3 compatibility to obtain
+-- consitent results.
+--
+-- @param l Lower bound
+-- @param u Upper bound
+-- @return A random number
+function lib.random(l,u)
+ local r = math.random()
+ if l and u then
+ assert(l <= u)
+ return math.floor(r*(u-l+1)) + l
+ elseif l then
+ assert(1.0 <= l)
+ return math.floor(r*l) + 1.0
+ else
+ return r
+ end
+end
+
-- Done
-return lib \ No newline at end of file
+return lib
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua
index aa149c3e4f9..292f9e56bf2 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/Bezier.lua,v 1.1 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/DepthFirstSearch.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/DepthFirstSearch.lua
index 768a5da0ffe..564b8f6839a 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/DepthFirstSearch.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/DepthFirstSearch.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/DepthFirstSearch.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua
index dd5dde22e1c..aaad047c702 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/Direct.lua,v 1.2 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua
index 918c118f4b2..952f37796eb 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/Event.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua
index a3c04ca54df..0014c94a375 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/LookupTable.lua,v 1.2 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua
index c617cf80d8b..05b480713b0 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/PathLengths.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua
index 7b93c755c56..378800fbf5b 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/PriorityQueue.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua
index b935305893a..abb428b8725 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/Simplifiers.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua
index 11466c04961..dfab15697de 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/Stack.lua,v 1.1 2012/11/27 17:24:26 tantau Exp $
+-- @release $Header$
--- A Stack is a very simple wrapper around an array
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua
index 525fcb4f8fc..eb520e77452 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/Storage.lua,v 1.4 2013/12/20 14:44:46 tantau Exp $
+-- @release $Header$
@@ -107,4 +107,4 @@ end
-- Done
-return Storage \ No newline at end of file
+return Storage
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua
index d477c682f60..1f81b269202 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/lib/Transform.lua,v 1.2 2014/02/24 10:40:32 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model.lua
index badde1bbd58..4a0130488bc 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model.lua,v 1.1 2012/11/27 17:24:24 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Arc.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Arc.lua
index 5c2f10cd383..997a452399f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Arc.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Arc.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Arc.lua,v 1.7 2015/04/21 14:10:00 tantau Exp $
+-- @release $Header$
---
@@ -31,13 +31,17 @@
-- synactic edges that ``belong'' to an edge.
--
-- In order to \emph{set} options of the edges, you can set the
--- |generate_options| field of an arc (which is |nil| by default), see
+-- |generated_options| field of an arc (which is |nil| by default), see
-- the |declare_parameter_sequence| function for the syntax. Similar
-- to the |path| field below, the options set in this table are
-- written back to the syntactic edges during a sync.
--
--- In detail, the following happens: Even though an arc has a |path|
--- field and a |generated_options| field, setting these fields does
+-- Finally, there is also an |animations| field, which, similarly to
+-- the |generated_options|, gets written back during a sync when it is
+-- not |nil|.
+--
+-- In detail, the following happens: Even though an arc has a |path|,
+-- |generated_options|, and |animations| fields, setting these fields does
-- not immediately set the paths of the syntactic edges nor does it
-- generate options. Indeed, you will normally want to setup and
-- modify the |path| field of an arc during your algorithm and only at
@@ -65,6 +69,9 @@
-- above.
-- @field generated_options If non-nil, some options to be passed back
-- to the original syntactic edges, see the description above.
+-- @field animations If non-nil, some animations to be passed back
+-- to the original syntactic edges. See the description of the
+-- |animations| field for |Vertex| for details on the syntax.
-- @field syntactic_edges In case this arc is an arc in the syntatic
-- digraph (and only then), this field contains an array containing
-- syntactic edges (``real'' edges in the syntactic digraph) that
@@ -528,6 +535,26 @@ function Arc:sync()
end
end
end
+ if self.animations then
+ local head = self.head
+ local tail = self.tail
+ local a = self.syntactic_digraph:arc(tail,head)
+ if a and #a.syntactic_edges>0 then
+ for _,e in ipairs(a.syntactic_edges) do
+ for _,o in ipairs(self.animations) do
+ e.animations[#e.animations+1] = o
+ end
+ end
+ end
+ local a = head ~= tail and self.syntactic_digraph:arc(head,tail)
+ if a and #a.syntactic_edges>0 then
+ for _,e in ipairs(a.syntactic_edges) do
+ for _,o in ipairs(self.animations) do
+ e.animations[#e.animations+1] = o
+ end
+ end
+ end
+ end
end
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Collection.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Collection.lua
index a460e83505d..8ebb6f144cf 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Collection.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Collection.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Collection.lua,v 1.2 2013/02/08 17:14:05 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Coordinate.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Coordinate.lua
index 8d11fe89d8f..815544ee705 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Coordinate.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Coordinate.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Coordinate.lua,v 1.4 2014/02/24 10:40:32 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Digraph.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Digraph.lua
index f0568d13ad9..5c48059a605 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Digraph.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Digraph.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Digraph.lua,v 1.7 2013/12/20 14:44:47 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Edge.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Edge.lua
index a91979d0ad5..87b06661e54 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Edge.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Edge.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Edge.lua,v 1.6 2013/12/20 14:44:47 tantau Exp $
+-- @release $Header$
---
@@ -60,7 +60,10 @@
-- by the algorithm. When the edge is rendered later on, this array
-- will be passed back to the display layer. The syntax is the same as
-- for the |declare_parameter_sequence| function, see
--- |InterfaceToAlgorithms|.
+-- |InterfaceToAlgorithms|.
+--
+-- @field animations An array of animations, see the |animations|
+-- field of the |Vertex| class for the syntax.
local Edge = {}
Edge.__index = Edge
@@ -94,6 +97,7 @@ function Edge.new(values)
new[k] = v
end
new.generated_options = new.generated_options or {}
+ new.animations = new.animations or {}
if not new.path then
local p = Path.new ()
p:appendMoveto(Edge.tailAnchorForEdgePath(new))
@@ -202,4 +206,4 @@ end
-- Done
-return Edge \ No newline at end of file
+return Edge
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Hyperedge.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Hyperedge.lua
index 54a373bf83f..3819e193689 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Hyperedge.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Hyperedge.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Hyperedge.lua,v 1.2 2013/05/23 20:01:27 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path.lua
index 07cd78d34e1..93cd44cc218 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Path.lua,v 1.3 2014/02/24 10:40:32 tantau Exp $
+-- @release $Header$
---
@@ -543,6 +543,10 @@ function Path:intersectionsWith(path)
local function intersect (i1, j1, i2, j2)
+ if i1 > j1 or i2 > j2 then
+ return
+ end
+
local bb1 = bb(i1, j1, memo1)
local bb2 = bb(i2, j2, memo2)
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path_arced.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path_arced.lua
index ace3825e350..92dd8ad87ac 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path_arced.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Path_arced.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Path_arced.lua,v 1.2 2015/05/08 10:23:50 tantau Exp $
+-- @release $Header$
local Path = require 'pgf.gd.model.Path'
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Vertex.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Vertex.lua
index f18aa43f450..c287181992f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Vertex.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/Vertex.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/Vertex.lua,v 1.6 2013/12/20 14:44:47 tantau Exp $
+-- @release $Header$
---
@@ -22,7 +22,7 @@
-- be modified directly.
--
-- Note that a |Vertex| is an abstraction of \tikzname\ nodes; indeed
--- that objective is to ensure that, in principle, we can use them
+-- the objective is to ensure that, in principle, we can use them
-- independently of \TeX. For this reason, you will not find any
-- references to |tex| inside a |Vertex|; this information is only
-- available in the syntactic digraph.
@@ -91,6 +91,22 @@
--
-- @field options A table of options that contains user-defined options.
--
+-- @field animations An array of attribute animations for the
+-- node. When an algorithm adds entries to this array, the display
+-- layer should try to render these. The syntax is as follows: Each
+-- element in the array is a table with a field |attribute|, which must
+-- be a string like |"opacity"| or |"translate"|, a field |entries|,
+-- which must be an array to be explained in a moment, and field
+-- |options|, which must be a table of the same syntax as the
+-- |options| field. For the |entries| array, each element must be
+-- table with two field: |t| must be set to a number, representing a
+-- time in secondds, and |value|, which must be set to a value that
+-- the |attribute| should have at the given time. The entries and the
+-- options will then be interpreted as described in \pgfname's basic
+-- layer animation system, except that where a |\pgfpoint| is expected
+-- you provide a |Coordinate| and a where a path is expected you
+-- provide a |Path|.
+--
-- @field shape A string describing the shape of the node (like |rectangle|
-- or |circle|). Note, however, that this is more ``informative''; the
-- actual information that is used by the graph drawing system for
@@ -104,6 +120,13 @@
-- @field event The |Event| when this vertex was created (may be |nil|
-- if the vertex is not part of the syntactic digraph).
--
+-- @field incomings A table indexed by |Digraph| objects. For each
+-- digraph, the table entry is an array of all vertices from which
+-- there is an |Arc| to this vertex. This field is internal and may
+-- not only be accessed by the |Digraph| class.
+--
+-- @field outgoings Like |incomings|, but for outgoing arcs.
+--
local Vertex = {}
Vertex.__index = Vertex
@@ -137,16 +160,11 @@ local Storage = require "pgf.gd.lib.Storage"
-- \item[|path|] A |Path| object representing the vertex's hull.
-- \item[|anchors|] A table of anchors.
-- \item[|options|] An options table for the vertex.
+-- \item[|animations|] An array of generated animation attributes.
-- \item[|shape|] A string describing the shape. If not given, |"none"| is used.
-- \item[|kind|] A kind like |"node"| or |"dummy"|. If not given, |"dummy"| is used.
-- \end{description}
--
--- @field incomings A table indexed by |Digraph| objects. For each
--- digraph, the table entry is an array of all vertices from which
--- there is an |Arc| to this vertex. This field is internal and may
--- not only be accessed by the |Digraph| class.
--- @field outgoings Like |incomings|, but for outgoing arcs.
---
-- @return A newly allocated node.
--
function Vertex.new(values)
@@ -162,6 +180,7 @@ function Vertex.new(values)
new.kind = new.kind or "dummy"
new.pos = new.pos or Coordinate.new(0,0)
new.anchors = new.anchors or { center = Coordinate.new(0,0) }
+ new.animations = new.animations or {}
return setmetatable (new, Vertex)
end
@@ -274,4 +293,4 @@ end
-- Done
-return Vertex \ No newline at end of file
+return Vertex
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/library.lua
index 3bc491ec093..ad62faa0f3d 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/model/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/model/library.lua,v 1.2 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf.lua
index aad6eb0a440..f7905f2418a 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/ogdf.lua,v 1.1 2012/12/17 23:53:11 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua
index a06c732ed1d..f91c75a4d64 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/ogdf/library.lua,v 1.12 2013/10/09 19:47:00 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees.lua
index 72bb3e904ee..95689e6379b 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees.lua,v 1.1 2015/03/12 15:58:20 tantau Exp $
+--- @release $Header$
local pedigrees = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/Koerner2015.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/Koerner2015.lua
index 460aaaed905..df366a31687 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/Koerner2015.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/Koerner2015.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/Koerner2015.lua,v 1.1 2015/03/12 15:58:23 tantau Exp $
+-- @release $Header$
local Koerner2015 = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/library.lua
index 4e6000d038f..db3d4f9cf72 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/pedigrees/library.lua,v 1.1 2015/03/12 15:58:23 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics.lua
index 75a78f4f478..77c66de5b2d 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics.lua,v 1.1 2013/02/08 17:14:04 tantau Exp $
+--- @release $Header$
local phylogenetics = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/AuthorDefinedPhylogeny.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/AuthorDefinedPhylogeny.lua
index dc5dea45b0f..f1acbd71281 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/AuthorDefinedPhylogeny.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/AuthorDefinedPhylogeny.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/AuthorDefinedPhylogeny.lua,v 1.2 2013/03/20 17:16:38 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedMinimumEvolution.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedMinimumEvolution.lua
index fd0fb62b3ad..d2b64270796 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedMinimumEvolution.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedMinimumEvolution.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedMinimumEvolution.lua,v 1.1 2013/02/08 17:14:05 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedNearestNeighbourInterchange.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedNearestNeighbourInterchange.lua
index a4fbc0cc3b9..8077790224a 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedNearestNeighbourInterchange.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedNearestNeighbourInterchange.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/BalancedNearestNeighbourInterchange.lua,v 1.2 2013/03/20 17:16:38 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/DistanceMatrix.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/DistanceMatrix.lua
index 0bca7773212..d44f098161f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/DistanceMatrix.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/DistanceMatrix.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/DistanceMatrix.lua,v 1.2 2013/12/20 14:44:47 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/Maeusle2012.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/Maeusle2012.lua
index ef0909a6d00..528110b57ea 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/Maeusle2012.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/Maeusle2012.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/Maeusle2012.lua,v 1.4 2013/05/23 20:01:29 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/PhylogeneticTree.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/PhylogeneticTree.lua
index 16356aa7cfa..f66f2553306 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/PhylogeneticTree.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/PhylogeneticTree.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/PhylogeneticTree.lua,v 1.2 2013/02/08 17:14:06 tantau Exp $
+-- @release $Header$
local PhylogeneticTree = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/SokalMichener1958.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/SokalMichener1958.lua
index c55a7a7467c..8be5c1d51e9 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/SokalMichener1958.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/SokalMichener1958.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/SokalMichener1958.lua,v 1.1 2013/02/08 17:14:06 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/library.lua
index 194e809ef2e..29183a57739 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/phylogenetics/library.lua,v 1.2 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar.lua
new file mode 100644
index 00000000000..5d80de77cdd
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar.lua
@@ -0,0 +1,6 @@
+require "pgf"
+require "pgf.gd"
+
+pgf.gd.planar = {}
+
+return pgf.gd.planar
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/BoyerMyrvold2004.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/BoyerMyrvold2004.lua
new file mode 100644
index 00000000000..f30c940a921
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/BoyerMyrvold2004.lua
@@ -0,0 +1,678 @@
+
+--[[
+---Data structures---
+
+Vertices from the original ugraph are referred to as input vertices.
+The tables that contain vertex data relevant to the algorithm
+are referred to as vertices.
+A vertex table may have the following keys:
+
+-sign
+1 or -1, indicates whether this and all in the depth-first search
+following vertices must be considered flipped
+(i. e. adjacency lists reversed) in respect to the dfs parent
+
+-childlist
+A linked list containing all dfs children of the vertex whose virtual roots
+have not yet been merged into the vertex, sorted by lowpoint
+
+-adjlistlinks
+A table with two fields with keys 0 and 1, containing the two half edges
+of the vertex which lie on the external face of the graph
+(if the vertex lies on the external face).
+The half edge with key 0 lies in the 0-direction of the other half edge
+and vice-versa
+The two fields may hold the same half edge, if the vertex has degree one
+
+-pertinentroots
+A linked list containing all virtual roots of this vertex that are
+pertinent during the current step
+
+-inputvertex
+The input vertex that corresponds to the vertex
+
+-dfi
+The depth-first search index (number of the step in the dfs at which
+the vertex was discovered)
+
+-dfsparent
+The depth-first search parent (vertex from which the vertex was discovered
+first in the dfs)
+
+-leastancestor
+Dfi of the vertex with lowest dfi that can be reached using one back edge
+(non-tree edge)
+
+-lowpoint
+Dfi of the vertex with lowest dfi that can be reached using any number of
+tree edges plus one back edge
+
+
+A root vertex is a virtual vertex not contained in the original ugraph.
+The root vertex represents another vertex in a biconnected component (block)
+which is a child of the biconnected component the represented vertex is in.
+The only field that it has in common with other vertices is the
+adjacency list links array:
+
+-isroot
+always true, indicates that this vertex is a virtual root
+
+-rootparent
+The vertex which this root represents
+
+-rootchild
+The only dfs child of the original vertex which is contained in the
+root verticis biconnected component
+
+-adjlistlinks
+See adjlistlinks of a normal vertex
+
+
+A half edge is a table with the following fields:
+
+-links
+A table with two fields with keys 0 and 1, containing the neighboring
+half edges in the adjacency list of the vertex these edges originate from.
+
+-target
+The vertex the half edge leads to
+
+-twin
+The twin half edge which connects the two vertices in the opposite direction
+
+-shortcircuit
+True if the half edge was inserted in order to make a short circuit for the
+algorithm. The edge will be removed at the end.
+
+The BoyerMyrvold2004 class has the following fields:
+
+-inputgraph
+The original ugraph given to the algorithm
+
+-numvertices
+The number of vertices of the graph
+
+-vertices
+The vertex table with depth-first search indices as keys
+
+-verticesbyinputvertex
+The vertex table with input vertices as keys
+
+-verticesbylowpoint
+The vertex table with low points as keys
+
+-shortcircuitedges
+An array of all short circuit half edges
+(which may not be in the original graph and will be removed at the end)
+
+--]]
+
+local BM = {}
+require("pgf.gd.planar").BoyerMyrvold2004 = BM
+
+-- imports
+local Storage = require "pgf.gd.lib.Storage"
+local LinkedList = require "pgf.gd.planar.LinkedList"
+local Embedding = require "pgf.gd.planar.Embedding"
+
+-- create class properties
+BM.__index = BM
+
+function BM.new()
+ local t = {}
+ setmetatable(t, BM)
+ return t
+end
+
+-- initializes some data structures at the beginning
+-- takes the ugraph of the layout algorithm as input
+function BM:init(g)
+ self.inputgraph = g
+ self.numvertices = #g.vertices
+ self.vertices = {}
+ self.verticesbyinputvertex = Storage.new()
+ self.verticesbylowpoint = Storage.newTableStorage()
+ self.shortcircuitedges = {}
+ for _, inputvertex in ipairs(self.inputgraph.vertices) do
+ local vertex = {
+ sign = 1,
+ childlist = LinkedList.new(),
+ adjlistlinks = {},
+ pertinentroots = LinkedList.new(),
+ inputvertex = inputvertex,
+ }
+ setmetatable(vertex, Embedding.vertexmetatable)
+ self.verticesbyinputvertex[inputvertex] = vertex
+ end
+end
+
+--[[
+local function nilmax(a, b)
+ if a == nil then return b end
+ if b == nil then return a end
+ return math.max(a, b)
+end
+
+local function nilmin(a, b)
+ if a == nil then return b end
+ if b == nil then return a end
+ return math.min(a, b)
+end
+--]]
+
+-- the depth-first search of the preprocessing
+function BM:predfs(inputvertex, parent)
+ local dfi = #self.vertices + 1
+ local vertex = self.verticesbyinputvertex[inputvertex]
+ self.vertices[dfi] = vertex
+ -- set the dfs infos in the vertex
+ vertex.dfi = dfi
+ vertex.dfsparent = parent
+ vertex.leastancestor = dfi
+ vertex.lowpoint = dfi
+ -- find neighbors
+ for _, arc in ipairs(self.inputgraph:outgoing(inputvertex)) do
+ local ninputvertex = arc.head
+ assert(ninputvertex ~= inputvertex, "Self-loop detected!")
+ local nvertex = self.verticesbyinputvertex[ninputvertex]
+ if nvertex.dfi == nil then
+ -- new vertex discovered
+ self:predfs(ninputvertex, vertex) -- recursive call
+ vertex.lowpoint = math.min(vertex.lowpoint, nvertex.lowpoint)
+ elseif parent and ninputvertex ~= parent.inputvertex then
+ -- back edge found
+ vertex.leastancestor = math.min(vertex.leastancestor, nvertex.dfi)
+ vertex.lowpoint = math.min(vertex.lowpoint, nvertex.dfi)
+ end
+ end
+ -- put vertex into lowpoint sort bucket
+ table.insert(self.verticesbylowpoint[vertex.lowpoint], vertex)
+end
+
+-- the preprocessing at the beginning of the algorithm
+-- does the depth-first search and the bucket sort for the child lists
+function BM:preprocess()
+ -- make dfs starting at an arbitrary vertex
+ self:predfs(self.inputgraph.vertices[1])
+ -- create separated child lists with bucket sort
+ for i = 1, self.numvertices do
+ for _, vertex in ipairs(self.verticesbylowpoint[i]) do
+ if vertex.dfsparent then
+ vertex.childlistelement
+ = vertex.dfsparent.childlist:addback(vertex)
+ end
+ end
+ end
+end
+
+-- adds tree edges and the corresponding virtual root vertices
+-- of the currentvertex
+function BM:add_trivial_edges(vertex)
+ -- find all dfs children
+ for _, arc in ipairs(self.inputgraph:outgoing(vertex.inputvertex)) do
+ local nvertex = self.verticesbyinputvertex[arc.head]
+ if nvertex.dfsparent == vertex then
+ -- create root vertex
+ local rootvertex = {
+ isroot = true,
+ rootparent = vertex,
+ rootchild = nvertex,
+ adjlistlinks = {},
+ name = tostring(vertex) .. "^" .. tostring(nvertex)
+ }
+ setmetatable(rootvertex, Embedding.vertexmetatable)
+ nvertex.parentroot = rootvertex
+ -- create half edges
+ local halfedge1 = {target = nvertex, links = {}}
+ local halfedge2 = {target = rootvertex, links = {}}
+ halfedge1.twin = halfedge2
+ halfedge2.twin = halfedge1
+ -- create circular adjacency lists
+ halfedge1.links[0] = halfedge1
+ halfedge1.links[1] = halfedge1
+ halfedge2.links[0] = halfedge2
+ halfedge2.links[1] = halfedge2
+ -- create links to adjacency lists
+ rootvertex.adjlistlinks[0] = halfedge1
+ rootvertex.adjlistlinks[1] = halfedge1
+ nvertex.adjlistlinks[0] = halfedge2
+ nvertex.adjlistlinks[1] = halfedge2
+ end
+ end
+end
+
+-- for the external face vertex which was entered through link vin
+-- returns the successor on the external face and the link through
+-- which it was entered
+local function get_successor_on_external_face(vertex, vin)
+ local halfedge = vertex.adjlistlinks[1 - vin]
+ local svertex = halfedge.target
+ local sin
+ if vertex.adjlistlinks[0] == vertex.adjlistlinks[1] then
+ sin = vin
+ elseif svertex.adjlistlinks[0].twin == halfedge then
+ sin = 0
+ else
+ sin = 1
+ end
+ return svertex, sin
+end
+
+-- the "walkup", used to identify the pertinent subgraph,
+-- i. e. the subgraph that contains end points of backedges
+-- for one backedge this function will mark all virtual roots
+-- as pertinent that lie on the path between the backedge and the current vertex
+-- backvertex: a vertex that is an endpoint of a backedge to the current vertex
+-- currentvertex: the vertex of the current step
+-- returns a root vertex of the current step, if one was found
+local function walkup(backvertex, currentvertex)
+ local currentindex = currentvertex.dfi
+ -- set the backedgeflag
+ backvertex.backedgeindex = currentindex
+ -- initialize traversal variables for both directions
+ local x, xin, y, yin = backvertex, 1, backvertex, 0
+ while x ~= currentvertex do
+ if x.visited == currentindex or y.visited == currentindex then
+ -- we found a path that already has the pertinent roots marked
+ return nil
+ end
+ -- mark vertices as visited for later calls
+ x.visited = currentindex
+ y.visited = currentindex
+
+ -- check for rootvertex
+ local rootvertex
+ if x.isroot then
+ rootvertex = x
+ elseif y.isroot then
+ rootvertex = y
+ end
+ if rootvertex then
+ local rootchild = rootvertex.rootchild
+ local rootparent = rootvertex.rootparent
+ if rootvertex.rootparent == currentvertex then
+ -- we found the other end of the back edge
+ return rootvertex
+ elseif rootchild.lowpoint < currentindex then
+ -- the block we just traversed is externally active
+ rootvertex.pertinentrootselement
+ = rootparent.pertinentroots:addback(rootvertex)
+ else
+ -- the block we just traversed is internally active
+ rootvertex.pertinentrootselement
+ = rootparent.pertinentroots:addfront(rootvertex)
+ end
+ -- jump to parent block
+ x, xin, y, yin = rootvertex.rootparent, 1, rootvertex.rootparent, 0
+ else
+ -- just continue on the external face
+ x, xin = get_successor_on_external_face(x, xin)
+ y, yin = get_successor_on_external_face(y, yin)
+ end
+ end
+end
+
+-- inverts the adjacency of a vertex
+-- i. e. reverses the order of the adjacency list and flips the links
+local function invert_adjacency(vertex)
+ -- reverse the list
+ for halfedge in Embedding.adjacency_iterator(vertex.adjlistlinks[0]) do
+ halfedge.links[0], halfedge.links[1]
+ = halfedge.links[1], halfedge.links[0]
+ end
+ -- flip links
+ vertex.adjlistlinks[0], vertex.adjlistlinks[1]
+ = vertex.adjlistlinks[1], vertex.adjlistlinks[0]
+end
+
+-- merges two blocks by merging the virtual root of the child block
+-- into it's parent, while making sure the external face stays consistent
+-- by flipping the root block if needed
+-- mergeinfo contains four fields:
+-- root - the virtual root vertex
+-- parent - it's parent
+-- rout - the link of the root through which we have exited it
+-- during the walkdown
+-- pin - the link of the parent through which we have entered it
+-- during the walkdown
+local function mergeblocks(mergeinfo)
+ local root = mergeinfo.root
+ local parent = mergeinfo.parent
+ local rout = mergeinfo.rootout
+ local pin = mergeinfo.parentin
+ if pin == rout then
+ -- flip required
+ invert_adjacency(root)
+ root.rootchild.sign = -1
+ --rout = 1 - rout -- not needed
+ end
+
+ -- redirect edges of the root vertex
+ for halfedge in Embedding.adjacency_iterator(root.adjlistlinks[0]) do
+ halfedge.twin.target = parent
+ end
+
+ -- remove block from data structures
+ root.rootchild.parentroot = nil
+ parent.pertinentroots:remove(root.pertinentrootselement)
+ parent.childlist:remove(root.rootchild.childlistelement)
+
+ -- merge adjacency lists
+ parent.adjlistlinks[0].links[1] = root.adjlistlinks[1]
+ parent.adjlistlinks[1].links[0] = root.adjlistlinks[0]
+ root.adjlistlinks[0].links[1] = parent.adjlistlinks[1]
+ root.adjlistlinks[1].links[0] = parent.adjlistlinks[0]
+ parent.adjlistlinks[pin] = root.adjlistlinks[pin]
+end
+
+-- inserts a half edge pointing to "to" into the adjacency list of "from",
+-- replacing the link "linkindex"
+local function insert_half_edge(from, linkindex, to)
+ local halfedge = {target = to, links = {}}
+ halfedge.links[ linkindex] = from.adjlistlinks[ linkindex]
+ halfedge.links[1 - linkindex] = from.adjlistlinks[1 - linkindex]
+ from.adjlistlinks[ linkindex].links[1 - linkindex] = halfedge
+ from.adjlistlinks[1 - linkindex].links[ linkindex] = halfedge
+ from.adjlistlinks[linkindex] = halfedge
+ return halfedge
+end
+
+-- connect the vertices x and y through the links xout and yin
+-- if shortcircuit is true, the edge will be marked as a short circuit edge
+-- and removed at the end of the algorithm
+function BM:embed_edge(x, xout, y, yin, shortcircuit)
+ -- create half edges
+ local halfedgex = insert_half_edge(x, xout, y)
+ local halfedgey = insert_half_edge(y, yin, x)
+ halfedgex.twin = halfedgey
+ halfedgey.twin = halfedgex
+ -- short circuit handling
+ if shortcircuit then
+ halfedgex.shortcircuit = true
+ halfedgey.shortcircuit = true
+ table.insert(self.shortcircuitedges, halfedgex)
+ table.insert(self.shortcircuitedges, halfedgey)
+ end
+end
+
+-- returns true if the given vertex is pertinent at the current step
+local function pertinent(vertex, currentindex)
+ return vertex.backedgeindex == currentindex
+ or not vertex.pertinentroots:empty()
+end
+
+-- returns ttue if the given vertex is externally active at the current step
+local function externally_active(vertex, currentindex)
+ return vertex.leastancestor < currentindex
+ or (not vertex.childlist:empty()
+ and vertex.childlist:first().lowpoint < currentindex)
+end
+
+-- the "walkdown", which merges the pertinent subgraph and embeds
+-- back and short circuit edges
+-- childrootvertex - a root vertex of the current vertex
+-- which the walkdown will start at
+-- currentvertex - the vertex of the current step
+function BM:walkdown(childrootvertex, currentvertex)
+ local currentindex = currentvertex.dfi
+ local mergestack = {}
+ local numinsertededges = 0 -- to return the number for count check
+ -- two walkdowns into both directions
+ for vout = 0,1 do
+ -- initialize the traversal variables
+ local w, win = get_successor_on_external_face(childrootvertex, 1 - vout)
+ while w ~= childrootvertex do
+ if w.backedgeindex == currentindex then
+ -- we found a backedge endpoint
+ -- merge all pertinent roots we found
+ while #mergestack > 0 do
+ mergeblocks(table.remove(mergestack))
+ end
+ -- embed the back edge
+ self:embed_edge(childrootvertex, vout, w, win)
+ numinsertededges = numinsertededges + 1
+ w.backedgeindex = 0 -- this shouldn't be necessary
+ end
+ if not w.pertinentroots:empty() then
+ -- we found a pertinent vertex with child blocks
+ -- create merge info for the later merge
+ local mergeinfo = {}
+ mergeinfo.parent = w
+ mergeinfo.parentin = win
+ local rootvertex = w.pertinentroots:first()
+ mergeinfo.root = rootvertex
+ -- check both directions for active vertices
+ local x, xin = get_successor_on_external_face(rootvertex, 1)
+ local y, yin = get_successor_on_external_face(rootvertex, 0)
+ local xpertinent = pertinent(x, currentindex)
+ local xexternallyactive = externally_active(x, currentindex)
+ local ypertinent = pertinent(y, currentindex)
+ local yexternallyactive = externally_active(y, currentindex)
+ -- chose the direction with the best vertex
+ if xpertinent and not xexternallyactive then
+ w, win = x, xin
+ mergeinfo.rootout = 0
+ elseif ypertinent and not yexternallyactive then
+ w, win = y, yin
+ mergeinfo.rootout = 1
+ elseif xpertinent then
+ w, win = x, xin
+ mergeinfo.rootout = 0
+ else
+ w, win = y, yin
+ mergeinfo.rootout = 1
+ end
+ -- this is what the paper sais, but it might cause problems
+ -- not sure though...
+ --[[if w == x then
+ mergeinfo.rootout = 0
+ else
+ mergeinfo.rootout = 1
+ end--]]
+ table.insert(mergestack, mergeinfo)
+ elseif not pertinent(w, currentindex)
+ and not externally_active(w, currentindex) then
+ -- nothing to see here, just continue on the external face
+ w, win = get_successor_on_external_face(w, win)
+ else
+ -- this is a stopping vertex, walkdown will end here
+ -- paper puts this into the if,
+ -- but this should always be the case, i think
+ assert(childrootvertex.rootchild.lowpoint < currentindex)
+ if #mergestack == 0 then
+ -- we're in the block we started at, so we embed a back edge
+ self:embed_edge(childrootvertex, vout, w, win, true)
+ end
+ break
+ end
+ end
+ if #mergestack > 0 then
+ -- this means, there is a pertinent vertex blocked by stop vertices,
+ -- so the graph is not planar and we can skip the second walkdown
+ break
+ end
+ end
+ return numinsertededges
+end
+
+-- embeds the back edges for the current vertex
+-- walkup and walkdown are called from here
+-- returns true, if all back edges could be embedded
+function BM:add_back_edges(vertex)
+ local pertinentroots = {} -- not in the paper
+ local numbackedges = 0
+ -- find all back edges to vertices with lower dfi
+ for _, arc in ipairs(self.inputgraph:outgoing(vertex.inputvertex)) do
+ local nvertex = self.verticesbyinputvertex[arc.head]
+ if nvertex.dfi > vertex.dfi
+ and nvertex.dfsparent ~= vertex
+ and nvertex ~= vertex.dfsparent then
+ numbackedges = numbackedges + 1
+ -- do the walkup
+ local rootvertex = walkup(nvertex, vertex)
+ if rootvertex then
+ -- remember the root vertex the walkup found, so we don't
+ -- have to call the walkdown for all root vertices
+ -- (or even know what the root vertices are)
+ table.insert(pertinentroots, rootvertex)
+ end
+ end
+ end
+ -- for all root vertices the walkup found
+ local insertededges = 0
+ while #pertinentroots > 0 do
+ -- do the walkdown
+ insertededges = insertededges
+ + self:walkdown(table.remove(pertinentroots), vertex)
+ end
+ if insertededges ~= numbackedges then
+ -- not all back edges could be embedded -> graph is not planar
+ return false
+ end
+ return true
+end
+
+-- the depth-first search of the postprocessing
+-- flips the blocks according to the sign field
+function BM:postdfs(vertex, sign)
+ sign = sign or 1
+ local root = vertex.parentroot
+ if root then
+ sign = 1
+ else
+ sign = sign * vertex.sign
+ end
+
+ if sign == -1 then
+ -- number of flips is odd, so we need to flip here
+ invert_adjacency(vertex)
+ end
+
+ -- for all dfs children
+ for _, arc in ipairs(self.inputgraph:outgoing(vertex.inputvertex)) do
+ local nvertex = self.verticesbyinputvertex[arc.head]
+ if nvertex.dfsparent == vertex then
+ -- recursive call
+ self:postdfs(nvertex, sign)
+ end
+ end
+end
+
+-- the postprocessing at the end of the algorithm
+-- calls the post depth-first search,
+-- removes the short circuit edges from the adjacency lists,
+-- adjusts the links of the vertices,
+-- merges root vertices
+-- and cleans up the vertices
+function BM:postprocess()
+ -- flip components
+ self:postdfs(self.vertices[1])
+
+ -- unlink the short circuit edges
+ for _, halfedge in ipairs(self.shortcircuitedges) do
+ halfedge.links[0].links[1] = halfedge.links[1]
+ halfedge.links[1].links[0] = halfedge.links[0]
+ end
+
+ -- vertex loop
+ local rootvertices = {}
+ local edgetoface = {}
+ for _, vertex in ipairs(self.vertices) do
+ -- check for root vertex and save it
+ local root = vertex.parentroot
+ if root then
+ table.insert(rootvertices, root)
+ end
+
+ -- clean up links and create adjacency matrix
+ local link = vertex.adjlistlinks[0]
+ local adjmat = {}
+ vertex.adjmat = adjmat
+ if link then
+ -- make sure the link points to a half edge
+ -- that is no short circuit edge
+ while link.shortcircuit do
+ link = link.links[0]
+ end
+ -- create link
+ vertex.link = link
+
+ -- create adjacency matrix
+ for halfedge in Embedding.adjacency_iterator(link) do
+ setmetatable(halfedge, Embedding.halfedgemetatable)
+ local target = halfedge.target
+ if target.isroot then
+ target = target.rootparent
+ end
+ adjmat[target] = halfedge
+ end
+ end
+
+ -- clean up vertex
+ vertex.sign = nil
+ vertex.childlist = nil
+ vertex.adjlistlinks = nil
+ vertex.pertinentroots = nil
+ vertex.dfi = nil
+ vertex.dfsparent = nil
+ vertex.leastancestor = nil
+ vertex.lowpoint = nil
+ vertex.parentroot = nil
+ end
+
+ -- root vertex loop
+ for _, root in ipairs(rootvertices) do
+ -- make sure the links point to a half edges
+ -- that are no short circuit edge
+ local link = root.adjlistlinks[0]
+ while link.shortcircuit do
+ link = link.links[0]
+ end
+
+ -- merge into parent
+ local rootparent = root.rootparent
+ local parentlink = rootparent.link
+ local adjmat = rootparent.adjmat
+ for halfedge in Embedding.adjacency_iterator(link) do
+ setmetatable(halfedge, Embedding.halfedgemetatable)
+ halfedge.twin.target = rootparent
+ adjmat[halfedge.target] = halfedge
+ end
+ if parentlink == nil then
+ assert(rootparent.link == nil)
+ rootparent.link = link
+ else
+ -- merge adjacency lists
+ parentlink.links[0].links[1] = link
+ link.links[0].links[1] = parentlink
+ local tmp = link.links[0]
+ link.links[0] = parentlink.links[0]
+ parentlink.links[0] = tmp
+ end
+ end
+end
+
+-- the entry point of the algorithm
+-- returns the array of vertices
+-- the vertices now only contain the inputvertex field
+-- and a field named "link" which contains an arbitrary half edge
+-- from the respective adjacency list
+-- the adjacency lists are in a circular order in respect to the plane graph
+function BM:run()
+ self:preprocess()
+ -- main loop over all vertices from lowest dfi to highest
+ for i = self.numvertices, 1, -1 do
+ local vertex = self.vertices[i]
+ self:add_trivial_edges(vertex)
+ if not self:add_back_edges(vertex) then
+ -- graph not planar
+ return nil
+ end
+ end
+ self:postprocess()
+ local embedding = Embedding.new()
+ embedding.vertices = self.vertices
+ return embedding
+end
+
+return BM
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/Embedding.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/Embedding.lua
new file mode 100644
index 00000000000..50fc3672207
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/Embedding.lua
@@ -0,0 +1,787 @@
+local E = {}
+
+require("pgf.gd.planar").Embedding = E
+
+-- includes
+local LinkedList = require("pgf.gd.planar.LinkedList")
+
+E.vertexmetatable = {
+ __tostring = function(v)
+ if v.name then
+ return v.name
+ elseif v.inputvertex then
+ return v.inputvertex.name
+ else
+ return tostring(v)
+ end
+ end
+}
+
+E.halfedgemetatable = {
+ __tostring = function(e)
+ return tostring(e.twin.target)
+ .. " -> "
+ .. tostring(e.target)
+ end
+}
+
+-- create class properties
+E.__index = E
+
+function E.new()
+ local t = {
+ vertices = {},
+ }
+ setmetatable(t, E)
+ return t
+end
+
+function E:add_vertex(name, inputvertex, virtual)
+ virtual = virtual or nil
+ local vertex = {
+ adjmat = {},
+ name = name,
+ inputvertex = inputvertex,
+ virtual = virtual,
+ }
+ setmetatable(vertex, E.vertexmetatable)
+ table.insert(self.vertices, vertex)
+ return vertex
+end
+
+function E:add_edge(v1, v2, after1, after2, virtual)
+ assert(v1.link == nil or v1 == after1.twin.target)
+ assert(v2.link == nil or v2 == after2.twin.target)
+ assert(v1.adjmat[v2] == nil)
+ assert(v2.adjmat[v1] == nil)
+
+ virtual = virtual or nil
+
+ local halfedge1 = {
+ target = v2,
+ virtual = virtual,
+ links = {},
+ }
+ local halfedge2 = {
+ target = v1,
+ virtual = virtual,
+ links = {},
+ }
+ halfedge1.twin = halfedge2
+ halfedge2.twin = halfedge1
+
+ setmetatable(halfedge1, E.halfedgemetatable)
+ setmetatable(halfedge2, E.halfedgemetatable)
+
+ if v1.link == nil then
+ v1.link = halfedge1
+ halfedge1.links[0] = halfedge1
+ halfedge1.links[1] = halfedge1
+ else
+ halfedge1.links[0] = after1.links[0]
+ after1.links[0].links[1] = halfedge1
+ halfedge1.links[1] = after1
+ after1.links[0] = halfedge1
+ end
+
+ if v2.link == nil then
+ v2.link = halfedge2
+ halfedge2.links[0] = halfedge2
+ halfedge2.links[1] = halfedge2
+ else
+ halfedge2.links[0] = after2.links[0]
+ after2.links[0].links[1] = halfedge2
+ halfedge2.links[1] = after2
+ after2.links[0] = halfedge2
+ end
+
+ v1.adjmat[v2] = halfedge1
+ v2.adjmat[v1] = halfedge2
+
+ return halfedge1, halfedge2
+end
+
+function E:remove_virtual()
+ local virtuals = {}
+ for i, v in ipairs(self.vertices) do
+ if v.virtual then
+ table.insert(virtuals, i)
+ else
+ local start = v.link
+ local current = start
+ repeat
+ current = current.links[0]
+ if current.virtual then
+ current.links[0].links[1] = current.links[1]
+ current.links[1].links[0] = current.links[0]
+ v.adjmat[current.target] = nil
+ current.target.adjmat[v] = nil
+ end
+ until current == start
+ end
+ end
+ for i = #virtuals, 1, -1 do
+ self.vertices[virtuals[i]] = self.vertices[#self.vertices]
+ table.remove(self.vertices)
+ end
+end
+
+-- for the use in for-loops
+-- iterates over the adjacency list of a vertex
+-- given a half edge to start and a direction (0 or 1, default 0)
+function E.adjacency_iterator(halfedge, direction)
+ direction = direction or 0
+ local function next_edge(startedge, prevedge)
+ if prevedge == nil then
+ return startedge
+ else
+ local nextedge = prevedge.links[direction]
+ if nextedge ~= startedge then
+ return nextedge
+ else
+ return nil
+ end
+ end
+ end
+ return next_edge, halfedge, nil
+end
+
+function E.face_iterator(halfedge, direction)
+ direction = direction or 0
+ local function next_edge(startedge, prevedge)
+ if prevedge == nil then
+ return startedge
+ else
+ local nextedge = prevedge.twin.links[1 - direction]
+ if nextedge ~= startedge then
+ return nextedge
+ else
+ return nil
+ end
+ end
+ end
+ return next_edge, halfedge, nil
+end
+
+function E:triangulate()
+ local visited = {}
+ for _, vertex in ipairs(self.vertices) do
+ for start in E.adjacency_iterator(vertex.link) do
+ if not visited[start] then
+ local prev = start
+ local beforestart = start.links[0].twin
+ local current = start.twin.links[1]
+ local next = current.twin.links[1]
+ visited[start] = true
+ visited[current] = true
+ visited[next] = true
+ while next ~= beforestart do
+ local halfedge1, halfedge2
+ if vertex ~= current.target
+ and not vertex.adjmat[current.target] then
+ halfedge1, halfedge2 = self:add_edge(
+ vertex, current.target,
+ prev, next,
+ true
+ )
+
+ prev = halfedge1
+ current = next
+ next = next.twin.links[1]
+ elseif not prev.target.adjmat[next.target] then
+ halfedge1, halfedge2 = self:add_edge(
+ prev.target, next.target,
+ current, next.twin.links[1],
+ true
+ )
+
+ current = halfedge1
+ next = halfedge2.links[1]
+ else
+ local helper = next.twin.links[1]
+ halfedge1, halfedge2 = self:add_edge(
+ current.target, helper.target,
+ next, helper.twin.links[1],
+ true
+ )
+
+ next = halfedge1
+ end
+
+ visited[next] = true
+ visited[halfedge1] = true
+ visited[halfedge2] = true
+ end
+ end
+ end
+ end
+end
+
+function E:canonical_order(v1, v2, vn)
+ local n = #self.vertices
+ local order = { v1 }
+ local marks = { [v1] = "ordered", [v2] = 0 }
+ local visited = {}
+ local vk = v1
+ local candidates = LinkedList.new()
+ local listelements = {}
+ for k = 1, n-2 do
+ for halfedge in E.adjacency_iterator(vk.link) do
+ local vertex = halfedge.target
+ if vertex ~= vn then
+ local twin = halfedge.twin
+ visited[twin] = true
+ if marks[vertex] == nil then
+ marks[vertex] = "visited"
+ elseif marks[vertex] ~= "ordered" then
+ local neighbor1 = visited[twin.links[0]]
+ local neighbor2 = visited[twin.links[1]]
+ if marks[vertex] == "visited" then
+ if neighbor1 or neighbor2 then
+ marks[vertex] = 1
+ listelements[vertex] = candidates:addback(vertex)
+ else
+ marks[vertex] = 2
+ end
+ else
+ if neighbor1 == neighbor2 then
+ if neighbor1 and neighbor2 then
+ marks[vertex] = marks[vertex] - 1
+ else
+ marks[vertex] = marks[vertex] + 1
+ end
+ if marks[vertex] == 1 then
+ listelements[vertex]
+ = candidates:addback(vertex)
+ elseif listelements[vertex] then
+ candidates:remove(listelements[vertex])
+ listelements[vertex] = nil
+ end
+ end
+ end
+ end
+ end
+ end
+ vk = candidates:popfirst()
+ order[k+1] = vk
+ marks[vk] = "ordered"
+ end
+ order[n] = vn
+ return order
+end
+
+function E:get_biggest_face()
+ local number = 0
+ local edge
+ local visited = {}
+ for _, vertex in ipairs(self.vertices) do
+ for start in E.adjacency_iterator(vertex.link) do
+ local count = 0
+ if not visited[start] then
+ visited[start] = true
+ local current = start
+ repeat
+ count = count + 1
+ current = current.twin.links[1]
+ until current == start
+ if count > number then
+ number = count
+ edge = start
+ end
+ end
+ end
+ end
+ return edge, number
+end
+
+function E:surround_by_triangle(faceedge, facesize)
+ local divisor = 3
+ if facesize > 3 then
+ divisor = 4
+ end
+ local basenodes = math.floor(facesize / divisor)
+ local extranodes = facesize % divisor
+ local attachnodes = { basenodes, basenodes, basenodes }
+ if facesize > 3 then
+ attachnodes[2] = basenodes * 2
+ end
+ for i = 1,extranodes do
+ attachnodes[i] = attachnodes[i] + 1
+ end
+
+ local v = {
+ self:add_vertex("$v_1$", nil, true),
+ self:add_vertex("$v_n$", nil, true),
+ self:add_vertex("$v_2$", nil, true)
+ }
+ for i = 1,3 do
+ local currentv = v[i]
+ local nextv = v[i % 3 + 1]
+ self:add_edge(currentv, nextv, currentv.link, nextv.link, true)
+ end
+
+ local current = faceedge
+ local next = current.twin.links[1]
+ for i = 1,3 do
+ local vertex = v[i]
+ local otheredge = vertex.adjmat[v[i % 3 + 1]]
+ local previnserted = otheredge.links[1]
+ for count = 1, attachnodes[i] do
+ if not vertex.adjmat[current.target] then
+ previnserted, _ = self:add_edge(vertex, current.target,
+ previnserted, next,
+ true
+ )
+ end
+
+ current = next
+ next = next.twin.links[1]
+ end
+ if not vertex.adjmat[current.target] then
+ previnserted, _ = self:add_edge(
+ vertex, current.target,
+ previnserted, next,
+ true
+ )
+ current = previnserted
+ end
+ end
+ return v[1], v[3], v[2]
+end
+
+function E:improve()
+ local pairdata = {}
+ local inpair = {}
+ for i, v1 in ipairs(self.vertices) do
+ for j = i + 1, #self.vertices do
+ local v2 = self.vertices[j]
+ local pd = self:find_pair_components(v1, v2)
+ if pd then
+ inpair[v1] = true
+ inpair[v2] = true
+ table.insert(pairdata, pd)
+ end
+ end
+ if not inpair[v1] then
+ local pd = self:find_pair_components(v1, nil)
+ if pd then
+ inpair[v1] = true
+ table.insert(pairdata, pd)
+ end
+ end
+ end
+
+ local changed
+ local runs = 1
+ local edgepositions = {}
+ repeat
+ changed = false
+ for i, pd in ipairs(pairdata) do
+ self:improve_separation_pair(pd)
+ end
+ -- check for changes
+ for i, v in ipairs(self.vertices) do
+ local start = v.link
+ local current = start
+ local counter = 1
+ repeat
+ if counter ~= edgepositions[current] then
+ changed = true
+ edgepositions[current] = counter
+ end
+ counter = counter + 1
+ current = current.links[0]
+ until current == start
+ end
+ runs = runs + 1
+ until changed == false or runs > 100
+end
+
+function E:find_pair_components(v1, v2)
+ local visited = {}
+ local companchors = {}
+ local edgecomps = {}
+ local compvertices = {}
+ local islinear = {}
+ local edgeindices = {}
+
+ local pair = { v1, v2 }
+ local start = v1.link
+ local current = start
+ local edgeindex = 1
+ -- start searches from v1
+ repeat
+ edgeindices[current] = edgeindex
+ edgeindex = edgeindex + 1
+ if not edgecomps[current] then
+ local compindex = #companchors + 1
+ local ca, il
+ edgecomps[current] = compindex
+ compvertices[compindex] = {}
+ local target = current.target
+ if target == v2 then
+ edgecomps[current.twin] = compindex
+ ca = 3
+ il = true
+ else
+ ca, il = self:component_dfs(
+ target,
+ pair,
+ visited,
+ edgecomps,
+ compvertices[compindex],
+ compindex
+ )
+ end
+ companchors[compindex] = ca
+ islinear[compindex] = il
+ end
+ current = current.links[0]
+ until current == start
+
+ if v2 then
+ start = v2.link
+ current = start
+ local lastincomp = true
+ local edgeindex = 1
+ -- now find the remaining blocks at v2
+ repeat
+ edgeindices[current] = edgeindex
+ edgeindex = edgeindex + 1
+ if not edgecomps[current] then
+ local compindex = #companchors + 1
+ edgecomps[current] = compindex
+ compvertices[compindex] = {}
+ self:component_dfs(
+ current.target,
+ pair,
+ visited,
+ edgecomps,
+ compvertices[compindex],
+ compindex
+ )
+ companchors[compindex] = 2
+ end
+ current = current.links[0]
+ until current == start
+ end
+
+ -- init compedges, tricomps, twocomps
+ local tricomps = {}
+ local twocomps = {{}, {}}
+ for i, anchors in ipairs(companchors) do
+ if anchors == 3 then
+ table.insert(tricomps, i)
+ else
+ table.insert(twocomps[anchors], i)
+ end
+ end
+
+ local flipimmune = #tricomps == 2
+ and (islinear[tricomps[1]] or islinear[tricomps[2]])
+ if (#tricomps < 2 or flipimmune)
+ and (v2 ~= nil or #twocomps[1] < 2) then
+ return nil
+ end
+
+ -- order tri comps cyclic
+ local function sorter(a, b)
+ return #compvertices[a] < #compvertices[b]
+ end
+
+ table.sort(tricomps, sorter)
+
+ -- determine order of comps
+ local numtricomps = #tricomps
+ local comporder = { {}, {} }
+ local bottom = math.ceil(numtricomps / 2)
+ local top = bottom + 1
+ for i, comp in ipairs(tricomps) do
+ if i % 2 == 1 then
+ comporder[1][bottom] = comp
+ comporder[2][numtricomps - bottom + 1] = comp
+ bottom = bottom - 1
+ else
+ comporder[1][top] = comp
+ comporder[2][numtricomps - top + 1] = comp
+ top = top + 1
+ end
+ end
+
+ local pairdata = {
+ pair = pair,
+ companchors = companchors,
+ edgecomps = edgecomps,
+ edgeindices = edgeindices,
+ compvertices = compvertices,
+ tricomps = tricomps,
+ twocomps = twocomps,
+ comporder = comporder,
+ }
+ return pairdata
+end
+
+function E:component_dfs(v, pair, visited, edgecomps, compvertices, compindex)
+ visited[v] = true
+ local start = v.link
+ local current = start
+ local companchors = 1
+ local numedges = 0
+ local islinear = true
+ table.insert(compvertices, v)
+ repeat
+ numedges = numedges + 1
+ local target = current.target
+ if target == pair[1] or target == pair[2] then
+ edgecomps[current.twin] = compindex
+ if target == pair[2] then
+ companchors = 3
+ end
+ elseif not visited[target] then
+ local ca, il = self:component_dfs(
+ target,
+ pair,
+ visited,
+ edgecomps,
+ compvertices,
+ compindex
+ )
+ if ca == 3 then
+ companchors = 3
+ end
+ islinear = islinear and il
+ end
+ current = current.links[0]
+ until current == start
+ return companchors, islinear and numedges == 2
+end
+
+function E:improve_separation_pair(pairdata)
+ local pair = pairdata.pair
+ local companchors = pairdata.companchors
+ local edgecomps = pairdata.edgecomps
+ local edgeindices = pairdata.edgeindices
+ local compvertices = pairdata.compvertices
+ local tricomps = pairdata.tricomps
+ local twocomps = pairdata.twocomps
+ local comporder = pairdata.comporder
+ local v1 = pair[1]
+ local v2 = pair[2]
+
+ local compedges = {}
+ for i = 1, #companchors do
+ compedges[i] = {{}, {}}
+ end
+
+ local numtricomps = #tricomps
+ local numtwocomps = { #twocomps[1], #twocomps[2] }
+
+ -- find compedges
+ for i = 1, #pair do
+ -- first find an edge that is the first of a triconnected component
+ local start2
+ if v2 then
+ start = pair[i].link
+ current = start
+ local last
+ repeat
+ local comp = edgecomps[current]
+ if companchors[comp] == 3 then
+ if last == nil then
+ last = comp
+ elseif last ~= comp then
+ start2 = current
+ break
+ end
+ end
+ current = current.links[0]
+ until current == start
+ else
+ start2 = pair[i].link
+ end
+ -- now list the edges by components
+ current = start2
+ repeat
+ table.insert(compedges[edgecomps[current]][i], current)
+ current = current.links[0]
+ until current == start2
+ end
+
+ -- count edges on each side of tri comps
+ local edgecount = {}
+ for _, comp in ipairs(tricomps) do
+ edgecount[comp] = {}
+ for i = 1, #pair do
+ local count = 1
+ local current = compedges[comp][i][1]
+ local other = pair[3 - i]
+ while current.target ~= other do
+ count = count + 1
+ current = current.twin.links[0]
+ end
+ edgecount[comp][i] = count
+ end
+ end
+
+ -- determine which comps have to be flipped
+ local flips = {}
+ local numflips = 0
+ local allflipped = true
+ for i, comp in ipairs(comporder[1]) do
+ local side1, side2
+ if i > numtricomps / 2 then
+ side1 = edgecount[comp][1]
+ side2 = edgecount[comp][2]
+ else
+ side1 = edgecount[comp][2]
+ side2 = edgecount[comp][1]
+ end
+ if side1 > side2 then
+ numflips = numflips + 1
+ flips[comp] = true
+ elseif side1 < side2 then
+ allflipped = false
+ end
+ end
+
+ if allflipped then
+ for i, comp in ipairs(tricomps) do
+ flips[comp] = false
+ end
+ else
+ for i, comp in ipairs(tricomps) do
+ if flips[comp] then
+ for _, v in ipairs(compvertices[comp]) do
+ local start = v.link
+ local current = start
+ repeat
+ current.links[0], current.links[1]
+ = current.links[1], current.links[0]
+ current = current.links[1]
+ until current == start
+ end
+ end
+ end
+ end
+
+ -- order edges cyclic per component (one cycle for all tri comps)
+ for i = 1, #pair do
+ if v2 then
+ local co
+ if allflipped then
+ co = comporder[3 - i]
+ else
+ co = comporder[i]
+ end
+
+ local id = co[numtricomps]
+ lastedges = compedges[id][i]
+ if flips[id] then
+ lastedge = lastedges[1]
+ else
+ lastedge = lastedges[#lastedges]
+ end
+
+ -- tri comps
+ for _, id in ipairs(co) do
+ local edges = compedges[id][i]
+ local from
+ local to
+ local step
+ if flips[id] then
+ from = #edges
+ to = 1
+ step = -1
+ else
+ from = 1
+ to = #edges
+ step = 1
+ end
+ for k = from, to, step do
+ local edge = edges[k]
+ lastedge.links[0] = edge
+ edge.links[1] = lastedge
+ lastedge = edge
+ end
+ end
+ end
+
+ -- two comps
+ for _, id in ipairs(twocomps[i]) do
+ lastedges = compedges[id][i]
+ lastedge = lastedges[#lastedges]
+ for _, edge in ipairs(compedges[id][i]) do
+ lastedge.links[0] = edge
+ edge.links[1] = lastedge
+ lastedge = edge
+ end
+ end
+ end
+
+ -- now merge the cycles
+ for i = 1, #pair do
+ local outeredges = {}
+ -- find the biggest face of the tri comps
+ if v2 then
+ local biggestedge
+ local biggestsize
+ local biggestindex
+ local start = compedges[tricomps[1]][i][1]
+ local current = start
+ repeat
+ local size = self:get_face_size(current)
+ if not biggestedge or size > biggestsize
+ or (size == biggestsize
+ and edgeindices[current] > biggestindex) then
+ biggestedge = current
+ biggestsize = size
+ biggestindex = edgeindices[current]
+ end
+ current = current.links[0]
+ until current == start
+ outeredges[1] = biggestedge
+ end
+
+ -- now for every two comp
+ for _, id in ipairs(twocomps[i]) do
+ local biggestedge
+ local biggestsize
+ local biggestindex
+ local start = compedges[id][i][1]
+ local current = start
+ repeat
+ local size = self:get_face_size(current)
+ if not biggestedge or size > biggestsize
+ or (size == biggestsize
+ and edgeindices[current] > biggestindex) then
+ biggestedge = current
+ biggestsize = size
+ biggestindex = edgeindices[current]
+ end
+ current = current.links[0]
+ until current == start
+ table.insert(outeredges, biggestedge)
+ end
+
+ -- now merge all comps at the outer edges
+ local lastedge = outeredges[#outeredges].links[0]
+ for _, edge in ipairs(outeredges) do
+ local nextlastedge = edge.links[0]
+ lastedge.links[1] = edge
+ edge.links[0] = lastedge
+ lastedge = nextlastedge
+ end
+ end
+end
+
+function E:get_face_size(halfedge)
+ local size = 0
+ local current = halfedge
+ repeat
+ size = size + 1
+ current = current.twin.links[1]
+ until current == halfedge
+ return size
+end
+
+return E
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/LinkedList.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/LinkedList.lua
new file mode 100644
index 00000000000..99a23501858
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/LinkedList.lua
@@ -0,0 +1,88 @@
+local LinkedList = {}
+
+LinkedList.__index = LinkedList
+
+function LinkedList.new()
+ local list = {elements = {}}
+ setmetatable(list, LinkedList)
+ return list
+end
+
+function LinkedList:addback(payload)
+ if payload == nil then
+ error("Need a payload!", 2)
+ end
+ local element = { payload = payload }
+ if self.head then
+ local tail = self.head.prev
+ self.head.prev = element
+ tail.next = element
+ element.next = self.head
+ element.prev = tail
+ else
+ self.head = element
+ element.next = element
+ element.prev = element
+ end
+ self.elements[element] = true
+ return element
+end
+
+function LinkedList:addfront(payload)
+ self.head = self:addback(payload)
+ return self.head
+end
+
+function LinkedList:remove(element)
+ if self.elements[element] == nil then
+ error("Element not in list!", 2)
+ end
+ if self.head == element then
+ if element.next == element then
+ self.head = nil
+ else
+ self.head = element.next
+ end
+ end
+ element.prev.next = element.next
+ element.next.prev = element.prev
+ self.elements[element] = nil
+end
+
+function LinkedList:popfirst()
+ if self.head == nil then
+ return nil
+ end
+ local element = self.head
+ if element.next == element then
+ self.head = nil
+ else
+ self.head = element.next
+ element.next.prev = element.prev
+ element.prev.next = element.next
+ end
+ self.elements[element] = nil
+ return element.payload
+end
+
+function LinkedList:poplast()
+ if self.head == nil then
+ return nil
+ end
+ self.head = self.head.prev
+ return self:popfirst()
+end
+
+function LinkedList:first()
+ return self.head and self.head.payload
+end
+
+function LinkedList:last()
+ return self.head and self.head.prev.payload
+end
+
+function LinkedList:empty()
+ return self.head == nil
+end
+
+return LinkedList
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/List.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/List.lua
new file mode 100644
index 00000000000..564216a8c37
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/List.lua
@@ -0,0 +1,49 @@
+local List = {}
+
+List.__index = List
+
+function List.new()
+ local t = {first = 0, last = -1}
+ setmetatable(t, List)
+ return t
+end
+
+function List:pushleft(value)
+ local first = self.first - 1
+ self.first = first
+ self[first] = value
+end
+
+function List:pushright(value)
+ local last = self.last + 1
+ self.last = last
+ self[last] = value
+end
+
+function List:popleft()
+ local first = self.first
+ if first > self.last then error("List is empty") end
+ local value = self[first]
+ self[first] = nil
+ self.first = first + 1
+ return value
+end
+
+function List:popright()
+ local last = self.last
+ if self.first > last then error("List is empty") end
+ local value = self[last]
+ self[last] = nil
+ self.last = last - 1
+ return value
+end
+
+function List:size()
+ return self.last - self.first + 1
+end
+
+function List:empty()
+ return self.last < self.first
+end
+
+return List
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PDP.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PDP.lua
new file mode 100644
index 00000000000..fbf94a52502
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PDP.lua
@@ -0,0 +1,576 @@
+
+local PDP = {}
+require("pgf.gd.planar").PDP = PDP
+
+-- Imports
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+local Storage = require "pgf.gd.lib.Storage"
+local Coordinate = require "pgf.gd.model.Coordinate"
+local Path = require "pgf.gd.model.Path"
+---
+PDP.__index = PDP
+
+function PDP.new(ugraph, embedding,
+ delta, gamma, coolingfactor,
+ expiterations,
+ startrepexp, endrepexp,
+ startattexp, endattexp,
+ appthreshold, stretchthreshold,
+ stresscounterthreshold,
+ numdivisions)
+ local t = {
+ ugraph = ugraph,
+ embedding = embedding,
+ delta = delta ,
+ gamma = gamma,
+ coolingfactor = coolingfactor,
+ expiterations = expiterations,
+ startrepexp = startrepexp,
+ endrepexp = endrepexp,
+ startattexp = startattexp,
+ endattexp = endattexp,
+ appthreshold = appthreshold,
+ stretchthreshold = stretchthreshold,
+ stresscounterthreshold = stresscounterthreshold,
+ numdivisions = numdivisions,
+ posxs = {},
+ posys = {},
+ cvsxs = {},
+ cvsys = {},
+ embeddingedges = {},
+ edgeids = {},
+ numedgeids = 0,
+ vertexids = {},
+ numvertexids = 0,
+ vertexpairs1 = {},
+ vertexpairs2 = {},
+ pairconnected = {},
+ edgepairsvertex = {},
+ edgepairsedge = {},
+ edgevertex1 = {},
+ edgevertex2 = {},
+ edgedeprecated = {},
+ subdivisionedges = {},
+ subdivisionvertices = {},
+ temperature = 1,
+ }
+
+ setmetatable(t, PDP)
+ return t
+end
+
+function PDP:run()
+ self:normalize_size()
+ self:find_force_pairs()
+
+ local delta = self.delta
+ local gamma = self.gamma
+ local coolingfactor = self.coolingfactor
+ local expiterations = self.expiterations
+ local startrepexp = self.startrepexp
+ local endattexp = self.endattexp
+ local startattexp = self.startattexp
+ local endrepexp = self.endrepexp
+
+ local vertexpairs1 = self.vertexpairs1
+ local vertexpairs2 = self.vertexpairs2
+ local pairconnected = self.pairconnected
+ local edgepairsvertex = self.edgepairsvertex
+ local edgepairsedge = self.edgepairsedge
+ local edgevertex1 = self.edgevertex1
+ local edgevertex2 = self.edgevertex2
+ local edgedeprecated = self.edgedeprecated
+
+ local forcexs = {}
+ local forceys = {}
+ local posxs = self.posxs
+ local posys = self.posys
+ local cvsxs = self.cvsxs
+ local cvsys = self.cvsys
+ local numcvs = {}
+ for i, v in ipairs(self.embedding.vertices) do
+ cvsxs[i] = {}
+ cvsys[i] = {}
+ posxs[i] = v.inputvertex.pos.x
+ posys[i] = v.inputvertex.pos.y
+ end
+
+ local numorigvertices = self.numvertexids
+ local numorigedges = self.numedgeids
+ local numdivisions = self.numdivisions
+ local divdelta = delta / (numdivisions + 1)
+ local stresscounter = {}
+ for i = 1, self.numedgeids do
+ stresscounter[i] = 0
+ end
+
+ local appthreshold = self.appthreshold
+ local stretchthreshold = self.stretchthreshold
+ local stresscounterthreshold = self.stresscounterthreshold
+
+ for i = 1, numorigedges do
+ local iv1 = self.embedding.vertices[edgevertex1[i]].inputvertex
+ local iv2 = self.embedding.vertices[edgevertex2[i]].inputvertex
+ local arc = self.ugraph:arc(iv1, iv2)
+ --TODO subdivide edge if desired
+ --self:subdivide_edge(i)
+ end
+
+ -- main loop
+ local iteration = 0
+ repeat
+ iteration = iteration + 1
+ local temperature = self.temperature
+ local ratio = math.min(1, iteration / expiterations)
+ local repexp = startrepexp + (endrepexp - startrepexp) * ratio
+ local attexp = startattexp + (endattexp - startattexp) * ratio
+ for i = 1, self.numvertexids do
+ forcexs[i] = 0
+ forceys[i] = 0
+ numcvs[i] = 0
+ end
+ -- vertex-vertex forces
+ for i = 1, #vertexpairs1 do
+ local id1 = vertexpairs1[i]
+ local id2 = vertexpairs2[i]
+ local diffx = posxs[id2] - posxs[id1]
+ local diffy = posys[id2] - posys[id1]
+ local dist2 = diffx * diffx + diffy * diffy
+ local dist = math.sqrt(dist2)
+ local dirx = diffx / dist
+ local diry = diffy / dist
+ assert(dist ~= 0)
+
+ local useddelta = delta
+ local hasdivvertex = id1 > numorigvertices or id2 > numorigvertices
+
+ -- calculate attractive force
+ if pairconnected[i] then
+ if hasdivvertex then
+ useddelta = divdelta
+ end
+ local mag = (dist / useddelta) ^ attexp * useddelta
+ local fax = mag * dirx
+ local fay = mag * diry
+ forcexs[id1] = forcexs[id1] + fax
+ forceys[id1] = forceys[id1] + fay
+ forcexs[id2] = forcexs[id2] - fax
+ forceys[id2] = forceys[id2] - fay
+ elseif hasdivvertex then
+ useddelta = gamma
+ end
+
+ -- calculate repulsive force
+ local mag = (useddelta / dist) ^ repexp * useddelta
+ local frx = mag * dirx
+ local fry = mag * diry
+ forcexs[id1] = forcexs[id1] - frx
+ forceys[id1] = forceys[id1] - fry
+ forcexs[id2] = forcexs[id2] + frx
+ forceys[id2] = forceys[id2] + fry
+ end
+
+ -- edge-vertex forces and collisions
+ for i = 1, #edgepairsvertex do
+ local edgeid = edgepairsedge[i]
+ if not edgedeprecated[edgeid] then
+ local id1 = edgepairsvertex[i]
+ local id2 = edgevertex1[edgeid]
+ local id3 = edgevertex2[edgeid]
+ assert(id2 ~= id1 and id3 ~= id1)
+
+ local abx = posxs[id3] - posxs[id2]
+ local aby = posys[id3] - posys[id2]
+ local dab2 = abx * abx + aby * aby
+ local dab = math.sqrt(dab2)
+ assert(dab ~= 0)
+ local abnx = abx / dab
+ local abny = aby / dab
+ local avx = posxs[id1] - posxs[id2]
+ local avy = posys[id1] - posys[id2]
+ local daiv = abnx * avx + abny * avy
+ local ivx = posxs[id2] + abnx * daiv
+ local ivy = posys[id2] + abny * daiv
+ local vivx = ivx - posxs[id1]
+ local vivy = ivy - posys[id1]
+ local dviv2 = vivx * vivx + vivy * vivy
+ local dviv = math.sqrt(dviv2)
+ local afactor, bfactor = 1, 1
+ local cvx
+ local cvy
+ if daiv < 0 then
+ cvx = -avx / 2
+ cvy = -avy / 2
+ local norm2 = cvx * cvx + cvy * cvy
+ bfactor = 1 + (cvx * abx + cvy * aby) / norm2
+ elseif daiv > dab then
+ cvx = (abx - avx) / 2
+ cvy = (aby - avy) / 2
+ local norm2 = cvx * cvx + cvy * cvy
+ afactor = 1 - (cvx * abx + cvy * aby) / norm2
+ else
+ if edgeid < numorigedges
+ and dviv < gamma * appthreshold
+ and dab > delta * stretchthreshold then
+ stresscounter[edgeid] = stresscounter[edgeid] + 1
+ end
+ assert(dviv > 0)
+ cvx = vivx / 2
+ cvy = vivy / 2
+ -- calculate edge repulsive force
+ local dirx = -vivx / dviv
+ local diry = -vivy / dviv
+ local mag = (gamma / dviv) ^ repexp * gamma
+ local fex = mag * dirx
+ local fey = mag * diry
+ local abratio = daiv / dab
+ forcexs[id1] = forcexs[id1] + fex
+ forceys[id1] = forceys[id1] + fey
+ forcexs[id2] = forcexs[id2] - fex * (1 - abratio)
+ forceys[id2] = forceys[id2] - fey * (1 - abratio)
+ forcexs[id3] = forcexs[id3] - fex * abratio
+ forceys[id3] = forceys[id3] - fey * abratio
+ end
+ local nv = numcvs[id1] + 1
+ local na = numcvs[id2] + 1
+ local nb = numcvs[id3] + 1
+ numcvs[id1] = nv
+ numcvs[id2] = na
+ numcvs[id3] = nb
+ cvsxs[id1][nv] = cvx
+ cvsys[id1][nv] = cvy
+ cvsxs[id2][na] = -cvx * afactor
+ cvsys[id2][na] = -cvy * afactor
+ cvsxs[id3][nb] = -cvx * bfactor
+ cvsys[id3][nb] = -cvy * bfactor
+ end
+ end
+
+ -- clamp forces
+ local scalefactor = 1
+ local collision = false
+ for i = 1, self.numvertexids do
+ local forcex = forcexs[i]
+ local forcey = forceys[i]
+ forcex = forcex * temperature
+ forcey = forcey * temperature
+ forcexs[i] = forcex
+ forceys[i] = forcey
+ local forcenorm2 = forcex * forcex + forcey * forcey
+ local forcenorm = math.sqrt(forcenorm2)
+ scalefactor = math.min(scalefactor, delta * 3 * temperature / forcenorm)
+ local cvys = cvsys[i]
+ for j, cvx in ipairs(cvsxs[i]) do
+ local cvy = cvys[j]
+ local cvnorm2 = cvx * cvx + cvy * cvy
+ local cvnorm = math.sqrt(cvnorm2)
+ local projforcenorm = (cvx * forcex + cvy * forcey) / cvnorm
+ if projforcenorm > 0 then
+ local factor = cvnorm * 0.9 / projforcenorm
+ if factor < scalefactor then
+ scalefactor = factor
+ collision = true
+ end
+ end
+ end
+ end
+ local moved = false
+ for i = 1, self.numvertexids do
+ local forcex = forcexs[i] * scalefactor
+ local forcey = forceys[i] * scalefactor
+ posxs[i] = posxs[i] + forcex
+ posys[i] = posys[i] + forcey
+ local forcenorm2 = forcex * forcex + forcey * forcey
+ if forcenorm2 > 0.0001 * delta * delta then moved = true end
+ end
+
+ -- subdivide stressed edges
+ if numdivisions > 0 then
+ for i = 1, numorigedges do
+ if stresscounter[i] > stresscounterthreshold then
+ self:subdivide_edge(i)
+ stresscounter[i] = 0
+ end
+ end
+ end
+ self.temperature = self.temperature * coolingfactor
+ until not collision and not moved
+ print("\nfinished PDP after " .. iteration .. " iterations")
+
+ -- write the positions back
+ for i, v in ipairs(self.embedding.vertices) do
+ v.inputvertex.pos.x = posxs[i]
+ v.inputvertex.pos.y = posys[i]
+ end
+
+ -- route the edges
+ for i = 1, self.numedgeids do
+ if self.subdivisionvertices[i] then
+ local iv1 = self.embedding.vertices[self.edgevertex1[i]].inputvertex
+ local iv2 = self.embedding.vertices[self.edgevertex2[i]].inputvertex
+ local arc = self.ugraph:arc(iv1, iv2)
+ local p = Path.new()
+ p:appendMoveto(arc.tail.pos:clone())
+ for _, vid in ipairs(self.subdivisionvertices[i]) do
+ p:appendLineto(self.posxs[vid], self.posys[vid])
+ end
+ p:appendLineto(arc.head.pos:clone())
+ arc.path = p
+ end
+ end
+end
+
+function PDP:subdivide_edge(edgeid)
+ assert(self.subdivisionedges[edgeid] == nil)
+ local numdivisions = self.numdivisions
+ local subdivisionedges = {}
+ local subdivisionvertices = {}
+ local id1 = self.edgevertex1[edgeid]
+ local id2 = self.edgevertex2[edgeid]
+ local x1 = self.posxs[id1]
+ local y1 = self.posys[id1]
+ local x2 = self.posxs[id2]
+ local y2 = self.posys[id2]
+ local prevvertexid = id1
+ for i = 1, numdivisions do
+ -- create new edge and vertex
+ local newvertexid1 = self.numvertexids + i
+ table.insert(subdivisionvertices, newvertexid1)
+ self.posxs[newvertexid1] = (x1 * (numdivisions + 1 - i) + x2 * i)
+ / (numdivisions + 1)
+ self.posys[newvertexid1] = (y1 * (numdivisions + 1 - i) + y2 * i)
+ / (numdivisions + 1)
+ self.cvsxs[newvertexid1] = {}
+ self.cvsys[newvertexid1] = {}
+
+ local newedgeid = self.numedgeids + i
+ table.insert(subdivisionedges, newedgeid)
+ table.insert(self.edgevertex1, prevvertexid)
+ table.insert(self.edgevertex2, newvertexid1)
+ prevvertexid = newvertexid1
+
+ -- pair the new vertex
+ -- with first vertex of the edge being devided
+ table.insert(self.vertexpairs1, self.edgevertex1[edgeid])
+ table.insert(self.vertexpairs2, newvertexid1)
+ table.insert(self.pairconnected, i == 1)
+
+ -- with second vertex of the edge being devided
+ table.insert(self.vertexpairs1, self.edgevertex2[edgeid])
+ table.insert(self.vertexpairs2, newvertexid1)
+ table.insert(self.pairconnected, i == numdivisions)
+
+ -- with each other
+ for j = i + 1, numdivisions do
+ local newvertexid2 = self.numvertexids + j
+ table.insert(self.vertexpairs1, newvertexid1)
+ table.insert(self.vertexpairs2, newvertexid2)
+ table.insert(self.pairconnected, j == i + 1)
+ end
+
+ -- with new edges
+ -- before vertex
+ for j = 1, i - 1 do
+ local newedgeid = self.numedgeids + j
+ table.insert(self.edgepairsvertex, newvertexid1)
+ table.insert(self.edgepairsedge, newedgeid)
+ end
+ -- after vertex
+ for j = i + 2, numdivisions + 1 do
+ local newedgeid = self.numedgeids + j
+ table.insert(self.edgepairsvertex, newvertexid1)
+ table.insert(self.edgepairsedge, newedgeid)
+ end
+
+ -- pair the new edges with vertices of the edge being devided
+ if i > 1 then
+ table.insert(self.edgepairsvertex, id1)
+ table.insert(self.edgepairsedge, newedgeid)
+ end
+ table.insert(self.edgepairsvertex, id2)
+ table.insert(self.edgepairsedge, newedgeid)
+ end
+ -- create last edge
+ table.insert(subdivisionedges, self.numedgeids + numdivisions + 1)
+ table.insert(self.edgevertex1, prevvertexid)
+ table.insert(self.edgevertex2, id2)
+
+ -- pair last edge with first vertex of the edge being devided
+ table.insert(self.edgepairsvertex, id1)
+ table.insert(self.edgepairsedge, self.numedgeids + numdivisions + 1)
+
+ self.subdivisionedges[edgeid] = subdivisionedges
+ self.subdivisionvertices[edgeid] = subdivisionvertices
+
+ -- pair new edges and vertices with existing edges and vertices
+ local sameface = false
+ local start = self.embeddingedges[edgeid]
+ local twin = start.twin
+ local donevertices = { [start.target] = true, [twin.target] = true }
+ local doneedges = { [start] = true, [twin] = true }
+ local current = start.twin.links[1]
+ for twice = 1, 2 do
+ while current ~= start do
+ if current == twin then
+ sameface = true
+ end
+
+ -- pair edge with the new vertices
+ -- or pair subdivision of edge with new vertices and edges
+ if not doneedges[current] then
+ local currentedgeid = self.edgeids[current]
+ if self.subdivisionvertices[currentedgeid] then
+ for _, vid in ipairs(self.subdivisionvertices[currentedgeid]) do
+ for i = 1, numdivisions do
+ local newvertexid = self.numvertexids + i
+ table.insert(self.vertexpairs1, vid)
+ table.insert(self.vertexpairs2, newvertexid)
+ self.pairconnected[#self.vertexpairs1] = false
+ end
+ for i = 1, numdivisions + 1 do
+ local newedgeid = self.numedgeids + i
+ table.insert(self.edgepairsvertex, vid)
+ table.insert(self.edgepairsedge, newedgeid)
+ end
+ end
+ for _, eid in ipairs(self.subdivisionedges[currentedgeid]) do
+ for i = 1, numdivisions do
+ local newvertexid = self.numvertexids + i
+ table.insert(self.edgepairsvertex, newvertexid)
+ table.insert(self.edgepairsedge, eid)
+ end
+ end
+ else
+ for i = 1, numdivisions do
+ local newvertexid = self.numvertexids + i
+ table.insert(self.edgepairsvertex, newvertexid)
+ table.insert(self.edgepairsedge, currentedgeid)
+ end
+ end
+ doneedges[current] = true
+ end
+
+ -- pair target vertex with the new vertices and edges
+ local vertexid = self.vertexids[current.target]
+ if not donevertices[current.target] then
+ for i = 1, numdivisions do
+ local newvertexid = self.numvertexids + i
+ table.insert(self.vertexpairs1, vertexid)
+ table.insert(self.vertexpairs2, newvertexid)
+ self.pairconnected[#self.vertexpairs1] = false
+ end
+ for i = 1, numdivisions + 1 do
+ local newedgeid = self.numedgeids + i
+ table.insert(self.edgepairsvertex, vertexid)
+ table.insert(self.edgepairsedge, newedgeid)
+ end
+ end
+ current = current.twin.links[1]
+ end
+ start = self.embeddingedges[edgeid].twin
+ current = start.twin.links[1]
+ if sameface then
+ break
+ end
+ end
+
+ self.edgedeprecated[edgeid] = true
+ self.numvertexids = self.numvertexids + numdivisions
+ self.numedgeids = self.numedgeids + numdivisions + 1
+end
+
+function PDP:find_force_pairs()
+ local donevertices = {}
+ -- number all vertices
+ local vertexids = self.vertexids
+ for i, v in ipairs(self.embedding.vertices) do
+ vertexids[v] = i
+ end
+ self.numvertexids = #self.embedding.vertices
+
+ local edgeids = self.edgeids
+ local numedgeids = 0
+ -- number all edges
+ for _, v in ipairs(self.embedding.vertices) do
+ local id = vertexids[v]
+ local start = v.link
+ local current = start
+ repeat
+ local targetid = vertexids[current.target]
+ if edgeids[current] == nil then
+ table.insert(self.edgevertex1, id)
+ table.insert(self.edgevertex2, targetid)
+ numedgeids = numedgeids + 1
+ edgeids[current] = numedgeids
+ edgeids[current.twin] = numedgeids
+ self.embeddingedges[numedgeids] = current
+ end
+ current = current.links[0]
+ until current == start
+ end
+
+ -- find all force pairs
+ for _, v in ipairs(self.embedding.vertices) do
+ local id = vertexids[v]
+ donevertices[id] = true
+ local vertexset = {}
+ local edgeset = {}
+ local start = v.link
+ repeat
+ local targetid = vertexids[start.target]
+ if vertexset[targetid] == nil and not donevertices[targetid] then
+ table.insert(self.pairconnected, true)
+ table.insert(self.vertexpairs1, id)
+ table.insert(self.vertexpairs2, targetid)
+ vertexset[targetid] = true
+ end
+ local current = start.twin.links[1]
+ while current.target ~= v do
+ local targetid = vertexids[current.target]
+ if vertexset[targetid] == nil and not donevertices[targetid] then
+ table.insert(self.pairconnected, self.ugraph:arc(v.inputvertex, current.target.inputvertex) ~= nil)
+ table.insert(self.vertexpairs1, id)
+ table.insert(self.vertexpairs2, targetid)
+ vertexset[targetid] = true
+ end
+ if edgeset[current] == nil then
+ table.insert(self.edgepairsvertex, id)
+ table.insert(self.edgepairsedge, edgeids[current])
+ edgeset[current] = true
+ edgeset[current.twin] = true
+ end
+ current = current.twin.links[1]
+ end
+ start = start.links[0]
+ until start == v.link
+ end
+
+ self.numedgeids = numedgeids
+end
+
+function PDP:normalize_size()
+ local minx = math.huge
+ local maxx = -math.huge
+ local miny = math.huge
+ local maxy = -math.huge
+
+ for _, v in ipairs(self.ugraph.vertices) do
+ minx = math.min(minx, v.pos.x)
+ maxx = math.max(maxx, v.pos.x)
+ miny = math.min(miny, v.pos.y)
+ maxy = math.max(maxy, v.pos.y)
+ end
+
+ local area = (maxx - minx) * (maxy - miny)
+ local gridarea = #self.ugraph.vertices * self.delta * self.delta
+
+ local scale = math.sqrt(gridarea) / math.sqrt(area)
+
+ for _, v in ipairs(self.ugraph.vertices) do
+ v.pos = v.pos * scale
+ end
+end
+
+-- done
+
+return PDP
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PlanarLayout.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PlanarLayout.lua
new file mode 100644
index 00000000000..8796148de80
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/PlanarLayout.lua
@@ -0,0 +1,159 @@
+
+
+local PlanarLayout = {}
+require("pgf.gd.planar").PlanarLayout = PlanarLayout
+
+-- imports
+local Coordinate = require "pgf.gd.model.Coordinate"
+local Storage = require "pgf.gd.lib.Storage"
+local BoyerMyrvold = require "pgf.gd.planar.BoyerMyrvold2004"
+local ShiftMethod = require "pgf.gd.planar.ShiftMethod"
+local Embedding = require "pgf.gd.planar.Embedding"
+local PDP = require "pgf.gd.planar.PDP"
+local InterfaceToAlgorithms = require("pgf.gd.interface.InterfaceToAlgorithms")
+local createEdge = InterfaceToAlgorithms.createEdge
+local createVertex = InterfaceToAlgorithms.createVertex
+
+InterfaceToAlgorithms.declare {
+ key = "planar layout",
+ algorithm = PlanarLayout,
+ preconditions = {
+ connected = true,
+ loop_free = true,
+ simple = true,
+ },
+ postconditions = {
+ fixed = true,
+ },
+ summary = [["
+ The planar layout draws planar graphs without edge crossings.
+ "]],
+ documentation = [["
+ The planar layout is a pipeline of algorithms to produce
+ a crossings-free drawing of a planar graph.
+ First a combinatorical embedding of the graph is created using
+ the Algorithm from Boyer and Myrvold.
+ The combinatorical Embedding is then being improved by
+ by the Sort and Flip algorithm and triangulated afterwards.
+ To determine the actual node positions the shift method
+ by de Fraysseix, Pach and Pollack is used.
+ Finally the force based Planar Drawing Postprocessing improves the drawing.
+ "]],
+ examples = {
+ [["
+ \tikz \graph [nodes={draw, circle}] {
+ a -- {
+ b -- {
+ d -- i,
+ e,
+ f
+ },
+ c -- {
+ g,
+ h
+ }
+ },
+ f --[no span edge] a,
+ h --[no span edge] a,
+ i --[no span edge] g,
+ f --[no span edge] g,
+ c --[no span edge] d,
+ e --[no span edge] c
+ }
+ "]]
+ }
+}
+
+function PlanarLayout:run()
+ --local file = io.open("timing.txt", "a")
+
+ local options = self.digraph.options
+
+ -- get embedding
+ local bm = BoyerMyrvold.new()
+ bm:init(self.ugraph)
+ local embedding = bm:run()
+
+ assert(embedding, "Graph is not planar")
+
+ --local start = os.clock()
+ if options["use sf"] then
+ embedding:improve()
+ end
+
+ -- choose external face
+ local exedge, exsize = embedding:get_biggest_face()
+
+ -- surround graph with triangle
+ local v1, v2, vn = embedding:surround_by_triangle(exedge, exsize)
+
+ -- make maximal planar
+ embedding:triangulate()
+
+ if options["show virtual"] then
+ -- add virtual vertices to input graph
+ for _, vertex in ipairs(embedding.vertices) do
+ if vertex.virtual then
+ vertex.inputvertex = createVertex(self, {
+ name = nil,--vertex.name,
+ generated_options = {},
+ text = vertex.name
+ })
+ vertex.virtual = false
+ end
+ end
+
+ -- add virtual edges to input graph
+ for _, vertex in ipairs(embedding.vertices) do
+ for halfedge in Embedding.adjacency_iterator(vertex.link) do
+ if halfedge.virtual then
+ createEdge(
+ self,
+ vertex.inputvertex,
+ halfedge.target.inputvertex
+ )
+ end
+ halfedge.virtual = false
+ end
+ end
+ end
+
+ -- create canonical ordering
+ local order = embedding:canonical_order(v1, v2, vn)
+
+ local sm = ShiftMethod.new()
+ sm:init(order)
+ local gridpos = sm:run()
+
+ local gridspacing = options["grid spacing"]
+ for _, v in ipairs(order) do
+ if not v.virtual then
+ local iv = v.inputvertex
+ iv.pos.x = gridpos[v].x * gridspacing
+ iv.pos.y = gridpos[v].y * gridspacing
+ end
+ end
+
+ embedding:remove_virtual()
+
+ --start = os.clock()
+ if options["use pdp"] then
+ local pdp = PDP.new(
+ self.ugraph, embedding,
+ options["node distance"],
+ options["node distance"],
+ options["pdp cooling factor"],
+ options["exponent change iterations"],
+ options["start repulsive exponent"],
+ options["end repulsive exponent"],
+ options["start attractive exponent"],
+ options["end attractive exponent"],
+ options["edge approach threshold"],
+ options["edge stretch threshold"],
+ options["stress counter threshold"],
+ options["edge divisions"]
+ )
+ pdp:run()
+ end
+
+end
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/ShiftMethod.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/ShiftMethod.lua
new file mode 100644
index 00000000000..9716aa27e4a
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/ShiftMethod.lua
@@ -0,0 +1,128 @@
+local SM = {}
+require("pgf.gd.planar").ShiftMethod = SM
+
+-- imports
+local Embedding = require("pgf.gd.planar.Embedding")
+
+-- create class properties
+SM.__index = SM
+
+function SM.new()
+ local t = {}
+ setmetatable(t, SM)
+ return t
+end
+
+function SM:init(vertices)
+ self.vertices = vertices
+ self.xoff = {}
+ self.pos = {}
+ for _, v in ipairs(vertices) do
+ self.pos[v] = {}
+ end
+ self.left = {}
+ self.right = {}
+end
+
+function SM:run()
+ local v1 = self.vertices[1]
+ local v2 = self.vertices[2]
+ local v3 = self.vertices[3]
+
+ self.xoff[v1] = 0
+ self.pos[v1].y = 0
+ self.right[v1] = v3
+
+ self.xoff[v3] = 1
+ self.pos[v3].y = 1
+ self.right[v3] = v2
+
+ self.xoff[v2] = 1
+ self.pos[v2].y = 0
+
+ local n = #self.vertices
+ for k = 4, n do
+ local vk = self.vertices[k]
+ local wplink, wqlink, wp1qsum
+ if k ~= n then
+ wplink, wqlink, wp1qsum = self:get_attachments(vk)
+ else
+ wplink, wqlink, wp1qsum = self:get_last_attachments(vk, v1, v2)
+ end
+ local wp, wq = wplink.target, wqlink.target
+ local wp1 = wplink.links[0].target
+ local wq1 = wqlink.links[1 - 0].target
+ self.xoff[wp1] = self.xoff[wp1] + 1
+ self.xoff[wq] = self.xoff[wq] + 1
+ wp1qsum = wp1qsum + 2
+ self.xoff[vk] = (wp1qsum + self.pos[wq].y - self.pos[wp].y) / 2
+ self.pos[vk].y = (wp1qsum + self.pos[wq].y + self.pos[wp].y) / 2
+ -- = self.xoff[vk] + self.pos[wp].y ?
+ self.right[wp] = vk
+ if wp ~= wq1 then
+ self.left[vk] = wp1
+ self.right[wq1] = nil
+ self.xoff[wp1] = self.xoff[wp1] - self.xoff[vk]
+ end
+ self.right[vk] = wq
+ self.xoff[wq] = wp1qsum - self.xoff[vk]
+ end
+ self.pos[v1].x = 0
+ self:accumulate_offset(v1, 0)
+ return self.pos
+end
+
+function SM:get_attachments(vk)
+ local wplink, wqlink
+ local wp1qsum = 0
+ local start = vk.link
+ local startattach = self.xoff[start.target] ~= nil
+ local current = start.links[0]
+ local last = start
+ repeat
+ local currentattach = self.xoff[current.target] ~= nil
+ local lastattach = self.xoff[last.target] ~= nil
+ if currentattach ~= lastattach then
+ if currentattach then
+ wplink = current
+ else
+ wqlink = last
+ end
+ if currentattach == startattach and not startattach then
+ break
+ end
+ currentattach = lastattach
+ elseif currentattach then
+ wp1qsum = wp1qsum + self.xoff[current.target]
+ end
+ last = current
+ current = current.links[0]
+ until last == start
+ return wplink, wqlink, wp1qsum
+end
+
+function SM:get_last_attachments(vn, v1, v2)
+ local wplink, wqlink
+ local wp1qsum = 0
+ for halfedge in Embedding.adjacency_iterator(vn.link, ccwdir) do
+ local target = halfedge.target
+ if target == v1 then
+ wplink = halfedge
+ elseif target == v2 then
+ wqlink = halfedge
+ end
+ wp1qsum = wp1qsum + self.xoff[target]
+ end
+ return wplink, wqlink, wp1qsum
+end
+
+function SM:accumulate_offset(v, x)
+ x = x + self.xoff[v]
+ self.pos[v].x = x
+ local l = self.left[v]
+ local r = self.right[v]
+ if l then self:accumulate_offset(l, x) end
+ if r then self:accumulate_offset(r, x) end
+end
+
+return SM
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/library.lua
new file mode 100644
index 00000000000..68c46898e34
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/library.lua
@@ -0,0 +1,2 @@
+require "pgf.gd.planar.PlanarLayout"
+require "pgf.gd.planar.parameters"
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/parameters.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/parameters.lua
new file mode 100644
index 00000000000..9e18eb07246
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/planar/parameters.lua
@@ -0,0 +1,144 @@
+-- Imports
+local declare = require("pgf.gd.interface.InterfaceToAlgorithms").declare
+
+declare {
+ key = "use pdp",
+ type = "boolean",
+ initial = "true",
+
+ summary = [["
+ Whether or not to use the Planar Drawing Postprocessing
+ to improve the drawing.
+ "]]
+}
+
+declare {
+ key = "use sf",
+ type = "boolean",
+ initial = "true",
+
+ summary = [["
+ Whether or not to use the Sort and Flip Algorithm
+ to improve the combinatorical embedding.
+ "]]
+}
+
+declare {
+ key = "grid spacing",
+ type = "number",
+ initial = "10",
+
+ summary = [["
+ If the |use pdp| option is not set,
+ this sets the spacing of the grid used by the shift method.
+ A bigger grid spacing will result in a bigger drawing.
+ "]]
+}
+
+declare {
+ key = "pdp cooling factor",
+ type = "number",
+ initial = "0.98",
+
+ summary = [["
+ This sets the cooling factor used by the Planar Drawing Postprocessing.
+ A higher cooling factor can result in better quality of the drawing,
+ but will increase the run time of the algorithm.
+ "]]
+}
+
+declare {
+ key = "start repulsive exponent",
+ type = "number",
+ initial = "2",
+
+ summary = [["
+ Start value of the exponent used in the calculation of all repulsive forces in PDP
+ "]]
+}
+
+declare {
+ key = "end repulsive exponent",
+ type = "number",
+ initial = "2",
+
+ summary = [["
+ End value of the exponent used in the calculation of all repulsive forces in PDP.
+ "]]
+}
+
+declare {
+ key = "start attractive exponent",
+ type = "number",
+ initial = "2",
+
+ summary = [["
+ Start value of the exponent used in PDP's calculation of the attractive force between
+ nodes connected by an edge.
+ "]]
+}
+
+declare {
+ key = "end attractive exponent",
+ type = "number",
+ initial = "2",
+
+ summary = [["
+ End value of the exponent used in PDP's calculation of the attractive force between
+ nodes connected by an edge.
+ "]]
+}
+
+declare {
+ key = "exponent change iterations",
+ type = "number",
+ initial = "1",
+
+ summary = [["
+ The number of iterations over which to modify the force exponents.
+ In iteration one the exponents will have their start value and in iteration
+ |exponent change iterations| they will have their end value.
+ "]]
+}
+
+declare {
+ key = "edge approach threshold",
+ type = "number",
+ initial = "0.3",
+
+ summary = [["
+ The maximum ration between the actual and the desired node-edge distance
+ which is required to count an edge as stressed.
+ "]]
+}
+
+declare {
+ key = "edge stretch threshold",
+ type = "number",
+ initial = "1.5",
+
+ summary = [["
+ The minimum ration between the actual and the desired edge length
+ which is required to count an edge as stressed.
+ "]]
+}
+
+declare {
+ key = "stress counter threshold",
+ type = "number",
+ initial = "30",
+
+ summary = [["
+ The number of iterations an edge has to be under stress before it will be subdevided.
+ "]]
+}
+
+declare {
+ key = "edge divisions",
+ type = "number",
+ initial = "0",
+
+ summary = [["
+ The number of edges in which stressed edges will be subdivided.
+ "]]
+}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing.lua
index 0dd9659852e..77166c5cbf5 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/routing.lua,v 1.1 2014/02/24 10:40:32 tantau Exp $
+--- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua
index 46c337090f4..1f68bd99f5f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/routing/Hints.lua,v 1.2 2015/05/18 17:01:16 tantau Exp $
+-- @release $Header$
---
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua
index 23a9d265923..9a99ea2275f 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/routing/NecklaceRouting.lua,v 1.1 2014/04/28 12:28:46 tantau Exp $
+-- @release $Header$
-- The class; it processes necklace hints.
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/library.lua
index 80364d11a39..17c959d6856 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/routing/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/routing/library.lua,v 1.1 2014/02/24 10:40:33 tantau Exp $
+-- @release $Header$
-- Imports
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/tools/make_gd_wrap.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/tools/make_gd_wrap.lua
index b433e73a652..b13dcb9abb4 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/tools/make_gd_wrap.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/tools/make_gd_wrap.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/tools/make_gd_wrap.lua,v 1.2 2013/01/01 17:10:09 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees.lua
index 9aff2aaf1d7..8c45e912dc7 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
---- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/trees.lua,v 1.1 2012/11/27 17:24:24 tantau Exp $
+--- @release $Header$
local trees = {}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua
index 272af54e55e..0b975fd3291 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/trees/ChildSpec.lua,v 1.4 2013/05/23 20:01:29 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ReingoldTilford1981.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ReingoldTilford1981.lua
index c808607385b..8eba23a2106 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ReingoldTilford1981.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/ReingoldTilford1981.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/trees/ReingoldTilford1981.lua,v 1.11 2014/03/19 09:20:59 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua
index 24e9a69c385..791fb81e658 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/trees/SpanningTreeComputation.lua,v 1.7 2013/05/23 20:01:29 tantau Exp $
+-- @release $Header$
@@ -634,4 +634,4 @@ end
-- Done
-return SpanningTreeComputation \ No newline at end of file
+return SpanningTreeComputation
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua
index 09c35611723..753f386bb9e 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua,v 1.1 2014/03/19 09:20:59 tantau Exp $
+-- @release $Header$
local key = require 'pgf.gd.doc'.key
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/library.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/library.lua
index f34aee06792..b8e36982cfc 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/library.lua
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/library.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/trees/library.lua,v 1.2 2013/04/04 20:43:45 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/experimental/tikzlibrarygraphdrawing.evolving.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/experimental/tikzlibrarygraphdrawing.evolving.code.tex
new file mode 100644
index 00000000000..9d9055dfe96
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/experimental/tikzlibrarygraphdrawing.evolving.code.tex
@@ -0,0 +1,21 @@
+% Copyright 2016 by Malte Skambath
+%
+% 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{graphdrawing}
+
+\usegdlibrary{evolving}
+
+\newcount\mycount
+\tikzgraphsset{
+ nodes = {supernode/.expanded=\tikzgraphnodename},
+ when/.code = {\pgfparsetime{#1}\mycount=\pgftimeresult pt\tikzgraphsset{name/.expanded=\the\mycount,snapshot/.expanded=\the\mycount}}
+}
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.circular.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.circular.code.tex
index 9c017b5577d..61f2e4bed00 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.circular.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.circular.code.tex
@@ -8,9 +8,9 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.circular.code.tex,v 1.4 2012/11/20 23:34:18 tantau Exp $
+\ProvidesFileRCS{pgflibrarygraphdrawing.circular.code.tex}
\usegdlibrary{circular}
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.code.tex
index ad648c29402..385c9705953 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.code.tex
@@ -8,7 +8,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.code.tex,v 1.39 2015/06/08 21:58:24 tantau Exp $
+\ProvidesFileRCS{pgflibrarygraphdrawing.code.tex}
@@ -26,50 +26,50 @@
-%
+%
% All graph drawing keys normally live in the following namespace:
-% /graph drawing.
+% /graph drawing.
%
-\def\pgfgdset{\pgfqkeys{/graph drawing}}
+\def\pgfgdset{\pgfqkeys{/graph drawing}}%
% Setup a key
-%
+%
% #1 = key
-%
+%
% Description:
-%
+%
% An internal macro that sets up #1 as a graph drawing key.
-\def\pgfgd@callbackkey#1{
- \pgf@gd@setup@forwards{#1}
- \pgfutil@g@addto@macro\pgf@gd@forwards@list{\pgf@gd@setup@forwards{#1}}
-}
-\def\pgf@gd@setup@forwards#1{
+\def\pgfgd@callbackkey#1{%
+ \pgf@gd@setup@forwards{#1}%
+ \pgfutil@g@addto@macro\pgf@gd@forwards@list{\pgf@gd@setup@forwards{#1}}%
+}%
+\def\pgf@gd@setup@forwards#1{%
\let\pgf@temp\pgfutil@empty
- \foreach \pgf@gd@path in \pgf@gd@forwarding@list {
+ \foreach \pgf@gd@path in \pgf@gd@forwarding@list {%
\ifx\pgf@gd@path\pgfutil@empty\else%
\expandafter\pgfutil@g@addto@macro%
\expandafter\pgf@temp\expandafter{%
- \expandafter\pgfkeys\expandafter{\pgf@gd@path#1/.forward to=/graph drawing/#1}}
+ \expandafter\pgfkeys\expandafter{\pgf@gd@path#1/.forward to=/graph drawing/#1}}%
\fi%
}%
\pgf@temp
-}
+}%
\let\pgf@gd@forwards@list\pgfutil@empty
% Append to the forwarding list:
-%
+%
% #1 = paths to append to the forwarding list
-%
+%
% Description:
-%
+%
% Append the paths in #1 (with trailing slashes) to the forwarding
% list.
-%
+%
% If algorithms have already been declared, forwarding will also be
% setup for them (using a bit of magic...).
@@ -77,19 +77,19 @@
\let\pgf@gd@forwarding@list@orig\pgf@gd@forwarding@list
\def\pgf@gd@forwarding@list{#1}%
\pgf@gd@forwards@list%
- \expandafter\def\expandafter\pgf@gd@forwarding@list\expandafter{\pgf@gd@forwarding@list@orig,#1}
-}
+ \expandafter\def\expandafter\pgf@gd@forwarding@list\expandafter{\pgf@gd@forwarding@list@orig,#1}%
+}%
\let\pgf@gd@forwarding@list\pgfutil@empty
-%
-%
+%
+%
% Callbacks
-%
+%
% The following macros are called *from* the binding layer. You do not
% call them from the pgf layer.
-%
+%
%
@@ -109,7 +109,7 @@
% a large label.
%
% These graph drawing parameters are different from "usual" pgf
-% options: An alogrithmic parameter influenced the way the algorithm
+% options: An algorithmic parameter influenced the way the algorithm
% works, while usual options normally only influence how the result
% looks like. For instance, the fact that a node is red is not an
% graph drawing parameter (usually, at least), while the shape of a node
@@ -119,7 +119,7 @@
% (since only this layer "knows" which parameters there are). The
% binding to TeX will call the \pgfgddeclareparameter function
% internally.
-%
+%
% Specifying the set of graph drawing parameters for a given graph or
% node or edge works as follows: When the graph drawing engine is
% started for a graph (using \pgfgdbeginscope), a snapshot is taken of
@@ -132,8 +132,8 @@
\def\pgfgdcallbackdeclareparameter#1#2{%
\pgfkeysdef{/graph drawing/#1}{\pgf@gd@handle@parameter{#1}{#2}{##1}}%
- \pgfgd@callbackkey{#1}%
-}
+ \pgfgd@callbackkey{#1}%
+}%
\def\pgf@gd@handle@parameter#1#2#3{%
\def\pgf@temp{#3}%
\ifx\pgf@temp\pgfkeysnovalue@text%
@@ -146,18 +146,18 @@
local new, main = pgf.gd.interface.InterfaceToDisplay.pushOption('\pgfutil@luaescapestring{#1}',\pgfgdresult,\the\pgf@gd@parameter@stack@height)
tex.print(new..'\pgfutil@luaescapestring{\relax}')
if main then
- tex.print('\pgfutil@luaescapestring{\noexpand\pgfgdtriggerrequest}')
- end}%
+ tex.print('\pgfutil@luaescapestring{\noexpand\pgfgdtriggerrequest}')
+ end}%
}%
\newcount\pgf@gd@parameter@stack@height
-\def\pgfgdtriggerrequest{\pgfgdset{@request scope and layout}}
+\def\pgfgdtriggerrequest{\pgfgdset{@request scope and layout}}%
% Conversions are used to adapt the syntactic description of a
% parameter on the TikZ layer to the one expected by Lua. The set of
% permissible conversions is described in
-% InterfaceToAlgorithms.declareParameter.
+% InterfaceToAlgorithms.declareParameter.
\pgfgdset{
conversions/string/.code=\def\pgfgdresult{'\pgfutil@luaescapestring{\detokenize{#1}}'},
@@ -166,13 +166,14 @@
conversions/boolean/.code=\def\pgf@test{#1}\ifx\pgf@test\pgf@truetext\def\pgfgdresult{true}\else\ifx\pgf@test\pgfkeysnovalue@text\def\pgfgdresult{true}\else\def\pgfgdresult{false}\fi\fi,
conversions/number/.code=\pgfmathparse{#1}\let\pgfgdresult\pgfmathresult,
conversions/length/.code=\pgfmathparse{#1}\let\pgfgdresult\pgfmathresult,
+ conversions/time/.code=\pgfparsetime{#1}\let\pgfgdresult\pgftimeresult,
conversions/direction/.code=\pgf@lib@gd@grow@dir{#1}\let\pgfgdresult\pgfmathresult,
conversions/canvas coordinate/.code args={(#1pt,#2pt)}{\edef\pgfgdresult{pgf.gd.model.Coordinate.new(#1,#2)}},
% deprecated, will be removed:
conversions/coordinate/.code args={(#1pt,#2pt)}{\edef\pgfgdresult{{#1,#2}}}
-}
-\def\pgf@truetext{true}
-\def\pgfgd@niltext{nil}
+}%
+\def\pgf@truetext{true}%
+\def\pgfgd@niltext{nil}%
\def\pgf@lib@gd@grow@dir#1{%
\def\pgf@temp{#1}%
@@ -185,30 +186,30 @@
\pgfmathparse{#1}%
\fi
\fi
-}
+}%
-\def\pgf@orient@direction@down{-90}
-\def\pgf@orient@direction@up{90}
-\def\pgf@orient@direction@left{180}
-\def\pgf@orient@direction@right{0}
+\def\pgf@orient@direction@down{-90}%
+\def\pgf@orient@direction@up{90}%
+\def\pgf@orient@direction@left{180}%
+\def\pgf@orient@direction@right{0}%
-\def\pgf@orient@direction@south{-90}
-\def\pgf@orient@direction@north{90}
-\def\pgf@orient@direction@west{180}
-\def\pgf@orient@direction@east{0}
+\def\pgf@orient@direction@south{-90}%
+\def\pgf@orient@direction@north{90}%
+\def\pgf@orient@direction@west{180}%
+\def\pgf@orient@direction@east{0}%
-\expandafter\def\csname pgf@orient@direction@north east\endcsname{45}
-\expandafter\def\csname pgf@orient@direction@north west\endcsname{135}
-\expandafter\def\csname pgf@orient@direction@south east\endcsname{-45}
-\expandafter\def\csname pgf@orient@direction@south west\endcsname{-135}
+\expandafter\def\csname pgf@orient@direction@north east\endcsname{45}%
+\expandafter\def\csname pgf@orient@direction@north west\endcsname{135}%
+\expandafter\def\csname pgf@orient@direction@south east\endcsname{-45}%
+\expandafter\def\csname pgf@orient@direction@south west\endcsname{-135}%
-\expandafter\def\csname pgf@orient@direction@-\endcsname{0}
-\expandafter\def\csname pgf@orient@direction@|\endcsname{-90}
+\expandafter\def\csname pgf@orient@direction@-\endcsname{0}%
+\expandafter\def\csname pgf@orient@direction@|\endcsname{-90}%
-{
+{%
\catcode`\|=13
- \gdef\pgf@gd@lib@active@bar{|}
-}
+ \gdef\pgf@gd@lib@active@bar{|}%
+}%
@@ -220,7 +221,7 @@
% #2 = Layer
%
% Description:
-%
+%
% Executes /graph drawing/#1/begin rendering/.try
%
@@ -233,7 +234,7 @@
\unhbox\pgf@gd@postkind@box%
\fi%
\pgfgdset{/graph drawing/#1/begin rendering/.try}%
-}
+}%
% Callback for ending the rendering of a collection kind
%
@@ -241,47 +242,47 @@
% #2 = Layer
%
% Description:
-%
+%
% Executes /graph drawing/#1/end rendering/.try
%
\def\pgfgdcallbackrendercollectionkindstop#1#2{%
\pgfgdset{/graph drawing/#1/end rendering/.try}%
\egroup % close box
-}
+}%
-% Callback for rendering a collection
-%
+% Callback for rendering a collection
+%
% #1 = Kind
% #2 = Options
%
% Description:
-%
+%
% Executes /graph drawing/#1/render/.try={#2}
%
\def\pgfgdcallbackrendercollection#1#2{
\pgfgdset{/graph drawing/#1/render/.try={#2}}
-}
+}%
-% Graph events
-%
+% Graph events
+%
% Although a graph consists of nodes and edges, during the
% construction of the graph a lot of information concerning the
% structure of the graph is often available. For instance, as we
% specify a graph using the child-syntax, we do not only which edges
% are present, but we can implicitly specify an ordering on the
-% nodes. Even more, there is even information availble concerning
+% nodes. Even more, there is even information available concerning
% nodes that are not present at all: A child[missing] is not present
% as a node or an edge, but a tree drawing algorithm will want to know
% about this child nevertheless.
-%
+%
% In order to communicate such information to the graph drawing
% engine, "events" are used. As a graph is created, in addition to
% nodes and edges, "events" may happen. The events come in a
@@ -289,36 +290,36 @@
% each node and each edge, its index in the event sequence is
% stored, that is, it is stored how many events happened before the
% node or edge was created.
-%
+%
% Internally, an event consists of a name and, possibly, some
% parameters. When the parameter is created on the tikz level, it will
% be a string that is passed down to Lua. Internally created events
% will also have parameters that are objects.
-%
+%
% Two events are a bit special since they get special internal
% support: The begin and end events. The first signals that some kind
% of group has started; which is closed by the corresponding end
% event. The "kind" of group is indicated by the parameter of the
% begin event.
-%
-%
-%
+%
+%
+%
% Standard events are:
-%
+%
% For each node entered into a graph, a "node" event is automatically
% created internally with the parameter being the node. However, you
% can also create this event yourself. In this case, the parameter
% will be a string and will mean that the node is "virtual" or
% "missing", but space should be reserved for it, if possible (this is
% use, for instance, by certain tree layouts).
-%
+%
% For each edge entered into a graph, an "edge" event is automatically
% created, with the edge as the parameter. Again, an event with a
% string parameter corresponds to a "non-existing" node.
-%
+%
%
% Standard event groups are:
-%
+%
%
% The "descendants" event group include a set of nodes that, at least
% inside the specification, are descendants of the last node
@@ -326,68 +327,68 @@
% begin descendants
% ...
% end
-%
-%
+%
+%
% The "array" event group collects together some nodes in an array of
% nodes. This can be used, for instance, to specify matrices.
-%
+%
% begin array
% ...
-% end
+% end
% Create a new event
-%
+%
% #1 = event name (should be a valid lua identifier name)
% #2 = parameter (some text)
-%
+%
% Description:
-%
+%
% Adds a new event to the event sequence of the graph
\def\pgfgdevent#1#2{%
\directlua{pgf.gd.interface.InterfaceToDisplay.createEvent('\pgfutil@luaescapestring{#1}', '\pgfutil@luaescapestring{#2}')}%
-}
+}%
% Start an event group
-%
+%
% #1 = kind of event group
-%
+%
% Description:
-%
+%
% Creates a begin event with #1 as the parameter of the begin
% event.
\def\pgfgdbegineventgroup#1{%
\pgfgdevent{begin}{#1}%
-}
+}%
% End an event group
-%
+%
% Description:
-%
+%
% Creates an end event.
\def\pgfgdendeventgroup{%
\pgfgdevent{end}{}%
-}
+}%
% Creates an event group for the current TeX group
%
-% #1 = event group name
+% #1 = event group name
%
% Description:
-%
+%
% Issues a begin event for #1 and, using \aftergroup, adds an end
% event at the end of the current tex group.
\def\pgfgdeventgroup#1{%
\pgfgdbegineventgroup{#1}%
\aftergroup\pgfgdendeventgroup%
-}
+}%
@@ -401,7 +402,7 @@
%
% Callback method for \pgfpositionnodelater
-%
+%
% This function is called by \pgfnode whenever a node has been newly
% created inside a graph drawing scope. It will create a new vertex on
% the Lua layer.
@@ -421,10 +422,10 @@
\let\pgfsyssoftpath@curvetosupportatoken\pgf@gd@curvetosupportatoken%
\let\pgfsyssoftpath@closepathtoken\pgf@gd@closepathtoken%
\pgfpositionnodelaterpath%
- %
+ %
\pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
\pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
- %
+ %
{%
\pgf@process{\pgfpointanchor{\pgfpositionnodelatername}{center}}
\pgfsettransform{\csname pgf@sh@nt@\pgfpositionnodelatername\endcsname}%
@@ -450,14 +451,14 @@
center = require 'pgf.gd.model.Coordinate'.new(\pgf@sys@tonumber\pgf@x,\pgf@sys@tonumber\pgf@y)
}
)
- pgf.temp = nil
+ pgf.temp = nil
}
}%
-}
+}%
-\def\pgf@gd@movetotoken#1#2{\directlua{pgf.temp:appendMoveto(\Pgf@geT#1,\Pgf@geT#2)}}
-\def\pgf@gd@linetotoken#1#2{\directlua{pgf.temp:appendLineto(\Pgf@geT#1,\Pgf@geT#2)}}
+\def\pgf@gd@movetotoken#1#2{\directlua{pgf.temp:appendMoveto(\Pgf@geT#1,\Pgf@geT#2)}}%
+\def\pgf@gd@linetotoken#1#2{\directlua{pgf.temp:appendLineto(\Pgf@geT#1,\Pgf@geT#2)}}%
\def\pgf@gd@rectcornertoken#1#2#3#4#5{%
\directlua{%
local x,y,dx,dy=\Pgf@geT#1,\Pgf@geT#2,\Pgf@geT#4,\Pgf@geT#5
@@ -465,17 +466,17 @@
pgf.temp:appendLineto(x,y+dy)
pgf.temp:appendLineto(x+dx,y+dy)
pgf.temp:appendLineto(x+dx,y)
- pgf.temp:appendClosepath()%
+ pgf.temp:appendClosepath()%
}%
-}
-\def\pgf@gd@curvetosupportatoken#1#2#3#4#5#6#7#8{\directlua{pgf.temp:appendCurveto(\Pgf@geT#1,\Pgf@geT#2,\Pgf@geT#4,\Pgf@geT#5,\Pgf@geT#7,\Pgf@geT#8)}}
-\def\pgf@gd@closepathtoken#1#2{\directlua{pgf.temp:appendClosepath()}}
+}%
+\def\pgf@gd@curvetosupportatoken#1#2#3#4#5#6#7#8{\directlua{pgf.temp:appendCurveto(\Pgf@geT#1,\Pgf@geT#2,\Pgf@geT#4,\Pgf@geT#5,\Pgf@geT#7,\Pgf@geT#8)}}%
+\def\pgf@gd@closepathtoken#1#2{\directlua{pgf.temp:appendClosepath()}}%
% Set options for an already existing node
-%
+%
% #1 = node name
-%
+%
% These node parameters of #1 will be updated with the current values
% of the node parameters. The node #1 must previously have been passed
% to the gd engine. If some of the options have already been set for
@@ -485,13 +486,13 @@
\directlua{
pgf.gd.interface.InterfaceToDisplay.addToVertexOptions('\pgfutil@luaescapestring{#1}',\the\pgf@gd@parameter@stack@height)
}
-}
+}%
%
% A callback for rendering (finally positioning) a node
-%
+%
% #1 = name of the node
% #2 = x min of the bounding box
% #3 = x max of the bounding box
@@ -500,11 +501,12 @@
% #6 = desired x pos of the node
% #7 = desired y pos of the node
% #8 = box register number of the TeX node
+% #9 = animation code
%
% This callback will be called by the engine for every original node
% when it finally needs to placed at a final position.
-\def\pgfgdcallbackrendernode#1#2#3#4#5#6#7#8{%
+\def\pgfgdcallbackrendernode#1#2#3#4#5#6#7#8#9{%
{%
\def\pgfpositionnodelatername{#1}
\def\pgfpositionnodelaterminx{#2}
@@ -512,10 +514,24 @@
\def\pgfpositionnodelaterminy{#4}
\def\pgfpositionnodelatermaxy{#5}
\directlua{pgf.gd.interface.InterfaceCore.binding:retrieveBox(#8,\pgfpositionnodelaterbox)}
- \pgfpositionnodenow{\pgfqpoint{#6}{#7}}
+ \def\pgf@temp{#9}%
+ \ifx\pgf@temp\pgfutil@empty%
+ \pgfpositionnodenow{\pgfqpoint{#6}{#7}}%
+ \else%
+ \pgfset{every graphdrawing animation/.try}%
+ \pgfset{every graphdrawing node animation/.try}%
+ #9%
+ \pgfuseid{pgf@gd}%
+ \pgfidscope%
+ \pgfpositionnodenow{\pgfqpoint{#6}{#7}}%
+ \endpgfidscope%
+ \fi%
}%
-}
+}%
+\ifx\pgfanimateattribute\pgfutil@undefined
+ \def\pgfanimateattribute#1#2{\tikzerror{You need to say \string\usetikzlibrary{animations} for animated graphs}}%
+\fi
% Adds an edge to the graph
@@ -531,14 +547,14 @@
% Creating an edge means that you tell the graph drawing algorithm
% that #1 and #2 are connected. The "kind" of connection is indicated
% by #3, which may be one of the following:
-%
+%
% -> = a directed edge (also known as an arc) from #1 to #2
% -- = an undirected edge between #1 and #2
% <- = a directed edge from #2 to #1, but with the "additional hint"
% that this is a "backward" edge. A graph drawing algorithm may
% or may not take this hint into account
% <-> = a bi-directed edge between #1 and #2.
-%
+%
%
% The parameters #4 and #5 are a bit more tricky. When an edge between
% two vertices of a graph is created via \pgfgdedge, nothing is
@@ -547,31 +563,31 @@
% creating the actual drawing commands for the edge. Thus, the actual
% drawing of the edge is done only when the graph drawing algorithm is
% done (namely in the macro \pgfgdcallbackedge, see later).
-%
+%
% Because of this "delayed" drawing of edges, options that influence
% the edge must be retained until the moment when the edge is actually
% drawn. Parameters #4 and #5 store such options.
-%
+%
% Let us start with #4. This parameter should be set to a list of
% key-value pairs like
-%
+%
% /tikz/.cd, color=red, very thick, this edge must be vertical
-%
+%
% Some of these options may be of interest to the graph drawing
-% algorithm (like the last option) while others will
+% algorithm (like the last option) while others will
% only be important during the drawing of edge (like the first
% option). The options that are important for the graph drawing
% algorithm must be passed to the algorithm via setting keys that have
-% been declared using the handler .edge parameter (see
+% been declared using the handler .edge parameter (see
% above).
-%
+%
% The tricky part is that options that are of interest to the graph
% drawing algorithm must be executed *before* the algorithm starts,
% but the options as a whole are usually only executed during the
% drawing of the edges, which is *after* the algorithm has finished.
-%
+%
% To overcome this problem, the following happens:
-%
+%
% The options in #4 are executed "tentatively" inside
% \pgfgdedge. However, this execution is done in a "heavily guarded
% sandbox" where all effects of the options (like changing the
@@ -579,7 +595,7 @@
% the changes of the graph drawing edge parameters leave the
% sandbox. These parameters are then passed down to the graph drawing
% engine.
-%
+%
% Later, when the edge is drawn using \pgfgdcallbackedge, the options #4
% are available once more and then they are executed normally.
%
@@ -587,9 +603,9 @@
% preset. Thus, you typically need to start it with, say, /tikz/.cd.
%
%
-% The text in #5 is some "auxilliary" text that is simply stored away
+% The text in #5 is some "auxiliary" text that is simply stored away
% and later directly to \pgfgdcallbackedge. This is a curtesy to TikZ,
-% which can use it to store its node labels.
+% which can use it to store its node labels.
%
% Example:
%
@@ -616,10 +632,10 @@
\endpgfinterruptpath%
}}%
\endgroup%
-}
+}%
\let\pgfgdprepareedge=\pgfutil@empty
-\def\pgfgdaddprepareedgehook#1{\expandafter\def\expandafter\pgfgdprepareedge\expandafter{\pgfgdprepareedge#1}}
+\def\pgfgdaddprepareedgehook#1{\expandafter\def\expandafter\pgfgdprepareedge\expandafter{\pgfgdprepareedge#1}}%
\newif\ifpgf@gd@nodes@behind@edges
@@ -629,14 +645,14 @@
% Define a callback for rendering edges
%
% #1 = macro name
-%
+%
% Descriptions:
-%
+%
% This is a callback from the graph drawing engine. At the end of the
% creation of a graph, when the nodes have been positioned, this macro
% is called once for each edge. The macro should take the following
% parameters:
-%
+%
% #1 = from node, optionally followed by "." and the tail anchor
% #2 = to node, optionally followed by "." and the head anchor
% #3 = direction (<-, --, ->, or <->)
@@ -644,28 +660,38 @@
% #5 = aux text (typically edge nodes)
% #6 = algorithm-generated options
% #7 = bend information
+% #8 = animations
%
% The first five parameters are the original values that were passed
% down to the \pgfgdedge command.
-%
+%
% #6 contains options that have been "computed by the algorithm". For
% instance, an algorithm might have determined, say, flow capacities
% for edges and it might now wish to communicate this information back
% to the upper layers. These options should be executed with the path
% /graph drawing.
-%
+%
% #7 contains algorithmically-computed information concerning how the
% edge should bend. This will be a text like
% "--(10pt,20pt)--(30pt,40pt)" in tikz-syntax, using the path
% operations "--", "..controls" and "--cycle".
-%
+%
% By default, a simple line is drawn between the nodes. Usually, you
% will wish to install a more "fancy" callback, here.
-\def\pgfgdsetedgecallback#1{\let\pgfgdcallbackedge=#1}
+\def\pgfgdsetedgecallback#1{\let\pgfgdcallbackedge=#1}%
-\def\pgfgddefaultedgecallback#1#2#3#4#5#6#7{%
+\def\pgfgddefaultedgecallback#1#2#3#4#5#6#7#8{%
{%
+ \def\pgf@temp{#8}%
+ \ifx\pgf@temp\pgfutil@empty%
+ \else%
+ \pgfset{every graphdrawing animation/.try}%
+ \pgfset{every graphdrawing edge animation/.try}%
+ #8%
+ \pgfuseid{pgf@gd}%
+ \pgfidscope%
+ \fi%
\pgfscope
\pgfpathmoveto{
\pgfutil@in@.{#1}%
@@ -685,14 +711,18 @@
}
\pgfusepath{stroke}
\endpgfscope
+ \ifx\pgf@temp\pgfutil@empty%
+ \else%
+ \endpgfidscope%
+ \fi%
}
-}
+}%
-\pgfgdsetedgecallback{\pgfgddefaultedgecallback}
+\pgfgdsetedgecallback{\pgfgddefaultedgecallback}%
\def\pgf@gd@unravel#1.#2\relax{%
\pgfpointanchor{#1}{#2}%
-}
+}%
@@ -709,7 +739,7 @@
\catcode`\@=11\relax%
\setbox\pgf@gd@prekind@box=\box\pgfutil@voidb@x%
\setbox\pgf@gd@postkind@box=\box\pgfutil@voidb@x%
-}
+}%
\def\pgfgdcallbackendshipout{%
\box\pgf@gd@prekind@box%
\ifpgf@gd@nodes@behind@edges%
@@ -721,7 +751,7 @@
\fi%
\box\pgf@gd@postkind@box%
\endpgfscope
-}
+}%
\newbox\pgf@gd@node@box
\newbox\pgf@gd@edge@box
@@ -730,23 +760,23 @@
\def\pgfgdcallbackbeginnodeshipout{%
\setbox\pgf@gd@node@box=\hbox\bgroup%
-}
+}%
\def\pgfgdcallbackendnodeshipout{%
\egroup%
-}
+}%
\def\pgfgdcallbackbeginedgeshipout{%
\setbox\pgf@gd@edge@box=\hbox\bgroup%
-}
+}%
\def\pgfgdcallbackendedgeshipout{%
\egroup
-}
+}%
-% Generate a node
+% Generate a node
%
% This callback is called from the engine whenever an algorithm
% generates a new node internally.
@@ -764,14 +794,14 @@
\pgfkeys{#3}
\pgfnode{#2}{\pgfkeysvalueof{/graph drawing/generated
node/anchor}}{#4}{#1}{\pgfkeysvalueof{/graph drawing/generated
- node/use path}}
+ node/use path}}
}
-}
+}%
\pgfkeys{
/graph drawing/generated node/anchor/.initial=center,
/graph drawing/generated node/use path/.initial=\pgfusepath{}
-}
+}%
@@ -779,49 +809,49 @@
% Sublayouts
%
% Description: For a general introduction to (sub)layouts, see
-% Section~\ref{section-gd-sublayouts} in the manual.
-%
+% Section~\ref{section-gd-sublayouts} in the manual.
+%
\def\pgfgdbeginlayout{
\begingroup
\pgfgdlayoutscopeactivetrue
\advance\pgf@gd@parameter@stack@height by1\relax%
\directlua{pgf.gd.interface.InterfaceToDisplay.pushLayout(\the\pgf@gd@parameter@stack@height)}
-}
+}%
\def\pgfgdendlayout{
\endgroup%
-}
+}%
% Creates a subgraph node
-%
+%
% #1 = name
% #2 = node options
% #3 = node text
-%
+%
% Description:
-%
+%
% A subgraph node is a node that "surrounds" the nodes of a
% subgraph. The special property of a subgraph node opposed to a
% normal node is that it is created only after the subgraph has been
% laid out. However, the difference to a collection like "hyper" is
-% that the node is availble immediately as a normal node in the sense
+% that the node is available immediately as a normal node in the sense
% that you can connect edges to it.
-%
+%
% What happens internally is that subgraph nodes get "registered"
% immediately both on the pgf level and on the lua level, but the
% actual node is only created inside the layout pipeline using a
% callback. The actual node creation happens when the innermost layout
% in which the subgraph node is declared has finished.
-%
+%
% When you create a subgraph node using this macro, you also start a
% collection (of an internal kind) that stores the subgraph. All
% following nodes in the current TeX scope will become part of this
-% collection.
-%
+% collection.
+%
% See |InterfaceToDisplay.pushSubgraphVertex| for details.
\def\pgfgdsubgraphnode#1#2#3{%
@@ -839,45 +869,45 @@
})
}%
}
-}
+}%
\def\pgfgdsubgraphnodecontents#1{% helper function
\hbox to \pgfkeysvalueof{/graph drawing/subgraph bounding box width}{%
\vrule width0pt height\pgfkeysvalueof{/graph drawing/subgraph bounding box height}\hfil}%
-}
+}%
\pgfgdset{
subgraph point cloud/.initial=,
subgraph bounding box width/.initial=,
subgraph bounding box height/.initial=,
-}
+}%
-%
+%
% Requests
-%
+%
% Description:
-%
+%
% This key is used to ``request'' a graph drawing scope and a
% layout. The objective of this key is to make it easier for users and
% algorithm designers to control the slightly involved
% back-and-forth-calling between the different layers.
-%
+%
% This key does the following: When called inside a pgfpicture
% (otherwise, the call is "illegal"), it will call a call-back with
% two parameters. This callback will get passed some code that should
% be executed at the beginning of ``the next scope'' and some code
% that should be executed at the end of that scope.
-%
+%
% The code passed to the callbacks will have a different effect,
% depending on whether we are currently inside a layout scope or not
-% (if no graph drawing scope is open, we are
+% (if no graph drawing scope is open, we are
% not inside a layout). If we are not inside a layout scope (or if the
% layout scope has been interrupted), the code will issue a
% \pgfgdbeginscope command in the opening code and a corresponding
% scope ending command in the closing code. Next, the two code pieces
% always contain \pgfgdbeginlayout and \pgfgdendlayout.
-%
+%
% Note that the "@request scope and layout" key will not immediately
% trigger a layout scope to be created; rather, the TikZ callback will
% call it only at the beginning of the scope, which will be after
@@ -887,39 +917,39 @@
% *after* the "@request scope and layout" key since the actual opening
% of the scope happens only before the "..." part is parsed.
-\pgfgdset{@request scope and layout/.code=\pgfgd@requestcallback{\pgfgdbeginrequest}{\pgfgdendrequest}}
+\pgfgdset{@request scope and layout/.code=\pgfgd@requestcallback{\pgfgdbeginrequest}{\pgfgdendrequest}}%
\def\pgfgd@requestcallback#1#2{%
#1\def\pgf@gd@after@request{#2\egroup}\bgroup\aftergroup\pgf@gd@after@request%
-} % Default for basic layer
+}% Default for basic layer
\def\pgfgdbeginrequest{%
\ifpgfgdlayoutscopeactive%
\else%
\expandafter\pgfgdbeginscope%
\fi%
- \pgfgdbeginlayout%
-}
+ \pgfgdbeginlayout%
+}%
\def\pgfgdendrequest{%
\pgfgdendlayout%
\ifpgfgdlayoutscopeactive%
\else%
\expandafter\pgfgdendscope%
- \fi%
-}
+ \fi%
+}%
\newif\ifpgfgdlayoutscopeactive
% Set the request callback
-%
+%
% #1 = A macro
-%
+%
% Description:
-%
+%
% Sets the request callback as described in the "@request scope and
% layout" key.
-\def\pgfgdsetrequestcallback#1{\let\pgfgd@requestcallback#1}
+\def\pgfgdsetrequestcallback#1{\let\pgfgd@requestcallback#1}%
@@ -932,7 +962,7 @@
% Begins a new graph drawing scope
-%
+%
% Description:
%
% Inside a graph drawing scope, all pgf nodes that are newly created
@@ -943,7 +973,7 @@
% explicitly, but have styles and keys invoke it internally.
%
% Usage:
-%
+%
% \pgfgdset{algorithm=somealgorithm}
% \pgfgdbeginscope
% \pgfnode{rectangle}{center}{A}{A}{}
@@ -953,9 +983,9 @@
% \pgfgdedge{B}{C}{->}{}{}
% \pgfgdedge{C}{A}{->}{}{}
% \pgfgdendscope
-%
+%
% Naturally, users will typically use TikZ's somewhat simpler syntax: '
-%
+%
% \tikz \graph [some algorithm] { A -> B -> C -> A };
\def\pgfgdbeginscope{%
@@ -975,7 +1005,7 @@
% Kill transformations (will be added by the position now
% macros)
\pgftransformreset
-}
+}%
@@ -987,7 +1017,7 @@
% Ends a graph drawing scope
-%
+%
% Description:
%
% This macro invokes the selected graph drawing algorithm and
@@ -1006,13 +1036,13 @@
\directlua{
pgf.gd.interface.InterfaceToDisplay.resumeGraphDrawingCoroutine()
}%
- \pgfutil@repeat%
+ \pgfutil@repeat%
\endgroup%
% Late positioning has ended
\directlua{pgf.gd.interface.InterfaceToDisplay.renderGraph()}%
\directlua{pgf.gd.interface.InterfaceToDisplay.endGraphDrawingScope()}%
\endgroup%
-}
+}%
@@ -1020,18 +1050,18 @@
% Hook into graph specification
-%
+%
% #1 = code
-%
+%
% Description:
-%
+%
% Allows you to specify code that should be active while the graph
% drawing engine collects the information concerning the graph, but
% which should no longer be active when the graph is rendered.
\def\pgfgdaddspecificationhook#1{
\expandafter\def\expandafter\pgfgd@latecallback\expandafter{\pgfgd@latecallback#1}
-}
+}%
\let\pgfgd@latecallback\pgfutil@empty
@@ -1046,24 +1076,24 @@
% Include a graph drawing library file.
%
% #1 = List of names of library file.
-%
+%
% Description:
%
% This command includes a list of graph drawing library files. For
% each file X in the list, the file pgf.gd.X.lua is included using
-% |require|.
+% |require|.
%
% For the convenience of Context users, both round and square brackets
% are possible for the argument.
-%
+%
%
% Example:
%
% \usegdlibrary{trees}
% \usegdlibrary[force,circular]
-\def\usegdlibrary{\pgfutil@ifnextchar[{\use@gdlibrary}{\use@@gdlibrary}}%}
-\def\use@gdlibrary[#1]{\use@@gdlibrary{#1}}
+\def\usegdlibrary{\pgfutil@ifnextchar[{\use@gdlibrary}{\use@@gdlibrary}}%}%
+\def\use@gdlibrary[#1]{\use@@gdlibrary{#1}}%
\def\use@@gdlibrary#1{%
\edef\pgf@list{#1}%
\pgfutil@for\pgf@temp:=\pgf@list\do{%
@@ -1075,56 +1105,49 @@
end}
\fi
}
-}
+}%
-% In the following code: Does anyone know how to determine the
-% file-system separator in Lua? Or in TeX?
-{
- \catcode`\%=11
+% LaTeX uses kpathsea for file lookup while ConTeXt uses its
+% resolvers. Luckily, kpathsea is still accessible in ConTeXt in a
+% subtable kpse.original which we use if kpse.find_file is nil.
+{%
+\catcode`\%=11
\directlua{
- function pgf_lookup_and_require(name)
- local sep = '/'
- if string.find(os.getenv('PATH'),';') then
- sep = '\string\\'
- end
- local function lookup(name)
- local sub = name:gsub('%.',sep)
- local find_func = function (name, suffix)
- if resolvers then
- local n = resolvers.findfile (name, suffix)
- return (not (n == '')) and n or nil
- else
- return kpse.find_file(name,suffix)
+ function pgf_lookup_and_require(name)
+ local sep = package.config:sub(1,1)
+ local function lookup(name)
+ local sub = name:gsub('%.',sep)
+ local find_file = context and
+ resolvers.findfile or
+ kpse.find_file
+ if find_file(sub, 'lua') then
+ require(name)
+ elseif find_file(sub, 'clua') then
+ collectgarbage('stop')
+ require(name)
+ collectgarbage('restart')
+ else
+ return false
+ end
+ return true
end
- end
- if find_func(sub, 'lua') then
- require(name)
- elseif find_func(sub, 'clua') then
- collectgarbage('stop')
- require(name)
- collectgarbage('restart')
- else
- return false
- end
- return true
+ return
+ lookup('pgf.gd.' .. name .. '.library') or
+ lookup('pgf.gd.' .. name) or
+ lookup(name .. '.library') or
+ lookup(name)
end
- return
- lookup('pgf.gd.' .. name .. '.library') or
- lookup('pgf.gd.' .. name) or
- lookup(name .. '.library') or
- lookup(name)
- end
-}
}
+}%
%
% Ok, fire up the system by creating the binding!
%
\directlua{
- require 'pgf.gd.interface.InterfaceToDisplay'
+ require 'pgf.gd.interface.InterfaceToDisplay'
pgf.gd.interface.InterfaceToDisplay.bind(require 'pgf.gd.bindings.BindingToPGF')
-}
+}%
@@ -1133,10 +1156,10 @@
% that have a special meaning on the display layer.
%
-\pgfkeys{/graph drawing/nodes behind edges/.append code=\csname pgf@gd@nodes@behind@edges#1\endcsname}
-\pgfkeys{/graph drawing/nodes behind edges/.default=true}
+\pgfkeys{/graph drawing/nodes behind edges/.append code=\csname pgf@gd@nodes@behind@edges#1\endcsname}%
+\pgfkeys{/graph drawing/nodes behind edges/.default=true}%
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.examples.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.examples.code.tex
index 4bfe4a839a3..c5c4997d627 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.examples.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.examples.code.tex
@@ -7,11 +7,11 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.examples.code.tex,v 1.2 2012/11/20 23:34:18 tantau Exp $
+\ProvidesFileRCS{pgflibrarygraphdrawing.examples.code.tex}
\usepgflibrary{graphdrawing}
\usegdlibrary{examples}
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.force.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.force.code.tex
index 3950a9062e1..cd6851466a3 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.force.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.force.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/graphdrawing/tex/pgflibrarygraphdrawing.force.code.tex,v 1.7 2012/11/20 23:34:18 tantau Exp $
+\ProvidesFileRCS{pgflibrarygraphdrawing.force.code.tex}
@@ -34,23 +34,23 @@
%
initial step dimension/.graph parameter=number,
initial step dimension/.parameter initial=0,
- %
+ %
convergence tolerance/.graph parameter=number,
convergence tolerance/.parameter initial=0.01,
%
spring constant/.graph parameter=number,
spring constant/.parameter initial=0.01,
- %
+ %
approximate electric forces/.graph parameter=boolean,
approximate electric forces/.parameter initial=false,
approximate electric forces/.default=true,
- %
+ %
electric force order/.graph parameter=number,
electric force order/.parameter initial=1,
%
% Parameters related to the multilevel approach where the input graph
% is iteratively coarsened into graphs with fewer nodes, until either
- % the number of nodes is small enough or the number of nodes in the
+ % the number of nodes is small enough or the number of nodes in the
% could not be reduced by at least a user-defined ratio.
%
coarsen/.graph parameter=boolean,
@@ -103,10 +103,10 @@
algorithm=pgf.gd.force.SpringHu2006
}
-
+
%
% Spring-electrical algorithm based on the paper
-%
+%
% "Efficient, High-Quality Force-Directed Graph Drawing"
% Yifan Hu, 2006
%
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.layered.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.layered.code.tex
index 37f28bc304a..794fff40275 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.layered.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.layered.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/graphdrawing/tex/pgflibrarygraphdrawing.layered.code.tex,v 1.5 2012/11/20 23:34:18 tantau Exp $
+\ProvidesFileRCS{pgflibrarygraphdrawing.layered.code.tex}
\usepgflibrary{graphdrawing}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.trees.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.trees.code.tex
index 7d0a9ed35b0..10231f221ad 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.trees.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.trees.code.tex
@@ -8,7 +8,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/tex/pgflibrarygraphdrawing.trees.code.tex,v 1.8 2012/11/20 23:34:18 tantau Exp $
+\ProvidesFileRCS{pgflibrarygraphdrawing.trees.code.tex}
\usepgflibrary{graphdrawing}
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/tikzlibrarygraphdrawing.code.tex b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/tikzlibrarygraphdrawing.code.tex
index 3c3532b394d..0967f817d27 100644
--- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/tikzlibrarygraphdrawing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/tex/tikzlibrarygraphdrawing.code.tex
@@ -8,16 +8,16 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/tex/tikzlibrarygraphdrawing.code.tex,v 1.20 2013/08/05 18:22:47 tantau Exp $
+\ProvidesFileRCS{tikzlibrarygraphdrawing.code.tex}
-\usepgflibrary{graphdrawing}
+\usepgflibrary{graphdrawing}%
-\def\tikz@lib@ensure@gd@loaded{}
+\def\tikz@lib@ensure@gd@loaded{}%
% Patch the level and sibling distances so that gd and plain tikz are
% in sync
-\tikzset{level distance=1cm, sibling distance=1cm}
+\tikzset{level distance=1cm, sibling distance=1cm}%
% Patch node distance because of its special syntax.
@@ -31,27 +31,27 @@
\else%
\tikz@gd@convert@and#1 and #1\pgf@stop%
\fi%
-}
-\def\tikz@gd@convert@and#1 and #2\pgf@stop{\pgfkeys{/graph drawing/node distance/orig={#1}}}
+}%
+\def\tikz@gd@convert@and#1 and #2\pgf@stop{\pgfkeys{/graph drawing/node distance/orig={#1}}}%
%
% Setup graph drawing for tikz
-%
+%
\def\tikz@gd@request@callback#1#2{%
\tikzset{
execute at begin scope={
- \tikzset{
+ \tikzset{
--/.style={arrows=-},
-!-/.style={draw=none,fill=none},
- }
+ }
\pgfgdsetedgecallback{\pgfgdtikzedgecallback}%
- %
+ %
% Setup for plain syntax
- %
+ %
\pgfgdaddspecificationhook{\tikz@lib@gd@spec@hook}%
#1
\let\tikzgdeventcallback\pgfgdevent%
@@ -62,27 +62,27 @@
#2%
}
}%
-}
+}%
\pgfgdsetrequestcallback\tikz@gd@request@callback
-\pgfgdappendtoforwardinglist{/tikz/,/tikz/graphs/}
+\pgfgdappendtoforwardinglist{/tikz/,/tikz/graphs/}%
\def\tikz@lib@gd@spec@hook{%
\tikzset{
edge macro=\tikz@gd@plain@edge@macro,
/tikz/at/.style={/graph drawing/desired at={##1}},
- %
+ %
% Setup for the tree syntax (do this late so that grow options
% are still valid after a layout has been chosen)
- %
+ %
/tikz/growth function=\relax,
/tikz/edge from parent macro=\tikz@gd@edge@from@parent@macro,
- %
- % Setup for the graphs syntax
- %
+ %
+ % Setup for the graphs syntax
+ %
/tikz/graphs/new ->/.code n args={4}{\pgfgdedge{##1}{##2}{->}{/tikz,##3}{##4}},
/tikz/graphs/new <-/.code n args={4}{\pgfgdedge{##1}{##2}{<-}{/tikz,##3}{##4}},
/tikz/graphs/new --/.code n args={4}{\pgfgdedge{##1}{##2}{--}{/tikz,##3}{##4}},
@@ -90,41 +90,58 @@
/tikz/graphs/new -!-/.code n args={4}{\pgfgdedge{##1}{##2}{-!-}{/tikz,##3}{##4}},
/tikz/graphs/placement/compute position/.code=,%
}
-}
+}%
\pgfgdaddprepareedgehook{
\tikz@enable@edge@quotes%
\let\tikz@transform=\pgfutil@empty%
\let\tikz@options=\pgfutil@empty%
\let\tikz@tonodes=\pgfutil@empty%
-}
+}%
\tikzset{
parent anchor/.forward to=/graph drawing/tail anchor,
child anchor/.forward to=/graph drawing/head anchor
-}
+}%
-\def\pgfgdtikzedgecallback#1#2#3#4#5#6#7{%
- \draw (#1)
- edge [to path={#7 \tikztonodes},#3,#4,/graph drawing/.cd,#6,/tikz/.cd]
- #5
- (#2);
-}
+\def\pgfgdtikzedgecallback#1#2#3#4#5#6#7#8{%
+ \def\pgf@temp{#8}%
+ \ifx\pgf@temp\pgfutil@empty%
+ \else%
+ \pgfscope%
+ \pgfset{every graphdrawing animation/.try}%
+ \pgfset{every graphdrawing edge animation/.try}%
+ #8%
+ \pgfuseid{pgf@gd}%
+ \pgfidscope%
+ \fi%
+ \begingroup
+ \draw (#1)
+ edge [to path={#7 \tikztonodes},#3,#4,/graph drawing/.cd,#6,/tikz/.cd]
+ #5
+ (#2);
+ \endgroup
+ \ifx\pgf@temp\pgfutil@empty%
+ \else%
+ \endpgfidscope%
+ \endpgfscope%
+ \fi%
+}%
\def\tikz@gd@edge@from@parent@macro#1#2{
[/utils/exec=\pgfgdedge{\tikzparentnode}{\tikzchildnode}{--}{/tikz,#1}{#2}]
-}
+}%
\def\tikz@gd@plain@edge@macro#1#2{
\pgfgdedge{\tikztostart}{\tikztotarget}{--}{/tikz,#1}{#2}
-}
+}%
-%
+%
% Conversions: Convert coordinates into pairs of values surrounded by
-% braces.
+% braces.
%
\pgfgdset{
@@ -140,7 +157,7 @@
\pgfmathsetmacro{\tikz@gd@temp@y}{\pgf@y}
\edef\pgfgdresult{pgf.gd.model.Coordinate.new(\tikz@gd@temp@x,\tikz@gd@temp@y)}
}
-}
+}%
@@ -150,11 +167,11 @@
\def\pgfgdcallbackcreatevertex#1#2#3#4{%
\node[every generated node/.try,name={#1},shape={#2},/graph drawing/.cd,#3]{#4};%
-}
+}%
-%
-% Subgraph handling
+%
+% Subgraph handling
%
% "General" text placement for subgraph nodes that works with all node
@@ -173,7 +190,7 @@
\vrule width0pt height.5\pgf@y depth.5\pgf@y\hfil}%
}%
},
-}
+}%
\def\tikz@lg@simple@contents@top#1{%
\def\pgfgdsubgraphnodecontents##1{%
@@ -190,13 +207,13 @@
\fi%
\fi%
\pgfmathparse{\pgfkeysvalueof{/tikz/subgraph text sep}}%
- \kern\pgfmathresult pt\relax%
+ \kern\pgfmathresult pt\relax%
\pgf@y=\pgfkeysvalueof{/graph drawing/subgraph bounding box height}\relax%
\hbox to \pgfkeysvalueof{/graph drawing/subgraph bounding box width}{%
\vrule width0pt height.5\pgf@y depth.5\pgf@y\hfil}%
}%
}%
-}
+}%
\def\tikz@lg@simple@contents@bottom#1{%
\def\pgfgdsubgraphnodecontents##1{%
@@ -205,7 +222,7 @@
\setbox0=\vbox{%
\hbox to \pgfkeysvalueof{/graph drawing/subgraph bounding box width}{\vrule width0pt height\pgf@y\hfil}%
\pgfmathparse{\pgfkeysvalueof{/tikz/subgraph text sep}}%
- \kern\pgfmathresult pt\relax%
+ \kern\pgfmathresult pt\relax%
\def\pgf@temp{##1}%
\ifx\pgf@temp\pgfutil@empty%
\else%
@@ -225,15 +242,15 @@
\box0\relax%
}%
}%
-}
+}%
-\tikzset{subgraph text top}
+\tikzset{subgraph text top}%
\tikzset{
subgraph nodes/.style={/tikz/every subgraph node/.style={#1}},
graphs/subgraph nodes/.style={/tikz/every subgraph node/.style={#1}},
graphs/@graph drawing setup/.style={/graph drawing/anchor at={(\tikz@lastx,\tikz@lasty)}}
-}
+}%
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
index 7eb1b719329..da124ee8401 100644
--- 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
@@ -7,9 +7,9 @@
%
% 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 $
+\ProvidesFileRCS{pgflibrarydatavisualization.barcharts.code.tex}
-\usepgfmodule{datavisualization}
+\usepgfmodule{datavisualization}%
%
@@ -18,22 +18,22 @@
\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};
-
+{%
+ \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}
@@ -53,15 +53,15 @@
\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() {
{
@@ -122,14 +122,14 @@
\else
\pgfoovalueof{use path fall}
\fi
- \end{pgfscope}
+ \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
index ae62fd31839..540901936fe 100644
--- 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
@@ -7,9 +7,9 @@
%
% 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.4 2011/03/14 23:17:52 tantau Exp $
+\ProvidesFileRCS{pgflibrarydatavisualization.formats.functions.code.tex}
-\usepgfmodule{datavisualization}
+\usepgfmodule{datavisualization}%
@@ -36,27 +36,27 @@
%
% 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.
+% 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
+% Newlines are not important, 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
+% ranges through 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];",
+% 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
+% default this is set to \pgfmathparse, but
% you can use a different parser, if you like.
%
% Example:
@@ -104,15 +104,15 @@
\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}
+ /pgf/data/samples/.initial=25}%
-\def\pgf@lib@dv@getval#1{\pgfkeysvalueof{/data point/#1}}
+\def\pgf@lib@dv@getval#1{\pgfkeysvalueof{/data point/#1}}%
\def\pgf@lib@dv@func@parse{%
\pgfutil@ifnextchar\pgf@stop{% done
@@ -125,17 +125,17 @@
\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 :{\pgfutil@ifnextchar\bgroup{\pgf@lib@dv@var@group{#1}}{\pgf@lib@dv@var@int{#1}}}
+}%
+\def\pgf@lib@dv@var var #1 :{\pgfutil@ifnextchar\bgroup{\pgf@lib@dv@var@group{#1}}{\pgf@lib@dv@var@int{#1}}}%
\def\pgf@lib@dv@var@group#1#2;{%
\expandafter\def\expandafter\pgf@lib@dv@parsed\expandafter{\pgf@lib@dv@parsed\pgf@lib@dv@group@var{#1}{#2}}%
\pgf@lib@dv@func@parse%
-}
+}%
\def\pgf@lib@dv@var@int#1#2[#3:#4]{%
\pgfutil@ifnextchar s{%
\pgf@lib@dv@samplesorsteps{#1}{#3}{#4}%
@@ -144,22 +144,22 @@
\pgf@lib@dv@parsed\pgf@lib@dv@samples@var{#1}{#3}{#4}{\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...
@@ -172,7 +172,7 @@
\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{%
{%
@@ -191,19 +191,19 @@
\pgfkeyslet{/data point/#1}{\pgfmathresult}%
\repeatpgfmathloop%%
}%
-}
+}%
\def\pgf@lib@dv@group@var#1#2#3\pgf@stop{%
\foreach \pgf@lib@dv@iterator in {#2} {%
\pgfkeyslet{/data point/#1}{\pgf@lib@dv@iterator}%
#3\pgf@stop%
}%
-}
+}%
\def\pgf@lib@dv@eval@func#1#2{%
\pgfkeysvalueof{/pgf/data/evaluator}{#2}%
- \pgfkeyslet{/data point/#1}{\pgfmathresult}%
-}
+ \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
index 36e51541cee..f56ebe3e7f0 100644
--- 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
@@ -7,35 +7,35 @@
%
% 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.4 2011/02/22 22:07:24 tantau Exp $
+\ProvidesFileRCS{pgflibrarydatavisualization.polar.code.tex}
-\usepgfmodule{datavisualization}
+\usepgfmodule{datavisualization}%
% This file defines code for doing plots involving polar
% coordinates. This includes not only standard polar plots, but also
-% pie charts.
+% pie charts.
\pgfooclass{polar transformer}
-{
- % Class plor mapper
+{%
+ % Class polar 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;
+
+ \attribute angle;%
% The attribute from which the angle is read.
-
- \attribute radius;
+
+ \attribute radius;%
% The attribute from which the radius is read.
-
- \attribute unit vector 0 degrees;
+
+ \attribute unit vector 0 degrees;%
% The unit vector 0 degrees
-
- \attribute unit vector 90 degrees;
+
+ \attribute unit vector 90 degrees;%
% The unit vector 90 degrees
@@ -52,7 +52,7 @@
\pgfooset{radius}{#2}
\pgfooset{unit vector 0 degrees}{#3}
\pgfooset{unit vector 90 degrees}{#4}
- }
+ }%
% Method
\method default connects() {
@@ -60,18 +60,18 @@
\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
@@ -105,10 +105,10 @@
\fi%
\fi%
\fi%
- }
+ }%
+
-
% Reaction to the path signal
%
% Here is what we do: When a pgfdvpathmoveto is done, the radius and
@@ -118,9 +118,9 @@
% the lineto is caught and replaced by an arc from the previous
% position to the new position.
- \attribute prev angle;
- \attribute prev radius;
-
+ \attribute prev angle;%
+ \attribute prev radius;%
+
\method path(#1) {%
\ifpgfdvhandled%
\else%
@@ -160,7 +160,7 @@
% No matter what, record the current position
\pgfooeset{prev angle}{\pgfkeysvalueof{/data point/\pgfoovalueof{angle}}}
\pgfooeset{prev radius}{\pgfkeysvalueof{/data point/\pgfoovalueof{radius}}}
- }
+ }%
% Method
%
@@ -191,10 +191,8 @@
\fi%
\fi%
\fi\fi%
- }
-}
+ }%
+}%
\endinput
-
-
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.footprints.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.footprints.code.tex
index 5cf633d0c59..369a0ecbd09 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.footprints.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.footprints.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgfmodule{decorations}
+\usepgfmodule{decorations}%
% Parameters
@@ -22,12 +22,12 @@
/pgf/decoration/foot angle/.initial=10,
% What animal?
/pgf/decoration/foot of/.initial=human,
-}
+}%
\pgfdeclaredecoration{footprints}{left}
-{
+{%
\state{left}[width=\pgfkeysvalueof{/pgf/decoration/stride length}/2,next state=right]
{
\pgftransformyshift{\pgfkeysvalueof{/pgf/decoration/foot sep}/2}
@@ -35,7 +35,7 @@
\pgftransformscale{\pgfmathresult}
\pgftransformrotate{\pgfkeysvalueof{/pgf/decoration/foot angle}}
\csname pgf@lib@foot@of@\pgfkeysvalueof{/pgf/decoration/foot of}\endcsname
- }
+ }%
\state{right}[width=\pgfkeysvalueof{/pgf/decoration/stride length}/2,next state=left]
{
\pgftransformyscale{-1}
@@ -44,23 +44,23 @@
\pgftransformscale{\pgfmathresult}
\pgftransformrotate{\pgfkeysvalueof{/pgf/decoration/foot angle}}
\csname pgf@lib@foot@of@\pgfkeysvalueof{/pgf/decoration/foot of}\endcsname
- }
-}
+ }%
+}%
-% Actual footprints.
+% Actual footprints.
%
% A footprint must be name \pgf@lib@foot@of@XXX, be a left foot and
% should fill a rectangle of (0,0) rectangle (1pt,1pt) (more or less)
-% and point right.
+% and point right.
%
\def\pgf@lib@foot@of@gnome{
% Coordinates from a Gnome logo on wikimedia commons. LGPL
% license... Unknown author.
- %
+ %
% Flip and rotate
\pgftransformcm{0}{-1}{-1}{0}{\pgfqpoint{1pt}{0.8pt}}
\pgftransformscale{0.83333}
@@ -68,23 +68,23 @@
\pgfpathcurveto{\pgfqpoint{.61466pt}{0pt}}{\pgfqpoint{.56851pt}{.35041pt}}{\pgfqpoint{.70691pt}{.35041pt}}
\pgfpathcurveto{\pgfqpoint{.84529pt}{.35041pt}}{\pgfqpoint{1.10671pt}{0pt}}{\pgfqpoint{.86068pt}{0pt}}
\pgfpathclose
- %
+ %
\pgfpathmoveto{\pgfqpoint{.45217pt}{.30699pt}}
\pgfpathcurveto{\pgfqpoint{.52586pt}{.31149pt}}{\pgfqpoint{.60671pt}{.02577pt}}{\pgfqpoint{.46821pt}{.04374pt}}
\pgfpathcurveto{\pgfqpoint{.32976pt}{.06171pt}}{\pgfqpoint{.37845pt}{.30249pt}}{\pgfqpoint{.45217pt}{.30699pt}}
\pgfpathclose
- %
+ %
\pgfpathmoveto{\pgfqpoint{.11445pt}{.48453pt}}
\pgfpathcurveto{\pgfqpoint{.16686pt}{.46146pt}}{\pgfqpoint{.1212pt}{.23581pt}}{\pgfqpoint{.03208pt}{.29735pt}}
\pgfpathcurveto{\pgfqpoint{-.057pt}{.3589pt}}{\pgfqpoint{.06204pt}{.50759pt}}{\pgfqpoint{.11445pt}{.48453pt}}
\pgfpathclose
- %
+ %
\pgfpathmoveto{\pgfqpoint{.26212pt}{.36642pt}}
\pgfpathcurveto{\pgfqpoint{.32451pt}{.3537pt}}{\pgfqpoint{.32793pt}{.09778pt}}{\pgfqpoint{.21667pt}{.14369pt}}
\pgfpathcurveto{\pgfqpoint{.10539pt}{.18961pt}}{\pgfqpoint{.19978pt}{.37916pt}}{\pgfqpoint{.26212pt}{.36642pt}}
\pgfpathlineto{\pgfqpoint{.26212pt}{.36642pt}}
\pgfpathclose
- %
+ %
\pgfpathmoveto{\pgfqpoint{.58791pt}{.93913pt}}
\pgfpathcurveto{\pgfqpoint{.59898pt}{1.02367pt}}{\pgfqpoint{.52589pt}{1.06542pt}}{\pgfqpoint{.45431pt}{1.01092pt}}
\pgfpathcurveto{\pgfqpoint{.22644pt}{.83743pt}}{\pgfqpoint{.8316pt}{.75088pt}}{\pgfqpoint{.79171pt}{.51386pt}}
@@ -94,7 +94,7 @@
\pgfpathcurveto{\pgfqpoint{.8358pt}{.82589pt}}{\pgfqpoint{.57867pt}{.8686pt}}{\pgfqpoint{.58791pt}{.93913pt}}
\pgfpathlineto{\pgfqpoint{.58791pt}{.93913pt}}
\pgfpathclose
-}
+}%
@@ -118,14 +118,14 @@
\pgfpathcurveto{\pgfqpoint{-3.4844pt}{2.9162pt}}{\pgfqpoint{-2.6164pt}{1.654pt}}{\pgfqpoint{-1.454pt}{1.3886pt}}
\pgfpathcurveto{\pgfqpoint{-1.0876pt}{1.305pt}}{\pgfqpoint{-1.0296pt}{1.3066pt}}{\pgfqpoint{-.886pt}{1.652pt}}
\pgfpathclose
-}
+}%
\expandafter\def\csname pgf@lib@foot@of@felis silvestris\endcsname{
% Coordinates derived from vector image created by Mark Wibrow, based
% on the forefoot of `felis silvestris' shown in
% Pearson, B. and Burton, J. A. (1980), `Wild Animals', Collins, 155.
- %
+ %
\pgftransformcm{0}{.1}{.1}{0}{\pgfqpoint{.48pt}{.5pt}}
\pgfpathmoveto{\pgfqpoint{2.7312pt}{-1.992pt}}
\pgfpathcurveto{\pgfqpoint{1.8716pt}{-1.4226pt}}{\pgfqpoint{2.1404pt}{.0436pt}}{\pgfqpoint{.9202pt}{.0436pt}}
@@ -151,30 +151,30 @@
\pgfpathcurveto{\pgfqpoint{2.8534pt}{.7868pt}}{\pgfqpoint{3.4658pt}{1.2838pt}}{\pgfqpoint{3.6872pt}{2.0152pt}}
\pgfpathcurveto{\pgfqpoint{3.9084pt}{2.7466pt}}{\pgfqpoint{3.655pt}{3.4358pt}}{\pgfqpoint{3.1212pt}{3.5542pt}}
\pgfpathclose
- %
+ %
\pgfpathmoveto{\pgfqpoint{-.6182pt}{5.0456pt}}
\pgfpathcurveto{\pgfqpoint{-1.2132pt}{5.0456pt}}{\pgfqpoint{-1.6956pt}{4.3104pt}}{\pgfqpoint{-1.6956pt}{3.4038pt}}
\pgfpathcurveto{\pgfqpoint{-1.6956pt}{2.4972pt}}{\pgfqpoint{-1.2132pt}{1.7618pt}}{\pgfqpoint{-.6182pt}{1.7618pt}}
\pgfpathcurveto{\pgfqpoint{-.0232pt}{1.7618pt}}{\pgfqpoint{.4592pt}{2.4972pt}}{\pgfqpoint{.4592pt}{3.4038pt}}
\pgfpathcurveto{\pgfqpoint{.4592pt}{4.3104pt}}{\pgfqpoint{-.0232pt}{5.0456pt}}{\pgfqpoint{-.6182pt}{5.0456pt}}
\pgfpathclose
- %
+ %
\pgfpathmoveto{\pgfqpoint{-4.1176pt}{1.8248pt}}
\pgfpathcurveto{\pgfqpoint{-4.6334pt}{1.7534pt}}{\pgfqpoint{-4.9806pt}{1.0312pt}}{\pgfqpoint{-4.8928pt}{.212pt}}
\pgfpathcurveto{\pgfqpoint{-4.8052pt}{-.6072pt}}{\pgfqpoint{-4.3158pt}{-1.2136pt}}{\pgfqpoint{-3.8pt}{-1.1422pt}}
\pgfpathcurveto{\pgfqpoint{-3.2842pt}{-1.0708pt}}{\pgfqpoint{-2.9372pt}{-.3486pt}}{\pgfqpoint{-3.0248pt}{.4706pt}}
\pgfpathcurveto{\pgfqpoint{-3.1126pt}{1.2898pt}}{\pgfqpoint{-3.6018pt}{1.8962pt}}{\pgfqpoint{-4.1176pt}{1.8248pt}}
\pgfpathclose
-}
+}%
\def\pgf@lib@foot@of@human{%
% Coordinates derived from vector image created by Mark Wibrow.
\pgftransformcm{0}{.5}{.5}{0}{\pgfqpoint{.48pt}{.2pt}}
- %
+ %
% Draw main part of foot.
- %
+ %
\pgfpathmoveto{\pgfqpoint{.20175pt}{-.72633pt}}
\pgfpathcurveto{\pgfqpoint{.16314pt}{-.88194pt}}{\pgfqpoint{.07386pt}{-1.0167pt}}{\pgfqpoint{-.08385pt}{-1.0167pt}}
\pgfpathcurveto{\pgfqpoint{-.24153pt}{-1.0167pt}}{\pgfqpoint{-.36942pt}{-.84897pt}}{\pgfqpoint{-.36942pt}{-.72633pt}}
@@ -189,7 +189,7 @@
\pgfpathclose
%
% Draw toe.s
- %
+ %
\pgfpathmoveto{\pgfqpoint{-.27138pt}{1.01451pt}}
\pgfpathcurveto{\pgfqpoint{-.21198pt}{1.01451pt}}{\pgfqpoint{-.1638pt}{.94509pt}}{\pgfqpoint{-.1638pt}{.8595pt}}
\pgfpathcurveto{\pgfqpoint{-.1638pt}{.77388pt}}{\pgfqpoint{-.21198pt}{.70446pt}}{\pgfqpoint{-.27138pt}{.70446pt}}
@@ -210,21 +210,21 @@
\pgfpathcurveto{\pgfqpoint{.0453pt}{.66699pt}}{\pgfqpoint{.02019pt}{.70602pt}}{\pgfqpoint{.0264pt}{.74874pt}}
\pgfpathcurveto{\pgfqpoint{.03261pt}{.79149pt}}{\pgfqpoint{.0678pt}{.82176pt}}{\pgfqpoint{.10497pt}{.81636pt}}
\pgfpathclose
- %
+ %
\pgfpathmoveto{\pgfqpoint{.24054pt}{.70842pt}}
\pgfpathcurveto{\pgfqpoint{.27513pt}{.70842pt}}{\pgfqpoint{.30318pt}{.67686pt}}{\pgfqpoint{.30318pt}{.63795pt}}
\pgfpathcurveto{\pgfqpoint{.30318pt}{.59904pt}}{\pgfqpoint{.27513pt}{.56751pt}}{\pgfqpoint{.24054pt}{.56751pt}}
\pgfpathcurveto{\pgfqpoint{.20598pt}{.56751pt}}{\pgfqpoint{.17793pt}{.59904pt}}{\pgfqpoint{.17793pt}{.63795pt}}
\pgfpathcurveto{\pgfqpoint{.17793pt}{.67686pt}}{\pgfqpoint{.20598pt}{.70842pt}}{\pgfqpoint{.24054pt}{.70842pt}}
\pgfpathclose
- %
+ %
\pgfpathmoveto{\pgfqpoint{.35973pt}{.57501pt}}
\pgfpathcurveto{\pgfqpoint{.3918pt}{.57501pt}}{\pgfqpoint{.41781pt}{.54852pt}}{\pgfqpoint{.41781pt}{.51585pt}}
\pgfpathcurveto{\pgfqpoint{.41781pt}{.48318pt}}{\pgfqpoint{.3918pt}{.45669pt}}{\pgfqpoint{.35973pt}{.45669pt}}
\pgfpathcurveto{\pgfqpoint{.32769pt}{.45669pt}}{\pgfqpoint{.30168pt}{.48318pt}}{\pgfqpoint{.30168pt}{.51585pt}}
\pgfpathcurveto{\pgfqpoint{.30168pt}{.54852pt}}{\pgfqpoint{.32769pt}{.57501pt}}{\pgfqpoint{.35973pt}{.57501pt}}
\pgfpathclose
-}
+}%
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.fractals.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.fractals.code.tex
index 22c9d8d1b27..2327c770295 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.fractals.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.fractals.code.tex
@@ -7,12 +7,12 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgfmodule{decorations}
+\usepgfmodule{decorations}%
\pgfdeclaredecoration{Koch curve type 1}{init}
-{
+{%
\state{init}[width=\pgfdecoratedinputsegmentremainingdistance]
{
\pgfpathlineto{\pgfpoint{.33333\pgfdecoratedinputsegmentremainingdistance}{0pt}}
@@ -20,11 +20,11 @@
\pgfpathlineto{\pgfpoint{.66666\pgfdecoratedinputsegmentremainingdistance}{.33333\pgfdecoratedinputsegmentremainingdistance}}
\pgfpathlineto{\pgfpoint{.66666\pgfdecoratedinputsegmentremainingdistance}{0pt}}
\pgfpathlineto{\pgfpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}
- }
-}
+ }%
+}%
\pgfdeclaredecoration{Koch curve type 2}{init}
-{
+{%
\state{init}[width=\pgfdecoratedinputsegmentremainingdistance]
{
\pgfpathlineto{\pgfpoint{.25\pgfdecoratedinputsegmentremainingdistance}{0pt}}
@@ -35,31 +35,31 @@
\pgfpathlineto{\pgfpoint{.75\pgfdecoratedinputsegmentremainingdistance}{-.25\pgfdecoratedinputsegmentremainingdistance}}
\pgfpathlineto{\pgfpoint{.75\pgfdecoratedinputsegmentremainingdistance}{0pt}}
\pgfpathlineto{\pgfpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}
- }
-}
+ }%
+}%
\pgfdeclaredecoration{Koch snowflake}{init}
-{
+{%
\state{init}[width=\pgfdecoratedinputsegmentremainingdistance]
{
\pgfpathlineto{\pgfpoint{.3333\pgfdecoratedinputsegmentremainingdistance}{0pt}}
\pgfpathlineto{\pgfpoint{.5\pgfdecoratedinputsegmentremainingdistance}{0.2886751347\pgfdecoratedinputsegmentremainingdistance}}
\pgfpathlineto{\pgfpoint{.6666\pgfdecoratedinputsegmentremainingdistance}{0pt}}
\pgfpathlineto{\pgfpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}
- }
-}
+ }%
+}%
\pgfdeclaredecoration{Cantor set}{init}
-{
+{%
\state{init}[width=\pgfdecoratedinputsegmentremainingdistance]
{
\pgfpathlineto{\pgfpoint{.3333\pgfdecoratedinputsegmentremainingdistance}{0pt}}
\pgfpathmoveto{\pgfpoint{.6666\pgfdecoratedinputsegmentremainingdistance}{0pt}}
\pgfpathlineto{\pgfpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}
- }
-}
+ }%
+}%
-\endinput \ No newline at end of file
+\endinput
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
index 546301c4d07..6a17dbe3c0a 100644
--- 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
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgfmodule{decorations}
+\usepgfmodule{decorations}%
% A marking decoration is used to add markings (which are just pgf
@@ -16,37 +16,37 @@
\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@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{%
\pgftransformxscale{#1}
\pgfarrowdraw{#2}%
-}
+}%
\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,
@@ -56,8 +56,8 @@
},
next state=pre
]
- {}
-
+ {}%
+
\state{pre}
[
width=0pt,
@@ -69,11 +69,11 @@
},
next state=skipper
]
- {}
+ {}%
\state{skipper}[width=\pgf@lib@dec@computed@width-\pgfdecoratedcompleteddistance-1sp,
- next state=\pgf@lib@dec@next@state]{}
-
+ next state=\pgf@lib@dec@next@state]{}%
+
\state{main}
[
width=1sp,
@@ -104,15 +104,15 @@
\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{%
@@ -124,7 +124,7 @@
% 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
@@ -134,7 +134,7 @@
\def\pgf@lib@dec@computed@action{#4}%
\def\pgf@lib@dec@next@state{main}%
\fi%
-}
+}%
\def\pgf@lib@dec@parsenum#1{%
@@ -145,28 +145,28 @@
\else%
\pgfmathparse{\pgfmathresult pt}%
\fi%
- \else%
+ \else%
\ifdim\pgfmathresult pt<0pt\relax%
\pgfmathparse{\pgfdecoratedpathlength\pgfmathresult*\pgfdecoratedpathlength}%
\else%
\pgfmathparse{\pgfmathresult*\pgfdecoratedpathlength}%
\fi%
\fi%
- \edef\pgf@lib@dec@computed@width{\pgfmathresult pt}%
-}
+ \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
+% 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=}
+ /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}}}
@@ -175,4 +175,4 @@
}%
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathmorphing.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathmorphing.code.tex
index a6052489796..3f628da582d 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathmorphing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathmorphing.code.tex
@@ -7,12 +7,12 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgfmodule{decorations}
+\usepgfmodule{decorations}%
%
% These decorations "morph" paths. That means that the
-% orginal characteristic of the path is kept and the number of
+% original characteristic of the path is kept and the number of
% subpaths remains the same -- only, the lines are slightly offset or
% changed by the decoration. For instance a line might be turned into
% a squiggly line or a snaking line or a bumping line.
@@ -28,31 +28,31 @@
% zigzag decoration.
%
-\pgfdeclaredecoration{zigzag}{up from center}{
+\pgfdeclaredecoration{zigzag}{up from center}{%
\state{up from center}[width=+.5\pgfdecorationsegmentlength, next state=big down]
{
\pgfpathlineto{\pgfqpoint{.25\pgfdecorationsegmentlength}{\pgfdecorationsegmentamplitude}}
- }
+ }%
\state{big down}[switch if less than=+.5\pgfdecorationsegmentlength to center finish,
width=+.5\pgfdecorationsegmentlength,
next state=big up]
{
\pgfpathlineto{\pgfqpoint{.25\pgfdecorationsegmentlength}{-\pgfdecorationsegmentamplitude}}
- }
+ }%
\state{big up}[switch if less than=+.5\pgfdecorationsegmentlength to center finish,
width=+.5\pgfdecorationsegmentlength,
next state=big down]
{
\pgfpathlineto{\pgfqpoint{.25\pgfdecorationsegmentlength}{\pgfdecorationsegmentamplitude}}
- }
+ }%
\state{center finish}[width=0pt, next state=final]{
\pgfpathlineto{\pgfpointorigin}
- }
+ }%
\state{final}
{
\pgfpathlineto{\pgfpointdecoratedpathlast}
- }
-}
+ }%
+}%
@@ -62,17 +62,17 @@
% Parameters: \pgfdecorationsegmentamplitude, \pgfdecorationsegmentlength
\pgfdeclaredecoration{saw}{initial}
-{
+{%
\state{initial}[auto end on length=+\pgfdecorationsegmentlength,
auto corner on length=+\pgfdecorationsegmentlength,
width=+\pgfdecorationsegmentlength]
{
\pgfpathlineto{\pgfqpoint{\pgfdecorationsegmentlength}{\pgfdecorationsegmentamplitude}}
\pgfpathlineto{\pgfqpoint{\pgfdecorationsegmentlength}{0pt}}
- }
+ }%
\state{final}
- {}
-}
+ {}%
+}%
@@ -84,10 +84,10 @@
% Parameters: \pgfdecorationsegmentamplitude, \pgfdecorationsegmentlength
\pgfdeclaredecoration{random steps}{start}
-{
- \state{start}[width=+0pt,next state=step,persistent precomputation=\pgfdecoratepathhascornerstrue]{}
+{%
+ \state{start}[width=+0pt,next state=step,persistent precomputation=\pgfdecoratepathhascornerstrue]{}%
\state{step}[auto end on length=1.5\pgfdecorationsegmentlength,
- auto corner on length=1.5\pgfdecorationsegmentlength,
+ auto corner on length=1.5\pgfdecorationsegmentlength,
width=+\pgfdecorationsegmentlength]
{
\pgfpathlineto{
@@ -95,29 +95,29 @@
{\pgfpoint{\pgfdecorationsegmentlength}{0pt}}
{\pgfpoint{rand*\pgfdecorationsegmentamplitude}{rand*\pgfdecorationsegmentamplitude}}
}
- }
+ }%
\state{final}
- {}
-}
+ {}%
+}%
% Meta-decoration line zigzag
-\pgfdeclaremetadecoration{straight zigzag}{line to}{
+\pgfdeclaremetadecoration{straight zigzag}{line to}{%
\state{line to}[width=\pgfmetadecorationsegmentlength, next state=zigzag]
{
\decoration{curveto}
- }
+ }%
\state{zigzag}[width=\pgfmetadecorationsegmentlength, next state=line to]
{
\decoration{zigzag}
- }
+ }%
\state{final}
{
\decoration{curveto}
- }
-}
+ }%
+}%
@@ -138,7 +138,7 @@
% Parameters: \pgfdecorationsegmentamplitude, \pgfdecorationsegmentaspect
\pgfdeclaredecoration{bent}{bent}
-{
+{%
\state{bent}[width=+\pgfdecoratedinputsegmentremainingdistance]
{
\pgfpathcurveto
@@ -146,44 +146,44 @@
{\pgfpointadd{\pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}
{\pgfqpoint{-\pgfdecorationsegmentaspect\pgfdecoratedinputsegmentremainingdistance}{\pgfdecorationsegmentamplitude}}}
{\pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}
- }
+ }%
\state{final}
- {}
-}
+ {}%
+}%
% decoration snake
%
-% This decoration produces a hopefully optically pleasing squiggly snake.
+% This decoration produces a hopefully optically pleasing squiggly snake.
%
% Parameters: \pgfdecorationsegmentamplitude, \pgfdecorationsegmentlength
\pgfdeclaredecoration{snake}{initial}
-{
+{%
\state{initial}[switch if less than=+.625\pgfdecorationsegmentlength to final,
width=+.3125\pgfdecorationsegmentlength,
next state=down]
- {
+ {
\pgfpathcurveto
{\pgfqpoint{.125\pgfdecorationsegmentlength}{0pt}}
{\pgfqpoint{.1875\pgfdecorationsegmentlength}{\pgfdecorationsegmentamplitude}}
{\pgfqpoint{.3125\pgfdecorationsegmentlength}{\pgfdecorationsegmentamplitude}}
- }
+ }%
\state{down}[switch if less than=+.8125\pgfdecorationsegmentlength to end down,
width=+.5\pgfdecorationsegmentlength,
next state=up]
{
\pgfpathcosine{\pgfqpoint{.25\pgfdecorationsegmentlength}{-1\pgfdecorationsegmentamplitude}}
\pgfpathsine{\pgfqpoint{.25\pgfdecorationsegmentlength}{-1\pgfdecorationsegmentamplitude}}
- }
+ }%
\state{up}[switch if less than=+.8125\pgfdecorationsegmentlength to end up,
width=+.5\pgfdecorationsegmentlength,
next state=down]
{
\pgfpathcosine{\pgfqpoint{.25\pgfdecorationsegmentlength}{\pgfdecorationsegmentamplitude}}
\pgfpathsine{\pgfqpoint{.25\pgfdecorationsegmentlength}{\pgfdecorationsegmentamplitude}}
- }
+ }%
\state{end down}[width=+.3125\pgfdecorationsegmentlength,
next state=final]
{
@@ -191,7 +191,7 @@
{\pgfqpoint{.125\pgfdecorationsegmentlength}{\pgfdecorationsegmentamplitude}}
{\pgfqpoint{.1875\pgfdecorationsegmentlength}{0pt}}
{\pgfqpoint{.3125\pgfdecorationsegmentlength}{0pt}}
- }
+ }%
\state{end up}[width=+.3125\pgfdecorationsegmentlength,
next state=final]
{
@@ -199,12 +199,12 @@
{\pgfqpoint{.125\pgfdecorationsegmentlength}{-\pgfdecorationsegmentamplitude}}
{\pgfqpoint{.1875\pgfdecorationsegmentlength}{0pt}}
{\pgfqpoint{.3125\pgfdecorationsegmentlength}{0pt}}
- }
+ }%
\state{final}
{
\pgfpathlineto{\pgfpointdecoratedpathlast}
- }
-}
+ }%
+}%
% coil decoration
@@ -212,7 +212,7 @@
% Parameters: \pgfdecorationsegmentamplitude, \pgfdecorationsegmentlength,
\pgfdeclaredecoration{coil}{coil}
-{
+{%
\state{coil}[switch if less than=%
1.5\pgfdecorationsegmentlength+%
\pgfdecorationsegmentaspect\pgfdecorationsegmentamplitude+%
@@ -235,7 +235,7 @@
{\pgfpoint@oncoil{0.445}{-1 }{10}}
{\pgfpoint@oncoil{0 }{-0.555}{11}}
{\pgfpoint@oncoil{0 }{ 0 }{12}}
- }
+ }%
\state{last}[width=.5\pgfdecorationsegmentlength+%
\pgfdecorationsegmentaspect\pgfdecorationsegmentamplitude+%
\pgfdecorationsegmentaspect\pgfdecorationsegmentamplitude,next state=final]
@@ -248,12 +248,12 @@
{\pgfpoint@oncoil{1.555}{ 1 }{4}}
{\pgfpoint@oncoil{2 }{ 0.555}{5}}
{\pgfpoint@oncoil{2 }{ 0 }{6}}
- }
+ }%
\state{final}
{
\pgfpathlineto{\pgfpointdecoratedpathlast}
- }
-}
+ }%
+}%
\def\pgfpoint@oncoil#1#2#3{%
\pgf@x=#1\pgfdecorationsegmentamplitude%
@@ -261,7 +261,7 @@
\pgf@y=#2\pgfdecorationsegmentamplitude%
\pgf@xa=0.083333333333\pgfdecorationsegmentlength%
\advance\pgf@x by#3\pgf@xa%
-}
+}%
% bumps decoration
@@ -269,7 +269,7 @@
% Parameters: \pgfdecorationsegmentamplitude, \pgfdecorationsegmentlength
\pgfdeclaredecoration{bumps}{initial}
-{
+{%
\state{initial}[auto end on length=+.51\pgfdecorationsegmentlength,
auto corner on length=+.51\pgfdecorationsegmentlength,
width=+.5\pgfdecorationsegmentlength]
@@ -282,18 +282,13 @@
{\pgfqpoint{.38875\pgfdecorationsegmentlength}{\pgfdecorationsegmentamplitude}}
{\pgfqpoint{.5\pgfdecorationsegmentlength}{.5\pgfdecorationsegmentamplitude}}
{\pgfqpoint{.5\pgfdecorationsegmentlength}{0\pgfdecorationsegmentamplitude}}
- }
+ }%
\state{final}
{
\pgfpathlineto{\pgfpointdecoratedpathlast}
- }
-}
-
-
-
-
-
+ }%
+}%
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathreplacing.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathreplacing.code.tex
index e618ac996cf..10f8371c470 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathreplacing.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathreplacing.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgfmodule{decorations}
+\usepgfmodule{decorations}%
%
@@ -34,19 +34,19 @@
% Parameters: \pgfdecorationsegmentlength, \pgfdecorationsegmentamplitude
\pgfdeclaredecoration{ticks}{ticks}
-{
+{%
\state{ticks}[width=+\pgfdecorationsegmentlength]
{
\pgfpathmoveto{\pgfqpoint{0pt}{\pgfdecorationsegmentamplitude}}
\pgfpathlineto{\pgfqpoint{0pt}{-\pgfdecorationsegmentamplitude}}
- }
+ }%
\state{final}
{
\pgfpathmoveto{\pgfqpoint{0pt}{\pgfdecorationsegmentamplitude}}
\pgfpathlineto{\pgfqpoint{0pt}{-\pgfdecorationsegmentamplitude}}
\pgfpathmoveto{\pgfpointdecoratedpathlast}
- }
-}
+ }%
+}%
@@ -55,9 +55,9 @@
% Parameters: \pgfdecorationsegmentangle, \pgfdecorationsegmentlength
\pgfdeclaredecoration{expanding waves}{initial}
-{
+{%
\state{initial}[width=+\pgfdecorationsegmentlength,next state=wave]
- {}
+ {}%
\state{wave}[switch if less than=+\pgfdecorationsegmentlength to last,
width=+\pgfdecorationsegmentlength]
@@ -67,7 +67,7 @@
{\pgfqpoint{-\pgfdecoratedcompleteddistance}{0pt}}%
{\pgfpointpolar{\pgfdecorationsegmentangle}{+\pgfdecoratedcompleteddistance}}}%
\pgfpatharc{\pgfdecorationsegmentangle}{-\pgfdecorationsegmentangle}{+\pgfdecoratedcompleteddistance}%
- }
+ }%
\state{last}[width=+0pt,next state=final]
{
\pgfpathmoveto{
@@ -75,19 +75,19 @@
{\pgfqpoint{-\pgfdecoratedcompleteddistance}{0pt}}%
{\pgfpointpolar{\pgfdecorationsegmentangle}{+\pgfdecoratedcompleteddistance}}}%
\pgfpatharc{\pgfdecorationsegmentangle}{-\pgfdecorationsegmentangle}{+\pgfdecoratedcompleteddistance}%
- }
+ }%
\state{final}
{
\pgfpathmoveto{\pgfpointdecoratedpathlast}
- }
-}
+ }%
+}%
% waves decoration
\pgfdeclaredecoration{waves}{wave}
-{
+{%
\state{wave}[width=\pgfdecorationsegmentlength]
{
\pgftransformxshift{+\pgfdecorationsegmentlength}
@@ -96,12 +96,12 @@
{\pgfqpoint{-\pgfkeysvalueof{/pgf/decoration/start radius}}{0pt}}%
{\pgfpointpolar{\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/start radius}}}}%
\pgfpatharc{\pgfdecorationsegmentangle}{-\pgfdecorationsegmentangle}{\pgfkeysvalueof{/pgf/decoration/start radius}}%
- }
+ }%
\state{final}
{
\pgfpathmoveto{\pgfpointdecoratedpathlast}
- }
-}
+ }%
+}%
@@ -110,23 +110,23 @@
% Parameters: \pgfdecorationsegmentlength, \pgfdecorationsegmentamplitude, \pgfdecorationsegmentangle
\pgfdeclaredecoration{border}{tick}
-{
+{%
\state{tick}[switch if less than=+\pgfdecorationsegmentlength to last,
width=+\pgfdecorationsegmentlength]
{
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpointpolar{\pgfdecorationsegmentangle}{+\pgfdecorationsegmentamplitude}}
- }
+ }%
\state{last}[width=+\pgfdecorationsegmentamplitude,next state=final]
{
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpointpolar{\pgfdecorationsegmentangle}{+\pgfdecorationsegmentamplitude}}
- }
+ }%
\state{final}
{
\pgfpathmoveto{\pgfpointdecoratedpathlast}
- }
-}
+ }%
+}%
@@ -138,78 +138,91 @@
% Parameters: \pgfdecorationsegmentamplitude
\pgfdeclaredecoration{brace}{brace}
-{
+{%
\state{brace}[width=+\pgfdecoratedremainingdistance,next state=final]
{
+ \pgf@yc=\pgfdecorationsegmentaspect\pgfdecoratedremainingdistance
+ \ifdim2\pgfdecorationsegmentamplitude>\pgf@yc
+ \pgf@yc=0.5\pgf@yc
+ \else
+ \pgf@yc=\pgfdecorationsegmentamplitude
+ \fi
+ \pgf@xc=\pgfdecorationsegmentaspect\pgfdecoratedremainingdistance
+ \advance\pgf@xc-\pgfdecoratedremainingdistance
+ \ifdim-2\pgfdecorationsegmentamplitude<\pgf@xc
+ \pgf@xc=-0.5\pgf@xc
+ \else
+ \pgf@xc=\pgfdecorationsegmentamplitude
+ \fi
\pgfpathmoveto{\pgfpointorigin}
\pgfpathcurveto
- {\pgfqpoint{.15\pgfdecorationsegmentamplitude}{.3\pgfdecorationsegmentamplitude}}
- {\pgfqpoint{.5\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
- {\pgfqpoint{\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{.15\pgf@yc}{.3\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{.5\pgf@yc}{.5\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{\pgf@yc}{.5\pgfdecorationsegmentamplitude}}
{
\pgftransformxshift{+\pgfdecorationsegmentaspect\pgfdecoratedremainingdistance}
- \pgfpathlineto{\pgfqpoint{-\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
+ \pgfpathlineto{\pgfqpoint{-\pgf@yc}{.5\pgfdecorationsegmentamplitude}}
\pgfpathcurveto
- {\pgfqpoint{-.5\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
- {\pgfqpoint{-.15\pgfdecorationsegmentamplitude}{.7\pgfdecorationsegmentamplitude}}
- {\pgfqpoint{0\pgfdecorationsegmentamplitude}{1\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{-.5\pgf@yc}{.5\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{-.15\pgf@yc}{.7\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{0\pgf@yc}{1\pgfdecorationsegmentamplitude}}
\pgfpathcurveto
- {\pgfqpoint{.15\pgfdecorationsegmentamplitude}{.7\pgfdecorationsegmentamplitude}}
- {\pgfqpoint{.5\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
- {\pgfqpoint{\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{.15\pgf@xc}{.7\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{.5\pgf@xc}{.5\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{\pgf@xc}{.5\pgfdecorationsegmentamplitude}}
}
{
\pgftransformxshift{+\pgfdecoratedremainingdistance}
- \pgfpathlineto{\pgfqpoint{-\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
+ \pgfpathlineto{\pgfqpoint{-\pgf@xc}{.5\pgfdecorationsegmentamplitude}}
\pgfpathcurveto
- {\pgfqpoint{-.5\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}}
- {\pgfqpoint{-.15\pgfdecorationsegmentamplitude}{.3\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{-.5\pgf@xc}{.5\pgfdecorationsegmentamplitude}}
+ {\pgfqpoint{-.15\pgf@xc}{.3\pgfdecorationsegmentamplitude}}
{\pgfqpoint{0pt}{0pt}}
}
- }
+ }%
\state{final}
- {}
-}
+ {}%
+}%
% 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%
- }
-}
+\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}
-}
+ /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%
@@ -217,11 +230,11 @@
\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%
-}
+ \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
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.shapes.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.shapes.code.tex
index 8cf75a739bd..6b1571518b6 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.shapes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.shapes.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgfmodule{decorations}
+\usepgfmodule{decorations}%
% Options for shape decorations
@@ -44,9 +44,9 @@
shape start height=#1,
shape end height=#1
}
-}
+}%
-\def\pgf@lib@shapedecoration@sep{.25cm, between centers}
+\def\pgf@lib@shapedecoration@sep{.25cm, between centers}%
\newif\ifpgfshapedecorationsloped
\pgfshapedecorationslopedtrue
\newif\ifpgfshapedecorationscaled
@@ -57,13 +57,13 @@
% triangle decoration
\pgfdeclaredecoration{triangles}{init}
-{
+{%
\state{init}[width=+0pt,next state=triangle,persistent precomputation={
\pgfmathparse{\pgfkeysvalueof{/pgf/decoration/shape start width}}
\edef\pgf@lib@dec@ssw{\pgfmathresult pt}
\pgfmathparse{\pgfkeysvalueof{/pgf/decoration/shape start height}/2}
\edef\pgf@lib@dec@ssh{\pgfmathresult pt}
- }]{}
+ }]{}%
\state{triangle}[switch if less than=+\pgfdecorationsegmentlength to last,
width=+\pgfdecorationsegmentlength]
{
@@ -71,7 +71,7 @@
\pgfpathlineto{\pgfqpoint{\pgf@lib@dec@ssw}{0pt}}
\pgfpathlineto{\pgfqpoint{0pt}{-\pgf@lib@dec@ssh}}
\pgfpathclose
- }
+ }%
\state{last}[switch if less than=\pgf@lib@dec@ssw to skip,
width=\pgfdecoratedremainingdistance,next state=final]
{
@@ -79,14 +79,14 @@
\pgfpathlineto{\pgfqpoint{\pgf@lib@dec@ssw}{0pt}}
\pgfpathlineto{\pgfqpoint{0pt}{-\pgf@lib@dec@ssh}}
\pgfpathclose
- }
+ }%
\state{skip}[width=\pgfdecoratedremainingdistance]
- {}
+ {}%
\state{final}
{
\pgfpathmoveto{\pgfpointdecoratedpathlast}
- }
-}
+ }%
+}%
@@ -94,13 +94,13 @@
% crosses decoration
\pgfdeclaredecoration{crosses}{init}
-{
+{%
\state{init}[width=+0pt,next state=crosses,persistent precomputation={
\pgfmathparse{\pgfkeysvalueof{/pgf/decoration/shape start width}/2}
\edef\pgf@lib@dec@ssw{\pgfmathresult pt}
\pgfmathparse{\pgfkeysvalueof{/pgf/decoration/shape start height}/2}
\edef\pgf@lib@dec@ssh{\pgfmathresult pt}
- }]{}
+ }]{}%
\state{crosses}[switch if less than=+\pgfdecorationsegmentlength to last,
width=+\pgfdecorationsegmentlength]
{
@@ -108,18 +108,18 @@
\pgfpathlineto{\pgfqpoint{\pgf@lib@dec@ssw}{-\pgf@lib@dec@ssh}}
\pgfpathmoveto{\pgfqpoint{-\pgf@lib@dec@ssw}{-\pgf@lib@dec@ssh}}
\pgfpathlineto{\pgfqpoint{\pgf@lib@dec@ssw}{\pgf@lib@dec@ssh}}
- }
+ }%
\state{last}[width=+\pgfdecoratedremainingdistance]
{
\pgfpathmoveto{\pgfqpoint{-\pgf@lib@dec@ssw}{\pgf@lib@dec@ssh}}
\pgfpathlineto{\pgfqpoint{\pgf@lib@dec@ssw}{-\pgf@lib@dec@ssh}}
\pgfpathmoveto{\pgfqpoint{-\pgf@lib@dec@ssw}{-\pgf@lib@dec@ssh}}
\pgfpathlineto{\pgfqpoint{\pgf@lib@dec@ssw}{\pgf@lib@dec@ssh}}
- }
+ }%
\state{final}{
\pgfpathmoveto{\pgfpointdecoratedpathlast}
- }
-}
+ }%
+}%
@@ -128,14 +128,14 @@
% The shape background decoration
%
-% The shape background decoration adds repeated instances of
+% The shape background decoration adds repeated instances of
% the background path of a specified shape along the path. The shape
% must have been declared by \pgfdeclareshape. If a shape has
% specialized keys (e.g. the number of points on a star, or the apex
-% angle the isosceles triangle), these can be specified in the usual manner.
+% angle the isosceles triangle), these can be specified in the usual manner.
%
-% The sepatation between shapes in the path can be specified and can
-% be between the center of the shape or the border of the shape.
+% The separation between shapes in the path can be specified and can
+% be between the center of the shape or the border of the shape.
%
% The height and width of the shape can be independently or
% simultaneously scaled (linearly) along the path. It is also
@@ -148,52 +148,52 @@
\edef\pgf@lib@shapedecoration@initialise{0pt}%
\pgfdeclaredecoration{shape backgrounds}{initialise}
-{
+{%
\state{initialise}
[
width=+\pgf@lib@shapedecoration@initialise,
next state=shape,
persistent precomputation=
{
- %
+ %
% \egroup ends the group started by the automaton before executing
- % a decoration state. This prevents the need for (most) \global variables.
- %
- %
+ % a decoration state. This prevents the need for (most) \global variables.
+ %
+ %
% Check the shape exists.
- %
+ %
\pgfutil@ifundefined{pgf@sh@bg@\pgfkeysvalueof{/pgf/decoration/shape}}{%
\pgferror{I do not know the shape `\pgfkeysvalueof{/pgf/decoration/shape}',
- so I cannot use it in a decoration. Check if its library been loaded or if you
+ so I cannot use it in a decoration. Check if its library been loaded or if you
simply mistyped the name}}{}%
- %
+ %
% Calculate a `default' path size.
- %
+ %
\pgfinterruptpath%
\pgfinterruptboundingbox%
\pgftransformreset%
\pgf@relevantforpicturesizetrue%
- %
+ %
% This size of this shape is unimportant, but it should
% be just large/small enough to avoid huge errors when
- % calculting the scaling factors later on.
- %
+ % calculating the scaling factors later on.
+ %
\pgfkeys{/pgf/inner sep=50pt, /pgf/minimum size=1pt}% Arbitrary lengths.
\setbox\pgfnodeparttextbox\hbox{}% Assume shape does nothing special if box is empty.
- \let\pgf@sh@savedmacros\pgfutil@empty%
+ \let\pgf@sh@savedmacros\pgfutil@empty%
\let\pgf@sh@savedpoints\pgfutil@empty%
\csname pgf@sh@s@\pgfkeysvalueof{/pgf/decoration/shape}\endcsname%
\pgf@sh@savedpoints%
\pgf@sh@savedmacros%
- %
- % Save the macros and pionts.
- %
+ %
+ % Save the macros and points.
+ %
\expandafter\gdef\expandafter\pgf@lib@shapedecoration@points\expandafter{\pgf@sh@savedpoints}%
\expandafter\gdef\expandafter\pgf@lib@shapedecoration@macros\expandafter{\pgf@sh@savedmacros}%
- \csname pgf@sh@bg@\pgfkeysvalueof{/pgf/decoration/shape}\endcsname%
- %
+ \csname pgf@sh@bg@\pgfkeysvalueof{/pgf/decoration/shape}\endcsname%
+ %
% Save the dimensions of the shape path.
- %
+ %
\pgf@x\pgf@picmaxx%
\pgf@y\pgf@picmaxy%
\advance\pgf@x-\pgf@picminx%
@@ -204,52 +204,52 @@
}%
\endpgfinterruptboundingbox%
\endpgfinterruptpath%
- %
+ %
\edef\pgf@lib@shapedecoration@beforeshape{0pt}%
\edef\pgf@lib@shapedecoration@aftershape{0pt}%
- %
+ %
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/decoration/shape start width}}%
\edef\pgf@lib@shapedecoration@startwidth{\the\pgf@x}%
\edef\pgf@lib@shapedecoration@width{\the\pgf@x}%
\pgf@x-\pgf@x%
\pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/decoration/shape end width}}%
\edef\pgf@lib@shapedecoration@widthchange{\the\pgf@x}%
- %
+ %
\pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/decoration/shape start height}}%
\edef\pgf@lib@shapedecoration@initialheight{\the\pgf@y}%
\edef\pgf@lib@shapedecoration@height{\the\pgf@y}%
\pgf@y-\pgf@y%
\pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/decoration/shape end height}}%
\edef\pgf@lib@shapedecoration@heightchange{\the\pgf@y}%
- %
+ %
% Calculate the sep.
- %
+ %
\ifx\pgf@lib@shapedecoration@spread\pgfutil@empty%
- %
+ %
% Not spreading, so easy:
- %
+ %
\def\pgf@lib@shapedecoration@borderstext{between borders}%
\afterassignment\pgf@lib@shapedecoration@setkeyword%
\expandafter\pgf@x\pgf@lib@shapedecoration@sep,\pgf@stop%
\edef\pgf@lib@shapedecoration@sep{\the\pgf@x}%
\else%
- %
+ %
% Spreading (a bit of a nuiscence actually).
- %
+ %
\def\pgf@lib@shapedecoration@borderstext{by borders}%
\afterassignment\pgf@lib@shapedecoration@setkeyword%
\expandafter\c@pgf@counta\pgf@lib@shapedecoration@spread,\pgf@stop%
\ifpgf@lib@shapedecoration@betweenborders%
- %
+ %
% Ok. The required sep between borders is:
- %
+ %
% (r -(n-1)((a+b)/2))/(n-1)
- %
+ %
% r = decoration length (here, the remaining distance)
% a = initial width
% b = end width
% n = the number of shapes
- %
+ %
\ifnum\c@pgf@counta>1\relax%
\advance\c@pgf@counta-1\relax%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/decoration/shape start width}}%
@@ -263,11 +263,11 @@
\advance\pgf@x\pgfdecoratedremainingdistance%
\divide\pgf@x\c@pgf@counta%
\pgf@x.9999\pgf@x% Hackery to control some native TeX inaccuracies.
- %
+ %
% Unfortunately if the shape is scaled, and evenly spread by borders,
- % it is necessary to do something a bit different to control for
+ % it is necessary to do something a bit different to control for
% (most) inaccuracies.
- %
+ %
\ifpgfshapedecorationscaled%
\pgf@xa\pgf@lib@shapedecoration@widthchange\relax%
\divide\pgf@xa\c@pgf@counta%
@@ -285,9 +285,9 @@
\fi%
\fi%
\else%
- %
+ %
% Between centers.
- %
+ %
\pgf@x\pgfdecoratedremainingdistance%
\ifnum\c@pgf@counta>1\relax%
\advance\c@pgf@counta-1\relax%
@@ -305,7 +305,7 @@
\edef\pgf@lib@shapedecoration@sep{\the\pgf@x}%
\fi%
}]
- {}
+ {}%
\state{before shape}
[
width=\pgf@lib@shapedecoration@beforeshape-1sp,
@@ -315,50 +315,50 @@
\ifpgfshapedecorationscaled%
\ifpgf@lib@shapedecoration@betweenborders%
\ifx\pgf@lib@shapedecoration@spread\pgfutil@empty%
- %
+ %
% Not so straightforward. The required ratio is given by
- %
+ %
% R = (c+W/2)/(c+r-.5*w)
- %
+ %
% c = completed distance
% r = remaining distance
% W = initial width
% w = the change in width (i.e., end - start)
- %
+ %
\pgf@x\pgfdecoratedcompleteddistance%
\advance\pgf@x\pgfdecoratedremainingdistance%
\pgf@xa\pgf@lib@shapedecoration@startwidth\relax%
\pgf@xa.5\pgf@xa%
\advance\pgf@xa\pgfdecoratedcompleteddistance% c+W/2
- %
+ %
\pgf@xb\pgf@lib@shapedecoration@widthchange\relax%
\pgf@xb-.5\pgf@xb%
\advance\pgf@xb\pgf@x% c+r-.5*w
- %
+ %
\pgfmathdivide@{\pgfmath@tonumber{\pgf@xa}}{\pgfmath@tonumber{\pgf@xb}}%
\fi%
\else%
- %
- % Easy peasy. The required ratio is
- %
+ %
+ % Easy peasy. The required ratio is
+ %
% R = c / (c+r)
- %
+ %
\pgf@y\pgfdecoratedcompleteddistance%
\advance\pgf@y\pgfdecoratedremainingdistance%
\pgfmathdivide@{\pgfmath@tonumber{\pgfdecoratedcompleteddistance}}{\pgfmath@tonumber{\pgf@y}}%
\fi%
- %
+ %
% Get the new width.
- %
+ %
\ifx\pgf@lib@shapedecoration@spread\pgfutil@empty%
\pgf@x\pgf@lib@shapedecoration@widthchange\relax%
\pgf@x\pgfmathresult\pgf@x%
\advance\pgf@x\pgf@lib@shapedecoration@startwidth\relax%
\else%
\ifpgf@lib@shapedecoration@betweenborders%
- %
- % Specical case when decoration is scaled, and evenly spread by borders.
- %
+ %
+ % Special case when decoration is scaled, and evenly spread by borders.
+ %
\pgf@x\pgf@lib@shapedecoration@width\relax%
\advance\pgf@x\pgf@lib@shapedecoration@specialwidth\relax%
\pgf@xa\pgf@x%
@@ -372,15 +372,15 @@
\fi%
\fi%
\edef\pgf@lib@shapedecoration@width{\the\pgf@x}%
- %
+ %
% New height = R*h + H
- %
+ %
\pgf@y\pgf@lib@shapedecoration@heightchange\relax%
\pgf@y\pgfmathresult\pgf@y%
\advance\pgf@y\pgf@lib@shapedecoration@initialheight\relax%
\edef\pgf@lib@shapedecoration@height{\the\pgf@y}%
\fi%
- %
+ %
\ifpgf@lib@shapedecoration@betweenborders%
\pgf@x\pgf@lib@shapedecoration@width\relax%
\pgf@x.5\pgf@x%
@@ -389,16 +389,16 @@
\def\pgf@lib@shapedecoration@beforeshape{0pt}%
\fi%
}]
- {}
+ {}%
\state{shape}[width=+0sp,next state=after shape]
{
\ifpgfshapedecorationsloped%
\else%
\pgftransformrotate{-\pgfdecoratedangle}%
\fi%
- %
+ %
% Scale the path when it is actually drawn.
- %
+ %
\pgf@lib@shapedecoration@shapepathsize%
\pgfutil@tempdima\pgf@x%
\pgfutil@tempdimb\pgf@y%
@@ -406,14 +406,14 @@
\pgf@xb\pgfutil@tempdima%
\pgfmathdivide@{\pgfmath@tonumber{\pgf@xa}}{\pgfmath@tonumber{\pgf@xb}}%
\expandafter\pgftransformxscale\expandafter{\pgfmathresult}%
- %
+ %
\pgf@ya\pgf@lib@shapedecoration@height\relax%
\pgf@yb\pgfutil@tempdimb%
\pgfmathdivide@{\pgfmath@tonumber{\pgf@ya}}{\pgfmath@tonumber{\pgf@yb}}%
\expandafter\pgftransformyscale\expandafter{\pgfmathresult}%
- %
+ %
% Move to the center anchor.
- %
+ %
\pgf@lib@shapedecoration@points%
\pgf@lib@shapedecoration@macros%
\pgftransformshift{%
@@ -421,11 +421,11 @@
\pgf@x-\pgf@x%
\pgf@y-\pgf@y%
}%
- %
+ %
% And draw the shape path.
- %
+ %
\csname pgf@sh@bg@\pgfkeysvalueof{/pgf/decoration/shape}\endcsname%
- }
+ }%
\state{after shape}
[
width=\pgf@lib@shapedecoration@aftershape-1sp,
@@ -441,28 +441,28 @@
\fi%
}
]
- {}
+ {}%
\state{sep}[width=\pgf@lib@shapedecoration@sep,next state=before shape,
persistent precomputation=\def\pgf@lib@shapedecoration@beforeshape{0pt}]
- {}
+ {}%
\state{final}
{
\pgfpathmoveto{\pgfpointdecoratedpathlast}%
- }
-}
+ }%
+}%
\def\pgf@lib@shapedecoration@setkeyword,{%
\pgfutil@ifnextchar\pgf@stop{\def\pgf@temp{}\pgf@lib@@@shapedecoration@setkeyword}{\pgf@lib@@shapedecoration@setkeyword}%
-}
-\def\pgf@lib@@shapedecoration@setkeyword#1,{\def\pgf@temp{#1}\pgf@lib@@@shapedecoration@setkeyword}
+}%
+\def\pgf@lib@@shapedecoration@setkeyword#1,{\def\pgf@temp{#1}\pgf@lib@@@shapedecoration@setkeyword}%
\def\pgf@lib@@@shapedecoration@setkeyword\pgf@stop{%
\ifx\pgf@temp\pgf@lib@shapedecoration@borderstext%
\pgf@lib@shapedecoration@betweenborderstrue%
\else%
\pgf@lib@shapedecoration@betweenbordersfalse%
\fi%
-}
+}%
-\endinput \ No newline at end of file
+\endinput
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
index b13f3ce0199..4d31c46fcfc 100644
--- 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
@@ -7,138 +7,141 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgfmodule{decorations}
+\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%
- }%
-}
+ /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@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}
+\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]{}
+\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{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{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}{}
-}
+ 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.
%
@@ -153,18 +156,18 @@
% \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{|}{}
+ \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
@@ -174,174 +177,181 @@
\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}
-
+ \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\ifx\pgfdecorationrestoftext\pgf@lib@dec@mathshift%
+ \ifpgf@lib@decorate@textmathmode%
+ \pgf@lib@decorate@textmathmodefalse%
+ \fi%
+ \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\fi%
+ \pgf@next}%
+
\def\pgf@lib@dec@text@@scanchar{%
- \expandafter\pgf@lib@dec@text@@@scanchar\pgfdecorationrestoftext\pgf@stop}
+ \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}
-
+ \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}
+ \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}}
-
+ \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@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%
-}
+ \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}}
-
+ \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@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%
-}
+ \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}}
-
+ \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}}
-
+ \pgf@lib@dec@text@@@@@@scanchar\space{#1}}%
+
\def\pgf@lib@dec@text@@insertspace#1{%
- \pgf@lib@dec@text@@@@@@scanchar\space#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}
+ \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%
-}
+ \let\pgfdecorationrestoftext\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}
+ \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}
-
+ \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}}
+\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.
+ \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%
- }%
-}
+ \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
+ \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
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgf/luamath/functions.lua b/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgf/luamath/functions.lua
index 8fc963d8b9e..3eecaf99c0a 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgf/luamath/functions.lua
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgf/luamath/functions.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more details.
--
--- $Id: functions.lua,v 1.3 2015/05/10 20:34:13 cfeuersaenger Exp $
+-- $Id$
--
local pgfluamathfunctions = pgfluamathfunctions or {}
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgf/luamath/parser.lua b/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgf/luamath/parser.lua
index 55066b45aad..30eff2e6992 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgf/luamath/parser.lua
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgf/luamath/parser.lua
@@ -8,7 +8,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more details.
--
--- $Id: parser.lua,v 1.1 2014/12/27 14:11:49 cfeuersaenger Exp $
+-- $Id$
--
-- usage:
--
@@ -48,7 +48,7 @@ local integer_pattern = S("+-")^-1 * positive_integer_pattern
local positive_integer_or_decimal_pattern = positive_integer_pattern * ( P(".") * one_digit_pattern^0)^-1 +
(P(".") * one_digit_pattern^1)
local integer_or_decimal_pattern = S("+-")^-1 * positive_integer_or_decimal_pattern
-local fpu_pattern = R"15" * P"Y" * positive_integer_or_decimal_pattern * P"e" * P("-")^-1 * R("09")^1 * P"]"
+local fpu_pattern = R"05" * P"Y" * positive_integer_or_decimal_pattern * P"e" * S("+-")^-1 * R("09")^1 * P"]"
local unbounded_pattern = P"inf" + P"INF" + P"nan" + P"NaN" + P"Inf"
local number_pattern = C(unbounded_pattern + fpu_pattern + integer_or_decimal_pattern * (S"eE" * integer_pattern + C(tex_unit))^-1)
@@ -77,7 +77,8 @@ local comma_pattern = P(",") * space_pattern
----------------
local TermOp = C(S("+-")) * space_pattern
-local RelationalOp = C( P"==" + P"!=" + P"<=" + P">=" + P"<" + P">" ) * space_pattern
+local EqualityOp = C( P"==" + P"!=" ) * space_pattern
+local RelationalOp = C( P"<=" + P">=" + P"<" + P">" ) * space_pattern
local FactorOp = C(S("*/")) * space_pattern
-- Grammar
@@ -141,6 +142,9 @@ local prefix_operator_pattern = (prefix_operator * space_pattern * Cg(Prefix) )
-- apparently, we need to distinghuish between <expr> ! and <expr> != <expr2>:
local postfix_operator = C( S"r!" - P"!=" ) + C(P"^") * space_pattern * pow_exponent
+pgfluamathfunctions.functionMustBeEvaluatedInTeX = function()
+ error("The function in this context cannot be evaluated by LUA because it depends on TeX macros.")
+end
local ternary_eval = pgfluamathfunctions.ifthenelse
@@ -170,11 +174,18 @@ local function postfix_eval(prefix, op, arg)
return result
end
-local function relational_eval(v1, op, v2)
+local function equality_eval(v1, op, v2)
local fct
if (op == "==") then fct = pgfluamathfunctions.equal
elseif (op == "!=") then fct = pgfluamathfunctions.notequal
- elseif (op == "<") then fct = pgfluamathfunctions.less
+ else
+ error("This function must not be invoked for operator "..op)
+ end
+ return fct(v1,v2)
+end
+local function relational_eval(v1, op, v2)
+ local fct
+ if (op == "<") then fct = pgfluamathfunctions.less
elseif (op == ">") then fct = pgfluamathfunctions.greater
elseif (op == ">=") then fct = pgfluamathfunctions.notless
elseif (op == "<=") then fct = pgfluamathfunctions.notgreater
@@ -264,6 +275,7 @@ local initialRule = V"initial"
local Summand = V"Summand"
local Relational = V"Relational"
+local Equality = V"Equality"
local LogicalOr = V"LogicalOr"
local LogicalAnd = V"LogicalAnd"
@@ -299,11 +311,11 @@ local G = P{ "initialRule",
initialRule = space_pattern* Exp * -1;
-- ternary operator (or chained ternary operators):
-- FIXME : is this chaining a good idea!?
- Exp = Cf( Relational * Cg(P"?" * space_pattern * Relational * P":" *space_pattern * Relational )^0, ternary_eval) ;
- -- FIXME : do we really allow something like " 1 == 1 != 2" ? I would prefer (1==1) != 2 !?
- Relational = Cf(LogicalOr * Cg(RelationalOp * LogicalOr)^0, relational_eval);
+ Exp = Cf( LogicalOr * Cg(P"?" * space_pattern * LogicalOr * P":" *space_pattern * LogicalOr )^0, ternary_eval) ;
LogicalOr = Cf(LogicalAnd * (P"||" * space_pattern * LogicalAnd)^0, pgfluamathfunctions.orPGF);
- LogicalAnd = Cf(Summand * (P"&&" * space_pattern * Summand)^0, pgfluamathfunctions.andPGF);
+ LogicalAnd = Cf(Equality * (P"&&" * space_pattern * Equality)^0, pgfluamathfunctions.andPGF);
+ Equality = Cf(Relational * Cg(EqualityOp * Relational)^0, equality_eval);
+ Relational = Cf(Summand * Cg(RelationalOp * Summand)^0, relational_eval);
Summand = Cf(Term * Cg(TermOp * Term)^0, eval) ;
Term = Cf(Prefix * Cg(FactorOp * Prefix)^0, eval);
Prefix = prefix_operator_pattern + Postfix;
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgflibraryluamath.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgflibraryluamath.code.tex
index 1d7a5227dd6..c559a0cc1ba 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgflibraryluamath.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/luamath/pgflibraryluamath.code.tex
@@ -8,7 +8,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
%
-% $Id: pgflibraryluamath.code.tex,v 1.20 2015/06/05 06:23:21 cfeuersaenger Exp $
+% $Id$
%
%
% This is a library for a LUA math parser and LUA math operations.
@@ -76,49 +76,70 @@
% Patch some configuration macros such that the modifications are
% available in LUA as well:
\pgfkeys{
- /pgf/trig format/deg/.add code={}{\directlua{pgfluamathfunctions.setTrigFormat("deg")}\aftergroup\pgfmath@settrigformat},
- /pgf/trig format/rad/.add code={}{\directlua{pgfluamathfunctions.setTrigFormat("rad")}\aftergroup\pgfmath@settrigformat},
+ /pgf/trig format/deg/.add code={}{\directlua{pgfluamathfunctions.setTrigFormat("deg")}\aftergroup\pgfmath@settrigformat},
+ /pgf/trig format/rad/.add code={}{\directlua{pgfluamathfunctions.setTrigFormat("rad")}\aftergroup\pgfmath@settrigformat},
}
% ... and reactivate the key:
\pgfmathiftrigonometricusesdeg{%
- \pgfkeys{/pgf/trig format/deg}%
+ \pgfkeys{/pgf/trig format/deg}%
}{%
- \pgfkeys{/pgf/trig format/rad}%
+ \pgfkeys{/pgf/trig format/rad}%
}%
% re-activates the current trig format. This is important after a TeX
% group has been closed.
\def\pgfmath@settrigformat{%
- \pgfmathiftrigonometricusesdeg{%
- \directlua{pgfluamathfunctions.setTrigFormat("deg")}%
- }{%
- \directlua{pgfluamathfunctions.setTrigFormat("rad")}%
- }%
+ \pgfmathiftrigonometricusesdeg{%
+ \directlua{pgfluamathfunctions.setTrigFormat("deg")}%
+ }{%
+ \directlua{pgfluamathfunctions.setTrigFormat("rad")}%
+ }%
}%
\let\pgfmathsetseed@pgfbasic = \pgfmathsetseed
\def\pgfmathsetseed#1{%
- \pgfmathsetseed@pgfbasic{#1}%
- \directlua{pgfluamathfunctions.setRandomSeed(pgfluamathfunctions.tonumber("\pgfmathresult"))}%
+ \pgfmathsetseed@pgfbasic{#1}%
+ \directlua{pgfluamathfunctions.setRandomSeed(pgfluamathfunctions.tonumber("\pgfmathresult"))}%
}%
% Patch 'declare function' such that it communicates the function
% directly to LUA.
\let\pgfmathnotifynewdeclarefunction@orig=\pgfmathnotifynewdeclarefunction
\def\pgfmathnotifynewdeclarefunction#1#2#3{%
- \pgfmathnotifynewdeclarefunction@orig{#1}{#2}{#3}%
- \directlua{pgfluamathparser.pushLocalExpressionFunction(%
- "\pgfutil@luaescapestring{#1}",%
- #2,%
- "\pgfutil@luaescapestring{#3}")}%
- %
- % ensure that the local function is removed at the end of the
- % scope. To this end, we maintain a stack on the LUA side.
- \aftergroup\pgfluamathparse@pop@local@function
+ \pgfmathnotifynewdeclarefunction@orig{#1}{#2}{#3}%
+ %
+ % we have to check if '#3' contains control sequences.
+ % this is highly tricky as it may contain '#1'...
+ \begingroup
+ \toks0={#3}%
+ \xdef\pgf@marshal@glob{\the\toks0 }%
+ \endgroup
+ \pgfutil@command@to@string\pgf@marshal@glob\pgf@marshal
+ \expandafter\pgfutilifcontainsmacro\expandafter{\pgf@marshal}{%
+ \def\pgf@temp{1}%
+ }{%
+ \def\pgf@temp{0}%
+ }%
+ \if1\pgf@temp
+ % let lua produce an error when evaluating this function -- we cannot possibly expand the macro to its current state:
+ \directlua{pgfluamathparser.pushLocalExpressionFunction(%
+ "\pgfutil@luaescapestring{#1}",%
+ #2,%
+ "functionMustBeEvaluatedInTeX")}%
+ \else
+ \directlua{pgfluamathparser.pushLocalExpressionFunction(%
+ "\pgfutil@luaescapestring{#1}",%
+ #2,%
+ "\pgfutil@luaescapestring{#3}")}%
+ \fi
+ %
+ % ensure that the local function is removed at the end of the
+ % scope. To this end, we maintain a stack on the LUA side.
+ \aftergroup\pgfluamathparse@pop@local@function
}%
\def\pgfluamathparse@pop@local@function{%
- \directlua{pgfluamathparser.popLocalExpressionFunction()}%
+ \directlua{pgfluamathparser.popLocalExpressionFunction()}%
}%
% End of luatex stuff
@@ -147,7 +168,7 @@
% LUA (defined only in TeX)
% - some special cases which simply haven't been added to the LUA
% parser (yet).
-% At the time of this writing, this includes
+% At the time of this writing, this includes
% -- arrays created via '{}' and indexed with '[]'
% -- strings with "<str>"
% -- 'scalar' function
@@ -163,13 +184,13 @@
\pgfluamath@checkuninstallcmd%
\pgfluamath@install%
\pgfluamathcomputationactivetrue
- \fi}
+ \fi}%
\def\pgfluamath@makecomputationinactive{%
\ifpgfluamathcomputationactive
\pgfluamath@uninstall%
\pgfluamathcomputationactivefalse
- \fi}
+ \fi}%
\let\pgfluamath@pgfmathparse\pgfmathparse
\def\pgfluamath@makeparseractive{%
@@ -177,14 +198,18 @@
\else
\let\pgfluamath@pgfmathparse\pgfmathparse
\let\pgfmathparse\pgfluamathparse
+ \let\pgfmath@iftrue=\pgfmathluamath@iftrue
\pgfluamathparseractivetrue
- \fi}
+ \fi}%
+
+\let\pgfmath@iftrue@basic=\pgfmath@iftrue
\def\pgfluamath@makeparserinactive{%
\ifpgfluamathparseractive
\let\pgfmathparse\pgfluamath@pgfmathparse
+ \let\pgfmath@iftrue=\pgfmath@iftrue@basic
\pgfluamathparseractivefalse
- \fi}
+ \fi}%
\pgfqkeys{/pgf}{%
% Enable lua-side computation of \pgfmathresult
@@ -223,23 +248,23 @@
luamath library}%
\fi
},
- luamath/output format/.is choice,
- luamath/output format/fixed/.code= {\def\pgfluamath@outputformat@choice{0}},
- % returns results for use in the FPU
- luamath/output format/float/.code= {\def\pgfluamath@outputformat@choice{1}},
- luamath/output format/fixed,
- % this is merely useful for debugging purposes, I guess.
- luamath/show error message/.is if=pgfluamathshowerrormessage,
- luamath/enable TeX fallback/.is choice,
- luamath/enable TeX fallback/true/.code={\pgfluamathenableTeXfallbacktrue\pgfluamathshowerrormessagefalse},
- luamath/enable TeX fallback/false/.code={\pgfluamathenableTeXfallbackfalse\pgfluamathshowerrormessagetrue},
- luamath/enable TeX fallback/.default=true,
- luamath/enable TeX fallback=true,
-}
+ luamath/output format/.is choice,
+ luamath/output format/fixed/.code= {\def\pgfluamath@outputformat@choice{0}},
+ % returns results for use in the FPU
+ luamath/output format/float/.code= {\def\pgfluamath@outputformat@choice{1}},
+ luamath/output format/fixed,
+ % this is merely useful for debugging purposes, I guess.
+ luamath/show error message/.is if=pgfluamathshowerrormessage,
+ luamath/enable TeX fallback/.is choice,
+ luamath/enable TeX fallback/true/.code={\pgfluamathenableTeXfallbacktrue\pgfluamathshowerrormessagefalse},
+ luamath/enable TeX fallback/false/.code={\pgfluamathenableTeXfallbackfalse\pgfluamathshowerrormessagetrue},
+ luamath/enable TeX fallback/.default=true,
+ luamath/enable TeX fallback=true,
+}%
\def\pgfluamath@uninstall@appendcmd#1{%
\expandafter\gdef\expandafter\pgfluamath@uninstall\expandafter{%
- \pgfluamath@uninstall #1}}
+ \pgfluamath@uninstall #1}}%
% If the uninstall command is already assembled, it will skip the
% uninstall assemblation.
@@ -252,7 +277,7 @@
\def\pgfluamath@uninstall@appendcmd##1{}%
\def\pgfluamath@prepareuninstallcmd##1{}%
}%
-}
+}%
% This assembles an uninstall command globally ON FIRST USAGE.
% See \pgfmathfloat@plots@checkuninstallcmd
@@ -262,18 +287,19 @@
\expandafter\gdef\expandafter\pgfluamath@uninstall\expandafter{%
\pgfluamath@uninstall
\expandafter\let\expandafter#1\csname pgfluamath@backup@\string#1\endcsname}%
-}
+}%
\def\pgfluamath@install@function#1=#2{%
\pgfluamath@prepareuninstallcmd{#1}%
\let#1=#2%
-}
+}%
\def\pgfluamath@install{%
\pgfluamath@install@function\pgfmathadd@=\pgfluamathadd@%
\pgfluamath@install@function\pgfmathsubtract@=\pgfluamathsubtract@%
\pgfluamath@install@function\pgfmathneg@=\pgfluamathneg@%
\pgfluamath@install@function\pgfmathmultiply@=\pgfluamathmultiply@%
+ \pgfmathfloat@install\pgfmath@iftrue=\pgfmathluamath@iftrue%
\pgfluamath@install@function\pgfmathdivide@=\pgfluamathdivide@%
% \pgfluamath@install@function\pgfmathdiv@=\pgfluamathdiv@%
\pgfluamath@install@function\pgfmathfactorial@=\pgfluamathfactorial@%
@@ -349,87 +375,106 @@
% \pgfluamath@install@function@unimplemented{notequal}%
\pgfluamath@install@function\pgfmathreciprocal=\pgfluamathreciprocal%
\pgfluamath@install@function\pgfpointnormalised=\pgfluamathpointnormalised
-}
+}%
\def\pgfluamathgetresult#1{%
- \edef\pgfmathresult{\pgfutil@directlua{tex.print(-1,#1)}}}
+ \edef\pgfmathresult{\pgfutil@directlua{tex.print(-1,#1)}}}%
+
+\def\pgfmathluamath@iftrue{%
+ \if 0\pgfluamath@outputformat@choice
+ \let\pgfmathluamath@@iftrue@v=\pgfluamathone
+ \else
+ \let\pgfmathluamath@@iftrue@v=\pgfluamathfloatone
+ \fi
+ \pgfmathluamath@iftrue@
+}%
+\def\pgfluamathone{1.0}%
+\def\pgfluamathfloatone{1Y1.0e+00]}%
+\def\pgfmathluamath@iftrue@#1#2{%
+ \ifx\pgfmathresult\pgfmathluamath@@iftrue@v
+ \def\pgfmath@next{#1}%
+ \else
+ \def\pgfmath@next{#2}%
+ \fi
+ \pgfmath@next
+}%
\def\pgfluamathpi@{%
- \pgfluamathgetresult{pgfluamathfunctions.pi()}}
+ \pgfluamathgetresult{pgfluamathfunctions.pi()}}%
\def\pgfluamathe@{%
- \pgfluamathgetresult{pgfluamathfunctions.e()}}
+ \pgfluamathgetresult{pgfluamathfunctions.e()}}%
\def\pgfluamathadd@#1#2{%
- \pgfluamathgetresult{pgfluamathfunctions.add(#1,#2)}}
+ \pgfluamathgetresult{pgfluamathfunctions.add(#1,#2)}}%
\def\pgfluamathsubtract@#1#2{%
- \pgfluamathgetresult{pgfluamathfunctions.substract(#1,#2)}}
+ \pgfluamathgetresult{pgfluamathfunctions.substract(#1,#2)}}%
\def\pgfluamathneg@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.neg(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.neg(#1)}}%
\def\pgfluamathmultiply@#1#2{%
- \pgfluamathgetresult{pgfluamathfunctions.multiply(#1,#2)}}
+ \pgfluamathgetresult{pgfluamathfunctions.multiply(#1,#2)}}%
\def\pgfluamathdivide@#1#2{%
- \pgfluamathgetresult{pgfluamathfunctions.divide(#1,#2)}}
+ \pgfluamathgetresult{pgfluamathfunctions.divide(#1,#2)}}%
\def\pgfluamathabs@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.abs(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.abs(#1)}}%
\def\pgfluamathround@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.round(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.round(#1)}}%
\def\pgfluamathfloor@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.floor(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.floor(#1)}}%
\def\pgfluamathceil@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.ceil(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.ceil(#1)}}%
\def\pgfluamathgcd@#1#2{%
- \pgfluamathgetresult{pgfluamathfunctions.gcd(#1,#2)}}
+ \pgfluamathgetresult{pgfluamathfunctions.gcd(#1,#2)}}%
\def\pgfluamathisprime@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.isprime(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.isprime(#1)}}%
\def\pgfluamathmax@#1{%
\pgfluamathgetresult{%
- math.max(pgfluamathfunctions.split_braces_to_explist("#1"))}}
+ math.max(pgfluamathfunctions.split_braces_to_explist("#1"))}}%
\def\pgfluamathmin@#1{%
\pgfluamathgetresult{%
- math.min(pgfluamathfunctions.split_braces_to_explist("#1"))}}
+ math.min(pgfluamathfunctions.split_braces_to_explist("#1"))}}%
\def\pgfluamathsin@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.Sin(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.Sin(#1)}}%
\def\pgfluamathcos@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.Cos(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.Cos(#1)}}%
\def\pgfluamathtan@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.Tan(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.Tan(#1)}}%
\def\pgfluamathmod@#1#2{%
- \pgfluamathgetresult{pgfluamathfunctions.mod(#1,#2)}}
+ \pgfluamathgetresult{pgfluamathfunctions.mod(#1,#2)}}%
\def\pgfluamathMod@#1#2{%
- \pgfluamathgetresult{pgfluamathfunctions.Mod(#1,#2)}}
+ \pgfluamathgetresult{pgfluamathfunctions.Mod(#1,#2)}}%
\def\pgfluamathrad@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.rad(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.rad(#1)}}%
\def\pgfluamathdeg@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.deg(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.deg(#1)}}%
\def\pgfluamathatan@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.aTan(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.aTan(#1)}}%
\def\pgfluamathatantwo@#1#2{%
- \pgfluamathgetresult{pgfluamathfunctions.aTan2(#1,#2)}}
+ \pgfluamathgetresult{pgfluamathfunctions.aTan2(#1,#2)}}%
\def\pgfluamathasin@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.aSin(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.aSin(#1)}}%
\def\pgfluamathacos@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.aCos(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.aCos(#1)}}%
\def\pgfluamathcot@#1{%
- \pgfluamathgetresult{1/pgfluamathfunctions.Tan(#1)}}
+ \pgfluamathgetresult{1/pgfluamathfunctions.Tan(#1)}}%
\def\pgfluamathsec@#1{%
- \pgfluamathgetresult{1/pgfluamathfunctions.Cos(#1)}}
+ \pgfluamathgetresult{1/pgfluamathfunctions.Cos(#1)}}%
\def\pgfluamathcosec@#1{%
- \pgfluamathgetresult{1/pgfluamathfunctions.Sin(#1)}}
+ \pgfluamathgetresult{1/pgfluamathfunctions.Sin(#1)}}%
\def\pgfluamathexp@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.exp(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.exp(#1)}}%
\def\pgfluamathln@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.log(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.log(#1)}}%
\def\pgfluamathlogten@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.log10(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.log10(#1)}}%
\def\pgfluamathsqrt@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.sqrt(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.sqrt(#1)}}%
\def\pgfluamathrnd@{%
- \pgfluamathgetresult{pgfluamathfunctions.rnd()}}
+ \pgfluamathgetresult{pgfluamathfunctions.rnd()}}%
\def\pgfluamathrand@{%
- \pgfluamathgetresult{pgfluamathfunctions.rand(-1,1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.rand(-1,1)}}%
\def\pgfluamathfactorial@#1{%
- \pgfluamathgetresult{pgfluamathfunctions.factorial(#1)}}
+ \pgfluamathgetresult{pgfluamathfunctions.factorial(#1)}}%
\def\pgfluamathreciprocal#1{%
- \pgfluamathgetresult{1/#1}}
+ \pgfluamathgetresult{1/#1}}%
% \pgfluamath@install@function\pgfmath@pi=\pgfluamathpi@%
% \pgfluamath@install@function\pgfmathpi=\pgfluamathpi@%
% \pgfluamath@install@function\pgfmathe@=\pgfluamathe@%
@@ -463,7 +508,7 @@
\pgfutil@directlua{%
pgfluamathfunctions.pointnormalised(%
\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})}%
- \ignorespaces}
+ \ignorespaces}%
% Parser
@@ -478,7 +523,7 @@
% LUA (defined only in TeX)
% - some special cases which simply haven't been added to the LUA
% parser (yet).
-% At the time of this writing, this includes
+% At the time of this writing, this includes
% -- arrays created via '{}' and indexed with '[]'
% -- strings with "<str>"
% -- 'scalar' function
@@ -497,17 +542,17 @@
\def\pgfluamathparse#1{%
\pgfluamathusedTeXfallbackfalse
\pgfutil@directlua{pgfluamathparser.texCallParser(
- "\pgfutil@luaescapestring{#1}",
- \pgfluamath@outputformat@choice,
- \ifpgfluamathshowerrormessage true\else false\fi)%
+ "\pgfutil@luaescapestring{#1}",
+ \pgfluamath@outputformat@choice,
+ \ifpgfluamathshowerrormessage true\else false\fi)%
}%
\ifx\pgfmathresult\pgfutil@empty
- \ifpgfluamathenableTeXfallback
- \pgfluamathusedTeXfallbacktrue
- \pgfluamath@pgfmathparse{#1}%
- \fi
+ \ifpgfluamathenableTeXfallback
+ \pgfluamathusedTeXfallbacktrue
+ \pgfluamath@pgfmathparse{#1}%
+ \fi
\fi
-}
+}%
\catcode`\"=\pgfliblua@oldcatcodedoublequote
\endinput
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 9c4a48aeaca..92d2f1e6864 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.16 2013/09/23 18:04:35 tantau Exp $
+\ProvidesFileRCS{pgflibraryarrows.code.tex}
% A square bracket shaped arrow
@@ -32,10 +32,10 @@
\pgfpathlineto{\pgfqpoint{0pt}{\pgfutil@tempdima}}
\pgfpathlineto{\pgfqpoint{-.5\pgfutil@tempdimb}{\pgfutil@tempdima}}
\pgfusepathqstroke
-}
-\pgfdeclarearrow{name=[-], means=square bracket}
+}%
+\pgfdeclarearrow{name=[-], means=square bracket}%
-\pgfarrowsdeclarereversed{]}{[}{[}{]}
+\pgfarrowsdeclarereversed{]}{[}{[}{]}%
% A round bracket shaped arrow
@@ -60,9 +60,9 @@
{\pgfqpoint{.25\pgfutil@tempdima}{.5\pgfutil@tempdima}}
{\pgfqpoint{-.5\pgfutil@tempdima}{\pgfutil@tempdima}}
\pgfusepathqstroke
-}
+}%
-\pgfarrowsdeclarereversed{)}{(}{(}{)}
+\pgfarrowsdeclarereversed{)}{(}{(}{)}%
@@ -88,9 +88,9 @@
\pgfpathlineto{\pgfqpoint{0.5\pgfutil@tempdima}{0\pgfutil@tempdima}}
\pgfpathlineto{\pgfqpoint{-5.5\pgfutil@tempdima}{6\pgfutil@tempdima}}
\pgfusepathqstroke
-}
+}%
-\pgfarrowsdeclarereversed{angle 90 reversed}{angle 90 reversed}{angle 90}{angle 90}
+\pgfarrowsdeclarereversed{angle 90 reversed}{angle 90 reversed}{angle 90}{angle 90}%
\pgfarrowsdeclare{angle 60}{angle 60}
@@ -112,9 +112,9 @@
\pgfpathlineto{\pgfqpoint{0.5\pgfutil@tempdima}{0pt}}
\pgfpathlineto{\pgfpointadd{\pgfqpoint{0.5\pgfutil@tempdima}{0pt}}{\pgfqpointpolar{-150}{9\pgfutil@tempdima}}}
\pgfusepathqstroke
-}
+}%
-\pgfarrowsdeclarereversed{angle 60 reversed}{angle 60 reversed}{angle 60}{angle 60}
+\pgfarrowsdeclarereversed{angle 60 reversed}{angle 60 reversed}{angle 60}{angle 60}%
@@ -137,9 +137,9 @@
\pgfpathlineto{\pgfqpoint{0.5\pgfutil@tempdima}{0\pgfutil@tempdima}}
\pgfpathlineto{\pgfpointadd{\pgfqpoint{0.5\pgfutil@tempdima}{0pt}}{\pgfqpointpolar{-157}{10\pgfutil@tempdima}}}
\pgfusepathqstroke
-}
+}%
-\pgfarrowsdeclarereversed{angle 45 reversed}{angle 45 reversed}{angle 45}{angle 45}
+\pgfarrowsdeclarereversed{angle 45 reversed}{angle 45 reversed}{angle 45}{angle 45}%
@@ -160,7 +160,7 @@
\pgfsetdash{}{+0pt}
\pgfpathcircle{\pgfqpoint{-3\pgfutil@tempdima}{0pt}}{+4.5\pgfutil@tempdima}
\pgfusepathqfillstroke
-}
+}%
% An open dot shaped arrow
@@ -179,7 +179,7 @@
\pgfsetdash{}{+0pt}
\pgfpathcircle{\pgfqpoint{4.5\pgfutil@tempdima}{0bp}}{4.5\pgfutil@tempdima}
\pgfusepathqstroke
-}
+}%
@@ -205,7 +205,7 @@
\pgfpathlineto{\pgfqpoint{-6\pgfutil@tempdima}{-4\pgfutil@tempdima}}
\pgfpathclose
\pgfusepathqfillstroke
-}
+}%
\pgfarrowsdeclare{open diamond}{open diamond}%{{-.5bp}{14.5bp}}
{
@@ -226,7 +226,7 @@
\pgfpathlineto{\pgfqpoint{7\pgfutil@tempdima}{-4\pgfutil@tempdima}}
\pgfpathclose
\pgfusepathqstroke
-}
+}%
% A square shaped arrow
@@ -250,7 +250,7 @@
\pgfpathlineto{\pgfqpoint{1\arrowsize}{-4\arrowsize}}
\pgfpathclose
\pgfusepathqfillstroke
-}
+}%
% A open square shaped arrow
\pgfarrowsdeclare{open square}{open square}%{{-.5bp}{8.5bp}}
@@ -273,7 +273,7 @@
\pgfpathlineto{\pgfqpoint{8\arrowsize}{-4\arrowsize}}
\pgfpathclose
\pgfusepathqstroke
-}
+}%
@@ -298,9 +298,9 @@
\pgfpathlineto{\pgfqpoint{-5.5\pgfutil@tempdima}{6\pgfutil@tempdima}}
\pgfpathclose
\pgfusepathqfillstroke
-}
+}%
-\pgfarrowsdeclarereversed{triangle 90 reversed}{triangle 90 reversed}{triangle 90}{triangle 90}
+\pgfarrowsdeclarereversed{triangle 90 reversed}{triangle 90 reversed}{triangle 90}{triangle 90}%
\pgfarrowsdeclare{triangle 60}{triangle 60}
@@ -322,9 +322,9 @@
\pgfpathlineto{\pgfpointadd{\pgfqpoint{0.5\pgfutil@tempdima}{0pt}}{\pgfqpointpolar{-150}{9\pgfutil@tempdima}}}
\pgfpathclose
\pgfusepathqfillstroke
-}
+}%
-\pgfarrowsdeclarereversed{triangle 60 reversed}{triangle 60 reversed}{triangle 60}{triangle 60}
+\pgfarrowsdeclarereversed{triangle 60 reversed}{triangle 60 reversed}{triangle 60}{triangle 60}%
@@ -348,9 +348,9 @@
\pgfpathlineto{\pgfpointadd{\pgfqpoint{0.5\pgfutil@tempdima}{0pt}}{\pgfqpointpolar{-157}{10\pgfutil@tempdima}}}
\pgfpathclose
\pgfusepathqfillstroke
-}
+}%
-\pgfarrowsdeclarereversed{triangle 45 reversed}{triangle 45 reversed}{triangle 45}{triangle 45}
+\pgfarrowsdeclarereversed{triangle 45 reversed}{triangle 45 reversed}{triangle 45}{triangle 45}%
@@ -373,9 +373,9 @@
\pgfpathlineto{\pgfqpoint{0\pgfutil@tempdima}{6\pgfutil@tempdima}}
\pgfpathclose
\pgfusepathqstroke
-}
+}%
-\pgfarrowsdeclare{open triangle 90 reversed}{open triangle 90 reversed}
+\pgfarrowsdeclare{open triangle 90 reversed}{open triangle 90 reversed}%
{
\pgfutil@tempdima=0.5pt%
\advance\pgfutil@tempdima by.25\pgflinewidth%
@@ -393,7 +393,7 @@
\pgfpathlineto{\pgfqpoint{6\pgfutil@tempdima}{6\pgfutil@tempdima}}
\pgfpathclose
\pgfusepathqstroke
-}
+}%
@@ -415,7 +415,7 @@
\pgfpathlineto{\pgfpointadd{\pgfqpoint{7.794\pgfutil@tempdima}{0pt}}{\pgfqpointpolar{-150}{9\pgfutil@tempdima}}}
\pgfpathclose
\pgfusepathqstroke
-}
+}%
@@ -437,7 +437,7 @@
\pgfpathlineto{\pgfqpointpolar{-30}{9\pgfutil@tempdima}}
\pgfpathclose
\pgfusepathqstroke
-}
+}%
@@ -459,7 +459,7 @@
\pgfpathlineto{\pgfpointadd{\pgfqpoint{9.205\pgfutil@tempdima}{0pt}}{\pgfqpointpolar{-157}{10\pgfutil@tempdima}}}
\pgfpathclose
\pgfusepathqstroke
-}
+}%
@@ -481,11 +481,11 @@
\pgfpathlineto{\pgfqpointpolar{-23}{10\pgfutil@tempdima}}
\pgfpathclose
\pgfusepathqstroke
-}
+}%
-% A less fleshy variant of LaTeX's orginal arrow type
+% A less fleshy variant of LaTeX's ordinal arrow type
\pgfarrowsdeclare{latex'}{latex'}
{
@@ -512,9 +512,9 @@
{\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
\pgfpathclose
\pgfusepathqfill
-}
+}%
-\pgfarrowsdeclarereversed{latex' reversed}{latex' reversed}{latex'}{latex'}
+\pgfarrowsdeclarereversed{latex' reversed}{latex' reversed}{latex'}{latex'}%
% A rounded variant of the stealth arrow
@@ -548,9 +548,9 @@
{\pgfqpoint{2\pgfutil@tempdima}{0\pgfutil@tempdima}}
\pgfpathclose
\pgfusepathqfillstroke
-}
+}%
-\pgfarrowsdeclarereversed{stealth' reversed}{stealth' reversed}{stealth'}{stealth'}
+\pgfarrowsdeclarereversed{stealth' reversed}{stealth' reversed}{stealth'}{stealth'}%
@@ -583,7 +583,7 @@
{\pgfqpoint{0.5\pgfutil@tempdima}{-0.125\pgflinewidth}}
\pgfpathlineto{\pgfqpoint{0pt}{-0.125\pgflinewidth}}
\pgfusepathqstroke
-}
+}%
\pgfarrowsdeclare{right to}{right to}
@@ -613,7 +613,7 @@
{\pgfqpoint{0.5\pgfutil@tempdima}{0.125\pgflinewidth}}
\pgfpathlineto{\pgfqpoint{0pt}{0.125\pgflinewidth}}
\pgfusepathqstroke
-}
+}%
@@ -645,7 +645,7 @@
\pgfpathcurveto{\pgfqpoint{3.5\pgfutil@tempdima}{2.5\pgfutil@tempdima}}{\pgfqpoint{0.75\pgfutil@tempdima}{0.25\pgfutil@tempdima}}{\pgfqpoint{0pt}{-0.125\pgflinewidth}}
}
\pgfusepathqstroke%
-}
+}%
\pgfarrowsdeclare{right to reversed}{right to reversed}
{
@@ -673,7 +673,7 @@
\pgfpathcurveto{\pgfqpoint{3.5\pgfutil@tempdima}{-2.5\pgfutil@tempdima}}{\pgfqpoint{0.75\pgfutil@tempdima}{-0.25\pgfutil@tempdima}}{\pgfqpoint{0pt}{0.125\pgflinewidth}}
}
\pgfusepathqstroke%
-}
+}%
@@ -697,9 +697,9 @@
\pgfpathcurveto{\pgfqpoint{2.415\pgfutil@tempdima}{0\pgfutil@tempdima}}{\pgfqpoint{3.75\pgfutil@tempdima}{1.665\pgfutil@tempdima}}{\pgfqpoint{3.75\pgfutil@tempdima}{3\pgfutil@tempdima}}
\pgfpathcurveto{\pgfqpoint{3.75\pgfutil@tempdima}{4.665\pgfutil@tempdima}}{\pgfqpoint{2.415\pgfutil@tempdima}{6\pgfutil@tempdima}}{\pgfqpoint{0.75\pgfutil@tempdima}{6\pgfutil@tempdima}}
\pgfusepathqstroke%
-}
+}%
-\pgfarrowsdeclarereversed{left hook reversed}{left hook reversed}{left hook}{left hook}
+\pgfarrowsdeclarereversed{left hook reversed}{left hook reversed}{left hook}{left hook}%
@@ -723,9 +723,9 @@
\pgfpathcurveto{\pgfqpoint{2.415\pgfutil@tempdima}{0\pgfutil@tempdima}}{\pgfqpoint{3.75\pgfutil@tempdima}{-1.665\pgfutil@tempdima}}{\pgfqpoint{3.75\pgfutil@tempdima}{-3\pgfutil@tempdima}}
\pgfpathcurveto{\pgfqpoint{3.75\pgfutil@tempdima}{-4.665\pgfutil@tempdima}}{\pgfqpoint{2.415\pgfutil@tempdima}{-6\pgfutil@tempdima}}{\pgfqpoint{0.75\pgfutil@tempdima}{-6\pgfutil@tempdima}}
\pgfusepathqstroke%
-}
+}%
-\pgfarrowsdeclarereversed{right hook reversed}{right hook reversed}{right hook}{right hook}
+\pgfarrowsdeclarereversed{right hook reversed}{right hook reversed}{right hook}{right hook}%
% Hooks in both directions
@@ -751,9 +751,9 @@
\pgfpathcurveto{\pgfqpoint{2.415\pgfutil@tempdima}{0\pgfutil@tempdima}}{\pgfqpoint{3.75\pgfutil@tempdima}{-1.665\pgfutil@tempdima}}{\pgfqpoint{3.75\pgfutil@tempdima}{-3\pgfutil@tempdima}}
\pgfpathcurveto{\pgfqpoint{3.75\pgfutil@tempdima}{-4.665\pgfutil@tempdima}}{\pgfqpoint{2.415\pgfutil@tempdima}{-6\pgfutil@tempdima}}{\pgfqpoint{0.75\pgfutil@tempdima}{-6\pgfutil@tempdima}}
\pgfusepathqstroke%
-}
+}%
-\pgfarrowsdeclarereversed{hooks reversed}{hooks reversed}{hooks}{hooks}
+\pgfarrowsdeclarereversed{hooks reversed}{hooks reversed}{hooks}{hooks}%
% An arrow that looks like a serif of the computer modern font
@@ -778,15 +778,15 @@
\pgfpathcurveto
{\pgfqpoint{-.04\pgflinewidth}{.5\pgfutil@tempdima}}
{\pgfqpoint{-.04\pgflinewidth}{-.5\pgfutil@tempdima}}
- {\pgfqpoint{0pt}{-1.95\pgfutil@tempdima}}
- \pgfpathlineto{\pgfqpoint{-.375\pgfutil@tempdima}{-1.95\pgfutil@tempdima}}
+ {\pgfqpoint{0pt}{-1.95\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfqpoint{-.375\pgfutil@tempdima}{-1.95\pgfutil@tempdima}}
\pgfpathcurveto
{\pgfqpoint{-.375\pgfutil@tempdima}{-.7\pgflinewidth}}
{\pgfqpoint{-.375\pgfutil@tempdima}{-.5\pgflinewidth}}
{\pgfqpoint{-.75\pgfutil@tempdima}{-.5\pgflinewidth}}
\pgfpathclose
\pgfusepathqfill
-}
+}%
@@ -800,7 +800,7 @@
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfqpoint{0.5\pgflinewidth}{0pt}}
\pgfusepathqstroke
-}
+}%
% Butt cap
@@ -813,7 +813,7 @@
\pgfpathmoveto{\pgfqpoint{-.1\pgflinewidth}{0pt}}
\pgfpathlineto{\pgfqpoint{0.5\pgflinewidth}{0pt}}
\pgfusepathqstroke
-}
+}%
@@ -829,7 +829,7 @@
\pgfpathlineto{\pgfqpoint{-.1\pgflinewidth}{-0.5\pgflinewidth}}
\pgfpathclose
\pgfusepathqfill
-}
+}%
% reversed 90 degrees cap
@@ -844,7 +844,7 @@
\pgfpathlineto{\pgfqpoint{0.5\pgflinewidth}{0\pgflinewidth}}
\pgfpathclose
\pgfusepathqfill
-}
+}%
@@ -867,7 +867,7 @@
\pgfpathlineto{\pgfqpoint{1.5\pgflinewidth}{0\pgflinewidth}}
\pgfpathclose
\pgfusepathqfill
-}
+}%
\pgfarrowsdeclare{fast cap reversed}{fast cap reversed}
@@ -887,7 +887,7 @@
\pgfpathlineto{\pgfqpoint{1\pgflinewidth}{0\pgflinewidth}}
\pgfpathclose
\pgfusepathqfill
-}
+}%
@@ -929,7 +929,7 @@
{\pgfpoint{-.75\pgfutil@tempdima}{-1.25\pgfutil@tempdima}}
{\pgfpoint{-1.4\pgfutil@tempdima}{-2.65\pgfutil@tempdima}}
\pgfusepathqstroke
-}
+}%
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.meta.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.meta.code.tex
index 80b2573a0c4..af509c1af64 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.meta.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.meta.code.tex
@@ -7,14 +7,14 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryarrows.meta.code.tex,v 1.13 2015/05/13 21:19:11 cfeuersaenger Exp $
+\ProvidesFileRCS{pgflibraryarrows.meta.code.tex}
-%
-%
-% Meta keys
-%
+%
+%
+% Meta keys
+%
%
@@ -67,7 +67,7 @@
angle'/.code={
\pgfarrowsaddtolateoptions{\pgfarrows@angle@setup@prime{#1}}%
},
- %
+ %
line cap/.is choice,
line cap/butt/.code=\pgfarrowsaddtooptions{\pgfarrowroundcapfalse},
line cap/round/.code=\pgfarrowsaddtooptions{\pgfarrowroundcaptrue},
@@ -76,14 +76,10 @@
line join/round/.code=\pgfarrowsaddtooptions{\pgfarrowroundjointrue},
round/.style={line cap=round,line join=round},
sharp/.style={line cap=butt,line join=miter},
-}
-
-
-
-
+}%
%
%
-% Classificaiton of arrow tips:
+% Classification of arrow tips:
%
%
% Barbs
@@ -93,7 +89,7 @@
% typically going backward. They cannot be filled, only stroked
%
% A special case are the arrows mimicking the tip at the end of a
-% \rightarrow command.
+% \rightarrow command.
%
%
% Geometric
@@ -151,7 +147,7 @@
\pgf@xa\pgf@temp@quot\pgfarrowlinewidth% xa is extra harpoon miter
% Set ends
\ifpgfarrowroundjoin
- \pgfarrowssettipend{\pgfarrowlength\advance\pgf@x by.5\pgfarrowlinewidth}
+ \pgfarrowssettipend{\pgfarrowlength\advance\pgf@x by.5\pgfarrowlinewidth}
\else
\pgfarrowssettipend{\pgfarrowlength\advance\pgf@x by\pgf@xc\ifpgfarrowharpoon\advance\pgf@x by\pgf@xa\fi}
\fi
@@ -205,12 +201,11 @@
\ifpgfarrowroundjoin j\fi%
\ifpgfarrowroundcap c\fi%
},
-}
-
-
-
+}%
+%
+%
% Hooks are barbs that consist of an arc going forward from the line
-% end and curving back by a given angle speficied using the |arc|
+% end and curving back by a given angle specified using the |arc|
% key.
\pgfkeys{
@@ -219,9 +214,9 @@
\pgfmathparse{#1}%
\expandafter\pgfarrowsaddtooptions\expandafter{\expandafter\def\expandafter\pgfarrowarc\expandafter{\pgfmathresult}}
}
-}
+}%
-\def\pgfarrowarc{180}
+\def\pgfarrowarc{180}%
\pgfdeclarearrow{
name = Hooks,
@@ -247,7 +242,7 @@
\pgfarrowsupperhullpoint{-\pgfarrowlength}{.25\pgfarrowwidth}
\else
\pgfarrowsupperhullpoint{\ifpgfarrowroundcap-.5\pgfarrowlinewidth\else0pt\fi}{.25\pgfarrowwidth}
- \pgfarrowsupperhullpoint{\ifpgfarrowroundcap-.5\pgfarrowlinewidth\else0pt\fi}{.5\pgfarrowwidth}
+ \pgfarrowsupperhullpoint{\ifpgfarrowroundcap-.5\pgfarrowlinewidth\else0pt\fi}{.5\pgfarrowwidth}
\fi
\fi
% Adjust width and length: Take line thickness into account:
@@ -261,9 +256,9 @@
% There are four different intervals for the values of
% \pgfarrowsarc that give rise to four different settings of tip
% ends and so on:
- %
- % Case 1: 0 <= Angle < 90
- %
+ %
+ % Case 1: 0 <= Angle < 90
+ %
\ifdim\pgfarrowarc pt<90pt%
% Tip end is given by sin(pgfarrowarc)*length
\pgfmathsin@{\pgfarrowarc}
@@ -280,7 +275,7 @@
\else
\ifpgfarrowroundcap\pgfarrowssetbackend{-.5\pgfarrowlinewidth}\fi%
\fi%
- \else%
+ \else%
\pgfarrowssettipend{\pgfarrowlength\advance\pgf@x by.5\pgfarrowlinewidth}%
\pgfarrowssetbackend{-\pgfarrowlength\advance\pgf@x by-.5\pgfarrowlinewidth}%
\fi\fi\fi%
@@ -289,14 +284,14 @@
\else%
\ifpgfarrowharpoon
\pgfarrowssetlineend{0pt}
- \else
+ \else
\pgfarrowssetlineend{.25\pgfarrowlinewidth}
\fi
\fi
% Adjust arc:
\pgf@x\pgfarrowarc pt%
\advance\pgf@x by-90pt%
- \edef\pgfarrowarc{\pgf@sys@tonumber\pgf@x}%
+ \edef\pgfarrowarc{\pgf@sys@tonumber\pgf@x}%
% The following are needed in the code:
\pgfarrowssavethe\pgfarrowlinewidth
\pgfarrowssavethe\pgfarrowlength
@@ -332,7 +327,7 @@
\ifpgfarrowroundjoin j\fi%
\ifpgfarrowroundcap c\fi%
},
-}
+}%
\pgfdeclarearrow{
@@ -363,7 +358,7 @@
\ifdim\pgfarrowarc pt>90pt
\ifdim\pgfarrowarc pt<120pt
\pgfarrowsupperhullpoint{\pgfmathresultx\pgfarrowlength}{.5\pgfarrowwidth}
- \else
+ \else
\pgfarrowsupperhullpoint{-.5\pgfarrowlength}{.5\pgfarrowwidth}
\ifdim\pgfarrowarc pt>150pt
\pgfarrowsupperhullpoint{-\pgfarrowlength}{.25\pgfarrowwidth}
@@ -377,7 +372,7 @@
\ifpgfarrowharpoon
\pgfutil@tempswatrue
\fi
- \ifpgfutil@tempswa
+ \ifpgfutil@tempswa
\pgf@xa.5\pgfarrowwidth\advance\pgf@xa by-\pgfarrowlinewidth%
\pgf@ya\pgfarrowlength\advance\pgf@ya by-\pgfarrowlinewidth%
\pgfarrowsupperhullpoint{\pgfmathresultx\pgf@ya}{\pgfmathresulty\pgf@xa}
@@ -435,7 +430,7 @@
\ifpgfarrowroundcap c\fi%
\ifpgfarrowroundjoin j\fi%
},
-}
+}%
@@ -451,7 +446,7 @@
},
bending mode=polar,
setup code = {
- % Two useful numbers...
+ % Two useful numbers...
\pgfutil@tempswafalse%
\pgfutil@tempswbfalse%
\pgfutil@tempdima\pgfarrowlength\advance\pgfutil@tempdima by-\pgfarrowinset\ifdim\pgfutil@tempdima<.5\pgfarrowlinewidth\pgfutil@tempdima.5\pgfarrowlinewidth\pgfutil@tempswatrue\fi%
@@ -519,7 +514,7 @@
\ifpgfarrowroundjoin j\fi%
\ifpgfarrowroundcap c\fi%
},
-}
+}%
% Math barbs that resemble \rightarrow in different fonts:
@@ -528,7 +523,7 @@
% The original default arrow head used in TikZ. It is modeled on an
% old version of the \rightarrow head of the *old* Computer Modern
-% fonts.
+% fonts.
\pgfdeclarearrow{
name = Classical TikZ Rightarrow,
@@ -538,7 +533,7 @@
line width = 0pt 0.8 1,
round
},
- setup code =
+ setup code =
{
\ifpgfarrowharpoon\pgfarrowroundjointrue\fi
% inner length:
@@ -585,11 +580,11 @@
\pgfarrowsupperhullpoint{-.5\pgfarrowlinewidth}{.5\pgfutil@tempdimb\advance\pgf@y by.5\pgfarrowlinewidth}%
% Lower end:
\ifpgfarrowharpoon
- \pgfarrowshullpoint{\pgfutil@tempdima\advance\pgf@x by-\pgflinewidth}{-.5\pgflinewidth}%
+ \pgfarrowshullpoint{\pgfutil@tempdima\advance\pgf@x by-\pgflinewidth}{-.5\pgflinewidth}%
\pgfarrowshullpoint{-.5\pgfarrowlinewidth}{.5\pgfutil@tempdimb\advance\pgf@y by-.5\pgflinewidth}%
\fi
},
- drawing code =
+ drawing code =
{
\pgfsetdash{}{+0pt}
\edef\pgf@orig@linewidth{\the\pgflinewidth}
@@ -605,7 +600,7 @@
\pgfpathcurveto
{\pgfqpoint{0.066666\pgfutil@tempdima}{0.3125\pgfutil@tempdimb}}
{\pgfqpoint{.8\pgfutil@tempdima}{0.03125\pgfutil@tempdimb}}
- {\pgfqpoint{\pgfutil@tempdima}{0pt}}
+ {\pgfqpoint{\pgfutil@tempdima}{0pt}}
\pgfpathcurveto
{\pgfqpoint{.8\pgfutil@tempdima}{-.03125\pgfutil@tempdimb}}
{\pgfqpoint{0.066666\pgfutil@tempdima}{-.3125\pgfutil@tempdimb}}
@@ -622,7 +617,7 @@
\ifpgfarrowroundjoin j\fi%
\ifpgfarrowroundcap c\fi%
},
-}
+}%
\def\pgf@arrows@old@tikz@harpoon{
\ifpgfarrowreversed
@@ -640,7 +635,7 @@
{\pgfqpoint{0.8\pgfutil@tempdima\advance\pgf@x by-.5\pgflinewidth}{-0.125\pgflinewidth}}
\pgfusepathqstroke
\fi
-}
+}%
\def\pgf@arrows@old@tikz@harpoon@reversed{
\pgfpathcurveto
{\pgfqpoint{0.066666\pgfutil@tempdima}{0.3125\pgfutil@tempdimb}}
@@ -658,7 +653,7 @@
\pgfpathmoveto{\pgfqpoint{\pgfutil@tempdima\advance\pgf@x by0.6\pgflinewidth}{0pt}}
\pgfpathlineto{\pgfqpoint{\pgfutil@tempdima}{0pt}}
\pgfusepathqstroke
-}
+}%
% An approximation to the new (past 1992) Computer Modern math arrow
@@ -673,7 +668,7 @@
line width = 0pt 1 1,
round
},
- setup code =
+ setup code =
{
% inner length:
\pgfutil@tempdima\pgfarrowlength
@@ -720,11 +715,11 @@
\pgfarrowsupperhullpoint{-\pgfutil@tempdima\advance\pgf@x by-.5\pgfarrowlinewidth}{.5\pgfutil@tempdimb\advance\pgf@y by.5\pgfarrowlinewidth}%
% Lower end:
\ifpgfarrowharpoon
- \pgfarrowshullpoint{-\pgfarrowlinewidth}{-.5\pgfarrowlinewidth}%
+ \pgfarrowshullpoint{-\pgfarrowlinewidth}{-.5\pgfarrowlinewidth}%
\pgfarrowshullpoint{-\pgfutil@tempdima\advance\pgf@x by-.5\pgfarrowlinewidth}{.5\pgfutil@tempdimb\advance\pgf@y by-.5\pgfarrowlinewidth}%
\fi
},
- drawing code =
+ drawing code =
{
\pgfsetdash{}{+0pt}
\ifpgfarrowroundcap\pgfsetroundcap\else\pgfsetbuttcap\fi
@@ -739,7 +734,7 @@
\ifpgfarrowharpoon
\pgfpathlineto
{\pgfqpoint{\ifpgfarrowreversed.5\else-\fi\pgfarrowlinewidth}{0pt}}
- \else
+ \else
\pgfpathcurveto
{\pgfqpoint{-0.41019\pgfutil@tempdima}{-0.05833333\pgfutil@tempdimb}}
{\pgfqpoint{-0.81731\pgfutil@tempdima}{-.2\pgfutil@tempdimb}}
@@ -756,7 +751,7 @@
\ifpgfarrowroundjoin j\fi%
\ifpgfarrowroundcap c\fi%
},
-}
+}%
@@ -796,20 +791,20 @@
\pgfusepathqstroke
},
parameters = {\the\pgfarrowlength}
-}
+}%
%
%
-% Geomatric arrow tips
+% Geometric arrow tips
%
%
% Generic "latex-like" arrow tip. This is the basic arrow tip used in
-% latex's picture environment. You can configure its length and width.
+% latex's picture environment. You can configure its length and width.
\pgfdeclarearrow{
name = Latex,
@@ -852,7 +847,7 @@
\pgfarrowssetlineend{0pt}
\fi
\ifpgfarrowroundjoin
- \pgfarrowssettipend{\pgfutil@tempdima\advance\pgf@x by.5\pgfarrowlinewidth}
+ \pgfarrowssettipend{\pgfutil@tempdima\advance\pgf@x by.5\pgfarrowlinewidth}
\else
\pgfarrowssettipend{\pgfarrowlength\advance\pgf@x by-.5\pgfarrowlinewidth\ifpgfarrowharpoon\advance\pgf@x by1.5\pgf@xa\fi}
\fi
@@ -882,7 +877,7 @@
{\pgfqpoint{0pt}{\pgfutil@tempdimb}}
\ifpgfarrowharpoon
\pgfpathlineto {\pgfpointorigin}
- \else
+ \else
\pgfpathlineto {\pgfqpoint{0pt}{-\pgfutil@tempdimb}}
\pgfpathcurveto {\pgfqpoint{.337381\pgfutil@tempdima}{-.519480\pgfutil@tempdimb}}
{\pgfqpoint{.877192\pgfutil@tempdima}{-.077922\pgfutil@tempdimb}}
@@ -899,7 +894,7 @@
\ifpgfarrowopen o\fi%
\ifpgfarrowroundjoin j\fi%
},
-}
+}%
@@ -960,7 +955,7 @@
\advance\pgf@x by1pt%
\pgfmathsqrt@{\pgf@sys@tonumber\pgf@x}%
\pgf@yc\pgfmathresult\pgfarrowlinewidth% yc is inset miter
- \pgf@yc.5\pgf@yc%
+ \pgf@yc.5\pgf@yc%
% Inner length (pgfutil@tempdima) is now arrowlength - front miter - back miter
\pgfutil@tempdima\pgfarrowlength%
\advance\pgfutil@tempdima by-\pgf@xc%
@@ -969,7 +964,7 @@
\advance\pgfutil@tempdimb by-\pgf@yb%
% harpoon miter correction
\ifpgfarrowroundjoin
- \pgfarrowssetbackend{\pgf@ya\advance\pgf@x by-.5\pgfarrowlinewidth}
+ \pgfarrowssetbackend{\pgf@ya\advance\pgf@x by-.5\pgfarrowlinewidth}
\else
\pgfarrowssetbackend{0pt}
\fi
@@ -987,7 +982,7 @@
\fi
\fi
\ifpgfarrowroundjoin
- \pgfarrowssettipend{\pgfutil@tempdima\advance\pgf@x by\pgf@ya\advance\pgf@x by.5\pgfarrowlinewidth}
+ \pgfarrowssettipend{\pgfutil@tempdima\advance\pgf@x by\pgf@ya\advance\pgf@x by.5\pgfarrowlinewidth}
\else
\pgfarrowssettipend{\pgfarrowlength\ifpgfarrowharpoon\advance\pgf@x by\pgf@xa\fi}
\fi
@@ -1027,7 +1022,7 @@
\ifpgfarrowopen o\fi%
\ifpgfarrowroundjoin j\fi%
},
-}
+}%
@@ -1037,7 +1032,7 @@
name = Kite,
defaults = {
length = +3.6pt +5.4,
- width' = +0pt +0.5,
+ width' = +0pt +0.5,
inset' = +0pt 0.25,
line width = +0pt 1 1,
},
@@ -1108,7 +1103,7 @@
\advance\pgfutil@tempdimb by\pgf@yb%
% Set back end
\ifpgfarrowroundjoin
- \pgfarrowssetbackend{\pgf@ya\advance\pgf@x by-.5\pgfarrowlinewidth}
+ \pgfarrowssetbackend{\pgf@ya\advance\pgf@x by-.5\pgfarrowlinewidth}
\else
\pgfarrowssetbackend{0pt}
\fi
@@ -1119,7 +1114,7 @@
\pgfarrowssetlineend{\pgf@yc\advance\pgf@x by\pgflinewidth\advance\pgf@x by-\pgfarrowlinewidth}
\fi
\ifpgfarrowroundjoin
- \pgfarrowssettipend{\pgfutil@tempdima\advance\pgf@x by.5\pgfarrowlinewidth}
+ \pgfarrowssettipend{\pgfutil@tempdima\advance\pgf@x by.5\pgfarrowlinewidth}
\else
\pgfarrowssettipend{\pgfarrowlength\ifpgfarrowharpoon\advance\pgf@x by\pgf@xa\fi}
\fi
@@ -1158,7 +1153,7 @@
\ifpgfarrowopen o\fi%
\ifpgfarrowroundjoin j\fi%
},
-}
+}%
@@ -1213,7 +1208,7 @@
\ifpgfarrowopen o\fi%
\ifpgfarrowroundjoin j\fi%
},
-}
+}%
% A simple rectangle shape
@@ -1283,7 +1278,7 @@
\ifpgfarrowopen o\fi%
\ifpgfarrowroundjoin j\fi%
},
-}
+}%
% Round cap
@@ -1332,7 +1327,7 @@
\pgfusepathqfill
},
parameters = {\the\pgfarrowlength}
-}
+}%
@@ -1359,7 +1354,7 @@
\pgfusepathqfill
},
parameters = {\the\pgfarrowlength}
-}
+}%
@@ -1375,7 +1370,7 @@
\edef\pgf@marshal{\noexpand\pgfarrowsaddtooptions{\noexpand\pgfarrowslinewidthdependent{+0pt}{\pgf@sys@tonumber\pgf@x}{0}\pgfarrowlength\pgf@x}}
\pgf@marshal
}
-}
+}%
\pgfdeclarearrow{
@@ -1420,7 +1415,7 @@
\pgfusepathqfill
},
parameters = {\the\pgfarrowlength}
-}
+}%
@@ -1451,7 +1446,7 @@
\pgfusepathqfill
},
parameters = {\the\pgfarrowlength,\the\pgfarrowinset}
-}
+}%
\pgfdeclarearrow{
@@ -1492,7 +1487,7 @@
\pgfusepathqfill
},
parameters = {\the\pgfarrowlength,\the\pgfarrowinset}
-}
+}%
@@ -1510,12 +1505,12 @@
\pgfmathparse{#1}%
\expandafter\pgf@lib@meta@strip@dot\pgfmathresult.\relax%
}
-}
+}%
\def\pgf@lib@meta@strip@dot#1.#2\relax{%
\pgfarrowsaddtooptions{\def\pgfarrown{#1}}%
-}
+}%
-\def\pgfarrown{4}
+\def\pgfarrown{4}%
\pgfdeclarearrow{
name = Rays,
@@ -1531,7 +1526,7 @@
\pgf@xa\pgfarrow@inc pt%
\ifodd\pgfarrown\pgf@ya.25\pgf@xa\else\pgf@ya.5\pgf@xa\fi%
\pgfmathsincos@{\pgf@sys@tonumber\pgf@ya}%
- \pgf@x.5\pgfarrowlength%
+ \pgf@x.5\pgfarrowlength%
\pgf@xa\pgfmathresultx\pgf@x%
\ifpgfarrowroundcap
\advance\pgf@xa by.5\pgfarrowlinewidth
@@ -1542,7 +1537,7 @@
\fi%
\pgfarrowssettipend{\pgf@xa}
\pgfarrowssetbackend{-\pgf@xa}
- % Hull is alwyas 8-point hull, except for tip
+ % Hull is always 8-point hull, except for tip
% The following are needed in the code:
\pgfarrowsupperhullpoint{\pgf@xa}{.25\pgfarrowwidth}
\pgfarrowsupperhullpoint{.25\pgfarrowlength}{.5\pgfarrowwidth\ifpgfarrowroundcap\advance\pgf@y by.5\pgfarrowlinewidth\fi}
@@ -1575,7 +1570,7 @@
\pgfpathlineto{\pgfpointorigin}
\ifpgfarrowharpoon\ifdim\pgf@ya>\pgf@xa\else{\pgfsettransform\pgf@temp@trans\pgfpathlineto{\pgfqpoint{-.5\pgflinewidth}{0pt}}}\fi\fi
\advance\pgf@ya by\pgf@xa\relax%
- \pgfutil@repeat%
+ \pgfutil@repeat%
}
\pgfusepathqstroke
},
@@ -1587,7 +1582,7 @@
\ifpgfarrowharpoon h\fi%
\ifpgfarrowroundcap c\fi%
}
-}
+}%
@@ -1604,7 +1599,7 @@
Bar /.tip = {Tee Barb[length=+0pt]},
Bracket /.tip = {Tee Barb[inset'=+0pt +1,length=+0.75pt +1]},
Parenthesis /.tip = {Arc Barb[arc=+120,length=+1.725pt +2.3]}
-}
+}%
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.spaced.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.spaced.code.tex
index b6d1728363d..166ed875333 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.spaced.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.spaced.code.tex
@@ -7,10 +7,10 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryarrows.spaced.code.tex,v 1.3 2013/09/23 18:04:36 tantau Exp $
+\ProvidesFileRCS{pgflibraryarrows.spaced.code.tex}
-\usepgflibrary{arrows}
+\usepgflibrary{arrows}%
% This library offers "spaced" versions of existing arrows, where a
@@ -21,71 +21,71 @@
% original name of the arrow.
-\pgfarrowsdeclarecombine*{spaced to}{spaced to}{to}{to}{space}{space}
-\pgfarrowsdeclarecombine*{spaced to reversed}{spaced to reversed}{to reversed}{to reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced implies}{spaced implies}{implies}{implies}{space}{space}
-\pgfarrowsdeclarecombine*{spaced latex}{spaced latex}{latex}{latex}{space}{space}
-\pgfarrowsdeclarecombine*{spaced latex reversed}{spaced latex reversed}{latex reversed}{latex reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced latex'}{spaced latex'}{latex'}{latex'}{space}{space}
-\pgfarrowsdeclarecombine*{spaced latex' reversed}{spaced latex' reversed}{latex' reversed}{latex' reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced stealth}{spaced stealth}{stealth}{stealth}{space}{space}
-\pgfarrowsdeclarecombine*{spaced stealth reversed}{spaced stealth reversed}{stealth reversed}{stealth reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced stealth'}{spaced stealth'}{stealth'}{stealth'}{space}{space}
-\pgfarrowsdeclarecombine*{spaced stealth' reversed}{spaced stealth' reversed}{stealth' reversed}{stealth' reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced triangle 90}{spaced triangle 90}{triangle 90}{triangle 90}{space}{space}
-\pgfarrowsdeclarecombine*{spaced triangle 90 reversed}{spaced triangle 90 reversed}{triangle 90 reversed}{triangle 90 reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced triangle 60}{spaced triangle 60}{triangle 60}{triangle 60}{space}{space}
-\pgfarrowsdeclarecombine*{spaced triangle 60 reversed}{spaced triangle 60 reversed}{triangle 60 reversed}{triangle 60 reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced triangle 45}{spaced triangle 45}{triangle 45}{triangle 45}{space}{space}
-\pgfarrowsdeclarecombine*{spaced triangle 45 reversed}{spaced triangle 45 reversed}{triangle 45 reversed}{triangle 45 reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced open triangle 90}{spaced open triangle 90}{open triangle 90}{open triangle 90}{space}{space}
-\pgfarrowsdeclarecombine*{spaced open triangle 90 reversed}{spaced open triangle 90 reversed}{open triangle 90 reversed}{open triangle 90 reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced open triangle 60}{spaced open triangle 60}{open triangle 60}{open triangle 60}{space}{space}
-\pgfarrowsdeclarecombine*{spaced open triangle 60 reversed}{spaced open triangle 60 reversed}{open triangle 60 reversed}{open triangle 60 reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced open triangle 45}{spaced open triangle 45}{open triangle 45}{open triangle 45}{space}{space}
-\pgfarrowsdeclarecombine*{spaced open triangle 45 reversed}{spaced open triangle 45 reversed}{open triangle 45 reversed}{open triangle 45 reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced angle 90}{spaced angle 90}{angle 90}{angle 90}{space}{space}
-\pgfarrowsdeclarecombine*{spaced angle 90 reversed}{spaced angle 90 reversed}{angle 90 reversed}{angle 90 reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced angle 60}{spaced angle 60}{angle 60}{angle 60}{space}{space}
-\pgfarrowsdeclarecombine*{spaced angle 60 reversed}{spaced angle 60 reversed}{angle 60 reversed}{angle 60 reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced angle 45}{spaced angle 45}{angle 45}{angle 45}{space}{space}
-\pgfarrowsdeclarecombine*{spaced angle 45 reversed}{spaced angle 45 reversed}{angle 45 reversed}{angle 45 reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced hooks}{spaced hooks}{hooks}{hooks}{space}{space}
-\pgfarrowsdeclarecombine*{spaced hooks reversed}{spaced hooks reversed}{hooks reversed}{hooks reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced o}{spaced o}{o}{o}{space}{space}
-\pgfarrowsdeclarecombine*{spaced *}{spaced *}{*}{*}{space}{space}
-\pgfarrowsdeclarecombine*{spaced diamond}{spaced diamond}{diamond}{diamond}{space}{space}
-\pgfarrowsdeclarecombine*{spaced open diamond}{spaced open diamond}{open diamond}{open diamond}{space}{space}
-\pgfarrowsdeclarecombine*{spaced square}{spaced square}{square}{square}{space}{space}
-\pgfarrowsdeclarecombine*{spaced open square}{spaced open square}{open square}{open square}{space}{space}
-\pgfarrowsdeclarecombine*{spaced serif cm}{spaced serif cm}{serif cm}{serif cm}{space}{space}
-\pgfarrowsdeclarecombine*{spaced left to}{spaced left to}{left to}{left to}{space}{space}
-\pgfarrowsdeclarecombine*{spaced left to reversed}{spaced left to reversed}{left to reversed}{left to reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced right to}{spaced right to}{right to}{right to}{space}{space}
-\pgfarrowsdeclarecombine*{spaced right to reversed}{spaced right to reversed}{right to reversed}{right to reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced left hook}{spaced left hook}{left hook}{left hook}{space}{space}
-\pgfarrowsdeclarecombine*{spaced left hook reversed}{spaced left hook reversed}{left hook reversed}{left hook reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced right hook}{spaced right hook}{right hook}{right hook}{space}{space}
-\pgfarrowsdeclarecombine*{spaced right hook reversed}{spaced right hook reversed}{right hook reversed}{right hook reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced round cap}{spaced round cap}{round cap}{round cap}{space}{space}
-\pgfarrowsdeclarecombine*{spaced butt cap}{spaced butt cap}{butt cap}{butt cap}{space}{space}
-\pgfarrowsdeclarecombine*{spaced triangle 90 cap}{spaced triangle 90 cap}{triangle 90 cap}{triangle 90 cap}{space}{space}
-\pgfarrowsdeclarecombine*{spaced triangle 90 cap reversed}{spaced triangle 90 cap reversed}{triangle 90 cap reversed}{triangle 90 cap reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced fast cap}{spaced fast cap}{fast cap}{fast cap}{space}{space}
-\pgfarrowsdeclarecombine*{spaced fast cap reversed}{spaced fast cap reversed}{fast cap reversed}{fast cap reversed}{space}{space}
-\pgfarrowsdeclarecombine*{spaced (}{spaced )}{(}{)}{space}{space}
-\pgfarrowsdeclarecombine*{spaced )}{spaced (}{)}{(}{space}{space}
-\pgfarrowsdeclarecombine*{spaced |}{spaced |}{|}{|}{space}{space}
+\pgfarrowsdeclarecombine*{spaced to}{spaced to}{to}{to}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced to reversed}{spaced to reversed}{to reversed}{to reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced implies}{spaced implies}{implies}{implies}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced latex}{spaced latex}{latex}{latex}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced latex reversed}{spaced latex reversed}{latex reversed}{latex reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced latex'}{spaced latex'}{latex'}{latex'}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced latex' reversed}{spaced latex' reversed}{latex' reversed}{latex' reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced stealth}{spaced stealth}{stealth}{stealth}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced stealth reversed}{spaced stealth reversed}{stealth reversed}{stealth reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced stealth'}{spaced stealth'}{stealth'}{stealth'}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced stealth' reversed}{spaced stealth' reversed}{stealth' reversed}{stealth' reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced triangle 90}{spaced triangle 90}{triangle 90}{triangle 90}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced triangle 90 reversed}{spaced triangle 90 reversed}{triangle 90 reversed}{triangle 90 reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced triangle 60}{spaced triangle 60}{triangle 60}{triangle 60}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced triangle 60 reversed}{spaced triangle 60 reversed}{triangle 60 reversed}{triangle 60 reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced triangle 45}{spaced triangle 45}{triangle 45}{triangle 45}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced triangle 45 reversed}{spaced triangle 45 reversed}{triangle 45 reversed}{triangle 45 reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced open triangle 90}{spaced open triangle 90}{open triangle 90}{open triangle 90}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced open triangle 90 reversed}{spaced open triangle 90 reversed}{open triangle 90 reversed}{open triangle 90 reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced open triangle 60}{spaced open triangle 60}{open triangle 60}{open triangle 60}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced open triangle 60 reversed}{spaced open triangle 60 reversed}{open triangle 60 reversed}{open triangle 60 reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced open triangle 45}{spaced open triangle 45}{open triangle 45}{open triangle 45}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced open triangle 45 reversed}{spaced open triangle 45 reversed}{open triangle 45 reversed}{open triangle 45 reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced angle 90}{spaced angle 90}{angle 90}{angle 90}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced angle 90 reversed}{spaced angle 90 reversed}{angle 90 reversed}{angle 90 reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced angle 60}{spaced angle 60}{angle 60}{angle 60}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced angle 60 reversed}{spaced angle 60 reversed}{angle 60 reversed}{angle 60 reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced angle 45}{spaced angle 45}{angle 45}{angle 45}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced angle 45 reversed}{spaced angle 45 reversed}{angle 45 reversed}{angle 45 reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced hooks}{spaced hooks}{hooks}{hooks}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced hooks reversed}{spaced hooks reversed}{hooks reversed}{hooks reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced o}{spaced o}{o}{o}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced *}{spaced *}{*}{*}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced diamond}{spaced diamond}{diamond}{diamond}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced open diamond}{spaced open diamond}{open diamond}{open diamond}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced square}{spaced square}{square}{square}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced open square}{spaced open square}{open square}{open square}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced serif cm}{spaced serif cm}{serif cm}{serif cm}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced left to}{spaced left to}{left to}{left to}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced left to reversed}{spaced left to reversed}{left to reversed}{left to reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced right to}{spaced right to}{right to}{right to}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced right to reversed}{spaced right to reversed}{right to reversed}{right to reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced left hook}{spaced left hook}{left hook}{left hook}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced left hook reversed}{spaced left hook reversed}{left hook reversed}{left hook reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced right hook}{spaced right hook}{right hook}{right hook}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced right hook reversed}{spaced right hook reversed}{right hook reversed}{right hook reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced round cap}{spaced round cap}{round cap}{round cap}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced butt cap}{spaced butt cap}{butt cap}{butt cap}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced triangle 90 cap}{spaced triangle 90 cap}{triangle 90 cap}{triangle 90 cap}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced triangle 90 cap reversed}{spaced triangle 90 cap reversed}{triangle 90 cap reversed}{triangle 90 cap reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced fast cap}{spaced fast cap}{fast cap}{fast cap}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced fast cap reversed}{spaced fast cap reversed}{fast cap reversed}{fast cap reversed}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced (}{spaced )}{(}{)}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced )}{spaced (}{)}{(}{space}{space}%
+\pgfarrowsdeclarecombine*{spaced |}{spaced |}{|}{|}{space}{space}%
\pgfdeclarearrow{
name = spaced [-spaced ],
means = square bracket[].space
-}
+}%
\pgfdeclarearrow{
name = spaced ]-spaced [,
means = square bracket[reversed].space
-}
+}%
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarycurvilinear.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarycurvilinear.code.tex
index 2ae9eb00e5a..42217aadf30 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarycurvilinear.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarycurvilinear.code.tex
@@ -7,11 +7,11 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibrarycurvilinear.code.tex,v 1.4 2015/05/14 14:43:05 cfeuersaenger Exp $
+\ProvidesFileRCS{pgflibrarycurvilinear.code.tex}
%
% This file defines commands for computing points in curvilinear
-% coordinate systems.
+% coordinate systems.
%
@@ -24,7 +24,7 @@
% precomputations are done; subsequent calls to
% \pgfpointcurvilinearxxx based on this Bezier curve will be
% relatively quick.
-%
+%
@@ -51,7 +51,7 @@
% speed against precision. Also note that the results will only be
% best near the start of the curve and may be far off near the end if
% that end is degenerate (second control point very near to end
-% point).
+% point).
%
% Example:
%
@@ -60,7 +60,7 @@
% {\pgfpoint{5.5mm}{10mm}}
% {\pgfpoint{10mm}{5.5mm}}
% {\pgfpoint{10mm}{0mm}} % nearly a quarter circle
-% \pgfpointcurvilinearbezierorthogonal{5mm}{5mm}
+% \pgfpointcurvilinearbezierorthogonal{5mm}{5mm}
% % should be 5mm along the circle, put at
% % distance 15mm from the origin (5mm from the circle line).
@@ -145,7 +145,7 @@
\let\pgf@curvilinear@comp@d\pgf@curvilinear@comp@d@initial%
\let\pgf@curvilinear@comp@e\pgf@curvilinear@comp@e@initial%
\let\pgf@curvilinear@point\pgf@curvilinear@curve@point%
-}
+}%
\newdimen\pgf@curvilinear@time@a
\newdimen\pgf@curvilinear@length@a
\newdimen\pgf@curvilinear@length@b
@@ -158,10 +158,10 @@
\let\pgf@curvilinear@quot@a\pgfmathresult%
\let\pgf@curvilinear@comp@a\pgf@curvilinear@comp@a@cont%
\pgf@curvilinear@comp@a@cont%
-}
+}%
\def\pgf@curvilinear@comp@a@cont{%
\pgf@x\pgf@curvilinear@quot@a\pgf@x%
-}
+}%
\def\pgf@curvilinear@comp@b@initial{%
\pgf@y=\pgf@curvilinear@length@b%
@@ -174,11 +174,11 @@
\edef\pgf@curvilinear@correct@b{\pgf@sys@tonumber\pgf@y}%
\let\pgf@curvilinear@comp@b\pgf@curvilinear@comp@b@cont%
\pgf@curvilinear@comp@b@cont%
-}
+}%
\def\pgf@curvilinear@comp@b@cont{%
\pgf@x\pgf@curvilinear@quot@b\pgf@x%
\advance\pgf@x by\pgf@curvilinear@correct@b pt%
-}
+}%
\def\pgf@curvilinear@comp@c@initial{%
\pgf@y=\pgf@curvilinear@length@c%
@@ -192,11 +192,11 @@
\edef\pgf@curvilinear@correct@c{\pgf@sys@tonumber\pgf@y}%
\let\pgf@curvilinear@comp@c\pgf@curvilinear@comp@c@cont%
\pgf@curvilinear@comp@c@cont%
-}
+}%
\def\pgf@curvilinear@comp@c@cont{%
\pgf@x\pgf@curvilinear@quot@c\pgf@x%
\advance\pgf@x by\pgf@curvilinear@correct@c pt%
-}
+}%
\def\pgf@curvilinear@comp@d@initial{%
\pgf@y=\pgf@curvilinear@length@d%
@@ -210,11 +210,11 @@
\edef\pgf@curvilinear@correct@d{\pgf@sys@tonumber\pgf@y}%
\let\pgf@curvilinear@comp@d\pgf@curvilinear@comp@d@cont%
\pgf@curvilinear@comp@d@cont%
-}
+}%
\def\pgf@curvilinear@comp@d@cont{%
\pgf@x\pgf@curvilinear@quot@d\pgf@x%
\advance\pgf@x by\pgf@curvilinear@correct@d pt%
-}
+}%
\def\pgf@curvilinear@comp@e@initial{%
\pgfmathmultiply@{8}{\pgf@sys@tonumber\pgf@curvilinear@time@a}%
@@ -222,20 +222,20 @@
\let\pgf@curvilinear@quot@e\pgfmathresult%
\let\pgf@curvilinear@comp@e\pgf@curvilinear@comp@e@cont%
\pgf@curvilinear@comp@e@cont%
-}
+}%
\def\pgf@curvilinear@comp@e@cont{%
\pgf@x\pgf@curvilinear@quot@e\pgf@x%
-}
+}%
% Convert a distance into a time
-%
+%
% #1 = a distance
-%
+%
% Description:
%
% After having called \pgfsetcurvilinearbeziercurve, you can use this
-% macro to convert a distance into a time along the curve set in that
+% macro to convert a distance into a time along the curve set in that
% command. The result will be stored in \pgf@x. It will only be
% reasonably precise for small nonnegative #1 (in particular, #1
% should not be more than about half the length of the curve).
@@ -255,7 +255,7 @@
\else%
\pgf@curvilinear@comp@e%
\fi\fi%
-}
+}%
@@ -279,7 +279,7 @@
%
% In addition to setting \pgf@x and \pgf@y, \pgf@xa/ya will be set to
% a tangent along the curve at the given point and \pgf@xb/yb to a
-% tanget orthogonal to the curve.
+% tangent orthogonal to the curve.
\def\pgfpointcurvilinearbezierorthogonal#1#2{%
\pgfmathsetmacro\pgf@curvilinear@yfactor{#2}%
@@ -296,7 +296,7 @@
\pgf@y\pgf@curvilinear@yfactor\pgf@y%
\advance\pgf@x by\pgf@xc%
\advance\pgf@y by\pgf@yc%
-}
+}%
\def\pgf@diff@curvi@ac{%
\pgf@curvilinear@line@a%
@@ -313,7 +313,7 @@
\fi\fi\fi\fi%
\pgf@xb-\pgf@xb%
\pgf@yb-\pgf@yb%
-}
+}%
@@ -330,13 +330,13 @@
% we compute that point at distance d along the Bezier curve B. Let
% B(d) be this point. Then, we rotate this point around the start of
% the curve (B(0)) by r degrees.
-%
+%
% As an example, consider a triangle with one tip at the origin and
% the other tips as (4cm,3cm) and (4cm,-3cm). Then this triangle would be
% transformed as follows: We take the first 5cm of the Bezier curve
% and rotate it by roughly 37 degrees to the left and by 37 degrees to
% the right.
-%
+%
% Note that this command is pretty expensive.
\def\pgfpointcurvilinearbezierpolar#1#2{%
@@ -373,7 +373,7 @@
}%
\pgf@curvilinear@line@a%
}%
-}
+}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfadings.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfadings.code.tex
index 39fca783437..8d25f73b37d 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfadings.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfadings.code.tex
@@ -7,51 +7,51 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibraryfadings.code.tex,v 1.3 2008/02/07 19:25:41 tantau Exp $
+\ProvidesFileRCS{pgflibraryfadings.code.tex}
% Axial fadings
\pgfdeclarehorizontalshading{pgf@lib@fade@east}{100bp}
{color(0bp)=(pgftransparent!0); color(25bp)=(pgftransparent!0);
- color(75bp)=(pgftransparent!100); color(100bp)=(pgftransparent!100)}
+ color(75bp)=(pgftransparent!100); color(100bp)=(pgftransparent!100)}%
\pgfdeclarehorizontalshading{pgf@lib@fade@west}{100bp}
{color(0bp)=(pgftransparent!100); color(25bp)=(pgftransparent!100);
- color(75bp)=(pgftransparent!0); color(100bp)=(pgftransparent!0)}
+ color(75bp)=(pgftransparent!0); color(100bp)=(pgftransparent!0)}%
\pgfdeclareverticalshading{pgf@lib@fade@north}{100bp}
{color(0bp)=(pgftransparent!0); color(25bp)=(pgftransparent!0);
- color(75bp)=(pgftransparent!100); color(100bp)=(pgftransparent!100)}
+ color(75bp)=(pgftransparent!100); color(100bp)=(pgftransparent!100)}%
\pgfdeclareverticalshading{pgf@lib@fade@south}{100bp}
{color(0bp)=(pgftransparent!100); color(25bp)=(pgftransparent!100);
- color(75bp)=(pgftransparent!0); color(100bp)=(pgftransparent!0)}
+ color(75bp)=(pgftransparent!0); color(100bp)=(pgftransparent!0)}%
-\pgfdeclarefading{east}{\pgfuseshading{pgf@lib@fade@east}}
-\pgfdeclarefading{west}{\pgfuseshading{pgf@lib@fade@west}}
-\pgfdeclarefading{north}{\pgfuseshading{pgf@lib@fade@north}}
-\pgfdeclarefading{south}{\pgfuseshading{pgf@lib@fade@south}}
+\pgfdeclarefading{east}{\pgfuseshading{pgf@lib@fade@east}}%
+\pgfdeclarefading{west}{\pgfuseshading{pgf@lib@fade@west}}%
+\pgfdeclarefading{north}{\pgfuseshading{pgf@lib@fade@north}}%
+\pgfdeclarefading{south}{\pgfuseshading{pgf@lib@fade@south}}%
% Circular fadings
\pgfdeclareradialshading{tikz@lib@fade@circle@10}{\pgfpointorigin}{
color(0pt)=(pgftransparent!0); color(22.5bp)=(pgftransparent!0);
- color(25bp)=(pgftransparent!100); color(50bp)=(pgftransparent!100)}
-\pgfdeclarefading{circle with fuzzy edge 10 percent}{\pgfuseshading{tikz@lib@fade@circle@10}}
+ color(25bp)=(pgftransparent!100); color(50bp)=(pgftransparent!100)}%
+\pgfdeclarefading{circle with fuzzy edge 10 percent}{\pgfuseshading{tikz@lib@fade@circle@10}}%
\pgfdeclareradialshading{tikz@lib@fade@circle@15}{\pgfpointorigin}{
color(0pt)=(pgftransparent!0); color(21.25bp)=(pgftransparent!0);
- color(25bp)=(pgftransparent!100); color(50bp)=(pgftransparent!100)}
-\pgfdeclarefading{circle with fuzzy edge 15 percent}{\pgfuseshading{tikz@lib@fade@circle@15}}
+ color(25bp)=(pgftransparent!100); color(50bp)=(pgftransparent!100)}%
+\pgfdeclarefading{circle with fuzzy edge 15 percent}{\pgfuseshading{tikz@lib@fade@circle@15}}%
\pgfdeclareradialshading{tikz@lib@fade@circle@20}{\pgfpointorigin}{
color(0pt)=(pgftransparent!0); color(20bp)=(pgftransparent!0);
- color(25bp)=(pgftransparent!100); color(50bp)=(pgftransparent!100)}
-\pgfdeclarefading{circle with fuzzy edge 20 percent}{\pgfuseshading{tikz@lib@fade@circle@20}}
+ color(25bp)=(pgftransparent!100); color(50bp)=(pgftransparent!100)}%
+\pgfdeclarefading{circle with fuzzy edge 20 percent}{\pgfuseshading{tikz@lib@fade@circle@20}}%
\pgfdeclareradialshading{tikz@lib@fade@fuzzy@15}{\pgfpointorigin}{
color(0pt)=(pgftransparent!100); color(21.25bp)=(pgftransparent!100); color(23.125bp)=(pgftransparent!0);
- color(25bp)=(pgftransparent!100); color(50bp)=(pgftransparent!100)}
-\pgfdeclarefading{fuzzy ring 15 percent}{\pgfuseshading{tikz@lib@fade@fuzzy@15}}
+ color(25bp)=(pgftransparent!100); color(50bp)=(pgftransparent!100)}%
+\pgfdeclarefading{fuzzy ring 15 percent}{\pgfuseshading{tikz@lib@fade@fuzzy@15}}%
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfixedpointarithmetic.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfixedpointarithmetic.code.tex
index 50a7521f826..b860192f45c 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfixedpointarithmetic.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfixedpointarithmetic.code.tex
@@ -9,131 +9,132 @@
\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}
+ 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@}
+ \begingroup%
+ \let\pgfmathpostparse=\relax%
+ \pgfmath@catcodes%
+ \pgfmath@quickparsefalse%
+ \pgfmathfpparse@}%
\def\pgfmathfpparse@#1{%
- \edef\pgfmathfp@expression{#1}%
- \expandafter\pgfmathfpparse@@\pgfmathfp@expression\pgfmathfp@}
+ \edef\pgfmathfp@expression{#1}%
+ \expandafter\pgfmathfpparse@@\pgfmathfp@expression\pgfmathfp@}%
-\def\pgfmathfp@char@asterisk{*}
+\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
-}
+ \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*}
-}
+ 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%
-}
+ \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%
-}
+ \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%
-}
-
-%
+ \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%
- \pgferror{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%
+ %
+ \expandafter\ifx\csname FP@version\endcsname\relax%
+ \pgferror{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\pgfmathneg@=\pgfmathfpneg@%
+ \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}%
@@ -143,495 +144,513 @@
% Scientific notation.
\def\pgfmathfpscientific#1#2{%
- \begingroup%
- \FPpow\pgfmathresult{10}{#2}\unskip% Needed.
- \FPmul\pgfmathresult{#1}{\pgfmathresult}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \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}%
-}
+ \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%
-}
+ \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}%
-}
+ \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%
-}
+ \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}%
-}
+ \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%
-}
-
-
+ \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}%
-}
+ \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%
-}
+ \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}%
-}
+ \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%
-}
+ \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}%
-}
+ \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%
-}
+ \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}%
-}
+ \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%
-}
+ \begingroup%
+ \FPdiv\pgfmathresult{#1}{#2}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}%
% abs
%
\def\pgfmathfpabs#1{%
- \pgfmathfpparse{#1}%
- \pgfmathfpabs@{\pgfmathresult}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfpabs@{\pgfmathresult}%
+}%
\def\pgfmathfpabs@#1{%
- \begingroup%
- \FPabs\pgfmathresult{#1}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \begingroup%
+ \FPabs\pgfmathresult{#1}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}%
+
+% neg
+%
+\def\pgfmathfpneg#1{%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpneg@{\pgfmathresult}%
+}%
+\def\pgfmathfpneg@#1{%
+ \begingroup%
+ \FPneg\pgfmathresult{#1}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup%
+}%
% round
%
\def\pgfmathfpround#1{%
- \pgfmathfpparse{#1}%
- \pgfmathfpround@{\pgfmathresult}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfpround@{\pgfmathresult}%
+}%
\def\pgfmathfpround@#1{%
- \begingroup%
- \FPround\pgfmathresult{#1}{0}%
- \edef\pgfmathresult{\pgfmathresult.0}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \begingroup%
+ \FPround\pgfmathresult{#1}{0}%
+ \edef\pgfmathresult{\pgfmathresult.0}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}%
% floor
%
\def\pgfmathfpfloor#1{%
- \pgfmathfpparse{#1}%
- \pgfmathfpfloor@{\pgfmathresult}%
-}
+ \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%
-}
+ \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}%
-}
+ \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%
-}
+ \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}%
-}
+ \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%
-}
+ \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%
-}
+ \pgfmathfpparse{#2}\let\pgfmath@result=\pgfmathresult%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpmax@@{\pgfmathresult}{\pgfmath@result}%
+}%
+\def\pgfmathfpmax@#1{%
+ \pgfmathfpmax@@#1%
+}%
+\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%
-}
+ \pgfmathfpparse{#2}\let\pgfmath@result=\pgfmathresult%
+ \pgfmathfpparse{#1}%
+ \pgfmathfpmin@@{\pgfmathresult}{\pgfmath@result}%
+}%
+\def\pgfmathfpmin@#1{%
+ \pgfmathfpmin@@#1%
+}%
+\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}%
-}
+ \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%
-}
+ \begingroup%
+ \FPpow\pgfmathresult{#1}{#2}\unskip%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}%
% exp
%
\def\pgfmathfpexp#1{%
- \pgfmathfpparse{#1}%
- \pgfmathfpexp@{\pgfmathresult}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfpexp@{\pgfmathresult}%
+}%
\def\pgfmathfpexp@#1{%
- \begingroup%
- \FPexp\pgfmathresult{#1}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \begingroup%
+ \FPexp\pgfmathresult{#1}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}%
% ln
%
\def\pgfmathfpln#1{%
- \pgfmathfpparse{#1}%
- \pgfmathfpln@{\pgfmathresult}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfpln@{\pgfmathresult}%
+}%
\def\pgfmathfpln@#1{%
- \begingroup%
- \FPln\pgfmathresult{#1}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \begingroup%
+ \FPln\pgfmathresult{#1}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}%
% sqrt
%
\def\pgfmathfpsqrt#1{%
- \pgfmathfpparse{#1}%
- \pgfmathfpsqrt@{\pgfmathresult}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfpsqrt@{\pgfmathresult}%
+}%
\def\pgfmathfpsqrt@#1{%
- \begingroup%
- \FProot\pgfmathresult{#1}{2}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \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}%
-}
+ \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%
-}
+ \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}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfpsin@{\pgfmathresult}%
+}%
\def\pgfmathfpsin@#1{%
- \begingroup%
- \FPmul\pgfmathresult{#1}{0.017453292519943295}%
- \FPsin\pgfmathresult{\pgfmathresult}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \begingroup%
+ \FPmul\pgfmathresult{#1}{0.017453292519943295}%
+ \FPsin\pgfmathresult{\pgfmathresult}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}%
% cos
%
\def\pgfmathfpcos#1{%
- \pgfmathfpparse{#1}%
- \pgfmathfpcos@{\pgfmathresult}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfpcos@{\pgfmathresult}%
+}%
\def\pgfmathfpcos@#1{%
- \begingroup%
- \FPmul\pgfmathresult{#1}{0.017453292519943295}%
- \FPcos\pgfmathresult{\pgfmathresult}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \begingroup%
+ \FPmul\pgfmathresult{#1}{0.017453292519943295}%
+ \FPcos\pgfmathresult{\pgfmathresult}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}%
% tan
%
\def\pgfmathfptan#1{%
- \pgfmathfpparse{#1}%
- \pgfmathfptan@{\pgfmathresult}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfptan@{\pgfmathresult}%
+}%
\def\pgfmathfptan@#1{%
- \begingroup%
- \FPmul\pgfmathresult{#1}{0.017453292519943295}%
- \FPtan\pgfmathresult{\pgfmathresult}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \begingroup%
+ \FPmul\pgfmathresult{#1}{0.017453292519943295}%
+ \FPtan\pgfmathresult{\pgfmathresult}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}%
% acos
%
\def\pgfmathfpacos#1{%
- \pgfmathfpparse{#1}%
- \pgfmathfpacos@{\pgfmathresult}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfpacos@{\pgfmathresult}%
+}%
\def\pgfmathfpacos@#1{%
- \begingroup%
- \FParccos\pgfmathresult{#1}%
- \FPmul\pgfmathresult{\pgfmathresult}{57.295779513082320885}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \begingroup%
+ \FParccos\pgfmathresult{#1}%
+ \FPmul\pgfmathresult{\pgfmathresult}{57.295779513082320885}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}%
% asin
%
\def\pgfmathfpasin#1{%
- \pgfmathfpparse{#1}%
- \pgfmathfpasin@{\pgfmathresult}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfpasin@{\pgfmathresult}%
+}%
\def\pgfmathfpasin@#1{%
- \begingroup%
- \FParcsin\pgfmathresult{#1}%
- \FPmul\pgfmathresult{\pgfmathresult}{57.295779513082320885}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \begingroup%
+ \FParcsin\pgfmathresult{#1}%
+ \FPmul\pgfmathresult{\pgfmathresult}{57.295779513082320885}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}%
% atan
%
\def\pgfmathfpatan#1{%
- \pgfmathfpparse{#1}%
- \pgfmathfpatan@{\pgfmathresult}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfpatan@{\pgfmathresult}%
+}%
\def\pgfmathfpatan@#1{%
- \begingroup%
- \FParctan\pgfmathresult{#1}%
- \FPmul\pgfmathresult{\pgfmathresult}{57.295779513082320885}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \begingroup%
+ \FParctan\pgfmathresult{#1}%
+ \FPmul\pgfmathresult{\pgfmathresult}{57.295779513082320885}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}%
% cot
%
\def\pgfmathfpcot#1{%
- \pgfmathfpparse{#1}%
- \pgfmathfpcot@{\pgfmathresult}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfpcot@{\pgfmathresult}%
+}%
\def\pgfmathfpcot@#1{%
- \begingroup%
- \FPmul\pgfmathresult{#1}{0.017453292519943295}%
- \FPcot\pgfmathresult{\pgfmathresult}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \begingroup%
+ \FPmul\pgfmathresult{#1}{0.017453292519943295}%
+ \FPcot\pgfmathresult{\pgfmathresult}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}%
% sec
%
\def\pgfmathfpsec#1{%
- \pgfmathfpparse{#1}%
- \pgfmathfpsec@{\pgfmathresult}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfpsec@{\pgfmathresult}%
+}%
\def\pgfmathfpsec@#1{%
- \begingroup%
- \FPmul\pgfmathresult{#1}{0.017453292519943295}%
- \FPcos\pgfmathresult{\pgfmathresult}%
- \FPdiv\pgfmathresult{1}{\pgfmathresult}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \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}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfpcosec@{\pgfmathresult}%
+}%
\def\pgfmathfpcosec@#1{%
- \begingroup%
- \FPmul\pgfmathresult{#1}{0.017453292519943295}%
- \FPsin\pgfmathresult{\pgfmathresult}%
- \FPdiv\pgfmathresult{1}{\pgfmathresult}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \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}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfpdeg@{\pgfmathresult}%
+}%
\def\pgfmathfpdeg@#1{%
- \begingroup%
- \FPmul\pgfmathresult{#1}{57.295779513082320885}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \begingroup%
+ \FPmul\pgfmathresult{#1}{57.295779513082320885}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}%
% rad
%
\def\pgfmathfprad#1{%
- \pgfmathfpparse{#1}%
- \pgfmathfprad@{\pgfmathresult}%
-}
+ \pgfmathfpparse{#1}%
+ \pgfmathfprad@{\pgfmathresult}%
+}%
\def\pgfmathfprad@#1{%
- \begingroup%
- \FPmul\pgfmathresult{#1}{0.01745329251994325}%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \begingroup%
+ \FPmul\pgfmathresult{#1}{0.01745329251994325}%
+ \pgfmath@smuggleone\pgfmathresult%
+ \endgroup%
+}%
% Random stuff...
\def\pgfmathfpsetseed#1{%
- \pgfmathfpparse{#1}%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \FPseed\pgfmathresult\relax\pgfmath@%
-}
+ \pgfmathfpparse{#1}%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \FPseed\pgfmathresult\relax\pgfmath@%
+}%
% rnd
%
\def\pgfmathfprnd{%
- \begingroup%
- \FPrandom\pgfmathresult%
- \pgfmath@smuggleone\pgfmathresult%
- \endgroup%
-}
+ \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%
-}
-
+ \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
index 00ce27705f8..d976f99205e 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfpu.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryfpu.code.tex
@@ -13,114 +13,125 @@
% public macro which invokes '#1' if the fpu is installed and ready and '#2'
% otherwise.
\def\pgflibraryfpuifactive#1#2{%
- \ifpgfmathfloatparseactive
- #1%
- \else
- #2%
- \fi
+ \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,
-}
+ % 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= {%
+ \def\pgfmathfloatparse@output@choice{Y}%
+ \let\pgfmathfloatparse@output=\relax
+ },
+ fpu/output format/sci/.code= {%
+ \def\pgfmathfloatparse@output@choice{S}%
+ \def\pgfmathfloatparse@output{\pgfmathfloattosci@{\pgfmathresult}}%
+ },
+ fpu/output format/fixed/.code= {%
+ \def\pgfmathfloatparse@output@choice{F}%
+ \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
+\let\pgfmathfloatone=\pgfmathresult
+
% This is the replacement parser invocation.
% It does two things which are different to \pgfmathparse:
-% 1. it disables any dimension dependand scalings,
+% 1. it disables any dimension dependent scalings,
% 2. it implements the 'scale results' feature.
\def\pgfmathfloatparse{%
- \begingroup%
- % disable any dimension-dependant scalings:
- \let\pgfmathpostparse=\relax%
- \pgfmath@catcodes%
- \pgfmath@quickparsefalse%
- \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@}
+ \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{*}
+ \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
-}
+ \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
%
@@ -128,268 +139,308 @@
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}%
+ \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{}%
- }%
+ \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%
- }%
-}
+ % 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%
-}
+ \pgfmathfloat@prepareuninstallcmd{#1}%
+ \let#1=#2%
+}%
\def\pgfmathfloat@install@csname#1#2{%
- \expandafter\pgfmathfloat@prepareuninstallcmd\csname #1\endcsname%
- \pgfutil@namelet{#1}{#2}%
-}
+ \expandafter\pgfmathfloat@prepareuninstallcmd\csname #1\endcsname%
+ \pgfutil@namelet{#1}{#2}%
+}%
\def\pgfmathfloat@install@unimplemented#1{%
- \expandafter\pgfmathfloat@prepareuninstallcmd\csname pgfmath@#1@\endcsname%
- \expandafter\def\csname pgfmath#1@\endcsname##1{\pgfmathfloat@notimplemented{#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%
-}
+ \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%
-}
+ \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%
-}
-
-%
+ \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\pgfmathsign@=\pgfmathfloatsign@%
- \pgfmathfloat@install\pgfmathround@=\pgfmathfloatround@%
- \pgfmathfloat@install\pgfmathfloor@=\pgfmathfloatfloor@%
- \pgfmathfloat@install\pgfmathceil@=\pgfmathfloatceil@
- \pgfmathfloat@install\pgfmathint@=\pgfmathfloatint@
- \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@csname{pgfmathlog10@}{pgfmathfloatlog10@}%
- \pgfmathfloat@install@csname{pgfmathlog2@}{pgfmathfloatlog2@}%
- \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\pgfmathnotless@=\pgfmathfloatnotless@%
- \pgfmathfloat@install\pgfmathnotgreater@=\pgfmathfloatnotgreater@%
- \pgfmathfloat@install\pgfmathless@=\pgfmathfloatlessthan@%
- \pgfmathfloat@install\pgfmathgreaterthan@=\pgfmathfloatgreaterthan@%
- \pgfmathfloat@install\pgfmathgreater@=\pgfmathfloatgreaterthan@%
- \pgfmathfloat@install\pgfmathifthenelse@=\pgfmathfloatifthenelse@%
- \pgfmathfloat@install\pgfmathequal@=\pgfmathfloatequal@%
- \pgfmathfloat@install\pgfmathequalto@=\pgfmathfloatequal@%
- \pgfmathfloat@install\pgfmathnotequal@=\pgfmathfloatnotequal@%
- \pgfmathfloat@install\pgfmathnotequalto@=\pgfmathfloatnotequal@%
- \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@
- \expandafter\pgfmathfloat@install\csname pgfmathatan2@\endcsname=\pgfmathfloatatantwo@
- \pgfmathfloat@install@unimplemented{frac}%
- \pgfmathfloat@install@unimplemented{random}%
- \pgfmathfloat@install@unimplemented{setseed}%
- \pgfmathfloat@install@unimplemented{Mod}%
- \pgfmathfloat@install@unimplemented{real}%
-% \pgfmathfloat@install@unimplemented{height}%
- %
- %
- \pgfmathfloat@install\pgfmathscientific=\pgfmathfloatscientific%
-}
+ % 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\pgfmathsign@=\pgfmathfloatsign@%
+ \pgfmathfloat@install\pgfmathround@=\pgfmathfloatround@%
+ \pgfmathfloat@install\pgfmathfloor@=\pgfmathfloatfloor@%
+ \pgfmathfloat@install\pgfmathceil@=\pgfmathfloatceil@
+ \pgfmathfloat@install\pgfmathint@=\pgfmathfloatint@
+ \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@csname{pgfmathlog10@}{pgfmathfloatlog10@}%
+ \pgfmathfloat@install@csname{pgfmathlog2@}{pgfmathfloatlog2@}%
+ \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\pgfmathnotless@=\pgfmathfloatnotless@%
+ \pgfmathfloat@install\pgfmathnotgreater@=\pgfmathfloatnotgreater@%
+ \pgfmathfloat@install\pgfmathless@=\pgfmathfloatlessthan@%
+ \pgfmathfloat@install\pgfmathgreaterthan@=\pgfmathfloatgreaterthan@%
+ \pgfmathfloat@install\pgfmathgreater@=\pgfmathfloatgreaterthan@%
+ \pgfmathfloat@install\pgfmathifthenelse@=\pgfmathfloatifthenelse@%
+ \pgfmathfloat@install\pgfmathequal@=\pgfmathfloatequal@%
+ \pgfmathfloat@install\pgfmathequalto@=\pgfmathfloatequal@%
+ \pgfmathfloat@install\pgfmathnotequal@=\pgfmathfloatnotequal@%
+ \pgfmathfloat@install\pgfmathnotequalto@=\pgfmathfloatnotequal@%
+ \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\pgfmath@iftrue=\pgfmathfloat@iftrue%
+ \expandafter\pgfmathfloat@install\csname pgfmathatan2@\endcsname=\pgfmathfloatatantwo@
+ \pgfmathfloat@install@unimplemented{isprime}%
+ \pgfmathfloat@install@unimplemented{iseven}%
+ \pgfmathfloat@install@unimplemented{isodd}%
+ \pgfmathfloat@install@unimplemented{gcd}%
+ \pgfmathfloat@install@unimplemented{frac}%
+ \pgfmathfloat@install@unimplemented{random}%
+ \pgfmathfloat@install@unimplemented{setseed}%
+ \pgfmathfloat@install@unimplemented{Mod}%
+ \pgfmathfloat@install@unimplemented{div}%
+ \pgfmathfloat@install@unimplemented{real}%
+% \pgfmathfloat@install@unimplemented{height}%
+ %
+ %
+ \pgfmathfloat@install\pgfmathscientific=\pgfmathfloatscientific%
+}%
+
+\def\pgfmathfloat@iftrue{%
+ \if Y\pgfmathfloatparse@output@choice
+ \let\pgfmathfloat@@iftrue@v=\pgfmathfloatone
+ \let\pgfmathfloat@@iftrue@next=\pgfmathfloat@iftrue@
+ \else
+ \if S\pgfmathfloatparse@output@choice
+ \def\pgfmathfloat@@iftrue@v{1.0e0}%
+ \let\pgfmathfloat@@iftrue@next=\pgfmathfloat@iftrue@
+ \else
+ \def\pgfmath@next{\pgfutilifstartswith{1.0}}%
+ \expandafter\pgfmath@next\expandafter{\pgfmathresult}{%
+ \ifdim\pgfmathresult pt=1.0pt %
+ \let\pgfmathfloat@@iftrue@next=\pgfutil@firstoftwo
+ \else
+ \let\pgfmathfloat@@iftrue@next=\pgfutil@secondoftwo
+ \fi
+ }{%
+ \let\pgfmathfloat@@iftrue@next=\pgfutil@secondoftwo
+ }%
+ \fi
+ \fi
+ \pgfmathfloat@@iftrue@next%
+}%
+\def\pgfmathfloat@iftrue@{%
+ \ifx\pgfmathresult\pgfmathfloat@@iftrue@v
+ \let\pgfmath@next=\pgfutil@firstoftwo
+ \else
+ \let\pgfmath@next=\pgfutil@secondoftwo
+ \fi
+ \pgfmath@next%
+}%
\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%
- %\pgfmathfloat@install\pgfmathparse@trynumber@token=\pgfmathfloat@parse@trynumber@token
- \pgfmathfloat@install\pgfmathparse@expression@is@number=\pgfmathfloat@parse@expression@is@number
+ \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%
+ %\pgfmathfloat@install\pgfmathparse@trynumber@token=\pgfmathfloat@parse@trynumber@token
+ \pgfmathfloat@install\pgfmathparse@expression@is@number=\pgfmathfloat@parse@expression@is@number
}%
% This here might bring speed improvements... if implemented
% correctly.
-% However, this heuristics might fail in cases like "1+1" vs "1e+1" ...
+% However, this heuristics might fail in cases like "1+1" vs "1e+1" ...
%\def\pgfmathfloat@parse@trynumber@token{numericfpu}
%\pgfmath@tokens@make{numericfpu}{eE+-Y.0123456789}
\def\pgfmathfloat@parse@expression@is@number{%
- \pgfmathfloatparsenumber{\pgfmath@expression}%
+ \pgfmathfloatparsenumber{\pgfmath@expression}%
\pgfmath@smuggleone\pgfmathresult%
\endgroup
\ignorespaces
}%
\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
+ \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%
+ \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
+ % 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}}
- }{}%
+ \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}}
+\pgfmathdeclarepseudoconstant{inf}{\def\pgfmathresult{inf}}%
+\pgfmathdeclarepseudoconstant{INF}{\def\pgfmathresult{inf}}%
+\pgfmathdeclarepseudoconstant{Inf}{\def\pgfmathresult{inf}}%
+\pgfmathdeclarepseudoconstant{infty}{\def\pgfmathresult{inf}}%
+\pgfmathdeclarepseudoconstant{nan}{\def\pgfmathresult{nan}}%
+\pgfmathdeclarepseudoconstant{NaN}{\def\pgfmathresult{nan}}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
@@ -400,54 +451,54 @@
% 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
-}
+ \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%
+ \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
+ % 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%
-}
+ \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}
+ \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%
-}
+ \let\pgfmath@postparsegroup\pgfmath@parseoperator%
+ \ifnum\pgfmath@sign1<0
+ \pgfmathfloatneg@{\pgfmathresult}%
+ \let\pgfmath@sign\pgfutil@empty
+ \fi
+ \pgfmath@parseoperator%
+}%
@@ -456,71 +507,71 @@
% PRECONDITION:
% either
-% <number>e
-% ^
-% -> read the exponent.
+% <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
+ \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%
+ \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
+ \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
+ \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
- }%
+ \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
+ }%
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
@@ -582,200 +633,200 @@
\let\pgfmath@basic@false@=\pgfmathfalse@
\def\pgfmathfloatscientific#1#2{%
- \edef\pgfmathresult{#1e#2}%
- \expandafter\pgfmathfloatparsenumber\expandafter{\pgfmathresult}%
-}
+ \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
-}
+ \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@
-% ! (#1 < #2) <=> (#1 >= #2)
+% ! (#1 < #2) <=> (#1 >= #2)
\def\pgfmathfloatnotless@#1#2{%
- \pgfmathfloatless@{#1}{#2}%
- \ifpgfmathfloatcomparison
- \def\pgfmathresult{0.0}%
- \else
- \def\pgfmathresult{1.0}%
- \fi
-}%
-% ! (#1 > #2) <=> (#1 <= #2)
+ \pgfmathfloatless@{#1}{#2}%
+ \ifpgfmathfloatcomparison
+ \def\pgfmathresult{0.0}%
+ \else
+ \def\pgfmathresult{1.0}%
+ \fi
+}%
+% ! (#1 > #2) <=> (#1 <= #2)
\def\pgfmathfloatnotgreater@#1#2{%
- \pgfmathfloatless@{#2}{#1}%
- \ifpgfmathfloatcomparison
- \def\pgfmathresult{0.0}%
- \else
- \def\pgfmathresult{1.0}%
- \fi
+ \pgfmathfloatless@{#2}{#1}%
+ \ifpgfmathfloatcomparison
+ \def\pgfmathresult{0.0}%
+ \else
+ \def\pgfmathresult{1.0}%
+ \fi
}%
% 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
-}
+ \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}}
+ \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{}%
+ \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\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
+ \let\pgfmathresult=\pgfmathmaxsofar
+ \pgfmath@smuggleone{\pgfmathresult}%
+ \endgroup
}%
\def\pgfmathfloatmin@#1{%
- \begingroup
- \pgfmathfloatcreate{1}{1.0}{2147483644}%
- \let\pgfmathminsofar=\pgfmathresult
- \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\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
+ \let\pgfmathresult=\pgfmathminsofar
+ \pgfmath@smuggleone{\pgfmathresult}%
+ \endgroup
}%
\def\pgfmathfloatmaxtwo#1#2{%
- \pgfmathfloatlessthan{#1}{#2}%
- \ifpgfmathfloatcomparison
- \edef\pgfmathresult{#2}%
- \else
- \edef\pgfmathresult{#1}%
- \fi
-}
+ \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
-}
+ \pgfmathfloatlessthan{#1}{#2}%
+ \ifpgfmathfloatcomparison
+ \edef\pgfmathresult{#1}%
+ \else
+ \edef\pgfmathresult{#2}%
+ \fi
+}%
\let\pgfmathfloatmin=\pgfmathfloatmintwo
-% Renormalizes #1 to extended precision mantisse, meaning
+% Renormalizes #1 to extended precision mantissa, meaning
% 100 <= m < 1000
% instead of 1 <= 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).
@@ -788,30 +839,30 @@
% \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
+ \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}%
+ \edef\pgfmathresult{#1}%
}%
\def\pgfmathfloattoextentedprecision@@one#1.#2#3\pgfmathfloat@EOI{%
- \edef\pgfmathresult{#1#2.#3}%
+ \edef\pgfmathresult{#1#2.#3}%
}%
\def\pgfmathfloattoextentedprecision@@two#1.#2#3#4\pgfmathfloat@EOI{%
- \edef\pgfmathresult{#1#2#3.#4}%
+ \edef\pgfmathresult{#1#2#3.#4}%
}%
\def\pgfmathfloattoextentedprecision@@three#1.#2#3#4#5\pgfmathfloat@EOI{%
- \edef\pgfmathresult{#1#2#3#4.#5}%
+ \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)
@@ -821,19 +872,19 @@
%
% 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
+ \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}%
@@ -842,143 +893,143 @@
%
% INPUT:
% #1 normalized floating point number. Maybe a macro (it will be expanded ONCE)
-%
+%
% OUTPUT:
-% - \pgfmathresult : the mantisse in extended precision
+% - \pgfmathresult : the mantissa 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
+ \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
+ \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
+ \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
+ \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
+ \pgfmathfloatgetflagstomacro{#1}\pgfmathfloatiffinite@
+ \ifnum\pgfmathfloatiffinite@>2 #3\else #2\fi
}%
\def\pgfmathfloatifthenelse@#1#2#3{%
- \pgfmathfloatifflags{#1}{0}{%
- \edef\pgfmathresult{#3}%%
- }{%
- \edef\pgfmathresult{#2}%
- }%
-}
+ \pgfmathfloatifflags{#1}{0}{%
+ \edef\pgfmathresult{#3}%%
+ }{%
+ \edef\pgfmathresult{#2}%
+ }%
+}%
\def\pgfmathfloatequal@#1#2{%
- \pgfmathfloatifapproxequalrel{#1}{#2}{%
- \def\pgfmathresult{1}%
- \pgfmathfloatcomparisontrue
- }{%
- \def\pgfmathresult{0}%
- \pgfmathfloatcomparisonfalse
- }%
-}
+ \pgfmathfloatifapproxequalrel{#1}{#2}{%
+ \def\pgfmathresult{1}%
+ \pgfmathfloatcomparisontrue
+ }{%
+ \def\pgfmathresult{0}%
+ \pgfmathfloatcomparisonfalse
+ }%
+}%
\let\pgfmathfloatequalto@=\pgfmathfloatequal@
\def\pgfmathfloatnotequal@#1#2{%
- \pgfmathfloatifapproxequalrel{#1}{#2}{%
- \def\pgfmathresult{0}%
- \pgfmathfloatcomparisonfalse
- }{%
- \def\pgfmathresult{1}%
- \pgfmathfloatcomparisontrue
- }%
-}
+ \pgfmathfloatifapproxequalrel{#1}{#2}{%
+ \def\pgfmathresult{0}%
+ \pgfmathfloatcomparisonfalse
+ }{%
+ \def\pgfmathresult{1}%
+ \pgfmathfloatcomparisontrue
+ }%
+}%
\let\pgfmathfloatnotequalto@=\pgfmathfloatnotequal@
% 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
+ \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'
@@ -993,227 +1044,227 @@
% \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)
+ \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=mantissa 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}%
-}
+ \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
+ \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
+ \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
+ \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@
@@ -1221,237 +1272,290 @@
%
% 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
+ \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
+ \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
+ \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.
+% 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
+% POSTCONDITION: \pgfmathresult contains the result and
+% \pgfmathfloatintwasnoop=1 if there was nothing to do
+% \pgfmathfloatintwasnoop=0 if there where non-zero digits after the period
+% \pgfmathfloatintwasnoop=2 if there where digits after the period. The digits will be stored in \pgfmathfloatintremainder in this case.
\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
+ \begingroup
+ \edef\pgfmathfloatint@input{#1}%
+ \expandafter\pgfmathfloat@decompose@tok\pgfmathfloatint@input\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \gdef\pgfmathfloatintwasnoop{1}%
+ \gdef\pgfmathfloatintremainder{}%
+ \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
+ %\message{ XXXXX int(\pgfmathfloatint@input) = \pgfmathresult -> was no op = \pgfmathfloatintwasnoop\space (remainder \pgfmathfloatintremainder)^^J}%
+ \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
+ \ifnum\pgfmathfloat@a@E<0
+ \pgfmathfloat@a@S=0
+ \pgfmathfloat@a@Mtok={0.0}%
+ \pgfmathfloat@a@E=0
+ \gdef\pgfmathfloatintwasnoop{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{}%
+ \def\pgfmathfloatint@@loop@{#1}%
+ \ifx\pgfmathfloatint@@loop@\pgfmathfloat@EOI
+ \gdef\pgfmathfloatintwasnoop{1}%
+ \let\pgfmathfloatint@@loop@next=\relax
+ \else
+ \ifnum\pgfmathfloat@b@E=0
+ \def\pgfmathfloatint@@loop@next{\pgfmathfloatint@@loop@gobble#1}%
+ \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{%
+ \if0\pgfmathfloatintwasnoop
+ \else
+ \gdef\pgfmathfloatintwasnoop{2}%
+ \gdef\pgfmathfloatintremainder{#1}%
+ \fi
+}%
\let\pgfmathfloatint=\pgfmathfloatint@
\def\pgfmathfloatfloor#1{%
- \edef\pgfmathfloat@loc@TMPa{#1}%
- \pgfmathfloatcreate{2}{5.0}{-1}% -0.5
- \let\pgfmathfloat@loc@TMPb=\pgfmathresult
- \pgfmathfloatadd@{\pgfmathfloat@loc@TMPa}{\pgfmathfloat@loc@TMPb}%
- \expandafter\pgfmathfloatround@\expandafter{\pgfmathresult}%
-}
+ \edef\pgfmath@orig{#1}%
+ \pgfmathfloatint@{#1}%
+ \pgfmathfloatifflags{\pgfmath@orig}{2}{%
+ \let\pgfmath@trunc=\pgfmathresult
+ \ifcase\pgfmathfloatintwasnoop\relax
+ % ah - we stripped something! Round DOWN
+ \pgfmathfloatcreate{2}{1.0}{0}% -1
+ \expandafter\pgfmathfloatadd@\expandafter{\pgfmathresult}{\pgfmath@trunc}%
+ \or
+ % was no-op
+ \let\pgfmathresult=\pgfmath@trunc
+ \else
+ % ok, we have to inspect the remainder:
+ \pgfmathfloatparsenumber{0.\pgfmathfloatintremainder}%
+ \pgfmathfloatifflags{\pgfmathresult}{1}{%
+ % ah - we stripped a non-zero remainder! Round DOWN
+ \pgfmathfloatcreate{2}{1.0}{0}% -1
+ \expandafter\pgfmathfloatadd@\expandafter{\pgfmathresult}{\pgfmath@trunc}%
+ }{%
+ % was no-op
+ \let\pgfmathresult=\pgfmath@trunc
+ }%
+ \fi
+ }{}%
+}%
\let\pgfmathfloatfloor@=\pgfmathfloatfloor
\def\pgfmathfloatceil#1{%
- \edef\pgfmathfloat@loc@TMPa{#1}%
- \pgfmathfloatcreate{1}{5.0}{-1}% +0.5
- \let\pgfmathfloat@loc@TMPb=\pgfmathresult
- \pgfmathfloatadd@{\pgfmathfloat@loc@TMPa}{\pgfmathfloat@loc@TMPb}%
- \expandafter\pgfmathfloatround@\expandafter{\pgfmathresult}%
-}
+ \edef\pgfmath@orig{#1}%
+ \pgfmathfloatint@{#1}%
+ \pgfmathfloatifflags{\pgfmath@orig}{1}{%
+ \let\pgfmath@trunc=\pgfmathresult
+ \ifcase\pgfmathfloatintwasnoop\relax
+ % ah - we stripped something! Round UP
+ \pgfmathfloatcreate{1}{1.0}{0}% +1
+ \expandafter\pgfmathfloatadd@\expandafter{\pgfmathresult}{\pgfmath@trunc}%
+ \or
+ % was no-op
+ \let\pgfmathresult=\pgfmath@trunc
+ \else
+ % ok, we have to inspect the remainder:
+ \pgfmathfloatparsenumber{0.\pgfmathfloatintremainder}%
+ \pgfmathfloatifflags{\pgfmathresult}{1}{%
+ % ah - we stripped a non-zero remainder! Round UP
+ \pgfmathfloatcreate{1}{1.0}{0}% +1
+ \expandafter\pgfmathfloatadd@\expandafter{\pgfmathresult}{\pgfmath@trunc}%
+ }{%
+ % was no-op
+ \let\pgfmathresult=\pgfmath@trunc
+ }%
+ \fi
+ }{}%
+}%
\let\pgfmathfloatceil@=\pgfmathfloatceil
\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}%
+ \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
@@ -1465,150 +1569,161 @@
% \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
-}
+ \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
+ \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
}%
%
% Defines \pgfmathresult to be sign(#1)
\def\pgfmathfloatsign@#1{%
- \begingroup
- \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
- \ifcase\pgfmathfloat@a@S
- % 0:
- \pgfmathfloatcreate{0}{0.0}{0}%
- \or
- % +: ok, is positive.
- \pgfmathfloatcreate{1}{1.0}{0}%
- \or
- % -:
- \pgfmathfloatcreate{2}{1.0}{0}%
- \or
- % nan: do nothing.
- \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
- \or
- % +infty:.
- \pgfmathfloatcreate{1}{1.0}{0}%
- \or
- % -infty:
- \pgfmathfloatcreate{2}{1.0}{0}%
- \fi
- \pgfmath@smuggleone\pgfmathresult
- \endgroup
+ \begingroup
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \ifcase\pgfmathfloat@a@S
+ % 0:
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \or
+ % +: ok, is positive.
+ \pgfmathfloatcreate{1}{1.0}{0}%
+ \or
+ % -:
+ \pgfmathfloatcreate{2}{1.0}{0}%
+ \or
+ % nan: do nothing.
+ \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{\the\pgfmathfloat@a@Mtok}{\the\pgfmathfloat@a@E}%
+ \or
+ % +infty:.
+ \pgfmathfloatcreate{1}{1.0}{0}%
+ \or
+ % -infty:
+ \pgfmathfloatcreate{2}{1.0}{0}%
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
}%
\let\pgfmathfloatsign=\pgfmathfloatsign@
% Computes the absolute error |#1 - #2| into \pgfmathresult.
\def\pgfmathfloatabserror@#1#2{%
- \pgfmathfloatsubtract@{#1}{#2}%
- \pgfmathfloatabs@{\pgfmathresult}%
+ \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}%
- \let\pgfmathfloat@subtract=\pgfmathresult
- \pgfmathfloatifflags{#2}{0}{%
- \let\pgfmathresult=\pgfmathfloat@subtract
- }{%
- \pgfmathfloatdivide@{\pgfmathfloat@subtract}{#2}%
- }%
- \pgfmathfloatabs@{\pgfmathresult}%
+ \pgfmathfloatsubtract@{#1}{#2}%
+ \let\pgfmathfloat@subtract=\pgfmathresult
+ \pgfmathfloatifflags{#2}{0}{%
+ \let\pgfmathresult=\pgfmathfloat@subtract
+ }{%
+ \pgfmathfloatdivide@{\pgfmathfloat@subtract}{#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
-}
+ \begingroup
+ \pgfmathfloattoint{#1}%
+ \let\pgfmathfloat@loc@TMPa=\pgfmathresult
+ \pgfmathfloattoint{#2}%
+ \let\pgfmathfloat@loc@TMPb=\pgfmathresult
+ \c@pgfmath@counta=\pgfmathfloat@loc@TMPa\relax
+ \divide\c@pgfmath@counta by\pgfmathfloat@loc@TMPb\relax
+ \expandafter\pgfmathfloatparsenumber\expandafter{\the\c@pgfmath@counta}%
+ %
+ \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
-}
+ \pgfmathfloatmod@{#1}{#2}%
+ %--------------------------------------------------
+ % \begingroup
+ % % FIXME : is this function correct? \pgfmathfloatmod had a
+ % % rounding flaw...
+ % \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}%
+ \pgfmathfloatcreate{1}{3.14159265358979}{0}%
}%
\let\pgfmathfloatpi=\pgfmathfloatpi@
\def\pgfmathfloate@{%
- \pgfmathfloatcreate{1}{2.71828182845905}{0}%
-}
+ \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%
-}
+ \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%
-}
+ \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.
@@ -1616,167 +1731,167 @@
%
% #1 is a one-argument macro which assigns \pgfmathresult.
\def\pgfmathfloatTRIG@#1#2{%
- \if0\pgfmath@trig@format@choice
- % trig format=deg
- \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}%
- \else
- % trig format=rad
- \expandafter\ifx\csname pgfmathfloatTRIG@rad@NUM\endcsname\relax%
- % Lazy evaluation:
- \pgfmathfloatcreate{1}{6.28318530717959}{0}%
- \global\let\pgfmathfloatTRIG@rad@NUM=\pgfmathresult
- \pgfmathfloatcreate{1}{1.59154943091895}{-1}%
- \global\let\pgfmathfloatTRIG@rad@NUM@INV=\pgfmathresult
- \fi
- \pgfmathfloatmodknowsinverse@{#2}{\pgfmathfloatTRIG@rad@NUM}{\pgfmathfloatTRIG@rad@NUM@INV}%
- \fi
- \pgfmathfloattofixed@{\pgfmathresult}%
- \expandafter#1\expandafter{\pgfmathresult}%
- \pgfmathfloatparsenumber{\pgfmathresult}%
-}%
-
-\def\pgfmathfloatsin@#1{\pgfmathfloatTRIG@\pgfmath@basic@sin@{#1}}
+ \if0\pgfmath@trig@format@choice
+ % trig format=deg
+ \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}%
+ \else
+ % trig format=rad
+ \expandafter\ifx\csname pgfmathfloatTRIG@rad@NUM\endcsname\relax%
+ % Lazy evaluation:
+ \pgfmathfloatcreate{1}{6.28318530717959}{0}%
+ \global\let\pgfmathfloatTRIG@rad@NUM=\pgfmathresult
+ \pgfmathfloatcreate{1}{1.59154943091895}{-1}%
+ \global\let\pgfmathfloatTRIG@rad@NUM@INV=\pgfmathresult
+ \fi
+ \pgfmathfloatmodknowsinverse@{#2}{\pgfmathfloatTRIG@rad@NUM}{\pgfmathfloatTRIG@rad@NUM@INV}%
+ \fi
+ \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}}
+\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
-}
+ % 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
+ % 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
- \pgfmathiftrigonometricusesdeg{%
- \pgfmathfloatcreate{1}{9.0}{1}%
- }{%
- \pgfmathfloatcreate{1}{1.570796326794}{0}%
- }%
- \else
- \pgfmathfloatlessthan{#1}{\pgfmathfloatatan@TMPB}%
- \ifpgfmathfloatcomparison
- \pgfmathiftrigonometricusesdeg{%
- \pgfmathfloatcreate{2}{9.0}{1}%
- }{%
- \pgfmathfloatcreate{2}{1.570796326794}{0}%
- }%
- \else
- \pgfmathfloattofixed@{#1}%
- \expandafter\pgfmath@basic@atan@\expandafter{\pgfmathresult}%
- \pgfmathfloatparsenumber{\pgfmathresult}%
- \fi
- \fi
- \pgfmath@smuggleone\pgfmathresult
- \endgroup
+ \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
+ \pgfmathiftrigonometricusesdeg{%
+ \pgfmathfloatcreate{1}{9.0}{1}%
+ }{%
+ \pgfmathfloatcreate{1}{1.570796326794}{0}%
+ }%
+ \else
+ \pgfmathfloatlessthan{#1}{\pgfmathfloatatan@TMPB}%
+ \ifpgfmathfloatcomparison
+ \pgfmathiftrigonometricusesdeg{%
+ \pgfmathfloatcreate{2}{9.0}{1}%
+ }{%
+ \pgfmathfloatcreate{2}{1.570796326794}{0}%
+ }%
+ \else
+ \pgfmathfloattofixed@{#1}%
+ \expandafter\pgfmath@basic@atan@\expandafter{\pgfmathresult}%
+ \pgfmathfloatparsenumber{\pgfmathresult}%
+ \fi
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
}%
\let\pgfmathfloatatan=\pgfmathfloatatan@
\def\pgfmathfloatatantwo#1#2{%
% Note: first parameter is y (!), second is x (!)
\begingroup%
- \let\pgfmath@trig@format@choice@@=\pgfmath@trig@format@choice
- \def\pgfmath@trig@format@choice{0}%
- %
- \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
- \expandafter\pgfmathfloat@decompose#2\relax\pgfmathfloat@b@S\pgfmathfloat@b@M\pgfmathfloat@b@E
- \ifnum\pgfmathfloat@a@S=0
- % ok, #1 = 0. Substitute by 1e-16 such that the next \ifnum catches it:
- \pgfmathfloat@a@E=-16 %
- \fi
- %
- \ifnum\pgfmathfloat@a@E<-3 %
- \ifnum\pgfmathfloat@b@S=2 %
- % #2 < 0
- \pgfmathfloatcreate{1}{1.8}{2}% +180
- \else
- \ifnum\pgfmathfloat@b@S=1 %
- % #2 >0
- \pgfmathfloatcreate{0}{0.0}{0}%
- \else
- % + or - 90, just use the sign of #1:
- \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{9.0}{1}%
- \fi
- \fi
+ \let\pgfmath@trig@format@choice@@=\pgfmath@trig@format@choice
+ \def\pgfmath@trig@format@choice{0}%
+ %
+ \expandafter\pgfmathfloat@decompose@tok#1\relax\pgfmathfloat@a@S\pgfmathfloat@a@Mtok\pgfmathfloat@a@E
+ \expandafter\pgfmathfloat@decompose#2\relax\pgfmathfloat@b@S\pgfmathfloat@b@M\pgfmathfloat@b@E
+ \ifnum\pgfmathfloat@a@S=0
+ % ok, #1 = 0. Substitute by 1e-16 such that the next \ifnum catches it:
+ \pgfmathfloat@a@E=-16 %
+ \fi
+ %
+ \ifnum\pgfmathfloat@a@E<-3 %
+ \ifnum\pgfmathfloat@b@S=2 %
+ % #2 < 0
+ \pgfmathfloatcreate{1}{1.8}{2}% +180
+ \else
+ \ifnum\pgfmathfloat@b@S=1 %
+ % #2 >0
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \else
+ % + or - 90, just use the sign of #1:
+ \pgfmathfloatcreate{\the\pgfmathfloat@a@S}{9.0}{1}%
+ \fi
+ \fi
\else%
\pgfmathfloatabs@{#1}\let\pgfmath@tempa\pgfmathresult%
\pgfmathfloatabs@{#2}\let\pgfmath@tempb\pgfmathresult%
- \pgfmathfloatgreaterthan@{\pgfmath@tempa}{\pgfmath@tempb}%
- \ifpgfmathfloatcomparison
+ \pgfmathfloatgreaterthan@{\pgfmath@tempa}{\pgfmath@tempb}%
+ \ifpgfmathfloatcomparison
\pgfmathfloatdivide@{#2}{\pgfmath@tempa}%
\expandafter\pgfmathfloatatan@\expandafter{\pgfmathresult}%
- \let\pgfmath@tempa=\pgfmathresult
- \pgfmathfloatcreate{1}{9.0}{1}%
- \let\pgfmath@tempb=\pgfmathresult
- \pgfmathfloatsubtract@{\pgfmath@tempb}{\pgfmath@tempa}%
+ \let\pgfmath@tempa=\pgfmathresult
+ \pgfmathfloatcreate{1}{9.0}{1}%
+ \let\pgfmath@tempb=\pgfmathresult
+ \pgfmathfloatsubtract@{\pgfmath@tempb}{\pgfmath@tempa}%
\else%
\pgfmathfloatdivide@{\pgfmath@tempa}{#2}%
\expandafter\pgfmathfloatatan@\expandafter{\pgfmathresult}%
- \expandafter\pgfmathfloatifflags\expandafter{\pgfmathresult}{2}{%
- \let\pgfmath@tempa=\pgfmathresult
- \pgfmathfloatcreate{1}{1.8}{2}%
- \let\pgfmath@tempb=\pgfmathresult
- \pgfmathfloatadd@{\pgfmath@tempa}{\pgfmath@tempb}%
- }{}%
+ \expandafter\pgfmathfloatifflags\expandafter{\pgfmathresult}{2}{%
+ \let\pgfmath@tempa=\pgfmathresult
+ \pgfmathfloatcreate{1}{1.8}{2}%
+ \let\pgfmath@tempb=\pgfmathresult
+ \pgfmathfloatadd@{\pgfmath@tempa}{\pgfmath@tempb}%
+ }{}%
\fi%
- %
- \pgfmathfloatifflags{#1}{-}{%
- % #1 < 0:
- \pgfmathfloatmultiplyfixed@{\pgfmathresult}{-1}%
- }{}%
+ %
+ \pgfmathfloatifflags{#1}{-}{%
+ % #1 < 0:
+ \pgfmathfloatmultiplyfixed@{\pgfmathresult}{-1}%
+ }{}%
\fi%
- \if1\pgfmath@trig@format@choice@@
- % trig format=rad
- \pgfmathfloat@scale@deg@to@rad\pgfmathresult
- \fi
+ \if1\pgfmath@trig@format@choice@@
+ % trig format=rad
+ \pgfmathfloat@scale@deg@to@rad\pgfmathresult
+ \fi
\pgfmath@smuggleone\pgfmathresult%
- \endgroup%
+ \endgroup%
}%
\let\pgfmathfloatatantwo@=\pgfmathfloatatantwo
\expandafter\let\csname pgfmathfloatatan2\endcsname=\pgfmathfloatatantwo
\expandafter\let\csname pgfmathfloatatan2@\endcsname=\pgfmathfloatatantwo@
\def\pgfmathfloat@scale@deg@to@rad#1{%
- \edef\pgfmathfloat@loc@TMPb{#1}%
- \pgfmathfloatcreate{1}{1.74532925199433}{-2}% = pi / 180
- \pgfmathfloatmultiply@{\pgfmathresult}{\pgfmathfloat@loc@TMPb}%
+ \edef\pgfmathfloat@loc@TMPb{#1}%
+ \pgfmathfloatcreate{1}{1.74532925199433}{-2}% = pi / 180
+ \pgfmathfloatmultiply@{\pgfmathresult}{\pgfmathfloat@loc@TMPb}%
}%
-\def\pgfmathfloatsec@#1{\pgfmathfloatTRIG@\pgfmath@basic@cos@{#1}\pgfmathfloatreciprocal@{\pgfmathresult}}
+\def\pgfmathfloatsec@#1{\pgfmathfloatTRIG@\pgfmath@basic@cos@{#1}\pgfmathfloatreciprocal@{\pgfmathresult}}%
\let\pgfmathfloatsec=\pgfmathfloatsec@
-\def\pgfmathfloatcosec@#1{\pgfmathfloatTRIG@\pgfmath@basic@sin@{#1}\pgfmathfloatreciprocal@{\pgfmathresult}}
+\def\pgfmathfloatcosec@#1{\pgfmathfloatTRIG@\pgfmath@basic@sin@{#1}\pgfmathfloatreciprocal@{\pgfmathresult}}%
\let\pgfmathfloatcosec=\pgfmathfloatcosec@
% Expands #2 using \edef and invokes #1 with the resulting string.
@@ -1788,33 +1903,33 @@
% will invoke
% \pgfmathexp@{7.9}
\def\pgfmathlog@invoke@expanded#1#2{%
- \edef\pgfmath@resulttemp{#2}%
- \expandafter#1\pgfmath@resulttemp
-}
+ \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
-}
+ \pgfmathlog@float{#1}%
+ \ifx\pgfmathresult\pgfutil@empty
+ \pgfmathfloatcreate{3}{0.0}{0}%
+ \else
+ \pgfmathfloatparsenumber{\pgfmathresult}%
+ \fi
+}%
\let\pgfmathfloatln=\pgfmathfloatln@
\expandafter\def\csname pgfmathfloatlog10@\endcsname#1{%
- \pgfmathfloatln@{#1}%
- \let\pgfmathfloat@log@e=\pgfmathresult
- \pgfmathfloatcreate{1}{4.34294481903252}{-1}% 1/ln(10)
- \pgfmathfloatmultiply@{\pgfmathresult}{\pgfmathfloat@log@e}%
+ \pgfmathfloatln@{#1}%
+ \let\pgfmathfloat@log@e=\pgfmathresult
+ \pgfmathfloatcreate{1}{4.34294481903252}{-1}% 1/ln(10)
+ \pgfmathfloatmultiply@{\pgfmathresult}{\pgfmathfloat@log@e}%
}%
\pgfutil@namelet{pgfmathfloatlog10}{pgfmathfloatlog10@}%
\expandafter\def\csname pgfmathfloatlog2@\endcsname#1{%
- \pgfmathfloatln@{#1}%
- \let\pgfmathfloat@log@e=\pgfmathresult
- \pgfmathfloatcreate{1}{1.44269504088896}{0}% 1/ln(2)
- \pgfmathfloatmultiply@{\pgfmathresult}{\pgfmathfloat@log@e}%
+ \pgfmathfloatln@{#1}%
+ \let\pgfmathfloat@log@e=\pgfmathresult
+ \pgfmathfloatcreate{1}{1.44269504088896}{0}% 1/ln(2)
+ \pgfmathfloatmultiply@{\pgfmathresult}{\pgfmathfloat@log@e}%
}%
\pgfutil@namelet{pgfmathfloatlog2}{pgfmathfloatlog2@}%
@@ -1827,7 +1942,7 @@
%
% 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.
+% errors in these cases.
%
% The natural logarithm is computed using log(X*10^Y) = log(X) + log(10)*Y
%
@@ -1837,315 +1952,315 @@
% 2. it returns the result as fixed point number
% Use \pgfmathln@ instead!
\def\pgfmathlog@#1{%
- \pgfmathfloatparsenumber{#1}%
- \pgfmathlog@float{\pgfmathresult}%
-}
+ \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%
-}
+ \begingroup%
+ % compute #1 = M*10^E with normalised mantissa 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
+% 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
+% with k chosen 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
+ \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}}%
+ % 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}%
-}
+ \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
+ \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}%
+ \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
+ \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
+ \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
+ \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
- \pgfmathfloatgetflags{#1}\c@pgfmath@counta
- \ifnum0=\c@pgfmath@counta
- % ah: 0^x
- \pgfmathfloatgetflags{#2}\c@pgfmath@counta
- \ifnum0=\c@pgfmath@counta
- % ah: 0^0
- \pgfmathfloatcreate{1}{1.0}{0}%
- \else
- % ah: 0^x with x!=0:
- \pgfmathfloatcreate{0}{0.0}{0}%
- \fi
- \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
- \fi
-}
+ \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
+ \pgfmathfloatgetflags{#1}\c@pgfmath@counta
+ \ifnum0=\c@pgfmath@counta
+ % ah: 0^x
+ \pgfmathfloatgetflags{#2}\c@pgfmath@counta
+ \ifnum0=\c@pgfmath@counta
+ % ah: 0^0
+ \pgfmathfloatcreate{1}{1.0}{0}%
+ \else
+ % ah: 0^x with x!=0:
+ \pgfmathfloatcreate{0}{0.0}{0}%
+ \fi
+ \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
+ \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%
+ \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%
+ \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{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@%
-}{}
+ % 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
+ \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.
@@ -2153,60 +2268,60 @@
% 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
+ \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
+ \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
+ \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
+ \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
index 41c0d1cdc19..7de4a2b9e97 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryintersections.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryintersections.code.tex
@@ -11,7 +11,7 @@
% Experimentally, it performed well while computing ~12 intersections of two
% plots, each with 600 samples. It failed when the number of samples exceeded 700.
-\usepgflibrary{fpu}
+\usepgflibrary{fpu}%
\newcount\pgf@intersect@solutions
@@ -19,28 +19,28 @@
\newif\ifpgf@intersect@sort@by@second@path
\def\pgfintersectionsortbyfirstpath{%
- \pgf@intersect@sorttrue%
- \pgf@intersect@sort@by@second@pathfalse%
-}
+ \pgf@intersect@sorttrue%
+ \pgf@intersect@sort@by@second@pathfalse%
+}%
\def\pgfintersectionsortbysecondpath{%
- \pgf@intersect@sorttrue%
- \pgf@intersect@sort@by@second@pathtrue%
-}
+ \pgf@intersect@sorttrue%
+ \pgf@intersect@sort@by@second@pathtrue%
+}%
% #1: the index. It starts at 1 and ends with \pgfintersectionsolutions (inclusive).
% Invalid values will implicitly result in the origin.
\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%
-}
+ \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%
+}%
% Gets the segment indices of solution #1.
%
@@ -51,27 +51,27 @@
% Example: \pgfintersectiongetsolutionsegmentindices{0}{\first}{\second}
%
% -> \first may be 0 if point #0 is in the 0'th segment
-% -> \second may be 42 if point #0 is in the 42'th segment
+% -> \second may be 42 if point #0 is in the 42'th segment
%
% The "segment index" is actually close to the "time" of the solution.
% If a solution is at "time" 42.2, it will have segment index 42.
\def\pgfintersectiongetsolutionsegmentindices#1#2#3{%
- \ifnum#1<1\relax%
- \let#2=\pgfutil@empty
- \let#3=\pgfutil@empty
- \else%
- \ifnum#1>\pgfintersectionsolutions\relax%
- \let#2=\pgfutil@empty
- \let#3=\pgfutil@empty
- \else%
- \def\pgf@temp##1##2##3##4{%
- \edef#2{##1}%
- \edef#3{##2}%
- }%
- \expandafter\let\expandafter\pgf@tempb\csname pgf@intersect@solution@props@#1\endcsname
- \expandafter\pgf@temp\pgf@tempb
- \fi%
- \fi%
+ \ifnum#1<1\relax%
+ \let#2=\pgfutil@empty
+ \let#3=\pgfutil@empty
+ \else%
+ \ifnum#1>\pgfintersectionsolutions\relax%
+ \let#2=\pgfutil@empty
+ \let#3=\pgfutil@empty
+ \else%
+ \def\pgf@temp##1##2##3##4{%
+ \edef#2{##1}%
+ \edef#3{##2}%
+ }%
+ \expandafter\let\expandafter\pgf@tempb\csname pgf@intersect@solution@props@#1\endcsname
+ \expandafter\pgf@temp\pgf@tempb
+ \fi%
+ \fi%
}%
% Gets the time indices of solution #1.
@@ -96,37 +96,37 @@
% \pgfintersectiongetsolutionsegmentindices (which is a
% "coarse-grained" time).
\def\pgfintersectiongetsolutiontimes#1#2#3{%
- \ifnum#1<1\relax%
- \let#2=\pgfutil@empty
- \let#3=\pgfutil@empty
- \else%
- \ifnum#1>\pgfintersectionsolutions\relax%
- \let#2=\pgfutil@empty
- \let#3=\pgfutil@empty
- \else%
- \def\pgf@temp##1##2##3##4{%
- \edef#2{##3}%
- \edef#3{##4}%
- %
- % check for fallback to segment indices:
- \ifx#2\pgfutil@empty \edef#2{##1}\fi
- \ifx#3\pgfutil@empty \edef#3{##2}\fi
- }%
- \expandafter\let\expandafter\pgf@tempb\csname pgf@intersect@solution@props@#1\endcsname
- \expandafter\pgf@temp\pgf@tempb
- \fi%
- \fi%
+ \ifnum#1<1\relax%
+ \let#2=\pgfutil@empty
+ \let#3=\pgfutil@empty
+ \else%
+ \ifnum#1>\pgfintersectionsolutions\relax%
+ \let#2=\pgfutil@empty
+ \let#3=\pgfutil@empty
+ \else%
+ \def\pgf@temp##1##2##3##4{%
+ \edef#2{##3}%
+ \edef#3{##4}%
+ %
+ % check for fallback to segment indices:
+ \ifx#2\pgfutil@empty \edef#2{##1}\fi
+ \ifx#3\pgfutil@empty \edef#3{##2}\fi
+ }%
+ \expandafter\let\expandafter\pgf@tempb\csname pgf@intersect@solution@props@#1\endcsname
+ \expandafter\pgf@temp\pgf@tempb
+ \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%
-}
+ \begingroup%
+ \pgftransforminvert%
+ \pgfpointorigin%
+ \pgf@pos@transform@glob
+ \global\pgf@x=\pgf@x%
+ \global\pgf@y=\pgf@y%
+ \endgroup%
+}%
% #1 code which assigns the first path using \pgfsetpath.
% #2 code which assigns the second path using \pgfsetpath.
@@ -134,262 +134,262 @@
% On output, the points, their properties, and the number of points are set.
% Use \pgfintersectionsolutions which expands to the number of intersections
\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%
- \pgf@intersect@path@reset@a
- %
- \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%
- %
- \pgfprocessround\pgf@intersect@path@a\pgf@intersect@path@a%
- \pgfprocessround\pgf@intersect@path@b\pgf@intersect@path@b%
- %
- \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}%
- \edef\pgf@marshal{\noexpand\pgf@intersection@set@properties{\csname pgfpoint@g@intersect@solution@\pgfmathcounter @props\endcsname}}%
- \pgf@marshal
- \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%
-}
+ \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%
+ \pgf@intersect@path@reset@a
+ %
+ \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%
+ %
+ \pgfprocessround\pgf@intersect@path@a\pgf@intersect@path@a%
+ \pgfprocessround\pgf@intersect@path@b\pgf@intersect@path@b%
+ %
+ \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}%
+ \edef\pgf@marshal{\noexpand\pgf@intersection@set@properties{\csname pgfpoint@g@intersect@solution@\pgfmathcounter @props\endcsname}}%
+ \pgf@marshal
+ \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@intersection@set@properties#1{%
- \pgfutil@namedef{pgf@intersect@solution@props@\pgfmathcounter}{#1}%
+ \pgfutil@namedef{pgf@intersect@solution@props@\pgfmathcounter}{#1}%
}%
% #1 a global name prefix to store properties.
\def\pgf@intersection@store@properties#1{%
- % we store the time offsets as well and make them available programmatically:
- % note that \pgf@intersect@time@a and \pgf@intersect@time@b may be empty.
- %
- % However, \pgf@intersect@time@offset and
- % \pgf@intersect@time@offset@b are *always* valid. In fact,they
- % resemble a part of the time: it holds
- % 0 <= \pgf@intersect@time@a < 1
- % and \pgf@intersect@time@offset > 0.
- %
- % If we have an intersection in segment 42 of path A,
- % \pgf@intersect@time@offset will be 42. The time inside of that
- % segment is given as number in the interval [0,1]. If it is 0.3,
- % the total time will be 42.3 and that number will be stored as
- % \pgf@intersect@time@a.
- %
- \expandafter\xdef\csname #1@props\endcsname{{\pgf@intersect@time@offset}{\pgf@intersect@time@offset@b}{\pgf@intersect@time@a}{\pgf@intersect@time@b}}%
-}
+ % we store the time offsets as well and make them available programmatically:
+ % note that \pgf@intersect@time@a and \pgf@intersect@time@b may be empty.
+ %
+ % However, \pgf@intersect@time@offset and
+ % \pgf@intersect@time@offset@b are *always* valid. In fact,they
+ % resemble a part of the time: it holds
+ % 0 <= \pgf@intersect@time@a < 1
+ % and \pgf@intersect@time@offset > 0.
+ %
+ % If we have an intersection in segment 42 of path A,
+ % \pgf@intersect@time@offset will be 42. The time inside of that
+ % segment is given as number in the interval [0,1]. If it is 0.3,
+ % the total time will be 42.3 and that number will be stored as
+ % \pgf@intersect@time@a.
+ %
+ \expandafter\xdef\csname #1@props\endcsname{{\pgf@intersect@time@offset}{\pgf@intersect@time@offset@b}{\pgf@intersect@time@a}{\pgf@intersect@time@b}}%
+}%
\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}
+ \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\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\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\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%
-}
+ \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%
- \pgf@intersect@path@reset@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%
-}
+ \pgf@intersect@path@getpoints@a%
+ \let\pgf@intersect@token@after=\pgf@intersect@path@process@b%
+ \pgf@intersect@path@reset@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@reset@a{%
- \def\pgf@intersect@time@offset{0}%
- \def\pgf@intersect@time@a{}%
+ \def\pgf@intersect@time@offset{0}%
+ \def\pgf@intersect@time@a{}%
}%
\def\pgf@intersect@path@reset@b{%
- \def\pgf@intersect@time@offset@b{0}%
- \def\pgf@intersect@time@b{}%
+ \def\pgf@intersect@time@offset@b{0}%
+ \def\pgf@intersect@time@b{}%
}%
\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%
-}
+ \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%
- \c@pgf@counta=\pgf@intersect@time@offset@b\relax%
- \advance\c@pgf@counta by1\relax%
- \edef\pgf@intersect@time@offset@b{\the\c@pgf@counta}%
- \pgf@intersectionofpaths}
+ \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%
+ \c@pgf@counta=\pgf@intersect@time@offset@b\relax%
+ \advance\c@pgf@counta by1\relax%
+ \edef\pgf@intersect@time@offset@b{\the\c@pgf@counta}%
+ \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%
-}
+ \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}%
+ \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}}%
-}
+ \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}}%
-}
+ \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}}%
-}
+ \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}%
-}
+ \pgf@intersect@solutions=0\relax%
+ \pgf@intersectionoflines{#1}{#2}{#3}{#4}%
+}%
\def\pgf@intersectionoflines#1#2#3#4{%
- \pgf@iflinesintersect{#1}{#2}{#3}{#4}%
- {%
- \pgfextract@process\pgf@intersect@solution@candidate{%
- \pgfpointintersectionoflines{\pgfpoint@intersect@start@a}{\pgfpoint@intersect@end@a}%
- {\pgfpoint@intersect@start@b}{\pgfpoint@intersect@end@b}%
- }%
- \pgf@ifsolution@duplicate{\pgf@intersect@solution@candidate}{%
- % ah - we a duplicate. Apparently, we have a hit on an
- % endpoint.
- }{%
- \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%
- \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%
- \edef\pgf@intersect@time@a{\pgfmath@tonumber{\pgf@x}}%
- \expandafter\global\expandafter\let\csname pgf@g@intersect@solution@\the\pgf@intersect@solutions @time@a\endcsname=
- \pgf@intersect@time@a
- \else
- \let\pgf@intersect@time@a=\pgfutil@empty
- \fi%
- \let\pgf@intersect@time@b=\pgfutil@empty
- \pgf@intersection@store@properties{pgfpoint@g@intersect@solution@\the\pgf@intersect@solutions}%
- }%
- %
- }{}%
-}
+ \pgf@iflinesintersect{#1}{#2}{#3}{#4}%
+ {%
+ \pgfextract@process\pgf@intersect@solution@candidate{%
+ \pgfpointintersectionoflines{\pgfpoint@intersect@start@a}{\pgfpoint@intersect@end@a}%
+ {\pgfpoint@intersect@start@b}{\pgfpoint@intersect@end@b}%
+ }%
+ \pgf@ifsolution@duplicate{\pgf@intersect@solution@candidate}{%
+ % ah - we a duplicate. Apparently, we have a hit on an
+ % endpoint.
+ }{%
+ \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%
+ \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%
+ \edef\pgf@intersect@time@a{\pgfmath@tonumber{\pgf@x}}%
+ \expandafter\global\expandafter\let\csname pgf@g@intersect@solution@\the\pgf@intersect@solutions @time@a\endcsname=
+ \pgf@intersect@time@a
+ \else
+ \let\pgf@intersect@time@a=\pgfutil@empty
+ \fi%
+ \let\pgf@intersect@time@b=\pgfutil@empty
+ \pgf@intersection@store@properties{pgfpoint@g@intersect@solution@\the\pgf@intersect@solutions}%
+ }%
+ %
+ }{}%
+}%
% Test if two lines L1 and L2 intersect.
%
@@ -410,395 +410,395 @@
%
% 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%
-}
+ \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%
-}
+ #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}%
-}
+ \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}}%
+ \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}}%
+ \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}
+\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
+% 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}%
-}
+ \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
+% #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.
+% \pgfpointintersectionsolution{<S>} - the point for solution 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
+% 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);
+% 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}}%
+ \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%
-}
+ \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}%
- % (\pgf@xa, \pgf@ya) is lower-left
- % (\pgf@xb, \pgf@yb) is upper-right
- \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%
- % check if the two bounding boxes overlap:
- \ifdim\pgf@xa<\pgf@xb%
- \else%
- \ifdim\pgf@x>\pgf@xc%
- \else%
- \ifdim\pgf@ya<\pgf@yb%
- \else%
- \ifdim\pgf@y>\pgf@yc%
- \else%
- % compute DIFFERENCE vectors:
- \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%
- % check if both difference vectors are point wise
- % less than tolerance (i.e. |v|_infty < eps ).
- % That means that both bounding boxes are "small enough"
- \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{%
- % set (x,y) = mean(the 4 points of the two bounding boxes):
- \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%
- \begingroup
- \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%
- \edef\pgf@intersect@time@a{\pgfmath@tonumber{\pgf@time@a}}%
- %
- \advance\pgf@time@b by\pgf@time@bb%
- \divide\pgf@time@b by2\relax%
- \advance\pgf@time@b by\pgf@intersect@time@offset@b pt\relax%
- \edef\pgf@intersect@time@b{\pgfmath@tonumber{\pgf@time@b}}%
- %
- \pgf@intersection@store@properties{pgfpoint@g@intersect@solution@\the\pgf@intersect@solutions}%
- \expandafter\global\expandafter\let%
- \csname pgfpoint@g@intersect@solution@\the\pgf@intersect@solutions\endcsname=%
- \pgf@intersect@solution@candidate%
- \ifpgf@intersect@sort%
- \expandafter\xdef%
- \csname pgf@g@intersect@solution@\the\pgf@intersect@solutions @time@a\endcsname%
- {\pgf@intersect@time@a}%
- \fi%
- \endgroup
- }%
- \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%
-}
+ \pgf@intersect@boundingbox@reset%
+ \pgf@intersect@boundingbox@update{#1}%
+ \pgf@intersect@boundingbox@update{#2}%
+ \pgf@intersect@boundingbox@update{#3}%
+ \pgf@intersect@boundingbox@update{#4}%
+ % (\pgf@xa, \pgf@ya) is lower-left
+ % (\pgf@xb, \pgf@yb) is upper-right
+ \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%
+ % check if the two bounding boxes overlap:
+ \ifdim\pgf@xa<\pgf@xb%
+ \else%
+ \ifdim\pgf@x>\pgf@xc%
+ \else%
+ \ifdim\pgf@ya<\pgf@yb%
+ \else%
+ \ifdim\pgf@y>\pgf@yc%
+ \else%
+ % compute DIFFERENCE vectors:
+ \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%
+ % check if both difference vectors are point wise
+ % less than tolerance (i.e. |v|_infty < eps ).
+ % That means that both bounding boxes are "small enough"
+ \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{%
+ % set (x,y) = mean(the 4 points of the two bounding boxes):
+ \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%
+ \begingroup
+ \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%
+ \edef\pgf@intersect@time@a{\pgfmath@tonumber{\pgf@time@a}}%
+ %
+ \advance\pgf@time@b by\pgf@time@bb%
+ \divide\pgf@time@b by2\relax%
+ \advance\pgf@time@b by\pgf@intersect@time@offset@b pt\relax%
+ \edef\pgf@intersect@time@b{\pgfmath@tonumber{\pgf@time@b}}%
+ %
+ \pgf@intersection@store@properties{pgfpoint@g@intersect@solution@\the\pgf@intersect@solutions}%
+ \expandafter\global\expandafter\let%
+ \csname pgfpoint@g@intersect@solution@\the\pgf@intersect@solutions\endcsname=%
+ \pgf@intersect@solution@candidate%
+ \ifpgf@intersect@sort%
+ \expandafter\xdef%
+ \csname pgf@g@intersect@solution@\the\pgf@intersect@solutions @time@a\endcsname%
+ {\pgf@intersect@time@a}%
+ \fi%
+ \endgroup
+ }%
+ \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%
-}
+ \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%
-}
+ \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%
-}
+ \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%
-}
+ #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%
+}%
% The following subroutines are part of a conversion from pgfbasic
% math to FPU. This transition is necessary due to the restricted
@@ -810,114 +810,114 @@
% The following routines constitute the "adapter":
\def\pgf@float@adapter@setxy{%
- \pgfmathfloatparsenumber{\pgf@sys@tonumber\pgf@x}\let\pgf@fpu@x=\pgfmathresult
- \pgfmathfloatparsenumber{\pgf@sys@tonumber\pgf@y}\let\pgf@fpu@y=\pgfmathresult
+ \pgfmathfloatparsenumber{\pgf@sys@tonumber\pgf@x}\let\pgf@fpu@x=\pgfmathresult
+ \pgfmathfloatparsenumber{\pgf@sys@tonumber\pgf@y}\let\pgf@fpu@y=\pgfmathresult
}%
\def\pgf@float@adapter@mult#1=#2*#3{%
- \pgfmathfloatmultiplyfixed@{#3}{#2}%
- \let#1=\pgfmathresult
+ \pgfmathfloatmultiplyfixed@{#3}{#2}%
+ \let#1=\pgfmathresult
}%
\def\pgf@float@adapter@advance#1by#2*#3{%
- \pgfmathfloatmultiplyfixed@{#3}{#2}%
- \let\pgfutil@temp=\pgfmathresult
- \pgfmathfloatadd@{#1}{\pgfutil@temp}%
- \let#1=\pgfmathresult
+ \pgfmathfloatmultiplyfixed@{#3}{#2}%
+ \let\pgfutil@temp=\pgfmathresult
+ \pgfmathfloatadd@{#1}{\pgfutil@temp}%
+ \let#1=\pgfmathresult
}%
\def\pgf@float@adapter@tostring#1{%
- \pgfmathfloattofixed{#1}\edef#1{\pgfmathresult pt }%
+ \pgfmathfloattofixed{#1}\edef#1{\pgfmathresult pt }%
}%
\def\pgf@curve@subdivide@left#1#2#3#4{%
- %
- % The left curve (from t=0 to t=.5)
- %
- \begingroup
- #1\relax%
- \pgfutil@tempdima=\pgf@x%
- \pgfutil@tempdimb=\pgf@y%
- \pgf@float@adapter@setxy
- \pgf@float@adapter@mult\pgf@fpu@xa=.5*\pgf@fpu@x \pgf@float@adapter@mult\pgf@fpu@ya=.5*\pgf@fpu@y%
- \pgf@float@adapter@mult\pgf@fpu@xb=.25*\pgf@fpu@x \pgf@float@adapter@mult\pgf@fpu@yb=.25*\pgf@fpu@y%
- \pgf@float@adapter@mult\pgf@fpu@xc=.125*\pgf@fpu@x\pgf@float@adapter@mult\pgf@fpu@yc=.125*\pgf@fpu@y%
- #2\relax%
- \pgf@float@adapter@setxy
- \pgf@float@adapter@advance\pgf@fpu@xa by.5*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@ya by.5*\pgf@fpu@y%
- \pgf@float@adapter@advance\pgf@fpu@xb by.5*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@yb by.5*\pgf@fpu@y%
- \pgf@float@adapter@advance\pgf@fpu@xc by.375*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@yc by.375*\pgf@fpu@y%
- #3\relax%
- \pgf@float@adapter@setxy
- \pgf@float@adapter@advance\pgf@fpu@xb by.25*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@yb by.25*\pgf@fpu@y%
- \pgf@float@adapter@advance\pgf@fpu@xc by.375*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@yc by.375*\pgf@fpu@y%
- #4\relax%
- \pgf@float@adapter@setxy
- \pgf@float@adapter@advance\pgf@fpu@xc by.125*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@yc by.125*\pgf@fpu@y%
- %
- \pgf@float@adapter@tostring\pgf@fpu@xa
- \pgf@float@adapter@tostring\pgf@fpu@ya
- \pgf@float@adapter@tostring\pgf@fpu@xb
- \pgf@float@adapter@tostring\pgf@fpu@yb
- \pgf@float@adapter@tostring\pgf@fpu@xc
- \pgf@float@adapter@tostring\pgf@fpu@yc
- \edef\pgf@marshal{%
- \noexpand\pgf@curve@subdivde@after%
- {\noexpand\pgf@x=\the\pgfutil@tempdima\noexpand\pgf@y=\the\pgfutil@tempdimb}%
- {\noexpand\pgf@x=\pgf@fpu@xa\noexpand\pgf@y=\pgf@fpu@ya}%
- {\noexpand\pgf@x=\pgf@fpu@xb\noexpand\pgf@y=\pgf@fpu@yb}
- {\noexpand\pgf@x=\pgf@fpu@xc\noexpand\pgf@y=\pgf@fpu@yc}%
- }%
- \expandafter
- \endgroup
- \pgf@marshal%
-}
+ %
+ % The left curve (from t=0 to t=.5)
+ %
+ \begingroup
+ #1\relax%
+ \pgfutil@tempdima=\pgf@x%
+ \pgfutil@tempdimb=\pgf@y%
+ \pgf@float@adapter@setxy
+ \pgf@float@adapter@mult\pgf@fpu@xa=.5*\pgf@fpu@x \pgf@float@adapter@mult\pgf@fpu@ya=.5*\pgf@fpu@y%
+ \pgf@float@adapter@mult\pgf@fpu@xb=.25*\pgf@fpu@x \pgf@float@adapter@mult\pgf@fpu@yb=.25*\pgf@fpu@y%
+ \pgf@float@adapter@mult\pgf@fpu@xc=.125*\pgf@fpu@x\pgf@float@adapter@mult\pgf@fpu@yc=.125*\pgf@fpu@y%
+ #2\relax%
+ \pgf@float@adapter@setxy
+ \pgf@float@adapter@advance\pgf@fpu@xa by.5*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@ya by.5*\pgf@fpu@y%
+ \pgf@float@adapter@advance\pgf@fpu@xb by.5*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@yb by.5*\pgf@fpu@y%
+ \pgf@float@adapter@advance\pgf@fpu@xc by.375*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@yc by.375*\pgf@fpu@y%
+ #3\relax%
+ \pgf@float@adapter@setxy
+ \pgf@float@adapter@advance\pgf@fpu@xb by.25*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@yb by.25*\pgf@fpu@y%
+ \pgf@float@adapter@advance\pgf@fpu@xc by.375*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@yc by.375*\pgf@fpu@y%
+ #4\relax%
+ \pgf@float@adapter@setxy
+ \pgf@float@adapter@advance\pgf@fpu@xc by.125*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@yc by.125*\pgf@fpu@y%
+ %
+ \pgf@float@adapter@tostring\pgf@fpu@xa
+ \pgf@float@adapter@tostring\pgf@fpu@ya
+ \pgf@float@adapter@tostring\pgf@fpu@xb
+ \pgf@float@adapter@tostring\pgf@fpu@yb
+ \pgf@float@adapter@tostring\pgf@fpu@xc
+ \pgf@float@adapter@tostring\pgf@fpu@yc
+ \edef\pgf@marshal{%
+ \noexpand\pgf@curve@subdivde@after%
+ {\noexpand\pgf@x=\the\pgfutil@tempdima\noexpand\pgf@y=\the\pgfutil@tempdimb}%
+ {\noexpand\pgf@x=\pgf@fpu@xa\noexpand\pgf@y=\pgf@fpu@ya}%
+ {\noexpand\pgf@x=\pgf@fpu@xb\noexpand\pgf@y=\pgf@fpu@yb}
+ {\noexpand\pgf@x=\pgf@fpu@xc\noexpand\pgf@y=\pgf@fpu@yc}%
+ }%
+ \expandafter
+ \endgroup
+ \pgf@marshal%
+}%
\def\pgf@curve@subdivide@right#1#2#3#4{%
- %
- % The right curve (from t=0.5 to t=1)
- %
- \begingroup
- #1\relax%
- \pgf@float@adapter@setxy
- \pgf@float@adapter@mult\pgf@float@tmpa=.125*\pgf@fpu@x\pgf@float@adapter@mult\pgf@float@tmpb=.125*\pgf@fpu@y%
- #2\relax%
- \pgf@float@adapter@setxy
- \pgf@float@adapter@advance\pgf@float@tmpa by.375*\pgf@fpu@x\pgf@float@adapter@advance\pgf@float@tmpb by.375*\pgf@fpu@y%
- \pgf@float@adapter@mult\pgf@fpu@xa=.25*\pgf@fpu@x\pgf@float@adapter@mult\pgf@fpu@ya=.25*\pgf@fpu@y%
- #3\relax%
- \pgf@float@adapter@setxy
- \pgf@float@adapter@advance\pgf@float@tmpa by.375*\pgf@fpu@x\pgf@float@adapter@advance\pgf@float@tmpb by.375*\pgf@fpu@y%
- \pgf@float@adapter@advance\pgf@fpu@xa by.5*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@ya by.5*\pgf@fpu@y%
- \pgf@float@adapter@mult\pgf@fpu@xb=.5*\pgf@fpu@x\pgf@float@adapter@mult\pgf@fpu@yb=.5*\pgf@fpu@y%
- #4\relax%
- \pgf@float@adapter@setxy
- \pgf@float@adapter@advance\pgf@float@tmpa by.125*\pgf@fpu@x\pgf@float@adapter@advance\pgf@float@tmpb by.125*\pgf@fpu@y%
- \pgf@float@adapter@advance\pgf@fpu@xa by.25*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@ya by.25*\pgf@fpu@y%
- \pgf@float@adapter@advance\pgf@fpu@xb by.5*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@yb by.5*\pgf@fpu@y%
- \let\pgf@fpu@xc=\pgf@fpu@x\let\pgf@fpu@yc=\pgf@fpu@y%
- %
- \pgf@float@adapter@tostring\pgf@float@tmpa
- \pgf@float@adapter@tostring\pgf@float@tmpb
- \pgf@float@adapter@tostring\pgf@fpu@xa
- \pgf@float@adapter@tostring\pgf@fpu@ya
- \pgf@float@adapter@tostring\pgf@fpu@xb
- \pgf@float@adapter@tostring\pgf@fpu@yb
- \pgf@float@adapter@tostring\pgf@fpu@xc
- \pgf@float@adapter@tostring\pgf@fpu@yc
- \edef\pgf@marshal{%
- \noexpand\pgf@curve@subdivde@after%
- {\noexpand\pgf@x=\pgf@float@tmpa\noexpand\pgf@y=\pgf@float@tmpb}%
- {\noexpand\pgf@x=\pgf@fpu@xa\noexpand\pgf@y=\pgf@fpu@ya}
- {\noexpand\pgf@x=\pgf@fpu@xb\noexpand\pgf@y=\pgf@fpu@yb}
- {\noexpand\pgf@x=\pgf@fpu@xc\noexpand\pgf@y=\pgf@fpu@yc}%
- }%
- \expandafter
- \endgroup
- \pgf@marshal%
-}
+ %
+ % The right curve (from t=0.5 to t=1)
+ %
+ \begingroup
+ #1\relax%
+ \pgf@float@adapter@setxy
+ \pgf@float@adapter@mult\pgf@float@tmpa=.125*\pgf@fpu@x\pgf@float@adapter@mult\pgf@float@tmpb=.125*\pgf@fpu@y%
+ #2\relax%
+ \pgf@float@adapter@setxy
+ \pgf@float@adapter@advance\pgf@float@tmpa by.375*\pgf@fpu@x\pgf@float@adapter@advance\pgf@float@tmpb by.375*\pgf@fpu@y%
+ \pgf@float@adapter@mult\pgf@fpu@xa=.25*\pgf@fpu@x\pgf@float@adapter@mult\pgf@fpu@ya=.25*\pgf@fpu@y%
+ #3\relax%
+ \pgf@float@adapter@setxy
+ \pgf@float@adapter@advance\pgf@float@tmpa by.375*\pgf@fpu@x\pgf@float@adapter@advance\pgf@float@tmpb by.375*\pgf@fpu@y%
+ \pgf@float@adapter@advance\pgf@fpu@xa by.5*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@ya by.5*\pgf@fpu@y%
+ \pgf@float@adapter@mult\pgf@fpu@xb=.5*\pgf@fpu@x\pgf@float@adapter@mult\pgf@fpu@yb=.5*\pgf@fpu@y%
+ #4\relax%
+ \pgf@float@adapter@setxy
+ \pgf@float@adapter@advance\pgf@float@tmpa by.125*\pgf@fpu@x\pgf@float@adapter@advance\pgf@float@tmpb by.125*\pgf@fpu@y%
+ \pgf@float@adapter@advance\pgf@fpu@xa by.25*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@ya by.25*\pgf@fpu@y%
+ \pgf@float@adapter@advance\pgf@fpu@xb by.5*\pgf@fpu@x\pgf@float@adapter@advance\pgf@fpu@yb by.5*\pgf@fpu@y%
+ \let\pgf@fpu@xc=\pgf@fpu@x\let\pgf@fpu@yc=\pgf@fpu@y%
+ %
+ \pgf@float@adapter@tostring\pgf@float@tmpa
+ \pgf@float@adapter@tostring\pgf@float@tmpb
+ \pgf@float@adapter@tostring\pgf@fpu@xa
+ \pgf@float@adapter@tostring\pgf@fpu@ya
+ \pgf@float@adapter@tostring\pgf@fpu@xb
+ \pgf@float@adapter@tostring\pgf@fpu@yb
+ \pgf@float@adapter@tostring\pgf@fpu@xc
+ \pgf@float@adapter@tostring\pgf@fpu@yc
+ \edef\pgf@marshal{%
+ \noexpand\pgf@curve@subdivde@after%
+ {\noexpand\pgf@x=\pgf@float@tmpa\noexpand\pgf@y=\pgf@float@tmpb}%
+ {\noexpand\pgf@x=\pgf@fpu@xa\noexpand\pgf@y=\pgf@fpu@ya}
+ {\noexpand\pgf@x=\pgf@fpu@xb\noexpand\pgf@y=\pgf@fpu@yb}
+ {\noexpand\pgf@x=\pgf@fpu@xc\noexpand\pgf@y=\pgf@fpu@yc}%
+ }%
+ \expandafter
+ \endgroup
+ \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).
@@ -925,32 +925,32 @@
% #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@ifsolution@duplicate@{\pgfmathcounter}%
- \repeatpgfmathloop%
- \pgf@intersect@next%
-}
+ #1%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \let\pgf@intersect@next=\pgfutil@secondoftwo%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@intersect@solutions\relax%
+ \else%
+ \pgf@ifsolution@duplicate@{\pgfmathcounter}%
+ \repeatpgfmathloop%
+ \pgf@intersect@next%
+}%
\def\pgf@ifsolution@duplicate@#1{%
- \pgf@process{\csname pgfpoint@g@intersect@solution@#1\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%
+ \pgf@process{\csname pgfpoint@g@intersect@solution@#1\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%
}%
\newif\ifpgf@intersect@solutions@sortfinish
@@ -958,35 +958,35 @@
% Sort solutions according to their time index.
%
\def\pgfintersectionsolutionsortbytime{%
- \pgf@intersect@solutions@sortfinishtrue%
- \pgfmathloop%
- \ifnum\pgfmathcounter<\pgfintersectionsolutions\relax%
- \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%
- %
- \pgfintersectionsolutionsortbytime@swap{pgfpoint@intersect@solution@\pgfmathcounter}%
- {pgfpoint@intersect@solution@\the\pgfutil@tempcnta}%
- %
- \pgfintersectionsolutionsortbytime@swap{pgf@intersect@solution@\pgfmathcounter @time@a}%
- {pgf@intersect@solution@\the\pgfutil@tempcnta @time@a}%
- %
- \pgfintersectionsolutionsortbytime@swap{pgf@intersect@solution@props@\pgfmathcounter}%
- {pgf@intersect@solution@props@\the\pgfutil@tempcnta}%
- \fi%
- \repeatpgfmathloop%
- \ifpgf@intersect@solutions@sortfinish%
- \else%
- \expandafter\pgfintersectionsolutionsortbytime%
- \fi%
-}
+ \pgf@intersect@solutions@sortfinishtrue%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter<\pgfintersectionsolutions\relax%
+ \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%
+ %
+ \pgfintersectionsolutionsortbytime@swap{pgfpoint@intersect@solution@\pgfmathcounter}%
+ {pgfpoint@intersect@solution@\the\pgfutil@tempcnta}%
+ %
+ \pgfintersectionsolutionsortbytime@swap{pgf@intersect@solution@\pgfmathcounter @time@a}%
+ {pgf@intersect@solution@\the\pgfutil@tempcnta @time@a}%
+ %
+ \pgfintersectionsolutionsortbytime@swap{pgf@intersect@solution@props@\pgfmathcounter}%
+ {pgf@intersect@solution@props@\the\pgfutil@tempcnta}%
+ \fi%
+ \repeatpgfmathloop%
+ \ifpgf@intersect@solutions@sortfinish%
+ \else%
+ \expandafter\pgfintersectionsolutionsortbytime%
+ \fi%
+}%
\def\pgfintersectionsolutionsortbytime@swap#1#2{%
- \pgfutil@namelet{pgf@intersect@temp}{#1}%
- \pgfutil@namelet{#1}{#2}%
- \pgfutil@namelet{#2}{pgf@intersect@temp}%
+ \pgfutil@namelet{pgf@intersect@temp}{#1}%
+ \pgfutil@namelet{#1}{#2}%
+ \pgfutil@namelet{#2}{pgf@intersect@temp}%
}%
\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
index ab6a067835e..bec0c855cda 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarylindenmayersystems.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarylindenmayersystems.code.tex
@@ -14,210 +14,216 @@
\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%
- }%
-}
+ 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%
-}
+ 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%
- }%
- {\pgferror{Lindenmayer system `#1' is already defined}}%
-}
+ \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%
+ }%
+ {\pgferror{Lindenmayer system `#1' is already defined}}%
+}%
\def\pgf@lsystem@symbol#1#2{%
- \expandafter\gdef\csname pgf@lsystem@\pgf@lsystem@name @symbol@#1\endcsname{#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{\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@@@}}
+ \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%
-}
+ \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%
-}
+ \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}
+ \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}
+ \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}
+ \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%
-}
+ \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}}
+ \pgflsystemradonmizestep
+ \pgftransformxshift{+\pgflsystemcurrentstep}%
+ \pgfpathlineto{\pgfpointorigin}}%
\def\pgflsystemmoveforward{%
- \pgflsystemradonmizestep
- \pgftransformxshift{+\pgflsystemcurrentstep}%
- \pgfpathmoveto{\pgfpointorigin}}
+ \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%
-}
+ \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%
-}
+ \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}}
+ \pgflsystemranomizerightangle
+ \pgftransformrotate{-\pgflsystemcurrentrightangle}}%
\def\pgflsystemturnleft{%
- \pgflsystemranomizeleftangle
- \pgftransformrotate{\pgflsystemcurrentleftangle}}
+ \pgflsystemranomizeleftangle
+ \pgftransformrotate{\pgflsystemcurrentleftangle}}%
-\def\pgflsystemsavestate{\begingroup}
-\def\pgflsystemrestorestate{\endgroup\pgfpathmoveto{\pgfpointorigin}}
+\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 acfc3fa7b2e..908d7490030 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex
@@ -7,80 +7,80 @@
%
% 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.13 2008/03/03 13:52:35 tantau Exp $
+\ProvidesFileRCS{pgflibrarypatterns.code.tex}
% Lines in different directions
\pgfdeclarepatternformonly{horizontal lines}{\pgfpointorigin}{\pgfqpoint{100pt}{1pt}}{\pgfqpoint{100pt}{3pt}}%
-{
- \pgfsetlinewidth{0.4pt}
- \pgfpathmoveto{\pgfqpoint{0pt}{0.5pt}}
- \pgfpathlineto{\pgfqpoint{100pt}{0.5pt}}
- \pgfusepath{stroke}
-}
+{%
+ \pgfsetlinewidth{0.4pt}%
+ \pgfpathmoveto{\pgfqpoint{0pt}{0.5pt}}%
+ \pgfpathlineto{\pgfqpoint{100pt}{0.5pt}}%
+ \pgfusepath{stroke}%
+}%
\pgfdeclarepatternformonly{vertical lines}{\pgfpointorigin}{\pgfqpoint{1pt}{100pt}}{\pgfqpoint{3pt}{100pt}}%
-{
- \pgfsetlinewidth{0.4pt}
- \pgfpathmoveto{\pgfqpoint{0.5pt}{0pt}}
- \pgfpathlineto{\pgfqpoint{0.5pt}{100pt}}
- \pgfusepath{stroke}
-}
+{%
+ \pgfsetlinewidth{0.4pt}%
+ \pgfpathmoveto{\pgfqpoint{0.5pt}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0.5pt}{100pt}}%
+ \pgfusepath{stroke}%
+}%
\pgfdeclarepatternformonly{north east lines}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{4pt}{4pt}}{\pgfqpoint{3pt}{3pt}}%
-{
- \pgfsetlinewidth{0.4pt}
- \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}
- \pgfpathlineto{\pgfqpoint{3.1pt}{3.1pt}}
- \pgfusepath{stroke}
-}
+{%
+ \pgfsetlinewidth{0.4pt}%
+ \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{3.1pt}{3.1pt}}%
+ \pgfusepath{stroke}%
+}%
\pgfdeclarepatternformonly{north west lines}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{4pt}{4pt}}{\pgfqpoint{3pt}{3pt}}%
-{
- \pgfsetlinewidth{0.4pt}
- \pgfpathmoveto{\pgfqpoint{0pt}{3pt}}
- \pgfpathlineto{\pgfqpoint{3.1pt}{-0.1pt}}
- \pgfusepath{stroke}
-}
+{%
+ \pgfsetlinewidth{0.4pt}%
+ \pgfpathmoveto{\pgfqpoint{0pt}{3pt}}%
+ \pgfpathlineto{\pgfqpoint{3.1pt}{-0.1pt}}%
+ \pgfusepath{stroke}%
+}%
% Crossed lines in different directions
\pgfdeclarepatternformonly{grid}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{4pt}{4pt}}{\pgfqpoint{3pt}{3pt}}%
-{
- \pgfsetlinewidth{0.4pt}
- \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}
- \pgfpathlineto{\pgfqpoint{0pt}{3.1pt}}
- \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}
- \pgfpathlineto{\pgfqpoint{3.1pt}{0pt}}
- \pgfusepath{stroke}
-}
+{%
+ \pgfsetlinewidth{0.4pt}%
+ \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{3.1pt}}%
+ \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{3.1pt}{0pt}}%
+ \pgfusepath{stroke}%
+}%
\pgfdeclarepatternformonly{crosshatch}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{4pt}{4pt}}{\pgfqpoint{3pt}{3pt}}%
-{
- \pgfsetlinewidth{0.4pt}
- \pgfpathmoveto{\pgfqpoint{3.1pt}{0pt}}
- \pgfpathlineto{\pgfqpoint{0pt}{3.1pt}}
- \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}
- \pgfpathlineto{\pgfqpoint{3.1pt}{3.1pt}}
- \pgfusepath{stroke}
-}
+{%
+ \pgfsetlinewidth{0.4pt}%
+ \pgfpathmoveto{\pgfqpoint{3.1pt}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{3.1pt}}%
+ \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{3.1pt}{3.1pt}}%
+ \pgfusepath{stroke}%
+}%
% Dotted regions
\pgfdeclarepatternformonly{dots}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{1pt}{1pt}}{\pgfqpoint{3pt}{3pt}}%
-{
- \pgfpathcircle{\pgfqpoint{0pt}{0pt}}{.5pt}
- \pgfusepath{fill}
-}
+{%
+ \pgfpathcircle{\pgfqpoint{0pt}{0pt}}{.5pt}%
+ \pgfusepath{fill}%
+}%
\pgfdeclarepatternformonly{crosshatch dots}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{2.5pt}{2.5pt}}{\pgfqpoint{3pt}{3pt}}%
-{
- \pgfpathcircle{\pgfqpoint{0pt}{0pt}}{.5pt}
- \pgfpathcircle{\pgfqpoint{1.5pt}{1.5pt}}{.5pt}
- \pgfusepath{fill}
-}
+{%
+ \pgfpathcircle{\pgfqpoint{0pt}{0pt}}{.5pt}%
+ \pgfpathcircle{\pgfqpoint{1.5pt}{1.5pt}}{.5pt}%
+ \pgfusepath{fill}%
+}%
@@ -88,61 +88,61 @@
% Star shaped patterns
\pgfdeclarepatternformonly{fivepointed stars}{\pgfpointorigin}{\pgfqpoint{3mm}{3mm}}{\pgfqpoint{3mm}{3mm}}%
-{
- \pgftransformshift{\pgfqpoint{1mm}{1mm}}
- \pgfpathmoveto{\pgfqpointpolar{18}{1mm}}
- \pgfpathlineto{\pgfqpointpolar{162}{1mm}}
- \pgfpathlineto{\pgfqpointpolar{306}{1mm}}
- \pgfpathlineto{\pgfqpointpolar{90}{1mm}}
- \pgfpathlineto{\pgfqpointpolar{234}{1mm}}
- \pgfpathclose%
- \pgfusepath{fill}
-}
+{%
+ \pgftransformshift{\pgfqpoint{1mm}{1mm}}%
+ \pgfpathmoveto{\pgfqpointpolar{18}{1mm}}%
+ \pgfpathlineto{\pgfqpointpolar{162}{1mm}}%
+ \pgfpathlineto{\pgfqpointpolar{306}{1mm}}%
+ \pgfpathlineto{\pgfqpointpolar{90}{1mm}}%
+ \pgfpathlineto{\pgfqpointpolar{234}{1mm}}%
+ \pgfpathclose%%
+ \pgfusepath{fill}%
+}%
\pgfdeclarepatternformonly{sixpointed stars}{\pgfpointorigin}{\pgfqpoint{3mm}{3mm}}{\pgfqpoint{3mm}{3mm}}%
-{
- \pgftransformshift{\pgfqpoint{1mm}{1mm}}
- \pgfpathmoveto{\pgfqpointpolar{30}{1mm}}
- \pgfpathlineto{\pgfqpointpolar{150}{1mm}}
- \pgfpathlineto{\pgfqpointpolar{270}{1mm}}
+{%
+ \pgftransformshift{\pgfqpoint{1mm}{1mm}}%
+ \pgfpathmoveto{\pgfqpointpolar{30}{1mm}}%
+ \pgfpathlineto{\pgfqpointpolar{150}{1mm}}%
+ \pgfpathlineto{\pgfqpointpolar{270}{1mm}}%
\pgfpathclose%
- \pgfpathmoveto{\pgfqpointpolar{-30}{1mm}}
- \pgfpathlineto{\pgfqpointpolar{-270}{1mm}}
- \pgfpathlineto{\pgfqpointpolar{-150}{1mm}}
+ \pgfpathmoveto{\pgfqpointpolar{-30}{1mm}}%
+ \pgfpathlineto{\pgfqpointpolar{-270}{1mm}}%
+ \pgfpathlineto{\pgfqpointpolar{-150}{1mm}}%
\pgfpathclose%
- \pgfsetnonzerorule
- \pgfusepath{fill}
-}
+ \pgfsetnonzerorule%
+ \pgfusepath{fill}%
+}%
% Bricks
\pgfdeclarepatternformonly{bricks}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{5mm}{5mm}}{\pgfqpoint{4mm}{4mm}}%
-{
- \pgfsetlinewidth{0.8pt}
- \pgfpathmoveto{\pgfqpoint{0mm}{1mm}}
- \pgfpathlineto{\pgfqpoint{4mm}{1mm}}
- \pgfpathmoveto{\pgfqpoint{0mm}{3mm}}
- \pgfpathlineto{\pgfqpoint{4mm}{3mm}}
- \pgfpathmoveto{\pgfqpoint{1mm}{0mm}}
- \pgfpathlineto{\pgfqpoint{1mm}{1mm}}
- \pgfpathmoveto{\pgfqpoint{3mm}{1mm}}
- \pgfpathlineto{\pgfqpoint{3mm}{3mm}}
- \pgfpathmoveto{\pgfqpoint{1mm}{3mm}}
- \pgfpathlineto{\pgfqpoint{1mm}{4mm}}
- \pgfusepath{stroke}
-}
+{%
+ \pgfsetlinewidth{0.8pt}%
+ \pgfpathmoveto{\pgfqpoint{0mm}{1mm}}%
+ \pgfpathlineto{\pgfqpoint{4mm}{1mm}}%
+ \pgfpathmoveto{\pgfqpoint{0mm}{3mm}}%
+ \pgfpathlineto{\pgfqpoint{4mm}{3mm}}%
+ \pgfpathmoveto{\pgfqpoint{1mm}{0mm}}%
+ \pgfpathlineto{\pgfqpoint{1mm}{1mm}}%
+ \pgfpathmoveto{\pgfqpoint{3mm}{1mm}}%
+ \pgfpathlineto{\pgfqpoint{3mm}{3mm}}%
+ \pgfpathmoveto{\pgfqpoint{1mm}{3mm}}%
+ \pgfpathlineto{\pgfqpoint{1mm}{4mm}}%
+ \pgfusepath{stroke}%
+}%
% Checkerboards
\pgfdeclarepatternformonly{checkerboard}{\pgfpointorigin}{\pgfqpoint{4mm}{4mm}}{\pgfqpoint{4mm}{4mm}}%
-{
- \pgfpathrectangle{\pgfpointorigin}{\pgfqpoint{2mm}{2mm}}
- \pgfpathrectangle{\pgfqpoint{2mm}{2mm}}{\pgfqpoint{2mm}{2mm}}
- \pgfusepath{fill}
-}
+{%
+ \pgfpathrectangle{\pgfpointorigin}{\pgfqpoint{2mm}{2mm}}%
+ \pgfpathrectangle{\pgfqpoint{2mm}{2mm}}{\pgfqpoint{2mm}{2mm}}%
+ \pgfusepath{fill}%
+}%
@@ -150,117 +150,115 @@
\pgfdeclarepatterninherentlycolored{checkerboard light gray}
{\pgfpointorigin}{\pgfqpoint{4mm}{4mm}}{\pgfqpoint{4mm}{4mm}}%
-{
- \pgfsetfillcolor{black!10}
+{%
+% \pgfsetfillcolor{black!10}
\pgfpathrectangle{\pgfpointorigin}{\pgfqpoint{4.1mm}{4.1mm}}% make
% slightly larger to ensure that tiles
% are really solid
- \pgfusepath{fill}
- \pgfsetfillcolor{black!20}
- \pgfpathrectangle{\pgfpointorigin}{\pgfqpoint{2mm}{2mm}}
- \pgfpathrectangle{\pgfqpoint{2mm}{2mm}}{\pgfqpoint{2mm}{2mm}}
- \pgfusepath{fill}
-}
+ \pgfusepath{fill}%
+ \pgfsetfillcolor{black!20}%
+ \pgfpathrectangle{\pgfpointorigin}{\pgfqpoint{2mm}{2mm}}%
+ \pgfpathrectangle{\pgfqpoint{2mm}{2mm}}{\pgfqpoint{2mm}{2mm}}%
+ \pgfusepath{fill}%
+}%
\pgfdeclarepatterninherentlycolored{horizontal lines light gray}
{\pgfpointorigin}{\pgfpoint{100pt}{4pt}}
{\pgfpoint{100pt}{4pt}}
-{
- \pgfsetfillcolor{black!10}
- \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{100pt}{2.5pt}}
- \pgfusepath{fill}
- \pgfsetfillcolor{black!15}
- \pgfpathrectangle{\pgfpoint{0pt}{2pt}}{\pgfpoint{100pt}{2.5pt}}
- \pgfusepath{fill}
-}
+{%
+ \pgfsetfillcolor{black!10}%
+ \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{100pt}{2.5pt}}%
+ \pgfusepath{fill}%
+ \pgfsetfillcolor{black!15}%
+ \pgfpathrectangle{\pgfpoint{0pt}{2pt}}{\pgfpoint{100pt}{2.5pt}}%
+ \pgfusepath{fill}%
+}%
\pgfdeclarepatterninherentlycolored{horizontal lines gray}
{\pgfpointorigin}{\pgfpoint{100pt}{4pt}}
{\pgfpoint{100pt}{4pt}}
-{
- \pgfsetfillcolor{black!30}
- \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{100pt}{2.5pt}}
- \pgfusepath{fill}
- \pgfsetfillcolor{black!35}
- \pgfpathrectangle{\pgfpoint{0pt}{2pt}}{\pgfpoint{100pt}{2.5pt}}
- \pgfusepath{fill}
-}
+{%
+ \pgfsetfillcolor{black!30}%
+ \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{100pt}{2.5pt}}%
+ \pgfusepath{fill}%
+ \pgfsetfillcolor{black!35}%
+ \pgfpathrectangle{\pgfpoint{0pt}{2pt}}{\pgfpoint{100pt}{2.5pt}}%
+ \pgfusepath{fill}%
+}%
\pgfdeclarepatterninherentlycolored{horizontal lines dark gray}
{\pgfpointorigin}{\pgfpoint{100pt}{4pt}}
{\pgfpoint{100pt}{4pt}}
-{
- \pgfsetfillcolor{black!90}
- \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{100pt}{2.5pt}}
- \pgfusepath{fill}
- \pgfsetfillcolor{black!85}
- \pgfpathrectangle{\pgfpoint{0pt}{2pt}}{\pgfpoint{100pt}{2.5pt}}
- \pgfusepath{fill}
-}
+{%
+ \pgfsetfillcolor{black!90}%
+ \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{100pt}{2.5pt}}%
+ \pgfusepath{fill}%
+ \pgfsetfillcolor{black!85}%
+ \pgfpathrectangle{\pgfpoint{0pt}{2pt}}{\pgfpoint{100pt}{2.5pt}}%
+ \pgfusepath{fill}%
+}%
\pgfdeclarepatterninherentlycolored{horizontal lines light blue}
{\pgfpointorigin}{\pgfpoint{100pt}{4pt}}
{\pgfpoint{100pt}{4pt}}
-{
- \pgfsetfillcolor{blue!10}
- \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{100pt}{2.5pt}}
- \pgfusepath{fill}
- \pgfsetfillcolor{blue!15}
- \pgfpathrectangle{\pgfpoint{0pt}{2pt}}{\pgfpoint{100pt}{2.5pt}}
- \pgfusepath{fill}
-}
+{%
+ \pgfsetfillcolor{blue!10}%
+ \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{100pt}{2.5pt}}%
+ \pgfusepath{fill}%
+ \pgfsetfillcolor{blue!15}%
+ \pgfpathrectangle{\pgfpoint{0pt}{2pt}}{\pgfpoint{100pt}{2.5pt}}%
+ \pgfusepath{fill}%
+}%
\pgfdeclarepatterninherentlycolored{horizontal lines dark blue}
{\pgfpointorigin}{\pgfpoint{100pt}{4pt}}
{\pgfpoint{100pt}{4pt}}
-{
- \pgfsetfillcolor{blue!90}
- \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{100pt}{2.5pt}}
- \pgfusepath{fill}
- \pgfsetfillcolor{blue!85}
- \pgfpathrectangle{\pgfpoint{0pt}{2pt}}{\pgfpoint{100pt}{2.5pt}}
- \pgfusepath{fill}
-}
+{%
+ \pgfsetfillcolor{blue!90}%
+ \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{100pt}{2.5pt}}%
+ \pgfusepath{fill}%
+ \pgfsetfillcolor{blue!85}%
+ \pgfpathrectangle{\pgfpoint{0pt}{2pt}}{\pgfpoint{100pt}{2.5pt}}%
+ \pgfusepath{fill}%
+}%
\pgfdeclarepatterninherentlycolored{crosshatch dots gray}
{\pgfpointorigin}{\pgfpoint{8pt}{8pt}}
{\pgfpoint{8pt}{8pt}}
-{
- \pgfsetfillcolor{black!20}
- \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{8pt}{8pt}}
- \pgfusepath{fill}
- \pgfsetfillcolor{black!10}
- \pgfpathcircle{\pgfpoint{2pt}{1.75pt}}{1pt}
- \pgfpathcircle{\pgfpoint{6pt}{5.75pt}}{1pt}
- \pgfusepath{fill}
- \pgfsetfillcolor{black!70}
- \pgfpathcircle{\pgfpoint{2pt}{2.25pt}}{1pt}
- \pgfpathcircle{\pgfpoint{6pt}{6.25pt}}{1pt}
- \pgfusepath{fill}
-}
-
-\pgfutil@definecolor{pgf@lightsteelblue}{rgb}{0.6875,0.765625,0.8671875}
-\pgfutil@colorlet{pgf@darklightsteelblue}{black!50!pgf@lightsteelblue}
+{%
+ \pgfsetfillcolor{black!20}%
+ \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{8pt}{8pt}}%
+ \pgfusepath{fill}%
+ \pgfsetfillcolor{black!10}%
+ \pgfpathcircle{\pgfpoint{2pt}{1.75pt}}{1pt}%
+ \pgfpathcircle{\pgfpoint{6pt}{5.75pt}}{1pt}%
+ \pgfusepath{fill}%
+ \pgfsetfillcolor{black!70}%
+ \pgfpathcircle{\pgfpoint{2pt}{2.25pt}}{1pt}%
+ \pgfpathcircle{\pgfpoint{6pt}{6.25pt}}{1pt}%
+ \pgfusepath{fill}%
+}%
+
+\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}}
{\pgfpoint{8pt}{8pt}}
-{
- \pgfsetfillcolor{pgf@lightsteelblue}
- \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{8pt}{8pt}}
- \pgfusepath{fill}
- \pgfsetfillcolor{pgf@darklightsteelblue!10}
- \pgfpathcircle{\pgfpoint{2pt}{1.75pt}}{1pt}
- \pgfpathcircle{\pgfpoint{6pt}{5.75pt}}{1pt}
- \pgfusepath{fill}
- \pgfsetfillcolor{pgf@darklightsteelblue!70}
- \pgfpathcircle{\pgfpoint{2pt}{2.25pt}}{1pt}
- \pgfpathcircle{\pgfpoint{6pt}{6.25pt}}{1pt}
- \pgfusepath{fill}
-}
-
-
+{%
+ \pgfsetfillcolor{pgf@lightsteelblue}%
+ \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{8pt}{8pt}}%
+ \pgfusepath{fill}%
+ \pgfsetfillcolor{pgf@darklightsteelblue!10}%
+ \pgfpathcircle{\pgfpoint{2pt}{1.75pt}}{1pt}%
+ \pgfpathcircle{\pgfpoint{6pt}{5.75pt}}{1pt}%
+ \pgfusepath{fill}%
+ \pgfsetfillcolor{pgf@darklightsteelblue!70}%
+ \pgfpathcircle{\pgfpoint{2pt}{2.25pt}}{1pt}%
+ \pgfpathcircle{\pgfpoint{6pt}{6.25pt}}{1pt}%
+ \pgfusepath{fill}%
+}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex
index 467fa1fee46..d3a381524ae 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex
@@ -7,8 +7,8 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\def\pgf@pat@type@uncolored{0}
-\def\pgf@pat@type@colored{1}
+\def\pgf@pat@type@uncolored{0}%
+\def\pgf@pat@type@colored{1}%
\newif\ifpgf@pat@makepatternimmutable
\pgfkeys{/pgf/patterns/.cd,
@@ -43,29 +43,29 @@
top right=\pgfpointorigin,
tile size=\pgfpointorigin,
tile transformation=,
- code=,
+ code=,
set up code=,
-}
+}%
-\def\pgf@pat@name@prefix{pgf@pattern@name@meta@}
+\def\pgf@pat@name@prefix{pgf@pattern@name@meta@}%
\def\pgfifpatternundefined#1{%
\pgfutil@ifundefined{\pgf@pat@name@prefix#1}%
-}
+}%
\def\pgf@pat@adddef@to@macro#1#2{%
\expandafter\expandafter\expandafter\def%
\expandafter\expandafter\expandafter#1%
\expandafter\expandafter\expandafter{\expandafter#1\expandafter%
\def\expandafter#2\expandafter{#2}}%
-}
+}%
\def\pgf@pat@addto@macro#1#2{%
\expandafter\def\expandafter#1\expandafter{#1#2}}%
\def\pgf@pat@process#1{%
\pgf@process{#1}%
-}
+}%
\def\pgf@pat@doifnotempty#1{%
\ifx#1\pgfutil@empty%
@@ -74,12 +74,12 @@
\let\pgf@pat@next=#1%
\fi%
\pgf@pat@next%
-}
+}%
-\def\pgf@pat@processtransformations#1{#1}
+\def\pgf@pat@processtransformations#1{#1}%
\def\pgf@pat@processpoint#1{%
\pgf@process{#1}%
-}
+}%
\def\pgfdeclarepattern#1{%
@@ -89,7 +89,7 @@
\pgfkeys{/pgf/patterns/.cd, #1}%
\pgf@declarepattern%
\endgroup%
-}
+}%
\def\pgf@declarepattern{%
\pgfifpatternundefined{\pgf@pat@name}{%
\ifx\pgf@pat@parameters\pgfutil@empty%
@@ -97,7 +97,7 @@
\pgf@pat@declare%
\edef\pgf@marshal{%
\noexpand\pgf@pat@addto@macro\noexpand\pgf@pat@options{,number ..=\pgf@pattern@number}}%
- \pgf@marshal%
+ \pgf@marshal%
\fi%
% It is a bit inefficient that all the options for
% immutable patterns are saved when only the type
@@ -106,7 +106,7 @@
}{%
\pgferror{Pattern `\pgf@pat@name' already defined}%
}%
-}
+}%
\let\pgf@pat@declarebefore=\pgfutil@empty
\let\pgf@pat@declareafter=\pgfutil@empty
\let\pgf@pat@codebefore=\pgfutil@empty
@@ -133,7 +133,7 @@
\pgf@pat@doifnotempty\pgf@pat@codebefore
\pgf@pat@code%
\pgf@pat@doifnotempty\pgf@pat@codeafter%
- \pgfsys@endscope%
+ \pgfsys@endscope%
\endpgfinterruptboundingbox%
\pgfsysprotocol@getcurrentprotocol\pgf@pattern@code%
\global\let\pgf@pattern@code=\pgf@pattern@code%
@@ -153,7 +153,7 @@
\pgf@pat@processtransformations\pgf@pat@transformation%
\pgfgettransformentries\aa\ab\ba\bb\shiftx\shifty%
\global\edef\pgf@pattern@matrix{{\aa}{\ab}{\ba}{\bb}{\shiftx}{\shifty}}%
- \endgroup%
+ \endgroup%
% Now, build a name for the pattern
\pgfutil@tempcnta=\pgf@pattern@number\relax%
\advance\pgfutil@tempcnta by1\relax%
@@ -163,39 +163,39 @@
{\the\pgf@xa}{\the\pgf@ya}{\the\pgf@xb}{\the\pgf@yb}{\the\pgf@xc}{\the\pgf@yc}\pgf@pattern@matrix{\pgf@pattern@code}{\pgf@pat@type}}%
}%
\pgf@marshal%
- \pgfsysprotocol@setcurrentprotocol\pgf@pattern@temp%
- }
+ \pgfsysprotocol@setcurrentprotocol\pgf@pattern@temp%
+}%
\def\pgf@pat@checkname#1{%
- \pgf@pat@@checkname#1[]\pgf@patstop}
+ \pgf@pat@@checkname#1[]\pgf@patstop}%
\def\pgf@pat@@checkname#1[#2]#3\pgf@patstop{%
\def\pgf@pat@onlinename{#1}%
\def\pgf@pat@onlineoptions{#2}%
-}
+}%
\def\pgf@pat@unravel#1/{%
- \pgfutil@ifnextchar\pgf@stop{\def\pgf@pat@unravelled{#1}}{\pgf@pat@unravel}}
+ \pgfutil@ifnextchar\pgf@stop{\def\pgf@pat@unravelled{#1}}{\pgf@pat@unravel}}%
\pgfkeys{/handlers/.pattern/.code={%
\expandafter\expandafter\expandafter\pgf@pat@unravel\pgfkeyscurrentpath/\pgf@stop%
\pgfpatternalias{#1}{\pgf@pat@unravelled}%
-}}
+}}%
\def\pgfpatternalias#1#2{%
\begingroup%
\pgf@pat@checkname{#1}%
\expandafter\let\expandafter\pgf@pat@options\expandafter=%
\csname\pgf@pat@name@prefix\pgf@pat@onlinename\endcsname%
- \pgf@pat@macroaskeys{/pgf/patterns/.cd}{\pgf@pat@options}%
+ \pgf@pat@macroaskeys{/pgf/patterns/.cd}{\pgf@pat@options}%
\pgfutil@toks@\expandafter{\pgf@pat@onlineoptions}%
\edef\pgf@pat@tmp{append to defaults={\the\pgfutil@toks@}}%
\expandafter\pgf@pat@addto@macro\expandafter\pgf@pat@options\expandafter{\expandafter,\pgf@pat@tmp}%
\pgf@pat@addto@macro\pgf@pat@options{,name=#2}%
\expandafter\global\expandafter\let\csname\pgf@pat@name@prefix#2\endcsname=\pgf@pat@options%
\endgroup%
-}
+}%
\let\pgfsetfillpattern@old=\pgfsetfillpattern
@@ -204,7 +204,7 @@
\pgfutil@toks@\expandafter{#2}%
\edef\pgf@marshal{\noexpand\pgfkeys{#1, \the\pgfutil@toks@}}%
\pgf@marshal%
-}
+}%
\def\pgfsetfillpattern#1#2{%
\pgf@pat@checkname{#1}%
\pgfutil@ifundefined{\pgf@pat@name@prefix\pgf@pat@onlinename}{%
@@ -246,7 +246,7 @@
\pgfsys@setpatterncolored{\pgf@pat@number}%
\fi%
}%
-}
+}%
\def\pgf@pat@setpatternuncolored#1#2{%
\pgfutil@colorlet{pgf@tempcolor}{#2}%
@@ -254,10 +254,10 @@
\pgfutil@extractcolorspec{pgf@tempcolor}{\pgf@tempcolor}%
\expandafter\pgfutil@convertcolorspec\pgf@tempcolor{rgb}{\pgf@rgbcolor}%
\expandafter\pgf@pat@set@fill@patternuncolored\pgf@rgbcolor\relax{#1}%
-}
+}%
\def\pgf@pat@set@fill@patternuncolored#1,#2,#3\relax#4{%
\pgfsys@setpatternuncolored{#4}{#1}{#2}{#3}%
-}
+}%
%%% Local Variables:
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 38ccd94d0b9..3f0fc8d268d 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.20 2013/08/31 13:02:59 ludewich Exp $
+\ProvidesFileRCS{pgflibraryplothandlers.code.tex}
% This handler converts each plot stream command into a curveto
@@ -25,13 +25,13 @@
point macro=\pgf@plot@curveto@handler@initial,
jump macro=\pgf@plot@smooth@next@moveto,
end macro=\pgf@plot@curveto@handler@finish
-}
+}%
\def\pgf@plot@smooth@next@moveto{%
\pgf@plot@curveto@handler@finish%
\global\pgf@plot@startedfalse%
\global\let\pgf@plotstreampoint\pgf@plot@curveto@handler@initial%
-}
+}%
\def\pgf@plot@curveto@handler@initial#1{%
\pgf@process{#1}%
@@ -41,14 +41,14 @@
\xdef\pgf@plot@curveto@first{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
\global\let\pgf@plot@curveto@first@support=\pgf@plot@curveto@first%
\global\let\pgf@plotstreampoint=\pgf@plot@curveto@handler@second%
-}
+}%
\def\pgf@plot@curveto@handler@second#1{%
\pgf@process{#1}%
\xdef\pgf@plot@curveto@second{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
\global\let\pgf@plotstreampoint=\pgf@plot@curveto@handler@third%
\global\pgf@plot@startedtrue%
-}
+}%
\def\pgf@plot@curveto@handler@third#1{%
\pgf@process{#1}%
@@ -79,20 +79,20 @@
\global\let\pgf@plot@curveto@first=\pgf@plot@curveto@second%
\global\let\pgf@plot@curveto@second=\pgf@plot@curveto@current%
\xdef\pgf@plot@curveto@first@support{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
-}
+}%
\def\pgf@plot@curveto@handler@finish{%
\ifpgf@plot@started%
\pgfpathcurveto{\pgf@plot@curveto@first@support}{\pgf@plot@curveto@second}{\pgf@plot@curveto@second}%
\fi%
-}
+}%
% This commands sets the tension for smoothing of plots.
%
% #1 = tension of curves. A value of 1 will yield a circle when the
% control points are at quarters of a circle. A smaller value
-% will result in a tighter curve. Default is 0.5.
+% will result in a tighter curve. Default is 0.5.
%
% Example:
%
@@ -101,8 +101,8 @@
\def\pgfsetplottension#1{%
\pgf@x=#1pt\relax%
\pgf@x=0.2775\pgf@x\relax%
- \edef\pgf@plottension{\pgf@sys@tonumber\pgf@x}}
-\pgfsetplottension{0.5}
+ \edef\pgf@plottension{\pgf@sys@tonumber\pgf@x}}%
+\pgfsetplottension{0.5}%
% This handler converts the plot stream command into a curveto
@@ -118,13 +118,13 @@
point macro=\pgf@plot@closedcurve@handler@initial,
end macro=\pgf@plot@closedcurve@handler@finish,
jump macro=\pgf@plot@closedsmooth@next@moveto
-}
+}%
\def\pgf@plot@closedsmooth@next@moveto{%
\pgf@plot@closedcurve@handler@finish%
\global\pgf@plot@startedfalse%
\global\let\pgf@plotstreampoint\pgf@plot@closedcurve@handler@initial%
-}
+}%
\def\pgf@plot@closedcurve@handler@initial#1{%
\pgf@process{#1}%
@@ -133,14 +133,14 @@
\xdef\pgf@plot@closedcurve@initial{\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}%
\global\let\pgf@plotstreampoint=\pgf@plot@closedcurve@handler@second%
\global\pgf@plot@startedfalse%
-}
+}%
\def\pgf@plot@closedcurve@handler@second#1{%
\pgf@process{#1}%
\xdef\pgf@plot@closedcurve@after@initial{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}%
{\pgfpathmoveto{}}%
\global\let\pgf@plotstreampoint=\pgf@plot@closedcurve@handler@third%
-}
+}%
\def\pgf@plot@closedcurve@handler@third#1{%
\global\pgf@plot@startedtrue%
@@ -170,7 +170,7 @@
\xdef\pgf@plot@closedcurve@after@initial@presupport{\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}%
\xdef\pgf@plot@closedcurve@first@support{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
\global\let\pgf@plotstreampoint=\pgf@plot@closedcurve@handler@fourth%
-}
+}%
\def\pgf@plot@closedcurve@handler@fourth#1{%
\pgf@process{#1}%
@@ -201,7 +201,7 @@
\global\let\pgf@plot@closedcurve@first=\pgf@plot@closedcurve@second%
\global\let\pgf@plot@closedcurve@second=\pgf@plot@closedcurve@current%
\xdef\pgf@plot@closedcurve@first@support{\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}%
-}
+}%
\def\pgf@plot@closedcurve@handler@finish{%
\ifpgf@plot@started
@@ -266,7 +266,7 @@
{\pgf@marshal}%
\pgfpathclose%
\fi%
-}
+}%
@@ -274,7 +274,7 @@
% This handler converts each point in a stream into a line from the
% $y$-axis to the given points coordinate, resulting in a
-% ``comb.''
+% ``comb.''
%
% Example:
%
@@ -285,7 +285,7 @@
start macro=\pgfplotxzerolevelstreamstart,
point macro=\pgf@plot@xcomb@handler,
end macro=\pgfplotxzerolevelstreamend,
-}
+}%
\def\pgf@plot@xcomb@handler#1{%
\pgf@process{#1}%
@@ -297,12 +297,12 @@
\pgf@yb=\pgf@x
\pgfpathmoveto{\pgfqpoint{\pgf@yb}{\pgf@ya}}%
\pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
-}
+}%
% This handler converts each point in a stream into a line from the
% $x$-axis straight up to the given points coordinate, resulting in a
-% ``comb.''
+% ``comb.''
%
% Example:
%
@@ -313,7 +313,7 @@
start macro=\pgfplotyzerolevelstreamstart,
point macro=\pgf@plot@ycomb@handler,
end macro=\pgfplotyzerolevelstreamend
-}
+}%
\def\pgf@plot@ycomb@handler#1{%
\pgf@process{#1}%
@@ -325,23 +325,23 @@
\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
+% and
% \pgfplotyzerolevelstreamstart
% \pgfplotyzerolevelstreamnext % assigns \pgf@x globally
% \pgfplotyzerolevelstreamend
@@ -351,43 +351,43 @@
\def\pgfplotxzerolevelstreamnext{\pgf@plotxzerolevelstreamnext}
\def\pgfplotyzerolevelstreamstart{\pgf@plotyzerolevelstreamstart}%
\def\pgfplotyzerolevelstreamend{\pgf@plotyzerolevelstreamend}%
-\def\pgfplotyzerolevelstreamnext{\pgf@plotyzerolevelstreamnext}
+\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}%
- }%
+ \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}%
- }%
+ \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}}
-\def\pgfplotbarshift{\pgfkeysvalueof{/pgf/bar shift}}
+\def\pgfplotbarwidth{\pgfkeysvalueof{/pgf/bar width}}%
+\def\pgfplotbarshift{\pgfkeysvalueof{/pgf/bar shift}}%
\pgfqkeys{/pgf}{%
- bar width/.initial=10pt,
- bar shift/.initial=0pt,
- bar interval width/.initial=1,
- bar interval shift/.initial=0.5,
- %
- % hook which is executed right before a new bar is begun.
- at begin bar/.initial=,
- % hook which is executed right after a bar path has been finished.
- % In this context, the bar's path has not been used.
- at end bar/.initial=,
-}
+ bar width/.initial=10pt,
+ bar shift/.initial=0pt,
+ bar interval width/.initial=1,
+ bar interval shift/.initial=0.5,
+ %
+ % hook which is executed right before a new bar is begun.
+ at begin bar/.initial=,
+ % hook which is executed right after a bar path has been finished.
+ % In this context, the bar's path has not been used.
+ at end bar/.initial=,
+}%
% 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
@@ -412,7 +412,7 @@
},
end macro=\pgfplotyzerolevelstreamend,
point macro=\pgf@plot@ybar@handler
-}
+}%
\def\pgf@plot@ybar@handler#1{%
\pgfkeysvalueof{/pgf/at begin bar}%
@@ -428,10 +428,10 @@
\pgf@yb=\pgf@x
\advance\pgf@ya by-\pgf@yb
\pgfpathrectangle
- {\pgfqpoint{\pgf@xc}{\pgf@yb}}%
- {\pgfqpoint{\pgf@xb}{\pgf@ya}}%
+ {\pgfqpoint{\pgf@xc}{\pgf@yb}}%
+ {\pgfqpoint{\pgf@xb}{\pgf@ya}}%
\pgfkeysvalueof{/pgf/at end bar}%
-}
+}%
% 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
@@ -455,7 +455,7 @@
},
end macro=\pgfplotxzerolevelstreamend,
point macro=\pgf@plot@xbar@handler
-}
+}%
\def\pgf@plot@xbar@handler#1{%
\pgfkeysvalueof{/pgf/at begin bar}%
@@ -471,23 +471,23 @@
\pgf@yb=\pgf@x
\advance\pgf@ya by-\pgf@yb
\pgfpathrectangle
- {\pgfqpoint{\pgf@yb}{\pgf@xc}}%
- {\pgfqpoint{\pgf@ya}{\pgf@xb}}%
+ {\pgfqpoint{\pgf@yb}{\pgf@xc}}%
+ {\pgfqpoint{\pgf@ya}{\pgf@xb}}%
\pgfkeysvalueof{/pgf/at end bar}%
-}
+}%
% 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.
@@ -519,14 +519,14 @@
},
end macro=\pgfplotyzerolevelstreamend,
point macro=\pgf@plot@ybarinterval@handler@first
-}
+}%
\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{%
\pgfkeysvalueof{/pgf/at begin bar}%
\pgf@process{#1}%
@@ -545,10 +545,10 @@
\pgf@yb=\pgf@x
\advance\pgf@ya by-\pgf@yb
\pgfpathrectangle
- {\pgfqpoint{\pgf@xc}{\pgf@yb}}%
- {\pgfqpoint{\pgf@xb}{\pgf@ya}}%
+ {\pgfqpoint{\pgf@xc}{\pgf@yb}}%
+ {\pgfqpoint{\pgf@xb}{\pgf@ya}}%
\pgfkeysvalueof{/pgf/at end bar}%
-}
+}%
% Like \pgfplothandlerybarinterval but for xbar.
\pgfdeclareplothandler{\pgfplothandlerxbarinterval}{}{%
@@ -561,14 +561,14 @@
},
end macro=\pgfplotxzerolevelstreamend,
point macro=\pgf@plot@xbarinterval@handler@first
-}
+}%
\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{%
\pgfkeysvalueof{/pgf/at begin bar}%
\pgf@process{#1}%
@@ -587,10 +587,10 @@
\pgf@yb=\pgf@x
\advance\pgf@ya by-\pgf@yb
\pgfpathrectangle
- {\pgfqpoint{\pgf@yb}{\pgf@xc}}%
- {\pgfqpoint{\pgf@ya}{\pgf@xb}}%
+ {\pgfqpoint{\pgf@yb}{\pgf@xc}}%
+ {\pgfqpoint{\pgf@ya}{\pgf@xb}}%
\pgfkeysvalueof{/pgf/at end bar}%
-}
+}%
% This handler is very similar to \pgfplothandlerlineto, but it
@@ -609,14 +609,14 @@
\pgfdeclareplothandler{\pgfplothandlerconstantlineto}{}{%
point macro=\pgf@plot@const@line@handler
-}
+}%
\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
@@ -625,11 +625,11 @@
\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
@@ -642,14 +642,14 @@
\pgfdeclareplothandler{\pgfplothandlerconstantlinetomarkright}{}{%
point macro=\pgf@plot@const@line@mark@right@handler
-}
+}%
\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
@@ -658,7 +658,7 @@
\pgfpathlineto{\pgfqpoint{\pgf@yb}{\pgf@ya}}%
\pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
\xdef\pgf@plot@const@line@handler@last{\the\pgf@xa}%
-}
+}%
% A variant of \pgfplothandlerconstantlineto which places its mark on
% the middle of the line segment.
@@ -676,14 +676,14 @@
\pgfdeclareplothandler{\pgfplothandlerconstantlinetomarkmid}{}{%
point macro=\pgf@plot@const@line@mark@mid@handler
-}
+}%
\def\pgf@plot@const@line@mark@mid@handler#1{%
\pgf@process{#1}%
\xdef\pgf@plot@const@line@handler@last{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}%
\pgf@plot@first@action{}%
\global\let\pgf@plotstreampoint=\pgf@plot@const@line@mark@mid@handler@@%
-}
+}%
\def\pgf@plot@const@line@mark@mid@handler@@#1{%
\pgf@process{#1}%
\pgf@xa=\pgf@x
@@ -695,7 +695,7 @@
\pgfpathlineto{\pgfqpoint{\pgf@xc}{\pgf@ya}}%
\pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
\xdef\pgf@plot@const@line@handler@last{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}%
-}
+}%
% This handler is in fact a variant of \pgfplothandlerconstantlineto,
% but it does not draw vertical lines. It produces a sequence of
@@ -703,7 +703,7 @@
% each right end:
%
% ---x
-% ---x
+% ---x
% ---x
% --x
%
@@ -714,14 +714,14 @@
\pgfdeclareplothandler{\pgfplothandlerjumpmarkright}{}{%
point macro=\pgf@plot@jumpmarkright@handler
-}
+}%
\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
@@ -730,7 +730,7 @@
\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
@@ -738,7 +738,7 @@
% each left end:
%
% x---
-% x---
+% x---
% x---
% x--
%
@@ -749,13 +749,13 @@
\pgfdeclareplothandler{\pgfplothandlerjumpmarkleft}{}{%
point macro=\pgf@plot@jumpmarkleft@handler
-}
+}%
\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
@@ -764,7 +764,7 @@
\pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}%
\pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
\xdef\pgf@plot@const@line@handler@last{\the\pgf@ya}%
-}
+}%
% This handler is in fact a variant of
% \pgfplothandlerconstantlinetomarkmid,
@@ -772,8 +772,8 @@
% line-to and move-to operations such that plot marks are placed like
%
% ----x
-%
-% --x--
+%
+% --x--
% --x----
% x--
%
@@ -784,14 +784,14 @@
\pgfdeclareplothandler{\pgfplothandlerjumpmarkmid}{}{%
point macro=\pgf@plot@jump@mark@mid@handler
-}
+}%
\def\pgf@plot@jump@mark@mid@handler#1{%
\pgf@process{#1}%
\xdef\pgf@plot@const@line@handler@last{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}%
\pgf@plot@first@action{}%
\global\let\pgf@plotstreampoint=\pgf@plot@jump@mark@mid@handler@@%
-}
+}%
\def\pgf@plot@jump@mark@mid@handler@@#1{%
\pgf@process{#1}%
\pgf@xa=\pgf@x
@@ -803,7 +803,7 @@
\pgfpathmoveto{\pgfqpoint{\pgf@xc}{\pgf@ya}}%
\pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
\xdef\pgf@plot@const@line@handler@last{\global\pgf@x=\the\pgf@x\space\global\pgf@y=\the\pgf@y\space}%
-}
+}%
% This handler converts each point in a stream into a line from the
@@ -816,7 +816,7 @@
\pgfdeclareplothandler{\pgfplothandlerpolarcomb}{}{%
point macro=\pgf@plot@polarcomb@handler
-}
+}%
\def\pgf@plot@polarcomb@handler#1{%
\pgf@process{#1}%
@@ -824,12 +824,12 @@
\pgf@ya=\pgf@y%
\pgfpathmoveto{\pgfpointorigin}%
\pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
-}
+}%
-% This handler draws a given mark at each point.
+% This handler draws a given mark at each point.
%
% #1 = some code to be executed at each point (with the coordinate
% system translated to that point).
@@ -853,15 +853,15 @@
\global\advance\pgf@plot@mark@count by-\pgf@plot@mark@phase\relax%
},
point macro=\pgf@plot@mark@handler
-}
+}%
\newcount\pgf@plot@mark@count
-\def\pgf@plot@mark@phase{0}
+\def\pgf@plot@mark@phase{0}%
\def\pgf@plot@mark@handler#1{%
\global\advance\pgf@plot@mark@count by1\relax%
{\pgftransformshift{#1}\pgf@plot@mark}%
-}
+}%
% Set the repeat count for marks. For example, if 3 is given as a
@@ -873,12 +873,12 @@
%
% \pgfsetplotmarkrepeat{2}
-\def\pgfsetplotmarkrepeat#1{\def\pgf@plot@mark@repeat{#1}}
-\pgfsetplotmarkrepeat{1}
+\def\pgfsetplotmarkrepeat#1{\def\pgf@plot@mark@repeat{#1}}%
+\pgfsetplotmarkrepeat{1}%
-% Set the phase for marks. For example, if 3 is the repeat and 3 is
-% the phase, already the first point will be marked.
+% Set the phase for marks. For example, if 3 is the repeat and 3 is
+% the phase, already the first point will be marked.
%
% #1 = the index of the first point that should be marked.
%
@@ -886,8 +886,8 @@
%
% \pgfsetplotmarkphase{3}
-\def\pgfsetplotmarkphase#1{\def\pgf@plot@mark@phase{#1}}
-\pgfsetplotmarkphase{1}
+\def\pgfsetplotmarkphase#1{\def\pgf@plot@mark@phase{#1}}%
+\pgfsetplotmarkphase{1}%
@@ -918,7 +918,7 @@
\global\advance\pgf@plot@mark@count by-\pgf@plot@mark@phase\relax%
},
point macro=\pgf@plot@mark@handler
-}
+}%
% \def\pgfplothandlermarklisted#1#2{%
% \let\pgf@plot@mark@list=\pgfutil@empty%
@@ -928,7 +928,7 @@
% \edef\pgf@marshal{\noexpand\pgfutil@in@{(\the\pgf@plot@mark@count)}{\pgf@plot@mark@list}}%
% \pgf@marshal%
% \ifpgfutil@in@#1\fi}%
-% }
+% }%
% Define a new plot mark for use with \pgfplotmark.
@@ -940,7 +940,7 @@
%
% \pgfdeclareplotmark{*}{\pgfpathcircle{\pgfpointorigin}{2pt}\pgfusepathqfill}
-\def\pgfdeclareplotmark#1#2{\expandafter\def\csname pgf@plot@mark@#1\endcsname{#2}}
+\def\pgfdeclareplotmark#1#2{\expandafter\def\csname pgf@plot@mark@#1\endcsname{#2}}%
% Set the size of plot marks. For circles, this will be the radius,
@@ -950,7 +950,7 @@
%
% \pgfsetplotmarksize{1pt}
-\def\pgfsetplotmarksize#1{\pgfmathsetlength\pgfplotmarksize{#1}}
+\def\pgfsetplotmarksize#1{\pgfmathsetlength\pgfplotmarksize{#1}}%
\newdimen\pgfplotmarksize
\pgfplotmarksize=2pt
@@ -964,7 +964,7 @@
%
% \pgfuseplotmark{*}
-\def\pgfuseplotmark#1{\csname pgf@plot@mark@#1\endcsname}
+\def\pgfuseplotmark#1{\csname pgf@plot@mark@#1\endcsname}%
% A stroke-filled circle mark
@@ -973,38 +973,38 @@
{%
\pgfpathellipse{\pgfpointorigin}{\pgfqpoint{\pgfplotmarksize}{0sp}}{\pgfqpoint{0sp}{\pgfplotmarksize}}%
\pgfusepathqfillstroke
-}
+}%
% A plus-sign like mark
\pgfdeclareplotmark{+}
{%
- \pgfpathmoveto{\pgfqpoint{-\pgfplotmarksize}{0pt}}
- \pgfpathlineto{\pgfqpoint{\pgfplotmarksize}{0pt}}
- \pgfpathmoveto{\pgfqpoint{0pt}{\pgfplotmarksize}}
- \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}
+ \pgfpathmoveto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
+ \pgfpathlineto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
+ \pgfpathmoveto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
+ \pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
\pgfusepathqstroke
-}
+}%
% An x-shaped mark
\pgfdeclareplotmark{x}
{%
- \pgfpathmoveto{\pgfqpoint{-.70710678\pgfplotmarksize}{-.70710678\pgfplotmarksize}}
- \pgfpathlineto{\pgfqpoint{.70710678\pgfplotmarksize}{.70710678\pgfplotmarksize}}
- \pgfpathmoveto{\pgfqpoint{-.70710678\pgfplotmarksize}{.70710678\pgfplotmarksize}}
- \pgfpathlineto{\pgfqpoint{.70710678\pgfplotmarksize}{-.70710678\pgfplotmarksize}}
+ \pgfpathmoveto{\pgfqpoint{-.70710678\pgfplotmarksize}{-.70710678\pgfplotmarksize}}%
+ \pgfpathlineto{\pgfqpoint{.70710678\pgfplotmarksize}{.70710678\pgfplotmarksize}}%
+ \pgfpathmoveto{\pgfqpoint{-.70710678\pgfplotmarksize}{.70710678\pgfplotmarksize}}%
+ \pgfpathlineto{\pgfqpoint{.70710678\pgfplotmarksize}{-.70710678\pgfplotmarksize}}%
\pgfusepathqstroke
-}
+}%
% See pgflibraryplotmarks for more plot marks
-% This handler turns creates a series of straight line segements
+% This handler turns creates a series of straight line segments
% between consecutive points, but leaving /pgf/gap around stream point
% space.
%
@@ -1013,16 +1013,16 @@
% \pgfplothandlergaplineto
% \pgfplotxyfile{mytable}
-\pgfkeys{/pgf/gap around stream point/.initial=1.5pt}
+\pgfkeys{/pgf/gap around stream point/.initial=1.5pt}%
\pgfdeclareplothandler{\pgfplothandlergaplineto}{}{%
point macro=\pgf@plot@gap@lineto@handler@initial,
jump macro=\pgf@plot@gap@next@moveto
-}
+}%
\def\pgf@plot@gap@next@moveto{%
\global\let\pgf@plotstreampoint=\pgf@plot@gap@lineto@handler@initial%
-}
+}%
\def\pgf@plot@gap@lineto@handler@initial#1{%
\pgf@process{#1}%
@@ -1030,7 +1030,7 @@
\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
@@ -1046,7 +1046,7 @@
\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%
-}
+}%
@@ -1065,13 +1065,13 @@
jump macro=\pgf@plot@gapcycle@next@moveto,
end macro=\pgf@plot@gap@cycle@handler@finish,
start={\global\let\pgf@plot@gap@cycle@first\relax}
-}
+}%
\def\pgf@plot@gapcycle@next@moveto{%
\pgf@plot@gap@cycle@handler@finish%
\global\let\pgf@plot@gap@cycle@first=\relax%
\global\let\pgf@plotstreampoint=\pgf@plot@gap@cycle@handler@initial%
-}
+}%
\def\pgf@plot@gap@cycle@handler@initial#1{%
\pgf@process{#1}%
@@ -1080,7 +1080,7 @@
\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
@@ -1096,14 +1096,14 @@
\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
-}
+}%
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 b64138dabf3..24bc7b8de72 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.14 2015/08/03 10:04:36 cfeuersaenger Exp $
+\ProvidesFileRCS{pgflibraryplotmarks.code.tex}
% A stroked circle mark
@@ -16,7 +16,7 @@
{%
\pgfpathellipse{\pgfpointorigin}{\pgfqpoint{\pgfplotmarksize}{0sp}}{\pgfqpoint{0sp}{\pgfplotmarksize}}%
\pgfusepathqstroke
-}
+}%
% A Mercedes-line star
@@ -30,7 +30,7 @@
\pgfpathmoveto{\pgfqpointpolar{-150}{\pgfplotmarksize}}%
\pgfpathlineto{\pgfpointorigin}%
\pgfusepathqstroke
-}
+}%
\pgfdeclareplotmark{Mercedes star flipped}
{%
@@ -41,7 +41,7 @@
\pgfpathmoveto{\pgfqpointpolar{150}{\pgfplotmarksize}}%
\pgfpathlineto{\pgfpointorigin}%
\pgfusepathqstroke
-}
+}%
@@ -57,7 +57,7 @@
\pgfpathmoveto{\pgfqpointpolar{-30}{\pgfplotmarksize}}%
\pgfpathlineto{\pgfqpointpolar{-210}{\pgfplotmarksize}}%
\pgfusepathqstroke
-}
+}%
% A five-pointed star mark
@@ -70,7 +70,7 @@
\pgfpathmoveto{\pgfpointorigin}\pgfpathlineto{\pgfqpointpolar{234}{\pgfplotmarksize}}%
\pgfpathmoveto{\pgfpointorigin}\pgfpathlineto{\pgfqpointpolar{162}{\pgfplotmarksize}}%
\pgfusepathqstroke
-}
+}%
% An 10-pointed star mark
@@ -83,7 +83,7 @@
\pgfpathmoveto{\pgfqpointpolar{234}{-\pgfplotmarksize}}\pgfpathlineto{\pgfqpointpolar{234}{\pgfplotmarksize}}%
\pgfpathmoveto{\pgfqpointpolar{162}{-\pgfplotmarksize}}\pgfpathlineto{\pgfqpointpolar{162}{\pgfplotmarksize}}%
\pgfusepathqstroke
-}
+}%
% An \oplus mark
@@ -96,7 +96,7 @@
\pgfpathmoveto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
\pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
\pgfusepathqstroke
-}
+}%
\pgfdeclareplotmark{oplus*}
{%
@@ -106,7 +106,7 @@
\pgfpathmoveto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
\pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
\pgfusepathqfillstroke
-}
+}%
% An \otimes mark
@@ -119,7 +119,7 @@
\pgfpathmoveto{\pgfqpoint{-.70710678\pgfplotmarksize}{.70710678\pgfplotmarksize}}%
\pgfpathlineto{\pgfqpoint{.70710678\pgfplotmarksize}{-.70710678\pgfplotmarksize}}%
\pgfusepathqstroke
-}
+}%
\pgfdeclareplotmark{otimes*}
{%
@@ -129,7 +129,7 @@
\pgfpathmoveto{\pgfqpoint{-.70710678\pgfplotmarksize}{.70710678\pgfplotmarksize}}%
\pgfpathlineto{\pgfqpoint{.70710678\pgfplotmarksize}{-.70710678\pgfplotmarksize}}%
\pgfusepathqfillstroke
-}
+}%
% A vertical bar mark
@@ -139,7 +139,7 @@
\pgfpathmoveto{\pgfqpoint{0pt}{\pgfplotmarksize}}%
\pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
\pgfusepathqstroke
-}
+}%
@@ -150,7 +150,7 @@
\pgfpathmoveto{\pgfqpoint{\pgfplotmarksize}{0pt}}%
\pgfpathlineto{\pgfqpoint{-\pgfplotmarksize}{0pt}}%
\pgfusepathqstroke
-}
+}%
% A square stroked mark
@@ -159,7 +159,7 @@
{%
\pgfpathrectangle{\pgfqpoint{-\pgfplotmarksize}{-\pgfplotmarksize}}{\pgfqpoint{2\pgfplotmarksize}{2\pgfplotmarksize}}%
\pgfusepathqstroke
-}
+}%
% A square stroked-filled mark
@@ -167,7 +167,7 @@
{%
\pgfpathrectangle{\pgfqpoint{-\pgfplotmarksize}{-\pgfplotmarksize}}{\pgfqpoint{2\pgfplotmarksize}{2\pgfplotmarksize}}%
\pgfusepathqfillstroke
-}
+}%
% A triangle mark
@@ -179,7 +179,7 @@
\pgfpathlineto{\pgfqpointpolar{-150}{\pgfplotmarksize}}%
\pgfpathclose
\pgfusepathqstroke
-}
+}%
% A stroke-filled triangle mark
@@ -191,7 +191,7 @@
\pgfpathlineto{\pgfqpointpolar{-150}{\pgfplotmarksize}}%
\pgfpathclose
\pgfusepathqfillstroke
-}
+}%
@@ -205,7 +205,7 @@
\pgfpathlineto{\pgfqpoint{-.75\pgfplotmarksize}{0pt}}%
\pgfpathclose
\pgfusepathqstroke
-}
+}%
% A stroke-filled diamond-shaped mark
@@ -218,7 +218,7 @@
\pgfpathlineto{\pgfqpoint{-.75\pgfplotmarksize}{0pt}}%
\pgfpathclose
\pgfusepathqfillstroke
-}
+}%
@@ -233,7 +233,7 @@
\pgfpathlineto{\pgfqpointpolar{162}{\pgfplotmarksize}}%
\pgfpathclose
\pgfusepathqstroke
-}
+}%
% A stroke-filled pentagon-shaped mark
@@ -246,7 +246,7 @@
\pgfpathlineto{\pgfqpointpolar{162}{\pgfplotmarksize}}%
\pgfpathclose
\pgfusepathqfillstroke
-}
+}%
\newif\ifpgfmarktext@usetikznode
\pgfkeys{
@@ -254,7 +254,7 @@
/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}},%
@@ -270,17 +270,17 @@
\else
\expandafter\pgftext\expandafter[\pgfmarktext@style]{\pgfmarktext@}%
\fi
-}
+}%
-\pgfkeysdef{/pgf/mark color}{\def\pgf@mark@color{#1}}
+\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
+ \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}%
@@ -289,44 +289,44 @@
% 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
-}
+ \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
-}
+ \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
@@ -338,13 +338,13 @@
\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
+ \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}}%
@@ -352,7 +352,7 @@
\pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
\pgfpathclose
\pgfusepathqstroke
-}
+}%
% A half-down-filled and half-up-filled-white tilted-squared-shaped mark
% created by Magnus Tewes
@@ -364,13 +364,13 @@
\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
+ \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}}%
@@ -378,7 +378,7 @@
\pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
\pgfpathclose
\pgfusepathqstroke
-}
+}%
% A half-right-filled and half-up-filled-white tilted-squared-shaped mark
% created by Magnus Tewes
@@ -390,13 +390,13 @@
\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
+ \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}}%
@@ -404,7 +404,7 @@
\pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
\pgfpathclose
\pgfusepathqstroke
-}
+}%
% A half-left-filled and half-up-filled-white tilted-squared-shaped mark
% created by Magnus Tewes
@@ -416,13 +416,13 @@
\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
+ \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}}%
@@ -430,7 +430,7 @@
\pgfpathlineto{\pgfqpoint{0pt}{-\pgfplotmarksize}}%
\pgfpathclose
\pgfusepathqstroke
-}
+}%
% A stroke-filled heart-shaped mark
@@ -447,7 +447,7 @@
\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
index ea1f469abe8..fe98a5f3f2e 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryprofiler.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryprofiler.code.tex
@@ -1,19 +1,19 @@
%--------------------------------------------
%
% 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/>.
%
@@ -31,38 +31,38 @@
\else
% Raise an error
\pgferror{%
- Library 'profiler' can only be used with pdftex Rev. >= 1.671
+ Library 'profiler' can only be used with pdftex Rev. >= 1.671
because it needs the \string\pdfelapsedtime\space command or
with luatex}%
\global\let\pgfutil@pdfelapsedtime=\c@pgf@counta
\fi}{%
% We run pdftex. That's ok.
- \let\pgfutil@pdfelapsedtime\pdfelapsedtime}
+ \let\pgfutil@pdfelapsedtime\pdfelapsedtime}%
% 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.
- }%
+ \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%
+ \expandafter\let\expandafter\pgfretval#1%
}%
% Defines a new profiler entry for the environment `#1'.
@@ -77,33 +77,33 @@
% \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
- \pgferror{\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
+ \expandafter\pgfprofile@@to@pgfretval\pgfprofile@TeX@DIALECT@toenvironment@begin{#2}%
+ \ifx\pgfretval\relax
+ \pgferror{\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}%
- }%
-}
+ \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>}%
@@ -113,10 +113,10 @@
%
% 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
@@ -124,32 +124,32 @@
% 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{\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
- \pgferror{library 'profiler' can't replace control sequences with '#3' arguments automatically, sorry.}{}%
- \fi
- \fi
+ \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
+ \pgferror{library 'profiler' can't replace control sequences with '#3' arguments automatically, sorry.}{}%
+ \fi
+ \fi
}%
% \pgfprofilenewforcommandpattern[<profile entry name>]{<\CS>}{<definition pattern>}{<invocation pattern>}
@@ -159,137 +159,137 @@
%
% \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{\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%
- \pgferror{\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\pgfprofile@known{1}%
+ \ifx#2\undefined
+ \def\pgfprofile@known{0}%
+ \else
+ \ifx#2\relax
+ \def\pgfprofile@known{0}%
+ \fi
+ \fi
+ \if\pgfprofile@known0%
+ \pgferror{\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}{%
- \pgferror{\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}%
- }%
+ \pgfutil@ifundefined{b@pgfprofile@show@#1}{%
+ \pgferror{\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}{%
- \pgferror{\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}%
- }%
+ \pgfutil@ifundefined{b@pgfprofile@show@#1}{%
+ \pgferror{\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\pgfprofile@no@optional@arg@text{<noarg>}%
\def\pgfprofileinvokecommand#1{%
- \pgfutil@ifnextchar[{\pgfprofileinvokecommand@{#1}}{\pgfprofileinvokecommand@{#1}[<noarg>]}%
+ \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%
+ \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%
+ % 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)}%
+ \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
+ \pgf@typeout{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}%
- }%
+ % 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}%
+ \pgfutil@ifnextchar\bgroup{\pgfprofileinvokecommand@onearg}{\pgfprofileinvokecommand@noarg}%
}%
\def\pgfprofileinvokecommand@onearg#1{%
- \pgfprofile@invokeorig{{#1}}%
+ \pgfprofile@invokeorig{{#1}}%
}%
\def\pgfprofileinvokecommand@noarg{%
- \pgfprofile@invokeorig{}%
+ \pgfprofile@invokeorig{}%
}%
@@ -302,51 +302,51 @@
% 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\pgfutil@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}%
+ \pgfprofileifisrunning{#1}{%
+ \relax
+ }{%
+ \expandafter\xdef\csname c@pgfprofile@elapsed@at@start@#1\endcsname{\the\pgfutil@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=\pgfutil@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
- }%
+ \pgfprofile@advance{c@pgfprofile@semaphor@#1}{-1}%
+ \pgfprofileifisrunning{#1}{%
+ \relax
+ }{%
+ \begingroup
+ \c@pgf@countb=\pgfutil@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
+ \pgf@typeout{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
+ \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
@@ -355,50 +355,50 @@
% 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
+ \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'.%
+ }%
+ \pgf@typeout{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
}%
{%
@@ -415,116 +415,116 @@
\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
+ \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}%
+ \pgf@typeout{
+ 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\pgfprofileinvokeforeach@@##1{#2}%
+ \pgfprofileforeachentryinCSVisterminated@loop#1,\pgfeov
}%
\long\def\pgfprofileforeachentryinCSVisterminated@loop{%
- \pgfutil@ifnextchar\pgfeov{\pgfutil@gobble}{\pgfprofileforeachentryinCSV@next}%
+ \pgfutil@ifnextchar\pgfeov{\pgfutil@gobble}{\pgfprofileforeachentryinCSV@next}%
}%
\long\def\pgfprofileforeachentryinCSV@next#1,{%
- \pgfprofileinvokeforeach@@{#1}%
- \pgfprofileforeachentryinCSVisterminated@loop%
+ \pgfprofileinvokeforeach@@{#1}%
+ \pgfprofileforeachentryinCSVisterminated@loop%
}%
-\xdef\pgfprofile@all@registered@list{}
-\xdef\pgfprofile@currently@running@list{}
+\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
+ \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}%
+ \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
+ \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
+ \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}%
+ \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
+ \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
+ \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
+ \ifnum\c@pgfprofile@stacktop<0 #1\else #2\fi
}%
-\def\pgfprofiletotwodigitstr#1{\ifnum#1<10 0\the#1\else\the#1\fi}
+\def\pgfprofiletotwodigitstr#1{\ifnum#1<10 0\the#1\else\the#1\fi}%
-\pgfprofilenew{main job}
-\pgfprofilestart{main job}
+\pgfprofilenew{main job}%
+\pgfprofilestart{main job}%
\expandafter\xdef\csname c@pgfprofile@elapsed@at@start@main job\endcsname{0}%
-\pgfprofilesetrel{main job}
+\pgfprofilesetrel{main job}%
\pgfutil@ifundefined{AtEndDocument}{%
- % no latex. ok.
+ % 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}%
+ % 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
index 285f6d21772..22aa92ffb35 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshadings.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibraryshadings.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/pgflibraryshadings.code.tex,v 1.2 2008/10/29 23:06:34 tantau Exp $
+\ProvidesFileRCS{pgflibraryshadings.code.tex}
%
@@ -20,7 +20,7 @@
{}
{ % x y
2 copy % ... x y x y
- 2 copy abs exch abs add 0.0001 ge
+ 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
@@ -58,7 +58,7 @@
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 ]
@@ -92,7 +92,7 @@
ifelse % for III
}
ifelse % for II
-}
+}%
\pgfdeclarefunctionalshading{color wheel black center}
{\pgfpoint{-50bp}{-50bp}}
@@ -100,7 +100,7 @@
{}
{ % x y
2 copy % ... x y x y
- 2 copy abs exch abs add 0.0001 ge
+ 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
@@ -138,7 +138,7 @@
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 ]
@@ -172,20 +172,20 @@
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
+ 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
+ 1.0 1.0 % ... H S V
% C version to use as model:
% H' = H * 6
% i = floor(H')
@@ -208,7 +208,7 @@
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 ]
@@ -242,17 +242,17 @@
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}
+\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}
@@ -264,13 +264,13 @@
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.
+ 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.
+ \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
@@ -279,7 +279,7 @@
4 1 roll
\pgf@lib@shadings@urblue mul exch \pgf@lib@shadings@ulblue mul add mul
add
-}
+}%
%
@@ -293,7 +293,7 @@
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
+ % 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
@@ -402,8 +402,8 @@
} { pop pop 1000.0 1000.0 } ifelse
% Compute distance
dup mul exch
- dup mul
+ 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/pgflibrarysnakes.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysnakes.code.tex
index 90f26eb7211..f964dca2751 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysnakes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysnakes.code.tex
@@ -7,10 +7,10 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibrarysnakes.code.tex,v 1.25 2013/07/15 12:05:34 tantau Exp $
+\ProvidesFileRCS{pgflibrarysnakes.code.tex}
-\pgfwarning{Snakes have been superseded by decorations. Use the decoration libraries instead of the snakes library}
+\pgfwarning{Snakes have been superseded by decorations. Use the decoration libraries instead of the snakes library}%
-\usepgflibrary{decorations.pathmorphing,decorations.pathreplacing,decorations.shapes}
+\usepgflibrary{decorations.pathmorphing,decorations.pathreplacing,decorations.shapes}%
\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
index a385cf199f5..59ea0915460 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex
@@ -7,10 +7,10 @@
%
% 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.7 2013/09/23 18:04:36 tantau Exp $
+\ProvidesFileRCS{pgflibrarysvg.path.code.tex}
-\usepgfmodule{parser}
+\usepgfmodule{parser}%
@@ -25,7 +25,7 @@
% 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
@@ -34,13 +34,13 @@
% 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%
@@ -52,7 +52,7 @@
\pgf@lib@svg@last@y\pgf@y%
\let\pgf@lib@svg@num=\pgfutil@empty%
\pgfparserparse{svgpath}#1"%
-}
+}%
@@ -72,12 +72,12 @@
% 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.
+% the start point is used.
-\def\pgf@lib@svg@clear@bezier@quad{
+\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
%
@@ -90,7 +90,7 @@
{
\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%
@@ -98,7 +98,7 @@
\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:
@@ -107,7 +107,7 @@
{
\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%
@@ -115,7 +115,7 @@
\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:
@@ -124,7 +124,7 @@
{
\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
@@ -135,7 +135,7 @@
\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:
@@ -144,7 +144,7 @@
{
\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
@@ -155,7 +155,7 @@
\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:
@@ -163,12 +163,12 @@
\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
@@ -176,12 +176,12 @@
\let\pgf@lib@svg@finish@prev=\relax
\pgf@lib@svg@clear@bezier@quad%
\pgfparserswitch{initial}%
-}
+}%
% Ignore spaces if no other rules says differently:
-\pgfparserdef{svgpath}{all}{blank space \space}{}
+\pgfparserdef{svgpath}{all}{blank space \space}{}%
@@ -192,7 +192,7 @@
{
\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
@@ -202,13 +202,13 @@
\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
@@ -218,7 +218,7 @@
\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:
@@ -227,7 +227,7 @@
{
\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
@@ -237,13 +237,13 @@
\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
@@ -253,7 +253,7 @@
\pgfpathlineto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}%
\pgf@lib@svg@read@nums{1}{\pgf@lib@svg@vlineto@rel}
\fi
-}
+}%
@@ -264,7 +264,7 @@
{
\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
@@ -283,14 +283,14 @@
% 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
@@ -308,7 +308,7 @@
\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
-}
+}%
@@ -318,7 +318,7 @@
{
\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
@@ -351,14 +351,14 @@
% 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
@@ -383,7 +383,7 @@
{\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}}}
+ \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@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%
@@ -391,7 +391,7 @@
% Go on
\pgf@lib@svg@read@nums{4}{\pgf@lib@svg@curveto@rel@smooth}
\fi
-}
+}%
@@ -402,7 +402,7 @@
{
\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
@@ -420,14 +420,14 @@
% 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
@@ -444,7 +444,7 @@
\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
-}
+}%
@@ -453,7 +453,7 @@
{
\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
@@ -485,14 +485,14 @@
% 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
@@ -524,7 +524,7 @@
% Go on
\pgf@lib@svg@read@nums{2}{\pgf@lib@svg@quad@curveto@rel@smooth}
\fi
-}
+}%
@@ -534,7 +534,7 @@
{
\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
@@ -553,13 +553,13 @@
% 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
@@ -578,7 +578,7 @@
% Go on
\pgf@lib@svg@read@nums{7}{\pgf@lib@svg@arcto@rel}
\fi
-}
+}%
@@ -590,7 +590,7 @@
{
\pgf@lib@svg@finish@prev
\pgfparserswitch{final}
-}
+}%
@@ -610,26 +610,26 @@
\fi
#2
}
-}
+}%
-\def\pgf@lib@svg@get@num#1{\csname pgf@lib@svg@num@#1\endcsname}
+\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%
@@ -642,44 +642,40 @@
\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.}}
+{\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}}
+{\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}}
+{\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}}
+{\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}}
+{\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}}
+{\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}}
+{\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}}
+{\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}}
+{\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}}
+{\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}}
-
-
-
-
+{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num9}}%
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytimelines.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytimelines.code.tex
new file mode 100644
index 00000000000..dd9b38fdc46
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarytimelines.code.tex
@@ -0,0 +1,197 @@
+% Copyright 2015 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{pgflibrarytimelines.code.tex}
+
+
+% We need the animation module:
+
+\usepgfmodule{animations}%
+
+
+% Starts a fixed timeline
+%
+% Description:
+%
+% A (fixed) timeline defines for a specific number of seconds how a
+% different objects are animated. In contrast to a dynamic timeline,
+% the animation must be fixed beforehand, that is, in a fixed timeline
+% you can specify things like "be there after 2s and there after 4s
+% and be red after 5s" but not "be there after that other animation
+% has finished and then stay there until another animation has
+% finished or something has been clicked". Note that while a fixed
+% timeline describes a fixed sequence of animations, the starting
+% point of the timeline may depend for instance on when some button is
+% clicked; only when the timeline's animation gets started there is
+% nothing dynamic about it till its end (a timeline may be ended
+% prematurely, however).
+%
+% This command allows you to start a timeline. Once the timeline has
+% been started, you can call the following macro repeatedly:
+%
+% \pgftimelineentry{time}{object}{attribute}{value}
+%
+% The time is some time when the given attribute should have the given
+% value. The important thing is that the entries need not come in any
+% specific order; it is the job of the timeline library to sort them
+% into a sensible order.
+%
+% At the end of the timeline, you will have specified for a whole
+% bunch of objects and attributes their values at certain time
+% points. The macro \pgftimelineend will now call \pgfanimateattribute
+% for all attributes and objects mentioned in the timeline.
+%
+%
+% Internally, pgf keeps track of all objects in a timeline and all
+% attributes and sorts the times using a simple insertion sort (which
+% will be fastest when the times are given in increasing order as
+% happens most of the time).
+
+\def\pgftimelinebegin{%
+ \pgf@timeline@todo@saved=\pgf@timeline@todo%
+ \begingroup%
+ \advance\pgf@timeline@depth by1\relax%
+ \pgf@timeline@todo{}%
+}%
+
+\newcount\pgf@timeline@depth
+\newtoks\pgf@timeline@todo
+\newtoks\pgf@timeline@todo@saved
+
+
+% Ends a timeline
+%
+% Description:
+%
+% This command will scan \pgfanimateattribute for the objects and
+% attributes mentioned in the timeline.
+
+\def\pgftimelineend{%
+ \the\pgf@timeline@todo%
+ \endgroup%
+ \global\pgf@timeline@todo=\pgf@timeline@todo@saved%
+}%
+
+
+% Adds an entry to a timeline
+%
+% #1 = a time (evaluated using \pgfparsetime)
+% #2 = an object (a "whom" in the sense of pgfmoduleanimations, will
+% be expanded)
+% #3 = an attribute (in the sense of pgfmoduleanimations, will be expanded)
+% #4 = a value
+%
+% Description:
+%
+% Adds a new entry to the timeline. For a fixed #1, several calls to
+% this macro allow you to specify a key frame by specifying the
+% different values of the different attributes of the different
+% objects in the key frame.
+
+\def\pgftimelineentry#1#2#3#4{%
+ \begingroup%
+ \pgfparsetime{#1}%
+ \edef\pgf@timeline@whom{#2}%
+ \edef\pgf@timeline@attr{#3}%
+ \expandafter\let\expandafter\pgf@timeline@entry\csname pgf@tl@\pgf@timeline@whom @\pgf@timeline@attr @\the\pgf@timeline@depth\endcsname%
+ \ifx\pgf@timeline@entry\relax%
+ \edef\pgf@timeline@entry{\noexpand\pgf@timeline@setup{\pgf@timeline@whom}{\pgf@timeline@attr}}%
+ \fi%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@timeline@entry\expandafter\expandafter\expandafter%
+ {\expandafter\pgf@timeline@entry\expandafter\pgf@timeline@doentry\expandafter{\pgftimeresult}{#4}}%
+ \expandafter\global\expandafter\let\csname pgf@tl@\pgf@timeline@whom @\pgf@timeline@attr @\the\pgf@timeline@depth\endcsname\pgf@timeline@entry%
+ \global\pgf@timeline@todo\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgf@timeline@todo\expandafter\pgf@timeline@handle\csname pgf@tl@\pgf@timeline@whom @\pgf@timeline@attr @\the\pgf@timeline@depth\endcsname}%
+ \endgroup%
+}%
+
+
+\newtoks\pgf@timeline@sort@toks
+\countdef\pgf@timeline@sort@count=0\relax%
+\countdef\pgf@timeline@count@down=1\relax%
+\countdef\pgf@timeline@count@down@next=2\relax%
+
+% Handles one entry in a timeline
+
+\def\pgf@timeline@handle#1{%
+ \ifx#1\relax%
+ \else%
+ % Do an inserting sort. The time is kept in the dimension registers
+ % 1 to n, the value in the token registers 1 to n.
+ {%
+ \pgf@timeline@sort@count=1\relax%
+ #1% will start a group
+ % Now we collect the toks:
+ \pgf@timeline@count@down=1\relax%
+ \pgf@timeline@sort@toks{}%
+ \pgfutil@loop%
+ \ifnum\pgf@timeline@count@down<\pgf@timeline@sort@count\relax%
+ \edef\pgf@temp{\the\pgf@timeline@sort@toks\noexpand\pgf@timeline@donow{\the\dimen\pgf@timeline@count@down}{\the\toks\pgf@timeline@count@down}}%
+ \pgf@timeline@sort@toks\expandafter{\pgf@temp}%
+ \advance\pgf@timeline@count@down by1\relax%
+ \pgfutil@repeat%
+ % Do computations now
+ \pgf@timeline@compute@duration%
+ %
+ \edef\pgf@temp{\noexpand\pgf@timeline@call@attribute{\pgf@timeline@whom}{\pgf@timeline@attr}{\the\pgf@timeline@sort@toks}}
+ \expandafter%
+ \endgroup%
+ \pgf@temp%
+ }%
+ \global\let#1\relax% cleanup
+ \fi%
+}%
+
+\def\pgf@timeline@compute@duration{%
+ \advance\pgf@timeline@sort@count by-1\relax%
+ \pgfmathparse{\the\dimen\pgf@timeline@sort@count}%
+ \global\let\pgf@timeline@duration\pgfmathresult%
+}%
+
+
+\def\pgf@timeline@setup#1#2{%
+ \def\pgf@timeline@whom{#1}%
+ \def\pgf@timeline@attr{#2}%
+ \begingroup%
+}%
+
+\def\pgf@timeline@doentry#1#2{%
+ \dimen\pgf@timeline@sort@count=#1pt\relax%
+ \toks\pgf@timeline@sort@count{#2}%
+ \pgf@timeline@count@down\pgf@timeline@sort@count\relax%
+ \pgfutil@loop%
+ \ifnum\pgf@timeline@count@down>1\relax%
+ \pgf@timeline@count@down@next\pgf@timeline@count@down%
+ \advance\pgf@timeline@count@down@next by-1\relax%
+ \ifdim\dimen\pgf@timeline@count@down<\dimen\pgf@timeline@count@down@next\relax%
+ % Swap:
+ \toks0=\toks\pgf@timeline@count@down%
+ \dimen0=\dimen\pgf@timeline@count@down%
+ \toks\pgf@timeline@count@down=\toks\pgf@timeline@count@down@next%
+ \dimen\pgf@timeline@count@down=\dimen\pgf@timeline@count@down@next%
+ \toks\pgf@timeline@count@down@next=\toks0\relax%
+ \dimen\pgf@timeline@count@down@next=\dimen0\relax%
+ \pgf@timeline@count@down\pgf@timeline@count@down@next\relax%
+ \else%
+ \pgf@timeline@count@down1\relax%
+ \fi%
+ \pgfutil@repeat%
+ \advance\pgf@timeline@sort@count by1\relax%
+}%
+
+
+\def\pgf@timeline@call@attribute#1#2#3{%
+ \pgfanimateattributecode{#2}{\pgfkeys{/pgf/animation/whom={#1},/pgf/animation/duration=\pgf@timeline@duration}#3}%
+}%
+
+\def\pgf@timeline@donow#1#2{%
+ \pgfkeys{/pgf/animation/key time={#1/\pgf@timeline@duration}}%
+ \pgfkeys{/pgf/animation/value={#2}}%
+}%
+
+\endinput
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
index e79634a06ea..62b1a260299 100644
--- 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
@@ -13,20 +13,20 @@
%
\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]
+{%
+ \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}}}}
@@ -54,9 +54,9 @@
\pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yc}}%
\pgfutil@repeat%
\advance\pgf@xb by-.1pt%
- \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yc}}%
- }
-}
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yc}}%
+ }%
+}%
@@ -65,7 +65,7 @@
%
\pgfdeclareshape{inductor IEC}
-{
+{%
\savedanchor\northeast{%
\pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
@@ -75,7 +75,7 @@
\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}}%
@@ -83,19 +83,19 @@
\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}
+ }%
+
+ \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%
@@ -112,8 +112,8 @@
\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
@@ -127,12 +127,12 @@
\pgfutil@loop%
\advance\pgf@xa by2\pgf@xc\relax%
\ifdim\pgf@xa<\pgf@xb%
- \pgfpatharc{180}{0}{\pgf@xc}%
+ \pgfpatharc{180}{0}{\pgf@xc}%
\pgfutil@repeat%
\advance\pgf@xb by-.1pt%
- \pgfpathlineto{\pgfqpoint{\pgf@xb}{0pt}}%
- }
-}
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{0pt}}%
+ }%
+}%
@@ -142,20 +142,20 @@
%
\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]
+{%
+ \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}}}}
@@ -166,8 +166,8 @@
\pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}
\pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@ya}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
- }
-}
+ }%
+}%
@@ -177,20 +177,20 @@
%
\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]
+{%
+ \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}}}}
@@ -213,8 +213,8 @@
\advance\pgf@yb by-\pgf@yc
\pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@ya}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
- }
-}
+ }%
+}%
@@ -224,20 +224,20 @@
%
\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]
+{%
+ \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}}}}
@@ -253,8 +253,8 @@
\advance\pgf@yb by-\pgf@yc
\pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@ya}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
- }
-}
+ }%
+}%
%
@@ -263,20 +263,20 @@
\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]
+{%
+ \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}}}}
@@ -295,9 +295,9 @@
\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}}}}
@@ -311,7 +311,7 @@
\pgfusepathqstroke
\pgf@xc=.5\pgf@xa
\advance\pgf@xc by.5\pgf@xb
- \pgftransformshift{\pgfqpoint{\pgf@xc}{\pgf@yc}}
+ \pgftransformshift{\pgfqpoint{\pgf@xc}{\pgf@yc}}
\pgf@yc=.5\pgf@yb
\advance\pgf@yc by-.5\pgf@ya
\pgftransformscale{\pgf@sys@tonumber{\pgf@yc}}
@@ -321,8 +321,8 @@
\pgfpathlineto{\pgfqpoint{.5pt}{1pt}}
\pgfusepathqstroke
}
- }
-}
+ }%
+}%
@@ -339,7 +339,7 @@
\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
@@ -347,31 +347,31 @@
% 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]
-
+
+ \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{}
+ \pgftransformshift{}
\pgfutil@tempdima=\radius%
- \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \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%
@@ -380,8 +380,8 @@
\pgftransformscale{\pgf@sys@tonumber{\pgfutil@tempdima}}
\pgfkeysvalueof{/pgf/generic circle IEC/before background}
}
- }
-}
+ }%
+}%
@@ -390,28 +390,28 @@
%
\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
+ % 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]
+ % (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}}}}
@@ -427,9 +427,9 @@
\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}}}}
@@ -441,31 +441,31 @@
\pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@yc}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yc}}
\pgfusepathqstroke
- \pgftransformshift{\pgfqpoint{\pgf@xb}{\pgf@yc}}
+ \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
+% Contacts
%
\pgfdeclareshape{make contact IEC}
-{
+{%
\savedanchor\northeast{%
\pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
@@ -475,7 +475,7 @@
\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}}%
@@ -483,23 +483,23 @@
\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}
+ }%
+
+ \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...
+ % tricky... simplify to the origin...
\pgf@xc=\pgf@x%
\pgf@yc=\pgf@y%
\pgf@process{\southwest}%
@@ -512,8 +512,8 @@
\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
@@ -521,17 +521,17 @@
% Start point
\pgfpathmoveto{\pgfqpoint{\pgf@xa}{0pt}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
- }
-}
+ }%
+}%
%
-% Concacts
+% Contacts
%
\pgfdeclareshape{var make contact IEC}
-{
+{%
\savedanchor\northeast{%
\pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
@@ -541,7 +541,7 @@
\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}}%
@@ -551,23 +551,23 @@
\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}
+ }%
+
+ \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...
+ % tricky... simplify to the origin...
\pgf@xc=\pgf@x%
\pgf@yc=\pgf@y%
\pgf@process{\southwest}%
@@ -579,8 +579,8 @@
\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}}}}}
@@ -600,13 +600,13 @@
\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}}%
@@ -616,7 +616,7 @@
\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}}%
@@ -624,23 +624,23 @@
\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}
+ }%
+
+ \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...
+ % tricky... simplify to the origin...
\pgf@xc=\pgf@x%
\pgf@yc=\pgf@y%
\pgf@process{\southwest}%
@@ -653,8 +653,8 @@
\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
@@ -669,12 +669,11 @@
\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
index 30ecbff3c4d..4cfa4eed7d6 100644
--- 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
@@ -16,25 +16,25 @@
% 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]
+{%
+ \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}%
@@ -42,57 +42,57 @@
\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]
+{%
+ \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}
-}
+ \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.
+% rectangle around the arrow tip.
%
\pgfdeclareshape{direction ee}
-{
+{%
\savedanchor\northeast{
\pgf@x=0pt%
% 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
\pgfarrowtotallength{\pgfkeysvalueof{/pgf/direction ee arrow}}%
@@ -100,20 +100,20 @@
% 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]
+ }%
+
+ \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{
@@ -124,7 +124,7 @@
\pgfpathmoveto{\pgfqpoint{\pgf@xa}{0pt}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{0pt}}
\pgfusepathqstroke
- }
+ }%
\beforebackgroundpath{
{
@@ -132,19 +132,19 @@
\pgfarrowdraw{\pgfkeysvalueof{/pgf/direction ee arrow}}%
\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}
@@ -159,13 +159,12 @@
\pgfpathlineto{\pgfqpoint{-0.5\pgfutil@tempdima}{-0.38268343237\pgfutil@tempdima}}
\pgfpathclose
\pgfusepathqfillstroke
-}
+}%
-\pgfsetarrowoptions{direction ee}{4pt}
+\pgfsetarrowoptions{direction ee}{4pt}%
\endinput
-
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex
index e137e113cdc..9b964996d70 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgflibrary{shapes.gates.logic}
+\usepgflibrary{shapes.gates.logic}%
\pgfkeys{/pgf/.cd,
and gate IEC symbol/.initial=$\char`\&$,
@@ -20,14 +20,14 @@
buffer gate IEC symbol/.initial=1,
logic gate IEC symbol align/.initial=top,
logic gate IEC symbol color/.initial=% no value
-}
+}%
\pgfkeys{/pgf/logic gate IEC symbol align/.cd,
top/.code=\pgftransformyshift{\innerhalfheight},
bottom/.code=\pgftransformyshift{-\innerhalfheight},
left/.code=\pgftransformxshift{-\innerhalfwidth},
- right/.code=\pgftransformxshift{\innerhalfwidth}
-}
+ right/.code=\pgftransformxshift{\innerhalfwidth},
+}%
\def\pgf@lib@sh@logicgates@IEC@foregroundpath#1{%
\dimensions%
@@ -45,7 +45,7 @@
\pgfkeysvalueof{/pgf/#1 gate IEC symbol}%
}%
}%
-}
+}%
\def\pgf@lib@sh@logicgates@dimensions@IEC#1{%
@@ -135,13 +135,13 @@
\multiply\pgfutil@tempdima#1\relax%
\advance\pgf@y\halfheight%
\advance\pgf@y-\pgfutil@tempdima%
-}
+}%
% Shape and gate IEC
%
-\pgfdeclareshape{and gate IEC}{
+\pgfdeclareshape{and gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@and gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
%
@@ -165,25 +165,25 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{and}%
- }
+ }%
\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}{\midpoint}%
\anchor{mid west}{%
\dimensions%
\midpoint%
@@ -192,7 +192,7 @@
\dimensions%
\midpoint%
\advance\pgf@x\halfwidth}%
- \anchor{base}{\basepoint}
+ \anchor{base}{\basepoint}%
\anchor{base west}{%
\dimensions%
\basepoint%
@@ -209,7 +209,7 @@
\anchor{north west}{\dimensions\centerpoint\advance\pgf@x-\halfwidth\advance\pgf@y\halfheight}%
\anchor{south east}{\dimensions\centerpoint\advance\pgf@x\halfwidth\advance\pgf@y-\halfheight}%
\anchor{south west}{\dimensions\centerpoint\advance\pgf@x-\halfwidth\advance\pgf@y-\halfheight}%
- \anchor{output}{\dimensions\centerpoint\advance\pgf@x\halfwidth}
+ \anchor{output}{\dimensions\centerpoint\advance\pgf@x\halfwidth}%
\backgroundpath{%
\dimensions%
\pgf@xc\halfwidth%
@@ -241,19 +241,19 @@
\advance\pgf@yc-\pgfutil@tempdima%
\expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
{%
- \pgfpathcircle{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\invertedradius}%
+ \pgfpathcircle{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\invertedradius}%
}%
\fi%
\repeatpgfmathloop%
}%
- }
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{and}}
+ }%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{and}}%
\anchorborder{%
\pgfextract@process\externalpoint{}%
\dimensions%
\pgfpointadd{\centerpoint}{\pgfpointborderrectangle{\externalpoint}{\pgfqpoint{\halfwidth}{\halfheight}}}%
- }%
-}
+ }%
+}%
@@ -261,7 +261,7 @@
% Shape nand gate IEC
%
-\pgfdeclareshape{nand gate IEC}{
+\pgfdeclareshape{nand gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nand gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
%
@@ -285,43 +285,43 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{nand}%
- }
+ }%
\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%
- }
- \inheritanchor[from=and gate IEC]{center}
- \inheritanchor[from=and gate IEC]{mid}
- \inheritanchor[from=and gate IEC]{mid west}
- \inheritanchor[from=and gate IEC]{mid east}
- \inheritanchor[from=and gate IEC]{base}
- \inheritanchor[from=and gate IEC]{base west}
- \inheritanchor[from=and gate IEC]{base east}
- \inheritanchor[from=and gate IEC]{north}
- \inheritanchor[from=and gate IEC]{south}
- \inheritanchor[from=and gate IEC]{east}
- \inheritanchor[from=and gate IEC]{west}
- \inheritanchor[from=and gate IEC]{north east}
- \inheritanchor[from=and gate IEC]{north west}
- \inheritanchor[from=and gate IEC]{south east}
- \inheritanchor[from=and gate IEC]{south west}
+ }%
+ \inheritanchor[from=and gate IEC]{center}%
+ \inheritanchor[from=and gate IEC]{mid}%
+ \inheritanchor[from=and gate IEC]{mid west}%
+ \inheritanchor[from=and gate IEC]{mid east}%
+ \inheritanchor[from=and gate IEC]{base}%
+ \inheritanchor[from=and gate IEC]{base west}%
+ \inheritanchor[from=and gate IEC]{base east}%
+ \inheritanchor[from=and gate IEC]{north}%
+ \inheritanchor[from=and gate IEC]{south}%
+ \inheritanchor[from=and gate IEC]{east}%
+ \inheritanchor[from=and gate IEC]{west}%
+ \inheritanchor[from=and gate IEC]{north east}%
+ \inheritanchor[from=and gate IEC]{north west}%
+ \inheritanchor[from=and gate IEC]{south east}%
+ \inheritanchor[from=and gate IEC]{south west}%
\anchor{output}{%
\csname pgf@anchor@and gate IEC@east\endcsname%
\advance\pgf@x\invertedradius%
\advance\pgf@x\outerinvertedradius%
- }
+ }%
\backgroundpath{%
\csname pgf@sh@bg@and gate IEC\endcsname%
\pgfpathcircle{%
@@ -329,10 +329,10 @@
\advance\pgf@x\halfwidth%
\advance\pgf@x\invertedradius%
}{+\invertedradius}%
- }
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{nand}}
- \inheritanchorborder[from=and gate IEC]
-}
+ }%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{nand}}%
+ \inheritanchorborder[from=and gate IEC]%
+}%
@@ -340,7 +340,7 @@
% Shape or gate IEC
%
-\pgfdeclareshape{or gate IEC}{
+\pgfdeclareshape{or gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@or gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
%
@@ -364,43 +364,43 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{or}%
- }
+ }%
\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%
- }
- \inheritanchor[from=and gate IEC]{center}
- \inheritanchor[from=and gate IEC]{mid}
- \inheritanchor[from=and gate IEC]{mid west}
- \inheritanchor[from=and gate IEC]{mid east}
- \inheritanchor[from=and gate IEC]{base}
- \inheritanchor[from=and gate IEC]{base west}
- \inheritanchor[from=and gate IEC]{base east}
- \inheritanchor[from=and gate IEC]{north}
- \inheritanchor[from=and gate IEC]{south}
- \inheritanchor[from=and gate IEC]{east}
- \inheritanchor[from=and gate IEC]{west}
- \inheritanchor[from=and gate IEC]{north east}
- \inheritanchor[from=and gate IEC]{north west}
- \inheritanchor[from=and gate IEC]{south east}
- \inheritanchor[from=and gate IEC]{south west}
- \inheritanchor[from=and gate IEC]{output}
- \inheritbackgroundpath[from=and gate IEC]
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{or}}
- \inheritanchorborder[from=and gate IEC]
-}
+ }%
+ \inheritanchor[from=and gate IEC]{center}%
+ \inheritanchor[from=and gate IEC]{mid}%
+ \inheritanchor[from=and gate IEC]{mid west}%
+ \inheritanchor[from=and gate IEC]{mid east}%
+ \inheritanchor[from=and gate IEC]{base}%
+ \inheritanchor[from=and gate IEC]{base west}%
+ \inheritanchor[from=and gate IEC]{base east}%
+ \inheritanchor[from=and gate IEC]{north}%
+ \inheritanchor[from=and gate IEC]{south}%
+ \inheritanchor[from=and gate IEC]{east}%
+ \inheritanchor[from=and gate IEC]{west}%
+ \inheritanchor[from=and gate IEC]{north east}%
+ \inheritanchor[from=and gate IEC]{north west}%
+ \inheritanchor[from=and gate IEC]{south east}%
+ \inheritanchor[from=and gate IEC]{south west}%
+ \inheritanchor[from=and gate IEC]{output}%
+ \inheritbackgroundpath[from=and gate IEC]%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{or}}%
+ \inheritanchorborder[from=and gate IEC]%
+}%
@@ -408,7 +408,7 @@
% Shape nor gate IEC
%
-\pgfdeclareshape{nor gate IEC}{
+\pgfdeclareshape{nor gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nor gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
%
@@ -432,43 +432,43 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{nor}%
- }
+ }%
\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%
- }
- \inheritanchor[from=and gate IEC]{center}
- \inheritanchor[from=and gate IEC]{mid}
- \inheritanchor[from=and gate IEC]{mid west}
- \inheritanchor[from=and gate IEC]{mid east}
- \inheritanchor[from=and gate IEC]{base}
- \inheritanchor[from=and gate IEC]{base west}
- \inheritanchor[from=and gate IEC]{base east}
- \inheritanchor[from=and gate IEC]{north}
- \inheritanchor[from=and gate IEC]{south}
- \inheritanchor[from=and gate IEC]{east}
- \inheritanchor[from=and gate IEC]{west}
- \inheritanchor[from=and gate IEC]{north east}
- \inheritanchor[from=and gate IEC]{north west}
- \inheritanchor[from=and gate IEC]{south east}
- \inheritanchor[from=and gate IEC]{south west}
- \inheritanchor[from=nand gate IEC]{output}%
- \inheritbackgroundpath[from=nand gate IEC]
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{nor}}
- \inheritanchorborder[from=and gate IEC]
-}
+ }%
+ \inheritanchor[from=and gate IEC]{center}%
+ \inheritanchor[from=and gate IEC]{mid}%
+ \inheritanchor[from=and gate IEC]{mid west}%
+ \inheritanchor[from=and gate IEC]{mid east}%
+ \inheritanchor[from=and gate IEC]{base}%
+ \inheritanchor[from=and gate IEC]{base west}%
+ \inheritanchor[from=and gate IEC]{base east}%
+ \inheritanchor[from=and gate IEC]{north}%
+ \inheritanchor[from=and gate IEC]{south}%
+ \inheritanchor[from=and gate IEC]{east}%
+ \inheritanchor[from=and gate IEC]{west}%
+ \inheritanchor[from=and gate IEC]{north east}%
+ \inheritanchor[from=and gate IEC]{north west}%
+ \inheritanchor[from=and gate IEC]{south east}%
+ \inheritanchor[from=and gate IEC]{south west}%
+ \inheritanchor[from=nand gate IEC]{output}%%
+ \inheritbackgroundpath[from=nand gate IEC]%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{nor}}%
+ \inheritanchorborder[from=and gate IEC]%
+}%
@@ -476,7 +476,7 @@
% Shape xor gate IEC
%
-\pgfdeclareshape{xor gate IEC}{
+\pgfdeclareshape{xor gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xor gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{2}% Maximum 1024 (!) inputs.
%
@@ -500,43 +500,43 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{xor}%
- }
+ }%
\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%
- }
- \inheritanchor[from=and gate IEC]{center}
- \inheritanchor[from=and gate IEC]{mid}
- \inheritanchor[from=and gate IEC]{mid west}
- \inheritanchor[from=and gate IEC]{mid east}
- \inheritanchor[from=and gate IEC]{base}
- \inheritanchor[from=and gate IEC]{base west}
- \inheritanchor[from=and gate IEC]{base east}
- \inheritanchor[from=and gate IEC]{north}
- \inheritanchor[from=and gate IEC]{south}
- \inheritanchor[from=and gate IEC]{east}
- \inheritanchor[from=and gate IEC]{west}
- \inheritanchor[from=and gate IEC]{north east}
- \inheritanchor[from=and gate IEC]{north west}
- \inheritanchor[from=and gate IEC]{south east}
- \inheritanchor[from=and gate IEC]{south west}
- \inheritanchor[from=and gate IEC]{output}
- \inheritbackgroundpath[from=and gate IEC]
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{xor}}
- \inheritanchorborder[from=and gate IEC]
-}
+ }%
+ \inheritanchor[from=and gate IEC]{center}%
+ \inheritanchor[from=and gate IEC]{mid}%
+ \inheritanchor[from=and gate IEC]{mid west}%
+ \inheritanchor[from=and gate IEC]{mid east}%
+ \inheritanchor[from=and gate IEC]{base}%
+ \inheritanchor[from=and gate IEC]{base west}%
+ \inheritanchor[from=and gate IEC]{base east}%
+ \inheritanchor[from=and gate IEC]{north}%
+ \inheritanchor[from=and gate IEC]{south}%
+ \inheritanchor[from=and gate IEC]{east}%
+ \inheritanchor[from=and gate IEC]{west}%
+ \inheritanchor[from=and gate IEC]{north east}%
+ \inheritanchor[from=and gate IEC]{north west}%
+ \inheritanchor[from=and gate IEC]{south east}%
+ \inheritanchor[from=and gate IEC]{south west}%
+ \inheritanchor[from=and gate IEC]{output}%
+ \inheritbackgroundpath[from=and gate IEC]%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{xor}}%
+ \inheritanchorborder[from=and gate IEC]%
+}%
@@ -544,7 +544,7 @@
% Shape xnor gate IEC
%
-\pgfdeclareshape{xnor gate IEC}{
+\pgfdeclareshape{xnor gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xnor gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
%
@@ -568,50 +568,50 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{xnor}%
- }
+ }%
\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%
- }
- \inheritanchor[from=and gate IEC]{center}
- \inheritanchor[from=and gate IEC]{mid}
- \inheritanchor[from=and gate IEC]{mid west}
- \inheritanchor[from=and gate IEC]{mid east}
- \inheritanchor[from=and gate IEC]{base}
- \inheritanchor[from=and gate IEC]{base west}
- \inheritanchor[from=and gate IEC]{base east}
- \inheritanchor[from=and gate IEC]{north}
- \inheritanchor[from=and gate IEC]{south}
- \inheritanchor[from=and gate IEC]{east}
- \inheritanchor[from=and gate IEC]{west}
- \inheritanchor[from=and gate IEC]{north east}
- \inheritanchor[from=and gate IEC]{north west}
- \inheritanchor[from=and gate IEC]{south east}
- \inheritanchor[from=and gate IEC]{south west}
- \inheritanchor[from=nand gate IEC]{output}
- \inheritbackgroundpath[from=nand gate IEC]
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{xnor}}
- \inheritanchorborder[from=and gate IEC]
-}
+ }%
+ \inheritanchor[from=and gate IEC]{center}%
+ \inheritanchor[from=and gate IEC]{mid}%
+ \inheritanchor[from=and gate IEC]{mid west}%
+ \inheritanchor[from=and gate IEC]{mid east}%
+ \inheritanchor[from=and gate IEC]{base}%
+ \inheritanchor[from=and gate IEC]{base west}%
+ \inheritanchor[from=and gate IEC]{base east}%
+ \inheritanchor[from=and gate IEC]{north}%
+ \inheritanchor[from=and gate IEC]{south}%
+ \inheritanchor[from=and gate IEC]{east}%
+ \inheritanchor[from=and gate IEC]{west}%
+ \inheritanchor[from=and gate IEC]{north east}%
+ \inheritanchor[from=and gate IEC]{north west}%
+ \inheritanchor[from=and gate IEC]{south east}%
+ \inheritanchor[from=and gate IEC]{south west}%
+ \inheritanchor[from=nand gate IEC]{output}%
+ \inheritbackgroundpath[from=nand gate IEC]%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{xnor}}%
+ \inheritanchorborder[from=and gate IEC]%
+}%
% Shape buffer gate IEC
%
-\pgfdeclareshape{buffer gate IEC}{
+\pgfdeclareshape{buffer gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@buffer gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{1}% Maximum 1 input.
%
@@ -629,43 +629,43 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{xor}%
- }
+ }%
\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%
- }
- \inheritanchor[from=and gate IEC]{center}
- \inheritanchor[from=and gate IEC]{mid}
- \inheritanchor[from=and gate IEC]{mid west}
- \inheritanchor[from=and gate IEC]{mid east}
- \inheritanchor[from=and gate IEC]{base}
- \inheritanchor[from=and gate IEC]{base west}
- \inheritanchor[from=and gate IEC]{base east}
- \inheritanchor[from=and gate IEC]{north}
- \inheritanchor[from=and gate IEC]{south}
- \inheritanchor[from=and gate IEC]{east}
- \inheritanchor[from=and gate IEC]{west}
- \inheritanchor[from=and gate IEC]{north east}
- \inheritanchor[from=and gate IEC]{north west}
- \inheritanchor[from=and gate IEC]{south east}
- \inheritanchor[from=and gate IEC]{south west}
- \inheritanchor[from=and gate IEC]{output}
- \inheritbackgroundpath[from=and gate IEC]
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{buffer}}
- \inheritanchorborder[from=and gate IEC]
-}
+ }%
+ \inheritanchor[from=and gate IEC]{center}%
+ \inheritanchor[from=and gate IEC]{mid}%
+ \inheritanchor[from=and gate IEC]{mid west}%
+ \inheritanchor[from=and gate IEC]{mid east}%
+ \inheritanchor[from=and gate IEC]{base}%
+ \inheritanchor[from=and gate IEC]{base west}%
+ \inheritanchor[from=and gate IEC]{base east}%
+ \inheritanchor[from=and gate IEC]{north}%
+ \inheritanchor[from=and gate IEC]{south}%
+ \inheritanchor[from=and gate IEC]{east}%
+ \inheritanchor[from=and gate IEC]{west}%
+ \inheritanchor[from=and gate IEC]{north east}%
+ \inheritanchor[from=and gate IEC]{north west}%
+ \inheritanchor[from=and gate IEC]{south east}%
+ \inheritanchor[from=and gate IEC]{south west}%
+ \inheritanchor[from=and gate IEC]{output}%
+ \inheritbackgroundpath[from=and gate IEC]%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{buffer}}%
+ \inheritanchorborder[from=and gate IEC]%
+}%
@@ -673,7 +673,7 @@
% Shape not gate IEC
%
-\pgfdeclareshape{not gate IEC}{
+\pgfdeclareshape{not gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@not gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{1}%
%
@@ -692,42 +692,42 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{not}%
- }
+ }%
\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%
- }
- \inheritanchor[from=and gate IEC]{center}
- \inheritanchor[from=and gate IEC]{mid}
- \inheritanchor[from=and gate IEC]{mid west}
- \inheritanchor[from=and gate IEC]{mid east}
- \inheritanchor[from=and gate IEC]{base}
- \inheritanchor[from=and gate IEC]{base west}
- \inheritanchor[from=and gate IEC]{base east}
- \inheritanchor[from=and gate IEC]{north}
- \inheritanchor[from=and gate IEC]{south}
- \inheritanchor[from=and gate IEC]{east}
- \inheritanchor[from=and gate IEC]{west}
- \inheritanchor[from=and gate IEC]{north east}
- \inheritanchor[from=and gate IEC]{north west}
- \inheritanchor[from=and gate IEC]{south east}
- \inheritanchor[from=and gate IEC]{south west}
- \inheritanchor[from=nand gate IEC]{output}
- \inheritbackgroundpath[from=nand gate IEC]
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{not}}
- \inheritanchorborder[from=and gate IEC]
-}
-
-\endinput \ No newline at end of file
+ }%
+ \inheritanchor[from=and gate IEC]{center}%
+ \inheritanchor[from=and gate IEC]{mid}%
+ \inheritanchor[from=and gate IEC]{mid west}%
+ \inheritanchor[from=and gate IEC]{mid east}%
+ \inheritanchor[from=and gate IEC]{base}%
+ \inheritanchor[from=and gate IEC]{base west}%
+ \inheritanchor[from=and gate IEC]{base east}%
+ \inheritanchor[from=and gate IEC]{north}%
+ \inheritanchor[from=and gate IEC]{south}%
+ \inheritanchor[from=and gate IEC]{east}%
+ \inheritanchor[from=and gate IEC]{west}%
+ \inheritanchor[from=and gate IEC]{north east}%
+ \inheritanchor[from=and gate IEC]{north west}%
+ \inheritanchor[from=and gate IEC]{south east}%
+ \inheritanchor[from=and gate IEC]{south west}%
+ \inheritanchor[from=nand gate IEC]{output}%
+ \inheritbackgroundpath[from=nand gate IEC]%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{not}}%
+ \inheritanchorborder[from=and gate IEC]%
+}%
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex
index f941abd2647..3a496324f81 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgflibrary{shapes.gates.logic}
+\usepgflibrary{shapes.gates.logic}%
\newif\ifpgfgateanchorsuseboundingrectangle%
@@ -17,160 +17,160 @@
%
\pgfkeys{
/pgf/logic gate anchors use bounding box/.is if=pgfgateanchorsuseboundingrectangle,%
-}
+}%
-% An internal macro for calculating internal dimensions of
+% An internal macro for calculating internal dimensions of
% the US + CDH gates (excluding and gate US and nand gate US).
%
\def\pgf@lib@sh@logicgates@dimensions@orUS{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\dp\pgfnodeparttextbox%
- %
- % Adjust the height for the number of inputs.
- %
- \c@pgf@counta\pgf@lib@sh@logicgate@numinputs%
- \advance\c@pgf@counta1\relax%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@ya\pgflinewidth%
- \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/logic gate input sep}}%
- \pgf@yb.5\pgf@yb%
- \ifdim\pgf@ya<\pgf@yb%
- \pgf@ya\pgf@yb%
- \fi%
- \multiply\pgf@ya\c@pgf@counta%
- \ifdim\pgf@y<\pgf@ya%
- \pgf@y\pgf@ya%
- \fi%
- %
- \ifdim\pgf@x>\pgf@y%
- \pgf@y\pgf@x%
- \else%
- \pgf@x\pgf@y%
- \fi%
- %
- % Adjust for minimum height and width.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@y<.5\pgf@ya%
- \pgf@y.5\pgf@ya%
- \fi%
- \pgf@xb\pgf@x%
- \advance\pgf@xb1.732051\pgf@y% 2y*cos(30)
- \ifdim\pgf@xb<\pgf@xa%
- \pgf@xb\pgf@xa%
- \pgf@x0.366025\pgf@xb% xb / (1 + 2*cos(30))
- \fi%
- %
- \ifdim\pgf@x>\pgf@y%
- \pgf@y\pgf@x%
- \else%
- \pgf@x\pgf@y%
- \fi%
- \edef\halfside{\the\pgf@x}%
- \addtosavedmacro\halfside%
- %
- % Take into account the outer sep.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
- \edef\outerxsep{\the\pgf@xa}%
- \edef\outerysep{\the\pgf@ya}%
- \addtosavedmacro\outerxsep%
- \addtosavedmacro\outerysep%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- %
- \edef\halfwidth{\the\pgf@x}%
- \edef\halfheight{\the\pgf@y}%
- \addtosavedmacro\halfwidth%
- \addtosavedmacro\halfheight%
- %
- \pgfextract@process\tipanchor{%
- \advance\pgf@x-\pgf@xa%
- \advance\pgf@y-\pgf@ya%
- \pgf@x-.16666\pgf@x%
- \pgf@yb2.0\pgf@y%
- \advance\pgf@x.866025\pgf@yb%
- \advance\pgf@x1.154701\pgf@xa%
- \pgf@y0pt%
- }%
- \addtosavedmacro\tipanchor%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y.5\dp\pgfnodeparttextbox%
+ %
+ % Adjust the height for the number of inputs.
+ %
+ \c@pgf@counta\pgf@lib@sh@logicgate@numinputs%
+ \advance\c@pgf@counta1\relax%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@ya\pgflinewidth%
+ \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/logic gate input sep}}%
+ \pgf@yb.5\pgf@yb%
+ \ifdim\pgf@ya<\pgf@yb%
+ \pgf@ya\pgf@yb%
+ \fi%
+ \multiply\pgf@ya\c@pgf@counta%
+ \ifdim\pgf@y<\pgf@ya%
+ \pgf@y\pgf@ya%
+ \fi%
+ %
+ \ifdim\pgf@x>\pgf@y%
+ \pgf@y\pgf@x%
+ \else%
+ \pgf@x\pgf@y%
+ \fi%
+ %
+ % Adjust for minimum height and width.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@y<.5\pgf@ya%
+ \pgf@y.5\pgf@ya%
+ \fi%
+ \pgf@xb\pgf@x%
+ \advance\pgf@xb1.732051\pgf@y% 2y*cos(30)
+ \ifdim\pgf@xb<\pgf@xa%
+ \pgf@xb\pgf@xa%
+ \pgf@x0.366025\pgf@xb% xb / (1 + 2*cos(30))
+ \fi%
+ %
+ \ifdim\pgf@x>\pgf@y%
+ \pgf@y\pgf@x%
+ \else%
+ \pgf@x\pgf@y%
+ \fi%
+ \edef\halfside{\the\pgf@x}%
+ \addtosavedmacro\halfside%
+ %
+ % Take into account the outer sep.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \edef\outerxsep{\the\pgf@xa}%
+ \edef\outerysep{\the\pgf@ya}%
+ \addtosavedmacro\outerxsep%
+ \addtosavedmacro\outerysep%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ %
+ \edef\halfwidth{\the\pgf@x}%
+ \edef\halfheight{\the\pgf@y}%
+ \addtosavedmacro\halfwidth%
+ \addtosavedmacro\halfheight%
+ %
+ \pgfextract@process\tipanchor{%
+ \advance\pgf@x-\pgf@xa%
+ \advance\pgf@y-\pgf@ya%
+ \pgf@x-.16666\pgf@x%
+ \pgf@yb2.0\pgf@y%
+ \advance\pgf@x.866025\pgf@yb%
+ \advance\pgf@x1.154701\pgf@xa%
+ \pgf@y0pt%
+ }%
+ \addtosavedmacro\tipanchor%
}%
-% An internal macro for calculating internal dimensions of
+% An internal macro for calculating internal dimensions of
% the and gate US and nand gate US.
%
\def\pgf@lib@sh@logicgates@dimensions@andUS{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\dp\pgfnodeparttextbox%
- %
- % Adjust the height for the number of inputs.
- %
- \c@pgf@counta\pgf@lib@sh@logicgate@numinputs%
- \advance\c@pgf@counta1\relax%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@ya\pgflinewidth%
- \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/logic gate input sep}}%
- \pgf@yb.5\pgf@yb%
- \ifdim\pgf@ya<\pgf@yb%
- \pgf@ya\pgf@yb%
- \fi%
- \multiply\pgf@ya\c@pgf@counta%
- \ifdim\pgf@y<\pgf@ya%
- \pgf@y\pgf@ya%
- \fi%
- %
- \ifdim\pgf@x>\pgf@y%
- \pgf@y\pgf@x%
- \else%
- \pgf@x\pgf@y%
- \fi%
- %
- % Adjust for minimum height and width.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@y<.5\pgf@ya%
- \pgf@y.5\pgf@ya%
- \fi%
- \pgf@xb2.5\pgf@x%
- \ifdim\pgf@xb<\pgf@xa%
- \pgf@xb\pgf@xa%
- \pgf@x0.4\pgf@xb%
- \fi%
- %
- \ifdim\pgf@x>\pgf@y%
- \pgf@y\pgf@x%
- \else%
- \pgf@x\pgf@y%
- \fi%
- \edef\halfside{\the\pgf@x}%
- \addtosavedmacro\halfside%
- %
- % Take into account the outer sep.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
- \edef\outerxsep{\the\pgf@xa}%
- \edef\outerysep{\the\pgf@ya}%
- \addtosavedmacro\outerxsep%
- \addtosavedmacro\outerysep%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- %
- \edef\halfwidth{\the\pgf@x}%
- \edef\halfheight{\the\pgf@y}%
- \addtosavedmacro\halfwidth%
- \addtosavedmacro\halfheight%
- %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y.5\dp\pgfnodeparttextbox%
+ %
+ % Adjust the height for the number of inputs.
+ %
+ \c@pgf@counta\pgf@lib@sh@logicgate@numinputs%
+ \advance\c@pgf@counta1\relax%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@ya\pgflinewidth%
+ \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/logic gate input sep}}%
+ \pgf@yb.5\pgf@yb%
+ \ifdim\pgf@ya<\pgf@yb%
+ \pgf@ya\pgf@yb%
+ \fi%
+ \multiply\pgf@ya\c@pgf@counta%
+ \ifdim\pgf@y<\pgf@ya%
+ \pgf@y\pgf@ya%
+ \fi%
+ %
+ \ifdim\pgf@x>\pgf@y%
+ \pgf@y\pgf@x%
+ \else%
+ \pgf@x\pgf@y%
+ \fi%
+ %
+ % Adjust for minimum height and width.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@y<.5\pgf@ya%
+ \pgf@y.5\pgf@ya%
+ \fi%
+ \pgf@xb2.5\pgf@x%
+ \ifdim\pgf@xb<\pgf@xa%
+ \pgf@xb\pgf@xa%
+ \pgf@x0.4\pgf@xb%
+ \fi%
+ %
+ \ifdim\pgf@x>\pgf@y%
+ \pgf@y\pgf@x%
+ \else%
+ \pgf@x\pgf@y%
+ \fi%
+ \edef\halfside{\the\pgf@x}%
+ \addtosavedmacro\halfside%
+ %
+ % Take into account the outer sep.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \edef\outerxsep{\the\pgf@xa}%
+ \edef\outerysep{\the\pgf@ya}%
+ \addtosavedmacro\outerxsep%
+ \addtosavedmacro\outerysep%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ %
+ \edef\halfwidth{\the\pgf@x}%
+ \edef\halfheight{\the\pgf@y}%
+ \addtosavedmacro\halfwidth%
+ \addtosavedmacro\halfheight%
+ %
}%
@@ -178,25 +178,25 @@
% both and gates and nand gates, and also the not gate and buffer.
%
\def\pgf@lib@sh@logicgate@AND@inputanchor#1{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-.166666\pgf@xa%
- \advance\pgf@x-\halfwidth%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-#1\endcsname%
- \advance\pgf@x-\invertedradius%
- \advance\pgf@x-\outerinvertedradius%
- \fi%
- %
- \pgfutil@tempdima\halfside%
- \multiply\pgfutil@tempdima2\relax%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \multiply\pgfutil@tempdima#1\relax%
- \advance\pgf@y\halfside%
- \advance\pgf@y-\pgfutil@tempdima%
-}
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-.166666\pgf@xa%
+ \advance\pgf@x-\halfwidth%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-#1\endcsname%
+ \advance\pgf@x-\invertedradius%
+ \advance\pgf@x-\outerinvertedradius%
+ \fi%
+ %
+ \pgfutil@tempdima\halfside%
+ \multiply\pgfutil@tempdima2\relax%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \multiply\pgfutil@tempdima#1\relax%
+ \advance\pgf@y\halfside%
+ \advance\pgf@y-\pgfutil@tempdima%
+}%
@@ -204,235 +204,235 @@
% Shape and gate US
%
\pgfdeclareshape{and gate US}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@and gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@and gate US@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@and gate US@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{An and gate must have at least two inputs}%
- \fi%
- }%
- \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
- \saveddimen\invertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- }%
- \saveddimen\outerinvertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@x.5\pgflinewidth%
- }
- \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@andUS}
- \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}{%
- \csname pgf@anchor@and gate US@east\endcsname%
- \pgf@xa\pgf@x%
- \midpoint%
- \pgf@x\pgf@xa}
- \anchor{mid west}{%
- \csname pgf@anchor@and gate US@west\endcsname%
- \pgf@xa\pgf@x%
- \midpoint%
- \pgf@x\pgf@xa}
- \anchor{base}{\basepoint}%
- \anchor{base east}{%
- \csname pgf@anchor@and gate US@east\endcsname%
- \pgf@xa\pgf@x%
- \basepoint%
- \pgf@x\pgf@xa}
- \anchor{base west}{%
- \csname pgf@anchor@and gate US@west\endcsname%
- \pgf@xa\pgf@x%
- \basepoint%
- \pgf@x\pgf@xa}
- \anchor{east}{%
- \dimensions%
- \pgf@xa\halfwidth%
- \pgf@xb\pgf@xa%
- \advance\pgf@xb-\outerxsep%
- \centerpoint%
- \advance\pgf@x.333333\pgf@xb%
- \advance\pgf@x\pgf@xa%
- }
- \anchor{output}{\csname pgf@anchor@and gate US@east\endcsname}
- \anchor{north east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \csname pgf@anchor@nand gate US@east\endcsname%
- \advance\pgf@y\halfheight%
- \else
- \pgf@xa\halfwidth%
- \pgf@ya\halfheight%
- \pgf@xb\pgf@xa%
- \advance\pgf@xb-\outerxsep%
- \centerpoint%
- \advance\pgf@x.333333\pgf@xb%
- \advance\pgf@x.707106\pgf@xa%
- \advance\pgf@y.707106\pgf@ya%
- \fi%
- }
- \anchor{south east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \csname pgf@anchor@nand gate US@east\endcsname%
- \advance\pgf@y-\halfheight%
- \else
- \pgf@xa\halfwidth%
- \pgf@ya\halfheight%
- \pgf@xb\pgf@xa%
- \advance\pgf@xb-\outerxsep%
- \centerpoint%
- \advance\pgf@x.333333\pgf@xb%
- \advance\pgf@x.707106\pgf@xa%
- \advance\pgf@y-.707106\pgf@ya%
- \fi%
- }
- \anchor{north}{%
- \dimensions%
- \centerpoint%
- \advance\pgf@y\halfheight%
- }
- \anchor{south}{%
- \dimensions%
- \centerpoint%
- \advance\pgf@y-\halfheight%
- }
- \anchor{south west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \advance\pgf@y-\halfheight%
- }
- \anchor{north west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \advance\pgf@y\halfheight%
- }
- \anchor{west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- }
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- \pgf@xb.333333\pgf@xc%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@yc}}%
- {%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
- \pgfpathclose%
- %
- % Draw the inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@xa\halfside%
- \pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-.5\pgflinewidth%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- }%
- }%
- \anchorborder{%
- \pgfextract@process\externalpoint{}%
- \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
- \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
- \let\externalangle\pgfmathresult%
- \dimensions%
- \pgf@xb\halfside%
- \pgf@xc1.66666\pgf@xb%
- \advance\pgf@xc\outerxsep%
- \pgf@yc\halfheight%
- \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@and gate US@north west\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\centerpoint}{\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y\pgf@yc}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@x.333333\pgf@xb%
- }%
- {0}{90}{+\halfwidth and +\halfheight}%
- \else%
- \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
- {\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y\pgf@yc}%
- {\centerpoint\advance\pgf@x-\pgf@xc\advance\pgf@y\pgf@yc}%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\centerpoint}{\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y-\pgf@yc}%
- \ifdim\externalangle pt>\pgfmathresult pt\relax%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@x.333333\pgf@xb%
- }%
- {270}{360}{+\halfwidth and +\halfheight}%
- \else%
- \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@and gate US@south west\endcsname}%
- \ifdim\externalangle pt>\pgfmathresult pt\relax%
- \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
- {\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y-\pgf@yc}%
- {\csname pgf@anchor@and gate US@south west\endcsname}%
- \else%
- \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
- {\csname pgf@anchor@and gate US@north west\endcsname}%
- {\csname pgf@anchor@and gate US@south west\endcsname}%
- \fi%
- \fi%
- \fi%
- }
-}
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@and gate US\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@and gate US@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@and gate US@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{An and gate must have at least two inputs}%
+ \fi%
+ }%
+ \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
+ \saveddimen\invertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ }%
+ \saveddimen\outerinvertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@x.5\pgflinewidth%
+ }%
+ \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@andUS}%
+ \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}{%
+ \csname pgf@anchor@and gate US@east\endcsname%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \pgf@x\pgf@xa}%
+ \anchor{mid west}{%
+ \csname pgf@anchor@and gate US@west\endcsname%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \pgf@x\pgf@xa}%
+ \anchor{base}{\basepoint}%
+ \anchor{base east}{%
+ \csname pgf@anchor@and gate US@east\endcsname%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \pgf@x\pgf@xa}%
+ \anchor{base west}{%
+ \csname pgf@anchor@and gate US@west\endcsname%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \pgf@x\pgf@xa}%
+ \anchor{east}{%
+ \dimensions%
+ \pgf@xa\halfwidth%
+ \pgf@xb\pgf@xa%
+ \advance\pgf@xb-\outerxsep%
+ \centerpoint%
+ \advance\pgf@x.333333\pgf@xb%
+ \advance\pgf@x\pgf@xa%
+ }%
+ \anchor{output}{\csname pgf@anchor@and gate US@east\endcsname}%
+ \anchor{north east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \csname pgf@anchor@nand gate US@east\endcsname%
+ \advance\pgf@y\halfheight%
+ \else
+ \pgf@xa\halfwidth%
+ \pgf@ya\halfheight%
+ \pgf@xb\pgf@xa%
+ \advance\pgf@xb-\outerxsep%
+ \centerpoint%
+ \advance\pgf@x.333333\pgf@xb%
+ \advance\pgf@x.707106\pgf@xa%
+ \advance\pgf@y.707106\pgf@ya%
+ \fi%
+ }%
+ \anchor{south east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \csname pgf@anchor@nand gate US@east\endcsname%
+ \advance\pgf@y-\halfheight%
+ \else
+ \pgf@xa\halfwidth%
+ \pgf@ya\halfheight%
+ \pgf@xb\pgf@xa%
+ \advance\pgf@xb-\outerxsep%
+ \centerpoint%
+ \advance\pgf@x.333333\pgf@xb%
+ \advance\pgf@x.707106\pgf@xa%
+ \advance\pgf@y-.707106\pgf@ya%
+ \fi%
+ }%
+ \anchor{north}{%
+ \dimensions%
+ \centerpoint%
+ \advance\pgf@y\halfheight%
+ }%
+ \anchor{south}{%
+ \dimensions%
+ \centerpoint%
+ \advance\pgf@y-\halfheight%
+ }%
+ \anchor{south west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@y-\halfheight%
+ }%
+ \anchor{north west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@y\halfheight%
+ }%
+ \anchor{west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ }%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ \pgf@xb.333333\pgf@xc%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@yc}}%
+ {%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
+ \pgfpathclose%
+ %
+ % Draw the inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@xa\halfside%
+ \pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-.5\pgflinewidth%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ }%
+ }%
+ \anchorborder{%
+ \pgfextract@process\externalpoint{}%
+ \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
+ \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
+ \let\externalangle\pgfmathresult%
+ \dimensions%
+ \pgf@xb\halfside%
+ \pgf@xc1.66666\pgf@xb%
+ \advance\pgf@xc\outerxsep%
+ \pgf@yc\halfheight%
+ \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@and gate US@north west\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\centerpoint}{\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y\pgf@yc}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@x.333333\pgf@xb%
+ }%
+ {0}{90}{+\halfwidth and +\halfheight}%
+ \else%
+ \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
+ {\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y\pgf@yc}%
+ {\centerpoint\advance\pgf@x-\pgf@xc\advance\pgf@y\pgf@yc}%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\centerpoint}{\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y-\pgf@yc}%
+ \ifdim\externalangle pt>\pgfmathresult pt\relax%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@x.333333\pgf@xb%
+ }%
+ {270}{360}{+\halfwidth and +\halfheight}%
+ \else%
+ \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@and gate US@south west\endcsname}%
+ \ifdim\externalangle pt>\pgfmathresult pt\relax%
+ \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
+ {\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y-\pgf@yc}%
+ {\csname pgf@anchor@and gate US@south west\endcsname}%
+ \else%
+ \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
+ {\csname pgf@anchor@and gate US@north west\endcsname}%
+ {\csname pgf@anchor@and gate US@south west\endcsname}%
+ \fi%
+ \fi%
+ \fi%
+ }%
+}%
@@ -441,512 +441,512 @@
% Shape nand gate US
%
\pgfdeclareshape{nand gate US}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nand gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@nand gate US@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@nand gate US@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{A nand gate must have at least two inputs}%
- \fi%
- }%
- \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
- \saveddimen\invertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- }%
- \saveddimen\outerinvertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@x.5\pgflinewidth%
- }
- \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@andUS}
- \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}%
- \inheritanchor[from=and gate US]{mid}
- \inheritanchor[from=and gate US]{mid east}
- \inheritanchor[from=and gate US]{mid west}
- \inheritanchor[from=and gate US]{base}
- \inheritanchor[from=and gate US]{base east}
- \inheritanchor[from=and gate US]{base west}
- \anchor{output}{%
- \dimensions
- \pgfpointadd{\centerpoint}{%
- \pgf@xa\halfside%
- \pgf@x1.33333\pgf@xa%
- \advance\pgf@x\invertedradius%
- \advance\pgf@x\outerinvertedradius%
- \advance\pgf@x\outerxsep%
- \pgf@y0pt%
- }%
- }
- \inheritanchor[from=and gate US]{east}
- \inheritanchor[from=and gate US]{north east}
- \inheritanchor[from=and gate US]{south east}
- \inheritanchor[from=and gate US]{north}
- \inheritanchor[from=and gate US]{south}
- \inheritanchor[from=and gate US]{south west}
- \inheritanchor[from=and gate US]{north west}
- \inheritanchor[from=and gate US]{west}
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- \pgf@xb.333333\pgf@xc%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@yc}}%
- {%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
- \pgfpathclose%
- %
- % Draw the inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@xa\halfside%
- \pgf@x-1.166666\pgf@xa%
- \advance\pgf@x-.5\pgflinewidth%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- %
- % Draw the output inverter.
- %
- {%
- \pgfpathcircle{%
- \pgf@x1.33333\pgf@xc%
- \advance\pgf@x\outerinvertedradius%
- \pgf@y0pt%
- }{+\invertedradius}%
- }%
- }%
- }
- \inheritanchorborder[from=and gate US]
-}
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nand gate US\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@nand gate US@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@nand gate US@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{A nand gate must have at least two inputs}%
+ \fi%
+ }%
+ \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
+ \saveddimen\invertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ }%
+ \saveddimen\outerinvertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@x.5\pgflinewidth%
+ }%
+ \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@andUS}%
+ \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}%
+ \inheritanchor[from=and gate US]{mid}%
+ \inheritanchor[from=and gate US]{mid east}%
+ \inheritanchor[from=and gate US]{mid west}%
+ \inheritanchor[from=and gate US]{base}%
+ \inheritanchor[from=and gate US]{base east}%
+ \inheritanchor[from=and gate US]{base west}%
+ \anchor{output}{%
+ \dimensions
+ \pgfpointadd{\centerpoint}{%
+ \pgf@xa\halfside%
+ \pgf@x1.33333\pgf@xa%
+ \advance\pgf@x\invertedradius%
+ \advance\pgf@x\outerinvertedradius%
+ \advance\pgf@x\outerxsep%
+ \pgf@y0pt%
+ }%
+ }%
+ \inheritanchor[from=and gate US]{east}%
+ \inheritanchor[from=and gate US]{north east}%
+ \inheritanchor[from=and gate US]{south east}%
+ \inheritanchor[from=and gate US]{north}%
+ \inheritanchor[from=and gate US]{south}%
+ \inheritanchor[from=and gate US]{south west}%
+ \inheritanchor[from=and gate US]{north west}%
+ \inheritanchor[from=and gate US]{west}%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ \pgf@xb.333333\pgf@xc%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@yc}}%
+ {%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
+ \pgfpathclose%
+ %
+ % Draw the inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@xa\halfside%
+ \pgf@x-1.166666\pgf@xa%
+ \advance\pgf@x-.5\pgflinewidth%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ %
+ % Draw the output inverter.
+ %
+ {%
+ \pgfpathcircle{%
+ \pgf@x1.33333\pgf@xc%
+ \advance\pgf@x\outerinvertedradius%
+ \pgf@y0pt%
+ }{+\invertedradius}%
+ }%
+ }%
+ }%
+ \inheritanchorborder[from=and gate US]%
+}%
% Internal macro for calculation input anchors. Used by
% or, nor xnor gates (US).
%
\def\pgf@lib@sh@logicgate@OR@inputanchor#1{%
- \dimensions%
- \pgf@ya\halfside%
- \pgf@yb2.0\pgf@ya%
- %
- \pgfutil@tempdima\halfside%
- \multiply\pgfutil@tempdima2\relax%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \multiply\pgfutil@tempdima#1\relax%
- \pgf@yc\pgf@ya%
- \advance\pgf@yc-\pgfutil@tempdima%
- %
- \pgf@xb\pgf@yb%
- \advance\pgf@yb-\halflinewidth%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- %
- \pgf@xc-1.166666\pgf@ya%
- \advance\pgf@xc-.866025\pgf@xb%
- \advance\pgf@xc\pgfmathresult\pgf@yb%
- \advance\pgf@xc\halflinewidth%
- \advance\pgf@xc-\outerxsep%
- %
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-#1\endcsname%
- \advance\pgf@xc-\invertedradius%
- \advance\pgf@xc-\outerinvertedradius%
- \fi%
- %
- \centerpoint%
- \advance\pgf@x\pgf@xc%
- \advance\pgf@y\pgf@yc%
-}
+ \dimensions%
+ \pgf@ya\halfside%
+ \pgf@yb2.0\pgf@ya%
+ %
+ \pgfutil@tempdima\halfside%
+ \multiply\pgfutil@tempdima2\relax%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \multiply\pgfutil@tempdima#1\relax%
+ \pgf@yc\pgf@ya%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ %
+ \pgf@xb\pgf@yb%
+ \advance\pgf@yb-\halflinewidth%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ %
+ \pgf@xc-1.166666\pgf@ya%
+ \advance\pgf@xc-.866025\pgf@xb%
+ \advance\pgf@xc\pgfmathresult\pgf@yb%
+ \advance\pgf@xc\halflinewidth%
+ \advance\pgf@xc-\outerxsep%
+ %
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-#1\endcsname%
+ \advance\pgf@xc-\invertedradius%
+ \advance\pgf@xc-\outerinvertedradius%
+ \fi%
+ %
+ \centerpoint%
+ \advance\pgf@x\pgf@xc%
+ \advance\pgf@y\pgf@yc%
+}%
% Shape or gate US
%
\pgfdeclareshape{or gate US}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@or gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@or gate US@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@or gate US@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@OR@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{An or gate must have at least two inputs}%
- \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%
- }
- \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}{%
- \csname pgf@anchor@or gate US@east\endcsname%
- \pgf@xa\pgf@x%
- \midpoint%
- \pgf@x\pgf@xa}
- \anchor{mid west}{%
- \csname pgf@anchor@or gate US@north west\endcsname%
- \pgf@xa\pgf@x%
- \midpoint%
- \pgf@x\pgf@xa}
- \anchor{base}{\basepoint}%
- \anchor{base east}{%
- \csname pgf@anchor@or gate US@east\endcsname%
- \pgf@xa\pgf@x%
- \basepoint%
- \pgf@x\pgf@xa}
- \anchor{base west}{%
- \csname pgf@anchor@or gate US@north west\endcsname%
- \pgf@xa\pgf@x%
- \basepoint%
- \pgf@x\pgf@xa}
- \anchor{east}{%
- \dimensions%
- \pgfpointadd{\centerpoint}{\tipanchor}%
- }
- \anchor{output}{\csname pgf@anchor@or gate US@east\endcsname}
- \anchor{north east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \tipanchor%
- \pgf@xa\pgf@x%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\halfheight%
- \else%
- \centerpoint%
- \pgf@xa\halfwidth%
- \pgf@ya\halfheight%
- \pgf@xb\halfside%
- \advance\pgf@x-.166666\pgf@xb%
- \advance\pgf@xa\pgf@xb%
- \advance\pgf@x.5\pgf@xa%
- \advance\pgf@y-\pgf@xb%
- \advance\pgf@ya\pgf@xb%
- \advance\pgf@y.866025\pgf@ya%
- \fi%
- }
- \anchor{south east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \tipanchor%
- \pgf@xa\pgf@x%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y-\halfheight%
- \else
- \centerpoint%
- \pgf@xa\halfwidth%
- \pgf@ya\halfheight%
- \pgf@xb\halfside%
- \advance\pgf@x-.166666\pgf@xb%
- \advance\pgf@xa\pgf@xb%
- \advance\pgf@x.5\pgf@xa%
- \advance\pgf@y\pgf@xb%
- \advance\pgf@ya\pgf@xb%
- \advance\pgf@y-.866025\pgf@ya%
- \fi%
- }
- \anchor{north}{%
- \dimensions%
- \centerpoint%
- \ifpgfgateanchorsuseboundingrectangle%
- \advance\pgf@y\halfheight%
- \else%
- \pgf@ya\halfheight%
- \advance\pgf@y.993043\pgf@ya%
- \fi%
- }
- \anchor{south}{%
- \dimensions%
- \centerpoint%
- \ifpgfgateanchorsuseboundingrectangle%
- \advance\pgf@y-\halfheight%
- \else%
- \pgf@ya\halfheight%
- \advance\pgf@y-.993043\pgf@ya%
- \fi%
- }
- \anchor{south west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \pgf@xa\outerxsep%
- \advance\pgf@x-1.732050\pgf@xa%
- \advance\pgf@y-\halfheight%
- }
- \anchor{north west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \pgf@xa\outerxsep%
- \advance\pgf@x-1.732050\pgf@xa%
- \advance\pgf@y\halfheight%
- }
- \anchor{west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \ifpgfgateanchorsuseboundingrectangle%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \else%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \advance\pgf@x0.267949\pgf@xa%
- \fi%
- }
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \pgfpatharc{-30}{0}{+\pgf@yc}%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \pgfpatharc{0}{30}{+\pgf@yc}%
- }%
- \pgfpathclose%
- %
- % Draw the inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@ya\halfside%
- \pgf@yb2.0\pgf@ya%
- \pgf@xa\pgf@yb%
- \advance\pgf@yb-\halflinewidth%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
- \let\sineangle\pgfmathresult%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- %
- \pgf@x-1.166666\pgf@ya%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x\pgfmathresult\pgf@yb%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- }%
- }%
- \anchorborder{%
- \pgfextract@process\externalpoint{}%
- \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \centerpoint%
- \pgf@xb\pgf@x%
- \pgf@yb\pgf@y%
- \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
- \let\externalangle\pgfmathresult%
- \dimensions%
- \pgf@xc\halfside%
- %
- \pgf@xc-.166666\pgf@xc%
- \ifdim\pgf@xa<\pgf@xc%
- \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@or gate US@north west\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
- {%
- \pgfgateanchorsuseboundingrectangletrue%
- \csname pgf@anchor@or gate US@north\endcsname%
- }%
- {\csname pgf@anchor@or gate US@north west\endcsname}%
- \else%
- \pgfmathsubtract@{360}{\pgfmathresult}%
- \ifdim\externalangle pt>\pgfmathresult pt\relax%
- \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
- {%
- \pgfgateanchorsuseboundingrectangletrue%
- \csname pgf@anchor@or gate US@south\endcsname%
- }%
- {\csname pgf@anchor@or gate US@south west\endcsname}%
- \else%
- \ifdim\pgf@ya>\pgf@yb%
- \pgf@yc\halfheight%
- \advance\pgf@yc\halfside%
- \advance\pgf@yc-\outerxsep%
- \pgfextract@process\point{%
- \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
- {%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.166666\pgf@xa%
- \pgf@xa2.0\pgf@xa%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x-\outerxsep%
- }%
- {0}{90}{+\pgf@yc}%
- }%
- \else%
- \pgf@yc\halfheight%
- \advance\pgf@yc\halfside%
- \advance\pgf@yc-\outerxsep%
- \pgfextract@process\point{%
- \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
- {%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.166666\pgf@xa%
- \pgf@xa2.0\pgf@xa%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x-\outerxsep%
- }%
- {270}{360}{+\pgf@yc}%
- }%
- \fi%
- \fi%
- \fi%
- \else%
- \ifdim\pgf@y=0pt\relax%
- \csname pgf@anchor@and gate US@east\endcsname%
- \else%
- \pgf@xc\halfwidth%
- \advance\pgf@xc\halfside%
- \pgf@yc\halfheight%
- \advance\pgf@yc\halfside%
- \pgf@xb\halfside%
- \pgf@xb-.166666\pgf@xb%
- \ifdim\pgf@ya<0pt%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@y\halfside%
- \advance\pgf@x\pgf@xb%
- }%
- {270}{330}{+\pgf@yc}%
- \else%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@y-\halfside%
- \advance\pgf@x\pgf@xb%
- }%
- {30}{90}{+\pgf@xc and +\pgf@yc}%
- \fi%
- \fi%
- \fi%
- }%
-}
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@or gate US\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@or gate US@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@or gate US@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@OR@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{An or gate must have at least two inputs}%
+ \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%
+ }%
+ \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}{%
+ \csname pgf@anchor@or gate US@east\endcsname%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \pgf@x\pgf@xa}%
+ \anchor{mid west}{%
+ \csname pgf@anchor@or gate US@north west\endcsname%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \pgf@x\pgf@xa}%
+ \anchor{base}{\basepoint}%
+ \anchor{base east}{%
+ \csname pgf@anchor@or gate US@east\endcsname%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \pgf@x\pgf@xa}%
+ \anchor{base west}{%
+ \csname pgf@anchor@or gate US@north west\endcsname%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \pgf@x\pgf@xa}%
+ \anchor{east}{%
+ \dimensions%
+ \pgfpointadd{\centerpoint}{\tipanchor}%
+ }%
+ \anchor{output}{\csname pgf@anchor@or gate US@east\endcsname}%
+ \anchor{north east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \tipanchor%
+ \pgf@xa\pgf@x%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\halfheight%
+ \else%
+ \centerpoint%
+ \pgf@xa\halfwidth%
+ \pgf@ya\halfheight%
+ \pgf@xb\halfside%
+ \advance\pgf@x-.166666\pgf@xb%
+ \advance\pgf@xa\pgf@xb%
+ \advance\pgf@x.5\pgf@xa%
+ \advance\pgf@y-\pgf@xb%
+ \advance\pgf@ya\pgf@xb%
+ \advance\pgf@y.866025\pgf@ya%
+ \fi%
+ }%
+ \anchor{south east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \tipanchor%
+ \pgf@xa\pgf@x%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y-\halfheight%
+ \else
+ \centerpoint%
+ \pgf@xa\halfwidth%
+ \pgf@ya\halfheight%
+ \pgf@xb\halfside%
+ \advance\pgf@x-.166666\pgf@xb%
+ \advance\pgf@xa\pgf@xb%
+ \advance\pgf@x.5\pgf@xa%
+ \advance\pgf@y\pgf@xb%
+ \advance\pgf@ya\pgf@xb%
+ \advance\pgf@y-.866025\pgf@ya%
+ \fi%
+ }%
+ \anchor{north}{%
+ \dimensions%
+ \centerpoint%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \advance\pgf@y\halfheight%
+ \else%
+ \pgf@ya\halfheight%
+ \advance\pgf@y.993043\pgf@ya%
+ \fi%
+ }%
+ \anchor{south}{%
+ \dimensions%
+ \centerpoint%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \advance\pgf@y-\halfheight%
+ \else%
+ \pgf@ya\halfheight%
+ \advance\pgf@y-.993043\pgf@ya%
+ \fi%
+ }%
+ \anchor{south west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x-1.732050\pgf@xa%
+ \advance\pgf@y-\halfheight%
+ }%
+ \anchor{north west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x-1.732050\pgf@xa%
+ \advance\pgf@y\halfheight%
+ }%
+ \anchor{west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \else%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@x0.267949\pgf@xa%
+ \fi%
+ }%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \pgfpatharc{-30}{0}{+\pgf@yc}%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \pgfpatharc{0}{30}{+\pgf@yc}%
+ }%
+ \pgfpathclose%
+ %
+ % Draw the inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@ya\halfside%
+ \pgf@yb2.0\pgf@ya%
+ \pgf@xa\pgf@yb%
+ \advance\pgf@yb-\halflinewidth%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
+ \let\sineangle\pgfmathresult%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ %
+ \pgf@x-1.166666\pgf@ya%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x\pgfmathresult\pgf@yb%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ }%
+ }%
+ \anchorborder{%
+ \pgfextract@process\externalpoint{}%
+ \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \centerpoint%
+ \pgf@xb\pgf@x%
+ \pgf@yb\pgf@y%
+ \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
+ \let\externalangle\pgfmathresult%
+ \dimensions%
+ \pgf@xc\halfside%
+ %
+ \pgf@xc-.166666\pgf@xc%
+ \ifdim\pgf@xa<\pgf@xc%
+ \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@or gate US@north west\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
+ {%
+ \pgfgateanchorsuseboundingrectangletrue%
+ \csname pgf@anchor@or gate US@north\endcsname%
+ }%
+ {\csname pgf@anchor@or gate US@north west\endcsname}%
+ \else%
+ \pgfmathsubtract@{360}{\pgfmathresult}%
+ \ifdim\externalangle pt>\pgfmathresult pt\relax%
+ \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
+ {%
+ \pgfgateanchorsuseboundingrectangletrue%
+ \csname pgf@anchor@or gate US@south\endcsname%
+ }%
+ {\csname pgf@anchor@or gate US@south west\endcsname}%
+ \else%
+ \ifdim\pgf@ya>\pgf@yb%
+ \pgf@yc\halfheight%
+ \advance\pgf@yc\halfside%
+ \advance\pgf@yc-\outerxsep%
+ \pgfextract@process\point{%
+ \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
+ {%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.166666\pgf@xa%
+ \pgf@xa2.0\pgf@xa%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ }%
+ {0}{90}{+\pgf@yc}%
+ }%
+ \else%
+ \pgf@yc\halfheight%
+ \advance\pgf@yc\halfside%
+ \advance\pgf@yc-\outerxsep%
+ \pgfextract@process\point{%
+ \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
+ {%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.166666\pgf@xa%
+ \pgf@xa2.0\pgf@xa%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ }%
+ {270}{360}{+\pgf@yc}%
+ }%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \ifdim\pgf@y=0pt\relax%
+ \csname pgf@anchor@and gate US@east\endcsname%
+ \else%
+ \pgf@xc\halfwidth%
+ \advance\pgf@xc\halfside%
+ \pgf@yc\halfheight%
+ \advance\pgf@yc\halfside%
+ \pgf@xb\halfside%
+ \pgf@xb-.166666\pgf@xb%
+ \ifdim\pgf@ya<0pt%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@y\halfside%
+ \advance\pgf@x\pgf@xb%
+ }%
+ {270}{330}{+\pgf@yc}%
+ \else%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@y-\halfside%
+ \advance\pgf@x\pgf@xb%
+ }%
+ {30}{90}{+\pgf@xc and +\pgf@yc}%
+ \fi%
+ \fi%
+ \fi%
+ }%
+}%
@@ -954,154 +954,154 @@
% Shape nor gate US
%
\pgfdeclareshape{nor gate US}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nor gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@nor gate US@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@nor gate US@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@OR@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{A nor gate must have at least two inputs}%
- \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%
- }
- \inheritanchor[from=or gate US]{center}
- \inheritanchor[from=or gate US]{mid}
- \inheritanchor[from=or gate US]{mid east}
- \inheritanchor[from=or gate US]{mid west}
- \inheritanchor[from=or gate US]{base}
- \inheritanchor[from=or gate US]{base east}
- \inheritanchor[from=or gate US]{base west}
- \inheritanchor[from=or gate US]{east}
- \inheritanchor[from=or gate US]{north east}
- \inheritanchor[from=or gate US]{south east}
- \inheritanchor[from=or gate US]{north}
- \inheritanchor[from=or gate US]{south}
- \inheritanchor[from=or gate US]{south west}
- \inheritanchor[from=or gate US]{north west}
- \inheritanchor[from=or gate US]{west}
- \anchor{output}{%
- \dimensions%
- \centerpoint%
- \pgf@xc\halfside%
- \pgf@yc\pgf@xc%
- \advance\pgf@x-.166666\pgf@xc%
- \pgf@yc2.0\pgf@yc%
- \advance\pgf@x.866025\pgf@yc%
- \advance\pgf@x\outerinvertedradius%
- \advance\pgf@x\invertedradius%
- \advance\pgf@x\outerxsep%
- }%
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \pgfpatharc{-30}{0}{+\pgf@yc}%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \pgfpatharc{0}{30}{+\pgf@yc}%
- }%
- \pgfpathclose%
- % 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 inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@ya\halfside%
- \pgf@yb2.0\pgf@ya%
- \pgf@xa\pgf@yb%
- \advance\pgf@yb-\halflinewidth%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
- \let\sineangle\pgfmathresult%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- %
- \pgf@x-1.166666\pgf@ya%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x\pgfmathresult\pgf@yb%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- }%
- }%
- \inheritanchorborder[from=or gate US]
-}
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nor gate US\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@nor gate US@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@nor gate US@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@OR@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{A nor gate must have at least two inputs}%
+ \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%
+ }%
+ \inheritanchor[from=or gate US]{center}%
+ \inheritanchor[from=or gate US]{mid}%
+ \inheritanchor[from=or gate US]{mid east}%
+ \inheritanchor[from=or gate US]{mid west}%
+ \inheritanchor[from=or gate US]{base}%
+ \inheritanchor[from=or gate US]{base east}%
+ \inheritanchor[from=or gate US]{base west}%
+ \inheritanchor[from=or gate US]{east}%
+ \inheritanchor[from=or gate US]{north east}%
+ \inheritanchor[from=or gate US]{south east}%
+ \inheritanchor[from=or gate US]{north}%
+ \inheritanchor[from=or gate US]{south}%
+ \inheritanchor[from=or gate US]{south west}%
+ \inheritanchor[from=or gate US]{north west}%
+ \inheritanchor[from=or gate US]{west}%
+ \anchor{output}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xc\halfside%
+ \pgf@yc\pgf@xc%
+ \advance\pgf@x-.166666\pgf@xc%
+ \pgf@yc2.0\pgf@yc%
+ \advance\pgf@x.866025\pgf@yc%
+ \advance\pgf@x\outerinvertedradius%
+ \advance\pgf@x\invertedradius%
+ \advance\pgf@x\outerxsep%
+ }%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \pgfpatharc{-30}{0}{+\pgf@yc}%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \pgfpatharc{0}{30}{+\pgf@yc}%
+ }%
+ \pgfpathclose%
+ % 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 inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@ya\halfside%
+ \pgf@yb2.0\pgf@ya%
+ \pgf@xa\pgf@yb%
+ \advance\pgf@yb-\halflinewidth%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
+ \let\sineangle\pgfmathresult%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ %
+ \pgf@x-1.166666\pgf@ya%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x\pgfmathresult\pgf@yb%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ }%
+ }%
+ \inheritanchorborder[from=or gate US]%
+}%
@@ -1109,42 +1109,42 @@
% xor and xnor gates (US).
%
\def\pgf@lib@sh@logicgate@XOR@inputanchor#1{%
- \dimensions%
- \pgf@ya\halfside%
- \pgf@yb2.0\pgf@ya%
- %
- \pgfutil@tempdima\halfside%
- \multiply\pgfutil@tempdima2\relax%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \multiply\pgfutil@tempdima#1\relax%
- \pgf@yc\pgf@ya%
- \advance\pgf@yc-\pgfutil@tempdima%
- %
- \pgf@xb\pgf@yb%
- \advance\pgf@yb-\halflinewidth%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- %
- \pgf@xc-1.166666\pgf@ya%
- \advance\pgf@xc-.866025\pgf@xb%
- \advance\pgf@xc\pgfmathresult\pgf@yb%
- \advance\pgf@xc\halflinewidth%
- \advance\pgf@xc-\outerxsep%
- %
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-#1\endcsname%
- \advance\pgf@xc-\invertedradius%
- \advance\pgf@xc-\outerinvertedradius%
- \fi%
- %
- \centerpoint%
- \advance\pgf@x\pgf@xc%
- \advance\pgf@y\pgf@yc%
- \pgf@xa\halfside%
- \advance\pgf@x-.333333\pgf@xa%
-}
+ \dimensions%
+ \pgf@ya\halfside%
+ \pgf@yb2.0\pgf@ya%
+ %
+ \pgfutil@tempdima\halfside%
+ \multiply\pgfutil@tempdima2\relax%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \multiply\pgfutil@tempdima#1\relax%
+ \pgf@yc\pgf@ya%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ %
+ \pgf@xb\pgf@yb%
+ \advance\pgf@yb-\halflinewidth%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ %
+ \pgf@xc-1.166666\pgf@ya%
+ \advance\pgf@xc-.866025\pgf@xb%
+ \advance\pgf@xc\pgfmathresult\pgf@yb%
+ \advance\pgf@xc\halflinewidth%
+ \advance\pgf@xc-\outerxsep%
+ %
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-#1\endcsname%
+ \advance\pgf@xc-\invertedradius%
+ \advance\pgf@xc-\outerinvertedradius%
+ \fi%
+ %
+ \centerpoint%
+ \advance\pgf@x\pgf@xc%
+ \advance\pgf@y\pgf@yc%
+ \pgf@xa\halfside%
+ \advance\pgf@x-.333333\pgf@xa%
+}%
@@ -1153,330 +1153,330 @@
% Shape xor gate US
%
\pgfdeclareshape{xor gate US}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xor gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{2}%
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@xor gate US@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@xor gate US@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@XOR@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{An xor gate must have at two inputs}%
- \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}%
- \inheritanchor[from=or gate US]{mid east}
- \anchor{mid west}{%
- \csname pgf@anchor@xor gate US@north west\endcsname%
- \pgf@xa\pgf@x%
- \midpoint%
- \pgf@x\pgf@xa}
- \anchor{base}{\basepoint}%
- \inheritanchor[from=or gate US]{base east}
- \anchor{base west}{%
- \csname pgf@anchor@xor gate US@north west\endcsname%
- \pgf@xa\pgf@x%
- \basepoint%
- \pgf@x\pgf@xa}
- \inheritanchor[from=or gate US]{base}
- \inheritanchor[from=or gate US]{output}
- \inheritanchor[from=or gate US]{east}
- \inheritanchor[from=or gate US]{north east}
- \inheritanchor[from=or gate US]{south east}
- \inheritanchor[from=or gate US]{north}
- \inheritanchor[from=or gate US]{south}
- \anchor{south west}{%
- \dimensions%
- \pgf@xa\halfside%
- \pgf@xa-3.232051\pgf@xa% (7/6 + 2*cos(30) + 1/3) * x
- \pgf@xb\halfside%
- \pgf@xb2.0\pgf@xb%
- \advance\pgf@xb-\halflinewidth%
- \advance\pgf@xa.866025\pgf@xb%
- \pgf@ya.5\pgf@xb%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \ifpgfgateanchorsuseboundingrectangle%
- \advance\pgf@y-\halfheight%
- \else%
- \advance\pgf@y-\pgf@ya%
- \fi%
- }
- \anchor{north west}{%
- \dimensions%
- \pgf@xa\halfside%
- \pgf@xa-3.232051\pgf@xa% (7/6 + 2*cos(30) + 1/3) * x
- \pgf@xb\halfside%
- \pgf@xb2.0\pgf@xb%
- \advance\pgf@xb-\halflinewidth%
- \advance\pgf@xa.866025\pgf@xb%
- \pgf@ya.5\pgf@xb%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \ifpgfgateanchorsuseboundingrectangle%
- \advance\pgf@y\halfheight%
- \else%
- \advance\pgf@y\pgf@ya%
- \fi%
- }
- \anchor{west}{%
- \dimensions%
- \pgf@ya\halfside%
- \pgf@yb2.0\pgf@ya%
- %
- \pgf@xb\pgf@yb%
- \advance\pgf@yb-\halflinewidth%
- \pgfmathdivide@{0}{\pgfmath@tonumber{\pgf@yb}}%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- %
- \pgf@xc-1.166666\pgf@ya%
- \advance\pgf@xc-.866025\pgf@xb%
- \advance\pgf@xc\pgfmathresult\pgf@yb%
- \advance\pgf@xc\halflinewidth%
- \advance\pgf@xc-\outerxsep%
- %
- \centerpoint%
- \advance\pgf@x\pgf@xc%
- \pgf@xa\halfside%
- \advance\pgf@x-.333333\pgf@xa%
- \ifpgfgateanchorsuseboundingrectangle%
- \pgf@xa2.0\pgf@xa%
- \advance\pgf@x-0.133974\pgf@xa%
- \fi%
- }
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- {%
- \pgf@yc2.66666\pgf@yc%
- \pgfpatharc{-22}{0}{+1.166666\pgf@yc and +\pgf@yc}%
- }
- {%
- \pgf@yc2.66666\pgf@yc%
- \pgfpatharc{0}{22}{+1.166666\pgf@yc and +\pgf@yc}%
- }%
- \pgfpathclose%
- %
- % Draw the inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@ya\halfside%
- \pgf@yb2.0\pgf@ya%
- \pgf@xa\pgf@yb%
- \advance\pgf@yb-\halflinewidth%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- %
- \pgf@x-1.5\pgf@ya%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x\pgfmathresult\pgf@yb%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- %
- % Now, some fooling around to stop the `tail' being filled.
- % Technically it still is, but it isn't visible.
- %
- \pgf@xc\halfside%
- \pgf@yc\halfside%
- \pgfpathmoveto{\pgfqpoint{-1.5\pgf@xc}{-\pgf@yc}}%
- \pgf@yc2.0\pgf@yc%
- \pgfmathloop%
- \ifnum\pgfmathcounter<61\relax%
- {%
- \pgfextract@process\point{%
- \pgfpointadd{%
- \pgf@x\halfside%
- \pgf@x-3.232051\pgf@x% (7/6 + 2*cos(30) + 1/3) * x
- \pgf@y0pt%
- }{%
- \pgfpointpolar{\pgfmathcounter-30}{+\pgf@yc}%
- }%
- }%
- \pgfpathlineto{\point}%
- \pgfpathmoveto{\point}%
- }
- \repeatpgfmathloop%
- }%
- }%
- \anchorborder{%
- \pgfextract@process\externalpoint{}%
- \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \centerpoint%
- \pgf@xb\pgf@x%
- \pgf@yb\pgf@y%
- \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
- \let\externalangle\pgfmathresult%
- \dimensions%
- \pgf@xc\halfside%
- %
- \pgf@xc-.166666\pgf@xc%
- \ifdim\pgf@xa<\pgf@xc%
- \pgfmathanglebetweenpoints{\centerpoint}%
- {%
- \pgfgateanchorsuseboundingrectangletrue%
- \csname pgf@anchor@xor gate US@north west\endcsname%
- }%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
- {%
- \pgfgateanchorsuseboundingrectangletrue%
- \csname pgf@anchor@xor gate US@north\endcsname%
- }%
- {%
- \pgfgateanchorsuseboundingrectangletrue%
- \csname pgf@anchor@xor gate US@north west\endcsname%
- }%
- \else%
- \pgfmathsubtract@{360}{\pgfmathresult}%
- \ifdim\externalangle pt>\pgfmathresult pt\relax%
- \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
- {%
- \pgfgateanchorsuseboundingrectangletrue%
- \csname pgf@anchor@xor gate US@south\endcsname%
- }%
- {%
- \pgfgateanchorsuseboundingrectangletrue%
- \csname pgf@anchor@xor gate US@south west\endcsname%
- }%
- \else%
- \ifdim\pgf@ya>\pgf@yb%
- \pgf@yc\halfheight%
- \advance\pgf@yc\halfside%
- \advance\pgf@yc-\outerxsep%
- \pgf@process{%
- \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
- {%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.166666\pgf@xa%
- \pgf@xa2.0\pgf@xa%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \advance\pgf@x-.166666\pgf@xa%
- }%
- {0}{90}{+\pgf@yc}%
- }%
- \else%
- \pgf@yc\halfheight%
- \advance\pgf@yc\halfside%
- \advance\pgf@yc-\outerxsep%
- \pgf@process{%
- \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
- {%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.166666\pgf@xa%
- \pgf@xa2.0\pgf@xa%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \advance\pgf@x-.166666\pgf@xa%
- }%
- {270}{360}{+\pgf@yc}%
- }%
- \fi%
- \fi%
- \fi%
- \else%
- \ifdim\pgf@y=0pt\relax%
- \csname pgf@anchor@and gate US@east\endcsname%
- \else%
- \pgf@xc\halfwidth%
- \advance\pgf@xc\halfside%
- \pgf@yc\halfheight%
- \advance\pgf@yc\halfside%
- \pgf@xb\halfside%
- \pgf@xb-.166666\pgf@xb%
- \ifdim\pgf@ya<0pt%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@y\halfside%
- \advance\pgf@x\pgf@xb%
- }%
- {270}{330}{+\pgf@yc}%
- \else%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@y-\halfside%
- \advance\pgf@x\pgf@xb%
- }%
- {30}{90}{+\pgf@xc and +\pgf@yc}%
- \fi%
- \fi%
- \fi%
- }%
-}
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xor gate US\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{2}%
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@xor gate US@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@xor gate US@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@XOR@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{An xor gate must have at two inputs}%
+ \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}%
+ \inheritanchor[from=or gate US]{mid east}%
+ \anchor{mid west}{%
+ \csname pgf@anchor@xor gate US@north west\endcsname%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \pgf@x\pgf@xa}%
+ \anchor{base}{\basepoint}%
+ \inheritanchor[from=or gate US]{base east}%
+ \anchor{base west}{%
+ \csname pgf@anchor@xor gate US@north west\endcsname%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \pgf@x\pgf@xa}%
+ \inheritanchor[from=or gate US]{base}%
+ \inheritanchor[from=or gate US]{output}%
+ \inheritanchor[from=or gate US]{east}%
+ \inheritanchor[from=or gate US]{north east}%
+ \inheritanchor[from=or gate US]{south east}%
+ \inheritanchor[from=or gate US]{north}%
+ \inheritanchor[from=or gate US]{south}%
+ \anchor{south west}{%
+ \dimensions%
+ \pgf@xa\halfside%
+ \pgf@xa-3.232051\pgf@xa% (7/6 + 2*cos(30) + 1/3) * x
+ \pgf@xb\halfside%
+ \pgf@xb2.0\pgf@xb%
+ \advance\pgf@xb-\halflinewidth%
+ \advance\pgf@xa.866025\pgf@xb%
+ \pgf@ya.5\pgf@xb%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \advance\pgf@y-\halfheight%
+ \else%
+ \advance\pgf@y-\pgf@ya%
+ \fi%
+ }%
+ \anchor{north west}{%
+ \dimensions%
+ \pgf@xa\halfside%
+ \pgf@xa-3.232051\pgf@xa% (7/6 + 2*cos(30) + 1/3) * x
+ \pgf@xb\halfside%
+ \pgf@xb2.0\pgf@xb%
+ \advance\pgf@xb-\halflinewidth%
+ \advance\pgf@xa.866025\pgf@xb%
+ \pgf@ya.5\pgf@xb%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \advance\pgf@y\halfheight%
+ \else%
+ \advance\pgf@y\pgf@ya%
+ \fi%
+ }%
+ \anchor{west}{%
+ \dimensions%
+ \pgf@ya\halfside%
+ \pgf@yb2.0\pgf@ya%
+ %
+ \pgf@xb\pgf@yb%
+ \advance\pgf@yb-\halflinewidth%
+ \pgfmathdivide@{0}{\pgfmath@tonumber{\pgf@yb}}%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ %
+ \pgf@xc-1.166666\pgf@ya%
+ \advance\pgf@xc-.866025\pgf@xb%
+ \advance\pgf@xc\pgfmathresult\pgf@yb%
+ \advance\pgf@xc\halflinewidth%
+ \advance\pgf@xc-\outerxsep%
+ %
+ \centerpoint%
+ \advance\pgf@x\pgf@xc%
+ \pgf@xa\halfside%
+ \advance\pgf@x-.333333\pgf@xa%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \pgf@xa2.0\pgf@xa%
+ \advance\pgf@x-0.133974\pgf@xa%
+ \fi%
+ }%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ {%
+ \pgf@yc2.66666\pgf@yc%
+ \pgfpatharc{-22}{0}{+1.166666\pgf@yc and +\pgf@yc}%
+ }
+ {%
+ \pgf@yc2.66666\pgf@yc%
+ \pgfpatharc{0}{22}{+1.166666\pgf@yc and +\pgf@yc}%
+ }%
+ \pgfpathclose%
+ %
+ % Draw the inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@ya\halfside%
+ \pgf@yb2.0\pgf@ya%
+ \pgf@xa\pgf@yb%
+ \advance\pgf@yb-\halflinewidth%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ %
+ \pgf@x-1.5\pgf@ya%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x\pgfmathresult\pgf@yb%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ %
+ % Now, some fooling around to stop the `tail' being filled.
+ % Technically it still is, but it isn't visible.
+ %
+ \pgf@xc\halfside%
+ \pgf@yc\halfside%
+ \pgfpathmoveto{\pgfqpoint{-1.5\pgf@xc}{-\pgf@yc}}%
+ \pgf@yc2.0\pgf@yc%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter<61\relax%
+ {%
+ \pgfextract@process\point{%
+ \pgfpointadd{%
+ \pgf@x\halfside%
+ \pgf@x-3.232051\pgf@x% (7/6 + 2*cos(30) + 1/3) * x
+ \pgf@y0pt%
+ }{%
+ \pgfpointpolar{\pgfmathcounter-30}{+\pgf@yc}%
+ }%
+ }%
+ \pgfpathlineto{\point}%
+ \pgfpathmoveto{\point}%
+ }
+ \repeatpgfmathloop%
+ }%
+ }%
+ \anchorborder{%
+ \pgfextract@process\externalpoint{}%
+ \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \centerpoint%
+ \pgf@xb\pgf@x%
+ \pgf@yb\pgf@y%
+ \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
+ \let\externalangle\pgfmathresult%
+ \dimensions%
+ \pgf@xc\halfside%
+ %
+ \pgf@xc-.166666\pgf@xc%
+ \ifdim\pgf@xa<\pgf@xc%
+ \pgfmathanglebetweenpoints{\centerpoint}%
+ {%
+ \pgfgateanchorsuseboundingrectangletrue%
+ \csname pgf@anchor@xor gate US@north west\endcsname%
+ }%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
+ {%
+ \pgfgateanchorsuseboundingrectangletrue%
+ \csname pgf@anchor@xor gate US@north\endcsname%
+ }%
+ {%
+ \pgfgateanchorsuseboundingrectangletrue%
+ \csname pgf@anchor@xor gate US@north west\endcsname%
+ }%
+ \else%
+ \pgfmathsubtract@{360}{\pgfmathresult}%
+ \ifdim\externalangle pt>\pgfmathresult pt\relax%
+ \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
+ {%
+ \pgfgateanchorsuseboundingrectangletrue%
+ \csname pgf@anchor@xor gate US@south\endcsname%
+ }%
+ {%
+ \pgfgateanchorsuseboundingrectangletrue%
+ \csname pgf@anchor@xor gate US@south west\endcsname%
+ }%
+ \else%
+ \ifdim\pgf@ya>\pgf@yb%
+ \pgf@yc\halfheight%
+ \advance\pgf@yc\halfside%
+ \advance\pgf@yc-\outerxsep%
+ \pgf@process{%
+ \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
+ {%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.166666\pgf@xa%
+ \pgf@xa2.0\pgf@xa%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@x-.166666\pgf@xa%
+ }%
+ {0}{90}{+\pgf@yc}%
+ }%
+ \else%
+ \pgf@yc\halfheight%
+ \advance\pgf@yc\halfside%
+ \advance\pgf@yc-\outerxsep%
+ \pgf@process{%
+ \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
+ {%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.166666\pgf@xa%
+ \pgf@xa2.0\pgf@xa%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@x-.166666\pgf@xa%
+ }%
+ {270}{360}{+\pgf@yc}%
+ }%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \ifdim\pgf@y=0pt\relax%
+ \csname pgf@anchor@and gate US@east\endcsname%
+ \else%
+ \pgf@xc\halfwidth%
+ \advance\pgf@xc\halfside%
+ \pgf@yc\halfheight%
+ \advance\pgf@yc\halfside%
+ \pgf@xb\halfside%
+ \pgf@xb-.166666\pgf@xb%
+ \ifdim\pgf@ya<0pt%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@y\halfside%
+ \advance\pgf@x\pgf@xb%
+ }%
+ {270}{330}{+\pgf@yc}%
+ \else%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@y-\halfside%
+ \advance\pgf@x\pgf@xb%
+ }%
+ {30}{90}{+\pgf@xc and +\pgf@yc}%
+ \fi%
+ \fi%
+ \fi%
+ }%
+}%
@@ -1484,167 +1484,167 @@
% Shape xnor gate US
%
\pgfdeclareshape{xnor gate US}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xnor gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{2}%
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@xnor gate US@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@xnor gate US@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@XOR@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{An xnor gate must have two inputs}%
- \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}%
- \inheritanchor[from=xor gate US]{mid east}
- \inheritanchor[from=xor gate US]{mid west}
- \anchor{base}{\basepoint}%
- \inheritanchor[from=xor gate US]{base east}
- \inheritanchor[from=xor gate US]{base west}
- \inheritanchor[from=xor gate US]{base}
- \inheritanchor[from=nor gate US]{output}
- \inheritanchor[from=xor gate US]{east}
- \inheritanchor[from=xor gate US]{north east}
- \inheritanchor[from=xor gate US]{south east}
- \inheritanchor[from=xor gate US]{north}
- \inheritanchor[from=xor gate US]{south}
- \inheritanchor[from=xor gate US]{south west}
- \inheritanchor[from=xor gate US]{north west}
- \inheritanchor[from=xor gate US]{west}
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- {%
- \pgf@yc2.66666\pgf@yc%
- \pgfpatharc{-22}{0}{+1.166666\pgf@yc and +\pgf@yc}%
- }
- {%
- \pgf@yc2.66666\pgf@yc%
- \pgfpatharc{0}{22}{+1.166666\pgf@yc and +\pgf@yc}%
- }%
- \pgfpathclose%
- %
- % 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 inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@ya\halfside%
- \pgf@yb2.0\pgf@ya%
- \pgf@xa\pgf@yb%
- \advance\pgf@yb-\halflinewidth%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- %
- \pgf@x-1.5\pgf@ya%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x\pgfmathresult\pgf@yb%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- %
- % Now, some fooling around to stop the `tail' being filled.
- %
- \pgf@xc\halfside%
- \pgf@yc\halfside%
- \pgfpathmoveto{\pgfqpoint{-1.5\pgf@xc}{-\pgf@yc}}%
- \pgf@yc2.0\pgf@yc%
- \pgfmathloop%
- \ifnum\pgfmathcounter<61\relax%
- {%
- \pgfextract@process\point{%
- \pgfpointadd{%
- \pgf@x\halfside%
- \pgf@x-3.232051\pgf@x% (7/6 + 2*cos(30) + 1/3) * x
- \pgf@y0pt%
- }{%
- \pgfpointpolar{\pgfmathcounter-30}{+\pgf@yc}%
- }%
- }%
- \pgfpathlineto{\point}%
- \pgfpathmoveto{\point}%
- }
- \repeatpgfmathloop%
- }%
- }%
- \inheritanchorborder[from=xor gate US]
-}
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xnor gate US\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{2}%
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@xnor gate US@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@xnor gate US@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@XOR@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{An xnor gate must have two inputs}%
+ \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}%
+ \inheritanchor[from=xor gate US]{mid east}%
+ \inheritanchor[from=xor gate US]{mid west}%
+ \anchor{base}{\basepoint}%%
+ \inheritanchor[from=xor gate US]{base east}%
+ \inheritanchor[from=xor gate US]{base west}%
+ \inheritanchor[from=xor gate US]{base}%
+ \inheritanchor[from=nor gate US]{output}%
+ \inheritanchor[from=xor gate US]{east}%
+ \inheritanchor[from=xor gate US]{north east}%
+ \inheritanchor[from=xor gate US]{south east}%
+ \inheritanchor[from=xor gate US]{north}%
+ \inheritanchor[from=xor gate US]{south}%
+ \inheritanchor[from=xor gate US]{south west}%
+ \inheritanchor[from=xor gate US]{north west}%
+ \inheritanchor[from=xor gate US]{west}%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ {%
+ \pgf@yc2.66666\pgf@yc%
+ \pgfpatharc{-22}{0}{+1.166666\pgf@yc and +\pgf@yc}%
+ }
+ {%
+ \pgf@yc2.66666\pgf@yc%
+ \pgfpatharc{0}{22}{+1.166666\pgf@yc and +\pgf@yc}%
+ }%
+ \pgfpathclose%
+ %
+ % 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 inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@ya\halfside%
+ \pgf@yb2.0\pgf@ya%
+ \pgf@xa\pgf@yb%
+ \advance\pgf@yb-\halflinewidth%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ %
+ \pgf@x-1.5\pgf@ya%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x\pgfmathresult\pgf@yb%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ %
+ % Now, some fooling around to stop the `tail' being filled.
+ %
+ \pgf@xc\halfside%
+ \pgf@yc\halfside%
+ \pgfpathmoveto{\pgfqpoint{-1.5\pgf@xc}{-\pgf@yc}}%
+ \pgf@yc2.0\pgf@yc%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter<61\relax%
+ {%
+ \pgfextract@process\point{%
+ \pgfpointadd{%
+ \pgf@x\halfside%
+ \pgf@x-3.232051\pgf@x% (7/6 + 2*cos(30) + 1/3) * x
+ \pgf@y0pt%
+ }{%
+ \pgfpointpolar{\pgfmathcounter-30}{+\pgf@yc}%
+ }%
+ }%
+ \pgfpathlineto{\point}%
+ \pgfpathmoveto{\point}%
+ }
+ \repeatpgfmathloop%
+ }%
+ }%
+ \inheritanchorborder[from=xor gate US]%
+}%
@@ -1655,7 +1655,7 @@
%
\pgfdeclareshape{not gate US}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@not gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1}%
+ \pgf@lib@sh@logicgate@parseinputs{1}%
\ifnum\pgf@lib@sh@logicgate@numinputs=0\relax%
\pgferror{A not gate must have one input}%
\fi%
@@ -1670,21 +1670,21 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
- \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}
+ }%
+ \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}{%
@@ -1692,14 +1692,14 @@
\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%
+ \advance\pgf@x\pgf@xc%
}%
\anchor{base}{\basepoint}%
\anchor{base east}{%
@@ -1707,16 +1707,16 @@
\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%
+ \advance\pgf@x\pgf@xc%
}%
- \inheritanchor[from=and gate US]{base}
+ \inheritanchor[from=and gate US]{base}%
\anchor{output}{%
\dimensions%
\pgf@xc\halfside%
@@ -1727,7 +1727,7 @@
\advance\pgf@x\invertedradius%
\advance\pgf@x\outerinvertedradius%
\advance\pgf@x\outerxsep%
- }
+ }%
\anchor{east}{%
\dimensions%
\tipanchor%
@@ -1749,11 +1749,11 @@
\pgfpointadd{\centerpoint}{%
\tipanchor%
\pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
+ \advance\pgf@x2.350943\pgf@xa%
}%
- }%
+ }%
\fi%
- }
+ }%
\anchor{south}{%
\dimensions%
\ifpgfgateanchorsuseboundingrectangle%
@@ -1768,17 +1768,17 @@
\pgfpointadd{\centerpoint}{%
\tipanchor%
\pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
+ \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{%
+ \pgf@process{%
\dimensions%
\tipanchor%
\pgf@xa\pgf@x%
@@ -1793,17 +1793,17 @@
\pgfpointadd{\centerpoint}{%
\tipanchor%
\pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
+ \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{%
+ \pgf@process{%
\dimensions%
\tipanchor%
\pgf@xa\pgf@x%
@@ -1818,11 +1818,11 @@
\pgfpointadd{\centerpoint}{%
\tipanchor%
\pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
+ \advance\pgf@x2.350943\pgf@xa%
}%
- }%
+ }%
\fi%
- }
+ }%
\anchor{south west}{%
\dimensions%
\pgf@xa\halfside%
@@ -1831,7 +1831,7 @@
\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.
+ \advance\pgf@y-1.565\pgf@ya% Selected by trial and error.
}%
\anchor{north west}{%
\dimensions%
@@ -1841,7 +1841,7 @@
\advance\pgf@x-\outerxsep%
\advance\pgf@y1.166666\pgf@xa%
\pgf@ya\outerysep%
- \advance\pgf@y1.565\pgf@ya% Selected by trial and error.
+ \advance\pgf@y1.565\pgf@ya% Selected by trial and error.
}%
\anchor{input}{%
\dimensions%
@@ -1856,7 +1856,7 @@
\advance\pgf@xc-\outerxsep%
\centerpoint%
\advance\pgf@x\pgf@xc%
- }
+ }%
\backgroundpath{%
\dimensions%
\pgf@xc\halfwidth%
@@ -1869,9 +1869,9 @@
\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%
@@ -1879,11 +1879,11 @@
\advance\pgf@x.866025\pgf@yc%
\advance\pgf@x\outerinvertedradius%
\pgf@y0pt%
- }{+\invertedradius}%
+ }{+\invertedradius}%
}%
- %
+ %
% Draw the input.
- %
+ %
\expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-1\endcsname%
{%
\pgfpathcircle{%
@@ -1892,15 +1892,15 @@
\advance\pgf@x-.5\pgflinewidth%
\advance\pgf@x-\invertedradius%
\pgf@y0pt%
- }{+\invertedradius}%
+ }{+\invertedradius}%
}%
- \fi%
+ \fi%
}%
}%
\anchorborder{%
\pgf@lib@gates@not@buffer@border{not gate US}
- }
-}
+ }%
+}%
\def\pgf@lib@gates@not@buffer@border#1{
\pgfextract@process\externalpoint{}%
@@ -1922,9 +1922,9 @@
\pgfpointadd{\centerpoint}{%
\tipanchor%
\pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
+ \advance\pgf@x2.350943\pgf@xa%
}%
- }%
+ }%
\else%
\pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@not gate US@south west\endcsname}%
\ifdim\externalangle pt<\pgfmathresult pt%
@@ -1938,9 +1938,9 @@
\pgfpointadd{\centerpoint}{%
\tipanchor%
\pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
+ \advance\pgf@x2.350943\pgf@xa%
}%
- }%
+ }%
\fi%
\fi%
\fi%
@@ -1948,8 +1948,8 @@
}%
-\def\pgf@lib@zero@text{0.0}
-\def\pgf@lib@onehundredeighty@text{180.0}
+\def\pgf@lib@zero@text{0.0}%
+\def\pgf@lib@onehundredeighty@text{180.0}%
@@ -1957,569 +1957,569 @@
% Shape buffer gate US.
%
\pgfdeclareshape{buffer gate US}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@buffer gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1}%
- \ifnum\pgf@lib@sh@logicgate@numinputs=0\relax%
- \pgferror{A buffer 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@buffer 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@buffer gate US@east\endcsname%
- \pgf@y\pgfutil@tempdima%
- }
- \inheritanchor[from=not gate US]{base west}
- \inheritanchor[from=and gate US]{base}
- \anchor{output}{\csname pgf@anchor@buffer gate US@east\endcsname}
- \anchor{east}{%
- \dimensions%
- \pgfpointadd{\centerpoint}{%
- \tipanchor%
- \pgf@xa\outerxsep%
- \advance\pgf@x2.350943\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@buffer 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%
- \pgfutil@tempdima\pgf@y%
- \csname pgf@anchor@buffer gate US@east\endcsname%
- \pgf@y\pgfutil@tempdima%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@x1pt\advance\pgf@y-1pt}%
- {\csname pgf@anchor@buffer gate US@south west\endcsname}%
- {%
- \pgfpointadd{\centerpoint}{%
- \tipanchor%
- \pgf@xc\outerxsep%
- \advance\pgf@x2.350943\pgf@xc%
- }%
- }%
- \fi%
- }
- \anchor{north east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \csname pgf@anchor@not gate US@north west\endcsname%
- \pgfutil@tempdima\pgf@y%
- \csname pgf@anchor@buffer gate US@east\endcsname%
- \pgf@y\pgfutil@tempdima%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@x1pt\advance\pgf@y1pt}%
- {\csname pgf@anchor@buffer gate US@north west\endcsname}%
- {%
- \pgfpointadd{\centerpoint}{%
- \tipanchor%
- \pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
- }%
- }%
- \fi%
- }
- \inheritanchor[from=not gate US]{south west}
- \inheritanchor[from=not gate US]{north west}
- \inheritanchor[from=not gate US]{input}
- \inheritanchor[from=not gate US]{west}
- \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}}%
- \pgfpathclose%
- %
- % 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%
- }%
- }%
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@buffer gate US\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{1}%
+ \ifnum\pgf@lib@sh@logicgate@numinputs=0\relax%
+ \pgferror{A buffer 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@buffer 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@buffer gate US@east\endcsname%
+ \pgf@y\pgfutil@tempdima%
+ }%
+ \inheritanchor[from=not gate US]{base west}%
+ \inheritanchor[from=and gate US]{base}%
+ \anchor{output}{\csname pgf@anchor@buffer gate US@east\endcsname}%
+ \anchor{east}{%
+ \dimensions%
+ \pgfpointadd{\centerpoint}{%
+ \tipanchor%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x2.350943\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@buffer 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%
+ \pgfutil@tempdima\pgf@y%
+ \csname pgf@anchor@buffer gate US@east\endcsname%
+ \pgf@y\pgfutil@tempdima%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@x1pt\advance\pgf@y-1pt}%
+ {\csname pgf@anchor@buffer gate US@south west\endcsname}%
+ {%
+ \pgfpointadd{\centerpoint}{%
+ \tipanchor%
+ \pgf@xc\outerxsep%
+ \advance\pgf@x2.350943\pgf@xc%
+ }%
+ }%
+ \fi%
+ }%
+ \anchor{north east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \csname pgf@anchor@not gate US@north west\endcsname%
+ \pgfutil@tempdima\pgf@y%
+ \csname pgf@anchor@buffer gate US@east\endcsname%
+ \pgf@y\pgfutil@tempdima%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@x1pt\advance\pgf@y1pt}%
+ {\csname pgf@anchor@buffer gate US@north west\endcsname}%
+ {%
+ \pgfpointadd{\centerpoint}{%
+ \tipanchor%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x2.350943\pgf@xa%
+ }%
+ }%
+ \fi%
+ }%
+ \inheritanchor[from=not gate US]{south west}%
+ \inheritanchor[from=not gate US]{north west}%
+ \inheritanchor[from=not gate US]{input}%
+ \inheritanchor[from=not gate US]{west}%
+ \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}}%
+ \pgfpathclose%
+ %
+ % 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{buffer gate US}
- }
-}
+ }%
+}%
\pgfdeclareshape{and gate CDH}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@and gate CDH\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@and gate CDH@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@and gate CDH@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{An and gate must have at least two inputs}%
- \fi%
- }%
- \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
- \saveddimen\invertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- }%
- \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}{%
- \csname pgf@anchor@and gate CDH@east\endcsname%
- \pgf@xa\pgf@x%
- \midpoint%
- \pgf@x\pgf@xa}
- \anchor{mid west}{%
- \csname pgf@anchor@and gate CDH@west\endcsname%
- \pgf@xa\pgf@x%
- \midpoint%
- \pgf@x\pgf@xa}
- \anchor{base}{\basepoint}%
- \anchor{base east}{%
- \csname pgf@anchor@and gate CDH@east\endcsname%
- \pgf@xa\pgf@x%
- \basepoint%
- \pgf@x\pgf@xa}
- \anchor{base west}{%
- \csname pgf@anchor@and gate CDH@west\endcsname%
- \pgf@xa\pgf@x%
- \basepoint%
- \pgf@x\pgf@xa}
- \anchor{east}{%
- \dimensions%
- \pgfpointadd{\centerpoint}{\tipanchor}%
- }
- \anchor{output}{\csname pgf@anchor@and gate CDH@east\endcsname}
- \anchor{north east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \tipanchor%
- \pgf@xa\pgf@x%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\halfheight%
- \else%
- \centerpoint%
- \pgf@xa\halfwidth%
- \pgf@ya\halfheight%
- \pgf@xb\halfside%
- \advance\pgf@x-.166666\pgf@xb%
- \advance\pgf@xa\pgf@xb%
- \advance\pgf@x.5\pgf@xa%
- \advance\pgf@y-\pgf@xb%
- \advance\pgf@ya\pgf@xb%
- \advance\pgf@y.866025\pgf@ya%
- \fi%
- }
- \anchor{south east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \tipanchor%
- \pgf@xa\pgf@x%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y-\halfheight%
- \else
- \centerpoint%
- \pgf@xa\halfwidth%
- \pgf@ya\halfheight%
- \pgf@xb\halfside%
- \advance\pgf@x-.166666\pgf@xb%
- \advance\pgf@xa\pgf@xb%
- \advance\pgf@x.5\pgf@xa%
- \advance\pgf@y\pgf@xb%
- \advance\pgf@ya\pgf@xb%
- \advance\pgf@y-.866025\pgf@ya%
- \fi%
- }
- \anchor{north}{%
- \dimensions%
- \centerpoint%
- \ifpgfgateanchorsuseboundingrectangle%
- \advance\pgf@y\halfheight%
- \else%
- \pgf@ya\halfheight%
- \advance\pgf@y.993043\pgf@ya%
- \fi%
- }
- \anchor{south}{%
- \dimensions%
- \centerpoint%
- \ifpgfgateanchorsuseboundingrectangle%
- \advance\pgf@y-\halfheight%
- \else%
- \pgf@ya\halfheight%
- \advance\pgf@y-.993043\pgf@ya%
- \fi%
- }
- \anchor{south west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \advance\pgf@y-\halfheight%
- }
- \anchor{north west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \advance\pgf@y\halfheight%
- }
- \anchor{west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- }
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
- \pgfpathclose%
- %
- % Draw the inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@xa\halfside%
- \pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-.5\pgflinewidth%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- }%
- }%
- \anchorborder{%
- \pgfextract@process\externalpoint{}%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \dimensions%
- \pgf@xb\halfside%
- %
- \pgf@xb-.166666\pgf@xb%
- \ifdim\pgf@xa<\pgf@xb%
- \pgfpointadd{\centerpoint}{%
- \pgfpointborderrectangle{\externalpoint}{%
- \pgf@xc\halfside%
- \pgf@xc.166666\pgf@xc%
- \advance\pgf@xc\halfwidth%
- \pgfqpoint{\pgf@xc}{\halfheight}%
- }%
- }%
- \else%
- \ifdim\pgf@y=0pt\relax%
- \csname pgf@anchor@and gate CDH@east\endcsname%
- \else%
- \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
- \pgf@xc\halfwidth%
- \advance\pgf@xc\halfside%
- \pgf@yc\halfheight%
- \advance\pgf@yc\halfside%
- \ifdim\pgf@ya<0pt%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@y\halfside%
- \advance\pgf@x\pgf@xb%
- }%
- {270}{330}{+\pgf@yc}%
- \else%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@y-\halfside%
- \advance\pgf@x\pgf@xb%
- }%
- {30}{90}{+\pgf@xc and +\pgf@yc}%
- \fi%
- \fi%
- \fi%
- }
-}
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@and gate CDH\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@and gate CDH@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@and gate CDH@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{An and gate must have at least two inputs}%
+ \fi%
+ }%
+ \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
+ \saveddimen\invertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ }%
+ \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}{%
+ \csname pgf@anchor@and gate CDH@east\endcsname%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \pgf@x\pgf@xa}%
+ \anchor{mid west}{%
+ \csname pgf@anchor@and gate CDH@west\endcsname%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \pgf@x\pgf@xa}%
+ \anchor{base}{\basepoint}%
+ \anchor{base east}{%
+ \csname pgf@anchor@and gate CDH@east\endcsname%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \pgf@x\pgf@xa}%
+ \anchor{base west}{%
+ \csname pgf@anchor@and gate CDH@west\endcsname%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \pgf@x\pgf@xa}%
+ \anchor{east}{%
+ \dimensions%
+ \pgfpointadd{\centerpoint}{\tipanchor}%
+ }%
+ \anchor{output}{\csname pgf@anchor@and gate CDH@east\endcsname}%
+ \anchor{north east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \tipanchor%
+ \pgf@xa\pgf@x%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\halfheight%
+ \else%
+ \centerpoint%
+ \pgf@xa\halfwidth%
+ \pgf@ya\halfheight%
+ \pgf@xb\halfside%
+ \advance\pgf@x-.166666\pgf@xb%
+ \advance\pgf@xa\pgf@xb%
+ \advance\pgf@x.5\pgf@xa%
+ \advance\pgf@y-\pgf@xb%
+ \advance\pgf@ya\pgf@xb%
+ \advance\pgf@y.866025\pgf@ya%
+ \fi%
+ }%
+ \anchor{south east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \tipanchor%
+ \pgf@xa\pgf@x%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y-\halfheight%
+ \else
+ \centerpoint%
+ \pgf@xa\halfwidth%
+ \pgf@ya\halfheight%
+ \pgf@xb\halfside%
+ \advance\pgf@x-.166666\pgf@xb%
+ \advance\pgf@xa\pgf@xb%
+ \advance\pgf@x.5\pgf@xa%
+ \advance\pgf@y\pgf@xb%
+ \advance\pgf@ya\pgf@xb%
+ \advance\pgf@y-.866025\pgf@ya%
+ \fi%
+ }%
+ \anchor{north}{%
+ \dimensions%
+ \centerpoint%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \advance\pgf@y\halfheight%
+ \else%
+ \pgf@ya\halfheight%
+ \advance\pgf@y.993043\pgf@ya%
+ \fi%
+ }%
+ \anchor{south}{%
+ \dimensions%
+ \centerpoint%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \advance\pgf@y-\halfheight%
+ \else%
+ \pgf@ya\halfheight%
+ \advance\pgf@y-.993043\pgf@ya%
+ \fi%
+ }%
+ \anchor{south west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@y-\halfheight%
+ }%
+ \anchor{north west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@y\halfheight%
+ }%
+ \anchor{west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ }%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
+ \pgfpathclose%
+ %
+ % Draw the inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@xa\halfside%
+ \pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-.5\pgflinewidth%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ }%
+ }%
+ \anchorborder{%
+ \pgfextract@process\externalpoint{}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \dimensions%
+ \pgf@xb\halfside%
+ %
+ \pgf@xb-.166666\pgf@xb%
+ \ifdim\pgf@xa<\pgf@xb%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointborderrectangle{\externalpoint}{%
+ \pgf@xc\halfside%
+ \pgf@xc.166666\pgf@xc%
+ \advance\pgf@xc\halfwidth%
+ \pgfqpoint{\pgf@xc}{\halfheight}%
+ }%
+ }%
+ \else%
+ \ifdim\pgf@y=0pt\relax%
+ \csname pgf@anchor@and gate CDH@east\endcsname%
+ \else%
+ \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
+ \pgf@xc\halfwidth%
+ \advance\pgf@xc\halfside%
+ \pgf@yc\halfheight%
+ \advance\pgf@yc\halfside%
+ \ifdim\pgf@ya<0pt%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@y\halfside%
+ \advance\pgf@x\pgf@xb%
+ }%
+ {270}{330}{+\pgf@yc}%
+ \else%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@y-\halfside%
+ \advance\pgf@x\pgf@xb%
+ }%
+ {30}{90}{+\pgf@xc and +\pgf@yc}%
+ \fi%
+ \fi%
+ \fi%
+ }%
+}%
\pgfdeclareshape{nand gate CDH}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nand gate CDH\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@nand gate CDH@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@nand gate CDH@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{A nand gate must have at least two inputs}%
- \fi%
- }%
- \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
- \saveddimen\invertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- }%
- \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}%
- \inheritanchor[from=and gate CDH]{mid east}
- \inheritanchor[from=and gate CDH]{mid west}
- \anchor{base}{\basepoint}%
- \inheritanchor[from=and gate CDH]{base east}
- \inheritanchor[from=and gate CDH]{base west}
- \anchor{output}{%
- \dimensions
- \pgfpointadd{\centerpoint}{%
- \pgf@xa\halfside%
- \pgf@x-.166666\pgf@xa%
- \pgf@xb2.0\pgf@xa%
- \advance\pgf@x.866025\pgf@xb%
- \advance\pgf@x\invertedradius%
- \advance\pgf@x\outerinvertedradius%
- \advance\pgf@x\outerxsep%
- \pgf@y0pt%
- }%
- }
- \inheritanchor[from=and gate CDH]{east}
- \inheritanchor[from=and gate CDH]{north east}
- \inheritanchor[from=and gate CDH]{south east}
- \inheritanchor[from=and gate CDH]{north}
- \inheritanchor[from=and gate CDH]{south}
- \inheritanchor[from=and gate CDH]{south west}
- \inheritanchor[from=and gate CDH]{north west}
- \inheritanchor[from=and gate CDH]{west}
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
- \pgfpathclose%
- %
- % 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 inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@xa\halfside%
- \pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-.5\pgflinewidth%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- }%
- }%
- \inheritanchorborder[from=and gate CDH]
-} \ No newline at end of file
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nand gate CDH\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@nand gate CDH@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@nand gate CDH@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{A nand gate must have at least two inputs}%
+ \fi%
+ }%
+ \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
+ \saveddimen\invertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ }%
+ \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}%
+ \inheritanchor[from=and gate CDH]{mid east}%
+ \inheritanchor[from=and gate CDH]{mid west}%
+ \anchor{base}{\basepoint}%%
+ \inheritanchor[from=and gate CDH]{base east}%
+ \inheritanchor[from=and gate CDH]{base west}%
+ \anchor{output}{%
+ \dimensions
+ \pgfpointadd{\centerpoint}{%
+ \pgf@xa\halfside%
+ \pgf@x-.166666\pgf@xa%
+ \pgf@xb2.0\pgf@xa%
+ \advance\pgf@x.866025\pgf@xb%
+ \advance\pgf@x\invertedradius%
+ \advance\pgf@x\outerinvertedradius%
+ \advance\pgf@x\outerxsep%
+ \pgf@y0pt%
+ }%
+ }%
+ \inheritanchor[from=and gate CDH]{east}%
+ \inheritanchor[from=and gate CDH]{north east}%
+ \inheritanchor[from=and gate CDH]{south east}%
+ \inheritanchor[from=and gate CDH]{north}%
+ \inheritanchor[from=and gate CDH]{south}%
+ \inheritanchor[from=and gate CDH]{south west}%
+ \inheritanchor[from=and gate CDH]{north west}%
+ \inheritanchor[from=and gate CDH]{west}%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
+ \pgfpathclose%
+ %
+ % 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 inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@xa\halfside%
+ \pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-.5\pgflinewidth%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ }%
+ }%
+ \inheritanchorborder[from=and gate CDH]%
+}%
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
index 72d6a6d22ba..68005a61478 100644
--- 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
@@ -13,8 +13,8 @@
\pgfkeys{/pgf/.cd,%
logic gate input sep/.initial=0.125cm,
logic gate inputs/.initial={normal,normal},%
- logic gate inverted radius/.initial=2pt
-}
+ logic gate inverted radius/.initial=2pt,
+}%
% Internal macro for parsing inputs.
@@ -31,19 +31,19 @@
\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}
-\def\pgf@lib@sh@atchar{@}
-\def\pgf@lib@sh@gobbletilat#1@{}
-\def\pgf@lib@sh@gobbletilatcomma#1@,{}
+}%
+\def\pgf@lib@sh@itext{i}%
+\def\pgf@lib@sh@invertedtext{inverted}%
+\def\pgf@lib@sh@atchar{@}%
+\def\pgf@lib@sh@gobbletilat#1@{}%
+\def\pgf@lib@sh@gobbletilatcomma#1@,{}%
%
-% The `short' version for input specifcation is an extension of
+% The `short' version for input specification 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 @%
-}
+}%
\def\pgf@lib@sh@logicgate@parseinputs@@short#1{%
\def\pgf@lib@sh@tmp{#1}%
\ifx\pgf@lib@sh@tmp\pgf@lib@sh@atchar%
@@ -61,17 +61,17 @@
\else%
\expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
\expandafter\def\csname input-\the\c@pgf@countb\endcsname{n}}%
- \fi%
+ \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,@,%
-}
+}%
\def\pgf@lib@sh@logicgate@parseinputs@@long#1,{%
\def\pgf@lib@sh@tmp{#1}%
\ifx\pgf@lib@sh@tmp\pgf@lib@sh@atchar%
@@ -90,16 +90,14 @@
\else%
\expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
\expandafter\def\csname input-\the\c@pgf@countb\endcsname{n}}%
- \fi%
+ \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/shapes/pgflibraryshapes.arrows.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.arrows.code.tex
index 39f90d6f2e6..0859687f9d4 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/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/shapes/pgflibraryshapes.arrows.code.tex,v 1.1 2008/06/26 16:55:55 tantau Exp $
+\ProvidesFileRCS{pgflibraryshapes.arrows.code.tex}
% keys for shape single arrow
@@ -17,531 +17,532 @@
% /pgf/single arrow head indent
\pgfkeys{/pgf/.cd,
- single arrow tip angle/.initial=90,
- single arrow head extend/.initial=.25cm,
- single arrow head indent/.initial=0cm}
+ single arrow tip angle/.initial=90,
+ single arrow head extend/.initial=.25cm,
+ single arrow head indent/.initial=0cm,
+}%
% Shape single arrow
%
%
\pgfdeclareshape{single arrow}{%
- \savedmacro\getsinglearrowpoints{%
- %
- % Get the outer sep.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- \edef\xoutersep{\the\pgf@x}%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- \edef\youtersep{\the\pgf@y}%
- %
- % Get the node dimensions.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@xa.5\wd\pgfnodeparttextbox%
- \advance\pgf@xa.5\pgflinewidth%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@ya.5\ht\pgfnodeparttextbox%
- \advance\pgf@ya.5\dp\pgfnodeparttextbox%
- \advance\pgf@ya.5\pgflinewidth%
- \ifpgfshapeborderusesincircle%
- \ifdim\pgf@xa<\pgf@ya%
- \pgf@xa\pgf@ya%
- \fi%
- \pgf@xa1.41421\pgf@xa%
- \pgf@ya\pgf@xa%
- \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
- \ifdim\xoutersep>\youtersep\relax%
- \let\youtersep\xoutersep%
- \else%
- \let\xoutersep\youtersep%
- \fi%
- \else%
- %
- % Round the rotation.
- %
- \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
- \pgfmathmod@{\rotate}{360}%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \expandafter\c@pgf@counta\pgfmathresult\relax\pgfmath@%
- \advance\c@pgf@counta45\relax%
- \divide\c@pgf@counta90\relax%
- \multiply\c@pgf@counta90\relax%
- \ifnum\c@pgf@counta<0\relax%
- \advance\c@pgf@counta360\relax%
- \fi%
- \edef\rotate{\the\c@pgf@counta}%
- %
- % Calculate the width and height of the node
- % contents, according to any border rotation.
- %
- \ifnum\c@pgf@counta=90\relax%
- \pgf@x\pgf@xa%
- \pgf@xa\pgf@ya%
- \pgf@ya\pgf@x%
- \let\pgfmathresult\xoutersep%
- \let\xoutersep\youtersep%
- \let\youtersep\pgfmathresult%
- \else%
- \ifnum\c@pgf@counta=270\relax%
- \pgf@x\pgf@xa%
- \pgf@xa\pgf@ya%
- \pgf@ya\pgf@x%
- \let\pgfmathresult\xoutersep%
- \let\xoutersep\youtersep%
- \let\youtersep\pgfmathresult%
- \fi%
- \fi%
- \fi%
- \addtosavedmacro\rotate%
- %
- % Get some useful trig stuff.
- %
- \pgfmathdivide{\pgfkeysvalueof{/pgf/single arrow tip angle}}{2}%
- \let\halftipangle\pgfmathresult%
- \pgfmathcosec@{\halftipangle}%
- \let\cosechalftipangle\pgfmathresult%
- \pgfmathcos@{\halftipangle}%
- \pgfutil@tempdima\pgfmathresult pt\relax%
- \pgfutil@tempdima\cosechalftipangle\pgfutil@tempdima%
- \edef\cothalftipangle{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgfmathreciprocal@{\pgfmathresult}%
- \let\sechalftipangle\pgfmathresult%
- \pgfmathsin@{\halftipangle}%
- \pgfutil@tempdima\pgfmathresult pt\relax%
- \pgfutil@tempdima\sechalftipangle\pgfutil@tempdima%
- \edef\tanhalftipangle{\pgfmath@tonumber{\pgfutil@tempdima}}%
- %
- % Get the single arrow head extend, and adjust for minimum width.
- %
- \pgf@xb\pgf@ya%
- \pgf@xb\cothalftipangle\pgf@xb%
- \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/single arrow head extend}}%
- \pgf@yc\pgf@xc%
- \advance\pgf@xc\pgf@ya%
- \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/minimum width}}%
- \ifdim\pgf@xc<.5\pgfutil@tempdimb%
- \pgfutil@tempdimb.5\pgfutil@tempdimb%
- \pgfmathdivide@{\pgfmath@tonumber{\pgfutil@tempdimb}}{\pgfmath@tonumber{\pgf@xc}}%
- \pgf@ya\pgfmathresult\pgf@ya%
- \pgf@xc\pgfmathresult\pgf@xc%
- \pgf@yc\pgfmathresult\pgf@yc%
- \pgf@xb\pgfmathresult\pgf@xb%
- \fi%
- %
- % Now calculate the height of the arrow and adjust for minimum height.
- %
- \advance\pgf@xc-\pgf@ya%
- \pgf@xc\cothalftipangle\pgf@xc%
- \pgf@xa2.0\pgf@xa%
- \advance\pgf@xa\pgf@xb%
- \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@xa<\pgfutil@tempdimb%
- \pgf@xa\pgfutil@tempdimb%
- \fi%
- \advance\pgf@xa-\pgf@xb%
- \pgf@xa.5\pgf@xa%
- \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/single arrow head indent}}%
- %
- % Now:
- %
- % xa - .5 * width of the node minus xb.
- % ya - .5 * height of the node contents.
- % xb - distance from the end of the node contents to the arrow tip.
- % xc - distance from the end of the node contents to the back end of the arrow head.
- % yc - distance from the top of the node contents to the top end of the arrow head.
- %
- \pgfsavepgf@process\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }%
- \pgfsavepgf@process\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt%
- }%
- \pgfsavepgf@process\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+.5ex}%
- }%
- %
- % As the arrow is symmetrical it can be described by only four points:
- %
- \pgfsavepgf@process\arrowtip{%
- \pgf@x\pgf@xa%
- \advance\pgf@x\pgf@xb%
- \pgf@y0pt\relax%
- }%
- \pgfsavepgf@process\beforearrowtip{%
- \pgf@x\pgf@xa%
- \advance\pgf@x-\pgf@xc%
- \pgf@y\pgf@ya%
- \advance\pgf@y\pgf@yc%
- }%
- \pgfsavepgf@process\beforearrowhead{%
- \pgf@x\pgf@xa%
- \advance\pgf@x-\pgf@xc%
- \advance\pgf@x\pgfutil@tempdima%
- \pgf@y\pgf@ya%
- }%
- \pgfsavepgf@process\afterarrowtail{%
- \pgf@x-\pgf@xa%
- \pgf@y\pgf@ya%
- }%
- %
- % Calculate the anchor point at the arrow tip...
- %
- \pgfsavepgf@process\arrowtipanchor{%
- \pgfpointadd{\centerpoint}{\arrowtip}%
- \pgf@xa\xoutersep\relax%
- \advance\pgf@x\cosechalftipangle\pgf@xa%
- }%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \edef\externalradius{\the\pgf@x}%
- \addtosavedmacro\externalradius%
- %
- % ...and the rest of the points.
- %
- \pgfmathanglebetweenlines{\beforearrowtip}{\beforearrowhead}{\beforearrowtip}{\arrowtip}%
- \pgf@xa\xoutersep\relax%
- \pgfutil@tempdima\pgfmathresult pt\relax%
- \pgfutil@tempdima.5\pgfutil@tempdima%
- \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgf@xa\pgfmathresult\pgf@xa%
- \pgfutil@tempdima-\pgfutil@tempdima%
- \advance\pgfutil@tempdima180pt\relax%
- \advance\pgfutil@tempdima-\halftipangle pt\relax%
- %
- \pgfsavepgf@process\beforearrowtipanchor{%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgf@xa}%
- \pgf@xb\pgf@x%
- \pgf@yb\pgf@y%
- \pgf@process{\pgfpointadd{\centerpoint}{\beforearrowtip}}%
- \advance\pgf@x\pgf@xb%
- \advance\pgf@y\pgf@yb%
- }%
- \pgfmathanglebetweenpoints{\beforearrowhead}{\beforearrowtip}%
- \pgfutil@tempdima-\pgfmathresult pt\relax%
- \advance\pgfutil@tempdima180pt\relax%
- \pgfutil@tempdima.5\pgfutil@tempdima%
- \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgf@xa\xoutersep\relax%
- \pgf@xa\pgfmathresult\pgf@xa%
- \pgfutil@tempdima-\pgfutil@tempdima%
- \advance\pgfutil@tempdima180pt\relax%
- \pgfsavepgf@process\beforearrowheadanchor{%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgf@xa}%
- \pgf@xb\pgf@x%
- \pgf@yb\pgf@y%
- \pgf@process{\pgfpointadd{\centerpoint}{\beforearrowhead}}%
- \advance\pgf@x\pgf@xb%
- \advance\pgf@y\pgf@yb%
- }%
- \pgfsavepgf@process\afterarrowtailanchor{%
- \pgfpointadd{\centerpoint}{\afterarrowtail}%
- \advance\pgf@x-\xoutersep\relax%
- \advance\pgf@y\youtersep\relax%
- }%
- %
- \pgfmathanglebetweenpoints{\centerpoint}{\beforearrowtipanchor}%
- \let\center@angle@beforearrowtip\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\beforearrowheadanchor}%
- \let\center@angle@beforearrowhead\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\afterarrowtailanchor}%
- \let\center@angle@afterarrowtail\pgfmathresult%
- \addtosavedmacro\center@angle@beforearrowtip%
- \addtosavedmacro\center@angle@beforearrowhead%
- \addtosavedmacro\center@angle@afterarrowtail%
- %
- \pgfmathanglebetweenpoints{\midpoint}{\beforearrowtipanchor}%
- \let\mid@angle@beforearrowtip\pgfmathresult%
- \pgfmathanglebetweenpoints{\midpoint}{\beforearrowheadanchor}%
- \let\mid@angle@beforearrowhead\pgfmathresult%
- \pgfmathanglebetweenpoints{\midpoint}{\afterarrowtailanchor}%
- \let\mid@angle@afterarrowtail\pgfmathresult%
- \addtosavedmacro\mid@angle@beforearrowtip%
- \addtosavedmacro\mid@angle@beforearrowhead%
- \addtosavedmacro\mid@angle@afterarrowtail%
- %
- \pgfmathanglebetweenpoints{\basepoint}{\beforearrowtipanchor}%
- \let\base@angle@beforearrowtip\pgfmathresult%
- \pgfmathanglebetweenpoints{\basepoint}{\beforearrowheadanchor}%
- \let\base@angle@beforearrowhead\pgfmathresult%
- \pgfmathanglebetweenpoints{\basepoint}{\afterarrowtailanchor}%
- \let\base@angle@afterarrowtail\pgfmathresult%
- \addtosavedmacro\base@angle@beforearrowtip%
- \addtosavedmacro\base@angle@beforearrowhead%
- \addtosavedmacro\base@angle@afterarrowtail%
- %
- \addtosavedmacro\arrowtipanchor%
- \addtosavedmacro\beforearrowtipanchor%
- \addtosavedmacro\beforearrowheadanchor%
- \addtosavedmacro\afterarrowtailanchor%
- }
- \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}{%
- \getsinglearrowpoints%
- \let\pgf@singlearrow@referencepoint\midpoint%
- \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }
- \anchor{mid west}{%
- \getsinglearrowpoints%
- \let\pgf@singlearrow@referencepoint\midpoint%
- \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }
- \anchor{base}{\basepoint}%
- \anchor{base east}{%
- \getsinglearrowpoints%
- \let\pgf@singlearrow@referencepoint\basepoint%
- \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }
- \anchor{base west}{%
- \getsinglearrowpoints%
- \let\pgf@singlearrow@referencepoint\basepoint%
- \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }
- \anchor{north}{%
- \getsinglearrowpoints%
- \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{0pt}{\externalradius}}%
- }
- \anchor{south}{%
- \getsinglearrowpoints%
- \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{0pt}{-\externalradius}}%
- }
- \anchor{east}{%
- \getsinglearrowpoints%
- \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }
- \anchor{west}{%
- \getsinglearrowpoints%
- \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }
- \anchor{north east}{%
- \getsinglearrowpoints%
- \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{\externalradius}{\externalradius}}%
- }
- \anchor{south east}{%
- \getsinglearrowpoints%
- \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{\externalradius}{-\externalradius}}%
- }
- \anchor{south west}{%
- \getsinglearrowpoints%
- \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{-\externalradius}{-\externalradius}}%
- }
- \anchor{north west}{%
- \getsinglearrowpoints%
- \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{-\externalradius}{\externalradius}}%
- }
- \anchor{before head}{%
- \getsinglearrowpoints%
- \pgfmathrotatepointaround{\beforearrowheadanchor}{\centerpoint}{\rotate}%
- }%
- \anchor{before tip}{%
- \getsinglearrowpoints%
- \pgfmathrotatepointaround{\beforearrowtipanchor}{\centerpoint}{\rotate}%
- }%
- \anchor{tip}{%
- \getsinglearrowpoints%
- \pgfmathrotatepointaround{\arrowtipanchor}{\centerpoint}{\rotate}%
- }%
- \anchor{after tip}{%
- \getsinglearrowpoints%
- \pgfmathrotatepointaround{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
- \pgf@y-\pgf@y%
- }{\centerpoint}}%
- {\centerpoint}{\rotate}%
- }
- \anchor{after head}{%
- \getsinglearrowpoints%
- \pgfmathrotatepointaround{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
- \pgf@y-\pgf@y%
- }{\centerpoint}}%
- {\centerpoint}{\rotate}%
- }
- \anchor{before tail}{%
- \getsinglearrowpoints%
- \pgfmathrotatepointaround{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\afterarrowtailanchor}%
- \pgf@y-\pgf@y%
- }{\centerpoint}}%
- {\centerpoint}{\rotate}%
- }
- \anchor{after tail}{%
- \getsinglearrowpoints%
- \pgfmathrotatepointaround{\afterarrowtailanchor}{\centerpoint}{\rotate}%
- }
- \anchor{tail}{%
- \getsinglearrowpoints%
- \pgfpointlineattime{0.5}{%
- \pgfmathrotatepointaround{\afterarrowtailanchor}{\centerpoint}{\rotate}%
- }%
- {%
- \pgfmathrotatepointaround{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\afterarrowtailanchor}%
- \pgf@y-\pgf@y%
- }{\centerpoint}}%
- {\centerpoint}{\rotate}%
- }%
- }%
- \backgroundpath{%
- {%
- \pgftransformshift{\centerpoint}%
- \pgftransformrotate{\rotate}%
- \pgfpathmoveto{\arrowtip}%
- \pgfpathlineto{\beforearrowtip}%
- \pgfpathlineto{\beforearrowhead}%
- \pgfpathlineto{\afterarrowtail}%
- \pgfpathlineto{\afterarrowtail\pgf@y-\pgf@y}%
- \pgfpathlineto{\beforearrowhead\pgf@y-\pgf@y}%
- \pgfpathlineto{\beforearrowtip\pgf@y-\pgf@y}%
- }%
- \pgfpathclose%
- }%
- \anchorborder{%
- \pgfsavepgf@process\externalpoint{}%
- \getsinglearrowpoints%
- \pgfutil@ifundefined{pgf@singlearrow@referencepoint}{\let\referencepoint\centerpoint}%
- {\let\referencepoint\pgf@singlearrow@referencepoint}%
- \pgfsavepgf@process\externalpoint{%
- \externalpoint%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \referencepoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya}%
- \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
- \pgfmathsubtract@{\pgfmathresult}{\rotate}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \let\externalangle\pgfmathresult%
- \pgf@x\externalangle pt\relax%
- \ifx\referencepoint\midpoint%
- \pgf@xa\mid@angle@beforearrowtip pt\relax%
- \pgf@xb\mid@angle@beforearrowhead pt\relax%
- \pgf@xc\mid@angle@afterarrowtail pt\relax%
- \else%
- \ifx\referencepoint\basepoint%
- \pgf@xa\base@angle@beforearrowtip pt\relax%
- \pgf@xb\base@angle@beforearrowhead pt\relax%
- \pgf@xc\base@angle@afterarrowtail pt\relax%
- \else%
- \pgf@xa\center@angle@beforearrowtip pt\relax%
- \pgf@xb\center@angle@beforearrowhead pt\relax%
- \pgf@xc\center@angle@afterarrowtail pt\relax%
- \fi%
- \fi%
- \ifdim\pgf@x<\pgf@xa%
- \let\firstpoint\arrowtipanchor%
- \let\secondpoint\beforearrowtipanchor%
- \else%
- \ifdim\pgf@x<\pgf@xb%
- \ifdim\pgf@xb<\pgf@xa%
- \let\firstpoint\arrowtipanchor%
- \let\secondpoint\beforearrowtipanchor%
- \else%
- \let\firstpoint\beforearrowheadanchor%
- \let\secondpoint\beforearrowtipanchor%
- \fi%
- \else%
- \ifdim\pgf@x<\pgf@xc%
- \let\firstpoint\beforearrowheadanchor%
- \let\secondpoint\afterarrowtailanchor%
- \else%
- \pgf@xc-\pgf@xc%
- \advance\pgf@xc360pt\relax%
- \ifdim\pgf@x<\pgf@xc%
- \let\firstpoint\afterarrowtailanchor%
- \pgfsavepgf@process\secondpoint{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\afterarrowtailanchor}%
- \pgf@y-\pgf@y%
- }{\centerpoint}%
- }%
- \else%
- \pgf@xa-\pgf@xa%
- \advance\pgf@xa360pt\relax%
- \pgf@xb-\pgf@xb%
- \advance\pgf@xb360pt\relax%
- \ifdim\pgf@x<\pgf@xa%
- \ifdim\pgf@x<\pgf@xb%
- \pgfsavepgf@process\firstpoint{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\afterarrowtailanchor}%
- \pgf@y-\pgf@y%
- }{\centerpoint}%
- }%
- \pgfsavepgf@process\secondpoint{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
- \pgf@y-\pgf@y%
- }{\centerpoint}%
- }%
- \else%
- \ifdim\pgf@xb<\pgf@xa%
- \pgfsavepgf@process\firstpoint{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
- \pgf@y-\pgf@y%
- }{\centerpoint}%
- }%
- \else%
- \pgfsavepgf@process\firstpoint{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\arrowtipanchor}%
- \pgf@y-\pgf@y%
- }{\centerpoint}%
- }%
- \fi%
- \pgfsavepgf@process\secondpoint{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
- \pgf@y-\pgf@y%
- }{\centerpoint}%
- }%
- \fi%
- \else%
- \pgfsavepgf@process\firstpoint{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
- \pgf@y-\pgf@y%
- }{\centerpoint}%
- }%
- \let\secondpoint\arrowtipanchor%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \pgfsavepgf@process\firstpoint{%
- \pgfmathrotatepointaround{\firstpoint}{\centerpoint}{\rotate}%
- }%
- \pgfsavepgf@process\secondpoint{%
- \pgfmathrotatepointaround{\secondpoint}{\centerpoint}{\rotate}%
- }%
- \pgfpointintersectionoflines{\referencepoint}{\externalpoint}%
- {\firstpoint}{\secondpoint}%
- }%
-}
+ \savedmacro\getsinglearrowpoints{%
+ %
+ % Get the outer sep.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \edef\xoutersep{\the\pgf@x}%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \edef\youtersep{\the\pgf@y}%
+ %
+ % Get the node dimensions.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@xa.5\wd\pgfnodeparttextbox%
+ \advance\pgf@xa.5\pgflinewidth%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@ya.5\ht\pgfnodeparttextbox%
+ \advance\pgf@ya.5\dp\pgfnodeparttextbox%
+ \advance\pgf@ya.5\pgflinewidth%
+ \ifpgfshapeborderusesincircle%
+ \ifdim\pgf@xa<\pgf@ya%
+ \pgf@xa\pgf@ya%
+ \fi%
+ \pgf@xa1.41421\pgf@xa%
+ \pgf@ya\pgf@xa%
+ \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
+ \ifdim\xoutersep>\youtersep\relax%
+ \let\youtersep\xoutersep%
+ \else%
+ \let\xoutersep\youtersep%
+ \fi%
+ \else%
+ %
+ % Round the rotation.
+ %
+ \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
+ \pgfmathmod@{\rotate}{360}%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter\c@pgf@counta\pgfmathresult\relax\pgfmath@%
+ \advance\c@pgf@counta45\relax%
+ \divide\c@pgf@counta90\relax%
+ \multiply\c@pgf@counta90\relax%
+ \ifnum\c@pgf@counta<0\relax%
+ \advance\c@pgf@counta360\relax%
+ \fi%
+ \edef\rotate{\the\c@pgf@counta}%
+ %
+ % Calculate the width and height of the node
+ % contents, according to any border rotation.
+ %
+ \ifnum\c@pgf@counta=90\relax%
+ \pgf@x\pgf@xa%
+ \pgf@xa\pgf@ya%
+ \pgf@ya\pgf@x%
+ \let\pgfmathresult\xoutersep%
+ \let\xoutersep\youtersep%
+ \let\youtersep\pgfmathresult%
+ \else%
+ \ifnum\c@pgf@counta=270\relax%
+ \pgf@x\pgf@xa%
+ \pgf@xa\pgf@ya%
+ \pgf@ya\pgf@x%
+ \let\pgfmathresult\xoutersep%
+ \let\xoutersep\youtersep%
+ \let\youtersep\pgfmathresult%
+ \fi%
+ \fi%
+ \fi%
+ \addtosavedmacro\rotate%
+ %
+ % Get some useful trig stuff.
+ %
+ \pgfmathdivide{\pgfkeysvalueof{/pgf/single arrow tip angle}}{2}%
+ \let\halftipangle\pgfmathresult%
+ \pgfmathcosec@{\halftipangle}%
+ \let\cosechalftipangle\pgfmathresult%
+ \pgfmathcos@{\halftipangle}%
+ \pgfutil@tempdima\pgfmathresult pt\relax%
+ \pgfutil@tempdima\cosechalftipangle\pgfutil@tempdima%
+ \edef\cothalftipangle{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \let\sechalftipangle\pgfmathresult%
+ \pgfmathsin@{\halftipangle}%
+ \pgfutil@tempdima\pgfmathresult pt\relax%
+ \pgfutil@tempdima\sechalftipangle\pgfutil@tempdima%
+ \edef\tanhalftipangle{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ %
+ % Get the single arrow head extend, and adjust for minimum width.
+ %
+ \pgf@xb\pgf@ya%
+ \pgf@xb\cothalftipangle\pgf@xb%
+ \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/single arrow head extend}}%
+ \pgf@yc\pgf@xc%
+ \advance\pgf@xc\pgf@ya%
+ \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/minimum width}}%
+ \ifdim\pgf@xc<.5\pgfutil@tempdimb%
+ \pgfutil@tempdimb.5\pgfutil@tempdimb%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgfutil@tempdimb}}{\pgfmath@tonumber{\pgf@xc}}%
+ \pgf@ya\pgfmathresult\pgf@ya%
+ \pgf@xc\pgfmathresult\pgf@xc%
+ \pgf@yc\pgfmathresult\pgf@yc%
+ \pgf@xb\pgfmathresult\pgf@xb%
+ \fi%
+ %
+ % Now calculate the height of the arrow and adjust for minimum height.
+ %
+ \advance\pgf@xc-\pgf@ya%
+ \pgf@xc\cothalftipangle\pgf@xc%
+ \pgf@xa2.0\pgf@xa%
+ \advance\pgf@xa\pgf@xb%
+ \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@xa<\pgfutil@tempdimb%
+ \pgf@xa\pgfutil@tempdimb%
+ \fi%
+ \advance\pgf@xa-\pgf@xb%
+ \pgf@xa.5\pgf@xa%
+ \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/single arrow head indent}}%
+ %
+ % Now:
+ %
+ % xa - .5 * width of the node minus xb.
+ % ya - .5 * height of the node contents.
+ % xb - distance from the end of the node contents to the arrow tip.
+ % xc - distance from the end of the node contents to the back end of the arrow head.
+ % yc - distance from the top of the node contents to the top end of the arrow head.
+ %
+ \pgfsavepgf@process\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \pgfsavepgf@process\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt%
+ }%
+ \pgfsavepgf@process\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+.5ex}%
+ }%
+ %
+ % As the arrow is symmetrical it can be described by only four points:
+ %
+ \pgfsavepgf@process\arrowtip{%
+ \pgf@x\pgf@xa%
+ \advance\pgf@x\pgf@xb%
+ \pgf@y0pt\relax%
+ }%
+ \pgfsavepgf@process\beforearrowtip{%
+ \pgf@x\pgf@xa%
+ \advance\pgf@x-\pgf@xc%
+ \pgf@y\pgf@ya%
+ \advance\pgf@y\pgf@yc%
+ }%
+ \pgfsavepgf@process\beforearrowhead{%
+ \pgf@x\pgf@xa%
+ \advance\pgf@x-\pgf@xc%
+ \advance\pgf@x\pgfutil@tempdima%
+ \pgf@y\pgf@ya%
+ }%
+ \pgfsavepgf@process\afterarrowtail{%
+ \pgf@x-\pgf@xa%
+ \pgf@y\pgf@ya%
+ }%
+ %
+ % Calculate the anchor point at the arrow tip...
+ %
+ \pgfsavepgf@process\arrowtipanchor{%
+ \pgfpointadd{\centerpoint}{\arrowtip}%
+ \pgf@xa\xoutersep\relax%
+ \advance\pgf@x\cosechalftipangle\pgf@xa%
+ }%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \edef\externalradius{\the\pgf@x}%
+ \addtosavedmacro\externalradius%
+ %
+ % ...and the rest of the points.
+ %
+ \pgfmathanglebetweenlines{\beforearrowtip}{\beforearrowhead}{\beforearrowtip}{\arrowtip}%
+ \pgf@xa\xoutersep\relax%
+ \pgfutil@tempdima\pgfmathresult pt\relax%
+ \pgfutil@tempdima.5\pgfutil@tempdima%
+ \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \pgf@xa\pgfmathresult\pgf@xa%
+ \pgfutil@tempdima-\pgfutil@tempdima%
+ \advance\pgfutil@tempdima180pt\relax%
+ \advance\pgfutil@tempdima-\halftipangle pt\relax%
+ %
+ \pgfsavepgf@process\beforearrowtipanchor{%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgf@xa}%
+ \pgf@xb\pgf@x%
+ \pgf@yb\pgf@y%
+ \pgf@process{\pgfpointadd{\centerpoint}{\beforearrowtip}}%
+ \advance\pgf@x\pgf@xb%
+ \advance\pgf@y\pgf@yb%
+ }%
+ \pgfmathanglebetweenpoints{\beforearrowhead}{\beforearrowtip}%
+ \pgfutil@tempdima-\pgfmathresult pt\relax%
+ \advance\pgfutil@tempdima180pt\relax%
+ \pgfutil@tempdima.5\pgfutil@tempdima%
+ \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \pgf@xa\xoutersep\relax%
+ \pgf@xa\pgfmathresult\pgf@xa%
+ \pgfutil@tempdima-\pgfutil@tempdima%
+ \advance\pgfutil@tempdima180pt\relax%
+ \pgfsavepgf@process\beforearrowheadanchor{%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgf@xa}%
+ \pgf@xb\pgf@x%
+ \pgf@yb\pgf@y%
+ \pgf@process{\pgfpointadd{\centerpoint}{\beforearrowhead}}%
+ \advance\pgf@x\pgf@xb%
+ \advance\pgf@y\pgf@yb%
+ }%
+ \pgfsavepgf@process\afterarrowtailanchor{%
+ \pgfpointadd{\centerpoint}{\afterarrowtail}%
+ \advance\pgf@x-\xoutersep\relax%
+ \advance\pgf@y\youtersep\relax%
+ }%
+ %
+ \pgfmathanglebetweenpoints{\centerpoint}{\beforearrowtipanchor}%
+ \let\center@angle@beforearrowtip\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\beforearrowheadanchor}%
+ \let\center@angle@beforearrowhead\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\afterarrowtailanchor}%
+ \let\center@angle@afterarrowtail\pgfmathresult%
+ \addtosavedmacro\center@angle@beforearrowtip%
+ \addtosavedmacro\center@angle@beforearrowhead%
+ \addtosavedmacro\center@angle@afterarrowtail%
+ %
+ \pgfmathanglebetweenpoints{\midpoint}{\beforearrowtipanchor}%
+ \let\mid@angle@beforearrowtip\pgfmathresult%
+ \pgfmathanglebetweenpoints{\midpoint}{\beforearrowheadanchor}%
+ \let\mid@angle@beforearrowhead\pgfmathresult%
+ \pgfmathanglebetweenpoints{\midpoint}{\afterarrowtailanchor}%
+ \let\mid@angle@afterarrowtail\pgfmathresult%
+ \addtosavedmacro\mid@angle@beforearrowtip%
+ \addtosavedmacro\mid@angle@beforearrowhead%
+ \addtosavedmacro\mid@angle@afterarrowtail%
+ %
+ \pgfmathanglebetweenpoints{\basepoint}{\beforearrowtipanchor}%
+ \let\base@angle@beforearrowtip\pgfmathresult%
+ \pgfmathanglebetweenpoints{\basepoint}{\beforearrowheadanchor}%
+ \let\base@angle@beforearrowhead\pgfmathresult%
+ \pgfmathanglebetweenpoints{\basepoint}{\afterarrowtailanchor}%
+ \let\base@angle@afterarrowtail\pgfmathresult%
+ \addtosavedmacro\base@angle@beforearrowtip%
+ \addtosavedmacro\base@angle@beforearrowhead%
+ \addtosavedmacro\base@angle@afterarrowtail%
+ %
+ \addtosavedmacro\arrowtipanchor%
+ \addtosavedmacro\beforearrowtipanchor%
+ \addtosavedmacro\beforearrowheadanchor%
+ \addtosavedmacro\afterarrowtailanchor%
+ }%
+ \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}{%
+ \getsinglearrowpoints%
+ \let\pgf@singlearrow@referencepoint\midpoint%
+ \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{mid west}{%
+ \getsinglearrowpoints%
+ \let\pgf@singlearrow@referencepoint\midpoint%
+ \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{base}{\basepoint}%
+ \anchor{base east}{%
+ \getsinglearrowpoints%
+ \let\pgf@singlearrow@referencepoint\basepoint%
+ \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{base west}{%
+ \getsinglearrowpoints%
+ \let\pgf@singlearrow@referencepoint\basepoint%
+ \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{north}{%
+ \getsinglearrowpoints%
+ \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{0pt}{\externalradius}}%
+ }%
+ \anchor{south}{%
+ \getsinglearrowpoints%
+ \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{0pt}{-\externalradius}}%
+ }%
+ \anchor{east}{%
+ \getsinglearrowpoints%
+ \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{west}{%
+ \getsinglearrowpoints%
+ \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{north east}{%
+ \getsinglearrowpoints%
+ \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{\externalradius}{\externalradius}}%
+ }%
+ \anchor{south east}{%
+ \getsinglearrowpoints%
+ \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{\externalradius}{-\externalradius}}%
+ }%
+ \anchor{south west}{%
+ \getsinglearrowpoints%
+ \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{-\externalradius}{-\externalradius}}%
+ }%
+ \anchor{north west}{%
+ \getsinglearrowpoints%
+ \csname pgf@anchor@single arrow@border\endcsname{\pgfqpoint{-\externalradius}{\externalradius}}%
+ }%
+ \anchor{before head}{%
+ \getsinglearrowpoints%
+ \pgfmathrotatepointaround{\beforearrowheadanchor}{\centerpoint}{\rotate}%
+ }%
+ \anchor{before tip}{%
+ \getsinglearrowpoints%
+ \pgfmathrotatepointaround{\beforearrowtipanchor}{\centerpoint}{\rotate}%
+ }%
+ \anchor{tip}{%
+ \getsinglearrowpoints%
+ \pgfmathrotatepointaround{\arrowtipanchor}{\centerpoint}{\rotate}%
+ }%
+ \anchor{after tip}{%
+ \getsinglearrowpoints%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}}%
+ {\centerpoint}{\rotate}%
+ }%
+ \anchor{after head}{%
+ \getsinglearrowpoints%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}}%
+ {\centerpoint}{\rotate}%
+ }%
+ \anchor{before tail}{%
+ \getsinglearrowpoints%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\afterarrowtailanchor}%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}}%
+ {\centerpoint}{\rotate}%
+ }%
+ \anchor{after tail}{%
+ \getsinglearrowpoints%
+ \pgfmathrotatepointaround{\afterarrowtailanchor}{\centerpoint}{\rotate}%
+ }%
+ \anchor{tail}{%
+ \getsinglearrowpoints%
+ \pgfpointlineattime{0.5}{%
+ \pgfmathrotatepointaround{\afterarrowtailanchor}{\centerpoint}{\rotate}%
+ }%
+ {%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\afterarrowtailanchor}%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}}%
+ {\centerpoint}{\rotate}%
+ }%
+ }%
+ \backgroundpath{%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgftransformrotate{\rotate}%
+ \pgfpathmoveto{\arrowtip}%
+ \pgfpathlineto{\beforearrowtip}%
+ \pgfpathlineto{\beforearrowhead}%
+ \pgfpathlineto{\afterarrowtail}%
+ \pgfpathlineto{\afterarrowtail\pgf@y-\pgf@y}%
+ \pgfpathlineto{\beforearrowhead\pgf@y-\pgf@y}%
+ \pgfpathlineto{\beforearrowtip\pgf@y-\pgf@y}%
+ }%
+ \pgfpathclose%
+ }%
+ \anchorborder{%
+ \pgfsavepgf@process\externalpoint{}%
+ \getsinglearrowpoints%
+ \pgfutil@ifundefined{pgf@singlearrow@referencepoint}{\let\referencepoint\centerpoint}%
+ {\let\referencepoint\pgf@singlearrow@referencepoint}%
+ \pgfsavepgf@process\externalpoint{%
+ \externalpoint%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \referencepoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya}%
+ \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
+ \pgfmathsubtract@{\pgfmathresult}{\rotate}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \let\externalangle\pgfmathresult%
+ \pgf@x\externalangle pt\relax%
+ \ifx\referencepoint\midpoint%
+ \pgf@xa\mid@angle@beforearrowtip pt\relax%
+ \pgf@xb\mid@angle@beforearrowhead pt\relax%
+ \pgf@xc\mid@angle@afterarrowtail pt\relax%
+ \else%
+ \ifx\referencepoint\basepoint%
+ \pgf@xa\base@angle@beforearrowtip pt\relax%
+ \pgf@xb\base@angle@beforearrowhead pt\relax%
+ \pgf@xc\base@angle@afterarrowtail pt\relax%
+ \else%
+ \pgf@xa\center@angle@beforearrowtip pt\relax%
+ \pgf@xb\center@angle@beforearrowhead pt\relax%
+ \pgf@xc\center@angle@afterarrowtail pt\relax%
+ \fi%
+ \fi%
+ \ifdim\pgf@x<\pgf@xa%
+ \let\firstpoint\arrowtipanchor%
+ \let\secondpoint\beforearrowtipanchor%
+ \else%
+ \ifdim\pgf@x<\pgf@xb%
+ \ifdim\pgf@xb<\pgf@xa%
+ \let\firstpoint\arrowtipanchor%
+ \let\secondpoint\beforearrowtipanchor%
+ \else%
+ \let\firstpoint\beforearrowheadanchor%
+ \let\secondpoint\beforearrowtipanchor%
+ \fi%
+ \else%
+ \ifdim\pgf@x<\pgf@xc%
+ \let\firstpoint\beforearrowheadanchor%
+ \let\secondpoint\afterarrowtailanchor%
+ \else%
+ \pgf@xc-\pgf@xc%
+ \advance\pgf@xc360pt\relax%
+ \ifdim\pgf@x<\pgf@xc%
+ \let\firstpoint\afterarrowtailanchor%
+ \pgfsavepgf@process\secondpoint{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\afterarrowtailanchor}%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}%
+ }%
+ \else%
+ \pgf@xa-\pgf@xa%
+ \advance\pgf@xa360pt\relax%
+ \pgf@xb-\pgf@xb%
+ \advance\pgf@xb360pt\relax%
+ \ifdim\pgf@x<\pgf@xa%
+ \ifdim\pgf@x<\pgf@xb%
+ \pgfsavepgf@process\firstpoint{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\afterarrowtailanchor}%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}%
+ }%
+ \pgfsavepgf@process\secondpoint{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}%
+ }%
+ \else%
+ \ifdim\pgf@xb<\pgf@xa%
+ \pgfsavepgf@process\firstpoint{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}%
+ }%
+ \else%
+ \pgfsavepgf@process\firstpoint{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\arrowtipanchor}%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}%
+ }%
+ \fi%
+ \pgfsavepgf@process\secondpoint{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}%
+ }%
+ \fi%
+ \else%
+ \pgfsavepgf@process\firstpoint{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}%
+ }%
+ \let\secondpoint\arrowtipanchor%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \pgfsavepgf@process\firstpoint{%
+ \pgfmathrotatepointaround{\firstpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfsavepgf@process\secondpoint{%
+ \pgfmathrotatepointaround{\secondpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfpointintersectionoflines{\referencepoint}{\externalpoint}%
+ {\firstpoint}{\secondpoint}%
+ }%
+}%
@@ -555,504 +556,505 @@
% /pgf/double arrow head sep
\pgfkeys{/pgf/.cd,
- double arrow tip angle/.initial=90,
- double arrow head extend/.initial=.25cm,
- double arrow head indent/.initial=0cm}
+ double arrow tip angle/.initial=90,
+ double arrow head extend/.initial=.25cm,
+ double arrow head indent/.initial=0cm,
+}%
% Shape double arrow
%
%
\pgfdeclareshape{double arrow}{%
- \savedmacro\getdoublearrowpoints{%
- %
- % Get the outer sep.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- \edef\xoutersep{\the\pgf@x}%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- \edef\youtersep{\the\pgf@y}%
- %
- % Get the node dimensions.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@xa.5\wd\pgfnodeparttextbox%
- \advance\pgf@xa.5\pgflinewidth%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@ya.5\ht\pgfnodeparttextbox%
- \advance\pgf@ya.5\dp\pgfnodeparttextbox%
- \advance\pgf@ya.5\pgflinewidth%
- \ifpgfshapeborderusesincircle%
- \ifdim\pgf@xa<\pgf@ya%
- \pgf@xa\pgf@ya%
- \fi%
- \pgf@xa1.41421\pgf@xa%
- \pgf@ya\pgf@xa%
- \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
- \ifdim\xoutersep>\youtersep\relax%
- \let\youtersep\xoutersep%
- \else%
- \let\xoutersep\youtersep%
- \fi%
- \else%
- %
- % Round the rotation.
- %
- \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}
- \pgfmathmod@{\rotate}{360}%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \expandafter\c@pgf@counta\pgfmathresult\relax\pgfmath@%
- \advance\c@pgf@counta45\relax%
- \divide\c@pgf@counta90\relax%
- \multiply\c@pgf@counta90\relax%
- \ifnum\c@pgf@counta<0\relax%
- \advance\c@pgf@counta360\relax%
- \fi%
- \edef\rotate{\the\c@pgf@counta}%
- %
- % Calculate the width and height of the node
- % contents, according to any border rotation.
- %
- \ifnum\c@pgf@counta=90\relax%
- \pgf@x\pgf@xa%
- \pgf@xa\pgf@ya%
- \pgf@ya\pgf@x%
- \let\pgfmathresult\xoutersep%
- \let\xoutersep\youtersep%
- \let\youtersep\pgfmathresult%
- \else%
- \ifnum\c@pgf@counta=270\relax%
- \pgf@x\pgf@xa%
- \pgf@xa\pgf@ya%
- \pgf@ya\pgf@x%
- \let\pgfmathresult\xoutersep%
- \let\xoutersep\youtersep%
- \let\youtersep\pgfmathresult%
- \fi%
- \fi%
- \fi%
- \addtosavedmacro\rotate%
- %
- % Get some useful trig stuff.
- %
- \pgfmathdivide{\pgfkeysvalueof{/pgf/double arrow tip angle}}{2}%
- \let\halftipangle\pgfmathresult%
- \pgfmathcosec@{\halftipangle}%
- \let\cosechalftipangle\pgfmathresult%
- \pgfmathcos@{\halftipangle}%
- \pgfutil@tempdima\pgfmathresult pt\relax%
- \pgfutil@tempdima\cosechalftipangle\pgfutil@tempdima%
- \edef\cothalftipangle{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgfmathreciprocal@{\pgfmathresult}%
- \let\sechalftipangle\pgfmathresult%
- \pgfmathsin@{\halftipangle}%
- \pgfutil@tempdima\pgfmathresult pt\relax%
- \pgfutil@tempdima\sechalftipangle\pgfutil@tempdima%
- \edef\tanhalftipangle{\pgfmath@tonumber{\pgfutil@tempdima}}%
- %
- % Get the double arrow head extend, and adjust for minimum width.
- %
- \pgf@xb\pgf@ya%
- \pgf@xb\cothalftipangle\pgf@xb%
- \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/double arrow head extend}}%
- \pgf@yc\pgf@xc%
- \advance\pgf@xc\pgf@ya%
- \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/minimum width}}%
- \ifdim\pgf@xc<.5\pgfutil@tempdimb%
- \pgfutil@tempdimb.5\pgfutil@tempdimb%
- \pgfmathdivide@{\pgfmath@tonumber{\pgfutil@tempdimb}}{\pgfmath@tonumber{\pgf@xc}}%
- \pgf@ya\pgfmathresult\pgf@ya%
- \pgf@xc\pgfmathresult\pgf@xc%
- \pgf@yc\pgfmathresult\pgf@yc%
- \pgf@xb\pgfmathresult\pgf@xb%
- \fi%
- %
- % Now calculate the height of the arrow and adjust for minimum height.
- %
- \advance\pgf@xc-\pgf@ya%
- \pgf@xc\cothalftipangle\pgf@xc%
- \advance\pgf@xa\pgf@xb%
- \pgf@xa2.0\pgf@xa%
- \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@xa<\pgfutil@tempdimb%
- \pgf@xa\pgfutil@tempdimb%
- \fi%
- \pgf@xa.5\pgf@xa%
- \advance\pgf@xa-\pgf@xb%
- \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/double arrow head indent}}%
- %
- % Now:
- %
- % xa - .5 * width of the node minus xb.
- % ya - .5 * height of the node contents.
- % xb - distance from the end of the node contents to the arrow tip.
- % xc - distance from the end of the node contents to the back end of the arrow head.
- % yc - distance from the top of the node contents to the top end of the arrow head.
- %
- \pgfsavepgf@process\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }%
- \pgfsavepgf@process\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt%
- }%
- \pgfsavepgf@process\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+.5ex}%
- }%
- %
- % As the arrow is symmetrical it can be described by only 3 points:
- %
- \pgfsavepgf@process\arrowtip{%
- \pgf@x\pgf@xa%
- \advance\pgf@x\pgf@xb%
- \pgf@y0pt\relax%
- }%
- \pgfsavepgf@process\beforearrowtip{%
- \pgf@x\pgf@xa%
- \advance\pgf@x-\pgf@xc%
- \pgf@y\pgf@ya%
- \advance\pgf@y\pgf@yc%
- }%
- \pgfsavepgf@process\beforearrowhead{%
- \pgf@x\pgf@xa%
- \advance\pgf@x-\pgf@xc%
- \advance\pgf@x\pgfutil@tempdima%
- \pgf@y\pgf@ya%
- }%
- %
- % Calculate the anchor point at the arrow tip.
- %
- \pgfsavepgf@process\arrowtipanchor{%
- \pgfpointadd{\centerpoint}{\arrowtip}%
- \pgf@xa\xoutersep\relax%
- \advance\pgf@x\cosechalftipangle\pgf@xa%
- }%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \edef\externalradius{\the\pgf@x}%
- \addtosavedmacro\externalradius%
- %
- %
- \pgfmathanglebetweenlines{\beforearrowtip}{\beforearrowhead}{\beforearrowtip}{\arrowtip}%
- \pgf@xa\xoutersep\relax%
- \pgfutil@tempdima\pgfmathresult pt\relax%
- \pgfutil@tempdima.5\pgfutil@tempdima%
- \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgf@xa\pgfmathresult\pgf@xa%
- \pgfutil@tempdima-\pgfutil@tempdima%
- \advance\pgfutil@tempdima180pt\relax%
- \advance\pgfutil@tempdima-\halftipangle pt\relax%
- \pgfsavepgf@process\beforearrowtipanchor{%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgf@xa}%
- \pgf@xb\pgf@x%
- \pgf@yb\pgf@y%
- \pgf@process{\pgfpointadd{\centerpoint}{\beforearrowtip}}%
- \advance\pgf@x\pgf@xb%
- \advance\pgf@y\pgf@yb%
- }%
- \pgfmathanglebetweenpoints{\beforearrowhead}{\beforearrowtip}%
- \pgfutil@tempdima-\pgfmathresult pt\relax%
- \advance\pgfutil@tempdima180pt\relax%
- \pgfutil@tempdima.5\pgfutil@tempdima%
- \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgf@xa\xoutersep\relax%
- \pgf@xa\pgfmathresult\pgf@xa%
- \pgfutil@tempdima-\pgfutil@tempdima%
- \advance\pgfutil@tempdima180pt\relax%
- \pgfsavepgf@process\beforearrowheadanchor{%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgf@xa}%
- \pgf@xb\pgf@x%
- \pgf@yb\pgf@y%
- \pgf@process{\pgfpointadd{\centerpoint}{\beforearrowhead}}%
- \advance\pgf@x\pgf@xb%
- \advance\pgf@y\pgf@yb%
- }%
- %
- \pgfmathanglebetweenpoints{\centerpoint}{\beforearrowtipanchor}%
- \let\center@angle@beforearrowtip\pgfmathresult%
- \addtosavedmacro\center@angle@beforearrowtip%
- %
- \pgfmathanglebetweenpoints{\midpoint}{\beforearrowtipanchor}%
- \let\mid@angle@beforearrowtip\pgfmathresult%
- \addtosavedmacro\mid@angle@beforearrowtip%
- %
- \pgfmathanglebetweenpoints{\basepoint}{\beforearrowtipanchor}%
- \let\base@angle@beforearrowtip\pgfmathresult%
- \addtosavedmacro\base@angle@beforearrowtip%
- %
- \addtosavedmacro\arrowtipanchor%
- \addtosavedmacro\beforearrowtipanchor%
- \addtosavedmacro\beforearrowheadanchor%
- }
- \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}{%
- \getdoublearrowpoints%
- \let\pgf@singlearrow@referencepoint\midpoint%
- \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }
- \anchor{mid west}{%
- \getdoublearrowpoints%
- \let\pgf@singlearrow@referencepoint\midpoint%
- \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }
- \anchor{base}{\basepoint}%
- \anchor{base east}{%
- \getdoublearrowpoints%
- \let\pgf@singlearrow@referencepoint\basepoint%
- \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }
- \anchor{base west}{%
- \getdoublearrowpoints%
- \let\pgf@singlearrow@referencepoint\basepoint%
- \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }
- \anchor{north}{%
- \getdoublearrowpoints%
- \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{0pt}{\externalradius}}%
- }
- \anchor{south}{%
- \getdoublearrowpoints%
- \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{0pt}{-\externalradius}}%
- }
- \anchor{east}{%
- \getdoublearrowpoints%
- \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }
- \anchor{west}{%
- \getdoublearrowpoints%
- \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }
- \anchor{north east}{%
- \getdoublearrowpoints%
- \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{\externalradius}{\externalradius}}%
- }
- \anchor{south east}{%
- \getdoublearrowpoints%
- \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{\externalradius}{-\externalradius}}%
- }
- \anchor{south west}{%
- \getdoublearrowpoints%
- \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{-\externalradius}{-\externalradius}}%
- }
- \anchor{north west}{%
- \getdoublearrowpoints%
- \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{-\externalradius}{\externalradius}}%
- }
- \anchor{before head 1}{%
- \getdoublearrowpoints%
- \pgfmathrotatepointaround{\beforearrowheadanchor}{\centerpoint}{\rotate}%
- }%
- \anchor{before tip 1}{%
- \getdoublearrowpoints%
- \pgfmathrotatepointaround{\beforearrowtipanchor}{\centerpoint}{\rotate}%
- }%
- \anchor{tip 1}{%
- \getdoublearrowpoints%
- \pgfmathrotatepointaround{\arrowtipanchor}{\centerpoint}{\rotate}%
- }%
- \anchor{after tip 1}{%
- \getdoublearrowpoints%
- \pgfmathrotatepointaround{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
- \pgf@y-\pgf@y%
- }{\centerpoint}}%
- {\centerpoint}{\rotate}%
- }
- \anchor{after head 1}{%
- \getdoublearrowpoints%
- \pgfmathrotatepointaround{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
- \pgf@y-\pgf@y%
- }{\centerpoint}}%
- {\centerpoint}{\rotate}%
- }
- \anchor{before head 2}{%
- \getdoublearrowpoints%
- \pgfmathrotatepointaround{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
- \pgf@x-\pgf@x%
- \pgf@y-\pgf@y%
- }{\centerpoint}}%
- {\centerpoint}{\rotate}%
- }%
- \anchor{before tip 2}{%
- \getdoublearrowpoints%
- \pgfmathrotatepointaround{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
- \pgf@x-\pgf@x%
- \pgf@y-\pgf@y%
- }{\centerpoint}}%
- {\centerpoint}{\rotate}%
- }%
- \anchor{tip 2}{%
- \getdoublearrowpoints%
- \pgfmathrotatepointaround{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\arrowtipanchor}%
- \pgf@x-\pgf@x%
- }{\centerpoint}}%
- {\centerpoint}{\rotate}%
- }%
- \anchor{after tip 2}{%
- \getdoublearrowpoints%
- \pgfmathrotatepointaround{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
- \pgf@x-\pgf@x%
- }{\centerpoint}}%
- {\centerpoint}{\rotate}%
- }
- \anchor{after head 2}{%
- \getdoublearrowpoints%
- \pgfmathrotatepointaround{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
- \pgf@x-\pgf@x%
- }{\centerpoint}}%
- {\centerpoint}{\rotate}%
- }
- \backgroundpath{%
- {%
- \pgftransformshift{\centerpoint}%
- \pgftransformrotate{\rotate}%
- \pgfpathmoveto{\arrowtip}%
- \pgfpathlineto{\beforearrowtip}%
- \pgfpathlineto{\beforearrowhead}%
- \pgfpathlineto{\beforearrowhead\pgf@x-\pgf@x}%
- \pgfpathlineto{\beforearrowtip\pgf@x-\pgf@x}%
- \pgfpathlineto{\arrowtip\pgf@x-\pgf@x}%
- \pgfpathlineto{\beforearrowtip\pgf@x-\pgf@x\pgf@y-\pgf@y}%
- \pgfpathlineto{\beforearrowhead\pgf@x-\pgf@x\pgf@y-\pgf@y}%
- \pgfpathlineto{\beforearrowhead\pgf@y-\pgf@y}%
- \pgfpathlineto{\beforearrowtip\pgf@y-\pgf@y}%
- }%
- \pgfpathclose%
- }%
- \anchorborder{%
- \pgfsavepgf@process\externalpoint{}%
- \getdoublearrowpoints%
- \pgfutil@ifundefined{pgf@singlearrow@referencepoint}{\let\referencepoint\centerpoint}%
- {\let\referencepoint\pgf@singlearrow@referencepoint}%
- \pgfsavepgf@process\externalpoint{%
- \externalpoint%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \referencepoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya}%
- \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
- \pgfmathsubtract@{\pgfmathresult}{\rotate}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \let\externalangle\pgfmathresult%
- \pgf@x\externalangle pt\relax%
- \ifx\referencepoint\midpoint%
- \pgf@xa\mid@angle@beforearrowtip pt\relax%
- \else%
- \ifx\referencepoint\basepoint%
- \pgf@xa\base@angle@beforearrowtip pt\relax%
- \else%
- \pgf@xa\center@angle@beforearrowtip pt\relax%
- \fi%
- \fi%
- \ifdim\pgf@x<180pt\relax%
- \ifdim\pgf@x<\pgf@xa%
- \let\firstpoint\arrowtipanchor%
- \let\secondpoint\beforearrowtipanchor%
- \else%
- \pgf@xa-\pgf@xa%
- \advance\pgf@xa180pt\relax%
- \ifdim\pgf@x<\pgf@xa%
- \let\firstpoint\beforearrowheadanchor%
- \pgfsavepgf@process\secondpoint{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
- \pgf@x-\pgf@x
- }{\centerpoint}}%
- \else%
- \pgfsavepgf@process\firstpoint{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
- \pgf@x-\pgf@x
- }{\centerpoint}}%
- \pgfsavepgf@process\secondpoint{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\arrowtipanchor}%
- \pgf@x-\pgf@x%
- \pgf@y-\pgf@y%
- }{\centerpoint}}%
- \fi%
- \fi%
- \else%
- \pgf@xa-\pgf@xa%
- \advance\pgf@xa360pt\relax%
- \ifdim\pgf@x<\pgf@xa%
- \pgf@xa-\pgf@xa%
- \advance\pgf@xa540pt\relax%
- \ifdim\pgf@x<\pgf@xa%
- \pgfsavepgf@process\firstpoint{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\arrowtipanchor}%
- \pgf@x-\pgf@x%
- }{\centerpoint}}%
- \pgfsavepgf@process\secondpoint{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
- \pgf@x-\pgf@x%
- \pgf@y-\pgf@y%
- }{\centerpoint}}%
- \else%
- \pgfsavepgf@process\firstpoint{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
- \pgf@x-\pgf@x%
- \pgf@y-\pgf@y%
- }{\centerpoint}}%
- \pgfsavepgf@process\secondpoint{%
- \pgfpointadd{%
- \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
- \pgf@y-\pgf@y%
- }{\centerpoint}}%
- \fi%
- \else%
- \pgfsavepgf@process\firstpoint{%
- \pgfpointadd{%
- \pgfpointdiff{\beforearrowtipanchor}{\centerpoint}%
- \pgf@x-\pgf@x%
- }{\centerpoint}}%
- \let\secondpoint\arrowtipanchor%
- \fi%
- \fi%
- \pgfsavepgf@process\firstpoint{%
- \pgfmathrotatepointaround{\firstpoint}{\centerpoint}{\rotate}%
- }%
- \pgfsavepgf@process\secondpoint{%
- \pgfmathrotatepointaround{\secondpoint}{\centerpoint}{\rotate}%
- }%
- \pgfpointintersectionoflines{\referencepoint}{\externalpoint}%
- {\firstpoint}{\secondpoint}%
- }%
-}
+ \savedmacro\getdoublearrowpoints{%
+ %
+ % Get the outer sep.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \edef\xoutersep{\the\pgf@x}%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \edef\youtersep{\the\pgf@y}%
+ %
+ % Get the node dimensions.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@xa.5\wd\pgfnodeparttextbox%
+ \advance\pgf@xa.5\pgflinewidth%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@ya.5\ht\pgfnodeparttextbox%
+ \advance\pgf@ya.5\dp\pgfnodeparttextbox%
+ \advance\pgf@ya.5\pgflinewidth%
+ \ifpgfshapeborderusesincircle%
+ \ifdim\pgf@xa<\pgf@ya%
+ \pgf@xa\pgf@ya%
+ \fi%
+ \pgf@xa1.41421\pgf@xa%
+ \pgf@ya\pgf@xa%
+ \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
+ \ifdim\xoutersep>\youtersep\relax%
+ \let\youtersep\xoutersep%
+ \else%
+ \let\xoutersep\youtersep%
+ \fi%
+ \else%
+ %
+ % Round the rotation.
+ %
+ \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}
+ \pgfmathmod@{\rotate}{360}%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter\c@pgf@counta\pgfmathresult\relax\pgfmath@%
+ \advance\c@pgf@counta45\relax%
+ \divide\c@pgf@counta90\relax%
+ \multiply\c@pgf@counta90\relax%
+ \ifnum\c@pgf@counta<0\relax%
+ \advance\c@pgf@counta360\relax%
+ \fi%
+ \edef\rotate{\the\c@pgf@counta}%
+ %
+ % Calculate the width and height of the node
+ % contents, according to any border rotation.
+ %
+ \ifnum\c@pgf@counta=90\relax%
+ \pgf@x\pgf@xa%
+ \pgf@xa\pgf@ya%
+ \pgf@ya\pgf@x%
+ \let\pgfmathresult\xoutersep%
+ \let\xoutersep\youtersep%
+ \let\youtersep\pgfmathresult%
+ \else%
+ \ifnum\c@pgf@counta=270\relax%
+ \pgf@x\pgf@xa%
+ \pgf@xa\pgf@ya%
+ \pgf@ya\pgf@x%
+ \let\pgfmathresult\xoutersep%
+ \let\xoutersep\youtersep%
+ \let\youtersep\pgfmathresult%
+ \fi%
+ \fi%
+ \fi%
+ \addtosavedmacro\rotate%
+ %
+ % Get some useful trig stuff.
+ %
+ \pgfmathdivide{\pgfkeysvalueof{/pgf/double arrow tip angle}}{2}%
+ \let\halftipangle\pgfmathresult%
+ \pgfmathcosec@{\halftipangle}%
+ \let\cosechalftipangle\pgfmathresult%
+ \pgfmathcos@{\halftipangle}%
+ \pgfutil@tempdima\pgfmathresult pt\relax%
+ \pgfutil@tempdima\cosechalftipangle\pgfutil@tempdima%
+ \edef\cothalftipangle{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \let\sechalftipangle\pgfmathresult%
+ \pgfmathsin@{\halftipangle}%
+ \pgfutil@tempdima\pgfmathresult pt\relax%
+ \pgfutil@tempdima\sechalftipangle\pgfutil@tempdima%
+ \edef\tanhalftipangle{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ %
+ % Get the double arrow head extend, and adjust for minimum width.
+ %
+ \pgf@xb\pgf@ya%
+ \pgf@xb\cothalftipangle\pgf@xb%
+ \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/double arrow head extend}}%
+ \pgf@yc\pgf@xc%
+ \advance\pgf@xc\pgf@ya%
+ \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/minimum width}}%
+ \ifdim\pgf@xc<.5\pgfutil@tempdimb%
+ \pgfutil@tempdimb.5\pgfutil@tempdimb%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgfutil@tempdimb}}{\pgfmath@tonumber{\pgf@xc}}%
+ \pgf@ya\pgfmathresult\pgf@ya%
+ \pgf@xc\pgfmathresult\pgf@xc%
+ \pgf@yc\pgfmathresult\pgf@yc%
+ \pgf@xb\pgfmathresult\pgf@xb%
+ \fi%
+ %
+ % Now calculate the height of the arrow and adjust for minimum height.
+ %
+ \advance\pgf@xc-\pgf@ya%
+ \pgf@xc\cothalftipangle\pgf@xc%
+ \advance\pgf@xa\pgf@xb%
+ \pgf@xa2.0\pgf@xa%
+ \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@xa<\pgfutil@tempdimb%
+ \pgf@xa\pgfutil@tempdimb%
+ \fi%
+ \pgf@xa.5\pgf@xa%
+ \advance\pgf@xa-\pgf@xb%
+ \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/double arrow head indent}}%
+ %
+ % Now:
+ %
+ % xa - .5 * width of the node minus xb.
+ % ya - .5 * height of the node contents.
+ % xb - distance from the end of the node contents to the arrow tip.
+ % xc - distance from the end of the node contents to the back end of the arrow head.
+ % yc - distance from the top of the node contents to the top end of the arrow head.
+ %
+ \pgfsavepgf@process\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \pgfsavepgf@process\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt%
+ }%
+ \pgfsavepgf@process\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+.5ex}%
+ }%
+ %
+ % As the arrow is symmetrical it can be described by only 3 points:
+ %
+ \pgfsavepgf@process\arrowtip{%
+ \pgf@x\pgf@xa%
+ \advance\pgf@x\pgf@xb%
+ \pgf@y0pt\relax%
+ }%
+ \pgfsavepgf@process\beforearrowtip{%
+ \pgf@x\pgf@xa%
+ \advance\pgf@x-\pgf@xc%
+ \pgf@y\pgf@ya%
+ \advance\pgf@y\pgf@yc%
+ }%
+ \pgfsavepgf@process\beforearrowhead{%
+ \pgf@x\pgf@xa%
+ \advance\pgf@x-\pgf@xc%
+ \advance\pgf@x\pgfutil@tempdima%
+ \pgf@y\pgf@ya%
+ }%
+ %
+ % Calculate the anchor point at the arrow tip.
+ %
+ \pgfsavepgf@process\arrowtipanchor{%
+ \pgfpointadd{\centerpoint}{\arrowtip}%
+ \pgf@xa\xoutersep\relax%
+ \advance\pgf@x\cosechalftipangle\pgf@xa%
+ }%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \edef\externalradius{\the\pgf@x}%
+ \addtosavedmacro\externalradius%
+ %
+ %
+ \pgfmathanglebetweenlines{\beforearrowtip}{\beforearrowhead}{\beforearrowtip}{\arrowtip}%
+ \pgf@xa\xoutersep\relax%
+ \pgfutil@tempdima\pgfmathresult pt\relax%
+ \pgfutil@tempdima.5\pgfutil@tempdima%
+ \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \pgf@xa\pgfmathresult\pgf@xa%
+ \pgfutil@tempdima-\pgfutil@tempdima%
+ \advance\pgfutil@tempdima180pt\relax%
+ \advance\pgfutil@tempdima-\halftipangle pt\relax%
+ \pgfsavepgf@process\beforearrowtipanchor{%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgf@xa}%
+ \pgf@xb\pgf@x%
+ \pgf@yb\pgf@y%
+ \pgf@process{\pgfpointadd{\centerpoint}{\beforearrowtip}}%
+ \advance\pgf@x\pgf@xb%
+ \advance\pgf@y\pgf@yb%
+ }%
+ \pgfmathanglebetweenpoints{\beforearrowhead}{\beforearrowtip}%
+ \pgfutil@tempdima-\pgfmathresult pt\relax%
+ \advance\pgfutil@tempdima180pt\relax%
+ \pgfutil@tempdima.5\pgfutil@tempdima%
+ \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \pgf@xa\xoutersep\relax%
+ \pgf@xa\pgfmathresult\pgf@xa%
+ \pgfutil@tempdima-\pgfutil@tempdima%
+ \advance\pgfutil@tempdima180pt\relax%
+ \pgfsavepgf@process\beforearrowheadanchor{%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgf@xa}%
+ \pgf@xb\pgf@x%
+ \pgf@yb\pgf@y%
+ \pgf@process{\pgfpointadd{\centerpoint}{\beforearrowhead}}%
+ \advance\pgf@x\pgf@xb%
+ \advance\pgf@y\pgf@yb%
+ }%
+ %
+ \pgfmathanglebetweenpoints{\centerpoint}{\beforearrowtipanchor}%
+ \let\center@angle@beforearrowtip\pgfmathresult%
+ \addtosavedmacro\center@angle@beforearrowtip%
+ %
+ \pgfmathanglebetweenpoints{\midpoint}{\beforearrowtipanchor}%
+ \let\mid@angle@beforearrowtip\pgfmathresult%
+ \addtosavedmacro\mid@angle@beforearrowtip%
+ %
+ \pgfmathanglebetweenpoints{\basepoint}{\beforearrowtipanchor}%
+ \let\base@angle@beforearrowtip\pgfmathresult%
+ \addtosavedmacro\base@angle@beforearrowtip%
+ %
+ \addtosavedmacro\arrowtipanchor%
+ \addtosavedmacro\beforearrowtipanchor%
+ \addtosavedmacro\beforearrowheadanchor%
+ }%
+ \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}{%
+ \getdoublearrowpoints%
+ \let\pgf@singlearrow@referencepoint\midpoint%
+ \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{mid west}{%
+ \getdoublearrowpoints%
+ \let\pgf@singlearrow@referencepoint\midpoint%
+ \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{base}{\basepoint}%
+ \anchor{base east}{%
+ \getdoublearrowpoints%
+ \let\pgf@singlearrow@referencepoint\basepoint%
+ \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{base west}{%
+ \getdoublearrowpoints%
+ \let\pgf@singlearrow@referencepoint\basepoint%
+ \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{north}{%
+ \getdoublearrowpoints%
+ \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{0pt}{\externalradius}}%
+ }%
+ \anchor{south}{%
+ \getdoublearrowpoints%
+ \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{0pt}{-\externalradius}}%
+ }%
+ \anchor{east}{%
+ \getdoublearrowpoints%
+ \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{west}{%
+ \getdoublearrowpoints%
+ \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{north east}{%
+ \getdoublearrowpoints%
+ \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{\externalradius}{\externalradius}}%
+ }%
+ \anchor{south east}{%
+ \getdoublearrowpoints%
+ \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{\externalradius}{-\externalradius}}%
+ }%
+ \anchor{south west}{%
+ \getdoublearrowpoints%
+ \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{-\externalradius}{-\externalradius}}%
+ }%
+ \anchor{north west}{%
+ \getdoublearrowpoints%
+ \csname pgf@anchor@double arrow@border\endcsname{\pgfqpoint{-\externalradius}{\externalradius}}%
+ }%
+ \anchor{before head 1}{%
+ \getdoublearrowpoints%
+ \pgfmathrotatepointaround{\beforearrowheadanchor}{\centerpoint}{\rotate}%
+ }%
+ \anchor{before tip 1}{%
+ \getdoublearrowpoints%
+ \pgfmathrotatepointaround{\beforearrowtipanchor}{\centerpoint}{\rotate}%
+ }%
+ \anchor{tip 1}{%
+ \getdoublearrowpoints%
+ \pgfmathrotatepointaround{\arrowtipanchor}{\centerpoint}{\rotate}%
+ }%
+ \anchor{after tip 1}{%
+ \getdoublearrowpoints%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}}%
+ {\centerpoint}{\rotate}%
+ }%
+ \anchor{after head 1}{%
+ \getdoublearrowpoints%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}}%
+ {\centerpoint}{\rotate}%
+ }%
+ \anchor{before head 2}{%
+ \getdoublearrowpoints%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
+ \pgf@x-\pgf@x%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}}%
+ {\centerpoint}{\rotate}%
+ }%
+ \anchor{before tip 2}{%
+ \getdoublearrowpoints%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
+ \pgf@x-\pgf@x%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}}%
+ {\centerpoint}{\rotate}%
+ }%
+ \anchor{tip 2}{%
+ \getdoublearrowpoints%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\arrowtipanchor}%
+ \pgf@x-\pgf@x%
+ }{\centerpoint}}%
+ {\centerpoint}{\rotate}%
+ }%
+ \anchor{after tip 2}{%
+ \getdoublearrowpoints%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
+ \pgf@x-\pgf@x%
+ }{\centerpoint}}%
+ {\centerpoint}{\rotate}%
+ }%
+ \anchor{after head 2}{%
+ \getdoublearrowpoints%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
+ \pgf@x-\pgf@x%
+ }{\centerpoint}}%
+ {\centerpoint}{\rotate}%
+ }%
+ \backgroundpath{%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgftransformrotate{\rotate}%
+ \pgfpathmoveto{\arrowtip}%
+ \pgfpathlineto{\beforearrowtip}%
+ \pgfpathlineto{\beforearrowhead}%
+ \pgfpathlineto{\beforearrowhead\pgf@x-\pgf@x}%
+ \pgfpathlineto{\beforearrowtip\pgf@x-\pgf@x}%
+ \pgfpathlineto{\arrowtip\pgf@x-\pgf@x}%
+ \pgfpathlineto{\beforearrowtip\pgf@x-\pgf@x\pgf@y-\pgf@y}%
+ \pgfpathlineto{\beforearrowhead\pgf@x-\pgf@x\pgf@y-\pgf@y}%
+ \pgfpathlineto{\beforearrowhead\pgf@y-\pgf@y}%
+ \pgfpathlineto{\beforearrowtip\pgf@y-\pgf@y}%
+ }%
+ \pgfpathclose%
+ }%
+ \anchorborder{%
+ \pgfsavepgf@process\externalpoint{}%
+ \getdoublearrowpoints%
+ \pgfutil@ifundefined{pgf@singlearrow@referencepoint}{\let\referencepoint\centerpoint}%
+ {\let\referencepoint\pgf@singlearrow@referencepoint}%
+ \pgfsavepgf@process\externalpoint{%
+ \externalpoint%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \referencepoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya}%
+ \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
+ \pgfmathsubtract@{\pgfmathresult}{\rotate}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \let\externalangle\pgfmathresult%
+ \pgf@x\externalangle pt\relax%
+ \ifx\referencepoint\midpoint%
+ \pgf@xa\mid@angle@beforearrowtip pt\relax%
+ \else%
+ \ifx\referencepoint\basepoint%
+ \pgf@xa\base@angle@beforearrowtip pt\relax%
+ \else%
+ \pgf@xa\center@angle@beforearrowtip pt\relax%
+ \fi%
+ \fi%
+ \ifdim\pgf@x<180pt\relax%
+ \ifdim\pgf@x<\pgf@xa%
+ \let\firstpoint\arrowtipanchor%
+ \let\secondpoint\beforearrowtipanchor%
+ \else%
+ \pgf@xa-\pgf@xa%
+ \advance\pgf@xa180pt\relax%
+ \ifdim\pgf@x<\pgf@xa%
+ \let\firstpoint\beforearrowheadanchor%
+ \pgfsavepgf@process\secondpoint{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
+ \pgf@x-\pgf@x
+ }{\centerpoint}}%
+ \else%
+ \pgfsavepgf@process\firstpoint{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
+ \pgf@x-\pgf@x
+ }{\centerpoint}}%
+ \pgfsavepgf@process\secondpoint{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\arrowtipanchor}%
+ \pgf@x-\pgf@x%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}}%
+ \fi%
+ \fi%
+ \else%
+ \pgf@xa-\pgf@xa%
+ \advance\pgf@xa360pt\relax%
+ \ifdim\pgf@x<\pgf@xa%
+ \pgf@xa-\pgf@xa%
+ \advance\pgf@xa540pt\relax%
+ \ifdim\pgf@x<\pgf@xa%
+ \pgfsavepgf@process\firstpoint{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\arrowtipanchor}%
+ \pgf@x-\pgf@x%
+ }{\centerpoint}}%
+ \pgfsavepgf@process\secondpoint{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowtipanchor}%
+ \pgf@x-\pgf@x%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}}%
+ \else%
+ \pgfsavepgf@process\firstpoint{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
+ \pgf@x-\pgf@x%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}}%
+ \pgfsavepgf@process\secondpoint{%
+ \pgfpointadd{%
+ \pgfpointdiff{\centerpoint}{\beforearrowheadanchor}%
+ \pgf@y-\pgf@y%
+ }{\centerpoint}}%
+ \fi%
+ \else%
+ \pgfsavepgf@process\firstpoint{%
+ \pgfpointadd{%
+ \pgfpointdiff{\beforearrowtipanchor}{\centerpoint}%
+ \pgf@x-\pgf@x%
+ }{\centerpoint}}%
+ \let\secondpoint\arrowtipanchor%
+ \fi%
+ \fi%
+ \pgfsavepgf@process\firstpoint{%
+ \pgfmathrotatepointaround{\firstpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfsavepgf@process\secondpoint{%
+ \pgfmathrotatepointaround{\secondpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfpointintersectionoflines{\referencepoint}{\externalpoint}%
+ {\firstpoint}{\secondpoint}%
+ }%
+}%
@@ -1061,1298 +1063,1299 @@
% Internal macros for the arrow box/shape.
%
\def\pgf@lib@arrowbox@parsearrowlength#1#2#3{%
- \edef\pgf@lib@temp{#3}%
- \edef\pgf@lib@marshal{%
- \noexpand\pgfutil@in@{none}{\pgf@lib@temp}%
- }%
- \pgf@lib@marshal%
- \ifpgfutil@in@%
- #10pt\relax%
- \else%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \expandafter#1\pgf@lib@temp\relax\pgfmath@%
- %
- \edef\pgf@lib@marshal{%
- \noexpand\pgfutil@in@{from center}{\pgf@lib@temp}%
- }%
- \pgf@lib@marshal%
- \ifpgfutil@in@%
- \else%
- \ifdim#1>0pt\relax%
- \advance#1#2\relax%
- \fi%
- \fi%
- \fi}
+ \edef\pgf@lib@temp{#3}%
+ \edef\pgf@lib@marshal{%
+ \noexpand\pgfutil@in@{none}{\pgf@lib@temp}%
+ }%
+ \pgf@lib@marshal%
+ \ifpgfutil@in@%
+ #10pt\relax%
+ \else%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter#1\pgf@lib@temp\relax\pgfmath@%
+ %
+ \edef\pgf@lib@marshal{%
+ \noexpand\pgfutil@in@{from center}{\pgf@lib@temp}%
+ }%
+ \pgf@lib@marshal%
+ \ifpgfutil@in@%
+ \else%
+ \ifdim#1>0pt\relax%
+ \advance#1#2\relax%
+ \fi%
+ \fi%
+ \fi}%
\def\pgf@lib@arrowbox@parsearrows#1{%
- \pgfkeys{/pgf/.cd,%
- arrow box west arrow=0pt,
- arrow box east arrow=0pt,
- arrow box south arrow=0pt,
- arrow box north arrow=0pt
- }%
- \def\pgf@lib@arrowbox@extend{0pt}%
- \edef\pgf@lib@temp{#1}%
- \expandafter\pgf@lib@arrowbox@@parsearrows\pgf@lib@temp,\pgf@lib@arrowbox@parsearrows,}
+ \pgfkeys{/pgf/.cd,%
+ arrow box west arrow=0pt,
+ arrow box east arrow=0pt,
+ arrow box south arrow=0pt,
+ arrow box north arrow=0pt
+ }%
+ \def\pgf@lib@arrowbox@extend{0pt}%
+ \edef\pgf@lib@temp{#1}%
+ \expandafter\pgf@lib@arrowbox@@parsearrows\pgf@lib@temp,\pgf@lib@arrowbox@parsearrows,
+}%
\def\pgf@lib@arrowbox@@parsearrows#1,{%
- \ifx\pgf@lib@arrowbox@parsearrows#1%
- \let\pgflib@next\relax%
- \else%
- \pgfutil@in@:{#1}%
- \ifpgfutil@in@%
- \pgf@lib@arrowbox@getextend#1\pgf@lib%
- \else%
- \def\pgf@lib@arrowbox@direction{#1}%
- \fi%
- \edef\pgf@marshal{%
- \noexpand\pgfkeys{/pgf/arrow box \pgf@lib@arrowbox@direction\space arrow=\pgf@lib@arrowbox@extend}%
- }%
- \pgf@marshal%
- \let\pgflib@next\pgf@lib@arrowbox@@@parsearrows%
- \fi%
- \pgflib@next%
-}
+ \ifx\pgf@lib@arrowbox@parsearrows#1%
+ \let\pgflib@next\relax%
+ \else%
+ \pgfutil@in@:{#1}%
+ \ifpgfutil@in@%
+ \pgf@lib@arrowbox@getextend#1\pgf@lib%
+ \else%
+ \def\pgf@lib@arrowbox@direction{#1}%
+ \fi%
+ \edef\pgf@marshal{%
+ \noexpand\pgfkeys{/pgf/arrow box \pgf@lib@arrowbox@direction\space arrow=\pgf@lib@arrowbox@extend}%
+ }%
+ \pgf@marshal%
+ \let\pgflib@next\pgf@lib@arrowbox@@@parsearrows%
+ \fi%
+ \pgflib@next%
+}%
\def\pgf@lib@arrowbox@@@parsearrows{%
- \pgfutil@ifnextchar x{\relax\pgf@lib@arrowbox@@parsearrows}{\relax\pgf@lib@arrowbox@@parsearrows}%
-}
+ \pgfutil@ifnextchar x{\relax\pgf@lib@arrowbox@@parsearrows}{\relax\pgf@lib@arrowbox@@parsearrows}%
+}%
\def\pgf@lib@arrowbox@getextend#1:#2\pgf@lib{%
- \def\pgf@lib@arrowbox@direction{#1}%
- \def\pgf@lib@arrowbox@extend{#2}%
+ \def\pgf@lib@arrowbox@direction{#1}%
+ \def\pgf@lib@arrowbox@extend{#2}%
}%
%
-% /pgf/arrow box north arrow
-% /pgf/arrow box south arrow
-% /pgf/arrow box west arrow
-% /pgf/arrow box east arrow
-% /pgf/arrow box arrows
-% /pgf/arrow box shaft width
-% /pgf/arrow box head extend
-% /pgf/arrow box head indent
-% /pgf/arrow box tip angle
+% /pgf/arrow box north arrow
+% /pgf/arrow box south arrow
+% /pgf/arrow box west arrow
+% /pgf/arrow box east arrow
+% /pgf/arrow box arrows
+% /pgf/arrow box shaft width
+% /pgf/arrow box head extend
+% /pgf/arrow box head indent
+% /pgf/arrow box tip angle
%
\pgfkeys{/pgf/.cd,
- arrow box west arrow/.initial=.5cm,
- arrow box east arrow/.initial=.5cm,
- arrow box south arrow/.initial=.5cm,
- arrow box north arrow/.initial=.5cm,
- arrow box shaft width/.initial=.125cm,
- arrow box head extend/.initial=.125cm,
- arrow box head indent/.initial=0cm,
- arrow box tip angle/.initial=90,
-}
+ arrow box west arrow/.initial=.5cm,
+ arrow box east arrow/.initial=.5cm,
+ arrow box south arrow/.initial=.5cm,
+ arrow box north arrow/.initial=.5cm,
+ arrow box shaft width/.initial=.125cm,
+ arrow box head extend/.initial=.125cm,
+ arrow box head indent/.initial=0cm,
+ arrow box tip angle/.initial=90,
+}%
%
% arrow box/Shape.
%
\pgfdeclareshape{arrow box}{%
- \saveddimen\shaftwidth{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/arrow box shaft width}}%
- }%
- %
- % Calculate far the arrows extend from the center of the node.
- %
- \savedmacro\arrowboxpoints{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
- \ifdim\pgf@x<.5\pgf@xa%
- \pgf@x.5\pgf@xa%
- \fi%
- \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- %
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\dp\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@y<.5\pgf@ya%
- \pgf@y.5\pgf@ya%
- \fi%
- \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- %
- \edef\halfboxwidth{\the\pgf@x}%
- \edef\halfboxheight{\the\pgf@y}%
- \pgfextract@process\arrowboxcorner{}%
- \addtosavedmacro\arrowboxcorner%
- %
- \pgf@lib@arrowbox@parsearrowlength\pgf@x{\halfboxwidth}%
- {\pgfkeysvalueof{/pgf/arrow box west arrow}}%
- \edef\westextend{\the\pgf@x}%
- \addtosavedmacro\westextend%
- %
- \pgf@lib@arrowbox@parsearrowlength\pgf@x{\halfboxwidth}%
- {\pgfkeysvalueof{/pgf/arrow box east arrow}}%
- \edef\eastextend{\the\pgf@x}%
- \addtosavedmacro\eastextend%
- %
- \pgf@lib@arrowbox@parsearrowlength\pgf@x{\halfboxheight}%
- {\pgfkeysvalueof{/pgf/arrow box north arrow}}%
- \edef\northextend{\the\pgf@x}%
- \addtosavedmacro\northextend%
- %
- \pgf@lib@arrowbox@parsearrowlength\pgf@x{\halfboxheight}%
- {\pgfkeysvalueof{/pgf/arrow box south arrow}}%
- \edef\southextend{\the\pgf@x}%
- \addtosavedmacro\southextend%
- }%
- \saveddimen\arrowheadextend{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/arrow box head extend}}%
- }%
- \saveddimen\arrowheadindent{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/arrow box head indent}}%
- }%
- %
- % Calculate the `miter' angle for the outer sep at the arrow tip.
- %
- \savedmacro\arrowtipmiterangle{%
- \pgfmathparse{\pgfkeysvalueof{/pgf/arrow box tip angle}}%
- \pgfmathdivide@{\pgfmathresult}{2}%
- \let\arrowtipmiterangle\pgfmathresult%
- }%
- %
- % Calculate the `miter' angle for the outer sep at the point just
- % before the arrow tip.
- %
- \savedmacro\arrowheadangles{%
- %
- % Calculate the `miter' angle and its cosecant at the arrow tip...
- %
- \pgfmathparse{\pgfkeysvalueof{/pgf/arrow box tip angle}}%
- \pgfmathdivide@{\pgfmathresult}{2}%
- \let\arrowtipmiterangle\pgfmathresult%
- \addtosavedmacro\arrowtipmiterangle%
- \pgfmathcosec@{\arrowtipmiterangle}%
- \let\cosecarrowtipmiterangle\pgfmathresult%
- \addtosavedmacro\cosecarrowtipmiterangle%
- %
- % ...before the arrow head...
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/arrow box head extend}}%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/arrow box head indent}}%
- \ifdim\pgf@y=0pt\relax%
- \def\pgfmathresult{90}%
- \else%
- \ifdim\pgf@y<0pt\relax%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
- \pgfmathatan@{\pgfmathresult}%
- \pgfmathadd@{\pgfmathresult}{180}%
- \else%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
- \pgfmathatan@{\pgfmathresult}%
- \fi%
- \fi%
- \pgfmathdivide@{\pgfmathresult}{2}%
- \let\beforearrowheadmiterangle\pgfmathresult%
- \addtosavedmacro\beforearrowheadmiterangle%
- \pgfmathcosec@{\beforearrowheadmiterangle}%
- \let\cosecbeforearrowheadmiterangle\pgfmathresult%
- \addtosavedmacro\cosecbeforearrowheadmiterangle%
- %
- % ...and before the arrow tip.
- %
- \pgfutil@tempdima-\arrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima90pt\relax%
- \pgfutil@tempdimb\beforearrowheadmiterangle pt\relax%
- \pgfutil@tempdimb2.0\pgfutil@tempdimb%
- \advance\pgfutil@tempdimb-90pt\relax%
- \advance\pgfutil@tempdima\pgfutil@tempdimb%
- \divide\pgfutil@tempdima2\relax%
- \edef\beforearrowtipmiterangle{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \addtosavedmacro\beforearrowtipmiterangle%
- \pgfmathcosec@{\beforearrowtipmiterangle}%
- \let\cosecbeforearrowtipmiterangle\pgfmathresult%
- \addtosavedmacro\cosecbeforearrowtipmiterangle%
- }
- \saveddimen\outerxsep{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- }%
- \saveddimen\outerysep{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer ysep}}%
- }%
- %
- % Calculate the (path) point immediately prior to an arrow tip.
- %
- \savedanchor\beforearrowtip{%
- \pgfmathparse{\pgfkeysvalueof{/pgf/arrow box tip angle}}%
- \pgfmathdivide@{\pgfmathresult}{2}%
- \pgfmathcot@{\pgfmathresult}%
- \let\cothalfangle\pgfmathresult%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/arrow box shaft width}}%
- \pgf@y.5\pgf@y%
- \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/arrow box head extend}}%
- \pgf@y\pgf@y%
- \pgf@x\cothalfangle\pgf@y%
- }%
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }%
- \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{mid}{\midpoint}
- \anchor{mid east}{%
- \arrowboxpoints%
- \ifdim\eastextend>0pt\relax%
- \let\pgf@lib@shapes@arrowbox@referencepoint\midpoint%
- \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{\eastextend}{0pt}};
- \else%
- \arrowboxcorner%
- \pgf@xa\pgf@x%
- \midpoint%
- \advance\pgf@x\pgf@xa%
- \fi%
- }
- \anchor{mid west}{%
- \arrowboxpoints%
- \ifdim\westextend>0pt\relax%
- \let\pgf@lib@shapes@arrowbox@referencepoint\midpoint%
- \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{-\westextend}{0pt}};
- \else%
- \arrowboxcorner%
- \pgf@xa\pgf@x%
- \midpoint%
- \advance\pgf@x-\pgf@xa%
- \fi%
- }
- \anchor{base}{\basepoint}
- \anchor{base east}{%
- \arrowboxpoints%
- \ifdim\eastextend>0pt\relax%
- \let\pgf@lib@shapes@arrowbox@referencepoint\basepoint%
- \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{\eastextend}{0pt}};
- \else%
- \arrowboxcorner%
- \pgf@xa\pgf@x%
- \basepoint%
- \advance\pgf@x\pgf@xa%
- \fi%
- }
- \anchor{base west}{%
- \arrowboxpoints%
- \ifdim\westextend>0pt\relax%
- \let\pgf@lib@shapes@arrowbox@referencepoint\basepoint%
- \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{-\westextend}{0pt}};
- \else%
- \arrowboxcorner%
- \pgf@xa\pgf@x%
- \basepoint%
- \advance\pgf@x-\pgf@xa%
- \fi%
- }
- \anchor{north}{%
- \arrowboxpoints%
- \ifdim\northextend>0pt\relax%
- \csname pgf@anchor@arrow box@north arrow tip\endcsname%
- \else%
- \pgfpointadd{\centerpoint}{\arrowboxcorner}%
- \pgf@ya\pgf@y%
- \centerpoint%
- \pgf@y\pgf@ya%
- \fi%
- }%
- \anchor{south}{%
- \arrowboxpoints%
- \ifdim\southextend>0pt\relax%
- \csname pgf@anchor@arrow box@south arrow tip\endcsname%
- \else%
- \pgfpointadd{\centerpoint}{\arrowboxcorner\pgf@y-\pgf@y}%
- \pgf@ya\pgf@y%
- \centerpoint%
- \pgf@y\pgf@ya%
- \fi%
- }%
- \anchor{east}{%
- \arrowboxpoints%
- \ifdim\eastextend>0pt\relax%
- \csname pgf@anchor@arrow box@east arrow tip\endcsname%
- \else%
- \pgfpointadd{\centerpoint}{\arrowboxcorner}%
- \pgf@xa\pgf@x%
- \centerpoint%
- \pgf@x\pgf@xa%
- \fi%
- }%
- \anchor{west}{%
- \arrowboxpoints%
- \ifdim\westextend>0pt\relax%
- \csname pgf@anchor@arrow box@west arrow tip\endcsname%
- \else%
- \pgfpointadd{\centerpoint}{\arrowboxcorner\pgf@x-\pgf@x}%
- \pgf@xa\pgf@x%
- \centerpoint%
- \pgf@x\pgf@xa%
- \fi%
- }%
- \anchor{north east}{%
- \arrowboxpoints%
- \pgfpointadd{\centerpoint}{\arrowboxcorner}%
- }%
- \anchor{north west}{%
- \arrowboxpoints%
- \pgfpointadd{\centerpoint}{\arrowboxcorner\pgf@x-\pgf@x}%
- }%
- \anchor{south west}{%
- \arrowboxpoints%
- \pgfpointadd{\centerpoint}{\arrowboxcorner\pgf@x-\pgf@x\pgf@y-\pgf@y}%
- }%
- \anchor{south east}{%
- \arrowboxpoints%
- \pgfpointadd{\centerpoint}{\arrowboxcorner\pgf@y-\pgf@y}%
- }%
- \anchor{before east arrow}{%
- \arrowboxpoints%
- \ifdim\eastextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \arrowboxcorner%
- \pgf@y\shaftwidth\relax%
- \pgf@y.5\pgf@y%
- \advance\pgf@y\outerysep\relax%
- }%
- \else%
- \csname pgf@anchor@arrow box@east\endcsname%
- \fi%
- }%
- \anchor{before east arrow head}{%
- \arrowboxpoints%
- \ifdim\eastextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
- \advance\pgfutil@tempdima180pt\relax%
- \pgfutil@tempdimb\outerxsep\relax%
- \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@x-\pgf@x%
- \advance\pgf@x\eastextend\relax%
- \advance\pgf@x\arrowheadindent\relax%
- \pgf@y\shaftwidth\relax%
- \pgf@y.5\pgf@y%
- }%
- }%
- \else%
- \csname pgf@anchor@arrow box@east\endcsname%
- \fi%
- }
- \anchor{before east arrow tip}{%
- \arrowboxpoints%
- \ifdim\eastextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima-\arrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima-\beforearrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima180pt\relax%
- \pgfutil@tempdimb\outerysep\relax%
- \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@x-\pgf@x%
- \advance\pgf@x\eastextend\relax%
- }%
- }%
- \else%
- \csname pgf@anchor@arrow box@east\endcsname%
- \fi%
- }
- \anchor{east arrow tip}{%
- \arrowboxpoints%
- \ifdim\eastextend>0pt\relax%
- \centerpoint%
- \advance\pgf@x\eastextend\relax%
- \pgf@xa\outerxsep\relax%
- \pgfmathcosec@{\arrowtipmiterangle}%
- \advance\pgf@x\pgfmathresult\pgf@xa%
- \else%
- \csname pgf@anchor@arrow box@east\endcsname%
- \fi%
- }
- \anchor{after east arrow tip}{%
- \arrowboxpoints%
- \ifdim\eastextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima-\arrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima-\beforearrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima180pt\relax%
- \pgfutil@tempdimb\outerysep\relax%
- \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@x-\pgf@x%
- \advance\pgf@x\eastextend\relax%
- }%
- \pgf@y-\pgf@y%
- }%
- \else%
- \csname pgf@anchor@arrow box@east\endcsname%
- \fi%
- }
- \anchor{after east arrow head}{%
- \arrowboxpoints%
- \ifdim\eastextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
- \advance\pgfutil@tempdima180pt\relax%
- \pgfutil@tempdimb\outerxsep\relax%
- \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@x-\pgf@x%
- \advance\pgf@x\eastextend\relax%
- \advance\pgf@x\arrowheadindent\relax%
- \pgf@y\shaftwidth\relax%
- \pgf@y.5\pgf@y%
- }%
- \pgf@y-\pgf@y%
- }%
- \else%
- \csname pgf@anchor@arrow box@east\endcsname%
- \fi%
- }
- \anchor{after east arrow}{%
- \arrowboxpoints%
- \ifdim\eastextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \arrowboxcorner%
- \pgf@y\shaftwidth\relax%
- \pgf@y.5\pgf@y%
- \advance\pgf@y\outerysep\relax%
- \pgf@y-\pgf@y%
- }%
- \else%
- \csname pgf@anchor@arrow box@east\endcsname%
- \fi%
- }%
- %
- \anchor{before west arrow}{%
- \arrowboxpoints%
- \ifdim\westextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \arrowboxcorner%
- \pgf@x-\pgf@x%
- \pgf@y\shaftwidth\relax%
- \pgf@y.5\pgf@y%
- \advance\pgf@y\outerysep\relax%
- \pgf@y-\pgf@y%
- }%
- \else%
- \csname pgf@anchor@arrow box@west\endcsname%
- \fi%
- }%
- \anchor{before west arrow head}{%
- \arrowboxpoints%
- \ifdim\westextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
- \advance\pgfutil@tempdima180pt\relax%
- \pgfutil@tempdimb\outerxsep\relax%
- \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@x-\pgf@x%
- \advance\pgf@x\westextend\relax%
- \advance\pgf@x\arrowheadindent\relax%
- \pgf@y\shaftwidth\relax%
- \pgf@y.5\pgf@y%
- }%
- \pgf@x-\pgf@x%
- \pgf@y-\pgf@y%
- }%
- \else%
- \csname pgf@anchor@arrow box@west\endcsname%
- \fi%
- }
- \anchor{before west arrow tip}{%
- \arrowboxpoints%
- \ifdim\westextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima-\arrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima-\beforearrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima180pt\relax%
- \pgfutil@tempdimb\outerysep\relax%
- \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@x-\pgf@x%
- \advance\pgf@x\westextend\relax%
- }%
- \pgf@x-\pgf@x%
- \pgf@y-\pgf@y%
- }%
- \else%
- \csname pgf@anchor@arrow box@west\endcsname%
- \fi%
- }
- \anchor{west arrow tip}{%
- \arrowboxpoints%
- \ifdim\westextend>0pt\relax%
- \centerpoint%
- \advance\pgf@x-\westextend\relax%
- \pgf@xa\outerxsep\relax%
- \pgfmathcosec@{\arrowtipmiterangle}%
- \advance\pgf@x-\pgfmathresult\pgf@xa%
- \else%
- \csname pgf@anchor@arrow box@west\endcsname%
- \fi%
- }
- \anchor{after west arrow tip}{%
- \arrowboxpoints%
- \ifdim\westextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima-\arrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima-\beforearrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima180pt\relax%
- \pgfutil@tempdimb\outerysep\relax%
- \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@x-\pgf@x%
- \advance\pgf@x\westextend\relax%
- }%
- \pgf@x-\pgf@x%
- }%
- \else%
- \csname pgf@anchor@arrow box@west\endcsname%
- \fi%
- }
- \anchor{after west arrow head}{%
- \arrowboxpoints%
- \ifdim\westextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
- \advance\pgfutil@tempdima180pt\relax%
- \pgfutil@tempdimb\outerxsep\relax%
- \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@x-\pgf@x%
- \advance\pgf@x\westextend\relax%
- \advance\pgf@x\arrowheadindent\relax%
- \pgf@y\shaftwidth\relax%
- \pgf@y.5\pgf@y%
- }%
- \pgf@x-\pgf@x%
- }%
- \else%
- \csname pgf@anchor@arrow box@west\endcsname%
- \fi%
- }
- \anchor{after west arrow}{%
- \arrowboxpoints%
- \ifdim\westextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \arrowboxcorner%
- \pgf@y\shaftwidth\relax%
- \pgf@y.5\pgf@y%
- \advance\pgf@y\outerysep\relax%
- \pgf@x-\pgf@x%
- }%
- \else%
- \csname pgf@anchor@arrow box@west\endcsname%
- \fi%
- }%
- %
- \anchor{before north arrow}{%
- \arrowboxpoints%
- \ifdim\northextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \arrowboxcorner%
- \pgf@x-\shaftwidth\relax%
- \pgf@x.5\pgf@x%
- \advance\pgf@x-\outerxsep\relax%
- }%
- \else%
- \csname pgf@anchor@arrow box@north\endcsname%
- \fi%
- }
- \anchor{before north arrow head}{%
- \arrowboxpoints%
- \ifdim\northextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
- \advance\pgfutil@tempdima270pt\relax%
- \pgfutil@tempdimb\outerysep\relax%
- \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@y-\pgf@x%
- \advance\pgf@y\northextend\relax%
- \advance\pgf@y\arrowheadindent\relax%
- \pgf@x-\shaftwidth\relax%
- \pgf@x.5\pgf@x%
- }%
- }%
- \else%
- \csname pgf@anchor@arrow box@north\endcsname%
- \fi%
- }
- \anchor{before north arrow tip}{%
- \arrowboxpoints%
- \ifdim\northextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima\arrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima\beforearrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima-90pt\relax%
- \pgfutil@tempdimb\outerxsep\relax%
- \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@xa\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y-\pgf@xa%
- \advance\pgf@y\northextend\relax%
- }%
- \pgf@x-\pgf@x%
- }%
- \else%
- \csname pgf@anchor@arrow box@north\endcsname%
- \fi%
- }
- \anchor{north arrow tip}{%
- \arrowboxpoints%
- \ifdim\northextend>0pt\relax%
- \centerpoint%
- \advance\pgf@y\northextend\relax%
- \pgf@ya\outerysep\relax%
- \pgfmathcosec@{\arrowtipmiterangle}%
- \advance\pgf@y\pgfmathresult\pgf@ya%
- \else%
- \csname pgf@anchor@arrow box@north\endcsname%
- \fi%
- }
- \anchor{after north arrow tip}{%
- \arrowboxpoints%
- \ifdim\northextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima\arrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima\beforearrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima-90pt\relax%
- \pgfutil@tempdimb\outerxsep\relax%
- \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@xa\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y-\pgf@xa%
- \advance\pgf@y\northextend\relax%
- }%
- }%
- \else%
- \csname pgf@anchor@arrow box@north\endcsname%
- \fi%
- }
- \anchor{after north arrow head}{%
- \arrowboxpoints%
- \ifdim\northextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
- \advance\pgfutil@tempdima270pt\relax%
- \pgfutil@tempdimb\outerysep\relax%
- \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@y-\pgf@x%
- \advance\pgf@y\northextend\relax%
- \advance\pgf@y\arrowheadindent\relax%
- \pgf@x-\shaftwidth\relax%
- \pgf@x.5\pgf@x%
- }%
- \pgf@x-\pgf@x%
- }%
- \else%
- \csname pgf@anchor@arrow box@north\endcsname%
- \fi%
- }
- \anchor{after north arrow}{%
- \arrowboxpoints%
- \ifdim\northextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \arrowboxcorner%
- \pgf@x\shaftwidth\relax%
- \pgf@x.5\pgf@x%
- \advance\pgf@x\outerxsep\relax%
- }%
- \else%
- \csname pgf@anchor@arrow box@north\endcsname%
- \fi%
- }
- %
- \anchor{before south arrow}{%
- \arrowboxpoints%
- \ifdim\southextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \arrowboxcorner%
- \pgf@x\shaftwidth\relax%
- \pgf@x.5\pgf@x%
- \advance\pgf@x\outerxsep\relax%
- \pgf@y-\pgf@y%
- }%
- \else%
- \csname pgf@anchor@arrow box@south\endcsname%
- \fi%
- }%
- \anchor{before south arrow head}{%
- \arrowboxpoints%
- \ifdim\northextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
- \advance\pgfutil@tempdima270pt\relax%
- \pgfutil@tempdimb\outerysep\relax%
- \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@y-\pgf@x%
- \advance\pgf@y\northextend\relax%
- \advance\pgf@y\arrowheadindent\relax%
- \pgf@x-\shaftwidth\relax%
- \pgf@x.5\pgf@x%
- }%
- \pgf@x-\pgf@x%
- \pgf@y-\pgf@y%
- }%
- \else%
- \csname pgf@anchor@arrow box@south\endcsname%
- \fi%
- }
- \anchor{before south arrow tip}{%
- \arrowboxpoints%
- \ifdim\northextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima\arrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima\beforearrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima-90pt\relax%
- \pgfutil@tempdimb\outerxsep\relax%
- \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@xa\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y-\pgf@xa%
- \advance\pgf@y\northextend\relax%
- }%
- \pgf@y-\pgf@y%
- }%
- \else%
- \csname pgf@anchor@arrow box@south\endcsname%
- \fi%
- }
- \anchor{south arrow tip}{%
- \arrowboxpoints%
- \ifdim\southextend>0pt\relax%
- \centerpoint%
- \advance\pgf@y-\southextend\relax%
- \pgf@ya\outerysep\relax%
- \pgfmathcosec@{\arrowtipmiterangle}%
- \advance\pgf@y-\pgfmathresult\pgf@ya%
- \else%
- \csname pgf@anchor@arrow box@east\endcsname%
- \fi%
- }
- \anchor{after south arrow tip}{%
- \arrowboxpoints%
- \ifdim\northextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima\arrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima\beforearrowtipmiterangle pt\relax%
- \advance\pgfutil@tempdima-90pt\relax%
- \pgfutil@tempdimb\outerxsep\relax%
- \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@xa\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y-\pgf@xa%
- \advance\pgf@y\northextend\relax%
- }%
- \pgf@x-\pgf@x%
- \pgf@y-\pgf@y%
- }%
- \else%
- \csname pgf@anchor@arrow box@south\endcsname%
- \fi%
- }
- \anchor{after south arrow head}{%
- \arrowboxpoints%
- \ifdim\northextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \pgfpointadd{%
- \arrowheadangles%
- \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
- \advance\pgfutil@tempdima270pt\relax%
- \pgfutil@tempdimb\outerysep\relax%
- \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }%
- {%
- \beforearrowtip%
- \pgf@y-\pgf@x%
- \advance\pgf@y\northextend\relax%
- \advance\pgf@y\arrowheadindent\relax%
- \pgf@x-\shaftwidth\relax%
- \pgf@x.5\pgf@x%
- }%
- \pgf@y-\pgf@y%
- }%
- \else%
- \csname pgf@anchor@arrow box@south\endcsname%
- \fi%
- }
- \anchor{after south arrow}{%
- \arrowboxpoints%
- \ifdim\southextend>0pt\relax%
- \pgfpointadd{\centerpoint}{%
- \arrowboxcorner%
- \pgf@x-\shaftwidth\relax%
- \pgf@x.5\pgf@x%
- \advance\pgf@x-\outerxsep\relax%
- \pgf@y-\pgf@y%
- }%
- \else%
- \csname pgf@anchor@arrow box@south\endcsname%
- \fi%
- }%
- %
- \backgroundpath{%
- \arrowboxpoints%
- \pgfextract@process\arrowboxcorner{%
- \arrowboxcorner%
- \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathaddtolength\pgf@y{-\pgfkeysvalueof{/pgf/outer ysep}}%
- }%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\arrowboxcorner}%
- \ifdim\eastextend>0pt\relax%
- \pgfpathlineto{%
- \arrowboxcorner%
- \pgf@y\shaftwidth\relax%
- \pgf@y.5\pgf@y%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \pgf@x-\pgf@x%
- \advance\pgf@x\eastextend\relax%
- \advance\pgf@x\arrowheadindent\relax%
- \pgf@y\shaftwidth\relax%
- \pgf@y.5\pgf@y%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \pgf@x-\pgf@x%
- \advance\pgf@x\eastextend\relax%
- }%
- \pgfpathlineto{%
- \pgf@x\eastextend\relax%
- \pgf@y0pt\relax%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \pgf@x-\pgf@x%
- \advance\pgf@x\eastextend\relax%
- \pgf@y-\pgf@y%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \pgf@x-\pgf@x%
- \advance\pgf@x\eastextend\relax%
- \advance\pgf@x\arrowheadindent\relax%
- \pgf@y\shaftwidth\relax%
- \pgf@y-.5\pgf@y%
- }%
- \pgfpathlineto{%
- \arrowboxcorner%
- \pgf@y\shaftwidth\relax%
- \pgf@y-.5\pgf@y%
- }%
- \fi%
- \pgfpathlineto{\arrowboxcorner\pgf@y-\pgf@y}%
- \ifdim\southextend>0pt\relax%
- \pgfpathlineto{%
- \arrowboxcorner%
- \pgf@x\shaftwidth\relax%
- \pgf@x.5\pgf@x%
- \pgf@y-\pgf@y%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \pgf@y\pgf@x%
- \advance\pgf@y-\southextend\relax%
- \advance\pgf@y-\arrowheadindent\relax%
- \pgf@x\shaftwidth\relax%
- \pgf@x.5\pgf@x%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \pgf@xa\pgf@y%
- \pgf@y\pgf@x%
- \advance\pgf@y-\southextend\relax%
- \pgf@x\pgf@xa%
- }%
- \pgfpathlineto{%
- \pgf@x0pt\relax%
- \pgf@y-\southextend\relax%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \pgf@xa\pgf@y%
- \pgf@y\pgf@x%
- \advance\pgf@y-\southextend\relax%
- \pgf@x-\pgf@xa%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \pgf@y\pgf@x%
- \advance\pgf@y-\southextend\relax%
- \advance\pgf@y-\arrowheadindent\relax%
- \pgf@x\shaftwidth\relax%
- \pgf@x-.5\pgf@x%
- }%
- \pgfpathlineto{%
- \arrowboxcorner%
- \pgf@x\shaftwidth\relax%
- \pgf@x-.5\pgf@x%
- \pgf@y-\pgf@y%
- }%
- \fi%
- \pgfpathlineto{\arrowboxcorner\pgf@x-\pgf@x\pgf@y-\pgf@y}%
- \ifdim\westextend>0pt\relax%
- \pgfpathlineto{%
- \arrowboxcorner%
- \pgf@x-\pgf@x
- \pgf@y\shaftwidth\relax%
- \pgf@y-.5\pgf@y%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \advance\pgf@x-\westextend\relax%
- \advance\pgf@x-\arrowheadindent\relax%
- \pgf@y\shaftwidth\relax%
- \pgf@y-.5\pgf@y%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \advance\pgf@x-\westextend\relax%
- \pgf@y-\pgf@y%
- }%
- \pgfpathlineto{%
- \pgf@x-\westextend\relax%
- \pgf@y0pt\relax%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \advance\pgf@x-\westextend\relax%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \advance\pgf@x-\westextend\relax%
- \advance\pgf@x-\arrowheadindent\relax%
- \pgf@y\shaftwidth\relax%
- \pgf@y.5\pgf@y%
- }%
- \pgfpathlineto{%
- \arrowboxcorner%
- \pgf@x-\pgf@x%
- \pgf@y\shaftwidth\relax%
- \pgf@y.5\pgf@y%
- }%
- \fi%
- \pgfpathlineto{\arrowboxcorner\pgf@x-\pgf@x}%
- \ifdim\northextend>0pt\relax%
- \pgfpathlineto{%
- \arrowboxcorner%
- \pgf@x\shaftwidth\relax%
- \pgf@x-.5\pgf@x%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \pgf@y-\pgf@x%
- \advance\pgf@y\northextend\relax%
- \advance\pgf@y\arrowheadindent\relax%
- \pgf@x\shaftwidth\relax%
- \pgf@x-.5\pgf@x%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \pgf@xa\pgf@y%
- \pgf@y-\pgf@x%
- \advance\pgf@y\northextend\relax%
- \pgf@x-\pgf@xa%
- }%
- \pgfpathlineto{%
- \pgf@x0pt\relax%
- \pgf@y\northextend\relax%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \pgf@xa\pgf@y%
- \pgf@y-\pgf@x%
- \advance\pgf@y\northextend\relax%
- \pgf@x\pgf@xa%
- }%
- \pgfpathlineto{%
- \beforearrowtip%
- \pgf@y-\pgf@x%
- \advance\pgf@y\northextend\relax%
- \advance\pgf@y\arrowheadindent\relax%
- \pgf@x\shaftwidth\relax%
- \pgf@x.5\pgf@x%
- }%
- \pgfpathlineto{%
- \arrowboxcorner%
- \pgf@x\shaftwidth\relax%
- \pgf@x.5\pgf@x%
- }%
- \fi%
- \pgfpathclose%
- }%
- }
- \anchorborder{%
- \pgfextract@process\externalpoint{}%
- \pgfutil@ifundefined{pgf@lib@shapes@arrowbox@referencepoint}%
- {\let\referencepoint\centerpoint}{\let\referencepoint\pgf@lib@shapes@arrowbox@referencepoint}%
- \pgfextract@process\externalpoint{%
- \pgfpointadd{\referencepoint}{\externalpoint}%
- }%
- \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
- \let\externalangle\pgfmathresult%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@west\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@north\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@north east\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@before east arrow tip\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \def\firstpoint{east arrow tip}%
- \def\secondpoint{before east arrow tip}%
- \else%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@before east arrow\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \def\firstpoint{before east arrow head}%
- \def\secondpoint{before east arrow}%
- \else%
- \def\firstpoint{before east arrow}%
- \def\secondpoint{north east}%
- \fi%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@after north arrow tip\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@after north arrow\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \def\firstpoint{north east}%
- \def\secondpoint{after north arrow}%
- \else%
- \def\firstpoint{after north arrow}%
- \def\secondpoint{after north arrow head}%
- \fi%
- \else%
- \def\firstpoint{after north arrow tip}%
- \def\secondpoint{north arrow tip}%
- \fi%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@north west\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@before north arrow tip\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \def\firstpoint{north arrow tip}%
- \def\secondpoint{before north arrow tip}%
- \else%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@before north arrow\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \def\firstpoint{before north head}%
- \def\secondpoint{before north arrow}%
- \else%
- \def\firstpoint{before north arrow}%
- \def\secondpoint{north west}%
- \fi%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@after west arrow tip\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@after west arrow\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \def\firstpoint{north west}%
- \def\secondpoint{after west arrow}%
- \else%
- \def\firstpoint{after west arrow}%
- \def\secondpoint{after west arrow head}%
- \fi%
- \else%
- \def\firstpoint{after west arrow tip}%
- \def\secondpoint{west arrow tip}%
- \fi%
- \fi%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@south arrow tip\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@south west\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@before west arrow tip\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \def\firstpoint{west arrow tip}%
- \def\secondpoint{before west arrow tip}%
- \else%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@before west arrow\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \def\firstpoint{before west arrow head}%
- \def\secondpoint{before west arrow}%
- \else%
- \def\firstpoint{before west arrow}%
- \def\secondpoint{south west}%
- \fi%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@after south arrow tip\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@after south arrow\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \def\firstpoint{south west}%
- \def\secondpoint{after south arrow}%
- \else%
- \def\firstpoint{after south arrow}%
- \def\secondpoint{after south arrow head}%
- \fi%
- \else%
- \def\firstpoint{after south arrow tip}%
- \def\secondpoint{south arrow tip}%
- \fi%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@south east\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@before south arrow tip\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \def\firstpoint{south arrow tip}%
- \def\secondpoint{before south arrow tip}%
- \else%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@before south arrow\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \def\firstpoint{before south arrow head}%
- \def\secondpoint{before south arrow}%
- \else%
- \def\firstpoint{before south arrow}%
- \def\secondpoint{south east}%
- \fi%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@after east arrow tip\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\referencepoint}%
- {\csname pgf@anchor@arrow box@after east arrow\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \def\firstpoint{south east}%
- \def\secondpoint{after east arrow}%
- \else%
- \def\firstpoint{after east arrow}%
- \def\secondpoint{after east arrow head}%
- \fi%
- \else%
- \def\firstpoint{after east arrow tip}%
- \def\secondpoint{east arrow tip}%
- \fi%
- \fi%
- \fi%
- \fi%
- \pgfpointintersectionoflines{\referencepoint}{\externalpoint}%
- {\csname pgf@anchor@arrow box@\firstpoint\endcsname}%
- {\csname pgf@anchor@arrow box@\secondpoint\endcsname}%
- }
-}
+ \saveddimen\shaftwidth{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/arrow box shaft width}}%
+ }%
+ %
+ % Calculate far the arrows extend from the center of the node.
+ %
+ \savedmacro\arrowboxpoints{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
+ \ifdim\pgf@x<.5\pgf@xa%
+ \pgf@x.5\pgf@xa%
+ \fi%
+ \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ %
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y.5\dp\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@y<.5\pgf@ya%
+ \pgf@y.5\pgf@ya%
+ \fi%
+ \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
+ %
+ \edef\halfboxwidth{\the\pgf@x}%
+ \edef\halfboxheight{\the\pgf@y}%
+ \pgfextract@process\arrowboxcorner{}%
+ \addtosavedmacro\arrowboxcorner%
+ %
+ \pgf@lib@arrowbox@parsearrowlength\pgf@x{\halfboxwidth}%
+ {\pgfkeysvalueof{/pgf/arrow box west arrow}}%
+ \edef\westextend{\the\pgf@x}%
+ \addtosavedmacro\westextend%
+ %
+ \pgf@lib@arrowbox@parsearrowlength\pgf@x{\halfboxwidth}%
+ {\pgfkeysvalueof{/pgf/arrow box east arrow}}%
+ \edef\eastextend{\the\pgf@x}%
+ \addtosavedmacro\eastextend%
+ %
+ \pgf@lib@arrowbox@parsearrowlength\pgf@x{\halfboxheight}%
+ {\pgfkeysvalueof{/pgf/arrow box north arrow}}%
+ \edef\northextend{\the\pgf@x}%
+ \addtosavedmacro\northextend%
+ %
+ \pgf@lib@arrowbox@parsearrowlength\pgf@x{\halfboxheight}%
+ {\pgfkeysvalueof{/pgf/arrow box south arrow}}%
+ \edef\southextend{\the\pgf@x}%
+ \addtosavedmacro\southextend%
+ }%
+ \saveddimen\arrowheadextend{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/arrow box head extend}}%
+ }%
+ \saveddimen\arrowheadindent{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/arrow box head indent}}%
+ }%
+ %
+ % Calculate the `miter' angle for the outer sep at the arrow tip.
+ %
+ \savedmacro\arrowtipmiterangle{%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/arrow box tip angle}}%
+ \pgfmathdivide@{\pgfmathresult}{2}%
+ \let\arrowtipmiterangle\pgfmathresult%
+ }%
+ %
+ % Calculate the `miter' angle for the outer sep at the point just
+ % before the arrow tip.
+ %
+ \savedmacro\arrowheadangles{%
+ %
+ % Calculate the `miter' angle and its cosecant at the arrow tip...
+ %
+ \pgfmathparse{\pgfkeysvalueof{/pgf/arrow box tip angle}}%
+ \pgfmathdivide@{\pgfmathresult}{2}%
+ \let\arrowtipmiterangle\pgfmathresult%
+ \addtosavedmacro\arrowtipmiterangle%
+ \pgfmathcosec@{\arrowtipmiterangle}%
+ \let\cosecarrowtipmiterangle\pgfmathresult%
+ \addtosavedmacro\cosecarrowtipmiterangle%
+ %
+ % ...before the arrow head...
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/arrow box head extend}}%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/arrow box head indent}}%
+ \ifdim\pgf@y=0pt\relax%
+ \def\pgfmathresult{90}%
+ \else%
+ \ifdim\pgf@y<0pt\relax%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
+ \pgfmathatan@{\pgfmathresult}%
+ \pgfmathadd@{\pgfmathresult}{180}%
+ \else%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
+ \pgfmathatan@{\pgfmathresult}%
+ \fi%
+ \fi%
+ \pgfmathdivide@{\pgfmathresult}{2}%
+ \let\beforearrowheadmiterangle\pgfmathresult%
+ \addtosavedmacro\beforearrowheadmiterangle%
+ \pgfmathcosec@{\beforearrowheadmiterangle}%
+ \let\cosecbeforearrowheadmiterangle\pgfmathresult%
+ \addtosavedmacro\cosecbeforearrowheadmiterangle%
+ %
+ % ...and before the arrow tip.
+ %
+ \pgfutil@tempdima-\arrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima90pt\relax%
+ \pgfutil@tempdimb\beforearrowheadmiterangle pt\relax%
+ \pgfutil@tempdimb2.0\pgfutil@tempdimb%
+ \advance\pgfutil@tempdimb-90pt\relax%
+ \advance\pgfutil@tempdima\pgfutil@tempdimb%
+ \divide\pgfutil@tempdima2\relax%
+ \edef\beforearrowtipmiterangle{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \addtosavedmacro\beforearrowtipmiterangle%
+ \pgfmathcosec@{\beforearrowtipmiterangle}%
+ \let\cosecbeforearrowtipmiterangle\pgfmathresult%
+ \addtosavedmacro\cosecbeforearrowtipmiterangle%
+ }%
+ \saveddimen\outerxsep{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ }%
+ \saveddimen\outerysep{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer ysep}}%
+ }%
+ %
+ % Calculate the (path) point immediately prior to an arrow tip.
+ %
+ \savedanchor\beforearrowtip{%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/arrow box tip angle}}%
+ \pgfmathdivide@{\pgfmathresult}{2}%
+ \pgfmathcot@{\pgfmathresult}%
+ \let\cothalfangle\pgfmathresult%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/arrow box shaft width}}%
+ \pgf@y.5\pgf@y%
+ \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/arrow box head extend}}%
+ \pgf@y\pgf@y%
+ \pgf@x\cothalfangle\pgf@y%
+ }%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \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{mid}{\midpoint}%
+ \anchor{mid east}{%
+ \arrowboxpoints%
+ \ifdim\eastextend>0pt\relax%
+ \let\pgf@lib@shapes@arrowbox@referencepoint\midpoint%
+ \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{\eastextend}{0pt}};
+ \else%
+ \arrowboxcorner%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \advance\pgf@x\pgf@xa%
+ \fi%
+ }%
+ \anchor{mid west}{%
+ \arrowboxpoints%
+ \ifdim\westextend>0pt\relax%
+ \let\pgf@lib@shapes@arrowbox@referencepoint\midpoint%
+ \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{-\westextend}{0pt}};
+ \else%
+ \arrowboxcorner%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \advance\pgf@x-\pgf@xa%
+ \fi%
+ }%
+ \anchor{base}{\basepoint}%
+ \anchor{base east}{%
+ \arrowboxpoints%
+ \ifdim\eastextend>0pt\relax%
+ \let\pgf@lib@shapes@arrowbox@referencepoint\basepoint%
+ \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{\eastextend}{0pt}};
+ \else%
+ \arrowboxcorner%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \advance\pgf@x\pgf@xa%
+ \fi%
+ }%
+ \anchor{base west}{%
+ \arrowboxpoints%
+ \ifdim\westextend>0pt\relax%
+ \let\pgf@lib@shapes@arrowbox@referencepoint\basepoint%
+ \csname pgf@anchor@arrow box@border\endcsname{\pgfqpoint{-\westextend}{0pt}};
+ \else%
+ \arrowboxcorner%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \advance\pgf@x-\pgf@xa%
+ \fi%
+ }%
+ \anchor{north}{%
+ \arrowboxpoints%
+ \ifdim\northextend>0pt\relax%
+ \csname pgf@anchor@arrow box@north arrow tip\endcsname%
+ \else%
+ \pgfpointadd{\centerpoint}{\arrowboxcorner}%
+ \pgf@ya\pgf@y%
+ \centerpoint%
+ \pgf@y\pgf@ya%
+ \fi%
+ }%
+ \anchor{south}{%
+ \arrowboxpoints%
+ \ifdim\southextend>0pt\relax%
+ \csname pgf@anchor@arrow box@south arrow tip\endcsname%
+ \else%
+ \pgfpointadd{\centerpoint}{\arrowboxcorner\pgf@y-\pgf@y}%
+ \pgf@ya\pgf@y%
+ \centerpoint%
+ \pgf@y\pgf@ya%
+ \fi%
+ }%
+ \anchor{east}{%
+ \arrowboxpoints%
+ \ifdim\eastextend>0pt\relax%
+ \csname pgf@anchor@arrow box@east arrow tip\endcsname%
+ \else%
+ \pgfpointadd{\centerpoint}{\arrowboxcorner}%
+ \pgf@xa\pgf@x%
+ \centerpoint%
+ \pgf@x\pgf@xa%
+ \fi%
+ }%
+ \anchor{west}{%
+ \arrowboxpoints%
+ \ifdim\westextend>0pt\relax%
+ \csname pgf@anchor@arrow box@west arrow tip\endcsname%
+ \else%
+ \pgfpointadd{\centerpoint}{\arrowboxcorner\pgf@x-\pgf@x}%
+ \pgf@xa\pgf@x%
+ \centerpoint%
+ \pgf@x\pgf@xa%
+ \fi%
+ }%
+ \anchor{north east}{%
+ \arrowboxpoints%
+ \pgfpointadd{\centerpoint}{\arrowboxcorner}%
+ }%
+ \anchor{north west}{%
+ \arrowboxpoints%
+ \pgfpointadd{\centerpoint}{\arrowboxcorner\pgf@x-\pgf@x}%
+ }%
+ \anchor{south west}{%
+ \arrowboxpoints%
+ \pgfpointadd{\centerpoint}{\arrowboxcorner\pgf@x-\pgf@x\pgf@y-\pgf@y}%
+ }%
+ \anchor{south east}{%
+ \arrowboxpoints%
+ \pgfpointadd{\centerpoint}{\arrowboxcorner\pgf@y-\pgf@y}%
+ }%
+ \anchor{before east arrow}{%
+ \arrowboxpoints%
+ \ifdim\eastextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \arrowboxcorner%
+ \pgf@y\shaftwidth\relax%
+ \pgf@y.5\pgf@y%
+ \advance\pgf@y\outerysep\relax%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@east\endcsname%
+ \fi%
+ }%
+ \anchor{before east arrow head}{%
+ \arrowboxpoints%
+ \ifdim\eastextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
+ \advance\pgfutil@tempdima180pt\relax%
+ \pgfutil@tempdimb\outerxsep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@x-\pgf@x%
+ \advance\pgf@x\eastextend\relax%
+ \advance\pgf@x\arrowheadindent\relax%
+ \pgf@y\shaftwidth\relax%
+ \pgf@y.5\pgf@y%
+ }%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@east\endcsname%
+ \fi%
+ }%
+ \anchor{before east arrow tip}{%
+ \arrowboxpoints%
+ \ifdim\eastextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima-\arrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima-\beforearrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima180pt\relax%
+ \pgfutil@tempdimb\outerysep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@x-\pgf@x%
+ \advance\pgf@x\eastextend\relax%
+ }%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@east\endcsname%
+ \fi%
+ }%
+ \anchor{east arrow tip}{%
+ \arrowboxpoints%
+ \ifdim\eastextend>0pt\relax%
+ \centerpoint%
+ \advance\pgf@x\eastextend\relax%
+ \pgf@xa\outerxsep\relax%
+ \pgfmathcosec@{\arrowtipmiterangle}%
+ \advance\pgf@x\pgfmathresult\pgf@xa%
+ \else%
+ \csname pgf@anchor@arrow box@east\endcsname%
+ \fi%
+ }%
+ \anchor{after east arrow tip}{%
+ \arrowboxpoints%
+ \ifdim\eastextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima-\arrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima-\beforearrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima180pt\relax%
+ \pgfutil@tempdimb\outerysep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@x-\pgf@x%
+ \advance\pgf@x\eastextend\relax%
+ }%
+ \pgf@y-\pgf@y%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@east\endcsname%
+ \fi%
+ }%
+ \anchor{after east arrow head}{%
+ \arrowboxpoints%
+ \ifdim\eastextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
+ \advance\pgfutil@tempdima180pt\relax%
+ \pgfutil@tempdimb\outerxsep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@x-\pgf@x%
+ \advance\pgf@x\eastextend\relax%
+ \advance\pgf@x\arrowheadindent\relax%
+ \pgf@y\shaftwidth\relax%
+ \pgf@y.5\pgf@y%
+ }%
+ \pgf@y-\pgf@y%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@east\endcsname%
+ \fi%
+ }%
+ \anchor{after east arrow}{%
+ \arrowboxpoints%
+ \ifdim\eastextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \arrowboxcorner%
+ \pgf@y\shaftwidth\relax%
+ \pgf@y.5\pgf@y%
+ \advance\pgf@y\outerysep\relax%
+ \pgf@y-\pgf@y%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@east\endcsname%
+ \fi%
+ }%
+ %
+ \anchor{before west arrow}{%
+ \arrowboxpoints%
+ \ifdim\westextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \arrowboxcorner%
+ \pgf@x-\pgf@x%
+ \pgf@y\shaftwidth\relax%
+ \pgf@y.5\pgf@y%
+ \advance\pgf@y\outerysep\relax%
+ \pgf@y-\pgf@y%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@west\endcsname%
+ \fi%
+ }%
+ \anchor{before west arrow head}{%
+ \arrowboxpoints%
+ \ifdim\westextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
+ \advance\pgfutil@tempdima180pt\relax%
+ \pgfutil@tempdimb\outerxsep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@x-\pgf@x%
+ \advance\pgf@x\westextend\relax%
+ \advance\pgf@x\arrowheadindent\relax%
+ \pgf@y\shaftwidth\relax%
+ \pgf@y.5\pgf@y%
+ }%
+ \pgf@x-\pgf@x%
+ \pgf@y-\pgf@y%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@west\endcsname%
+ \fi%
+ }%
+ \anchor{before west arrow tip}{%
+ \arrowboxpoints%
+ \ifdim\westextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima-\arrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima-\beforearrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima180pt\relax%
+ \pgfutil@tempdimb\outerysep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@x-\pgf@x%
+ \advance\pgf@x\westextend\relax%
+ }%
+ \pgf@x-\pgf@x%
+ \pgf@y-\pgf@y%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@west\endcsname%
+ \fi%
+ }%
+ \anchor{west arrow tip}{%
+ \arrowboxpoints%
+ \ifdim\westextend>0pt\relax%
+ \centerpoint%
+ \advance\pgf@x-\westextend\relax%
+ \pgf@xa\outerxsep\relax%
+ \pgfmathcosec@{\arrowtipmiterangle}%
+ \advance\pgf@x-\pgfmathresult\pgf@xa%
+ \else%
+ \csname pgf@anchor@arrow box@west\endcsname%
+ \fi%
+ }%
+ \anchor{after west arrow tip}{%
+ \arrowboxpoints%
+ \ifdim\westextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima-\arrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima-\beforearrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima180pt\relax%
+ \pgfutil@tempdimb\outerysep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@x-\pgf@x%
+ \advance\pgf@x\westextend\relax%
+ }%
+ \pgf@x-\pgf@x%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@west\endcsname%
+ \fi%
+ }%
+ \anchor{after west arrow head}{%
+ \arrowboxpoints%
+ \ifdim\westextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
+ \advance\pgfutil@tempdima180pt\relax%
+ \pgfutil@tempdimb\outerxsep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@x-\pgf@x%
+ \advance\pgf@x\westextend\relax%
+ \advance\pgf@x\arrowheadindent\relax%
+ \pgf@y\shaftwidth\relax%
+ \pgf@y.5\pgf@y%
+ }%
+ \pgf@x-\pgf@x%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@west\endcsname%
+ \fi%
+ }%
+ \anchor{after west arrow}{%
+ \arrowboxpoints%
+ \ifdim\westextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \arrowboxcorner%
+ \pgf@y\shaftwidth\relax%
+ \pgf@y.5\pgf@y%
+ \advance\pgf@y\outerysep\relax%
+ \pgf@x-\pgf@x%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@west\endcsname%
+ \fi%
+ }%
+ %
+ \anchor{before north arrow}{%
+ \arrowboxpoints%
+ \ifdim\northextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \arrowboxcorner%
+ \pgf@x-\shaftwidth\relax%
+ \pgf@x.5\pgf@x%
+ \advance\pgf@x-\outerxsep\relax%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@north\endcsname%
+ \fi%
+ }%
+ \anchor{before north arrow head}{%
+ \arrowboxpoints%
+ \ifdim\northextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
+ \advance\pgfutil@tempdima270pt\relax%
+ \pgfutil@tempdimb\outerysep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@y-\pgf@x%
+ \advance\pgf@y\northextend\relax%
+ \advance\pgf@y\arrowheadindent\relax%
+ \pgf@x-\shaftwidth\relax%
+ \pgf@x.5\pgf@x%
+ }%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@north\endcsname%
+ \fi%
+ }%
+ \anchor{before north arrow tip}{%
+ \arrowboxpoints%
+ \ifdim\northextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima\arrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima\beforearrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima-90pt\relax%
+ \pgfutil@tempdimb\outerxsep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@xa\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y-\pgf@xa%
+ \advance\pgf@y\northextend\relax%
+ }%
+ \pgf@x-\pgf@x%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@north\endcsname%
+ \fi%
+ }%
+ \anchor{north arrow tip}{%
+ \arrowboxpoints%
+ \ifdim\northextend>0pt\relax%
+ \centerpoint%
+ \advance\pgf@y\northextend\relax%
+ \pgf@ya\outerysep\relax%
+ \pgfmathcosec@{\arrowtipmiterangle}%
+ \advance\pgf@y\pgfmathresult\pgf@ya%
+ \else%
+ \csname pgf@anchor@arrow box@north\endcsname%
+ \fi%
+ }%
+ \anchor{after north arrow tip}{%
+ \arrowboxpoints%
+ \ifdim\northextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima\arrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima\beforearrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima-90pt\relax%
+ \pgfutil@tempdimb\outerxsep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@xa\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y-\pgf@xa%
+ \advance\pgf@y\northextend\relax%
+ }%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@north\endcsname%
+ \fi%
+ }%
+ \anchor{after north arrow head}{%
+ \arrowboxpoints%
+ \ifdim\northextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
+ \advance\pgfutil@tempdima270pt\relax%
+ \pgfutil@tempdimb\outerysep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@y-\pgf@x%
+ \advance\pgf@y\northextend\relax%
+ \advance\pgf@y\arrowheadindent\relax%
+ \pgf@x-\shaftwidth\relax%
+ \pgf@x.5\pgf@x%
+ }%
+ \pgf@x-\pgf@x%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@north\endcsname%
+ \fi%
+ }%
+ \anchor{after north arrow}{%
+ \arrowboxpoints%
+ \ifdim\northextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \arrowboxcorner%
+ \pgf@x\shaftwidth\relax%
+ \pgf@x.5\pgf@x%
+ \advance\pgf@x\outerxsep\relax%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@north\endcsname%
+ \fi%
+ }%
+ %
+ \anchor{before south arrow}{%
+ \arrowboxpoints%
+ \ifdim\southextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \arrowboxcorner%
+ \pgf@x\shaftwidth\relax%
+ \pgf@x.5\pgf@x%
+ \advance\pgf@x\outerxsep\relax%
+ \pgf@y-\pgf@y%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@south\endcsname%
+ \fi%
+ }%
+ \anchor{before south arrow head}{%
+ \arrowboxpoints%
+ \ifdim\northextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
+ \advance\pgfutil@tempdima270pt\relax%
+ \pgfutil@tempdimb\outerysep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@y-\pgf@x%
+ \advance\pgf@y\northextend\relax%
+ \advance\pgf@y\arrowheadindent\relax%
+ \pgf@x-\shaftwidth\relax%
+ \pgf@x.5\pgf@x%
+ }%
+ \pgf@x-\pgf@x%
+ \pgf@y-\pgf@y%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@south\endcsname%
+ \fi%
+ }%
+ \anchor{before south arrow tip}{%
+ \arrowboxpoints%
+ \ifdim\northextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima\arrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima\beforearrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima-90pt\relax%
+ \pgfutil@tempdimb\outerxsep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@xa\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y-\pgf@xa%
+ \advance\pgf@y\northextend\relax%
+ }%
+ \pgf@y-\pgf@y%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@south\endcsname%
+ \fi%
+ }%
+ \anchor{south arrow tip}{%
+ \arrowboxpoints%
+ \ifdim\southextend>0pt\relax%
+ \centerpoint%
+ \advance\pgf@y-\southextend\relax%
+ \pgf@ya\outerysep\relax%
+ \pgfmathcosec@{\arrowtipmiterangle}%
+ \advance\pgf@y-\pgfmathresult\pgf@ya%
+ \else%
+ \csname pgf@anchor@arrow box@east\endcsname%
+ \fi%
+ }%
+ \anchor{after south arrow tip}{%
+ \arrowboxpoints%
+ \ifdim\northextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima\arrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima\beforearrowtipmiterangle pt\relax%
+ \advance\pgfutil@tempdima-90pt\relax%
+ \pgfutil@tempdimb\outerxsep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowtipmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@xa\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y-\pgf@xa%
+ \advance\pgf@y\northextend\relax%
+ }%
+ \pgf@x-\pgf@x%
+ \pgf@y-\pgf@y%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@south\endcsname%
+ \fi%
+ }%
+ \anchor{after south arrow head}{%
+ \arrowboxpoints%
+ \ifdim\northextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointadd{%
+ \arrowheadangles%
+ \pgfutil@tempdima-\beforearrowheadmiterangle pt\relax%
+ \advance\pgfutil@tempdima270pt\relax%
+ \pgfutil@tempdimb\outerysep\relax%
+ \pgfutil@tempdimb\cosecbeforearrowheadmiterangle\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }%
+ {%
+ \beforearrowtip%
+ \pgf@y-\pgf@x%
+ \advance\pgf@y\northextend\relax%
+ \advance\pgf@y\arrowheadindent\relax%
+ \pgf@x-\shaftwidth\relax%
+ \pgf@x.5\pgf@x%
+ }%
+ \pgf@y-\pgf@y%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@south\endcsname%
+ \fi%
+ }%
+ \anchor{after south arrow}{%
+ \arrowboxpoints%
+ \ifdim\southextend>0pt\relax%
+ \pgfpointadd{\centerpoint}{%
+ \arrowboxcorner%
+ \pgf@x-\shaftwidth\relax%
+ \pgf@x.5\pgf@x%
+ \advance\pgf@x-\outerxsep\relax%
+ \pgf@y-\pgf@y%
+ }%
+ \else%
+ \csname pgf@anchor@arrow box@south\endcsname%
+ \fi%
+ }%
+ %
+ \backgroundpath{%
+ \arrowboxpoints%
+ \pgfextract@process\arrowboxcorner{%
+ \arrowboxcorner%
+ \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathaddtolength\pgf@y{-\pgfkeysvalueof{/pgf/outer ysep}}%
+ }%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\arrowboxcorner}%
+ \ifdim\eastextend>0pt\relax%
+ \pgfpathlineto{%
+ \arrowboxcorner%
+ \pgf@y\shaftwidth\relax%
+ \pgf@y.5\pgf@y%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \pgf@x-\pgf@x%
+ \advance\pgf@x\eastextend\relax%
+ \advance\pgf@x\arrowheadindent\relax%
+ \pgf@y\shaftwidth\relax%
+ \pgf@y.5\pgf@y%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \pgf@x-\pgf@x%
+ \advance\pgf@x\eastextend\relax%
+ }%
+ \pgfpathlineto{%
+ \pgf@x\eastextend\relax%
+ \pgf@y0pt\relax%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \pgf@x-\pgf@x%
+ \advance\pgf@x\eastextend\relax%
+ \pgf@y-\pgf@y%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \pgf@x-\pgf@x%
+ \advance\pgf@x\eastextend\relax%
+ \advance\pgf@x\arrowheadindent\relax%
+ \pgf@y\shaftwidth\relax%
+ \pgf@y-.5\pgf@y%
+ }%
+ \pgfpathlineto{%
+ \arrowboxcorner%
+ \pgf@y\shaftwidth\relax%
+ \pgf@y-.5\pgf@y%
+ }%
+ \fi%
+ \pgfpathlineto{\arrowboxcorner\pgf@y-\pgf@y}%
+ \ifdim\southextend>0pt\relax%
+ \pgfpathlineto{%
+ \arrowboxcorner%
+ \pgf@x\shaftwidth\relax%
+ \pgf@x.5\pgf@x%
+ \pgf@y-\pgf@y%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \pgf@y\pgf@x%
+ \advance\pgf@y-\southextend\relax%
+ \advance\pgf@y-\arrowheadindent\relax%
+ \pgf@x\shaftwidth\relax%
+ \pgf@x.5\pgf@x%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \pgf@xa\pgf@y%
+ \pgf@y\pgf@x%
+ \advance\pgf@y-\southextend\relax%
+ \pgf@x\pgf@xa%
+ }%
+ \pgfpathlineto{%
+ \pgf@x0pt\relax%
+ \pgf@y-\southextend\relax%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \pgf@xa\pgf@y%
+ \pgf@y\pgf@x%
+ \advance\pgf@y-\southextend\relax%
+ \pgf@x-\pgf@xa%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \pgf@y\pgf@x%
+ \advance\pgf@y-\southextend\relax%
+ \advance\pgf@y-\arrowheadindent\relax%
+ \pgf@x\shaftwidth\relax%
+ \pgf@x-.5\pgf@x%
+ }%
+ \pgfpathlineto{%
+ \arrowboxcorner%
+ \pgf@x\shaftwidth\relax%
+ \pgf@x-.5\pgf@x%
+ \pgf@y-\pgf@y%
+ }%
+ \fi%
+ \pgfpathlineto{\arrowboxcorner\pgf@x-\pgf@x\pgf@y-\pgf@y}%
+ \ifdim\westextend>0pt\relax%
+ \pgfpathlineto{%
+ \arrowboxcorner%
+ \pgf@x-\pgf@x
+ \pgf@y\shaftwidth\relax%
+ \pgf@y-.5\pgf@y%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \advance\pgf@x-\westextend\relax%
+ \advance\pgf@x-\arrowheadindent\relax%
+ \pgf@y\shaftwidth\relax%
+ \pgf@y-.5\pgf@y%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \advance\pgf@x-\westextend\relax%
+ \pgf@y-\pgf@y%
+ }%
+ \pgfpathlineto{%
+ \pgf@x-\westextend\relax%
+ \pgf@y0pt\relax%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \advance\pgf@x-\westextend\relax%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \advance\pgf@x-\westextend\relax%
+ \advance\pgf@x-\arrowheadindent\relax%
+ \pgf@y\shaftwidth\relax%
+ \pgf@y.5\pgf@y%
+ }%
+ \pgfpathlineto{%
+ \arrowboxcorner%
+ \pgf@x-\pgf@x%
+ \pgf@y\shaftwidth\relax%
+ \pgf@y.5\pgf@y%
+ }%
+ \fi%
+ \pgfpathlineto{\arrowboxcorner\pgf@x-\pgf@x}%
+ \ifdim\northextend>0pt\relax%
+ \pgfpathlineto{%
+ \arrowboxcorner%
+ \pgf@x\shaftwidth\relax%
+ \pgf@x-.5\pgf@x%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \pgf@y-\pgf@x%
+ \advance\pgf@y\northextend\relax%
+ \advance\pgf@y\arrowheadindent\relax%
+ \pgf@x\shaftwidth\relax%
+ \pgf@x-.5\pgf@x%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \pgf@xa\pgf@y%
+ \pgf@y-\pgf@x%
+ \advance\pgf@y\northextend\relax%
+ \pgf@x-\pgf@xa%
+ }%
+ \pgfpathlineto{%
+ \pgf@x0pt\relax%
+ \pgf@y\northextend\relax%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \pgf@xa\pgf@y%
+ \pgf@y-\pgf@x%
+ \advance\pgf@y\northextend\relax%
+ \pgf@x\pgf@xa%
+ }%
+ \pgfpathlineto{%
+ \beforearrowtip%
+ \pgf@y-\pgf@x%
+ \advance\pgf@y\northextend\relax%
+ \advance\pgf@y\arrowheadindent\relax%
+ \pgf@x\shaftwidth\relax%
+ \pgf@x.5\pgf@x%
+ }%
+ \pgfpathlineto{%
+ \arrowboxcorner%
+ \pgf@x\shaftwidth\relax%
+ \pgf@x.5\pgf@x%
+ }%
+ \fi%
+ \pgfpathclose%
+ }%
+ }%
+ \anchorborder{%
+ \pgfextract@process\externalpoint{}%
+ \pgfutil@ifundefined{pgf@lib@shapes@arrowbox@referencepoint}%
+ {\let\referencepoint\centerpoint}{\let\referencepoint\pgf@lib@shapes@arrowbox@referencepoint}%
+ \pgfextract@process\externalpoint{%
+ \pgfpointadd{\referencepoint}{\externalpoint}%
+ }%
+ \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
+ \let\externalangle\pgfmathresult%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@west\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@north\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@north east\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@before east arrow tip\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \def\firstpoint{east arrow tip}%
+ \def\secondpoint{before east arrow tip}%
+ \else%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@before east arrow\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \def\firstpoint{before east arrow head}%
+ \def\secondpoint{before east arrow}%
+ \else%
+ \def\firstpoint{before east arrow}%
+ \def\secondpoint{north east}%
+ \fi%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@after north arrow tip\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@after north arrow\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \def\firstpoint{north east}%
+ \def\secondpoint{after north arrow}%
+ \else%
+ \def\firstpoint{after north arrow}%
+ \def\secondpoint{after north arrow head}%
+ \fi%
+ \else%
+ \def\firstpoint{after north arrow tip}%
+ \def\secondpoint{north arrow tip}%
+ \fi%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@north west\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@before north arrow tip\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \def\firstpoint{north arrow tip}%
+ \def\secondpoint{before north arrow tip}%
+ \else%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@before north arrow\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \def\firstpoint{before north head}%
+ \def\secondpoint{before north arrow}%
+ \else%
+ \def\firstpoint{before north arrow}%
+ \def\secondpoint{north west}%
+ \fi%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@after west arrow tip\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@after west arrow\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \def\firstpoint{north west}%
+ \def\secondpoint{after west arrow}%
+ \else%
+ \def\firstpoint{after west arrow}%
+ \def\secondpoint{after west arrow head}%
+ \fi%
+ \else%
+ \def\firstpoint{after west arrow tip}%
+ \def\secondpoint{west arrow tip}%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@south arrow tip\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@south west\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@before west arrow tip\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \def\firstpoint{west arrow tip}%
+ \def\secondpoint{before west arrow tip}%
+ \else%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@before west arrow\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \def\firstpoint{before west arrow head}%
+ \def\secondpoint{before west arrow}%
+ \else%
+ \def\firstpoint{before west arrow}%
+ \def\secondpoint{south west}%
+ \fi%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@after south arrow tip\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@after south arrow\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \def\firstpoint{south west}%
+ \def\secondpoint{after south arrow}%
+ \else%
+ \def\firstpoint{after south arrow}%
+ \def\secondpoint{after south arrow head}%
+ \fi%
+ \else%
+ \def\firstpoint{after south arrow tip}%
+ \def\secondpoint{south arrow tip}%
+ \fi%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@south east\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@before south arrow tip\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \def\firstpoint{south arrow tip}%
+ \def\secondpoint{before south arrow tip}%
+ \else%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@before south arrow\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \def\firstpoint{before south arrow head}%
+ \def\secondpoint{before south arrow}%
+ \else%
+ \def\firstpoint{before south arrow}%
+ \def\secondpoint{south east}%
+ \fi%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@after east arrow tip\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\referencepoint}%
+ {\csname pgf@anchor@arrow box@after east arrow\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \def\firstpoint{south east}%
+ \def\secondpoint{after east arrow}%
+ \else%
+ \def\firstpoint{after east arrow}%
+ \def\secondpoint{after east arrow head}%
+ \fi%
+ \else%
+ \def\firstpoint{after east arrow tip}%
+ \def\secondpoint{east arrow tip}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \pgfpointintersectionoflines{\referencepoint}{\externalpoint}%
+ {\csname pgf@anchor@arrow box@\firstpoint\endcsname}%
+ {\csname pgf@anchor@arrow box@\secondpoint\endcsname}%
+ }%
+}%
+
+
-
-
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.callouts.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.callouts.code.tex
index cfa1d80d442..4cf4b1346b8 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.callouts.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.callouts.code.tex
@@ -7,83 +7,83 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgflibrary{shapes.symbols}
+\usepgflibrary{shapes.symbols}%
% Keys for callouts
%
% Common to all callouts:
-% /pgf/callout absolute pointer
-% /pgf/callout relative pointer
+% /pgf/callout absolute pointer
+% /pgf/callout relative pointer
%
% ellipse callout only:
-% /pgf/callout pointer arc
+% /pgf/callout pointer arc
%
-% rectangle callout only:
-% /pgf/callout pointer width
+% rectangle callout only:
+% /pgf/callout pointer width
%
% cloud callout only:
-% /pgf/callout pointer start size
-% /pgf/callout pointer end size
-% /pgf/callout pointer segments
+% /pgf/callout pointer start size
+% /pgf/callout pointer end size
+% /pgf/callout pointer segments
%
\newif\ifpgf@lib@callout@absolutepointer
\pgfkeys{/pgf/.cd,
- callout pointer arc/.initial=15,
- callout pointer width/.initial=.25cm,
- callout pointer start size/.initial=.2 of callout,
- callout pointer end size/.initial=.1 of callout,
- callout pointer segments/.initial=2,
- callout absolute pointer/.code={\pgf@lib@callout@makeabsolutepointer{#1}},
- callout relative pointer/.code={\pgf@lib@callout@makerelativepointer{#1}},
- callout pointer shorten/.initial=0cm
-}
+ callout pointer arc/.initial=15,
+ callout pointer width/.initial=.25cm,
+ callout pointer start size/.initial=.2 of callout,
+ callout pointer end size/.initial=.1 of callout,
+ callout pointer segments/.initial=2,
+ callout absolute pointer/.code={\pgf@lib@callout@makeabsolutepointer{#1}},
+ callout relative pointer/.code={\pgf@lib@callout@makerelativepointer{#1}},
+ callout pointer shorten/.initial=0cm,
+}%
\def\pgf@lib@callout@makeabsolutepointer#1{%
- \pgf@lib@callout@absolutepointertrue%
- {%
- \pgftransformshift{#1}%
- \pgfmultipartnode{coordinate}{center}{pgf@lib@callout@pointer}{}%
- }%
-}
+ \pgf@lib@callout@absolutepointertrue%
+ {%
+ \pgftransformshift{#1}%
+ \pgfmultipartnode{coordinate}{center}{pgf@lib@callout@pointer}{}%
+ }%
+}%
\def\pgf@lib@callout@makerelativepointer#1{%
- \pgf@lib@callout@absolutepointerfalse%
- \def\pgf@lib@callout@relativepointer{#1}%
-}
-\pgfkeys{/pgf/callout relative pointer=\pgfpointpolar{300}{.5cm}}
+ \pgf@lib@callout@absolutepointerfalse%
+ \def\pgf@lib@callout@relativepointer{#1}%
+}%
+\pgfkeys{/pgf/callout relative pointer=\pgfpointpolar{300}{.5cm}}%
% Shape ellipse callout
%
%
\pgfdeclareshape{ellipse callout}{%
- \savedmacro\ellipsecalloutpoints{%
- %
- % Get the larger of the outer sep.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- \ifdim\pgf@x>\pgf@y%
- \edef\outersep{\the\pgf@x}%
- \else%
- \edef\outersep{\the\pgf@y}%
- \fi%
- \addtosavedmacro\outersep%
- %
- % Calculate the node dimensions...
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \savedmacro\ellipsecalloutpoints{%
+ %
+ % Get the larger of the outer sep.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@x>\pgf@y%
+ \edef\outersep{\the\pgf@x}%
+ \else%
+ \edef\outersep{\the\pgf@y}%
+ \fi%
+ \addtosavedmacro\outersep%
+ %
+ % Calculate the node dimensions...
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@x1.4142136\pgf@x%
\pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
\ifdim\pgf@x<.5\pgf@xa%
\pgf@x.5\pgf@xa%
\fi%
%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y.5\ht\pgfnodeparttextbox%
\advance\pgf@y.5\dp\pgfnodeparttextbox%
\pgf@y1.4142136\pgf@y%
\pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
@@ -105,177 +105,177 @@
%
\addtosavedmacro\xradius%
\addtosavedmacro\xpathradius%
- \addtosavedmacro\yradius%
+ \addtosavedmacro\yradius%
\addtosavedmacro\ypathradius%
- %
- \pgfmathsetmacro\pointerarc{\pgfkeysvalueof{/pgf/callout pointer arc}}%
- \addtosavedmacro\pointerarc%
- %
- \pgfextract@process\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }%
- %
- % Get the realtive pointer.
- %
- \ifpgf@lib@callout@absolutepointer%
- \else%
- \pgfextract@process\calloutpointer{%
- \pgfextract@process\borderpoint{%
- \expandafter\pgfpointborderellipse\expandafter{\pgf@lib@callout@relativepointer}{\pgfqpoint{\xpathradius}{\ypathradius}}%
- }%
- \pgfmathanglebetweenpoints{\pgfpointorigin}{\borderpoint}%
- \let\pointerangle\pgfmathresult%
- \expandafter\pgf@process\expandafter{\pgf@lib@callout@relativepointer}%
- \pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
- \edef\pointerradius{\pgfmathresult pt}%
- \pgfpointadd{\borderpoint}{\pgfqpointpolar{\pointerangle}{\pointerradius}}%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- %
- \addtosavedmacro\calloutpointer%
- \pgf@lib@callouts@shortenpointer%
- \pgf@lib@ellipsecallout@getpoints%
- \addtosavedmacro\calloutpointeranchor%
- \addtosavedmacro\beforecalloutangle%
- \addtosavedmacro\aftercalloutangle%
- \fi%
+ %
+ \pgfmathsetmacro\pointerarc{\pgfkeysvalueof{/pgf/callout pointer arc}}%
+ \addtosavedmacro\pointerarc%
+ %
+ \pgfextract@process\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ %
+ % Get the relative pointer.
+ %
+ \ifpgf@lib@callout@absolutepointer%
+ \else%
+ \pgfextract@process\calloutpointer{%
+ \pgfextract@process\borderpoint{%
+ \expandafter\pgfpointborderellipse\expandafter{\pgf@lib@callout@relativepointer}{\pgfqpoint{\xpathradius}{\ypathradius}}%
+ }%
+ \pgfmathanglebetweenpoints{\pgfpointorigin}{\borderpoint}%
+ \let\pointerangle\pgfmathresult%
+ \expandafter\pgf@process\expandafter{\pgf@lib@callout@relativepointer}%
+ \pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
+ \edef\pointerradius{\pgfmathresult pt}%
+ \pgfpointadd{\borderpoint}{\pgfqpointpolar{\pointerangle}{\pointerradius}}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ %
+ \addtosavedmacro\calloutpointer%
+ \pgf@lib@callouts@shortenpointer%
+ \pgf@lib@ellipsecallout@getpoints%
+ \addtosavedmacro\calloutpointeranchor%
+ \addtosavedmacro\beforecalloutangle%
+ \addtosavedmacro\aftercalloutangle%
+ \fi%
}%
\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{+.5ex}%
- }
+ }%
\savedanchor\basepoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y0pt\relax%
- }
+ }%
\anchor{center}{\centerpoint}%
\anchor{mid}{\midpoint}%
\anchor{mid east}{%
- \ellipsecalloutpoints%
- \pgfmathpointintersectionoflineandarc{\midpoint\advance\pgf@x\xradius}{\midpoint}%
- {\centerpoint}{270}{450}{\xradius and \yradius}%
+ \ellipsecalloutpoints%
+ \pgfmathpointintersectionoflineandarc{\midpoint\advance\pgf@x\xradius}{\midpoint}%
+ {\centerpoint}{270}{450}{\xradius and \yradius}%
}%
\anchor{mid west}{%
- \ellipsecalloutpoints%
- \pgfmathpointintersectionoflineandarc{\midpoint\advance\pgf@x-\xradius}{\midpoint}%
- {\centerpoint}{90}{270}{\xradius and \yradius}%
+ \ellipsecalloutpoints%
+ \pgfmathpointintersectionoflineandarc{\midpoint\advance\pgf@x-\xradius}{\midpoint}%
+ {\centerpoint}{90}{270}{\xradius and \yradius}%
}%
\anchor{base}{\basepoint}%
\anchor{base east}{%
- \ellipsecalloutpoints%
- \pgfmathpointintersectionoflineandarc{\basepoint\advance\pgf@x\xradius}{\basepoint}%
- {\centerpoint}{270}{450}{\xradius and \yradius}%
+ \ellipsecalloutpoints%
+ \pgfmathpointintersectionoflineandarc{\basepoint\advance\pgf@x\xradius}{\basepoint}%
+ {\centerpoint}{270}{450}{\xradius and \yradius}%
}%
\anchor{base west}{%
- \ellipsecalloutpoints%
- \pgfmathpointintersectionoflineandarc{\basepoint\advance\pgf@x-\xradius}{\basepoint}%
- {\centerpoint}{90}{270}{\xradius and \yradius}%
+ \ellipsecalloutpoints%
+ \pgfmathpointintersectionoflineandarc{\basepoint\advance\pgf@x-\xradius}{\basepoint}%
+ {\centerpoint}{90}{270}{\xradius and \yradius}%
}%
\anchor{north}{%
- \ellipsecalloutpoints%
- \centerpoint%
- \advance\pgf@y\yradius\relax%
- }
+ \ellipsecalloutpoints%
+ \centerpoint%
+ \advance\pgf@y\yradius\relax%
+ }%
\anchor{south}{%
- \ellipsecalloutpoints%
- \centerpoint%
- \advance\pgf@y-\yradius\relax%
- }
+ \ellipsecalloutpoints%
+ \centerpoint%
+ \advance\pgf@y-\yradius\relax%
+ }%
\anchor{east}{%
- \ellipsecalloutpoints%
- \centerpoint%
- \advance\pgf@x\xradius\relax%
- }
+ \ellipsecalloutpoints%
+ \centerpoint%
+ \advance\pgf@x\xradius\relax%
+ }%
\anchor{west}{%
- \ellipsecalloutpoints%
- \centerpoint%
- \advance\pgf@x-\xradius\relax%
- }
+ \ellipsecalloutpoints%
+ \centerpoint%
+ \advance\pgf@x-\xradius\relax%
+ }%
\anchor{north west}{%
- \ellipsecalloutpoints%
- \pgf@xa\xradius\relax%
- \pgf@ya\yradius\relax%
- \centerpoint%
- \advance\pgf@y0.7071067\pgf@ya%
- \advance\pgf@x-0.7071067\pgf@xa%
- }
+ \ellipsecalloutpoints%
+ \pgf@xa\xradius\relax%
+ \pgf@ya\yradius\relax%
+ \centerpoint%
+ \advance\pgf@y0.7071067\pgf@ya%
+ \advance\pgf@x-0.7071067\pgf@xa%
+ }%
\anchor{north east}{%
- \ellipsecalloutpoints%
- \pgf@xa\xradius\relax%
- \pgf@ya\yradius\relax%
- \centerpoint%
- \advance\pgf@y0.7071067\pgf@ya%
- \advance\pgf@x0.7071067\pgf@xa%
- }
+ \ellipsecalloutpoints%
+ \pgf@xa\xradius\relax%
+ \pgf@ya\yradius\relax%
+ \centerpoint%
+ \advance\pgf@y0.7071067\pgf@ya%
+ \advance\pgf@x0.7071067\pgf@xa%
+ }%
\anchor{south west}{%
- \ellipsecalloutpoints%
- \pgf@xa\xradius\relax%
- \pgf@ya\yradius\relax%
- \centerpoint%
- \advance\pgf@y-0.7071067\pgf@ya%
- \advance\pgf@x-0.7071067\pgf@xa%
- }
+ \ellipsecalloutpoints%
+ \pgf@xa\xradius\relax%
+ \pgf@ya\yradius\relax%
+ \centerpoint%
+ \advance\pgf@y-0.7071067\pgf@ya%
+ \advance\pgf@x-0.7071067\pgf@xa%
+ }%
\anchor{south east}{%
- \ellipsecalloutpoints%
- \pgf@xa\xradius\relax%
- \pgf@ya\yradius\relax%
- \centerpoint%
- \advance\pgf@y-0.7071067\pgf@ya%
- \advance\pgf@x0.7071067\pgf@xa%
- }
+ \ellipsecalloutpoints%
+ \pgf@xa\xradius\relax%
+ \pgf@ya\yradius\relax%
+ \centerpoint%
+ \advance\pgf@y-0.7071067\pgf@ya%
+ \advance\pgf@x0.7071067\pgf@xa%
+ }%
\anchor{pointer}{%
- \ellipsecalloutpoints%
- \calloutpointeranchor%
- }%
+ \ellipsecalloutpoints%
+ \calloutpointeranchor%
+ }%
\backgroundpath{%
- \ellipsecalloutpoints%
- \ifpgf@lib@callout@absolutepointer%
- \pgfextract@process\calloutpointer{%
- \pgfpointanchor{pgf@lib@callout@pointer}{center}%
- }%
- \pgf@lib@callouts@shortenpointer%
- \pgf@lib@ellipsecallout@getpoints%
- \calloutpointeranchor%
- \ifx\pgf@node@name\pgfutil@empty%
- \else%
- \edef\pgf@sh@@temp{\noexpand\expandafter\noexpand\pgfutil@g@addto@macro\noexpand\csname pgf@sh@np@\pgf@node@name\noexpand\endcsname}%
- \edef\pgf@sh@@@temp{%
- \noexpand\def\noexpand\calloutpointeranchor{%
- \noexpand\pgf@x\the\pgf@x%
- \noexpand\pgf@y\the\pgf@y%
- }%
- }%
- \expandafter\pgf@sh@@temp\expandafter{\pgf@sh@@@temp}
- \fi%
- \fi%
- \pgfpathmoveto{\calloutpointer}%
- \pgfpathlineto{\aftercalloutpointer}%
- \ifdim\aftercalloutangle pt<\beforecalloutangle pt\relax%
- \pgfpatharc{\aftercalloutangle}{\beforecalloutangle}{\xpathradius and \ypathradius}%
- \else%
- \pgfpatharc{\aftercalloutangle}{360}{\xpathradius and \ypathradius}%
- \pgfpatharc{0}{\beforecalloutangle}{\xpathradius and \ypathradius}%
- \fi%
- \pgfpathclose%
- }%
+ \ellipsecalloutpoints%
+ \ifpgf@lib@callout@absolutepointer%
+ \pgfextract@process\calloutpointer{%
+ \pgfpointanchor{pgf@lib@callout@pointer}{center}%
+ }%
+ \pgf@lib@callouts@shortenpointer%
+ \pgf@lib@ellipsecallout@getpoints%
+ \calloutpointeranchor%
+ \ifx\pgf@node@name\pgfutil@empty%
+ \else%
+ \edef\pgf@sh@@temp{\noexpand\expandafter\noexpand\pgfutil@g@addto@macro\noexpand\csname pgf@sh@np@\pgf@node@name\noexpand\endcsname}%
+ \edef\pgf@sh@@@temp{%
+ \noexpand\def\noexpand\calloutpointeranchor{%
+ \noexpand\pgf@x\the\pgf@x%
+ \noexpand\pgf@y\the\pgf@y%
+ }%
+ }%
+ \expandafter\pgf@sh@@temp\expandafter{\pgf@sh@@@temp}
+ \fi%
+ \fi%
+ \pgfpathmoveto{\calloutpointer}%
+ \pgfpathlineto{\aftercalloutpointer}%
+ \ifdim\aftercalloutangle pt<\beforecalloutangle pt\relax%
+ \pgfpatharc{\aftercalloutangle}{\beforecalloutangle}{\xpathradius and \ypathradius}%
+ \else%
+ \pgfpatharc{\aftercalloutangle}{360}{\xpathradius and \ypathradius}%
+ \pgfpatharc{0}{\beforecalloutangle}{\xpathradius and \ypathradius}%
+ \fi%
+ \pgfpathclose%
+ }%
\anchorborder{%
- \pgfextract@process\externalpoint{}%
- \ellipsecalloutpoints%
- \pgfpointadd{\pgfpointborderellipse{\externalpoint}{\pgfpoint{\xradius}{\yradius}}%
- }{\centerpoint}%
+ \pgfextract@process\externalpoint{}%
+ \ellipsecalloutpoints%
+ \pgfpointadd{\pgfpointborderellipse{\externalpoint}{\pgfpoint{\xradius}{\yradius}}%
+ }{\centerpoint}%
}%
-}
+}%
% Internal macro for calculating the points for the
% ellipse callout pointer.
@@ -289,334 +289,334 @@
% \ypathradius - the y radius of the ellipse.
%
\def\pgf@lib@ellipsecallout@getpoints{%
- \pgfextract@process\borderpoint{%
- \pgfpointborderellipse{%
- \centerpoint%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \calloutpointer%
- \advance\pgf@x-\pgf@xa%
- \advance\pgf@y-\pgf@ya%
- }{\pgfqpoint{\xpathradius}{\ypathradius}}%
- }%
- \pgfmathangleonellipse{\borderpoint}{\xpathradius and \ypathradius}%
- \pgfutil@tempdima\pointerarc pt\relax%
- \pgfutil@tempdimb\pgfmathresult pt\relax%
- \advance\pgfutil@tempdimb-.5\pgfutil@tempdima%
- \ifdim\pgfutil@tempdimb<0pt\relax%
- \advance\pgfutil@tempdimb360pt\relax%
- \fi%
- \edef\beforecalloutangle{\pgfmath@tonumber{\pgfutil@tempdimb}}%
- \advance\pgfutil@tempdimb\pgfutil@tempdima%
- \ifdim\pgfutil@tempdimb<360pt\relax%
- \else%
- \advance\pgfutil@tempdimb-360pt\relax%
- \fi%
- \edef\aftercalloutangle{\pgfmath@tonumber{\pgfutil@tempdimb}}%
- %
- \pgfextract@process\beforecalloutpointer{%
- \pgfpointadd{\centerpoint}{%
- \pgfpointpolar{\beforecalloutangle}{\xpathradius and \ypathradius}%
- }%
- }%
- \pgfextract@process\aftercalloutpointer{%
- \pgfpointadd{\centerpoint}{%
- \pgfpointpolar{\aftercalloutangle}{\xpathradius and \ypathradius}%
- }%
- }%
- %
- % Calculate the pointer anchor.
- %
- \pgf@lib@callouts@pointeranchor%
-}
+ \pgfextract@process\borderpoint{%
+ \pgfpointborderellipse{%
+ \centerpoint%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \calloutpointer%
+ \advance\pgf@x-\pgf@xa%
+ \advance\pgf@y-\pgf@ya%
+ }{\pgfqpoint{\xpathradius}{\ypathradius}}%
+ }%
+ \pgfmathangleonellipse{\borderpoint}{\xpathradius and \ypathradius}%
+ \pgfutil@tempdima\pointerarc pt\relax%
+ \pgfutil@tempdimb\pgfmathresult pt\relax%
+ \advance\pgfutil@tempdimb-.5\pgfutil@tempdima%
+ \ifdim\pgfutil@tempdimb<0pt\relax%
+ \advance\pgfutil@tempdimb360pt\relax%
+ \fi%
+ \edef\beforecalloutangle{\pgfmath@tonumber{\pgfutil@tempdimb}}%
+ \advance\pgfutil@tempdimb\pgfutil@tempdima%
+ \ifdim\pgfutil@tempdimb<360pt\relax%
+ \else%
+ \advance\pgfutil@tempdimb-360pt\relax%
+ \fi%
+ \edef\aftercalloutangle{\pgfmath@tonumber{\pgfutil@tempdimb}}%
+ %
+ \pgfextract@process\beforecalloutpointer{%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointpolar{\beforecalloutangle}{\xpathradius and \ypathradius}%
+ }%
+ }%
+ \pgfextract@process\aftercalloutpointer{%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointpolar{\aftercalloutangle}{\xpathradius and \ypathradius}%
+ }%
+ }%
+ %
+ % Calculate the pointer anchor.
+ %
+ \pgf@lib@callouts@pointeranchor%
+}%
-% If the callout pointer is very pointed and stroked, the anchor will be
+% If the callout pointer is very pointed and stroked, the anchor will be
% miles away from the end of the pointer which will (typically) be
-% bevelled.
+% bevelled.
% Using outer sep=0pt is one solution, however, another is provided
% using this special key:
%
% /pgf/callout pointer anchor aspect
-%
+%
% which takes a value from 0 (ignore any outer sep) to 1 (use
% the full outer sep).
-\pgfkeys{/pgf/callout pointer anchor aspect/.initial=1}
+\pgfkeys{/pgf/callout pointer anchor aspect/.initial=1}%
% Internal macro for calculating the anchor for the callout pointer.
%
% Requires the following to be set up (points are anti-clockwise)
%
-% \beforecalloutpointer - point on the border before the callout pointer
-% \calloutpointer
+% \beforecalloutpointer - point on the border before the callout pointer
+% \calloutpointer
% \aftercalloutpointer - point on the border after the callout pointer
% \outersep - the largest of the outer xsep or ysep.
%
\def\pgf@lib@callouts@pointeranchor{%
- \pgfutil@tempdimb\outersep\relax%
- %
- \pgfmathanglebetweenlines{\calloutpointer}{\aftercalloutpointer}{\calloutpointer}{\beforecalloutpointer}%
- \pgfmathdivide@{\pgfmathresult}{2}%
- \pgfutil@tempdima\pgfmathresult pt\relax%
- \pgfmathcosec@{\pgfmathresult}%
- \pgfutil@tempdimb\pgfmathresult\pgfutil@tempdimb%
- \pgfmathanglebetweenpoints{\calloutpointer}{\aftercalloutpointer}%
- \advance\pgfutil@tempdima\pgfmathresult pt\relax%
- \advance\pgfutil@tempdima180pt\relax%
- %
- \pgfextract@process\calloutpointeranchor{%
- \pgfpointadd{%
- \pgfmathparse{\pgfkeysvalueof{/pgf/callout pointer anchor aspect}}%
- \pgfutil@tempdimb\pgfmathresult\pgfutil@tempdimb%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- }{%
- \calloutpointer%
- }%
- }%
+ \pgfutil@tempdimb\outersep\relax%
+ %
+ \pgfmathanglebetweenlines{\calloutpointer}{\aftercalloutpointer}{\calloutpointer}{\beforecalloutpointer}%
+ \pgfmathdivide@{\pgfmathresult}{2}%
+ \pgfutil@tempdima\pgfmathresult pt\relax%
+ \pgfmathcosec@{\pgfmathresult}%
+ \pgfutil@tempdimb\pgfmathresult\pgfutil@tempdimb%
+ \pgfmathanglebetweenpoints{\calloutpointer}{\aftercalloutpointer}%
+ \advance\pgfutil@tempdima\pgfmathresult pt\relax%
+ \advance\pgfutil@tempdima180pt\relax%
+ %
+ \pgfextract@process\calloutpointeranchor{%
+ \pgfpointadd{%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/callout pointer anchor aspect}}%
+ \pgfutil@tempdimb\pgfmathresult\pgfutil@tempdimb%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ }{%
+ \calloutpointer%
+ }%
+ }%
}%
\def\pgf@lib@callouts@shortenpointer{%
- \pgfextract@process\calloutpointer{%
- \pgfmathanglebetweenpoints{\calloutpointer}{\centerpoint}%
- \let\angle\pgfmathresult%
- \pgfmathsin@{\angle}%
- \let\sinpointerangle\pgfmathresult%
- \pgfmathcos@{\angle}%
- \let\cospointerangle\pgfmathresult%
- \pgfpointadd{\calloutpointer}{%
- \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/callout pointer shorten}}%
- \pgf@x\cospointerangle\pgfutil@tempdima%
- \pgf@y\sinpointerangle\pgfutil@tempdima%
- }%
- }%
+ \pgfextract@process\calloutpointer{%
+ \pgfmathanglebetweenpoints{\calloutpointer}{\centerpoint}%
+ \let\angle\pgfmathresult%
+ \pgfmathsin@{\angle}%
+ \let\sinpointerangle\pgfmathresult%
+ \pgfmathcos@{\angle}%
+ \let\cospointerangle\pgfmathresult%
+ \pgfpointadd{\calloutpointer}{%
+ \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/callout pointer shorten}}%
+ \pgf@x\cospointerangle\pgfutil@tempdima%
+ \pgf@y\sinpointerangle\pgfutil@tempdima%
+ }%
+ }%
}%
-
+
\pgfdeclareshape{rectangle callout}{%
- \savedmacro\rectanglecalloutpoints{%
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
- \ifdim\pgf@x<.5\pgf@xa%
- \pgf@x.5\pgf@xa%
- \fi%
- \edef\xtemp{\the\pgf@x}%
- \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- %
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\dp\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@y<.5\pgf@ya%
- \pgf@y.5\pgf@ya%
- \fi%
- \edef\ytemp{\the\pgf@y}%
- \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- %
- \edef\xlength{\the\pgf@x}%
- \edef\ylength{\the\pgf@y}%
- \addtosavedmacro\xlength%
- \addtosavedmacro\ylength%
- %
- \pgfmathsetlengthmacro\pointerwidth{\pgfkeysvalueof{/pgf/callout pointer width}}%
- \addtosavedmacro\pointerwidth%
- %
- \pgfextract@process\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }%
- %
- % Process the relative callout pointer.
- %
- \ifpgf@lib@callout@absolutepointer%
- \else%
- \pgfextract@process\calloutpointer{%
- \pgfextract@process\borderpoint{%
- \expandafter\pgfpointborderrectangle\expandafter{\pgf@lib@callout@relativepointer}%
- {\pgfqpoint{\xtemp}{\ytemp}}%
- }%
- \pgfmathanglebetweenpoints{\pgfpointorigin}{\borderpoint}%
- \let\pointerangle\pgfmathresult%
- \expandafter\pgf@process\expandafter{\pgf@lib@callout@relativepointer}%
- \pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
- \edef\pointerradius{\pgfmathresult pt}%
- \pgfpointadd{\borderpoint}{\pgfqpointpolar{\pointerangle}{\pointerradius}}%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- \pgf@lib@callouts@shortenpointer%
- \addtosavedmacro\calloutpointer%
- \pgf@lib@rectanglecallout@pointer%
- \addtosavedmacro\calloutpointeranchor%
- \addtosavedmacro\beforecalloutpointer%
- \addtosavedmacro\aftercalloutpointer%
- \addtosavedmacro\firstpoint%
- \addtosavedmacro\secondpoint%
- \addtosavedmacro\thirdpoint%
- \addtosavedmacro\fourthpoint%
- \fi%
- }
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
- \savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt\relax%
- }
- \savedanchor\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+.5em}%
- }
- \anchor{center}{\centerpoint}
- \anchor{mid}{\midpoint}
- \anchor{mid east}{%
- \rectanglecalloutpoints%
- \midpoint%
- \advance\pgf@x\xlength\relax%
- }
- \anchor{mid west}{%
- \rectanglecalloutpoints%
- \midpoint%
- \advance\pgf@x-\xlength\relax%
- }
- \anchor{base}{\basepoint}
- \anchor{base east}{%
- \rectanglecalloutpoints%
- \basepoint%
- \advance\pgf@x\xlength\relax%
- }
- \anchor{base west}{%
- \rectanglecalloutpoints%
- \basepoint%
- \advance\pgf@x-\xlength\relax%
- }
- \anchor{north}{%
- \rectanglecalloutpoints%
- \centerpoint%
- \advance\pgf@y\ylength\relax%
- }%
- \anchor{south}{%
- \rectanglecalloutpoints%
- \centerpoint%
- \advance\pgf@y-\ylength\relax%
- }%
- \anchor{east}{%
- \rectanglecalloutpoints%
- \centerpoint%
- \advance\pgf@x\xlength\relax%
- }%
- \anchor{west}{%
- \rectanglecalloutpoints%
- \centerpoint%
- \advance\pgf@x-\xlength\relax%
- }%
- \anchor{north east}{%
- \rectanglecalloutpoints%
- \centerpoint%
- \advance\pgf@x\xlength\relax%
- \advance\pgf@y\ylength\relax%
- }%
- \anchor{south west}{%
- \rectanglecalloutpoints%
- \centerpoint%
- \advance\pgf@x-\xlength\relax%
- \advance\pgf@y-\ylength\relax%
- }%
- \anchor{south east}{%
- \rectanglecalloutpoints%
- \centerpoint%
- \advance\pgf@x\xlength\relax%
- \advance\pgf@y-\ylength\relax%
- }%
- \anchor{north west}{%
- \rectanglecalloutpoints%
- \centerpoint%
- \advance\pgf@x-\xlength\relax%
- \advance\pgf@y\ylength\relax%
- }%
- \anchor{pointer}{%
- \rectanglecalloutpoints%
- \calloutpointeranchor%
- }%
- \backgroundpath{%
- \rectanglecalloutpoints%
- \pgf@x\xlength\relax%
- \pgf@y\ylength\relax%
- \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathaddtolength\pgf@y{-\pgfkeysvalueof{/pgf/outer ysep}}%
- \edef\xtemp{\the\pgf@x}%
- \edef\ytemp{\the\pgf@y}%
- %
- % The absolute pointer must be calculated here because the
- % anchor of the shape (which is calculated after the saved
- % macros and points) affects how the pointer joins the
- % main rectangle.
- %
- \ifpgf@lib@callout@absolutepointer%
- \pgfextract@process\calloutpointer{%
- \pgfpointanchor{pgf@lib@callout@pointer}{center}%
- }%
- \pgf@lib@callouts@shortenpointer%
- \pgfmathsetlengthmacro\pointerwidth{\pgfkeysvalueof{/pgf/callout pointer width}}%
- \pgf@lib@rectanglecallout@pointer%
- %
- % \pgf@node@name = the shape name (from \pgfmultipartnode)
- %
- \ifx\pgf@node@name\pgfutil@empty%
- \else%
- %
- % Now hack an extra saved anchor \calloutpointeranchor,
- % with the new anchor for the callout pointer.
- %
- \edef\pgf@sh@@temp{\noexpand\expandafter\noexpand\pgfutil@g@addto@macro\noexpand\csname pgf@sh@np@\pgf@node@name\noexpand\endcsname}%
- \edef\pgf@sh@@@temp{%
- \noexpand\def\noexpand\calloutpointeranchor{%
- \noexpand\pgf@x\the\pgf@x%
- \noexpand\pgf@y\the\pgf@y%
- }%
- }%
- \expandafter\pgf@sh@@temp\expandafter{\pgf@sh@@@temp}%
- \fi%
- \fi%
- {%
- \pgfsetcornersarced{\pgfqpoint{0pt}{0pt}}%
- \pgfpathmoveto{\beforecalloutpointer}%
- }%
- \pgfpathlineto{\calloutpointer}%
- {%
- \pgfsetcornersarced{\pgfqpoint{0pt}{0pt}}%
- \pgfpathlineto{\aftercalloutpointer}%
- }%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathlineto{\firstpoint}%
- \pgfpathlineto{\secondpoint}%
- \pgfpathlineto{\thirdpoint}%
- \pgfpathlineto{\fourthpoint}%
- {%
- \pgfsetcornersarced{\pgfqpoint{0pt}{0pt}}%
- \pgfpathclose%
- }%
- }
- }
- \anchorborder{%
- \pgfextract@process\externalpoint{}%
- \rectanglecalloutpoints%
- \pgfpointadd{\centerpoint}%
- {%
- \pgfpointborderrectangle{\pgfpointadd{\centerpoint}{\externalpoint}}%
- {\pgfqpoint{\xlength}{\ylength}}%
- }%
- }%
-}
+ \savedmacro\rectanglecalloutpoints{%
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
+ \ifdim\pgf@x<.5\pgf@xa%
+ \pgf@x.5\pgf@xa%
+ \fi%
+ \edef\xtemp{\the\pgf@x}%
+ \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ %
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y.5\dp\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@y<.5\pgf@ya%
+ \pgf@y.5\pgf@ya%
+ \fi%
+ \edef\ytemp{\the\pgf@y}%
+ \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
+ %
+ \edef\xlength{\the\pgf@x}%
+ \edef\ylength{\the\pgf@y}%
+ \addtosavedmacro\xlength%
+ \addtosavedmacro\ylength%
+ %
+ \pgfmathsetlengthmacro\pointerwidth{\pgfkeysvalueof{/pgf/callout pointer width}}%
+ \addtosavedmacro\pointerwidth%
+ %
+ \pgfextract@process\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ %
+ % Process the relative callout pointer.
+ %
+ \ifpgf@lib@callout@absolutepointer%
+ \else%
+ \pgfextract@process\calloutpointer{%
+ \pgfextract@process\borderpoint{%
+ \expandafter\pgfpointborderrectangle\expandafter{\pgf@lib@callout@relativepointer}%
+ {\pgfqpoint{\xtemp}{\ytemp}}%
+ }%
+ \pgfmathanglebetweenpoints{\pgfpointorigin}{\borderpoint}%
+ \let\pointerangle\pgfmathresult%
+ \expandafter\pgf@process\expandafter{\pgf@lib@callout@relativepointer}%
+ \pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
+ \edef\pointerradius{\pgfmathresult pt}%
+ \pgfpointadd{\borderpoint}{\pgfqpointpolar{\pointerangle}{\pointerradius}}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ \pgf@lib@callouts@shortenpointer%
+ \addtosavedmacro\calloutpointer%
+ \pgf@lib@rectanglecallout@pointer%
+ \addtosavedmacro\calloutpointeranchor%
+ \addtosavedmacro\beforecalloutpointer%
+ \addtosavedmacro\aftercalloutpointer%
+ \addtosavedmacro\firstpoint%
+ \addtosavedmacro\secondpoint%
+ \addtosavedmacro\thirdpoint%
+ \addtosavedmacro\fourthpoint%
+ \fi%
+ }%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt\relax%
+ }%
+ \savedanchor\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+.5em}%
+ }%
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\midpoint}%
+ \anchor{mid east}{%
+ \rectanglecalloutpoints%
+ \midpoint%
+ \advance\pgf@x\xlength\relax%
+ }%
+ \anchor{mid west}{%
+ \rectanglecalloutpoints%
+ \midpoint%
+ \advance\pgf@x-\xlength\relax%
+ }%
+ \anchor{base}{\basepoint}%
+ \anchor{base east}{%
+ \rectanglecalloutpoints%
+ \basepoint%
+ \advance\pgf@x\xlength\relax%
+ }%
+ \anchor{base west}{%
+ \rectanglecalloutpoints%
+ \basepoint%
+ \advance\pgf@x-\xlength\relax%
+ }%
+ \anchor{north}{%
+ \rectanglecalloutpoints%
+ \centerpoint%
+ \advance\pgf@y\ylength\relax%
+ }%
+ \anchor{south}{%
+ \rectanglecalloutpoints%
+ \centerpoint%
+ \advance\pgf@y-\ylength\relax%
+ }%
+ \anchor{east}{%
+ \rectanglecalloutpoints%
+ \centerpoint%
+ \advance\pgf@x\xlength\relax%
+ }%
+ \anchor{west}{%
+ \rectanglecalloutpoints%
+ \centerpoint%
+ \advance\pgf@x-\xlength\relax%
+ }%
+ \anchor{north east}{%
+ \rectanglecalloutpoints%
+ \centerpoint%
+ \advance\pgf@x\xlength\relax%
+ \advance\pgf@y\ylength\relax%
+ }%
+ \anchor{south west}{%
+ \rectanglecalloutpoints%
+ \centerpoint%
+ \advance\pgf@x-\xlength\relax%
+ \advance\pgf@y-\ylength\relax%
+ }%
+ \anchor{south east}{%
+ \rectanglecalloutpoints%
+ \centerpoint%
+ \advance\pgf@x\xlength\relax%
+ \advance\pgf@y-\ylength\relax%
+ }%
+ \anchor{north west}{%
+ \rectanglecalloutpoints%
+ \centerpoint%
+ \advance\pgf@x-\xlength\relax%
+ \advance\pgf@y\ylength\relax%
+ }%
+ \anchor{pointer}{%
+ \rectanglecalloutpoints%
+ \calloutpointeranchor%
+ }%
+ \backgroundpath{%
+ \rectanglecalloutpoints%
+ \pgf@x\xlength\relax%
+ \pgf@y\ylength\relax%
+ \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathaddtolength\pgf@y{-\pgfkeysvalueof{/pgf/outer ysep}}%
+ \edef\xtemp{\the\pgf@x}%
+ \edef\ytemp{\the\pgf@y}%
+ %
+ % The absolute pointer must be calculated here because the
+ % anchor of the shape (which is calculated after the saved
+ % macros and points) affects how the pointer joins the
+ % main rectangle.
+ %
+ \ifpgf@lib@callout@absolutepointer%
+ \pgfextract@process\calloutpointer{%
+ \pgfpointanchor{pgf@lib@callout@pointer}{center}%
+ }%
+ \pgf@lib@callouts@shortenpointer%
+ \pgfmathsetlengthmacro\pointerwidth{\pgfkeysvalueof{/pgf/callout pointer width}}%
+ \pgf@lib@rectanglecallout@pointer%
+ %
+ % \pgf@node@name = the shape name (from \pgfmultipartnode)
+ %
+ \ifx\pgf@node@name\pgfutil@empty%
+ \else%
+ %
+ % Now hack an extra saved anchor \calloutpointeranchor,
+ % with the new anchor for the callout pointer.
+ %
+ \edef\pgf@sh@@temp{\noexpand\expandafter\noexpand\pgfutil@g@addto@macro\noexpand\csname pgf@sh@np@\pgf@node@name\noexpand\endcsname}%
+ \edef\pgf@sh@@@temp{%
+ \noexpand\def\noexpand\calloutpointeranchor{%
+ \noexpand\pgf@x\the\pgf@x%
+ \noexpand\pgf@y\the\pgf@y%
+ }%
+ }%
+ \expandafter\pgf@sh@@temp\expandafter{\pgf@sh@@@temp}%
+ \fi%
+ \fi%
+ {%
+ \pgfsetcornersarced{\pgfqpoint{0pt}{0pt}}%
+ \pgfpathmoveto{\beforecalloutpointer}%
+ }%
+ \pgfpathlineto{\calloutpointer}%
+ {%
+ \pgfsetcornersarced{\pgfqpoint{0pt}{0pt}}%
+ \pgfpathlineto{\aftercalloutpointer}%
+ }%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathlineto{\firstpoint}%
+ \pgfpathlineto{\secondpoint}%
+ \pgfpathlineto{\thirdpoint}%
+ \pgfpathlineto{\fourthpoint}%
+ {%
+ \pgfsetcornersarced{\pgfqpoint{0pt}{0pt}}%
+ \pgfpathclose%
+ }%
+ }
+ }%
+ \anchorborder{%
+ \pgfextract@process\externalpoint{}%
+ \rectanglecalloutpoints%
+ \pgfpointadd{\centerpoint}%
+ {%
+ \pgfpointborderrectangle{\pgfpointadd{\centerpoint}{\externalpoint}}%
+ {\pgfqpoint{\xlength}{\ylength}}%
+ }%
+ }%
+}%
@@ -632,145 +632,145 @@
% \pointerwidth - the width of the pointer.
%
\def\pgf@lib@rectanglecallout@pointer{%
- %
- % Ensure that the pointer never connects to the main shape
- % too near to a corner. This is done for two reasons:
- % 1. It can look ugly.
- % 2. If the corners are rounded, a mess can result.
- %
- \pgfextract@process\borderpoint{%
- \pgfpointborderrectangle{%
- \centerpoint%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \calloutpointer%
- \advance\pgf@x-\pgf@xa%
- \advance\pgf@y-\pgf@ya%
- }{\pgfqpoint{\xtemp}{\ytemp}}%
- }%
- \pgfmathanglebetweenpoints{\pgfpointorigin}{\borderpoint}%
- \let\borderangle\pgfmathresult%
- %
- \pgfutil@tempdima\pointerwidth\relax%
- \pgf@xa\xtemp\relax%
- \advance\pgf@xa-\pgfutil@tempdima%
- \pgf@ya\ytemp\relax%
- \advance\pgf@ya-\pgfutil@tempdima%
- %
- \pgf@process{%
- \pgfutil@ifundefined{pgf@corner@arc}{\pgfpointorigin}{%
- \expandafter\pgfqpoint\pgf@corner@arc}%
- }%
- \advance\pgf@xa-\pgf@x%
- \advance\pgf@ya-\pgf@y%
- %
- \borderpoint%
- \pgf@xb\pgf@x%
- \pgf@yb\pgf@y%
- %
- \pgf@xc0pt\relax%
- \pgf@yc0pt\relax%
- %
- \pgfmathanglebetweenpoints{\pgfpointorigin}{\pgfqpoint{\xtemp}{\ytemp}}%
- \ifdim\borderangle pt<\pgfmathresult pt\relax%
- \pgf@yc.5\pgfutil@tempdima%
- \ifdim\pgf@yb>\pgf@ya%
- \pgf@yb\pgf@ya%
- \fi%
- %
- % Establish the order for drawing the rectangle corners.
- %
- \edef\firstpoint{\noexpand\pgfqpoint{\xtemp}{\ytemp}}%
- \edef\secondpoint{\noexpand\pgfqpoint{-\xtemp}{\ytemp}}%
- \edef\thirdpoint{\noexpand\pgfqpoint{-\xtemp}{-\ytemp}}%
- \edef\fourthpoint{\noexpand\pgfqpoint{\xtemp}{-\ytemp}}%
- \else%
- \pgfmathanglebetweenpoints{\pgfpointorigin}{\pgfqpoint{-\xtemp}{\ytemp}}%
- \ifdim\borderangle pt<\pgfmathresult pt\relax%
- \pgf@xc-.5\pgfutil@tempdima%
- \ifdim\pgf@xb>\pgf@xa%
- \pgf@xb\pgf@xa%
- \else%
- \ifdim\pgf@xb<-\pgf@xa%
- \pgf@xb-\pgf@xa%
- \fi%
- \fi%
- \edef\firstpoint{\noexpand\pgfqpoint{-\xtemp}{\ytemp}}%
- \edef\secondpoint{\noexpand\pgfqpoint{-\xtemp}{-\ytemp}}%
- \edef\thirdpoint{\noexpand\pgfqpoint{\xtemp}{-\ytemp}}%
- \edef\fourthpoint{\noexpand\pgfqpoint{\xtemp}{\ytemp}}%
- \else%
- \pgfmathanglebetweenpoints{\pgfpointorigin}{\pgfqpoint{-\xtemp}{-\ytemp}}%
- \ifdim\borderangle pt<\pgfmathresult pt\relax%
- \pgf@yc-.5\pgfutil@tempdima%
- \ifdim\pgf@yb>\pgf@ya%
- \pgf@yb\pgf@ya%
- \else%
- \ifdim\pgf@yb<-\pgf@ya%
- \pgf@yb-\pgf@ya%
- \fi%
- \fi%
- \edef\firstpoint{\noexpand\pgfqpoint{-\xtemp}{-\ytemp}}%
- \edef\secondpoint{\noexpand\pgfqpoint{\xtemp}{-\ytemp}}%
- \edef\thirdpoint{\noexpand\pgfqpoint{\xtemp}{\ytemp}}%
- \edef\fourthpoint{\noexpand\pgfqpoint{-\xtemp}{\ytemp}}%
- \else%
- \pgfmathanglebetweenpoints{\pgfpointorigin}{\pgfqpoint{\xtemp}{-\ytemp}}%
- \ifdim\borderangle pt<\pgfmathresult pt\relax%
- \pgf@xc.5\pgfutil@tempdima%
- \ifdim\pgf@xb>\pgf@xa%
- \pgf@xb\pgf@xa%
- \else%
- \ifdim\pgf@xb<-\pgf@xa%
- \pgf@xb-\pgf@xa%
- \fi%
- \fi%
- \edef\firstpoint{\noexpand\pgfqpoint{\xtemp}{-\ytemp}}%
- \edef\secondpoint{\noexpand\pgfqpoint{\xtemp}{\ytemp}}%
- \edef\thirdpoint{\noexpand\pgfqpoint{-\xtemp}{\ytemp}}%
- \edef\fourthpoint{\noexpand\pgfqpoint{-\xtemp}{-\ytemp}}%
- \else%
- \pgf@yc.5\pgfutil@tempdima%
- \ifdim\pgf@yb<-\pgf@ya%
- \pgf@yb-\pgf@ya%
- \fi%
- \edef\firstpoint{\noexpand\pgfqpoint{\xtemp}{\ytemp}}%
- \edef\secondpoint{\noexpand\pgfqpoint{-\xtemp}{\ytemp}}%
- \edef\thirdpoint{\noexpand\pgfqpoint{-\xtemp}{-\ytemp}}%
- \edef\fourthpoint{\noexpand\pgfqpoint{\xtemp}{-\ytemp}}%
- \fi%
- \fi%
- \fi%
- \fi%
- \pgfextract@process\beforecalloutpointer{%
- \centerpoint%
- \advance\pgf@x\pgf@xb%
- \advance\pgf@y\pgf@yb%
- \advance\pgf@x-\pgf@xc%
- \advance\pgf@y-\pgf@yc%
- }%
- \pgfextract@process\aftercalloutpointer{%
- \centerpoint%
- \advance\pgf@x\pgf@xb%
- \advance\pgf@y\pgf@yb%
- \advance\pgf@x\pgf@xc%
- \advance\pgf@y\pgf@yc%
- }%
- %
- % Now calculate the pointer anchor.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- \ifdim\pgf@x>\pgf@y%
- \edef\outersep{\the\pgf@x}%
- \else%
- \edef\outersep{\the\pgf@y}%
- \fi%
- \pgf@lib@callouts@pointeranchor%
-}
+ %
+ % Ensure that the pointer never connects to the main shape
+ % too near to a corner. This is done for two reasons:
+ % 1. It can look ugly.
+ % 2. If the corners are rounded, a mess can result.
+ %
+ \pgfextract@process\borderpoint{%
+ \pgfpointborderrectangle{%
+ \centerpoint%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \calloutpointer%
+ \advance\pgf@x-\pgf@xa%
+ \advance\pgf@y-\pgf@ya%
+ }{\pgfqpoint{\xtemp}{\ytemp}}%
+ }%
+ \pgfmathanglebetweenpoints{\pgfpointorigin}{\borderpoint}%
+ \let\borderangle\pgfmathresult%
+ %
+ \pgfutil@tempdima\pointerwidth\relax%
+ \pgf@xa\xtemp\relax%
+ \advance\pgf@xa-\pgfutil@tempdima%
+ \pgf@ya\ytemp\relax%
+ \advance\pgf@ya-\pgfutil@tempdima%
+ %
+ \pgf@process{%
+ \pgfutil@ifundefined{pgf@corner@arc}{\pgfpointorigin}{%
+ \expandafter\pgfqpoint\pgf@corner@arc}%
+ }%
+ \advance\pgf@xa-\pgf@x%
+ \advance\pgf@ya-\pgf@y%
+ %
+ \borderpoint%
+ \pgf@xb\pgf@x%
+ \pgf@yb\pgf@y%
+ %
+ \pgf@xc0pt\relax%
+ \pgf@yc0pt\relax%
+ %
+ \pgfmathanglebetweenpoints{\pgfpointorigin}{\pgfqpoint{\xtemp}{\ytemp}}%
+ \ifdim\borderangle pt<\pgfmathresult pt\relax%
+ \pgf@yc.5\pgfutil@tempdima%
+ \ifdim\pgf@yb>\pgf@ya%
+ \pgf@yb\pgf@ya%
+ \fi%
+ %
+ % Establish the order for drawing the rectangle corners.
+ %
+ \edef\firstpoint{\noexpand\pgfqpoint{\xtemp}{\ytemp}}%
+ \edef\secondpoint{\noexpand\pgfqpoint{-\xtemp}{\ytemp}}%
+ \edef\thirdpoint{\noexpand\pgfqpoint{-\xtemp}{-\ytemp}}%
+ \edef\fourthpoint{\noexpand\pgfqpoint{\xtemp}{-\ytemp}}%
+ \else%
+ \pgfmathanglebetweenpoints{\pgfpointorigin}{\pgfqpoint{-\xtemp}{\ytemp}}%
+ \ifdim\borderangle pt<\pgfmathresult pt\relax%
+ \pgf@xc-.5\pgfutil@tempdima%
+ \ifdim\pgf@xb>\pgf@xa%
+ \pgf@xb\pgf@xa%
+ \else%
+ \ifdim\pgf@xb<-\pgf@xa%
+ \pgf@xb-\pgf@xa%
+ \fi%
+ \fi%
+ \edef\firstpoint{\noexpand\pgfqpoint{-\xtemp}{\ytemp}}%
+ \edef\secondpoint{\noexpand\pgfqpoint{-\xtemp}{-\ytemp}}%
+ \edef\thirdpoint{\noexpand\pgfqpoint{\xtemp}{-\ytemp}}%
+ \edef\fourthpoint{\noexpand\pgfqpoint{\xtemp}{\ytemp}}%
+ \else%
+ \pgfmathanglebetweenpoints{\pgfpointorigin}{\pgfqpoint{-\xtemp}{-\ytemp}}%
+ \ifdim\borderangle pt<\pgfmathresult pt\relax%
+ \pgf@yc-.5\pgfutil@tempdima%
+ \ifdim\pgf@yb>\pgf@ya%
+ \pgf@yb\pgf@ya%
+ \else%
+ \ifdim\pgf@yb<-\pgf@ya%
+ \pgf@yb-\pgf@ya%
+ \fi%
+ \fi%
+ \edef\firstpoint{\noexpand\pgfqpoint{-\xtemp}{-\ytemp}}%
+ \edef\secondpoint{\noexpand\pgfqpoint{\xtemp}{-\ytemp}}%
+ \edef\thirdpoint{\noexpand\pgfqpoint{\xtemp}{\ytemp}}%
+ \edef\fourthpoint{\noexpand\pgfqpoint{-\xtemp}{\ytemp}}%
+ \else%
+ \pgfmathanglebetweenpoints{\pgfpointorigin}{\pgfqpoint{\xtemp}{-\ytemp}}%
+ \ifdim\borderangle pt<\pgfmathresult pt\relax%
+ \pgf@xc.5\pgfutil@tempdima%
+ \ifdim\pgf@xb>\pgf@xa%
+ \pgf@xb\pgf@xa%
+ \else%
+ \ifdim\pgf@xb<-\pgf@xa%
+ \pgf@xb-\pgf@xa%
+ \fi%
+ \fi%
+ \edef\firstpoint{\noexpand\pgfqpoint{\xtemp}{-\ytemp}}%
+ \edef\secondpoint{\noexpand\pgfqpoint{\xtemp}{\ytemp}}%
+ \edef\thirdpoint{\noexpand\pgfqpoint{-\xtemp}{\ytemp}}%
+ \edef\fourthpoint{\noexpand\pgfqpoint{-\xtemp}{-\ytemp}}%
+ \else%
+ \pgf@yc.5\pgfutil@tempdima%
+ \ifdim\pgf@yb<-\pgf@ya%
+ \pgf@yb-\pgf@ya%
+ \fi%
+ \edef\firstpoint{\noexpand\pgfqpoint{\xtemp}{\ytemp}}%
+ \edef\secondpoint{\noexpand\pgfqpoint{-\xtemp}{\ytemp}}%
+ \edef\thirdpoint{\noexpand\pgfqpoint{-\xtemp}{-\ytemp}}%
+ \edef\fourthpoint{\noexpand\pgfqpoint{\xtemp}{-\ytemp}}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \pgfextract@process\beforecalloutpointer{%
+ \centerpoint%
+ \advance\pgf@x\pgf@xb%
+ \advance\pgf@y\pgf@yb%
+ \advance\pgf@x-\pgf@xc%
+ \advance\pgf@y-\pgf@yc%
+ }%
+ \pgfextract@process\aftercalloutpointer{%
+ \centerpoint%
+ \advance\pgf@x\pgf@xb%
+ \advance\pgf@y\pgf@yb%
+ \advance\pgf@x\pgf@xc%
+ \advance\pgf@y\pgf@yc%
+ }%
+ %
+ % Now calculate the pointer anchor.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@x>\pgf@y%
+ \edef\outersep{\the\pgf@x}%
+ \else%
+ \edef\outersep{\the\pgf@y}%
+ \fi%
+ \pgf@lib@callouts@pointeranchor%
+}%
-% Internal macro for parsing the size of
+% Internal macro for parsing the size of
% the cloud callout pointer.
%
% \pgf@x and \pgf@y should be set up as the
@@ -779,173 +779,173 @@
% \pgf@xa and \pgf@ya are returned appropriately.
%
\def\pgf@lib@callout@setpointersize#1{%
- \edef\pgf@lib@callout@temp{#1}%
- \edef\pgf@marshall{\noexpand\pgfutil@in@{of callout}{\pgf@lib@callout@temp}}%
- \pgf@marshall%
- \ifpgfutil@in@%
- \expandafter\pgf@xa\expandafter\pgf@lib@callout@setpointerrelativesize%
- \pgf@lib@callout@temp\pgf@lib@stop\pgf@x%
- \expandafter\pgf@ya\expandafter\pgf@lib@callout@setpointerrelativesize%
- \pgf@lib@callout@temp\pgf@lib@stop\pgf@y%
- \else%
- \edef\pgf@marshall{\noexpand\pgfutil@in@{and}{\pgf@lib@callout@temp}}%
- \pgf@marshall%
- \ifpgfutil@in@%
- \expandafter\pgf@lib@callout@setpointerbothsizes\pgf@lib@callout@temp\pgf@lib@stop%
- \else%
- \pgfmathsetlength\pgf@xa{#1}%
- \pgfmathsetlength\pgf@ya{#1}%
- \fi%
- \fi%
-}
+ \edef\pgf@lib@callout@temp{#1}%
+ \edef\pgf@marshall{\noexpand\pgfutil@in@{of callout}{\pgf@lib@callout@temp}}%
+ \pgf@marshall%
+ \ifpgfutil@in@%
+ \expandafter\pgf@xa\expandafter\pgf@lib@callout@setpointerrelativesize%
+ \pgf@lib@callout@temp\pgf@lib@stop\pgf@x%
+ \expandafter\pgf@ya\expandafter\pgf@lib@callout@setpointerrelativesize%
+ \pgf@lib@callout@temp\pgf@lib@stop\pgf@y%
+ \else%
+ \edef\pgf@marshall{\noexpand\pgfutil@in@{and}{\pgf@lib@callout@temp}}%
+ \pgf@marshall%
+ \ifpgfutil@in@%
+ \expandafter\pgf@lib@callout@setpointerbothsizes\pgf@lib@callout@temp\pgf@lib@stop%
+ \else%
+ \pgfmathsetlength\pgf@xa{#1}%
+ \pgfmathsetlength\pgf@ya{#1}%
+ \fi%
+ \fi%
+}%
\def\pgf@lib@callout@setpointerrelativesize#1of callout#2\pgf@lib@stop{#1}%
\def\pgf@lib@callout@setpointerbothsizes#1and#2\pgf@lib@stop{%
- \pgfmathsetlength\pgf@xa{#2}%
- \pgfmathsetlength\pgf@ya{#2}%
-}
+ \pgfmathsetlength\pgf@xa{#2}%
+ \pgfmathsetlength\pgf@ya{#2}%
+}%
% Shape: cloud callout.
%
\pgfdeclareshape{cloud callout}{%
- \savedanchor\calloutpointer{%
- \pgfutil@ifundefined{pgf@sh@s@cloud}{%
- \pgferror{I cannot find the cloud shape. Please load the `symbol shapes' library}}{}%
- \pgf@sh@s@cloud%
- \pgf@sh@savedmacros%
- %
- \pgfextract@process\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }%
- \ifpgf@lib@callout@absolutepointer%
- \else%
- \pgfextract@process\calloutpointer{%
- \pgfextract@process\borderpoint{%
- \expandafter\pgfpointborderellipse\expandafter{\pgf@lib@callout@relativepointer}%
- {\pgfqpoint{\xouterradius}{\youterradius}}%
- }%
- \pgfmathanglebetweenpoints{\pgfpointorigin}{\borderpoint}%
- \let\pointerangle\pgfmathresult%
- \expandafter\pgf@process\expandafter{\pgf@lib@callout@relativepointer}%
- \pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
- \edef\pointerradius{\pgfmathresult pt}%
- \pgfpointadd{\borderpoint}{\pgfqpointpolar{\pointerangle}{\pointerradius}}%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- \pgf@lib@callouts@shortenpointer%
- \fi%
- }
- \anchor{pointer}{%
- \calloutpointer%
- }%
- \inheritsavedanchors[from=cloud]
- \inheritanchor[from=cloud]{center}
- \inheritanchor[from=cloud]{base}
- \inheritanchor[from=cloud]{mid}
- \inheritanchor[from=cloud]{north}
- \inheritanchor[from=cloud]{south}
- \inheritanchor[from=cloud]{east}
- \inheritanchor[from=cloud]{west}
- \inheritanchor[from=cloud]{north east}
- \inheritanchor[from=cloud]{south west}
- \inheritanchor[from=cloud]{south east}
- \inheritanchor[from=cloud]{north west}
- \inheritanchorborder[from=cloud]
- \backgroundpath{%
- \pgf@sh@bg@cloud%
- \ifpgf@lib@callout@absolutepointer%
- \pgfextract@process\calloutpointer{%
- \pgfpointanchor{pgf@lib@callout@pointer}{center}%
- }%
- \ifx\pgf@node@name\pgfutil@empty%
- \else%
- \edef\pgf@sh@@temp{\noexpand\expandafter\noexpand\pgfutil@g@addto@macro\noexpand\csname pgf@sh@np@\pgf@node@name\noexpand\endcsname}%
- \edef\pgf@sh@@@temp{%
- \noexpand\def\noexpand\calloutpointeranchor{%
- \noexpand\pgf@x\the\pgf@x%
- \noexpand\pgf@y\the\pgf@y%
- }%
- }%
- \expandafter\pgf@sh@@temp\expandafter{\pgf@sh@@@temp}
- \fi%
- \fi%
- %
- \pgfextract@process\borderpoint{%
- \pgfpointadd{%
- \pgfpointborderellipse{\pgfpointdiff{\centerpoint}{\calloutpointer}}%
- {\pgfqpoint{\xouterradius}{\youterradius}}%
- }{\centerpoint}%
- }%
- \pgf@lib@callouts@shortenpointer%
- \pgfmathanglebetweenpoints{\calloutpointer}{\centerpoint}%
- \let\angle\pgfmathresult%
- \pgfmathsin@{\angle}%
- \let\sinpointerangle\pgfmathresult%
- \pgfmathcos@{\angle}%
- \let\cospointerangle\pgfmathresult%
- %
- \pgf@x\xouterradius\relax%
- \pgf@x2.0\pgf@x%
- \pgf@y\yinnerradius\relax%
- \pgf@y2.0\pgf@y%
- \pgf@lib@callout@setpointersize{\pgfkeysvalueof{/pgf/callout pointer start size}}%
- \pgf@xb\pgf@xa%
- \pgf@yb\pgf@ya%
- \pgf@lib@callout@setpointersize{\pgfkeysvalueof{/pgf/callout pointer end size}}%
- \advance\pgf@xb-\pgf@xa%
- \advance\pgf@yb-\pgf@ya%
- %
- \pgfmathsetcount\c@pgf@counta{\pgfkeysvalueof{/pgf/callout pointer segments}}%
- \divide\pgf@xb\c@pgf@counta%
- \divide\pgf@yb\c@pgf@counta%
- %
- \pgf@process{\pgfpointdiff{\borderpoint}{\calloutpointer}}%
- \pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
- \pgfutil@tempdima\pgfmathresult pt\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- %
- \pgfutil@tempdimb0pt\relax%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\c@pgf@counta%
- \else%
- {%
- \pgf@xa.5\pgf@xa%
- \pgf@ya.5\pgf@ya%
- \edef\tempxradius{\the\pgf@xa}%
- \edef\tempyradius{\the\pgf@ya}%
- \pgfpathellipse%
- {%
- \calloutpointer%
- \advance\pgf@x\cospointerangle\pgfutil@tempdimb%
- \advance\pgf@y\sinpointerangle\pgfutil@tempdimb%
- }%
- {\pgfqpoint{\tempxradius}{0pt}}{\pgfqpoint{0pt}{\tempyradius}}%
- }%
- \advance\pgf@xa\pgf@xb%
- \advance\pgf@ya\pgf@yb%
- \advance\pgfutil@tempdimb\pgfutil@tempdima%
- \repeatpgfmathloop%
- }%
- %
- % Hack the puff anchors for the callout.
- %
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@cloud callout\endcsname{%
- \c@pgf@counta\puffs\relax%
- \pgfmathloop%
- \ifnum\c@pgf@counta>0\relax%
- \pgfutil@ifundefined{pgf@anchor@cloud callout@puff\space\the\c@pgf@counta}{%
- \expandafter\xdef\csname pgf@anchor@cloud callout@puff\space\the\c@pgf@counta\endcsname{%
- \noexpand\pgf@sh@@cloudpuffanchor{\the\c@pgf@counta}%
- }%
- }{\c@pgf@counta0\relax}%
- \advance\c@pgf@counta-1\relax%
- \repeatpgfmathloop%
- }%
-}
+ \savedanchor\calloutpointer{%
+ \pgfutil@ifundefined{pgf@sh@s@cloud}{%
+ \pgferror{I cannot find the cloud shape. Please load the `symbol shapes' library}}{}%
+ \pgf@sh@s@cloud%
+ \pgf@sh@savedmacros%
+ %
+ \pgfextract@process\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \ifpgf@lib@callout@absolutepointer%
+ \else%
+ \pgfextract@process\calloutpointer{%
+ \pgfextract@process\borderpoint{%
+ \expandafter\pgfpointborderellipse\expandafter{\pgf@lib@callout@relativepointer}%
+ {\pgfqpoint{\xouterradius}{\youterradius}}%
+ }%
+ \pgfmathanglebetweenpoints{\pgfpointorigin}{\borderpoint}%
+ \let\pointerangle\pgfmathresult%
+ \expandafter\pgf@process\expandafter{\pgf@lib@callout@relativepointer}%
+ \pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
+ \edef\pointerradius{\pgfmathresult pt}%
+ \pgfpointadd{\borderpoint}{\pgfqpointpolar{\pointerangle}{\pointerradius}}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ \pgf@lib@callouts@shortenpointer%
+ \fi%
+ }%
+ \anchor{pointer}{%
+ \calloutpointer%
+ }%
+ \inheritsavedanchors[from=cloud]%
+ \inheritanchor[from=cloud]{center}%
+ \inheritanchor[from=cloud]{base}%
+ \inheritanchor[from=cloud]{mid}%
+ \inheritanchor[from=cloud]{north}%
+ \inheritanchor[from=cloud]{south}%
+ \inheritanchor[from=cloud]{east}%
+ \inheritanchor[from=cloud]{west}%
+ \inheritanchor[from=cloud]{north east}%
+ \inheritanchor[from=cloud]{south west}%
+ \inheritanchor[from=cloud]{south east}%
+ \inheritanchor[from=cloud]{north west}%
+ \inheritanchorborder[from=cloud]%
+ \backgroundpath{%
+ \pgf@sh@bg@cloud%
+ \ifpgf@lib@callout@absolutepointer%
+ \pgfextract@process\calloutpointer{%
+ \pgfpointanchor{pgf@lib@callout@pointer}{center}%
+ }%
+ \ifx\pgf@node@name\pgfutil@empty%
+ \else%
+ \edef\pgf@sh@@temp{\noexpand\expandafter\noexpand\pgfutil@g@addto@macro\noexpand\csname pgf@sh@np@\pgf@node@name\noexpand\endcsname}%
+ \edef\pgf@sh@@@temp{%
+ \noexpand\def\noexpand\calloutpointeranchor{%
+ \noexpand\pgf@x\the\pgf@x%
+ \noexpand\pgf@y\the\pgf@y%
+ }%
+ }%
+ \expandafter\pgf@sh@@temp\expandafter{\pgf@sh@@@temp}
+ \fi%
+ \fi%
+ %
+ \pgfextract@process\borderpoint{%
+ \pgfpointadd{%
+ \pgfpointborderellipse{\pgfpointdiff{\centerpoint}{\calloutpointer}}%
+ {\pgfqpoint{\xouterradius}{\youterradius}}%
+ }{\centerpoint}%
+ }%
+ \pgf@lib@callouts@shortenpointer%
+ \pgfmathanglebetweenpoints{\calloutpointer}{\centerpoint}%
+ \let\angle\pgfmathresult%
+ \pgfmathsin@{\angle}%
+ \let\sinpointerangle\pgfmathresult%
+ \pgfmathcos@{\angle}%
+ \let\cospointerangle\pgfmathresult%
+ %
+ \pgf@x\xouterradius\relax%
+ \pgf@x2.0\pgf@x%
+ \pgf@y\yinnerradius\relax%
+ \pgf@y2.0\pgf@y%
+ \pgf@lib@callout@setpointersize{\pgfkeysvalueof{/pgf/callout pointer start size}}%
+ \pgf@xb\pgf@xa%
+ \pgf@yb\pgf@ya%
+ \pgf@lib@callout@setpointersize{\pgfkeysvalueof{/pgf/callout pointer end size}}%
+ \advance\pgf@xb-\pgf@xa%
+ \advance\pgf@yb-\pgf@ya%
+ %
+ \pgfmathsetcount\c@pgf@counta{\pgfkeysvalueof{/pgf/callout pointer segments}}%
+ \divide\pgf@xb\c@pgf@counta%
+ \divide\pgf@yb\c@pgf@counta%
+ %
+ \pgf@process{\pgfpointdiff{\borderpoint}{\calloutpointer}}%
+ \pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
+ \pgfutil@tempdima\pgfmathresult pt\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ %
+ \pgfutil@tempdimb0pt\relax%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\c@pgf@counta%
+ \else%
+ {%
+ \pgf@xa.5\pgf@xa%
+ \pgf@ya.5\pgf@ya%
+ \edef\tempxradius{\the\pgf@xa}%
+ \edef\tempyradius{\the\pgf@ya}%
+ \pgfpathellipse%
+ {%
+ \calloutpointer%
+ \advance\pgf@x\cospointerangle\pgfutil@tempdimb%
+ \advance\pgf@y\sinpointerangle\pgfutil@tempdimb%
+ }%
+ {\pgfqpoint{\tempxradius}{0pt}}{\pgfqpoint{0pt}{\tempyradius}}%
+ }%
+ \advance\pgf@xa\pgf@xb%
+ \advance\pgf@ya\pgf@yb%
+ \advance\pgfutil@tempdimb\pgfutil@tempdima%
+ \repeatpgfmathloop%
+ }%
+ %
+ % Hack the puff anchors for the callout.
+ %
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@cloud callout\endcsname{%
+ \c@pgf@counta\puffs\relax%
+ \pgfmathloop%
+ \ifnum\c@pgf@counta>0\relax%
+ \pgfutil@ifundefined{pgf@anchor@cloud callout@puff\space\the\c@pgf@counta}{%
+ \expandafter\xdef\csname pgf@anchor@cloud callout@puff\space\the\c@pgf@counta\endcsname{%
+ \noexpand\pgf@sh@@cloudpuffanchor{\the\c@pgf@counta}%
+ }%
+ }{\c@pgf@counta0\relax}%
+ \advance\c@pgf@counta-1\relax%
+ \repeatpgfmathloop%
+ }%
+}%
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.code.tex
index fc0b1d20aa5..ee41b301abc 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.code.tex
@@ -7,14 +7,14 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\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 $
+\ProvidesFileRCS{pgflibraryshapes.code.tex}
% Only the following are loaded by default and only for historical
-% reasons.
+% reasons.
-\usepgflibrary{shapes.geometric}
-\usepgflibrary{shapes.misc}
-\usepgflibrary{shapes.symbols}
+\usepgflibrary{shapes.geometric}%
+\usepgflibrary{shapes.misc}%
+\usepgflibrary{shapes.symbols}%
% Further libraries should be included directly
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.geometric.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.geometric.code.tex
index ae7ec0f3c4e..08ef867ff0e 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.geometric.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.geometric.code.tex
@@ -7,87 +7,87 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\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 $
+\ProvidesFileRCS{pgflibraryshapes.geometric.code.tex}
\pgfdeclareshape{ellipse}
%
% Draws a circle around the text
%
-{
+{%
\savedanchor\centerpoint{%
\pgf@x=.5\wd\pgfnodeparttextbox%
\pgf@y=.5\ht\pgfnodeparttextbox%
\advance\pgf@y by-.5\dp\pgfnodeparttextbox%
- }
+ }%
\savedanchor\radius{%
- %
- % Caculate ``height radius''
- %
+ %
+ % Calculate ``height radius''
+ %
\pgf@y=.5\ht\pgfnodeparttextbox%
\advance\pgf@y by.5\dp\pgfnodeparttextbox%
\pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/inner ysep}}%
\advance\pgf@y by\pgf@yb%
- %
- % Caculate ``width radius''
- %
+ %
+ % Calculate ``width radius''
+ %
\pgf@x=.5\wd\pgfnodeparttextbox%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/inner xsep}}%
\advance\pgf@x by\pgf@xb%
- %
+ %
% Adjust
- %
+ %
\pgf@x=1.4142136\pgf@x%
\pgf@y=1.4142136\pgf@y%
- %
- % Adjust hieght, if necessary
- %
+ %
+ % Adjust height, if necessary
+ %
\pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/minimum height}}%
\ifdim\pgf@y<.5\pgf@yc%
\pgf@y=.5\pgf@yc%
\fi%
- %
+ %
% Adjust width, if necessary
- %
+ %
\pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/minimum width}}%
\ifdim\pgf@x<.5\pgf@xc%
\pgf@x=.5\pgf@xc%
\fi%
- %
+ %
% Add outer sep
- %
- \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
+ %
+ \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
\advance\pgf@x by\pgf@xb%
\advance\pgf@y by\pgf@yb%
- }
+ }%
%
% Anchors
- %
- \anchor{center}{\centerpoint}
- \anchor{mid}{\centerpoint\pgfmathsetlength\pgf@y{.5ex}}
- \anchor{base}{\centerpoint\pgf@y=0pt}
+ %
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\centerpoint\pgfmathsetlength\pgf@y{.5ex}}%
+ \anchor{base}{\centerpoint\pgf@y=0pt}%
\anchor{north}
{
\pgf@process{\radius}
\pgf@ya=\pgf@y%
\pgf@process{\centerpoint}
\advance\pgf@y by\pgf@ya
- }
+ }%
\anchor{south}
{
\pgf@process{\radius}
\pgf@ya=\pgf@y%
\pgf@process{\centerpoint}
\advance\pgf@y by-\pgf@ya
- }
+ }%
\anchor{west}
{
\pgf@process{\radius}
\pgf@xa=\pgf@x%
\pgf@process{\centerpoint}
\advance\pgf@x by-\pgf@xa
- }
+ }%
\anchor{mid west}
{%
\pgf@process{\radius}
@@ -95,7 +95,7 @@
\pgf@process{\centerpoint}
\advance\pgf@x by-\pgf@xa%
\pgfmathsetlength\pgf@y{.5ex}
- }
+ }%
\anchor{base west}
{%
\pgf@process{\radius}
@@ -103,7 +103,7 @@
\pgf@process{\centerpoint}
\advance\pgf@x by-\pgf@xa%
\pgf@y=0pt
- }
+ }%
\anchor{north west}
{
\pgf@process{\radius}
@@ -112,7 +112,7 @@
\pgf@process{\centerpoint}
\advance\pgf@x by-0.707107\pgf@xa
\advance\pgf@y by0.707107\pgf@ya
- }
+ }%
\anchor{south west}
{
\pgf@process{\radius}
@@ -121,14 +121,14 @@
\pgf@process{\centerpoint}
\advance\pgf@x by-0.707107\pgf@xa
\advance\pgf@y by-0.707107\pgf@ya
- }
+ }%
\anchor{east}
{%
\pgf@process{\radius}
\pgf@xa=\pgf@x%
\pgf@process{\centerpoint}
\advance\pgf@x by\pgf@xa
- }
+ }%
\anchor{mid east}
{%
\pgf@process{\radius}
@@ -136,7 +136,7 @@
\pgf@process{\centerpoint}
\advance\pgf@x by\pgf@xa%
\pgfmathsetlength\pgf@y{.5ex}
- }
+ }%
\anchor{base east}
{%
\pgf@process{\radius}
@@ -144,7 +144,7 @@
\pgf@process{\centerpoint}
\advance\pgf@x by\pgf@xa%
\pgf@y=0pt
- }
+ }%
\anchor{north east}
{
\pgf@process{\radius}
@@ -153,7 +153,7 @@
\pgf@process{\centerpoint}
\advance\pgf@x by0.707107\pgf@xa
\advance\pgf@y by0.707107\pgf@ya
- }
+ }%
\anchor{south east}
{
\pgf@process{\radius}
@@ -162,7 +162,7 @@
\pgf@process{\centerpoint}
\advance\pgf@x by0.707107\pgf@xa
\advance\pgf@y by-0.707107\pgf@ya
- }
+ }%
\anchorborder{
\edef\pgf@marshal{%
\noexpand\pgfpointborderellipse
@@ -175,7 +175,7 @@
\centerpoint%
\advance\pgf@x by\pgf@xa%
\advance\pgf@y by\pgf@ya%
- }
+ }%
%
% Background path
@@ -185,13 +185,13 @@
\pgf@process{\radius}%
\pgfutil@tempdima=\pgf@x%
\pgfutil@tempdimb=\pgf@y%
- \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
\advance\pgfutil@tempdima by-\pgf@xb%
\advance\pgfutil@tempdimb by-\pgf@yb%
\pgfpathellipse{\centerpoint}{\pgfqpoint{\pgfutil@tempdima}{0pt}}{\pgfqpoint{0pt}{\pgfutil@tempdimb}}%
- }
-}
+ }%
+}%
@@ -209,14 +209,14 @@
% /pgf/aspect : recommended width/height quotient.
%
\pgfkeys{/pgf/.cd,
- aspect/.code={\pgfsetshapeaspect{#1}},% this for tikz...
- shape aspect/.initial=1,% but this is consistent with other pgfset stuff.
- shape aspect/.code={%
- \pgfkeys{/pgf/aspect=#1}%
- \pgfkeyssetvalue{/pgf/shape aspect}{#1}
- }%
-}
-
+ aspect/.code={\pgfsetshapeaspect{#1}},% this for tikz...
+ shape aspect/.initial=1,% but this is consistent with other pgfset stuff.
+ shape aspect/.code={%
+ \pgfkeys{/pgf/aspect=#1}%
+ \pgfkeyssetvalue{/pgf/shape aspect}{#1}
+ }%
+}%
+
\def\pgfsetshapeaspect#1{%
\def\pgfshapeaspect{#1}%
@@ -226,13 +226,13 @@
\c@pgf@counta=\pgfutil@tempdima\relax% 8192*determinant
\pgfutil@tempdima=8192pt%
\divide\pgfutil@tempdima by\c@pgf@counta%
- \edef\pgfshapeaspectinverse{\pgf@sys@tonumber{\pgfutil@tempdima}}
-}
+ \edef\pgfshapeaspectinverse{\pgf@sys@tonumber{\pgfutil@tempdima}}%
+}%
-\pgfsetshapeaspect{1}
+\pgfsetshapeaspect{1}%
\pgfdeclareshape{diamond}
-{
+{%
\savedanchor\outernortheast{%
%
% Calculate width and height of the inner rectangle
@@ -255,13 +255,13 @@
% Check against minimum height/width
%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
- \pgf@xb=.5\pgf@xb%
+ \pgf@xb=.5\pgf@xb%
\ifdim\pgf@x<\pgf@xb%
% yes, too small. Enlarge...
\pgf@x=\pgf@xb%
\fi%
\pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum height}}%
- \pgf@yb=.5\pgf@yb%
+ \pgf@yb=.5\pgf@yb%
\ifdim\pgf@y<\pgf@yb%
% yes, too small. Enlarge...
\pgf@y=\pgf@yb%
@@ -273,12 +273,12 @@
\advance\pgf@x by\pgf@xa%
\pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
\advance\pgf@y by\pgf@ya%
- }
+ }%
\savedanchor\text{%
\pgf@x=-.5\wd\pgfnodeparttextbox%
\pgf@y=-.5\ht\pgfnodeparttextbox%
\advance\pgf@y by.5\dp\pgfnodeparttextbox%
- }
+ }%
%
% Anchors
@@ -288,18 +288,18 @@
\anchor{mid}{%
\pgf@process{\text}%
\pgf@x=0pt%
- \pgfmathsetlength\pgf@ya{.5ex}
+ \pgfmathsetlength\pgf@ya{.5ex}%
\advance\pgf@y by\pgf@ya%
- }
- \anchor{base}{\pgf@process{\text}\pgf@x=0pt }
- \anchor{north}{\pgf@process{\outernortheast}\pgf@x=0pt}
- \anchor{south}{\pgf@process{\outernortheast}\pgf@x=0pt\pgf@y=-\pgf@y}
- \anchor{west}{\pgf@process{\outernortheast}\pgf@x=-\pgf@x\pgf@y=0pt}
- \anchor{north west}{\pgf@process{\outernortheast}\pgf@x=-.5\pgf@x\pgf@y=.5\pgf@y}
- \anchor{south west}{\pgf@process{\outernortheast}\pgf@x=-.5\pgf@x\pgf@y=-.5\pgf@y}
- \anchor{east}{\pgf@process{\outernortheast}\pgf@y=0pt}
- \anchor{north east}{\pgf@process{\outernortheast}\pgf@x=.5\pgf@x\pgf@y=.5\pgf@y}
- \anchor{south east}{\pgf@process{\outernortheast}\pgf@x=.5\pgf@x\pgf@y=-.5\pgf@y}
+ }%
+ \anchor{base}{\pgf@process{\text}\pgf@x=0pt}%
+ \anchor{north}{\pgf@process{\outernortheast}\pgf@x=0pt}%
+ \anchor{south}{\pgf@process{\outernortheast}\pgf@x=0pt\pgf@y=-\pgf@y}%
+ \anchor{west}{\pgf@process{\outernortheast}\pgf@x=-\pgf@x\pgf@y=0pt}%
+ \anchor{north west}{\pgf@process{\outernortheast}\pgf@x=-.5\pgf@x\pgf@y=.5\pgf@y}%
+ \anchor{south west}{\pgf@process{\outernortheast}\pgf@x=-.5\pgf@x\pgf@y=-.5\pgf@y}%
+ \anchor{east}{\pgf@process{\outernortheast}\pgf@y=0pt}%
+ \anchor{north east}{\pgf@process{\outernortheast}\pgf@x=.5\pgf@x\pgf@y=.5\pgf@y}%
+ \anchor{south east}{\pgf@process{\outernortheast}\pgf@x=.5\pgf@x\pgf@y=-.5\pgf@y}%
\anchorborder{%
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
@@ -320,7 +320,7 @@
{\noexpand\pgfqpoint{0pt}{\the\pgf@y}}%
}%
\pgf@process{\pgf@marshal}%
- }
+ }%
%
% Background path
@@ -338,8 +338,8 @@
\pgfpathlineto{\pgfqpoint{-\pgf@xc}{0pt}}%
\pgfpathlineto{\pgfqpoint{0pt}{-\pgf@yc}}%
\pgfpathclose%
- }
-}
+ }%
+}%
@@ -356,571 +356,569 @@
% /pgf/star point ratio : The ratio of the outer point and inner point radii.
\pgfkeys{/pgf/.cd,
- star points/.initial=5,
- star point height/.initial=.5cm,
- star point height/.code={%
- \def\pgf@lib@temp{#1}%
- \pgfkeyslet{/pgf/star point height}{\pgf@lib@temp}%
- \pgf@lib@shapes@starouterradiususesratiofalse%
- },
- star point ratio/.initial=1.5,
- star point ratio/.code={%
- \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
-}
+ star points/.initial=5,
+ star point height/.initial=.5cm,
+ star point height/.code={%
+ \def\pgf@lib@temp{#1}%
+ \pgfkeyslet{/pgf/star point height}{\pgf@lib@temp}%
+ \pgf@lib@shapes@starouterradiususesratiofalse%
+ },
+ star point ratio/.initial=1.5,
+ star point ratio/.code={%
+ \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 compatibility with 1.18
+}%
% Shape star.
%
-\pgfdeclareshape{star}{
- \savedmacro\totalstarpoints{%
- \pgfmathsetcounter{pgf@counta}{\pgfkeysvalueof{/pgf/star points}}%
- \multiply\c@pgf@counta2\relax%
- \edef\totalstarpoints{\the\c@pgf@counta}%
- }
- \savedmacro\anglestep{%
- \pgfmathdivide{180}{\pgfkeysvalueof{/pgf/star points}}%
- \let\anglestep\pgfmathresult%
- }
- \savedmacro\calculateradii{%
- %
- % Get the node dimensions.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\dp\pgfnodeparttextbox%
- \ifdim\pgf@y>\pgf@x%
- \pgf@x\pgf@y%
- \fi%
- %
- % Calculate the incircle radius.
- %
- \pgf@x1.41421\pgf@x%
- \edef\innerradius{\the\pgf@x}%
- %
- % Calculate the circumcircle radius.
- %
- % Use the star point height or the star point ratio?
- %
- \ifpgf@lib@shapes@starouterradiususesratio%
- \pgfmathparse{\pgfkeysvalueof{/pgf/star point ratio}}%
- \expandafter\pgf@x\pgfmathresult\pgf@x%
- \else%
- \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/star point height}}%
- \fi%
- \pgf@xc\pgf@x%
- %
- % Accommodate the larger of the minimum height/width.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@ya>\pgf@xa%
- \pgf@xa\pgf@ya%
- \fi%
- \ifdim\pgf@x<.5\pgf@xa%
- \pgf@x.5\pgf@xa%
- \fi%
- \edef\outerradius{\the\pgf@x}%
- %
- % If the outer radius has been enlarged, adjust the inner radius...
- %
- \ifdim\pgf@x>\pgf@xc%
- %
- % ...using the star point ratio, or...
- %
- \ifpgf@lib@shapes@starouterradiususesratio%
- \pgfmathreciprocal{\pgfkeysvalueof{/pgf/star point ratio}}%
- \pgf@xa\pgfmathresult\pgf@x\relax%
- \edef\innerradius{\the\pgf@xa}%
- \else%
- %
- % The star point height.
- %
- \pgf@xa\pgf@x\relax%
- \pgfmathaddtolength\pgf@xa{-\pgfkeysvalueof{/pgf/star point height}}%
- \edef\innerradius{\the\pgf@xa}%
- \fi%
- \fi%
- \edef\outerradius{\the\pgf@x}%
- %
- % Now calculate the anchor radii from the outer sep.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
- \ifdim\pgf@ya>\pgf@xa%
- \pgf@xa\pgf@ya%
- \fi
- %
- % Take into account the miter length...
- %
- \pgfmathdivide{180}{\pgfkeysvalueof{/pgf/star points}}%
- \let\angletofirstpoint\pgfmathresult%
- \pgfmathmultiply@{\angletofirstpoint}{2}%
- \let\angletosecondpoint\pgfmathresult%
- %
- % ...for the outer radius...
- %
- \pgfmathanglebetweenlines%
- {\pgfqpointpolar{\angletofirstpoint}{\outerradius}}%
- {\pgfqpointpolar{\angletosecondpoint}{\innerradius}}%
- {\pgfqpointpolar{\angletofirstpoint}{\outerradius}}%
- {\pgfqpointpolar{0}{\innerradius}}%
- \pgfmathdivide@{\pgfmathresult}{2}%
- \pgfmathcosec@{\pgfmathresult}%
- \pgf@x\outerradius\relax%
- \advance\pgf@x\pgfmathresult\pgf@xa%
- \edef\anchorouterradius{\the\pgf@x}%
- %
- % ...and for the inner radius.
- %
- \pgfmathanglebetweenlines%
- {\pgfqpointpolar{\angletofirstpoint}{\innerradius}}%
- {\pgfqpointpolar{0}{\outerradius}}%
- {\pgfqpointpolar{\angletofirstpoint}{\innerradius}}%
- {\pgfqpointpolar{\angletosecondpoint}{\outerradius}}%
- \pgfmathdivide@{\pgfmathresult}{2}%
- \pgfmathcosec@{\pgfmathresult}%
- \pgf@x\innerradius\relax%
- \advance\pgf@x\pgfmathresult\pgf@xa%
- \edef\anchorinnerradius{\the\pgf@x}%
- %
- % Save all radii.
- %
- \addtosavedmacro{\innerradius}%
- \addtosavedmacro{\outerradius}%
- \addtosavedmacro{\anchorinnerradius}%
- \addtosavedmacro{\anchorouterradius}%
- }
- \savedmacro\startangle{%
- \pgfmathadd{90}{\pgfkeysvalueof{/pgf/shape border rotate}}%
- \let\startangle\pgfmathresult%
- }
- %
- % Saved anchors.
- %
- \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{+.5ex}%
- }%
- %
- % Other anchors.
- %
-%
- % Other anchors.
- %
- \anchor{center}{\centerpoint}%
- \anchor{mid}{\centerpoint\pgfmathsetlength\pgf@y{.5ex}}%
- \anchor{base}{\centerpoint\pgf@y=0pt}%
- \anchor{north}{%
- \calculateradii%
- \csname pgf@anchor@star@border\endcsname{\pgfqpoint{0pt}{\anchorouterradius}}}%
- \anchor{south}{%
- \calculateradii%
- \csname pgf@anchor@star@border\endcsname{\pgfqpoint{0pt}{-\anchorouterradius}}}%
- \anchor{east}{%
- \calculateradii%
- \csname pgf@anchor@star@border\endcsname{\pgfqpoint{\anchorouterradius}{0pt}}}%
- \anchor{west}{%
- \calculateradii%
- \csname pgf@anchor@star@border\endcsname{\pgfqpoint{-\anchorouterradius}{0pt}}}%
- \anchor{north east}{%
- \calculateradii%
- \csname pgf@anchor@star@border\endcsname{\pgfqpoint{\anchorouterradius}{\anchorouterradius}}}%
- \anchor{north west}{%
- \calculateradii%
- \csname pgf@anchor@star@border\endcsname{\pgfqpoint{-\anchorouterradius}{\anchorouterradius}}}%
- \anchor{south east}{%
- \calculateradii%
- \csname pgf@anchor@star@border\endcsname{\pgfqpoint{\anchorouterradius}{-\anchorouterradius}}}%
- \anchor{south west}{%
- \calculateradii%
- \csname pgf@anchor@star@border\endcsname{\pgfqpoint{-\anchorouterradius}{-\anchorouterradius}}}%
- %
- % Background path.
- %
- \backgroundpath{%
- \calculateradii%
- \let\angle\startangle%
- \pgfpathmoveto{\pgfpointadd{\centerpoint}{\pgfqpointpolar{\startangle}{\outerradius}}}%
- \pgfmathloop%
- \pgfmathadd@{\angle}{\anglestep}%
- \let\angle\pgfmathresult%
- \ifnum\pgfmathcounter=\totalstarpoints%
- \pgfpathclose%
- \else%
- \ifodd\pgfmathcounter
- \pgfpathlineto{\pgfpointadd{\centerpoint}{\pgfqpointpolar{\angle}{\innerradius}}}%
- \else%
- \pgfpathlineto{\pgfpointadd{\centerpoint}{\pgfqpointpolar{\angle}{\outerradius}}}%
- \fi%
- \repeatpgfmathloop%
- }%
- %
- % Define points on the anchor border.
- %
- \anchorborder{%
- %
- % Save x and y.
- %
- \edef\externalx{\the\pgf@x}%
- \edef\externaly{\the\pgf@y}%
- %
- % Adjust the location of the external
- % point relative to \centerpoint.
- %
- \centerpoint%
- \pgf@xa\externalx\relax%
- \pgf@ya\externaly\relax%
- \advance\pgf@xa\pgf@x%
- \advance\pgf@ya\pgf@y%
- \edef\externalx{\the\pgf@xa}%
- \edef\externaly{\the\pgf@ya}%
- %
- % Get the angle of the external point to the \centerpoint.
- %
- \pgfmathanglebetweenpoints{\centerpoint}{\pgfqpoint{\externalx}{\externaly}}%
- %
- % Locate the appropriate sides on the star border...
- %
- \pgfmathsubtract@{\pgfmathresult}{\startangle}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \pgfmathdivide@{\pgfmathresult}{\anglestep}%
- \pgfmathfloor@{\pgfmathresult}%
- \afterassignment\pgfmath@gobbletilpgfmath@
- \c@pgf@counta\pgfmathresult\relax\pgfmath@
- \pgfmathmultiply@{\pgfmathresult}{\anglestep}%
- \pgfmathadd@{\pgfmathresult}{\startangle}%
- \let\firstangle\pgfmathresult%
- \pgfmathadd@{\pgfmathresult}{\anglestep}%
- \let\secondangle\pgfmathresult%
- \calculateradii%
- %
- % ...and thus, the point on the star border.
- %
- \ifodd\c@pgf@counta
- \pgfpointintersectionoflines{\centerpoint}{\pgfpoint{+\externalx}{+\externaly}}%
- {%
- \pgfpointadd{\centerpoint}%
- {\pgfqpointpolar{+\firstangle}{+\anchorinnerradius}}%
- }%
- {%
- \pgfpointadd{\centerpoint}%
- {\pgfqpointpolar{+\secondangle}{+\anchorouterradius}}%
- }%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\pgfpoint{+\externalx}{+\externaly}}%
- {%
- \pgfpointadd{\centerpoint}%
- {\pgfqpointpolar{+\firstangle}{+\anchorouterradius}}%
- }%
- {%
- \pgfpointadd{\centerpoint}%
- {\pgfqpointpolar{+\secondangle}{+\anchorinnerradius}}%
- }%
- \fi%
- }
- %
- % Some hackery. This is needed if a star is positioned using
- % a `...point <n+1>' anchor, where n is the maximum number of
- % points of any previously drawn star.
- %
- \pgfutil@g@addto@macro\pgf@sh@s@star{%
- \c@pgf@counta\totalstarpoints\relax%
- \divide\c@pgf@counta2\relax%
- \pgfmathloop%
- \ifnum\c@pgf@counta>0\relax%
- \c@pgf@countb\c@pgf@counta\relax%
- \advance\c@pgf@countb-1\relax%
- \pgfutil@ifundefined{pgf@anchor@star@inner point\space\the\c@pgf@counta}{%
- \expandafter\xdef\csname pgf@anchor@star@inner point\space\the\c@pgf@counta\endcsname{%
- \noexpand\calculateradii%
- \noexpand\pgfmathmultiply@{\the\c@pgf@countb}{\noexpand\anglestep}%
- \noexpand\pgfmathmultiply@{\noexpand\pgfmathresult}{2}%
- \noexpand\pgfmathadd@{\noexpand\pgfmathresult}{\noexpand\anglestep}%
- \noexpand\pgfmathadd@{\noexpand\pgfmathresult}{\noexpand\startangle}%
- \noexpand\let\noexpand\angle\noexpand\pgfmathresult%
- \noexpand\pgfpointadd{\noexpand\centerpoint}%
- {\noexpand\pgfqpointpolar{\noexpand\angle}{\noexpand\anchorinnerradius}}%
- }%
- \expandafter\xdef\csname pgf@anchor@star@outer point\space\the\c@pgf@counta\endcsname{%
- \noexpand\calculateradii%
- \noexpand\pgfmathmultiply@{\the\c@pgf@countb}{\noexpand\anglestep}%
- \noexpand\pgfmathmultiply@{\noexpand\pgfmathresult}{2}%
- \noexpand\pgfmathadd@{\noexpand\pgfmathresult}{\noexpand\startangle}%
- \noexpand\let\noexpand\angle\noexpand\pgfmathresult%
- \noexpand\pgfpointadd{\noexpand\centerpoint}%
- {\noexpand\pgfqpointpolar{\noexpand\angle}{\noexpand\anchorouterradius}}%
- }%
- }{\c@pgf@counta0\relax}%
- \advance\c@pgf@counta-1\relax%
- \repeatpgfmathloop%
- }%
-}
+\pgfdeclareshape{star}{%
+ \savedmacro\totalstarpoints{%
+ \pgfmathsetcounter{pgf@counta}{\pgfkeysvalueof{/pgf/star points}}%
+ \multiply\c@pgf@counta2\relax%
+ \edef\totalstarpoints{\the\c@pgf@counta}%
+ }%
+ \savedmacro\anglestep{%
+ \pgfmathdivide{180}{\pgfkeysvalueof{/pgf/star points}}%
+ \let\anglestep\pgfmathresult%
+ }%
+ \savedmacro\calculateradii{%
+ %
+ % Get the node dimensions.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y.5\dp\pgfnodeparttextbox%
+ \ifdim\pgf@y>\pgf@x%
+ \pgf@x\pgf@y%
+ \fi%
+ %
+ % Calculate the incircle radius.
+ %
+ \pgf@x1.41421\pgf@x%
+ \edef\innerradius{\the\pgf@x}%
+ %
+ % Calculate the circumcircle radius.
+ %
+ % Use the star point height or the star point ratio?
+ %
+ \ifpgf@lib@shapes@starouterradiususesratio%
+ \pgfmathparse{\pgfkeysvalueof{/pgf/star point ratio}}%
+ \expandafter\pgf@x\pgfmathresult\pgf@x%
+ \else%
+ \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/star point height}}%
+ \fi%
+ \pgf@xc\pgf@x%
+ %
+ % Accommodate the larger of the minimum height/width.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@ya>\pgf@xa%
+ \pgf@xa\pgf@ya%
+ \fi%
+ \ifdim\pgf@x<.5\pgf@xa%
+ \pgf@x.5\pgf@xa%
+ \fi%
+ \edef\outerradius{\the\pgf@x}%
+ %
+ % If the outer radius has been enlarged, adjust the inner radius...
+ %
+ \ifdim\pgf@x>\pgf@xc%
+ %
+ % ...using the star point ratio, or...
+ %
+ \ifpgf@lib@shapes@starouterradiususesratio%
+ \pgfmathreciprocal{\pgfkeysvalueof{/pgf/star point ratio}}%
+ \pgf@xa\pgfmathresult\pgf@x\relax%
+ \edef\innerradius{\the\pgf@xa}%
+ \else%
+ %
+ % The star point height.
+ %
+ \pgf@xa\pgf@x\relax%
+ \pgfmathaddtolength\pgf@xa{-\pgfkeysvalueof{/pgf/star point height}}%
+ \edef\innerradius{\the\pgf@xa}%
+ \fi%
+ \fi%
+ \edef\outerradius{\the\pgf@x}%
+ %
+ % Now calculate the anchor radii from the outer sep.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@ya>\pgf@xa%
+ \pgf@xa\pgf@ya%
+ \fi
+ %
+ % Take into account the miter length...
+ %
+ \pgfmathdivide{180}{\pgfkeysvalueof{/pgf/star points}}%
+ \let\angletofirstpoint\pgfmathresult%
+ \pgfmathmultiply@{\angletofirstpoint}{2}%
+ \let\angletosecondpoint\pgfmathresult%
+ %
+ % ...for the outer radius...
+ %
+ \pgfmathanglebetweenlines%
+ {\pgfqpointpolar{\angletofirstpoint}{\outerradius}}%
+ {\pgfqpointpolar{\angletosecondpoint}{\innerradius}}%
+ {\pgfqpointpolar{\angletofirstpoint}{\outerradius}}%
+ {\pgfqpointpolar{0}{\innerradius}}%
+ \pgfmathdivide@{\pgfmathresult}{2}%
+ \pgfmathcosec@{\pgfmathresult}%
+ \pgf@x\outerradius\relax%
+ \advance\pgf@x\pgfmathresult\pgf@xa%
+ \edef\anchorouterradius{\the\pgf@x}%
+ %
+ % ...and for the inner radius.
+ %
+ \pgfmathanglebetweenlines%
+ {\pgfqpointpolar{\angletofirstpoint}{\innerradius}}%
+ {\pgfqpointpolar{0}{\outerradius}}%
+ {\pgfqpointpolar{\angletofirstpoint}{\innerradius}}%
+ {\pgfqpointpolar{\angletosecondpoint}{\outerradius}}%
+ \pgfmathdivide@{\pgfmathresult}{2}%
+ \pgfmathcosec@{\pgfmathresult}%
+ \pgf@x\innerradius\relax%
+ \advance\pgf@x\pgfmathresult\pgf@xa%
+ \edef\anchorinnerradius{\the\pgf@x}%
+ %
+ % Save all radii.
+ %
+ \addtosavedmacro{\innerradius}%
+ \addtosavedmacro{\outerradius}%
+ \addtosavedmacro{\anchorinnerradius}%
+ \addtosavedmacro{\anchorouterradius}%
+ }%
+ \savedmacro\startangle{%
+ \pgfmathadd{90}{\pgfkeysvalueof{/pgf/shape border rotate}}%
+ \let\startangle\pgfmathresult%
+ }%
+ %
+ % Saved anchors.
+ %
+ \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{+.5ex}%
+ }%
+ %
+ %
+ % Other anchors.
+ %
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\centerpoint\pgfmathsetlength\pgf@y{.5ex}}%
+ \anchor{base}{\centerpoint\pgf@y=0pt}%
+ \anchor{north}{%
+ \calculateradii%
+ \csname pgf@anchor@star@border\endcsname{\pgfqpoint{0pt}{\anchorouterradius}}}%
+ \anchor{south}{%
+ \calculateradii%
+ \csname pgf@anchor@star@border\endcsname{\pgfqpoint{0pt}{-\anchorouterradius}}}%
+ \anchor{east}{%
+ \calculateradii%
+ \csname pgf@anchor@star@border\endcsname{\pgfqpoint{\anchorouterradius}{0pt}}}%
+ \anchor{west}{%
+ \calculateradii%
+ \csname pgf@anchor@star@border\endcsname{\pgfqpoint{-\anchorouterradius}{0pt}}}%
+ \anchor{north east}{%
+ \calculateradii%
+ \csname pgf@anchor@star@border\endcsname{\pgfqpoint{\anchorouterradius}{\anchorouterradius}}}%
+ \anchor{north west}{%
+ \calculateradii%
+ \csname pgf@anchor@star@border\endcsname{\pgfqpoint{-\anchorouterradius}{\anchorouterradius}}}%
+ \anchor{south east}{%
+ \calculateradii%
+ \csname pgf@anchor@star@border\endcsname{\pgfqpoint{\anchorouterradius}{-\anchorouterradius}}}%
+ \anchor{south west}{%
+ \calculateradii%
+ \csname pgf@anchor@star@border\endcsname{\pgfqpoint{-\anchorouterradius}{-\anchorouterradius}}}%
+ %
+ % Background path.
+ %
+ \backgroundpath{%
+ \calculateradii%
+ \let\angle\startangle%
+ \pgfpathmoveto{\pgfpointadd{\centerpoint}{\pgfqpointpolar{\startangle}{\outerradius}}}%
+ \pgfmathloop%
+ \pgfmathadd@{\angle}{\anglestep}%
+ \let\angle\pgfmathresult%
+ \ifnum\pgfmathcounter=\totalstarpoints%
+ \pgfpathclose%
+ \else%
+ \ifodd\pgfmathcounter
+ \pgfpathlineto{\pgfpointadd{\centerpoint}{\pgfqpointpolar{\angle}{\innerradius}}}%
+ \else%
+ \pgfpathlineto{\pgfpointadd{\centerpoint}{\pgfqpointpolar{\angle}{\outerradius}}}%
+ \fi%
+ \repeatpgfmathloop%
+ }%
+ %
+ % Define points on the anchor border.
+ %
+ \anchorborder{%
+ %
+ % Save x and y.
+ %
+ \edef\externalx{\the\pgf@x}%
+ \edef\externaly{\the\pgf@y}%
+ %
+ % Adjust the location of the external
+ % point relative to \centerpoint.
+ %
+ \centerpoint%
+ \pgf@xa\externalx\relax%
+ \pgf@ya\externaly\relax%
+ \advance\pgf@xa\pgf@x%
+ \advance\pgf@ya\pgf@y%
+ \edef\externalx{\the\pgf@xa}%
+ \edef\externaly{\the\pgf@ya}%
+ %
+ % Get the angle of the external point to the \centerpoint.
+ %
+ \pgfmathanglebetweenpoints{\centerpoint}{\pgfqpoint{\externalx}{\externaly}}%
+ %
+ % Locate the appropriate sides on the star border...
+ %
+ \pgfmathsubtract@{\pgfmathresult}{\startangle}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \pgfmathdivide@{\pgfmathresult}{\anglestep}%
+ \pgfmathfloor@{\pgfmathresult}%
+ \afterassignment\pgfmath@gobbletilpgfmath@
+ \c@pgf@counta\pgfmathresult\relax\pgfmath@
+ \pgfmathmultiply@{\pgfmathresult}{\anglestep}%
+ \pgfmathadd@{\pgfmathresult}{\startangle}%
+ \let\firstangle\pgfmathresult%
+ \pgfmathadd@{\pgfmathresult}{\anglestep}%
+ \let\secondangle\pgfmathresult%
+ \calculateradii%
+ %
+ % ...and thus, the point on the star border.
+ %
+ \ifodd\c@pgf@counta
+ \pgfpointintersectionoflines{\centerpoint}{\pgfpoint{+\externalx}{+\externaly}}%
+ {%
+ \pgfpointadd{\centerpoint}%
+ {\pgfqpointpolar{+\firstangle}{+\anchorinnerradius}}%
+ }%
+ {%
+ \pgfpointadd{\centerpoint}%
+ {\pgfqpointpolar{+\secondangle}{+\anchorouterradius}}%
+ }%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\pgfpoint{+\externalx}{+\externaly}}%
+ {%
+ \pgfpointadd{\centerpoint}%
+ {\pgfqpointpolar{+\firstangle}{+\anchorouterradius}}%
+ }%
+ {%
+ \pgfpointadd{\centerpoint}%
+ {\pgfqpointpolar{+\secondangle}{+\anchorinnerradius}}%
+ }%
+ \fi%
+ }%
+ %
+ % Some hackery. This is needed if a star is positioned using
+ % a `...point <n+1>' anchor, where n is the maximum number of
+ % points of any previously drawn star.
+ %
+ \pgfutil@g@addto@macro\pgf@sh@s@star{%
+ \c@pgf@counta\totalstarpoints\relax%
+ \divide\c@pgf@counta2\relax%
+ \pgfmathloop%
+ \ifnum\c@pgf@counta>0\relax%
+ \c@pgf@countb\c@pgf@counta\relax%
+ \advance\c@pgf@countb-1\relax%
+ \pgfutil@ifundefined{pgf@anchor@star@inner point\space\the\c@pgf@counta}{%
+ \expandafter\xdef\csname pgf@anchor@star@inner point\space\the\c@pgf@counta\endcsname{%
+ \noexpand\calculateradii%
+ \noexpand\pgfmathmultiply@{\the\c@pgf@countb}{\noexpand\anglestep}%
+ \noexpand\pgfmathmultiply@{\noexpand\pgfmathresult}{2}%
+ \noexpand\pgfmathadd@{\noexpand\pgfmathresult}{\noexpand\anglestep}%
+ \noexpand\pgfmathadd@{\noexpand\pgfmathresult}{\noexpand\startangle}%
+ \noexpand\let\noexpand\angle\noexpand\pgfmathresult%
+ \noexpand\pgfpointadd{\noexpand\centerpoint}%
+ {\noexpand\pgfqpointpolar{\noexpand\angle}{\noexpand\anchorinnerradius}}%
+ }%
+ \expandafter\xdef\csname pgf@anchor@star@outer point\space\the\c@pgf@counta\endcsname{%
+ \noexpand\calculateradii%
+ \noexpand\pgfmathmultiply@{\the\c@pgf@countb}{\noexpand\anglestep}%
+ \noexpand\pgfmathmultiply@{\noexpand\pgfmathresult}{2}%
+ \noexpand\pgfmathadd@{\noexpand\pgfmathresult}{\noexpand\startangle}%
+ \noexpand\let\noexpand\angle\noexpand\pgfmathresult%
+ \noexpand\pgfpointadd{\noexpand\centerpoint}%
+ {\noexpand\pgfqpointpolar{\noexpand\angle}{\noexpand\anchorouterradius}}%
+ }%
+ }{\c@pgf@counta0\relax}%
+ \advance\c@pgf@counta-1\relax%
+ \repeatpgfmathloop%
+ }%
+}%
% Keys for shape regular polygon
%
-% /pgf/regular polygon sides
+% /pgf/regular polygon sides
%
\pgfkeys{/pgf/.cd,
- regular polygon sides/.initial=5,
- regular polygon rotate/.style={/pgf/shape border rotate=#1}% For compatability with 1.18
-}
+ regular polygon sides/.initial=5,
+ regular polygon rotate/.style={/pgf/shape border rotate=#1}% For compatibility with 1.18
+}%
% Shape Regular Polygon.
%
-\pgfdeclareshape{regular polygon}{
- \savedmacro\sides{%
- \pgfmathtruncatemacro\sides{\pgfkeysvalueof{/pgf/regular polygon sides}}%
- }
- \savedmacro\anglestep{%
- \pgfmathdivide{360}{\pgfkeysvalueof{/pgf/regular polygon sides}}%
- \let\anglestep\pgfmathresult%
- }
- \savedmacro\calculateradii{%
- %
- % Get the node dimensions.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\dp\pgfnodeparttextbox%
- \ifdim\pgf@y>\pgf@x%
- \pgf@x\pgf@y%
- \fi%
- %
- % Calculate i, the incircle radius
- %
- \pgf@x1.41421\pgf@x%
- %
- % Calculate r, the polygon radius
- %
- % r = i / cos(360 / s / 2)
- %
- % (s = polygon sides)
- %
- \pgfmathdivide{180}{\pgfkeysvalueof{/pgf/regular polygon sides}}%
- \pgfmathsec@{\pgfmathresult}%
- \pgf@x\pgfmathresult\pgf@x%
- %
- % Accommodate the minimum width/height.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@ya>\pgf@xa%
- \pgf@xa\pgf@ya%
- \fi%
- \ifdim\pgf@x<.5\pgf@xa%
- \pgf@x.5\pgf@xa%
- \fi%
- \edef\radius{\the\pgf@x}%
- %
- % Now calculate the anchor radius from the outer sep.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
- \ifdim\pgf@ya>\pgf@xa%
- \pgf@xa\pgf@ya%
- \fi
- %
- % Take into account the miter length.
- %
- % m = o / sin (90 - (360 / s / 2))
- %
- % (o = outer sep, s = sides)
- %
- \pgfmathdivide{180}{\pgfkeysvalueof{/pgf/regular polygon sides}}%
- \pgfmathsubtract@{90}{\pgfmathresult}%
- \pgfmathcosec@{\pgfmathresult}%
- \advance\pgf@x\pgfmathresult\pgf@xa%
- \edef\anchorradius{\the\pgf@x}%
- %
- % Save both radii.
- %
- \addtosavedmacro{\radius}%
- \addtosavedmacro{\anchorradius}%
- }
- \savedmacro\startangle{%
- \pgfmathdivide{360}{\pgfkeysvalueof{/pgf/regular polygon sides}}%
- \let\anglestep\pgfmathresult%
- \pgfmathtruncatemacro\sides{\pgfkeysvalueof{/pgf/regular polygon sides}}%
- \expandafter\ifodd\sides\relax%
- \edef\pgfmathresult{90}%
- \else%
- \pgfmathdivide@{\anglestep}{2}%
- \pgfmathsubtract@{90}{\pgfmathresult}%
- \fi%
- \pgfmathadd{\pgfmathresult}{\pgfkeysvalueof{/pgf/shape border rotate}}%
- \let\startangle\pgfmathresult%
- }
- %
- % Saved anchors.
- %
- \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{+.5ex}%
- }%
- %
- % Other anchors.
- %
- \anchor{center}{\centerpoint}%
- \anchor{mid}{\midpoint}%
- \anchor{base}{\centerpoint\pgf@y=0pt}%
- \anchor{north}{%
- \calculateradii%
- \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{0pt}{\anchorradius}}}%
- \anchor{south}{%
- \calculateradii%
- \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{0pt}{-\anchorradius}}}%
- \anchor{east}{%
- \calculateradii%
- \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{\anchorradius}{0pt}}}%
- \anchor{west}{%
- \calculateradii%
- \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{-\anchorradius}{0pt}}}%
- \anchor{north east}{%
- \calculateradii%
- \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{\anchorradius}{\anchorradius}}}%
- \anchor{north west}{%
- \calculateradii%
- \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{-\anchorradius}{\anchorradius}}}%
- \anchor{south east}{%
- \calculateradii%
- \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{\anchorradius}{-\anchorradius}}}%
- \anchor{south west}{%
- \calculateradii%
- \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{-\anchorradius}{-\anchorradius}}}%
- %
- % Background path.
- %
- \backgroundpath{%
- \calculateradii%
- \pgfpathmoveto{%
- \pgfpointadd{\centerpoint}{\pgfqpointpolar{\startangle}{\radius}}%
- }%
- \let\angle\startangle%
- \pgfmathloop%
- \ifnum\pgfmathcounter=\sides\relax%
- \pgfpathclose%
- \else%
- \pgfmathadd@{\angle}{\anglestep}%
- \let\angle\pgfmathresult%
- \pgfpathlineto{%
- \pgfpointadd{\centerpoint}{\pgfqpointpolar{\angle}{\radius}}%
- }%
- \repeatpgfmathloop%
- }%
- \anchorborder{%
- %
- % Save x and y.
- %
- \edef\externalx{\the\pgf@x}%
- \edef\externaly{\the\pgf@y}%
- %
- % Adjust the location of the external
- % point relative to \centerpoint.
- %
- \centerpoint%
- \pgf@xa\externalx\relax%
- \pgf@ya\externaly\relax%
- \advance\pgf@xa\pgf@x%
- \advance\pgf@ya\pgf@y%
- \edef\externalx{\the\pgf@xa}%
- \edef\externaly{\the\pgf@ya}%
- %
- % Get the angle of the external point to the \centerpoint.
- %
- \pgfmathanglebetweenpoints{\centerpoint}{\pgfqpoint{\externalx}{\externaly}}%
- %
- % Locate the appropriate sides on the polygon border...
- %
- \pgfmathsubtract@{\pgfmathresult}{\startangle}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \pgfmathdivide@{\pgfmathresult}{\anglestep}%
- \pgfmathfloor@{\pgfmathresult}%
- \pgfmathmultiply@{\pgfmathresult}{\anglestep}%
- \pgfmathadd@{\pgfmathresult}{\startangle}%
- \let\firstangle\pgfmathresult%
- \pgfmathadd@{\pgfmathresult}{\anglestep}%
- \let\secondangle\pgfmathresult%
- \calculateradii%
- %
- % ...and thus, the point on the polygon border.
- %
- \pgfpointintersectionoflines{\centerpoint}{\pgfpoint{+\externalx}{+\externaly}}%
- {%
- \pgfpointadd{\centerpoint}%
- {\pgfqpointpolar{+\firstangle}{+\anchorradius}}%
- }%
- {%
- \pgfpointadd{\centerpoint}%
- {\pgfqpointpolar{+\secondangle}{+\anchorradius}}%
- }%
- }
- %
- % More hackery for when the recuglar polygon is positioned using
- % a `corner <n+1>' or `side <n+1>' anchor, where n is the maximum
- % number of sides of any previously drawn regular polygon.
- %
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@regular polygon\endcsname{%
- \c@pgf@counta\sides\relax%
- \pgfmathloop%
- \ifnum\c@pgf@counta>0\relax%
- \pgfutil@ifundefined{pgf@anchor@regular polygon@corner\space\the\c@pgf@counta}{%
- %
- % ...(manually \xdef as \gdef is normally used by \anchor)...
- %
- \expandafter\xdef\csname pgf@anchor@regular polygon@corner\space\the\c@pgf@counta\endcsname{%
- \noexpand\calculateradii%
- \noexpand\pgfmathsubtract@{\the\c@pgf@counta}{1}%
- \noexpand\pgfmathmultiply@{\noexpand\pgfmathresult}{\noexpand\anglestep}%
- \noexpand\pgfmathadd@{\noexpand\pgfmathresult}{\noexpand\startangle}%
- \noexpand\let\noexpand\angle\noexpand\pgfmathresult%
- \noexpand\pgfpointadd{\noexpand\centerpoint}%
- {\noexpand\pgfqpointpolar{\noexpand\angle}{\noexpand\anchorradius}}%
- }%
- \expandafter\xdef\csname pgf@anchor@regular polygon@side\space\the\c@pgf@counta\endcsname{%
- \noexpand\calculateradii%
- \noexpand\pgfmathsubtract@{\the\c@pgf@counta}{1}%
- \noexpand\pgfmathmultiply@{\noexpand\pgfmathresult}{\noexpand\anglestep}%
- \noexpand\pgfmathadd@{\noexpand\pgfmathresult}{\noexpand\startangle}%
- \noexpand\let\noexpand\firstangle\noexpand\pgfmathresult%
- \noexpand\pgfmathadd@{\noexpand\pgfmathresult}{\noexpand\anglestep}%
- \noexpand\let\noexpand\secondangle\noexpand\pgfmathresult%
- \noexpand\pgfpointlineattime{0.5}%
- {\noexpand\pgfpointadd{\noexpand\centerpoint}%
- {\noexpand\pgfqpointpolar{\noexpand\firstangle}{\noexpand\anchorradius}}}%
- {\noexpand\pgfpointadd{\noexpand\centerpoint}%
- {\noexpand\pgfqpointpolar{\noexpand\secondangle}{\noexpand\anchorradius}}}%
- }%
- }{\c@pgf@counta0\relax}%
- \advance\c@pgf@counta-1\relax%
- \repeatpgfmathloop%
- }%
-}
+\pgfdeclareshape{regular polygon}{%
+ \savedmacro\sides{%
+ \pgfmathtruncatemacro\sides{\pgfkeysvalueof{/pgf/regular polygon sides}}%
+ }%
+ \savedmacro\anglestep{%
+ \pgfmathdivide{360}{\pgfkeysvalueof{/pgf/regular polygon sides}}%
+ \let\anglestep\pgfmathresult%
+ }%
+ \savedmacro\calculateradii{%
+ %
+ % Get the node dimensions.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y.5\dp\pgfnodeparttextbox%
+ \ifdim\pgf@y>\pgf@x%
+ \pgf@x\pgf@y%
+ \fi%
+ %
+ % Calculate i, the incircle radius
+ %
+ \pgf@x1.41421\pgf@x%
+ %
+ % Calculate r, the polygon radius
+ %
+ % r = i / cos(360 / s / 2)
+ %
+ % (s = polygon sides)
+ %
+ \pgfmathdivide{180}{\pgfkeysvalueof{/pgf/regular polygon sides}}%
+ \pgfmathsec@{\pgfmathresult}%
+ \pgf@x\pgfmathresult\pgf@x%
+ %
+ % Accommodate the minimum width/height.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@ya>\pgf@xa%
+ \pgf@xa\pgf@ya%
+ \fi%
+ \ifdim\pgf@x<.5\pgf@xa%
+ \pgf@x.5\pgf@xa%
+ \fi%
+ \edef\radius{\the\pgf@x}%
+ %
+ % Now calculate the anchor radius from the outer sep.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@ya>\pgf@xa%
+ \pgf@xa\pgf@ya%
+ \fi
+ %
+ % Take into account the miter length.
+ %
+ % m = o / sin (90 - (360 / s / 2))
+ %
+ % (o = outer sep, s = sides)
+ %
+ \pgfmathdivide{180}{\pgfkeysvalueof{/pgf/regular polygon sides}}%
+ \pgfmathsubtract@{90}{\pgfmathresult}%
+ \pgfmathcosec@{\pgfmathresult}%
+ \advance\pgf@x\pgfmathresult\pgf@xa%
+ \edef\anchorradius{\the\pgf@x}%
+ %
+ % Save both radii.
+ %
+ \addtosavedmacro{\radius}%
+ \addtosavedmacro{\anchorradius}%
+ }%
+ \savedmacro\startangle{%
+ \pgfmathdivide{360}{\pgfkeysvalueof{/pgf/regular polygon sides}}%
+ \let\anglestep\pgfmathresult%
+ \pgfmathtruncatemacro\sides{\pgfkeysvalueof{/pgf/regular polygon sides}}%
+ \expandafter\ifodd\sides\relax%
+ \edef\pgfmathresult{90}%
+ \else%
+ \pgfmathdivide@{\anglestep}{2}%
+ \pgfmathsubtract@{90}{\pgfmathresult}%
+ \fi%
+ \pgfmathadd{\pgfmathresult}{\pgfkeysvalueof{/pgf/shape border rotate}}%
+ \let\startangle\pgfmathresult%
+ }%
+ %
+ % Saved anchors.
+ %
+ \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{+.5ex}%
+ }%
+ %
+ % Other anchors.
+ %
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\midpoint}%
+ \anchor{base}{\centerpoint\pgf@y=0pt}%
+ \anchor{north}{%
+ \calculateradii%
+ \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{0pt}{\anchorradius}}}%
+ \anchor{south}{%
+ \calculateradii%
+ \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{0pt}{-\anchorradius}}}%
+ \anchor{east}{%
+ \calculateradii%
+ \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{\anchorradius}{0pt}}}%
+ \anchor{west}{%
+ \calculateradii%
+ \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{-\anchorradius}{0pt}}}%
+ \anchor{north east}{%
+ \calculateradii%
+ \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{\anchorradius}{\anchorradius}}}%
+ \anchor{north west}{%
+ \calculateradii%
+ \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{-\anchorradius}{\anchorradius}}}%
+ \anchor{south east}{%
+ \calculateradii%
+ \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{\anchorradius}{-\anchorradius}}}%
+ \anchor{south west}{%
+ \calculateradii%
+ \csname pgf@anchor@regular polygon@border\endcsname{\pgfqpoint{-\anchorradius}{-\anchorradius}}}%
+ %
+ % Background path.
+ %
+ \backgroundpath{%
+ \calculateradii%
+ \pgfpathmoveto{%
+ \pgfpointadd{\centerpoint}{\pgfqpointpolar{\startangle}{\radius}}%
+ }%
+ \let\angle\startangle%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter=\sides\relax%
+ \pgfpathclose%
+ \else%
+ \pgfmathadd@{\angle}{\anglestep}%
+ \let\angle\pgfmathresult%
+ \pgfpathlineto{%
+ \pgfpointadd{\centerpoint}{\pgfqpointpolar{\angle}{\radius}}%
+ }%
+ \repeatpgfmathloop%
+ }%
+ \anchorborder{%
+ %
+ % Save x and y.
+ %
+ \edef\externalx{\the\pgf@x}%
+ \edef\externaly{\the\pgf@y}%
+ %
+ % Adjust the location of the external
+ % point relative to \centerpoint.
+ %
+ \centerpoint%
+ \pgf@xa\externalx\relax%
+ \pgf@ya\externaly\relax%
+ \advance\pgf@xa\pgf@x%
+ \advance\pgf@ya\pgf@y%
+ \edef\externalx{\the\pgf@xa}%
+ \edef\externaly{\the\pgf@ya}%
+ %
+ % Get the angle of the external point to the \centerpoint.
+ %
+ \pgfmathanglebetweenpoints{\centerpoint}{\pgfqpoint{\externalx}{\externaly}}%
+ %
+ % Locate the appropriate sides on the polygon border...
+ %
+ \pgfmathsubtract@{\pgfmathresult}{\startangle}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \pgfmathdivide@{\pgfmathresult}{\anglestep}%
+ \pgfmathfloor@{\pgfmathresult}%
+ \pgfmathmultiply@{\pgfmathresult}{\anglestep}%
+ \pgfmathadd@{\pgfmathresult}{\startangle}%
+ \let\firstangle\pgfmathresult%
+ \pgfmathadd@{\pgfmathresult}{\anglestep}%
+ \let\secondangle\pgfmathresult%
+ \calculateradii%
+ %
+ % ...and thus, the point on the polygon border.
+ %
+ \pgfpointintersectionoflines{\centerpoint}{\pgfpoint{+\externalx}{+\externaly}}%
+ {%
+ \pgfpointadd{\centerpoint}%
+ {\pgfqpointpolar{+\firstangle}{+\anchorradius}}%
+ }%
+ {%
+ \pgfpointadd{\centerpoint}%
+ {\pgfqpointpolar{+\secondangle}{+\anchorradius}}%
+ }%
+ }%
+ %
+ % More hackery for when the rectangular polygon is positioned using
+ % a `corner <n+1>' or `side <n+1>' anchor, where n is the maximum
+ % number of sides of any previously drawn regular polygon.
+ %
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@regular polygon\endcsname{%
+ \c@pgf@counta\sides\relax%
+ \pgfmathloop%
+ \ifnum\c@pgf@counta>0\relax%
+ \pgfutil@ifundefined{pgf@anchor@regular polygon@corner\space\the\c@pgf@counta}{%
+ %
+ % ...(manually \xdef as \gdef is normally used by \anchor)...
+ %
+ \expandafter\xdef\csname pgf@anchor@regular polygon@corner\space\the\c@pgf@counta\endcsname{%
+ \noexpand\calculateradii%
+ \noexpand\pgfmathsubtract@{\the\c@pgf@counta}{1}%
+ \noexpand\pgfmathmultiply@{\noexpand\pgfmathresult}{\noexpand\anglestep}%
+ \noexpand\pgfmathadd@{\noexpand\pgfmathresult}{\noexpand\startangle}%
+ \noexpand\let\noexpand\angle\noexpand\pgfmathresult%
+ \noexpand\pgfpointadd{\noexpand\centerpoint}%
+ {\noexpand\pgfqpointpolar{\noexpand\angle}{\noexpand\anchorradius}}%
+ }%
+ \expandafter\xdef\csname pgf@anchor@regular polygon@side\space\the\c@pgf@counta\endcsname{%
+ \noexpand\calculateradii%
+ \noexpand\pgfmathsubtract@{\the\c@pgf@counta}{1}%
+ \noexpand\pgfmathmultiply@{\noexpand\pgfmathresult}{\noexpand\anglestep}%
+ \noexpand\pgfmathadd@{\noexpand\pgfmathresult}{\noexpand\startangle}%
+ \noexpand\let\noexpand\firstangle\noexpand\pgfmathresult%
+ \noexpand\pgfmathadd@{\noexpand\pgfmathresult}{\noexpand\anglestep}%
+ \noexpand\let\noexpand\secondangle\noexpand\pgfmathresult%
+ \noexpand\pgfpointlineattime{0.5}%
+ {\noexpand\pgfpointadd{\noexpand\centerpoint}%
+ {\noexpand\pgfqpointpolar{\noexpand\firstangle}{\noexpand\anchorradius}}}%
+ {\noexpand\pgfpointadd{\noexpand\centerpoint}%
+ {\noexpand\pgfqpointpolar{\noexpand\secondangle}{\noexpand\anchorradius}}}%
+ }%
+ }{\c@pgf@counta0\relax}%
+ \advance\c@pgf@counta-1\relax%
+ \repeatpgfmathloop%
+ }%
+}%
@@ -930,15 +928,15 @@
% /pgf/trapezium right angle : angle of the right side.
\pgfkeys{/pgf/.cd,
- trapezium left angle/.initial=60,
- trapezium right angle/.initial=60,
- trapezium angle/.style={
- /pgf/trapezium left angle=#1,
- /pgf/trapezium right angle=#1
- },%
- trapezium stretches/.is if=pgf@lib@sh@trapeziumstretches,%
- trapezium stretches body/.is if=pgf@lib@sh@trapeziumstretchesbody%
-}
+ trapezium left angle/.initial=60,
+ trapezium right angle/.initial=60,
+ trapezium angle/.style={
+ /pgf/trapezium left angle=#1,
+ /pgf/trapezium right angle=#1
+ },%
+ trapezium stretches/.is if=pgf@lib@sh@trapeziumstretches,%
+ trapezium stretches body/.is if=pgf@lib@sh@trapeziumstretchesbody,%
+}%
\newif\ifpgf@lib@sh@trapeziumstretchesbody
\newif\ifpgf@lib@sh@trapeziumstretches
@@ -946,1394 +944,1394 @@
% Shape trapezium.
%
-\pgfdeclareshape{trapezium}{
- \savedmacro\installtrapeziumparameters{%
- %
- % Get the node dimensions.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\dp\pgfnodeparttextbox%
- \ifpgfshapeborderusesincircle%
- %
- % Get the rotation (no rounding).
- %
- \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
- %
- % Use the radius of the incircle if required...
- %
- \ifdim\pgf@x<\pgf@y%
- \pgf@x\pgf@y%
- \fi%
- \pgf@x1.41421\pgf@x%
- \pgf@y\pgf@x%
- \else%
- %
- % Get the rotation (with rounding).
- %
- \pgfmathmod{\pgfkeysvalueof{/pgf/shape border rotate}}{360}%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \expandafter\c@pgf@counta\pgfmathresult\relax\pgfmath@%
- \advance\c@pgf@counta45\relax%
- \divide\c@pgf@counta90\relax%
- \multiply\c@pgf@counta90\relax%
- \ifnum\c@pgf@counta<0\relax%
- \advance\c@pgf@counta360\relax%
- \fi%
- \edef\rotate{\the\c@pgf@counta}%
- %
- % Calculate the width and height of the node
- % contents, according to any border rotation.
- %
- \ifnum\c@pgf@counta=90\relax%
- \pgf@xc\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y\pgf@xc%
- \else%
- \ifnum\c@pgf@counta=270\relax%
- \pgf@xc\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y\pgf@xc%
- \fi%
- \fi%
- \fi%
- \pgfmathmod{\pgfkeysvalueof{/pgf/trapezium left angle}}{360}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \let\leftangle\pgfmathresult%
- \ifdim\leftangle pt=0pt\relax%
- \def\pgfmathresult{0}%
- \else%
- \pgfmathcot@{\leftangle}%
- \fi%
- \pgf@xa2\pgf@y%
- \pgf@xa\pgfmathresult\pgf@xa%
- \pgfmathmod{\pgfkeysvalueof{/pgf/trapezium right angle}}{360}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \let\rightangle\pgfmathresult%
- \ifdim\rightangle pt=0pt\relax%
- \def\pgfmathresult{0}%
- \else%
- \pgfmathcot@{\rightangle}%
- \fi%
- \pgf@xb2\pgf@y%
- \pgf@xb\pgfmathresult\pgf@xb%
- %
- % Take into account minimum height and width.
- %
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@y<.5\pgf@ya%
- \ifpgf@lib@sh@trapeziumstretches%
- \pgf@y.5\pgf@ya%
- \else%
- \ifpgf@lib@sh@trapeziumstretchesbody%
- \pgf@y.5\pgf@ya%
- \else%
- \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@y}}%
- \pgf@yb.5\pgf@ya%
- \pgf@yb\pgfmathresult\pgf@yb%
- \pgf@y.5\pgf@ya%
- \pgf@x\pgfmath@tonumber{\pgf@yb}\pgf@x%
- \pgf@xa\pgfmath@tonumber{\pgf@yb}\pgf@xa%
- \pgf@xb\pgfmath@tonumber{\pgf@yb}\pgf@xb%
- \fi%
- \fi%
- \fi%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum width}}%
- \pgf@xc2\pgf@x%
- \ifdim\pgf@xa<0pt\relax%
- \advance\pgf@xc-\pgf@xa%
- \else%
- \advance\pgf@xc\pgf@xa%
- \fi%
- \ifdim\pgf@xb<0pt\relax%
- \advance\pgf@xc-\pgf@xb%
- \else%
- \advance\pgf@xc\pgf@xb%
- \fi%
- \ifdim\pgf@xc<\pgf@ya%
- \ifpgf@lib@sh@trapeziumstretchesbody%
- \pgf@xc-\pgf@xc%
- \advance\pgf@xc\pgf@ya%
- \advance\pgf@x.5\pgf@xc%
- \else%
- \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@xc}}%
- \pgf@ya\pgfmathresult\pgf@ya%
- \pgf@x\pgfmath@tonumber{\pgf@ya}\pgf@x%
- \pgf@xa\pgfmath@tonumber{\pgf@ya}\pgf@xa%
- \pgf@xb\pgfmath@tonumber{\pgf@ya}\pgf@xb%
- \ifpgf@lib@sh@trapeziumstretches%
- \else%
- \pgf@y\pgfmath@tonumber{\pgf@ya}\pgf@y%
- \fi%
- \fi%
- \fi%
- \edef\halfheight{\the\pgf@y}%
- \edef\halfwidth{\the\pgf@x}%
- \edef\leftextension{\the\pgf@xa}%
- \edef\rightextension{\the\pgf@xb}%
- \pgf@xc2\pgf@x%
- %
- % Take the larger of the outer sep.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- \ifdim\pgf@y>\pgf@x%
- \pgf@x\pgf@y%
- \fi%
- \edef\outersep{\the\pgf@x}%
- %
- % The \externalradius is a length that is
- % guarenteed to produce a point outside the trapezium.
- %
- \advance\pgf@xc2.0\pgf@x%
- \pgf@yc\halfheight\relax%
- \multiply\pgf@yc2\relax%
- \advance\pgf@yc2.0\pgf@x%
- \ifdim\pgf@xc<\pgf@yc%
- \edef\externalradius{\the\pgf@yc}%
- \else%
- \edef\externalradius{\the\pgf@xc}%
- \fi%
- %
- % Calculate the centre base and mid poins of the node.
- %
- \pgfextract@process\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }%
- \pgfextract@process\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt\relax%
- }%
- \pgfextract@process\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+.5ex}%
- }%
- %
- % Calculate each point on the trapezium (without rotation).
- %
- \pgfextract@process\lowerleftpoint{%
- \centerpoint%
- \advance\pgf@x-\halfwidth\relax%
- \ifdim\leftextension>0pt\relax%
- \advance\pgf@x-\leftextension\relax%
- \fi%
- \advance\pgf@y-\halfheight\relax%
- }%
- \pgfextract@process\upperleftpoint{%
- \centerpoint%
- \advance\pgf@x-\halfwidth\relax%
- \ifdim\leftextension<0pt\relax%
- \advance\pgf@x\leftextension\relax%
- \fi%
- \advance\pgf@y\halfheight\relax%
- }%
- \pgfextract@process\upperrightpoint{%
- \centerpoint%
- \advance\pgf@x\halfwidth\relax%
- \ifdim\rightextension<0pt\relax%
- \advance\pgf@x-\rightextension\relax%
- \fi%
- \advance\pgf@y\halfheight\relax%
- }%
- \pgfextract@process\lowerrightpoint{%
- \centerpoint%
- \advance\pgf@x\halfwidth\relax%
- \ifdim\rightextension>0pt\relax%
- \advance\pgf@x\rightextension\relax%
- \fi%
- \advance\pgf@y-\halfheight\relax%
- }%
- %
- % Now calculate the adjustment for the miter length at each corner
- % of the trapezium. This ensures more accurate anchor positioning
- % when the line width is particularly thick.
- %
- \pgfextract@process\lowerleftmiter{%
- \pgfmathanglebetweenlines{\lowerleftpoint}{\lowerrightpoint}{\lowerleftpoint}{\upperleftpoint}%
- \pgfmathmultiply@{\pgfmathresult}{.5}%
- \pgfmathtan@{\pgfmathresult}%
- \pgfmathreciprocal@{\pgfmathresult}%
- \pgf@x-\outersep\relax%
- \pgf@x\pgfmathresult\pgf@x%
- \pgf@y-\outersep\relax%
- }%
- \pgfextract@process\upperleftmiter{%
- \pgfmathanglebetweenlines{\upperleftpoint}{\lowerleftpoint}{\upperleftpoint}{\upperrightpoint}%
- \pgfmathmultiply@{\pgfmathresult}{.5}%
- \pgfmathtan@{\pgfmathresult}%
- \pgfmathreciprocal@{\pgfmathresult}%
- \pgf@x-\outersep\relax%
- \pgf@x\pgfmathresult\pgf@x%
- \pgf@y\outersep\relax%
- }%
- \pgfextract@process\upperrightmiter{%
- \pgfmathanglebetweenlines{\upperrightpoint}{\upperleftpoint}{\upperrightpoint}{\lowerrightpoint}%
- \pgfmathmultiply@{\pgfmathresult}{.5}%
- \pgfmathtan@{\pgfmathresult}%
- \pgfmathreciprocal@{\pgfmathresult}%
- \pgf@x\outersep\relax%
- \pgf@x\pgfmathresult\pgf@x%
- \pgf@y\outersep\relax%
- }%
- \pgfextract@process\lowerrightmiter{%
- \pgfmathanglebetweenlines{\lowerrightpoint}{\upperrightpoint}{\lowerrightpoint}{\lowerleftpoint}%
- \pgfmathmultiply@{\pgfmathresult}{.5}%
- \pgfmathtan@{\pgfmathresult}%
- \pgfmathreciprocal@{\pgfmathresult}%
- \pgf@x\outersep\relax%
- \pgf@x\pgfmathresult\pgf@x%
- \pgf@y-\outersep\relax%
- }%
- %
- % Now calculate the corners for determining anchor border
- % points, by adding the adjustment for the miter length.
- %
- \pgfextract@process\lowerleftborderpoint{%
- \pgfpointadd{\lowerleftpoint}{\lowerleftmiter}%
- }%
- \pgfextract@process\upperleftborderpoint{%
- \pgfpointadd{\upperleftpoint}{\upperleftmiter}%
- }%
- \pgfextract@process\upperrightborderpoint{%
- \pgfpointadd{\upperrightpoint}{\upperrightmiter}%
- }%
- \pgfextract@process\lowerrightborderpoint{%
- \pgfpointadd{\lowerrightpoint}{\lowerrightmiter}%
- }%
- %
- % Calulate the angle from the centerpoint to each corner.
- % Rotation is not important here (see \anchorborder code).
- %
- \pgfmathanglebetweenpoints{\centerpoint}{\lowerleftborderpoint}%
- \let\angletolowerleft\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\upperleftborderpoint}%
- \let\angletoupperleft\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\upperrightborderpoint}%
- \let\angletoupperright\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\lowerrightborderpoint}%
- \let\angletolowerright\pgfmathresult%
- %
- % Do the same for the *inversely rotated* base point...
- %
- \pgfextract@process\rotatedbasepoint{%
- \pgfmathrotatepointaround{\basepoint}{\centerpoint}{-\rotate}%
- }%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\lowerleftborderpoint}%
- \let\baseangletolowerleft\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\upperleftborderpoint}%
- \let\baseangletoupperleft\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\upperrightborderpoint}%
- \let\baseangletoupperright\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\lowerrightborderpoint}%
- \let\baseangletolowerright\pgfmathresult%
- %
- % And the *inversely rotated* mid point...
- %
- \pgfextract@process\rotatedmidpoint{%
- \pgfmathrotatepointaround{\midpoint}{\centerpoint}{-\rotate}%
- }%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\lowerleftborderpoint}%
- \let\midangletolowerleft\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\upperleftborderpoint}%
- \let\midangletoupperleft\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\upperrightborderpoint}%
- \let\midangletoupperright\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\lowerrightborderpoint}%
- \let\midangletolowerright\pgfmathresult%
- %
- % Now rotate the border points around the centerpoint...
- %
- \pgfextract@process\lowerleftborderpoint{%
- \pgfmathrotatepointaround%
- {\lowerleftborderpoint}%
- {\centerpoint}%
- {\rotate}%
- }%
- \pgfextract@process\upperleftborderpoint{%
- \pgfmathrotatepointaround%
- {\upperleftborderpoint}%
- {\centerpoint}%
- {\rotate}%
- }%
- \pgfextract@process\upperrightborderpoint{%
- \pgfmathrotatepointaround%
- {\upperrightborderpoint}%
- {\centerpoint}%
- {\rotate}%
- }%
- \pgfextract@process\lowerrightborderpoint{%
- \pgfmathrotatepointaround%
- {\lowerrightborderpoint}%
- {\centerpoint}%
- {\rotate}%
- }%
- %
- % ...and the points for drawing the border (i.e. no outer sep).
- %
- \pgfextract@process\lowerleftpoint{%
- \pgfmathrotatepointaround{\lowerleftpoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\upperleftpoint{%
- \pgfmathrotatepointaround{\upperleftpoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\upperrightpoint{%
- \pgfmathrotatepointaround{\upperrightpoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\lowerrightpoint{%
- \pgfmathrotatepointaround{\lowerrightpoint}{\centerpoint}{\rotate}%
- }%
- %
- % And finally, save all the relevant stuff.
- %
- \addtosavedmacro{\lowerleftpoint}%
- \addtosavedmacro{\upperleftpoint}%
- \addtosavedmacro{\upperrightpoint}%
- \addtosavedmacro{\lowerrightpoint}%
- %
- \addtosavedmacro{\lowerleftborderpoint}%
- \addtosavedmacro{\upperleftborderpoint}%
- \addtosavedmacro{\upperrightborderpoint}%
- \addtosavedmacro{\lowerrightborderpoint}%
- %
- \addtosavedmacro{\angletolowerleft}%
- \addtosavedmacro{\angletoupperleft}%
- \addtosavedmacro{\angletoupperright}%
- \addtosavedmacro{\angletolowerright}%
- %
- \addtosavedmacro{\baseangletolowerleft}%
- \addtosavedmacro{\baseangletoupperleft}%
- \addtosavedmacro{\baseangletoupperright}%
- \addtosavedmacro{\baseangletolowerright}%
- %
- \addtosavedmacro{\midangletolowerleft}%
- \addtosavedmacro{\midangletoupperleft}%
- \addtosavedmacro{\midangletoupperright}%
- \addtosavedmacro{\midangletolowerright}%
- %
- \addtosavedmacro{\rotate}%
- \addtosavedmacro{\externalradius}%
- }
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }%
- \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{base}{\basepoint}%
- \anchor{base east}{%
- \installtrapeziumparameters%
- \let\pgf@trapeziumanchorborderreferencepoint\basepoint%
- \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }
- \anchor{base west}{%
- \installtrapeziumparameters%
- \let\pgf@trapeziumanchorborderreferencepoint\basepoint%
- \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }%
- \anchor{mid}{\midpoint}%
- \anchor{mid east}{%
- \installtrapeziumparameters%
- \let\pgf@trapeziumanchorborderreferencepoint\midpoint%
- \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }
- \anchor{mid west}{%
- \installtrapeziumparameters%
- \let\pgf@trapeziumanchorborderreferencepoint\midpoint%
- \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }%
- \anchor{north}{%
- \installtrapeziumparameters%
- \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{0pt}{\externalradius}}%
- }
- \anchor{south}{%
- \installtrapeziumparameters%
- \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{0pt}{-\externalradius}}%
- }
- \anchor{east}{%
- \installtrapeziumparameters%
- \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }
- \anchor{west}{%
- \installtrapeziumparameters%
- \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }
- \anchor{north east}{%
- \installtrapeziumparameters%
- \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{\externalradius}{\externalradius}}%
- }
- \anchor{south west}{%
- \installtrapeziumparameters%
- \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{-\externalradius}{-\externalradius}}%
- }
- \anchor{south east}{%
- \installtrapeziumparameters%
- \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{\externalradius}{-\externalradius}}%
- }
- \anchor{north west}{%
- \installtrapeziumparameters%
- \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{-\externalradius}{\externalradius}}%
- }
- \anchor{bottom left corner}{%
- \installtrapeziumparameters%
- \lowerleftborderpoint%
- }%
- \anchor{top left corner}{%
- \installtrapeziumparameters%
- \upperleftborderpoint%
- }%
- \anchor{top right corner}{%
- \installtrapeziumparameters%
- \upperrightborderpoint%
- }%
- \anchor{bottom right corner}{%
- \installtrapeziumparameters%
- \lowerrightborderpoint%
- }%
- \anchor{left side}{%
- \installtrapeziumparameters%
- \pgfpointlineattime{0.5}{\lowerleftborderpoint}{\upperleftborderpoint}%
- }%
- \anchor{right side}{%
- \installtrapeziumparameters%
- \pgfpointlineattime{0.5}{\lowerrightborderpoint}{\upperrightborderpoint}%
- }%
- \anchor{top side}{%
- \installtrapeziumparameters%
- \pgfpointlineattime{0.5}{\upperleftborderpoint}{\upperrightborderpoint}%
- }%
- \anchor{bottom side}{%
- \installtrapeziumparameters%
- \pgfpointlineattime{0.5}{\lowerleftborderpoint}{\lowerrightborderpoint}%
- }%
- \backgroundpath{%
- \installtrapeziumparameters%
- \pgfpathmoveto{\lowerleftpoint}%
- \pgfpathlineto{\upperleftpoint}%
- \pgfpathlineto{\upperrightpoint}%
- \pgfpathlineto{\lowerrightpoint}%
- \pgfpathclose%
- }
- \anchorborder{%
- %
- % Save x and y.
- %
- \edef\externalx{\the\pgf@x}%
- \edef\externaly{\the\pgf@y}%
- %
- % This allows anchors base east, base west, mid east and mid west,
- % to redefine the `center' of the node to correctly calculate the
- % border points.
- %
- \pgfutil@ifundefined{pgf@trapeziumanchorborderreferencepoint}%
- {\let\referencepoint\centerpoint}%
- {\let\referencepoint\pgf@trapeziumanchorborderreferencepoint}%
- %
- % Adjust the location of the external
- % point relative to the reference point.
- %
- \referencepoint%
- \pgf@xa\externalx\relax%
- \pgf@ya\externaly\relax%
- \advance\pgf@xa\pgf@x%
- \advance\pgf@ya\pgf@y%
- \edef\externalx{\the\pgf@xa}%
- \edef\externaly{\the\pgf@ya}%
- %
- % Install the required points and angles.
- %
- \installtrapeziumparameters%
- %
- % Get the angle of the external point to the \referencepoint.
- %
- \pgfmathanglebetweenpoints{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
- %
- % *Subtract* the rotation from the external angle. This is
- % why the border point angles do not neeed to be rotated.
- %
- \pgfmathsubtract@{\pgfmathresult}{\rotate}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- %
- % Get the relevant angles for the reference point.
- %
- \let\externalangle\pgfmathresult%
- \ifx\referencepoint\basepoint%
- \let\angletoupperright\baseangletoupperright%
- \let\angletoupperleft\baseangletoupperleft%
- \let\angletolowerright\baseangletolowerright%
- \let\angletolowerleft\baseangletolowerleft%
- \else%
- \ifx\referencepoint\midpoint%
- \let\angletoupperright\midangletoupperright%
- \let\angletoupperleft\midangletoupperleft%
- \let\angletolowerright\midangletolowerright%
- \let\angletolowerleft\midangletolowerleft%
- \fi\fi%
- %
- % Find the line on the border...
- %
- \ifdim\externalangle pt<\angletoupperright pt\relax%
- \let\firstpoint\upperrightborderpoint%
- \let\secondpoint\lowerrightborderpoint%
- \else%
- \ifdim\externalangle pt<\angletoupperleft pt\relax%
- \let\firstpoint\upperleftborderpoint%
- \let\secondpoint\upperrightborderpoint%
- \else%
- \ifdim\externalangle pt<\angletolowerleft pt\relax%
- \let\firstpoint\upperleftborderpoint%
- \let\secondpoint\lowerleftborderpoint%
- \else%
- \ifdim\externalangle pt<\angletolowerright pt\relax%
- \let\firstpoint\lowerleftborderpoint%
- \let\secondpoint\lowerrightborderpoint%
- \else%
- \let\firstpoint\upperrightborderpoint%
- \let\secondpoint\lowerrightborderpoint%
- \fi%
- \fi%
- \fi%
- \fi%
- %
- % ...and thus the point on the border.
- %
- \pgfpointintersectionoflines{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
- {\firstpoint}{\secondpoint}%
- }%
-}
+\pgfdeclareshape{trapezium}{%
+ \savedmacro\installtrapeziumparameters{%
+ %
+ % Get the node dimensions.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y.5\dp\pgfnodeparttextbox%
+ \ifpgfshapeborderusesincircle%
+ %
+ % Get the rotation (no rounding).
+ %
+ \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
+ %
+ % Use the radius of the incircle if required...
+ %
+ \ifdim\pgf@x<\pgf@y%
+ \pgf@x\pgf@y%
+ \fi%
+ \pgf@x1.41421\pgf@x%
+ \pgf@y\pgf@x%
+ \else%
+ %
+ % Get the rotation (with rounding).
+ %
+ \pgfmathmod{\pgfkeysvalueof{/pgf/shape border rotate}}{360}%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter\c@pgf@counta\pgfmathresult\relax\pgfmath@%
+ \advance\c@pgf@counta45\relax%
+ \divide\c@pgf@counta90\relax%
+ \multiply\c@pgf@counta90\relax%
+ \ifnum\c@pgf@counta<0\relax%
+ \advance\c@pgf@counta360\relax%
+ \fi%
+ \edef\rotate{\the\c@pgf@counta}%
+ %
+ % Calculate the width and height of the node
+ % contents, according to any border rotation.
+ %
+ \ifnum\c@pgf@counta=90\relax%
+ \pgf@xc\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y\pgf@xc%
+ \else%
+ \ifnum\c@pgf@counta=270\relax%
+ \pgf@xc\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y\pgf@xc%
+ \fi%
+ \fi%
+ \fi%
+ \pgfmathmod{\pgfkeysvalueof{/pgf/trapezium left angle}}{360}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \let\leftangle\pgfmathresult%
+ \ifdim\leftangle pt=0pt\relax%
+ \def\pgfmathresult{0}%
+ \else%
+ \pgfmathcot@{\leftangle}%
+ \fi%
+ \pgf@xa2\pgf@y%
+ \pgf@xa\pgfmathresult\pgf@xa%
+ \pgfmathmod{\pgfkeysvalueof{/pgf/trapezium right angle}}{360}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \let\rightangle\pgfmathresult%
+ \ifdim\rightangle pt=0pt\relax%
+ \def\pgfmathresult{0}%
+ \else%
+ \pgfmathcot@{\rightangle}%
+ \fi%
+ \pgf@xb2\pgf@y%
+ \pgf@xb\pgfmathresult\pgf@xb%
+ %
+ % Take into account minimum height and width.
+ %
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@y<.5\pgf@ya%
+ \ifpgf@lib@sh@trapeziumstretches%
+ \pgf@y.5\pgf@ya%
+ \else%
+ \ifpgf@lib@sh@trapeziumstretchesbody%
+ \pgf@y.5\pgf@ya%
+ \else%
+ \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@y}}%
+ \pgf@yb.5\pgf@ya%
+ \pgf@yb\pgfmathresult\pgf@yb%
+ \pgf@y.5\pgf@ya%
+ \pgf@x\pgfmath@tonumber{\pgf@yb}\pgf@x%
+ \pgf@xa\pgfmath@tonumber{\pgf@yb}\pgf@xa%
+ \pgf@xb\pgfmath@tonumber{\pgf@yb}\pgf@xb%
+ \fi%
+ \fi%
+ \fi%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgf@xc2\pgf@x%
+ \ifdim\pgf@xa<0pt\relax%
+ \advance\pgf@xc-\pgf@xa%
+ \else%
+ \advance\pgf@xc\pgf@xa%
+ \fi%
+ \ifdim\pgf@xb<0pt\relax%
+ \advance\pgf@xc-\pgf@xb%
+ \else%
+ \advance\pgf@xc\pgf@xb%
+ \fi%
+ \ifdim\pgf@xc<\pgf@ya%
+ \ifpgf@lib@sh@trapeziumstretchesbody%
+ \pgf@xc-\pgf@xc%
+ \advance\pgf@xc\pgf@ya%
+ \advance\pgf@x.5\pgf@xc%
+ \else%
+ \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@xc}}%
+ \pgf@ya\pgfmathresult\pgf@ya%
+ \pgf@x\pgfmath@tonumber{\pgf@ya}\pgf@x%
+ \pgf@xa\pgfmath@tonumber{\pgf@ya}\pgf@xa%
+ \pgf@xb\pgfmath@tonumber{\pgf@ya}\pgf@xb%
+ \ifpgf@lib@sh@trapeziumstretches%
+ \else%
+ \pgf@y\pgfmath@tonumber{\pgf@ya}\pgf@y%
+ \fi%
+ \fi%
+ \fi%
+ \edef\halfheight{\the\pgf@y}%
+ \edef\halfwidth{\the\pgf@x}%
+ \edef\leftextension{\the\pgf@xa}%
+ \edef\rightextension{\the\pgf@xb}%
+ \pgf@xc2\pgf@x%
+ %
+ % Take the larger of the outer sep.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@y>\pgf@x%
+ \pgf@x\pgf@y%
+ \fi%
+ \edef\outersep{\the\pgf@x}%
+ %
+ % The \externalradius is a length that is
+ % guarenteed to produce a point outside the trapezium.
+ %
+ \advance\pgf@xc2.0\pgf@x%
+ \pgf@yc\halfheight\relax%
+ \multiply\pgf@yc2\relax%
+ \advance\pgf@yc2.0\pgf@x%
+ \ifdim\pgf@xc<\pgf@yc%
+ \edef\externalradius{\the\pgf@yc}%
+ \else%
+ \edef\externalradius{\the\pgf@xc}%
+ \fi%
+ %
+ % Calculate the centre base and mid poins of the node.
+ %
+ \pgfextract@process\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \pgfextract@process\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt\relax%
+ }%
+ \pgfextract@process\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+.5ex}%
+ }%
+ %
+ % Calculate each point on the trapezium (without rotation).
+ %
+ \pgfextract@process\lowerleftpoint{%
+ \centerpoint%
+ \advance\pgf@x-\halfwidth\relax%
+ \ifdim\leftextension>0pt\relax%
+ \advance\pgf@x-\leftextension\relax%
+ \fi%
+ \advance\pgf@y-\halfheight\relax%
+ }%
+ \pgfextract@process\upperleftpoint{%
+ \centerpoint%
+ \advance\pgf@x-\halfwidth\relax%
+ \ifdim\leftextension<0pt\relax%
+ \advance\pgf@x\leftextension\relax%
+ \fi%
+ \advance\pgf@y\halfheight\relax%
+ }%
+ \pgfextract@process\upperrightpoint{%
+ \centerpoint%
+ \advance\pgf@x\halfwidth\relax%
+ \ifdim\rightextension<0pt\relax%
+ \advance\pgf@x-\rightextension\relax%
+ \fi%
+ \advance\pgf@y\halfheight\relax%
+ }%
+ \pgfextract@process\lowerrightpoint{%
+ \centerpoint%
+ \advance\pgf@x\halfwidth\relax%
+ \ifdim\rightextension>0pt\relax%
+ \advance\pgf@x\rightextension\relax%
+ \fi%
+ \advance\pgf@y-\halfheight\relax%
+ }%
+ %
+ % Now calculate the adjustment for the miter length at each corner
+ % of the trapezium. This ensures more accurate anchor positioning
+ % when the line width is particularly thick.
+ %
+ \pgfextract@process\lowerleftmiter{%
+ \pgfmathanglebetweenlines{\lowerleftpoint}{\lowerrightpoint}{\lowerleftpoint}{\upperleftpoint}%
+ \pgfmathmultiply@{\pgfmathresult}{.5}%
+ \pgfmathtan@{\pgfmathresult}%
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \pgf@x-\outersep\relax%
+ \pgf@x\pgfmathresult\pgf@x%
+ \pgf@y-\outersep\relax%
+ }%
+ \pgfextract@process\upperleftmiter{%
+ \pgfmathanglebetweenlines{\upperleftpoint}{\lowerleftpoint}{\upperleftpoint}{\upperrightpoint}%
+ \pgfmathmultiply@{\pgfmathresult}{.5}%
+ \pgfmathtan@{\pgfmathresult}%
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \pgf@x-\outersep\relax%
+ \pgf@x\pgfmathresult\pgf@x%
+ \pgf@y\outersep\relax%
+ }%
+ \pgfextract@process\upperrightmiter{%
+ \pgfmathanglebetweenlines{\upperrightpoint}{\upperleftpoint}{\upperrightpoint}{\lowerrightpoint}%
+ \pgfmathmultiply@{\pgfmathresult}{.5}%
+ \pgfmathtan@{\pgfmathresult}%
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \pgf@x\outersep\relax%
+ \pgf@x\pgfmathresult\pgf@x%
+ \pgf@y\outersep\relax%
+ }%
+ \pgfextract@process\lowerrightmiter{%
+ \pgfmathanglebetweenlines{\lowerrightpoint}{\upperrightpoint}{\lowerrightpoint}{\lowerleftpoint}%
+ \pgfmathmultiply@{\pgfmathresult}{.5}%
+ \pgfmathtan@{\pgfmathresult}%
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \pgf@x\outersep\relax%
+ \pgf@x\pgfmathresult\pgf@x%
+ \pgf@y-\outersep\relax%
+ }%
+ %
+ % Now calculate the corners for determining anchor border
+ % points, by adding the adjustment for the miter length.
+ %
+ \pgfextract@process\lowerleftborderpoint{%
+ \pgfpointadd{\lowerleftpoint}{\lowerleftmiter}%
+ }%
+ \pgfextract@process\upperleftborderpoint{%
+ \pgfpointadd{\upperleftpoint}{\upperleftmiter}%
+ }%
+ \pgfextract@process\upperrightborderpoint{%
+ \pgfpointadd{\upperrightpoint}{\upperrightmiter}%
+ }%
+ \pgfextract@process\lowerrightborderpoint{%
+ \pgfpointadd{\lowerrightpoint}{\lowerrightmiter}%
+ }%
+ %
+ % Calculate the angle from the centerpoint to each corner.
+ % Rotation is not important here (see \anchorborder code).
+ %
+ \pgfmathanglebetweenpoints{\centerpoint}{\lowerleftborderpoint}%
+ \let\angletolowerleft\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\upperleftborderpoint}%
+ \let\angletoupperleft\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\upperrightborderpoint}%
+ \let\angletoupperright\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\lowerrightborderpoint}%
+ \let\angletolowerright\pgfmathresult%
+ %
+ % Do the same for the *inversely rotated* base point...
+ %
+ \pgfextract@process\rotatedbasepoint{%
+ \pgfmathrotatepointaround{\basepoint}{\centerpoint}{-\rotate}%
+ }%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\lowerleftborderpoint}%
+ \let\baseangletolowerleft\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\upperleftborderpoint}%
+ \let\baseangletoupperleft\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\upperrightborderpoint}%
+ \let\baseangletoupperright\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\lowerrightborderpoint}%
+ \let\baseangletolowerright\pgfmathresult%
+ %
+ % And the *inversely rotated* mid point...
+ %
+ \pgfextract@process\rotatedmidpoint{%
+ \pgfmathrotatepointaround{\midpoint}{\centerpoint}{-\rotate}%
+ }%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\lowerleftborderpoint}%
+ \let\midangletolowerleft\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\upperleftborderpoint}%
+ \let\midangletoupperleft\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\upperrightborderpoint}%
+ \let\midangletoupperright\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\lowerrightborderpoint}%
+ \let\midangletolowerright\pgfmathresult%
+ %
+ % Now rotate the border points around the centerpoint...
+ %
+ \pgfextract@process\lowerleftborderpoint{%
+ \pgfmathrotatepointaround%
+ {\lowerleftborderpoint}%
+ {\centerpoint}%
+ {\rotate}%
+ }%
+ \pgfextract@process\upperleftborderpoint{%
+ \pgfmathrotatepointaround%
+ {\upperleftborderpoint}%
+ {\centerpoint}%
+ {\rotate}%
+ }%
+ \pgfextract@process\upperrightborderpoint{%
+ \pgfmathrotatepointaround%
+ {\upperrightborderpoint}%
+ {\centerpoint}%
+ {\rotate}%
+ }%
+ \pgfextract@process\lowerrightborderpoint{%
+ \pgfmathrotatepointaround%
+ {\lowerrightborderpoint}%
+ {\centerpoint}%
+ {\rotate}%
+ }%
+ %
+ % ...and the points for drawing the border (i.e. no outer sep).
+ %
+ \pgfextract@process\lowerleftpoint{%
+ \pgfmathrotatepointaround{\lowerleftpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\upperleftpoint{%
+ \pgfmathrotatepointaround{\upperleftpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\upperrightpoint{%
+ \pgfmathrotatepointaround{\upperrightpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\lowerrightpoint{%
+ \pgfmathrotatepointaround{\lowerrightpoint}{\centerpoint}{\rotate}%
+ }%
+ %
+ % And finally, save all the relevant stuff.
+ %
+ \addtosavedmacro{\lowerleftpoint}%
+ \addtosavedmacro{\upperleftpoint}%
+ \addtosavedmacro{\upperrightpoint}%
+ \addtosavedmacro{\lowerrightpoint}%
+ %
+ \addtosavedmacro{\lowerleftborderpoint}%
+ \addtosavedmacro{\upperleftborderpoint}%
+ \addtosavedmacro{\upperrightborderpoint}%
+ \addtosavedmacro{\lowerrightborderpoint}%
+ %
+ \addtosavedmacro{\angletolowerleft}%
+ \addtosavedmacro{\angletoupperleft}%
+ \addtosavedmacro{\angletoupperright}%
+ \addtosavedmacro{\angletolowerright}%
+ %
+ \addtosavedmacro{\baseangletolowerleft}%
+ \addtosavedmacro{\baseangletoupperleft}%
+ \addtosavedmacro{\baseangletoupperright}%
+ \addtosavedmacro{\baseangletolowerright}%
+ %
+ \addtosavedmacro{\midangletolowerleft}%
+ \addtosavedmacro{\midangletoupperleft}%
+ \addtosavedmacro{\midangletoupperright}%
+ \addtosavedmacro{\midangletolowerright}%
+ %
+ \addtosavedmacro{\rotate}%
+ \addtosavedmacro{\externalradius}%
+ }%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \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{base}{\basepoint}%
+ \anchor{base east}{%
+ \installtrapeziumparameters%
+ \let\pgf@trapeziumanchorborderreferencepoint\basepoint%
+ \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{base west}{%
+ \installtrapeziumparameters%
+ \let\pgf@trapeziumanchorborderreferencepoint\basepoint%
+ \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{mid}{\midpoint}%
+ \anchor{mid east}{%
+ \installtrapeziumparameters%
+ \let\pgf@trapeziumanchorborderreferencepoint\midpoint%
+ \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{mid west}{%
+ \installtrapeziumparameters%
+ \let\pgf@trapeziumanchorborderreferencepoint\midpoint%
+ \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{north}{%
+ \installtrapeziumparameters%
+ \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{0pt}{\externalradius}}%
+ }%
+ \anchor{south}{%
+ \installtrapeziumparameters%
+ \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{0pt}{-\externalradius}}%
+ }%
+ \anchor{east}{%
+ \installtrapeziumparameters%
+ \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{west}{%
+ \installtrapeziumparameters%
+ \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{north east}{%
+ \installtrapeziumparameters%
+ \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{\externalradius}{\externalradius}}%
+ }%
+ \anchor{south west}{%
+ \installtrapeziumparameters%
+ \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{-\externalradius}{-\externalradius}}%
+ }%
+ \anchor{south east}{%
+ \installtrapeziumparameters%
+ \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{\externalradius}{-\externalradius}}%
+ }%
+ \anchor{north west}{%
+ \installtrapeziumparameters%
+ \csname pgf@anchor@trapezium@border\endcsname{\pgfqpoint{-\externalradius}{\externalradius}}%
+ }%
+ \anchor{bottom left corner}{%
+ \installtrapeziumparameters%
+ \lowerleftborderpoint%
+ }%
+ \anchor{top left corner}{%
+ \installtrapeziumparameters%
+ \upperleftborderpoint%
+ }%
+ \anchor{top right corner}{%
+ \installtrapeziumparameters%
+ \upperrightborderpoint%
+ }%
+ \anchor{bottom right corner}{%
+ \installtrapeziumparameters%
+ \lowerrightborderpoint%
+ }%
+ \anchor{left side}{%
+ \installtrapeziumparameters%
+ \pgfpointlineattime{0.5}{\lowerleftborderpoint}{\upperleftborderpoint}%
+ }%
+ \anchor{right side}{%
+ \installtrapeziumparameters%
+ \pgfpointlineattime{0.5}{\lowerrightborderpoint}{\upperrightborderpoint}%
+ }%
+ \anchor{top side}{%
+ \installtrapeziumparameters%
+ \pgfpointlineattime{0.5}{\upperleftborderpoint}{\upperrightborderpoint}%
+ }%
+ \anchor{bottom side}{%
+ \installtrapeziumparameters%
+ \pgfpointlineattime{0.5}{\lowerleftborderpoint}{\lowerrightborderpoint}%
+ }%
+ \backgroundpath{%
+ \installtrapeziumparameters%
+ \pgfpathmoveto{\lowerleftpoint}%
+ \pgfpathlineto{\upperleftpoint}%
+ \pgfpathlineto{\upperrightpoint}%
+ \pgfpathlineto{\lowerrightpoint}%
+ \pgfpathclose%
+ }%
+ \anchorborder{%
+ %
+ % Save x and y.
+ %
+ \edef\externalx{\the\pgf@x}%
+ \edef\externaly{\the\pgf@y}%
+ %
+ % This allows anchors base east, base west, mid east and mid west,
+ % to redefine the `center' of the node to correctly calculate the
+ % border points.
+ %
+ \pgfutil@ifundefined{pgf@trapeziumanchorborderreferencepoint}%
+ {\let\referencepoint\centerpoint}%
+ {\let\referencepoint\pgf@trapeziumanchorborderreferencepoint}%
+ %
+ % Adjust the location of the external
+ % point relative to the reference point.
+ %
+ \referencepoint%
+ \pgf@xa\externalx\relax%
+ \pgf@ya\externaly\relax%
+ \advance\pgf@xa\pgf@x%
+ \advance\pgf@ya\pgf@y%
+ \edef\externalx{\the\pgf@xa}%
+ \edef\externaly{\the\pgf@ya}%
+ %
+ % Install the required points and angles.
+ %
+ \installtrapeziumparameters%
+ %
+ % Get the angle of the external point to the \referencepoint.
+ %
+ \pgfmathanglebetweenpoints{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
+ %
+ % *Subtract* the rotation from the external angle. This is
+ % why the border point angles do not neeed to be rotated.
+ %
+ \pgfmathsubtract@{\pgfmathresult}{\rotate}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ %
+ % Get the relevant angles for the reference point.
+ %
+ \let\externalangle\pgfmathresult%
+ \ifx\referencepoint\basepoint%
+ \let\angletoupperright\baseangletoupperright%
+ \let\angletoupperleft\baseangletoupperleft%
+ \let\angletolowerright\baseangletolowerright%
+ \let\angletolowerleft\baseangletolowerleft%
+ \else%
+ \ifx\referencepoint\midpoint%
+ \let\angletoupperright\midangletoupperright%
+ \let\angletoupperleft\midangletoupperleft%
+ \let\angletolowerright\midangletolowerright%
+ \let\angletolowerleft\midangletolowerleft%
+ \fi\fi%
+ %
+ % Find the line on the border...
+ %
+ \ifdim\externalangle pt<\angletoupperright pt\relax%
+ \let\firstpoint\upperrightborderpoint%
+ \let\secondpoint\lowerrightborderpoint%
+ \else%
+ \ifdim\externalangle pt<\angletoupperleft pt\relax%
+ \let\firstpoint\upperleftborderpoint%
+ \let\secondpoint\upperrightborderpoint%
+ \else%
+ \ifdim\externalangle pt<\angletolowerleft pt\relax%
+ \let\firstpoint\upperleftborderpoint%
+ \let\secondpoint\lowerleftborderpoint%
+ \else%
+ \ifdim\externalangle pt<\angletolowerright pt\relax%
+ \let\firstpoint\lowerleftborderpoint%
+ \let\secondpoint\lowerrightborderpoint%
+ \else%
+ \let\firstpoint\upperrightborderpoint%
+ \let\secondpoint\lowerrightborderpoint%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ %
+ % ...and thus the point on the border.
+ %
+ \pgfpointintersectionoflines{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
+ {\firstpoint}{\secondpoint}%
+ }%
+}%
% Shape semicircle.
%
-\pgfdeclareshape{semicircle}{
- \savedmacro\installsemicircleparameters{%
- %
- % Get the larger of the outer sep.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- \ifdim\pgf@x<\pgf@y%
- \pgf@x\pgf@y%
- \fi%
- \edef\outersep{\the\pgf@x}%
- %
- % Get the node dimensions.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x+.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y+.5\ht\pgfnodeparttextbox%
- \advance\pgf@y+.5\dp\pgfnodeparttextbox%
- %
- % Use the radius of the incircle if required...
- %
- \ifpgfshapeborderusesincircle%
- %
- % Get the rotation (no rounding).
- %
- \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
- \ifdim\pgf@x<\pgf@y%
- \pgf@x\pgf@y%
- \fi%
- \pgf@x1.41421\pgf@x%
- \edef\halfheight{\the\pgf@x}%
- \advance\pgf@x\pgf@x%
- \else%
- %
- % Get the rotation (with rounding).
- %
- \pgfmathmod{\pgfkeysvalueof{/pgf/shape border rotate}}{360}%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \expandafter\c@pgf@counta\pgfmathresult\relax\pgfmath@%
- \advance\c@pgf@counta45\relax%
- \divide\c@pgf@counta90\relax%
- \multiply\c@pgf@counta90\relax%
- \ifnum\c@pgf@counta<0\relax%
- \advance\c@pgf@counta360\relax%
- \fi%
- \edef\rotate{\the\c@pgf@counta}%
- %
- % Calculate the width and height of the node
- % contents, according to any border rotation.
- %
- \ifnum\c@pgf@counta=90\relax%
- \pgf@xc\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y\pgf@xc%
- \else%
- \ifnum\c@pgf@counta=270\relax%
- \pgf@xc\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y\pgf@xc%
- \fi%
- \fi%
- \advance\pgf@y\pgf@y%
- \pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
- \pgf@x\pgfmathresult pt\relax%
- \pgf@y.5\pgf@y%
- \edef\halfheight{\the\pgf@y}%
- \fi%
- \edef\defaultradius{\the\pgf@x}%
- %
- % Take into account minimum height and width.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
- \ifdim\pgf@x<.5\pgf@xa%
- \pgf@x.5\pgf@xa%
- \fi%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@x<\pgf@ya%
- \pgf@x\pgf@ya%
- \fi%
- \edef\semicircleradius{\the\pgf@x}%
- %
- % Find the center/base/mid of the semi circle node.
- %
- \pgfextract@process\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y+-.5\dp\pgfnodeparttextbox%
- }%
- \pgfextract@process\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt\relax%
- }%
- \pgfextract@process\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+.5ex}%
- }%
- \pgfextract@process\semicirclecenterpoint{%
- \centerpoint%
- \pgf@ya\semicircleradius\relax%
- \advance\pgf@ya-\defaultradius\relax%
- %
- % The point is adjusted to make the node contents
- % appear more centered if the node is enlarged to
- % some minimum size. The factor .4 just seems OK.
- %
- \pgf@ya.4\pgf@ya%
- \advance\pgf@y-\pgf@ya%
- \pgf@ya\halfheight\relax%
- \advance\pgf@y-\pgf@ya%
- }%
- %
- % Add the outer sep to the radius here.
- %
- \pgf@x\semicircleradius\relax%
- \advance\pgf@x\outersep\relax%
- \edef\semicircleradius{\the\pgf@x}%
- \pgfpointdiff{\centerpoint}{\semicirclecenterpoint}%
- \ifdim\pgf@y<0pt\pgf@y-\pgf@y\fi%
- \edef\centerpointdiff{\the\pgf@y}%
- %
- % Calculate the start and end points on the border.
- %
- \pgfextract@process\arcstartborder{%
- \semicirclecenterpoint%
- \advance\pgf@x\semicircleradius\relax%
- }%
- \pgfextract@process\arcendborder{%
- \semicirclecenterpoint%
- \advance\pgf@x-\semicircleradius\relax%
- }%
- %
- % Calculate the start and end *corner* points on the border.
- % This is needed to accommodate the outer sep.
- %
- \pgfextract@process\arcstartcorner{%
- \arcstartborder%
- \advance\pgf@y-\outersep\relax%
- }%
- \pgfextract@process\arcendcorner{%
- \arcendborder%
- \advance\pgf@y-\outersep\relax%
- }
- %
- % Now calculate all the relevant angles.
- %
- % For the center point.
- %
- \pgfmathanglebetweenpoints{\centerpoint}{\arcstartborder}%
- \let\angletoarcstartborder\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\arcendborder}%
- \let\angletoarcendborder\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\arcstartcorner}%
- \let\angletoarcstartcorner\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\arcendcorner}%
- \let\angletoarcendcorner\pgfmathresult%
- %
- % For the basepoint (rotated about the center point).
- %
- \pgfextract@process\rotatedbasepoint{%
- \pgfmathrotatepointaround{\basepoint}{\centerpoint}{-\rotate}%
- }%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\arcstartborder}%
- \let\baseangletoarcstartborder\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\arcendborder}%
- \let\baseangletoarcendborder\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\arcstartcorner}%
- \let\baseangletoarcstartcorner\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\arcendcorner}%
- \let\baseangletoarcendcorner\pgfmathresult%
- %
- % For the midpoint (rotated about the center point).
- %
- \pgfextract@process\rotatedmidpoint{%
- \pgfmathrotatepointaround{\midpoint}{\centerpoint}{-\rotate}%
- }%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\arcstartborder}%
- \let\midangletoarcstartborder\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\arcendborder}%
- \let\midangletoarcendborder\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\arcstartcorner}%
- \let\midangletoarcstartcorner\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\arcendcorner}%
- \let\midangletoarcendcorner\pgfmathresult%
- %
- % Now, rotate the semicircle points around the centerpoint.
- %
- \pgfextract@process\semicirclecenterpoint{%
- \pgfmathrotatepointaround{\semicirclecenterpoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\arcstartborder{%
- \pgfmathrotatepointaround{\arcstartborder}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\arcendborder{%
- \pgfmathrotatepointaround{\arcendborder}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\arcstartcorner{%
- \pgfmathrotatepointaround{\arcstartcorner}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\arcendcorner{%
- \pgfmathrotatepointaround{\arcendcorner}{\centerpoint}{\rotate}%
- }%
- %
- % Calculate the distance between the base point and the (rotated) semicircle center.
- %
- \pgfpointdiff{\basepoint}{\semicirclecenterpoint}%
- \pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
- \edef\basesemicirclecenterdiff{\pgfmathresult pt}%
- %
- % Calculate the distance between the base point and the (rotated) semicircle center.
- %
- \pgfpointdiff{\midpoint}{\semicirclecenterpoint}%
- \pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
- \edef\midsemicirclecenterdiff{\pgfmathresult pt}%
- %
- % And save all the stuff.
- %
- \addtosavedmacro{\rotate}%
- \addtosavedmacro{\outersep}%
- \addtosavedmacro{\semicircleradius}%
- %
- \addtosavedmacro{\arcstartborder}%
- \addtosavedmacro{\arcendborder}%
- \addtosavedmacro{\arcstartcorner}%
- \addtosavedmacro{\arcendcorner}%
- \addtosavedmacro{\semicirclecenterpoint}%
- %
- \addtosavedmacro{\angletoarcstartborder}%
- \addtosavedmacro{\angletoarcendborder}%
- \addtosavedmacro{\angletoarcstartcorner}%
- \addtosavedmacro{\angletoarcendcorner}%
- %
- \addtosavedmacro{\centerpointdiff}%
- \addtosavedmacro{\basesemicirclecenterdiff}%
- \addtosavedmacro{\midsemicirclecenterdiff}%
- %
- \addtosavedmacro{\baseangletoarcstartborder}%
- \addtosavedmacro{\baseangletoarcendborder}%
- \addtosavedmacro{\baseangletoarcstartcorner}%
- \addtosavedmacro{\baseangletoarcendcorner}%
- %
- \addtosavedmacro{\midangletoarcstartborder}%
- \addtosavedmacro{\midangletoarcendborder}%
- \addtosavedmacro{\midangletoarcstartcorner}%
- \addtosavedmacro{\midangletoarcendcorner}%
- }
- \savedanchor{\centerpoint}{%
- \pgfmathsetlength\pgf@x{+.5\wd\pgfnodeparttextbox}%
- \pgfmathsetlength\pgf@y{+.5\ht\pgfnodeparttextbox}%
- \pgfmathaddtolength\pgf@y{-.5\dp\pgfnodeparttextbox}%
- }
- \savedanchor{\basepoint}{%
- \pgfmathsetlength\pgf@x{+.5\wd\pgfnodeparttextbox}%
- \pgf@y0pt\relax%
- }
- \savedanchor{\midpoint}{%
- \pgfmathsetlength\pgf@x{+.5\wd\pgfnodeparttextbox}%
- \pgfmathsetlength\pgf@y{+.5ex}%
- }
- \anchor{center}{\centerpoint}
- \anchor{base}{\basepoint}
- \anchor{base west}{%
- \installsemicircleparameters%
- \let\pgf@semicirclereferencepoint\basepoint%
- \csname pgf@anchor@semicircle@border\endcsname{\pgfqpoint{-\semicircleradius}{0pt}}%
- }
- \anchor{base east}{%
- \installsemicircleparameters%
- \let\pgf@semicirclereferencepoint\basepoint%
- \csname pgf@anchor@semicircle@border\endcsname{\pgfqpoint{\semicircleradius}{0pt}}%
- }
- \anchor{mid}{\midpoint}
- \anchor{mid west}{%
- \installsemicircleparameters%
- \let\pgf@semicirclereferencepoint\midpoint%
- \csname pgf@anchor@semicircle@border\endcsname{\pgfqpoint{-\semicircleradius}{0pt}}%
- }
- \anchor{mid east}{%
- \installsemicircleparameters%
- \let\pgf@semicirclereferencepoint\midpoint%
- \csname pgf@anchor@semicircle@border\endcsname{\pgfqpoint{\semicircleradius}{0pt}}%
- }
- \anchor{apex}{%
- \installsemicircleparameters%
- \pgfmathadd@{\rotate}{90}%
- \let\angle\pgfmathresult%
- \pgfpointadd{\semicirclecenterpoint}{\pgfqpointpolar{\angle}{\semicircleradius}}%
- }
- \anchor{arc start}{%
- \installsemicircleparameters%
- \arcstartcorner%
- }
- \anchor{arc end}{%
- \installsemicircleparameters%
- \arcendcorner%
- }
- \anchor{chord center}{%
- \installsemicircleparameters%
- \pgfpointlineattime{0.5}{\arcstartcorner}{\arcendcorner}%
- }
- \anchor{north}{%
- \installsemicircleparameters%
- \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{90}{\semicircleradius}}%
- }
- \anchor{south}{%
- \installsemicircleparameters%
- \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{270}{\semicircleradius}}%
- }
- \anchor{east}{%
- \installsemicircleparameters%
- \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{0}{\semicircleradius}}%
- }
- \anchor{west}{%
- \installsemicircleparameters%
- \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{180}{\semicircleradius}}%
- }
- \anchor{north west}{%
- \installsemicircleparameters%
- \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{135}{\semicircleradius}}%
- }
- \anchor{south west}{%
- \installsemicircleparameters%
- \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{225}{\semicircleradius}}%
- }
- \anchor{north east}{%
- \installsemicircleparameters%
- \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{45}{\semicircleradius}}%
- }
- \anchor{south east}{%
- \installsemicircleparameters%
- \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{315}{\semicircleradius}}%
- }
- \backgroundpath{%
- \installsemicircleparameters%
- \pgf@x\semicircleradius\relax%
- \advance\pgf@x-\outersep\relax%
- \edef\semicircleradius{\the\pgf@x}%
- \pgfpathmoveto{\pgfpointadd{\semicirclecenterpoint}{\pgfqpointpolar{\rotate}{\semicircleradius}}}%
- {%
- \pgftransformrotate{\rotate}%
- \pgfpatharc{0}{180}{\semicircleradius}%
- \pgfpathclose%
- }%
- }
- \anchorborder{%
- %
- % Save x and y.
- %
- \edef\externalx{\the\pgf@x}%
- \edef\externaly{\the\pgf@y}%
- %
- % Check if a reference point has been defined (i.e. \midpoint or \basepoint).
- %
- \pgfutil@ifundefined{pgf@semicirclereferencepoint}%
- {\let\referencepoint\centerpoint}%
- {\let\referencepoint\pgf@semicirclereferencepoint}%
- %
- % Adjust the location of the external point relative to the reference point.
- %
- \referencepoint%
- \pgf@xa\externalx\relax%
- \pgf@ya\externaly\relax%
- \advance\pgf@xa\pgf@x%
- \advance\pgf@ya\pgf@y%
- \edef\externalx{\the\pgf@xa}%
- \edef\externaly{\the\pgf@ya}%
- %
- % Install the required points and angles.
- %
- \installsemicircleparameters%
- %
- % Get the angle of the external point to the \referencepoint.
- %
- \pgfmathanglebetweenpoints{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
- \let\externalangle\pgfmathresult%
- %
- % *Subtract* the rotation from the external angle.
- %
- \pgfmathsubtract@{\pgfmathresult}{\rotate}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \let\angle\pgfmathresult%
- \ifx\referencepoint\basepoint%
- \let\angletoarcstartborder\baseangletoarcstartborder%
- \let\angletoarcendborder\baseangletoarcendborder%
- \let\angletoarcstartcorner\baseangletoarcstartcorner%
- \let\angletoarcendcorner\baseangletoarcendcorner%
- \let\centerpointdiff\basesemicirclecenterdiff%
- \else%
- \ifx\referencepoint\midpoint%
- \let\angletoarcstartborder\midangletoarcstartborder%
- \let\angletoarcendborder\midangletoarcendborder%
- \let\angletoarcstartcorner\midangletoarcstartcorner%
- \let\angletoarcendcorner\midangletoarcendcorner%
- \let\centerpointdiff\midsemicirclecenterdiff%
- \fi\fi%
- %
- % Determine if the line will cross the semicircle arc, or the chord.
- %
- \ifdim\angle pt>\angletoarcstartborder pt\relax%
- \let\firstpoint\pgfutil@empty%
- \let\secondpoint\pgfutil@empty%
- \else%
- \ifdim\angle pt>\angletoarcstartcorner pt\relax%
- \let\firstpoint\arcstartcorner%
- \let\secondpoint\arcstartborder%
- \else%
- \ifdim\angle pt>\angletoarcendcorner pt\relax%
- \let\firstpoint\arcendcorner%
- \let\secondpoint\arcstartcorner%
- \else%
- \ifdim\angle pt>\angletoarcendborder pt\relax%
- \let\firstpoint\arcendborder%
- \let\secondpoint\arcendcorner%
- \else%
- \let\firstpoint\pgfutil@empty%
- \let\secondpoint\pgfutil@empty%
- \fi%
- \fi%
- \fi%
- \fi%
- \ifx\firstpoint\pgfutil@empty
- %
- % Calculate the angle from the centre of the semicircle to the
- % point on the semicircle arc which intersects the line from
- % the external point to the reference point...
- %
- \pgfmathanglebetweenlines{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
- {\semicirclecenterpoint}{\referencepoint}%
- \pgfmathsin@{\pgfmathresult}%
- \let\sineangle\pgfmathresult%
- \pgf@x\semicircleradius\relax%
- \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@x}}%
- \let\reciprocalradius\pgfmathresult%
- \pgf@x\centerpointdiff\relax%
- \pgf@x\sineangle\pgf@x%
- \pgf@x\reciprocalradius\pgf@x%
- \pgfmathasin@{\pgfmath@tonumber{\pgf@x}}%
- \pgf@x\pgfmathresult pt\relax%
- \advance\pgf@x\externalangle pt\relax%
- \edef\angle{\pgfmath@tonumber{\pgf@x}}%
- %
- % ...and thus the point on the border.
- %
- \pgfpointadd{\semicirclecenterpoint}{\pgfqpointpolar{\angle}{\semicircleradius}}%
- \else%
- %
- % Calculate the the point where the semicircle chord intersects
- % the line from the external point to the reference point.
- %
- \pgfpointintersectionoflines{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
- {\firstpoint}{\secondpoint}%
- \fi%
- }
-}
+\pgfdeclareshape{semicircle}{%
+ \savedmacro\installsemicircleparameters{%
+ %
+ % Get the larger of the outer sep.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@x<\pgf@y%
+ \pgf@x\pgf@y%
+ \fi%
+ \edef\outersep{\the\pgf@x}%
+ %
+ % Get the node dimensions.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x+.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y+.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y+.5\dp\pgfnodeparttextbox%
+ %
+ % Use the radius of the incircle if required...
+ %
+ \ifpgfshapeborderusesincircle%
+ %
+ % Get the rotation (no rounding).
+ %
+ \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
+ \ifdim\pgf@x<\pgf@y%
+ \pgf@x\pgf@y%
+ \fi%
+ \pgf@x1.41421\pgf@x%
+ \edef\halfheight{\the\pgf@x}%
+ \advance\pgf@x\pgf@x%
+ \else%
+ %
+ % Get the rotation (with rounding).
+ %
+ \pgfmathmod{\pgfkeysvalueof{/pgf/shape border rotate}}{360}%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter\c@pgf@counta\pgfmathresult\relax\pgfmath@%
+ \advance\c@pgf@counta45\relax%
+ \divide\c@pgf@counta90\relax%
+ \multiply\c@pgf@counta90\relax%
+ \ifnum\c@pgf@counta<0\relax%
+ \advance\c@pgf@counta360\relax%
+ \fi%
+ \edef\rotate{\the\c@pgf@counta}%
+ %
+ % Calculate the width and height of the node
+ % contents, according to any border rotation.
+ %
+ \ifnum\c@pgf@counta=90\relax%
+ \pgf@xc\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y\pgf@xc%
+ \else%
+ \ifnum\c@pgf@counta=270\relax%
+ \pgf@xc\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y\pgf@xc%
+ \fi%
+ \fi%
+ \advance\pgf@y\pgf@y%
+ \pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
+ \pgf@x\pgfmathresult pt\relax%
+ \pgf@y.5\pgf@y%
+ \edef\halfheight{\the\pgf@y}%
+ \fi%
+ \edef\defaultradius{\the\pgf@x}%
+ %
+ % Take into account minimum height and width.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
+ \ifdim\pgf@x<.5\pgf@xa%
+ \pgf@x.5\pgf@xa%
+ \fi%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@x<\pgf@ya%
+ \pgf@x\pgf@ya%
+ \fi%
+ \edef\semicircleradius{\the\pgf@x}%
+ %
+ % Find the center/base/mid of the semi circle node.
+ %
+ \pgfextract@process\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y+-.5\dp\pgfnodeparttextbox%
+ }%
+ \pgfextract@process\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt\relax%
+ }%
+ \pgfextract@process\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+.5ex}%
+ }%
+ \pgfextract@process\semicirclecenterpoint{%
+ \centerpoint%
+ \pgf@ya\semicircleradius\relax%
+ \advance\pgf@ya-\defaultradius\relax%
+ %
+ % The point is adjusted to make the node contents
+ % appear more centered if the node is enlarged to
+ % some minimum size. The factor .4 just seems OK.
+ %
+ \pgf@ya.4\pgf@ya%
+ \advance\pgf@y-\pgf@ya%
+ \pgf@ya\halfheight\relax%
+ \advance\pgf@y-\pgf@ya%
+ }%
+ %
+ % Add the outer sep to the radius here.
+ %
+ \pgf@x\semicircleradius\relax%
+ \advance\pgf@x\outersep\relax%
+ \edef\semicircleradius{\the\pgf@x}%
+ \pgfpointdiff{\centerpoint}{\semicirclecenterpoint}%
+ \ifdim\pgf@y<0pt\pgf@y-\pgf@y\fi%
+ \edef\centerpointdiff{\the\pgf@y}%
+ %
+ % Calculate the start and end points on the border.
+ %
+ \pgfextract@process\arcstartborder{%
+ \semicirclecenterpoint%
+ \advance\pgf@x\semicircleradius\relax%
+ }%
+ \pgfextract@process\arcendborder{%
+ \semicirclecenterpoint%
+ \advance\pgf@x-\semicircleradius\relax%
+ }%
+ %
+ % Calculate the start and end *corner* points on the border.
+ % This is needed to accommodate the outer sep.
+ %
+ \pgfextract@process\arcstartcorner{%
+ \arcstartborder%
+ \advance\pgf@y-\outersep\relax%
+ }%
+ \pgfextract@process\arcendcorner{%
+ \arcendborder%
+ \advance\pgf@y-\outersep\relax%
+ }
+ %
+ % Now calculate all the relevant angles.
+ %
+ % For the center point.
+ %
+ \pgfmathanglebetweenpoints{\centerpoint}{\arcstartborder}%
+ \let\angletoarcstartborder\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\arcendborder}%
+ \let\angletoarcendborder\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\arcstartcorner}%
+ \let\angletoarcstartcorner\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\arcendcorner}%
+ \let\angletoarcendcorner\pgfmathresult%
+ %
+ % For the basepoint (rotated about the center point).
+ %
+ \pgfextract@process\rotatedbasepoint{%
+ \pgfmathrotatepointaround{\basepoint}{\centerpoint}{-\rotate}%
+ }%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\arcstartborder}%
+ \let\baseangletoarcstartborder\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\arcendborder}%
+ \let\baseangletoarcendborder\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\arcstartcorner}%
+ \let\baseangletoarcstartcorner\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\arcendcorner}%
+ \let\baseangletoarcendcorner\pgfmathresult%
+ %
+ % For the midpoint (rotated about the center point).
+ %
+ \pgfextract@process\rotatedmidpoint{%
+ \pgfmathrotatepointaround{\midpoint}{\centerpoint}{-\rotate}%
+ }%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\arcstartborder}%
+ \let\midangletoarcstartborder\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\arcendborder}%
+ \let\midangletoarcendborder\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\arcstartcorner}%
+ \let\midangletoarcstartcorner\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\arcendcorner}%
+ \let\midangletoarcendcorner\pgfmathresult%
+ %
+ % Now, rotate the semicircle points around the centerpoint.
+ %
+ \pgfextract@process\semicirclecenterpoint{%
+ \pgfmathrotatepointaround{\semicirclecenterpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\arcstartborder{%
+ \pgfmathrotatepointaround{\arcstartborder}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\arcendborder{%
+ \pgfmathrotatepointaround{\arcendborder}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\arcstartcorner{%
+ \pgfmathrotatepointaround{\arcstartcorner}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\arcendcorner{%
+ \pgfmathrotatepointaround{\arcendcorner}{\centerpoint}{\rotate}%
+ }%
+ %
+ % Calculate the distance between the base point and the (rotated) semicircle center.
+ %
+ \pgfpointdiff{\basepoint}{\semicirclecenterpoint}%
+ \pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
+ \edef\basesemicirclecenterdiff{\pgfmathresult pt}%
+ %
+ % Calculate the distance between the base point and the (rotated) semicircle center.
+ %
+ \pgfpointdiff{\midpoint}{\semicirclecenterpoint}%
+ \pgfmathveclen@{\pgfmath@tonumber{\pgf@x}}{\pgfmath@tonumber{\pgf@y}}%
+ \edef\midsemicirclecenterdiff{\pgfmathresult pt}%
+ %
+ % And save all the stuff.
+ %
+ \addtosavedmacro{\rotate}%
+ \addtosavedmacro{\outersep}%
+ \addtosavedmacro{\semicircleradius}%
+ %
+ \addtosavedmacro{\arcstartborder}%
+ \addtosavedmacro{\arcendborder}%
+ \addtosavedmacro{\arcstartcorner}%
+ \addtosavedmacro{\arcendcorner}%
+ \addtosavedmacro{\semicirclecenterpoint}%
+ %
+ \addtosavedmacro{\angletoarcstartborder}%
+ \addtosavedmacro{\angletoarcendborder}%
+ \addtosavedmacro{\angletoarcstartcorner}%
+ \addtosavedmacro{\angletoarcendcorner}%
+ %
+ \addtosavedmacro{\centerpointdiff}%
+ \addtosavedmacro{\basesemicirclecenterdiff}%
+ \addtosavedmacro{\midsemicirclecenterdiff}%
+ %
+ \addtosavedmacro{\baseangletoarcstartborder}%
+ \addtosavedmacro{\baseangletoarcendborder}%
+ \addtosavedmacro{\baseangletoarcstartcorner}%
+ \addtosavedmacro{\baseangletoarcendcorner}%
+ %
+ \addtosavedmacro{\midangletoarcstartborder}%
+ \addtosavedmacro{\midangletoarcendborder}%
+ \addtosavedmacro{\midangletoarcstartcorner}%
+ \addtosavedmacro{\midangletoarcendcorner}%
+ }%
+ \savedanchor{\centerpoint}{%
+ \pgfmathsetlength\pgf@x{+.5\wd\pgfnodeparttextbox}%
+ \pgfmathsetlength\pgf@y{+.5\ht\pgfnodeparttextbox}%
+ \pgfmathaddtolength\pgf@y{-.5\dp\pgfnodeparttextbox}%
+ }%
+ \savedanchor{\basepoint}{%
+ \pgfmathsetlength\pgf@x{+.5\wd\pgfnodeparttextbox}%
+ \pgf@y0pt\relax%
+ }%
+ \savedanchor{\midpoint}{%
+ \pgfmathsetlength\pgf@x{+.5\wd\pgfnodeparttextbox}%
+ \pgfmathsetlength\pgf@y{+.5ex}%
+ }%
+ \anchor{center}{\centerpoint}%
+ \anchor{base}{\basepoint}%
+ \anchor{base west}{%
+ \installsemicircleparameters%
+ \let\pgf@semicirclereferencepoint\basepoint%
+ \csname pgf@anchor@semicircle@border\endcsname{\pgfqpoint{-\semicircleradius}{0pt}}%
+ }%
+ \anchor{base east}{%
+ \installsemicircleparameters%
+ \let\pgf@semicirclereferencepoint\basepoint%
+ \csname pgf@anchor@semicircle@border\endcsname{\pgfqpoint{\semicircleradius}{0pt}}%
+ }%
+ \anchor{mid}{\midpoint}%
+ \anchor{mid west}{%
+ \installsemicircleparameters%
+ \let\pgf@semicirclereferencepoint\midpoint%
+ \csname pgf@anchor@semicircle@border\endcsname{\pgfqpoint{-\semicircleradius}{0pt}}%
+ }%
+ \anchor{mid east}{%
+ \installsemicircleparameters%
+ \let\pgf@semicirclereferencepoint\midpoint%
+ \csname pgf@anchor@semicircle@border\endcsname{\pgfqpoint{\semicircleradius}{0pt}}%
+ }%
+ \anchor{apex}{%
+ \installsemicircleparameters%
+ \pgfmathadd@{\rotate}{90}%
+ \let\angle\pgfmathresult%
+ \pgfpointadd{\semicirclecenterpoint}{\pgfqpointpolar{\angle}{\semicircleradius}}%
+ }%
+ \anchor{arc start}{%
+ \installsemicircleparameters%
+ \arcstartcorner%
+ }%
+ \anchor{arc end}{%
+ \installsemicircleparameters%
+ \arcendcorner%
+ }%
+ \anchor{chord center}{%
+ \installsemicircleparameters%
+ \pgfpointlineattime{0.5}{\arcstartcorner}{\arcendcorner}%
+ }%
+ \anchor{north}{%
+ \installsemicircleparameters%
+ \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{90}{\semicircleradius}}%
+ }%
+ \anchor{south}{%
+ \installsemicircleparameters%
+ \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{270}{\semicircleradius}}%
+ }%
+ \anchor{east}{%
+ \installsemicircleparameters%
+ \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{0}{\semicircleradius}}%
+ }%
+ \anchor{west}{%
+ \installsemicircleparameters%
+ \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{180}{\semicircleradius}}%
+ }%
+ \anchor{north west}{%
+ \installsemicircleparameters%
+ \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{135}{\semicircleradius}}%
+ }%
+ \anchor{south west}{%
+ \installsemicircleparameters%
+ \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{225}{\semicircleradius}}%
+ }%
+ \anchor{north east}{%
+ \installsemicircleparameters%
+ \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{45}{\semicircleradius}}%
+ }%
+ \anchor{south east}{%
+ \installsemicircleparameters%
+ \csname pgf@anchor@semicircle@border\endcsname{\pgfqpointpolar{315}{\semicircleradius}}%
+ }%
+ \backgroundpath{%
+ \installsemicircleparameters%
+ \pgf@x\semicircleradius\relax%
+ \advance\pgf@x-\outersep\relax%
+ \edef\semicircleradius{\the\pgf@x}%
+ \pgfpathmoveto{\pgfpointadd{\semicirclecenterpoint}{\pgfqpointpolar{\rotate}{\semicircleradius}}}%
+ {%
+ \pgftransformrotate{\rotate}%
+ \pgfpatharc{0}{180}{\semicircleradius}%
+ \pgfpathclose%
+ }%
+ }%
+ \anchorborder{%
+ %
+ % Save x and y.
+ %
+ \edef\externalx{\the\pgf@x}%
+ \edef\externaly{\the\pgf@y}%
+ %
+ % Check if a reference point has been defined (i.e. \midpoint or \basepoint).
+ %
+ \pgfutil@ifundefined{pgf@semicirclereferencepoint}%
+ {\let\referencepoint\centerpoint}%
+ {\let\referencepoint\pgf@semicirclereferencepoint}%
+ %
+ % Adjust the location of the external point relative to the reference point.
+ %
+ \referencepoint%
+ \pgf@xa\externalx\relax%
+ \pgf@ya\externaly\relax%
+ \advance\pgf@xa\pgf@x%
+ \advance\pgf@ya\pgf@y%
+ \edef\externalx{\the\pgf@xa}%
+ \edef\externaly{\the\pgf@ya}%
+ %
+ % Install the required points and angles.
+ %
+ \installsemicircleparameters%
+ %
+ % Get the angle of the external point to the \referencepoint.
+ %
+ \pgfmathanglebetweenpoints{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
+ \let\externalangle\pgfmathresult%
+ %
+ % *Subtract* the rotation from the external angle.
+ %
+ \pgfmathsubtract@{\pgfmathresult}{\rotate}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \let\angle\pgfmathresult%
+ \ifx\referencepoint\basepoint%
+ \let\angletoarcstartborder\baseangletoarcstartborder%
+ \let\angletoarcendborder\baseangletoarcendborder%
+ \let\angletoarcstartcorner\baseangletoarcstartcorner%
+ \let\angletoarcendcorner\baseangletoarcendcorner%
+ \let\centerpointdiff\basesemicirclecenterdiff%
+ \else%
+ \ifx\referencepoint\midpoint%
+ \let\angletoarcstartborder\midangletoarcstartborder%
+ \let\angletoarcendborder\midangletoarcendborder%
+ \let\angletoarcstartcorner\midangletoarcstartcorner%
+ \let\angletoarcendcorner\midangletoarcendcorner%
+ \let\centerpointdiff\midsemicirclecenterdiff%
+ \fi\fi%
+ %
+ % Determine if the line will cross the semicircle arc, or the chord.
+ %
+ \ifdim\angle pt>\angletoarcstartborder pt\relax%
+ \let\firstpoint\pgfutil@empty%
+ \let\secondpoint\pgfutil@empty%
+ \else%
+ \ifdim\angle pt>\angletoarcstartcorner pt\relax%
+ \let\firstpoint\arcstartcorner%
+ \let\secondpoint\arcstartborder%
+ \else%
+ \ifdim\angle pt>\angletoarcendcorner pt\relax%
+ \let\firstpoint\arcendcorner%
+ \let\secondpoint\arcstartcorner%
+ \else%
+ \ifdim\angle pt>\angletoarcendborder pt\relax%
+ \let\firstpoint\arcendborder%
+ \let\secondpoint\arcendcorner%
+ \else%
+ \let\firstpoint\pgfutil@empty%
+ \let\secondpoint\pgfutil@empty%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \ifx\firstpoint\pgfutil@empty
+ %
+ % Calculate the angle from the centre of the semicircle to the
+ % point on the semicircle arc which intersects the line from
+ % the external point to the reference point...
+ %
+ \pgfmathanglebetweenlines{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
+ {\semicirclecenterpoint}{\referencepoint}%
+ \pgfmathsin@{\pgfmathresult}%
+ \let\sineangle\pgfmathresult%
+ \pgf@x\semicircleradius\relax%
+ \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@x}}%
+ \let\reciprocalradius\pgfmathresult%
+ \pgf@x\centerpointdiff\relax%
+ \pgf@x\sineangle\pgf@x%
+ \pgf@x\reciprocalradius\pgf@x%
+ \pgfmathasin@{\pgfmath@tonumber{\pgf@x}}%
+ \pgf@x\pgfmathresult pt\relax%
+ \advance\pgf@x\externalangle pt\relax%
+ \edef\angle{\pgfmath@tonumber{\pgf@x}}%
+ %
+ % ...and thus the point on the border.
+ %
+ \pgfpointadd{\semicirclecenterpoint}{\pgfqpointpolar{\angle}{\semicircleradius}}%
+ \else%
+ %
+ % Calculate the the point where the semicircle chord intersects
+ % the line from the external point to the reference point.
+ %
+ \pgfpointintersectionoflines{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
+ {\firstpoint}{\secondpoint}%
+ \fi%
+ }%
+}%
% Keys for shape isosceles triangle
%
% /pgf/isosceles triangle apex angle : angle at the apex of the triangle.
\pgfkeys{/pgf/.cd,
- isosceles triangle apex angle/.initial=45,
- isosceles triangle stretches/.is if=pgf@lib@sh@isosceslestrianglestretches
-}
+ isosceles triangle apex angle/.initial=45,
+ isosceles triangle stretches/.is if=pgf@lib@sh@isosceslestrianglestretches
+}%
\newif\ifpgf@lib@sh@isosceslestrianglestretches
-\pgfdeclareshape{isosceles triangle}{
- \savedmacro\trianglepoints{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/isosceles triangle apex angle}}%
- \divide\pgf@x2\relax%
- \edef\halfapexangle{\pgfmath@tonumber{\pgf@x}}%
- \addtosavedmacro\halfapexangle%
- %
- \pgfmathtan@{\halfapexangle}%
- \let\tanhalfapexangle\pgfmathresult%
- %
- \pgfmathcot@{\halfapexangle}%
- \let\cothalfapexangle\pgfmathresult%
- %
- \pgfmathsin@{\halfapexangle}%
- \let\sinhalfapexangle\pgfmathresult%
- %
- \pgfmathreciprocal@{\pgfmathresult}%
- \let\cosechalfapexangle\pgfmathresult%
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\dp\pgfnodeparttextbox%
- %
- \ifpgfshapeborderusesincircle%
- \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
- \ifdim\pgf@x<\pgf@y%
- \pgf@x\pgf@y%
- \else%
- \pgf@y\pgf@x%
- \fi%
- \pgf@x1.414213\pgf@x%
- \pgf@y1.414213\pgf@y%
- %
- \pgf@xa\pgf@x%
- \advance\pgf@xa\cosechalfapexangle\pgf@x%
- \pgf@ya\tanhalfapexangle\pgf@xa%
- \else%
- \pgfmathmod{\pgfkeysvalueof{/pgf/shape border rotate}}{360}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \pgfmathsetcount\c@pgf@counta{+\pgfmathresult}%
- \advance\c@pgf@counta45\relax%
- \divide\c@pgf@counta90\relax%
- \multiply\c@pgf@counta90\relax%
- \edef\rotate{\the\c@pgf@counta}%
- \ifnum\c@pgf@counta=90\relax%
- \pgf@xa\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y\pgf@xa%
- \else%
- \ifnum\c@pgf@counta=270\relax%
- \pgf@xa\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y\pgf@xa%
- \fi%
- \fi%
- %
- \pgf@xa2.0\pgf@x%
- \pgf@ya\tanhalfapexangle\pgf@xa%
- \advance\pgf@xa\cothalfapexangle\pgf@y%
- \advance\pgf@ya\pgf@y%
- \fi%
- \addtosavedmacro\rotate%
- \ifdim\pgf@xa=0pt\relax%
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum height}}%
- \fi%
- % Adjust for minimum height and width.
- %
- \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum width}}%
- \ifdim\pgf@ya<.5\pgf@yb%
- \ifpgf@lib@sh@isosceslestrianglestretches%
- \pgf@ya.5\pgf@yb%
- %
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@ya}}{\pgfmath@tonumber{\pgf@xa}}%
- \pgfmathatan@{\pgfmathresult}%
- \let\halfapexangle\pgfmathresult%
- %
- \else%
- \pgf@ya.5\pgf@yb%
- \pgf@xa\cothalfapexangle\pgf@ya%
- \fi%
- \fi%
- %
- \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@xa<\pgf@xb%
- \ifpgf@lib@sh@isosceslestrianglestretches%
- \pgf@xa\pgf@xb%
- %
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@ya}}{\pgfmath@tonumber{\pgf@xa}}%
- \pgfmathatan@{\pgfmathresult}%
- \let\halfapexangle\pgfmathresult%
- %
- \else%
- \pgf@xa\pgf@xb%
- \pgf@ya\tanhalfapexangle\pgf@xa%
- \fi%
- \fi%
- %
- %
- % Now find the ``offset height'' (h'). This is the distance from the
- % center of the node contents to the base of the triangle.
- %
- \ifpgfshapeborderusesincircle%
- %
- % h' = H*sin(a/2) / (1+sin(a/2))
- %
- % where:
- % H = the height of the triangle.
- % a = the apex angle.
- %
- \pgf@xc\pgf@xa%
- \pgfmathsin@{\halfapexangle}%
- \pgf@xc\pgfmathresult\pgf@xc%
- \pgf@yc1pt\relax%
- \advance\pgf@yc\pgfmathresult pt\relax%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@xc}}{\pgfmath@tonumber{\pgf@yc}}
- \pgfutil@tempdima\pgfmathresult pt\relax%
- \else%
- %
- % h' = 0.5*h + (0.5*(W-w)*cos(a/2) - h*sin(a/2))/(1+sin(a/2))
- %
- % where:
- % h = the height of the node contents.
- % w = the width of the node contents.
- % W = the width of the triangle.
- % a = the apex angle.
- %
- \pgf@xc\pgf@ya%
- \advance\pgf@xc-\pgf@y%
- \pgfmathcos@{\halfapexangle}%
- \pgf@xc\pgfmathresult\pgf@xc%
- \pgfmathsin@{\halfapexangle}%
- \advance\pgf@xc-\pgfmathresult\pgf@x%
- \advance\pgf@xc-\pgfmathresult\pgf@x%
- \pgf@yc\pgfmathresult pt\relax%
- \advance\pgf@yc1pt\relax%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@xc}}{\pgfmath@tonumber{\pgf@yc}}%
- \pgfutil@tempdima\pgfmathresult pt\relax%
- \advance\pgfutil@tempdima\pgf@x%
- \fi%
- \pgfextract@process\apex{%
- \pgf@y0pt%
- \pgf@x\pgf@xa%
- \advance\pgf@x-\pgfutil@tempdima%
- }%
- \addtosavedmacro\apex%
- %
- \pgfextract@process\lowerleft{%
- \pgf@y\pgf@ya%
- \pgf@x-\pgfutil@tempdima%
- }%
- \addtosavedmacro\lowerleft%
- %
- \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/outer ysep}}%
- \ifdim\pgf@xb<\pgf@yb%
- \pgf@xb\pgf@yb%
- \fi%
- \pgfextract@process\apexanchor{%
- \apex%
- \advance\pgf@x\cosechalfapexangle\pgf@xb%
- }%
- \addtosavedmacro\apexanchor%
- %
- \pgf@yc-\halfapexangle pt\relax%
- \advance\pgf@yc90pt\relax%
- \divide\pgf@yc2\relax%
- \pgfmathcot@{\pgfmath@tonumber{\pgf@yc}}%
- \pgfextract@process\lowerleftanchor{%
- \lowerleft%
- \advance\pgf@y\pgfmathresult\pgf@xb%
- \advance\pgf@x-\pgf@xb%
- }%
- \addtosavedmacro\lowerleftanchor%
- %
- \pgfextract@process\lowerrightanchor{%
- \lowerleftanchor%
- \pgf@y-\pgf@y%
- }%
- \addtosavedmacro\lowerrightanchor%
- }
- \anchor{apex}{%
- \trianglepoints%
- \pgfpointadd{\centerpoint}{%
- \pgfmathrotatepointaround{\apexanchor}{\pgfpointorigin}{\rotate}%
- }%
- }%
- \anchor{left corner}{%
- \trianglepoints%
- \pgfpointadd{\centerpoint}{%
- \pgfmathrotatepointaround{\lowerleftanchor}{\pgfpointorigin}{\rotate}%
- }%
- }%
- \anchor{right corner}{%
- \trianglepoints%
- \pgfpointadd{\centerpoint}{%
- \pgfmathrotatepointaround{\lowerrightanchor}{\pgfpointorigin}{\rotate}%
- }%
- }%
- \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{+.5ex}%
- }%
- \savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt%
- }%
- \anchor{center}{\centerpoint}%
- \anchor{mid}{\midpoint}%
- \anchor{mid west}{%
- \trianglepoints%
- \let\pgf@isoscelestriangle@referencepoint\midpoint%
- \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{-1pt}{0pt}}%
- }%
- \anchor{mid east}{%
- \trianglepoints%
- \let\pgf@isoscelestriangle@referencepoint\midpoint%
- \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{1pt}{0pt}}%
- }%
- \anchor{base}{\basepoint}%
- \anchor{base west}{%
- \trianglepoints%
- \let\pgf@isoscelestriangle@referencepoint\basepoint%
- \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{-1pt}{0pt}}%
- }%
- \anchor{base east}{%
- \trianglepoints%
- \let\pgf@isoscelestriangle@referencepoint\basepoint%
- \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{1pt}{0pt}}%
- }%
- \anchor{north}{%
- \trianglepoints%
- \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{0pt}{1pt}}%
- }
- \anchor{south}{%
- \trianglepoints%
- \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{0pt}{-1pt}}%
- }
- \anchor{east}{%
- \trianglepoints%
- \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{1pt}{0pt}}%
- }
- \anchor{west}{%
- \trianglepoints%
- \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{-1pt}{0pt}}%
- }
- \anchor{north east}{%
- \trianglepoints%
- \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{1pt}{1pt}}%
- }
- \anchor{south west}{%
- \trianglepoints%
- \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{-1pt}{-1pt}}%
- }
- \anchor{south east}{%
- \trianglepoints%
- \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{1pt}{-1pt}}%
- }
- \anchor{north west}{%
- \trianglepoints%
- \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{-1pt}{1pt}}%
- }
- \anchor{left side}{%
- \trianglepoints%
- \pgfmathrotatepointaround{%
- \pgfpointadd{\pgfpointlineattime{0.5}{\lowerleftanchor}{\apexanchor}}{\centerpoint}}%
- {\centerpoint}{\rotate}%
- }
- \anchor{right side}{%
- \trianglepoints%
- \pgfmathrotatepointaround{%
- \pgfpointadd{\pgfpointlineattime{0.5}{\lowerrightanchor}{\apexanchor}}{\centerpoint}}%
- {\centerpoint}{\rotate}%
- }
- \anchor{lower side}{%
- \trianglepoints%
- \pgfmathrotatepointaround{%
- \pgfpointadd{\pgfpointlineattime{0.5}{\lowerleftanchor}{\lowerrightanchor}}{\centerpoint}}%
- {\centerpoint}{\rotate}%
- }
- \backgroundpath{%
- \trianglepoints%
- {%
- \pgftransformshift{\centerpoint}%
- \pgftransformrotate{\rotate}%
- \pgfpathmoveto{\apex}%
- \pgfpathlineto{\lowerleft}%
- \pgfpathlineto{\lowerleft\pgf@y-\pgf@y}%
- \pgfpathclose%
- }%
- }
- \anchorborder{%
- \pgfutil@ifundefined{pgf@isoscelestriangle@referencepoint}{\let\referencepoint\centerpoint}%
- {\let\referencepoint\pgf@isoscelestriangle@referencepoint}%
- \pgfextract@process\externalpoint{%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \referencepoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- \trianglepoints%
- \pgfmathanglebetweenpoints{\referencepoint}{\externalpoint}%
- \pgfmathsubtract@{\pgfmathresult}{\rotate}%
- \pgfmathmod@{\pgfmathresult}{360}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \let\externalangle\pgfmathresult%
- %
- \pgfmathanglebetweenpoints{\referencepoint}{\pgfpointadd{\centerpoint}{\lowerrightanchor}}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\referencepoint}{\pgfpointadd{\centerpoint}{\lowerleftanchor}}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\referencepoint}{\pgfpointadd{\centerpoint}{\apexanchor}}%
- \ifdim\externalangle pt>\pgfmathresult pt\relax%
- \let\firstpoint\apexanchor%
- \let\secondpoint\lowerleftanchor%
- \else%
- \let\firstpoint\apexanchor%
- \let\secondpoint\lowerrightanchor%
- \fi%
- \else%
- \let\firstpoint\lowerleftanchor%
- \let\secondpoint\lowerrightanchor%
- \fi%
- \else%
- \let\firstpoint\lowerrightanchor%
- \let\secondpoint\apexanchor%
- \fi%
- \pgfpointintersectionoflines{\referencepoint}{\externalpoint}%
- {\pgfmathrotatepointaround{\pgfpointadd{\centerpoint}{\firstpoint}}{\centerpoint}{\rotate}}%
- {\pgfmathrotatepointaround{\pgfpointadd{\centerpoint}{\secondpoint}}{\centerpoint}{\rotate}}%
- }%
-}
+\pgfdeclareshape{isosceles triangle}{%
+ \savedmacro\trianglepoints{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/isosceles triangle apex angle}}%
+ \divide\pgf@x2\relax%
+ \edef\halfapexangle{\pgfmath@tonumber{\pgf@x}}%
+ \addtosavedmacro\halfapexangle%
+ %
+ \pgfmathtan@{\halfapexangle}%
+ \let\tanhalfapexangle\pgfmathresult%
+ %
+ \pgfmathcot@{\halfapexangle}%
+ \let\cothalfapexangle\pgfmathresult%
+ %
+ \pgfmathsin@{\halfapexangle}%
+ \let\sinhalfapexangle\pgfmathresult%
+ %
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \let\cosechalfapexangle\pgfmathresult%
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y.5\dp\pgfnodeparttextbox%
+ %
+ \ifpgfshapeborderusesincircle%
+ \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
+ \ifdim\pgf@x<\pgf@y%
+ \pgf@x\pgf@y%
+ \else%
+ \pgf@y\pgf@x%
+ \fi%
+ \pgf@x1.414213\pgf@x%
+ \pgf@y1.414213\pgf@y%
+ %
+ \pgf@xa\pgf@x%
+ \advance\pgf@xa\cosechalfapexangle\pgf@x%
+ \pgf@ya\tanhalfapexangle\pgf@xa%
+ \else%
+ \pgfmathmod{\pgfkeysvalueof{/pgf/shape border rotate}}{360}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \pgfmathsetcount\c@pgf@counta{+\pgfmathresult}%
+ \advance\c@pgf@counta45\relax%
+ \divide\c@pgf@counta90\relax%
+ \multiply\c@pgf@counta90\relax%
+ \edef\rotate{\the\c@pgf@counta}%
+ \ifnum\c@pgf@counta=90\relax%
+ \pgf@xa\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y\pgf@xa%
+ \else%
+ \ifnum\c@pgf@counta=270\relax%
+ \pgf@xa\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y\pgf@xa%
+ \fi%
+ \fi%
+ %
+ \pgf@xa2.0\pgf@x%
+ \pgf@ya\tanhalfapexangle\pgf@xa%
+ \advance\pgf@xa\cothalfapexangle\pgf@y%
+ \advance\pgf@ya\pgf@y%
+ \fi%
+ \addtosavedmacro\rotate%
+ \ifdim\pgf@xa=0pt\relax%
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum height}}%
+ \fi%
+ % Adjust for minimum height and width.
+ %
+ \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum width}}%
+ \ifdim\pgf@ya<.5\pgf@yb%
+ \ifpgf@lib@sh@isosceslestrianglestretches%
+ \pgf@ya.5\pgf@yb%
+ %
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@ya}}{\pgfmath@tonumber{\pgf@xa}}%
+ \pgfmathatan@{\pgfmathresult}%
+ \let\halfapexangle\pgfmathresult%
+ %
+ \else%
+ \pgf@ya.5\pgf@yb%
+ \pgf@xa\cothalfapexangle\pgf@ya%
+ \fi%
+ \fi%
+ %
+ \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@xa<\pgf@xb%
+ \ifpgf@lib@sh@isosceslestrianglestretches%
+ \pgf@xa\pgf@xb%
+ %
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@ya}}{\pgfmath@tonumber{\pgf@xa}}%
+ \pgfmathatan@{\pgfmathresult}%
+ \let\halfapexangle\pgfmathresult%
+ %
+ \else%
+ \pgf@xa\pgf@xb%
+ \pgf@ya\tanhalfapexangle\pgf@xa%
+ \fi%
+ \fi%
+ %
+ %
+ % Now find the ``offset height'' (h'). This is the distance from the
+ % center of the node contents to the base of the triangle.
+ %
+ \ifpgfshapeborderusesincircle%
+ %
+ % h' = H*sin(a/2) / (1+sin(a/2))
+ %
+ % where:
+ % H = the height of the triangle.
+ % a = the apex angle.
+ %
+ \pgf@xc\pgf@xa%
+ \pgfmathsin@{\halfapexangle}%
+ \pgf@xc\pgfmathresult\pgf@xc%
+ \pgf@yc1pt\relax%
+ \advance\pgf@yc\pgfmathresult pt\relax%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@xc}}{\pgfmath@tonumber{\pgf@yc}}
+ \pgfutil@tempdima\pgfmathresult pt\relax%
+ \else%
+ %
+ % h' = 0.5*h + (0.5*(W-w)*cos(a/2) - h*sin(a/2))/(1+sin(a/2))
+ %
+ % where:
+ % h = the height of the node contents.
+ % w = the width of the node contents.
+ % W = the width of the triangle.
+ % a = the apex angle.
+ %
+ \pgf@xc\pgf@ya%
+ \advance\pgf@xc-\pgf@y%
+ \pgfmathcos@{\halfapexangle}%
+ \pgf@xc\pgfmathresult\pgf@xc%
+ \pgfmathsin@{\halfapexangle}%
+ \advance\pgf@xc-\pgfmathresult\pgf@x%
+ \advance\pgf@xc-\pgfmathresult\pgf@x%
+ \pgf@yc\pgfmathresult pt\relax%
+ \advance\pgf@yc1pt\relax%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@xc}}{\pgfmath@tonumber{\pgf@yc}}%
+ \pgfutil@tempdima\pgfmathresult pt\relax%
+ \advance\pgfutil@tempdima\pgf@x%
+ \fi%
+ \pgfextract@process\apex{%
+ \pgf@y0pt%
+ \pgf@x\pgf@xa%
+ \advance\pgf@x-\pgfutil@tempdima%
+ }%
+ \addtosavedmacro\apex%
+ %
+ \pgfextract@process\lowerleft{%
+ \pgf@y\pgf@ya%
+ \pgf@x-\pgfutil@tempdima%
+ }%
+ \addtosavedmacro\lowerleft%
+ %
+ \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@xb<\pgf@yb%
+ \pgf@xb\pgf@yb%
+ \fi%
+ \pgfextract@process\apexanchor{%
+ \apex%
+ \advance\pgf@x\cosechalfapexangle\pgf@xb%
+ }%
+ \addtosavedmacro\apexanchor%
+ %
+ \pgf@yc-\halfapexangle pt\relax%
+ \advance\pgf@yc90pt\relax%
+ \divide\pgf@yc2\relax%
+ \pgfmathcot@{\pgfmath@tonumber{\pgf@yc}}%
+ \pgfextract@process\lowerleftanchor{%
+ \lowerleft%
+ \advance\pgf@y\pgfmathresult\pgf@xb%
+ \advance\pgf@x-\pgf@xb%
+ }%
+ \addtosavedmacro\lowerleftanchor%
+ %
+ \pgfextract@process\lowerrightanchor{%
+ \lowerleftanchor%
+ \pgf@y-\pgf@y%
+ }%
+ \addtosavedmacro\lowerrightanchor%
+ }%
+ \anchor{apex}{%
+ \trianglepoints%
+ \pgfpointadd{\centerpoint}{%
+ \pgfmathrotatepointaround{\apexanchor}{\pgfpointorigin}{\rotate}%
+ }%
+ }%
+ \anchor{left corner}{%
+ \trianglepoints%
+ \pgfpointadd{\centerpoint}{%
+ \pgfmathrotatepointaround{\lowerleftanchor}{\pgfpointorigin}{\rotate}%
+ }%
+ }%
+ \anchor{right corner}{%
+ \trianglepoints%
+ \pgfpointadd{\centerpoint}{%
+ \pgfmathrotatepointaround{\lowerrightanchor}{\pgfpointorigin}{\rotate}%
+ }%
+ }%
+ \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{+.5ex}%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt%
+ }%
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\midpoint}%
+ \anchor{mid west}{%
+ \trianglepoints%
+ \let\pgf@isoscelestriangle@referencepoint\midpoint%
+ \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{-1pt}{0pt}}%
+ }%
+ \anchor{mid east}{%
+ \trianglepoints%
+ \let\pgf@isoscelestriangle@referencepoint\midpoint%
+ \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{1pt}{0pt}}%
+ }%
+ \anchor{base}{\basepoint}%
+ \anchor{base west}{%
+ \trianglepoints%
+ \let\pgf@isoscelestriangle@referencepoint\basepoint%
+ \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{-1pt}{0pt}}%
+ }%
+ \anchor{base east}{%
+ \trianglepoints%
+ \let\pgf@isoscelestriangle@referencepoint\basepoint%
+ \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{1pt}{0pt}}%
+ }%
+ \anchor{north}{%
+ \trianglepoints%
+ \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{0pt}{1pt}}%
+ }%
+ \anchor{south}{%
+ \trianglepoints%
+ \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{0pt}{-1pt}}%
+ }%
+ \anchor{east}{%
+ \trianglepoints%
+ \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{1pt}{0pt}}%
+ }%
+ \anchor{west}{%
+ \trianglepoints%
+ \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{-1pt}{0pt}}%
+ }%
+ \anchor{north east}{%
+ \trianglepoints%
+ \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{1pt}{1pt}}%
+ }%
+ \anchor{south west}{%
+ \trianglepoints%
+ \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{-1pt}{-1pt}}%
+ }%
+ \anchor{south east}{%
+ \trianglepoints%
+ \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{1pt}{-1pt}}%
+ }%
+ \anchor{north west}{%
+ \trianglepoints%
+ \csname pgf@anchor@isosceles triangle@border\endcsname{\pgfqpoint{-1pt}{1pt}}%
+ }%
+ \anchor{left side}{%
+ \trianglepoints%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{\pgfpointlineattime{0.5}{\lowerleftanchor}{\apexanchor}}{\centerpoint}}%
+ {\centerpoint}{\rotate}%
+ }%
+ \anchor{right side}{%
+ \trianglepoints%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{\pgfpointlineattime{0.5}{\lowerrightanchor}{\apexanchor}}{\centerpoint}}%
+ {\centerpoint}{\rotate}%
+ }%
+ \anchor{lower side}{%
+ \trianglepoints%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{\pgfpointlineattime{0.5}{\lowerleftanchor}{\lowerrightanchor}}{\centerpoint}}%
+ {\centerpoint}{\rotate}%
+ }%
+ \backgroundpath{%
+ \trianglepoints%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgftransformrotate{\rotate}%
+ \pgfpathmoveto{\apex}%
+ \pgfpathlineto{\lowerleft}%
+ \pgfpathlineto{\lowerleft\pgf@y-\pgf@y}%
+ \pgfpathclose%
+ }%
+ }%
+ \anchorborder{%
+ \pgfutil@ifundefined{pgf@isoscelestriangle@referencepoint}{\let\referencepoint\centerpoint}%
+ {\let\referencepoint\pgf@isoscelestriangle@referencepoint}%
+ \pgfextract@process\externalpoint{%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \referencepoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ \trianglepoints%
+ \pgfmathanglebetweenpoints{\referencepoint}{\externalpoint}%
+ \pgfmathsubtract@{\pgfmathresult}{\rotate}%
+ \pgfmathmod@{\pgfmathresult}{360}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \let\externalangle\pgfmathresult%
+ %
+ \pgfmathanglebetweenpoints{\referencepoint}{\pgfpointadd{\centerpoint}{\lowerrightanchor}}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\referencepoint}{\pgfpointadd{\centerpoint}{\lowerleftanchor}}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\referencepoint}{\pgfpointadd{\centerpoint}{\apexanchor}}%
+ \ifdim\externalangle pt>\pgfmathresult pt\relax%
+ \let\firstpoint\apexanchor%
+ \let\secondpoint\lowerleftanchor%
+ \else%
+ \let\firstpoint\apexanchor%
+ \let\secondpoint\lowerrightanchor%
+ \fi%
+ \else%
+ \let\firstpoint\lowerleftanchor%
+ \let\secondpoint\lowerrightanchor%
+ \fi%
+ \else%
+ \let\firstpoint\lowerrightanchor%
+ \let\secondpoint\apexanchor%
+ \fi%
+ \pgfpointintersectionoflines{\referencepoint}{\externalpoint}%
+ {\pgfmathrotatepointaround{\pgfpointadd{\centerpoint}{\firstpoint}}{\centerpoint}{\rotate}}%
+ {\pgfmathrotatepointaround{\pgfpointadd{\centerpoint}{\secondpoint}}{\centerpoint}{\rotate}}%
+ }%
+}%
@@ -2342,654 +2340,654 @@
%
%
\pgfkeys{/pgf/.cd,
- kite upper vertex angle/.initial=120,
- kite lower vertex angle/.initial=60,
- kite vertex angles/.code={%
- \pgfutil@in@{and}{#1}%
- \ifpgfutil@in@%
- \def\pgf@marshal##1and##2\@@{%
- \pgfkeys{/pgf/kite upper vertex angle=##1}%
- \pgfkeys{/pgf/kite lower vertex angle=##2}%
- }%
- \expandafter\pgf@marshal#1\@@%
- \else%
- \pgfkeys{/pgf/kite upper vertex angle=#1}%
- \pgfkeys{/pgf/kite lower vertex angle=#1}%
- \fi%
- }%
-}
+ kite upper vertex angle/.initial=120,
+ kite lower vertex angle/.initial=60,
+ kite vertex angles/.code={%
+ \pgfutil@in@{and}{#1}%
+ \ifpgfutil@in@%
+ \def\pgf@marshal##1and##2\@@{%
+ \pgfkeys{/pgf/kite upper vertex angle=##1}%
+ \pgfkeys{/pgf/kite lower vertex angle=##2}%
+ }%
+ \expandafter\pgf@marshal#1\@@%
+ \else%
+ \pgfkeys{/pgf/kite upper vertex angle=#1}%
+ \pgfkeys{/pgf/kite lower vertex angle=#1}%
+ \fi%
+ }%
+}%
% Shape kite.
%
-\pgfdeclareshape{kite}{
- \savedmacro\installkiteparameters{%
- %
- % Get the larger of the outer sep.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- \ifdim\pgf@x<\pgf@y%
- \pgf@x\pgf@y%
- \fi%
- \edef\outersep{\the\pgf@x}%
- %
- % Calculate the centre, base and mid points of the node.
- %
- \pgfextract@process\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }%
- \pgfextract@process\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt\relax%
- }%
- \pgfextract@process\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+.5ex}%
- }%
- %
- % Halve the vertex angles.
- %
- \pgfmathdivide{\pgfkeysvalueof{/pgf/kite upper vertex angle}}{2}%
- \let\halfuppervertexangle\pgfmathresult%
- \pgfmathdivide{\pgfkeysvalueof{/pgf/kite lower vertex angle}}{2}%
- \let\halflowervertexangle\pgfmathresult%
- %
- % Get the node dimensions.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\dp\pgfnodeparttextbox%
- \ifpgfshapeborderusesincircle%
- %
- % Get the rotation.
- %
- \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
- %
- % Get the radis of the incircle.
- %
- \ifdim\pgf@x<\pgf@y%
- \pgf@x\pgf@y%
- \fi%
- \pgf@x1.41421\pgf@x%
- %
- % Get the distances from the upper and lower verticies
- % to the center of the incircle.
- %
- \pgfmathsin@{\halfuppervertexangle}%
- \let\sinehalfuppervertexangle\pgfmathresult%
- \pgfmathreciprocal@{\pgfmathresult}%
- \let\cosechalfuppervertexangle\pgfmathresult%
- \pgf@ya\pgfmathresult\pgf@x%
- \pgfmathsin@{\halflowervertexangle}%
- \let\sinehalflowervertexangle\pgfmathresult%
- \pgfmathreciprocal@{\pgfmathresult}%
- \pgf@yb\pgfmathresult\pgf@x%
- %
- % Now calculate vertical offset (yc) between the center of
- % the incircle, and the intersection of the kite diagonals.
- %
- % yc = x * cosec(a/2) - x * cot(a/2) * (sin(a/2) + sin(b/2)) * cosec(a/2 + b/2)
- %
- % where:
- % x = the incircle radius.
- % a = the upper vertex angle.
- % b = the lower vertex angle.
- %
- \pgf@yc\pgf@x%
- \pgfmathadd@{\halfuppervertexangle}{\halflowervertexangle}%
- \pgfmathcosec@{\pgfmathresult}%
- \pgf@yc\pgfmathresult\pgf@yc%
- \pgfmathadd@{\sinehalfuppervertexangle}{\sinehalflowervertexangle}%
+\pgfdeclareshape{kite}{%
+ \savedmacro\installkiteparameters{%
+ %
+ % Get the larger of the outer sep.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@x<\pgf@y%
+ \pgf@x\pgf@y%
+ \fi%
+ \edef\outersep{\the\pgf@x}%
+ %
+ % Calculate the centre, base and mid points of the node.
+ %
+ \pgfextract@process\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \pgfextract@process\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt\relax%
+ }%
+ \pgfextract@process\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+.5ex}%
+ }%
+ %
+ % Halve the vertex angles.
+ %
+ \pgfmathdivide{\pgfkeysvalueof{/pgf/kite upper vertex angle}}{2}%
+ \let\halfuppervertexangle\pgfmathresult%
+ \pgfmathdivide{\pgfkeysvalueof{/pgf/kite lower vertex angle}}{2}%
+ \let\halflowervertexangle\pgfmathresult%
+ %
+ % Get the node dimensions.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y.5\dp\pgfnodeparttextbox%
+ \ifpgfshapeborderusesincircle%
+ %
+ % Get the rotation.
+ %
+ \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
+ %
+ % Get the radius of the incircle.
+ %
+ \ifdim\pgf@x<\pgf@y%
+ \pgf@x\pgf@y%
+ \fi%
+ \pgf@x1.41421\pgf@x%
+ %
+ % Get the distances from the upper and lower vertices
+ % to the center of the incircle.
+ %
+ \pgfmathsin@{\halfuppervertexangle}%
+ \let\sinehalfuppervertexangle\pgfmathresult%
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \let\cosechalfuppervertexangle\pgfmathresult%
+ \pgf@ya\pgfmathresult\pgf@x%
+ \pgfmathsin@{\halflowervertexangle}%
+ \let\sinehalflowervertexangle\pgfmathresult%
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \pgf@yb\pgfmathresult\pgf@x%
+ %
+ % Now calculate vertical offset (yc) between the center of
+ % the incircle, and the intersection of the kite diagonals.
+ %
+ % yc = x * cosec(a/2) - x * cot(a/2) * (sin(a/2) + sin(b/2)) * cosec(a/2 + b/2)
+ %
+ % where:
+ % x = the incircle radius.
+ % a = the upper vertex angle.
+ % b = the lower vertex angle.
+ %
+ \pgf@yc\pgf@x%
+ \pgfmathadd@{\halfuppervertexangle}{\halflowervertexangle}%
+ \pgfmathcosec@{\pgfmathresult}%
+ \pgf@yc\pgfmathresult\pgf@yc%
+ \pgfmathadd@{\sinehalfuppervertexangle}{\sinehalflowervertexangle}%
\pgf@yc\pgfmathresult\pgf@yc%
- \pgfmathcos@{\halfuppervertexangle}%
- \pgf@yc\pgfmathresult\pgf@yc%
- \pgf@yc-\cosechalfuppervertexangle\pgf@yc%
- \advance\pgf@yc\cosechalfuppervertexangle\pgf@x%
- \edef\deltay{\the\pgf@yc}%
- %
- % Now calculate the height of the kite...
- %
- \advance\pgf@ya-\pgf@yc%
- %
- % ...and the depth.
- %
- \advance\pgf@yb\pgf@yc%
- %
- % Get the half width of the widest part of the kite.
- %
- \pgfmathtan@{\halfuppervertexangle}%
- \pgf@xa\pgfmathresult\pgf@ya%
- \else%
- \multiply\pgf@x2\relax%
- \multiply\pgf@y2\relax%
- %
- % Get the rotation (with rounding).
- %
- \pgfmathmod{\pgfkeysvalueof{/pgf/shape border rotate}}{360}%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \expandafter\c@pgf@counta\pgfmathresult\relax\pgfmath@%
- \advance\c@pgf@counta45\relax%
- \divide\c@pgf@counta90\relax%
- \multiply\c@pgf@counta90\relax%
- \ifnum\c@pgf@counta<0\relax%
- \advance\c@pgf@counta360\relax%
- \fi%
- \edef\rotate{\the\c@pgf@counta}%
- %
- % Calculate the width and height of the node
- % contents, according to any border rotation.
- %
- \ifnum\c@pgf@counta=90\relax%
- \pgf@xc\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y\pgf@xc%
- \else%
- \ifnum\c@pgf@counta=270\relax%
- \pgf@xc\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y\pgf@xc%
- \fi%
- \fi%
- %
- % The node contents (total height y) extends a distance ya into the
- % upper isosceles triangle of the kite and a distance yb into the
- % lower isosceles triangle. Thus, the following relationships hold:
- %
- % ya/yb = tan(b/2)/tan(a/2)
- %
- % and y = ya + yb
- %
- % so ya = y * sin(a/2 + b/2) / (cos(a/2) * sin(b/2))
- %
- % where:
- % a = upper vertex angle.
- % b = lower vertex angle.
- %
- \pgfmathadd@{\halfuppervertexangle}{\halflowervertexangle}%
- \pgfmathsin@{\pgfmathresult}%
- \pgfmathreciprocal@{\pgfmathresult}%
- \pgf@ya\pgfmathresult\pgf@y%
- \pgfmathcos@{\halfuppervertexangle}%
- \pgf@ya\pgfmathresult\pgf@ya%
- \pgfmathsin@{\halflowervertexangle}%
- \pgf@ya\pgfmathresult\pgf@ya%
- \pgf@yb\pgf@y%
- \advance\pgf@yb-\pgf@ya%
- %
- % The vertical offset between the center of the node, and
- % the intersection of the kite diagonals is given by:
- %
- % yc = y/2 - ya
- %
- \pgf@yc.5\pgf@y%
- \advance\pgf@yc-\pgf@ya%
- \edef\deltay{\the\pgf@yc}%
- %
- % Get the half width of the widest part of the kite.
- %
- \pgfmathtan@{\halfuppervertexangle}%
- \pgf@xa.5\pgf@x%
- \advance\pgf@xa\pgfmathresult\pgf@ya%
- %
- % Now calculate the height of the kite...
- %
- \pgf@xb.5\pgf@x%
- \pgfmathreciprocal@{\pgfmathresult}%
- \advance\pgf@ya\pgfmathresult\pgf@xb%
- %
- % ...and the depth.
- %
- \pgfmathtan@{\halflowervertexangle}%
- \pgfmathreciprocal@{\pgfmathresult}%
- \advance\pgf@yb\pgfmathresult\pgf@xb%
- \fi%
- %
- % Take into account minimum height and width.
- %
- % ya is the kite height.
- % yb is the kite depth.
- % xa is the kite (half) width.
- %
- \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/minimum height}}%
- \pgf@y\pgf@ya%
- \advance\pgf@y\pgf@yb%
- \ifdim\pgf@y<\pgf@yc%
- \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@y}}%
- \pgf@yc\pgfmathresult\pgf@yc%
- \pgf@xa\pgfmath@tonumber{\pgf@yc}\pgf@xa%
- \pgf@ya\pgfmath@tonumber{\pgf@yc}\pgf@ya%
- \pgf@yb\pgfmath@tonumber{\pgf@yc}\pgf@yb%
- \fi%
- \pgf@x2.0\pgf@xa%
- \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/minimum width}}%
- \ifdim\pgf@x<\pgf@xc%
- \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@x}}%
- \pgf@xc\pgfmathresult\pgf@xc%
- \pgf@xa\pgfmath@tonumber{\pgf@xc}\pgf@xa%
- \pgf@ya\pgfmath@tonumber{\pgf@xc}\pgf@ya%
- \pgf@yb\pgfmath@tonumber{\pgf@xc}\pgf@yb%
- \fi%
- \edef\kitehalfwidth{\the\pgf@xa}%
- \edef\kiteheight{\the\pgf@ya}%
- \edef\kitedepth{\the\pgf@yb}%
- %
- % Calculate the basic points on the kite (for the background path).
- %
- \pgfextract@process\toppoint{%
- \centerpoint%
- \advance\pgf@y\deltay\relax%
- \advance\pgf@y\kiteheight%
- }%
- \pgfextract@process\bottompoint{%
- \centerpoint%
- \advance\pgf@y\deltay\relax%
- \advance\pgf@y-\kitedepth%
- }%
- \pgfextract@process\leftpoint{%
- \centerpoint%
- \advance\pgf@y\deltay\relax%
- \advance\pgf@x-\kitehalfwidth%
- }%
- \pgfextract@process\rightpoint{%
- \centerpoint%
- \advance\pgf@y\deltay\relax%
- \advance\pgf@x\kitehalfwidth%
- }%
- %
- % Now calculate the miter length. At the top...
- %
- \pgfmathsin@{\halfuppervertexangle}%
- \pgfmathreciprocal@{\pgfmathresult}%
- \pgf@y\outersep\relax%
- \pgf@y\pgfmathresult\pgf@y%
- \edef\topmiter{\the\pgf@y}%
- %
- % ...at the bottom...
- %
- \pgfmathsin@{\halflowervertexangle}%
- \pgfmathreciprocal@{\pgfmathresult}%
- \pgf@y\outersep\relax%
- \pgf@y\pgfmathresult\pgf@y%
- \edef\bottommiter{\the\pgf@y}%
- %
- % ...to the right...
- %
- \pgfmathsubtract@{180}{\halflowervertexangle}%
- \pgfmathsubtract@{\pgfmathresult}{\halfuppervertexangle}%
- \pgfmathdivide@{\pgfmathresult}{2}%
- \pgfmathsin@{\pgfmathresult}%
- \pgfmathreciprocal@{\pgfmathresult}%
- \pgf@xa\outersep\relax%
- \pgf@xa\pgfmathresult\pgf@xa%
- \pgfmathsubtract@{\halfuppervertexangle}{\halflowervertexangle}%
- \pgfmathdivide@{\pgfmathresult}{2}%
- \let\angle\pgfmathresult%
- \pgfextract@process\rightmiter{%
- \pgfqpointpolar{\angle}{\the\pgf@xa}%
- }%
- %
- % ...and to the left.
- %
- \pgfmathsubtract@{180}{\angle}%
- \let\angle\pgfmathresult%
- \pgfextract@process\leftmiter{%
- \pgfqpointpolar{\angle}{\the\pgf@xa}%
- }%
- %
- % Create the border points.
- %
- \pgfextract@process\topborderpoint{%
- \toppoint%
- \advance\pgf@y\topmiter\relax%
- }%
- \pgfextract@process\bottomborderpoint{%
- \bottompoint%
- \advance\pgf@y-\bottommiter\relax%
- }%
- \pgfextract@process\leftborderpoint{%
- \leftpoint%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \leftmiter%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- \pgfextract@process\rightborderpoint{%
- \rightpoint%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \rightmiter%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- %
- % Get the angle from the \centerpoint to the *unrotated points*.
- %
- \pgfmathanglebetweenpoints{\centerpoint}{\topborderpoint}%
- \let\angletotoppoint\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\leftborderpoint}%
- \let\angletoleftpoint\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\bottomborderpoint}%
- \let\angletobottompoint\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\rightborderpoint}%
- \let\angletorightpoint\pgfmathresult%
- %
- % ...from the *inversly rotated* \basepoint...
- %
- \pgfextract@process\rotatedbasepoint{%
- \pgfmathrotatepointaround{\basepoint}{\centerpoint}{-\rotate}%
- }%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\topborderpoint}%
- \let\baseangletotoppoint\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\leftborderpoint}%
- \let\baseangletoleftpoint\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\bottomborderpoint}%
- \let\baseangletobottompoint\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\rightborderpoint}%
- \let\baseangletorightpoint\pgfmathresult%
- %
- % ...and from the *inversely rotated* \midpoint.
- %
- \pgfextract@process\rotatedmidpoint{%
- \pgfmathrotatepointaround{\midpoint}{\centerpoint}{-\rotate}%
- }%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\topborderpoint}%
- \let\midangletotoppoint\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\leftborderpoint}%
- \let\midangletoleftpoint\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\bottomborderpoint}%
- \let\midangletobottompoint\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\rightborderpoint}%
- \let\midangletorightpoint\pgfmathresult%
- %
- % Calculate a radius guaranteed to be outside the kite.
- %
- \pgfextractx\pgf@xa{\pgfpointdiff{\leftborderpoint}{\rightborderpoint}}%
- \ifdim\pgf@xa<0pt\relax%
- \pgf@xa-\pgf@xa%
- \fi%
- \pgfextracty\pgf@ya{\pgfpointdiff{\topborderpoint}{\bottomborderpoint}}%
- \ifdim\pgf@ya<0pt\relax%
- \pgf@ya-\pgf@ya%
- \fi%
- \ifdim\pgf@ya>\pgf@xa%
- \edef\externalradius{\the\pgf@ya}%
- \else%
- \edef\externalradius{\the\pgf@xa}%
- \fi%
- %
- % Now rotate the points...
- %
- \pgfextract@process\toppoint{%
- \pgfmathrotatepointaround{\toppoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\bottompoint{%
- \pgfmathrotatepointaround{\bottompoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\leftpoint{%
- \pgfmathrotatepointaround{\leftpoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\rightpoint{%
- \pgfmathrotatepointaround{\rightpoint}{\centerpoint}{\rotate}%
- }%
- %
- % ...and the border points.
- %
- \pgfextract@process\topborderpoint{%
- \pgfmathrotatepointaround{\topborderpoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\bottomborderpoint{%
- \pgfmathrotatepointaround{\bottomborderpoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\leftborderpoint{%
- \pgfmathrotatepointaround{\leftborderpoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\rightborderpoint{%
- \pgfmathrotatepointaround{\rightborderpoint}{\centerpoint}{\rotate}%
- }%
- %
- % Now save it all.
- %
- \addtosavedmacro{\rotate}%
- \addtosavedmacro{\externalradius}%
- %
- \addtosavedmacro\toppoint%
- \addtosavedmacro\bottompoint%
- \addtosavedmacro\leftpoint%
- \addtosavedmacro\rightpoint%
- %
- \addtosavedmacro\topborderpoint%
- \addtosavedmacro\bottomborderpoint%
- \addtosavedmacro\leftborderpoint%
- \addtosavedmacro\rightborderpoint%
- %
- \addtosavedmacro\angletotoppoint%
- \addtosavedmacro\angletobottompoint%
- \addtosavedmacro\angletoleftpoint%
- \addtosavedmacro\angletorightpoint%
- %
- \addtosavedmacro\baseangletotoppoint%
- \addtosavedmacro\baseangletobottompoint%
- \addtosavedmacro\baseangletoleftpoint%
- \addtosavedmacro\baseangletorightpoint%
- %
- \addtosavedmacro\midangletotoppoint%
- \addtosavedmacro\midangletobottompoint%
- \addtosavedmacro\midangletoleftpoint%
- \addtosavedmacro\midangletorightpoint%
- }
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }%
- \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{base}{\basepoint}%
- \anchor{base west}{%
- \installkiteparameters%
- \let\pgf@kiteanchorborderreferencepoint\basepoint%
- \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }%
- \anchor{base east}{%
- \installkiteparameters%
- \let\pgf@kiteanchorborderreferencepoint\basepoint%
- \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }%
- \anchor{mid}{\midpoint}%
- \anchor{mid west}{%
- \installkiteparameters%
- \let\pgf@kiteanchorborderreferencepoint\midpoint%
- \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }%
- \anchor{mid east}{%
- \installkiteparameters%
- \let\pgf@kiteanchorborderreferencepoint\midpoint%
- \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }%
- \anchor{north}{%
- \installkiteparameters%
- \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{0pt}{\externalradius}}%
- }
- \anchor{south}{%
- \installkiteparameters%
- \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{0pt}{-\externalradius}}%
- }
- \anchor{east}{%
- \installkiteparameters%
- \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }
- \anchor{west}{%
- \installkiteparameters%
- \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }
- \anchor{north east}{%
- \installkiteparameters%
- \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{\externalradius}{\externalradius}}%
- }
- \anchor{south west}{%
- \installkiteparameters%
- \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{-\externalradius}{-\externalradius}}%
- }
- \anchor{south east}{%
- \installkiteparameters%
- \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{\externalradius}{-\externalradius}}%
- }
- \anchor{north west}{%
- \installkiteparameters%
- \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{-\externalradius}{\externalradius}}%
- }
- \anchor{upper vertex}{%
- \installkiteparameters%
- \topborderpoint}
- \anchor{lower vertex}{%
- \installkiteparameters%
- \bottomborderpoint}
- \anchor{left vertex}{%
- \installkiteparameters%
- \leftborderpoint}
- \anchor{right vertex}{%
- \installkiteparameters%
- \rightborderpoint}
- \anchor{upper left side}{%
- \installkiteparameters%
- \pgfpointlineattime{0.5}{\topborderpoint}{\leftborderpoint}}
- \anchor{lower left side}{%
- \installkiteparameters%
- \pgfpointlineattime{0.5}{\bottomborderpoint}{\leftborderpoint}}
- \anchor{upper right side}{%
- \installkiteparameters%
- \pgfpointlineattime{0.5}{\topborderpoint}{\rightborderpoint}}
- \anchor{lower right side}{%
- \installkiteparameters%
- \pgfpointlineattime{0.5}{\bottomborderpoint}{\rightborderpoint}}
- \backgroundpath{%
- \installkiteparameters%
- \pgfpathmoveto{\toppoint}%
- \pgfpathlineto{\leftpoint}%
- \pgfpathlineto{\bottompoint}%
- \pgfpathlineto{\rightpoint}%
- \pgfpathclose%
- }
- \anchorborder{%
- %
- % Save x and y.
- %
- \edef\externalx{\the\pgf@x}%
- \edef\externaly{\the\pgf@y}%
- %
- % This allows anchors base east, base west, mid east and mid west,
- % to redefine the `center' of the node to correctly calculate the
- % border points.
- %
- \pgfutil@ifundefined{pgf@kiteanchorborderreferencepoint}%
- {\let\referencepoint\centerpoint}%
- {\let\referencepoint\pgf@kiteanchorborderreferencepoint}%
- %
- % Adjust the location of the external
- % point relative to the reference point.
- %
- \referencepoint%
- \pgf@xa\externalx\relax%
- \pgf@ya\externaly\relax%
- \advance\pgf@xa\pgf@x%
- \advance\pgf@ya\pgf@y%
- \edef\externalx{\the\pgf@xa}%
- \edef\externaly{\the\pgf@ya}%
- %
- % Install the required points and angles.
- %
- \installkiteparameters%
- %
- % Get the angle of the external point relative to \referencepoint.
- %
- \pgfmathanglebetweenpoints{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
- %
- % *Subtract* the rotation from the external angle.
- %
- \pgfmathsubtract@{\pgfmathresult}{\rotate}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \let\externalangle\pgfmathresult%
- \ifx\referencepoint\basepoint%
- \let\angletotoppoint\baseangletotoppoint%
- \let\angletobottompoint\baseangletobottompoint%
- \let\angletoleftpoint\baseangletoleftpoint%
- \let\angletorightpoint\baseangletorightpoint%
- \else%
- \ifx\referencepoint\midpoint%
- \let\angletotoppoint\midangletotoppoint%
- \let\angletobottompoint\midangletobottompoint%
- \let\angletoleftpoint\midangletoleftpoint%
- \let\angletorightpoint\midangletorightpoint%
- \fi\fi%
- %
- % Depending on the rotation, the angle to \rightborderpoint
- % may be smaller than the angle to \topborderpoint.
- %
- \ifdim\angletorightpoint pt<\angletotoppoint pt\relax%
- \ifdim\externalangle pt<\angletorightpoint pt\relax%
- \let\firstpoint\rightborderpoint%
- \let\secondpoint\bottomborderpoint%
- \else%
- \ifdim\externalangle pt<\angletotoppoint pt\relax%
- \let\firstpoint\rightborderpoint%
- \let\secondpoint\topborderpoint%
- \else%
- \ifdim\externalangle pt<\angletoleftpoint pt\relax%
- \let\firstpoint\topborderpoint%
- \let\secondpoint\leftborderpoint%
- \else%
- \ifdim\externalangle pt<\angletobottompoint pt\relax%
- \let\firstpoint\leftborderpoint%
- \let\secondpoint\bottomborderpoint%
- \else%
- \let\firstpoint\rightborderpoint%
- \let\secondpoint\bottomborderpoint%
- \fi%
- \fi%
- \fi%
- \fi%
- \else%
- \ifdim\externalangle pt<\angletotoppoint pt\relax%
- \let\firstpoint\rightborderpoint%
- \let\secondpoint\topborderpoint%
- \else%
- \ifdim\externalangle pt<\angletoleftpoint pt\relax%
- \let\firstpoint\leftborderpoint%
- \let\secondpoint\topborderpoint%
- \else%
- \ifdim\externalangle pt<\angletobottompoint pt\relax%
- \let\firstpoint\bottomborderpoint%
- \let\secondpoint\leftborderpoint%
- \else%
- \ifdim\externalangle pt<\angletorightpoint pt\relax%
- \let\firstpoint\rightborderpoint%
- \let\secondpoint\bottomborderpoint%
- \else%
- \let\firstpoint\rightborderpoint%
- \let\secondpoint\topborderpoint%
- \fi%
- \fi%
- \fi%
- \fi%
- \fi%
- \pgfpointintersectionoflines{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
- {\firstpoint}{\secondpoint}%
- }
-}
+ \pgfmathcos@{\halfuppervertexangle}%
+ \pgf@yc\pgfmathresult\pgf@yc%
+ \pgf@yc-\cosechalfuppervertexangle\pgf@yc%
+ \advance\pgf@yc\cosechalfuppervertexangle\pgf@x%
+ \edef\deltay{\the\pgf@yc}%
+ %
+ % Now calculate the height of the kite...
+ %
+ \advance\pgf@ya-\pgf@yc%
+ %
+ % ...and the depth.
+ %
+ \advance\pgf@yb\pgf@yc%
+ %
+ % Get the half width of the widest part of the kite.
+ %
+ \pgfmathtan@{\halfuppervertexangle}%
+ \pgf@xa\pgfmathresult\pgf@ya%
+ \else%
+ \multiply\pgf@x2\relax%
+ \multiply\pgf@y2\relax%
+ %
+ % Get the rotation (with rounding).
+ %
+ \pgfmathmod{\pgfkeysvalueof{/pgf/shape border rotate}}{360}%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter\c@pgf@counta\pgfmathresult\relax\pgfmath@%
+ \advance\c@pgf@counta45\relax%
+ \divide\c@pgf@counta90\relax%
+ \multiply\c@pgf@counta90\relax%
+ \ifnum\c@pgf@counta<0\relax%
+ \advance\c@pgf@counta360\relax%
+ \fi%
+ \edef\rotate{\the\c@pgf@counta}%
+ %
+ % Calculate the width and height of the node
+ % contents, according to any border rotation.
+ %
+ \ifnum\c@pgf@counta=90\relax%
+ \pgf@xc\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y\pgf@xc%
+ \else%
+ \ifnum\c@pgf@counta=270\relax%
+ \pgf@xc\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y\pgf@xc%
+ \fi%
+ \fi%
+ %
+ % The node contents (total height y) extends a distance ya into the
+ % upper isosceles triangle of the kite and a distance yb into the
+ % lower isosceles triangle. Thus, the following relationships hold:
+ %
+ % ya/yb = tan(b/2)/tan(a/2)
+ %
+ % and y = ya + yb
+ %
+ % so ya = y * sin(a/2 + b/2) / (cos(a/2) * sin(b/2))
+ %
+ % where:
+ % a = upper vertex angle.
+ % b = lower vertex angle.
+ %
+ \pgfmathadd@{\halfuppervertexangle}{\halflowervertexangle}%
+ \pgfmathsin@{\pgfmathresult}%
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \pgf@ya\pgfmathresult\pgf@y%
+ \pgfmathcos@{\halfuppervertexangle}%
+ \pgf@ya\pgfmathresult\pgf@ya%
+ \pgfmathsin@{\halflowervertexangle}%
+ \pgf@ya\pgfmathresult\pgf@ya%
+ \pgf@yb\pgf@y%
+ \advance\pgf@yb-\pgf@ya%
+ %
+ % The vertical offset between the center of the node, and
+ % the intersection of the kite diagonals is given by:
+ %
+ % yc = y/2 - ya
+ %
+ \pgf@yc.5\pgf@y%
+ \advance\pgf@yc-\pgf@ya%
+ \edef\deltay{\the\pgf@yc}%
+ %
+ % Get the half width of the widest part of the kite.
+ %
+ \pgfmathtan@{\halfuppervertexangle}%
+ \pgf@xa.5\pgf@x%
+ \advance\pgf@xa\pgfmathresult\pgf@ya%
+ %
+ % Now calculate the height of the kite...
+ %
+ \pgf@xb.5\pgf@x%
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \advance\pgf@ya\pgfmathresult\pgf@xb%
+ %
+ % ...and the depth.
+ %
+ \pgfmathtan@{\halflowervertexangle}%
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \advance\pgf@yb\pgfmathresult\pgf@xb%
+ \fi%
+ %
+ % Take into account minimum height and width.
+ %
+ % ya is the kite height.
+ % yb is the kite depth.
+ % xa is the kite (half) width.
+ %
+ \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/minimum height}}%
+ \pgf@y\pgf@ya%
+ \advance\pgf@y\pgf@yb%
+ \ifdim\pgf@y<\pgf@yc%
+ \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@y}}%
+ \pgf@yc\pgfmathresult\pgf@yc%
+ \pgf@xa\pgfmath@tonumber{\pgf@yc}\pgf@xa%
+ \pgf@ya\pgfmath@tonumber{\pgf@yc}\pgf@ya%
+ \pgf@yb\pgfmath@tonumber{\pgf@yc}\pgf@yb%
+ \fi%
+ \pgf@x2.0\pgf@xa%
+ \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/minimum width}}%
+ \ifdim\pgf@x<\pgf@xc%
+ \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@x}}%
+ \pgf@xc\pgfmathresult\pgf@xc%
+ \pgf@xa\pgfmath@tonumber{\pgf@xc}\pgf@xa%
+ \pgf@ya\pgfmath@tonumber{\pgf@xc}\pgf@ya%
+ \pgf@yb\pgfmath@tonumber{\pgf@xc}\pgf@yb%
+ \fi%
+ \edef\kitehalfwidth{\the\pgf@xa}%
+ \edef\kiteheight{\the\pgf@ya}%
+ \edef\kitedepth{\the\pgf@yb}%
+ %
+ % Calculate the basic points on the kite (for the background path).
+ %
+ \pgfextract@process\toppoint{%
+ \centerpoint%
+ \advance\pgf@y\deltay\relax%
+ \advance\pgf@y\kiteheight%
+ }%
+ \pgfextract@process\bottompoint{%
+ \centerpoint%
+ \advance\pgf@y\deltay\relax%
+ \advance\pgf@y-\kitedepth%
+ }%
+ \pgfextract@process\leftpoint{%
+ \centerpoint%
+ \advance\pgf@y\deltay\relax%
+ \advance\pgf@x-\kitehalfwidth%
+ }%
+ \pgfextract@process\rightpoint{%
+ \centerpoint%
+ \advance\pgf@y\deltay\relax%
+ \advance\pgf@x\kitehalfwidth%
+ }%
+ %
+ % Now calculate the miter length. At the top...
+ %
+ \pgfmathsin@{\halfuppervertexangle}%
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \pgf@y\outersep\relax%
+ \pgf@y\pgfmathresult\pgf@y%
+ \edef\topmiter{\the\pgf@y}%
+ %
+ % ...at the bottom...
+ %
+ \pgfmathsin@{\halflowervertexangle}%
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \pgf@y\outersep\relax%
+ \pgf@y\pgfmathresult\pgf@y%
+ \edef\bottommiter{\the\pgf@y}%
+ %
+ % ...to the right...
+ %
+ \pgfmathsubtract@{180}{\halflowervertexangle}%
+ \pgfmathsubtract@{\pgfmathresult}{\halfuppervertexangle}%
+ \pgfmathdivide@{\pgfmathresult}{2}%
+ \pgfmathsin@{\pgfmathresult}%
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \pgf@xa\outersep\relax%
+ \pgf@xa\pgfmathresult\pgf@xa%
+ \pgfmathsubtract@{\halfuppervertexangle}{\halflowervertexangle}%
+ \pgfmathdivide@{\pgfmathresult}{2}%
+ \let\angle\pgfmathresult%
+ \pgfextract@process\rightmiter{%
+ \pgfqpointpolar{\angle}{\the\pgf@xa}%
+ }%
+ %
+ % ...and to the left.
+ %
+ \pgfmathsubtract@{180}{\angle}%
+ \let\angle\pgfmathresult%
+ \pgfextract@process\leftmiter{%
+ \pgfqpointpolar{\angle}{\the\pgf@xa}%
+ }%
+ %
+ % Create the border points.
+ %
+ \pgfextract@process\topborderpoint{%
+ \toppoint%
+ \advance\pgf@y\topmiter\relax%
+ }%
+ \pgfextract@process\bottomborderpoint{%
+ \bottompoint%
+ \advance\pgf@y-\bottommiter\relax%
+ }%
+ \pgfextract@process\leftborderpoint{%
+ \leftpoint%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \leftmiter%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ \pgfextract@process\rightborderpoint{%
+ \rightpoint%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \rightmiter%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ %
+ % Get the angle from the \centerpoint to the *unrotated points*.
+ %
+ \pgfmathanglebetweenpoints{\centerpoint}{\topborderpoint}%
+ \let\angletotoppoint\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\leftborderpoint}%
+ \let\angletoleftpoint\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\bottomborderpoint}%
+ \let\angletobottompoint\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\rightborderpoint}%
+ \let\angletorightpoint\pgfmathresult%
+ %
+ % ...from the *inversely rotated* \basepoint...
+ %
+ \pgfextract@process\rotatedbasepoint{%
+ \pgfmathrotatepointaround{\basepoint}{\centerpoint}{-\rotate}%
+ }%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\topborderpoint}%
+ \let\baseangletotoppoint\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\leftborderpoint}%
+ \let\baseangletoleftpoint\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\bottomborderpoint}%
+ \let\baseangletobottompoint\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\rightborderpoint}%
+ \let\baseangletorightpoint\pgfmathresult%
+ %
+ % ...and from the *inversely rotated* \midpoint.
+ %
+ \pgfextract@process\rotatedmidpoint{%
+ \pgfmathrotatepointaround{\midpoint}{\centerpoint}{-\rotate}%
+ }%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\topborderpoint}%
+ \let\midangletotoppoint\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\leftborderpoint}%
+ \let\midangletoleftpoint\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\bottomborderpoint}%
+ \let\midangletobottompoint\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\rightborderpoint}%
+ \let\midangletorightpoint\pgfmathresult%
+ %
+ % Calculate a radius guaranteed to be outside the kite.
+ %
+ \pgfextractx\pgf@xa{\pgfpointdiff{\leftborderpoint}{\rightborderpoint}}%
+ \ifdim\pgf@xa<0pt\relax%
+ \pgf@xa-\pgf@xa%
+ \fi%
+ \pgfextracty\pgf@ya{\pgfpointdiff{\topborderpoint}{\bottomborderpoint}}%
+ \ifdim\pgf@ya<0pt\relax%
+ \pgf@ya-\pgf@ya%
+ \fi%
+ \ifdim\pgf@ya>\pgf@xa%
+ \edef\externalradius{\the\pgf@ya}%
+ \else%
+ \edef\externalradius{\the\pgf@xa}%
+ \fi%
+ %
+ % Now rotate the points...
+ %
+ \pgfextract@process\toppoint{%
+ \pgfmathrotatepointaround{\toppoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\bottompoint{%
+ \pgfmathrotatepointaround{\bottompoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\leftpoint{%
+ \pgfmathrotatepointaround{\leftpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\rightpoint{%
+ \pgfmathrotatepointaround{\rightpoint}{\centerpoint}{\rotate}%
+ }%
+ %
+ % ...and the border points.
+ %
+ \pgfextract@process\topborderpoint{%
+ \pgfmathrotatepointaround{\topborderpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\bottomborderpoint{%
+ \pgfmathrotatepointaround{\bottomborderpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\leftborderpoint{%
+ \pgfmathrotatepointaround{\leftborderpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\rightborderpoint{%
+ \pgfmathrotatepointaround{\rightborderpoint}{\centerpoint}{\rotate}%
+ }%
+ %
+ % Now save it all.
+ %
+ \addtosavedmacro{\rotate}%
+ \addtosavedmacro{\externalradius}%
+ %
+ \addtosavedmacro\toppoint%
+ \addtosavedmacro\bottompoint%
+ \addtosavedmacro\leftpoint%
+ \addtosavedmacro\rightpoint%
+ %
+ \addtosavedmacro\topborderpoint%
+ \addtosavedmacro\bottomborderpoint%
+ \addtosavedmacro\leftborderpoint%
+ \addtosavedmacro\rightborderpoint%
+ %
+ \addtosavedmacro\angletotoppoint%
+ \addtosavedmacro\angletobottompoint%
+ \addtosavedmacro\angletoleftpoint%
+ \addtosavedmacro\angletorightpoint%
+ %
+ \addtosavedmacro\baseangletotoppoint%
+ \addtosavedmacro\baseangletobottompoint%
+ \addtosavedmacro\baseangletoleftpoint%
+ \addtosavedmacro\baseangletorightpoint%
+ %
+ \addtosavedmacro\midangletotoppoint%
+ \addtosavedmacro\midangletobottompoint%
+ \addtosavedmacro\midangletoleftpoint%
+ \addtosavedmacro\midangletorightpoint%
+ }%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \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{base}{\basepoint}%
+ \anchor{base west}{%
+ \installkiteparameters%
+ \let\pgf@kiteanchorborderreferencepoint\basepoint%
+ \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{base east}{%
+ \installkiteparameters%
+ \let\pgf@kiteanchorborderreferencepoint\basepoint%
+ \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{mid}{\midpoint}%
+ \anchor{mid west}{%
+ \installkiteparameters%
+ \let\pgf@kiteanchorborderreferencepoint\midpoint%
+ \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{mid east}{%
+ \installkiteparameters%
+ \let\pgf@kiteanchorborderreferencepoint\midpoint%
+ \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{north}{%
+ \installkiteparameters%
+ \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{0pt}{\externalradius}}%
+ }%
+ \anchor{south}{%
+ \installkiteparameters%
+ \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{0pt}{-\externalradius}}%
+ }%
+ \anchor{east}{%
+ \installkiteparameters%
+ \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{west}{%
+ \installkiteparameters%
+ \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{north east}{%
+ \installkiteparameters%
+ \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{\externalradius}{\externalradius}}%
+ }%
+ \anchor{south west}{%
+ \installkiteparameters%
+ \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{-\externalradius}{-\externalradius}}%
+ }%
+ \anchor{south east}{%
+ \installkiteparameters%
+ \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{\externalradius}{-\externalradius}}%
+ }%
+ \anchor{north west}{%
+ \installkiteparameters%
+ \csname pgf@anchor@kite@border\endcsname{\pgfqpoint{-\externalradius}{\externalradius}}%
+ }%
+ \anchor{upper vertex}{%
+ \installkiteparameters%
+ \topborderpoint}%
+ \anchor{lower vertex}{%
+ \installkiteparameters%
+ \bottomborderpoint}%
+ \anchor{left vertex}{%
+ \installkiteparameters%
+ \leftborderpoint}%
+ \anchor{right vertex}{%
+ \installkiteparameters%
+ \rightborderpoint}%
+ \anchor{upper left side}{%
+ \installkiteparameters%
+ \pgfpointlineattime{0.5}{\topborderpoint}{\leftborderpoint}}%
+ \anchor{lower left side}{%
+ \installkiteparameters%
+ \pgfpointlineattime{0.5}{\bottomborderpoint}{\leftborderpoint}}%
+ \anchor{upper right side}{%
+ \installkiteparameters%
+ \pgfpointlineattime{0.5}{\topborderpoint}{\rightborderpoint}}%
+ \anchor{lower right side}{%
+ \installkiteparameters%
+ \pgfpointlineattime{0.5}{\bottomborderpoint}{\rightborderpoint}}%
+ \backgroundpath{%
+ \installkiteparameters%
+ \pgfpathmoveto{\toppoint}%
+ \pgfpathlineto{\leftpoint}%
+ \pgfpathlineto{\bottompoint}%
+ \pgfpathlineto{\rightpoint}%
+ \pgfpathclose%
+ }%
+ \anchorborder{%
+ %
+ % Save x and y.
+ %
+ \edef\externalx{\the\pgf@x}%
+ \edef\externaly{\the\pgf@y}%
+ %
+ % This allows anchors base east, base west, mid east and mid west,
+ % to redefine the `center' of the node to correctly calculate the
+ % border points.
+ %
+ \pgfutil@ifundefined{pgf@kiteanchorborderreferencepoint}%
+ {\let\referencepoint\centerpoint}%
+ {\let\referencepoint\pgf@kiteanchorborderreferencepoint}%
+ %
+ % Adjust the location of the external
+ % point relative to the reference point.
+ %
+ \referencepoint%
+ \pgf@xa\externalx\relax%
+ \pgf@ya\externaly\relax%
+ \advance\pgf@xa\pgf@x%
+ \advance\pgf@ya\pgf@y%
+ \edef\externalx{\the\pgf@xa}%
+ \edef\externaly{\the\pgf@ya}%
+ %
+ % Install the required points and angles.
+ %
+ \installkiteparameters%
+ %
+ % Get the angle of the external point relative to \referencepoint.
+ %
+ \pgfmathanglebetweenpoints{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
+ %
+ % *Subtract* the rotation from the external angle.
+ %
+ \pgfmathsubtract@{\pgfmathresult}{\rotate}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \let\externalangle\pgfmathresult%
+ \ifx\referencepoint\basepoint%
+ \let\angletotoppoint\baseangletotoppoint%
+ \let\angletobottompoint\baseangletobottompoint%
+ \let\angletoleftpoint\baseangletoleftpoint%
+ \let\angletorightpoint\baseangletorightpoint%
+ \else%
+ \ifx\referencepoint\midpoint%
+ \let\angletotoppoint\midangletotoppoint%
+ \let\angletobottompoint\midangletobottompoint%
+ \let\angletoleftpoint\midangletoleftpoint%
+ \let\angletorightpoint\midangletorightpoint%
+ \fi\fi%
+ %
+ % Depending on the rotation, the angle to \rightborderpoint
+ % may be smaller than the angle to \topborderpoint.
+ %
+ \ifdim\angletorightpoint pt<\angletotoppoint pt\relax%
+ \ifdim\externalangle pt<\angletorightpoint pt\relax%
+ \let\firstpoint\rightborderpoint%
+ \let\secondpoint\bottomborderpoint%
+ \else%
+ \ifdim\externalangle pt<\angletotoppoint pt\relax%
+ \let\firstpoint\rightborderpoint%
+ \let\secondpoint\topborderpoint%
+ \else%
+ \ifdim\externalangle pt<\angletoleftpoint pt\relax%
+ \let\firstpoint\topborderpoint%
+ \let\secondpoint\leftborderpoint%
+ \else%
+ \ifdim\externalangle pt<\angletobottompoint pt\relax%
+ \let\firstpoint\leftborderpoint%
+ \let\secondpoint\bottomborderpoint%
+ \else%
+ \let\firstpoint\rightborderpoint%
+ \let\secondpoint\bottomborderpoint%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \ifdim\externalangle pt<\angletotoppoint pt\relax%
+ \let\firstpoint\rightborderpoint%
+ \let\secondpoint\topborderpoint%
+ \else%
+ \ifdim\externalangle pt<\angletoleftpoint pt\relax%
+ \let\firstpoint\leftborderpoint%
+ \let\secondpoint\topborderpoint%
+ \else%
+ \ifdim\externalangle pt<\angletobottompoint pt\relax%
+ \let\firstpoint\bottomborderpoint%
+ \let\secondpoint\leftborderpoint%
+ \else%
+ \ifdim\externalangle pt<\angletorightpoint pt\relax%
+ \let\firstpoint\rightborderpoint%
+ \let\secondpoint\bottomborderpoint%
+ \else%
+ \let\firstpoint\rightborderpoint%
+ \let\secondpoint\topborderpoint%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \pgfpointintersectionoflines{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
+ {\firstpoint}{\secondpoint}%
+ }%
+}%
@@ -2999,545 +2997,545 @@
%
\pgfkeys{/pgf/.cd,
- dart tip angle/.initial=45,
- dart tail angle/.initial=135
-}
+ dart tip angle/.initial=45,
+ dart tail angle/.initial=135,
+}%
% Shape dart.
%
\pgfdeclareshape{dart}{%
- \savedmacro\installdartparameters{%
- %
- % Get the halved angles (more useful).
- %
- \pgfmathdivide{\pgfkeysvalueof{/pgf/dart tip angle}}{2}%
- \let\halftipangle\pgfmathresult%
- \pgfmathdivide{\pgfkeysvalueof{/pgf/dart tail angle}}{2}%
- \let\halftailangle\pgfmathresult%
- %
- % Calculate some common results.
- %
- \pgfmathcot@{\halftipangle}%
- \let\cothalftipangle\pgfmathresult%
- %
- % Get the larger of the outer sep.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- \ifdim\pgf@x<\pgf@y%
- \pgf@x\pgf@y%
- \fi%
- \edef\outersep{\the\pgf@x}%
- %
- % Calculate the centre, base and mid points of the node.
- %
- \pgfextract@process\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }%
- \pgfextract@process\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt\relax%
- }%
- \pgfextract@process\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+.5ex}%
- }%
- %
- % Get the (halved) dimension of the node.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\dp\pgfnodeparttextbox%
- %
- % Get the length of the dart tip.
- %
- \ifpgfshapeborderusesincircle%
- %
- % Get the (unrounded) rotation.
- %
- \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
- %
- % Get the radius of the incircle.
- %
- \ifdim\pgf@x<\pgf@y%
- \pgf@x\pgf@y%
- \fi%
- \pgf@x1.41421\pgf@x%
- %
- % Calculate the length of the dart tip.
- %
- \pgf@xa\cothalftipangle\pgf@x%
- \advance\pgf@xa\pgf@x%
- \else%
- %
- % Get the rotation (with rounding).
- %
- \pgfmathmod{\pgfkeysvalueof{/pgf/shape border rotate}}{360}%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \expandafter\c@pgf@counta\pgfmathresult\relax\pgfmath@%
- \advance\c@pgf@counta45\relax%
- \divide\c@pgf@counta90\relax%
- \multiply\c@pgf@counta90\relax%
- \ifnum\c@pgf@counta<0\relax%
- \advance\c@pgf@counta360\relax%
- \fi%
- \edef\rotate{\the\c@pgf@counta}%
- %
- % Flip the width and height of the node contents,
- % according to the appropriate border rotation.
- %
- \ifnum\c@pgf@counta=90\relax%
- \pgf@xc\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y\pgf@xc%
- \else%
- \ifnum\c@pgf@counta=270\relax%
- \pgf@xc\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y\pgf@xc%
- \fi%
- \fi%
- %
- % Calculate the length of the dart tip.
- %
- \pgf@xa\cothalftipangle\pgf@y%
- \advance\pgf@xa2.0\pgf@x%
- \fi%
- %
- % Get the (half) separation of the dart tails.
- %
- \pgfmathsubtract@{\halftailangle}{\halftipangle}%
- \pgfmathcosec@{\pgfmathresult}%
- \pgf@ya\pgfmathresult\pgf@xa%
- \pgfmathsin@{\halftipangle}%
- \pgf@ya\pgfmathresult\pgf@ya%
- \pgfmathcos@{\halftipangle}%
- \pgf@ya\pgfmathresult\pgf@ya%
- %
- % Get the total length of the dart...
- %
- \pgf@xb\cothalftipangle\pgf@ya%
- %
- % and hence the length of the tails.
- %
- \pgf@xc-\pgf@xa%
- \advance\pgf@xc\pgf@xb%
- %
- % Adjust for minimum height (length of the dart).
- %
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@xb<\pgf@y%
- \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@xb}}%
- \pgf@y\pgfmathresult\pgf@y%
- \pgf@xa\pgfmath@tonumber{\pgf@y}\pgf@xa%
- \pgf@xc\pgfmath@tonumber{\pgf@y}\pgf@xc%
- \pgf@ya\pgfmath@tonumber{\pgf@y}\pgf@ya%
- \pgf@x\pgfmath@tonumber{\pgf@y}\pgf@x%
- \fi%
- %
- % Adjust for minimum width (tail separation length).
- %
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/minimum width}}%
- \pgf@y.5\pgf@y%
- \ifdim\pgf@ya<\pgf@y%
- \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@ya}}%
- \pgf@ya\pgf@y%
- \pgf@y\pgfmathresult\pgf@y%
- \pgf@xa\pgfmath@tonumber{\pgf@y}\pgf@xa%
- \pgf@xc\pgfmath@tonumber{\pgf@y}\pgf@xc%
- \pgf@x\pgfmath@tonumber{\pgf@y}\pgf@x%
- \fi%
- \edef\dartlength{\the\pgf@xa}%
- \edef\deltax{\the\pgf@x}%
- \edef\taillength{\the\pgf@xc}%
- \edef\halftailseparation{\the\pgf@ya}
- %
- % Create the basic points on the dart (for the backgroundo path).
- %
- \pgfextract@process\tippoint{%
- \centerpoint%
- \advance\pgf@x\dartlength\relax%
- \advance\pgf@x-\deltax\relax%
- }%
- \pgfextract@process\tailcenterpoint{%
- \centerpoint%
- \advance\pgf@x-\deltax\relax%
- }%
- \pgfextract@process\lefttailpoint{%
- \centerpoint%
- \advance\pgf@x-\deltax\relax%
- \advance\pgf@x-\taillength\relax%
- \advance\pgf@y\halftailseparation\relax%
- }%
- \pgfextract@process\righttailpoint{%
- \centerpoint%
- \advance\pgf@x-\deltax\relax%
- \advance\pgf@x-\taillength\relax%
- \advance\pgf@y-\halftailseparation\relax%
- }%
- %
- % Calculate the miter vectors. At the dart tip...
- %
- \pgfextract@process\tipmiter{%
- \pgfmathcosec@{\halftipangle}%
- \pgf@x\outersep\relax%
- \pgf@x\pgfmathresult\pgf@x%
- \pgf@y0pt\relax%
- }%
- %
- % ...at the tail center...
- %
- \pgfextract@process\tailcentermiter{%
- \pgfmathcosec@{\halftailangle}%
- \pgf@x-\outersep\relax%
- \pgf@x\pgfmathresult\pgf@x%
- \pgf@y0pt\relax%
- }%
- %
- % ...at the left tail...
- %
- \pgfmathsubtract@{\halftailangle}{\halftipangle}%
- \pgfmathdivide@{\pgfmathresult}{2}%
- \let\angle\pgfmathresult%
- \pgfmathcosec@{\pgfmathresult}%
- \pgf@x\outersep\relax%
- \pgf@x\pgfmathresult\pgf@x%
- \pgfmathadd@{\angle}{90}%
- \pgfmathsubtract{\pgfmathresult}{\halftailangle}%
- \pgfmathsincos@{\pgfmathresult}%
- \pgf@ya\pgfmathresultx\pgf@x%
- \pgf@xa\pgfmathresulty\pgf@x%
- \pgfextract@process\lefttailmiter{%
- \pgf@x-\pgf@xa%
- \pgf@y\pgf@ya%
- }%
- %
- % ...and the right tail.
- %
- \pgfextract@process\righttailmiter{%
- \pgf@x-\pgf@xa%
- \pgf@y-\pgf@ya%
- }%
- %
- % Create the border points.
- %
- \pgfextract@process\tipborderpoint{%
- \pgfpointadd{\tippoint}{\tipmiter}
- }%
- \pgfextract@process\tailcenterborderpoint{%
- \pgfpointadd{\tailcenterpoint}{\tailcentermiter}%
- }%
- \pgfextract@process\lefttailborderpoint{%
- \pgfpointadd{\lefttailpoint}{\lefttailmiter}%
- }%
- \pgfextract@process\righttailborderpoint{%
- \pgfpointadd{\righttailpoint}{\righttailmiter}%
- }%
- %
- % Calculate the angles between the centerpoint
- % and the *unrotated* borderpoints.
- %
- \pgfmathanglebetweenpoints{\centerpoint}{\tipborderpoint}%
- \let\angletotip\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\tailcenterborderpoint}%
- \let\angletotailcenter\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\lefttailborderpoint}%
- \let\angletolefttail\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\righttailborderpoint}%
- \let\angletorighttail\pgfmathresult%
- %
- % Calculate the angles between the *inversly rotated*
- % basepoint and the *unrotated* borderpoints.
- %
- \pgfextract@process\rotatedbasepoint{%
- \pgfmathrotatepointaround{\basepoint}{\centerpoint}{-\rotate}%
- }%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\tipborderpoint}%
- \let\baseangletotip\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\tailcenterborderpoint}%
- \let\baseangletotailcenter\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\lefttailborderpoint}%
- \let\baseangletolefttail\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedbasepoint}{\righttailborderpoint}%
- \let\baseangletorighttail\pgfmathresult%
- %
- % Calculate the angles between the *inversly rotated*
- % midpoint and the *unrotated* borderpoints.
- %
- \pgfextract@process\rotatedmidpoint{%
- \pgfmathrotatepointaround{\midpoint}{\centerpoint}{-\rotate}%
- }%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\tipborderpoint}%
- \let\midangletotip\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\tailcenterborderpoint}%
- \let\midangletotailcenter\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\lefttailborderpoint}%
- \let\midangletolefttail\pgfmathresult%
- \pgfmathanglebetweenpoints{\rotatedmidpoint}{\righttailborderpoint}%
- \let\midangletorighttail\pgfmathresult%
- %
- % Rotate the background path points.
- %
- \pgfextract@process\tippoint{%
- \pgfmathrotatepointaround{\tippoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\tailcenterpoint{%
- \pgfmathrotatepointaround{\tailcenterpoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\lefttailpoint{%
- \pgfmathrotatepointaround{\lefttailpoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\righttailpoint{%
- \pgfmathrotatepointaround{\righttailpoint}{\centerpoint}{\rotate}%
- }%
- %
- % Calculate a radius guaranteed to be outside the dart.
- %
- \pgfextractx\pgf@xa{\pgfpointdiff{\lefttailborderpoint}{\tipborderpoint}}%
- \pgfextracty\pgf@ya{\pgfpointdiff{\lefttailborderpoint}{\righttailborderpoint}}%
- \ifdim\pgf@xa<0pt\relax%
- \pgf@xa-\pgf@xa%
- \fi%
- \ifdim\pgf@ya<0pt\relax%
- \pgf@ya-\pgf@ya%
- \fi%
- \ifdim\pgf@xa>\pgf@ya%
- \edef\externalradius{\the\pgf@xa}%
- \else%
- \edef\externalradius{\the\pgf@ya}%
- \fi%
- %
- % Rotate the border anchor points.
- %
- \pgfextract@process\tipborderpoint{%
- \pgfmathrotatepointaround{\tipborderpoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\tailcenterborderpoint{%
- \pgfmathrotatepointaround{\tailcenterborderpoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\lefttailborderpoint{%
- \pgfmathrotatepointaround{\lefttailborderpoint}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\righttailborderpoint{%
- \pgfmathrotatepointaround{\righttailborderpoint}{\centerpoint}{\rotate}%
- }%
- %
- % Save everything.
- %
- \addtosavedmacro{\rotate}%
- \addtosavedmacro{\externalradius}%
- %
- \addtosavedmacro{\tippoint}%
- \addtosavedmacro{\tailcenterpoint}%
- \addtosavedmacro{\lefttailpoint}%
- \addtosavedmacro{\righttailpoint}%
- %
- \addtosavedmacro{\tipborderpoint}%
- \addtosavedmacro{\tailcenterborderpoint}%
- \addtosavedmacro{\lefttailborderpoint}%
- \addtosavedmacro{\righttailborderpoint}%
- %
- \addtosavedmacro{\angletotip}%
- \addtosavedmacro{\angletotailcenter}%
- \addtosavedmacro{\angletolefttail}%
- \addtosavedmacro{\angletorighttail}%
- %
- \addtosavedmacro{\baseangletotip}%
- \addtosavedmacro{\baseangletotailcenter}%
- \addtosavedmacro{\baseangletolefttail}%
- \addtosavedmacro{\baseangletorighttail}%
- %
- \addtosavedmacro{\midangletotip}%
- \addtosavedmacro{\midangletotailcenter}%
- \addtosavedmacro{\midangletolefttail}%
- \addtosavedmacro{\midangletorighttail}%
- }
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }%
- \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{base}{\basepoint}%
- \anchor{base west}{%
- \installdartparameters%
- \let\pgf@dartanchorborderreferencepoint\basepoint%
- \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }
- \anchor{base east}{%
- \installdartparameters%
- \let\pgf@dartanchorborderreferencepoint\basepoint%
- \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }
- \anchor{mid}{\midpoint}%
- \anchor{mid west}{%
- \installdartparameters%
- \let\pgf@dartanchorborderreferencepoint\midpoint%
- \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }
- \anchor{mid east}{%
- \installdartparameters%
- \let\pgf@dartanchorborderreferencepoint\midpoint%
- \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }
- \anchor{north}{%
- \installdartparameters%
- \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{0pt}{\externalradius}}%
- }
- \anchor{south}{%
- \installdartparameters%
- \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{0pt}{-\externalradius}}%
- }
- \anchor{east}{%
- \installdartparameters%
- \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }
- \anchor{west}{%
- \installdartparameters%
- \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }
- \anchor{north east}{%
- \installdartparameters%
- \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{\externalradius}{\externalradius}}%
- }
- \anchor{south west}{%
- \installdartparameters%
- \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{-\externalradius}{-\externalradius}}%
- }
- \anchor{south east}{%
- \installdartparameters%
- \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{\externalradius}{-\externalradius}}%
- }
- \anchor{north west}{%
- \installdartparameters%
- \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{-\externalradius}{\externalradius}}%
- }
- \anchor{tip}{%
- \installdartparameters%
- \tipborderpoint}
- \anchor{left tail}{%
- \installdartparameters%
- \lefttailborderpoint}
- \anchor{right tail}{%
- \installdartparameters%
- \righttailborderpoint}
- \anchor{tail center}{%
- \installdartparameters%
- \tailcenterborderpoint}
- \anchor{left side}{%
- \installdartparameters%
- \pgfpointlineattime{0.5}{\tipborderpoint}{\lefttailborderpoint}}
- \anchor{right side}{%
- \installdartparameters%
- \pgfpointlineattime{0.5}{\tipborderpoint}{\righttailborderpoint}}
- \backgroundpath{%
- \installdartparameters%
- \pgfpathmoveto{\tippoint}%
- \pgfpathlineto{\lefttailpoint}%
- \pgfpathlineto{\tailcenterpoint}%
- \pgfpathlineto{\righttailpoint}%
- \pgfpathclose%
- }
- \anchorborder{%
- %
- % Save x and y.
- %
- \edef\externalx{\the\pgf@x}%
- \edef\externaly{\the\pgf@y}%
- %
- % This allows anchors base east, base west, mid east and mid west,
- % to redefine the `center' of the node to correctly calculate the
- % border points.
- %
- \pgfutil@ifundefined{pgf@dartanchorborderreferencepoint}%
- {\let\referencepoint\centerpoint}%
- {\let\referencepoint\pgf@dartanchorborderreferencepoint}%
- %
- % Adjust the location of the external
- % point relative to the reference point.
- %
- \referencepoint%
- \pgf@xa\externalx\relax%
- \pgf@ya\externaly\relax%
- \advance\pgf@xa\pgf@x%
- \advance\pgf@ya\pgf@y%
- \edef\externalx{\the\pgf@xa}%
- \edef\externaly{\the\pgf@ya}%
- %
- % Install the required points and angles.
- %
- \installdartparameters%
- %
- % Get the angle of the external point relative to \referencepoint.
- %
- \pgfmathanglebetweenpoints{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
- %
- % *Subtract* the rotation from the external angle.
- %
- \pgfmathsubtract@{\pgfmathresult}{\rotate}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \let\externalangle\pgfmathresult%
- %
- % Get the set of angles for the appropriate border point.
- %
- \ifx\referencepoint\basepoint%
- \let\angletotip\baseangletotip%
- \let\angletotailcenter\baseangletotailcenter%
- \let\angletolefttail\baseangletolefttail%
- \let\angletorighttail\baseangletorighttail%
- \else%
- \ifx\referencepoint\midpoint%
- \let\angletotip\midangletotip%
- \let\angletotailcenter\midangletotailcenter%
- \let\angletolefttail\midangletolefttail%
- \let\angletorighttail\midangletorighttail%
- \fi\fi%
- %
- % Locate the appropriate line on the border...
- %
- \ifdim\externalangle pt<\angletotip pt\relax%
- \let\firstpoint\tipborderpoint%
- \let\secondpoint\righttailborderpoint%
- \else%
- \ifdim\externalangle pt<\angletolefttail pt\relax%
- \let\firstpoint\lefttailborderpoint%
- \let\secondpoint\tipborderpoint%
- \else%
- \ifdim\externalangle pt<\angletotailcenter pt\relax%
- \let\firstpoint\lefttailborderpoint%
- \let\secondpoint\tailcenterborderpoint%
- \else%
- \ifdim\externalangle pt<\angletorighttail pt\relax%
- \let\firstpoint\righttailborderpoint%
- \let\secondpoint\tailcenterborderpoint%
- \else%
- \let\firstpoint\tipborderpoint%
- \let\secondpoint\righttailborderpoint%
- \fi%
- \fi%
- \fi%
- \fi%
- %
- % ...and thus the point on the border.
- %
- \pgfpointintersectionoflines{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
- {\firstpoint}{\secondpoint}%
- }%
-}
+ \savedmacro\installdartparameters{%
+ %
+ % Get the halved angles (more useful).
+ %
+ \pgfmathdivide{\pgfkeysvalueof{/pgf/dart tip angle}}{2}%
+ \let\halftipangle\pgfmathresult%
+ \pgfmathdivide{\pgfkeysvalueof{/pgf/dart tail angle}}{2}%
+ \let\halftailangle\pgfmathresult%
+ %
+ % Calculate some common results.
+ %
+ \pgfmathcot@{\halftipangle}%
+ \let\cothalftipangle\pgfmathresult%
+ %
+ % Get the larger of the outer sep.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@x<\pgf@y%
+ \pgf@x\pgf@y%
+ \fi%
+ \edef\outersep{\the\pgf@x}%
+ %
+ % Calculate the centre, base and mid points of the node.
+ %
+ \pgfextract@process\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \pgfextract@process\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt\relax%
+ }%
+ \pgfextract@process\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+.5ex}%
+ }%
+ %
+ % Get the (halved) dimension of the node.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y.5\dp\pgfnodeparttextbox%
+ %
+ % Get the length of the dart tip.
+ %
+ \ifpgfshapeborderusesincircle%
+ %
+ % Get the (unrounded) rotation.
+ %
+ \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
+ %
+ % Get the radius of the incircle.
+ %
+ \ifdim\pgf@x<\pgf@y%
+ \pgf@x\pgf@y%
+ \fi%
+ \pgf@x1.41421\pgf@x%
+ %
+ % Calculate the length of the dart tip.
+ %
+ \pgf@xa\cothalftipangle\pgf@x%
+ \advance\pgf@xa\pgf@x%
+ \else%
+ %
+ % Get the rotation (with rounding).
+ %
+ \pgfmathmod{\pgfkeysvalueof{/pgf/shape border rotate}}{360}%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter\c@pgf@counta\pgfmathresult\relax\pgfmath@%
+ \advance\c@pgf@counta45\relax%
+ \divide\c@pgf@counta90\relax%
+ \multiply\c@pgf@counta90\relax%
+ \ifnum\c@pgf@counta<0\relax%
+ \advance\c@pgf@counta360\relax%
+ \fi%
+ \edef\rotate{\the\c@pgf@counta}%
+ %
+ % Flip the width and height of the node contents,
+ % according to the appropriate border rotation.
+ %
+ \ifnum\c@pgf@counta=90\relax%
+ \pgf@xc\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y\pgf@xc%
+ \else%
+ \ifnum\c@pgf@counta=270\relax%
+ \pgf@xc\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y\pgf@xc%
+ \fi%
+ \fi%
+ %
+ % Calculate the length of the dart tip.
+ %
+ \pgf@xa\cothalftipangle\pgf@y%
+ \advance\pgf@xa2.0\pgf@x%
+ \fi%
+ %
+ % Get the (half) separation of the dart tails.
+ %
+ \pgfmathsubtract@{\halftailangle}{\halftipangle}%
+ \pgfmathcosec@{\pgfmathresult}%
+ \pgf@ya\pgfmathresult\pgf@xa%
+ \pgfmathsin@{\halftipangle}%
+ \pgf@ya\pgfmathresult\pgf@ya%
+ \pgfmathcos@{\halftipangle}%
+ \pgf@ya\pgfmathresult\pgf@ya%
+ %
+ % Get the total length of the dart...
+ %
+ \pgf@xb\cothalftipangle\pgf@ya%
+ %
+ % and hence the length of the tails.
+ %
+ \pgf@xc-\pgf@xa%
+ \advance\pgf@xc\pgf@xb%
+ %
+ % Adjust for minimum height (length of the dart).
+ %
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@xb<\pgf@y%
+ \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@xb}}%
+ \pgf@y\pgfmathresult\pgf@y%
+ \pgf@xa\pgfmath@tonumber{\pgf@y}\pgf@xa%
+ \pgf@xc\pgfmath@tonumber{\pgf@y}\pgf@xc%
+ \pgf@ya\pgfmath@tonumber{\pgf@y}\pgf@ya%
+ \pgf@x\pgfmath@tonumber{\pgf@y}\pgf@x%
+ \fi%
+ %
+ % Adjust for minimum width (tail separation length).
+ %
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgf@y.5\pgf@y%
+ \ifdim\pgf@ya<\pgf@y%
+ \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@ya}}%
+ \pgf@ya\pgf@y%
+ \pgf@y\pgfmathresult\pgf@y%
+ \pgf@xa\pgfmath@tonumber{\pgf@y}\pgf@xa%
+ \pgf@xc\pgfmath@tonumber{\pgf@y}\pgf@xc%
+ \pgf@x\pgfmath@tonumber{\pgf@y}\pgf@x%
+ \fi%
+ \edef\dartlength{\the\pgf@xa}%
+ \edef\deltax{\the\pgf@x}%
+ \edef\taillength{\the\pgf@xc}%
+ \edef\halftailseparation{\the\pgf@ya}
+ %
+ % Create the basic points on the dart (for the background path).
+ %
+ \pgfextract@process\tippoint{%
+ \centerpoint%
+ \advance\pgf@x\dartlength\relax%
+ \advance\pgf@x-\deltax\relax%
+ }%
+ \pgfextract@process\tailcenterpoint{%
+ \centerpoint%
+ \advance\pgf@x-\deltax\relax%
+ }%
+ \pgfextract@process\lefttailpoint{%
+ \centerpoint%
+ \advance\pgf@x-\deltax\relax%
+ \advance\pgf@x-\taillength\relax%
+ \advance\pgf@y\halftailseparation\relax%
+ }%
+ \pgfextract@process\righttailpoint{%
+ \centerpoint%
+ \advance\pgf@x-\deltax\relax%
+ \advance\pgf@x-\taillength\relax%
+ \advance\pgf@y-\halftailseparation\relax%
+ }%
+ %
+ % Calculate the miter vectors. At the dart tip...
+ %
+ \pgfextract@process\tipmiter{%
+ \pgfmathcosec@{\halftipangle}%
+ \pgf@x\outersep\relax%
+ \pgf@x\pgfmathresult\pgf@x%
+ \pgf@y0pt\relax%
+ }%
+ %
+ % ...at the tail center...
+ %
+ \pgfextract@process\tailcentermiter{%
+ \pgfmathcosec@{\halftailangle}%
+ \pgf@x-\outersep\relax%
+ \pgf@x\pgfmathresult\pgf@x%
+ \pgf@y0pt\relax%
+ }%
+ %
+ % ...at the left tail...
+ %
+ \pgfmathsubtract@{\halftailangle}{\halftipangle}%
+ \pgfmathdivide@{\pgfmathresult}{2}%
+ \let\angle\pgfmathresult%
+ \pgfmathcosec@{\pgfmathresult}%
+ \pgf@x\outersep\relax%
+ \pgf@x\pgfmathresult\pgf@x%
+ \pgfmathadd@{\angle}{90}%
+ \pgfmathsubtract{\pgfmathresult}{\halftailangle}%
+ \pgfmathsincos@{\pgfmathresult}%
+ \pgf@ya\pgfmathresultx\pgf@x%
+ \pgf@xa\pgfmathresulty\pgf@x%
+ \pgfextract@process\lefttailmiter{%
+ \pgf@x-\pgf@xa%
+ \pgf@y\pgf@ya%
+ }%
+ %
+ % ...and the right tail.
+ %
+ \pgfextract@process\righttailmiter{%
+ \pgf@x-\pgf@xa%
+ \pgf@y-\pgf@ya%
+ }%
+ %
+ % Create the border points.
+ %
+ \pgfextract@process\tipborderpoint{%
+ \pgfpointadd{\tippoint}{\tipmiter}
+ }%
+ \pgfextract@process\tailcenterborderpoint{%
+ \pgfpointadd{\tailcenterpoint}{\tailcentermiter}%
+ }%
+ \pgfextract@process\lefttailborderpoint{%
+ \pgfpointadd{\lefttailpoint}{\lefttailmiter}%
+ }%
+ \pgfextract@process\righttailborderpoint{%
+ \pgfpointadd{\righttailpoint}{\righttailmiter}%
+ }%
+ %
+ % Calculate the angles between the centerpoint
+ % and the *unrotated* borderpoints.
+ %
+ \pgfmathanglebetweenpoints{\centerpoint}{\tipborderpoint}%
+ \let\angletotip\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\tailcenterborderpoint}%
+ \let\angletotailcenter\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\lefttailborderpoint}%
+ \let\angletolefttail\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\righttailborderpoint}%
+ \let\angletorighttail\pgfmathresult%
+ %
+ % Calculate the angles between the *inversely rotated*
+ % basepoint and the *unrotated* borderpoints.
+ %
+ \pgfextract@process\rotatedbasepoint{%
+ \pgfmathrotatepointaround{\basepoint}{\centerpoint}{-\rotate}%
+ }%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\tipborderpoint}%
+ \let\baseangletotip\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\tailcenterborderpoint}%
+ \let\baseangletotailcenter\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\lefttailborderpoint}%
+ \let\baseangletolefttail\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedbasepoint}{\righttailborderpoint}%
+ \let\baseangletorighttail\pgfmathresult%
+ %
+ % Calculate the angles between the *inversely rotated*
+ % midpoint and the *unrotated* borderpoints.
+ %
+ \pgfextract@process\rotatedmidpoint{%
+ \pgfmathrotatepointaround{\midpoint}{\centerpoint}{-\rotate}%
+ }%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\tipborderpoint}%
+ \let\midangletotip\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\tailcenterborderpoint}%
+ \let\midangletotailcenter\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\lefttailborderpoint}%
+ \let\midangletolefttail\pgfmathresult%
+ \pgfmathanglebetweenpoints{\rotatedmidpoint}{\righttailborderpoint}%
+ \let\midangletorighttail\pgfmathresult%
+ %
+ % Rotate the background path points.
+ %
+ \pgfextract@process\tippoint{%
+ \pgfmathrotatepointaround{\tippoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\tailcenterpoint{%
+ \pgfmathrotatepointaround{\tailcenterpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\lefttailpoint{%
+ \pgfmathrotatepointaround{\lefttailpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\righttailpoint{%
+ \pgfmathrotatepointaround{\righttailpoint}{\centerpoint}{\rotate}%
+ }%
+ %
+ % Calculate a radius guaranteed to be outside the dart.
+ %
+ \pgfextractx\pgf@xa{\pgfpointdiff{\lefttailborderpoint}{\tipborderpoint}}%
+ \pgfextracty\pgf@ya{\pgfpointdiff{\lefttailborderpoint}{\righttailborderpoint}}%
+ \ifdim\pgf@xa<0pt\relax%
+ \pgf@xa-\pgf@xa%
+ \fi%
+ \ifdim\pgf@ya<0pt\relax%
+ \pgf@ya-\pgf@ya%
+ \fi%
+ \ifdim\pgf@xa>\pgf@ya%
+ \edef\externalradius{\the\pgf@xa}%
+ \else%
+ \edef\externalradius{\the\pgf@ya}%
+ \fi%
+ %
+ % Rotate the border anchor points.
+ %
+ \pgfextract@process\tipborderpoint{%
+ \pgfmathrotatepointaround{\tipborderpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\tailcenterborderpoint{%
+ \pgfmathrotatepointaround{\tailcenterborderpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\lefttailborderpoint{%
+ \pgfmathrotatepointaround{\lefttailborderpoint}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\righttailborderpoint{%
+ \pgfmathrotatepointaround{\righttailborderpoint}{\centerpoint}{\rotate}%
+ }%
+ %
+ % Save everything.
+ %
+ \addtosavedmacro{\rotate}%
+ \addtosavedmacro{\externalradius}%
+ %
+ \addtosavedmacro{\tippoint}%
+ \addtosavedmacro{\tailcenterpoint}%
+ \addtosavedmacro{\lefttailpoint}%
+ \addtosavedmacro{\righttailpoint}%
+ %
+ \addtosavedmacro{\tipborderpoint}%
+ \addtosavedmacro{\tailcenterborderpoint}%
+ \addtosavedmacro{\lefttailborderpoint}%
+ \addtosavedmacro{\righttailborderpoint}%
+ %
+ \addtosavedmacro{\angletotip}%
+ \addtosavedmacro{\angletotailcenter}%
+ \addtosavedmacro{\angletolefttail}%
+ \addtosavedmacro{\angletorighttail}%
+ %
+ \addtosavedmacro{\baseangletotip}%
+ \addtosavedmacro{\baseangletotailcenter}%
+ \addtosavedmacro{\baseangletolefttail}%
+ \addtosavedmacro{\baseangletorighttail}%
+ %
+ \addtosavedmacro{\midangletotip}%
+ \addtosavedmacro{\midangletotailcenter}%
+ \addtosavedmacro{\midangletolefttail}%
+ \addtosavedmacro{\midangletorighttail}%
+ }%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \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{base}{\basepoint}%
+ \anchor{base west}{%
+ \installdartparameters%
+ \let\pgf@dartanchorborderreferencepoint\basepoint%
+ \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{base east}{%
+ \installdartparameters%
+ \let\pgf@dartanchorborderreferencepoint\basepoint%
+ \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{mid}{\midpoint}%
+ \anchor{mid west}{%
+ \installdartparameters%
+ \let\pgf@dartanchorborderreferencepoint\midpoint%
+ \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{mid east}{%
+ \installdartparameters%
+ \let\pgf@dartanchorborderreferencepoint\midpoint%
+ \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{north}{%
+ \installdartparameters%
+ \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{0pt}{\externalradius}}%
+ }%
+ \anchor{south}{%
+ \installdartparameters%
+ \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{0pt}{-\externalradius}}%
+ }%
+ \anchor{east}{%
+ \installdartparameters%
+ \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{west}{%
+ \installdartparameters%
+ \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{north east}{%
+ \installdartparameters%
+ \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{\externalradius}{\externalradius}}%
+ }%
+ \anchor{south west}{%
+ \installdartparameters%
+ \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{-\externalradius}{-\externalradius}}%
+ }%
+ \anchor{south east}{%
+ \installdartparameters%
+ \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{\externalradius}{-\externalradius}}%
+ }%
+ \anchor{north west}{%
+ \installdartparameters%
+ \csname pgf@anchor@dart@border\endcsname{\pgfqpoint{-\externalradius}{\externalradius}}%
+ }%
+ \anchor{tip}{%
+ \installdartparameters%
+ \tipborderpoint}%
+ \anchor{left tail}{%
+ \installdartparameters%
+ \lefttailborderpoint}%
+ \anchor{right tail}{%
+ \installdartparameters%
+ \righttailborderpoint}%
+ \anchor{tail center}{%
+ \installdartparameters%
+ \tailcenterborderpoint}%
+ \anchor{left side}{%
+ \installdartparameters%
+ \pgfpointlineattime{0.5}{\tipborderpoint}{\lefttailborderpoint}}%
+ \anchor{right side}{%
+ \installdartparameters%
+ \pgfpointlineattime{0.5}{\tipborderpoint}{\righttailborderpoint}}%
+ \backgroundpath{%
+ \installdartparameters%
+ \pgfpathmoveto{\tippoint}%
+ \pgfpathlineto{\lefttailpoint}%
+ \pgfpathlineto{\tailcenterpoint}%
+ \pgfpathlineto{\righttailpoint}%
+ \pgfpathclose%
+ }%
+ \anchorborder{%
+ %
+ % Save x and y.
+ %
+ \edef\externalx{\the\pgf@x}%
+ \edef\externaly{\the\pgf@y}%
+ %
+ % This allows anchors base east, base west, mid east and mid west,
+ % to redefine the `center' of the node to correctly calculate the
+ % border points.
+ %
+ \pgfutil@ifundefined{pgf@dartanchorborderreferencepoint}%
+ {\let\referencepoint\centerpoint}%
+ {\let\referencepoint\pgf@dartanchorborderreferencepoint}%
+ %
+ % Adjust the location of the external
+ % point relative to the reference point.
+ %
+ \referencepoint%
+ \pgf@xa\externalx\relax%
+ \pgf@ya\externaly\relax%
+ \advance\pgf@xa\pgf@x%
+ \advance\pgf@ya\pgf@y%
+ \edef\externalx{\the\pgf@xa}%
+ \edef\externaly{\the\pgf@ya}%
+ %
+ % Install the required points and angles.
+ %
+ \installdartparameters%
+ %
+ % Get the angle of the external point relative to \referencepoint.
+ %
+ \pgfmathanglebetweenpoints{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
+ %
+ % *Subtract* the rotation from the external angle.
+ %
+ \pgfmathsubtract@{\pgfmathresult}{\rotate}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \let\externalangle\pgfmathresult%
+ %
+ % Get the set of angles for the appropriate border point.
+ %
+ \ifx\referencepoint\basepoint%
+ \let\angletotip\baseangletotip%
+ \let\angletotailcenter\baseangletotailcenter%
+ \let\angletolefttail\baseangletolefttail%
+ \let\angletorighttail\baseangletorighttail%
+ \else%
+ \ifx\referencepoint\midpoint%
+ \let\angletotip\midangletotip%
+ \let\angletotailcenter\midangletotailcenter%
+ \let\angletolefttail\midangletolefttail%
+ \let\angletorighttail\midangletorighttail%
+ \fi\fi%
+ %
+ % Locate the appropriate line on the border...
+ %
+ \ifdim\externalangle pt<\angletotip pt\relax%
+ \let\firstpoint\tipborderpoint%
+ \let\secondpoint\righttailborderpoint%
+ \else%
+ \ifdim\externalangle pt<\angletolefttail pt\relax%
+ \let\firstpoint\lefttailborderpoint%
+ \let\secondpoint\tipborderpoint%
+ \else%
+ \ifdim\externalangle pt<\angletotailcenter pt\relax%
+ \let\firstpoint\lefttailborderpoint%
+ \let\secondpoint\tailcenterborderpoint%
+ \else%
+ \ifdim\externalangle pt<\angletorighttail pt\relax%
+ \let\firstpoint\righttailborderpoint%
+ \let\secondpoint\tailcenterborderpoint%
+ \else%
+ \let\firstpoint\tipborderpoint%
+ \let\secondpoint\righttailborderpoint%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ %
+ % ...and thus the point on the border.
+ %
+ \pgfpointintersectionoflines{\referencepoint}{\pgfqpoint{\externalx}{\externaly}}%
+ {\firstpoint}{\secondpoint}%
+ }%
+}%
@@ -3545,476 +3543,476 @@
%
% /pgf/circular sector angle : the angle at the center of the sector.
%
-\pgfkeys{/pgf/circular sector angle/.initial=60}
+\pgfkeys{/pgf/circular sector angle/.initial=60}%
% Shape circular sector
%
\pgfdeclareshape{circular sector}{%
- \savedmacro\installcircularsectorparameters{%
- %
- % Define a \centerpoint, \basepoint and \midpoint.
- %
- \pgfextract@process\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }%
- %
- % Get the larger of the outer sep.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- \ifdim\pgf@x<\pgf@y%
- \pgf@x\pgf@y%
- \fi%
- \edef\outersep{\the\pgf@x}%
- %
- % Half of the sector angle is more useful.
- %
- \pgfmathmod{\pgfkeysvalueof{/pgf/circular sector angle}}{360}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \let\angle\pgfmathresult%
- \pgfmathdivide@{\pgfmathresult}{2}%
- \let\halfangle\pgfmathresult%
- %
- % Get some useful trigonometric stuff.
- %
- \pgfmathsin@{\halfangle}%
- \let\sinehalfangle\pgfmathresult%
- \pgfmathreciprocal@{\pgfmathresult}%
- \let\cosechalfangle\pgfmathresult%
- \pgfmathabs@{\halfangle}%
- \pgfmathcos@{\pgfmathresult}%
- \let\coshalfangle\pgfmathresult%
- \pgf@x\pgfmathresult pt\relax%
- \pgf@x\cosechalfangle\pgf@x%
- \edef\cothalfangle{\pgfmath@tonumber{\pgf@x}}%
- %
- % Calculate the miter length at the center,
- % according to the outer sep.
- %
- \pgf@x\outersep\relax%
- \pgf@x\cosechalfangle\pgf@x%
- \edef\centermiter{\the\pgf@x}%
- %
- % Get the start and end angles of the arc.
- %
- \pgfmathsubtract@{180}{\halfangle}%
- \let\startangle\pgfmathresult%
- \pgfmathadd@{180}{\halfangle}%
- \let\endangle\pgfmathresult%
- %
- % Get (half) the node dimensions.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\dp\pgfnodeparttextbox%
- %
- % Calculate the radius of the sector and the `center offset',
- % which is the distance between the center of the node and the
- % center of the sector.
- %
- \ifpgfshapeborderusesincircle%
- %
- % Get the rotation.
- %
- \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
- %
- % Calculate the incircle radius.
- %
- \ifdim\pgf@x<\pgf@y%
- \pgf@x\pgf@y%
- \fi%
- \pgf@x1.41421\pgf@x%
- \pgf@xa\cosechalfangle\pgf@x%
- %
- % xa is the radius, xb the offset.
- %
- \pgf@xb\pgf@xa%
- \advance\pgf@xa\pgf@x%
- \else%
- %
- % Get the rotation (with rounding).
- %
- \pgfmathmod{\pgfkeysvalueof{/pgf/shape border rotate}}{360}%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \expandafter\c@pgf@counta\pgfmathresult\relax\pgfmath@%
- \advance\c@pgf@counta45\relax%
- \divide\c@pgf@counta90\relax%
- \multiply\c@pgf@counta90\relax%
- \ifnum\c@pgf@counta<0\relax%
- \advance\c@pgf@counta360\relax%
- \fi%
- \edef\rotate{\the\c@pgf@counta}%
- %
- % Swap the height and width for relevant angles.
- %
- \ifnum\c@pgf@counta=90\relax%
- \pgf@xc\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y\pgf@xc%
- \else%
- \ifnum\c@pgf@counta=270\relax%
- \pgf@xc\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y\pgf@xc%
- \fi%
- \fi%
- %
- % xa is the radius, xb the offset.
- %
- \pgf@xa\cosechalfangle\pgf@y%
- \pgf@xa\coshalfangle\pgf@xa%
- \advance\pgf@xa\pgf@x%
- \pgf@xb\pgf@xa%
- \advance\pgf@xa\pgf@x%
- \pgfmathveclen@{\pgfmath@tonumber{\pgf@xa}}{\pgfmath@tonumber{\pgf@y}}%
- \pgf@xa\pgfmathresult pt\relax%
- \fi%
- %
- % Adjust for minimum height and width.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/minimum width}}%
- \pgf@x.5\pgf@x%
- \pgfmathsec@{\halfangle}%
- \pgf@xc\pgfmathresult\pgf@xb%
- \ifdim\pgf@xc<0pt\relax%
- \pgf@xc-\pgf@xc%
- \fi%
- \ifdim\pgf@xc<\pgf@x%
- \pgfmathreciprocal{\pgfmath@tonumber{\pgf@xc}}%
- \pgf@xc\pgfmathresult\pgf@x% Increase by ratio.
- \pgf@xa\pgfmath@tonumber{\pgf@xc}\pgf@xa%
- \pgf@xb\pgfmath@tonumber{\pgf@xc}\pgf@xb%
- \fi%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@xa<\pgf@y%
- \pgfmathreciprocal{\pgfmath@tonumber{\pgf@xa}}%
- \pgf@xc\pgfmathresult\pgf@y% Increase by ratio.
- \pgf@xa\pgf@y%
- \pgf@xb\pgfmath@tonumber{\pgf@xc}\pgf@xb%
- \fi%
- \edef\centeroffset{\the\pgf@xb}%
- \edef\radius{\the\pgf@xa}%
- %
- % Calculate the radius at sector border and the arc corners.
- %
- \advance\pgf@xa\outersep\relax%
- \edef\borderradius{\the\pgf@xa}%
- \pgf@x\outersep\relax%
- \pgf@x\cosechalfangle\pgf@x%
- \pgf@x\coshalfangle\pgf@x%
- \advance\pgf@xa\pgf@x%
- \edef\cornerradius{\the\pgf@xa}%
- %
- % Calculate the *unrotated* points for the background path.
- %
- \pgfextract@process\sectorcenter{%
- \centerpoint%
- \advance\pgf@x\centeroffset%
- }%
- \pgfextract@process\arcstart{%
- \pgfqpointpolar{\startangle}{\radius}%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \sectorcenter%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- %
- % Calculate the *unrotated* points for the anchor border.
- %
- \pgfextract@process\sectorcenterborder{%
- \sectorcenter%
- \advance\pgf@x\centermiter\relax%
- }%
- \pgfextract@process\arcstartborder{%
- \pgfqpointpolar{\startangle}{\borderradius}%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \sectorcenter%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- \pgfextract@process\arcendborder{%
- \pgfqpointpolar{\endangle}{\borderradius}%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \sectorcenter%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- \pgfextract@process\arcstartcorner{%
- \pgfqpointpolar{\startangle}{\cornerradius}%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \sectorcenterborder%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- \pgfextract@process\arcendcorner{%
- \pgfqpointpolar{\endangle}{\cornerradius}%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \sectorcenterborder%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- %
- % Calculate the *unrotated* corner angles to the \centerpoint.
- %
- \pgfmathanglebetweenpoints{\centerpoint}{\sectorcenterborder}%
- \let\angletosectorcenterborder\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\arcstartborder}%
- \let\angletoarcstartborder\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\arcendborder}%
- \let\angletoarcendborder\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\arcstartcorner}%
- \let\angletoarcstartcorner\pgfmathresult%
- \pgfmathanglebetweenpoints{\centerpoint}{\arcendcorner}%
- \let\angletoarcendcorner\pgfmathresult%
- %
- % Rotate the background path points around the note center.
- %
- \pgfextract@process\sectorcenter{%
- \pgfmathrotatepointaround{\sectorcenter}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\arcstart{%
- \pgfmathrotatepointaround{\arcstart}{\centerpoint}{\rotate}%
- }%
- %
- % Rotate the border points around the note center.
- %
- \pgfextract@process\sectorcenterborder{%
- \pgfmathrotatepointaround{\sectorcenterborder}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\arcstartborder{%
- \pgfmathrotatepointaround{\arcstartborder}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\arcendborder{%
- \pgfmathrotatepointaround{\arcendborder}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\arcstartcorner{%
- \pgfmathrotatepointaround{\arcstartcorner}{\centerpoint}{\rotate}%
- }%
- \pgfextract@process\arcendcorner{%
- \pgfmathrotatepointaround{\arcendcorner}{\centerpoint}{\rotate}%
- }%
- %
- % Add the rotation to the start and end angles.
- %
- \pgfmathadd@{\startangle}{\rotate}%
- \let\startangle\pgfmathresult%
- \pgfmathadd@{\endangle}{\rotate}%
- \let\endangle\pgfmathresult%
- %
- % Save everything.
- %
- % NB \addtosavedmacro is currently experimental. May get changed.
- %
- \addtosavedmacro{\rotate}%
- \addtosavedmacro{\centeroffset}%
- %
- \addtosavedmacro{\radius}%
- \addtosavedmacro{\borderradius}%
- \addtosavedmacro{\cornerradius}%
- %
- \addtosavedmacro{\endangle}%
- \addtosavedmacro{\startangle}%
- %
- \addtosavedmacro{\sectorcenter}%
- \addtosavedmacro{\arcstart}%
- %
- \addtosavedmacro{\sectorcenterborder}%
- \addtosavedmacro{\arcstartborder}%
- \addtosavedmacro{\arcendborder}%
- \addtosavedmacro{\arcstartcorner}%
- \addtosavedmacro{\arcendcorner}%
- %
- \addtosavedmacro{\angletosectorcenterborder}%
- \addtosavedmacro{\angletoarcstartborder}%
- \addtosavedmacro{\angletoarcendborder}%
- \addtosavedmacro{\angletoarcstartcorner}%
- \addtosavedmacro{\angletoarcendcorner}%
- }%
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }%
- \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{base}{\basepoint}
- \anchor{mid}{\midpoint}
- \anchor{arc start}{%
- \installcircularsectorparameters%
- \arcstartcorner%
- }
- \anchor{arc end}{%
- \installcircularsectorparameters%
- \arcendcorner%
- }
- \anchor{sector center}{%
- \installcircularsectorparameters%
- \sectorcenterborder%
- }
- \anchor{arc center}{%
- \installcircularsectorparameters%
- \pgfmathadd@{\rotate}{180}%
- \let\angle\pgfmathresult%
- \csname pgf@anchor@circular sector@border\endcsname{\pgfqpointpolar{\angle}{\cornerradius}}%
- }
- \anchor{north}{%
- \installcircularsectorparameters%
- \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{0pt}{\cornerradius}}%
- }
- \anchor{south}{%
- \installcircularsectorparameters%
- \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{0pt}{-\cornerradius}}%
- }
- \anchor{east}{%
- \installcircularsectorparameters%
- \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{\cornerradius}{0pt}}%
- }
- \anchor{west}{%
- \installcircularsectorparameters%
- \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{-\cornerradius}{0pt}}%
- }
- \anchor{north west}{%
- \installcircularsectorparameters%
- \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{-\cornerradius}{\cornerradius}}%
- }
- \anchor{south west}{%
- \installcircularsectorparameters%
- \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{-\cornerradius}{-\cornerradius}}%
- }
- \anchor{north east}{%
- \installcircularsectorparameters%
- \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{\cornerradius}{\cornerradius}}%
- }
- \anchor{south east}{%
- \installcircularsectorparameters%
- \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{\cornerradius}{-\cornerradius}}%
- }
- \backgroundpath{%
- \installcircularsectorparameters%
- \pgfpathmoveto{\sectorcenter}%
- \pgfpathlineto{\arcstart}%
- \ifdim\endangle pt>360pt\relax%
- \ifdim\startangle pt>360pt\relax%
- \pgfpatharc{\startangle}{\endangle}{\radius}%
- \else%
- \pgfpatharc{\startangle}{360}{\radius}%
- \pgfpatharc{0}{\endangle}{\radius}%
- \fi%
- \else%
- \pgfpatharc{\startangle}{\endangle}{\radius}%
- \fi%
- \pgfpathclose%
- }%
- \anchorborder{%
- %
- % Save x and y.
- %
- \edef\externalx{\the\pgf@x}%
- \edef\externaly{\the\pgf@y}%
- %
- % Adjust the location of the external point relative to \centerpoint.
- %
- \centerpoint%
- \pgf@xa\externalx\relax%
- \pgf@ya\externaly\relax%
- \advance\pgf@xa\pgf@x%
- \advance\pgf@ya\pgf@y%
- \edef\externalx{\the\pgf@xa}%
- \edef\externaly{\the\pgf@ya}%
- %
- % Install the required points and angles.
- %
- \installcircularsectorparameters%
- %
- % Get the angle of the external point to the \centerpoint.
- %
- \pgfmathanglebetweenpoints{\centerpoint}{\pgfqpoint{\externalx}{\externaly}}%
- \let\externalangle\pgfmathresult%
- %
- % *Subtract* the rotation from the external angle.
- %
- \pgfmathsubtract@{\pgfmathresult}{\rotate}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \let\angle\pgfmathresult%
- %
- % Determine if the line will cross the sector arc.
- %
- \ifdim\angle pt>\angletoarcendcorner pt\relax%
- \let\firstpoint\arcendcorner%
- \let\secondpoint\sectorcenterborder%
- \else%
- \ifdim\angle pt>\angletoarcendborder pt\relax%
- \let\firstpoint\arcendborder%
- \let\secondpoint\arcendcorner%
- \else%
- \ifdim\angle pt>\angletoarcstartborder pt\relax%
- \let\firstpoint\pgfutil@empty%
- \let\secondpoint\pgfutil@empty%
- \else%
- \ifdim\angle pt>\angletoarcstartcorner pt\relax%
- \let\firstpoint\arcstartborder
- \let\secondpoint\arcstartcorner
- \else%
- \let\firstpoint\sectorcenterborder%
- \let\secondpoint\arcstartcorner%
- \fi%
- \fi%
- \fi%
- \fi%
- \ifx\firstpoint\pgfutil@empty
- %
- % Calculate the angle from the centre of the semicircle to the
- % point on the semicircle arc which intersects the line from
- % the external point to the reference point...
- %
- \pgfmathanglebetweenlines{\centerpoint}{\pgfqpoint{\externalx}{\externaly}}%
- {\sectorcenter}{\centerpoint}%
- \pgfmathsin@{\pgfmathresult}%
- \let\sineangle\pgfmathresult%
- \pgf@x\borderradius\relax%
- \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@x}}%
- \let\reciprocalradius\pgfmathresult%
- \pgf@x\centeroffset\relax%
- \pgf@x\sineangle\pgf@x%
- \pgf@x\reciprocalradius\pgf@x%
- \pgfmathasin@{\pgfmath@tonumber{\pgf@x}}%
- \pgf@x\pgfmathresult pt\relax%
- \advance\pgf@x\externalangle pt\relax%
- \edef\angle{\pgfmath@tonumber{\pgf@x}}%
- %
- % ...and thus the point on the border.
- %
- \pgfpointadd{\sectorcenter}{\pgfqpointpolar{\angle}{\borderradius}}%
- \else%
- %
- % Calculate the the point where the semicircle chord intersects
- % the line from the external point to the reference point.
- %
- \pgfpointintersectionoflines{\centerpoint}{\pgfqpoint{\externalx}{\externaly}}%
- {\firstpoint}{\secondpoint}%
- \fi%
- }%
-}
+ \savedmacro\installcircularsectorparameters{%
+ %
+ % Define a \centerpoint, \basepoint and \midpoint.
+ %
+ \pgfextract@process\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ %
+ % Get the larger of the outer sep.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@x<\pgf@y%
+ \pgf@x\pgf@y%
+ \fi%
+ \edef\outersep{\the\pgf@x}%
+ %
+ % Half of the sector angle is more useful.
+ %
+ \pgfmathmod{\pgfkeysvalueof{/pgf/circular sector angle}}{360}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \let\angle\pgfmathresult%
+ \pgfmathdivide@{\pgfmathresult}{2}%
+ \let\halfangle\pgfmathresult%
+ %
+ % Get some useful trigonometric stuff.
+ %
+ \pgfmathsin@{\halfangle}%
+ \let\sinehalfangle\pgfmathresult%
+ \pgfmathreciprocal@{\pgfmathresult}%
+ \let\cosechalfangle\pgfmathresult%
+ \pgfmathabs@{\halfangle}%
+ \pgfmathcos@{\pgfmathresult}%
+ \let\coshalfangle\pgfmathresult%
+ \pgf@x\pgfmathresult pt\relax%
+ \pgf@x\cosechalfangle\pgf@x%
+ \edef\cothalfangle{\pgfmath@tonumber{\pgf@x}}%
+ %
+ % Calculate the miter length at the center,
+ % according to the outer sep.
+ %
+ \pgf@x\outersep\relax%
+ \pgf@x\cosechalfangle\pgf@x%
+ \edef\centermiter{\the\pgf@x}%
+ %
+ % Get the start and end angles of the arc.
+ %
+ \pgfmathsubtract@{180}{\halfangle}%
+ \let\startangle\pgfmathresult%
+ \pgfmathadd@{180}{\halfangle}%
+ \let\endangle\pgfmathresult%
+ %
+ % Get (half) the node dimensions.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y.5\dp\pgfnodeparttextbox%
+ %
+ % Calculate the radius of the sector and the `center offset',
+ % which is the distance between the center of the node and the
+ % center of the sector.
+ %
+ \ifpgfshapeborderusesincircle%
+ %
+ % Get the rotation.
+ %
+ \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
+ %
+ % Calculate the incircle radius.
+ %
+ \ifdim\pgf@x<\pgf@y%
+ \pgf@x\pgf@y%
+ \fi%
+ \pgf@x1.41421\pgf@x%
+ \pgf@xa\cosechalfangle\pgf@x%
+ %
+ % xa is the radius, xb the offset.
+ %
+ \pgf@xb\pgf@xa%
+ \advance\pgf@xa\pgf@x%
+ \else%
+ %
+ % Get the rotation (with rounding).
+ %
+ \pgfmathmod{\pgfkeysvalueof{/pgf/shape border rotate}}{360}%
+ \afterassignment\pgfmath@gobbletilpgfmath@%
+ \expandafter\c@pgf@counta\pgfmathresult\relax\pgfmath@%
+ \advance\c@pgf@counta45\relax%
+ \divide\c@pgf@counta90\relax%
+ \multiply\c@pgf@counta90\relax%
+ \ifnum\c@pgf@counta<0\relax%
+ \advance\c@pgf@counta360\relax%
+ \fi%
+ \edef\rotate{\the\c@pgf@counta}%
+ %
+ % Swap the height and width for relevant angles.
+ %
+ \ifnum\c@pgf@counta=90\relax%
+ \pgf@xc\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y\pgf@xc%
+ \else%
+ \ifnum\c@pgf@counta=270\relax%
+ \pgf@xc\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y\pgf@xc%
+ \fi%
+ \fi%
+ %
+ % xa is the radius, xb the offset.
+ %
+ \pgf@xa\cosechalfangle\pgf@y%
+ \pgf@xa\coshalfangle\pgf@xa%
+ \advance\pgf@xa\pgf@x%
+ \pgf@xb\pgf@xa%
+ \advance\pgf@xa\pgf@x%
+ \pgfmathveclen@{\pgfmath@tonumber{\pgf@xa}}{\pgfmath@tonumber{\pgf@y}}%
+ \pgf@xa\pgfmathresult pt\relax%
+ \fi%
+ %
+ % Adjust for minimum height and width.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgf@x.5\pgf@x%
+ \pgfmathsec@{\halfangle}%
+ \pgf@xc\pgfmathresult\pgf@xb%
+ \ifdim\pgf@xc<0pt\relax%
+ \pgf@xc-\pgf@xc%
+ \fi%
+ \ifdim\pgf@xc<\pgf@x%
+ \pgfmathreciprocal{\pgfmath@tonumber{\pgf@xc}}%
+ \pgf@xc\pgfmathresult\pgf@x% Increase by ratio.
+ \pgf@xa\pgfmath@tonumber{\pgf@xc}\pgf@xa%
+ \pgf@xb\pgfmath@tonumber{\pgf@xc}\pgf@xb%
+ \fi%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@xa<\pgf@y%
+ \pgfmathreciprocal{\pgfmath@tonumber{\pgf@xa}}%
+ \pgf@xc\pgfmathresult\pgf@y% Increase by ratio.
+ \pgf@xa\pgf@y%
+ \pgf@xb\pgfmath@tonumber{\pgf@xc}\pgf@xb%
+ \fi%
+ \edef\centeroffset{\the\pgf@xb}%
+ \edef\radius{\the\pgf@xa}%
+ %
+ % Calculate the radius at sector border and the arc corners.
+ %
+ \advance\pgf@xa\outersep\relax%
+ \edef\borderradius{\the\pgf@xa}%
+ \pgf@x\outersep\relax%
+ \pgf@x\cosechalfangle\pgf@x%
+ \pgf@x\coshalfangle\pgf@x%
+ \advance\pgf@xa\pgf@x%
+ \edef\cornerradius{\the\pgf@xa}%
+ %
+ % Calculate the *unrotated* points for the background path.
+ %
+ \pgfextract@process\sectorcenter{%
+ \centerpoint%
+ \advance\pgf@x\centeroffset%
+ }%
+ \pgfextract@process\arcstart{%
+ \pgfqpointpolar{\startangle}{\radius}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \sectorcenter%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ %
+ % Calculate the *unrotated* points for the anchor border.
+ %
+ \pgfextract@process\sectorcenterborder{%
+ \sectorcenter%
+ \advance\pgf@x\centermiter\relax%
+ }%
+ \pgfextract@process\arcstartborder{%
+ \pgfqpointpolar{\startangle}{\borderradius}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \sectorcenter%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ \pgfextract@process\arcendborder{%
+ \pgfqpointpolar{\endangle}{\borderradius}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \sectorcenter%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ \pgfextract@process\arcstartcorner{%
+ \pgfqpointpolar{\startangle}{\cornerradius}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \sectorcenterborder%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ \pgfextract@process\arcendcorner{%
+ \pgfqpointpolar{\endangle}{\cornerradius}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \sectorcenterborder%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ %
+ % Calculate the *unrotated* corner angles to the \centerpoint.
+ %
+ \pgfmathanglebetweenpoints{\centerpoint}{\sectorcenterborder}%
+ \let\angletosectorcenterborder\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\arcstartborder}%
+ \let\angletoarcstartborder\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\arcendborder}%
+ \let\angletoarcendborder\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\arcstartcorner}%
+ \let\angletoarcstartcorner\pgfmathresult%
+ \pgfmathanglebetweenpoints{\centerpoint}{\arcendcorner}%
+ \let\angletoarcendcorner\pgfmathresult%
+ %
+ % Rotate the background path points around the note center.
+ %
+ \pgfextract@process\sectorcenter{%
+ \pgfmathrotatepointaround{\sectorcenter}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\arcstart{%
+ \pgfmathrotatepointaround{\arcstart}{\centerpoint}{\rotate}%
+ }%
+ %
+ % Rotate the border points around the note center.
+ %
+ \pgfextract@process\sectorcenterborder{%
+ \pgfmathrotatepointaround{\sectorcenterborder}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\arcstartborder{%
+ \pgfmathrotatepointaround{\arcstartborder}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\arcendborder{%
+ \pgfmathrotatepointaround{\arcendborder}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\arcstartcorner{%
+ \pgfmathrotatepointaround{\arcstartcorner}{\centerpoint}{\rotate}%
+ }%
+ \pgfextract@process\arcendcorner{%
+ \pgfmathrotatepointaround{\arcendcorner}{\centerpoint}{\rotate}%
+ }%
+ %
+ % Add the rotation to the start and end angles.
+ %
+ \pgfmathadd@{\startangle}{\rotate}%
+ \let\startangle\pgfmathresult%
+ \pgfmathadd@{\endangle}{\rotate}%
+ \let\endangle\pgfmathresult%
+ %
+ % Save everything.
+ %
+ % NB \addtosavedmacro is currently experimental. May get changed.
+ %
+ \addtosavedmacro{\rotate}%
+ \addtosavedmacro{\centeroffset}%
+ %
+ \addtosavedmacro{\radius}%
+ \addtosavedmacro{\borderradius}%
+ \addtosavedmacro{\cornerradius}%
+ %
+ \addtosavedmacro{\endangle}%
+ \addtosavedmacro{\startangle}%
+ %
+ \addtosavedmacro{\sectorcenter}%
+ \addtosavedmacro{\arcstart}%
+ %
+ \addtosavedmacro{\sectorcenterborder}%
+ \addtosavedmacro{\arcstartborder}%
+ \addtosavedmacro{\arcendborder}%
+ \addtosavedmacro{\arcstartcorner}%
+ \addtosavedmacro{\arcendcorner}%
+ %
+ \addtosavedmacro{\angletosectorcenterborder}%
+ \addtosavedmacro{\angletoarcstartborder}%
+ \addtosavedmacro{\angletoarcendborder}%
+ \addtosavedmacro{\angletoarcstartcorner}%
+ \addtosavedmacro{\angletoarcendcorner}%
+ }%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \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{base}{\basepoint}%
+ \anchor{mid}{\midpoint}%
+ \anchor{arc start}{%
+ \installcircularsectorparameters%
+ \arcstartcorner%
+ }%
+ \anchor{arc end}{%
+ \installcircularsectorparameters%
+ \arcendcorner%
+ }%
+ \anchor{sector center}{%
+ \installcircularsectorparameters%
+ \sectorcenterborder%
+ }%
+ \anchor{arc center}{%
+ \installcircularsectorparameters%
+ \pgfmathadd@{\rotate}{180}%
+ \let\angle\pgfmathresult%
+ \csname pgf@anchor@circular sector@border\endcsname{\pgfqpointpolar{\angle}{\cornerradius}}%
+ }%
+ \anchor{north}{%
+ \installcircularsectorparameters%
+ \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{0pt}{\cornerradius}}%
+ }%
+ \anchor{south}{%
+ \installcircularsectorparameters%
+ \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{0pt}{-\cornerradius}}%
+ }%
+ \anchor{east}{%
+ \installcircularsectorparameters%
+ \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{\cornerradius}{0pt}}%
+ }%
+ \anchor{west}{%
+ \installcircularsectorparameters%
+ \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{-\cornerradius}{0pt}}%
+ }%
+ \anchor{north west}{%
+ \installcircularsectorparameters%
+ \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{-\cornerradius}{\cornerradius}}%
+ }%
+ \anchor{south west}{%
+ \installcircularsectorparameters%
+ \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{-\cornerradius}{-\cornerradius}}%
+ }%
+ \anchor{north east}{%
+ \installcircularsectorparameters%
+ \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{\cornerradius}{\cornerradius}}%
+ }%
+ \anchor{south east}{%
+ \installcircularsectorparameters%
+ \csname pgf@anchor@circular sector@border\endcsname{\pgfqpoint{\cornerradius}{-\cornerradius}}%
+ }%
+ \backgroundpath{%
+ \installcircularsectorparameters%
+ \pgfpathmoveto{\sectorcenter}%
+ \pgfpathlineto{\arcstart}%
+ \ifdim\endangle pt>360pt\relax%
+ \ifdim\startangle pt>360pt\relax%
+ \pgfpatharc{\startangle}{\endangle}{\radius}%
+ \else%
+ \pgfpatharc{\startangle}{360}{\radius}%
+ \pgfpatharc{0}{\endangle}{\radius}%
+ \fi%
+ \else%
+ \pgfpatharc{\startangle}{\endangle}{\radius}%
+ \fi%
+ \pgfpathclose%
+ }%
+ \anchorborder{%
+ %
+ % Save x and y.
+ %
+ \edef\externalx{\the\pgf@x}%
+ \edef\externaly{\the\pgf@y}%
+ %
+ % Adjust the location of the external point relative to \centerpoint.
+ %
+ \centerpoint%
+ \pgf@xa\externalx\relax%
+ \pgf@ya\externaly\relax%
+ \advance\pgf@xa\pgf@x%
+ \advance\pgf@ya\pgf@y%
+ \edef\externalx{\the\pgf@xa}%
+ \edef\externaly{\the\pgf@ya}%
+ %
+ % Install the required points and angles.
+ %
+ \installcircularsectorparameters%
+ %
+ % Get the angle of the external point to the \centerpoint.
+ %
+ \pgfmathanglebetweenpoints{\centerpoint}{\pgfqpoint{\externalx}{\externaly}}%
+ \let\externalangle\pgfmathresult%
+ %
+ % *Subtract* the rotation from the external angle.
+ %
+ \pgfmathsubtract@{\pgfmathresult}{\rotate}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \let\angle\pgfmathresult%
+ %
+ % Determine if the line will cross the sector arc.
+ %
+ \ifdim\angle pt>\angletoarcendcorner pt\relax%
+ \let\firstpoint\arcendcorner%
+ \let\secondpoint\sectorcenterborder%
+ \else%
+ \ifdim\angle pt>\angletoarcendborder pt\relax%
+ \let\firstpoint\arcendborder%
+ \let\secondpoint\arcendcorner%
+ \else%
+ \ifdim\angle pt>\angletoarcstartborder pt\relax%
+ \let\firstpoint\pgfutil@empty%
+ \let\secondpoint\pgfutil@empty%
+ \else%
+ \ifdim\angle pt>\angletoarcstartcorner pt\relax%
+ \let\firstpoint\arcstartborder
+ \let\secondpoint\arcstartcorner
+ \else%
+ \let\firstpoint\sectorcenterborder%
+ \let\secondpoint\arcstartcorner%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \ifx\firstpoint\pgfutil@empty
+ %
+ % Calculate the angle from the centre of the semicircle to the
+ % point on the semicircle arc which intersects the line from
+ % the external point to the reference point...
+ %
+ \pgfmathanglebetweenlines{\centerpoint}{\pgfqpoint{\externalx}{\externaly}}%
+ {\sectorcenter}{\centerpoint}%
+ \pgfmathsin@{\pgfmathresult}%
+ \let\sineangle\pgfmathresult%
+ \pgf@x\borderradius\relax%
+ \pgfmathreciprocal@{\pgfmath@tonumber{\pgf@x}}%
+ \let\reciprocalradius\pgfmathresult%
+ \pgf@x\centeroffset\relax%
+ \pgf@x\sineangle\pgf@x%
+ \pgf@x\reciprocalradius\pgf@x%
+ \pgfmathasin@{\pgfmath@tonumber{\pgf@x}}%
+ \pgf@x\pgfmathresult pt\relax%
+ \advance\pgf@x\externalangle pt\relax%
+ \edef\angle{\pgfmath@tonumber{\pgf@x}}%
+ %
+ % ...and thus the point on the border.
+ %
+ \pgfpointadd{\sectorcenter}{\pgfqpointpolar{\angle}{\borderradius}}%
+ \else%
+ %
+ % Calculate the the point where the semicircle chord intersects
+ % the line from the external point to the reference point.
+ %
+ \pgfpointintersectionoflines{\centerpoint}{\pgfqpoint{\externalx}{\externaly}}%
+ {\firstpoint}{\secondpoint}%
+ \fi%
+ }%
+}%
@@ -4023,397 +4021,397 @@
% /pgf/shape aspect : Ratio between the x and y radii of the cylinder end.
% /pgf/cylinder uses custom fill : Use a custom fill for the cylinder.
% /pgf/cylinder end fill : Custom color for the cylinder end.
-% /pgf/cylinder body fill : Custom color for the cylinderbody.
+% /pgf/cylinder body fill : Custom color for the cylinder body.
%
\newif\ifpgfcylinderusescustomfill
\pgfkeys{/pgf/.cd,
- cylinder uses custom fill/.is if=pgfcylinderusescustomfill,
- cylinder end fill/.initial=white,
- cylinder body fill/.initial=white
-}
+ cylinder uses custom fill/.is if=pgfcylinderusescustomfill,
+ cylinder end fill/.initial=white,
+ cylinder body fill/.initial=white,
+}%
\pgfdeclareshape{cylinder}{%
- \savedmacro\getcylinderpoints{%
- \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/inner xsep}}%
- \pgf@x\pgf@xc%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/inner ysep}}%
- \pgf@y\pgf@yc%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\dp\pgfnodeparttextbox%
- \ifpgfshapeborderusesincircle%
- \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
- \ifdim\pgf@x<\pgf@y%
- \pgf@x\pgf@y%
- \else%
- \pgf@y\pgf@x%
- \fi%
- \pgf@x1.414213\pgf@x%
- \pgf@y1.414213\pgf@y%
- \else%
- \pgfmathmod{\pgfkeysvalueof{/pgf/shape border rotate}}{360}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \pgfmathsetcount\c@pgf@counta{+\pgfmathresult}%
- \advance\c@pgf@counta45\relax%
- \divide\c@pgf@counta90\relax%
- \multiply\c@pgf@counta90\relax%
- \edef\rotate{\the\c@pgf@counta}%
- \ifnum\c@pgf@counta=90\relax%
- \pgf@xa\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y\pgf@xa%
- \pgf@yc\pgf@xc%
- \else%
- \ifnum\c@pgf@counta=270\relax%
- \pgf@xa\pgf@x%
- \pgf@x\pgf@y%
- \pgf@y\pgf@xa%
- \pgf@yc\pgf@xc%
- \fi%
- \fi%
- \fi%
- \addtosavedmacro\rotate%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \pgfutil@tempdima\pgfshapeaspect\pgf@ya%
- \pgfutil@tempdimb\pgf@ya%
- %
- % Adjust for minimum height.
- %
- \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/minimum width}}%
- \ifdim\pgfutil@tempdimb<.5\pgf@xc\relax%
- \pgfutil@tempdimb.5\pgf@xc%
- \pgf@ya\pgfutil@tempdimb%
- \fi%
- %
- % Calculate how far the node contents can extend into the cylinder bottom.
- %
- \pgf@yb\pgfutil@tempdimb%
- \advance\pgf@yb-\pgf@yc%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@yb}}{\pgfmath@tonumber{\pgfutil@tempdimb}}%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- \let\angle\pgfmathresult%
- \pgf@xb\pgfmathresult\pgfutil@tempdima%
- %
- % Adjust for minimum width.
- %
- \pgf@x.5\pgflinewidth%
- \advance\pgf@x2.0\pgf@xa%
- \advance\pgf@x3.0\pgfutil@tempdima%
- \advance\pgf@x-\pgf@xb%
- \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@x<\pgf@xc%
- \advance\pgf@xc-\pgf@x%
- \advance\pgf@xa.5\pgf@xc%
- \fi%
- %
- % Add the larger of the outer sep to the radii.
- %
- \pgf@x\pgfutil@tempdima\relax%
- \pgf@y\pgfutil@tempdimb\relax%
- \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/outer ysep}}%
- \ifdim\pgf@xc>\pgf@yc%
- \advance\pgf@x\pgf@xc%
- \advance\pgf@y\pgf@xc%
- \edef\outersep{\the\pgf@xc}%
- \else%
- \advance\pgf@x\pgf@yc%
- \advance\pgf@y\pgf@yc%
- \edef\outersep{\the\pgf@yc}%
- \fi%
- \edef\xradius{\the\pgf@x}%
- \edef\yradius{\the\pgf@y}%
- \addtosavedmacro\xradius%
- \addtosavedmacro\yradius%
- \addtosavedmacro\outersep%
- %
- \pgfextract@process\cylindercenter{%
- \pgf@x\pgfutil@tempdima%
- \advance\pgf@x.5\pgflinewidth%
- \advance\pgf@x\pgf@xb%
- \pgf@x.5\pgf@x%
- \pgf@y0pt%
- }%
- \addtosavedmacro\cylindercenter%
- %
- \pgfextract@process\beforetop{%
- \pgf@x\pgf@xa%
- \advance\pgf@x\pgfutil@tempdima%
- \advance\pgf@x.5\pgflinewidth%
- \pgf@y\pgf@ya%
- }%
- \pgfextract@process\afterbottom{%
- \pgf@x-\pgf@xa%
- \advance\pgf@x\pgf@xb%
- \pgf@y\pgf@ya%
- }%
- \addtosavedmacro\beforetop%
- \addtosavedmacro\afterbottom%
- \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/outer ysep}}%
- \pgfextract@process\beforetopanchor{%
- \beforetop%
- \advance\pgf@y\pgf@yc%
- }%
- \pgfextract@process\afterbottomanchor{%
- \afterbottom%
- \advance\pgf@y\pgf@yc%
- }%
- \addtosavedmacro\beforetopanchor%
- \addtosavedmacro\afterbottomanchor%
- %
- \beforetopanchor%
- \advance\pgf@x\xradius\relax%
- \ifdim\pgf@x>\pgf@y%
- \edef\externalradius{\the\pgf@x}%
- \else%
- \edef\externalradius{\the\pgf@y}%
- \fi%
- \addtosavedmacro\externalradius%
- }
- \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{shape center}{%
- \getcylinderpoints%
- \pgfmathrotatepointaround{\pgfpointadd{\cylindercenter}{\centerpoint}}%
- {\centerpoint}{\rotate}%
- }%
- \anchor{mid}{\midpoint}%
- \anchor{mid east}{%
- \getcylinderpoints%
- \let\pgf@cylinder@referencepoint\midpoint%
- \pgf@anchor@cylinder@border{\pgfqpoint{\externalradius}{0pt}}%
- }%
- \anchor{mid west}{%
- \getcylinderpoints%
- \let\pgf@cylinder@referencepoint\midpoint%
- \pgf@anchor@cylinder@border{\pgfqpoint{-\externalradius}{0pt}}%
- }%
- \anchor{base}{\basepoint}%
- \anchor{base east}{%
- \getcylinderpoints%
- \let\pgf@cylinder@referencepoint\basepoint%
- \pgf@anchor@cylinder@border{\pgfqpoint{\externalradius}{0pt}}%
- }%
- \anchor{base west}{%
- \getcylinderpoints%
- \let\pgf@cylinder@referencepoint\basepoint%
- \pgf@anchor@cylinder@border{\pgfqpoint{-\externalradius}{0pt}}%
- }%
- \anchor{north}{%
- \getcylinderpoints%
- \pgf@anchor@cylinder@border{\pgfqpoint{0pt}{\externalradius}}%
- }%
- \anchor{south}{%
- \getcylinderpoints%
- \pgf@anchor@cylinder@border{\pgfqpoint{0pt}{-\externalradius}}%
- }%
- \anchor{east}{%
- \getcylinderpoints%
- \pgf@anchor@cylinder@border{\pgfqpoint{\externalradius}{0pt}}%
- }%
- \anchor{west}{%
- \getcylinderpoints%
- \pgf@anchor@cylinder@border{\pgfqpoint{-\externalradius}{0pt}}%
- }%
- \anchor{north east}{%
- \getcylinderpoints%
- \pgf@anchor@cylinder@border{\pgfqpoint{\externalradius}{\externalradius}}%
- }%
- \anchor{south west}{%
- \getcylinderpoints%
- \pgf@anchor@cylinder@border{\pgfqpoint{-\externalradius}{-\externalradius}}%
- }%
- \anchor{south east}{%
- \getcylinderpoints%
- \pgf@anchor@cylinder@border{\pgfqpoint{\externalradius}{-\externalradius}}%
- }%
- \anchor{north west}{%
- \getcylinderpoints%
- \pgf@anchor@cylinder@border{\pgfqpoint{-\externalradius}{\externalradius}}%
- }%
- \anchor{before top}{%
- \getcylinderpoints%
- \pgfmathrotatepointaround{\pgfpointadd{\beforetopanchor}{\centerpoint}}{\centerpoint}{\rotate}%
- }
- \anchor{top}{%
- \getcylinderpoints%
- \pgfmathrotatepointaround{%
- \pgfpointadd{%
- \beforetop%
- \pgf@y0pt\relax%
- \advance\pgf@x\xradius\relax%
- }{\centerpoint}}{\centerpoint}{\rotate}%
- }
- \anchor{after top}{%
- \getcylinderpoints%
- \pgfmathrotatepointaround{\pgfpointadd{\beforetopanchor\pgf@y-\pgf@y}{\centerpoint}}{\centerpoint}{\rotate}%
- }
- \anchor{before bottom}{%
- \getcylinderpoints%
- \pgfmathrotatepointaround{\pgfpointadd{\afterbottomanchor\pgf@y-\pgf@y}{\centerpoint}}{\centerpoint}{\rotate}%
- }
- \anchor{bottom}{%
- \getcylinderpoints%
- \pgfmathrotatepointaround{%
- \pgfpointadd{%
- \afterbottom%
- \pgf@y0pt\relax%
- \advance\pgf@x-\xradius\relax%
- }{\centerpoint}}{\centerpoint}{\rotate}%
- }
- \anchor{after bottom}{%
- \getcylinderpoints%
- \pgfmathrotatepointaround{\pgfpointadd{\afterbottomanchor}{\centerpoint}}{\centerpoint}{\rotate}%
- }
- \backgroundpath{%
- \getcylinderpoints%
- {%
- \pgf@x\xradius\relax%
- \advance\pgf@x-\outersep\relax%
- \edef\xradius{\the\pgf@x}%
- \pgf@y\yradius\relax%
- \advance\pgf@y-\outersep\relax%
- \edef\yradius{\the\pgf@y}%
- \pgftransformshift{\centerpoint}%
- \pgftransformrotate{\rotate}%
- \pgfpathmoveto{\afterbottom}%
- \pgfpatharc{90}{270}{\xradius and \yradius}%
- \pgfpathlineto{\beforetop\pgf@y-\pgf@y}%
- \pgfpatharc{-90}{90}{\xradius and \yradius}%
- \pgfpathclose%
- \pgfpathmoveto{\beforetop}%
- \pgfpatharc{90}{270}{\xradius and \yradius}%
- }%
- }%
- \behindbackgroundpath{%
- \ifpgfcylinderusescustomfill%
- \getcylinderpoints%
- \pgf@x\xradius\relax%
- \advance\pgf@x-\outersep\relax%
- \edef\xradius{\the\pgf@x}%
- \pgf@y\yradius\relax%
- \advance\pgf@y-\outersep\relax%
- \edef\yradius{\the\pgf@y}%
- {%
- \pgftransformshift{\centerpoint}%
- \pgftransformrotate{\rotate}%
- \pgfpathmoveto{\afterbottom}%
- \pgfpatharc{90}{270}{\xradius and \yradius}%
- \pgfpathlineto{\beforetop\pgf@y-\pgf@y}%
- \pgfpatharc{270}{90}{\xradius and \yradius}%
- \pgfpathclose%
- \expandafter\pgfsetfillcolor\expandafter{\pgfkeysvalueof{/pgf/cylinder body fill}}%
- \pgfusepath{fill}%
- %
- \pgfpathmoveto{\beforetop}%
- \pgfpatharc{90}{-270}{\xradius and \yradius}%
- \pgfpathclose
- \expandafter\pgfsetfillcolor\expandafter{\pgfkeysvalueof{/pgf/cylinder end fill}}%
- \pgfusepath{fill}%
- }%
- \fi%
- }%
- \anchorborder{%
- \pgfextract@process\externalpoint{}%
- \getcylinderpoints%
- \pgfutil@ifundefined{pgf@cylinder@referencepoint}{\let\referencepoint\centerpoint}{%
- \let\referencepoint\pgf@cylinder@referencepoint}%
- \pgfextract@process\externalpoint{%
- \externalpoint%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \referencepoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
- \pgfmathsubtract@{\pgfmathresult}{\rotate}%
- \ifdim\pgfmathresult pt<0pt\relax%
- \pgfmathadd@{\pgfmathresult}{360}%
- \fi%
- \let\externalangle\pgfmathresult%
- %
- \pgfmathanglebetweenpoints{\referencepoint}{\pgfpointadd{\afterbottomanchor}{\centerpoint}}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\referencepoint}{\pgfpointadd{\beforetopanchor}{\centerpoint}}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathrotatepointaround{%
- \pgfmathpointintersectionoflineandarc%
- {\pgfmathrotatepointaround{\externalpoint}{\centerpoint}{-\rotate}}%
- {\pgfmathrotatepointaround{\referencepoint}{\centerpoint}{-\rotate}}%
- {%
- \beforetop%
- \pgf@xa\pgf@x%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- }%
- {0}{90}{\xradius and \yradius}%
- }{\centerpoint}{\rotate}%
- \else%
- \pgfpointintersectionoflines{%
- \pgfmathrotatepointaround{\pgfpointadd{\afterbottomanchor}{\centerpoint}}%
- {\centerpoint}{\rotate}}{%
- \pgfmathrotatepointaround{\pgfpointadd{\beforetopanchor}{\centerpoint}}%
- {\centerpoint}{\rotate}}%
- {\referencepoint}{\externalpoint}%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\referencepoint}{\pgfpointadd{\afterbottomanchor\pgf@y-\pgf@y}{\centerpoint}}%
- \ifdim\externalangle pt>\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\referencepoint}{\pgfpointadd{\beforetopanchor\pgf@y-\pgf@y}{\centerpoint}}%
- \ifdim\externalangle pt>\pgfmathresult pt\relax%
- \pgfmathrotatepointaround{%
- \pgfmathpointintersectionoflineandarc%
- {\pgfmathrotatepointaround{\externalpoint}{\centerpoint}{-\rotate}}%
- {\pgfmathrotatepointaround{\referencepoint}{\centerpoint}{-\rotate}}%
- {%
- \beforetop%
- \pgf@xa\pgf@x%
- \centerpoint
- \advance\pgf@x\pgf@xa%
- }%
- {270}{360}{\xradius and \yradius}%
- }{\centerpoint}{\rotate}%
- \else%
- \pgfpointintersectionoflines{%
- \pgfmathrotatepointaround{\pgfpointadd{\afterbottomanchor\pgf@y-\pgf@y}{\centerpoint}}%
- {\centerpoint}{\rotate}}{%
- \pgfmathrotatepointaround{\pgfpointadd{\beforetopanchor\pgf@y-\pgf@y}{\centerpoint}}%
- {\centerpoint}{\rotate}}%
- {\referencepoint}{\externalpoint}%
- \fi%
- \else%
- \pgfmathrotatepointaround{%
- \pgfmathpointintersectionoflineandarc%
- {\pgfmathrotatepointaround{\externalpoint}{\centerpoint}{-\rotate}}%
- {\pgfmathrotatepointaround{\referencepoint}{\centerpoint}{-\rotate}}%
- {%
- \afterbottom%
- \pgf@xa\pgf@x%
- \centerpoint
- \advance\pgf@x\pgf@xa%
- }%
- {90}{270}{\xradius and \yradius}%
- }{\centerpoint}{\rotate}%
- \fi%
- \fi%
- }
-}
+ \savedmacro\getcylinderpoints{%
+ \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \pgf@x\pgf@xc%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \pgf@y\pgf@yc%
+ \advance\pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y.5\dp\pgfnodeparttextbox%
+ \ifpgfshapeborderusesincircle%
+ \pgfmathsetmacro\rotate{\pgfkeysvalueof{/pgf/shape border rotate}}%
+ \ifdim\pgf@x<\pgf@y%
+ \pgf@x\pgf@y%
+ \else%
+ \pgf@y\pgf@x%
+ \fi%
+ \pgf@x1.414213\pgf@x%
+ \pgf@y1.414213\pgf@y%
+ \else%
+ \pgfmathmod{\pgfkeysvalueof{/pgf/shape border rotate}}{360}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \pgfmathsetcount\c@pgf@counta{+\pgfmathresult}%
+ \advance\c@pgf@counta45\relax%
+ \divide\c@pgf@counta90\relax%
+ \multiply\c@pgf@counta90\relax%
+ \edef\rotate{\the\c@pgf@counta}%
+ \ifnum\c@pgf@counta=90\relax%
+ \pgf@xa\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y\pgf@xa%
+ \pgf@yc\pgf@xc%
+ \else%
+ \ifnum\c@pgf@counta=270\relax%
+ \pgf@xa\pgf@x%
+ \pgf@x\pgf@y%
+ \pgf@y\pgf@xa%
+ \pgf@yc\pgf@xc%
+ \fi%
+ \fi%
+ \fi%
+ \addtosavedmacro\rotate%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \pgfutil@tempdima\pgfshapeaspect\pgf@ya%
+ \pgfutil@tempdimb\pgf@ya%
+ %
+ % Adjust for minimum height.
+ %
+ \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/minimum width}}%
+ \ifdim\pgfutil@tempdimb<.5\pgf@xc\relax%
+ \pgfutil@tempdimb.5\pgf@xc%
+ \pgf@ya\pgfutil@tempdimb%
+ \fi%
+ %
+ % Calculate how far the node contents can extend into the cylinder bottom.
+ %
+ \pgf@yb\pgfutil@tempdimb%
+ \advance\pgf@yb-\pgf@yc%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@yb}}{\pgfmath@tonumber{\pgfutil@tempdimb}}%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ \let\angle\pgfmathresult%
+ \pgf@xb\pgfmathresult\pgfutil@tempdima%
+ %
+ % Adjust for minimum width.
+ %
+ \pgf@x.5\pgflinewidth%
+ \advance\pgf@x2.0\pgf@xa%
+ \advance\pgf@x3.0\pgfutil@tempdima%
+ \advance\pgf@x-\pgf@xb%
+ \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@x<\pgf@xc%
+ \advance\pgf@xc-\pgf@x%
+ \advance\pgf@xa.5\pgf@xc%
+ \fi%
+ %
+ % Add the larger of the outer sep to the radii.
+ %
+ \pgf@x\pgfutil@tempdima\relax%
+ \pgf@y\pgfutil@tempdimb\relax%
+ \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgf@xc>\pgf@yc%
+ \advance\pgf@x\pgf@xc%
+ \advance\pgf@y\pgf@xc%
+ \edef\outersep{\the\pgf@xc}%
+ \else%
+ \advance\pgf@x\pgf@yc%
+ \advance\pgf@y\pgf@yc%
+ \edef\outersep{\the\pgf@yc}%
+ \fi%
+ \edef\xradius{\the\pgf@x}%
+ \edef\yradius{\the\pgf@y}%
+ \addtosavedmacro\xradius%
+ \addtosavedmacro\yradius%
+ \addtosavedmacro\outersep%
+ %
+ \pgfextract@process\cylindercenter{%
+ \pgf@x\pgfutil@tempdima%
+ \advance\pgf@x.5\pgflinewidth%
+ \advance\pgf@x\pgf@xb%
+ \pgf@x.5\pgf@x%
+ \pgf@y0pt%
+ }%
+ \addtosavedmacro\cylindercenter%
+ %
+ \pgfextract@process\beforetop{%
+ \pgf@x\pgf@xa%
+ \advance\pgf@x\pgfutil@tempdima%
+ \advance\pgf@x.5\pgflinewidth%
+ \pgf@y\pgf@ya%
+ }%
+ \pgfextract@process\afterbottom{%
+ \pgf@x-\pgf@xa%
+ \advance\pgf@x\pgf@xb%
+ \pgf@y\pgf@ya%
+ }%
+ \addtosavedmacro\beforetop%
+ \addtosavedmacro\afterbottom%
+ \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \pgfextract@process\beforetopanchor{%
+ \beforetop%
+ \advance\pgf@y\pgf@yc%
+ }%
+ \pgfextract@process\afterbottomanchor{%
+ \afterbottom%
+ \advance\pgf@y\pgf@yc%
+ }%
+ \addtosavedmacro\beforetopanchor%
+ \addtosavedmacro\afterbottomanchor%
+ %
+ \beforetopanchor%
+ \advance\pgf@x\xradius\relax%
+ \ifdim\pgf@x>\pgf@y%
+ \edef\externalradius{\the\pgf@x}%
+ \else%
+ \edef\externalradius{\the\pgf@y}%
+ \fi%
+ \addtosavedmacro\externalradius%
+ }%
+ \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{shape center}{%
+ \getcylinderpoints%
+ \pgfmathrotatepointaround{\pgfpointadd{\cylindercenter}{\centerpoint}}%
+ {\centerpoint}{\rotate}%
+ }%
+ \anchor{mid}{\midpoint}%
+ \anchor{mid east}{%
+ \getcylinderpoints%
+ \let\pgf@cylinder@referencepoint\midpoint%
+ \pgf@anchor@cylinder@border{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{mid west}{%
+ \getcylinderpoints%
+ \let\pgf@cylinder@referencepoint\midpoint%
+ \pgf@anchor@cylinder@border{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{base}{\basepoint}%
+ \anchor{base east}{%
+ \getcylinderpoints%
+ \let\pgf@cylinder@referencepoint\basepoint%
+ \pgf@anchor@cylinder@border{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{base west}{%
+ \getcylinderpoints%
+ \let\pgf@cylinder@referencepoint\basepoint%
+ \pgf@anchor@cylinder@border{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{north}{%
+ \getcylinderpoints%
+ \pgf@anchor@cylinder@border{\pgfqpoint{0pt}{\externalradius}}%
+ }%
+ \anchor{south}{%
+ \getcylinderpoints%
+ \pgf@anchor@cylinder@border{\pgfqpoint{0pt}{-\externalradius}}%
+ }%
+ \anchor{east}{%
+ \getcylinderpoints%
+ \pgf@anchor@cylinder@border{\pgfqpoint{\externalradius}{0pt}}%
+ }%
+ \anchor{west}{%
+ \getcylinderpoints%
+ \pgf@anchor@cylinder@border{\pgfqpoint{-\externalradius}{0pt}}%
+ }%
+ \anchor{north east}{%
+ \getcylinderpoints%
+ \pgf@anchor@cylinder@border{\pgfqpoint{\externalradius}{\externalradius}}%
+ }%
+ \anchor{south west}{%
+ \getcylinderpoints%
+ \pgf@anchor@cylinder@border{\pgfqpoint{-\externalradius}{-\externalradius}}%
+ }%
+ \anchor{south east}{%
+ \getcylinderpoints%
+ \pgf@anchor@cylinder@border{\pgfqpoint{\externalradius}{-\externalradius}}%
+ }%
+ \anchor{north west}{%
+ \getcylinderpoints%
+ \pgf@anchor@cylinder@border{\pgfqpoint{-\externalradius}{\externalradius}}%
+ }%
+ \anchor{before top}{%
+ \getcylinderpoints%
+ \pgfmathrotatepointaround{\pgfpointadd{\beforetopanchor}{\centerpoint}}{\centerpoint}{\rotate}%
+ }%
+ \anchor{top}{%
+ \getcylinderpoints%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{%
+ \beforetop%
+ \pgf@y0pt\relax%
+ \advance\pgf@x\xradius\relax%
+ }{\centerpoint}}{\centerpoint}{\rotate}%
+ }%
+ \anchor{after top}{%
+ \getcylinderpoints%
+ \pgfmathrotatepointaround{\pgfpointadd{\beforetopanchor\pgf@y-\pgf@y}{\centerpoint}}{\centerpoint}{\rotate}%
+ }%
+ \anchor{before bottom}{%
+ \getcylinderpoints%
+ \pgfmathrotatepointaround{\pgfpointadd{\afterbottomanchor\pgf@y-\pgf@y}{\centerpoint}}{\centerpoint}{\rotate}%
+ }%
+ \anchor{bottom}{%
+ \getcylinderpoints%
+ \pgfmathrotatepointaround{%
+ \pgfpointadd{%
+ \afterbottom%
+ \pgf@y0pt\relax%
+ \advance\pgf@x-\xradius\relax%
+ }{\centerpoint}}{\centerpoint}{\rotate}%
+ }%
+ \anchor{after bottom}{%
+ \getcylinderpoints%
+ \pgfmathrotatepointaround{\pgfpointadd{\afterbottomanchor}{\centerpoint}}{\centerpoint}{\rotate}%
+ }%
+ \backgroundpath{%
+ \getcylinderpoints%
+ {%
+ \pgf@x\xradius\relax%
+ \advance\pgf@x-\outersep\relax%
+ \edef\xradius{\the\pgf@x}%
+ \pgf@y\yradius\relax%
+ \advance\pgf@y-\outersep\relax%
+ \edef\yradius{\the\pgf@y}%
+ \pgftransformshift{\centerpoint}%
+ \pgftransformrotate{\rotate}%
+ \pgfpathmoveto{\afterbottom}%
+ \pgfpatharc{90}{270}{\xradius and \yradius}%
+ \pgfpathlineto{\beforetop\pgf@y-\pgf@y}%
+ \pgfpatharc{-90}{90}{\xradius and \yradius}%
+ \pgfpathclose%
+ \pgfpathmoveto{\beforetop}%
+ \pgfpatharc{90}{270}{\xradius and \yradius}%
+ }%
+ }%
+ \behindbackgroundpath{%
+ \ifpgfcylinderusescustomfill%
+ \getcylinderpoints%
+ \pgf@x\xradius\relax%
+ \advance\pgf@x-\outersep\relax%
+ \edef\xradius{\the\pgf@x}%
+ \pgf@y\yradius\relax%
+ \advance\pgf@y-\outersep\relax%
+ \edef\yradius{\the\pgf@y}%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgftransformrotate{\rotate}%
+ \pgfpathmoveto{\afterbottom}%
+ \pgfpatharc{90}{270}{\xradius and \yradius}%
+ \pgfpathlineto{\beforetop\pgf@y-\pgf@y}%
+ \pgfpatharc{270}{90}{\xradius and \yradius}%
+ \pgfpathclose%
+ \expandafter\pgfsetfillcolor\expandafter{\pgfkeysvalueof{/pgf/cylinder body fill}}%
+ \pgfusepath{fill}%
+ %
+ \pgfpathmoveto{\beforetop}%
+ \pgfpatharc{90}{-270}{\xradius and \yradius}%
+ \pgfpathclose
+ \expandafter\pgfsetfillcolor\expandafter{\pgfkeysvalueof{/pgf/cylinder end fill}}%
+ \pgfusepath{fill}%
+ }%
+ \fi%
+ }%
+ \anchorborder{%
+ \pgfextract@process\externalpoint{}%
+ \getcylinderpoints%
+ \pgfutil@ifundefined{pgf@cylinder@referencepoint}{\let\referencepoint\centerpoint}{%
+ \let\referencepoint\pgf@cylinder@referencepoint}%
+ \pgfextract@process\externalpoint{%
+ \externalpoint%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \referencepoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
+ \pgfmathsubtract@{\pgfmathresult}{\rotate}%
+ \ifdim\pgfmathresult pt<0pt\relax%
+ \pgfmathadd@{\pgfmathresult}{360}%
+ \fi%
+ \let\externalangle\pgfmathresult%
+ %
+ \pgfmathanglebetweenpoints{\referencepoint}{\pgfpointadd{\afterbottomanchor}{\centerpoint}}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\referencepoint}{\pgfpointadd{\beforetopanchor}{\centerpoint}}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathrotatepointaround{%
+ \pgfmathpointintersectionoflineandarc%
+ {\pgfmathrotatepointaround{\externalpoint}{\centerpoint}{-\rotate}}%
+ {\pgfmathrotatepointaround{\referencepoint}{\centerpoint}{-\rotate}}%
+ {%
+ \beforetop%
+ \pgf@xa\pgf@x%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ }%
+ {0}{90}{\xradius and \yradius}%
+ }{\centerpoint}{\rotate}%
+ \else%
+ \pgfpointintersectionoflines{%
+ \pgfmathrotatepointaround{\pgfpointadd{\afterbottomanchor}{\centerpoint}}%
+ {\centerpoint}{\rotate}}{%
+ \pgfmathrotatepointaround{\pgfpointadd{\beforetopanchor}{\centerpoint}}%
+ {\centerpoint}{\rotate}}%
+ {\referencepoint}{\externalpoint}%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\referencepoint}{\pgfpointadd{\afterbottomanchor\pgf@y-\pgf@y}{\centerpoint}}%
+ \ifdim\externalangle pt>\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\referencepoint}{\pgfpointadd{\beforetopanchor\pgf@y-\pgf@y}{\centerpoint}}%
+ \ifdim\externalangle pt>\pgfmathresult pt\relax%
+ \pgfmathrotatepointaround{%
+ \pgfmathpointintersectionoflineandarc%
+ {\pgfmathrotatepointaround{\externalpoint}{\centerpoint}{-\rotate}}%
+ {\pgfmathrotatepointaround{\referencepoint}{\centerpoint}{-\rotate}}%
+ {%
+ \beforetop%
+ \pgf@xa\pgf@x%
+ \centerpoint
+ \advance\pgf@x\pgf@xa%
+ }%
+ {270}{360}{\xradius and \yradius}%
+ }{\centerpoint}{\rotate}%
+ \else%
+ \pgfpointintersectionoflines{%
+ \pgfmathrotatepointaround{\pgfpointadd{\afterbottomanchor\pgf@y-\pgf@y}{\centerpoint}}%
+ {\centerpoint}{\rotate}}{%
+ \pgfmathrotatepointaround{\pgfpointadd{\beforetopanchor\pgf@y-\pgf@y}{\centerpoint}}%
+ {\centerpoint}{\rotate}}%
+ {\referencepoint}{\externalpoint}%
+ \fi%
+ \else%
+ \pgfmathrotatepointaround{%
+ \pgfmathpointintersectionoflineandarc%
+ {\pgfmathrotatepointaround{\externalpoint}{\centerpoint}{-\rotate}}%
+ {\pgfmathrotatepointaround{\referencepoint}{\centerpoint}{-\rotate}}%
+ {%
+ \afterbottom%
+ \pgf@xa\pgf@x%
+ \centerpoint
+ \advance\pgf@x\pgf@xa%
+ }%
+ {90}{270}{\xradius and \yradius}%
+ }{\centerpoint}{\rotate}%
+ \fi%
+ \fi%
+ }%
+}%
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.misc.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.misc.code.tex
index 5466b1a27f2..fe64c707c1a 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.misc.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.misc.code.tex
@@ -7,28 +7,28 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/shapes/pgflibraryshapes.misc.code.tex,v 1.5 2013/07/18 14:15:25 tantau Exp $
+\ProvidesFileRCS{pgflibraryshapes.misc.code.tex}
\pgfdeclareshape{cross out}
-{
- \inheritsavedanchors[from=rectangle] % this is nearly a 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}
+{%
+ \inheritsavedanchors[from=rectangle]% % this is nearly a 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}%
\foregroundpath{
% store lower right in xa/ya and upper right in xb/yb
\southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
@@ -39,440 +39,440 @@
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@ya}}
\pgfsetarrowsstart{}
\pgfsetarrowsend{}
- }
-}
+ }%
+}%
\pgfdeclareshape{strike out}
-{
- \inheritsavedanchors[from=rectangle] % this is nearly a 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}
+{%
+ \inheritsavedanchors[from=rectangle]% % this is nearly a 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}%
\foregroundpath{
\pgfpathmoveto{\southwest}
\pgfpathlineto{\northeast}
\pgfsetarrowsstart{}
\pgfsetarrowsend{}
- }
-}
+ }%
+}%
% 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/.style={/pgf/rounded rectangle east arc=#1},%
- rounded rectangle arc length/.initial=180%
+ 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/.style={/pgf/rounded rectangle east arc=#1},%
+ rounded rectangle arc length/.initial=180%
}%
\def\pgf@lib@sh@misc@rr@text@concave{concave}%
\def\pgf@lib@sh@misc@rr@text@convex{convex}%
\pgfdeclareshape{rounded rectangle}{%
- \savedmacro\westarc{%
- \edef\westarc{\pgfkeysvalueof{/pgf/rounded rectangle west arc}}%
- }
- \savedmacro\eastarc{%
- \edef\eastarc{\pgfkeysvalueof{/pgf/rounded rectangle east arc}}%
- }
- \savedmacro\roundedrectanglepoints{%
- %
- % Get half the arc angle, a.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/rounded rectangle arc length}}%
- \pgf@x=.5\pgf@x%
- \edef\halfarcangle{\pgfmath@tonumber{\pgf@x}}%
- \addtosavedmacro\halfarcangle%
- %
- % Get the (half) node dimensions x & y.
- %
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \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}}%
- \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%
- \fi%
- \edef\halfheight{\the\pgf@y}%
- \addtosavedmacro\halfheight%
- %
- % Calculate the radius of the arc ends.
- %
- \pgfmathcosec@{\halfarcangle}%
- \pgf@ya=\pgfmathresult\pgf@y%
- \edef\radius{\the\pgf@ya}%
- \addtosavedmacro\radius%
- %
- % Arc width = r - r*cos(a/2).
- %
- \pgfmathcos@{\halfarcangle}%
- \pgf@xa=\pgf@ya%
- \advance\pgf@xa by-\pgfmathresult\pgf@ya%
- %
- % When the node contents are pushed inside a convex arc,
- % the resulting chord has a height r - r*cos(asin(0.5*h/r)).
- %
- \pgfmathdivide{\halftextheight}{\radius}%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- \pgf@xb=\pgf@ya%
- \advance\pgf@xb by-\pgfmathresult\pgf@ya%
- %
- % 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%
- %
- \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\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%
- %
- % The node is made wider if convex arcs overlap.
- %
- \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%
- %
- \pgf@x=\halftextwidth\relax%
- \advance\pgf@x by\xoffset\relax%
- \edef\halfwidth{\the\pgf@x}%
- \addtosavedmacro\halfwidth%
- %
- \edef\arcwidth{\the\pgf@xa}%
- \addtosavedmacro\arcwidth%
- %
- \edef\chordwidth{\the\pgf@xb}%
- \addtosavedmacro\chordwidth%
- %
- \pgfmathsetlengthmacro\outerxsep{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlengthmacro\outerysep{\pgfkeysvalueof{/pgf/outer ysep}}%
- \addtosavedmacro\outerxsep%
- \addtosavedmacro\outerysep%
- %
- % calculate some horizontal adjustments made for the default miter
- % drawn when an arc meets the north or south side of the node path.
- %
- \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%
- %
- \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 by-.5\dp\pgfnodeparttextbox%
- }
- \savedanchor\midpoint{%
- \pgf@x=.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+0.5ex}%
- }
- \savedanchor\basepoint{%
- \pgf@x=.5\wd\pgfnodeparttextbox%
- \pgf@y=0pt\relax%
- }
- \anchor{center}{\centerpoint}%
- \anchor{mid}{\midpoint}%
- \anchor{mid west}{%
- \csname pgf@anchor@rounded rectangle@west\endcsname%
- \pgf@xc=\pgf@x%
- \midpoint%
- \pgf@x=\pgf@xc%
- }%
- \anchor{mid east}{%
- \csname pgf@anchor@rounded rectangle@east\endcsname%
- \pgf@xc=\pgf@x%
- \midpoint%
- \pgf@x=\pgf@xc%
- }%
- \anchor{base}{\basepoint}%
- \anchor{base west}{%
- \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}{%
- \roundedrectanglepoints%
- \pgfpointadd{\centerpoint}{\pgfpoint{+0pt}{\halfheight+\outerysep}}%
- }%
- \anchor{south}{%
- \roundedrectanglepoints%
- \pgfpointadd{\centerpoint}{\pgfpoint{+0pt}{-\halfheight-\outerysep}}%
- }%
- \anchor{west}{%
- \roundedrectanglepoints%
- \pgfpointadd{\centerpoint}{%
- \ifx\westarc\pgf@lib@sh@misc@rr@text@concave%
- \pgfpoint{-\halfwidth-\arcwidth-\concavexshift}{+0pt}%
- \else%
- \ifx\westarc\pgf@lib@sh@misc@rr@text@convex%
- \pgfpoint{-\halfwidth-\chordwidth-\outerxsep}{+0pt}%
- \else%
- \pgfpoint{-\halfwidth-\outerxsep}{+0pt}%
- \fi%
- \fi%
- }%
- }%
- \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{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{east}{%
- \roundedrectanglepoints%
- \pgfpointadd{\centerpoint}{%
- \ifx\eastarc\pgf@lib@sh@misc@rr@text@concave%
- \pgfpoint{\halfwidth+\arcwidth+\concavexshift}{+0pt}%
- \else%
- \ifx\eastarc\pgf@lib@sh@misc@rr@text@convex%
- \pgfpoint{\halfwidth+\chordwidth+\outerxsep}{+0pt}%
- \else%
- \pgfpoint{\halfwidth+\outerxsep}{+0pt}%
- \fi%
- \fi%
- }%
- }%
- \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}{%
- \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{%
- {%
- \roundedrectanglepoints%
- \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\eastarc\pgf@lib@sh@misc@rr@text@convex%
- \pgfpathlineto{\pgfpoint{\halfwidth+\chordwidth-\arcwidth}{+\halfheight}}%
- \pgfpatharc{+\halfarcangle}{+-\halfarcangle}{+\radius}%
- \else%
- \pgfpathlineto{\pgfqpoint{\halfwidth}{\halfheight}}%
- \pgfpathlineto{\pgfqpoint{\halfwidth}{-\halfheight}}%
- \fi%
- \fi%
- \ifx\westarc\pgf@lib@sh@misc@rr@text@concave%
- \pgfpathlineto{\pgfpoint{-\halfwidth-\arcwidth}{+-\halfheight}}%
- \pgfpatharc{+-\halfarcangle}{+\halfarcangle}{+\radius}%
- \else%
- \ifx\westarc\pgf@lib@sh@misc@rr@text@convex%
- \pgfpathlineto{\pgfpoint{-\halfwidth-\chordwidth+\arcwidth}{+-\halfheight}}%
- \pgfpatharc{180+\halfarcangle}{180-\halfarcangle}{+\radius}%
- \else%
- \pgfpathlineto{\pgfqpoint{-\halfwidth}{-\halfheight}}%
- \pgfpathlineto{\pgfqpoint{-\halfwidth}{\halfheight}}%
- \fi%
- \fi%
- \pgfpathclose%
- }%
- }
- \anchorborder{%
- \pgfextract@process\externalpoint{%
- \pgfextract@process\externalpoint{}%
- \pgfpointadd{\centerpoint}{\externalpoint}%
- }%
- \roundedrectanglepoints%
- %
- \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
- \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 east\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- % 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%
- {\csname pgf@anchor@rounded rectangle@north east\endcsname}%
- {\csname pgf@anchor@rounded rectangle@south east\endcsname}%
- {\externalpoint}{\centerpoint}%
- \fi%
- \else%
- % 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 west\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- % 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%
- {\csname pgf@anchor@rounded rectangle@north west\endcsname}%
- {\csname pgf@anchor@rounded rectangle@south west\endcsname}%
- {\externalpoint}{\centerpoint}%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@rounded rectangle@south east\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- % 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%
- % Between east and south east.
- \ifx\eastarc\pgf@lib@sh@misc@rr@text@convex%
- \pgfextract@process\arccenter{%
- \pgfpointadd{\centerpoint}{\pgfpoint{\halfwidth+\chordwidth-\radius}{+0pt}}%
- }%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {\arccenter}{360-\halfarcangle}{360}{\radius+\outerxsep and \radius+\outerysep}%
- \else%
- \pgfpointintersectionoflines%
- {\csname pgf@anchor@rounded rectangle@north east\endcsname}%
- {\csname pgf@anchor@rounded rectangle@south east\endcsname}%
- {\externalpoint}{\centerpoint}%
- \fi%
- \fi%
- \fi%
- \fi%
- }
-}
+ \savedmacro\westarc{%
+ \edef\westarc{\pgfkeysvalueof{/pgf/rounded rectangle west arc}}%
+ }%
+ \savedmacro\eastarc{%
+ \edef\eastarc{\pgfkeysvalueof{/pgf/rounded rectangle east arc}}%
+ }%
+ \savedmacro\roundedrectanglepoints{%
+ %
+ % Get half the arc angle, a.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/rounded rectangle arc length}}%
+ \pgf@x=.5\pgf@x%
+ \edef\halfarcangle{\pgfmath@tonumber{\pgf@x}}%
+ \addtosavedmacro\halfarcangle%
+ %
+ % Get the (half) node dimensions x & y.
+ %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \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}}%
+ \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%
+ \fi%
+ \edef\halfheight{\the\pgf@y}%
+ \addtosavedmacro\halfheight%
+ %
+ % Calculate the radius of the arc ends.
+ %
+ \pgfmathcosec@{\halfarcangle}%
+ \pgf@ya=\pgfmathresult\pgf@y%
+ \edef\radius{\the\pgf@ya}%
+ \addtosavedmacro\radius%
+ %
+ % Arc width = r - r*cos(a/2).
+ %
+ \pgfmathcos@{\halfarcangle}%
+ \pgf@xa=\pgf@ya%
+ \advance\pgf@xa by-\pgfmathresult\pgf@ya%
+ %
+ % When the node contents are pushed inside a convex arc,
+ % the resulting chord has a height r - r*cos(asin(0.5*h/r)).
+ %
+ \pgfmathdivide{\halftextheight}{\radius}%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ \pgf@xb=\pgf@ya%
+ \advance\pgf@xb by-\pgfmathresult\pgf@ya%
+ %
+ % 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%
+ %
+ \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\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%
+ %
+ % The node is made wider if convex arcs overlap.
+ %
+ \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%
+ %
+ \pgf@x=\halftextwidth\relax%
+ \advance\pgf@x by\xoffset\relax%
+ \edef\halfwidth{\the\pgf@x}%
+ \addtosavedmacro\halfwidth%
+ %
+ \edef\arcwidth{\the\pgf@xa}%
+ \addtosavedmacro\arcwidth%
+ %
+ \edef\chordwidth{\the\pgf@xb}%
+ \addtosavedmacro\chordwidth%
+ %
+ \pgfmathsetlengthmacro\outerxsep{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlengthmacro\outerysep{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \addtosavedmacro\outerxsep%
+ \addtosavedmacro\outerysep%
+ %
+ % calculate some horizontal adjustments made for the default miter
+ % drawn when an arc meets the north or south side of the node path.
+ %
+ \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%
+ %
+ \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 by-.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\midpoint{%
+ \pgf@x=.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+0.5ex}%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x=.5\wd\pgfnodeparttextbox%
+ \pgf@y=0pt\relax%
+ }%
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\midpoint}%
+ \anchor{mid west}{%
+ \csname pgf@anchor@rounded rectangle@west\endcsname%
+ \pgf@xc=\pgf@x%
+ \midpoint%
+ \pgf@x=\pgf@xc%
+ }%
+ \anchor{mid east}{%
+ \csname pgf@anchor@rounded rectangle@east\endcsname%
+ \pgf@xc=\pgf@x%
+ \midpoint%
+ \pgf@x=\pgf@xc%
+ }%
+ \anchor{base}{\basepoint}%
+ \anchor{base west}{%
+ \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}{%
+ \roundedrectanglepoints%
+ \pgfpointadd{\centerpoint}{\pgfpoint{+0pt}{\halfheight+\outerysep}}%
+ }%
+ \anchor{south}{%
+ \roundedrectanglepoints%
+ \pgfpointadd{\centerpoint}{\pgfpoint{+0pt}{-\halfheight-\outerysep}}%
+ }%
+ \anchor{west}{%
+ \roundedrectanglepoints%
+ \pgfpointadd{\centerpoint}{%
+ \ifx\westarc\pgf@lib@sh@misc@rr@text@concave%
+ \pgfpoint{-\halfwidth-\arcwidth-\concavexshift}{+0pt}%
+ \else%
+ \ifx\westarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfpoint{-\halfwidth-\chordwidth-\outerxsep}{+0pt}%
+ \else%
+ \pgfpoint{-\halfwidth-\outerxsep}{+0pt}%
+ \fi%
+ \fi%
+ }%
+ }%
+ \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{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{east}{%
+ \roundedrectanglepoints%
+ \pgfpointadd{\centerpoint}{%
+ \ifx\eastarc\pgf@lib@sh@misc@rr@text@concave%
+ \pgfpoint{\halfwidth+\arcwidth+\concavexshift}{+0pt}%
+ \else%
+ \ifx\eastarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfpoint{\halfwidth+\chordwidth+\outerxsep}{+0pt}%
+ \else%
+ \pgfpoint{\halfwidth+\outerxsep}{+0pt}%
+ \fi%
+ \fi%
+ }%
+ }%
+ \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}{%
+ \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{%
+ {%
+ \roundedrectanglepoints%
+ \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\eastarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfpathlineto{\pgfpoint{\halfwidth+\chordwidth-\arcwidth}{+\halfheight}}%
+ \pgfpatharc{+\halfarcangle}{+-\halfarcangle}{+\radius}%
+ \else%
+ \pgfpathlineto{\pgfqpoint{\halfwidth}{\halfheight}}%
+ \pgfpathlineto{\pgfqpoint{\halfwidth}{-\halfheight}}%
+ \fi%
+ \fi%
+ \ifx\westarc\pgf@lib@sh@misc@rr@text@concave%
+ \pgfpathlineto{\pgfpoint{-\halfwidth-\arcwidth}{+-\halfheight}}%
+ \pgfpatharc{+-\halfarcangle}{+\halfarcangle}{+\radius}%
+ \else%
+ \ifx\westarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfpathlineto{\pgfpoint{-\halfwidth-\chordwidth+\arcwidth}{+-\halfheight}}%
+ \pgfpatharc{180+\halfarcangle}{180-\halfarcangle}{+\radius}%
+ \else%
+ \pgfpathlineto{\pgfqpoint{-\halfwidth}{-\halfheight}}%
+ \pgfpathlineto{\pgfqpoint{-\halfwidth}{\halfheight}}%
+ \fi%
+ \fi%
+ \pgfpathclose%
+ }%
+ }%
+ \anchorborder{%
+ \pgfextract@process\externalpoint{%
+ \pgfextract@process\externalpoint{}%
+ \pgfpointadd{\centerpoint}{\externalpoint}%
+ }%
+ \roundedrectanglepoints%
+ %
+ \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
+ \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 east\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ % 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%
+ {\csname pgf@anchor@rounded rectangle@north east\endcsname}%
+ {\csname pgf@anchor@rounded rectangle@south east\endcsname}%
+ {\externalpoint}{\centerpoint}%
+ \fi%
+ \else%
+ % 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 west\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ % 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%
+ {\csname pgf@anchor@rounded rectangle@north west\endcsname}%
+ {\csname pgf@anchor@rounded rectangle@south west\endcsname}%
+ {\externalpoint}{\centerpoint}%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@rounded rectangle@south east\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ % 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%
+ % Between east and south east.
+ \ifx\eastarc\pgf@lib@sh@misc@rr@text@convex%
+ \pgfextract@process\arccenter{%
+ \pgfpointadd{\centerpoint}{\pgfpoint{\halfwidth+\chordwidth-\radius}{+0pt}}%
+ }%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {\arccenter}{360-\halfarcangle}{360}{\radius+\outerxsep and \radius+\outerysep}%
+ \else%
+ \pgfpointintersectionoflines%
+ {\csname pgf@anchor@rounded rectangle@north east\endcsname}%
+ {\csname pgf@anchor@rounded rectangle@south east\endcsname}%
+ {\externalpoint}{\centerpoint}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ }%
+}%
@@ -483,74 +483,74 @@
% /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@lib@sh@misc@cr@corners}
-\pgfkeys{/tikz/chamfered rectangle corners/.store in=\pgf@lib@sh@misc@cr@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@lib@sh@misc@cr@chamferall{chamfer all}%
-\def\pgf@lib@sh@misc@cr@chamfer{chamfer}
+\def\pgf@lib@sh@misc@cr@chamfer{chamfer}%
\let\pgf@lib@sh@misc@cr@corners\pgf@lib@sh@misc@cr@chamferall
\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@lib@sh@misc@cr@corners}{chamfer all}%
- \ifpgfutil@in@%
- \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@lib@sh@misc@cr@parsecorners%
- \fi%
- \pgf@next}
+ \let\northeastcorner\pgfutil@empty%
+ \let\southeastcorner\pgfutil@empty%
+ \let\southwestcorner\pgfutil@empty%
+ \let\northwestcorner\pgfutil@empty%
+ \expandafter\pgfutil@in@\expandafter{\pgf@lib@sh@misc@cr@corners}{chamfer all}%
+ \ifpgfutil@in@%
+ \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@lib@sh@misc@cr@parsecorners%
+ \fi%
+ \pgf@next}%
\def\pgf@lib@sh@misc@cr@parsecorners{%
- \expandafter\pgf@@chamferedrectangle@parsecorners\pgf@lib@sh@misc@cr@corners,\pgf@stop,%
-}
-
+ \expandafter\pgf@@chamferedrectangle@parsecorners\pgf@lib@sh@misc@cr@corners,\pgf@stop,%
+}%
+
\def\pgf@@chamferedrectangle@parsecorners#1,{%
- \ifx#1\pgf@stop%
- \let\pgf@next\relax%
- \else%
- \pgfutil@in@{@#1@}{@north east@@top left@}%
- \ifpgfutil@in@%
- \let\northeastcorner\pgf@lib@sh@misc@cr@chamfer%
- \else%
- \pgfutil@in@{@#1@}{@south east@@bottom right@}%
- \ifpgfutil@in@%
- \let\southeastcorner\pgf@lib@sh@misc@cr@chamfer%
- \else%
- \pgfutil@in@{@#1@}{@south west@@bottom left@}%
- \ifpgfutil@in@%
- \let\southwestcorner\pgf@lib@sh@misc@cr@chamfer%
- \else%
- \pgfutil@in@{@#1@}{@north west@@top right@}%
- \ifpgfutil@in@%
- \let\northwestcorner\pgf@lib@sh@misc@cr@round%
- \fi%
- \fi%
- \fi%
- \fi%
- \let\pgf@next\pgf@@@chamferedrectangle@parsecorners%
- \fi%
- \pgf@next%
-}
+ \ifx#1\pgf@stop%
+ \let\pgf@next\relax%
+ \else%
+ \pgfutil@in@{@#1@}{@north east@@top left@}%
+ \ifpgfutil@in@%
+ \let\northeastcorner\pgf@lib@sh@misc@cr@chamfer%
+ \else%
+ \pgfutil@in@{@#1@}{@south east@@bottom right@}%
+ \ifpgfutil@in@%
+ \let\southeastcorner\pgf@lib@sh@misc@cr@chamfer%
+ \else%
+ \pgfutil@in@{@#1@}{@south west@@bottom left@}%
+ \ifpgfutil@in@%
+ \let\southwestcorner\pgf@lib@sh@misc@cr@chamfer%
+ \else%
+ \pgfutil@in@{@#1@}{@north west@@top right@}%
+ \ifpgfutil@in@%
+ \let\northwestcorner\pgf@lib@sh@misc@cr@round%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \let\pgf@next\pgf@@@chamferedrectangle@parsecorners%
+ \fi%
+ \pgf@next%
+}%
\def\pgf@@@chamferedrectangle@parsecorners{%
- \pgfutil@ifnextchar x{\pgf@@chamferedrectangle@parsecorners}{\pgf@@chamferedrectangle@parsecorners}%
+ \pgfutil@ifnextchar x{\pgf@@chamferedrectangle@parsecorners}{\pgf@@chamferedrectangle@parsecorners}%
}%
\pgfkeys{/pgf/.cd,
- chamfered rectangle angle/.initial=45,%
- chamfered rectangle xsep/.initial=.666ex,%
- chamfered rectangle ysep/.initial=.666ex%
-}
+ chamfered rectangle angle/.initial=45,%
+ chamfered rectangle xsep/.initial=.666ex,%
+ chamfered rectangle ysep/.initial=.666ex%
+}%
\pgfkeys{/pgf/chamfered rectangle sep/.style={%
- /pgf/chamfered rectangle xsep=#1,/pgf/chamfered rectangle ysep=#1}%
-}
+ /pgf/chamfered rectangle xsep=#1,/pgf/chamfered rectangle ysep=#1}%
+}%
@@ -559,569 +559,569 @@
%
%
\pgfdeclareshape{chamfered rectangle}{%
- \savedmacro\getchamferedrectanglepoints{%
- \pgf@lib@sh@misc@cr@getcorners%
- %
- % Get the node dimensions.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@xa.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@ya.5\ht\pgfnodeparttextbox%
- \advance\pgf@ya.5\dp\pgfnodeparttextbox%
- %
- % Get chamfer stuff.
- %
- \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/chamfered rectangle angle}}%
- \ifdim\pgfutil@tempdima<89pt\relax%
- \ifdim\pgfutil@tempdima<1pt\relax%
- \pgfutil@tempdima1pt\relax%
- \fi%
- \else%
- \pgfutil@tempdima89pt\relax%
- \fi%
- \pgfutil@tempdima-\pgfutil@tempdima%
- \advance\pgfutil@tempdima90pt\relax%
- \pgfmathtan@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \let\tanangle\pgfmathresult%
- \pgfmathcot@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \let\cotangle\pgfmathresult%
- \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/chamfered rectangle xsep}}%
- \pgf@yc\tanangle\pgf@xb%
- \ifdim\pgf@yc>\pgf@ya%
- \pgf@yc\pgf@ya%
- \pgf@xb\cotangle\pgf@yc%
- \fi%
- \pgfmathcot@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/chamfered rectangle ysep}}%
- \pgf@xc\cotangle\pgf@yb%
- \ifdim\pgf@xc>\pgf@xa%
- \pgf@xc\pgf@xa%
- \pgf@yb\tanangle\pgf@xc%
- \fi%
- %
- % Check for minimum width and height%
- %
- \pgfutil@tempdima\pgf@xa%
- \advance\pgfutil@tempdima\pgf@xb%
- \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/minimum width}}%
- \ifdim\pgfutil@tempdima<.5\pgfutil@tempdimb%
- \pgf@xa.5\pgfutil@tempdimb%
- \advance\pgf@xa-\pgf@xb%
- \fi%
- \pgfutil@tempdima\pgf@ya%
- \advance\pgfutil@tempdima\pgf@yb%
- \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgfutil@tempdima<.5\pgfutil@tempdimb%
- \pgf@ya.5\pgfutil@tempdimb%
- \advance\pgf@ya-\pgf@yb%
- \fi%
- %
- % Define the background path points.
- %
- \pgfextract@process\centerpoint{%
- \pgfmathsetlength\pgf@x{+.5\wd\pgfnodeparttextbox}%
- \pgfmathsetlength\pgf@y{+.5\ht\pgfnodeparttextbox}%
- \pgfmathaddtolength\pgf@y{+-.5\dp\pgfnodeparttextbox}%
- }%
- \pgfextract@process\beforenortheast{%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@x\pgf@xb%
- \advance\pgf@y\pgf@ya%
- \advance\pgf@y-\pgf@yc%
- }%
- \pgfextract@process\northeast{%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- \ifx\northeastcorner\pgfutil@empty%
- \advance\pgf@x\pgf@xb%
- \advance\pgf@y\pgf@yb%
- \fi%
- }%
- \pgfextract@process\afternortheast{%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@x-\pgf@xc%
- \advance\pgf@y\pgf@ya%
- \advance\pgf@y\pgf@yb%
- }%
- \pgfextract@process\northwest{%
- \centerpoint%
- \advance\pgf@x-\pgf@xa%
- \advance\pgf@y\pgf@ya%
- \ifx\northwestcorner\pgfutil@empty%
- \advance\pgf@x-\pgf@xb%
- \advance\pgf@y\pgf@yb%
- \fi%
- }%
- \pgfextract@process\beforesouthwest{%
- \centerpoint%
- \advance\pgf@x-\pgf@xa%
- \advance\pgf@x-\pgf@xb%
- \advance\pgf@y-\pgf@ya%
- \advance\pgf@y\pgf@yc%
- }%
- \pgfextract@process\southwest{%
- \centerpoint%
- \advance\pgf@x-\pgf@xa%
- \advance\pgf@y-\pgf@ya%
- \ifx\southwestcorner\pgfutil@empty%
- \advance\pgf@x-\pgf@xb%
- \advance\pgf@y-\pgf@yb%
- \fi%
- }%
- \pgfextract@process\aftersouthwest{%
- \centerpoint%
- \advance\pgf@x-\pgf@xa%
- \advance\pgf@x\pgf@xc%
- \advance\pgf@y-\pgf@ya%
- \advance\pgf@y-\pgf@yb%
- }%
- \pgfextract@process\southeast{%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y-\pgf@ya%
- \ifx\southeastcorner\pgfutil@empty%
- \advance\pgf@x\pgf@xb%
- \advance\pgf@y-\pgf@yb%
- \fi%
- }%
- %
- % Calculate the `miter' vectors.
- %
- \pgfmathanglebetweenlines{\beforenortheast}{\afternortheast}{\beforenortheast}%
- {\beforesouthwest\pgf@ya\pgf@y\beforenortheast\pgf@y\pgf@ya}%
- \pgfutil@tempdima\pgfmathresult pt\relax%
- \ifdim\pgfutil@tempdima>180pt\relax%
- \advance\pgfutil@tempdima-180pt\relax%
- \fi%
- \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/outer xsep}}%
- \ifdim\pgfutil@tempdima<90pt\relax%
- \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgfutil@tempdimb\pgfmathresult\pgfutil@tempdimb%
- \pgfutil@tempdima0pt\relax%
- \else%
- \pgfutil@tempdima.5\pgfutil@tempdima%
- \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgfutil@tempdimb\pgfmathresult\pgfutil@tempdimb%
- \pgfutil@tempdima-\pgfutil@tempdima%
- \advance\pgfutil@tempdima90pt\relax%
- \fi%
- \pgfextract@process\before@ne@anchor{%
- \beforenortheast%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- \pgfutil@tempdima-\pgfutil@tempdima%
- \advance\pgfutil@tempdima180pt\relax%
- \pgfextract@process\before@sw@anchor{%
- \beforesouthwest%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \pgfqpointpolar{-\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- %
- \pgfmathanglebetweenlines{\afternortheast}{\aftersouthwest\pgf@xa\pgf@x\afternortheast\pgf@x\pgf@xa}%
- {\afternortheast}{\beforenortheast}%
- \pgfutil@tempdima\pgfmathresult pt\relax%
- \ifdim\pgfutil@tempdima>270pt\relax%
- \advance\pgfutil@tempdima-270pt\relax%
- \fi%
- \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/outer ysep}}%
- \ifdim\pgfutil@tempdima<90pt\relax%
- \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgfutil@tempdimb\pgfmathresult\pgfutil@tempdimb%
- \pgfutil@tempdima90pt\relax%
- \else%
- \pgfutil@tempdima.5\pgfutil@tempdima%
- \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
- \pgfutil@tempdimb\pgfmathresult\pgfutil@tempdimb%
- \fi%
- %
- \pgfextract@process\after@ne@anchor{%
- \afternortheast%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- \pgfutil@tempdima-\pgfutil@tempdima%
- \advance\pgfutil@tempdima180pt\relax%
- \pgfextract@process\after@sw@anchor{%
- \aftersouthwest
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \pgfqpointpolar{-\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- \addtosavedmacro\before@ne@anchor%
- \addtosavedmacro\after@ne@anchor%
- \addtosavedmacro\before@sw@anchor%
- \addtosavedmacro\after@sw@anchor%
- \pgfextract@process\ne@anchor{%
- \ifx\northeastcorner\pgfutil@empty%
- \northeast%
- \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- \else%
- \pgfpointlineattime{0.5}{\before@ne@anchor}{\after@ne@anchor}%
- \fi%
- }%
- \pgfextract@process\nw@anchor{%
- \ifx\northwestcorner\pgfutil@empty%
- \northwest%
- \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
- \else%
- \pgfpointlineattime{0.5}{%
- \before@ne@anchor%
- \pgf@ya\pgf@y
- \before@sw@anchor%
- \pgf@y\pgf@ya%
- }{%
- \after@ne@anchor%
- \pgf@ya\pgf@y
- \after@sw@anchor%
- \pgf@y\pgf@ya%
- }%
- \fi%
- }%
- \pgfextract@process\sw@anchor{%
- \ifx\southwestcorner\pgfutil@empty%
- \southwest%
- \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathaddtolength\pgf@y{-\pgfkeysvalueof{/pgf/outer ysep}}%
- \else%
- \pgfpointlineattime{0.5}{\before@sw@anchor}{\after@sw@anchor}%
- \fi%
- }%
- \pgfextract@process\se@anchor{%
- \ifx\southeastcorner\pgfutil@empty%
- \southeast%
- \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathaddtolength\pgf@y{-\pgfkeysvalueof{/pgf/outer ysep}}%
- \else%
- \pgfpointlineattime{0.5}{%
- \before@ne@anchor%
- \pgf@xa\pgf@x
- \before@sw@anchor%
- \pgf@x\pgf@xa%
- }{%
- \after@ne@anchor%
- \pgf@xa\pgf@x
- \after@sw@anchor%
- \pgf@x\pgf@xa%
- }%
- \fi%
- }%
- \addtosavedmacro\ne@anchor%
- \addtosavedmacro\nw@anchor%
- \addtosavedmacro\sw@anchor%
- \addtosavedmacro\se@anchor%
- }%
- \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{+.5ex}%
- }%
- \savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt%
- }%
- \anchor{center}{\centerpoint}%
- \anchor{mid}{\midpoint}%
- \anchor{mid east}{%
- \getchamferedrectanglepoints%
- \midpoint%
- \pgf@ya\pgf@y%
- \pgf@process{%
- \before@sw@anchor%
- \pgf@ya\pgf@y%
- \before@ne@anchor%
- \pgf@y\pgf@ya
- }%
- \ifdim\pgf@ya<\pgf@y%
- \pgfpointintersectionoflines{\midpoint}{\midpoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
- {\before@sw@anchor\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
- {\after@sw@anchor\pgf@ya\pgf@y\after@ne@anchor\pgf@y\pgf@ya}%
- \else%
- \pgf@process{\before@ne@anchor}%
- \ifdim\pgf@ya<\pgf@y%
- \pgfpointintersectionoflines{\midpoint}{\midpoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
- {\before@sw@anchor\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
- {\before@ne@anchor}%
- \else%
- \pgfpointintersectionoflines{\midpoint}{\midpoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
- {\before@ne@anchor}%
- {\after@ne@anchor}%
- \fi%
- \fi%
- }%
- \anchor{mid west}{%
- \getchamferedrectanglepoints%
- \midpoint%
- \pgf@ya\pgf@y%
- \pgf@process{\before@sw@anchor}%
- \ifdim\pgf@ya<\pgf@y%
- \pgfpointintersectionoflines{\midpoint}{\midpoint\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
- {\before@sw@anchor}{\after@sw@anchor}%
- \else%
- \pgf@process{\before@ne@anchor\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
- \ifdim\pgf@ya<\pgf@y%
- \pgfpointintersectionoflines{\midpoint}{\midpoint\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
- {\before@ne@anchor\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
- {\before@sw@anchor}%
- \else%
- \pgfpointintersectionoflines{\midpoint}{\midpoint\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
- {\before@ne@anchor\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
- {\after@ne@anchor\pgf@ya\pgf@y\after@sw@anchor\pgf@y\pgf@ya}%
- \fi%
- \fi%
- }%
- \anchor{base}{\basepoint}%
- \anchor{base east}{%
- \getchamferedrectanglepoints%
- \basepoint%
- \pgf@ya\pgf@y%
- \pgf@process{%
- \before@sw@anchor%
- \pgf@ya\pgf@y%
- \before@ne@anchor%
- \pgf@y\pgf@ya
- }%
- \ifdim\pgf@ya<\pgf@y%
- \pgfpointintersectionoflines{\basepoint}{\basepoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
- {\before@sw@anchor\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
- {\after@sw@anchor\pgf@ya\pgf@y\after@ne@anchor\pgf@y\pgf@ya}%
- \else%
- \pgf@process{\before@ne@anchor}%
- \ifdim\pgf@ya<\pgf@y%
- \pgfpointintersectionoflines{\basepoint}{\basepoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
- {\before@sw@anchor\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
- {\before@ne@anchor}%
- \else%
- \pgfpointintersectionoflines{\basepoint}{\basepoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
- {\before@ne@anchor}%
- {\after@ne@anchor}%
- \fi%
- \fi%
- }%
- \anchor{base west}{%
- \getchamferedrectanglepoints%
- \basepoint%
- \pgf@ya\pgf@y%
- \pgf@process{\before@sw@anchor}%
- \ifdim\pgf@ya<\pgf@y%
- \pgfpointintersectionoflines{\basepoint}{\basepoint\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
- {\before@sw@anchor}{\after@sw@anchor}%
- \else%
- \pgf@process{\before@ne@anchor\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
- \ifdim\pgf@ya<\pgf@y%
- \pgfpointintersectionoflines{\basepoint}{\basepoint\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
- {\before@ne@anchor\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
- {\before@sw@anchor}%
- \else%
- \pgfpointintersectionoflines{\basepoint}{\basepoint\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
- {\before@ne@anchor\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
- {\after@ne@anchor\pgf@ya\pgf@y\after@sw@anchor\pgf@y\pgf@ya}%
- \fi%
- \fi%
- }%
- \anchor{before north east}{\getchamferedrectanglepoints\before@ne@anchor}%
- \anchor{north east}{\getchamferedrectanglepoints\ne@anchor}%
- \anchor{after north east}{\getchamferedrectanglepoints\after@ne@anchor}%
- \anchor{north}{%
- \getchamferedrectanglepoints%
- \centerpoint%
- \pgf@xa\pgf@x%
- \after@ne@anchor%
- \pgf@x\pgf@xa}%
- \anchor{before north west}{%
- \getchamferedrectanglepoints%
- \after@sw@anchor%
- \pgf@xa\pgf@x%
- \after@ne@anchor%
- \pgf@x\pgf@xa}%
- \anchor{north west}{\getchamferedrectanglepoints\nw@anchor}%
- \anchor{after north west}{%
- \getchamferedrectanglepoints%
- \before@sw@anchor%
- \pgf@xa\pgf@x%
- \before@ne@anchor%
- \pgf@x\pgf@xa}%
- \anchor{west}{%
- \getchamferedrectanglepoints%
- \centerpoint%
- \pgf@ya\pgf@y%
- \before@sw@anchor%
- \pgf@y\pgf@ya}%
- \anchor{before south west}{\getchamferedrectanglepoints\before@sw@anchor}%
- \anchor{south west}{\getchamferedrectanglepoints\sw@anchor}%
- \anchor{after south west}{\getchamferedrectanglepoints\after@sw@anchor}%
- \anchor{south}{%
- \getchamferedrectanglepoints%
- \centerpoint%
- \pgf@xa\pgf@x%
- \after@sw@anchor%
- \pgf@x\pgf@xa}%
- \anchor{before south east}{%
- \getchamferedrectanglepoints%
- \after@sw@anchor%
- \pgf@ya\pgf@y%
- \after@ne@anchor%
- \pgf@y\pgf@ya}%
- \anchor{south east}{\getchamferedrectanglepoints\se@anchor}%
- \anchor{after south east}{%
- \getchamferedrectanglepoints%
- \before@sw@anchor%
- \pgf@ya\pgf@y%
- \before@ne@anchor%
- \pgf@y\pgf@ya}%
- \anchor{east}{%
- \getchamferedrectanglepoints%
- \centerpoint%
- \pgf@ya\pgf@y%
- \before@ne@anchor%
- \pgf@y\pgf@ya}%
- \backgroundpath{%
- \pgfpathmoveto{\beforenortheast}%
- \pgfpathlineto{\northeast}%
- \pgfpathlineto{\afternortheast}%
- \pgfpathlineto{\aftersouthwest\pgf@xa\pgf@x\afternortheast\pgf@x\pgf@xa}%
- \pgfpathlineto{\northwest}%
- \pgfpathlineto{\beforesouthwest\pgf@xa\pgf@x\beforenortheast\pgf@x\pgf@xa}%
- \pgfpathlineto{\beforesouthwest}%
- \pgfpathlineto{\southwest}%
- \pgfpathlineto{\aftersouthwest}%
- \pgfpathlineto{\aftersouthwest\pgf@ya\pgf@y\afternortheast\pgf@y\pgf@ya}%
- \pgfpathlineto{\southeast}%
- \pgfpathlineto{\beforesouthwest\pgf@ya\pgf@y\beforenortheast\pgf@y\pgf@ya}%
- \pgfpathclose%
- }
- \anchorborder{%
- \pgfextract@process\externalpoint{%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- }%
- \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
- \let\externalangle\pgfmathresult%
- \getchamferedrectanglepoints%
- \pgfmathanglebetweenpoints{\centerpoint}{\centerpoint\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax% west.
- \pgfmathanglebetweenpoints{\centerpoint}{\centerpoint\pgf@xa\pgf@x\after@ne@anchor\pgf@x\pgf@xa}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax% north.
- \pgfmathanglebetweenpoints{\centerpoint}{\ne@anchor}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax% north east.
- \pgfmathanglebetweenpoints{\centerpoint}{\before@ne@anchor}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax% before north east.
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\centerpoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}{\before@ne@anchor}%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\before@ne@anchor}{\ne@anchor}%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\centerpoint}{\after@ne@anchor}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax% after north east.
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\ne@anchor}{\after@ne@anchor}%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\after@ne@anchor}{\centerpoint\pgf@xa\pgf@x\after@ne@anchor\pgf@x\pgf@xa}%
- \fi%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\centerpoint}{\nw@anchor}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax% north west.
- \pgfmathanglebetweenpoints{\centerpoint}{\after@sw@anchor\pgf@xa\pgf@x\after@ne@anchor\pgf@x\pgf@xa}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax% before north west.
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\centerpoint\pgf@xa\pgf@x\after@ne@anchor\pgf@x\pgf@xa}%
- {\after@sw@anchor\pgf@xa\pgf@x\after@ne@anchor\pgf@x\pgf@xa}%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\after@sw@anchor\pgf@xa\pgf@x\after@ne@anchor\pgf@x\pgf@xa}%
- {\nw@anchor}%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\centerpoint}{\before@sw@anchor\pgf@xa\pgf@x\before@ne@anchor\pgf@x\pgf@xa}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax% after north west.
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\nw@anchor}{\before@sw@anchor\pgf@xa\pgf@x\before@ne@anchor\pgf@x\pgf@xa}%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\before@sw@anchor\pgf@xa\pgf@x\before@ne@anchor\pgf@x\pgf@xa}%
- {\before@sw@anchor\pgf@xa\pgf@x\centerpoint\pgf@x\pgf@xa}%
- \fi%
- \fi%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\centerpoint}{\centerpoint\pgf@xa\pgf@x\after@sw@anchor\pgf@x\pgf@xa}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax% south.
- \pgfmathanglebetweenpoints{\centerpoint}{\sw@anchor}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax% south west.
- \pgfmathanglebetweenpoints{\centerpoint}{\before@sw@anchor}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax% before south west.
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\before@sw@anchor\pgf@xa\pgf@x\centerpoint\pgf@x\pgf@xa}%
- {\before@sw@anchor}%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\before@sw@anchor}{\sw@anchor}%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\centerpoint}{\after@sw@anchor}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax% after south west.
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\sw@anchor}{\after@sw@anchor}%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\after@sw@anchor}{\centerpoint\pgf@xa\pgf@x\after@sw@anchor\pgf@x\pgf@xa}%
- \fi%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\centerpoint}{\se@anchor}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax% south east.
- \pgfmathanglebetweenpoints{\centerpoint}{\after@ne@anchor\pgf@xa\pgf@x\after@sw@anchor\pgf@x\pgf@xa}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax% before south east.
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\after@ne@anchor\pgf@xa\pgf@x\after@sw@anchor\pgf@x\pgf@xa}%
- {\centerpoint\pgf@xa\pgf@x\after@sw@anchor\pgf@x\pgf@xa}%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\after@ne@anchor\pgf@xa\pgf@x\after@sw@anchor\pgf@x\pgf@xa}{\se@anchor}
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\centerpoint}{\before@ne@anchor\pgf@xa\pgf@x\before@sw@anchor\pgf@x\pgf@xa}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax% after south east.
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\se@anchor}{\before@ne@anchor\pgf@xa\pgf@x\before@sw@anchor\pgf@x\pgf@xa}%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
- {\before@ne@anchor\pgf@xa\pgf@x\before@sw@anchor\pgf@x\pgf@xa}%
- {\centerpoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
- \fi%
- \fi%
- \fi%
- \fi%
- }%
-}
+ \savedmacro\getchamferedrectanglepoints{%
+ \pgf@lib@sh@misc@cr@getcorners%
+ %
+ % Get the node dimensions.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@xa.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@ya.5\ht\pgfnodeparttextbox%
+ \advance\pgf@ya.5\dp\pgfnodeparttextbox%
+ %
+ % Get chamfer stuff.
+ %
+ \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/chamfered rectangle angle}}%
+ \ifdim\pgfutil@tempdima<89pt\relax%
+ \ifdim\pgfutil@tempdima<1pt\relax%
+ \pgfutil@tempdima1pt\relax%
+ \fi%
+ \else%
+ \pgfutil@tempdima89pt\relax%
+ \fi%
+ \pgfutil@tempdima-\pgfutil@tempdima%
+ \advance\pgfutil@tempdima90pt\relax%
+ \pgfmathtan@{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \let\tanangle\pgfmathresult%
+ \pgfmathcot@{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \let\cotangle\pgfmathresult%
+ \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/chamfered rectangle xsep}}%
+ \pgf@yc\tanangle\pgf@xb%
+ \ifdim\pgf@yc>\pgf@ya%
+ \pgf@yc\pgf@ya%
+ \pgf@xb\cotangle\pgf@yc%
+ \fi%
+ \pgfmathcot@{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/chamfered rectangle ysep}}%
+ \pgf@xc\cotangle\pgf@yb%
+ \ifdim\pgf@xc>\pgf@xa%
+ \pgf@xc\pgf@xa%
+ \pgf@yb\tanangle\pgf@xc%
+ \fi%
+ %
+ % Check for minimum width and height%
+ %
+ \pgfutil@tempdima\pgf@xa%
+ \advance\pgfutil@tempdima\pgf@xb%
+ \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/minimum width}}%
+ \ifdim\pgfutil@tempdima<.5\pgfutil@tempdimb%
+ \pgf@xa.5\pgfutil@tempdimb%
+ \advance\pgf@xa-\pgf@xb%
+ \fi%
+ \pgfutil@tempdima\pgf@ya%
+ \advance\pgfutil@tempdima\pgf@yb%
+ \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgfutil@tempdima<.5\pgfutil@tempdimb%
+ \pgf@ya.5\pgfutil@tempdimb%
+ \advance\pgf@ya-\pgf@yb%
+ \fi%
+ %
+ % Define the background path points.
+ %
+ \pgfextract@process\centerpoint{%
+ \pgfmathsetlength\pgf@x{+.5\wd\pgfnodeparttextbox}%
+ \pgfmathsetlength\pgf@y{+.5\ht\pgfnodeparttextbox}%
+ \pgfmathaddtolength\pgf@y{+-.5\dp\pgfnodeparttextbox}%
+ }%
+ \pgfextract@process\beforenortheast{%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@x\pgf@xb%
+ \advance\pgf@y\pgf@ya%
+ \advance\pgf@y-\pgf@yc%
+ }%
+ \pgfextract@process\northeast{%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ \ifx\northeastcorner\pgfutil@empty%
+ \advance\pgf@x\pgf@xb%
+ \advance\pgf@y\pgf@yb%
+ \fi%
+ }%
+ \pgfextract@process\afternortheast{%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@x-\pgf@xc%
+ \advance\pgf@y\pgf@ya%
+ \advance\pgf@y\pgf@yb%
+ }%
+ \pgfextract@process\northwest{%
+ \centerpoint%
+ \advance\pgf@x-\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ \ifx\northwestcorner\pgfutil@empty%
+ \advance\pgf@x-\pgf@xb%
+ \advance\pgf@y\pgf@yb%
+ \fi%
+ }%
+ \pgfextract@process\beforesouthwest{%
+ \centerpoint%
+ \advance\pgf@x-\pgf@xa%
+ \advance\pgf@x-\pgf@xb%
+ \advance\pgf@y-\pgf@ya%
+ \advance\pgf@y\pgf@yc%
+ }%
+ \pgfextract@process\southwest{%
+ \centerpoint%
+ \advance\pgf@x-\pgf@xa%
+ \advance\pgf@y-\pgf@ya%
+ \ifx\southwestcorner\pgfutil@empty%
+ \advance\pgf@x-\pgf@xb%
+ \advance\pgf@y-\pgf@yb%
+ \fi%
+ }%
+ \pgfextract@process\aftersouthwest{%
+ \centerpoint%
+ \advance\pgf@x-\pgf@xa%
+ \advance\pgf@x\pgf@xc%
+ \advance\pgf@y-\pgf@ya%
+ \advance\pgf@y-\pgf@yb%
+ }%
+ \pgfextract@process\southeast{%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y-\pgf@ya%
+ \ifx\southeastcorner\pgfutil@empty%
+ \advance\pgf@x\pgf@xb%
+ \advance\pgf@y-\pgf@yb%
+ \fi%
+ }%
+ %
+ % Calculate the `miter' vectors.
+ %
+ \pgfmathanglebetweenlines{\beforenortheast}{\afternortheast}{\beforenortheast}%
+ {\beforesouthwest\pgf@ya\pgf@y\beforenortheast\pgf@y\pgf@ya}%
+ \pgfutil@tempdima\pgfmathresult pt\relax%
+ \ifdim\pgfutil@tempdima>180pt\relax%
+ \advance\pgfutil@tempdima-180pt\relax%
+ \fi%
+ \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \ifdim\pgfutil@tempdima<90pt\relax%
+ \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \pgfutil@tempdimb\pgfmathresult\pgfutil@tempdimb%
+ \pgfutil@tempdima0pt\relax%
+ \else%
+ \pgfutil@tempdima.5\pgfutil@tempdima%
+ \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \pgfutil@tempdimb\pgfmathresult\pgfutil@tempdimb%
+ \pgfutil@tempdima-\pgfutil@tempdima%
+ \advance\pgfutil@tempdima90pt\relax%
+ \fi%
+ \pgfextract@process\before@ne@anchor{%
+ \beforenortheast%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ \pgfutil@tempdima-\pgfutil@tempdima%
+ \advance\pgfutil@tempdima180pt\relax%
+ \pgfextract@process\before@sw@anchor{%
+ \beforesouthwest%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \pgfqpointpolar{-\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ %
+ \pgfmathanglebetweenlines{\afternortheast}{\aftersouthwest\pgf@xa\pgf@x\afternortheast\pgf@x\pgf@xa}%
+ {\afternortheast}{\beforenortheast}%
+ \pgfutil@tempdima\pgfmathresult pt\relax%
+ \ifdim\pgfutil@tempdima>270pt\relax%
+ \advance\pgfutil@tempdima-270pt\relax%
+ \fi%
+ \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \ifdim\pgfutil@tempdima<90pt\relax%
+ \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \pgfutil@tempdimb\pgfmathresult\pgfutil@tempdimb%
+ \pgfutil@tempdima90pt\relax%
+ \else%
+ \pgfutil@tempdima.5\pgfutil@tempdima%
+ \pgfmathcosec@{\pgfmath@tonumber{\pgfutil@tempdima}}%
+ \pgfutil@tempdimb\pgfmathresult\pgfutil@tempdimb%
+ \fi%
+ %
+ \pgfextract@process\after@ne@anchor{%
+ \afternortheast%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \pgfqpointpolar{\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ \pgfutil@tempdima-\pgfutil@tempdima%
+ \advance\pgfutil@tempdima180pt\relax%
+ \pgfextract@process\after@sw@anchor{%
+ \aftersouthwest
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \pgfqpointpolar{-\pgfmath@tonumber{\pgfutil@tempdima}}{\the\pgfutil@tempdimb}%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ \addtosavedmacro\before@ne@anchor%
+ \addtosavedmacro\after@ne@anchor%
+ \addtosavedmacro\before@sw@anchor%
+ \addtosavedmacro\after@sw@anchor%
+ \pgfextract@process\ne@anchor{%
+ \ifx\northeastcorner\pgfutil@empty%
+ \northeast%
+ \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \else%
+ \pgfpointlineattime{0.5}{\before@ne@anchor}{\after@ne@anchor}%
+ \fi%
+ }%
+ \pgfextract@process\nw@anchor{%
+ \ifx\northwestcorner\pgfutil@empty%
+ \northwest%
+ \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathaddtolength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \else%
+ \pgfpointlineattime{0.5}{%
+ \before@ne@anchor%
+ \pgf@ya\pgf@y
+ \before@sw@anchor%
+ \pgf@y\pgf@ya%
+ }{%
+ \after@ne@anchor%
+ \pgf@ya\pgf@y
+ \after@sw@anchor%
+ \pgf@y\pgf@ya%
+ }%
+ \fi%
+ }%
+ \pgfextract@process\sw@anchor{%
+ \ifx\southwestcorner\pgfutil@empty%
+ \southwest%
+ \pgfmathaddtolength\pgf@x{-\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathaddtolength\pgf@y{-\pgfkeysvalueof{/pgf/outer ysep}}%
+ \else%
+ \pgfpointlineattime{0.5}{\before@sw@anchor}{\after@sw@anchor}%
+ \fi%
+ }%
+ \pgfextract@process\se@anchor{%
+ \ifx\southeastcorner\pgfutil@empty%
+ \southeast%
+ \pgfmathaddtolength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathaddtolength\pgf@y{-\pgfkeysvalueof{/pgf/outer ysep}}%
+ \else%
+ \pgfpointlineattime{0.5}{%
+ \before@ne@anchor%
+ \pgf@xa\pgf@x
+ \before@sw@anchor%
+ \pgf@x\pgf@xa%
+ }{%
+ \after@ne@anchor%
+ \pgf@xa\pgf@x
+ \after@sw@anchor%
+ \pgf@x\pgf@xa%
+ }%
+ \fi%
+ }%
+ \addtosavedmacro\ne@anchor%
+ \addtosavedmacro\nw@anchor%
+ \addtosavedmacro\sw@anchor%
+ \addtosavedmacro\se@anchor%
+ }%
+ \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{+.5ex}%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt%
+ }%
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\midpoint}%
+ \anchor{mid east}{%
+ \getchamferedrectanglepoints%
+ \midpoint%
+ \pgf@ya\pgf@y%
+ \pgf@process{%
+ \before@sw@anchor%
+ \pgf@ya\pgf@y%
+ \before@ne@anchor%
+ \pgf@y\pgf@ya%
+ }%
+ \ifdim\pgf@ya<\pgf@y%
+ \pgfpointintersectionoflines{\midpoint}{\midpoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
+ {\before@sw@anchor\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
+ {\after@sw@anchor\pgf@ya\pgf@y\after@ne@anchor\pgf@y\pgf@ya}%
+ \else%
+ \pgf@process{\before@ne@anchor}%
+ \ifdim\pgf@ya<\pgf@y%
+ \pgfpointintersectionoflines{\midpoint}{\midpoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
+ {\before@sw@anchor\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
+ {\before@ne@anchor}%
+ \else%
+ \pgfpointintersectionoflines{\midpoint}{\midpoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
+ {\before@ne@anchor}%
+ {\after@ne@anchor}%
+ \fi%
+ \fi%
+ }%
+ \anchor{mid west}{%
+ \getchamferedrectanglepoints%
+ \midpoint%
+ \pgf@ya\pgf@y%
+ \pgf@process{\before@sw@anchor}%
+ \ifdim\pgf@ya<\pgf@y%
+ \pgfpointintersectionoflines{\midpoint}{\midpoint\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
+ {\before@sw@anchor}{\after@sw@anchor}%
+ \else%
+ \pgf@process{\before@ne@anchor\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
+ \ifdim\pgf@ya<\pgf@y%
+ \pgfpointintersectionoflines{\midpoint}{\midpoint\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
+ {\before@ne@anchor\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
+ {\before@sw@anchor}%
+ \else%
+ \pgfpointintersectionoflines{\midpoint}{\midpoint\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
+ {\before@ne@anchor\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
+ {\after@ne@anchor\pgf@ya\pgf@y\after@sw@anchor\pgf@y\pgf@ya}%
+ \fi%
+ \fi%
+ }%
+ \anchor{base}{\basepoint}%
+ \anchor{base east}{%
+ \getchamferedrectanglepoints%
+ \basepoint%
+ \pgf@ya\pgf@y%
+ \pgf@process{%
+ \before@sw@anchor%
+ \pgf@ya\pgf@y%
+ \before@ne@anchor%
+ \pgf@y\pgf@ya%
+ }%
+ \ifdim\pgf@ya<\pgf@y%
+ \pgfpointintersectionoflines{\basepoint}{\basepoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
+ {\before@sw@anchor\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
+ {\after@sw@anchor\pgf@ya\pgf@y\after@ne@anchor\pgf@y\pgf@ya}%
+ \else%
+ \pgf@process{\before@ne@anchor}%
+ \ifdim\pgf@ya<\pgf@y%
+ \pgfpointintersectionoflines{\basepoint}{\basepoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
+ {\before@sw@anchor\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
+ {\before@ne@anchor}%
+ \else%
+ \pgfpointintersectionoflines{\basepoint}{\basepoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
+ {\before@ne@anchor}%
+ {\after@ne@anchor}%
+ \fi%
+ \fi%
+ }%
+ \anchor{base west}{%
+ \getchamferedrectanglepoints%
+ \basepoint%
+ \pgf@ya\pgf@y%
+ \pgf@process{\before@sw@anchor}%
+ \ifdim\pgf@ya<\pgf@y%
+ \pgfpointintersectionoflines{\basepoint}{\basepoint\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
+ {\before@sw@anchor}{\after@sw@anchor}%
+ \else%
+ \pgf@process{\before@ne@anchor\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
+ \ifdim\pgf@ya<\pgf@y%
+ \pgfpointintersectionoflines{\basepoint}{\basepoint\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
+ {\before@ne@anchor\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
+ {\before@sw@anchor}%
+ \else%
+ \pgfpointintersectionoflines{\basepoint}{\basepoint\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
+ {\before@ne@anchor\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
+ {\after@ne@anchor\pgf@ya\pgf@y\after@sw@anchor\pgf@y\pgf@ya}%
+ \fi%
+ \fi%
+ }%
+ \anchor{before north east}{\getchamferedrectanglepoints\before@ne@anchor}%
+ \anchor{north east}{\getchamferedrectanglepoints\ne@anchor}%
+ \anchor{after north east}{\getchamferedrectanglepoints\after@ne@anchor}%
+ \anchor{north}{%
+ \getchamferedrectanglepoints%
+ \centerpoint%
+ \pgf@xa\pgf@x%
+ \after@ne@anchor%
+ \pgf@x\pgf@xa}%
+ \anchor{before north west}{%
+ \getchamferedrectanglepoints%
+ \after@sw@anchor%
+ \pgf@xa\pgf@x%
+ \after@ne@anchor%
+ \pgf@x\pgf@xa}%
+ \anchor{north west}{\getchamferedrectanglepoints\nw@anchor}%
+ \anchor{after north west}{%
+ \getchamferedrectanglepoints%
+ \before@sw@anchor%
+ \pgf@xa\pgf@x%
+ \before@ne@anchor%
+ \pgf@x\pgf@xa}%
+ \anchor{west}{%
+ \getchamferedrectanglepoints%
+ \centerpoint%
+ \pgf@ya\pgf@y%
+ \before@sw@anchor%
+ \pgf@y\pgf@ya}%
+ \anchor{before south west}{\getchamferedrectanglepoints\before@sw@anchor}%
+ \anchor{south west}{\getchamferedrectanglepoints\sw@anchor}%
+ \anchor{after south west}{\getchamferedrectanglepoints\after@sw@anchor}%
+ \anchor{south}{%
+ \getchamferedrectanglepoints%
+ \centerpoint%
+ \pgf@xa\pgf@x%
+ \after@sw@anchor%
+ \pgf@x\pgf@xa}%
+ \anchor{before south east}{%
+ \getchamferedrectanglepoints%
+ \after@sw@anchor%
+ \pgf@ya\pgf@y%
+ \after@ne@anchor%
+ \pgf@y\pgf@ya}%
+ \anchor{south east}{\getchamferedrectanglepoints\se@anchor}%
+ \anchor{after south east}{%
+ \getchamferedrectanglepoints%
+ \before@sw@anchor%
+ \pgf@ya\pgf@y%
+ \before@ne@anchor%
+ \pgf@y\pgf@ya}%
+ \anchor{east}{%
+ \getchamferedrectanglepoints%
+ \centerpoint%
+ \pgf@ya\pgf@y%
+ \before@ne@anchor%
+ \pgf@y\pgf@ya}%
+ \backgroundpath{%
+ \pgfpathmoveto{\beforenortheast}%
+ \pgfpathlineto{\northeast}%
+ \pgfpathlineto{\afternortheast}%
+ \pgfpathlineto{\aftersouthwest\pgf@xa\pgf@x\afternortheast\pgf@x\pgf@xa}%
+ \pgfpathlineto{\northwest}%
+ \pgfpathlineto{\beforesouthwest\pgf@xa\pgf@x\beforenortheast\pgf@x\pgf@xa}%
+ \pgfpathlineto{\beforesouthwest}%
+ \pgfpathlineto{\southwest}%
+ \pgfpathlineto{\aftersouthwest}%
+ \pgfpathlineto{\aftersouthwest\pgf@ya\pgf@y\afternortheast\pgf@y\pgf@ya}%
+ \pgfpathlineto{\southeast}%
+ \pgfpathlineto{\beforesouthwest\pgf@ya\pgf@y\beforenortheast\pgf@y\pgf@ya}%
+ \pgfpathclose%
+ }%
+ \anchorborder{%
+ \pgfextract@process\externalpoint{%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ }%
+ \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
+ \let\externalangle\pgfmathresult%
+ \getchamferedrectanglepoints%
+ \pgfmathanglebetweenpoints{\centerpoint}{\centerpoint\pgf@ya\pgf@y\before@sw@anchor\pgf@y\pgf@ya}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax% west.
+ \pgfmathanglebetweenpoints{\centerpoint}{\centerpoint\pgf@xa\pgf@x\after@ne@anchor\pgf@x\pgf@xa}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax% north.
+ \pgfmathanglebetweenpoints{\centerpoint}{\ne@anchor}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax% north east.
+ \pgfmathanglebetweenpoints{\centerpoint}{\before@ne@anchor}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax% before north east.
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\centerpoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}{\before@ne@anchor}%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\before@ne@anchor}{\ne@anchor}%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\centerpoint}{\after@ne@anchor}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax% after north east.
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\ne@anchor}{\after@ne@anchor}%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\after@ne@anchor}{\centerpoint\pgf@xa\pgf@x\after@ne@anchor\pgf@x\pgf@xa}%
+ \fi%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\centerpoint}{\nw@anchor}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax% north west.
+ \pgfmathanglebetweenpoints{\centerpoint}{\after@sw@anchor\pgf@xa\pgf@x\after@ne@anchor\pgf@x\pgf@xa}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax% before north west.
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\centerpoint\pgf@xa\pgf@x\after@ne@anchor\pgf@x\pgf@xa}%
+ {\after@sw@anchor\pgf@xa\pgf@x\after@ne@anchor\pgf@x\pgf@xa}%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\after@sw@anchor\pgf@xa\pgf@x\after@ne@anchor\pgf@x\pgf@xa}%
+ {\nw@anchor}%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\centerpoint}{\before@sw@anchor\pgf@xa\pgf@x\before@ne@anchor\pgf@x\pgf@xa}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax% after north west.
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\nw@anchor}{\before@sw@anchor\pgf@xa\pgf@x\before@ne@anchor\pgf@x\pgf@xa}%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\before@sw@anchor\pgf@xa\pgf@x\before@ne@anchor\pgf@x\pgf@xa}%
+ {\before@sw@anchor\pgf@xa\pgf@x\centerpoint\pgf@x\pgf@xa}%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\centerpoint}{\centerpoint\pgf@xa\pgf@x\after@sw@anchor\pgf@x\pgf@xa}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax% south.
+ \pgfmathanglebetweenpoints{\centerpoint}{\sw@anchor}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax% south west.
+ \pgfmathanglebetweenpoints{\centerpoint}{\before@sw@anchor}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax% before south west.
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\before@sw@anchor\pgf@xa\pgf@x\centerpoint\pgf@x\pgf@xa}%
+ {\before@sw@anchor}%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\before@sw@anchor}{\sw@anchor}%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\centerpoint}{\after@sw@anchor}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax% after south west.
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\sw@anchor}{\after@sw@anchor}%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\after@sw@anchor}{\centerpoint\pgf@xa\pgf@x\after@sw@anchor\pgf@x\pgf@xa}%
+ \fi%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\centerpoint}{\se@anchor}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax% south east.
+ \pgfmathanglebetweenpoints{\centerpoint}{\after@ne@anchor\pgf@xa\pgf@x\after@sw@anchor\pgf@x\pgf@xa}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax% before south east.
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\after@ne@anchor\pgf@xa\pgf@x\after@sw@anchor\pgf@x\pgf@xa}%
+ {\centerpoint\pgf@xa\pgf@x\after@sw@anchor\pgf@x\pgf@xa}%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\after@ne@anchor\pgf@xa\pgf@x\after@sw@anchor\pgf@x\pgf@xa}{\se@anchor}
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\centerpoint}{\before@ne@anchor\pgf@xa\pgf@x\before@sw@anchor\pgf@x\pgf@xa}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax% after south east.
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\se@anchor}{\before@ne@anchor\pgf@xa\pgf@x\before@sw@anchor\pgf@x\pgf@xa}%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\externalpoint}%
+ {\before@ne@anchor\pgf@xa\pgf@x\before@sw@anchor\pgf@x\pgf@xa}%
+ {\centerpoint\pgf@ya\pgf@y\before@ne@anchor\pgf@y\pgf@ya}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ }%
+}%
\endinput
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
index 15d7baf090c..2866923c529 100644
--- 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
@@ -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/shapes/pgflibraryshapes.multipart.code.tex,v 1.2 2010/01/07 01:12:23 vibrovski Exp $
+\ProvidesFileRCS{pgflibraryshapes.multipart.code.tex}
\newbox\pgfnodepartlowerbox
@@ -21,11 +21,11 @@
% Parts: text, lower
\pgfdeclareshape{circle split}
-{
+{%
%
% Node parts
%
- \nodeparts{text,lower}
+ \nodeparts{text,lower}%
%
% Anchors
@@ -46,44 +46,44 @@
\advance\pgf@y by-.5\pgflinewidth%
\advance\pgf@y by-\dp\pgfnodeparttextbox%
\advance\pgf@y by-.5\pgflinewidth%
- }
-
+ }%
+
\saveddimen\radius{%
- %
- % Caculate ``height radius''
+ %
+ % Calculate ``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%
+ %
+ % 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''
- %
+ %
+ % Calculate ``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%
@@ -105,73 +105,73 @@
\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}}%
+ % 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}}%
+ %
+ % Now, add larger of outer separations.
+ %
+ \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}
+ %
+ \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]
+ \inheritbackgroundpath[from=circle]%
\beforebackgroundpath{
\pgfutil@tempdima=\radius%
- \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \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%
+ \advance\pgfutil@tempdima by-.5\pgflinewidth%
\pgfsetshortenstart{0pt}%
\pgfsetshortenend{0pt}%
- \pgfsetarrows{-}%
+ \pgfsetarrows{-}%
\pgfpathmoveto{\pgfpointadd{\centerpoint}{\pgfqpoint{-1\pgfutil@tempdima}{0pt}}}%
\pgfpathlineto{\pgfpointadd{\centerpoint}{\pgfqpoint{\pgfutil@tempdima}{0pt}}}%
\pgfusepath{stroke}%
- }
-}
+ }%
+}%
%
@@ -181,7 +181,7 @@
\pgfdeclareshape{circle solidus}{%
% Node parts
- \nodeparts{text,lower}%
+ \nodeparts{text,lower}%
% Anchors
% solidus slants at 45 degrees
% text placement minimizes the required radius,
@@ -297,23 +297,23 @@
\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%
-}
+ \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}}}
+\def\pgf@lib@sh@getalpha#1#2{\expandafter\edef\expandafter#1\expandafter{\pgf@lib@sh@toalpha{#2}}}%
\newbox\pgfnodeparttwobox
\newbox\pgfnodepartthreebox
@@ -325,25 +325,25 @@
\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%
-}
+ \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}
+\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
@@ -353,900 +353,902 @@
\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}
+\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}
-}
+ 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,}
+ \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}}
-
+ \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}
+ \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%
-}
+ \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}
+\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}%
- }%
+ \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%
}%
- \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}%
- }%
+ \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@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@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@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}
+\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}%
@@ -1254,101 +1256,101 @@
% 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%
- }%
-}
+ \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/shapes/pgflibraryshapes.symbols.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.symbols.code.tex
index efa492cc024..a6e925346d6 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.symbols.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.symbols.code.tex
@@ -7,35 +7,35 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/shapes/pgflibraryshapes.symbols.code.tex,v 1.6 2013/09/11 06:15:59 vibrovski Exp $
+\ProvidesFileRCS{pgflibraryshapes.symbols.code.tex}
\pgfdeclareshape{forbidden sign}
-{
- \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]
+{%
+ \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}}%
+ \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%
@@ -45,37 +45,37 @@
\pgfpathlineto{\pgfpointadd{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\pgfqpoint{0.707107\pgfutil@tempdima}{0.707107\pgfutil@tempdima}}}
\pgfsetarrowsstart{}
\pgfsetarrowsend{}
- }
-}
+ }%
+}%
\pgfdeclareshape{correct forbidden sign}
-{
- \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]
+{%
+ \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}}%
+ \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%
@@ -85,8 +85,8 @@
\pgfpathlineto{\pgfpointadd{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\pgfqpoint{-0.707107\pgfutil@tempdima}{0.707107\pgfutil@tempdima}}}
\pgfsetarrowsstart{}
\pgfsetarrowsend{}
- }
-}
+ }%
+}%
@@ -107,31 +107,31 @@
\fi%
\pgfkeyslet{/pgf/random starburst}{\pgfmathresult}%
}%
-}
-\pgfkeys{/pgf/random starburst=100}
+}%
+\pgfkeys{/pgf/random starburst=100}%
-\pgfkeys{/pgf/starburst point height/.value required}
+\pgfkeys{/pgf/starburst point height/.value required}%
\pgfkeys{/pgf/starburst point height/.code={%
\pgfmathparse{#1}%
\edef\pgfmathresult{\pgfmathresult pt}%
\pgfkeyslet{/pgf/starburst point height}{\pgfmathresult}%
}%
}%
-\pgfkeys{/pgf/starburst point height=.5cm}
+\pgfkeys{/pgf/starburst point height=.5cm}%
-\pgfkeys{/pgf/starburst points/.value required}
+\pgfkeys{/pgf/starburst points/.value required}%
\pgfkeys{/pgf/starburst points/.code={%
\pgfmathtruncatemacro\pgfmathresult{#1}%
\pgfkeyslet{/pgf/starburst points}{\pgfmathresult}%
- }%
+ }%
}%
-\pgfkeys{/pgf/starburst points=17}
+\pgfkeys{/pgf/starburst points=17}%
\pgfdeclareshape{starburst}{%
\savedmacro\anglestep{%
\pgfmathdivide@{180}{\pgfkeysvalueof{/pgf/starburst points}}%
\let\anglestep\pgfmathresult%
- }
+ }%
\savedmacro\calculatestarburstpoints{%
%
% Get the angle step.
@@ -162,11 +162,11 @@
\pgf@x\pgf@y%
\fi%
\edef\outersep{\the\pgf@x}%
- %
+ %
% Get the node dimensions.
- %
+ %
\pgfmathsetlength\pgf@x{+\pgfkeysvalueof{/pgf/inner xsep}}%
- \pgfmathaddtolength\pgf@x{+.5\wd\pgfnodeparttextbox}%
+ \pgfmathaddtolength\pgf@x{+.5\wd\pgfnodeparttextbox}%
\pgfmathsetlength\pgf@y{+\pgfkeysvalueof{/pgf/inner ysep}}%
\pgfmathaddtolength\pgf@y{+.5\ht\pgfnodeparttextbox}%
\pgfmathaddtolength\pgf@y{+.5\dp\pgfnodeparttextbox}%
@@ -215,15 +215,15 @@
\edef\rotate{\the\c@pgf@counta}%
%
% ...or not.
- %
+ %
\pgf@x=1.41421\pgf@x%
\pgf@y=1.41421\pgf@y%
\fi%
\addtosavedmacro{\rotate}%
- %
+ %
% Adjust innerradius for minimum width and height.
%
- \pgf@xa\pgf@x%
+ \pgf@xa\pgf@x%
\pgfmathsetlength\pgf@xb{+\pgfkeysvalueof{/pgf/starburst point height}}%
\advance\pgf@xa\pgf@xb%
\pgfmathsetlength\pgf@xc{+\pgfkeysvalueof{/pgf/minimum width}}%
@@ -231,14 +231,14 @@
\pgf@x.5\pgf@xc%
\advance\pgf@x-\pgf@xb%
\fi%
- \pgf@ya\pgf@y%
+ \pgf@ya\pgf@y%
\pgfmathsetlength\pgf@yb{+\pgfkeysvalueof{/pgf/starburst point height}}%
\advance\pgf@ya\pgf@yb%
\pgfmathsetlength\pgf@yc{+\pgfkeysvalueof{/pgf/minimum height}}%
\ifdim\pgf@ya<.5\pgf@yc%
\pgf@y.5\pgf@yc%
\advance\pgf@y-\pgf@yb%
- \fi%
+ \fi%
\edef\xinnerradius{\the\pgf@x}%
\edef\yinnerradius{\the\pgf@y}%
\addtosavedmacro{\xinnerradius}%
@@ -255,9 +255,9 @@
%
% Set the seed for the random number generator.
%
- \pgfmathsetseed{\pgfkeysvalueof{/pgf/random starburst}}%
+ \pgfmathsetseed{\pgfkeysvalueof{/pgf/random starburst}}%
%
- % Now create the points on the shape and also
+ % Now create the points on the shape and also
% the miter length and angle for each point.
%
\def\angle{90}% Start at the top.
@@ -270,7 +270,7 @@
% As 3 consecutive points are required to be defined for miter
% calculations, it is necessary to go over the first two points
% again.
- %
+ %
\c@pgf@countc\totalpoints\relax%
\advance\c@pgf@countc2\relax%
\edef\looppoints{\the\c@pgf@countc}%
@@ -280,8 +280,8 @@
%
% Cycle the point definitions.
%
- \let\firstpoint\secondpoint%
- \let\secondpoint\thirdpoint%
+ \let\firstpoint\secondpoint%
+ \let\secondpoint\thirdpoint%
\ifnum\pgfmathcounter>\looppoints%
\else%
\ifnum\pgfmathcounter>\totalpoints%
@@ -324,14 +324,14 @@
\centerpoint%
\advance\pgf@x\pgf@xa%
\advance\pgf@y\pgf@ya%
- }%
+ }%
\fi%
%
% Add the points to the saved macro.
%
\expandafter\let\expandafter\thirdpoint\csname point@\the\c@pgf@counta @\endcsname%
\expandafter\addtosavedmacro\expandafter{\csname point@\the\c@pgf@counta @\endcsname}%
- \fi%
+ \fi%
%
% It is only possible to do the miter calculations if three points are defined.
%
@@ -376,12 +376,12 @@
\expandafter\edef\csname angletoborderpoint@\the\c@pgf@countb @\endcsname{\pgfmathresult}%
\expandafter\addtosavedmacro\expandafter{\csname angletoborderpoint@\the\c@pgf@countb @\endcsname}%
%
- % Rotatee the border points and save.
+ % Rotate the border points and save.
%
\expandafter\pgfextract@process\csname borderpoint@\the\c@pgf@countb @\endcsname{%
\pgfmathrotatepointaround{\borderpoint}{\centerpoint}{\rotate}%
}%
- \expandafter\addtosavedmacro\expandafter{\csname borderpoint@\the\c@pgf@countb @\endcsname}%
+ \expandafter\addtosavedmacro\expandafter{\csname borderpoint@\the\c@pgf@countb @\endcsname}%
%
% Now create the anchors.
%
@@ -405,7 +405,7 @@
\fi%
\fi%
\pgfmathadd@{\angle}{\anglestep}%
- \pgfmathmod@{\pgfmathresult}{360}%
+ \pgfmathmod@{\pgfmathresult}{360}%
\let\angle\pgfmathresult%
\advance\c@pgf@counta1\relax%
\ifnum\c@pgf@counta>\totalpoints%
@@ -416,7 +416,7 @@
\c@pgf@countb1\relax%
\fi%
\repeatpgfmathloop%
- }
+ }%
\savedanchor\centerpoint{%
\pgfmathsetlength\pgf@x{+.5\wd\pgfnodeparttextbox}%
\pgfmathsetlength\pgf@y{+.5\ht\pgfnodeparttextbox}%
@@ -430,42 +430,42 @@
\pgfmathsetlength\pgf@x{+.5\wd\pgfnodeparttextbox}%
\pgf@y0pt\relax%
}%
- \anchor{center}{\centerpoint}
- \anchor{base}{\basepoint}
- \anchor{mid}{\midpoint}
+ \anchor{center}{\centerpoint}%
+ \anchor{base}{\basepoint}%
+ \anchor{mid}{\midpoint}%
\anchor{north}{%
\calculatestarburstpoints%
\csname pgf@anchor@starburst@border\endcsname{\pgfqpoint{0pt}{\externalradius}}%
- }
+ }%
\anchor{south}{%
\calculatestarburstpoints%
\csname pgf@anchor@starburst@border\endcsname{\pgfqpoint{0pt}{-\externalradius}}%
- }
+ }%
\anchor{east}{%
\calculatestarburstpoints%
\csname pgf@anchor@starburst@border\endcsname{\pgfqpoint{\externalradius}{0pt}}%
- }
+ }%
\anchor{west}{%
\calculatestarburstpoints%
\csname pgf@anchor@starburst@border\endcsname{\pgfqpoint{-\externalradius}{0pt}}%
- }
+ }%
\anchor{north west}{%
\calculatestarburstpoints%
\csname pgf@anchor@starburst@border\endcsname{\pgfqpoint{-\externalradius}{\externalradius}}%
- }
+ }%
\anchor{south west}{%
\calculatestarburstpoints%
\csname pgf@anchor@starburst@border\endcsname{\pgfqpoint{-\externalradius}{-\externalradius}}%
- }
+ }%
\anchor{north east}{%
\calculatestarburstpoints%
\csname pgf@anchor@starburst@border\endcsname{\pgfqpoint{\externalradius}{\externalradius}}%
- }
+ }%
\anchor{south east}{%
\calculatestarburstpoints%
\csname pgf@anchor@starburst@border\endcsname{\pgfqpoint{\externalradius}{-\externalradius}}%
- }
- \backgroundpath{%
+ }%
+ \backgroundpath{%
\calculatestarburstpoints%
\pgfmathloop%
\ifnum\pgfmathcounter>\totalpoints%
@@ -479,8 +479,8 @@
%\pgfmathrotatepointaround{\csname point@\pgfmathcounter @\endcsname}{\centerpoint}{\rotate}}%
\csname point@\pgfmathcounter @\endcsname}
\repeatpgfmathloop%
- \pgfpathclose%
- }
+ \pgfpathclose%
+ }%
\anchorborder{%
%
% Save x and y.
@@ -488,7 +488,7 @@
\edef\externalx{\the\pgf@x}%
\edef\externaly{\the\pgf@y}%
%
- % Adjust the location of the external
+ % Adjust the location of the external
% point relative to \centerpoint.
%
\centerpoint%
@@ -544,9 +544,9 @@
\c@pgf@counta\pgfmathcounter%
\else%
\ifdim\externalangle pt<\csname angletoborderpoint@\pgfmathcounter @\endcsname pt\relax%
- \c@pgf@counta\pgfmathcounter%
+ \c@pgf@counta\pgfmathcounter%
\fi%
- \fi%
+ \fi%
\repeatpgfmathloop%
\edef\first{\the\c@pgf@counta}%
\advance\c@pgf@counta-1\relax%
@@ -561,7 +561,7 @@
\pgfpointintersectionoflines{\centerpoint}{\pgfqpoint{\externalx}{\externaly}}%
{\csname borderpoint@\first @\endcsname}{\csname borderpoint@\second @\endcsname}%
}%
-}
+}%
@@ -578,7 +578,7 @@
cloud puffs/.initial=10,
cloud puff arc/.initial=150,
cloud ignores aspect/.is if=pgfcloudignoresaspect,
- cloud anchors use ellipse/.is if=pgfcloudanchorsuseellipse
+ cloud anchors use ellipse/.is if=pgfcloudanchorsuseellipse,
}%
@@ -586,12 +586,12 @@
%
\pgfkeys{/pgf/.cd,
aspect/.code={\pgfsetshapeaspect{#1}},% this for tikz...
- shape aspect/.initial=1,% but this is consistent with other pgfset stuff.
+ shape aspect/.initial=1,% but this is consistent with other pgfset stuff.
shape aspect/.code={%
\pgfkeys{/pgf/aspect=#1}%
\pgfkeyssetvalue{/pgf/shape aspect}{#1}
}%
-}
+}%
\def\pgfsetshapeaspect#1{%
\def\pgfshapeaspect{#1}%
@@ -601,11 +601,11 @@
\c@pgf@counta=\pgfutil@tempdima\relax% 8192*determinant
\pgfutil@tempdima=8192pt%
\divide\pgfutil@tempdima by\c@pgf@counta%
- \edef\pgfshapeaspectinverse{\pgf@sys@tonumber{\pgfutil@tempdima}}
-}
+ \edef\pgfshapeaspectinverse{\pgf@sys@tonumber{\pgfutil@tempdima}}%
+}%
+
+\pgfsetshapeaspect{1}%
-\pgfsetshapeaspect{1}
-%
% Shape cloud.
%
@@ -653,7 +653,7 @@
\edef\yinnerradius{\the\pgf@yc}%
%
% Get the larger of the outer sep.
- %
+ %
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/outer xsep}}%
\pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/outer ysep}}%
\ifdim\pgf@x<\pgf@y%
@@ -667,7 +667,7 @@
% and the radius of that arc, is constant:
%
% g = .5 * sec((180-a)/2)
- %
+ %
\pgfmathsubtract{180}{\arc}%
\pgfmathdivide@{\pgfmathresult}{2}%
\let\tempangle\pgfmathresult%
@@ -677,7 +677,7 @@
\addtosavedmacro\arcradiusquotient%
%
% In addition, the quotient of the distance between the start and
- % end point of a puffs circular arc and the height of that arc
+ % end point of a puffs circular arc and the height of that arc
% (ignoring rotation), is also constant:
%
% h = .5 * (1-sin((180-a)/2))/cos((180-a)/2)
@@ -688,20 +688,20 @@
\let\archeightquotient\pgfmathresult%
\addtosavedmacro\archeightquotient%
%
- % Minimum size is applied to the circum-ellipse (i.e. the ellipse
- % that passes through the extremeties of each puff). Thus, the
- % relationship between the radii of the elliptical incircle ("inellipse"?)
- % of the cloud (x and y) and the radii of the circum-ellispe (X and Y),
- % is given by
+ % Minimum size is applied to the circum-ellipse (i.e. the ellipse
+ % that passes through the extremities of each puff). Thus, the
+ % relationship between the radii of the elliptical incircle ("inellipse"?)
+ % of the cloud (x and y) and the radii of the circum-ellipse (X and Y),
+ % is given by
%
- % X = 2(x*cos(p/2) + ky)
+ % X = 2(x*cos(p/2) + ky)
% Y = 2(y*cos(p/2) + kx)
- %
+ %
% where:
% k = sin(p/2)*((1-cos(a/2))/sin(a/2))
- % p = the angle between each puff (i.e. 360/<puffs>)
+ % p = the angle between each puff (i.e. 360/<puffs>)
% a = the length of arc of the puff.
- %
+ %
\pgfmathdivide{\arc}{2}%
\let\halfarcangle\pgfmathresult%
\pgfmathcos@{\pgfmathresult}%
@@ -747,10 +747,10 @@
\edef\youterradius{\the\pgf@ya}%
\addtosavedmacro\youterradius%
%
- % Now recalculate `in-ellispe' radii:
+ % Now recalculate `in-ellipse' radii:
%
- % x = (X'cos(p/2)-kY')/cos^2(p/2)-k^2,
- % y = (Y'cos(p/2)-kX')/cos^2(p/2)-k^2,
+ % x = (X'cos(p/2)-kY')/cos^2(p/2)-k^2,
+ % y = (Y'cos(p/2)-kX')/cos^2(p/2)-k^2,
%
\pgf@xc\k pt\relax%
\pgf@xc-\k\pgf@xc%
@@ -803,23 +803,23 @@
\addtosavedmacro\cosquarterarc%
\addtosavedmacro\tanquarterarc%
%
- }
+ }%
\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{+.5ex}%
- }
+ }%
\savedanchor\basepoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y0pt%
- }
- \anchor{center}{\centerpoint}
- \anchor{mid}{\midpoint}
- \anchor{base}{\basepoint}
+ }%
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\midpoint}%
+ \anchor{base}{\basepoint}%
\anchor{north}{%
\getradii%
\csname pgf@anchor@cloud@border\endcsname{\pgfqpoint{0pt}{\youterradius}}%
@@ -877,9 +877,9 @@
\csname pgf@anchor@cloud@border\endcsname{\pgf@sh}%
}%
%
- % Each `puff' is a circular arc of length a, drawn using two a/2
- % arcs (a < 180), approximated by Bezier curves.
- % Due to TeX rounding errors, it is sometimes necessary to `force'
+ % Each `puff' is a circular arc of length a, drawn using two a/2
+ % arcs (a < 180), approximated by Bezier curves.
+ % Due to TeX rounding errors, it is sometimes necessary to `force'
% the arc to end at a specific point. So...
%
% @article{riskus2006,
@@ -927,7 +927,7 @@
\pgfpointadd{\centerpoint}{%
\pgfpointpolar{+\angle}{+\xinnerradius and +\yinnerradius}%
}%
- }%
+ }%
\fi%
%
% Get some useful cloud parameters from \arcstartpoint and \arcendpoint.
@@ -944,7 +944,7 @@
\pgfmathcos@{\arcrotate}%
\let\cosarcrotate\pgfmathresult%
%
- % Calculate the amount by which to scale the control
+ % Calculate the amount by which to scale the control
% points, in order to approximate an a/2 arc with radius x.
%
\pgf@x\arcradius\relax%
@@ -995,11 +995,11 @@
%
% Get the second control point for the first arc (length a/2)...
%
- \pgfextract@process\controltwo{%
+ \pgfextract@process\controltwo{%
\pgf@x0.55228475pt\relax%
\pgf@x\sinquarterarc\pgf@x% k * sin(a/2)
\pgf@y-0.55228475pt\relax%
- \pgf@y\cosquarterarc\pgf@y% -k * cos(a/2)
+ \pgf@y\cosquarterarc\pgf@y% -k * cos(a/2)
%
% ...scale, rotate and shift.
%
@@ -1032,7 +1032,7 @@
%
% First control point for the second arc...
%
- \pgfextract@process\controlone{%
+ \pgfextract@process\controlone{%
\pgf@x0.55228475pt\relax%
\pgf@x\sinquarterarc\pgf@x% k * sin(a/2)
\pgf@y0.55228475pt\relax%
@@ -1055,11 +1055,11 @@
%
% Second control point for the second arc.
%
- \pgfextract@process\controltwo{%
+ \pgfextract@process\controltwo{%
\pgf@x0.55228475pt\relax%
\pgf@x\sinquarterarc\pgf@x% k * sin(a/2)
\pgf@y-0.55228475pt\relax%
- \pgf@y\cosquarterarc\pgf@y% -k * cos(a/2)
+ \pgf@y\cosquarterarc\pgf@y% -k * cos(a/2)
%
% ...scale, rotate and shift.
%
@@ -1095,7 +1095,7 @@
%
% Get the inner radii and trig. constants.
%
- \getradii%
+ \getradii%
%
%
%
@@ -1116,9 +1116,9 @@
\pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
\let\externalangle\pgfmathresult%
%
- % 1. Locate the correct puff:
+ % 1. Locate the correct puff:
%
- % Get end angle of the relavent puff arc.
+ % Get end angle of the relevant puff arc.
%
\pgfmathdivide@{\anglestep}{2}%
\let\halfanglestep\pgfmathresult%
@@ -1136,7 +1136,7 @@
\pgfmathadd@{\endangle}{\anglestep}%
\let\endangle\pgfmathresult%
%
- % Calculate the `miter point'. This is the point between
+ % Calculate the `miter point'. This is the point between
% each puff, and takes into account the outer sep.
%
\pgfextract@process\miterpoint{%
@@ -1210,12 +1210,12 @@
\pgfpointadd{\centerpoint}{%
\pgfpointpolar{+\startangle}{+\xinnerradius and +\yinnerradius}%
}%
- }%
+ }%
\pgfextract@process\arcendpoint{%
\pgfpointadd{\centerpoint}{%
\pgfpointpolar{+\endangle}{+\xinnerradius and +\yinnerradius}%
}%
- }%
+ }%
%
% Get some useful cloud parameters from \arcstartpoint and \arcendpoint.
%
@@ -1232,9 +1232,9 @@
\fi%
%
% 2. Locate the angle on the circular arc which forms the puff.
- %
- % Essentially a binary search to find the angle on the circular
- % arc, which provides the nearset estimate to the border point.
+ %
+ % Essentially a binary search to find the angle on the circular
+ % arc, which provides the nearest estimate to the border point.
%
\let\s\halfcomplementarc% The start of the arc.
\pgfmathadd@{\s}{\arc}%
@@ -1247,7 +1247,7 @@
\pgfmathadd@{\e}{\s}%
\pgfmathdivide@{\pgfmathresult}{2}%
\let\p\pgfmathresult% The point halfway between \s and \e.
- \ifdim\p pt=\s pt\relax%
+ \ifdim\p pt=\s pt\relax%
\else%
%
% Get the point on the circular arc.
@@ -1288,7 +1288,7 @@
\ifdim\pgfmathresult pt<\m pt\relax%
\let\m\pgfmathresult%
\let\n\p%
- \fi%
+ \fi%
\repeatpgfmathloop%
%
% Use the nearest estimate as the anchor angle.
@@ -1304,8 +1304,8 @@
\fi%
}% Again, Phew!
%
- % Now, a sneaky hack. This means an arbitrary `puff' anchors
- % can be used for positiong the cloud shape. This is needed
+ % Now, a sneaky hack. This means an arbitrary `puff' anchors
+ % can be used for positioning the cloud shape. This is needed
% if a cloud is positioned using the `puff <n+1>' anchor, where
% n is the number of puffs of any previously drawn cloud.
%
@@ -1319,12 +1319,12 @@
}%
}{\c@pgf@counta0\relax}%
\advance\c@pgf@counta-1\relax%
- \repeatpgfmathloop%
+ \repeatpgfmathloop%
}%
-}
+}%
% \pgf@sh@@cloudpuffanchor
-%
+%
% Internal macro for calculating the anchors puff 1, puff 2, ... etc.
%
\def\pgf@sh@@cloudpuffanchor#1{%
@@ -1352,7 +1352,7 @@
\pgfpointadd{\centerpoint}{%
\pgfpointpolar{+\angle}{+\xinnerradius and +\yinnerradius}%
}%
- }%
+ }%
%
% Get some useful cloud parameters from \arcstartpoint and \arcendpoint.
%
@@ -1365,11 +1365,11 @@
\pgfpointadd{\circlecenterpoint}{%
\pgfqpointpolar{\anchorangle}{\outerarcradius}%
}%
-}
+}%
% \pgf@sh@cloudpuffparameters
%
-% Internal macro to calculate some common arc parameters which
+% Internal macro to calculate some common arc parameters which
% are required when calculating radii, drawing the background
% path and calculating border anchors.
%
@@ -1411,7 +1411,7 @@
\pgfmathrotatepointaround{\circlecenterpoint}{\pgfpointorigin}{\arcslope}%
}%
}%
-}
+}%
@@ -1427,7 +1427,7 @@
%
\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}
+ \expandafter\pgf@lib@sh@signal@@parsedirection\pgf@lib@sh@temp\pgf@stop}%
\def\pgf@lib@sh@signal@@parsedirection#1\pgf@stop{%
\pgfutil@in@{and}{#1}%
@@ -1436,7 +1436,7 @@
\else%
\pgf@lib@sh@signal@@@parsedirection#1 and #1\pgf@lib%
\fi
-}
+}%
\def\pgf@lib@sh@signal@@@parsedirection#1 and #2\pgf@lib{%
\pgfutil@in@{nowhere}{#1}%
\ifpgfutil@in@
@@ -1444,7 +1444,7 @@
\pgf@lib@sh@signal@@@@parsedirection{#1}%
\pgf@lib@sh@signal@@@@parsedirection{#2}%
\fi%
-}
+}%
\def\pgf@lib@sh@signal@@@@parsedirection#1{%
\pgfutil@in@{ #1 }{ east right }%
\ifpgfutil@in@%
@@ -1470,7 +1470,7 @@
\let\pgf@lib@sh@signal@east=\pgf@lib@sh@signal@nowhere%
\let\pgf@lib@sh@signal@west=\pgf@lib@sh@signal@nowhere%
\fi%
-}
+}%
% Keys for signal shape:
@@ -1478,8 +1478,8 @@
\pgfkeys{/pgf/.cd,
signal pointer angle/.initial=90,
signal to/.initial=east,
- signal from/.initial=nowhere
-}
+ signal from/.initial=nowhere,
+}%
\pgfdeclareshape{signal}{%
\savedmacro\installsignalparameters{%
@@ -1490,7 +1490,7 @@
\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}%
+ \pgf@lib@sh@signal@parsedirection{\pgfkeysvalueof{/pgf/signal to}}{\pgf@lib@sh@signal@to}%
%
% Define a centerpoint.
%
@@ -1531,7 +1531,7 @@
\fi%
\pgf@yc=\pgf@y%
%
- % Calculate the miter due to the line width, at the pointer apex...
+ % Calculate the miter due to the line width, at the pointer apex...
%
\pgf@x=\cosechalfpointerangle\pgf@y%
\edef\pointerapexmiter{\the\pgf@x}%
@@ -1559,7 +1559,7 @@
\pgfmathsubtract@{90}{\halfpointerangle}%
\pgfmathtan@{\pgfmathresult}%
\pgf@xb=\pgfmathresult\pgf@ya%
- %
+ %
% ...and up.
%
\pgf@yb=\pgfmathresult\pgf@xa%
@@ -1704,7 +1704,7 @@
\addtosavedmacro{\southeast}%
\addtosavedmacro{\northwest}%
%
- % Calculate the `miter vectors' (i.e. +outer sep).
+ % Calculate the `miter vectors' (i.e. +outer sep).
%
\pgfextract@process\northmiter{%
\pgf@x0pt%
@@ -1749,7 +1749,7 @@
\ifx\pgf@lib@sh@signal@east\pgf@lib@sh@signal@to%
\pgfqpointpolar{\complementquarterpointerangle}{\tocornermiter}%
\fi%
- \fi%
+ \fi%
\fi%
\ifx\pgf@lib@sh@signal@north\pgf@lib@sh@signal@from%
\pgfqpointpolar{\complementquarterpointerangle}{\fromcornermiter}%
@@ -1757,7 +1757,7 @@
\ifx\pgf@lib@sh@signal@north\pgf@lib@sh@signal@to%
\pgfqpointpolar{\quarterpointerangle}{\tocornermiter}%
\fi%
- \fi%
+ \fi%
}%
\pgfextract@process\southeastmiter{%
\ifx\pgf@lib@sh@signal@east\pgf@lib@sh@signal@nowhere%
@@ -1770,7 +1770,7 @@
\ifx\pgf@lib@sh@signal@east\pgf@lib@sh@signal@to%
\pgfqpointpolar{-\complementquarterpointerangle}{\tocornermiter}%
\fi%
- \fi%
+ \fi%
\fi%
\ifx\pgf@lib@sh@signal@south\pgf@lib@sh@signal@from%
\pgfqpointpolar{-\complementquarterpointerangle}{\fromcornermiter}
@@ -1778,7 +1778,7 @@
\ifx\pgf@lib@sh@signal@south\pgf@lib@sh@signal@to%
\pgfqpointpolar{-\quarterpointerangle}{\tocornermiter}%
\fi%
- \fi%
+ \fi%
}%
\pgfextract@process\southwestmiter{%
\ifx\pgf@lib@sh@signal@west\pgf@lib@sh@signal@nowhere%
@@ -1793,7 +1793,7 @@
\pgfmathadd@{\complementquarterpointerangle}{180}%
\expandafter\pgfqpointpolar\expandafter{\pgfmathresult}{\tocornermiter}%
\fi%
- \fi%
+ \fi%
\fi%
\ifx\pgf@lib@sh@signal@south\pgf@lib@sh@signal@from%
\pgfmathadd@{\complementquarterpointerangle}{180}%
@@ -1803,7 +1803,7 @@
\pgfmathadd@{\quarterpointerangle}{180}%
\expandafter\pgfqpointpolar\expandafter{\pgfmathresult}{\tocornermiter}%
\fi%
- \fi%
+ \fi%
}%
\pgfextract@process\northwestmiter{%
\ifx\pgf@lib@sh@signal@west\pgf@lib@sh@signal@nowhere%
@@ -1818,7 +1818,7 @@
\pgfmathsubtract@{180}{\complementquarterpointerangle}%
\expandafter\pgfqpointpolar\expandafter{\pgfmathresult}{\tocornermiter}%
\fi%
- \fi%
+ \fi%
\fi%
\ifx\pgf@lib@sh@signal@north\pgf@lib@sh@signal@from%
\pgfmathsubtract@{180}{\complementquarterpointerangle}%
@@ -1828,7 +1828,7 @@
\pgfmathsubtract@{180}{\quarterpointerangle}%
\expandafter\pgfqpointpolar\expandafter{\pgfmathresult}{\tocornermiter}%
\fi%
- \fi%
+ \fi%
}%
\addtosavedmacro{\northmiter}%
\addtosavedmacro{\southmiter}%
@@ -1872,7 +1872,7 @@
\addtosavedmacro{\anchornortheast}%
\addtosavedmacro{\anchorsouthwest}%
\addtosavedmacro{\anchorsoutheast}%
- \addtosavedmacro{\anchornorthwest}%
+ \addtosavedmacro{\anchornorthwest}%
}%
\savedanchor\centerpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
@@ -1912,7 +1912,7 @@
\let\secondpoint\anchornortheast%
\fi%
\pgfpointintersectionoflines{\basepoint}{\externalpoint}%
- {\firstpoint}{\secondpoint}%
+ {\firstpoint}{\secondpoint}%
}%
\anchor{base west}{%
\installsignalparameters%
@@ -1937,7 +1937,7 @@
\let\secondpoint\anchornorthwest%
\fi%
\pgfpointintersectionoflines{\basepoint}{\externalpoint}%
- {\firstpoint}{\secondpoint}%
+ {\firstpoint}{\secondpoint}%
}%
\anchor{mid}{\midpoint}%
\anchor{mid east}{%
@@ -1963,7 +1963,7 @@
\let\secondpoint\anchornortheast%
\fi%
\pgfpointintersectionoflines{\midpoint}{\externalpoint}%
- {\firstpoint}{\secondpoint}%
+ {\firstpoint}{\secondpoint}%
}%
\anchor{mid west}{%
\installsignalparameters%
@@ -1988,7 +1988,7 @@
\let\secondpoint\anchornorthwest%
\fi%
\pgfpointintersectionoflines{\midpoint}{\externalpoint}%
- {\firstpoint}{\secondpoint}%
+ {\firstpoint}{\secondpoint}%
}%
\anchor{north}{\installsignalparameters\anchornorth}%
\anchor{south}{\installsignalparameters\anchorsouth}%
@@ -2009,7 +2009,7 @@
\pgfpathlineto{\west}%
\pgfpathlineto{\northwest}%
\pgfpathclose%
- }
+ }%
\anchorborder{%
%
% Save x and y.
@@ -2017,7 +2017,7 @@
\edef\externalx{\the\pgf@x}%
\edef\externaly{\the\pgf@y}%
%
- % Adjust the location of the external
+ % Adjust the location of the external
% point relative to \centerpoint.
%
\centerpoint%
@@ -2105,14 +2105,14 @@
tape bend top/.initial=in and out,
tape bend bottom/.initial=in and out,
tape bend/.style={/pgf/tape bend top=#1, /pgf/tape bend bottom=#1},
- tape bend height/.initial=5pt
-}
+ tape bend height/.initial=5pt,
+}%
-\def\pgf@lib@sh@inandouttext{in and out}
-\def\pgf@lib@sh@outandintext{out and in}
-\def\pgf@lib@sh@nonetext{none}
+\def\pgf@lib@sh@inandouttext{in and out}%
+\def\pgf@lib@sh@outandintext{out and in}%
+\def\pgf@lib@sh@nonetext{none}%
-\pgfdeclareshape{tape}{
+\pgfdeclareshape{tape}{%
\savedmacro\tapedimensions{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
\advance\pgf@x.5\wd\pgfnodeparttextbox%
@@ -2159,7 +2159,7 @@
\ifx\bottombendstyle\pgf@lib@sh@nonetext%
\else%
\advance\pgf@y-\pgfutil@tempdima%
- \fi%
+ \fi%
%
\pgfutil@tempdima3.414213\pgfutil@tempdima% 1 / (1-sin(45))
\edef\bendyradius{\the\pgfutil@tempdima}%
@@ -2172,7 +2172,7 @@
\edef\innerbendyradius{\the\pgfutil@tempdima}%
\addtosavedmacro\innerbendyradius%
%
- \pgfutil@tempdima0.707106\pgf@x% cos(45)
+ \pgfutil@tempdima0.707106\pgf@x% cos(45)
\edef\bendxradius{\the\pgfutil@tempdima}%
\addtosavedmacro\bendxradius%
\advance\pgfutil@tempdima\outerxsep%
@@ -2213,20 +2213,20 @@
\let\cothalfangleout\pgfmathresult%
\addtosavedmacro\cothalfangleout%
%
- }
+ }%
\savedanchor{\centerpoint}{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\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}{\tapedimensions\midpoint\advance\pgf@x\outerhalfwidth}%
@@ -2236,30 +2236,30 @@
\anchor{base west}{\tapedimensions\basepoint\advance\pgf@x-\outerhalfwidth}%
\anchor{north}{%
\csname pgf@anchor@tape@north east\endcsname%
- \pgf@ya\pgf@y%
+ \pgf@ya\pgf@y%
\csname pgf@anchor@tape@north west\endcsname%
- \advance\pgf@ya\pgf@y%
+ \advance\pgf@ya\pgf@y%
\centerpoint%
\pgf@y.5\pgf@ya%
- }
+ }%
\anchor{south}{%
\csname pgf@anchor@tape@south east\endcsname%
- \pgf@ya\pgf@y%
+ \pgf@ya\pgf@y%
\csname pgf@anchor@tape@south west\endcsname%
- \advance\pgf@ya\pgf@y%
+ \advance\pgf@ya\pgf@y%
\centerpoint%
\pgf@y.5\pgf@ya%
- }
+ }%
\anchor{east}{%
\tapedimensions%
\centerpoint%
\advance\pgf@x\outerhalfwidth%
- }
+ }%
\anchor{west}{%
\tapedimensions%
\centerpoint%
\advance\pgf@x-\outerhalfwidth%
- }
+ }%
\anchor{north east}{%
\tapedimensions%
\centerpoint%
@@ -2268,15 +2268,15 @@
\pgf@yc\outerysep%
\ifx\topbendstyle\pgf@lib@sh@inandouttext%
\advance\pgf@y\halfbendheight%
- \advance\pgf@y\cothalfangleout\pgf@yc%
+ \advance\pgf@y\cothalfangleout\pgf@yc%
\else%
- \ifx\topbendstyle\pgf@lib@sh@outandintext%
+ \ifx\topbendstyle\pgf@lib@sh@outandintext%
\advance\pgf@y\halfbendheight%
- \advance\pgf@y\cothalfanglein\pgf@yc%
+ \advance\pgf@y\cothalfanglein\pgf@yc%
\else%
\advance\pgf@y\pgf@yc%
\fi%
- \fi%
+ \fi%
}%
\anchor{north west}{%
\tapedimensions%
@@ -2286,15 +2286,15 @@
\pgf@yc\outerysep%
\ifx\topbendstyle\pgf@lib@sh@inandouttext%
\advance\pgf@y\halfbendheight%
- \advance\pgf@y\cothalfanglein\pgf@yc%
+ \advance\pgf@y\cothalfanglein\pgf@yc%
\else%
\ifx\topbendstyle\pgf@lib@sh@outandintext%
\advance\pgf@y\halfbendheight%
- \advance\pgf@y\cothalfangleout\pgf@yc%
+ \advance\pgf@y\cothalfangleout\pgf@yc%
\else%
\advance\pgf@y\pgf@yc%
\fi%
- \fi%
+ \fi%
}%
\anchor{south east}{%
\tapedimensions%
@@ -2304,15 +2304,15 @@
\pgf@yc\outerysep%
\ifx\topbendstyle\pgf@lib@sh@outandintext%
\advance\pgf@y-\halfbendheight%
- \advance\pgf@y-\cothalfangleout\pgf@yc%
+ \advance\pgf@y-\cothalfangleout\pgf@yc%
\else%
- \ifx\topbendstyle\pgf@lib@sh@inandouttext%
+ \ifx\topbendstyle\pgf@lib@sh@inandouttext%
\advance\pgf@y-\halfbendheight%
- \advance\pgf@y-\cothalfanglein\pgf@yc%
+ \advance\pgf@y-\cothalfanglein\pgf@yc%
\else%
\advance\pgf@y-\pgf@yc%
\fi%
- \fi%
+ \fi%
}%
\anchor{south west}{%
\tapedimensions%
@@ -2322,24 +2322,24 @@
\pgf@yc\outerysep%
\ifx\topbendstyle\pgf@lib@sh@outandintext%
\advance\pgf@y-\halfbendheight%
- \advance\pgf@y-\cothalfanglein\pgf@yc%
+ \advance\pgf@y-\cothalfanglein\pgf@yc%
\else%
\ifx\topbendstyle\pgf@lib@sh@inandouttext%
\advance\pgf@y-\halfbendheight%
- \advance\pgf@y-\cothalfangleout\pgf@yc%
+ \advance\pgf@y-\cothalfangleout\pgf@yc%
\else%
\advance\pgf@y-\pgf@yc%
\fi%
- \fi%
+ \fi%
}%
\backgroundpath{%
\tapedimensions%
%
\pgf@xc\halfwidth%
- \pgf@yc\halfheight%
+ \pgf@yc\halfheight%
%
\pgf@xc\bendxradius%
- \pgf@yc\bendyradius%
+ \pgf@yc\bendyradius%
{%
\pgftransformshift{\centerpoint}%
\pgfpathmoveto{\pgfqpoint{-\halfwidth}{0pt}}%
@@ -2372,8 +2372,8 @@
\fi%
\fi%
\pgfpathclose%
- }%
- }
+ }%
+ }%
\anchorborder{%
\pgf@xa\pgf@x%
\pgf@ya\pgf@y%
@@ -2554,7 +2554,7 @@
\fi%
\fi%
}%
-}
+}%
@@ -2568,36 +2568,36 @@
\pgfkeys{/pgf/.cd,
magnifying glass handle angle/.initial=-45,
- magnifying glass handle aspect/.initial=1.5
-}
+ 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]
+{%
+ \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}}%
+ \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%
@@ -2609,16 +2609,16 @@
{\pgfpointpolar{\pgfkeysvalueof{/pgf/magnifying glass handle angle}}{\pgfutil@tempdima+\pgfutil@tempdima*(\pgfkeysvalueof{/pgf/magnifying glass handle aspect})}}}
\pgfsetarrowsstart{}
\pgfsetarrowsend{}
- }
-}
+ }%
+}%
\pgfkeys{%
/pgf/magnetic tape tail/.initial=0.15,
/pgf/magnetic tape tail extend/.initial=0cm,
-}
-\pgfdeclareshape{magnetic tape}{
- \nodeparts{text}
+}%
+\pgfdeclareshape{magnetic tape}{%
+ \nodeparts{text}%
\savedmacro\installparameters{%
%
\pgf@x=0.5\wd\pgfnodeparttextbox%
@@ -2651,8 +2651,8 @@
\pgfmathparse{max(\pgfkeysvalueof{/pgf/magnetic tape tail extend},0)}%
\edef\tailextend{\pgfmathresult pt}%
%
- \pgfmathparse{min(max(\pgfkeysvalueof{/pgf/magnetic tape tail},0),1)}%
- \pgf@xa=\pgfmathresult\pgf@x%
+ \pgfmathparse{min(max(\pgfkeysvalueof{/pgf/magnetic tape tail},0),1)}%
+ \pgf@xa=\pgfmathresult\pgf@x%
\edef\tailheight{\the\pgf@xa}%
%
\pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
@@ -2689,38 +2689,38 @@
\addtosavedmacro\tailtopangle%
\addtosavedmacro\tailbottomangle%
\addtosavedmacro\centerpoint%
- }
- \savedanchor{\base}{\pgfqpoint{0.5\wd\pgfnodeparttextbox}{0pt}}
- \savedanchor{\mid}{\pgfqpoint{0.5\wd\pgfnodeparttextbox}{0pt}\pgfmathsetlength\pgf@y{.5ex}}
+ }%
+ \savedanchor{\base}{\pgfqpoint{0.5\wd\pgfnodeparttextbox}{0pt}}%
+ \savedanchor{\mid}{\pgfqpoint{0.5\wd\pgfnodeparttextbox}{0pt}\pgfmathsetlength\pgf@y{.5ex}}%
\anchor{center}{\installparameters\centerpoint}% \addtosavedmacro\outerradius%
- \anchor{base}{\base}
- \anchor{mid}{\mid}
- \anchor{base west}{\installparameters\pgfpointadd{\base}{\pgfqpoint{-\outerradius}{0pt}}}
- \anchor{base east}{\installparameters\pgfpointadd{\base}{\pgfqpoint{\outerradius}{0pt}}}
- \anchor{mid west}{\installparameters\pgfpointadd{\mid}{\pgfqpoint{-\outerradius}{0pt}}}
- \anchor{mid east}{\installparameters\pgfpointadd{\mid}{\pgfqpoint{\outerradius}{0pt}}}
+ \anchor{base}{\base}%
+ \anchor{mid}{\mid}%
+ \anchor{base west}{\installparameters\pgfpointadd{\base}{\pgfqpoint{-\outerradius}{0pt}}}%
+ \anchor{base east}{\installparameters\pgfpointadd{\base}{\pgfqpoint{\outerradius}{0pt}}}%
+ \anchor{mid west}{\installparameters\pgfpointadd{\mid}{\pgfqpoint{-\outerradius}{0pt}}}%
+ \anchor{mid east}{\installparameters\pgfpointadd{\mid}{\pgfqpoint{\outerradius}{0pt}}}%
\anchor{north}{\installparameters%
- \pgfpointadd{\centerpoint}{\pgfqpoint{0pt}{\outerradius}}}
+ \pgfpointadd{\centerpoint}{\pgfqpoint{0pt}{\outerradius}}}%
\anchor{north east}{\installparameters%
- \pgfpointadd{\centerpoint}{\pgfqpointpolar{45}{\outerradius}}}
+ \pgfpointadd{\centerpoint}{\pgfqpointpolar{45}{\outerradius}}}%
\anchor{south}{\installparameters%
- \pgfpointadd{\centerpoint}{\pgfqpoint{0pt}{-\outerradius}}}
+ \pgfpointadd{\centerpoint}{\pgfqpoint{0pt}{-\outerradius}}}%
\anchor{south east}{\installparameters%
- \pgfpointadd{\centerpoint}{\pgfqpoint{\outerradius}{-\outerradius}}}
+ \pgfpointadd{\centerpoint}{\pgfqpoint{\outerradius}{-\outerradius}}}%
\anchor{east}{\installparameters%
- \pgfpointadd{\centerpoint}{\pgfqpoint{\outerradius}{0pt}}}
+ \pgfpointadd{\centerpoint}{\pgfqpoint{\outerradius}{0pt}}}%
\anchor{south west}{\installparameters%
- \pgfpointadd{\centerpoint}{\pgfqpointpolar{225}{\outerradius}}}
+ \pgfpointadd{\centerpoint}{\pgfqpointpolar{225}{\outerradius}}}%
\anchor{west}{\installparameters%
- \pgfpointadd{\centerpoint}{\pgfqpoint{-\outerradius}{0pt}}}
+ \pgfpointadd{\centerpoint}{\pgfqpoint{-\outerradius}{0pt}}}%
\anchor{north west}{\installparameters%
- \pgfpointadd{\centerpoint}{\pgfqpointpolar{135}{\outerradius}}}
+ \pgfpointadd{\centerpoint}{\pgfqpointpolar{135}{\outerradius}}}%
\anchor{tail east}{\installparameters%
- \pgfpointadd{\centerpoint}{\pgfpoint{\radius+\tailextend+\outersep}{-\outerradius+\outersep+\tailheight/2}}}
+ \pgfpointadd{\centerpoint}{\pgfpoint{\radius+\tailextend+\outersep}{-\outerradius+\outersep+\tailheight/2}}}%
\anchor{tail south east}{\installparameters%
- \pgfpointadd{\centerpoint}{\pgfpoint{\radius+\tailextend+\outersep}{-\outerradius}}}
+ \pgfpointadd{\centerpoint}{\pgfpoint{\radius+\tailextend+\outersep}{-\outerradius}}}%
\anchor{tail north east}{\installparameters%
- \pgfpointadd{\centerpoint}{\pgfpoint{\radius+\tailextend+\outersep}{-\outerradius+\outersep+\tailheight+\outersep}}}
+ \pgfpointadd{\centerpoint}{\pgfpoint{\radius+\tailextend+\outersep}{-\outerradius+\outersep+\tailheight+\outersep}}}%
\backgroundpath{
%
\installparameters%
@@ -2733,7 +2733,7 @@
\pgfpathlineto{\pgfpoint{\radius+\tailextend}{-\radius+\tailheight}}%
\pgfpathclose%
}%
- }
+ }%
\anchorborder{%
\pgfextract@process\externalpoint{}%
\installparameters%
@@ -2742,34 +2742,34 @@
\pgfpointadd{\centerpoint}{%
\pgfpointborderellipse%
{\externalpoint}%
- {\pgfqpoint{\outerradius}{\outerradius}}%
+ {\pgfqpoint{\outerradius}{\outerradius}}%
}%
\else%
\ifdim\pgfmathresult pt<\tailbottomangle pt\relax%
\pgfpointadd{\centerpoint}{%
\pgfpointintersectionoflines%
{\externalpoint}{\pgfpointorigin}%
- {\pgfqpoint{0pt}{-\outerradius}}{\pgfqpoint{\outerradius}{-\outerradius}}%
+ {\pgfqpoint{0pt}{-\outerradius}}{\pgfqpoint{\outerradius}{-\outerradius}}%
}%
\else%
\ifdim\pgfmathresult pt<\tailtopangle pt\relax%
\pgfpointadd{\centerpoint}{%
\pgfpointintersectionoflines%
{\externalpoint}{\pgfpointorigin}%
- {\pgfqpoint{\outerradius}{\outerradius}}{\pgfqpoint{\outerradius}{-\outerradius}}%
+ {\pgfqpoint{\outerradius}{\outerradius}}{\pgfqpoint{\outerradius}{-\outerradius}}%
}%
\else%
\pgfpointadd{\centerpoint}{%
\pgfpointborderellipse%
{\externalpoint}%
- {\pgfqpoint{\outerradius}{\outerradius}}%
+ {\pgfqpoint{\outerradius}{\outerradius}}%
}%
\fi%
\fi%
\fi%
- }
-}
+ }%
+}%
% Local Variables:
% tab-width: 2
-% End: \ No newline at end of file
+% End:
diff --git a/Master/texmf-dist/tex/generic/pgf/lua/pgf/manual.lua b/Master/texmf-dist/tex/generic/pgf/lua/pgf/manual.lua
index 583777075df..7142eea3ec5 100644
--- a/Master/texmf-dist/tex/generic/pgf/lua/pgf/manual.lua
+++ b/Master/texmf-dist/tex/generic/pgf/lua/pgf/manual.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/lua/pgf/manual.lua,v 1.1 2013/05/23 20:01:29 tantau Exp $
+-- @release $Header$
diff --git a/Master/texmf-dist/tex/generic/pgf/lua/pgf/manual/DocumentParser.lua b/Master/texmf-dist/tex/generic/pgf/lua/pgf/manual/DocumentParser.lua
index 116809a473c..2f367dfdd4d 100644
--- a/Master/texmf-dist/tex/generic/pgf/lua/pgf/manual/DocumentParser.lua
+++ b/Master/texmf-dist/tex/generic/pgf/lua/pgf/manual/DocumentParser.lua
@@ -7,7 +7,7 @@
--
-- See the file doc/generic/pgf/licenses/LICENSE for more information
--- @release $Header: /cvsroot/pgf/pgf/generic/pgf/lua/pgf/manual/DocumentParser.lua,v 1.3 2014/02/24 10:40:33 tantau Exp $
+-- @release $Header$
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 0c11f544594..fd3eea1b0bf 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
@@ -7,17 +7,20 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ifx\pgfmathsetlength\undefined
+
+% Guard against reading twice
+\ifx\pgfmathloaded\pgfutil@undefined
+ \let\pgfmathloaded=\relax
\else
\expandafter\endinput
\fi
-\input pgfmathcalc.code.tex
-
-\ifx\pgfkeysloaded\undefined
- \let\pgfkeysloaded=\relax
-\else
- \expandafter\input pgfmathfloat.code.tex
+% We need keys:
+\ifx\pgfkeysloaded\pgfutil@undefined
+ \input pgfkeys.code.tex
\fi
+\input pgfmathcalc.code.tex
+\input pgfmathfloat.code.tex
+
\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex
index 34a5e406a68..006d6ea4046 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex
@@ -805,7 +805,7 @@
}
\newif\ifpgfmathfloatround@allow@empty@mantissa
-\def\pgfmathfloatround@mantissa@ONE{1.0}%
+\def\pgfmathfloatround@mantissa@ONE{1pt }%
% #1: sign
% #2: mantissa
@@ -821,10 +821,38 @@
\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
+ \def\pgfmathfloat@loc@TMPa{1}% "should draw mantissa=1"
+ \ifpgfmathfloatround@allow@empty@mantissa
+ \else
+ \ifdim#2pt=\pgfmathfloatround@mantissa@ONE
+ \def\pgfmathfloat@loc@TMPa{0}% do not draw it.
+ \fi
+ \fi
+ %
+ \if1\pgfmathfloat@loc@TMPa
+ \pgfmathprintnumber@fixed@style{#2}#1#2e0\relax%
+ \expandafter\pgfmathfloatrounddisplaystyle@shared@impl@\expandafter{\pgfmathresult}{#4#6}%
+ \else
+ \def\pgfmathfloat@loc@TMPa{0}%
+ \pgfmathfloatrounddisplaystyle@shared@impl@{#5}{#6}%
+ \fi
+ \or
+ \def\pgfmathfloat@loc@TMPa{1}% "should draw mantissa=1"
+ \ifpgfmathfloatround@allow@empty@mantissa
+ \else
+ \ifdim#2pt=\pgfmathfloatround@mantissa@ONE
+ \def\pgfmathfloat@loc@TMPa{0}% do not draw it.
+ \fi
+ \fi
+ %
+ \if1\pgfmathfloat@loc@TMPa
+ \pgfmathprintnumber@fixed@style{-#2}#1#2e0\relax%
+ \expandafter\pgfmathfloatrounddisplaystyle@shared@impl@\expandafter{\pgfmathresult}{#4#6}%
+ \else
+ \def\pgfmathfloat@loc@TMPa{0}%
+ \pgfmathfloatrounddisplaystyle@shared@impl@{-#5}{#6}%
+ \fi
\or
\pgfmathfloatrounddisplaystyle@shared@impl@@{\hbox{NaN}}{}%
\or
@@ -1049,8 +1077,15 @@
@sci exponent mark=,
}%
},
-% sci may skip mantissa/.is if=pgfmathfloatround@allow@empty@mantissa,
-% sci may skip mantissa/.default=true,
+ retain unit mantissa/.is if=pgfmathfloatround@allow@empty@mantissa,
+ retain unit mantissa/.default=true,
+ retain unit mantissa=true,
+ %
+ % allows to replace the implementation, for example
+ % 'implementation=\num'. This is experimental -- it is inclear
+ % if all consumers work well since they rely on the keys in
+ % /pgf/number format.
+ implementation/.code={\def\pgfmathprintnumber@protected{#1}},
}
@@ -1121,7 +1156,7 @@
}
\def\pgfmathprintnumber@RELATIVE@choice@roundtofixed@warn{%
- \immediate\write16{! Package pgf warning: the use of /pgf/number format/relative is discouraged (buggy). Please use 'relative*' instead or type \string\pgfkeys{/pgf/number format/relative round mode=fixed} into your preamble.}%
+ \pgf@typeout{! Package pgf warning: the use of /pgf/number format/relative is discouraged (buggy). Please use 'relative*' instead or type \string\pgfkeys{/pgf/number format/relative round mode=fixed} into your preamble.}%
\global\let\pgfmathprintnumber@RELATIVE@choice@roundtofixed@warn=\relax
}
@@ -1389,7 +1424,7 @@
\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.}%
+ \pgf@typeout{! 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
diff --git a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex
index f11704c94c2..9094da50dc9 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex
@@ -121,4 +121,4 @@
\pgfmath@smuggleone\pgfmathresult
\endgroup}
-\endinput \ No newline at end of file
+\endinput
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
index 03f9ca270ae..07f7b8b6d90 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex
@@ -39,17 +39,28 @@
\pgfmathdeclarefunction{floor}{1}{%
\begingroup%
\expandafter\pgfmath@x#1pt\relax%
- \afterassignment\pgfmath@gobbletilpgfmath@%
- \expandafter\c@pgfmath@counta\the\pgfmath@x\relax\pgfmath@%
+ \afterassignment\pgfmathfloor@collect@remainder%
+ \expandafter\c@pgfmath@counta\the\pgfmath@x\pgfmath@%
\expandafter\pgfmath@x#1pt\relax%
\ifdim\pgfmath@x<0pt\relax%
- \advance\c@pgfmath@counta by -1\relax%
+ \ifdim\pgfmathfloor@remainder>0pt
+ \advance\c@pgfmath@counta by -1\relax%
+ \else
+ % ok, we stripped only '0'.
+ \fi
\fi%
\pgfmath@x\c@pgfmath@counta pt\relax%
\pgfmath@returnone\pgfmath@x%
\endgroup%
}%
+\def\pgfmathfloor@collect@remainder#1\pgfmath@{%
+ \def\pgfmathfloor@remainder{#1}%
+ \ifx\pgfmathfloor@remainder\pgfutil@empty
+ \def\pgfmathfloor@remainder{0}%
+ \fi
+}%
+
% ceil function.
%
\pgfmathdeclarefunction{ceil}{1}{%
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 e2c78d1fdf4..0ede2314cfe 100644
--- a/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
@@ -160,6 +160,24 @@
\def\pgfmathresultunitscale{1}
+
+% A utility function which evaluates expression '#1' and invokes '#2'
+% if the expression is true and '#3' if it is false.
+\def\pgfmathifexpression#1#2#3{%
+ \pgfmathparse{#1}%
+ \pgfmath@iftrue{#2}{#3}%
+}%
+% Executes '#1' if \pgfmathresult is 'true', '#2' otherwise.
+% WARNING : overwritten in fpu lib!
+\def\pgfmath@iftrue{%
+ \ifdim\pgfmathresult pt=1.0pt %
+ \let\pgfmath@next=\pgfutil@firstoftwo
+ \else
+ \let\pgfmath@next=\pgfutil@secondoftwo
+ \fi
+ \pgfmath@next%
+}%
+
% Stuff for compatability with the calc package.
%
\def\pgfmath@calc@real#1{#1}
@@ -261,6 +279,10 @@
\fi
\pgfmath@parse@next}
+% TT: If false, octal parsing is switched off (needed for time parsing)
+\newif\ifpgfmath@octalparsing
+\pgfmath@octalparsingtrue
+
% I (CJ) *think* it replaces |{| and |}| by |\pgfmath@bgroup| and
% |\pgfmath@egroup|?
\def\pgfmath@parse@@@ifbgroup#1{%
@@ -312,7 +334,9 @@
\let\pgfmath@base=\pgfmath@empty%
\let\pgfmath@token@next=\pgfmath@token%
\if#10% Check for octal prefix.
- \def\pgfmath@base{8}%
+ \ifpgfmath@octalparsing%
+ \def\pgfmath@base{8}%
+ \fi%
\fi%
\let\pgfmath@parse@next=\pgfmath@parse@number%
\else%
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleanimations.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleanimations.code.tex
new file mode 100644
index 00000000000..4860107d1c2
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleanimations.code.tex
@@ -0,0 +1,1314 @@
+% Copyright 2015 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{pgfmoduleanimations.code.tex}
+
+
+% We need the animation system abstraction:
+
+\input pgfsysanimations.code.tex
+
+
+% Animate an attribute over time
+%
+% #1 = an attribute
+% #2 = configuration keys
+%
+% This command adds animation commands for the attribute given in #1
+% of some future object to the current graphic scope. For instance,
+% when #1 is "fill opacity" then the fill opacity of the object will
+% change over time. The object to which the command refers is
+% specified using a special key in #2.
+%
+% The keys in #2 specify how the changes occur over time. There are a
+% number of keys that have an effect on the animation "as a whole"
+% (like "repeats") while the most central key is the entry key. This
+% key takes two parameters: a time and a value. It specifies that at
+% the given time the attribute should have the specified value. The
+% times must be given in ascending order. Between the times given in
+% this way, the values of the attribute will be interpolated; you can
+% influence the details of how this interpolation is done using
+% additional keys.
+%
+% The keys in #2 are given in key-value syntax and can be given in any
+% order, except that the entry keys must be given in order of
+% ascending times.
+%
+% The syntax of the second parameter of the entry key depends on
+% #1. Currently, these are:
+%
+% Attribute Value Type
+% ---------------------------------------
+% fill opacity scalar
+% stroke opacity scalar
+% opacity scalar
+% visible boolean
+% line width dimension
+% fill color
+% stroke color
+% motion motion
+% translate point
+% scale scaling
+% rotate scalar
+% xskew scalar
+% yskew scalar
+% path path
+% softpath softpath
+% view viewbox
+% dash phase dimension
+% dash pattern dashpattern
+% none any
+%
+% Example:
+%
+% \pgfanimateattribute{fill opacity}{entry={0s}{1}, entry={2s}{0}}
+
+\def\pgfanimateattribute#1#2{%
+ \pgfanimateattributecode{#1}{\pgfkeys{/pgf/animation/.cd,#2}}%
+}
+
+
+% Variant of \pgfanimateattribute
+%
+% #1 = attribute
+% #2 = code
+%
+% Description:
+%
+% A version of \pgfanimateattribute where instead of keys #2 you
+% provide a code #2 that calls the animation keys itself.
+
+\def\pgfanimateattributecode#1#2{%
+ {%
+ \pgfkeys{/pgf/@animation attributes/.cd,#1}%
+ #2%
+ \csname pgf@animation@check@\pgf@animation@attribute\endcsname%
+ \pgfsysanimate{\pgf@animation@attribute}%
+ }%
+}
+
+
+
+% Create a time snapshot
+%
+% #1 = a time
+%
+% Description:
+%
+% This command should be called in a scope prior to all calls of
+% animation commands in that scope. When called, all animations will
+% be "intercepted" and, instead of creating the animation code, normal
+% code will be generated that shows the state of the animation at the
+% specified "moment" #1. Since no animation code is involved, this
+% works with all drivers.
+%
+% The command \pgfsnapshotafter works the same way as \pgfsnapshot,
+% only the timing is slightly different: Conceptually, #1 is
+% interpreted as "#1+epsilon". For instance, if there are two values
+% specified for the time #1, then \pgfsnapshot will use the first
+% while \pgfsnapshotafter will use the second. Likewise, when an
+% animation ends at time #1, \pgfsnapshot will still us the
+% animation's value, while \pgfsnapshotafter will not.
+%
+% Example:
+%
+% {
+% \pgfsnapshot{1.2s}
+% \pgfanimateattribute{fill opacity}{entry={0s}{1}, entry={2s}{0}}
+% \fill (0,0) rectangle (1,1);
+% }
+
+\def\pgfsnapshot#1{\pgfparsetime{#1}\expandafter\pgfsysanimsnapshot\expandafter{\pgftimeresult}}
+\def\pgfsnapshotafter#1{\pgfparsetime{#1}\expandafter\pgfsysanimsnapshotafter\expandafter{\pgftimeresult}}
+
+
+% The animation attributes
+
+\pgfkeys{/pgf/@animation attributes/.cd,
+ visible/.code=\pgf@animate@attr{visibility}{mapped}\def\pgf@anim@map@true{visible}\def\pgf@anim@map@false{hidden},
+ stage/.code=\pgf@animate@attr{visibility}{mapped}\def\pgf@anim@map@true{visible}\def\pgf@anim@map@false{hidden}\pgfsysanimkeybase\pgfsysanimvaltext{hidden},
+ opacity/.code=\pgf@animate@attr{opacity}{scalar},
+ fill opacity/.code=\pgf@animate@attr{fillopacity}{scalar},
+ draw opacity/.code=\pgf@animate@attr{strokeopacity}{scalar},
+ stroke opacity/.style=draw opacity,
+ line width/.code=\pgf@animate@attr{linewidth}{dimension},
+ fill/.code=\pgf@animate@attr{fillcolor}{color},
+ draw/.code=\pgf@animate@attr{strokecolor}{color},
+ color/.code=\pgf@animate@attr{color}{color},
+ stroke/.style=draw,
+ motion/.code=\pgf@animate@attr{motion}{scalar},
+ translate/.code=\pgf@animate@attr{translate}{point},
+ scale/.code=\pgf@animate@attr{scale}{scaling},
+ rotate/.code=\pgf@animate@attr{rotate}{scalar},
+ xskew/.code=\pgf@animate@attr{skewx}{scalar},
+ yskew/.code=\pgf@animate@attr{skewy}{scalar},
+ skew x/.style=xskew,
+ skew y/.style=yskew,
+ path/.code=\pgf@animate@attr{path}{path},
+ softpath/.code=\pgf@animate@attr{path}{softpath},
+ view/.code=\pgf@animate@attr{viewbox}{viewbox},
+ dash/.code=\pgf@animate@attr{dash}{dash},
+ none/.code=\pgf@animate@attr{none}{none},
+}
+
+\def\pgf@animate@attr#1#2{%
+ \def\pgf@animation@attribute{#1}%
+ \expandafter\let\expandafter\pgfanim@type@parser\csname pgfanim@parse@type@#2\endcsname%
+}
+
+
+
+% The time parser
+%
+% #1 = a time
+%
+% This macro parses the time in #1, but adds some support for times:
+%
+% 1) The postfix operator "s" is added, which has no effect.
+% 2) The postfix operator "ms" is added, which devides a number by
+% 1000, so "2ms" equals "0.002".
+% 3) The postfix operator "min" is added, which multiplies a number by
+% 60.
+% 4) The postfix operator "h" is added, which multiplies a number by
+% 3600.
+% 5) The infix operator ":" is redefined, so that it multiplies its
+% first argument by 60 and adds the second. This implies that
+% "1:20" equals "80" and "01:00:00" equals "3600".
+% 6) The parsing of octal numbers is switched off to allow things like
+% "01:08" for 68s.
+
+\def\pgfparsetime#1{%
+ \begingroup%
+ \pgfmathdeclareoperator{s}{@seconds}{1}{postfix}{600}%
+ \pgfmathdeclareoperator{m}{m@encountered}{1}{postfix}{600}%
+ \pgfmathdeclareoperator{i}{i@encountered}{1}{postfix}{600}%
+ \pgfmathdeclareoperator{n}{@minutes}{1}{postfix}{600}%
+ \pgfmathdeclareoperator{h}{@hours}{1}{postfix}{600}%
+ \pgfmathdeclareoperator{:}{time@colon}{2}{infix}{50}%
+ \pgfmath@octalparsingfalse%
+ \pgfmathparse{#1}%
+ \expandafter\endgroup%
+ \expandafter\def\expandafter\pgftimeresult\expandafter{\pgfmathresult}%
+}
+
+\newif\ifpgfanim@m@encountered
+\newif\ifpgfanim@i@encountered
+\pgfmathdeclarefunction{@seconds}{1}{%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \ifpgfanim@m@encountered%
+ \divide\pgfmath@x by1000\relax%
+ \fi%
+ \global\pgfanim@m@encounteredfalse%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}%
+\pgfmathdeclarefunction{m@encountered}{1}{%
+ \global\pgfanim@m@encounteredtrue%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}%
+\pgfmathdeclarefunction{i@encountered}{1}{%
+ \ifpgfanim@m@encountered%
+ \global\pgfanim@m@encounteredfalse%
+ \global\pgfanim@i@encounteredtrue%
+ \else%
+ \pgfmath@error{Unexpected i}{}%
+ \fi%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}%
+\pgfmathdeclarefunction{@minutes}{1}{%
+ \ifpgfanim@i@encountered%
+ \global\pgfanim@i@encounteredfalse%
+ \else%
+ \pgfmath@error{Unexpected n}{}%
+ \fi%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \pgfmath@x60\pgfmath@x\relax%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}%
+\pgfmathdeclarefunction{@hours}{1}{%
+ \begingroup%
+ \expandafter\pgfmath@x#1pt\relax%
+ \pgfmath@x3600\pgfmath@x\relax%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}%
+\pgfmathdeclarefunction{time@colon}{2}{%
+ \begingroup%
+ \pgfmath@x=#1pt\relax%
+ \pgfmath@x=60\pgfmath@x\relax%
+ \pgfmath@y=#2pt\relax%
+ \advance\pgfmath@x by\pgfmath@y%
+ \pgfmath@returnone\pgfmath@x%
+ \endgroup%
+}
+
+
+
+% Sets general animation attributes
+%
+% #1 = key-value pairs that are executed for the path /pgf/animation/
+
+\def\pgfanimationset{\pgfqkeys{/pgf/animation}}
+
+
+% Sets the target animation scope that should be animated.
+%
+% #1 = A name that will be used with an idscope.
+%
+% Example:
+%
+% \pgfanimateattribute{fill opacity}{whom=some scope, entry={0s}{1}, entry={1s}{0}}
+% \begin{scope}[name=some scope]
+% \draw (0,0) -- (1,1);
+% \draw (1,0) -- (2,1);
+% \end{scope}
+
+\pgfanimationset{
+ whom/.code={%
+ \pgf@anim@decomp{#1}%
+ \pgfidrefnextuse\pgf@anim@id\pgf@anim@id@name%
+ \expandafter\expandafter\expandafter\pgfsysanimkeywhom\expandafter\expandafter\expandafter{\expandafter\pgf@anim@id\expandafter}\expandafter{\pgf@anim@type}%
+ \let\pgf@anim@whom@id\pgf@anim@id%
+ \let\pgf@anim@whom@type\pgf@anim@type%
+ }
+}
+
+\def\pgf@anim@decomp#1{%
+ \edef\pgf@temp{#1}%
+ \expandafter\pgfutil@in@\expandafter.\expandafter{\pgf@temp}%
+ \ifpgfutil@in@%
+ \expandafter\pgf@anim@decomp@\pgf@temp\pgf@stop%
+ \else%
+ \expandafter\pgf@anim@decomp@\pgf@temp.\pgf@stop%
+ \fi%
+}
+\def\pgf@anim@decomp@#1.#2\pgf@stop{%
+ \def\pgf@anim@id@name{#1}%
+ \def\pgf@anim@type{#2}%
+}
+
+
+% Assigns a name to this animation so that it can be used as an event
+% id in another animation
+%
+% #1 = A name
+%
+% The name "previous" is special and always refers to the most recent
+% animation before the animation currently being constructed.
+%
+% Example:
+%
+% \pgfanimateattribute{fill opacity}{name=anim 1, entry={0s}{1}, entry={1s}{0}}
+% \pgfanimateattribute{fill opacity}{begin on={end,of=anim 1}, entry={0s}{1}, entry={1s}{0}}
+
+\pgfanimationset{
+ name/.code=\pgfuseid{#1}
+}
+
+
+
+
+% Configures whether an animation can be restarted
+%
+% Some animations can restart when certain events take place. This key
+% configures this. Setting it to
+%
+% "true" allows a restart at any time,
+% "false" does not allow a restart,
+% "when not active" allows a restart only, when the element is not
+% active.
+%
+% Example:
+%
+% \pgfanimateattribute{fill opacity}{entry={0s}{1}, entry={1s}{0}, restart=false}
+
+\pgfanimationset{
+ restart/.is choice,
+ restart/.default=true,
+ restart/true/.code=\pgfsysanimkeyrestartalways,
+ restart/false/.code=\pgfsysanimkeyrestartnever,
+ restart/never/.code=\pgfsysanimkeyrestartnever,
+ restart/when not active/.code=\pgfsysanimkeyrestartwhennotactive
+}
+
+
+% Sets the number times an animation should repeat
+%
+% #1 = A string of the following form:
+%
+% [<empty> | <number> | for <time>] ["accumulating"]
+%
+% When empty (the default value) the animation repeats forever.
+%
+% When a <number> is provided, the animation will repeat <number>
+% times, which need not be an integer.
+%
+% When a <time> is given, the repeating will stop after this much time.
+%
+% When the optional "accumulating" is specified, the repeat
+% accumulates, otherwise each repeat begins with the original start
+% value.
+%
+% Example:
+%
+% \pgfanimateattribute{fill opacity}{repeats, entry={0s}{1}, entry={6s}{0}}
+% \pgfanimateattribute{fill opacity}{repeats=2, entry={0s}{1}, entry={6s}{0}}
+% \pgfanimateattribute{fill opacity}{repeats=2 accumulating, entry={0s}{1}, entry={6s}{0}}
+% \pgfanimateattribute{fill opacity}{repeats=for 15s, entry={0s}{1}, entry={6s}{0}}
+
+\pgfanimationset{
+ repeats/.code={%
+ \pgfutil@in@{accumulating\pgf@stop}{#1\pgf@stop}%
+ \ifpgfutil@in@%
+ \pgfsysanimkeyaccumulate%
+ \pgfanim@parse@acc#1\pgf@stop%
+ \else%
+ \pgfsysanimkeynoaccumulate%
+ \pgfanim@parse@noacc{#1}%
+ \fi%
+ },
+ repeats/.default=,
+ repeat/.style={repeats={#1}},
+ repeat/.default=,
+}
+\def\pgfanim@parse@acc#1accumulating\pgf@stop{%
+ \pgfanim@parse@noacc{#1}%
+}
+\def\pgfanim@parse@noacc#1{%
+ \pgfutil@in@{\pgf@stop for}{\pgf@stop#1}%
+ \ifpgfutil@in@%
+ \pgfanim@parse@for#1\pgf@stop%
+ \else%
+ \def\pgf@temp{#1}%
+ \ifx\pgf@temp\pgfutil@empty%
+ \pgfsysanimkeyrepeatindefinite%
+ \else%
+ \pgfmathparse{#1}%
+ \expandafter\pgfsysanimkeyrepeat\expandafter{\pgfmathresult}%
+ \fi%
+ \fi%
+}
+\def\pgfanim@parse@for for#1\pgf@stop{\pgfparsetime{#1}\expandafter\pgfsysanimkeyrepeatdur\expandafter{\pgftimeresult}}
+
+
+
+
+
+% Specifies that an animation should begin or end at a certain time
+% (relative to the current context). The "begin..." options may be
+% used multiple times and their effects accumulate, likewise for the
+% "end..." options.
+%
+% #1 = A time
+%
+% Example:
+%
+% \pgfanimateattribute{fill opacity}{begin=2s, end=2.5s, entry={0s}{1}, entry={1s}{0}}
+
+\pgfanimationset{
+ begin/.code=\pgfparsetime{#1}\expandafter\pgfsysanimkeyoffset\expandafter{\pgftimeresult}{begin},
+ end/.code=\pgfparsetime{#1}\expandafter\pgfsysanimkeyoffset\expandafter{\pgftimeresult}{end},
+}
+
+
+
+% Specifies that an animation should begin (or end) when a certain
+% event takes place.
+%
+% #1 = A list of key-value pairs.
+%
+% The following keys are allowed:
+%
+% event=some event : The begin / end is triggered by that event. The
+% list of allowed events is defined in the SVG
+% standard.
+% of=some name : The event does not refer to the current group,
+% but to the object named "some name", which must
+% previously have been named \pgfuseid. If some
+% name contains a period, the part before the
+% period must be the name of the id, the part
+% following it the type of the id.
+% key=some key : The trigger is some key being pressed
+% repeat=number : The trigger is that an animation has been
+% repeated number times.
+% delay=time : A delay, may be negative.
+%
+% These keys are executed with the path prefix /pgf/animation/events.
+%
+% Some of them are predefined:
+%
+% "click" is a shorthand for "event=click"
+% "focus in" is a shorthand for "event=focusin"
+% "focus out" is a shorthand for "event=focusout"
+% "activate" is a shorthand for "event=activate"
+% "mouse down" is a shorthand for "event=mousedown"
+% "mouse up" is a shorthand for "event=mouseup"
+% "mouse over" is a shorthand for "event=mouseover"
+% "mouse move" is a shorthand for "event=mousemove"
+% "mouse out" is a shorthand for "event=mouseout"
+% "begin" is a shorthand for "event=begin"
+% "end" is a shorthand for "event=end"
+%
+% Example:
+%
+% % Begin after 5s or when clicked:
+% \pgfanimateattribute{fill opacity}{begin=5s, begin on=click, entry={0s}{1}, entry={1s}{0}}
+%
+% % Begin, when an object named "button" is clicked
+% \pgfanimateattribute{fill opacity}{begin on={click, of=button}, entry={0s}{1}, entry={1s}{0}, name=another animation}
+%
+% % Begin 1s after some other animation ends
+% \pgfanimateattribute{fill opacity}{begin on={end, of=another animation, delay=1s}, entry={0s}{1}, entry={1s}{0}}
+
+\pgfanimationset{
+ begin on/.code={\pgfanim@make@event{#1}{begin}},%
+ end on/.code={\pgfanim@make@event{#1}{end}}
+}
+
+\def\pgfanim@make@event#1#2{%
+ \let\pgfanim@event@event\pgfutil@empty%
+ \let\pgf@anim@id\pgfutil@empty%
+ \let\pgf@anim@type\pgfutil@empty%
+ \let\pgfanim@event@key\pgfutil@empty%
+ \let\pgfanim@event@repeat\pgfutil@empty%
+ \let\pgfanim@event@delay\pgfutil@empty%
+ \pgfkeys{/pgf/animation/events/.cd,#1}%
+ \ifx\pgfanim@event@key\pgfutil@empty%
+ \ifx\pgfanim@event@repeat\pgfutil@empty%
+ \ifx\pgfanim@event@event\pgfutil@empty%
+ \pgferror{No event specified}%
+ \else%
+ \pgfsysanimkeyevent{\pgf@anim@id}{\pgf@anim@type}{\pgfanim@event@event}{\pgfanim@event@delay}{#2}%
+ \fi%
+ \else%
+ \pgfsysanimkeyrepeatevent{\pgf@anim@id}{\pgf@anim@type}{\pgfanim@event@repeat}{\pgfanim@event@delay}{#2}%
+ \fi%
+ \else%
+ \pgfsysanimkeyaccesskey{\pgfanim@event@key}{\pgfanim@event@delay}{#2}%
+ \fi%
+}
+
+\pgfkeys{/pgf/animation/events/.cd,
+ event/.store in=\pgfanim@event@event,
+ of/.code={%
+ \pgf@anim@decomp{#1}%
+ \pgfidrefprevuse\pgf@anim@id\pgf@anim@id@name%
+ \ifx\pgf@anim@id\pgfutil@empty%
+ \pgferror{Unknown object/node name '\pgf@anim@id@name'. Did you
+ mean 'of next=\pgf@anim@id@name'?}%
+ \fi%
+ },
+ of next/.code={%
+ \pgf@anim@decomp{#1}%
+ \pgfidrefnextuse\pgf@anim@id\pgf@anim@id@name%
+ },
+ of id/.code=\def\pgf@anim@id{#1},
+ key/.store in=\pgfanim@event@key,
+ repeat/.code=\pgfmathparse{#1}\let\pgfanim@event@repeat\pgfmathresult,
+ delay/.code=\pgfparsetime{#1}\let\pgfanim@event@delay\pgftimeresult,
+ click/.style={event=click},
+ focus in/.style={event=focusin},
+ focus out/.style={event=focusout},
+ mouse down/.style={event=mousedown},
+ mouse up/.style={event=mouseup},
+ mouse over/.style={event=mouseover},
+ mouse move/.style={event=mousemove},
+ mouse out/.style={event=mouseout},
+ begin/.style={event=begin},
+ end/.style={event=end}
+}
+
+
+% Specifies the timeline start for a snapshot
+%
+% #1 = a time
+%
+% Description:
+%
+% What a snapshot is taken of an animation (using \pgfsnapshot), all
+% animations normally start at time 0s. When this key is used, the
+% animation's timeline start is considered to be at moment #1
+% instead.
+
+\pgfanimationset{
+ begin snapshot/.code=
+ \pgfparsetime{#1}\expandafter\pgfsysanimkeysnapshotstart\expandafter{\pgftimeresult}
+}
+
+
+% Specifies the origin for tranforming animations
+%
+% #1 = a pgf point
+%
+% Specifies the origin of transformations (for instance, a rotate will
+% rotate around this point).
+%
+% Example:
+%
+% \pgfanimateattribute{rotate}{entry={0s}{0}, entry={1s}{90}, origin=\pgfpoint{1cm}{1cm}}
+
+\pgfanimationset{
+ origin/.code={%
+ \pgf@process{#1}%
+ \edef\pgf@marshal{%
+ \noexpand\pgfsysanimkeycanvastransform%
+ {\noexpand\pgftransformshift{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}{\noexpand\pgflowlevelsynccm}}%
+ {\noexpand\pgftransforminvert\noexpand\pgflowlevelsynccm}%
+ \noexpand\pgf@anim@save@transform{\noexpand\pgftransformshift{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}%
+ }%
+ \pgf@marshal%
+ }
+}
+
+\pgfsysanimkeycanvastransform{{\pgflowlevelsynccm}}{\pgftransforminvert\pgflowlevelsynccm}%
+
+
+
+% Specifies the tranforming for the animation coordinate system
+%
+% #1 = code that changes the pgf coordinate system
+%
+% Specifies an additional transformation of the coordinate system for
+% animations.
+%
+% Example:
+%
+% \pgfanimateattribute{shift}{entry={0s}{\pgfpointorigin}, entry={1s}{\pgfpoint{1cm}{0cm}}, transform=\pgftransformrotate{30}}
+
+\pgfanimationset{
+ transform/.code={%
+ \pgfsysanimkeycanvastransform{#1{\pgflowlevelsynccm}}{\pgftransforminvert\pgflowlevelsynccm}%
+ \pgf@anim@save@transform{#1}%
+ }
+}
+
+
+
+% Specifies a motion path.
+%
+% #1 = pgf commands for constructing a path
+%
+% Use this key to specify a motion path for the motion attribute. The
+% values of the "entry" key specify fractions along this path.
+%
+% Example:
+%
+% \pgfanimateattribute{motion}{
+% entry={0s}{0}, entry={1s}{1},
+% along=\pgfpathmoveto{\pgfpointorigin} \pgfpathlineto{\pgfpoint{1cm}{1cm}}
+% }
+
+\pgfanimationset{
+ along/.code=%
+ {%
+ \pgfsyssoftpath@getcurrentpath\pgfanim@save@path%
+ \pgfsyssoftpath@setcurrentpath\pgfutil@empty%
+ #1%
+ \pgfsyssoftpath@getcurrentpath\pgfanim@the@path%
+ \global\let\pgfanim@the@path\pgfanim@the@path%
+ \pgfsyssoftpath@setcurrentpath\pgfanim@save@path%
+ }%
+ \expandafter\pgf@anim@protocol@path@size\pgfanim@the@path\pgf@stop%
+ \expandafter\pgfsysanimkeymovealong\expandafter{\pgfanim@the@path}%
+}
+
+
+% Specifies a motion soft path.
+%
+% #1 = a pgf soft path (result of calling \pgfsyssoftpath@getcurrentpath)
+%
+% Use this key to specify a motion path for the motion attribute when
+% a softpath has already been constructed.
+%
+% Example:
+%
+% \pgfanimateattribute{motion}{entry={0s}{0}, entry={1s}{1},
+% along softpath=\pgfsyssoftpath@movetotoken {0pt}{0pt}\pgfsyssoftpath@linetotoken {10pt}{10pt}}
+
+\pgfanimationset{
+ along softpath/.code=%
+ \pgf@anim@protocol@path@size#1\pgf@stop%
+ \pgfsysanimkeymovealong{#1}%
+}
+
+
+\def\pgf@anim@protocol@path@size{%
+ \pgfutil@ifnextchar\pgf@stop\relax\pgf@anim@protocol@path@size@%
+}
+\def\pgf@anim@protocol@path@size@#1#2#3{%
+ \pgf@protocolanimsizes@direct{#2}{#3}%
+ \pgf@anim@protocol@path@size%
+}
+
+
+% Configures whether the motion is rotated along the path.
+%
+% Example:
+%
+% \pgfanimateattribute{motion}{rotate along, entry={0s}{0}, entry={1s}{1},
+% along=\pgfpathmoveto{\pgfpointorigin} \pgfpathlineto{\pgfpoint{1cm}{1cm}}}
+
+\pgfanimationset{
+ rotate along/.is choice,
+ rotate along/.default=true,
+ rotate along/true/.code=\pgfsysanimkeyrotatealong,
+ rotate along/false/.code=\pgfsysanimkeynorotatealong,
+}
+
+
+
+% Specifies an entry
+%
+% #1 = A time. This time will be parsed using \pgfparsetime
+% #2 = A value. The format of this value depends on the current type
+% of the animation attribute. (So for an animation of the "fill
+% opacity", #1 must be a scalar value, for an animation of the "fill"
+% color, #1 must be a color, and so on.)
+% If #2 is the special text "current value", then the current
+% value will be used. For SVG, this is allowed only when exactly
+% two entries are specified and this special value is used for
+% the first one.
+%
+% Example:
+%
+% \pgfanimateattribute{fill opacity}{entry={0s}{0}, entry={1s}{1}}
+
+\pgfanimationset{entry/.code 2 args=\pgf@anim@entry{#1}{#2}}
+\def\pgf@anim@entry#1#2{%
+ \pgf@anim@entry@giventrue%
+ \pgfparsetime{#1}%
+ \edef\pgf@marshal{\noexpand\pgfsysanimkeytime{\pgftimeresult}\pgf@anim@entry@spline\pgf@anim@exit@spline}%
+ \pgf@marshal%
+ \def\pgf@temp{#2}%
+ \ifx\pgf@temp\pgf@special@current@text%
+ \pgfsysanimvalcurrent%
+ \else%
+ \pgfanim@type@parser{#2}%
+ \fi%
+}
+\def\pgf@special@current@text{current value}
+\newif\ifpgf@anim@entry@given
+
+
+% Specifies a base value
+%
+% #1 = A value. The format is as for the entry key.
+%
+% Description:
+%
+% Will set the "base" value of the animation, which is a value that is
+% used when the animation is not active.
+%
+% Example:
+%
+% \pgfanimateattribute{fill opacity}{base = 0.5, entry={0s}{0.5}, entry={1s}{1}}
+
+\pgfanimationset{base/.code=\pgf@anim@base{#1}}
+\def\pgf@anim@base#1{%
+ \pgfsysanimkeybase%
+ \pgfanim@type@parser{#1}%
+}
+
+
+% Specifies that there is an entry "at infinity".
+%
+% When an animation ends, its "effect" can either persist or it can be
+% removed. Setting "freeze at end" to true will cause it to persist,
+% otherwise it will be removed.
+%
+% Example:
+%
+% \pgfanimateattribute{fill opacity}{entry={0s}{1}, entry={1s}{0}, freeze at end}
+
+\pgfanimationset{
+ freeze at end/.is choice,
+ freeze at end/.default=true,
+ freeze at end/true/.code=\pgfsysanimkeyfreezeatend,
+ freeze at end/false/.code=\pgfsysanimkeyremoveatend,
+}
+
+
+
+% Specifies an entry or exit spline control
+%
+% #1 = time fraction
+% #2 = attribute fraction
+%
+% Description:
+%
+% Suppose that an animation is supposed to interpolate a attribute's
+% value between the two values "50" and "100" over a time of 10s. The
+% simplest way of doing so is to do a linear interpolation, where the
+% value as, say, 1s is 55, at 2s it is 60, and so on.
+%
+% Unfortunately, the linear interpolation does not "look" nice in many
+% cases since the acceleration of a linear interpolation is zero
+% during the animation, but infinite at the beginning and at the end;
+% which looks "jerky".
+%
+% To avoid this, you can specify that the time--attribute curve should
+% not be a straight line, but rather a curve. You specify this curve
+% using a spline.
+%
+% The most logical "coordinate rectangle" used for this spline in our
+% example would be (0s,50) and (10s,100) and we would like to specify
+% something like "(0s,50) .. controls (5s,50) and (9s,100)
+% .. (10s,100)". This would result in a time--attribute curve where
+% the attribute at 50 changes slowly at 0s and also arrives slowly at
+% 100 at 10s, but speeds up between these values.
+%
+% We call the first control point (5s,50) the "exit control" and call
+% (9s,100) the "entry control": The first control dictates how quickly
+% or slowly a time point is left, the second dictates how quickly or
+% slowly we enter the next one.
+%
+% The control points are, however, not specified in the coordinate
+% system indicated above. Rather, the rectangle (0s,50) to (10s, 100),
+% gets normalized to (0,0) to (1,1). The control point (5s,50) would
+% thus become (0.5,0) and (9s,100) becomes (0.9,1).
+%
+% Example:
+%
+% \pgfanimateattribute{rotate}{
+% exit control={0.5}{0},
+% entry control={0.9}{1},
+% entry={0s}{50},
+% entry={10s}{100}}
+
+\pgfanimationset{
+ entry control/.code 2 args={%
+ \pgfmathsetmacro\pgf@temp@t{#1}%
+ \pgfmathsetmacro\pgf@temp@a{#2}%
+ \edef\pgf@anim@entry@spline{{\pgf@temp@t}{\pgf@temp@a}}%
+ },
+ exit control/.code 2 args={%
+ \pgfmathsetmacro\pgf@temp@t{#1}%
+ \pgfmathsetmacro\pgf@temp@a{#2}%
+ \edef\pgf@anim@exit@spline{{\pgf@temp@t}{\pgf@temp@a}}%
+ },
+ stay/.code=\let\pgf@anim@exit@spline\pgfsys@stay@text,%
+ jump/.code=\let\pgf@anim@entry@spline\pgfsys@jump@text,%
+ linear/.style={entry control={1}{1},exit control={0}{0}}
+}
+\def\pgf@anim@entry@spline@base{{1}{1}}
+\def\pgf@anim@exit@spline@base{{0}{0}}
+
+\def\pgf@anim@reset@linear{\let\pgf@anim@entry@spline\pgf@anim@entry@spline@base\let\pgf@anim@exit@spline\pgf@anim@exit@spline@base}
+\pgf@anim@reset@linear
+
+
+
+% Specifies how much arrow tips should be shortened (as in
+% \pgfsetshortenstart)
+%
+% #1 = an additional shortening distance the path start.
+%
+% Description:
+%
+% Works like \pgfsetshortenstart, only for animated paths.
+
+\pgfanimationset{
+ shorten </.code={%
+ \ifpgf@anim@entry@given%
+ \pgferror{You must specify shorten < prior to the path entries}%
+ \else%
+ \pgfmathsetmacro\pgf@anim@marker@extra@shorten@start{#1}%
+ \edef\pgf@anim@marker@extra@shorten@start{\pgf@anim@marker@extra@shorten@start pt}%
+ \fi%
+ },
+ shorten >/.code={%
+ \ifpgf@anim@entry@given%
+ \pgferror{You must specify shorten < prior to the path entries}%
+ \else%
+ \pgfmathsetmacro\pgf@anim@marker@extra@shorten@end{#1}%
+ \edef\pgf@anim@marker@extra@shorten@end{\pgf@anim@marker@extra@shorten@end pt}%
+ \fi%
+ }
+}
+\def\pgf@anim@marker@extra@shorten@start{0pt}%
+\def\pgf@anim@marker@extra@shorten@end{0pt}%
+\def\pgf@anim@marker@shorten@start{0pt}%
+\def\pgf@anim@marker@shorten@end{0pt}%
+
+% Specifies the arrow tips used for path animations
+%
+% #1 = an arrow specification of the form <start>-<end> as for the
+% command \pgfsetarrows
+%
+% Description:
+%
+% Specifies arrow tips that are used in a path animation. Note that in
+% order to set the arrow tips of a path that is animated, you always
+% have to use this command. In particular, you should *not* set arrow
+% tips for the to-be-animated path, but use this key and the base key
+% to install a base path with arrow tips.
+
+\pgfanimationset{
+ arrows/.code={%
+ \ifpgf@anim@entry@given%
+ \pgferror{You must specify animation arrows prior to the path entries}%
+ \else%
+ \pgf@anim@parser@arrows#1\pgf@stop%
+ \fi%
+ }
+}
+
+\def\pgf@anim@parser@arrows#1-#2\pgf@stop{%
+ \pgf@anim@prepare@arrow@start{#1}%
+ \pgf@anim@prepare@arrow@end{#2}%
+ \expandafter\expandafter\expandafter\pgfsysanimkeytipmarkers\expandafter\expandafter\expandafter{\expandafter\pgf@anim@marker@id@start\expandafter}\expandafter{\pgf@anim@marker@id@end}%
+}
+
+\def\pgf@anim@prepare@arrow@start#1{%
+ \def\pgf@anim@temp{#1}%
+ \ifx\pgf@anim@temp\pgfutil@empty%
+ \let\pgf@anim@marker@id@start\pgfutil@empty%
+ \def\pgf@anim@marker@shorten@start{0pt}%
+ \else%
+ {%
+ \pgfsetarrowsstart{#1}%
+ \pgf@anim@prep@marker@arrow\pgf@start@tip@sequence\pgf@anim@marker@id\pgf@anim@marker@shorten%
+ \global\let\pgf@anim@marker@id@start\pgf@anim@marker@id%
+ \global\let\pgf@anim@temp\pgf@anim@marker@shorten%
+ }%
+ \let\pgf@anim@marker@shorten@start\pgf@anim@temp%
+ \fi%
+}
+
+\def\pgf@anim@prepare@arrow@end#1{%
+ \def\pgf@anim@temp{#1}%
+ \ifx\pgf@anim@temp\pgfutil@empty%
+ \let\pgf@anim@marker@id@end\pgfutil@empty%
+ \def\pgf@anim@marker@shorten@end{0pt}%
+ \else%
+ {%
+ \pgfsetarrowsend{#1}%
+ \pgf@anim@prep@marker@arrow\pgf@end@tip@sequence\pgf@anim@marker@id\pgf@anim@marker@shorten%
+ \global\let\pgf@anim@marker@id@end\pgf@anim@marker@id%
+ }%
+ \let\pgf@anim@marker@shorten@end\pgf@anim@marker@shorten%
+ \fi%
+}
+
+
+% Draw an arrow using markers
+
+\def\pgf@anim@prep@marker@arrow#1#2#3{%
+ % #1 = tip sequence
+ % #2 = macro for storing marker code
+ % #3 = macro for storing shortening length
+ %
+ % First, compute id's:
+ {%
+ \let\pgf@arrow@handle\pgf@anim@marker@id@test%
+ \let\pgf@arrow@handle@dot\relax%?
+ \global\let\pgf@anim@marker@id@list\pgfutil@empty%
+ #1%
+ }%
+ \expandafter\let\expandafter#2\csname pgfanim@marker@cache@\pgf@anim@marker@id@list\endcsname%
+ \expandafter\let\expandafter#3\csname pgfanim@marker@cachel@\pgf@anim@marker@id@list\endcsname%
+ \ifx#2\relax% ok, have to create it!
+ \pgf@relevantforpicturesizefalse%
+ \pgfinterruptpath%
+ \pgf@arrow@compute@shortening{#1}%
+ \xdef#3{\the\pgf@xa}%
+ {%
+ \let\pgf@arrow@handle\pgf@anim@drawer@marker
+ \let\pgf@arrow@handle@dot\relax%
+ \pgfsys@marker@declare#2{%
+ \pgftransformxshift{-\pgf@xb}%
+ \pgftransformxshift{\pgf@xa}%
+ #1%
+ }%
+ }%
+ \endpgfinterruptpath%
+ \expandafter\global\expandafter\let\csname pgfanim@marker@cache@\pgf@anim@marker@id@list\endcsname#2%
+ \expandafter\global\expandafter\let\csname pgfanim@marker@cachel@\pgf@anim@marker@id@list\endcsname#3%
+ \fi%
+}
+
+\def\pgf@anim@marker@id@test#1#2{%
+ \pgfarrows@getid{#1}{#2}%
+ \expandafter\expandafter\expandafter\pgf@arrow@drawer@shift\csname pgf@ar@ends@\pgf@arrow@id\endcsname%
+ \xdef\pgf@anim@marker@id@list{\pgf@anim@marker@id@list:\pgf@arrow@id\ifpgfarrowswap s\else n\fi\pgfarrows@slant w\the\pgf@xc}%
+}
+
+\def\pgf@anim@drawer@marker#1#2{%
+ % Prepare:
+ {%
+ \pgfarrows@getid{#1}{#2}%
+ % Do shift:
+ \expandafter\expandafter\expandafter\pgf@arrow@drawer@shift\csname pgf@ar@ends@\pgf@arrow@id\endcsname%
+ % Do slant:
+ \ifdim\pgfarrows@slant pt=0pt%
+ \else%
+ \pgftransformxslant{\pgfarrows@slant}%
+ \fi%
+ % do swap:
+ \ifpgfarrowswap%
+ \pgftransformyscale{-1}%
+ \fi%
+ {%
+ \csname pgf@ar@saves@\pgf@arrow@id\endcsname%
+ \pgfsys@beginscope%
+ \pgf@arrows@color@setup%
+ \pgflowlevelsynccm\csname pgf@ar@cache@\pgf@arrow@id\endcsname%
+ \pgfsys@endscope%
+ }%
+ \expandafter}%
+ % Transform to next tip:
+ \expandafter\pgftransformxshift\expandafter{\the\pgf@xc}%
+}
+
+
+
+
+
+
+
+
+
+% The parsers
+
+% Parse no value
+%
+% #1 is ignored
+%
+% Example:
+%
+% entry = {0s}{5+6}
+
+\def\pgfanim@parse@type@none#1{%
+ \pgfsysanimvalnone%
+}
+
+% Parse a scalar
+%
+% #1 is a number parsed using \pgfmathparse
+%
+% Example:
+%
+% entry = {0s}{5+6}
+
+\def\pgfanim@parse@type@scalar#1{%
+ \pgfmathparse{#1}%
+ \expandafter\pgfsysanimvalscalar\expandafter{\pgfmathresult}%
+}
+
+
+% Parse a dimension
+%
+% #1 is a number parsed using \pgfmathparse
+%
+% Example:
+%
+% entry = {0s}{5cm + 2pt}
+
+\def\pgfanim@parse@type@dimension#1{%
+ \pgfmathparse{#1}%
+ \expandafter\pgfsysanimvaldimension\expandafter{\pgfmathresult pt}%
+}
+
+
+
+% Parse a mapped text
+%
+% #1 is a text. It is looked up in \pgf@anim@map@#1 and gets replaced
+% by what this macro expands to.
+%
+% Example:
+%
+% entry = {0s}{true}
+
+\def\pgfanim@parse@type@mapped#1{%
+ {%
+ \expandafter\let\expandafter\pgf@temp\csname pgf@anim@map@#1\endcsname\relax%
+ \ifx\pgf@temp\relax%
+ \pgferror{Value '#1' not allowed for an animation for this attribute}%
+ \let\pgf@temp\pgfutil@empty%
+ \fi%
+ \expandafter}%
+ \expandafter\pgfsysanimvaltext\expandafter{\pgf@temp}%
+}
+
+
+% Parse a color
+%
+% #1 is a color
+%
+% entry = {0s}{blue!20}
+
+\def\pgfanim@parse@type@color#1{%
+ \pgfsysanimvalcolor{#1}%
+}
+
+
+% Parse a path
+%
+% #1 is a sequence of pgf path construction commands
+%
+% entry = {0s}{\pgfpathmoveto{\pgfpointorigin} \pgfpathlineto{\pgfpoint{1cm}{1cm}}}
+
+\def\pgfanim@parse@type@path#1{%
+ {%
+ \pgfsyssoftpath@getcurrentpath\pgfanim@save@path%
+ \pgfsyssoftpath@setcurrentpath\pgfutil@empty%
+ #1%
+ \pgfsyssoftpath@getcurrentpath\pgfanim@the@path%
+ \pgfprocessround{\pgfanim@the@path}{\pgfanim@the@path}%
+ \global\let\pgfanim@the@path\pgfanim@the@path%
+ \pgfsyssoftpath@setcurrentpath\pgfanim@save@path%
+ }%
+ \expandafter\pgfanim@parse@type@softpath\expandafter{\pgfanim@the@path}%
+}
+
+
+% Parse a softpath
+%
+% #1 is a sequence of pgf softpath token commands
+%
+% entry = {0s}{\pgfsyssoftpath@movetotoken {0pt}{0pt}\pgfsyssoftpath@linetotoken {10pt}{10pt}}
+
+\def\pgfanim@parse@type@softpath#1{%
+ {%
+ \def\pgf@anim@path{#1}%
+ % Shorten?
+ \pgf@worryfalse%
+ \pgf@xb=\pgf@anim@marker@extra@shorten@start%
+ \advance\pgf@xb by\pgf@anim@marker@shorten@start%
+ \pgf@xc=\pgf@anim@marker@extra@shorten@end%
+ \advance\pgf@xc by\pgf@anim@marker@shorten@end%
+ \ifdim\pgf@xb=0pt\else\pgf@worrytrue\fi%
+ \ifdim\pgf@xc=0pt\else\pgf@worrytrue\fi%
+ \ifpgf@worry%
+ \edef\pgf@path@shortening@distance@end{\the\pgf@xc}%
+ \edef\pgf@path@shortening@distance@start{\the\pgf@xb}%
+ % Yes! Need to shorten.
+ \pgf@anim@shorten@path%
+ \fi%
+ \expandafter}%
+ \expandafter\pgfsysanimvalpath\expandafter{\pgf@anim@path}%
+}
+
+
+\def\pgf@anim@shorten@path{%
+ \pgf@precise@shorteningfalse%
+ \let\pgf@path@shortening@distance\pgf@path@shortening@distance@end%
+ %
+ % Step 1: Split
+ %
+ \pgfprocesssplitpath{\pgf@anim@path}%
+ \pgfprocesssplitsubpath{\pgfprocessresultpathsuffix}%
+ %
+ % Step 2: extract
+ %
+ \expandafter\pgf@parse@end\pgfprocessresultsubpathsuffix\pgf@stop\pgf@stop\pgf@stop%
+ %
+ % Step 3: prep end
+ %
+ \pgf@prep@end%
+ %
+ % Step 4: shorten end
+ %
+ \ifdim\pgf@path@shortening@distance=0pt\else\pgf@do@shorten@end\fi%
+ %
+ \let\pgf@path@shortening@distance\pgf@path@shortening@distance@start%
+ %
+ % Step 5: extract
+ %
+ \expandafter\pgf@parse@start\pgfprocessresultpathsuffix\pgf@stop\pgf@stop\pgf@stop%
+ %
+ % Step 6: prep start
+ %
+ \pgf@prep@start%
+ %
+ % Step 7: shorten start
+ %
+ \ifdim\pgf@path@shortening@distance=0pt\else\pgf@do@shorten@start\fi%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgf@anim@path%
+ \expandafter\expandafter\expandafter{\expandafter\pgfprocessresultpathprefix\pgfprocessresultpathsuffix}%
+}
+
+
+
+% Parse a point
+%
+% #1 is a point
+%
+% entry = {0s}{\pgfpoint{1cm}{2cm}}
+
+\def\pgfanim@parse@type@point#1{%
+ \pgf@process{#1}%
+ \pgf@protocolanimsizes\pgf@x\pgf@y%
+ \expandafter\expandafter\expandafter\pgfsysanimvaltranslate\expandafter\expandafter\expandafter{\expandafter\the\expandafter\pgf@x\expandafter}\expandafter{\the\pgf@y}%
+}
+
+
+% Parse a scaling
+%
+% #1 = if #1 contains a comma, the two parts are passed to
+% pgfmathparse, otherwise the whole thing is passed to pgfmathparse.
+%
+% entry = {0s}{2}
+% entry = {0s}{2,1}
+
+\def\pgfanim@parse@type@scaling#1{%
+ \pgfutil@in@{,}{#1}%
+ \ifpgfutil@in@%
+ \pgfanim@unpack@comma#1\pgf@stop%
+ \else%
+ \pgfmathparse{#1}%
+ \expandafter\pgfsysanimvalscale\expandafter{\pgfmathresult}{\pgfmathresult}%
+ \fi%
+}
+\def\pgfanim@unpack@comma#1,#2\pgf@stop{%
+ \pgfmathsetmacro{\pgf@anim@temp@x}{#1}%
+ \pgfmathsetmacro{\pgf@anim@temp@y}{#2}%
+ \expandafter\expandafter\expandafter\pgfsysanimvalscale\expandafter\expandafter\expandafter{\expandafter\pgf@anim@temp@x\expandafter}\expandafter{\pgf@anim@temp@y}%
+}
+
+
+
+% Parse a viewbox
+%
+% #1 consists of two points, each in paranetheses
+%
+% entry = {0s}{{\pgfpoint{1cm}{2cm}}{\pgfpoint{3cm}{4cm}}}
+
+\def\pgfanim@parse@type@viewbox#1{%
+ {%
+ \pgfanim@unpack@viewbox#1%
+ \xdef\pgf@anim@caller{\noexpand\pgfsysanimvalviewbox{\the\pgf@x}{\the\pgf@y}{\the\pgf@xa}{\the\pgf@ya}}%
+ }%
+ \pgf@anim@caller%
+}
+\def\pgfanim@unpack@viewbox#1#2{%
+ \pgfpointtransformed{#2}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \pgfpointtransformed{#1}%
+ \ifdim\pgf@xa<\pgf@x% swap needed
+ \pgf@xb=\pgf@x%
+ \pgf@x=\pgf@xa%
+ \pgf@xa=\pgf@xb%
+ \fi%
+ \ifdim\pgf@ya<\pgf@y% swap needed
+ \pgf@yb=\pgf@y%
+ \pgf@y=\pgf@ya%
+ \pgf@ya=\pgf@yb%
+ \fi%
+}
+
+
+
+
+% Parse a dash pattern
+%
+% #1,#2 is a dash pattern as in \pgfsetdash
+%
+% entry = {0s}{{{1pt}{2pt}{3pt}{1pt}}{1pt}}
+
+\def\pgfanim@parse@type@dash#1{\pgfanim@parse@type@dash@#1}%
+\def\pgfanim@parse@type@dash@#1#2{%
+ \def\pgf@temp{}%
+ \def\pgf@next{\pgf@strip}%
+ \pgf@strip#1{pgf@stop}%
+ \expandafter\pgfsysanimvaldash\expandafter{\pgf@temp}{#2}%
+}
+
+
+
+
+
+%
+%
+% Bounding box adjustments in animations.
+%
+%
+
+\def\pgf@protocolanimsizes#1#2{%
+ \edef\pgf@temp{\noexpand\pgf@anim@handle@point{\the#1}{\the#2}}%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@protocolanim@list\expandafter\expandafter\expandafter{\expandafter\pgf@protocolanim@list\pgf@temp}%
+}
+\def\pgf@protocolanimsizes@direct#1#2{%
+ \expandafter\def\expandafter\pgf@protocolanim@list\expandafter{\pgf@protocolanim@list\pgf@anim@handle@point{#1}{#2}}%
+}
+\let\pgf@protocolanim@list\pgfutil@empty
+
+\def\pgf@animation@check@translate{%
+ \ifx\pgf@protocolanim@list\pgfutil@empty%
+ \else%
+ \expandafter\expandafter\expandafter\pgf@animation@check@translate@\expandafter\expandafter\expandafter{\expandafter\pgf@protocolanim@list\expandafter}\expandafter{\pgf@anim@saved@transform}%
+ \fi%
+}
+\let\pgf@animation@check@motion\pgf@animation@check@translate
+
+\def\pgf@animation@check@translate@#1#2{%
+ \pgfsys@attach@to@id\pgf@anim@whom@id\pgf@anim@whom@type{%
+ \pgf@size@hookedtrue%
+ {%
+ % Compute bounding box in local coordinate system
+ #2%
+ \pgf@pt@x0pt%
+ \pgf@pt@y0pt%
+ \pgf@picmaxx=-16000pt\relax%
+ \pgf@picminx=16000pt\relax%
+ \pgf@picmaxy=-16000pt\relax%
+ \pgf@picminy=16000pt\relax%
+ #1%
+ \edef\pgf@temp{{\the\pgf@picminx}{\the\pgf@picminy}{\the\pgf@picmaxx}{\the\pgf@picmaxy}}%
+ \expandafter%
+ }\expandafter%
+ \def\expandafter\pgf@temp\expandafter{\pgf@temp}%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@path@size@hook\expandafter\expandafter\expandafter{%
+ \expandafter\pgf@path@size@hook\expandafter\pgf@anim@bb\pgf@temp}%
+ }{}%
+}
+\def\pgf@anim@handle@point#1#2{%
+ \pgf@x#1\pgf@y#2%
+ \pgf@pos@transform\pgf@x\pgf@y%
+ \ifdim\pgf@x<\pgf@picminx\pgf@picminx\pgf@x\fi%
+ \ifdim\pgf@x>\pgf@picmaxx\pgf@picmaxx\pgf@x\fi%
+ \ifdim\pgf@y<\pgf@picminy\pgf@picminy\pgf@y\fi%
+ \ifdim\pgf@y>\pgf@picmaxy\pgf@picmaxy\pgf@y\fi%
+}
+
+\newdimen\pgf@anim@dim
+
+\def\pgf@anim@bb#1#2#3#4{% (#1,#2) lower left, (#3, #4) upper right
+ \pgf@anim@dim\pgf@size@hook@x%
+ \advance\pgf@anim@dim by#1\relax%
+ \ifdim\pgf@anim@dim<\pgf@picminx\global\pgf@picminx\pgf@anim@dim\fi%
+ \pgf@anim@dim\pgf@size@hook@x%
+ \advance\pgf@anim@dim by#3\relax%
+ \ifdim\pgf@anim@dim>\pgf@picmaxx\global\pgf@picmaxx\pgf@anim@dim\fi%
+ \pgf@anim@dim\pgf@size@hook@y%
+ \advance\pgf@anim@dim by#2\relax%
+ \ifdim\pgf@anim@dim<\pgf@picminy\global\pgf@picminy\pgf@anim@dim\fi%
+ \pgf@anim@dim\pgf@size@hook@y%
+ \advance\pgf@anim@dim by#4\relax%
+ \ifdim\pgf@anim@dim>\pgf@picmaxy\global\pgf@picmaxy\pgf@anim@dim\fi%
+}
+
+\def\pgf@anim@save@transform#1{%
+ \def\pgf@anim@saved@transform{#1}%
+}
+\let\pgf@anim@saved@transform\pgfutil@empty%
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulebending.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulebending.code.tex
index f0a28bfff68..cc9ed651c71 100644
--- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulebending.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulebending.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/modules/pgfmodulebending.code.tex,v 1.18 2013/09/30 18:30:15 tantau Exp $
+\ProvidesFileRCS{pgfmodulebending.code.tex}
%
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledatavisualization.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledatavisualization.code.tex
index f991fdedaef..a1122b91370 100644
--- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledatavisualization.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledatavisualization.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/pgfmoduledatavisualization.code.tex,v 1.50 2015/05/18 17:01:16 tantau Exp $
+\ProvidesFileRCS{pgfmoduledatavisualization.code.tex}
\usepgfmodule{oo,shapes}
\usepgflibrary{fpu}
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 c2bf2582a29..500e0c7bad1 100644
--- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledecorations.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduledecorations.code.tex
@@ -797,7 +797,7 @@
\pgf@decorate@movealonginputsegment{\the\pgfdecoratedremainingdistance}%
\pgf@decorate@transformtoinputsegment%
\pgfpointorigin%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
+ \pgf@pos@transform@glob%
\global\pgf@x\pgf@x%
\global\pgf@y\pgf@y%
}%
@@ -835,7 +835,7 @@
{%
\pgftransforminvert%
\pgfpoint@decorated@pathfirst%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
+ \pgf@pos@transform@glob%
\global\pgf@x\pgf@x%
\global\pgf@y\pgf@y%
}%
@@ -847,7 +847,7 @@
{%
\pgftransforminvert%
\pgfpoint@decorated@pathlast%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
+ \pgf@pos@transform@glob%
\global\pgf@x\pgf@x%
\global\pgf@y\pgf@y%
}%
@@ -861,7 +861,7 @@
{%
\pgftransforminvert%
\pgf@decorate@inputsegment@first%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
+ \pgf@pos@transform@glob%
\global\pgf@x\pgf@x%
\global\pgf@y\pgf@y%
}%
@@ -875,7 +875,7 @@
{%
\pgftransforminvert%
\pgf@decorate@inputsegment@last%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
+ \pgf@pos@transform@glob%
\global\pgf@x\pgf@x%
\global\pgf@y\pgf@y%
}%
@@ -2188,4 +2188,4 @@
-\endinput \ No newline at end of file
+\endinput
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 a9344f6c95c..f3158456ebe 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.8 2013/09/17 17:34:00 tantau Exp $
+\ProvidesFileRCS{pgfmodulematrix.code.tex}
\usepgfmodule{shapes}
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulenonlineartransformations.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulenonlineartransformations.code.tex
index 913f2edff9d..7ce4784110f 100644
--- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulenonlineartransformations.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulenonlineartransformations.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/modules/pgfmodulenonlineartransformations.code.tex,v 1.4 2013/10/09 18:30:27 tantau Exp $
+\ProvidesFileRCS{pgfmodulenonlineartransformations.code.tex}
%
@@ -45,7 +45,7 @@
\def\pgfpointtransformednonlinear#1{%
\pgf@process{%
#1%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
+ \pgf@pos@transform@glob%
\pgf@nlt@list%
}
}
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleoo.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleoo.code.tex
index eba114885ea..1cd938af521 100644
--- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleoo.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleoo.code.tex
@@ -298,7 +298,7 @@
% }
% define the method macro and append the method to the method collection
-\def\pgfoo@declaremethod#1(#2)#3{%
+\long\def\pgfoo@declaremethod#1(#2)#3{%
\def\pgfoo@method{#1}%
\ifx\pgfoo@classname\pgfoo@method
\def\pgfoo@method{init}%
@@ -595,15 +595,19 @@
}%
}%
}
-\def\pgfoo@new#1=new #2({%
- \expandafter\ifx\csname pgfooY#2.get id\endcsname\relax%
- \pgferror{Unknown class '#2'}%
+\def\pgfoo@new#1={%
+ \def\pgfutil@reserved@a{#1}%
+ \let\pgfutil@next\pgfoo@@new
+ \futurelet\pgfutil@let@token\pgfutil@ignorespaces}
+\def\pgfoo@@new new #1({%
+ \expandafter\ifx\csname pgfooY#1.get id\endcsname\relax%
+ \pgferror{Unknown class '#1'}%
\else%
- \pgfoo@new@create#1{#2}%
+ \expandafter\pgfoo@new@create\pgfutil@reserved@a{#1}%
{%
\pgfoothis@count\pgfoo@objectcount%
\let\pgfoo@attribute@op\pgfoolet
- \csname pgfooY#2.@pgfoo@process@attributes\endcsname%
+ \csname pgfooY#1.@pgfoo@process@attributes\endcsname%
}%
\let\pgfoo@continue=\pgf@oo@new@cont%
\expandafter\pgfoo@collect@args%
@@ -615,27 +619,26 @@
\aftergroup\pgfoogc% cleanup after group
}
-\def\pgfoo@new@attribute#1=new #2({%
- \expandafter\ifx\csname pgfooY#2.get id\endcsname\relax%
- \pgferror{Unknown class '#2'}%
+\def\pgfoo@new@attribute#1={%
+ \def\pgfutil@reserved@a{#1}%
+ \let\pgfutil@next\pgfoo@@new@attribute
+ \futurelet\pgfutil@let@token\pgfutil@ignorespaces}
+\def\pgfoo@@new@attribute new #1({%
+ \expandafter\ifx\csname pgfooY#1.get id\endcsname\relax%
+ \pgferror{Unknown class '#1'}%
\else%
- \pgfoo@new@create\pgfoo@temp{#2}%
+ \pgfoo@new@create\pgfoo@temp{#1}%
{%
\pgfoothis@count\pgfoo@objectcount%
\let\pgfoo@attribute@op\pgfoolet%
- \csname pgfooY#2.@pgfoo@process@attributes\endcsname%
+ \csname pgfooY#1.@pgfoo@process@attributes\endcsname%
}%
- \pgfoolet{#1}\pgfoo@temp%
+ \expandafter\pgfoolet\expandafter{\pgfutil@reserved@a}\pgfoo@temp%
\let\pgfoo@continue=\pgf@oo@new@cont%
\expandafter\pgfoo@collect@args%
\fi%
}
-\def\pgf@oo@new@cont{%
- \expandafter\pgfoolastobj\expandafter.\expandafter i\expandafter n\expandafter i\expandafter t\expandafter(\the\pgfoo@toks)%
- \aftergroup\pgfoogc% cleanup after group
-}
-
\def\pgfoo@new@create#1#2{%
\advance\pgfoo@objectcount by 1\relax%
\edef\pgfoolastobj{\noexpand\pgfoo@caller{\the\pgfoo@objectcount}}%
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleparser.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleparser.code.tex
index 0a08a5e9d4e..5c248ad9f56 100644
--- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleparser.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmoduleparser.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/modules/pgfmoduleparser.code.tex,v 1.2 2013/07/15 12:05:34 tantau Exp $
+\ProvidesFileRCS{pgfmoduleparser.code.tex}
%
% This file defines commands for defining a letter-by-letter parser
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 696608e31e8..6c548160b26 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.13 2015/08/03 07:57:07 cfeuersaenger Exp $
+\ProvidesFileRCS{pgfmoduleplot.code.tex}
% PGF's plotting interface works as follows:
@@ -503,7 +503,7 @@
\immediate\pgfutil@write\pgf@plotwrite{\pgf@gnuplot@head}%
\immediate\pgfutil@write\pgf@plotwrite{#2}%
\immediate\closeout\pgf@plotwrite%
- \immediate\pgfutil@write18{%
+ \pgfutil@shellescape{%
\pgfkeysvalueof{/pgf/plot/gnuplot call} \pgf@plotgnuplotfile}%
\fi%
% \let\pgf@savedparsexyline=\pgf@parsexyline%
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 6a4d0932393..71a3876da32 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.35 2014/03/21 19:52:38 tantau Exp $
+\ProvidesFileRCS{pgfmoduleshapes.code.tex}
@@ -41,6 +41,9 @@
{\pgferror{Unknown shape ``#1''}}%
{%
{%
+ \ifpgflatenodepositioning%
+ \pgfsys@beginscope%
+ \fi%
\pgf@outer@adjust@hook%
\let\pgf@sh@savedmacros=\pgfutil@empty% MW
\let\pgf@sh@savedpoints=\pgfutil@empty%
@@ -58,7 +61,7 @@
}%
% Save the saved points and the transformation matrix
\edef\pgf@node@name{#3}%
- \ifpgflatenodepositioning
+ \ifpgflatenodepositioning%
\pgf@shapes@late@pos@begin%
\fi%
\ifx\pgf@node@name\pgfutil@empty%
@@ -73,36 +76,39 @@
\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}}%
+ {{\pgfusetype{.behind background}\pgfidscope\pgfscope\csname pgf@sh@bbg@#1\endcsname\endpgfscope\endpgfidscope}}%
\pgfutil@ifundefined{pgf@sh@bg@#1}{%
\global\let\pgfpositionnodelaterpath\pgfutil@empty%
}%
- {\csname pgf@sh@bg@#1\endcsname%
+ {\pgfpushtype%
+ \pgfusetype{.background}\csname pgf@sh@bg@#1\endcsname%
\ifpgflatenodepositioning%
\pgfsyssoftpath@getcurrentpath\pgfpositionnodelaterpath%
\pgfprocessround{\pgfpositionnodelaterpath}{\pgfpositionnodelaterpath}%
\global\let\pgfpositionnodelaterpath\pgfpositionnodelaterpath%
\fi%
- #4}%
+ #4\pgfpoptype}%
\pgfutil@ifundefined{pgf@sh@fbg@#1}{}
- {{\pgfscope\csname pgf@sh@fbg@#1\endcsname\endpgfscope}}%
+ {{\pgfusetype{.before background}\pgfidscope\pgfscope\csname pgf@sh@fbg@#1\endcsname\endpgfscope\endpgfidscope}}%
{%
\expandafter\pgfutil@for\expandafter\pgf@shape@com\expandafter:\expandafter=\csname pgf@sh@boxes@#1\endcsname\do{%
{%
+ \pgfusetype{.\pgf@shape@com}%
\pgftransformshift{\pgf@sh@reanchor{#1}{\pgf@shape@com}}%
- \pgfapproximatenonlineartransformation%
+ \pgfapproximatenonlineartransformation%
\expandafter\pgfqboxsynced\expandafter{\csname pgfnodepart\pgf@shape@com box\endcsname}%
}%
}%
}%
\pgfutil@ifundefined{pgf@sh@bfg@#1}{}%
- {{\pgfscope\csname pgf@sh@bfg@#1\endcsname\endpgfscope}}%
+ {{\pgfusetype{.behind foreground}\pgfidscope\pgfscope\csname pgf@sh@bfg@#1\endcsname\endpgfscope\endpgfidscope}}%
\pgfutil@ifundefined{pgf@sh@fg@#1}{}%
- {\csname pgf@sh@fg@#1\endcsname#4}%
+ {\pgfpushtype\pgfusetype{.foreground}\csname pgf@sh@fg@#1\endcsname#4\pgfpoptype}%
\pgfutil@ifundefined{pgf@sh@ffg@#1}{}%
- {{\pgfscope\csname pgf@sh@ffg@#1\endcsname\endpgfscope}}%
+ {{\pgfusetype{.before foreground}\pgfidscope\pgfscope\csname pgf@sh@ffg@#1\endcsname\endpgfscope\endpgfidscope}}%
\ifpgflatenodepositioning%
\pgf@shapes@late@pos@end%
+ \pgfsys@endscope%
\else%
\expandafter\pgf@nodecallback\expandafter{\pgf@node@name}%
\fi%
@@ -120,9 +126,11 @@
\pgf@relevantforpicturesizetrue%
\setbox\pgfpositionnodelaterbox=\hbox%
\bgroup%
+ \pgfsys@beginscope%
}
\def\pgf@shapes@late@pos@end{%
+ \pgfsys@endscope%
\egroup% Close box
\ifdim\pgf@picminx>\pgf@picmaxx\relax% happens for empty nodes
\def\pgfpositionnodelaterminx{0.0pt}%
@@ -539,15 +547,13 @@
\pgf@sh@reanchor{\csname pgf@sh@ns@#1\endcsname}{#2}%
{%
\pgfsettransform{\csname pgf@sh@nt@#1\endcsname}%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
- \global\pgf@x=\pgf@x%
- \global\pgf@y=\pgf@y%
+ \pgf@pos@transform@glob%
}%
% Add inter picture transformation
\pgf@shape@interpictureshift{#1}%
% Undo current transformation
\pgftransforminvert%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
+ \pgf@pos@transform@glob%
}%
}%
}
@@ -605,7 +611,7 @@
\pgf@process{\pgfpointtransformed{#2}}%
\pgfsettransform{\csname pgf@sh@nt@#1\endcsname}%
\pgftransforminvert%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
+ \pgf@pos@transform@glob%
\pgf@xa=\pgf@x%
\pgf@ya=\pgf@y%
\pgf@process{\csname pgf@anchor@\csname pgf@sh@ns@#1\endcsname @center\endcsname}%
@@ -614,7 +620,7 @@
\advance\pgf@ya by-\pgf@y%
\csname pgf@anchor@\csname pgf@sh@ns@#1\endcsname @border\endcsname{\pgfqpoint{\pgf@xa}{\pgf@ya}}%
\pgfsettransform{\csname pgf@sh@nt@#1\endcsname}%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
+ \pgf@pos@transform@glob%
\global\pgf@x=\pgf@x%
\global\pgf@y=\pgf@y%
}%
@@ -622,7 +628,7 @@
\pgf@shape@interpictureshift{#1}%
% Undo current transformation
\pgftransforminvert%
- \pgf@pos@transform{\pgf@x}{\pgf@y}%
+ \pgf@pos@transform@glob%
}%
}%
}
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulesnakes.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulesnakes.code.tex
index 5f6479a1d7b..f87a884b417 100644
--- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulesnakes.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulesnakes.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/pgfmodulesnakes.code.tex,v 1.3 2013/07/15 12:05:34 tantau Exp $
+\ProvidesFileRCS{pgfmodulesnakes.code.tex}
\pgfwarning{Snakes have been superseded by decorations. Use the module decorations instead of snakes}
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulesorting.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulesorting.code.tex
index b85fde14501..497ea8591e8 100644
--- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulesorting.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulesorting.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/modules/pgfmodulesorting.code.tex,v 1.1 2008/11/12 23:39:37 tantau Exp $
+\ProvidesFileRCS{pgfmodulesorting.code.tex}
%
% This file defines commands for sorting data. This is useful for 3d plots,
diff --git a/Master/texmf-dist/tex/generic/pgf/pgf.revision.tex b/Master/texmf-dist/tex/generic/pgf/pgf.revision.tex
new file mode 100644
index 00000000000..4651ba8b9c6
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/pgf.revision.tex
@@ -0,0 +1,15 @@
+\begingroup
+\catcode`\-=12
+\catcode`\/=12
+\catcode`\.=12
+\catcode`\:=12
+\catcode`\+=12
+\catcode`\-=12
+\gdef\pgfrevision{3.1}
+\gdef\pgfversion{3.1}
+\gdef\pgfversiondatetime{2019-01-05 11:28:22 +0100}
+\gdef\pgfrevisiondatetime{2019-01-05 11:28:22 +0100}
+\gdef\pgf@glob@TMPa#1-#2-#3 #4\relax{#1/#2/#3}
+\xdef\pgfversiondate{\expandafter\pgf@glob@TMPa\pgfversiondatetime\relax}
+\xdef\pgfrevisiondate{\expandafter\pgf@glob@TMPa\pgfrevisiondatetime\relax}
+\endgroup
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg
index 38b32e39b57..01ae33272e7 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgf.cfg,v 1.7 2008/05/14 22:01:48 tantau Exp $
+\ProvidesFileRCS{pgf.cfg}
% Copy this file to somewhere local and uncomment one of the following
% if you do not trust/use/like the automatic driver selection
@@ -18,6 +18,7 @@
% \def\pgfsysdriver{pgfsys-dvipdfmx.def}
% \def\pgfsysdriver{pgfsys-dvips.def}
% \def\pgfsysdriver{pgfsys-pdftex.def}
+% \def\pgfsysdriver{pgfsys-luatex.def}
% \def\pgfsysdriver{pgfsys-tex4ht.def}
% \def\pgfsysdriver{pgfsys-textures.def}
% \def\pgfsysdriver{pgfsys-vtex.def}
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 1605a956260..1ba7515684b 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,7 +7,7 @@
%
% 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.8 2013/07/12 13:52:50 tantau Exp $
+\ProvidesFileRCS{pgfsys-common-pdf-via-dvi.def}
% Common driver commands for all drivers that produce pdf via the
% detour of a dvi file
@@ -16,57 +16,6 @@
% Hboxes
-\def\pgfsys@hbox#1{%
- \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
- \pgfsys@invoke{0 Tr}%
- \pgfsys@invoke{0 J [] 0 d}% reset line cap and dash
- \wd#1=0pt%
- \ht#1=0pt%
- \dp#1=0pt%
- \box#1
- \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
- \pgfsys@invoke{0 J [] 0 d}% reset line cap and dash
- \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{%
- \pgfsys@invoke{3 Tr}%
- \hbox to 0pt{\pgfutil@font@normalfont\pgfutil@selectfont.\hss}% enforce font change
- \pgfsys@invoke{0 Tr}%
- \special{pdf: content q}}
-\def\pgfsys@endpicture{%
- \pgfsys@invoke{n Q}%
-}
\def\pgfsys@beginpurepicture{\special{pdf: content q}}
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 32906ad3b64..ccac27335a3 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,7 +7,7 @@
%
% 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.13 2013/10/10 12:00:15 tantau Exp $
+\ProvidesFileRCS{pgfsys-common-pdf.def}
% Common driver commands for all drivers that produce pdf
@@ -60,6 +60,10 @@
\def\pgfsys@color@gray@stroke#1{\pgfsysprotocol@literal{#1 G}}
\def\pgfsys@color@gray@fill#1{\pgfsysprotocol@literal{#1 g}}
+% Visibility
+\def\pgfsys@begininvisiblescope{\pgfsys@beginscope{\pgfsys@discardpath\pgfsys@clipnext\pgfsys@moveto{0pt}{0pt}\pgfsys@discardpath}}
+\def\pgfsys@endinvisiblescope{\pgfsys@endscope}
+
% Opacity
\def\pgfsys@stroke@opacity#1{%
\expandafter\ifx\csname pgf@sys@pdf@so@#1\endcsname\relax%
@@ -75,6 +79,8 @@
\fi%
\pgfsysprotocol@literal{\csname pgf@sys@pdf@fo@#1\endcsname\space gs}%
}
+
+% Blending
\def\pgfsys@blend@mode#1{%
\expandafter\ifx\csname pgf@sys@pdf@bm@#1\endcsname\relax%
\expandafter\let\expandafter\pgf@temp\csname pgf@sys@pdf@blend@mode@map@#1\endcsname%
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 52e0ef9b224..0f8ce5d0157 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.22 2008/10/01 14:19:33 tantau Exp $
+\ProvidesFileRCS{pgfsys-common-postscript.def}
% Driver commands for postscript
@@ -100,6 +100,11 @@
\def\pgfsys@beginscope{\pgfsysprotocol@literal{save}}
\def\pgfsys@endscope{\pgfsysprotocol@literal{restore}}
+\newif\ifpgfsys@ps@boxmode
+\def\pgfsys@begin@text{\pgfsys@ps@boxmodetrue}
+\def\pgfsys@end@text{}
+
+
% Graphics state
\def\pgfsys@setdash#1#2{%
\pgfsysprotocol@literalbuffered{[}%
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 f2edbedf3c9..4986feaa46e 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,13 +7,16 @@
%
% 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.24 2013/08/28 11:00:54 tantau Exp $
+\ProvidesFileRCS{pgfsys-common-svg.def}
% Driver commands for svg
+
% Helping functions:
+\def\pgf@sys@svg@make@defs#1{\pgf@sys@fail{svg defs}}
+\def\pgf@sys@svg@ref@defs#1{\pgf@sys@fail{svg defs}}
\let\pgf@sys@svgpath=\pgfutil@empty
\def\pgf@sys@svgnum#1{%
{%
@@ -26,7 +29,10 @@
\def\pgf@sys@addtosvgpath#1{\pgfutil@g@addto@macro\pgf@sys@svgpath{#1\space}}
\def\pgf@sys@flushsvgpath{\pgfsysprotocol@literal{\pgf@sys@svgpath}\global\let\pgf@sys@svgpath=\pgfutil@empty}
\def\pgf@sys@svg@gs#1{%
- {\pgfsysprotocol@literal{<g #1>\pgfsys@svg@newline }}\global\advance\pgf@sys@svg@scopecount by1\relax%
+ {%
+ \pgfsysprotocol@literal{<g #1>\pgfsys@svg@newline}%
+ }%
+ \global\advance\pgf@sys@svg@scopecount by1\relax%
}
\newcount\pgf@sys@svg@objectcount
@@ -38,61 +44,92 @@
}
% Path construction:
-\def\pgfsys@lineto#1#2{\pgf@sys@addtosvgpath{L }\pgf@sys@svgnum{#1}\pgf@sys@svgnum{#2}}
-\def\pgfsys@moveto#1#2{\pgf@sys@addtosvgpath{M }\pgf@sys@svgnum{#1}\pgf@sys@svgnum{#2}}
+\def\pgfsys@lineto#1#2{\pgf@sys@addtosvgpath{L}\pgf@sys@svgnum{#1}\pgf@sys@svgnum{#2}}
+\def\pgfsys@moveto#1#2{\pgf@sys@addtosvgpath{M}\pgf@sys@svgnum{#1}\pgf@sys@svgnum{#2}}
\def\pgfsys@curveto#1#2#3#4#5#6{%
- \pgf@sys@addtosvgpath{C }%
+ \pgf@sys@addtosvgpath{C}%
\pgf@sys@svgnum{#1}\pgf@sys@svgnum{#2}%
\pgf@sys@svgnum{#3}\pgf@sys@svgnum{#4}%
\pgf@sys@svgnum{#5}\pgf@sys@svgnum{#6}}
\def\pgfsys@rect#1#2#3#4{%
\pgfsys@moveto{#1}{#2}%
- \pgf@sys@addtosvgpath{h }\pgf@sys@svgnum{#3}%
- \pgf@sys@addtosvgpath{v }\pgf@sys@svgnum{#4}%
- \pgf@sys@addtosvgpath{h }{\pgf@x=#3\pgf@x=-\pgf@x\pgf@sys@svgnum{\pgf@x}}%
+ \pgf@sys@addtosvgpath{h}\pgf@sys@svgnum{#3}%
+ \pgf@sys@addtosvgpath{v}\pgf@sys@svgnum{#4}%
+ \pgf@sys@addtosvgpath{h}{\pgf@x=#3\pgf@x=-\pgf@x\pgf@sys@svgnum{\pgf@x}}%
\pgfsys@closepath}
\def\pgfsys@closepath{\pgf@sys@addtosvgpath{Z}}
% Path usage:
\newif\ifpgf@sys@svg@clipnext
\def\pgf@sys@svg@possiblyclippedpath#1{%
+ \edef\pgf@sys@cacheref{\pgfsys@id@refcurrent}%
+ \pgfsys@if@fresh@currentid{\csname pgf@sys@svg@path@\pgf@sys@cacheref\endcsname}{}%
+ \let\pgfsys@anim@ba@d\pgfutil@empty
+ \csname pgfsys@anim@ba@\pgf@sys@cacheref\endcsname%
\ifpgf@sys@svg@clipnext%
\global\advance\pgf@sys@svg@objectcount by1\relax%
- \pgfsysprotocol@literal{<clipPath id="pgfcp\the\pgf@sys@svg@objectcount">
- <path id="pgfpath\the\pgf@sys@svg@objectcount" d="}%
- \pgf@sys@flushsvgpath%
- \pgfsysprotocol@literal{"/>\pgfsys@svg@newline </clipPath>\pgfsys@svg@newline }
- \pgfsysprotocol@literal{<use xlink:href="\#pgfpath\the\pgf@sys@svg@objectcount" #1/>\pgfsys@svg@newline }%
- \pgf@sys@svg@gs{clip-path="url(\#pgfcp\the\pgf@sys@svg@objectcount)"}
+ \pgfsysprotocol@literal{%
+ <clipPath id="\pgfsys@if@fresh@currentid{\pgf@sys@cacheref}{pgfcp\the\pgf@sys@svg@objectcount}clip">
+ <path id="\pgfsys@if@fresh@currentid{\pgf@sys@cacheref}{pgfcp\the\pgf@sys@svg@objectcount}" d="}%
+ \ifx\pgfsys@anim@ba@d\pgfutil@empty\pgf@sys@flushsvgpath\else\pgfsysprotocol@literal{\pgfsys@anim@ba@d}\fi%
+ \pgfsysprotocol@literal{"/> </clipPath>\pgfsys@svg@newline }
+ \pgfsysprotocol@literal{<use xlink:href="\#\pgfsys@if@fresh@currentid{\pgf@sys@cacheref}{pgfcp\the\pgf@sys@svg@objectcount}" %
+ \ifx\pgfsys@anim@ba@d\pgfutil@empty\else%
+ \ifx\pgfsys@anim@ba@markerstart\pgfutil@empty\else%
+ marker-start="url(\#\pgfsys@anim@ba@markerstart)" %
+ \fi%
+ \ifx\pgfsys@anim@ba@markerend\pgfutil@empty\else%
+ marker-end="url(\#\pgfsys@anim@ba@markerend)" %
+ \fi%
+ \fi%
+ #1/>\pgfsys@svg@newline }%
+ \pgf@sys@svg@gs{clip-path="url(\#\pgfsys@if@fresh@currentid{\pgfsys@id@refcurrent}{pgfcp\the\pgf@sys@svg@objectcount}clip)"}
\pgf@sys@svg@clipnextfalse%
\else%
- \pgfsysprotocol@literal{<path d="}%
- \pgf@sys@flushsvgpath%
- \pgfsysprotocol@literal{" #1/>\pgfsys@svg@newline }
+ \pgfsysprotocol@literal{<path\pgfsys@if@fresh@currentid{ id="\pgfsys@id@refcurrent"}{} d="}%
+ \ifx\pgfsys@anim@ba@d\pgfutil@empty\pgf@sys@flushsvgpath\else\pgfsysprotocol@literal{\pgfsys@anim@ba@d}\fi%
+ \pgfsysprotocol@literal{" %
+ \ifx\pgfsys@anim@ba@d\pgfutil@empty\else%
+ \ifx\pgfsys@anim@ba@markerstart\pgfutil@empty\else%
+ marker-start="url(\#\pgfsys@anim@ba@markerstart)" %
+ \fi%
+ \ifx\pgfsys@anim@ba@markerend\pgfutil@empty\else%
+ marker-end="url(\#\pgfsys@anim@ba@markerend)" %
+ \fi%
+ \fi%
+ #1/>\pgfsys@svg@newline }%
\fi%
+ \pgfsys@invalidate@currentid%
}
-\def\pgfsys@stroke{\pgf@sys@svg@possiblyclippedpath{style="fill:none"}}
-\def\pgfsys@fill{\pgf@sys@svg@possiblyclippedpath{style="stroke:none"}}
+\def\pgfsys@stroke{\pgf@sys@svg@possiblyclippedpath{fill="none"}}
+\def\pgfsys@fill{\pgf@sys@svg@possiblyclippedpath{stroke="none"}}
\def\pgfsys@fillstroke{\pgf@sys@svg@possiblyclippedpath{}}
\def\pgfsys@clipnext{\pgf@sys@svg@clipnexttrue}
\def\pgfsys@discardpath{%
\ifpgf@sys@svg@clipnext%
+ \edef\pgf@sys@cacheref{\pgfsys@id@refcurrent}%
+ \let\pgfsys@anim@ba@d\pgfutil@empty
+ \csname pgfsys@anim@ba@\pgf@sys@cacheref\endcsname%
\global\advance\pgf@sys@svg@objectcount by1\relax%
- \pgfsysprotocol@literal{<clipPath id="pgfcp\the\pgf@sys@svg@objectcount">
- <path d="}%
- \pgf@sys@flushsvgpath%
- \pgfsysprotocol@literal{"/>\pgfsys@svg@newline </clipPath>\pgfsys@svg@newline }
+ \pgfsysprotocol@literal{%
+ <clipPath id="pgfcp\the\pgf@sys@svg@objectcount">%
+ <path\pgfsys@if@fresh@currentid{ id="\pgfsys@id@refcurrent"}{} d="}%
+ \ifx\pgfsys@anim@ba@d\pgfutil@empty\pgf@sys@flushsvgpath\else\pgfsysprotocol@literal{\pgfsys@anim@ba@d}\fi%
+ \pgfsysprotocol@literal{"/> </clipPath>\pgfsys@svg@newline }
\pgf@sys@svg@gs{clip-path="url(\#pgfcp\the\pgf@sys@svg@objectcount)"}
\pgf@sys@svg@clipnextfalse%
\else%
\global\let\pgf@sys@svgpath=\pgfutil@empty
- \fi}
+ \fi%
+ \pgfsys@invalidate@currentid%
+}
% Fill rules:
\def\pgfsys@eoruletrue{\pgf@sys@svg@gs{fill-rule="evenodd"}}
\def\pgfsys@eorulefalse{\pgf@sys@svg@gs{fill-rule="nonzero"}}
% Transparency:
+\def\pgfsys@opacity#1{\pgf@sys@svg@gs{opacity="#1"}}
\def\pgfsys@stroke@opacity#1{\pgf@sys@svg@gs{stroke-opacity="#1"}}
\def\pgfsys@fill@opacity#1{\pgf@sys@svg@gs{fill-opacity="#1"}\def\pgf@sys@svg@opacity{#1}}
\def\pgf@sys@svg@opacity{1}
@@ -107,35 +144,174 @@
% Transformation:
\def\pgfsys@transformcm#1#2#3#4#5#6{%
{\pgf@x=#5\pgf@y=#6%
- \pgf@sys@svg@gs{transform="matrix(#1,#2,#3,#4,\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}}}
+ \edef\pgf@temp{#1,#2,#3,#4}%
+ \ifx\pgf@temp\pgf@sys@svg@idtrans@text%
+ \ifdim\pgf@x=0pt\relax%
+ \ifdim\pgf@y=0pt%
+ \else%
+ \pgf@sys@svg@gs{transform="translate(\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}%
+ \fi%
+ \else%
+ \pgf@sys@svg@gs{transform="translate(\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}%
+ \fi%
+ \else%
+ \pgf@sys@svg@gs{transform="matrix(#1,#2,#3,#4,\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}%
+ \fi}}
+\def\pgfsys@transformshift#1#2{%
+ {\pgf@x=#1\pgf@y=#2%
+ \ifdim\pgf@x=0pt\relax%
+ \ifdim\pgf@y=0pt%
+ \else%
+ \pgf@sys@svg@gs{transform="translate(\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}%
+ \fi%
+ \else%
+ \pgf@sys@svg@gs{transform="translate(\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}%
+ \fi}}
+\def\pgfsys@transformxyscale#1#2{%
+ {\pgf@x=#1pt\pgf@y=#2pt%
+ \pgf@sys@svg@gs{transform="scale(\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}}}
+\def\pgfsys@viewboxmeet{\pgf@sys@svg@viewbox{meet}}
+\def\pgfsys@viewboxslice{\pgf@sys@svg@viewbox{slice}}
+\def\pgf@sys@svg@viewbox#1#2#3#4#5#6#7#8#9{%
+ {%
+ \edef\pgf@sys@cacheref{\pgfsys@id@refcurrent}%
+ \csname pgfsys@anim@ba@\pgf@sys@cacheref\endcsname%
+ \pgf@x#2%
+ \pgf@y#3%
+ \pgf@xa#4%
+ \pgf@ya#5%
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ \pgf@xb#6%
+ \pgf@yb#7%
+ \pgf@xc#8%
+ \pgf@yc#9%
+ \advance\pgf@xc by-\pgf@xb%
+ \advance\pgf@yc by-\pgf@yb%
+ \pgfsysprotocol@literal{<svg
+ overflow="visible"
+ preserveAspectRatio="xMidYMid #1"
+ \pgfsys@if@fresh@currentid{ id="\pgf@sys@cacheref"}{}
+ x="\pgf@sys@tonumber{\pgf@x}"
+ y="\pgf@sys@tonumber{\pgf@y}"
+ width="\pgf@sys@tonumber{\pgf@xa}"
+ height="\pgf@sys@tonumber{\pgf@ya}"
+ viewBox="%
+ \ifx\pgfsys@anim@ba@viewBox\pgfutil@empty%
+ \pgf@sys@tonumber{\pgf@xb} \pgf@sys@tonumber{\pgf@yb} \pgf@sys@tonumber{\pgf@xc} \pgf@sys@tonumber{\pgf@yc}%
+ \else%
+ \pgfsys@anim@ba@viewBox%
+ \fi%
+ ">}%
+ \pgfsys@invalidate@currentid%
+ }%
+}
+\def\pgfsys@endviewbox{\pgfsysprotocol@literal{</svg>}}
+
% Scopes
\newcount\pgf@sys@svg@scopecount
+
+\newif\ifpgfsys@svg@boxmode
+\def\pgfsys@begin@text{\pgfsys@beginscope\pgfsys@svg@boxmodetrue}
+\def\pgfsys@end@text{\pgfsys@endscope}
+
\def\pgfsys@beginscope{%
\edef\pgf@sys@svg@thescopecount{\the\pgf@sys@svg@scopecount}%
\begingroup%
+ \pgf@sys@svg@scopecount=0\relax%
+}
+\def\pgfsys@beginscope@#1{%
+ \edef\pgf@sys@svg@thescopecount{\the\pgf@sys@svg@scopecount}%
+ \begingroup%
\pgf@sys@svg@scopecount=1\relax%
- \pgfsysprotocol@literal{<g>\pgfsys@svg@newline }%
- }
+ \pgfsysprotocol@literal{<g#1>\pgfsys@svg@newline }%
+}
\def\pgfsys@endscope{%
\loop%
+ \ifnum\pgf@sys@svg@scopecount>0\relax%
\pgfsysprotocol@literal{</g>\pgfsys@svg@newline }%
\advance\pgf@sys@svg@scopecount by-1\relax%
- \ifnum\pgf@sys@svg@scopecount>0\relax%
\repeat%
\endgroup%
\global\pgf@sys@svg@scopecount=\pgf@sys@svg@thescopecount\relax%
}
+\newif\ifpgfsys@svg@close@strokenone
+\def\pgfsys@begin@idscope{%
+ \begingroup%
+ \pgfsys@if@fresh@currentid{%
+ \edef\pgf@sys@cacheref{\pgfsys@id@refcurrent}%
+ \let\pgf@sys@svg@ba@gs\pgfutil@empty%
+ \csname pgfsys@anim@ba@\pgf@sys@cacheref\endcsname%
+ \pgfsys@beginscope@{ id="\pgf@sys@cacheref" \pgf@sys@svg@ba@gs\pgfsys@svg@rdf}%
+ \expandafter\let\expandafter\pgf@sys@svg@end@id@scope@code\csname pgf@sys@att@end@\pgfsys@id@refcurrent\endcsname%
+ \let\pgf@sys@svg@end@id@scope\pgfsys@endscope%
+ \csname pgf@sys@att@beg@\pgfsys@id@refcurrent\endcsname%
+ }{%
+ \ifx\pgfsys@svg@rdf\pgfutil@empty%
+ \let\pgf@sys@svg@end@id@scope@code\relax%
+ \let\pgf@sys@svg@end@id@scope\relax%
+ \else%
+ \pgfsys@beginscope@{\pgfsys@svg@rdf}%
+ \let\pgf@sys@svg@end@id@scope@code\relax%
+ \let\pgf@sys@svg@end@id@scope\pgfsys@endscope%
+ \fi%
+ }%
+ \expandafter\global\expandafter\let\csname pgf@sys@att@beg@\pgfsys@id@refcurrent\endcsname\relax%
+ \expandafter\global\expandafter\let\csname pgf@sys@att@end@\pgfsys@id@refcurrent\endcsname\relax%
+ \ifpgfsys@svg@boxmode\pgfsysprotocol@literal{<g stroke="none">}\pgfsys@svg@close@strokenonetrue\fi%
+ \pgfsys@invalidate@currentid%
+ \begingroup%
+ \global\let\pgfsys@svg@rdf\pgfutil@empty%
+}
+\def\pgfsys@end@idscope{%
+ \endgroup%
+ \ifpgfsys@svg@close@strokenone\pgfsysprotocol@literal{</g>}\fi%
+ \pgf@sys@svg@end@id@scope@code%
+ \pgf@sys@svg@end@id@scope%
+ \endgroup%
+}
+\let\pgfsys@svg@rdf\pgfutil@empty%
+
+% IDs
+
+\newcount\pgf@sys@svg@type@count
+
+\def\pgfsys@clean@type#1#2{%
+ \expandafter\let\expandafter#1\csname pgf@sys@svg@lookup@#2\endcsname%
+ \if#1\relax%
+ \global\advance\pgf@sys@svg@type@count by1\relax%
+ \expandafter\xdef\csname pgf@sys@svg@lookup@#2\endcsname{t\the\pgf@sys@svg@type@count}%
+ \expandafter\let\expandafter#1\csname pgf@sys@svg@lookup@#2\endcsname%
+ \fi%
+}
+
+
% Graphics state
\def\pgfsys@setdash#1#2{%
- \edef\pgf@test@dashpattern{#1}%
- \ifx\pgf@test@dashpattern\pgfutil@empty%
- \pgf@sys@svg@gs{stroke-dasharray="none" stroke-dashoffset="#2"}%
- \else%
- \pgf@sys@svg@gs{stroke-dasharray="#1" stroke-dashoffset="#2"}%
- \fi}
-\def\pgfsys@setlinewidth#1{\pgf@sys@svg@gs{stroke-width="#1"}}
+ {%
+ \pgf@xa#2\relax%
+ \edef\pgf@test@dashpattern{#1}%
+ \ifx\pgf@test@dashpattern\pgfutil@empty%
+ \pgf@sys@svg@gs{stroke-dasharray="none" stroke-dashoffset="\pgf@sys@tonumber\pgf@xa"}%
+ \else%
+ \let\pgf@sys@svg@parsed@dash\pgfutil@empty%
+ \expandafter\pgf@sys@svg@parse@dash\pgf@test@dashpattern,\relax%
+ \pgf@sys@svg@gs{stroke-dasharray="\pgf@sys@svg@parsed@dash" stroke-dashoffset="\pgf@sys@tonumber\pgf@xa"}%
+ \fi%
+ }%
+}
+\def\pgf@sys@svg@parse@dash#1,{%
+ \pgf@x#1\relax%
+ \pgfutil@ifnextchar\relax{%
+ \edef\pgf@sys@svg@parsed@dash{\pgf@sys@svg@parsed@dash\pgf@sys@tonumber\pgf@x}%
+ }{%
+ \edef\pgf@sys@svg@parsed@dash{\pgf@sys@svg@parsed@dash\pgf@sys@tonumber\pgf@x,}%
+ \pgf@sys@svg@parse@dash%
+ }%
+}
+\def\pgfsys@setlinewidth#1{{\pgf@x=#1\pgf@sys@svg@gs{stroke-width="\pgf@sys@tonumber{\pgf@x}"}}}
\def\pgfsys@setmiterlimit#1{\pgf@sys@svg@gs{stroke-miterlimit="#1"}}
\def\pgfsys@buttcap{\pgf@sys@svg@gs{stroke-linecap="butt"}}
\def\pgfsys@roundcap{\pgf@sys@svg@gs{stroke-linecap="round"}}
@@ -144,34 +320,88 @@
\def\pgfsys@roundjoin{\pgf@sys@svg@gs{stroke-linejoin="round"}}
\def\pgfsys@beveljoin{\pgf@sys@svg@gs{stroke-linejoin="bevel"}}
+% Invisibility
+\def\pgfsys@begininvisible{\pgfsysprotocol@literal{<g visibility="hidden">\pgfsys@svg@newline }}
+\def\pgfsys@endinvisible{\pgfsysprotocol@literal{</g>}}
+\def\pgfsys@begininvisiblescope{\pgfsys@beginscope@{ visibility="hidden"}}
+\def\pgfsys@endinvisiblescope{\pgfsys@endscope}
+
%
% Color management
%
+\def\pgf@sys@svg@rgb@to@hash#1#2#3{%
+ {%
+ \pgf@sys@svg@do@color{#1}%
+ \let\pgf@sys@svg@ra\pgf@sys@svg@hex@first%
+ \let\pgf@sys@svg@rb\pgf@sys@svg@hex@second%
+ \pgf@sys@svg@do@color{#2}%
+ \let\pgf@sys@svg@ga\pgf@sys@svg@hex@first%
+ \let\pgf@sys@svg@gb\pgf@sys@svg@hex@second%
+ \pgf@sys@svg@do@color{#3}%
+ \let\pgf@sys@svg@ba\pgf@sys@svg@hex@first%
+ \let\pgf@sys@svg@bb\pgf@sys@svg@hex@second%
+ \xdef\pgf@sys@svg@prepared{\pgf@sys@svg@hash\pgf@sys@svg@ra\pgf@sys@svg@rb\pgf@sys@svg@ga\pgf@sys@svg@gb\pgf@sys@svg@ba\pgf@sys@svg@bb}%
+ \ifx\pgf@sys@svg@ra\pgf@sys@svg@rb%
+ \ifx\pgf@sys@svg@ga\pgf@sys@svg@gb%
+ \ifx\pgf@sys@svg@ba\pgf@sys@svg@bb%
+ \xdef\pgf@sys@svg@prepared{\pgf@sys@svg@hash\pgf@sys@svg@ra\pgf@sys@svg@ga\pgf@sys@svg@ba}%
+ \fi%
+ \fi%
+ \fi%
+ }%
+}
+
+\expandafter\def\csname pgf@svg@0\endcsname{0}
+\expandafter\def\csname pgf@svg@1\endcsname{1}
+\expandafter\def\csname pgf@svg@2\endcsname{2}
+\expandafter\def\csname pgf@svg@3\endcsname{3}
+\expandafter\def\csname pgf@svg@4\endcsname{4}
+\expandafter\def\csname pgf@svg@5\endcsname{5}
+\expandafter\def\csname pgf@svg@6\endcsname{6}
+\expandafter\def\csname pgf@svg@7\endcsname{7}
+\expandafter\def\csname pgf@svg@8\endcsname{8}
+\expandafter\def\csname pgf@svg@9\endcsname{9}
+\expandafter\def\csname pgf@svg@10\endcsname{a}
+\expandafter\def\csname pgf@svg@11\endcsname{b}
+\expandafter\def\csname pgf@svg@12\endcsname{c}
+\expandafter\def\csname pgf@svg@13\endcsname{d}
+\expandafter\def\csname pgf@svg@14\endcsname{e}
+\expandafter\def\csname pgf@svg@15\endcsname{f}
+
+\def\pgf@sys@svg@do@color#1{%
+ \pgf@x#1\relax%
+ \c@pgf@counta\pgf@x%
+ \divide\c@pgf@counta by256\relax%
+ \ifnum\c@pgf@counta>255\relax%
+ \c@pgf@counta=255\relax%
+ \fi%
+ \ifnum\c@pgf@counta<0\relax%
+ \c@pgf@counta=0\relax%
+ \fi%
+ \c@pgf@countb\c@pgf@counta\relax%
+ \divide\c@pgf@countb by16\relax%
+ \expandafter\let\expandafter\pgf@sys@svg@hex@first\csname pgf@svg@\the\c@pgf@countb\endcsname%
+ \multiply\c@pgf@countb by16\relax%
+ \advance\c@pgf@counta by-\c@pgf@countb\relax%
+ \expandafter\let\expandafter\pgf@sys@svg@hex@second\csname pgf@svg@\the\c@pgf@counta\endcsname%
+}
+
\def\pgf@sys@svg@color@rgb#1,#2,#3\relax{%
{%
- \pgf@xa=#1pt%
- \pgf@xa=100\pgf@xa%
- \pgf@xb=#2pt%
- \pgf@xb=100\pgf@xb%
- \pgf@xc=#3pt%
- \pgf@xc=100\pgf@xc%
- \xdef\pgf@sys@svg@prepared{rgb(\pgf@sys@tonumber\pgf@xa\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xb\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xc\pgf@sys@svg@percentchar)}%
- }%
+ \pgf@sys@svg@rgb@to@hash{#1pt}{#2pt}{#3pt}%
+ }%
}
\def\pgf@sys@svg@color@cmy#1,#2,#3\relax{%
{%
\pgf@xa=1pt%
\advance\pgf@xa by-#1pt%
- \pgf@xa=100\pgf@xa%
\pgf@xb=1pt%
\advance\pgf@xb by-#2pt%
- \pgf@xb=100\pgf@xb%
\pgf@xc=1pt%
\advance\pgf@xc by-#3pt%
- \pgf@xc=100\pgf@xc%
- \xdef\pgf@sys@svg@prepared{rgb(\pgf@sys@tonumber\pgf@xa\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xb\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xc\pgf@sys@svg@percentchar)}%
+ \pgf@sys@svg@rgb@to@hash{\pgf@xa}{\pgf@xb}{\pgf@xc}%
}%
}
\def\pgf@sys@svg@color@cmyk#1,#2,#3,#4\relax{%
@@ -181,27 +411,26 @@
\pgf@xa=#1\pgf@xa%
\advance\pgf@xa by#4pt%
\advance\pgf@xa by-1pt%
- \pgf@xa=-100\pgf@xa%
+ \pgf@xa=-\pgf@xa%
\pgf@xb=1pt%
\advance\pgf@xb by-#4pt%
\pgf@xb=#2\pgf@xb%
\advance\pgf@xb by#4pt%
\advance\pgf@xb by-1pt%
- \pgf@xb=-100\pgf@xb%
+ \pgf@xb=-\pgf@xb%
\pgf@xc=1pt%
\advance\pgf@xc by-#4pt%
\pgf@xc=#3\pgf@xc%
\advance\pgf@xc by#4pt%
\advance\pgf@xc by-1pt%
- \pgf@xc=-100\pgf@xc%
- \xdef\pgf@sys@svg@prepared{rgb(\pgf@sys@tonumber\pgf@xa\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xb\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xc\pgf@sys@svg@percentchar)}%
+ \pgf@xc=-\pgf@xc%
+ \pgf@sys@svg@rgb@to@hash{\pgf@xa}{\pgf@xb}{\pgf@xc}%
}%
}
\def\pgf@sys@svg@color@gray#1\relax{%
- {%
+ {%
\pgf@xa=#1pt%
- \pgf@xa=100\pgf@xa%
- \xdef\pgf@sys@svg@prepared{rgb(\pgf@sys@tonumber\pgf@xa\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xa\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xa\pgf@sys@svg@percentchar)}%
+ \pgf@sys@svg@rgb@to@hash{\pgf@xa}{\pgf@xa}{\pgf@xa}%
}%
}
@@ -209,30 +438,100 @@
\ifpgfpicture\pgf@sys@svg@gs{#1}\fi%
}
+\def\pgf@sys@svg@colorpop{\special{color pop}}
+
+
+% RGB
\def\pgfsys@color@rgb@stroke#1#2#3{%
\pgf@sys@svg@color@rgb#1,#2,#3\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
\pgf@sys@svg@gs@color{stroke="\pgf@sys@svg@prepared"}}
\def\pgfsys@color@rgb@fill#1#2#3{%
- \pgf@sys@svg@color@rgb#1,#2,#3\relax%
- \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}}
+ \ifpgfpicture%
+ \pgf@sys@svg@color@rgb#1,#2,#3\relax%
+ \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}%
+ \else%
+ \special{color push rgb #1 #2 #3}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
+\def\pgfsys@color@rgb#1#2#3{%
+ \ifpgfpicture%
+ \pgf@sys@svg@color@rgb#1,#2,#3\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
+ \pgf@sys@svg@gs@color{\ifpgfsys@svg@boxmode\else stroke="\pgf@sys@svg@prepared" \fi fill="\pgf@sys@svg@prepared"}%
+ \else%
+ \special{color push rgb #1 #2 #3}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
+
+%CMYK
\def\pgfsys@color@cmyk@stroke#1#2#3#4{%
\pgf@sys@svg@color@cmyk#1,#2,#3,#4\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
\pgf@sys@svg@gs@color{stroke="\pgf@sys@svg@prepared"}}
\def\pgfsys@color@cmyk@fill#1#2#3#4{%
- \pgf@sys@svg@color@cmyk#1,#2,#3,#4\relax%
- \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}}
+ \ifpgfpicture%
+ \pgf@sys@svg@color@cmyk#1,#2,#3,#4\relax%
+ \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}%
+ \else%
+ \special{color push cmyk #1 #2 #3 #4}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
+\def\pgfsys@color@cmyk#1#2#3#4{%
+ \ifpgfpicture%
+ \pgf@sys@svg@color@cmyk#1,#2,#3,#4\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
+ \pgf@sys@svg@gs@color{\ifpgfsys@svg@boxmode\else stroke="\pgf@sys@svg@prepared" \fi fill="\pgf@sys@svg@prepared"}%
+ \else%
+ \special{color push cmyk #1 #2 #3 #4}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
+
+% CMY
\def\pgfsys@color@cmy@stroke#1#2#3{%
\pgf@sys@svg@color@cmy#1,#2,#3\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
\pgf@sys@svg@gs@color{stroke="\pgf@sys@svg@prepared"}}
\def\pgfsys@color@cmy@fill#1#2#3{%
- \pgf@sys@svg@color@cmy#1,#2,#3\relax%
- \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}}
+ \ifpgfpicture%
+ \pgf@sys@svg@color@cmy#1,#2,#3\relax%
+ \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}
+ \else%
+ \special{color push cmyk #1 #2 #3 0}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
+\def\pgfsys@color@cmy#1#2#3{%
+ \ifpgfpicture%
+ \pgf@sys@svg@color@cmy#1,#2,#3\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
+ \pgf@sys@svg@gs@color{\ifpgfsys@svg@boxmode\else stroke="\pgf@sys@svg@prepared" \fi fill="\pgf@sys@svg@prepared"}%
+ \else%
+ \special{color push cmyk #1 #2 #3 0}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
+
+% gray
\def\pgfsys@color@gray@stroke#1{%
\pgf@sys@svg@color@gray#1\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
\pgf@sys@svg@gs@color{stroke="\pgf@sys@svg@prepared"}}
\def\pgfsys@color@gray@fill#1{%
- \pgf@sys@svg@color@gray#1\relax%
- \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}}
+ \ifpgfpicture%
+ \pgf@sys@svg@color@gray#1\relax%
+ \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}%
+ \else%
+ \special{color push gray #1}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
+\def\pgfsys@color@gray#1{%
+ \ifpgfpicture%
+ \pgf@sys@svg@color@gray#1\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
+ \pgf@sys@svg@gs@color{\ifpgfsys@svg@boxmode\else stroke="\pgf@sys@svg@prepared" \fi fill="\pgf@sys@svg@prepared"}%
+ \else%
+ \special{color push gray #1}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
% Shadings:
@@ -286,7 +585,7 @@
{%
\pgf@parsefunc{#3}%
\global\advance\pgf@sys@svg@objectcount by1\relax%
- \pgf@sys@svg@addtostops{<linearGradient id="pgfsh\the\pgf@sys@svg@objectcount">\noexpand\pgfsys@svg@newline}
+ \pgf@sys@svg@addtostops{<linearGradient id="pgfsh\the\pgf@sys@svg@objectcount">\noexpand\pgfsys@svg@newline}%
\pgf@sys@svg@shading@stops%
\pgf@sys@svg@addtostops{</linearGradient>\noexpand\pgfsys@svg@newline}%
\pgf@process{\pgfpoint{\pgf@sys@shading@end@pos}{#2}}%
@@ -317,7 +616,7 @@
\global\advance\pgf@sys@svg@objectcount by1\relax%
\pgf@sys@svg@addtostops{<linearGradient
id="pgfsh\the\pgf@sys@svg@objectcount"
- gradientTransform="rotate(90)">\noexpand\pgfsys@svg@newline}
+ gradientTransform="rotate(90)">\noexpand\pgfsys@svg@newline}%
\pgf@sys@svg@shading@stops%
\pgf@sys@svg@addtostops{</linearGradient>\noexpand\pgfsys@svg@newline}%
\pgf@process{\pgfpoint{\pgf@sys@shading@end@pos}{#2}}%
@@ -352,7 +651,7 @@
id="pgfsh\the\pgf@sys@svg@objectcount"
fx="\pgf@sys@tonumber\pgf@x"
fy="\pgf@sys@tonumber\pgf@y"
- >\noexpand\pgfsys@svg@newline}
+ >\noexpand\pgfsys@svg@newline}%
\pgf@sys@svg@shading@stops%
\pgf@sys@svg@addtostops{</radialGradient>\noexpand\pgfsys@svg@newline}%
\pgf@xa=\pgf@sys@shading@end@pos%
@@ -373,8 +672,6 @@
% Patterns
-\iffalse % comment until interpage support is available
-
\def\pgfsys@declarepattern#1#2#3#4#5#6#7#8#9{%
% Start building the pattern dictionary:
\pgf@xa=#2\relax%
@@ -385,22 +682,22 @@
\pgf@yc=#7\relax%
\ifnum#9=1\relax%
% Colored. That's easy:
- \pgfsysprotocol@literal{
+ \pgf@sys@svg@make@defs{#1}{
<pattern
id="pgfpat#1"
patternUnits="userSpaceOnUse"
- width="\the\pgf@xc"
- height="\the\pgf@yc">
+ width="\pgf@sys@tonumber\pgf@xc"
+ height="\pgf@sys@tonumber\pgf@yc">
#8
</pattern>}%
\else%
% Uncolored. Yikes!
- \pgfsysprotocol@literal{
+ \pgf@sys@svg@make@defs{#1}{
<pattern
id="pgfpat#1"
patternUnits="userSpaceOnUse"
- width="\the\pgf@xc"
- height="\the\pgf@yc"/>
+ width="\pgf@sys@tonumber\pgf@xc"
+ height="\pgf@sys@tonumber\pgf@yc"/>
<symbol id="pgfsym#1">
#8
</symbol>}%
@@ -413,38 +710,884 @@
\pgfsysprotocol@literal{
<pattern id="pgfupat\the\pgf@sys@svg@objectcount" xlink:href="\#pgfpat#1">
<g stroke="\pgf@sys@svg@prepared" fill="\pgf@sys@svg@prepared"> <use xlink:href="\#pgfsym#1"/> </g>
- </pattern>}
+ </pattern>}%
+ \pgf@sys@svg@ref@defs{#1}%
\pgf@sys@svg@gs@color{fill="url(\#pgfupat\the\pgf@sys@svg@objectcount)"}%
}
\def\pgfsys@setpatterncolored#1{%
+ \pgf@sys@svg@ref@defs{#1}%
\pgf@sys@svg@gs@color{fill="url(\#pgfpat#1)"}%
}
-\fi
-% Fadings
+
+% Animation
+
+\pgfsysanimationsupportedtrue
+
+\let\pgfsys@anim@val@dur\pgfutil@empty
+\let\pgfsys@anim@val@restart\pgfutil@empty
+\let\pgfsys@anim@val@repeatCount\pgfutil@empty
+\let\pgfsys@anim@val@repeatDur\pgfutil@empty
+\let\pgfsys@anim@val@fill\pgfutil@empty
+\let\pgfsys@anim@val@keyTimes\pgfutil@empty
+\let\pgfsys@anim@val@keyPoints\pgfutil@empty
+\let\pgfsys@anim@val@keySplines\pgfutil@empty
+\let\pgfsys@anim@val@begin\pgfutil@empty
+\let\pgfsys@anim@val@end\pgfutil@empty
+\let\pgfsys@anim@val@additive\pgfutil@empty
+\let\pgfsys@anim@val@accumulate\pgfutil@empty
+\def\pgfsys@anim@val@calcMode{spline}
+\let\pgfsys@anim@val@from\pgfutil@empty
+\let\pgfsys@anim@val@to\pgfutil@empty
+\let\pgfsys@anim@val@path\pgfutil@empty
+\let\pgfsys@anim@val@rotate\pgfutil@empty
+\let\pgfsys@anim@val@values\pgfutil@empty
+\def\pgfsys@anim@val@canvas@trans{{}{}}
+\let\pgfsys@anim@val@@id\pgfutil@empty
+\let\pgfsys@anim@val@@type\pgfutil@empty
+\let\pgfsys@anim@val@base\pgfutil@empty
+\let\pgfsys@anim@val@idref\pgfutil@empty
+\expandafter\let\csname pgfsys@anim@val@xlink:href\endcsname\pgfutil@empty
+
+\def\pgf@sys@svg@key#1{%
+ \expandafter\ifx\csname pgfsys@anim@val@#1\endcsname\pgfutil@empty\else%
+ \space#1="\csname pgfsys@anim@val@#1\endcsname"%
+ \fi%
+}
+
+\def\pgf@svg@anim@keys{
+ \pgf@sys@svg@key{dur}%
+ \pgf@sys@svg@key{restart}%
+ \pgf@sys@svg@key{repeatCount}%
+ \pgf@sys@svg@key{repeatDur}%
+ \pgf@sys@svg@key{fill}%
+ \pgf@sys@svg@key{keyTimes}%
+ \pgf@sys@svg@key{keyPoints}%
+ \pgf@sys@svg@key{keySplines}%
+ \pgf@sys@svg@key{begin}%
+ \pgf@sys@svg@key{end}%
+ \pgf@sys@svg@key{additive}%
+ \pgf@sys@svg@key{accumulate}%
+ \pgf@sys@svg@key{calcMode}%
+ \pgf@sys@svg@key{values}%
+ \pgf@sys@svg@key{from}%
+ \pgf@sys@svg@key{to}%
+ \pgf@sys@svg@key{path}%
+ \pgf@sys@svg@key{rotate}%
+ \pgf@sys@svg@key{xlink:href}%
+}
+
+\newif\ifpgf@sys@at@least@one@event
+\def\pgf@sys@svg@do@events#1{%
+ \pgf@sys@at@least@one@eventfalse%
+ \def\pgf@sys@event@target{#1}%
+ \expandafter\expandafter\expandafter\pgf@sys@svg@do@events@now\csname pgf@sys@event@list@#1\endcsname\relax%
+}
+\def\pgf@sys@svg@do@events@now{%
+ \pgfutil@ifnextchar\relax{}{\pgf@sys@svg@do@event}%
+}
+\def\pgf@sys@svg@do@event#1#2#3#4{%
+ \pgf@sys@at@least@one@eventtrue%
+ %
+ {%
+ \edef\pgf@temp{#1}%
+ \ifx\pgf@temp\pgfutil@empty%
+ \else%
+ \pgfsys@register@type{#2}%
+ \def\pgf@temp{\pgfsys@id@ref{#1}{#2}.}%
+ \fi%
+ \edef\pgf@@temp{#4}%
+ \ifx\pgf@@temp\pgfutil@empty%
+ \pgf@x0pt%
+ \else%
+ \pgf@x#4pt%
+ \fi%
+ \ifx\pgf@sys@event@target\pgf@sys@begin@text%
+ \advance\pgf@x by\pgf@xa\relax%
+ \fi\relax%
+ \ifdim\pgf@x<0pt%
+ \edef\pgf@@temp{ \pgf@sys@tonumber\pgf@x s}%
+ \else
+ \edef\pgf@@temp{ +\pgf@sys@tonumber\pgf@x s}%
+ \fi%
+ \xdef\pgf@svg@anim@temp{\pgf@temp#3\pgf@@temp}%
+ }%
+ \pgf@sys@svg@append{\pgf@sys@event@target}{\pgf@svg@anim@temp}%
+ \global\let\pgf@svg@anim@temp\relax%
+ \pgf@sys@svg@do@events@now%
+}
+
+
+\newif\ifpgf@sys@svg@is@sync@base
+\def\pgf@sys@svg@anim#1#2#3{%
+ \ifx\pgfsys@anim@val@@id\pgfutil@empty%
+ \pgferror{Animation misses ``whom''}%
+ \else%
+ {%
+ \ifx\pgfsys@anim@val@base\pgfutil@empty%
+ \else%
+ % Hook into id:
+ \expandafter\let\expandafter\pgf@sys@temp\csname pgfsys@anim@ba@\pgfsys@anim@val@idref\endcsname%
+ \ifx\pgf@sys@temp\relax%
+ \edef\pgf@sys@temp{\global\let\expandafter\noexpand\csname pgfsys@anim@ba@\pgfsys@anim@val@idref\endcsname\relax\noexpand\pgfsys@anim@ba@setup}%
+ \fi%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@temp\expandafter\expandafter\expandafter{\expandafter\pgf@sys@temp\expandafter\def\expandafter#3\expandafter{\pgfsys@anim@val@base}}%
+ \expandafter\global\expandafter\let\csname pgfsys@anim@ba@\pgfsys@anim@val@idref\endcsname\pgf@sys@temp%
+ \fi%
+ \pgf@sys@svg@tl@eval%
+ \pgf@sys@svg@do@events{begin}%
+ \ifpgf@sys@at@least@one@event%
+ \else%
+ \pgf@sys@svg@append{begin}{\ifdim\pgf@xa>0pt+\fi\pgf@sys@tonumber\pgf@xa s}%
+ \fi%
+ \pgf@sys@svg@do@events{end}%
+ #2%
+ % Suppress empty, superfluous animations:
+ \pgfutil@tempswatrue%
+ \pgfsys@if@fresh@currentid{}{%
+ \ifx\pgfsys@anim@val@values\pgfutil@empty%
+ \ifx\pgfsys@anim@val@to\pgfutil@empty%
+ \ifx\pgfsys@anim@val@dur\pgfutil@empty%
+ \pgfutil@tempswafalse%
+ \fi%
+ \fi%
+ \fi}
+ \ifpgfutil@tempswa%
+ \edef\pgf@temp{{<animate #1\pgfsys@if@fresh@currentid{ id="\pgfsys@id@refcurrent"}{}\pgf@svg@anim@keys/>\pgfsys@svg@newline}}%
+ \expandafter\pgfsysprotocol@literal\pgf@temp%
+ \fi%
+ \pgfsys@invalidate@currentid%
+ }%
+ \fi%
+}
+
+\def\pgf@sys@svg@anim@path{%
+ % animate a path...
+ \ifx\pgfsys@anim@val@@id\pgfutil@empty%
+ \pgferror{Animation misses ``whom''}%
+ \else%
+ {%
+ \let\pgf@sys@svg@add@code\pgfutil@empty%
+ %
+ % Setup markers:
+ %
+ % Setup start
+ \ifx\pgf@svg@anim@marker@start\pgfutil@empty%
+ \let\pgf@sys@svg@marker@id@start\pgfutil@empty%
+ \else%
+ \global\advance\pgf@sys@svg@objectcount by1\relax%
+ \edef\pgf@sys@svg@marker@id{pgf\the\pgf@sys@svg@objectcount}%
+ \edef\pgf@sys@svg@add@code{%
+ \noexpand\pgf@sys@svg@ref@defs{pgfs\pgf@svg@anim@marker@start}%
+ \noexpand\pgfsysprotocol@literal{<marker id="\pgf@sys@svg@marker@id" markerUnits="userSpaceOnUse" orient="auto" overflow="visible">
+ <use xlink:href="\#pgfs\pgf@svg@anim@marker@start" transform="scale(-1,-1)"/> </marker>\pgfsys@svg@newline}%
+ }%
+ \let\pgf@sys@svg@marker@id@start\pgf@sys@svg@marker@id%
+ \fi%
+ % Setup end
+ \ifx\pgf@svg@anim@marker@end\pgfutil@empty%
+ \let\pgf@sys@svg@marker@id@end\pgfutil@empty%
+ \else%
+ \global\advance\pgf@sys@svg@objectcount by1\relax%
+ \edef\pgf@sys@svg@marker@id{pgf\the\pgf@sys@svg@objectcount}%
+ \edef\pgf@sys@svg@add@code@{%
+ \noexpand\pgf@sys@svg@ref@defs{pgfs\pgf@svg@anim@marker@end}%
+ \noexpand\pgfsysprotocol@literal{<marker id="\pgf@sys@svg@marker@id" markerUnits="userSpaceOnUse" orient="auto" overflow="visible">
+ <use xlink:href="\#pgfs\pgf@svg@anim@marker@end"/> </marker>\pgfsys@svg@newline}%
+ }%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@svg@add@code\expandafter\expandafter\expandafter{\expandafter\pgf@sys@svg@add@code\pgf@sys@svg@add@code@}%
+ \let\pgf@sys@svg@marker@id@end\pgf@sys@svg@marker@id%
+ \fi%
+ \ifx\pgfsys@anim@val@base\pgfutil@empty%
+ \else%
+ % Hook into id of path:
+ \expandafter\let\expandafter\pgf@sys@temp\csname pgfsys@anim@ba@\pgfsys@anim@val@idref\endcsname%
+ \ifx\pgf@sys@temp\relax%
+ \edef\pgf@sys@temp{\global\let\expandafter\noexpand\csname pgfsys@anim@ba@\pgfsys@anim@val@idref\endcsname\relax\noexpand\pgfsys@anim@ba@setup}%
+ \fi%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@temp\expandafter\expandafter\expandafter{\expandafter\pgf@sys@temp\expandafter\def\expandafter\pgfsys@anim@ba@d\expandafter{\pgfsys@anim@val@base}}%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@temp\expandafter\expandafter\expandafter{\expandafter\pgf@sys@temp\expandafter\def\expandafter\pgfsys@anim@ba@markerstart\expandafter{\pgf@sys@svg@marker@id@start}}%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@temp\expandafter\expandafter\expandafter{\expandafter\pgf@sys@temp\expandafter\def\expandafter\pgfsys@anim@ba@markerend\expandafter{\pgf@sys@svg@marker@id@end}}%
+ \expandafter\global\expandafter\let\csname pgfsys@anim@ba@\pgfsys@anim@val@idref\endcsname\pgf@sys@temp%
+ \fi%
+ \pgf@sys@svg@tl@eval%
+ \pgf@sys@svg@do@events{begin}%
+ \ifpgf@sys@at@least@one@event%
+ \else%
+ \pgf@sys@svg@append{begin}{\ifdim\pgf@xa>0pt+\fi\pgf@sys@tonumber\pgf@xa s}%
+ \fi%
+ \pgf@sys@svg@do@events{end}%
+ % Suppress empty, superfluous animations:
+ \pgfutil@tempswatrue%
+ \pgfsys@if@fresh@currentid{}{%
+ \ifx\pgfsys@anim@val@values\pgfutil@empty%
+ \ifx\pgfsys@anim@val@to\pgfutil@empty%
+ \ifx\pgfsys@anim@val@dur\pgfutil@empty%
+ \pgfutil@tempswafalse%
+ \fi%
+ \fi%
+ \fi}
+ \ifpgfutil@tempswa%
+ % Ok, first, animate the path:
+ \edef\pgf@temp{%
+ {%
+ <animate attributeName="d"\pgfsys@if@fresh@currentid{ id="\pgfsys@id@refcurrent"}{}\pgf@svg@anim@keys/>\pgfsys@svg@newline
+ <animate attributeName="marker-start"\pgfsys@if@fresh@currentid{ id="\pgfsys@id@refcurrent-ms"}{}%
+ \pgf@sys@svg@key{dur}%
+ \pgf@sys@svg@key{restart}%
+ \pgf@sys@svg@key{repeatCount}%
+ \pgf@sys@svg@key{repeatDur}%
+ \pgf@sys@svg@key{fill}%
+ \pgf@sys@svg@key{begin}%
+ \pgf@sys@svg@key{end}%
+ \pgf@sys@svg@key{xlink:href}
+ from="\ifx\pgf@svg@anim@marker@start\pgfutil@empty none\else url(\#\pgf@sys@svg@marker@id@start)\fi"
+ to="\ifx\pgf@svg@anim@marker@start\pgfutil@empty none\else url(\#\pgf@sys@svg@marker@id@start)\fi"
+ />\pgfsys@svg@newline%
+ <animate attributeName="marker-end"\pgfsys@if@fresh@currentid{ id="\pgfsys@id@refcurrent-me"}{}%
+ \pgf@sys@svg@key{dur}%
+ \pgf@sys@svg@key{restart}%
+ \pgf@sys@svg@key{repeatCount}%
+ \pgf@sys@svg@key{repeatDur}%
+ \pgf@sys@svg@key{fill}%
+ \pgf@sys@svg@key{begin}%
+ \pgf@sys@svg@key{end}%
+ \pgf@sys@svg@key{xlink:href}
+ from="\ifx\pgf@svg@anim@marker@end\pgfutil@empty none\else url(\#\pgf@sys@svg@marker@id@end)\fi"
+ to="\ifx\pgf@svg@anim@marker@end\pgfutil@empty none\else url(\#\pgf@sys@svg@marker@id@end)\fi"
+ />\pgfsys@svg@newline%
+ }}%
+ \expandafter\pgfsysprotocol@literal\pgf@temp%
+ \fi%
+ \ifx\pgf@sys@svg@add@code\pgfutil@empty%
+ \else%
+ \expandafter\let\expandafter\pgf@sys@svg@add@code@\csname pgf@sys@svg@path@\pgfsys@id@ref{\pgfsys@anim@val@@id}{\pgfsys@anim@val@@type}\endcsname%
+ \ifx\pgf@sys@svg@add@code@\relax%
+ \else%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@svg@add@code\expandafter\expandafter\expandafter{\expandafter\pgf@sys@svg@add@code\pgf@sys@svg@add@code@}%
+ \fi%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@svg@add@code%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@sys@svg@add@code\expandafter\global\expandafter\let\csname pgf@sys@svg@path@\pgfsys@id@ref{\pgfsys@anim@val@@id}{\pgfsys@anim@val@@type}\endcsname\relax}%
+ \expandafter\global\expandafter\let\csname pgf@sys@svg@path@\pgfsys@id@ref{\pgfsys@anim@val@@id}{\pgfsys@anim@val@@type}\endcsname\pgf@sys@svg@add@code%
+ \fi%
+ \pgfsys@invalidate@currentid%
+ }%
+ \fi%
+}
+
+\def\pgfsys@anim@ba@setup{%
+ \let\pgfsys@anim@ba@opacity\pgfutil@empty%
+ \let\pgfsys@anim@ba@fillopacity\pgfutil@empty%
+ \let\pgfsys@anim@ba@strokeopacity\pgfutil@empty%
+ \let\pgfsys@anim@ba@visibility\pgfutil@empty%
+ \let\pgfsys@anim@ba@strokewidth\pgfutil@empty%
+ \let\pgfsys@anim@ba@fill\pgfutil@empty%
+ \let\pgfsys@anim@ba@stroke\pgfutil@empty%
+ \let\pgfsys@anim@ba@strokedasharray\pgfutil@empty%
+ \let\pgfsys@anim@ba@strokedashoffset\pgfutil@empty%
+ \let\pgf@sys@svg@ba@gs\pgf@sys@svg@ba@gs@do@now%
+}
+\let\pgfsys@anim@ba@opacity\pgfutil@empty%
+\let\pgfsys@anim@ba@fillopacity\pgfutil@empty%
+\let\pgfsys@anim@ba@strokeopacity\pgfutil@empty%
+\let\pgfsys@anim@ba@visibility\pgfutil@empty%
+\let\pgfsys@anim@ba@strokewidth\pgfutil@empty%
+\let\pgfsys@anim@ba@fill\pgfutil@empty%
+\let\pgfsys@anim@ba@stroke\pgfutil@empty%
+\let\pgfsys@anim@ba@viewBox\pgfutil@empty%
+\let\pgfsys@anim@ba@d\pgfutil@empty%
+\let\pgfsys@anim@ba@strokedasharray\pgfutil@empty%
+\let\pgfsys@anim@ba@strokedashoffset\pgfutil@empty%
+\let\pgfsys@anim@ba@markerstart\pgfutil@empty%
+\let\pgfsys@anim@ba@markerendd\pgfutil@empty%
+
+\def\pgf@sys@svg@ba@gs@do@now{%
+ \ifx\pgfsys@anim@ba@fill\pgfutil@empty\else fill="\pgfsys@anim@ba@fill" \fi%
+ \ifx\pgfsys@anim@ba@stroke\pgfutil@empty\else stroke="\pgfsys@anim@ba@stroke" \fi%
+ \ifx\pgfsys@anim@ba@opacity\pgfutil@empty\else opacity="\pgfsys@anim@ba@opacity" \fi%
+ \ifx\pgfsys@anim@ba@fillopacity\pgfutil@empty\else fill-opacity="\pgfsys@anim@ba@fillopacity" \fi%
+ \ifx\pgfsys@anim@ba@strokeopacity\pgfutil@empty\else stroke-opacity="\pgfsys@anim@ba@strokeopacity" \fi%
+ \ifx\pgfsys@anim@ba@visibility\pgfutil@empty\else visibility="\pgfsys@anim@ba@visibility" \fi%
+ \ifx\pgfsys@anim@ba@strokewidth\pgfutil@empty\else stroke-width="\pgfsys@anim@ba@strokewidth" \fi%
+ \ifx\pgfsys@anim@ba@strokedasharray\pgfutil@empty\else stroke-dasharray="\pgfsys@anim@ba@strokedasharray" \fi%
+ \ifx\pgfsys@anim@ba@strokedashoffset\pgfutil@empty\else stroke-dashoffset="\pgfsys@anim@ba@strokedashoffset" \fi%
+}
+
+
+
+\newcount\pgf@sys@svg@canvascount
+\def\pgf@sys@svg@anim@trans#1#2#3{%
+ \ifx\pgfsys@anim@val@@id\pgfutil@empty%
+ \pgferror{Animation misses ``whom''}%
+ \else%
+ {%
+ %
+ \global\advance\pgf@sys@svg@canvascount by1\relax%
+ \pgf@sys@svg@tl@eval%
+ \pgf@sys@svg@do@events{begin}%
+ \ifpgf@sys@at@least@one@event%
+ \else%
+ \pgf@sys@svg@append{begin}{\ifdim\pgf@xa>0pt+\fi\pgf@sys@tonumber\pgf@xa s}%
+ \fi%
+ \pgf@sys@svg@do@events{end}%
+ #2%
+ \pgfsys@register@type{\pgfsys@anim@val@@type}%
+ \pgf@sys@svg@replace{xlink:href}{\#\pgfsys@id@ref{\pgfsys@anim@val@@id canvas\the\pgf@sys@svg@canvascount}{\pgfsys@anim@val@@type}}%
+ \ifx\pgfsys@anim@val@base\pgfutil@empty%
+ \let\pgf@sys@svg@base@trans\pgfutil@empty%
+ \else%
+ \edef\pgf@sys@svg@base@trans{ transform="#3(\pgfsys@anim@val@base)"}%
+ \fi%
+ \pgfsysprotocol@literal{<#1\pgfsys@if@fresh@currentid{ id="\pgfsys@id@refcurrent"}{}\pgf@svg@anim@keys/>\pgfsys@svg@newline}%
+ \pgfsys@invalidate@currentid%
+ \edef\pgf@temp{{\pgfsys@id@ref{\pgfsys@anim@val@@id
+ canvas\the\pgf@sys@svg@canvascount}{\pgfsys@anim@val@@type}}}%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\pgf@sys@svg@attacher%
+ \expandafter\expandafter\expandafter\pgf@temp\expandafter\pgfsys@anim@val@canvas@trans\expandafter{\pgf@sys@svg@base@trans}%
+ }%
+ \fi%
+}
+
+\newif\ifpgf@sys@svg@called
+\def\pgf@sys@svg@attacher#1#2#3#4{%
+ \toks0{%
+ {%
+ \let\pgfsys@transformcm\pgfsys@anim@transformcm%
+ \global\pgf@sys@svg@calledfalse%
+ #2%
+ \ifpgf@sys@svg@called\else\pgfsysprotocol@literal{<g>}\fi%
+ \pgfsysprotocol@literal{<g id="#1"#4>}
+ {%
+ \global\pgf@sys@svg@calledfalse%
+ #3%
+ \ifpgf@sys@svg@called\else\pgfsysprotocol@literal{<g>}\fi%
+ }%
+ }%
+ }%
+ \edef\pgf@sys@svg@beg{\the\toks0}%
+ \def\pgf@sys@svg@end{\pgfsysprotocol@literal{</g></g></g>\noexpand\pgfsys@svg@newline}}%
+ \expandafter\expandafter\expandafter\pgfsys@attach@to@id%
+ \expandafter\expandafter\expandafter\pgfsys@anim@val@@id%
+ \expandafter\expandafter\expandafter\pgfsys@anim@val@@type%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@sys@svg@beg\expandafter}\expandafter{\pgf@sys@svg@end}%
+}
+
+
+\def\pgfsys@anim@transformcm#1#2#3#4#5#6{%
+ \ifpgf@sys@svg@called%
+ \pgferror{Double transformation calls in animation}%
+ \else%
+ {%
+ \pgf@x=#5\pgf@y=#6%
+ \edef\pgf@temp{ transform="matrix(#1,#2,#3,#4,\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}%
+ \ifx\pgf@temp\pgf@sys@svg@idmat@stext%
+ \let\pgf@temp\pgfutil@empty%
+ \fi%
+ \pgfsysprotocol@literal{<g\pgf@temp>}%
+ }%
+ \global\pgf@sys@svg@calledtrue%
+ \fi%
+}
+\def\pgf@sys@svg@idtrans@text{1.0,0.0,0.0,1.0}
+\def\pgf@sys@svg@idmat@text{transform="matrix(1.0,0.0,0.0,1.0,0.0,0.0)"}
+\def\pgf@sys@svg@idmat@stext{ transform="matrix(1.0,0.0,0.0,1.0,0.0,0.0)"}
+
+\def\pgf@sys@svg@replace#1#2{%
+ \expandafter\edef\csname pgfsys@anim@val@#1\endcsname{#2}%
+}
+
+\def\pgf@sys@svg@append#1#2{%
+ \expandafter\let\expandafter\pgf@svg@anim@temp@\csname pgfsys@anim@val@#1\endcsname%
+ \ifx\pgf@svg@anim@temp@\pgfutil@empty%
+ \expandafter\edef\csname pgfsys@anim@val@#1\endcsname{#2}%
+ \else\ifx\pgf@svg@anim@temp@\relax%
+ \pgfutil@packageerror{pgfsys}{Unknown animation key '#1'}{}
+ \else%
+ \edef\pgf@svg@anim@temp@{\pgf@svg@anim@temp@;#2}%
+ \expandafter\let\csname pgfsys@anim@val@#1\endcsname\pgf@svg@anim@temp@%
+ \fi\fi%
+}
+
+% The actual animate command
+\def\pgfsys@animate#1{%
+ \expandafter\let\expandafter\pgf@sys@temp\csname pgfsys@svg@animate#1\endcsname\relax%
+ \ifx\pgf@sys@temp\relax%
+ \pgf@sys@fail{animation attribute #1}%
+ \else%
+ \pgf@sys@temp%
+ \fi%
+}
+
+
+% The non-transforming animations
+\def\pgfsys@svg@animatenone{}
+\def\pgfsys@svg@animateopacity{\pgf@sys@svg@anim{attributeName="opacity"}{}{\pgfsys@anim@ba@opacity}}
+\def\pgfsys@svg@animatefillopacity{\pgf@sys@svg@anim{attributeName="fill-opacity"}{}{\pgfsys@anim@ba@fillopacity}}
+\def\pgfsys@svg@animatestrokeopacity{\pgf@sys@svg@anim{attributeName="stroke-opacity"}{}{\pgfsys@anim@ba@strokeopacity}}
+\def\pgfsys@svg@animatevisibility{\pgf@sys@svg@anim{attributeName="visibility"}{}{\pgfsys@anim@ba@visibility}}
+\def\pgfsys@svg@animatelinewidth{\pgf@sys@svg@anim{attributeName="stroke-width"}{}{\pgfsys@anim@ba@strokewidth}}
+\def\pgfsys@svg@animatecolor{\pgf@sys@svg@anim{attributeName="fill"}{}{\pgfsys@anim@ba@fill}\pgf@sys@svg@anim{attributeName="stroke"}{}{\pgfsys@anim@ba@stroke}}
+\def\pgfsys@svg@animatefillcolor{\pgf@sys@svg@anim{attributeName="fill"}{}{\pgfsys@anim@ba@fill}}
+\def\pgfsys@svg@animatestrokecolor{\pgf@sys@svg@anim{attributeName="stroke"}{}{\pgfsys@anim@ba@stroke}}
+\def\pgfsys@svg@animateviewbox{\pgf@sys@svg@anim{attributeName="viewBox"}{}{\pgfsys@anim@ba@viewBox}}
+\def\pgfsys@svg@animatepath{\pgf@sys@svg@anim@path}
+\def\pgfsys@svg@animatesyncbase{{\pgf@sys@svg@is@sync@basetrue\pgf@sys@svg@anim{}{}{}}}
+\def\pgfsys@svg@animatedash{%
+ \pgf@svg@anim@prep@dash{\pgfsys@anim@val@base}{\pgfsys@anim@val@base@array}{\pgfsys@anim@val@base@offset}%
+ \let\pgfsys@anim@val@base\pgfsys@anim@val@base@array%
+ \pgf@sys@svg@anim{attributeName="stroke-dasharray"}{%
+ \pgf@svg@anim@prep@dash{\pgfsys@anim@val@from}{\pgfsys@anim@val@from@array}{\pgfsys@anim@val@from@offset}%
+ \pgf@svg@anim@prep@dash{\pgfsys@anim@val@to}{\pgfsys@anim@val@to@array}{\pgfsys@anim@val@to@offset}%
+ \pgf@svg@anim@prep@dash{\pgfsys@anim@val@values}{\pgfsys@anim@val@values@array}{\pgfsys@anim@val@values@offset}%
+ \let\pgfsys@anim@val@from\pgfsys@anim@val@from@array%
+ \let\pgfsys@anim@val@to\pgfsys@anim@val@to@array%
+ \let\pgfsys@anim@val@values\pgfsys@anim@val@values@array%
+ }{\pgfsys@anim@ba@strokedasharray}%
+ \let\pgfsys@anim@val@base\pgfsys@anim@val@base@offset%
+ \pgf@sys@svg@anim{attributeName="stroke-dashoffset"}{%
+ \pgf@svg@anim@prep@dash{\pgfsys@anim@val@from}{\pgfsys@anim@val@from@array}{\pgfsys@anim@val@from@offset}%
+ \pgf@svg@anim@prep@dash{\pgfsys@anim@val@to}{\pgfsys@anim@val@to@array}{\pgfsys@anim@val@to@offset}%
+ \pgf@svg@anim@prep@dash{\pgfsys@anim@val@values}{\pgfsys@anim@val@values@array}{\pgfsys@anim@val@values@offset}%
+ \let\pgfsys@anim@val@from\pgfsys@anim@val@from@offset%
+ \let\pgfsys@anim@val@to\pgfsys@anim@val@to@offset%
+ \let\pgfsys@anim@val@values\pgfsys@anim@val@values@offset%
+ }{\pgfsys@anim@ba@strokedashoffset}%
+}
+
+% The transforming animations
+\def\pgfsys@svg@animatetranslate{\pgf@sys@svg@anim@trans{animateTransform attributeName="transform" type="translate"}{}{translate}}
+\def\pgfsys@svg@animatescale{\pgf@sys@svg@anim@trans{animateTransform attributeName="transform" type="scale"}{}{scale}}
+\def\pgfsys@svg@animaterotate{\pgf@sys@svg@anim@trans{animateTransform attributeName="transform" type="rotate"}{}{rotate}}
+\def\pgfsys@svg@animateskewx{\pgf@sys@svg@anim@trans{animateTransform attributeName="transform" type="skewX"}{}{skewX}}
+\def\pgfsys@svg@animateskewy{\pgf@sys@svg@anim@trans{animateTransform attributeName="transform" type="skewY"}{}{skewY}}
+\def\pgfsys@svg@animatemotion{\pgf@sys@svg@anim@trans{animateMotion}{%
+ \let\pgfsys@anim@val@base\pgfutil@empty%
+ \let\pgfsys@anim@val@keyPoints\pgfsys@anim@val@values%
+ \let\pgfsys@anim@val@values\pgfutil@empty%
+ \ifx\pgfsys@anim@val@keyTimes\pgfutil@empty%
+ \let\pgfsys@anim@val@keyPoints\pgfutil@empty%
+ \fi%
+ }{}}
+
+% The keys
+\def\pgfsys@animation@whom#1#2{%
+ % Animations must "look forward"...
+ \pgfsys@if@fresh@id{#1}{#2}{}{\pgferror{Animations must precede the to-be-animated objects (``whom'')}}%
+ \pgf@sys@svg@replace{@id}{#1}%
+ \pgf@sys@svg@replace{@type}{#2}%
+ \pgf@sys@svg@replace{xlink:href}{\#\pgfsys@id@ref{#1}{#2}}%
+ \pgf@sys@svg@replace{idref}{\pgfsys@id@ref{#1}{#2}}%
+}
+\def\pgfsys@animation@restart@always{\pgf@sys@svg@replace{restart}{always}}
+\def\pgfsys@animation@restart@never{\pgf@sys@svg@replace{restart}{never}}
+\def\pgfsys@animation@restart@whennotactive{\pgf@sys@svg@replace{restart}{whenNotActive}}
+\def\pgfsys@animation@repeat@indefinite{\pgf@sys@svg@replace{repeatCount}{indefinite}}
+\def\pgfsys@animation@repeat#1{\pgf@sys@svg@replace{repeatCount}{#1}}
+\def\pgfsys@animation@repeat@dur#1{\pgf@sys@svg@replace{repeatDur}{#1}}
+\def\pgfsys@animation@freezeatend{\pgf@sys@svg@replace{fill}{freeze}}
+\def\pgfsys@animation@removeatend{\pgf@sys@svg@replace{fill}{remove}}
+\def\pgfsys@animation@canvas@transform#1#2{\def\pgfsys@anim@val@canvas@trans{{#1}{#2}}}
+\def\pgfsys@animation@offset#1#2{\pgfsys@animation@event{}{}{}{#1}{#2}}
+\def\pgfsys@animation@event#1#2#3#4#5{%
+ \expandafter\edef\csname pgf@sys@event@list@#5\endcsname{\csname pgf@sys@event@list@#5\endcsname{#1}{#2}{#3}{#4}}%
+}%
+\def\pgf@sys@event@list@begin{}
+\def\pgf@sys@event@list@end{}
+\def\pgfsys@animation@syncbegin#1#2#3#4{\pgfsys@animation@event{#1}{#2}{begin}{#3}{#4}}
+\def\pgfsys@animation@syncend#1#2#3#4{\pgfsys@animation@event{#1}{#2}{end}{#3}{#4}}
+\def\pgfsys@animation@repeat@event#1#2#3#4#5{\pgfsys@animation@event{#1}{#2}{repeat(#3)}{#4}{#5}}
+\def\pgfsys@animation@accesskey#1#2#3{\pgfsys@animation@event{}{}{accessKey(#1)}{#2}{#3}}
+%\def\pgfsys@animation@sum{\pgf@sys@svg@replace{additive}{sum}}
+%\def\pgfsys@animation@replace{\pgf@sys@svg@replace{additive}{replace}}
+\def\pgfsys@animation@accumulate{\pgf@sys@svg@replace{accumulate}{sum}}
+\def\pgfsys@animation@noaccumulate{\pgf@sys@svg@replace{accumulate}{}}
+\def\pgfsys@animation@rotatealong{\pgf@sys@svg@replace{rotate}{auto}}
+\def\pgfsys@animation@norotatealong{\pgf@sys@svg@replace{rotate}{}}
+\def\pgfsys@animation@movealong#1{%
+ {%
+ \let\pgf@sys@save@svgpath=\pgf@sys@svgpath%
+ \global\let\pgf@sys@svgpath=\pgfutil@empty%
+ \pgfsyssoftpath@getcurrentpath\pgf@sys@save@path%
+ \pgfsyssoftpath@setcurrentpath\pgfutil@empty%
+ #1%
+ \pgfsyssoftpath@invokecurrentpath%
+ \pgfsyssoftpath@setcurrentpath\pgf@sys@save@path%
+ \global\let\pgf@svg@anim@temp\pgf@sys@svgpath%
+ \global\let\pgf@sys@svgpath\pgf@sys@save@svgpath%
+ }%
+ \pgf@sys@svg@replace{path}{\pgf@svg@anim@temp}%
+}
+\def\pgfsys@animation@tip@markers#1#2{%
+ \edef\pgf@svg@anim@marker@start{#1}%
+ \edef\pgf@svg@anim@marker@end{#2}%
+}
+\let\pgf@svg@anim@marker@start\pgfutil@empty
+\let\pgf@svg@anim@marker@end\pgfutil@empty
+
+
+
+% Timelines
+\let\pgf@sys@svg@tl@entries\pgfutil@empty
+\let\pgf@sys@svg@tl@start\pgfutil@empty
+\let\pgf@sys@svg@tl@end\pgfutil@empty
+
+
+\def\pgfsys@animation@time#1#2#3#4#5{%
+ \def\pgf@sys@svg@t{#1}%
+ \let\pgf@sys@last@out@spline\pgf@sys@svg@out@spline%
+ \def\pgf@sys@svg@in@spline{{#2}{#3}}%
+ \def\pgf@sys@svg@out@spline{{#4}{#5}}%
+}
+\def\pgfsys@animation@base{%
+ \let\pgf@sys@svg@t\pgf@sys@svg@base@text%
+}
+\def\pgf@sys@svg@base@text{base}
+
+\def\pgf@sys@svg@entry#1{%
+ \ifx\pgf@sys@svg@t\pgf@sys@svg@base@text%
+ % Ah, base. Save!
+ \edef\pgfsys@anim@val@base{#1}%
+ \else%
+ \ifx\pgf@sys@svg@tl@start\pgfutil@empty%
+ % Ah, first.
+ \let\pgf@sys@svg@tl@start\pgf@sys@svg@t%
+ \edef\pgf@sys@svg@tl@entries{%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@svg@t}%
+ \noexpand\pgf@sys@svg@add@value{#1}%
+ }%
+ \else%
+ \ifx\pgf@sys@last@out@spline\pgfsys@stay@text%
+ \ifx\pgf@sys@svg@in@spline\pgfsys@jump@text%
+ {%
+ \pgf@x\pgf@sys@svg@t pt
+ \pgf@xa\pgf@sys@svg@tl@end pt%
+ \advance\pgf@x by\pgf@xa%
+ \pgf@x.5\pgf@x%
+ \edef\pgf@sys@temp{\pgf@sys@tonumber\pgf@x}
+ \expandafter}\expandafter\def\expandafter\pgf@sys@temp\expandafter{\pgf@sys@temp}%
+ \edef\pgf@sys@svg@temp{%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@temp}%
+ \noexpand\pgf@sys@svg@add@spline{0}{0}{1}{1}%
+ \noexpand\pgf@sys@svg@add@value{\pgf@sys@svg@last@value}%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@temp}%
+ \noexpand\pgf@sys@svg@add@spline{0}{0}{1}{1}%
+ \noexpand\pgf@sys@svg@add@value{#1}%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@svg@t}%
+ \noexpand\pgf@sys@svg@add@spline{0}{0}{1}{1}%
+ \noexpand\pgf@sys@svg@add@value{#1}%
+ }%
+ \else
+ \edef\pgf@sys@svg@temp{%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@svg@t}%
+ \noexpand\pgf@sys@svg@add@spline{0}{0}{1}{1}%
+ \noexpand\pgf@sys@svg@add@value{\pgf@sys@svg@last@value}%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@svg@t}%
+ \noexpand\pgf@sys@svg@add@spline{0}{0}{1}{1}%
+ \noexpand\pgf@sys@svg@add@value{#1}%
+ }%
+ \fi%
+ \else%
+ \ifx\pgf@sys@svg@in@spline\pgfsys@jump@text%
+ \edef\pgf@sys@svg@temp{%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@svg@tl@end}%
+ \noexpand\pgf@sys@svg@add@spline{0}{0}{1}{1}%
+ \noexpand\pgf@sys@svg@add@value{#1}%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@svg@t}%
+ \noexpand\pgf@sys@svg@add@spline{0}{0}{1}{1}%
+ \noexpand\pgf@sys@svg@add@value{#1}%
+ }%
+ \else%
+ \edef\pgf@sys@svg@temp{%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@svg@t}%
+ \noexpand\pgf@sys@svg@add@spline\pgf@sys@last@out@spline\pgf@sys@svg@in@spline%
+ \noexpand\pgf@sys@svg@add@value{#1}%
+ }%
+ \fi%
+ \fi%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgf@sys@svg@tl@entries%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@sys@svg@tl@entries\pgf@sys@svg@temp}%
+ \fi%
+ \let\pgf@sys@svg@tl@end\pgf@sys@svg@t%
+ \edef\pgf@sys@svg@last@value{#1}%
+ \fi%
+}
+\newif\ifpgf@sys@svg@do@times
+\def\pgf@sys@svg@tl@eval{%
+ \pgf@xa=0pt%
+ % Overrulings
+ \pgf@sys@svg@do@timestrue%
+ % Ok, we need to compute the time interval
+ \ifx\pgf@sys@svg@tl@end\pgfutil@empty%
+ \else%
+ \ifx\pgf@sys@svg@tl@start\pgfutil@empty\else\pgf@xa=\pgf@sys@svg@tl@start pt\fi%
+ \pgf@xb=\pgf@sys@svg@tl@end pt%
+ \advance\pgf@xb by -\pgf@xa%
+ % Ok, \pgf@xb is now the duration.
+ \ifdim\pgf@xb>0pt\relax%
+ \pgf@sys@svg@replace{dur}{\pgf@sys@tonumber\pgf@xb}%
+ \else%
+ \pgf@sys@svg@replace{dur}{\pgf@sys@svg@indefinitetext}%
+ \fi%
+ % Now, prepare factors
+ \pgf@xc=8192pt%
+ \ifdim\pgf@xb<0.0001pt\relax
+ \pgf@xc=1pt%
+ \pgf@xb=1sp%
+ \else%
+ \divide\pgf@xc by\pgf@xb%
+ \multiply\pgf@xb by\pgf@xc%
+ \divide\pgf@xb by65536%
+ \fi%
+ % Now, run!
+ \pgf@sys@svg@tl@entries%
+ \ifx\pgfsys@anim@val@dur\pgf@sys@svg@indefinitetext%
+ \let\pgfsys@anim@val@from\pgfsys@anim@val@to%
+ \let\pgfsys@anim@val@keyTimes\pgfutil@empty%
+ \let\pgfsys@anim@val@calcMode\pgfutil@empty%
+ \fi%
+ \fi%
+}
+\def\pgf@sys@svg@indefinitetext{indefinite}
+\def\pgf@sys@svg@add@time#1{%
+ \ifpgf@sys@svg@do@times%
+ % Compute fraction:
+ \pgf@yb=#1pt%
+ \advance\pgf@yb by-\pgf@xa%
+ \multiply\pgf@yb by\pgf@xc%
+ \divide\pgf@yb by\pgf@xb%
+ \ifdim\pgf@yb<0pt\pgf@yb=0pt\fi%
+ \ifdim\pgf@yb>1pt\pgf@yb=1pt\fi%
+ \pgf@sys@svg@append{keyTimes}{\pgf@sys@tonumber\pgf@yb}%
+ \fi%
+}
+\def\pgf@sys@svg@add@spline#1#2#3#4{\ifpgf@sys@svg@do@times\pgf@sys@svg@append{keySplines}{#1 #2 #3 #4}\fi}
+\def\pgf@sys@svg@add@value#1{%
+ \ifx\pgfsys@anim@val@values\pgfutil@empty%
+ \ifx\pgfsys@anim@val@to\pgfutil@empty%
+ \pgf@sys@svg@replace{to}{#1}%
+ \else% move
+ \let\pgfsys@anim@val@values\pgfsys@anim@val@to%
+ \let\pgfsys@anim@val@to\pgfutil@empty%
+ \pgf@sys@svg@append{values}{#1}%
+ \fi%
+ \else%
+ \pgf@sys@svg@append{values}{#1}%
+ \fi%
+}
+\def\pgfsys@animation@val@current{\pgf@sys@svg@entry{}}
+\def\pgfsys@animation@val{\pgf@sys@svg@entry{nil}} % will be ignored anyway
+\def\pgfsys@animation@val@text#1{\pgf@sys@svg@entry{#1}}
+\def\pgfsys@animation@val@scalar#1{\pgf@sys@svg@entry{#1}}
+\def\pgfsys@animation@val@dimension#1{%
+ {%
+ \pgf@x=#1\relax%
+ \xdef\pgf@svg@anim@temp{\expandafter\Pgf@geT\the\pgf@x}%
+ }%
+ \pgf@sys@svg@entry{\pgf@svg@anim@temp}%
+}
+\def\pgfsys@animation@val@color@rgb#1#2#3{\pgf@sys@svg@color@rgb#1,#2,#3\relax\pgf@sys@svg@entry{\pgf@sys@svg@prepared}}
+\def\pgfsys@animation@val@color@cmyk#1#2#3#4{\pgf@sys@svg@color@cmyk#1,#2,#3,#4\relax\pgf@sys@svg@entry{\pgf@sys@svg@prepared}}
+\def\pgfsys@animation@val@color@cmy#1#2#3{\pgf@sys@svg@color@cmy#1,#2,#3\relax\pgf@sys@svg@entry{\pgf@sys@svg@prepared}}
+\def\pgfsys@animation@val@color@gray#1{\pgf@sys@svg@color@gray#1\relax\pgf@sys@svg@entry{\pgf@sys@svg@prepared}}
+\def\pgfsys@animation@val@path#1{%
+ {%
+ \let\pgf@sys@save@svgpath=\pgf@sys@svgpath%
+ \global\let\pgf@sys@svgpath=\pgfutil@empty%
+ \pgfsyssoftpath@getcurrentpath\pgf@sys@save@path%
+ \pgfsyssoftpath@setcurrentpath\pgfutil@empty%
+ #1%
+ \pgfsyssoftpath@invokecurrentpath%
+ \pgfsyssoftpath@setcurrentpath\pgf@sys@save@path%
+ \global\let\pgf@svg@anim@temp\pgf@sys@svgpath%
+ \global\let\pgf@sys@svgpath\pgf@sys@save@svgpath%
+ }%
+ \pgf@sys@svg@entry{\pgf@svg@anim@temp}%
+}
+\def\pgfsys@animation@val@translate#1#2{%
+ {%
+ \pgf@x=#1\relax%
+ \pgf@y=#2\relax%
+ \xdef\pgf@svg@anim@temp{\expandafter\Pgf@geT\the\pgf@x,\expandafter\Pgf@geT\the\pgf@y}%
+ }%
+ \pgf@sys@svg@entry{\pgf@svg@anim@temp}%
+}
+\def\pgfsys@animation@val@scale#1#2{\pgf@sys@svg@entry{#1,#2}}
+\def\pgfsys@animation@val@viewbox#1#2#3#4{%
+ {%
+ \pgf@x=#1\relax%
+ \pgf@y=#2\relax%
+ \pgf@xa=#3\relax%
+ \pgf@ya=#4\relax%
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ \xdef\pgf@svg@anim@temp{\expandafter\Pgf@geT\the\pgf@x\space\expandafter\Pgf@geT\the\pgf@y\space\expandafter\Pgf@geT\the\pgf@xa\space\expandafter\Pgf@geT\the\pgf@ya}%
+ }%
+ \pgf@sys@svg@entry{\pgf@svg@anim@temp}%
+}
+\def\pgfsys@animation@val@dash#1#2{%
+ \edef\pgf@test@dashpattern{#1}%
+ \let\pgf@sys@svg@parsed@dash\pgfutil@empty%
+ \ifx\pgf@test@dashpattern\pgfutil@empty%
+ \else%
+ \expandafter\pgf@sys@svg@parse@dash\pgf@test@dashpattern,\relax%
+ \fi%
+ {%
+ \pgf@x=#2\relax%
+ \xdef\pgf@svg@anim@temp{\expandafter\Pgf@geT\the\pgf@x}%
+ }%
+ \pgf@sys@svg@entry{{\pgf@sys@svg@parsed@dash}{\pgf@svg@anim@temp}}%
+}
+
+
+
+\def\pgf@svg@anim@prep@dash#1#2#3{%
+ \let\pgf@svg@anim@dash@array\pgfutil@empty%
+ \let\pgf@svg@anim@dash@offset\pgfutil@empty%
+ % #1 = \pgfsys@anim@val@from or \pgfsys@anim@val@to or \pgfsys@anim@val@values
+ \ifx#1\pgfutil@empty%
+ \else%
+ \expandafter\pgf@svg@anim@prep@dash@parse#1\pgf@stop%
+ \fi%
+ \let#2\pgf@svg@anim@dash@array%
+ \let#3\pgf@svg@anim@dash@offset%
+}
+
+\def\pgf@svg@anim@prep@dash@parse#1#2{%
+ \expandafter\def\expandafter\pgf@svg@anim@dash@array\expandafter{\pgf@svg@anim@dash@array#1}%
+ \expandafter\def\expandafter\pgf@svg@anim@dash@offset\expandafter{\pgf@svg@anim@dash@offset#2}%
+ \pgfutil@ifnextchar;{%
+ \expandafter\def\expandafter\pgf@svg@anim@dash@array\expandafter{\pgf@svg@anim@dash@array;}%
+ \expandafter\def\expandafter\pgf@svg@anim@dash@offset\expandafter{\pgf@svg@anim@dash@offset;}%
+ \expandafter\pgf@svg@anim@prep@dash@parse\pgfutil@gobble%
+ }{%
+ \pgfutil@gobble% done, gobble \pgf@stop
+ }%
+}
+
%
-% Opacity masks
+% Markers
%
-% \def\pgfsys@fadingfrombox#1#2{%
-% \setbox#2=\hbox{%
-% \pgfsys@invoke{<mask id="pgfmask#1">}%
-% \box#2%
-% \pgfsys@invoke{</mask>}%
-% }%
-% \wd#2=0pt%
-% \ht#2=0pt%
-% \dp#2=0pt%
-% \unskip\box#2%
-% }
-% \def\pgfsys@usefading#1#2#3#4#5#6#7{%
-% \pgf@sys@svg@gs@color{mask="url(\#pgfmask#1)"}%
-% }
+
+\def\pgfsys@marker@declare@{%
+ \pgfsysprotocol@setcurrentprotocol\pgfutil@empty%
+ \pgfsys@beginscope@{ id="pgfs\the\pgf@sys@id@count"}%
+ \pgfsysprotocol@literal{\csname pgf@sys@marker@prot@\the\pgf@sys@id@count\endcsname}%
+ \pgfsys@endscope%
+ \pgfsysprotocol@getcurrentprotocol\pgfsys@temp%
+ \pgf@sys@svg@make@defs{pgfs\the\pgf@sys@id@count}{\pgfsys@temp}%
+}
+
+\def\pgfsys@marker@use#1{%
+ \pgf@sys@svg@ref@defs{pgfs#1}%
+ \pgfsysprotocol@literal{<use xlink:href="\#pgfs#1"/>}%
+}
+
+\def\pgfsys@marker@at@begin@usedpath#1{\def\pgf@sys@svg@marker@begin{#1}\let\pgf@sys@svg@marker@begin@use\pgfutil@empty}
+\def\pgfsys@marker@at@end@usedpath#1{\def\pgf@sys@svg@marker@end{#1}\let\pgf@sys@svg@marker@begin@use\pgfutil@empty}
+
+\let\pgf@sys@svg@marker@begin\relax
+\let\pgf@sys@svg@marker@end\relax
+
+\let\pgf@sys@svg@marker@begin@use\pgfutil@empty
+\let\pgf@sys@svg@marker@end@use\pgfutil@empty
+
+\def\pgf@sys@svg@prep@marker#1#2#3#4#5{%
+ \pgf@sys@svg@ref@defs{pgfs#1}%
+ \global\advance\pgf@sys@svg@objectcount by1\relax%
+ \edef\pgf@sys@svg@marker@id{pgf\the\pgf@sys@svg@objectcount}%
+ \pgfsysprotocol@literal{<marker id="\pgf@sys@svg@marker@id" markerUnits="userSpaceOnUse" orient="auto" overflow="visible">
+ <use xlink:href="\#pgfs#1"#2/> </marker>\pgfsys@svg@newline}%
+ \edef#3{marker-#4="url(\#\pgf@sys@svg@marker@id)" }%
+}
+
+
+%
+% RDF
+%
+
+\def\pgf@svg@rdf@init{%
+ \ifx\pgfsys@svg@rdf\pgfutil@empty%
+ % Ok, first, so init
+ \global\let\pgf@svg@rdf@vocab\relax%
+ \global\let\pgf@svg@rdf@about\relax%
+ \global\let\pgf@svg@rdf@content\relax%
+ \global\let\pgf@svg@rdf@datatype\relax%
+ \global\let\pgf@svg@rdf@href\relax%
+ \global\let\pgf@svg@rdf@inlist\relax%
+ \global\let\pgf@svg@rdf@prefix\relax%
+ \global\let\pgf@svg@rdf@property\relax%
+ \global\let\pgf@svg@rdf@rel\relax%
+ \global\let\pgf@svg@rdf@resource\relax%
+ \global\let\pgf@svg@rdf@rev\relax%
+ \global\let\pgf@svg@rdf@src\relax%
+ \global\let\pgf@svg@rdf@typeof\relax%
+ \global\let\pgfsys@svg@rdf\pgfsys@svg@rdf@initial%
+ \fi%
+}
+\def\pgfsys@svg@rdf@initial{%
+ \ifx\pgf@svg@rdf@vocab\relax\else\space vocab="\pgf@svg@rdf@vocab"\fi%
+ \ifx\pgf@svg@rdf@about\relax\else\space about="\pgf@svg@rdf@about"\fi%
+ \ifx\pgf@svg@rdf@datatype\relax\else\space datatype="\pgf@svg@rdf@datatype"\fi%
+ \ifx\pgf@svg@rdf@href\relax\else\space href="\pgf@svg@rdf@href"\fi%
+ \ifx\pgf@svg@rdf@inlist\relax\else\space inlist="\pgf@svg@rdf@inlist"\fi%
+ \ifx\pgf@svg@rdf@prefix\relax\else\space prefix="\pgf@svg@rdf@prefix"\fi%
+ \ifx\pgf@svg@rdf@property\relax\else\space property="\pgf@svg@rdf@property"\fi%
+ \ifx\pgf@svg@rdf@rel\relax\else\space rel="\pgf@svg@rdf@rel"\fi%
+ \ifx\pgf@svg@rdf@resource\relax\else\space resource="\pgf@svg@rdf@resource"\fi%
+ \ifx\pgf@svg@rdf@rev\relax\else\space rev="\pgf@svg@rdf@rev"\fi%
+ \ifx\pgf@svg@rdf@src\relax\else\space src="\pgf@svg@rdf@src"\fi%
+ \ifx\pgf@svg@rdf@typeof\relax\else\space typeof="\pgf@svg@rdf@typeof"\fi%
+ \ifx\pgf@svg@rdf@content\relax\else\space content="\pgf@svg@rdf@content"\fi%
+}
+
+\def\pgfsys@rdf@about#1{\pgf@svg@rdf@init\gdef\pgf@svg@rdf@about{#1}}
+\def\pgfsys@rdf@content#1{\pgf@svg@rdf@init\gdef\pgf@svg@rdf@content{#1}}
+\def\pgfsys@rdf@datatype#1{\pgf@svg@rdf@init\gdef\pgf@svg@rdf@datatype{#1}}
+\def\pgfsys@rdf@href#1{\pgf@svg@rdf@init\gdef\pgf@svg@rdf@href{#1}}
+\def\pgfsys@rdf@inlist{\pgf@svg@rdf@init\let\pgf@svg@rdf@inlist\pgfutil@empty}
+\def\pgfsys@rdf@prefix#1{\pgf@svg@rdf@init%
+ \ifx\pgf@svg@rdf@prefix\relax%
+ \gdef\pgf@svg@rdf@prefix{#1}
+ \else%
+ \expandafter\gdef\expandafter\pgf@svg@rdf@prefix\expandafter{\pgf@svg@rdf@prefix\space#1}%
+ \fi}
+\def\pgfsys@rdf@property#1{\pgf@svg@rdf@init%
+ \ifx\pgf@svg@rdf@property\relax%
+ \gdef\pgf@svg@rdf@property{#1}
+ \else%
+ \expandafter\gdef\expandafter\pgf@svg@rdf@property\expandafter{\pgf@svg@rdf@property\space#1}%
+ \fi}
+\def\pgfsys@rdf@rel#1{\pgf@svg@rdf@init%
+ \ifx\pgf@svg@rdf@rel\relax%
+ \gdef\pgf@svg@rdf@rel{#1}
+ \else%
+ \expandafter\gdef\expandafter\pgf@svg@rdf@rel\expandafter{\pgf@svg@rdf@rel\space#1}%
+ \fi}
+\def\pgfsys@rdf@rev#1{\pgf@svg@rdf@init%
+ \ifx\pgf@svg@rdf@rev\relax%
+ \gdef\pgf@svg@rdf@rev{#1}
+ \else%
+ \expandafter\gdef\expandafter\pgf@svg@rdf@rev\expandafter{\pgf@svg@rdf@rev\space#1}%
+ \fi}
+\def\pgfsys@rdf@typeof#1{\pgf@svg@rdf@init%
+ \ifx\pgf@svg@rdf@typeof\relax%
+ \gdef\pgf@svg@rdf@typeof{#1}
+ \else%
+ \expandafter\gdef\expandafter\pgf@svg@rdf@typeof\expandafter{\pgf@svg@rdf@typeof\space#1}%
+ \fi}
+\def\pgfsys@rdf@resource#1{\pgf@svg@rdf@init\gdef\pgf@svg@rdf@resource{#1}}
+\def\pgfsys@rdf@src#1{\pgf@svg@rdf@init\gdef\pgf@svg@rdf@src{#1}}
+\def\pgfsys@rdf@vocab#1{\pgf@svg@rdf@init\gdef\pgf@svg@rdf@vocab{#1}}
+
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvi.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvi.def
index 05f647fc796..20ba5f0fdc7 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvi.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvi.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-dvi.def,v 1.5 2007/06/07 07:41:11 tantau Exp $
+\ProvidesFileRCS{pgfsys-dvi.def}
% Driver commands for pure, ultra-portable dvi, in the tradition of
% old-style LaTeX pictures.
@@ -164,10 +164,12 @@
% Text:
\def\pgfsys@hbox#1{%
+ \pgfsys@begin@idscope%
\wd#1=0pt%
\ht#1=0pt%
\dp#1=0pt%
\pgf@sys@dvi@put{\pgf@sys@dvi@pt@x}{\pgf@sys@dvi@pt@y}{\box#1}%
+ \pgfsys@end@idscope%
}
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 54cd937a591..cb545f2b66f 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.22 2014/07/09 14:01:22 cfeuersaenger Exp $
+\ProvidesFileRCS{pgfsys-dvipdfm.def}
% Driver commands for dvipdfm
@@ -21,6 +21,62 @@
% dvipdfm-specific stuff:
%
+\def\pgfsys@hbox#1{%
+ \pgfsys@begin@idscope%
+ \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
+ \pgfsys@invoke{0 Tr}%
+ \pgfsys@invoke{0 J [] 0 d}% reset line cap and dash
+ \wd#1=0pt%
+ \ht#1=0pt%
+ \dp#1=0pt%
+ \box#1
+ \pgfsys@invoke{n Q Q}%
+ \pgfsys@end@idscope%
+}
+\def\pgfsys@hboxsynced#1{%
+ {%
+ \pgfsys@begin@idscope%
+ \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
+ \pgfsys@invoke{0 J [] 0 d}% reset line cap and dash
+ \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%
+ \pgfsys@end@idscope%
+ }%
+}
+
+\def\pgfsys@beginpicture{%
+ \pgfsys@invoke{3 Tr}%
+ \hbox to 0pt{\pgfutil@font@normalfont\pgfutil@selectfont.\hss}% enforce font change
+ \pgfsys@invoke{0 Tr}%
+ \special{pdf: content q}}
+\def\pgfsys@endpicture{%
+ \pgfsys@invoke{n Q}%
+}
+
\def\pgfsys@invoke#1{\special{pdf: content Q #1 q}} % ugly, but necessary...
\def\pgfsys@papersize#1#2{%
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 cf1d5b9fe1e..beadfff3bf1 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.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-dvipdfmx.def,v 1.14 2014/07/09 14:01:22 cfeuersaenger Exp $
+\ProvidesFileRCS{pgfsys-dvipdfmx.def}
% Driver commands for dvipdfmx
%
@@ -64,6 +64,7 @@
}
\def\pgfsys@hbox#1{%
+ \pgfsys@begin@idscope%
\pgfsys@beginscope%
\setbox#1=\hbox{\box#1}%
\wd#1=0pt%
@@ -76,11 +77,13 @@
\pgfsys@dvipdfmx@stop@force@reset@color%
\pgfsys@dvipdfmx@unsuspendcontent%
\pgfsys@endscope%
+ \pgfsys@end@idscope%
}
% 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@begin@idscope%
\pgfsys@beginscope%
\setbox#1=\hbox{\box#1}%
\wd#1=0pt%
@@ -98,6 +101,7 @@
\pgfsys@dvipdfmx@stop@force@reset@color%
\pgfsys@dvipdfmx@unsuspendcontent%
\pgfsys@endscope%
+ \pgfsys@end@idscope%
}
% All text materials between `pdf:bcontent' and `pdf:econtent' are
@@ -469,11 +473,9 @@
%
% Position tracking (needs pdftex >= 1.40.0-alpha-20051205 in dvi mode)
%
-\ifx\pdftexversion\@undefined
+\ifx\pdfsavepos\@undefined
\else
- \ifnum\pdftexversion>139
- \pgf@sys@pdf@dvi@tracker
- \fi
+ \pgf@sys@pdf@dvi@tracker
\fi
\def\pgfsys@papersize#1#2{%
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 c3a2b6200f8..b349b07e2f3 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def
@@ -7,11 +7,11 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvips.def,v 1.25 2014/07/09 14:01:22 cfeuersaenger Exp $
+\ProvidesFileRCS{pgfsys-dvips.def}
% Driver commands for dvips
-\def\pgfsys@invoke#1{\special{ps:: #1}}
+\def\pgfsys@invoke#1{\special{ps\ifpgfsys@ps@boxmode\else:\fi: #1}}
\def\pgfsys@outerinvoke#1{\special{ps: #1}}
\def\pgf@sys@postscript@header#1{\pgfutil@insertatbegincurrentpage{\special{! #1}}}
\def\pgf@sys@postscript@object#1{\special{! #1}}
@@ -27,9 +27,10 @@
% dvips-specific stuff:
%
-\def\pgfsys@beginpicture{\special{ps: }\special{ps::[begin]}\pgfsys@invoke{pgfo}}
+\def\pgfsys@beginpicture{\pgfsys@ps@boxmodefalse\special{ps: }\special{ps::[begin]}\pgfsys@invoke{pgfo}}
\def\pgfsys@endpicture{\pgfsys@invoke{pgfc}\special{ps::[end]}}
\def\pgfsys@hbox#1{%
+ \pgfsys@begin@idscope%
\pgfsys@invoke{pgfs}%
\special{ps::[end]}%
\wd#1=0pt%
@@ -38,6 +39,7 @@
\box#1
\special{ps::[begin]}%
\pgfsys@invoke{pgfr}%
+ \pgfsys@end@idscope%
}
\def\pgfsys@begininvisible{%
\special{ps::[begin]}%
@@ -96,17 +98,30 @@
%
-% Position tracking (needs pdftex >= 1.40 in dvi mode)
+% Position tracking (needs pdftex or luatex in dvi mode)
%
-\ifx\pdftexversion\@undefined
+\ifx\savepos\@undefined
+ \ifx\pdfsavepos\@undefined
+ \else
+ \let\pgf@savepos\pdfsavepos
+ \let\pgf@lastxpos\pdflastxpos
+ \let\pgf@lastypos\pdflastypos
+ \fi
+\else
+ \let\pgf@savepos\savepos
+ \let\pgf@lastxpos\lastxpos
+ \let\pgf@lastypos\lastypos
+\fi
+
+
+\ifx\pgf@savepos\@undefined
\else
- \ifnum\pdftexversion>139
\def\pgfsys@markposition#1{%
- \pdfsavepos%
+ \pgf@savepos%
\edef\pgf@temp{#1}%
\expandafter\pgfutil@writetoaux\expandafter{%
- \expandafter\noexpand\expandafter\pgfsyspdfmark\expandafter{\pgf@temp}{\the\pdflastxpos}{\the\pdflastypos}}%
+ \expandafter\noexpand\expandafter\pgfsyspdfmark\expandafter{\pgf@temp}{\the\pgf@lastxpos}{\the\pgf@lastypos}}%
}
\def\pgfsyspdfmark#1#2#3{%
@@ -121,7 +136,6 @@
\def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfpointorigin}
- \fi
\fi
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvisvgm.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvisvgm.def
index 6225c5abc21..3acef85b177 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvisvgm.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvisvgm.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-dvisvgm.def,v 1.3 2013/08/23 09:50:22 tantau Exp $
+\ProvidesFileRCS{pgfsys-dvisvgm.def}
% Driver commands for dvisvgm
@@ -17,12 +17,23 @@
%
\input pgfsys-common-svg.def
+\newif\ifpgf@sys@svg@inpicture
+
+\def\pgf@sys@svg@make@defs#1#2{{\let\#\pgf@sys@svg@hash\special{dvisvgm:rawset #1}\special{dvisvgm:rawdef #2}\special{dvisvgm:endrawset}}}
+\def\pgf@sys@svg@ref@defs#1{\special{dvisvgm:rawput #1}}
\def\pgfsys@invoke#1{{\let\#\pgf@sys@svg@hash\special{dvisvgm:raw #1}}}
-\def\pgfsys@beginpicture{\pgfsys@invoke{<g transform="translate({?x},{?y}) scale(1,-1)">}}
-\def\pgfsys@endpicture{\pgfsys@invoke{</g>}}
+\def\pgfsys@beginpicture{%
+ \special{color push gray 0}% make dvisvgm *not* add anything to text
+ \pgf@sys@svg@inpicturetrue% in a picture
+ \pgfsys@svg@boxmodefalse%
+ \pgfsys@invoke{<g \ifx\pgf@sys@svg@last@stroke\relax\else
+ stroke="\pgf@sys@svg@last@stroke" \fi stroke-miterlimit="10" transform="translate({?x},{?y})scale(0.996264,-0.996264)">}}
+\def\pgfsys@endpicture{\pgfsys@invoke{</g>}\special{color pop}}
\def\pgfsys@svg@newline{{?nl}}
+\let\pgf@sys@svg@last@stroke\relax%
+
\def\pgfsys@hbox#1{%
{%
@@ -30,11 +41,28 @@
\wd#1=0pt%
\ht#1=0pt%
\dp#1=0pt%
- \pgfsetcolor{.}%
- \pgfsys@invoke{<g stroke="none" transform="scale(-1,1) translate({?x},{?y}) scale(-1,-1)">}\box#1\pgfsys@invoke{</g>}%
+ \pgfsys@begin@idscope%
+ \pgfsys@invoke{<g stroke="none" transform="scale(-1.00375,1.00375)translate({?x},{?y})scale(-1,-1)">}\box#1\pgfsys@invoke{</g>}%
+ \pgfsys@end@idscope%
}%
}
+\def\pgfsys@hboxsynced#1{%
+ {%
+ \setbox#1=\hbox{\box#1}%
+ \wd#1=0pt%
+ \ht#1=0pt%
+ \dp#1=0pt%
+ \pgfsys@begin@idscope%
+ \pgfsys@beginscope%
+ \pgflowlevelsynccm%
+ \pgfsys@invoke{<g stroke="none" transform="scale(-1.00375,1.00375)translate({?x},{?y})scale(-1,-1)">}\box#1\pgfsys@invoke{</g>}%
+ \pgfsys@endscope%
+ \pgfsys@end@idscope%
+ }%
+}
+
+
\def\pgfsys@shadingoutsidepgfpicture#1{%
\begingroup%
#1%
@@ -70,6 +98,117 @@
\pgfsysprotocol@literal{</g>}%
}
+
+
+\def\pgfsys@papersize#1#2{%
+ {%
+ \pgf@x#1\relax%
+ \pgf@y#2\relax%
+ \pgf@xa-1in\relax%
+ \special{dvisvgm:bbox fix \pgf@sys@tonumber\pgf@xa\space \pgf@sys@tonumber\pgf@xa\space \pgf@sys@tonumber\pgf@x\space \pgf@sys@tonumber\pgf@y}%
+ }%
+}
+\def\pgfsys@prepare@papersize#1#2{%
+ \expandafter\gdef\expandafter\pgfsys@atbegindocument\expandafter{\pgfsys@atbegindocument\pgfsys@papersize{#1}{#2}}%
+}
+
+
+
+\def\pgfsys@typesetpicturebox#1{%
+ \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%
+ \pgf@xa=\pgf@trimleft@final\relax \ifdim\pgf@xa=0pt \else\kern\pgf@xa\fi%
+ \raise-\pgf@ya\hbox{\ifpgf@sys@svg@inpicture\else\special{dvisvgm:bbox \pgf@sys@tonumber\pgf@picmaxx\space\pgf@sys@tonumber\pgf@picmaxy}\fi\box#1}%
+ \pgf@xa=\pgf@trimright@final\relax \ifdim\pgf@xa=0pt \else\kern\pgf@xa\fi%
+}
+
+
+
+\def\pgfsys@text@to@black@hook{%
+ \let\pgfsys@svg@set@color@orig\set@color%
+ \let\pgfsys@svg@reset@color@orig\reset@color%
+ \def\set@color{\special{dvisvgm:raw <g fill="black">}\pgfsys@svg@set@color@orig}%
+ \def\reset@color{\special{dvisvgm:raw </g>}\pgfsys@svg@reset@color@orig}%
+}
+
+
+
+% Fadings
+
+% FIXME: Correct sizes!
+
+%
+% Opacity masks
+%
+% \def\pgfsys@fadingfrombox#1#2{%
+% \setbox#2=\hbox{%
+% \pgfsys@invoke{<mask id="pgfmask#1">}%
+% \box#2%
+% \pgfsys@invoke{</mask>}%
+% }%
+% \wd#2=0pt%
+% \ht#2=0pt%
+% \dp#2=0pt%
+% \unskip\box#2%
+% }
+% \def\pgfsys@usefading#1#2#3#4#5#6#7{%
+% \pgf@sys@svg@gs@color{mask="url(\#pgfmask#1)"}%
+% }
+
+
+
+
+%
+% Position tracking (needs pdftex or luatex in dvi mode)
+%
+\ifx\savepos\@undefined
+ \ifx\pdfsavepos\@undefined
+ \else
+ \let\pgf@savepos\pdfsavepos
+ \let\pgf@lastxpos\pdflastxpos
+ \let\pgf@lastypos\pdflastypos
+ \fi
+\else
+ \let\pgf@savepos\savepos
+ \let\pgf@lastxpos\lastxpos
+ \let\pgf@lastypos\lastypos
+\fi
+
+
+\ifx\pgf@savepos\@undefined
+\else
+
+\def\pgfsys@markposition#1{%
+ \pgf@savepos%
+ \edef\pgf@temp{#1}%
+ \expandafter\pgfutil@writetoaux\expandafter{%
+ \expandafter\noexpand\expandafter\pgfsyspdfmark\expandafter{\pgf@temp}{\the\pgf@lastxpos}{\the\pgf@lastypos}}%
+}
+
+\def\pgfsyspdfmark#1#2#3{%
+ \expandafter\gdef\csname pgf@sys@pdf@mark@pos@#1\endcsname{\pgfqpoint{#2sp}{#3sp}}%
+ \pgfutil@check@rerun{#1}{{#2}{#3}}%
+}
+
+\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}
+
+\fi
+
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def
index e01c0007da8..24fad51a342 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def
@@ -1,12 +1,5 @@
% Copyright 2006 by Till Tantau
%
-% pgfsys-luatex.def
-% converted from pgfsys-pdftex.def by replacing disappeared primitives/vars
-% with their respective replacements, as laid out in the luatex manual.
-% Conversion by Norbert Preining
-%
-% Included into the TeX Live pgf package with agreement of Till Tantau.
-%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
@@ -14,8 +7,13 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-luatex.def,v 1.35 2014/10/11 09:23:31 vibrovski Exp $
+\ProvidesFileRCS{pgfsys-luatex.def}
+\ifnum\luatexversion<95
+ \immediate\write-1{luatex driver of PGF: detected lua version \the\luatexversion; falling back to old pdftex driver^^J}%
+ \input pgfsys-pdftex.def
+ \expandafter\endinput
+\fi
% Driver commands for pdf
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 0cc939675f6..f6498264735 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.35 2014/10/11 09:23:31 vibrovski Exp $
+\ProvidesFileRCS{pgfsys-pdftex.def}
% Driver commands for pdf
@@ -25,6 +25,7 @@
% Synced hboxes
\def\pgfsys@hboxsynced#1{%
{%
+ \pgfsys@begin@idscope%
\pgfsys@beginscope%
\setbox\pgf@hbox=\hbox{%
\hskip\pgf@pt@x%
@@ -40,6 +41,7 @@
\dp\pgf@hbox=0pt%
\box\pgf@hbox%
\pgfsys@endscope%
+ \pgfsys@end@idscope%
}%
}
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 cc5dadb1173..751ab7e6fa7 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.25 2013/08/06 17:46:08 tantau Exp $
+\ProvidesFileRCS{pgfsys-tex4ht.def}
@@ -86,12 +86,13 @@
% class="}{\%s}{-\%s}{x-x-\%d}{}{">}{</span>}
%}
-\def\pgfsys@svg@newline{\Hnewline}
+\def\pgfsys@svg@newline{^^J}
% 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
+ \pgfsys@svg@boxmodefalse%
+ \EndP\HtmlParOff%
\pgfkeys{/pgf/tex4ht node/escape=false}%
% text only nodes are the default. Advantage : pure svg pictures are
% the default, nicer for text only nodes.
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-textures.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-textures.def
index 0645fb8c51f..033d949baac 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-textures.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-textures.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-textures.def,v 1.6 2011/05/13 10:16:37 tantau Exp $
+\ProvidesFileRCS{pgfsys-textures.def}
% Driver commands for textures driver
@@ -36,12 +36,14 @@
\special{rawpostscript pgfbeginpicture}}
\def\pgfsys@endpicture{\special{rawpostscript restore}}
\def\pgfsys@hbox#1{%
+ \pgfsys@begin@idscope%
\pgfsys@invoke{save pgfbeginhbox}%
\wd#1=0pt%
\ht#1=0pt%
\dp#1=0pt%
\box#1%
\pgfsys@invoke{restore}%
+ \pgfsys@end@idscope%
}
\def\pgfsys@begininvisible{%
\special{rawpostscript gsave nulldevice}%
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-vtex.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-vtex.def
index 5014f48beba..e5e9b1d5df9 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-vtex.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-vtex.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-vtex.def,v 1.10 2013/07/15 12:05:34 tantau Exp $
+\ProvidesFileRCS{pgfsys-vtex.def}
% Driver commands for vtex
@@ -15,8 +15,8 @@
% Invoking things:
\def\pgfsys@invoke#1{\special{pS: grestore #1 gsave}} % to protect against things happeing in between
\def\pgfsys@outerinvoke#1{\special{pS: #1}}
-\def\pgf@sys@postscript@header#1{\special{pS: #1}}
-\def\pgf@sys@postscript@object#1{\special{pS: #1}}
+\def\pgf@sys@postscript@header#1{\immediate\special{pS: #1}}
+\def\pgf@sys@postscript@object#1{\immediate\special{pS: #1}}
%
@@ -81,7 +81,7 @@
\AtBeginDocument{
% Always present specials.
- \special{pS:
+ \immediate\special{pS:
/pgfsc{} bind def% stroke color is empty by default
/pgffc{} bind def% fill color is empty by default
/pgfstr{stroke} bind def%
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 e23e48c2f57..a4a49c1faab 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.11 2014/07/09 14:01:22 cfeuersaenger Exp $
+\ProvidesFileRCS{pgfsys-xetex.def}
\input pgfsys-dvipdfmx.def
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 e33a132c29b..393a7860608 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.48 2014/07/09 14:01:22 cfeuersaenger Exp $
+\ProvidesPackageRCS{pgfsys.code.tex}
% Load key mechanism
@@ -17,7 +17,7 @@
\pgfkeys{/pgf/.is family}
\def\pgfset{\pgfqkeys{/pgf}}
-% This is if is needed *very* early
+% This if is needed *very* early
\newif\ifpgfpicture
@@ -93,12 +93,6 @@
-% The following \if decides, whether even-odd filling and clipping is
-% to be used or normal the non-zero winding number rule. See the
-% pdf-documentation for details on what these rules are.
-
-\newif\ifpgfsys@eorule
-
% In the following dummy definitions of the pgf system commands are
@@ -128,6 +122,10 @@
+%
+% Invocation commands
+%
+
\def\pgfsys@invoke{\pgf@sys@fail{invoking specials}}
% This command is used whenever some literal text needs to be inserted
% into the resulting .pdf, .ps, or .dvi file. Note that most
@@ -141,7 +139,6 @@
% been called previously and when the picture has not been suspended
% using \pgfsys@beginhbox.
-
\def\pgfsys@outerinvoke{\pgfsys@invoke}
% This command can be used to insert protocolled graphic commands
% outside any picture. This is extremely dangerous, but sometimes
@@ -319,6 +316,14 @@
% should subsequently be used for clipping. See \pgfsys@clipnext for
% details.
+\def\pgfsys@closestroke{\pgfsys@closepath\pgfsys@stroke}
+% This command should have the same effect as first closing the path
+% and then stroking it.
+
+\newif\ifpgfsys@eorule
+% Decides, whether even-odd filling and clipping is
+% to be used or normal the non-zero winding number rule. See the
+% pdf-documentation for details on what these rules are.
@@ -329,7 +334,8 @@
%
%
\def\pgfsys@setlinewidth#1{\pgf@sys@fail{setting the line width}}
-% Sets the width of lines, when stroked, to #1.
+% Sets the width of lines, when stroked, to #1, which must be a TeX
+% dimension (as text).
\def\pgfsys@buttcap{\pgf@sys@fail{setting the line cap}}
% Sets the cap to a butt cap. See \pgfsys@stroke.
@@ -355,19 +361,19 @@
\def\pgfsys@setdash#1#2{\pgf@sys@fail{setting the dashing pattern}}
% Sets the dashing patter. #1 should be a list of lengths separated by
-% spaces. #2 should be a single dimension.
+% commas. #2 should be a single dimension.
%
% The list of values in #1 is used to determine the lengths of the
% `on' phases of the dashing and of the `off' phases. For example, if
-% #1 is `3pt 4pt', then the dashing pattern is `3pt on followed by 4pt
+% #1 is `3pt,4pt', then the dashing pattern is `3pt on followed by 4pt
% off, followed by 3pt on, followed by 4pt off, and so on'. A pattern
-% of `.5pt 4pt 3pt 1.5pt' means `.5pt on, 4pt off, 3pt on, 1.5pt off, .5pt on,
+% of `.5pt,4pt,3pt,1.5pt' means `.5pt on, 4pt off, 3pt on, 1.5pt off, .5pt on,
% ...'. If the number of entries is odd, the last one is used twice,
% so `3pt' means `3pt on, 3pt off, 3pt on, 3pt off,...'. An empty list
% means `always on'.
%
% The second argument determines the `phase' of the pattern. For
-% example, for a pattern of `3pt 4pt' and a phase of `1pt', the pattern
+% example, for a pattern of `3pt,4pt' and a phase of `1pt', the pattern
% would start: `2pt on, 4pt off, 3pt on, 4pt off, 3pt on, 4pt off...'.
@@ -456,6 +462,11 @@
% tricked. When called, this command should set the current color to
% #1 without causing any change in the color stack.
+\def\pgfsys@text@to@black@hook{}
+% Another slightly obscure command that allows tikz to hack into
+% dvisvgm's color management inside text nodes. The problem is that
+% the color "black" is special for dvisvgm.
+
%
@@ -470,6 +481,66 @@
% transformation matrix is a transformation on a homogeneous
% 2D-coordinate system. See the pdf or postscript manual for details.
+\def\pgfsys@transformshift#1#2{\pgfsys@transformcm{1}{0}{0}{1}{#1}{#2}}
+% This command will change the origin of the low-level coordinate
+% system to (#1,#2).
+
+\def\pgfsys@transformxyscale#1#2{\pgfsys@transformcm{#1}{0}{0}{#2}{0bp}{0bp}}
+% This command will scale the low-level coordinate system (and
+% everything that is drawn) by a factor of #1 in x-directed and #2 in
+% y-direction. Note that this applies to everything, including
+% lines. So a scaled line will have a different width and may even
+% have a different width when going along the x-axis and when going
+% along the y-axis, if the scaling is different in these directions.
+
+\def\pgfsys@viewboxmeet#1#2#3#4#5#6#7#8{\pgfsys@beginscope\pgf@sys@default@viewbox@impl{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{<}}
+% Consider the two rectangles R with lower left corner
+% (#5,#6) and upper right (#7,#8) and S with lower left corner
+% (#1,#2) and upper right (#3,#4). Now, consider the transformation
+% that scales and translates R so that the result T has the same
+% center as S and has maximal size while still being inside S. This
+% transformation gets installed in a new graphics group, which must be
+% ended with a corresponding \pgfsys@endviewbox.
+
+\def\pgfsys@viewboxslice#1#2#3#4#5#6#7#8{\pgfsys@beginscope\pgf@sys@default@viewbox@impl{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{>}}
+% Works like \pgfsys@viewboxmeet, but R3 will have minimal size so
+% that in contains all of R2.
+
+\def\pgfsys@endviewbox{\pgfsys@endscope}
+% Ends a viewbox scope started by either of the previous two commands.
+
+
+\def\pgf@sys@default@viewbox@impl#1#2#3#4#5#6#7#8#9{{%
+ \pgf@x#1%
+ \pgf@y#2%
+ \pgf@xa#3%
+ \pgf@ya#4%
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ \pgfmathdivide@\pgf@xa\pgf@ya%
+ \let\aspectr\pgfmathresult%
+ \pgf@xb#5%
+ \pgf@yb#6%
+ \pgf@xc#7%
+ \pgf@yc#8%
+ \advance\pgf@xc by-\pgf@xb%
+ \advance\pgf@yc by-\pgf@yb%
+ \pgfmathdivide@\pgf@xc\pgf@yc%
+ \let\aspects\pgfmathresult%
+ \ifdim\aspectr pt#9\aspects pt%
+ \pgfmathdivide@\pgf@xa\pgf@xc%
+ \else%
+ \pgfmathdivide@\pgf@ya\pgf@yc%
+ \fi%
+ \advance\pgf@x by.5\pgf@xa%
+ \advance\pgf@xb by.5\pgf@xc%
+ \advance\pgf@y by.5\pgf@ya%
+ \advance\pgf@yb by.5\pgf@yc%
+ \pgfsys@transformcm{\pgfmathresult}{0}{0}{\pgfmathresult}{\pgf@x}{\pgf@y}%
+ \pgfsys@transformcm{1}{0}{0}{1}{-\pgf@xb}{-\pgf@yb}%
+ }%
+}
+
@@ -494,6 +565,218 @@
\def\pgfsys@endscope{\pgf@sys@fail{scoping}}
% Restores the last saved graphic state.
+\def\pgfsys@begin@idscope{%
+ \begingroup%
+ \edef\pgf@sys@cacheref{\pgfsys@id@refcurrent}%
+ \expandafter\let\expandafter\pgfsys@beg@save\csname pgf@sys@att@beg@\pgf@sys@cacheref\endcsname%
+ \expandafter\let\expandafter\pgfsys@end@save\csname pgf@sys@att@end@\pgf@sys@cacheref\endcsname%
+ \ifx\pgfsys@beg@save\relax%
+ \ifx\pgfsys@end@save\relax%
+ \else%
+ \pgfsys@call@save%
+ \fi%
+ \else%
+ \pgfsys@call@save%
+ \fi%
+ \pgfsys@invalidate@currentid%
+ \begingroup%
+}
+% Starts an "id scope" where the current value of \pgfsys@use@id and
+% \pgfsys@use@type is used. If the combination has been used before,
+% nothing happens. Otherwise, depending of the driver, a graphic
+% scope may or may not be created. To ensure that a graphic scope is
+% created, use \pgfsys@beginscope additionally.
+
+\def\pgfsys@call@save{%
+ \pgfsys@beginscope%
+ \pgfsys@beg@save%
+ \expandafter\global\expandafter\let\csname pgf@sys@att@beg@\pgfsys@id@refcurrent\endcsname\relax%
+ \expandafter\global\expandafter\let\csname pgf@sys@att@end@\pgfsys@id@refcurrent\endcsname\relax%
+}
+
+\def\pgfsys@end@idscope{
+ \endgroup%
+ \ifx\pgfsys@beg@save\relax%
+ \ifx\pgfsys@end@save\relax%
+ \else%
+ \pgfsys@call@end%
+ \fi%
+ \else%
+ \pgfsys@call@end%
+ \fi%
+ \endgroup
+}
+% Ends an id scope.
+
+\def\pgfsys@call@end{%
+ \pgfsys@end@save%
+ \pgfsys@endscope%
+}
+
+
+\def\pgfsys@begin@text{}
+% Inside a text box you should not use graphics command. However, TikZ
+% needs to insert some color commands at the beginnings of text
+% boxes. For most drivers, this is not a problem; except for SVG,
+% where every change of the graphics state opens a scope and needs a
+% closing scope. This command should be used at the beginning of text
+% boxes containing such color commands and the matching
+% \pgfsys@end@text at the end. If the box does not contain commands
+% that change the graphics state, this command is not needed.
+
+\def\pgfsys@end@text{}
+% Closes a \pgfsys@begin@text.
+
+
+
+%
+%
+% Id management (all of these commands have a default implementation
+% any typically need not be redefined by a driver)
+%
+%
+
+% The id count
+\newcount\pgf@sys@id@count
+
+\def\pgfsys@new@id#1{%
+ \edef#1{pgf\the\pgf@sys@id@count}%
+ \global\advance\pgf@sys@id@count by1\relax%
+}
+% Creates a new id and stores it in the macro #1.
+
+\def\pgfsys@use@id#1{%
+ \edef\pgf@sys@id@current@id{#1}%
+ \let\pgfsys@current@type\pgfutil@empty%
+}
+\let\pgf@sys@id@current@id\pgfutil@empty
+% Sets the id to be used for the next graphic object (group, box, or
+% path). The type is reset to be empty. #1 must be a macro name that
+% has previously been set using \pgfsys@new@id.
+%
+% Each combination of id and type can be used only once, on a second
+% use nothing happens.
+
+\def\pgfsys@clear@id{%
+ \let\pgf@sys@id@current@id\pgfutil@empty%
+}
+% Clears the current id, so nothing can be referenced.
+
+\def\pgfsys@use@type#1{%
+ \edef\pgfsys@current@type{#1}%
+ \pgfsys@register@type\pgfsys@current@type%
+}
+\let\pgfsys@current@type\pgfutil@empty
+% Sets the type to be used for the next graphic object.
+
+\def\pgfsys@append@type#1{%
+ \ifx\pgfsys@current@type\pgfutil@empty%
+ \pgfsys@use@type{#1}%
+ \else%
+ \pgfsys@use@type{\pgfsys@current@type.#1}%
+ \fi%
+}
+% Appends something to the current type
+
+\def\pgfsys@register@type#1{%
+ \expandafter\let\expandafter\pgf@sys@temp\csname pgf@sys@reg@type@#1\endcsname%
+ \ifx\pgf@sys@temp\relax%
+ {%
+ \c@pgf@counta\pgf@sys@type@count\relax%
+ \global\advance\c@pgf@counta by1\relax%
+ \edef\pgf@sys@type@count{\the\c@pgf@counta}%
+ \expandafter\xdef\csname pgf@sys@reg@type@#1\endcsname{y\the\c@pgf@counta}%
+ }%
+ \fi%
+}
+% Registers a type with the system. Must be called before any use of
+% the type
+\def\pgf@sys@reg@type@{}
+\def\pgf@sys@reg@type@background{b}
+\def\pgf@sys@reg@type@path{p}
+\def\pgf@sys@reg@type@text{t}
+\expandafter\def\csname pgf@sys@reg@type@background.path\endcsname{bp}
+\def\pgf@sys@type@count{0}
+
+\def\pgfsys@push@type{%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@typestack%
+ \expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgfsys@current@type%
+ \expandafter\expandafter\expandafter{\expandafter\pgfsys@current@type\expandafter}%
+ \expandafter\def\expandafter\pgf@sys@typestack\expandafter{\pgf@sys@typestack}}%
+}
+\let\pgf@sys@typestack\pgfutil@empty
+% Pushes the current type onto a global stack. This is useful for
+% temporarily changing the type without creating \TeX scopes.
+
+\def\pgfsys@pop@type{\pgf@sys@typestack}
+% Pops the last id from the stack.
+
+\def\pgfsys@id@ref#1#2{#1\csname pgf@sys@reg@type@#2\endcsname}
+% Expands to a text that can be inserted as a reference. #1 must be a
+% reference created \pgfsys@new@id, #2 must be a type that has been
+% registered using \pgfsys@id@register@type.
+
+\def\pgfsys@id@refcurrent{\pgfsys@id@ref{\pgf@sys@id@current@id}{\pgfsys@current@type}}
+% Expands to a text that can be inserted as a reference to the current
+% id-type pair in use.
+
+\def\pgfsys@invalidate@currentid{%
+ \expandafter\global\expandafter\let\csname pgf@sys@id@keylist@\pgfsys@id@refcurrent\endcsname\pgfutil@empty%
+}
+% Mark the current id-type pair as used.
+
+\def\pgfsys@attach@to@id#1#2#3#4{%
+ \pgfsys@register@type{#2}%
+ \expandafter\def\expandafter\pgf@sys@tempbeg\expandafter{\csname pgf@sys@att@beg@\pgfsys@id@ref{#1}{#2}\endcsname}%
+ \expandafter\def\expandafter\pgf@sys@tempend\expandafter{\csname pgf@sys@att@end@\pgfsys@id@ref{#1}{#2}\endcsname}%
+ \expandafter\ifx\pgf@sys@tempbeg\relax%
+ \expandafter\let\pgf@sys@tempbeg\pgfutil@empty%
+ \fi%
+ \expandafter\ifx\pgf@sys@tempend\relax%
+ \expandafter\let\pgf@sys@tempend\pgfutil@empty%
+ \fi%
+ \expandafter\let\expandafter\pgf@sys@tempbeg@cont\pgf@sys@tempbeg%
+ \expandafter\let\expandafter\pgf@sys@tempend@cont\pgf@sys@tempend%
+ \expandafter\expandafter\expandafter\gdef\expandafter\pgf@sys@tempbeg\expandafter{\pgf@sys@tempbeg@cont#3}%
+ \def\pgf@sys@temp{#4}%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\gdef\expandafter\expandafter\expandafter\pgf@sys@tempend\expandafter\expandafter\expandafter{\expandafter\pgf@sys@temp\pgf@sys@tempend@cont}%
+}
+% Attaches some code to an id-type pair so that when the id's scope
+% gets created, #3 is added at the beginning and #4 is added at the
+% end.
+
+\def\pgfsys@if@fresh@id#1#2#3#4{%
+ \edef\pgf@sys@temp{#1}%
+ \ifx\pgf@sys@temp\pgfutil@empty% empty id always counts as "has been used"
+ #4%
+ \else%
+ \pgfsys@register@type{#2}%
+ \expandafter\ifx\csname pgf@sys@id@keylist@\pgfsys@id@ref{#1}{#2}\endcsname\pgfutil@empty%
+ % has already been used!
+ #4%
+ \else%
+ #3%
+ \fi%
+ \fi%
+}
+% Checks whether a given id-type pair #1-#2 has not been used, yet. If
+% so, #3 is executed, otherwise #4.
+
+\def\pgfsys@if@fresh@currentid#1#2{%
+ \ifx\pgf@sys@id@current@id\pgfutil@empty% empty id always counts as "has been used"
+ #2%
+ \else%
+ \expandafter\ifx\csname pgf@sys@id@keylist@\pgfsys@id@refcurrent\endcsname\pgfutil@empty%
+ % has already been used!
+ #2%
+ \else%
+ #1%
+ \fi%
+ \fi%
+}
+% Checks whether the current id-type pair in use has not been used,
+% yet. If so, #1 is executed, otherwise #2.
+
@@ -515,6 +798,13 @@
%
%
+\def\pgfsys@opacity#1{\pgfsys@stroke@opacity{#1}\pgfsys@fill@opacity{#1}}
+% Ideally, this should sets the opacity of all operations, treating
+% the group as a transparency group with 1 meaning fully opaque, 0
+% meaning fully transparent. Since most drivers do not support this,
+% the fallback is to set the stroke and fill opacity at the same
+% time. This is not quite the same, however.
+
\def\pgfsys@stroke@opacity#1{\pgf@sys@fail{opacity}}
% Sets the opacity of stroking operations. 1 means fully opaque, 0
% means fully transparent.
@@ -659,6 +949,463 @@
% Sets an colored pattern #1 as filling color.
+
+
+
+%
+%
+% Animations
+%
+%
+
+
+\newif\ifpgfsysanimationsupported
+% Will be set to true by a driver when animations are supported. Note
+% that snapshots are always supported.
+
+
+\def\pgfsys@animate#1{\pgf@sys@fail{animations}}
+% Adds an animation of the attribute #1 to the current scope.
+% The configuration of the animation (like start times, etc.) is taken
+% from the current values of the animation keys, which are configured
+% using calls to \pgfsys@animation@..., which setup an animation
+% key for the local scope. This means that you typically setup these
+% keys in a scope and at the end of the scope call \pgfsys@animate.
+%
+% Some keys accumulate (like begin or keytime), most do not. In those
+% cases, the last call overrides the previous one.
+%
+% Not all value types make sense or are allowed, it depends on the
+% specific \pgfsys@animate call.
+%
+% Example:
+%
+% {
+% \pgfsys@animation@offset{10}{begin}%
+% \pgfsys@animation@event{}{click}{1}{begin}%
+% \pgfsys@animation@time{5}{1}{1}{0}{0}
+% \pgfsys@animation@val@scalar{1}
+% \pgfsys@animation@time{8}{1}{1}{0}{0}
+% \pgfsys@animation@val@scalar{0.5}
+% \pgfsys@animation@sum%
+% \pgfsys@animate{fillopacity}%
+% }
+%
+% When a driver does not support a specific attribute #1, it should
+% issue a \pgf@sys@fail. Typical attributes are things like "opacity"
+% or "linewidth" or "dash".
+%
+% The following values are permissible for "#1":
+%
+% "opacity" adds an animation of the opacity.
+% Type: scalar
+%
+% "fillopacity" adds an animation of the fill opacity.
+% Type: scalar
+%
+% "strokeopacity" adds an animation of the stroke opacity.
+% Type: scalar
+%
+% "visibility" adds an animation of the visiblity.
+% Type: text ("visible" or "hidden")
+%
+% "linewidth" adds an animation of the line width.
+% Type: dimension
+%
+% "dash" adds an animation of the dash.
+% Type: dash
+%
+% "translate" adds an animation of the transformation.
+% Type: translate
+%
+% "scale" adds an animation of the transformation.
+% Type: scale
+%
+% "rotate" adds an animation of the transformation.
+% Type: scalar
+%
+% "skewx" adds an animation of the transformation.
+% Type: scalar
+%
+% "skewy" adds an animation of the transformation.
+% Type: scalar
+%
+% "motion" adds a movement along a path.
+% Type: motion
+%
+% "strokecolor" adds an animation of the stroke color.
+% Type: color
+%
+% "fillcolor" adds an animation of the fill color.
+% Type: color
+%
+% "viewbox" adds an animation of the view box.
+% Type: view box
+%
+% "path" adds an animation of the path to the path specified by
+% \pgfsys@animation@whom
+% Type: path
+%
+% "syncbase" adds a sync base to the animation. A sync base does not animate
+% anything by itself, but other animations can begin and end relative
+% to it.
+%
+% "none" supresses the animation
+% Type: any
+
+
+
+
+% Animation timing :
+%
+% You specify an animation using a timeline. A timeline consists of a
+% sequence of times together with values for these times. The times
+% must be given in increasing order. You use the command
+% \pgfsys@animation@time to specify a time and
+% \pgfsys@animation@val@... to specify a value. The time must be
+% specfied first, the time--value is created when the value command is
+% used.
+%
+% Times are given in seconds (so 0.01 is one hundreth of a second).
+%
+% The animation's timeline will start with the first time mentioned
+% (not necessarily zero and not necessarily a positive value) and ends
+% with the last value. The duration is the difference between these
+% two values.
+
+\def\pgfsys@animation@restart@always{}
+% Specifies that the animation can always restart
+
+\def\pgfsys@animation@restart@never{}
+% Specifies that the animation should never restart
+
+\def\pgfsys@animation@restart@whennotactive{}
+% Specifies that the animation should only restart when it is not active
+
+\def\pgfsys@animation@repeat#1{}
+% #1 must be a number
+
+\def\pgfsys@animation@repeat@indefinite{}
+% Repeats forever
+
+\def\pgfsys@animation@repeat@dur#1{}
+% #1 must be a clock value
+
+\def\pgfsys@animation@freezeatend{}
+% Specifies that the last value of the animation remains in force at
+% the end
+
+\def\pgfsys@animation@removeatend{}
+% Specifies that the effect of the animation is removed at the end
+
+\def\pgfsys@animation@time#1#2#3#4#5{}
+% Specifies a time together with spline control points for the entry
+% and the exit to this time. The value #1 is a time in seconds (so 60
+% means 1 minute, 0.001 means one millisecond). The values #2 and #3
+% specify the control point of the spline *entering* the time point,
+% while the values #4 and #5 specify the control point of the spline
+% *leaving* the time point. They are all dimensionless values between
+% 0 and 1. For a linear animation, set the first two to 1 and the last
+% two to 0.
+%
+% Example:
+% \pgfsys@animation@time{5}{1}{1}{0.25}{0.1}
+% \pgfsys@animation@val@scalar{80}
+% \pgfsys@animation@time{8}{.75}{1}{0}{0}
+% \pgfsys@animation@val@scalar{90}
+%
+% In SVG, this will create the following entries:
+% begin = +5s
+% duration = 3s
+% keyTimes = 0;1
+% values = 80;90
+% keySpline = 0.25 0.1 0.75 1
+%
+% For the key spline, note that the entry spline controls of the first
+% time and the exit spline controls of the last point are dropped.
+%
+%
+% When the exit spline takes the special values #4="stay" and #5="0",
+% the attribute's value "stays" until the next value for the next time
+% (it "jumps" to the next value then). This corresponds, roughly, to
+% an "infinite" #4.
+%
+% Similarly, when the entry spline takes the special value #2="jump"
+% and #3="1", the value immediately jumps from the previous value to
+% the next value when the previous value was "created".
+
+\def\pgfsys@stay@text{{stay}{0}}
+\def\pgfsys@jump@text{{jump}{1}}
+
+\def\pgfsys@animation@base{}
+% Think of this command as setting the value of the attribute in the
+% timeline before the timeline starts. Normally, an animation only
+% influences the timeline while the animation is running (which may be
+% forever) and before and after the animation is running, the
+% attribute's value is not modified by the animation (so, it is just
+% inherited from the surrounding scope). When a base value is set,
+% while the animation is not running, this value is used. For most
+% attributes you can achieve the same effect by surrounding the
+% to-be-animated object by a scope and setting the value there, but
+% using bases is often more convenient and, for instance for the
+% visibility attribute, it is necessary to use a base.
+%
+% Note that when a backend driver does not support animations, base
+% values will not be depicted unless a snapshot is used explicitly.
+
+\def\pgfsys@animation@offset#1#2{}
+% #1 must be a value in seconds, #2 is the target "begin" or "end" to
+% which this offset is appended.
+
+\def\pgfsys@animation@syncbegin#1#2#3#4{}
+% #1 is the id of a sync base (obtained by
+% \pgfsys@new@id), #2 is the id type (or empty), #3 is an optional
+% offset, #4 is the target.
+
+\def\pgfsys@animation@syncend#1#2#3#4{}
+% Like the previous command.
+
+\def\pgfsys@animation@event#1#2#3#4#5{}
+% #1 is the optional id of another element (obtained by
+% \pgfsys@new@id), #2 is the optional type of the id, #3 is an event
+% name, #4 is an optional offset, #5 is the target.
+
+\def\pgfsys@animation@repeat@event#1#2#3#4#5{}
+% #1 is the optional id of another element, #2 is the type, #3 is a
+% repeat count, and #4 is an optional offset, #5 is the target.
+
+\def\pgfsys@animation@accesskey#1#2#3{}
+% #1 is a character, #2 is an optional offset, #3 is the target.
+
+\def\pgf@sys@begin@text{begin}
+
+
+% Accumulation
+
+\def\pgfsys@animation@accumulate{}
+% Corresponds to accumulate="sum" in SVG
+
+\def\pgfsys@animation@noaccumulate{}
+% Corresponds to accumulate="none" in SVG
+
+
+% Targeting
+
+\def\pgfsys@animation@whom#1#2{}
+% Sets the target of the animation. #1 must be an id previously
+% created using \pgfsys@new@id and #2 must be empty or a type
+% previously created using \pgfsys@new@id@type
+
+
+% Attribute definitions
+
+\def\pgfsys@animation@rotatealong{}
+% Applicable only to motion animations. Indicates that the
+% to-be-animated group should be rotated automatically so that it
+% points along the path as time progresses.
+
+\def\pgfsys@animation@norotatealong{}
+% Corresponds to rotate="0"
+
+\def\pgfsys@animation@movealong#1{}
+% Applicable only to motion animations. #1 is a softpath along which
+% the movement will be done.
+
+\def\pgfsys@animation@tip@markers#1#2{}
+% Applicable only to path animations. #1 and #2 are markers (declared
+% using \pgfsys@marker@declare) that store marker symbols to be added
+% at the start and at the end of the to-be-animated path. If empty, no
+% markers are added.
+
+\def\pgfsys@animation@canvas@transform#1#2{}
+% #1 is some code that may call \pgfsys@transformcm at most once. It
+% will be executed when a canvas transformation animation is
+% installed for a scope id. #2 is some further codes that may also
+% call \pgfsys@transformcm at most once. It will be installed right
+% after the animation.
+%
+% Typically, #1 is some pgf coordinate shift followed by
+% {\pgflowlevelsynccm} and #2 is \pgftransforminvert followed by
+% \pgflowlevelsynccm.
+
+
+
+% Values
+
+\def\pgfsys@animation@val@current{}
+% The current value of the attribute. At least with SVG, this can only
+% be used for the first value and, then, only if there is only one
+% other value.
+
+\def\pgfsys@animation@val@text#1{}
+% #1 should be some text.
+
+\def\pgfsys@animation@val@scalar#1{}
+% #1 should be a single value.
+
+\def\pgfsys@animation@val@dimension#1{}
+% #1 must be a dimension.
+
+\def\pgfsys@animation@val@color@rgb#1#2#3{}
+% #1,#2,#3 must be an rgb tuple
+
+\def\pgfsys@animation@val@color@cmyk#1#2#3#4{}
+% #1,#2,#3,#4 must be an cmyk tuple
+
+\def\pgfsys@animation@val@color@cmy#1#2#3{}
+% #1,#2,#3 must be an cmy tuple
+
+\def\pgfsys@animation@val@color@gray#1{}
+% #1 must be a gray value
+
+\def\pgfsys@animation@val@path#1{}
+% #1 must consist of path-construction tokens (as returned by the
+% softpath layer)
+
+\def\pgfsys@animation@val@translate#1#2{}
+% #1,#2 must be dimensions
+
+\def\pgfsys@animation@val@scale#1#2{}
+% #1,#2 must be dimensionless
+
+\def\pgfsys@animation@val@viewbox#1#2#3#4{}
+% #1,#2 describe the lower left, #3,#4 the upper right corner of the
+% view box.
+
+\def\pgfsys@animation@val@dash#1#2{}
+% #1,#2 have the syntax of \pgfsys@setdash.
+
+
+
+%
+%
+% Markers
+%
+%
+
+\def\pgfsys@marker@declare#1#2{%
+ {%
+ \pgfpicturetrue%
+ \pgfsysprotocol@getcurrentprotocol\pgfsys@marker@temp%
+ \pgfsysprotocol@setcurrentprotocol\pgfutil@empty%
+ \pgfsysprotocol@bufferedtrue%
+ \pgfsys@beginscope%
+ #2%
+ \pgfsys@endscope%
+ \xdef#1{\the\pgf@sys@id@count}%
+ \expandafter\expandafter\expandafter\global\expandafter\pgfsysprotocol@getcurrentprotocol\csname pgf@sys@marker@prot@#1\endcsname%
+ \pgfsys@marker@declare@% curtesy hook
+ \pgfsysprotocol@setcurrentprotocol\pgfsys@marker@temp%
+ \global\advance\pgf@sys@id@count by1\relax%
+ }%
+}
+\let\pgfsys@marker@declare@\relax
+% Declares a new marker symbol whose code is in #2. #1 should be a
+% macro name, which will be set to a unique
+% value by which the marker can be referenced later on. #2 should be
+% code that, when executed, produces recordable code.
+
+\def\pgfsys@marker@use#1{%
+ \pgfsysprotocol@literal{\csname pgf@sys@marker@prot@#1\endcsname}%
+}
+% Draws the marker symbol not at the end of a path, but simply with
+% the current transformation matrix
+
+
+
+
+
+
+%
+%
+% RDF
+%
+%
+
+\def\pgfsys@rdf@about#1{\pgf@sys@fail{rdf}}
+% Adds the rdf attribute "about" with value #1 to the next
+% idscope. The RDF-spec says: "a SafeCURIEorCURIEorIRI, used for
+% stating what the data is about (a 'subject' in RDF terminology);"
+
+\def\pgfsys@rdf@content#1{\pgf@sys@fail{rdf}}
+% Adds the rdf attribute content with value #1 to the next
+% idscope. The RDF-spec says: "a CDATA string, for supplying
+% machine-readable content for a literal (a 'literal object', in RDF
+% terminology);"
+
+\def\pgfsys@rdf@datatype#1{\pgf@sys@fail{rdf}}
+% Adds the rdf attribute datatype with value #1 to the next
+% idscope. The RDF-spec says: "a TERMorCURIEorAbsIRI representing a
+% datatype, to express the datatype of a literal;"
+
+\def\pgfsys@rdf@href#1{\pgf@sys@fail{rdf}}
+% Adds the rdf attribute href with value #1 to the next idscope
+% The RDF-spec says: "a traditionally navigable IRI for
+% expressing the partner resource of a relationship (a 'resource
+% object', in RDF terminology);"
+
+\def\pgfsys@rdf@inlist{\pgf@sys@fail{rdf}}
+% Adds the rdf attribute inlist to the next idscope. The
+% RDF-spec says: "An attribute used to indicate that the object
+% associated with a rel or property attribute on the same element is
+% to be added to the list for that predicate. The value of this
+% attribute must be ignored. Presence of this attribute causes a list
+% to be created if it does not already exist."
+
+\def\pgfsys@rdf@prefix#1{\pgf@sys@fail{rdf}}
+% Adds #1 to the list of the rdf prefix attribute to the next
+% idscope. Can be called several times, in which case all values of #1
+% are concatenated with whitespaces. The RDF-spec says: "a white space
+% separated list of prefix-name IRI pairs of the form NCName ':' ' '+
+% xsd:anyURI"
+
+\def\pgfsys@rdf@property#1{\pgf@sys@fail{rdf}}
+% Adds #1 to the list of the rdf property attribute to the next
+% idscope. Can be called repeatedly. The RDF-spec says: "a white space
+% separated list of TERMorCURIEorAbsIRIs, used for expressing
+% relationships between a subject and either a resource object if
+% given or some literal text (also a 'predicate');"
+
+\def\pgfsys@rdf@rel#1{\pgf@sys@fail{rdf}}
+% Adds #1 to the list of the rdf rel attribute to the next
+% next idscope. Can be called repeatedly. The
+% RDF-spec says: "a white space separated list of
+% TERMorCURIEorAbsIRIs, used for expressing relationships between two
+% resources ('predicates' in RDF terminology);"
+
+\def\pgfsys@rdf@resource#1{\pgf@sys@fail{rdf}}
+% Adds the rdf attribute resource with value #1 to the next idscope. The
+% RDF-spec says: "a SafeCURIEorCURIEorIRI for expressing the partner
+% resource of a relationship that is not intended to be navigable
+% (e.g., a 'clickable' link) (also an 'object');"
+
+\def\pgfsys@rdf@rev#1{\pgf@sys@fail{rdf}}
+% Adds #1 to the list of the rdf rev attribute to the next
+% idscope. Can be called repeatedly. The
+% RDF-spec says: "a white space separated list of
+% TERMorCURIEorAbsIRIs, used for expressing reverse relationships
+% between two resources (also 'predicates');
+
+\def\pgfsys@rdf@src#1{\pgf@sys@fail{rdf}}
+% Adds an rdf attribute src with value #1 to the next idscope. The
+% RDF-spec says: "an IRI for expressing the partner resource of a
+% relationship when the resource is embedded (also a 'resource
+% object');"
+
+\def\pgfsys@rdf@typeof#1{\pgf@sys@fail{rdf}}
+% Adds #1 to the list of the rdf typeof attribute to the next
+% idscope. Can be called repeatedly. The
+% RDF-spec says: "a white space separated list of TERMorCURIEorAbsIRIs
+% that indicate the RDF type(s) to associate with a subject;"
+
+\def\pgfsys@rdf@vocab#1{\pgf@sys@fail{rdf}}
+% Adds an rdf attribute vocab with value #1 to the next idscope. The
+% RDF-spec says: "an IRI that defines the mapping to use when a TERM
+% is referenced in an attribute value. See General Use of Terms in
+% Attributes and the section on Vocabulary Expansion."
+
+
+
%
%
% Page size stuff
@@ -765,27 +1512,8 @@
% This command has a default implementation.
-
-
-
-\def\pgfsys@closestroke{\pgfsys@closepath\pgfsys@stroke}
-% This command should have the same effect as first closing the path
-% and then stroking it.
-
-
-\def\pgfsys@transformshift#1#2{\pgfsys@transformcm{1}{0}{0}{1}{#1}{#2}}
-% This command will change the origin of the low-level coordinate
-% system to (#1,#2).
-
-\def\pgfsys@transformxyscale#1#2{\pgfsys@transformcm{#1}{0}{0}{#2}{0bp}{0bp}}
-% This command will scale the low-level coordinate system (and
-% everything that is drawn) by a factor of #1 in x-directed and #2 in
-% y-direction. Note that this applies to everything, including
-% lines. So a scaled line will have a different width and may even
-% have a different width when going along the x-axis and when going
-% along the y-axis, if the scaling is different in these directions.
-
\def\pgfsys@hbox#1{%
+ \pgfsys@begin@idscope%
\pgfsys@beginscope%
\setbox#1=\hbox{\box#1}%
\wd#1=0pt%
@@ -793,21 +1521,22 @@
\dp#1=0pt%
\box#1%
\pgfsys@endscope%
+ \pgfsys@end@idscope%
}
% Called to insert a TeX hbox into a pgfpicture.
\def\pgfsys@hboxsynced#1{%
- {\pgfsys@beginscope\pgflowlevelsynccm\pgfsys@hbox#1\pgfsys@endscope}%
-}
-% Called to insert a TeX hbox into a pgfpicture, but with the current
+ \pgfsys@beginscope\pgflowlevelsynccm\pgfsys@hbox#1\pgfsys@endscope%
+}%
+% Called to insert box #1 into a pgfpicture, but with the current
% coordinate transformation matrix synced with the canvas
-% transformation matrix.
+% transformation matrix and surrounded by a scope.
%
% In essence, this command does the same as if you first said
-% \pgflowlevelsynccm and then \pgfsys@hbox. However, a driver may
-% choose to use a ``TeX-translation'' for the translation part of the
+% \pgflowlevelsynccm and then \pgfsys@hbox#1. However, a
+% ``TeX-translation'' is used for the translation part of the
% transformation cm. This will ensure that hyperlinks ``survive'' at
-% least translations.
+% least translations.
\def\pgfsys@pictureboxsynced#1{%
{%
@@ -820,7 +1549,7 @@
% stream. However, the default implementation uses \pgfsys@hboxsynced
% in conjunction with \pgfsys@beginpicture to ensure that, if
% possible, hyperlinks survive in pdfs. Drivers that are sensitive to
-% picture-in-picture scopes shuold replace this implementation by
+% picture-in-picture scopes should replace this implementation by
% \pgfsys@beginscope\pgflowlevelsynccm\box#1\pgfsys@endscope
\def\pgfsys@beginpicture{}
@@ -917,6 +1646,7 @@
\def\pgfsys@defobject#1#2#3#4{%
\pgfsysprotocol@getcurrentprotocol\pgfsys@temp%
{%
+ \pgfpicturetrue%
\pgfsysprotocol@setcurrentprotocol\pgfutil@empty%
\pgfsysprotocol@bufferedtrue%
\pgfsys@beginscope%
@@ -957,12 +1687,19 @@
\def\pgfsys@begininvisible{\pgfsys@transformcm{1}{0}{0}{1}{2000bp}{2000bp}}
% Between this command and the closing endinvisible, all output should
% be suppressed. Nothing should be drawn at all, which includes all
-% paths, images and shadings.
+% paths, images and shadings. This command typically should not open a
+% graphic scope.
\def\pgfsys@endinvisible{\pgfsys@transformcm{1}{0}{0}{1}{-2000bp}{-2000bp}}
% Ends the invisibilty section, unless invisibility blocks have been
% nested. In this case, only the `last' one restores visibility.
+\def\pgfsys@begininvisiblescope{\pgfsys@beginscope\pgfsys@begininvisible}
+% Works like pgfsys@begininvisible, but it may open a graphics scope.
+
+\def\pgfsys@endinvisiblescope{\pgfsys@endinvisible\pgfsys@endscope}
+% Closes the invisibility scope.
+
\def\pgfsys@atbegindocument{}
% This command will be executed at the begin of the document. If for
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysanimations.code.tex b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysanimations.code.tex
new file mode 100644
index 00000000000..12862bee9db
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysanimations.code.tex
@@ -0,0 +1,2009 @@
+% Copyright 2016 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.
+
+
+
+% Guard against reading twice
+\ifx\pgfsysanimationsloaded\pgfutil@undefined
+ \let\pgfsysanimationsloaded=\relax
+\else
+ \expandafter\endinput
+\fi
+
+
+% We need some support:
+\usepgfmodule{decorations}
+
+
+% Animation abstraction layer
+%
+% This layer provides an abstraction of the
+% \pgfsys@anim... commands. The idea is to provide an interface that
+% can map animation commands either to "real" animations (for instance
+% in the sense of SVG) or to "snapshots" of animations, which are
+% especially useful for printing. For these snapshots, instead of
+% adding an animation property to a scope, the property is actually
+% set to a certain value computed by \TeX.
+%
+% For each \pgfsys@animation@... command there is a corresponding
+% \pgfsysanim command.
+
+
+% Set the current time to a snapshot time
+%
+% #1 = a global snapshot time (a dimensionless number, measured in
+% seconds).
+%
+% Description:
+%
+% When this command is used in a scope, instead of creating an
+% animation, pgf will insert appropriate commands that show the state
+% of the animation at the given time.
+%
+% The value #1 can be thought of as the "global time", which can be
+% thought of as the time that elapsed since the "onload" event.
+%
+% The command \pgfsysanimsnapshotafter works the same way as
+% pgfsysanimsnapshot, only the time #1 is interpreted as "global time
+% #1 + epsilon". This means that when two or mroe values are specified
+% for time #1, the last of them is used rather than the
+% first. Likewise, when a non-freezing timeline ends at time #1,
+% \pgfsysanimsnapshot will set the value to the last value in the
+% timeline, while \pgfsysanimsnapshotafter removes the animation.
+%
+% The following commands and effect for animations are ignored / not
+% implemented for snapshots (meaning that even if the "real" animation
+% would look in a certain way because of one of the following commands
+% or effects, the snapshot will not reflect this):
+%
+% - Events and restarts are ignored. For the snapshot, all animations
+% start at global time 0, except if the command
+% \pgfsysanimkeysnapshotstart is used to specify a different
+% start for a specific animation.
+% - The "current value" as starting value (pgf has no real chance of
+% determining the correct value of this). Using this with a snapshot
+% will raise an errer.
+%
+% Example:
+%
+% {
+% \pgfsyssnapshot{2}%
+% \pgfsysanimkeytime{0}{1}{1}{0}{0}
+% \pgfsysanimvalscalar{1}
+% \pgfsysanimkeytime{5}{1}{1}{0}{0}
+% \pgfsysanimvalscalar{0}
+% \pgfsysanimkeywhom{\someid}{}
+% \pgfsysanimate{fillopacity}%
+% % Will set the opacity of \someid to 0.6
+% }
+
+\def\pgfsysanimsnapshot#1{%
+ \def\pgfsysanim@snaptime{#1}%
+ \pgfsysanim@snap@firsttrue%
+ \pgfsysanim@is@snaptrue%
+}
+\def\pgfsysanimsnapshotafter#1{%
+ \def\pgfsysanim@snaptime{#1}%
+ \pgfsysanim@snap@firstfalse%
+ \pgfsysanim@is@snaptrue%
+}
+\newif\ifpgfsysanim@is@snap
+\newif\ifpgfsysanim@snap@first
+
+
+
+% Companion for \pgfsys@animate
+%
+% #1 = attribute
+%
+% Description:
+%
+% If not snapshot is set, \pgfsys@animate is simply called. Otherwise,
+% appropriate code is generated that sets the specified attribute of
+% the whom object to the value it would have during the animation at
+% the moment of the snapshot.
+
+\def\pgfsysanimate#1{%
+ \csname pgfsysanim@checks@#1\endcsname%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@do@snap{#1}%
+ \else%
+ \pgfsys@animate{#1}%
+ \fi%
+}
+
+\def\pgfsysanim@do@snap#1{%
+ {%
+ \expandafter\ifx\csname pgfsysanim@prep@attr@#1\endcsname\pgfutil@undefined%
+ \else%
+ % First, compute time frame:
+ \pgfsysanim@compute@interval%
+ % Second, compute code:
+ \let\pgfsysanim@code@begin\relax%
+ \let\pgfsysanim@code@end\pgfutil@empty%
+ \csname pgfsysanim@prep@attr@#1\endcsname%
+ \ifx\pgfsysanim@code@begin\relax%
+ \else%
+ % Attach to object:
+ \expandafter\expandafter\expandafter\pgfsysanim@call@attacher%
+ \expandafter\expandafter\expandafter{\expandafter\pgfsysanim@code@begin\expandafter}\expandafter{\pgfsysanim@code@end}{}%
+ \fi%
+ \fi%
+ }%
+}
+\def\pgfsysanim@call@attacher{\pgfsys@attach@to@id{\pgfsysanim@whom@id}{\pgfsysanim@whom@type}}
+
+
+% Do some checks:
+\def\pgfsysanim@checks@path{%
+ \expandafter\global\expandafter\let\csname pgfsysanim@path@is@animated@\pgfsysanim@whom@id @\pgfsysanim@whom@type\endcsname\pgfutil@empty%
+}
+
+
+% Companions for \pgfsys@animation@restart@...
+%
+% Description:
+%
+% These commands just call \pgfsys@animation@restart@... and they are
+% *ignored* when it comes to snapshots.
+
+\def\pgfsysanimkeyrestartalways{\pgfsys@animation@restart@always}
+\def\pgfsysanimkeyrestartnever{\pgfsys@animation@restart@never}
+\def\pgfsysanimkeyrestartwhennotactive{\pgfsys@animation@restart@whennotactive}
+
+
+
+% Companions for \pgfsys@animation@repeat...
+%
+% Description:
+%
+% These commands call \pgfsys@animation@repeat... and, if there is a
+% snapshot installed, the passed values are taken into consideration.
+
+\def\pgfsysanimkeyrepeat#1{%
+ \pgfsys@animation@repeat{#1}%
+ % Snapshot
+ \let\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@normal%
+ {%
+ \pgf@x#1pt\relax%
+ \expandafter}%
+ \expandafter\def\expandafter\pgfsysanim@snap@repeat@arg\expandafter{\the\pgf@x}%
+}
+\def\pgfsysanimkeyrepeatindefinite{%
+ \pgfsys@animation@repeat@indefinite%
+ % Snapshot
+ \let\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@indefinite%
+ \let\pgfsysanim@snap@repeat@arg\pgfutil@empty%
+}
+\def\pgfsysanimkeyrepeatdur#1{%
+ \pgfsys@animation@repeat@dur{#1}%
+ % Snapshot
+ \let\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@dur%
+ {%
+ \pgf@x#1pt\relax%
+ \expandafter}%
+ \expandafter\def\expandafter\pgfsysanim@snap@repeat@arg\expandafter{\the\pgf@x}%
+}
+\def\pgfsysanim@snap@repeat@none{n}%
+\def\pgfsysanim@snap@repeat@normal{m}%
+\def\pgfsysanim@snap@repeat@indefinite{i}%
+\def\pgfsysanim@snap@repeat@dur{d}%
+\let\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@none
+\let\pgfsysanim@snap@repeat@arg\pgfutil@empty
+
+
+
+% Companions for \pgfsys@animation@freezeatend and
+% \pgfsys@animation@removeatend
+%
+% Description:
+%
+% These commands call the two system commands and, if there is a
+% snapshot installed, the settings are taken into consideration.
+
+\def\pgfsysanimkeyfreezeatend{\pgfsys@animation@freezeatend\pgfsysanim@freezeatendtrue}
+\def\pgfsysanimkeyremoveatend{\pgfsys@animation@removeatend\pgfsysanim@freezeatendfalse}
+\newif\ifpgfsysanim@freezeatend
+
+
+
+% Companion for \pgfsys@animation@time
+%
+% #1 to #5 = as in \pgfsys@animation@time
+%
+% Description:
+%
+% Calls \pgfsys@animation@time. Furthermore, the specified times are
+% recorded so that they can later be analysed for the computation
+% needed for a snapshot.
+
+\def\pgfsysanimkeytime#1#2#3#4#5{%
+ % Setup animation
+ \pgfsys@animation@time{#1}{#2}{#3}{#4}{#5}%
+ % and rember for snapshots
+ \def\pgfsysanim@time{{#1}{#2}{#3}{#4}{#5}}%
+}
+
+
+% Sets the base value
+%
+% Description:
+%
+% This will set the "base" value for an animation, which is installed
+% prior to any animation of the attribute.
+
+\def\pgfsysanimkeybase{%
+ \pgfsys@animation@base%
+ \let\pgfsysanim@time\pgfsysanim@base@text%
+}
+\def\pgfsysanim@base@text{base}%
+
+% Sets the beginning of the timeline for snapshots
+%
+% #1 = a time (a scalar)
+%
+% Description:
+%
+% Sets the start of current animation to #1 for snapshots. For
+% instance, if #1 is 5 (=five seconds), and you say
+% \pgfsysanimsnapshot{6}, the attribute will be set to whatever the
+% animation specifies after one second.
+
+\def\pgfsysanimkeysnapshotstart#1{%
+ \def\pgfsysanim@snapshotstart{#1}%
+}
+\def\pgfsysanim@snapshotstart{0}
+
+
+% Companion for \pgfsys@animation@offset
+%
+% #1, #2 = as in \pgfsys@animation@offset
+%
+% Description:
+%
+% Calls \pgfsys@animation@offset.
+
+\def\pgfsysanimkeyoffset#1#2{%
+ \pgfsys@animation@offset{#1}{#2}%
+}
+
+
+% Companion for \pgfsys@animation@sync(begin|end)
+%
+% #1 to #4 = as in \pgfsys@animation@sync(begin|end)
+%
+% Description:
+%
+% Calls \pgfsys@animation@sync(begin|end).
+
+\def\pgfsysanimkeysyncbegin#1#2#3#4{%
+ \pgfsys@animation@syncbegin{#1}{#2}{#3}{#4}%
+}
+
+\def\pgfsysanimkeysyncend#1#2#3#4{%
+ \pgfsys@animation@syncend{#1}{#2}{#3}{#4}%
+}
+
+
+% Companion for \pgfsys@animation@event
+%
+% #1 to #5 = as in \pgfsys@animation@event
+%
+% Description:
+%
+% Calls \pgfsys@animation@event.
+
+\def\pgfsysanimkeyevent#1#2#3#4#5{%
+ \pgfsys@animation@event{#1}{#2}{#3}{#4}{#5}%
+}
+
+
+% Companion for \pgfsys@animation@repeat@event
+%
+% #1 to #5 = as in \pgfsys@animation@repeat@event
+%
+% Description:
+%
+% Calls \pgfsys@animation@repeat@event.
+
+\def\pgfsysanimkeyrepeatevent#1#2#3#4#5{%
+ \pgfsys@animation@repeat@event{#1}{#2}{#3}{#4}{#5}%
+}
+
+
+
+% Companion for \pgfsys@animation@accesskey
+%
+% #1 to #3 = as in \pgfsys@animation@accesskey
+%
+% Description:
+%
+% Calls \pgfsys@animation@accesskey.
+
+\def\pgfsysanimkeyaccesskey#1#2#3{%
+ \pgfsys@animation@accesskey{#1}{#2}{#3}%
+}
+
+
+
+
+% Companions for \pgfsys@animation@(no)accumulate
+%
+% Description:
+%
+% Calls \pgfsys@animaion@(no)accumulate and records the setting for
+% snapshots.
+
+\def\pgfsysanimkeyaccumulate{\pgfsys@animation@accumulate\pgfsysanim@accumulatetrue}
+\def\pgfsysanimkeynoaccumulate{\pgfsys@animation@noaccumulate\pgfsysanim@accumulatefalse}
+\newif\ifpgfsysanim@accumulate
+
+
+
+
+% Companion for \pgfsys@animation@whom
+%
+% #1 and #2 = as for \pgfsys@animation@whom
+%
+% Description:
+%
+% Calls \pgfsys@animation@whom and records the setting for snapshots.
+
+\def\pgfsysanimkeywhom#1#2{%
+ \pgfsys@register@type{#2}%
+ \pgfsys@animation@whom{#1}{#2}%
+ % Snapshots
+ \def\pgfsysanim@whom@id{#1}%
+ \def\pgfsysanim@whom@type{#2}%
+}
+
+
+
+
+
+% Companions for \pgfsys@animation@rotatealong and
+% \pgfsys@animation@norotatealong
+%
+% Description:
+%
+% Calls the system layer command and records the setting for
+% snapshots.
+
+\def\pgfsysanimkeyrotatealong{\pgfsys@animation@rotatealong\pgfsysanim@rotatealongtrue}
+\def\pgfsysanimkeynorotatealong{\pgfsys@animation@norotatealong\pgfsysanim@rotatealongfalse}
+\newif\ifpgfsysanim@rotatealong
+
+
+% Companion for \pgfsys@animation@movealong
+%
+% #1 = the path
+%
+% Description:
+%
+% Calls the system layer command and records the setting for
+% snapshots.
+
+\def\pgfsysanimkeymovealong#1{%
+ \pgfsys@animation@movealong{#1}%
+ % Snapshot
+ \def\pgfsysanim@snap@movealong{#1}%
+}
+
+
+
+
+% Companion for \pgfsys@animation@tip@markers
+%
+% #1, #2 = the markers
+%
+% Description:
+%
+% Calls the system layer command and records the setting for
+% snapshots.
+
+\def\pgfsysanimkeytipmarkers#1#2{%
+ \pgfsys@animation@tip@markers{#1}{#2}%
+ % Snapshot
+ \def\pgfsysanim@snap@tip@start{#1}%
+ \def\pgfsysanim@snap@tip@end{#2}%
+}
+\let\pgfsysanim@snap@tip@start\pgfutil@empty%
+\let\pgfsysanim@snap@tip@end\pgfutil@empty%
+
+
+% Companion for \pgfsys@animation@canvas@transform
+%
+% Description:
+%
+% Calls the system layer command and records the setting for
+% snapshots.
+
+\def\pgfsysanimkeycanvastransform#1#2{%
+ \pgfsys@animation@canvas@transform{#1}{#2}%
+ % Snapshot
+ \def\pgfsysanim@snap@canvas@transform@pre{#1}%
+ \def\pgfsysanim@snap@canvas@transform@post{#2}%
+}
+\let\pgfsysanim@snap@canvas@transform@pre\relax
+\let\pgfsysanim@snap@canvas@transform@post\relax
+
+
+
+% Companion for \pgfsys@animation@val@current
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% an error results.
+
+\def\pgfsysanimvalcurrent{%
+ \pgfsys@animation@val@current%
+ \ifpgfsysanim@is@snap%
+ \pgferror{You may not use "current value" with an animation snapshot}%
+ \fi%
+}
+
+
+% Supresses the animation value
+%
+% Description:
+%
+% The animation value is simply ignored.
+
+\def\pgfsysanimvalnone{%
+}
+
+
+
+% Companion for \pgfsys@animation@val@text
+%
+% #1 = as for \pgfsys@animation@val@text
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvaltext#1{%
+ \pgfsys@animation@val@text{#1}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{#1}%
+ \fi%
+}
+
+
+
+
+% Companion for \pgfsys@animation@val@scalar
+%
+% #1 = as for \pgfsys@animation@val@scalar
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalscalar#1{%
+ \pgfsys@animation@val@scalar{#1}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{#1}%
+ \fi%
+}
+
+
+
+% Companion for \pgfsys@animation@val@dimension
+%
+% #1 = as for \pgfsys@animation@val@dimension
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvaldimension#1{%
+ \pgfsys@animation@val@dimension{#1}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{#1}%
+ \fi%
+}
+
+
+
+% Dispatcher for different color values
+%
+% #1 = a color value (like "red" or "black!20")
+%
+% Description:
+%
+% This macro transforms #1 into its correct color model and, then,
+% calls the correct \pgfsysanimcolor... macro.
+
+\def\pgfsysanimvalcolor#1{%
+ \pgfutil@colorlet{pgf@anim@temp}{#1}%
+ \pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{pgf@anim@temp}}%
+ \expandafter\let\expandafter\pgf@sys@temp\csname\string\color@pgf@anim@temp\endcsname
+ \expandafter\pgfanim@parse@type@color@\pgf@sys@temp%
+}
+\def\pgfanim@parse@type@color@#1#2#3#4#5{%
+ \expandafter\ifx\csname pgfsysanimvalcolor#4\endcsname\relax%
+ \pgferror{Unsupported color model `#4'}%
+ \else%
+ \edef\pgf@sys@colmarshal{\expandafter\noexpand\csname pgfsysanimvalcolor#4\endcsname}%
+ \pgf@sys@uncomma#5,,%
+ \pgf@sys@colmarshal%
+ \fi%
+}
+
+\def\pgf@sys@uncomma#1,{%
+ \def\pgf@sys@coltest{#1}%
+ \ifx\pgf@sys@coltest\pgfutil@empty%
+ \else%
+ \expandafter\def\expandafter\pgf@sys@colmarshal\expandafter{\pgf@sys@colmarshal{#1}}%
+ \expandafter\pgf@sys@uncomma%
+ \fi%
+}
+
+
+
+
+% Companion for \pgfsys@animation@val@color@rgb
+%
+% #1, #2, #3 = as for \pgfsys@animation@val@color@rgb
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalcolorrgb#1#2#3{%
+ \pgfsys@animation@val@color@rgb{#1}{#2}{#3}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{{#1}{#2}{#3}}%
+ \fi%
+}
+
+
+
+% Companion for \pgfsys@animation@val@color@cmyk
+%
+% #1, #2, #3, #4 = as for \pgfsys@animation@val@color@cmyk
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalcolorcmyk#1#2#3#4{%
+ \pgfsys@animation@val@color@cmyk{#1}{#2}{#3}{#4}%
+ \ifpgfsysanim@is@snap%
+ {%
+ \pgf@xa=1pt%
+ \advance\pgf@xa by-#1pt%
+ \advance\pgf@xa by-#4pt\relax%
+ \ifdim\pgf@xa<0pt\pgf@xa0pt\fi%
+ \pgf@xb=1pt%
+ \advance\pgf@xb by-#1pt%
+ \advance\pgf@xb by-#4pt\relax%
+ \ifdim\pgf@xb<0pt\pgf@xb0pt\fi%
+ \pgf@xc=1pt%
+ \advance\pgf@xc by-#1pt%
+ \advance\pgf@xc by-#4pt\relax%
+ \ifdim\pgf@xc<0pt\pgf@xc0pt\fi%
+ \edef\pgfsys@temp{{\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgf@xb}{\pgf@sys@tonumber\pgf@xc}}%
+ \expandafter}%
+ \expandafter\pgfsysanim@esnap@record\expandafter{\pgfsys@temp}%
+ \fi%
+}
+
+
+% Companion for \pgfsys@animation@val@color@cmy
+%
+% #1, #2, #3 = as for \pgfsys@animation@val@color@cmy
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalcolorcmy#1#2#3{%
+ \pgfsys@animation@val@color@cmy{#1}{#2}{#3}%
+ \ifpgfsysanim@is@snap%
+ {%
+ \pgf@xa=1pt%
+ \advance\pgf@xa by-#1pt%
+ \pgf@xb=1pt%
+ \advance\pgf@xb by-#1pt%
+ \pgf@xc=1pt%
+ \advance\pgf@xc by-#1pt%
+ \edef\pgfsys@temp{{\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgf@xb}{\pgf@sys@tonumber\pgf@xc}}%
+ \expandafter}%
+ \expandafter\pgfsysanim@esnap@record\expandafter{\pgfsys@temp}%
+ \fi%
+}
+
+
+
+% Companion for \pgfsys@animation@val@color@gray
+%
+% #1 = as for \pgfsys@animation@val@color@gray
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalcolorgray#1{%
+ \pgfsys@animation@val@color@gray{#1}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{{#1}{#1}{#1}}%
+ \fi%
+}
+
+
+
+% Special companion for \pgfsys@animation@val@path
+%
+% #1 = as for \pgfsys@animation@val@path
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalpath#1{%
+ \pgfsys@animation@val@path{#1}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@snap@record{#1}%
+ \fi%
+}
+
+
+% Companion for \pgfsys@animation@val@translate
+%
+% #1, #2 = as for \pgfsys@animation@val@translate
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvaltranslate#1#2{%
+ \pgfsys@animation@val@translate{#1}{#2}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{{#1}{#2}}%
+ \fi%
+}
+
+
+
+% Companion for \pgfsys@animation@val@scale
+%
+% #1, #2 = as for \pgfsys@animation@val@scale
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalscale#1#2{%
+ \pgfsys@animation@val@scale{#1}{#2}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{{#1}{#2}}%
+ \fi%
+}
+
+
+
+% Companion for \pgfsys@animation@val@viewbox
+%
+% #1, #2, #3, #4 = as for \pgfsys@animation@val@viewbox
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalviewbox#1#2#3#4{%
+ \pgfsys@animation@val@viewbox{#1}{#2}{#3}{#4}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{{#1}{#2}{#3}{#4}}%
+ \fi%
+}
+
+
+
+
+% Companion for \pgfsys@animation@val@dash
+%
+% #1, #2 = as for \pgfsys@animation@val@dash
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvaldash#1#2{%
+ \pgfsys@animation@val@dash{#1}{#2}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{{#1}{#2}}%
+ \fi%
+}
+
+
+
+
+
+%
+% Recording mechanism: We record entries in an array.
+%
+
+\def\pgfsysanim@esnap@record#1{% records a new entry for the timeline
+ \edef\pgfsysanim@temp{#1}%
+ \expandafter\pgfsysanim@snap@record\expandafter{\pgfsysanim@temp}%
+}
+\def\pgfsysanim@snap@record#1{% records a new entry for the timeline
+ \ifx\pgfsysanim@time\pgfsysanim@base@text%
+ \def\pgfsysanim@base@value{#1}%
+ \else%
+ \advance\pgfsysanim@snap@count by1\relax%
+ \expandafter\def\expandafter\pgfsysanim@temp\expandafter{\pgfsysanim@time{#1}}%
+ \expandafter\let\csname pgfsysanim@snap@\the\pgfsysanim@snap@count\endcsname\pgfsysanim@temp%
+ \fi%
+}
+\newcount\pgfsysanim@snap@count
+\let\pgfsysanim@base@value\pgfutil@empty%
+
+
+% Compute the time-value interval of the snapshot: Based on the value of \pgfsysanim@snaptime,
+% computes the interval containing the specified time. This interval
+% will start at \pgfsysanim@prev@time and end at
+% \pgfsysanim@next@time. The values will be \pgfsysanim@prev@val and
+% \pgfsysanim@next@val.
+%
+\def\pgfsysanim@compute@interval{%
+ \let\pgfsysanim@prev@val\relax%
+ \let\pgfsysanim@prev@time\relax%
+ \let\pgfsysanim@prev@spline\pgfsysanim@default@spline%
+ \let\pgfsysanim@next@val\relax%
+ \let\pgfsysanim@next@time\relax%
+ \let\pgfsysanim@next@spline\pgfsysanim@default@spline%
+ \let\pgfsysanim@first@time\relax%
+ \let\pgfsysanim@last@time\relax%
+ \let\pgfsysanim@last@val\relax%
+ \ifnum\pgfsysanim@snap@count>0\relax%
+ \pgf@xc\pgfsysanim@snaptime pt\relax%
+ \pgf@x\pgfsysanim@snapshotstart pt\relax%
+ \advance\pgf@xc-\pgf@x\relax%
+ % Compute the start and end times:
+ \pgfsysanim@compute@start@end%
+ \pgfsysanim@compute@value%
+ \fi%
+ % Test whether a valid interval has been found:
+ \pgfsysanim@valid@snapshot@timefalse%
+ \ifx\pgfsysanim@prev@time\relax%
+ \else\ifx\pgfsysanim@next@time\relax%
+ \else\pgfsysanim@valid@snapshot@timetrue%
+ \fi\fi%
+ \ifpgfsysanim@valid@snapshot@time%
+ % ok, computed later
+ \else%
+ \ifx\pgfsysanim@base@value\pgfutil@empty%
+ \else%
+ % Ah, use base value!
+ \let\pgfsysanim@prev@val\pgfsysanim@base@value%
+ \def\pgfsysanim@prev@time{0}%
+ \let\pgfsysanim@prev@spline\pgfsysanim@default@spline%
+ \let\pgfsysanim@next@val\pgfsysanim@base@value%
+ \let\pgfsysanim@next@time\pgfsysanim@prev@time%
+ \let\pgfsysanim@next@spline\pgfsysanim@default@spline%
+ \def\pgfsysanim@first@time{-16382}%
+ \let\pgfsysanim@last@time\pgfsysanim@prev@time%
+ \let\pgfsysanim@last@val\pgfsysanim@base@value%
+ \def\pgfsysanim@frac@a{1}%
+ \def\pgfsysanim@frac@b{0}%
+ \pgfsysanim@valid@snapshot@timetrue% counts as valid!
+ \fi%
+ \fi%
+}
+\newif\ifpgfsysanim@cont%
+\newif\ifpgfsysanim@valid@snapshot@time
+\def\pgfsysanim@default@spline{{0}{0}{1}{1}}
+
+\def\pgfsysanim@compute@start@end{%
+ \expandafter\expandafter\expandafter\pgfsysanim@compute@start\csname pgfsysanim@snap@1\endcsname%
+ \expandafter\expandafter\expandafter\pgfsysanim@compute@end\csname pgfsysanim@snap@\the\pgfsysanim@snap@count\endcsname%
+}
+\def\pgfsysanim@compute@start#1#2#3#4#5#6{%
+ \def\pgfsysanim@first@time{#1}%
+}
+\def\pgfsysanim@compute@end#1#2#3#4#5#6{%
+ \def\pgfsysanim@last@time{#1}%
+ \def\pgfsysanim@last@val{#6}%
+}
+
+
+\def\pgfsysanim@compute@value{%
+ % First, are we before start?
+ \ifdim\pgf@xc<\pgfsysanim@first@time pt\relax%
+ % snapshot time (xc) is before start of animation. So, nothing happens:
+ \else%
+ \ifx\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@none%
+ \pgfsysanim@handle@repeat@none%
+ \else\ifx\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@normal%
+ \pgfsysanim@handle@repeat@normal%
+ \else\ifx\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@indefinite%
+ \pgfsysanim@handle@repeat@indefinite%
+ \else\ifx\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@dur%
+ \pgfsysanim@handle@repeat@dur%
+ \fi\fi\fi\fi%
+ \fi%
+}
+
+\def\pgfsysanim@handle@repeat@none{%
+ \ifdim\pgf@xc<\pgfsysanim@last@time pt\relax%
+ \pgfsysanim@compute@time%
+ \else%
+ \ifdim\pgf@xc=\pgfsysanim@last@time pt\relax%
+ % A bit tricky:
+ \ifpgfsysanim@snap@first%
+ \pgfsysanim@compute@time%
+ \else%
+ \ifpgfsysanim@freezeatend%
+ \let\pgfsysanim@prev@val\pgfsysanim@last@val%
+ \let\pgfsysanim@prev@time\pgfsysanim@last@time%
+ \let\pgfsysanim@next@val\pgfsysanim@last@val%
+ \let\pgfsysanim@next@time\pgfsysanim@last@time%
+ \fi%
+ \fi%
+ \else%
+ % Called when we are past the end.
+ \ifpgfsysanim@freezeatend%
+ \let\pgfsysanim@prev@val\pgfsysanim@last@val%
+ \let\pgfsysanim@prev@time\pgfsysanim@last@time%
+ \let\pgfsysanim@next@val\pgfsysanim@last@val%
+ \let\pgfsysanim@next@time\pgfsysanim@last@time%
+ \fi%
+ \fi%
+ \fi%
+}
+
+
+\def\pgfsysanim@handle@repeat@indefinite{%
+ \ifdim\pgf@xc<\pgfsysanim@last@time pt\relax%
+ \pgfsysanim@compute@time%
+ \else%
+ % Compute interval length
+ \pgf@xa=\pgfsysanim@last@time pt%
+ \pgf@xb=\pgfsysanim@first@time pt%
+ \advance\pgf@xa by-\pgf@xb%
+ % Compute repeat count and fraction:
+ \pgf@ya\pgf@xc%
+ \advance\pgf@ya by-\pgf@xb%
+ \ifdim\pgf@xa<0.01pt\relax%
+ % Interval too small: Goto end of interval
+ \def\pgfmathresult{1.0}%
+ \else%
+ \pgfmathdivide@{\pgf@ya}{\pgf@xa}%
+ \fi%
+ \pgf@x\pgfmathresult pt\relax%
+ \expandafter\pgfsysanim@splitter\the\pgf@x%
+ \pgf@xc=\pgfsysanim@repeat@frac\pgf@xa%
+ \advance\pgf@xc by\pgf@xb%
+ \pgfsysanim@compute@time%
+ \fi%
+}
+{\catcode`\p=12\catcode`\t=12\gdef\Pgfsysanim@sPliTTer#1.#2pt{\Pgfsysanim@seTTer{#1}{#2}}}
+\let\pgfsysanim@splitter\Pgfsysanim@sPliTTer
+\def\Pgfsysanim@seTTer#1#2{%
+ \def\pgfsysanim@repeat@decimal{#1}%
+ \def\pgfsysanim@repeat@frac{.#2}%
+ \ifdim\pgfsysanim@repeat@frac pt=0pt% goto one before:
+ \c@pgf@counta\pgfsysanim@repeat@decimal%
+ \advance\c@pgf@counta by-1\relax%
+ \edef\pgfsysanim@repeat@decimal{\the\c@pgf@counta}%
+ \def\pgfsysanim@repeat@frac{1}%
+ \fi%
+}
+\def\pgfsysanim@repeat@decimal{0}%
+
+
+\def\pgfsysanim@handle@repeat@normal{%
+ % Compute interval length
+ \pgf@xa=\pgfsysanim@last@time pt%
+ \pgf@xb=\pgfsysanim@first@time pt%
+ \advance\pgf@xa by-\pgf@xb%
+ % Compute repeat count and fraction:
+ \pgf@ya\pgf@xc%
+ \advance\pgf@ya by-\pgf@xb%
+ \ifdim\pgf@xa<0.01pt\relax%
+ % Interval too small: Goto end of interval
+ \def\pgfmathresult{1.0}%
+ \else%
+ \pgfmathdivide@{\pgf@ya}{\pgf@xa}%
+ \fi%
+ \pgf@x\pgfmathresult pt\relax%
+ \expandafter\pgfsysanim@splitter\the\pgf@x%
+ % Cases:
+ \ifdim\pgfmathresult pt<\pgfsysanim@snap@repeat@arg\relax%
+ % Ok! Compute!
+ \pgf@xc=\pgfsysanim@repeat@frac\pgf@xa%
+ \advance\pgf@xc by\pgf@xb%
+ \pgfsysanim@compute@time%
+ \else%
+ % Hmm. Freeze?
+ \ifpgfsysanim@freezeatend%
+ \expandafter\pgfsysanim@splitter\pgfsysanim@snap@repeat@arg%
+ \pgf@xc=\pgfsysanim@repeat@frac\pgf@xa%
+ \advance\pgf@xc by\pgf@xb%
+ \pgfsysanim@compute@time%
+ \else%
+ \ifdim\pgfmathresult pt=\pgfsysanim@snap@repeat@arg\relax%
+ \ifpgfsysanim@snap@first%
+ \expandafter\pgfsysanim@splitter\pgfsysanim@snap@repeat@arg%
+ \pgf@xc=\pgfsysanim@repeat@frac\pgf@xa%
+ \advance\pgf@xc by\pgf@xb%
+ \pgfsysanim@compute@time%
+ \fi%
+ % else: nothing!
+ \fi%
+ \fi%
+ \fi%
+}
+
+\def\pgfsysanim@handle@repeat@dur{%
+ \pgf@yb=\pgfsysanim@first@time pt%
+ \advance\pgf@yb by\pgfsysanim@snap@repeat@arg\relax%
+ \ifdim\pgf@xc<\pgf@yb% inside interval
+ \pgf@xa=\pgfsysanim@last@time pt%
+ \pgf@xb=\pgfsysanim@first@time pt%
+ \advance\pgf@xa by-\pgf@xb%
+ % Compute repeat count and fraction:
+ \pgf@ya\pgf@xc%
+ \advance\pgf@ya by-\pgf@xb%
+ \ifdim\pgf@xa<0.01pt\relax%
+ % Interval too small: Goto end of interval
+ \def\pgfmathresult{1.0}%
+ \else%
+ \pgfmathdivide@{\pgf@ya}{\pgf@xa}%
+ \fi%
+ \pgf@x\pgfmathresult pt\relax%
+ \expandafter\pgfsysanim@splitter\the\pgf@x%
+ %
+ \pgf@xc=\pgfsysanim@repeat@frac\pgf@xa%
+ \advance\pgf@xc by\pgf@xb%
+ \pgfsysanim@compute@time%
+ \else%
+ \ifpgfsysanim@freezeatend%
+ \pgfsysanim@handle@repeat@dur@freeze%
+ \else%
+ \ifdim\pgf@xc=\pgf@yb%
+ \ifpgfsysanim@snap@first%
+ \pgfsysanim@handle@repeat@dur@freeze%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+}
+
+\def\pgfsysanim@handle@repeat@dur@freeze{%
+ \pgf@xa=\pgfsysanim@last@time pt%
+ \pgf@xb=\pgfsysanim@first@time pt%
+ \advance\pgf@xa by-\pgf@xb%
+ % Compute repeat count and fraction:
+ \ifdim\pgf@xa<0.01pt\relax%
+ % Interval too small: Goto end of interval
+ \def\pgfmathresult{1.0}%
+ \else%
+ \pgfmathdivide@{\pgfsysanim@snap@repeat@arg}{\pgf@xa}%
+ \fi%
+ \pgf@x\pgfmathresult pt\relax%
+ \expandafter\pgfsysanim@splitter\the\pgf@x%
+ %
+ \pgf@xc=\pgfsysanim@repeat@frac\pgf@xa%
+ \advance\pgf@xc by\pgf@xb%
+ \pgfsysanim@compute@time%
+}
+
+
+
+
+
+\def\pgfsysanim@compute@time{%
+ % Ok, let us iterate over all points of time.
+ \pgfutil@tempcnta=1\relax%
+ \pgfsysanim@conttrue%
+ \pgfutil@loop%
+ \ifnum\pgfutil@tempcnta>\pgfsysanim@snap@count%
+ \pgfsysanim@contfalse%
+ \else%
+ \expandafter\let\expandafter\pgfsys@temp\csname pgfsysanim@snap@\the\pgfutil@tempcnta\endcsname%
+ \expandafter\pgfsysanim@test@time\pgfsys@temp%
+ \fi%
+ \ifpgfsysanim@cont%
+ \advance\pgfutil@tempcnta by1\relax%
+ \pgfutil@repeat%
+}
+
+
+\def\pgfsysanim@test@time#1#2#3#4#5#6{%
+ % #1 = time in seconds
+ % #2 to #5 = spline controls
+ % #6 = value
+ \ifdim#1pt<\pgf@xc%
+ % snap time not yet reached. Update previous:
+ \def\pgfsysanim@prev@val{#6}%
+ \def\pgfsysanim@prev@time{#1}%
+ \def\pgfsysanim@prev@spline{{#2}{#3}{#4}{#5}}%
+ \else%
+ \ifdim#1pt=\pgf@xc%
+ \ifpgfsysanim@snap@first%
+ \ifx\pgfsysanim@next@val\relax%
+ % first? Save!
+ \def\pgfsysanim@prev@val{#6}%
+ \def\pgfsysanim@prev@time{#1}%
+ \def\pgfsysanim@prev@spline{{#2}{#3}{#4}{#5}}%
+ \let\pgfsysanim@next@val\pgfsysanim@prev@val%
+ \let\pgfsysanim@next@time\pgfsysanim@prev@time%
+ \let\pgfsysanim@next@spline\pgfsysanim@prev@spline%
+ \pgfsysanim@contfalse%
+ % else, do nothing
+ \fi
+ \else%
+ % always overwrite:
+ \def\pgfsysanim@prev@val{#6}%
+ \def\pgfsysanim@prev@time{#1}%
+ \def\pgfsysanim@prev@spline{{#2}{#3}{#4}{#5}}%
+ \let\pgfsysanim@next@val\pgfsysanim@prev@val%
+ \let\pgfsysanim@next@time\pgfsysanim@prev@time%
+ \let\pgfsysanim@next@spline\pgfsysanim@prev@spline%
+ \fi%
+ \else%
+ % we passed the time!
+ \ifx\pgfsysanim@next@val\relax%
+ % first? Then save!
+ \def\pgfsysanim@next@val{#6}%
+ \def\pgfsysanim@next@time{#1}%
+ \def\pgfsysanim@next@spline{{#2}{#3}{#4}{#5}}%
+ \else%
+ % ignore later times!
+ \pgfsysanim@contfalse%
+ \fi%
+ \fi%
+ \fi%
+}
+
+\let\pgfsysanim@prev@val\relax%
+\let\pgfsysanim@prev@time\relax%
+\let\pgfsysanim@next@val\relax%
+\let\pgfsysanim@next@time\relax%
+
+% Help function
+\def\pgfsysanim@attach#1#2#3{%
+ \expandafter\pgfsysanim@prep@beg\expandafter{\pgfsysanim@first@time}{#2}{#3}%
+ \expandafter\def\expandafter\pgfsysanim@code@main\expandafter{\csname pgfsysanim@main@of@\pgfsysanim@whom@id @\pgfsysanim@whom@type @#1\endcsname}%
+ \expandafter\ifx\pgfsysanim@code@main\relax%
+ \edef\pgfsysanim@code@begin{%
+ \let\noexpand\pgfsysanim@c@begin\noexpand\pgfutil@empty%
+ \let\noexpand\pgfsysanim@c@end\noexpand\pgfutil@empty%
+ \pgfsysanim@lasttime-16383pt\relax%
+ \expandafter\noexpand\pgfsysanim@code@main%
+ \global\let\expandafter\noexpand\pgfsysanim@code@main\relax%
+ \noexpand\pgfsysanim@c@begin%
+ }%
+ \let\pgfsysanim@code@end\pgfsysanim@code@closer%
+ \expandafter\global\expandafter\let\pgfsysanim@code@main\pgfutil@empty%
+ \else%
+ \let\pgfsysanim@code@begin\relax%
+ \let\pgfsysanim@code@end\relax%
+ \fi%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\pgfsysanim@new@main%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter{\expandafter\pgfsysanim@code@main\pgfsysanim@add@main}
+ \expandafter\global\expandafter\let\pgfsysanim@code@main\pgfsysanim@new@main%
+}
+\def\pgfsysanim@code@closer{\pgfsysanim@c@end}
+
+\def\pgfsysanim@prep@beg#1#2#3{%
+ \edef\pgfsysanim@add@main{%
+ \noexpand\ifdim\pgfsysanim@lasttime>#1pt%
+ % ignore!
+ \noexpand\else%
+ \pgfsysanim@lasttime#1pt%
+ \def\noexpand\pgfsysanim@c@begin{#2}%
+ \def\noexpand\pgfsysanim@c@end{#3}%
+ \noexpand\fi%
+ }
+}
+
+\def\pgfsysanim@prep@beg@special#1#2{%
+ \def\pgfsysanim@add@main{%
+ \ifdim\pgfsysanim@lasttime>#1pt%
+ % ignore!
+ \else%
+ \pgfsysanim@lasttime#1pt%
+ \def\pgfsysanim@c@begin{#2}%
+ \fi%
+ }
+}
+
+
+
+\def\pgfsysanim@attach@special#1#2{%
+ \expandafter\expandafter\expandafter\pgfsysanim@prep@beg@special\expandafter\expandafter\expandafter{\expandafter\pgfsysanim@first@time\expandafter}\expandafter{#2}%
+ \ifx#1\relax%
+ \def#1{%
+ \pgfsysanim@lasttime-16383pt\relax%
+ \let\pgfsysanim@c@begin\pgfutil@empty%
+ }%
+ \fi%
+ \expandafter\expandafter\expandafter\gdef\expandafter\expandafter\expandafter#1\expandafter\expandafter\expandafter{\expandafter#1\pgfsysanim@add@main}%
+}
+
+
+
+\newdimen\pgfsysanim@lasttime
+
+
+\def\pgfsysanim@add@trans{%
+ \ifx\pgfsysanim@snap@canvas@transform@pre\relax%
+ \else%
+ \ifx\pgfsysanim@code@begin\relax%
+ \let\pgfsysanim@code@begin\pgfutil@empty%
+ \fi%
+ \pgfsysanim@add@trans@%
+ \fi%
+}
+\def\pgfsysanim@add@trans@{%
+ \toks0\expandafter{\pgfsysanim@snap@canvas@transform@pre}%
+ \toks1\expandafter{\pgfsysanim@code@begin}%
+ \toks2\expandafter{\pgfsysanim@snap@canvas@transform@post}%
+ \edef\pgfsysanim@code@begin{{\the\toks0 \the\toks1 \the\toks2}}%
+}
+
+% The code for the different attributes
+
+\def\pgfsysanim@prep@attr@opacity{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@scalar%
+ \pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}%
+ \pgfsysanim@attach{opacity}{\noexpand\pgfsys@opacity{\pgfsysanim@x@val}}{}%
+ \fi%
+}
+
+\def\pgfsysanim@prep@attr@fillopacity{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@scalar%
+ \pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}%
+ \pgfsysanim@attach{fillopacity}{\noexpand\pgfsys@fill@opacity{\pgfsysanim@x@val}}{}%
+ \fi%
+}
+
+\def\pgfsysanim@prep@attr@strokeopacity{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@scalar%
+ \pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}%
+ \pgfsysanim@attach{strokeopacity}{\noexpand\pgfsys@stroke@opacity{\pgfsysanim@x@val}}{}%
+ \fi%
+}
+
+\def\pgfsysanim@prep@attr@visibility{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@text%
+ \ifx\pgfsysanim@text@val\pgf@hidden@text%
+ \pgfsysanim@attach{visibility}{\noexpand\pgfsys@begininvisiblescope}{\noexpand\pgfsys@endinvisiblescope}%
+ \else%
+ \pgfsysanim@attach{visibility}{}{}%
+ \fi%
+ \fi%
+}
+\def\pgf@hidden@text{hidden}
+
+\def\pgfsysanim@prep@attr@linewidth{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@dimension%
+ \pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{16382}%
+ \pgfsysanim@attach{linewidth}{\noexpand\pgfsys@setlinewidth{\pgfsysanim@x@val pt}}{}%
+ \fi%
+}
+
+\def\pgfsysanim@prep@attr@dash{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@dash%
+ \pgfsysanim@attach{dash}{\noexpand\pgfsys@setdash{\pgfsysanim@dash@vals}{\pgfsysanim@x@val pt}}{}%
+ \fi%
+}
+
+\def\pgfsysanim@prep@attr@translate{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@translate%
+ \edef\pgfsysanim@code@begin{\noexpand\pgfsys@transformshift{\pgfsysanim@x@val pt}{\pgfsysanim@y@val pt}}%
+ \fi%
+ \pgfsysanim@add@trans%
+}
+
+
+\def\pgfsysanim@prep@attr@scale{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@scale%
+ \edef\pgfsysanim@code@begin{\noexpand\pgfsys@transformxyscale{\pgfsysanim@x@val}{\pgfsysanim@y@val}}%
+ \fi%
+ \pgfsysanim@add@trans%
+}
+
+\def\pgfsysanim@prep@attr@rotate{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@scalar%
+ {%
+ \pgfmathsin@{\pgfsysanim@x@val}%
+ \let\pgftransform@sin=\pgfmathresult%
+ \pgfmathcos@{\pgfsysanim@x@val}%
+ \let\pgftransform@cos=\pgfmathresult%
+ \pgf@x=\pgftransform@sin pt%
+ \pgf@xa=-\pgf@x%
+ \edef\pgfsysanim@code@begin{\noexpand\pgfsys@transformcm{\pgftransform@cos}{\pgftransform@sin}{\pgf@sys@tonumber{\pgf@xa}}{\pgftransform@cos}{0pt}{0pt}}%
+ \expandafter}%
+ \expandafter\def\expandafter\pgfsysanim@code@begin\expandafter{\pgfsysanim@code@begin}%
+ \fi%
+ \pgfsysanim@add@trans%
+}
+
+\def\pgfsysanim@prep@attr@skewx{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@scalar%
+ {%
+ \pgfmathtan@{\pgfsysanim@x@val}%
+ \edef\pgfsysanim@code@begin{\noexpand\pgfsys@transformcm{1}{0}{\pgfmathresult}{1}{0pt}{0pt}}%
+ \expandafter}%
+ \expandafter\def\expandafter\pgfsysanim@code@begin\expandafter{\pgfsysanim@code@begin}%
+ \fi%
+ \pgfsysanim@add@trans%
+}
+
+\def\pgfsysanim@prep@attr@skewy{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@scalar%
+ {%
+ \pgfmathtan@{\pgfsysanim@x@val}%
+ \edef\pgfsysanim@code@begin{\noexpand\pgfsys@transformcm{1}{\pgfmathresult}{0}{1}{0pt}{0pt}}%
+ \expandafter}%
+ \expandafter\def\expandafter\pgfsysanim@code@begin\expandafter{\pgfsysanim@code@begin}%
+ \fi%
+ \pgfsysanim@add@trans%
+}
+
+\def\pgfsysanim@prep@attr@motion{%
+ \ifx\pgfsysanim@base@value\pgfutil@empty%
+ \else%
+ \pgferror{You may not provide a base value for a motion}%
+ \let\pgfsysanim@base@value\pgfutil@empty%
+ \fi%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@motion%
+ \expandafter\pgfsysanim@prep@attr@motion@\pgfsysanim@motion@trans%
+ \fi%
+ \pgfsysanim@add@trans%
+}
+\def\pgfsysanim@prep@attr@motion@#1#2#3#4#5#6{%
+ \ifpgfsysanim@rotatealong%
+ \def\pgfsysanim@code@begin{\pgfsys@transformcm{#1}{#2}{#3}{#4}{#5}{#6}}%
+ \else%
+ \def\pgfsysanim@code@begin{\pgfsys@transformshift{#5}{#6}}%
+ \fi%
+}
+
+
+\def\pgfsysanim@prep@attr@strokecolor{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@color%
+ \pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}%
+ \pgfsysanim@cap@scalar{\pgfsysanim@y@val}{0}{1}%
+ \pgfsysanim@cap@scalar{\pgfsysanim@z@val}{0}{1}%
+ \pgfsysanim@attach{strokecolor}{\noexpand\pgfsys@color@rgb@stroke{\pgfsysanim@x@val}{\pgfsysanim@y@val}{\pgfsysanim@z@val}}{}%
+ \fi%
+}
+
+\def\pgfsysanim@prep@attr@fillcolor{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@color%
+ \pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}%
+ \pgfsysanim@cap@scalar{\pgfsysanim@y@val}{0}{1}%
+ \pgfsysanim@cap@scalar{\pgfsysanim@z@val}{0}{1}%
+ \pgfsysanim@attach{fillcolor}{\noexpand\pgfsys@color@rgb@fill{\pgfsysanim@x@val}{\pgfsysanim@y@val}{\pgfsysanim@z@val}}{}%
+ \fi%
+}
+
+\def\pgfsysanim@prep@attr@color{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@color%
+ \pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}%
+ \pgfsysanim@cap@scalar{\pgfsysanim@y@val}{0}{1}%
+ \pgfsysanim@cap@scalar{\pgfsysanim@z@val}{0}{1}%
+ \pgfsysanim@attach{color}{\noexpand\pgfsys@color@rgb{\pgfsysanim@x@val}{\pgfsysanim@y@val}{\pgfsysanim@z@val}}{}%
+ \fi%
+}
+
+\newif\ifpgfsys@animation@view@hooked
+
+\def\pgfsysanim@prep@attr@viewbox{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@viewbox%
+ \pgfsys@attach@to@id{\pgfsysanim@whom@id}{}{%
+ \ifpgfsys@animation@view@hooked%
+ \else%
+ % Hook into viewbox systems layer commands
+ \let\pgfsys@viewboxmeet@orig\pgfsys@viewboxmeet%
+ \let\pgfsys@viewboxmeet\pgfsysanim@hooked@viewboxmeet%
+ \let\pgfsys@viewboxslice@orig\pgfsys@viewboxslice%
+ \let\pgfsys@viewboxslice\pgfsysanim@hooked@viewboxslice%
+ \pgfsys@animation@view@hookedtrue%
+ \fi%
+ }{}{}%
+ \edef\pgfsysanim@temp{{\pgfsysanim@x@val}{\pgfsysanim@y@val}{\pgfsysanim@z@val}{\pgfsysanim@w@val}}%
+ \expandafter\pgfsysanim@attach@special\csname pgfsysanim@hook@for@\pgfsys@id@ref{\pgfsysanim@whom@id}{\pgfsysanim@whom@type}\endcsname\pgfsysanim@temp%
+ \fi%
+}
+\def\pgfsysanim@hooked@viewboxmeet#1#2#3#4#5#6#7#8{%
+ \expandafter\ifx\csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname\relax%
+ \pgfsys@viewboxmeet@orig{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
+ \else%
+ \csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname%
+ \ifx\pgfsysanim@c@begin\pgfutil@empty%
+ % should not happen, but, then, ignore
+ \else%
+ \expandafter\pgfsysanim@hooked@viewboxmeet@\pgfsysanim@c@begin{#1}{#2}{#3}{#4}%
+ \fi%
+ \expandafter\global\expandafter\let\csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname\relax%
+ \fi%
+}
+\def\pgfsysanim@hooked@viewboxmeet@#1#2#3#4#5#6#7#8{%
+ \pgfsys@viewboxmeet@orig{#5}{#6}{#7}{#8}{#1}{#2}{#3}{#4}%
+}
+\def\pgfsysanim@hooked@viewboxslice#1#2#3#4#5#6#7#8{%
+ \expandafter\ifx\csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname\relax%
+ \pgfsys@viewboxslice@orig{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
+ \else%
+ \csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname%
+ \expandafter\pgfsysanim@hooked@viewboxslice@\pgfsysanim@c@begin{#1}{#2}{#3}{#4}%
+ \expandafter\global\expandafter\let\csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname\relax%
+ \fi%
+}
+\def\pgfsysanim@hooked@viewboxslice@#1#2#3#4#5#6#7#8{%
+ \pgfsys@viewboxslice@orig{#5}{#6}{#7}{#8}{#1}{#2}{#3}{#4}%
+}
+
+
+\newif\ifpgfsys@animation@path@hooked
+
+\def\pgfsysanim@prep@attr@path{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@path%
+ \pgfsys@attach@to@id{\pgfsysanim@whom@id}{}{%
+ \ifpgfsys@animation@path@hooked%
+ \else%
+ % Hook into path systems layer commands
+ \let\pgfsys@discardpath@orig\pgfsys@discardpath%
+ \let\pgfsys@stroke@orig\pgfsys@stroke%
+ \let\pgfsys@fill@orig\pgfsys@fill%
+ \let\pgfsys@fillstroke@orig\pgfsys@fillstroke%
+ \let\pgfsys@closestroke@orig\pgfsys@closestroke%
+ \let\pgfsys@discardpath\pgfsys@discardpath@hook%
+ \let\pgfsys@stroke\pgfsys@stroke@hook%
+ \let\pgfsys@fill\pgfsys@fill@hook%
+ \let\pgfsys@fillstroke\pgfsys@fillstroke@hook%
+ \let\pgfsys@closestroke\pgfsys@closestroke@hook%
+ \pgfsys@animation@path@hookedtrue%
+ \fi%
+ }{}{}%
+ \expandafter\pgfsysanim@attach@special\csname pgfsysanim@phook@for@\pgfsys@id@ref{\pgfsysanim@whom@id}{\pgfsysanim@whom@type}\endcsname\pgfsysanim@path@all%
+ \fi%
+}
+\def\pgfsys@stroke@hook{\pgfsysanim@with@tipstrue\pgfsysanim@path@hooks\pgfsys@stroke@orig}
+\def\pgfsys@fill@hook{\pgfsysanim@with@tipsfalse\pgfsysanim@path@hooks\pgfsys@fill@orig}
+\def\pgfsys@fillstroke@hook{\pgfsysanim@with@tipstrue\pgfsysanim@path@hooks\pgfsys@fillstroke@orig}
+\def\pgfsys@closestroke@hook{\pgfsysanim@with@tipsfalse\pgfsysanim@path@hooks\pgfsys@closestroke@orig}
+\def\pgfsys@discardpath@hook{\pgfsysanim@with@tipsfalse\pgfsysanim@path@hooks\pgfsys@discardpath@orig}
+
+\newif\ifpgfsysanim@with@tips
+
+\def\pgfsysanim@path@hooks#1{%
+ {%
+ \expandafter\ifx\csname pgfsysanim@phook@for@\pgfsys@id@refcurrent\endcsname\relax%
+ #1%
+ \else%
+ \pgfsys@discardpath@orig%
+ \csname pgfsysanim@phook@for@\pgfsys@id@refcurrent\endcsname%
+ \pgfsysanim@c@begin%
+ \pgfsysanim@path@val%
+ #1%
+ \ifpgfsysanim@with@tips%
+ \ifx\pgfsysanim@path@val\pgfutil@empty\else%
+ \pgfsysanim@prepare@end@of@path%
+ \begingroup%
+ \pgfsysanim@prepare@start@of@path%
+ \pgfsysanim@add@marker@at@start%
+ \endgroup%
+ \pgfsysanim@add@marker@at@end%
+ \fi%
+ \fi%
+ \expandafter\global\expandafter\let\csname pgfsysanim@phook@for@\pgfsys@id@refcurrent\endcsname\relax%
+ \fi%
+ }%
+}
+
+
+\def\pgfsysanim@prepare@start@of@path{%
+ \ifx\pgfsysanim@snap@tip@start\pgfutil@empty\else
+ %
+ % Step 1: Split
+ %
+ \ifx\pgfprocessresultpathsuffix\relax%
+ % Ok, still need to compute the split:
+ \pgfprocesssplitpath{\pgf@arrowpath}%
+ \fi%
+ %
+ % Step 2: extract
+ %
+ \expandafter\pgf@parse@start\pgfprocessresultpathsuffix\pgf@stop\pgf@stop\pgf@stop%
+ %
+ % Step 3: prep
+ %
+ \pgf@prep@start%
+ \fi%
+}
+\def\pgfsysanim@add@marker@at@start{%
+ \ifx\pgfsysanim@snap@tip@start\pgfutil@empty\else
+ %
+ % Step 4: draw
+ %
+ {%
+ \pgftransformreset%
+ \pgftransformarrow{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\pgfqpoint{\pgf@xb}{\pgf@yb}}%
+ \pgfsys@beginscope%
+ \pgflowlevelsynccm%
+ \pgfsys@marker@use{\pgfsysanim@snap@tip@start}%
+ \pgfsys@endscope%
+ }%
+ \fi%
+}
+
+
+\def\pgfsysanim@prepare@end@of@path{%
+ \let\pgfprocessresultpathsuffix\relax% flag that nothing has happened...
+ \let\pgfprocessresultsubpathsuffix\relax%
+ \pgf@precise@shorteningfalse%
+ \edef\pgf@path@shortening@distance{0pt}%
+ \ifx\pgfsysanim@snap@tip@end\pgfutil@empty\else
+ %
+ % Step 1: Split
+ %
+ \pgfprocesssplitpath{\pgfsysanim@path@val}%
+ \pgfprocesssplitsubpath{\pgfprocessresultpathsuffix}%
+ %
+ % Step 2: extract
+ %
+ \expandafter\pgf@parse@end\pgfprocessresultsubpathsuffix\pgf@stop\pgf@stop\pgf@stop%
+ %
+ % Step 3: prep
+ %
+ \pgf@prep@end%
+ \fi%
+}
+\def\pgfsysanim@add@marker@at@end{%
+ \ifx\pgfsysanim@snap@tip@end\pgfutil@empty\else
+ %
+ % Step 4: draw
+ %
+ {%
+ \pgftransformreset%
+ \pgftransformarrow{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\pgfqpoint{\pgf@xb}{\pgf@yb}}%
+ \pgfsys@beginscope%
+ \pgflowlevelsynccm%
+ \pgfsys@marker@use{\pgfsysanim@snap@tip@end}%
+ \pgfsys@endscope%
+ }%
+ \fi%
+}
+
+
+
+%
+% Interpolation functions
+%
+
+% Scalar interpolation
+
+\def\pgfsysanim@comp@scalar{%
+ \pgfsysanim@compute@fractions%
+ \pgfsysanim@mix@scalar%
+ \ifpgfsysanim@accumulate%
+ \ifnum\pgfsysanim@repeat@decimal=0\else%
+ \let\pgfsysanim@frac@b\pgfsysanim@one%
+ \let\pgfsysanim@prev@val\pgfsysanim@x@val%
+ \let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal%
+ \let\pgfsysanim@next@val\pgfsysanim@last@val%
+ \pgfsysanim@mix@scalar%
+ \fi%
+ \fi%
+}
+\def\pgfsysanim@one{1}
+
+\def\pgfsysanim@mix@scalar{%
+ \pgf@x\pgfsysanim@prev@val pt%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y\pgfsysanim@next@val pt%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}%
+}
+\def\pgfsysanim@cap@scalar#1#2#3{%
+ \ifdim#1 pt<#2 pt%
+ \def#1{#2}%
+ \else\ifdim#1 pt>#3 pt%
+ \def#1{#3}%
+ \fi\fi%
+}
+
+
+% Scale interpolation
+
+\def\pgfsysanim@comp@scale{%
+ \pgfsysanim@compute@fractions%
+ \expandafter\expandafter\expandafter\pgfsysanim@mix@scale\expandafter\pgfsysanim@prev@val\pgfsysanim@next@val%
+ \ifpgfsysanim@accumulate%
+ \ifnum\pgfsysanim@repeat@decimal=0\else%
+ \let\pgfsysanim@frac@b\pgfsysanim@one%
+ \let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal%
+ \expandafter\pgfsysanim@mix@scale\expandafter\pgfsysanim@x@val\expandafter\pgfsysanim@y@val\pgfsysanim@last@val%
+ \fi%
+ \fi%
+}
+\def\pgfsysanim@mix@scale#1#2#3#4{%
+ \pgf@x#1pt%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#3pt%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}%
+ \pgf@x#2pt%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#4pt%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@y@val{\pgf@sys@tonumber\pgf@x}%
+}
+
+
+% Dimension interpolation
+
+\def\pgfsysanim@comp@dimension{%
+ \pgfsysanim@compute@fractions%
+ \pgfsysanim@mix@dimension%
+ \ifpgfsysanim@accumulate%
+ \ifnum\pgfsysanim@repeat@decimal=0\else%
+ \let\pgfsysanim@frac@b\pgfsysanim@one%
+ \def\pgfsysanim@prev@val{\pgfsysanim@x@val pt}%
+ \let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal%
+ \let\pgfsysanim@next@val\pgfsysanim@last@val%
+ \pgfsysanim@mix@dimension%
+ \fi%
+ \fi%
+}
+\def\pgfsysanim@mix@dimension{%
+ \pgf@x\pgfsysanim@prev@val%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y\pgfsysanim@next@val%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}%
+}
+
+
+
+% Translate interpolation
+
+\def\pgfsysanim@comp@translate{%
+ \pgfsysanim@compute@fractions%
+ \expandafter\expandafter\expandafter\pgfsysanim@mix@translate\expandafter\pgfsysanim@prev@val\pgfsysanim@next@val%
+ \ifpgfsysanim@accumulate%
+ \ifnum\pgfsysanim@repeat@decimal=0\else%
+ \let\pgfsysanim@frac@b\pgfsysanim@one%
+ \let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal%
+ \edef\pgfsysanim@prev@val{{\pgfsysanim@x@val pt}{\pgfsysanim@y@val pt}}
+ \expandafter\expandafter\expandafter\pgfsysanim@mix@translate\expandafter\pgfsysanim@prev@val\pgfsysanim@last@val%
+ \fi%
+ \fi%
+}
+\def\pgfsysanim@mix@translate#1#2#3#4{%
+ \pgf@x#1%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#3%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}%
+ \pgf@x#2%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#4%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@y@val{\pgf@sys@tonumber\pgf@x}%
+}
+
+
+
+% Color interpolation
+
+\def\pgfsysanim@comp@color{%
+ \pgfsysanim@compute@fractions%
+ \expandafter\expandafter\expandafter\pgfsysanim@mix@color\expandafter\pgfsysanim@prev@val\pgfsysanim@next@val%
+ \ifpgfsysanim@accumulate%
+ \ifnum\pgfsysanim@repeat@decimal=0\else%
+ \let\pgfsysanim@frac@b\pgfsysanim@one%
+ \let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal%
+ \expandafter\pgfsysanim@mix@color\expandafter\pgfsysanim@x@val\expandafter\pgfsysanim@y@val\expandafter\pgfsysanim@z@val\pgfsysanim@last@val%
+ \fi%
+ \fi%
+}
+\def\pgfsysanim@mix@color#1#2#3#4#5#6{%
+ \pgf@x#1pt%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#4pt%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}%
+ \pgf@x#2pt%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#5pt%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@y@val{\pgf@sys@tonumber\pgf@x}%
+ \pgf@x#3pt%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#6pt%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@z@val{\pgf@sys@tonumber\pgf@x}%
+}
+
+
+% Text interpolation
+
+\def\pgfsysanim@comp@text{%
+ \let\pgfsysanim@text@val\pgfsysanim@prev@val%
+}
+
+
+
+% Dash interpolation
+
+\def\pgfsysanim@comp@dash{%
+ \pgfsysanim@compute@fractions%
+ \expandafter\expandafter\expandafter\pgfsysanim@mix@dash\expandafter\pgfsysanim@prev@val\pgfsysanim@next@val%
+ \ifpgfsysanim@accumulate%
+ \ifnum\pgfsysanim@repeat@decimal=0\else%
+ \let\pgfsysanim@frac@b\pgfsysanim@one%
+ \let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal%
+ \edef\pgfsysanim@prev@val{{\pgfsysanim@dash@vals}{\pgfsysanim@x@val pt}}%
+ \expandafter\expandafter\expandafter\pgfsysanim@mix@dash\expandafter\pgfsysanim@prev@val\pgfsysanim@last@val%
+ \fi%
+ \fi%
+}
+\def\pgfsysanim@mix@dash#1#2#3#4{%
+ \pgf@x#2\relax%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#4\relax%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}%
+ \let\pgfsysanim@dash@vals\pgfutil@empty%
+ \pgfsysanim@parse@dash#1,\pgf@stop#3,\pgf@stop%
+}
+\def\pgfsysanim@parse@dash{\pgfutil@ifnextchar\pgf@stop\pgfsysanim@parse@dash@done\pgfsysanim@parse@dash@first}
+\def\pgfsysanim@parse@dash@done\pgf@stop\pgf@stop{}%
+\def\pgfsysanim@parse@dash@first#1,#2\pgf@stop#3\pgf@stop{%
+ \pgf@x#1\relax%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgfsysanim@parse@dash@second#3\pgf@stop{#2}%
+}
+\def\pgfsysanim@parse@dash@second#1,#2\pgf@stop#3{%
+ \pgf@y#1\relax%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \def\pgfsys@temp{#2}%
+ \edef\pgfsysanim@dash@vals{\pgfsysanim@dash@vals\the\pgf@x\ifx\pgfsys@temp\pgfutil@empty\else,\fi}%
+ \pgfsysanim@parse@dash#3\pgf@stop#2\pgf@stop%
+}
+
+
+
+
+% Viewbox interpolation
+
+\def\pgfsysanim@comp@viewbox{%
+ \pgfsysanim@compute@fractions%
+ \expandafter\expandafter\expandafter\pgfsysanim@mix@viewbox\expandafter\pgfsysanim@prev@val\pgfsysanim@next@val%
+ \ifpgfsysanim@accumulate%
+ \pgferror{viewbox animations cannot accumulate / add}%
+ \fi%
+}
+\def\pgfsysanim@mix@viewbox#1#2#3#4#5#6#7#8{%
+ \pgf@x#1%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#5%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\the\pgf@x}%
+ \pgf@x#2%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#6%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@y@val{\the\pgf@x}%
+ \pgf@x#3%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#7%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@z@val{\the\pgf@x}%
+ \pgf@x#4%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#8%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@w@val{\the\pgf@x}%
+}
+
+
+
+
+% Path interpolation
+
+\def\pgfsysanim@comp@path{%
+ \pgfsysanim@compute@fractions%
+ \edef\pgfsysanim@path@tips{%
+ \def\noexpand\pgfsysanim@snap@tip@start{\pgfsysanim@snap@tip@start}%
+ \def\noexpand\pgfsysanim@snap@tip@end{\pgfsysanim@snap@tip@end}%
+ }%
+ \let\pgfsysanim@path@val\pgfutil@empty%
+ \expandafter\expandafter\expandafter\pgfsysanim@parse@path\expandafter\pgfsysanim@prev@val\expandafter\pgf@stop\expandafter\relax\pgfsysanim@next@val\pgf@stop\relax%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgfsysanim@path@all\expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgfsysanim@path@val\expandafter\expandafter\expandafter{\expandafter\pgfsysanim@path@val\expandafter}\pgfsysanim@path@tips}%
+ \ifpgfsysanim@accumulate%
+ \pgferror{path animations cannot accumulate / add}%
+ \fi%
+}
+\def\pgfsysanim@parse@path{\pgfutil@ifnextchar\pgf@stop\pgfsysanim@parse@path@done\pgfsysanim@parse@path@first}
+\def\pgfsysanim@parse@path@done\pgf@stop\relax\pgf@stop\relax{}%
+\def\pgfsysanim@parse@path@first{\pgfutil@ifnextchar\bgroup\pgfsysanim@parse@path@first@num\pgfsysanim@parse@path@token}
+\def\pgfsysanim@parse@path@token#1#2\relax#3#4\relax{%
+ \expandafter\def\expandafter\pgfsysanim@path@val\expandafter{\pgfsysanim@path@val#1}%
+ \pgfsysanim@parse@path#2\relax#4\relax%
+}
+\def\pgfsysanim@parse@path@first@num#1#2\relax#3#4\relax{%
+ \pgf@x#1%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#3%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgfsysanim@path@val\expandafter\expandafter\expandafter{\expandafter\pgfsysanim@path@val\expandafter{\the\pgf@x}}%
+ \pgfsysanim@parse@path#2\relax#4\relax%
+}
+
+
+
+% Motion interpolation
+
+\def\pgfsysanim@comp@motion{%
+ \pgfsysanim@compute@fractions%
+ \pgf@x\pgfsysanim@prev@val pt%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y\pgfsysanim@next@val pt%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}%
+ \ifdim\pgfsysanim@x@val pt=1pt%
+ \def\pgfsysanim@x@val{0.9999}% because of rounding problems in decorations
+ \fi%
+ \pgf@relevantforpicturesizefalse%
+ \pgfdecoratepath{pgfsysanim@motion}{%
+ \pgfsyssoftpath@setcurrentpath\pgfsysanim@snap@movealong%
+ }%
+ \ifpgfsysanim@accumulate%
+ \pgferror{motion animations cannot accumulate / add}%
+ \fi%
+}
+\pgfdeclaredecoration{pgfsysanim@motion}{s}{%
+ \state{s}[width=\pgfsysanim@x@val\pgfdecoratedremainingdistance,next state=final]{}%
+ \state{final}{\pgfgettransform\pgfsysanim@motion@trans\global\let\pgfsysanim@motion@trans\pgfsysanim@motion@trans}%
+}
+
+
+
+
+
+
+% Compute fractions and splines:
+
+\def\pgfsysanim@compute@fractions{%
+ \ifdim\pgf@xc=\pgfsysanim@prev@time pt%
+ \def\pgfsysanim@frac@a{0}%
+ \def\pgfsysanim@frac@b{1}%
+ \else%
+ \pgfmathsubtract@{\pgfsysanim@next@time}{\pgfsysanim@prev@time}%
+ \ifdim\pgfmathresult pt<0.01pt%
+ \def\pgfsysanim@frac@a{0}%
+ \def\pgfsysanim@frac@b{1}%
+ \else%
+ \let\pgfsysanim@divby\pgfmathresult%
+ \pgfmathsubtract@{\pgf@xc}{\pgfsysanim@prev@time}%
+ \pgfmathdivide@{\pgfmathresult}{\pgfsysanim@divby}%
+ \ifdim\pgfmathresult pt<0pt\def\pgfmathresult{0}\fi%
+ \ifdim\pgfmathresult pt>1pt\def\pgfmathresult{1}\fi%
+ \let\pgfsysanim@frac@a\pgfmathresult%
+ \pgfmathsubtract@{1}{\pgfmathresult}%
+ \let\pgfsysanim@frac@b\pgfmathresult%
+ \fi%
+ \fi%
+ \ifdim\pgfsysanim@frac@a pt=0pt%
+ \else\ifdim\pgfsysanim@frac@b pt=0pt%
+ \else%
+ \expandafter\expandafter\expandafter\pgfsysanim@apply@spline\expandafter\pgfsysanim@prev@spline\pgfsysanim@next@spline%
+ \fi\fi%
+}
+
+
+\def\pgfsysanim@apply@spline#1#2#3#4#5#6#7#8{%
+ \edef\pgfsys@temp{#3,#5,#4,#6}%
+ \ifx\pgfsys@temp\pgfsysanim@id@spline%
+ \else%
+ \def\pgfsysanim@prev@out@time{{#3}{#4}}%
+ \def\pgfsysanim@next@in@time{{#5}{#6}}%
+ \ifx\pgfsysanim@prev@out@time\pgfsys@stay@text%
+ \pgfsysanim@jump@splines%
+ \else\ifx\pgfsysanim@next@in@time\pgfsys@jump@text%
+ \pgfsysanim@jump@splines%
+ \else%
+ \pgf@xa#3pt%
+ \pgf@xb#5pt%
+ % #4 is val supoort a
+ % #6 is val support b
+ % our first approximation
+ \let\pgfsysanim@t\pgfsysanim@frac@a%
+ \let\pgfsysanim@s\pgfsysanim@frac@b%
+ \pgfsysanim@eval@spline%
+ \edef\pgfsysanim@ft{\the\pgf@x}%
+ \pgf@x\pgfsysanim@t pt%
+ \advance\pgf@x by256sp%
+ \pgf@y1pt%
+ \advance\pgf@y by-\pgf@x%
+ \edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}%
+ \edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}%
+ \pgfsysanim@eval@spline%
+ % Ok, now do Newton one step
+ \advance\pgf@x by-\pgfsysanim@ft%
+ \pgf@x256\pgf@x%
+ % \pgf@x is f'(t)
+ % must compute t - (f(t)-frac@a)/f'(t)
+ \pgf@ya\pgfsysanim@ft%
+ \advance\pgf@ya by-\pgfsysanim@frac@a pt%
+ \pgf@yb\pgf@x
+ \pgfmathreciprocal@{\pgf@yb}%
+ \ifdim\pgfmathresult pt>2.5pt%
+ \def\pgfmathresult{2.5}%
+ \fi%
+ \ifdim\pgfmathresult pt<-2.5pt%
+ \def\pgfmathresult{-2.5}%
+ \fi%
+ \pgf@x\pgfsysanim@t pt%
+ \advance\pgf@x by-\pgfmathresult\pgf@ya%
+ % \pgf@x is new t:
+ \pgf@y1pt%
+ \advance\pgf@y by-\pgf@x%
+ \edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}%
+ \edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}%
+ \pgfsysanim@eval@spline%
+ \edef\pgfsysanim@ft{\the\pgf@x}%
+ \pgf@x\pgfsysanim@t pt%
+ \advance\pgf@x by256sp%
+ \pgf@y1pt%
+ \advance\pgf@y by-\pgf@x%
+ \edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}%
+ \edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}%
+ \pgfsysanim@eval@spline%
+ % Ok, now do Newton one step2
+ \advance\pgf@x by-\pgfsysanim@ft%
+ \pgf@x256\pgf@x%
+ % \pgf@x is f'(t)
+ % must compute t - (f(t)-frac@a)/f'(t)
+ \pgf@ya\pgfsysanim@ft%
+ \advance\pgf@ya by-\pgfsysanim@frac@a pt%
+ \pgf@yb\pgf@x
+ \pgfmathreciprocal@{\pgf@yb}%
+ \ifdim\pgfmathresult pt>2.5pt%
+ \def\pgfmathresult{2.5}%
+ \fi%
+ \ifdim\pgfmathresult pt<-2.5pt%
+ \def\pgfmathresult{-2.5}%
+ \fi%
+ \pgf@x\pgfsysanim@t pt%
+ \advance\pgf@x by-\pgfmathresult\pgf@ya%
+ % \pgf@x is new t:
+ \pgf@y1pt%
+ \advance\pgf@y by-\pgf@x%
+ \edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}%
+ \edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}%
+ % Third newton:
+ \pgfsysanim@eval@spline%
+ \edef\pgfsysanim@ft{\the\pgf@x}%
+ \pgf@x\pgfsysanim@t pt%
+ \advance\pgf@x by256sp%
+ \pgf@y1pt%
+ \advance\pgf@y by-\pgf@x%
+ \edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}%
+ \edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}%
+ \pgfsysanim@eval@spline%
+ % Ok, now do Newton one step2
+ \advance\pgf@x by-\pgfsysanim@ft%
+ \pgf@x256\pgf@x%
+ % \pgf@x is f'(t)
+ % must compute t - (f(t)-frac@a)/f'(t)
+ \pgf@ya\pgfsysanim@ft%
+ \advance\pgf@ya by-\pgfsysanim@frac@a pt%
+ \pgf@yb\pgf@x
+ \pgfmathreciprocal@{\pgf@yb}%
+ \ifdim\pgfmathresult pt>2.5pt%
+ \def\pgfmathresult{2.5}%
+ \fi%
+ \ifdim\pgfmathresult pt<-2.5pt%
+ \def\pgfmathresult{-2.5}%
+ \fi%
+ \pgf@x\pgfsysanim@t pt%
+ \advance\pgf@x by-\pgfmathresult\pgf@ya%
+ % \pgf@x is new t:
+ \pgf@y1pt%
+ \advance\pgf@y by-\pgf@x%
+ \edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}%
+ \edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}%
+ % now, evaluate target:
+ \pgf@xa#4pt%
+ \pgf@xb#6pt%
+ \pgfsysanim@eval@spline%
+ % \pgf@x is result:
+ \pgf@y1pt%
+ \advance\pgf@y by-\pgf@x%
+ \edef\pgfsysanim@frac@a{\pgf@sys@tonumber\pgf@x}%
+ \edef\pgfsysanim@frac@b{\pgf@sys@tonumber\pgf@y}%
+ \fi\fi%
+ \fi%
+}
+\def\pgfsysanim@id@spline{0,1,0,1}
+
+\def\pgfsysanim@eval@spline{%
+ % Iteration one: (0,#1,#2,1) reduced to (ya,yb,yc)
+ \pgf@ya\pgfsysanim@t\pgf@xa%
+ \pgf@yb\pgfsysanim@t\pgf@xb%
+ \advance\pgf@yb by\pgfsysanim@s\pgf@xa%
+ \pgf@yc\pgfsysanim@t pt%
+ \advance\pgf@yc by\pgfsysanim@s\pgf@xb%
+ % Iteration two: (ya,yb,yc) recuded to (y,xc)
+ \pgf@y\pgfsysanim@t\pgf@yb%
+ \advance\pgf@y by\pgfsysanim@s\pgf@ya%
+ \pgf@xc\pgfsysanim@t\pgf@yc%
+ \advance\pgf@xc by\pgfsysanim@s\pgf@yb%
+ % Iteration three: (y,xc) recuded to (x)
+ \pgf@x\pgfsysanim@t\pgf@xc%
+ \advance\pgf@x by\pgfsysanim@s\pgf@y%
+}
+
+\def\pgfsysanim@jump@splines{%
+ \ifx\pgfsysanim@prev@out@time\pgfsys@stay@text%
+ \ifx\pgfsysanim@next@in@time\pgfsys@jump@text%
+ \ifdim\pgfsysanim@frac@a pt<0.5pt%
+ \def\pgfsysanim@frac@a{0}%
+ \def\pgfsysanim@frac@b{1}%
+ \else%
+ \def\pgfsysanim@frac@a{1}%
+ \def\pgfsysanim@frac@b{0}%
+ \fi%
+ \else%
+ % Only stay, so go to begin
+ \def\pgfsysanim@frac@a{0}%
+ \def\pgfsysanim@frac@b{1}%
+ \fi%
+ \else
+ % Only jump, so go to end
+ \def\pgfsysanim@frac@a{1}%
+ \def\pgfsysanim@frac@b{0}%
+ \fi%
+}
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
index b34ae3bcdc7..09e6eed0a84 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.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/pgfsysprotocol.code.tex,v 1.4 2006/10/16 22:32:59 tantau Exp $
+\ProvidesFileRCS{pgfsysprotocol.code.tex}
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 0b6310873ab..c52f4d49de8 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.9 2013/09/09 10:05:41 tantau Exp $
+\ProvidesFileRCS{pgfsyssoftpath.code.tex}
% This package provides the pgf system path abstraction layer. This
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfcalendar.code.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfcalendar.code.tex
index 7cd2e4e1127..1e4960066ed 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfcalendar.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfcalendar.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/utilities/pgfcalendar.code.tex,v 1.11 2007/07/23 21:23:14 tantau Exp $
+\ProvidesFileRCS{pgfcalendar.code.tex}
% Translation stuff
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 e984ca06315..47969aaba48 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgffor.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/utilities/pgffor.code.tex,v 1.25 2013/12/13 11:40:27 tantau Exp $
+\ProvidesPackageRCS{pgffor.code.tex}
% pgfmath is needed
\input pgfmath.code.tex
@@ -288,6 +288,15 @@
\def\pgffor@dots@value@process#1{%
\expandafter\pgffor@dots@stripcontext#1\pgffor@@stop%
\expandafter\pgffor@dots@charcheck\pgffor@dotsvalue\pgffor@@stop%
+ \ifpgffor@alphabeticsequence
+ \else
+ \begingroup
+ \pgfkeys{/pgf/fpu/false/.try}%
+ \pgfmathparse{\pgffor@dotsvalue}%
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+ \let\pgffor@dotsvalue=\pgfmathresult
+ \fi
\let#1=\pgffor@dotsvalue%
}
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 3d79735459d..6d9f08fdcba 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
@@ -76,7 +76,11 @@
\pgfkeys@temptoks{#2}\expandafter\edef\csname pgfk@#1\endcsname{\the\pgfkeys@temptoks}%
}
-
+\long\def\pgfkeyssetevalue#1#2{%
+ \pgfkeys@temptoks={#2}%
+ \pgfkeys@temptoks=\scantokens\expandafter{\expandafter{\the\pgfkeys@temptoks}}%
+ \expandafter\edef\csname pgfk@#1\expandafter\endcsname\expandafter{\the\pgfkeys@temptoks}%
+}
% Add text to a key at the end
%
@@ -608,7 +612,7 @@
\long\def\pgfkeysedef#1#2{%
\long\edef\pgfkeys@temp##1\pgfeov{#2}%
\pgfkeyslet{#1/.@cmd}{\pgfkeys@temp}%
- \pgfkeyssetvalue{#1/.@body}{#2}%
+ \pgfkeyssetevalue{#1/.@body}{#2}%
}
@@ -633,11 +637,12 @@
\pgfkeyssetvalue{#1/.@args}{#2\pgfeov}%
\pgfkeyssetvalue{#1/.@body}{#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}%
+ \pgfkeyssetevalue{#1/.@body}{#3}%
}
% Like \pgfkeysdefargs, but `#2' is an integer denoting the expected
@@ -677,10 +682,10 @@
% {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{%
+% --------------------------------------------------
+\long\def\pgfkeysdefnargs#1#2#3{\pgfkeysdefnargs@{#1}{#2}{#3}{\def}{\pgfkeyssetvalue}}%
+\long\def\pgfkeysedefnargs#1#2#3{\pgfkeysdefnargs@{#1}{#2}{#3}{\edef}{\pgfkeyssetevalue}}%
+\long\def\pgfkeysdefnargs@#1#2#3#4#5{%
\ifcase#2\relax
\pgfkeyssetvalue{#1/.@args}{}%
\or
@@ -714,11 +719,9 @@
\edef\pgfkeys@tempargs{\noexpand\pgfkeysvalueof{#1/.@@body}}%
\def\pgfkeys@temp{\pgfkeysdef{#1}}%
\expandafter\pgfkeys@temp\expandafter{\pgfkeys@tempargs##1}%
- \pgfkeyssetvalue{#1/.@body}{#3}%
+ #5{#1/.@body}{#3}%
}
-
-
% Defining a key command
\pgfkeysdef{/handlers/.code}{\pgfkeysdef{\pgfkeyscurrentpath}{#1}}
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex
index ef7411da924..1a413536783 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex
@@ -538,7 +538,7 @@
/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.}%
+ \pgf@typeout{LOG: the option '\pgfkeyscurrentkey' (was originally '\pgfkeyscurrentkeyRAW') (case \pgfkeyscasenumber) has not been processed due to pgfkeysfiltered.}%
},
%
%
@@ -598,7 +598,7 @@
},
/pgf/key filters/active families or no family DEBUG/.code 2 args={%
\if\pgfkeyscasenumber0%
- \immediate\write16{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) invoking unknown handler '#2']}%
+ \pgf@typeout{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) invoking unknown handler '#2']}%
\pgfkeysevalkeyfilterwith{#2}%
\else
\if\pgfkeyscasenumber3%
@@ -609,12 +609,12 @@
\ifpgfkeyssuccess
\pgfkeysisfamilyactive{\pgfkeyspred@TMP}%
\ifpgfkeysfiltercontinue
- \immediate\write16{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) family is ACTIVE]}%
+ \pgf@typeout{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) family is ACTIVE]}%
\else
- \immediate\write16{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) family is NOT active.]}%
+ \pgf@typeout{[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']}%
+ \pgf@typeout{[pgfkeyshasactivefamilyornofamily(\pgfkeyscurrentkey, \pgfkeyscasenumber) invoking has-no-family-handler '#1']}%
\pgfkeysevalkeyfilterwith{#1}%
\fi
\fi
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 1f1ba110830..58fa5b0ef74 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex
@@ -14,19 +14,28 @@
% string. This command will also be available in plain TeX, where it
% prints out a message to the log.
-
-%\def\pgfversion{3.0.1-cvs}
-\def\pgfversion{3.0.1a}
+\pgfutil@IfFileExists{pgf.revision.tex}{\input pgf.revision.tex } {%
+ \def\pgfrevision{0}%
+ \def\pgfversion{0.0}%
+ \def\pgfversiondatetime{2014-07-01 00:00:00 +100}%
+ \def\pgfrevisiondatetime{2014-07-01 00:00:00 +100}%
+ \def\pgfversiondate{2014/07/01}%
+ \def\pgfrevisiondate{2014/07/01}%
+}
\begingroup
\catcode`\"=12
\pgfutil@IfUndefined{directlua}{}{%
- \directlua{pgf = {}; pgf.pgfversion = "\pgfversion"}%
+ \directlua{pgf = {}; pgf.pgfversion = "\pgfversion"}%
}%
\endgroup
-%\def\pgftypesetversion{\oldstylenums{3}.\oldstylenums{0}.\oldstylenums{1}-cvs}
-\def\pgftypesetversion{\oldstylenums{3}.\oldstylenums{0}.\oldstylenums{1}a}
+% \def\pgftypesetversion{\oldstylenums{3}.\oldstylenums{0}.\oldstylenums{1}}
+% XXX : implement pretty-printing:
+% which is better? 'version' is something like 3.0.1 . revision is
+% 3.0.1-151-g62184b3 which might be better for instable builds
+%\let\pgftypesetversion=\pgfversion
+\let\pgftypesetversion=\pgfrevision
\ifx\pgfrcsloaded\undefined
@@ -35,69 +44,40 @@
\edef\pgfrcsatcode{\the\catcode`\@}
\catcode`\@=11
-% Get date and version from RCS Ids
-\def\pgf@parseid $#1: #2.#3,v #4 #5/#6/#7 #8${%
- \pgf@parsercsfile$#2/$
- \def\pgf@rcssuffix{#3}
- \def\pgf@rcsrevision{#4}
- \def\pgf@rcsdate{#5/#6/#7}
-}
-\def\pgf@parsercsfile$#1/#2${
- \def\pgf@temp{#2}
- \ifx\pgf@temp\pgfutil@empty
- \def\pgf@rcsfile{#1}
- \else
- \pgf@parsercsfile$#2$
- \fi}
-
-\def\ProvidesFileRCS{%
- \def\pgfrcs@marshal{\ProvidesFile{\pgf@rcsfile.\pgf@rcssuffix}}%
- \pgfrcs@parserest%
-}
-\def\ProvidesPackageRCS{%
- \def\pgfrcs@marshal{\ProvidesPackage{\pgf@rcsfile}}%
- \pgfrcs@parserest%
+% not used in PGF, deprecated
+\def\ProvidesFileRCS#1{%
+ \ProvidesFile{#1}[\pgfversiondate\space v\pgfversion\space(\pgfrevision)]%
}
-\def\pgfrcs@parserest{%
- \def\pgf@rcsadditional{}%
- \afterassignment\pgfrcs@checkforoptional\let\next=}
-
-\def\pgfrcs@checkforoptional{%
- \ifx\next[%
- \let\next=\pgfrcs@getoptional%
- \else
- \let\next=\pgfrcs@package%
- \fi%
- \next}%}
-
-\def\pgfrcs@getoptional#1] ${%
- \def\pgf@rcsadditional{#1}%
- \pgfrcs@package%
-}
+\def\pgf@remove@ext#1.#2\relax{%
+ \def\pgfretval{#1}%
+}%
-\def\pgfrcs@package#1${
- \pgf@parseid $#1$
- \pgfrcs@marshal[\pgf@rcsdate\space\pgf@rcsadditional\space(rcs-revision \pgf@rcsrevision)]
+\def\ProvidesPackageRCS#1{%
+ \pgf@remove@ext#1.\relax
+ \edef\pgfrcs@marshal{{\pgfretval}[\pgfversiondate\space v\pgfversion\space(\pgfrevision)]}%
+ \expandafter\ProvidesPackage\pgfrcs@marshal
}
-\def\ProvidesClassRCS $#1$ [#2]{%
- \pgf@parseid $#1$
- \ProvidesClass{\pgf@rcsfile}[\pgf@rcsdate\space#2\space (rcs-revision \pgf@rcsrevision)]
+% not used in PGF, deprecated
+\def\ProvidesClassRCS#1{%
+ \pgf@remove@ext#1.\relax
+ \edef\pgfrcs@marshal{{\pgfretval}[\pgfversiondate\space v\pgfversion\space(\pgfrevision)]}%
+ \expandafter\ProvidesClass\pgfrcs@marshal
}
\ifx\ProvidesPackage\@undefined
- % plain tex
- \def\ProvidesPackage#1[#2]{\wlog{Loading package #1 version #2.}}
+ % plain tex
+ \def\ProvidesPackage#1[#2]{\wlog{Loading package #1 version #2.}}
\fi
\ifx\ProvidesFile\@undefined
- % plain tex
- \def\ProvidesFile#1[#2]{\wlog{Loading file #1 version #2.}}
+ % plain tex
+ \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.31 2015/08/07 10:17:34 cfeuersaenger Exp $
+\ProvidesPackageRCS{pgfrcs.code.tex}
\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 782d0d44748..b2f55e82923 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
@@ -35,6 +35,16 @@
% Simple stuff
+% \pgfutil@trimspaces{<token list>}
+%
+% Removes spaces on both sides of <token list>. Same as trimspaces.sty
+\catcode`\Q=3
+\def\pgfutil@trimspaces#1{%
+ \romannumeral-`0\pgfutil@trimspaces@\noexpand#1Q Q}
+\def\pgfutil@trimspaces@#1 Q{\pgfutil@trimspaces@@#1Q}
+\def\pgfutil@trimspaces@@#1Q#2{#1}
+\catcode`\Q=11
+
% \pgfutil@ifundefined{<macro name with backslash>}
% {<is undefined code>}{<is defined code>}
%
@@ -99,6 +109,20 @@
\def\:{\pgfutil@xifnch} \expandafter\gdef\: {\futurelet\pgfutil@let@token\pgfutil@ifnch}
}
+% pgfutil@ignorespaces
+
+\def\pgfutil@ignorespaces
+ {\ifx\pgfutil@let@token\pgfutil@sptoken
+ \expandafter\pgfutil@ignorespaces@helper
+ \else
+ \expandafter\pgfutil@next
+ \fi}
+
+{
+ \def\:{\pgfutil@ignorespaces@helper}
+ \expandafter\gdef\: {\futurelet\pgfutil@let@token\pgfutil@ignorespaces}
+}
+
% pgfutil@in@
\newif\ifpgfutil@in@
@@ -106,13 +130,13 @@
% Usage:
% \pgfutil@in@{one}{three two one}
% \ifpgfutil@in@
-% -> will be true!
+% -> will be true!
% \else
% \fi
%
% \pgfutil@in@{,}{1234,456567}
% \ifpgfutil@in@
-% -> will be true!
+% -> will be true!
% \else
% \fi
\def\pgfutil@in@#1#2{%
@@ -145,7 +169,7 @@
% pgfutil@IfFileExists
-%\chardef\pgfutil@inputcheck0
+\chardef\pgfutil@inputcheck0
\def\pgfutil@IfFileExists#1#2#3{%
\openin\pgfutil@inputcheck=#1 %
\ifeof\pgfutil@inputcheck
@@ -308,58 +332,119 @@
%
\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}%
- }%
+ \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
+% Converts an arbitrary command (without arguments) to a string in which all characters
+% have category 12.
+%
+% #1: a macro name (which takes no arguments)
+% #2: a macro name which will be assigned to '#1' converted to string.
+%
+% This uses '\meaning#1' hackery.
+\def\pgfutil@command@to@string#1#2{%
+ \expandafter\pgfutil@command@to@string@@\meaning#1\pgfutil@EOI{#2}%
+}%
+\xdef\pgfutil@glob@TMPa{\meaning\pgfutil@empty}%
+\expandafter\def\expandafter\pgfutil@command@to@string@@\pgfutil@glob@TMPa#1\pgfutil@EOI#2{%
+ \def#2{#1}%
+}%
+\begingroup
+\catcode`\|=0
+\catcode`\\=12
+|gdef|pgfutil@backslash@as@other{\}%
+|endgroup
+
+% Checks if the token sequence #1 (unexpanded) contains a macro and
+% invokes #2 if so and #3 if not.
+\def\pgfutilifcontainsmacro#1#2#3{%
+ \def\pgf@marshal{#1}%
+ \pgfutil@command@to@string\pgf@marshal\pgf@marshal
+ \edef\pgf@marshal{\noexpand\pgfutil@in@{\pgfutil@backslash@as@other}{\pgf@marshal}}%
+ \pgf@marshal
+ \ifpgfutil@in@
+ \def\pgf@marshal{#2}%
+ \else
+ \def\pgf@marshal{#3}%
+ \fi
+ \pgf@marshal
+}%
+
+% Tests if string '#2' starts with pattern '#1'.
+%
+% If so, it executes #3 and defines \pgfretval to contain the
+% suffix which is not equal to #1. Otherwise it executes #4.
+\def\pgfutilifstartswith#1#2#3#4{%
+ \def\pgfutilifstartswith@ ##1#1##2\pgf@EOI{%
+ \def\pgfutil@tmp{##1}%
+ \ifx\pgfutil@tmp\pgfutil@empty
+ % Ah - a hit!
+ %
+ % define \pgfretval to be the suffix...
+ \def\pgfutil@tmp#1####1\pgf@EOI{%
+ \def\pgfretval{####1}%
+ }%
+ \pgfutil@tmp#2\pgf@EOI%
+ %
+ % ... and execute the <true> code:
+ #3\relax%
+ \else
+ % hm. No such prefix.
+ #4\relax%
+ \fi
+ }%
+ \pgfutilifstartswith@#2--#1\pgf@EOI%
+}%
+
% Usage:
% \pgfutilstrreplace{<token>}{<replacement>}{<string>}
%
@@ -369,138 +454,286 @@
% #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}%
+ \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
+ \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.
+% {<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.
+% {<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}
+% {0.24}{1}
+% {-0.97}{0}
% }{
-% {-7}
-% {18}
+% {-7}
+% {18}
% }
% -> yields \pgfmathresult={−18.55618}{−2.54642}
%
% The algorithm employs column pivotisation.
+%
+% If the matrix is singular, the routine will return {}.
\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
+ \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
+ \tmpa=\csname m\Pa a\endcsname pt %
+ \ifdim\tmpa<0pt \tmpa=-\tmpa\fi
+ \ifdim\tmpa<0.0001pt
+ % singular matrix!
+ \let\pgfmathresult=\pgfutil@empty
+ \else
+ \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
+ %
+ \tmpa=\csname \Pb b\endcsname%
+ \ifdim\tmpa<0pt \tmpa=-\tmpa\fi
+ \ifdim\tmpa<0.0001pt
+ % singular matrix!
+ \let\pgfmathresult=\pgfutil@empty
+ \else
+ % 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 := 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}%
+ }%
+ \fi
+ \fi
+ \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
+ \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\pgfutilsolvetwotwoleqfloat@ifislarger#1#2#3#4{%
+ \pgfmathfloatabs@{#1}\let\tmpa=\pgfmathresult
+ \pgfmathfloatabs@{#2}\let\tmpb=\pgfmathresult
+ \pgfmathfloatlessthan@{\tmpb}{\tmpa}%
+ \ifpgfmathfloatcomparison
+ #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\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
+ \ra=#1pt \rb=#2pt
+}%
+\def\pgfutilsolvetwotwoleqfloat@A#1#2#3#4{%
+ \pgfmathfloatparsenumber{#1}\let\maa=\pgfmathresult
+ \pgfmathfloatparsenumber{#2}\let\mab=\pgfmathresult
+ \pgfmathfloatparsenumber{#3}\let\mba=\pgfmathresult
+ \pgfmathfloatparsenumber{#4}\let\mbb=\pgfmathresult
+}
+\def\pgfutilsolvetwotwoleqfloat@r#1#2{%
+ \pgfmathfloatparsenumber{#1}\let\ra=\pgfmathresult
+ \pgfmathfloatparsenumber{#2}\let\rb=\pgfmathresult
+}%
+
+% Same as \pgfutilsolvetwotwoleq, but using floating point
+% arithmetics. The return value is still in fixed point.
+\def\pgfutilsolvetwotwoleqfloat#1#2{%
+ \begingroup
+ \pgfmathfloatcreate{1}{1.0}{-4}% FIXME : use a smaller threshold for FPU?
+ \let\thresh=\pgfmathresult
+ %
+ \edef\pgf@temp{#1}%
+ \expandafter\pgfutilsolvetwotwoleqfloat@A\pgf@temp
+ \edef\pgf@temp{#2}%
+ \expandafter\pgfutilsolvetwotwoleqfloat@r\pgf@temp
+ %
+ \pgfutilsolvetwotwoleqfloat@ifislarger\maa\mba{%
+ % identity "permutation":
+ \def\Pa{a}%
+ \def\Pb{b}%
+ }{%
+ % permutation matrix: switch rows!
+ \def\Pa{b}%
+ \def\Pb{a}%
+ }%
+ % \pivot := 1/aa
+ \expandafter\pgfmathfloatabs@\expandafter{\csname m\Pa a\endcsname}%
+ \let\tmpa=\pgfmathresult
+ \pgfmathfloatlessthan@{\tmpa}{\thresh}%
+ \ifpgfmathfloatcomparison
+ % singular matrix!
+ \let\pgfmathresult=\pgfutil@empty
+ \else
+ \expandafter\pgfmathfloatreciprocal@\expandafter{\csname m\Pa a\endcsname}%
+ \let\pivot=\pgfmathresult
+ %
+ % \factor := 1/aa * ba
+ \expandafter\pgfmathfloatmultiply@\expandafter{\csname m\Pb a\endcsname}{\pivot}%
+ \let\factor=\pgfmathresult
+ \expandafter\let\csname m\Pb a\endcsname=\factor
+ %
+ % bb -= ba/aa * ab
+ \expandafter\pgfmathfloatmultiply@\expandafter{\csname m\Pa b\endcsname}{\factor}%
+ \let\tmpa=\pgfmathresult
+ \expandafter\pgfmathfloatsubtract@\expandafter{\csname m\Pb b\endcsname}{\tmpa}%
+ \expandafter\let\csname m\Pb b\endcsname=\pgfmathresult
+ %
+ % rb -= ba/aa * ra
+ \expandafter\pgfmathfloatmultiply@\expandafter{\csname r\Pa\endcsname}{\factor}%
+ \let\tmpa=\pgfmathresult
+ \expandafter\pgfmathfloatsubtract@\expandafter{\csname r\Pb\endcsname}{\tmpa}%
+ \expandafter\let\csname r\Pb\endcsname=\pgfmathresult
+ %
+ \expandafter\pgfmathfloatabs@\expandafter{\csname m\Pb b\endcsname}%
+ \let\tmpa=\pgfmathresult
+ \pgfmathfloatlessthan@{\tmpa}{\thresh}%
+ \ifpgfmathfloatcomparison
+ % singular matrix!
+ \let\pgfmathresult=\pgfutil@empty
+ \else
+ % xb := rb / bb (the modified rb and modified bb!)
+ \edef\pgf@marshal{
+ \noexpand\pgfmathfloatdivide@
+ {\csname r\Pb\endcsname}
+ {\csname m\Pb b\endcsname}%
+ }%
+ \pgf@marshal
+ \expandafter\let\csname pgfmathresult\Pb\endcsname=\pgfmathresult
+ \let\tmpa=\pgfmathresult
+ %
+ % ra := ra - xb * ab
+ \expandafter\pgfmathfloatmultiply@\expandafter{\csname m\Pa b\endcsname}{\tmpa}%
+ \let\tmpa=\pgfmathresult
+ \expandafter\pgfmathfloatsubtract@\expandafter{\csname r\Pa\endcsname}{\tmpa}%
+ \expandafter\let\csname r\Pa\endcsname=\pgfmathresult
+ %
+ % xa := 1/aa * ra (the modified ra!)
+ \expandafter\pgfmathfloatmultiply@\expandafter{\csname r\Pa\endcsname}{\pivot}%
+ \expandafter\let\csname pgfmathresult\Pa\endcsname=\pgfmathresult
+ %
+ \edef\pgfmathresult{%
+ {\csname pgfmathresult\Pa\endcsname}%
+ {\csname pgfmathresult\Pb\endcsname}%
+ }%
+ \expandafter\pgfutilsolvetwotwoleqfloat@to@pgf@range\pgfmathresult
+ \fi
+ \fi
+ \pgfmath@smuggleone\pgfmathresult
+ \endgroup
+}%
+
+
+\def\pgfutilsolvetwotwoleqfloat@to@pgf@range#1#2{%
+ \pgfmathfloatcreate{1}{1.6}{4}\let\pgfutilsolvetwotwoleqfloat@to@pgf@range@max=\pgfmathresult
+ \pgfmathfloatabs@{#1}%
+ \expandafter\pgfmathfloatlessthan@\expandafter{\pgfmathresult}{\pgfutilsolvetwotwoleqfloat@to@pgf@range@max}%
+ \ifpgfmathfloatcomparison
+ \pgfmathfloatabs@{#2}%
+ \expandafter\pgfmathfloatlessthan@\expandafter{\pgfmathresult}{\pgfutilsolvetwotwoleqfloat@to@pgf@range@max}%
+ \ifpgfmathfloatcomparison
+ % ok.
+ \pgfmathfloattofixed{#1}\let\tmpa=\pgfmathresult
+ \pgfmathfloattofixed{#2}%
+ \edef\pgfmathresult{{\tmpa}{\pgfmathresult}}%
+ \else
+ % singular (because PGF cannot represent its result
+ \let\pgfmathresult=\pgfutil@empty
+ \fi
+ \else
+ % singular (because PGF cannot represent its result
+ \let\pgfmathresult=\pgfutil@empty
+ \fi
}%
% there are funny programs which overwrite \read and \write (like
@@ -544,18 +777,36 @@
\def\pgfutil@directlua#1{}
\def\pgfutil@luaescapestring#1{}
\fi
+
+
+\def\pgfutil@shellescape@lua@eightseven#1{%
+ \pgfutil@directlua{os.execute("\pgfutil@luaescapestring{#1}")}%
+}%
+\def\pgfutil@shellescape#1{%
+ \immediate\write18{#1}%
+}%
+\pgfutil@IfUndefined{directlua}{%
+}{%
+ \pgfutil@IfUndefined{lastsavedimageresourcepages}{%
+ % Ah - an old version of luatex. It still supports \write18
+ }{%
+ % take the new variant...
+ \let\pgfutil@shellescape=\pgfutil@shellescape@lua@eightseven
+ }%
+}%
+
% End of luatex stuff
% Advances a number stored in a macro and writes the result back into
% the macro.
% #1 is a macro containing a number.
\def\pgfutil@advancestringcounter#1{%
- \begingroup
- \c@pgf@counta=#1\relax
- \advance\c@pgf@counta by1
- \edef#1{\the\c@pgf@counta}%
- \pgfmath@smuggleone#1%
- \endgroup
+ \begingroup
+ \c@pgf@counta=#1\relax
+ \advance\c@pgf@counta by1
+ \edef#1{\the\c@pgf@counta}%
+ \pgfmath@smuggleone#1%
+ \endgroup
}%
\input pgfutil-common-lists.tex
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 ebc04d012e9..16ba0611783 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-context.def
@@ -17,7 +17,7 @@
\def\pgfutil@aux@read@hook{%
\pgfutil@IfFileExists{\jobname.pgf}{\input \jobname.pgf\relax}{}
\csname newwrite\endcsname\pgfutil@auxout
- \csname openout\endcsname\pgfutil@auxout\jobname.pgf\relax
+ \immediate\csname openout\endcsname\pgfutil@auxout\jobname.pgf\relax
}
\def\pgfutil@writetoaux#1{\write\pgfutil@auxout{#1}}
@@ -27,6 +27,7 @@
\def\pgfutil@emu@rgb#1#2,#3,#4\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{rgb}{#2,#3,#4}}}
\def\pgfutil@emu@gray#1#2\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{rgb}{#2,#2,#2}}}
+\def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{cmyk}{#2,#3,#4,#5}}}
% no need for x colors (users can load it if needed)
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 6c740514bba..aad781a60ef 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
@@ -28,7 +28,17 @@
\def\pgfutil@definecolor{\definecolor}
\def\pgfutil@color{\color}
-\def\pgfutil@colorlet{\colorlet}
+\def\pgfutil@colorlet#1#2{%
+ % If the color is a defined named color, we have to use the [named]
+ % option for colorlet to force xcolor to perform color model
+ % conversion.
+ \expandafter\ifx\csname\expandafter\string\csname color@#2\endcsname\endcsname\relax
+ \colorlet{#1}{#2}%
+ \else
+ \colorlet[named]{#1}{#2}%
+ \fi
+}
+
\def\pgfutil@extractcolorspec{\extractcolorspec}
\def\pgfutil@convertcolorspec{\convertcolorspec}
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 b05887f84cf..3d7573f7071 100644
--- a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def
@@ -16,7 +16,7 @@
\def\pgfutil@aux@read@hook{
\pgfutil@IfFileExists{\jobname.pgf}{\input \jobname.pgf\relax}{}
\csname newwrite\endcsname\pgfutil@auxout
- \csname openout\endcsname\pgfutil@auxout\jobname.pgf
+ \immediate\csname openout\endcsname\pgfutil@auxout\jobname.pgf
}
\def\pgfutil@writetoaux#1{\write\pgfutil@auxout{#1}}
@@ -160,19 +160,23 @@
\ifx\pdfoutput\relax\alloc@0\count\countdef\insc@unt\pdfoutput\fi
\def\pgfutil@guessdriver{
- \ifx\HCode\@undefined%
- \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%
- \else%
- \def\pgfsysdriver{pgfsys-tex4ht.def}% should be right
- \fi%
+ \ifx\directlua\@undefined
+ \ifx\HCode\@undefined%
+ \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%
+ \else%
+ \def\pgfsysdriver{pgfsys-tex4ht.def}% should be right
+ \fi%
+ \else
+ \def\pgfsysdriver{pgfsys-luatex.def}%
+ \fi
}
diff --git a/Master/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty b/Master/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
index 05bc35f3b57..710eea546b4 100644
--- a/Master/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
+++ b/Master/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
@@ -10,7 +10,7 @@
\RequirePackage{pgfrcs}
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/latex/pgf/basiclayer/pgf.sty,v 1.15 2015/08/07 10:17:34 cfeuersaenger Exp $
+\ProvidesPackageRCS{pgf.sty}
\def\pgf@draft{}
\DeclareOption{draft}{\def\pgf@draft{\pgf@draftmodetrue}}
diff --git a/Master/texmf-dist/tex/latex/pgf/compatibility/pgfarrows.sty b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfarrows.sty
index 2c0a90b4fa5..419be0065b2 100644
--- a/Master/texmf-dist/tex/latex/pgf/compatibility/pgfarrows.sty
+++ b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfarrows.sty
@@ -9,7 +9,7 @@
\RequirePackage{pgfrcs}
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/latex/pgf/compatibility/pgfarrows.sty,v 1.3 2006/10/11 15:22:27 tantau Exp $
+\ProvidesPackageRCS{pgfarrows.sty}
\RequirePackage{pgf}
diff --git a/Master/texmf-dist/tex/latex/pgf/compatibility/pgfautomata.sty b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfautomata.sty
index 965fa30fed7..d43cdd4f782 100644
--- a/Master/texmf-dist/tex/latex/pgf/compatibility/pgfautomata.sty
+++ b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfautomata.sty
@@ -9,7 +9,7 @@
\RequirePackage{pgfrcs}
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/latex/pgf/compatibility/pgfautomata.sty,v 1.3 2006/10/11 15:22:27 tantau Exp $
+\ProvidesPackageRCS{pgfautomata.sty}
\RequirePackage{pgf}
diff --git a/Master/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty
index 09f6fda3149..571f2e5b3c2 100644
--- a/Master/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty
+++ b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty
@@ -9,7 +9,7 @@
\RequirePackage{pgfrcs}
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/latex/pgf/compatibility/pgfcomp-version-0-65.sty,v 1.7 2007/07/03 07:52:35 tantau Exp $
+\ProvidesPackageRCS{pgfcomp-version-0-65.sty}
\def\pgfdirection#1{\csname pgf@direction#1\endcsname}
diff --git a/Master/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty
index f279fc89112..470868e793b 100644
--- a/Master/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty
+++ b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty
@@ -9,7 +9,7 @@
\RequirePackage{pgfrcs}
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/latex/pgf/compatibility/pgfcomp-version-1-18.sty,v 1.1 2007/07/23 21:23:14 tantau Exp $
+\ProvidesPackageRCS{pgfcomp-version-1-18.sty}
\def\pgfsetshapeinnerxsep#1{\pgfset{inner xsep=#1}}
\def\pgfsetshapeinnerysep#1{\pgfset{inner ysep=#1}}
diff --git a/Master/texmf-dist/tex/latex/pgf/compatibility/pgfheaps.sty b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfheaps.sty
index 9d4a1324025..ed5a95c1530 100644
--- a/Master/texmf-dist/tex/latex/pgf/compatibility/pgfheaps.sty
+++ b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfheaps.sty
@@ -9,7 +9,7 @@
\RequirePackage{pgfrcs}
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/latex/pgf/compatibility/pgfheaps.sty,v 1.3 2006/10/11 15:22:27 tantau Exp $
+\ProvidesPackageRCS{pgfheaps.sty}
\RequirePackage{pgf}
diff --git a/Master/texmf-dist/tex/latex/pgf/compatibility/pgfnodes.sty b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfnodes.sty
index 1308cc761b2..33a76867961 100644
--- a/Master/texmf-dist/tex/latex/pgf/compatibility/pgfnodes.sty
+++ b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfnodes.sty
@@ -9,7 +9,7 @@
\RequirePackage{pgfrcs}
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/latex/pgf/compatibility/pgfnodes.sty,v 1.3 2006/10/11 15:22:27 tantau Exp $
+\ProvidesPackageRCS{pgfnodes.sty}
\RequirePackage{pgf}
diff --git a/Master/texmf-dist/tex/latex/pgf/compatibility/pgfshade.sty b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfshade.sty
index 373fbb06837..29d430e34f7 100644
--- a/Master/texmf-dist/tex/latex/pgf/compatibility/pgfshade.sty
+++ b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfshade.sty
@@ -9,7 +9,7 @@
\RequirePackage{pgfrcs}
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/latex/pgf/compatibility/pgfshade.sty,v 1.3 2006/10/11 15:22:27 tantau Exp $
+\ProvidesPackageRCS{pgfshade.sty}
\RequirePackage{pgf}
diff --git a/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.code.tex b/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.code.tex
index 1c20205676b..5850362e9d5 100644
--- a/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.code.tex
+++ b/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.code.tex
@@ -33,7 +33,7 @@
%
%
-\def\pgfmanual@warning#1{\immediate\write16{! Package pgfmanual Warning: #1}}%
+\def\pgfmanual@warning#1{\pgf@typeout{! Package pgfmanual Warning: #1}}%
\pgfkeys{
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
index ba9ed33e243..bdae790399e 100644
--- a/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.pdflinks.code.tex
+++ b/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.pdflinks.code.tex
@@ -53,6 +53,13 @@
\newif\ifpgfmanualshowlabels
+% FIXME : \cleanedhypertarget/\cleanedhyperlink have been introduced
+% in http://pgf.cvs.sourceforge.net/viewvc/pgf/pgf/latex/pgf/doc/pgfmanual.pdflinks.code.tex?r1=1.15&r2=1.16
+% but they are not present on my (CFR) system... what problem did they
+% address/how can we satisfy this dependency?
+\pgfutil@IfUndefined{cleanedhypertarget}{\let\cleanedhypertarget=\hypertarget}{}
+\pgfutil@IfUndefined{cleanedhyperlink}{\let\cleanedhyperlink=\hyperlink}{}
+
\pgfkeys{%
/codeexample/prettyprint/cs arguments/pgfkeys/.initial=1,
/codeexample/prettyprint/cs/pgfkeys/.code 2 args={\pgfmanualpdfref{#1}{#1}\{\pgfmanualprettyprintpgfkeys{#2}\pgfmanualclosebrace},
@@ -135,9 +142,9 @@
\gdef\pgfmanualpdf@installreplacements{%
\def\marg##1{{##1}}%
\def\oarg##1{[##1]}%
- \def\meta##1{<##1>}%
+ \def\meta##1{meta(##1)}%
\def\x{x}%
- \def\textbackslash{<CS>}%
+ \def\textbackslash{back/}%
\def\\{\textbackslash}%
\def\space{:}%
\edef\ {\space}%
@@ -231,9 +238,9 @@
\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@@}%
\ifvmode%
- \expandafter\hypertarget\expandafter{\pgfmanualpdflabel@@}{#2}%
+ \expandafter\cleanedhypertarget\expandafter{\pgfmanualpdflabel@@}{#2}%
\else%
- {\setbox0=\hbox{\raise1em\hbox{\expandafter\hypertarget\expandafter{\pgfmanualpdflabel@@}{}}}\ht0=0pt\box0}#2%
+ {\setbox0=\hbox{\raise1em\hbox{\expandafter\cleanedhypertarget\expandafter{\pgfmanualpdflabel@@}{}}}\ht0=0pt\box0}#2%
\fi%
\else
#2%
@@ -280,7 +287,7 @@
}%
\def\pgfmanualpdfref@#1#2{%
\pgfkeysgetvalue{/pdflinks/internal link prefix}\pgfmanual@temp
- \expandafter\hyperlink\expandafter{\pgfmanual@temp.#1}{\pgfkeysvalueof{/pdflinks/render hyperlink/.@cmd}{#2}\pgfeov}%
+ \expandafter\cleanedhyperlink\expandafter{\pgfmanual@temp.#1}{\pgfkeysvalueof{/pdflinks/render hyperlink/.@cmd}{#2}\pgfeov}%
\ifpgfmanualshowlabels
\pgfkeysvalueof{/pdflinks/show labels code/.@cmd}{#1}\pgfeov
\fi
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
index 3ef113dc154..f01db1e2cee 100644
--- a/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex
+++ b/Master/texmf-dist/tex/latex/pgf/doc/pgfmanual.prettyprinter.code.tex
@@ -425,14 +425,14 @@
}%
\def\pgfmanual@pretty@collectpoint{%
- \let\pgfmanualprettyprinterhandlecollectedargs=\pgfmanual@pretty@collectargs@finish@collectpoint
+ \let\pgfmanualprettyprinterhandlecollectedargsVtwo=\pgfmanual@pretty@collectargs@finish@collectpoint
\expandafter\pgfmanualprettyprintercollectupto\pgfmanual@pretty@rroundbrace
{\afterpgfmanual@pretty@collectpoint}%
}
{
\catcode`\:=12
-\gdef\pgfmanual@pretty@collectargs@finish@collectpoint#1{%
+\gdef\pgfmanual@pretty@collectargs@finish@collectpoint#1#2{%
\expandafter\pgfutil@in@\pgfmanual@pretty@colon{#1}%
\ifpgfutil@in@
\def\pgfmanual@pretty@collectpoint@getcoordsystem##1:##2\relax{%
@@ -449,14 +449,14 @@
\expandafter\def\expandafter\pgfmanual@loc@TMPa\expandafter{\expandafter{\pgfmanual@pretty@glob@TMPa}{##2}}%
\expandafter\pgfmanual@loc@TMPb\pgfmanual@loc@TMPa\pgfeov
}%
- \ifpgfmanualprettyprinterfoundterminator
+ \if1#2%
\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
+ \if1#2%
\pgfmanual@loc@TMPb(#1)\pgfeov
\else
\pgfmanual@loc@TMPb(#1\pgfeov
@@ -477,7 +477,7 @@
% a csname may only use letters. And: only letters have a
% positive lcccode!
\ifnum\lccode`#1=0
- \ifx\pgfmanual@loc@TMPb @%
+ \ifx\pgfmanual@loc@TMPb\pgfmanual@attext%
% ok, we may also accept an `@':
\edef\pgfmanual@loc@TMPa{\pgfmanual@loc@TMPa #1}%
\else
@@ -492,6 +492,7 @@
\pgfmanual@pretty@collectcs@loop@NEXT
}%
\def\afterpgfmanual@pretty@cs{\pgfmanual@pretty@mainloop}%
+\def\pgfmanual@attext{@}
\def\pgfmanual@pretty@collectcs@loop@END{%
\pgfkeysifdefined{/codeexample/prettyprint/cs arguments/\pgfmanual@loc@TMPa}{%
@@ -703,12 +704,25 @@
\newif\ifpgfmanualprettyprinterfoundterminator
+\def\pgfmanualprettyprinterhandlecollectedargsVtwo@default#1#2{%
+ \if1#2%
+ \pgfmanualprettyprinterfoundterminatortrue
+ \else
+ \pgfmanualprettyprinterfoundterminatorfalse
+ \fi
+ \pgfmanualprettyprinterhandlecollectedargs{#1}%
+}%
+\def\pgfmanualprettyprintercollectupto@restore@callback{%
+ \let\pgfmanualprettyprinterhandlecollectedargsVtwo=\pgfmanualprettyprinterhandlecollectedargsVtwo@default
+}%
+\pgfmanualprettyprintercollectupto@restore@callback
+
% 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.
+% \pgfmanualprettyprinterhandlecollectedargsVtwo has been invoked.
%
% PRECONDITION:
% there is a large token list following
@@ -717,17 +731,17 @@
% POSTCONDITION:
% - the arguments will be collected as
% '<result> := <token list>'
-% and then, \pgfmanualprettyprinterhandlecollectedargs{<result>} will be
-% invoked. Just define \pgfmanualprettyprinterhandlecollectedargs
+% and then,
+% \pgfmanualprettyprinterhandlecollectedargsVtwo{<result>}{<found terminator>? 1 : 0} will be
+% invoked. Just define
+% \pgfmanualprettyprinterhandlecollectedargsVtwo
% 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
@@ -756,8 +770,8 @@
\ifnum\c@pgfmanual@pretty@openbracecount>0
\noexpand\pgfmanualprettyprinterarghasunmatchedbracestrue
\fi
- \noexpand\pgfmanualprettyprinterfoundterminatorfalse
- \noexpand\pgfmanualprettyprinterhandlecollectedargs{\the\t@pgfmanual@currentarg}%
+ \noexpand\pgfmanualprettyprinterhandlecollectedargsVtwo{\the\t@pgfmanual@currentarg}{0}%
+ \noexpand\pgfmanualprettyprintercollectupto@restore@callback
\the\t@afterpgfmanualprettyprinterhandlecollected
\noexpand\pgfmanual@EOI% <- put this token back into token list!
}%
@@ -785,7 +799,8 @@
% do NOT include the delimit token.
\edef\pgfmanual@pretty@collectupto@loop@NEXT{%
\noexpand\endgroup
- \noexpand\pgfmanualprettyprinterhandlecollectedargs{\the\t@pgfmanual@currentarg}%
+ \noexpand\pgfmanualprettyprinterhandlecollectedargsVtwo{\the\t@pgfmanual@currentarg}{1}%
+ \noexpand\pgfmanualprettyprintercollectupto@restore@callback
\the\t@afterpgfmanualprettyprinterhandlecollected
}%
\else
@@ -854,13 +869,15 @@
}
\def\pgfmanual@pretty@pgfkeys{%
- \let\pgfmanualprettyprinterhandlecollectedargs=\pgfmanual@pretty@pgfkeys@start
+ \let\pgfmanualprettyprinterhandlecollectedargsVtwo=\pgfmanual@pretty@pgfkeys@start
\pgfmanualprettyprintercollectupto]{\pgfmanual@pretty@mainloop}%%
}%
-\long\def\pgfmanual@pretty@pgfkeys@start#1{%
+\long\def\pgfmanual@pretty@pgfkeys@start#1#2{%
[%
\pgfmanual@pretty@pgfkeys@loop#1\pgfmanual@EOI
- ]%
+ \if1#2%
+ ]%
+ \fi
}%
% iterates through single tokens, detecting key names and values while
% it goes.
@@ -1034,7 +1051,7 @@
\fi
\fi
\if\pgfmanual@pretty@isconsumed0%
- \def\pgfmanualprettyprinterhandlecollectedargs##1{\pgfmanual@pretty@pgfkeys@processvalue{##1}}% the braces will be handled separately.
+ \def\pgfmanualprettyprinterhandlecollectedargsVtwo##1##2{\pgfmanual@pretty@pgfkeys@processvalue{##1}}% the braces will be handled separately.
\def\pgfmanual@pretty@pgfkeys@collectvalue@next{%
\pgfmanualprettyprintercollectupto,{\afterpgfmanual@pretty@collectargs@finish@value}#1%
}%
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
index 2488dfa4e79..67d199476ea 100644
--- a/Master/texmf-dist/tex/latex/pgf/frontendlayer/libraries/tikzlibraryexternal.code.tex
+++ b/Master/texmf-dist/tex/latex/pgf/frontendlayer/libraries/tikzlibraryexternal.code.tex
@@ -29,6 +29,11 @@
%
% ... also used for \pdf@shellescape.
\usepackage{pdftexcmds}
+\pgfutil@IfFileExists{atveryend.sty}{%
+ \usepackage{atveryend}%
+}{%
+ \message{! Package tikz Warning: \string\usepackage{atveryend} impossible. Automatic resolving of references within external files impossible.}%
+}%
% source generic implementation:
\input tikzexternalshared.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 2144e9c7005..c652a2621b9 100644
--- a/Master/texmf-dist/tex/latex/pgf/utilities/pgfpages.sty
+++ b/Master/texmf-dist/tex/latex/pgf/utilities/pgfpages.sty
@@ -338,6 +338,111 @@
}
+\pgfpagesdeclarelayout{6 on 1}
+{
+ \edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
+ \edef\pgfpageoptionwidth{\the\paperheight}
+ \def\pgfpageoptionborder{0pt}
+}
+{
+ \pgfpagesphysicalpageoptions
+ {%
+ logical pages=6,%
+ physical height=\pgfpageoptionheight,%
+ physical width=\pgfpageoptionwidth%
+ }
+ \ifdim\paperheight>\paperwidth\relax
+ % put side-by-side
+ \pgfpageslogicalpageoptions{1}
+ {%
+ border shrink=\pgfpageoptionborder,%
+ resized width=.25\pgfphysicalwidth,%
+ resized height=.5\pgfphysicalheight,%
+ center=\pgfpoint{.167\pgfphysicalwidth}{.75\pgfphysicalheight}%
+ }%
+ \pgfpageslogicalpageoptions{2}
+ {%
+ border shrink=\pgfpageoptionborder,%
+ resized width=.25\pgfphysicalwidth,%
+ resized height=.5\pgfphysicalheight,%
+ center=\pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight}%
+ }%
+ \pgfpageslogicalpageoptions{3}
+ {%
+ border shrink=\pgfpageoptionborder,%
+ resized width=.25\pgfphysicalwidth,%
+ resized height=.5\pgfphysicalheight,%
+ center=\pgfpoint{.833\pgfphysicalwidth}{.75\pgfphysicalheight}%
+ }%
+ \pgfpageslogicalpageoptions{4}
+ {%
+ border shrink=\pgfpageoptionborder,%
+ resized width=.25\pgfphysicalwidth,%
+ resized height=.5\pgfphysicalheight,%
+ center=\pgfpoint{.167\pgfphysicalwidth}{.25\pgfphysicalheight}%
+ }%
+ \pgfpageslogicalpageoptions{5}
+ {%
+ border shrink=\pgfpageoptionborder,%
+ resized width=.25\pgfphysicalwidth,%
+ resized height=.5\pgfphysicalheight,%
+ center=\pgfpoint{.5\pgfphysicalwidth}{.25\pgfphysicalheight}%
+ }%
+ \pgfpageslogicalpageoptions{6}
+ {%
+ border shrink=\pgfpageoptionborder,%
+ resized width=.25\pgfphysicalwidth,%
+ resized height=.5\pgfphysicalheight,%
+ center=\pgfpoint{.833\pgfphysicalwidth}{.25\pgfphysicalheight}%
+ }%
+ \else
+ % stack on top of one another
+ \pgfpageslogicalpageoptions{1}
+ {%
+ border shrink=\pgfpageoptionborder,%
+ resized width=.5\pgfphysicalwidth,%
+ resized height=.25\pgfphysicalheight,%
+ center=\pgfpoint{.25\pgfphysicalwidth}{.833\pgfphysicalheight}%
+ }%
+ \pgfpageslogicalpageoptions{2}
+ {%
+ border shrink=\pgfpageoptionborder,%
+ resized width=.5\pgfphysicalwidth,%
+ resized height=.25\pgfphysicalheight,%
+ center=\pgfpoint{.75\pgfphysicalwidth}{.833\pgfphysicalheight}%
+ }%
+ \pgfpageslogicalpageoptions{3}
+ {%
+ border shrink=\pgfpageoptionborder,%
+ resized width=.5\pgfphysicalwidth,%
+ resized height=.25\pgfphysicalheight,%
+ center=\pgfpoint{.25\pgfphysicalwidth}{.5\pgfphysicalheight}%
+ }%
+ \pgfpageslogicalpageoptions{4}
+ {%
+ border shrink=\pgfpageoptionborder,%
+ resized width=.5\pgfphysicalwidth,%
+ resized height=.25\pgfphysicalheight,%
+ center=\pgfpoint{.75\pgfphysicalwidth}{.5\pgfphysicalheight}%
+ }%
+ \pgfpageslogicalpageoptions{5}
+ {%
+ border shrink=\pgfpageoptionborder,%
+ resized width=.5\pgfphysicalwidth,%
+ resized height=.25\pgfphysicalheight,%
+ center=\pgfpoint{.25\pgfphysicalwidth}{.167\pgfphysicalheight}%
+ }%
+ \pgfpageslogicalpageoptions{6}
+ {%
+ border shrink=\pgfpageoptionborder,%
+ resized width=.5\pgfphysicalwidth,%
+ resized height=.25\pgfphysicalheight,%
+ center=\pgfpoint{.75\pgfphysicalwidth}{.167\pgfphysicalheight}%
+ }%
+ \fi
+}
+
+
\pgfpagesdeclarelayout{8 on 1}
{
\edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
diff --git a/Master/texmf-dist/tex/latex/pgf/utilities/xxcolor.sty b/Master/texmf-dist/tex/latex/pgf/utilities/xxcolor.sty
index 7c2d666b8fc..d085debebdf 100644
--- a/Master/texmf-dist/tex/latex/pgf/utilities/xxcolor.sty
+++ b/Master/texmf-dist/tex/latex/pgf/utilities/xxcolor.sty
@@ -69,7 +69,7 @@
\g@addto@macro\XC@mcolor{%
\ifnum\XC@nummixins>0%
- \pgfutil@namelet{\string\color@XC@mixtmp}{\string\color@.}%
+ \colorlet{XC@mixtmp}{.}%
\applycolormixins{XC@mixtmp}%
\pgfutil@namelet{current@color}{\string\color@XC@mixtmp}%
\fi%
diff --git a/Master/texmf-dist/tex/plain/pgf/basiclayer/pgf.tex b/Master/texmf-dist/tex/plain/pgf/basiclayer/pgf.tex
index 4c4e4c60de6..777bafc505c 100644
--- a/Master/texmf-dist/tex/plain/pgf/basiclayer/pgf.tex
+++ b/Master/texmf-dist/tex/plain/pgf/basiclayer/pgf.tex
@@ -13,7 +13,7 @@
\input pgfrcs.tex
-\ProvidesPackageRCS $Header: /cvsroot/pgf/pgf/plain/pgf/basiclayer/pgf.tex,v 1.10 2008/01/15 17:17:22 tantau Exp $
+\ProvidesPackageRCS{pgf.tex}
\input pgfcore.tex