# Custom chapter prefix text in KOMA-Script

With \KOMAoption{chapterprefix}{true}, I would like to replace the default text for the chapter prefix, so that it shows up in all the appropriate places: chapter heading, page headers, and preferable ToC. So, instead of "Chapter 1 Something," I would see "Assignment 1: Something."

I have looked in the KOMA-Script manual, particularly in the section on redefining or declaring sectioning commands, and couldn't figure out where the text is stored. I tried \renewcommand\chapterformat{Assignment\enskip\thechapter:} but it did not affect headers or ToC. I assume that there is a place where the string "chapter" is stored?

\documentclass{scrbook}
\KOMAoption{chapterprefix}{true}
\begin{document}

\frontmatter
\tableofcontents

\mainmatter
\chapter{Something}
chapter text

\end{document}


Thank you!

In \chapapp is Chapter defined. You can change it with

\renewcommand{\chapapp}{Assignment}


So the complete code

\documentclass{scrbook}

\KOMAoption{chapterprefix}{true}
\renewcommand{\chapapp}{Assignment} % <=================================

\begin{document}

\frontmatter
\tableofcontents

\mainmatter
\chapter{Something}
chapter text

\end{document}


gives you the result:

As explained in table 12.1 of the KOMA-Script guide the term "Chapter" is stored in \chaptername. The table is part of the description of command \providecaptionname, that can be used to define the language dependent term, e.g.,

\providecaptionname{english}{\chaptername}{Assignment}


If the term should be changed for appendices too, you should additionally change \appendixname. Otherwise you would get "Appendix" after \appendix.

\documentclass[chapterprefix=true]{scrbook}
\providecaptionname{english}{\chaptername}{Assignment}
\providecaptionname{english}{\appendixname}{Assignment}% also change the prefix of appendices
\begin{document}

\frontmatter
\tableofcontents

\mainmatter
\chapter{Something}
chapter text

\appendix
\chapter{Something in the appendix}
appendix text
\end{document}


If you are using a language package like babel you should use \renewcaptionname instead of \providecaptionname:

\documentclass[chapterprefix=true]{scrbook}
\usepackage[english]{babel}
\renewcaptionname{english}{\chaptername}{Assignment}
\renewcaptionname{english}{\appendixname}{Assignment}% also change the prefix of appendices
\begin{document}

\frontmatter
\tableofcontents

\mainmatter
\chapter{Something}
chapter text

\appendix
\chapter{Something in the appendix}
appendix text
\end{document}