[Tex/LaTex] How to specify document font size less than 8pt

fontsfontsize

I want to use the smallest readable font for cheatsheet,
\documentclass[6pt]{extarticle}
doesn't work

Best Answer

The key is to pick a font that supports arbitrary scaling, such as lmodern, and then use the \fontsize{}{}\selectfont approach to select it. The revised font size will stay active until subsequently changed.

As to default size at startup, LaTeX only supports 10pt, 11pt, and 12pt, which is why the [6pt] option was ignored in the OP's approach.

\documentclass[12pt]{article}
\usepackage{lmodern}
\begin{document}
XYZxyz\par
\fontsize{11pt}{12pt}\selectfont XYZxyz\par
\fontsize{10pt}{11pt}\selectfont XYZxyz\par
\fontsize{9pt}{10pt}\selectfont XYZxyz\par
\fontsize{8pt}{9pt}\selectfont XYZxyz\par
\fontsize{7pt}{8pt}\selectfont XYZxyz\par
\fontsize{6pt}{7pt}\selectfont XYZxyz\par
\fontsize{5pt}{6pt}\selectfont XYZxyz\par
\fontsize{4pt}{5pt}\selectfont XYZxyz\par
\fontsize{3pt}{4pt}\selectfont XYZxyz\par
\fontsize{2pt}{3pt}\selectfont XYZxyz\par
\fontsize{1pt}{2pt}\selectfont XYZxyz
\end{document}

enter image description here

Eliminating the use of lmodern, one will find that the fontsize cannot be reduced below 5pt, since the default computer-modern font is not arbitrarily scalable.

enter image description here

p.s. With lmodern selected, one should just as well add \usepackage[T1]{fontenc} to the preamble, to take advantage of the extra glyph set.