
LaTeX で目次を作成する必要があります。章はローマ数字、セクションはアラビア数字、サブセクションは文字です。また、サブセクション レベルまでしか表示しないようにする必要があります。
次のようになります:
I. CHAPTER
II. CHAPTER
1. Section
2. Section
(a) Subsection
(b) Subsection
目次を生成するために次のコマンドを使用しますが、別の形式で生成されます。
\tableofcontents
ラテックスでこれをどうやって実現するのでしょうか?
テッド。
答え1
章、節、サブセクションのカウンターの表現を制御するコマンド 、 を再定義できます\thechapter
。\thesection
その後、パッケージを使用してドットを追加できます。\thesubsection
tocloft
\documentclass{book}
\usepackage{tocloft}
\renewcommand\cftchapaftersnum{.}
\renewcommand\cftsecaftersnum{.}
\renewcommand\thechapter{\Roman{chapter}}
\renewcommand\thesection{\arabic{section}}
\renewcommand\thesubsection{(\alph{subsection})}
\begin{document}
\tableofcontents
\chapter{Test Chapter One}
\section{Test Section One}
\section{Test Section One}
\subsection{Test Subsection A}
\subsection{Test Subsection B}
\end{document}
章番号がタイトルと重ならないようにしたり、セクション番号とタイトルの間のスペースを狭めたりするために、他の調整が必要になる場合があります。調整は次のようになります。
\renewcommand\cftchapnumwidth{2.8em}
\renewcommand\cftsecnumwidth{2em}
\renewcommand\cftsecindent{3em}
\renewcommand\cftsubsecindent{5em}