Scrartcl 13.999 point 14.4 point but not 14 point?
KOMA-Script supports several ways to set the font size. First of all, if you want fontsize=
<value> it tries to load a font size definition file \@fontsizefilebase
<value>.clo. If this is not found, it tries \@fontsizefilebase
<value>pt.clo
. If this is not found, it tries size
<adapted value>.clo
. <adapted value> is the font size in pt but with stripped pt
, it results, e.g., in 10
for 10pt, 11
for 11pt
, and 14
for 14pt
. Last but not least KOMA-Script provides a fallback calculation for font sizes without font size definition files.
The default for \@fontsizefilebase
is scrsize
, but you can change it before \documentclass
.
So with fontsize=14pt
, scrartcl
searches for scrsize14pt.clo
and size14.clo
. If you have installed package extsizes
, it will find size14.clo
. There you can find:
\renewcommand\normalsize{%
\@setfontsize\normalsize\@xivpt{17}%
and in the LaTeX kernel:
\def\@xivpt{14.4}
This is the reason for getting 14.4pt instead of 14pt.
If you really want 14pt, you need to make your own font size definition file. You can use scrsize10pt.clo
, rename it and change the values. Or you can use:
\documentclass{scrartcl}
\usepackage{scrfontsizes}
\generatefontfile{afsize}{14pt}
\begin{document}
Test
\end{document}
to generate afsize14pt.clo
. After generating the font definition file:
\makeatletter
\newcommand*{\@fontsizefilebase}{afsize}
\makeatother
\documentclass[fontsize=14pt]{scrartcl}
\usepackage[letterpaper]{geometry}
\usepackage{fontspec}
\makeatletter
\def\showfontsize{\f@size{} point}
\makeatother
\begin{document}
\showfontsize
\end{document}
Will result in:
Last but not least
\documentclass[letterpaper,fontsize=14pt]{scrartcl}
\KOMAoptions{fontsize=14pt}
\makeatletter
\def\showfontsize{\f@size{} point}
\makeatother
\begin{document}
\showfontsize
\end{document}
Would also result in using 14pt, because \KOMAoptions{fontsize=14pt}
uses the fall back calculation. This is the same font size calculation, that is used by \generatefontsizes
. Nevertheless, in this example initialisation of some load time lengths of scrartcl
could be done with, e.g., the font size of size14.clo
. So combining both methods would be a save solution, if your document needs at least two LaTeX runs:
\makeatletter
\newcommand*{\@fontsizefilebase}{afsize}% setup prefix of font declaration files
\makeatother
\documentclass[letterpaper,fontsize=14pt]{scrartcl}
% Generate and use the font size declaration file, if is does not exist
\IfFileExists{\csname @fontsizefilebase\endcsname 14pt.clo}{}{%
\usepackage{scrfontsizes}
\generatefontfile{afsize}{14pt}
\KOMAoptions{fontsize=14pt}
}
\begin{document}
\csname f@size\endcsname\ point
\end{document}
KOMA has two different systems to setup the font sizes:
A (small) number of fontsize options (8pt, 9pt, 10pt, 11pt, 12pt, 14pt 17pt, 20pt) load a scrsizeXX.clo
(from KOMA) or (if found) sizeXX.clo
(from the extsize
package) where designated fontsizes are declared. You can add more options to this list by writing a suitable sizeXX.clo
or scrsizeXX.clo
. In this cases the actual fontsize can differ from the name (this is the same as with the standardclasses). This happens here:
\documentclass[fontsize=14pt]{scrartcl}
\begin{document}
blub
\end{document}
Class scrartcl Info: File `size14.clo' used to setup font sizes on input line 2033.
It is possible that due to rounding error values near e.g. 14pt triggers the loading of a size14.clo too.
For other values of fontsize it will calculate the fontsize. In this case the fontsize will exactly as wanted.
For pdflatex documents is it still possible that fontsizes changes due to the declaration in the fd-files. E.g.
\documentclass[fontsize=13.8pt]{scrartcl}
\begin{document}
blub
\end{document}
leads to
LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <13.8> not available
(Font) size <14.4> substituted on input line 2033.
In this case you need e.g. the package fix-cm. With xelatex and lualatex this is not necessary.