The KOMA-Script key fontsize
can be used to switch the font size mid-document (as well as at the start of the document). However, it adds spurious spaces when switching to 10pt
, 11pt
or 12pt
, as can be seen in the MWE below. This seems to only happen for those sizes.
Why is this happening and how can I prevent it?
\documentclass{scrartcl}
\usepackage{lmodern}
\def\fontsizetest#1{%
\noindent\makebox[2em][r]{#1}:
{X\KOMAoptions{fontsize=#1}X}\par
}
\begin{document}
\fontsizetest{9pt}
\fontsizetest{9.5pt}
\fontsizetest{10pt}
\fontsizetest{10.5pt}
\fontsizetest{11pt}
\fontsizetest{11.5pt}
\fontsizetest{12pt}
\fontsizetest{12.5pt}
\fontsizetest{13pt}
\end{document}
%
in the class but do you ever really want to change the document layout mid-paragraph? spaces are harmless in vertical mode\fontsize
command\fontsize
doesn't set up\large
and friends, does it? KOMA-Script changes all of those, as well as setting up dimensions like\abovedisplayskip
.tikzpictures
that I need to scale up (usingadjustbox
; there is no good way to scale all the relevant dimensions using TikZ itself), so I need to reset the font size to a small value for thetikzpictures
.