目次に付録を追加する際に問題が発生しました

目次に付録を追加する際に問題が発生しました

論文に付録を追加しようとしており、次のコマンドを使用しました。

\begin{appendices}
\chapter{Performance Tables of ABCD}
\input{tab1}
\input{tab2}
\input{tab3}
\input{tab4}
\input{realworld}
\end{appendices}

そして、私は次のパッケージを使用しました:

\usepackage[titletoc]{appendix}

問題は、次のことが表示されることです。

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

付録 A だけを表示するにはどうすればいいでしょうか? 愚かな質問でしたら申し訳ありません。

答え1

あなたは目次の章の設定方法については、すでに序文でいくつかの定義が示されています。そのため、以下に挙げるいくつかの小さな変更により、Chapter付録の挿入をオフにすることができます。

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

\documentclass{report}

\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
\newcommand{\frontmatternumberline}{%
  \renewcommand{\numberline}[1]{\@chapapp~##1\hfill\mbox{}\par\nobreak}}
\newcommand{\appendixnumberline}{%
  \renewcommand{\numberline}[1]{##1\hfill\mbox{}\par\nobreak}}
\patchcmd{\l@chapter}% <cmd>
  {#1}% <search>
  {\frontmatternumberline #1}% <replace>
  {}{}% <success><failure>
\AtBeginEnvironment{appendices}{% Do the following when you hit \begin{appendices}
  \addtocontents{toc}{\string\let\string\frontmatternumberline\string\appendixnumberline}}
\makeatother

\usepackage[titletoc]{appendix}

\begin{document}

\tableofcontents

\chapter{Introduction}

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

\begin{appendices}
\chapter{An appendix}
\section{First appendix}
\section{Second appendix}
\section{Last appendix}
\end{appendices}

\end{document}

\stringこの場合と同様に、を使用するのは\protect、ToC へのマクロ挿入が拡張されないようにするためです。

答え2

章は\chapter*目次に表示されません。

\begin{appendices}
\chapter*{Performance Tables of ABCD}
...
\end{appendices}

関連情報