# Koma-script, change chapter appearance (how to add a circle and horizontal ruler?)

I'd like to get the chapter names formatted as shown below:

with a horizontal ruler between the circle and Chapter name, for both numbered and non-numbered chapters (I work with the chapterprefix=on option, so I'd like not to loose the "Chapter" word before chapter no.)

The problems are:

1. Placing a horizontal ruler.

2. Having the title at the same line as "CHAPTER {number}."

Here's a solution using the titlesec package; this will work as expected with both numbered and unnumbered chapters; taking into account the comments, I've replaced the initial definition of the circle with \CIRCLE from the wasysym package:

\documentclass[chapterprefix=true]{scrbook}
\usepackage{titlesec}
\usepackage{wasysym}

\titleformat{\chapter}[block]
{\normalfont\huge\sffamily\bfseries}
{\CIRCLE\vskip6pt\titlerule[1pt]\vskip9pt\chaptertitlename~\thechapter.}
{0.5em}{}
\titleformat{name=\chapter,numberless}[block]
{\normalfont\huge\sffamily\bfseries}
{\CIRCLE\vskip6pt\titlerule[1pt]\vskip9pt}
{0pc}{}

\begin{document}

\tableofcontents
\chapter{Test Numbered Chapter}
\chapter*{Test Unnumbered Chapter}

\end{document}


Some images of the output showing a numbered and an unnumbered chapter:

• That's great, thanks a lot. Actually this solution is something I can fully understand and modify, while the first one seemed for me a kind of magic (although it worked pretty good for numbered chapters too). – Alexandre Apr 16 '12 at 3:48
• @Gonzalo Medina Tikz consumes a lot of time while compiling. Wouldn't it be better to include a circle as as a graphic? – Keks Dose Apr 16 '12 at 6:22
• @Keks Dose - I actually used the wasysym-version of circle with the \CIRCLE command in math mode. – Alexandre Apr 16 '12 at 8:27
• @KeksDose: you're right. I've changed the code; the new version doesn't use TikZ but \CIRCLE from wasysym as Alexandre suggested. – Gonzalo Medina Apr 16 '12 at 12:35

Here is a suggestion for newer KOMA-Script versions:

You do not want an extra prefix line for the chapter name and number. So do not use option chapterprefix=on. You can redefine \chapterformat to insert the prefix \chaptername (or \appendixname). Then you can redefine \chapterlinesformat to insert the dot and the rule:

\documentclass[
numbers=endperiod,% dot at the end of numbers
]{scrbook}
\usepackage{wasysym}

\renewcommand\chapterformat{\chapapp~\thechapter\autodot\enskip}% chapter name as prefix
\makeatletter
\renewcommand\chapterlinesformat[3]{%
\ifstr{#1}{chapter}
{\CIRCLE\\*\rule{\textwidth}{1pt}\vskip9pt}{}% insert dot and rule before chapter titles
\@hangfrom{#2}{#3}%
}
\makeatother

\begin{document}
\tableofcontents
\chapter{Test Numbered Chapter}
\chapter*{Test Unnumbered Chapter}
\end{document}


Result:

I had some troubles to understand what you mean by "circle symbol, 20 pt" did you mean radius or diameter? Now then... i wrote a piece of code which i would consider as a bit dangerous (maybe titlesec provides a more user-spaceish way). This takes one of KOMA´s basic definitions and alter it to fit your requirements. I had troubles with chaptermark as well so i used this definition. This is of course not tested adequately but i believe it should work in any situation.

\documentclass[chapterprefix=true]{scrbook}
\usepackage{tikz}

\makeatletter
{%
\setlength{\parindent}{\z@}\setlength{\parfillskip}{\fill}%
\normalfont\sectfont\nobreak\size@chapter{}%
\if@chapterprefix
\let\@tempa\raggedsection
\else
\let\@tempa\@hangfrom
\fi
\@tempa{\ifnum \c@secnumdepth >\m@ne%
\if@mainmatter
\if@chapterprefix
\expandafter\size@chapterprefix
\else
\expandafter\size@chapter
\fi
{\tikz\fill circle (20pt) ; \rule[.75\baselineskip]{5cm}  {1pt}}%insted of chaptermark
\if@chapterprefix
\size@chapterprefix{}\endgraf\nobreak\vskip.5\baselineskip%               \chapapp\enskip \thechapter.\enskip
\fi
\fi
\fi
}%
{\raggedsection \interlinepenalty \@M \size@chapter{#1}\par}}%