aboutsummaryrefslogtreecommitdiffstats
path: root/csci5801/usecases.sty
blob: c31fd5185620d6394796cfd767c850b50f73007e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
%% Use Cases Style File
%% Created by Tom Desair (http://www.tomdesair.com)
%% Downloadable at: http://www.tomdesair.com/downloads/use-case-latex-template.zip
%% Date Modified: 03/04/2012
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.

%-------------------------------------------------------------------------------
%                Required Packages
%-------------------------------------------------------------------------------
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{longtable}

%-------------------------------------------------------------------------------
%                \addtitle command: add the title of the use case
%-------------------------------------------------------------------------------
\newcommand\addtitle[2]{\hline \\ [-1.5ex] \textbf{#1} &\textbf{#2}\\ [1ex] \hline \\ [-1.5ex]}
\newcommand\tabularhead{\begin{longtable}{lp{8.9cm}}
}

%-------------------------------------------------------------------------------
%                \addfield command: add a property of the use case
%-------------------------------------------------------------------------------
\newcommand\addfield[2]{\textit{#1} &#2\\ [1ex] \hline \\ [-1.3ex] }

%-------------------------------------------------------------------------------
%                \addscenario command: add the main (or alternative) scenario
%                of the use case
%-------------------------------------------------------------------------------
\newcommand\addscenario[2]{ 
\multicolumn{2}{l}{\textit{#1}} \\
\multicolumn{2}{l}{
\begin{minipage}[t]{13.2cm}
    \begin{enumerate} #2   \end{enumerate}
    \vspace{1.3ex}
\end{minipage}
} \\ [1ex] \hline \\ [-1.5ex] }

%-------------------------------------------------------------------------------
%                \additemizedfield command: add a field with an item list
%-------------------------------------------------------------------------------
\newcommand\additemizedfield[2]{ 
	\begin{minipage}[t][][t]{3.5cm}
		\textit{#1}
		\vspace{1.3ex}
	\end{minipage}% 
   &
    \begin{minipage}[t][][t]{8.9cm}
    	\begin{itemize} #2   \end{itemize}
    	\vspace{1.5ex}
    \end{minipage}\\ [1ex] \hline \\ [-1.5ex] }

%-------------------------------------------------------------------------------
%                Definition of the use case environment
%-------------------------------------------------------------------------------
\newenvironment{usecase}{\tabularhead}
{\end{longtable}}