On How to create a enumerate list adding a custom prefix before each item number? I learned how to create a custom environment to create labels. But now, it is missing the enumitem shortlabels feature:
By taking the original example, I managed to pass the delimiter type to the nested environment list:

\documentclass{scrbook}
\usepackage{enumitem}
\usepackage{xparse}
\newcounter{enumerateoptionalcount}
\NewDocumentEnvironment{enumerateoptional}{O{)}}{%
\setcounter{enumerateoptionalcount}{0}%
\renewcommand*\descriptionlabel[1]{%
\stepcounter{enumerateoptionalcount}%
\normalfont\bfseries ##1~\arabic{enumerateoptionalcount}#1%
}%
\description%
}%
{\enddescription}
\begin{document}
\begin{enumerateoptional}[)]
\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{enumerateoptional}
\end{document}
But how can I also pass the number type as enumerate environment has, i.e.,
- If I call
\begin{enumdescript}[1)], then, the number are1) ..., 2) ... - If I call
\begin{enumdescript}[i)], then, the number arei) ..., ii) ... - If I call
\begin{enumdescript}[I)], then, the number areI) ..., II) ... - ...
I tried to look at the enumitem package source-code, but I cannot understand anything about it. For example, \ifx\enit@b\enit@c\else ... \enit@elt{##1}{##2}, what is enit? What does elt mean? What are enit@a, enit@b, enit@c doing?
\newcommand\SetEnumerateShortLabel[2]{%
\let\enit@a\@empty
\def\enit@elt##1##2{%
\def\enit@b{#1}\def\enit@c{##1}%
\ifx\enit@b\enit@c\else
\expandafter\def\expandafter\enit@a\expandafter{%
\enit@a
\enit@elt{##1}{##2}}%
\fi}%
\enit@marklist
\expandafter\def\expandafter\enit@a\expandafter{%
\enit@a
\enit@elt{#1}{#2}}%
\let\enit@marklist\enit@a}
\SetEnumerateShortLabel{a}{\alph*}
\SetEnumerateShortLabel{A}{\Alph*}
\SetEnumerateShortLabel{i}{\roman*}
\SetEnumerateShortLabel{I}{\Roman*}
\SetEnumerateShortLabel{1}{\arabic*}


enumerateenvironment instead of using the one provided byenumitem? You could just pass the optional parameter to it then. – siracusa Oct 16 '19 at 06:57