3.6 Libraries
Syntax
TikZ libraries are used to extend functionality and provide commonly needed tools without having to program everything manually. They contain predefined commands, styles, shapes, or positioning options that simplify complex tasks. A \usetikzlibrary command can look like this:
\usetikzlibrary{
positioning,
arrows.meta,
shapes.geometric,
calc
}
Copy
Types
There are various libraries. Below is a list of important TikZ libraries and their purposes:
arrows / arrows.meta: defines various arrow tips and line styles.
positioning: makes it easy to position nodes relative to each other (e.g., "right=of node").
shapes.geometric: geometric shapes such as diamond, circle, ellipse.
shapes.misc: additional shapes like trapezoid, parallelogram, cloud.
decorations.pathreplacing: for decorative lines, arcs, or brackets along paths.
decorations.markings: allows arrows or marks at specific points along lines.
calc: extends mathematical operations for coordinate calculations.
fit: groups multiple nodes into a frame or container.
matrix: easy creation of tables or grids using nodes.
3d / 3dplot: for three-dimensional coordinates and perspectives.