Add dimension arrows to technical drawings in TikZ.
Dimensioning a drawing requires extension lines, arrow tips, and centered text labels. The arrows.meta library provides the arrow heads, and node positions place the measurements cleanly outside the part.
The short answer: load \usetikzlibrary{arrows.meta, calc}, draw extension lines from your geometry, and place double-ended arrows between them with node[midway] for the text.
The basic dimension line
A dimension line needs arrow tips at both ends, offset extension lines so the arrows do not touch the object, and a label floating midway above or inside the span.
The standard way uses the arrows.meta library for modern arrow heads, combined with coordinate calculations from the calc library to position the dimension bar at a set distance from the object.
A complete dimensioning example
This example draws a base line, drops two extension lines downward, and places a dimension arrow with a centered label between them.
Choosing arrow tips for dimensions
Technical bars (|--|)
Engineering drawings usually use small perpendicular ticks or architectural slashes instead of filled triangle arrow heads at the ends of a dimension line.
\draw [{Bar[width=3mm]}-{Bar[width=3mm]}] (0,0) -- (5,0);Standard arrows (<->)
For schematics and general diagrams, standard filled arrow heads from the arrows.meta library work best. Scale them to match your line width.
\draw [{Stealth[length=2mm, width=1.5mm]}-{Stealth[length=2mm, width=1.5mm]}] (0,0) -- (5,0);
Building a reusable dimension macro
If your drawing has many dimensions, writing extension offsets by hand gets repetitive. A custom style or macro keeps the distance consistent across every part of the figure.
Set an offset variable using \pgfmathsetmacro or a TikZ style key so you can drop dimensions with a single path command.
Questions
How do I make the dimension arrows smaller?
Use the arrows.meta library and pass length and width parameters inside square brackets, such as {Stealth[length=2mm, width=1.5mm]}.
How do I place text in the middle of the dimension line?
Add a node with the midway option inside your draw command, such as node[midway, above] {$50\text{ mm}$}.
Why do my dimension arrows touch the object?
You need extension lines between the object and the dimension bar. Draw short perpendicular lines from your object points before drawing the main dimension span.
Try your own paper in Texeno.
Start free, upload a project as a .zip and press Recompile. Upgrade when you need longer compiles.
Start writing