I'm writing a document with many tables and figures.
This is a reproducible piece of my document. (With LuaTeX, but plain LaTeX is OK too).
\RequirePackage{luatex85}
\documentclass[11pt,a4paper]{article}
\usepackage[capitalise,noabbrev]{cleveref}
\usepackage[demo]{graphicx}
\usepackage{float}
\usepackage[section]{placeins}
%\counterwithin{figure}{subsection}
\usepackage[skip=5pt]{caption} %, margin=2em ,labelfont=it, , textfont=it
\captionsetup{font=small, labelfont=bf} %,format=hang
\addtolength{\footnotesep}{5mm}
\begin{document}
\section{Introduction}
\cref{fig:esquema1} summarizes the process
\begin{figure}[h]
\centering
\includegraphics[width=0.95\linewidth]{esquema1}
\caption{My caption.}
\label{fig:esquema1}
\end{figure}
\end{document}
I'd like that some captions instead of "Figure 1" were automatically called "Diagram 1", both below the figure and when referenced from the document.
How can tell LaTeX to do it?
I've read something like
%\captionsetup[figure]{name={Fig.}}
will change the name, but it will do it for all Figures.
I would like to keep that name for figures (real pictures) but add a new "Diagram" name for other (diagrams made with tikz and other).
graphicx
andcleveref
package loading,graphicx
withdemo
option, otherwise reproducible is doubtful ;-)float
includes\newfloat
command to declare new floats, why not use it to distinguishfigures
fromdiagram
?diagram
occasionally, Chirstian's method is the easiest. I've tested withnewfloat
and table of figures doesn't look good.newfloat
is good, in my point of view, but it will introduce a new\listof...
macro (as far as I know), so diagram and figure are not merged inLoF
. Perhaps\let\l@diagram\l@figure
will improve the look ofLoF
which look bad as you reported?