為什麼我的浮動清單會折疊?

為什麼我的浮動清單會折疊?

我定義了兩種類型的新浮動,但是當我嘗試單獨列出它們時,它們會折疊到同一個列表中。這是一個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

兩個清單定義的檔案副檔名相同,這表示兩個浮點類型都會放入清單中A( loa)。例如,將第二個清單副檔名變更為lob

\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}

相關內容