I am trying to set OpenSans Light as the default font in my document of type scrreport
, so I included the opensans package. This worked so far, as that OpenSans is now used for my continuous text, but with the regular weight. Furthermore, some other parts apparently don't use it. See this screenshot for illustration:
Here is the markup:
\documentclass[
paper = a4,
]{scrreprt}
\usepackage{lipsum}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[default,scale=0.95]{opensans}
\usepackage{lmodern}
\begin{document}
\linespread{1.25}\selectfont
\chapter{Test Chapter}
\section{Test Section}
\begin{description}
\item [Some description] Some text...
\item [Some description] Some text...
\end{description}
This is some text and some \textbf{bold} text and some \textit{italic} text.
\lipsum
\end{document}
First of all I'd like to have the continuous text in the light variant of the font. I could just do \fontseries{l}\selectfont
at the beginning of my document, but I'm not sure if that is good style. Is there a way to define what the default weight of the standard font should be?
Next, please have a look at the things I circled in red; you will notice that these appear to be in LaTeX' default sans-serif font and not in the one I selected. However, the text circled in green is rendered with the OpenSans font. Now I'd like to change the font and font weight used in the headings, sections and descriptions to be e.g. OpenSans Light or Semibold. Preferrably I'd just set that font globally for everything. How can I achieve this?
EDIT: The font problem has been solved! I accidentially included that package lmodern
which also replaced the default font for some elemnts. However, I'd still like to know how to change the weight of the font for the different elements.
Here is an updated screenshot of what the current state is:
Best Answer
Option
defaultsans
of packageopensans
sets the OpenSans font family as default sans-serif font family (\sfdefault
). Optiondefault
additionally redefines\familydefault
to\sfdefault
. So optiondefault
is enough to change the font of the text and the other elements of a KOMA-Script document to OpenSans.To change the weight of the text you can redefine
\seriesdefault
tol
:And you can set
\mddefault
tol
andbfdefault
tosb
(semibold) orm
(regular).Result with
\renewcommand\bfdefault{sb}
:Result with
\renewcommand\bfdefault{m}
: