3

I defined two types of new floats, but when I try to list each of them separately, they get collapsed into the same list. Here is an MWE:

\documentclass{book}

\usepackage{float}
\usepackage{newfloat}

\DeclareFloatingEnvironment[
    fileext=loa,
    listname=List of A,
    name=FloatA,
    placement=tbhp,
    within=chapter,
]{floata}

\DeclareFloatingEnvironment[
    fileext=loa,
    listname=List of B,
    name=FloatB,
    placement=tbhp,
    within=chapter,
]{floatb}

\begin{document}

\listoffloatas
\listoffloatbs

\newpage

\begin{floata}
\caption[float a]{float a example}
\end{floata}

\begin{floatb}
\caption[float b]{float b example}
\end{floatb}

\end{document}
1
  • 3
    You are using the same file extension for both (loa). Feb 8 '16 at 16:29
5

The file extensions of both list definitions are the same, this means both float types will be put to the A list (loa). Change the second list extension to, say lob, for example.

\documentclass{book}

\usepackage{float}
\usepackage{newfloat}

\DeclareFloatingEnvironment[
    fileext=loa,
    listname=List of A,
    name=FloatA,
    placement=tbhp,
    within=chapter,
]{floata}

\DeclareFloatingEnvironment[
    fileext=lob,
    listname=List of B,
    name=FloatB,
    placement=tbhp,
    within=chapter,
]{floatb}

\begin{document}

\listoffloatas
\listoffloatbs

\newpage

\begin{floata}
\caption[float a]{float a example}
\end{floata}

\begin{floatb}
\caption[float b]{float b example}
\end{floatb}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.