I am using the tocloft package to change the style of my ToC. I would like to typeset the chapter numbers as roman numerals. However, for the ToC I would to typeset them using the romanbars
package.
This package provides a command which takes its input (a roman numeral) and formats it with horizontal bars on the base- and top-line which I find pleasing to the eye. The command takes a single argument. However, the tocloft
command only provides commands to change the formatting of the (chapter) number using non-argument command (like \bfseries
).
My MWE is:
\documentclass{scrbook}
\renewcommand{\thechapter}{\Roman{chapter}}
\usepackage[usedvipsnames]{xcolor}
\usepackage{tocloft}
\usepackage{romanbar}
\renewcommand{\cftchappresnum}{\color{red}\Romanbar}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\chapter{First Chapter}
\lipsum[2]
\chapter{Second Chapter}
\lipsum[2]
\chapter{Third Chapter}
\lipsum[2]
\end{document}
which produces:
as you can see, the first letter of each roman numeral is formatted properly using the command while any subsequent letter is formatted using the normal font.
Is it possible to wrap the \Romanbar
command somehow so that it reads the entire following numeral? Or otherwise configure tocloft
to achieve the desired formatting?
tocloft
to be useful, but would you consider doing that withtitletoc
?