4

How can I have a numbered list with a description for every item? It should be something like:

1(desc1). balabala

2(desc2). balabala

3(desc3). balabala

I have read the answer here, but it doesn't seem to be helpful (in my case).

Notice that the dot have to be after the description.

  • As see, the answer of @Marco Daniel in linked question solve your problem. Or do I miss something? BTW, what you try so far? – Zarko Mar 29 at 14:39
  • @Zarko I tried his answer, but I can't solve the problem of the location of the dot. – Yijun Yuan Mar 29 at 14:41
  • @Zarko Besides that, the font of the numbers in the normal enumerate environment is decided by the "outer" environment, but Daniel's solution seem to fix the font. – Yijun Yuan Mar 29 at 14:44
  • 1
    The answers to this question might help. – Bernard Mar 29 at 14:56
6

Here's a solution defining a new list environment descenum with enumitem. The descenum environment is basically the same as an enumerate environment, but in this environment (and only there) the \item command is modified to take an argument, which is placed between parentheses after the number of the enumerated item.

A short example:

\documentclass{article}
\usepackage{enumitem}
\newlist{descenum}{enumerate}{1}
\setlist[descenum]{%
    label={\arabic*},
    before={\changeitem},
    after={\renewcommand{\item}{\olditem}},
}
\newcommand{\changeitem}{%
    \let\olditem\item
    \renewcommand{\item}[1]{\olditem (##1).\ }
}
\begin{document}
\begin{descenum}
    \item{First thing to be described} First description.
    \item{Second thing to be described} Second description.
\end{descenum}
\end{document}

If you want to change how the described items are displayed, you can modify the \changeitem command, which renews the \item command. For example, if you want the described things to be in italic, you could replace

\newcommand{\changeitem}{%
    \let\olditem\item
    \renewcommand{\item}[1]{\olditem (##1).\ }
}

with

\newcommand{\changeitem}{%
    \let\olditem\item
    \renewcommand{\item}[1]{\olditem (\textit{##1}).\ }
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.