カスタム章見出し

カスタム章見出し

現在、book クラスを使用して論文を書いています。次のように目次を表示しようとしています。

目次

各章は次のように表示されます。

章

私は LaTeX を使い始めたばかりで、論文を書くのも初めてなので、この形式でフォーマットする方法がよくわかりません。何かアイデアがあれば教えてください。

ありがとう!

答え1

次のパッチ\l@chapteretoolbox十分なものです:

ここに画像の説明を入力してください

\documentclass{report}
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
\patchcmd{\l@chapter}% <cmd>
  {#1}% <search>
  {\def\numberline##1{\@chapapp~##1\hfill\mbox{}\par\nobreak}#1}% <replace>
  {}{}% <success><failure>
\makeatother

\begin{document}

\tableofcontents

\chapter{Introduction}

\chapter{Preliminaries}
\section{Problem definition}
\section{Genetic algorithms}
\section{Ant algorithms}
\section{Previous work}
\end{document}

関連情報