答案1
您可以在列表中同时设置两个元素 - 第一个元素位于 内,description
最后一个元素位于 内enumerate
。对 进行了调整,\makelabel
以将每个项目设置description
为尾随\hfill:
。
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\setcounter{section}{2}% Just for this example
\section{Specific Requirements}
\subsection{Functional Requirement Specification}
\subsubsection{User Login}
% Style taken from example in section 11 Samples of enumitem documentation
% http://texdoc.net/pkg/enumitem
\begin{description}[leftmargin=3cm, style=sameline]
% Update description label (let to \makelabel) to set the font and add \hfill: to end
\renewcommand{\makelabel}[1]{\normalfont#1\hfill:}%
\item[Use case name]
User Login
\item[Objective]
Used to log in an existing profile.
\item[Priority]
High
\item[Precondition]
User is not logged in to a profile, input profile exists in database, user password matches profile
\item[Postconditions]
Page data is appropriate for selected profile
\item[Flow of events]
\begin{enumerate}[nosep,leftmargin=1.5em]
\item Basic flow
\begin{enumerate}[label*=\arabic*]
\item User enters the username and password in the text box and then clicks on the Login button.
\item An animated loading bar is shown while the authentication of the user profile takes place.
\item The Webpage is updated for the user profile.
\end{enumerate}
\item Alternative Flow 1
\begin{enumerate}[label*=\arabic*]
\item In case of invalid username or invalid password or mismatched password, an error message is shown and it is redirected to the previous page.
\item Software disposes the dialog box
\item Software places cursor at beginning position of the editor
\end{enumerate}
\end{enumerate}
\end{description}
\end{document}