[Library: calc]
Picture commands/environments
Options & key handling
TikZ
\tikzpicture[⟨options⟩] …
\endtikzpicture
\tikzset{⟨options⟩}
\begin{tikzpicture}[⟨options⟩] …\end{tikzpicture}
⟨key⟩/.cd
Reference
\starttikzpicture[⟨options⟩] … \stoptikzpicture
⟨key⟩/.style=⟨key list⟩
Card
\tikz[⟨options⟩]{ … }
⟨key⟩/.prefix style=⟨key list⟩
⟨key⟩/.append style=⟨key list⟩
Picture options
Scope commands/environments
⟨key⟩/.pic={⟨code⟩}
every picture/.style=⟨key list⟩
\scope[⟨options⟩] …
\endscope
baseline=⟨ycoord⟩
\begin{scope}[⟨options⟩] …\end{scope} Coordinate specification
trim left=⟨xcoord⟩
\startscope[⟨options⟩] … \stopscope
(⟨xdimen⟩,⟨ydimen⟩) canvas
trim right=⟨xcoord⟩
\scoped[⟨options⟩]{ … }
(⟨x⟩,⟨y⟩,⟨z⟩)
xyz
remember picture
(
⟨angle⟩
:
⟨dimen⟩
)
canvas polar
Scope options
execute at begin picture=⟨code⟩ every scope/.style=⟨key list⟩
(⟨angle⟩:⟨r⟩)
xyz polar
execute at end picture=⟨code⟩
(
⟨node
name⟩
.
{⟨anchor⟩
| ⟨angle⟩} )
execute at begin scope=⟨code⟩
+
⟨coord⟩
rel.
current
position;
no ‘update’
Path construction
execute at end scope=⟨code⟩
++
⟨coord⟩
rel.
current
position;
‘updates’
\path[⟨options⟩] … ⟨operation⟩ … ;
(⟨coord1⟩-|⟨coord2⟩) intersection of hor. and ver. lines
foreach⟨variables⟩[⟨options⟩]
arc[⟨options⟩] elliptical arc
(⟨coord1⟩|-⟨coord2⟩) intersection of ver. and hor. lines
in{⟨code⟩}
x radius=⟨dimen⟩
($⟨computation⟩$)
let⟨assignments⟩in
y radius=⟨dimen⟩
⟨ factor⟩*⟨coord⟩⟨modifiers⟩{ + | - }⟨computation⟩
\n{⟨number register⟩}
radius=⟨dimen⟩
!⟨number⟩!⟨angle⟩:⟨coord2⟩
\p{⟨point register⟩}
start angle=⟨angle⟩
position ⟨number⟩ from ⟨coord⟩ to ⟨coord2⟩
⟨coord⟩
move to
end angle=⟨angle⟩
!
⟨dimen⟩
!⟨angle⟩:⟨coord2⟩
--⟨coord⟩ line to
delta angle=⟨angle⟩
distance
⟨dimen⟩ from ⟨coord⟩ to ⟨coord2⟩
-|⟨coord⟩ hor./ver. line to
sin⟨coord⟩ sine in [0, 𝜋/2]
!
⟨pr-coord⟩
!⟨angle⟩:⟨coord2⟩
|-⟨coord⟩ ver./hor. line to
cos⟨coord⟩ cosine in [0, 𝜋/2]
project
⟨pr-coord⟩
to line from ⟨coord⟩ to ⟨coord2⟩
..controls⟨coord1⟩
parabola[⟨options⟩]⟨coord⟩
and⟨coord2⟩..⟨coord⟩
Node anchors & references
bend=⟨bcoord⟩
Bézier cubic curve to
bend at start
north west
north
north east
150
rectangle⟨coord⟩
bend at end
grid[⟨options⟩]⟨coord⟩
bend pos=⟨bposcoord⟩
center
east
west
mid east
mid west
mid
xstep=⟨dimen⟩
parabola height=⟨dimen⟩
base west
base east
text
base
ystep=⟨dimen⟩
to[⟨options⟩]⟨coord⟩
south west
south
south east
step=⟨dimen⟩
out=⟨angle⟩
Predefined nodes
circle[⟨options⟩] circle/ellipse
in=⟨angle⟩
current bounding box
x radius=⟨dimen⟩
edge node=⟨nodespec⟩
current path bounding box
y radius=⟨dimen⟩
edge label=⟨text⟩
current subpath start
(coordinate)
radius=⟨dimen⟩
edge label'=⟨text⟩
current page
at=⟨coord⟩
at=⟨coord⟩
Transformations
{ plot | --plot } [⟨options⟩]⟨ further arguments⟩
{ x | y | z } = {⟨dimen⟩ | ⟨coord⟩} xslant=⟨ factor⟩
coordinates{⟨coord1⟩⟨coord2⟩ … ⟨coord𝑛⟩}
shift=⟨coord⟩
yslant=⟨ factor⟩
file{⟨ filename⟩}
shift only
rotate=⟨angle⟩
⟨coordinate expression⟩
xshift=⟨dimen⟩
rotate around
function{⟨gnuplot formula⟩}
yshift=⟨dimen⟩
={⟨angle⟩:⟨coord⟩}
node⟨ foreach statements⟩[⟨node-options⟩](⟨name⟩)at⟨coord⟩{⟨text⟩}
scale=⟨ factor⟩
rotate around { x | y | z }
coordinate[⟨options⟩](⟨name⟩)at(⟨coord⟩)
scale around
=⟨angle⟩
node also[⟨options⟩](⟨name⟩)
𝑦
𝑦
𝑦
={⟨ factor⟩:⟨coord⟩}
edge[⟨options⟩]⟨nodes⟩⟨coord⟩
xscale=⟨ factor⟩
𝑥
𝑥
𝑥
child[⟨options⟩]⟨ foreach statements⟩{⟨code⟩}
yscale=⟨ factor⟩
edge from parent[⟨options⟩]
𝑧
𝑧
𝑧
pic⟨ foreach statements⟩[⟨options⟩](⟨prefix⟩)at⟨coord⟩{⟨pic type⟩}
Path options
every path/.style=⟨key list⟩
clip
fill=⟨color⟩
draw=⟨color⟩
path picture={⟨code⟩}
{ nonzero | even odd } rule
⟨code⟩ clipped to curr. path
(for fill area calc.)
line width=⟨w⟩
dash pattern=⟨pattern⟩
use as bounding box
pattern=⟨name⟩
0.1 pt
ultra thin
e.g. on 2pt off 3pt
overlay no effect on bbox calc.
pattern color=⟨color⟩
0.2 pt
very thin
dash phase=⟨length⟩
preaction=⟨options⟩
shade (using curr. shading)
thin
0.4 pt
dotted
postaction=⟨options⟩
shading angle=⟨angle⟩
semithick
0.6 pt
densely dotted
late options={name=
shading=⟨name⟩
thick
0.8 pt
loosely dotted
⟨node
name⟩
,
⟨options⟩
}
very thick
1.2 pt
dashed
axis
ultra thick
1.6 pt
densely dashed
⟨arrow spec.⟩-⟨arrow spec.⟩
{ top | bottom | middle
rounded corners=⟨dimen⟩
loosely dashed
double=⟨color⟩
| left | right } color
sharp corners
dash dot
double distance=⟨dim.⟩
=⟨color⟩
line cap= { butt | rect | round }
densely dash dot
dist. between inner borders
ball
loosely dash dot
double between line centers
ball color=⟨color⟩
line join= { bevel | miter | round } dash dot dot
=⟨dim.⟩
radial
{ inner | outer } color
densely dash dot dot
double equal sign distance
miter limit=⟨ratio⟩
loosely dash dot dot
dist. matches =
=⟨color⟩
Text
Child options
Node options
level distance=⟨dimen⟩
sibling distance=⟨dimen⟩
grow= {⟨angle⟩ | ⟨direction⟩}
Pic options
every pic/.style=⟨key list⟩
pic type=⟨pic type⟩
pics/code=⟨code⟩
pics/foreground code=⟨code⟩
pics/background code=⟨code⟩
pic text=⟨text⟩
pic text options=⟨options⟩
pic action
name prefix
pin={[⟨options⟩]
{⟨angle⟩ | center } :⟨text⟩}
pin distance=⟨angle⟩
pin position=⟨angle⟩
pin edge={⟨options⟩}
absolute=⟨bool⟩
label/pin positions
matrix
every matrix/.style=⟨key list⟩
every cell/.style=⟨key list⟩
column sep= {⟨dimen⟩ | ⟨spacing list⟩}
row sep= {⟨dimen⟩ | ⟨spacing list⟩}
{ {⟨dimen⟩ | between origins,
| between borders } ,⟨spacing list⟩}
cells={⟨options⟩}
nodes={⟨options⟩}
{ column | row } ⟨number⟩={⟨options⟩}
every odd { column | row } ={⟨options⟩}
every even { column | row } ={⟨options⟩}
matrix anchor=⟨anchor⟩
anchor= {⟨anchor⟩ | ⟨node⟩.⟨anchor⟩}
ampersand replacement= {⟨macro name⟩ | ⟨empty⟩}
sets ex & em dimens
font=⟨commands⟩
does not set ex & em
text width=⟨dimen⟩
align=⟨alignment⟩
\draw
\fill
\filldraw
\pattern
\shade
\shadedraw
\clip
\useasboundingbox
\node
\matrix
Opacity
left
flush left
right
flush right
center
flush center
justify
none
transform shape
draw opacity=⟨number⟩
fill opacity=⟨number⟩
text opacity=⟨number⟩
opacity=⟨number⟩
transparent
ultra nearly transparent
very nearly transparent
nearly transparent
semitransparent
nearly opaque
very nearly opaque
ultra nearly opaque
opaque
apply curr. transform. to node
shape= { rectangle | circle
| coordinate | ⟨name⟩}
anchor=⟨name⟩
{ above | below | left | right }
=⟨shift-part⟩⟨of-part⟩
{ above | mid | base | below }
{ left | right } =⟨shift-part⟩⟨of-part⟩
of {⟨coord⟩ | ⟨node name⟩}
⟨dimen⟩
}offset
⟨number⟩
{⟨number1⟩ | ⟨dimen1⟩}
and {⟨number2⟩ | ⟨dimen2⟩}
[Library: positioning]
raw gnuplot
every plot/.style=⟨key list⟩
mark= { * | + | x | ball }
mark repeat=⟨number⟩
mark phase=⟨number⟩
mark indices=⟨list⟩
mark size=⟨dimen⟩
every mark/.style=⟨key list⟩
mark options={⟨options⟩}
no { marks | markers }
sharp plot
smooth
tension=⟨number⟩
smooth cycle
const plot
const plot mark left
const plot mark right
const plot mark mid
jump mark left
jump mark right
jump mark mid
ycomb
xcomb
polar comb
ybar
xbar
ybar interval
xbar interval
only marks
[function only]
{ down | up | left | right
| north { west | east }
| south { west | east } }
grow'= {⟨angle⟩ | ⟨direction⟩}
missing=⟨bool⟩
growth parent anchor=⟨anchor⟩
edge from parent path=⟨path⟩
child anchor=⟨anchor⟩
parent anchor=⟨anchor⟩
every child/.style=⟨key list⟩
every child node/.style=⟨key list⟩
level/.style=⟨key list⟩
level ⟨number⟩/.style=⟨key list⟩
edge from parent/.style=⟨key list⟩
Plot options
variable=⟨macro name⟩
samples=⟨number⟩
domain=⟨start⟩:⟨end⟩
samples at={⟨sample list⟩}
⟨number⟩,⟨sample list⟩
parametric=⟨bool⟩
{ range | xrange | yrange }
=⟨start⟩:⟨end⟩
id=⟨plot id⟩
prefix=⟨prefix⟩
Abbreviations
every node/.style=⟨key list⟩
node contents=⟨text⟩
at={⟨coord⟩}
behind path
in front of path
name=⟨name⟩
alias=⟨name⟩
name prefix=⟨text⟩
name suffix=⟨text⟩
inner sep=⟨dimen⟩
inner xsep=⟨dimen⟩
inner ysep=⟨dimen⟩
outer sep=⟨dimen⟩
outer xsep=⟨dimen⟩
outer ysep=⟨dimen⟩
minimum width=⟨dimen⟩
minimum height=⟨dim.⟩
minimum size=⟨dimen⟩
shape aspect=⟨ratio⟩
text=⟨color⟩
node font=⟨commands⟩
on grid
node distance=⟨shift-part⟩
default ⟨shift-part⟩
pos=⟨num.⟩
at start
pos=0
pos=0.125
very near start
pos=0.25
near start
midway
pos=0.5
near end
pos=0.75
very near end
pos=0.875
at end
pos=1
auto= { left | right }
{ swap | ' } swaps right & left
sloped rotated to tangent
allow upside down=⟨bool⟩
label={[⟨options⟩]
{⟨angle⟩ | center } :⟨text⟩}
label distance=⟨angle⟩
label position=⟨angle⟩
© 2014–16 Alan J. Cain ([email protected])
This work is licensed under the Creative Commons Attribution–Non-Commercial–ShareAlike 4.0 International Licence. To view a copy of this licence,
visit: creativecommons.org/licenses/by-nc-sa/4.0/
ver. 0.4.2 (2016-04-15)
www-groups.mcs.st-and.ac.uk/~alanc/pub/c_tikzref/
© Copyright 2026 Paperzz