
Я пытаюсь добавить приложение к своей диссертации и использую следующие команды:
\begin{appendices}
\chapter{Performance Tables of ABCD}
\input{tab1}
\input{tab2}
\input{tab3}
\input{tab4}
\input{realworld}
\end{appendices}
Я использовал следующий пакет:
\usepackage[titletoc]{appendix}
Проблема в том, что он показывает следующее:
Как сделать так, чтобы отображалось только Приложение А? Извините, если это глупый вопрос.
решение1
Я полагаю, тыуже есть некоторые определения в вашей преамбуле относительно того, как расположены главы в ToC. Таким образом, некоторые незначительные изменения, перечисленные ниже, позволят вам отключить 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}