0

I'm trying to define functional requirements for software in LaTeX. Each requirement needs an ID, so I decided to use enumitem to define a list with special labels. It's all fine when it's non-nested, but to avoid duplication I wanted to have nested list with sub-requirements.

I'd like the top level items to have labels like FR1: and sublayers like FR1.1:

My current approach looks like this:

\usepackage{enumitem}
\newlist{funcreq}{enumerate}{2}
\setlist[funcreq, 1]{label = \textbf{FR\arabic*:}}
\setlist[funcreq, 2]{label* = \arabic*}

This is far from ideal, because it results in FR1:1 instead.

Is it possible to extract the current number from parent label?
Maybe is it possible to edit parent label from child label to remove the colon? (like adding backspace character as the first character in child label)
Or I should forget about it and use something better than enumitem for this task?

2
\documentclass[a4paper, 10pt]{report}
\usepackage{enumitem}
\newlist{funcreq}{enumerate}{2}

\setlist[funcreq, 1]{label = \textbf{FR\arabic*:},}
\setlist[funcreq, 2]{label = FR\arabic{funcreqi}.\arabic*}
\begin{document}
\begin{funcreq}
\item a
\item b
 \begin{funcreq}
 \item b
 \end{funcreq}
\end{funcreq} 
\end{document}

enter image description here

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.