TikZ and pgf - Boston University

[Pages:405]Tik Z and pgf

Manual for version 1.18

\tikzstyle{level 1}=[sibling angle=120] \tikzstyle{level 2}=[sibling angle=60] \tikzstyle{level 3}=[sibling angle=30] \tikzstyle{every node}=[fill] \tikzstyle{edge from parent}=[snake=expanding waves,segment length=1mm,segment angle=10,draw] \tikz [grow cyclic,shape=circle,very thick,level distance=13mm,cap=round]

\node {} child [color=\A] foreach \A in {red,green,blue} { node {} child [color=\A!50!\B] foreach \B in {red,green,blue} { node {} child [color=\A!50!\B!50!\C] foreach \C in {black,gray,white} { node {} } } };

1

Fu?r meinen Vater, damit er noch viele sch?one TEX-Graphiken erschaffen kann. Till

Copyright 2007 by Till Tantau Permission is granted to copy, distribute and/or modify the documentation under the terms of the gnu Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled gnu Free Documentation License. Permission is granted to copy, distribute and/or modify the code of the package under the terms of the gnu Public License, Version 2 or any later version published by the Free Software Foundation. A copy of the license is included in the section entitled gnu Public License. Permission is also granted to distribute and/or modify both the documentation and the code under the conditions of the LaTeX Project Public License, either version 1.3 of this license or (at your option) any later version. A copy of the license is included in the section entitled LATEX Project Public License.

2

The Tik Z and PGF Packages

Manual for version 1.18

Till Tantau

Institut fu?r Theoretische Informatik Universit?at zu Lu?beck

June 12, 2007

Contents

1 Introduction

14

1.1 Structure of the System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

1.2 Comparison with Other Graphics Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

1.3 Utilities: Page Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

1.4 How to Read This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

1.5 Authors and Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

1.6 Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

I Tutorials and Guidelines

17

2 Tutorial: A Picture for Karl's Students

18

2.1 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2.2 Setting up the Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2.2.1 Setting up the Environment in LATEX . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.2.2 Setting up the Environment in Plain TEX . . . . . . . . . . . . . . . . . . . . . . . . 19 2.2.3 Setting up the Environment in ConTEXt . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.3 Straight Path Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.4 Curved Path Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.5 Circle Path Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.6 Rectangle Path Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.7 Grid Path Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

2.8 Adding a Touch of Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

2.9 Drawing Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

2.10 Arc Path Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

2.11 Clipping a Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

2.12 Parabola and Sine Path Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

2.13 Filling and Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

2.14 Shading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

2.15 Specifying Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

2.16 Adding Arrow Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

2.17 Scoping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

2.18 Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

2.19 Repeating Things: For-Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

2.20 Adding Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

Editor of this documentation. Parts of this documentation have been written by other authors as indicated in these parts or chapters and in Section 1.5.

3

3 Tutorial: A Petri-Net for Hagen

35

3.1 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

3.2 Setting up the Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

3.2.1 Setting up the Environment in LATEX . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3.2.2 Setting up the Environment in Plain TEX . . . . . . . . . . . . . . . . . . . . . . . . 35 3.2.3 Setting up the Environment in ConTEXt . . . . . . . . . . . . . . . . . . . . . . . . . 36 3.3 Introduction to Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

3.4 Placing Nodes Using the At Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

3.5 Using Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

3.6 Node Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

3.7 Naming Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

3.8 Placing Nodes Using Relative Placement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

3.9 Adding Labels Next to Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

3.10 Connecting Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

3.11 Adding Labels Next to Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

3.12 Adding the Snaked Line and Multi-Line Text . . . . . . . . . . . . . . . . . . . . . . . . . . 42

3.13 Using Layers: The Background Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

3.14 The Complete Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

4 Guidelines on Graphics

46

4.1 Planning the Time Needed for the Creation of Graphics . . . . . . . . . . . . . . . . . . . . 46

4.2 Workflow for Creating a Graphic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

4.3 Linking Graphics With the Main Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

4.4 Consistency Between Graphics and Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

4.5 Labels in Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

4.6 Plots and Charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

4.7 Attention and Distraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

II Installation and Configuration

53

5 Installation

54

5.1 Package and Driver Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.2 Installing Prebundled Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.2.1 Debian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.2.2 MiKTeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

5.3 Installation in a texmf Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

5.3.1 Installation that Keeps Everything Together . . . . . . . . . . . . . . . . . . . . . . . 55

5.3.2 Installation that is TDS-Compliant . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

5.4 Updating the Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

6 Licenses and Copyright

56

6.1 Which License Applies? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

6.2 The GNU Public License, Version 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

6.2.1 Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

6.2.2 Terms and Conditions For Copying, Distribution and Modification . . . . . . . . . . 57

6.2.3 No Warranty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

6.3 The LATEX Project Public License, Version 1.3c 2006-05-20 . . . . . . . . . . . . . . . . . . . 59 6.3.1 Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

6.3.2 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

6.3.3 Conditions on Distribution and Modification . . . . . . . . . . . . . . . . . . . . . . . 60

6.3.4 No Warranty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

6.3.5 Maintenance of The Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

6.3.6 Whether and How to Distribute Works under This License . . . . . . . . . . . . . . . 62

6.3.7 Choosing This License or Another License . . . . . . . . . . . . . . . . . . . . . . . . 62

6.3.8 A Recommendation on Modification Without Distribution . . . . . . . . . . . . . . . 63

6.3.9 How to Use This License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

6.3.10 Derived Works That Are Not Replacements . . . . . . . . . . . . . . . . . . . . . . . 63

6.3.11 Important Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

4

6.4 GNU Free Documentation License, Version 1.2, November 2002 . . . . . . . . . . . . . . . . 64 6.4.1 Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.4.2 Applicability and definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.4.3 Verbatim Copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.4.4 Copying in Quantity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.4.5 Modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.4.6 Combining Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.4.7 Collection of Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.4.8 Aggregating with independent Works . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.4.9 Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.4.10 Termination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.4.11 Future Revisions of this License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 6.4.12 Addendum: How to use this License for your documents . . . . . . . . . . . . . . . . 68

7 Input and Output Formats

69

7.1 Supported Input Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

7.1.1 Using the LATEX Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 7.1.2 Using the Plain TEX Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 7.1.3 Using the ConTEXt Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 7.2 Supported Output Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

7.2.1 Selecting the Backend Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

7.2.2 Producing PDF Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

7.2.3 Producing PostScript Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

7.2.4 Producing HTML / SVG Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

7.2.5 Producing Perfectly Portable DVI Output . . . . . . . . . . . . . . . . . . . . . . . . 72

III Tik Z ist kein Zeichenprogramm

73

8 Design Principles

74

8.1 Special Syntax For Specifying Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

8.2 Special Syntax For Path Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

8.3 Actions on Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

8.4 Key-Value Syntax for Graphic Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

8.5 Special Syntax for Specifying Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

8.6 Special Syntax for Specifying Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

8.7 Grouping of Graphic Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

8.8 Coordinate Transformation System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

9 Hierarchical Structures: Package, Environments, Scopes, and Styles

77

9.1 Loading the Package and the Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

9.2 Creating a Picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

9.2.1 Creating a Picture Using an Environment . . . . . . . . . . . . . . . . . . . . . . . . 77

9.2.2 Creating a Picture Using a Command . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

9.2.3 Adding a Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

9.3 Using Scopes to Structure a Picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

9.4 Using Scopes Inside Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

9.5 Using Styles to Manage How Pictures Look . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

10 Specifying Coordinates

82

10.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

10.2 Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

10.2.1 Canvas, XYZ, and Polar Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . 82

10.2.2 Barycentric Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

10.2.3 Node Coordinate System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

10.2.4 Intersection Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

10.2.5 Defining New Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

10.3 Relative and Incremental Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

5

11 Syntax for Path Specifications

90

11.1 The Move-To Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

11.2 The Line-To Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

11.2.1 Straight Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

11.2.2 Horizontal and Vertical Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

11.2.3 Snaked Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

11.3 The Curve-To Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

11.4 The Cycle Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

11.5 The Rectangle Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

11.6 Rounding Corners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

11.7 The Circle and Ellipse Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

11.8 The Arc Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

11.9 The Grid Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

11.10 The Parabola Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

11.11 The Sine and Cosine Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

11.12 The Plot Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

11.13 The To Path Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

11.14 The Scoping Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

11.15 The Node Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

11.16 The PGF-Extra Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

12 Actions on Paths

104

12.1 Specifying a Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

12.2 Drawing a Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

12.2.1 Graphic Parameters: Line Width, Line Cap, and Line Join . . . . . . . . . . . . . . . 106

12.2.2 Graphic Parameters: Dash Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

12.2.3 Graphic Parameters: Draw Opacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

12.2.4 Graphic Parameters: Arrow Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

12.2.5 Graphic Parameters: Double Lines and Bordered Lines . . . . . . . . . . . . . . . . . 110

12.3 Filling a Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

12.3.1 Graphic Parameters: Fill Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

12.3.2 Graphic Parameters: Interior Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

12.3.3 Graphic Parameters: Fill Opacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

12.4 Shading a Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

12.4.1 Choosing a Shading Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

12.4.2 Choosing a Shading Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

