27

Is there a way to have a List of tables and figures as one list? Currently I have

\listoffigures 
\listoftables

which generates two lists and starts a new page for each list. What I want is a list that contains Tables and Figures in the same list, numbered in sequence (i.e. the first table should get the number following the last figure at that point), Babel-compatible and KOMA-Script-compatible if possible (I use both). The example command

\listoffiguresandtables

should create something like

List of Figures and Tables

1.1 A nice picture caption

1.2 Another nice picture caption

2.1 A caption of a cool table

How to do this?

6
  • \let\c@table=\c@figure will solve part of your problem: it will give a single numbering scheme for tables and figures. Tables and figures will still be different lists. Commented Jun 23, 2013 at 10:17
  • Your question isn't clear on whether you want them numbered in the same sequence. If you do, the easiest thing is just to use figure environment for all cases. If that doesn't do what you want could you say what you want to be different. Commented Jun 23, 2013 at 10:28
  • @DavidCarlisle: Or \let\figure\table\let\endtable\endfigure ;-) Commented Jun 23, 2013 at 10:35
  • @DavidCarlisle If I just use figure everywhere then the tables won't have "Table 2.1: [caption]" below them, but "Figure 2.1: [caption]".
    – Foo Bar
    Commented Jun 23, 2013 at 10:45
  • @FooBar \renewcommand\figurename{Table}\caption{.....} Commented Jun 23, 2013 at 10:52

2 Answers 2

18
\def\table{\def\figurename{Table}\figure}
\let\endtable\endfigure 

Should put all figures and tables in the same sequence and write Table for table captions.

The list of figures will still say list of figures, if you want to change that add

\renewcommand\listfigurename{List of Figures and Tables}
5
  • This gives me \caption outside float on all tables. And I assume it should mean \let\endtable\endfigure (instead of '\lettendtable\endfigure')?
    – Foo Bar
    Commented Jun 23, 2013 at 11:06
  • 1
    @FooBar it would work if you did what I meant, not what I wrote:-) will fix... Commented Jun 23, 2013 at 11:09
  • I want to mention one small drawback: it doesn't work with captionof. Commented Jun 23, 2013 at 11:14
  • 1
    Note that the \renewcommand\listfigurename should be put just before the call to \listoffigures. I tried setting it in the preamble and it seemed to have no effect in my case (it might have been reset by \begin{document} or some package). Commented May 23, 2016 at 10:04
  • 1
    @GeorgesDupéron probably some babel language resetting it? In that case the official way would be to modify the babel language-specific text in the preamble, but as you say defining it just where it is used works as well Commented May 23, 2016 at 10:12
23

You can use the following definition in your header:

\makeatletter
\renewcommand*{\ext@figure}{lot}
\let\c@figure\c@table
\let\ftype@figure\ftype@table
\let\listoftableandfigures\listoftables
\renewcommand*\listtablename{List of Tables and figures}
\makeatother

The leads to:

enter image description here

\documentclass{scrreprt}

\makeatletter
\renewcommand*{\ext@figure}{lot}
\let\c@figure\c@table
\let\ftype@figure\ftype@table
\let\listoftableandfigures\listoftables
\renewcommand*\listtablename{List of Tables and figures}
\makeatother

\begin{document}
\listoftableandfigures


\chapter{foo}
Text

\begin{table}[!ht]
\caption{A table}
\end{table}

Text

\begin{figure}[!ht]
\caption{A figure}
\end{figure}

Text

\begin{table}[!ht]
\caption{A table}
\end{table}

Text

\begin{figure}[!ht]
\caption{A figure}
\end{figure}

\chapter{foo}
Text

\begin{table}[!ht]
\caption{A table}
\end{table}

Text

\begin{figure}[!ht]
\caption{A figure}
\end{figure}

Text

\begin{table}[!ht]
\caption{A table}
\end{table}

Text

\begin{figure}[!ht]
\caption{A figure}
\end{figure}

\end{document}
3
  • Thank you, too, this works as well, so +1. I accepted @DavidCarlisle's answer however because it needs less code.
    – Foo Bar
    Commented Jun 23, 2013 at 11:29
  • 4
    +1, because this solution also supports hyperref's \autoref feature. Commented Jun 23, 2013 at 11:42
  • For me this doesn't work and results in the List of figures and tables called "list of tables"
    – mueslo
    Commented Nov 30, 2023 at 21:29

You must log in to answer this question.

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