I increased the space between chapter numbers and chapter titles to cope with Roman numbers in ToC, but this workaround doesn't satisfy me anymore. Indeed, a space of
3em
necessary for five-digit numbers like XVIII is excessive for one or two-digit numbers like I or II and the result looks very crappy.What I'd like to do is merging number and title, in other words I need to do away with the fixed
numwidth
and to treat numbers as if they were parts of the tile.Minimal example:
Code: Select all
\documentclass[a5paper, openany, 10pt]{book}
\usepackage{bookmark}
\renewcommand{\thechapter}{\Roman{chapter}}
\usepackage{tocloft}
\renewcommand\cftchapaftersnum{.}
\renewcommand\cftchapdotsep{\cftdotsep}
\renewcommand\cftchapnumwidth{3em}
\setlength\cftbeforetoctitleskip{10pt}
\setlength\cftaftertoctitleskip{10pt}
\renewcommand{\cfttoctitlefont}{\hfill\LARGE\bfseries\MakeUppercase}
\renewcommand{\cftaftertoctitle}{\hfill}
\begin{document}
\tableofcontents
\chapter{First Chapter}
\chapter{Second Chapter}
\chapter{Third Chapter}
\chapter{Fourth Chapter}
\chapter{Fifth Chapter}
\chapter{Sixth Chapter}
\chapter{Seventh Chapter}
\chapter{Eighth Chapter}
\chapter{Ninth Chapter}
\chapter{Tenth Chapter}
\chapter{Eleventh Chapter}
\chapter{Twelfth Chapter}
\chapter{Thirteenth Chapter}
\chapter{Fourteenth Chapter}
\chapter{Fifteenth Chapter}
\chapter{Sixteenth Chapter}
\chapter{Seventeenth Chapter}
\chapter{Eighteenth Chapter}
\end{document}