12.5 Establishing a Bounding Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

12.6 Using a Path For Clipping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

13 Nodes and Edges

118

13.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

13.2 Nodes and Their Shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

13.3 Multi-Part Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

13.4 Options for the Text in Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

13.5 Placing Nodes Using Anchors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

13.6 Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

13.7 Placing Nodes on a Line or Curve Explicitly . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

13.8 Placing Nodes on a Line or Curve Implicitly . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

13.9 The Label and Pin Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

13.10 Connecting Nodes: Using Nodes as Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . 131

13.11 Connecting Nodes: Using the Edge Operation . . . . . . . . . . . . . . . . . . . . . . . . . . 131

13.12 Referencing Nodes Outside the Current Pictures . . . . . . . . . . . . . . . . . . . . . . . . . 133

13.12.1 Referencing a Node in a Different Picture . . . . . . . . . . . . . . . . . . . . . . . . 133

13.12.2 Referencing the Current Page Node ? Absolute Positioning . . . . . . . . . . . . . . . 134

13.13 Predefined Shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134

13.14 Executing Code After Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

6

14 Matrices and Alignment

138

14.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

14.2 Matrices are Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

14.3 Cell Pictures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139

14.3.1 Alignment of Cell Pictures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139

14.3.2 Setting and Adjusting Column and Row Spacing . . . . . . . . . . . . . . . . . . . . 140

14.3.3 Cell Styles and Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142

14.4 Anchoring a Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

14.5 Considerations Concerning Active Characters . . . . . . . . . . . . . . . . . . . . . . . . . . 144

14.6 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

15 Making Trees Grow

148

15.1 Introduction to the Child Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

15.2 Child Paths and the Child Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149

15.3 Naming Child Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149

15.4 Specifying Options for Trees and Children . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

15.5 Placing Child Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

15.6 Edges From the Parent Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155

16 Plots of Functions

158

16.1 When Should One Use Tik Z for Generating Plots? . . . . . . . . . . . . . . . . . . . . . . . 158

16.2 The Plot Path Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

16.3 Plotting Points Given Inline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159

16.4 Plotting Points Read From an External File . . . . . . . . . . . . . . . . . . . . . . . . . . . 159

16.5 Plotting a Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159

16.6 Plotting a Function Using Gnuplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161

16.7 Placing Marks on the Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163

16.8 Smooth Plots, Sharp Plots, and Comb Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . 164

17 Transformations

167

17.1 The Different Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167

17.2 The XY- and XYZ-Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167

17.3 Coordinate Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

IV Libraries

172

18 Arrow Tip Library

173

18.1 Triangular Arrow Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173

18.2 Barbed Arrow Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173

18.3 Bracket-Like Arrow Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173

18.4 Circle and Diamond Arrow Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173

18.5 Serif-Like Arrow Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173

18.6 Partial Arrow Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

18.7 Line Caps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

19 Automata Drawing Library

175

19.1 Drawing Automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

19.2 States With and Without Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176

19.3 Initial and Accepting States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176

19.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178

20 Background Library

180

7

21 Calendar Library

183

21.1 Calendar Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

21.1.1 Creating a Simple List of Days . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189

21.1.2 Adding a Month Label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189

21.1.3 Creating a Week List Arrangement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190

21.1.4 Creating a Month List Arrangement . . . . . . . . . . . . . . . . . . . . . . . . . . . 190

21.2 Arrangements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191

21.3 Month Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193

21.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195

22 Entity-Relationship Diagram Drawing Library

199

22.1 Entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199

22.2 Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199

22.3 Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200

23 Paper Folding Diagrams Library

201

24 Matrix Library

204

24.1 Matrices of Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204

24.2 Delimiters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

25 Mindmap Drawing Library

207

25.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207

25.2 The Mindmap Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207

25.3 Concepts Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208

25.3.1 Isolated Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208

25.3.2 Concepts in Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209

25.4 Connecting Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211

25.4.1 Simple Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211

25.4.2 The Circle Connection Bar Snake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212

25.4.3 The Circle Connection Bar To-Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213

25.4.4 Tree Edges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214

25.5 Adding Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215

25.6 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215

26 Pattern Library

217

27 Petri-Net Drawing Library

218

27.1 Places . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

27.2 Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

27.3 Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

28 Plot Handler Library

221

28.1 Curve Plot Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

28.2 Comb Plot Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

28.3 Mark Plot Handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

29 Plot Mark Library

225

30 Shape Library

226

30.1 Geometric Shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226

30.2 Symbol Shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

30.3 Shapes with Multiple Text Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232

30.4 Miscellaneous Shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

31 Snake Library

235

8

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download