Tx · LaTeX & TikZ

How to Draw a TikZ Line Thinner Than 0.1 mm

Published By the 9to5Science editorial team

At a glance

  1. 1. Set the width

    Use TikZ’s line width option with a physical dimension, such as line width=0.05mm.

  2. 2. Apply it where needed

    Put the option on one draw command or on the tikzpicture to affect its paths.

  3. 3. Check the output

    Inspect the final-size PDF or print; very thin strokes may disappear when rasterized or printed.

TikZ can draw strokes thinner than 0.1 mm. Specify the stroke width with the line width option and a TeX dimension, such as line width=0.05mm. Set the option on an individual path or on the whole picture, depending on whether you want one line or many paths to use that width.

A small vector stroke can still look faint or vanish in a screenshot, low-resolution export, or print. The requested width may be valid even when a particular display or output device cannot reproduce it clearly.

Set a precise line width

Use line width=<dimension> inside TikZ’s square-bracket options. TikZ accepts ordinary TeX units, including mm, cm, pt, and bp.

For example, this sets one path to 0.05 mm:

\draw[line width=0.05mm] (0,0) -- (3,0);

To set the width for paths in a whole picture, place the option after \begin{tikzpicture}:

\begin{tikzpicture}[line width=0.05mm]
  \draw (0,0) -- (3,0);
  \draw (0,0.5) -- (3,0.5);
\end{tikzpicture}

The second form applies the setting to both paths unless a path has its own line-width option. A local setting on a path takes precedence for that path.

Complete example

This minimal document uses the tikz package and draws three lines for comparison. The first two are thinner than 0.1 mm; the last uses TikZ’s default line width.

\documentclass{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
  \draw[line width=0.05mm] (0,2) -- (4,2)
    node[right] {0.05 mm};
  \draw[line width=0.09mm] (0,1) -- (4,1)
    node[right] {0.09 mm};
  \draw (0,0) -- (4,0)
    node[right] {default};
\end{tikzpicture}
\end{document}

Compile it with a LaTeX engine that supports the standalone class, such as pdfLaTeX. If your document does not use that class, replace standalone with article and add \pagestyle{empty} if you want to suppress page numbers.

What the units mean

TikZ’s default line width is 0.4 pt, which is about 0.141 mm. The conversion uses TeX points: 1 pt is approximately 0.35146 mm. So 0.1 mm is about 0.285 pt, and 0.05mm is about 0.142 pt. These conversions explain why the default stroke is thicker than 0.1 mm.

TikZ also provides named width styles. ultra thin sets the width to 0.1 pt, about 0.035 mm, so it is below 0.1 mm. For a specific physical width, an explicit setting such as line width=0.05mm is clearer and more predictable than choosing a named style.

Common mistakes and output limits

  • Using thin and expecting less than 0.1 mm: thin is a named style, not a request for an arbitrarily small stroke; its standard width is 0.4 pt. Give the width explicitly when you need a particular measurement.
  • Changing the coordinate scale instead: Adjusting coordinates changes the drawing’s geometry, not the stroke width requested by line width.
  • Judging from a zoomed-out preview: A PDF stores vector strokes, but a screen must rasterize them into pixels. At ordinary zoom, a very thin stroke can appear faint, uneven, or missing. Zoom in or inspect a higher-resolution export.
  • Ignoring the printer or final size: A printer may not reproduce a very fine line consistently. Test the intended output size and device. If a line must remain easy to see, choose a width that the output process can reliably reproduce rather than relying only on the PDF’s nominal dimension.

If the setting appears to have no effect, check that line width is attached to the path or picture you mean to style, and check whether a later style or path option overrides it.

References

  1. The TikZ and PGF Packages: Manual for Version 3.1.11

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.