How can the List of Figures and List of Tables be included in the Table of Contents when they have been placed under the control of the tocbasic
package? Ordinarily, these listings can be included by using the package tocbibind
without the options notlof
and notlot
.
\documentclass{report}
\usepackage[nottoc]{tocbibind}% load before tocbasic
\usepackage{tocbasic}
% reset vertical spacing of LoF and LoT
\renewcommand{\listoffigures}{\listoftoc[\listfigurename]{lof}}
\renewcommand{\listoftables}{\listoftoc[\listtablename]{lot}}
% place LoF and LoT under control of tocbasic
\DeclareTOCStyleEntries{tocline}{figure,table}
% define custom listing
\DeclareNewTOC[%
type=thing,
float,
name=Thing,
listname={List of Things},
counterwithin=chapter,
setup=totoc,% add this list to the Table of Contents
tocentryindent:=figure,
tocentrynumwidth:=figure
]{lop}
% match vertical spacing of LoF and LoT
\usepackage{xpatch}
\makeatletter
\xapptocmd{\@chapter}
{\addtocontents{lop}{\protect\addvspace{10\p@}}}
{}{\PatchFailed}
\makeatother
\begin{document}
\tableofcontents
\listoffigures
\listoftables
\listofthings
\chapter{First}
\begin{figure}[ht] \centering\fbox{Figure}\caption{Figure 1} \end{figure}
\begin{table}[ht] \centering\fbox{Table} \caption{Table 1} \end{table}
\begin{thing}[ht] \centering\fbox{Thing} \caption{Thing 1} \end{thing}
\chapter{Second}
\begin{figure}[ht] \centering\fbox{Figure}\caption{Figure 2} \end{figure}
\begin{table}[ht] \centering\fbox{Table} \caption{Table 2} \end{table}
\begin{thing}[ht] \centering\fbox{Thing} \caption{Thing 2} \end{thing}
\begin{figure}[ht] \centering\fbox{Figure}\caption{Figure 3} \end{figure}
\begin{table}[ht] \centering\fbox{Table} \caption{Table 3} \end{table}
\begin{thing}[ht] \centering\fbox{Thing} \caption{Thing 3} \end{thing}
\end{document}
Contents page, lacking the LoF and LoT: