5

I intend to set Open Sans as the entire document's font.

However, if I use the opensans package with the default option it doesn't affect the title and headings of the scrartcl class.

MWE:

\documentclass[10pt,a4paper]{scrartcl}
\usepackage[english]{babel}

\usepackage[default]{opensans}

\title{Title}
\subtitle{Subtitle}
\author{Author}


\begin{document}
\maketitle
\end{document}

Output:

output

Title and subtitle are still in Computer Modern. How can I change them to also appear in OpenSans?

1 Answer 1

7

Add the option defaultsans when loading the package:

\usepackage[defaultsans,default]{opensans}

enter image description here

5
  • 1
    Or pass the option egregdoesnotlikesansseriftitles to scrartcl.
    – egreg
    Commented Mar 27, 2021 at 10:52
  • 1
    @egreg that does the job, but doesn't really fit this type of usage, does it? ;)
    – schoekling
    Commented Mar 27, 2021 at 10:56
  • There are reasons why that's my favorite option with koma classes. ;-)
    – egreg
    Commented Mar 27, 2021 at 13:20
  • 1
    In case someone reading this wants more explanation for what’s going on: LaTeX sets a default font family and a default sans-serif font family. \usepackage[default]{opensans} sets \familydefault, and the defaultsans option sets \sfdefault as well. The Koma classes, by default, use the sans-serif font for titles.
    – Davislor
    Commented Mar 27, 2021 at 13:51
  • If your font package does not come with options to set both, you can \renewcommand\familydefault{\sfdefault} or (much more rarely) \renewcommand\sfdefault{\familydefault}.
    – Davislor
    Commented Mar 27, 2021 at 13:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .