我正在尝试获取两个单独的图表列表。其中一个图表包含使用以下方式创建的某些图表tikzpicture
:
\begin{figure}
\begin{tikzpicture}
\begin{axis}
...
\end{axis}
\end{tikzpicture}
\end{figure}
其他都是简单图像。结果我需要有图片列表和绘图列表。我该如何实现?如果可能的话,请举个例子。
答案1
该软件包newfloat
为您提供了一个简单的界面:
\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}
完整示例:
\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}