
次のような内容のファイルを作成したいと思います。
A chapter page
1 section page
1.1 subsection1 page
subsubsection1 - subsubsection2
subsubsection3 - subsubsection4
1.2 subsection2 page
subsubsection1 - subsubsection2
サブサブセクションには番号を付けず、後続の行に折り返されるリストで表示し、ハイフンで区切る必要があります。
章と節の番号付けは成功しましたが、サブサブセクションスタイルを実現する方法がわかりません。何かアイデアはありますか?章と節には、
\renewcommand\thechapter{\Alph{chapter}}
\renewcommand{\thesection}{\arabic{section}}
助けてくれてありがとう
答え1
あなたはtitletoc
このためのパッケージ:
コード:
\documentclass{book}
\usepackage{titletoc}
\renewcommand\thechapter{\Alph{chapter}}
\renewcommand{\thesection}{\arabic{section}}
\titlecontents*{subsubsection}
[7em]
{\small}
{\thecontentslabel}
{}
{}
[~---\ ]
\setcounter{tocdepth}{3}
\begin{document}
\tableofcontents
\chapter{A test chapter}
\section{A test section}
\subsection{A test subsection}
\subsubsection{Test subsubsection one one}
\subsubsection{Test subsubsection one two}
\subsubsection{Test subsubsection one three}
\subsubsection{Test subsubsection one four}
\subsection{Another test subsection}
\subsubsection{Test subsubsection two one}
\subsubsection{Test subsubsection two two}
\subsubsection{Test subsubsection two three}
\subsubsection{Test subsubsection two four}
\subsubsection{Test subsubsection two five}
\subsection{Yet another test subsection}
\subsubsection{Test subsubsection three one}
\end{document}
アップデート
コメントで、タイトルの後にページ番号を追加するように要求されました。これを行う 1 つの方法は、タイトルとページ番号の間にコンマと改行できないスペースを追加することです (必要に応じて調整してください)。
\documentclass{book}
\usepackage{titletoc}
\renewcommand\thechapter{\Alph{chapter}}
\renewcommand{\thesection}{\arabic{section}}
\titlecontents*{subsubsection}
[7em]
{\small}
{\thecontentslabel}
{}
{,~\thecontentspage}
[~---\ ]
\setcounter{tocdepth}{3}
\begin{document}
\tableofcontents
\chapter{A test chapter}
\section{A test section}
\subsection{A test subsection}
\subsubsection{Test subsubsection one one}
\subsubsection{Test subsubsection one two}
\subsubsection{Test subsubsection one three}
\subsubsection{Test subsubsection one four}
\subsection{Another test subsection}
\subsubsection{Test subsubsection two one}
\subsubsection{Test subsubsection two two}
\subsubsection{Test subsubsection two three}
\subsubsection{Test subsubsection two four}
\subsubsection{Test subsubsection two five}
\subsection{Yet another test subsection}
\subsubsection{Test subsubsection three one}
\end{document}