
だから私は取り除くという単語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}