diff options
author | Karl Berry <karl@freefriends.org> | 2010-07-20 22:30:22 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-07-20 22:30:22 +0000 |
commit | cdfe96a3444a4d0664b9702c4ff6fe6622257834 (patch) | |
tree | 577232accd4bf41d7480fae7c177ceef147c8fea /Master/texmf-dist/tex/latex/stex/reqdoc | |
parent | 47e2d96a8faed88dfedd17ca5352227d585a6710 (diff) |
stex update once more
git-svn-id: svn://tug.org/texlive/trunk@19548 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/stex/reqdoc')
-rw-r--r-- | Master/texmf-dist/tex/latex/stex/reqdoc/reqdoc.sty | 65 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/stex/reqdoc/reqdoc.sty.ltxml | 23 |
2 files changed, 88 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 &\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'. diff --git a/Master/texmf-dist/tex/latex/stex/reqdoc/reqdoc.sty.ltxml b/Master/texmf-dist/tex/latex/stex/reqdoc/reqdoc.sty.ltxml new file mode 100644 index 00000000000..f7b9edf4d8a --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/reqdoc/reqdoc.sty.ltxml @@ -0,0 +1,23 @@ +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +RegisterNamespace('r'=>"http://omdoc.org/ontology/requirements#"); +RegisterDocumentNamespace('r'=>"http://omdoc.org/ontology/requirements#"); +DefEnvironment('{requirements} OptionalKeyVals:reqs', + "<omdoc:omgroup type='itemize'>#body</omdoc:omgroup>"); +DefCMPEnvironment('{requirement} OptionalKeyVals:req', + "<omdoc:omtext ?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')() r:dummy='to ensure the namespace'>" + . "<omdoc:meta property='texttype' content='r:requirement'/>" + . "?&KeyVal(#1,'refs')(<omdoc:link rel='r:dependsOn' href='#&KeyVal(#1,'refs')'/>)()" + . "#body" + ."</omdoc:omtext>"); +DefConstructor('\reqnote{}', + "<omdoc:note type='requirement'>#1</omdoc:note>"); +DefEnvironment('{reqtable} OptionalKeyVals:reqs', + "<omdoc:omgroup type='itemize'>#body</omdoc:omgroup>"); +DefCMPConstructor('\reqline OptionalKeyVals:req{}{}', + "<omdoc:omtext type='requirement'><omdoc:CMP>#2</omdoc:CMP></omdoc:omtext>" + ."<omdoc:omtext type='note'><omdoc:CMP>#3</omdoc:CMP></omdoc:omtext>"); +DefConstructor('\importreqs {}',"<omdoc:imports from='#1'/>"); +DefMacro('\rinput','\input'); +1; |