There ist a great answer and solution to this question by Christian Hupfer, BUT it does not work with KOMA-Script
which is a pity.
The question is how to get several listof
in one document?
\documentclass{scrbook}
\usepackage{xparse}
\usepackage{xpatch}
\usepackage{caption}
\usepackage{blindtext}
% Do not a driver counter, i.e. a resetting counter for those two counter fellows here:
\newcounter{lofcntr}
\newcounter{lotcntr}
\NewDocumentCommand{\clearcontents}{}{%
\stepcounter{lofcntr}% We don't need labels here, I suppose?
\stepcounter{lotcntr}%
\setcounter{figure}{0}
\setcounter{table}{0}
}
\AtBeginDocument{%
\stepcounter{lofcntr}%
\stepcounter{lotcntr}%
}
\makeatletter
% Store the definition of \ext@figure etc. first
\let\latex@ext@figure\ext@figure
\let\latex@ext@table\ext@table
\AtBeginDocument{%
\xpretocmd{\caption}{%
% Prepend the extension with the number of the current list of ...
\def\ext@figure{\number\value{lofcntr}\latex@ext@figure}
\def\ext@table{\number\value{lotcntr}\latex@ext@table}
}{\typeout{Worked!}}{\typeout{Failed miserably!}}
}
\xpatchcmd{\listoffigures}{%
\@starttoc{lof}%
}{%
\@starttoc{\number\value{lofcntr}lof}%
}{\typeout{Patch success}}{\typeout{Patch failure}}
\xpatchcmd{\listoftables}{%
\@starttoc{lot}%
}{%
\@starttoc{\number\value{lotcntr}lot}%
}{\typeout{Patch success}}{\typeout{Patch failure}}
\makeatother
\begin{document}
\tableofcontents
\listoffigures
\listoftables
\captionof{figure}{Some figure caption for 1st lof}
\captionof{figure}{Some figure caption for 1st lof}
\captionof{figure}{Some figure caption for 1st lof}
\captionof{figure}{Some figure caption for 1st lof}
\captionof{table}{Some table caption for 1st lot}
\captionof{table}{Some table caption for 1st lot}
\captionof{table}{Some table caption for 1st lot}
\captionof{table}{Some table caption for 1st lot}
\clearcontents
\listoffigures
\listoftables
\captionof{figure}{Some figure caption for 2nd lof}
\captionof{figure}{Some figure caption for 2nd lof}
\captionof{figure}{Some figure caption for 2nd lof}
\captionof{figure}{Some figure caption for 2nd lof}
\captionof{table}{Some table caption for 2nd lot}
\captionof{table}{Some table caption for 2nd lot}
\captionof{table}{Some table caption for 2nd lot}
\captionof{table}{Some table caption for 2nd lot}
\end{document}
The problem is that the names of the lists are not display correctly and set to a new page (common behaviour?!):
Is it possible to get rid of the heading at all and that it won't start on a new page?
Edit: I’d be happy to work with a different code as well. At least it works with KOMA
and is as easy to adopt as the one above.
\DeclareNewTOC
to define another LoF with another extension? Then you can either change\ext@figure
or you can define another figure environment using optionfloat
of\DeclareNewTOC
. Something like this has been shown in: Mit einem aktuellen KOMA-Script geht alles viel einfacher for a separate appendix LoF (and LoT and ToC).DeclareNewTOC
for eachlistoffigures
. Since I will have numerouslistoffigures
that approach looks like too much manual work.