![Alinear los números romanos de las partes en ToC](https://rvso.com/image/254689/Alinear%20los%20n%C3%BAmeros%20romanos%20de%20las%20partes%20en%20ToC.png)
¿Cómo puedo alinear los números romanos de las partes de esta manera? La alternativa es utilizar una enumeración árabe. No haría ningún cambio en el TOC de la tesis clásica fuera de la alineación de los números romanos de las partes.
\documentclass{scrreprt} % classe report di KOMA-Script;
\usepackage[%
pdfspacing,% % migliora il riempimento di riga
linedheaders,%
dottedtoc,%
parts% % da decommentare in un documento diviso in parti
]{classicthesis} % stile ClassicThesis
\hypersetup{hidelinks}
\begin{document}
\tableofcontents
\part{Test Part One}
\chapter{Test Chapter One}
\section{Test Section One One}
\section{Test Section One Two}
\part{Test Part Two}
\chapter{Test Chapter One}
\section{Test Section One One}
\section{Test Section One Two}
\part{Test Part Three}
\chapter{Test Chapter One}
\section{Test Section One One}
\section{Test Section One Two}
\end{document}
Respuesta1
Aquí hay una posible solución usando una redefinición de \Part
como se define en classicthesis.sty
:
\documentclass{scrreprt}
\usepackage[%
pdfspacing,%
linedheaders,%
dottedtoc,%
parts%
]{classicthesis}
\hypersetup{bookmarksnumbered,hidelinks}
\makeatletter
\setlength\cftpartnumwidth{1.5em}
\renewcommand\Part[2][]{%
\addtocontents{toc}{\setcounter{tocdepth}{-2}}
\ifpdf\pdfstringdefDisableCommands{\let\thepart\@gobbletwo}%
\oldpart[\texorpdfstring{\spacedlowsmallcaps{#1}}{#1}]{#2}
\else\oldpart[\spacedlowsmallcaps{#1}]{#2}%
\fi%
\addtocontents{toc}{\setcounter{tocdepth}{2}}%
\addcontentsline{toc}{part}{\protect\numberline{%
\hspace*{4pt}\texorpdfstring{\llap{\thepart}}{}}\texorpdfstring{\noexpand\spacedlowsmallcaps{#1}}{#1}}
\ctparttext{\relax}%
}%
\makeatother
\begin{document}
\tableofcontents
\part{Test Part One}
\chapter{Test Chapter One}
\section{Test Section One One}
\section{Test Section One Two}
\part{Test Part Two}
\chapter{Test Chapter One}
\section{Test Section One One}
\section{Test Section One Two}
\part{Test Part Three}
\chapter{Test Chapter One}
\section{Test Section One One}
\section{Test Section One Two}
\end{document}
Respuesta2
A diferencia de otros comandos seccionales, \part
no utiliza ninguna alineación de su número en el ToC. Es posible una alineación similar a otros comandos cuando se usa \numberline
(lo que requiere establecer un valor para \@tempdima
a 1.5em
del original 3em
).xpatch
proporciona un medio para parchear los dos comandos necesarios para corregir el comportamiento de ToC: \l@part
y \@part
.
\documentclass{book}
\usepackage{xpatch}% http://ctan.org/pkg/xpatch
\makeatletter
\patchcmd{\l@part}{3em}{1.5em}{}{}% <cmd><search><replace><success><failure>
\xpatchcmd{\@part}{\thepart\hspace{1em}}{\protect\numberline{\ \llap{\thepart}}}{}{}% <cmd><search><replace><success><failure>
\makeatother
\begin{document}
\tableofcontents
\part{title}
\chapter{title}
\section{title}
\part{title}
\chapter{title}
\section{title}
\part{title}
\chapter{title}
\section{title}
\end{document}