带有侧标题且所有标题在同一行的 Latex

带有侧标题且所有标题在同一行的 Latex

如何在乳胶中创建这样的东西?

在此处输入图片描述

答案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}

相关内容