# Spacing in list of figures / tables for entries from appendices

Having made the changes Werner very helpfully suggested in the Separate table of appendices - pdf bookmarks & avoid previous chapter's format, my list is up and running but I have some spacing problems.

I now have an extra space before my figure and table numbers from the appendices. For example, A.1 in the table of contents. This means it no longer lines up with the lines from the main chapters. In the entry in the .lot file there is a space before { A.1}.

Here is the a minimal working example (or at least my best shot at it):

\documentclass[]{ut-thesis}
\usepackage{tocloft}

\begin{document}

\newcommand{\listappendixname}{List of Appendices}
\newlistof{appendix}{app}{\listappendixname}
\setcounter{appdepth}{2}
\renewcommand{\theappendix}{\Alph{appendix}}
\renewcommand{\cftappendixpresnum}{Appendix\space}
\setlength{\cftbeforeappendixskip}{\baselineskip}
\setlength{\cftappendixnumwidth}{1in}
\newlistentry[appendix]{subappendix}{app}{1}
\renewcommand{\thesubappendix}{\theappendix.\arabic{subappendix}}
\renewcommand{\cftsubappendixpresnum}{Appendix\space}
\setlength{\cftsubappendixnumwidth}{1in}
\setlength{\cftsubappendixindent}{0em}

\newcommand{\myappendix}[1]{%
\refstepcounter{appendix}\pdfbookmark[1]{#1}{#1\theappendix}%
\chapter*{Appendix \theappendix\space #1}%
\markboth{}{\MakeUppercase{Appendix}\ \theappendix\space #1}\par
}

\newcommand{\subappendix}[1]{%
\refstepcounter{subappendix}\pdfbookmark[2]{#1}{#1\thesubappendix}%
\section*{\thesubappendix.\space #1}%
}

\begin{preliminary}

\listoftables
\listoffigures

\end{preliminary}

\chapter{Objective}
\section{Get it done}
\begin{figure}
\caption[Short name for a figure]{Loooong name for the figure with lots of explanation}
\end{figure}
\begin{table}
\caption[Short name for my table]{Loooong name for the my  with lots of explanation}
\end{table}

\appendix
\clearpage \phantomsection
\renewcommand{\thefigure}{ \theappendix.\arabic{figure}}
\renewcommand{\thetable}{ \theappendix.\arabic{figure}}

\myappendix{VBA code for Extension of Jaccard Measure}
\label{chap:code}
\begin{figure}
\caption[Code for functions that do this and that]{}
\end{figure}
\begin{table}
\caption[Table showing not very much]{}
\end{table}

\end{document}

-
As your two questions cover two separate matters, please remove one of them from this question and post it as a new question. This way, other users looking for help can find solutions more easily. Also don't forget to provide a minimal working example (MWE) for each question. – doncherry Jan 7 '12 at 21:16
And please use a better title for your questions. – Martin Schröder Jan 7 '12 at 22:21
The spacing tag seems to be appropriate for your first question. – lockstep Jan 8 '12 at 3:11

There are spurious blank spaces in the redefinition of \thefigure and \thetable; use:
\renewcommand{\thefigure}{\theappendix.\arabic{figure}}

(in both cases I removed the blank spaces before \theappendix).