我正在嘗試獲取兩個單獨的數字列表。這些是包含使用以下命令創建的一些圖的圖形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}