Welcome to the forum!
With the memoir class you do not need the float package.
memoir
has its own commands for defining floats. I admit that it is not quite as easy, though:
Code: Select all
\newfloat[chapter]{project}{lop}{Project}
\renewcommand*\theproject{\thechapter.\arabic{project}}
\newlistof{listofprojects}{lop}{List of Projects}
\newlistentry[chapter]{project}{lop}{0}
\cftsetindents{project}{0em}{2.3em}
In order to have a completely equivalent definition like the
table
and
figure
floats one even needs some additional definitions. The following definitions are necessary for floats to behave correctly in front-, main- and backmatter. If you don't use
\frontmatter
,
\mainmatter
and
\backmatter
you can leave them away:
Code: Select all
\g@addto@macro\@memfront@floats{\counterwithout{project}{chapter}}
\g@addto@macro\@memmain@floats{\counterwithin{project}{chapter}}
\g@addto@macro\@memback@floats{%
\counterwithin{project}{chapter}%
\setcounter{project}{0}%
}
If you also plan to use the
article
option then also add the following:
Code: Select all
\ifartopt
\counterwithout{project}{chapter}
\fi
IMHO those additions should be handled by the
\newfloat
macro. Maybe we should ask the
memoir
maintainer whether the class can improved in this aspect…
A complete example:
Code: Select all
\documentclass[12pt,a4paper,twoside]{memoir}
\newfloat[chapter]{project}{lop}{Project}
\renewcommand*\theproject{\thechapter.\arabic{project}}
\newlistof{listofprojects}{lop}{List of Projects}
\newlistentry[chapter]{project}{lop}{0}
\cftsetindents{project}{0em}{2.3em}
\makeatletter
\g@addto@macro\@memfront@floats{\counterwithout{project}{chapter}}
\g@addto@macro\@memmain@floats{\counterwithin{project}{chapter}}
\g@addto@macro\@memback@floats{%
\counterwithin{project}{chapter}%
\setcounter{project}{0}%
}
\ifartopt
\counterwithout{project}{chapter}
\fi
\begin{document}
\tableofcontents*
\chapter{A normal chapter}
\begin{table}[h!]
\centering
\caption{Caption for the table.}
\label{tab:table1}
\begin{tabular}{l|c||r}
1 & 2 & 3 \\
\hline
a & b & c
\end{tabular}
\end{table}
\begin{project}
\caption{This is an example caption.}
\label{proj:blah}
\begin{itemize}
\item Possible project
\end{itemize}
\end{project}
\appendix
\listoftables
\listofprojects
\end{document}
The minimized example without additional definitions:
Code: Select all
\documentclass[12pt,a4paper,twoside]{memoir}
\newfloat[chapter]{project}{lop}{Project}
\renewcommand*\theproject{\thechapter.\arabic{project}}
\newlistof{listofprojects}{lop}{List of Projects}
\newlistentry[chapter]{project}{lop}{0}
\cftsetindents{project}{0em}{2.3em}
\begin{document}
\tableofcontents*
\chapter{A normal chapter}
\begin{table}[h!]
\centering
\caption{Caption for the table.}
\label{tab:table1}
\begin{tabular}{l|c||r}
1 & 2 & 3 \\
\hline
a & b & c
\end{tabular}
\end{table}
\begin{project}
\caption{This is an example caption.}
\label{proj:blah}
\begin{itemize}
\item Possible project
\end{itemize}
\end{project}
\appendix
\listoftables
\listofprojects
\end{document}
Regards