I used a previous approach to create a separate list of appendices that also shows up in the TOC. Described here: Appendix in scrreprt - Separate table of appendices but mentioned in original TOC
However, I did some modifications so that new entries into the appendix list are created when the table/figure commands are used instead of chapter or section commands. This works fine, but I`m not able to include the table or figure captions into the new list of appendices. So far, only e.g. "Table S1" is displayed.
The problem is that I`m missing the command to call the captions in the following line:
\newcommand*{\thackedtableaddcontentsline}[3]{\oldaddcontentsline{loa}{#2}{\tableformat~~}}
Does anyone know how to handle this? Thanks for any helps or suggestions. Regards
Here is the full code:
\documentclass[listof=totoc, bibliography=totoc,chapterprefix=true,appendixprefix=false]{scrreprt}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{etoolbox}
% Basic changes to directories
% Continuous numbering
\usepackage{chngcntr}
\counterwithout{figure}{chapter}
\counterwithout{table}{chapter}
% "Table/Figure..."
\KOMAoption{listof}{entryprefix}
\newcaptionname{english}{\listoflotentryname}{Table}
\newcaptionname{english}{\listoflofentryname}{Figure}
%% --- List of Appendices ---
% Set the name for the list of appendices (LoA) that can be recalled through the command \listofappendices
\newcommand\appendicesname{Appendices}
\newcommand\listofloaname{List of \appendicesname}
\newcommand*{\listofappendices}{\listoftoc{loa}}
% Redefine LOA
\preto\listofappendices{%
\cleardoublepage
\addtocontents{loa}{~\hfill\textbf{Page}\vspace{2ex}\par}%
}
% Add LoA to ToC
\setuptoc{loa}{totoc}
%% Redefine all Table or Figure commands so to be added to the LoA instead of to the LOT or LOF, when issuing the \appendix command
\makeatletter
\g@addto@macro\appendix{%
\renewcommand*{\tableformat}{\tablename~S\arabic{table}}
\renewcommand*{\figureformat}{\figurename~S\arabic{figure}}
\let\oldaddcontentsline\addcontentsline
\newcommand*{\thackedaddcontentsline}[3]{\oldaddcontentsline{loa}{#2}{#3}}
\newcommand*{\thackedtableaddcontentsline}[3]{\oldaddcontentsline{loa}{#2}{\tableformat~~}}
\let\oldaddcontentsline\addcontentsline
\newcommand*{\fhackedaddcontentsline}[3]{\oldaddcontentsline{loa}{#2}{#3}}
\newcommand*{\fhackedtableaddcontentsline}[3]{\oldaddcontentsline{loa}{#2}{\figureformat~~}}
% Redefine Lable for Tables
\let\oldtable\table
\renewcommand*\table{%
\let\addcontentsline\thackedtableaddcontentsline%
\oldtable%
}
\let\oldendtable\endtable
\renewcommand*\endtable{%
\oldendtable%
\let\addcontentsline\oldaddcontentsline%
}
% redefine Lable for Figures
\let\oldfigure\figure
\renewcommand*\figure{%
\let\addcontentsline\fhackedtableaddcontentsline%
\oldfigure%
}
\let\oldendfigure\endfigure
\renewcommand*\endfigure{%
\oldendfigure%
\let\addcontentsline\oldaddcontentsline%
}
}
\makeatother
% - main document
\begin{document}
\tableofcontents
\listoftables
\listoffigures
\listofappendices
\cleardoublepage
\chapter{Introduction}
\section{Section title}
\begin{table}[!hbt]
\caption[Short caption for LOT]{Long caption in the main text}
\vspace{1ex}\centering\begin{tabular}{|l|l|}
\hline
Formen & Städte\\
\hline
\hline
Quadrat & Bunkenstedt \\
\hline
Dreieck & Laggenbeck\\
\hline
Kreis & Peine\\
\hline
Raute & Wakaluba \\
\hline
\end{tabular}
\label{table1}
\vspace{2ex}\end{table}
\chapter{Results}
\section{Section title}
\newpage
\begin{figure}[h]
\centering
\noindent\includegraphics[width=3cm]{example-image}
\caption{Example figure}
\label{figure1}
\end{figure}
%% - Appendix
\cleardoublepage
\appendix
%Reset Figure/Table numbering
\counterwithin{figure}{section}
\counterwithin{table}{section}
\addchap{Appendix}
\refstepcounter{chapter}
\section*{Supplemental Tables}
\begin{table}[!hbt]
\caption[Caption of Supplemental Table not pictured in LOA]{Long caption in the main text}
\vspace{1ex}\centering\begin{tabular}{|l|l|}
\hline
Formen & Städte\\
\hline
\hline
Quadrat & Bunkenstedt \\
\hline
Dreieck & Laggenbeck\\
\hline
Kreis & Peine\\
\hline
Raute & Wakaluba \\
\hline
\end{tabular}
\label{Appendix1}
\vspace{2ex}\end{table}
\newpage
\section*{Supplemental Figures}
\begin{figure}[h]
\centering
\noindent\includegraphics[width=3cm]{example-image}
\caption[Caption of Supplemental Figure not pictured in LOA]{Long caption in the main text}
\label{Appendix2}
\end{figure}
\end{document}