I have some text that I want to turn into a template which looks like this:
Extensions:
\begin{enumerate}
\item[2.a] xyz
\begin{enumerate}[i.]
\item a
\item b
\item c
\end{enumerate}
\item[5.b] abc
\begin{enumerate}[i.]
\item x
\item y
\end{enumerate}
\end{enumerate}\\
I want to make a new command that mimics the text above but that takes as arguments something like:
\ucextensions{[2.a] xyz, [5.b] abc}{{a, b, c}, {x, y}}
Please note that I will have variable numbers of arguments. I already have:
\newcommand{\ucextensions}[2]{
Extensions:
\begin{enumerate}
\forcsvlist{\item}{#1 \extensionsteps{#2}}
\end{enumerate}\\
}
\newcommand{\extensionsteps}[1]{
\begin{enumerate}[i.]
\forcsvlist{\item}{#1}
\end{enumerate}
}
which gives output like:
- [2.a] xyz
- [5.b] abc
- a, b, c
- x, y
(except with i. and ii. instead of bullets). I would like instead to have output like:
- [2.a] xyz
- a
- b
- c
- [5.b] abc
- x
- y
(again with i's instead of bullets). I am using the etoolbox
package to do this. Is there a way to do something similar that would take either a nested csv, or a series of csv's to create the desired output?
Best Answer
I'd re-order the input a bit: