1

I'm using Koma-Script (scrbook class). I want chapters with two lines:

This is line number one which contains the title of the chapter

This is line number two which contains the subtitle of the chapter

Eeach one of them with diferent styles.

How can I do this?

Clarification:

The behaviour I want is like Christian suggested (see comments below):

\addchap{Chapter title \\ \somesize Chapter subtitle}

I don't know if there's an easy way to create a command (e.g. \chapterwsub) that do that in Koma-Script.

  • Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Nov 23 '14 at 20:09
  • I don't know of subtitles of chapters. Do you mean a linebreak followed by a new line with smaller font size with additional text? – user31729 Nov 23 '14 at 20:11
  • Something like this \chapter{A long huge title\\ \normalsize followed with smaller font}? But note, this should not appear in the table of contents. Use \chapter[short title stuff]{Your very long title stuff \\ \normalsize subtitle} for this – user31729 Nov 23 '14 at 20:36
  • Yes, but with \addchap. I know how to do it manually. I would like a global solution, e.g., by modifying the \addchap command. – Gastón Nov 23 '14 at 21:51
  • Do you want to add just the \addchap or numbered chapters as well? You can write any text/box directly after using \chapter (or define a macro for that). Redefining chapter is not recommended (by me). – Johannes_B Nov 23 '14 at 22:03
3

This (trial of a) solution adds an additional optional argument to the \chapter command, which will hold the subtitle and will display it in the next line, using a somewhat smaller fontsize. If not present, there is no subtitle and everything behaves as usual.

In my point of view, it's no good idea, to get the subtitle into the page headers, as it will skew this and readability will suffer from this.

\documentclass{scrbook}
\usepackage{scrpage2}%
\usepackage{xcolor}
\usepackage{xparse}


\usepackage{blindtext}%


\makeatletter
\let\LaTeXStandardChapter\chapter%

\NewDocumentCommand{\chaptersubtitlefont}{+m}{%
{\large \bfseries #1}%
}%

\RenewDocumentCommand{\chapter}{s+o+m+o}{%
  \IfBooleanTF{#1}{%
    \LaTeXStandardChapter*{#3}%
  }{%
    \IfNoValueTF{#4}{%
    \IfNoValueTF{#2}{%
        \LaTeXStandardChapter{#3}%
      }{%
        \LaTeXStandardChapter[#2]{#3}%
      }%
    }{%
      \IfNoValueTF{#2}{ %     
        \LaTeXStandardChapter{#3\\ \chaptersubtitlefont{#4}}%
      }{%
        \LaTeXStandardChapter[#2]{#3\\ \chaptersubtitlefont{#4}}%
      }%
    }%
  }%
}%


\makeatother





\begin{document}
\pagestyle{scrheadings}

\tableofcontents

\chapter{First}
\blindtext

\chapter{Another one}

\chapter*{Hello}

\chapter{My Chapter}[\textcolor{red}{With subtitle}]

\blindtext[10]


\chapter[Short chapter title]{My very long chapter title}[with short subtitle]

\blindtext[10]

\end{document}
| improve this answer | |
  • Something similar would be easily doable for \addchap as well. – Johannes_B Nov 24 '14 at 15:07
  • @Johannes_B: You are free to do it :D – user31729 Nov 24 '14 at 15:11
  • No i won't, a title and a subtitle are two different entities, related, but different and should be treated that way, different. – Johannes_B Nov 24 '14 at 15:13
1

A very basic version could be the following. But to make it bullet proof, more information are needed.

enter image description here

\documentclass[oneside]{scrbook}
\newkomafont{chapsubtitle}{\normalsize\bfseries}
\newcommand{\chapsubvskip}{\vspace{\baselineskip}}
\newcommand{\chapsubtitle}[1]{%
\begingroup%
\usekomafont{disposition}\usekomafont{chapsubtitle}#1\par\endgroup%
\chapsubvskip\noindent\ignorespaces}
\usepackage{blindtext}
%\addtokomafont{chapsubtitle}{\Large}
\begin{document}
\chapter{The duck that went crazy}
\blindtext
\chapter{The duck that went crazy}
\chapsubtitle{man, that was quit a riot}
\blindtext
\chapter{The duck that went crazy}
\blindtext
\end{document}
| improve this answer | |
  • @Gastón What exactly do you mean by heading? The part that appears on top of every page? Or the information that goes into the table of contents? Or something else? – yo' Nov 24 '14 at 9:55
  • @tohecz Sorry. Forget the headings. – Gastón Nov 24 '14 at 18:10

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.