# Why not scale elements that contain text

Why is it a bad idea to scale elements that contain text, for example tables, by using \resizebox, \scalebox and similar commands?

(I could not find an existing questions about this, but I often mention it in comments, so I think it might be a good idea to have a questions one can easily link to)

For good fonts, different font sizes don't only have a different size, but the actual shape of the letters is different.

Consider the following example:

\documentclass{article}

\begin{document}

\resizebox{3cm}{!}{\tiny Q}
\resizebox{3cm}{!}{\Huge Q}

\end{document}


As one can see the shape of the letters is different. For the tiny font, the strokes are thicker compared to the large font. This ensures that small symbols are still readable.

If one merely scales a font, the size of the letters from the current font size is changed, but the shape of the letters is not changed.

For the best possible result, it is thus better to choose an appropriate font size instead of scaling elements that contain text.

• different shape depends to the kind of font. Try \usepackage{libertinus} ... You are using different fonts for \tiny and \Huge. It is obvious that you have different font shapes for \resizebox – user187802 May 19 '19 at 15:11

Scaling an element which contains text will result in an inconsistent font size compared to the rest of the document.

Especially automatic scaling to fit a table to the text width (\resizebox{\textwidth}{!}{...}) will ensure that each and every table with have another font size which will look messy.

• Inconsistent font sizes in tables look messy, but the alternative is to change the table structure or contents to fit the page (e.g., creating multiline cells, abbreviating, creating two small tables instead of a larger one) which can also be messy and/or reduce clarity of the information. Or keeping normal size, keeping all content, and letting the table stick out in the margins, which is really messy. So sometimes resizing can be the most acceptable solution. – Marijn May 19 '19 at 16:40

Only for fonts which have different optical sizes of the font, e.g. Latin Modern for 5pt and 17 pt. Without such own font files you'll get the same. For example the Libertinus:

\documentclass{article}
\usepackage{graphicx}
\usepackage[T1]{fontenc}
\begin{document}

\resizebox{3cm}{!}{\tiny Q}
\resizebox{3cm}{!}{\Huge Q}

\fontfamily{LibertinusSerif-LF}\selectfont
\resizebox{3cm}{!}{\tiny Q}
\resizebox{3cm}{!}{\Huge Q}

\end{document}


The embedded fonts are:

bash-3.2\$ pdffonts document.pdf
name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
DJAQCM+LMRoman5-Regular              Type 1C           WinAnsi          yes yes yes      4  0
OQYFCQ+LMRoman17-Regular             Type 1C           WinAnsi          yes yes yes      5  0
AJPGYT+LibertinusSerif               Type 1C           WinAnsi          yes yes yes      6  0
OWXLSH+LMRoman10-Regular             Type 1C           WinAnsi          yes yes yes      7  0