0% found this document useful (0 votes)
58 views196 pages

Visual Tik Z

This document provides an overview and reference for the TikZ graphical package. It introduces basic concepts like paths, edges, parameters for styling lines, filling shapes, and adding arrows. It also covers drawing small pictures, using different coordinate systems, and thanking contributors.

Uploaded by

chandrahas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views196 pages

Visual Tik Z

This document provides an overview and reference for the TikZ graphical package. It introduces basic concepts like paths, edges, parameters for styling lines, filling shapes, and adding arrows. It also covers drawing small pictures, using different coordinate systems, and thanking contributors.

Uploaded by

chandrahas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 196

Visual TikZ

Version 0.64
Jean Pierre Casteleyn
IUT Génie Thermique et Énergie
Dunkerque, France

Updated on February 13, 2017

1
Objectives :
• One image per command or parameter.
• the minimum amount of text possible.
• the most complete possible update after update.
• keep the same structure as VisualPSTricks

Remarks : Minimal code is given to show the effect of a command or a parameter. The
effects are sometime exaggerated for clarity .To consult the documentation, I have given the
number of the Section in pgfmanual

You can contact me at my personal email to


• let me know the mistakes found (please indicate the page)
• give me your commentaries, your suggestions …

What’s new :
• tikzpeople package added 116
• circuits.logic package added 162
• tikz-optics package added 166
• 3 minors bugs signaled by Jim Diamond corrected
• reorganization of the index

Licence :
This work may be distributed and/or modified under the conditions of the LaTeX Project
Public License, either version 1.3 of this license or (at your option) any later version.
The latest version of this license is in http://www.latex-project.org/lppl.txt and version 1.3
or later is part of all distributions of LaTeX version 2005/12/01 or later.
This work has the LPPL maintenance status ‘maintained’.
The Current Maintainer of this work is M. Jean Pierre Casteleyn.

Thanks to:
Till Tantau
Alain Matthes
Jim Diamond
Falk Rühl
Axel Kielhorn
Nils Fleischhacker
Michel Fruchart

2
Contents
1 Tikz loading 9

2 Basic figures 9

3 Path and edge 12


3.1 Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.2 Pathes in a path : edge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4 Parameters 14
4.1 Line width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.2 Dimensions available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.3 Terminators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.4 Lines junction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.5 Line styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.6 Fillings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.7 Filling rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.8 Filling with an image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.9 Shading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.9.1 Shadings available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.9.2 Shading library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.10 Extremities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.10.1 TikZ package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.10.2 “library arrow.meta ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Parameter sep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Parameter length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Parameter width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Parameter inset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Parameter angle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Parameter scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Parameter arc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Parameter slant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Parameter reversed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Parameter left . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Parameter right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Parameter harpoon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Parameter color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Parameter fill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Parameter open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Parameter line cap : round or butt . . . . . . . . . . . . . . . . . . . . . . 29
Parameter line join : round or miter . . . . . . . . . . . . . . . . . . . . . 29
Parameter round . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Parameter sharp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Parameter line width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Parameter line width’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Parameter quick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Parameter bending . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Parameter cap angle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

5 Small pictures 34
5.1 Own small pictures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.2 Drawing angles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

3
6 Coordinates 38
6.1 Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6.2 Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.2.1 Canvas coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.2.2 xyz coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.2.3 Polar coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.2.4 Coordinate system xyz polar . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.2.5 Barycentric coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.2.6 Named coordinates: nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.2.7 Coordinates relative to a node . . . . . . . . . . . . . . . . . . . . . . . . 41
6.2.8 Coordinates relative to two points . . . . . . . . . . . . . . . . . . . . . . 41
6.2.9 Coordinates relative to an intersection . . . . . . . . . . . . . . . . . . . . 42
6.3 Calculated positions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.3.1 Calculated positions with “pgfmath ” . . . . . . . . . . . . . . . . . . . . 43
6.4 Calculated positions with “calc library calc ” . . . . . . . . . . . . . . . . . . . . 43
6.5 Tangents with “calc library ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.5.1 Percentage position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.5.2 Position at a given distance . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.5.3 Relative coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.5.4 Cartesian coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.5.5 Polar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.5.6 Relative polar coordinate . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

7 Nodes 47
7.1 Creation of nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.2 Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.3 Node labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.4 Nodes on a path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
7.5 Nodes on an edge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
7.6 Fitting nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

8 Transformations 54

9 Placing the picture 55


9.1 In the text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
9.1.1 Without offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
9.1.2 With zero offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
9.1.3 With an offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
9.2 In a tikzpicture environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
9.3 In a fbox environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
9.4 Bounding box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
9.5 Clipping the picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
9.6 Partial clipping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
9.6.1 Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

10 Scope 59
10.1 Environment Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
10.2 library scopes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
10.2.1 Shorthand for Scope Environments . . . . . . . . . . . . . . . . . . . . . . 59
10.2.2 Single Command Scopes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

11 Absolute position on a page 61

4
12 Background 62
12.1 Framing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
12.1.1 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
12.1.2 Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
12.2 Partial framing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
12.2.1 Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
12.2.2 Gridding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
12.2.3 Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
12.2.4 Framing and gridding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

13 Defining your own colors 64


13.1 Basic colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
13.2 Colors mixing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
13.3 Naming a color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
13.3.1 Percentage of red , green and blue . . . . . . . . . . . . . . . . . . . . . . 64
13.3.2 From existing color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

14 Opacity 65
14.1 Blend Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
14.2 Fading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
14.2.1 Preset patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
14.2.2 Own patterns of fading with tikzfadingfrompicture . . . . . . . . . . . . . 67
14.3 Creating fading patterns with tikzfading . . . . . . . . . . . . . . . . . . . . . . . 69
14.3.1 Modification of the fading pattern . . . . . . . . . . . . . . . . . . . . . . 69
14.4 Transparency Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

15 Create command 71

16 Creating styles 72
16.1 Styles without variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
16.2 Styles with variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

17 Text highlighting 73
17.1 In a TikZ node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
17.1.1 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
17.1.2 Minimum size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
17.2 Geometric Shapes nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
17.2.1 Available shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
17.2.2 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
17.3 Symbol Shapes nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
17.3.1 Available shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
17.3.2 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
17.4 Arrow Shapes nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
17.4.1 Available shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
17.4.2 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
17.5 Callout Shapes nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
17.5.1 Available shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
17.5.2 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
17.6 Miscellaneous Shapes nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
17.6.1 Available shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
17.6.2 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Options for “rounded rectangle ” . . . . . . . . . . . . . . . . . . . . . . . 83
Options for “chamfered rectangle ” . . . . . . . . . . . . . . . . . . . . . . 83
17.7 Shapes with Multiple Text Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
17.8 Text attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

5
17.8.1 Position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
17.8.2 Colors and Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
17.8.3 Font Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
17.9 Positions on a node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
17.9.1 For all types of node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
17.9.2 Specific to a node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

18 Decorations 89
18.1 Library “decorations.pathmorphing ” . . . . . . . . . . . . . . . . . . . . . . . . . 89
18.1.1 “lineto ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
18.1.2 “straight zigzag ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
18.1.3 “random steps ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
18.1.4 “saw ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
18.1.5 “zigzag ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
18.1.6 “bent ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
18.1.7 “bumps ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
18.1.8 “coil ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
18.1.9 “curveto ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
18.1.10 “snake ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
18.2 Library “decorations.pathreplacing ” . . . . . . . . . . . . . . . . . . . . . . . . . 95
18.2.1 “border ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
18.2.2 “brace ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
18.2.3 ”expanding waves ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
18.2.4 “moveto ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
18.2.5 “ticks ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
18.2.6 ”waves ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
18.2.7 “show path construction ” . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
18.3 Library “decorations.markings ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
18.3.1 Personal mark at one position . . . . . . . . . . . . . . . . . . . . . . . . . 100
18.3.2 Marks between positions with step size . . . . . . . . . . . . . . . . . . . . 100
18.3.3 Marks with a text node . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
18.3.4 Mark with a picture node . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
18.3.5 Numbered marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
18.3.6 Marks info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
18.3.7 Mark with a connection node . . . . . . . . . . . . . . . . . . . . . . . . . 102
18.3.8 Arrow Tip Markings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
18.4 Library “decorations.footprints ” . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
18.5 Library “decorations.shapes ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
18.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
18.5.2 “shape backgrounds ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Orientation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
18.6 Library “decorations.text ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
18.7 Library “decorations.fractals ” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
18.8 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
18.8.1 Node decoration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
18.8.2 Node link decoration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
18.8.3 Graph decoration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
18.8.4 Various decoration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
18.8.5 Partial decoration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
18.8.6 Global and partial parameters . . . . . . . . . . . . . . . . . . . . . . . . 114
18.8.7 Path and its decoration “Postaction ” . . . . . . . . . . . . . . . . . . . . 114

19 Pictures in a TikZ picture 115


19.0.1 In a node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
19.0.2 With pgfdeclareimage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

6
20 Freehand drawing 115

21 Special effect 116


21.1 Tikzpeople . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
21.1.1 available characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
21.1.2 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
21.1.3 Anchor specific . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
21.1.4 Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

22 Creating Graphs 122


22.1 Graph with TikZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
22.1.1 From a list of points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
22.1.2 From a data file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
22.1.3 Graph types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
22.1.4 Graph of a function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
22.1.5 Parametric function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
22.2 Marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
22.2.1 Marks with TikZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
22.2.2 Marks with text mark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
22.2.3 Marks with plotmarks library . . . . . . . . . . . . . . . . . . . . . . . . . 127
22.3 Graph with Gnuplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

23 Creation of a graph with pgfplots 128


23.1 2D Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
23.1.1 Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
23.2 Drawing of the graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
23.2.1 Xunit and Yunit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
23.2.2 Graph type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
23.3 Graph information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
23.3.1 Titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
23.3.2 Legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
23.3.3 Size of the graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
23.3.4 Grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133

24 3D graph 135
24.0.1 Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
24.0.2 Graph drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
24.0.3 Aspect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
24.0.4 Viewpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

25 Table of a function variation 139


25.1 Creation of the table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
25.1.1 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
25.2 Creation of a sign row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
25.3 Creation of a variation row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

26 Repetitions 145
26.1 One variable repetition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
26.2 Two variables repetition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
26.3 Nested loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146

7
27 Tree diagram 147
27.1 Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
27.2 Orientation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
27.3 Distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
27.4 Parent-child distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
27.5 Two children distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
27.6 Nodes customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
27.6.1 Nodes name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
27.6.2 Missing a node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
27.6.3 Attachment point modification . . . . . . . . . . . . . . . . . . . . . . . . 151
27.6.4 Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
27.6.5 Labels on link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
27.6.6 Links customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
27.7 More options with « library trees » . . . . . . . . . . . . . . . . . . . . . . . . . . 154
27.7.1 One child and two childrenn position . . . . . . . . . . . . . . . . . . . . . 154
27.7.2 Angular linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
27.7.3 Forking links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155

28 Electrical Engineering Circuits 156


28.1 Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
28.2 Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
28.3 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162

29 Logical circuits 162

30 Optics 166
30.1 Optic components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
30.1.1 Components available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
30.1.2 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
30.1.3 Anchors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
30.2 Lights and sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
30.2.1 Available . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
30.2.2 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
30.2.3 Anchors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
30.3 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
30.3.1 Marks on the ray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
30.3.2 Dimensions indicating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

31 Animate a TikZ picture 176


31.1 Animation from picture files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
31.2 Animateinline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
31.3 Multiframe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
31.4 Creation of the table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
31.4.1 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
31.5 Creation of a sign row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
31.6 Creation of a variation row . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180

32 Packages studied in this document 184

33 Index 187

8
1 Tikz loading
Load package : \usepackage{tikz}

2 Basic figures
\draw (0,0) - - (2,1) ; PGFmanual section : 14-2 \draw (0,0)-| (2,1) ; \draw (0,0) |- (2,1) ;

\draw (0,2) . . controls (3,0) .. (2,2); PGFmanual section : 14-3

\draw \fill \filldraw

\draw (0,2) . . controls (3,0) and (-1,0) .. (2,2); PGFmanual section : 14-3

\draw \fill \filldraw

\draw (0,0) rectangle (3,2); PGFmanual section : 14-4

\draw \fill \filldraw

\draw (1,1) circle (1); PGFmanual section : 14-6

\draw \fill \filldraw

9
\draw (1,1) circle [radius=1cm]; \draw (1,1)ellipse [x radius=2cm,y radius=1cm]

radius=1cm x radius=2cm,y radius=1cm

\draw (1,1) circle (2 and 1); \draw (1,1) ellipse (2 and 1);

\draw (-2,0) arc (180:-45:2); PGFmanual section : 14-7

\draw \fill \filldraw

\draw (-2,0) arc [start angle=180, end angle=-45,radius=1] \draw (-2,0) arc (180:-45:2 and 1)

radius=1 x radius=1,y radius=.5

\draw (0,0) parabola (3,2); PGFmanual section : 14-9

——

\draw \fill \filldraw

\draw(0,1) parabola bend (1,0) (4,4); \draw(0,0) parabola[bend pos=0.25] (4,4);

10
\draw(0,1) parabola [parabola height=2cm] (3,0); \draw(0,0) parabola[bend at start] (3,2);

[bend at start] [bend at end]

\draw (0,0) sin (1.57,2); PGFmanual section : 14-10

\draw \fill \filldraw

\draw (0,0) cos (1.57,2);

PGFmanual section : 14-13

\draw (0,0) to (3,2); \draw[out=0] (0,0) to (3,2); \draw [in=-90] (0,0) to (3,2);
see section 7.2 page 47

Drawing with plot PGFmanual section : 14-12 PGFmanual section : 22


list of coordinates file of coordinates mathematical equation

plot coordinates plot file {table.dat} plot (\x,{sin(\x)})


{(2,0) (3,1) (4,1) (5,2)}
voir page 122

11
3 Path and edge
3.1 Path
PGFmanual section : 14

\draw (0,0) - - (2,1) - - (3,0) ; \draw (0,0) - - (2,1) - - (3,0) - - cycle ;

\draw (0,0) - - (2,1) - - (3,3) arc (135:-20:1) .. controls (6,0) and (4,0)
.. (5,2) sin (6.57,0) cos (7.57,2) ;

\draw \filldraw

PGFmanual section : 14-5

\draw [rounded corners] (0,0) – (2,1) – (3,0) ; \draw [sharp corners] (0,0) - - (2,1) - - (3,0) ;

\draw [rounded corners=0.5cm] (0,0) - - (1,1.732) - - (2,0) - - cycle ;

\draw (0,0) - - (1,1.732) [rounded corners=0.5cm] - - (2,0) - - cycle ;

\draw (0,0) - - (1,1.732) - - (2,0)[rounded corners=0.5cm] - - cycle ;

\draw [rounded corners=0.5cm] (0,0) - - (1,1.732)[sharp corners] - - (2,0) - - cycle ;

PGFmanual section : 14-2-2

12
\draw (0,0) - - (2,1) -| cycle ; \draw (0,0) - - (2,1) |- cycle ;

\tikz [c/.style={insert path={circle[radius=3pt]}}]


\draw(0,0)[c] – (1,2)[c] – (3,1) [c];

Path interrupted PGFmanual section : 14-1

\draw (0.5,0.5) - -(2.5,0.5) (0.5,1.5) - -(2.5,1.5);

\draw (0,0) - - (0,1) - - (1,1) (2,0) - - (2,1) - - (3,1) - - (current subpath start);
\fill[red] (current subpath start) circle (3pt);

3.2 Pathes in a path : edge


PGFmanual section : 17-12

\draw (0,0) - - (2,1) edge[dotted] (3,0) edge[red] (3,2) - -(1,2) - - (0,1) ;

