I have two appendices. The first one contains only tables, while the second one has tables, figures and schemes. At the begin of each appendix I want the list of tables/figures to show up. I know how to do this, if there is only one list of tables/figures for the whole appendix. I followed Markus Kohm's guideline for that. This works fine with a single list, but not with my modifications for multiple lists. In addition for the second appendix, I want the tables, figures and schemes listed combined in one "appendix B list".
So, what I want it to look like is this:
Appendix A
Content
Table A.1 Table in Appendix A
Table A.2 Table in Appendix A
Appendix B
Content
Table B.1 Table in Appendix B
Figure B.1 Figure in Appendix B
Scheme B.1 Scheme in Appendix B
Table B.2 Table in Appendix B
This is what I thought should work, but which does not give the desired output:
\documentclass[listof=totoc]{scrbook}
\usepackage{tocbasic}
\newcommand{\entrynumberwithprefix}[2]{%
\csname listof#1entryname\endcsname\ #2%
}%
\newlength{\loftnumwidth}
\setlength{\loftnumwidth}{5em}
\DeclareTOCStyleEntry[%
entrynumberformat=\entrynumberwithprefix{lot},
numwidth=\loftnumwidth,%
indent=0pt,
]{tocline}{table}
\DeclareTOCStyleEntry[%
entrynumberformat=\entrynumberwithprefix{lof},
numwidth=\loftnumwidth,%
indent=0pt,
]{tocline}{figure}
\DeclareNewTOC[%
type=scheme,%
types=schemes,%
float,%
floattype=4,%
name=Scheme,%
tocentrynumberformat=\entrynumberwithprefix{los},
tocentrynumwidth=\loftnumwidth,%
tocentryindent=0pt,
]{los}
% new lists for appendices
\DeclareNewTOC[%
listname={Content of Appendix A},%
]{lotA}
\DeclareNewTOC[%
listname={Tables in Appendix B},%
]{lotB}
\DeclareNewTOC[%
listname={Content of Appendix B},%
]{lofB}
\DeclareNewTOC[%
listname={Schemes in Appendix B},%
]{losB}
\makeatletter
\newcommand{\useappendixtocs}{%
\setcounter{figure}{0}%
\setcounter{table}{0}%
\KOMAoptions{listof=leveldown}
\renewcommand{\ext@table}{lotA}%
\renewcommand{\ext@figure}{lotB}%
\renewcommand{\ext@figure}{lofB}%
\renewcommand*{\ext@figure}{losB}%
}
\g@addto@macro\appendix{
\useappendixtocs
}
\makeatother
\begin{document}
\tableofcontents
\listoffigures
\listoftables
\listofschemes
\chapter{Main Document}
\begin{table}
\caption{Table in main document.}
\end{table}
\begin{figure}
\caption{Figure in main document.}
\end{figure}
\begin{scheme}
\caption{Scheme in main document.}
\end{scheme}
\appendix
\chapter{First appendix with tables only}
\listoftoc{lotA}
\begin{table}
\caption{Table in appendix A.}
\end{table}
\chapter{Second appendix with figures, tables and schemes}
\listoftoc{lofB}%
\begin{table}
\caption{Table in appendix B.}
\end{table}
\begin{figure}
\caption{Figure in appendix B.}
\end{figure}
\begin{scheme}
\caption{Scheme in appendix B.}
\end{scheme}
\begin{table}
\caption{Table in appendix B.}
\end{table}
\end{document}




scrbookloads packagetocbasicautomatically. – esdd Apr 22 '18 at 18:37