4

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.

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.