The documentation (scrguien
) says about the title (I highlighted the relevant part):
The title is output with a very large font size. Besides the change of
size, the settings for the element title also take effect. By default
these settings are identical to the settings for the element
disposition (see table 3.2, page 51). The default settings may be
changed using the commands \setkomafont
and \addtokomafont
(see
section 3.6, page 51). The font size is, however, not affected (see
table 3.2, page 59).
The reason why the change of font size performed with \setkomafont
won't have effect is because scrartcl.cls
uses
\titlefont\huge \@title\par
so any modification to the font size made with \setkomafont
(applied through \titlefont
) will be overwritten by the \ḩuge
command after \titlefont
.
Here's a possible solution using the etoolbox
package to patch the internal command \@maketitle
to change the default \huge
(instead of \small
use the desired size):
\documentclass{scrartcl}
\usepackage{etoolbox}
\setkomafont{title}{\normalfont\bfseries}
\makeatletter
\patchcmd{\@maketitle}{\titlefont\huge}{\titlefont\small}{}{}
\makeatother
\title{The Title}
\author{The Author}
\begin{document}
\maketitle
\end{document}
As lockstep mentions, the above solution will produce the desired solution if the titlepage
option is false (which is the default). If the titlepage
option is set to true, one can patch \maketitle
with the help of the xpatch
package:
\documentclass[titlepage]{scrartcl}
\usepackage{xpatch}
\setkomafont{title}{\normalfont\bfseries}
\makeatletter
\xpatchcmd{\maketitle}{\titlefont\huge}{\titlefont\small}{}{}
\makeatother
\title{The Title}
\author{The Author}
\begin{document}
\maketitle
\end{document}
Here's some code that will work whether titlepage
is set to true or false:
\documentclass{scrartcl}
\usepackage{xpatch}
\setkomafont{title}{\normalfont\bfseries}
\makeatletter
\xpatchcmd{\maketitle}{\titlefont\huge}{\titlefont\small}{}{}
\xpatchcmd{\@maketitle}{\titlefont\huge}{\titlefont\small}{}{}
\makeatother
\title{The Title}
\author{The Author}
\begin{document}
\maketitle
\end{document}
Another option (mentioned by Andrew Swann in a comment), but I am not sure if this will have undesired side effects, is to
use the font size switch directly in the argument of \title
:
\documentclass{scrartcl}
\setkomafont{title}{\normalfont\bfseries}
\title{\small The Title}
\author{The Author}
\begin{document}
\maketitle
\end{document}
As soon as the current KOMA-Script
version (3.11b) is updated, the following addition to your preamble should suffice:
\setkomafont{author}{\sffamily}
With version 3.11b, one may use the xpatch
package to add \sffamily
to the code responsible for typesetting the author names.
\documentclass[a4paper]{scrartcl}
\usepackage{fontspec}
\setmainfont[Ligatures={Common,TeX}]{Minion Pro}
\setsansfont{Myriad Pro}
\setmonofont[Scale=0.8]{Consolas}
\usepackage{xpatch}
\makeatletter
\xpatchcmd{\maketitle}{% with the `titlepage` class option
\@author
}{%
\sffamily\@author
}{}{}
\xpatchcmd{\@maketitle}{% without the `titlepage` class optipn
\@author
}{%
\sffamily\@author
}{}{}
\makeatother
\begin{document}
\title{Document Title}
\author{Author Name}
\date{}
\maketitle
\end{document}
Best Answer
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 triessize
<adapted value>.clo
. <adapted value> is the font size in pt but with strippedpt
, it results, e.g., in10
for 10pt,11
for11pt
, and14
for14pt
. Last but not least KOMA-Script provides a fallback calculation for font sizes without font size definition files.The default for
\@fontsizefilebase
isscrsize
, but you can change it before\documentclass
.So with
fontsize=14pt
,scrartcl
searches forscrsize14pt.clo
andsize14.clo
. If you have installed packageextsizes
, it will findsize14.clo
. There you can find:and in the LaTeX kernel:
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:to generate
afsize14pt.clo
. After generating the font definition file:Will result in:
Last but not least
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 ofscrartcl
could be done with, e.g., the font size ofsize14.clo
. So combining both methods would be a save solution, if your document needs at least two LaTeX runs: