The captions of my figures read, as usual, "Figure #: some text". I want a few of them, which are scattered through the text, to read "Diagram #: some text" (the counter being consecutive). What is the right way to do this? Should I define a new float environment?
Here, a minimal example:
\documentclass{article}
\usepackage{amssymb,latexsym,amsmath}
\usepackage{amsmath,amsthm,amssymb,pstricks,pst-node}
\begin{document}
Some text, and then:
\begin{figure}[htb]
\[
\text{This is a figure}
\]
\caption{Ok. Here I like the label figure}
\end{figure}
Now:
\begin{figure}[htb]
\[
\begin{array}{cc}
\Rnode{a}{A} & \Rnode{b}{B}
\end{array}
\ncLine{a}{b}\Aput{}
\]
\caption{Wrong! Here I would like the caption to say ``Diagram 2:...''}
\end{figure}
and finally:
\begin{figure}[htb]
\[
\vspace{-.1cm}
\setlength{\arraycolsep}{1.8cm}
\text{This is another figure}
\]
\caption{Ok. Here I like the label figure}
\end{figure}
\end{document}
Best Answer
First solution Temporarily redefine the
\figurename
to Diagram within thefigure
environment. (Thanks to Torbjorn for his reminder about the group feature offigure
)Edit -- Alternate Version using
\usepackage{caption}