Document ClassesCustom Chapter Title

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
ge0rge04
Posts: 10
Joined: Sun Mar 28, 2010 12:23 am

Custom Chapter Title

Post by ge0rge04 »

Hello,

I use the scrreprt document class from koma-script, and \chapter{Maimuta Betivana} prints this.
1 Maimuta Betivana
I want to insert a newline between the chapter number and the chapter name like this.
1
Maimuta Betivana
How can I achieve this? Please use the same chapter number and name as in the example provided, so I could follow it up easier.

Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Custom Chapter Title

Post by localghost »

A quick hack could look like this.

Code: Select all

\documentclass[
  chapterprefix=on
]{scrreprt}
\usepackage[T1]{fontenc}

\renewcommand*{\chapterformat}{\thechapter\autodot\enskip}  % Redefinition of chapter prefix format

\begin{document}
  \chapter{Foo}
\end{document}
Note the option chapterprefix=on for the document class.


Thorsten
ge0rge04
Posts: 10
Joined: Sun Mar 28, 2010 12:23 am

Custom Chapter Title

Post by ge0rge04 »

It looks great now.

Meanwhile I found a solution online

Code: Select all

\renewcommand{\sfdefault}{mdugm}
\usepackage[ ]{titlesec}
\titleformat{\chapter}[display]
  { \normalsize \huge  \color{black}}
  {\flushleft \normalsize \MakeUppercase {  } \hspace{1 ex} { \fontsize{60}{60}\selectfont \sffamily  \thechapter }} {10 pt}{\huge}
but yours is nicer :)
Post Reply