# Table numbering and listing in table of appendices instead of TOC

I am using a list of appendices based on this thread: Appendix in scrreprt - Separate table of appendices but mentioned in original TOC

This works perfectly fine. But I realized I don't intend to use subsections in the appendix, but only tables instead (my appendix is 99% tables). The following structure illustrates this:

A. 1st appendix chapter
Table A.1
Table A.2 etc.
B. 2nd appendix chapter
Table B.1
Table B.2 etc.


Also my appendix tables are still in the original Table of contents atm. With the above structure, they had to be listed only in the List of Appendices, ideally listed optionally (I don't know if it looks good to list all the tables there. Maybe only the chapters would be fine too)

Finally, if I use any tables in the appendix, suddenly all of my tables' labelfonts (also in other parts of the document, simply all of them) have a dot after them, like the following example shows (see also MWE):

 **Table 1.**
The Table shows the following...


Here is the complete MWE, with the list of appendices from the above link:

\documentclass[a4paper, 12pt, headsepline, smallheadings, listof=totoc]{scrreprt}
\usepackage{booktabs}
\usepackage[labelfont={normalsize,bf}, textfont=small,    labelsep=newline,singlelinecheck=false,format=plain,indention=2cm]{caption}
\setcapindent{0em}
\usepackage{chngcntr}
\counterwithout{table}{chapter}

\newcommand\appendicesname{Appendices}
\newcommand\listofloaname{List of \appendicesname}
\newcommand*{\listofappendices}{\listoftoc{loa}}
\setuptoc{loa}{totoc}

\makeatletter
\let\oldpart\part
\renewcommand*\part[1]{%
\oldpart{#1}%
}
\let\oldchapter\chapter
\renewcommand*\chapter[1]{%
\oldchapter{#1}%
}
\let\oldsection\section
\renewcommand*\section[1]{%
\oldsection{#1}%
}
\let\oldsubsection\subsection
\renewcommand*\subsection[1]{%
\oldsubsection{#1}%
}
\let\oldsubsubsection\subsubsection
\renewcommand*\subsubsection[1]{%
\oldsubsubsection{#1}%
}
}
\makeatother

\begin{document}

\listoftables
\tableofcontents

\chapter{1st chapter}

\begin{table}[h]
\centering
\caption[Table caption (1)]{The Table shows the following...}
{\normalsize
\begin{tabular}{lccccc}
\toprule
A & B & C & D & E \\
\midrule
1 & 2 & 3 & 4 & 5 \\
\bottomrule
\end{tabular}
}
\end{table}
\chapter{2nd chapter}

\listofappendices
\appendix

\chapter{1st appendix chapter}

\begin{table}[h]
\centering
\caption[Table caption (2)]{The Table shows the following...}
{\normalsize
\begin{tabular}{lccccc}
\toprule
A & B & C & D & E \\
\midrule
1 & 2 & 3 & 4 & 5 \\
\bottomrule
\end{tabular}
}
\end{table}

\chapter{2nd appendix chapter}

\begin{table}[h]
\centering
\caption[Table caption (3)]{The Table shows the following...}
{\normalsize
\begin{tabular}{lccccc}
\toprule
A & B & C & D & E \\
\midrule
1 & 2 & 3 & 4 & 5 \\
\bottomrule
\end{tabular}
}
\end{table}

\end{document}


As you can see, the current numbering is wrong, and the tables are listed in the TOC instead of the list of appendices. And there is this unwanted dot after the table labelfonts.

Also if you got a better idea how to organize this, let me know. In the case of many tables, I think subsections in the appendix are a little bit too much of segmentation. But I am open to suggestions. Thanks for any help!

I've managed to accomplish all your requests...

The following stuff has been added to the redefinition of \appendix through \g@addto@macro:

• It seems that in the appendices you want the table counter to be reset at every chapter, so

\counterwithin{table}{chapter}

• To remove the dot before the table caption

\renewcommand*{\tableformat}{\tablename~\thetable}

• To insert "Table #" instead of the table caption in the LoA

\newcommand\hackedtableaddcontentsline[3]{\oldaddcontentsline{loa}{#2}{\tableformat}}

• Finally, to insert all appendix tables in the LoA instead of in the LoT,

\let\oldtable\table
\renewcommand*\table{%
\oldtable%
}
\let\oldendtable\endtable
\renewcommand*\endtable{%
\oldendtable%
}


Complete MWE:

\documentclass[a4paper, 12pt, headsepline, smallheadings, listof=totoc]{scrreprt}
\usepackage{booktabs}
\usepackage[labelfont={normalsize,bf},textfont=small,labelsep=newline,singlelinecheck=false,format=plain,indention=2cm]{caption}
\setcapindent{0em}
\usepackage{chngcntr}
\counterwithout{table}{chapter}

\newcommand\appendicesname{Appendices}
\newcommand\listofloaname{List of \appendicesname}
\newcommand*{\listofappendices}{\listoftoc{loa}}
\setuptoc{loa}{totoc}

\makeatletter
\counterwithin{table}{chapter}
\renewcommand*{\tableformat}{\tablename~\thetable}
\let\oldpart\part
\renewcommand*\part[1]{%
\oldpart{#1}%
}
\let\oldchapter\chapter
\renewcommand*\chapter[1]{%
\oldchapter{#1}%
}
\let\oldsection\section
\renewcommand*\section[1]{%
\oldsection{#1}%
}
\let\oldsubsection\subsection
\renewcommand*\subsection[1]{%
\oldsubsection{#1}%
}
\let\oldsubsubsection\subsubsection
\renewcommand*\subsubsection[1]{%
\oldsubsubsection{#1}%
}
\let\oldtable\table
\renewcommand*\table{%
\oldtable%
}
\let\oldendtable\endtable
\renewcommand*\endtable{%
\oldendtable%
}
}
\makeatother

\begin{document}

\listoftables
\tableofcontents

\chapter{1st chapter}

\begin{table}[h]
\centering
\caption[Table caption (1)]{The Table shows the following...}
{\normalsize
\begin{tabular}{lccccc}
\toprule
A & B & C & D & E \\
\midrule
1 & 2 & 3 & 4 & 5 \\
\bottomrule
\end{tabular}
}
\end{table}
\chapter{2nd chapter}

\listofappendices
\appendix

\chapter{1st appendix chapter}

\begin{table}[h]
\centering
\caption[Table caption (2)]{The Table shows the following...}
{\normalsize
\begin{tabular}{lccccc}
\toprule
A & B & C & D & E \\
\midrule
1 & 2 & 3 & 4 & 5 \\
\bottomrule
\end{tabular}
}
\end{table}

\chapter{2nd appendix chapter}

\begin{table}[h]
\centering
\caption[Table caption (3)]{The Table shows the following...}
{\normalsize
\begin{tabular}{lccccc}
\toprule
A & B & C & D & E \\
\midrule
1 & 2 & 3 & 4 & 5 \\
\bottomrule
\end{tabular}
}
\end{table}

\end{document}


Output (LoT):

Output (LoA):

## EDIT

If you want it to work also with longtables, also add the following lines:

\let\oldlongtable\longtable
\renewcommand*\longtable{%

• This works nearly perfectly. Is there any way to adjust \newcommand\hackedtableaddcontentsline[3]{\oldaddcontentsline{loa}{#2}{\tableformat}} to also include longtables besides normal tables? Atm these seem to be ignored in the list of appendices. – TomM Dec 18 '13 at 21:27
• @TomM Just in case you want to remove all periods after sectioning numbers, table numers, etc, load scrreprt with the additional option numbers=noendperiod. In this case the line \renewcommand*{\tableformat}{\tablename~\thetable} is superfluous. – karlkoeller Jan 8 '14 at 17:57