첫 번째 항목 앞에 "페이지"가 ​​있는 LaTeX Memoir 클래스 TOC

첫 번째 항목 앞에 "페이지"가 ​​있는 LaTeX Memoir 클래스 TOC

저는 책을 조판하기 위해 LaTeX와 memoir 클래스를 사용하고 있습니다. 책 출판사(Cambridge)는 목차의 왼쪽에 장과 제목, 오른쪽에 페이지 번호를 두고 첫 번째 항목 앞에 "페이지"라는 단어가 오는 페이지 번호를 포함하도록 요청합니다.

나는 시도했다:

\renewcommand*{\cftchapterformatpnum}[1]{\emph{페이지} \cftchapterpagefont #1}

이를 통해 "페이지"를 추가할 수 있었지만 모든 항목에 추가되었습니다. 나는 시도했다:

\renewcommand*{\cftchapterformatpnum}[1] {\cftchapterpagefont #1}

내 문서의 다른 곳에서 다시 설정했지만 LaTeX의 작동 방식에 대해 근본적으로 이해하지 못하는 것이 분명히 있습니다. 다음 이전에만 이 명령을 존중하는 것 같습니다.

\begin{문서}

LaTeX 전문가가 목표를 달성하는 올바른 방법을 알려줄 수 있나요?

답변1

이것은 어떻습니까(오타가 적음)?

\documentclass{memoir}
\newcommand*{\epage}{\emph{page }} % for convenience
\renewcommand*{\cftchapterformatpnum}[1]{\epage\cftchapterpagefont #1}
\begin{document}
\frontmatter
\tableofcontents* % don't add the ToC reference to the ToC
  %\addtocontents{toc}{\hfill \epage\par} % put page above page numbers
\mainmatter
\chapter{One}
\addtocontents{toc}%
  {\protect\renewcommand*{\protect\epage}{}% nullify printing page
}
\section{one}
\chapter{Two}
\section{one}
\end{document}

지금까지 해낸 일을 잘 하셨습니다. 비결은 매크로를 사용하여 ToC의 적절한 위치에 명령을 추가하는 것입니다 \addtocontents{<file>}{<text>}. 섹션 9.1 참조일반 ToC 방법설명서에 ( > texdoc memoir).

관련 정보