1

I am using the scrbook class document and observed that the heading, subheading and caption fonts are different from the normal text font style.

Along-with the scrbook settings, I have caption package included, which helps me changing the caption font style only. But I'm not sure how can I change the heading and subheading fonts. Once I know the normal text style, I can copy the same style into caption package.

But how can I make them all (heading, subheading, caption and normal text) of same style, but of different sizes? However, the chapter titlefont style should remain the same.

MWE:

\documentclass[
fontsize=11pt,   % Schriftgröße
DIV=12,          % Seitenaufteilung
BCOR=5mm,        % Bindekorrektur
ngerman,         % für Umlaute, Silbentrennung etc.
Inhaltsverzeichnis ein
]{scrbook}

\usepackage[textfont={small,sf},labelfont={small,bf,sf},labelsep=endash,format=hang,justification=justified]{caption}
\usepackage{titlesec, graphicx, geometry, titlecaps}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}
 %Chapter Headers%
 \titleformat{\chapter}[display]{}   {\normalfont\Large\scshape\titlecap{\chaptertitlename}\enspace\scalebox{1.8}{\thechapter}\filright} {8ex}{\Huge\bfseries\sffamily\filleft}[{\titlerule[0.5pt]}]
 \titlespacing*{\chapter}{0pt}{30pt}{20pt}

\chapter{Fruits} 
\section{Apple}
The most of the fiber in apples is soluble fiber...
\begin{figure}[h!]
\caption{Apple Apple  Apple  Apple  }
\end{figure}
\subsection{Apple}
Most of the fiber in apples is soluble fiber...
\end{document}
1

You can use \setkomafont{<section>}{<font>} to adjust the font to suit your needs. See Change size of section, subsection, subsubsection, paragraph and subparagraph title.

In terms of the settings for caption, remove the use of sf in the font selection:

enter image description here

\documentclass[
  fontsize=11pt,   % Schriftgröße
  DIV=12,          % Seitenaufteilung
  BCOR=5mm,        % Bindekorrektur
  ngerman,         % für Umlaute, Silbentrennung etc.
  Inhaltsverzeichnis ein
  ]{scrbook}

\usepackage{caption}
\captionsetup{
  textfont={small},% Removed sf
  labelfont={small,bf},% Remove sf
  labelsep=endash,
  format=hang,
  justification=justified
}
\usepackage{titlesec, graphicx, titlecaps}

%Chapter Headers%
\titleformat{\chapter}
  [display]
  {}
  {\normalfont\Large\scshape\titlecap{\chaptertitlename}\enspace\scalebox{1.8}{\thechapter}\filright}
  {8ex}
  {\Huge\bfseries\sffamily\filleft}
  [{\titlerule[0.5pt]}]

\setkomafont{section}{\normalfont\Large\bfseries}
\setkomafont{subsection}{\normalfont\large\bfseries}

\titlespacing*{\chapter}{0pt}{30pt}{20pt}

\begin{document}

\chapter{Fruits} 
\section{Apple}
The most of the fiber in apples is soluble fiber \ldots

\begin{figure}[h]
  \caption{Apple Apple Apple Apple}
\end{figure}

\subsection{Apple}
Most of the fiber in apples is soluble fiber \ldots

\end{document}

titlesec is not suggested for use with KOMA-script.

3
  • Thanks. It works pretty well and I got the same text style for caption as that of normal text font. I tried the link you suggested and that works too. But I can only change the sizes, not the style; as I don't know the text style name. How can I find the name of the font I'm using? I can then use the \setkomafont{<section>}{<font>} to set standard sizes. Lastly, if I remove titlesec, chapter headings changes and I don't get a titlerule. @Werner
    – Yousaf
    Oct 23 '16 at 13:36
  • @Yousaf: The name of the font is Computer Modern, and is most likely accessible via \rmfamily.
    – Werner
    Oct 23 '16 at 13:54
  • I tried \newcommand*{\myfont}{\fontfamily{<cmr>}\selectfont} and \setkomafont{section}{\LARGE\cmrfamily} commands but the section font remain the same, in both cases. @Werner
    – Yousaf
    Oct 23 '16 at 14:30
1

You can use \addtokomafont{disposition}{<font settings>} or \setkomafont{disposition}{<font settings>} to modify or change the presettings for all sectioning levels. To change the size of single section level use \addtokomafont{<section level>}{<size command>}.

Note that it is not recommended to use titlesec together with a KOMA-Script class. This package breaks some KOMA-Script features.

Here is a suggestion without titlesec and titlecaps. There is also no need to load package caption, if this package is only used to change the font of the captions and their labels.

\documentclass[
DIV=12,          % Seitenaufteilung
BCOR=5mm,        % Bindekorrektur
%ngerman,         % für Umlaute, Silbentrennung etc.
]{scrbook}[2015/10/03]

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}

% font presettings for all section levels
\setkomafont{disposition}{\normalfont\normalcolor\bfseries}

% formating the chapter titles
\KOMAoptions{chapterprefix}
\RedeclareSectionCommand[
    beforeskip=-30pt,
    afterskip=20pt,
    innerskip=8ex,
    font=\Huge\bfseries\sffamily,
    prefixfont=\normalfont\Large\scshape
]{chapter}

\renewcommand*\raggedchapter{\raggedleft}
\renewcommand*\chapterformat{\chapapp\enspace\scalebox{1.8}{\thechapter}}
\renewcommand*\chapterlineswithprefixformat[3]{%
    {\raggedright#2}#3
    \par\vspace*{\dimexpr-\parskip-5pt\relax}\rule{\textwidth}{.5pt}%
}

% settings for captions and captionlabels
\addtokomafont{caption}{\small}
\addtokomafont{captionlabel}{\bfseries}
\renewcommand*\captionformat{~--~}

\begin{document}
\tableofcontents
\chapter{Fruits} 
\section{Apple}
The most of the fiber in apples is soluble fiber \ldots

\begin{figure}[h]
  \caption{Apple Apple Apple Apple}
\end{figure}

\subsection{Apple}
Most of the fiber in apples is soluble fiber \ldots
\end{document}

enter image description here

2
  • Thank you for your effort. I tried this one and it works too. But it changed the text appearance as you can see the above mentioned picture from @Werner. Is there any way of getting the same text style, chapter headings and without even using a titlesec with komma class? @esdd
    – Yousaf
    Oct 23 '16 at 13:39
  • The section headings are using the same font family but different sizes and they are bold. The chapter heading uses the same font as in your MWE. If it should not use \sffamily, then remove this command from the chapter font settings. Note that in your MWE and my code package fontenc with option T1 is loaded while the example of @Werner uses the default OT1 encoding.
    – esdd
    Oct 23 '16 at 14:46

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.