3

When using a caption with a itemize, how can you get caption saying List 5.1.3 or something instead of Figure 5.1.3? A list isn't a figure, so it should be included in the list of figures either.

\documentclass{article}

\usepackage{enumerate}

\begin{document}

\begin{figure}
\caption{blabla}
\begin{itemize}
\item blabal
\end{itemize}
\end{figure}


\end{document}

2 Answers 2

5

enter image description here

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


\begin{document}

\begin{mylist}
\caption{blabla}
\begin{itemize}
\item blabal
\end{itemize}
\end{mylist}

\end{document} 
2
1

Here is a solution, which violates the use of listings package, but it has the advantage of making a List of Lists entry and uses \cref correctly.

\documentclass{article}
\usepackage{listings} % http://ctan.org/pkg/listings
\renewcommand{\lstlistingname}{List}% Listing -> List
\renewcommand{\lstlistlistingname}{List of \lstlistingname s}% List of Listings -> List of Lists
\usepackage{cleveref}
\crefname{listing}{list}{lists}
\begin{document}
\lstlistoflistings

\begin{itemize}
\begin{lstlisting}[caption={Three blablas},label=list1]\end{lstlisting}\vspace{-\baselineskip}
\item blabla 1
\item blabla 2
\item blabla 3
\end{itemize}

In \cref{list1}, we describe ...\par
\Cref{list1} describes ...

\end{document}

enter image description here

You must log in to answer this question.

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