나는 여기에 대한 이전 답변의 도움을 받아주요 목차와 섹션 내 목차에 대한 서로 다른 목차 깊이, 내 메인 에는 없는 동안 내에 titletoc
는 담을 수 있도록 만들었습니다 . 그러나 나는 toc의 형식이 다른 간격을 가지고 있음을 발견했습니다.subsections
toc
titletoc
기본 형식을 직접 설정했다면 toc
매개변수를 복사하여 목차에 맞게 모방했을 것입니다 titletoc
. 그런데 기본 회고록 형식이라 어떻게 복제해야 할지 모르겠습니다.
여기 MWE가 있습니다
\documentclass{memoir}
\setlength{\parskip}{12pt plus2pt}
\def\baselinestretch{1.6}
\linespread{1.3}
\usepackage{titletoc}
\usepackage{lipsum}
\setpnumwidth{2.5em}
\setrmarg{3.5em}
\begin{document}
\tableofcontents*
\setsecnumdepth{subsection}
\maxsecnumdepth{subsection}
\settocdepth{subsection}
\chapter{Chap1}
\section{Chap1Sec1}
\section{Chap1Sec2}
\chapter{Chap2}
\section{Chap2Sec1}
\section{Chap2Sec2}
\subsection{Chap2Sec2Subsec1}
\chapter{Chap3}
\settocdepth{section}
\renewcommand{\thesection}{\thechapter-\Roman{section}}
\renewcommand{\thesubsection}{\thechapter-\Roman{section}.\arabic{subsection}}
\renewcommand{\thepage}{S-\arabic{page}}
\section{Chap3Sec1}
\clearpage
\section{Chap3Sec2}
\startcontents
\printcontents{}{2}{\addtocontents{ptc}{\setcounter{tocdepth}{2}}}
\lipsum[1-2]
\subsection{Chap3Sec2Subsec1}\clearpage
\subsection{Chap3Sec2Subsec2}\clearpage
\subsection{Chap3Sec2Subsec3}\lipsum[1]
\subsection{Chap3Sec2Subsec4}
\stopcontents
\section{Chap3Sec3}\clearpage
\section{Chap3Sec4}\clearpage
\section{Chap3Sec5}\clearpage
\section{Chap3Sec6}\clearpage
\section{Chap3Sec7}\clearpage
\renewcommand{\thepage}{A-\arabic{page}}
\setcounter{page}{9}
\chapter{Chap4}
\settocdepth{subsection}
\section{Chap4Sec1}\clearpage
\section{Chap4Sec2}\clearpage
\subsection{Chap4Sec2Subsec1}
\end{document}
다음은 lockstep에 의한 제안과 새로운 간격 문제를 보여주는 두 번째 MWE입니다. 패키지 의 DoubleSpacing
및 SingleSpacing
사용도 사용합니다.memoir
\documentclass{memoir}
\setlength{\parskip}{12pt plus2pt}
\def\baselinestretch{1.6}
\linespread{1.3}
\usepackage{titletoc}
\usepackage{lipsum}
\setpnumwidth{2.5em}
\setrmarg{3.5em}
\begin{document}
\addtocontents{toc}{\protect\setlength{\parskip}{0pt}}
\frontmatter
\tableofcontents*
\setsecnumdepth{subsection}
\maxsecnumdepth{subsection}
\settocdepth{subsection}
\mainmatter
\DoubleSpacing
\chapter{Chap1}
\section{Chap1Sec1}
\section{Chap1Sec2}
\chapter{Chap2}
\section{Chap2Sec1}
\section{Chap2Sec2}
\subsection{Chap2Sec2Subsec1}
\SingleSpacing
\chapter{Chap3}
\settocdepth{section}
\renewcommand{\thesection}{\thechapter-\Roman{section}}
\renewcommand{\thesubsection}{\thechapter-\Roman{section}.\arabic{subsection}}
\renewcommand{\thepage}{S-\arabic{page}}
\section{Chap3Sec1}
\clearpage
\section{Chap3Sec2}
\bigskip
\startcontents
\printcontents{}{2}{\addtocontents{ptc}{\setcounter{tocdepth}{2}}}
\lipsum[1-2]
\subsection{Chap3Sec2Subsec1}\clearpage
\subsection{Chap3Sec2Subsec2}\clearpage
\subsection{Chap3Sec2Subsec3}\lipsum[1]
\subsection{Chap3Sec2Subsec4}
\stopcontents
\section{Chap3Sec3}\clearpage
\section{Chap3Sec4}\clearpage
\section{Chap3Sec5}\clearpage
\section{Chap3Sec6}\clearpage
\section{Chap3Sec7}\clearpage
\renewcommand{\thepage}{A-\arabic{page}}
\setcounter{page}{9}
\chapter{Chap4}
\settocdepth{subsection}
\section{Chap4Sec1}\clearpage
\section{Chap4Sec2}\clearpage
\subsection{Chap4Sec2Subsec1}
\end{document}
답변1
길이를 12pt로 변경하고 \parskip
있으며 일반 ToC와 달리 부분 ToC가 이로 인해 영향을 받는 것 같습니다. 해결 방법: 문제
\addtocontents{toc}{\protect\setlength{\parskip}{0pt}}
문서 본문의 시작 부분에. 또한 \bigskip
부분 ToC가 시작되기 전에 수직 공간(예: )을 추가할 수도 있습니다 .
편집: 두 번째 MWE에서는 (어떤 이유로든) 문서 중간 \DoubleSpacing
으로 전환하고\SingleSpacing
둘 다설정은 ToC resp에 영향을 미칩니다. 부분적인 ToC. 예를 들어 파일 \protect\OnehalfSpacing
에 추가하는 것이 좋습니다 .toc
.
\documentclass{memoir}
\setlength{\parskip}{12pt plus2pt}
\def\baselinestretch{1.6}
\linespread{1.3}
\usepackage{titletoc}
\usepackage{lipsum}
\setpnumwidth{2.5em}
\setrmarg{3.5em}
\begin{document}
\addtocontents{toc}{\protect\setlength{\parskip}{0pt}\protect\OnehalfSpacing}
\frontmatter
\tableofcontents*
\setsecnumdepth{subsection}
\maxsecnumdepth{subsection}
\settocdepth{subsection}
\mainmatter
\DoubleSpacing
\chapter{Chap1}
\section{Chap1Sec1}
\section{Chap1Sec2}
\chapter{Chap2}
\section{Chap2Sec1}
\section{Chap2Sec2}
\subsection{Chap2Sec2Subsec1}
\SingleSpacing
\chapter{Chap3}
\settocdepth{section}
\renewcommand{\thesection}{\thechapter-\Roman{section}}
\renewcommand{\thesubsection}{\thechapter-\Roman{section}.\arabic{subsection}}
\renewcommand{\thepage}{S-\arabic{page}}
\section{Chap3Sec1}
\clearpage
\section{Chap3Sec2}
\bigskip
\startcontents
\printcontents{}{2}{\addtocontents{ptc}{\setcounter{tocdepth}{2}}}
\lipsum[1-2]
\subsection{Chap3Sec2Subsec1}\clearpage
\subsection{Chap3Sec2Subsec2}\clearpage
\subsection{Chap3Sec2Subsec3}\lipsum[1]
\subsection{Chap3Sec2Subsec4}
\stopcontents
\section{Chap3Sec3}\clearpage
\section{Chap3Sec4}\clearpage
\section{Chap3Sec5}\clearpage
\section{Chap3Sec6}\clearpage
\section{Chap3Sec7}\clearpage
\renewcommand{\thepage}{A-\arabic{page}}
\setcounter{page}{9}
\chapter{Chap4}
\settocdepth{subsection}
\section{Chap4Sec1}\clearpage
\section{Chap4Sec2}\clearpage
\subsection{Chap4Sec2Subsec1}
\end{document}