パートのローマ数字をこのように揃えるにはどうすればよいでしょうか。別の方法としては、アラビア数字の列挙を使用することです。classicthesis の TOC では、パートのローマ数字の揃え以外に変更は行いません。
\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}
答え1
\Part
で定義されているの再定義を使用した 1 つの解決策を次に示します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}
答え2
他のセクション コマンドとは異なり、\part
は ToC 内でその番号の配置を使用しません。 を使用すると、他のコマンドと同様の配置が可能になります(元の から に値\numberline
を設定する必要があります)。\@tempdima
1.5em
3em
xpatch
ToC の動作を修正するために必要な 2 つのコマンドをパッチする手段を提供します:\l@part
および\@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}