4

I would like to have in my LaTeX document an enumerated list, but with the numbers inserted manually rather than automatically and in a chosen order. For example, if I do the following:

\documentclass[12pt,letter]{article}
\usepackage{enumerate}

\begin{document}
\begin{enumerate}[(1)]
\item This is an item on apples.
\item This is an item on oranges.
\end{enumerate}
\end{document}

then the output looks fine, except that I would now like to also be able to move the individual items around between different lists and keep the previous numbers.

Another way to ask my question is that rather than use the enumerate package, I need to begin each item with a number such as (3) or (12) that I insert myself, and the paragraph I type thereafter in this item should be indented the same way it would be indented if I had used the enumerate package.

2
  • 2
    You can simply use \item[(7)] (or whatever number you need) for the item you want to enumerate manually.
    – Guido
    Sep 9, 2013 at 6:38
  • @Guido: That works fine. I shall accept if you post the comment as an answer.
    – AG.
    Sep 9, 2013 at 6:57

2 Answers 2

2

The simplest way would be to use the optional argument of \item, i.e., \item[(3)] (or whatever number you need).

3

I would use the more powerful enumitem package; but with enumerate it would be exactly the same (but with a different optional argument to \begin{enumerate}, of course).

\documentclass[12pt]{article}
\usepackage{enumitem}
\makeatletter
\newcommand\xitem[1]{% x for eXplicit
  \setcounter{\@enumctr}{\numexpr#1-1}% \item will step the counter
  \item}
\makeatletter

\begin{document}
\begin{enumerate}[label=(\arabic*)]
\xitem{3} This is an item on apples.
\xitem{12} This is an item on oranges.
\end{enumerate}
\end{document}

This should work at all levels, so also in an enumerate inside another enumerate.

enter image description here

You must log in to answer this question.

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