Table of Contents – Creating Two Separate Lists of Figures

table of contents

I'm trying to get two separate lists of figures. Ones are the figures containing some plots created using tikzpicture like:

\begin{figure}
  \begin{tikzpicture}
    \begin{axis}
    ...
    \end{axis}
  \end{tikzpicture}
\end{figure}

and the others are simple images. At result I need to have List of Figures and a List of Plots. How can I achieve it? Please give an example if possible.

Best Answer

The package newfloat offers you a simple interface:

\usepackage{newfloat}

\DeclareFloatingEnvironment[
  fileext=lop,
  listname={List of Plots},
  name=Plot,
  placement=tp,
  %within=section,% activate it if you want
  %chapterlistsgaps=on,% meaningful only if chapters exist
]{plot}

Full example:

\documentclass{article}

\usepackage{newfloat}
\usepackage{pgfplots}

\DeclareFloatingEnvironment[
  fileext=lop,
  listname={List of Plots},
  name=Plot,
  placement=tp,
  %within=section,% activate it if you want
  %chapterlistsgaps=on,% only meaningful when chapters exist
]{plot}

\pgfplotsset{compat=1.13}

\begin{document}

\listoffigures

\listofplots

\section{Test}

\begin{figure}[htp]
\centering

\fbox{\rule{0pt}{3cm}\rule{3cm}{0pt}}

\caption{A figure}

\end{figure}

\begin{plot}[htp]
\centering

\begin{tikzpicture}
\begin{axis}[
    extra x ticks={-2,2},
    extra y ticks={-2,2},
    extra tick style={grid=major}]
    \addplot {x};
    \draw (axis cs:0,0) circle[radius=2];
\end{axis}
\end{tikzpicture}

\caption{A plot}

\end{plot}

\end{document}

enter image description here