我是 Tex 和 LaTeX 的新手,我甚至不知道在哪里寻找答案。
我想使用 LaTeX 制作一份文档(需求文档),其中需求段落/子段落以前导文本和层级编号进行编号。
例如
FAU_GEN.1 Audit data generation
Hierarchical to: No other components.
FAU_GEN.1.1 The TSF shall be able to generate an audit record of the following auditable
events:
a) Start-up and shutdown of the audit functions;
b) All auditable events for the [selection: minimum, basic, detailed, not
specified] level of audit; and
c) [assignment: other specifically defined auditable events].
FAU_GEN.1.2 The TSF shall record within each audit record at least the following
information:
a) Date and time of the event, type of event, subject identity, and the
outcome (success or failure) of the event; and
b) For each audit event type, based on the auditable event definitions of
the functional components included in the PP/ST, [assignment: other
audit relevant information]
Dependencies: FPT_STM.1 Reliable time stamps
依赖关系是对另一个需求的外部引用,并被编号为该外部引用需求。FPT_STM.1 不会自动增加。
此 FAU_GEN.1 要求后面可能跟着另一个将自动递增的要求,如下所示:
FAU_GEN.2 用户身份关联从属于:无其他组件。
FAU_GEN.2.1 TSF 应能够将每个可审计事件与导致该事件的用户身份相关联。
依赖项:FAU_GEN.1 审计数据生成 FIA_UID.1 识别时间
我在网上能找到的最接近的例子是https://www.niap-ccevs.org/Documents_and_Guidance/cc_docs/cc_v21_part2.pdf
第 19 页上的第 3.2 节。虽然这个示例文档还有很多其他内容。
答案1
也许像这样
\documentclass{artikel3}
\catcode`\_=11 % use \sb if you need a math subscript
\setcounter{secnumdepth}{5}
\usepackage[T1]{fontenc}
\newcommand\reqpara[1]{%
\def\thispara{#1}\paragraph{}}
\newcommand\reqsubpara{\subparagraph{}}
\renewcommand\theparagraph{\arabic{paragraph}}
\newenvironment{deps}{%
\par
\textbf{Dependencies}
\begin{itemize}}{\end{itemize}}
\renewcommand\theenumi{\alph{enumi}}
\renewcommand\labelenumi{\theenumi)}
\makeatletter
\renewcommand\@seccntformat[1]{\thispara.\@nameuse{the#1}}
\makeatother
\renewcommand\ParaFont{\normalfont\large\bfseries}
\renewcommand\SParaFont{\normalfont\bfseries}
\begin{document}
\reqpara{FAU_GEN}
Audit data generation
Hierarchical to: No other components.
\reqsubpara
The TSF shall be able to generate an audit record of the following auditable
events
\begin{enumerate}
\item Start-up and shutdown of the audit functions;
\item All auditable events for the [selection: minimum, basic, detailed, not
specified] level of audit; and
\item {}[assignment: other specifically defined auditable events].
\end{enumerate}
\reqsubpara
The TSF shall record within each audit record at least the following
information:
a) Date and time of the event, type of event, subject identity, and the
outcome (success or failure) of the event; and
b) For each audit event type, based on the auditable event definitions of
the functional components included in the PP/ST, [assignment: other
audit relevant information]
\begin{deps}
\item[FPT_SMT.1] Reliable time stamps
\end{deps}
\end{document}