*동일한* 목차를 두 번 조판하는 방법: 한 번은 깊이 0으로, 그 다음에는 깊이 1로

*동일한* 목차를 두 번 조판하는 방법: 한 번은 깊이 0으로, 그 다음에는 깊이 1로

책에 4개의 장만 있다고 가정해 보겠습니다. 각 장에 엄청나게 많은 수의 섹션(예: 100)이 있다고 가정해 보겠습니다. 이 책의 깊이=0인 목차는 1페이지만 소요되는 반면, 깊이=1인 목차는 20페이지에 달합니다.

이러한 책의 경우 2개의 연속된 목차를 갖는 것이 좋습니다. 첫 번째 목차는 장만 참조하고 두 번째 목차는 장을 여러 섹션으로 나눕니다.

어떻게 해야 합니까?

다음 예에서는 두 번째 TOC가 비어 있습니다.

\documentclass{book}
\begin{document}

\setcounter{tocdepth}{0}
\tableofcontents

\setcounter{tocdepth}{1}
\tableofcontents

\chapter{One}
\section{a} \section{b} \section{c} \section{d} \section{e}
\chapter{Two}
\section{a} \section{b} \section{c} \section{d} \section{e}
\chapter{Three}
\section{a} \section{b} \section{c} \section{d} \section{e}
\chapter{Four}
\section{a} \section{b} \section{c} \section{d} \section{e}

\end{document}

답변1

패키지shorttoc

\documentclass{book}
\usepackage{shorttoc}
\begin{document}
\shorttableofcontents{\contentsname}{0}

\setcounter{tocdepth}{1}
\tableofcontents



\chapter{One}
\section{a} \section{b} \section{c} \section{d} \section{e}
\chapter{Two}
\section{a} \section{b} \section{c} \section{d} \section{e}
\chapter{Three}
\section{a} \section{b} \section{c} \section{d} \section{e}
\chapter{Four}
\section{a} \section{b} \section{c} \section{d} \section{e}

\end{document}

당신이 사용할 수있는\shorttoc{\contentsname}{0}

관련 정보