[Tex/LaTex] Using Appendix prefix for figures in List of Figures

appendicestable of contents

I'm fairly new to LaTeX and need help with the number of figures in appendices in the table of figures. Currently, they are just numbered,

  1. Figure caption ………… p193

but I'd like them to appear as

A.1. Figure caption ……… p193

This is for my dissertation, and I've inherited some formatting code from previous graduate students. The MWE is:

\documentclass[12pt]{report}

\usepackage[demo]{graphicx}

\newcommand{\APPENDIX}[2]{%
\refstepcounter{chapter}%
\addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}: #2}%
\pagestyle{plain}%
\thispagestyle{plain}%
\singlespace%
\begin{center}% 
\large
\textbf{Appendix #1: #2}\\%
\normalsize
\end{center}%
\doublespace%
\vspace{1em}}

\begin{document}

\tableofcontents

\listoffigures

\newpage
\appendix
\appendix{A}{TITLE OF APPENDIX}

\begin{figure}
\includegraphics{dummy}
\caption{dummy caption}
\end{figure}

\end{document}

Thanks in advance!

Best Answer

I'd suggest you a different approach. Using a manual formatting for your appendices implies too much work: you'll have to correct counters, marks, ToC entries, amongst others. Instead, you can use the titlesec package to easily change the chapter format in appendices, allowing you to use \chapter for your appendices and thus solving automatically all problems mentioned above; in particular, you recover the desired numbering for floats in the appendices.

In comments it has been mentioned that a colon must appear between the number and the title for ToC entries corresponding to appendices, and that chapter and section entries should have leading dots; this can be achieved with the help of the titletoc package.

\documentclass[12pt]{report}
\usepackage[demo]{graphicx}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{setspace}
\usepackage{etoolbox}

\newcommand\AppChap{%
\titleformat{\chapter}[block]
  {\normalfont\large\bfseries\filcenter}{\appendixname\ \thechapter:}{1em}{}
\titlespacing*{\chapter}
  {0pt}{-20pt}{1em}
\titlecontents{chapter}
  [1.5em]{\vspace{10pt}\bfseries}
  {\contentslabel[\thecontentslabel:]{1.3em}}
  {\hspace*{-1.3em}}
  {\titlerule*[0.8em]{.}\contentspage}
}
\titlecontents{chapter}
  [1.5em]{\vspace{10pt}\bfseries}
  {\contentslabel{1.25em}}
  {\hspace*{-1.25em}}
  {\titlerule*[10pt]{.}\contentspage}
\titlecontents{section}
  [3.8em]{}
  {\contentslabel{2.3em}}
  {\hspace*{-2.3em}}
  {\titlerule*[10pt]{.}\contentspage}

\apptocmd{\appendix}{\AppChap}{}{}

\begin{document}

\tableofcontents
\listoffigures

\chapter{A regular chapter}
\section{A regular section}
\newpage
\appendix
\chapter{TITLE OF APPENDIX}
\section{A section in appendix}
\begin{figure}
\includegraphics{dummy}
\caption{dummy caption}
\end{figure}

\end{document}

An image of the ToC:

enter image description here

An image of the LoF:

enter image description here