# Right Align Chapter Numbering in KOMA script ToC

Chapter numbers are roman numerals and I would like them to be right aligned. The tocloft package doesnt work well with KOMA script.

Also I would like to have a dot after the chapter numbers only. And no dot after section and subsection numbers

ie I.1 Section 1 and NOT I.1. Section 1

MWE below

\documentclass{scrbook}
\usepackage[english]{babel}

\renewcommand{\thechapter}{\Roman{chapter}}

\begin{document}

\tableofcontents

\chapter{Chapter 1}
\section{Section 1}
\subsection{Subsection 1}
\section{Section 2}
\chapter{Chapter 2}

\chapter{Chapter 3}

\end{document}


Here is a suggestion that needs at least KOMA-Script version 3.22.

\documentclass[
numbers=noenddot% no dot at the end of numbers like section, figure, ...
]{scrbook}[2017/01/03]% needs at least version 3.22
\usepackage[english]{babel}
\renewcommand{\thechapter}{\Roman{chapter}}

\usepackage{xpatch}
\xpatchcmd\chapterformat{\autodot}{.}{}{\PatchFailed}% dot after chapter in document header
\xpatchcmd\chaptermarkformat{\autodot}{.}{}{\PatchFailed}% dot after chapter in page header

\RedeclareSectionCommand[%
tocdynnumwidth,
tocentrynumberformat=\chapterentrynumberformat% sets the format of the chapter numbers in ToC
]{chapter}

\newcommand\chapterentrynumberformat[1]{% define the new format for the chapter numbers in ToC
\renewcommand\autodot{.}% dot after chapter
\hfill#1\enspace% align chapter numbers right
}

\usepackage{blindtext}% dummy text
\begin{document}
\tableofcontents
\blinddocument
\chapter{Chapter 2}
\chapter{Chapter 3}
\end{document}


Run three times to get