You are on page 1of 2

Picture commands/environments Options & key handling

\tikzpicture[⟨options⟩] … \endtikzpicture TikZ \tikzset{⟨options⟩}


\begin{tikzpicture}[⟨options⟩] …\end{tikzpicture} Reference ⟨key⟩/.cd
\starttikzpicture[⟨options⟩] … \stoptikzpicture ⟨key⟩/.style=⟨key list⟩
\tikz[⟨options⟩]{ … } Card ⟨key⟩/.prefix style=⟨key list⟩
Picture options Scope commands/environments ⟨key⟩/.append style=⟨key list⟩
every picture/.style=⟨key list⟩ \scope[⟨options⟩] … \endscope ⟨key⟩/.pic={⟨code⟩}
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 Scope options ( ⟨angle⟩ : ⟨dimen⟩ ) canvas polar
execute at begin picture=⟨code⟩ every scope/.style=⟨key list⟩ (⟨angle⟩:⟨r⟩) xyz polar
execute at end picture=⟨code⟩ execute at begin scope=⟨code⟩ ( ⟨node name⟩ . {⟨anchor⟩ | ⟨angle⟩} )
Path construction execute at end scope=⟨code⟩ + ⟨coord⟩ rel. current position; no ‘update’
\path[⟨options⟩] … ⟨operation⟩ … ; ++ ⟨coord⟩ rel. current position; ‘updates’
(⟨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⟩
\n{⟨number register⟩} radius=⟨dimen⟩
⟨ factor⟩*⟨coord⟩⟨modifiers⟩{ + | - }⟨computation⟩

[Library: calc]
\p{⟨point register⟩} start angle=⟨angle⟩ !⟨number⟩!⟨angle⟩:⟨coord2⟩
⟨coord⟩ move to end angle=⟨angle⟩ position ⟨number⟩ from ⟨coord⟩ to ⟨coord2⟩
--⟨coord⟩ line to delta angle=⟨angle⟩ ! ⟨dimen⟩ !⟨angle⟩:⟨coord2⟩
-|⟨coord⟩ hor./ver. line to sin⟨coord⟩ sine in [0, 𝜋/2] distance ⟨dimen⟩ from ⟨coord⟩ to ⟨coord2⟩
|-⟨coord⟩ ver./hor. line to cos⟨coord⟩ cosine in [0, 𝜋/2] ! ⟨pr-coord⟩ !⟨angle⟩:⟨coord2⟩
..controls⟨coord1⟩ parabola[⟨options⟩]⟨coord⟩ project ⟨pr-coord⟩ to line from ⟨coord⟩ to ⟨coord2⟩
and⟨coord2⟩..⟨coord⟩ bend=⟨bcoord⟩ Node anchors & references
Bézier cubic curve to bend at start north west 150 north north east
rectangle⟨coord⟩ bend at end
grid[⟨options⟩]⟨coord⟩
xstep=⟨dimen⟩
ystep=⟨dimen⟩
bend pos=⟨bposcoord⟩
parabola height=⟨dimen⟩
to[⟨options⟩]⟨coord⟩
west
base west
mid west
text
Textcenter
mid
base
mid east
east
base east

south west south south east


step=⟨dimen⟩ out=⟨angle⟩
circle[⟨options⟩] circle/ellipse in=⟨angle⟩
Predefined nodes
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⟩
{ plot | --plot } [⟨options⟩]⟨ further arguments⟩ Transformations
coordinates{⟨coord1⟩⟨coord2⟩ … ⟨coord𝑛⟩} { x | y | z } = {⟨dimen⟩ | ⟨coord⟩} xslant=⟨ factor⟩
file{⟨ filename⟩} shift=⟨coord⟩ yslant=⟨ factor⟩
⟨coordinate expression⟩ shift only rotate=⟨angle⟩
function{⟨gnuplot formula⟩} xshift=⟨dimen⟩ rotate around
node⟨ foreach statements⟩[⟨node-options⟩](⟨name⟩)at⟨coord⟩{⟨text⟩} yshift=⟨dimen⟩ ={⟨angle⟩:⟨coord⟩}
coordinate[⟨options⟩](⟨name⟩)at(⟨coord⟩) scale=⟨ factor⟩ rotate around { x | y | z }
node also[⟨options⟩](⟨name⟩) scale around =⟨angle⟩
𝑦 𝑦 𝑦
edge[⟨options⟩]⟨nodes⟩⟨coord⟩ ={⟨ factor⟩:⟨coord⟩}
child[⟨options⟩]⟨ foreach statements⟩{⟨code⟩} xscale=⟨ factor⟩ 𝑥 𝑥 𝑥
edge from parent[⟨options⟩] yscale=⟨ factor⟩ 𝑧 𝑧 𝑧
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
line width=⟨w⟩ dash pattern=⟨pattern⟩ ⟨code⟩ clipped to curr. path (for fill area calc.)
ultra thin 0.1 pt e.g. on 2pt off 3pt use as bounding box pattern=⟨name⟩
very thin 0.2 pt dash phase=⟨length⟩ overlay no effect on bbox calc. pattern color=⟨color⟩
thin 0.4 pt dotted preaction=⟨options⟩ shade (using curr. shading)
semithick 0.6 pt densely dotted postaction=⟨options⟩ shading angle=⟨angle⟩
thick 0.8 pt loosely dotted late options={name= shading=⟨name⟩
very thick 1.2 pt dashed ⟨node name⟩ , ⟨options⟩ } 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
densely dash dot dot double equal sign distance { inner | outer } color
miter limit=⟨ratio⟩ loosely dash dot dot dist. matches = =⟨color⟩
Child options Node options Abbreviations
level distance=⟨dimen⟩ every node/.style=⟨key list⟩ pin={[⟨options⟩] \draw
sibling distance=⟨dimen⟩ node contents=⟨text⟩ {⟨angle⟩ | center } :⟨text⟩} \fill
grow= {⟨angle⟩ | ⟨direction⟩} at={⟨coord⟩} pin distance=⟨angle⟩ \filldraw
{ down | up | left | right behind path pin position=⟨angle⟩ \pattern
| north { west | east } in front of path pin edge={⟨options⟩} \shade
| south { west | east } } name=⟨name⟩ absolute=⟨bool⟩ \shadedraw
grow'= {⟨angle⟩ | ⟨direction⟩} alias=⟨name⟩ label/pin positions \clip
missing=⟨bool⟩ name prefix=⟨text⟩ matrix \useasboundingbox
growth parent anchor=⟨anchor⟩ name suffix=⟨text⟩ every matrix/.style=⟨key list⟩ \node
edge from parent path=⟨path⟩ inner sep=⟨dimen⟩ every cell/.style=⟨key list⟩ \matrix
child anchor=⟨anchor⟩ inner xsep=⟨dimen⟩ column sep= {⟨dimen⟩ | ⟨spacing list⟩}
parent anchor=⟨anchor⟩ inner ysep=⟨dimen⟩ row sep= {⟨dimen⟩ | ⟨spacing list⟩}
every child/.style=⟨key list⟩ outer sep=⟨dimen⟩ { {⟨dimen⟩ | between origins,
every child node/.style=⟨key list⟩ outer xsep=⟨dimen⟩ | between borders } ,⟨spacing list⟩}
level/.style=⟨key list⟩ outer ysep=⟨dimen⟩ cells={⟨options⟩}
level ⟨number⟩/.style=⟨key list⟩ minimum width=⟨dimen⟩ nodes={⟨options⟩}
edge from parent/.style=⟨key list⟩ minimum height=⟨dim.⟩ { column | row } ⟨number⟩={⟨options⟩}
Plot options minimum size=⟨dimen⟩ every odd { column | row } ={⟨options⟩}
variable=⟨macro name⟩ shape aspect=⟨ratio⟩ every even { column | row } ={⟨options⟩}
samples=⟨number⟩ text=⟨color⟩ matrix anchor=⟨anchor⟩
domain=⟨start⟩:⟨end⟩ node font=⟨commands⟩ anchor= {⟨anchor⟩ | ⟨node⟩.⟨anchor⟩}
samples at={⟨sample list⟩} sets ex & em dimens ampersand replacement= {⟨macro name⟩ | ⟨empty⟩}
⟨number⟩,⟨sample list⟩ font=⟨commands⟩
Opacity
parametric=⟨bool⟩ does not set ex & em
draw opacity=⟨number⟩ transparent
[function only]

{ range | xrange | yrange } text width=⟨dimen⟩


fill opacity=⟨number⟩ ultra nearly transparent
=⟨start⟩:⟨end⟩ align=⟨alignment⟩
text opacity=⟨number⟩ very nearly transparent
id=⟨plot id⟩ left
opacity=⟨number⟩ nearly transparent
prefix=⟨prefix⟩ flush left
semitransparent
raw gnuplot right
nearly opaque
every plot/.style=⟨key list⟩ flush right
very nearly opaque
mark= { * | + | x | ball } center
ultra nearly opaque
mark repeat=⟨number⟩ flush center
opaque
mark phase=⟨number⟩ justify
mark indices=⟨list⟩ none
mark size=⟨dimen⟩ transform shape
every mark/.style=⟨key list⟩ apply curr. transform. to node
mark options={⟨options⟩} shape= { rectangle | circle
no { marks | markers } | coordinate | ⟨name⟩}
sharp plot anchor=⟨name⟩
smooth { above | below | left | right }
tension=⟨number⟩ =⟨shift-part⟩⟨of-part⟩
[Library: positioning]

smooth cycle { above | mid | base | below }


const plot { left | right } =⟨shift-part⟩⟨of-part⟩
const plot mark left
of {⟨coord⟩ | ⟨node name⟩}
const plot mark right
⟨dimen⟩
const plot mark mid }offset
⟨number⟩
jump mark left
{⟨number1⟩ | ⟨dimen1⟩}
jump mark right
and {⟨number2⟩ | ⟨dimen2⟩}
jump mark mid
on grid
ycomb
node distance=⟨shift-part⟩
xcomb
default ⟨shift-part⟩
polar comb
pos=⟨num.⟩
ybar
at start pos=0
xbar pos=0.125
very near start
ybar interval pos=0.25
near start
xbar interval
midway pos=0.5
only marks
near end
pos=0.75
Pic options very near end pos=0.875
every pic/.style=⟨key list⟩ at end pos=1
pic type=⟨pic type⟩ auto= { left | right }
pics/code=⟨code⟩ { swap | ' } swaps right & left
pics/foreground code=⟨code⟩ sloped rotated to tangent
pics/background code=⟨code⟩ allow upside down=⟨bool⟩ © 2014–16 Alan J. Cain (a.cain@fct.unl.pt)
pic text=⟨text⟩ label={[⟨options⟩] This work is licensed under the Creative Commons Attribution–Non-Com-
pic text options=⟨options⟩ {⟨angle⟩ | center } :⟨text⟩} mercial–ShareAlike 4.0 International Licence. To view a copy of this licence,
pic action label distance=⟨angle⟩ visit: creativecommons.org/licenses/by-nc-sa/4.0/
name prefix label position=⟨angle⟩ ver. 0.4.2 (2016-04-15) www-groups.mcs.st-and.ac.uk/~alanc/pub/c_tikzref/

You might also like