1

I want the list of figures and the list of tables to appear in my table of contents as sections instead of as chapters. A bit like the elements right above (from summary to acronyms)

A quick reminder that I used

\listoftables

\listoffigures

To automatically generate the list of tables and figures

I also used

\section*{Summary} \label{sec:summary} \addcontentsline{toc}{section}{\nameref{sec:summary}}

To create and and the sections to the table of contents

Table of contents

3
  • \usepackage{etoolbox}\patchcmd{\listoffigures}{\chapter}{\section}{}{} and similarly for \listoftables
    – Ivan
    Jun 6, 2021 at 15:11
  • It's not working
    – pyaj
    Jun 6, 2021 at 15:17
  • I think that I'll have to use \renewcommand
    – pyaj
    Jun 6, 2021 at 15:22

2 Answers 2

2

Suggestion using package tocbasic:

\documentclass{book}
\usepackage{blindtext}% only for dummy text

\usepackage{tocbasic}
\renewcommand*{\listoffigures}{\listoftoc[\listfigurename]{lof}}
\renewcommand*{\listoftables}{\listoftoc[\listtablename]{lot}}
\setuptoc{lof}{leveldown,totoc}
\setuptoc{lot}{leveldown,totoc}

\begin{document}
\listoffigures
\listoftables

\tableofcontents
\blinddocument
\begin{table}
  \caption{A table}
\end{table}
\begin{figure}%
  \caption{A figure}%
\end{figure}
\end{document}

enter image description here

Remark: tocbasic can not be used together with package tocloft or titletoc.

2
  • Thank you problem solved
    – pyaj
    Jun 6, 2021 at 21:25
  • That is a complete solution, since it changes not only the toc entries to section, but also changes pagestyle (e.g. chapter may break pages, whereas section does not) and variables (e.g. section/chapter in the headings) correctly. Jun 14 at 12:34
1

Try this, no need to change any pre-existing code.

% loftoc.tex  SE 600162
\documentclass{report}
\begin{document}
\tableofcontents
\clearpage
\addcontentsline{toc}{section}{List of Figures}
\listoffigures

\chapter{First}

\begin{figure}
\centering
\caption{A figure}
\end{figure}

\end{document}

The macro \addcontentsline is basic LaTeX.

enter image description here

3
  • The problem is that \listoffigures automatically adds the content line to the table of content
    – pyaj
    Jun 6, 2021 at 21:21
  • I get the list of figures repeated twice in the table of contents: one being showed as section and one being shown as chapter
    – pyaj
    Jun 6, 2021 at 21:24
  • 1
    @PenielAdounkpe As you have not bothered to show what documentclass you are using then why should I bother to try and help? My solution works for the report, and book classes. With a minor adjustment, use listoffigures* it works for the memoir class. Jun 7, 2021 at 16:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .