
그래서 나는 노력하고 있습니다제거하다단어 Chapter n
를 로 바꾸고 chapter title
. 하지만 목차에는 표시하고 싶은데... (그래서 사용할 수 없습니다 \chapter*{...}
).
그것을 달성할 수 있는 방법이 있나요?
감사해요!
답변1
사용titlesec
\documentclass{book}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{}{0pt}{\Huge}
\titlespacing*{\chapter} {0pt}{20pt}{40pt}
\begin{document}
\tableofcontents
\chapter{Some chapter}
\end{document}
답변2
이것은 나에게 효과적이었습니다.
\chapter*{Introduction}\stepcounter{chapter}\addcontentsline{toc}{chapter}{Introduction}
해당 코드를 장 시작 부분에 배치하세요.
답변3
book
또는 문서 클래스를 사용하고 report
와 같은 LaTeX 패키지를 사용하지 않으려면 titlesec
하위 수준 매크로를 재정의(실제로 단순화)하여 진행할 수 있습니다 \@makechapterhead
. 다음은 문서 클래스를 사용하는 실제 예제입니다 book
. 로 시작하는 줄은 %%
의 원본 코드에서 주석 처리됩니다 \@makechapterhead
.
\documentclass{book}
\makeatletter
\def\@makechapterhead#1{%
%%\vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont
%%\ifnum \c@secnumdepth >\m@ne
%%\if@mainmatter
%% \huge\bfseries \@chapapp\space \thechapter
%% \par\nobreak
%% \vskip 20\p@
%%\fi
%%\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\makeatother
\begin{document}
\tableofcontents
\mainmatter
\chapter{First}
\chapter{Second}
\end{document}
답변4
그런 줄을 서문에 추가하십시오.
\setcounter{secnumdepth}{-1}