From 7bfdb1666866c48e9845dbc1402ccf546fac5b1b Mon Sep 17 00:00:00 2001 From: Henri Menke Date: Sun, 19 Dec 2021 16:39:15 +0100 Subject: [PATCH] feat(tests): generate tests from manual examples Signed-off-by: Henri Menke --- testfiles/pgfmanual-en-base-actions.lvt | 179 ++ testfiles/pgfmanual-en-base-animations.lvt | 549 ++++ testfiles/pgfmanual-en-base-arrows.lvt | 79 + testfiles/pgfmanual-en-base-decorations.lvt | 243 ++ testfiles/pgfmanual-en-base-design.lvt | 17 + testfiles/pgfmanual-en-base-images.lvt | 77 + testfiles/pgfmanual-en-base-layers.lvt | 30 + testfiles/pgfmanual-en-base-matrices.lvt | 106 + testfiles/pgfmanual-en-base-nodes.lvt | 211 ++ testfiles/pgfmanual-en-base-paths.lvt | 353 +++ testfiles/pgfmanual-en-base-patterns.lvt | 114 + testfiles/pgfmanual-en-base-plots.lvt | 112 + testfiles/pgfmanual-en-base-points.lvt | 300 ++ testfiles/pgfmanual-en-base-quick.lvt | 42 + testfiles/pgfmanual-en-base-scopes.lvt | 168 ++ testfiles/pgfmanual-en-base-shadings.lvt | 224 ++ .../pgfmanual-en-base-transformations.lvt | 497 ++++ testfiles/pgfmanual-en-base-transparency.lvt | 166 ++ testfiles/pgfmanual-en-dv-axes.lvt | 1345 +++++++++ testfiles/pgfmanual-en-dv-examples.lvt | 88 + testfiles/pgfmanual-en-dv-formats.lvt | 122 + testfiles/pgfmanual-en-dv-introduction.lvt | 29 + testfiles/pgfmanual-en-dv-main.lvt | 206 ++ testfiles/pgfmanual-en-dv-polar.lvt | 190 ++ testfiles/pgfmanual-en-dv-stylesheets.lvt | 2516 +++++++++++++++++ testfiles/pgfmanual-en-dv-visualizers.lvt | 322 +++ testfiles/pgfmanual-en-gd-algorithm-layer.lvt | 18 + testfiles/pgfmanual-en-gd-overview.lvt | 87 + testfiles/pgfmanual-en-gd-usage-pgf.lvt | 60 + testfiles/pgfmanual-en-gd-usage-tikz.lvt | 187 ++ testfiles/pgfmanual-en-library-3d.lvt | 90 + testfiles/pgfmanual-en-library-angles.lvt | 60 + testfiles/pgfmanual-en-library-automata.lvt | 134 + testfiles/pgfmanual-en-library-babel.lvt | 22 + .../pgfmanual-en-library-backgrounds.lvt | 134 + testfiles/pgfmanual-en-library-calendar.lvt | 389 +++ testfiles/pgfmanual-en-library-chains.lvt | 226 ++ testfiles/pgfmanual-en-library-circuits.lvt | 732 +++++ .../pgfmanual-en-library-decorations.lvt | 996 +++++++ testfiles/pgfmanual-en-library-edges.lvt | 106 + testfiles/pgfmanual-en-library-er.lvt | 81 + testfiles/pgfmanual-en-library-fit.lvt | 84 + testfiles/pgfmanual-en-library-fixedpoint.lvt | 16 + testfiles/pgfmanual-en-library-folding.lvt | 146 + testfiles/pgfmanual-en-library-fpu.lvt | 193 ++ testfiles/pgfmanual-en-library-lsystems.lvt | 82 + testfiles/pgfmanual-en-library-math.lvt | 225 ++ testfiles/pgfmanual-en-library-matrices.lvt | 175 ++ testfiles/pgfmanual-en-library-mindmaps.lvt | 187 ++ testfiles/pgfmanual-en-library-patterns.lvt | 218 ++ .../pgfmanual-en-library-perspective.lvt | 286 ++ testfiles/pgfmanual-en-library-petri.lvt | 177 ++ .../pgfmanual-en-library-plot-handlers.lvt | 325 +++ testfiles/pgfmanual-en-library-rdf.lvt | 189 ++ testfiles/pgfmanual-en-library-shadings.lvt | 73 + testfiles/pgfmanual-en-library-shadows.lvt | 145 + testfiles/pgfmanual-en-library-shapes.lvt | 1233 ++++++++ testfiles/pgfmanual-en-library-spy.lvt | 172 ++ testfiles/pgfmanual-en-library-svg-path.lvt | 16 + testfiles/pgfmanual-en-library-through.lvt | 16 + testfiles/pgfmanual-en-library-trees.lvt | 92 + testfiles/pgfmanual-en-library-turtle.lvt | 34 + testfiles/pgfmanual-en-library-views.lvt | 61 + testfiles/pgfmanual-en-main-body.lvt | 300 ++ testfiles/pgfmanual-en-math-algorithms.lvt | 67 + testfiles/pgfmanual-en-math-commands.lvt | 86 + .../pgfmanual-en-math-numberprinting.lvt | 383 +++ testfiles/pgfmanual-en-math-parsing.lvt | 467 +++ testfiles/pgfmanual-en-module-parser.lvt | 47 + testfiles/pgfmanual-en-pgfcalendar.lvt | 71 + testfiles/pgfmanual-en-pgffor.lvt | 166 ++ testfiles/pgfmanual-en-pgfkeys.lvt | 314 ++ testfiles/pgfmanual-en-pgfkeysfiltered.lvt | 87 + testfiles/pgfmanual-en-pgfsys-animations.lvt | 574 ++++ testfiles/pgfmanual-en-tikz-actions.lvt | 595 ++++ testfiles/pgfmanual-en-tikz-animations.lvt | 752 +++++ testfiles/pgfmanual-en-tikz-arrows.lvt | 744 +++++ testfiles/pgfmanual-en-tikz-coordinates.lvt | 493 ++++ testfiles/pgfmanual-en-tikz-decorations.lvt | 304 ++ testfiles/pgfmanual-en-tikz-design.lvt | 78 + testfiles/pgfmanual-en-tikz-graphs.lvt | 1520 ++++++++++ testfiles/pgfmanual-en-tikz-matrices.lvt | 439 +++ testfiles/pgfmanual-en-tikz-paths.lvt | 438 +++ testfiles/pgfmanual-en-tikz-pics.lvt | 205 ++ testfiles/pgfmanual-en-tikz-plots.lvt | 204 ++ testfiles/pgfmanual-en-tikz-scopes.lvt | 131 + testfiles/pgfmanual-en-tikz-shapes.lvt | 1009 +++++++ .../pgfmanual-en-tikz-transformations.lvt | 199 ++ testfiles/pgfmanual-en-tikz-transparency.lvt | 383 +++ testfiles/pgfmanual-en-tikz-trees.lvt | 358 +++ testfiles/pgfmanual-en-tutorial-Euclid.lvt | 286 ++ testfiles/pgfmanual-en-tutorial-chains.lvt | 416 +++ testfiles/pgfmanual-en-tutorial-map.lvt | 526 ++++ testfiles/pgfmanual-en-tutorial-nodes.lvt | 457 +++ testfiles/pgfmanual-en-tutorial.lvt | 446 +++ testfiles/pgfmanual-en-xxcolor.lvt | 40 + 96 files changed, 28337 insertions(+) create mode 100644 testfiles/pgfmanual-en-base-actions.lvt create mode 100644 testfiles/pgfmanual-en-base-animations.lvt create mode 100644 testfiles/pgfmanual-en-base-arrows.lvt create mode 100644 testfiles/pgfmanual-en-base-decorations.lvt create mode 100644 testfiles/pgfmanual-en-base-design.lvt create mode 100644 testfiles/pgfmanual-en-base-images.lvt create mode 100644 testfiles/pgfmanual-en-base-layers.lvt create mode 100644 testfiles/pgfmanual-en-base-matrices.lvt create mode 100644 testfiles/pgfmanual-en-base-nodes.lvt create mode 100644 testfiles/pgfmanual-en-base-paths.lvt create mode 100644 testfiles/pgfmanual-en-base-patterns.lvt create mode 100644 testfiles/pgfmanual-en-base-plots.lvt create mode 100644 testfiles/pgfmanual-en-base-points.lvt create mode 100644 testfiles/pgfmanual-en-base-quick.lvt create mode 100644 testfiles/pgfmanual-en-base-scopes.lvt create mode 100644 testfiles/pgfmanual-en-base-shadings.lvt create mode 100644 testfiles/pgfmanual-en-base-transformations.lvt create mode 100644 testfiles/pgfmanual-en-base-transparency.lvt create mode 100644 testfiles/pgfmanual-en-dv-axes.lvt create mode 100644 testfiles/pgfmanual-en-dv-examples.lvt create mode 100644 testfiles/pgfmanual-en-dv-formats.lvt create mode 100644 testfiles/pgfmanual-en-dv-introduction.lvt create mode 100644 testfiles/pgfmanual-en-dv-main.lvt create mode 100644 testfiles/pgfmanual-en-dv-polar.lvt create mode 100644 testfiles/pgfmanual-en-dv-stylesheets.lvt create mode 100644 testfiles/pgfmanual-en-dv-visualizers.lvt create mode 100644 testfiles/pgfmanual-en-gd-algorithm-layer.lvt create mode 100644 testfiles/pgfmanual-en-gd-overview.lvt create mode 100644 testfiles/pgfmanual-en-gd-usage-pgf.lvt create mode 100644 testfiles/pgfmanual-en-gd-usage-tikz.lvt create mode 100644 testfiles/pgfmanual-en-library-3d.lvt create mode 100644 testfiles/pgfmanual-en-library-angles.lvt create mode 100644 testfiles/pgfmanual-en-library-automata.lvt create mode 100644 testfiles/pgfmanual-en-library-babel.lvt create mode 100644 testfiles/pgfmanual-en-library-backgrounds.lvt create mode 100644 testfiles/pgfmanual-en-library-calendar.lvt create mode 100644 testfiles/pgfmanual-en-library-chains.lvt create mode 100644 testfiles/pgfmanual-en-library-circuits.lvt create mode 100644 testfiles/pgfmanual-en-library-decorations.lvt create mode 100644 testfiles/pgfmanual-en-library-edges.lvt create mode 100644 testfiles/pgfmanual-en-library-er.lvt create mode 100644 testfiles/pgfmanual-en-library-fit.lvt create mode 100644 testfiles/pgfmanual-en-library-fixedpoint.lvt create mode 100644 testfiles/pgfmanual-en-library-folding.lvt create mode 100644 testfiles/pgfmanual-en-library-fpu.lvt create mode 100644 testfiles/pgfmanual-en-library-lsystems.lvt create mode 100644 testfiles/pgfmanual-en-library-math.lvt create mode 100644 testfiles/pgfmanual-en-library-matrices.lvt create mode 100644 testfiles/pgfmanual-en-library-mindmaps.lvt create mode 100644 testfiles/pgfmanual-en-library-patterns.lvt create mode 100644 testfiles/pgfmanual-en-library-perspective.lvt create mode 100644 testfiles/pgfmanual-en-library-petri.lvt create mode 100644 testfiles/pgfmanual-en-library-plot-handlers.lvt create mode 100644 testfiles/pgfmanual-en-library-rdf.lvt create mode 100644 testfiles/pgfmanual-en-library-shadings.lvt create mode 100644 testfiles/pgfmanual-en-library-shadows.lvt create mode 100644 testfiles/pgfmanual-en-library-shapes.lvt create mode 100644 testfiles/pgfmanual-en-library-spy.lvt create mode 100644 testfiles/pgfmanual-en-library-svg-path.lvt create mode 100644 testfiles/pgfmanual-en-library-through.lvt create mode 100644 testfiles/pgfmanual-en-library-trees.lvt create mode 100644 testfiles/pgfmanual-en-library-turtle.lvt create mode 100644 testfiles/pgfmanual-en-library-views.lvt create mode 100644 testfiles/pgfmanual-en-main-body.lvt create mode 100644 testfiles/pgfmanual-en-math-algorithms.lvt create mode 100644 testfiles/pgfmanual-en-math-commands.lvt create mode 100644 testfiles/pgfmanual-en-math-numberprinting.lvt create mode 100644 testfiles/pgfmanual-en-math-parsing.lvt create mode 100644 testfiles/pgfmanual-en-module-parser.lvt create mode 100644 testfiles/pgfmanual-en-pgfcalendar.lvt create mode 100644 testfiles/pgfmanual-en-pgffor.lvt create mode 100644 testfiles/pgfmanual-en-pgfkeys.lvt create mode 100644 testfiles/pgfmanual-en-pgfkeysfiltered.lvt create mode 100644 testfiles/pgfmanual-en-pgfsys-animations.lvt create mode 100644 testfiles/pgfmanual-en-tikz-actions.lvt create mode 100644 testfiles/pgfmanual-en-tikz-animations.lvt create mode 100644 testfiles/pgfmanual-en-tikz-arrows.lvt create mode 100644 testfiles/pgfmanual-en-tikz-coordinates.lvt create mode 100644 testfiles/pgfmanual-en-tikz-decorations.lvt create mode 100644 testfiles/pgfmanual-en-tikz-design.lvt create mode 100644 testfiles/pgfmanual-en-tikz-graphs.lvt create mode 100644 testfiles/pgfmanual-en-tikz-matrices.lvt create mode 100644 testfiles/pgfmanual-en-tikz-paths.lvt create mode 100644 testfiles/pgfmanual-en-tikz-pics.lvt create mode 100644 testfiles/pgfmanual-en-tikz-plots.lvt create mode 100644 testfiles/pgfmanual-en-tikz-scopes.lvt create mode 100644 testfiles/pgfmanual-en-tikz-shapes.lvt create mode 100644 testfiles/pgfmanual-en-tikz-transformations.lvt create mode 100644 testfiles/pgfmanual-en-tikz-transparency.lvt create mode 100644 testfiles/pgfmanual-en-tikz-trees.lvt create mode 100644 testfiles/pgfmanual-en-tutorial-Euclid.lvt create mode 100644 testfiles/pgfmanual-en-tutorial-chains.lvt create mode 100644 testfiles/pgfmanual-en-tutorial-map.lvt create mode 100644 testfiles/pgfmanual-en-tutorial-nodes.lvt create mode 100644 testfiles/pgfmanual-en-tutorial.lvt create mode 100644 testfiles/pgfmanual-en-xxcolor.lvt diff --git a/testfiles/pgfmanual-en-base-actions.lvt b/testfiles/pgfmanual-en-base-actions.lvt new file mode 100644 index 000000000..644b8a6db --- /dev/null +++ b/testfiles/pgfmanual-en-base-actions.lvt @@ -0,0 +1,179 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usepgflibrary{arrows.meta} +\usepgflibrary{arrows.meta} +\usepgflibrary{arrows.meta} +\usepgflibrary{arrows.meta} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-actions-1} +\begin{pgfpicture} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{1cm}{1cm}} + \pgfpathlineto{\pgfpoint{1cm}{0cm}} + \pgfusepath{fill} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-actions-2} +\begin{pgfpicture} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{1cm}{1cm}} + \pgfpathlineto{\pgfpoint{1cm}{0cm}} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-actions-3} +\begin{pgfpicture} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{1cm}{1cm}} + \pgfpathlineto{\pgfpoint{1cm}{0cm}} + \pgfusepath{stroke,clip} + \pgfpathcircle{\pgfpoint{1cm}{1cm}}{0.5cm} + \pgfusepath{fill} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-actions-4} +\begin{pgfpicture} + \pgfsetlinewidth{1mm} + \pgfpathmoveto{\pgfpoint{0mm}{0mm}} + \pgfpathlineto{\pgfpoint{2cm}{0mm}} + \pgfusepath{stroke} + \pgfsetlinewidth{2\pgflinewidth} % double in size + \pgfpathmoveto{\pgfpoint{0mm}{5mm}} + \pgfpathlineto{\pgfpoint{2cm}{5mm}} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-actions-5} +\begin{pgfpicture} + \pgfsetdash{{0.5cm}{0.5cm}{0.1cm}{0.2cm}}{0cm} + \pgfpathmoveto{\pgfpoint{0mm}{0mm}} + \pgfpathlineto{\pgfpoint{2cm}{0mm}} + \pgfusepath{stroke} + \pgfsetdash{{0.5cm}{0.5cm}{0.1cm}{0.2cm}}{0.1cm} + \pgfpathmoveto{\pgfpoint{0mm}{1mm}} + \pgfpathlineto{\pgfpoint{2cm}{1mm}} + \pgfusepath{stroke} + \pgfsetdash{{0.5cm}{0.5cm}{0.1cm}{0.2cm}}{0.2cm} + \pgfpathmoveto{\pgfpoint{0mm}{2mm}} + \pgfpathlineto{\pgfpoint{2cm}{2mm}} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-actions-6} +\begin{pgfpicture} + \pgfsetlinewidth{1pt} + \color{red} + \pgfpathcircle{\pgfpoint{0cm}{0cm}}{3mm} \pgfusepath{fill,stroke} + \pgfsetstrokecolor{black} + \pgfpathcircle{\pgfpoint{1cm}{0cm}}{3mm} \pgfusepath{fill,stroke} + \color{red} + \pgfpathcircle{\pgfpoint{2cm}{0cm}}{3mm} \pgfusepath{fill,stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-actions-7} +\begin{pgfpicture} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{1cm}{1cm}} + \pgfpathlineto{\pgfpoint{1cm}{0cm}} + \pgfsetlinewidth{2pt} + \pgfsetinnerlinewidth{1pt} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-actions-8} +\begin{pgfpicture} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{1cm}{1cm}} + \pgfpathlineto{\pgfpoint{1cm}{0cm}} + \pgfsetlinewidth{2pt} + \pgfsetinnerlinewidth{1pt} + \pgfsetinnerstrokecolor{red!50} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-actions-9} +\begin{pgfpicture} + \pgfsetarrowsstart{Latex[length=10pt]} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{1cm}{0cm}} + \pgfusepath{stroke} + \pgfsetarrowsstart{Computer Modern Rightarrow} + \pgfpathmoveto{\pgfpoint{0cm}{2mm}} + \pgfpathlineto{\pgfpoint{1cm}{2mm}} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-actions-10} +\begin{pgfpicture} + \pgfsetarrowsstart{Latex[length=10pt]} + \pgfsetarrowsend{Computer Modern Rightarrow} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{1cm}{0cm}} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-actions-11} +\begin{pgfpicture} + \pgfsetarrows{Latex[length=10pt]->>} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{1cm}{0cm}} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-actions-12} +\begin{pgfpicture} + \pgfpathcircle{\pgfpointorigin}{5mm} + \pgfusepath{stroke} + \pgfsetarrows{Latex-} + \pgfsetshortenstart{4pt} + \pgfpathmoveto{\pgfpoint{5mm}{0cm}} % would be on the circle + \pgfpathlineto{\pgfpoint{2cm}{0cm}} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-actions-13} +\begin{pgfpicture} + \pgfseteorule + \pgfpathcircle{\pgfpoint{0mm}{0cm}}{7mm} + \pgfpathcircle{\pgfpoint{5mm}{0cm}}{7mm} + \pgfusepath{fill} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-actions-14} +\begin{pgfpicture} + \pgfsetnonzerorule + \pgfpathcircle{\pgfpoint{0mm}{0cm}}{7mm} + \pgfpathcircle{\pgfpoint{5mm}{0cm}}{7mm} + \pgfusepath{fill} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-actions-15} +Left +\begin{pgfpicture} + \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2ex}{1ex}} + \pgfusepath{use as bounding box} % draws nothing + + \pgfpathcircle{\pgfpointorigin}{2ex} + \pgfusepath{stroke} +\end{pgfpicture} +right. +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-animations.lvt b/testfiles/pgfmanual-en-base-animations.lvt new file mode 100644 index 000000000..347000aa7 --- /dev/null +++ b/testfiles/pgfmanual-en-base-animations.lvt @@ -0,0 +1,549 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usepgfmodule{animations} +\usetikzlibrary{animations} +\def\pgfname{\textsc{pgf}} + +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usetikzlibrary{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usetikzlibrary{views} +\usepgfmodule{animations} +\usetikzlibrary{views} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} +\usepgfmodule{animations} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-animations-1} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-2} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-3} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-4} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-5} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-6} +\tikz { + \foreach \i in {0,0.125,...,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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-7} +\tikz { + \foreach \i in {0,0.125,...,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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-8} +\tikz { + \foreach \i in {0,0.125,...,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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-9} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-10} +\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 }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-11} +\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}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-12} +\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}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-13} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-14} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-15} +\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} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-16} +\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}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-17} +\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}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-18} +\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}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-19} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-20} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-21} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-22} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-23} +\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}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-24} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-25} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-26} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-27} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-28} +\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); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-29} +\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]; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-30} +\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]; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-31} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-32} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-33} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-34} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-35} +\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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-36} +\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!}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-37} +\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!}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-38} +\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!}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-39} +\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} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-40} +\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} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-41} +\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!}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-42} +\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!}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-43} +\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!}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-44} +\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!}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-45} +\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!}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-46} +\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!}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-47} +\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!}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-animations-48} +\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!}; } +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-arrows.lvt b/testfiles/pgfmanual-en-base-arrows.lvt new file mode 100644 index 000000000..b66e21bff --- /dev/null +++ b/testfiles/pgfmanual-en-base-arrows.lvt @@ -0,0 +1,79 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta,bending} + +\begin{document} + +\makeatletter + \def\showvalueofmacro#1{% + \texttt{\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\pgfutil@gobble\expandafter\expandafter\expandafter\string\expandafter\csname#1\endcsname} + }% + +\BEGINBOXTEST{pgfmanual-en-base-arrows-8} +\pgfdeclarearrow{ + name = foo, + parameters = { \the\pgfarrowlength }, + setup code = { + % The different end values: + \pgfarrowssettipend{.25\pgfarrowlength} + \pgfarrowssetlineend{-.25\pgfarrowlength} + \pgfarrowssetvisualbackend{-.5\pgfarrowlength} + \pgfarrowssetbackend{-.75\pgfarrowlength} + % The hull + \pgfarrowshullpoint{.25\pgfarrowlength}{0pt} + \pgfarrowshullpoint{-.75\pgfarrowlength}{.5\pgfarrowlength} + \pgfarrowshullpoint{-.75\pgfarrowlength}{-.5\pgfarrowlength} + % Saves: Only the length: + \pgfarrowssavethe\pgfarrowlength + }, + drawing code = { + \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 } +} +\tikz \draw [-foo] (0,0) -- (8,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-arrows-9} +\pgfdeclarearrow{ + name = foo, + parameters = { \the\pgfarrowlength }, + setup code = { + % The different end values: + \pgfarrowssettipend{.25\pgfarrowlength} + \pgfarrowssetlineend{-.25\pgfarrowlength} + \pgfarrowssetvisualbackend{-.5\pgfarrowlength} + \pgfarrowssetbackend{-.75\pgfarrowlength} + % The hull + \pgfarrowshullpoint{.25\pgfarrowlength}{0pt} + \pgfarrowshullpoint{-.75\pgfarrowlength}{.5\pgfarrowlength} + \pgfarrowshullpoint{-.75\pgfarrowlength}{-.5\pgfarrowlength} + % Saves: Only the length: + \pgfarrowssavethe\pgfarrowlength + }, + drawing code = { + \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 } +} +\tikz \draw [-{foo[length=2cm,bend]}] (0,0) to [bend left] (3,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-arrows-18} +\pgfarrowsthreeparameters{2pt 1} +\showvalueofmacro\pgfarrowstheparameters +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-decorations.lvt b/testfiles/pgfmanual-en-base-decorations.lvt new file mode 100644 index 000000000..0bdc0a337 --- /dev/null +++ b/testfiles/pgfmanual-en-base-decorations.lvt @@ -0,0 +1,243 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{decorations,decorations.pathmorphing} +\usetikzlibrary{decorations,decorations.text} +\usetikzlibrary{decorations} +\usetikzlibrary{decorations,shapes.geometric} +\usetikzlibrary{decorations} +\usetikzlibrary{decorations,decorations.pathmorphing} +\usetikzlibrary{decorations,decorations.pathmorphing} +\usetikzlibrary{decorations,decorations.pathmorphing} +\usetikzlibrary{decorations,decorations.pathmorphing} +\usetikzlibrary{decorations,decorations.pathmorphing} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-decorations-1} +\tikz \draw decorate[decoration=zigzag] {(0,0) -- (3,0)}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-decorations-2} +\tikz \path decorate [decoration={text along path, + text={Some text along a path}}] + { (0,2) .. controls (2,2) and (1,0) .. (3,0) }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-decorations-4} +\pgfdeclaredecoration{example}{initial} +{ + \state{initial}[width=10pt] + { + \pgfpathlineto{\pgfpoint{0pt}{5pt}} + \pgfpathlineto{\pgfpoint{5pt}{5pt}} + \pgfpathlineto{\pgfpoint{5pt}{-5pt}} + \pgfpathlineto{\pgfpoint{10pt}{-5pt}} + \pgfpathlineto{\pgfpoint{10pt}{0pt}} + } + \state{final} + { + \pgfpathlineto{\pgfpointdecoratedpathlast} + } +} +\tikz[decoration=example] +{ + \draw [decorate] (0,0) -- (3,0); + \draw [red,decorate] (0,0) to [out=45,in=135] (3,0); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-decorations-5} +\pgfmathsetseed{1} +\pgfdeclaredecoration{stars}{initial}{ + \state{initial}[width=15pt] + { + \pgfmathparse{round(rnd*100)} + \pgfsetfillcolor{yellow!\pgfmathresult!orange} + \pgfsetstrokecolor{yellow!\pgfmathresult!red} + \pgfnode{star}{center}{}{}{\pgfusepath{stroke,fill}} + } + \state{final} + { + \pgfpathmoveto{\pgfpointdecoratedpathlast} + } +} +\tikz\path[decorate, decoration=stars, star point ratio=2, star points=5, + inner sep=0, minimum size=rnd*10pt+2pt] + (0,0) .. controls (0,2) and (3,2) .. (3,0) + .. controls (3,-3) and (0,0) .. (0,-3) + .. controls (0,-5) and (3,-5) .. (3,-3); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-decorations-6} +\pgfdeclaredecoration{complicated example decoration}{initial} +{ + \state{initial}[width=5pt,next state=up] + { \pgfpathlineto{\pgfpoint{5pt}{0pt}} } + + \state{up}[width=5pt,next state=down] + { + \ifdim\pgfdecoratedremainingdistance>\pgfdecoratedcompleteddistance + % Growing + \pgfpathlineto{\pgfpoint{0pt}{\pgfdecoratedcompleteddistance}} + \pgfpathlineto{\pgfpoint{5pt}{\pgfdecoratedcompleteddistance}} + \pgfpathlineto{\pgfpoint{5pt}{0pt}} + \else + % Shrinking + \pgfpathlineto{\pgfpoint{0pt}{\pgfdecoratedremainingdistance}} + \pgfpathlineto{\pgfpoint{5pt}{\pgfdecoratedremainingdistance}} + \pgfpathlineto{\pgfpoint{5pt}{0pt}} + \fi% + } + \state{down}[width=5pt,next state=up] + { + \ifdim\pgfdecoratedremainingdistance>\pgfdecoratedcompleteddistance + % Growing + \pgfpathlineto{\pgfpoint{0pt}{-\pgfdecoratedcompleteddistance}} + \pgfpathlineto{\pgfpoint{5pt}{-\pgfdecoratedcompleteddistance}} + \pgfpathlineto{\pgfpoint{5pt}{0pt}} + \else + % Shrinking + \pgfpathlineto{\pgfpoint{0pt}{-\pgfdecoratedremainingdistance}} + \pgfpathlineto{\pgfpoint{5pt}{-\pgfdecoratedremainingdistance}} + \pgfpathlineto{\pgfpoint{5pt}{0pt}} + \fi% + } + \state{final} + { + \pgfpathlineto{\pgfpointdecoratedpathlast} + } +} +\begin{tikzpicture}[decoration=complicated example decoration] + \draw decorate{ (0,0) -- (3,0)}; + \fill [red!50,rounded corners=2pt] + decorate {(.5,-2) -- ++(2.5,-2.5)} -- (3,-5) -| (0,-2) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-decorations-7} +\begin{tikzpicture}[decoration={segment length=5pt}] + \draw [help lines] grid (3,2); + \begin{pgfdecoration}{{curveto}{1cm},{zigzag}{2cm},{curveto}{1cm}} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathcurveto + {\pgfpoint{0cm}{2cm}}{\pgfpoint{3cm}{2cm}}{\pgfpoint{3cm}{0cm}} + \end{pgfdecoration} +\pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-decorations-8} +\begin{tikzpicture}[decoration={segment length=5pt}] + \draw [help lines] grid (3,2); + \begin{pgfdecoration}{ + {curveto}{\pgfdecoratedpathlength/3}, + {zigzag}{\pgfdecoratedpathlength/3}, + {curveto}{\pgfdecoratedremainingdistance} + } + \pgfpathmoveto{\pgfpointorigin} + \pgfpathcurveto + {\pgfpoint{0cm}{2cm}}{\pgfpoint{3cm}{2cm}}{\pgfpoint{3cm}{0cm}} + \end{pgfdecoration} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-decorations-9} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \begin{pgfdecoration}{ + {curveto}{\pgfdecoratedpathlength/3} + {} + { + \pgfusepath{stroke} + }, + {zigzag}{\pgfdecoratedpathlength/3} + { + \pgfpathmoveto{\pgfpointdecoratedpathfirst} + \pgfdecorationsegmentlength=5pt + } + { + \pgfsetstrokecolor{red} + \pgfusepath{stroke} + \pgfpathmoveto{\pgfpointdecoratedpathlast} + \pgfsetstrokecolor{black} + }, + {curveto}{\pgfdecoratedremainingdistance} + } + \pgfpathmoveto{\pgfpointorigin} + \pgfpathcurveto + {\pgfpoint{0cm}{2cm}}{\pgfpoint{3cm}{2cm}}{\pgfpoint{3cm}{0cm}} + \end{pgfdecoration} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-decorations-11} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \begin{pgfdecoration}{ + {curveto}{\pgfdecoratedpathlength/3}, + {zigzag}{\pgfdecoratedpathlength/3} + { + \pgfdecorationsegmentlength=5pt + \pgfsetdecorationsegmenttransformation{\pgftransformyshift{.5cm}} + }, + {curveto}{\pgfdecoratedremainingdistance} + } + \pgfpathmoveto{\pgfpointorigin} + \pgfpathcurveto + {\pgfpoint{0cm}{2cm}}{\pgfpoint{3cm}{2cm}}{\pgfpoint{3cm}{0cm}} + \end{pgfdecoration} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-decorations-12} +\pgfdeclaremetadecoration{arrows}{initial}{ + \state{initial}[width=0pt, next state=arrow] + { + \pgfmathdivide{100}{\pgfmetadecoratedpathlength} + \let\factor\pgfmathresult + \pgfsetlinewidth{1pt} + \pgfset{/pgf/decoration/segment length=4pt} + } + \state{arrow}[ + switch if less than=\pgfmetadecorationsegmentlength to final, + width=\pgfmetadecorationsegmentlength/3, + next state=zigzag] + { + \decoration{curveto} + \beforedecoration + { + \pgfmathparse{\pgfmetadecoratedcompleteddistance*\factor} + \pgfsetcolor{red!\pgfmathresult!yellow} + \pgfpathmoveto{\pgfpointmetadecoratedpathfirst} + } + } + \state{zigzag}[width=\pgfmetadecorationsegmentlength/3, next state=end arrow] + { + \decoration{zigzag} + } + \state{end arrow}[width=\pgfmetadecorationsegmentlength/3, next state=move] + { + \decoration{curveto} + \beforedecoration{\pgfpathmoveto{\pgfpointmetadecoratedpathfirst}} + \afterdecoration + { + \pgfsetarrowsend{to} + \pgfusepath{stroke} + } + } + \state{move}[width=\pgfmetadecorationsegmentlength/2, next state=arrow]{} + \state{final}{} +} + +\tikz\draw[decorate,decoration={arrows,meta-segment length=2cm}] + (0,0) .. controls (0,2) and (3,2) .. (3,0) + .. controls (3,-2) and (0,-2) .. (0,-4) + .. controls (0,-6) and (3,-6) .. (3,-8) + .. controls (3,-10) and (0,-10) .. (0,-8); +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-design.lvt b/testfiles/pgfmanual-en-base-design.lvt new file mode 100644 index 000000000..7ddb30788 --- /dev/null +++ b/testfiles/pgfmanual-en-base-design.lvt @@ -0,0 +1,17 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-design-1} +\newdimen\myypos +\begin{pgfpicture} + \pgfpathmoveto{\pgfpoint{0cm}{\myypos}} + \pgfpathlineto{\pgfpoint{1cm}{\myypos}} + \advance \myypos by 1cm + \pgfpathlineto{\pgfpoint{1cm}{\myypos}} + \pgfpathclose + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-images.lvt b/testfiles/pgfmanual-en-base-images.lvt new file mode 100644 index 000000000..702bd1ef1 --- /dev/null +++ b/testfiles/pgfmanual-en-base-images.lvt @@ -0,0 +1,77 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usepackage{xxcolor} +\usepackage{xxcolor} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-images-2} +\pgfdeclareimage[interpolate=true,width=1cm,height=1cm] + {image1}{brave-gnu-world-logo} +\pgfdeclareimage[interpolate=true,width=1cm]{image2}{brave-gnu-world-logo} +\pgfdeclareimage[interpolate=true,height=1cm]{image3}{brave-gnu-world-logo} +\begin{pgfpicture} + \pgftext[at=\pgfpoint{1cm}{5cm},left,base]{\pgfuseimage{image1}} + \pgftext[at=\pgfpoint{1cm}{3cm},left,base]{\pgfuseimage{image2}} + \pgftext[at=\pgfpoint{1cm}{1cm},left,base]{\pgfuseimage{image3}} + + \pgfpathrectangle{\pgfpoint{1cm}{5cm}}{\pgfpoint{1cm}{1cm}} + \pgfpathrectangle{\pgfpoint{1cm}{3cm}}{\pgfpoint{1cm}{1cm}} + \pgfpathrectangle{\pgfpoint{1cm}{1cm}}{\pgfpoint{1cm}{1cm}} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-images-3} +\pgfdeclareimage[interpolate=true,width=1cm,height=1cm] + {image1.!25!white}{brave-gnu-world-logo.25} +\pgfdeclareimage[interpolate=true,width=1cm] + {image2.25!white}{brave-gnu-world-logo.25} +\pgfdeclareimage[interpolate=true,height=1cm] + {image3.white}{brave-gnu-world-logo.25} +\begin{colormixin}{25!white} +\begin{pgfpicture} + \pgftext[at=\pgfpoint{1cm}{5cm},left,base]{\pgfuseimage{image1}} + \pgftext[at=\pgfpoint{1cm}{3cm},left,base]{\pgfuseimage{image2}} + \pgftext[at=\pgfpoint{1cm}{1cm},left,base]{\pgfuseimage{image3}} + + \pgfpathrectangle{\pgfpoint{1cm}{5cm}}{\pgfpoint{1cm}{1cm}} + \pgfpathrectangle{\pgfpoint{1cm}{3cm}}{\pgfpoint{1cm}{1cm}} + \pgfpathrectangle{\pgfpoint{1cm}{1cm}}{\pgfpoint{1cm}{1cm}} + \pgfusepath{stroke} +\end{pgfpicture} +\end{colormixin} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-images-4} +\begin{colormixin}{25!white} +\begin{pgfpicture} + \pgftext[at=\pgfpoint{1cm}{5cm},left,base] + {\pgfimage[interpolate=true,width=1cm,height=1cm]{brave-gnu-world-logo}} + \pgftext[at=\pgfpoint{1cm}{3cm},left,base] + {\pgfimage[interpolate=true,width=1cm]{brave-gnu-world-logo}} + \pgftext[at=\pgfpoint{1cm}{1cm},left,base] + {\pgfimage[interpolate=true,height=1cm]{brave-gnu-world-logo}} + + \pgfpathrectangle{\pgfpoint{1cm}{5cm}}{\pgfpoint{1cm}{1cm}} + \pgfpathrectangle{\pgfpoint{1cm}{3cm}}{\pgfpoint{1cm}{1cm}} + \pgfpathrectangle{\pgfpoint{1cm}{1cm}}{\pgfpoint{1cm}{1cm}} + \pgfusepath{stroke} +\end{pgfpicture} +\end{colormixin} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-images-5} +\pgfdeclarehorizontalshading{colorful}{5cm}{color(0cm)=(red); +color(2cm)=(green); color(4cm)=(blue); color(6cm)=(red); +color(8cm)=(green); color(10cm)=(blue); color(12cm)=(red); +color(14cm)=(green)} +\hbox{\pgfuseshading{colorful}\hskip-14cm\hskip1cm +\pgfimage[height=4cm]{brave-gnu-world-logo}\hskip1cm +\pgfimage[height=4cm]{brave-gnu-world-logo-mask}\hskip1cm +\pgfdeclaremask{mymask}{brave-gnu-world-logo-mask} +\pgfimage[mask=mymask,height=4cm,interpolate=true]{brave-gnu-world-logo}} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-layers.lvt b/testfiles/pgfmanual-en-base-layers.lvt new file mode 100644 index 000000000..950739f1d --- /dev/null +++ b/testfiles/pgfmanual-en-base-layers.lvt @@ -0,0 +1,30 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-layers-2} +\pgfdeclarelayer{background layer} +\pgfdeclarelayer{foreground layer} +\pgfsetlayers{background layer,main,foreground 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} + + % On main layer again: + \fill[blue!50] (-.5,-1) rectangle (.5,1); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-matrices.lvt b/testfiles/pgfmanual-en-base-matrices.lvt new file mode 100644 index 000000000..030569df0 --- /dev/null +++ b/testfiles/pgfmanual-en-base-matrices.lvt @@ -0,0 +1,106 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-matrices-1} +\begin{tikzpicture}[x=3mm,y=3mm,fill=blue!50] + \def\atorig#1{\node[black] at (0,0) {\tiny #1};} + + \pgfmatrix{rectangle}{center}{mymatrix} + {\pgfusepath{}}{\pgfpointorigin}{} + { + \fill (0,-3) rectangle (1,1);\atorig1 \pgfmatrixnextcell + \fill (-1,0) rectangle (1,1);\atorig2 \pgfmatrixnextcell + \fill (-1,-2) rectangle (0,0);\atorig3 \pgfmatrixnextcell + \fill (-1,-1) rectangle (0,3);\atorig4 \\ + \fill (-1,0) rectangle (4,1);\atorig5 \pgfmatrixnextcell + \fill (0,-1) rectangle (1,1);\atorig6 \pgfmatrixnextcell + \fill (0,0) rectangle (1,4);\atorig7 \pgfmatrixnextcell + \fill (-1,-1) rectangle (0,0);\atorig8 \\ + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-matrices-2} +\begin{tikzpicture} + \pgfmatrix{rectangle}{center}{mymatrix} + {\pgfusepath{}}{\pgfpointorigin}{} + { + \node {a}; \pgfmatrixnextcell \node {b}; \pgfmatrixendrow + \node {c}; \pgfmatrixnextcell \node {d}; \pgfmatrixendrow + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-matrices-3} +\begin{tikzpicture}[every node/.style=draw] + \pgfsetmatrixcolumnsep{1mm} + \pgfmatrix{rectangle}{center}{mymatrix} + {\pgfusepath{}}{\pgfpointorigin}{\let\&=\pgfmatrixnextcell} + { + \node {8}; \&[2mm] \node{1}; \&[-1mm] \node {6}; \\ + \node {3}; \& \node{5}; \& \node {7}; \\ + \node {4}; \& \node{9}; \& \node {2}; \\ + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-matrices-4} +\begin{tikzpicture}[every node/.style=draw] + \pgfsetmatrixcolumnsep{1mm} + \pgfmatrix{rectangle}{center}{mymatrix} + {\pgfusepath{}}{\pgfpointorigin}{\let\&=\pgfmatrixnextcell} + { + \node {8}; \&[2mm] \node(a){1}; \&[1cm,between origins] \node(b){6}; \\ + \node {3}; \& \node {5}; \& \node {7}; \\ + \node {4}; \& \node {9}; \& \node {2}; \\ + } + \draw [<->,red,thick,every node/.style=] (a.center) -- (b.center) + node [above,midway] {11mm}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-matrices-5} +\begin{tikzpicture}[every node/.style=draw] + \pgfsetmatrixcolumnsep{1cm,between origins} + \pgfmatrix{rectangle}{center}{mymatrix} + {\pgfusepath{}}{\pgfpointorigin}{\let\&=\pgfmatrixnextcell} + { + \node (a) {8}; \& \node (b) {1}; \&[between borders] \node (c) {6}; \\ + \node {3}; \& \node {5}; \& \node {7}; \\ + \node {4}; \& \node {9}; \& \node {2}; \\ + } + \begin{scope}[every node/.style=] + \draw [<->,red,thick] (a.center) -- (b.center) node [above,midway] {10mm}; + \draw [<->,red,thick] (b.east) -- (c.west) node [above,midway] + {10mm}; + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-matrices-6} +\begin{tikzpicture} + \def\pgfmatrixemptycode{\node{empty};} + \pgfmatrix{rectangle}{center}{mymatrix} + {\pgfusepath{}}{\pgfpointorigin}{\let\&=\pgfmatrixnextcell} + { + \node {a}; \& \& \node {b}; \\ + \& \node{c}; \& \node {d}; \& \\ + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-matrices-7} +\begin{tikzpicture} + \def\pgfmatrixbegincode{\node[draw]\bgroup} + \def\pgfmatrixendcode{\egroup;} + \pgfmatrix{rectangle}{center}{mymatrix} + {\pgfusepath{}}{\pgfpointorigin}{\let\&=\pgfmatrixnextcell} + { + a \& b \& c \\ + d \& \& e \\ + } +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-nodes.lvt b/testfiles/pgfmanual-en-base-nodes.lvt new file mode 100644 index 000000000..62c269754 --- /dev/null +++ b/testfiles/pgfmanual-en-base-nodes.lvt @@ -0,0 +1,211 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{shapes} +\usetikzlibrary{scopes} +\usetikzlibrary{shapes.geometric} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-nodes-1} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (4,3); + { + \pgftransformshift{\pgfpoint{1.5cm}{1cm}} + \pgfnode{rectangle}{north}{Hello World}{hellonode}{\pgfusepath{stroke}} + } + { + \color{red!20} + \pgftransformrotate{10} + \pgftransformshift{\pgfpoint{3cm}{1cm}} + \pgfnode{rectangle}{center} + {\color{black}Hello World}{hellonode}{\pgfusepath{fill}} + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-nodes-2} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (4,3); + { + \color{red!20} + \pgftransformrotate{10} + \pgftransformshift{\pgfpoint{3cm}{1cm}} + \pgftransformresetnontranslations + \pgfnode{rectangle}{center} + {\color{black}Hello World}{hellonode}{\pgfusepath{fill}} + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-nodes-3} +\setbox\pgfnodeparttextbox=\hbox{$q_1$} +\setbox\pgfnodepartlowerbox=\hbox{01} +\begin{pgfpicture} + \pgfmultipartnode{circle split}{center}{my state}{\pgfusepath{stroke}} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-nodes-6} +\begin{tikzpicture} + \draw[help lines] (-2,0) grid (2,1); + + \pgfset{minimum width=3cm} + \pgfnode{rectangle}{center}{Hello World}{}{\pgfusepath{stroke}} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-nodes-7} +\begin{tikzpicture} + \draw[help lines] (-2,0) grid (2,1); + + \pgfset{inner xsep=1cm} + \pgfnode{rectangle}{center}{Hello World}{}{\pgfusepath{stroke}} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-nodes-8} +\begin{tikzpicture} + \draw[help lines] (-2,0) grid (2,1); + + \pgfset{outer xsep=.5cm} + \pgfnode{rectangle}{center}{Hello World}{x}{\pgfusepath{stroke}} + + \pgfpathcircle{\pgfpointanchor{x}{north}}{2pt} + \pgfpathcircle{\pgfpointanchor{x}{south}}{2pt} + \pgfpathcircle{\pgfpointanchor{x}{east}}{2pt} + \pgfpathcircle{\pgfpointanchor{x}{west}}{2pt} + \pgfpathcircle{\pgfpointanchor{x}{north east}}{2pt} + \pgfusepath{fill} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-nodes-9} +\newbox\mybox + +\def\mysaver{ + \global\setbox\mybox=\box\pgfpositionnodelaterbox + \global\let\myname=\pgfpositionnodelatername + \global\let\myminx=\pgfpositionnodelaterminx + \global\let\myminy=\pgfpositionnodelaterminy + \global\let\mymaxx=\pgfpositionnodelatermaxx + \global\let\mymaxy=\pgfpositionnodelatermaxy +} + +\begin{tikzpicture} + { + \pgfpositionnodelater{\mysaver} + \node [fill=blue!20,below,rotate=30] (hi) {Hello world}; + } + \draw [help lines] (0,0) grid (3,2); + + \let\pgfpositionnodelatername=\myname + \let\pgfpositionnodelaterminx=\myminx + \let\pgfpositionnodelaterminy=\myminy + \let\pgfpositionnodelatermaxx=\mymaxx + \let\pgfpositionnodelatermaxy=\mymaxy + \setbox\pgfpositionnodelaterbox=\box\mybox + \pgfpositionnodenow{\pgfqpoint{2cm}{2cm}} + + \draw (hi) -- (0,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-nodes-10} +\begin{pgfpicture} + \pgftransformrotate{30} + \pgfnode{rectangle}{center}{Hello World!}{x}{\pgfusepath{stroke}} + + \pgfpathcircle{\pgfpointanchor{x}{north}}{2pt} + \pgfpathcircle{\pgfpointanchor{x}{south}}{2pt} + \pgfpathcircle{\pgfpointanchor{x}{east}}{2pt} + \pgfpathcircle{\pgfpointanchor{x}{west}}{2pt} + \pgfpathcircle{\pgfpointanchor{x}{north east}}{2pt} + \pgfusepath{fill} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-nodes-11} +\makeatletter +\begin{pgfpicture} + \pgftransformrotate{30} + \pgfnode{rectangle}{center}{Hello World!}{x}{\pgfusepath{stroke}} + + { + \pgftransformreset + \pgfpointanchor{x}{east} + \xdef\mycoordinate{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}} + } + + \pgfpathcircle{\mycoordinate}{2pt} + \pgfusepath{fill} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-nodes-12} +\begin{pgfpicture} + \begin{pgfscope} + \pgftransformrotate{30} + \pgfnode{rectangle}{center}{Hello World!}{x}{\pgfusepath{stroke}} + \end{pgfscope} + \pgfpathcircle{\pgfpointshapeborder{x}{\pgfpoint{2cm}{1cm}}}{2pt} + \pgfpathcircle{\pgfpoint{2cm}{1cm}}{2pt} + \pgfpathcircle{\pgfpointshapeborder{x}{\pgfpoint{-1cm}{1cm}}}{2pt} + \pgfpathcircle{\pgfpoint{-1cm}{1cm}}{2pt} + \pgfusepath{fill} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-nodes-15} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + { [local bounding box=outer box] + \draw (1,1) circle (.5) [local bounding box=inner box] (2,2) circle (.5); + } + \draw (outer box.south west) rectangle (outer box.north east); + \draw[red] (inner box.south west) rectangle (inner box.north east); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-nodes-30} +\makeatletter +\pgfdeclareshape{document}{ + \inheritsavedanchors[from=rectangle] % this is nearly a rectangle + \inheritanchorborder[from=rectangle] + \inheritanchor[from=rectangle]{center} + \inheritanchor[from=rectangle]{north} + \inheritanchor[from=rectangle]{south} + \inheritanchor[from=rectangle]{west} + \inheritanchor[from=rectangle]{east} + % ... and possibly more + \backgroundpath{% this is new + % store lower right in xa/ya and upper right in xb/yb + \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y + \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y + % compute corner of ``flipped page'' + \pgf@xc=\pgf@xb \advance\pgf@xc by-5pt % this should be a parameter + \pgf@yc=\pgf@yb \advance\pgf@yc by-5pt + % construct main path + \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}} + \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}} + \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yb}} + \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}} + \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}} + \pgfpathclose + % add little corner + \pgfpathmoveto{\pgfpoint{\pgf@xc}{\pgf@yb}} + \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}} + \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}} + \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}} + } +}\hskip-1.2cm +\begin{tikzpicture} + \node[shade,draw,shape=document,inner sep=2ex] (x) {Remark}; + \node[fill=yellow!80!black,draw,ellipse,double] + at ([shift=(-80:3cm)]x) (y) {Use Case}; + + \draw[dashed] (x) -- (y); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-paths.lvt b/testfiles/pgfmanual-en-base-paths.lvt new file mode 100644 index 000000000..0cd2d3388 --- /dev/null +++ b/testfiles/pgfmanual-en-base-paths.lvt @@ -0,0 +1,353 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-paths-1} +\begin{tikzpicture}[scale=2] + \draw[thick,red] + (0,0) coordinate (a) + -- coordinate (ab) (1,.5) coordinate (b) + .. coordinate (bc) controls +(up:1cm) and +(left:1cm) .. (3,1) coordinate (c) + (0,1) -- (2,1) -- coordinate (x) (1,2) -- cycle; + + \draw (a) node[below] {start part 1} + (ab) node[below right] {straight segment} + (b) node[right] {end first segment} + (c) node[right] {end part 1} + (x) node[above right] {part 2 (closed)}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-2} +\begin{pgfpicture} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{1cm}{1cm}} + \pgfpathlineto{\pgfpoint{2cm}{1cm}} + \pgfpathlineto{\pgfpoint{3cm}{0.5cm}} + \pgfpathlineto{\pgfpoint{3cm}{0cm}} + \pgfsetfillcolor{yellow!80!black} + \pgfusepath{fill,stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-3} +\begin{pgfpicture} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{1cm}{1cm}} + \pgfpathlineto{\pgfpoint{2cm}{1cm}} + \pgfpathmoveto{\pgfpoint{2cm}{1cm}} % New part + \pgfpathlineto{\pgfpoint{3cm}{0.5cm}} + \pgfpathlineto{\pgfpoint{3cm}{0cm}} + \pgfsetfillcolor{yellow!80!black} + \pgfusepath{fill,stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-4} +\begin{pgfpicture} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{1cm}{1cm}} + \pgfpathlineto{\pgfpoint{2cm}{1cm}} + \pgfsetfillcolor{yellow!80!black} + \pgfusepath{fill,stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-5} +\begin{pgfpicture} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathcurveto + {\pgfpoint{1cm}{1cm}}{\pgfpoint{2cm}{1cm}}{\pgfpoint{3cm}{0cm}} + \pgfsetfillcolor{yellow!80!black} + \pgfusepath{fill,stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-6} +\begin{pgfpicture} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathquadraticcurveto + {\pgfpoint{1cm}{1cm}}{\pgfpoint{2cm}{0cm}} + \pgfsetfillcolor{yellow!80!black} + \pgfusepath{fill,stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-7} +\begin{tikzpicture} + \draw [thin] (0,0) .. controls (0,2) and (3,0) .. (3,2); + \pgfpathcurvebetweentime{0.25}{0.9}{\pgfpointxy{0}{0}}{\pgfpointxy{0}{2}} + {\pgfpointxy{3}{0}}{\pgfpointxy{3}{2}} + \pgfsetstrokecolor{red} + \pgfsetstrokeopacity{0.5} + \pgfsetlinewidth{2pt} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-8} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfsetlinewidth{5pt} + \pgfpathmoveto{\pgfpoint{1cm}{1cm}} + \pgfpathlineto{\pgfpoint{0cm}{-1cm}} + \pgfpathlineto{\pgfpoint{1cm}{-1cm}} + \pgfpathclose + \pgfpathmoveto{\pgfpoint{2.5cm}{1cm}} + \pgfpathlineto{\pgfpoint{1.5cm}{-1cm}} + \pgfpathlineto{\pgfpoint{2.5cm}{-1cm}} + \pgfpathlineto{\pgfpoint{2.5cm}{1cm}} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-9} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0cm}{1cm}} + \pgfpatharc{180}{90}{.5cm} + \pgfpathlineto{\pgfpoint{3cm}{1.5cm}} + \pgfpatharc{90}{-45}{.5cm} + \pgfusepath{fill} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-10} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathmoveto{\pgfpointorigin} + \pgfpatharc{180}{45}{2cm and 1cm} + \pgfusepath{draw} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-11} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgftransformrotate{30} + \pgfpathmoveto{\pgfpointorigin} + \pgfpatharc{180}{45}{2cm and 1cm} + \pgfusepath{draw} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-12} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (2cm,5mm) (0,0) -- (0cm,1cm); + + \pgfpathmoveto{\pgfpoint{2cm}{5mm}} + \pgfpatharcaxes{0}{90}{\pgfpoint{2cm}{5mm}}{\pgfpoint{0cm}{1cm}} + \pgfusepath{draw} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-13} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \pgfpathmoveto{\pgfpoint{0mm}{20mm}} + \pgfpatharcto{3cm}{1cm}{0}{0}{0}{\pgfpoint{3cm}{1cm}} + \pgfusepath{draw} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-14} +\begin{tikzpicture} + \pgfsetlinewidth{2pt} + % Flags 0 0: red + \pgfsetstrokecolor{red} + \pgfpathmoveto{\pgfpointorigin} + \pgfpatharcto{20pt}{10pt}{0}{0}{0}{\pgfpoint{20pt}{10pt}} + \pgfusepath{stroke} + % Flags 0 1: blue + \pgfsetstrokecolor{blue} + \pgfpathmoveto{\pgfpointorigin} + \pgfpatharcto{20pt}{10pt}{0}{0}{1}{\pgfpoint{20pt}{10pt}} + \pgfusepath{stroke} + % Flags 1 0: orange + \pgfsetstrokecolor{orange} + \pgfpathmoveto{\pgfpointorigin} + \pgfpatharcto{20pt}{10pt}{0}{1}{0}{\pgfpoint{20pt}{10pt}} + \pgfusepath{stroke} + % Flags 1 1: black + \pgfsetstrokecolor{black} + \pgfpathmoveto{\pgfpointorigin} + \pgfpatharcto{20pt}{10pt}{0}{1}{1}{\pgfpoint{20pt}{10pt}} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-15} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \def\cx{1.5cm}% center x + \def\cy{1cm}% center y + \def\startangle{0}% + \def\endangle{270}% + \def\a{1.5cm}% xradius + \def\b{0.5cm}% yradius + \pgfmathparse{\a/\b}\let\abratio=\pgfmathresult + \pgfmathparse{\b/\a}\let\baratio=\pgfmathresult + % + % start point: + \pgfpathmoveto{\pgfpoint{\cx+\a*cos(\startangle)}{\cy+\b*sin(\startangle)}}% + \pgfpatharctoprecomputed + {\pgfpoint{\cx}{\cy}} + {\startangle} + {\endangle} + {\pgfpoint{\cx+\a*cos(\endangle)}{\cy+\b*sin(\endangle)}}% end point + {\a} + {\b} + {\abratio} + {\baratio} + \pgfusepath{draw} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-16} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathellipse{\pgfpoint{1cm}{0cm}} + {\pgfpoint{1.5cm}{0cm}} + {\pgfpoint{0cm}{1cm}} + \pgfusepath{draw} + \color{red} + \pgfpathellipse{\pgfpoint{1cm}{0cm}} + {\pgfpoint{1cm}{1cm}} + {\pgfpoint{-0.5cm}{0.5cm}} + \pgfusepath{draw} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-17} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathrectangle{\pgfpoint{1cm}{0cm}}{\pgfpoint{1.5cm}{1cm}} + \pgfpathrectangle{\pgfpoint{1.5cm}{0.25cm}}{\pgfpoint{1.5cm}{1cm}} + \pgfpathrectangle{\pgfpoint{2cm}{0.5cm}}{\pgfpoint{1.5cm}{1cm}} + \pgfusepath{draw} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-18} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathrectanglecorners{\pgfpoint{1cm}{0cm}}{\pgfpoint{1.5cm}{1cm}} + \pgfusepath{draw} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-19} +\begin{pgfpicture} + \pgfsetlinewidth{0.8pt} + \pgfpathgrid[step={\pgfpoint{1cm}{1cm}}] + {\pgfpoint{-3mm}{-3mm}}{\pgfpoint{33mm}{23mm}} + \pgfusepath{stroke} + \pgfsetlinewidth{0.4pt} + \pgfpathgrid[stepx=1mm,stepy=1mm] + {\pgfpoint{-1.5mm}{-1.5mm}}{\pgfpoint{31.5mm}{21.5mm}} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-20} +\begin{pgfpicture} + \pgftransformrotate{10} + \pgfpathgrid[stepx=1mm,stepy=2mm]{\pgfpoint{0mm}{0mm}}{\pgfpoint{30mm}{30mm}} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-21} +\begin{pgfpicture} + % Half-parabola going ``up and right'' + \pgfpathmoveto{\pgfpointorigin} + \pgfpathparabola{\pgfpointorigin}{\pgfpoint{2cm}{4cm}} + \color{red} + \pgfusepath{stroke} + + % Half-parabola going ``down and right'' + \pgfpathmoveto{\pgfpointorigin} + \pgfpathparabola{\pgfpoint{-2cm}{4cm}}{\pgfpointorigin} + \color{blue} + \pgfusepath{stroke} + + % Full parabola + \pgfpathmoveto{\pgfpoint{-2cm}{2cm}} + \pgfpathparabola{\pgfpoint{1cm}{-1cm}}{\pgfpoint{2cm}{4cm}} + \color{orange} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-22} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,1); + \pgfpathmoveto{\pgfpoint{1cm}{0cm}} + \pgfpathsine{\pgfpoint{1cm}{1cm}} + \pgfusepath{stroke} + + \color{red} + \pgfpathmoveto{\pgfpoint{1cm}{0cm}} + \pgfpathsine{\pgfpoint{-2cm}{-2cm}} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-23} +\begin{pgfpicture} + \pgfpathmoveto{\pgfpoint{0cm}{0cm}} + \pgfpathsine{\pgfpoint{1cm}{1cm}} + \pgfpathcosine{\pgfpoint{1cm}{-1cm}} + \pgfpathsine{\pgfpoint{1cm}{-1cm}} + \pgfpathcosine{\pgfpoint{1cm}{1cm}} + \pgfsetfillcolor{yellow!80!black} + \pgfusepath{fill,stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-24} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \pgfsetcornersarced{\pgfpoint{5mm}{5mm}} + \pgfpathrectanglecorners{\pgfpointorigin}{\pgfpoint{3cm}{2cm}} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-25} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \pgfsetcornersarced{\pgfpoint{10mm}{5mm}} + % 10mm entering, + % 5mm leaving. + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0cm}{2cm}} + \pgfpathlineto{\pgfpoint{3cm}{2cm}} + \pgfpathcurveto + {\pgfpoint{3cm}{0cm}} + {\pgfpoint{2cm}{0cm}} + {\pgfpoint{1cm}{0cm}} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-paths-26} +\begin{pgfpicture} + \pgfsetcornersarced{\pgfpoint{4pt}{4pt}} + \pgfpathmoveto{\pgfpointpolar{0}{1cm}} + \pgfpathlineto{\pgfpointpolar{72}{1cm}} + \pgfpathlineto{\pgfpointpolar{144}{1cm}} + \pgfpathlineto{\pgfpointpolar{216}{1cm}} + \pgfpathlineto{\pgfpointpolar{288}{1cm}} + \pgfpathclose + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-patterns.lvt b/testfiles/pgfmanual-en-base-patterns.lvt new file mode 100644 index 000000000..bb2f7df15 --- /dev/null +++ b/testfiles/pgfmanual-en-base-patterns.lvt @@ -0,0 +1,114 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{patterns} +\usetikzlibrary{patterns} +\usetikzlibrary{patterns} +\usetikzlibrary{patterns} +\pgfdeclarepatternformonly{stars} +{\pgfpointorigin}{\pgfpoint{1cm}{1cm}} +{\pgfpoint{1cm}{1cm}} +{ + \pgftransformshift{\pgfpoint{.5cm}{.5cm}} + \pgfpathmoveto{\pgfpointpolar{0}{4mm}} + \pgfpathlineto{\pgfpointpolar{144}{4mm}} + \pgfpathlineto{\pgfpointpolar{288}{4mm}} + \pgfpathlineto{\pgfpointpolar{72}{4mm}} + \pgfpathlineto{\pgfpointpolar{216}{4mm}} + \pgfpathclose% + \pgfusepath{fill} +} +\pgfdeclarepatterninherentlycolored{green stars} +{\pgfpointorigin}{\pgfpoint{1cm}{1cm}} +{\pgfpoint{1cm}{1cm}} +{ + \pgfsetfillcolor{green!50!black} + \pgftransformshift{\pgfpoint{.5cm}{.5cm}} + \pgfpathmoveto{\pgfpointpolar{0}{4mm}} + \pgfpathlineto{\pgfpointpolar{144}{4mm}} + \pgfpathlineto{\pgfpointpolar{288}{4mm}} + \pgfpathlineto{\pgfpointpolar{72}{4mm}} + \pgfpathlineto{\pgfpointpolar{216}{4mm}} + \pgfpathclose% + \pgfusepath{stroke,fill} +} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-patterns-1} +\pgfdeclarepatternformonly{stars} +{\pgfpointorigin}{\pgfpoint{1cm}{1cm}} +{\pgfpoint{1cm}{1cm}} +{ + \pgftransformshift{\pgfpoint{.5cm}{.5cm}} + \pgfpathmoveto{\pgfpointpolar{0}{4mm}} + \pgfpathlineto{\pgfpointpolar{144}{4mm}} + \pgfpathlineto{\pgfpointpolar{288}{4mm}} + \pgfpathlineto{\pgfpointpolar{72}{4mm}} + \pgfpathlineto{\pgfpointpolar{216}{4mm}} + \pgfpathclose% + \pgfusepath{fill} +} +\begin{tikzpicture} + \filldraw[pattern=stars] (0,0) rectangle (1.5,2); + \filldraw[pattern=stars,pattern color=red] + (1.5,0) rectangle (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-patterns-2} +\pgfdeclarepatternformonly[/tikz/radius,\thickness,\size]{rings} +{\pgfpoint{-0.5*\size}{-0.5*\size}} +{\pgfpoint{0.5*\size}{0.5*\size}} +{\pgfpoint{\size}{\size}} +{ + \pgfsetlinewidth{\thickness} + \pgfpathcircle\pgfpointorigin{\pgfkeysvalueof{/tikz/radius}} + \pgfusepath{stroke} +} +\newdimen\thickness +\tikzset{ + radius/.initial=4pt, + size/.store in=\size, size=20pt, + thickness/.code={\thickness=#1}, + thickness=0.75pt +} +\begin{tikzpicture}[rings/.style={pattern=rings}] + \filldraw [rings, radius=2pt, size=6pt] (0,0) rectangle +(1.5,2); + \filldraw [rings, radius=2pt, size=8pt] (2,0) rectangle +(1.5,2); + \filldraw [rings, radius=6pt, thickness=2pt] (0,2.5) rectangle +(1.5,2); + \filldraw [rings, radius=8pt, thickness=4pt] (2,2.5) rectangle +(1.5,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-patterns-3} +\pgfdeclarepatterninherentlycolored{green stars} +{\pgfpointorigin}{\pgfpoint{1cm}{1cm}} +{\pgfpoint{1cm}{1cm}} +{ + \pgfsetfillcolor{green!50!black} + \pgftransformshift{\pgfpoint{.5cm}{.5cm}} + \pgfpathmoveto{\pgfpointpolar{0}{4mm}} + \pgfpathlineto{\pgfpointpolar{144}{4mm}} + \pgfpathlineto{\pgfpointpolar{288}{4mm}} + \pgfpathlineto{\pgfpointpolar{72}{4mm}} + \pgfpathlineto{\pgfpointpolar{216}{4mm}} + \pgfpathclose% + \pgfusepath{stroke,fill} +} +\begin{tikzpicture} + \filldraw[pattern=green stars] (0,0) rectangle (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-patterns-4} +\begin{tikzpicture} + \pgfsetfillpattern{stars}{red} + \filldraw (0,0) rectangle (1.5,2); + + \pgfsetfillpattern{green stars}{red} + \filldraw (1.5,0) rectangle (3,2); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-plots.lvt b/testfiles/pgfmanual-en-base-plots.lvt new file mode 100644 index 000000000..1be067887 --- /dev/null +++ b/testfiles/pgfmanual-en-base-plots.lvt @@ -0,0 +1,112 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-plots-6} +\begin{tikzpicture}[x=3.8cm/360] + \pgfplothandlerlineto + \pgfplotfunction{\x}{0,5,...,360}{\pgfpointxy{\x}{sin(\x)+sin(3*\x)}} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-plots-7} +\begin{tikzpicture}[y=3cm/360] + \pgfplothandlerlineto + \pgfplotfunction{\y}{0,5,...,360}{\pgfpointxyz{sin(2*\y)}{\y}{cos(2*\y)}} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-plots-9} +\begin{tikzpicture} + \draw[help lines] (0,-1) grid (4,1); + \pgfplothandlerlineto + \pgfplotgnuplot[plots/pgfplotgnuplot-example]{plot [x=0:3.5] x*sin(x)} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-plots-11} +\begin{pgfpicture} + \pgfpathmoveto{\pgfpointorigin} + \pgfplothandlerlineto + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{1cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{3cm}{2cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{2cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-plots-12} +\begin{pgfpicture} + \pgfpathmoveto{\pgfpointorigin} + \pgfsetlinetofirstplotpoint + \pgfplothandlerlineto + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{1cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{3cm}{2cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{2cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-plots-13} +\begin{pgfpicture} + \pgfplothandlerrecord{\mystream} + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{1cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{3cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{2cm}} + \pgfplotstreamend + \pgfplothandlerlineto + \mystream + \pgfplothandlerclosedcurve + \mystream + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-plots-15} +\pgfdeclareplothandler{\myhandler}{#1}{ + start = Hi #1., + end = Bye #1., +} +\myhandler{foo} +\pgfplotstreamstart +\pgfplotstreamend +\myhandler{bar} +\pgfplotstreamstart +\pgfplotstreamend +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-plots-16} +\pgfdeclareplothandler{\myhandler}{#1}{ + point=\pgfpathcircle{##1}{#1} % ##1 is the coordinate, + % #1 the parameter for \myhandler +} +\begin{pgfpicture} + \myhandler{1pt} + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0pt}{0pt}} + \pgfplotstreampoint{\pgfpoint{3pt}{3pt}} + \pgfplotstreampoint{\pgfpoint{6pt}{3pt}} + \pgfplotstreampoint{\pgfpoint{9pt}{0pt}} + \pgfplotstreamend + \pgfusepath{stroke} + \myhandler{3pt} + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0pt}{0pt}} + \pgfplotstreampoint{\pgfpoint{9pt}{0pt}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-points.lvt b/testfiles/pgfmanual-en-base-points.lvt new file mode 100644 index 000000000..f118ced1f --- /dev/null +++ b/testfiles/pgfmanual-en-base-points.lvt @@ -0,0 +1,300 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{intersections} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-points-1} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathcircle{\pgfpoint{1cm}{1cm}} {2pt} + \pgfpathcircle{\pgfpoint{2cm}{5pt}} {2pt} + \pgfpathcircle{\pgfpoint{0pt}{.5in}}{2pt} + \pgfusepath{fill} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-2} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \foreach \angle in {0,10,...,90} + {\pgfpathcircle{\pgfpointpolar{\angle}{1cm}}{2pt}} + \pgfusepath{fill} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-3} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \foreach \angle in {0,10,...,90} + {\pgfpathcircle{\pgfpointpolar{\angle}{1cm and 2cm}}{2pt}} + \pgfusepath{fill} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-4} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathmoveto{\pgfpointxy{1}{0}} + \pgfpathlineto{\pgfpointxy{2}{2}} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-5} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \pgfpathmoveto{\pgfpointxy{1}{0}} + \pgfpathlineto{\pgfpointxy{2}{2}} + \pgfusepath{stroke} + + \color{red} + \pgfsetxvec{\pgfpoint{0.75cm}{0cm}} + \pgfpathmoveto{\pgfpointxy{1}{0}} + \pgfpathlineto{\pgfpointxy{2}{2}} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-6} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \begin{scope}[x={(1cm,-5mm)},y=1.5cm] + \foreach \angle in {0,10,...,90} + {\pgfpathcircle{\pgfpointpolarxy{\angle}{1}}{2pt}} + \pgfusepath{fill} + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-7} +\begin{pgfpicture} + \pgfsetarrowsend{to} + + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpointxyz{0}{0}{1}} + \pgfusepath{stroke} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpointxyz{0}{1}{0}} + \pgfusepath{stroke} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpointxyz{1}{0}{0}} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-8} +\begin{tikzpicture} + \draw [->] (0,0) -- (1,0,0) node [right] {$x$}; + \draw [->] (0,0) -- (0,1,0) node [above] {$y$}; + \draw [->] (0,0) -- (0,0,1) node [below left] {$z$}; + + \pgfpathcircle{\pgfpointcylindrical{80}{1}{.5}}{2pt} + \pgfusepath{fill} + + \draw[red] (0,0) -- (0,0,.5) -- +(80:1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-9} +\begin{tikzpicture} + \pgfsetfillcolor{lightgray} + + \foreach \latitude in {-90,-75,...,30} + { + \foreach \longitude in {0,20,...,360} + { + \pgfpathmoveto{\pgfpointspherical{\longitude}{\latitude}{1}} + \pgfpathlineto{\pgfpointspherical{\longitude+20}{\latitude}{1}} + \pgfpathlineto{\pgfpointspherical{\longitude+20}{\latitude+15}{1}} + \pgfpathlineto{\pgfpointspherical{\longitude}{\latitude+15}{1}} + \pgfpathclose + } + \pgfusepath{fill,stroke} + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-10} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathcircle{\pgfpointadd{\pgfpoint{1cm}{0cm}}{\pgfpoint{1cm}{1cm}}}{2pt} + \pgfusepath{fill} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-11} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathcircle{\pgfpointscale{1.5}{\pgfpoint{1cm}{0cm}}}{2pt} + \pgfusepath{fill} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-12} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathcircle{\pgfpointdiff{\pgfpoint{1cm}{0cm}}{\pgfpoint{1cm}{1cm}}}{2pt} + \pgfusepath{fill} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-13} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathcircle{\pgfpoint{2cm}{1cm}}{2pt} + \pgfpathcircle{\pgfpointscale{20} + {\pgfpointnormalised{\pgfpoint{2cm}{1cm}}}}{2pt} + \pgfusepath{fill} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-14} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{2cm}{2cm}} + \pgfusepath{stroke} + \foreach \t in {0,0.25,...,1.25} + {\pgftext[at= + \pgfpointlineattime{\t}{\pgfpointorigin}{\pgfpoint{2cm}{2cm}}]{\t}} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-15} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{3cm}{2cm}} + \pgfusepath{stroke} + \foreach \d in {0pt,20pt,40pt,70pt} + {\pgftext[at= + \pgfpointlineatdistance{\d}{\pgfpointorigin}{\pgfpoint{3cm}{2cm}}]{\d}} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-16} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathmoveto{\pgfpoint{2cm}{1cm}} + \pgfpatharcaxes{0}{60}{\pgfpoint{2cm}{0cm}}{\pgfpoint{0cm}{1cm}} + \pgfusepath{stroke} + \foreach \t in {0,0.25,0.5,0.75,1} + {\pgftext[at=\pgfpointarcaxesattime{\t}{\pgfpoint{0cm}{1cm}} + {\pgfpoint{2cm}{0cm}}{\pgfpoint{0cm}{1cm}}{0}{60}]{\t}} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-17} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathmoveto{\pgfpointorigin} + \pgfpathcurveto + {\pgfpoint{0cm}{2cm}}{\pgfpoint{0cm}{2cm}}{\pgfpoint{3cm}{2cm}} + \pgfusepath{stroke} + \foreach \t in {0,0.25,0.5,0.75,1} + {\pgftext[at=\pgfpointcurveattime{\t}{\pgfpointorigin} + {\pgfpoint{0cm}{2cm}} + {\pgfpoint{0cm}{2cm}} + {\pgfpoint{3cm}{2cm}}]{\t}} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-18} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (2,1.5); + \pgfpathrectanglecorners{\pgfpoint{-1cm}{-1.25cm}}{\pgfpoint{1cm}{1.25cm}} + \pgfusepath{stroke} + + \pgfpathcircle{\pgfpoint{5pt}{5pt}}{2pt} + \pgfpathcircle{\pgfpoint{-10pt}{5pt}}{2pt} + \pgfusepath{fill} + \color{red} + \pgfpathcircle{\pgfpointborderrectangle + {\pgfpoint{5pt}{5pt}}{\pgfpoint{1cm}{1.25cm}}}{2pt} + \pgfpathcircle{\pgfpointborderrectangle + {\pgfpoint{-10pt}{5pt}}{\pgfpoint{1cm}{1.25cm}}}{2pt} + \pgfusepath{fill} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-19} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (2,1.5); + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{1cm}{0cm}}{\pgfpoint{0cm}{1.25cm}} + \pgfusepath{stroke} + + \pgfpathcircle{\pgfpoint{5pt}{5pt}}{2pt} + \pgfpathcircle{\pgfpoint{-10pt}{5pt}}{2pt} + \pgfusepath{fill} + \color{red} + \pgfpathcircle{\pgfpointborderellipse + {\pgfpoint{5pt}{5pt}}{\pgfpoint{1cm}{1.25cm}}}{2pt} + \pgfpathcircle{\pgfpointborderellipse + {\pgfpoint{-10pt}{5pt}}{\pgfpoint{1cm}{1.25cm}}}{2pt} + \pgfusepath{fill} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-20} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (2,2); + \draw (.5,0) -- (2,2); + \draw (1,2) -- (2,0); + \pgfpathcircle{% + \pgfpointintersectionoflines + {\pgfpointxy{.5}{0}}{\pgfpointxy{2}{2}} + {\pgfpointxy{1}{2}}{\pgfpointxy{2}{0}}} + {2pt} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-21} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (2,2); + \draw (0.5,0) circle (1); + \draw (1.5,1) circle (.8); + \pgfpathcircle{% + \pgfpointintersectionofcircles + {\pgfpointxy{.5}{0}}{\pgfpointxy{1.5}{1}} + {1cm}{0.8cm}{1}} + {2pt} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-22} +\begin{pgfpicture} +\pgfintersectionofpaths +{ + \pgfpathellipse{\pgfpointxy{0}{0}}{\pgfpointxy{1}{0}}{\pgfpointxy{0}{2}} + \pgfgetpath\temppath + \pgfusepath{stroke} + \pgfsetpath\temppath +} +{ + \pgftransformrotate{-30} + \pgfpathrectangle{\pgfpointorigin}{\pgfpointxy{2}{2}} + \pgfgetpath\temppath + \pgfusepath{stroke} + \pgfsetpath\temppath +} +\foreach \s in {1,...,\pgfintersectionsolutions} + {\pgfpathcircle{\pgfpointintersectionsolution{\s}}{2pt}} +\pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-points-24} +\pgfpoint{2cm}{4cm} +\pgfgetlastxy{\macrox}{\macroy} +Macro $x$ is `\macrox' and macro $y$ is `\macroy'. +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-quick.lvt b/testfiles/pgfmanual-en-base-quick.lvt new file mode 100644 index 000000000..26bfb5398 --- /dev/null +++ b/testfiles/pgfmanual-en-base-quick.lvt @@ -0,0 +1,42 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-quick-1} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgftransformxshift{1cm} + \pgfpathqmoveto{0pt}{0pt} % not transformed + \pgfpathqlineto{1cm}{1cm} % not transformed + \pgfpathlineto{\pgfpoint{2cm}{0cm}} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-quick-2} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathqmoveto{0pt}{0pt} + \pgfpathqcurveto{1cm}{1cm}{2cm}{1cm}{3cm}{0cm} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-quick-3} +\colorlet{examplefill}{yellow!80!black} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (1,1); + \pgfpathqcircle{10pt} + \pgfsetfillcolor{examplefill} + \pgfusepath{stroke,fill} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-quick-4} +\begin{pgfpicture} + \pgfpathqcircle{5pt} + \pgfusepathqstroke +\end{pgfpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-scopes.lvt b/testfiles/pgfmanual-en-base-scopes.lvt new file mode 100644 index 000000000..e6cd7a69c --- /dev/null +++ b/testfiles/pgfmanual-en-base-scopes.lvt @@ -0,0 +1,168 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-scopes-1} +Hello \begin{pgfpicture} + \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2ex}{1ex}} + \pgfusepath{stroke} +\end{pgfpicture} World! +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-2} +Rectangles \begin{pgfpicture} + \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2ex}{1ex}} + \pgfusepath{stroke} +\end{pgfpicture} and \begin{pgfpicture} + \pgfpathrectangle{\pgfpoint{0ex}{1ex}}{\pgfpoint{2ex}{1ex}} + \pgfusepath{stroke} +\end{pgfpicture}. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-3} +Rectangles \begin{pgfpicture} + \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2ex}{1ex}} + \pgfusepath{stroke} + \pgfsetbaseline{0pt} +\end{pgfpicture} and \begin{pgfpicture} + \pgfpathrectangle{\pgfpoint{0ex}{1ex}}{\pgfpoint{2ex}{1ex}} + \pgfusepath{stroke} + \pgfsetbaseline{0pt} +\end{pgfpicture}. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-4} +Text +\begin{pgfpicture} + \pgfpathcircle{\pgfpointorigin}{1ex}\pgfusepath{stroke} +\end{pgfpicture}, +\begin{pgfpicture} + \pgfsetbaseline{0pt} + \pgfpathcircle{\pgfpointorigin}{1ex}\pgfusepath{stroke} +\end{pgfpicture}, +\begin{pgfpicture} + \pgfsetbaseline{.5ex} + \pgfpathcircle{\pgfpointorigin}{1ex}\pgfusepath{stroke} +\end{pgfpicture}, +\begin{pgfpicture} + \pgfsetbaseline{-1ex} + \pgfpathcircle{\pgfpointorigin}{1ex}\pgfusepath{stroke} +\end{pgfpicture}. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-5} +Hello +\begin{pgfpicture} + \pgfsetbaselinepointlater{\pgfpointanchor{X}{base}} + % Note: no shape X, yet + \pgfnode{cross out}{center}{world.}{X}{\pgfusepath{stroke}} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-6} +\begin{pgfpicture} + \begin{pgfscope} + { + \pgfsetlinewidth{2pt} + \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2ex}{2ex}} + \pgfusepath{stroke} + } + \pgfpathrectangle{\pgfpoint{3ex}{0ex}}{\pgfpoint{2ex}{2ex}} + \pgfusepath{stroke} + \end{pgfscope} + \pgfpathrectangle{\pgfpoint{6ex}{0ex}}{\pgfpoint{2ex}{2ex}} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-7} +\begin{pgfpicture} + \begin{pgfscope} + { + \pgfsetarrows{->} + \pgfpathmoveto{\pgfpointorigin}\pgfpathlineto{\pgfpoint{2ex}{2ex}} + \pgfusepath{stroke} + } + \pgfpathmoveto{\pgfpoint{3ex}{0ex}}\pgfpathlineto{\pgfpoint{5ex}{2ex}} + \pgfusepath{stroke} + \end{pgfscope} + \pgfpathmoveto{\pgfpoint{6ex}{0ex}}\pgfpathlineto{\pgfpoint{8ex}{2ex}} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-8} +\begin{pgfpicture} + \pgfpathmoveto{\pgfpoint{0cm}{0cm}} % In the middle of path, now + \newbox\mybox + \setbox\mybox=\hbox{ + \begin{pgfinterruptpicture} + Sub-\begin{pgfpicture} % a subpicture + \pgfpathmoveto{\pgfpoint{1cm}{0cm}} + \pgfpathlineto{\pgfpoint{1cm}{1cm}} + \pgfusepath{stroke} + \end{pgfpicture}-picture. + \end{pgfinterruptpicture} + } + \pgfqbox{\mybox}% + \pgfpathlineto{\pgfpoint{0cm}{1cm}} + \pgfusepath{stroke} +\end{pgfpicture}\hskip3.9cm +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-9} +\tikz{\draw[help lines] (-1,-.5) grid (1,.5); + \pgftext[left] {lovely}} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-10} +\tikz{\draw[help lines] (-1,-.5) grid (1,.5); + \pgftext[right] {lovely}} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-11} +\tikz{\draw[help lines] (-1,-.5) grid (1,.5); + \pgftext[top] {lovely}} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-12} +\tikz{\draw[help lines] (-1,-.5) grid (1,.5); + \pgftext[top,right] {lovely}} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-13} +\tikz{\draw[help lines] (-1,-.5) grid (1,.5); + \pgftext[bottom] {lovely}} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-14} +\tikz{\draw[help lines] (-1,-.5) grid (1,.5); + \pgftext[bottom,right] {lovely}} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-15} +\tikz{\draw[help lines] (-1,-.5) grid (1,.5); + \pgftext[base] {lovely}} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-16} +\tikz{\draw[help lines] (-1,-.5) grid (1,.5); + \pgftext[base,right] {lovely}} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-17} +\tikz{\draw[help lines] (-1,-.5) grid (1,.5); + \pgftext[base,at={\pgfpoint{1cm}{0cm}}] {lovely}} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-18} +\tikz{\draw[help lines] (-1,-.5) grid (1,.5); + \pgftext[base,x=1cm,y=-0.5cm] {lovely}} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-scopes-19} +\tikz{\draw[help lines] (-1,-.5) grid (1,.5); + \pgftext[base,x=1cm,y=-0.5cm,rotate=30] {lovely}} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-shadings.lvt b/testfiles/pgfmanual-en-base-shadings.lvt new file mode 100644 index 000000000..6cbe7712e --- /dev/null +++ b/testfiles/pgfmanual-en-base-shadings.lvt @@ -0,0 +1,224 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-shadings-3} +\pgfdeclarehorizontalshading{myshadingA} + {1cm}{rgb(0cm)=(1,0,0); color(2cm)=(green); color(4cm)=(blue)} +\pgfuseshading{myshadingA} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-shadings-4} +\pgfdeclarehorizontalshading[mycolor]{myshadingB} + {1cm}{rgb(0cm)=(1,0,0); color(2cm)=(mycolor)} +\colorlet{mycolor}{green} +\pgfuseshading{myshadingB} +\colorlet{mycolor}{blue} +\pgfuseshading{myshadingB} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-shadings-5} +\pgfdeclareverticalshading{myshadingC} + {4cm}{rgb(0cm)=(1,0,0); rgb(1.5cm)=(0,1,0); rgb(2cm)=(0,0,1)} +\pgfuseshading{myshadingC} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-shadings-6} +\pgfdeclareradialshading{sphere}{\pgfpoint{0.5cm}{0.5cm}}% + {rgb(0cm)=(0.9,0,0); + rgb(0.7cm)=(0.7,0,0); + rgb(1cm)=(0.5,0,0); + rgb(1.05cm)=(1,1,1)} +\pgfuseshading{sphere} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-shadings-7} +\pgfdeclarefunctionalshading{twospots} + {\pgfpointorigin}{\pgfpoint{4cm}{4cm}}{}{ + % Save coordinates for later + 2 copy + % Compute distance from (40bp,45bp), with x doubled + 45 sub dup mul exch + 40 sub dup mul 0.5 mul add sqrt + % exponential decay + dup mul neg 1.0005 exch exp 1.0 exch sub + % Compute distance from (70bp,70bp) from stored coordinate, scaled + 3 1 roll + 70 sub dup mul .5 mul exch + 70 sub dup mul add sqrt + % Decay + dup mul neg 1.002 exch exp 1.0 exch sub + % red component + 1.0 3 1 roll +} +\pgfuseshading{twospots} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-shadings-8} +\pgfdeclarefunctionalshading[mycol]{sweep}{\pgfpoint{-1cm}{-1cm}} +{\pgfpoint{1cm}{1cm}}{\pgfshadecolortorgb{mycol}{\myrgb}}{ + 2 copy % whirl + % Calculate "safe" atan of position + 2 copy abs exch abs add 0.0001 ge { atan } { pop } ifelse + 3 1 roll + dup mul exch + dup mul add sqrt + 30 mul + add + sin + 1 add 2 div + dup + \myrgb % push mycol + 5 4 roll % multiply all components by calculated value + mul + 3 1 roll + 3 index + mul + 3 1 roll + 4 3 roll + mul + 3 1 roll +} +\colorlet{mycol}{white}% +\pgfuseshading{sweep}% +\colorlet{mycol}{red}% +\pgfuseshading{sweep} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-shadings-9} +\pgfshadecolortorgb{orange}{\mycol} +|\mycol|=\mycol |\mycolred|=\mycolred |\mycolgreen|=\mycolgreen |\mycolblue|=\mycolblue +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-shadings-10} +\pgfdeclarefunctionalshading[col1,col2,col3,col4]{bilinear interpolation} +{\pgfpointorigin}{\pgfpoint{100bp}{100bp}} +{ +\pgfshadecolortorgb{col1}{\first}\pgfshadecolortorgb{col2}{\second} +\pgfshadecolortorgb{col3}{\third}\pgfshadecolortorgb{col4}{\fourth} +}{ + 100 div exch 100 div 2 copy % Calculate y/100 x/100. + neg 1 add exch neg 1 add % Calculate 1-y/100 1-x/100. + 3 1 roll 2 copy exch 5 2 roll 6 copy 6 copy % Set up stack. + \firstred mul exch \secondred mul add mul % Process red component. + 4 1 roll + \thirdred mul exch \fourthred mul add mul + add + 13 1 roll + \firstgreen mul exch \secondgreen mul add mul % Process green component. + 4 1 roll + \thirdgreen mul exch \fourthgreen mul add mul + add + 7 1 roll + \firstblue mul exch \secondblue mul add mul % Process blue component. + 4 1 roll + \thirdblue mul exch \fourthblue mul add mul + add +} + +\colorlet{col1}{blue} +\colorlet{col2}{yellow} +\colorlet{col3}{red} +\colorlet{col4}{green} +\pgfuseshading{bilinear interpolation} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-shadings-12} +\begin{pgfpicture} + \pgfdeclareverticalshading{myshadingD} + {20pt}{color(0pt)=(red); color(20pt)=(blue)} + \pgftext[at=\pgfpoint{1cm}{0cm}] {\pgfuseshading{myshadingD}} + \pgftext[at=\pgfpoint{2cm}{0.5cm}]{\pgfuseshading{myshadingD}} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-shadings-13} +\pgfdeclareverticalshading{myshadingE}{100bp} + {color(0bp)=(red); color(25bp)=(green); color(75bp)=(blue); color(100bp)=(black)} +\pgfuseshading{myshadingE} +\hskip 1cm +\begin{pgfpicture} + \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2cm}{1cm}} + \pgfshadepath{myshadingE}{0} + \pgfusepath{stroke} + \pgfpathrectangle{\pgfpoint{3cm}{0cm}}{\pgfpoint{1cm}{2cm}} + \pgfshadepath{myshadingE}{0} + \pgfusepath{stroke} + \pgfpathrectangle{\pgfpoint{5cm}{0cm}}{\pgfpoint{2cm}{2cm}} + \pgfshadepath{myshadingE}{45} + \pgfusepath{stroke} + \pgfpathcircle{\pgfpoint{9cm}{1cm}}{1cm} + \pgfshadepath{myshadingE}{45} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-shadings-14} +\pgfdeclareverticalshading{myshadingF}{100bp} + {color(0bp)=(red); color(25bp)=(green); color(75bp)=(blue); color(100bp)=(black)} +\begin{tikzpicture} + \draw (50bp,50bp) node {\pgfuseshading{myshadingF}}; + \draw[white,thick] (25bp,25bp) rectangle (75bp,75bp); + \draw (50bp,0bp) node[below] {first two applications}; + + \begin{scope}[xshift=5cm] + \draw (50bp,50bp) node{\pgfuseshading{myshadingF}}; + \draw[rotate around={45:(50bp,50bp)},white,thick] (25bp,25bp) rectangle (75bp,75bp); + \draw (50bp,0bp) node[below] {third application}; + \end{scope} + + \begin{scope}[xshift=10cm] + \draw (50bp,50bp) node{\pgfuseshading{myshadingF}}; + \draw[white,thick] (50bp,50bp) circle (25bp); + \draw (50bp,0bp) node[below] {fourth application}; + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-shadings-15} +\pgfdeclareradialshading{ballshading}{\pgfpoint{-10bp}{10bp}} + {color(0bp)=(red!15!white); color(9bp)=(red!75!white); + color(18bp)=(red!70!black); color(25bp)=(red!50!black); color(50bp)=(black)} +\pgfuseshading{ballshading} +\hskip 1cm +\begin{pgfpicture} + \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{1cm}{1cm}} + \pgfshadepath{ballshading}{0} + \pgfusepath{} + \pgfpathcircle{\pgfpoint{3cm}{0cm}}{1cm} + \pgfshadepath{ballshading}{0} + \pgfusepath{} + \pgfpathcircle{\pgfpoint{6cm}{0cm}}{1cm} + \pgfshadepath{ballshading}{45} + \pgfusepath{} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-shadings-16} +\pgfdeclareverticalshading{myshadingG}{100bp} + {color(0bp)=(red); color(25bp)=(green); color(75bp)=(blue); color(100bp)=(black)} +\begin{pgfpicture} + \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2cm}{1cm}} + \pgfshadepath{myshadingG}{0} + \pgfusepath{stroke} + \pgfpathrectangle{\pgfpoint{3cm}{0cm}}{\pgfpoint{2cm}{1cm}} + \pgfshadepath{myshadingG}{90} + \pgfusepath{stroke} + \pgfpathrectangle{\pgfpoint{6cm}{0cm}}{\pgfpoint{2cm}{1cm}} + \pgfshadepath{myshadingG}{45} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-shadings-17} +\pgfdeclareverticalshading{rainbow}{100bp} + {color(0bp)=(red); color(25bp)=(red); color(35bp)=(yellow); + color(45bp)=(green); color(55bp)=(cyan); color(65bp)=(blue); + color(75bp)=(violet); color(100bp)=(violet)} +\begin{tikzpicture}[shading=rainbow] + \shade (0,0) rectangle node[white] {\textsc{pride}} (2,1); + \shade[shading angle=90] (3,0) rectangle +(1,2); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-transformations.lvt b/testfiles/pgfmanual-en-base-transformations.lvt new file mode 100644 index 000000000..0c2465de5 --- /dev/null +++ b/testfiles/pgfmanual-en-base-transformations.lvt @@ -0,0 +1,497 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usepgfmodule{nonlineartransformations} +\usepgfmodule{nonlineartransformations} +\usepgfmodule{nonlineartransformations} +\usepgfmodule{nonlineartransformations} +\usepgfmodule{nonlineartransformations} +\usepgfmodule{nonlineartransformations} +\usepgfmodule{nonlineartransformations} +\usetikzlibrary{curvilinear} +\usepgfmodule{nonlineartransformations} +\usetikzlibrary{curvilinear} +\usepgfmodule{nonlineartransformations} +\usetikzlibrary{curvilinear} +\usepgfmodule{nonlineartransformations} +\usetikzlibrary{curvilinear} + +\begin{document} + +\makeatletter +\def\polartransformation{ + % \pgf@x will contain the radius + % \pgf@y will contain the distance + \pgfmathsincos@{\pgf@sys@tonumber\pgf@x}% + % pgfmathresultx is now the cosine of radius and + % pgfmathresulty is the sine of radius + \pgf@x=\pgfmathresultx\pgf@y% + \pgf@y=\pgfmathresulty\pgf@y% +} +\makeatother + +\BEGINBOXTEST{pgfmanual-en-base-transformations-1} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (2,1) -- (1,0); + \pgftransformshift{\pgfpoint{1cm}{1cm}} + \draw[red] (0,0) -- (2,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-2} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (2,1) -- (1,0); + \pgftransformxshift{.5cm} + \draw[red] (0,0) -- (2,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-3} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (2,1) -- (1,0); + \pgftransformscale{.75} + \draw[red] (0,0) -- (2,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-4} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (2,1) -- (1,0); + \pgftransformxscale{.75} + \draw[red] (0,0) -- (2,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-5} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (2,1) -- (1,0); + \pgftransformxslant{.5} + \draw[red] (0,0) -- (2,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-6} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (2,1) -- (1,0); + \pgftransformyslant{-1} + \draw[red] (0,0) -- (2,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-7} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (2,1) -- (1,0); + \pgftransformrotate{30} + \draw[red] (0,0) -- (2,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-8} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgftransformtriangle + {\pgfpoint{1cm}{0cm}} + {\pgfpoint{0cm}{2cm}} + {\pgfpoint{3cm}{1cm}} + + \draw (0,0) -- (1pt,0pt) -- (0pt,1pt) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-9} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (2,1) -- (1,0); + \pgftransformcm{1}{1}{0}{1}{\pgfpoint{.25cm}{.25cm}} + \draw[red] (0,0) -- (2,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-10} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (3,1); + \pgftransformarrow{\pgfpointorigin}{\pgfpoint{3cm}{1cm}} + \pgftext{tip} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-11} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (2,1); + \pgftransformlineattime{.25}{\pgfpointorigin}{\pgfpoint{2cm}{1cm}} + \pgftext{Hi!} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-12} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (2,1); + \pgfslopedattimetrue + \pgftransformlineattime{.25}{\pgfpointorigin}{\pgfpoint{2cm}{1cm}} + \pgftext{Hi!} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-13} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgftransformscale{1.5} + \draw (0,0) -- (2,1); + \pgfslopedattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{.25}{\pgfpointorigin}{\pgfpoint{2cm}{1cm}} + \pgftext{Hi!} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-14} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgftransformscale{1.5} + \draw (0,0) -- (2,1); + \pgfslopedattimetrue + \pgfresetnontranslationattimetrue + \pgftransformlineattime{.25}{\pgfpointorigin}{\pgfpoint{2cm}{1cm}} + \pgftext{Hi!} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-15} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) .. controls (0,2) and (1,2) .. (2,1); + \pgftransformcurveattime{.25}{\pgfpointorigin} + {\pgfpoint{0cm}{2cm}}{\pgfpoint{1cm}{2cm}}{\pgfpoint{2cm}{1cm}} + \pgftext{Hi!} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-16} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) .. controls (0,2) and (1,2) .. (2,1); + \pgfslopedattimetrue + \pgftransformcurveattime{.25}{\pgfpointorigin} + {\pgfpoint{0cm}{2cm}}{\pgfpoint{1cm}{2cm}}{\pgfpoint{2cm}{1cm}} + \pgftext{Hi!} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-17} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfpathmoveto{\pgfpoint{2cm}{1cm}} + \pgfpatharcaxes{0}{60}{\pgfpoint{2cm}{0cm}}{\pgfpoint{0cm}{1cm}} + \pgfusepath{stroke} + \pgfslopedattimetrue + \pgftransformarcaxesattime{.25} + {\pgfpoint{0cm}{1cm}} + {\pgfpoint{2cm}{0cm}}{\pgfpoint{0cm}{1cm}} + {0}{60} + \pgftext{Hi!} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-18} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgftransformrotate{30} + \draw (0,0) -- (2,1) -- (1,0); + \pgftransformreset + \draw[red] (0,0) -- (2,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-19} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgftransformscale{2} + \pgftransformrotate{30} + \pgftransformxshift{1cm} + {\color{red}\pgftext{rotated}} + \pgftransformresetnontranslations + \pgftext{shifted only} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-20} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgftransformrotate{30} + \draw (0,0) -- (2,1) -- (1,0); + \pgftransforminvert + \draw[red] (0,0) -- (2,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-21} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (2,2); + \begin{scope}[xscale=2,thick] + \draw [red] (1,1) -- ++(1,0); + + \pgftransformationadjustments + \draw [blue] (1,0) -- ++(\pgfhorizontaltransformationadjustment,0); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-22} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (2,2); + \begin{scope}[xscale=2,thick,rotate=90] + \draw [red] (1,1) -- ++(1,0); + + \pgftransformationadjustments + \draw [blue] (1,0) -- ++(\pgfhorizontaltransformationadjustment,0); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-23} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfsetlinewidth{1pt} + \pgftransformscale{5} + \draw (0,0) -- (0.4,.2); + \pgftransformxshift{0.2cm} + \pgflowlevelsynccm + \draw[red] (0,0) -- (0.4,.2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-24} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfsetlinewidth{1pt} + \pgflowlevel{\pgftransformscale{5}} + \draw (0,0) -- (0.4,.2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-25} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfsetlinewidth{1pt} + \pgflowlevelobj{\pgftransformscale{5}} {\draw (0,0) -- (0.4,.2);} + \pgflowlevelobj{\pgftransformxshift{-1cm}}{\draw (0,0) -- (0.4,.2);} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-26} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \pgfsetlinewidth{1pt} + \begin{pgflowlevelscope}{\pgftransformscale{5}} + \draw (0,0) -- (0.4,.2); + \end{pgflowlevelscope} + \begin{pgflowlevelscope}{\pgftransformxshift{-1cm}} + \draw (0,0) -- (0.4,.2); + \end{pgflowlevelscope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-27} +\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} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-28} +\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} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-32} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-33} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + { + \pgftransformnonlinear{\polartransformation} + % The curve with the controls computed by pgf: a nice quarter arc + \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); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-34} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + \draw[red] (0:20mm) arc [start angle=0, end angle=90, radius=2cm]; + { + \pgftransformnonlinear{\polartransformation} + \pgfsettransformnonlinearflatness{2pt} % very precise + \draw (0,20mm) -- (90pt,20mm); + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-35} +\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} + { + \pgftransformshift{\pgfpoint{\angle pt}{\dist cm}} + \pgftext{\angle$^\circ$} + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-36} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + \pgftransformnonlinear{\polartransformation}% see above + \draw (0pt,0mm) grid [xstep=10pt, ystep=5mm] (90pt, 20mm); + + \begin{scope}[shift={(45pt,20mm)}] + % Draw something near "origin": + \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); + \pgftext{foo} + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-37} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + \pgftransformnonlinear{\polartransformation}% see above + \draw (0pt,0mm) grid [xstep=10pt, ystep=5mm] (90pt, 20mm); + + \begin{scope}[shift={(45pt,20mm)}] + % Draw something near "origin": + \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); + \pgftext{foo} + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-39} +\makeatletter +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + { + \pgfsetcurvilinearbeziercurve + {\pgfpoint{0mm}{20mm}} + {\pgfpoint{11mm}{20mm}} + {\pgfpoint{20mm}{11mm}} + {\pgfpoint{20mm}{0mm}} + \pgftransformnonlinear{\pgfpointcurvilinearbezierorthogonal\pgf@x\pgf@y}% + \draw (0,-30pt) grid [step=10pt] (80pt,30pt); + } + \draw[red, very thick] + (0mm,20mm) .. controls (11mm,20mm) and (20mm,11mm) .. (20mm,0mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-40} +\makeatletter +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + { + \pgfsetcurvilinearbeziercurve + {\pgfpoint{0mm}{20mm}} + {\pgfpoint{10mm}{20mm}} + {\pgfpoint{10mm}{10mm}} + {\pgfpoint{20mm}{10mm}} + \pgftransformnonlinear{\pgfpointcurvilinearbezierorthogonal\pgf@x\pgf@y}% + \draw (0,-30pt) grid [step=10pt] (80pt,30pt); + } + \draw[red, very thick] + (0mm,20mm) .. controls (10mm,20mm) and (10mm,10mm) .. (20mm,10mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-41} +\makeatletter +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + { + \pgfsetcurvilinearbeziercurve + {\pgfpoint{0mm}{20mm}} + {\pgfpoint{11mm}{20mm}} + {\pgfpoint{20mm}{11mm}} + {\pgfpoint{20mm}{0mm}} + \pgftransformnonlinear{\pgfpointcurvilinearbezierpolar\pgf@x\pgf@y}% + \draw (0,-30pt) grid [step=10pt] (80pt,30pt); + % Add a "barb": + \draw [blue, very thick] (20pt,10pt) -- (0,0) -- (20pt,-10pt); + } + \draw[red, very thick] + (0mm,20mm) .. controls (11mm,20mm) and (20mm,11mm) .. (20mm,0mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transformations-42} +\makeatletter +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + { + \pgfsetcurvilinearbeziercurve + {\pgfpoint{0mm}{20mm}} + {\pgfpoint{10mm}{20mm}} + {\pgfpoint{10mm}{10mm}} + {\pgfpoint{20mm}{10mm}} + \pgftransformnonlinear{\pgfpointcurvilinearbezierpolar\pgf@x\pgf@y}% + \draw (0,-30pt) grid [step=10pt] (80pt,30pt); + % Add a "barb": + \draw [blue, very thick] (20pt,10pt) -- (0,0) -- (20pt,-10pt); + } + \draw[red, very thick] + (0mm,20mm) .. controls (10mm,20mm) and (10mm,10mm) .. (20mm,10mm); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-base-transparency.lvt b/testfiles/pgfmanual-en-base-transparency.lvt new file mode 100644 index 000000000..abf463231 --- /dev/null +++ b/testfiles/pgfmanual-en-base-transparency.lvt @@ -0,0 +1,166 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\pgfdeclarefading{fading2} +{\tikz \shade[left color=pgftransparent!0, + right color=pgftransparent!100] (0,0) rectangle (2,2);} +\pgfdeclarehorizontalshading{shading}{100bp} +{ color(0pt)=(transparent!0); color(25bp)=(transparent!0); + color(75bp)=(transparent!100); color(100bp)=(transparent!100)} +\pgfdeclarefading{fading}{\pgfuseshading{shading}} +\usetikzlibrary{shapes.symbols} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-base-transparency-1} +\begin{pgfpicture} + \pgfsetlinewidth{5mm} + \color{red} + \pgfpathcircle{\pgfpoint{0cm}{0cm}}{10mm} \pgfusepath{stroke} + \color{black} + \pgfsetstrokeopacity{0.5} + \pgfpathcircle{\pgfpoint{1cm}{0cm}}{10mm} \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transparency-2} +\begin{tikzpicture} + \pgfsetfillopacity{0.5} + \fill[red] (90:1cm) circle (11mm); + \fill[green] (210:1cm) circle (11mm); + \fill[blue] (-30:1cm) circle (11mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transparency-3} +\begin{tikzpicture} + \pgfsetfillopacity{0.5} + \fill[red] (0,0) circle (1); + \fill[red] (1,0) circle (1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transparency-4} +\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); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transparency-5} +\pgfdeclarefading{fading1}{\textcolor{white}{Ti\emph{k}Z}} +\begin{tikzpicture} + \fill [black!20] (0,0) rectangle (2,2); + \fill [black!30] (0,0) arc (180:0:1); + \pgfsetfading{fading1}{\pgftransformshift{\pgfpoint{1cm}{1cm}}} + \fill [red] (0,0) rectangle (2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transparency-6} +\pgfdeclarefading{fading2} +{\tikz \shade[left color=pgftransparent!0, + right color=pgftransparent!100] (0,0) rectangle (2,2);} +\begin{tikzpicture} + \fill [black!20] (0,0) rectangle (2,2); + \fill [black!30] (0,0) arc (180:0:1); + \pgfsetfading{fading2}{\pgftransformshift{\pgfpoint{1cm}{1cm}}} + \fill [red] (0,0) rectangle (2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transparency-7} +\pgfdeclareradialshading{myshading}{\pgfpointorigin} +{ + color(0mm)=(pgftransparent!0); + color(5mm)=(pgftransparent!0); + color(8mm)=(pgftransparent!100); + color(15mm)=(pgftransparent!100) +} +\pgfdeclarefading{fading3}{\pgfuseshading{myshading}} +\begin{tikzpicture} + \fill [black!20] (0,0) rectangle (2,2); + \fill [black!30] (0,0) arc (180:0:1); + \pgfsetfading{fading3}{\pgftransformshift{\pgfpoint{1cm}{1cm}}} + \fill [red] (0,0) rectangle (2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transparency-8} +\pgfdeclarefading{fading2} +{\tikz \shade[left color=pgftransparent!0, + right color=pgftransparent!100] (0,0) rectangle (2,2);} +\begin{tikzpicture} + \fill [black!20] (0,0) rectangle (2,2); + \fill [black!30] (0,0) arc (180:0:1); + \pgfsetfading{fading2}{} + \fill [red] (0,0) rectangle (2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transparency-9} +\begin{tikzpicture} + \fill [black!20] (0,0) rectangle (2,2); + \fill [black!30] (0,0) arc (180:0:1); + \pgfsetfading{fading2}{\pgftransformshift{\pgfpoint{1cm}{1cm}} + \pgftransformrotate{20}} + \fill [red] (0,0) rectangle (2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transparency-10} +\pgfdeclarehorizontalshading{shading}{100bp} +{ color(0pt)=(transparent!0); color(25bp)=(transparent!0); + color(75bp)=(transparent!100); color(100bp)=(transparent!100)} + +\pgfdeclarefading{fading}{\pgfuseshading{shading}} + +\begin{tikzpicture} + \fill [black!20] (0,0) rectangle (2,2); + \fill [black!30] (0,0) arc (180:0:1); + + \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{2cm}{1cm}} + \pgfsetfadingforcurrentpath{fading}{} + \pgfusepath{discard} + + \fill [red] (0,0) rectangle (2,1); + + \pgfpathrectangle{\pgfpoint{0cm}{1cm}}{\pgfpoint{2cm}{1cm}} + \pgfsetfadingforcurrentpath{fading}{\pgftransformrotate{90}} + \pgfusepath{discard} + + \fill [red] (0,1) rectangle (2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transparency-11} +\begin{tikzpicture} + \pgfsetlinewidth{2mm} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{2cm}{0cm}} + \pgfsetfadingforcurrentpathstroked{fading}{} + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-base-transparency-12} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (2,2); + + % Stuff outside the picture, but still in a transparency group. + \node [left,overlay] at (0,1) { + \begin{tikzpicture} + \pgfsetfillopacity{0.5} + \pgftransparencygroup + \node at (2,0) [forbidden sign,line width=2ex,draw=red,fill=white] + {Smoking}; + \endpgftransparencygroup + \end{tikzpicture} + }; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-dv-axes.lvt b/testfiles/pgfmanual-en-dv-axes.lvt new file mode 100644 index 000000000..80ae43ccc --- /dev/null +++ b/testfiles/pgfmanual-en-dv-axes.lvt @@ -0,0 +1,1345 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.polar} +\usetikzlibrary{datavisualization.polar} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} + +\begin{document} + +\tikz \datavisualization data group {people and money} = { + data [set=people 1] { + time, people + 1900, 1000000000 + 1920, 1500000000 + 1930, 2000000000 + 1980, 3000000000 + } + data [set=people 2] { + time, people + 1900, 2000000000 + 1920, 2500000000 + 1940, 4000000000 + 2000, 5700000000 + } + data [set=money 1] { + time, money + 1910, 1.1 + 1920, 2 + 1930, 5 + 1980, 2 + } + data [set=money 2] { + time, money + 1950, 3 + 1960, 3 + 1970, 4 + 1990, 3.5 + } + }; +\tikzdatavisualizationset{ + our system/.style={ + new Cartesian axis=x axis, + new Cartesian axis=left axis, + new Cartesian axis=right axis, + x axis={attribute=x}, + left axis={unit vector={(0cm,1pt)}}, + right axis={unit vector={(0cm,1pt)}}, + 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}} + } +} + +\BEGINBOXTEST{pgfmanual-en-dv-axes-4} +\tikz \datavisualization [scientific axes, + x axis={attribute=people, length=2.5cm, ticks=few}, + y axis={attribute=year}, + visualize as scatter] + data { + year, people + 1900, 100 + 1910, 200 + 1950, 200 + 1960, 250 + 2000, 150 + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-5} +\tikz \datavisualization [scientific axes, all axes={length=3cm}, + visualize as line] + data [format=function] { + var x : interval [5:10]; + func y = \value x * \value x; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-6} +\tikz \datavisualization [scientific axes, all axes={length=3cm}, + visualize as line, + x axis={include value=20}, + y axis={include value=0}] + data [format=function] { + var x : interval [5:10]; + func y = \value x * \value x; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-8} +\tikz \datavisualization + [scientific axes, + x axis={attribute=people, length=2.5cm, ticks=few}, + y axis={attribute=year, scaling=1900 at 0cm and 2000 at 5cm}, + visualize as scatter] + data { + year, people + 1900, 100 + 1910, 200 + 1950, 200 + 1960, 250 + 2000, 150 + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-13} +\tikz \datavisualization + [scientific axes, + x axis={ticks={major={at={1,10,100,1000}}}, + scaling=1 at 0cm and 1000 at 3cm, + function=\pgfdvmathln{\pgfvalue}{\pgfvalue}}, + visualize as scatter] + data [format=named] { + x={1,100,...,1000}, y={1,2,3} + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-14} +\tikz \datavisualization + [scientific axes, + x axis={ticks=few, + scaling=1 at 0cm and 1000 at 3cm, + function=\pgfdvmathunaryop{\pgfvalue}{sqrt}{\pgfvalue}}, + visualize as scatter] + data [format=named] { + x={0,100,...,1000}, y={1,2,3} + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-15} +\tikz \datavisualization [scientific axes, + x axis={logarithmic}, + y axis={logarithmic}, + visualize as line] + data [format=function] { + var x : interval [0.01:100]; + func y = \value x * \value x; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-16} +\tikz \datavisualization + [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} + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-17} +\tikz \datavisualization + [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} + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-18} +\tikz \datavisualization [scientific axes, + x axis={length=3cm}, + y axis={length=2cm}, + all axes={ticks=few}, + visualize as line] + data { + x, y + 10, 10 + 20, 20 + 15, 30 + 13, 20 + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-19} +\tikz \datavisualization [scientific axes, + x axis={length=3cm}, + y axis={length=4cm}, + all axes={ticks=few}, + visualize as line] + data { + x, y + 10, 10 + 20, 20 + 15, 30 + 13, 20 + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-20} +\tikz \datavisualization [scientific axes, + all axes={ticks=few, unit length=1mm}, + visualize as line] + data { + x, y + 10, 10 + 40, 20 + 15, 30 + 13, 20 + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-21} +\tikz \datavisualization + [scientific axes, + x axis={unit length=1mm per 1000000000 units, ticks=few}, + visualize as line] + data { + x, y + 10000000000, 10 + 40000000000, 20 + 15000000000, 30 + 13000000000, 20 + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-22} +\tikz \datavisualization + [scientific axes, + y axis={logarithmic, power unit length=1mm, grid}, + visualize as line] + data { + x, y + 0, 0.0000000001 + 1, 1 + 2, 100000 + 3, 100000000000 + 4, 10000000000000000000000000000000 + 5, 500000000 + 6, 5000000000000000000 + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-23} +\tikz \datavisualization [ + scientific axes, + x axis = {label, length=2.5cm}, + y axis = {label={[node style={fill=blue!20}]{$x^2$}}}, + visualize as smooth line] + data [format=function] { + var x : interval [-3:5]; + func y = \value x * \value x; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-24} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + + \datavisualization + [new Cartesian axis=x axis, x axis={attribute=x}, + new Cartesian axis=y axis, y axis={attribute=y}, + x axis={unit vector=(0:1pt)}, + y axis={unit vector=(60:1pt)}, + visualize as scatter] + data { + x, y + 0, 0 + 1, 0 + 2, 0 + 1, 1 + 2, 1 + 1, 1.5 + 2, 1.5 + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-30} +\tikz \datavisualization [ + scientific axes=clean, + x axis={attribute=time, ticks={tick unit=ms}, + label={elapsed time}}, + y axis={attribute=v, ticks={tick unit=m/s}, + label={speed of disc}}, + all axes=grid, + visualize as line] +data { + time, v + 0, 0 + 1, 0.001 + 2, 0.002 + 3, 0.004 + 4, 0.0035 + 5, 0.0085 + 6, 0.0135 +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-31} +\begin{tikzpicture} + \datavisualization [scientific axes, + visualize as smooth line] + data [format=function] { + var x : interval [0:100]; + func y = sqrt(\value x); + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-33} +\begin{tikzpicture} + \datavisualization [visualize as smooth line, + scientific axes, + all axes={unit length=1cm per 10 units, ticks={few}}] + data [format=function] { + var x : interval [0:100]; + func y = sqrt(\value x); + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-34} +\begin{tikzpicture} + \datavisualization [scientific axes=outer ticks, + visualize as smooth line] + data [format=function] { + var x : interval [-12:12]; + func y = \value x*\value x*\value x; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-35} +\begin{tikzpicture} + \datavisualization [scientific axes=inner ticks, + visualize as smooth line] + data [format=function] { + var x : interval [-12:12]; + func y = \value x*\value x*\value x; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-36} +\begin{tikzpicture} + \datavisualization [scientific axes={inner ticks, width=3.2cm}, + style sheet=cross marks, + visualize as scatter/.list={a,b}] + data [set=a] { + x, y + 0, 0 + 1, 1 + 0.5, 0.5 + 2, 1 + } + data [set=b] { + x, y + 0.05, 0 + 1.5, 1 + 0.5, 0.75 + 2, 0.5 + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-37} +\tikz \datavisualization [ + scientific axes=clean, + visualize as smooth line] +data [format=function] { + var x : interval [-12:12]; + func y = \value x*\value x*\value x; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-38} +\tikz \datavisualization + [scientific axes={clean, standard labels}, + visualize as smooth line, + x axis={label=degree $d$, + ticks={tick unit={}^\circ}}, + y axis={label=$\sin d$}] +data [format=function] { + var x : interval [-10:10] samples 10; + func y = sin(\value x); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-39} +\tikz \datavisualization [ + scientific axes={clean, upright labels}, + visualize as smooth line, + x axis={label=degree $d$, + ticks={tick unit={}^\circ}}, + y axis={label=$\cos d$, include value=1, + ticks={style={ + /pgf/number format/precision=4, + /pgf/number format/fixed zerofill}}}] +data [format=function] { + var x : interval [-10:10] samples 10; + func y = cos(\value x); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-40} +\tikz \datavisualization [ + scientific axes={clean, end labels}, + visualize as smooth line, + x axis={label=degree $d$, + ticks={tick unit={}^\circ}}, + y axis={label=$\tan d$}] +data [format=function] { + var x : interval [-80:80]; + func y = tan(\value x); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-41} +\begin{tikzpicture} + \datavisualization [school book axes, visualize as smooth line] + data [format=function] { + var x : interval [-1.3:1.3]; + func y = \value x*\value x*\value x; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-42} +\begin{tikzpicture} + \datavisualization [school book axes={unit=10}, + visualize as smooth line, + clean ticks, + x axis={label=$x$}, + y axis={label=$f(x)$}] + data [format=function] { + var x : interval [-20:20]; + func y = \value x*\value x/10; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-43} +\begin{tikzpicture} + \datavisualization [school book axes={standard labels}, + visualize as smooth line, + clean ticks, + x axis={label=$x$}, + y axis={label=$f(x)$}] + data [format=function] { + var x : interval [-1:1]; + func y = \value x*\value x + 1; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-44} +\begin{tikzpicture} + \datavisualization [xy Cartesian, visualize as smooth line] + data [format=function] { + var x : interval [-1.25:1.25]; + func y = \value x*\value x*\value x; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-45} +\tikz \datavisualization [ + scientific axes, visualize as line, + x axis={ticks={step=24, minor steps between steps=3}, + label=hours}] + data { + x, y + 0, 0 + 10, 0 + 20, 0.5 + 30, 0.75 + 40, 0.7 + 50, 0.6 + 60, 0.5 + 70, 0.45 + 80, 0.47 + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-46} +\tikz \datavisualization + [scientific axes, + visualize as smooth line, + all axes= {grid, unit length=1.25cm}, + y axis={ ticks=few }, + x axis={ ticks=many, ticks and grid={ major also at={(pi/2) as $\frac{\pi}{2}$}}}] + data [format=function] { + var x : interval [-pi/2:3*pi] samples 50; + func y = sin(\value x r); + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-47} +\begin{tikzpicture} + \datavisualization [scientific axes, visualize as smooth line] + data [format=function] { + var x : interval [1:11]; + func y = \value x*\value x; + }; +\end{tikzpicture} +\qquad +\begin{tikzpicture} + \datavisualization [scientific axes, visualize as smooth line, + y axis={exponential steps}, + x axis={ticks={quarter about strategy}}, + ] + data [format=function] { + var x : interval [1:11]; + func y = \value x*\value x; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-48} +\tikz \datavisualization [ + school book axes, visualize as smooth line, + y axis={ticks={step=1.25}}, + ] + data [format=function] { + var x : interval [0:3]; + func y = \value x*\value x/2; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-49} +\begin{tikzpicture} + \datavisualization [school book axes, visualize as smooth line, + x axis={ticks={minor steps between steps=3}}, + y axis={ticks={minor steps between steps}}, + ] + data [format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-50} +\tikz \datavisualization + [ school book axes, visualize as smooth line, + x axis={ticks={major={at={1, 1.5, 2}}}}] + data [format=function] { + var x : interval [-1.25:2]; + func y = \value x * \value x / 2; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-51} +\tikz \datavisualization + [ school book axes, visualize as smooth line, + x axis={grid={minor={at={1, 1.5, 2}}}}] + data [format=function] { + var x : interval [-1.25:2]; + func y = \value x * \value x / 2; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-52} +\tikz \datavisualization + [ school book axes, visualize as smooth line, + x axis={ticks={minor steps between steps, common={low=0}}} ] + data [format=function] { + var x : interval [-1.25:2]; + func y = \value x * \value x / 2; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-53} +\tikz \datavisualization + [ school book axes, visualize as smooth line, + x axis={ticks={major={at={-1,0.5,(pi/2)}}}}] + data [format=function] { + var x : interval [-1.25:2]; + func y = \value x * \value x / 2; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-55} +\tikz \datavisualization + [ school book axes, visualize as smooth line, + x axis={grid, ticks and grid={major={also at={0.5}}}}] + data [format=function] { + var x : interval [-1.25:2]; + func y = \value x * \value x / 2; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-56} +\tikz \datavisualization + [scientific axes, + all axes={ticks={style=blue}, length=3cm}, + 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; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-57} +\tikz \datavisualization + [scientific axes, + all axes={ticks={node style=red}, length=3cm}, + visualize as line] + data [format=function] { + var x : interval [5:10]; + func y = \value x * \value x; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-58} +\tikz \datavisualization + [scientific axes, + all axes={ + length=3cm, + grid, + grid={minor steps between steps} + }, + grid layer/.style=, % none, so on top of data (bad idea) + visualize as line] + data [format=function] { + var x : interval [5:10]; + func y = \value x * \value x; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-60} +\tikz \datavisualization + [scientific axes, + all axes={length=3cm, grid}, + every grid/.append style={style=densely dashed}, + visualize as line] + data [format=function] { + var x : interval [5:10]; + func y = \value x * \value x; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-62} +\tikz \datavisualization + [scientific axes, + all axes={ + length=3cm, + grid, + grid={minor steps between steps} + }, + every major grid/.style = {style={blue, thin}}, + visualize as line] + data [format=function] { + var x : interval [5:10]; + func y = \value x * \value x; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-69} +\tikz \datavisualization [ + scientific axes, + visualize as smooth line, + x axis={ticks={major={ + options at = 3 as [no tick text], + also at = (pi) as + [{tick text padding=1ex}] $\pi$}}}] +data [format=function] { + var x : interval[0:2*pi]; + func y = sin(\value x r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-70} +\tikz \datavisualization + [scientific axes=clean, + x axis={length=2.5cm, ticks={major at={ + 5, + 6 as [style=red], + 7 as [{style=blue, low=-1em}], + 8 as [style=green] $2^3$, + 10 as ten + }}}, + visualize as line] + data [format=function] { + var x : interval [5:10]; + func y = \value x * \value x; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-71} +\tikz \datavisualization + [scientific axes, all axes={ticks=few, length=2.5cm}, + x axis={ticks={tick prefix=$\langle$, tick suffix=$]$}}, + visualize as line] + data [format=function] { + var x : interval [5:10]; + func y = \value x * \value x; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-72} +\tikz \datavisualization + [scientific axes, all axes={length=3cm}, + x axis={ticks={tick unit=s}}, + y axis={ticks={tick unit=m/s^2}}, + visualize as line] + data [format=function] { + var x : interval [5:10]; + func y = \value x * \value x; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-73} +\def\mytypesetter#1{% + \pgfmathparse{#1/pi}% + \pgfmathprintnumber{\pgfmathresult}$\pi$% +} +\tikz \datavisualization + [school book axes, all axes={unit length=1.25cm}, + x axis={ticks={step=(0.5*pi), tick typesetter/.code=\mytypesetter{##1}}}, + y axis={include value={-1,1}}, + visualize as smooth line] + data [format=function] { + var x : interval [0.5:7]; + func y = sin(\value x r); + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-74} +\tikz \datavisualization [scientific axes, + all axes={length=2.5cm}, + visualize as smooth line] + data [format=function] { + var y : interval[-100:100]; + func x = \value y*\value y; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-75} +\tikz \datavisualization [scientific axes, + all axes={length=2.5cm}, + x axis={ticks={node style={rotate=90, anchor=east}}}, + visualize as smooth line] + data [format=function] { + var y : interval[-100:100]; + func x = \value y*\value y; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-76} +\tikz \datavisualization [scientific axes, + all axes={length=2.5cm}, + x axis={ticks={major at={0,4000,8000, + 2000 as [node style={yshift=-1em}], + 6000 as [node style={yshift=-1em}], + 10000 as [node style={yshift=-1em}]}}}, + visualize as smooth line] + data [format=function] { + var y : interval[-100:100]; + func x = \value y*\value y; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-77} +\tikz \datavisualization [scientific axes, + all axes={length=2.5cm}, x axis={ticks=stack}, + visualize as smooth line] + data [format=function] { + var y : interval[-100:100]; + func x = \value y*\value y; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-79} +\tikz \datavisualization [scientific axes, + all axes={length=2.5cm}, + x axis={ticks={tick text low even padding=-1em}}, + visualize as smooth line] + data [format=function] { + var y : interval[-100:100]; + func x = \value y*\value y; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-80} +\tikz \datavisualization [scientific axes, + all axes={length=2.5cm}, + x axis={ticks={stack=1.5em}}, + visualize as smooth line] + data [format=function] { + var y : interval[-100:100]; + func x = \value y*\value y; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-81} +\tikz \datavisualization [scientific axes, + all axes={length=2.5cm}, + x axis={ticks=stack'}, + visualize as smooth line] + data [format=function] { + var y : interval[-100:100]; + func x = \value y*\value y; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-82} +\tikz \datavisualization + [scientific axes, + x axis={ticks={stack, many, major also at= + {(pi) as [{tick text padding=2.5em}] $\pi$}}}, + visualize as smooth line] + data [format=function] { + var x : interval[0:(2*pi)]; + func y = sin(\value x r); + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-83} +\begin{tikzpicture} + \datavisualization + [scientific axes={inner ticks, width=3cm}, + x axis={ticks={step=3, minor steps between steps=2}}, + y axis={ticks={step=.36}}, + visualize as scatter] + data { + x, y + 17, 30 + 34, 32 + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-84} +\begin{tikzpicture} + \datavisualization + [scientific axes, + x axis={logarithmic, length=2cm, ticks={step=1.5}}, + y axis={logarithmic, ticks={step=1, minor steps between steps=9}}, + visualize as scatter] + data { + x, y + 1, 10 + 1000, 1000000 + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-85} +\def\silly{ + \tikzdatavisualizationset{major={at={ + 2,3,5,7,11,13}}} +} +\begin{tikzpicture} + \datavisualization [ + scientific axes, visualize as scatter, + x axis={tick placement strategy=\silly} + ] + data { + x, y + 0, 0 + 15, 15 + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-91} +\tikz \datavisualization [ + our system, + x axis={attribute=time, length=4cm}, + left axis ={attribute=money}, + right axis={attribute=people}, + visualize as line/.list={people 1, people 2, money 1, money 2}, + people 1={style={visualizer color=blue}}, + 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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-93} +\tikzdatavisualizationset{ + our system/.style={ + new Cartesian axis=x axis, + new Cartesian axis=left axis, + new Cartesian axis=right axis, + x axis={attribute=x}, + left axis={unit vector={(0cm,1pt)}}, + right axis={unit vector={(0cm,1pt)}}, + 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}} + } +} +\tikzset{ + data visualization/our system/.append style={ + left axis= {visualize axis={x axis= {goto=min}}}, + right axis={visualize axis={x axis= {goto=max}}}, + x axis= {visualize axis={left axis={goto=min}}, + visualize axis={left axis={goto=max}}}, + } +} +\tikz \datavisualization [ + our system, + x axis={attribute=time, length=4cm}, + 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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-94} +\tikzdatavisualizationset{ + our system/.style={ + new Cartesian axis=x axis, + new Cartesian axis=left axis, + new Cartesian axis=right axis, + x axis={attribute=x}, + left axis={unit vector={(0cm,1pt)}}, + right axis={unit vector={(0cm,1pt)}}, + 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}} + } +} +\tikzset{ + data visualization/our system/.append style={ + x axis= {visualize axis={left axis={goto pos=0.25}}, + visualize axis={left axis={goto pos=0.5}}}, + } +} +\tikz \datavisualization [ + our system, + x axis={attribute=time, length=4cm}, + 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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-95} +\tikzdatavisualizationset{ + our system/.style={ + new Cartesian axis=x axis, + new Cartesian axis=left axis, + new Cartesian axis=right axis, + x axis={attribute=x}, + left axis={unit vector={(0cm,1pt)}}, + right axis={unit vector={(0cm,1pt)}}, + 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}} + } +} +\tikzset{ + data visualization/our system/.append style={ + every axis/.style={style=black!50}, % make this the default + left axis= {visualize axis={x axis= {goto=min}, style=red!75}}, + right axis={visualize axis={x axis= {goto=max}, style=blue!75}}, + x axis= {visualize axis={left axis={goto=min}}, + visualize axis={left axis={goto=max}}}, + } +} +\tikz \datavisualization [ + our system, + x axis={attribute=time, length=4cm}, + 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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-96} +\begin{tikzpicture} + \datavisualization [scientific axes=clean, + x axis={padding min=-1cm}, + visualize as smooth line] + data [format=function] { + var x : interval [-3:5]; + func y = \value x * \value x; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-97} +\tikzdatavisualizationset{ + our system/.style={ + new Cartesian axis=x axis, + new Cartesian axis=left axis, + new Cartesian axis=right axis, + x axis={attribute=x}, + left axis={unit vector={(0cm,1pt)}}, + right axis={unit vector={(0cm,1pt)}}, + 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}} + } +}% +\tikzset{ + data visualization/our system/.append style={ + every axis/.style={style=black!50}, % make this the default + left axis= {visualize axis={x axis= {goto=min}, style=red!75}}, + right axis={visualize axis={x axis= {goto=max}, style=blue!75}}, + x axis= {visualize axis={left axis={goto=min}}, + visualize axis={left axis={goto=max}}}, + } +} +\tikzset{ + data visualization/our system/.append style={ + all axes= {padding=.5em}, + left axis= {visualize axis={x axis= {goto=padded min}, padded}}, + right axis={visualize axis={x axis= {goto=padded max}, padded}}, + x axis= {visualize axis={left axis={goto=padded min}, padded}, + visualize axis={left axis={goto=padded max}, padded}}, + } +} +\tikz \datavisualization [ + our system, + x axis={attribute=time, length=3cm}, + 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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-98} +\tikz \datavisualization [ + xyz Cartesian cabinet, + all axes={visualize axis={low=0, style=->}}, + x axis={visualize grid={direction axis=y axis}, grid=many}, + visualize as scatter] + data { + x, y, z + 0, 0, 1 + 0, 1, 0 + 2, 2, 2 + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-99} +\tikz \datavisualization [ + xyz Cartesian cabinet, + all axes={visualize axis={low=0, style=->}, grid=many}, + x axis={visualize grid={direction axis=z axis}}, + z axis={visualize grid={direction axis=x axis}, + visualize grid={direction axis=y axis},}, + visualize as scatter] + data { + x, y, z + 0, 0, 1 + 0, 1, 0 + 2, 2, 2 + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-100} +\tikz \datavisualization [ + xy Cartesian, + all axes={visualize axis={low=0, style=->}, + grid={some, minor steps between steps}}, + x axis= {visualize grid={ + direction axis=y axis, + minor={low=0.25, high=1.75, style=red!50}}}, + visualize as scatter] + data { + x, y + 0, 0 + 3, 3 + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-101} +\tikzset{ + data visualization/our system/.append style={ + x axis= {visualize grid={direction axis=left axis}}, + left axis= {visualize grid={direction axis=x axis, + common={style=red!50}}}, + right axis={visualize grid={direction axis=x axis, + common={style=blue!50}}}, + } +} +\tikz \datavisualization [ + our system, + x axis={attribute=time, length=3cm, grid=many}, + 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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-102} +\tikz \datavisualization [scientific axes, all axes={length=3cm}, + x axis={ticks={stack}}, + visualize as smooth line] + data [format=function] { + var x : interval [0:2]; + func y = \value x*\value x; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-103} +\tikzset{ + data visualization/our system/.append style={ + x axis={visualize ticks={direction axis=left axis, left axis={goto=min}}, + visualize ticks={direction axis=left axis, left axis={goto=max}}, + } + } +} +\tikz \datavisualization [ + our system, + x axis={attribute=time, length=3cm, ticks=many}, + 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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-104} +\tikzset{ + data visualization/our system/.append style={ + x axis={ + visualize ticks={direction axis=left axis,high=0pt,left axis={goto=min}}, + visualize ticks={direction axis=left axis,low=0pt,left axis={goto=max}}, + } + } +} +\tikz \datavisualization [ + our system, + x axis={attribute=time, length=3cm, ticks=many}, + 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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-105} +\tikzset{ + data visualization/our system/.append style={ + x axis={ + visualize ticks={direction axis=left axis, left axis={goto=min}, + high=0pt, tick text at low, stack}, + visualize ticks={direction axis=left axis, left axis={goto=max}, + low=0pt, tick text at high, stack} + } + } +} +\tikz \datavisualization [ + our system, + x axis={attribute=time, length=3cm, ticks=some}, + 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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-106} +\tikz \datavisualization [scientific axes, all axes={length=3cm}, + x axis={ticks={ + major also at={6.5 as [no tick text]}}}, + visualize as smooth line] + data [format=function] { + var x : interval [5:10]; + func y = \value x * \value x; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-107} +\tikzdatavisualizationset{ + our system/.append style={ + x axis={visualize label={ + x axis={goto pos=.5}, + left axis={padding=1.5em, goto=padded min}}} + } +} +\tikz \datavisualization [ + 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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-108} +\tikzdatavisualizationset{ + our system/.append style={ + x axis={visualize label={ + x axis={goto pos=.5}, + node style={ + at={(0,0 |- data visualization bounding box.south)}, + below +} } } } } +\tikz \datavisualization [ + 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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-axes-110} +\tikzdatavisualizationset{ + our system/.style={ + % The axes + new Cartesian axis=x axis, + new Cartesian axis=left axis, + new Cartesian axis=right axis, + % The default attributes, other attributes must be configured + x axis={attribute=x}, + % The directions of the axes + all axes={padding=.5em}, + left axis={unit vector={(0cm,1pt)}}, + right axis={unit vector={(0cm,1pt)}}, + % The lengths of the axes + 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}}, + % The styling of the axes + every axis/.style={style=black!50}, % make this the default + % Visualizing the axes themselves + left axis= {visualize axis={x axis= {goto=padded min}, style=red!75, padded}}, + right axis={visualize axis={x axis= {goto=padded max}, style=blue!75,padded}}, + x axis= {visualize axis={left axis={goto=padded min}, padded}, + visualize axis={left axis={goto=padded max}, padded}}, + % Visualizing the grid, when requested + x axis= {visualize grid={direction axis=left axis, padded}}, + left axis= {visualize grid={direction axis=x axis, padded, common={style=red!50}}}, + right axis={visualize grid={direction axis=x axis, padded, common={style=blue!50}}}, + % Visualizing the ticks, when requested + 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}}, + x axis={ + visualize ticks={direction axis=left axis, left axis={goto=padded min}, high=0pt, tick text at low}, + visualize ticks={direction axis=left axis, left axis={goto=padded max}, low=0pt} + }, + % By default, there are ticks on all axes + all axes={ticks}, + % Visualizing the axis labels, when requested + x axis={visualize label={ + x axis={goto pos=.5}, node style={at={(0,0 |- data visualization bounding box.south)}, below}}}, + left axis={visualize label={ + left axis={goto pos=.5}, node style={ + at={(0,0 -| data visualization bounding box.west)}, rotate=90, anchor=south, red!50!black}}}, + right axis={visualize label={ + right axis={goto pos=.5}, node style={ + at={(0,0 -| data visualization bounding box.east)}, rotate=-90, anchor=south, blue!80!black}}}, + } +} +\tikz \datavisualization [ + 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, + padding min=0, include value=0, grid, + ticks={tick prefix=\$, style={/pgf/number format/fixed, + /pgf/number format/fixed zerofill, /pgf/number format/precision=2}}}, + right axis={attribute=people, + label=Population, + padding min=0, include value=0, + ticks={style=/pgf/number format/fixed}}, + visualize as line/.list={ + people 1, people 2, money 1, money 2}, + people 1={style={visualizer color=blue}}, + 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}; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-dv-examples.lvt b/testfiles/pgfmanual-en-dv-examples.lvt new file mode 100644 index 000000000..6ea72cebc --- /dev/null +++ b/testfiles/pgfmanual-en-dv-examples.lvt @@ -0,0 +1,88 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-dv-examples-1} +\begin{tikzpicture}[baseline] + \datavisualization [ + school book axes, + visualize as smooth line, + clean ticks, + all axes={grid={step=1,minor steps between steps=1}}, + x axis={ + ticks={ + major={ + also at={(0.5*pi) as $\pi/2$}, + also at={(pi) as $\pi$}, + options at=3 as [no tick text] + } + }, + label=$x$ + }, + y axis={ + label=$y$, + } + ] + data [format=function] { + var x : interval [-0.5*pi:4] samples 50; + func y = sin(\value x r); + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-examples-2} +\begin{tikzpicture}[baseline] + \datavisualization [ + scientific axes=clean, + visualize as line, + all axes={padding=4pt}, + x axis={logarithmic, + ticks={many, tick unit={ms}, + node style={rotate=45,anchor=north east}}, + label={time}, + grid}, + y axis={label={distance}}, + ] + data { + x, y, z + 0.001, 0, 0 + 2000, 2.23, 2 + 20670, 1, 3 + 501, -2, 0 + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-examples-3} +\begin{tikzpicture}[baseline,mark=*] + \datavisualization [ + scientific axes=inner ticks, + all axes={padding=4pt}, + euro about strategy, + visualize as scatter, + x axis={attribute=x2}, + y axis={attribute=y2} + ] + data [separator=\space] { +x y x1 y1 x2 y2 x3 y3 +10.0 8.04 10.0 9.14 10.0 7.46 8.0 6.58 +8.0 6.95 8.0 8.14 8.0 6.77 8.0 5.76 +13.0 7.58 13.0 8.74 13.0 12.74 8.0 7.71 +9.0 8.81 9.0 8.77 9.0 7.11 8.0 8.84 +11.0 8.33 11.0 9.26 11.0 7.81 8.0 8.47 +14.0 9.96 14.0 8.10 14.0 8.84 8.0 7.04 +6.0 7.24 6.0 6.13 6.0 6.08 8.0 5.25 +4.0 4.26 4.0 3.10 4.0 5.39 19.0 12.50 +12.0 10.84 12.0 9.13 12.0 8.15 8.0 5.56 +7.0 4.82 7.0 7.26 7.0 6.42 8.0 7.91 +5.0 5.68 5.0 4.74 5.0 5.73 8.0 6.89 + }; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-dv-formats.lvt b/testfiles/pgfmanual-en-dv-formats.lvt new file mode 100644 index 000000000..e9f2aa9e1 --- /dev/null +++ b/testfiles/pgfmanual-en-dv-formats.lvt @@ -0,0 +1,122 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-dv-formats-3} +\begin{tikzpicture} + \datavisualization [school book axes, visualize as line] + data [separator=\space] { + x y + 0 0 + 1 1 + 2 1 + 3 0 + } + data [separator=;] { + x; y; z + 3; 1; 0 + 2; 2; 0 + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-formats-4} +\begin{tikzpicture} + \datavisualization [school book axes, visualize as line] + data [headline={x, y}] { + 0, 0 + 1, 1 + 2, 1 + 3, 0 + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-formats-5} +\begin{tikzpicture} + \datavisualization [school book axes, visualize as line] + data [format=named] { + x=0, y=0 + x=1, y=1 + x=2, y=1 + x=3, y=0 + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-formats-6} +\tikz \datavisualization + [scientific axes=clean, + visualize as scatter/.list={a,b,c}, + style sheet=cross marks] +data [format=named] { + x=0, y={1,2,3}, set=a + x={2,3,4}, y={3,4,5,7}, set=b + x=6, y={5,7,...,15}, set=c +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-formats-7} +\begin{tikzpicture} + \datavisualization [school book axes, visualize as line] + data [format=TeX code] { + \pgfkeys{/data point/.cd,x=0, y=0} \pgfdatapoint + \pgfkeys{/data point/.cd,x=1, y=1} \pgfdatapoint + \pgfkeys{/data point/x=2} \pgfdatapoint + \pgfkeyssetvalue{/data point/x}{3} + \pgfkeyssetvalue{/data point/y}{0} \pgfdatapoint + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-formats-8} +\tikz + \datavisualization [school book axes, visualize as smooth line] + data [format=function] { + var x : interval [-1.5:1.5]; + + func y = \value x * \value x; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-formats-9} +\tikz \datavisualization [ + school book axes, + all axes={unit length=5mm, ticks={step=2}}, + visualize as smooth line] +data [format=function] { + var t : interval [0:2*pi]; + + func x = \value t * cos(\value t r); + func y = \value t * sin(\value t r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-formats-10} +\tikz \datavisualization [ + scientific axes=clean, + y axis={ticks={style={ + /pgf/number format/fixed, + /pgf/number format/fixed zerofill, + /pgf/number format/precision=2}}}, + x axis={ticks={tick suffix=${}^\circ$}}, + visualize as smooth line/.list={1,2,3,4,5,6}, + style sheet=vary hue] +data [format=function] { + var set : {1,...,6}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); +}; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-dv-introduction.lvt b/testfiles/pgfmanual-en-dv-introduction.lvt new file mode 100644 index 000000000..59dae78b7 --- /dev/null +++ b/testfiles/pgfmanual-en-dv-introduction.lvt @@ -0,0 +1,29 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-dv-introduction-1} +\begin{tikzpicture}[scale=.7] + \datavisualization [school book axes, visualize as smooth line] + data [format=function] { + var x : interval [-2:2]; + func y = \value x*\value x + 1; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-introduction-2} +\begin{tikzpicture}[scale=.7] + \datavisualization [scientific axes, visualize as smooth line] + data [format=function] { + var x : interval [-2:2]; + func y = \value x*\value x + 1; + }; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-dv-main.lvt b/testfiles/pgfmanual-en-dv-main.lvt new file mode 100644 index 000000000..3dc6b9b42 --- /dev/null +++ b/testfiles/pgfmanual-en-dv-main.lvt @@ -0,0 +1,206 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} + +\begin{document} + +\tikz \datavisualization data group {points} = { + data { + x, y + 0, 1 + 1, 2 + 2, 2 + 5, 1 + 2, 0 + 1, 1 + } +}; + +\BEGINBOXTEST{pgfmanual-en-dv-main-1} +\begin{tikzpicture} + \datavisualization [school book axes, visualize as smooth line] + data { + x, y + -1.5, 2.25 + -1, 1 + -.5, .25 + 0, 0 + .5, .25 + 1, 1 + 1.5, 2.25 + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-main-2} +\begin{tikzpicture} + \datavisualization [school book axes, visualize as smooth line] + data [format=function] { + var x : interval [-1.5:1.5] samples 7; + func y = \value x*\value x; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-main-3} +\begin{tikzpicture} + \datavisualization [ + scientific axes, + x axis={length=3cm, ticks=few}, + visualize as smooth line + ] + data [format=function] { + var x : interval [-1.5:1.5] samples 7; + func y = \value x*\value x; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-main-4} +\begin{tikzpicture} + \datavisualization [ + scientific axes=clean, + x axis={length=3cm, ticks=few}, + all axes={grid}, + visualize as smooth line + ] + data [format=function] { + var x : interval [-1.5:1.5] samples 7; + func y = \value x*\value x; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-main-5} +\begin{tikzpicture} + \datavisualization [ + scientific axes=clean, + x axis={length=3cm, ticks=few}, + visualize as smooth line + ] + data [format=function] { + var x : interval [-1.5:1.5] samples 7; + func y = \value x*\value x; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-main-6} +\begin{tikzpicture} + \datavisualization [ + scientific axes=clean, + x axis={length=3cm, ticks=few}, + visualize as scatter + ] + data [format=function] { + var x : interval [-1.5:1.5] samples 7; + func y = \value x*\value x; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-main-7} +\begin{tikzpicture}[baseline] + \datavisualization [ scientific axes=clean, + y axis=grid, + visualize as smooth line/.list={sin,cos,tan}, + style sheet=strong colors, + style sheet=vary dashing, + sin={label in legend={text=$\sin x$}}, + cos={label in legend={text=$\cos x$}}, + tan={label in legend={text=$\tan x$}}, + data/format=function ] + data [set=sin] { + var x : interval [-0.5*pi:4]; + func y = sin(\value x r); + } + data [set=cos] { + var x : interval [-0.5*pi:4]; + func y = cos(\value x r); + } + data [set=tan] { + var x : interval [-0.3*pi:.3*pi]; + func y = tan(\value x r); + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-main-11} +\tikz + \datavisualization [school book axes, visualize as line] + data [/data point/x=1] { + y + 1 + 2 + } + data [/data point/x=2] { + y + 2 + 0.5 + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-main-12} +\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]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-main-13} +\tikzdatavisualizationset{ + horizontal/.style={ + data point={x=#1, y=1}, data point={x=#1, y=2}}, +} +\tikz \datavisualization +[ school book axes, visualize as line, + horizontal=1, + horizontal=2 ]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-main-15} +\tikz \datavisualization [school book axes, visualize as line] data group {points}; +\qquad +\tikz \datavisualization [scientific axes=clean, visualize as line] data group {points}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-main-17} +\begin{tikzpicture}[baseline] + \datavisualization [ school book axes, visualize as line ] + data [format=function] { + var x : interval [-0.1*pi:2]; + func y = sin(\value x r); + } + info { + \draw [red] (visualization cs: x={(.5*pi)}, y=1) circle [radius=1pt] + node [above,font=\footnotesize] {extremal point}; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-main-18} +\begin{tikzpicture}[baseline] + \datavisualization [ school book axes, visualize as line ] + data [format=function] { + var x : interval [-0.1*pi:2]; + func y = sin(\value x r); + } + info' { + \fill [red] (visualization cs: x={(.5*pi)}, y=1) circle [radius=2mm]; + }; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-dv-polar.lvt b/testfiles/pgfmanual-en-dv-polar.lvt new file mode 100644 index 000000000..9a61f0cef --- /dev/null +++ b/testfiles/pgfmanual-en-dv-polar.lvt @@ -0,0 +1,190 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{ + datavisualization.formats.functions, + datavisualization.polar, +} +\usetikzlibrary{ + datavisualization.formats.functions, + datavisualization.polar, +} +\usetikzlibrary{ + datavisualization.formats.functions, + datavisualization.polar, +} +\usetikzlibrary{ + datavisualization.formats.functions, + datavisualization.polar, +} +\usetikzlibrary{ + datavisualization.formats.functions, + datavisualization.polar, +} +\usetikzlibrary{ + datavisualization.formats.functions, + datavisualization.polar, +} +\usetikzlibrary{datavisualization.polar} +\usetikzlibrary{datavisualization.polar} +\usetikzlibrary{datavisualization.polar} +\usetikzlibrary{datavisualization.polar} +\usetikzlibrary{datavisualization.polar} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-dv-polar-1} +\tikz \datavisualization [ + scientific polar axes={0 to pi, clean}, + all axes=grid, + style sheet=vary hue, + legend=below + ] + [visualize as smooth line=sin, + sin={label in legend={text=$1+\sin \alpha$}}] + data [format=function] { + var angle : interval [0:pi]; + func radius = sin(\value{angle}r) + 1; + } + [visualize as smooth line=cos, + cos={label in legend={text=$1+\cos\alpha$}}] + data [format=function] { + var angle : interval [0:pi]; + func radius = cos(\value{angle}r) + 1; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-polar-2} +\tikz[baseline] \datavisualization [ + scientific axes={clean}, + x axis={attribute=angle, ticks={minor steps between steps=4}}, + y axis={attribute=radius, ticks={some, style=red!80!black}}, + all axes=grid, + visualize as smooth line=sin] + data [format=function] { + var t : interval [-3:3]; + func angle = exp(\value t); + func radius = \value{t}*\value{t}; + }; +\qquad +\tikz[baseline] \datavisualization [ + scientific polar axes={right half clockwise, clean}, + angle axis={logarithmic, + ticks={ + minor steps between steps=8, + major also at/.list={2,3,4,5,15,20}}}, + radius axis={ticks={some, style=red!80!black}}, + all axes=grid, + visualize as smooth line=sin] + data [format=function] { + var t : interval [-3:3]; + func angle = exp(\value t); + func radius = \value{t}*\value{t}; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-polar-4} +\tikz \datavisualization [ + scientific polar axes, + radius axis={ + attribute=distance, + ticks={step=5000}, + padding=1.5em, + length=3cm, + grid + }, + visualize as smooth line] +data [format=function] { + var angle : interval [0:100]; + func distance = \value{angle}*\value{angle}; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-polar-5} +\tikz \datavisualization [ + scientific polar axes={outer ticks, 0 to 180}, + visualize as smooth line] +data [format=function] { + var angle : interval [0:100]; + func radius = \value{angle}; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-polar-6} +\tikz \datavisualization [ + scientific polar axes={inner ticks, 0 to 180}, + visualize as smooth line] +data [format=function] { + var angle : interval [0:100]; + func radius = \value{angle}; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-polar-7} +\tikz \datavisualization [ + scientific polar axes={clean, 0 to 180}, + visualize as smooth line] +data [format=function] { + var angle : interval [0:100]; + func radius = \value{angle}; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-polar-8} +\tikz \datavisualization [ + scientific polar axes={ + clean, + 0 to 90 % the option + }, + angle axis={ticks={step=30}}, + radius axis={length=1cm, ticks={step=1}}, + visualize as scatter] +data point [angle=20, radius=0.5] +data point [angle=30, radius=1] +data point [angle=40, radius=1.5]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-polar-9} +\tikz \datavisualization + [new polar axes={angle axis}{radius axis}, + radius axis={length=2cm}, + visualize as scatter] + data [format=named] { + angle={0,20,...,160}, radius={0,...,5} + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-polar-10} +\tikz \datavisualization + [new polar axes={angle axis}{radius axis}, + radius axis={unit length=1cm}, + angle axis={unit vectors={(10:1pt)}{(60:1pt)}}, + visualize as scatter] + data [format=named] { + angle={0,90}, radius={0.25,0.5,...,2} + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-polar-11} +\tikz \datavisualization + [new polar axes={angle axis}{radius axis}, + radius axis={unit length=1cm}, + angle axis={degrees}, + visualize as scatter] + data [format=named] { + angle={10,90}, radius={0.25,0.5,...,2} + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-polar-12} +\tikz \datavisualization + [new polar axes={angle axis}{radius axis}, + radius axis={unit length=1cm}, + angle axis={radians}, + visualize as scatter] + data [format=named] { + angle={0,1.5}, radius={0.25,0.5,...,2} + }; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-dv-stylesheets.lvt b/testfiles/pgfmanual-en-dv-stylesheets.lvt new file mode 100644 index 000000000..541dfbc98 --- /dev/null +++ b/testfiles/pgfmanual-en-dv-stylesheets.lvt @@ -0,0 +1,2516 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-1} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-2} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + school book axes, all axes={unit length=7.5mm}, + visualize as smooth line/.list={log, lin, squared, exp}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-3} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + school book axes, all axes={unit length=7.5mm}, + visualize as smooth line/.list={log, lin, squared, exp}, + style sheet=vary dashing] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-4} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + school book axes, all axes={unit length=7.5mm}, + x axis={label=$x$}, + visualize as smooth line/.list={log, lin, squared, exp}, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=vary dashing] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-5} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + school book axes, + x axis={label=$x$}, + visualize as smooth line/.list={log, lin, squared, exp}, + every data set label/.append style={text colored}, + log= {pin in data={text'=$\log x$, when=y is -1}}, + lin= {pin in data={text=$x/2$, when=x is 2, + pin length=1ex}}, + squared={pin in data={text=$x^2$, when=x is 1.1, + pin angle=230}}, + exp= {label in data={text=$e^x$, when=x is -2}}, + style sheet=vary hue] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-6} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + school book axes, all axes={unit length=7.5mm}, + visualize as smooth line/.list={log, lin, squared, exp}, + style sheet=vary thickness and dashing, + style sheet=vary hue] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-10} +\pgfkeys{ + /pgf/data visualization/style sheets/traffic light/.cd, + % All these styles have the above prefix. + 1/.style={green!50!black}, + 2/.style={yellow!90!black}, + 3/.style={red!80!black}, + default style/.style={black} +} +\tikz \datavisualization [ + school book axes, + visualize as line=1, + visualize as line=2, + visualize as line=3, + style sheet=traffic light] +data point [x=0, y=0, set=1] +data point [x=2, y=2, set=1] +data point [x=0, y=1, set=2] +data point [x=2, y=1, set=2] +data point [x=0.5, y=1.5, set=3] +data point [x=2.25, y=1.75, set=3]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-11} +\pgfkeys{ + /pgf/data visualization/style sheets/traffic light/.cd, + % All these styles have the above prefix. + 1/.style={green!50!black}, + 2/.style={yellow!90!black}, + 3/.style={red!80!black}, + default style/.style={black} +} +\begin{tikzpicture} + \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] + data point [x=2, y=1, set=heated] + data point [x=0.5, y=1.5, set=critical] + data point [x=2.25, y=1.75, set=critical] + }; + \datavisualization [ + school book axes, + visualize as line=normal, + visualize as line=heated, + visualize as line=critical, + /data point/set/normal/.initial=1, + /data point/set/heated/.initial=2, + /data point/set/critical/.initial=3, + style sheet=traffic light] + data group {lines}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-12} +\pgfkeys{ + /pgf/data visualization/style sheets/traffic light/.cd, + % All these styles have the above prefix. + 1/.style={green!50!black}, + 2/.style={yellow!90!black}, + 3/.style={red!80!black}, + default style/.style={black} +}% +\tikz \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] + data point [x=2, y=1, set=heated] + data point [x=0.5, y=1.5, set=critical] + data point [x=2.25, y=1.75, set=critical] +}; +\tikz \datavisualization [ + school book axes, + visualize as line=normal, + visualize as line=heated, + visualize as line=critical, + /data point/set/critical/.initial=1, % same styling as first set + style sheet=traffic light] +data group {lines}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-14} +\tikz \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] + data point [x=2, y=1, set=heated] + data point [x=0.5, y=1.5, set=critical] + data point [x=2.25, y=1.75, set=critical] +}; +\pgfdvdeclarestylesheet{my dashings}{ + default style/.style={dash pattern={on #1pt off 1pt}} +} +\tikz \datavisualization [ + school book axes, + visualize as line=normal, + visualize as line=heated, + visualize as line=critical, + style sheet=my dashings] +data group {lines}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-15} +\tikz \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] + data point [x=2, y=1, set=heated] + data point [x=0.5, y=1.5, set=critical] + data point [x=2.25, y=1.75, set=critical] +}; +\pgfdvdeclarestylesheet{my colors} +{ + default style/.style={visualizer color=black}, + 1/.style={visualizer color=black}, + 2/.style={visualizer color=red!80!black}, + 3/.style={visualizer color=blue!80!black}, +} +\tikz \datavisualization [ + school book axes, + visualize as line=normal, + visualize as line=heated, + visualize as line=critical, + style sheet=my colors] +data group {lines}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-16} +\tikz \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] + data point [x=2, y=1, set=heated] + data point [x=0.5, y=1.5, set=critical] + data point [x=2.25, y=1.75, set=critical] +}; +\tikzdvdeclarestylesheetcolorseries{greens}{hsb}{0.3,1.3,0.8}{0,-.4,-.1} +\tikz \datavisualization [ + school book axes, + visualize as line=normal, + visualize as line=heated, + visualize as line=critical, + style sheet=greens] +data group {lines}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-19} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + example visualization/.style={ + scientific axes=clean, + y axis={ticks={style={ + /pgf/number format/fixed, + /pgf/number format/fixed zerofill, + /pgf/number format/precision=2}}}, + x axis={ticks={tick suffix=${}^\circ$}}, + 1={label in legend={text=$\frac{1}{6}\sin 11x$}}, + 2={label in legend={text=$\frac{1}{7}\sin 12x$}}, + 3={label in legend={text=$\frac{1}{8}\sin 13x$}}, + 4={label in legend={text=$\frac{1}{9}\sin 14x$}}, + 5={label in legend={text=$\frac{1}{10}\sin 15x$}}, + 6={label in legend={text=$\frac{1}{11}\sin 16x$}}, + 7={label in legend={text=$\frac{1}{12}\sin 17x$}}, + 8={label in legend={text=$\frac{1}{13}\sin 18x$}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list= + {1,2,3,4,5,6,7,8}, + example visualization, + style sheet=vary thickness] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-20} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + example visualization/.style={ + scientific axes=clean, + y axis={ticks={style={ + /pgf/number format/fixed, + /pgf/number format/fixed zerofill, + /pgf/number format/precision=2}}}, + x axis={ticks={tick suffix=${}^\circ$}}, + 1={label in legend={text=$\frac{1}{6}\sin 11x$}}, + 2={label in legend={text=$\frac{1}{7}\sin 12x$}}, + 3={label in legend={text=$\frac{1}{8}\sin 13x$}}, + 4={label in legend={text=$\frac{1}{9}\sin 14x$}}, + 5={label in legend={text=$\frac{1}{10}\sin 15x$}}, + 6={label in legend={text=$\frac{1}{11}\sin 16x$}}, + 7={label in legend={text=$\frac{1}{12}\sin 17x$}}, + 8={label in legend={text=$\frac{1}{13}\sin 18x$}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list= + {1,2,3,4,5,6,7,8}, + example visualization, + style sheet=vary dashing] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-21} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + example visualization/.style={ + scientific axes=clean, + y axis={ticks={style={ + /pgf/number format/fixed, + /pgf/number format/fixed zerofill, + /pgf/number format/precision=2}}}, + x axis={ticks={tick suffix=${}^\circ$}}, + 1={label in legend={text=$\frac{1}{6}\sin 11x$}}, + 2={label in legend={text=$\frac{1}{7}\sin 12x$}}, + 3={label in legend={text=$\frac{1}{8}\sin 13x$}}, + 4={label in legend={text=$\frac{1}{9}\sin 14x$}}, + 5={label in legend={text=$\frac{1}{10}\sin 15x$}}, + 6={label in legend={text=$\frac{1}{11}\sin 16x$}}, + 7={label in legend={text=$\frac{1}{12}\sin 17x$}}, + 8={label in legend={text=$\frac{1}{13}\sin 18x$}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list= + {1,2,3,4,5,6,7,8}, + example visualization, + style sheet=vary thickness + and dashing] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-22} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + example visualization/.style={ + scientific axes=clean, + y axis={ticks={style={ + /pgf/number format/fixed, + /pgf/number format/fixed zerofill, + /pgf/number format/precision=2}}}, + x axis={ticks={tick suffix=${}^\circ$}}, + 1={label in legend={text=$\frac{1}{6}\sin 11x$}}, + 2={label in legend={text=$\frac{1}{7}\sin 12x$}}, + 3={label in legend={text=$\frac{1}{8}\sin 13x$}}, + 4={label in legend={text=$\frac{1}{9}\sin 14x$}}, + 5={label in legend={text=$\frac{1}{10}\sin 15x$}}, + 6={label in legend={text=$\frac{1}{11}\sin 16x$}}, + 7={label in legend={text=$\frac{1}{12}\sin 17x$}}, + 8={label in legend={text=$\frac{1}{13}\sin 18x$}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list= + {1,2,3,4,5,6,7,8}, + example visualization, + style sheet=vary thickness, + style sheet=vary dashing] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-23} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + example visualization/.style={ + scientific axes=clean, + y axis={ticks={style={ + /pgf/number format/fixed, + /pgf/number format/fixed zerofill, + /pgf/number format/precision=2}}}, + x axis={ticks={tick suffix=${}^\circ$}}, + 1={label in legend={text=$\frac{1}{6}\sin 11x$}}, + 2={label in legend={text=$\frac{1}{7}\sin 12x$}}, + 3={label in legend={text=$\frac{1}{8}\sin 13x$}}, + 4={label in legend={text=$\frac{1}{9}\sin 14x$}}, + 5={label in legend={text=$\frac{1}{10}\sin 15x$}}, + 6={label in legend={text=$\frac{1}{11}\sin 16x$}}, + 7={label in legend={text=$\frac{1}{12}\sin 17x$}}, + 8={label in legend={text=$\frac{1}{13}\sin 18x$}} + } +} +\tikz \datavisualization [ + visualize as scatter/.list= + {1,2,3,4,5,6,7,8}, + example visualization, + style sheet=cross marks] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-24} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + example visualization/.style={ + scientific axes=clean, + y axis={ticks={style={ + /pgf/number format/fixed, + /pgf/number format/fixed zerofill, + /pgf/number format/precision=2}}}, + x axis={ticks={tick suffix=${}^\circ$}}, + 1={label in legend={text=$\frac{1}{6}\sin 11x$}}, + 2={label in legend={text=$\frac{1}{7}\sin 12x$}}, + 3={label in legend={text=$\frac{1}{8}\sin 13x$}}, + 4={label in legend={text=$\frac{1}{9}\sin 14x$}}, + 5={label in legend={text=$\frac{1}{10}\sin 15x$}}, + 6={label in legend={text=$\frac{1}{11}\sin 16x$}}, + 7={label in legend={text=$\frac{1}{12}\sin 17x$}}, + 8={label in legend={text=$\frac{1}{13}\sin 18x$}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list= + {1,2,3,4,5,6,7,8}, + example visualization, + style sheet=cross marks] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-25} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + example visualization/.style={ + scientific axes=clean, + y axis={ticks={style={ + /pgf/number format/fixed, + /pgf/number format/fixed zerofill, + /pgf/number format/precision=2}}}, + x axis={ticks={tick suffix=${}^\circ$}}, + 1={label in legend={text=$\frac{1}{6}\sin 11x$}}, + 2={label in legend={text=$\frac{1}{7}\sin 12x$}}, + 3={label in legend={text=$\frac{1}{8}\sin 13x$}}, + 4={label in legend={text=$\frac{1}{9}\sin 14x$}}, + 5={label in legend={text=$\frac{1}{10}\sin 15x$}}, + 6={label in legend={text=$\frac{1}{11}\sin 16x$}}, + 7={label in legend={text=$\frac{1}{12}\sin 17x$}}, + 8={label in legend={text=$\frac{1}{13}\sin 18x$}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list= + {1,2,3,4,5,6,7,8}, + example visualization, + style sheet=strong colors] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-26} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + example visualization/.style={ + scientific axes=clean, + y axis={ticks={style={ + /pgf/number format/fixed, + /pgf/number format/fixed zerofill, + /pgf/number format/precision=2}}}, + x axis={ticks={tick suffix=${}^\circ$}}, + 1={label in legend={text=$\frac{1}{6}\sin 11x$}}, + 2={label in legend={text=$\frac{1}{7}\sin 12x$}}, + 3={label in legend={text=$\frac{1}{8}\sin 13x$}}, + 4={label in legend={text=$\frac{1}{9}\sin 14x$}}, + 5={label in legend={text=$\frac{1}{10}\sin 15x$}}, + 6={label in legend={text=$\frac{1}{11}\sin 16x$}}, + 7={label in legend={text=$\frac{1}{12}\sin 17x$}}, + 8={label in legend={text=$\frac{1}{13}\sin 18x$}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list= + {1,2,3,4,5,6,7,8}, + example visualization, + style sheet=strong colors, + style sheet=vary dashing] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-27} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + example visualization/.style={ + scientific axes=clean, + y axis={ticks={style={ + /pgf/number format/fixed, + /pgf/number format/fixed zerofill, + /pgf/number format/precision=2}}}, + x axis={ticks={tick suffix=${}^\circ$}}, + 1={label in legend={text=$\frac{1}{6}\sin 11x$}}, + 2={label in legend={text=$\frac{1}{7}\sin 12x$}}, + 3={label in legend={text=$\frac{1}{8}\sin 13x$}}, + 4={label in legend={text=$\frac{1}{9}\sin 14x$}}, + 5={label in legend={text=$\frac{1}{10}\sin 15x$}}, + 6={label in legend={text=$\frac{1}{11}\sin 16x$}}, + 7={label in legend={text=$\frac{1}{12}\sin 17x$}}, + 8={label in legend={text=$\frac{1}{13}\sin 18x$}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list= + {1,2,3,4,5,6,7,8}, + example visualization, + style sheet=vary hue] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-28} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + example visualization/.style={ + scientific axes=clean, + y axis={ticks={style={ + /pgf/number format/fixed, + /pgf/number format/fixed zerofill, + /pgf/number format/precision=2}}}, + x axis={ticks={tick suffix=${}^\circ$}}, + 1={label in legend={text=$\frac{1}{6}\sin 11x$}}, + 2={label in legend={text=$\frac{1}{7}\sin 12x$}}, + 3={label in legend={text=$\frac{1}{8}\sin 13x$}}, + 4={label in legend={text=$\frac{1}{9}\sin 14x$}}, + 5={label in legend={text=$\frac{1}{10}\sin 15x$}}, + 6={label in legend={text=$\frac{1}{11}\sin 16x$}}, + 7={label in legend={text=$\frac{1}{12}\sin 17x$}}, + 8={label in legend={text=$\frac{1}{13}\sin 18x$}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list= + {1,2,3,4,5,6,7,8}, + example visualization, + style sheet=shades of blue] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-29} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + example visualization/.style={ + scientific axes=clean, + y axis={ticks={style={ + /pgf/number format/fixed, + /pgf/number format/fixed zerofill, + /pgf/number format/precision=2}}}, + x axis={ticks={tick suffix=${}^\circ$}}, + 1={label in legend={text=$\frac{1}{6}\sin 11x$}}, + 2={label in legend={text=$\frac{1}{7}\sin 12x$}}, + 3={label in legend={text=$\frac{1}{8}\sin 13x$}}, + 4={label in legend={text=$\frac{1}{9}\sin 14x$}}, + 5={label in legend={text=$\frac{1}{10}\sin 15x$}}, + 6={label in legend={text=$\frac{1}{11}\sin 16x$}}, + 7={label in legend={text=$\frac{1}{12}\sin 17x$}}, + 8={label in legend={text=$\frac{1}{13}\sin 18x$}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list= + {1,2,3,4,5,6,7,8}, + example visualization, + style sheet=shades of red] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-30} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + example visualization/.style={ + scientific axes=clean, + y axis={ticks={style={ + /pgf/number format/fixed, + /pgf/number format/fixed zerofill, + /pgf/number format/precision=2}}}, + x axis={ticks={tick suffix=${}^\circ$}}, + 1={label in legend={text=$\frac{1}{6}\sin 11x$}}, + 2={label in legend={text=$\frac{1}{7}\sin 12x$}}, + 3={label in legend={text=$\frac{1}{8}\sin 13x$}}, + 4={label in legend={text=$\frac{1}{9}\sin 14x$}}, + 5={label in legend={text=$\frac{1}{10}\sin 15x$}}, + 6={label in legend={text=$\frac{1}{11}\sin 16x$}}, + 7={label in legend={text=$\frac{1}{12}\sin 17x$}}, + 8={label in legend={text=$\frac{1}{13}\sin 18x$}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list= + {1,2,3,4,5,6,7,8}, + example visualization, + style sheet=gray scale] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-32} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + school book axes, + x axis={label=$x$}, + visualize as smooth line/.list={log, lin, squared, exp}, + log= {label in data={text'=$\log x$, when=y is -1, + text colored}}, + lin= {label in data={text=$x/2$, when=x is 2}}, + squared={label in data={text=$x^2$, when=x is 1.1}}, + exp= {label in data={text=$e^x$, when=x is -2, + text colored}}, + style sheet=vary hue] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-33} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + school book axes, + x axis={label=$x$}, + visualize as smooth line/.list={exp}, + exp= {label in data={text=$5$, index=5}, + label in data={text=$10$, index=10}, + label in data={text=$20$, index=20}, + style={mark=x}}, + style sheet=vary hue] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-34} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + school book axes, + x axis={label=$x$}, + visualize as smooth line=exp, + exp= {label in data={text=$.2$, pos=0.2}, + label in data={text=$.5$, pos=0.5}, + label in data={text=$.95$, pos=0.95}, + style={mark=x}}, + style sheet=vary hue] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-35} +\tikz \datavisualization [ + scientific axes=clean, + visualize as smooth line/.list={linear, squared, cubed}, + linear ={label in data={text=$2x$}}, + squared={label in data={text=$x^2$}}, + cubed ={label in data={text=$x^3$}}] +data [set=linear, format=function] { + var x : interval [0:1.5]; + func y = 2*\value x; +} +data [set=squared, format=function] { + var x : interval [0:1.5]; + func y = \value x * \value x; +} +data [set=cubed, format=function] { + var x : interval [0:1.5]; + func y = \value x * \value x * \value x; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-36} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + school book axes, + x axis={label=$x$}, + visualize as smooth line/.list={log, lin, squared, exp}, + every data set label/.append style={text colored}, + log= {label in data={text'=$\log x$, when=y is -1}}, + lin= {label in data={text=$x/2$, + node style=sloped, when=x is 2}}, + squared={label in data={text=$x^2$, when=x is 1.1}}, + exp= {label in data={text=$e^x$, + node style=sloped, when=x is -2}}, + style sheet=vary hue] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-37} +\tikz \datavisualization [ + scientific axes=clean, + visualize as smooth line/.list={linear, squared, cubed}, + linear ={pin in data={text=$2x$}}, + squared={pin in data={text=$x^2$}}, + cubed ={pin in data={text=$x^3$}}] +data [set=linear, format=function] { + var x : interval [0:1.5]; + func y = \value x; +} +data [set=squared, format=function] { + var x : interval [0:1.5]; + func y = \value x * \value x; +} +data [set=cubed, format=function] { + var x : interval [0:1.5]; + func y = \value x * \value x * \value x; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-38} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + school book axes, + x axis={label=$x$}, + visualize as smooth line/.list={log, lin, squared, exp}, + every data set label/.append style={text colored}, + log= {pin in data={text'=$\log x$, when=y is -1}}, + lin= {pin in data={text=$x/2$, when=x is 2, + pin length=1ex}}, + squared={pin in data={text=$x^2$, when=x is 1.1, + pin angle=230}}, + exp= {label in data={text=$e^x$, when=x is -2}}, + style sheet=vary hue] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-40} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend={matrix node style={fill=black!25}}, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=vary dashing] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-41} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, x axis={label=$x$}, + visualize as smooth line/.list={log, lin, squared, exp}, + new legend={upper legend}, + new legend={lower legend}, + upper legend=above, + lower legend=below, + log= {label in legend={text=$\log x$, legend=upper legend}}, + lin= {label in legend={text=$x/2$, legend=upper legend}}, + squared={label in legend={text=$x^2$, legend=lower legend}}, + exp= {label in legend={text=$e^x$, legend=lower legend}}, + style sheet=vary dashing] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-42} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, x axis={label=$x$}, + visualize as smooth line/.list={log, lin, squared, exp}, + legend=below, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=vary dashing] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-44} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, x axis={label=$x$}, + visualize as smooth line/.list= + {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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-45} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list={1,2,3,4,5,6,7,8}, + legend example, style sheet=vary hue, + main legend={down then right, columns=3}] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-47} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list={1,2,3,4,5,6,7,8}, + legend example, style sheet=vary hue, + main legend={down then left, columns=3}] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-48} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list={1,2,3,4,5,6,7,8}, + legend example, style sheet=vary hue, + main legend={up then right, columns=3}] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-49} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list={1,2,3,4,5,6,7,8}, + legend example, style sheet=vary hue, + main legend={up then left, columns=3}] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-50} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list={1,2,3,4,5,6,7,8}, + legend example, style sheet=vary hue, + main legend={left then up, columns=3}] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-51} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\tikz \datavisualization [ + visualize as smooth line/.list={1,2,3,4,5,6,7,8}, + legend example, style sheet=vary hue, + main legend={left then down, columns=3}] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-52} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\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 up, columns=3}] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-53} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\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, columns=3}] +data group {sin functions}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-54} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-55} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-56} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-57} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-58} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-59} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-60} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-61} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-62} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-63} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-64} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-65} +\tikz \datavisualization data group {sin functions} = { + data [format=function] { + var set : {1,...,8}; + var x : interval [0:50]; + func y = sin(\value x * (\value{set}+10))/(\value{set}+5); + } +};% +\tikzdatavisualizationset { + legend example/.style={ + scientific axes, all axes={length=1cm, ticks=none}, + 1={label in legend={text=1}}, + 2={label in legend={text=2}}, + 3={label in legend={text=3}}, + 4={label in legend={text=4}}, + 5={label in legend={text=5}}, + 6={label in legend={text=6}}, + 7={label in legend={text=7}}, + 8={label in legend={text=8}} + } +} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-66} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, x axis={label=$x$}, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend={anchor=north west, at= + (data visualization bounding box.north east)}, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=vary dashing] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-67} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend=east outside, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-68} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend=north east outside, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-69} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend=south east outside, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-70} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend=west outside, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-71} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend=north west outside, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-72} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend=south west outside, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-73} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend=north outside, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-74} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend=south outside, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-75} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + visualize as smooth line/.list= + {log, lin}, + legend=south east inside, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-76} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + 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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-77} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + 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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-78} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + 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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-79} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + every label in legend/.style={node style= + {fill=red!30}}, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend=north east outside, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$, + node style={circle, draw=red}}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-80} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend={label style={node style=draw}}, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$, + node style={circle, draw=red}}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-81} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend=north east outside, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$, + node style={circle, draw=red}}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-82} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend={label style=text colored}, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-83} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend={label style=text left}, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-84} +\tikz \datavisualization data group {function classes} = { + data [set=log, format=function] { + var x : interval [0.2:2.5]; + func y = ln(\value x); + } + data [set=lin, format=function] { + var x : interval [-2:2.5]; + func y = 0.5*\value x; + } + data [set=squared, format=function] { + var x : interval [-1.5:1.5]; + func y = \value x*\value x; + } + data [set=exp, format=function] { + var x : interval [-2.5:1]; + func y = exp(\value x); + } +}; +\tikz \datavisualization [ + scientific axes, + visualize as smooth line/.list= + {log, lin, squared, exp}, + legend={south east inside, rows=2, + label style=text only}, + log= {label in legend={text=$\log x$}}, + lin= {label in legend={text=$x/2$}}, + squared={label in legend={text=$x^2$}}, + exp= {label in legend={text=$e^x$}}, + style sheet=strong colors] +data group {function classes}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-86} +\tikz \datavisualization [ + school book axes, visualize as line/.list={a,b}, + style sheet=vary dashing, + a={label in legend={text=a}}, + new legend entry={ + text=spacer, + visualizer in legend={\draw[solid] (0,0) circle[radius=2pt];} + }, + b={label in legend={text=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]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-87} +\tikz \datavisualization [ + school book axes, visualize as line/.list={a,b}, + style sheet=vary dashing, + a={label in legend={text=a}}, b={label in legend={text=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]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-88} +\tikz \datavisualization [ + school book axes, visualize as line/.list={a,b}, + legend entry options/default label in legend path/.style= + straight label in legend line, + style sheet=vary dashing, + a={label in legend={text=a}}, b={label in legend={text=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]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-89} +\tikz \datavisualization [ + 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, + a={label in legend={text=example a}}, + b={label in legend={text=example b}}, + c={label in legend={text=example c}}]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-90} +\tikz \datavisualization [ + school book axes, visualize as line/.list={a,b}, + style sheet=vary dashing, + a={label in legend={text=a, + label in legend line coordinates={(-1em,0), (0,0)}}}, + b={label in legend={text=b, + label in legend line coordinates={(-2em,0), (0,0)}}}] +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]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-91} +\tikz \datavisualization [ + school book axes, visualize as line/.list={a,b}, + legend={up then right}, style sheet=vary dashing, + a={label in legend={text=a, + label in legend line coordinates={(-2em,-.25ex), (0,0)}}}, + b={label in legend={text=b, + label in legend line coordinates={(-2em,.25ex), (0,0)}}}] +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]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-92} +\tikz \datavisualization [ + school book axes, visualize as line/.list={a,b}, + legend={up then right}, style sheet=vary dashing, + a={label in legend={text=a, + label in legend line coordinates={ + (-2em,-.2ex), (-1em,.2ex), (0,-.2ex)}}}, + b={label in legend={text=b, + label in legend line coordinates={ + (-2em,-.2ex), (-1em,.2ex), (0,-.2ex)}}}] +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]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-93} +\tikz \datavisualization [ + school book axes, visualize as line/.list={a,b}, + legend={up then right}, + style sheet=vary dashing, + style sheet=cross marks, + a={label in legend={text=a, + label in legend line coordinates={ + (-2em,-.2ex), (-1em,.2ex), (0,-.2ex)}, + label in legend mark coordinates={ + (-1em,.2ex)}}}, + b={label in legend={text=b, + label in legend line coordinates={ + (-2em,-.2ex), (-1em,.2ex), (0,-.2ex)}, + label in legend mark coordinates={ + (-2em,-.2ex), (0,-.2ex)}}}] +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]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-94} +\tikz \datavisualization [visualize as line, + line={style={mark=x}, label in legend={text=example, + straight label in legend line}}]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-95} +\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}}]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-96} +\tikz \datavisualization [ + visualize as line=a, + 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}}]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-97} +\tikz \datavisualization [ + visualize as line/.list={a,b}, + 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}}]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-98} +\tikz \datavisualization [ + scientific axes={clean}, all axes={length=3cm}, + visualize as line/.list={a,b,c}, + a={polygon}, b={smooth cycle}, + style sheet=cross marks, + a={label in legend={text=polygon}}, + b={label in legend={text=circle}}, + c={label in legend={text=line}}] +data [format=function, set=a] { + var t : {0,72,...,359}; + func x = cos(\value t); + func y = sin(\value t); +} +data [format=function, set=b] { + var t : [0:2*pi]; + func x = .8*cos(\value t r); + func y = .8*sin(\value t r); +} +data point [x=-1, y=0.5, set=c] +data point [x=1, y=0.25, set=c]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-99} +\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={style={mark=*, mark size=0.5pt}, + label in legend={text=polygon}}, + b={label in legend={text=circle}}, + c={style={mark=*, mark size=0.5pt, mark options=red}, + label in legend={text=line}}] +data [format=function, set=a] { + var t : {0,72,...,359}; + func x = cos(\value t); + func y = sin(\value t); +} +data [format=function, set=b] { + var t : [0:352]; + func x = .8*cos(\value t); + func y = .8*sin(\value t); +} +data point [x=-1, y=0.5, set=c] +data point [x=1, y=0.25, set=c]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-100} +\tikz \datavisualization [visualize as scatter/.list={a,b,c}, + style sheet=cross marks, + a={label in legend={text=example a}}, + b={label in legend={text=example b}}, + c={label in legend={text=example c}}]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-stylesheets-101} +\tikz \datavisualization [visualize as scatter/.list={a,b,c}, + style sheet=cross marks, + a={label in legend={text=example a, label in legend three marks}}, + b={label in legend={text=example b, label in legend three marks}}, + c={label in legend={text=example c, label in legend three marks}}]; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-dv-visualizers.lvt b/testfiles/pgfmanual-en-dv-visualizers.lvt new file mode 100644 index 000000000..d4c438c30 --- /dev/null +++ b/testfiles/pgfmanual-en-dv-visualizers.lvt @@ -0,0 +1,322 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization.formats.functions} +\usetikzlibrary{datavisualization} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-1} +\tikz \datavisualization data group {example} = { +data { + x, y + 0, 0 + 0.5, 2 + 1, 2 + 1.5, 1.5 + 2, 0.5 +}}; +\tikz \datavisualization [school book axes, visualize as line] data group {example}; +\qquad +\tikz \datavisualization [school book axes, visualize as smooth line] data group {example}; +\qquad +\tikz \datavisualization [school book axes, visualize as scatter] data group {example}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-3} +\tikz \datavisualization + [scientific axes=clean, + visualize as line=sin, + visualize as line=cos, + visualize as scatter=tan] +data { + x, y, set + 0, 0, sin + 1, 1, sin + 2, 0, sin + 3, -1, sin + 4, 0, sin + 0, 1, cos + 1, 0, cos + 0, 0, tan + 1, 1, tan + 2, 2, tan + 3, 4, tan + 2, -1, cos + 3, 0, cos + 4, 1, cos +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-4} +\tikz \datavisualization + [scientific axes=clean, + visualize as line=sin, + visualize as line=cos] +data [set=sin] { + x, y + 0, 0 + 1, 1 + 2, 0 + 3, -1 + 4, 0 +} +data [set=cos] { + x, y + 0, 1 + 1, 0 + 2, -1 + 3, 0 + 4, 1 +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-5} +\tikz \datavisualization + [scientific axes=clean, + visualize as line/.list={sin, cos, tan}] +data [set=sin, format=function] { + var x : interval[0:3*pi]; + func y = sin(\value x r); +} +data [set=cos, format=function] { + var x : interval[0:3*pi]; + func y = cos(\value x r); +} +data [set=tan, format=function] { + var x : interval[0:pi/2.2]; + func y = tan(\value x r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-7} +\tikz \datavisualization + [scientific axes=clean, + visualize as smooth line/.list={sin, cos}, + sin={style=red}, + cos={style=blue}] +data [set=sin, format=function] { + var x : interval[0:3*pi]; + func y = sin(\value x r); +} +data [set=cos, format=function] { + var x : interval[0:3*pi]; + func y = cos(\value x r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-8} +\tikz \datavisualization + [scientific axes=clean, + visualize as smooth line=sin, + sin={style={red, densely dotted}}, + visualize as smooth line=cos, + cos={style={mark=x}}, +] +data [set=sin, format=function] { + var x : interval[0:3*pi]; + func y = sin(\value x r); +} +data [set=cos, format=function] { + var x : interval[0:3*pi]; + func y = cos(\value x r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-9} +\tikz \datavisualization + [scientific axes={clean, end labels}, + x axis={label=$x$}, y axis={grid={major also at=0}}, + visualize as smooth line/.list={sin,cos,sin 2,cos 2}, + legend={below, rows=2}, + sin={label in legend={text=$\sin x$}}, + cos={label in legend={text=$\cos x$}}, + sin 2={label in legend={text=$\sin 2x$}}, + cos 2={label in legend={text=$\cos 2x$}}, + style sheet=strong colors] +data [set=sin, format=function] { + var x : interval[0:3*pi]; + func y = sin(\value x r); +} +data [set=cos, format=function] { + var x : interval[0:3*pi]; + func y = cos(\value x r); +} +data [set=sin 2, format=function] { + var x : interval[0:3*pi]; + func y = sin(2*\value x r); +} +data [set=cos 2, format=function] { + var x : interval[0:3*pi]; + func y = cos(2*\value x r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-10} +\tikz \datavisualization + [scientific axes=clean, + every visualizer/.style={dashed}, + visualize as smooth line] +data [format=function] { + var x : interval[0:3*pi]; + func y = sin(\value x r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-11} +\tikz \datavisualization + [scientific axes=clean, + visualize as line=my data, + my data={style={mark=x, mark repeat=3}}] +data [format=function] { + var x : interval [0:pi] samples 10; + func y = sin(\value x r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-12} +\tikz \datavisualization + [scientific axes=clean, x axis={grid={major at=(pi/2)}}, + visualize as smooth line] +data [format=function] { + var x : interval[0:pi/2-0.1]; + func y = tan(\value x r); +} +data point [outlier] +data [format=function] { + var x : interval[pi/2+0.1:pi]; + func y = tan(\value x r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-13} +\tikz [scale=.55] \datavisualization + [scientific axes=clean, all axes={ticks=few}, + visualize as smooth line=my data, my data={straight line}] +data [format=function] { + var t : interval [0:4] samples 5; + func x = cos(\value t r); + func y = sin(\value t r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-14} +\tikz [scale=.55] \datavisualization + [scientific axes=clean, all axes={ticks=few}, + visualize as smooth line=my data, my data={straight cycle}] +data [format=function] { + var t : interval [0:4] samples 5; + func x = cos(\value t r); + func y = sin(\value t r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-15} +\tikz [scale=.55] \datavisualization + [scientific axes=clean, all axes={ticks=few}, + visualize as smooth line=my data, my data={smooth line}] +data [format=function] { + var t : interval [0:4] samples 5; + func x = cos(\value t r); + func y = sin(\value t r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-16} +\tikz [scale=.55] \datavisualization + [scientific axes=clean, all axes={ticks=few}, + visualize as smooth line=my data, my data={smooth cycle}] +data [format=function] { + var t : interval [0:4] samples 5; + func x = cos(\value t r); + func y = sin(\value t r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-17} +\tikz [scale=.55] \datavisualization + [scientific axes=clean, all axes={ticks=few}, + visualize as smooth line=my data, my data={gap line}] +data [format=function] { + var t : interval [0:4] samples 5; + func x = cos(\value t r); + func y = sin(\value t r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-18} +\tikz [scale=.55] \datavisualization + [scientific axes=clean, all axes={ticks=few}, + visualize as smooth line=my data, my data={gap cycle}] +data [format=function] { + var t : interval [0:4] samples 5; + func x = cos(\value t r); + func y = sin(\value t r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-19} +\tikz [scale=.55] \datavisualization + [scientific axes=clean, all axes={ticks=few}, + visualize as smooth line=my data, my data={no lines, style={mark=x}}] +data [format=function] { + var t : interval [0:4] samples 5; + func x = cos(\value t r); + func y = sin(\value t r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-20} +\tikz \datavisualization + [scientific axes=clean, + visualize as scatter] +data [format=function] { + var x : interval [0:pi] samples 10; + func y = sin(\value x r); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-dv-visualizers-24} +\tikz \datavisualization [ + scientific axes=clean, + visualize as circle/.list={a, b, c}, + style sheet=strong colors] +data [set=a] { + x, y, radius + 0, 0, 2pt + 1, 1, 3pt + 1, 2, 3pt + 2, 0, 1pt +} +data [set=b] { + x, y, radius + 0.5, 0.5, 5pt + 1, 1.5, 2pt + 1, 2.5, 3pt + 0, 2, 4pt +} +data [set=c] { + x, y, radius + 3, 2, 3pt + 2.5, 0.5, 4pt +}; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-gd-algorithm-layer.lvt b/testfiles/pgfmanual-en-gd-algorithm-layer.lvt new file mode 100644 index 000000000..8a1ec0141 --- /dev/null +++ b/testfiles/pgfmanual-en-gd-algorithm-layer.lvt @@ -0,0 +1,18 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-gd-algorithm-layer-2} +\tikz [very simple demo layout] + \graph { f -> c -> e -> a -> {b -> {c, d, f}, e -> b}}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-algorithm-layer-3} +\tikz [very simple demo layout, componentwise] + \graph { + 1 -> 2 ->[orient=right] 3 -> 1; + a -- b --[orient=45] c -- d -- a; + }; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-gd-overview.lvt b/testfiles/pgfmanual-en-gd-overview.lvt new file mode 100644 index 000000000..6b6947dcb --- /dev/null +++ b/testfiles/pgfmanual-en-gd-overview.lvt @@ -0,0 +1,87 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{trees} +\usetikzlibrary{graphs,graphdrawing,quotes} +\usegdlibrary{force} +\usetikzlibrary{arrows.meta,graphs,graphdrawing} +\usegdlibrary{layered} +\usetikzlibrary{graphdrawing} +\usegdlibrary{trees} +\usetikzlibrary{decorations.pathmorphing,graphdrawing} +\usegdlibrary{force} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-gd-overview-1} +\tikz \graph [binary tree layout, level distance=5mm] { + 4 -- { + 3 -- 0 -- 1[second], + 10 -- { + 8 -- { + 6 -- {5,7}, + 9 + } } } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-overview-2} +\tikz \graph [spring layout, + edge quotes mid, + edges={nodes={font=\scriptsize, fill=white, sloped, inner sep=1pt}}] +{ + 1 ->["Das"] 2 ->["ist"] 3 ->["das"] 4 ->["Haus"] + 2 ->["vom" near start] 5 ->["Ni"] 4 ->["ko" near start] + 1 ->["laus", orient=right] 5; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-overview-3} +\tikz [>={Stealth[round,sep]}] + \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; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-overview-4} +\tikz [grow'=up, binary tree layout, nodes={circle,draw}] + \node {1} + child { node {2} + child { node {3} } + child { node {4} + child { node {5} } + child { node {6} } + } + } + child { node {7} + child { node {8} + child[missing] + child { node {9} } + } + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-overview-5} +\tikz [spring electrical layout, node distance=1.3cm, + every edge/.style={ + decoration={coil, aspect=-.5, post length=1mm, + segment length=1mm, pre length=2mm}, + decorate, draw}] +{ + \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) + (node 3) edge (node 4) + edge (node 5) + edge (node 6); +} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-gd-usage-pgf.lvt b/testfiles/pgfmanual-en-gd-usage-pgf.lvt new file mode 100644 index 000000000..8fcfdc421 --- /dev/null +++ b/testfiles/pgfmanual-en-gd-usage-pgf.lvt @@ -0,0 +1,60 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{trees} +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{trees} +\usetikzlibrary{graphdrawing} +\usegdlibrary{trees} +\usetikzlibrary{graphdrawing} +\usegdlibrary{trees} +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{trees} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-gd-usage-pgf-1} +\tikz[tree layout] + \graph {root [as=Hello] -> World[fill=blue!20]}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-pgf-4} +\tikz [tree layout] \graph {1 -> {b,c}}; +\tikz \graph [tree layout] {2 -> {b,c}}; +\tikz \path graph [tree layout] {3 -> {b,c}}; + +\begin{tikzpicture}[tree layout] + \graph {4 -> {b,c}}; +\end{tikzpicture} + +\begin{tikzpicture} + \scoped [tree layout] \graph {5 -> {b,c}}; + + \begin{scope}[tree layout, xshift=1.5cm] + \graph {6 -> {b,c}}; + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-pgf-5} +\begin{tikzpicture} + \scoped [tree layout] + \node {root} + child { node {left child} } + child { node {right child} }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-pgf-6} +\tikz [tree layout] + \node {root} + child { node {left child} } + child { node {right child} }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-pgf-7} +\tikz \graph [tree layout] { root -- {left child, right child} }; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-gd-usage-tikz.lvt b/testfiles/pgfmanual-en-gd-usage-tikz.lvt new file mode 100644 index 000000000..37051af11 --- /dev/null +++ b/testfiles/pgfmanual-en-gd-usage-tikz.lvt @@ -0,0 +1,187 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{layered} +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{force} +\usetikzlibrary{graphdrawing} +\usegdlibrary{force,trees} +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{force,trees} +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{circular,trees} +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{circular,trees} +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{circular,trees} +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{trees} +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{trees} +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{trees} +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{trees} +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{trees} +\usetikzlibrary{graphs,graphdrawing,quotes} +\usegdlibrary{trees} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-gd-usage-tikz-3} +\tikz [rounded corners] + \graph [layered layout, sibling distance=8mm, level distance=8mm] + { + a -> { + b, + c -> { d, e } + } -> + f -> + a + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-tikz-4} +\tikz \graph [spring layout, vertical=1 to 2] { 1--2--3--1 }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-tikz-5} +\tikz [spring 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] + \node (1) {1}; + \node (2) {2}; + \draw (1) edge (2); + \end{scope} + + \draw (a) edge (1); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-tikz-6} +\tikz \graph [spring layout] { + // [tree layout] { a -- {b, c} }; + // [tree layout] { 1 -- 2 }; + a -- 1; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-tikz-7} +\tikz \graph [simple necklace layout] { + // [simple necklace layout] { a -> b -> c -> d -> e -> f -> a }; + + // [tree layout] { % first tentacle + a -> {1, 2}; + }; + + // [tree layout] {% second tentacle + d -> {3, 4 -> {5, 6}} + }; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-tikz-8} +\tikz \graph [simple necklace layout] { + // [tree layout] { % first ``giant node'' + a -> {1, 2}; + }; + + a -> b -> c -> d; + + // [tree layout] {% second ``giant node'' + d -> {3, 4 -> {5, 6}} + }, + + d -> e -> f -> a; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-tikz-9} +\tikz \graph [simple necklace layout] { + tree 1[draw, circle] // [tree layout] { a -> {1, 2}; } + -> b + -> c + -> tree 2[draw] // [tree layout] { d -> {3, 4 -> {5, 6} } } + -> e + -> f + -> tree 1; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-tikz-10} +\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; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-tikz-11} +\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; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-tikz-12} +\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; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-tikz-13} +\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; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-tikz-14} +\tikz [subgraph text top=text centered] + \graph [tree layout] { + a -> { b -> {c, d}, e -> {f, g -> h} }; + + left [draw, circle] // { b, c, d }; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-gd-usage-tikz-15} +\tikz \graph [tree layout] { + a -> { b -> {c, d}, e -> {f, g -> h} }; + + / ["left", draw] // { b, c, d } <-> + / ["right", draw] // { e, f, g, h}; + }; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-3d.lvt b/testfiles/pgfmanual-en-library-3d.lvt new file mode 100644 index 000000000..d8dc1bb33 --- /dev/null +++ b/testfiles/pgfmanual-en-library-3d.lvt @@ -0,0 +1,90 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{3d} +\usetikzlibrary{3d} +\usetikzlibrary{3d} +\usetikzlibrary{3d} +\usetikzlibrary{3d} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-3d-1} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-3d-2} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-3d-3} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-3d-4} +\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) + 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} + { + \begin{scope}[xshift=\shift cm,thin] + \draw (.5,0) -- (0.5,0 |- 45:1cm); + \draw (1,0) -- (1,1); + \draw (1.5,0) -- (1.5,0 |- 45:1cm); + \draw (2.5,0) -- (2.5,0 |- -45:1cm); + \draw (3,0) -- (3,-1); + \draw (3.5,0) -- (3.5,0 |- -45:1cm); + \end{scope} + } + } + \begin{scope}[canvas is zy plane at x=0,fill=blue] + \wave + \node at (6,-1.5) [transform shape] {magnetic field}; + \end{scope} + \begin{scope}[canvas is zx plane at y=0,fill=red] + \draw[help lines] (0,-2) grid (12,2); + \wave + \node at (6,1.5) [rotate=180,xscale=-1,transform shape] {electric field}; + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-3d-5} +\begin{tikzpicture} + \begin{scope}[canvas is zy plane at x=0] + \draw (0,0) circle (1cm); + \draw (-1,0) -- (1,0) (0,-1) -- (0,1); + \end{scope} + + \begin{scope}[canvas is zx plane at y=0] + \draw (0,0) circle (1cm); + \draw (-1,0) -- (1,0) (0,-1) -- (0,1); + \end{scope} + + \begin{scope}[canvas is xy plane at z=0] + \draw (0,0) circle (1cm); + \draw (-1,0) -- (1,0) (0,-1) -- (0,1); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-angles.lvt b/testfiles/pgfmanual-en-library-angles.lvt new file mode 100644 index 000000000..d23a0e95d --- /dev/null +++ b/testfiles/pgfmanual-en-library-angles.lvt @@ -0,0 +1,60 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{angles} +\usetikzlibrary{angles} +\usetikzlibrary{angles,quotes} +\usetikzlibrary{angles,quotes} +\usetikzlibrary{angles,quotes} +\usetikzlibrary{angles} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-angles-1} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-angles-2} +\tikz \draw [line width=2mm] + (2,0) coordinate (A) -- (0,0) coordinate (B) + -- (1,1) coordinate (C) + pic [draw=blue, fill=blue!50, angle radius=1cm] {angle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-angles-3} +\tikz \draw (2,0) coordinate (A) -- (0,0) coordinate (B) + -- (1,1) coordinate (C) + pic ["$\alpha$", draw, ->] {angle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-angles-4} +\tikz \draw (2,0) coordinate (A) -- (0,0) coordinate (B) + -- (1,1) coordinate (C) + pic ["$\alpha$", draw, angle eccentricity=1] {angle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-angles-5} +\tikz { + \draw (2,0) coordinate (A) -- (0,0) coordinate (B) + -- (1,1) coordinate (C) + pic (alpha) ["$\alpha$", draw] {angle}; + + \draw (alpha) circle [radius=5pt]; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-angles-6} +\tikz + \draw (0,0,0) coordinate (O) + (1,0,0) coordinate (A) -- (O) + (0,0,1) coordinate (B) -- (O) + (0,1,0) coordinate (C) -- (O) + pic [fill=gray,angle radius=4mm] {right angle = A--O--B} + pic [draw,red,thick,angle eccentricity=.5,pic text=.] + {right angle = A--O--C}; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-automata.lvt b/testfiles/pgfmanual-en-library-automata.lvt new file mode 100644 index 000000000..d9eb4a68c --- /dev/null +++ b/testfiles/pgfmanual-en-library-automata.lvt @@ -0,0 +1,134 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{automata,positioning} +\usetikzlibrary{automata} +\usetikzlibrary{automata} +\usetikzlibrary{arrows.meta,automata,positioning} +\usetikzlibrary{automata} +\usetikzlibrary{arrows.meta,automata,positioning} +\usetikzlibrary{arrows.meta,automata,positioning,shadows} +\usetikzlibrary{arrows.meta,automata,positioning} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-automata-1} +\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto] + \draw[help lines] (0,0) grid (3,2); + + \node[state,initial] (q_0) {$q_0$}; + \node[state] (q_1) [above right=of q_0] {$q_1$}; + \node[state] (q_2) [below right=of q_0] {$q_2$}; + \node[state,accepting](q_3) [below right=of q_1] {$q_3$}; + + \path[->] (q_0) edge node {0} (q_1) + edge node [swap] {1} (q_2) + (q_1) edge node {1} (q_3) + edge [loop above] node {0} () + (q_2) edge node [swap] {0} (q_3) + edge [loop below] node {1} (); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-automata-2} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \node[state without output] {$q_0$}; + + \node[state with output] at (2,0) {$q_1$ \nodepart{lower} $00$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-automata-3} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-automata-4} +\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,>={Stealth[round]}, + every state/.style={draw=blue!50,very thick,fill=blue!20}] + + \node[state,initial] (q_0) {$q_0$}; + \node[state] (q_1) [above right=of q_0] {$q_1$}; + \node[state] (q_2) [below right=of q_0] {$q_2$}; + + \path[->] (q_0) edge node [above left] {0} (q_1) + edge node [below left] {1} (q_2) + (q_1) edge [loop above] node {0} () + (q_2) edge [loop below] node {1} (); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-automata-5} +\begin{tikzpicture}[every initial by arrow/.style={text=red,->>}] + \node[state,initial,initial distance=2cm] {$q_0$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-automata-6} +\begin{tikzpicture} + [shorten >=1pt,node distance=2cm,on grid,>={Stealth[round]},initial text=, + every state/.style={draw=blue!50,very thick,fill=blue!20}, + accepting/.style=accepting by arrow] + + \node[state,initial] (q_0) {$q_0$}; + \node[state] (q_1) [above right=of q_0] {$q_1$}; + \node[state] (q_2) [below right=of q_0] {$q_2$}; + \node[state,accepting](q_3) [below right=of q_1] {$q_3$}; + + \path[->] (q_0) edge node [above left] {0} (q_1) + edge node [below left] {1} (q_2) + (q_1) edge node [above right] {1} (q_3) + edge [loop above] node {0} () + (q_2) edge node [below right] {0} (q_3) + edge [loop below] node {1} (); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-automata-7} +\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,>={Stealth[round]},thick, + every state/.style={fill,draw=none,orange,text=white,circular drop shadow}, + accepting/.style ={green!50!black,text=white}, + initial/.style ={red,text=white}] + + \node[state,initial] (q_0) {$q_0$}; + \node[state] (q_1) [above right=of q_0] {$q_1$}; + \node[state] (q_2) [below right=of q_0] {$q_2$}; + \node[state,accepting](q_3) [below right=of q_1] {$q_3$}; + + \path[->] (q_0) edge node [above left] {0} (q_1) + edge node [below left] {1} (q_2) + (q_1) edge node [above right] {1} (q_3) + edge [loop above] node {0} () + (q_2) edge node [below right] {0} (q_3) + edge [loop below] node {1} (); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-automata-8} +\begin{tikzpicture}[->,>={Stealth[round]},shorten >=1pt,% + auto,node distance=2cm,on grid,semithick, + inner sep=2pt,bend angle=45] + \node[initial,state] (A) {$q_a$}; + \node[state] (B) [above right=of A] {$q_b$}; + \node[state] (D) [below right=of A] {$q_d$}; + \node[state] (C) [below right=of B] {$q_c$}; + \node[state] (E) [below=of D] {$q_e$}; + + \path [every node/.style={font=\footnotesize}] + (A) edge node {0,1,L} (B) + edge node {1,1,R} (C) + (B) edge [loop above] node {1,1,L} (B) + edge node {0,1,L} (C) + (C) edge node {0,1,L} (D) + edge [bend left] node {1,0,R} (E) + (D) edge [loop below] node {1,1,R} (D) + edge node {0,1,R} (A) + (E) edge [bend left] node {1,0,R} (A); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-babel.lvt b/testfiles/pgfmanual-en-library-babel.lvt new file mode 100644 index 000000000..7b27fe23c --- /dev/null +++ b/testfiles/pgfmanual-en-library-babel.lvt @@ -0,0 +1,22 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-babel-1} +\catcode`\.=\active +\def.{\o} + +\tikz [handle active characters in code] + \node [draw, minimum width=3.0cm] {hall. pe.ple}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-babel-2} +\catcode`\.=\active +\def.{\o} + +\tikz [handle active characters in code, + handle active characters in nodes] + \node [draw, label=f..] {hall. pe.ple}; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-backgrounds.lvt b/testfiles/pgfmanual-en-library-backgrounds.lvt new file mode 100644 index 000000000..1a6853181 --- /dev/null +++ b/testfiles/pgfmanual-en-library-backgrounds.lvt @@ -0,0 +1,134 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{backgrounds} +\usetikzlibrary{backgrounds} +\usetikzlibrary{backgrounds} +\usetikzlibrary{backgrounds} +\usetikzlibrary{backgrounds} +\usetikzlibrary{backgrounds} +\usetikzlibrary{backgrounds} +\usetikzlibrary{backgrounds} +\usetikzlibrary{backgrounds} +\usetikzlibrary{backgrounds} +\usetikzlibrary{backgrounds} +\usetikzlibrary{backgrounds} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-backgrounds-1} +\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} + + % On main layer again: + \fill[blue!50] (-.5,-1) rectangle (.5,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-backgrounds-2} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-backgrounds-3} +\begin{tikzpicture}[show background rectangle] + \draw (0,0) ellipse (10mm and 5mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-backgrounds-4} +\begin{tikzpicture} + [background rectangle/.style= + {double,ultra thick,draw=red,top color=blue,rounded corners}, + show background rectangle] + \draw (0,0) ellipse (10mm and 5mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-backgrounds-5} +\begin{tikzpicture} + [background rectangle/.style= + {draw=blue!50,fill=blue!20,rounded corners=1ex}, + show background rectangle] + \draw (0,0) ellipse (10mm and 5mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-backgrounds-6} +\begin{tikzpicture}[show background grid] + \draw (0,0) ellipse (10mm and 5mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-backgrounds-7} +\begin{tikzpicture} + [background grid/.style={thick,draw=red,step=.5cm}, + show background grid] + \draw (0,0) ellipse (10mm and 5mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-backgrounds-8} +\tikzset{background grid/.style={thick,draw=red,step=.5cm}, + background rectangle/.style={rounded corners,fill=yellow}} +\begin{tikzpicture}[framed,gridded] + \draw (0,0) ellipse (10mm and 5mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-backgrounds-9} +\begin{tikzpicture}[ + background rectangle/.style={fill=yellow}, + framed,show background top] + \draw (0,0) ellipse (10mm and 5mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-backgrounds-10} +\begin{tikzpicture} + [background rectangle/.style={fill=yellow}, + framed, + show background top, + outer frame xsep=1ex] + \draw (0,0) ellipse (10mm and 5mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-backgrounds-11} +\begin{tikzpicture} + [background rectangle={fill=blue!20}, + outer frame sep=1ex,% + show background top,% + show background bottom,% + show background left,% + show background right] + \draw (0,0) ellipse (10mm and 5mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-backgrounds-12} +\tikzset{background rectangle/.style={fill=blue!20}, + background top/.style={draw=blue!50,line width=1ex}} +\begin{tikzpicture}[framed,show background top] + \draw (0,0) ellipse (10mm and 5mm); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-calendar.lvt b/testfiles/pgfmanual-en-library-calendar.lvt new file mode 100644 index 000000000..ab9452cb6 --- /dev/null +++ b/testfiles/pgfmanual-en-library-calendar.lvt @@ -0,0 +1,389 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar,shapes.misc} +\usetikzlibrary{calendar,shapes.misc} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-calendar-1} +\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-2} +\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day xshift=3ex]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-3} +\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day yshift=2ex]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-4} +\tikz \calendar[dates=2000-01-01 to 2000-02-last,week list, + month yshift=0pt]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-5} +\tikz \calendar[dates=2000-01-01 to 2000-02-last,week list, + month yshift=1cm]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-6} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \matrix [anchor=cal-2000-01-20.center] at (2,2) + { \calendar(cal)[dates=2000-01-01 to 2000-01-31,week list]; \\}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-7} +\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list, + day code={\fill[blue] (0,0) circle (2pt);}]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-9} +\begin{tikzpicture} + \calendar (mycal) [dates=2000-01-01 to 2000-01-31,week list]; + + \draw[red] (mycal-2000-01-20) circle (4pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-10} +\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list, + day text=x]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-11} +\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list, + day text=\%d0]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-12} +\tikz[every day/.style=red] + \calendar[dates=2000-01-01 to 2000-01-31,week list]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-13} +\tikz \calendar[dates=2000-01-01 to 2000-02-last,week list, + month label above centered]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-15} +\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list, + month label above centered, + month text=\textcolor{red}{\%mt} \%y-]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-16} +\tikz + \calendar + [dates=2000-01-01 to 2000-01-31,week list] + if (Sunday) [red]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-17} +\tikz + \calendar + [dates=2000-01-01 to 2000-01-31,week list] + if (Sunday) [red] + if (equals=2000-01-20) {\draw (0,0) circle (8pt);}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-18} +\tikz [every day/.style={anchor=mid}] + \calendar + [dates=2000-01-01 to 2000-01-31,week list] + if (Sunday) [red] + if (equals=2000-01-20) {\draw (0,0) circle (8pt);}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-19} +\tikz + \calendar [dates=2000-01-01 to 2000-01-08, + execute after day scope= + {\pgftransformyshift{-1em}}]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-20} +\tikz + \calendar + [dates=2000-01-01 to 2000-01-08, + execute after day scope={\pgftransformyshift{-1em}}, + execute at begin day scope= + {\ifdate{day of month=1}{\tikzmonthcode}{}}, + every month/.append style={anchor=base east,xshift=-2em}]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-21} +\tikz + \calendar + [dates=2000-01-01 to 2000-01-20, + % each day is shifted right according to the day of week + execute at begin day scope= + {\pgftransformxshift{\pgfcalendarcurrentweekday em}}, + % after each week, the origin is shifted downward: + execute after day scope= + {\ifdate{Sunday}{\pgftransformyshift{-1em}}{}}]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-22} +\newcount\mycount +\tikz + \calendar + [dates=2000-01-01 to 2000-02-last, + execute before day scope= + { + \ifdate{day of month=1} { + % Remember the weekday of first day of month + \mycount=\pgfcalendarcurrentweekday + % Shift downward + \pgftransformyshift{-1em} + }{} + }, + execute at begin day scope= + { + % each day is shifted right according to the day of month + \pgftransformxshift{\pgfcalendarcurrentday em} + % and additionally according to the weekday of the first + \pgftransformxshift{\the\mycount em} + }]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-23} +\tikz + \calendar [dates=2000-01-28 to 2000-02-03, + day list downward,month yshift=1em]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-24} +\tikz + \calendar [dates=2000-01-28 to 2000-02-03, + day list upward,month yshift=1em]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-25} +\tikz + \calendar [dates=2000-01-28 to 2000-02-03, + day list right,month xshift=1em]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-26} +\tikz + \calendar [dates=2000-01-01 to 2000-02-last,week list]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-27} +\tikz + \calendar [dates=2000-01-01 to 2000-02-last,week list, + month yshift=0pt]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-28} +\sffamily\scriptsize +\tikz + \calendar [dates=2000-01-01 to 2000-12-31, + month list,month label left,month yshift=1.25em] + if (Sunday) [black!50]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-29} +\tikz + \calendar [dates=2000-01-28 to 2000-02-03, + day list downward,month yshift=1em, + month label left]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-30} +\tikz + \calendar [dates=2000-01-28 to 2000-02-03, + day list downward,month yshift=1em, + month label left vertical]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-31} +\tikz + \calendar [dates=2000-01-28 to 2000-02-03, + day list downward,month yshift=1em, + month label right]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-32} +\tikz + \calendar [dates=2000-01-28 to 2000-02-03, + day list downward,month yshift=1em, + month label right vertical]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-33} +\tikz + \calendar [dates=2000-01-28 to 2000-02-03, + day list right,month xshift=1em, + month label above left]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-34} +\tikz + \calendar [dates=2000-01-20 to 2000-02-10, + week list,month label above left]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-35} +\tikz + \calendar [dates=2000-02-01 to 2000-02-last, + day list right,month label above centered]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-36} +\tikz + \calendar [dates=2000-01-20 to 2000-02-10, + week list,month label above centered]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-37} +\tikz + \calendar [dates=2000-01-20 to 2000-02-10, + week list,month label above right]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-38} +\tikz + \calendar [dates=2000-02-01 to 2000-02-last, + day list right,month label below left]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-39} +\tikz + \calendar [dates=2000-02-01 to 2000-02-last, + day list right,month label below centered]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-40} +\begin{tikzpicture} + \calendar + [ + dates=2099-12-01 to 2100-01-last, + week list,inner sep=2pt,month label above centered, + month text=\%mt \%y0 + ] + if (at most=2099-12-29) [nodes={strike out,draw}] + if (weekend) [black!50,nodes={draw=none}] + ; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-41} +\begin{tikzpicture} + \calendar + [ + dates=\year-\month-\day+-25 to \year-\month-\day+25, + week list,inner sep=2pt,month label above centered, + month text=\textit{\%mt \%y0} + ] + if (at least=\year-\month-\day) {} + else [nodes={strike out,draw}] + if (at most=\year-\month-\day+7) + [green!50!black] + if (between=\year-\month-\day+8 and \year-\month-\day+10) + [red] + if (Sunday) + [gray,nodes={draw=none}] + ; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-42} +\sffamily + +\colorlet{winter}{blue} +\colorlet{spring}{green!60!black} +\colorlet{summer}{orange} +\colorlet{fall}{red} + +\newcount\mycount + +\begin{tikzpicture} + [transform shape, + every day/.style={anchor=mid,font=\fontsize{6}{6}\selectfont}] + \node{\normalsize\the\year}; + \foreach \month/\monthcolor in + {1/winter,2/winter,3/spring,4/spring,5/spring,6/summer, + 7/summer,8/summer,9/fall,10/fall,11/fall,12/winter} + { + % Compute angle: + \mycount=\month + \advance\mycount by -1 + \multiply\mycount by 30 + \advance\mycount by -90 + + % The actual calendar + \calendar at (\the\mycount:6.4cm) + [ + dates=\the\year-\month-01 to \the\year-\month-last, + ] + if (day of month=1) {\color{\monthcolor}\tikzmonthcode} + if (Sunday) [red] + if (all) + { + % Again, compute angle + \mycount=1 + \advance\mycount by -\pgfcalendarcurrentday + \multiply\mycount by 11 + \advance\mycount by 90 + \pgftransformshift{\pgfpointpolar{\mycount}{1.4cm}} + }; + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-calendar-43} +\begin{tikzpicture} + \small\sffamily + \colorlet{darkgreen}{green!50!black} + \calendar[dates=\year-01-01 to \year-12-31,week list, + month label left,month yshift=0pt, + month text=\textcolor{darkgreen}{\%m0}] + if (Sunday) [black!50]; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-chains.lvt b/testfiles/pgfmanual-en-library-chains.lvt new file mode 100644 index 000000000..7782043a0 --- /dev/null +++ b/testfiles/pgfmanual-en-library-chains.lvt @@ -0,0 +1,226 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{chains} +\usetikzlibrary{chains,scopes} +\usetikzlibrary{chains} +\usetikzlibrary{chains} +\usetikzlibrary{chains,scopes} +\usetikzlibrary{chains} +\usetikzlibrary{chains} +\usetikzlibrary{chains} +\usetikzlibrary{chains} +\usetikzlibrary{chains} +\usetikzlibrary{chains,matrix,scopes,shapes.geometric} +\usetikzlibrary{chains} +\usetikzlibrary{chains,scopes} +\usetikzlibrary{chains,scopes} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-chains-1} +\begin{tikzpicture}[start chain] + % The chain is called just "chain" + \node [on chain] {A}; + \node [on chain] {B}; + \node [on chain] {C}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-chains-2} +\begin{tikzpicture} + % Same as above, using the scope shorthand + { [start chain] + \node [on chain] {A}; + \node [on chain] {B}; + \node [on chain] {C}; + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-chains-3} +\begin{tikzpicture}[start chain=1 going right, + start chain=2 going below, + node distance=5mm, + every node/.style=draw] + \node [on chain=1] {A}; + \node [on chain=1] {B}; + \node [on chain=1] {C}; + + \node [on chain=2] at (0.5,-.5) {0}; + \node [on chain=2] {1}; + \node [on chain=2] {2}; + + \node [on chain=1] {D}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-chains-4} +\begin{tikzpicture}[start chain=going right,node distance=5mm] + \node [draw,on chain] {Hello}; + \node [draw,on chain] {World}; + \node [draw,continue chain=going below,on chain] {,}; + \node [draw,on chain] {this}; + \node [draw,on chain] {is}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-chains-5} +\begin{tikzpicture}[node distance=5mm, + every node/.style=draw] + { [start chain=1] + \node [on chain] {A}; + \node [on chain] {B}; + \node [on chain] {C}; + } + + { [start chain=2 going below] + \node [on chain=2] at (0.5,-.5) {0}; + \node [on chain=2] {1}; + \node [on chain=2] {2}; + } + + { [continue chain=1] + \node [on chain] {D}; + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-chains-6} +\begin{tikzpicture}[start chain=circle placed {at=(\tikzchaincount*30:1.5)}] + \foreach \i in {1,...,10} + \node [on chain] {\i}; + + \draw (circle-1) -- (circle-10); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-chains-7} +\begin{tikzpicture}[start chain,node distance=5mm] + \node [draw,on chain] {}; + \node [draw,on chain] {Hallo}; + \node [draw,on chain] {Welt}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-chains-8} +\begin{tikzpicture}[start chain,node distance=5mm] + \node [draw,on chain] {Hello}; + \node [draw,on chain] {World}; + \node [draw,on chain=going below] {,}; + \node [draw,on chain] {this}; + \node [draw,on chain] {is}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-chains-9} +\begin{tikzpicture}[start chain=going {at=(\tikzchainprevious),shift=(30:1)}] + \draw [help lines] (0,0) grid (3,2); + \node [draw,on chain] {1}; + \node [draw,on chain] {Hello}; + \node [draw,on chain] {World}; + \node [draw,on chain] {.}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-chains-10} +\begin{tikzpicture}[node distance=5mm, + every node/.style=draw,every join/.style=->] + \draw [help lines] (0,0) grid (3,2); + + \node[red] (existing) at (0,2) {existing}; + + \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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-chains-11} +\begin{tikzpicture}[every node/.style=draw] + \matrix [matrix of nodes,column sep=5mm,row sep=5mm] + { + |(a)| World & |(b) [circle]| peace \\ + |(c)| be & |(d) [isosceles triangle]| would \\ + |(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); + \chainin (d); + \chainin (c); + \chainin (e); + \chainin (f); + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-chains-12} +\begin{tikzpicture}[start chain,node distance=5mm, + every join/.style={->,red}] + \node [draw,on chain,join] {}; + \node [draw,on chain,join] {Hallo}; + \node [draw,on chain,join] {Welt}; + \node [draw,on chain=going below, + join,join=with chain-1 by {blue,<-}] {foo}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-chains-13} +\begin{tikzpicture}[every on chain/.style=join,every join/.style=->, + node distance=2mm and 1cm] + { [start chain=trunk] + \node [on chain] {A}; + \node [on chain] {B}; + + { [start branch=numbers going below] + \node [on chain] {1}; + \node [on chain] {2}; + \node [on chain] {3}; + } + { [start branch=greek going above] + \node [on chain] {$\alpha$}; + \node [on chain] {$\beta$}; + \node [on chain] {$\gamma$}; + } + + \node [on chain,join=with trunk/numbers-end,join=with trunk/greek-end] {C}; + { [start branch=symbols going below] + \node [on chain] {$\star$}; + \node [on chain] {$\circ$}; + \node [on chain] {$\int$}; + } + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-chains-14} +\begin{tikzpicture}[every on chain/.style=join,every join/.style=->, + node distance=2mm and 1cm] + { [start chain=trunk] + \node [on chain] {A}; + \node [on chain] {B}; + { [start branch=numbers going below] } % just a declaration, + { [start branch=greek going above] } % we will come back later + \node [on chain] {C}; + + % Now come the branches... + { [continue branch=numbers] + \node [on chain] {1}; + \node [on chain] {2}; + } + { [continue branch=greek] + \node [on chain] {$\alpha$}; + \node [on chain] {$\beta$}; + } + } +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-circuits.lvt b/testfiles/pgfmanual-en-library-circuits.lvt new file mode 100644 index 000000000..e8240b199 --- /dev/null +++ b/testfiles/pgfmanual-en-library-circuits.lvt @@ -0,0 +1,732 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.logic.US} +\usetikzlibrary{circuits.logic.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits} +\usetikzlibrary{circuits} +\usetikzlibrary{circuits} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.logic.IEC} +\usetikzlibrary{circuits.logic.CDH} +\usetikzlibrary{circuits.logic.IEC} +\usetikzlibrary{circuits.logic.US} +\usetikzlibrary{circuits.logic.IEC} +\usetikzlibrary{circuits.logic.IEC} +\usetikzlibrary{circuits.logic.US} +\usetikzlibrary{circuits.logic.CDH} +\usetikzlibrary{circuits.logic.IEC} +\usetikzlibrary{circuits.logic.US} +\usetikzlibrary{circuits.logic.US} +\usetikzlibrary{shapes.gates.logic.IEC} +\usetikzlibrary{circuits.logic.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} +\usetikzlibrary{circuits.ee.IEC} + +\begin{document} + +\tikzset{ + % from `shape` library + shape example/.style= {color = black!30, + draw, + fill = yellow!30, + line width = .5cm, + inner xsep = 2.5cm, + inner ysep = 0.5cm} +} + +\BEGINBOXTEST{pgfmanual-en-library-circuits-2} +\begin{tikzpicture}[circuit ee IEC,x=3cm,y=2cm,semithick, + every info/.style={font=\footnotesize}, + small circuit symbols, + set resistor graphic=var resistor IEC graphic, + set diode graphic=var diode IEC graphic, + set make contact graphic= var make contact IEC graphic] + % Let us start with some contacts: + \foreach \contact/\y in {1/1,2/2,3/3.5,4/4.5,5/5.5} + { + \node [contact] (left contact \contact) at (0,\y) {}; + \node [contact] (right contact \contact) at (1,\y) {}; + } + \draw (right contact 1) -- (right contact 2) -- (right contact 3) + -- (right contact 4) -- (right contact 5); + + \draw (left contact 1) to [diode] ++(down:1) + to [voltage source={near start, + direction info={volt=3}}, + resistor={near end,ohm=3}] ++(right:1) + to (right contact 1); + \draw (left contact 1) to [resistor={ohm=4}] (right contact 1); + \draw (left contact 1) to [resistor={ohm=3}] (left contact 2); + \draw (left contact 2) to [voltage source={near start, + direction info={<-,volt=8}}, + resistor={ohm=2,near end}] (right contact 2); + \draw (left contact 2) to [resistor={near start,ohm=1}, + make contact={near end,info'={[red]$S_1$}}] + (left contact 3); + \draw (left contact 3) to [current direction'={near start,info=$\iota$}, + resistor={near end,info={$R=4\Omega$}}] + (right contact 3); + \draw (left contact 4) to [voltage source={near start, + direction info={<-,volt=8}}, + resistor={ohm=2,near end}] (right contact 4); + \draw (left contact 3) to [resistor={ohm=1}] (left contact 4); + \draw (left contact 4) to [resistor={ohm=3}] (left contact 5); + \draw (left contact 5) to [resistor={ohm=4}] (right contact 5); + \draw (left contact 5) to [diode] ++(up:1) + to [voltage source={near start, + direction info={volt=3}}, + resistor={near end,ohm=3}] ++(right:1) + to (right contact 5); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-4} +\begin{tikzpicture}[circuit logic US] + \matrix[column sep=7mm] + { + \node (i0) {0}; & & \\ + & \node [and gate] (a1) {}; & \\ + \node (i1) {0}; & & \node [or gate] (o) {};\\ + & \node [nand gate] (a2) {}; & \\ + \node (i2) {1}; & & \\ + }; + \draw (i0.east) -- ++(right:3mm) |- (a1.input 1); + \draw (i1.east) -- ++(right:3mm) |- (a1.input 2); + \draw (i1.east) -- ++(right:3mm) |- (a2.input 1); + \draw (i2.east) -- ++(right:3mm) |- (a2.input 2); + \draw (a1.output) -- ++(right:3mm) |- (o.input 1); + \draw (a2.output) -- ++(right:3mm) |- (o.input 2); + \draw (o.output) -- ++(right:3mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-5} +\begin{tikzpicture}[circuit logic IEC] + \matrix[column sep=7mm] + { + \node (i0) {0}; & & \\ + & \node [and gate] (a1) {}; & \\ + \node (i1) {0}; & & \node [or gate] (o) {};\\ + & \node [nand gate] (a2) {}; & \\ + \node (i2) {1}; & & \\ + }; + \draw (i0.east) -- ++(right:3mm) |- (a1.input 1); + \draw (i1.east) -- ++(right:3mm) |- (a1.input 2); + \draw (i1.east) -- ++(right:3mm) |- (a2.input 1); + \draw (i2.east) -- ++(right:3mm) |- (a2.input 2); + \draw (a1.output) -- ++(right:3mm) |- (o.input 1); + \draw (a2.output) -- ++(right:3mm) |- (o.input 2); + \draw (o.output) -- ++(right:3mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-6} +\tikz [circuit ee IEC] + \draw (0,0) to [diode={light emitting}] (3,0) + to [resistor={adjustable}] (3,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-7} +\begin{tikzpicture}[circuit ee IEC] + \draw (0,1) to [resistor] (3.5,1); + \draw[circuit symbol unit=14pt] + (0,0) to [resistor] (3.5,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-8} +\begin{tikzpicture}[circuit ee IEC] + \draw (0,1) to [resistor] (2,1) to[inductor] (4,1); + + \begin{scope} + [every resistor/.style={circuit symbol size=width 3 height 1}] + \draw (0,0) to [resistor] (2,0) to[inductor] (4,0); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-11} +\begin{tikzpicture} + [circuit declare symbol=foo, + set foo graphic={draw,shape=rectangle,minimum size=5mm}] + + \node [foo] at (1,1) {}; + \node [foo={red}] at (2,1) {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-12} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-13} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-14} +\tikz [circuit ee IEC] + \draw (3,0) to[inductor] (1,0) to[inductor] (0,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-15} +\tikz [circuit ee IEC] \node [diode,point up] {}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-16} +\tikz [circuit ee IEC] \node [diode,point down] {}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-17} +\tikz [circuit ee IEC] \node [diode,point left] {}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-18} +\tikz [circuit ee IEC] \node [diode,point right] {}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-19} +\begin{tikzpicture}[circuit ee IEC,every info/.style=red] + \node [resistor,info=$3\Omega$] {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-20} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-21} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-22} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-23} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-24} +\begin{tikzpicture}[circuit ee IEC,circuit declare unit={my ohm}{O}] + \draw (0,0) to[resistor={my ohm' sloped=3}] (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-26} +\tikzset{circuit declare annotation= + {circular annotation} + {8pt} + {(0pt,8pt) arc (-270:80:3.5pt)} +} +\tikz[circuit ee IEC] + \draw (0,0) to [resistor={circular annotation}] (3,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-27} +\tikzset{circuit declare annotation={circular annotation}{9pt} + {(0pt,8pt) edge[to path={arc(-270:80:3.5pt)}] ()} +} +\tikz[circuit ee IEC] + \draw (0,0) to [resistor={circular annotation}] (3,0) + to [capacitor={circular annotation'}] (3,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-28} +\tikzset{circuit declare annotation= + {circular annotation} + {8pt} + {(0pt,8pt) arc (-270:80:3.5pt)} +} +\tikz[circuit ee IEC] + \draw (0,0) to [resistor={circular annotation,ohm=5}] (2,0) + to [resistor={circular annotation={ohm=5}}] (4,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-29} +\begin{tikzpicture} + [circuit ee IEC, + every circuit symbol/.style={ultra thick}, + every resistor/.style={red}] + + \draw (0,0) to [inductor] ++(right:3) to [resistor] ++(up:2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-30} +\tikz [circuit ee IEC, + circuit symbol open/.style={thick,draw,fill=yellow}] + \draw (0,0) to [inductor] ++(right:3) to [resistor] ++(up:2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-31} +\tikz [circuit ee IEC, + circuit symbol lines/.style={thick,draw=red}] + \draw (0,0) to [capacitor] ++(right:3) to [resistor] ++(up:2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-32} +\tikz [circuit ee IEC,circuit symbol lines/.style={draw,very thick}] + \draw (0,0) to [capacitor={near start}, + make contact={near end}] (3,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-33} +\tikz [circuit ee IEC,circuit symbol wires/.style={draw,very thick}] + \draw (0,0) to [capacitor={near start}, + make contact={near end}] (3,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-36} +\begin{tikzpicture}[circuit ee IEC] + % Standard resistor + \draw (0,2) to [resistor] (3,2); + + % Var resistor + \begin{scope}[set resistor graphic=var resistor IEC graphic] + \draw (0,1) to [resistor] (3,1); + + % Back to original + \draw [set resistor graphic=resistor IEC graphic] + (0,0) to [resistor] (3,0); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-37} +\begin{tikzpicture}[circuit logic IEC, + every circuit symbol/.style={ + logic gate IEC symbol color=black, + fill=blue!20,draw=blue,very thick}] + \matrix[column sep=7mm] + { + \node (i0) {0}; & & \\ + & \node [and gate] (a1) {}; & \\ + \node (i1) {0}; & & \node [or gate] (o) {};\\ + & \node [nand gate] (a2) {}; & \\ + \node (i2) {1}; & & \\ + }; + \draw (i0.east) -- ++(right:3mm) |- (a1.input 1); + \draw (i1.east) -- ++(right:3mm) |- (a1.input 2); + \draw (i1.east) -- ++(right:3mm) |- (a2.input 1); + \draw (i2.east) -- ++(right:3mm) |- (a2.input 2); + \draw (a1.output) -- ++(right:3mm) |- (o.input 1); + \draw (a2.output) -- ++(right:3mm) |- (o.input 2); + \draw (o.output) -- ++(right:3mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-39} +\begin{tikzpicture}[circuit logic CDH, + tiny circuit symbols, + every circuit symbol/.style={ + fill=white,draw}] + \matrix[column sep=7mm] + { + \node (i0) {0}; & & \\ + & \node [and gate] (a1) {}; & \\ + \node (i1) {0}; & & \node [or gate] (o) {};\\ + & \node [nand gate] (a2) {}; & \\ + \node (i2) {1}; & & \\ + }; + \draw (i0.east) -- ++(right:3mm) |- (a1.input 1); + \draw (i1.east) -- ++(right:3mm) |- (a1.input 2); + \draw (i1.east) -- ++(right:3mm) |- (a2.input 1); + \draw (i2.east) -- ++(right:3mm) |- (a2.input 2); + \draw (a1.output) -- ++(right:3mm) |- (o.input 1); + \draw (a2.output) -- ++(right:3mm) |- (o.input 2); + \draw (o.output) -- ++(right:3mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-40} +\tikz [circuit logic IEC] \node [and gate] {$A$}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-41} +\tikz [circuit logic US] +{ + \node [and gate,point down] {$A$}; + \node [and gate,point down,info=center:$A$] at (1,0) {}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-42} +\begin{tikzpicture}[circuit logic IEC] + \node[and gate,inputs={inini}] (A) {}; + \foreach \a in {1,...,5} + \draw (A.input \a -| -1,0) -- (A.input \a); + \draw (A.output) -- ++(right:5mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-43} +\begin{tikzpicture}[minimum height=0.75cm] + \node[and gate IEC, draw, logic gate inputs={inverted, normal, inverted}] + (A) {}; + \foreach \a in {1,...,3} + \draw (A.input \a -| -1,0) -- (A.input \a); + \draw (A.output) -- ([xshift=0.5cm]A.output); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-44} +\begin{tikzpicture}[minimum height=0.75cm] + \node[or gate US, draw,logic gate inputs=inini] (A) {}; + \foreach \a in {1,...,5} + \draw (A.input \a -| -1,0) -- (A.input \a); + \draw (A.output) -- ([xshift=0.5cm]A.output); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-45} +\begin{tikzpicture}[minimum height=0.75cm] + \tikzset{every node/.style={shape=nand gate CDH, draw, logic gate inputs=ii}} + \node[logic gate inverted radius=2pt] {A}; + \node[logic gate inverted radius=4pt] at (0,-1) {B}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-46} +\begin{tikzpicture}[minimum size=0.75cm] + \draw [help lines] grid (3,2); + \tikzset{every node/.style={shape=and gate IEC, draw, logic gate inputs=ini}} + \node[logic gate input sep=0.33333cm] at (1,1)(A) {A}; + \node[logic gate input sep=0.5cm] at (3,1) (B) {B}; + \foreach \a in {1,...,3} + \draw (A.input \a -| 0,0) -- (A.input \a) + (B.input \a -| 2,0) -- (B.input \a); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-47} +\begin{tikzpicture}[minimum height=1.5cm] + \node[xnor gate US, draw, gray!50,line width=2pt] (A) {}; + \foreach \x/\y/\z in {false/blue/1pt, true/red/2pt} + \foreach \a in {north, south, east, west, north east, + south east, north west, south west} + \draw[logic gate anchors use bounding box=\x, color=\y] + (A.\a) circle(\z); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-48} +\Huge +\begin{tikzpicture} + \node[name=s,shape=nand gate US,shape example, inner sep=0cm, + logic gate inputs={in}, + logic gate inverted radius=.5cm] {Nand Gate\vrule width1pt height2cm}; + \foreach \anchor/\placement in + {center/above, text/above, 30/above right, + mid/right, mid east/left, mid west/above, + base/below, base east/below, base west/left, + north/above, south/below, east/above, west/above, + north east/above, south east/below, south west/below, north west/above, + output/right, input 1/above, input 2/below} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-49} +\begin{tikzpicture}[minimum size=1cm, use IEC style logic gates] + \tikzset{every node/.style={nor gate, draw}} + \node (A) at (0,1.5) {}; + \node [logic gate symbol align={bottom, right}] (B) at (0,0) {}; + \foreach \g in {A, B}{ + \foreach \i in {1,2} + \draw ([xshift=-0.5cm]\g.input \i) -- (\g.input \i); + \draw (\g.output) -- ([xshift=0.5cm]\g.output); + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-50} +\Huge +\begin{tikzpicture} + \node[name=s,shape=nand gate IEC ,shape example, inner xsep=1cm, inner ysep=1cm, + minimum height=6cm, nand gate IEC symbol=\color{black!30}\char`\&, + logic gate inputs={in}, + logic gate inverted radius=0.65cm] + {Nand Gate\vrule width1pt height2cm}; + \foreach \anchor/\placement in + {center/above, text/above, 30/above right, + mid/right, mid east/left, mid west/above, + base/below, base east/below, base west/left, + north/above, south/below, east/above, west/above, + north east/above, south east/below, south west/below, north west/above, + output/right, input 1/above, input 2/below} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-51} +\tikz [circuit ee IEC] + \node [resistor] {}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-52} +\tikz [circuit ee IEC] + \node [resistor,ohm=5] {}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-53} +\tikz [circuit ee IEC] + \node [resistor={ohm=5}] {}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-54} +\tikz [circuit ee IEC] { + \node (R1) [resistor,point up,ohm=5] at (3,1) {}; + \node (R2) [resistor,ohm=10k] at (0,0) {}; + \draw (R2) -| (R1); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-55} +\tikz [circuit ee IEC] + \draw (0,0) to [resistor=red] (3,0) + to [resistor={ohm=2\mu}] (3,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-56} +\tikz [circuit ee IEC] \draw (0,0) to [resistor={ohm=5M}] (0,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-57} +\tikz [circuit ee IEC] \draw (0,0) to [resistor={ohm'=5M}] (0,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-58} +\tikz [circuit ee IEC] + \draw (0,0) to [resistor={ohm sloped=5M}] (0,2) + (2,0) to [resistor={ohm' sloped=6f}] (2,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-59} +\tikz [circuit ee IEC] \draw (0,0) to [diode=light emitting] (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-60} +\tikz [circuit ee IEC] +{ + \draw (0,2) to [diode={light emitting,info=not good}] (2,2); + \draw (0,0) to [diode={light emitting={info=better}, + info'=also good}] (2,0); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-62} +\begin{tikzpicture} + \pgfsetarrowoptions{direction ee}{6cm} + \node[name=s,shape=direction ee,shape example,minimum height=0.7654*6cm] {}; + \foreach \anchor/\placement in + {center/above, 30/above right, + north/above, south/below, east/left, west/right, + north east/above, south east/below, south west/below, north west/above, + input/left,output/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-63} +\begin{tikzpicture}[direction ee arrow=angle 45] + \node[name=s,shape=direction ee,shape example,minimum height=1.75cm] {}; + \foreach \anchor/\placement in {north/above, south/below, + output/right, input/left} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-64} +\tikz \node [generic circle IEC, + /pgf/generic circle IEC/before background={ + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{1pt}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{1pt}} + \pgfpathlineto{\pgfpoint{-0.5pt}{-0.5pt}} + \pgfusepathqstroke + }, + draw] {Hello world}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-65} +\begin{tikzpicture} + \node[name=s,shape=generic diode IEC,shape example,minimum size=6cm] {}; + \foreach \anchor/\placement in + {center/above, 30/above right, + north/above, south/below, east/left, west/right, + north east/above, south east/below, south west/below, north west/above, + input/left,output/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-66} +\tikz \node [minimum size=1cm,generic diode IEC, + /pgf/generic diode IEC/before background={ + \pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}} + \pgfpathlineto{\pgfqpoint{.5pt}{-1pt}} + \pgfpathmoveto{\pgfqpoint{0pt}{-1pt}} + \pgfpathlineto{\pgfqpoint{0pt}{1pt}} + \pgfpathmoveto{\pgfqpoint{-.5pt}{1pt}} + \pgfpathlineto{\pgfqpoint{.5pt}{1pt}} + \pgfusepathqstroke + }, + draw] {}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-67} +\begin{tikzpicture} + \node[name=s,shape=breakdown diode IEC,shape example,minimum width=6cm,minimum height=4cm] {}; + \foreach \anchor/\placement in + {center/above, 30/above right, + north/above, south/below, east/left, west/right, + north east/above, south east/below, south west/below, north west/above, + input/left,output/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-68} +\begin{tikzpicture} + \node[name=s,shape=var resistor IEC,shape example,minimum width=7cm,minimum height=1cm] {}; + \foreach \anchor/\placement in + {center/above, 30/above right, + north/above, south/below, east/left, west/right, + north east/above, south east/below, south west/below, north west/above, + input/left,output/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-69} +\begin{tikzpicture} + \node[name=s,shape=inductor IEC,shape example,minimum width=7cm,minimum height=1cm] {}; + \foreach \anchor/\placement in + {center/above, 30/above right, + north/above, south/below, east/left, west/right, + north east/above, south east/below, south west/below, north west/above, + input/left,output/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-70} +\begin{tikzpicture} + \node[name=s,shape=capacitor IEC,shape example, + minimum width=2cm,minimum height=3cm,inner sep=0pt] {}; + \foreach \anchor/\placement in + {center/above, 30/above right, + north/above, south/below, east/left, west/right, + north east/above, south east/below, south west/below, north west/above, + input/left,output/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-71} +\tikz \node[shape=battery IEC,shape example,minimum size=2cm, + inner sep=0pt] {}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-72} +\tikz \node[shape=ground IEC,shape example,minimum size=2cm, + inner sep=0pt] {}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-73} +\begin{tikzpicture} + \node[name=s,shape=make contact IEC,shape example,minimum width=3cm,minimum height=1cm] {}; + \foreach \anchor/\placement in + {center/above, 30/above right, + north/above, south/below, east/left, west/right, + north east/above, south east/below, south west/below, north west/above, + input/left,output/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-74} +\tikz \node[shape=var make contact IEC,shape example, + minimum height=1cm,minimum width=3cm,inner sep=0pt] {}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-circuits-75} +\tikz \node[shape=break contact IEC,shape example, + minimum height=1cm,minimum width=3cm,inner sep=0pt] {}; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-decorations.lvt b/testfiles/pgfmanual-en-library-decorations.lvt new file mode 100644 index 000000000..acf6cc554 --- /dev/null +++ b/testfiles/pgfmanual-en-library-decorations.lvt @@ -0,0 +1,996 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{decorations.markings,fpu} +\usetikzlibrary{decorations} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathreplacing} +\usetikzlibrary{decorations.pathreplacing} +\usetikzlibrary{decorations.pathreplacing} +\usetikzlibrary{decorations.pathreplacing} +\usetikzlibrary{decorations.pathreplacing} +\usetikzlibrary{decorations.pathreplacing} +\usetikzlibrary{decorations.pathreplacing,shapes.misc} +\usetikzlibrary{decorations.markings} +\usetikzlibrary{decorations.markings} +\usetikzlibrary{decorations.markings} +\usetikzlibrary{decorations.markings} +\usetikzlibrary{decorations.markings} +\usetikzlibrary{decorations.markings,shapes.arrows} +\usetikzlibrary{decorations.markings} +\usetikzlibrary{decorations.markings} +\usetikzlibrary{decorations.markings} +\usetikzlibrary{decorations.markings} +\usetikzlibrary{decorations.markings} +\usetikzlibrary{decorations.markings} +\usetikzlibrary{decorations.footprints} +\usetikzlibrary{decorations.footprints} +\usetikzlibrary{decorations.footprints} +\usetikzlibrary{decorations.footprints} +\usetikzlibrary{decorations.footprints} +\usetikzlibrary{decorations.shapes} +\usetikzlibrary{decorations.shapes} +\usetikzlibrary{decorations.shapes,shapes.geometric} +\usetikzlibrary{decorations.shapes,shapes.geometric} +\usetikzlibrary{decorations.shapes,shapes.geometric} +\usetikzlibrary{decorations.shapes,shapes.geometric} +\usetikzlibrary{decorations.shapes,shapes.symbols} +\usetikzlibrary{decorations.shapes} +\usetikzlibrary{decorations.shapes,shapes.geometric} +\usetikzlibrary{decorations.shapes} +\usetikzlibrary{decorations.shapes} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text,math} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text,math} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.fractals} +\usetikzlibrary{decorations.fractals} +\usetikzlibrary{decorations.fractals} +\usetikzlibrary{decorations.fractals} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-decorations-1} +\begin{tikzpicture} + \begin{scope}[/pgf/fpu/install only={reciprocal}] + \draw[postaction=decorate,decoration={ + markings,mark=at position 0.52 with { + \draw circle[radius=2pt]; + }}, + ] plot[smooth,variable=\x,domain=-1:1] (\x*\x*\x,\x*\x); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-2} +\begin{tikzpicture}[decoration=lineto] + \draw [help lines] grid (3,2); + \draw [decorate,fill=yellow!80!black] + (0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-3} +\begin{tikzpicture}[decoration={straight zigzag,meta-segment length=1.1cm}] + \draw [help lines] grid (3,2); + \draw [decorate,fill=yellow!80!black] + (0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-4} +\pgfmathsetseed{1} +\begin{tikzpicture} + [decoration={random steps,segment length=2mm}] + \draw [help lines] grid (3,2); + \draw [decorate,fill=yellow!80!black] + (0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-5} +\begin{tikzpicture}[decoration=saw] + \draw [help lines] grid (3,2); + \draw [decorate,fill=yellow!80!black] + (0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-6} +\begin{tikzpicture}[decoration=zigzag] + \draw [help lines] grid (3,2); + \draw [decorate,fill=yellow!80!black] + (0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-7} +\begin{tikzpicture}[decoration=bent] + \draw [help lines] grid (3,2); + \draw [decorate] (0,0) -- (3,1) -- (1.5,2) -- (0,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-8} +\begin{tikzpicture}[decoration={bent,aspect=.3}] + \draw [decorate,fill=yellow!80!black] (0,0) rectangle (3.5,2); + \node[circle,draw] (A) at (.5,.5) {A}; + \node[circle,draw] (B) at (3,1.5) {B}; + \draw[->,decorate] (A) -- (B); + \draw[->,decorate] (B) -- (A); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-9} +\begin{tikzpicture}[decoration=bumps] + \draw [help lines] grid (3,2); + \draw [decorate,fill=yellow!80!black] + (0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-10} +\begin{tikzpicture}[decoration=coil] + \draw [help lines] grid (3,2); + \draw [decorate,fill=yellow!80!black] + (0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-11} +\begin{tikzpicture} + [decoration={coil,aspect=0.3,segment length=3mm,amplitude=3mm}] + \draw [help lines] grid (3,2); + \draw [decorate,fill=yellow!80!black] + (0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-12} +\begin{tikzpicture}[decoration=curveto] + \draw [help lines] grid (3,2); + \draw [decorate,fill=yellow!80!black] + (0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-13} +\begin{tikzpicture}[decoration=snake] + \draw [help lines] grid (3,2); + \draw [decorate,fill=yellow!80!black] + (0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-14} +\begin{tikzpicture}[decoration=border] + \draw [help lines] grid (3,2); + \draw [postaction={decorate,draw,red}] + (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-15} +\begin{tikzpicture}[decoration=brace] + \draw [help lines] grid (3,2); + \draw [decorate] (0,0) -- (3,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-16} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-17} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-18} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-19} +\begin{tikzpicture}[>=stealth, every node/.style={midway, sloped, font=\tiny}, + decoration={show path construction, + moveto code={ + \fill [red] (\tikzinputsegmentfirst) circle (2pt) + node [fill=none, below] {moveto};}, + lineto code={ + \draw [blue,->] (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast) + node [above] {lineto}; + }, + curveto code={ + \draw [green!75!black,->] (\tikzinputsegmentfirst) .. controls + (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb) + ..(\tikzinputsegmentlast) node [above] {curveto}; + }, + closepath code={ + \draw [orange,->] (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast) + node [above] {closepath};} + }] + \draw [help lines] grid (3,2); + \path [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-20} +\tikzset{ + show curve controls/.style={ + decoration={ + show path construction, + curveto code={ + \draw [blue, dashed] + (\tikzinputsegmentfirst) -- (\tikzinputsegmentsupporta) + node [at end, cross out, draw, solid, red, inner sep=2pt]{}; + \draw [blue, dashed] + (\tikzinputsegmentsupportb) -- (\tikzinputsegmentlast) + node [at start, cross out, draw, solid, red, inner sep=2pt]{}; + } + },decorate + } +} + +\tikzpicture + \draw [postaction=show curve controls, thick] + (0,2) .. controls (2.5,1.5) and (0.5,0.5) .. (3,0); +\endtikzpicture +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-22} +\begin{tikzpicture}[decoration={ + markings,% switch on markings + mark=% actually add a mark + at position 2cm + with + { + \draw (-2pt,-2pt) -- (2pt,2pt); + \draw (2pt,-2pt) -- (-2pt,2pt); + } + } + ] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-23} +\begin{tikzpicture}[decoration={ + markings,% switch on markings + mark=% actually add a mark + between positions 0 and 1 step 5mm + with + { + \draw (-2pt,-2pt) -- (2pt,2pt); + \draw (2pt,-2pt) -- (-2pt,2pt); + } + } + ] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-24} +\begin{tikzpicture}[decoration={ + markings,% switch on markings + mark=at position 1cm with \node[red]{1cm};, + mark=at position .5 with \node[green]{mid};, + mark=at position -1cm with {\node[blue,transform shape]{1cm from end};}} + ] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-25} +\begin{tikzpicture}[domain=0:4,label/.style={postaction={ + decorate, + decoration={ + markings, + mark=at position .75 with \node #1;}}}] + \draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9); + + \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$}; + \draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$}; + + \draw[red,label={[above left]{$f(x)=x$}}] plot (\x,\x); + \draw[blue,label={[below left]{$f(x)=\sin x$}}] plot (\x,{sin(\x r)}); + \draw[orange,label={[right]{$f(x)= \frac{1}{20} \mathrm e^x$}}] plot (\x,{0.05*exp(\x)}); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-26} +\begin{tikzpicture}[decoration={markings, + mark=between positions 0 and 1 step 0.1 + with { \draw (-2pt,-2pt) -- (2pt,2pt); + \draw (2pt,-2pt) -- (-2pt,2pt); }} ] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-27} +\begin{tikzpicture}[decoration={markings, + mark=between positions 0 and 1 step 1cm + with { \node [single arrow,fill=red, + single arrow head extend=3pt,transform shape] {};}}] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-28} +\begin{tikzpicture}[decoration={markings, + mark=between positions 0 and 1 step 1cm with { + \node [draw, + name=mark-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}, + transform shape] + {\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}};}}] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); + \draw [red,->] (mark-3) -- (mark-7); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-29} +\begin{tikzpicture}[decoration={markings, + % Main marks + mark=between positions 0 and 1 step 40pt with + { \draw [help lines] (0,0) -- (0,0.5) + node[above,font=\tiny]{ + \pgfkeysvalueof{/pgf/decoration/mark info/distance from start}}; }, + mark=at position -0.1pt with + { \draw [help lines] (0,0) -- (0,0.5) + node[above,font=\tiny]{ + \pgfkeysvalueof{/pgf/decoration/mark info/distance from start}}; }}] + \draw [help lines] grid (5,3); + \draw [postaction={decorate}] (0,0) .. controls (8,3) and (0,3) .. (5,0) ; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-30} +\begin{tikzpicture}[decoration={markings, + mark connection node=my node, + mark=at position .5 with + {\node [draw,blue,transform shape] (my node) {my node};}}] + \draw [help lines] grid (3,2); + \draw decorate { (0,0) -- (3,2) }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-31} +\begin{tikzpicture}[decoration={markings, + mark connection node=my node, + mark=at position .25 with + {\node [draw,red] (my node) {my node};}}] + \draw [help lines] grid (3,2); + \draw decorate { (0,0) -- (3,2) }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-32} +\begin{tikzpicture}[decoration={ + markings,% switch on markings + mark=at position 1cm with {\node[red]{1cm};}, + mark=at position .75 with {\arrow[blue,line width=2mm]{>}}, + mark=at position -1cm with {\arrowreversed[black]{stealth}}} + ] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-33} +\begin{tikzpicture}[decoration={ + markings,% switch on markings + mark=between positions 0 and .75 step 4mm with {\arrow{stealth}}, + mark=between positions .75 and 1 step 4mm with {\arrowreversed{stealth}}} + ] + \draw [help lines] grid (3,2); + \draw [postaction={decorate}] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-34} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-35} +\begin{tikzpicture}[decoration={footprints,foot length=20pt}] + \fill [decorate] (0,0) -- (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-36} +\begin{tikzpicture}[decoration={footprints,stride length=50pt}] + \fill [decorate] (0,0) -- (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-37} +\begin{tikzpicture}[decoration={footprints,foot sep=10pt}] + \fill [decorate] (0,0) -- (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-38} +\begin{tikzpicture}[decoration={footprints,foot angle=60}] + \fill [decorate] (0,0) -- (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-39} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-40} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-41} +\begin{tikzpicture}[decoration={shape backgrounds,shape=star,shape size=5pt}] + \draw [help lines] grid (3,2); + \draw [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-42} +\tikzset{paint/.style={ draw=#1!50!black, fill=#1!50 }, + decorate with/.style= + {decorate,decoration={shape backgrounds,shape=#1,shape size=2mm}}} +\begin{tikzpicture} + \draw [decorate with=dart, paint=red] (0,1.5) -- (3,1.5); + \draw [decorate with=diamond, paint=green] (0,1) -- (3,1); + \draw [decorate with=rectangle, paint=blue] (0,0.5) -- (3,0.5); + \draw [decorate with=circle, paint=yellow] (0,0) -- (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-43} +\begin{tikzpicture}[decoration={ + shape backgrounds,shape=regular polygon,shape size=4mm}] + \draw [help lines] grid (3,2); + \draw [thick] (0,0) -- (2,2) (1,0) -- (3,0); + \draw [red, decorate, decoration={shape sep=.5cm}] (1,0) -- (3,0); + \draw [blue, decorate, decoration={shape sep=.5cm}] (0,0) -- (2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-44} +\tikzset{ + paint/.style={draw=#1!50!black, fill=#1!50}, + my star/.style={decorate,decoration={shape backgrounds,shape=star}, + star points=#1} +} +\begin{tikzpicture}[decoration={shape sep=.5cm, shape size=.5cm}] + \draw [my star=9, paint=red] (0,1.5) -- (3,1.5); + \draw [my star=5, paint=blue] (0,.75) -- (3,.75); + \draw [my star=5, paint=yellow, shape border rotate=30] (0,0) -- (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-45} +\begin{tikzpicture}[ + decoration={shape backgrounds,shape size=.5cm,shape=signal}, + signal from=west, signal to=east, + paint/.style={decorate, draw=#1!50!black, fill=#1!50}] + \draw [help lines] grid (3,2); + \draw [paint=red, decoration={shape sep=.5cm}] + (0,2) -- (3,2); + \draw [paint=green, decoration={shape sep={1cm, between centers}}] + (0,1) -- (3,1); + \draw [paint=blue, decoration={shape sep={1cm, between borders}}] + (0,0) -- (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-46} +\tikzset{ + paint/.style={draw=#1!50!black, fill=#1!50}, + spreading/.style={ + decorate,decoration={shape backgrounds, shape=rectangle, + shape start size=4mm,shape end size=1mm,shape evenly spread={#1}}} +} +\begin{tikzpicture} + \fill [paint=green,spreading={5, by borders}, + decoration={shape scaled}] (0,2) -- (3,2); + \fill [paint=blue,spreading={5, by centers}, + decoration={shape scaled}] (0,1.5) -- (3,1.5); + \fill [paint=red, spreading=5] (0,1) -- (3,1); + \fill [paint=orange, spreading=4] (0,.5) -- (3,.5); + \fill [paint=gray, spreading=1] (0,0) -- (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-47} +\tikzset{ + paint/.style={draw=#1!50!black, fill=#1!50} +} +\begin{tikzpicture}[decoration={ + shape width=.65cm, shape height=.45cm, + shape=isosceles triangle, shape sep=.75cm, + shape backgrounds}] + \draw [help lines] grid (3,2); + \draw [paint=red,decorate] (0,0) -- (2,2); + \draw [paint=blue,decorate,decoration={shape sloped=false}] + (1,0) -- (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-48} +\tikzset{ + bigger/.style={decoration={shape start size=.125cm, shape end size=.5cm}}, + smaller/.style={decoration={shape start size=.5cm, shape end size=.125cm}}, + decoration={shape backgrounds, + shape sep={.25cm, between borders},shape scaled} +} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \fill [decorate, bigger, red!50] (0,1) -- (3,2); + \fill [decorate, smaller, blue!50] (0,0) -- (3,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-49} +\tikzset{ + bigger/.style={decoration={shape start size=.25cm, shape end size=1cm}}, + smaller/.style={decoration={shape start size=1cm, shape end size=.25cm}}, + decoration={shape backgrounds, + shape sep={.25cm, between borders},shape scaled} +} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \fill [decorate,bigger, + decoration={shape sep={.25cm, between borders}}, blue!50] + (0,1.5) -- (3,1.5); + \fill [decorate,smaller, + decoration={shape sep={1cm, between centers}}, red!50] + (0,.5) -- (3,.5); + \draw [gray, dotted] (0,1.625) -- (3,2) (0,1.375) -- (3,1) + (0,1) -- (3,.625) (0,0) -- (3,.375); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-50} +\catcode`\|12 +\begin{tikzpicture}[decoration={text along path, + text={Some long text along a ridiculously long curve that}}] + \draw [help lines] grid (3,2); + \draw [decorate] (0,0) -- (3,1) arc (0:180:1.5 and 1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-51} +\catcode`\|12 +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \path [decorate,decoration={text along path, + text={a big |\color{green}|green|| juicy apple.}}] + (0,0) .. controls (0,2) and (3,0) .. (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-52} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \path [decorate,decoration={text along path, + text={a |\large|big |+\bf\color{red}|red|| juicy apple.}}] + (0,0) .. controls (0,2) and (3,0) .. (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-53} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \path [decorate, decoration={text along path,text format delimiters={[}{]}, + text={A big [\color{red}]red[] and [\color{green}]green[] apple.}}] + (0,0) .. controls (0,2) and (3,0) .. (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-54} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \draw [gray, ->] + [postaction={decoration={text along path, + text={a big juicy apple}, text color=red}, decorate}] + [postaction={decoration={text along path, + text={a big juicy apple}, text color=blue, reverse path}, decorate}] + (3,0) .. controls (3,2) and (0,2) .. (0,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-55} +\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); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-56} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \draw [red, dashed] + [postaction={decoration={text along path, text={a big juicy apple}, + text align=fit to path}, decorate}] + (0,0) .. controls (0,2) and (3,2) .. (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-57} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \draw [red, dashed] + [postaction={decoration={text along path, text={a big juicy apple}, + text align={fit to path stretching spaces}}, decorate}] + (0,0) .. controls (0,2) and (3,2) .. (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-58} +\bfseries\large +\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}}}] + (0,0) .. controls ++(2,1) and ++(-2,-1) .. (3,4); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-59} +\begin{tikzpicture}[decoration={text effects along path, + text={000-001-010-011-100-101-110-111}, + text effects/.cd, + path from text, + word separator=-, + every letter/.style={shape=rectangle, fill=blue!20, draw=blue!40}}] + +\path [decorate] (0,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-60} +\begin{tikzpicture}[decoration={text effects along path, + text={000-001-010-011-100-101-110-111}, text align=center, + text effects/.cd, + word separator=-, + replace characters=0 with {\fill [purple] circle [radius=2pt]; }, + 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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-61} +\begin{tikzpicture}[decoration={text effects along path, + 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}] + (0,0) .. controls ++(1,0) and ++(-1,0) .. (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-62} +\begin{tikzpicture}[decoration={text effects along path, + text={text effects along path!}, text align=center, + text effects/.cd, + character count=\i, + characters={xslant=0.5, text along path, name=c-\i}}] + +\path [decorate] (0,0) -- (3,2); +\path [decorate, + text effects={character widths={inner xsep=0pt, xslant=0}}] + (0,1) -- (3,3); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-63} +\begin{tikzpicture}[decoration={text effects along path, + text={text effects along path!}, + text effects/.cd, + 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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-64} +\begin{tikzpicture}[decoration={text effects along path, + text={text effects along path!}, + text effects/.cd, + 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] + (0,0) .. controls ++(1,0) and ++(-1,0) .. (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-65} +\begin{tikzpicture}[decoration={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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-66} +\begin{tikzpicture}[decoration={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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-67} +\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, + style characters=aeiou{\"U}{\"a}{\"o} with {text=blue}, + characters={text along path}}] + +\path [decorate] (0,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-68} +\begin{tikzpicture}[decoration={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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-69} +\begin{tikzpicture}[decoration={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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-70} +\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] + (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}] + (0,0) .. controls ++(2,0) and ++(-1,0) .. (5,-1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-71} +\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] + (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}] + (0,0) .. controls ++(2,0) and ++(-1,0) .. (5,-1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-72} +\begin{tikzpicture}[decoration={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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-73} +\begin{tikzpicture}[decoration={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, text effects={reverse text}] (0,0); +\path [blue, decorate, decoration={reverse path}, + text effects={characters/.append={scale=-1}}] (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-74} +\begin{tikzpicture}[decoration={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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-75} +\begin{tikzpicture}[decoration={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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-76} +\begin{tikzpicture}[decoration={text effects along path, + text={text effects along path!\ }, + text effects/.cd, + 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] + (180:2) \foreach \a in {0,...,12}{ arc (180-\a*90:90-\a*90:1.5-\a/10) }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-77} +\def\mycommand#1{#1$_\n$} +\begin{tikzpicture}[decoration={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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-78} +\begin{tikzpicture}[decoration={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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-79} +\begin{tikzpicture}[decoration=Koch curve type 1] + \draw decorate{ (0,0) -- (3,0) }; + \draw decorate{ decorate{ (0,-1.5) -- (3,-1.5) }}; + \draw decorate{ decorate{ decorate{ (0,-3) -- (3,-3) }}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-80} +\begin{tikzpicture}[decoration=Koch curve type 2] + \draw decorate{ (0,0) -- (3,0) }; + \draw decorate{ decorate{ (0,-2) -- (3,-2) }}; + \draw decorate{ decorate{ decorate{ (0,-4) -- (3,-4) }}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-81} +\begin{tikzpicture}[decoration=Koch snowflake] + \draw decorate{ (0,0) -- (3,0) }; + \draw decorate{ decorate{ (0,-1) -- (3,-1) }}; + \draw decorate{ decorate{ decorate{ (0,-2) -- (3,-2) }}}; + \draw decorate{ decorate{ decorate{ decorate{ (0,-3) -- (3,-3) }}}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-decorations-82} +\begin{tikzpicture}[decoration=Cantor set,very thick] + \draw decorate{ (0,0) -- (3,0) }; + \draw decorate{ decorate{ (0,-.5) -- (3,-.5) }}; + \draw decorate{ decorate{ decorate{ (0,-1) -- (3,-1) }}}; + \draw decorate{ decorate{ decorate{ decorate{ (0,-1.5) -- (3,-1.5) }}}}; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-edges.lvt b/testfiles/pgfmanual-en-library-edges.lvt new file mode 100644 index 000000000..b416bc591 --- /dev/null +++ b/testfiles/pgfmanual-en-library-edges.lvt @@ -0,0 +1,106 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{automata,positioning} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-edges-1} +\tikz {\draw (0,0) to[line to] (1,0);} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-edges-2} +\tikz \draw (0,0) to[line to] (1,0) + to[move to] (2,0) to[line to] (3,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-edges-3} +\begin{tikzpicture}[out=45,in=135] + \draw (0,0) to (1,0) + (0,0) to (2,0) + (0,0) to (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-edges-4} +\begin{tikzpicture}[out=45,in=135,relative] + \draw (0,0) to (1,0) + to (2,1) + to (2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-edges-5} +\begin{tikzpicture}[out=90,in=90,relative] + \node [circle,draw] (a) at (0,0) {a}; + \node [circle,draw] (b) at (1,1) {b}; + \node [circle,draw] (c) at (2,2) {c}; + + \path (a) edge (b) + edge (c); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-edges-6} +\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid] + \node[state,initial] (q_0) {$q_0$}; + \node[state] (q_1) [right=of q_0] {$q_1$}; + \node[state,accepting](q_2) [right=of q_1] {$q_2$}; + + \path[->] (q_0) edge node [above] {0} (q_1) + edge [loop above] node {1} () + edge [bend left] node [above] {1} (q_2) + edge [bend right] node [below] {0} (q_2) + (q_1) edge node [above] {1} (q_2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-edges-7} +\begin{tikzpicture} + \foreach \angle in {0,45,...,315} + \node[rectangle,draw=black!50] (\angle) at (\angle:2) {\angle}; + + \foreach \from/\to in {0/45,45/90,90/135,135/180, + 180/225,225/270,270/315,315/0} + \path (\from) edge [->,bend right=22,looseness=0.8] (\to) + edge [<-,bend left=22,looseness=0.8] (\to); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-edges-8} +\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); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-edges-9} +\begin{tikzpicture}[out=45,in=135,distance=1cm] + \draw (0,0) to (1,0) + (0,0) to (2,0) + (0,0) to (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-edges-10} +\tikz \draw (0,0) to [controls=+(90:1) and +(90:1)] (3,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-edges-11} +\begin{tikzpicture} + \node [circle,draw] {a} edge [in=30,out=60,loop] (); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-edges-12} +\begin{tikzpicture} + \node [circle,draw] {a} edge [loop above] node {x} (); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-edges-13} +\begin{tikzpicture}[every loop/.style={}] + \draw (0,0) to [loop above] () to [loop right] () + to [loop below] () to [loop left] (); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-er.lvt b/testfiles/pgfmanual-en-library-er.lvt new file mode 100644 index 000000000..684795950 --- /dev/null +++ b/testfiles/pgfmanual-en-library-er.lvt @@ -0,0 +1,81 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{er,positioning} +\usetikzlibrary{er,positioning} +\usetikzlibrary{er} +\usetikzlibrary{er} +\usetikzlibrary{er} +\usetikzlibrary{er} +\usetikzlibrary{er} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-er-1} +\begin{tikzpicture} + \node[entity] (sheep) {Sheep}; + \node[entity] (genome) [right=of sheep] {Genome}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-er-2} +\begin{tikzpicture} + [every entity/.style={draw=blue!50,fill=blue!20,thick}] + \node[entity] (sheep) {Sheep}; + \node[entity] (genome) [right=of sheep] {Genome}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-er-3} +\begin{tikzpicture} + \node[entity] (sheep) at (0,0) {Sheep}; + \node[entity] (genome) at (2,0) {Genome}; + \node[relationship] at (1,1.5) {has} + edge (sheep) + edge (genome); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-er-4} +\begin{tikzpicture} + [every entity/.style={fill=blue!20,draw=blue,thick}, + every relationship/.style={fill=orange!20,draw=orange,thick,aspect=1.5}] + \node[entity] (sheep) at (0,0) {Sheep}; + \node[entity] (genome) at (2,0) {Genome}; + \node[relationship] at (1,1.5) {has} + edge (sheep) + edge (genome); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-er-5} +\begin{tikzpicture} + \node[entity] (sheep) {Sheep} + child {node[attribute] {name}} + child {node[attribute] {color}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-er-6} +\begin{tikzpicture}[every pin edge/.style=draw] + \node[entity,pin={[attribute]60:name},pin={[attribute]120:color}] {Sheep}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-er-7} +\begin{tikzpicture} + [text depth=1pt, + every attribute/.style={fill=black!20,draw=black}, + every entity/.style={fill=blue!20,draw=blue,thick}, + every relationship/.style={fill=orange!20,draw=orange,thick,aspect=1.5}] + + \node[entity] (sheep) at (0,0) {Sheep} + child {node [key attribute] {name}}; + \node[entity] (genome) at (2,0) {Genome}; + \node[relationship] at (1,1.5) {has} + edge (sheep) + edge (genome); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-fit.lvt b/testfiles/pgfmanual-en-library-fit.lvt new file mode 100644 index 000000000..c434981da --- /dev/null +++ b/testfiles/pgfmanual-en-library-fit.lvt @@ -0,0 +1,84 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{fit} +\usetikzlibrary{fit} +\usetikzlibrary{fit,shapes.geometric} +\usetikzlibrary{fit} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-fit-1} +\begin{tikzpicture}[inner sep=0pt,thick, + dot/.style={fill=blue,circle,minimum size=3pt}] + \draw[help lines] (0,0) grid (3,2); + \node[dot] (a) at (1,1) {}; + \node[dot] (b) at (2,2) {}; + \node[dot] (c) at (1,2) {}; + \node[dot] (d) at (1.25,0.25) {}; + \node[dot] (e) at (1.75,1.5) {}; + + \node[draw=red, fit=(a) (b) (c) (d) (e)] {box}; + \node[draw,circle,fit=(a) (b) (c) (d) (e)] {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fit-2} +\begin{tikzpicture}[inner sep=0pt,thick, + dot/.style={fill=blue,circle,minimum size=3pt}] + \draw[help lines] (0,0) grid (3,2); + \node[dot] (a) at (1,1) {}; + \node[dot] (b) at (2,2) {}; + \node[dot] (c) at (1,2) {}; + \node[dot] (d) at (1.25,0.25) {}; + \node[dot] (e) at (1.75,1.5) {}; + + \node[draw=red,fit=(a) (b) (c) (d) (e)] (fit) {}; + \node[below] at (fit.north) {box}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fit-3} +\begin{tikzpicture} + [vertex/.style={minimum size=2pt,fill,draw,circle}, + open/.style={fill=none}, + sibling distance=1.5cm,level distance=.75cm, + every fit/.style={ellipse,draw,inner sep=-2pt}, + leaf/.style={label={[name=#1]below:$#1$}},auto] + + \node [vertex] (root) {} + child { node [vertex,open] {} + child { node [vertex,open] {} + child { node [vertex] (b's parent) {} + child { node [vertex] {} + child { node [vertex,leaf=d] {} } + child { node [vertex,leaf=e] {} } } + child { node [vertex,leaf=b] {} } } + child { node [vertex,leaf=a] {} } } + child { node [coordinate] {} + child[missing] + child { node [vertex] (f's parent) {} + child { node [vertex,leaf=c] {} } + child { node [vertex,leaf=f] {} } } } + edge from parent node {$\rho$} }; + + \node [fit=(d) (e) (b) (b's parent),label=above left:$F^{(b,R)}$] {}; + \node [fit=(c) (f) (f's parent),label=above right:$F^{(c,R)}$] {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fit-4} +\begin{tikzpicture}[inner sep=0pt,thick, + dot/.style={fill=blue,circle,minimum size=3pt}] + \draw[help lines] (0,0) grid (3,2); + \node[dot] (a) at (1,1) {}; + \node[dot] (b) at (2,2) {}; + \node[dot] (c) at (1,2) {}; + \node[dot] (d) at (1.25,0.25) {}; + \node[dot] (e) at (1.75,1.5) {}; + \node[draw, fit=(a) (b) (c) (d) (e)] {}; + \node[draw=red, rotate fit=30, fit=(a) (b) (c) (d) (e)] {}; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-fixedpoint.lvt b/testfiles/pgfmanual-en-library-fixedpoint.lvt new file mode 100644 index 000000000..4aaa06d4e --- /dev/null +++ b/testfiles/pgfmanual-en-library-fixedpoint.lvt @@ -0,0 +1,16 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usepgflibrary{fixedpointarithmetic} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-fixedpoint-1} +\begin{tikzpicture}[fixed point arithmetic={scale results=10^-6}] +\draw [help lines] grid (3,2); +\draw (0,0) -- (2,2); +\draw [red, line width=4pt] (*1.0e6,0) -- (*3.0e6,*2.0e6); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-folding.lvt b/testfiles/pgfmanual-en-library-folding.lvt new file mode 100644 index 000000000..724631224 --- /dev/null +++ b/testfiles/pgfmanual-en-library-folding.lvt @@ -0,0 +1,146 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{calendar,folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} +\usetikzlibrary{folding} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-folding-1} +\sffamily\scriptsize +\tikz \pic [ + transform shape, + every calendar/.style={ + at={(-8ex,4ex)}, + week list, + month label above centered, + month text=\bfseries\textcolor{red}{\%mt} \%y0, + if={(Sunday) [black!50]} + }, + folding line length=2.5cm, + face 1={ \calendar [dates=\the\year-01-01 to \the\year-01-last];}, + face 2={ \calendar [dates=\the\year-02-01 to \the\year-02-last];}, + face 3={ \calendar [dates=\the\year-03-01 to \the\year-03-last];}, + face 4={ \calendar [dates=\the\year-04-01 to \the\year-04-last];}, + face 5={ \calendar [dates=\the\year-05-01 to \the\year-05-last];}, + face 6={ \calendar [dates=\the\year-06-01 to \the\year-06-last];}, + face 7={ \calendar [dates=\the\year-07-01 to \the\year-07-last];}, + face 8={ \calendar [dates=\the\year-08-01 to \the\year-08-last];}, + face 9={ \calendar [dates=\the\year-09-01 to \the\year-09-last];}, + face 10={\calendar [dates=\the\year-10-01 to \the\year-10-last];}, + face 11={\calendar [dates=\the\year-11-01 to \the\year-11-last];}, + face 12={\calendar [dates=\the\year-12-01 to \the\year-12-last];} +] {dodecahedron folding}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-2} +\tikz \pic [ + transform shape, + folding line length=6mm, + face 1={ \node[red] {1};}, + face 2={ \node {2};}, + face 3={ \node {3};}, + face 4={ \node {4};} +] {tetrahedron folding}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-3} +\tikz \pic[ + every cut/.style=red, + every fold/.style=dotted, + folding line length=6mm +] { tetrahedron folding }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-4} +\tikz \pic [folding line length=6mm, numbered faces, transform shape] + { tetrahedron truncated folding }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-5} +\tikz \pic [folding line length=6mm, numbered faces, transform shape] + { cube folding }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-6} +\tikz \pic [folding line length=6mm, numbered faces, transform shape] + { cube truncated folding }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-7} +\tikz \pic [folding line length=6mm, numbered faces, transform shape] + { octahedron folding }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-8} +\tikz \pic [folding line length=6mm, numbered faces, transform shape] + { octahedron truncated folding }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-9} +\tikz \pic [folding line length=6mm, numbered faces, transform shape] + { dodecahedron folding }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-10} +\tikz \pic [folding line length=6mm, numbered faces, transform shape] + { dodecahedron' folding }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-11} +\tikz \pic [folding line length=6mm, numbered faces, transform shape] + { dodecahedron rhombic folding }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-12} +\tikz \pic [folding line length=6mm, numbered faces, transform shape] + { dodecahedron golden folding }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-13} +\tikz \pic [folding line length=6mm, numbered faces, transform shape] + { cuboctahedron folding }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-14} +\tikz \pic [folding line length=6mm, numbered faces, transform shape] + { cuboctahedron truncated folding }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-15} +\tikz \pic [folding line length=6mm, numbered faces, transform shape] + { icosahedron folding }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-16} +\tikz \pic [folding line length=6mm, numbered faces, transform shape] + { rhombicuboctahedron folding }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-17} +\tikz \pic [folding line length=6mm, numbered faces, transform shape] + { snub cube folding }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-folding-18} +\tikz \pic [folding line length=6mm, numbered faces, transform shape] + { icosidodecahedron folding }; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-fpu.lvt b/testfiles/pgfmanual-en-library-fpu.lvt new file mode 100644 index 000000000..0fbdc7d95 --- /dev/null +++ b/testfiles/pgfmanual-en-library-fpu.lvt @@ -0,0 +1,193 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usepgflibrary{fpu} +\usepgflibrary{fpu} +\usepgflibrary{fpu} +\usepgflibrary{fpu} +\usepgflibrary{fpu} +\usetikzlibrary{fpu} +\usetikzlibrary{fpu} +\usetikzlibrary{fpu} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-fpu-1} +\pgfkeys{/pgf/fpu} +\pgfmathparse{1+1}\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-2} +\pgfkeys{/pgf/fpu,/pgf/fpu/output format=float} +\pgfmathparse{exp(50)*42}\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-3} +\pgfkeys{/pgf/fpu,/pgf/fpu/output format=sci} +\pgfmathparse{4.22e-8^-2}\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-4} +\pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed} +\pgfmathparse{sqrt(1e-12)}\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-5} +\pgfkeys{/pgf/fpu=false} +\begingroup +\pgfkeys{/pgf/fpu/install only={divide}} +\pgfmathparse{12.34/0.001234}\pgfmathresult (good) +\pgfmathparse{12/4}\pgfmathresult (bad) +\endgroup +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-6} +\pgfmathfloatparsenumber{2} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-7} +\pgfmathfloatparsenumber{0} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-8} +\pgfmathfloatparsenumber{0.2} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-9} +\pgfmathfloatparsenumber{42} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-10} +\pgfmathfloatparsenumber{20.5E+2} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-11} +\pgfmathfloatparsenumber{1e6} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-12} +\pgfmathfloatparsenumber{5.21513e-11} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-13} +\pgfmathfloatparsenumber{0.00052} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E +$\to$ +\pgfmathfloattofixed{\pgfmathresult} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-14} +\pgfmathfloatparsenumber{123.456e4} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E +$\to$ +\pgfmathfloattofixed{\pgfmathresult} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-15} +\pgfmathfloatparsenumber{123456} +\pgfmathfloattoint{\pgfmathresult} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-16} +\pgfmathfloatcreate{1}{1.0}{327} +\pgfmathfloattomacro{\pgfmathresult}{\F}{\M}{\E} +Flags: \F; Mantissa \M; Exponent \E +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-17} +\pgfmathfloatparsenumber{42} +\pgfmathfloatifflags{\pgfmathresult}{0}{It's zero!}{It's not zero!} +\pgfmathfloatifflags{\pgfmathresult}{1}{It's positive!}{It's not positive!} +\pgfmathfloatifflags{\pgfmathresult}{2}{It's negative!}{It's not negative!} + +\pgfmathfloatifflags{\pgfmathresult}{+}{It's positive!}{It's not positive!} +\pgfmathfloatifflags{\pgfmathresult}{-}{It's negative!}{It's not negative!} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-18} +\pgfmathroundto{1} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-19} +\pgfmathroundto{4.685} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-20} +\pgfmathroundto{19999.9996} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-21} +\pgfmathroundtozerofill{1} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-22} +\pgfmathroundto{4.685} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-23} +\pgfmathroundtozerofill{19999.9996} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-24} +\pgfmathfloatparsenumber{52.5864} +\pgfmathfloatround{\pgfmathresult} +\pgfmathfloattosci{\pgfmathresult} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-25} +\pgfmathfloatparsenumber{9.995} +\pgfmathfloatround{\pgfmathresult} +\pgfmathfloattosci{\pgfmathresult} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-26} +\pgfmathfloatparsenumber{52.5864} +\pgfmathfloatroundzerofill{\pgfmathresult} +\pgfmathfloattosci{\pgfmathresult} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-27} +\pgfmathfloatparsenumber{9.995} +\pgfmathfloatroundzerofill{\pgfmathresult} +\pgfmathfloattosci{\pgfmathresult} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-28} +\pgfmathlog{1.452e-7} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-fpu-29} +\pgfmathlog{6.426e+8} +\pgfmathresult +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-lsystems.lvt b/testfiles/pgfmanual-en-library-lsystems.lvt new file mode 100644 index 000000000..2e9548766 --- /dev/null +++ b/testfiles/pgfmanual-en-library-lsystems.lvt @@ -0,0 +1,82 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{lindenmayersystems} +\usetikzlibrary{lindenmayersystems} +\usetikzlibrary{lindenmayersystems} +\usetikzlibrary{lindenmayersystems} +\usetikzlibrary{lindenmayersystems} +\usetikzlibrary{lindenmayersystems} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-lsystems-1} +\expandafter\let\csname pgf@lsystem@Koch curve\endcsname=\relax +\begin{tikzpicture} +\pgfdeclarelindenmayersystem{Koch curve}{ + \rule{F -> F-F++F-F} +} + +\shadedraw [top color=white, bottom color=blue!50, draw=blue!50!black] + [l-system={Koch curve, step=2pt, angle=60, axiom=F++F++F, order=3}] + lindenmayer system -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-lsystems-2} +\begin{tikzpicture} +\draw [green!50!black, rotate=90] + [l-system={rule set={F -> FF-[-F+F]+[+F-F]}, axiom=F, order=4, step=2pt, + randomize step percent=25, angle=30, randomize angle percent=5}] + lindenmayer system; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-lsystems-3} +\nullfont\expandafter\let\csname pgf@lsystem@Hilbert curve\endcsname=\relax +\pgfdeclarelindenmayersystem{Hilbert curve}{ + \symbol{X}{\pgflsystemdrawforward} + \symbol{+}{\pgflsystemturnright} % Explicitly define + and - symbols. + \symbol{-}{\pgflsystemturnleft} + \rule{A -> +BX-AXA-XB+} + \rule{B -> -AX+BXB+XA-} +} +\tikz\draw[lindenmayer system={Hilbert curve, axiom=A, order=4, angle=90}] + lindenmayer system; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-lsystems-4} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \pgfset{lindenmayer system/.cd, angle=60, step=2pt} + \foreach \x/\y in {0cm/1cm, 1.5cm/1.5cm, 2.5cm/0.5cm, 1cm/0cm}{ + \pgftransformshift{\pgfqpoint{\x}{\y}} + \pgfpathmoveto{\pgfpointorigin} + \pgflindenmayersystem{Koch curve}{F++F++F}{2} + \pgfusepath{stroke} + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-lsystems-8} +\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}]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-lsystems-9} +\begin{tikzpicture}[l-system={step=1.75pt, order=5, angle=60}] + \pgfdeclarelindenmayersystem{Sierpinski triangle}{ + \symbol{X}{\pgflsystemdrawforward} + \symbol{Y}{\pgflsystemdrawforward} + \rule{X -> Y-X-Y} + \rule{Y -> X+Y+X} + } + \draw [help lines] grid (3,2); + \draw [red] (0,0) l-system + [l-system={Sierpinski triangle, axiom=+++X, anchor=south west}]; + \draw [blue] (3,2) l-system + [l-system={Sierpinski triangle, axiom=X, anchor=north east}]; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-math.lvt b/testfiles/pgfmanual-en-library-math.lvt new file mode 100644 index 000000000..49ee792f9 --- /dev/null +++ b/testfiles/pgfmanual-en-library-math.lvt @@ -0,0 +1,225 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{math} +\usetikzlibrary{math} +\usetikzlibrary{math} +\usetikzlibrary{math} +\usetikzlibrary{math} +\usetikzlibrary{math} +\usetikzlibrary{math} +\usetikzlibrary{math} +\usetikzlibrary{math} +\usetikzlibrary{math} +\usetikzlibrary{math} +\usetikzlibrary{math} +\usetikzlibrary{math} +\usetikzlibrary{math} +\usetikzlibrary{math} +\usetikzlibrary{math} +\usetikzlibrary{math} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-math-1} +\tikzmath{ + % Adapted from http://www.cs.northwestern.edu/academics/courses/110/html/fib_rec.html + function fibonacci(\n) { + if \n == 0 then { + return 0; + } else { + return fibonacci2(\n, 0, 1); + }; + }; + function fibonacci2(\n, \p, \q) { + if \n == 1 then { + return \q; + } else { + return fibonacci2(\n-1, \q, \p+\q); + }; + }; + int \f, \i; + for \i in {0,1,...,20} { + \f = fibonacci(\i); + print {\f, }; + }; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-2} +\tikz[x=0.25cm,y=0.25cm, + evaluate={ + int \i, \j; + for \i in {0,...,10} { + for \j in {0,...,10} { + \a{\i,\j} = (\i+\j)*5; + }; + }; + } +] +\foreach \i in {0,...,10} + \foreach \j in {0,...,10} + \fill [red!\a{\i,\j}!yellow] (\i,\j) rectangle ++(1, 1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-3} +\newcount\mycount +\newdimen\mydimen +\tikzmath{ + \a = 4*5+6; + \b = sin(30)*4; + \mycount = log10(2048) / log10(2); + \mydimen = 15^2; +} +\a, \b, \the\mycount, \the\mydimen +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-4} +\tikzmath{ + \x1 = 3+4; \x2 = 30+40; \x3 = 300+400; +} +\x1, \x2, \x3 +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-5} +\tikzmath{ + \c{air} = 340; \c{water} = 1435; \c{steel} = 6100; +} +\foreach \medium in {air,steel}{The speed of sound in \medium\ is \c{\medium} m/s. } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-6} +\tikzmath{ + let \x = (5*4)+1; + let \c1 = blue; +} +\x, ``\c1'' +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-7} +\tikzmath{ + integer \x; + \x1 = 3+4; \x2 = 30+40; \x3 = 300+400; +} +\x1, \x2, \x3 +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-8} +\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$}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-9} +\tikzmath{ + coordinate \c; + \c = (45:10pt); +} +\tikz\draw (0,0) -- (\c); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-10} +\tikzmath{ + coordinate \c, \d; + \c = (-1,2)+(1,-1); + \d = (4,1)-(2,-1); +} +\tikz\draw (\c) -- (\d); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-11} +\tikzmath{ + coordinate \c; + \c1 = (30:20pt); + \c2 = (210:20pt); +} +\tikz\draw (\cx1,\cy1) -- (\cx2,\cy1) -- (\cx2,\cy2) -- (\cx1,\cy2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-12} +\pgfmathsetseed{1} +\tikzmath{ + int \x, \v; + \v=1; + for \x in {1,...,{random(3,10)}} { + \v=\v*2; + }; + print {$x=\x, v=\v$}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-13} +\tikzmath{ + int \x, \y; + \y = 0; + for \x1 in {1,...,5} { + for \x2 in {10,20,...,50} { + \y = \y+\x1*\x2; + }; + }; +} +$x_1=\x1, x_2=\x2, y=\y$ +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-14} +\begin{tikzpicture} + \tikzmath{ + int \x; + for \k in {0,10,...,350} { + if \k>260 then { let \c = orange; } else { + if \k>170 then { let \c = blue; } else { + if \k>80 then { let \c = red; } else { + let \c = green; }; }; }; + { + \path [fill=\c!50, draw=\c] (\k:0.5cm) -- (\k:1cm) -- + (\k+5:1cm) -- (\k+5:0.5cm) -- cycle; + }; + }; + } + \end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-15} +\pgfmathsetseed{1} +\tikzmath{ + function product(\x,\y) { + return \x*\y; + }; + int \i, \j, \k; + \i = random(1,10); + \j = random(20, 40); + \k = product(\i, \j); + print { $\i\times \j = \k$ }; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-16} +\pgfmathsetseed{1} +\tikzmath{ + int \x, \y, \z; + \x = random(2, 5); + for \y in {0,...,6} { + \z = \x^\y; + print {$\x^\y=\z$, }; + }; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-math-17} +\begin{tikzpicture} +\draw [help lines] grid (3,2); +\tikzmath{ + coordinate \c; + for \x in {0,10,...,360} { + \c = (1.5cm, 1cm) + (\x:1cm and 0.5cm); + { \fill (\c) circle [radius=1pt]; }; + }; +} +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-matrices.lvt b/testfiles/pgfmanual-en-library-matrices.lvt new file mode 100644 index 000000000..9cb5be091 --- /dev/null +++ b/testfiles/pgfmanual-en-library-matrices.lvt @@ -0,0 +1,175 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{matrix} +\usetikzlibrary{matrix} +\usetikzlibrary{matrix} +\usetikzlibrary{matrix} +\usetikzlibrary{matrix} +\usetikzlibrary{matrix} +\usetikzlibrary{matrix} +\usetikzlibrary{matrix} +\usetikzlibrary{matrix} +\usetikzlibrary{matrix} +\usetikzlibrary{matrix} +\usetikzlibrary{matrix} +\usetikzlibrary{matrix} +\usetikzlibrary{matrix} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-matrices-1} +\begin{tikzpicture} + \matrix (magic) [matrix of nodes] + { + 8 & 1 & 6 \\ + 3 & 5 & 7 \\ + 4 & 9 & 2 \\ + }; + + \draw[thick,red,->] (magic-1-1) |- (magic-2-3); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-matrices-2} +\begin{tikzpicture}[row 2 column 3/.style=red] + \matrix [matrix of nodes] + { + 8 & 1 & 6 \\ + 3 & 5 & 7 \\ + 4 & 9 & 2 \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-matrices-3} +\begin{tikzpicture} + \matrix [matrix of nodes] + { + 8 & 1 & 6 \\ + 3 & 5 & |[red]| 7 \\ + 4 & 9 & 2 \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-matrices-4} +\begin{tikzpicture} + \matrix [matrix of nodes] + { + 8 &[1cm] 1 &[3mm] |[red]| 6 \\ + 3 & 5 & |[red]| 7 \\ + 4 & 9 & 2 \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-matrices-5} +\begin{tikzpicture} + \matrix [matrix of nodes] + { + 8 & 1 & 6 \\ + 3 & 5 & \node[red]{7}; \draw(0,0) circle(10pt);\\ + 4 & 9 & 2 \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-matrices-6} +\begin{tikzpicture} + \matrix [matrix of math nodes] + { + a_8 & a_1 & a_6 \\ + a_3 & a_5 & |[red]| a_7 \\ + a_4 & a_9 & a_2 \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-matrices-7} +\begin{tikzpicture} + \matrix [matrix of math nodes,nodes={circle,draw}] + { + a_8 & & a_6 \\ + a_3 & & a_7 \\ + a_4 & a_9 & \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-matrices-8} +\begin{tikzpicture} + \matrix [matrix of math nodes,nodes={circle,draw},nodes in empty cells] + { + a_8 & & a_6 \\ + a_3 & & a_7 \\ + a_4 & a_9 & \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-matrices-10} +\begin{tikzpicture} + \matrix [matrix of nodes,nodes={text width=16mm,draw}] + { + row 1 & upper line \\ lower line \\ + row 2 & hmm \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-matrices-11} +\begin{tikzpicture} + \matrix [matrix of nodes,nodes={text width=16mm,draw}] + { + row 1 & {upper line \\ lower line} \\ + row 2 & hmm \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-matrices-12} +\begin{tikzpicture} + \matrix [matrix of math nodes,left delimiter=(,right delimiter=\}] + { + a_8 & a_1 & a_6 \\ + a_3 & a_5 & a_7 \\ + a_4 & a_9 & a_2 \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-matrices-13} +\begin{tikzpicture} + \node [fill=red!20,left delimiter=(,right delimiter=\}] + {$\displaystyle\int_0^1 x\,dx$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-matrices-14} +\begin{tikzpicture} + [every left delimiter/.style={red,xshift=1ex}, + every right delimiter/.style={xshift=-1ex}] + \matrix [matrix of math nodes,left delimiter=(,right delimiter=\}] + { + a_8 & a_1 & a_6 \\ + a_3 & a_5 & a_7 \\ + a_4 & a_9 & a_2 \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-matrices-15} +\begin{tikzpicture} + \matrix [matrix of math nodes,% + left delimiter=\|,right delimiter=\rmoustache,% + above delimiter=(,below delimiter=\}] + { + a_8 & a_1 & a_6 \\ + a_3 & a_5 & a_7 \\ + a_4 & a_9 & a_2 \\ + }; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-mindmaps.lvt b/testfiles/pgfmanual-en-library-mindmaps.lvt new file mode 100644 index 000000000..e452b1610 --- /dev/null +++ b/testfiles/pgfmanual-en-library-mindmaps.lvt @@ -0,0 +1,187 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap} +\usetikzlibrary{backgrounds,mindmap} +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-1} +\tikz[mindmap,concept color=red!50] + \node [concept] {Root concept} + child[grow=right] {node[concept] {Child concept}}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-2} +\tikz[large mindmap,concept color=red!50] + \node [concept] {Root concept} + child[grow=right] {node[concept] {Child concept}}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-3} +\tikz[mindmap,concept color=red!50] \node [concept] {Some concept}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-4} +\begin{tikzpicture}[mindmap,concept color=blue!80] + \node [concept] {Root concept}; + \node [extra concept] at (10,0) {extra concept}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-5} +\tikz + [root concept/.append style={concept color=blue!80,minimum size=3.5cm}, + mindmap] + \node [concept] {Root concept}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-6} +\tikz + [root concept/.append style={concept color=blue!80}, + level 1 concept/.append style={concept color=red!50}, + mindmap] + \node [concept] {Root concept} + child[grow=30] {node[concept] {child}} + child[grow=0 ] {node[concept] {child}}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-7} +\tikz[mindmap,concept color=blue!80] + \node [concept] {Root concept} + child[concept color=red,grow=30] {node[concept] {Child concept}} + child[concept color=orange,grow=0] {node[concept] {Child concept}}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-8} +\tikz[mindmap,text=white, + root concept/.style={concept color=blue}, + level 1 concept/.append style= + {every child/.style={concept color=blue!50}}] + \node [concept] {Root concept} + child[grow=30] {node[concept] {child}} + child[grow=0 ] {node[concept] {child}}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-9} +\begin{tikzpicture} + [root concept/.append style={concept color=blue!20,minimum size=2cm}, + level 1 concept/.append style={sibling angle=45}, + mindmap] + \node [concept] {Root concept} + [clockwise from=45] + child { node[concept] (c1) {child}} + child { node[concept] (c2) {child}} + child { node[concept] (c3) {child}}; + \begin{pgfonlayer}{background} + \draw [concept connection] (c1) edge (c2) + edge (c3) + (c2) edge (c3); + \end{pgfonlayer} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-10} +\begin{tikzpicture} + [decoration={start radius=1cm,end radius=.5cm,amplitude=2mm,angle=30}] + \fill[blue!20] (0,0) circle (1cm); + \fill[red!20] (2.5,0) circle (.5cm); + + \filldraw [draw=red,fill=black, + decorate,decoration=circle connection bar] (1,0) -- (2,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-11} +\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 [decorate,decoration=circle connection bar] (1,0) -- (2,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-12} +\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 [decorate,decoration=circle connection bar] (1,0) -- (1.9,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-13} +\begin{tikzpicture}[concept color=blue!50,blue!50,outer sep=0pt] + \node (n1) at (0,0) [circle,minimum size=2cm,fill,draw,thick] {}; + \node (n2) at (2.5,0) [circle,minimum size=1cm,fill,draw,thick] {}; + + \path (n1) to[circle connection bar] (n2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-14} +\begin{tikzpicture}[outer sep=0pt] + \node (n1) at (0,0) [circle,minimum size=2cm,fill,draw,thick,red] {}; + \node (n2) at (30:2.5) [circle,minimum size=1cm,fill,draw,thick,blue] {}; + + \path (n1) to[circle connection bar switch color=from (red) to (blue)] (n2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-15} +\begin{tikzpicture} + \path[mindmap,concept color=black,text=white] + node[concept] {Computer Science} + [clockwise from=0] + % note that `sibling angle' can only be defined in + % `level 1 concept/.append style={}' + child[concept color=green!50!black] { + node[concept] {practical} + [clockwise from=90] + child { node[concept] {algorithms} } + child { node[concept] {data structures} } + child { node[concept] {pro\-gramming languages} } + child { node[concept] {software engineer\-ing} } + } + % note that the `concept color' is passed to the `child'(!) + child[concept color=blue] { + node[concept] {applied} + [clockwise from=-30] + child { node[concept] {databases} } + child { node[concept] {WWW} } + } + child[concept color=red] { node[concept] {technical} } + child[concept color=orange] { node[concept] {theoretical} }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-mindmaps-16} +\begin{tikzpicture} + [mindmap,concept color=blue!80, + every annotation/.style={fill=red!20}] + \node [concept] (root) {Root concept}; + + \node [annotation,right] at (root.east) + {The root concept is, in general, the most important concept.}; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-patterns.lvt b/testfiles/pgfmanual-en-library-patterns.lvt new file mode 100644 index 000000000..1f59a6873 --- /dev/null +++ b/testfiles/pgfmanual-en-library-patterns.lvt @@ -0,0 +1,218 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{patterns.meta} +\usetikzlibrary{patterns,patterns.meta} +\usetikzlibrary{patterns,patterns.meta} +\usetikzlibrary{patterns,patterns.meta} +\usetikzlibrary{patterns,patterns.meta} +\usetikzlibrary{patterns.meta} +\usetikzlibrary{patterns.meta} +\usetikzlibrary{patterns.meta} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-patterns-1} +\pgfdeclarepattern{ + name=hatch, + parameters={\hatchsize,\hatchangle,\hatchlinewidth}, + bottom left={\pgfpoint{-.1pt}{-.1pt}}, + top right={\pgfpoint{\hatchsize+.1pt}{\hatchsize+.1pt}}, + tile size={\pgfpoint{\hatchsize}{\hatchsize}}, + tile transformation={\pgftransformrotate{\hatchangle}}, + code={ + \pgfsetlinewidth{\hatchlinewidth} + \pgfpathmoveto{\pgfpoint{-.1pt}{-.1pt}} + \pgfpathlineto{\pgfpoint{\hatchsize+.1pt}{\hatchsize+.1pt}} + \pgfpathmoveto{\pgfpoint{-.1pt}{\hatchsize+.1pt}} + \pgfpathlineto{\pgfpoint{\hatchsize+.1pt}{-.1pt}} + \pgfusepath{stroke} + } +} + +\tikzset{ + hatch size/.store in=\hatchsize, + hatch angle/.store in=\hatchangle, + hatch line width/.store in=\hatchlinewidth, + hatch size=5pt, + hatch angle=0pt, + hatch line width=.5pt, +} + +\begin{tikzpicture} +\foreach \r in {1,...,4} + \draw [pattern=hatch, pattern color=red] + (\r*3,0) rectangle ++(2,2); + +\foreach \r in {1,...,4} + \draw [pattern=hatch, pattern color=green, hatch size=2pt] + (\r*3,3) rectangle ++(2,2); + +\foreach \r in {1,...,4} + \draw [pattern=hatch, pattern color=blue, hatch size=10pt, hatch angle=21] + (\r*3,6) rectangle ++(2,2); + +\foreach \r in {1,...,4} + \draw [pattern=hatch, pattern color=orange, hatch line width=2pt] + (\r*3,9) rectangle ++(2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-patterns-2} +\begin{tikzpicture} + \draw[pattern={horizontal lines},pattern color=orange] + (0,0) rectangle +(1,1); + \draw[pattern={Lines[yshift=.5pt]},pattern color=blue] + (0,0) rectangle +(1,1); + + \draw[pattern={vertical lines},pattern color=orange] + (1,0) rectangle +(1,1); + \draw[pattern={Lines[angle=90,yshift=-.5pt]},pattern color=blue] + (1,0) rectangle +(1,1); + + \draw[pattern={north east lines},pattern color=orange] + (0,1) rectangle +(1,1); + \draw[pattern={Lines[angle=45,distance={3pt/sqrt(2)}]},pattern color=blue] + (0,1) rectangle +(1,1); + + \draw[pattern={north west lines},pattern color=orange] + (1,1) rectangle +(1,1); + \draw[pattern={Lines[angle=-45,distance={3pt/sqrt(2)}]},pattern color=blue] + (1,1) rectangle +(1,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-patterns-3} +\begin{tikzpicture} + \draw[pattern={grid},pattern color=orange] + (0,0) rectangle +(1,1); + \draw[pattern={Hatch},pattern color=blue] + (0,0) rectangle +(1,1); + + \draw[pattern={crosshatch},pattern color=orange] + (1,0) rectangle +(1,1); + \draw[pattern={Hatch[angle=45,distance={3pt/sqrt(2)},xshift=.1pt]}, + pattern color=blue] (1,0) rectangle +(1,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-patterns-4} +\begin{tikzpicture} + \draw[pattern={dots},pattern color=orange] + (0,0) rectangle +(1,1); + \draw[pattern={Dots},pattern color=blue] + (0,0) rectangle +(1,1); + + \draw[pattern={crosshatch dots},pattern color=orange] + (1,0) rectangle +(1,1); + \draw[pattern={Dots[angle=45,distance={3pt/sqrt(2)}]}, + pattern color=blue] (1,0) rectangle +(1,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-patterns-5} +\begin{tikzpicture} + \draw[pattern={fivepointed stars},pattern color=orange] + (0,0) rectangle +(1,1); + \draw[pattern={Stars},pattern color=blue] + (0,0) rectangle +(1,1); + + \draw[pattern={sixpointed stars},pattern color=orange] + (1,0) rectangle +(1,1); + \draw[pattern={Stars[points=6]},pattern color=blue] + (1,0) rectangle +(1,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-patterns-6} +\tikzdeclarepattern{ + name=flower, + type=colored, + bottom left={(-.1pt,-.1pt)}, + top right={(10.1pt,10.1pt)}, + tile size={(10pt,10pt)}, + code={ + \tikzset{x=1pt,y=1pt} + \path [draw=green] (5,2.5) -- (5, 7.5); + \foreach \i in {0,60,...,300} + \path [fill=pink, shift={(5,7.5)}, rotate=-\i] + (0,0) .. controls ++(120:4) and ++(60:4) .. (0,0); + \path [fill=red] (5,7.5) circle [radius=1]; + \foreach \i in {-45,45} + \path [fill=green, shift={(5,2.5)}, rotate=-\i] + (0,0) .. controls ++(120:4) and ++(60:4) .. (0,0); + } +} + +\tikz\draw [pattern=flower] circle [radius=1]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-patterns-7} +\tikzdeclarepattern{ + name=mystars, + type=uncolored, + bounding box={(-5pt,-5pt) and (5pt,5pt)}, + tile size={(\tikztilesize,\tikztilesize)}, + parameters={\tikzstarpoints,\tikzstarradius,\tikzstarrotate,\tikztilesize}, + tile transformation={rotate=\tikzstarrotate}, + defaults={ + points/.store in=\tikzstarpoints,points=5, + radius/.store in=\tikzstarradius,radius=3pt, + rotate/.store in=\tikzstarrotate,rotate=0, + tile size/.store in=\tikztilesize,tile size=10pt, + }, + code={ + \pgfmathparse{180/\tikzstarpoints}\let\a=\pgfmathresult + \fill (90:\tikzstarradius) \foreach \i in {1,...,\tikzstarpoints}{ + -- (90+2*\i*\a-\a:\tikzstarradius/2) -- (90+2*\i*\a:\tikzstarradius) + } -- cycle; + } +} + +\begin{tikzpicture} + \draw[pattern=mystars,pattern color=blue] (0,0) rectangle +(2,2); + \draw[pattern={mystars[points=7,tile size=15pt]}] (2,0) rectangle +(2,2); + \draw[pattern={mystars[rotate=45]},pattern color=red] (0,2) rectangle +(2,2); + \draw[pattern={mystars[rotate=30,points=4,radius=5pt]}] (2,2) rectangle +(2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-patterns-8} +\tikzdeclarepattern{ + name=mylines, + parameters={ + \pgfkeysvalueof{/pgf/pattern keys/size}, + \pgfkeysvalueof{/pgf/pattern keys/angle}, + \pgfkeysvalueof{/pgf/pattern keys/line width}, + }, + bounding box={ + (0,-0.5*\pgfkeysvalueof{/pgf/pattern keys/line width}) and + (\pgfkeysvalueof{/pgf/pattern keys/size}, + 0.5*\pgfkeysvalueof{/pgf/pattern keys/line width})}, + tile size={(\pgfkeysvalueof{/pgf/pattern keys/size}, + \pgfkeysvalueof{/pgf/pattern keys/size})}, + tile transformation={rotate=\pgfkeysvalueof{/pgf/pattern keys/angle}}, + defaults={ + size/.initial=5pt, + angle/.initial=45, + line width/.initial=.4pt, + }, + code={ + \draw [line width=\pgfkeysvalueof{/pgf/pattern keys/line width}] + (0,0) -- (\pgfkeysvalueof{/pgf/pattern keys/size},0); + }, +} + +\begin{tikzpicture} + \draw[pattern={mylines[size=10pt,line width=.8pt,angle=10]}, + pattern color=red] (0,0) rectangle ++(2,2); + \draw[pattern={mylines[size= 5pt,line width=.8pt,angle=40]}, + pattern color=blue] (2,0) rectangle ++(2,2); + \draw[pattern={mylines[size=10pt,line width=.4pt,angle=90]}, + pattern color=green] (0,2) rectangle ++(2,2); + \draw[pattern={mylines[size= 2pt,line width= 1pt,angle=70]}, + pattern color=orange] (2,2) rectangle ++(2,2); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-perspective.lvt b/testfiles/pgfmanual-en-library-perspective.lvt new file mode 100644 index 000000000..317cab94f --- /dev/null +++ b/testfiles/pgfmanual-en-library-perspective.lvt @@ -0,0 +1,286 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{perspective} +\usetikzlibrary{perspective} +\usetikzlibrary{perspective} +\usetikzlibrary{perspective} +\usetikzlibrary{perspective} +\usetikzlibrary{perspective} +\usetikzlibrary{perspective} +\usetikzlibrary{perspective} +\usetikzlibrary{perspective} +\usetikzlibrary{perspective} +\usetikzlibrary{perspective} +\usetikzlibrary{perspective} +\usetikzlibrary{perspective} +\usetikzlibrary{perspective} +\usetikzlibrary{perspective} + +\begin{document} + +\newcommand\simplecuboid[3]{% + \fill[gray!80!white] (tpp cs:x=0,y=0,z=#3) + -- (tpp cs:x=0,y=#2,z=#3) + -- (tpp cs:x=#1,y=#2,z=#3) + -- (tpp cs:x=#1,y=0,z=#3) -- cycle; + \fill[gray] (tpp cs:x=0,y=0,z=0) + -- (tpp cs:x=0,y=0,z=#3) + -- (tpp cs:x=0,y=#2,z=#3) + -- (tpp cs:x=0,y=#2,z=0) -- cycle; + \fill[gray!50!white] (tpp cs:x=0,y=0,z=0) + -- (tpp cs:x=0,y=0,z=#3) + -- (tpp cs:x=#1,y=0,z=#3) + -- (tpp cs:x=#1,y=0,z=0) -- cycle;} + +\newcommand{\simpleaxes}[3]{% + \draw[->] (-0.5,0,0) -- (#1,0,0) node[pos=1.1]{x}; + \draw[->] (0,-0.5,0) -- (0,#2,0) node[pos=1.1]{y}; + \draw[->] (0,0,-0.5) -- (0,0,#3) node[pos=1.1]{z};} + +\BEGINBOXTEST{pgfmanual-en-library-perspective-1} +\begin{tikzpicture}[3d view] + \draw[->] (-1,0,0) -- (1,0,0) node[pos=1.1]{x}; + \draw[->] (0,-1,0) -- (0,1,0) node[pos=1.1]{y}; + \draw[->] (0,0,-1) -- (0,0,1) node[pos=1.1]{z}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-perspective-2} +\begin{tikzpicture}[isometric view] + \draw[->] (-1,0,0) -- (1,0,0) node[pos=1.1]{x}; + \draw[->] (0,-1,0) -- (0,1,0) node[pos=1.1]{y}; + \draw[->] (0,0,-1) -- (0,0,1) node[pos=1.1]{z}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-perspective-3} +\newcommand\simplecuboid[3]{% + \fill[gray!80!white] (tpp cs:x=0,y=0,z=#3) + -- (tpp cs:x=0,y=#2,z=#3) + -- (tpp cs:x=#1,y=#2,z=#3) + -- (tpp cs:x=#1,y=0,z=#3) -- cycle; + \fill[gray] (tpp cs:x=0,y=0,z=0) + -- (tpp cs:x=0,y=0,z=#3) + -- (tpp cs:x=0,y=#2,z=#3) + -- (tpp cs:x=0,y=#2,z=0) -- cycle; + \fill[gray!50!white] (tpp cs:x=0,y=0,z=0) + -- (tpp cs:x=0,y=0,z=#3) + -- (tpp cs:x=#1,y=0,z=#3) + -- (tpp cs:x=#1,y=0,z=0) -- cycle;} +\newcommand{\simpleaxes}[3]{% + \draw[->] (-0.5,0,0) -- (#1,0,0) node[pos=1.1]{x}; + \draw[->] (0,-0.5,0) -- (0,#2,0) node[pos=1.1]{y}; + \draw[->] (0,0,-0.5) -- (0,0,#3) node[pos=1.1]{z};} + +\begin{tikzpicture}[3d view] + \simplecuboid{2}{2}{2} + \simpleaxes{2}{2}{2} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-perspective-5} +\begin{tikzpicture}[3d view,perspective] + \simplecuboid{2}{2}{2} + \simpleaxes{2}{2}{2} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-perspective-6} +\begin{tikzpicture}[ + 3d view, + perspective={ + p = {(5,0,0)}}] + \simplecuboid{2}{2}{2} + \simpleaxes{2}{2}{2} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-perspective-7} +\begin{tikzpicture}[ + 3d view, + perspective={ + p = {(5,0,1)}}] + \simplecuboid{2}{2}{2} + \simpleaxes{2}{2}{2} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-perspective-8} +\begin{tikzpicture}[ + 3d view, + perspective={ + p = {(5,1,0)}}] + \simplecuboid{2}{2}{2} + \simpleaxes{2}{2}{2} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-perspective-9} +\begin{tikzpicture}[ + 3d view, + perspective={ + p = {(5,1,1)}}] + \simplecuboid{2}{2}{2} + \simpleaxes{2}{2}{2} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-perspective-10} +\begin{tikzpicture}[ + 3d view, + perspective={ + q = {(0,5,0)}}] + \simplecuboid{2}{2}{2} + \simpleaxes{2}{2}{2} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-perspective-11} +\begin{tikzpicture}[ + 3d view, + perspective={ + r = {(0,0,5)}}] + \simplecuboid{2}{2}{2} + \simpleaxes{2}{2}{2} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-perspective-12} +\begin{tikzpicture}[ + isometric view, + perspective={ + p = {(8,0,0)}, + q = {(0,8,0)}, + r = {(0,0,-8)}}] + + \simplecuboid{2}{2}{2} + +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-perspective-13} +\begin{tikzpicture}[ + isometric view, + perspective={ + p = {(4,0,0)}, + q = {(0,4,0)}}] + + \node[fill=red,circle,inner sep=1.5pt,label=above:p] at (4,0,0){}; + + \foreach \i in {0,...,100}{ + \filldraw[fill = gray] (tpp cs:x=\i,y=0,z=0) + -- (tpp cs:x=\i+0.5,y=0,z=0) + -- (tpp cs:x=\i+0.5,y=2,z=0) + -- (tpp cs:x=\i,y=2,z=0) + -- cycle;} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-perspective-14} +\begin{tikzpicture}[ + scale=0.7, + 3d view, + perspective={ + p = {(20,0,0)}, + q = {(0,20,0)}}] + + \filldraw[fill=brown] (tpp cs:x=0,y=0,z=0) + -- (tpp cs:x=0,y=4,z=0) + -- (tpp cs:x=0,y=4,z=2) + -- (tpp cs:x=0,y=2,z=4) + -- (tpp cs:x=0,y=0,z=2) -- cycle; + \filldraw[fill=red!70!black] (tpp cs:x=0,y=0,z=2) + -- (tpp cs:x=5,y=0,z=2) + -- (tpp cs:x=5,y=2,z=4) + -- (tpp cs:x=0,y=2,z=4) -- cycle; + \filldraw[fill=brown!80!white] (tpp cs:x=0,y=0,z=0) + -- (tpp cs:x=0,y=0,z=2) + -- (tpp cs:x=5,y=0,z=2) + -- (tpp cs:x=5,y=0,z=0) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-perspective-15} +\begin{tikzpicture}[ + 3d view, + perspective={ + p = {(2,0,0)}, + q = {(0,2,0)}, + r = {(0,0,2)}}, + scale=4, + vanishing point/.style={fill,circle,inner sep=2pt}] + + \simplecuboid{3}{1}{2} + + \node[vanishing point,label = right:p] (p) at (2,0,0){}; + \node[vanishing point,label = left:q] (q) at (0,2,0){}; + \node[vanishing point,label = above:r] (r) at (0,0,2){}; + + \begin{scope}[dotted] + \foreach \y in {0,1}{ + \foreach \z in {0,2}{ + \draw (tpp cs:x=0,y=\y,z=\z) -- (p.center);}} + \foreach \x in {0,3}{ + \foreach \z in {0,2}{ + \draw (tpp cs:x=\x,y=0,z=\z) -- (q.center);}} + \foreach \x in {0,3}{ + \foreach \y in {0,1}{ + \draw (tpp cs:x=\x,y=\y,z=0) -- (r.center);}} + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-perspective-16} +\begin{tikzpicture}[ + cycle of vertices/.style 2 args={ + insert path={ + foreach \i [count=\j,evaluate=\j as \k using + {ifthenelse(\j==1,"","-- "}] in {#2}{\k (vert-#1-\i)} -- cycle}}, + scale=0.7, + line join=round, + bottom/.style={draw=white!50!black,fill=white!40!black}, + front/.style={draw=white!50!black,fill=black}, + side/.style={draw=white!50!black,fill=white!80!black}, +] + \begin{scope}[ + 3d view={-20}{0}, + perspective={ + p = {(20,0,0)}, + q = {(0,20,0)}, + r = {(5,1,50)}, + }] + \path foreach \x/\y/\z [count=\i] in { + 3.5/2.0/0.0,3.5/2.0/4.0,6.0/2.0/4.0,6.5/2.0/3.5,6.5/2.0/0.5,6.0/2.0/0.0, + 4.5/2.0/1.0,4.5/2.0/3.0,5.5/2.0/3.0,5.5/2.0/1.0,3.5/0.0/0.0,3.5/0.0/4.0, + 6.0/0.0/4.0,6.5/0.0/3.5,6.5/0.0/0.5,6.0/0.0/0.0,4.5/0.0/1.0,4.5/0.0/3.0, + 5.5/0.0/3.0,5.5/0.0/1.0% + }{(tpp cs:x=\x,y=\y,z=\z) coordinate[name=vert-D-\i]}; + \filldraw[front,cycle of vertices={D}{1,...,6}, + cycle of vertices={D}{7,10,9,8}]; + \filldraw[side,cycle of vertices={D}{10,9,19,20}]; + \filldraw[bottom,cycle of vertices={D}{8,9,19,18}]; + \filldraw[front,cycle of vertices={D}{11,...,16}, + cycle of vertices={D}{17,20,19,18}]; + \filldraw[side,cycle of vertices={D}{1,2,12,11}]; + % '3' + \path foreach \x/\y/\z [count=\i] in { + 0.0/2.0/0.0,0.0/2.0/1.0,2.0/2.0/1.0,2.0/2.0/1.5,0.0/2.0/1.5,0.0/2.0/2.5, + 2.0/2.0/2.5,2.0/2.0/3.0,0.0/2.0/3.0,0.0/2.0/4.0,3.0/2.0/4.0,3.0/2.0/0.0, + 0.0/0.0/0.0,0.0/0.0/1.0,2.0/0.0/1.0,2.0/0.0/1.5,0.0/0.0/1.5,0.0/0.0/2.5, + 2.0/0.0/2.5,2.0/0.0/3.0,0.0/0.0/3.0,0.0/0.0/4.0,3.0/0.0/4.0,3.0/0.0/0.0% + }{(tpp cs:x=\x,y=\y,z=\z) coordinate[name=vert-3-\i]}; + \filldraw[front,cycle of vertices={3}{1,...,12}]; + \filldraw[side,cycle of vertices={3}{3,4,16,15}]; + \filldraw[side,cycle of vertices={3}{7,8,20,19}]; + \filldraw[side,cycle of vertices={3}{1,2,14,13}]; + \filldraw[side,cycle of vertices={3}{5,6,18,17}]; + \filldraw[side,cycle of vertices={3}{9,10,22,21}]; + \filldraw[bottom,cycle of vertices={3}{4,5,17,16}]; + \filldraw[bottom,cycle of vertices={3}{8,9,21,20}]; + \filldraw[front,cycle of vertices={3}{13,...,24}]; + \end{scope} +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-petri.lvt b/testfiles/pgfmanual-en-library-petri.lvt new file mode 100644 index 000000000..47c6f4ed0 --- /dev/null +++ b/testfiles/pgfmanual-en-library-petri.lvt @@ -0,0 +1,177 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{petri,positioning} +\usetikzlibrary{petri,positioning} +\usetikzlibrary{petri,positioning} +\usetikzlibrary{petri,positioning} +\usetikzlibrary{petri} +\usetikzlibrary{petri} +\usetikzlibrary{petri} +\usetikzlibrary{petri} +\usetikzlibrary{petri} +\usetikzlibrary{petri} +\usetikzlibrary{petri} +\usetikzlibrary{petri} +\usetikzlibrary{petri} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-petri-1} +\begin{tikzpicture} + \node[place,label=above:$p_1$,tokens=2] (p1) {}; + \node[place,label=below:$p_2\ge1$,right=of p1] (p2) {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-petri-2} +\begin{tikzpicture} + [every place/.style={draw=blue,fill=blue!20,thick,minimum size=9mm}] + \node[place,tokens=7,label=above:$p_1$] (p1) {}; + \node[place,structured tokens={3,2,9}, + label=below:$p_2\ge1$,right=of p1] (p2) {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-petri-3} +\begin{tikzpicture} + \node[place,tokens=2,label=above:$p_1$] (p1) {}; + \node[place,label=above:$p_2\ge1$,right=of p1] (p2) {}; + + \node[transition,below right=of p1,label=below:$t_1$] {} + edge[pre] (p1) + edge[post] node[auto] {2} (p2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-petri-4} +\begin{tikzpicture} + \node[place,label=above:$p_1$] (p1) {}; + \node[token] at (p1) {}; + + \node[place,label=above:$p_2$,right=of p1] (p2) {}; + \node[token] at (p2) {$y$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-petri-5} +\begin{tikzpicture} + \node[place,label=above:$p_1$] {} + [children are tokens] + child {node [token] {1}} + child {node [token] {2}} + child {node [token] {3}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-petri-6} +\begin{tikzpicture} + \node[place,label=above:$p_2$] {} + [children are tokens] + child {node [token] {1}} + child {node [token,fill=red] {2}} + child {node [token,fill=red] {2}} + child {node [token] {1}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-petri-7} +\begin{tikzpicture} + \node[place,label=above:$p_3$] {} + [children are tokens,token distance=1.1ex] + child {node [token] {}} + child {node [token,red] {}} + child {node [token,blue] {}} + child {node [token] {}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-petri-8} +\tikz + \node[place] {} + [children are tokens] + child {node [token] {}} + child {node [token] {}} + child {node [token] {}}; +\tikz + \node[place,tokens=3] {}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-petri-9} +\begin{tikzpicture}[every place/.style={minimum size=9mm}] + + \foreach \x/\y/\tokennumber in {0/2/1,1/2/2,2/2/3, + 0/1/4,1/1/5,2/1/6, + 0/0/7,1/0/8,2/0/9} + \node [place,tokens=\tokennumber] at (\x,\y) {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-petri-10} +\tikz \node[place,colored tokens={black,black,red,blue}] {}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-petri-11} +\tikz \node[place,structured tokens={$x$,$y$,$z$}] {}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-petri-12} +\begin{tikzpicture}[every place/.style={minimum size=9mm}] + + \foreach \x/\y/\tokennumber in {0/2/1,1/2/2,2/2/3, + 0/1/4,1/1/5,2/1/6, + 0/0/7,1/0/8,2/0/9} + \node [place,structured tokens={1,...,\tokennumber}] at (\x,\y) {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-petri-13} +\begin{tikzpicture}[yscale=-1.6,xscale=1.5,thick, + every transition/.style={draw=red,fill=red!20,minimum size=3mm}, + every place/.style={draw=blue,fill=blue!20,minimum size=6mm}] + + \foreach \i in {1,...,6} { + \node[place,label=left:$p_\i$] (p\i) at (0,\i) {}; + \node[place,label=right:$q_\i$] (q\i) at (8,\i) {}; + } + \foreach \name/\var/\vala/\valb/\height/\x in + {m1/m_1/f/t/2.25/3,m2/m_2/f/t/2.25/5,h/\mathit{hold}/1/2/4.5/4} { + \node[place,label=above:{$\var = \vala$}] (\name\vala) at (\x,\height) {}; + \node[place,yshift=-8mm,label=below:{$\var = \valb$}] (\name\valb) at (\x,\height) {}; + } + \node[token] at (p1) {}; \node[token] at (q1) {}; + \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) + 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) + 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) + 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) + 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) + edge [post] (q6) edge [post] (m2f); + \node[transition] at (6.5,6.5) {} edge [pre] (q6) edge [post] (q1.south west); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-plot-handlers.lvt b/testfiles/pgfmanual-en-library-plot-handlers.lvt new file mode 100644 index 000000000..a0fbca507 --- /dev/null +++ b/testfiles/pgfmanual-en-library-plot-handlers.lvt @@ -0,0 +1,325 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-1} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlercurveto + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-2} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfsetplottension{0.75} + \pgfplothandlercurveto + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-3} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerclosedcurve + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-4} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerconstantlineto + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-5} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerconstantlinetomarkright + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-6} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerconstantlinetomarkmid + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-7} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerjumpmarkleft + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-8} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerjumpmarkright + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-9} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerjumpmarkmid + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-10} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerxcomb + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-11} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerycomb + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-12} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerpolarcomb + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-15} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerybar + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-16} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlerxbar + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-17} +\begin{tikzpicture} + \draw[gray] (0,2) node {$x_1$} (1,1) node {$x_2$} (2,.5) node {$x_3$} (4,0.7) node {$x_4$}; + \pgfplothandlerybarinterval + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{2cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreampoint{\pgfpoint{4cm}{0.7cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-18} +\begin{tikzpicture}[bar interval width=0.5] + \draw[gray] + (0,3) -- (0,-0.1) + (1,3) -- (1,-0.1) + (2,3) -- (2,-0.1) + (4,3) -- (4,-0.1); + \pgfplothandlerybarinterval + \begin{scope}[bar interval shift=0.25,fill=blue] + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{2cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreampoint{\pgfpoint{4cm}{0.7cm}} + \pgfplotstreamend + \pgfusepath{fill} + \end{scope} + \begin{scope}[bar interval shift=0.75,fill=red] + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{3cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{0.2cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.7cm}} + \pgfplotstreampoint{\pgfpoint{4cm}{0.2cm}} + \pgfplotstreamend + \pgfusepath{fill} + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-19} +\begin{tikzpicture} + \pgfplothandlergaplineto + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-20} +\begin{tikzpicture} + \pgfplothandlergapcycle + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-21} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlermark{\pgfpathcircle{\pgfpointorigin}{4pt}\pgfusepath{stroke}} + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-22} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlermarklisted + {\pgfpathcircle{\pgfpointorigin}{4pt}\pgfusepath{stroke}} + {1,3} + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-23} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfplothandlermark{\pgfuseplotmark{pentagon}} + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-24} +\pgfdeclareplotmark{my plot mark} + {\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 + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-plot-handlers-25} +\begin{tikzpicture} + \draw[gray] (0,0) node {x} (1,1) node {y} (2,.5) node {z}; + \pgfsetplotmarksize{1ex} + \pgfplothandlermark{\pgfuseplotmark{*}} + \pgfplotstreamstart + \pgfplotstreampoint{\pgfpoint{0cm}{0cm}} + \pgfplotstreampoint{\pgfpoint{1cm}{1cm}} + \pgfplotstreampoint{\pgfpoint{2cm}{0.5cm}} + \pgfplotstreamend + \pgfusepath{stroke} +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-rdf.lvt b/testfiles/pgfmanual-en-library-rdf.lvt new file mode 100644 index 000000000..f49bd426f --- /dev/null +++ b/testfiles/pgfmanual-en-library-rdf.lvt @@ -0,0 +1,189 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{graphs,rdf} +\usetikzlibrary{graphs,rdf} + +\begin{document} + +\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$} } } +\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 } } } +} + +\BEGINBOXTEST{pgfmanual-en-library-rdf-15} +\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] + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-rdf-25} +\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] + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-rdf-26} + + + + + + + + + + + + + + + + ... + + + + + + + + ... + + + + + + + + + + ... + + + + + + + + + + ... + + + + + + + + + ... + + + + + + + + + + + ... + + +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-shadings.lvt b/testfiles/pgfmanual-en-library-shadings.lvt new file mode 100644 index 000000000..534c3b83f --- /dev/null +++ b/testfiles/pgfmanual-en-library-shadings.lvt @@ -0,0 +1,73 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usepgflibrary{shadings} +\usepgflibrary{shadings} +\usepgflibrary{shadings} +\usepgflibrary{shadings} +\usepgflibrary{shadings} +\usepgflibrary{shadings} +\usepgflibrary{shadings} +\usepgflibrary{shadings} +\usepgflibrary{shadings} +\usepgflibrary{shadings} +\usepgflibrary{shadings} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-shadings-1} +\tikz \draw[top color=red] (0,0) rectangle (2,1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadings-2} +\tikz \draw[top color=white,bottom color=black,middle color=red] + (0,0) rectangle (2,1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadings-3} +\begin{tikzpicture} + \shade[ball color=white] (0,0) circle (2ex); + \shade[ball color=red] (1,0) circle (2ex); + \shade[ball color=black] (2,0) circle (2ex); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadings-4} +\tikz + \shade[upper left=red,upper right=green, + lower left=blue,lower right=yellow] + (0,0) rectangle (3,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadings-5} +\tikz \shade[shading=color wheel] (0,0) circle (1.5); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadings-6} +\tikz \shade[shading=color wheel] [even odd rule] + (0,0) circle (1.5) + (0,0) circle (1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadings-7} +\tikz \shade[shading=color wheel black center] (0,0) circle (1.5); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadings-8} +\tikz \shade[shading=color wheel white center] (0,0) circle (1.5); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadings-9} +\tikz \shade[shading=Mandelbrot set] (0,0) rectangle (2,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadings-10} +\tikz \draw[inner color=red] (0,0) rectangle (2,1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadings-11} +\tikz \draw[outer color=red,inner color=white] + (0,0) rectangle (2,1); +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-shadows.lvt b/testfiles/pgfmanual-en-library-shadows.lvt new file mode 100644 index 000000000..06a2bdb5d --- /dev/null +++ b/testfiles/pgfmanual-en-library-shadows.lvt @@ -0,0 +1,145 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{shadows} +\usetikzlibrary{shadows} +\usetikzlibrary{shadows} +\usetikzlibrary{shadows} +\usetikzlibrary{shadows,shapes.symbols} +\usetikzlibrary{shadows} +\usetikzlibrary{shadows} +\usetikzlibrary{shadows,shapes.symbols} +\usetikzlibrary{shadows,shapes.symbols} +\usetikzlibrary{shadows} +\usetikzlibrary{shadows} +\usetikzlibrary{shadows} +\usetikzlibrary{shadows} +\usetikzlibrary{shadows} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-shadows-1} +\tikz [even odd rule] + \draw [general shadow={fill=red}] (0,0) circle (.5) (0.5,0) circle (.5); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadows-2} +\tikz [even odd rule] + \draw [general shadow={fill=red,shadow scale=1.25}] + (0,0) circle (.5) (0.5,0) circle (.5); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadows-3} +\tikz [even odd rule] + \draw [general shadow={fill=red,shadow xshift=-5pt}] + (0,0) circle (.5) (0.5,0) circle (.5); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadows-5} +\tikz [even odd rule] + \filldraw [drop shadow,fill=white] (0,0) circle (.5) (0.5,0) circle (.5); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadows-6} +\begin{tikzpicture} + \foreach \i in {1,...,4} + \node[starburst,drop shadow,fill=white,draw] at (0,\i) {Burst \i}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadows-7} +\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); + + \filldraw [drop shadow={opacity=0.25},fill=white] + (1,.5) circle (.5) (1.5,.5) circle (.5); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadows-8} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadows-10} +\begin{tikzpicture} + \node [copy shadow,fill=blue!20,draw=blue,thick] {Hello World!}; + + \node at (0,-1) [copy shadow={shadow xshift=1ex,shadow yshift=1ex}, + fill=blue!20,draw=blue,thick] + {Hello World!}; + + \node at (0,-2) [copy shadow={opacity=.5},tape, + fill=blue!20,draw=blue,thick] + {Hello World!}; + + % We have to repeat the left color since shadings are not + % automatically applied to shadows + \node at (0,-3) [copy shadow={left color=blue!50}, + left color=blue!50,draw=blue,thick] + {Hello World!}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadows-11} +\begin{tikzpicture} + \node [double copy shadow,fill=blue!20,draw=blue,thick] {Hello World!}; + + \node at (0,-1) [double copy shadow={shadow xshift=1ex,shadow yshift=1ex}, + fill=blue!20,draw=blue,thick] + {Hello World!}; + + \node at (0,-2) [double copy shadow={opacity=.5},tape, + fill=blue!20,draw=blue,thick] + {Hello World!}; + + \node at (0,-3) [double copy shadow={left color=blue!50}, + left color=blue!50,draw=blue,thick] + {Hello World!}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadows-13} +\begin{tikzpicture} + \foreach \i in {1,...,8} + \node[circle,circular drop shadow,draw=blue,fill=blue!20,thick] + at (\i*45:1) {Circle \i}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadows-15} +\begin{tikzpicture} + \foreach \i in {1,...,8} + \node[circle,circular glow,fill=red!20,draw=red,thick] + at (\i*45:1) {Circle \i}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadows-16} +\begin{tikzpicture} + \foreach \i in {1,...,8} + \node[circle,circular glow={fill=white},fill=red!20,draw=red,thick] + at (\i*45:1) {Circle \i}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadows-17} +\begin{tikzpicture} + \foreach \i in {1,...,8} + \node[circle,circular glow={fill=green},fill=black,text=green!50!black] + at (\i*45:1) {Circle \i}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shadows-18} +\begin{tikzpicture} + \foreach \i in {1,...,8} + \node[circle,circular glow={fill=red!\i0}] + at (\i*45:1) {Circle \i}; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-shapes.lvt b/testfiles/pgfmanual-en-library-shapes.lvt new file mode 100644 index 000000000..dee8387ac --- /dev/null +++ b/testfiles/pgfmanual-en-library-shapes.lvt @@ -0,0 +1,1233 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.arrows} +\usetikzlibrary{shapes.arrows} +\usetikzlibrary{shapes.arrows} +\usetikzlibrary{shapes.arrows} +\usetikzlibrary{shapes.arrows} +\usetikzlibrary{shapes.arrows} +\usetikzlibrary{shapes.arrows} +\usetikzlibrary{shapes.arrows} +\usetikzlibrary{shapes.arrows} +\usetikzlibrary{shapes.arrows} +\usetikzlibrary{shapes.arrows} +\usetikzlibrary{shapes.arrows} +\usetikzlibrary{shapes.multipart} +\usetikzlibrary{shapes.multipart} +\usetikzlibrary{shapes.multipart} +\usetikzlibrary{shapes.multipart} +\usetikzlibrary{shapes.multipart} +\usetikzlibrary{shapes.multipart} +\usetikzlibrary{shapes.multipart} +\usetikzlibrary{shapes.multipart} +\usetikzlibrary{shapes.multipart} +\usetikzlibrary{shapes.multipart} +\usetikzlibrary{shapes.multipart} +\usetikzlibrary{shapes.multipart} +\usetikzlibrary{shapes.callouts} +\usetikzlibrary{shapes.callouts} +\usetikzlibrary{shapes.callouts} +\usetikzlibrary{shapes.callouts} +\usetikzlibrary{shapes.callouts} +\usetikzlibrary{shapes.misc} +\usetikzlibrary{shapes.misc} +\usetikzlibrary{shapes.misc} +\usetikzlibrary{shapes.misc} +\usetikzlibrary{shapes.misc} +\usetikzlibrary{shapes.misc} +\usetikzlibrary{shapes.misc} +\usetikzlibrary{shapes.misc} +\usetikzlibrary{shapes.misc} +\usetikzlibrary{shapes.misc} +\usetikzlibrary{shapes.misc} +\usetikzlibrary{shapes.misc} +\usetikzlibrary{shapes.misc} + +\begin{document} + +\tikzset{ + shape example/.style= {color = black!30, + draw, + fill = yellow!30, + line width = .5cm, + inner xsep = 2.5cm, + inner ysep = 0.5cm} +} + +\BEGINBOXTEST{pgfmanual-en-library-shapes-2} +\Huge +\begin{tikzpicture} + \node[name=s,shape=circle,shape example] {Circle\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {north west/above left, north/above, north east/above right, + west/left, center/above, east/right, + mid west/right, mid/above, mid east/left, + base west/left, base/below, base east/right, + south west/below left, south/below, south east/below right, + text/left, 10/right, 130/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-3} +\Huge +\begin{tikzpicture} + \node[name=s,shape=rectangle,shape example] {Rectangle\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {north west/above left, north/above, north east/above right, + west/left, center/above, east/right, + mid west/right, mid/above, mid east/left, + base west/left, base/below, base east/right, + south west/below left, south/below, south east/below right, + text/left, 10/right, 130/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-4} +\Huge +\begin{tikzpicture} + \node[name=s,shape=diamond,shape example] {Diamond\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {north west/above left, north/above, north east/above right, + west/left, center/above, east/right, + mid/above, + base/below, + south west/below left, south/below, south east/below right, + text/left, 10/right, 130/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-5} +\Huge +\begin{tikzpicture} + \node[name=s,shape=ellipse,shape example] {Ellipse\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {north west/above left, north/above, north east/above right, + west/left, center/above, east/right, + mid west/right, mid/above, mid east/left, + base west/left, base/below, base east/right, + south west/below left, south/below, south east/below right, + text/left, 10/right, 130/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-6} +\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}; + \node[trapezium left angle=120, trapezium right angle=60] + at (0,0) {C}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-7} +\begin{tikzpicture}[>=stealth, every node/.style={text=black}, + shape border uses incircle, shape border rotate=60] + \node [trapezium, fill=gray!25, minimum width=2cm] (t) {}; + \draw [red, <->] (t.bottom left corner) -- (t.bottom right corner) + node [midway, below right] {width}; + \draw [red, <->] (t.top side) -- (t.bottom side) + node [at start, above] {height}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-8} +\tikzset{my node/.style={trapezium, fill=#1!20, draw=#1!75, text=black}} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \node [my node=red] {A}; + \node [my node=green, minimum height=1.5cm] at (1, 1.25) {B}; + \node [my node=blue, minimum width=1.5cm] at (2, 0) {C}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-9} +\tikzset{my node/.style={trapezium, fill=#1!20, draw=#1!75, text=black}} +\begin{tikzpicture} +\tikzset{trapezium stretches=true} + \draw [help lines] grid (3,2); + \node [my node=red] {A}; + \node [my node=green, minimum height=1.5cm] at (1, 1.25) {B}; + \node [my node=blue, minimum width=1.5cm] at (2, 0) {C}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-10} +\tikzset{my node/.style={trapezium, fill=#1!20, draw=#1!75, text=black}} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \node [my node=red] at (1.5,.25) {A}; + \node [my node=green, minimum width=3cm, trapezium stretches] + at (1.5,1) {B}; + \node [my node=blue, minimum width=3cm, trapezium stretches body] + at (1.5,1.75) {C}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-11} +\Huge +\begin{tikzpicture} + \node[name=s, shape=trapezium, shape example, inner sep=1cm] + {Trapezium\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {bottom left corner/below, top right corner/right, + top left corner/left, bottom right corner/below, + bottom side/below, left side/left, + right side/right, top side/above, + center/above, text/below, mid/right, base/below, + mid west/right, base west/below, mid east/left, base east/below, + west/above, east/above, north/below, south/above, + north west/above, north east/above, + south west/below, south east/below, 160/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-12} +\Huge +\begin{tikzpicture} + \node[name=s,shape=semicircle,shape border rotate=0,shape example, inner sep=1cm] + {Semicircle\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {apex/above, arc start/below, arc end/below, chord center/below, + center/above, base/below, mid/right, text/left, + base west/below, base east/below, mid west/left, mid east/right, + north/below, south/above, east/above, west/above, + north west/above left, north east/above right, + south west/below, south east/below, 30/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-13} +\begin{tikzpicture} + \foreach \a in {3,...,7}{ + \draw[red, dashed] (\a*2,0) circle(0.5cm); + \node[regular polygon, regular polygon sides=\a, draw, + inner sep=0.3535cm] at (\a*2,0) {}; + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-14} +\begin{tikzpicture} + \foreach \a in {3,...,7}{ + \draw[blue, dashed] (\a*2,0) circle(0.5cm); + \node[regular polygon, regular polygon sides=\a, minimum size=1cm, draw] at (\a*2,0) {}; + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-15} +\Huge +\begin{tikzpicture} + \node[name=s, shape=regular polygon, shape example, inner sep=.5cm] + {Regular Polygon\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {corner 1/above, corner 2/above, corner 3/left, corner 4/right, corner 5/above, + side 1/above, side 2/left, side 3/below, side 4/right, side 5/above, + 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} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-16} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (2,2); + \draw [blue, dashed] (1,1) circle(1cm); + \draw [red, dashed] (1,1) circle(.5cm); + \node [star, star point height=.5cm, minimum size=2cm, draw] + at (1,1) {S}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-17} +\Huge +\begin{tikzpicture} + \node[name=s, shape=star, star points=5, star point ratio=1.65, shape example, inner sep=1.5cm] + {Star\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {inner point 1/above, inner point 2/above, inner point 3/below, inner point 4/right, + inner point 5/above, outer point 1/above, outer point 2/above, outer point 3/left, + 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} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-18} +\begin{tikzpicture}[>=stealth, every node/.style={text=black}, + shape border uses incircle, shape border rotate=-30] + \node [isosceles triangle, fill=gray!25, minimum width=1.5cm] (t) {}; + \draw [red, <->] (t.left corner) -- (t.right corner) + node [midway, above left] {width}; + \draw [red, <->] (t.apex) -- (t.lower side) + node [midway, above right] {height}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-19} +\begin{tikzpicture}[paint/.style={draw=#1!75, fill=#1!20}] + \tikzset{every node/.style={isosceles triangle, draw, inner sep=0pt, + anchor=left corner, shape border rotate=90}} + \draw[help lines] grid(4,2); + \foreach \a/\c in {1.5/blue, 1/green, 0.5/red}{ + \node[paint=\c, minimum height=\a cm] at (0,0) {}; + \node[paint=\c, minimum width=\a cm] at (2,0) {}; + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-20} +\begin{tikzpicture}[paint/.style={draw=#1!75, fill=#1!20}] + \tikzset{every node/.style={isosceles triangle, draw, inner sep=0pt, + anchor=south, shape border rotate=90, isosceles triangle stretches}} + \draw[help lines] grid(4,2); + \foreach \a/\c in {1.5/blue, 1/green, 0.5/red}{ + \node[paint=\c, minimum height=\a cm, minimum width=1.5cm] at (0.75,0) {}; + \node[paint=\c, minimum width=\a cm, minimum height=1.5cm] at (3,0) {}; + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-21} +\Huge +\begin{tikzpicture} + \node[name=s, shape=isosceles triangle, shape example, inner xsep=1cm] + {Isosceles Triangle\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {apex/above, left corner/right, right corner/right, + left side/above, right side/below, lower side/right, + center/above, text/right, 150/above, + mid/right, mid west/above, mid east/right, + base/below, base west/below, base east/below, + west/above, east/below, north/below, south/above, + north west/below, north east/below, + south west/above, south east/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-22} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-23} +\Huge +\begin{tikzpicture} + \node[name=s, shape=kite, shape example, inner sep=1.5cm] + {Kite\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {upper vertex/above, left vertex/above, lower vertex/below, + right vertex/above, upper left side/above, upper right side/above, + lower left side/below, lower right side/below, + center/above, text/left, mid/right, base/below, + mid west/left, base west/below, mid east/right, base east/below, + west/above, east/above, north/below, south/above, + north west/left, north east/right, + south west/above, south east/above, 110/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-24} +\begin{tikzpicture} + \node[dart, draw, gray, shape border uses incircle, shape border rotate=45] + (d) {dart}; + \draw [<->] (d.tip)++(202.5:.5cm) arc(202.5:247.5:.5cm); + \node [left=.5cm] at (d.tip) {tip angle}; + \draw [<->] (d.tail center)++(157.5:.5cm) arc(157.5:292.5:.5cm); + \node [right] at (d.tail center) {tail angle}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-25} +\Huge +\begin{tikzpicture} + \node[name=s, shape=dart, shape border rotate=90, shape example, inner sep=1.25cm] + {Dart\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {tip/above, tail center/below, right tail/below, + left tail/below, right tail/below, left side/left, right side/right, + center/above, text/left, mid/right, base/below, + mid west/left, base west/below, mid east/right, base east/below, + west/above, east/above, north/below, south/above, + north west/left, north east/right, south west/above, south east/above, + 110/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-26} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-27} +\Huge +\begin{tikzpicture} + \node[name=s,shape=circular sector, style=shape example, inner sep=1cm] + {Circular Sector\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {sector center/above, arc start/below, arc end/below, arc center/below, + center/above, base/below, mid/right, text/below, + north/below, south/above, east/below, west/above, + north west/above left, north east/above right, + south west/below, south east/below, 30/right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-28} +\begin{tikzpicture} + \node[cylinder, draw, shape aspect=.5] {ABC}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-29} +\begin{tikzpicture}[>=stealth] + \node [cylinder, gray!50, rotate=30, draw, + minimum height=2cm, minimum width=1cm] (c) {Cylinder}; + \draw[red, <->] (c.top) -- (c.bottom) + node [at end, below, black] {height}; + \draw[red, <->] (c.north) -- (c.south) + node [at start, above, black] {width}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-30} +\begin{tikzpicture}[shape aspect=.5] + \tikzset{every node/.style={cylinder, shape border rotate=90, draw}} + \node [minimum height=1.5cm] {A}; + \node [minimum width=1.5cm] at (1.5,0) {B}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-31} +\begin{tikzpicture}[] + \tikzset{every node/.style={cylinder, shape border rotate=90, draw}} + \node [aspect=1.0] {A}; + \node [aspect=0.5] at (1,0) {B}; + \node [aspect=0.25] at (2,0) {C}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-32} +\begin{tikzpicture}[aspect=0.5] + \node [cylinder, cylinder uses custom fill, cylinder end fill=red!50, + cylinder body fill=red!25] {Cylinder}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-33} +\Huge +\begin{tikzpicture} + \node[name=s, shape=cylinder, shape example, aspect=.5, inner xsep=3cm, + inner ysep=1cm] {Cylinder\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {before top/above, top/above, after top/below, + before bottom/below, bottom/above, after bottom/above, + mid/right, mid west/right, mid east/left, + base/below, base west/below, base east/below, + center/above, text/above, shape center/right, + west/right, east/left, north/above, south/below, + north west/below, north east/above, + south west/above, south east/below, 160/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-34} +\begin{tikzpicture} + \node [correct forbidden sign,line width=1ex,draw=red,fill=white] {Smoking}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-35} +\begin{tikzpicture} + \node [forbidden sign,line width=1ex,draw=red,fill=white] {Smoking}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-36} +\begin{tikzpicture} + \node [magnifying glass,line width=1ex,draw] {huge}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-37} +\begin{tikzpicture} + \node[cloud, draw, fill=gray!20, aspect=2] {ABC}; + \node[cloud, draw, fill=gray!20] at (1.5,0) {D}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-38} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-39} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \draw [blue, dashed] (1.5, 1) ellipse (1.5cm and 1cm); + \node [cloud, cloud puffs=9, draw, minimum width=3cm, minimum height=2cm] + at (1.5, 1) {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-40} +\Huge +\begin{tikzpicture} + \node[name=s, shape=cloud, style=shape example, cloud puffs=11, aspect=1.5, + cloud puff arc=120,inner ysep=1cm] {Cloud\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {puff 1/above, puff 2/above, puff 3/above, puff 4/below, + puff 5/left, puff 6/below, puff 7/below, puff 8/right, + puff 9/below, puff 10/above, puff 11/above, 70/right, + center/above, base/below, mid/right, text/left, + north/below, south/below, east/above, west/above, + north west/left, north east/right, + south west/below, south east/below} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-41} +\begin{tikzpicture} + \node[starburst, fill=yellow, draw=red, line width=2pt] {\bf BANG!}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-42} +\begin{tikzpicture} + \draw[help lines] grid(3,2); + \node[starburst, draw, minimum width=3cm, minimum height=2cm] + at (1.5, 1) {\bf BOOM!}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-43} +\Huge +\begin{tikzpicture} + \node[name=s, shape=starburst, starburst points=9, starburst point height=3.5cm, + style=shape example,inner sep=1cm] + {Starburst\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {outer point 1/above, outer point 2/above, outer point 3/right, + outer point 4/above, outer point 5/below, outer point 6/above, + outer point 7/left, outer point 8/above, outer point 9/above, + inner point 1/below, inner point 2/above, inner point 3/left, + inner point 4/above, inner point 5/above, inner point 6/above, + inner point 7/below, inner point 8/above, inner point 9/below, + center/above, text/left, mid/right, base/below, 80/above, + north/below, south/below, east/left, west/right, + north east/below, south west/below, south east/below, north west/below} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-44} +\begin{tikzpicture} + [every node/.style={signal, draw, text=white, signal to=nowhere}] + \node[fill=green!65!black, signal to=east] at (0,1) {To East}; + \node[fill=red!65!black, signal from=east] at (0,0) {From East}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-45} +\Huge +\begin{tikzpicture} + \node[name=s, shape=signal, signal from=west, shape example, inner sep=2cm] + {Signal\vrule width1pt height2cm}; + \foreach \anchor/\placement in + {text/left, center/above, 70/above, + base/below, base east/below, base west/below, + mid/right, mid east/above left, mid west/above left, + north/above, south/below, + east/above, west/above, + north west/above, north east/above, + south west/below, south east/below} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-46} +\begin{tikzpicture} + \node[tape, draw]{ABCD}; + \node[tape, draw, tape bend top=none] at (1.5, 0) {EFGH}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-47} +\begin{tikzpicture}[-stealth] + \node[tape, draw, gray, minimum width=2cm](t){Tape}; + \draw [blue]([yshift=5pt] t.north west) -- ([yshift=5pt]t.north east) + node[midway, above, black]{in and out}; + \draw [blue]([yshift=-5pt]t.south east) -- ([yshift=-5pt]t.south west) + node[sloped, allow upside down, midway, above, black]{in and out}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-48} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-49} +\begin{tikzpicture}[>=stealth] + \draw [help lines] grid(3,2); + \node [tape, fill, minimum size=2cm, red!50, tape bend top=none, + tape bend height=1cm] at (1.5,1.5) (t) {}; + \draw [|<->|, blue] (1.5,0) -- (1.5,1) + node [at end, above, black]{tape bend height}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-50} +\Huge +\begin{tikzpicture} + \node[name=s, shape=tape, tape bend height=1cm, shape example, inner xsep=3cm] + {Tape\vrule width1pt height2cm}; + \foreach \anchor/\placement in + {text/left, center/above, 60/above, + base/below, base east/below, base west/below, + mid/right, mid east/left, mid west/right, + north/above, south/below, east/above, west/above, + north west/above, north east/above, + south west/below, south east/below} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-51} +\tikz\node [magnetic tape, draw] (A) {A}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-52} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-53} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-54} +\Huge +\begin{tikzpicture} +\node[name=s,shape=magnetic tape,shape example,inner sep=0.75cm, +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, + west/left, center/above, east/right, + mid west/right, mid/right, mid east/left, + base west/below, base/below, base east/right, + south west/below left, south/below, south east/left, + text/left, 10/right, 130/above, + tail east/right, tail south east/below, tail north east/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-55} +\begin{tikzpicture}[every node/.style={single arrow, draw}, + rotate border/.style={shape border uses incircle, shape border rotate=#1}] + \node {right}; + \node at (2,0) [shape border rotate=90]{up}; + \node at (1,1) [rotate border=37, inner sep=0pt]{$37^\circ$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-56} +\begin{tikzpicture}[>=stealth, + rotate border/.style={shape border uses incircle, shape border rotate=#1}] + \node[rotate border=-30, fill=gray!25, minimum height=3cm, single arrow, + single arrow head extend=.5cm, single arrow head indent=.25cm] (arrow) {}; + \draw[red, <->] (arrow.before tip) -- (arrow.after tip) + node [near end, left, black] {width}; + \draw[red, <->] (arrow.tip) -- (arrow.tail) + node [near end, below left, black] {height}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-57} +\begin{tikzpicture} + \node[single arrow, draw, single arrow head extend=.5cm, gray!50, rotate=60] + (a) {Arrow}; + \draw[red, |<->|] (a.before tip) -- (a.before head) + node [midway, below, sloped, black] {head extend}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-58} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-59} +\Huge +\begin{tikzpicture} + \node[name=s,shape=single arrow, shape example, single arrow head extend=1.5cm] + {Single Arrow\vrule width1pt height2cm}; + \foreach \anchor/\placement in + {text/above, center/above, 20/above, + mid west/left, mid/above, mid east/above left, + base west/below, base/below, base east/below, + tip/above, before tip/above, after tip/below, before head/above, + after head/below, after tail/above, before tail/below, tail/right, + north/above, south/below, east/below, west/above, + north west/above, north east/below, south west/below, south east/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-60} +\begin{tikzpicture}[every node/.style={double arrow, draw}] + \node [double arrow, draw] {Left or Right}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-61} +\begin{tikzpicture}[>=stealth, + rotate border/.style={shape border uses incircle, shape border rotate=#1}] + \node[rotate border=210, fill=gray!25, minimum height=3cm, double arrow, + double arrow head extend=.5cm, double arrow head indent=.25cm] (arrow) {}; + \draw[red, <->] (arrow.before tip 1) -- (arrow.after tip 1) + node [near start, right, black] {width}; + \draw[red, <->] (arrow.tip 1) -- (arrow.tip 2) + node [near end, above left, black] {height}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-62} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-63} +\Huge +\begin{tikzpicture} + \node[name=s,shape=double arrow, double arrow head extend=1.5cm, shape example, inner xsep=2cm] + {Double Arrow\vrule width1pt height2cm}; + \foreach \anchor/\placement in + {text/above, center/above, 20/above, + mid west/above right, mid/above, mid east/above left, + base west/below, base/below, base east/below, + before head 1/above, before tip 1/above, tip 1/above, after tip 1/below, after head 1/below, + before head 2/above, before tip 2/below, tip 2/above, after tip 2/above, after head 2/below, + north/above, south/below, east/below, west/below, + north west/below, north east/below, south west/above, south east/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-64} +\begin{tikzpicture} + \node[arrow box, draw] {A}; + \node[arrow box, draw, arrow box arrows={north:.5cm, west:0.75cm}] + at (2,0) {B}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-65} +\begin{tikzpicture} + \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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-66} +\Huge +\begin{tikzpicture} + \node[shape=arrow box, shape example, inner xsep=1cm, inner ysep=1.5cm, arrow box shaft width=2cm, + arrow box arrows={north:3.5cm from border, south, east:5cm from border, west}, + arrow box head extend=0.75cm, rotate=-90](s) {Arrow Box\vrule width1pt height2cm}; + \foreach \anchor/\placement in + {center/above, text/above, mid/right, base/below, 75/above, + mid east/right, mid west/left, base east/right, base west/left, + north/below, south/below, east/below, west/below, + north east/above, south east/above, south west/below, north west/below, + north arrow tip/above,south arrow tip/above, east arrow tip/above, west arrow tip/above, + before north arrow/above, before north arrow head/below left, before north arrow tip/above left, + after north arrow tip/above right, after north arrow head/below right, after north arrow/below, + before south arrow/below, before south arrow head/above right, before south arrow tip/below right, + after south arrow tip/below left, after south arrow head/above left, after south arrow/above, + before east arrow/above, before east arrow head/above right, before east arrow tip/above, + after east arrow tip/below, after east arrow head/below right, after east arrow/below, + before west arrow/below, before west arrow head/below left, before west arrow tip/below, + after west arrow tip/above, after west arrow head/above left, after west arrow/below} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement, rotate=-90] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-67} +\begin{tikzpicture} + \node [circle split,draw,double,fill=red!20] + { + $q_1$ + \nodepart{lower} + $00$ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-68} +\Huge +\begin{tikzpicture} + \node[name=s,shape=circle split,shape example] {text\nodepart{lower}lower}; + \foreach \anchor/\placement in + {north west/above left, north/above, north east/above right, + west/left, center/below, east/right, + mid west/right, mid/above, mid east/left, + base west/left, base/below, base east/right, + south west/below left, south/below, south east/below right, + text/left, lower/left, 130/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-69} +\begin{tikzpicture} + \node [circle solidus,draw,double,fill=red!20] + { + $q_1$ + \nodepart{lower} + $00$ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-70} +\Huge +\begin{tikzpicture} + \node[name=s,shape=circle solidus,shape example,inner xsep=1cm] {text\nodepart{lower}lower}; + \foreach \anchor/\placement in + {north west/above left, north/above, north east/above right, + west/left, center/below, east/right, + mid west/right, mid/above, mid east/left, + base west/left, base/below, base east/right, + south west/below left, south/below, south east/below right, + text/left, lower/left, 130/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-71} +\Huge +\begin{tikzpicture} + \node[name=s,shape=ellipse split,shape example] {text\nodepart{lower}lower}; + \foreach \anchor/\placement in + {center/below, text/left, lower/left, 60/above right, + mid/above, mid east/above, mid west/above, + base/right, base east/left, base west/right, + north/above, south/below, east/below, west/below, + north east/above, south east/below, south west/below, north west/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-72} +\begin{tikzpicture}[my shape/.style={ + rectangle split, rectangle split parts=#1, draw, anchor=center}] + \node [my shape=5] at (0,1) + {a\nodepart{two}b\nodepart{three}c\nodepart{four}d\nodepart{five}e}; + \node [my shape=5, rectangle split horizontal] at (2,2) + {1\nodepart{two}2\nodepart{three}3\nodepart{four}4\nodepart{five}5}; + \node [my shape=3] at (3,0.5) + {A\nodepart{two}B\nodepart{three}C}; + \node [my shape=4, rectangle split horizontal] at (1.5,0.5) + {1\nodepart{two}2\nodepart{three}3\nodepart{four}4}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-73} +\begin{tikzpicture}[every text node part/.style={align=center}] + \node[rectangle split, rectangle split parts=3, draw, text width=2.75cm] + {Student + \nodepart{two} + age:int \\ + name:String + \nodepart{three} + getAge():int \\ + getName():String}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-74} +\begin{tikzpicture}[every node/.style={draw, anchor=text, rectangle split, + rectangle split parts=3}] + \node {text \nodepart{second} \nodepart{third}third}; + \node [rectangle split ignore empty parts] at (2,0) + {text \nodepart{second} \nodepart{third}third}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-75} +\def\x{one \nodepart{two} 2 \nodepart{three} three \nodepart{four} 4} +\begin{tikzpicture}[ + every node/.style={rectangle split, rectangle split parts=4, + draw} + ] + \node[rectangle split part align={center, left, right}] at (0,0) {\x}; + \node[rectangle split part align={center, left}] at (1.25,0) {\x}; + \node[rectangle split part align={center}] at (2.5,0) {\x}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-76} +\def\x{\Large w\nodepart{two}x\nodepart{three}\Huge y\nodepart{four}\tiny z} +\begin{tikzpicture}[ + every node/.style={rectangle split, rectangle split parts=4, + draw, rectangle split horizontal} + ] + \node[rectangle split part align={center, top, bottom}] at (0,0) {\x}; + \node[rectangle split part align={center, top}] at (0,-1.25) {\x}; + \node[rectangle split part align={center}] at (0,-2.5) {\x}; + \node[rectangle split part align=base] at (0,-3.75) {\x}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-77} +\begin{tikzpicture} + \tikzset{every node/.style={rectangle split, draw, minimum width=.5cm}} + \node[rectangle split part fill={red!50, green!50, blue!50, yellow!50}] {}; + \node[rectangle split part fill={red!50, green!50, blue!50}] at (0.75,0) {}; + \node[rectangle split part fill={red!50, green!50}] at (1.5,0) {}; + \node[rectangle split part fill={red!50}] at (2.25,0) {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-78} +\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}; + \foreach \anchor/\placement in + {text/left, text east/above, text west/above, + two/left, two east/above, two west/above, + three/left, three east/below, three west/below, + four/left, four east/below, four west/below, + text split/left, text split east/above, text split west/above, + two split/left, two split east/above, two split west/above, + three split/left, three split east/below, three split west/below, + north/above, south/below, east/below, west/below, + north west/above, north east/above, south west/below, south east/below, + center/above, 70/above, mid/above, base/below} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-81} +\begin{tikzpicture} + \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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-82} +\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}; + \foreach \anchor/\placement in + {center/above, text/below, 60/above, + mid/right, mid west/left, mid east/right, + base/below, base west/below, base east/below, + north/above, south/below, east/above, west/above, + north west/above, north east/above, + south west/below, south east/below, + pointer/below} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-83} +\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}; + \foreach \anchor/\placement in + {center/above, text/below, 60/above, + mid/above, mid west/right, mid east/left, + base/below, base west/below, base east/below, + north/above, south/below, east/above, west/above, + north west/above left, north east/above right, + south west/below left, south east/below right, + pointer/below} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-84} +\begin{tikzpicture} + \node[cloud callout, cloud puffs=15, aspect=2.5, cloud puff arc=120, + shading=ball,text=white] {\bf Imagine...}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-85} +\Huge +\begin{tikzpicture} + \node[name=s, shape=cloud callout, style=shape example, cloud puffs=11, aspect=1.5, + cloud puff arc=120,inner xsep=.5cm, callout pointer start size=.25 of callout, + callout pointer end size=.15 of callout, callout relative pointer={(315:4cm)}, + callout pointer segments=2] {Cloud Callout\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {puff 1/above, puff 2/above, puff 3/above, puff 4/below, + puff 5/left, puff 6/below, puff 7/below, puff 8/right, + puff 9/below, puff 10/above, puff 11/above, 70/right, + center/above, base/below, mid/right, text/left, + north/below, south/below, east/above, west/above, + north west/left, north east/right, + south west/below, south east/below,pointer/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-86} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + \node [cross out,draw=red] at (1.5,1) {cross out}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-87} +Cross \tikz[baseline] \node [cross out,draw,anchor=text] {me}; out! +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-88} +\Huge +\begin{tikzpicture} + \node[name=s,shape=cross out,shape example] {cross out\vrule width 1pt height 2cm}; + \foreach \anchor/\placement in + {north west/above left, north/above, north east/above right, + west/left, center/above, east/right, + mid west/right, mid/above, mid east/left, + base west/left, base/below, base east/right, + south west/below left, south/below, south east/below right, + text/left, 10/right, 130/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-89} +Strike \tikz[baseline] \node [strike out,draw,anchor=text] {me}; out! +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-90} +\begin{tikzpicture} + \node[rounded rectangle, draw, fill=red!20]{Hallo}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-91} +\begin{tikzpicture} + \matrix[row sep=5pt, every node/.style={draw, rounded rectangle}]{ + \node[rounded rectangle arc length=180] {180}; \\ + \node[rounded rectangle arc length=120] {120}; \\ + \node[rounded rectangle arc length=90] {90}; \\}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-92} +\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}; \\}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-93} +\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}; + \foreach \anchor/\placement in + {center/above, text/below, 10/above, + mid/above, mid west/right, mid east/left, + base/below, base west/below, base east/below, + north/above, south/below, east/above, west/above, + north west/above left, north east/above right, + south west/below left, south east/below right} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-94} +\begin{tikzpicture} + \node[chamfered rectangle, white, fill=red, double=red, draw, very thick] + {\bf STOP!}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-95} +\begin{tikzpicture} + \tikzset{every node/.style={chamfered rectangle, draw}} + \node[chamfered rectangle angle=30] {abc}; + \node[chamfered rectangle angle=60] at (1.5,0) {123}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-96} +\begin{tikzpicture} + \tikzset{every node/.style={chamfered rectangle, draw}} + \node[chamfered rectangle xsep=2pt] {def}; + \node[chamfered rectangle xsep=2cm] at (1.5,0) {456}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-97} +\begin{tikzpicture} + \tikzset{every node/.style={chamfered rectangle, draw}} + \node[chamfered rectangle corners=north west] {ghi}; + \node[chamfered rectangle corners={north east, south east}] at (1.5,0) {789}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-shapes-98} +\Huge +\begin{tikzpicture} + \node[name=s,shape=chamfered rectangle, chamfered rectangle sep=1cm, + shape example, inner ysep=1cm, inner xsep=.75cm] + {Chamfered Rectangle\vrule width1pt height2cm}; + \foreach \anchor/\placement in + {text/right, center/above, 70/above, + base/below, base east/left, base west/right, + mid/right, mid east/above, mid west/above, + north/above, south/below, east/above, west/above, + before north east/above, north east/above, after north east/above, + before north west/above, north west/above, after north west/above, + before south west/below, south west/below, after south west/below, + before south east/below, south east/below, after south east/below} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-spy.lvt b/testfiles/pgfmanual-en-library-spy.lvt new file mode 100644 index 000000000..9311c475e --- /dev/null +++ b/testfiles/pgfmanual-en-library-spy.lvt @@ -0,0 +1,172 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{decorations.fractals,spy} +\usetikzlibrary{decorations.fractals,spy} +\usetikzlibrary{decorations.fractals,spy} +\usetikzlibrary{decorations.fractals,spy} +\usetikzlibrary{decorations.fractals,spy} +\usetikzlibrary{decorations.fractals,spy} +\usetikzlibrary{decorations.fractals,spy} +\usetikzlibrary{decorations.fractals,spy} +\usetikzlibrary{decorations.fractals,spy} +\usetikzlibrary{decorations.fractals,shadows,shapes.symbols,spy} +\usetikzlibrary{decorations.fractals,shadows,shapes.symbols,spy} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-spy-1} +\begin{tikzpicture} + [spy using outlines={circle, magnification=4, size=2cm, connect spies}] + + \draw [help lines] (0,0) grid (3,2); + + \draw [decoration=Koch curve type 1] + decorate { decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}}; + + \spy [red] on (1.6,0.3) + in node [left] at (3.5,-1.25); + + \spy [blue, size=1cm] on (1,1) + in node [right] at (0,-1.25); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-spy-2} +\begin{tikzpicture}[spy using overlays={size=12mm}] + \draw [decoration=Koch snowflake] + decorate { decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}}; + + \spy [green,magnification=3] on (0.6,0.1) in node at (-0.3,-1); + \spy [blue,magnification=5] on (1,0.5) in node at (1,-1); + \spy [red,magnification=10] on (1.6,0.1) in node at (2.3,-1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-spy-3} +\begin{tikzpicture} + [spy using outlines={rectangle, red, magnification=5, + size=1.5cm, connect spies}] + + \begin{scope} + [spy using outlines={circle, blue, + magnification=3, size=1.5cm, connect spies}] + \draw [help lines] (0,0) grid (3,2); + + \draw [decoration=Koch curve type 1] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy on (1.6,0.3) in node (zoom) [left] at (3.5,-1.25); + \end{scope} + + \spy on (zoom.north west) in node [right] at (0,-1.25); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-spy-4} +\begin{tikzpicture} + [spy using outlines={circle, magnification=3, size=1cm}] + + \draw [decoration=Koch curve type 1] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy [red] on (1.6,0.3) in node; + \spy [blue] on (1,1) in node at (1,-1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-spy-5} +\begin{tikzpicture} + \begin{scope} + [spy using outlines={circle, magnification=3, size=2cm, connect spies}] + + \draw [decoration=Koch curve type 1] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy [red] on (1.6,0.3) in node (a) [left] at (3.5,-1.25); + + \spy [blue, size=1cm] on (1,1) in node (b) [right] at (0,-1.25); + \end{scope} + \draw [ultra thick, green!50!black] (b) -- (a.north west); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-spy-7} +\begin{tikzpicture} + [spy using outlines={lens={scale=3,rotate=20}, size=2cm, connect spies}] + + \draw [decoration=Koch curve type 1] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy [red] on (1.6,0.3) in node at (2.5,-1.25); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-spy-8} +\begin{tikzpicture} + [spy using outlines={circle, magnification=3, size=1cm, connect spies}] + + \draw [decoration=Koch curve type 1] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy [red] on (1.6,0.3) in node at (3,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-spy-9} +\begin{tikzpicture} + [spy using overlays={circle, magnification=3, size=1cm, connect spies}] + + \draw [decoration=Koch curve type 1] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy [green] on (1.6,0.3) in node at (3,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-spy-10} +\begin{tikzpicture} + [spy using overlays={circle, magnification=3, size=1cm}] + + \draw [decoration=Koch curve type 2] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy [green] on (1.6,0.1) in node at (3,1); + \spy [red,connect spies] on (0.5,0.4) in node at (1,1.5); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-spy-11} +\tikzset{spy using mag glass/.style={ + spy scope={ + every spy on node/.style={ + circle, + fill, fill opacity=0.2, text opacity=1}, + every spy in node/.style={ + magnifying glass, circular drop shadow, + fill=white, draw, ultra thick, cap=round}, + #1 + }}} +\begin{tikzpicture}[spy using mag glass={magnification=3, size=1cm}] + \draw [decoration=Koch curve type 2] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy [green!50!black] on (1.6,0.1) in node at (2.5,-0.5); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-spy-12} +\begin{tikzpicture} + [spy scope={magnification=4, size=1cm}, + every spy in node/.style={ + magnifying glass, circular drop shadow, + fill=white, draw, ultra thick, cap=round}] + + \draw [decoration=Koch curve type 2] + decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; + + \spy on (1.6,0.1) in node; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-svg-path.lvt b/testfiles/pgfmanual-en-library-svg-path.lvt new file mode 100644 index 000000000..022f2e5b1 --- /dev/null +++ b/testfiles/pgfmanual-en-library-svg-path.lvt @@ -0,0 +1,16 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usepgflibrary{svg.path} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-svg-path-1} +\begin{pgfpicture} + \pgfpathsvg{M 0 0 l 20 0 0 20 -20 0 q 10 0 10 10 + t 10 10 10 10 h -50 z} + \pgfusepath{stroke} +\end{pgfpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-through.lvt b/testfiles/pgfmanual-en-library-through.lvt new file mode 100644 index 000000000..ec2bc77e0 --- /dev/null +++ b/testfiles/pgfmanual-en-library-through.lvt @@ -0,0 +1,16 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{through} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-through-1} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \node (a) at (2,1.5) {$a$}; + \node [draw] at (1,1) [circle through={(a)}] {$c$}; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-trees.lvt b/testfiles/pgfmanual-en-library-trees.lvt new file mode 100644 index 000000000..2334da3c9 --- /dev/null +++ b/testfiles/pgfmanual-en-library-trees.lvt @@ -0,0 +1,92 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{trees} +\usetikzlibrary{trees} +\usetikzlibrary{trees} +\usetikzlibrary{trees} +\usetikzlibrary{trees} +\usetikzlibrary{trees} +\usetikzlibrary{trees} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-trees-1} +\begin{tikzpicture}[grow via three points={% + one child at (0,1) and two children at (-.5,1) and (.5,1)}] + \node at (0,0) {one} child; + \node at (0,-1.5) {two} child child; + \node at (0,-3) {three} child child child; + \node at (0,-4.5) {four} child child child child; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-trees-2} +\begin{tikzpicture}[grow via three points={% + one child at (0,1) and two children at (0,1) and (1,1)}] + \node at (0,0) {one} child; + \node at (0,-1.5) {two} child child; + \node at (0,-3) {three} child child child; + \node at (0,-4.5) {four} child child child child; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-trees-3} +\begin{tikzpicture}[grow via three points={% + one child at (-1,-.5) and two children at (-1,-.5) and (0,-.75)}] + \node at (0,0) {one} child; + \node at (0,-1.5) {two} child child; + \node at (0,-3) {three} child child child; + \node at (0,-4.5) {four} child child child child; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-trees-4} +\begin{tikzpicture} + [grow cyclic, + level 1/.style={level distance=8mm,sibling angle=60}, + level 2/.style={level distance=4mm,sibling angle=45}, + level 3/.style={level distance=2mm,sibling angle=30}] + \coordinate [rotate=-90] % going down + child foreach \x in {1,2,3} + {child foreach \x in {1,2,3} + {child foreach \x in {1,2,3}}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-trees-5} +\begin{tikzpicture} + \node {root} + [clockwise from=30,sibling angle=30] + child {node {$30$}} + child {node {$0$}} + child {node {$-30$}} + child {node {$-60$}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-trees-6} +\begin{tikzpicture} + \node {root} + [edge from parent fork down] + child {node {left}} + child {node {right} + child[child anchor=north east] {node {child}} + child {node {child}} + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-trees-7} +\begin{tikzpicture} + \node {root} + [edge from parent fork right,grow=right] + child {node {left}} + child {node {right} + child {node {child}} + child {node {child}} + }; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-turtle.lvt b/testfiles/pgfmanual-en-library-turtle.lvt new file mode 100644 index 000000000..1e943193f --- /dev/null +++ b/testfiles/pgfmanual-en-library-turtle.lvt @@ -0,0 +1,34 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{turtle} +\usetikzlibrary{turtle} +\usetikzlibrary{turtle} +\usetikzlibrary{turtle} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-turtle-1} +\tikz[turtle/distance=2mm] + \draw [turtle={home,forward,right,forward,left,forward,left,forward}]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-turtle-2} +\tikz[turtle/distance=2mm] + \draw [turtle={home,fd,rt,fd,lt,fd,lt,fd}]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-turtle-3} +\tikz \draw [turtle={how/.style={bend left},home,forward,right,forward}]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-turtle-4} +\tikz \filldraw [thick,blue,fill=blue!20] + [turtle=home] + \foreach \i in {1,...,5} + { + [turtle={forward,right=144}] + }; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-library-views.lvt b/testfiles/pgfmanual-en-library-views.lvt new file mode 100644 index 000000000..5d36dfde6 --- /dev/null +++ b/testfiles/pgfmanual-en-library-views.lvt @@ -0,0 +1,61 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{views} +\usetikzlibrary{views} +\usetikzlibrary{animations,views} +\usetikzlibrary{animations,views} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-library-views-1} +\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} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-views-2} +\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} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-views-3} +\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} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-library-views-4} +\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} } +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-main-body.lvt b/testfiles/pgfmanual-en-main-body.lvt new file mode 100644 index 000000000..df7588e54 --- /dev/null +++ b/testfiles/pgfmanual-en-main-body.lvt @@ -0,0 +1,300 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{arrows.meta,automata,positioning,shadows} +\usetikzlibrary{angles,calc,quotes} +\usetikzlibrary{arrows.meta,graphs,graphdrawing} +\usegdlibrary{layered} +\usetikzlibrary{arrows,trees} +\usetikzlibrary{datavisualization.formats.functions} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-main-body-1} +\tikz \draw[thick,rounded corners=8pt] + (0,0) -- (0,2) -- (1,3.25) -- (2,2) -- (2,0) -- (0,2) -- (2,2) -- (0,0) -- (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-main-body-2} +\begin{tikzpicture}[->,>={Stealth[round]},shorten >=1pt,auto,node distance=2.8cm,on grid,semithick, + every state/.style={fill=red,draw=none,circular drop shadow,text=white}] + + \node[initial,state] (A) {$q_a$}; + \node[state] (B) [above right=of A] {$q_b$}; + \node[state] (D) [below right=of A] {$q_d$}; + \node[state] (C) [below right=of B] {$q_c$}; + \node[state] (E) [below=of D] {$q_e$}; + + \path (A) edge node {0,1,L} (B) + edge node {1,1,R} (C) + (B) edge [loop above] node {1,1,L} (B) + edge node {0,1,L} (C) + (C) edge node {0,1,L} (D) + edge [bend left] node {1,0,R} (E) + (D) edge [loop below] node {1,1,R} (D) + edge node {0,1,R} (A) + (E) edge [bend left] node {1,0,R} (A); + + \node [right=1cm,text width=8cm] at (C) + { + The current candidate for the busy beaver for five states. It is + presumed that this Turing machine writes a maximum number of + $1$'s before halting among all Turing machines with five states + and the tape alphabet $\{0, 1\}$. Proving this conjecture is an + open research problem. + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-main-body-3} +\begin{tikzpicture}[angle radius=.75cm] + + \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$}; + + \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 + (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}; + + \node at ($ (D)!.5!(B) $) [right=1cm,text width=6cm,rounded corners,fill=red!20,inner sep=1ex] + { + When we assume that $\color{red}AB$ and $\color{blue}CD$ are + parallel, i.\,e., ${\color{red}AB} \mathbin{\|} \color{blue}CD$, + then $\alpha = \gamma$ and $\beta = \delta$. + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-main-body-4} +\tikz [nodes={text height=.7em, text depth=.2em, + draw=black!20, thick, fill=white, font=\footnotesize}, + >={Stealth[round,sep]}, rounded corners, semithick] + \graph [layered layout, level distance=1cm, sibling sep=.5em, sibling distance=1cm] { + "5th Edition" -> { "6th Edition", "PWB 1.0" }; + "6th Edition" -> { "LSX" [>child anchor=45], "1 BSD", "Mini Unix", "Wollongong", "Interdata" }; + "Interdata" -> { "Unix/TS 3.0", "PWB 2.0", "7th Edition" }; + "7th Edition" -> { "8th Edition", "32V", "V7M", "Ultrix-11", "Xenix", "UniPlus+" }; + "V7M" -> "Ultrix-11"; + "8th Edition" -> "9th Edition"; + "1 BSD" -> "2 BSD" -> "2.8 BSD" -> { "Ultrix-11", "2.9 BSD" }; + "32V" -> "3 BSD" -> "4 BSD" -> "4.1 BSD" -> { "4.2 BSD", "2.8 BSD", "8th Edition" }; + "4.2 BSD" -> { "4.3 BSD", "Ultrix-32" }; + "PWB 1.0" -> { "PWB 1.2" -> "PWB 2.0", "USG 1.0" -> { "CB Unix 1", "USG 2.0" }}; + "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"; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-main-body-5} +\tikzset{ + ld/.style={level distance=#1},lw/.style={line width=#1}, + level 1/.style={ld=4.5mm, trunk, lw=1ex ,sibling angle=60}, + level 2/.style={ld=3.5mm, trunk!80!leaf a,lw=.8ex,sibling angle=56}, + level 3/.style={ld=2.75mm,trunk!60!leaf a,lw=.6ex,sibling angle=52}, + level 4/.style={ld=2mm, trunk!40!leaf a,lw=.4ex,sibling angle=48}, + level 5/.style={ld=1mm, trunk!20!leaf a,lw=.3ex,sibling angle=44}, + level 6/.style={ld=1.75mm,leaf a, lw=.2ex,sibling angle=40}, +} +\pgfarrowsdeclare{leaf}{leaf} + {\pgfarrowsleftextend{-2pt} \pgfarrowsrightextend{1pt}} +{ + \pgfpathmoveto{\pgfpoint{-2pt}{0pt}} + \pgfpatharc{150}{30}{1.8pt} + \pgfpatharc{-30}{-150}{1.8pt} + \pgfusepathqfill +} + +\newcommand{\logo}[5] +{ + \colorlet{border}{#1} + \colorlet{trunk}{#2} + \colorlet{leaf a}{#3} + \colorlet{leaf b}{#4} + \begin{tikzpicture} + \scriptsize\scshape + \draw[border,line width=1ex,yshift=.3cm, + yscale=1.45,xscale=1.05,looseness=1.42] + (1,0) to [out=90, in=0] (0,1) to [out=180,in=90] (-1,0) + to [out=-90,in=-180] (0,-1) to [out=0, in=-90] (1,0) -- cycle; + + \coordinate (root) [grow cyclic,rotate=90] + child { + child [line cap=round] foreach \a in {0,1} { + child foreach \b in {0,1} { + child foreach \c in {0,1} { + child foreach \d in {0,1} { + child foreach \leafcolor in {leaf a,leaf b} + { edge from parent [color=\leafcolor,-#5] } + } } } + } edge from parent [shorten >=-1pt,serif cm-,line cap=butt] + }; + + \node [align=center,below] at (0pt,-.5ex) + { \textcolor{border}{T}heoretical \\ \textcolor{border}{C}omputer \\ + \textcolor{border}{S}cience }; + \end{tikzpicture} +} +\begin{minipage}{3cm} + \logo{green!80!black}{green!25!black}{green}{green!80}{leaf}\\ + \logo{green!50!black}{black}{green!80!black}{red!80!green}{leaf}\\ + \logo{red!75!black}{red!25!black}{red!75!black}{orange}{leaf}\\ + \logo{black!50}{black}{black!50}{black!25}{} +\end{minipage} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-main-body-6} +\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); +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-main-body-7} +\begin{tikzpicture}[scale=2] + \shade[top color=blue,bottom color=gray!50] (0,0) parabola (1.5,2.25) |- (0,0); + \draw (1.05cm,2pt) node[above] {$\displaystyle\int_0^{3/2} \!\!x^2\mathrm{d}x$}; + + \draw[help lines] (0,0) grid (3.9,3.9) + [step=0.25cm] (1,2) grid +(1,1); + + \draw[->] (-0.2,0) -- (4,0) node[right] {$x$}; + \draw[->] (0,-0.2) -- (0,4) node[above] {$f(x)$}; + + \foreach \x/\xtext in {1/1, 1.5/1\frac{1}{2}, 2/2, 3/3} + \draw[shift={(\x,0)}] (0pt,2pt) -- (0pt,-2pt) node[below] {$\xtext$}; + + \foreach \y/\ytext in {1/1, 2/2, 2.25/2\frac{1}{4}, 3/3} + \draw[shift={(0,\y)}] (2pt,0pt) -- (-2pt,0pt) node[left] {$\ytext$}; + + \draw (-.5,.25) parabola bend (0,0) (2,4) node[below right] {$x^2$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-main-body-8} +\pgfmathsetseed{1} +\foreach \col in {black,red,green,blue} +{ + \begin{tikzpicture}[x=10pt,y=10pt,ultra thick,baseline,line cap=round] + \coordinate (current point) at (0,0); + \coordinate (old velocity) at (0,0); + \coordinate (new velocity) at (rand,rand); + + \foreach \i in {0,1,...,100} + { + \draw[\col!\i] (current point) + .. controls ++([scale=-1]old velocity) and + ++(new velocity) .. ++(rand,rand) + coordinate (current point); + \coordinate (old velocity) at (new velocity); + \coordinate (new velocity) at (rand,rand); + } + \end{tikzpicture} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-main-body-9} +\begin{tikzpicture} + \draw[gray,very thin] (-1.9,-1.9) grid (2.9,3.9) + [step=0.25cm] (-1,-1) grid (1,1); + \draw[blue] (1,-2.1) -- (1,4.1); % asymptote + + \draw[->] (-2,0) -- (3,0) node[right] {$x(t)$}; + \draw[->] (0,-2) -- (0,4) node[above] {$y(t)$}; + + \foreach \pos in {-1,2} + \draw[shift={(\pos,0)}] (0pt,2pt) -- (0pt,-2pt) node[below] {$\pos$}; + + \foreach \pos in {-1,1,2,3} + \draw[shift={(0,\pos)}] (2pt,0pt) -- (-2pt,0pt) node[left] {$\pos$}; + + \fill (0,0) circle (0.064cm); + \draw[thick,parametric,domain=0.4:1.5,samples=200] + % The plot is reparameterised such that there are more samples + % near the center. + plot[id=asymptotic-example] function{(t*t*t)*sin(1/(t*t*t)),(t*t*t)*cos(1/(t*t*t))} + node[right] {$\bigl(x(t),y(t)\bigr) = (t\sin \frac{1}{t}, t\cos \frac{1}{t})$}; + + \fill[red] (0.63662,0) circle (2pt) + node [below right,fill=white,yshift=-4pt] {$(\frac{2}{\pi},0)$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-main-body-10} +\begin{tikzpicture} + [shorten >=1pt,->, + vertex/.style={circle,fill=black!25,minimum size=17pt,inner sep=0pt}] + + \foreach \name/\x in {s/1, 2/2, 3/3, 4/4, 15/11, 16/12, 17/13, 18/14, 19/15, t/16} + \node[vertex] (G-\name) at (\x,0) {$\name$}; + + \foreach \name/\angle/\text in {P-1/234/5, P-2/162/6, P-3/90/7, P-4/18/8, P-5/-54/9} + \node[vertex,xshift=6cm,yshift=.5cm] (\name) at (\angle:1cm) {$\text$}; + + \foreach \name/\angle/\text in {Q-1/234/10, Q-2/162/11, Q-3/90/12, Q-4/18/13, Q-5/-54/14} + \node[vertex,xshift=9cm,yshift=.5cm] (\name) at (\angle:1cm) {$\text$}; + + \foreach \from/\to in {s/2,2/3,3/4,3/4,15/16,16/17,17/18,18/19,19/t} + \draw (G-\from) -- (G-\to); + + \foreach \from/\to in {1/2,2/3,3/4,4/5,5/1,1/3,2/4,3/5,4/1,5/2} + { \draw (P-\from) -- (P-\to); \draw (Q-\from) -- (Q-\to); } + + \draw (G-3) .. controls +(-30:2cm) and +(-150:1cm) .. (Q-1); + \draw (Q-5) -- (G-15); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-main-body-11} +\begin{tikzpicture} + \draw[line width=0.3cm,color=red!30,line cap=round,line join=round] (0,0)--(2,0)--(2,5); + \draw[help lines] (-2.5,-2.5) grid (5.5,7.5); + \draw[very thick] (1,-1)--(-1,-1)--(-1,1)--(0,1)--(0,0)-- + (1,0)--(1,-1)--(3,-1)--(3,2)--(2,2)--(2,3)--(3,3)-- + (3,5)--(1,5)--(1,4)--(0,4)--(0,6)--(1,6)--(1,5) + (3,3)--(4,3)--(4,5)--(3,5)--(3,6) + (3,-1)--(4,-1); + \draw[below left] (0,0) node(s){$s$}; + \draw[below left] (2,5) node(t){$t$}; + \fill (0,0) circle (0.06cm) (2,5) circle (0.06cm); + \draw[->,rounded corners=0.2cm,shorten >=2pt] + (1.5,0.5)-- ++(0,-1)-- ++(1,0)-- ++(0,2)-- ++(-1,0)-- ++(0,2)-- ++(1,0)-- + ++(0,1)-- ++(-1,0)-- ++(0,-1)-- ++(-2,0)-- ++(0,3)-- ++(2,0)-- ++(0,-1)-- + ++(1,0)-- ++(0,1)-- ++(1,0)-- ++(0,-1)-- ++(1,0)-- ++(0,-3)-- ++(-2,0)-- + ++(1,0)-- ++(0,-3)-- ++(1,0)-- ++(0,-1)-- ++(-6,0)-- ++(0,3)-- ++(2,0)-- + ++(0,-1)-- ++(1,0); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-math-algorithms.lvt b/testfiles/pgfmanual-en-math-algorithms.lvt new file mode 100644 index 000000000..dea7a101b --- /dev/null +++ b/testfiles/pgfmanual-en-math-algorithms.lvt @@ -0,0 +1,67 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-math-algorithms-1} +\makeatletter +\pgfmathdeclarefunction{double}{1}{ + \begingroup + \pgf@x=#1pt\relax + \multiply\pgf@x by2\relax + \pgfmathreturn\pgf@x + \endgroup +} +\makeatother +\pgfmathparse{double(44.3)}\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-algorithms-2} +\makeatletter +\pgfmathdeclarefunction{foo}{1}{ + \begingroup + \pgf@x=#1pt\relax + \multiply\pgf@x by2\relax + \pgfmathreturn\pgf@x + \endgroup +} +\pgfmathparse{foo(42)}\pgfmathresult +\pgfmathredeclarefunction{foo}{ + \begingroup + \pgf@x=#1pt\relax + \multiply\pgf@x by3\relax + \pgfmathreturn\pgf@x + \endgroup +} +\pgfmathparse{foo(42)}\pgfmathresult +\makeatother +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-algorithms-3} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + \draw [blue, thick, x=0.0085cm, y=1cm, + declare function={ + sines(\t,\a,\b)=1 + 0.5*(sin(\t)+sin(\t*\a)+sin(\t*\b)); + }] + plot [domain=0:360, samples=144, smooth] (\x,{sines(\x,3,5)}); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-algorithms-4} +\pgfmathsetseed{1} +\begin{tikzpicture}[ + declare function={ + excitation(\t,\w) = sin(\t*\w); + noise = rnd - 0.5; + source(\t) = excitation(\t,20) + noise; + filter(\t) = 1 - abs(sin(mod(\t, 90))); + speech(\t) = 1 + source(\t)*filter(\t); + } +] + \draw [help lines] (0,0) grid (3,2); + \draw [blue, thick, x=0.0085cm, y=1cm] (0,1) -- + plot [domain=0:360, samples=144, smooth] (\x,{speech(\x)}); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-math-commands.lvt b/testfiles/pgfmanual-en-math-commands.lvt new file mode 100644 index 000000000..9576db411 --- /dev/null +++ b/testfiles/pgfmanual-en-math-commands.lvt @@ -0,0 +1,86 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-math-commands-1} +\begin{pgfpicture} + \foreach \x in {1,...,50}{ + \pgfmathrandominteger{\a}{1}{50} + \pgfmathrandominteger{\b}{1}{50} + \pgfpathcircle{\pgfpoint{+\a pt}{+\b pt}}{+2pt} + \color{blue!40!white} + \pgfsetstrokecolor{blue!80!black} + \pgfusepath{stroke, fill} + } +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-commands-2} +\begin{pgfpicture} + \pgfmathdeclarerandomlist{color}{{red}{blue}{green}{yellow}{white}} + \foreach \a in {1,...,50}{ + \pgfmathrandominteger{\x}{1}{85} + \pgfmathrandominteger{\y}{1}{85} + \pgfmathrandominteger{\r}{5}{10} + \pgfmathrandomitem{\c}{color} + \pgfpathcircle{\pgfpoint{+\x pt}{+\y pt}}{+\r pt} + \color{\c!40!white} + \pgfsetstrokecolor{\c!80!black} + \pgfusepath{stroke, fill} + } +\end{pgfpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-commands-3} +\pgfmathbasetodec\mynumber{107f}{16} \mynumber +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-commands-4} +\pgfmathbasetodec\mynumber{33FC}{20} \mynumber +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-commands-5} +\pgfmathdectobase\mynumber{65535}{16} \mynumber +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-commands-6} +\pgfmathdectoBase\mynumber{65535}{16} \mynumber +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-commands-7} +\pgfmathbasetobase\mynumber{11011011}{2}{16} \mynumber +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-commands-8} +\pgfmathbasetoBase\mynumber{121212}{3}{12} \mynumber +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-commands-9} +\pgfmathsetbasenumberlength{8} +\pgfmathdectobase\mynumber{15}{2} \mynumber +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-commands-10} +\pgfmathsetbasenumberlength{8} +\begin{tikzpicture}[x=0.25cm, y=0.25cm] + \foreach \n [count=\y] in {0, 60, 102, 102, 126, 102, 102, 102, 0}{ + \pgfmathdectobase{\binary}{\n}{2} + \pgfmathtodigitlist{\digitlist}{\binary} + \foreach \digit [count=\x, evaluate={\c=\digit*50+15;}] in \digitlist + \fill [fill=black!\c] (\x, -\y) rectangle ++(1,1); + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-commands-11} +\pgfmathanglebetweenpoints{\pgfpoint{1cm}{3cm}}{\pgfpoint{2cm}{4cm}} +\pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-commands-12} +\pgfmathanglebetweenlines{\pgfpoint{1cm}{3cm}}{\pgfpoint{2cm}{4cm}} + {\pgfpoint{0cm}{1cm}}{\pgfpoint{1cm}{0cm}} +\pgfmathresult +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-math-numberprinting.lvt b/testfiles/pgfmanual-en-math-numberprinting.lvt new file mode 100644 index 000000000..525355e40 --- /dev/null +++ b/testfiles/pgfmanual-en-math-numberprinting.lvt @@ -0,0 +1,383 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{fpu} +\usetikzlibrary{fpu} +\usetikzlibrary{fpu} +\usetikzlibrary{fpu} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-1} +\pgfkeys{/pgf/number format/.cd,fixed,precision=2} +\pgfmathprintnumber{4.568}\hspace{1em} +\pgfmathprintnumber{5e-04}\hspace{1em} +\pgfmathprintnumber{0.1}\hspace{1em} +\pgfmathprintnumber{24415.98123}\hspace{1em} +\pgfmathprintnumber{123456.12345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-2} +\pgfkeys{/pgf/number format/.cd,fixed,fixed zerofill,precision=2} +\pgfmathprintnumber{4.568}\hspace{1em} +\pgfmathprintnumber{5e-04}\hspace{1em} +\pgfmathprintnumber{0.1}\hspace{1em} +\pgfmathprintnumber{24415.98123}\hspace{1em} +\pgfmathprintnumber{123456.12345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-3} +\pgfkeys{/pgf/number format/.cd,std,fixed zerofill,precision=2} +\pgfmathprintnumber{4.568}\hspace{1em} +\pgfmathprintnumber{5e-05}\hspace{1em} +\pgfmathprintnumber{1}\hspace{1em} +\pgfmathprintnumber{123456.12345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-4} +\pgfkeys{/pgf/number format/.cd,sci,precision=2} +\pgfmathprintnumber{4.568}\hspace{1em} +\pgfmathprintnumber{5e-04}\hspace{1em} +\pgfmathprintnumber{0.1}\hspace{1em} +\pgfmathprintnumber{24415.98123}\hspace{1em} +\pgfmathprintnumber{123456.12345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-5} +\pgfkeys{/pgf/number format/.cd,sci,sci zerofill,precision=2} +\pgfmathprintnumber{4.568}\hspace{1em} +\pgfmathprintnumber{5e-04}\hspace{1em} +\pgfmathprintnumber{0.1}\hspace{1em} +\pgfmathprintnumber{24415.98123}\hspace{1em} +\pgfmathprintnumber{123456.12345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-6} +\pgfkeys{/pgf/number format/.cd,std,precision=2} +\pgfmathprintnumber{4.568}\hspace{1em} +\pgfmathprintnumber{5e-04}\hspace{1em} +\pgfmathprintnumber{0.1}\hspace{1em} +\pgfmathprintnumber{24415.98123}\hspace{1em} +\pgfmathprintnumber{123456.12345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-7} +\pgfkeys{/pgf/number format/relative*={1}} +\pgfmathprintnumber{6.42e-16}\hspace{1em} +\pgfmathprintnumber{1.2}\hspace{1em} +\pgfmathprintnumber{6}\hspace{1em} +\pgfmathprintnumber{20.6}\hspace{1em} +\pgfmathprintnumber{87} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-8} +\pgfkeys{/pgf/number format/relative*={2}} +\pgfmathprintnumber{123.345}\hspace{1em} +\pgfmathprintnumber{0.0012}\hspace{1em} +\pgfmathprintnumber{0.0014}\hspace{1em} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-9} +\pgfkeys{/pgf/number format/relative*={-3}} +\pgfmathprintnumber{123.345}\hspace{1em} +\pgfmathprintnumber{0.0012}\hspace{1em} +\pgfmathprintnumber{0.0014}\hspace{1em} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-10} +\pgfkeys{/pgf/number format/.cd,relative*={3},precision=0} +\pgfmathprintnumber{123456999}\hspace{1em} +\pgfmathprintnumber{123456999.12} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-11} +\pgfkeys{/pgf/number format/.cd,relative*={3},precision=0,relative style=fixed} +\pgfmathprintnumber{123456999}\hspace{1em} +\pgfmathprintnumber{123456999.12} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-12} +\pgfkeys{/pgf/number format/.cd,fixed relative,precision=6} +\pgfmathprintnumber{123456999}\hspace{1em} +\pgfmathprintnumber{123456999.12} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-14} +\pgfkeys{/pgf/number format/.cd,fixed relative,precision=3} +\pgfmathprintnumber{1000.0123}\hspace{1em} +\pgfmathprintnumber{100.0567}\hspace{1em} +\pgfmathprintnumber{0.000010003452}\hspace{1em} +\pgfmathprintnumber{0.010073452}\hspace{1em} +\pgfmathprintnumber{1.23567}\hspace{1em} +\pgfmathprintnumber{1003.75}\hspace{1em} +\pgfmathprintnumber{1006.75}\hspace{1em} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-15} +\pgfkeys{/pgf/number format/.cd,int detect,precision=2} +\pgfmathprintnumber{15}\hspace{1em} +\pgfmathprintnumber{20}\hspace{1em} +\pgfmathprintnumber{20.4}\hspace{1em} +\pgfmathprintnumber{0.01}\hspace{1em} +\pgfmathprintnumber{0} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-16} +15 \pgfmathifisint{15}{is an int: \pgfretval.}{is no int}\hspace{1em} +15.5 \pgfmathifisint{15.5}{is an int: \pgfretval.}{is no int} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-17} +\pgfkeys{/pgf/number format/.cd,int trunc} +\pgfmathprintnumber{4.568}\hspace{1em} +\pgfmathprintnumber{5e-04}\hspace{1em} +\pgfmathprintnumber{0.1}\hspace{1em} +\pgfmathprintnumber{24415.98123}\hspace{1em} +\pgfmathprintnumber{123456.12345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-18} +\pgfkeys{/pgf/number format/frac} +\pgfmathprintnumber{0.333333333333333}\hspace{1em} +\pgfmathprintnumber{0.5}\hspace{1em} +\pgfmathprintnumber{2.133333333333325e-01}\hspace{1em} +\pgfmathprintnumber{0.12}\hspace{1em} +\pgfmathprintnumber{2.666666666666646e-02}\hspace{1em} +\pgfmathprintnumber{-1.333333333333334e-02}\hspace{1em} +\pgfmathprintnumber{7.200000000000000e-01}\hspace{1em} +\pgfmathprintnumber{6.666666666666667e-02}\hspace{1em} +\pgfmathprintnumber{1.333333333333333e-01}\hspace{1em} +\pgfmathprintnumber{-1.333333333333333e-02}\hspace{1em} +\pgfmathprintnumber{3.3333333}\hspace{1em} +\pgfmathprintnumber{1.2345}\hspace{1em} +\pgfmathprintnumber{1}\hspace{1em} +\pgfmathprintnumber{-6} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-19} +\pgfkeys{/pgf/number format/.cd,frac, frac denom=10} +\pgfmathprintnumber{0.1}\hspace{1em} +\pgfmathprintnumber{0.5}\hspace{1em} +\pgfmathprintnumber{1.2}\hspace{1em} +\pgfmathprintnumber{-0.6}\hspace{1em} +\pgfmathprintnumber{-1.4}\hspace{1em} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-20} +\pgfkeys{/pgf/number format/.cd,frac, frac whole=false} +\pgfmathprintnumber{20.1}\hspace{1em} +\pgfmathprintnumber{5.5}\hspace{1em} +\pgfmathprintnumber{1.2}\hspace{1em} +\pgfmathprintnumber{-5.6}\hspace{1em} +\pgfmathprintnumber{-1.4}\hspace{1em} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-21} +\pgfkeys{/pgf/number format/read comma as period} +\pgfmathprintnumber{1234,56} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-22} +\pgfkeys{/pgf/number format/.cd, + read comma as period, + use comma} +\pgfmathprintnumber{1234,56} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-23} +\pgfkeys{/pgf/number format/.cd, + fixed, + fixed zerofill, + precision=2, + set thousands separator={}} +\pgfmathprintnumber{1234.56} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-24} +\pgfkeys{/pgf/number format/.cd, + fixed, + fixed zerofill, + precision=2, + set thousands separator={}} +\pgfmathprintnumber{1234567890} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-25} +\pgfkeys{/pgf/number format/.cd, + fixed, + fixed zerofill, + precision=2, + set thousands separator={.}} +\pgfmathprintnumber{1234567890} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-26} +\pgfkeys{/pgf/number format/.cd, + fixed, + fixed zerofill, + precision=2, + set thousands separator={,}} +\pgfmathprintnumber{1234567890} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-27} +\pgfkeys{/pgf/number format/.cd, + fixed, + fixed zerofill, + precision=2, + set thousands separator={{{,}}}} +\pgfmathprintnumber{1234567890} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-28} +\pgfkeys{/pgf/number format/.cd, + fixed, + precision=999, + set thousands separator={\,}, + 1000 sep in fractionals, + } +\pgfmathprintnumber{1234.1234567} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-29} +\pgfkeys{/pgf/number format/.cd, + fixed,fixed zerofill, + precision=9, + set thousands separator={\,}, + 1000 sep in fractionals, + } +\pgfmathprintnumber{1234.1234567} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-30} +\pgfkeys{/pgf/number format/.cd, + int detect, + 1000 sep={\,}, + min exponent for 1000 sep=0} +\pgfmathprintnumber{5000}; \pgfmathprintnumber{1000000} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-31} +\pgfkeys{/pgf/number format/.cd, + int detect, + 1000 sep={\,}, + min exponent for 1000 sep=4} +\pgfmathprintnumber{1000}; \pgfmathprintnumber{5000} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-32} +\pgfkeys{/pgf/number format/.cd, + int detect, + 1000 sep={\,}, + min exponent for 1000 sep=4} +\pgfmathprintnumber{10000}; \pgfmathprintnumber{1000000} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-33} +\pgfkeys{/pgf/number format/.cd,fixed,precision=2,use period} +\pgfmathprintnumber{12.3456} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-34} +\pgfkeys{/pgf/number format/.cd,fixed,precision=2,use period} +\pgfmathprintnumber{1234.56} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-35} +\pgfkeys{/pgf/number format/.cd,fixed,precision=2,use comma} +\pgfmathprintnumber{12.3456} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-36} +\pgfkeys{/pgf/number format/.cd,fixed,precision=2,use comma} +\pgfmathprintnumber{1234.56} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-37} +\pgfkeys{/pgf/number format/.cd, + fixed, + fixed zerofill,precision=2, + skip 0.} +\pgfmathprintnumber{0.56} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-38} +\pgfkeys{/pgf/number format/.cd, + fixed, + fixed zerofill,precision=2, + skip 0.=false} +\pgfmathprintnumber{0.56} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-39} +\pgfkeys{/pgf/number format/showpos} +\pgfmathprintnumber{12.345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-40} +\pgfkeys{/pgf/number format/showpos=false} +\pgfmathprintnumber{12.345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-41} +\pgfkeys{/pgf/number format/.cd,showpos,sci} +\pgfmathprintnumber{12.345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-42} +\pgfkeys{/pgf/number format/.cd,sci,sci 10e} +\pgfmathprintnumber{12.345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-43} +\pgfkeys{/pgf/number format/.cd,sci,sci e} +\pgfmathprintnumber{12.345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-44} +\pgfkeys{/pgf/number format/.cd,sci,sci E} +\pgfmathprintnumber{12.345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-45} +\pgfkeys{/pgf/number format/.cd,sci,sci subscript} +\pgfmathprintnumber{12.345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-46} +\pgfkeys{/pgf/number format/.cd,sci,sci superscript} +\pgfmathprintnumber{12.345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-47} +\pgfkeys{ + /pgf/number format/.cd, + sci, + sci generic={mantissa sep=\times,exponent={10^{#1}}}} +\pgfmathprintnumber{12.345}; +\pgfmathprintnumber{0.00012345} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-48} +\pgfkeys{ + /pgf/number format/.cd, + sci, retain unit mantissa=false} +\pgfmathprintnumber{10.5}; +\pgfmathprintnumber{10}; +\pgfmathprintnumber{1010}; +\pgfmathprintnumber[precision=1]{-1010}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-numberprinting-49} +\pgfkeys{ + /pgf/fpu, + /pgf/number format/.cd, + sci, + verbatim} +\pgfmathprintnumber{12.345}; +\pgfmathprintnumber{0.00012345}; +\pgfmathparse{exp(15)} +\pgfmathprintnumber{\pgfmathresult} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-math-parsing.lvt b/testfiles/pgfmanual-en-math-parsing.lvt new file mode 100644 index 000000000..3d7d50927 --- /dev/null +++ b/testfiles/pgfmanual-en-math-parsing.lvt @@ -0,0 +1,467 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{calc,quotes} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-math-parsing-1} +\muskipdef\mymuskip=0 + \pgfmathsetlength{\mymuskip}{1mu+3*4mu} \the\mymuskip +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-2} +\dimendef\mydimen=0 + \pgfmathsetlength{\mydimen}{1pt+3*4pt} \the\mydimen +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-3} +\skipdef\myskip=0 + \pgfmathsetlength{\myskip}{1pt+3*4pt} \the\myskip +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-4} +\skipdef\myskip=0 + \pgfmathsetlength{\myskip}{+1pt plus 1fil} \the\myskip +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-5} +\pgfmathparse{scalar(1pt/2pt)} \pgfmathresult\ +\ifpgfmathunitsdeclared with \else without \fi unit +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-6} +\pgfmathparse{1pt+scalar(1pt)} \pgfmathresult\ +\ifpgfmathunitsdeclared with \else without \fi unit +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-7} +\pgfmathparse{scalar(1pt)+1pt} \pgfmathresult\ +\ifpgfmathunitsdeclared with \else without \fi unit +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-8} +\tikz{ + \coordinate["$A$"] (A) at (2,2); + \coordinate["$B$" below] (B) at (0,0); + \coordinate["$C$" below] (C) at (3,0); + \draw (A) -- (B) -- (C) -- cycle; + \path + let \p1 =($(A)-(B)$), \p2 =($(A)-(C)$), + \n1 = {veclen(\x1,\y1)}, \n2 = {veclen(\x2,\y2)} + in coordinate ["$D$" below] (D) at ($ (B)!scalar(\n1/(\n1+\n2))!(C) $); + \draw (A) -- (D); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-9} +\def\myarray{{1,"two",2+1,"IV","cinq","sechs",sin(\i*5)*14}} +\foreach \i in {0,...,6}{\pgfmathparse{\myarray[\i]}\pgfmathresult, } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-10} +\def\myarray{{7,-3,4,-9,11}} +\pgfmathparse{\myarray[3]} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-11} +\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]}}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-12} +\def\x{5} +\foreach \y in {0,10}{ + \pgfmathparse{\x > \y ? "\noexpand\Large Bigger" : "\noexpand\tiny smaller"} + \x\ is \pgfmathresult\ than \y. +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-13} +\pgfmathparse{add(75,6)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-14} +\pgfmathparse{subtract(75,6)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-15} +\pgfmathparse{neg(50)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-16} +\pgfmathparse{multiply(75,6)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-17} +\pgfmathparse{divide(75,6)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-18} +\pgfmathparse{div(75,9)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-19} +\pgfmathparse{factorial(5)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-20} +\pgfmathparse{sqrt(10)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-21} +\pgfmathparse{sqrt(8765.432)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-22} +\pgfmathparse{pow(2,7)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-23} +\pgfmathparse{(e^2-e^-2)/2} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-24} +\pgfmathparse{exp(1)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-25} +\pgfmathparse{exp(2.34)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-26} +\pgfmathparse{ln(10)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-27} +\pgfmathparse{ln(exp(5))} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-28} +\pgfmathparse{log10(100)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-29} +\pgfmathparse{log2(128)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-30} +\pgfmathparse{abs(-5)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-31} +\pgfmathparse{-abs(4*-3)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-32} +\pgfmathparse{mod(20,6)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-33} +\pgfmathparse{mod(-100,30)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-34} +\pgfmathparse{Mod(-100,30)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-35} +\pgfmathparse{sign(-5)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-36} +\pgfmathparse{sign(0)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-37} +\pgfmathparse{sign(5)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-38} +\pgfmathparse{round(32.5/17)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-39} +\pgfmathparse{round(398/12)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-40} +\pgfmathparse{floor(32.5/17)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-41} +\pgfmathparse{floor(398/12)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-42} +\pgfmathparse{floor(-398/12)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-43} +\pgfmathparse{ceil(32.5/17)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-44} +\pgfmathparse{ceil(398/12)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-45} +\pgfmathparse{ceil(-398/12)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-46} +\pgfmathparse{int(32.5/17)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-47} +\pgfmathparse{frac(32.5/17)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-48} +\pgfmathparse{real(4)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-49} +\pgfmathparse{gcd(42,56)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-50} +\pgfmathparse{isodd(2)} \pgfmathresult, +\pgfmathparse{isodd(3)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-51} +\pgfmathparse{iseven(2)} \pgfmathresult, +\pgfmathparse{iseven(3)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-52} +\pgfmathparse{isprime(1)} \pgfmathresult, +\pgfmathparse{isprime(2)} \pgfmathresult, +\pgfmathparse{isprime(31)} \pgfmathresult, +\pgfmathparse{isprime(64)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-53} +\pgfmathparse{pi} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-54} +\pgfmathparse{pi r} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-55} +\pgfmathparse{rad(90)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-56} +\pgfmathparse{deg(3*pi/2)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-57} +\pgfmathparse{sin(60)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-58} +\pgfmathparse{sin(pi/3 r)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-59} +\pgfmathparse{cos(60)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-60} +\pgfmathparse{cos(pi/3 r)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-61} +\pgfmathparse{tan(45)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-62} +\pgfmathparse{tan(2*pi/8 r)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-63} +\pgfmathparse{sec(45)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-64} +\pgfmathparse{cosec(30)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-65} +\pgfmathparse{cot(15)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-66} +\pgfmathparse{asin(0.7071)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-67} +\pgfmathparse{acos(0.5)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-68} +\pgfmathparse{atan(1)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-69} +\pgfmathparse{atan2(-4,3)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-70} +\pgfmathparse{cos(45)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-71} +\pgfkeys{/pgf/trig format=rad} +\pgfmathparse{cos(pi/2)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-72} +\begin{tikzpicture} + \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); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-73} +\pgfmathparse{equal(20,20)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-74} +\pgfmathparse{greater(20,25)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-75} +\pgfmathparse{less(20,25)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-76} +\pgfmathparse{notequal(20,25)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-77} +\pgfmathparse{notgreater(20,25)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-78} +\pgfmathparse{notless(20,25)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-79} +\pgfmathparse{and(5>4,6>7)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-80} +\pgfmathparse{or(5>4,6>7)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-81} +\pgfmathparse{not(true)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-82} +\pgfmathparse{ifthenelse(5==4,"yes","no")} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-83} +\pgfmathparse{true ? "yes" : "no"} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-84} +\pgfmathparse{false ? "yes" : "no"} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-85} +\pgfmathsetseed{1} +\foreach \x in {1,...,10}{\pgfmathparse{rnd}\pgfmathresult, } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-86} +\pgfmathsetseed{1} +\foreach \x in {1,...,10}{\pgfmathparse{rand}\pgfmathresult, } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-87} +\pgfmathsetseed{1} +\foreach \x in {1,...,10}{\pgfmathparse{random()}\pgfmathresult, } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-88} +\pgfmathsetseed{1} +\foreach \x in {1,...,10}{\pgfmathparse{random(100)}\pgfmathresult, } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-89} +\pgfmathsetseed{1} +\foreach \x in {1,...,10}{\pgfmathparse{random(232,762)}\pgfmathresult, } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-90} +\pgfmathparse{hex(65535)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-91} +\pgfmathparse{Hex(65535)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-92} +\pgfmathparse{oct(63)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-93} +\pgfmathparse{bin(185)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-94} +\pgfmathparse{min(3,4,-2,250,-8,100)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-95} +\pgfmathparse{max(3,4,-2,250,-8,100)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-96} +\pgfmathparse{veclen(12,5)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-97} +\pgfmathparse{array({9,13,17,21},2)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-98} +\pgfmathparse{dim({1,2,3,4})} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-99} +\pgfmathparse{sinh(0.5)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-100} +\pgfmathparse{cosh(0.5)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-101} +\pgfmathparse{tanh(0.5)} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-102} +\pgfmathparse{width("Some Lovely Text")} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-103} +\pgfmathparse{height("Some Lovely Text")} \pgfmathresult +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-math-parsing-104} +\pgfmathparse{depth("Some Lovely Text")} \pgfmathresult +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-module-parser.lvt b/testfiles/pgfmanual-en-module-parser.lvt new file mode 100644 index 000000000..29cf8bfe7 --- /dev/null +++ b/testfiles/pgfmanual-en-module-parser.lvt @@ -0,0 +1,47 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usepgfmodule{parser} +\usepgfmodule{parser} +\usepgfmodule{parser} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-module-parser-1} +\newcount\mycount +\pgfparserdef{myparser}{initial}{the letter a}% +{\advance\mycount by 1\relax}% +\pgfparserdef{myparser}{initial}{the letter b}% +{} % do nothing +\pgfparserdef{myparser}{initial}{the letter c}% +{\pgfparserswitch{final}}% done! + +\pgfparserparse{myparser}aabaabababbbbbabaabcccc +There are \the\mycount\ a's. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-module-parser-2} +\newcount\mycount +\mycount=0 +\pgfparserdef{different letters}{all};{\pgfparserswitch{final}}% +\pgfparserdefunknown{different letters}{all}% + {\pgfparserdef{different letters}{all}\pgfparsertoken{}\advance\mycount1}% +\pgfparserdeffinal{different letters}% + {\the\mycount\ different letters found}% +\pgfparserset{different letters/silent=true}% + +\pgfparserparse{different letters}udiaternxqlchudiea; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-module-parser-3} +\pgfparserdef{arguments}{initial}{the letter a}[d()] + {\pgfparserifmark{#1}{\textcolor{red}{\textit{use}}}{\textbf{#1}} }% +\pgfparserdef{arguments}{initial}t[m]{\texttt{#1} }% +\pgfparserdef{arguments}{initial}c[t*O{blue}m] + {\pgfparserifmark{#1}{#3}{\textcolor{#2}{#3}}}% +\pgfparserdef{arguments}{all};{\pgfparserswitch{final}}% + +\pgfparserparse{arguments}t{nobody}a(will)ac[green]{P}c*{arse}c{r}; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-pgfcalendar.lvt b/testfiles/pgfmanual-en-pgfcalendar.lvt new file mode 100644 index 000000000..077ae3396 --- /dev/null +++ b/testfiles/pgfmanual-en-pgfcalendar.lvt @@ -0,0 +1,71 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usepackage{pgfcalendar} +\usepackage{pgfcalendar} +\usepackage{pgfcalendar} +\usepackage{pgfcalendar} +\usepackage{pgfcalendar} +\usepackage{pgfcalendar} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-pgfcalendar-1} +\pgfcalendar{cal}{2007-01-20}{2007-02-10}{\pgfcalendarcurrentday\ } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfcalendar-2} +\pgfcalendar{cal}{2007-01-20}{2007-02-10} +{ + \pgfcalendarcurrentday\ + \ifdate{Sunday}{\par}{} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfcalendar-3} +\pgfcalendar{cal}{2007-01-20}{2007-02-10} +{% + \leavevmode% + \hbox to0pt{\hskip\pgfcalendarcurrentweekday cm\pgfcalendarcurrentday\hss}% + \ifdate{Sunday}{\par}{}% +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfcalendar-4} +\pgfcalendar{cal}{2007-01-01}{2007-02-28}{% + \ifdate{day of month=1}{ + \par\bigskip\hbox to7.5cm{\itshape\hss\pgfcalendarshorthand mt\hss}\par + }{}% + \leavevmode% + {% + \ifdate{weekend}{\color{black!50}}{\color{black}}% + \hbox to0pt{% + \hskip\pgfcalendarcurrentweekday cm% + \hbox to1cm{\hss\pgfcalendarshorthand d-}\hss% + }% + }% + \ifdate{Sunday}{\par}{}% +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfcalendar-5} +\begin{tikzpicture} + \pgfcalendar{cal}{2007-01-20}{2007-02-10}{% + \ifdate{workday} + {\tikzset{filling/.style={fill=blue!20}}} + {\tikzset{filling/.style={fill=red!20}}} + \node (\pgfcalendarsuggestedname) at (\pgfcalendarcurrentweekday,0) + [anchor=base,circle,filling] {\pgfcalendarcurrentday}; + \ifdate{Sunday}{\pgftransformyshift{-3em}}{}% + } + \draw (cal-2007-01-21) -- (cal-2007-02-03); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfcalendar-6} +\let\%=\pgfcalendarshorthand +\pgfcalendar{cal}{2007-01-20}{2007-01-20} +{ ISO form: \%y0-\%m0-\%d0, long form: \%wt, \%mt \%d-, \%y0} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-pgffor.lvt b/testfiles/pgfmanual-en-pgffor.lvt new file mode 100644 index 000000000..9aa3070fa --- /dev/null +++ b/testfiles/pgfmanual-en-pgffor.lvt @@ -0,0 +1,166 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-pgffor-1} +\foreach \x in {1,2,3,0} {[\x]} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-2} +\def\mylist{1,2,3,0} +\foreach \x in \mylist {[\x]} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-3} +\tikz + \foreach \x in {0,1,2,3} + \draw (\x,0) circle (0.2cm); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-4} +\begin{tikzpicture} + \foreach \x in {0,1,2,3} + \foreach \y in {0,1,2,3} + { + \draw (\x,\y) circle (0.2cm); + \fill (\x,\y) circle (0.1cm); + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-5} +\tikz + \foreach \position in {(0,0), (1,1), (2,0), (3,1)} + \draw \position rectangle +(.25,.5); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-6} +\tikz + \draw (0,0) + foreach \x in {1,...,3} + { -- (\x,1) -- (\x,0) } + ; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-7} +\tikz \draw foreach \p in {1,...,3} {(\p,1)--(\p,3) (1,\p)--(3,\p)}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-8} +\begin{tikzpicture} + \foreach \x/\xtext in {0,...,3,2.72 / e} + \draw (\x,0) node{$\xtext$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-9} +\begin{tikzpicture} + % Define some coordinates: + \path[nodes={circle,fill=yellow!80!black,draw}] + (0,0) node(a) {a} + (2,0.55) node(b) {b} + (1,1.5) node(c) {c} + (2,1.75) node(d) {d}; + + % Draw some connections: + \foreach \source/\target in {a/b, b/c, c/a, c/d} + \draw (\source) .. controls +(.75cm,0pt) and +(-.75cm,0pt)..(\target); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-10} +\begin{tikzpicture} + % Let's draw circles at interesting points: + \foreach \x / \y / \r in {0 / 0 / 2mm, 1 / 1 / 3mm, 2 / 0 / 1mm} + \draw (\x,\y) circle (\r); + + % Same effect + \foreach \center/\r in {{(0,0)/2mm}, {(1,1)/3mm}, {(2,0)/1mm}} + \draw[yshift=2.5cm] \center circle (\r); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-11} +\begin{tikzpicture}[line cap=round,line width=3pt] + \filldraw [fill=yellow!80!black] (0,0) circle (2cm); + + \foreach \angle / \label in + {0/3, 30/2, 60/1, 90/12, 120/11, 150/10, 180/9, + 210/8, 240/7, 270/6, 300/5, 330/4} + { + \draw[line width=1pt] (\angle:1.8cm) -- (\angle:2cm); + \draw (\angle:1.4cm) node{\textsf{\label}}; + } + + \foreach \angle in {0,90,180,270} + \draw[line width=2pt] (\angle:1.6cm) -- (\angle:2cm); + + \draw (0,0) -- (120:0.8cm); % hour + \draw (0,0) -- (90:1cm); % minute +\end{tikzpicture}% +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-12} +\tikz[shading=ball] + \foreach \x / \cola in {0/red,1/green,2/blue,3/yellow} + \foreach \y / \colb in {0/red,1/green,2/blue,3/yellow} + \shade[ball color=\cola!50!\colb] (\x,\y) circle (0.4cm); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-13} +\foreach \x [evaluate=\x] in {2^0,2^...,2^8}{$\x$, } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-14} +\foreach \x [evaluate=\x as \xeval] in {2^0,2^...,2^8}{$\x=\xeval$, } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-15} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-16} +\foreach \x [remember=\x as \lastx (initially A)] in {B,...,H}{$\overrightarrow{\lastx\x}$, } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-17} +\tikz[x=0.75cm,y=0.75cm] + \foreach \x [count=\xi] in {a,...,e} + \foreach \y [count=\yi] in {\x,...,e} + \node [draw, top color=white, bottom color=blue!50, minimum size=0.666cm] + at (\xi,-\yi) {$\mathstrut\x\y$}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-18} +\foreach \x [parse=true] in {1,...,1.0e+1 - 1}{ \x } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-19} +\def\Iota#1#2{% + \ifnum\numexpr#1\relax<\numexpr#2\relax + \the\numexpr#1\relax,% + \expandafter\Iota\expandafter{\the\numexpr(#1)+1\relax}{#2}% + \else + \the\numexpr#2\relax + \fi} +\foreach [expand list=true] \x in {\Iota{1}{5}} { + \x +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgffor-20} +\begin{tikzpicture} + \foreach \x in {1,...,4} + \foreach \y in {1,...,4} + { + \fill[red!50] (\x,\y) ellipse (3pt and 6pt); + + \ifnum \x<\y + \breakforeach + \fi + } +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-pgfkeys.lvt b/testfiles/pgfmanual-en-pgfkeys.lvt new file mode 100644 index 000000000..74a529395 --- /dev/null +++ b/testfiles/pgfmanual-en-pgfkeys.lvt @@ -0,0 +1,314 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{graphs,quotes} +\usetikzlibrary{graphs} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-2} +\pgfkeys{/my key/.code=The value is '#1'.} +\pgfkeys{/my key=hi!} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-3} +\pgfkeys{/my key/.code 2 args=The values are '#1' and '#2'.} +\pgfkeys{/my key={a1}{a2}} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-4} +\pgfkeys{/my key/.code=(#1)} +\pgfkeys{/my key/.default=hello} +\pgfkeys{/my key=hallo,/my key} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-7} +\pgfkeys{/a/.code=(a:#1)} +\pgfkeys{/b/.code=(b:#1)} +\pgfkeys{/my style/.style={/a=foo,/b=bar,/a=#1}} +\pgfkeys{/my style=wow} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-9} +\pgfkeyssetvalue{/my family/my key}{Hello, world!} +\pgfkeysvalueof{/my family/my key} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-10} +\def\helloworld{Hello, world!} +\pgfkeyslet{/my family/my key}{\helloworld} +\pgfkeysvalueof{/my family/my key} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-11} +\pgfkeyssetvalue{/my family/my key}{Hello, world!} +\pgfkeysgetvalue{/my family/my key}{\helloworld} +\helloworld +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-12} +\pgfkeyssetvalue{/my family/my key}{Hello, world!} +\pgfkeysvalueof{/my family/my key} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-13} +\pgfkeyssetvalue{/my family/my key}{Hello, world!} +\pgfkeysifdefined{/my family/my key}{yes}{no} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-16} +\tikz \graph { a ->["1" red] b ->["0"] c }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-17} +\tikz \graph { a ->[edge node={node[red,auto]{1}}] b ->[edge label=0] c }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-18} +\let\mycharacter=" +\meaning\mycharacter +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-19} +\pgfkeys{ + /handlers/first char syntax=true, + /handlers/first char syntax/the character "/.initial=\myquotemacro, + /handlers/first char syntax/the character } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-20} +\pgfkeys{ + /handlers/first char syntax=true, + /handlers/first char syntax/the character '/.initial=\mysinglequotemacro +} + +\def\mysinglequotemacro#1{\pgfkeysalso{label={#1}}} + +\tikz \node [circle, 'foo', draw] {bar}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-21} +\pgfkeys{ + /handlers/first char syntax=true, + /handlers/first char syntax/the character (/.initial=\myparamacro +} + +\def\myparamacro#1{\myparaparser#1\someendtext} +\def\myparaparser(#1)#2\someendtext{ + \pgfmathparse{#1} + \ifx\pgfmathresult\onetext + \pgfkeysalso{#2} + \fi +} +\def\onetext{1} + +\foreach \i in {1,...,4} + \tikz \node [draw, thick, rectangle, (pi>\i) circle, (pi>\i*2) draw=red] {x}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-22} +\def\mystore#1+#2\pgfeov{\def\a{#1}\def\b{#2}} +\pgfkeyslet{/my key/.@cmd}{\mystore} +\pgfkeys{/my key=hello+world} + +|\a| is \a, |\b| is \b. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-23} +\pgfkeysdef{/my key}{#1, #1.} +\pgfkeys{/my key=hello} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-24} +\pgfkeysdefnargs{/my key}{2}{\def\a{#1}\def\b{#2}} +\pgfkeys{/my key= + {hello} + {world}} + +|\a| is `\a', |\b| is `\b'. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-25} +\pgfkeysdefargs{/my key}{#1+#2}{\def\a{#1}\def\b{#2}} +\pgfkeys{/my key=hello+world} + +|\a| is \a, |\b| is \b. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-27} +\pgfkeysdef{/handlers/.my code}{\pgfkeysdef{\pgfkeyscurrentpath}{#1}} +\pgfkeys{/my key/.my code=(#1)} +\pgfkeys{/my key=hallo} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-28} +\pgfkeys{/the/key/.code={Initial definition. }} +\pgfkeys{/handlers/.unknown/.code={Unknown key `\pgfkeyscurrentkey'. }} + +\pgfkeys{/the/key} + +\pgfkeys{/handler config=only existing} + +\pgfkeys{/the/key/.code={Re-Definition. }} +\pgfkeys{/the/key} + +\pgfkeys{/the/other key/.code={New definition. }} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-31} +\pgfkeys{/my search path/.unknown/.code= + {% + \let\searchname=\pgfkeyscurrentname% + \pgfkeysalso{% + /a/\searchname/.try=#1, + /b/\searchname/.retry=#1, + /b/c/\searchname/.retry=#1% + }% + }% +} + +\pgfkeys{/b/custom/.code={This is `\pgfkeyscurrentkey'. }} + +\pgfkeys{/handler config=only existing} + +\pgfkeys{/my search path/.cd,custom} + +\pgfkeys{/my search path/.cd,custom/.append code={Modified. }} + +\pgfkeys{/my search path/.cd,custom} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-36} +\pgfkeys{/a key/.code n args={2}{First=`#1', Second=`#2'}} +\pgfkeys{/a key={A}{B}} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-40} +\begin{tikzpicture}[outline/.style={draw=#1,fill=#1!20}] + \node [outline=red] {red box}; + \node [outline=blue] at (0,-1) {blue box}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-44} +\pgfkeys{/my key/.initial=red} +\pgfkeys{/my key/.code=#1} +\pgfkeys{/my key=blue} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-45} +\pgfkeys{/my key/.initial=red} +\pgfkeys{/my key=blue} +\pgfkeys{/my key/.get=\mymacro} +\mymacro +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-46} +\pgfkeys{/text/.store in=\mytext} +\def\a{world} +\pgfkeys{/text=Hello \a!} +\def\a{Gruffalo} +\mytext +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-47} +\pgfkeys{/text/.estore in=\mytext} +\def\a{world} +\pgfkeys{/text=Hello \a!} +\def\a{Gruffalo} +\mytext +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-48} +\newif\iftheworldisflat +\pgfkeys{/flat world/.is if=theworldisflat} +\pgfkeys{/flat world=false} +\iftheworldisflat + Flat +\else + Round? +\fi +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-50} +\def\a{bottom} +\def\b{\a} +\def\c{\b} + +\pgfkeys{/key1/.initial=\c} +\pgfkeys{/key2/.initial/.expand once=\c} +\pgfkeys{/key3/.initial/.expand twice=\c} +\pgfkeys{/key4/.initial/.expanded=\c} + +\def\a{{\ttfamily\string\a}} +\def\b{{\ttfamily\string\b}} +\def\c{{\ttfamily\string\c}} + +\begin{tabular}{ll} +Key 1:& \pgfkeys{/key1} \\ +Key 2:& \pgfkeys{/key2} \\ +Key 3:& \pgfkeys{/key3} \\ +Key 4:& \pgfkeys{/key4} +\end{tabular} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-51} +\pgfkeys{ + /golden ratio/.initial/.evaluated={(1 + sqrt(5))/2}, +} +\pgfkeys{/golden ratio} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-52} +\pgfkeys{/foo/.code=(#1)} +\pgfkeys{/foo/.list={a,b,0,1,...,5}} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-53} +\pgfkeys{ + /a/.code=(a:#1), + /b/.code=(b:#1), + /b/.forward to=/a, + /c/.forward to=/a +} +\pgfkeys{/b=1} \pgfkeys{/c=2} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-54} +\pgfkeys{/secondary path/option/.code={Invoking /secondary path/option with `#1'}} + +\pgfkeys{/main path/.search also={/secondary path}} + +\pgfkeys{/main path/.cd,option=value} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-55} +\pgfkeys{/secondary path/option/.code={Invoking /secondary path/option with `#1'}} + +\pgfkeys{/main path/.search also={/secondary path}} + +\pgfkeys{/main path/.cd,option=value} + +\pgfkeys{/handlers/.unknown/.code={Found unknown option \pgfkeyscurrentkeyRAW={#1}!}}% +\pgfkeys{/main path/.cd,/main path/option=value} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-59} +\pgfkeys{/a/.code=(a:#1)} +\pgfkeys{/b/.code=(b:#1)} +\pgfkeys{/x/.try=hmm,/a/.try=hallo,/b/.try=welt} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeys-60} +\pgfkeys{/a/.code=(a:#1)} +\pgfkeys{/b/.code=(b:#1)} +\pgfkeys{/x/.try=hmm,/a/.retry=hallo,/b/.retry=welt} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-pgfkeysfiltered.lvt b/testfiles/pgfmanual-en-pgfkeysfiltered.lvt new file mode 100644 index 000000000..bf14453bc --- /dev/null +++ b/testfiles/pgfmanual-en-pgfkeysfiltered.lvt @@ -0,0 +1,87 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\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, +} + +\BEGINBOXTEST{pgfmanual-en-pgfkeysfiltered-3} +\pgfkeys{/my group/A1=a1, /my group/A2=a2, /my group/B=b, /my group/C=c} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeysfiltered-6} +\pgfkeys{/my group/A/.activate family} +\pgfkeysfiltered{/my group/A1=a1, /my group/A2=a2, + /my group/B=b, /my group/C=c} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeysfiltered-7} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeysfiltered-8} +\pgfkeys{/pgf/key filter handlers/append filtered to/.install key filter handler=\remainingoptions} +\def\remainingoptions{} +\pgfkeysfiltered{/my group/A1=a1, /my group/A2=a2, + /my group/B=b, /my group/C=c, /tikz/color=blue, /my group/A3=a3} + +Remaining: `\remainingoptions'. +\pgfkeysalsofrom{\remainingoptions} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeysfiltered-10} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeysfiltered-11} +\pgfkeys{/pgf/key filter handlers/append filtered to/.install key filter handler=\remainingoptions} +\def\remainingoptions{} +\pgfkeysfiltered{/my group/A1=a1, /my group/A2=a2, + /my group/B=b, /my group/C=c, /tikz/color=blue} + +Remaining options: `\remainingoptions'. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeysfiltered-14} +\pgfkeys{ +/group 1/A/.code={(A:#1)}, +/group 1/foo/bar/B/.code={(B:#1)}, +/group 2/C/.code={(C:#1)}, +/pgf/key filters/is descendant of/.install key filter=/group 1} +\pgfkeysfiltered{/group 1/A=a,/group 1/foo/bar/B=b,/group 2/C=c} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeysfiltered-15} +\pgfkeys{ +/group 1/A/.code={(A:#1)}, +/group 1/B/.code={(B:#1)}, +/pgf/key filters/equals/.install key filter=/group 1/A} +\pgfqkeysfiltered{/group 1}{A=a,B=b} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfkeysfiltered-16} +\pgfkeys{ +/group 1/A/.code={(A:#1)}, +/group 1/foo/bar/B/.code={(B:#1)}, +/group 2/C/.code={(C:#1)}, +/pgf/key filters/not/.install key filter= + {/pgf/key filters/is descendant of=/group 1}} +\pgfkeysfiltered{/group 1/A=a,/group 1/foo/bar/B=b,/group 2/C=c} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-pgfsys-animations.lvt b/testfiles/pgfmanual-en-pgfsys-animations.lvt new file mode 100644 index 000000000..70ba9bfcf --- /dev/null +++ b/testfiles/pgfmanual-en-pgfsys-animations.lvt @@ -0,0 +1,574 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations,views} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} + +\begin{document} + +\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}; + }% +} +\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]; } } + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-4} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvalscalar{1} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvalscalar{0} + \pgfsysanimate{opacity} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-5} +\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}; + } +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-6} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvalscalar{1} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvalscalar{0} + \pgfsysanimate{opacity} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-7} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvalscalar{1} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvalscalar{0} + \pgfsysanimate{fillopacity} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-8} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvalscalar{1} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvalscalar{0} + \pgfsysanimate{strokeopacity} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-9} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvaltext{hidden} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvaltext{hidden} + \pgfsysanimate{visibility} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-10} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvalcolorrgb{0}{0}{0} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvalcolorrgb{1}{0}{0} + \pgfsysanimate{strokecolor} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-11} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvalcolorrgb{0}{0}{0} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvalcolorrgb{1}{0}{0} + \pgfsysanimate{fillcolor} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-12} +\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); } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-13} +\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);} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-14} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvaldimension{1pt} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvaldimension{10pt} + \pgfsysanimate{linewidth} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-15} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvaldash{1pt,10pt}{0pt} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvaldash{10pt,3pt}{0pt} + \pgfsysanimate{dash} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-16} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvaldash{1cm,1pt}{0pt} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvaldash{1cm,1pt}{1cm} + \pgfsysanimate{dash} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-17} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvaldash{3pt,1pt}{0pt} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvaldash{1pt,3pt}{10pt} + \pgfsysanimate{dash} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-19} +\animationcanvasexample +{} +{} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-20} +\animationcanvasexample +{\pgfsys@transformshift{10mm}{0mm}} +{\pgfsys@transformshift{-10mm}{0mm}} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-21} +\animationcanvasexample +{\pgfsys@transformcm{0.5}{0.5}{-0.5}{0.5} + {0pt}{0pt}} +{} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-22} +\animationcanvasexample +{\pgfsys@transformcm{0.5}{0.5}{-0.5}{0.5} + {0pt}{0pt}} +{\pgfsys@transformcm{1}{-1}{1}{1} + {0pt}{0pt}} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-23} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvaltranslate{0cm}{0cm}% + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvaltranslate{5mm}{-1cm} + \pgfsysanimate{translate} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-24} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvalscale{1}{1}% + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvalscale{0.5}{2} + \pgfsysanimate{scale} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-25} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvalscalar{0}% + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvalscalar{90} + \pgfsysanimate{rotate} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-26} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvalscalar{0}% + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvalscalar{45} + \pgfsysanimate{skewx} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-27} + +\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} +} + +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-28} + +\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} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-29} +\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]; +} } } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-31} +\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} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-32} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvaltranslate{0cm}{0cm} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvaltranslate{0cm}{-1cm} + \pgfsysanimkeyrepeatindefinite + \pgfsysanimate{translate} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-33} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvaltranslate{0cm}{0cm} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvaltranslate{0cm}{-1cm} + \pgfsysanimkeyrepeatdur{5} + \pgfsysanimate{translate} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-34} + +\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} } + +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-35} +\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} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-36} +\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} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-37} +\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} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-38} +\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} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-39} +\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} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-40} +\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}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-41} +\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} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-42} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvaltranslate{0cm}{0cm} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvaltranslate{0cm}{-1cm} + \pgfsysanimkeyrestartalways + \pgfsysanimate{translate} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-43} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvaltranslate{0cm}{0cm} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvaltranslate{0cm}{-1cm} + \pgfsysanimkeyrestartnever + \pgfsysanimate{translate} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-44} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvaltranslate{0cm}{0cm} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvaltranslate{0cm}{-1cm} + \pgfsysanimkeyrestartwhennotactive + \pgfsysanimate{translate} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-45} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvaltranslate{0cm}{0cm} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvaltranslate{0cm}{-1cm} + \pgfsysanimkeyfreezeatend + \pgfsysanimate{translate} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-46} +\animationexample{node}{}{ + \pgfsysanimkeytime{0}{1}{1}{0}{0} + \pgfsysanimvaltranslate{0cm}{0cm} + \pgfsysanimkeytime{2}{1}{1}{0}{0} + \pgfsysanimvaltranslate{0cm}{-1cm} + \pgfsysanimkeyremoveatend + \pgfsysanimate{translate} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-47} +\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} } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-pgfsys-animations-48} +\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} } +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-actions.lvt b/testfiles/pgfmanual-en-tikz-actions.lvt new file mode 100644 index 000000000..a7dacd0e7 --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-actions.lvt @@ -0,0 +1,595 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{decorations} +\usepackage{amsmath} +\usetikzlibrary{arrows.meta} +\usepackage{amsmath} +\usetikzlibrary{arrows.meta} +\usepackage{amsmath} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta,bending} +\usetikzlibrary{arrows.meta,bending} +\usetikzlibrary{patterns} +\usetikzlibrary{patterns} +\usetikzlibrary{patterns} +\usetikzlibrary{patterns} +\usetikzlibrary{fadings,patterns} +\usetikzlibrary{fadings} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing,shadows} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-3} +\tikz \fill[color=red!20] (0,0) circle (1ex); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-4} +\tikz \fill[red!20] (0,0) circle (1ex); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-5} +\begin{tikzpicture} + \path[draw=red] (0,0) -- (1,1) -- (2,1) circle (10pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-6} +\tikz \draw[line width=5pt] (0,0) -- (1cm,1.5ex); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-7} +\tikz \draw[ultra thin] (0,0) -- (1cm,1.5ex); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-8} +\tikz \draw[very thin] (0,0) -- (1cm,1.5ex); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-9} +\tikz \draw[thin] (0,0) -- (1cm,1.5ex); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-10} +\tikz \draw[semithick] (0,0) -- (1cm,1.5ex); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-11} +\tikz \draw[thick] (0,0) -- (1cm,1.5ex); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-12} +\tikz \draw[very thick] (0,0) -- (1cm,1.5ex); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-13} +\tikz \draw[ultra thick] (0,0) -- (1cm,1.5ex); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-14} +\begin{tikzpicture} + \begin{scope}[line width=10pt] + \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,0) (0,1 ) -- +(1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-15} +\begin{tikzpicture}[line width=10pt] + \draw[line join=round] (0,0) -- ++(.5,1) -- ++(.5,-1); + \draw[line join=bevel] (1.25,0) -- ++(.5,1) -- ++(.5,-1); + \draw[line join=miter] (2.5,0) -- ++(.5,1) -- ++(.5,-1); + \useasboundingbox (0,1.5); % enlarge bounding box +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-16} +\begin{tikzpicture}[line width=5pt] + \draw (0,0) -- ++(5,.5) -- ++(-5,.5); + \draw[miter limit=25] (6,0) -- ++(5,.5) -- ++(-5,.5); + \useasboundingbox (14,0); % make bounding box bigger +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-17} +\begin{tikzpicture}[dash pattern=on 2pt off 3pt on 4pt off 4pt] + \draw (0pt,0pt) -- (3.5cm,0pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-18} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-19} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-20} +\begin{tikzpicture}[|-|, dash pattern=on 4pt off 2pt] + \draw [dash expand off] (0pt,30pt) -- (26pt,30pt); + \draw [dash expand off] (0pt,20pt) -- (24pt,20pt); + \draw [dash expand off] (0pt,10pt) -- (22pt,10pt); + \draw [dash expand off] (0pt, 0pt) -- (20pt, 0pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-21} +\tikz \draw[solid] (0pt,0pt) -- (50pt,0pt); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-22} +\tikz \draw[dotted] (0pt,0pt) -- (50pt,0pt); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-23} +\tikz \draw[densely dotted] (0pt,0pt) -- (50pt,0pt); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-24} +\tikz \draw[loosely dotted] (0pt,0pt) -- (50pt,0pt); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-25} +\tikz \draw[dashed] (0pt,0pt) -- (50pt,0pt); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-26} +\tikz \draw[densely dashed] (0pt,0pt) -- (50pt,0pt); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-27} +\tikz \draw[loosely dashed] (0pt,0pt) -- (50pt,0pt); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-28} +\tikz \draw[dash dot] (0pt,0pt) -- (50pt,0pt); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-29} +\tikz \draw[densely dash dot] (0pt,0pt) -- (50pt,0pt); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-30} +\tikz \draw[loosely dash dot] (0pt,0pt) -- (50pt,0pt); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-31} +\tikz \draw[dash dot dot] (0pt,0pt) -- (50pt,0pt); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-32} +\tikz \draw[densely dash dot dot] (0pt,0pt) -- (50pt,0pt); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-33} +\tikz \draw[loosely dash dot dot] (0pt,0pt) -- (50pt,0pt); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-34} +\tikz \draw[double] + plot[smooth cycle] coordinates{(0,0) (1,1) (1,0) (0,1)}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-35} +\begin{tikzpicture} + \draw (0,0) -- (1,1); + \draw[draw=white,double=red,very thick] (0,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-36} +\begin{tikzpicture} + \draw[very thick,double] (0,0) arc (180:90:1cm); + \draw[very thick,double distance=2pt] (1,0) arc (180:90:1cm); + \draw[thin,double distance=2pt] (2,0) arc (180:90:1cm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-37} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-38} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-39} +\Huge $=\implies$\tikz[baseline,double equal sign distance] + \draw[double,thick,-{Implies[]}](0,0.55ex) --++(3ex,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-40} +\normalsize $=\implies$\tikz[baseline,double equal sign distance] + \draw[double,-{Implies[]}](0,0.6ex) --++(3ex,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-41} +\tiny $=\implies$\tikz[baseline,double equal sign distance] + \draw[double,very thin,-{Implies[]}](0,0.5ex) -- ++(3ex,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-42} +\tikz \path[tips, -{Latex[open,length=10pt,bend]}] (0,0) to[bend left] (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-43} +\tikz \draw[tips, -{Latex[open,length=10pt,bend]}] (0,0) to[bend left] (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-44} +\begin{tikzpicture} + \fill (0,0) -- (1,1) -- (2,1); + \fill (4,0) circle (.5cm) (4.5,0) circle (.5cm); + \fill[even odd rule] (6,0) circle (.5cm) (6.5,0) circle (.5cm); + \fill (8,0) -- (9,1) -- (10,0) circle (.5cm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-45} +\begin{tikzpicture}[fill=yellow!80!black,line width=5pt] + \filldraw (0,0) -- (1,1) -- (2,1); + \filldraw (4,0) circle (.5cm) (4.5,0) circle (.5cm); + \filldraw[even odd rule] (6,0) circle (.5cm) (6.5,0) circle (.5cm); + \filldraw (8,0) -- (9,1) -- (10,0) circle (.5cm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-46} +\begin{tikzpicture} + \draw[pattern=dots] (0,0) circle (1cm); + \draw[pattern=fivepointed stars] (0,0) rectangle (3,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-47} +\begin{tikzpicture} + \draw[pattern color=red,pattern=fivepointed stars] (0,0) circle (1cm); + \draw[pattern color=blue,pattern=fivepointed stars] (0,0) rectangle (3,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-48} +\begin{tikzpicture} + \def\mypath{(0,0) -- +(0,1) arc (180:0:1.5cm) -- +(0,-1)} + \fill [red] \mypath; + \pattern[pattern color=white,pattern=bricks] \mypath; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-49} +\begin{tikzpicture} + \filldraw[fill=yellow!80!black] + % Clockwise rectangle + (0,0) -- (0,1) -- (1,1) -- (1,0) -- cycle + % Counter-clockwise rectangle + (0.25,0.25) -- (0.75,0.25) -- (0.75,0.75) -- (0.25,0.75) -- cycle; + + \draw[->] (0,1) -- (.4,1); + \draw[->] (0.75,0.75) -- (0.3,.75); + + \draw[->] (0.5,0.5) -- +(0,1) node[above] {crossings: $-1+1 = 0$}; + + \begin{scope}[yshift=-3cm] + \filldraw[fill=yellow!80!black] + % Clockwise rectangle + (0,0) -- (0,1) -- (1,1) -- (1,0) -- cycle + % Clockwise rectangle + (0.25,0.25) -- (0.25,0.75) -- (0.75,0.75) -- (0.75,0.25) -- cycle; + + \draw[->] (0,1) -- (.4,1); + \draw[->] (0.25,0.75) -- (0.4,.75); + + \draw[->] (0.5,0.5) -- +(0,1) node[above] {crossings: $1+1 = 2$}; + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-50} +\begin{tikzpicture} + \filldraw[fill=yellow!80!black,even odd rule] + (0,0) rectangle (1,1) (0.5,0.5) circle (0.4cm); + \draw[->] (0.5,0.5) -- +(0,1) [above] node{crossings: $1+1 = 2$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-51} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + \filldraw [fill=blue!10,draw=blue,thick] (1.5,1) circle (1) + [path picture={ + \node at (path picture bounding box.center) { + This is a long text. + };} + ]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-52} +\begin{tikzpicture}[cross/.style={path picture={ + \draw[black] + (path picture bounding box.south east) -- + (path picture bounding box.north west) + (path picture bounding box.south west) -- + (path picture bounding box.north east); + }}] + \draw [help lines] (0,0) grid (3,2); + \filldraw [cross,fill=blue!10,draw=blue,thick] (1,1) circle (1); + \path [cross,top color=red,draw=red,thick] (2,0) -- (3,2) -- (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-53} +\begin{tikzpicture}[path image/.style={ + path picture={ + \node at (path picture bounding box.center) { + \includegraphics[height=3cm]{#1} + };}}] + \draw [help lines] (0,0) grid (3,2); + + \draw [path image=brave-gnu-world-logo,draw=blue,thick] + (0,1) circle (1); + \draw [path image=brave-gnu-world-logo,draw=red,very thick,->] + (1,0) parabola[parabola height=2cm] (3,0); + +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-54} +\tikz \shade (0,0) circle (1ex); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-55} +\tikz \shadedraw (0,0) circle (1ex); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-56} +\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); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-57} +\tikz \shadedraw [left color=red,right color=blue] + (0,0) rectangle (1,1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-58} +\tikz \shadedraw [shading=axis,shading angle=90] (0,0) rectangle (1,1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-59} +Left of picture\begin{tikzpicture} + \draw[use as bounding box] (2,0) rectangle (3,1); + \draw (1,0) -- (4,.75); +\end{tikzpicture}right of picture. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-60} +Left of picture +\begin{tikzpicture} + \useasboundingbox (0,0) rectangle (3,1); + \fill (.75,.25) circle (.5cm); +\end{tikzpicture} +right of picture. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-61} +\begin{tikzpicture} + \draw[red] (0,0) circle (2pt); + \draw[red] (2,1) circle (3pt); + + \draw (current bounding box.south west) rectangle + (current bounding box.north east); + + \draw[red] (3,-1) circle (4pt); + + \draw[thick] (current bounding box.south west) rectangle + (current bounding box.north east); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-62} +Text before image.% + \begin{tikzpicture}[trim left] + \draw (-1,-1) grid (3,2); + \fill (0,0) circle (5pt); + \end{tikzpicture}% +Text after image. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-63} +\vbox\bgroup\hsize=5cm +\begin{tikzpicture} + \draw (0,1) -- (0,0) -- (1,1) -- cycle; + \fill (0,0) circle (2pt); + \node[left] at (0,0) {$-1$}; +\end{tikzpicture} +\par +\begin{tikzpicture} + \draw (0,1) -- (0,0) -- (1,1) -- cycle; + \fill (0,0) circle (2pt); + \node[left] at (0,0) {$1$}; +\end{tikzpicture} +\par +\begin{tikzpicture}[trim left] + \draw (0,1) -- (0,0) -- (1,1) -- cycle; + \fill (0,0) circle (2pt); + \node[left] at (0,0) {$-1$}; +\end{tikzpicture} +\par +\begin{tikzpicture}[trim left] + \draw (0,1) -- (0,0) -- (1,1) -- cycle; + \fill (0,0) circle (2pt); + \node[left] at (0,0) {$1$}; +\end{tikzpicture} +\egroup +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-64} +Text before image.% + \begin{tikzpicture}[trim left, trim right=2cm, baseline] + \draw (-1,-1) grid (3,2); + \fill (0,0) circle (5pt); + \end{tikzpicture}% +Text after image. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-65} +\begin{tikzpicture} + \draw[clip] (0,0) circle (1cm); + \fill[red] (1,0) circle (1cm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-66} +\begin{tikzpicture} + \clip (0,0) circle (1cm); + \fill[red] (1,0) circle (1cm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-67} +\begin{tikzpicture} + \draw (0,0) -- ( 0:1cm); + \draw (0,0) -- (10:1cm); + \draw (0,0) -- (20:1cm); + \draw (0,0) -- (30:1cm); + \begin{scope}[fill=red] + \fill[clip] (0.2,0.2) rectangle (0.5,0.5); + + \draw (0,0) -- (40:1cm); + \draw (0,0) -- (50:1cm); + \draw (0,0) -- (60:1cm); + \end{scope} + \draw (0,0) -- (70:1cm); + \draw (0,0) -- (80:1cm); + \draw (0,0) -- (90:1cm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-68} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \draw + [preaction={draw,line width=4mm,blue}] + [line width=2mm,red] (0,0) rectangle (2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-69} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw + [preaction={fill=black,opacity=.5, + transform canvas={xshift=1mm,yshift=-1mm}}] + [fill=red] (0,0) rectangle (1,2) + (1,2) circle (5mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-70} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw [pattern=fivepointed stars] + [preaction={fill=black,opacity=.5, + transform canvas={xshift=1mm,yshift=-1mm}}] + [preaction={top color=blue,bottom color=white}] + (0,0) rectangle (1,2) + (1,2) circle (5mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-71} +\begin{tikzpicture} + [ + % Define an interesting style + button/.style={ + % First preaction: Fuzzy shadow + preaction={fill=black,path fading=circle with fuzzy edge 20 percent, + opacity=.5,transform canvas={xshift=1mm,yshift=-1mm}}, + % Second preaction: Background pattern + preaction={pattern=#1, + path fading=circle with fuzzy edge 15 percent}, + % Third preaction: Make background shiny + preaction={top color=white, + bottom color=black!50, + shading angle=45, + path fading=circle with fuzzy edge 15 percent, + opacity=0.2}, + % Fourth preaction: Make edge especially shiny + preaction={path fading=fuzzy ring 15 percent, + top color=black!5, + bottom color=black!80, + shading angle=45}, + inner sep=2ex + }, + button/.default=horizontal lines light blue, + circle + ] + + \draw [help lines] (0,0) grid (4,3); + + \node [button] at (2.2,1) {\Huge Big}; + \node [button=crosshatch dots light steel blue, + text=white] at (1,1.5) {Small}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-72} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \draw + [postaction={draw,line width=2mm,blue}] + [line width=4mm,red,fill=white] (0,0) rectangle (2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-73} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw + [postaction={path fading=south,fill=white}] + [postaction={path fading=south,fading angle=45,fill=blue,opacity=.5}] + [left color=black,right color=red,draw=white,line width=2mm] + (0,0) rectangle (1,2) + (1,2) circle (5mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-74} +\begin{tikzpicture} + \draw (0,0) rectangle (3,2); + \draw [red, decorate, decoration=zigzag] + (0,0) rectangle (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-actions-75} +\begin{tikzpicture} + \node [circular drop shadow={shadow scale=1.05},minimum size=3.13cm, + decorate, decoration=zigzag, + fill=blue!20,draw,thick,circle] {Hello!}; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-animations.lvt b/testfiles/pgfmanual-en-tikz-animations.lvt new file mode 100644 index 000000000..e17ed2e17 --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-animations.lvt @@ -0,0 +1,752 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations,views} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{animations} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-1} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-2} +\tikz \draw :xshift = {0s = "0cm", 30s = "-3cm", repeats} (0,0) circle (5mm); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-3} +\tikz \node [fill, text = white, animate = { + myself:fill = {0s = "red", 2s = "blue", begin on = click }}] {Click me}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-4} +\tikz [animate = {a node:fill = {0s = "red", 2s = "blue", + begin on = click}}] + \node (a node) [fill, text = white] {Click me}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-5} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-6} +\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 }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-7} +\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 }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-8} +\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 }; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-9} +\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}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-10} +\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); } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-11} +\tikz [animate = {attribute = fill, n: = { 0s = "red", 2s = "blue", + begin on = click } }] + \node (n) [fill, text = white] {The node}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-12} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-13} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-15} +\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 }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-20} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-27} +\tikz \node + :fill opacity = { 0s="1", 2s="0", begin on=click } + [fill = blue!20, draw = blue, ultra thick, circle] {Here!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-28} +\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!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-29} +\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!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-30} +\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!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-37} +\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}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-38} +\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}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-39} +\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}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-40} +\tikz \node :fill opacity = { 0s="1", 2s="0", begin on=click } + [fill = blue!20, draw = blue, ultra thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-41} +\tikz \node :opacity = { 0s="1", 2s="0", begin on=click } + [fill = blue!20, draw = blue, ultra thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-42} +\tikz :visible = {begin on=click, 0s="false", 2s="false"} + \node (node) [fill = blue!20, draw = blue, very thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-43} +\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}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-44} +\tikz \node :line width = { 0s="1pt", 2s="5mm", begin on=click} + [fill = blue!20, draw = blue, ultra thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-45} +\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!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-46} +\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!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-47} +\tikz \node :dash phase = { 0s="0pt", 2s="1cm", begin on=click} + [fill = blue!20, draw = blue, ultra thick, circle, dashed] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-48} +\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!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-49} +\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!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-53} +\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} }; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-54} +\tikz \node :scale = { 0s="1", 2s="0.2", begin on=click} + [fill = blue!20, draw = blue, ultra thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-55} +\tikz \node :rotate = { 0s="45", 2s="90", begin on=click} + [fill = blue!20, draw = blue, ultra thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-56} +\tikz \node :xskew = { 0s="0", 2s="45", begin on=click} + [fill = blue!20, draw = blue, ultra thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-57} +\tikz \node :xslant = { 0s="-1", 2s="1", begin on=click} + [fill = blue!20, draw = blue, ultra thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-58} +\tikz \node :shift = { 0s="{(0,0)}", 2s="{(5mm,-5mm)}", + begin on=click} + [fill = blue!20, draw = blue, ultra thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-59} +\tikz \node :xshift = { 0s="0pt", 2s="5mm", begin on=click} + [fill = blue!20, draw = blue, ultra thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-60} +\tikz \node :shift = { 0s = "{(0,0)}", 2s = "{(5mm,-5mm)}", + begin on = click } + [fill = blue!20, draw = blue, ultra thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-61} +\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}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-62} +\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}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-63} +\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}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-64} +\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}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-65} +\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}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-66} +\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}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-67} +\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}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-69} +\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}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-70} +\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}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-71} +\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}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-72} +\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} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-73} +\tikz \node [fill = green, text = white] :fill = + { 1s = "red", 2s = "blue", base = "orange", begin on = click } + {Click me}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-74} +\tikz \node [fill = green, text = white] :fill = + { 1s = {"red" = base}, 2s = "blue", begin on = click } + {Click me}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-75} +\tikz \node [fill = green, text = white] :fill = + { 1s = "red" base, 2s = "blue", begin on = click } + {Click me}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-76} +\tikz \node :fill = { 1s="red", 2s="blue", forever, begin on=click} + [fill = green!50!black, text = white] {Click me}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-77} +\tikz \node [fill = green!50!black, text = white] + :fill = { 1s = "red", 2s = "blue", begin on = click } + {Click me}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-78} +\tikz \node [fill = green!50!black, text = white] + :rotate = { 1s = "0", 5s = "90", begin = 2s, end = 4s } + {Click me}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-79} +\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}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-80} +\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}; } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-81} +\tikz \node :rotate = { 0s="0", 2s="90", begin on = {click}} + [fill = blue!20, draw = blue, circle, ultra thick] {Here!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-82} +\tikz \node :rotate = { 0s="0", 2s="90", begin on = {mouse down}} + [fill = blue!20, draw = blue, circle, ultra thick] {Here!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-83} +\tikz \node :rotate = { 0s="0", 2s="90", begin on = {mouse up} } + [fill = blue!20, draw = blue, circle, ultra thick] {Here!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-84} +\tikz \node :rotate = { 0s="0", 2s="90", begin on = {mouse over} } + [fill = blue!20, draw = blue, circle, ultra thick] {Here!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-85} +\tikz \node :rotate = { 0s="0", 2s="90", begin on = {mouse move} } + [fill = blue!20, draw = blue, circle, ultra thick] {Here!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-86} +\tikz \node :rotate = { 0s="0", 2s="90", begin on = {mouse out} } + [fill = blue!20, draw = blue, circle, ultra thick] {Here!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-87} +\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!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-88} +\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!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-89} +\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!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-90} +\tikz \node :rotate = { 0s="0", 2s="90", + restart = false, begin on = {click}} + [fill = blue!20, draw = blue, circle, ultra thick] {Here!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-91} +\tikz \node :rotate = { 0s="0", 2s="90", + restart = when not active, begin on = {click}} + [fill = blue!20, draw = blue, circle, ultra thick] {Here!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-92} +\tikz \node :rotate = { 0s = "0", 2s = "90", + repeats, begin on = click } + [fill = blue!20, draw = blue, ultra thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-93} +\tikz \node :rotate = { 0s = "0", 2s = "90", + repeats = 1.75, begin on = click } + [fill = blue!20, draw = blue, ultra thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-94} +\tikz \node :rotate = { 0s = "0", 2s = "90", + repeats = for 3.5s, begin on = click } + [fill = blue!20, draw = blue, ultra thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-95} +\tikz \node :rotate = { 0s = "0", 2s = "90", begin on = click, + repeats = accumulating } + [fill = blue!20, draw = blue, ultra thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-96} +\tikz \node :rotate = { 0s = "0", 2s = "90", begin on = click, + repeats = for 4s accumulating } + [fill = blue!20, draw = blue, ultra thick, circle] {Click me!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-99} +\tikz { + \foreach \i in {0,0.125,...,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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-100} +\tikz { + \foreach \i in {0,0.125,...,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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-101} +\tikz { + \foreach \i in {0,0.125,...,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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-102} +\tikz { + \foreach \i in {0,0.125,...,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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-103} +\tikz { + \foreach \i in {0,0.125,...,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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-104} +\tikz { + \foreach \i in {0,0.125,...,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!}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-105} +\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]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-106} +\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); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-107} +\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); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-animations-108} +\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); +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-arrows.lvt b/testfiles/pgfmanual-en-tikz-arrows.lvt new file mode 100644 index 000000000..87f68660c --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-arrows.lvt @@ -0,0 +1,744 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{arrows.meta,bending,positioning} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta,graphs} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{patterns} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta,bending} +\usetikzlibrary{arrows.meta,bending} +\usetikzlibrary{arrows.meta,bending} +\usetikzlibrary{arrows.meta,bending} +\usetikzlibrary{bending} +\usetikzlibrary{arrows.meta,bending} +\usetikzlibrary{arrows.meta,bending} +\usetikzlibrary{arrows.meta,bending} +\usetikzlibrary{arrows.meta,bending} +\usetikzlibrary{bending} +\usetikzlibrary{arrows.meta,bending} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta,positioning} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta,graphs} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta,bending} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{arrows.meta,bending} + +\begin{document} + +\usetikzlibrary{patterns} +\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); } + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-1} +\tikz { + \node [circle,draw] (A) {A}; + \node [circle,draw] (B) [right=of A] {B}; + + \draw [draw = blue, thick, + arrows={ + 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) + (B) edge [in=-110, out=-70,looseness=8] (B); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-2} +\begin{tikzpicture} + \draw[->] (0,0) -- (1,0); + \draw[>-Stealth] (0,0.3) -- (1,0.3); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-3} +\begin{tikzpicture} + \draw[-{Stealth[red]}] (0,0) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-4} +\tikz [<->] \draw; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-5} +\tikz [<->] \draw (0,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-6} +\tikz [<->] \draw [tips=proper] (0,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-7} +\tikz [<->] \draw (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-8} +\tikz [<->] \draw (0,0) -- (1,0) (2,0) -- (3,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-9} +\tikz [<->] \draw (0,0) -- (1,0) (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-10} +\tikz [<->] \draw [tips=on proper draw] (0,0) -- (1,0) (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-11} +\tikz [<->] \draw (0,0) circle[radius=2pt] (2,0) -- (3,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-12} +\tikz{ + \draw [-{Stealth[length=5mm]}] (0,0) -- (2,0); + \draw [|<->|] (1.5,.4) -- node[above=1mm] {5mm} (2,.4); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-13} +\tikz{ + \draw [-{Latex[length=5mm]}] (0,0) -- (2,0); + \draw [|<->|] (1.5,.4) -- node[above=1mm] {5mm} (2,.4); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-14} +\tikz{ + \draw [-{Classical TikZ Rightarrow[length=5mm]}] (0,0) -- (2,0); + \draw [|<->|] (1.5,.6) -- node[above=1mm] {5mm} (2,.6); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-15} +\tikz \draw [line width=1pt, double distance=3pt, + arrows = {-Latex[length=0pt 3 0]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-16} +\tikz \draw [line width=1pt, double distance=3pt, + arrows = {-Latex[length=0pt 3 .5]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-17} +\tikz \draw [line width=1pt, double distance=3pt, + arrows = {-Latex[length=0pt 3 1]} ] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-18} +\tikz{ + \draw [line width=1mm, -{Stealth[length=10mm, open]}] + (0,0) -- (2,0); + \draw [|<->|] (2,.6) -- node[above=1mm] {10mm} ++(-10mm,0); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-19} +\tikz{ + \draw [line width=1mm, -{Stealth[length=10mm, open, round]}] + (0,0) -- (2,0); + \draw [|<->|] (2,.6) -- node[above=1mm] {10mm} ++(-10mm,0); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-20} +\tikz \draw [arrows = {-Latex[width=10pt, length=10pt]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-21} +\tikz \draw [arrows = {-Latex[width=0pt 10, length=10pt]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-23} +\tikz \draw [arrows = {-Latex[width'=0pt .5, length=10pt]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-24} +\tikz \draw [arrows = {-Latex[width'=0pt .5, length=15pt]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-25} +\tikz \draw [arrows = {-Stealth[length=10pt, inset=5pt]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-26} +\tikz \draw [arrows = {-Stealth[length=10pt, inset=2pt]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-27} +\tikz \draw [arrows = {-Stealth[inset=0pt, angle=90:10pt]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-28} +\tikz \draw [arrows = {-Stealth[inset=0pt, angle=30:10pt]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-29} +\tikz \draw [arrows = {-Stealth[inset=0pt, length=10pt, angle'=90]}] + (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-30} +\tikz \draw [arrows = {-Stealth[inset=0pt, length=10pt, angle'=30]}] + (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-31} +\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); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-32} +\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); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-33} +\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); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-34} +\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); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-35} +\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); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-36} +\tikz [>={[slant=.3] To[] To[]}] + \graph [math nodes] { A -> B <-> C }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-37} +\tikz [ultra thick] \draw [arrows = {-Stealth[reversed]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-38} +\tikz [ultra thick] \draw [arrows = {-Stealth[reversed, reversed]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-39} +\tikz [ultra thick] \draw [arrows = {-Stealth[harpoon]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-40} +\tikz [ultra thick] \draw [arrows = {->[harpoon]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-41} +\tikz [ultra thick] \draw [arrows = {-Stealth[harpoon]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-42} +\tikz [ultra thick] \draw [arrows = {-Stealth[harpoon,swap]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-43} +\tikz [ultra thick] \draw [arrows = {-Stealth[left]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-44} +\tikz [ultra thick] \draw [arrows = {-Stealth[right]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-45} +\tikz [ultra thick] \draw [red, arrows = {-Stealth}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-46} +\tikz [ultra thick] \draw [blue, arrows = {-Stealth}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-47} +\tikz [ultra thick] \draw [red, arrows = {-Stealth[color=blue]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-48} +\tikz [ultra thick] \draw [red, arrows = {-Stealth[color=black]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-49} +\tikz [ultra thick] \draw [red, arrows = {-Stealth[blue]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-50} +\tikz [ultra thick] \draw [draw=red, fill=red!50, arrows = {-Stealth[length=10pt]}] + (0,0) -- (1,1) -- (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-51} +\tikz { + \draw [help lines] (0,-.5) grid [step=1mm] (1,.5); + \draw [thick, red, arrows = {-Stealth[fill=white,length=15pt]}] (0,0) -- (1,0); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-52} +\tikz { + \draw [help lines] (0,-.5) grid [step=1mm] (1,.5); + \draw [thick, red, arrows = {-Stealth[fill=none,length=15pt]}] (0,0) -- (1,0); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-53} +\tikz { + \draw [help lines] (0,-.5) grid [step=1mm] (1,.5); + \draw [thick, red, arrows = {-Stealth[color=blue, fill=white, length=15pt]}] + (0,0) -- (1,0); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-54} +\tikz [ultra thick] \draw [draw=red, fill=red!50, + arrows = {-Stealth[length=15pt, fill=pgffillcolor]}] + (0,0) -- (1,1) -- (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-55} +\tikz [line width=2mm] + \draw [arrows = {-Computer Modern Rightarrow[line cap=butt]}] + (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-56} +\tikz [line width=2mm] + \draw [arrows = {-Computer Modern Rightarrow[line cap=round]}] + (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-57} +\tikz [line width=2mm] + \draw [arrows = {-Bracket[reversed,line cap=butt]}] + (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-58} +\tikz [line width=2mm] + \draw [arrows = {-Bracket[reversed,line cap=round]}] + (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-59} +\tikz [line width=2mm] + \draw [arrows = {-Computer Modern Rightarrow[line join=miter]}] + (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-60} +\tikz [line width=2mm] + \draw [arrows = {-Computer Modern Rightarrow[line join=round]}] + (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-61} +\tikz [line width=2mm] + \draw [arrows = {-Bracket[reversed,line join=miter]}] + (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-62} +\tikz [line width=2mm] + \draw [arrows = {-Bracket[reversed,line join=round]}] + (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-63} +\tikz [line width=2mm] + \draw [arrows = {-Computer Modern Rightarrow[round]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-64} +\tikz [line width=2mm] + \draw [arrows = {-Bracket[reversed,round]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-65} +\tikz [line width=2mm] + \draw [arrows = {-Computer Modern Rightarrow[sharp]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-66} +\tikz [line width=2mm] + \draw [arrows = {-Bracket[reversed,sharp]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-67} +\tikz \draw [arrows = {-Latex[line width=0.1pt, fill=white, length=10pt]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-68} +\tikz \draw [arrows = {-Latex[line width=1pt, fill=white, length=10pt]}] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-69} +\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); } +\begin{tikzpicture} + \wall + % The "line" + \draw [red,line width=1mm] (-1,0) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-71} +\begin{tikzpicture} + \wall + \draw [red,line width=1mm,-{Stealth[length=1cm,open,blue]}] + (-1,0) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-72} +\begin{tikzpicture} + \wall + \draw [red!25,line width=1mm] (-1,0) -- (1,0); + \draw [red,line width=1mm] (-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-73} +\begin{tikzpicture} + \wall + \draw [red!25,line width=1mm] (-1,0) -- (1,0); + \draw [red,line width=1mm,-{Stealth[length=1cm,open,blue,quick]}] + (-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-74} +\begin{tikzpicture} + \wall + \draw [red!25,line width=1mm] (-1,0) -- (1,0); + \draw [red,line width=1mm,-{[quick,sep]>>>}] + (-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-75} +\begin{tikzpicture} + \wall + \draw [red!25,line width=1mm] (-1,0) -- (1,0); + \draw [red,line width=1mm,-{Stealth[length=1cm,open,blue,flex]}] + (-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-76} +\begin{tikzpicture} + \wall + \draw [red!25,line width=1mm] (-1,0) -- (1,0); + \draw [red,line width=1mm,-{Stealth[length=1cm,open,blue,flex=0]}] + (-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-77} +\begin{tikzpicture} + \wall + \draw [red!25,line width=1mm] (-1,0) -- (1,0); + \draw [red,line width=1mm,-{Stealth[length=1cm,open,blue,flex=.5]}] + (-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-78} +\begin{tikzpicture} + \wall + \draw [red!25,line width=1mm] (-1,0) -- (1,0); + \draw [red,line width=1mm,-{Stealth[length=1cm,flex=0]}] + (-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-79} +\begin{tikzpicture} + \wall + \draw [red!25,line width=1mm] (-1,0) -- (1,0); + \draw [red,line width=1mm,-{[flex,sep]>>>}] + (-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-80} +\begin{tikzpicture} + \wall + \draw [red!25,line width=1mm] (-1,0) -- (1,0); + \draw [red,line width=1mm,-{Stealth[length=1cm,open,blue,flex']}] + (-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-81} +\begin{tikzpicture} + \wall + \draw [red!25,line width=1mm] (-1,0) -- (1,0); + \draw [red,line width=1mm,-{Computer Modern Rightarrow[flex]}] + (0,-.5) .. controls (1,-.5) and (0.5,0) .. (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-82} +\begin{tikzpicture} + \wall + \draw [red!25,line width=1mm] (-1,0) -- (1,0); + \draw [red,line width=1mm,-{Computer Modern Rightarrow[flex'=.75]}] + (0,-.5) .. controls (1,-.5) and (0.5,0) .. (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-83} +\begin{tikzpicture} + \wall + \draw [red!25,line width=1mm] (-1,0) -- (1,0); + \draw [red,line width=1mm,-{Stealth[length=20pt,bend]}] + (-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-84} +\begin{tikzpicture} + \wall + \draw [red!25,line width=1mm] (-1,0) -- (1,0); + \draw [red,line width=1mm,-{[bend,sep]>>>}] + (-1,-.5) .. controls (0,-.5) and (0,0) .. (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-85} +\begin{tikzpicture} + \wall + \draw [red!25,line width=1mm] (-1,0) -- (1,0); + \draw [red,line width=1mm,-{Stealth[bend,round,length=20pt]}] + (0,-.5) .. controls (1,-.5) and (0.25,0) .. (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-86} +\tikz \draw [<<<->>>>] (0,0) -- (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-87} +\tikz { + \draw [-{>[sep=1pt]>[sep= 2pt]>}] (0,1.0) -- (1,1.0); + \draw [-{>[sep=1pt]>[sep=-2pt]>}] (0,0.5) -- (1,0.5); + \draw [-{> >[sep] >}] (0,0.0) -- (1,0.0); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-88} +\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); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-89} +\tikz \draw [->_>] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-90} +\tikz \draw [->__>] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-91} +\tikz [very thick] \draw [<<<->>>] (0,0) -- (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-92} +\tikz [very thick] \draw [<.<<->.>>] (0,0) -- (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-93} +\tikz [very thick] \draw [<<.<-.>>>] (0,0) -- (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-94} +\tikz [very thick] \draw [<<.<->.>>] (0,0) to [bend left] (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-95} +\tikz [very thick] \draw [-{Stealth[] . Stealth[] Stealth[]}] (0,0) -- (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-96} +\tikz [foo /.tip = {Stealth[sep]. >>}] + \draw [-foo] (0,0) -- (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-97} +\tikz [foo /.tip = {Stealth[sep] Latex[sep]}, + bar /.tip = {Stealth[length=10pt,open]}] + \draw [-{foo[red] . bar}] (0,0) -- (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-98} +\tikz \draw [<->] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-99} +\tikz \draw [>->] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-100} +\tikz \draw [Stealth-Stealth] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-101} +\tikz [<-> /.tip = Stealth] \draw [<->>] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-102} +\tikz [<-> /.tip = Latex] \draw [>-<] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-103} +\begin{tikzpicture}[scale=2,ultra thick] + \begin{scope}[>=Latex] + \draw[>->] (0pt,3ex) -- (1cm,3ex); + \draw[|<->>|] (0pt,2ex) -- (1cm,2ex); + \end{scope} + \begin{scope}[>=Stealth] + \draw[>->] (0pt,1ex) -- (1cm,1ex); + \draw[|<<.<->|] (0pt,0ex) -- (1cm,0ex); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-105} +\tikz { + \shade [left color=white, right color=red!50] (0,0) rectangle (4,1); + + \draw [ultra thick,-{Triangle[open]}] (0,2/3) -- ++ (3,0); + \draw [ultra thick,-{Triangle[fill=white]}] (0,1/3) -- ++ (3,0); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-106} +\tikz \graph [clockwise=3, math nodes, + edges = {double equal sign distance, -Implies}] { + "\alpha", "\beta", "\gamma"; + "\alpha" -> "\beta" -> "\gamma" -> "\alpha" +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-107} +\tikz \draw [line width=1ex, line cap=round, -Butt Cap] (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-108} +\tikz \draw [line width=1ex, + -{Round Cap []. Fast Round[] Fast Round[]}] + (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-109} +\tikz [f/.tip = Fast Round] % shorthand + \draw [line width=1ex, -{[bend] Round Cap[] . f f f}] + (0,0) to [bend left] (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-110} +\tikz \draw [line width=1ex, + -{Triangle Cap []. Fast Triangle[] Fast Triangle[]}] + (0,0) -- (1,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-arrows-111} +\tikz [f/.tip = Fast Triangle] % shorthand + \draw [line width=1ex, -{[bend] Triangle Cap[] . f f f}] + (0,0) to [bend left] (1,0); +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-coordinates.lvt b/testfiles/pgfmanual-en-tikz-coordinates.lvt new file mode 100644 index 000000000..6053a45f9 --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-coordinates.lvt @@ -0,0 +1,493 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{arrows.meta} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{calc} +\usetikzlibrary{calc} +\usetikzlibrary{intersections} +\usetikzlibrary{intersections} +\usetikzlibrary{intersections} +\usetikzlibrary{intersections} +\usetikzlibrary{intersections} +\usetikzlibrary{calc} +\usetikzlibrary{calc} +\usetikzlibrary{calc} +\usetikzlibrary{calc} +\usetikzlibrary{calc} +\usetikzlibrary{calc} +\usetikzlibrary{calc} +\usetikzlibrary{calc} +\usetikzlibrary{calc} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-1} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (canvas cs:x=0cm,y=2mm) + -- (canvas polar cs:radius=2cm,angle=30); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-2} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0cm,2mm) -- (30:2cm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-3} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (1,1); + \draw[red] (0,0) -- ([xshift=3pt] 1,1); + \draw (1,0) -- +(30:2cm); + \draw[red] (1,0) -- +([shift=(135:5pt)] 30:2cm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-4} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \fill (canvas cs:x=1cm,y=1.5cm) circle (2pt); + \fill (canvas cs:x=2cm,y=-5mm+2pt) circle (2pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-5} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \fill (1cm,1.5cm) circle (2pt); + \fill (2cm,-5mm+2pt) circle (2pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-6} +\begin{tikzpicture}[->] + \draw (0,0) -- (xyz cs:x=1); + \draw (0,0) -- (xyz cs:y=1); + \draw (0,0) -- (xyz cs:z=1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-7} +\begin{tikzpicture}[->] + \draw (0,0) -- (1,0); + \draw (0,0) -- (0,1,0); + \draw (0,0) -- (0,0,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-8} +\tikz \draw (0,0) -- (canvas polar cs:angle=30,radius=1cm); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-9} +\tikz \draw (0cm,0cm) -- (30:1cm) -- (60:1cm) -- (90:1cm) + -- (120:1cm) -- (150:1cm) -- (180:1cm); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-10} +\begin{tikzpicture}[x=1.5cm,y=1cm] + \draw[help lines] (0cm,0cm) grid (3cm,2cm); + + \draw (0,0) -- (xyz polar cs:angle=0,radius=1); + \draw (0,0) -- (xyz polar cs:angle=30,radius=1); + \draw (0,0) -- (xyz polar cs:angle=60,radius=1); + \draw (0,0) -- (xyz polar cs:angle=90,radius=1); + + \draw (xyz polar cs:angle=0,radius=2) + -- (xyz polar cs:angle=30,radius=2) + -- (xyz polar cs:angle=60,radius=2) + -- (xyz polar cs:angle=90,radius=2); + \end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-11} +\tikz[x={(0cm,1cm)},y={(-1cm,0cm)}] + \draw (0,0) -- (30:1) -- (60:1) -- (90:1) + -- (120:1) -- (150:1) -- (180:1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-12} +\begin{tikzpicture} + \coordinate (content) at (90:3cm); + \coordinate (structure) at (210:3cm); + \coordinate (form) at (-30:3cm); + + \node [above] at (content) {content oriented}; + \node [below left] at (structure) {structure oriented}; + \node [below right] at (form) {form oriented}; + + \draw [thick,gray] (content.south) -- (structure.north east) -- (form.north west) -- cycle; + + \small + \node at (barycentric cs:content=0.5,structure=0.1 ,form=1) {PostScript}; + \node at (barycentric cs:content=1 ,structure=0 ,form=0.4) {DVI}; + \node at (barycentric cs:content=0.5,structure=0.5 ,form=1) {PDF}; + \node at (barycentric cs:content=0 ,structure=0.25,form=1) {CSS}; + \node at (barycentric cs:content=0.5,structure=1 ,form=0) {XML}; + \node at (barycentric cs:content=0.5,structure=1 ,form=0.4) {HTML}; + \node at (barycentric cs:content=1 ,structure=0.2 ,form=0.8) {\TeX}; + \node at (barycentric cs:content=1 ,structure=0.6 ,form=0.8) {\LaTeX}; + \node at (barycentric cs:content=0.8,structure=0.8 ,form=1) {Word}; + \node at (barycentric cs:content=1 ,structure=0.05,form=0.05) {ASCII}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-13} +\begin{tikzpicture} + \node (shape) at (0,2) [draw] {|class Shape|}; + \node (rect) at (-2,0) [draw] {|class Rectangle|}; + \node (circle) at (2,0) [draw] {|class Circle|}; + \node (ellipse) at (6,0) [draw] {|class Ellipse|}; + + \draw (node cs:name=circle,anchor=north) |- (0,1); + \draw (node cs:name=ellipse,anchor=north) |- (0,1); + \draw [arrows = -{Triangle[open, angle=60:3mm]}] + (node cs:name=rect,anchor=north) + |- (0,1) -| (node cs:name=shape,anchor=south); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-14} +\begin{tikzpicture} + \node (start) [draw,shape=ellipse] {start}; + \foreach \angle in {-90, -80, ..., 90} + \draw (node cs:name=start,angle=\angle) + .. controls +(\angle:1cm) and +(-1,0) .. (2.5,0); + \end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-15} +\begin{tikzpicture} + \path (0,0) node(a) [ellipse,rotate=10,draw] {An ellipse} + (3,-1) node(b) [circle,draw] {A circle}; + \draw[thick] (node cs:name=a) -- (node cs:name=b); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-16} +\tikz \draw (0,0) node(x) [draw] {Text} + rectangle (1,1) + (node cs:name=x) -- +(1,1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-17} +\tikz \draw (0,0) node(x) [draw] {X} + (2,0) node(y) {Y} + (node cs:name=x) .. controls +(1,1) and +(-1,1) .. + (node cs:name=y); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-18} +\begin{tikzpicture}[fill=blue!20] + \draw[help lines] (-1,-2) grid (6,3); + \path (0,0) node(a) [ellipse,rotate=10,draw,fill] {An ellipse} + (3,-1) node(b) [circle,draw,fill] {A circle} + (2,2) node(c) [rectangle,rotate=20,draw,fill] {A rectangle} + (5,2) node(d) [rectangle,rotate=-30,draw,fill] {Another rectangle}; + \draw[thick] (a.south) -- (b) -- (c) -- (d); + \draw[thick,red,->] (a) |- +(1,3) -| (c) |- (b); + \draw[thick,blue,<->] (b) .. controls +(right:2cm) and +(down:1cm) .. (d); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-19} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + + \coordinate (a) at (3,2); + + \node [circle,draw] (c) at (1,1) [minimum size=40pt] {$c$}; + + \draw[red] (a) -- (tangent cs:node=c,point={(a)},solution=1) -- + (c.center) -- (tangent cs:node=c,point={(a)},solution=2) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-20} +\makeatletter +\define@key{cylindricalkeys}{angle}{\def\myangle{#1}} +\define@key{cylindricalkeys}{radius}{\def\myradius{#1}} +\define@key{cylindricalkeys}{z}{\def\myz{#1}} +\tikzdeclarecoordinatesystem{cylindrical}% +{% + \setkeys{cylindricalkeys}{#1}% + \pgfpointadd{\pgfpointxyz{0}{0}{\myz}}{\pgfpointpolarxy{\myangle}{\myradius}} +} +\begin{tikzpicture}[z=0.2pt] + \draw [->] (0,0,0) -- (0,0,350); + \foreach \num in {0,10,...,350} + \fill (cylindrical cs:angle=\num,radius=1,z=\num) circle (1pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-21} +\begin{tikzpicture} + \path (30:1cm) node(p1) {$p_1$} (75:1cm) node(p2) {$p_2$}; + + \draw (-0.2,0) -- (1.2,0) node(xline)[right] {$q_1$}; + \draw (2,-0.2) -- (2,1.2) node(yline)[above] {$q_2$}; + + \draw[->] (p1) -- (p1 |- xline); + \draw[->] (p2) -- (p2 |- xline); + \draw[->] (p1) -- (p1 -| yline); + \draw[->] (p2) -- (p2 -| yline); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-22} +\begin{tikzpicture} + \node (A) at (0,1) {A}; + \node (B) at (1,1.5) {B}; + \node (C) at (2,0) {C}; + \node (D) at (2.5,-2) {D}; + + \draw (A) -- (B) node [midway] {x}; + \draw (C) -- (D) node [midway] {x}; + + \node at ({$(A)!.5!(B)$} -| {$(C)!.5!(D)$}) {X}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-23} +\begin{tikzpicture}[every node/.style={opacity=1, black, above left}] + \draw [help lines] grid (3,2); + \draw [name path=ellipse] (2,0.5) ellipse (0.75cm and 1cm); + \draw [name path=rectangle, rotate=10] (0.5,0.5) rectangle +(2,1); + \fill [red, opacity=0.5, name intersections={of=ellipse and rectangle}] + (intersection-1) circle (2pt) node {1} + (intersection-2) circle (2pt) node {2}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-24} +\begin{tikzpicture} + \clip (-2,-2) rectangle (2,2); + \draw [name path=curve 1] (-2,-1) .. controls (8,-1) and (-8,1) .. (2,1); + \draw [name path=curve 2] (-1,-2) .. controls (-1,8) and (1,-8) .. (1,2); + + \fill [name intersections={of=curve 1 and curve 2, name=i, total=\t}] + [red, opacity=0.5, every node/.style={above left, black, opacity=1}] + \foreach \s in {1,...,\t}{(i-\s) circle (2pt) node {\footnotesize\s}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-25} +\begin{tikzpicture} + \clip (-2,-2) rectangle (2,2); + \draw [name path=curve 1] (-2,-1) .. controls (8,-1) and (-8,1) .. (2,1); + \draw [name path=curve 2] (-1,-2) .. controls (-1,8) and (1,-8) .. (1,2); + + \fill [name intersections={of=curve 1 and curve 2, by={a,b}}] + (a) circle (2pt) + (b) circle (2pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-26} +\begin{tikzpicture} + \clip (-2,-2) rectangle (2,2); + \draw [name path=curve 1] (-2,-1) .. controls (8,-1) and (-8,1) .. (2,1); + \draw [name path=curve 2] (-1,-2) .. controls (-1,8) and (1,-8) .. (1,2); + + \fill [name intersections={ + of=curve 1 and curve 2, + by={[label=center:a],[label=center:...],[label=center:i]}}]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-27} +\begin{tikzpicture} +\clip (-0.5,-0.75) rectangle (3.25,2.25); +\foreach \pathname/\shift in {line/0cm, curve/2cm}{ + \tikzset{xshift=\shift} + \draw [->, name path=curve] (1,1.5) .. controls (-1,1) and (2,0.5) .. (0,0); + \draw [->, name path=line] (0,-.5) -- (1,2) ; + \fill [name intersections={of=line and curve,sort by=\pathname, name=i}] + [red, opacity=0.5, every node/.style={left=.25cm, black, opacity=1}] + \foreach \s in {1,2,3}{(i-\s) circle (2pt) node {\footnotesize\s}}; +} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-28} +\begin{tikzpicture} + \draw (0,0) -- ++(1,0) -- ++(0,1) -- ++(-1,0) -- cycle; + \draw (2,0) -- ++(1,0) -- ++(0,1) -- ++(-1,0) -- cycle; + \draw (1.5,1.5) -- ++(1,0) -- ++(0,1) -- ++(-1,0) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-29} +\begin{tikzpicture} + \draw (0,0) -- +(1,0) -- +(1,1) -- +(0,1) -- cycle; + \draw (2,0) -- +(1,0) -- +(1,1) -- +(0,1) -- cycle; + \draw (1.5,1.5) -- +(1,0) -- +(1,1) -- +(0,1) -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-30} +\begin{tikzpicture} + \draw (1,0) .. controls +(30:1cm) and +(60:1cm) .. (3,-1); + \draw[gray,->] (1,0) -- +(30:1cm); + \draw[gray,<-] (3,-1) -- +(60:1cm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-31} +\tikz \draw (0,0) -- (1,1) -- ([turn]-45:1cm) -- ([turn]-30:1cm); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-32} +\tikz [delta angle=30, radius=1cm] + \draw (0,0) arc [start angle=0] -- ([turn]0:1cm) + arc [start angle=30] -- ([turn]0:1cm) + arc [start angle=60] -- ([turn]30:1cm); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-33} +\tikz \draw (0,0) to [bend left] (2,1) -- ([turn]0:1cm); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-34} +\tikz \draw plot coordinates {(0,0) (1,1) (2,0) (3,0) } -- ([turn]30:1cm); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-35} +\tikz \draw (0.5,0.5) -| (2,1) -- ([turn]1,1) + .. controls ([turn]0:1cm) .. ([turn]-90:1cm); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-36} +\begin{tikzpicture} + \draw (0,0) -- ++(1,0) -- ++(0,1) -- ++(-1,0); + \draw[red] (2,0) -- ++(1,0) { -- ++(0,1) } -- ++(-1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-37} +\begin{tikzpicture} + \draw (0,0) -- ++(1,0) -- ++(0,1) -- ++(-1,0); + \draw[red] (2,0) -- ++(1,0) + { [current point is local] -- ++(0,1) } -- ++(-1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-38} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + + \node (a) at (1,1) {A}; + \fill [red] ($(a) + 1/3*(1cm,0)$) circle (2pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-39} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + + \fill [red] ($2*(1,1)$) circle (2pt); + \fill [green] (${1+1}*(1,.5)$) circle (2pt); + \fill [blue] ($cos(0)*sin(90)*(1,1)$) circle (2pt); + \fill [black] (${3*(4-3)}*(1,0.5)$) circle (2pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-41} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + + \draw (1,0) -- (3,2); + + \foreach \i in {0,0.2,0.5,0.9,1} + \node at ($(1,0)!\i!(3,2)$) {\i}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-42} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,3); + + \coordinate (a) at (1,0); + \coordinate (b) at (3,2); + + \draw[->] (a) -- (b); + + \coordinate (c) at ($ (a)!1! 10:(b) $); + + \draw[->,red] (a) -- (c); + + \fill ($ (a)!.5! 10:(b) $) circle (2pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-43} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (4,4); + + \foreach \i in {0,0.125,...,2} + \fill ($(2,2) !\i! \i*180:(3,2)$) circle (2pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-44} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + + \draw (0,0) -- (3,2); + \draw[red] ($(0,0)!.3!(3,2)$) -- (3,0); + \fill[red] ($(0,0)!.3!(3,2)!.7!(3,0)$) circle (2pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-45} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + + \draw (1,0) -- (3,2); + + \foreach \i in {0cm,1cm,15mm} + \node at ($(1,0)!\i!(3,2)$) {\i}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-46} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + + \coordinate (a) at (1,0); + \coordinate (b) at (3,1); + + \draw (a) -- (b); + + \coordinate (c) at ($ (a)!.25!(b) $); + \coordinate (d) at ($ (c)!1cm!90:(b) $); + + \draw [<->] (c) -- (d) node [sloped,midway,above] {1cm}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-coordinates-48} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + + \coordinate (a) at (0,1); + \coordinate (b) at (3,2); + \coordinate (c) at (2.5,0); + + \draw (a) -- (b) -- (c) -- cycle; + + \draw[red] (a) -- ($(b)!(a)!(c)$); + \draw[orange] (b) -- ($(a)!(b)!(c)$); + \draw[blue] (c) -- ($(a)!(c)!(b)$); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-decorations.lvt b/testfiles/pgfmanual-en-tikz-decorations.lvt new file mode 100644 index 000000000..46012065a --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-decorations.lvt @@ -0,0 +1,304 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{ + decorations.pathmorphing, + decorations.pathreplacing, + decorations.shapes, +} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.shapes} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{ + decorations.pathmorphing, + decorations.shapes, +} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{ + decorations.pathmorphing, + decorations.shapes, +} +\usetikzlibrary{ + decorations.pathmorphing, + decorations.shapes, +} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.fractals} +\usetikzlibrary{ + decorations.pathmorphing, + decorations.text, + shapes.geometric, +} +\usetikzlibrary{ + decorations.pathmorphing, + decorations.text, + shapes.geometric, +} +\usetikzlibrary{decorations.text} +\usetikzlibrary{decorations.shapes} +\usetikzlibrary{decorations.pathreplacing} +\usetikzlibrary{decorations.shapes} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{ + decorations.pathmorphing, + decorations.shapes, +} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-1} +\begin{tikzpicture}[thick] + \draw (0,3) -- (3,3); + \draw[decorate,decoration=zigzag] (0,2.5) -- (3,2.5); + \draw[decorate,decoration=brace] (0,2) -- (3,2); + \draw[decorate,decoration=triangles] (0,1.5) -- (3,1.5); + \draw[decorate,decoration={coil,segment length=4pt}] (0,1) -- (3,1); + \draw[decorate,decoration={coil,aspect=0}] (0,.5) -- (3,.5); + \draw[decorate,decoration={expanding waves,angle=7}] (0,0) -- (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-2} +\begin{tikzpicture} + \node [fill=red!20,draw,decorate,decoration={bumps,mirror}, + minimum height=1cm] + {Bumpy}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-3} +\begin{tikzpicture} + \filldraw[fill=blue!20] (0,3) + decorate [decoration=saw] { -- (3,3) } + decorate [decoration={coil,aspect=0}] { -- (2,1) } + decorate [decoration=bumps] { -| (0,3) }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-4} +\pgfmathsetseed{1} +\begin{tikzpicture} + \node [fill=yellow!50,draw,thick, minimum height=2cm, minimum width=3cm, + decorate, decoration={random steps,segment length=3pt,amplitude=1pt}] + {Saved from trash}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-5} +\tikz \fill + [fill=blue!20,draw=blue,thick] (0,0) -- (2,1) arc (90:-90:.5) -- cycle; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-6} +\tikz \fill [decorate,decoration={zigzag}] + [fill=blue!20,draw=blue,thick] (0,0) -- (2,1) arc (90:-90:.5) -- cycle; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-7} +\tikz \fill [decoration={zigzag}] + [fill=blue!20,draw=blue,thick] (0,0) -- (2,1) + decorate { arc (90:-90:.5) } -- cycle; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-8} +\tikz \fill [decorate,decoration={crosses}] + [fill=blue!20,draw=blue,thick] (0,0) -- (2,1) arc (90:-90:.5) -- cycle; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-9} +\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; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-10} +\tikz \fill [fill=blue!20,draw=blue,thick] + (0,0) rectangle (3,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-11} +\tikz \fill [fill=blue!20,draw=blue,thick] + decorate[decoration={zigzag,segment length=10mm,amplitude=2.5mm}] + { (0,0) rectangle (3,2) }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-12} +\tikz \fill [fill=blue!20,draw=blue,thick] + decorate[decoration={crosses,segment length=2mm}] { + decorate[decoration={zigzag,segment length=10mm,amplitude=2.5mm}] { + (0,0) rectangle (3,2) + } + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-13} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \draw decorate [decoration={name=zigzag}] + { (0,0) .. controls (0,2) and (3,0) .. (3,2) |- (0,0) }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-14} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \draw decorate [decoration={name=zigzag}] + { (0,0) -- (2,2) node (hi) [left,draw=red] {Hi!} arc(90:0:1)}; + + \draw [blue] decorate [decoration={crosses}] {(3,0) -- (hi)}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-15} +\begin{tikzpicture}[decoration=zigzag] + \draw decorate {(0,0) -- (3,2)}; + \draw [red] decorate [decoration=crosses] {(0,2) -- (3,0)}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-16} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \draw decorate [decoration={name=zigzag}] + { (0,0) .. controls (0,2) and (3,0) .. (3,2) }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-17} +\begin{tikzpicture} + \draw [help lines] grid (3,2); + \draw decorate [decoration=zigzag] + { (0,0) .. controls (0,2) and (3,0) .. (3,2) }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-18} +\begin{tikzpicture}[decoration={text along path,text= + around and around and around and around we go}] + + \draw (0,0) -- (1,1) decorate { -- (2,1) } -- (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-19} +\begin{tikzpicture}[decoration=Koch snowflake,draw=blue,fill=blue!20,thick] + \filldraw (0,0) -- ++(60:1) -- ++(-60:1) -- cycle ; + \filldraw decorate{ (0,-1) -- ++(60:1) -- ++(-60:1) -- cycle }; + \filldraw decorate{ decorate{ (0,-2.5) -- ++(60:1) -- ++(-60:1) -- cycle }}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-20} +\begin{tikzpicture}[decoration=zigzag] + \draw [help lines] (0,0) grid (3,5); + + \draw [fill=blue!20,decorate] (1.5,4) circle (1cm); + + \node at (1.5,2.5) [fill=red!20,decorate,ellipse] {Ellipse}; + + \node at (1.5,1) [inner sep=6mm,fill=red!20,decorate,ellipse,decoration= + {text along path,text={This is getting silly}}] {Ellipse}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-21} +\begin{tikzpicture}[decoration=zigzag] + \node at (1.5,1) [inner sep=6mm,fill=red!20,ellipse, + postaction={decorate,decoration= + {text along path,text={This is getting silly}}}] {Ellipse}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-22} +\begin{tikzpicture} +\draw [help lines] grid (3,2); +\fill [draw=red,fill=red!20, + postaction={decorate,decoration={raise=2pt,text along path, + text=around and around and around and around we go}}] + (0,1) arc (180:-180:1.5cm and 1cm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-23} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + + \draw (0,0) -- (1,1) arc (90:0:2 and 1); + \draw decorate [decoration=crosses] + { (0,0) -- (1,1) arc (90:0:2 and 1) }; + \draw[red] decorate [decoration={crosses,raise=5pt}] + { (0,0) -- (1,1) arc (90:0:2 and 1) }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-24} +\begin{tikzpicture} + \node (a) {A}; + \node (b) at (2,1) {B}; + \draw (a) -- (b); + \draw[decorate,decoration=brace] (a) -- (b); + \draw[decorate,decoration={brace,mirror},red] (a) -- (b); + \draw[decorate,decoration={brace,mirror,raise=5pt},blue] (a) -- (b); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-25} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + + \draw (0,0) -- (1,1) arc (90:0:2 and 1); + \draw[red,very thick] decorate [decoration={ + crosses,transform={shift only},shape size=1.5mm}] + { (0,0) -- (1,1) arc (90:0:2 and 1) }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-26} +\tikz [decoration={zigzag,pre=lineto,pre length=1cm}] + \draw [decorate] (0,0) -- (2,1) arc (90:0:1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-27} +\tikz [decoration={zigzag,pre=moveto,pre length=1cm}] + \draw [decorate] (0,0) -- (2,1) arc (90:0:1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-28} +\tikz [decoration={zigzag,pre=crosses,pre length=1cm}] + \draw [decorate] (0,0) -- (2,1) arc (90:0:1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-29} +\tikz [decoration={zigzag,pre length=3cm}] + \draw [decorate] (0,0) -- (2,1) arc (90:0:1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-30} +\tikz [decoration={zigzag,pre=curveto,pre length=3cm}] + \draw [decorate] (0,0) -- (2,1) arc (90:0:1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-decorations-31} +\begin{tikzpicture} + [decoration=snake, + line around/.style={decoration={pre length=#1,post length=#1}}] + + \draw[->,decorate] (0,0) -- ++(3,0); + \draw[->,decorate,line around=5pt] (0,-5mm) -- ++(3,0); + \draw[->,decorate,line around=1cm] (0,-1cm) -- ++(3,0); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-design.lvt b/testfiles/pgfmanual-en-tikz-design.lvt new file mode 100644 index 000000000..435c8016e --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-design.lvt @@ -0,0 +1,78 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{arrows.meta,trees} +\usetikzlibrary{graphs} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tikz-design-2} +\tikz \draw[line width=2pt,color=red] (1,0) -- (0,0) -- (0,1) -- cycle; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-design-3} +\tikz \draw (1,1) node {text} -- (2,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-design-4} +\begin{tikzpicture} + \node {root} + child {node {left}} + child {node {right} + child {node {child}} + child {node {child}} + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-design-5} +\begin{tikzpicture} + [edge from parent fork down, sibling distance=15mm, level distance=15mm, + every node/.style={fill=red!30,rounded corners}, + edge from parent/.style={red,-{Circle[open]},thick,draw}] + \node {root} + child {node {left}} + child {node {right} + child {node {child}} + child {node {child}} + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-design-6} +\begin{tikzpicture} + [parent anchor=east,child anchor=west,grow=east, + sibling distance=15mm, level distance=15mm, + every node/.style={ball color=red,circle,text=white}, + edge from parent/.style={draw,dashed,thick,red}] + \node {root} + child {node {left}} + child {node {right} + child {node {child}} + child {node {child}} + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-design-7} +\tikz \graph [grow down, branch right] { + root -> { left, right -> {child, child} } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-design-8} +\begin{tikzpicture} + \begin{scope}[color=red] + \draw (0mm,10mm) -- (10mm,10mm); + \draw (0mm, 8mm) -- (10mm, 8mm); + \draw (0mm, 6mm) -- (10mm, 6mm); + \end{scope} + \begin{scope}[color=green] + \draw (0mm, 4mm) -- (10mm, 4mm); + \draw (0mm, 2mm) -- (10mm, 2mm); + \draw[color=blue] (0mm, 0mm) -- (10mm, 0mm); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-graphs.lvt b/testfiles/pgfmanual-en-tikz-graphs.lvt new file mode 100644 index 000000000..f108eea53 --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-graphs.lvt @@ -0,0 +1,1520 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{graphs} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs,quotes} +\usetikzlibrary{graphs,quotes} +\usetikzlibrary{graphs,quotes} +\usetikzlibrary{graphs,quotes} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs,shapes.geometric} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs,graphdrawing}\usegdlibrary{layered} +\usetikzlibrary{graphs,graphdrawing}\usegdlibrary{layered} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs,quotes} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs,quotes} +\usetikzlibrary{graphs,quotes} +\usetikzlibrary{graphs,quotes} +\usetikzlibrary{graphs,quotes} +\usetikzlibrary{graphs,quotes} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs,quotes} +\usetikzlibrary{graphs,quotes} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs.standard} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs.standard} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-1} +\tikz \graph { a -> {b, c} -> d }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-2} +\tikz \graph { + subgraph I_nm [V={a, b, c}, W={1,...,4}]; + + a -> { 1, 2, 3 }; + b -> { 1, 4 }; + c -> { 2 [>green!75!black], 3, 4 [>red]} +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-3} +\tikz + \graph [nodes={draw, circle}, clockwise, radius=.5cm, empty nodes, n=5] { + subgraph I_n [name=inner] --[complete bipartite] + subgraph I_n [name=outer] + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-4} +\definecolor{graphicbackground}{rgb}{0.96,0.96,0.8} +\tikz + \graph [nodes={draw, circle}, clockwise, radius=.75cm, empty nodes, n=8] { + subgraph C_n [name=inner] <->[shorten <=1pt, shorten >=1pt] + subgraph C_n [name=outer] + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-5} +\tikz [>={To[sep]}, rotate=90, xscale=-1, + mark/.style={fill=black!50}, mark/.default=] + \graph [trie, simple, + nodes={circle,draw}, + edges={nodes={ + inner sep=1pt, anchor=mid, + fill=graphicbackground}}, % yellowish background + put node text on incoming edges] + { + root[mark] -> { + a -> n -> { + g [mark], + f -> a -> n -> g [mark] + }, + f -> a -> n -> g [mark], + g[mark], + n -> { + g[mark], + f -> a -> n -> g[mark] + } + }, + { [edges=red] % highlight one path + root -> f -> a -> n + } + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-6} +\tikz [every node/.style = draw] + \graph { foo -> bar -> blub }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-7} +\tikz \graph { + a -> b -> c; + d -> e -> f; + g -> f; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-8} +\tikz \graph { + x1/$x_1$ -> x2 [as=$x_2$, red] -> x34/{$x_3,x_4$}; + x1 -> [bend left] x34; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-9} +\tikz \graph { + "$x_1$" -> "$x_2$"[red] -> "$x_3,x_4$"; + "$x_1$" ->[bend left] "$x_3,x_4$"; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-10} +\tikz \graph { + a -> { + b -> c, + d -> e + } -> f +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-11} +\tikz + \graph [grow down, + branch right=2.5cm] { + root -> { + child 1, + child 2 -> { + grand child 1, + grand child 2 + }, + child 3 -> { + grand child 3 + } + } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-12} +\tikz \graph { + a ->[red] b --[thick] {c, d}; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-13} +\tikz \graph { + a ->[red, "foo"] b --[thick, "bar"] {c, d}; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-14} +\tikz \graph { + a -> b -- {c [> "foo"], d [> "bar"']}; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-15} +\tikz \graph { + a [< red] -> b -- {c [> blue], d [> "bar"']}; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-16} +\tikz + \graph [edge quotes={fill=white,inner sep=1pt}, + grow down, branch right, nodes={circle,draw}] { + "" -> h [>"9"] -> { + c [>"4"] -> { + a [>"2"], + e [>"0"] + }, + j [>"7"] + } + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-17} +\tikz { + \node (a) at (0,0) {A}; + \node (b) at (1,0) {B}; + \node (c) at (2,0) {C}; + + \graph { (a) -> (b) -> (c) }; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-18} +\tikz [new set=my nodes] { + \node [set=my nodes, circle, draw] at (1,1) {A}; + \node [set=my nodes, rectangle, draw] at (1.5,0) {B}; + \node [set=my nodes, diamond, draw] at (1,-1) {C}; + \node (d) [star, draw] at (3,0) {D}; + + \graph { X -> (my nodes) -> (d) }; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-19} +\tikz \graph { subgraph K_n [n=6, clockwise] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-20} +\tikz \graph { subgraph C_n [n=5, clockwise] -> mid }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-21} +\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] + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-22} +\tikz \graph [nodes=red] { a -> b -> c }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-23} +\tikz \graph [edges={red,thick}] { a -> b -> c }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-24} +\tikz \graph [edge node={node [red, near end] {X}}] { a -> b -> c }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-25} +\tikz \graph [edge node={node [near end] {X}}, + edge node={node [near start] {Y}}] { a -> b -> c }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-26} +\tikz \graph [edge label=x] { a -> b -> {c,d} }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-27} +\tikz \graph [edge label=out, edge label'=in] + { subgraph C_n [clockwise, n=5] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-28} +\tikz \graph { + a -> b, + c; + + d -> e -> f +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-29} +\tikz \graph { + a [red, draw] -> b [blue, draw], + c [brown, draw, circle] +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-30} +\tikz \graph { + a -> { [nodes=red] % the option is local to these nodes: + b, c + } -> + d +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-31} +\tikz \graph [math nodes, branch down=5mm] { + a -> { + \foreach \i in {1,2,3} { + a_\i -> { x_\i, y_\i } + }, + b + } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-32} +\def\mychain{ a -> b -> c; } +\tikz \graph { [parse/.expand once=\mychain] d -> e }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-33} +\def\mychain#1{ + \def\mytext{1} + \foreach \i in {2,...,#1} { + \xdef\mytext{\mytext -> \i} + } +} +\tikzgraphsset{my chain/.style={ + /utils/exec=\mychain{#1}, + parse/.expand once=\mytext} +} +\tikz \graph { [my chain=4] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-34} +\tikz \graph { + {a,b,c} -> [complete bipartite] {e,f,g} +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-35} +\tikz \graph [left anchor=east, right anchor=west] { + {a,b,c} -- [complete bipartite] {e,f,g} +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-36} +\tikz \graph [branch down=5mm] { + a -> b; + c -- d; + e <- f; + g <-> h; + i -!- j; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-37} +\tikz \graph { + a -> b; % both are fresh + c -> a; % only c is fresh, a is referenced +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-38} +\tikz \graph [branch down=5mm] { + { [fresh nodes] + a -> { + b -> {c, c}, + b -> {c, c}, + b -> {c, c}, + } + }, + b' -- b'' +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-39} +\tikz \graph [branch down=5mm] { + { [number nodes] + a -> { + b -> {c, c}, + b -> {c, c}, + b -> {c, c}, + } + }, + b 2 -- b 5 +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-40} +\begin{tikzpicture} + \graph { + { [name=first] 1, 2, 3} -- + { [name=second] 1, 2, 3} + }; + \draw [red] (second 1) circle [radius=3mm]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-41} +\begin{tikzpicture} + \graph [name separator=] { % no separator + { [name=first] 1, 2, 3} -- + { [name=second] 1, 2, 3} + }; + \draw [red] (second1) circle [radius=3mm]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-42} +\begin{tikzpicture} + \graph [name separator=-] { + { [name=first] 1, 2, 3} -- + { [name=second] 1, 2, 3} + }; + \draw [red] (second-1) circle [radius=3mm]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-43} +\tikz \graph { a [as=$x$] -- b [as=$y_5$] -> c [red, as={a--b}] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-44} +\tikz \graph [typeset=(\tikzgraphnodetext)] + { a -> b -> c }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-45} +\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 }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-46} +\tikz \graph [empty nodes, nodes={circle, draw}] { a -> {b, c} }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-47} +\tikz \graph [math nodes, nodes={circle, draw}] { a_1 -> {b^2, c_3^n} }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-48} +\begin{tikzpicture} + \graph [grow right=2cm] { + "Hi, World!" -> "It's \emph{important}!"[red,rotate=-45]; + "name"/actual text -> "It's \emph{important}!"; + }; + \draw (name) circle [radius=3pt]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-50} +\begin{tikzpicture}[new set=red, new set=green, shorten >=2pt] + \foreach \i in {1,2,3} { + \node [draw, red!80, set=red] (r\i) at (\i,1) {$r_\i$}; + \node [draw, green!50!black, set=green] (g\i) at (\i,2) {$g_\i$}; + } + \graph { + root [xshift=2cm] -> + (red) -> [complete bipartite, right anchor=south] + (green) + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-51} +\begin{tikzpicture}[new set=import nodes] + \begin{scope}[nodes={set=import nodes}] % make all nodes part of this set + \node [red] (a) at (0,1) {$a$}; + \node [red] (b) at (1,1) {$b$}; + \node [red] (d) at (2,1) {$d$}; + \end{scope} + + \graph { + (import nodes); % "import" the nodes + + a -> b -> c -> d -> e; % only c and e are new + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-52} +\tikz \graph { a -> {b,c,d} -> {e -> {f,g}, h} }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-53} +\tikz \graph [trie] { + a -> { + a, + c -> {a, b}, + b + } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-54} +\tikz \graph [trie, simple, layered layout] { + a -> b -> a, + a -> b -> c, + a -> {d,a} +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-55} +\tikz \graph [trie, simple, layered layout, + typeset=\tikzgraphnodefullname] { + a -> b -> a, + a -> b -> c, + a -> {d,a} +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-56} +\tikz \graph { + { [trie, simple] + a -> { + b, + c -> a + } + }, + a b ->[red] a c a +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-57} +\tikz \graph [quick] { "a" --["foo"] "b"[x=1] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-58} +\tikz \graph [quick] { + "a"/"$a$" -- "b"[x=1] --[red] "c"[x=2]; + { [nodes=blue] "a" -- "d"[y=1]; }; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-59} +\tikz \graph [multi] { % "multi" is not really necessary here + a ->[bend left, red] b; + a ->[bend right, blue] b; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-60} +\tikz \graph [simple]{ + a ->[bend left, red] b; + a ->[bend right, blue] b; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-61} +\tikz \graph [simple, grow right=2cm] { + {a,b,c,d} ->[complete bipartite] {e,f,g,h}; + + { [edges={red,thick}] a -> e -> d -> g -> a }; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-62} +\tikz \graph [simple] { + subgraph K_n [n=8, clockwise]; + % Get rid of the following edges: + 1 -!- 2; + 3 -!- 4; + 6 -!- 8; + % And make one edge red: + 1 --[red] 3; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-63} +\tikz + \graph [edge quotes=near start] { + { a, b } -> [red, "x", complete bipartite] { c, d }; + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-64} +\tikz \graph { + a ->["x"] b ->["y"'] c ->["z" red] d; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-65} +\tikz \graph [edge quotes={blue,auto}] { + a ->["x"] b ->["y"'] c ->["b" red] d; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-66} +\tikz \graph [edge quotes center] { + a ->["x"] b ->["y"] c ->["z" red] d; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-67} +\tikz \graph [edge quotes mid] { + a ->["x"] b ->["y"] c ->["z" red] d; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-68} +\tikz \graph { a -> {b,c} }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-69} +\tikz \graph { + a -> [red] b; + a -> [blue] c; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-70} +\tikz \graph [simple] { + a -> {b,c}; + a -> [red] b; + a -> [blue] c; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-71} +\tikz \graph [simple] { + % The larger tree, no special options in force + a -> { + b -> {c,d}, + e -> {f,g}, + h + }, + { [edges=red] % Now highlight a part of the tree + a -> e -> {f,g} + } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-72} +\tikz \graph { + { a, b } -> + { c [target edge style=red], d } -> + { e, f } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-73} +\tikz \graph { + { a, b } -> [blue, thick] + { c [target edge style=red], d } -> + { e, f } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-74} +\tikz \graph { + { a, b } -> + { c [target edge style=red], d } -> + { e, f }, + b -> c +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-75} +\tikz \graph { + { a, b } -> + { c [target edge style=red], d }, + b -> c[target edge clear] +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-76} +\tikz \graph { + { a, b } -> + { c [target edge node=node{X}], d } -> + { e, f } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-77} +\tikz \graph { + { a, b } -> + { c [source edge style=red], d } -> + { e, f } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-78} +\tikz \graph { + a [source edge style=red] ->[green] + b [target edge style=blue] % blue wins +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-80} +\tikz + \graph [edge quotes={fill=white,inner sep=1pt}, + grow down, branch right] { + / -> h [>"9"] -> { + c [>"4" text=red,] -> { + a [>"2", >thick], + e [>"0"] + }, + j [>"7"] + } + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-81} +\tikz \graph [empty nodes] +{ + root -> { + a [>"a"], + b [>"b"] -> { + c [>"c"], + d [>"d"] + } + } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-82} +\tikz \graph [put node text on incoming edges, + math nodes, nodes={circle,draw}] + { a -> b -> {c, d} }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-83} +\tikz \graph [color class=red] { + [cycle=red] % causes all "logically" red nodes to be connected in + % a cycle + a, + b [red], + { [red] c ->[bend right] d }, + e +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-84} +\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 } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-85} +\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] +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-86} +\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] +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-87} +\tikz \graph { a -> { b, c, d } -> e }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-88} +\tikz \graph { a -> { b[not source], c, d[not target] } -> e }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-90} +\tikz \graph { subgraph K_n [--, n=5, clockwise, radius=6mm] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-91} +\tikz \graph { subgraph K_n [->, n=5, clockwise, radius=6mm] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-92} +\tikz \graph { subgraph K_n [<-, n=5, clockwise, radius=6mm] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-93} +\tikz \graph { subgraph K_n [<->, n=5, clockwise, radius=6mm] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-94} +\def\myconnect#1{\tikzset{graphs/new ->={root}{#1}{}{}}} + +\begin{tikzpicture} + \node (root) at (-1,-1) {root}; + + \graph { + x, + { + [operator=\tikzgraphforeachcolorednode{all}{\myconnect}] + a, b, c + } + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-95} +\newcount\leftshorecount \newcount\rightshorecount +\newcount\mycount \newcount\myothercount +\def\zigzag{ + \tikzgraphpreparecolor{left shore}\leftshorecount{left shore prefix} + \tikzgraphpreparecolor{right shore}\rightshorecount{right shore prefix} + \mycount=0\relax + \loop + \advance\mycount by 1\relax% + % Add the "forward" edge + \tikzgraphsset{new ->= + {\csname left shore prefix\the\mycount\endcsname} + {\csname right shore prefix\the\mycount\endcsname}{}{}} + \myothercount=\mycount\relax% + \advance\myothercount by1\relax% + \tikzgraphsset{new <-= + {\csname left shore prefix\the\myothercount\endcsname} + {\csname right shore prefix\the\mycount\endcsname}{}{}} + \ifnum\myothercount<\leftshorecount\relax + \repeat +} +\begin{tikzpicture} + \graph [color class=left shore, color class=right shore] + { [operator=\zigzag] + { [left shore, Cartesian placement] a, b, c }, + { [right shore, Cartesian placement, nodes={xshift=1cm}] d, e, f } + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-96} +\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} }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-97} +\tikz \graph [default edge operator=matching] { + {a, b} ->[matching and star] + {c, d, e} --[complete bipartite] + {f, g, h} -- + {i, j, k} +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-98} +\begin{tikzpicture} + \graph [color class=red, color class=green, math nodes] + { [complete bipartite={red}{green}] + { [red, Cartesian placement] r_1, r_2, r_3 }, + { [green, Cartesian placement, nodes={xshift=1cm}] g_1, g_2, g_3 } + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-99} +\tikz \graph [branch down=4mm, declare={claw}{1 -- {2,3,4}}] { + a; + claw; + b; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-100} +\tikz \graph [ n/.code=\def\n{#1}, branch down=4mm, + declare={star}{root -- { \foreach \i in {1,...,\n} {\i} }}] +{ star [n=5]; }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-101} +\newcount\mycount +\tikzgraphsset{ + levels/.store in=\tikzgraphlevel, + levels=1, + declare={bintree}{% + [/utils/exec={% + \ifnum\tikzgraphlevel=1\relax% + \def\childtrees{ / }% + \else% + \mycount=\tikzgraphlevel% + \advance\mycount by-1\relax% + \edef\childtrees{ + / -> { + bintree[levels=\the\mycount], + bintree[levels=\the\mycount] + }} + \fi% + }, + parse/.expand once=\childtrees + ] + % Everything is inside the \childtrees... + } +} +\tikz \graph [grow down=5mm, branch right=5mm] { bintree [levels=5] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-102} +\tikz \graph [branch down=4mm, declare={claw}{1 -- {2,3,4}}] { + claw [name=left], + claw [name=right] +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-103} +\tikz \graph [no placement] +{ + a[at={(0:0)}] -> b[at={(1,0)}] -> c[yshift=1cm]; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-104} +\tikz \graph [no placement] +{ + a[x=0,y=0] -> b[x=1,y=0] -> c[x=0,y=1]; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-105} +\tikz \graph [no placement] +{ + a -> + { [x=1] % group option + b [y=0] -> c[y=1] + }; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-106} +\tikz + \graph [nodes={align=center, inner sep=1pt}, grow right=7mm, + typeset={\tikzgraphnodetext\\[-4pt] + \tiny\mywidth\\[-6pt]\tiny\mydepth}, + placement/compute position/.append code= + \pgfkeysgetvalue{/tikz/graphs/placement/width}{\mywidth} + \pgfkeysgetvalue{/tikz/graphs/placement/depth}{\mydepth}] +{ + a, + b, + c -> d -> { + e -> f -> g, + h -> i + } -> j, + k -> l +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-107} +\tikz \graph [chain shift=(45:1)] { + a -> b -> c; + d -> e; + f -> g -> h; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-108} +\tikz \graph [chain shift=(45:7mm), group shift=(-45:7mm)] { + a -> b -> c; + d -> e; + f -> g -> h; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-109} +\tikz \graph [grow up=7mm] { a -> b -> c}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-110} +\tikz \graph [grow down=7mm] { a -> b -> c}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-111} +\tikz \graph [grow left=7mm] { a -> b -> c}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-112} +\tikz \graph [grow right=7mm] { a -> b -> c}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-113} +\tikz \graph [branch up=7mm] { a -> b -> {c, d, e} }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-114} +\tikz \graph [branch down=7mm] { a -> b -> {c, d, e}}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-115} +\tikz \graph [branch left=7mm, grow down=7mm] { a -> b -> {c, d, e}}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-116} +\tikz \graph [branch right=7mm, grow down=7mm] { a -> b -> {c, d, e}}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-117} +\tikz \graph [grid placement] { subgraph I_n[n=6, wrap after=3] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-118} +\tikz \graph [grid placement] { subgraph Grid_n [n=9] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-119} +\tikz \graph [grid placement, branch up, grow left] { subgraph Grid_n [n=9] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-120} +\tikz \graph [grid placement] { + [n=6, wrap after=3] + a -- b -- c -- d -- e -- f +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-121} +\tikz \graph [grow right sep, left anchor=east, right anchor=west] { + start -- { + long text -- {short, very long text} -- more text, + long -- longer -- longest + } -- end +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-122} +\tikz \graph [grow left sep] { long -- longer -- longest }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-123} +\tikz \graph [grow up sep] { + a / $a=x$ -- + b / {$b=\displaystyle \int_0^1 x dx$} -- + c [draw, circle, inner sep=7mm] +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-124} +\tikz \graph [grow down, branch right sep] { + start -- { + an even longer text -- {short, very long text} -- more text, + long -- longer -- longest, + some text -- a -- b + } -- end +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-125} +\tikz \graph [grow down sep, branch left sep] { + start -- { + an even longer text -- {short, very long text} -- more text, + long -- longer, + some text -- a -- b + } -- end +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-126} +\tikz \graph [branch up sep] { a, b, c[draw, circle, inner sep=7mm] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-127} +\tikz \graph [circular placement] { + a -> b -> c; + d -> e; + f -> g -> h; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-128} +\tikz \graph [circular placement, group polar shift=(30:0)] { + a -> b -> c; + d -> e; + f -> g -> h; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-129} +\tikz \graph [circular placement, + chain polar shift=(30:0), + group polar shift=(0:1cm)] { + a -- b -- c; + d -- e; + f -- g -- h; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-130} +\tikz \graph [circular placement, radius=5mm] { a, b, c, d }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-131} +\tikz \graph [circular placement, radius=1cm] { a, b, c, d }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-132} +\tikz \graph [circular placement] { a, b, c, d }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-133} +\tikz \graph [circular placement, phase=0] { a, b, c, d }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-134} +\tikz \graph [clockwise=4] { a, b, c, d }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-135} +\tikz \graph [clockwise] { subgraph K_n [n=5] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-136} +\tikz \graph [ branch down=5mm, typeset= + \tikzgraphnodetext:\pgfkeysvalueof{/tikz/graphs/placement/level}] +{ + a -> { + b, + c -> { + d, + e -> {f,g}, + h + }, + j + } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-137} +\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 -> { + d, + e -> {f,g}, + h + }, + j + } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-138} +\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 -> { + d, + e -> {f,g}, + h + }, + j + } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-139} +\tikz \graph [ + grow right sep, typeset=\tikzgraphnodetext:\mynum, + placement/compute position/.append code= + \pgfkeysgetvalue{/tikz/graphs/placement/element count}{\mynum}] +{ + a -> b -> c, + d -> {e, f->h} -> j +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-140} +\tikz + \graph [nodes={align=center, inner sep=1pt}, grow right=7mm, + typeset={\tikzgraphnodetext\\[-4pt] + \tiny\mywidth\\[-6pt]\tiny\mydepth}, + placement/compute position/.append code= + \pgfkeysgetvalue{/tikz/graphs/placement/width}{\mywidth} + \pgfkeysgetvalue{/tikz/graphs/placement/depth}{\mydepth}] +{ + a, + b, + c -> d -> { + e -> f -> g, + h -> i + } -> j, + k -> l +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-141} +\tikz + \graph [grow right sep, branch down sep, nodes={align=left, inner sep=1pt}, + typeset={\tikzgraphnodetext\\[-4pt] \tiny Width: \mywidth\\[-6pt] \tiny Depth: \mydepth}, + placement/compute position/.append code= + \pgfkeysgetvalue{/tikz/graphs/placement/width}{\mywidth} + \pgfkeysgetvalue{/tikz/graphs/placement/depth}{\mydepth}] +{ + a, + b, + c -> d -> { + e -> f -> g, + h -> i + } -> j, + k -> l +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-142} +\tikz \graph [ + grow right sep, branch down=5mm, typeset=\tikzgraphnodetext:\mynum, + placement/compute position/.append code= + \pgfkeysgetvalue{/tikz/graphs/placement/chain count}{\mynum}] +{ + a -> b -> {c,d,e}, + f, + g -> h +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-143} +\newcount\mycount +\def\lightendeepernodes{ + \pgfmathsetcount{\mycount}{ + 100-20*\pgfkeysvalueof{/tikz/graphs/placement/width} + } + \edef\mydepth{\the\mycount} + \tikzset{nodes={fill=red!\mydepth,circle,text=white}} +} +\tikz + \graph [placement/compute position/.append code=\lightendeepernodes] + { + a -> { + b -> c -> d, + e -> { + f, + g + }, + h + } + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-144} +\tikz \graph [branch right, nodes={draw, circle}] + { subgraph I_n [V={a,b,c}] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-145} +\tikz \graph [clockwise, clique] { subgraph I_n [n=4] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-146} +\tikz \graph { subgraph I_nm [V={1,2,3}, W={a,b,c}] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-147} +\tikz \graph { + subgraph I_nm [n=3, m=4]; + + V 1 -- { W 2, W 3 }; + V 2 -- { W 1, W 3 }; + V 3 -- { W 1, W 4 }; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-148} +\tikz \graph [clockwise] { subgraph K_n [n=7] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-149} +\tikz \graph [branch right, grow down] + { subgraph K_nm [V={6,...,9}, W={b,...,e}] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-150} +\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}, <-]; +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-151} +\tikz \graph [branch right] { subgraph P_n [n=3] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-152} +\tikz \graph [clockwise] { subgraph C_n [n=7, ->] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-153} +\tikz \graph [grid placement] { subgraph Grid_n [n=3,wrap after=1] }; +\tikz \graph [grid placement] { subgraph Grid_n [n=3,wrap after=3] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-154} +\tikz \graph [grid placement] { subgraph Grid_n [n=4,wrap after=2] }; +\tikz \graph [grid placement] { subgraph Grid_n [n=4] }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-155} +\tikz \graph [clockwise, n=5] { + a, + b, + { + [clique] + c, d, e + } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-156} +\tikz \graph [color class=red, clockwise, n=5] { + [clique=red, ->] + a, b[red], c[red], d, e[red] +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-157} +\tikz \graph [simple] { + subgraph K_n [<->, n=7, clockwise]; % create lots of edges + + { [induced independent set] 1, 3, 4, 5, 6 } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-158} +\tikz \graph [clockwise, n=6, phase=60] { + { [cycle, ->] a, b, c }, + { [cycle, <-] d, e, f } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-159} +\tikz \graph [simple] { + subgraph K_n [n=7, clockwise]; % create lots of edges + + { [induced cycle, ->, edge=red] 2, 3, 4, 6, 7 }, +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-160} +\tikz \graph [clockwise, n=6] { + { [path, ->] a, b, c }, + { [path, <-] d, e, f } +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-161} +\tikz \graph [simple] { + subgraph K_n [n=7, clockwise]; % create lots of edges + + { [induced path, ->, edges=red] 2, 3, 4, 6, 7 }, +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-162} +\tikz \graph { {a, b} ->[complete bipartite] + {c, d, e} --[complete bipartite] + {g, h, i, j} --[complete bipartite] + k }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-163} +\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] +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-164} +\tikz \graph [simple] { + subgraph K_n [n=5, clockwise]; % Lots of edges + + {2, 3} ->[induced complete bipartite] {4, 5} +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-165} +\tikz \graph { + {a, b, c} ->[matching] + {d, e, f} --[matching] + {g, h} --[matching] + {i, j, k} +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-166} +\tikz \graph { a -> {b, c} -> {d, e} -- f}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-graphs-167} +\tikz \graph [left anchor=east, right anchor=west, + branch down=4mm, grow right=15mm] { + subgraph I_n [n=12, name=A] --[butterfly={level=3}] + subgraph I_n [n=12, name=B] --[butterfly={level=2}] + subgraph I_n [n=12, name=C] +}; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-matrices.lvt b/testfiles/pgfmanual-en-tikz-matrices.lvt new file mode 100644 index 000000000..3be03c95c --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-matrices.lvt @@ -0,0 +1,439 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{matrix,fit} +\usetikzlibrary{matrix} +\usetikzlibrary{matrix} +\usetikzlibrary{matrix} +\usetikzlibrary{arrows,shapes.geometric} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-1} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (4,2); + \node [matrix,fill=red!20,draw=blue,very thick] (my matrix) at (2,1) + { + \draw (0,0) circle (4mm); & \node[rotate=10] {Hello}; \\ + \draw (0.2,0) circle (2mm); & \fill[red] (0,0) circle (3mm); \\ + }; + + \draw [very thick,->] (0,0) |- (my matrix.west); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-2} +\begin{tikzpicture} + [every node/.style={draw=black,anchor=base,font=\huge}] + + \matrix [draw=red] + { + \node {a}; \fill[blue] (0,0) circle (2pt); & + \node {X}; \fill[blue] (0,0) circle (2pt); & + \node {g}; \fill[blue] (0,0) circle (2pt); \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-3} +\begin{tikzpicture} + [every node/.style={draw=black,anchor=base}] + + \matrix [draw=red] + { + \node {a}; & \node {X}; & \node {g}; \\ + \node {a}; & \node {X}; & \node {g}; \\ + }; + + \matrix [row sep=3mm,draw=red] at (0,-2) + { + \node {a}; & \node {X}; & \node {g}; \\ + \node {a}; & \node {X}; & \node {g}; \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-4} +\begin{tikzpicture}[every node/.style={draw}] + \matrix [draw=red] + { + \node[left] {Hallo}; \fill[blue] (0,0) circle (2pt); \\ + \node {X}; \fill[blue] (0,0) circle (2pt); \\ + \node[right] {g}; \fill[blue] (0,0) circle (2pt); \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-5} +\begin{tikzpicture}[every node/.style={draw}] + \matrix [draw=red,column sep=1cm] + { + \node {8}; & \node{1}; & \node {6}; \\ + \node {3}; & \node{5}; & \node {7}; \\ + \node {4}; & \node{9}; & \node {2}; \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-6} +\begin{tikzpicture} + \matrix [draw,column sep=1cm,nodes=draw] + { + \node(a) {123}; & \node (b) {1}; & \node {1}; \\ + \node {12}; & \node {12}; & \node {1}; \\ + \node(c) {1}; & \node (d) {123}; & \node {1}; \\ + }; + \draw [red,thick] (a.east) -- (a.east |- c) + (d.west) -- (d.west |- b); + \draw [<->,red,thick] (a.east) -- (d.west |- b) + node [above,midway] {1cm}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-7} +\begin{tikzpicture} + \matrix [draw,column sep={1cm,between origins},nodes=draw] + { + \node(a) {123}; & \node (b) {1}; & \node {1}; \\ + \node {12}; & \node {12}; & \node {1}; \\ + \node {1}; & \node {123}; & \node {1}; \\ + }; + \draw [<->,red,thick] (a.center) -- (b.center) node [above,midway] {1cm}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-8} +\begin{tikzpicture} + \matrix [draw,row sep=1cm,nodes=draw] + { + \node (a) {123}; & \node {1}; & \node {1}; \\ + \node (b) {12}; & \node {12}; & \node {1}; \\ + \node {1}; & \node {123}; & \node {1}; \\ + }; + \draw [<->,red,thick] (a.south) -- (b.north) node [right,midway] {1cm}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-9} +\begin{tikzpicture} + \matrix [draw,row sep={1cm,between origins},nodes=draw] + { + \node (a) {123}; & \node {1}; & \node {1}; \\ + \node (b) {12}; & \node {12}; & \node {1}; \\ + \node {1}; & \node {123}; & \node {1}; \\ + }; + \draw [<->,red,thick] (a.center) -- (b.center) node [right,midway] {1cm}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-10} +\begin{tikzpicture} + \matrix [row sep=1mm] + { + \draw (0,0) circle (2mm); & \draw (0,0) circle (2mm); \\ + \draw (0,0) circle (2mm); & \draw (0,0) circle (2mm); \\[-1mm] + \draw (0,0) coordinate (a) circle (2mm); & + \draw (0,0) circle (2mm); \\[1cm,between origins] + \draw (0,0) coordinate (b) circle (2mm); & + \draw (0,0) circle (2mm); \\ + }; + \draw [<->,red,thick] (a.center) -- (b.center) node [right,midway] {1cm}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-11} +\begin{tikzpicture} + \matrix [draw,nodes=draw,column sep=1mm] + { + \node {8}; &[2mm] \node{1}; &[-1mm] \node {6}; \\ + \node {3}; & \node{5}; & \node {7}; \\ + \node {4}; & \node{9}; & \node {2}; \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-12} +\begin{tikzpicture} + \matrix [draw,nodes=draw,column sep=1mm] + { + \node {8}; &[2mm] \node(a){1}; &[1cm,between origins] \node(b){6}; \\ + \node {3}; & \node {5}; & \node {7}; \\ + \node {4}; & \node {9}; & \node {2}; \\ + }; + \draw [<->,red,thick] (a.center) -- (b.center) node [above,midway] {11mm}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-13} +\begin{tikzpicture} + \matrix [draw,nodes=draw,column sep={1cm,between origins}] + { + \node (a) {8}; & \node (b) {1}; &[between borders] \node (c) {6}; \\ + \node {3}; & \node {5}; & \node {7}; \\ + \node {4}; & \node {9}; & \node {2}; \\ + }; + \draw [<->,red,thick] (a.center) -- (b.center) node [above,midway] {10mm}; + \draw [<->,red,thick] (b.east) -- (c.west) node [above,midway] {10mm}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-14} +\begin{tikzpicture} + \matrix [nodes={fill=blue!20,minimum size=5mm}] + { + \node {8}; & \node{1}; & \node {6}; \\ + \node {3}; & \node{5}; & \node {7}; \\ + \node {4}; & \node{9}; & \node {2}; \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-15} +\begin{tikzpicture} + [row 1/.style={red}, + column 2/.style={green!50!black}, + row 3 column 3/.style={blue}] + + \matrix + { + \node {8}; & \node{1}; & \node {6}; \\ + \node {3}; & \node{5}; & \node {7}; \\ + \node {4}; & \node{9}; & \node {2}; \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-16} +\begin{tikzpicture} + [column 1/.style={anchor=base west}, + column 2/.style={anchor=base east}, + column 3/.style={anchor=base}] + \matrix + { + \node {123}; & \node{456}; & \node {789}; \\ + \node {12}; & \node{45}; & \node {78}; \\ + \node {1}; & \node{4}; & \node {7}; \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-17} +\begin{tikzpicture}[ + font=\sffamily, + striped col/.style={column #1/.append style={ + every even row/.style={nodes={fill=olive!50}}}}, + head color/.style args={#1/#2}{column #1/.append style={ + row 1/.append style={nodes={fill=#2}}}} +] + +\matrix [ + matrix of nodes, nodes in empty cells, + nodes={text width=2cm, align=center, + minimum height=1.5em, anchor=center}, + striped col/.list={1,...,5}, % add striped col style to all cols + column 1/.style={ % Override stripes and modify the feature column + row 1 column 1/.style={nodes={fill=none, draw=none}}, + nodes={fill=olive, inner ysep=0}, + }, + % modify headers first via common styles and then specific colors + row 1/.style={nodes={text depth=0.2ex, text width=2cm, text=white}}, + head color/.list={2/orange,3/teal,4/cyan,5/magenta} + ] (m) + { + & Basic & Standard & Professional & Enterprise \\ + Feature A & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\ + Feature B & $\bullet$ & $\bullet$ & $\bullet$ & $\bullet$ \\ + Feature C & & & & $\bullet$ \\ + Feature D & & $\bullet$ & $\bullet$ & $\bullet$ \\ + Feature E & & & $\bullet$ & $\bullet$ \\ + }; +\node[fit={(m-1-4.north west) (m-6-4.south east)}, + ultra thick, inner sep=0, rounded corners=1mm, + draw=cyan, label={[cyan,align=center]270:Popular\\Choice!}]{}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-20} +\begin{tikzpicture} + [matrix of nodes/.style={ + execute at begin cell=\node\bgroup, + execute at end cell=\egroup;% + }] + \matrix [matrix of nodes] + { + 8 & 1 & 6 \\ + 3 & 5 & 7 \\ + 4 & 9 & 2 \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-21} +\begin{tikzpicture} + [matrix of nodes/.style={ + execute at begin cell=\node\bgroup, + execute at end cell=\egroup;,% + execute at empty cell=\node{--};% + }] + \matrix [matrix of nodes] + { + 8 & 1 & \\ + 3 & & 7 \\ + & & 2 \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-22} +\begin{tikzpicture} + \matrix [matrix anchor=west] at (0,0) + { + \node {123}; \\ % still center anchor + \node {12}; \\ + \node {1}; \\ + }; + \matrix [anchor=west] at (0,-2) + { + \node {123}; \\ % inherited west anchor + \node {12}; \\ + \node {1}; \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-23} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \matrix[matrix anchor=inner node.south,anchor=base,row sep=3mm] at (1,1) + { + \node {a}; & \node {b}; & \node {c}; & \node {d}; \\ + \node {a}; & \node(inner node) {b}; & \node {c}; & \node {d}; \\ + \node {a}; & \node {b}; & \node {c}; & \node {d}; \\ + }; + \draw (inner node.south) circle (1pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-24} +\tikz + \matrix [ampersand replacement=\&] + { + \draw (0,0) circle (4mm); \& \node[rotate=10] {Hello}; \\ + \draw (0.2,0) circle (2mm); \& \fill[red] (0,0) circle (3mm); \\ + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-25} +\begin{tikzpicture} + \matrix [matrix of math nodes,row sep=1cm] + { + |(U)| U &[2mm] &[8mm] \\ + & |(XZY)| X \times_Z Y & |(X)| X \\ + & |(Y)| Y & |(Z)| Z \\ + }; + \begin{scope}[every node/.style={midway,auto,font=\scriptsize}] + \draw [double, dashed] (U) -- node {$x$} (X); + \draw (X) -- node {$p$} (X -| XZY.east) + (X) -- node {$f$} (Z) + -- node {$g$} (Y) + -- node {$q$} (XZY) + -- node {$y$} (U); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-26} +\definecolor{graphicbackground}{rgb}{0.96,0.96,0.8} +\begin{tikzpicture}[>=stealth,->,shorten >=2pt,looseness=.5,auto] + \matrix [matrix of math nodes, + column sep={2cm,between origins}, + row sep={3cm,between origins}, + nodes={circle, draw, minimum size=7.5mm}] + { + & |(A)| A & \\ + |(B)| B & |(E)| E & |(C)| C \\ + & |(D)| D \\ + }; + \begin{scope}[every node/.style={font=\small\itshape}] + \draw (A) to [bend left] node [midway] {g} (B); + \draw (B) to [bend left] node [midway] {f} (A); + \draw (D) -- node [midway] {c} (B); + \draw (E) -- node [midway] {b} (B); + \draw (E) -- node [near end] {a} (C); + \draw [-,line width=8pt,draw=graphicbackground] + (D) to [bend right, looseness=1] (A); + \draw (D) to [bend right, looseness=1] + node [near start] {b} node [near end] {e} (A); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-27} +\begin{tikzpicture} + \matrix (network) + [matrix of nodes,% + nodes in empty cells, + nodes={outer sep=0pt,circle,minimum size=4pt,draw}, + column sep={1cm,between origins}, + row sep={1cm,between origins}] + { + & & & \\ + & & & \\ + |[draw=none]| & |[xshift=1mm]| & |[xshift=-1mm]| \\ + }; + \foreach \a in {1,...,4}{ + \draw (network-3-2) -- (network-2-\a); + \draw (network-3-3) -- (network-2-\a); + \draw [-stealth] ([yshift=5mm]network-1-\a.north) -- (network-1-\a); + \foreach \b in {1,...,4} + \draw (network-1-\a) -- (network-2-\b); + } + \draw [stealth-] ([yshift=-5mm]network-3-2.south) -- (network-3-2); + \draw [stealth-] ([yshift=-5mm]network-3-3.south) -- (network-3-3); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-matrices-28} +\begin{tikzpicture} + [auto, + decision/.style={diamond, draw=blue, thick, fill=blue!20, + text width=4.5em,align=flush center, + inner sep=1pt}, + block/.style ={rectangle, draw=blue, thick, fill=blue!20, + text width=5em,align=center, rounded corners, + minimum height=4em}, + line/.style ={draw, thick, -latex',shorten >=2pt}, + cloud/.style ={draw=red, thick, ellipse,fill=red!20, + minimum height=2em}] + + \matrix [column sep=5mm,row sep=7mm] + { + % row 1 + \node [cloud] (expert) {expert}; & + \node [block] (init) {initialize model}; & + \node [cloud] (system) {system}; \\ + % row 2 + & \node [block] (identify) {identify candidate model}; & \\ + % row 3 + \node [block] (update) {update model}; & + \node [block] (evaluate) {evaluate candidate models}; & \\ + % row 4 + & \node [decision] (decide) {is best candidate}; & \\ + % row 5 + & \node [block] (stop) {stop}; & \\ + }; + \begin{scope}[every path/.style=line] + \path (init) -- (identify); + \path (identify) -- (evaluate); + \path (evaluate) -- (decide); + \path (update) |- (identify); + \path (decide) -| node [near start] {yes} (update); + \path (decide) -- node [midway] {no} (stop); + \path [dashed] (expert) -- (init); + \path [dashed] (system) -- (init); + \path [dashed] (system) |- (evaluate); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-paths.lvt b/testfiles/pgfmanual-en-tikz-paths.lvt new file mode 100644 index 000000000..d329dca7c --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-paths.lvt @@ -0,0 +1,438 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{svg.path} +\usetikzlibrary{calc} +\usetikzlibrary{calc} +\usetikzlibrary{calc} +\usetikzlibrary{calc} +\usetikzlibrary{animations} +\usetikzlibrary{intersections} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-1} +\tikz \draw (0,0) -- (1,1) + [rounded corners] -- (2,0) -- (3,1) + [sharp corners] -- (3,0) -- (2,1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-2} +\tikz \draw (0,0) -- (1,1) + {[rounded corners] -- (2,0) -- (3,1)} + -- (3,0) -- (2,1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-3} +\tikz \draw (0,0) -- (1,1) + [color=red] -- (2,0) -- (3,1) + [color=blue] -- (3,0) -- (2,1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-4} +\tikz{\draw (0,0) -- (1,1); + \draw [color=red] (1,1) -- (2,0) -- (3,1); + \draw [color=blue] (3,1) -- (3,0) -- (2,1);} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-5} +\begin{tikzpicture} + [fill=yellow!80!black, % only sets the color + every path/.style={draw}] % all paths are drawn + \fill (0,0) rectangle +(1,1); + \shade (2,0) rectangle +(1,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-6} +\tikz [c/.style={insert path={circle[radius=2pt]}}] + \draw (0,0) -- (1,1) [c] -- (3,2) [c]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-7} +\tikz \draw node [append after command={(foo)--(1,1)},draw] (foo){foo}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-8} +\begin{tikzpicture} + \draw (0,0) --(2,0) (0,1) --(2,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-9} +\tikz [line width=2mm] + \draw (0,0) -- (1,0) -- (1,1) + -- (0,1) -- (current subpath start); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-10} +\begin{tikzpicture}[line width=10pt] + \draw (0,0) --(1,1) (1,1) --(2,0); + \draw (3,0) -- (4,1) -- (5,0); + \useasboundingbox (0,1.5); % make bounding box higher +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-11} +\begin{tikzpicture}[line width=10pt] + \draw (0,0) -- (1,1) -- (1,0) -- (0,0) (2,0) -- (3,1) -- (3,0) -- (2,0); + \draw (5,0) -- (6,1) -- (6,0) -- cycle (7,0) -- (8,1) -- (8,0) -- cycle; + \useasboundingbox (0,1.5); % make bounding box higher +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-12} +\begin{tikzpicture} + \draw (0,0) node(a) [draw] {A} (1,1) node(b) [draw] {B}; + \draw (a.north) |- (b.west); + \draw[color=red] (a.east) -| (2,1.5) -| (b.north); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-13} +\begin{tikzpicture}[ultra thick] + \draw (0,0) -- (1,1) -| cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-14} +\begin{tikzpicture} + \draw[line width=10pt] (0,0) .. controls (1,1) .. (4,0) + .. controls (5,0) and (5,1) .. (4,1); + \draw[color=gray] (0,0) -- (1,1) -- (4,0) -- (5,0) -- (5,1) -- (4,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-15} +\begin{tikzpicture} + \draw[line width=10pt] (0,0) -- (2,0) .. controls (1,1) .. cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-16} +\begin{tikzpicture}[line width=10pt] + \draw (0,0) -- (1,1) (1,1) .. controls (1,0) and (2,0) .. (2,0); + \draw [yshift=-1.5cm] + (0,0) -- (1,1) .. controls (1,0) and (2,0) .. (2,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-17} +\begin{tikzpicture} + \draw (0,0) rectangle (1,1); + \draw (.5,1) rectangle (2,0.5) (3,0) rectangle (3.5,1.5) -- (2,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-18} +\tikz \draw [rounded corners] (0,0) -- (1,1) + -- (2,0) .. controls (3,1) .. (4,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-19} +\begin{tikzpicture} + \draw[color=gray,very thin] (10pt,15pt) circle[radius=10pt]; + \draw[rounded corners=10pt] (0,0) -- (0pt,25pt) -- (40pt,25pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-20} +\begin{tikzpicture} + \draw (0,0) [rounded corners=10pt] -- (1,1) -- (2,1) + [sharp corners] -- (2,0) + [rounded corners=5pt] -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-21} +\tikz \draw[rounded corners=1ex] (0,0) rectangle (20pt,2ex); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-22} +\begin{tikzpicture} + \draw (1,0) circle [radius=1.5]; + \fill (1,0) circle [x radius=1cm, y radius=5mm, rotate=30]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-23} +\begin{tikzpicture}[radius=2pt] + \draw (0,0) circle -- (1,1) circle -- ++(0,1) circle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-25} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + \draw (1,1) ellipse [x radius=1cm,y radius=.5cm]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-26} +\begin{tikzpicture}[radius=1cm] + \draw (0,0) arc[start angle=180, end angle=90] + -- (2,.5) arc[start angle=90, delta angle=-90]; + \draw (4,0) -- +(30:1cm) + arc [start angle=30, delta angle=30] -- cycle; + \draw (8,0) arc [start angle=0, end angle=270, + x radius=1cm, y radius=5mm] -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-27} +\begin{tikzpicture}[radius=1cm,delta angle=30] + \draw (-1,0) -- +(3.5,0); + \draw (1,0) ++(210:2cm) -- +(30:4cm); + \draw (1,0) +(0:1cm) arc [start angle=0]; + \draw (1,0) +(180:1cm) arc [start angle=180]; + \path (1,0) ++(15:.75cm) node{$\alpha$}; + \path (1,0) ++(15:-.75cm) node{$\beta$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-28} +\tikz[rotate=30] \draw[step=1mm] (0,0) grid (2,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-29} +\begin{tikzpicture}[x=.5cm] + \draw[thick] (0,0) grid [step=1] (3,2); + \draw[red] (0,0) grid [step=.75cm] (3,2); +\end{tikzpicture} +\begin{tikzpicture} + \draw (0,0) circle [radius=1]; + \draw[blue] (0,0) grid [step=(45:1)] (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-30} +\begin{tikzpicture} + \draw (0,0) grid [xstep=.5,ystep=.75] (3,2); + \draw[ultra thick] (0,0) grid [ystep=0] (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-31} +\tikz \draw[help lines] (0,0) grid (3,3); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-32} +\begin{tikzpicture} + \draw (0,0) rectangle (1,1.5) + (0,0) parabola (1,1.5); + \draw[xshift=1.5cm] (0,0) rectangle (1,1.5) + (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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-33} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (-1,0) parabola[bend pos=0.5] bend +(0,2) +(3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-34} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (-1,0) parabola[parabola height=2cm] +(3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-35} +\tikz \draw (0,0) rectangle (1,1) (0,0) sin (1,1) + (2,0) rectangle +(1.57,1) (2,0) sin +(1.57,1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-36} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-37} +\begin{tikzpicture} + \filldraw [fill=red!20] (0,1) svg[scale=2] {h 10 v 10 h -10} + node [above left] {upper left} -- cycle; + + \draw svg {M 0 0 L 20 20 h 10 a 10 10 0 0 0 -20 0}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-38} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \node (a) at (2,2) {a}; + + \draw (0,0) to (0,2); + \draw[red] (10pt,10pt) to (a); + \draw[blue] (3,0) -- (3,2) -- (a) to cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-39} +\begin{tikzpicture} + \draw (0,0) to node [sloped,above] {x} (3,2); + + \draw (0,0) to[out=90,in=180] node [sloped,above] {x} (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-40} +\begin{tikzpicture} + \draw (0,0) to [edge node={node [sloped,above] {x}}] (3,2); + + \draw (0,0) to [out=90,in=180, + edge node={node [sloped,above] {x}}] (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-41} +\tikz \draw (0,0) to [edge label=x] (3,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-42} +\tikz \draw (0,0) to [edge label=x, edge label'=y] (3,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-43} +\tikz[every to/.style={bend left}] + \draw (0,0) to (3,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-44} +\tikz[every to/.style={append after command={[draw,dashed]}}] + \draw (0,0) to (3,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-45} +\begin{tikzpicture}[to path={ + .. controls +(1,0) and +(1,0) .. (\tikztotarget) \tikztonodes}] + + \node (a) at (0,0) {a}; + \node (b) at (2,1) {b}; + \node (c) at (1,2) {c}; + + \draw (a) to node {x} (b) + (a) to (c); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-46} +\tikzset{ + my loop/.style={to path={ + .. controls +(80:1) and +(100:1) .. (\tikztotarget) \tikztonodes}}, + my state/.style={circle,draw}} + +\begin{tikzpicture}[shorten >=2pt] + \node [my state] (a) at (210:1) {$q_a$}; + \node [my state] (b) at (330:1) {$q_b$}; + + \draw[->] (a) to node[below] {1} (b) + to [my loop] node[above right] {0} (b); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-47} +\tikz \draw (0,0) foreach \x in {1,...,3} { -- (\x,1) -- (\x,0) }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-48} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + + \draw let \p{foo} = (1,1), \p2 = (2,0) in + (0,0) -- (\p2) -- (\p{foo}); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-49} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + + \draw (1,0) coordinate (first point) + -- (3,2) coordinate (second point); + + \fill[red] let \p1 = (first point), + \p2 = (second point) in + (\x1,\y2) circle [radius=2pt]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-50} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,2); + + \path % let's define some points: + let + \p1 = (1,0), + \p2 = (3,2), + \p{center} = ($ (\p1) !.5! (\p2) $) % center + in + coordinate (p1) at (\p1) + coordinate (p2) at (\p2) + coordinate (center) at (\p{center}); + + \draw (p1) -- (p2); + \fill[red] (center) circle [radius=2pt]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-51} +\pgfmathsetseed{1} +\begin{tikzpicture} + \draw [help lines] (0,0) grid (3,3); + + \coordinate (a) at (rnd,rnd); + \coordinate (b) at (3-rnd,3-rnd); + \draw (a) -- (b); + + \node (c) at (1,2) {x}; + + \draw let \p1 = ($ (a)!(c)!(b) - (c) $), + \n1 = {veclen(\x1,\y1)} + in circle [at=(c), radius=\n1]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-52} +\tikz \draw :xshift = {0s = "0cm", 30s = "-3cm", repeats} (0,0) circle (5mm); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-53} +\newdimen\mydim +\begin{tikzpicture} + \mydim=1cm + \draw (0pt,\mydim) \pgfextra{\mydim=2cm} -- (0pt,\mydim); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-54} +\newdimen\mydim +\begin{tikzpicture} + \mydim=1cm + \draw (0pt,\mydim) + \pgfextra \mydim=2cm \endpgfextra -- (0pt,\mydim); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-paths-55} +\begin{tikzpicture} + \path[save path=\pathA,name path=A] (0,1) to [bend left] (1,0); + \path[save path=\pathB,name path=B] + (0,0) .. controls (.33,.1) and (.66,.9) .. (1,1); + + \fill[name intersections={of=A and B}] (intersection-1) circle (1pt); + + \draw[blue][use path=\pathA]; + \draw[red] [use path=\pathB]; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-pics.lvt b/testfiles/pgfmanual-en-tikz-pics.lvt new file mode 100644 index 000000000..c734a5d71 --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-pics.lvt @@ -0,0 +1,205 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{animations} +\usetikzlibrary{animations} +\usetikzlibrary{angles,quotes} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-2} +\tikzset{ + seagull/.pic={ + % Code for a "seagull". Do you see it?... + \draw (-3mm,0) to [bend left] (0,0) to [bend left] (3mm,0); + }, +} +\tikz \fill [fill=blue!20] + (1,1) + -- (2,2) pic {seagull} + -- (3,2) pic {seagull} + -- (3,1) pic [rotate=30] {seagull} + -- (2,1) pic [red] {seagull}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-3} +\tikzset{ + seagull/.pic={ + % Code for a "seagull". Do you see it?... + \draw (-3mm,0) to [bend left] (0,0) to [bend left] (3mm,0); + }, +} +\tikz { + \path (0,0) pic [pic type = seagull] + (1,0) pic {seagull}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-4} +\tikzset{ + seagull/.pic={ + % Code for a "seagull". Do you see it?... + \draw (-3mm,0) to [bend left] (0,0) to [bend left] (3mm,0); + }, +} +\tikz { % different ways of placing pics + \draw [help lines] (0,0) grid (3,2); + \pic at (1,0) {seagull}; + \path (2,1) pic {seagull}; + \pic [at={(3,2)}] {seagull}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-5} +\tikzset{ + seagull/.pic={ + % Code for a "seagull". Do you see it?... + \draw (-3mm,0) to [bend left] (0,0) to [bend left] (3mm,0); + }, +} +\tikz [scale=2] { + \pic at (0,0) {seagull}; + \pic at (1,0) [transform shape] {seagull}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-6} +\tikzset{ + seagull/.pic={ + % Code for a "seagull". Do you see it?... + \draw (-3mm,0) to [bend left] (0,0) to [bend left] (3mm,0); + }, +} +\tikz [rotate=30] { + \pic at (0,0) {seagull}; + \pic at (1,0) [rotate=90] {seagull}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-7} +\tikzset{ + seagull/.pic={ + % Code for a "seagull". Do you see it?... + \draw (-3mm,0) to [bend left] (0,0) to [bend left] (3mm,0); + }, +} +\tikz \draw + (0,0) to [bend left] + pic [near start] {seagull} + pic {seagull} + pic [sloped, near end] {seagull} (4,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-8} +\tikz \pic [pics/code={\draw (-3mm,0) to[bend left] (0,0) + to[bend left] (3mm,0);}] + {}; % no pic type specified +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-9} +\tikz \draw (0,0) .. controls(1,0) and (2,1) .. (3,1) + foreach \t in {0, 0.125, ..., 1} { + pic [pos=\t] {code={\draw circle [radius=2pt];}} + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-11} +\tikzset{ + my pic/.pic = { + \path [pic actions] (0,0) circle[radius=3mm]; + \draw (-3mm,-3mm) rectangle (3mm,3mm); + } +} +\tikz \pic {my pic}; \space +\tikz \pic [red] {my pic}; \space +\tikz \pic [draw] {my pic}; \space +\tikz \pic [draw=red] {my pic}; \space +\tikz \pic [draw, shading=ball] {my pic}; \space +\tikz \pic [fill=red!50] {my pic}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-12} +\tikzset{ + seagull/.pic={ + % Code for a "seagull". Do you see it?... + \draw (-3mm,0) to [bend left] (0,0) to [bend left] (3mm,0); + }, +} +\tikz \fill [fill=blue!20] + (1,1) + -- (2,2) pic [behind path] {seagull} + -- (3,2) pic {seagull} + -- (3,1) pic [rotate=30] {seagull} + -- (2,1) pic [red, behind path] {seagull}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-13} +\tikzset{ + seagull/.pic={ + % Code for a "seagull". Do you see it?... + \draw (-3mm,0) to [bend left] (0,0) to [bend left] (3mm,0); + }, +} +\tikz \pic foreach \x in {1,2,3} at (\x,0) {seagull}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-14} +\tikzset{ + seagull/.pic={ + % Code for a "seagull". Do you see it?... + \draw (-3mm,0) to [bend left] (0,0) to [bend left] (3mm,0); + }, +} +\begin{tikzpicture}[every pic/.style={scale=2,transform shape}] + \pic foreach \x in {1,2,3} at (\x,0) {seagull}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-17} +\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); + } +} +\tikz { + \pic :rotate={0s="0", 20s="90"} {seagull}; + \pic at (1.5,1.5) {seagull}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-18} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-19} +\tikz \draw (3,0) coordinate (A) + -- (0,1) coordinate (B) + -- (1,2) coordinate (C) + pic [draw, "$\alpha$"] {angle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-pics-22} +\tikzset{ + pics/my circle/.style = { + background code = { \fill circle [radius=#1]; } + } +} +\tikz [fill=blue!30] + \draw (0,0) pic {my circle=2mm} -- (1,1) pic {my circle=5mm}; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-plots.lvt b/testfiles/pgfmanual-en-tikz-plots.lvt new file mode 100644 index 000000000..da627ff91 --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-plots.lvt @@ -0,0 +1,204 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{patterns} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-1} +\tikz \draw plot coordinates {(0,0) (1,1) (2,0) (3,1) (2,1) (10:2cm)}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-2} +\begin{tikzpicture} + \draw (0,0) -- (1,1) plot coordinates {(2,0) (4,0)}; + \draw[color=red,xshift=5cm] + (0,0) -- (1,1) -- plot coordinates {(2,0) (4,0)}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-3} +\tikz \draw plot[mark=x,smooth] file {plots/pgfmanual-sine.table}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-6} +\begin{tikzpicture}[domain=0:4] + \draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9); + + \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$}; + \draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$}; + + \draw[color=red] plot (\x,\x) node[right] {$f(x) =x$}; + % \x r means to convert '\x' from degrees to _r_adians: + \draw[color=blue] plot (\x,{sin(\x r)}) node[right] {$f(x) = \sin x$}; + \draw[color=orange] plot (\x,{0.05*exp(\x)}) node[right] {$f(x) = \frac{1}{20} \mathrm e^x$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-7} +\tikz \draw[scale=0.5,domain=-3.141:3.141,smooth,variable=\t] + plot ({\t*sin(\t r)},{\t*cos(\t r)}); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-8} +\tikz \draw[domain=0:360,smooth,variable=\t] + plot ({sin(\t)},\t/360,{cos(\t)}); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-9} +\begin{tikzpicture}[domain=0:4] + \draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9); + + \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$}; + \draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$}; + + \draw[color=red] plot[id=x] function{x} node[right] {$f(x) =x$}; + \draw[color=blue] plot[id=sin] function{sin(x)} node[right] {$f(x) = \sin x$}; + \draw[color=orange] plot[id=exp] function{0.05*exp(x)} node[right] {$f(x) = \frac{1}{20} \mathrm e^x$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-10} +\tikz \draw[scale=0.5,domain=-3.141:3.141,smooth] + plot[parametric,id=parametric-example] function{t*sin(t),t*cos(t)}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-11} +\tikz \draw[scale=0.5,domain=-3.141:3.141, samples=100, smooth, range=-3:3] + plot[id=tan-example] function{tan(x)}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-12} +\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)}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-16} +\tikz \draw plot[mark=x,mark repeat=3,smooth] file {plots/pgfmanual-sine.table}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-17} +\tikz \draw plot[mark=x,mark repeat=3,mark phase=6,smooth] file {plots/pgfmanual-sine.table}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-18} +\tikz \draw plot[mark=x,mark indices={1,4,...,10,11,12,...,16,20},smooth] + file {plots/pgfmanual-sine.table}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-19} +\tikz \fill[fill=blue!20] + plot[mark=triangle*,mark options={color=blue,rotate=180}] + file{plots/pgfmanual-sine.table} |- (0,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-20} +\tikz\draw plot[smooth] file{plots/pgfmanual-sine.table}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-21} +\begin{tikzpicture}[smooth cycle] + \draw plot[tension=0.2] + coordinates{(0,0) (1,1) (2,0) (1,-1)}; + \draw[yshift=-2.25cm] plot[tension=0.5] + coordinates{(0,0) (1,1) (2,0) (1,-1)}; + \draw[yshift=-4.5cm] plot[tension=1] + coordinates{(0,0) (1,1) (2,0) (1,-1)}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-22} +\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; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-23} +\tikz\draw plot[const plot] file{plots/pgfmanual-sine.table}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-24} +\tikz\draw plot[const plot mark left,mark=*] file{plots/pgfmanual-sine.table}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-25} +\tikz\draw plot[const plot mark right,mark=*] file{plots/pgfmanual-sine.table}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-26} +\tikz\draw plot[const plot mark mid,mark=*] file{plots/pgfmanual-sine.table}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-27} +\tikz\draw plot[jump mark left, mark=*] file{plots/pgfmanual-sine.table}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-28} +\tikz\draw plot[jump mark right, mark=*] file{plots/pgfmanual-sine.table}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-29} +\tikz\draw plot[jump mark mid, mark=*] file{plots/pgfmanual-sine.table}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-30} +\tikz\draw[ultra thick] plot[ycomb,thin,mark=*] file{plots/pgfmanual-sine.table}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-31} +\begin{tikzpicture}[ycomb] + \draw[color=red,line width=6pt] + plot coordinates{(0,1) (.5,1.2) (1,.6) (1.5,.7) (2,.9)}; + \draw[color=red!50,line width=4pt,xshift=3pt] + plot coordinates{(0,1.2) (.5,1.3) (1,.5) (1.5,.2) (2,.5)}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-32} +\tikz \draw plot[xcomb,mark=x] coordinates{(1,0) (0.8,0.2) (0.6,0.4) (0.2,1)}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-33} +\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)}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-34} +\tikz\draw[draw=blue,fill=blue!60!black] plot[ybar] file{plots/pgfmanual-sine.table}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-35} +\begin{tikzpicture}[ybar] + \draw[color=red,fill=red!80,bar width=6pt] + plot coordinates{(0,1) (.5,1.2) (1,.6) (1.5,.7) (2,.9)}; + \draw[color=red!50,fill=red!20,bar width=4pt,bar shift=3pt] + plot coordinates{(0,1.2) (.5,1.3) (1,.5) (1.5,.2) (2,.5)}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-36} +\tikz \draw[pattern=north west lines] plot[xbar] + coordinates{(1,0) (0.4,1) (1.7,2) (1.6,3)}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-37} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-38} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-plots-39} +\tikz \draw (0,0) sin (1,1) cos (2,0) + plot[only marks,mark=x] coordinates{(0,0) (1,1) (2,0) (3,-1)}; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-scopes.lvt b/testfiles/pgfmanual-en-tikz-scopes.lvt new file mode 100644 index 000000000..ea04f6f30 --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-scopes.lvt @@ -0,0 +1,131 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{shapes.misc} +\usetikzlibrary{backgrounds} +\usetikzlibrary{scopes} +\usetikzlibrary{backgrounds} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tikz-scopes-1} +$A \mathbin{\tikz[baseline] \draw[->>] (0pt,.5ex) -- (3ex,.5ex);} B$ +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-scopes-2} +Hello +\tikz[baseline=(X.base)] + \node [cross out,draw] (X) {world.}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-scopes-3} +Top align: +\tikz[baseline=(current bounding box.north)] + \draw (0,0) rectangle (1cm,1ex); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-scopes-4} +\begin{tikzpicture}[execute at end picture=% + { + \begin{pgfonlayer}{background} + \path[fill=yellow,rounded corners] + (current bounding box.south west) rectangle + (current bounding box.north east); + \end{pgfonlayer} + }] + \node at (0,0) {X}; + \node at (2,1) {Y}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-scopes-7} +\begin{tikzpicture}[ultra thick] + \begin{scope}[red] + \draw (0mm,10mm) -- (10mm,10mm); + \draw (0mm,8mm) -- (10mm,8mm); + \end{scope} + \draw (0mm,6mm) -- (10mm,6mm); + \begin{scope}[green] + \draw (0mm,4mm) -- (10mm,4mm); + \draw (0mm,2mm) -- (10mm,2mm); + \draw[blue] (0mm,0mm) -- (10mm,0mm); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-scopes-8} +\begin{tikzpicture} + { [ultra thick] + { [red] + \draw (0mm,10mm) -- (10mm,10mm); + \draw (0mm,8mm) -- (10mm,8mm); + } + \draw (0mm,6mm) -- (10mm,6mm); + } + { [green] + \draw (0mm,4mm) -- (10mm,4mm); + \draw (0mm,2mm) -- (10mm,2mm); + \draw[blue] (0mm,0mm) -- (10mm,0mm); + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-scopes-9} +\begin{tikzpicture} + \node [fill=white] at (1,1) {Hello world}; + \scoped [on background layer] + \draw (0,0) grid (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-scopes-10} +\tikz \draw (0,0) -- (1,1) + {[rounded corners] -- (2,0) -- (3,1)} + -- (3,0) -- (2,1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-scopes-11} +\begin{tikzpicture} + \draw (0,0) grid +(2,2); + \draw[help lines] (2,0) grid +(2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-scopes-13} +\begin{tikzpicture}[help lines/.style={blue!50,very thin}] + \draw (0,0) grid +(2,2); + \draw[help lines] (2,0) grid +(2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-scopes-14} +\tikzset{help lines/.style={blue!50,very thin}} +\begin{tikzpicture} + \draw (0,0) grid +(2,2); + \draw[help lines] (2,0) grid +(2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-scopes-15} +\begin{tikzpicture}[help lines/.append style=blue!50] + \draw (0,0) grid +(2,2); + \draw[help lines] (2,0) grid +(2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-scopes-16} +\begin{tikzpicture}[outline/.style={draw=#1,thick,fill=#1!50}] + \node [outline=red] at (0,1) {red}; + \node [outline=blue] at (0,0) {blue}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-scopes-17} +\begin{tikzpicture}[outline/.style={draw=#1,thick,fill=#1!50}, + outline/.default=black] + \node [outline] at (0,1) {default}; + \node [outline=blue] at (0,0) {blue}; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-shapes.lvt b/testfiles/pgfmanual-en-tikz-shapes.lvt new file mode 100644 index 000000000..44facc2e3 --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-shapes.lvt @@ -0,0 +1,1009 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{animations} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.geometric} +\usetikzlibrary{shapes.multipart} +\usetikzlibrary{shapes.multipart} +\usetikzlibrary{shapes.multipart} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{fit,shapes.geometric} +\usetikzlibrary{backgrounds,fit,shapes.geometric} +\usepgfmodule{nonlineartransformations}\usetikzlibrary{curvilinear} +\usepgfmodule{nonlineartransformations}\usetikzlibrary{curvilinear} +\usetikzlibrary{automata} +\usetikzlibrary{automata} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{quotes} +\usetikzlibrary{quotes} +\usetikzlibrary{quotes} +\usetikzlibrary{quotes} +\usetikzlibrary{quotes} +\usetikzlibrary{quotes} +\usetikzlibrary{quotes} +\usetikzlibrary{quotes} +\usetikzlibrary{quotes} +\usetikzlibrary{quotes} +\usetikzlibrary{quotes} +\usetikzlibrary{quotes} +\usetikzlibrary{quotes} +\usetikzlibrary{quotes} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-1} +\tikz \fill [fill=yellow!80!black] + (0,0) node {first node} + -- (1,1) node[behind path] {second node} + -- (2,0) node {third node}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-2} +\tikz { + \path (0,0) node [red] {A} + (1,0) node [blue] {B} + (2,0) node [green, node contents=C] + (3,0) node [node contents=D] ; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-3} +\tikz \fill [fill=blue!50, draw=blue, very thick] + (0,0) node [behind path, fill=red!50] {first node} + -- (1.5,0) node [behind path, fill=green!50] {second node} + -- (1.5,1) node [behind path, fill=brown!50] {third node} + -- (0,1) node [ fill=blue!30] {fourth node}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-4} +\tikz \fill[fill=yellow!80!black] + (0,0) node {first node} + -- (1,1) node[draw, behind path] {second node} + -- (0,2) node[fill=red!20,draw,double,rounded corners] {third node}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-5} +\tikz \fill[fill=yellow!80!black] + (0,0) node {first node} + -- (1,1) node[ellipse,draw, behind path] {second node} + -- (0,2) node[circle,fill=red!20] {third node}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-6} +\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!}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-7} +\tikz \draw (0,0) node foreach \x in {1,2,3} at (\x,0) {\x}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-8} +\tikz \draw (0,0) node at (1,0) {1} node at (2,0) {2} node at (3,0) {3}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-9} +\tikz \node foreach \x in {1,...,4} foreach \y in {1,2,3} + [draw] at (\x,\y) {\x,\y}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-10} +\begin{tikzpicture}[every node/.style={draw}] + \draw (0,0) node {A} -- (1,1) node {B}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-11} +\begin{tikzpicture} + [every rectangle node/.style={draw}, + every circle node/.style={draw,double}] + \draw (0,0) node[rectangle] {A} -- (1,1) node[circle] {B}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-12} +\begin{tikzpicture} + [execute at begin node={A}, + execute at end node={D}] + \node[execute at begin node={B}] {C}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-13} +\tikz { + \begin{scope}[name prefix = top-] + \node (A) at (0,1) {A}; + \node (B) at (1,1) {B}; + \draw (A) -- (B); + \end{scope} + \begin{scope}[name prefix = bottom-] + \node (A) at (0,0) {A}; + \node (B) at (1,0) {B}; + \draw (A) -- (B); + \end{scope} + + \draw [red] (top-A) -- (bottom-B); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-14} +\begin{tikzpicture}[every node/.style={draw}] + \path[yshift=1.5cm,shape=rectangle] + (0,0) node(a1){} (1,0) node(a2){} + (1,1) node(a3){} (0,1) node(a4){}; + \filldraw[fill=yellow!80!black] (a1) -- (a2) -- (a3) -- (a4); + + \path[shape=coordinate] + (0,0) coordinate(b1) (1,0) coordinate(b2) + (1,1) coordinate(b3) (0,1) coordinate(b4); + \filldraw[fill=yellow!80!black] (b1) -- (b2) -- (b3) -- (b4); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-15} +\begin{tikzpicture} + \draw (0,0) node[inner sep=0pt,draw] {tight} + (0cm,2em) node[inner sep=5pt,draw] {loose} + (0cm,4em) node[fill=yellow!80!black] {default}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-16} +\begin{tikzpicture} + \draw[line width=5pt] + (0,0) node[fill=yellow!80!black] (f) {filled} + (2,0) node[draw] (d) {drawn} + (1,-2) node[draw,scale=2] (s) {scaled}; + + \draw[->] (1,-1) -- (f); + \draw[->] (1,-1) -- (d); + \draw[->] (1,-1) -- (s); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-17} +\begin{tikzpicture}[outer sep=auto] + \draw[line width=5pt] + (0,0) node[fill=yellow!80!black] (f) {filled} + (2,0) node[draw] (d) {drawn} + (1,-2) node[draw,scale=2] (s) {scaled}; + + \draw[->] (1,-1) -- (f); + \draw[->] (1,-1) -- (d); + \draw[->] (1,-1) -- (s); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-18} +\begin{tikzpicture} + \draw (0,0) node[minimum height=1cm,draw] {1cm} + (2,0) node[minimum height=0cm,draw] {0cm}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-19} +\begin{tikzpicture} + \draw (0,0) node[minimum height=2cm,minimum width=3cm,draw] {$3 \times 2$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-20} +\begin{tikzpicture} + \draw (0,0) node[minimum size=2cm,draw] {square}; + \draw (0,-2) node[minimum size=2cm,draw,circle] {circle}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-21} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-22} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-23} +\tikzset{every node/.style={isosceles triangle, draw}} +\begin{tikzpicture} + \node {abc}; + \node [shape border uses incircle] at (2,0) {abc}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-24} +\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}; + \foreach \s/\t in + {left side/base east, bottom side/north, bottom left corner/base}{ + \fill[red] (A.\s) circle(1.5pt) (B.\s) circle(1.5pt); + \fill[blue] (A.\t) circle(1.5pt) (B.\t) circle(1.5pt); + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-25} +\begin{tikzpicture} + \node [circle split,draw,double,fill=red!20] + { + % No \nodepart has been used, yet. So, the following is put in the + % ``text'' node part by default. + $q_1$ + \nodepart{lower} % Ok, end ``text'' part, start ``output'' part + $00$ + }; % output part ended. +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-26} +\tikz [every lower node part/.style={red}] + \node [circle split,draw] {$q_1$ \nodepart{lower} $00$}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-27} +\begin{tikzpicture} + \draw[red] (0,0) -- +(1,1) node[above] {red}; + \draw[text=red] (1,0) -- +(1,1) node[above] {red}; + \draw (2,0) -- +(1,1) node[above,red] {red}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-28} +\begin{tikzpicture} + \draw[node font=\itshape] (1,0) -- +(1,1) node[above] {italic}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-29} +\tikz \node [node font=\tiny, minimum height=3em, draw] {tiny}; +\tikz \node [node font=\small, minimum height=3em, draw] {small}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-30} +\begin{tikzpicture} + \node [font=\itshape] {italic}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-31} +\tikz \node [font=\tiny, minimum height=3em, draw] {tiny}; +\tikz \node [font=\small, minimum height=3em, draw] {small}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-32} +\tikz [every text node part/.style={font=\itshape}, + every lower node part/.style={font=\footnotesize}] + \node [circle split,draw] {state \nodepart{lower} output}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-33} +\tikz \node [draw] { + \begin{tabular}{cc} + upper left & upper right\\ + lower left & lower right + \end{tabular} +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-34} +\tikz[align=left] \node[draw] {This is a\\demonstration.}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-35} +\tikz[align=center] \node[draw] {This is a\\demonstration.}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-36} +\tikz \node[fill=yellow!80!black,align=right] + {This is a\\[-2pt] demonstration text for\\[1ex] alignments.}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-37} +\tikz \draw (0,0) node[fill=yellow!80!black,text width=3cm] + {This is a demonstration text for showing how line breaking works.}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-38} +\tikz \node[fill=yellow!80!black,align=left] + {This is a\\ demonstration text for\\ alignments.}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-39} +\tikz \node[fill=yellow!80!black,text width=3cm,align=left] + {This is a demonstration text for showing how line breaking works.}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-40} +\tikz \node[fill=yellow!80!black,text width=3cm,align=flush left] + {This is a demonstration text for showing how line breaking works.}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-41} +\tikz \node[fill=yellow!80!black,align=right] + {This is a\\ demonstration text for\\ alignments.}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-42} +\tikz \node[fill=yellow!80!black,text width=3cm,align=right] + {This is a demonstration text for showing how line breaking works.}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-43} +\tikz \node[fill=yellow!80!black,text width=3cm,align=flush right] + {This is a demonstration text for showing how line breaking works.}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-44} +\tikz \node[fill=yellow!80!black,align=center] + {This is a\\ demonstration text for\\ alignments.}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-45} +\tikz \node[fill=yellow!80!black,text width=3cm,align=center] + {This is a demonstration text for showing how line breaking works.}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-46} +\tikz \node[fill=yellow!80!black,text width=3cm,align=flush center] + {This is a demonstration text for showing how line breaking works.}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-47} +\tikz \node[fill=yellow!80!black,text width=3cm,align=justify] + {This is a demonstration text for showing how line breaking works.}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-49} +\tikz \node[draw] {y}; +\tikz \node[draw,text height=10pt] {y}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-50} +\tikz \draw (0,0) node[anchor=north east] {first node} + rectangle (1,1) node[anchor=west] {second node}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-51} +\begin{tikzpicture}[scale=3,transform shape] + % First, center alignment -> wobbles + \draw[anchor=center] (0,1) node{x} -- (0.5,1) node{y} -- (1,1) node{t}; + % Second, base alignment -> no wobble, but too high + \draw[anchor=base] (0,.5) node{x} -- (0.5,.5) node{y} -- (1,.5) node{t}; + % Third, mid alignment + \draw[anchor=mid] (0,0) node{x} -- (0.5,0) node{y} -- (1,0) node{t}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-52} +\tikz \fill (0,0) circle (2pt) node[above] {above}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-53} +\tikz \fill (0,0) circle (2pt) node[above=2pt] {above}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-54} +\tikz \fill (0,0) circle (2pt) node[above left] {above left}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-55} +\tikz \fill (0,0) circle (2pt) node[above right] {above right}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-56} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (2,2); + \node at (1,1) [above=2pt+3pt,draw] {above}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-57} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (2,2); + \node at (1,1) [above=.2,draw] {above}; + % south border of the node is now 2mm above (1,1) +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-58} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (2,2); + \node at (1,1) [above=.2 and 3mm,draw] {above}; + % south border of the node is also 2mm above (1,1) +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-59} +\begin{tikzpicture}[every node/.style=draw] + \draw[help lines] (0,0) grid (2,2); + \node (somenode) at (1,1) {some node}; + + \node [above=5mm of somenode.north east] {\tiny 5mm of somenode.north east}; + \node [above=1cm of somenode.north] {\tiny 1cm of somenode.north}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-60} +\begin{tikzpicture}[every node/.style=draw] + \draw[help lines] (0,0) grid (2,2); + \node (some node) at (1,1) {some node}; + + \node (other node) [above=1cm of some node] {\tiny above=1cm of some node}; + + \draw [<->] (some node.north) -- (other node.south) + node [midway,right,draw=none] {1cm}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-61} +\begin{tikzpicture}[every node/.style=draw] + \draw[help lines] (0,0) grid (2,3); + + % Not gridded + \node (a1) at (0,0) {not gridded}; + \node (b1) [above=1cm of a1] {fooy}; + \node (c1) [above=1cm of b1] {a}; + + % gridded + \node (a2) at (2,0) {gridded}; + \node (b2) [on grid,above=1cm of a2] {fooy}; + \node (c2) [on grid,above=1cm of b2] {a}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-62} +\begin{tikzpicture}[every node/.style=draw,node distance=5mm] + \draw[help lines] (0,0) grid (2,3); + + % Not gridded + \node (a1) at (0,0) {not gridded}; + \node (b1) [above=of a1] {fooy}; + \node (c1) [above=of b1] {a}; + + % gridded + \begin{scope}[on grid] + \node (a2) at (2,0) {gridded}; + \node (b2) [above=of a2] {fooy}; + \node (c2) [above=of b2] {a}; + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-63} +\begin{tikzpicture}[every node/.style={draw,circle}] + \draw[help lines] (0,0) grid (2,5); + \begin{scope}[node distance=5mm and 5mm] + \node (b) at (1,4) {b}; + \node [left=of b] {1}; \node [right=of b] {2}; + \node [above=of b] {3}; \node [below=of b] {4}; + \node [above left=of b] {5}; \node [above right=of b] {6}; + \node [below left=of b] {7}; \node [below right=of b] {8}; + \end{scope} + \begin{scope}[node distance=5mm] + \node (a) at (1,1) {a}; + \node [left=of a] {1}; \node [right=of a] {2}; + \node [above=of a] {3}; \node [below=of a] {4}; + \node [above left=of a] {5}; \node [above right=of a] {6}; + \node [below left=of a] {7}; \node [below right=of a] {8}; + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-64} +\begin{tikzpicture}[every node/.style={draw,rectangle}] + \draw[help lines] (0,0) grid (2,5); + \begin{scope}[node distance=5mm and 5mm] + \node (b) at (1,4) {b}; + \node [left=of b] {1}; \node [right=of b] {2}; + \node [above=of b] {3}; \node [below=of b] {4}; + \node [above left=of b] {5}; \node [above right=of b] {6}; + \node [below left=of b] {7}; \node [below right=of b] {8}; + \end{scope} + \begin{scope}[node distance=5mm] + \node (a) at (1,1) {a}; + \node [left=of a] {1}; \node [right=of a] {2}; + \node [above=of a] {3}; \node [below=of a] {4}; + \node [above left=of a] {5}; \node [above right=of a] {6}; + \node [below left=of a] {7}; \node [below right=of a] {8}; + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-65} +\begin{tikzpicture}[every node/.style={draw,rectangle},on grid] + \draw[help lines] (0,0) grid (4,4); + \begin{scope}[node distance=1] + \node (a) at (2,3) {a}; + \node [left=of a] {1}; \node [right=of a] {2}; + \node [above=of a] {3}; \node [below=of a] {4}; + \node [above left=of a] {5}; \node [above right=of a] {6}; + \node [below left=of a] {7}; \node [below right=of a] {8}; + \end{scope} + \begin{scope}[node distance=1 and 1] + \node (b) at (2,0) {b}; + \node [left=of b] {1}; \node [right=of b] {2}; + \node [above=of b] {3}; \node [below=of b] {4}; + \node [above left=of b] {5}; \node [above right=of b] {6}; + \node [below left=of b] {7}; \node [below right=of b] {8}; + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-66} +\begin{tikzpicture}[node distance=1ex] + \draw[help lines] (0,0) grid (3,1); + \huge + \node (X) at (0,1) {X}; + \node (a) [right=of X] {a}; + \node (y) [right=of a] {y}; + + \node (X) at (0,0) {X}; + \node (a) [base right=of X] {a}; + \node (y) [base right=of a] {y}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-67} +\begin{tikzpicture}[level distance=8mm] + \node (root) {root} + child { node (a) {a} } + child { node (b) {b} + child { node (d) {d} } + child { node (e) {e} } } + child { node (c) {c} }; + + \node[draw=red,inner sep=0pt,thick,ellipse,fit=(root) (b) (d) (e)] {}; + \node[draw=blue,inner sep=0pt,thick,ellipse,fit=(b) (c) (e)] {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-68} +\begin{tikzpicture}[level distance=8mm] + \node (root) {root} + child { node (a) {a} } + child { node (b) {b} + child { node (d) {d} } + child { node (e) {e} } } + child { node (c) {c} }; + + \begin{scope}[on background layer] + \node[fill=red!20,inner sep=0pt,ellipse,fit=(root) (b) (d) (e)] {}; + \node[fill=blue!20,inner sep=0pt,ellipse,fit=(b) (c) (e)] {}; + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-69} +\makeatletter +\begin{tikzpicture}[every node/.style={draw}] + \draw[help lines](0,0) grid (3,2); + \draw (1,0) node{A} + (2,0) node[rotate=90,scale=1.5] {B}; + \draw[rotate=30] (1,0) node{A} + (2,0) node[rotate=90,scale=1.5] {B}; + \draw[rotate=60] (1,0) node[transform shape] {A} + (2,0) node[transform shape,rotate=90,scale=1.5] {B}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-70} +\makeatletter +\begin{tikzpicture} + % Install a nonlinear transformation: + \pgfsetcurvilinearbeziercurve + {\pgfpoint{0mm}{20mm}} + {\pgfpoint{10mm}{20mm}} + {\pgfpoint{10mm}{10mm}} + {\pgfpoint{20mm}{10mm}} + \pgftransformnonlinear{\pgfpointcurvilinearbezierorthogonal\pgf@x\pgf@y}% + + % 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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-71} +\tikz \draw (0,0) -- (3,1) + node[pos=0]{0} node[pos=0.5]{1/2} node[pos=0.9]{9/10}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-72} +\tikz { + \draw [help lines] (0,0) grid (3,2); + \draw (2,0) arc [x radius=1, y radius=2, start angle=0, end angle=180] + node foreach \t in {0,0.125,...,1} [pos=\t,auto] {\t}; +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-73} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-74} +\tikz \draw (0,0) |- (3,1) + node[pos=0]{0} node[pos=0.5]{1/2} node[pos=0.9]{9/10}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-75} +\tikz \draw (0,0) -| (3,1) + node[pos=0]{0} node[pos=0.5]{1/2} node[pos=0.9]{9/10}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-76} +\begin{tikzpicture} + [scale=.8,auto=left,every node/.style={circle,fill=blue!20}] + \node (a) at (-1,-2) {a}; + \node (b) at ( 1,-2) {b}; + \node (c) at ( 2,-1) {c}; + \node (d) at ( 2, 1) {d}; + \node (e) at ( 1, 2) {e}; + \node (f) at (-1, 2) {f}; + \node (g) at (-2, 1) {g}; + \node (h) at (-2,-1) {h}; + + \foreach \from/\to in {a/b,b/c,c/d,d/e,e/f,f/g,g/h,h/a} + \draw [->] (\from) -- (\to) + node[midway,fill=red!20] {\from--\to}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-77} +\begin{tikzpicture}[auto] + \draw[help lines,use as bounding box] (0,-.5) grid (4,5); + + \draw (0.5,0) .. controls (9,6) and (-5,6) .. (3.5,0) + node foreach \pos in {0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1} + [pos=\pos,swap,fill=red!20] {\pos} + node foreach \pos in {0.025,0.2,0.4,0.6,0.8,0.975} + [pos=\pos,fill=blue!20] {\pos}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-78} +\begin{tikzpicture}[shorten >=1pt,node distance=2cm,auto] + \draw[help lines] (0,0) grid (3,2); + + \node[state] (q_0) {$q_0$}; + \node[state] (q_1) [above right of=q_0] {$q_1$}; + \node[state] (q_2) [below right of=q_0] {$q_2$}; + \node[state] (q_3) [below right of=q_1] {$q_3$}; + + \path[->] (q_0) edge node {0} (q_1) + edge node [swap] {1} (q_2) + (q_1) edge node {1} (q_3) + edge [loop above] node {0} () + (q_2) edge node [swap] {0} (q_3) + edge [loop below] node {1} (); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-79} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-80} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-81} +\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}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-82} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-83} +\tikz \draw (0,0) .. controls +(up:2cm) and +(left:3cm) .. (1,5) + node[at end] {\texttt{at end}} + node[very near end] {\texttt{very near end}} + node[near end] {\texttt{near end}} + node[midway] {\texttt{midway}} + node[near start] {\texttt{near start}} + node[very near start] {\texttt{very near start}} + node[at start] {\texttt{at start}}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-84} +\begin{tikzpicture}[near end] + \draw (0cm,4em) -- (3cm,4em) node{A}; + \draw (0cm,3em) -- node{B} (3cm,3em); + \draw (0cm,2em) -- node[midway] {C} (3cm,2em); + \draw (0cm,1em) -- (3cm,1em) node[midway] {D} ; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-85} +\tikz [circle] { + \node [draw] (s) {}; + \node [draw] (a) [right=of s] {} edge (s); + \node [draw] (b) [right=of a] {} edge (a); + \node [draw] (t) [right=of b] {} edge (b); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-86} +\tikz [circle] { + \node [draw] (s) [label=$s$] {}; + \node [draw] (a) [right=of s] {} edge (s); + \node [draw] (b) [right=of a] {} edge (a); + \node [draw] (t) [right=of b, label=$t$] {} edge (b); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-87} +\tikz [rotate=-80,every label/.style={draw,red}] + \node [transform shape,rectangle,draw,label=right:label] {main node}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-88} +\tikz [rotate=-80,every label/.style={draw,red},absolute] + \node [transform shape,rectangle,draw,label=right:label] {main node}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-89} +\tikz + \node [circle, draw, + label=default, + label=60:$60^\circ$, + label=below:$-90^\circ$, + label=3:$3^\circ$, + label=2:$2^\circ$, + label={[below]180:$180^\circ$}, + label={[centered]135:$135^\circ$}] {my circle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-90} +\tikz \node [transform shape,rotate=90, + rectangle,draw,label={[red]center:R}] {main node}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-91} +\tikz \node [circle,draw,label={[red]above:X}] {my circle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-92} +\begin{tikzpicture} + \node [circle,draw,label={[name=label node]above left:$a,b$}] {}; + \draw (label node) -- +(1,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-93} +\tikz[label distance=5mm] + \node [circle,draw,label=right:X, + label=above right:Y, + label=above:Z] {my circle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-94} +\tikz \node [circle,fill=blue!50,minimum size=1cm,pin=60:$q_0$] {}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-95} +\tikz[pin distance=1cm] + \node [circle,draw,pin=right:X, + pin=above right:Y, + pin=above:Z] {my circle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-96} +\tikz [pin distance=15mm, + every pin edge/.style={<-,shorten <=1pt,decorate, + decoration={snake,pre length=4pt}}] + \node [circle,draw,pin=right:X, + pin=above right:Y, + pin=above:Z] {my circle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-97} +\tikz[pin distance=10mm] + \node [circle,draw,pin={[pin edge={blue,thick}]right:X}, + pin=above:Z] {my circle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-98} +\tikz [every pin edge/.style={}, + initial/.style={pin={[pin distance=5mm, + pin edge={<-,shorten <=1pt}]left:start}}] + \node [circle,draw,initial] {my circle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-99} +\tikz \node ["my label" red, draw] {my node}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-100} +\tikz \node [label={[red]my label}, draw] {my node}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-101} +\begin{tikzpicture} + \matrix [row sep=5mm] { + \node [draw, "label"] {A}; \\ + \node [draw, "label" left] {B}; \\ + \node [draw, "label" centered] {C}; \\ + \node [draw, "label" color=red] {D}; \\ + \node [draw, "label" {red,draw,thick}] {E}; \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-102} +\tikz + \node ["$90^\circ$" above, "$180^\circ$" left, circle, draw] {circle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-103} +\tikz + \node ["90:$90^\circ$", "left:$180^\circ$", circle, draw] {circle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-104} +\tikz [every label quotes/.style=red] + \node ["90:$90^\circ$", "left:$180^\circ$", circle, draw] {circle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-105} +\tikz \node ["{yes, we can}", draw] {foo}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-106} +\tikz \node ["yes{:} we can", draw] {foo}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-107} +\tikz [quotes mean pin] + \node ["$90^\circ$" above, "$180^\circ$" left, circle, draw] {circle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-108} +\tikzset{node quotes mean={label={[#2,name={#1}]#1}}} + +\tikz { + \node ["1", "2" label position=left, circle, draw] {circle}; + \draw (1) -- (2); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-109} +\begin{tikzpicture} + \path (0,0) node (x) {Hello World!} + (3,1) node[circle,draw](y) {$\int_1^2 x \mathrm d x$}; + + \draw[->,blue] (x) -- (y); + \draw[->,red] (x) -| node[near start,below] {label} (y); + \draw[->,orange] (x) .. controls +(up:1cm) and +(left:1cm) .. node[above,sloped] {label} (y); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-110} +\begin{tikzpicture} + \node (a) at (0:1) {$a$}; + \node (b) at (90:1) {$b$} edge [->] (a); + \node (c) at (180:1) {$c$} edge [->] (a) + edge [<-] (b); + \node (d) at (270:1) {$d$} edge [->] (a) + edge [dotted] (b) + edge [<-] (c); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-111} +\begin{tikzpicture} + \node foreach \name/\angle in {a/0,b/90,c/180,d/270} + (\name) at (\angle:1) {$\name$}; + + \path[->] (b) edge (a) + edge (c) + edge [-,dotted] (d) + (c) edge (a) + edge (d) + (d) edge (a); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-112} +\begin{tikzpicture} + \node foreach \name/\angle in {a/0,b/90,c/180,d/270} + (\name) at (\angle:1.5) {$\name$}; + + \path[->] (b) edge node[above right] {$5$} (a) + edge (c) + edge [-,dotted] node[below,sloped] {missing} (d) + (c) edge (a) + edge (d) + (d) edge [red] node[above,sloped] {very} + node[below,sloped] {bad} (a); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-113} +\begin{tikzpicture}[every edge/.style={draw,dashed}] + \path (0,0) edge (3,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-114} +\tikz \draw (0,0) edge ["left", ->] (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-115} +\tikz [every edge quotes/.style={auto=right}] + \draw (0,0) edge ["right", ->] (2,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-116} +\tikz [every edge quotes/.style={fill=white,font=\footnotesize}] + \draw (0,0) edge ["mid", ->] (2,1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-117} +\tikz + \draw (0,0) edge ["left", "right"', + "start" near start, + "end"' near end] (4,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-118} +\tikz [tight/.style={inner sep=1pt}, loose/.style={inner sep=.7em}] + \draw (0,0) edge ["left" tight, + "right"' loose, + "start" near start] (4,0); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-127} +\begin{tikzpicture} + \node [draw,circle] (a) {Hello}; + \node also [label=above:world] (a); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-shapes-128} +\begin{tikzpicture} + \node [draw,circle] (a) {Hello}; + \path [late options={name=a, label=above:world}]; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-transformations.lvt b/testfiles/pgfmanual-en-tikz-transformations.lvt new file mode 100644 index 000000000..294ebe2f0 --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-transformations.lvt @@ -0,0 +1,199 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-1} +\begin{tikzpicture} + \draw (0,0) -- +(1,0); + \draw[x=2cm,color=red] (0,0.1) -- +(1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-2} +\tikz \draw[x=1.5cm] (0,0) grid (2,2); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-3} +\begin{tikzpicture} + \draw (0,0) -- (1,0); + \draw[x={(2cm,0.5cm)},color=red] (0,0) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-4} +\begin{tikzpicture}[smooth] + \draw plot coordinates{(1,0) (2,0.5) (3,0) (3,1)}; + \draw[x={(0cm,1cm)},y={(1cm,0cm)},color=red] + plot coordinates{(1,0) (2,0.5) (3,0) (3,1)}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-5} +\begin{tikzpicture}[z=-1cm,->,thick] + \draw[color=red] (0,0,0) -- (1,0,0); + \draw[color=blue] (0,0,0) -- (0,1,0); + \draw[color=orange] (0,0,0) -- (0,0,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-6} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) rectangle (1,0.5); + \begin{scope}[xshift=1cm] + \draw [red] (0,0) rectangle (1,0.5); + \draw[yshift=1cm] [blue] (0,0) rectangle (1,0.5); + \draw[rotate=30] [orange] (0,0) rectangle (1,0.5); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-7} +\tikz \draw (0,0) rectangle (1,0.5) [xshift=2cm] (0,0) rectangle (1,0.5); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-8} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (1,1) -- (1,0); + \draw[shift={(1,1)},blue] (0,0) -- (1,1) -- (1,0); + \draw[shift={(30:1cm)},red] (0,0) -- (1,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-9} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (1,1) -- (1,0); + \draw[rotate=30,xshift=2cm,blue] (0,0) -- (1,1) -- (1,0); + \draw[rotate=30,xshift=2cm,shift only,red] (0,0) -- (1,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-10} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (1,1) -- (1,0); + \draw[xshift=2cm,blue] (0,0) -- (1,1) -- (1,0); + \draw[xshift=-10pt,red] (0,0) -- (1,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-11} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (1,1) -- (1,0); + \draw[scale=2,blue] (0,0) -- (1,1) -- (1,0); + \draw[scale=-1,red] (0,0) -- (1,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-12} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (1,1) -- (1,0); + \draw[scale=2,blue] (0,0) -- (1,1) -- (1,0); + \draw[scale around={2:(1,1)},red] (0,0) -- (1,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-13} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (1,1) -- (1,0); + \draw[xscale=2,blue] (0,0) -- (1,1) -- (1,0); + \draw[xscale=-1,red] (0,0) -- (1,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-14} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (1,1) -- (1,0); + \draw[xslant=2,blue] (0,0) -- (1,1) -- (1,0); + \draw[xslant=-1,red] (0,0) -- (1,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-15} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (1,1) -- (1,0); + \draw[yslant=2,blue] (0,0) -- (1,1) -- (1,0); + \draw[yslant=-1,red] (0,0) -- (1,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-16} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (1,1) -- (1,0); + \draw[rotate=40,blue] (0,0) -- (1,1) -- (1,0); + \draw[rotate=-20,red] (0,0) -- (1,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-17} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (1,1) -- (1,0); + \draw[rotate around={40:(1,1)},blue] (0,0) -- (1,1) -- (1,0); + \draw[rotate around={-20:(1,1)},red] (0,0) -- (1,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-18} +\begin{tikzpicture}[>=stealth] + \draw [->] (0,0,0) -- (2,0,0) node [at end, right] {$x$}; + \draw [->] (0,0,0) -- (0,2,0) node [at end, left] {$y$}; + \draw [->] (0,0,0) -- (0,0,2) node [at end, left] {$z$}; + + \draw [red, rotate around x=0] (0,0,0) -- (1,1,0) -- (1,0,0); + \draw [green, rotate around x=45] (0,0,0) -- (1,1,0) -- (1,0,0); + \draw [blue, rotate around x=90] (0,0,0) -- (1,1,0) -- (1,0,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-19} +\begin{tikzpicture}[>=stealth] + \draw [->] (0,0,0) -- (2,0,0) node [at end, right] {$x$}; + \draw [->] (0,0,0) -- (0,2,0) node [at end, left] {$y$}; + \draw [->] (0,0,0) -- (0,0,2) node [at end, left] {$z$}; + + \draw [red, rotate around y=0] (0,0,0) -- (1,1,0) -- (1,0,0); + \draw [green, rotate around y=-45] (0,0,0) -- (1,1,0) -- (1,0,0); + \draw [blue, rotate around y=-90] (0,0,0) -- (1,1,0) -- (1,0,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-20} +\begin{tikzpicture}[>=stealth] + \draw [->] (0,0,0) -- (2,0,0) node [at end, right] {$x$}; + \draw [->] (0,0,0) -- (0,2,0) node [at end, left] {$y$}; + \draw [->] (0,0,0) -- (0,0,2) node [at end, left] {$z$}; + + \draw [red, rotate around z=0] (0,0) -- (1,1) -- (1,0); + \draw [green, rotate around z=45] (0,0) -- (1,1) -- (1,0); + \draw [blue, rotate around z=90] (0,0) -- (1,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-21} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (1,1) -- (1,0); + \draw[cm={1,1,0,1,(0,0)},blue] (0,0) -- (1,1) -- (1,0); + \draw[cm={0,1,1,0,(1cm,1cm)},red] (0,0) -- (1,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transformations-22} +\begin{tikzpicture} + \draw[help lines] (0,0) grid (3,2); + \draw (0,0) -- (1,1) -- (1,0); + \draw[transform canvas={scale=2},blue] (0,0) -- (1,1) -- (1,0); + \draw[transform canvas={rotate=180},red] (0,0) -- (1,1) -- (1,0); +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-transparency.lvt b/testfiles/pgfmanual-en-tikz-transparency.lvt new file mode 100644 index 000000000..48fa39b97 --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-transparency.lvt @@ -0,0 +1,383 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{fadings,patterns} +\usetikzlibrary{fadings,patterns} +\usetikzlibrary{fadings,patterns} +\usetikzlibrary{fadings,patterns} +\usetikzlibrary{fadings,patterns} +\usetikzlibrary{fadings,patterns} +\usetikzlibrary{fadings,patterns} +\usetikzlibrary{fadings,patterns} +\usetikzlibrary{fadings,patterns,shadows} +\usetikzlibrary{fadings,patterns} +\usetikzlibrary{fadings,patterns} +\usetikzlibrary{fadings} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{shapes.symbols} +\usetikzlibrary{patterns,shapes.symbols} +\usetikzlibrary{patterns,shapes.symbols} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-1} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-2} +\tikz{\fill[red] (0,0) rectangle (1,0.5); + \fill[transparent,red] (0.5,0) rectangle (1.5,0.25); } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-3} +\tikz{\fill[red] (0,0) rectangle (1,0.5); + \fill[ultra nearly transparent] (0.5,0) rectangle (1.5,0.25); } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-4} +\tikz{\fill[red] (0,0) rectangle (1,0.5); + \fill[very nearly transparent] (0.5,0) rectangle (1.5,0.25); } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-5} +\tikz{\fill[red] (0,0) rectangle (1,0.5); + \fill[nearly transparent] (0.5,0) rectangle (1.5,0.25); } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-6} +\tikz{\fill[red] (0,0) rectangle (1,0.5); + \fill[semitransparent] (0.5,0) rectangle (1.5,0.25); } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-7} +\tikz{\fill[red] (0,0) rectangle (1,0.5); + \fill[nearly opaque] (0.5,0) rectangle (1.5,0.25); } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-8} +\tikz{\fill[red] (0,0) rectangle (1,0.5); + \fill[very nearly opaque] (0.5,0) rectangle (1.5,0.25); } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-9} +\tikz{\fill[red] (0,0) rectangle (1,0.5); + \fill[ultra nearly opaque] (0.5,0) rectangle (1.5,0.25); } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-10} +\tikz{\fill[red] (0,0) rectangle (1,0.5); + \fill[opaque] (0.5,0) rectangle (1.5,0.25); } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-11} +\begin{tikzpicture}[thick,fill opacity=0.5] + \filldraw[fill=red] (0:1cm) circle (12mm); + \filldraw[fill=green] (120:1cm) circle (12mm); + \filldraw[fill=blue] (-120:1cm) circle (12mm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-12} +\begin{tikzpicture} + \fill[red] (0,0) rectangle (3,2); + + \node at (0,0) {\huge A}; + \node[fill opacity=0.5] at (3,2) {\huge B}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-13} +\begin{tikzpicture}[every node/.style={fill,draw}] + \draw[line width=2mm,blue!50,line cap=round] (0,0) grid (3,2); + + \node[opacity=0.5] at (1.5,2) {Upper node}; + \node[draw opacity=0.8,fill opacity=0.2,text opacity=1] + at (1.5,0) {Lower node}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-14} +\begin{tikzpicture}[fill opacity=0.5] + \fill[red] (0,0) circle (1); + \fill[red] (1,0) circle (1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-15} +\tikz { + \begin{scope}[transparency group] + \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); + \end{scope} + \end{scope} +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-16} +\tikz [blend group=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); +} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-17} +\begin{tikzfadingfrompicture}[name=fade right with circle] + \shade[left color=transparent!0, + right color=transparent!100] (0,0) rectangle (2,2); + \fill[transparent!50] (1,1) circle (0.7); +\end{tikzfadingfrompicture} + +\begin{tikzpicture} + % Background + \fill [black!20] (-1.2,-1.2) rectangle (1.2,1.2); + \pattern [pattern=checkerboard,pattern color=black!30] + (-1.2,-1.2) rectangle (1.2,1.2); + + \fill [path fading=fade right with circle,red] (-1,-1) rectangle (1,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-18} +\begin{tikzfadingfrompicture}[name=tikz] + \node [text=transparent!20] + {\fontencoding{T1}\fontfamily{ptm}\fontsize{45}{45}\bfseries\selectfont + Ti\emph{k}Z}; +\end{tikzfadingfrompicture} + +\begin{tikzpicture} + \fill [black!20] (-2,-1) rectangle (2,1); + \pattern [pattern=checkerboard,pattern color=black!30] + (-2,-1) rectangle (2,1); + + \shade[path fading=tikz,fit fading=false, + left color=blue,right color=black] + (-2,-1) rectangle (2,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-19} +\tikzfading[name=fade right, + left color=transparent!0, + right color=transparent!100] + +\begin{tikzpicture} + % Background + \fill [black!20] (-1.2,-1.2) rectangle (1.2,1.2); + \path [pattern=checkerboard,pattern color=black!30] + (-1.2,-1.2) rectangle (1.2,1.2); + + \fill [red,path fading=fade right] (-1,-1) rectangle (1,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-20} +\tikzfading[name=fade out, + inner color=transparent!0, + outer color=transparent!100] + +\begin{tikzpicture} + % Background + \fill [black!20] (-1.2,-1.2) rectangle (1.2,1.2); + \path [pattern=checkerboard,pattern color=black!30] + (-1.2,-1.2) rectangle (1.2,1.2); + + \fill [blue,path fading=fade out] (-1,-1) rectangle (1,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-21} +\begin{tikzpicture}[path fading=south] + % Checker board + \fill [black!20] (0,0) rectangle (4,3); + \pattern [pattern=checkerboard,pattern color=black!30] + (0,0) rectangle (4,3); + + \fill [color=blue] (0.5,1.5) rectangle +(1,1); + \fill [color=blue,path fading=north] (2.5,1.5) rectangle +(1,1); + + \fill [color=red,path fading] (1,0.75) ellipse (.75 and .5); + \fill [color=red] (3,0.75) ellipse (.75 and .5); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-22} +\pgfdeclarefading{fade down}{% + \tikzset{top color=pgftransparent!0,bottom color=pgftransparent!100} + \pgfuseshading{axis} +} +\begin{tikzpicture}[path fading=fade down] + % Checker board + \fill [black!20] (0,0) rectangle (4,1.5); + \path [pattern=checkerboard,pattern color=black!30] (0,0) rectangle (4,1.5); + + \fill [red,path fading,fading transform={rotate=90}] + (1,0.75) ellipse (.75 and .5); + \fill [red,path fading,fading transform={rotate=30}] + (3,0.75) ellipse (.75 and .5); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-23} +\begin{tikzpicture} + % Checker board + \fill [black!20] (0,0) rectangle (4,4); + \path [pattern=checkerboard,pattern color=black!30] (0,0) rectangle (4,4); + + \shade [ball color=blue,path fading=south] (2,2) circle (1.8); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-24} +\tikzfading[name=fade inside, + inner color=transparent!80, + outer color=transparent!30] +\begin{tikzpicture} + % Checker board + \fill [black!20] (0,0) rectangle (4,4); + \path [pattern=checkerboard,pattern color=black!30] (0,0) rectangle (4,4); + + \shade [ball color=red] (3,3) circle (0.8); + \shade [ball color=white,path fading=fade inside] (2,2) circle (1.8); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-25} +\tikzfading[name=middle, + top color=transparent!50, + bottom color=transparent!50, + middle color=transparent!20] +\begin{tikzpicture} + \node [circle,circular drop shadow, + pattern=horizontal lines dark blue, + path fading=south, + minimum size=3.6cm] {}; + \pattern [path fading=north, + pattern=horizontal lines dark gray] + (0,0) circle (1.8cm); + \pattern [path fading=middle, + pattern=crosshatch dots light steel blue] + (0,0) circle (1.8cm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-26} +\begin{tikzpicture} + \fill [black!20] (-2,-2) rectangle (2,2); + \pattern [pattern=checkerboard,pattern color=black!30] + (-2,-2) rectangle (2,2); + + % The bounding box of the shading: + \draw [red] (-50bp,-50bp) rectangle (50bp,50bp); + + \path [scope fading=south,fit fading=false] (0,0); + % fading is centered at its natural size + + \fill[red] ( 90:1) circle (1); + \fill[green] (210:1) circle (1); + \fill[blue] (330:1) circle (1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-27} +\begin{tikzpicture} + \fill [black!20] (-2,-2) rectangle (2,2); + \pattern [pattern=checkerboard,pattern color=black!30] + (-2,-2) rectangle (2,2); + + \path [scope fading=south] (-2,-2) rectangle (2,2); + + \fill[red] ( 90:1) circle (1); + \fill[green] (210:1) circle (1); + \fill[blue] (330:1) circle (1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-28} +\tikz \node [scope fading=south,fading angle=45,text width=3.5cm] +{ + This is some text that will fade out as we go right + and down. It is pretty hard to achieve this effect in + other ways. +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-29} +\begin{tikzpicture}[opacity=.5] + \draw [line width=5mm] (0,0) -- (2,2); + \draw [line width=5mm] (2,0) -- (0,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-30} +\begin{tikzpicture} + \node at (0,0) [forbidden sign,line width=2ex,draw=red,fill=white] {Smoking}; + + \node [opacity=.5] + at (2,0) [forbidden sign,line width=2ex,draw=red,fill=white] {Smoking}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-31} +\begin{tikzpicture}[opacity=.5] + \begin{scope}[transparency group] + \draw [line width=5mm] (0,0) -- (2,2); + \draw [line width=5mm] (2,0) -- (0,2); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-32} +\begin{tikzpicture} + \node at (0,0) [forbidden sign,line width=2ex,draw=red,fill=white] {Smoking}; + + \begin{scope}[opacity=.5,transparency group] + \node at (2,0) [forbidden sign,line width=2ex,draw=red,fill=white] + {Smoking}; + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-33} +\begin{tikzpicture} + \pattern[pattern=checkerboard,pattern color=black!15](-1,-1) rectangle (3,1); + \node at (0,0) [forbidden sign,line width=2ex,draw=red,fill=white] {Smoking}; + + \begin{scope}[transparency group,opacity=.5] + \node at (2,0) [forbidden sign,line width=2ex,draw=red,fill=white] + {Smoking}; + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-34} +\begin{tikzpicture} + \pattern[pattern=checkerboard,pattern color=black!15](-1,-1) rectangle (3,1); + \node at (0,0) [forbidden sign,line width=2ex,draw=red,fill=white] {Smoking}; + + \begin{scope}[transparency group,opacity=.5] + \node (s) at (2,0) [forbidden sign,line width=2ex,draw=red,fill=white] + {Smoking}; + + \draw [opacity=.5, line width=2ex, blue] (1.2,0) -- (2.8,0); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-transparency-35} +\begin{tikzpicture} + \shade [left color=red,right color=blue] (-2,-1) rectangle (2,1); + \begin{scope}[transparency group=knockout] + \fill [white] (-1.9,-.9) rectangle (1.9,.9); + \node [opacity=0,font=\fontencoding{T1}\fontfamily{ptm}\fontsize{45}{45}\bfseries] + {Ti\emph{k}Z}; + \end{scope} +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tikz-trees.lvt b/testfiles/pgfmanual-en-tikz-trees.lvt new file mode 100644 index 000000000..695ff4150 --- /dev/null +++ b/testfiles/pgfmanual-en-tikz-trees.lvt @@ -0,0 +1,358 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{shapes.geometric} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-1} +\begin{tikzpicture} + \node {root} + child {node {left}} + child {node {right} + child {node {child}} + child {node {child}} + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-2} +\begin{tikzpicture} + \node {root} [grow'=up] + child {node {left}} + child {node {right} + child {node {child}} + child {node {child}} + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-7} +\begin{tikzpicture} + [level distance=4mm,level/.style={sibling distance=8mm/#1}] + \coordinate + child foreach \x in {0,1} + {child foreach \y in {0,1} + {child foreach \z in {0,1}}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-8} +\begin{tikzpicture}[sibling distance=15mm] + \node[rectangle,draw] {root} + child {node[circle,draw,yshift=-5mm] (left node) {left}} + child {node[ellipse,draw] (right node) {right}}; + \draw[dashed,->] (left node) -- (right node); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-9} +\begin{tikzpicture} + \node {root} + child {[fill] circle (2pt)} + child {[fill] circle (2pt)}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-10} +\begin{tikzpicture}[sibling distance=15mm] + \node (root) {root} + child + child { + child {coordinate (special)} + child + }; + \node at (root-1) {root-1}; + \node at (root-2) {root-2}; + \node at (special) {special}; + \node at (root-2-2) {root-2-2}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-11} +\begin{tikzpicture} + [thick,level 1/.style={sibling distance=15mm}, + level 2/.style={sibling distance=10mm}] + \coordinate + child[red] {child child} + child[green] {child child[blue]}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-12} +\begin{tikzpicture}[thick] + \node [red] {root} + child + child; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-13} +\begin{tikzpicture}[thick] + \node [red] {root} + [green] % option applies to all children + child + child; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-15} +\begin{tikzpicture}[level/.style={sibling distance=20mm/#1}] + \node {root} + child { child child } + child { child child child }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-16} +\begin{tikzpicture} + [level 1/.style={sibling distance=20mm}, + level 2/.style={sibling distance=5mm}] + \node {root} + child { child child } + child { child child child }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-17} +\begin{tikzpicture}[sibling distance=15mm, level distance=15mm] + \path [help lines] + node (root) {root} + [grow=-10] + child {node {1}} + child {node {2}} + child {node {3}} + child {node {4}}; + + \draw[|<->|,thick] (root-1.center) + -- node[above,sloped] {sibling distance} (root-2.center); + + \draw[|<->|,thick] (root.center) + -- node[above,sloped] {level distance} +(-10:\tikzleveldistance); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-18} +\begin{tikzpicture} + \node {root} + [level distance=20mm] + child + child { + [level distance=5mm] + child + child + child + } + child[level distance=10mm]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-19} +\begin{tikzpicture} + [level 1/.style={level distance=10mm}, + level 2/.style={level distance=5mm}] + \node {root} + child + child { + child + child[level distance=10mm] + child + } + child; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-20} +\begin{tikzpicture} + [level distance=4mm, + level 1/.style={sibling distance=8mm}, + level 2/.style={sibling distance=4mm}, + level 3/.style={sibling distance=2mm}] + \coordinate + child { + child {child child} + child {child child} + } + child { + child {child child} + child {child child} + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-21} +\begin{tikzpicture} + [level distance=10mm, + every node/.style={fill=red!60,circle,inner sep=1pt}, + level 1/.style={sibling distance=20mm,nodes={fill=red!45}}, + level 2/.style={sibling distance=10mm,nodes={fill=red!30}}, + level 3/.style={sibling distance=5mm,nodes={fill=red!25}}] + \node {31} + child {node {30} + child {node {20} + child {node {5}} + child {node {4}} + } + child {node {10} + child {node {9}} + child {node {1}} + } + } + child {node {20} + child {node {19} + child {node {1}} + child[missing] + } + child {node {18}} + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-22} +\tikz \node {root} [grow=right] child child; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-23} +\tikz \node {root} [grow=south west] child child; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-24} +\begin{tikzpicture}[level distance=10mm,sibling distance=5mm] + \node {root} + [grow=down] + child + child + child[grow=right] { + child child child + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-25} +\begin{tikzpicture}[level distance=2em] + \node {C} + child[grow=up] {node {H}} + child[grow=left] {node {H}} + child[grow=down] {node {H}} + child[grow=right] {node {C} + child[grow=up] {node {H}} + child[grow=right] {node {H}} + child[grow=down] {node {H}} + edge from parent[double] + coordinate (wrong) + }; + \draw[<-,red] ([yshift=-2mm]wrong) -- +(0,-1) + node[below]{This is wrong!}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-26} +\begin{tikzpicture} + \node[rectangle,draw] (a) at (0,0) {start node}; + \node[rectangle,draw] (b) at (2,1) {end}; + + \draw (a) -- (b) + node[coordinate,midway] {} + child[grow=100,<-] {node[above] {the middle is here}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-27} +\begin{tikzpicture}[level distance=10mm,sibling distance=5mm] + \node {root} [grow=down] + child { node {1} } + child { node {2} } + child { node {3} } + child[missing] { node {4} } + child { node {5} } + child { node {6} }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-28} +\begin{tikzpicture}[level distance=1cm] + \node [rectangle,draw] (a) at (0,0) {root} + [growth parent anchor=south] child; + + \node [rectangle,draw] (b) at (2,0) {root} + [growth parent anchor=north east] child; + + \draw [red,thick,dashed] (a.south) -- (a-1); + \draw [red,thick,dashed] (b.north east) -- (b-1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-29} +\begin{tikzpicture} + [level distance=2cm,growth parent anchor=north, + every node/.style={anchor=north,rectangle,draw} + every child node/.style={anchor=south}] + + \node at (0,0) {root} child {node {small}}; + + \node at (2,0) {big root} child {node {\large big}}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-30} +\begin{tikzpicture} + [edge from parent/.style={draw,red,thick}] + \node {root} + child {node {left} edge from parent[dashed]} + child {node {right} + child {node {child}} + child {node {child} edge from parent[draw=none]} + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-32} +\begin{tikzpicture}[level distance=15mm, sibling distance=15mm, + edge from parent path= + {(\tikzparentnode.south) .. controls +(0,-1) and +(0,1) + .. (\tikzchildnode.north)}] + \node {root} + child {node {left}} + child {node {right} + child {node {child}} + child {node {child}} + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-35} +\begin{tikzpicture} + \node {root} + child { + node {left} + edge from parent + node[left] {a} + node[right] {b} + } + child { + node {right} + child { + node {child} + edge from parent + node[left] {c} + } + child {node {child}} + edge from parent + node[near end] {x} + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tikz-trees-36} +\begin{tikzpicture} + \node {root} + [child anchor=north] + child {node {left} edge from parent[dashed]} + child {node {right} + child {node {child}} + child {node {child} edge from parent[draw=none]} + }; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tutorial-Euclid.lvt b/testfiles/pgfmanual-en-tutorial-Euclid.lvt new file mode 100644 index 000000000..d3cc0aa34 --- /dev/null +++ b/testfiles/pgfmanual-en-tutorial-Euclid.lvt @@ -0,0 +1,286 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{calc} +\usetikzlibrary{calc} +\usetikzlibrary{calc} +\usetikzlibrary{through} +\usetikzlibrary{intersections,through} +\usetikzlibrary{intersections,through} +\usetikzlibrary{backgrounds,calc,intersections,through} +\usetikzlibrary{calc} +\usetikzlibrary{calc} +\usetikzlibrary{calc} +\usetikzlibrary{calc,through} +\usetikzlibrary{calc,through} +\usetikzlibrary{calc,intersections,through} +\usetikzlibrary{calc,intersections,through} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-4} +\begin{tikzpicture} + \coordinate (A) at (0,0); + \coordinate (B) at (1.25,0.25); + + \draw[blue] (A) -- (B); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-5} +\begin{tikzpicture} + \coordinate [label=left:\textcolor{blue}{$A$}] (A) at (0,0); + \coordinate [label=right:\textcolor{blue}{$B$}] (B) at (1.25,0.25); + + \draw[blue] (A) -- (B); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-8} +\begin{tikzpicture} + \coordinate [label=left:$A$] (A) at (0,0); + \coordinate [label=right:$B$] (B) at (1.25,0.25); + \draw (A) -- (B); + + \draw (A) let + \p1 = ($ (B) - (A) $) + in + circle ({veclen(\x1,\y1)}); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-9} +\begin{tikzpicture} + \coordinate [label=left:$A$] (A) at (0,0); + \coordinate [label=right:$B$] (B) at (1.25,0.25); + \draw (A) -- (B); + + \draw let \p1 = ($ (B) - (A) $), + \n2 = {veclen(\x1,\y1)} + in + (A) circle (\n2) + (B) circle (\n2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-10} +\begin{tikzpicture} + \coordinate [label=left:$A$] (A) at (0,0); + \coordinate [label=right:$B$] (B) at (1.25,0.25); + \draw (A) -- (B); + + \draw let \p1 = ($ (B) - (A) $), + \n{radius} = {veclen(\x1,\y1)} + in + (A) circle (\n{radius}) + (B) circle (\n{radius}); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-11} +\begin{tikzpicture} + \coordinate [label=left:$A$] (A) at (0,0); + \coordinate [label=right:$B$] (B) at (1.25,0.25); + \draw (A) -- (B); + + \node [draw,circle through=(B),label=left:$D$] at (A) {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-12} +\begin{tikzpicture} + \coordinate [label=left:$A$] (A) at (0,0); + \coordinate [label=right:$B$] (B) at (1.25,0.25); + \draw (A) -- (B); + + \node (D) [name path=D,draw,circle through=(B),label=left:$D$] at (A) {}; + \node (E) [name path=E,draw,circle through=(A),label=right:$E$] at (B) {}; + + % Name the coordinates, but do not draw anything: + \path [name intersections={of=D and E}]; + + \coordinate [label=above:$C$] (C) at (intersection-1); + + \draw [red] (A) -- (C); + \draw [red] (B) -- (C); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-13} +\begin{tikzpicture} + \coordinate [label=left:$A$] (A) at (0,0); + \coordinate [label=right:$B$] (B) at (1.25,0.25); + \draw [name path=A--B] (A) -- (B); + + \node (D) [name path=D,draw,circle through=(B),label=left:$D$] at (A) {}; + \node (E) [name path=E,draw,circle through=(A),label=right:$E$] at (B) {}; + + \path [name intersections={of=D and E, by={[label=above:$C$]C, [label=below:$C'$]C'}}]; + + \draw [name path=C--C',red] (C) -- (C'); + + \path [name intersections={of=A--B and C--C',by=F}]; + \node [fill=red,inner sep=1pt,label=-45:$F$] at (F) {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-14} +\pgfmathsetseed{1} +\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); + + \foreach \point in {A,B,C} + \fill [black,opacity=.5] (\point) circle (2pt); + + \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} + on a given \textcolor{input}{finite straight line}.} + \par\vskip1em + Let \A\B\ be the given \textcolor{input}{finite straight line}. \dots + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-15} +\begin{tikzpicture} + \coordinate [label=left:$A$] (A) at (0,0); + \coordinate [label=right:$B$] (B) at (1.25,0.25); + \draw (A) -- (B); + \node [fill=red,inner sep=1pt,label=below:$X$] (X) at ($ (A)!.5!(B) $) {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-16} +\begin{tikzpicture} + \coordinate [label=left:$A$] (A) at (0,0); + \coordinate [label=right:$B$] (B) at (1.25,0.25); + \draw (A) -- (B); + \node [fill=red,inner sep=1pt,label=below:$X$] (X) at ($ (A)!.5!(B) $) {}; + \node [fill=red,inner sep=1pt,label=above:$D$] (D) at + ($ (X) ! {sin(60)*2} ! 90:(B) $) {}; + \draw (A) -- (D) -- (B); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-17} +\begin{tikzpicture} + \coordinate [label=left:$A$] (A) at (0,0); + \coordinate [label=right:$B$] (B) at (1.25,0.25); + \draw (A) -- (B); + \node [fill=red,inner sep=1pt,label=above:$D$] (D) at + ($ (A) ! .5 ! (B) ! {sin(60)*2} ! 90:(B) $) {}; + \draw (A) -- (D) -- (B); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-18} +\begin{tikzpicture} + \coordinate [label=left:$A$] (A) at (0,0); + \coordinate [label=right:$B$] (B) at (0.75,0.25); + \coordinate [label=above:$C$] (C) at (1,1.5); + \draw (A) -- (B) -- (C); + \coordinate [label=above:$D$] (D) at + ($ (A) ! .5 ! (B) ! {sin(60)*2} ! 90:(B) $) {}; + \node (H) [label=135:$H$,draw,circle through=(C)] at (B) {}; + \draw (D) -- ($ (D) ! 3.5 ! (B) $) coordinate [label=below:$F$] (F); + \draw (D) -- ($ (D) ! 2.5 ! (A) $) coordinate [label=below:$E$] (E); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-19} +\begin{tikzpicture} + \coordinate [label=left:$A$] (A) at (0,0); + \coordinate [label=right:$B$] (B) at (0.75,0.25); + \coordinate [label=above:$C$] (C) at (1,1.5); + \draw (A) -- (B) -- (C); + \coordinate [label=above:$D$] (D) at + ($ (A) ! .5 ! (B) ! {sin(60)*2} ! 90:(B) $) {}; + \draw (D) -- ($ (D) ! 3.5 ! (B) $) coordinate [label=below:$F$] (F); + \draw (D) -- ($ (D) ! 2.5 ! (A) $) coordinate [label=below:$E$] (E); +\node (H) [label=135:$H$,draw,circle through=(C)] at (B) {}; + \path let \p1 = ($ (B) - (C) $) in + coordinate [label=left:$G$] (G) at ($ (B) ! veclen(\x1,\y1) ! (F) $); + \fill[red,opacity=.5] (G) circle (2pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-20} +\begin{tikzpicture} + \coordinate [label=left:$A$] (A) at (0,0); + \coordinate [label=right:$B$] (B) at (0.75,0.25); + \coordinate [label=above:$C$] (C) at (1,1.5); + \draw (A) -- (B) -- (C); + \coordinate [label=above:$D$] (D) at + ($ (A) ! .5 ! (B) ! {sin(60)*2} ! 90:(B) $) {}; + \draw (D) -- ($ (D) ! 3.5 ! (B) $) coordinate [label=below:$F$] (F); + \draw (D) -- ($ (D) ! 2.5 ! (A) $) coordinate [label=below:$E$] (E); +\node (H) [name path=H,label=135:$H$,draw,circle through=(C)] at (B) {}; + \path [name path=B--F] (B) -- (F); + \path [name intersections={of=H and B--F,by={[label=left:$G$]G}}]; + \fill[red,opacity=.5] (G) circle (2pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-Euclid-21} +\pgfmathsetseed{1} +\begin{tikzpicture}[thick,help lines/.style={thin,draw=black!50}] + \def\A{\textcolor{orange}{$A$}} \def\B{\textcolor{input}{$B$}} + \def\C{\textcolor{input}{$C$}} \def\D{$D$} + \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) $); + + \draw [input] (B) -- (C); + \draw [help lines] (A) -- (B); + + \coordinate [label=above:\D] (D) at ($ (A)!.5!(B) ! {sin(60)*2} ! 90:(B) $); + + \draw [help lines] (D) -- ($ (D)!3.75!(A) $) coordinate [label=-135:\E] (E); + \draw [help lines] (D) -- ($ (D)!3.75!(B) $) coordinate [label=-45:\F] (F); + + \node (H) at (B) [name path=H,help lines,circle through=(C),draw,label=135:\H] {}; + \path [name path=B--F] (B) -- (F); + \path [name intersections={of=H and B--F,by={[label=right:\G]G}}]; + + \node (K) at (D) [name path=K,help lines,circle through=(G),draw,label=135:\K] {}; + \path [name path=A--E] (A) -- (E); + \path [name intersections={of=K and A--E,by={[label=below:\L]L}}]; + + \draw [output] (A) -- (L); + + \foreach \point in {A,B,C,D,G,L} + \fill [black,opacity=.5] (\point) circle (2pt); + + % \node ... +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tutorial-chains.lvt b/testfiles/pgfmanual-en-tutorial-chains.lvt new file mode 100644 index 000000000..fc24d2259 --- /dev/null +++ b/testfiles/pgfmanual-en-tutorial-chains.lvt @@ -0,0 +1,416 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning,shapes.misc} +\usetikzlibrary{calc,positioning,shapes.misc} +\usetikzlibrary{positioning,shapes.misc} +\usetikzlibrary{positioning,shapes.misc} +\usetikzlibrary{positioning,shapes.misc} +\usetikzlibrary{positioning,shapes.misc} +\usetikzlibrary{positioning,shapes.misc} +\usetikzlibrary{calc,positioning,shapes.misc} +\usetikzlibrary{calc,positioning,shapes.misc} +\usetikzlibrary{calc,positioning,shapes.misc} +\usetikzlibrary{shapes.misc} +\usetikzlibrary{shapes.misc} +\usetikzlibrary{graphs,shapes.misc} +\usetikzlibrary{arrows.meta,graphs,shapes.misc} +\usetikzlibrary{graphs} +\usetikzlibrary{graphs,shapes.misc} +\usetikzlibrary{graphs,shapes.misc} +\usetikzlibrary{arrows.meta,graphs,shapes.misc} +\usetikzlibrary{arrows.meta,graphs,shapes.misc} + +\begin{document} + +\tikzset{ + terminal/.style={ + % The shape: + rounded rectangle, + minimum size=6mm, + % The rest + very thick,draw=black!50, + top color=white,bottom color=black!20, + font=\ttfamily}, +} +\tikzset{ + nonterminal/.style={ + % The shape: + rectangle, + % The size: + minimum size=6mm, + % The border: + very thick, + draw=red!50!black!50, % 50% red and 50% black, + % and that mixed with 50% white + % The filling: + top color=white, % a shading that is white at the top... + bottom color=red!50!black!20, % and something else at the bottom + % Font + font=\itshape, + }, +} +\tikzset{ + terminal/.append style={text height=1.5ex,text depth=.25ex}, + nonterminal/.append style={text height=1.5ex,text depth=.25ex}, +} +\def\matrixcontent{ + % First row: + \& \& \& \& \& \& \& \& \& \& \& \node (plus) [terminal] {+};\\ + % Second row: + \node (p1) [point] {}; \& \node (ui1) [nonterminal] {unsigned integer}; \& + \node (p2) [point] {}; \& \node (dot) [terminal] {.}; \& + \node (p3) [point] {}; \& \node (digit) [terminal] {digit}; \& + \node (p4) [point] {}; \& \node (p5) [point] {}; \& + \node (p6) [point] {}; \& \node (e) [terminal] {E}; \& + \node (p7) [point] {}; \& \& + \node (p8) [point] {}; \& \node (ui2) [nonterminal] {unsigned integer}; \& + \node (p9) [point] {}; \& \node (p10) [point] {};\\ + % Third row: + \& \& \& \& \& \& \& \& \& \& \& \node (minus)[terminal] {-};\\ +} + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-1} +\begin{tikzpicture}[ + nonterminal/.style={ + % The shape: + rectangle, + % The size: + minimum size=6mm, + % The border: + very thick, + draw=red!50!black!50, % 50% red and 50% black, + % and that mixed with 50% white + % The filling: + top color=white, % a shading that is white at the top... + bottom color=red!50!black!20, % and something else at the bottom + % Font + font=\itshape + }] + \node [nonterminal] {unsigned integer}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-2} +\begin{tikzpicture}[node distance=5mm, + terminal/.style={ + % The shape: + rectangle,minimum size=6mm,rounded corners=3mm, + % The rest + very thick,draw=black!50, + top color=white,bottom color=black!20, + font=\ttfamily}] + \node (dot) [terminal] {.}; + \node (digit) [terminal,right=of dot] {digit}; + \node (E) [terminal,right=of digit] {E}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-3} +\begin{tikzpicture}[node distance=5mm, + terminal/.style={ + % The shape: + rounded rectangle, + minimum size=6mm, + % The rest + very thick,draw=black!50, + top color=white,bottom color=black!20, + font=\ttfamily}] + \node (dot) [terminal] {.}; + \node (digit) [terminal,right=of dot] {digit}; + \node (E) [terminal,right=of digit] {E}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-5} +\begin{tikzpicture}[node distance=5mm] + \node (dot) [terminal] {.}; + \node (digit) [terminal,right=of dot] {digit}; + \node (E) [terminal,right=of digit] {E}; + + \draw [help lines] let \p1 = (dot.base), + \p2 = (digit.base), + \p3 = (E.base) + in (-.5,\y1) -- (3.5,\y1) + (-.5,\y2) -- (3.5,\y2) + (-.5,\y3) -- (3.5,\y3); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-6} +\begin{tikzpicture}[node distance=5mm] + \node (dot) [terminal] {.}; + \node (digit) [terminal,base right=of dot] {digit}; + \node (E) [terminal,base right=of digit] {E}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-7} +\begin{tikzpicture}[node distance=5mm, + text height=1.5ex,text depth=.25ex] + \node (dot) [terminal] {.}; + \node (digit) [terminal,right=of dot] {digit}; + \node (E) [terminal,right=of digit] {E}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-9} +\begin{tikzpicture}[node distance=5mm and 5mm] + \node (ui1) [nonterminal] {unsigned integer}; + \node (dot) [terminal,right=of ui1] {.}; + \node (digit) [terminal,right=of dot] {digit}; + \node (E) [terminal,right=of digit] {E}; + \node (plus) [terminal,above right=of E] {+}; + \node (minus) [terminal,below right=of E] {-}; + \node (ui2) [nonterminal,below right=of plus] {unsigned integer}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-10} +\begin{tikzpicture}[node distance=5mm and 5mm] + \node (E) [terminal] {E}; + \node (plus) [terminal,above right=of E,xshift=5mm] {+}; + \node (minus) [terminal,below right=of E,xshift=5mm] {-}; + \node (ui2) [nonterminal,below right=of plus,xshift=5mm] {unsigned integer}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-11} +\begin{tikzpicture}[node distance=5mm and 5mm,terminal/.append style={rectangle,rounded corners=3mm}] + \node (E) [terminal] {E}; + \node (plus) [terminal,above right=of E] {+}; + \node (minus) [terminal,below right=of E] {-}; + \node (ui2) [nonterminal,below right=of plus] {unsigned integer}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-12} +\begin{tikzpicture}[node distance=5mm and 5mm] + \node (dot) [terminal] {.}; + \node (digit) [terminal,right=of dot] {digit}; + \node (E) [terminal,right=of digit] {E}; + + \path (dot) edge[->] (digit) % simple edges + (digit) edge[->] (E); + + \draw [->] + % start right of digit.east, that is, at the point that is the + % linear combination of digit.east and the vector (2mm,0pt). We + % use the ($ ... $) notation for computing linear combinations + ($ (digit.east) + (2mm,0) $) + % Now go down + -- ++(0,-.5) + % And back to the left of digit.west + -| ($ (digit.west) - (2mm,0) $); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-13} +\begin{tikzpicture}[node distance=5mm and 5mm, + skip loop/.style={to path={-- ++(0,-.5) -| (\tikztotarget)}}] + \node (dot) [terminal] {.}; + \node (digit) [terminal,right=of dot] {digit}; + \node (E) [terminal,right=of digit] {E}; + + \path (dot) edge[->] (digit) % simple edges + (digit) edge[->] (E) + ($ (digit.east) + (2mm,0) $) + edge[->,skip loop] ($ (digit.west) - (2mm,0) $); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-14} +\begin{tikzpicture}[node distance=5mm and 5mm, + skip loop/.style={to path={-- ++(0,#1) -| (\tikztotarget)}}] + \node (dot) [terminal] {.}; + \node (digit) [terminal,right=of dot] {digit}; + \node (E) [terminal,right=of digit] {E}; + + \path (dot) edge[->] (digit) % simple edges + (digit) edge[->] (E) + ($ (digit.east)!.5!(E.west) $) + edge[->,skip loop=-5mm] ($ (digit.west)!.5!(dot.east) $); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-15} +\begin{tikzpicture} + \matrix[row sep=1mm,column sep=5mm] { + % First row: + & & & & \node [terminal] {+}; & \\ + % Second row: + \node [nonterminal] {unsigned integer}; & + \node [terminal] {.}; & + \node [terminal] {digit}; & + \node [terminal] {E}; & + & + \node [nonterminal] {unsigned integer}; \\ + % Third row: + & & & & \node [terminal] {-}; & \\ + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-16} +\begin{tikzpicture}[point/.style={circle,inner sep=0pt,minimum size=2pt,fill=red}, + skip loop/.style={to path={-- ++(0,#1) -| (\tikztotarget)}}] + \matrix[row sep=1mm,column sep=2mm] { + % First row: + & & & & & & & & & & & \node (plus) [terminal] {+};\\ + % Second row: + \node (p1) [point] {}; & \node (ui1) [nonterminal] {unsigned integer}; & + \node (p2) [point] {}; & \node (dot) [terminal] {.}; & + \node (p3) [point] {}; & \node (digit) [terminal] {digit}; & + \node (p4) [point] {}; & \node (p5) [point] {}; & + \node (p6) [point] {}; & \node (e) [terminal] {E}; & + \node (p7) [point] {}; & & + \node (p8) [point] {}; & \node (ui2) [nonterminal] {unsigned integer}; & + \node (p9) [point] {}; & \node (p10) [point] {};\\ + % Third row: + & & & & & & & & & & & \node (minus)[terminal] {-};\\ + }; + + \path (p4) edge [->,skip loop=-5mm] (p3) + (p2) edge [->,skip loop=5mm] (p6); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-18} +\tikzset{ampersand replacement=\&,point/.style={coordinate}} +\begin{tikzpicture}[skip loop/.style={to path={-- ++(0,#1) -| (\tikztotarget)}}, + 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); + (p4) ->[skip loop=-5mm] (p3); + (p2) ->[skip loop=5mm] (p5); + (p6) ->[skip loop=-11mm] (p9); + (p7) ->[vh path] (plus) -> [hv path] (p8); + (p7) ->[vh path] (minus) -> [hv path] (p8); + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-19} +\tikzset{ + ampersand replacement=\&, + point/.style={coordinate}, + skip loop/.style={to path={-- ++(0,#1) -| (\tikztotarget)}}, + hv path/.style={to path={-| (\tikztotarget)}}, + vh path/.style={to path={|- (\tikztotarget)}}, +} +\begin{tikzpicture}[>={Stealth[round]},thick,black!50,text=black, + 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; + p2 ->[skip loop=5mm] p5; + p6 ->[skip loop=-11mm] p9; + p7 ->[vh path] { plus, minus } -> [hv path] p8; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-20} +\tikz \graph [grow right=2cm] { unsigned integer -> d -> digit -> E }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-21} +\tikz \graph [grow right sep] { + unsigned integer[nonterminal] -> "."[terminal] -> digit[terminal] -> E[terminal] +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-22} +\tikz \graph [grow right sep] { + unsigned integer [nonterminal] -> + "." [terminal] -> + digit [terminal] -> + E [terminal] -> + { + "+" [terminal], + "" [coordinate], + "-" [terminal] + } -> + ui2/unsigned integer [nonterminal] +}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-23} +\tikzset{ + skip loop/.style={to path={-- ++(0,#1) -| (\tikztotarget)}}, + hv path/.style={to path={-| (\tikztotarget)}}, + vh path/.style={to path={|- (\tikztotarget)}}, +} +\begin{tikzpicture}[>={Stealth[round]}, thick, black!50, text=black, + every new ->/.style={shorten >=1pt}, + graphs/every graph/.style={edges=rounded corners}] + \graph [grow right sep, branch down=7mm] { + / [coordinate] -> + unsigned integer [nonterminal] -- + p1 [coordinate] -> + "." [terminal] -- + p2 [coordinate] -> + digit [terminal] -- + p3 [coordinate] -- + p4 [coordinate] -- + p5 [coordinate] -> + E [terminal] -- + q1 [coordinate] ->[vh path] + { [nodes={yshift=7mm}] + "+" [terminal], + q2/ [coordinate], + "-" [terminal] + } -> [hv path] + q3 [coordinate] -- + /unsigned integer [nonterminal] -- + p6 [coordinate] -> + / [coordinate]; + + p1 ->[skip loop=5mm] p4; + p3 ->[skip loop=-5mm] p2; + p5 ->[skip loop=-11mm] p6; + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-chains-24} +\tikz [>={Stealth[round]}, black!50, text=black, thick, + every new ->/.style = {shorten >=1pt}, + graphs/every graph/.style = {edges=rounded corners}, + skip loop/.style = {to path={-- ++(0,#1) -| (\tikztotarget)}}, + hv path/.style = {to path={-| (\tikztotarget)}}, + vh path/.style = {to path={|- (\tikztotarget)}}, + nonterminal/.style = { + rectangle, minimum size=6mm, very thick, draw=red!50!black!50, top color=white, + 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}, + shape = coordinate + ] + \graph [grow right sep, branch down=7mm, simple] { + / -> unsigned integer[nonterminal] -- p1 -> "." [terminal] -- p2 -> digit[terminal] -- + p3 -- p4 -- p5 -> E[terminal] -- q1 ->[vh path] + {[nodes={yshift=7mm}] + "+"[terminal], q2, "-"[terminal] + } -> [hv path] + q3 -- /unsigned integer [nonterminal] -- p6 -> /; + + p1 ->[skip loop=5mm] p4; + p3 ->[skip loop=-5mm] p2; + p5 ->[skip loop=-11mm] p6; + + q1 -- q2 -- q3; % make these edges plain + }; +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tutorial-map.lvt b/testfiles/pgfmanual-en-tutorial-map.lvt new file mode 100644 index 000000000..4609816b3 --- /dev/null +++ b/testfiles/pgfmanual-en-tutorial-map.lvt @@ -0,0 +1,526 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{trees} +\usetikzlibrary{trees} +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap} +\usetikzlibrary{mindmap,shadows} +\usetikzlibrary{mindmap,shadows} +\usetikzlibrary{mindmap,shadows} +\usetikzlibrary{backgrounds,mindmap,shadows} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} +\usetikzlibrary{calendar} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tutorial-map-1} +\tikz + \node {Computational Complexity} % root + child { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + child { node {Problem Domains} } + child { node {Key Problems} } + } + child { node {Computational Models} + child { node {Turing Machines} } + child { node {Random-Access Machines} } + child { node {Circuits} } + child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } + child { node {Programming in Logic} } + } + child { node {Measuring Complexity} + child { node {Complexity Measures} } + child { node {Classifying Complexity} } + child { node {Comparing Complexity} } + child { node {Describing Complexity} } + } + child { node {Solving Problems} + child { node {Exact Algorithms} } + child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } + child { node {Parallel Computation} } + child { node {Partial Solutions} } + child { node {Approximation} } + }; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-map-2} + + \tikz [font=\footnotesize, + grow=right, level 1/.style={sibling distance=6em}, + level 2/.style={sibling distance=1em}, level distance=5cm] + \node {Computational Complexity} % root + child { node {Computational Problems} + child { node {Problem Measures} } child { node {Problem Aspects} } + child { node {Problem Domains} } child { node {Key Problems} } + } + child { node {Computational Models} + child { node {Turing Machines} } child { node {Random-Access Machines} } + child { node {Circuits} } child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } child { node {Programming in Logic} } + } + child { node {Measuring Complexity} + child { node {Complexity Measures} } child { node {Classifying Complexity} } + child { node {Comparing Complexity} } child { node {Describing Complexity} } + } + child { node {Solving Problems} + child { node {Exact Algorithms} } child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } child { node {Parallel Computation} } + child { node {Partial Solutions} } child { node {Approximation} } + }; + +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-map-3} + + \tikz [text width=2.7cm, align=flush center, + grow cyclic, + level 1/.style={level distance=2.5cm,sibling angle=90}, + level 2/.style={text width=2cm, font=\footnotesize, level distance=3cm,sibling angle=30}] + \node[font=\bfseries] {Computational Complexity} % root + child { node {Computational Problems} + child { node {Problem Measures} } child { node {Problem Aspects} } + child { node {Problem Domains} } child { node {Key Problems} } + } + child { node {Computational Models} + child { node {Turing Machines} } child { node {Random-Access Machines} } + child { node {Circuits} } child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } child { node {Programming in Logic} } + } + child { node {Measuring Complexity} + child { node {Complexity Measures} } child { node {Classifying Complexity} } + child { node {Comparing Complexity} } child { node {Describing Complexity} } + } + child { node {Solving Problems} + child { node {Exact Algorithms} } child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } child { node {Parallel Computation} } + child { node {Partial Solutions} } child { node {Approximation} } + }; + +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-map-4} + + \tikz [mindmap, every node/.style=concept, concept color=black!20, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90}, + level 2/.append style={level distance=3cm,sibling angle=45}] + \node [root concept] {Computational Complexity} % root + child { node {\hbox to 2cm{Computational\hss} Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + child { node {Problem Domains} } + child { node {Key Problems} } + } + child { node {\hbox to 2cm{Computational\hss} Models} + child { node {Turing Machines} } + child { node {Random-Access Machines} } + child { node {Circuits} } + child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } + child { node {\hbox to1.5cm{Programming\hss} in Logic} } + } + child { node {Measuring Complexity} + child { node {Complexity Measures} } + child { node {Classifying Complexity} } + child { node {Comparing Complexity} } + child { node {Describing Complexity} } + } + child { node {Solving Problems} + child { node {Exact Algorithms} } + child { node {\hbox to 1.5cm{Randomization\hss}} } + child { node {Fixed-Parameter Algorithms} } + child { node {Parallel Computation} } + child { node {Partial Solutions} } + child { node {\hbox to1.5cm{Approximation\hss}} } + }; + +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-map-5} + + \begin{tikzpicture} + [mindmap, + every node/.style={concept, execute at begin node=\hskip0pt}, + concept color=black!20, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90}, + level 2/.append style={level distance=3cm,sibling angle=45}] + \clip (-1,2) rectangle ++ (-4,5); + \node [root concept] {Computational Complexity} % root + child { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + child { node {Problem Domains} } + child { node {Key Problems} } + } + child { node {Computational Models} + child { node {Turing Machines} } + child { node {Random-Access Machines} } + child { node {Circuits} } + child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } + child { node {Programming in Logic} } + } + child { node {Measuring Complexity} + child { node {Complexity Measures} } + child { node {Classifying Complexity} } + child { node {Comparing Complexity} } + child { node {Describing Complexity} } + } + child { node {Solving Problems} + child { node {Exact Algorithms} } + child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } + child { node {Parallel Computation} } + child { node {Partial Solutions} } + child { node {Approximation} } + }; + \end{tikzpicture} + +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-map-6} + + \begin{tikzpicture} + [mindmap, + every node/.style={concept, execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, + fill=white, line width=1ex, + text=black}, + text=white, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90}, + level 2/.append style={level distance=3cm,sibling angle=45}] + \clip (0,-1) rectangle ++(4,5); + \node [root concept] {Computational Complexity} % root + child [concept color=red] { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + child { node {Problem Domains} } + child { node {Key Problems} } + } + child [concept color=blue] { node {Computational Models} + child { node {Turing Machines} } + child { node {Random-Access Machines} } + child { node {Circuits} } + child { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } + child { node {Programming in Logic} } + } + child [concept color=orange] { node {Measuring Complexity} + child { node {Complexity Measures} } + child { node {Classifying Complexity} } + child { node {Comparing Complexity} } + child { node {Describing Complexity} } + } + child [concept color=green!50!black] { node {Solving Problems} + child { node {Exact Algorithms} } + child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } + child { node {Parallel Computation} } + child { node {Partial Solutions} } + child { node {Approximation} } + }; + \end{tikzpicture} + +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-map-7} + + \begin{tikzpicture}[mindmap] + \begin{scope}[ + every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, + fill=white, line width=1ex, + text=black, font=\large\scshape}, + text=white, + computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, + computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, + measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, + solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, + level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] + \node [root concept] {Computational Complexity} % root + child [computational problems] { node {Computational Problems} + child { node {Problem Measures} } + child { node {Problem Aspects} } + child [faded] { node {Problem Domains} } + child { node {Key Problems} } + } + child [computational models] { node {Computational Models} + child { node {Turing Machines} } + child [faded] { node {Random-Access Machines} } + child { node {Circuits} } + child [faded] { node {Binary Decision Diagrams} } + child { node {Oracle Machines} } + child { node {Programming in Logic} } + } + child [measuring complexity] { node {Measuring Complexity} + child { node {Complexity Measures} } + child { node {Classifying Complexity} } + child { node {Comparing Complexity} } + child [faded] { node {Describing Complexity} } + } + child [solving problems] { node {Solving Problems} + child { node {Exact Algorithms} } + child { node {Randomization} } + child { node {Fixed-Parameter Algorithms} } + child { node {Parallel Computation} } + child { node {Partial Solutions} } + child { node {Approximation} } + }; + \end{scope} + \end{tikzpicture} + +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-map-9} + + \begin{tikzpicture}[mindmap] + \clip (-5.25,-3) rectangle ++ (4,5); + \begin{scope}[ + every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, + fill=white, line width=1ex, + text=black, font=\large\scshape}, + text=white, + computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, + computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, + measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, + solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, + level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] + \node [root concept] (Computational Complexity) {Computational Complexity} % root + child [computational problems] { node (Computational Problems) {Computational Problems} + child { node (Problem Measures) {Problem Measures} } + child { node (Problem Aspects) {Problem Aspects} } + child [faded] { node (Problem Domains) {Problem Domains} } + child { node (Key Problems) {Key Problems} } + } + child [computational models] { node (Computational Models) {Computational Models} + child { node (Turing Machines) {Turing Machines} } + child [faded] { node (Random-Access Machines) {Random-Access Machines} } + child { node (Circuits) {Circuits} } + child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} } + child { node (Oracle Machines) {Oracle Machines} } + child { node (Programming in Logic) {Programming in Logic} } + } + child [measuring complexity] { node (Measuring Complexity) {Measuring Complexity} + child { node (Complexity Measures) {Complexity Measures} } + child { node (Classifying Complexity) {Classifying Complexity} } + child { node (Comparing Complexity) {Comparing Complexity} } + child [faded] { node (Describing Complexity) {Describing Complexity} } + } + child [solving problems] { node (Solving Problems) {Solving Problems} + child { node (Exact Algorithms) {Exact Algorithms} } + child { node (Randomization) {Randomization} } + child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} } + child { node (Parallel Computation) {Parallel Computation} } + child { node (Partial Solutions) {Partial Solutions} } + child { node (Approximation) {Approximation} } + }; + \end{scope} + \begin{scope}[every annotation/.style={fill=black!40}] + \node [annotation, above] at (Computational Problems.north) { + Lecture 1: Computational Problems + \begin{itemize} + \item Knowledge of several key problems + \item Knowledge of problem encodings + \item Being able to formalize problems + \end{itemize} + }; + \end{scope} + \end{tikzpicture} + +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-map-11} + % !!! replace all `#x` with `#x` +\def\lecture#1#2#3#4#5#6{ + \node [annotation, #3, scale=0.65, text width=4cm, inner sep=2mm] at (#4) { + Lecture #1: \textcolor{orange}{\textbf{#2}} + \list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt + \parskip=0pt\labelwidth=8pt\leftmargin=8pt + \itemindent=0pt\labelsep=2pt} + #5 + \endlist + }; +} + + \begin{tikzpicture}[mindmap,every annotation/.style={fill=white}] + \clip (-5.25,-3) rectangle ++ (4,5); + \begin{scope}[ + every node/.style={concept, circular drop shadow,execute at begin node=\hskip0pt}, + root concept/.append style={ + concept color=black, + fill=white, line width=1ex, + text=black, font=\large\scshape}, + text=white, + computational problems/.style={concept color=red,faded/.style={concept color=red!50}}, + computational models/.style={concept color=blue,faded/.style={concept color=blue!50}}, + measuring complexity/.style={concept color=orange,faded/.style={concept color=orange!50}}, + solving problems/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}}, + grow cyclic, + level 1/.append style={level distance=4.5cm,sibling angle=90,font=\scshape}, + level 2/.append style={level distance=3cm,sibling angle=45,font=\scriptsize}] + \node [root concept] (Computational Complexity) {Computational Complexity} % root + child [computational problems] { node (Computational Problems) {Computational Problems} + child { node (Problem Measures) {Problem Measures} } + child { node (Problem Aspects) {Problem Aspects} } + child [faded] { node (problem Domains) {Problem Domains} } + child { node (Key Problems) {Key Problems} } + } + child [computational models] { node (Computational Models) {Computational Models} + child { node (Turing Machines) {Turing Machines} } + child [faded] { node (Random-Access Machines) {Random-Access Machines} } + child { node (Circuits) {Circuits} } + child [faded] { node (Binary Decision Diagrams) {Binary Decision Diagrams} } + child { node (Oracle Machines) {Oracle Machines} } + child { node (Programming in Logic) {Programming in Logic} } + } + child [measuring complexity] { node (Measuring Complexity) {Measuring Complexity} + child { node (Complexity Measures) {Complexity Measures} } + child { node (Classifying Complexity) {Classifying Complexity} } + child { node (Comparing Complexity) {Comparing Complexity} } + child [faded] { node (Describing Complexity) {Describing Complexity} } + } + child [solving problems] { node (Solving Problems) {Solving Problems} + child { node (Exact Algorithms) {Exact Algorithms} } + child { node (Randomization) {Randomization} } + child { node (Fixed-Parameter Algorithms) {Fixed-Parameter Algorithms} } + child { node (Parallel Computation) {Parallel Computation} } + child { node (Partial Solutions) {Partial Solutions} } + child { node (Approximation) {Approximation} } + }; + \end{scope} + \lecture{1}{Computational Problems}{above,xshift=-3mm}{Computational Problems.north}{ + \item Knowledge of several key problems + \item Knowledge of problem encodings + \item Being able to formalize problems + }{2009-04-08} + \end{tikzpicture} + +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-map-12} +\begin{tikzpicture}[ + mindmap, + concept color=black, + root concept/.append style={ + concept, + circular drop shadow, + fill=white, line width=1ex, + text=black, font=\large\scshape} + ] + + \clip (-1.5,-5) rectangle ++(4,10); + + \node [root concept] (Computational Complexity) {Computational Complexity}; + + \begin{pgfonlayer}{background} + \clip (-1.5,-5) rectangle ++(4,10); + + \colorlet{upperleft}{green!50!black!25} + \colorlet{upperright}{orange!25} + \colorlet{lowerleft}{red!25} + \colorlet{lowerright}{blue!25} + + % The large rectangles: + \fill [upperleft] (Computational Complexity) rectangle ++(-20,20); + \fill [upperright] (Computational Complexity) rectangle ++(20,20); + \fill [lowerleft] (Computational Complexity) rectangle ++(-20,-20); + \fill [lowerright] (Computational Complexity) rectangle ++(20,-20); + + % The shadings: + \shade [left color=upperleft,right color=upperright] + ([xshift=-1cm]Computational Complexity) rectangle ++(2,20); + \shade [left color=lowerleft,right color=lowerright] + ([xshift=-1cm]Computational Complexity) rectangle ++(2,-20); + \shade [top color=upperleft,bottom color=lowerleft] + ([yshift=-1cm]Computational Complexity) rectangle ++(-20,2); + \shade [top color=upperright,bottom color=lowerright] + ([yshift=-1cm]Computational Complexity) rectangle ++(20,2); + \end{pgfonlayer} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-map-13} +\tiny +\begin{tikzpicture} + \calendar [day list downward, + name=cal, + dates=2009-04-01 to 2009-04-14] + if (weekend) + [black!25]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-map-15} + % !!! replace all `#x` with `#x` +\def\lecture#1#2#3#4#5#6{ + \node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}}; +} +\tiny +\begin{tikzpicture} + \calendar [day list downward, + name=cal, + dates=2009-04-01 to 2009-04-14] + if (weekend) + [black!25]; + + % As before: + \lecture{1}{Computational Problems}{above,xshift=-3mm} + {Computational Problems.north}{ + \item Knowledge of several key problems + \item Knowledge of problem encodings + \item Being able to formalize problems + }{2009-04-08} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-map-16} + % !!! replace all `#x` with `#x` +\def\lecture#1#2#3#4#5#6{ + \node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}}; +} +\tiny +\begin{tikzpicture} + \calendar [day list downward, + month text=\%mt\ \%y0, + month yshift=3.5em, + name=cal, + dates=2009-04-01 to 2009-05-01] + if (weekend) + [black!25] + if (day of month=1) { + \node at (0pt,1.5em) [anchor=base west] {\small\tikzmonthtext}; + }; + + \lecture{1}{Computational Problems}{above,xshift=-3mm} + {Computational Problems.north}{ + \item Knowledge of several key problems + \item Knowledge of problem encodings + \item Being able to formalize problems + }{2009-04-08} + + \lecture{2}{Computational Models}{above,xshift=-3mm} + {Computational Models.north}{ + \item Knowledge of Turing machines + \item Being able to compare the computational power of different + models + }{2009-04-15} +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tutorial-nodes.lvt b/testfiles/pgfmanual-en-tutorial-nodes.lvt new file mode 100644 index 000000000..0d18bf310 --- /dev/null +++ b/testfiles/pgfmanual-en-tutorial-nodes.lvt @@ -0,0 +1,457 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{positioning} +\usetikzlibrary{arrows.meta,positioning} +\usetikzlibrary{arrows.meta,positioning} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{arrows.meta,backgrounds,fit,positioning} +\usetikzlibrary{arrows.meta,petri,positioning} +\usetikzlibrary{arrows.meta,petri,positioning} + +\begin{document} + +\tikzset{ + place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, + transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm} +} +\tikzset{ + place/.style={circle,draw,inner sep=0pt,minimum size=5ex,every place}, + transition/.style={rectangle,draw,inner sep=0pt,minimum size=4mm,every transition}, +} + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-4} +\begin{tikzpicture} + \path ( 0,2) node [shape=circle,draw] {} + ( 0,1) node [shape=circle,draw] {} + ( 0,0) node [shape=circle,draw] {} + ( 1,1) node [shape=rectangle,draw] {} + (-1,1) node [shape=rectangle,draw] {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-5} +\begin{tikzpicture} + \path node at ( 0,2) [shape=circle,draw] {} + node at ( 0,1) [shape=circle,draw] {} + node at ( 0,0) [shape=circle,draw] {} + node at ( 1,1) [shape=rectangle,draw] {} + node at (-1,1) [shape=rectangle,draw] {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-6} +\begin{tikzpicture} + \node at ( 0,2) [circle,draw] {}; + \node at ( 0,1) [circle,draw] {}; + \node at ( 0,0) [circle,draw] {}; + \node at ( 1,1) [rectangle,draw] {}; + \node at (-1,1) [rectangle,draw] {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-7} +\begin{tikzpicture}[thick] + \node at ( 0,2) [circle,draw=blue!50,fill=blue!20] {}; + \node at ( 0,1) [circle,draw=blue!50,fill=blue!20] {}; + \node at ( 0,0) [circle,draw=blue!50,fill=blue!20] {}; + \node at ( 1,1) [rectangle,draw=black!50,fill=black!20] {}; + \node at (-1,1) [rectangle,draw=black!50,fill=black!20] {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-8} +\begin{tikzpicture} + [place/.style={circle,draw=blue!50,fill=blue!20,thick}, + transition/.style={rectangle,draw=black!50,fill=black!20,thick}] + \node at ( 0,2) [place] {}; + \node at ( 0,1) [place] {}; + \node at ( 0,0) [place] {}; + \node at ( 1,1) [transition] {}; + \node at (-1,1) [transition] {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-9} +\begin{tikzpicture} + [inner sep=2mm, + place/.style={circle,draw=blue!50,fill=blue!20,thick}, + transition/.style={rectangle,draw=black!50,fill=black!20,thick}] + \node at ( 0,2) [place] {}; + \node at ( 0,1) [place] {}; + \node at ( 0,0) [place] {}; + \node at ( 1,1) [transition] {}; + \node at (-1,1) [transition] {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-10} +\begin{tikzpicture} + [place/.style={circle,draw=blue!50,fill=blue!20,thick, + inner sep=0pt,minimum size=6mm}, + transition/.style={rectangle,draw=black!50,fill=black!20,thick, + inner sep=0pt,minimum size=4mm}] + \node at ( 0,2) [place] {}; + \node at ( 0,1) [place] {}; + \node at ( 0,0) [place] {}; + \node at ( 1,1) [transition] {}; + \node at (-1,1) [transition] {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-12} +\begin{tikzpicture} + \node (waiting 1) at ( 0,2) [place] {}; + \node (critical 1) at ( 0,1) [place] {}; + \node (semaphore) at ( 0,0) [place] {}; + \node (leave critical) at ( 1,1) [transition] {}; + \node (enter critical) at (-1,1) [transition] {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-13} +\begin{tikzpicture} + \node[place] (waiting 1) at ( 0,2) {}; + \node[place] (critical 1) at ( 0,1) {}; + \node[place] (semaphore) at ( 0,0) {}; + \node[transition] (leave critical) at ( 1,1) {}; + \node[transition] (enter critical) at (-1,1) {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-14} +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-15} +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; + + \node [red,above] at (semaphore.north) {$s\le 3$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-16} +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical, + label=above:$s\le3$] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-17} +\tikz + \node [circle,draw,label=60:$60^\circ$,label=below:$-90^\circ$] {my circle}; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-18} +\begin{tikzpicture}[every label/.style={red}] + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical, + label=above:$s\le3$] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-19} +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; + \draw [->] (enter critical.east) -- (critical.west); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-20} +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; + \draw [->] (enter critical.east) -- (critical.west); + \draw [->] (waiting.west) .. controls +(left:5mm) and +(up:5mm) + .. (enter critical.north); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-21} +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; + \draw [->] (enter critical) -- (critical); + \draw [->] (waiting) .. controls +(left:8mm) and +(up:8mm) + .. (enter critical); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-22} +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; + \draw [->] (enter critical) to (critical); + \draw [->] (waiting) to [out=180,in=90] (enter critical); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-23} +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {}; + \draw [->] (enter critical) to (critical); + \draw [->] (waiting) to [bend right=45] (enter critical); + \draw [->] (enter critical) to [bend right=45] (semaphore); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-24} +\begin{tikzpicture} + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + \node[transition] (leave critical) [right=of critical] {}; + \node[transition] (enter critical) [left=of critical] {} + edge [->] (critical) + edge [<-,bend left=45] (waiting) + edge [->,bend right=45] (semaphore); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-25} +\begin{tikzpicture} + [bend angle=45, + pre/.style={<-,shorten <=1pt,>={Stealth[round]},semithick}, + post/.style={->,shorten >=1pt,>={Stealth[round]},semithick}] + + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + + \node[transition] (leave critical) [right=of critical] {} + edge [pre] (critical) + edge [post,bend right] (waiting) + edge [pre, bend left] (semaphore); + \node[transition] (enter critical) [left=of critical] {} + edge [post] (critical) + edge [pre, bend left] (waiting) + edge [post,bend right] (semaphore); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-26} +\begin{tikzpicture}[auto,bend right] + \node (a) at (0:1) {$0^\circ$}; + \node (b) at (120:1) {$120^\circ$}; + \node (c) at (240:1) {$240^\circ$}; + + \draw (a) to node {1} node [swap] {1'} (b) + (b) to node {2} node [swap] {2'} (c) + (c) to node {3} node [swap] {3'} (a); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-27} +\tikzset{ + pre/.style={<-,shorten <=1pt,>={Stealth[round]},semithick}, + post/.style={->,shorten >=1pt,>={Stealth[round]},semithick}, +} +\begin{tikzpicture}[bend angle=45] + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + + \node[transition] (leave critical) [right=of critical] {} + edge [pre] (critical) + edge [post,bend right] node[auto,swap] {2} (waiting) + edge [pre, bend left] (semaphore); + \node[transition] (enter critical) [left=of critical] {} + edge [post] (critical) + edge [pre, bend left] (waiting) + edge [post,bend right] (semaphore); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-28} +\begin{tikzpicture} + \draw [->,decorate,decoration=snake] (0,0) -- (2,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-29} +\begin{tikzpicture} + \draw [->,decorate, + decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}] + (0,0) -- (3,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-30} +\begin{tikzpicture} + \draw [->,decorate, + decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}] + (0,0) -- (3,0) + node [above,align=center,midway] + { + replacement of\\ + the \textcolor{red}{capacity}\\ + by \textcolor{red}{two places} + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-31} +\begin{tikzpicture} + \draw [->,decorate, + decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}] + (0,0) -- (3,0) + node [above,text width=3cm,align=center,midway] + { + replacement of the \textcolor{red}{capacity} by + \textcolor{red}{two places} + }; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-32} +\tikzset{ + pre/.style={<-,shorten <=1pt,>={Stealth[round]},semithick}, + post/.style={->,shorten >=1pt,>={Stealth[round]},semithick}, +} +\begin{tikzpicture}[bend angle=45] + \node[place] (waiting) {}; + \node[place] (critical) [below=of waiting] {}; + \node[place] (semaphore) [below=of critical] {}; + + \node[transition] (leave critical) [right=of critical] {} + edge [pre] (critical) + edge [post,bend right] node[auto,swap] {2} (waiting) + edge [pre, bend left] (semaphore); + \node[transition] (enter critical) [left=of critical] {} + edge [post] (critical) + edge [pre, bend left] (waiting) + edge [post,bend right] (semaphore); + + \begin{scope}[on background layer] + \node [fill=black!30,fit=(waiting) (critical) (semaphore) + (leave critical) (enter critical)] {}; + \end{scope} +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-34} +\tikzset{ + every place/.style={minimum size=6mm,thick,draw=blue!75,fill=blue!20}, + every transition/.style={thick,draw=black!75,fill=black!20}, + every label/.style={red}, + every picture/.style={on grid,node distance=1.3cm,>={Stealth[round]},bend angle=45,auto}, +}% +\begin{tikzpicture} +\node [place,tokens=1] (w1) {}; + \node [place] (c1) [below=of w1] {}; + \node [place] (s) [below=of c1,label=above:$s\le 3$] {}; + \node [place] (c2) [below=of s] {}; + \node [place,tokens=1] (w2) [below=of c2] {}; + + \node [transition] (e1) [left=of c1] {} + edge [pre,bend left] (w1) + edge [post,bend right] (s) + edge [post] (c1); + \node [transition] (e2) [left=of c2] {} + edge [pre,bend right] (w2) + edge [post,bend left] (s) + edge [post] (c2); + \node [transition] (l1) [right=of c1] {} + edge [pre] (c1) + edge [pre,bend left] (s) + edge [post,bend right] node[swap] {2} (w1); + \node [transition] (l2) [right=of c2] {} + edge [pre] (c2) + edge [pre,bend right] (s) + edge [post,bend left] node {2} (w2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-nodes-35} +\tikzset{ + every place/.style={minimum size=6mm,thick,draw=blue!75,fill=blue!20}, + every transition/.style={thick,draw=black!75,fill=black!20}, + red place/.style= {place,draw=red!75,fill=red!20}, + every label/.style={red}, + every picture/.style={on grid,node distance=1.3cm,>={Stealth[round]},bend angle=45,auto}, +}% +\begin{tikzpicture} +\begin{scope}[xshift=6cm] + \node [place,tokens=1] (w1') {}; + \node [place] (c1') [below=of w1'] {}; + \node [red place] (s1') [below=of c1',xshift=-5mm] + [label=left:$s$] {}; + \node [red place,tokens=3] (s2') [below=of c1',xshift=5mm] + [label=right:$\bar s$] {}; + \node [place] (c2') [below=of s1',xshift=5mm] {}; + \node [place,tokens=1] (w2') [below=of c2'] {}; + + \node [transition] (e1') [left=of c1'] {} + edge [pre,bend left] (w1') + edge [post] (s1') + edge [pre] (s2') + edge [post] (c1'); + \node [transition] (e2') [left=of c2'] {} + edge [pre,bend right] (w2') + edge [post] (s1') + edge [pre] (s2') + edge [post] (c2'); + \node [transition] (l1') [right=of c1'] {} + edge [pre] (c1') + edge [pre] (s1') + edge [post] (s2') + edge [post,bend right] node[swap] {2} (w1'); + \node [transition] (l2') [right=of c2'] {} + edge [pre] (c2') + edge [pre] (s1') + edge [post] (s2') + edge [post,bend left] node {2} (w2'); + \end{scope} +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-tutorial.lvt b/testfiles/pgfmanual-en-tutorial.lvt new file mode 100644 index 000000000..8e7fe8f6b --- /dev/null +++ b/testfiles/pgfmanual-en-tutorial.lvt @@ -0,0 +1,446 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usetikzlibrary{intersections} +\usetikzlibrary{arrows.meta} +\usetikzlibrary{intersections} +\usetikzlibrary{angles,quotes} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-tutorial-2} +We are working on +\begin{tikzpicture} + \draw (-1.5,0) -- (1.5,0); + \draw (0,-1.5) -- (0,1.5); +\end{tikzpicture}. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-5} +\tikz \draw (-1.5,0) -- (1.5,0) -- (0,-1.5) -- (0,1.5); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-6} +\begin{tikzpicture} + \filldraw [gray] (0,0) circle [radius=2pt] + (1,1) circle [radius=2pt] + (2,1) circle [radius=2pt] + (2,0) circle [radius=2pt]; + \draw (0,0) .. controls (1,1) and (2,1) .. (2,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-7} +\begin{tikzpicture} + \draw (-1.5,0) -- (1.5,0); + \draw (0,-1.5) -- (0,1.5); + \draw (-1,0) .. controls (-1,0.555) and (-0.555,1) .. (0,1) + .. controls (0.555,1) and (1,0.555) .. (1,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-8} +\tikz \draw (0,0) circle [radius=10pt]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-9} +\tikz \draw (0,0) ellipse [x radius=20pt, y radius=10pt]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-10} +\begin{tikzpicture} + \draw (-1.5,0) -- (1.5,0); + \draw (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-11} +\begin{tikzpicture} + \draw (-1.5,0) -- (1.5,0); + \draw (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; + \draw (0,0) rectangle (0.5,0.5); + \draw (-0.5,-0.5) rectangle (-1,-1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-12} +\begin{tikzpicture} + \draw (-1.5,0) -- (1.5,0); + \draw (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; + \draw[step=.5cm] (-1.4,-1.4) grid (1.4,1.4); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-13} +\begin{tikzpicture} + \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4); + \draw (-1.5,0) -- (1.5,0); + \draw (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-18} +\begin{tikzpicture} + \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4); + \draw (-1.5,0) -- (1.5,0); + \draw (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; + \draw (3mm,0mm) arc [start angle=0, end angle=30, radius=3mm]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-19} +\begin{tikzpicture}[scale=3] + \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4); + \draw (-1.5,0) -- (1.5,0); + \draw (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; + \draw (3mm,0mm) arc [start angle=0, end angle=30, radius=3mm]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-20} +\tikz \draw (0,0) + arc [start angle=0, end angle=315, + x radius=1.75cm, y radius=1cm]; +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-21} +\begin{tikzpicture}[scale=3] + \clip (-0.1,-0.2) rectangle (1.1,0.75); + \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4); + \draw (-1.5,0) -- (1.5,0); + \draw (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; + \draw (3mm,0mm) arc [start angle=0, end angle=30, radius=3mm]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-22} +\begin{tikzpicture}[scale=3] + \clip[draw] (0.5,0.5) circle (.6cm); + \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4); + \draw (-1.5,0) -- (1.5,0); + \draw (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; + \draw (3mm,0mm) arc [start angle=0, end angle=30, radius=3mm]; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-23} +\tikz \draw (0,0) rectangle (1,1) (0,0) parabola (1,1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-24} +\tikz \draw[x=1pt,y=1pt] (0,0) parabola bend (4,16) (6,12); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-25} +A sine \tikz \draw[x=1ex,y=1ex] (0,0) sin (1.57,1); curve. +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-26} +\tikz \draw[x=1.57ex,y=1ex] (0,0) sin (1,1) cos (2,0) sin (3,-1) cos (4,0) + (0,1) cos (1,0) sin (2,-1) cos (3,0) sin (4,1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-27} +\begin{tikzpicture}[scale=3] + \clip (-0.1,-0.2) rectangle (1.1,0.75); + \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4); + \draw (-1.5,0) -- (1.5,0); + \draw (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; + \fill[green!20!white] (0,0) -- (3mm,0mm) + arc [start angle=0, end angle=30, radius=3mm] -- (0,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-29} +\begin{tikzpicture}[line width=5pt] + \draw (0,0) -- (1,0) -- (1,1) -- (0,0); + \draw (2,0) -- (3,0) -- (3,1) -- cycle; + \useasboundingbox (0,1.5); % make bounding box higher +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-30} +\begin{tikzpicture}[scale=3] + \clip (-0.1,-0.2) rectangle (1.1,0.75); + \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4); + \draw (-1.5,0) -- (1.5,0); + \draw (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; + \filldraw[fill=green!20!white, draw=green!50!black] (0,0) -- (3mm,0mm) + arc [start angle=0, end angle=30, radius=3mm] -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-31} +\tikz \shade (0,0) rectangle (2,1) (3,0.5) circle (.5cm); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-32} +\begin{tikzpicture}[rounded corners,ultra thick] + \shade[top color=yellow,bottom color=black] (0,0) rectangle +(2,1); + \shade[left color=yellow,right color=black] (3,0) rectangle +(2,1); + \shadedraw[inner color=yellow,outer color=black,draw=yellow] (6,0) rectangle +(2,1); + \shade[ball color=green] (9,.5) circle (.5cm); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-33} +\begin{tikzpicture}[scale=3] + \clip (-0.1,-0.2) rectangle (1.1,0.75); + \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4); + \draw (-1.5,0) -- (1.5,0); + \draw (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; + \shadedraw[left color=gray,right color=green, draw=green!50!black] + (0,0) -- (3mm,0mm) + arc [start angle=0, end angle=30, radius=3mm] -- cycle; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-34} +\begin{tikzpicture}[scale=3] + \clip (-0.1,-0.2) rectangle (1.1,0.75); + \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4); + \draw (-1.5,0) -- (1.5,0); + \draw (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; + \filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm) + arc [start angle=0, end angle=30, radius=3mm] -- cycle; + \draw[red,very thick] (30:1cm) -- +(0,-0.5); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-35} +\begin{tikzpicture}[scale=3] + \clip (-0.1,-0.2) rectangle (1.1,0.75); + \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4); + \draw (-1.5,0) -- (1.5,0); + \draw (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; + \filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm) + arc [start angle=0, end angle=30, radius=3mm] -- cycle; + \draw[red,very thick] (30:1cm) -- +(0,-0.5); + \draw[blue,very thick] (30:1cm) ++(0,-0.5) -- (0,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-36} +\begin{tikzpicture} + \def\rectanglepath{-- ++(1cm,0cm) -- ++(0cm,1cm) -- ++(-1cm,0cm) -- cycle} + \draw (0,0) \rectanglepath; + \draw (1.5,0) \rectanglepath; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-37} +\begin{tikzpicture} + \def\rectanglepath{-- +(1cm,0cm) -- +(1cm,1cm) -- +(0cm,1cm) -- cycle} + \draw (0,0) \rectanglepath; + \draw (1.5,0) \rectanglepath; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-38} +\tikz \draw (0,0) rectangle +(1,1) (1.5,0) rectangle +(1,1); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-40} +\begin{tikzpicture}[scale=3] + \clip (-0.1,-0.2) rectangle (1.1,1.51); + \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4); + \draw[->] (-1.5,0) -- (1.5,0); + \draw[->] (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; + \filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm) + arc [start angle=0, end angle=30, radius=3mm] -- cycle; + \draw[red,very thick] (30:1cm) -- +(0,-0.5); + \draw[blue,very thick] (30:1cm) ++(0,-0.5) -- (0,0); + + \path [name path=upward line] (1,0) -- (1,1); + \path [name path=sloped line] (0,0) -- (30:1.5cm); + \draw [name intersections={of=upward line and sloped line, by=x}] + [very thick,orange] (1,0) -- (x); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-41} +\begin{tikzpicture} + \draw [<->] (0,0) arc [start angle=180, end angle=30, radius=10pt]; + \draw [<->] (1,0) -- (1.5cm,10pt) -- (2cm,0pt) -- (2.5cm,10pt); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-42} +\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} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-43} +\begin{tikzpicture}[ultra thick] + \draw (0,0) -- (0,1); + \begin{scope}[thin] + \draw (1,0) -- (1,1); + \draw (2,0) -- (2,1); + \end{scope} + \draw (3,0) -- (3,1); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-44} +\tikz \draw (0,0) -- (0,0.5) [xshift=2pt] (0,0) -- (0,0.5); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-45} +\begin{tikzpicture}[even odd rule,rounded corners=2pt,x=10pt,y=10pt] + \filldraw[fill=yellow!80!black] (0,0) rectangle (1,1) + [xshift=5pt,yshift=5pt] (0,0) rectangle (1,1) + [rotate=30] (-1,-1) rectangle (2,2); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-46} +\foreach \x in {1,2,3} {$x =\x$, } +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-47} +\begin{tikzpicture}[scale=3] + \clip (-0.1,-0.2) rectangle (1.1,1.51); + \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4); + \filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm) + arc [start angle=0, end angle=30, radius=3mm] -- cycle; + \draw[->] (-1.5,0) -- (1.5,0); + \draw[->] (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; + + \foreach \x in {-1cm,-0.5cm,1cm} + \draw (\x,-1pt) -- (\x,1pt); + \foreach \y in {-1cm,-0.5cm,0.5cm,1cm} + \draw (-1pt,\y) -- (1pt,\y); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-49} +\tikz \foreach \x in {1,...,10} + \draw (\x,0) circle (0.4cm); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-50} +\tikz \foreach \x in {-1,-0.5,...,1} + \draw (\x cm,-1pt) -- (\x cm,1pt); +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-51} +\begin{tikzpicture} + \foreach \x in {1,2,...,5,7,8,...,12} + \foreach \y in {1,...,5} + { + \draw (\x,\y) +(-.5,-.5) rectangle ++(.5,.5); + \draw (\x,\y) node{\x,\y}; + } +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-52} +\begin{tikzpicture} + \draw (0,0) rectangle (2,2); + \draw (0.5,0.5) node [fill=yellow!80!black] + {Text at \verb!node 1!} + -- (1.5,1.5) node {Text at \verb!node 2!}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-53} +\begin{tikzpicture}[scale=3] + \clip (-0.6,-0.2) rectangle (0.6,1.51); + \draw[step=.5cm,help lines] (-1.4,-1.4) grid (1.4,1.4); + \filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm) + arc [start angle=0, end angle=30, radius=3mm] -- cycle; + \draw[->] (-1.5,0) -- (1.5,0); \draw[->] (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; + + \foreach \x in {-1,-0.5,1} + \draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north] {$\x$}; + \foreach \y in {-1,-0.5,0.5,1} + \draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east] {$\y$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-54} +\begin{tikzpicture}[scale=3] + \clip (-0.6,-0.2) rectangle (0.6,1.51); + \draw[step=.5cm,help lines] (-1.4,-1.4) grid (1.4,1.4); + \filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm) + arc [start angle=0, end angle=30, radius=3mm] -- cycle; + \draw[->] (-1.5,0) -- (1.5,0); \draw[->] (0,-1.5) -- (0,1.5); + \draw (0,0) circle [radius=1cm]; + + \foreach \x/\xtext in {-1, -0.5/-\frac{1}{2}, 1} + \draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north] {$\xtext$}; + \foreach \y/\ytext in {-1, -0.5/-\frac{1}{2}, 0.5/\frac{1}{2}, 1} + \draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east] {$\ytext$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-55} +\begin{tikzpicture}[scale=3] + \clip (-2,-0.2) rectangle (2,0.8); + \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4); + \filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm) + arc [start angle=0, end angle=30, radius=3mm] -- cycle; + \draw[->] (-1.5,0) -- (1.5,0) coordinate (x axis); + \draw[->] (0,-1.5) -- (0,1.5) coordinate (y axis); + \draw (0,0) circle [radius=1cm]; + + \draw[very thick,red] + (30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} (30:1cm |- x axis); + \draw[very thick,blue] + (30:1cm |- x axis) -- node[below=2pt,fill=white] {$\cos \alpha$} (0,0); + \path [name path=upward line] (1,0) -- (1,1); + \path [name path=sloped line] (0,0) -- (30:1.5cm); + \draw [name intersections={of=upward line and sloped line, by=t}] + [very thick,orange] (1,0) -- node [right=1pt,fill=white] + {$\displaystyle \tan \alpha \color{black}= + \frac{{\color{red}\sin \alpha}}{\color{blue}\cos \alpha}$} (t); + + \draw (0,0) -- (t); + + \foreach \x/\xtext in {-1, -0.5/-\frac{1}{2}, 1} + \draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north,fill=white] {$\xtext$}; + \foreach \y/\ytext in {-1, -0.5/-\frac{1}{2}, 0.5/\frac{1}{2}, 1} + \draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east,fill=white] {$\ytext$}; +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-56} +\begin{tikzpicture} + \draw (0,0) .. controls (6,1) and (9,1) .. + node[near start,sloped,above] {near start} + node {midway} + node[very near end,sloped,below] {very near end} (12,0); +\end{tikzpicture} +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-tutorial-58} +\begin{tikzpicture}[scale=3] + \coordinate (A) at (1,0); + \coordinate (B) at (0,0); + \coordinate (C) at (30:1cm); + + \draw (A) -- (B) -- (C) + pic [draw=green!50!black, fill=green!20, angle radius=9mm, + "$\alpha$"] {angle = A--B--C}; +\end{tikzpicture} +\ENDBOXTEST +\END diff --git a/testfiles/pgfmanual-en-xxcolor.lvt b/testfiles/pgfmanual-en-xxcolor.lvt new file mode 100644 index 000000000..3d4b0c038 --- /dev/null +++ b/testfiles/pgfmanual-en-xxcolor.lvt @@ -0,0 +1,40 @@ +\documentclass{minimal} +\input{pgf-regression-test} +\RequirePackage{fp,pgf,tikz,xcolor} + +\usepackage{xxcolor} +\usepackage{xxcolor} +\usepackage{calc} + +\begin{document} + +\BEGINBOXTEST{pgfmanual-en-xxcolor-1} +\begin{minipage}{3.5cm}\raggedright +\color{red}Red text,% +\begin{colormixin}{25!white} + washed-out red text, + \color{blue} washed-out blue text, + \begin{colormixin}{25!black} + dark washed-out blue text, + \color{green} dark washed-out green text,% + \end{colormixin} + back to washed-out blue text,% +\end{colormixin} +and back to red. +\end{minipage}% +\ENDBOXTEST + +\BEGINBOXTEST{pgfmanual-en-xxcolor-2} +\begin{minipage}{\linewidth-6pt}\raggedright +\begin{colormixin}{75!white} + \colorcurrentmixin\ should be ``!75!white''\par + \begin{colormixin}{75!black} + \colorcurrentmixin\ should be ``!75!black!75!white''\par + \begin{colormixin}{50!white} + \colorcurrentmixin\ should be ``!50!white!75!black!75!white''\par + \end{colormixin} + \end{colormixin} +\end{colormixin} +\end{minipage} +\ENDBOXTEST +\END