2

How do I get different chapter titles in TOC, e.g. "Chapter" for the first few chapters and "Appendix" for the last?

This is a part of my preamble and my main document:

\usepackage[toc,page]{appendix}
\addto\captionsdanish{
    \renewcommand\appendixname{Appendiks}
    \renewcommand\chaptername{Kapitel}
    \renewcommand\contentsname{Indholdsfortegnelse} 
    \renewcommand\appendixpagename{Appendiks}
    \renewcommand\appendixtocname{Appendiks}
}

\appendix

\titleformat{\chapter}[hang]
  {\fontfamily{georgia}\bf\Huge\color{black}}{Appendiks \thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{\filright\fontfamily{georgia}\Huge\bf}[\vspace{0.1mm}\titlerule]
\titlespacing*{\chapter}{0pt}{0pt}{20pt}


Document:

\begin{appendices}

\chapter{First appendix}

\end{appendices}

enter image description here

  • As always on the site please post a full (but minimal) self contained example that others can test as is. As your question is now we cannot help as the answer depends on the document class and preamble you are using. – daleif Sep 20 at 11:44
1

To do that you should use the \appendix command before your appendices. Note that it will affect each \chapter{} you will use after it.

\appendix will change "Kapitel" to "Anhang". If you want to have "Appendix" instead you should give the following command in your preamble, where *appendix name* is the word you want to have:

\addto\captionsgerman{\renewcommand{\appendixname}{*appendix name*}}

P.S.: I assumed that your document is in German and did some attempts. Please note that I'm not German, so there might be better solutions.

0

You can use a combination of the tocloft and appendix packages. The following works with English names but the packages allow you to use any names you wish; read the documentation.

% tocnameprob.tex  % put Chapter/Appendix before the number
\documentclass{book} % or any other class that provides \chapter
\usepackage{lipsum}
\usepackage{tocloft}
\renewcommand{\cftchappresnum}{Chapter } % put Chapter before ToC Chapter entries
\newlength{\tocl}% a scratch lenght
\settowidth{\tocl}{\bfseries\cftchappresnum\cftchapaftersnum}% extra space for Chapter
\addtolength{\cftchapnumwidth}{\tocl}% add the extra space
\usepackage[titletoc]% Option to put Appendix (\appendixname) before ToC Appendix entries
           {appendix}
\begin{document}
\tableofcontents
\chapter{One}
\lipsum[1]
\section{one}
\lipsum[2]
\chapter{Two}
\lipsum[3]
\section{two}
\lipsum[4]
\begin{appendices}
\addtocontents{toc}{\protect\renewcommand{\protect\cftchappresnum}{}} % nullify Chapter
\addtocontents{toc}{\addtolength{\cftchapnumwidth}{-\tocl}} % delete space for Chapter
\chapter{Appone}  % first Appendix
\lipsum[5]
\section{appone}
\lipsum[6]
% and more appendices
\end{appendices}
\end{document}

There may be more efficiant ways to accomplish this, but it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.