ToC 백매터 입력 거리 수정

ToC 백매터 입력 거리 수정

memoir다음과 같이 클래스를 사용하여 간단한 문서를 만들었습니다 .

\documentclass[12pt,a5paper]{memoir}

\renewcommand\thepart{\arabic{part}}
% modify ToC part
\renewcommand{\cftpartaftersnum}{.}
\renewcommand{\cftpartfont}{\normalsize\bfseries}
\renewcommand{\cftpartpagefont}{\normalsize\bfseries}
\setlength{\cftbeforepartskip}{16pt}
\setlength{\cftpartnumwidth}{2.5em}
% modify ToC chapter
\renewcommand{\cftchapteraftersnum}{.}
\renewcommand{\cftchapterfont}{\normalsize}
\renewcommand{\cftchapterleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftchapterpagefont}{\normalsize}
\setlength{\cftbeforechapterskip}{2pt}
\setlength{\cftchapternumwidth}{2.5em}


\begin{document}
\frontmatter
\tableofcontents
\mainmatter

\part{Part One}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}

\part{Part Two}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}

\backmatter
\pagestyle{plain}
\chapter[About Writer]{About Writer}

\end{document}

내 결과

About WriterToC의 과 마지막 장 사이(예: 와 Part One) 사이에 공간(예: 16pt)을 더 추가하려면 어떻게 해야 합니까 Part Two? 감사해요.

업데이트: 둘 다칼콜러의그리고Johannes_B's내가 사용하면 답변이 제대로 작동했습니다 \chapter[About Writer]{About Writer}. 하지만 내가 사용했을 때 \include{aboutwriter}(@barbara-beeton으로말하는), 그들은 작동하지 않았습니다.

\documentclass[12pt,a5paper]{memoir}

\renewcommand\thepart{\arabic{part}}
% modify ToC part
\renewcommand{\cftpartaftersnum}{.}
\renewcommand{\cftpartfont}{\normalsize\bfseries}
\renewcommand{\cftpartpagefont}{\normalsize\bfseries}
\setlength{\cftbeforepartskip}{16pt}
\setlength{\cftpartnumwidth}{2.5em}
% modify ToC chapter
\renewcommand{\cftchapteraftersnum}{.}
\renewcommand{\cftchapterfont}{\normalsize}
\renewcommand{\cftchapterleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftchapterpagefont}{\normalsize}
\setlength{\cftbeforechapterskip}{2pt}
\setlength{\cftchapternumwidth}{2.5em}

% Karlkoeller said:
\usepackage{etoolbox}
\appto{\backmatter}{\addtocontents{toc}{\protect\addvspace{16pt}}}{}{}

\begin{document}
\frontmatter
\tableofcontents
\mainmatter

\part{Part One}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}

\part{Part Two}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}

\backmatter
\pagestyle{plain}
% \chapter[About Writer]{About Writer}

% Johannes_B said:
% \addtocontents{toc}{\protect\vspace{16pt}}

\include{aboutwriter} % Include external file

\end{document}

답변1

패키지를 로드 etoolbox하고 발행합니다.

\preto{\backmatter}{\addtocontents{toc}{\protect\addvspace{16pt}}}

이러한 방식으로 실행하면 \backmatter건너 16pt뛰기가 ToC에 추가됩니다.

MWE:

\documentclass[12pt,a5paper]{memoir}

\renewcommand\thepart{\arabic{part}}
% modify ToC part
\renewcommand{\cftpartaftersnum}{.}
\renewcommand{\cftpartfont}{\normalsize\bfseries}
\renewcommand{\cftpartpagefont}{\normalsize\bfseries}
\setlength{\cftbeforepartskip}{16pt}
\setlength{\cftpartnumwidth}{2.5em}
% modify ToC chapter
\renewcommand{\cftchapteraftersnum}{.}
\renewcommand{\cftchapterfont}{\normalsize}
\renewcommand{\cftchapterleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftchapterpagefont}{\normalsize}
\setlength{\cftbeforechapterskip}{2pt}
\setlength{\cftchapternumwidth}{2.5em}

\usepackage{etoolbox}
\preto{\backmatter}{\addtocontents{toc}{\protect\addvspace{16pt}}}


\begin{document}
\frontmatter
\tableofcontents
\mainmatter

\part{Part One}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}

\part{Part Two}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}

\backmatter
\pagestyle{plain}
\chapter[About Writer]{About Writer}

\end{document} 

산출:

여기에 이미지 설명을 입력하세요

답변2

앞 부분의 공간이 생겨서 \part더 쉽고, 여기서도 단순히 공간에 의존하기보다는 같은 메커니즘을 활용하는 것이 좀 더 간단하게 이해되는 목차로 이어진다고 생각합니다.

여기에 이미지 설명을 입력하세요

\documentclass[12pt,a5paper]{memoir}

\renewcommand\thepart{\arabic{part}}
% modify ToC part
\renewcommand{\cftpartaftersnum}{.}
\renewcommand{\cftpartfont}{\normalsize\bfseries}
\renewcommand{\cftpartpagefont}{\normalsize\bfseries}
\setlength{\cftbeforepartskip}{16pt}
\setlength{\cftpartnumwidth}{2.5em}
% modify ToC chapter
\renewcommand{\cftchapteraftersnum}{.}
\renewcommand{\cftchapterfont}{\normalsize}
\renewcommand{\cftchapterleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftchapterpagefont}{\normalsize}
\setlength{\cftbeforechapterskip}{2pt}
\setlength{\cftchapternumwidth}{2.5em}


\begin{document}
\frontmatter
\tableofcontents
\mainmatter

\part{Part One}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}

\part{Part Two}
\chapter[Chapter Title]{Chapter Title}
\chapter[Chapter Title]{Chapter Title}
%\chapter[Chapter Title]{Chapter Title}

\backmatter
\part{The Appendix Bits}
\pagestyle{plain}
\chapter[About Writer]{About Writer}

\end{document}

관련 정보