3

To write my Ph.D. thesis. I have utilized the figure environment to create an environment called a "plate". However, when I use the \listoffigures command, it includes both figures and plates in the list. Unfortunately, when I use the \listofplates command, it generates an error. Therefore, I require assistance in creating a command that separates plates from \listoffigures and generates a separate list of plates. I am using Overleaf, so the solution should be compatible with Overleaf.

\documentclass{article}

\usepackage{graphicx}
\newcounter{platecnt}
\newcounter{figcnt}

\newcommand{\setfigurenumber}[1]
{
    \refstepcounter{#1}
    \renewcommand{\thefigure}{\arabic{#1}}
}

\newenvironment{plate}[1][]{
    \renewcommand{\figurename}{Plate}
    \begin{figure}[#1]
    }{
    \end{figure}
}


\begin{document}
\listoffigures

    \begin{plate}[h]
        \centering
        \setfigurenumber{platecnt}
        \includegraphics[width=0.5\textwidth]{LOAMR1B.png}
        \caption{Plate 1}
        \label{plate:example}
    \end{plate}

        
    \begin{figure}
        \centering
        \setfigurenumber{figcnt}
        \includegraphics[scale = 0.4]{LOAMR1B.png}
        \caption{Figure 1}
        \label{fig:my_label}
    \end{figure}

   

   
\end{document}

1 Answer 1

6

I would use instead the package newfloat like so:

enter image description here

enter image description here

\documentclass{article}

\usepackage{graphicx}

\usepackage{newfloat}
\DeclareFloatingEnvironment[
   fileext=lop,
   listname={List of Plates},
   name=Plate,
   placement=tbp,
   within=none,
   ]{plate}

\begin{document}
\listoffigures
\bigskip
\listofplates
\newpage

\begin{plate}[h]
    \centering
    \includegraphics[width=0.5\textwidth]{example-image-a}
    \caption{Plate 1}
    \label{plate:example}
\end{plate}

\begin{figure}
    \centering
    \includegraphics[scale = 0.4]{example-image-a}
    \caption{Figure 1}
    \label{fig:my_label}
\end{figure}
    
\end{document}
1
  • 1
    It perfectly working. Thanks a lot Commented May 22, 2023 at 4:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .