summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/stex/reqdoc/reqdoc.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/stex/reqdoc/reqdoc.sty')
-rw-r--r--Master/texmf-dist/tex/latex/stex/reqdoc/reqdoc.sty65
1 files changed, 65 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/reqdoc/reqdoc.sty b/Master/texmf-dist/tex/latex/stex/reqdoc/reqdoc.sty
new file mode 100644
index 00000000000..ce58e497acd
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/stex/reqdoc/reqdoc.sty
@@ -0,0 +1,65 @@
+%%
+%% This is file `reqdoc.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% reqdoc.dtx (with options: `package')
+%%
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{reqdoc}[2010/06/25 v0.3 Semantic Requirement Documents]
+\newif\if@deps\@depsfalse
+\DeclareOption{recorddeps}{\@depstrue}
+\ProcessOptions
+\RequirePackage{sref}
+\RequirePackage{longtable}
+\newif\ifreqsnum\reqsnumfalse
+\omdaddkey{reqs}{numbering}
+\omdaddkey[R]{reqs}{prefix}
+\def\reqs@no{no}
+\newenvironment{requirements}[1][]%
+{\omdsetkeys{reqs}{#1}\ifx\reqs@numbering\reqs@no\reqsnumfalse\else\reqsnumtrue\fi}{}
+\omdaddkey{req}{id}
+\omdaddkey{req}{prio}
+\omdaddkey{req}{refs}
+\omdaddkey{req}{num}
+\newcounter{reqnum}[section]
+\def\req@do@refs#1#2{\let\@tmpop=\relax\@for\@I:=#1\do{\@tmpop\req@do@ref{\@I}\let\@tmpop=#2}}
+\def\req@do@ref#1{\sref@hlink@ifh{#1}{\req@ref{#1}{number}}}
+\def\req@def@aux#1#2#3{\expandafter\xdef\csname req@#1@#2\endcsname{#3}}
+\def\req@write@aux#1#2#3{\protected@write\@auxout{}{\string\req@def@aux{#1}{#2}{\thesection.#3}}}
+\def\req@def#1#2#3{\req@def@aux{#1}{#2}{#3}\req@write@aux{#1}{#2}{#3}}
+\def\req@ref#1#2{\csname req@#1@#2\endcsname}
+\def\print@req@prio{\ifx\req@prio\@empty\else(Priority: \req@prio)\fi}
+\def\print@req@label{\sref@target@ifh\req@id{\reqs@prefix\arabic{reqnum}: }}
+\def\print@req@refs{\ifx\req@refs\@empty\else\hfill [from~\req@do@refs{\req@refs}{,}]\fi}
+\newenvironment{requirement}[1][]%
+{\omdsetkeys{req}{#1}\stepcounter{reqnum}
+\ifreqsnum\ifx\req@id\@empty\else\req@def\req@id{number}\thereqnum\fi
+\noindent\textbf{\print@req@label}\fi
+\newcommand{\reqnote}[1]{\par\noindent Note: ##1}
+\print@req@prio}
+{\medskip\print@req@refs}
+\newenvironment{reqtable}[1][]{\omdsetkeys{reqs}{#1}
+\begin{center}\begin{longtable}{|l|l|p{6cm}|p{5cm}|l|}\hline
+\# & Prio & Requirement & Notes & Refs\\\hline\hline}
+{\end{longtable}\end{center}}
+\newcommand{\reqline}[3][]%
+{\omdsetkeys{req}{#1}\stepcounter{reqnum}
+\req@def\req@id{number}\thereqnum% remember the number for reference
+\textbf{\sref@target@ifh\req@id{\reqs@prefix\arabic{reqnum}}}&
+\req@prio &#2&#3&\req@do@refs\req@refs{,}\tabularnewline\hline}
+\newcommand{\importreqs}[1]{\req@dep@write{"#1.tex"}{IMPORTREQS}\makeatletter\input{#1.aux}\makeatother}
+\newcommand{\rinput}[1]{\req@dep@write{"#1.tex"}{[dt="input"]}\bgroup\@depsfalse\input{#1}\egroup}
+\if@deps\newwrite\req@depfile
+\immediate\openout\req@depfile=\jobname.deps
+\AtEndDocument{\closeout\req@depfile}
+\renewcommand{\importmodule}[2][]{\req@dep@write{"#1.tex"}{[dt="importmodule"]}\def\@test{#1}%
+\ifx\@test\@empty\else\requiremodules{#1}\fi
+\expandafter\gdef\csname#2@cd@file@base\endcsname{#1}
+\activate@defs{#2}\export@defs{#2}}
+\fi
+\def\req@dep@write#1#2{\if@deps\protected@write\req@depfile{}{#1 #2}\fi}
+\endinput
+%%
+%% End of file `reqdoc.sty'.