# Right-align TOC title using KOMA or tocloft for the scrreprt class

I seriously hope this question hasn't been asked before, but I couldn't find one that fits my exact case.

I'm using the scrreprt document class and successfully right-aligned the chapter titles using:

\renewcommand{\raggedchapter}{\raggedleft}


This also worked for the title of the list of listings. However, it did not work for the titles of the TOC, the list of figures and the list of tables. I tried some things like:

\renewcommand{\cfttoctitlefont}{\raggedleft}


but this did not right-align the title, but instead just reset the font-size (which is to be expected for a renew).

There's probably some easy way of doing this using either KOMA or tocloft, but I couldn't find anything that worked so far. Thank you.

The KOMA classes are not fond of the tocloft package and will make a bunch of suggestions which, as a non-user of KOMA, mean nothing to me. However the following short MWE shows how to use tocloft to get the ToC, etc., titles right aligned.

% toctitleprob.tex  SE 563186

\documentclass{scrreprt}
\usepackage{tocloft}

\renewcommand{\raggedchapter}{\raggedleft}
\renewcommand{\cfttoctitlefont}{\hfill\LARGE\bfseries\sffamily}

\begin{document}
\tableofcontents
\chapter{A chapter}

\end{document}


Perhaps you can translate this into scrreprt code.

• Thanks so much! This actually did the trick! I'm not a KOMA user myself, but I got a scrreprt based template for my thesis, that I wanted to adapt a little. – snoato Sep 18 at 18:44

Disclaimer: Do not use package tocloft together with a KOMA-Script class. It breaks several KOMA-Script features. KOMA-Script uses its own package tocbasic for the ToC and lists like LoF and LoT.

If you really want to use package tocloft and tocloft should not change the settings of the headings in TOC etc. you can load it with option titles.

Example:

\documentclass{scrreprt}
\usepackage[titles]{tocloft}% I would not use this package with a KOMA-Script class

\renewcommand{\raggedchapter}{\raggedleft}

\begin{document}
\tableofcontents
\chapter{A chapter}
\end{document}