# How to create a enumerate list adding a custom prefix before each item number?

I found this question Adding some common text to enumerated description lists to be the closest:

\documentclass{scrbook}

\usepackage{enumitem}
\newcounter{descriptcount}
\newlist{enumdescript}{description}{1}
\setlist[enumdescript,1]{%
before={\setcounter{descriptcount}{0}%
\renewcommand*\thedescriptcount{\arabic{descriptcount}}},
font={\bfseries\stepcounter{descriptcount}Case \thedescriptcount,~}
}

\begin{document}

\begin{enumdescript}
\item item one
\item item two
\item[Some Text] item three
\item item four
\item item five
\end{enumdescript}
\end{document}


The only difference, it that I would like to put the number after the custom text, and not before, i.e., instead of doing:

Case 1, item one
Case 2, item two
Case 3, Some Text item three
Case 4, item four
Case 5, item five


I would like to do:

\begin{enumdescript}
\item[Some first] item one
\item[Some second] item two
\item[Some third] item three
\item[Some forth] item four
\item[Some Fifth] item five
\end{enumdescript}

Some first 1) item one
Some second 2) item two
Some third 3) item three
Some forth 4) item four
Some fitth 5) item five


Related questions:

Other questions:

Here is a solution: I create a new environment, which first redefines the \makedescriptionlabel command, then enters a description environment.

\documentclass{scrbook}

\usepackage{enumitem}
\usepackage{xparse}
\newcounter{descriptcount}

\NewDocumentEnvironment{enumdescript}{O{}}{%
\setcounter{descriptcount}{0}%
\renewcommand*\descriptionlabel[1]{%
\stepcounter{descriptcount}%
\normalfont\bfseries ##1~\arabic{descriptcount})%
}%
\description%
}%
{\enddescription}

\begin{document}

\begin{enumdescript}
\item[Some first] item one
\item[Some second] item two
\item[Some third] item three
\item[Some fourth] item four
\item[Some Fifth] item five
\end{enumdescript}

\end{document}


• What is this O{} passed as argument to \NewDocumentEnvironment? Or where I can find the documentation for this \NewDocumentEnvironment? I keep searching but I cannot find it. – user Oct 14 '19 at 3:34
• I just found it. It is from the xparse package: O As for o, but returns (default) if no value is given. Should be given as O{(default)} – user Oct 14 '19 at 3:43