如何在文档中间开始一种新类型的图形计数器?

如何在文档中间开始一种新类型的图形计数器?

我尝试寻找这些问题的答案,但一无所获,所以任何帮助都将不胜感激。我的 LaTeX 文档中有几张图表,它们的标题是普通的“图 1:...”。但是,我想让图表有一个独立的计数器,将其标题为“图 1”而不是“图 1”,同时让常规图像的标题为“图”。

我发现了一些与此相关的问题(就像这样),但它们要么涉及\renewcommand{\figurename}{Fig.}要么包含caption包装,这两者似乎都无法实现两个独立图形计数器的想法。

编辑:解决方案

有人可能会在以后偶然发现这个问题,所以我只是想提出解决这个问题的方法。

\documentclass{article}
\usepackage{float}
\newfloat{Graph}{tbp}{ext}

\begin{document}
...
\begin{Graph}[h!]
\centering
\includegraphics[width=0.65\textwidth]{graph1.PNG}
\caption{caption goes here.}
\end{Graph}
...
\end{document}

答案1

您可以使用 float 包和\newfloat{graph}

答案2

如果您只有少量表格或者没有表格,则可以使用表格来绘制图表。

\renewcommand{\tablename}{Graphs}%
\begin{table}
\centering
\includegraphics[width=0.5\textwidth]{graph1.png}
\caption{my fancy graph}
\end{table}%\setcounter{table}{2} % return value if you got other tables,
%if only graphs no need to reset counter.

相关内容