\draw (0,0) - - (2,1) edge([red,to path={parabola (3,0)} ] ()


edge[red,to path={arc(-90 : 90 : 0.5)}] () - -(1,2) - - (0,1) ;

13
4 Parameters
4.1 Line width
PGFmanual section : 15-3-1

\tikz \draw[line width=.2cm] (0,0) - - (1,1);

[line width=.2cm] [ultra thin] [very thin] [thin]


(0.1pt) (0.2pt) (0.4pt)

[semithick] [thick] [very thick] [ultra thick]


(0.6pt) (0.8pt) (1.2pt) (1.6pt)

4.2 Dimensions available


\draw[line width=10pt] (2,0) to (2,1);

\draw[line width=10bp] (2,0) to (2,1);

\draw[line width=10mm] (2,0) to (2,1);

\draw[line width=1cm] (2,0) to (2,1);

\draw[line width=1in] (2,0) to (2,1);

x \draw[line width=1ex] (0,0.5) to (4,.5);

x \Huge \draw[line width=1ex] (0,0.5) to (4,.5);

m \draw[line width=1em] (2,0) to (2,1);

m \Huge \draw[line width=1em] (2,0) to (2,1);

4.3 Terminators

[line cap=rect ] [line cap=butt ] [line cap=round ]

14
4.4 Lines junction
\draw[line join=round ] (0,0) - - (2,1) - - (0,2);

[line join=round ] [line join=bevel ] [line join=miter ]

\draw[miter limit=1] (0,0) - - (2,1) - - (0,2);


(By default : miter limit=10)

miter limit=1 miter limit=2 miter limit=3

4.5 Line styles


PGFmanual section : 15-3-2

\tikz \draw[solid,line width=2mm] (0,0) - - (2,1);

[solid]

[dotted] [densely dotted] [loosely dotted]

[dashed] [densely dashed] [loosely dashed]

[dash dot] [densely dash dot] [loosely dash dot]

[dash dot dot] [densely dash dot dot] [loosely dash dot dot]

[dash pattern= on 1cm off 0.25cm on 0.25cm off 0.5cm]

[dash pattern=on 1cm off .25cm on .25cm off .5cm,dash phase=1cm]

15
PGFmanual section : 15-3-4

\tikz \draw[line width=.2cm,double] (0,0) - - (1,1);

double draw=blue,double=red double distance=.3cm double distance between line centers


=.3cm

\Huge = \tikz \draw[double equal sign distance] (0,0) - - (4,0);

= =
\Huge \large

4.6 Fillings
PGFmanual section : 15-5-1 PGFmanual section : 60

Load package : \usetikzlibrary{patterns}

\draw[pattern= dots ] (0,0) - - (3,1);

dots fivepointed stars sixpointed stars

grid horizontal lines vertical lines

north east lines north west lines rosshatch

crosshatch dots bricks checkerboard

\draw[pattern=fivepointed stars,pattern color=red] (0,0) rectangle (3,1);

16
\draw[pattern=checkerboard light gray ] (0,0) - - ((3,2) ;

checkerboard light gray horizontal lines light gray horizontal lines gray

horizontal lines dark gray horizontal lines light blue horizontal lines dark blue

crosshatch dots gray crosshatch dots light steel blue

4.7 Filling rule


PGFmanual section : 15-5-2

nonzero rule (By default)

\filldraw [fill=green!20] \filldraw [fill=green!20]


(0,0) - - (0,3) - - (3,3) - - (3,0) - - cycle (0,0) - - (0,3) - - (3,3) - - (3,0) - - cycle
(1,1) - - (1,2) - - (2,2) - -(2,1) - - cycle ; (1,1) - - (2,1) - - (2,2) - -(1,2) - - cycle;
even odd rule
\[fill=[green] (0,0) - - (2,1) - - (1,2) circle (.5cm); \filldraw[fill=green] (0,0) – (2,1) - - (1,2) circle (.5cm);

[fill=green] [even odd rule,fill=green] [fill=green] [even odd rule,fill=green]

4.8 Filling with an image


PGFmanual section : 15-6

\draw [path picture={ \node at (path picture bounding box.center)


{\includegraphics[height=3cm]{tiger}};}] (0,1) circle (1);

(0,1) circle (1) (0,0) - - (-1,1) - - (0,2) - - (1,1) - - cycle (1,0) parabola[parabola height=2cm] (3,0)

17
\draw [path picture={ \node at (path picture bounding box.north)
{\includegraphics[height=3cm]{tiger}};}] (0,1) circle (1);

north south east west south east

4.9 Shading
4.9.1 Shadings available
PGFmanual section : 15-7

\shade (0,0) rectangle (3,1); \shadedraw (0,0) rectangle (3,1);

\shadedraw[shading=axis ](0,0) rectangle (3,1);

axis radial ball

[left color=red] [right color=green] left color=red,right color=green

[top color=red] [bottom color=green] middle color=red

right color=green left color=red


shading angle=90 [shading angle=45] shading angle=-45

inner color=red outer color=green inner color=red outer color=green

4.9.2 Shading library


PGFmanual section : 65

Load package : \usetikzlibrary{shadings}

18
\shadedraw[upper left=red] (0,0) rectangle (2,2) ;

upper left=red upper right=green lower left=blue lower right=yellow

\shadedraw[shading=color wheel ] (0,0) rectangle (2,2) ;

shading=color wheel shading=color wheel black center shading=color wheel white center

shading=Mandelbrot set

19
4.10 Extremities
4.10.1 TikZ package
\tikz \draw[->,line width=.2cm,blue] (0,0) - - (1.5,1);

[->] [<-] [<->] [>->]

[-to] [-to reversed] [-o] [-|]

[-latex] [-latex reversed] [-stealth] [-stealth reversed]

4.10.2 “library arrow.meta”

Load package : \usetikzlibrary{arrows.meta}

\tikz \draw[ -Arc Barb,line width=.2cm,blue ] (0,0) - - (1.5,1) ;

-Arc Barb -Bar -Bracket -Hooks -Stealth

-Parenthesis -Straight Barb -Tee Barb -Classical TikZ Rightarrow -Square

-Circle -Implies, double -Rectangle -Computer Modern Rightarrow -Turned Square


[-To]

-Diamond -Ellipse -Kite [-Latex] -Triangle

\tikz \draw[-Butt Cap,line width=.2cm,blue] (0,0) - - (1.5,1) ;

-Butt Cap -Fast Round -Fast Triangle -Round Cap -Triangle Cap

20
\tikz \draw[Triangle-Circle,line width=.2cm,blue] (0,0) - - (3.5,1) ;

Triangle-Circle {Circle[] Triangle[]} {Circle[] . Triangle[] Triangle[] }

\tikz \draw[-Rays],line width=.1cm,blue] (0,0) - - (1.5,1);

Rays {Rays[n=2]} {Rays[n=3]} {Rays[n=4]} {Rays[n=5]}

{Rays[n=6]} {Rays[n=7]} {Rays[n=8]} {Rays[n=9]} {Rays[n=10]}

Parameter sep PGFmanual section : 16-4-2


\tikz \draw[-{Arc Barb[sep=.25cm] Arc Barb[ ]},line width=.1cm,blue] (0,0) - - (1.5,1);

Arc Barb Bracket Hooks Parenthesis Classical TikZ Rightarrow Rays

Straight Barb Tee Barb Circle Ellipse Computer Modern Rightarrow Triangle

Latex Kite Rectangle Square Stealth Turned Square

\tikz \draw[-{Arc Barb[sep=.25cm] Arc Barb[ ]},line width=.1cm,blue] (0,0) - - (1.5,1);

Arc Barb Bracket Hooks Parenthesis Classical TikZ Rightarrow Rays

Straight Barb Tee Barb Circle Ellipse Computer Modern Rightarrow Triangle

Latex Kite Rectangle Square Stealth Turned Square

21
Parameter length PGFmanual section : 16-3-1
\tikz \draw[-{Arc Barb[length=1cm]},line width=.2cm,blue] (0,0) - - (1,1);

Arc Barb Hooks Straight Barb Tee Barb Latex Classical TikZ Rightarrow

Straight Barb Diamond Ellipse Kite Circle Computer Modern Rightarrow

\tikz \draw[-{Arc Barb[length=0cm 10]},line width=.1cm,blue] (0,0) - - (3,1);

[length=0cm 10] [length=.5cm 5 ]


0cm + 10 x .1cm = 1cm .5cm + 5 x .1cm = 1cm

\tikz \draw[-{Arc Barb[length=0cm 5 ]},line width=.1cm,blue,double,double distance = 2 mm] (0,0) - - (3,1

[length=0cm5 ] [length=0cm 5 .6 ]
0cm + 5 x (.1cm + 2 mm + .1cm ) = 2cm 0cm + 5 x (.6 x .1cm+ (1-.6)(.1cm+ 2 mm+.1cm) = 11 mm

22
Parameter width PGFmanual section : 16-3-1
\tikz \draw[-{Arc Barb[width=2cm]},line width=.2cm,blue] (0,0) - - (1,1);

Arc Barb Hooks Straight Barb Tee Barb Classical TikZ Rightarrow

Straight Barb Diamond Ellipse Kite Computer Modern Rightarrow

\tikz \draw[-{Arc Barb[width=0cm 10]},line width=.1cm,blue] (0,0) - - (3,1);

[width=0cm 10] [width=.5cm 5 ]


0cm + 10 x .1cm = 1cm .5cm + 5 x .1cm = 1cm

\tikz \draw[-{Arc Barb[width=0cm 5 ]},line width=.1cm,blue,double,double distance = 2 mm] (0,0) - - (3,1)

[width=0cm5 ] [width=0cm 5 .6 ]
0cm + 5 x (.1cm + 2 mm + .1cm ) = 2cm 0cm + 5 x (.6 x .1cm+ (1-.6)(.1cm+ 2 mm+=.1cm) = 11 mm

\tikz \draw[-{Arc Barb[length=1cm,width=0cm 1.5]},line width’=.1cm,blue] (0,0) - - (3,1);

[width’=0cm 1.5] [width’=.5cm .5 ]


0cm + 1.5 x 1cm = 1.5cm .5cm + .5 x 1cm = 1cm

23
\tikz \draw[-{Arc Barb[length=1cm,width’=0cm 1.5 ]},line width=.1cm,blue,double,double distance = 2 mm

[width’=0cm 1.5 ] [width’=0cm 1.5 .6 ]


0cm + 1.5 x 1cm = 1.5cm 0cm + 1.5 x (.6 x 1cm+ (1-.6)(1cm+ 2 mm+1cm) = 11 mm

Parameter inset PGFmanual section : 16-3-1


\tikz \draw[-{Tee Barb[inset=0pt]},line width=.2cm,blue] (0,0) - - (1,1);

Tee Barb[inset=0pt] Kite[inset=0pt] Stealth[inset=0pt]

Tee Barb[inset=1cm] Kite[inset=1cm] Stealth[inset=.5cm]

\tikz \draw[-{Fast Round[inset=1cm]},line width=.2cm,blue] (0,0) - - (1,1);

Fast Round[inset=1cm] Fast Round[inset=2cm] Fast Triangle[inset=1cm] Fast Triangle[inset=2cm]

inset=1cm 1 inset=1cm 2 inset=1cm 4 inset=1cm .2

inset=0cm 1 inset=0cm 2 inset=0cm 4 inset=0cm .2

inset=0cm .2 inset=0cm .2 2 inset=0cm .2 10 inset=0cm 2 .5

24
inset=0cm .2 inset=0cm .2 2 inset=0cm .2 10 inset=0cm 2 .5

Parameter angle PGFmanual section : 16-3-1


\tikz \draw[-{Straight Barb[angle=60:.5cm 1]},line width=.2cm,blue] (0,0) - - (1,1);

[angle=60:.5cm 1] [angle=60:.5cm 1] [angle=60:.5cm 20] [angle=60:.5cm 5] [angle=90:.5cm 5]

\tikz \draw[-{Triangle[angle=60:.5cm 1]},line width=.2cm,blue] (0,0) - - (1,1);

[angle=60:.5cm 1] [angle=60:.5cm 1] [angle=60:.5cm 20] [angle=60:.5cm 5] [angle=90:.5cm 5]

Parameter scale PGFmanual section : 16-3-2


\tikz \draw[-{Arc Barb[scale=4]},li ne width=.1cm,blue] (0,0) - - (3,0) ;

scale=4 scale length=4 scale width=4

Parameter arc PGFmanual section : 16-3-3


\tikz \draw[-{Arc Barb[arc=270]},line width=.2cm,blue] (0,0) - - (3,1);

Arc Barb[arc=270] Arc Barb[arc=360] Hooks[arc=270] Hooks[arc=360]

Parameter slant PGFmanual section : 16-3-4


\tikz \draw[-{Arc Barb[slant=.3]},line width=.2cm,blue] (0,0) - - (1,1);

slant=0 slant=0.3 slant=0.5 slant=0.8 slant=1

25
\tikz \draw[-{Arc Barb[slant=.5]},line width=.2cm,blue] (0,0) - - (1,1);

Arc Barb Bracket Hooks Parenthesis Classical TikZ Rightarrow

Straight Barb Tee Barb Circle Diamond Ellipse

Kite Latex Rectangle Square Stealth

Turned Square Fast Round Fast Triangle Round Cap Triangle Cap

Parameter reversed PGFmanual section : 16-3-5


\tikz \draw[-{Arc Barb[reversed},line width=.2cm,blue] (0,0) - - (2,1) ;

Arc Barb Bracket Hooks Classical TikZ Rightarrow

Straight Barb Tee Barb Parenthesis Computer Modern Rightarrow

\tikz \draw[-{Fast Round[reversed]},line width=.5cm,blue] (0,0) - - (2,1);

Fast Round Fast Triangle Round Cap Triangle Cap

26
Parameter left PGFmanual section : 16-3-5
\tikz \draw[-{Arc Barb[left]},line width=.2cm,blue] (0,0) - - (1.5,1);

Arc Barb Bracket Hooks Parenthesis Classical TikZ Rightarrow Triangle

Straight Barb Tee Barb Circle Diamond Ellipse Turned Square

Kite Latex Rectangle Square Stealth Rays

Parameter right PGFmanual section : 16-3-5


\tikz \draw[-{Arc Barb[right]},line width=.2cm,blue] (0,0) - - (1.5,1);

Arc Barb Bracket Hooks Parenthesis Classical TikZ Rightarrow Triangle

Straight Barb Tee Barb Circle Diamond Ellipse Turned Square

Kite Latex Rectangle Square Stealth Rays

Parameter harpoon PGFmanual section : 16-3-5


\tikz \draw[-{Arc Barb[harpoon]},line width=.2cm,blue] (0,0) - - (1,1);

Arc Barb Bracket Hooks Parenthesis Classical TikZ Rightarrow Straight Barb Tee Barb

\tikz \draw[-{Arc Barb[harpoon,swap]},line width=.2cm,blue] (0,0) - - (1,1);

Arc Barb Bracket Hooks Parenthesis Classical TikZ Rightarrow Straight Barb Tee Barb

27
Parameter color PGFmanual section : 16-3-6
\tikz \draw[-{Arc Barb[color=red},line width=.2cm,blue] (0,0) - - (1,1);

Bracket[color=red] Bracket[color=green] Bracket[red]

\tikz \draw[-{Arc Barb[red},line width=.2cm,blue] (0,0) - - (1,1);

Arc Barb Bracket Hooks Parenthesis Classical TikZ Rightarrow

Straight Barb Tee Barb Circle Diamond Ellipse

Kite Latex Rectangle Square Stealth

Triangle Turned Square Rays

Parameter fill PGFmanual section : 16-3-6


\tikz \draw[-{Circle[fill=red]},line width=.2cm,blue] (0,0) - - (1,1);

Circle Diamond Ellipse Kite Triangle

Latex Rectangle Square Stealth Turned Square

\tikz \draw[-{Circle[fill=none]},line width=.2cm,blue] (0,0) - - (1,1);

Circle Diamond Ellipse Kite Triangle

Latex Rectangle Square Stealth Turned Square

28
Parameter open PGFmanual section : 16-3-6
\tikz \draw[-{Circle[open]},line width=.2cm,blue] (0,0) - - (1.5,1) ;

Circle Diamond Ellipse Kite Triangle

Latex Rectangle Square Stealth Turned Square

Parameter line cap : round or butt PGFmanual section : 16-3-7


\tikz \draw[-{Arc Barb[line cap=butt ]},line width=.2cm,blue] (0,0) - - (1,1);

Arc Barb Bracket Hooks Parenthesis Ellipse Rectangle Square Stealth

Straight Barb Tee Barb Diamond Kite Latex Triangle Turned Square Rays

\tikz \draw[-{Arc Barb[line cap=round ]},line width=.2cm,blue] (0,0) - - (1,1);

Arc Barb Bracket Hooks Parenthesis Ellipse Rectangle Square Stealth

Straight Barb Tee Barb Diamond Kite Latex Triangle Turned Square Rays

Parameter line join : round or miter PGFmanual section : 16-3-7


\tikz \draw[-{Arc Barb[line join=miter ]},line width=.2cm,blue] (0,0) - - (1,1);

Arc Barb Bracket Hooks Parenthesis Ellipse Rectangle Square Stealth

Straight Barb Tee Barb Diamond Kite Latex Triangle Turned Square Rays

29
\tikz \draw[-{Arc Barb[line cap=round ]},line width=.2cm,blue] (0,0) - - (1,1);

Arc Barb Bracket Hooks Parenthesis Ellipse Rectangle Square Stealth

Straight Barb Tee Barb Diamond Kite Latex Triangle Turned Square Rays

Parameter round PGFmanual section : 16-3-7


\tikz \draw[-{Arc Barb[round]},line width=.2cm,blue] (0,0) - - (1,1);

Arc Barb Bracket Hooks Parenthesis Ellipse Rectangle Square Stealth

Straight Barb Tee Barb Diamond Kite Latex Triangle Turned Square Rays

Parameter sharp PGFmanual section : 16-3-7


\tikz \draw[-{Classical TikZ Rightarrow[sharp]},line width=.2cm,blue] (0,0) - - (2,0)) ;
-{Classical TikZ Rightarrow[sharp]} -{Computer Modern Rightarrow[sharp]}

sharp [] sharp []

30
Parameter line width PGFmanual section : 16-3-7
\tikz \draw[-{Arc Barb[line width=.2cm]},line width=.4cm,blue] (0,0) - - (2,0);

Arc Barb Hooks Classical TikZ Rightarrow Straight Barb

Straight Barb Tee Bar Computer Modern Rightarrow

\tikz \draw[-{Arc Barb[line width=0cm 10]},line width=.1cm,blue] (0,0) - - (3,1);

[length=0cm 10] [length=.5cm 5 ]


0cm + 10 x .1cm = 1cm .5cm + 5 x .1cm = 1cm

\tikz \draw[-{Arc Barb[length=0cm 5 ]},line width=.1cm,blue,double,double distance = 2 mm] (0,0) - - (3,1

[length=0cm5 ] [length=0cm 5 .6 ]
0cm + 5 x (.1cm + 2 mm + .1cm ) = 2cm 0cm + 5 x (.6 x .1cm+ (1-.6)(.1cm+ 2 mm+.1cm) = 11 mm

31
Parameter line width’ PGFmanual section : 16-3-7
\tikz \draw[-{Arc Barb[line width’=.2cm]},line width=.4cm,blue] (0,0) - - (1,1);

Arc Barb Hooks Classical TikZ Rightarrow Straight Barb

Straight Barb Tee Bar Computer Modern Rightarrow

\tikz \draw[-{Arc Barb[line width=0cm 10]},line width’=.1cm,blue] (0,0) - - (3,1);

[length=0cm 10] [length=.5cm 5 ]


0cm + 10 x .1cm = 1cm .5cm + 5 x .1cm = 1cm

Parameter quick PGFmanual section : 16-3-8


\tikz \draw[-{Stealth[length=1cm,open,quick]}] (0,0) .. controls (1,-1) and (2,1) .. (3,1);

[-Stealth[length=1cm,open,quick]] [-Stealth[length=1cm,open]]

32
Parameter bending PGFmanual section : 16-3-8

Load package : \usetikzlibrary{bending}

\tikz \draw[-{Stealth[length=1cm,open,flex=0]}] (0,0) .. controls (1,-1) and (2,1) .. (3,1);

flex=0 flex=0.5 flex=1

\tikz \draw[-{Stealth[length=1cm,open,flex’=0]}] (0,0) .. controls (1,-1) and (2,1) .. (3,1);

flex’=0 flex’=0.5 flex’=1

\tikz \draw[-{Stealth[length=1cm,open,bend]}] (0,0) .. controls (1,-1) and (2,1) .. (3,1);

[-{Stealth[length=1cm,open,bend]}] [-Stealth[length=1cm,open,bend]Stealth[length=1cm,open,bend,sep]]

Parameter cap angle PGFmanual section : 16-5-4


\tikz \draw[-{Fast Round[cap angle=60]},line width=.2cm,blue] (0,0) - - (3,1);

Fast Round[cap angle=20] Fast Round[cap angle=60] Fast Round[cap angle=90]

Fast Triangle[cap angle=20] Fast Triangle[cap angle=60] Fast Triangle[cap angle=90]

33
5 Small pictures
5.1 Own small pictures
PGFmanual section : 14-19 PGFmanual section : 18

Création Utilisation
\tikzset{dfr/.pic={\filldraw[blue] (-2pt,0) rectangle
(0,5pt) ; \tikz \pic {dfr};
\filldraw[fill=white] (0,0) rectangle (2pt,5pt);
\filldraw[fill=red] (2pt,0) rectangle (4pt,5pt); }}

Positioning

\pic at (1,1) [pic type = dfr]; \pic at (1,1) {dfr};

\path (1,1) pic [pic type= dfr]; \path (1,1) pic {dfr};

\pic [at={(1,1)}] [pic type= dfr]; \pic [at={(1,1)}] {dfr};

\pic[scale=3] at (1,1) {dfr};

[scale=3] [scale=3,rotate=45] [scale=3,red]

\tikz [scale=4] \pic at (0,0) {dfr};


\pic at (.5,0) [transform shape] {dfr};

On a path
\tikz \draw (0,0) to [out=10,in=170] pic [near start] {dfr} pic {dfr}
pic [sloped, near end] {dfr} (10,0);

\draw (0,0) to [out=10,in=170] pic [pos=.3]


{code={\draw circle [radius=3mm];}} (10,0) ;

34
Définition :
\tikzset{ my pic/.pic = {
\path [pic actions] (0,0) circle[radius=3mm];
\draw (-3mm,-3mm) rectangle (3mm,3mm); } }
Utilisation : \pic [red] {my pic}

[red] [draw] [draw=red] [draw, shading=ball] [fill=red!50]

\tikz \pic foreach \x in {1,1.5,...,10} at (\x,0) {dfr};

\fill [green] (0,0) - - (1,0)pic [behind path,scale=3] {dfr} – (1,1) – (0,1) – cycle ;

[behind path,scale=3] [scale=3]

\tikzset{ pics/mon cercle/.style = { background code =


{ \fill circle [radius=#1]; } } }
\tikz [fill=green] \draw[line width=3pt] (0,0) pic {mon
cercle=2mm} - - (1,1) pic {mon cercle=5mm};
\tikzset{ pics/mon cercle/.style = { foreground code =
{ \fill circle [radius=#1]; } } }
\tikz [fill=green] \draw[line width=3pt] (0,0) pic {mon
cercle=2mm} - - (1,1) pic {mon cercle=5mm};

\fill [green](-1,0) - - (1,0)


pic [pics/background code={\fill[blue] (0.5,0.5) circle (1cm );}
, pics/code=\fill[red] (-1,-.5) rectangle (0.5,0.5); ]
{} - - (1,2) - - (-1,2) - - cycle ;

\fill [green] (-1,0) - - (1,0)


pic [pics/foreground code=\fill[blue] (0.5,0.5) circle (1cm );
,pics/code={\fill[red] (-1,-.5) rectangle (0.5,0.5);} ]
{} - - (1,2) - - (-1,2) - - cycle ;

\fill [green](-1,0) - - (1,0)


pic [pics/background code={\fill[blue] (0.5 , 0.5) circle (1cm
);}
,pics/code={\fill[red] (-1 , -0.5) rectangle (0.5 , 0.5);},behind
path ]
{} - - (1,2) - - (-1,2) - - cycle ;

\fill [green] (-1,0) - - (1,0)


pic [pics/foreground code={\fill[blue] (0.5 , 0.5) circle (1cm );}
, pics/code={\fill[red] (-1,-.5) rectangle (0.5 , 0.5);},behind
path ]
{} - - (1,2) - - (-1,2) - - cycle ;

35
5.2 Drawing angles
PGFmanual section : 39

Load package : \usetikzlibrary{angles}

\tikz \draw (2,0) coordinate (A) - - (0,0) coordinate (B)


- - (1,1) coordinate (C) pic [draw] {angle};

pic [draw] {angle} pic [fill] {angle}

\tikz \draw (2,0) coordinate (X) - - (0,0) coordinate (Y)


- - (1,1) coordinate (Z) pic [draw] {angle= X- -Y- -Z};

pic [draw] {angle= X- -Y- -Z} pic [fill] {angle = Z- -Y- -X}
By default : angle= A- -B- -C

\tikz \draw (2,0) coordinate (A) - - (0,0) coordinate (B)


- - (1,1) coordinate (C) pic [draw,->] {angle};

pic [draw,->] {angle} pic [fill,fill=red!50] {angle}

\tikz \draw (2,0) coordinate (A) - - (0,0) coordinate (B)


- - (1,1) coordinate (C) pic [draw,angle radius=1cm] {angle};

pic [draw,angle radius=1cm] {angle} pic [fill,angle radius=1cm] {angle}


By default : angle radius=5mm

Load package : \usetikzlibrary{quotes}

\tikz \draw (3,0) coordinate (A) - - (0,1) coordinate (B) - - (1,2) coordinate (C)
pic [draw,"$\alpha$ "] {angle};

\tikz \draw (2,0) coordinate (A)


- - (0,0) coordinate (B) - - (1,2) coordinate (C) α
α
pic [draw, " $\alpha$", angle eccentricity=1]] {angle};
angle eccentricity=1 angle eccentricity=1.5
By default : angle eccentricity= 0.6

36
\tikz { \draw (2,0) coordinate (A) - - (0,0) coordinate (B) - - (1,2) coordinate (C)
pic (xxx) [draw,"$\alpha$",angle radius= 1cm ] {angle};
\draw (xxx)circle [radius=5pt] ; }

37
6 Coordinates
6.1 Grid

\draw (0,0) grid (2,2); PGFmanual section : 14-8

\draw (0,0) grid [step=.75cm] (0,0) grid (3,3);

step=.75cm x step=.75cm ystep=.75cm step=(45:1)

\draw[red] (0,0) grid [rotate=45] (3,3); \draw[help lines] (0,0) grid (3,3);

38
6.2 Coordinates
PGFmanual section : 13-2-1

6.2.1 Canvas coordinates


explicit implicit

\fill (canvas cs:x=2cm,y=1.5cm) circle (2pt); \fill (2cm,1.5cm) circle (2pt);

6.2.2 xyz coordinates

\draw (0,0) - - (xyz cs:x=1); \draw (0,0) - - (1,0,0);


\draw (0,0) - - (xyz cs:y=1); \draw (0,0) - - (0,1,0);
\draw (0,0) - - (xyz cs:z=1); \draw (0,0) - - (0,0,1);

6.2.3 Polar coordinates


explicit implicit

\fill (canvas polar cs:angle=45,radius=2cm) circle (2pt); \fill (45:2cm) circle (2pt);

\fill (canvas polar cs:angle=45,x radius=3cm,y radius=2cm) circle (2pt);

39
6.2.4 Coordinate system xyz polar
explicit implicit

\fill (xyz polar cs:angle=45,radius=2) circle (2pt); \fill (45:2cm) circle (2pt);

\fill (xyz polar cs:angle=45,x radius=3,y radius=2) circle (2pt);

\begin{tikzpicture}[x=1.5cm,y=1cm]

\fill (xyz polar cs:angle=45,radius=2) circle (2pt); \fill (45:2cm) circle (2pt);

\begin{tikzpicture}[x={(0cm,1cm)},y={(-1cm,0cm)}]

\fill (xyz polar cs:angle=45,radius=2) circle (2pt); \fill (45:2cm) circle (2pt);

6.2.5 Barycentric coordinates


PGFmanual section : 13-2-2

\node [circle,fill=red!20] at (barycentric cs:A=0.6,B=0.3 ) {X};


C C D

X
X

A X B A B A B
A=0.3,B=0.3 A=0.4,B=0.4 ,C=.4 A=0.5,B=0.5,C=.5,D=.5
C C D

X
X

A X B A B A B
A=0.6,B=0.3 A=0.2,B=0.4 ,C=.6 A=0.2,B=0.4,C=.6,D=.8

40
6.2.6 Named coordinates: nodes
PGFmanual section : 13-2-3

\coordinate (centre) at(1.5,1.5) ;


\coordinate (A) at (.5,.5) ;
\coordinate (B) at (2.5,2.5) ;

\fill (centre) circle (3pt);


\draw[red] (A) rectangle (B) ;

see also page 88

6.2.7 Coordinates relative to a node


\node [draw,fill=green!20,] (A) at (1,1) {\huge noeud};
\fill[red] (node cs:name=A,anchor=south) circle (3pt);

noeud noeud noeud noeud


name=A,anchor=south name=A,anchor=west name=A,anchor=north name=A,anchor=east

\fill[red] (node cs:name=A,angle=0) circle (3pt);

noeud noeud noeud noeud


name=A,angle=0 name=A,angle=-30 nname=A,angle=-90 name=A,angle=-150

6.2.8 Coordinates relative to two points


PGFmanual section : 13-3-1

\node [circle,fill=red!20] at (1,1 |- 3,3) {X}

X B B

A A X

at (1,1 |- 3,3) at (1,1 -| 3,3)

41
6.2.9 Coordinates relative to an intersection
PGFmanual section : 13-3-2

Load package : \usetikzlibrary{intersections}

\draw [name path=cercle] (2,1) circle (1cm);


\draw [name path=rectangle] (0.5,0.5) rectangle +(3,1);
\fill [red,name intersections={of=cercle and rectangle}] (intersection-1) circle (2pt)

intersection-1 intersection-2 intersection-3 intersection-4

\fill [red, name intersections={of=cercle and rectangle}]


(intersection-1) circle (2pt) node[black,above right] {point a} ;
point a

\fill [red, name intersections={of=cercle and rectangle, name=point}];


\draw [red] (point-1) - - (point-3); \draw [green] (point-2) - - (point-4);

\fill [red, name intersections={of=cercle and rectangle, by={a,b,c,d}}];


\draw [red] (a) - - (c); \draw [green] (b) - - (d);

\fill [name intersections={of=cercle and rectangle, name=i, total=\t}] [red]


\foreach \s in {1,...,\t} {(i-\s) circle (2pt) node[black,above right] {\s}}
2 1

3 4

42
6.3 Calculated positions
6.3.1 Calculated positions with “pgfmath”
PGFmanual section : 13-2-1

Package automatically loaded with Tikz

explicit : \fill [red] (canvas cs:x=2cm+1.5cm,y=1.5cm-1cm) circle (3pt);


implicit : \fill [red] (2cm+1.5cm,1.5cm-1cm) circle (3pt);

\draw[dashed] (2,2) circle (2);


\fill [red](2+ 2*cos 30 , 2+2*sin 30) circle
(3pt);
\fill[magenta] (2+2*cos{(120)} ,
2+2*sin{(120)}) circle (3pt);

6.4 Calculated positions with “calc library calc”


PGFmanual section : 13-5

Load package : \usetikzlibrary{calc}

A
\node (a) at (1,1) {A};
\fill [red] ($(a) + 2/3*(1cm,0)$) circle (2pt);
\fill [red] ($(a) + 4/3*(1cm,0)$) circle (2pt);

6.5 Tangents with “calc library”


PGFmanual section : 13-2-4

\node[fill=green!20] (a) at (3,1.5) {A};


\fill[red] (tangent cs:node=c,point={(A)},solution=1);

A A
c c

solution=1 solution=2

43
6.5.1 Percentage position
PGFmanual section : 13-5-3

\fill[red] ($(0,1)!.25!(4,1)$) circle (4pt);

(0,1)!0.25!(4,1) (0,1)!0.75!(4,1)

\fill[red] ($(0,2)!0.75!(4,2)!0.66!(0,0)$) circle (2pt);

6.5.2 Position at a given distance


PGFmanual section : 13-5-4

\fill[red] ($(0,1)!1.5cm!(4,1)$) circle (4pt);

(0,1)!1.5cm!(4,1) (0,1)!3cm!(4,1)

\draw (2,.05) - - ($ (2,0.5)!2cm!90:(4,1) $);

6.5.3 Relative coordinates


6.5.4 Cartesian coordinates
PGFmanual section : 13-4-1

44
relative to the origin relative to a position relative to the last position

(0,0) - - (1,0) (0,0) - - (1,0) (0,0) - - (1,0)


- - (2,1) - - (2,-1) - - +(2,1) - - +(2,-1) - - ++(2,1) - - ++(2,-1)

\draw (0,0) rectangle (1,1) \draw (0,0) rectangle (1,1) \draw (0,0) rectangle (1,1)
rectangle (2,2) rectangle (3,3); rectangle +(2,2) rectangle +(3,3); rectangle ++(2,2) rectangle ++(3,3);

6.5.5 Polar
relative to the origin relative to a position relative to the last position

(0:0) - - (0:1) (0:0) - - (0:1) (0:0)- - (0:1)


- - (30:2) - - (-30:2) - - +(30:2) - - +(-30:2) - - ++(30:2) - - ++(-30:2)

6.5.6 Relative polar coordinate


PGFmanual section : 13-4-2

([turn]-45:1cm) ([turn]45:1cm)

\draw (4,0) arc (0 :120 :2) - - ([turn]90:2cm) ; \draw (0,0) to [bend left] (2,2) - - ([turn]0:2cm);

45
\draw(1,2) .. controls ([turn]0:2cm) .. ([turn]-90:2cm);

([turn]0:2cm) .. ([turn]-90:2cm) ([turn]30:2cm) .. ([turn]-90:2cm) ([turn]0:2cm) .. ([turn]90:2cm)

46
7 Nodes
7.1 Creation of nodes
\draw (1,1) node[fill=red!20] {};

By default node[draw] node[circle] node[circle,draw]

\node at (1,1) [fill=red!20] {};

[fill=red!20] [draw] [circle,fill=red!20] [circle,draw]

Other type of nodes see page 73

7.2 Links
B B B

A A A
(A)- - (B) (A) |- (B) (A) -| (B)
B B B

A A A
(A) to [bend right] (B) (A) to [bend left] (B) (A) to[bend left=0] (B)

B B B

A A A
(A) to[bend left=120] (B) (A) to[bend left=45] (B) (A) to[bend left=90] (B)

B B B

A A A
(A) to[out=90] (B) (A) to[out=30] (B) (A) to[in=-90] (B)

47
\draw (A) .. controls +(right:2cm) and +(down:2cm) .. (B);
B B

A A
controls +(right:2cm) and +(down:2cm) controls +(up:1cm) and +(left:1cm)
B B

A A
controls +(right:1cm) and +(right:2cm) controls +(up:1cm) and +(right:2cm)
B B

A A
controls +(120:2cm) and +(200:1cm) controls +(120:2cm) and +(200:1cm)
B B

C C

A D A D
controls +(C) and +(D) controls +(D)

\node[draw] (A) at (0,0) {A}


\node[draw] (B) at (2,2) {B} edge [->] (A);
PGFmanual section : 17-12-1
B B B

A A A
[->] [red] [dashed]

48
7.3 Node labels
\fill(0,0) circle (2pt) node[above] {texte} ;

texte
texte texte
texte

[above] [below] [left] [right]

texte texte
texte texte

[above left] [below left] [above right] [below right]

texte
texte texte
texte

[anchor=south] [anchor=west] [anchor=north] [anchor=east] ]

texte texte
texte
texte

[anchor=south east] [anchor=south west] [anchor=north west] [anchor==north east ]

\fill(0,0) circle (2pt) node[above=.3cm] {texte} ;

texte
texte texte
texte

[above=.3cm] [below=.3cm] [left=.3cm] [right=.3cm]]

texte texte

texte texte

[above left=.3cm] [below left=.3cm] [above right=.3cm] [below right=.3cm]]

49
\shorthandoff{ :} 1
\node [draw,label=right :texte] {}
\shorthandon{ :}
texte texte
texte texte texte
label=right label=left label=above label=below label=45

\fill(0,0) circle (2pt) node[below right=.3cm,draw,label=45 :étiquette] {texte} ;

étiquette
texte

1
\shorthandoff{ :} \node[circle,draw,blue,pin=texte] {} ; \shorthandon{ :}
texte texte

texte
[circle,pin=texte] [circle,pin=60 :texte] [circle,pin=right :texte]

\tikz[pin position=60] \node [circle,pin=texte] {} ;


texte

texte
texte

[pin position=60] [pin distance=0 cm] [pin distance=2 cm]


By default : above By default : 3 ex
1 Only useful when the package babel is loaded with the frenchb option

50
7.4 Nodes on a path
\draw(0,0) .. controls (1,2) and (2,-1) .. (4,0) node[at end] {texte} ;

texte
texte texte

pos=0 pos=.33 at end (pos=1)

texte
texte texte

very near end (pos=0.875.) near end (pos=0.75) midway (pos=0.5)

texte texte
texte

near start (pos=0.25) very near start (pos=0.125) at start (pos=0)

\draw(0,0) .. controls (1,2) and (2,1) .. (4,0) node[sloped,midway] {texte} ;

te texte
xt
e texte

sloped above below

\draw(0,0) .. controls (1,2) and (2,1) .. (5,0) node[sloped,midway,allow upside down] {texte} ;

te texte
xt
e texte

sloped above below

51
\draw(A) to [bend right] node [bend right] {texte} (B);
B B B

texte
texte
texte
A A A
[bend right] [auto,bend right] [auto,swap,bend right]

7.5 Nodes on an edge


\draw(0,0) edge [”abc”, ->] (4,0);
PGFmanual section : 17-12-2
abc abc
abc
[”abc”, ->] [”abc”, near start] [”abc”, style={auto=right}]
abc abc
abc
[font=\Large,”abc” ] [”abc” color=red ] [”abc” ’ ]

abc abc abc

[”abc” draw ] [”abc” inner sep=0pt ] [”abc” fill ,fill=yellow ]

\draw[every edge quotes/.style={fill=yellow}] (0,0) edge [”abc”] (4,0);

abc

7.6 Fitting nodes


Load package : \usetikzlibrary{fit}

PGFmanual section : 52

\fill (.5,1) circle (3pt);


\fill (2,.25) circle (3pt);
\fill (1,2) circle (3pt);
\fill (1.25,0.25) circle (3pt);
\fill (1.75,1.5) circle (3pt);
\node[draw=red,ultra thick,fit={(.5,1) (2,.25) (1,2)
(1.25,0.25) (1.75,1.5) }] {} ;

[dot/.style={inner sep=0pt,draw,circle,blue}]
\node[dot] (a) at (.5,1) {a};
c
\node[dot] (b) at (2,.25) {b};
e \node[dot] (c) at (1,2) {c};
a \node[dot] (d) at (1.25,0.25) {d};
\node[dot] (e) at (1.75,1.5) {e};
d b \node[draw=red,ultra thick,fit=(a) (b) (c) (d) (e)] {}

52
\node[draw=red,ultra thick,fit=(a) (b) (c) (d) (e)] (xxx) {}
\node at (xxx.east) [fill=green!20] {x};
x
c c c
e e e
a x a a x

d b d b d b
xxx.east xxx.north east xxx.center

\node [draw=green,fit=(a) (b) (c) (d) (e)] ;


\node [inner sep=0pt,draw=red,fit=(a) (b) (c) (d) (e)] ;

c c
e e
a a

d b d b

inner sep=0pt inner sep=.5cm

\node[circle,draw=red,inner sep=0pt,fit=(a) (b) (c) (d) (e)] {};

c
c c e
e e a
a a
d b
d b d b

circle ellipse shape=starburst (see section 17 )

\node[draw=red, rotate fit=45, fit=(a) (b) (c) (d) (e)] {};

c
c
e
e
a
a
d b
d b

rotate fit=45 ellipse, rotate fit=45

53
8 Transformations
PGFmanual section : 25-3

\draw[rotate,blue] (0,0) rectangle (2,2) ;

rotate=40 x=1cm,y=0.5cm xslant=0.75 yslant=0.75

scale=1.5 scale=-1 xshift=0.5cm yshift=0.5cm

54
9 Placing the picture
9.1 In the text
9.1.1 Without offset
PGFmanual section : 12-2

picture in the text here is the following code : \tikz \draw


(0,0) rectangle(2,2);\tikz \draw (0,0) circle (1);

9.1.2 With zero offset

picture in the text here is the following code : \tikz[base-

line=0pt] \draw (0,0) rectangle(2,2);\tikz[baseline=0pt] \draw (0,0) circle (1);

9.1.3 With an offset

picture in the text here is the following code : \tikz[base-

line=1cm] \draw (0,0) rectangle(2,2);\tikz[baseline=1cm] \draw (0,0) circle (1);

55
9.2 In a tikzpicture environment
PGFmanual section : 12-1

text before
\tikzpicture[blue]
\draw (0,0) rectangle(2,2);
\draw (0,0) circle (1);
\end{tikzpicture}
text after
text before text after

text before
\begin{tikzpicture}[blue,baseline=0pt]
\draw (0,0) rectangle(2,2);
text before text after \draw (0,0) circle (1);
\end{tikzpicture}
text after

text before text after text before


\begin{tikzpicture}[blue,baseline=1cm]
\draw (0,0) rectangle(2,2);
\draw (0,0) circle (1);
\end{tikzpicture}
text after

9.3 In a fbox environment


text before
\fbox{
\begin{tikzpicture}[blue,baseline=0pt]
\draw (0,0) rectangle(2,2);
text before text after \draw (0,0) circle (1);
\end{tikzpicture}
}
text after

9.4 Bounding box


PGFmanual section : 15-8

\draw [use as bounding box] (1,0) rectangle (2,1);


\draw[blue] (-1,0) - - (3,1);

texte avant texte après texte avant texte après


(1,0) rectangle (2,1) (0,0) rectangle (0,0)

56
texte avant. \begin{tikzpicture} [trim left=1cm]
\draw[blue] (-1,0) - - (3,1); \draw[red] (0,0) grid (2,1);
\end{tikzpicture}texte après

texte avant. texte après texte avant. texte après


[trim left=1cm] [trim right= 1cm]

text before
\tikzpicture[blue]
\draw [red,use as bounding box] (-1.5,-1.5) rectangle
(2.5,2.5);
\draw (0,0) rectangle(2,2);
\draw (0,0) circle (1);
\end{tikzpicture}
text after
text before text after

text before
\begin{tikzpicture}[blue,baseline=0pt]
\draw [red,use as bounding box] (-1.5,-1.5) rectangle
(2.5,2.5);
text before text after \draw (0,0) rectangle(2,2);
\draw (0,0) circle (1);
\end{tikzpicture}
text after

text before
\begin{tikzpicture}[blue,baseline=0pt]
\useasboundingbox (-1.5,-1.5) rectangle (2.5,2.5);
\draw (0,0) rectangle(2,2);
text before text after
\draw (0,0) circle (1);
\end{tikzpicture}
text after

\begin{tikzpicture}[blue]
\fill (0,0) circle (5pt);
\fill (2,1) circle (5pt);
\draw[red] (current bounding box.south west) rectangle (current bounding
box.north east);
\end{tikzpicture}

57
9.5 Clipping the picture
PGFmanual section : 15-9

no clipping \clip (-1,-1) - -(0,2) - - (1,-1) - - cycle;

9.6 Partial clipping


\tikzpicture[red,scale=.7]
\draw[help lines] (-2,-2) grid (2,2);
\draw[blue] (-1.1,-0.2) rectangle (2,1.5);
\draw (0,0) circle (1.5);
\clip (-1.1,-0.2) rectangle (2,1.5);
\draw (0,0) circle (.5);
\draw (0,0) circle (1);
\endtikzpicture

9.6.1 Scaling

Normal size \tikzpicture[blue,scale=.5]

58
10 Scope
10.1 Environment Scope
PGFmanual section : 12-3

\begin{tikzpicture}[line width = 3mm]

\draw (0.5,6) - - (2.5,6);

\scope[red]
\draw (0.5,5) - - (2.5,5);
\draw (0.5,4) - - (2.5,4);
\end{scope}

\draw (0.5,3) - - (2.5,3);

\scope[green]
\draw (0.5,2) - - (2.5,2);
\draw [red] (0.5,1) - - (2.5,1);
\draw (0.5,0) - - (2.5,0);
\end{scope}

\end{tikzpicture}

10.2 library scopes


10.2.1 Shorthand for Scope Environments
PGFmanual section : 12-3-2

Load package : \usetikzlibrary{scopes}

\begin{tikzpicture}[line width = 3mm]

\draw (0.5,6) - - (2.5,6);

{ [red]
\draw (0.5,5) - - (2.5,5);
\draw (0.5,4) - - (2.5,4);
}

\draw (0.5,3) - - (2.5,3);

{ [green]
\draw (0.5,2) - - (2.5,2);
\draw [red] (0.5,1) - - (2.5,1);
\draw (0.5,0) - - (2.5,0);
}

\end{tikzpicture}

59
10.2.2 Single Command Scopes

\node [fill=white] at (1,1) {\DFR}; \node [fill=white] at (1,1) {\DFR};


\scoped [on background layer]
\draw (0,0) grid (3,2); \draw (0,0) grid (3,2);

60
rth west north north east

11 Absolute position on a page

\begin{tikzpicture}[remember picture,overlay]
\fill(current page.north) circle (5pt) node[below left=4mm] \Huge north ;
\fill(current page.north east) circle (5pt) node[below left=4mm] \Huge north east ;
\fill(current page.north west) circle (5pt) node[below right=4mm] \Huge north west ;
\fill(current page.east) circle (5pt) node[above left=4mm] \Huge east ;
\fill(current page.center) circle (5pt) node[above left=4mm] \Hugecenter ;
\fill(current page.west) circle (5pt) node[above right=4mm] \Huge west ;
\fill(current page.south) circle (5pt) node[above right=4mm] \Huge south ;
\fill(current page.south west) circle (5pt) node[above right=4mm] \Huge south west ;
\fill(current page.south east) circle (5pt) node[above left=4mm] \Huge south east ;
\end{tikzpicture}

\begin{tikzpicture}[remember picture,overlay]
\node [opacity=.15] at (current page.center) {\includegraphics[width=8cm]{tiger} };
\end{tikzpicture}

\begin{tikzpicture}[remember picture,overlay]
\draw[dotted,opacity=.4] (current page.south west) - - (current page.north east)
node[near start] {\Huge TIKZ} ;
\end{tikzpicture}

est center east

TIKZ

61

uth west south south east


12 Background
12.1 Framing
1

\begin{tikzpicture}[show background rectangle]


\filldraw[fill=yellow] (0,0) ellipse (1 and .5 );
\end{tikzpicture}

Other syntax :
\begin{tikzpicture}[framed]

12.1.1 Options
[show background rectangle,inner frame xsep=1cm]

inner frame xsep=1cm inner frame ysep=1cm inner frame sep=1cm


By default: inner frame xsep=1ex , inner frame ysep=1ex

tight background loose background rounded corners


(inner frame sep = 0pt) (inner frame sep = 2ex)

12.1.2 Style
[background rectangle/.style={double,draw=blue},framed]

double fill=green top color=green line width=4pt rounded corners=0.5cm

12.2 Partial framing

show background top show background bottom show background left show background right
1 \tikzset{background rectangle/.style={fill=cyan!20,draw=blue,line width=2pt}}

62
[framed,show background top,outer frame xsep=1cm]

outer frame xsep=1cm outer frame ysep=1cm outer frame sep=1cm

12.2.1 Style
\begin{tikzpicture}[show background left,
[background left/.style={double,ultra thick,draw=blue}]

double <-> line width=10pt dashed

12.2.2 Gridding
\begin{tikzpicture}[show background grid]
\filldraw[fill=yellow] (0,0) ellipse (2 and 1);
\end{tikzpicture}

Other syntax :
\begin{tikzpicture}[gridded]

12.2.3 Style
[background grid/.style={ultra thick,draw=blue},show background grid]

ultra thick ,draw=blue,draw=blue draw=red step=.5cm,draw=blue

12.2.4 Framing and gridding

\begin{tikzpicture}[framed , gridded ]
\filldraw[fill=yellow] (0,0) ellipse (2 and 1);
\end{tikzpicture}

63
13 Defining your own colors
13.1 Basic colors

black blue brown cyan darkgray

gray green lightgray lime magenta

olive orange pink purple red

teal violet white yellow

[blue!10] [blue!30] [blue!50] [blue!70] [blue!90]

13.2 Colors mixing

[blue!30!red] [red!80!blue!20] [red!80!blue!50] [red!80!blue!50!black!40]

13.3 Naming a color


PGFmanual section : 15-2

13.3.1 Percentage of red , green and blue


\definecolor{macouleur}{rgb}{.75,0.5,0.25}
(75% de rouge 50% de vert 25% de bleu)
\fill [macouleur] (0,0) rectangle (2,1);

13.3.2 From existing color

\colorlet{monrouge}{red!25}
\fill [monrouge] (0,0) rectangle (2,1);

\colorlet{monviolet}{red!25!blue}
\fill [monviolet] (0,0) rectangle (2,1);

64
14 Opacity
PGFmanual section : 23-2

\draw[red] (0,0) – (2,1); \draw [blue,draw opacity=0] (0,1) - - (2,0);

draw opacity=0 draw opacity=0.25 draw opacity=0.5 draw opacity=0.75 draw opacity=1

\fill[red] (0,0) rectangle (1,1); \fill[blue,transparent] (0.5,0) rectangle (1.5,1);

transparent ultra nearly transparent very nearly transparent nearly transparent

semitransparent nearly opaque very nearly opaque ultra nearly opaque

opaque fill opacity=.25 fill opacity=.5 fill opacity=.75

\node at (1,1) [text opacity=1] { \Huge texte} ;

texte texte texte texte texte


text opacity=1 text opacity=0.75 text opacity=0.5 opacity=0.25 text opacity=0

65
14.1 Blend Modes
PGFmanual section : 23-3

blend group=normal blend group=multiply blend group=screen

blend group=overlay blend group=darken blend group=lighten

blend group=difference blend group=exclusion blend group=hue

blend group=saturation blend group=color blend group=luminosity

Error message Unknow blend mode !

blend group=colordodge blend group=colorburn blend group=hardlight blend group=softlight

66
14.2 Fading
Load package : \usetikzlibrary{fadings}

14.2.1 Preset patterns


PGFmanual section : 51

\fill [blue,path fading=north] (-1,-1) rectangle (1,1);

path fading=north path fading=south path fading=east path fading=west

path fading=circle with fuzzy edge 10 percent path fading=circle with fuzzy edge 15 percent

path fading=circle with fuzzy edge 20 percent path fading=fuzzy ring 15 percent

14.2.2 Own patterns of fading with tikzfadingfrompicture


PGFmanual section : 23-4-1

Creation Visualization
\tikzfadingfrompicture[name=filtre]
\shade[left color=yellow,right color=blue!100] (0,0) rectangle
(2,2);
\fill[blue!50] (1,1) circle (0.7);
\end{tikzfadingfrompicture}
\tikzfadingfrompicture[name=tikz]
\node [draw,text=transparent!20]
{\fontfamily{ptm}\fontsize{25}{25}\bfseries\selectfont
TikZ};
TikZ
\end{tikzfadingfrompicture}

67
Use in a frame
\fill[path fading=filtre] (-2,-1) rectangle (2,1);

TikZ
[path fading=filtre] [path fading=tikz]

TikZ
[path fading=filtre ,fit fading=false] [path fading=tikz,fit fading=false]

TikZ
left color=blue,right color=red [path left color=blue,right color=red

TikZ
[path fading=filtre ,red] [path fading=tikz,red]

Use in an ellipse
\fill[path fading=filtre] (-2,-1) ellipse (2 and 1);

TikZ
[path fading=filtre] [path fading=tikz]

68
14.3 Creating fading patterns with tikzfading
\tikzfading[name=fade right, left color=transparent!0, right
color=transparent!100]

\tikz \filldraw [red,path fading=fade right] (-1,-1) rectan-


gle (1,1);
\tikzfading[name=fade out, inner color=transparent!0, outer
color=transparent!100]

\tikz \filldraw [blue,path fading=fade out] (-1,-1) rectan-


gle (1,1);
\tikzfading[name=fade inside, inner color=transparent!80,
outer color=transparent!10]

\tikz \filldraw [blue,path fading=fade inside] (-1,-1) rect-


angle (1,1);
\tikzfading[name=middle, top color=transparent!80, bottom
color=transparent!80, middle color=transparent!20]

\tikz \filldraw [blue,path fading=middle] (-1,-1) rectangle


(1,1);

14.3.1 Modification of the fading pattern


PGFmanual section : 23-4-2

\fill [blue,path fading=north,fading transform={yshift=-.5cm}] (-1,-1) rectangle (1,1);

fading transform={yshift=-.5cm} fading transform={yshift=-.5cm} fading angle=30

PGFmanual section : 23-4-3

\begin{tikzpicture}
\draw (-1,-1) rectangle (1,1);
\path [scope fading=east] (-1,-1) rectangle (1,1);
\fill[red] ( 90:1) circle (1);
\fill[green] (210:1) circle (1);
\fill[blue] (330:1) circle (1);
\end{tikzpicture}

69
VisualTIKZ VisualTIKZ
VisualTIKZ VisualTIKZ
VisualTIKZ VisualTIKZ
VisualTIKZ VisualTIKZ
\tikz \node [black,scope fading=south,fading VisualTIKZ VisualTIKZ
angle=45,text width=5cm] VisualTIKZ VisualTIKZ
{ VisualTIKZ VisualTIKZ VisualTIKZ Visu- VisualTIKZ
alTIKZ VisualTIKZ VisualTIKZ VisualTIKZ
VisualTIKZ VisualTIKZ VisualTIKZ Visu-
alTIKZ VisualTIKZ VisualTIKZ };

14.4 Transparency Groups


PGFmanual section : 23-5

\begin{tikzpicture}[opacity=.5]
\draw [line width=1cm] (0,0) – (2,2);
\draw [line width=1cm] (0,2) – (2,0);
\end{tikzpicture}

[opacity=.5] [opacity=.5,transparency group]

Not working !
\begin{tikzpicture}
\shade [left color=red,right color=blue] (-2,-1) rect-
angle (2,1);
\begin{scope}[transparency group=knockout]
\fill][white] (-1.9,-.9) rectangle (1.9,.9); TikZ
\node [opacity=0] TikZ;
\end{scope}
\end{tikzpicture}

70
15 Create command
Load package : Warning: the creation of the com-
mand must be placed before \begin{document} !

syntax :\newcommand{\name}[ number of variables]{Description}

Example : command with one variable :


Creation
\newcommand
{\maboite}[1]{ % command named “maboite”with one variable
\begin{center} % centering the box
\tikzpicture \node[fill=yellow % a yellow text box
,text centered % centering the text in the box
,text width=.5\linewidth] % to set the width of the box
#1} ; \end{center} % #1 will be replaced by the variable
}

Utilisation : \maboite{contenu}

Load package : contenu

Example : command without variable :


creation
\newcommand{\DFR}{ \tikzpicture[scale=.25] \draw [fill=blue](0,0) rectangle (3,1.5);
\draw [fill=white](1,0) rectangle (2,1.5); \draw[fill=red](2,0) rectangle (3,1.5);\endtikzpic-
ture }
Utilisation : \DFR

71
16 Creating styles
16.1 Styles without variable

\begin{tikzpicture} [mon style/.style={draw=blue,


fill=red!20, very thick}]
\draw (0,0) circle (2cm);
\draw[mon style] (0,0) circle (1cm);
\end{tikzpicture}

16.2 Styles with variable


\begin{tikzpicture} [mon style/.style={draw=#1, thick, fill=#1!50,
scale=.5}]
\filldraw [mon style=red] (0,0) rectangle (2,1);
\filldraw [mon style=blue] (3,0) rectangle (5,1);
\end{tikzpicture}

With a default value


\begin{tikzpicture} [mon style/.style={draw=#1,fill=#1!20,very
thick},
mon style/default=black]
\filldraw [mon style] (0,0) rectangle (2,1);
\filldraw [mon style=blue] (3,0) rectangle (5,1);
\end{tikzpicture}

72
17 Text highlighting
17.1 In a TikZ node
\tikz \draw (0,0) grid (2,2) (1,1) node[fill=red!20,] {texte};

texte texte texte texte

node[fill=red!20] node[fill=red!20,draw] node[fill=red!20,circle] node[fill=red!20,circle,draw]

17.1.1 Options
\tikz \draw node[draw,double,blue] {texte};

te
x
texte texte texte texte texte texte texte

te
double rounded corners ultra thick dashed red rotate=45 shading=radial text=red

\tikz \draw node[draw,inner sep=0pt] {texte};

texte texte

texte texte
inner sep=0pt inner sep=1cm inner xsep=1cm inner ysep=1cm
By default : 0.3333em

\node [fill=red!20,outer sep=1cm] (A) at (1,1) {texte};


\fill (node cs:name=A,anchor=east) circle (3pt);
\fill (node cs:name=A,anchor=south) circle (3pt);

texte texte
texte texte

outer sep=1cm outer sep=0pt outer xsep=1cm outer ysep=1cm


By default : 0.5\pgflinewidth

17.1.2 Minimum size


\draw((0,0) node[fill=blue!20,minimum height=1.5cm,draw] {texte} ;

texte
texte
minimum height=1.5cm minimum width=3cm

texte texte

minimum size=1.5cm,draw minimum size=1.5cm,circle

73
17.2 Geometric Shapes nodes
Load package : \usetikzlibrary{shapes.geometric}

PGFmanual section : 67-3

17.2.1 Available shapes


2 syntaxes :
\tikz \node[fill=green!20,shape=diamond,draw,blue] {texte};
\tikz \node[fill=green!20,diamond,draw] {texte};

texte
texte texte texte
diamond ellipse trapezium semicircle

texte
texte texte texte

star regular polygon isosceles triangle kite

texte texte
texte
dart circular sector cylinder

17.2.2 Options
\node [trapezium,draw,trapezium left angle=90,draw,blue] {texte};
texte texte texte
trapezium left angle=90 trapezium right angle=90 trapezium angle=120

texte texte
texte

minimum height=1.5cm minimum height=1.5cm minimum width=1.5cm


trapezium stretches=true trapezium stretches=false trapezium stretches

74
\tikz \node [fill=green!20,star,star points=6,draw] {texte};

texte
texte

texte

star points=7 star point height = 2cm star point ratio = 3


By default5 By default.5cm By default1.5

\node [isosceles triangle,isosceles triangle apex angle=90,draw,blue] {texte};


\node [regular polygon, regular polygon sides=6,draw,blue] {texte};

texte
texte texte

isosceles triangle apex angle=90 isosceles triangle stretches regular polygon sides=6

\node [kite,kite upper vertex angle=90,draw,blue] {texte};

texte texte texte

kite upper vertex angle=90 kite lower vertex angle=90 kite vertex angles=90
initially 120 initially 60

\node [dart,dart tip angle=90,draw,blue] {texte};

texte
texte
texte

dart tip angle=90 dart tail angle=90 circular sector angle=90


initially 45 initially 135 initially 60

75
\node [cylinder,aspect=2,draw,blue] {texte};
texte texte
aspect=2 aspect=4
texte texte
cylinder uses custom fill, cylinder uses custom fill,
cylinder end fill=yellow cylinder body fill=yellow

\draw(0,0) node[shape aspect=1,diamond,draw] {texte} ;

texte
texte texte texte
shape aspect=1 shape aspect=2 shape aspect=3 shape aspect=4

76
17.3 Symbol Shapes nodes
Load package : \usetikzlibrary{shapes.symbols}

PGFmanual section : 67-4

17.3.1 Available shapes

texte texte
texte

forbidden sign magnifying glass cloud

texte
texte
texte
starburst signal tape

17.3.2 Options
\node[magnifying glass,magnifying glass handle angle=45,draw,blue] {texte} ;

texte
texte
texte

magnifying glass handle angle=45 magnifying glass handle aspect=3 line width=1ex
By default : -45 By default : 1.5

\node [cloud,cloud puffs=5,draw,blue] {texte};

texte
texte texte texte

cloud puffs=5 cloud puff arc=270 cloud ignores aspect=false cloud ignores aspect=true
By default: 10 By default: 135 By default: true

\node [starburst,starburst points=5,draw,blue] {texte};

texte
texte texte
texte

starburst points=5 starburst point height=1cm random starburst=50 random starburst=0

77
\node [signal,signal pointer angle=45,draw,blue] {texte};
texte texte texte
signal pointer angle=45 signal pointer angle=10 signal pointer angle=300
By default : signal pointer angle= 90

\node [signal,signal to=above,draw,blue] {texte};


texte
texte texte texte
signal to=above signal to=below signal to=right signal to=above

\tikz [signal to=nowhere] \node [signal,signal from=above=45,draw,blue] {texte};


texte
texte texte texte
signal from=above signal from=below signal from=right signal from=above

texte
texte
signal from=east , signal to=west signal from=south, signal to=north

\tikz \node [tape, draw,tape bend top=out and in] {texte};


texte texte
texte
tape bend top=out and in tape bend bottom=out and in tape bend bottom=in and in
texte texte texte

tape bend top=none tape bend bottom=out and in tape bend bottom=in and out
tape bend top=out and in tape bend top=in and out
(By default )

\tikz \node [tape, draw, tape bend height=1cm,blue] {texte};

texte

By default : tape bend height = 5pt

78
17.4 Arrow Shapes nodes
Load package : \usetikzlibrary{shapes.arrows}

PGFmanual section : 67-5

17.4.1 Available shapes

texte
texte texte

single arrow double arrow arrow box

17.4.2 Options
\node[single arrow,draw,single arrow tip angle=45] {texte};
\node[single arrow,draw,single arrow head extend=.75cm] {texte};

texte
texte texte texte texte

angle=45 angle=120 extend=.75cm] extend=0cm extend=-1mm


By default: single arrow tip angle= 90 By default: single arrow head extend=0.5cm

\node[minimum size=2cm,single arrow,draw,single arrow head indent=1cm,blue] {texte};

texte texte texte texte

indent=1cm indent=10pt indent=1ex indent=-1ex

\node[minimum size=2cm,double arrow,draw,double arrow tip angle=45] {texte};


\node[minimum size=2cm,double arrow,draw,double arrow head extend=1ex] {texte};
\node[minimum size=2cm,double arrow,draw,double arrow head indent=1ex] {texte};

texte texte texte texte texte

angle=45 angle=120 extend=1ex extend=0 indent=1ex

\node [arrow box, draw, arrow box arrows={north:.25cm}] {texte};

texte texte texte texte

{north:.25cm} {west:.25cm} {south:.25cm} {east:.25cm}


By default : 0.5 cm

79
\node [arrow box, draw, arrow box tip angle=45] {texte};

texte texte

arrow box tip angle=45 arrow box head extend=.25cm


By default: 90 By default: 0.125cm

texte texte

arrow box head indent=.25cm arrow box shaft width=.25cm


By default : 0cm By default : 0.125cm

80
17.5 Callout Shapes nodes
Load package : \usetikzlibrary{shapes.callouts}

PGFmanual section : 67-7

17.5.1 Available shapes

texte
texte texte

ellipse callout rectangle callout cloud callout

17.5.2 Options
\node [rectangle callout,draw,callout absolute pointer=(0,1)] at (2,1) {texte};

texte texte texte texte

callout relative pointer={(0,1)} callout absolute pointer={(0,1)}

texte texte texte texte

callout pointer shorten=.5cm

\node [ellipse callout,draw,callout pointer arc=1] at (0,1.5) {texte};


texte texte texte

callout pointer arc=1 callout pointer arc=30 callout pointer arc=90


By default : callout pointer arc=15

\node[draw,cloud callout, aspect=2.5] {texte};

texte texte texte

cloud puffs=5 aspect=2.5 cloud puff arc=120

81
\node [draw,cloud callout,callout pointer start size=.1] {texte};

texte texte texte

callout pointer start size=.1 start size=.8cm start size=20pt and 1pt
By default : callout pointer start size =.2 of callout

texte
texte texte

callout pointer end size=.5 callout pointer end size=.8cm callout pointer segments=3
By default : callout pointer start size = .1 of callout By default : segments=2

82
17.6 Miscellaneous Shapes nodes
Load package : \usetikzlibrary{shapes.misc}

PGFmanual section : 67-8

17.6.1 Available shapes

texte texte texte texte


cross out strike out rounded rectangle chamfered rectangle

17.6.2 Options
Options for “rounded rectangle” :
\node [draw, rounded rectangle,rounded rectangle arc length=270] {texte};
texte texte texte texte texte
270 180 120 90 45

\node [draw, rounded rectangle,rounded rectangle west arc=concave] {texte};


\node [draw, rounded rectangle,rounded rectangle left arc=concave] {texte};
texte texte texte texte
concave convex none

\node [draw, rounded rectangle,rounded rectangle east arc=concave] {texte};


\node [draw, rounded rectangle,rounded rectangle right arc=concave] {texte};
texte texte texte
concave convex none

Options for “chamfered rectangle” :


\node [draw, chamfered rectangle,chamfered rectangle angle=30] {texte};
texte texte texte texte
10 30 60 80
By default: 45

\node [draw, chamfered rectangle,chamfered rectangle xsep=10pt] {texte};

texte
texte texte texte texte
xsep=0pt xsep=5pt xsep=10pt xsep=-10pt xsep=2cm
By default: 0.666ex

\node [draw, chamfered rectangle,chamfered rectangle ysep=10pt] {texte};

texte
texte texte
texte texte
ysep=0pt ysep=5pt ysep=10pt ysep=-10pt ysep=1cm

83
\node [draw, chamfered rectangle,chamfered rectangle ysep=10pt] {texte};

texte texte
texte texte
texte
sep=0pt sep=5pt sep=10pt sep=-10pt sep=1cm

\node [draw, chamfered rectangle,chamfered rectangle corners=north west] {texte};


texte texte texte
north west {north east, south east} {north east, south west}

84
17.7 Shapes with Multiple Text Parts
Load package : \usetikzlibrary{shapes.multipart}

PGFmanual section : 67-6

\node [circle split,draw,fill=green!20]{haut \nodepart{lower} bas };

haut haut
haut texte haut
bas
bas texte bas

circle split circle solidus ellipse split rectangle split

\node[rectangle split,rectangle split parts=5,


texte 1 draw]
texte 2 {texte 1
\nodepart{second} texte 2
texte 3 \nodepart{four} texte 3};

By default: rectangle split parts=4

\node [rectangle split,rectangle split parts=3,rectangle split horizontal,draw,blue]


{texte1\nodepart{two}texte2\nodepart{three}texte3};
texte 1 texte 2 texte 3

\node[rectangle split,rectangle split parts=5,


texte 1
draw]
texte 2a {texte 1
texte 2b \nodepart{second} texte 2a \\texte 2b \\
texte 2c texte 2c
texte 3a \nodepart{three} texte 3a \\ texte 3b };
texte 3b

\node[rectangle split, draw,blue,minimum size = 2cm,rectangle split draw splits= true]


{texte 1 \nodepart{two} texte 2 \nodepart{three} texte 3 \nodepart{four} texte 4};
texte 1 texte 1
texte 2 texte 2
texte 3 texte 3
texte 4 texte 4
rectangle split draw splits= true rectangle split draw splits= false
By default

\node [rectangle split,rectangle split parts=3,draw,rectangle split ignore empty parts=false]


{texte 1 \nodepart{second} \nodepart{third}texte 3};
texte 1
texte 1
texte 3 texte 3
rectangle split ignore empty parts=false rectangle split ignore empty parts=true

85
\node [rectangle split,rectangle split parts=3,draw,rectangle split empty part depth=1cm]
{texte 1 \nodepart{second} \nodepart{third}texte 3};
texte 1 texte 1

texte 3 texte 3
rectangle split empty part depth=1cm text depth=1cm
By default: 0ex By default: 0ex
texte 1

texte 1

texte 3 texte 3
rectangle split empty part height=1cm text height=1cm
By default: 1ex By default: 1ex

\node [rectangle split,rectangle split parts=3,draw,rectangle split empty part width=1cm] {};

rectangle split empty part width=2cm By default: 1ex

\node[rectangle split, draw,blue,minimum


texte 1 size = 2cm,
texte 2 rectangle split part align={center, left,right}]
texte 3 {texte 1 \nodepart{two} texte 2
\nodepart{three} texte 3 \nodepart{four}
texte 4
texte 4};
\node[rectangle split, draw,blue,minimum
size = 2cm,
texte 3 rectangle split horizontal,
rectangle split part align={center,base,
texte 1 texte 2 top,bottom}]
{texte 1 \nodepart{two} texte 2
texte 4 \nodepart{three} texte 3 \nodepart{four}
texte 4};

\node[rectangle split, draw,blue, minimum width=1cm,


rectangle split part fill={red, green,cyan}]{};

86
17.8 Text attributes
17.8.1 Position
PGFmanual section : 17-4-3

\tikz \draw (0,0) node[fill=blue!10,text width=2cm,text justified]


{Ceci est une démonstration d’un texte sur une largeur de 2cm};
Ceci est Ceci Ceci est
une dé- Ceci est est une une dé-
monstra- une dé- démon- monstra-
tion d’un monstra- stration tion d’un
texte tion d’un d’un texte texte
sur une texte sur sur une sur une
largeur de une largeur largeur largeur de
2cm. de 2cm de 2cm . 2cm .
without option text justified text centered text ragged
Ceci est Ceci est Ceci Ceci est
une une est une une
démonstra- démonstra- démon- démonstra-
tion d’un tion d’un stration tion d’un
texte sur texte sur d’un texte texte sur
une une sur une une
largeur de largeur de largeur largeur de
2cm. 2cm . de 2cm . 2cm .
text badly ragged text badly centered align=center align=flush center
Ceci est Ceci est Ceci est
Ceci est une une dé- une
une dé- démonstra- monstra- démonstra-
monstra- tion d’un tion d’un tion d’un
tion d’un texte sur texte texte sur
texte sur une sur une une
une largeur largeur de largeur largeur de
de 2cm . 2cm . de 2cm . 2cm .
align=justify align=flush right align=right align=flush left

17.8.2 Colors and Fonts


Texte. Texte. Texte. Texte. Texte. Texte.
[text= red] [font=\itshape] [font=\slshape] [font=\scshape] [font=\upshape] [font=\bfseries]

17.8.3 Font Sizes


\tikz \draw (0,0) node[font=\tiny]{Texte.}

Texte. Texte. Texte. Texte. Texte. Texte. Texte.


\tiny \footnotesize \small \large \Large \huge \Huge

PGFmanual section : 17-4-4

87
Texte.

Texte.
text height=1cm text depth=1cm

17.9 Positions on a node


17.9.1 For all types of node
PGFmanual section : 17-5-1

texte texte texte texte


north west north north east text

texte texte texte texte


west mid west base west base

texte texte texte texte


east mid esat base east mid

texte texte texte texte


south east south south west center

texte texte texte

0 120 -60

88
17.9.2 Specific to a node
In a future version

18 Decorations
18.1 Library “decorations.pathmorphing”
PGFmanual section : 48-2

18.1.1 “lineto”

(0,0) - - (2,2) (1,1) circle (1) (0,0) arc (0:180:3 and 2)

18.1.2 “straight zigzag”


\draw[decorate,decoration=straight zigzag ] (0,0) - - (2,2) ;

(0,0) - - (2,2) (1,1) circle (1) (0,0) arc (0:180:3 and 2);

\draw[decorate,decoration={straight zigzag,meta-segment length=2cm}] (0,0) - - (10,0); By default


meta-segment length=2cm 1cm

amplitude=0.5cm 2.5pt

segment length=1cm 10pt

\draw[decorate,decoration=
{straight zigzag,meta-segment length=0.5cm}] (1,1) circle (1);

meta-segment length=2cm amplitude=0.5cm segment length=5pt

89
18.1.3 “random steps”
\draw[decorate,decoration=random steps ] (0,0) - - (2,2) ;

(0,0) – (2,2) (1,1) circle (1) (0,0) arc (0:180:3 and 2)

\draw[decorate,decoration={random steps,segment length=2cm}] (0,0) - - (10,0); By default


segment length=2pt 10pt

segment length=1cm

amplitude=0.5cm 2.5pt

amplitude=0.5cm
,segment length=1cm

\draw[decorate,decoration= {random steps,segment length=2cm}] (1,1) circle (1);

meta-segment length=2cm amplitude=0.5cm segment length=5pt

18.1.4 “saw”
\draw[decorate,decoration=saw ] (0,0) - - (2,2) ;

(0,0) - - (2,2) (1,1) circle (1) (0,0) arc (0:180:3 and 2);

\draw[decorate,decoration={saw,meta-segment length=0.5cm}] (0,0) - - (10,0); By default


segment length=0.5cm 10 pt

segment length=2cm

amplitude=0.5cm 2.5 pt

90
\draw[decorate,decoration={saw,segment length=20pt}] (1,1) circle (1);

segment length=20pt segment length=5pt amplitude=0.5cm

18.1.5 “zigzag”
\draw[decorate,decoration=zigzag ] (0,0) - - (2,2) ;

(0,0) - - (2,2) (1,1) circle (1) (0,0) arc (0:180:3 and 2);

\draw[decorate,decoration={zigzag,meta-segment length=2cm}] (0,0) - - (10,0); By default


segment length=0.5cm 10pt

segment length=2cm

amplitude=0.5cm 2.5 pt

\draw[decorate,decoration= {saw,segment length=20pt }] (1,1) circle (1);

segment length=20pt segment length=5pt amplitude=0.5cm

18.1.6 “bent”

(0,0) - - (2,2) (1,1) circle (1) (0,0) arc (0:180:3 and 2);

91
\draw[decorate,decoration={bent,amplitude=0.5cm}] (0,0) – (10,0); By default
amplitude=0.5cm 2.5 pt

aspect=0.1 (en bleue)


aspect=0.9 (en vert) 0.5
amplitude=0.5cm

amplitude=1cm amplitude=0.5cm aspect=0.25

18.1.7 “bumps”
\draw[decorate,decoration=bumps ] (0,0) - - (2,2) ;

(0,0) - - (2,2) (1,1) circle (1) (0,0) arc (0:180:3 and 2)

\draw[decorate,decoration={bumps,amplitude=0.5cm}] (0,0) - - (10,0); By default


amplitude=0.5cm 2.5 pt

segment length=1cm 10 pt

\draw[decorate,decoration= {bumps,amplitude=10pt}] (1,1) circle (1);

amplitude=10pt amplitude=0.5cm segment length=20pt

18.1.8 “coil”
\draw[decorate,decoration=coil ] (0,0) - - (2,2) ;

(0,0) - - (2,2) (1,1) circle (1) (0,0) arc (0:180:3 and 2)

92
\draw[decorate,decoration={coil,amplitude=0.5cm}] (0,0) - - (10,0); By default
amplitude=0.5cm 2.5 pt

segment length=1cm 10 pt

aspect=0.1
(amplitude=0.5cm)

aspect=0.3 0.5

aspect=0.9

\draw[decorate,decoration= {coil,amplitude=0.5cm}] (1,1) circle (1);

amplitude=0.5 cm segment length=1cm aspect=0.25


amplitude=0.5cm amplitude=0.5cm

18.1.9 “curveto”

(0,0) - - (2,2) (1,1) circle (1) (0,0) arc (0:180:3 and 2)

18.1.10 “snake”
\draw[decorate,decoration=snake ] (0,0) - - (2,2) ;

(0,0) - - (2,2) (1,1) circle (1) (0,0) arc (0:180:3 and 2)

\draw[decorate,decoration={snake,segment length=2cm}] (0,0) - - (10,0); By default


amplitude=0.5cm 2.5 pt

segment length=1cm 10 pt

93
\draw[decorate,decoration= snake, amplitude=5pt] (1,1) circle (1);

amplitude=5pt amplitude=0.5cm segment length=5pt

94
18.2 Library “decorations.pathreplacing”
Load package : \usetikzlibrary{decorations.pathreplacing}

PGFmanual section : 48-3

18.2.1 “border”
\draw[decorate,decoration=border ] (0,0) - - (2,2) ;

(0,0) - - (2,2) (1,1) circle (1) (0,0) arc (0:180:3 and 2)

\draw[decorate,decoration={border,amplitude=0.5cm}] (0,0) - - (10,0); By default


amplitude=0.5cm 2.5 pt

segment length=1cm ,
10 pt
amplitude=0.5cm

angle=90 ,
45
amplitude=0.5cm

\draw[decorate,decoration= {border,amplitude=0.5cm}] (1,1) circle (1);

amplitude=0.5cm segment length=1cm angle=90


,amplitude=0.5cm ,amplitude=0.5cm

18.2.2 “brace”
\draw [decorate,decoration=brace ] (0,0) - - (3,1);

\draw[decorate,decoration= {brace,amplitude=0.5cm}] (1,1) circle (1); ;

amplitude=0.5cm aspect=0.65 raise= 0.25cm mirror


,amplitude = 0.5cm ,amplitude = 0.5cm ,amplitude = 0.5cm
By default: 2.5 By default: 0.5 By default: 0

95
18.2.3 ”expanding waves”

\draw [dashed,red](0,0) - - (20:2) ;


\draw [dashed,red](0,0) - - (-20:2) ;
\draw [decorate,decoration={expanding waves}](0,0) - -
(2,0) ;

\draw[decorate,decoration= {expanding waves,segment length=0.5cm}] (1,1) circle (1);

segment length=0.5cm angle=45


By default: 10pt By default: 20

18.2.4 “moveto”
see page 113

18.2.5 “ticks”
\draw[decorate,decoration=ticks ] (0,0) - - (2,2) ;

(0,0) - - (2,2) (1,1) circle (1) (0,0) arc (0:180:3 and 2)

\draw[decorate,decoration={ticks,amplitude=0.5cm}] (0,0) - - (10,0); By default

amplitude=0.5cm 2.5 pt

segment length=1cm 10 pt

\draw[decorate,decoration= {ticks,segment length=1cm}] (1,1) circle (1);

segment length=1cm segment length=pi*8 amplitude=0.5cm


(1,1) circle (1) (1,1) circle (32pt) (1,1) circle (1)

96
18.2.6 ”waves”
\draw[decorate,decoration=waves ] (0,0) - - (2,2) ;

(0,0) - - (2,2) (1,1) circle (1) (0,0) arc (0:180:3 and 2)

\draw[decorate,decoration={waves,angle=60,radius=1cm}] (0,0) - - (10,0); By default

angle=60 45

segment length=1cm 10 pt

radius=2cm 10 pt

\draw[decorate,decoration= {waves,segment length=pi*8,


radius=1cm}] (1,1) circle (32pt);

segment length = pi*8 angle=60 radius=2cm


, segment length = pi*8 , segment length = pi*8

97
18.2.7 “show path construction”
path to decorate
\draw [blue,dashed] (0,0) - - (2,1) arc (-20:135:1) - - cycle
(3,2) .. controls (7,0) and (2,0) .. (5,2) - - (6,2) sin (7.57,0) - - (8,3) ;

Linear components : “lineto”


decoration={ show path construction,
lineto code={ \draw [red,ultra thick,->]
(\tikzinputsegmentfirst) - - (\tikzinputsegmentlast); },}

Path terminations : “closepath”


decoration={ show path construction,
closepath code={ \draw [red,ultra thick,->]
(\tikzinputsegmentfirst) - - (\tikzinputsegmentlast); },}

Broken paths : “moveto”


decoration={ show path construction,
moveto code={ \draw [red,ultra thick,->]
(\tikzinputsegmentfirst) - - (\tikzinputsegmentlast); },}

98
Curved segments : “curveto”
decoration={ show path construction,
curveto code={ \draw [red,ultra thick,->]
(\tikzinputsegmentfirst) - - (\tikzinputsegmentlast); },}

decoration={ show path construction,


curveto code={ \draw [red,ultra thick,->]
(\tikzinputsegmentfirst) - - (\tikzinputsegmentsupporta); },}

decoration={ show path construction,


curveto code={ \draw [red,ultra thick,->]
(\tikzinputsegmentlast) - - (\tikzinputsegmentsupportb); },}

decoration={ show path construction,


curveto code={ \draw [red,ultra thick,->]
(\tikzinputsegmentfirst) .. controls (\tikzinputsegmentsupporta)
and (\tikzinputsegmentsupportb) .. (\tikzinputsegmentlast) ; },}

.. controls (7,0) and (2,0) .. (5,2) don’t work !

99
18.3 Library “decorations.markings”
Load package : \usetikzlibrary{decorations.markings}

PGFmanual section : 48-4

18.3.1 Personal mark at one position


\draw [decorate,decoration={markings,mark=at position 1cm
with { \draw[red] (-2pt,-2pt) - - (2pt,2pt); \draw[red](2pt,-2pt) - - (-2pt,2pt);
\draw[red] (-2pt,-2pt) rectangle (2pt,2pt); }}] (1,1) circle (1);

18.3.2 Marks between positions with step size


\draw[decorate,{markings,mark=between positions 0 and 1 step 5mm with ... }] (1,1) circle (1);;

mark=between positions 0 and 1 step 5mm between positions 0 and 0.5 step 5mm

mark= between positions 0 and 1 step 1/10 between positions 0 and 1 step0.1

18.3.3 Marks with a text node


decoration={markings,mark=at position 1cm with \node[red]{texte}}
texte

texte

texte
at position 1cm at position 0.5 at position -1cm
texte
texte

texte
at position 1cm/2 at position 0.5/2 at position -0.5/2

100
18.3.4 Mark with a picture node
\draw [decorate,decoration={markings,mark=at position 1cm with \node{\DFR}; }] (1,1) circle (1);

\node{\DFR} \node[transform shape]{\DFR}

\node{ \node[transform shape]{


\includegraphics[width=0.5cm]{tiger} } \includegraphics[width=0.5cm]{tiger} }

18.3.5 Numbered marks

3 4 decoration={markings,
5 mark=between positions 0 and 1 step 0.2
2
with { \node [draw , circle ,fill=white, name=
marque-\pgfkeysvalueof{/pgf/decoration/mark info/sequence
number},
1

transform shape]
{\pgfkeysvalueof{/pgf/decoration/mark info/sequence num-
ber}};}}
3 4
2 5

\draw [red,ultra thick] (marque-3) - - (marque-5);


1

18.3.6 Marks info


120.0pt
80.0pt
160.0pt

40.0pt

200.0pt

0.0pt

decoration={markings,
mark=between positions 0 and 1 step 40pt with
{ \node [red,draw,ellipse,fill=white,font=\tiny]
{\pgfkeysvalueof{/pgf/decoration/mark info/distance from start} };} }

/pgf/decoration/reset marks (no value)


/pgf/decoration/mark connection node=node name (no default, initially empty)

101
18.3.7 Mark with a connection node
\draw [decorate,decoration={markings,
mark connection node=mon noeud,mark=at position 0.4 with
e {\node [draw,ellipse,blue,transform shape] (mon noeud)
xt
te {texte};}}]
(0,0) – (3,2) ;

18.3.8 Arrow Tip Markings


\draw[decorate,decoration={ markings,mark=at position 1cm with
{\arrow[blue,line width=2mm]{>}};}] (1,1) circle (1);

{>} {stealth } {|} {diamond}


Other possibilities see page 20

\draw[decorate,decoration={markings,mark=at position 1cm with


{\arrowreversed[blue,line width=2mm]{>}};}] (1,1) circle (1);

{>} {stealth } {|} {diamond}

102
18.4 Library “decorations.footprints”
Load package : \usetikzlibrary{decorations.footprints}

PGFmanual section : 48-5-2

\tikz \draw[decorate,decoration=footprints ] (0,0) – (10,0);

\draw[decorate,decoration={footprints,foot of = gnome }] (0,2.5) - - (3,2.5);

foot of = gnome foot of = human foot of = bird foot of = felis silvestris


(By default)

\fill[decorate,decoration={footprints,foot of = gnome}] (0,2.5) - - (3,2.5);

foot of = gnome foot of = human foot of = bird foot of = felis silvestris

\fill[decorate,decoration={footprints,foot length=20pt}] (0,2.5) - - (3,2.5);

foot length=1cm stride length=2cm


By default : 10pt By default : 30pt

foot sep=1cm foot angle = 45


By default : 4pt By default : 10

\fill[decorate,decoration={footprints,foot length=20pt}] (0,2.5) - - (3,2.5);

foot length=20pt foot length=1cm stride length=15pt stride length=2cm


By default : foot length=10pt By default : stride length=30pt

foot sep=10pt foot sep=1cm foot angle = -45 foot angle = 45


By default : foot sep=4pt By default : foot angle=10
——————————

103
18.5 Library “decorations.shapes”
18.5.1 Introduction

Load package : \usetikzlibrary{decorations.shapes}

PGFmanual section : 48-5-3

\draw[decorate,decoration=crosses ] (0,0) - - (3,0);

crosses triangles shape backgrounds

\draw[decorate,decoration={crosses,segment length=1cm}](0,0) - - (10,0);


segment length = 1cm
shape width = 1cm

shape height = 1cm

shape size = 1cm


By default: shape width = shape height = 2.5pt

18.5.2 “shape backgrounds”


\draw[decorate with=dart] (0,2.5) - - (3,2.5);

dart diamond rectangle circle

star regular polygon signal kite


Other possibilities or parameters see from page 74

Shapes available
Syntax \draw[decorate,decoration={ shape backgrounds,shape=dart,
shape size=.5cm,shape sep=1cm}] (0,0) - - (10,0);
Other syntax \draw[decorate with=dart,decoration={shape size=.5cm,shape sep=1cm}]
(0,0) – (10,0);

dart
rectangle
cloud
star
starburst
tape
kite
signal
By default: shape= circle
Other possibilities see page 74

104
Parameters
\draw[decorate with=star,star points=3,decoration={shape size=.5cm,shape sep=1cm}]
(0,2.5) - - (3,2.5);

star points=3 star points=4 star points=5 star points=8


\draw[decorate with=star,paint=green,decoration={shape size=.5cm,shape sep=1cm}]

(0,2.5) - - (3,2.5);

paint=green double ultra thick star point ratio = 3

Spacing
\draw[decorate with=dart,decoration={shape size=.5cm,
shape sep=1cm}] (0,2.5) - - (10,2.5);
shape sep={1cm}
shape sep={2cm}
By default: shape sep= 0.25cm

Type of spacing
\draw[decorate with=dart,decoration={shape size=.5cm,
shape sep={1cm,between centers}}] (0,2.5) - - (10,2.5);
between centers
between borders
By default: between centers

Automatic spacing
\draw[decorate with=dart,decoration={shape size=.5cm,
shape evenly spread=5}] (0,0) - - (10,0);
shape evenly spread=5
shape evenly spread=10

Orientation :
” shape border rotate “
shape border rotate=90
shape border rotate=45
shape border rotate=180

“shape sloped”
\draw[decorate with=dart,decoration={shape width=.5cm,shape sep=1cm,
shape sloped=true }] (0,0) - - (3,3);

shape sloped=true shape sloped=false


By default: shape sloped=true

105
\draw[decorate with=dart,decoration={shape width=.5cm,shape sep=1cm,
shape sloped=true}] (0,0) arc (0:180:3 and 2);

shape sloped=true shape sloped=false


By default: shape sloped=true

\draw[decorate with=dart,decoration={shape width=.5cm,shape sep=1cm,


shape border rotate=90,shape sloped=true }] (0,0) - - (3,3);

shape sloped=true shape sloped=false

“shift only”
decoration= transform={shift only},shape width=5mm,segment length=.5cm,shape sep=1cm

avec sans

Dimensions
\draw[decorate with=dart,decoration={shape size=.5cm,
shape height= 1cm }] (0,0) - - (10,0);
shape height=1cm

shape width=1cm
shape size=1cm

106
\draw[decorate with=dart,decoration={shape size=.5cm,
shape start size=1cm,shape scaled }] (0,2.5) - - (10,2.5);

shape start size=1cm

shape start height=1cm


shape start width=1cm

shape end size=1cm

shape end height=1cm


shape end width=1cm

107
18.6 Library “decorations.text”
Load package : \usetikzlibrary{decorations.text}

PGFmanual section : 48-6

\draw[decorate,decoration={text along path,text={texte}}] (1,1) circle (1);


e

text
Text too long
\draw[decorate,decoration={text along path,
text={Un Deux Trois Quatre Cinq Six sept Huit Neuf Dix}}] (1,1) circle (1);
eux Tro
D
is

sepUn
Quatr

e
Cinq Si
x

Text format
\draw [decorate,decoration={text along path, text=avant |\red | texte | | après }]
tt
ex t e a e e e e e ee
ee e
n
pr

ee

ee text

text
ava
ès

e e e e ee

ee
ee

e e e e ee e
text={avant |\red|texte|| après } text={ |\red|texte|| } text={ |\red|texte|| {} }
texte
t
texte a
t
te t
x te
n

n
ap

pr
ava

ava

ava
ès
r ès

apr s
è
avant | \red| texte || après avant | \it| texte || après avant | \Huge| texte || après

\draw [decorate,decoration={text along path,


text={avant |\Large|Visual |+\bf\color{red}|Tikz|| après }}] (1,1) circle (1);
V is u t
al

n
ava
Tikz

ap r ès

\draw [decorate,decoration={text along path,text format delimiters={[}{]},


text={ [ \red ] texte [ ] }}] (1,1) circle (1);
e
t
te x

108
Text orientation
\draw[decorate,decoration={text along path,text={texte},
text color=blue, reverse path }] (1,1) circle (1);
e

text
text
e

Text position
\draw[decorate,decoration={ text along path,text={texte},
text align={align=left}}] (1,1) circle (1);
e
text

texte

te
ex
t
align={align=left } align={align=center } align={align=right }

\draw[ decorate,decoration={text along path,text={texte},


text align={align=left,left indent=1cm} } ] (1,1) circle (1);
texte

texte
align={align=left,left indent=1cm} align={align=right,right indent=1cm}
Fit to path
\draw [decoration={text along path, text={Un deux trois quatre },
text align={fit to path}}, decorate] (1,1) circle (1);
deux
eU n
troi

s
tr

qua
Fit to path stretching spaces
\draw [decoration={text along path, text={Un deux trois quatre },
text align={fit to path stretching spaces}}, decorate] (1,1) circle (1);
de ux
reUn
tr o

is
at

qu

109
18.7 Library “decorations.fractals”
Load package : \usetikzlibrary{decorations.fractals}

PGFmanual section : 48-7

\draw[decorate,decoration=Koch curve type 1] (0,0) - - (3,0);

Koch curve type 1 Koch curve type 2 Koch snowflake Cantor set

\begin{tikzpicture}[decoration=Koch curve type 1]


\draw decorate { decorate { (0,0) – (3,0) }};
\end{tikzpicture}

Koch curve type 1 Koch curve type 2 Koch snowflake Cantor set

\draw decorate { decorate { decorate { (0,0) - - (3,0) } } };

Koch curve type 1 Koch curve type 2 Koch snowflake Cantor set

sans 1 decorate 2 decorate 3 decorate

110
18.8 Applications
18.8.1 Node decoration
\node [draw,decorate,decoration={bumps, minimum height=2cm, minimum width=3cm}] {texte};

texte
texte

decoration=bumps decoration=footprints

texte Texte

decoration={random steps , amplitude = 1pt } starburst,decoration={random steps,


segment length=3pt , amplitude=2pt}
Trois Q
eux u D

at

NUn
Texte texte

re Ci
nq
Six Sept Hu

it
ellipse,decoration=zigzag decoration= {text along path,text=
{Un Deux Trois Quatre Cinq Six Sept Huit Neuf} }

18.8.2 Node link decoration


\draw [decorate,decoration=snake](A) – (B);
B B B

A A A
decoration=snake decoration=coil decoration=footprints
(A)- - (B) (A) |- (B) (A) -| (B)

B B B

A A A
decoration=coil decoration=zigzag decoration=ticks
(A) to [bend right] (B) (A) to[bend left=120] (B) (A) to[out=30] (B)

111
18.8.3 Graph decoration
\draw[ decorate,decoration=footprints] plot coordinates (0,0) (2,1) (4,-2) (6,1) ;

plot coordinates (0,0) (2,1) (4,-2) (6,1) plot (\x,{sin(\x r)})

18.8.4 Various decoration


\draw [decorate, decoration={zigzag,pre=footprints,pre length=5cm}](0,0) – (10,0);

decoration={zigzag,pre=footprints,pre length=5cm}

decoration={zigzag,post=footprints,post length=5cm}

decoration={zigzag,pre=footprints,pre length=3cm, ,post=expanding waves,post length=3cm}

18.8.5 Partial decoration

\draw [decorate,decoration=zigzag] (0,0) – (2,0) – (2,1) – (0,1)– cycle;

\draw [decoration=zigzag] (0,0) – (2,0) decorate{– (2,1)} – (0,1)– cycle;

\draw [decorate,decoration=zigzag] (0,0) – (2,0) – (2,1) – decorate{(0,1)}– cycle;

\draw [decorate,decoration=zigzag] (0,0) decorate{– (2,0)} – (2,1) – decorate{(0,1)}– cycle;

112
“lineto” \draw [decorate, decoration={zigzag,lineto,pre length=5cm}](0,0) – (10,0);

decoration={ zigzag,pre=lineto,pre length=5cm }

decoration={zigzag,post=lineto,post length=5cm}

decoration={zigzag,pre=lineto,pre length=3cm, ,post=curveto,post length=3cm}

“curveto”
\draw [decorate, decoration={zigzag,pre=curveto,pre length=5cm}](0,0) – (10,0);

decoration={zigzag,pre=curveto,pre length=5cm}

decoration={zigzag,post=curveto,post length=5cm}

decoration={zigzag,pre=curveto,pre length=3cm, ,post=curveto,post length=3cm}

“moveto”
\draw [decorate, decoration={zigzag,pre=moveto,pre length=5cm}](0,0) – (10,0);

decoration={zigzag,pre=moveto,pre length=5cm}

decoration={zigzag,post=moveto,post length=5cm}

decoration={zigzag,pre=moveto,pre length=3cm, ,post=moveto,post length=3cm}

113
18.8.6 Global and partial parameters

\begin{tikzpicture}[baseline=0pt,ultra thick,
decoration={straight zigzag,amplitude=0.5cm,segment length=1cm}]
\draw[red!20,ultra thin] (0,-2) grid (10,3);
\draw[magenta] (0,2) – (10,2);
\draw[blue,decorate] (0,1) – (10,1);
\draw[red,{decorate,decoration=saw}] (0,0) – (10,0);
\draw[cyan,decorate,decoration=meta-segment length=2cm] (0,-1) – (10,-1);
\end{tikzpicture}

18.8.7 Path and its decoration “Postaction”


\draw [postaction={decorate,blue,draw,ultra
thick,
decoration={straight zigzag,ampli-
tude=0.5cm}}]

[red,line width = 10pt ] (0,0) arc (0:180:3 and


2);

114
19 Pictures in a TikZ picture
19.0.1 In a node

\begin{tikzpicture}
\draw (0,0) grid (5,3);
\node [fill=green!20,trapezium,draw] at (1,2) {\DFR };
71
\node [draw] at (3,1) {\includegraph-
ics[width=1cm]{tiger} };
\end{tikzpicture}

19.0.2 With pgfdeclareimage

\pgfdeclareimage[width=3cm]{ttt}{tiger}

\begin{tikzpicture}
\draw (0,0) grid (5,5);
\draw (3,2) node {\pgfuseimage{ttt}} ;
\end{tikzpicture}

20 Freehand drawing
see page 90

\draw[decorate,decoration={random steps,
amplitude=1pt,segment length=3pt}] (0,0)
arc (0:320:2.5 and 1.5);

\draw[decorate,decoration={random steps,
amplitude=1pt,segment length=3pt}] plot
coordinates (0,0) (1,1) (2,0) (3,1) (4,1) (5,2);

\draw[decorate, decoration={random steps,


amplitude=1pt,segment length=3pt}] plot
(\x,sin(\x r));

115
21 Special effect
21.1 Tikzpeople
Load package : \usepackage{tikzpeople} [4]

\tikz \node[alice] at (0,0) ;

21.1.1 available characters


\tikz \node[alice,minimum size=1.5cm] at (0,0) ;

BP

alice bob bride builder businessman charlie chef

conductor cowboy criminal dave graduate groom guard

Nurse

jester judge mexican nun nurse physician pilot

police priest sailor santa surgeon

21.1.2 Options
\tikz \node[businessman,evil,minimum size=1.5cm] at (0,0) ;

BP BP BP BP
BP

evil female good mirrored monitor

116
21.1.3 Anchor specific
\begin{tikzpicture}[blue]
Hey!
\node[name=a,shape=bob,minimum size=1.5cm] {};
\node at (1.25,.5) [ellipse callout, draw, callout absolute
pointer{(a.mouth)}, font=\tiny] Hey!;
\end{tikzpicture}

21.1.4 Colors
\tikz \node[alice,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red details=red

\tikz \node[bob,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red details=red

\tikz \node[bride,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red pearls=red veil=red

\tikz \node[builder,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red trousers=red hat=red

\tikz \node[businessman,hair=red,minimum size=1.5cm] at (0,0) ;

BP BP BP BP BP BP

hair=red skin=red shirt=red tie=red undershirt=red monogram=red

117
\tikz \node[charlie,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red buttons=red

\tikz \node[chef,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red hat=red details=red

\tikz \node[conductor,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red hat=red hatshield=red

undershirt=red shirt=red hatbadge=red badge=red

\tikz \node[cowboy,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=green hat=red

patches=red tie=green stitching=red vest=red

118
\tikz \node[criminal,hat=red,minimum size=1.5cm] at (0,0) ;

hat=red skin=red shirt=red details=red

\tikz \node[dave,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red undershirt=green tie=green

\tikz \node[graduate,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red undershirt=red stripes=red hat=red

\tikz \node[groom,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red undershirt=green tie=green hat=red

\tikz \node[guard,hat=red,minimum size=1.5cm] at (0,0) ;

hat=red skin=red shirt=red collar=red lining=red details=red

\tikz \node[jester,hat=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=yellow hat=red pattern=yellow details=blue

119
\tikz \node[judge,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red undershirt=red hairshadow=red

\tikz \node[mexican,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red hat=green ringtop=red ringmid=red ringbot=yellow

\tikz \node[nun,plaid=red,minimum size=1.5cm] at (0,0) ;

plaid=red skin=red shirt=red

\tikz \node[nurse,hair=red,minimum size=1.5cm] at (0,0) ;

Nurse Nurse Nurse Nurse Nurse Nurse Nurse

hair=red skin=red shirt=red badgeclip=green redcross=green badge=red badgename=red

\tikz \node[physician,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red hat=red stethoscope=red tube=red

\tikz \node[pilot,hat=red,minimum size=1.5cm] at (0,0) ;

hat=red skin=red shirt=red undershirt=red visor=red straps=red decoration=red

120
\tikz \node[police,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red hat=red

badge=red hatbadge=red hatshield=red undershirt=red

\tikz \node[priest,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red hat=red collar=red cross=red

\tikz \node[sailor,hair=red,minimum size=1.5cm] at (0,0) ;

hair=red skin=red shirt=red hat=red undershirt=red stripes=red details=red

\tikz \node[santa,hat=green,minimum size=1.5cm] at (0,0) ;

hat=green skin=green shirt=green beard=green details=green

\tikz \node[surgeon,hat=red,minimum size=1.5cm] at (0,0) ;

hat=red skin=red shirt=red hair=red mask=red

121
22 Creating Graphs
22.1 Graph with TikZ
22.1.1 From a list of points
\tikz \draw plot coordinates {(0,0) (1,1) (2,0) (3,1) (4,1) (5,2)};

PGFmanual section : 22-2

22.1.2 From a data file


\tikz \draw plot[mark=x] file {table.dat} ;

[mark=x] [mark=x,smooth] [mark=x,smooth,tension=.2] [mark=x,smooth,tension=1]


By default: tension= 0:55

content of the file table.dat


0.0 0.3
0.3 0.6
0.6 0.9
0.9 1.5
1.2 0.6
1.5 1.2
1.8 1.5
2.1 2.0
2.4 3.0

122
22.1.3 Graph types
\tikz \draw plot[mark=*,const plot] file {table.dat} ;

const plot const plot mark left const plot mark right jump mark left

jump mark right ycomb xcomb only marks

\tikz \draw plot[polar comb,mark=*]coordinates


{(0:1) (60:0.5) (120:1.5) (180:3) (240:.5) (300:1) (0:1)};

\tikz \draw plot[ybar] file {table.dat} ;

[ybar] [ybar interval] [ybar interval,x=2cm] [ybar interval,y=.5cm]

\begin{tikzpicture}
\draw[red,fill=cyan,ybar,bar width=.5cm]
plot coordinates {(0,1) (1,1.2) (2,.6) (3,.7) (4,.9)};
\draw[blue,fill=green,ybar,bar width=.5cm,bar
shift=.3cm]
plot coordinates {(0,1.2) (1,1.3) (2,.5) (3,.2)
(4,.5)};
\end{tikzpicture}

123
\tikz \draw plot[xbar interval] file {table.dat} ;

[xbar] [xbar interval] [xbar interval,x=.5cm] [xbar interval,y=.5cm]

124
22.1.4 Graph of a function
\draw [color=red] plot (\x,\x);

(\x,\x) (\x,{sin(\x r)}) (\x,{sin(\x)})


x en radian x en degré
Options
\draw[color=red,dashed] plot(\x,{sin(\x r)});
\draw[color=blue,samples=5,mark=*,ultra thick] plot(\x,{sin(\x r)});

[color=blue,samples=5,mark=*] [color=blue,domain=0:4]

[color=blue,domain=1:5] [color=blue,samples at={1,2,4,5},mark=*]

22.1.5 Parametric function


\draw[domain=-3.141:3.141,smooth,variable=\t]plot ({sin(\t r)},{sin(2 *\t r)});
\draw[domain=0:720,smooth,variable=\t]plot ({sin(\t)},\t/360,{cos(\t)});

({sin(\t r)},{sin(2 *\t r)}) ({sin(\t)},\t/360,{cos(\t)})

22.2 Marks
22.2.1 Marks with TikZ

mark=+ mark=x mark=* mark=ball

125
[color=blue,mark repeat=3,mark=*] [color=blue,mark repeat=3,mark phase=5,mark=*]

[color=blue,mark indices=1,4,...,15,17,20,mark=*] [color=blue,mark size=5pt,mark=*]

mark options={color=magenta},mark=+ mark options={rotate=10},mark=+

22.2.2 Marks with text mark


\draw[mark=text ,text mark=A,mark size=5pt] coordinates {(0,0) (1,1) (2,0)};

A Texte

A A Texte Texte
text mark=A text mark=Texte text mark=\DFR 71

text mark={\includegraphics[width=.5cm]{tiger}}

126
22.2.3 Marks with plotmarks library

Load package : \usetikzlibrary{plotmarks}

PGFmanual section : 63

mark=- mark=| mark=o mark=asterisk

mark==star mark==10-pointed star mark=oplus mark=oplus*

mark=otimes mark=otimes* mark=square mark=square*

mark=triangle mark=triangle* mark=diamond mark=diamond*

mark=halfdiamond* mark=halfsquare* mark=halfsquare right* mark=halfsquare left*

mark=pentagon mark=pentagon* mark=Mercedes star mark=Mercedes star flipped


p

p p
mark=halfcircle mark=halfcircle* mark=heart mark=text

\draw[mark=halfcircle,mark color=red,mark size=5pt] coordinates {(0,0) (1,1) (2,0)};

mark=halfcircle mark=halfcircle* mark=halfdiamond* mark=halfsquare*

22.3 Graph with Gnuplot


\draw[color=red] plot[id=sin] function{sin(x)} ;

==> plot[id=sin] create the file “sin.gnuplot”


==> Open the file “sin.gnuplot”with the program gnuplot : creation of the file “sin.table”
==> Use the datafile “sin.table”

127
23 Creation of a graph with pgfplots
Load package : \usepackage{pgfplots} [2]

23.1 2D Graph
23.1.1 Axes
pgfplots section : 4-1
1 1
100.4 100.4
0.8 0.8

0.6 0.6

100.2 100.2
0.4 0.4

0.2 0.2

0 0 100 100
0 0.1 0.2 0.3 0.4
0 0.2 0.4 0.6 0.8 1 10 10 10 10 10 0 0.2 0.4 0.6 0.8 1 100 100.1 100.2 100.3 100.4

\axis \semilogxaxis \semilogyaxis \loglogaxis

\end{axis} \end{semilogxaxis} \end{semilogyaxis} \end{loglogaxis}

23.2 Drawing of the graph


pgfplots section : 4-2
2
30
1.5

20
1

0.5
10

0 1 2 3 4 5 −6 −4 −2 0 2 4 6

\addplot coordinates \addplot {xˆ2 - x +4}; \addplot gnuplot[id=sin]{sin(x)};


{(0,0) (1,1) (2,0) (3,1) (4,1) (5,2)};

2 10
101.5

1.5
8

1
101
6
0.5

0 4
100.5
100 100.2 100.4 100.6 100 100.1 100.2 100.3 100.4 100.5 −6 −4 −2 0 2 4 6

axes : semilogxaxis axes : semilogxaxis axes : semilogyaxis


\addplot coordinates \addplot {xˆ2 - x +4}; \addplot {xˆ2 - x +4};
{(0,0) (1,1) (2,0) (3,1) (4,1) (5,2)};

128
10 10
30

8 8
20

6 6
10

4
4

−1 0 1 2 3 −6 −4 −2 0 2 4 6 −1 0 1 2 3

\begin{axis}[domain=-1:3] \begin{axis}[samples=5] \begin{axis}[domain=-1:3,samples=5]


25

20 30
35 20

30
15 15
20
25

10 10
20
10

5 15 5

10
−4 −2 0 2 4 −6 −4 −2 0 2 4 6 −4 −2 0 2 −2 0 2 4

ymax=20 ymin=10 xmax=2 xmin=-2

23.2.1 Xunit and Yunit

35 35

30 30

25 25
30

20 20

20 15 15

10 10
10
5 5

−5 0 5 −6 −4 −2 0 2 4 6 −5 0 5
\begin{axis}[x=.2cm] \begin{axis}[y=.2cm] \begin{axis}[x=.2cm,y=.2cm]

23.2.2 Graph type


3 3 3

2 2 2

1 1 1

0 0 0

0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5

const plot const plot mark right const plot mark mid

129
3 3 3

2 2 2

1 1 1

0 0 0

0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5

jump mark left jump mark right jump mark mid


3 3

4
2 2

2 1 1

0 0 0

1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 0 0.9 1.2 1.5 1.8 2.1

xbar ybar ybar interval


3 3
4

3 2 2

1 1 1

0
0 0

1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5

xbar interval xcomb ycomb

30 30

20 20

10 10

−6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6

only marks scatter mesh


\addplot [quiver={u=1,v=2*x}],->,samples=5,blue,ultra thick] {xˆ2 - x +4};
1
30
0.5

20
0

−0.5
10

−1
−6 −4 −2 0 2 4 6 0 100 200 300 400

quiver=u=1,v=2*x quiver={u=180/3.14,v=cos(x)}
By default: u=0 et v = 0

130
6 6
60

4 4
40

2 2
20

0 0
0
−6 −4 −2 0 2 4 6 0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5

[stack plots=y,blue] [stack plots=y,blue] [ybar stacked,blue]

6 6 6

4 4 4

2 2 2

0 0 0

0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5

[stack plots=y,area style] [const plot,stack plots=y,area style] [stack plots=y,area style,smooth]

\addplot [error bars/y dir=both,error bars/y fixed =2.5] {xˆ2 - x +4};


40

30
30 30

20
20 20

10 10
10

0 0
−6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6

error bars/y dir =both error bars/y dir =plus error bars/y dir =minus

\addplot [error bars/x dir=both,error bars/x fixed =.5] {xˆ2 - x +4};

30 30 30

20 20 20

10 10 10

−6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6

error bars/x dir =both error bars/x dir =plus error bars/x dir =minus

\addplot [error bars/y dir=both,error bars/x fixed relative =.2] {xˆ2 - x +4};
40
60 30

30

40 20
20

20
10 10

0 0
−6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6

error bars/y fixed relative =.2 error bars/y fixed relative =1 error bars/x fixed relative =.2

131
23.3 Graph information
23.3.1 Titles
Titre du graphe
1
1 1
0.8
0.8 0.8
0.6
0.6 0.6

axe Y
0.4
0.4 0.4
0.2
0.2 0.2
0
0 0
0 0.2 0.4 0.6 0.8 1
axe X 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1

\begin{axis}[xlabel=axe X] \begin{axis}[ylabel=axe Y] \begin{axis}[title=Titre du graphe]

23.3.2 Legend
x2 − x + 4
30 x2 − x + 2
x2 − x
x2 − x − 2 \begin{axis}
\addplot {xˆ2 - x +4};
20 x2 − x − 4

10 \addplot {xˆ2 - x +2};


\addplot {xˆ2 - x };
\addplot {xˆ2 - x -2 };
0

−6 −4 −2 0 2 4 6 \addplot {xˆ2 - x -4 };

\legend{$xˆ2 - x +4$,$xˆ2 - x +2$,$xˆ2 - x $,$xˆ2 - x -2


$,$xˆ2 - x -4 $}
\end{axis}
x2 − x + 4
30 x2 − x + 2
x2 − x

20
x2 − x − 2
2
x −x−4 \begin{axis}[legend entries= {$ xˆ2 - x +4 $,$ xˆ2 - x
+2 $,$ xˆ2 - x $,$ xˆ2 - x -2 $,$ xˆ2 - x -4 $} ]
10

0 \addplot {xˆ2 - x +4};


\addplot {xˆ2 - x +2};
\addplot {xˆ2 - x };
−6 −4 −2 0 2 4 6

\addplot {xˆ2 - x -2 };
\addplot {xˆ2 - x -4 };
\end{axis}
Options
x2 − x + 4
x2 − x + 4 x2 − x + 4
x2 − x + 2
30 x2 − x
30 x2 − x + 2 30 x2 − x + 2
x2 − x − 2 x2 − x
x2 − x − 4 x2 − x − 2
20 20 2
x −x−4
20

10 10
10
0 0

0
−6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6

legend style={font=\tiny} legend style={draw=none} legend style={shape=ellipse}

132
x2 − x + 4
30 30 x2 − x + 2
x2 − x
x2 − x − 2
20 20 2
x −x−4

x2 − x + 4
10 10
x2 − x + 2
x2 − x
0 x2 − x − 2 0
x2 − x − 4

−6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6

legend style={at={(.5,.5)}} legend style={legend pos=outer north east}

A B A B C A B C D E
30 C D 30 D E 30
E

20 20 20

10 10 10

0 0 0

−6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6

legend style={legend columns=2} legend style={legend columns=3} legend style={legend columns=-1}

x2 − x + 4 x2 − x + 4 x2 − x + 4
30 f(x) 30 f(x) 30 f(x)
x2 − x x2 − x x2 − x
courbe courbe courbe
20 Y 20 Y 20 Y

10 10 10

0 0 0

−6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6

[legend cell align=left] [legend cell align=center] [legend cell align=right]

23.3.3 Size of the graph

30 30

20 20

30 10 10
20
10
−5 0 5 −5 0 5 −5 0 5
width=3cm height=5cm width=3cm,height=5cm

23.3.4 Grids

30 30 30

20 20 20

10 10 10

−6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6

\begin{axis}[xmajorgrids=true] \begin{axis}[ymajorgrids=true] \begin{axis}[grid=major]

133
34 3
3
30 2.5

23.01 23.99
2
20 1.5 1.5
14.5 15.23
1
1 0.8
8.93 0.6
10 8.45
4.873.755.11
0
0
−6 −4 −2 0 2 4 6 0 0.5 1 1.5 2 2.5
\beginACaxis[nodes near coords,samples=10] \beginACaxis[nodes near coords]
\addplot {xˆ 2- x +4}; \addplot file table2.dat;

134
24 3D graph
24.0.1 Axes

5 5
0 5 0
0 5
−5
−5 5 −5 0 −5
0 0 5
−5 0 −5 0 0
5 −5 5 −5 5 −5
plot box ratio=2 1 1 plot box ratio=1 2 1 plot box ratio=1 1 2

20 20 20
0 0 0
−20 5 −20 5 −20 5
−5 0 −5 0 −5 0
0 0 0
5 −5 5 −5 5 −5
3d box=background (By default) 3d box=complete 3d box=complete*

5 −5
20 0
0 5
0 −5 20
20
5 −20 5 0
−5 0
5 −5 −20
0
−5
−20 5 −5
axis lines=center,axis on top axis lines*=left axis lines*=right
−5
5 0
0 5
−5 −5
5 0
0 5 5
−5 40
20 0
0 −5
−20
−40
−5
5 0 5
−5 0
5 0 −5
5 5
0 50
−5 0
0 −5
−50

135
24.0.2 Graph drawing
\addplot3 [surf] {y};

5 20
0 0
−5 5 −20 5
−5 0 −5 0
0 0
5 −5 5 −5
{y} {-x*y} gnuplot[id=sinxy]{sin(x)*sin(y)};

1 10
4
0.5 2 5
1 1 0 1
0 0
0 0.5 0 0.5 −1−0.5 0 0
0.5 1 0 0.5 1 0 0.5 1 −1

coordinates {(0,0,1) (1,0,0) (1,1,0) (0,1,0)}; file {table3.dat}; {sin(x)},{cos(x)},{x/60});

content of the file table3.dat


0 0 0
0 0.5 0
0 1 1
1 1 5
1 0.5 0
1 0 0

24.0.3 Aspect

5 5 5
0 0 0
−5 5 −5 5 −5 5
−5 0 −5 0 −5 0
0 0 0
5 −5 5 −5 5 −5
[red] [surf] [mesh]

5 5 5
0 0 0
−5 5 −5 5 −5 5
−5 0 −5 0 −5 0
0 0 0
5 −5 5 −5 5 −5
[red,samples=10] [surf,samples=10] [mesh,samples=10]

136
5 5 5
0 0 0
−5 5 −5 5 −5 5
−5 0 −5 0 −5 0
0 0 0
5 −5 5 −5 5 −5
[scatter] [scatter,samples=10] [scatter,samples=10,only marks]

5 5 5
0 0 0
−5 5 −5 5 −5 5
−5 0 −5 0 −5 0
0 0 0
5 −5 5 −5 5 −5
[surf,colormap/greenyellow] [surf,colormap/hot] [surf,colormap/jet]

5 5 5
0 0 0
−5 5 −5 5 −5 5
−5 0 −5 0 −5 0
0 0 0
5 −5 5 −5 5 −5
[surf,colormap/blackwhite] [surf,colormap/hot2] [surf,colormap/bluered]

5 5 5
0 0 0
−5 5 −5 5 −5 5
−5 0 −5 0 −5 0
0 0 0
5 −5 5 −5 5 −5
[surf,colormap/cool] [surf,colormap/redyellow] [surf,colormap/violet]

137
5 5 5
0 0 0
−5 5 −5 5 −5 5
−5 0 −5 0 −5 0
0 0 0
5 −5 5 −5 5 −5
shader=flat shader=interp shader=faceted

5 5 5
0 0 0
−5 5 −5 5 −5 5
−5 0 −5 0 −5 0
0 0 0
5 −5 5 −5 5 −5
shader=flat corner shader=flat mean shader=faceted interp

5 2
0
0
−2
−5 5
0 −4
−5 0
5 −5
colorbar

24.0.4 Viewpoint

20
20 0
0 −20
−20 −5
5 5 0 5
az = -500 0 el = -50 0
−5−5 5−5

Azimut Elevation
view/az= angle from - 50 to +50 view/el= angle from - 50 to +50

138
25 Table of a function variation
Load package : \usepackage{tkz-tab} [3]

25.1 Creation of the table

1° ligne a b c

2° ligne

\begin{tikzpicture}
\tkzTabInit{1° ligne / 1 ,2° ligne /1 } { a , b, c }
\end{tikzpicture}

25.1.1 Options
Row width

1° ligne a b c

2° ligne

3° ligne

\tikz \tkzTabInit{1° ligne ’/1 , 2° ligne /.5 , 3° ligne /1.5 }{a , b , c };

First column width

x a b c

\tkzTabInit[lgt=4]{ x / 1}{ a , b , c };
By default: lgt==2 cm

Space between two values

x a b c

\tkzTabInit[espcl=1]{ x / 1}{ a , b , c };
By default: espcl=2 cm

Margin

x a b c

\tkzTabInit[deltacl=1]{ x / 1}{ a , b , c };
By default: deltacl=0.5 cm

139
Line width

x a b c

\tkzTabInit[dlw=2pt]{ x / 1}{ a , b , c };
By default: lw=0,4 pt

No cadre

x a b c

\tkzTabInit[nocadre]{ x / 1}{ a , b , c };
By default: nocadre=false

Coloring
\tkzTabInit [color,colorT = yellow]{1°ligne/1 , 2°ligne/1}{ a , b }

1°ligne a b 1°ligne a b

2°ligne 2°ligne

[color,colorT = yellow] [color,colorC = cyan]

1°ligne a b 1°ligne a b

2°ligne 2°ligne

[color,colorL = green] [color,colorV = magenta]


By default: color = false colorT=colorC=colorL=colorV =white

25.2 Creation of a sign row

x a b c x a b c

f (x) 2 4 f (x) 0 2 0 4 0

\tkzTabLine{ t, 2,t ,4 ,t } \tkzTabLine{ z, 2, z ,4 ,z }

x a b c x a b c

f (x) 2 4 f (x) 1 3 4 5

\tkzTabLine{ d, 2, d ,4 ,d } \tkzTabLine{ 1, h, 3 ,4 ,5 }

140
Example

x −∞ -4 4 10 +∞

f (x) + − 0 +

\begin{tikzpicture}
\tkzTabInit[espcl=1.5]{$x$ / 1 ,$f(x)$ /1 } { −∞ , -4, 4 , 10 , +∞ }
\tkzTabLine{ t,+, d ,h ,d,-,z,+ }
\end{tikzpicture}

25.3 Creation of a variation row

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{ +/1 , -/2} \tkzTabVar{ -/1 , +/2}

x a b c x a b c

f (x) f (x) 1 2
1 2
\tkzTabVar{-/1 , -/2} \tkzTabVar{ +/1 , +/2 }

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{ +C/1 , -/2} \tkzTabVar{ -C/1 , +/2}

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{-/1 , -C/2} \tkzTabVar{ +/1 , +C/2 }

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{ +H/1 , -/2} \tkzTabVar{ -H/1 , +/2}

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{-/1 , -H/2} \tkzTabVar{ +/1 , +H/2 }

141
x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{ +D/1 , -/2} \tkzTabVar{ -D/1 , +/2}

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{-/1 , -D/2} \tkzTabVar{ +/1 , +D/2 }

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{ D+/1 , -/2} \tkzTabVar{D-/1 , +/2}

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{-/1 , D-/2} \tkzTabVar{ +/1 , D+/2 }

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{ +DH/1 , -/2} \tkzTabVar{ -DH/1 , +/2}

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{-/1 , -DH/2} \tkzTabVar{ +DH/1 , +/2 }

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{ +CH/1 , -/2} \tkzTabVar{ -CH/1 , +/2}

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{-/1 , -CH/2} \tkzTabVar{ +/1 , +CH/2 }

142
x a b c x a b c

f (x) 2 3 f (x) 1 2
1 2 2 3
\tkzTabVar{ -/1 , +D-/2 , +/3} \tkzTabVar{ +/1 , -D+/2 , -/3}

x a b c x a b c

f (x) 1 3 f (x) 2 2
2 2 1 3
\tkzTabVar{+/1 , -D-/2 , +/3} \tkzTabVar{-/1 , +D+/2 , -/3 }

x a b c x a b c

f (x) 2 3 f (x) 1 2
1 2 2 3
\tkzTabVar{ -/1 , +CD-/2 , +/3} \tkzTabVar{ +/1 , -CD+/2 , -/3}

x a b c x a b c

f (x) 1 3 f (x)
22 1 3
\tkzTabVar{+/1 , -CD-/2 , +/3} \tkzTabVar{-/1 , +CD+/2 , -/3 }

x a b c x a b c

f (x) 2 3 f (x) 1 2
1 2 2 3
\tkzTabVar{ -/1 , +DC-/2 , +/3} \tkzTabVar{ +/1 , -DC+/2 , -/3}

x a b c x a b c

f (x) 1 3 f (x) 22
22 1 3
\tkzTabVar{+/1 , -DC-/2 , +/3} \tkzTabVar{-/1 , +DC+/2 , -/3 }

x a b c x a b c

f (x) 2 3 f (x) 1 2
1 2 2 3
\tkzTabVar{ -/1 , +V-/2 , +/3} \tkzTabVar{ +/1 , -V+/2 , -/3}

x a b c x a b c

f (x) 1 3 f (x) 2 2
2 2 1 3
\tkzTabVar{+/1 , -V-/2 , +/3} \tkzTabVar{-/1 , +V+/2 , -/3 }

143
Emphasizing a value

x a b c

1 3
f (x) 2 2

\tkzTabVar{+/1 , -V-/\colorbox{yellow}{2} , +/3}

Multicolumn variation

x a b c

f (x) 3
1
\tkzTabVar{-/1 , R/ , +/3}

Intermediate values

x a A b c x a b A c

3 x 3
f (x)
1 x f (x)
1
\tkzTabVal{1}{3}{0.25}{A}{x} \tkzTabVal{1}{3}{0.75}{A}{x}

x a A b c

3
f (x)
1 x

\tkzTabVal[draw]{1}{3}{0.25}{A}{x}

Picture insertion

x a b c d x a b c d

3 x 3
f (x)
1 x f (x)
1
\tkzTabIma{1}{4}{2}{x} \tkzTabIma{1}{4}{3}{x}

144
26 Repetitions
Package used : “pgffor”(automatically loaded with TikZ)

26.1 One variable repetition

\tikz \foreach \x in {1,...,10} \fill[blue](\x,0) circle (0.4cm);


Variable \x : position en X

26.2 Two variables repetition


Numerical variables

\tikz \foreach \pos/\y in {1/10,2/20,3/30,4/40,5/50,6/60,7/70,8/80,9/90,10/100}


\fill[color=blue!\y](\pos,0) circle (0.5cm);
Variable \pos : position en X Variable \y : couleur

Composite variables

\tikz \foreach \x/\col in 1/red,3/green,5/magenta,7/blue \shade[ball color=\col](\x,0) circle (1);


Variable \x : position en X Variable \col : couleur

Variables with a step

1,3 2,3 3,3 4,3 7,3 8,3 9,3 10,3

1,2 2,2 3,2 4,2 7,2 8,2 9,2 10,2

1,1 2,1 3,1 4,1 7,1 8,1 9,1 10,1

\begin{tikzpicture}
\foreach \x in{1,2,...,4,7,8,...,10}
\foreach \y in {1,...,3}
{ \draw (\x,\y) +(-.5,-.5) rectangle ++(.5,.5); \draw (\x,\y)
node\x,\y; }
\end{tikzpicture}

Variable \x : position en X Variable \y : position en Y

List example
1, 2, 3, 4, 5, 6, \foreach \x in {1,...,6} {\x, }
1, 3, 5, 7, 9, 11, \foreach \x in {1,3,...,11} {\x, }
Z, X, V, T, R, P, N, \foreach \x in {Z,X,...,M} {\x, }
21 , 22 , 23 , 24 , 25 , 26 , 27 , \foreach \x in {2ˆ1,2ˆ...,2ˆ7} {\x, }
0cm, 0.5cm, 1cm, 1.5cm, 2cm, 2.5cm, 3cm, \foreach \x in {0cm,0.5cm,...cm,3cm} {\x, }
A1 , B1 , C1 , D1 , E1 , F1 , G1 , H1 , \foreach \x in {A_1,..._1,H_1} {\x, }

145
Calculation on variables

\begin{tikzpicture}
\foreach \x in 0,20,...,360{ \filldraw[red] (0,0) .. controls (\x+10:1)
.. (\x:1) .. controls (\x-10:1) .. (0,0);}
\foreach \x in 10,30,...,370{ \filldraw[blue] (0,0) .. controls (\x+10:3)
.. (\x:3) .. controls (\x-10:3) .. (0,0);}
\end{tikzpicture}

Variable \x : angle

26.3 Nested loops


Order of the nested loops
X X X X X X

X X X X X X

X X X X X X
\begin{tikzpicture} \begin{tikzpicture}
\draw (0,0) \draw (0,0)
\foreach \x in {1,2,3} \foreach \y in {0,1,2}
\foreach \y in {0,1,2} \foreach \x in {1,2,3}
{– (\x,\y) node{X}}; {– (\x,\y) node{X}};
\end{tikzpicture} \end{tikzpicture}

146
27 Tree diagram
PGFmanual section : 21

27.1 Structure

\node {} child child { child child } child ; \coordinate child child { child child } child ;

père \begin{tikzpicture}
\node {père}
child {node {frère}}
child {node {moi}
frère moi soeur child {node {fils}}
child {node {fille}}}
child {node{soeur}};
fils fille \end{tikzpicture}

racine

a b c d
\node {racine} child foreach \name in {a,b,c,d} {node {\name}};

27.2 Orientation
soeur soeur fille fils
frère
père

moi fille moi fils moi fille

père père
frère fils frère soeur
\node {père}[grow=-30] \node {père}[grow=30] \node {père}[grow’=30]

147
fille fils frère soeur

fils fille
soeur moi frère moi père père moi

fille fils
père soeur frère
\node {père}[grow=up] \node {père}[grow=left] \node {père}[grow=right]
fille fils soeur
fille
fille soeur
soeur moi frère père moi fils
moi
fils
père frère père frère
\node {père}[grow=north] \node {père}[grow=east] \node {père}[grow=north east ]

\node {père}
soeur
child[grow=right,red] {node {frère}}
child {node {moi}
père frère child {node {fils}}
child {node {fille}}}
child[grow=north west,red] {node{soeur}};

moi

fils fille

27.3 Distance
27.4 Parent-child distance
père

frère moi soeur père

moi soeur
fille

fils fille frère fils


\node {père}[level distance=3cm,red] child[level distance=3cm,red] {node {frère}}
child[level distance=.5cm,red] {node {fille}}
By default : level distance=15 mm

148
père père

frère moi soeur


frère moi soeur
fils fille fils fille
\node {père}[level 1/.style={level distance=1cm}] \node {père}[level 2/.style={level distance=.5cm}]

27.5 Two children distance


père père

frère moi soeur frère moi soeur

fils fille fils fille


\node {père}[sibling distance=1cm,red] \node {père}[sibling distance=3cm,red]
By default : sibling distance=15 mm

Problem solution
père père

frère moi soeur frère moi soeur

fils neveu
fille nièce fils fille neveu nièce
[sibling distance=2cm] [level 1/.style=sibling distance=2cm,
level 2/.style=sibling distance=1cm]

149
27.6 Nodes customization
1
\node[starburst ,draw] {père}[grow=right]
soeur

fille child {node[diamond,draw] frère}


child {node[diamond,draw] moi
père moi child {node[ellipse,draw] fils}
child {node[ellipse,draw] fille}}
fils child {node[diamond,draw] soeur};

frère

\node[rectangle,double,draw,text width=1cm,text cen-


soeur tered]
{père}[grow=right,level distance=2cm]
fille
père child {node[red,ultra thick,draw,rotate=45] {frère}}
et moi child {node[blue,dashed, draw] {moi}
mère child {node[ellipse,draw] {fils}}
fils
child {node [ellipse,fill] {fille}}}
child {node [magenta,pattern=dots,draw] {soeur}};
e
èr
fr

27.6.1 Nodes name


a \node (a) {a}
child
child {
child {child child}
a-1 a-2 child {child }
};
\node at (a-1) {a-1};
a-2-1 a-2-2 \node at (a-2) {a-2};
\node at (a-2-2) {a-2-2};
\node at (a-2-1) {a-2-1};
\node at (a-2-1-2) {a-2-1-2};
a-2-1-2
\draw[red,ultra thick] (a-1) – (a-2);

1 Other types of nodes see section 17

150
a \node (a) {a}
child
child
child coordinate (b) child child
a-1 a-2 child
;
\node at (a-1) {a-1};
b a-2-2 \node at (a-2) {a-2};
\node at (b) {b};
\node at (a-2-2) {a-2-2};
\node at (b-1) {b-1};
b-1 a-2-1-2 \node at (a-2-1-2) {a-2-1-2};

\draw[red,ultra thick] (a-1) – (b-1);

\node (a) {père}


père
child {node (b) {frère}}
child {node (c) {moi}
child {node (d) {fils}}
frère moi soeur child {node (e) {fille}}}
child {node (f) {soeur}};

\draw[red„ultra thick] (b) – (d);


fils fille

27.6.2 Missing a node


0

1 2 3 5 6
child[missing] {node {4} }

27.6.3 Attachment point modification

pére pére

frère moi frère moi

fils fille fils fille


\node {pére} [child anchor=east,red] \node {pére}
child {node {frère}} child {node {frère}}
child { node {moi} child { node {moi}
child {node {fils}} child [child anchor=west,red] {node {fils}}
child {node {fils}} }; child {node {fils}} };

151
pére pére

frère moi frère moi

fils fille fils fille


\node {pére} [parent anchor=east,red] \node {pére}
child {node {frère}} child {node {frère}}
child { node {moi} child { node {moi}
child {node {fils}} child [parent anchor=west,red] {node {fils}}
child {node {fils}} }; child {node {fils}} };

27.6.4 Links
pére pére père

frère moi soeur frère moi soeur frère moi soeur

fils fille fils fille fils fille


child {node {moi} child {node {fils} child { node {fille}
edge from parent[red,ultra thick] edge from parent[red,ultra thick] } edge from parent[draw=none] }

père

frère moi soeur

fils fille
[edge from parent/.style={draw,red,ultra thick}]
\node {père}

27.6.5 Labels on link


\node {père} child {node {fils} edge from parent node[left,red] {texte}};
père père père père

texte texte texte


texte
fils fils fils fils
node[left,red] node[right,red] node[near end,red] node[draw,red]

152
27.6.6 Links customization
[ edge from parent path= {(\tikzparentnode.south) .. controls +(0,-1) and +(0,1) ..
(\tikzchildnode.north)} ]
père père père

frère moi soeur frère moi soeur frère moi soeur

fils fille fils fille fils fille


.. controls +(0,-1) and +(0,1) .. -| to[in=90,out=-90]
see links available : section 7.2

153
27.7 More options with « library trees »
Load package : \usetikzlibrary{trees}

PGFmanual section : 72

27.7.1 One child and two childrenn position


grow via three points={ one child at (0,1) and two children at (-.5,1) and (.5,1)}

un deux trois quatre

grow via three points={ one child at (0,1) and two children at (0,1) and (1,1)}

un deux trois quatre

grow via three points={ one child at (0,1) and two children at (-.5,1) and (.5,1.5)}

un deux trois quatre

27.7.2 Angular linking

racine
racine
racine

[grow cyclic] [grow cyclic,sibling angle=45] [grow cyclic,sibling angle=90]

154
30

root 0 \node {racine} [clockwise from=30,sibling


angle=30]
−30
−60 child {node {$30$} }
child {node {$0$} }
child {node {$-30$} }
child {node {$-60$ } };

27.7.3 Forking links

père \node {père} [edge from parent fork down]

child {node {frère}}


child {node {moi}
frère moi child [child anchor=north east] {node {fils}}
child {node {fille}}
};
fils fille

père \node {père} [edge from parent fork right]

child {node {frère}}


child {node {moi}
frère moi child {node {fils}}
child {node {fille}}
};
fils fille

fille

moi

père fils \node {père} [edge from parent fork


right,grow=right]
frère
child {node {frère}}
child {node {moi}
child {node {fils}}
child {node {fille}}
};

155
28 Electrical Engineering Circuits
Load package : \usepackage{circuits.ee.IEC}

28.1 Symbols
PGFmanual section : 47-4

On a node On a path

\node [circuit ee IEC] at (1,0.5) to [resistor] {} ; \draw [circuit ee IEC](0,0.5) to [resistor] (2,.5) ;

Basic Elements
\draw [circuit ee IEC] (0,.5) to [resistor] (2,.5) ;
PGFmanual section : 47-4-3

[resistor] [inductor] [capacitor] [battery]

;
[bulb] [current source] [voltage source] [ground]
PGFmanual section : 47-4-4

[diode] [Zener diode] [Schottky diode] [tunnel diode]

[backward diode] [breakdown diode]


PGFmanual section : 47-4-5

[contact] [make contact] [break contact]

Alternate appearance
\draw [circuit ee IEC,set resistor graphic=var resistor IEC graphic ]
(0,0.5) to [resistor] (2,0.5) ;

resistor inductor diode

Zener diode Schottky diode tunnel diode

backward diode breakdown diode make contact

156
Symbol Size
PGFmanual section : 47-2-1
\draw [circuit ee IEC] (0,0.5) to [diode,large circuit symbols] (2,0.5) ;

huge circuit symbols large circuit symbols medium circuit symbols small circuit symbols tiny circuit s
(10pt) (8pt) (7pt) (6pt) (5pt)

\draw [circuit ee IEC,circuit symbol unit=14pt] (0,0.5) to [diode] (2,0.5) ;

circuit symbol unit=14pt circuit symbol size=width 3 height 1 circuit symbol size=width 1 height 5
don’t work !

Declaring New Symbols


PGFmanual section : 47-2-2
\begin{tikzpicture} [circuit declare symbol=xxx,
set xxx graphic={draw,shape=rectangle,minimum
size=5mm}]
\node [xxx] at (.5,.5) ;
\draw[circuit ee IEC] (1,.5) to [xxx] (3,.5) ;
\end{tikzpicture}

shape=circle shape=dart shape=star shape=forbidden sign


voir les “different shape libraries”see the different shape libraries

Placement of symbol on a path


\draw [circuit ee IEC] (0,0.5) to [contact={at start},make contact={very near start},voltage source={near s
resistor, bulb={near end}, bulb={very near end},contact={at end}] (12,0.5) ;

\draw [circuit ee IEC] (0,0.5) to [contact={ pos=0 },make contact={pos=0.2},voltage source={pos=0.3


resistor={ pos=0.5 }, bulb={pos=0.75 },contact={pos =1 }] (12,0.5) ;

Symbol orientation
PGFmanual section : 47-2-3
\node [circuit ee IEC] at (1,.5) [diode,point up] {} ;

[diode,point up] [diode,point down] [diode,point left] [diode,point right]

157
Automatic orientation

\draw [circuit ee IEC] (0,0)


to [voltage source] (1,1)
to [resistor] (2,0)
to [bulb] (1,-1)
to [diode] (0,0) ;

28.2 Annotations
Indicating Current Directions
PGFmanual section : 47-4-2
\draw [circuit ee IEC] (0,0.5) to [current direction] (2,0.5) ;

[current direction] [current direction’ ]

Units available
PGFmanual section : 47-4-6
\node [draw,circuit ee IEC] at(1,.5) [ampere=5] {}
5A 5V 5 5S 5H

[ampere=5] [volt=5] [ohm=5] don’t work ! [siemens=5] [henry=5]


5F 5C 5VA 5W 5Hz

[farad=5] [coulomb=5] [voltampere=5] [watt=5] [hertz=5]


5kA 5mA 5µA 5kW 5MW

[ampere=5k] [ampere=5m] [ampere=5\mu] [watt=5k] [watt=5M]

Declare unit
PGFmanual section : 47-2-4
\tikz[circuit ee IEC,circuit declare unit={xxx}{ Unit}]
\draw (0,0) to[resistor={xxx’ sloped=3}] (3,2) to [resistor={xxx= 10\mu}] (5,2) to [resistor={xxx= 10M}]
10µUnit

10MUnit
nit
3U

158
Annotations
PGFmanual section : 47-4-7
\draw [circuit ee IEC] (0,0.5) to [resistor=light emitting] (2,0.5) ;

[resistor=light emitting] [resistor=light dependent] [resistor=direction info] [resistor=adjustable]

[diode=light emitting] [diode=light dependent] [diode=direction info] [diode=adjustable]

[diode=light emitting’] [diode=light dependent’] [diode=direction info’] [diode=adjustable’]

Units position
PGFmanual section : 47-2-4
\draw [circuit ee IEC] (0,0) to [capacitor={farad=5\mu}] (2,2) ;

5µF

5µF

[capacitor={farad=5\mu}] [capacitor={farad’=5\mu}]
F

F

[capacitor={farad sloped=5\mu}] [capacitor={farad’ sloped=5\mu}]

Info Labels
PGFmanual section : 47-2-4
\draw [circuit ee IEC] (0,0.5) to [diode={light emitting={info=D1}}] (2,0.5) ;

D1

D3
D2

[diode={light emitting={info=D1}} ] [diode={light emitting={info’=D2}} ] [diode={light emitting,info’

On a node On a path
3Ω 3Ω

R1 R1
[resistor,info=$3\Omega$,info’=R1] [resistor={info=$3\Omega$,info’=R1}]

159
3Ω
3Ω
[resistor,point up,info=center:$3\Omega$] [resistor,point up,info=center:$3\Omega$]

\node [voltage source,direction info={volt=10}] {} \node [voltage source,direction info’={volt=10}] {}

10V 10V

10V 10V

{volt=10} {volt’=10} {volt=10} {volt’=10}


or {->,volt=10} or {->,volt’=10} or {->,volt=10} or {->,volt’=10}

10V 10V 10V

10V

{<-,volt=10} {<-,volt=10} {<-,volt=10} {<-,volt’=10}

Declare annotation
PGFmanual section : 47-2-5
\tikzset{circuit declare annotation={XXX}{9pt}
{ (-0.5cm,0.5cm) edge[to path={- -(0pt,2pt) - - (8pt,8pt)}] ()} }
\tikz[blue,circuit ee IEC] \draw (0,0) to [resistor=XXX] (3,0);
\tikzset{circuit declare annotation={xxx}{ 9pt } }
abc { (-0.5cm,0.5cm) edge[to path={- -(0pt,2pt) - - (8pt,8pt)}] ()} }
\tikz[blue,circuit ee IEC] \draw (0,0) to [resis-
tor={xxx={info=abc}}] (3,0);
abc \tikzset{circuit declare annotation={xxx}{1cm } }
{ (-0.5,0.5) edge[to path={- -(0pt,2pt) - - (8pt,8pt)}] ()} }
\tikz[blue,circuit ee IEC] \draw (0,0) to [resis-
tor={xxx={info=abc}}] (3,0);

160
Theming Symbols
PGFmanual section : 47-2-6
\draw[circuit symbol lines/.style={draw,red,very thick}] (0,0)
to [capacitor={near start},resistor, make contact={near end}] (5,0);

\draw[circuit symbol wires/.style={draw,red,very thick}] (0,0)


to [capacitor={near start},resistor, make contact={near end}] (5,0);

\draw[circuit symbol open/.style={thick,draw,red,fill=yellow}] (0,0)


to [capacitor={near start},resistor, make contact={near end}] (5,0);

\tikz[blue,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);

4Ω R2 4Ω R2

3Ω 3Ω

R1 R1

every info/.style=red every info/.style={font=\tiny}

161
28.3 Example
3 methods for the same circuit
\begin{tikzpicture}[blue,circuit ee IEC]
\draw (0,0)
3kΩ
to [voltage source={direction info={->,volt=10}}] (0,2)
to [resistor={info=center:$3 k\Omega$}] (2,2)
10V to [diode=light emitting] ( 2,0)
to [make contact] (0,0);
\end{tikzpicture}

\begin{tikzpicture}[blue,circuit ee IEC]
\draw (0,0) to [voltage source={direction info={-
3kΩ
>,volt=10}}] ++(up:2)
to [resistor={info=center:$ 3 k\Omega$}] ++(right:2)
10V to [diode=light emitting] ++(down:2)
to [make contact] ++(left:2) ;
\end{tikzpicture}

10k
\begin{tikzpicture}[blue,circuit ee IEC]
\node (A) at (0,1) [voltage source,point up,volt=10]{};
\node (B) at (1,2) [resistor,ohm=10k] {};
10V
\node (C) at (2,1) [diode=light emitting,point down] {}
;
\node (D) at ( 1,0) [make contact] {};
\draw (A) |- (B) -| (C) |- (D) -| (A);
\end{tikzpicture}
j

29 Logical circuits
International Electrotechnical Commission :

Load package : \usepackage{circuits.logic.IEC}

American logic gates :

Load package : \usepackage{circuits.logic.US}

logic symbols used in A. Croft, R. Davidson, and M. Hargreaves (1992), Engineering


Mathematics, Addison-Wesley, 82–95 :

Load package : \usepackage{circuits.logic.CDH}

162
Basic Elements
\node [circuit logic IEC] at (1,.5) [and gate ] {A} ;
PGFmanual section : 47-3-2

&

[circuit logic IEC] [circuit logic US] [circuit logic CDH]


and gate and gate and gate
&

[circuit logic IEC] [circuit logic US] [circuit logic CDH]


nand gate nand gate nand gate
≥1

[circuit logic IEC] [circuit logic US] [circuit logic CDH]


or gate or gate or gate
≥1

[circuit logic IEC] [circuit logic US] [circuit logic CDH]


nor gate nor gate nor gate
=1

[circuit logic IEC] [circuit logic US] [circuit logic CDH]


xor gate xor gate xor gate
=1

[circuit logic IEC] [circuit logic US] [circuit logic CDH]


xnor gate xnor gate xnor gate
1

[circuit logic IEC] [circuit logic US] [circuit logic CDH]


not gate not gate not gate
1

[circuit logic IEC] [circuit logic US] [circuit logic CDH]


buffer gate buffer gate buffer gate

163
Labelled
\node [circuit logic IEC] at (1,.5) [and gate] {A} ;
PGFmanual section : 47-3-1

&
A A A

[circuit logic IEC] [circuit logic US] [circuit logic CDH]

Orientation
PGFmanual section : 47-3-1
\node [circuit logic IEC] at (1,.5) [and gate,point down] {A} ;
A

A
&

[circuit logic IEC] [circuit logic US] [circuit logic CDH]


\node [circuit logic IEC] at (1,.5) [and gate,point up] {A} ;
A

A
&

[circuit logic IEC] [circuit logic US] [circuit logic CDH]


\node [circuit logic IEC] at (1,.5) [and gate,point left] {A} ;

A A A
&

[circuit logic IEC] [circuit logic US] [circuit logic CDH]

inputs exit
PGFmanual section : 47-3-3
\node [and gate IEC, draw,
logic gate inputs={inverted ,normal , inverted }] at (1,.5)
&
(A) {};
\draw [red] (A.input 1) -| (0,0.5);
\draw[green] (A.input 2) -| (0,0.5);
\draw[cyan] (A.input 3) -| (0,0.5);
\draw (A.output) -| (2,0.5);
\node [and gate IEC, draw,
& logic gate inputs={ini}] at (1,.5) (A) {};
\draw [red] (A.input 1) -| (0,0.5);
\draw[green] (A.input 2) -| (0,0.5);
\draw[cyan] (A.input 3) -| (0,0.5);
\draw (A.output) -| (2,0.5);

164
input parameter
\node [and gate IEC, draw, logic gate inputs=ini,logic gate inverted radius=4pt ]
at (1,.5) (A) {};
PGFmanual section : 47-3-3

&
&

logic gate inverted radius=4pt logic gate input sep=0.5cm

symbol parameter
\node [circuit logic IEC,and gate IEC symbol=AND ] at (1,.5) [and gate] {}
PGFmanual section : 47-3-5

AND &

&

and gate IEC symbol logic gate IEC symbol color logic gate IEC symbol align
=AND =red ={bottom, right}

Composant parameter
\node [circuit logic IEC,very thick ] at (1,.5) [and gate] {}
PGFmanual section : 47-3-5

& & &

very thick fill=blue!10 fill=blue!10,


logic gate IEC symbol color=black

165
30 Optics
Load package : \usepackage{optics} [6]

\begin{tikzpicture}[blue,line width=2pt]
\draw[help lines] (-1,-1) grid (1,1);
\node[use optics,lens] (L) at (0,0) ;
\end{tikzpicture}

30.1 Optic components


30.1.1 Components available
Éléments optiques
\tikz[use optics,blue] \node[lens] (L) at (0,0) {};

lens slit double slit mirror

convex mirror concave mirror polarizer beam splitter double amici prism

thin optics element thick optics element heat filter screen

diffraction grating grid semi-transparent mirror diaphragm

30.1.2 Parameters
\node[lens,object height=1cm] (L) at (0,0) {};

50%

object height=1cm draw focal points focal length=1.5cm focal height=0.5


By default 2cm By default empty By default 1cm By default 0.8 (80%)

166
Lens type slit parameters
\node[lens,lens type=converging] (L) at (0,0) {}; \node[slit,slit height=0.5] (L) at (0,0) {};

slit height=0.5 slit height=0.5cm


lens type=converging lens type=diverging By default 0.075 (7.5% )

Double slit parameters


\node[double slit,slit height=0.15] (L) at (0,0) {};

slit height=0.15 slit height=0.25cm slit separation=0.5 double slit, slit separation=1cm
By default 0.075 (7.5% x 2cm = 1.5 mm) By default 0.2 (20% x 2cm = 4mm)

mirror parameters
\node[mirror,mirror decoration separation=0.25] (L) at (0,0) {};

mirror decoration separation=0.25 mirror decoration separation=0.5cm


By default 0.15cm

mirror decoration amplitude=0.25 mirror decoration amplitude=1cm


By default 0.125cm

spherical mirror type


\node[convex mirror](L) at (0,0) {};

convex mirror concave mirror


spherical mirror, spherical mirror type=convex spherical mirror, spherical mirror type=concave

167
spherical mirror orientation
\node[convex mirror, spherical mirror orientation=ltr](L) at (0,0) {};

convex mirror, convex mirror,


spherical mirror orientation=ltr spherical mirror orientation=rtl

concave mirror concave mirror,


spherical mirror orientation=ltr spherical mirror orientation=rtl

\node[spherical mirror, spherical mirror angle=240](L) at (0,0) {};

spherical mirror angle=240 mirror decoration separation=0.25 mirror decoration amplitude=0.5cm


By default 150 By default 0.15cm By default 0.125cm

\node[spherical mirror, spherical mirror angle=from_radius(2cm)](L) at (0,0) {};

\node[polarizer, object height=1.5cm](L) at (0,0) {};

object height=1.5cm object aspect ratio=0.5 object aspect ratio=2


By default 2cm By default 0.2

\node[beam splitter,object height=1.5cm](L) at (0,0) {};

object height=1.5cm object aspect ratio=.5 object aspect ratio=2

168
\node[double amici prism,prism height=1cm](L) at (0,0) {};

prism height=1cm prism apex angle=90


By default 1.5cm By default 60

\node[thick optics element,object height=1.5cm](L) at (0,0) {};

object height=1.5cm object aspect ratio=0.5 object aspect ratio=1.5

30.1.3 Anchors
\node[lens] (L) at (0,0) {} ;
\node[red,fill] (L.lens north) circle (2pt) ;

(L.lens north) (L.lens south) (L.east focus) (L.west focus) (L.center)

\node[slit, slit height=0.5] (L) at (0,0) {} ;


\node[red,fill] (L.slit north) circle (2pt) ;

(L.slit north) (L.slit south) (L.slit center)

\node[double slit,slit height=0.2,slit separation=0.5] (L) at (0,0) {} ;


\node[red,fill] (L.slit 1 north) circle (2pt) ;

(L.slit 1 north) (L.slit 1 south) (L.slit 1 center) (L.slit 2 north) (L.slit 2 south) (L.slit 2 center)

169
\node[spherical mirror] (L) at (0,0) {} ;
\node[red,fill] (L.mirror center) circle (2pt) ;

L.mirror center L.focus L.arc start L.arc center L.arc end L.45 L.-45

30.2 Lights and sensors


30.2.1 Available
\tikz[use optics,scale=.5,blue] \node[generic optics io] (L) at (0,0) {};

generic optics io sensor line generic sensor generic lamp

;
halogen lamp spectral lamp laser laser’

170
30.2.2 Parameters
\node[generic optics io, io body height=1.5cm](L) at (0,0) {};
Same parameters for generic sensor , generic lamp , halogen lamp , spectral lamp,laser

io body height=1.5cm io body aspect ratio=4 io body width=4


By default 0.75cm By default 2

io body width=3cm io aperture width=1 io aperture width=1cm


By default 0.33

io aperture height=2 io aperture height=1cm io aperture shift=0.25


By default 0.66 By default 0

io orientation=ltr io orientation=rtl
By default ltr

\node[sensor line, sensor line height=1.5cm](L) at (0,0) {};

sensor line height=1.5cm sensor line aspect ratio=0.5 sensor line pixel number=10
By default 2cm By default 0.2 By default 5

sensor line pixel width=0.8 sensor line pixel width=0.2cm sensor line inner ysep=0.2
By default0.4 By default 0.05

171
30.2.3 Anchors

s.body north s.body south s.body east s.body west s.body cente

s.body north east s.body north west s.body south east s.body south west

s.aperture north s.aperture south s.aperture east s.aperture west s.aperture cen

s.aperture north east s.aperture north west s.aperture south east s.aperture south west

172
s.pixel 1 center s.pixel 2 center s.pixel 3 center s.pixel 4 center s.pixel 5 center

s.pixel 3 east s.pixel 3 west s.pixel 3 south s.pixel 3 north

s.pixel 3 north east s.pixel 3 north west s.pixel 3 south east s.pixel 3 south west

30.3 Tools
30.3.1 Marks on the ray
\draw [->-] (0,0) – (1.5,1;

[->-] [-<-] [-> >-] [->n-={n=4}] [->n={n=5,at=0.25}] [-> >-=at=0.25, ->-={at=0.75}]

\draw [put arrow] (0,0) to[bend left=120] (2,0);

[put arrow] [put arrow={arrow’}] [put arrow={at=0.2}] [put arrow={style=red}]

[red,put arrow={arrow=latex}] [put arrow={arrow’=Kite}] [put arrow={pos=.25}]


By default pos=0.5

173
\draw[red, put arrow/every arrow/.style={blue}, put arrow={at=0.2},
put arrow={at=0.5}, put arrow={at=0.8}] (0,0) – (5,0);

\begin{tikzpicture}[use optics,blue]
B \draw[put coordinate=A at 0.1,put coordinate=B at 0.9]
A (0,0) - - (1.5,1) - - (3, 0) - - (4.5,1);
\draw[red] (A) - - (B);
\fill(A) circle (2pt) node[above] {A} ;
\fill(B) circle (2pt) node[above] {B} ;
\end{tikzpicture}
Point A à 10% , point B à 90%

\begin{tikzpicture}[use optics]
\node[halogen lamp] (quartz iode) at (0,0) {Q.I.};
\node[heat filter,right=0.5cm of quartz iode.aperture east]
(AC) {};
Q.I. \node[slit,right=0.75cm of AC] (fente) {};
\node[lens,right=2cm of fente] (L) {};
\node[screen,right=3cm of fente] (screen) {};
\end{tikzpicture}

30.3.2 Dimensions indicating


\draw (0,0) to[short dim arrow={label=2cm}] (2,0);

2cm 2cm
2cm

[dim arrow={label=2cm}] to[dim arrow={label’=2cm}] [dim arrow={label=2cm


label style/.append style=re

2cm

2cm
2cm

[dim arrow={label=2cm,raise=1cm}] [dim arrow={label=2cm,no raise},red] [dim arrow’={label=2cm}


By default raise = 0.5cm

174
\draw (0,0) to[short dim arrow={label=2cm}] (2,0);

2cm 2cm

[short dim arrow={label=2cm}] [short dim arrow={label=2cm,arrow length=1cm}]


By default arrow length= 5mm

2cm
2cm

[short dim arrow={label=2cm,label near end}] [short dim arrow={label=2cm,label near middle}]
By default label near start

175
31 Animate a TikZ picture
Load package : \usepackage{animate} [5]

31.1 Animation from picture files


first frame second and last frame

\includegraphics{XXX1} \includegraphics{XXX2}

\animategraphics:
[ controls, :Inserts control buttons
loop :animation restarts automatically
autoplay ] :Start animation automatically
{4} :4 frame per second
{XXX} :file base name
{1} :number of the first frame
{2} :number of the last frame

31.2 Animateinline
\animateinline[controls,loop,autoplay]{5}

% first frame
\begin{tikzpicture} \fill[blue] (45:2) - - (135:.5)- - (225:2)- -(315:.5)
- - cycle; \fill[blue] (45:.5) - - (135:2)- - (225:.5)- -(315:2) - - cycle;
\end{tikzpicture}
% second frame
\newframe
\begin{tikzpicture}
\fill[blue] (0:2) - - (90:.5)- - (180:2)- -(270:.5) - - cycle;
\fill[blue] (0:.5) - - (90:2)- - (180:.5)- -(270:2) - - cycle;
\end{tikzpicture}

\end{animateinline}

176
31.3 Multiframe
\begin{animateinline}[poster=first,controls, palindrome]{12}
\multiframe{29}{iAngle=80+10, Rdim=2.0+-0.2}{
\begin{tikzpicture}
\fill[blue] (\iAngle+45:\Rdim) - - (\iAngle+135:.5)- -
(\iAngle+225:\Rdim)- -(\iAngle+315:.5) - - cycle;
\fill[blue] (\iAngle+45:.5) - - (\iAngle+135:\Rdim)- - (\iAn-
gle+225:.5)- -(\iAngle+315:\Rdim) - - cycle;
\end{tikzpicture} }
\end{animateinline}

The first letter of the variable name determines his type


entier initiale : i ou I
réelles initiale : n, N, r ou R
longueurs initiale : d ou D

\begin{animateinline}[autoplay,loop]{12}
\multiframe{24}{iAngle=0+15,icol=0+5}{\begin{tikzpicture}
\draw[line width=0pt] (-2,-3) rectangle(6,3);
\draw (0,0) node[fill=white,circle,rotate=\iAngle]
{\includegraphics[width=2cm]{LogoIUT}} (0,0) circle (1);
\draw (0,0) circle (1);
\coordinate (abc) at (${sqrt(9-sin(\iAngle)*sin(\iAngle))+cos(\iAngle)}*(1,0)$)
;
\coordinate (xyz) at (\iAngle:1);
\draw[ultra thick] (0,0) - -(xyz);
\draw[ultra thick] (xyz) - - (abc) ;
\fill[color=blue!\icol] (abc)++(0.5,-1) rectangle (5,1) ;
\draw[ultra thick] (abc) ++(0,-1) rectangle ++(.5,2) ;
\draw[ultra thick] (1.5,1) - - (5,1) - - (5,-1) - - (1.5,-1);
\fill[red] (xyz) circle (4pt);
\fill[red] (abc) circle (4pt);
\end{tikzpicture}}
\end{animateinline}

Load package : \usepackage{tkz-tab} [3]

31.4 Creation of the table

1° ligne a b c

2° ligne

\begin{tikzpicture}
\tkzTabInit{1° ligne / 1 ,2° ligne /1 } { a , b, c }
\end{tikzpicture}

177
31.4.1 Options
Row width

1° ligne a b c

2° ligne

3° ligne

\tikz \tkzTabInit{1° ligne ’/1 , 2° ligne /.5 , 3° ligne /1.5 }{a , b , c };

First column width

x a b c

\tkzTabInit[lgt=4]{ x / 1}{ a , b , c };
By default: lgt==2 cm

Space between two values

x a b c

\tkzTabInit[espcl=1]{ x / 1}{ a , b , c };
By default: espcl=2 cm

Margin

x a b c

\tkzTabInit[deltacl=1]{ x / 1}{ a , b , c };
By default: deltacl=0.5 cm

178
Line width

x a b c

\tkzTabInit[dlw=2pt]{ x / 1}{ a , b , c };
By default: lw=0,4 pt

No cadre

x a b c

\tkzTabInit[nocadre]{ x / 1}{ a , b , c };
By default: nocadre=false

Coloring
\tkzTabInit [color,colorT = yellow]{1°ligne/1 , 2°ligne/1}{ a , b }

1°ligne a b 1°ligne a b

2°ligne 2°ligne

[color,colorT = yellow] [color,colorC = cyan]

1°ligne a b 1°ligne a b

2°ligne 2°ligne

[color,colorL = green] [color,colorV = magenta]


By default: color = false colorT=colorC=colorL=colorV =white

31.5 Creation of a sign row

x a b c x a b c

f (x) 2 4 f (x) 0 2 0 4 0

\tkzTabLine{ t, 2,t ,4 ,t } \tkzTabLine{ z, 2, z ,4 ,z }

x a b c x a b c

f (x) 2 4 f (x) 1 3 4 5

\tkzTabLine{ d, 2, d ,4 ,d } \tkzTabLine{ 1, h, 3 ,4 ,5 }

179
Example

x −∞ -4 4 10 +∞

f (x) + − 0 +

\begin{tikzpicture}
\tkzTabInit[espcl=1.5]{$x$ / 1 ,$f(x)$ /1 } { −∞ , -4, 4 , 10 , +∞ }
\tkzTabLine{ t,+, d ,h ,d,-,z,+ }
\end{tikzpicture}

31.6 Creation of a variation row

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{ +/1 , -/2} \tkzTabVar{ -/1 , +/2}

x a b c x a b c

f (x) f (x) 1 2
1 2
\tkzTabVar{-/1 , -/2} \tkzTabVar{ +/1 , +/2 }

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{ +C/1 , -/2} \tkzTabVar{ -C/1 , +/2}

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{-/1 , -C/2} \tkzTabVar{ +/1 , +C/2 }

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{ +H/1 , -/2} \tkzTabVar{ -H/1 , +/2}

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{-/1 , -H/2} \tkzTabVar{ +/1 , +H/2 }

180
x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{ +D/1 , -/2} \tkzTabVar{ -D/1 , +/2}

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{-/1 , -D/2} \tkzTabVar{ +/1 , +D/2 }

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{ D+/1 , -/2} \tkzTabVar{D-/1 , +/2}

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{-/1 , D-/2} \tkzTabVar{ +/1 , D+/2 }

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{ +DH/1 , -/2} \tkzTabVar{ -DH/1 , +/2}

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{-/1 , -DH/2} \tkzTabVar{ +DH/1 , +/2 }

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{ +CH/1 , -/2} \tkzTabVar{ -CH/1 , +/2}

x a b c x a b c

f (x) 1 f (x) 2
2 1
\tkzTabVar{-/1 , -CH/2} \tkzTabVar{ +/1 , +CH/2 }

181
x a b c x a b c

f (x) 2 3 f (x) 1 2
1 2 2 3
\tkzTabVar{ -/1 , +D-/2 , +/3} \tkzTabVar{ +/1 , -D+/2 , -/3}

x a b c x a b c

f (x) 1 3 f (x) 2 2
2 2 1 3
\tkzTabVar{+/1 , -D-/2 , +/3} \tkzTabVar{-/1 , +D+/2 , -/3 }

x a b c x a b c

f (x) 2 3 f (x) 1 2
1 2 2 3
\tkzTabVar{ -/1 , +CD-/2 , +/3} \tkzTabVar{ +/1 , -CD+/2 , -/3}

x a b c x a b c

f (x) 1 3 f (x)
22 1 3
\tkzTabVar{+/1 , -CD-/2 , +/3} \tkzTabVar{-/1 , +CD+/2 , -/3 }

x a b c x a b c

f (x) 2 3 f (x) 1 2
1 2 2 3
\tkzTabVar{ -/1 , +DC-/2 , +/3} \tkzTabVar{ +/1 , -DC+/2 , -/3}

x a b c x a b c

f (x) 1 3 f (x) 22
22 1 3
\tkzTabVar{+/1 , -DC-/2 , +/3} \tkzTabVar{-/1 , +DC+/2 , -/3 }

x a b c x a b c

f (x) 2 3 f (x) 1 2
1 2 2 3
\tkzTabVar{ -/1 , +V-/2 , +/3} \tkzTabVar{ +/1 , -V+/2 , -/3}

x a b c x a b c

f (x) 1 3 f (x) 2 2
2 2 1 3
\tkzTabVar{+/1 , -V-/2 , +/3} \tkzTabVar{-/1 , +V+/2 , -/3 }

182
Emphasizing a value

x a b c

1 3
f (x) 2 2

\tkzTabVar{+/1 , -V-/\colorbox{yellow}{2} , +/3}

Multicolumn variation

x a b c

f (x) 3
1
\tkzTabVar{-/1 , R/ , +/3}

Intermediate values

x a A b c x a b A c

3 x 3
f (x)
1 x f (x)
1
\tkzTabVal{1}{3}{0.25}{A}{x} \tkzTabVal{1}{3}{0.75}{A}{x}

x a A b c

3
f (x)
1 x

\tkzTabVal[draw]{1}{3}{0.25}{A}{x}

Picture insertion

x a b c d x a b c d

3 x 3
f (x)
1 x f (x)
1
\tkzTabIma{1}{4}{2}{x} \tkzTabIma{1}{4}{3}{x}

183
32 Packages studied in this document
Basic TikZ package :
1
name Load package documentation
tikz \usepackage{tikz} pgfmanual.pdf

Other packages
2
name see page documentation
animate 176 animate.pdf
tikz-optics 166 tikz-optics.pdf
pgfplots 128 pgfplots.pdf
tikzpeople 116 tikzpeople.pdf
tkz-tab 177 tkz-tab-screen.pdf

Optional library (documentation : pgfmanual.pdf)


name see page Load package
angles 36 \usetikzlibrary{angles}
arrows.meta 20 \usetikzlibrary{arrows.meta}
bending 33 \usetikzlibrary{bending}
backgrounds 62 \usetikzlibrary{backgrounds}
calc 43 \usetikzlibrary{calc}
circuits.ee.IEC 156 \usetikzlibrary{circuits.ee.IEC}
circuits.logic.IEC 162 \usetikzlibrary{circuits.logic.IEC}
circuits.logic.US 162 \usetikzlibrary{circuits.logic.US}
circuits.logic.CDH 162 \usetikzlibrary{circuits.logic.CDH}
fit 52 \usetikzlibrary{fit}
decorations.footprints 103 \usetikzlibrary{decorations.footprints}
decorations.fractals 110 \usetikzlibrary{decorations.fractals}
decorations.markings 100 \usetikzlibrary{decorations.markings}
decorations.pathmorphing 89 \usetikzlibrary{decorations.pathmorphing}
decorations.pathreplacing 95 \usetikzlibrary{decorations.pathreplacing}
decorations.shapes 104 \usetikzlibrary{decorations.shapes}
decorations.text 108 \usetikzlibrary{decorations.text}
fadings 67 \usetikzlibrary{fadings }
intersections 42 \usetikzlibrary{intersections}
patterns 16 \usetikzlibrary{patterns}
plotmarks 127 \usetikzlibrary{plotmarks}
scopes 59 \usetikzlibrary{scopes}
shadings 19 \usetikzlibrary{shadings}
shapes.arrows 79 \usetikzlibrary{shapes.arrows}
shapes.callouts 81 \usetikzlibrary{shapes.callouts}
shapes.geometric 74 \usetikzlibrary{shapes.geometric}
shapes.misc 83 \usetikzlibrary{shapes.misc}
shapes.multipart 85 \usetikzlibrary{shapes.multipart}
shapes.symbols 77 \usetikzlibrary{shapes.symbols}
trees 154 \usetikzlibrary{trees}
1 look in repertory : \texlive\2016\tesmf-dist\doc\generic\pgf
2 search in repertory : \texlive\2016\tesmf-dist\doc\latex

184
In a a future update
automata PGFmanual section : 41
babel PGFmanual section : 42
calendar PGFmanual section : 45
chains PGFmanual section : 46
circular graph drawing library PGFmanual section : 32
curvilinear library PGFmanual section : 103-4-7
datavisualization library PGFmanual section : 75
datavisualization.formats.functions library PGFmanual section : 76-4
datavisualization.polar library PGFmanual section : 80
er PGFmanual section : 49
examples graph drawing library PGFmanual section : 35-8
external PGFmanual section : 50
fixedpointarithmetic PGFmanual section : 53
folding PGFmanual section : 59
force graph drawing library PGFmanual section : 31
fpu PGFmanual section : 54
graph.standard library PGFmanual section : 19-10
graphdrawing library PGFmanual section : 27
graphs library PGFmanual section : 19
layered graph drawing library PGFmanual section : 30
lindenmayersystems PGFmanual section : 55
matrix PGFmanual section : 57
mindmap PGFmanual section : 58
petri PGFmanual section : 61
phylogenetics graph drawing library PGFmanual section : 33
plothandlers PGFmanual section : 62
positioning PGFmanual section : 17-5-3
profiler PGFmanual section : 64
quotes library PGFmanual section : 17-10-4
routing graph drawing library PGFmanual section : 34
shadows PGFmanual section : 66
spy PGFmanual section : 68
svg.path PGFmanual section : 69
through PGFmanual section : 71
topaths PGFmanual section : 70
trees graph drawing library
turtle PGFmanual section : 73

185
References
[1] pgfmanual.pdf version 3.0.1a 1161 pages

[2] pgfplots.pdf version 1.80 439 pages

[3] tkz-tab-screen.pdf version 1.1c 83 pages

[4] tikzpeople.pdf 19 pages

[5] animate.pdf 26 pages

[6] tikz-optics.pdf version 0.2.2 39 pages

186
33 Index
1. environnements
2. Commandes

3. paramètres et options
4. Valeurs TikZ
5. Extrémités

187
Index
1 Environments \tkzTabVar, 141–143, 180–182
\animateinline, 176 \useasboundingbox, 57
\axis, 128 3 Parameters and options
\loglogaxis, 128 <->, 63
\scope, 59 error bars/x dir, 131
\semilogxaxis, 128 name intersections, 42
\semilogyaxis, 128 near end, 51
\tikzfadingfrompicture, 67 with, 100
\tikzpicture, 56, 57 above, 49, 51
2 Commands above left, 49
\addplot, 128, 132 above right, 49
\animategraphics, 176 adjustable, 159
\arrow, 102 adjustable’, 159
\arrowreversed, 102 alice, 116
\clip, 58 align, 109
\colorbox, 144, 183 ampere, 158
\colorlet, 64 amplitude, 89–96
\coordinate, 41 anchor, 41, 49
\definecolor, 64 anchor==north east , 49
\draw, 9, 89–97, 100, 103–107, 110, and, 9, 100
112 and gate, 163
\fbox, 56 and gate IEC symbol, 165
\fill, 9, 103 angle, 25, 36, 39–41, 95–97
\filldraw, 9 angle eccentricity, 36
\foreach, 145 angle radius, 36
\legend, 132 arc, 10, 25
\multiframe, 177 arc center, 170
\newcommand, 71 arc end, 170
\newframe, 176 arc start, 170
\node, 47, 102 arrow, 173
\nodepart, 85 arrow box arrows, 79
\pgfdeclareimage, 115 arrow box head extend, 80
\pgfkeysvalueof, 101 arrow box head indent, 80
\pgfuseimage, 115 arrow box shaft width, 80
\pic, 34 arrow box tip angle, 80
\scoped, 60 arrow length, 175
\shade, 18 arrow’, 173
\shadedraw, 18 aspect, 76, 92, 93, 95
\shorthandoff, 50 aspect=2, 76
\shorthandon, 50 at, 47, 133, 173
\tikzchildnode.north, 153 at end, 51, 157
\tikzfading, 69 at start, 51, 157
\tikzinputsegmentfirst, 98, 99 auto, 52
\tikzinputsegmentlast, 98, 99 background code, 35
\tikzinputsegmentsupporta, 99 background grid/.style, 63
\tikzinputsegmentsupportb, 99 background left/.style, 63
\tikzparentnode.south, 153 background rectangle/.style, 62
\tikzset, 35 backward diode, 156
\tkzTabIma, 144, 183 badge, 118, 120, 121
\tkzTabInit, 139, 177, 178 badgeclip, 120
\tkzTabLine, 140, 179 badgename, 120
\tkzTabVal, 144, 183 bar shift, 123

188
barycentric cs, 40 circuit symbol lines/.style, 161
baseline, 55–57 circuit symbol open/.style, 161
battery, 156 circuit symbol size, 157
beam splitter, 166 circuit symbol unit, 157
beard, 121 circuit symbol wires/.style, 161
behind path, 35 circular sector angle, 75
below, 49, 51 clockwise from, 155
below left, 49 closepath code, 98
below right, 49 cloud, 104
bend, 10, 33 cloud ignores aspect, 77
bend at end, 11 cloud puff arc, 77
bend at start, 11 cloud puffs, 77
bend left, 47 code, 34
bend pos, 10 collar, 119, 121
bend right, 47, 52 color, 28, 140, 179
between borders, 105 colorbar, 138
between centers, 105 colorC, 140, 179
between positions, 100 colorL, 140, 179
bob, 116 colormap/blackwhite, 137
bottom color, 18 colormap/bluered, 137
break contact, 156 colormap/cool, 137
breakdown diode, 156 colormap/greenyellow, 137
bride, 116 colormap/hot, 137
buffer gate, 163 colormap/hot2, 137
builder, 116 colormap/jet, 137
bulb, 156 colormap/redyellow, 137
bumps, 111 colormap/violet, 137
businessman, 116 colorT, 140, 179
buttons, 118 colorV, 140, 179
by, 42 concave mirror, 166, 167
callout absolute pointer, 81 conductor, 116
callout pointer arc, 81 const plot, 123, 129
callout pointer end size, 82 const plot mark left, 123
callout pointer segments, 82 const plot mark mid, 129
callout pointer shorten, 81 const plot mark right, 123, 129
callout pointer start size, 82 contact, 156
callout relative pointer, 81 controls, 9
Cantor set, 110 convex mirror, 166, 167
canvas cs, 39, 43 coordinates, 122
canvas polar cs, 39 cos, 11
cap angle, 33 coulomb, 158
capacitor, 156 cowboy, 116
center, 160, 169 criminal, 116
chamfered rectangle angle, 83 cross, 121
chamfered rectangle corners, 84 crosses, 104
chamfered rectangle xsep, 83 current bounding box.north east, 57
chamfered rectangle ysep, 83, 84 current bounding box.south west, 57
charlie, 116 current direction, 158
chef, 116 current direction’ , 158
child anchor, 151 current page.center, 61
circle, 9, 10, 47, 73 current page.east, 61
circle solidus, 85 current page.north, 61
circle split, 85 current page.north east, 61
circuit declare symbol, 157 current page.north west, 61
circuit declare unit, 158 current page.south, 61

189
current page.south east, 61 east focus, 169
current page.south west, 61 edge, 13, 48
current page.west, 61 edge from parent, 152
current source, 156 edge from parent fork down, 155
current subpath start, 13 edge from parent fork right, 155
curveto code, 99 edge from parent/.style, 152
cycle, 12 ellipse, 10, 150
cylinder body fill, 76 ellipse split, 85
cylinder end fill, 76 end angle, 10
cylinder uses custom fill, 76 error bars/x dir, 131
dart, 104 error bars/x fixed, 131
dart tail angle, 75 error bars/x fixed relative, 131
dart tip angle, 75 error bars/y dir, 131
dash dot, 15 error bars/y fixed, 131
dash dot dot, 15 error bars/y fixed relative, 131
dash pattern, 15 espcl, 139, 178
dash phase, 15 even odd rule, 17
dashed, 15, 63 every arrow, 174
dave, 116 every info/.style, 161
declare annotation, 160 evil, 116
decorate, 112, 114 expanding waves, 96
decorate with, 104 fading angle, 69
decoration, 89–93, 95–97, 103, 104, fading transform, 69
120 farad, 158
default, 72 female, 116
deltacl, 139, 178 file, 122
densely dash dot, 15 fill, 28, 47, 62
densely dash dot dot, 15 fill opacity, 65
densely dashed, 15 fit, 52
densely dotted, 15 fit fading, 68
details, 117–119, 121 fit to path, 109
diamond, 74, 150 fit to path stretching spaces, 109
diaphragm, 166 flex, 33
diffraction grating, 166 flex’, 33
dim arrow, 174 focal height, 166
dim arrow’, 174 focal length, 166
diode, 156 focus, 170
direction info, 159, 160 font, 87, 132
direction info’, 159, 160 foot angle, 103
dlw, 140, 179 foot length, 103
domain, 125, 129 foot of, 103
dotted, 15 foot sep, 103
double, 16, 62, 63, 73, 105 footprints, 111
double amici prism, 166 foreach, 147
double arrow head extend, 79 foreground code, 35
double arrow head indent, 79 framed, 62
double arrow tip angle, 79 framed , gridded , 63
double distance, 16 generic lamp, 170
double distance between line centers, generic optics io, 170
16 generic sensor, 170
double equal sign distance, 16 good, 116
double slit, 166 graduate, 116
draw, 47, 63, 73, 132, 144, 152, 183 grid, 38, 133, 166
draw focal points, 166 gridded, 63
draw opacity, 65 groom, 116

190
ground, 156 Koch snowflake, 110
grow, 147, 148 label, 50, 174
grow cyclic, 154 label near end, 175
grow’, 147 label near middle, 175
grow=right, 155 label style, 174
guard, 116 label’, 174
hair, 117–121 large circuit symbols, 157
hairshadow, 120 laser, 170
halogen lamp, 170 laser’, 170
harpoon, 27 left, 27, 49, 152
hat, 117–121 left color, 18
hatbadge, 118, 121 left indent, 109
hatshield, 118, 121 legend cell align, 133
heat filter, 166 legend columns, 133
height, 133 legend entries, 132
help lines, 38 legend pos, 133
henry, 158 legend style, 132
hertz, 158 length, 22
huge circuit symbols, 157 lens, 166
id, 127 lens north, 169
in, 11, 47 lens south, 169
inductor, 156 lens type, 167
info, 159 level 1/.style, 149
info’, 159 level 2/.style, 149
inner color, 18 lgt, 139, 178
inner frame sep, 62 light dependent, 159
inner frame xsep, 62 light dependent’, 159
inner frame ysep, 62 light emitting, 159
inner sep, 53, 73 light emitting’, 159
inner xsep, 73 line cap, 14, 29, 30
inner ysep, 73 line join, 15, 29
input, 164 line width, 14, 31, 62, 63
insert path, 13 line width’, 32
inset, 24 lineto code, 98
intersection, 42 lining, 119
io aperture height, 171 logic gate IEC symbol align, 165
io aperture shift, 171 logic gate IEC symbol color, 165
io aperture width, 171 logic gate input sep, 165
io body aspect ratio, 171 logic gate inputs, 164
io body height, 171 logic gate inverted radius, 165
io body width, 171 loose background, 62
io orientation, 171 loosely dash dot, 15
isosceles triangle apex angle, 75 loosely dash dot dot, 15
isosceles triangle stretches, 75 loosely dashed, 15
jester, 116 loosely dotted, 15
judge, 116 lower left, 19
jump mark left, 123, 130 lower right, 19
jump mark mid, 130 magnifying glass handle angle, 77
jump mark right, 123, 130 magnifying glass handle aspect, 77
kite, 104 make contact, 156
kite lower vertex angle, 75 mark, 100, 126
kite upper vertex angle, 75 mark color, 127
kite vertex angles, 75 mark connection node, 102
Koch curve type 1, 110 mark indices, 126
Koch curve type 2, 110 mark options, 126

191
mark phase, 126 output, 164
mark repeat, 126 paint, 105
mark size, 126 parabola, 10
mask, 121 parabola height, 11
medium circuit symbols, 157 parent anchor, 152
mesh, 130, 136 patches, 118
meta-segment length, 89–91 path fading, 67–69
mexican, 116 path picture, 17
middle color, 18 path picture bounding box, 18
midway, 51 pattern, 16, 119
minimum height, 73 pattern color, 16
minimum size, 73 pearls, 117
minimum width, 73 physician, 116
mirror, 95, 166 pi*8, 96
mirror center, 170 pic, 34, 36
mirror decoration amplitude, 167, 168 pic actions, 35
mirror decoration separation, 167, 168 pic type, 34
mirrored, 116 pilot, 116
missing, 151 pin, 50
miter limit, 15 pin distance, 50
monitor, 116 pin position, 50
monogram, 117 plaid, 120
mouth, 117 point, 43
moveto code, 98 point down, 157, 164
n, 173 point left, 157, 164
name, 41, 42, 67, 69 point right, 157
name path, 42 point up, 157, 164
nand gate, 163 polar comb, 123
near end, 152, 157 polarizer, 166
near start, 51, 157 police, 116
nearly opaque, 65 pos, 51, 157, 173
nearly transparent, 65 post, 112, 113
no raise, 174 post length, 112, 113
node, 43 postaction, 114
node cs, 41 pre, 112, 113
nodes near coords, 134 pre length, 112, 113
nor gate, 163 priest, 116
not gate, 163 prism apex angle, 169
nun, 116 prism height, 169
nurse, 116 put arrow, 173
object aspect ratio, 168, 169 put coordinate, 174
object height, 166, 168, 169 quick, 32
ohm, 158 quiver, 130
only marks, 123, 130 radius, 10, 39, 40, 97
opaque, 65 raise, 95, 174
open, 29 random starburst, 77
or gate, 163 rectangle, 9, 104
out, 11, 47 rectangle split, 85
outer color, 18 rectangle split draw splits, 85
outer frame sep, 63 rectangle split empty part depth, 86
outer frame xsep, 63 rectangle split empty part height, 86
outer frame ysep, 63 rectangle split empty part width, 86
outer sep, 73 rectangle split horizontal, 85
outer xsep, 73 rectangle split ignore empty parts, 85
outer ysep, 73 rectangle split part align, 86

192
rectangle split part fill, 86 shape end size, 107
rectangle split parts, 85 shape end width, 107
red, 28 shape evenly spread, 105
redcross, 120 shape height, 104, 106
regular polygon sides, 75 shape scaled, 107
resistor, 156 shape sep, 105
reverse path, 109 shape size, 104, 106
reversed, 26 shape sloped, 105, 106
right, 27, 49, 152, 174 shape start height, 107
right color, 18 shape start size, 107
right indent, 109 shape start width, 107
ringbot, 120 shape width, 104, 106
ringmid, 120 sharp, 30
ringtop, 120 sharp corners, 12
rotate, 38, 54 shirt, 117–121
rotate fit, 53 short dim arrow, 174, 175
round, 30 show background bottom, 62
rounded corners, 12, 62, 73 show background grid, 63
rounded rectangle arc length, 83 show background left, 62
rounded rectangle east arc, 83 show background rectangle, 62
rounded rectangle left arc, 83 show background right, 62
rounded rectangle right arc, 83 show background top, 62
rounded rectangle west arc, 83 show path construction, 98, 99
sailor, 116 sibling angle, 154, 155
samples, 125, 129 sibling distance, 149
samples at, 125 siemens, 158
santa, 116 signal, 104
scale, 25, 54, 58 signal from, 78
scale length, 25 signal from=above, 78
scale width, 25 signal pointer angle, 78
scatter, 130 signal to, 78
Schottky diode, 156 sin, 11
scope fading, 69, 70 single arrow head extend, 79
screen, 166 single arrow head indent, 79
segment length, 89–97, 104 single arrow tip angle, 79
semi-transparent mirror, 166 skin, 117–121
semilogxaxis, 128 slant, 25
semilogyaxis , 128 slit, 166
semithick, 14 slit 1 center, 169
semitransparent, 65 slit 1 north, 169
sensor line, 170 slit 1 south, 169
sensor line aspect ratio, 171 slit 2 center, 169
sensor line height, 171 slit 2 north, 169
sensor line inner ysep, 171 slit 2 south, 169
sensor line pixel number, 171 slit center, 169
sensor line pixel width, 171 slit height, 167
sep, 21 slit north, 169
shader, 138 slit separation, 167
shading, 18 slit south, 169
shading angle, 18 sloped, 51
shape, 74, 104, 132, 157 small circuit symbols, 157
shape aspect, 76 smooth, 122
shape backgrounds, 104 solid, 15
shape border rotate, 106 solution, 43
shape end height, 107 spectral lamp , 170

193
spherical mirror angle, 168 trim right, 57
spherical mirror orientation, 168 trousers, 117
spherical mirror type, 167 tube, 120
stack plots, 131 tunnel diode, 156
stack plots=y, 131 turn, 45
star, 104 ultra nearly opaque, 65
star point height, 75 ultra nearly transparent, 65
star point ratio, 75, 105 ultra thick, 14, 63, 105
star points, 75, 105 ultra thin, 14
starburst, 104, 150 undershirt, 117–121
starburst point height, 77 upper left, 19
starburst points, 77 upper right, 19
start angle, 10 use as bounding box, 56, 57
step, 38, 63, 100 use optics, 166
stethoscope, 120 veil, 117
stitching, 118 very near end, 51, 157
straps, 120 very near start, 51, 157
stride length, 103 very nearly opaque, 65
stripes, 119, 121 very nearly transparent, 65
style, 72, 173 very thick, 14
surf, 136 very thin, 14
surgeon, 116 vest, 118
swap, 27, 52 view/az, 138
tangent cs, 43 view/el, 138
tape, 104 visor, 120
tape bend bottom, 78 volt, 158
tape bend height, 78 voltage source, 156
tape bend top, 78 voltampere, 158
tension, 122 watt, 158
text depth, 86, 88 west focus, 169
text height, 86, 88 width, 23, 133
text justified, 87 x, 54, 123, 124, 129
text mark, 126 x radius, 10, 39, 40
text opacity, 65 xbar, 124, 130
thick, 14 xbar interval, 124, 130
thick optics element, 166 xcomb, 123, 130
thin, 14 xlabel, 132
thin optics element, 166 xmajorgrids, 133
tie, 117–119 xmax, 129
tight background, 62 xmin, 129
tiny circuit symbols, 157 xnor gate, 163
title, 132 xor gate, 163
to, 11 xshift, 54
to path, 13 xslant, 54
top color, 18, 62 xyz cs, 39
total, 42 xyz polar cs, 40
transform shape, 34, 101 y, 54, 123, 124, 129
transparency group, 70 y radius, 10, 39, 40
transparent, 65 ybar, 123, 130
trapezium angle, 74 ybar interval, 123, 130
trapezium left angle, 74 ybar stacked, 131
trapezium right angle, 74 ycomb, 123, 130
trapezium stretches, 74 ylabel, 132
triangles, 104 ymajorgrids, 133
trim left, 57 ymax, 129

194
ymin, 129 horizontal lines dark gray (pattern),
yshift, 54 17
yslant, 54 horizontal lines gray (pattern), 17
Zener diode, 156 horizontal lines light blue (pattern),
4 Values Tikz 17
10-pointed star (mark), 127 horizontal lines light gray (pattern),
asterisk (mark), 127 17
at position (mark), 100 hue, 66
axis (shading), 18 human (foot of), 103
ball (shading), 18 inverted (gate), 164
bevel (line join), 15 left (align), 109
bird (foot of), 103 lighten, 66
border (decoration), 95 ltr, 168
brace (decoration), 95 luminosity, 66
bricks (pattern), 16 Mandelbrot set (shadingv), 19
bumps (decoration), 92 Mercedes star (mark), 127
butt (line cap), 14, 29 Mercedes star flipped (mark), 127
center (align), 109 miter (line join), 15, 29
checkerboard (pattern), 16 multiply, 66
checkerboard light gray (pattern), 17 normal, 66
coil (decoration), 92 normal (gate), 164
color, 66 north east lines (pattern), 16
color wheel (shading), 19 north west lines (pattern), 16
color wheel black center (shading), o (mark), 127
19 off, 15
color wheel white center (shading), on, 15
19 oplus (mark), 127
concave, 167 oplus* (mark), 127
convex, 167 otimes (mark), 127
crosses (decoration), 104 otimes* (mark), 127
crosshatch dots (pattern), 16 overlay, 66
crosshatch dots gray (pattern), 17 pentagon (mark), 127
crosshatch dots light steel blue (pat- pentagon* (mark), 127
tern), 17 radial (shading), 18
darken, 66 random steps (decoration), 90
diamond (mark), 127 rect (line cap), 14
diamond* (mark), 127 right (align), 109
difference, 66 rosshatch (pattern), 16
dots (pattern), 16 round (line cap), 14, 29, 30
exclusion, 66 round (line join), 15
felis silvestris (foot of), 103 rtl, 168
fivepointed stars (pattern), 16 saturation, 66
footprints (decoration), 103 saw (decoration), 90
gnome (foot of), 103 screen, 66
grid (pattern), 16 sixpointed stars (pattern), 16
halfcircle (mark), 127 snake (decoration), 93
halfcircle* (mark), 127 square (mark), 127
halfdiamond* (mark), 127 square* (mark), 127
halfsquare left* (mark), 127 star (mark), 127
halfsquare right* (mark), 127 straight zigzag (decoration), 89
halfsquare* (mark), 127 text (mark), 126, 127
heart (mark), 127 ticks (decoration), 96
horizontal lines (pattern), 16 triangle (mark), 127
horizontal lines dark blue (pattern), triangle* (mark), 127
17 vertical lines (pattern), 16

195
waves (decoration), 97
zigzag (decoration), 91
5 Extremities
-, 20
->, 20
-Arc Barb, 20
-Bar, 20
-Bracket, 20
-Butt Cap, 20
-Circle, 20
-Classical TikZ Rightarrow, 20
-Computer Modern Rightarrow, 20
-Diamond, 20
-Ellipse, 20
-Fast Round, 20
-Fast Triangle, 20
-Hooks, 20
-Implies, 20
-Kite, 20
-Latex, 20
-Parenthesis, 20
-Rays, 21
-Rectangle, 20
-Round Cap, 20
-Square, 20
-Stealth, 20
-Straight Barb, 20
-Tee Barb, 20
-To, 20
-Triangle, 20
-Triangle Cap, 20
-Turned Square, 20
-latex, 20
-latex reversed, 20
-o, 20
-stealth, 20
-stealth reversed, 20
-to, 20
-to reversed, 20
<-, 20
<->, 20
>->, 20
6 list of don’t work , 99, 157, 158

196

You might also like