Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to interrupt/resume a list in LaTeX?

Tags:

latex

I want to produce output something like this:

1. List item

2. Another list item

Paragraph of comments on list items 1 and 2.

3. Further item

4. Final item

I'm sure I've seen a nice way to interrupt and resume lists in this way (without explicitly setting some counter), but I can't reproduce it.

like image 949
Anton Geraschenko Avatar asked Aug 28 '09 16:08

Anton Geraschenko


People also ask

How do you continue enumerate in LaTex?

The environment where this happens is called cenumerate-- as in, continuing to enumerate. To employ this environment at any level k in i, ii, iii or iv, just employ the command \renewcommand{outlinek}{cenumerate} before the start of your outline. Be warned, this will even continue to count across outlines!

How do I skip enumerate numbers in LaTex?

You can also use \addtocounter{enumi}{2} (for example, in your particular case) to skip 2 items.

How do you do bullet points in LaTex?

You can create a numbered list with LaTex bullet points with the same code we used before, except with \begin{enumerate} and \end{enumerate} around the list items instead of \begin{itemize} and \end{itemize}.


3 Answers

I like enumitem for this sort of thing:

\documentclass{article}
\usepackage{enumitem}
\begin{document}

\begin{enumerate}
  \item List item
  \item Another list item
\end{enumerate}

Paragraph of comments on list items 1 and 2.

\begin{enumerate}[resume]
  \item Further item
  \item Final item
\end{enumerate}

\end{document}
like image 145
Will Robertson Avatar answered Oct 19 '22 02:10

Will Robertson


The TeX FAQ lists several ways of doing this. Read here for full details.

I've successfully used the mdwlist package (which is part of mdwtools) in my own documents. For example:

\documentclass{article}
\usepackage{mdwlist}

\begin{document}

\begin{enumerate}
\item List item
\item Another list item
\suspend{enumerate}

Paragraph of comments on list items 1 and 2.

\resume{enumerate}
\item Further item
\item Final item
\end{enumerate}

\end{document}

Thanks to Dervin Thunk for providing the FAQ link.

like image 34
ChrisN Avatar answered Oct 19 '22 02:10

ChrisN


\documentclass{article}

\begin{document}

\begin{enumerate}
\item first;

\item second;
\end{enumerate}

This is a paragraph.


\begin{enumerate}
  \setcounter{enumi}{2}
\item third;

\item and so on...
\end{enumerate}
\end{document}

edit: as pointed out by Dervin Thunk, I hardcoded 2 here.

so, here's a solution that seems to work:

\documentclass{article}

\newcounter{tempcounter}

\begin{document}

\begin{enumerate}
\item first;

\item second;
  \setcounter{tempcounter}{\value{enumi}}
\end{enumerate}

This is a paragraph.


\begin{enumerate}
  \setcounter{enumi}{\value{tempcounter}}
\item third;

\item and so on...
\end{enumerate}
\end{document}
like image 8
giorgian Avatar answered Oct 19 '22 02:10

giorgian