TransWikia.com

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

TeX - LaTeX Asked by snoato on September 20, 2020

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.

One Answer

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}{hfillLARGEbfseriessffamily}

begin{document}
tableofcontents
chapter{A chapter}

end{document}

Perhaps you can translate this into scrreprt code.

Correct answer by Peter Wilson on September 20, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP