ToC 헤더는 다음 장에 나타납니다.

ToC 헤더는 다음 장에 나타납니다.

목차를 포함하고 싶은 문서를 작성 중이고 그 후에 프롤로그를 작성하겠습니다.

문제는 다음 이미지에 표시된 것처럼 장의 두 번째 페이지에 ToC 헤더가 있다는 것입니다.여기에 이미지 설명을 입력하세요

적절한 헤더를 추가하는 방법에 대한 아이디어가 있습니까?

샘플 코드는 다음과 같습니다

\documentclass{book}
\usepackage[Conny]{fncychap}%Options: Sonny, Lenny, Glenn, Conny, Rejne, Bjarne, Bjornstrup
\UCTfalse
\usepackage{blindtext}

\begin{document}

\tableofcontents

\chapter*{Prologue}
\blindtext[5]
\end{document}

답변1

장 이름을 억제하면 \chapter*{}헤더가 업데이트되지 않습니다. 를 추가하여 변경할 수 있습니다 \markboth{Prologue}{}.

\documentclass{book}
\usepackage[Conny]{fncychap}%Options: Sonny, Lenny, Glenn, Conny, Rejne, Bjarne, Bjornstrup
\UCTfalse
\usepackage{blindtext}

\begin{document}
    \tableofcontents
    \chapter*{Prologue}
    \addcontentsline{toc}{chapter}{Prologue}  % if you want to add the Prologue to TOC
    \markboth{Prologue}{}                     % to change the header despite \chapter*{} command
    \blindtext[5]
\end{document}

결과는 다음과 같습니다.
시사

도움이 되었기를 바랍니다 :)

*편집: TOC 바로 뒤가 아니라 헤더를 변경하려면 으로 표시하지 않는 모든 장에 대해 이 작업을 수행해야 합니다 .

답변2

\frontmatter, \mainmatter및 명령을 사용할 수 있으며 다음 명령 을 사용하여 \backmatter전체 머리말을 "그룹"( \begingroup\endgroup명령) 안에 배치할 수 있습니다 .\pagestyle{plain}\frontmatter

\documentclass{book}
\usepackage[Conny]{fncychap}%Options: Sonny, Lenny, Glenn, Conny, Rejne, Bjarne, Bjornstrup
\UCTfalse
\usepackage{blindtext}
\title{Test}
\begin{document}


\maketitle
\begingroup
\pagestyle{plain}
\frontmatter
\tableofcontents
\chapter*{Prologue}
\blindtext[5]
\endgroup
\mainmatter
\chapter{Introduction}
\blindtext[5]
\backmatter
\appendix
\chapter{App1}
\blindtext[5]
\end{document}

위 코드의 결과에서 머리글과 바닥글을 확인하여 모든 것이 예상한 대로인지 확인하세요.

관련 정보