2

This is my minimal working example:

\documentclass[headinclude=true,twoside=true,BCOR=5mm,fontsize=11pt,paper=17cm:24cm,pagesize,DIV=13,headings=normal,appendixprefix=true,numbers=noendperiod,toc=bibliography,parskip=false,captions=bottombeside,version=last]{scrbook}

\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\addtokomafont{caption}{\small}

\usepackage[american]{babel}
\usepackage{wrapfig}
\usepackage{subfiles}
\usepackage{mathrsfs}
\usepackage[pdftex]{hyperref}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{verbatim}
\usepackage{bm}
\usepackage[separate-uncertainty=true,multi-part-units=single]{siunitx}
\usepackage{cite}
\usepackage[numbers,sort&compress]{natbib}
\usepackage{tikz,tikz-3dplot}
\usepackage{mathtools}

\usetikzlibrary{decorations.pathmorphing,decorations.markings,positioning,fadings,calc}
\newcommand{\onlyinsubfile}[1]{#1}
\newcommand{\notinsubfile}[1]{}
\newcommand*\chem[1]{\ensuremath{\mathrm{#1}}}
\newcommand{\vcenteredinclude}[2]{\begingroup
\setbox0=\hbox{\includegraphics[width=#1]{#2}}%
\parbox{\wd0}{\box0}\endgroup}
\newcommand{\specialcell}[2][c]{%
  \begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}
\usepackage[toc]{appendix}
\renewcommand{\onlyinsubfile}[1]{}
\renewcommand{\notinsubfile}[1]{#1}
\setkomafont{disposition}{\normalcolor\bfseries}


\begin{document}

\subfile{../Chapter_Introduction/Chapter_Introduction}

\end{document}

[I realize this is not a real MWE but I got some errors after deleting most of the commands, so I just kept them here now.]

Which produces the chapter title:

enter image description here.

Upon using this code (from a question on Stack Exchange, can't find the thread anymore)

\renewcommand*{\chapterformat}{%
  \thechapter\enskip
  \textcolor{gray!50}{\rule[-\dp\strutbox]{2pt}{\baselineskip}}\enskip
}

the Chapter title becomes:

enter image description here.

I have two questions:

1) How can I change the comment such that the second image has the same font as the first?

2) Is it possible to make the Chapter Number and the bar bigger? I naively tried commands like `\bigg' but it did not work.

1 Answer 1

3
  1. Remove \setkomafont{disposition}{\normalcolor\bfseries} from your preamble to use a sansserif font for the chapters.
  2. You could add a fontsize command to the redefinition of \chapterformat.

Example:

\documentclass{scrbook}
\usepackage{tikz}% loads also graphicx,xcolor, etc.

%\setkomafont{disposition}{\normalcolor\bfseries}

\renewcommand*{\chapterformat}{{%
  \Huge\thechapter\enskip
  \textcolor{gray!50}{\rule[-\dp\strutbox]{4pt}{\baselineskip}}\enskip
}}

\begin{document}
\chapter{Introduction}
\end{document}

Update (because of a comment below this answer)

To change the size of the chapter title too, use \addtokomafont{chapter}{<fontsize command>}.

The height of the gray rule can be changed in its third (=second mandantory) argument. If you want to change the horizontal position of the rule, adjust the first (optional) argument.

Example:

\documentclass{scrbook}
\usepackage{xcolor}

\renewcommand*{\chapterformat}{{%
  \Huge\thechapter\enskip
  \textcolor{gray!50}{\rule[-2.5\dp\strutbox]{4pt}{2\baselineskip}}\enskip
}}

\addtokomafont{chapter}{\small}

\begin{document}
\chapter{Introduction}
\end{document}
8
  • But tikz might slow down compilation much more than graphicx and xcolor.
    – Keks Dose
    Commented May 17, 2019 at 14:45
  • @KeksDose Yes: "etc." means the other packages ;-) and the OP already loads tikz in his/her example code.
    – esdd
    Commented May 17, 2019 at 14:48
  • @esdd I played a bit with your suggestion. Is it also possible to change the standard font size of the chapter title within the same \renewcommand? Because now I have a chapter number which is quite big so I would like the chapter title to be a bit bigger as well.
    – Funzies
    Commented May 17, 2019 at 14:50
  • Should both the number and the title use the same fontsize?
    – esdd
    Commented May 17, 2019 at 14:53
  • @esdd No, I would rather change them separately... Related: how can I make the gray bar higher?
    – Funzies
    Commented May 17, 2019 at 14:56

You must log in to answer this question.

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