6

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.

1
  • Welcome to TeX.SX! The package newfloat should be what you're looking for
    – egreg
    Commented Feb 12, 2016 at 0:06

1 Answer 1

8

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

You must log in to answer this question.

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