17

Can the scrartcl class make a true 14 point type?

It will produce 13.999pt, 13.9999pt and 13.99998pt, but 14pt produces 14.4 point type only.

Thanks :)

\documentclass[fontsize=13.999pt]{scrartcl}
\usepackage[letterpaper]{geometry}
\usepackage{fontspec}
\setmainfont{Vollkorn}

   \makeatletter

\def\showfontsize{\f@size{} point}

    \makeatother

\begin{document}

  \showfontsize 

\end{document}

enter image description here

Changing the fontsize to 14pt:

\documentclass[fontsize=14.000pt]{scrartcl}

Produces:

enter image description here

Also changing the fontsize to 13.999999pt, 13.9999999pt, 13.99999999pt, and so on, also results in 14.4pt type.

Strangely enough this:

\documentclass[fontsize=14.00001pt]{scrartcl}

Produces:

enter image description here

and this:

\documentclass[fontsize=14.000001pt]{scrartcl}

Produces:

enter image description here

Closely related: How can i change the fontsize with KOMA-script?

Related: Scrbook: Using fallback calculation to setup font sizes

  • Even 13.999pt produces a 14.4pt font... – Werner Apr 28 '16 at 3:24
  • I'm compiling with LuaLatex and using Vollkorn, texlive 2015 on Ubuntu 14.04. On my machine it changes over at 13.999999 – A Feldman Apr 28 '16 at 3:40
  • I guess that 14.00002pt type is functionally 14 point. It just seems curious that it seemingly cannot be set to 14.0pt. – A Feldman Apr 28 '16 at 5:15
  • That's because the font is only available at 14.4pt. You have to use a font that is fully scalable to all possible points. – Werner Apr 28 '16 at 5:21
  • 2
    The resulting font size depends on whether the fallback calculation is used or a font size definition file for the size is available. For example, if you have installed package extsizes, size14.clo will be loaded. size14.clo uses 14.4pt for 14pt. You can make your own font size using package scrfontsizes or by renaming and editing an existing file like scrsize10pt.clo. – Schweinebacke Apr 28 '16 at 7:20
21

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:

14 point

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}
  • 5
    Welcome back to TeX.SX! – egreg Apr 28 '16 at 8:17
  • Fantastic answer, thank you so much. In making the font definition file would I have to find the path to the other *.clo files and compile in that directory, and then texmf, or would compiling in a user directory suffice? – A Feldman Apr 28 '16 at 13:35
  • I meant rather texhash. – A Feldman Apr 28 '16 at 14:39
  • So scrfontsizes generated the file afsize14pt.clo which I then put in a folder I named AltKomaSizes in my ~/texmf directory. I then did a texhash ~/texmf which seemed to install the 14 point font system wide without having to use \newcommand*{\@fontsizefilebase}{afsize} in subsequent documents. Is what I did the right way to use the answer? – A Feldman Apr 28 '16 at 14:46
  • @AFeldman Putting the file afsize14.clo in a local texmf tree ensures that the file will be found if it is searched. But you have to use \newcommand*{\@fontsizefilebase}{afsize} if the file afsize14.clo should be searched. – esdd Apr 29 '16 at 9:15
15

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.

  • 1
    Loading scrsize….clo or size….clo is not restricted by the font sizes, but by the available files. – Schweinebacke Apr 28 '16 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.