If I try to define a new float with:
\documentclass{mwart}
\usepackage{newfloat}
\DeclareFloatingEnvironment{plate}
It works.
But if I just change the class to
\documentclass{mwrep}
\usepackage{newfloat}
\DeclareFloatingEnvironment{plate}
I get this error message:
I get is error message:
line 6: Undefined control sequence. ...vironment[listname={List of plates}]{plate}
line 6: Missing \begin{document}. ...vironment[listname={List of plates}]{plate}
: Unsupported document class (or package) detected,(caption) usage of the caption package is not recommended.
: \caption will not be redefined since it's already(caption) redefined by a document class or package which is(caption) unknown to the caption package.
The same error happens if I use:
\usepackage{caption}
\DeclareCaptionType{plates}[Quadro][List of Plates]
\newenvironment{plate}{\captionsetup{type=plates}}{}
The book
and report
classes don't suffer from this problem at all. I tried to change the definition of caption to that of the default classes, but to no avail.
I know how to create a new float without a package with the mwcls
classes, but the caption
and newfloat
packages are much more practical for that. Still, I have no idea what is causing this issue.
\documentclass{mwrep}
\usepackage{newfloat}
\usepackage[demo]{graphicx}
\usepackage{kantlipsum}
\DeclareFloatingEnvironment[listname={List of plates}]{plate}
\usepackage{caption}
\captionsetup{labelsep=endash}
\let\oldlistofplates\listofplates
\renewcommand{\listofplates}{
\begingroup%
\let\oldnumberline\numberline%
\renewcommand{\numberline}{Plate\ \oldnumberline}%
\oldlistofplates%
\endgroup
}
\begin{document}
\listoffigures
\listofplates
\section{A section}
\kant[1]
\begin{figure}[bp]
\centering
\includegraphics[width=2in]{fig}
\caption{A figure}
\end{figure}
\kant[2]
\begin{plate}
\centering
\includegraphics[width=3in]{plate}
\caption{A plate}
\end{plate}
\kant[3]
\end{document}
mwrep
and the othermw
classes are not compatible withnewfloat
. – egreg Aug 16 '17 at 10:22mwart
is compatible. I just wanted to know why. I've fumbled with the caption definitions, looked thoroughly at the.cls
files, but still haven't found what causes this. – BlackBird Aug 16 '17 at 10:42caption
package and when I use thenewfloat
package. I guessnewfloat
loadscaption
. – BlackBird Aug 16 '17 at 10:44