
다음과 같은 콘텐츠를 만들고 싶습니다.
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}
업데이트
댓글에서 제목 뒤에 페이지 번호를 추가해 달라는 요청이 있었습니다. 이를 수행하는 한 가지 방법이 있습니다. 제목과 페이지 번호 사이에 쉼표와 깨지지 않는 공백을 추가했습니다(필요에 따라 조정).
\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}