# Optional argument to \item to appear in brackets after the counter

Usually, when you have the following document:

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}
\item Mary
\item lamb
\end{enumerate}
\end{document}


It will format as

  1. Mary
2. lamb


I would want it to format as

  1. Mary
3. lamb


In other words, I would like the optional argument that can be passed to an \item not to replace the usual label, but I want it to appear additionally. In particular, the counter should still be stepped.

This might seem like a subtlety, but note that the argument should appear before the period and after the counter. In fact, this is just a minimal example - I would like to have greater flexibility in placing the optional argument within the label.

Is there a way to do this with the enumitem package?

-
A simple solution would be \item (had) a little, but perhaps that is not an option. –  Peter Grill Mar 8 '13 at 8:09
What about references? How should item 2 be referenced? With 2 or with 2(had)? –  egreg Mar 8 '13 at 8:34
Just with 2, as in, with the usual counter value. –  Jesko Hüttenhain Mar 8 '13 at 8:51
It would be interesting to know why you don't just do it as Peter Grill suggests. Could you please add that to the question? Thanks! –  Hendrik Vogt Mar 8 '13 at 13:37
It's basically in the comment to Peters answer, but I put it in the original question as well. –  Jesko Hüttenhain Mar 9 '13 at 0:10

You could try it this way:

\documentclass{article}
\usepackage{enumitem}
\newcommand\labeltext{}
\newcommand\specialitem[1][]{%
{\renewcommand\labeltext{ (#1)}\item\leavevmode}}
\begin{document}
\begin{enumerate}[label=\arabic*\noexpand\labeltext.]
\item Mary
\item lamb
\end{enumerate}
\end{document}


Remarks:

1. I'm using a special command but it should also be possible to patch \item but then you would loose the standard behaviour.

2. The correct alignment of the label is left as an exercise ;-).

-
That's clever! Also, it does exactly what I want. Also, exercise solved. Thanks a bunch! =) –  Jesko Hüttenhain Mar 9 '13 at 0:08
I do not fully understand, what you do, so it might be superfluous, but: Jesko writes in a comment to egreg above, that for the references he wants only the counters without the added text. In enumitem for such cases exists an option ref, here I would suggest ref=\arabic*.. –  Speravir Mar 9 '13 at 3:51
No no, don't worry, this is precisely what I wanted. I am using cleveref anyway. –  Jesko Hüttenhain Mar 9 '13 at 15:25

You can define you own custom environment in which you redefine \item macro:

## Code:

\documentclass{article}
\usepackage{enumitem}
\usepackage{xstring}
\usepackage{letltxmacro}

\LetLtxMacro{\OldItem}{\item}
\newenvironment{MyEnumerate}[1][]{%
\renewcommand{\item}[1][]{\OldItem \IfStrEq{##1}{}{}{(##1)}}%
\begin{enumerate}[#1]%
}{%
\end{enumerate}%
}%

\begin{document}
\begin{MyEnumerate}
\item Mary