2

I would like to include a "List of lists" to appear after "List of figures" and "List of tables". Therefore I cannot simply change the heading of either of those, I need to create a new "List of lists". How can this be done? It would not be an issue for me to do this manually in each list.

The floating environment is made like this

\usepackage{newfloat}
\DeclareFloatingEnvironment[placement={!ht},name=List]{mylist}

And then create lists like this

\begin{mylist}
     \begin{itemize}
        \item Items go here, as usual
    \end{itemize}
    \caption{Some caption}
    \label{list:some-list}
\end{mylist}

I did it this way in order to have a caption and label, in addition to making it a floating environment, like figures.

5
  • \listoflists should already work (it is defined by newfloat when you create a new float type).
    – Marijn
    Commented Apr 4, 2022 at 16:41
  • 1
    Maybe \listofmylists, I'm not sure how the name argument interacts with this.
    – Marijn
    Commented Apr 4, 2022 at 16:42
  • Thank you! The solution is \listofmylists, otherwise I got an error (Undefined control sequence)
    – Student024
    Commented Apr 4, 2022 at 16:45
  • 1
    In the manual of newfloat you can find some more options, for example setting the title of the list.
    – Marijn
    Commented Apr 4, 2022 at 16:46
  • Thanks again :)
    – Student024
    Commented Apr 4, 2022 at 16:47

2 Answers 2

1

You can use the tocloft package, which can provide non-floating, but captioned and referenceable lists.

% newlistprob.tex  SE 639634

\documentclass{article}

\usepackage{tocloft}

% enable a List of Lists
\newcommand{\listoflistname}{List of Lists}
\newlistof[section]{lists}{lst}{\listoflistname}

% Specify the code for a list
\newcommand{\mylist}[1]{%
  \refstepcounter{lists}
  \par\noindent\textbf{List \thelists. #1}
  \addcontentsline{lst}{lists}{\protect\numberline{\thelists}#1}\par}

\begin{document}
\tableofcontents

\listoflists

\section{Begin}

\mylist{First list}
\begin{itemize}
\item A
\item B
\end{itemize}
\label{Flist}

List \ref{Flist} is the first list.

\mylist{Second list}
\begin{itemize}
\item C
\item D
\end{itemize}
\label{Slist}

List \ref{Slist} is another list.

\end{document}

enter image description here

Read the tocloft package manual for more information.

1

\listofmylists was automatically defined when I made the floating environment, as mentioned by @Marijn in the comments.

More info can be found in the documentation

1

You must log in to answer this question.

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