我需要制作一张更简单的 Volere 需求卡。它如下:
由于我只了解 LaTeX 的基础知识,所以我不知道如何从头开始创建模板。我的想法是这样做:
\begin{requirement}
\number 75
\type 9
\description ...
\end{}
我甚至不知道这是否可能......
先感谢您!
编辑:
我目前得到的是:
\newenvironment{requirement}[5]{
\begin{table}[H]
\centering
\begin{tabular}{|l p{7cm} p{4cm}|}
\hline
\# #1 & & Type: #2 \space\space\space\space\space\space\space\space\space Event: #3 \newline \\
Description: & \multicolumn{2}{p{11cm}|}{#4 \newline} \\
Fit Criterion: & \multicolumn{2}{p{11cm}|}{#5 \newline} \\ \hline
\end{tabular}
\end{table}
}
{}
环境的呼唤:
\begin{requirement}{1}{2}{3}{Test}{Test}
\end{requirement}
输出结果如下:
答案1
enumitem
可能,以下内容基于description
,multicols
可以tcolorbox
作为起点:
\documentclass{article}
\usepackage{multicol}
\usepackage[dvipsnames]{xcolor}
\usepackage{enumitem}
\usepackage{tcolorbox}
\newenvironment{myreq}[1]{%
\setlist[description]{font=\normalfont\color{darkgray}}%
\begin{tcolorbox}[colframe=black,colback=white, sharp corners, boxrule=1pt]%
\bfseries\color{blue}%
\begin{description}#1}%
{\end{description}\end{tcolorbox}}
\newcommand{\threeinline}[3]{\begin{multicols}{3}#1 #2 #3\end{multicols}}
\newcommand{\twoinline}[2]{\begin{multicols}{2}#1 #2\end{multicols}}
\newcommand{\reqno}{\item[Requirement \#:]}
\newcommand{\reqtype}{\item[Requirement Type:]}
\newcommand{\reqevent}{\item[Event/BUC/PUC \#:]}
\newcommand{\reqdesc}{\item[Description:]}
\newcommand{\reqrat}{\item[Rationale:]}
\newcommand{\reqorig}{\item[Originator:]}
\newcommand{\reqfit}{\item[Fit Criterion:]}
\newcommand{\reqsatis}{\item[Customer Satisfaction:]}
\newcommand{\reqdissat}{\item[Customer Dissatisfaction:]}
\newcommand{\reqdep}{\item[Dependencies:]}
\newcommand{\reqconf}{\item[Conflicts:]}
\newcommand{\reqmater}{\item[Materials:]}
\newcommand{\reqhist}{\item[History:]}
\begin{document}
\begin{myreq}
\threeinline
{\reqno 75}
{\reqtype 9}
{\reqevent 7.9}
\reqdesc description text description text description text
\reqrat some more text some more text some more text
\reqorig other text other text other text
\reqfit longer text that needs more than one line longer text that needs more than one line
\twoinline
{\reqsatis 5}
{\reqdissat 3}
\twoinline
{\reqdep some more text}
{\reqconf 111}
\reqmater other text other text other text
\reqhist other text other text other text
\end{myreq}
\end{document}