diff options
author | Karl Berry <karl@freefriends.org> | 2012-03-30 23:23:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-03-30 23:23:02 +0000 |
commit | 849996eca72af498b48b10fbea7f14c4b9d21b8f (patch) | |
tree | 2d40d42dfc9fc0b0622212cc220868f98345305f /Master/texmf-dist/tex/latex | |
parent | d82e1c23973fd0271f93686f487bd1cee8dcd947 (diff) |
restore stex (ca. 28jan12)
git-svn-id: svn://tug.org/texlive/trunk@25792 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
56 files changed, 6684 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/cmath/cmath.sty b/Master/texmf-dist/tex/latex/stex/cmath/cmath.sty new file mode 100644 index 00000000000..c94906d6fd2 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/cmath/cmath.sty @@ -0,0 +1,29 @@ +%% +%% This is file `cmath.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% cmath.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{cmath}[2012/01/28 v0.1 inline content math] +\ProcessOptions + +\newcommand{\vname}[2][]{#2% +\def\@opt{#1}% +\ifx\@opt\@empty\else\expandafter\gdef\csname MOD@name@#1\endcsname{#2}\fi} +\def\vnref#1{\csname MOD@name@#1\endcsname} +\newcommand{\primvar}[2][]{\vname[#1]{#2^\prime}} +\newcommand{\pprimvar}[2][]{\vname[#1]{#2^{\prime\prime}}} +\newcommand{\uivar}[3][]{\vname[#1]{{#2}^{#3}}} +\newcommand{\livar}[3][]{\vname[#1]{{#2}_{#3}}} +\newcommand{\ulivar}[4][]{\vname[#1]{{#2}^{#3}_{#4}}} +\newcommand\nappa[2]{#1\left(#2\right)} +\newcommand\nappe[3]{\nappa{#1}{#2,\ldots,#3}} +\newcommand\nappf[4]{\nappe{#1}{#2{#3}}{#2{#4}}} +\newcommand\nappli[4]{\nappe{#1}{#2_{#3}}{#2_{#4}}} +\newcommand\nappui[4]{\nappe{#1}{#2^{#3}}{#2^{#4}}} +\endinput +%% +%% End of file `cmath.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/cmath/cmath.sty.ltxml b/Master/texmf-dist/tex/latex/stex/cmath/cmath.sty.ltxml new file mode 100644 index 00000000000..d972c961de7 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/cmath/cmath.sty.ltxml @@ -0,0 +1,55 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; + +# return: unique ID for variable +sub cvar_id { + my ($id) = @_; + $id = ToString($id); + if (!$id) { + $id=LookupValue('cvar_id') || 0; + AssignValue('cvar_id', $id + 1, 'global'); } + "cvar.$id"; }#$ +DefConstructor('\vname[]{}', + "<ltx:XMWrap role='ID' xml:id='&cvar_id(#1)'>#2</ltx:XMWrap>", + requireMath=>1); +# \vnref{<reference>} +DefMacro('\vnref{}','\@XMRef{cvar.#1}'); + +# variants for declaring variables +DefMacro('\uivar[]{}{}', '\vname[#1]{{#2}^{#3}}'); +DefMacro('\livar[]{}{}', '\vname[#1]{{#2}_{#3}}'); +DefMacro('\ulivar[]{}{}{}', '\vname[#1]{{#2}^{#3}_{#4}}'); +DefMacro('\primvar[]{}', '\vname[#1]{#2^\prime}'); +DefMacro('\pprimvar[]{}', '\vname[#1]{#2^{\prime\prime}}'); + +# \nappa{<function>}{<(const)(,\1)*>} +# @#1(#2) +DefConstructor('\nappa{}{}', + "<ltx:XMApp>" + ."<ltx:XMTok meaning='#1' />" + ."<ltx:XMArg>#2</ltx:XMArg>" + ."</ltx:XMApp>"); + +# \@napp@seq{<function>}{start <const>}{end <const>} +# @#1(@sequence(#2,sequencefromto,#3)) +DefConstructor('\@napp@seq{}{}{}', + "<ltx:XMApp>" + ."<ltx:XMTok meaning='#1' />" + ."<ltx:XMArg>" + ."<ltx:XMApp>" + ."<ltx:XMTok meaning='sequence' />" + ."<ltx:XMArg>#2</ltx:XMArg>" + ."<ltx:XMArg><ltx:XMTok meaning='sequencefromto' /></ltx:XMArg>" + ."<ltx:XMArg>#3</ltx:XMArg>" + ."</ltx:XMApp>" + ."</ltx:XMArg>" + ."</ltx:XMApp>"); + +DefMacro('\nappe{}{}{}', '\@napp@seq{#1}{#2}{#3}'); +DefMacro('\nappf{}{}{}{}', '\@napp@seq{#1}{#2{#3}}{#2{#4}}'); +DefMacro('\nappli{}{}{}{}', '\@napp@seq{#1}{#2_{#3}}{#2_{#4}}'); +DefMacro('\nappui{}{}{}{}', '\@napp@seq{#1}{#2^{#3}}{#2^{#4}}'); + +1; diff --git a/Master/texmf-dist/tex/latex/stex/cmathml/cmathml.sty b/Master/texmf-dist/tex/latex/stex/cmathml/cmathml.sty new file mode 100644 index 00000000000..90b215dd2ab --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/cmathml/cmathml.sty @@ -0,0 +1,450 @@ +%% +%% This is file `cmathml.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% cmathml.dtx (with options: `sty') +%% +\RequirePackage{presentation} +\newcommand{\Capply}[3][]{#2(#3)} +\def\CMathML@cn#1{#1} +\newcommand{\Ccn}[2][]{\CMathML@cn{#2}} +\def\CMathML@ci#1{#1} +\newcommand{\Cci}[2][]{\CMathML@ci{#2}} +\def\CMathML@csymbol#1{#1} +\newcommand{\Ccsymbol}[2][]{\CMathML@csymbol{#2}} +\def\CMathML@ccinterval#1#2{[#1,#2]} +\newcommand{\Cccinterval}[3][]{\CMathML@ccinterval{#2}{#3}} +\def\CMathML@cointerval#1#2{[#1,#2)} +\newcommand{\Ccointerval}[3][]{\CMathML@cointerval{#2}{#3}} +\def\CMathML@ocinterval#1#2{(#1,#2]} +\newcommand{\Cocinterval}[3][]{\CMathML@ocinterval{#2}{#3}} +\def\CMathML@oointerval#1#2{(#1,#2)} +\newcommand{\Coointerval}[3][]{\CMathML@oointerval{#2}{#3}} +\newcommand{\Cinverse}[2][]{#2^{-1}} +\def\CMathML@lambda#1#2{\lambda({#1},{#2})} +\newcommand{\Clambda}[3][]{\CMathML@lambda{#2}{#3}} +\def\CMathML@lambdaDA#1#2#3{\lambda({#1}\colon{#2},#3)} +\newcommand{\ClambdaDA}[4][]{\CMathML@lambdaDA{#2}{#3}{#4}} +\def\CMathML@restrict#1#2{\left.#1\right|_{#2}} +\newcommand{\Crestrict}[3][]{\CMathML@restrict{#2}{#3}} +\def\CMathML@composeOp{\circ} +\newcommand{\CcomposeOp}{\CMathML@composeOp} +\def\CMathML@compose#1{\assoc[p=500,pi=500]{\CMathML@composeOp}{#1}} +\newcommand{\Ccompose}[2][]{\CMathML@compose{#2}} +\def\CMathML@ident#1{\mathrm{id}} +\newcommand{\Cident}[1][]{\CMathML@ident{#1}} +\def\CMathML@domain#1{\mbox{dom}(#1)} +\newcommand{\Cdomain}[2][]{\CMathML@domain{#2}} +\def\CMathML@codomain#1{\mbox{codom}(#1)} +\newcommand{\Ccodomain}[2][]{\CMathML@codomain{#2}} +\def\CMathML@image#1{{\mathbf{Im}}(#1)} +\newcommand{\Cimage}[2][]{\CMathML@image{#2}} +\def\CMathML@piecewise#1{\left\{\begin{array}{ll}#1\end{array}\right.} +\newcommand{\Cpiecewise}[2][]{\CMathML@piecewise{#2}} +\def\CMathML@piece#1#2{#1&{\mathrm{if}}\;{#2}\\} +\newcommand{\Cpiece}[3][]{\CMathML@piece{#2}{#3}} +\def\CMathML@otherwise#1{#1&else\\} +\newcommand{\Cotherwise}[2][]{\CMathML@otherwise{#2}} +\def\CMathML@quotient#1#2{\frac{#1}{#2}} +\newcommand{\Cquotient}[3][]{\CMathML@quotient{#2}{#3}} +\def\CMathML@factorialOp{!} +\newcommand{\CfactorialOp}{\CMathML@factorialOp} +\def\CMathML@factorial#1{#1{\CMathML@factorialOp}} +\newcommand{\Cfactorial}[2][]{\CMathML@factorial{#2}} +\def\CMathML@divideOp{\div} +\newcommand{\CdivideOp}{\CMathML@divideOp} +\def\CMathML@divide#1#2{\infix[p=400]{\CMathML@divideOp}{#1}{#2}} +\newcommand{\Cdivide}[3][]{\CMathML@divide{#2}{#3}} +\def\CMathML@maxOp{\mathrm{max}} +\newcommand{\CmaxOp}{\CMathML@maxOp} +\def\CMathML@max#1{{\CMathML@maxOp}(#1)} +\newcommand{\Cmax}[2][]{\CMathML@max{#2}} +\def\CMathML@minOp{\mathrm{min}} +\newcommand{\CminOp}{\CMathML@minOp} +\def\CMathML@min#1{{\CMathML@minOp}(#1)} +\newcommand{\Cmin}[2][]{\CMathML@min{#2}} +\def\CMathML@minusOp{-} +\newcommand{\CminusOp}{\CMathML@minusOp} +\def\CMathML@minus#1#2{\infix[p=500]{\CMathML@minusOp}{#1}{#2}} +\newcommand{\Cminus}[3][]{\CMathML@minus{#2}{#3}} +\def\CMathML@uminus#1{\prefix[p=200]{\CMathML@minusOp}{#1}} +\newcommand{\Cuminus}[2][]{\CMathML@uminus{#2}} +\def\CMathML@plusOp{+} +\newcommand{\CplusOp}{\CMathML@plusOp} +\def\CMathML@plus#1{\assoc[p=500]{\CMathML@plusOp}{#1}} +\newcommand{\Cplus}[2][]{\CMathML@plus{#2}} +\def\CMathML@power#1#2{\infix[p=200]{^}{#1}{#2}} +\newcommand{\Cpower}[3][]{\CMathML@power{#2}{#3}} +\def\CMathML@remOp{\bmod} +\newcommand{\CremOp}{\CMathML@remOp} +\def\CMathML@rem#1#2{#1 \CMathML@remOp #2} +\newcommand{\Crem}[3][]{\CMathML@rem{#2}{#3}} +\def\CMathML@timesOp{\cdot} +\newcommand{\CtimesOp}{\CMathML@timesOp} +\def\CMathML@times#1{\assoc[p=400]{\CMathML@timesOp}{#1}} +\newcommand{\Ctimes}[2][]{\CMathML@times{#2}} +\def\CMathML@rootOp{\sqrt} +\newcommand{\CrootOp}{\CMathML@rootOp{}} +\def\CMathML@root#1#2{\CMathML@rootOp[#1]{#2}} +\newcommand{\Croot}[3][]{\CMathML@root{#2}{#3}} +\def\CMathML@gcd#1{\gcd(#1)} +\newcommand{\Cgcd}[2][]{\CMathML@gcd{#2}} +\def\CMathML@andOp{\wedge} +\newcommand{\CandOp}{\CMathML@andOp} +\def\CMathML@and#1{\assoc[p=400]{\CMathML@andOp}{#1}} +\newcommand{\Cand}[2][]{\CMathML@and{#2}} +\def\CMathML@orOp{\vee} +\newcommand{\CorOp}{\CMathML@orOp} +\def\CMathML@or#1{\assoc[p=500]{\CMathML@orOp}{#1}} +\newcommand{\Cor}[2][]{\CMathML@or{#2}} +\def\CMathML@xorOp{\oplus} +\newcommand{\CxorOp}{\CMathML@xorOp} +\def\CMathML@xor#1{\assoc[p=400]{\CMathML@xorOp}{#1}} +\newcommand{\Cxor}[2][]{\CMathML@xor{#2}} +\def\CMathML@notOp{\neg} +\newcommand{\CnotOp}{\CMathML@notOp} +\def\CMathML@not#1{\CMathML@notOp{#1}} +\newcommand{\Cnot}[2][]{\CMathML@not{#2}} +\def\CMathML@impliesOp{\Longrightarrow} +\newcommand{\CimpliesOp}{\CMathML@impliesOp} +\def\CMathML@implies#1#2{#1\CMathML@impliesOp{#2}} +\newcommand{\Cimplies}[3][]{\CMathML@implies{#2}{#3}} +\def\CMathML@AndDA#1#2{\bigwedge_{#1}{#2}} % set, scope +\newcommand{\CAndDA}[3][]{\CMathML@AndDA{#2}{#3}} +\def\CMathML@AndCond#1#2#3{\bigwedge_{#2}{#3}} % bvars,condition, scope +\newcommand{\CAndCond}[4][]{\CMathML@AndCond{#2}{#2}{#3}} +\def\CMathML@OrDA#1#2{\bigvee_{#1}{#2}} % set, scope +\newcommand{\COrDa}[3][]{\CMathML@OrDA{#2}{#3}} +\def\CMathML@OrCond#1#2#3{\bigvee_{#2}{#3}}% bvars,condition, scope +\newcommand{\COrCond}[4][]{\CMathML@OrCond{#2}{#3}{#4}} +\def\CMathML@XorDA#1#2{\bigoplus_{#1}{#2}} % set, scope +\newcommand{\CXorDA}[3][]{\CMathML@XorDA{#2}{#3}} +\def\CMathML@XorCond#1#2#3{\bigoplus_{#2}{#3}}% bvars,condition, scope +\newcommand{\CXorCond}[4][]{\CMathML@XorCond{#2}{#3}{#4}} +\def\CMathML@forall#1#2{\forall{#1}\colon{#2}} +\newcommand{\Cforall}[3][]{\CMathML@forall{#2}{#3}} +\def\CMathML@forallCond#1#2#3{\forall{#1},{#2}\colon{#3}} % list), condition, scope +\newcommand{\CforallCond}[4][]{\CMathML@forallCond{#2}{#3}{#4}} +\def\CMathML@exists#1#2{\exists{#1}\colon{#2}} +\newcommand{\Cexists}[3][]{\CMathML@exists{#2}{#3}} +\def\CMathML@esistsCont#1#2#3{\exists{#1},{#2}\colon{#3}} +\newcommand{\CexistsCond}[4][]{\CMathML@esistsCont{#2}{#3}{#4}} +\def\CMathML@abs#1{\left|#1\right|} +\newcommand{\Cabs}[2][]{\CMathML@abs{#2}} +\def\CMathML@conjugate#1{\overline{#1}} +\newcommand{\Cconjugate}[2][]{\CMathML@conjugate{#2}} +\def\CMathML@arg#1{\angle #1} +\newcommand{\Carg}[2][]{\CMathML@arg{#2}} +\def\CMathML@real#1{\Re #1} +\newcommand{\Creal}[2][]{\CMathML@real{#2}} +\def\CMathML@imaginary#1{\Im #1} +\newcommand{\Cimaginary}[2][]{\CMathML@imaginary{#2}} +\def\CMathML@lcm#1{\mbox{lcm}(#1)} +\newcommand{\Clcm}[2][]{\CMathML@lcm{#2}} +\def\CMathML@floor#1{\left\lfloor{#1}\right\rfloor} +\newcommand{\Cfloor}[2][]{\CMathML@floor{#2}} +\def\CMathML@ceiling#1{\left\lceil{#1}\right\rceil} +\newcommand{\Cceiling}[2][]{\CMathML@ceiling{#2}} +\def\CMathML@eqOp{=} +\newcommand{\CeqOp}{\CMathML@eqOp} +\def\CMathML@eq#1{\assoc[p=700]{\CMathML@eqOp}{#1}} +\newcommand{\Ceq}[2][]{\CMathML@eq{#2}} +\def\CMathML@neqOp{\neq} +\newcommand{\CneqOp}{\CMathML@neqOp} +\def\CMathML@neq#1#2{\infix[p=700]{\CMathML@neqOp}{#1}{#2}} +\newcommand{\Cneq}[3][]{\CMathML@neq{#2}{#3}} +\def\CMathML@gtOp{>} +\newcommand{\CgtOp}{\CMathML@gtOp} +\def\CMathML@gt#1{\assoc[p=700]{\CMathML@gtOp}{#1}} +\newcommand{\Cgt}[2][]{\CMathML@gt{#2}} +\def\CMathML@ltOp{<} +\newcommand{\CltOp}{\CMathML@ltOp} +\def\CMathML@lt#1{\assoc[p=700]{\CMathML@ltOp}{#1}} +\newcommand{\Clt}[2][]{\CMathML@lt{#2}} +\def\CMathML@geqOp{\geq} +\newcommand{\CgeqOp}{\CMathML@geqOp} +\def\CMathML@geq#1{\assoc[p=700]{\CMathML@geqOp}{#1}} +\newcommand{\Cgeq}[2][]{\CMathML@geq{#2}} +\def\CMathML@leqOp{\leq} +\newcommand{\CleqOp}{\CMathML@leqOp} +\def\CMathML@leq#1{\assoc[p=700]{\CMathML@leqOp}{#1}} +\newcommand{\Cleq}[2][]{\CMathML@leq{#2}} +\def\CMathML@equivalentOp{\equiv} +\newcommand{\CequivalentOp}{\CMathML@equivalentOp} +\def\CMathML@equivalent#1{\assoc[p=700]{\CMathML@equivalentOp}{#1}} +\newcommand{\Cequivalent}[2][]{\CMathML@equivalent{#2}} +\def\CMathML@approxOp{\approx} +\newcommand{\CapproxOp}{\CMathML@approxOp} +\def\CMathML@approx#1#2{#1\CMathML@approxOp{#2}} +\newcommand{\Capprox}[3][]{\CMathML@approx{#2}{#3}} +\def\CMathML@factorofOp{\mid} +\newcommand{\CfactorofOp}{\CMathML@factorofOp} +\def\CMathML@factorof#1#2{#1\CMathML@factorofOp{#2}} +\newcommand{\Cfactorof}[3][]{\CMathML@factorof{#2}{#3}} + +\def\CMathML@intOp{\int} +\newcommand{\CintOp}{\CMathML@intOp} +\def\CMathML@int#1{\CMathML@intOp{#1}} +\newcommand{\Cint}[2][]{\CMathML@int{#2}} +\def\CMathML@intLimits#1#2#3#4{\CMathML@intOp_{#2}^{#3}{#4}d{#1}} %bvars,llimit, ulimit,body +\newcommand{\CintLimits}[5][]{\CMathML@intLimits{#2}{#3}{#4}{#5}} +\def\CMathML@intSet#1#2{\CMathML@intOp_{#1}{#2}}% set,function +\newcommand{\CintDA}[3][]{\CMathML@intSet{#2}{#3}} +\def\CMathML@intCond#1#2#3{\CMathML@intOp_{#2}{#3}d{#1}} %bvars, condition, body +\newcommand{\CintCond}[4][]{\CMathML@intCond{#2}{#3}{#4}} + +\def\CMathML@diff#1{#1'} +\newcommand{\Cdiff}[2][]{\CMathML@diff{#2}} +\def\CMathML@ddiff#1#2{{d{#2}(#1)\over{d{#1}}}} +\newcommand{\Cddiff}[3][]{\CMathML@ddiff{#2}{#3}} +\def\CMathML@partialdiff#1#2#3{{\partial^{#1}\over\partial{#2}}{#3}}% degree, bvars, body +\newcommand{\Cpartialdiff}[4][]{\CMathML@partialdiff{#2}{#3}{#4}} +\newcommand{\Cdegree}[2]{#1^{#2}} +\def\CMathML@limit#1#2#3{\lim_{#1\rightarrow{#2}}{#3}} +\newcommand{\Climit}[4][]{\CMathML@limit{#2}{#3}{#4}} % bvar, lowlimit, scope +\def\CMathML@limitCond#1#2#3{\lim_{#2}{#3}} +\newcommand{\ClimitCond}[4][]{\CMathML@limitCond{#2}{#3}{#4}} % bvars, condition, scope +\def\CMathML@tendstoOp{\rightarrow} +\newcommand{\CtendstoOp}{\CMathML@tendstoOp} +\def\CMathML@tendsto#1#2{#1\CMathML@tendstoOp{#2}} +\newcommand{\Ctendsto}[3][]{\CMathML@tendsto{#2}{#3}} +\def\CMathML@tendstoAboveOp{\searrow} +\newcommand{\CtendstoAboveOp}{\CMathML@tendstoAboveOp} +\def\CMathML@tendstoAbove#1#2{#1\searrow{#2}} +\newcommand{\CtendstoAbove}[3][]{\CMathML@tendstoAbove{#2}{#3}} +\def\CMathML@tendstoBelowOp{\nearrow} +\newcommand{\CtendstoBelowOp}{\CMathML@tendstoBelowOp} +\def\CMathML@tendstoBelow#1#2{#1\CMathML@tendstoBelowOp{#2}} +\newcommand{\CtendstoBelow}[3][]{\CMathML@tendstoBelow{#2}{#3}} +\def\CMathML@divergence#1{\nabla\cdot{#1}} +\newcommand{\Cdivergence}[2][]{\CMathML@divergence{#2}} +\def\CMathML@grad#1{\nabla{#1}} +\newcommand{\Cgrad}[2][]{\CMathML@grad{#2}} +\def\CMathML@curl#1{\nabla\times{#1}} +\newcommand{\Ccurl}[2][]{\CMathML@curl{#2}} +\def\CMathML@laplacian#1{\nabla^2#1} +\newcommand{\Claplacian}[2][]{\CMathML@laplacian{#2}} +\def\CMathML@set#1{\left\{#1\right\}} +\newcommand{\Cset}[2][]{\CMathML@set{#2}} +\def\CMathML@setRes#1#2{\{#1|#2\}} +\newcommand{\CsetRes}[3][]{\CMathML@setRes{#2}{#3}} +\def\CMathML@setCond#1#2#3{\{#2|#3\}} +\newcommand{\CsetCond}[4][]{\CMathML@setCond{#2}{#3}{#4}} +\def\CMathML@setDA#1#2#3{\{#1\in{#2}|#3\}} +\newcommand{\CsetDA}[4][]{\CMathML@setDA{#2}{#3}{#4}} +\def\CMathML@listOp{\mbox{list}} +\newcommand{\ClistOp}{\CMathML@listOp} +\def\CMathML@list#1{\CMathML@listOp({#1})} +\newcommand{\Clist}[2][]{\CMathML@list{#2}} +\def\CMathML@unionOp{\cup} +\newcommand{\CunionOp}{\CMathML@unionOp} +\def\CMathML@union#1{\assoc[p=500]{\CMathML@unionOp}{#1}} +\newcommand{\Cunion}[2][]{\CMathML@union{#2}} +\def\CMathML@intersectOp{\cap} +\newcommand{\CintersectOp}{\CMathML@intersectOp} +\def\CMathML@intersect#1{\assoc[p=400]{\CMathML@intersectOp}{#1}} +\newcommand{\Cintersect}[2][]{\CMathML@intersect{#2}} +\def\CMathML@inOp{\in} +\newcommand{\CinOp}{\CMathML@inOp} +\def\CMathML@in#1#2{#1\CMathML@inOp{#2}} +\newcommand{\Cin}[3][]{\CMathML@in{#2}{#3}} +\def\CMathML@notinOp{\notin} +\newcommand{\CnotinOp}{\CMathML@notinOp} +\def\CMathML@notin#1#2{#1\CMathML@notinOp{#2}} +\newcommand{\Cnotin}[3][]{\CMathML@notin{#2}{#3}} +\def\CMathML@setdiffOp{\setminus} +\newcommand{\CsetdiffOp}{\CMathML@setdiffOp} +\def\CMathML@setdiff#1#2{#1\CMathML@setdiffOp{#2}} +\newcommand{\Csetdiff}[3][]{\CMathML@setdiff{#2}{#3}} +\def\CMathML@cardOp{\#} +\newcommand{\CcardOp}{\CMathML@cardOp} +\def\CMathML@card#1{\CMathML@cardOp #1} +\newcommand{\Ccard}[2][]{\CMathML@card{#2}} +\def\CMathML@cartesianproductOp{\times} +\newcommand{\CcartesianproductOp}{\CMathML@cartesianproductOp} +\def\CMathML@cartesianproduct#1{\assoc[p=400]{\CMathML@cartesianproductOp}{#1}} +\newcommand{\Ccartesianproduct}[2][]{\CMathML@cartesianproduct{#2}} +\def\CMathML@subsetOp{\subseteq} +\newcommand{\CsubsetOp}{\CMathML@subsetOp} +\def\CMathML@subset#1{\assoc[p=700]{\CMathML@subsetOp}{#1}} +\newcommand{\Csubset}[2][]{\CMathML@subset{#2}} +\def\CMathML@prsubsetOp{\subset} +\newcommand{\CprsubsetOp}{\CMathML@prsubsetOp} +\def\CMathML@prsubset#1{\assoc[p=700]{\CMathML@prsubsetOp}{#1}} +\newcommand{\Cprsubset}[2][]{\CMathML@prsubset{#2}} +\def\CMathML@notsubsetOp{\not\subseteq} +\newcommand{\CnotsubsetOp}{\CMathML@notsubsetOp} +\def\CMathML@notsubset#1#2{#1\CMathML@notsubsetOp{#2}} +\newcommand{\Cnotsubset}[3][]{\CMathML@notsubset{#2}{#3}} +\def\CMathML@notprsubsetOp{\not\subset} +\newcommand{\CnotprsubsetOp}{\CMathML@notprsubsetOp} +\def\CMathML@notprsubset#1#2{#1\CMathML@notprsubsetOp{#2}} +\newcommand{\Cnotprsubset}[3][]{\CMathML@notprsubset{#2}{#3}} +\def\CMathML@supsetOp{\supseteq} +\newcommand{\CsupsetOp}{\CMathML@supsetOp} +\def\CMathML@supset#1{\assoc[p=700]{\CMathML@supsetOp}{#1}} +\newcommand{\Csupset}[2][]{\CMathML@supset{#2}} +\def\CMathML@prsupsetOp{\supset} +\newcommand{\CprsupsetOp}{\CMathML@prsupsetOp} +\def\CMathML@prsupset#1{\assoc[p=700]{\CMathML@prsupsetOp}{#1}} +\newcommand{\Cprsupset}[2][]{\CMathML@prsupset{#2}} +\def\CMathML@notsupsetOp{\not\supseteq} +\newcommand{\CnotsupsetOp}{\CMathML@notsupsetOp} +\def\CMathML@notsupset#1#2{#1\CMathML@notsupsetOp{#2}} +\newcommand{\Cnotsupset}[3][]{\CMathML@notsupset{#2}{#3}} +\def\CMathML@notprsupsetOp{\not\supset} +\newcommand{\CnotprsupsetOp}{\CMathML@notprsupsetOp} +\def\CMathML@notprsupset#1#2{#1\CMathML@notprsupsetOp{#2}} +\newcommand{\Cnotprsupset}[3][]{\CMathML@notprsupset{#2}{#3}} +\def\CMathML@UnionDAOp{\bigwedge} +\newcommand{\CUnionDAOp}{\CMathML@UnionDAOp} +\def\CMathML@UnionDA#1#2{\CMathML@UnionDAOp_{#1}{#2}} % set, scope +\newcommand{\CUnionDA}[3][]{\CMathML@UnionDA{#2}{#3}} +\def\CMathML@UnionCond#1#2#3{\CMathML@UnionDAOp_{#2}{#3}} % bvars,condition, scope +\newcommand{\CUnionCond}[4][]{\CMathML@UnionCond{#2}{#2}{#3}} +\def\CMathML@IntersectDAOp{\bigvee} +\newcommand{\CIntersectDAOp}{\CMathML@IntersectDAOp} +\def\CMathML@IntersectDA#1#2{\CMathML@IntersectDAOp_{#1}{#2}} % set, scope +\newcommand{\CIntersectDa}[3][]{\CMathML@IntersectDA{#2}{#3}} +\def\CMathML@IntersectCond#1#2#3{\CMathML@IntersectDAOp_{#2}{#3}}% bvars,condition, scope +\newcommand{\CIntersectCond}[4][]{\CMathML@IntersectCond{#2}{#3}{#4}} +\def\CMathML@CartesianproductDAOp{\bigoplus} +\newcommand{\CCartesianproductDAOp}{\CMathML@CartesianproductDAOp} +\def\CMathML@CartesianproductDA#1#2{\CMathML@CartesianproductDAOp_{#1}{#2}} % set, scope +\newcommand{\CCartesianproductDA}[3][]{\CMathML@CartesianproductDA{#2}{#3}} +\def\CMathML@CartesianproductCond#1#2#3{\CMathML@CartesianproductDAOp_{#2}{#3}}% bvars,condition, scope +\newcommand{\CCartesianproductCond}[4][]{\CMathML@CartesianproductCond{#2}{#3}{#4}} +\def\CMathML@sumOp{\sum} +\newcommand{\CsumOp}{\CMathML@sumOp} +\def\CMathML@sumLimits#1#2#3#4{\CMathML@sumOp_{#1=#2}^{#3}#4}% bvar, llimit, ulimit, body +\newcommand{\CsumLimits}[5][]{\CMathML@sumLimits{#2}{#3}{#4}{#5}} +\def\CMathML@sumCond#1#2#3{\CMathML@sumOp_{#1\in{#2}}#3} % bvar, condition, body +\newcommand{\CsumCond}[4][]{\CMathML@sumCond{#2}{#3}{#4}} +\def\CMathML@sumDA#1#2{\CMathML@sumOp_{#1}#2} % set, body +\newcommand{\CsumDA}[3][]{\CMathML@sumDA{#2}{#3}} +\def\CMathML@prodOp{\prod} +\newcommand{\CprodOp}{\CMathML@prodOp} +\def\CMathML@prodLimits#1#2#3#4{\CMathML@prodOp_{#1=#32^{#3}#4}}% bvar, llimit, ulimit, body +\newcommand{\CprodLimits}[5][]{\CMathML@prodLimits{#2}{#3}{#4}{#5}} +\def\CMathML@prodCond#1#2#3{\CMathML@prodOp_{#1\in{#2}}#3} % bvar, condition, body +\newcommand{\CprodCond}[4][]{\CMathML@prodCond{#2}{#3}{#4}} +\def\CMathML@prodDA#1#2{\CMathML@prodOp_{#1}#2} % set, body +\newcommand{\CprodDA}[3]{\CMathML@prodDA{#2}{#3}} +\def\CMathML@sin#1{\sin(#1)} +\newcommand{\Csin}[2][]{\CMathML@sin{#2}} +\def\CMathML@cos#1{\cos(#1)} +\newcommand{\Ccos}[2][]{\CMathML@cos{#2}} +\def\CMathML@tan#1{\tan(#1)} +\newcommand{\Ctan}[2][]{\CMathML@tan{#2}} +\def\CMathML@sec#1{\sec(#1)} +\newcommand{\Csec}[2][]{\CMathML@sec{#2}} +\def\CMathML@csc#1{\csc(#1)} +\newcommand{\Ccsc}[2][]{\CMathML@csc{#2}} +\def\CMathML@cot#1{\cot(#1)} +\newcommand{\Ccot}[2][]{\CMathML@cot{#2}} +\def\CMathML@sinh#1{\sinh(#1)} +\newcommand{\Csinh}[2][]{\CMathML@sinh{#2}} +\def\CMathML@cosh#1{\cosh(#1)} +\newcommand{\Ccosh}[2][]{\CMathML@cosh{#2}} +\def\CMathML@tanh#1{\tanh(#1)} +\newcommand{\Ctanh}[2][]{\CMathML@tanh{#2}} +\def\CMathML@sech#1{\mbox{sech}(#1)} +\newcommand{\Csech}[2][]{\CMathML@sech{#2}} +\def\CMathML@csch#1{\mbox{csch}(#1)} +\newcommand{\Ccsch}[2][]{\CMathML@csch{#2}} +\def\CMathML@coth#1{\mbox{coth}(#1)} +\newcommand{\Ccoth}[2][]{\CMathML@coth{#2}} +\def\CMathML@arcsin#1{\arcsin(#1)} +\newcommand{\Carcsin}[2][]{\CMathML@arcsin{#2}} +\def\CMathML@arccos#1{\arccos(#1)} +\newcommand{\Carccos}[2][]{\CMathML@arccos{#2}} +\def\CMathML@arctan#1{\arctan(#1)} +\newcommand{\Carctan}[2][]{\CMathML@arctan{#2}} +\def\CMathML@arccosh#1{\mbox{arccosh}(#1)} +\newcommand{\Carccosh}[2][]{\CMathML@arccosh{#2}} +\def\CMathML@arccot#1{\mbox{arccot}(#1)} +\newcommand{\Carccot}[2][]{\CMathML@arccot{#2}} +\def\CMathML@arccoth#1{\mbox{arccoth}(#1)} +\newcommand{\Carccoth}[2][]{\CMathML@arccoth{#2}} +\def\CMathML@arccsc#1{\mbox{arccsc}(#1)} +\newcommand{\Carccsc}[2][]{\CMathML@arccsc{#2}} +\def\CMathML@arcsinh#1{\mbox{arcsinh}(#1)} +\newcommand{\Carcsinh}[2][]{\CMathML@arcsinh{#2}} +\def\CMathML@arctanh#1{\mbox{arctanh}(#1)} +\newcommand{\Carctanh}[2][]{\CMathML@arctanh{#2}} + +\def\CMathML@exp#1{\exp(#1)} +\newcommand{\Cexp}[2][]{\CMathML@exp{#2}} +\def\CMathML@ln#1{\ln(#1)} +\newcommand{\Cln}[2][]{\CMathML@ln{#2}} +\def\CMathML@log#1#2{\log_{#1}(#2)} +\newcommand{\Clog}[3][]{\CMathML@log{#2}{#3}} +\def\CMathML@mean#1{\mbox{mean}(#1)} +\newcommand{\Cmean}[2][]{\CMathML@mean{#2}} +\def\CMathML@sdev#1{\mbox{std}(#1)} +\newcommand{\Csdev}[2][]{\CMathML@sdev{#2}} +\def\CMathML@var#1{\mbox{var}(#1)} +\newcommand{\Cvar}[2][]{\CMathML@var{#2}} +\def\CMathML@median#1{\mbox{median}(#1)} +\newcommand{\Cmedian}[2][]{\CMathML@median{#2}} +\def\CMathML@mode#1{\mbox{mode}(#1)} +\newcommand{\Cmode}[2][]{\CMathML@mode{#2}} +\def\CMathML@moment#1#2{\langle{#2}^{#1}\rangle}% degree, momentabout, scope +\newcommand{\Cmoment}[3][]{\CMathML@moment{#2}{#3}} +\def\CMathML@momentA#1#2{\langle{#2}^{#1}\rangle}% degree, momentabout, scope +\newcommand{\CmomentA}[4][]{\CMathML@momentA{#2}{#3}{#4}} +\def\CMathML@vector#1{(#1)} +\newcommand{\Cvector}[2][]{\CMathML@vector{#2}} +\def\CMathML@matrix#1#2{\left(\begin{array}{#1}#2\end{array}\right)}% row pattern, body +\newcommand{\Cmatrix}[3][]{\CMathML@matrix{#2}{#3}} +\def\CMathML@determinant#1{\left|#1\right|} +\newcommand{\Cdeterminant}[2][]{\CMathML@determinant{#2}} +\def\CMathML@transpose#1{#1^\top} +\newcommand{\Ctranspose}[2][]{\CMathML@transpose{#2}} +\def\CMathML@selector#1#2{#1_{#2}} +\newcommand{\Cselector}[3][]{\CMathML@selector{#2}{#3}} +\def\CMathML@vectproductOp{\cdot} +\newcommand{\CvectproductOp}{\CMathML@vectproductOp} +\def\CMathML@vectproduct#1#2{#1\CMathML@vectproductOp{#2}} +\newcommand{\Cvectproduct}[3][]{\CMathML@vectproduct{#2}{#3}} +\def\CMathML@scalarproduct#1#2{{#1}#2} +\newcommand{\Cscalarproduct}[3][]{\CMathML@scalarproduct{#2}{#3}} +\def\CMathML@outerproductOp{\times} +\newcommand{\CouterproductOp}{\CMathML@outerproductOp} +\def\CMathML@outerproduct#1#2{#1\CMathML@outerproductOp{#2}} +\newcommand{\Couterproduct}[3][]{\CMathML@outerproduct{#2}{#3}} +\def\CMathML@integers{{\mathbb{Z}}} +\newcommand{\Cintegers}[1][]{\CMathML@integers} +\def\CMathML@reals{{\mathbb{R}}} +\newcommand{\Creals}[1][]{\CMathML@reals} +\def\CMathML@rationals{{\mathbb{Q}}} +\newcommand{\Crationals}[1][]{\CMathML@rationals} +\def\CMathML@naturalnumbers{{\mathbb{N}}} +\newcommand{\Cnaturalnumbers}[1][]{\CMathML@naturalnumbers} +\def\CMathML@complexes{{\mathbb{C}}} +\newcommand{\Ccomplexes}[1][]{\CMathML@complexes} +\def\CMathML@primes{{\mathbb{P}}} +\newcommand{\Cprimes}[1][]{\CMathML@primes} +\def\CMathML@exponemtiale{e} +\newcommand{\Cexponemtiale}[1][]{\CMathML@exponemtiale} +\def\CMathML@imaginaryi{i} +\newcommand{\Cimaginaryi}[1][]{\CMathML@imaginaryi} +\def\CMathML@notanumber{{\mathrm{NaN}}} +\newcommand{\Cnotanumber}[1][]{\CMathML@notanumber} +\def\CMathML@true{{\mathrm{true}}} +\newcommand{\Ctrue}[1][]{\CMathML@true} +\def\CMathML@false{{\mathrm{false}}} +\newcommand{\Cfalse}[1][]{\CMathML@false} +\def\CMathML@emptyset{\emptyset} +\newcommand{\Cemptyset}[1][]{\CMathML@emptyset} +\def\CMathML@pi{\pi} +\newcommand{\Cpi}[1][]{\CMathML@pi} +\def\CMathML@eulergamma{\gamma} +\newcommand{\Ceulergamma}[1][]{\CMathML@eulergamma} +\def\CMathML@infinit{\infty} +\newcommand{\Cinfinit}[1][]{\CMathML@infinit} +\endinput +%% +%% End of file `cmathml.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/cmathml/cmathml.sty.ltxml b/Master/texmf-dist/tex/latex/stex/cmathml/cmathml.sty.ltxml new file mode 100644 index 00000000000..fdc0b2eae33 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/cmathml/cmathml.sty.ltxml @@ -0,0 +1,974 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +use LaTeXML::Document; +RequirePackage('LaTeX'); +sub remove_tokens_from_list { + my ($list, $pattern, $math) = @_; + if (ref $list) { + my @toks = $list->unlist; + @toks = grep($_->toString !~ /$pattern/, @toks); + ($math ? (LaTeXML::MathList->new(@toks)) : (LaTeXML::List)->new(@toks)); } + else { undef; } } + +sub remove_math_commas { + my ($whatsit, $argno) = @_; + my @args = $whatsit ? $whatsit->getArgs() : undef; + $argno--; + if ($args[$argno]) { + $args[$argno] = remove_tokens_from_list($args[$argno], ',', 1); + $whatsit->setArgs(@args); + } + return; +} +DefConstructor('\Capply [] {} {}', + "<ltx:XMApp ?#1(definitionURL='#1')()>#2 #3</ltx:XMApp>"); +DefConstructor('\Ccn [] {}',"#2"); +DefConstructor('\Cci [] {}',"#2"); +DefConstructor('\Ccsymbol [] {}', + "<ltx:XMTok role='CSYMBOL' meaning='#2' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cccinterval [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='CONSTRUCTOR' meaning='ccinterval' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg></ltx:XMApp>"); +DefConstructor('\Ccointerval [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='CONSTRUCTOR' meaning='cointerval' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg></ltx:XMApp>"); +DefConstructor('\Cocinterval [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='CONSTRUCTOR' meaning='ocinterval' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg></ltx:XMApp>"); +DefConstructor('\Coointerval [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='CONSTRUCTOR' meaning='oointerval' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg></ltx:XMApp>"); +DefConstructor('\Cinverse [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='inverse' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Clambda [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BINDER' meaning='lambda' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\ClambdaDA [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BINDER' meaning='lambda' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Crestrict [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='restrict' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CcomposeOp []', + "<ltx:XMTok meaning='compose' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Ccompose [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='MULOP' meaning='compose' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\Cident []', + "<ltx:XMTok meaning='ident' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cdomain [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='domain' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Ccodomain [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='codomain' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cimage [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='image' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cpiecewise [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='piecewise' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cpiece [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='piece' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cotherwise [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='otherwise' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cquotient [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='quotient' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CfactorialOp []', + "<ltx:XMTok meaning='factorial' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cfactorial [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='factorial' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CdivideOp []', + "<ltx:XMTok meaning='divide' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cdivide [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='divide' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CmaxOp []', + "<ltx:XMTok meaning='max' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cmax [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='max' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CminOp []', + "<ltx:XMTok meaning='min' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cmin [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='min' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CminusOp []', + "<ltx:XMTok meaning='minus' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cminus [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='ADDOP' meaning='minus' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cuminus [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='uminus' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CplusOp []', + "<ltx:XMTok meaning='plus' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cplus [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='ADDOP' meaning='plus' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\Cpower [] {} {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='power' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CremOp []', + "<ltx:XMTok meaning='rem' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Crem [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='rem' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CtimesOp []', + "<ltx:XMTok meaning='times' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Ctimes [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='MULOP' meaning='times' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CrootOp []', + "<ltx:XMTok meaning='root' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Croot [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='root' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cgcd [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='gcd' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CandOp []', + "<ltx:XMTok meaning='and' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cand [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='CONNECTIVE' meaning='and' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CorOp []', + "<ltx:XMTok meaning='or' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cor [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='CONNECTIVE' meaning='or' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CxorOp []', + "<ltx:XMTok meaning='xor' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cxor [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='CONNECTIVE' meaning='xor' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CnotOp []', + "<ltx:XMTok meaning='not' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cnot [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='CONNECTIVE' meaning='not' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CimpliesOp []', + "<ltx:XMTok meaning='implies' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cimplies [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='CONNECTIVE' meaning='implies' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CAndDa [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BIGOP' meaning='and' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CAndCond [] {}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BIGOP' meaning='and' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\COrDa [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BIGOP' meaning='or' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\COrCond [] {}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BIGOP' meaning='or' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CXorDa [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BIGOP' meaning='xor' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CXorCond [] {}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BIGOP' meaning='xor' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cforall [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BINDER' meaning='forall' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CforallCond [] {}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BINDER' meaning='forall' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cexists [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BINDER' meaning='exists' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CexistsCond [] {}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BINDER' meaning='exists' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cabs [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='abs' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cconjugate [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='conjugate' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Carg [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='arg' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Creal [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='real' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cimaginary [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='imaginary' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Clcm [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='lcm' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cfloor [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='floor' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cceiling [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='ceiling' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CeqOp []', + "<ltx:XMTok meaning='eq' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Ceq [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='eq' role='RELOP' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CneqOp []', + "<ltx:XMTok meaning='neq' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cneq [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='neq' role='RELOP' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CgtOp []', + "<ltx:XMTok meaning='gt' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cgt [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='gt' role='RELOP' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CltOp []', + "<ltx:XMTok meaning='lt' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Clt [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='lt' role='RELOP' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CgeqOp []', + "<ltx:XMTok meaning='geq' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cgeq [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='geq' role='RELOP' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CleqOp []', + "<ltx:XMTok meaning='leq' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cleq [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='leq' role='RELOP' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CequivalentOp []', + "<ltx:XMTok meaning='equivalent' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cequivalent [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='equivalent' role='RELOP' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>"); +DefConstructor('\CapproxOp []', + "<ltx:XMTok meaning='approx' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Capprox [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='approx' role='RELOP' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CfactorofOp []', + "<ltx:XMTok meaning='factorof' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cfactorof [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='factorof' role='RELOP' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CintOp []', + "<ltx:XMTok meaning='int' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cint [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='int' role='INTOP' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CintLimits [] {}{}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='int' role='INTOP' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "<ltx:XMArg>#5</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CintDA [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='int' role='INTOP' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CintCond [] {}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='int' role='INTOP' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cdiff [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='diff' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cddiff [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='diff' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cpartialdiff [] {}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='diff' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "?#2(<ltx:XMArg>#2</ltx:XMArg>)()" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cdegree {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='degree'/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#1</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Climit [] {}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='limit' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\ClimitCond [] {}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='limit' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CtendstoOp []', + "<ltx:XMTok meaning='tendsto' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Ctendsto [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='RELOP' meaning='tendsto' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CtendstoAboveOp []', + "<ltx:XMTok meaning='tendsto' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\CtendstoAbove [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='RELOP'meaning='tendsto' type='above' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CtendstoBelowOp []', + "<ltx:XMTok meaning='tendsto' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\CtendstoBelow [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='RELOP' meaning='tendsto' type='below' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cdivergence [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='divergence' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cgrad [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='grad' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Curl [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='url' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Claplacian [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='OPFUNCTION' meaning='laplacian' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cset [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='set' role='CONSTRUCTOR' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CsetRes [] {}{}', + "<ltx:XMApp role='BIGOP'>" + . "<ltx:XMTok role='BIGOP' meaning='set' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg role='BVAR'>#2</ltx:XMArg>" + . "<ltx:XMArg role='CONDITION'>#3</ltx:XMArg>" + . "<ltx:XMArg role='SCOPE'>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CsetCond [] {}{}{}', + "<ltx:XMApp role='BIGOP'>" + . "<ltx:XMTok role='BIGOP' meaning='set' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg role='BVAR'>#2</ltx:XMArg>" + . "<ltx:XMArg role='CONDITION'>#3</ltx:XMArg>" + . "<ltx:XMArg role='SCOPE'>#4</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CsetDA [] {}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BIGOP' meaning='set' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg role='BVAR'>#2</ltx:XMArg>" + . "<ltx:XMArg role='DOMAINOFAPPLICATION'>#3</ltx:XMArg>" + . "<ltx:XMArg role='SCOPE'>#4</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\ClistOp []', + "<ltx:XMTok meaning='list' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Clist [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='list' role='CONSTRUCTOR' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CunionOp []', + "<ltx:XMTok meaning='union' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cunion [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='union' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CintersectOp []', + "<ltx:XMTok meaning='intersect' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cintersect [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='intersect' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CinOp []', + "<ltx:XMTok meaning='in' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cin [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='in' role='RELOP' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CnotinOp []', + "<ltx:XMTok meaning='notin' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cnotin [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='notin' role='RELOP' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CsubsetOp []', + "<ltx:XMTok meaning='subset' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Csubset [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='subset' role='RELOP' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CprsubsetOp []', + "<ltx:XMTok meaning='prsubset' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cprsubset [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='prsubset' role='RELOP' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CnotsubsetOp []', + "<ltx:XMTok meaning='notsubset' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cnotsubset [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='notsubset' role='RELOP' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CnotprsubsetOp []', + "<ltx:XMTok meaning='notprsubset' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cnotprsubset [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='notprsubset' role='RELOP' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CsetdiffOp []', + "<ltx:XMTok meaning='setdiff' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Csetdiff [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='setdiff' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CcardOp []', + "<ltx:XMTok meaning='card' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Ccard [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='card' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CcartesianproductOp []', + "<ltx:XMTok meaning='cartesianproduct' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Ccartesianproduct [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='cartesianproduct' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CsupsetOp []', + "<ltx:XMTok meaning='supset' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\CprsupsetOp []', + "<ltx:XMTok meaning='prsupset' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\CnotsupsetOp []', + "<ltx:XMTok meaning='notsupset' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\CnotprsupsetOp []', + "<ltx:XMTok meaning='notprsupset' role='ID' ?#1(definitionURL='#1')()/>"); +DefMacro('\Csupset[]{}','\Csubset[#1]{#2}'); +DefMacro('\Cprsupset[]{}','\Cprsubset[#1]{#2}'); +DefMacro('\Cnotsupset[]{}{}','\Cnotsubset[#1]{#3}{#2}'); +DefMacro('\Cnotprsupset[]{}{}','\Cnotprsubset[#1]{#3}{#2}'); +DefConstructor('\CUnionDAOp []', + "<ltx:XMTok meaning='union' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\CUnionDA [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BIGOP' meaning='union' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CUnionCond [] {}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BIGOP' meaning='union' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CIntersectDaOp []', + "<ltx:XMTok meaning='intersect' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\CIntersectDa [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BIGOP' meaning='intersect' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CIntersectCond [] {}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BIGOP' meaning='intersect' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CCartesianproductDaOp []', + "<ltx:XMTok meaning='cartesianproduct' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\CCartesianproductDa [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BIGOP' meaning='cartesianproduct' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CCartesianproductCond [] {}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='BIGOP' meaning='cartesianproduct' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CsumOp []', + "<ltx:XMTok meaning='sum' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\CsumLimits [] {}{}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='sum' role='SUMOP' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "#5</ltx:XMApp>"); +DefConstructor('\CprodOp []', + "<ltx:XMTok meaning='prod' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\CprodLimits [] {}{}{}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='prod' role='SUMOP' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg><ci>#2</ci></ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "<ltx:XMArg>#4</ltx:XMArg>" + . "#5</ltx:XMApp>"); +DefConstructor('\Csin [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='sin' role='TRIGFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Ccos [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='cos' role='TRIGFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Ctan [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='tan' role='TRIGFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Csec [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='sec' role='TRIGFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Ccsc [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='csc' role='TRIGFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Ccot [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='cot' role='TRIGFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Csinh [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='sinh' role='TRIGFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Ccosh [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='cosh' role='TRIGFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Ctanh [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='tanh' role='TRIGFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Csech [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='sech' role='TRIGFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Ccsch [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='csch' role='TRIGFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Ccoth [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='coth' role='TRIGFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Carcsin [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='arcsin' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Carccos [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='arccos' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Carctan [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='arctan' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Carcsec [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='arcsec' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Carccsc [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='arccsc' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Carccot [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='arccot' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Carcsinh [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='arcsinh' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Carccosh [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='arccosh' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Carctanh [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='arctanh' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Carcsech [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='arcsech' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Carccsch [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='arccsch' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Carccoth [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='arccoth' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cexp [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='exp' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cln [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='ln' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Clog [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='log' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cmean [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='mean' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Csdev [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='sdev' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cvar [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='var' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cmedian [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='median' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cmode [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='mode' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cmoment [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='moment' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cvector [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok role='CONSTRUCTOR' meaning='vector' ?#1(definitionURL='#1')()/>" + . "#2" + . "</ltx:XMApp>", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\Cmatrix [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok role='CONSTRUCTOR' meaning='matrix' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cdeterminant [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='determinant' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Ctranspose [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='transpose' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cselector [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='selector' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CvectorproductOp []', + "<ltx:XMTok meaning='vectorproduct' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cvectorproduct [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='vectorproduct' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\Cscalarproduct [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='scalarproduct' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>"); +DefConstructor('\CouterproductOp []', + "<ltx:XMTok meaning='outerproduct' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Couterproduct [] {}{}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='outerproduct' role='OPFUNCTION' ?#1(definitionURL='#1')()/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "<ltx:XMArg>#3</ltx:XMArg>" + . "</ltx:XMApp>");#$ +DefConstructor('\Cintegers []', + "<ltx:XMTok meaning='integers' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Creals []', + "<ltx:XMTok meaning='reals' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Crationals []', + "<ltx:XMTok meaning='rationals' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cnaturalnumbers []', + "<ltx:XMTok meaning='naturalnumbers' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Ccomplexes []', + "<ltx:XMTok meaning='complexes' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cprimes []', + "<ltx:XMTok meaning='primes' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cexponentiale []', + "<ltx:XMTok meaning='exponentiale' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cimaginaryi []', + "<ltx:XMTok meaning='imaginaryi' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cnotanumber []', + "<ltx:XMTok meaning='notanumber' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Ctrue []', + "<ltx:XMTok meaning='true' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cfalse []', + "<ltx:XMTok meaning='false' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cemptyset []', + "<ltx:XMTok meaning='emptyset' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cpi []', + "<ltx:XMTok meaning='pi' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Ceulergamma []', + "<ltx:XMTok meaning='eulergamma' role='ID' ?#1(definitionURL='#1')()/>"); +DefConstructor('\Cinfinit []', + "<ltx:XMTok meaning='infinit' role='ID' ?#1(definitionURL='#1')()/>"); +1; diff --git a/Master/texmf-dist/tex/latex/stex/cmathml/cmathmlx.sty b/Master/texmf-dist/tex/latex/stex/cmathml/cmathmlx.sty new file mode 100644 index 00000000000..dd9f04945f4 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/cmathml/cmathmlx.sty @@ -0,0 +1,14 @@ +%% +%% This is file `cmathmlx.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% cmathml.dtx (with options: `styx') +%% +\RequirePackage{presentation} +\def\CMathML@complement#1{#1^c} +\newcommand{\Ccomplement}[2][]{\CMathML@complement{#2}} +\endinput +%% +%% End of file `cmathmlx.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/cmathml/cmathmlx.sty.ltxml b/Master/texmf-dist/tex/latex/stex/cmathml/cmathmlx.sty.ltxml new file mode 100644 index 00000000000..93025278369 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/cmathml/cmathmlx.sty.ltxml @@ -0,0 +1,22 @@ +%% +%% This is file `cmathmlx.sty.ltxml', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% cmathml.dtx (with options: `ltxmlx') +%% +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +use LaTeXML::Document; +RequirePackage('LaTeX'); +DefConstructor('\Ccomplement [] {}', + "<ltx:XMApp>" + . "<ltx:XMTok meaning='complement' role='CSYMBOL'/>" + . "<ltx:XMArg>#2</ltx:XMArg>" + . "</ltx:XMApp>"); +\endinput +%% +%% End of file `cmathmlx.sty.ltxml'. diff --git a/Master/texmf-dist/tex/latex/stex/cnx/cnx.cls b/Master/texmf-dist/tex/latex/stex/cnx/cnx.cls new file mode 100644 index 00000000000..3908c72b577 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/cnx/cnx.cls @@ -0,0 +1,142 @@ +%% +%% This is file `cnx.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% cnx.dtx (with options: `cls') +%% +\RequirePackage{sref} +\RequirePackage{graphicx} +\DeclareOption{letterpaper} + {\setlength\paperheight {11in}% + \setlength\paperwidth {8.5in}} +\DeclareOption{a4paper} + {\setlength\paperheight {297mm}% + \setlength\paperwidth {210mm}} +\ExecuteOptions{letterpaper} +\ProcessOptions +\input{size10.clo} +\pagenumbering{roman} +\addmetakey{cnxmodule}{name} +\srefaddidkey{cnxmodule}{id} +\newenvironment{cnxmodule}[1][]{\metasetkeys{cnxmodule}{#1}}{} +\newenvironment{ccontent}{}{} +\newcounter{section} +\srefaddidkey{sectioning}{id} +\newenvironment{csection}[2][]% +{\stepcounter{section}\strut\\[1.5ex]\noindent% +{\Large\bfseries\arabic{section}.~{#2}}\\[1.5ex] +\metasetkeys{sectioning}{#1}} +{} +\newcounter{subsection}[section] +\newenvironment{csubsection}[2][] +{\refstepcounter{subsection}\strut\\[1ex]\noindent% +{\large\bfseries{\arabic{section}.\arabic{subsection}.~#2\\[1ex]}}% +\metasetkeys{sectioning}{#1}}% +{} +\newcounter{subsubsection}[subsection] +\newenvironment{csubsubsection}[2][] +{\refstepcounter{subsubsection}\strut\\[.5ex]\noindent +{\bfseries\arabic{section}.\arabic{subsection}.\arabic{subsubsecction}~#2\\[.5ex]}% +\metasetkeys{sectioning}{#1}}{} +\srefaddidkey{para}{id} +\newenvironment{cpara}[1][]{\metasetkeys{para}{#1}}{\par} +\srefaddidkey{note} +\addmetakey{note}{type} +\newenvironment{cnote}[1][]% +{\metasetkeys{note}{#1}\par\noindent\strut\hfill\begin{minipage}{10cm}{\bfseries\note@type}:~}% +{\end{minipage}\hfill\strut\par} +\srefaddidkey{equation}{id} +\newenvironment{cequation}[1][]% +{\metasetkeys{equation}{#1}\begin{displaymath}} +{\end{displaymath}} +\srefaddidkey{cquote} +\addmetakey{cquote}{type} +\addmetakey{cquote}{src} +\newenvironment{cquote}[1][]{% +\metasetkeys{cquote}{#1}\begin{center}\begin{minipage}{.8\textwidth}}{\end{minipage}\end{center}} +\newcommand{\litem}[2][]{\item[#1]\label{#2}} +\srefaddidkey{example} +\addmetakey{example}{name} +\newenvironment{cexample}[1][]{\metasetkeys{example}{#1} +{\ifx\example@name\@empty\else\noindent\bfseries{\example@name}\fi}} +{} +\newcounter{cexercise} +\srefaddidkey{cexercise} +\addmetakey{cexercise}{name} +\newenvironment{cexercise}[1][]{\metasetkeys{cexercise}{#1} +{\ifx\cexercise@name\@empty\else\stepcounter{cexercise}\noindent\bfseries{\cexercise@name~\arabic{cexercise}}\fi}} +{} +\srefaddidkey{cproblem} +\newenvironment{cproblem}[1][]{\metasetkeys{cproblem}{#1}}{}{} +\srefaddidkey{csolution} +\newenvironment{csolution}[1][]{\metasetkeys{csolution}{#1}}{\par\noindent\bfseries{Solution}}{} +\srefaddidkey{rule} +\addmetakey{rule}{name} +\addmetakey{rule}{type} +\newenvironment{crule}[1][]{\metasetkeys{rule}{#1}% +{\noindent\bfseries{\rule@type:}\ifx\rule@name\@empty\else~(\rule@name)\fi}}% +{} +\srefaddidkey{statement} +\newenvironment{statement}[1][]{\metasetkeys{statement}{#1}}{} +\srefaddidkey{proof} +\newenvironment{proof}[1][]{\metasetkeys{proof}{#1}}{} +\srefaddidkey{definition} +\addmetakey{definition}{term} +\addmetakey{definition}{seealso} +\newenvironment{definition}[1][]{\metasetkeys{definition}{#1}{\noindent\bfseries{Definition:}}}{} +\srefaddidkey{meaning} +\newenvironment{cmeaning}[1][]{\metasetkeys{meaning}{#1}}{} +\addmetakey{cnxn}{document} +\addmetakey{cnxn}{target} +\addmetakey{cnxn}{strength} +\newcommand{\cnxn}[2][]% keys, link text +{\metasetkeys{cnxn}{#1}{\underline{#2}}\footnote{{\ttfamily\@ifx\cnxn@document\@empty\cnxn@document\fi\#\cnxn@target}}} +\newcommand\@makefntext[1]{\parindent 1em\noindent\hb@xt@1.8em{\hss\@makefnmark}#1} +\addmetakey{link}{src} +\newcommand{\link}[2][]{\metasetkeys{link}{#1}\underline{#2}} +\srefaddidkey{cfigure} +\addmetakey{cfigure}{type} +\addmetakey{cfigure}{caption} +\newcounter{figure} +\newcommand{\cfigure}[3][]{% cnx_keys, graphicx_keys, path +\begin{center}% +\includegraphics[#2]{#3}% +\metasetkeys{cfigure}{#1}\sref@target% +\ifx\cfigure@caption\@empty\else +\par\noindent Figure\refstepcounter{figure} {\arabic{figure}}: \cfigure@caption% +\protected@edef\@currentlabel{\arabic{figure}}% +\sref@label@id{Figure \thefigure}\fi +\end{center}} +\addmetakey{ccite}{src} +\newcommand{\ccite}[2][]{\metasetkeys{ccite}{#1}\emph{#2}} +\newcommand{\term}[1]{{\bfseries\underline{#1}}} +\addmetakey{metadata}{version} +\addmetakey{metadata}{created} +\addmetakey{metadata}{revised} +\newsavebox{\metadatabox} +\newenvironment{metadata}[1][]% +{\noindent\hfill\begin{lrbox}{\metadatabox} +\begin{minipage}{.8\textwidth}% +{\Large\bfseries CNX Module: \cnx@name\hfill\strut}\\[2ex]}% +{\end{minipage}\end{lrbox}\fbox{\usebox\metadatabox}\hfill} +\newenvironment{authorlist}{{\bfseries{Authors}:~}}{\\[1ex]} +\newenvironment{maintainerlist}{{\bfseries{Maintainers}:~}}{\\[1ex]} +\srefaddidkey{auth} +\addmetakey{auth}{honorific} +\addmetakey{auth}{firstname} +\addmetakey{auth}{other} +\addmetakey{auth}{surname} +\addmetakey{auth}{lineage} +\addmetakey{auth}{email} +\newcommand{\cnxauthor}[1][]{\metasetkeys{auth}{#1}\auth@first~\auth@sur,} +\newcommand{\maintainer}[1][]{\metasetkeys{auth}{#1}\auth@first~\auth@sur,} +\newenvironment{keywordlist}{\bfseries{Keywords}:~}{\\[1ex]} +\newcommand{\keyword}[1]{#1,} +\newenvironment{cnxabstract}% +{\par\noindent\strut\hfill\begin{minipage}{10cm}{\bfseries{Abstract}:~}}% +{\end{minipage}\hfill} +\endinput +%% +%% End of file `cnx.cls'. diff --git a/Master/texmf-dist/tex/latex/stex/cnx/cnx.cls.ltxml b/Master/texmf-dist/tex/latex/stex/cnx/cnx.cls.ltxml new file mode 100644 index 00000000000..9dc46bd071f --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/cnx/cnx.cls.ltxml @@ -0,0 +1,280 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +RequirePackage('metakeys'); +RegisterNamespace('cnx'=>"http://cnx.rice.edu/cnxml"); +RegisterNamespace('md'=>"http://cnx.rice.edu/mdml/0.4"); +RegisterNamespace('bib'=>"http://bibtexml.sf.net/"); +RegisterNamespace('m'=>"http://www.w3.org/1998/Math/MathML"); +DocType("cnx:document", +"-//CNX//DTD CNXML 0.5 plus LaTeXML//EN", +"../dtd/cnxml+ltxml.dtd", +'#default'=>"http://cnx.rice.edu/cnxml", + 'md'=>"http://cnx.rice.edu/mdml/0.4", + 'bib'=>"http://bibtexml.sf.net/", + 'm'=>"http://www.w3.org/1998/Math/MathML", + 'ltx'=>"http://dlmf.nist.gov/LaTeXML"); +NewCounter('@itemizei', 'document', idprefix=>'I'); +NewCounter('@itemizeii', '@itemizei', idprefix=>'I'); +NewCounter('@itemizeiii', '@itemizeii', idprefix=>'I'); +NewCounter('@itemizeiv', '@itemizeiii',idprefix=>'I'); +NewCounter('@itemizev', '@itemizeiv', idprefix=>'I'); +NewCounter('@itemizevi', '@itemizev', idprefix=>'I'); + +NewCounter('enumi', '@itemizei', idprefix=>'i'); +NewCounter('enumii', '@itemizeii', idprefix=>'i'); +NewCounter('enumiii','@itemizeiii', idprefix=>'i'); +NewCounter('enumiv', '@itemizeiv', idprefix=>'i'); +# A couple of more levels, since we use these for ID's! +NewCounter('enumv', '@itemizev', idprefix=>'i'); +NewCounter('enumvi', '@itemizevi', idprefix=>'i'); + +DefMacro('\theenumi', '\arabic{enumi}'); +DefMacro('\theenumii', '\alph{enumii}'); +DefMacro('\theenumiii', '\roman{enumiii}'); +DefMacro('\theenumiv', '\Alph{enumiv}'); + +NewCounter('equation', 'document', idprefix=>'E'); +DefMacro('\theequation', '\arabic{equation}'); +DefMacro('\textwidth','16cm'); +Let('\thedocument@ID','\@empty'); +DefKeyVal('cnxmodule','name','Semiverbatim'); +DefKeyVal('cnxmodule','id','Semiverbatim'); +DefEnvironment('{document}','<cnx:document>#body</cnx:document>', + beforeDigest=> sub { AssignValue(inPreamble=>0); }, + afterDigest=> sub { $_[0]->getGullet->flush; return; }); +DefEnvironment('{cnxmodule} OptionalKeyVals:cnxmodule', + "<cnx:name>&KeyVal('#1','name')</cnx:name>\n#body\n", + afterDigestBegin => sub { + AssignValue('cnxmodule_id', + KeyVal($_[1]->getArg(1), 'id')->toString, + 'global'); + });#$ +Tag('cnx:document', afterClose => sub { + $_[1]->setAttribute('id', LookupValue('cnxmodule_id')); + }); +DefEnvironment('{ccontent}',"<cnx:content>#body</cnx:content>"); +DefKeyVal('sectioning','id','Semiverbatim'); +DefEnvironment('{csection}OptionalKeyVals:sectioning{}', + "<cnx:section %&KeyVals(#1)>\n" + . "?#2(<cnx:name>#2</cnx:name>\n)()" + . "#body\n</cnx:section>\n"); +DefEnvironment('{csubsection}OptionalKeyVals:sectioning{}', + "<cnx:section %&KeyVals(#1)>\n" + . "?#2(<cnx:name>#2</cnx:name>\n)()" + . "#body\n</cnx:section>\n"); +DefEnvironment('{csubsubsection}OptionalKeyVals:sectioning{}', + "<cnx:section %&KeyVals(#1)>\n" + . "?#2(<cnx:name>#2</cnx:name>\n)()" + . "#body\n</cnx:section>\n"); +DefKeyVal('para','id','Semiverbatim'); +DefEnvironment('{cpara} OptionalKeyVals:para','<cnx:para %&KeyVals(#1)>#body</cnx:para>'); +sub number_para { + my($document,$node,$whatsit)=@_; + # Get prefix from first parent with an id. + my(@parents)=$document->findnodes('ancestor::*[@id]',$node); # find 1st id'd parent. + my $prefix= (@parents ? $parents[$#parents]->getAttribute('id')."." : ''); + # Get the previous number within parent; Worried about intervening elements around para's, but... + my(@siblings)=$document->findnodes("preceding-sibling::cnx:para",$node); + my $n=1; + $n = $1+1 if(@siblings && $siblings[$#siblings]->getAttribute('id')=~/(\d+)$/); + $node->setAttribute(id=>$prefix."p$n"); } +Tag('cnx:para',afterOpen=>\&number_para); +DefConstructor('\par',sub { $_[0]->maybeCloseElement('cnx:para'); },alias=>"\\par\n"); +Tag('cnx:para', autoClose=>1, autoOpen=>1); +DefKeyVal('note','id','Semiverbatim'); +DefKeyVal('note','type','Semiverbatim'); +DefEnvironment('{cnote}OptionalKeyVals:note','<cnx:note %&KeyVals(#1)>#body</cnx:note>'); +DefKeyVal('equation','id','Semiverbatim'); +DefEnvironment('{cequation} OptionalKeyVals:equation', + "<cnx:equation %&KeyVals(#1)>" + . "<ltx:Math mode='display'>" + . "<ltx:XMath>#body</ltx:XMath>" + . "</ltx:Math></cnx:equation>", + mode=>'display_math'); +DefKeyVal('cquote','id','Semiverbatim'); +DefKeyVal('cquote','type','Semiverbatim'); +DefKeyVal('cquote','src','Semiverbatim'); +DefEnvironment('{cquote} OptionalKeyVals:cquote', + "<cnx:quote %&KeyVals(#1)>#body</cnx:quote>"); +DefConstructor('\footnote[]{}',"<cnx:note type='foot'>#2</cnx:note>"); +DefConstructor('\emph{}',"<cnx:emphasis>#1</cnx:emphasis>"); +DefConstructor('\[', + "<cnx:equation id='#id'>" + . "<ltx:Math mode='display'>" + . "<ltx:XMath>" + . "#body" + . "</ltx:XMath>" + . "</ltx:Math>" + ."</cnx:equation>", + beforeDigest=> sub{ $_[0]->beginMode('display_math'); }, + captureBody=>1, + properties=> sub { RefStepID('equation') }); +DefConstructor('\]' ,"",beforeDigest=> sub{ $_[0]->endMode('display_math'); }); +DefConstructor('\[', + "<cnx:equation id='#id'>" + . "<ltx:Math mode='display'>" + . "<ltx:XMath>" + . "#body" + . "</ltx:XMath>" + . "</ltx:Math>" + ."</cnx:equation>", + beforeDigest=> sub{ $_[0]->beginMode('display_math'); }, + captureBody=>1, + properties=> sub { RefStepID('equation') }); +DefConstructor('\]' ,"",beforeDigest=> sub{ $_[0]->endMode('display_math'); }); + +DefMacro('\eqnarray', '\@@eqnarray\@start@alignment'); +DefMacro('\endeqnarray', '\@finish@alignment\end@eqnarray'); +DefMacro('\csname eqnarray*\endcsname', '\@@eqnarray*\@start@alignment'); +DefMacro('\csname endeqnarray*\endcsname', '\@finish@alignment\end@eqnarray'); +DefConstructor('\@@eqnarray OptionalMatch:* AlignmentBody:\end@eqnarray', + sub { + my($document,$star,$body,%props)=@_; + $document->openElement('cnx:equation',refnum=>$props{refnum},id=>$props{id}); + $document->openElement('ltx:Math',mode=>'display'); + $document->openElement('ltx:XMath'); + constructAlignment($document,$body,attributes=>{name=>'eqnarray'}); + $document->closeElement('ltx:XMath'); + $document->closeElement('ltx:Math'); + $document->closeElement('cnx:equation'); }, + mode=>'display_math', + beforeDigest=>sub { alignmentBindings('rcl'); }, + properties=> sub { ($_[1] ? RefStepID('equation') : RefStepCounter('equation')); }, + afterDigest=>sub { + $_[1]->setProperty(body=>$_[1]->getArg(2));}, # So we get TeX + reversion=>'\begin{eqnarray#1}#2\end{eqnarray#1}'); +Tag('cnx:item', autoClose=>1); +DefConstructor('\item[]',"<cnx:item>?#1(<cnx:name>#1</cnx:name>)"); +DefConstructor('\litem[]{}',"<cnx:item id='#2'>?#1(<cnx:name>#1</cnx:name>)"); +DefConstructor('\itemize@item[]', + "<cnx:item id='#id'>?#1(<cnx:name>#1</cnx:name>)", + properties=>sub{ RefStepItemCounter(); }); +DefConstructor('\enumerate@item[]', + "<cnx:item id='#id'>?#1(<cnx:name>#1</cnx:name>)", + properties=>sub{ RefStepItemCounter(); }); +DefConstructor('\description@item[]', + "<cnx::item id='#id'>?#1(<cnx:name>#1</cnx:name>)", + properties=>sub{ RefStepItemCounter(); }); +AssignValue(itemlevel=>0); +DefEnvironment('{itemize}', + "<cnx:list id='#id' type='itemize'>#body</cnx:list>", + properties=>sub { beginItemize('itemize'); }); +DefEnvironment('{enumerate}', + "<cnx:list type='enumerate' id='#id'>#body</cnx:list>", + properties=>sub { beginItemize('enumerate'); }); +DefEnvironment('{description}', + "<cnx:list type='description' id='#id'>#body</cnx:list>", + properties=>sub { beginItemize('description'); }); +DefEnvironment('{center}','#body'); +DefEnvironment('{minipage}{}','#body'); +DefEnvironment('{small}','#body'); +DefEnvironment('{footnotesize}','#body'); +DefEnvironment('{tiny}','#body'); +DefEnvironment('{scriptsize}','#body'); +DefConstructor('\ref Semiverbatim', "<cnx:cnxn target='#1'>&LookupValue('LABEL@#1')</cnx:cnxn>"); +DefKeyVal('example','id','Semiverbatim'); +DefEnvironment('{cexample}OptionalKeyVals:example', + "<cnx:example %&KeyVals(#1)>#body</cnx:example>"); +DefKeyVal('cexercise','id','Semiverbatim'); +DefKeyVal('cexercise','name','Semiverbatim'); +DefEnvironment('{cexercise}OptionalKeyVals:exercise', + "<cnx:exercise ?&defined(&KeyVal(#1,'id'))(id='&KeyVal(#1,'id')')()>" + . "#body" + . "</cnx:exercise>"); +DefKeyVal('cproblem','id','Semiverbatim'); +DefKeyVal('cproblem','name','Semiverbatim'); +DefEnvironment('{cproblem}OptionalKeyVals:cproblem', + "<cnx:problem ?&defined(&KeyVal(#1,'id'))(id='&KeyVal(#1,'id')')()>" + . "?&defined(&KeyVal(#1,'name'))(<cnx:name>&KeyVal(#1,'name')</cnx:name>\n)()" + . "#body" + . "</cnx:problem>"); +DefKeyVal('csolution','id','Semiverbatim'); +DefKeyVal('csolution','name','Semiverbatim'); +DefEnvironment('{csolution}OptionalKeyVals:cproblem', + "<cnx:solution ?&defined(&KeyVal(#1,'id'))(id='&KeyVal(#1,'id')')()>" + . "?&defined(&KeyVal(#1,'name'))(<cnx:name>&KeyVal(#1,'name')</cnx:name>\n)()" + . "#body" + . "</cnx:solution>"); +DefKeyVal('rule','id','Semiverbatim'); +DefKeyVal('rule','name','Semiverbatim'); +DefKeyVal('rule','type','Semiverbatim'); +DefEnvironment('{crule}OptionalKeyVals:rule', + "<cnx:rule ?&defined(&KeyVal(#1,'id'))(id='&KeyVal(#1,'id')')() type='&KeyVal(#1,'type')'>\n" + . "?&defined(&KeyVal(#1,'name'))(<cnx:name>&KeyVal(#1,'name')</cnx:name>\n)()" + . "\n#body\n" + . "</cnx:rule>\n"); +DefKeyVal('statement','id','Semiverbatim'); +DefEnvironment('{statement} OptionalKeyVals:statement','<cnx:statement %&KeyVals(#1)>#body</cnx:statement>'); +DefKeyVal('proof','id','Semiverbatim'); +DefEnvironment('{proof}OptionalKeyVals:proof','<cnx:proof %&KeyVals(#1)>#body</cnx:proof>'); +DefKeyVal('definition','id','Semiverbatim'); +DefKeyVal('definition','term','Semiverbatim'); +DefKeyVal('definition','seealso','Semiverbatim'); +DefEnvironment('{definition}OptionalKeyVals:definition', + "<cnx:definition ?&defined(&KeyVal(#1,'id'))(id='&KeyVal(#1,'id')')()>\n" + . "?&defined(&KeyVal(#1,'term'))(<cnx:term>&KeyVal(#1,'term')</cnx:term>\n)()" + . "\n#body\n" + . "?&defined(&KeyVal(#1,'seealso'))(<cnx:seealso><cnx:term>&KeyVal(#1,'term')</cnx:term></cnx:seealso>\n)()" + . "</cnx:definition>\n"); +DefKeyVal('meaning','id','Semiverbatim'); +DefEnvironment('{cmeaning}OptionalKeyVals:meaning','<cnx:meaning %&KeyVals(#1)>#body</cnx:meaning>'); +DefKeyVal('cnxn','document','Semiverbatim'); +DefKeyVal('cnxn','target','Semiverbatim'); +DefKeyVal('cnxn','strength','Semiverbatim'); +DefConstructor('\cnxn OptionalKeyVals:cnxn {}','<cnx:cnxn %&KeyVals(#1)>#1</cnx:cnxn>'); +DefKeyVal('link','src','Semiverbatim'); +DefConstructor('\link OptionalKeyVals:link {}','<cnx:link %&KeyVals(#1)>#2</cnx:link>'); +DefKeyVal('cfigure','id','Semiverbatim'); +DefKeyVal('cfigure','name','Semiverbatim'); +DefKeyVal('cfigure','type','Semiverbatim'); +DefKeyVal('cfigure','caption','Semiverbatim'); +DefConstructor('\cfigure OptionalKeyVals:cfigure Semiverbatim Semiverbatim', + "<cnx:figure ?&defined(&KeyVal(#1,'id'))(id='&KeyVal(#1,'id')')()>" + . "?&defined(&KeyVal(#1,'name'))(<cnx:name>&KeyVal(#1,'name')</cnx:name>\n)()" + . "<cnx:media type='&KeyVal(#1,'type')' src='#3'/>" + . "?&defined(&KeyVal(#1,'caption'))(<cnx:caption>&KeyVal(#1,'caption')</cnx:caption>\n)()" + . "</cnx:figure>"); +DefKeyVal('ccite','src','Semiverbatim'); +DefConstructor('\ccite OptionalKeyVals:ccite {}','<cnx:cite %&KeyVals(#1)>#2</cnx:cite>'); +DefConstructor('\term[]{}',"<cnx:term>#2</cnx:term>"); +DefKeyVal('metadata','version','Semiverbatim'); +DefKeyVal('metadata','created','Semiverbatim'); +DefKeyVal('metadata','revised','Semiverbatim'); +DefEnvironment('{metadata}OptionalKeyVals:metadata', + "<cnx:metadata>\n" + . "<md:version>&KeyVal('#1','version')</md:version>\n" + . "<md:created>&KeyVal('#1','created')</md:created>\n" + . "<md:revised>&KeyVal('#1','revised')</md:revised>\n" + . "#body\n" + . "</cnx:metadata>"); +DefEnvironment('{authorlist}',"<md:authorlist>#body</md:authorlist>"); +DefEnvironment('{maintainerlist}',"<md:maintainerlist>#body</md:maintainerlist>"); +DefKeyVal('auth','id','Semiverbatim'); +DefKeyVal('auth','firstname','Semiverbatim'); +DefKeyVal('auth','surname','Semiverbatim'); +DefKeyVal('auth','email','Semiverbatim'); +DefConstructor('\cnxauthor OptionalKeyVals:auth', + "<md:author id='&KeyVal('#1','id')'>\n" + . "?&defined(&KeyVal(#1,'honorific'))(<md:honorific>&KeyVal('#1','honorific')</md:honorific>\n)()" + . "?&defined(&KeyVal(#1,'firstname'))(<md:firstname>&KeyVal('#1','firstname')</md:firstname>\n)()" + . "?&defined(&KeyVal(#1,'other'))(<md:other>&KeyVal('#1','other')</md:other>\n)()" + . "?&defined(&KeyVal(#1,'surname'))(<md:surname>&KeyVal('#1','surname')</md:surname>\n)()" + . "?&defined(&KeyVal(#1,'lineage'))(<md:lineage>&KeyVal('#1','lineage')</md:lineage>\n)()" + . "?&defined(&KeyVal(#1,'email'))(<md:email>&KeyVal('#1','email')</md:email>\n)()" + . "</md:author>\n"); +DefConstructor('\maintainer OptionalKeyVals:auth', + "<md:maintainer id='&KeyVal('#1','id')'>\n" + . "?&defined(&KeyVal(#1,'honorific'))(<md:honorific>&KeyVal('#1','honorific')</md:honorific>\n)()" + . "?&defined(&KeyVal(#1,'firstname'))(<md:firstname>&KeyVal('#1','firstname')</md:firstname>\n)()" + . "?&defined(&KeyVal(#1,'other'))(<md:other>&KeyVal('#1','other')</md:other>\n)()" + . "?&defined(&KeyVal(#1,'surname'))(<md:surname>&KeyVal('#1','surname')</md:surname>\n)()" + . "?&defined(&KeyVal(#1,'lineage'))(<md:lineage>&KeyVal('#1','lineage')</md:lineage>\n)()" + . "?&defined(&KeyVal(#1,'email'))(<md:email>&KeyVal('#1','email')</md:email>\n)()" + . "</md:maintainer>\n"); +DefEnvironment('{keywordlist}',"<md:keywordlist>\n#body\n</md:keywordlist>"); +DefConstructor('\keyword {}',"<md:keyword>#1</md:keyword>"); +DefEnvironment('{cnxabstract} OptionalKeyVals:cnxabstract', + "<md:abstract>\n#body\n</md:abstract>\n"); +1; diff --git a/Master/texmf-dist/tex/latex/stex/ctansvn.sty b/Master/texmf-dist/tex/latex/stex/ctansvn.sty new file mode 100644 index 00000000000..5ddfe7667e1 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/ctansvn.sty @@ -0,0 +1,2 @@ +\def\ctancitesuffix{:ctan} +\def\ctancite#1{\cite{#1\ctancitesuffix}} diff --git a/Master/texmf-dist/tex/latex/stex/dcm/dcm.sty b/Master/texmf-dist/tex/latex/stex/dcm/dcm.sty new file mode 100644 index 00000000000..d6bab773306 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/dcm/dcm.sty @@ -0,0 +1,86 @@ +%% +%% This is file `dcm.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% dcm.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{dcm}[2012/01/28 v0.3 Dublin Core Metadata] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\ProcessOptions +\RequirePackage{workaddress} +\RequirePackage[sectioning]{rdfmeta} +\newenvironment{DCmetadata}[1][]% +{\def\@style{#1}}% to set the way things are presented. +{\@ifundefined{dcm@\@style @block}% +{\message{style {\@style} not defined}}% +{\csname dcm@\@style @block\endcsname}} +\def\DCMcreators#1{\@for\@I:=#1\do{\wa@ref@test{person}\@I{id}} +\gdef\dcm@creators{#1}} +\def\DCMcontributors#1{\@for\@I:=#1\do{\wa@ref@test{person}\@I{id}}% +\def\dcm@contributors{#1}} +\def\DCMtitle#1{\def\dcm@title{#1}\providecommand{\dcm@shorttitle}{#1}} +\def\dcm@subtitle{} +\def\DCMsubtitle#1{\def\dcm@subtitle{#1}} +\def\dcm@shorttitle{} +\def\DCMshorttitle#1{\def\dcm@shorttitle{#1}} +\def\DCMsubject#1{\def\dcm@subject{#1}} +\long\def\DCMdescription#1{\long\def\dcm@description{#1}} +\def\DCMpublisher#1{\def\dcm@publisher{#1}} +\def\dcm@date{\today} +\def\DCMdate#1{\def\dcm@date{#1}} +\def\DCMtype#1{\def\dcm@type{#1}} +\def\DCMidentifier#1#2{\def\dcm@scheme{#1}\def\dcm@identifier{#2}} +\def\DCMsource#1{\def\dcm@source{#1}} +\def\DCMlanguage#1{\def\dcm@language{#1}} +\def\DCMrelation#1{\def\dcm@relation{#1}} +\def\DCMrights#1{\long\def\dcm@rights{#1}} +\def\DCMlicense#1{\def\dcm@license{#1}} +\def\dcm@license{All rights reserved} +\def\DCMlicensenotice#1{\long\def\dcm@license{\\[1ex]License: #1}} +\def\DCMcopyrightnotice#1#2{\DCMrights{Copyright {\copyright} #1: #2}} +\def\cclicense#1{\def\attribution{\def\dcm@by{yes}} + \def\noncommercial{\def\dcm@nc{yes}} + \def\sharealike{\defdcm@sharealike{yes}} + \def\noderivativeworks{\def\dcm@derivatives{no}}} +\long\def\DCMabstract#1{\long\def\dcm@abstract{#1}} +\def\dcm@titlepage@block{\begin{titlepage} + \null\vfil\vskip 60\p@ + \begin{center} + \ifx\dcm@title\@empty + \PackageWarning{dcm}{No title specified}{\LARGE Add title here\par} + \else\LARGE \dcm@title \par\fi + \ifx\dcm@subtitle\@empty + \vskip 3em\Large \dcm@subtitle \par\vskip 3em + \else\large\lineskip .75em\WAauthorblock\dcm@creators\vskip 1.5em\fi + \ifx\dcm@date\@empty + \PackageWarning{dcm}{No date specified}{\large\today\par} + \else{\large\dcm@date\par}\vskip 2em\fi + \end{center}\vskip2em + \ifx\dcm@abstract\@empty + \PackageWarning{dcm}{No Abstract specified}\else + \begin{quote}\textbf\dcm@abstract@heading:\dcm@abstract\end{quote}\fi + \vskip 2em\par\vfil\noindent + {\small\noindent\dcm@rights\dcm@license} + \end{titlepage}} +\def\dcm@maketitle@block{\def\@title{\dcm@title\ifx\dcm@subtitle\empty\else\newline\dcm@subtitle\fi}% +\def\@author{\WAauthorblock\dcm@creators}% +\def\@date{\dcm@date}\maketitle} +\def\ISOtimestamp{\count1=\time\divide\count1 by 60 % hours +\count2=\count1\multiply\count2 by 60% minutes in \count1 hours +\count3=\time\advance\count3 by -\count2 % minutes +\the\year -\ifnum\month>9\else0\fi\the\month-\ifnum\day>9\else0\fi\the\day +T\ifnum\count1>9\else0\fi\the\count1:\ifnum\count3>9\else0\fi\the\count3:00Z} +\def\dcm@abstract@heading{Abstract} +\def\dcm@creators@heading{Author(s)} +\def\dcm@contributors@connector{with contributions from} +\def\dcm@chapter@heading{Chapter} +\def\dcm@section@heading{Section} +\def\dcm@subsection@heading{Subsection} +\def\dcm@subsubsection@heading{Subsubsection} +\def\dcm@paragraph@heading{Paragraph} +\endinput +%% +%% End of file `dcm.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/dcm/dcm.sty.ltxml b/Master/texmf-dist/tex/latex/stex/dcm/dcm.sty.ltxml new file mode 100644 index 00000000000..cdd386bbc6f --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/dcm/dcm.sty.ltxml @@ -0,0 +1,72 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Global; +use LaTeXML::Package; +RequirePackage('rdfmeta'); +RequirePackage('workaddress'); +sub FishOutMetadata { + my ($document,$keyvals)=@_; + foreach my $role(qw(creators contributors)) { + my $idlist_string=getKeyValue_noDelim($keyvals,$role); + my @ids = split(/,\s*/, $idlist_string); + foreach my $id(@ids) { + my $name = LookupValue('DCM_'.$id.'_name'); + if ($name) { + my $prop_role = $role; +chop $prop_role if $prop_role; + $document->insertElement("dc:$prop_role",$name) if $role; + } else {print STDERR "Warning: no $role with 'id' $id !\n";} + } + } + return;}#$ +DefEnvironment('{DCmetadata}[]', "<omdoc:metadata>#body</omdoc:metadata>"); +DefConstructor('\DCMcreators{}',sub{ + my ($document,$args,%properties) = @_; + my $keyval = LaTeXML::KeyVals->new('wa@person',T_BEGIN,T_END,('creators'=>$args)); + FishOutMetadata($document,$keyval); + return;}); +DefConstructor('\DCMcontributors{}',sub{ + my ($document,$args,%properties) = @_; + my $keyval = LaTeXML::KeyVals->new('wa@person',T_BEGIN,T_END,('contributors'=>$args)); + FishOutMetadata($document,$keyval); + return;}); +DefConstructor('\DCMtitle{}',"<dc:title>#1</dc:title>"); +DefConstructor('\DCMsubject{}',"<dc:subject>#1</dc:subject>"); +DefConstructor('\DCMdescription{}',"<dc:description>#1</dc:description>"); +DefConstructor('\DCMpublisher{}',"<dc:publisher>#1</dc:publisher>"); +DefConstructor('\DCMdate{}',"<dc:date>#1</dc:date>"); +DefConstructor('\DCMtype{}',"<dc:type>#1</dc:type>"); +DefConstructor('\DCMidentifier{}{}',"<dc:identifier scheme='#1'>#2</dc:identifier>"); +DefConstructor('\DCMsource{}',"<dc:source>#1</dc:source>"); +DefConstructor('\DCMlanguage{}',"<dc:language>#1</dc:language>"); +DefConstructor('\DCMrelation{}',"<dc:relation>#1</dc:relation>"); +DefConstructor('\DCMrights{}',"<dc:rights>#1</dc:rights>"); +DefMacro('\DCMlicensenotice{}','\DCMrights{#1}'); +DefMacro('\DCMcopyrightnotice{}{}','\DCMrights{Copyright {\copyright} #1: #2}'); +DefConstructor('\cclicense{}',"<cc:license>#1</cc:license>"); +DefConstructor('\attribution',"<cc:attribution/>"); +DefConstructor('\noncommercial',"<cc:noncommercial/>"); +DefConstructor('\sharealike',"<cc:sharealike/>"); +DefConstructor('\noderivativeworks',"<cc:noderivativeworks>"); +DefConstructor('\DCMabstract{}',"<dc:description>#1</dc:description>"); +Tag('dc:description',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1); +Tag('dc:date',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1); +Tag('dc:creator',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1); +Tag('dc:contributor',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1); +Tag('dc:title',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1); +Tag('dc:subject',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1); +Tag('dc:publisher',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1); +Tag('dc:type',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1); +Tag('dc:identifier',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1); +Tag('dc:language',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1); +Tag('dc:rights',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1); +RawTeX(' +\def\ISOtimestamp{\count1=\time\divide\count1 by 60 % hours +\count2=\count1\multiply\count2 by 60% minutes in \count1 hours +\count3=\time\advance\count3 by -\count2 % minutes +\the\year -\ifnum\month>9\else0\fi\the\month-\ifnum\day>9\else0\fi\the\day +T\ifnum\count1>9\else0\fi\the\count1:\ifnum\count3>9\else0\fi\the\count3:00Z} +'); +Tag('dc:title',afterOpen=>\&numberIt,afterClose=>\&locateIt); +1; diff --git a/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.cls b/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.cls new file mode 100644 index 00000000000..1408b9918f6 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.cls @@ -0,0 +1,34 @@ +%% +%% This is file `hwexam.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% hwexam.dtx (with options: `cls') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesClass{hwexam}[2012/01/28 v0.9b assignment and exam documents] +\DeclareOption{test}{\PassOptionsToPackage{\CurrentOption}{hwexam}} +\DeclareOption{multiple}{\PassOptionsToPackage{\CurrentOption}{hwexam}} +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\DeclareOption{extrefs}{\PassOptionsToPackage{\CurrentOption}{sref}} +\DeclareOption{notes}{\PassOptionsToPackage{\CurrentOption}{problem}} +\DeclareOption{hints}{\PassOptionsToPackage{\CurrentOption}{problem}} +\DeclareOption{solutions}{\PassOptionsToPackage{\CurrentOption}{problem}} +\DeclareOption{pts}{\PassOptionsToPackage{\CurrentOption}{problem}} +\DeclareOption{min}{\PassOptionsToPackage{\CurrentOption}{problem}} +\DeclareOption{boxed}{\PassOptionsToPackage{\CurrentOption}{problem}} +\DeclareOption{extract}{\PassOptionsToPackage{\CurrentOption}{problem}} +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{omdoc}} +\ProcessOptions +\LoadClass{omdoc} +\RequirePackage{stex} +\RequirePackage{hwexam} +\RequirePackage{graphicx} +\RequirePackage{a4wide} +\RequirePackage{amssymb} +\RequirePackage{amstext} +\RequirePackage{amsmath} +\endinput +%% +%% End of file `hwexam.cls'. diff --git a/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.cls.ltxml b/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.cls.ltxml new file mode 100644 index 00000000000..885ada472b4 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.cls.ltxml @@ -0,0 +1,26 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +use LaTeXML::Util::Pathname; +use Cwd qw(cwd abs_path); +DeclareOption('test',,sub {PassOptions('hwexam','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption('multiple',sub {PassOptions('hwexam','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption('showmeta',sub {PassOptions('metakeys','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption('extrefs',sub {PassOptions('sref','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption('notes',sub {PassOptions('problem','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption('hints',sub {PassOptions('problem','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption('solutions',sub {PassOptions('problem','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption('pts',sub {PassOptions('problem','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption('min',sub {PassOptions('problem','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption('boxed',sub {PassOptions('problem','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption('extract',sub {PassOptions('problem','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption(undef,sub {PassOptions('omdoc','cls',ToString(Digest(T_CS('\CurrentOption')))); }); +ProcessOptions(); +LoadClass('omdoc'); +RequirePackage('stex'); +RequirePackage('hwexam'); +RequirePackage('graphicx'); +RequirePackage('amssymb'); +RequirePackage('amstext'); +RequirePackage('amsmath'); diff --git a/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty b/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty new file mode 100644 index 00000000000..db290659ffe --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty @@ -0,0 +1,126 @@ +%% +%% This is file `hwexam.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% hwexam.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{hwexam}[2012/01/28 v0.9b homework assignments and exams] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\newif\iftest\testfalse +\newif\ifsolutions\solutionsfalse +\DeclareOption{test}{\testtrue\solutionsfalse} +\newif\ifmultiple\multiplefalse +\DeclareOption{multiple}{\multipletrue} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{problem}} +\ProcessOptions +\RequirePackage{keyval}[1997/11/10] +\RequirePackage{problem} +\addmetakey{assig}{number} +\addmetakey*{assig}{title} +\addmetakey{assig}{type} +\addmetakey{assig}{given} +\addmetakey{assig}{due} +\def\given@due#1#2{% +\ifx\assig@given\@empty\else\ifx\assig@due\@empty\else{#1}\fi\fi% +\ifx\assig@given\@empty\else{Given {\assig@given}}\fi% +\ifx\assig@given\@empty\else\ifx\assig@due\@empty\else{, }\fi\fi% +\ifx\assig@due\@empty\else{Due {\assig@due}}\fi% +\ifx\assig@given\@empty\else{\ifx\assig@due\@empty\else{#2}\fi}\fi} +\ifmultiple +\def\assignment@titleblock{% +\@ifundefined{assig@number}{\stepcounter{section}}{\setcounter{section}{\assig@number}}% +\section*{\protect\document@hwexamtype~\arabic{section}:~\assig@title\given@due{\\(})}% +\addcontentsline{toc}{section}{\document@hwexamtype~{\arabic{section}}:~\assig@title}% +\setcounter{problem}{0}} +\else +\def\assignment@titleblock{% +\setcounter{section}{\assig@number} +\begin{center}\bf +\Large\@title\\ +\document@hwexamtype~\assig@number:~\assig@title\strut\\ +\large{\given@due()} +\end{center}} +\fi +\def\assignment@process@keys#1{\metasetkeys{assig}{#1} +\ifx\inclassig@title\@empty\else\def\assig@title{\inclassig@title}\fi +\ifx\inclassig@type\@empty\else\def\assig@type{\inclassig@type}\fi +\ifx\inclassig@number\@empty\else\def\assig@number{\inclassig@number}\fi +\ifx\inclassig@due\@empty\else\def\assig@due{\inclassig@due}\fi +\ifx\inclassig@given\@empty\else\def\assig@given{\inclassig@given}\fi} +\def\inclassig@title{} +\def\inclassig@type{} +\def\inclassig@number{} +\def\inclassig@due{} +\def\inclassig@given{} +\newenvironment{assignment}[1][]{\assignment@process@keys{#1}% +\assignment@titleblock}{} +\def\assig@default@type{Assignment} +\addmetakey[\assig@default@type]{document}{hwexamtype} +\addmetakey{inclassig}{number} +\addmetakey{inclassig}{title} +\addmetakey{inclassig}{type} +\addmetakey{inclassig}{given} +\addmetakey{inclassig}{due} +\newcommand{\includeassignment}[2][]{\metasetkeys{inclassig}{#1}\include{#2}} +\newcommand{\inputassignment}[2][]{\metasetkeys{inclassig}{#1}\input{#2}} +\addmetakey{quizheading}{tas} +\newcommand\quizheading[1]{\def\@tas{#1}% +\large\noindent NAME: \hspace{8cm} MAILBOX:\\[2ex]% +\ifx\@tas\@empty\else% +\noindent TA: \@for\@I:=\@tas\do{{\Large$\Box$}\@I\hspace*{1em}}\\[2ex]\fi} +\addmetakey{testheading}{min} +\addmetakey{testheading}{duration} +\addmetakey{testheading}{reqpts} +\newenvironment{testheading}[1][]{\metasetkeys{testheading}{#1} +{\noindent\large{}Name: \hfill Matriculation Number:\hspace*{2cm}\strut\\[1ex] +\begin{center}\Large\textbf{\@title}\\[1ex]\large\@date\\[3ex]\end{center} +{\textbf{You have +\ifx\test@heading@duration\@empty\testheading@min minutes\else\testheading@duration\fi +(sharp) for the test}};\\ Write the solutions to the sheet.}\par\noindent + +\newcount\check@time\check@time=\testheading@min +\advance\check@time by -\theassignment@totalmin +The estimated time for solving this exam is {\theassignment@totalmin} minutes, +leaving you {\the\check@time} minutes for revising your exam. + +\newcount\bonus@pts\bonus@pts=\theassignment@totalpts +\advance\bonus@pts by -\testheading@reqpts +You can reach {\theassignment@totalpts} points if you solve all problems. You will only need +{\testheading@reqpts} points for a perfect score, i.e.\ {\the\bonus@pts} points are +bonus points. \vfill +\begin{center} + {\Large\em + Different problems test different skills and knowledge, so do not get stuck on + one problem.}\vfill\par\correction@table \\[3ex] +\end{center}} +{\newpage} +\def\testspace#1{\iftest\vspace*{#1}\fi} +\def\testnewpage{\iftest\newpage\fi} +\def\testemptypage{\iftest\begin{center}This page was intentionally left + blank for extra space\end{center}\vfill\eject\else\fi} +\def\@problem#1#2#3{\stepcounter{assignment@probs} +\def\@test{#2}\ifx\@test\@empty\else\addtocounter{assignment@totalpts}{#2}\fi +\def\@test{#3}\ifx\@test\@empty\else\addtocounter{assignment@totalmin}{#3}\fi +\xdef\correction@probs{\correction@probs & #1}% +\xdef\correction@pts{\correction@pts & #2} +\xdef\correction@reached{\correction@reached &}} +\newcounter{assignment@probs} +\newcounter{assignment@totalpts} +\newcounter{assignment@totalmin} +\def\correction@probs{prob.}% +\def\correction@pts{total}% +\def\correction@reached{reached}% +\stepcounter{assignment@probs} +\def\correction@table{\begin{tabular}{|l|*{\theassignment@probs}{c|}|p{3cm}|}\hline% +&\multicolumn{\theassignment@probs}{c||}% +{\footnotesize To be used for grading, do not write here} &\\\hline +\correction@probs & Sum & grade\\\hline +\correction@pts &\theassignment@totalpts & \strut\hspace{3cm}\strut\\\hline +\correction@reached & & \\[.7cm]\hline +\end{tabular}} +\endinput +%% +%% End of file `hwexam.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty.ltxml b/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty.ltxml new file mode 100644 index 00000000000..4532b9f2fb1 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/hwexam/hwexam.sty.ltxml @@ -0,0 +1,40 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +RequirePackage('problem'); +RegisterNamespace('assig'=>"http://omdoc.org/ontology/assignments#"); +RegisterDocumentNamespace('assig'=>"http://omdoc.org/ontology/assignments#"); +DefEnvironment('{assignment} OptionalKeyVals:assig', + "<omdoc:omgroup ?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')() " + . "assig:dummy='for the namespace'>" + . "<omdoc:metadata>" + . "<dc:title>" + . "Assignment ?&KeyVal(#1,'num')(&KeyVal(#1,'num').)()" + . "?&KeyVal(#1,'title')((&KeyVal(#1,'title')))" + . "</dc:title>" + . "?&KeyVal(#1,'given')(<omdoc:meta property='assig:given'>&KeyVal(#1,'given')</omdoc:meta>)()" + . "?&KeyVal(#1,'due')(<omdoc:meta property='assig:due'>&KeyVal(#1,'due')</omdoc:meta>)()" + . "?&KeyVal(#1,'pts')(<omdoc:meta property='assig:pts'>&KeyVal(#1,'pts')</omdoc:meta>)()" + . "</omdoc:metadata>" + . "#body" + ."</omdoc:omgroup>\n", + afterDigest=> sub { + my ($stomach, $kv) = @_; + my $kvi = LookupValue('inclassig'); + my @keys = qw(id num title pts given due); + my @vals = $kvi && map($kvi->getValue($_), @keys); + foreach my $i(0..$#vals) { + $kv->setValue($keys[$i],$vals[$i]) if $vals[$i]; + }});#$ +DefMacro('\includeassignment [] {}', sub { + my ($stomach, $arg1, $arg2) = @_; + AssignValue('inclassig',$arg1) if $arg1; + (Invocation(T_CS('\input'),$arg2)->unlist); +}); +DefMacro('\inputassignment [] {}','\input{#2}'); +DefEnvironment('{testheading}OptionalKeyVals:omdoc',''); +DefConstructor('\testspace{}',''); +DefConstructor('\testnewpage',''); +DefConstructor('\testemptypage',''); +1; diff --git a/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty b/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty new file mode 100644 index 00000000000..b499384e139 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty @@ -0,0 +1,63 @@ +%% +%% This is file `metakeys.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% metakeys.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{metakeys}[2012/01/28 v0.9 Framework for Metadata Keys] +\newif\ifmetakeys@showmeta\metakeys@showmetafalse +\DeclareOption{showmeta}{\metakeys@showmetatrue} +\ProcessOptions +\RequirePackage{keyval}[1997/11/10] +\newcommand\addmetakey{\@ifstar\addmetakey@star\addmetakey@nostar} +\newcommand\addmetakey@star[3][]% +{\@ifnextchar[{\addmetakey@star@aux[#1]{#2}{#3}}{\addmetakey@star@aux[#1]{#2}{#3}[]}} +\def\addmetakey@star@aux[#1]#2#3[#4]{\metakeys@ext@clear@keys{#2}{#3}{#1}% +\metakeys@initialize@showkeys{#2}% +\define@key{#2}{#3}[#4]{\expandafter\gdef\csname #2@#3\endcsname{##1}}} +\newcommand\addmetakey@nostar[3][]% +{\metakeys@ext@showkeys{#2}{#3}\addmetakey@star[#1]{#2}{#3}} +\newcommand\metasetkeys[2]{\@nameuse{clear@#1@keys}\setkeys{#1}{#2}% +\ifmetakeys@showmeta% +\edef\@@keys{\@nameuse{#1@showkeys}}% +\metakeys@show@keys{#1}{\@for\@I:=\@@keys\do{\metakeys@show@keyval{#1}{\@I}}}% +\fi} +\newcommand\metakeys@ext@clear@keys[3]{\@metakeys@ext@clear@keys{#1}{#1@#2}{#3}} +\newcommand\@metakeys@ext@clear@keys[3]{\@ifundefined{clear@#1@keys}% +{\expandafter\gdef\csname clear@#1@keys\endcsname% +{\expandafter\gdef\csname #2\endcsname{#3}}}% +{\expandafter\g@addto@macro\csname clear@#1@keys\endcsname% +{\expandafter\gdef\csname #2\endcsname{#3}}}} +\newcommand\addmetalistkey{\@ifstar\addmetalistkey@star\addmetalistkey@nostar} +\newcommand\addmetalistkey@star[3][]{\metakeys@ext@clear@keys{#2}{#3}{#1}% +\metakeys@initialize@showkeys{#2}% +\expandafter\gdef\csname #2@#3s\endcsname{} +\define@key{#2}{#3}[#1]{% +\expandafter\ifx\csname #2@#3s\endcsname\@empty\expandafter\gdef\csname #2@#3s\endcsname{##1}% +\else\expandafter\xdef\csname #2@#3s\endcsname{\csname #2@#3s\endcsname,##1}% +\fi}} +\newcommand\addmetalistkey@nostar[3][]% +{\metakeys@ext@showkeys{#2}{#3}\addmetalistkey@star[#1]{#2}{#3}} +\newcommand\metakeys@initialize@showkeys[1]% +{\@ifundefined{#1@showkeys}{\expandafter\def\csname #1@showkeys\endcsname{}}{}}% +\newcommand\metakeys@ext@showkeys[2]{\@ifundefined{#1@showkeys}% +{\expandafter\def\csname #1@showkeys\endcsname{#2}}% +{\expandafter\edef\csname #1@showkeys\endcsname{\csname #1@showkeys\endcsname,#2}}} +\newcommand\@metakeys@show@key[2]{\metakeys@show@key{#2}{#1}} +\newcommand\metakeys@show@key[2]{\edef\@test{#2}\ifx\@test\@empty\else #1:#2\quad\fi} +\newcommand\metakeys@show@keys[2]{\marginpar{{\scriptsize #2}}} +\newcommand\metakeys@show@keyval[2]% +{\expandafter\@metakeys@show@key\csname #1@#2\endcsname{#2}} +\newcommand\showmetakeys{\metakeys@showmetatrue} +\newcommand\hidemetakeys{\metakeys@showmetafalse} +\newcommand\addmetakeynew[3][]{\metakeys@ext@clear@keys{#2}{#3}{#1}% +\define@key{#2}{#3}{\expandafter\gdef\csname #2@#3\endcsname{##1}}} +\newcommand\metakeys@unspecified{an metakeys-defined key left unspecified} +\newcommand\metakeysifus[4]{\message{testing #1@#2=\csname#1@#2\endcsname}% +\expandafter\ifx\csname #1@#2\endcsname\metakeys@unspecified{#3}\else{#4}\fi} +\endinput +%% +%% End of file `metakeys.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty.ltxml b/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty.ltxml new file mode 100644 index 00000000000..b07f809f8e9 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/metakeys/metakeys.sty.ltxml @@ -0,0 +1,3 @@ +DefConstructor('\showmetakeys',''); +DefConstructor('\hidemetakeys',''); +1; diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/beamerthemeJacobs.sty b/Master/texmf-dist/tex/latex/stex/mikoslides/beamerthemeJacobs.sty new file mode 100644 index 00000000000..dac52637b13 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/mikoslides/beamerthemeJacobs.sty @@ -0,0 +1,64 @@ +% Beamer Jacobs slide theme; some hints from CXL's DFKI theme included +% +% (C) 2009 Michael Kohlhase <m.kohlhase@jacobs-university.de. + +\ProvidesPackage{beamerthemeJacobs} +\typeout{Beamer KWARC theme} +\author[Kohlhase]{Michael Kohlhase} +\institute{\texttt{http://kwarc.info/kohlhase}\\ + Center for Advanced Systems Engineering\\ + Jacobs University Bremen, Germany} + +\mode<presentation> + +%% Shadings and logo images +\pgfdeclareimage[height=.5ex,width=113mm]{shade-l2r}{shading-l2r} +\pgfdeclareimage[height=2ex]{jacobslogo}{jacobs-logo} +\pgfdeclareimage[height=2ex]{cclogo}{cc_somerights} + +%% Headers flushed to the left. +\setbeamertemplate{frametitle}[default][left] + + +%% Add the line below the header +\addtobeamertemplate{frametitle}{}{\hspace*{-1cm} % + \begin{pgfpicture}{0cm}{0cm}{128mm}{2mm} + \pgfputat{\pgforigin}{\pgfbox[left,bottom]{\pgfuseimage{shade-l2r}}} + \end{pgfpicture} + } + +\setbeamertemplate{footline}[text line]{% + \usebeamercolor[fg]{titlelike} + \strut\hspace*{2cm}\insertshortauthor: \insertshorttitle\hfill{}% + \insertframenumber\hfill\insertshortdate\hspace*{3cm}% + } + \addtobeamertemplate{footline}{ % + \begin{pgfpicture}{0cm}{0cm}{128mm}{0mm} % + \pgfputat{\pgfpoint{126mm}{1mm}}{\pgfbox[right,top]{\pgfuseimage{jacobslogo}}} % + \pgfputat{\pgfpoint{10mm}{1mm}}{\pgfbox[right,top]{\pgfuseimage{cclogo}}} % + \end{pgfpicture}}{} + +%% Turn off the navigation symbols +\setbeamertemplate{navigation symbols}{} + +%% Inner theme +\useinnertheme{circles} + +%% Big logo for the title page. +%\pgfdeclareimage[height=1cm]{biglogo}{beamer/img/DFKI-SKS} +%\titlegraphic{\pgfuseimage{biglogo}} + + +\mode +<all> + +%% Redefine various margin sizes +\setbeamersize{text margin left=3mm} +\setbeamersize{text margin right=3mm} +\setlength\leftmargini{1em} +\setlength\leftmarginii{1em} +\setlength\leftmarginiii{1em} +\newcommand{\vstretch}[1]{\vspace*{\stretch{#1}}} +\beamer@descriptionwidth=1cm + + diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/cc-by-sa.png b/Master/texmf-dist/tex/latex/stex/mikoslides/cc-by-sa.png Binary files differnew file mode 100644 index 00000000000..f0a944e0b89 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/mikoslides/cc-by-sa.png diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/cc_somerights.png b/Master/texmf-dist/tex/latex/stex/mikoslides/cc_somerights.png Binary files differnew file mode 100644 index 00000000000..fd7d3c7f33c --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/mikoslides/cc_somerights.png diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/dangerous-bend.png b/Master/texmf-dist/tex/latex/stex/mikoslides/dangerous-bend.png Binary files differnew file mode 100644 index 00000000000..fbcfefa5d97 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/mikoslides/dangerous-bend.png diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/jacobs-logo.png b/Master/texmf-dist/tex/latex/stex/mikoslides/jacobs-logo.png Binary files differnew file mode 100644 index 00000000000..0bbe28c44fc --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/mikoslides/jacobs-logo.png diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/mikoaffiliation.sty b/Master/texmf-dist/tex/latex/stex/mikoslides/mikoaffiliation.sty new file mode 100644 index 00000000000..3004b99b7ba --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/mikoslides/mikoaffiliation.sty @@ -0,0 +1,54 @@ +\RequirePackage[ngerman,USenglish]{babel} + +\newcommand{\mikoand}[1]% joint work with +{{\large\sc Michael Kohlhase}\\{\normalsize\green{joint work with #1}}\\[1ex]\mikoaffiliation} + +\newcommand{\miko} +{{\large\sc Michael Kohlhase}\\[1ex] +\JacobsAffiliation} + +\newcommand{\mikoJacobsDFKI}{\mikoJacobsDfki} +\newcommand{\mikoJacobsDfki} +{{\large\sc Michael Kohlhase}\\[1ex] +\JacobsDfkiAffiliation} + +\newcommand{\JacobsAffiliation} +{{\begin{small} + Computer Science\\ + School of Engineering \& Science \\ + Jacobs University Bremen, Germany \\ + \end{small}} +{\color{black}\normalsize\url{http://kwarc.info/kohlhase}}} + +\newcommand{\mikoboth} +{\begin{creator} +{\large\sc Michael Kohlhase}\\[1ex] +{\small\begin{tabular}{c@{\qquad}c} +School of Engineering \& Science & School of Computer Science \\ +Jacobs University Bremen & Carnegie Mellon yUniversity +\end{tabular}} +{\color{black}\normalsize\url{http://kwarc.info/kohlhase}} +\end{creator}} + +\newcommand{\JacobsDfkiAffiliation} +{\begin{small} +\begin{tabular}{c@{\qquad}c} +Computer Science +&\iflanguage{german}{Sichere Kognitive Systeme}{Safe and Secure Cognitive Systems} \\ +%School of Engineering \& Science +%& DFKI Bremen\\ +Jacobs University, Bremen +&\iflanguage{german}{Deutsches Forschungszentrum f\"ur KI}{German Research Center for AI}\\ +\end{tabular} +\end{small} +{\color{black}\normalsize\url{http://kwarc.info/kohlhase}}} + +\newcommand{\mikocmu} +{\begin{creator} +{\large\sc Michael Kohlhase}\\[1ex] +{\small\begin{tabular}{c} +School of Computer Science \\ +Carnegie Mellon University \\ +\end{tabular}}\\ +{\color{black}\normalsize\url{http://kwarc.info/kohlhase}} +\end{center}} diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/mikoaffiliation.sty.ltxml b/Master/texmf-dist/tex/latex/stex/mikoslides/mikoaffiliation.sty.ltxml new file mode 100644 index 00000000000..591d7469f24 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/mikoslides/mikoaffiliation.sty.ltxml @@ -0,0 +1,25 @@ +# -*- CPERL -*- +# /=====================================================================\ # +# | quiz.sty | # +# | Implementation for LaTeXML | # +# |=====================================================================| # +# | Not (yet) Part of LaTeXML: | # +# | Copyright (c) 2004 Michael Kohlhase, released under the | # +# |---------------------------------------------------------------------| # +# | $URL: svn://kwarc.faculty.iu-bremen.de/kohlhase/kwarc/projects/content/cnx/xsl/latexml.xsl$ +# | $Revision: 9990 $; last modified by $Author: $ +# | $Date: 2006-09-20 13:31:37 +0200 (Wed, 20 Sep 2006) $ +# |---------------------------------------------------------------------| # +# | Michael Kohlhase <m.kohlhase@iu-bremen.de> #_# | # +# | http://dlmf.nist.gov/LaTeXML/ (o o) | # +# \=========================================================ooo==U==ooo=/ # +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; + +DefConstructor('\miko',"<author><name>Michael Kohlhase</name><affiliation>School of Engineering & Sciences International University Bremen, Germany </affiliation></author>"); +#********************************************************************** +# To be extended/experimental + +#********************************************************************** +1; diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/mikoslides.cls b/Master/texmf-dist/tex/latex/stex/mikoslides/mikoslides.cls new file mode 100644 index 00000000000..1c835a37c29 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/mikoslides/mikoslides.cls @@ -0,0 +1,115 @@ +%% +%% This is file `mikoslides.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% mikoslides.dtx (with options: `cls') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesClass{mikoslides}[2012/01/28 v0.9 Jacobs slides] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\newif\ifnotes\notesfalse +\newif\ifsectocframes\sectocframesfalse +\newif\ifproblems\problemstrue +\DeclareOption{notes}{\notestrue} +\DeclareOption{slides}{\notesfalse} +\DeclareOption{noproblems}{\problemsfalse} +\DeclareOption{sectocframes}{\sectocframestrue} +\ifnotes +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{omdoc}} +\else +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{beamer}} +\fi +\ProcessOptions +\ifnotes +\LoadClass{omdoc} +\RequirePackage{a4wide} +\RequirePackage{marginnote} +\RequirePackage[notheorems,noamsthm]{beamerarticle} +\else +\LoadClass[notheorems,noamsthm,10pt]{beamer} +\newcounter{Item} +\newcounter{paragraph} +\newcounter{subparagraph} +\newcounter{Hfootnote} +\usetheme{Jacobs} +\fi +\RequirePackage{stex} +\RequirePackage{latexml} +\RequirePackage{amssymb} +\RequirePackage{tikz} +\usepgflibrary{shapes}\usetikzlibrary{arrows} +\RequirePackage{url} +\RequirePackage{amsmath} +\RequirePackage{comment} +\RequirePackage{standalone} +\newcounter{slide} +\newlength{\slidewidth}\setlength{\slidewidth}{13.5cm} +\newlength{\slideheight}\setlength{\slideheight}{9cm} +\ifnotes\renewenvironment{note}{}{}\else\excludecomment{note}\fi +\ifnotes +\newlength{\slideframewidth}\setlength{\slideframewidth}{2pt} +\newsavebox{\myframebox} +\renewenvironment{frame}[1][]% +{\stepcounter{slide} +\def\itemize@level{outer} +\def\itemize@outer{outer} +\def\itemize@inner{inner} +\renewcommand\metakeys@show@keys[2]{\marginnote{{\scriptsize ##2}}} +\renewenvironment{itemize} +{\ifx\itemize@level\itemize@outer\def\itemize@label{$\rhd$}\fi + \ifx\itemize@level\itemize@inner\def\itemize@label{$\scriptstyle\rhd$}\fi + \begin{list} + {\itemize@label} + {\setlength{\labelsep}{.3em}\setlength{\labelwidth}{.5em}\setlength{\leftmargin}{1.5em}} + \edef\itemize@level{\itemize@inner}} +{\end{list}} + \noindent\hfill\begin{lrbox}{\myframebox} + \begin{minipage}{\slidewidth}\sf}% + {\miko@slidelabel\end{minipage}\end{lrbox}% + \begin{center}\fbox{\usebox\myframebox}\end{center}\hfill} +\renewcommand{\frametitle}[1]{{\Large\bf\sf\color{blue}{#1}}} +\fi +\makeindex +\ifproblems\newenvironment{problems}{}{}\else\excludecomment{problems}\fi +\newlength{\slidelogoheight} +\ifnotes\setlength{\slidelogoheight}{.4cm}\else\setlength{\slidelogoheight}{1cm}\fi +\newsavebox{\slidelogo}\sbox{\slidelogo}{\includegraphics[height=\slidelogoheight]{jacobs-logo}} +\def\source{Michael Kohlhase}% customize locally +\def\copyrightnotice{\footnotesize\copyright:\hspace{.3ex}{\source}} +\newsavebox{\cclogo}\sbox{\cclogo}{\includegraphics[height=\slidelogoheight]{cc_somerights}} +\newif\ifcchref\cchreffalse +\AtBeginDocument{\@ifpackageloaded{hyperref}{\cchreftrue}{\cchreffalse}} +\def\licensing{\ifcchref\href{http://creativecommons.org/licenses/by-sa/2.5/}{\usebox{\cclogo}}\else{\usebox{\cclogo}}\fi} +\newcommand{\miko@slidelabel}% +{\vbox to \slidelogoheight{\vss\hbox to \slidewidth% +{\licensing\hfill\copyrightnotice\hfill\arabic{slide}\hfill\usebox{\slidelogo}}}} +\AtBeginDocument{\definecolor{green}{rgb}{0,.5,0}\definecolor{purple}{cmyk}{.3,1,0,.17}} +\def\defemph#1{{\textcolor{magenta}{#1}}} +\def\notemph#1{{\textcolor{magenta}{#1}}} +\def\stDMemph#1{{\textcolor{blue}{#1}}} +\def\@@lec#1{(\textcolor{green}{#1})} +\pgfdeclareimage[width=1.5em]{miko@dbend}{dangerous-bend} +\def\textwarning{\raisebox{-.05cm}{\pgfuseimage{miko@dbend}}\xspace} +\newcommand\titleframe{\begin{frame}\titlepage\end{frame}} +\newenvironment{titleframewith}{\begin{frame}\titlepage}{\end{frame}} +\newenvironment{ttitle}{\begin{center}\LARGE\begin{tabular}{|c|}\hline}% + {\\\hline\end{tabular}\end{center}\vspace{1ex minus 1ex}} +\newenvironment{ttitlejoint}[1]% +{\newbox\boxwith\setbox\boxwith\hbox{\begin{tabular}{c}{\em joint work with}\\#1\end{tabular}}% +\begin{center}\LARGE\begin{tabular}{c}\color{red}}% +{\\\box\boxwith\end{tabular}\end{center}% +\vspace{1ex minus 1ex}} +\newcommand{\putgraphicsat}[3]{% + \begin{picture}(0,0)\put(#1){\includegraphics[#2]{#3}}\end{picture}} +\newcommand{\putat}[2]{\begin{picture}(0,0)\put(#1){#2}\end{picture}} +\ifsectocframes +\def\at@begin@omgroup#1{\message{atbeginomgroup}\begin{frame}<beamer>\frametitle{Outline}\tableofcontents[section]\end{frame}} +\fi +\newcommand\tikzinput[2][]{\input{#2}} + +\ifnotes\else\sf\fi +\endinput +%% +%% End of file `mikoslides.cls'. diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/mikoslides.cls.ltxml b/Master/texmf-dist/tex/latex/stex/mikoslides/mikoslides.cls.ltxml new file mode 100644 index 00000000000..c08d03888b1 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/mikoslides/mikoslides.cls.ltxml @@ -0,0 +1,94 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +RawTeX('\newif\ifnotes\notesfalse'); +RawTeX('\newif\ifproblems\problemsfalse'); +LoadClass('omdoc'); +DefConstructor('\usetheme{}',''); +RequirePackage('stex'); +RequirePackage('latexml'); +RequirePackage('amssymb'); +RequirePackage('graphicx'); +RequirePackage('tikz'); +RequirePackage('amsmath'); +DefRegister('\slidewidth' => Dimension('13.5cm')); +DefRegister('\slideheight' => Dimension('9cm')); +DefEnvironment('{note}','#body'); +DefEnvironment('{frame}[]', + "<omdoc:omgroup layout='slide'>" + . "#body\n" + ."</omdoc:omgroup>\n\n", + afterDigestBegin=>sub { + $_[1]->setProperty(theory=>LookupValue('current_module')); }); +DefConstructor('\frametitle{}', + "\n<omdoc:metadata><dc:title>#1</dc:title></omdoc:metadata>"); +DefEnvironment('{problems}','#body'); +#DefMacro('\defemph{}','{\textcolor{magenta}{#1}}'); +#DefMacro('\notemph{}','{\textcolor{magenta}{#1}}'); +DefMacro('\textwarning',""); +DefMacro('\title[]{}', '\@add@frontmatter{ltx:title}{#1}'); +DefMacro('\date[]{}', '\@add@frontmatter{ltx:date}[role=creation]{#1}'); +DefMacro('\author[]{}', sub { andSplit(T_CS('\@author'),$_[1]); });#$ +DefConstructor('\titleframe',"<omdoc:ignore>titleframe elided here</omdoc:ignore>"); +DefEnvironment('{titleframewith}', + "<omdoc:ignore>begin elided titleframe</omdoc:ignore>" + . "#body" + ."<omdoc:ignore>end elided titleframe</omdoc:ignore>"); +DefEnvironment('{titleslide}',""); +DefEnvironment('{titleslide}',"<omdoc:omgroup>#body</omdoc:omgroup>"); +DefEnvironment('{ttitle}', "\n<dc:title>#body</dc:title>"); +DefMacro('\tikzinput[] {}','\includegraphics[#1]{#2}'); + +DefEnvironment('{columns}','#body'); +DefEnvironment('{column}{}','#body'); +DefConstructor('\uncover','#1'); +#Define a Beamer Overlay Parameter type + DefParameterType('BeamerOverlay', sub { + my ($gullet) = @_; + my $tok = $gullet->readXToken; + if (ref $tok && ToString($tok) eq '<') { + $gullet->readUntil(T_OTHER('>')); + } else { + $gullet->unread($tok) if ref $tok; + undef; }}, + reversion=> sub { + (T_OTHER('<'), $_[0]->revert, T_OTHER('>')); + }); + +#Take the "from" field of the overlay range +sub overlayFrom { + return "" unless defined $_[0]; + my $overlay=ToString($_[0]); $overlay =~ /^(\d+)/; $1;} + +#Reuse the CMP itemizations, only adjust the \item constructors. +DefMacro('\beamer@group@item[] OptionalBeamerOverlay IfBeginFollows', sub { + my($gullet,$tag,$overlay,$needwrapper)=@_; + $overlay=$overlay||T_OTHER(""); + ( T_CS('\group@item@maybe@unwrap'), + ($needwrapper ? (Invocation(T_CS('\beamer@group@item@wrap'),$tag,$overlay)->unlist) : ()) ); }); +DefConstructor('\beamer@group@item@wrap {} OptionalBeamerOverlay', + "<omdoc:omtext ?#2(overlay='&overlayFrom(#2)')()>" + . "?#1(<dc:title>#1</dc:title>)()" + . "<omdoc:CMP>", + beforeDigest=>sub { + Let('\group@item@maybe@unwrap','\group@item@unwrap'); + #$_[0]->bgroup; +return; }, + properties=>sub{ RefStepItemCounter(); }); + +#DefConstructor('\beamer@itemize@item[] OptionalBeamerOverlay', +# "<omdoc:li ?#2(overlay='&overlayFrom(#2)')() >" +# . "?#1(<dc:title>#1</dc:title>)()", +# properties=>sub{ RefStepItemCounter(); }); +DefConstructor('\beamer@enumerate@item[] OptionalBeamerOverlay', + "<omdoc:li ?#2(overlay='&overlayFrom(#2)')() >" + . "?#1(<dc:title>#1</dc:title>)()", + properties=>sub{ RefStepItemCounter(); }); +DefConstructor('\beamer@description@item[] OptionalBeamerOverlay', + "<omdoc:di ?#2(overlay='&overlayFrom(#2)')() >" + . "?#1(<omdoc:dt>#1</omdoc:dt>)()<omdoc:dd>", # trust di and dt to autoclose + properties=>sub{ RefStepItemCounter(); }); +DefMacro('\putgraphicsat{}{}{}','\mygraphics[#2]{#3}'); +DefMacro('\putat{}{}','#2'); +1; diff --git a/Master/texmf-dist/tex/latex/stex/mikoslides/shading-l2r.png b/Master/texmf-dist/tex/latex/stex/mikoslides/shading-l2r.png Binary files differnew file mode 100644 index 00000000000..2eabe7a8b17 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/mikoslides/shading-l2r.png diff --git a/Master/texmf-dist/tex/latex/stex/modules/modules.sty b/Master/texmf-dist/tex/latex/stex/modules/modules.sty new file mode 100644 index 00000000000..8ee9fda5172 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/modules/modules.sty @@ -0,0 +1,262 @@ +%% +%% This is file `modules.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% modules.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{modules}[2012/01/28 v1.1 Semantic Markup] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\newif\ifmod@show\mod@showfalse +\DeclareOption{showmods}{\mod@showtrue} +\newif\ifmod@qualified\mod@qualifiedfalse +\DeclareOption{qualifiedimports}{\mod@qualifiedtrue} +\ProcessOptions +\RequirePackage{sref} +\RequirePackage{xspace} +\RequirePackage{xcomment} +\addmetakey{module}{cd} +\addmetakey{module}{title} +\define@key{module}{id}{% +\edef\this@module{\expandafter\noexpand\csname module@defs@#1\endcsname}% +\global\@namedef{module@defs@#1}{}% +\ifmod@qualified +\edef\this@qualified@module{\expandafter\noexpand\csname module@defs@qualified@#1\endcsname}% +\global\@namedef{module@defs@qualified@#1}{}% +\fi +\def\mod@id{#1}% +\expandafter\edef\csname #1@cd@file@base\endcsname{\mod@path}% +\expandafter\g@addto@macro\csname module@defs@#1\expandafter\endcsname\expandafter% +{\expandafter\def\csname #1@cd@file@base\expandafter\endcsname\expandafter{\mod@path}}} +\newcounter{module}[section] +\newcommand\module@heading{\stepcounter{module}% +\noindent{\textbf{Module} \thesection.\themodule [\mod@id]}% +\sref@label@id{Module \thesection.\themodule [\mod@id]}% +\ifx\module@title\@empty :\quad\else\quad(\module@title)\hfill\\\fi} +\newcommand\module@footer{\noindent{\textbf{EndModule} \thesection.\themodule}} +\newenvironment{module}[1][]% +{\metasetkeys{module}{#1}\ifmod@show\module@heading\fi} +{\ifmod@show\module@footer\fi} +\def\activate@defs#1{\csname module@defs@#1\endcsname} +\def\export@defs#1{\@ifundefined{mod@id}{}% +{\expandafter\expandafter\expandafter\g@addto@macro\expandafter% +\this@module\expandafter{\csname module@defs@#1\endcsname}}} +\def\coolurion{} +\def\coolurioff{} +\newcommand{\importmodule}[2][]{{\def\mod@path{#1}% +\ifx\mod@path\@empty\else\requiremodules{#1}\fi}% +\activate@defs{#2}\export@defs{#2}} +\newenvironment{importmodulevia}[2][]{\gdef\@@doit{\importmodule[#1]{#2}}% +\ifmod@show\par\noindent importing module #2 via \@@doit\fi} +{\aftergroup\@@doit\ifmod@show end import\fi} +\newcommand\vassign[2]{\ifmod@show\ensuremath{#1\mapsto #2}, \fi} +\newcommand\tassign[3][]{\ifmod@show #2\ensuremath{\mapsto} #3, \fi} +\newcommand\ttassign[3][]{\ifmod@show #1\ensuremath{\mapsto} ``#2'', \fi} +\newcommand{\importOMDocmodule}[3][]{\importmodule[#1]{#3}} +\let\metalanguage=\importmodule +\def\mod@newcommand{\@star@or@long\mod@new@command} +\def\mod@new@command#1{\@testopt{\@mod@newcommand#1}0} +\def\@mod@newcommand#1[#2]{\kernel@ifnextchar [{\mod@xargdef#1[#2]}{\mod@argdef#1[#2]}} +\long\def\mod@argdef#1[#2]#3{\@yargdef#1\@ne{#2}{#3}} +\long\def\mod@xargdef#1[#2][#3]#4{\expandafter\def\expandafter#1\expandafter{% +\expandafter\@protected@testopt\expandafter #1\csname\string#1\endcsname{#3}}% +\expandafter\@yargdef\csname\string#1\endcsname\tw@{#2}{#4}} +\newif\if@symdeflocal +\define@key{symdef}{local}[true]{\@symdeflocaltrue} +\define@key{symdef}{name}{} +\define@key{symdef}{assocarg}{} +\define@key{symdef}{bvars}{} +\define@key{symdef}{bvar}{} +\define@key{symdef}{bindargs}{} +\def\symdef{\@ifnextchar[{\@symdef}{\@symdef[]}} +\def\@symdef[#1]#2{\@ifnextchar[{\@@symdef[#1]{#2}}{\@@symdef[#1]{#2}[0]}} +\def\@mod@nc#1{\mod@newcommand{#1}[1]} +\def\@@symdef[#1]#2[#3]#4{% +\@symdeflocalfalse\setkeys{symdef}{#1}% +\expandafter\mod@newcommand\csname modules@#2@pres@\endcsname[#3]{#4}% +\expandafter\def\csname #2\endcsname% +{\@ifnextchar[{\csname modules@#2\endcsname}{\csname modules@#2\endcsname[]}}% +\expandafter\def\csname modules@#2\endcsname[##1]% +{\csname modules@#2@pres@##1\endcsname}% +\expandafter\@mod@nc\csname mod@symref@#2\expandafter\endcsname\expandafter% +{\expandafter\mod@termref\expandafter{\mod@id}{#2}{##1}}% +\if@symdeflocal\else% +\@ifundefined{mod@id}{}{% +\expandafter\g@addto@macro\this@module% +{\expandafter\mod@newcommand\csname modules@#2@pres@\endcsname[#3]{#4}}% +\expandafter\g@addto@macro\this@module% +{\expandafter\def\csname#2\endcsname% +{\@ifnextchar[{\csname modules@#2\endcsname}{\csname modules@#2\endcsname[]}}}% +\expandafter\g@addto@macro\this@module% +{\expandafter\def\csname modules@#2\endcsname[##1]% +{\csname modules@#2@pres@##1\endcsname}}% +\expandafter\g@addto@macro\csname module@defs@\mod@id\expandafter\endcsname\expandafter% +{\expandafter\@mod@nc\csname mod@symref@#2\expandafter\endcsname\expandafter% +{\expandafter\mod@termref\expandafter{\mod@id}{#2}{##1}}}% +\ifmod@qualified% +\expandafter\g@addto@macro\this@qualified@module% +{\expandafter\mod@newcommand\csname modules@#2@pres@qualified\endcsname[#3]{#4}}% +\expandafter\g@addto@macro\this@qualified@module% +{\expandafter\def\csname#2atqualified\endcsname{\csname modules@#2@pres@qualified\endcsname}}% +\fi% +}\fi} +\define@key{DefMathOp}{name}{\def\defmathop@name{#1}} +\newcommand\DefMathOp[2][]{% +\setkeys{DefMathOp}{#1}% +\symdef[#1]{\defmathop@name}{#2}} +\def\symvariant#1{\@ifnextchar[{\@symvariant{#1}}{\@symvariant{#1}[0]}} +\def\@symvariant#1[#2]#3#4{% +\expandafter\mod@newcommand\csname modules@#1@pres@#3\endcsname[#2]{#4}% +\@ifundefined{mod@id}{}{% +\expandafter\g@addto@macro\this@module% +{\expandafter\mod@newcommand\csname modules@#1@pres@#3\endcsname[#2]{#4}}}}% +\def\resymdef{\@ifnextchar[{\@resymdef}{\@resymdef[]}} +\def\@resymdef[#1]#2{\@ifnextchar[{\@@resymdef[#1]{#2}}{\@@resymdef[#1]{#2}[0]}} +\def\@@resymdef[#1]#2[#3]#4{\PackageError{modules} + {The \protect\resymdef macro is deprecated,\MessageBreak + use the \protect\symvariant instead!}} +\let\abbrdef\symdef +\def\mod@path{} +\def\mod@true{true} +\addmetakey[false]{termdef}{local} +\addmetakey{termdef}{name} +\newcommand{\termdef}[3][]{\metasetkeys{termdef}{#1}% +\expandafter\mod@newcommand\csname#2\endcsname[0]{#3\xspace}% +\ifx\termdef@local\mod@true\else% +\@ifundefined{mod@id}{}{\expandafter\g@addto@macro\this@module% +{\expandafter\mod@newcommand\csname#2\endcsname[0]{#3\xspace}}}% +\fi} +\def\@captitalize#1{\uppercase{#1}} +\newcommand\capitalize[1]{\expandafter\@captitalize #1} +\def\mod@termref#1#2#3{\def\@test{#3} +\@ifundefined{#1@cd@file@base} + {\protect\G@refundefinedtrue + \@latex@warning{\protect\termref with unidentified cd "#1": the cd key must + reference an active module} + \def\@label{sref@#2 @target}} + {\def\@label{sref@#2@#1@target}}% +\expandafter\ifx\csname #1@cd@file@base\endcsname\@empty% local reference +\sref@hlink@ifh{\@label}{\ifx\@test\@empty #2\else #3\fi}\else% +\def\@uri{\csname #1@cd@file@base\endcsname.pdf\#\@label}% +\sref@href@ifh{\@uri}{\ifx\@test\@empty #2\else #3\fi}\fi} +\def\mod@simplify#1{\expandafter\mod@simpl#1/\relax} +\def\mod@simpl#1/#2\relax{\def\@second{#2}% +\ifx\mod@blaaaa\@empty\edef\mod@savedprefix{}\def\mod@blaaaa{aaa}\else\fi% +\ifx\@second\@empty\edef\mod@savedprefix{\mod@savedprefix#1}% +\else\mod@simplhelp#1/#2\relax\fi} +\def\mod@updir{..} +\def\mod@simplhelp#1/#2/#3\relax{\def\@first{#1}\def\@second{#2}\def\@third{#3}% +\ifx\@third\@empty% base case +\ifx\@second\mod@updir\else% + +\ifx\mod@second\@empty\edef\mod@savedprefix{\mod@savedprefix#1}% +\else\edef\mod@savedprefix{\mod@savedprefix#1/#2}% +\fi% +\fi% +\else% +\ifx\@first\mod@updir% +\edef\mod@savedprefix{\mod@savedprefix#1/}\mod@simplhelp#2/#3\relax% +\else% +\ifx\@second\mod@updir\mod@simpl#3\relax% +\else\edef\mod@savedprefix{\mod@savedprefix#1/}\mod@simplhelp#2/#3\relax% +\fi% +\fi% +\fi}% +\newcommand{\defpath}[2]{\expandafter\newcommand\csname #1\endcsname[1]{#2/##1}} +\newif\ifmodules +\gdef\mod@reg{} +\def\mod@update#1{\ifx\mod@reg\@empty\xdef\mod@reg{#1}\else\xdef\mod@reg{#1@\mod@reg}\fi} +\def\mod@check#1@#2///#3\relax{% +\def\mod@one{#1}\def\mod@two{#2}\def\mod@three{#3}% +\expandafter% +\ifx\mod@three\mod@one\modulestrue% +\else% +\ifx\mod@two\@empty\modulesfalse\else\mod@check#2///#3\relax\fi% +\fi} +\def\mod@search#1{% +\modulesfalse\expandafter\mod@check\mod@reg @///#1\relax% +\ifmodules\else\mod@update{#1}\fi} +\def\mod@reguse#1{\modulesfalse\expandafter\mod@check\mod@reg @///#1\relax} +\def\mod@prefix{} +\def\mod@updatedpre#1{% +\edef\mod@prefix{\mod@prefix\mod@pathprefix@check#1/\relax}} +\def\mod@pathprefix@check#1/#2\relax{% +\ifx\\#2\\% no slash in string +\else\mod@ReturnAfterFi{#1/\mod@pathprefix@help#2\relax}% +\fi} +\def\mod@pathprefix@help#1/#2\relax{% +\ifx\\#2\\% end of recursion +\else\mod@ReturnAfterFi{#1/\mod@pathprefix@help#2\relax}% +\fi} +\long\def\mod@ReturnAfterFi#1\fi{\fi#1} +\def\mod@pathpostfix@check#1/#2\relax{% slash +\ifx\\#2\\%no slash in string +#1\else\mod@ReturnAfterFi{\mod@pathpostfix@help#2\relax}% +\fi} +\def\mod@pathpostfix@help#1/#2\relax{% +\ifx\\#2\\% +#1\else\mod@ReturnAfterFi{\mod@pathpostfix@help#2\relax}% +\fi} +\def\mod@updatedpost#1{% +\edef\mod@savedprefix{\mod@savedprefix\mod@pathpostfix@check#1/\relax}} +\def\mod@updatesms{\edef\mod@savedprefix{\mod@savedprefix.sms}} +\newcommand\requiremodules[1]{% +{\mod@showfalse% save state and ensure silence while reading sms +\mod@updatedpre{#1}% add the new file to the already existing path +\let\mod@savedprefix\mod@prefix% add the path to the new file to the prefix +\mod@updatedpost{#1}% +\def\mod@blaaaa{}% macro used in the simplify function (remove .. from the prefix) +\mod@simplify{\mod@savedprefix}% remove |xxx/..| from the path (in case it exists) +\mod@reguse{\mod@savedprefix}% +\ifmodules\else% +\mod@updatesms% update the file to contain the .sms extension +\let\newreg\mod@reg% use to compare, in case the .sms file was loaded before +\mod@search{\mod@savedprefix}% update registry +\ifx\newreg\mod@reg\else\input{\mod@savedprefix}\fi% check if the registry was updated and load if necessary +\fi}} +\def\sinput#1{ +{\mod@updatedpre{#1}% add the new file to the already existing path +\let\mod@savedprefix\mod@prefix% add the path to the new file to the prefix +\mod@updatedpost{#1}% +\def\mod@blaaaa{}% macro used in the simplify function (remove .. from the prefix) +\mod@simplify{\mod@savedprefix}% remove |xxx/..| from the path (in case it exists) +\mod@reguse{\mod@savedprefix}% +\let\newreg\mod@reg% use to compare, in case the .sms file was loaded before +\mod@search{\mod@savedprefix}% update registry +\ifx\newreg\mod@reg%\message{This file has been previously introduced} +\else\input{\mod@savedprefix}% +\fi}} +\let\sinputref=\sinput +\let\inputref=\input +\def\requirepackage#1#2{\makeatletter\input{#1.sty}\makeatother} +\srefaddidkey{view} +\addmetakey*{view}{title} +\define@key{view}{load}{\requiremodules{#1}} +\newcounter{view}[section] +\newcommand\view@heading[2]{\stepcounter{view}% +{\textbf{View} \thesection.\theview: from #1 to #2}% +\sref@label@id{View \thesection.\theview}% +\ifx\view@title\@empty :\quad\else\quad(\view@title)\hfill\\\fi} +\ifmod@show\newsavebox{\viewbox} +\newenvironment{view}[3][]{\metasetkeys{view}{#1}\sref@target\stepcounter{view} +\begin{lrbox}{\viewbox}\begin{minipage}{.9\textwidth} +\importmodule{#1}\importmodule{#2}\gdef\view@@heading{\view@heading{#2}{#3}}} +{\end{minipage}\end{lrbox} +\setbox0=\hbox{\begin{minipage}{.9\textwidth}% +\noindent\view@@heading\rm% +\end{minipage}} +\smallskip\noindent\fbox{\vbox{\box0\vspace*{.2em}\usebox\viewbox}}\smallskip} +\else\newxcomment[]{view}\fi%ifmod@show +\define@key{module}{uses}{% +\@for\module@tmp:=#1\do{\activate@defs\module@tmp\export@defs\module@tmp}} +\define@key{module}{usesqualified}{% +\@for\module@tmp:=#1\do{\activate@defs{qualified@\module@tmp}\export@defs\module@tmp}} +\def\csymdef{\@ifnextchar[{\@csymdef}{\@csymdef[]}} +\def\@csymdef[#1]#2{\@ifnextchar[{\@@csymdef[#1]{#2}}{\@@csymdef[#1]{#2}[0]}} +\def\@@csymdef[#1]#2[#3]#4#5{\@@symdef[#1]{#2}[#3]{#4}} +\def\notationdef[#1]#2#3{} +\endinput +%% +%% End of file `modules.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/modules/modules.sty.ltxml b/Master/texmf-dist/tex/latex/stex/modules/modules.sty.ltxml new file mode 100644 index 00000000000..23da85ab9ea --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/modules/modules.sty.ltxml @@ -0,0 +1,624 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Global; +use LaTeXML::Package; +DefKeyVal('Module','id','Semiverbatim'); +DefKeyVal('Module','cd','Semiverbatim'); +DefEnvironment('{module} OptionalKeyVals:Module', + "?#excluded()(<omdoc:theory " + . "?&defined(&KeyVal(#1,'id'))(xml:id='&KeyVal(#1,'id')')(xml:id='#id')>#body</omdoc:theory>)", +# beforeDigest=>\&useTheoryItemizations, + afterDigestBegin=>sub { + my($stomach, $whatsit)=@_; + $whatsit->setProperty(excluded=>LookupValue('excluding_modules')); + + my $keys = $whatsit->getArg(1); + my($id, $cd)=$keys + && map(ToString($keys->getValue($_)),qw(id cd)); + #make sure we have an id or give a stub one otherwise: +if (not $id) { +#do magic to get a unique id for this theory +#$whatsit->setProperties(beginItemize('theory')); +#$id = ToString($whatsit->getProperty('id')); + # changed: beginItemize returns the hash returned by RefStepCounter. + # RefStepCounter deactivates any scopes for the current value of the + # counter which causes the stored prop. of the env. not to be + # visible anymore. + $id = LookupValue('stex:theory:id') || 0; + AssignValue('stex:theory:id', $id+1); + $id = "I$id"; +} + $cd = $id unless $cd; + # update the catalog with paths for modules + my $module_paths = LookupValue('module_paths') || {}; + $module_paths->{$id} = LookupValue('last_module_path'); + AssignValue('module_paths', $module_paths, 'global'); + + #Update the current module position + AssignValue(current_module => $id); + AssignValue(module_cd => $cd) if $cd; + + #activate the module in our current scope + $STATE->activateScope("module:".$id); + + #Activate parent scope, if present + my $parentmod = LookupValue('parent_module'); + use_module($parentmod) if $parentmod; + #Update the current parent module + AssignValue("parent_of_$id"=>$parentmod,'global'); + AssignValue("parent_module" => $id); + return; }, + afterDigest => sub { + #Move a step up on the module ancestry + AssignValue("parent_module" => LookupValue("parent_of_".LookupValue("parent_module"))); + return; + }); +sub use_module { + my($module,%ancestors)=@_; + $module = ToString($module); + if (defined $ancestors{$module}) { + Fatal(":module \"$module\" leads to import cycle!"); + } + $ancestors{$module}=1; + # Depth-first load definitions from used modules, disregarding cycles + foreach my $used_module (@{ LookupValue("module_${module}_uses") || []}){ + use_module($used_module,%ancestors); + } + # then load definitions for this module + $STATE->activateScope("module:$module"); }#$ +DefMacro('\coolurion',sub {AssignValue('cooluri'=>1);}); +DefMacro('\coolurioff',sub {AssignValue('cooluri'=>0);}); +sub omext { + my ($mod)=@_; my $dest=''; + $mod = ToString($mod); + if ($mod) { + #We need a constellation of abs_path invocations + # to make sure that all symbolic links get resolved + if ($mod=~/^(\w)+:\/\//) { $dest=$mod; } else { + my ($d,$f,$t) = pathname_split(abs_path($mod)); + $d = pathname_relative(abs_path($d),abs_path(cwd())); + $dest=$d."/".$f; + } + } + $dest.=".omdoc" if (ToString($mod) && !LookupValue('cooluri')); + return Tokenize($dest);} +sub importmoduleI { + my($stomach,$whatsit)=@_; + my $file = ToString($whatsit->getArg(1)); + my $omdocmod = $file.".omdoc" if $file; + my $module = ToString($whatsit->getArg(2)); + my $containing_module = LookupValue('current_module'); + AssignValue('last_import_module',$module); + #set the relation between the current module and the one to be imported + PushValue("module_".$containing_module."_uses"=>$module) if $containing_module; + #check if we've already loaded this module file or no file path given + if((!$file) || (LookupValue('file_'.$module.'_loaded'))) {use_module($module);} #if so activate it! + else { + #if not: + my $gullet = $stomach->getGullet; + #1) mark as loaded + AssignValue('file_'.$module.'_loaded' => 1, 'global'); + #open a group for its definitions so that they are localized + $stomach->bgroup; + #update the last module path + AssignValue('last_module_path', $file); + #queue the closing tag for this module in the gullet where it will be executed + #after all other definitions of the imported module have been taken care of + $gullet->unread(Invocation(T_CS('\end@requiredmodule'), Tokens(Explode($module)))->unlist); + #we only need to load the sms definitions without generating any xml output, so we set the flag to 1 + AssignValue('excluding_modules' => 1); + #queue this module's sms file in the gullet so that its definitions are imported + $gullet->input($file,['sms']); + } + return;} +DefConstructor('\importmodule OptionalSemiverbatim {}', + "<omdoc:imports from='?#1(&omext(#1))\##2'/>", + afterDigest=>sub{ importmoduleI(@_)}); +DefMacro('\importmodulevia OptionalSemiverbatim {}','\endgroup\importmoduleI[#1]{#2}\begin{importmoduleenv}[#1]{#2}'); +DefMacroI('\end{importmodulevia}',undef,'\end{importmoduleenv}'); +DefEnvironment('{importmoduleenv} OptionalSemiverbatim {}', + "<omdoc:imports from='?#1(&omext(#1))\##2'>" + . "<omdoc:morphism>#body</omdoc:morphism>" + ."</omdoc:imports>"); +DefConstructor('\importmoduleI OptionalSemiverbatim {}', '', + afterDigest=>sub{ importmoduleI(@_)}); +DefConstructor('\vassign{}{}', + "<omdoc:requation>" + . "<ltx:Math><ltx:XMath>#1</ltx:XMath></ltx:Math>" + . "<ltx:Math><ltx:XMath>#2</ltx:XMath></ltx:Math>" + ."</omdoc:requation>"); +DefConstructor('\tassign[]{}{}', + "<omdoc:requation>" + . "<om:OMOBJ><om:OMS cd='?#1(#1)(#lastImportModule)' name='#2'/></om:OMOBJ>" + . "<om:OMOBJ><om:OMS cd='#currentModule' name='#3'/></om:OMOBJ>" + ."</omdoc:requation>", + afterDigest=> sub { + my ($stomach,$whatsit) = @_; + $whatsit->setProperty('currentModule',LookupValue("current_module")); + $whatsit->setProperty('lastImportModule',LookupValue("last_import_module")); + }); +DefConstructor('\ttassign{}{}', + "<omdoc:requation>" + . "<ltx:Math><ltx:XMath>#1</ltx:XMath></ltx:Math>" + . "<ltx:Math><ltx:XMath>#2</ltx:XMath></ltx:Math>" + ."</omdoc:requation>"); +DefConstructor('\importOMDocmodule OptionalSemiverbatim {}{}',"<omdoc:imports from='#3\##2'/>", +afterDigest=>sub{ + #Same as \importmodule, just switch second and third argument. + my ($stomach,$whatsit) = @_; + my $path = $whatsit->getArg(1); + my $ouri = $whatsit->getArg(2); + my $module = $whatsit->getArg(3); + $whatsit->setArgs(($path, $module,$ouri)); + importmoduleI($stomach,$whatsit); + return; +}); +DefConstructor('\metalanguage OptionalSemiverbatim {}', + "<omdoc:imports type='metalanguage' from='?#1(&omext(#1))\##2'/>", + afterDigest=>sub{ importmoduleI(@_)}); +DefMacro('\DefMathOp OptionalKeyVals:symdef {}', + sub { + my($self,$keyval,$pres)=@_; + my $name = KeyVal($keyval,'name') if $keyval; + #Rewrite this token + my $scopes = $STATE->getActiveScopes; + DefMathRewrite(xpath=>'descendant-or-self::ltx:XMath',match=>ToString($pres), + replace=>sub{ + map {$STATE->activateScope($_);} @$scopes; + $_[0]->absorb(Digest("\\".ToString($name))); + }); + #Invoke symdef + (Invocation(T_CS('\symdef'),$keyval,$name,undef,$pres)->unlist); + }); +DefMacro('\symdef OptionalKeyVals:symdef {}[]{}', + sub { + my($self,@args)=@_; + ((Invocation(T_CS('\@symdef'),@args)->unlist), + (LookupValue('excluding_modules') ? () + : (Invocation(T_CS('\@symdef@pres'), @args)->unlist))); }); + +#Current list of recognized formatter command sequences: +our @PresFormatters = qw (infix prefix postfix assoc mixfixi mixfixa mixfixii mixfixia mixfixai mixfixaii mixfixiii); +DefPrimitive('\@symdef OptionalKeyVals:symdef {}[]{}', sub { + my($stomach,$keys,$cs,$nargs,$presentation)=@_; + my($name,$cd,$role,$bvars,$bvar)=$keys + && map($_ && $_->toString,map($keys->getValue($_), qw(name cd role + bvars bvar))); + $cd = LookupValue('module_cd') unless $cd; + $name = $cs unless $name; + #Store for later lookup + AssignValue("symdef.".ToString($cs).".cd"=>ToString($cd),'global'); + AssignValue("symdef.".ToString($cs).".name"=>ToString($name),'global'); + $nargs = (ref $nargs ? $nargs->toString : $nargs || 0); + my $module = LookupValue('current_module'); + my $scope = (($keys && ($keys->getValue('local') || '' eq 'true')) ? 'module_local' : 'module').":".$module; + #The DefConstructorI Factory is responsible for creating the \symbol command sequences as dictated by the \symdef + DefConstructorI("\\".$cs->toString,convertLaTeXArgs($nargs+1,'default'), sub { + my ($document,@args) = @_; + my $icvariant = shift @args; + my @props = @args; + #Lookup the presentation from the State, if a variant: + @args = splice(@props,0,$nargs); + my %prs = @props; + my $localpres = $prs{presentation}; + $prs{isbound} = "BINDER" if ($bvars || $bvar); + my $wrapped; + my $parent=$document->getNode; + if(! defined $parent->lookupNamespacePrefix("http://omdoc.org/ns")){ # namespace not already declared? + $document->getDocument->documentElement->setNamespace("http://omdoc.org/ns","omdoc",0); } + my $symdef_scope=$parent->exists('ancestor::omdoc:rendering'); #Are we in a \symdef rendering? + if (($localpres =~/^LaTeXML::Token/) && $symdef_scope) { + #Note: We should probably ask Bruce whether this maneuver makes sense + # We jump back to digestion, at a processing stage where it has been already completed + # Hence need to reinitialize all scopes and make a new group. This is probably expensive to do. + + my @toks = $localpres->unlist; + while(@toks && $toks[0]->equals(T_SPACE)){ shift(@toks); } # Remove leading space + my $formatters = join("|",@PresFormatters); + $formatters = qr/$formatters/; + $wrapped = (@toks && ($toks[0]->toString =~ /^\\($formatters)$/)); + $localpres = Invocation(T_CS('\@use'),$localpres) unless $wrapped; + # Plug in the provided arguments, doing a nasty reversion: + my @sargs = map (Tokens($_->revert), @args); + $localpres = Tokens(LaTeXML::Expandable::substituteTokens($localpres,@sargs)) if $nargs>0; + #Digest: + my $stomach = $STATE->getStomach; + $stomach->beginMode('inline-math'); + $STATE->activateScope($scope); + use_module($module); + use_module(LookupValue("parent_of_".$module)) if LookupValue("parent_of_".$module); + $localpres=$stomach->digest($localpres); + $stomach->endMode('inline-math'); + } + else { #Some are already digested to Whatsit, usually when dropped from a wrapping constructor + } + if ($nargs == 0) { + if (!$symdef_scope) { #Simple case - discourse flow, only a single XMTok + #Referencing XMTok when not in \symdefs: + $document->insertElement('ltx:XMTok',undef,(name=>$cs->toString, meaning=>$name,omcd=>$cd,role => $role,scriptpos=>$prs{'scriptpos'})); + } + else { + if ($symdef_scope && ($localpres =~/^LaTeXML::Whatsit/) && (!$wrapped)) {#1. Simple case: converts to a single token + $localpres->setProperties((name=>$cs->toString, meaning=>$name,omcd=>$cd,role => $role,scriptpos=>$prs{'scriptpos'})); + } + else { + #Experimental treatment - COMPLEXTOKEN + #$role=$role||'COMPLEXTOKEN'; + #$document->openElement('ltx:XMApp',role=>'COMPLEXTOKEN'); + #$document->insertElement('ltx:XMTok',undef,(name=>$cs->toString, meaning=>$name, omcd=>$cd, role=>$role, scriptpos=>$prs{'scriptpos'})); + #$document->openElement('ltx:XMWrap'); + #$document->absorb($localpres); + #$document->closeElement('ltx:XMWrap'); + #$document->closeElement('ltx:XMApp'); + } + #We need expanded presentation when invoked in \symdef scope: + + #Suppress errors from rendering attributes when absorbing. + #This is bad style, but we have no way around it due to the digestion acrobatics. + my $verbosity = $LaTeXML::Global::STATE->lookupValue('VERBOSITY'); + my $errors = $LaTeXML::Global::STATE->getStatus('error'); + $LaTeXML::Global::STATE->assignValue('VERBOSITY',-5); + + #Absorb presentation: + $document->absorb($localpres); + + #Return to original verbosity and error state: + $LaTeXML::Global::STATE->assignValue('VERBOSITY',$verbosity); + $LaTeXML::Global::STATE->setStatus('error',$errors); + + #Strip all/any <rendering><Math><XMath> wrappers: + #TODO: Ugly LibXML work, possibly do something smarter + my $parent = $document->getNode; + my @renderings=$parent->findnodes(".//omdoc:rendering"); + foreach my $render(@renderings) { + my $content=$render; + while ($content && $content->localname =~/^rendering|[X]?Math/) { + $content = $content->firstChild; + } + my $sibling = $content->parentNode->lastChild; + my $localp = $render->parentNode; + while ((defined $sibling) && (!$sibling->isSameNode($content))) { + my $clone = $sibling->cloneNode(1); + $localp->insertAfter($clone,$render); + $sibling = $sibling->previousSibling; + } + $render->replaceNode($content); + } + } + } + else {#2. Constructors with arguments + if (!$symdef_scope) { #2.1 Simple case, outside of \symdef declarations: + #Referencing XMTok when not in \symdefs: + my %ic = ($icvariant ne 'default') ? (ic=>'variant:'.$icvariant) : (); + $document->openElement('ltx:XMApp',%ic,scriptpos=>$prs{'scriptpos'},role=>$prs{'isbound'}); + $document->insertElement('ltx:XMTok',undef,(name=>$cs->toString, meaning=>$name, omcd=>$cd, role=>$role, scriptpos=>$prs{'operator_scriptpos'})); + foreach my $carg (@args) { + if ($carg =~/^LaTeXML::Token/) { + my $stomach = $STATE->getStomach; + $stomach->beginMode('inline-math'); + $carg=$stomach->digest($carg); + $stomach->endMode('inline-math'); + } + $document->openElement('ltx:XMArg'); + $document->absorb($carg); + $document->closeElement('ltx:XMArg'); + } + $document->closeElement('ltx:XMApp'); + } + else { #2.2 Complex case, inside a \symdef declaration + #We need expanded presentation when invoked in \symdef scope: + + #Suppress errors from rendering attributes when absorbing. + #This is bad style, but we have no way around it due to the digestion acrobatics. + my $verbosity = $LaTeXML::Global::STATE->lookupValue('VERBOSITY'); + my $errors = $LaTeXML::Global::STATE->getStatus('error'); + $LaTeXML::Global::STATE->assignValue('VERBOSITY',-5); + + #Absorb presentation: + $document->absorb($localpres); + + #Return to original verbosity and error state: + $LaTeXML::Global::STATE->assignValue('VERBOSITY',$verbosity); + $LaTeXML::Global::STATE->setStatus('error',$errors); + + #Strip all/any <rendering><Math><XMath> wrappers: + #TODO: Ugly LibXML work, possibly do something smarter? + my $parent = $document->getNode; + if(! defined $parent->lookupNamespacePrefix("http://omdoc.org/ns")){ # namespace not already declared? + $document->getDocument->documentElement->setNamespace("http://omdoc.org/ns","omdoc",0); } + my @renderings=$parent->findnodes(".//omdoc:rendering"); + foreach my $render(@renderings) { + my $content=$render; + while ($content && $content->localname =~/^rendering|[X]?Math/) { + $content = $content->firstChild; + } + my $sibling = $content->parentNode->lastChild; + my $localp = $render->parentNode; + while ((defined $sibling) && (!$sibling->isSameNode($content))) { + my $clone = $sibling->cloneNode(1); + $localp->insertAfter($clone,$render); + $sibling = $sibling->previousSibling; + } + $render->replaceNode($content); + } + } + }}, + properties => {name=>$cs->toString, meaning=>$name,omcd=>$cd,role => $role}, + scope=>$scope, + beforeDigest => sub{ + my ($gullet, $variant) = @_; + my $icvariant = ToString($variant); + my $localpres = $presentation; + if ($icvariant && $icvariant ne 'default') { + $localpres = LookupValue($cs->toString."$icvariant:pres"); + if (!$localpres) { + Error("No variant named '$icvariant' found! Falling back to ". + "default.\n Please consider introducing \\symvariant{". + $cs->toString."}[$nargs]{$icvariant}{... your presentation ...}"); + $localpres = $presentation; + } + } + my $count = LookupValue(ToString($cs).'_counter') || 0; + AssignValue(ToString($cs).":pres:$count",$localpres); + AssignValue(ToString($cs).'_counter',$count+1); + return; + }, + afterDigest => sub{ + my ($stomach,$whatsit) = @_; + my $count = LookupValue(ToString($cs).'_aftercounter') || 0; + $whatsit->setProperty('presentation',LookupValue(ToString($cs).":pres:$count")); + AssignValue(ToString($cs).'_aftercounter',$count+1); + }); + return; }); + DefMacro('\symvariant{}[]{}{}', sub { + my($self,@args)=@_; + my $prestok = Invocation(T_CS('\@symvariant@pres'), @args); + pop @args; push @args, $prestok; + Invocation(T_CS('\@symvariant@construct'),@args)->unlist; +}); + DefMacro('\@symvariant@pres{}[]{}{}', sub { + my($self,$cs,$nargs,$ic,$presentation)=@_; + symdef_presentation_pmml($cs,ToString($nargs)||0,$presentation); + }); + DefConstructor('\@symvariant@construct{}[]{}{}', sub { + my($document,$cs,$nargs,$icvariant,$presentation)=@_; + $cs = ToString($cs); + $nargs = ToString($nargs); + $icvariant = ToString($icvariant); + # Save presentation for future reference: + #Notation created by \symdef + #Create the rendering at the right place: + my $cnode = $document->getNode; + my $root = $document->getDocument->documentElement; + my $name = LookupValue("symdef.".ToString($cs).".name") || $cs; + # Fix namespace (the LibXML XPath problems...) + $root->setNamespace("http://omdoc.org/ns","omdoc",0); + my ($notation) = $root->findnodes(".//omdoc:notation[\@name='$name' and ". + "preceding-sibling::omdoc:symbol[1]/\@name + = '$name']"); + if (!$notation) { + #No symdef found, raise error: + Error("No \\symdef found for \\$cs! Please define symbol prior to introducing variants!"); + return; + } + $document->setNode($notation); + $document->absorb($presentation); + $notation->lastChild->setAttribute("ic","variant:$icvariant"); + $document->setNode($cnode); + return; + }, + beforeDigest => sub { + my($gullet,$cs,$nargs,$icvariant,$presentation)=@_; + $cs = ToString($cs); + $icvariant = ToString($icvariant); + AssignValue("$cs:$icvariant:pres",Digest($presentation),'module:'.LookupValue('current_module')); + }); + #mode=>'math' +DefPrimitive('\abbrdef OptionalKeyVals:symdef {}[]{}', sub { + my($stomach,$keys,$cs,$nargs,$presentation)=@_; + my $module = LookupValue('current_module'); + my $scope = (($keys && ($keys->getValue('local') || '' eq 'true')) ? 'module_local' : 'module').":$module"; + DefMacroI("\\".$cs->toString,convertLaTeXArgs($nargs,''),$presentation, + scope=>$scope); + return; }); +DefMacro('\defpath{}{}', sub { + my ($gullet,$arg1,$arg2)=@_; + $arg1 = ToString($arg1); + $arg2 = ToString($arg2); + my $paths = LookupValue('defpath')||{}; + $$paths{"$arg1"}=$arg2; + AssignValue('defpath'=>$paths,'global'); + DefMacro('\\'.$arg1.' Semiverbatim',$arg2."/#1"); + });#$ +DefPrimitive('\requiremodules{}', sub { + my($stomach,$module)=@_; + my $GULLET = $stomach->getGullet; + $module = Digest($module)->toString; + if(LookupValue('file_'.$module.'_loaded')) {} + else { + AssignValue('file_'.$module.'_loaded' => 1, 'global'); + $stomach->bgroup; + AssignValue('last_module_path', $module); + $GULLET->unread(T_CS('\end@requiredmodule')); + AssignValue('excluding_modules' => 1); + $GULLET->input($module,['sms']); + } + return;}); + +DefPrimitive('\end@requiredmodule{}',sub { + #close the group + $_[0]->egroup; + #print STDERR "END: ".ToString(Digest($_[1])->toString); + #Take care of any imported elements in this current module by activating it and all its dependencies + #print STDERR "Important: ".ToString(Digest($_[1])->toString)."\n"; + use_module(ToString(Digest($_[1])->toString)); + return; });#$ +DefPrimitive('\sinput Semiverbatim', sub { + my($stomach,$module)=@_; + my $GULLET = $stomach->getGullet; + $module = Digest($module)->toString; + AssignValue('file_'.$module.'_loaded' => 1, 'global'); + $stomach->bgroup; + AssignValue('last_module_path', $module); + $GULLET->unread(Invocation(T_CS('\end@requiredmodule'),Tokens(Explode($module)))->unlist); + $GULLET->input($module,['tex']); + return;});#$ +DefConstructor('\sinputref{}',"<omdoc:oref href='#1.omdoc' class='expandable'/>"); +DefConstructor('\inputref{}',"<omdoc:oref href='#1.omdoc' class='expandable'/>"); +DefMacro('\@symdef@pres OptionalKeyVals:symdef {}[]{}', sub { + my($self,$keys, $cs,$nargs,$presentation)=@_; + + my($name,$cd,$role)=$keys + && map($_ && $_->toString,map($keys->getValue($_), qw(name cd role))); + $cd = LookupValue('module_cd') unless $cd; + $name = $cs unless $name; + AssignValue('module_name'=>$name) if $name; + $nargs = 0 unless ($nargs); + my $nargkey = ToString($name).'_args'; + AssignValue($nargkey=>ToString($nargs)) if $nargs; + $name=ToString($name); + + Invocation(T_CS('\@symdef@pres@aux'), + $cs, + ($nargs || Tokens(T_OTHER(0))), + symdef_presentation_pmml($cs,ToString($nargs)||0,$presentation), + (Tokens(Explode($name))), + (Tokens(Explode($cd))), + $keys)->unlist; });#$ +sub symdef_presentation_pmml { + my($cs,$nargs,$presentation)=@_; + my @toks = $presentation->unlist; + while(@toks && $toks[0]->equals(T_SPACE)){ shift(@toks); } # Remove leading space + $presentation = Tokens(@toks); + # Wrap with \@use, unless already has a recognized formatter. + my $formatters = join("|",@PresFormatters); + $formatters = qr/$formatters/; + $presentation = Invocation(T_CS('\@use'),$presentation) + unless (@toks && ($toks[0]->toString =~ /^\\($formatters)$/)); + # Low level substitution. + my @args = + map(Invocation(T_CS('\@SYMBOL'),T_OTHER("arg:".($_))),1..$nargs); + $presentation = Tokens(LaTeXML::Expandable::substituteTokens($presentation,@args)); + $presentation; }#$ +sub getSymmdefProperties { + my $cd = LookupValue('module_cd'); + my $name = LookupValue('module_name'); + my $nargkey = ToString($name).'_args'; + my $nargs = LookupValue($nargkey); + $nargs = 0 unless ($nargs); + my %props = ('cd'=>$cd,'name'=>$name,'nargs'=>$nargs); + return %props;} +DefConstructor('\@use{}', sub{ + my ($document,$args,%properties) = @_; + #Notation created at \@symdef@pres@aux + #Create the rendering: + $document->openElement('omdoc:rendering'); + $document->openElement('ltx:Math'); + $document->openElement('ltx:XMath'); + if ($args->isMath) {$document->absorb($args);} + else { $document->insertElement('ltx:XMText',$args);} + $document->closeElement('ltx:XMath'); + $document->closeElement('ltx:Math'); + $document->closeElement('omdoc:rendering'); +}, +properties=>sub { getSymmdefProperties($_[1]);}, + mode=>'inline_math'); +sub get_cd { + my($name,$cd,$role)=@_; + return $cd;} +DefConstructor('\@symdef@pres@aux{}{}{}{}{} OptionalKeyVals:symdef', sub { + my ($document,$cs,$nargs,$pmml,$name,$cd,$keys)=@_; + my $assocarg = ToString($keys->getValue('assocarg')) if $keys; + $assocarg = $assocarg||"0"; + my $bvars = ToString($keys->getValue('bvars')) if $keys; + $bvars = $bvars||"0"; + my $bvar = ToString($keys->getValue('bvar')) if $keys; + $bvar = $bvar||"0"; + my $appElement = 'om:OMA'; $appElement = 'om:OMBIND' if ($bvars || $bvar); + my $root = $document->getDocument->documentElement; + my $name_str = ToString($name); + my ($notation) = $root->findnodes(".//omdoc:notation[\@name='$name_str' and ". + "preceding-sibling::omdoc:symbol[1]/\@name + = '$name_str']"); + if (!$notation) { + $document->insertElement("omdoc:symbol",undef,(name=>$name,"xml:id"=>$name_str.".sym")); + } + $document->openElement("omdoc:notation",(name=>$name,cd=>$cd)); + #First, generate prototype: + $nargs = ToString($nargs)||0; + $document->openElement('omdoc:prototype'); + $document->openElement($appElement) if $nargs; + my $cr="fun" if $nargs; + $document->insertElement('om:OMS',undef, + (cd=>$cd, + name=>$name, + "cr"=>$cr)); + if ($bvar || $bvars) { + $document->openElement('om:OMBVAR'); + if ($bvar) { + $document->insertElement('omdoc:expr',undef,(name=>"arg$bvar")); + } else { + $document->openElement('omdoc:exprlist',(name=>"args")); + $document->insertElement('omdoc:expr',undef,(name=>"arg")); + $document->closeElement('omdoc:exprlist'); + } + $document->closeElement('om:OMBVAR'); + } + for my $id(1..$nargs) { + next if ($id==$bvars || $id==$bvar); + if ($id!=$assocarg) { + my $argname="arg$id"; + $document->insertElement('omdoc:expr',undef,(name=>"$argname")); + } + else { + $document->openElement('omdoc:exprlist',(name=>"args")); + $document->insertElement('omdoc:expr',undef,(name=>"arg")); + $document->closeElement('omdoc:exprlist'); + } + } + $document->closeElement($appElement) if $nargs; + $document->closeElement('omdoc:prototype'); + #Next, absorb rendering: + $document->absorb($pmml); + $document->closeElement("omdoc:notation"); + }, afterDigest=>sub { my ($stomach, $whatsit) = @_; + my $keys = $whatsit->getArg(6); + my $module = LookupValue('current_module'); + $whatsit->setProperties(for=>ToString($whatsit->getArg(1))); + $whatsit->setProperty(role=>($keys ? $keys->getValue('role') + : (ToString($whatsit->getArg(2)) ? 'applied' + : undef))); }); +sub symdef_presentation_TeX { + my($presentation)=@_; + my @tokens = $presentation->unlist; + my(@frag,@frags) = (); + while(my $tok = shift(@tokens)){ + if($tok->equals(T_PARAM)){ + push(@frags,Invocation(T_CS('\@symdef@pres@text'),Tokens(@frag))) if @frag; + @frag=(); + my $n = shift(@tokens)->getString; + push(@frags,Invocation(T_CS('\@symdef@pres@arg'),T_OTHER($n+1))); } + else { + push(@frag,T_OTHER($tok->getString)); }} # IMPORTANT! Neutralize the tokens! + push(@frags,Invocation(T_CS('\@symdef@pres@text'),Tokens(@frag))) if @frag; + Tokens(map($_->unlist,@frags)); } +DefConstructor('\@symdef@pres@arg{}', "<omdoc:recurse select='#select'/>", + afterDigest=>sub { my ($stomach, $whatsit) = @_; + my $select = $whatsit->getArg(1); + $select = ref $select ? $select->toString : ''; + $whatsit->setProperty(select=>"*[".$select."]"); }); +DefConstructor('\@symdef@pres@text{}', "<omdoc:text>#1</omdoc:text>"); +DefConstructor('\requirepackage{} Semiverbatim',"<omdoc:imports from='#2'/>", + afterDigest=>sub { my ($stomach, $whatsit) = @_; + my $select = $whatsit->getArg(1); + RequirePackage($select->toString); });#$ +DefKeyVal('view','id','Semiverbatim'); +DefEnvironment('{view} OptionalKeyVals:view {}{}', + "<omdoc:theory-inclusion from='#2' to='#3'>" + . "<omdoc:morphism>#body</omdoc:morphism>" + ."</omdoc:theory-inclusion>"); +Tag('omdoc:recurse',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:imports',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:theory',afterOpen=>\&numberIt,afterClose=>\&locateIt); +1; diff --git a/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls b/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls new file mode 100644 index 00000000000..6cb3c77a74b --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls @@ -0,0 +1,28 @@ +%% +%% This is file `omdoc.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% omdoc.dtx (with options: `cls') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesClass{omdoc}[2012/01/28 v1.0 OMDoc Documents] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\def\omdoc@class{article} +\DeclareOption{report}{\def\omdoc@class{report}\PassOptionsToPackage{\CurrentOption}{omdoc}} +\DeclareOption{book}{\def\omdoc@class{book}\PassOptionsToPackage{\CurrentOption}{omdoc}} +\DeclareOption{chapter}{\PassOptionsToPackage{\CurrentOption}{omdoc}} +\DeclareOption{part}{\PassOptionsToPackage{\CurrentOption}{omdoc}} +\DeclareOption{showignores}{\PassOptionsToPackage{\CurrentOption}{omdoc}} +\DeclareOption{extrefs}{\PassOptionsToPackage{\CurrentOption}{sref}} +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} +\ProcessOptions +\LoadClass{\omdoc@class} +\RequirePackage{omdoc} +\let\orig@document=\document +\srefaddidkey{document} +\renewcommand{\document}[1][]{\metasetkeys{document}{#1}\orig@document} +\endinput +%% +%% End of file `omdoc.cls'. diff --git a/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls.ltxml b/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls.ltxml new file mode 100644 index 00000000000..56d43b7138e --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.cls.ltxml @@ -0,0 +1,58 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +use LaTeXML::Util::Pathname; +use Cwd qw(cwd abs_path); +DeclareOption('report',sub {PassOptions('omdoc','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption('book',sub {PassOptions('omdoc','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption('chapter',sub {PassOptions('omdoc','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption('part',sub {PassOptions('omdoc','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption('showignores',sub {PassOptions('omdoc','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption('extrefs',sub {PassOptions('sref','sty',ToString(Digest(T_CS('\CurrentOption')))); }); +DeclareOption(undef,sub {PassOptions('article','cls',ToString(Digest(T_CS('\CurrentOption')))); }); +ProcessOptions(); +LoadClass('article'); +RequirePackage('sref'); +RegisterNamespace('omdoc'=>"http://omdoc.org/ns"); +RegisterNamespace('om'=>"http://www.openmath.org/OpenMath"); +RegisterNamespace('m'=>"http://www.w3.org/1998/Math/MathML"); +RegisterNamespace('dc'=>"http://purl.org/dc/elements/1.1/"); +RegisterNamespace('cc'=>"http://creativecommons.org/ns"); +RegisterNamespace('stex'=>"http://kwarc.info/ns/sTeX"); +RegisterNamespace('ltx'=>"http://dlmf.nist.gov/LaTeXML"); +RelaxNGSchema('omdoc+ltxml', + '#default'=>"http://omdoc.org/ns", + 'om'=>"http://www.openmath.org/OpenMath", + 'm'=>"http://www.w3.org/1998/Math/MathML", + 'dc'=>"http://purl.org/dc/elements/1.1/", + 'cc'=>"http://creativecommons.org/ns", + 'stex'=>"http://kwarc.info/ns/sTeX", + 'ltx'=>"http://dlmf.nist.gov/LaTeXML"); +RequirePackage('omdoc'); +sub xmlBase { + my $baseuri = LookupValue('baseuri'); + my $baselocal = LookupValue('baselocal'); + my $cdir = abs_path(cwd()); + $cdir =~ s/^$baselocal// if $baselocal; + #DG: Make this more robust! + my ($d,$f,$t); + my $srcf = LookupValue('SOURCEFILE'); + if ( $srcf =~ /^(\w+):\/\//) { + $srcf =~ s/^(\w+):\///; + } # TODO: Hacky, do something better + ($d, $f,$t) = pathname_split(LookupValue('SOURCEFILE')); + $t = '' if LookupValue('cooluri'); + Tokenize($baseuri.$cdir.'/'.$f.$t); } +DefEnvironment('{document} OptionalKeyVals:omdoc', + "<omdoc:omdoc " + . "?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')" + . "(?&Tokenize(&LookupValue('SOURCEBASE'))" + . "(xml:id='&Tokenize(&LookupValue('SOURCEBASE')).omdoc')()) " + . "?&Tokenize(&LookupValue('baseuri'))" + . "(xml:base='&xmlBase()')()>" + . "#body" + ."</omdoc:omdoc>", + beforeDigest=> sub { AssignValue(inPreamble=>0); }, + afterDigest=> sub { $_[0]->getGullet->flush; return; });#$ +1; diff --git a/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty b/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty new file mode 100644 index 00000000000..54f275d7c46 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty @@ -0,0 +1,85 @@ +%% +%% This is file `omdoc.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% omdoc.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{omdoc}[2012/01/28 v1.0 OMDoc document Structure] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\newif\if@chapter\@chapterfalse +\newif\if@part\@partfalse +\newcount\section@level\section@level=3 +\newif\ifshow@ignores\show@ignoresfalse +\def\omdoc@class{article} +\DeclareOption{report}{\def\omdoc@class{report}\section@level=2} +\DeclareOption{book}{\def\omdoc@class{book}\section@level=1} +\DeclareOption{chapter}{\section@level=2\@chaptertrue} +\DeclareOption{part}{\section@level=1\@chaptertrue\@parttrue} +\DeclareOption{showignores}{\show@ignorestrue} +\DeclareOption{extrefs}{\PassOptionsToPackage{\CurrentOption}{sref}} +\ProcessOptions +\RequirePackage{sref} +\RequirePackage{xspace} +\RequirePackage{comment} +\def\level@section#1{\ifcase#1\or{part}\or{chapter}\or{section}\or{subsection}\or{subsubsection}\or{paragraph}\or{subparagraph}\fi} +\def\Level@Section#1{\ifcase#1\or{Part}\or{Chapter}\or{Section}\or{Subsection}\or{Subsubsection}\or{Paragraph}\or{Subparagraph}\fi} +\def\in@level@section#1{\ifcase#1\or{this document}\or{part}\or{chapter}\or{section}\or{subsection}\or{subsubsection}\or{paragraph}\or{subparagraph}\fi} +\def\In@Level@Section#1{\ifcase#1\or{This document}\or{Part}\or{Chapter}\or{Section}\or{Subsection}\or{Subsubsection}\or{Paragraph}\or{Subparagraph}\fi} +\def\currentsectionlevel{\in@level@section\section@level\xspace} +\def\CurrentSectionLevel{\In@Level@Section\section@level\xspace} +\srefaddidkey{omgroup} +\addmetakey{omgroup}{creators} +\addmetakey{omgroup}{date} +\addmetakey{omgroup}{contributors} +\addmetakey{omgroup}{type} +\addmetakey*{omgroup}{short} +\addmetakey*{omgroup}{display} +\def\at@begin@omgroup#1{} +\newenvironment{omgroup}[2][]% keys, title +{\metasetkeys{omgroup}{#1}\sref@target% +\ifx\omgroup@display\st@flow\noindent{\Large\textbf{#2}\\[.3ex]\noindent\ignorespaces}% +\else% +\if@part\ifnum\section@level=1\part{#2}\sref@label@id{Part \thepart}\fi\fi% +\if@chapter\ifnum\section@level=2\chapter{#2}\sref@label@id{Chapter \thechapter}\fi\fi% +\ifnum\section@level=3\section{#2}\sref@label@id{Section \thesection}\fi% +\ifnum\section@level=4\subsection{#2}\sref@label@id{Subsection \thesubsection}\fi% +\ifnum\section@level=5\subsubsection{#2}\sref@label@id{Subsubsection \thesubsubsection}\fi% +\ifnum\section@level=6\paragraph{#2}\sref@label@id{this paragraph}\fi% +\ifnum\section@level=7\subparagraph{#2}\sref@label@id{this subparagraph}\fi% +\at@begin@omgroup\section@level% for customization +\advance\section@level by 1% +\fi}{\advance\section@level by -1} +\providecommand\printindex{\IfFileExists{\jobname.ind}{\input{\jobname.ind}}{}} +\ifshow@ignores +\addmetakey{ignore}{type} +\addmetakey{ignore}{comment} +\newenvironment{ignore}[1][] +{\metasetkeys{ignore}{#1}\textless\ignore@type\textgreater\bgroup\itshape} +{\egroup\textless/\ignore@type\textgreater} +\renewenvironment{ignore}{}{}\else\excludecomment{ignore}\fi +\long\def\STRlabel#1#2{\STRlabeldef{#1}{#2}{#2}} +\def\STRcopy#1{\expandafter\ifx\csname STR@#1\endcsname\relax +\message{STR warning: reference #1 undefined!} +\else\csname STR@#1\endcsname\fi} +\newcommand{\STRsemantics}[3][]{#2\def\@test{#1}\ifx\@test\@empty\STRlabeldef{#1}{#2}\fi} +\def\STRlabeldef#1{\expandafter\gdef\csname STR@#1\endcsname} +\def\black#1{\textcolor{black}{#1}} +\def\gray#1{\textcolor{gray}{#1}} +\def\blue#1{\textcolor{blue}{#1}} +\def\red#1{\textcolor{red}{#1}} +\def\green#1{\textcolor{green}{#1}} +\def\cyan#1{\textcolor{cyan}{#1}} +\def\magenta#1{\textcolor{magenta}{#1}} +\def\brown#1{\textcolor{brown}{#1}} +\def\yellow#1{\textcolor{yellow}{#1}} +\def\orange#1{\textcolor{orange}{#1}} +\newcommand\hateq{\ensuremath{\hat=}\xspace} +\newcommand\hatequiv{\ensuremath{\hat\equiv}\xspace} +\newcommand\textleadsto{\ensuremath{\leadsto}\xspace} +\newcommand{\baseURI}[2][]{} +\endinput +%% +%% End of file `omdoc.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty.ltxml b/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty.ltxml new file mode 100644 index 00000000000..207a53b6f2b --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/omdoc/omdoc.sty.ltxml @@ -0,0 +1,67 @@ +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +use Cwd qw(cwd abs_path); +DeclareOption('report',''); +DeclareOption('book',''); +DeclareOption('chapter',''); +DeclareOption('part',''); +DeclareOption('showignores',''); +DeclareOption('extrefs',''); +RequirePackage('sref'); +RequirePackage('xspace'); +RequirePackage('omtext'); +DefEnvironment('{omgroup} OptionalKeyVals:omgroup {}', + "<omdoc:omgroup layout='sectioning'" + . "?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')()" + . "?&KeyVal(#1,'type')(type='&KeyVal(#1,'type')')()>\n" + . "<dc:title>#2</dc:title>\n" + . "#body\n" + . "</omdoc:omgroup>"); +DefConstructor('\printindex','<omdoc:index/>'); +DefConstructor('\tableofcontents',"<omdoc:tableofcontents level='&ToString(&CounterValue('tocdepth'))'/>"); +DefConstructor('\bibliography{}',"<omdoc:bibliography files='#1'/>"); +DefKeyVal('ignore','type','Semiverbatim'); +DefKeyVal('ignore','comment','Semiverbatim'); +DefEnvironment('{ignore} OptionalKeyVals:ignore', + "<omdoc:ignore %&KeyVals(#1)>#body</omdoc:ignore>"); +DefConstructor('\STRlabel{}{}', sub { + my($document,$label,$object)=@_; + $document->absorb($object); + $document->addAttribute('xml:id'=>ToString($label)) if $label; }); +DefConstructor('\STRcopy{}',"<omdoc:ref xref='##1'/>"); +DefConstructor('\STRsemantics[]{}{}', sub { + my($document,$label,$ignore,$object)=@_; + $document->absorb($object); + $document->addAttribute('xml:id'=>ToString($label)) if $label; }); +DefMacro('\STRlabeldef{}{}', ""); +sub omdocColorMacro { + my ($color, @args) = @_; + my $tok_color = TokenizeInternal($color); + (T_BEGIN, T_CS('\@omdoc@color'), T_BEGIN, $tok_color->unlist, + T_END, T_CS('\@omdoc@color@content'), T_OTHER('['), $tok_color->unlist, T_OTHER(']'), + T_BEGIN, $args[1]->unlist, T_END, T_END); } +DefMacro('\@omdoc@color{}', sub { MergeFont(color=>$_[1]->toString); return; });#$ +DefConstructor('\@omdoc@color@content[]{}', + "?#isMath(#2)(<ltx:text ?#1(style='color:#1')()>#2</ltx:text>)"); +foreach my $color(qw(black gray blue red green cyan magenta brown yellow orange)) { + DefMacro("\\".$color.'{}', sub { omdocColorMacro($color, @_); }); }#$ +DefConstructor('\newpage',''); +Tag('omdoc:ignore',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:ref',afterOpen=>\&numberIt,afterClose=>\&locateIt); +DefConstructor('\hateq',"\x{2259}"); +DefConstructor('\hatequiv',"\x{2A6F}"); +DefConstructor('\textleadsto',"\x{219D}"); +DefMacro('\baseURI []Semiverbatim', sub { + if (LookupValue('SOURCEFILE')!~/^(\w+):\/\//) { + my $baselocal = ToString(Expand($_[1])); + $baselocal = abs_path($baselocal) unless $baselocal=~/^(\w+):\/\//; + AssignValue('baselocal'=>$baselocal); + AssignValue('baseuri'=>ToString(Expand($_[2])));} + else { + AssignValue('baselocal'=>undef); + AssignValue('baseuri'=>ToString(Expand($_[2]))); + }}); +DefConstructor('\url Semiverbatim',"<omdoc:link href='#1'>#1</omdoc:link>"); +DefConstructor('\href Semiverbatim {}',"<omdoc:link href='#1'>#2</omdoc:link>"); +1; diff --git a/Master/texmf-dist/tex/latex/stex/omtext/omtext.sty b/Master/texmf-dist/tex/latex/stex/omtext/omtext.sty new file mode 100644 index 00000000000..d57be46a147 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/omtext/omtext.sty @@ -0,0 +1,96 @@ +%% +%% This is file `omtext.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% omtext.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{omtext}[2012/01/28 v1.0 OMDoc Text Fragments] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\newif\ifindex\indextrue +\DeclareOption{noindex}{\indexfalse} +\ProcessOptions +\ifindex\makeindex\fi +\RequirePackage{sref} +\RequirePackage{comment} +\srefaddidkey{omtext} +\addmetakey[]{omtext}{functions} +\addmetakey*{omtext}{display} +\addmetakey{omtext}{for} +\addmetakey{omtext}{from} +\addmetakey{omtext}{type} +\addmetakey*{omtext}{title} +\addmetakey*{omtext}{start} +\addmetakey{omtext}{theory} +\addmetakey{omtext}{continues} +\addmetakey{omtext}{verbalizes} +\addmetakey{omtext}{subject} +\def\st@flow{flow} +\def\omtext@pre@skip{\smallskip} +\def\omtext@post@skip{} +\providecommand{\stDMemph}[1]{\textbf{#1}} +\newenvironment{omtext}[1][]{\bgroup\metasetkeys{omtext}{#1}\sref@label@id{this paragraph}% +\def\lec##1{\@lec{##1}} +\ifx\omtext@display\st@flow\else\omtext@pre@skip\par\noindent% +\ifx\omtext@title\@empty\else\stDMemph{\omtext@title}: \fi\fi\ignorespaces} +{\egroup\omtext@post@skip} +\srefaddidkey{phrase} +\addmetakey{phrase}{style} +\addmetakey{phrase}{class} +\addmetakey{phrase}{index} +\addmetakey{phrase}{verbalizes} +\addmetakey{phrase}{type} +\newenvironment{phrase}[1][]{\metasetkeys{phrase}{#1}}{} +\def\nlex#1{\green{\sl{#1}}} +\def\nlcex#1{*\green{\sl{#1}}} +\def\@sinlinequote#1{``{\sl{#1}}''} +\def\@@sinlinequote#1#2{\@sinlinequote{#2}~#1} +\newcommand{\sinlinequote}[2][] +{\def\@opt{#1}\ifx\@opt\@empty\@sinlinequote{#2}\else\@@sinlinequote\@opt{#2}\fi} +\def\begin@sblockquote{\begin{quote}\sl} +\def\end@sblockquote{\end{quote}} +\def\begin@@sblockquote#1{\begin@sblockquote} +\def\end@@sblockquote#1{\def\@@lec##1{{\rm ##1}}\@lec{#1}\end@sblockquote} +\newenvironment{sblockquote}[1][] + {\def\@opt{#1}\ifx\@opt\@empty\begin@sblockquote\else\begin@@sblockquote\@opt\fi} + {\ifx\@opt\@empty\end@sblockquote\else\end@@sblockquote\@opt\fi} +\providecommand{\@@lec}[1]{(#1)} +\def\@lec#1{\strut\hfil\strut\null\nobreak\hfill\hbox{\@@lec{#1}}} +\def\lec#1{\@lec{#1}\par} +\newcommand\mygraphics[2][]{\includegraphics[#1]{#2}} +\newcommand\mycgraphics[2][]{\begin{center}\includegraphics[#1]{#2}\end{center}} +\newcommand\mybgraphics[2][]{\fbox{\includegraphics[#1]{#2}\end{center}}} +\newcommand{\omdoc@index}[2][]{\ifindex\def\@test{#1}%% +\ifx\@test\@empty\def\@@idx{#2}\else\def\@@idx{#1}\fi% +\@ifundefined{mod@id}{\index{\@@idx @#2}}% +{\index{\@@idx @{\importmodule{\mod@id} #2}}\fi}} +\newcommand{\indexalt}[3][]{{#2}\omdoc@index[#1]{#3}} % word in text and index +\newcommand{\indextoo}[2][]{{#2}\omdoc@index[#1]{#2}} % word in text and index +\newcommand{\@twin}[3][]{\ifindex\def\@test{#1}%% +\ifx\@test\@empty\def\@@idx{#2}\else\def\@@idx{#1}\fi% +\@ifundefined{mod@id} +{\index{\@@idx @#2!#3}% +\ifx\@test\@empty\def\@@idx{#3}\else\def\@@idx{#1}\fi% +\index{\@@idx @#2!#3}}% +{\index{\@@idx @{\importmodule{\mod@id} #2}!{\importmodule{\mod@id} #3}}% +\ifx\@test\@empty\def\@@idx{#3}\else\def\@@idx{#1}\fi% +\index{\@@idx @{\importmodule{\mod@id} #3}!{\importmodule{\mod@id} #2}}\fi}} +\newcommand{\twinalt}[4][]{#2\@twin[#1]{#3}{#4}} +\newcommand{\twintoo}[3][]{{#2 #3}\@twin[#1]{#2}{#3}} % and use the word compound too +\newcommand{\@atwin}[4][]{\ifindex\def\@test{#1}%% +\ifx\@test\@empty\def\@@idx{#2}\else\def\@@idx{#1}\fi% +\@ifundefined{mod@id}% +{\index{\@@idx @#2!#3!#4}% +\ifx\@test\@empty\def\@@idx{#3}\else\def\@@idx{#1}\fi +\index{\@@idx @#3!#2 (#4)}}% +{\index{\@@idx @{\importmodule{\mod@id} #2}!{\importmodule{\mod@id} #3}!{\importmodule{\mod@id} #4}} +\ifx\@test\@empty\def\@@idx{#3}\else\def\@@idx{#1}\fi% +\index{\@@idx @{\importmodule{\mod@id} #3}!{\importmodule{\mod@id} #2} ({\importmodule{\mod@id} #4})}\fi}} +\newcommand{\atwinalt}[5][]{#2\@atwin[#1]{#3}{#4}{#4}} +\newcommand{\atwintoo}[4][]{{#2 #3 #4}\@atwin[#1]{#2}{#3}{#4}} % and use it too +\def\omspace#1{\hspace*{#1}} +\endinput +%% +%% End of file `omtext.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/omtext/omtext.sty.ltxml b/Master/texmf-dist/tex/latex/stex/omtext/omtext.sty.ltxml new file mode 100644 index 00000000000..7d781b74e53 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/omtext/omtext.sty.ltxml @@ -0,0 +1,223 @@ +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +use Cwd qw(cwd abs_path); +DeclareOption('noindex',''); +RequirePackage('sref'); +Tag('omdoc:metadata',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1,autoOpen=>1); +sub declareFunctions{ + my ($stomach,$whatsit) = @_; + my $keyval = $whatsit->getArg(1); + my $funval = KeyVal($keyval,'functions') if KeyVal($keyval,'functions'); + my @funsymbs = ParseKeyValList($funval); + #Unread the function declarations at the Gullet + foreach (@funsymbs) { + $stomach->getGullet->unread(Tokenize('\lxDeclare[role=FUNCTION]{$'.$_.'$}')->unlist); + } + return; +} +Tag('omdoc:CMP', afterOpen => sub {AssignValue('_LastSeenCMP', $_[1], 'global');return;});#$ +DefParameterType('IfBeginFollows', sub { + my ($gullet) = @_; + $gullet->skipSpaces; + my $next = $gullet->readToken; + $gullet->unread($next); + $next = ToString($next); + #Hm, falling back to regexp handling, the $gullet->ifNext approach didn't work properly + return 1 unless ($next=~/^\\begin/); + return; + }, + reversion=>'', optional=>1); +DefKeyVal('omtext','functions','Undigested'); +DefKeyVal('omtext','display','Semiverbatim'); +DefKeyVal('omtext','for','Semiverbatim'); +DefKeyVal('omtext','from','Semiverbatim'); +DefKeyVal('omtext','type','Semiverbatim'); +DefKeyVal('omtext','title','Plain'); #Math mode in titles. +DefKeyVal('omtext','start','Plain'); #Math mode in start phrases +DefKeyVal('omtext','theory','Semiverbatim'); +DefKeyVal('omtext','continues','Semiverbatim'); +DefKeyVal('omtext','verbalizes','Semiverbatim'); +DefEnvironment('{omtext} OptionalKeyVals:omtext', + "<omdoc:omtext " + . "?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')() " + . "?&KeyVal(#1,'type')(type='&KeyVal(#1,'type')')() " + . "?&KeyVal(#1,'for')(for='&KeyVal(#1,'for')')() " + . "?&KeyVal(#1,'from')(from='&KeyVal(#1,'from')')()>" + . "?&KeyVal(#1,'title')(<dc:title>&KeyVal(#1,'title')</dc:title>)()" + . "<omdoc:CMP>" + . "?&KeyVal(#1,'start')(<ltx:text class='startemph'>&KeyVal(#1,'start')</ltx:text>)()" + . "#body" + ."</omdoc:omtext>"); +sub DefCMPEnvironment { + my ($proto, $replacement, %options) = @_; + my @before = $options{beforeDigest} ? ($options{beforeDigest}) : (); + push(@before, \&useCMPItemizations); + $options{beforeDigest} = \@before; + my @after = $options{afterDigestBegin} ? ($options{afterDigestBegin}) : (); + push(@after, \&declareFunctions); + $options{afterDigestBegin} = \@after; + DefEnvironment($proto, $replacement, %options); +} +sub DefCMPConstructor { + my ($proto, $replacement, %options) = @_; + my @before = $options{beforeDigest} ? ($options{beforeDigest}) : (); + push(@before, \&useCMPItemizations); + $options{beforeDigest} = \@before; + DefConstructor($proto, $replacement, %options); +}#$ +DefKeyVal('phrase','id','Semiverbatim'); +DefKeyVal('phrase','style','Semiverbatim'); +DefKeyVal('phrase','class','Semiverbatim'); +DefKeyVal('phrase','index','Semiverbatim'); +DefKeyVal('phrase','verbalizes','Semiverbatim'); +DefKeyVal('phrase','type','Semiverbatim'); +DefConstructor('\phrase OptionalKeyVals:phrase {}', + "<ltx:text %&KeyVals(#1)>#2</ltx:text>"); +DefConstructor('\nlex{}', + "<ltx:text class='nlex'>#1</ltx:text>"); +DefConstructor('\nlcex{}', + "<ltx:text type='nlcex'>#1</ltx:text>"); +DefConstructor('\sinlinequote [] {}', + "<ltx:quote type='inlinequote'>" + . "?#1(<dc:source>#1</dc:source>\n)()" + . "#2" + . "</ltx:quote>"); +DefEnvironment('{sblockquote} []', + "?#1(<omdoc:omtext type='quote'>" + . "<dc:source>#1</dc:source>" + . "#body" + . " </omdoc:omtext>)" + . "(<ltx:quote>#body</ltx:quote>)"); +DefConstructor('\lec{}', + "\n<omdoc:note type='line-end-comment'>#1</omdoc:note>"); +RawTeX(' +\newcommand\mygraphics[2][]{\includegraphics[#1]{#2}} +\newcommand\mycgraphics[2][]{\begin{center}\includegraphics[#1]{#2}\end{center}} +\newcommand\mybgraphics[2][]{\fbox{\includegraphics[#1]{#2}\end{center}}} +'); +DefConstructor('\indextoo[]{}', + "<omdoc:idx>" + . "<omdoc:idt>#2</omdoc:idt>" + . "<omdoc:ide ?#1(sort-by='#1')()>" + . "<omdoc:idp>#2</omdoc:idp>" + . "</omdoc:ide>" + ."</omdoc:idx>"); +DefConstructor('\indexalt[]{}{}', + "<omdoc:idx>" + . "<omdoc:idt>#2</omdoc:idt>" + . "<omdoc:ide ?#1(sort-by='#1')()>" + . "<omdoc:idp>#3</omdoc:idp>" + . "</omdoc:ide>" + ."</omdoc:idx>"); +DefConstructor('\twintoo[]{}{}', + "<omdoc:idx>" + . "<omdoc:idt>#2 #3</omdoc:idt>" + . "<omdoc:ide ?#1(sort-by='#1')()>" + . "<omdoc:idp>#2</omdoc:idp>" + . "<omdoc:idp>#3</omdoc:idp>" + . "</omdoc:ide>" + ."</omdoc:idx>"); +DefConstructor('\twinalt[]{}{}{}', + "<omdoc:idx>" + . "<omdoc:idt>#2</omdoc:idt>" + . "<omdoc:ide ?#1(sort-by='#1')()>" + . "<omdoc:idp>#2</omdoc:idp>" + . "<omdoc:idp>#3</omdoc:idp>" + . "</omdoc:ide>" + ."</omdoc:idx>"); +DefConstructor('\atwintoo[]{}{}{}', + "<omdoc:idx>" + . "<omdoc:idt>#2 #3</omdoc:idt>" + . "<omdoc:ide ?#1(sort-by='#1')()>" + . "<omdoc:idp>#2</omdoc:idp>" + . "<omdoc:idp>#3</omdoc:idp>" + . "<omdoc:idp>#4</omdoc:idp>" + . "</omdoc:ide>" + ."</omdoc:idx>"); + +DefConstructor('\atwinalt[]{}{}{}{}', + "<omdoc:idx>" + . "<omdoc:idt>#2</omdoc:idt>" + . "<omdoc:ide ?#1(sort-by='#1')()>" + . "<omdoc:idp>#2</omdoc:idp>" + . "<omdoc:idp>#3</omdoc:idp>" + . "<omdoc:idp>#4</omdoc:idp>" + . "</omdoc:ide>" + ."</omdoc:idx>"); +# needed? DefConstructor('\par',sub { $_[0]->maybeCloseElement('ltx:p'); },alias=>"\\par\n"); +Tag('omdoc:CMP', autoClose=>1, autoOpen=>1); +Tag('omdoc:omtext', autoClose=>1, autoOpen=>1); +DefConstructor('\footnote[]{}', + "<omdoc:note type='foot' ?#1(mark='#1')>#2</omdoc:note>"); +DefConstructor('\footnotemark[]',""); +DefConstructor('\footnotetext[]{}', + "<omdoc:note class='foot' ?#1(mark='#1')>#2</omdoc:note>"); +Tag('omdoc:omtext',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:omgroup',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:CMP',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:idx',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:ide',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:idt',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:note',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:metadata',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:meta',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:resource',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('ltx:p',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('ltx:tabular',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('ltx:thead',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('ltx:td',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('ltx:tr',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('ltx:caption',afterOpen=>\&numberIt,afterClose=>\&locateIt); +sub numberIt { + my($document,$node,$whatsit)=@_; + my(@parents)=$document->findnodes('ancestor::*[@xml:id]',$node); + my $prefix= (@parents ? $parents[$#parents]->getAttribute('xml:id')."." : ''); + my(@siblings)=$document->findnodes('preceding-sibling::*[@xml:id]',$node); + my $n = scalar(@siblings)+1; + my $id = ($node -> getAttribute('xml:id')); + my $localname = $node->localname; + $node->setAttribute('xml:id'=>$prefix."$localname$n") unless $id; + my $about = $node -> getAttribute('about'); + $node->setAttribute('about'=>'#'.$node->getAttribute('xml:id')) unless $about; + #Also, provide locators: + my $locator = $whatsit->getProperty('locator'); + #Need to inherit locators if missing: + $locator = (@parents ? $parents[$#parents]->getAttribute('stex:srcref') : '') unless $locator; + if ($locator) { + # There is a BUG with namespace declarations (or am I using the API wrongly??) which + # does not recognize the stex namespace. Hence, I need to redeclare it... + my $parent=$document->getNode; + if(! defined $parent->lookupNamespacePrefix("http://kwarc.info/ns/sTeX")) + { # namespace not already declared? + $document->getDocument->documentElement->setNamespace("http://kwarc.info/ns/sTeX","stex",0); + } + $node->setAttribute('stex:srcref'=>$locator); + }return;} + +sub locateIt { + my($document,$node,$whatsit)=@_; + #Estimate trailer locator: + my $trailer = $whatsit->getProperty('trailer'); + return unless $trailer; #Nothing we can do if the trailer isn't defined + $trailer = $trailer->getLocator; + return unless ($trailer && $trailer!~/^\s*$/); #Useless if broken + my $locator = $node->getAttribute('stex:srcref'); + if ($locator) { + $locator =~ /^(.+from=\d+;\d+)/; + my $from = $1; + $trailer =~ /(,to=\d+;\d+.+)$/; + my $to = $1; + $locator = $from.$to; + } else { + $locator = $trailer; #This should never happen + } + my $parent = $document->getNode; + if(! defined $parent->lookupNamespacePrefix("http://kwarc.info/ns/sTeX")) + { # namespace not already declared? + $document->getDocument->documentElement->setNamespace("http://kwarc.info/ns/sTeX","stex",0); + } + $node->setAttribute('stex:srcref' => $locator); + return; +} +1; diff --git a/Master/texmf-dist/tex/latex/stex/presentation/presentation.sty b/Master/texmf-dist/tex/latex/stex/presentation/presentation.sty new file mode 100644 index 00000000000..0b0362bf30c --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/presentation/presentation.sty @@ -0,0 +1,157 @@ +%% +%% This is file `presentation.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% presentation.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{presentation}[2012/01/28 v1.0 presentation for semantic macros] +\ProcessOptions +\RequirePackage{keyval}[1997/11/10] +\def\pres@default@precedence{0} +\def\pres@infty{1000000} +\def\iprec{\pres@infty} +\def\niprec{-\pres@infty} +\def\pres@initial@precedence{0} +\def\pres@current@precedence{\pres@initial@precedence} +\def\pres@default@lbrack{(}\def\pres@lbrack{\pres@default@lbrack} +\def\pres@default@rbrack{)}\def\pres@rbrack{\pres@default@rbrack} +\def\PrecSet#1{\def\pres@default@precedence{#1}} +\def\PrecWrite#1{\ifnum\pres@p>\pres@current@precedence\else{#1}\fi} +\def\prepost@clearkeys{\def\pres@p@key{\pres@default@precedence}\def\pres@pi@key{\niprec} +\def\pres@lbrack{\pres@default@lbrack}\def\pres@rbrack{\pres@default@rbrack}} +\define@key{prepost}{lbrack}{\def\pres@lbrack{#1}} +\define@key{prepost}{rbrack}{\def\pres@lbrack{#1}} +\define@key{prepost}{p}{\def\pres@p@key{#1}} +\define@key{prepost}{pi}{\def\pres@pi@key{#1}} +\newcommand{\prefix}[3][]%key, fn, arg +{\prepost@clearkeys\setkeys{prepost}{#1} +{#2}\pres@lbrack{\edef\pres@current@precedence{\pres@pi@key}#3}\pres@rbrack} +\newcommand{\postfix}[3][]%key, fn, arg +{\prepost@clearkeys\setkeys{prepost}{#1} +\pres@lbrack{\edef\pres@current@precedence{\pres@pi@key}#3}\pres@rbrack{#2}} +\newcommand{\funapp}[2]{\prefix{#1}{#2}} +\def\clearkeys{\let\pres@p@key=\relax +\let\pres@pi@key=\relax% +\let\pres@pi@key=\relax% +\let\pres@pii@key=\relax% +\let\pres@piii@key=\relax} +\define@key{mi}{nobrackets}[yes]{\def\pres@p@key{\pres@infty}% +\def\pres@pi@key{-\pres@infty}} +\define@key{mi}{lbrack}{\def\pres@lbrack@key{#1}} +\define@key{mi}{rbrack}{\def\pres@lbrack@key{#1}} +\define@key{mi}{p}{\def\pres@p@key{#1}} +\define@key{mi}{pi}{\def\pres@pi@key{#1}} +\def\prep@keys@mi% +{\edef\pres@lbrack{\@ifundefined{pres@lbrack@key}\pres@default@lbrack\pres@lbrack@key} +\edef\pres@rbrack{\@ifundefined{pres@rbrack@key}\pres@default@rbrack\pres@rbrack@key} +\edef\pres@p{\@ifundefined{pres@p@key}\pres@default@precedence\pres@p@key} +\edef\pres@pi{\@ifundefined{pres@pi@key}\pres@p\pres@pi@key}} +\newcommand{\mixfixi}[4][]%key, pre, arg, post +{\clearkeys\setkeys{mi}{#1}\prep@keys@mi% +\PrecWrite\pres@lbrack% +#2{\edef\pres@current@precedence{\pres@pi}#3}#4% +\PrecWrite\pres@rbrack} +\def\@assoc#1#2#3{% precedence, function, argv +\let\@tmpop=\relax% do not print the function the first time round +\@for\@I:=#3\do{\@tmpop% print the function +{\edef\pres@current@precedence{#1}\@I}% +\let\@tmpop=#2}}%update the function +\newcommand{\mixfixa}[5][]%key, pre, arg, post, assocop +{\clearkeys\setkeys{mi}{#1}\prep@keys@mi% +\PrecWrite\pres@lbrack{#2}{\@assoc\pres@pi{#5}{#3}}{#4}\PrecWrite\pres@rbrack} +\define@key{mii}{nobrackets}[yes]{\def\pres@p@key{\pres@infty}% +\def\pres@pi@key{-\pres@infty}\def\pres@pii@key{-\pres@infty}} +\define@key{mii}{lbrack}{\def\pres@lbrack@key{#1}} +\define@key{mii}{rbrack}{\def\pres@lbrack@key{#1}} +\define@key{mii}{p}{\def\pres@p@key{#1}} +\define@key{mii}{pi}{\def\pres@pi@key{#1}} +\define@key{mii}{pii}{\def\pres@pii@key{#1}} +\def\prep@keys@mii{\prep@keys@mi% +\edef\pres@pii{\@ifundefined{pres@pii@key}\pres@p\pres@pii@key}} +\newcommand{\mixfixii}[6][]%key, pre, arg1, mid, arg2, post +{\clearkeys\setkeys{mii}{#1}\prep@keys@mii% +\PrecWrite\pres@lbrack% write bracket if necessary +#2{\edef\pres@current@precedence{\pres@pi}#3}% +#4{\edef\pres@current@precedence{\pres@pii}#5}#6% +\PrecWrite\pres@rbrack} +\newcommand{\mixfixia}[7][]%key, pre, arg1, mid, arg2, post, assocop +{\clearkeys\setkeys{mii}{#1}\prep@keys@mii% +\PrecWrite\pres@lbrack% write bracket if necessary +#2{\edef\pres@current@precedence{\pres@pi}#3}% +#4{\@assoc\pres@pii{#7}{#5}}#6% +\PrecWrite\pres@rbrack} +\newcommand{\mixfixai}[7][]%key, pre, arg1, mid, arg2, post, assocop +{\clearkeys\setkeys{mii}{#1}\prep@keys@mii% +\PrecWrite\pres@lbrack% write bracket if necessary +#2{\@assoc\pres@pi{#7}{#3}}% +#4{\edef\pres@current@precedence{\pres@pii}#5}#6% +\PrecWrite\pres@rbrack} +\define@key{miii}{nobrackets}[yes]{\def\pres@p@key{\pres@infty}% +\def\pres@pi@key{-\pres@infty} +\def\pres@pii@key{-\pres@infty} +\def\pres@pii@key{-\pres@infty}} +\define@key{miii}{lbrack}{\def\pres@lbrack@key{#1}} +\define@key{miii}{rbrack}{\def\pres@lbrack@key{#1}} +\define@key{miii}{p}{\def\pres@p@key{#1}} +\define@key{miii}{pi}{\def\pres@pi@key{#1}} +\define@key{miii}{pii}{\def\pres@pii@key{#1}} +\define@key{miii}{piii}{\def\pres@piii@key{#1}} +\def\prep@keys@miii{\prep@keys@mii% +\edef\pres@piii{\@ifundefined{pres@piii@key}{\pres@p}{\pres@piii@key}}} +\newcommand{\mixfixiii}[8][]%key, pre, arg1, mid1, arg2, mid2, arg3, post +{\clearkeys\setkeys{miii}{#1}\prep@keys@miii% +\PrecWrite\pres@lbrack% write bracket if necessary +#2{\edef\pres@current@precedence{\pres@pi}#3}% +#4{\edef\pres@current@precedence{\pres@pii}#5}% +#6{\edef\pres@current@precedence{\pres@pii}#7}#8% +\PrecWrite\pres@rbrack} +\newcommand{\mixfixaii}[9][]%key, pre, arg1, mid1, arg2, mid2, arg3, post, sep +{\clearkeys\setkeys{miii}{#1}\prep@keys@miii% +\PrecWrite\pres@lbrack% write bracket if necessary +#2{\@assoc\pres@pi{#9}{#3}}% +#4{\edef\pres@current@precedence{\pres@pii}#5}% +#6{\edef\pres@current@precedence{\pres@pii}#7}#8% +\PrecWrite\pres@rbrack} +\newcommand{\mixfixiai}[9][]%key, pre, arg1, mid1, arg2, mid2, arg3, post, assocop +{\clearkeys\setkeys{miii}{#1}\prep@keys@miii% +\PrecWrite\pres@lbrack% write bracket if necessary +#2{\edef\pres@current@precedence{\pres@pi}#3}% +#4{\@assoc\pres@pi{#9}{#5}}% +#6{\edef\pres@current@precedence{\pres@pii}#7}#8% +\PrecWrite\pres@rbrack} +\newcommand{\mixfixiia}[9][]%key, pre, arg1, mid1, arg2, mid2, arg3, post,assocop +{\clearkeys\setkeys{miii}{#1}\prep@keys@miii% +\PrecWrite\pres@lbrack% write bracket if necessary +#2{\edef\pres@current@precedence{\pres@pi}#3}% +#4{\edef\pres@current@precedence{\pres@pii}#5}% +#6{\@assoc\pres@pi{#9}{#7}}#8% +\PrecWrite\pres@rbrack} +\newcommand{\prefixa}[4][]%keys, fn, arg, sep +{\prepost@clearkeys\setkeys{prepost}{#1} +{#2}\pres@lbrack{\@assoc\pres@pi@key{#3}{#4}}\pres@rbrack} +\newcommand{\postfixa}[4][]%keys, fn, arg, sep +{\prepost@clearkeys\setkeys{prepost}{#1} +\pres@lbrack{\@assoc\pres@pi@key{#3}{#4}}\pres@rbrack{#2}} +\newcommand{\infix}[4][]{\mixfixii[#1]{}{#3}{#2}{#4}{}} +\newcommand{\assoc}[3][]{\mixfixa[#1]{}{#3}{}{#2}} +\def\setegroup#1#2{\expandafter\def\csname #1@egroup\endcsname{#2}} +\def\elide#1#2#3{\@ifundefined{#1@egroup}% +{\def\@elevel{0} +\PackageError{presentation}{undefined egroup #1, assuming value 0}% +{When calling \protect\elide{#1}... the elision group #1 has be have\MessageBreak +been set by \protect\setegroup before, e.g. by \protect\setegroup{an}{0}.}}% +{\edef\@elevel{\csname #1@egroup\endcsname}}% +\ifnum\@elevel>#2\else{#3}\fi} +\def\provideEdefault#1#2{\expandafter\def\csname#1@edefault\endcsname{#2} +\@ifundefined{this@module}{}% +{\expandafter\g@addto@macro\this@module{\expandafter\def\csname#1@edefault\endcsname{#2}}}} +\def\setEdefault#1#2{\expandafter\def\csname #1@edfault\endcsname{#2}} +\def\fromEcontext#1{\csname #1@edefault\endcsname} +\newcommand{\arrayline}[2]{#1#2\\} +\newcommand{\arraycell}[1]{#1&} +\endinput +%% +%% End of file `presentation.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/presentation/presentation.sty.ltxml b/Master/texmf-dist/tex/latex/stex/presentation/presentation.sty.ltxml new file mode 100644 index 00000000000..c0154aaa9b3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/presentation/presentation.sty.ltxml @@ -0,0 +1,364 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +DefMacro('\iprec','1000000'); +DefMacro('\niprec','-1000000'); +DefConstructor('\crossrefOp[]{}', + "?#2(<ltx:XMApp role='CROSSREFOP'>" + . "<ltx:XMTok role='CROSSREFOP' cr='?#1(#1)(fun)'/>" + . "<ltx:XMWrap>#2</ltx:XMWrap>" + ."</ltx:XMApp>)()", + requireMath=>1); + +DefMacro('\prefix[]{}{}','\@prefix[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}'); +DefConstructor('\@prefix OptionalKeyVals:mi {}{}', + "<omdoc:rendering " + . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') " + . "argprec='&argument_precedence(#1)'>" + . "<m:mrow>" + . "#2" + . "<m:mrow>" + . "<m:mo fence='true'>(</m:mo>" + . "#3" + . "<m:mo fence='true'>)</m:mo>" + . "</m:mrow>" + . "</m:mrow>" + ."</omdoc:rendering>", + afterDigest=>sub { + #Default argument precedence is -\infty + my $keyval = $_[1]->getArg(1); + $keyval->setValue('pi',-1000000) unless ($keyval && defined($keyval->getValue('pi'))); + applyPrecedencePreferences(@_); + }, + properties=>sub { getSymmdefProperties($_[1]); }); +DefMacro('\postfix []{}{}','\@postfix[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}'); +DefConstructor('\@postfix OptionalKeyVals:mi {}{}', + "<omdoc:rendering " + . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') " + ."argprec='&argument_precedence(#1)'>" + . "<m:mrow>" + . "<m:mrow>" + . "<m:mo fence='true'>(</m:mo>" + . "#3" + . "<m:mo fence='true'>)</m:mo>" + . "</m:mrow>" + . "#2" + . "</m:mrow>" + ."</omdoc:rendering>", + afterDigest=>sub { + #Default argument precedence is -\infty + my $keyval = $_[1]->getArg(1); + $keyval->setValue('pi',-1000000) unless ($keyval && defined($keyval->getValue('pi'))); + applyPrecedencePreferences(@_); + }, + properties=>sub { getSymmdefProperties($_[1]); }); +DefConstructor('\funapp{}{}','<ltx:XMApp>#1#2</ltx:XMApp>'); +our $max_arguments = 10; #Currently max 10 arguments to \symdef. +DefKeyVal('mi','lbrack','Semiverbatim'); +DefKeyVal('mi','rbrack','Semiverbatim'); +DefKeyVal('mi','p','Semiverbatim'); +DefKeyVal('mi','pi','Semiverbatim'); +DefKeyVal('mi','pii','Semiverbatim'); #Why are we using this at mixfixai ? +DefKeyVal('mi','cd','Semiverbatim'); +DefKeyVal('mi','name','Semiverbatim'); +DefKeyVal('mi','nobrackets','Semiverbatim'); +sub argument_precedence { + my ($keyval) = @_; + my $attr = 'pi'; + my @precs = (); + foreach (1..$max_arguments) { + if (defined KeyVal($keyval,$attr)) { + push @precs, ToString(KeyVal($keyval,$attr)) + } else { + push @precs, ""; + } + $attr = $attr.'i'; + } + return join(" ",@precs)." "; +} +sub applyPrecedencePreferences { + my ($stomach,$whatsit) = @_; + my @args = $whatsit->getArgs; + my $keyvals = shift @args; + return unless (defined $keyvals); + my %kvhash = %{$keyvals->getKeyVals}; + #Default p (operator precedence) if not set: + my $default_precedence = LookupValue('default_precedence'); + $keyvals->setValue('p',$default_precedence) unless defined($keyvals->getValue('p')); + return unless (exists $kvhash{'nobrackets'}); + $keyvals->setValue('p',1000000); + $keyvals->setValue('pi',-1000000); + $keyvals->setValue('pii',-1000000); + $keyvals->setValue('piii',-1000000); + return; +}#$ +DefMacro('\mixfixi[]{}{}{}', + '\@mixfixi[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}' + . '{\ensuremath{\crossrefOp[fun]{#4}}}'); +DefConstructor('\@mixfixi OptionalKeyVals:mi {}{}{}', + "<omdoc:rendering" + . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')')" + . " argprec='&argument_precedence(#1)'>" + . "<m:mrow>" + . "<m:mo egroup='fence' fence='true'>(</m:mo>" + . "#2 #3 #4" + . "<m:mo egroup='fence' fence='true'>)</m:mo>" + . "</m:mrow>" + ."</omdoc:rendering>", + afterDigest=>sub { applyPrecedencePreferences(@_);}, + properties=>sub { getSymmdefProperties($_[1]); });#$ +DefMacro('\mixfixa[]{}{}{}{}', + '\@mixfixa[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}' + . '{\ensuremath{\crossrefOp[fun]{#4}}}' + . '{\ensuremath{\crossrefOp[fun]{\ensuremath{#5 }}}}'); +DefConstructor('\@mixfixa OptionalKeyVals:mi {}{}{}{}', + "<omdoc:rendering " + . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')')>" + . "<m:mrow>" + . "<m:mo egroup='fence' fence='true'>(</m:mo>" + . "#2" + . "<omdoc:iterate name='args' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>" + . "<omdoc:separator>#5</omdoc:separator>" + . "<omdoc:render name='arg' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>" + . "</omdoc:iterate>" + . "#4" + . "<m:mo egroup='fence' fence='true'>)</m:mo>" + . "</m:mrow>" + ."</omdoc:rendering>", + afterDigest=>sub { applyPrecedencePreferences(@_);}, + properties=>sub { getSymmdefProperties($_[1]); });#$ +DefKeyVal('mii','lbrack','Semiverbatim'); +DefKeyVal('mii','rbrack','Semiverbatim'); +DefKeyVal('mii','p','Semiverbatim'); +DefKeyVal('mii','pi','Semiverbatim'); +DefKeyVal('mii','pii','Semiverbatim'); +DefKeyVal('mii','cd','Semiverbatim'); +DefKeyVal('mii','name','Semiverbatim'); +DefKeyVal('mii','nobrackets','Semiverbatim'); +DefMacro('\mixfixii[]{}{}{}{}{}', + '\@mixfixii[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}' + . '{\ensuremath{\crossrefOp[fun]{#4}}}{\ensuremath{#5 }}' + . '{\ensuremath{\crossrefOp[fun]{#6}}}'); +DefConstructor('\@mixfixii OptionalKeyVals:mi {}{}{}{}{}', + "<omdoc:rendering " + . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') " + . "argprec='&argument_precedence(#1)'>" + . "<m:mrow>" + . "<m:mo egroup='fence' fence='true'>(</m:mo>" + . "#2 #3 #4 #5 #6" + . "<m:mo egroup='fence' fence='true'>)</m:mo>" + . "</m:mrow>" + ."</omdoc:rendering>", + afterDigest=>sub { applyPrecedencePreferences(@_);}, + properties=>sub { getSymmdefProperties($_[1]); });#$ +DefMacro('\mixfixia[]{}{}{}{}{}{}', + '\@mixfixia[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}' + . '{\ensuremath{\crossrefOp[fun]{#4}}}{\ensuremath{#5 }}' + . '{\ensuremath{\crossrefOp[fun]{#6}}}' + . '{\ensuremath{\crossrefOp[fun]{#7}}}'); +DefConstructor('\@mixfixia OptionalKeyVals:mii {}{}{}{}{}{}', + "<omdoc:rendering " + . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') " + . " argprec='&argument_precedence(#1)'>" + . "<m:mrow>" + . "<m:mo egroup='fence' fence='true'>(</m:mo>" + . "#2 #3 #4" + . "<omdoc:iterate name='args' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>" + . "<omdoc:separator>#7</omdoc:separator>" + . "<omdoc:render name='arg' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>" + . "</omdoc:iterate>" + . "#6" + . "<m:mo egroup='fence' fence='true'>)</m:mo>" + . "</m:mrow>" + ."</omdoc:rendering>", + afterDigest=>sub { applyPrecedencePreferences(@_);}, + properties=>sub { getSymmdefProperties($_[1]); });#$ +DefMacro('\mixfixai[]{}{}{}{}{}{}', + '\@mixfixai[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}' + .'{\ensuremath{\crossrefOp[fun]{#4}}}{\ensuremath{#5 }}' + .'{\ensuremath{\crossrefOp[fun]{#6}}}' + .'{\ensuremath{\crossrefOp[fun]{#7}}}'); +DefConstructor('\@mixfixai OptionalKeyVals:mi {}{}{}{}{}{}', + "<omdoc:rendering " + . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') " + . " argprec='&argument_precedence(#1)'>" + . "<m:mrow>" + . "<m:mo egroup='fence' fence='true'>(</m:mo>" + . "#2" + . "<omdoc:iterate name='args' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>" + . "<omdoc:separator>#7</omdoc:separator>" + . "<omdoc:render name='arg' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>" + . "</omdoc:iterate>" + . "#4 #5 #6" + . "<m:mo egroup='fence' fence='true'>)</m:mo>" + . "</m:mrow>" + ."</omdoc:rendering>", + afterDigest=>sub { applyPrecedencePreferences(@_);}, + properties=>sub { getSymmdefProperties($_[1]); });#$ +DefKeyVal('miii','lbrack','Semiverbatim'); +DefKeyVal('miii','rbrack','Semiverbatim'); +DefKeyVal('miii','p','Semiverbatim'); +DefKeyVal('miii','pi','Semiverbatim'); +DefKeyVal('miii','pii','Semiverbatim'); +DefKeyVal('miii','piii','Semiverbatim'); +DefKeyVal('miii','cd','Semiverbatim'); +DefKeyVal('miii','name','Semiverbatim'); +DefKeyVal('miii','nobrackets','Semiverbatim'); +DefMacro('\mixfixiii[]{}{}{}{}{}{}{}', + '\@mixfixiii[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}' + . '{\ensuremath{\crossrefOp[fun]{#4}}}{\ensuremath{#5 }}' + . '{\ensuremath{\crossrefOp[fun]{#6}}}{\ensuremath{#7 }}' + . '{\ensuremath{\crossrefOp[fun]{#8}}}'); +DefConstructor('\@mixfixiii OptionalKeyVals:mi {}{}{}{}{}{}{}', + "<omdoc:rendering " + . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') " + . " argprec='&argument_precedence(#1)'>" + . "<m:mrow>" + . "<m:mo egroup='fence' fence='true'>(</m:mo>" + . "#2 #3 #4 #5 #6 #7 #8" + . "<m:mo egroup='fence' fence='true'>)</m:mo>" + . "</m:mrow>" + ."</omdoc:rendering>", + afterDigest=>sub { applyPrecedencePreferences(@_);}, + properties=>sub { getSymmdefProperties($_[1]); });#$ +DefMacro('\mixfixaii[]{}{}{}{}{}{}{}{}', + '\@mixfixaii[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}' + . '{\ensuremath{\crossrefOp[fun]{#4}}}{\ensuremath{#5 }}' + . '{\ensuremath{\crossrefOp[fun]{#6}}}{\ensuremath{#7 }}' + . '{\ensuremath{\crossrefOp[fun]{#8}}}' + . '{\ensuremath{\crossrefOp[fun]{#9}}}'); +DefConstructor('\@mixfixaii OptionalKeyVals:mi {}{}{}{}{}{}{}{}', + "<omdoc:rendering " + . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') " + . " argprec='&argument_precedence(#1)'>" + . "<m:mrow>" + . "<m:mo egroup='fence' fence='true'>(</m:mo>" + . "#2" + . "<omdoc:iterate name='args' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>" + . "<omdoc:separator>#9</omdoc:separator>" + . "<omdoc:render name='arg' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>" + . "</omdoc:iterate>" + . "#4 #5 #6 #7 #8" + . "<m:mo egroup='fence' fence='true'>)</m:mo>" + . "</m:mrow>" + ."</omdoc:rendering>", + afterDigest=>sub { applyPrecedencePreferences(@_);}, + properties=>sub { getSymmdefProperties($_[1]); });#$ +DefMacro('\mixfixiai[]{}{}{}{}{}{}{}{}', + '\@mixfixiai[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}' + . '{\ensuremath{\crossrefOp[fun]{#4}}}{\ensuremath{#5 }}' + . '{\ensuremath{\crossrefOp[fun]{#6}}}{\ensuremath{#7 }}' + . '{\ensuremath{\crossrefOp[fun]{#8}}}' + . '{\ensuremath{\crossrefOp[fun]{#9}}}'); +DefConstructor('\@mixfixiai OptionalKeyVals:mi {}{}{}{}{}{}{}', + "<omdoc:rendering " + . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') " + . " argprec='&argument_precedence(#1)'>" + . "<m:mrow>" + . "<m:mo egroup='fence' fence='true'>(</m:mo>" + . "#2 #3 #4" + . "<omdoc:iterate name='args' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>" + . "<omdoc:separator>#9</omdoc:separator>" + . "<omdoc:render name='arg' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>" + . "</omdoc:iterate>" + . "#6 #7 #8" + . "<m:mo egroup='fence' fence='true'>)</m:mo>" + . "</m:mrow>" + ."</omdoc:rendering>", + afterDigest=>sub { applyPrecedencePreferences(@_);}, + properties=>sub { getSymmdefProperties($_[1]); });#$ +DefMacro('\mixfixiia[]{}{}{}{}{}{}{}{}', + '\@mixfixiia[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}' + . '{\ensuremath{\crossrefOp[fun]{#4}}}{\ensuremath{#5 }}' + . '{\ensuremath{\crossrefOp[fun]{#6}}}{\ensuremath{#7 }}' + . '{\ensuremath{\crossrefOp[fun]{#8}}}' + . '{\ensuremath{\crossrefOp[fun]{#9}}}'); +DefConstructor('\@mixfixiia OptionalKeyVals:mi {}{}{}{}{}{}{}', + "<omdoc:rendering " + . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') " + . " argprec='&argument_precedence(#1)'>" + . "<m:mrow>" + . "<m:mo egroup='fence' fence='true'>(</m:mo>" + . "#2 #3 #4 #5 #6" + . "<omdoc:iterate name='args' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>" + . "<omdoc:separator>#9</omdoc:separator>" + . "<omdoc:render name='arg' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>" + . "</omdoc:iterate>" + . "#8" + . "<m:mo egroup='fence' fence='true'>)</m:mo>" + . "</m:mrow>" + ."</omdoc:rendering>", + afterDigest=>sub { applyPrecedencePreferences(@_);}, + properties=>sub { getSymmdefProperties($_[1]); });#$ +DefMacro('\prefixa[]{}{}{}','\@prefixa[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}{\ensuremath{#4 }}'); +DefConstructor('\@prefixa OptionalKeyVals:mi {}{}{}', + "<omdoc:rendering " + . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') " + . "argprec='&argument_precedence(#1)'>" + . "<m:mrow>" + . "#2" + . "<m:mrow>" + . "<m:mo fence='true'>(</m:mo>" + . "<omdoc:iterate name='args' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>" + . "<omdoc:separator>#4</omdoc:separator>" + . "<omdoc:render name='arg' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>" + . "</omdoc:iterate>" + . "<m:mo fence='true'>)</m:mo>" + . "</m:mrow>" + . "</m:mrow>" + ."</omdoc:rendering>", + afterDigest=>sub { + #Default argument precedence is -\infty + my $keyval = $_[1]->getArg(1); + $keyval->setValue('pi',-1000000) unless ($keyval && defined($keyval->getValue('pi'))); + applyPrecedencePreferences(@_); + }, + properties=>sub { getSymmdefProperties($_[1]); }); +DefMacro('\postfixa []{}{}{}','\@postfixa[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}{\ensuremath{#4 }}'); +DefConstructor('\@postfixa OptionalKeyVals:mi {}{}{}', + "<omdoc:rendering " + . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') " + ."argprec='&argument_precedence(#1)'>" + . "<m:mrow>" + . "<m:mrow>" + . "<m:mo fence='true'>(</m:mo>" + . "<omdoc:iterate name='args' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>" + . "<omdoc:separator>#4</omdoc:separator>" + . "<omdoc:render name='arg' " + . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>" + . "</omdoc:iterate>" + . "<m:mo fence='true'>)</m:mo>" + . "</m:mrow>" + . "#2" + . "</m:mrow>" + ."</omdoc:rendering>", + afterDigest=>sub { + #Default argument precedence is -\infty + my $keyval = $_[1]->getArg(1); + $keyval->setValue('pi',-1000000) unless ($keyval && defined($keyval->getValue('pi'))); + applyPrecedencePreferences(@_); + }, + properties=>sub { getSymmdefProperties($_[1]); }); +RawTeX(' +\newcommand{\infix}[4][]{\mixfixii[#1]{}{#3}{#2}{#4}{}} +\newcommand{\assoc}[3][]{\mixfixa[#1]{}{#3}{}{#2}} +'); +DefConstructor('\arrayline{}{}','<ltx:XMRow>#1<ltx:XMCell>#2</ltx:XMCell></ltx:XMRow>'); +DefConstructor('\arraycell{}','<ltx:XMCell>#1</ltx:XMCell>'); +1; diff --git a/Master/texmf-dist/tex/latex/stex/problem/problem.sty b/Master/texmf-dist/tex/latex/stex/problem/problem.sty new file mode 100644 index 00000000000..220ad52bb29 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/problem/problem.sty @@ -0,0 +1,117 @@ +%% +%% This is file `problem.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% problem.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{problem}[2012/01/28 v0.9c Semantic Markup for Problems] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\newif\ifexnotes\exnotesfalse\DeclareOption{notes}{\exnotestrue} +\newif\ifhints\hintsfalse\DeclareOption{hints}{\hintstrue} +\newif\ifsolutions\solutionsfalse\DeclareOption{solutions}{\solutionstrue} +\newif\ifpts\ptsfalse\DeclareOption{pts}{\ptstrue} +\newif\ifmin\minfalse\DeclareOption{min}{\mintrue} +\newif\ifboxed\boxedfalse\DeclareOption{boxed}{\boxedtrue} +\newif\ifextract\extractfalse\DeclareOption{extract}{\extracttrue} +\ProcessOptions +\RequirePackage{keyval}[1997/11/10] +\RequirePackage{xcomment} +\RequirePackage{sref} +\srefaddidkey[prefix=prob.]{problem} +\addmetakey{problem}{pts} +\addmetakey{problem}{min} +\addmetakey*{problem}{title} +\addmetakey{problem}{refnum} +\newsavebox{\probbox} +\newcounter{problem}[section] +\def\prob@number{\ifx\inclprob@refnum\@empty +\ifx\problem@refnum\@empty\thesection.\theproblem\else\problem@refnum\fi +\inclprob@refnum\fi} +\def\prob@heading{Problem \prob@number% +\ifx\sref@id\@empty\else{\sref@label@id{Problem \thesection.\theproblem}}\fi% +\ifx\inclprob@title\@empty% if there is no outside title +\ifx\problem@title\@empty{:\quad}\else{\quad(\problem@title)\hfill\\}\fi +\else\quad(\inclprob@title)\hfill\\\fi}% else show the outside title +\ifboxed +\newenvironment{problem}[1][]{\metasetkeys{problem}{#1}\sref@target% +\stepcounter{problem}\show@pts\show@min\record@problem% +\begin{lrbox}{\probbox}\begin{minipage}{.9\textwidth}\ignorespaces} +{\end{minipage}\end{lrbox} +\setbox0=\hbox{\begin{minipage}{.9\textwidth}% +\noindent\textbf\prob@heading\rm% +\end{minipage}} +\smallskip\noindent\fbox{\vbox{\box0\vspace*{.2em}\usebox\probbox}}\smallskip} +\else +\newenvironment{problem}[1][]{\metasetkeys{problem}{#1}\sref@target% +\stepcounter{problem}\show@pts\show@min\record@problem% +\par\noindent\textbf\prob@heading\rm\ignorespaces} +{\smallskip} +\fi%boxed +\def\record@problem{\protected@write\@auxout{}% +{\string\@problem{\prob@number}% +{\ifx\inclprob@pts\@empty\problem@pts\else\inclprob@pts\fi}% +{\ifx\inclprob@min\@empty\problem@min\else\inclprob@min\fi}}} +\def\@problem#1#2#3{} +\define@key{soln}{id}{\def\soln@id{#1}} +\define@key{soln}{for}{\def\soln@for{#1}} +\define@key{soln}{height}{\def\soln@height{#1}} +\ifsolutions +\newenvironment{solution}[1][]% +{\hrule\smallskip{\bf Solution: }\begin{small}}% +{\hrule\end{small}} +\else\newxcomment[]{solution}\fi +\ifexnotes +\newenvironment{exnote}[1][]% +{\par\noindent\hrule\smallskip{\bf Note: }\small} +{\smallskip\hrule} +\else%ifexnotes +\newxcomment[]{exnote} +\fi%ifexnotes +\ifhints +\newenvironment{hint}[1][]% +{\par\noindent\hrule\smallskip{\bf Hint: }\small} +{\smallskip\hrule} +\else%ifhints +\newxcomment[]{hint} +\fi%ifhints +\ifextract +\newwrite\problem@file +\immediate\openout\problem@file=\jobname-problems.tex +\AtEndDocument{\closeout\problem@file} +\fi +\addmetakey{inclprob}{pts} +\addmetakey{inclprob}{min} +\addmetakey*{inclprob}{title} +\addmetakey{inclprob}{refnum} +\clear@inclprob@keys +\newcommand{\includeproblem}[2][]{% +\bgroup\metasetkeys{inclprob}{#1}\input{#2}\ifsolutions\newpage\fi\egroup +\ifextract\def\@test{#1} +\def\prob@num{\ifx\inclprob@refnum\@empty\thesection.\theproblem\else\inclprob@refnum\fi} +\def\inclprob@keys{#1\ifx\@test\@empty\else,\fi refnum=\prob@num} +\protected@write\problem@file{}{\string\includeproblem[\inclprob@keys]{#2}} +\fi} +\def\pts#1{\ifpts\marginpar{#1 pt}\fi} +\def\min#1{\ifmin\marginpar{#1 min}\fi} +\AtEndDocument{\ifpts\message{Total: \arabic{pts} points}\fi +\ifmin\message{Total: \arabic{min} minutes}\fi} +\newcounter{pts} +\def\show@pts{\ifx\inclprob@pts\@empty% +\ifx\problem@pts\@empty\else% +\ifpts\marginpar{\problem@pts pt\smallskip}\addtocounter{pts}{\problem@pts}\fi% +\fi\else% +\ifpts\marginpar{\inclprob@pts pt\smallskip}\addtocounter{pts}{\inclprob@pts}\fi% +\fi} +\newcounter{min} +\def\show@min{\ifx\inclprob@min\@empty% +\ifx\problem@min\@empty\else% +\ifmin\marginpar{\problem@min min}\addtocounter{min}{\problem@min}\fi% +\fi\else% +\ifmin\marginpar{\inclprob@min min}\addtocounter{min}{\inclprob@min}\fi +\fi} +\endinput +%% +%% End of file `problem.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/problem/problem.sty.ltxml b/Master/texmf-dist/tex/latex/stex/problem/problem.sty.ltxml new file mode 100644 index 00000000000..85fb12e7bbe --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/problem/problem.sty.ltxml @@ -0,0 +1,75 @@ +RawTeX(' +\newif\ifexnotes\exnotesfalse +\newif\ifhints\hintsfalse +\newif\ifsolutions\solutionsfalse +\newif\ifpts\ptsfalse +\newif\ifmin\minfalse +\newif\ifboxed\boxedfalse +\newif\ifextract\extractfalse +'); +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +RequirePackage('sref'); +RegisterNamespace('prob'=>"http://omdoc.org/ontology/problems#"); +RegisterDocumentNamespace('prob'=>"http://omdoc.org/ontology/problems#"); +DefEnvironment('{problem} OptionalKeyVals:problem', + "<omdoc:exercise ?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')()>" + . "?&KeyVal(#1,'title')(<dc:title>&KeyVal(#1,'title')</dc:title>)()" + . "?&KeyVal(#1,'min')(" + . "<omdoc:meta property='prob:solvedinminutes' prob:dummy='for the namespace'>" + . "&KeyVal(#1,'min')" + . "</omdoc:meta>)()" + . "?&KeyVal(#1,'pts')(" + . "<omdoc:meta property='prob:points' prob:dummy='for the namespace'>" + . "&KeyVal(#1,'pts')" + . "</omdoc:meta>)()" + . "<omdoc:CMP><omdoc:p>#body" + ."</omdoc:exercise>", + afterDigest => sub { + my ($stomach,$kv)=@_; + my $kvi = LookupValue('inclprob'); + my @keys = qw(id title min pts); + my @vals = $kvi && map($kvi->getValue($_), @keys); + foreach my $i(0..$#vals) { + $kv->setValue($keys[$i],$vals[$i]) if $vals[$i]; + } + return;});#$ +DefKeyVal('soln','id','Semiverbatim'); +DefKeyVal('soln','height','Semiverbatim'); +DefKeyVal('soln','for','Semiverbatim'); +DefEnvironment('{solution} OptionalKeyVals:soln', + "<omdoc:solution ?&KeyVals(#1,'for')(for='&KeyVal(#1,'for')')()>" + . "#body" + . "</omdoc:solution>"); +DefEnvironment('{exnote}',"<omdoc:hint><omdoc:CMP><omdoc:p>#body</omdoc:hint>"); +DefEnvironment('{hint}',"<omdoc:hint><omdoc:CMP><omdoc:p>#body</omdoc:hint>"); +DefConstructor('\pts{}',""); +DefConstructor('\min{}',""); +DefKeyVal('prob','pts','Semiverbatim'); +DefKeyVal('prob','min','Semiverbatim'); +DefKeyVal('prob','title','Semiverbatim'); +DefConstructor('\includeproblem OptionalKeyVals:prob Semiverbatim', + "<omdoc:ref type='cite' xref='#2'>" + . "?&KeyVal(#1,'title')(<dc:title>&KeyVal(#1,'title')</dc:title>)()" + . "?&KeyVal(#1,'min')(" + . "<omdoc:meta property='prob:solvedinminutes' prob:dummy='for the namespace'>" + . "&KeyVal(#1,'min')" + . "</omdoc:meta>)()" + . "?&KeyVal(#1,'pts')(" + . "<omdoc:meta property='prob:points' prob:dummy='for the namespace'>" + . "&KeyVal(#1,'pts')" + . "</omdoc:meta>)()" + ."</omdoc:ref>", + afterDigest => sub{ + my ($stomach,$kv) = @_; + AssignValue('inclprob',$kv) if $kv; + }); +Tag('omdoc:exercise',afterOpen=>\&numberIt); +Tag('omdoc:solution',afterOpen=>\&numberIt); +Tag('omdoc:hint',afterOpen=>\&numberIt); +Tag('omdoc:exercise',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:solution',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:hint',afterOpen=>\&numberIt,afterClose=>\&locateIt); +1; diff --git a/Master/texmf-dist/tex/latex/stex/rdfmeta/rdfmeta.sty b/Master/texmf-dist/tex/latex/stex/rdfmeta/rdfmeta.sty new file mode 100644 index 00000000000..cdfd81223cc --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/rdfmeta/rdfmeta.sty @@ -0,0 +1,68 @@ +%% +%% This is file `rdfmeta.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% rdfmeta.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{rdfmeta}[2012/01/28 v0.2 Metadata key upgrades] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\newif\if@rdfmeta@sectioning\@rdfmeta@sectioningfalse +\DeclareOption{sectioning}{\@rdfmeta@sectioningtrue} +\ProcessOptions +\RequirePackage{sref,modules} +\newcommand\keydef[2]{\addmetakey{#1}{#2}% +\expandafter\g@addto@macro\this@module{\addmetakey{#1}{#2}}} +\newcommand\listkeydef[2]{\addmetalistkey{#1}{#2}% +\expandafter\g@addto@macro\this@module{\addmetalistkey{#1}{#2}}} +\def\@yes@{yes} +\addmetakey*{upgrade}{idlabel} +\addmetakey*{upgrade}{optarg} +\addmetakey*[yes]{upgrade}{optargstar} +\addmetakey*{upgrade}{keygroup} +\def\rdfmeta@upgrade{\@ifstar\rdfmeta@upgrade@star\rdfmeta@upgrade@nostar} +\newcommand\rdfmeta@upgrade@nostar[2][]{\metasetkeys{upgrade}{#1}% +\ifx\upgrade@keygroup\@empty\def\@@group{#2}\else\def\@@group{\upgrade@keygroup}\fi +\rdfmeta@upgrade@base{#2}{\@nameuse{\@@group @\upgrade@optarg}}} +\newcommand\rdfmeta@upgrade@star[2][]{\metasetkeys{upgrade}{#1}% +\ifx\upgrade@keygroup\@empty\def\@@group{#2}\else\def\@@group{\upgrade@keygroup}\fi +\rdfmeta@upgrade@base@star{#2}{\@nameuse{\@@group @\upgrade@optarg}}} +\newcommand{\rdfmeta@upgrade@base}[2]{\@ifundefined{#1}{}% +{\message{redefining macro #1,} +\ifx\upgrade@idlabel\@empty\srefaddidkey{#1}\else\srefaddidkey[prefix=\upgrade@idlabel]{#1}\fi% +\expandafter\let\csname rdfmeta@#1@old\expandafter\endcsname\csname #1\endcsname% +\expandafter\renewcommand\csname #1\endcsname[2][]% +{\metasetkeys{#1}{##1}\@nameuse{rdfmeta@#1@old}[#2]{##2}} +\addmetakey*\@@group{\upgrade@optarg}}} +\newcommand\rdfmeta@upgrade@base@star[2]{\@ifundefined{#1}{}% +{\message{redefining macros #1 and #1*,} +\ifx\upgrade@idlabel\@empty\srefaddidkey{#1}\else\srefaddidkey[prefix=\upgrade@idlabel]{#1}\fi% +\expandafter\let\csname rdfmeta@#1@old\expandafter\endcsname\csname #1\endcsname% +\expandafter\renewcommand\csname #1\endcsname% +{\@ifstar{\@nameuse{rdfmeta@#1@star}}{\@nameuse{rdfmeta@#1@nostar}}}% +\expandafter\newcommand\csname rdfmeta@#1@nostar\endcsname[2][]% +{\metasetkeys{#1}{##1}\edef\@test{#2}% +\ifx\@test\@empty\@nameuse{rdfmeta@#1@old}{##2}% +\else\@nameuse{rdfmeta@#1@old}[#2]{##2}\fi}% +\ifx\upgrade@optargstar\@yes@% +\expandafter\newcommand\csname rdfmeta@#1@star\endcsname[2][]% +{\metasetkeys{#1}{##1}\@nameuse{rdfmeta@#1@old}*[#2]{##2}}% +\else% +\expandafter\newcommand\csname rdfmeta@#1@star\endcsname[2][]% +{\metasetkeys{#1}{##1}\@nameuse{rdfmeta@#1@old}*{##2}}% +\fi% +\addmetakey*\@@group{\upgrade@optarg}}} +\if@rdfmeta@sectioning +\message{redefining sectioning commands!} +\rdfmeta@upgrade*[optarg=short,optargstar=no]{part} +\rdfmeta@upgrade*[optarg=short,optargstar=no]{chapter} +\rdfmeta@upgrade*[optarg=short,optargstar=no]{section} +\rdfmeta@upgrade*[optarg=short,optargstar=no]{subsection} +\rdfmeta@upgrade*[optarg=short,optargstar=no]{subsubsection} +\rdfmeta@upgrade*[optarg=short,optargstar=no]{paragraph} +\fi +\endinput +%% +%% End of file `rdfmeta.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/rdfmeta/rdfmeta.sty.ltxml b/Master/texmf-dist/tex/latex/stex/rdfmeta/rdfmeta.sty.ltxml new file mode 100644 index 00000000000..f4683274c06 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/rdfmeta/rdfmeta.sty.ltxml @@ -0,0 +1,8 @@ +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +DeclareOption('showmeta',''); +DeclareOption('sectioning',''); +DefConstructor('\keydef',''); +DefConstructor('\listkeydef',''); +1; 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..f8cb314b7c3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/reqdoc/reqdoc.sty @@ -0,0 +1,66 @@ +%% +%% 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}[2012/01/28 v0.3 Semantic Requirement Documents] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\newif\if@deps\@depsfalse +\DeclareOption{recorddeps}{\@depstrue} +\ProcessOptions +\RequirePackage{sref} +\RequirePackage{longtable} +\newif\ifreqsnum\reqsnumfalse +\addmetakey{reqs}{numbering} +\addmetakey[R]{reqs}{prefix} +\def\reqs@no{no} +\newenvironment{requirements}[1][]% +{\metasetkeys{reqs}{#1}\ifx\reqs@numbering\reqs@no\reqsnumfalse\else\reqsnumtrue\fi}{} +\addmetakey{req}{id} +\addmetakey{req}{prio} +\addmetakey{req}{refs} +\addmetakey{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][]% +{\metasetkeys{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][]{\metasetkeys{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][]% +{\metasetkeys{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..fd9fa13a7b8 --- /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>"); +DefEnvironment('{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>"); +DefConstructor('\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; diff --git a/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty b/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty new file mode 100644 index 00000000000..35d2470cd02 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty @@ -0,0 +1,84 @@ +%% +%% This is file `sproof.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sproof.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{sproof}[2012/01/28 v1.0 Semantic Markup for Proofs] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\ProcessOptions +\RequirePackage{sref} +\srefaddidkey{spf} +\addmetakey*{spf}{display} +\addmetakey{spf}{for} +\addmetakey{spf}{from} +\addmetakey*[\sproof@box]{spf}{proofend} +\addmetakey{spf}{type} +\addmetakey*{spf}{title} +\addmetakey{spf}{continues} +\addmetakey{spf}{functions} +\def\spf@flow{flow} +\newenvironment{pst@with@label}[1]% +{\edef\pst@label{#1}\advance\count10 by 1\count\count10=1} +{\advance\count10 by -1} +\def\the@pst@label{\pst@make@label\pst@label{\number\count\count10}} +\def\pst@make@label@long#1#2{\@for\@I:=#1\do{\@I.}#2} +\def\pst@make@label@angles#1#2{\ensuremath{\@for\@I:=#1\do{\rangle}}#2} +\def\pst@make@label@short#1#2{#2} +\def\pst@make@label@empty#1#2{} +\def\pstlabelstyle#1{\def\pst@make@label{\@nameuse{pst@make@label@#1}}} +\pstlabelstyle{long} +\def\next@pst@label{\global\advance\count\count10 by 1} +\def\sproof@box{\hbox{\vrule\vbox{\hrule width 6 pt\vskip 6pt\hrule}\vrule}} +\def\spf@proofend{\sproof@box} +\def\sproofend{\ifx\spf@proofend\@empty\else\hfil\null\nobreak\hfill\spf@proofend\par\smallskip\fi} +\def\sProofEndSymbol#1{\def\sproof@box{#1}} +\def\spf@proofsketch@kw{Proof Sketch} +\def\spf@proof@kw{Proof} +\newcommand{\spfsketch}[2][]{\metasetkeys{spf}{#1}\sref@target +\ifx\spf@display\spf@flow\else{\stDMemph{\ifx\spf@type\@empty\spf@proofsketch@kw\else\spf@type\fi}:}\fi{ #2}% +\sref@label@id{this \ifx\spf@type\@empty\spf@proofsketch@kw\else\spf@type\fi}} +\newenvironment{spf@proof}[2][]{\metasetkeys{spf}{#1}\sref@target +\count10=10 +\ifx\spf@display\spf@flow\else{\stDMemph{\ifx\spf@type\@empty\spf@proof@kw\else\spf@type\fi}:}\fi{ #2}% +\sref@label@id{this \ifx\spf@type\@empty\spf@proof@kw\else\spf@type\fi} +\def\pst@label{}\newcount\pst@count% initialize the labeling mechanism +\begin{description}\begin{pst@with@label}{P}} +{\end{pst@with@label}\end{description}} +\newenvironment{sproof}[2][]{\begin{spf@proof}[#1]{#2}}{\sproofend\end{spf@proof}} +\newenvironment{sProof}[2][]{\begin{spf@proof}[#1]{#2}}{\end{spf@proof}} +\newcommand{\spfidea}[2][]{\metasetkeys{spf}{#1}% +\stDMemph{\ifx\spf@type\@empty{Proof Idea}\else\spf@type\fi:} #2\sproofend} +\newenvironment{spfstep}[1][]{\metasetkeys{spf}{#1} +\ifx\spf@display\spf@flow\else\item[\the@pst@label]\fi +\ifx\spf@title\@empty\else{(\stDMemph{\spf@title})}\fi} +{\next@pst@label} +\newenvironment{sproofcomment}[1][]{\metasetkeys{spf}{#1} +\ifx\spf@display\spf@flow\else\item[\the@pst@label]\fi} +{\next@pst@label} +\newenvironment{spfcases}[2][]{\metasetkeys{spf}{#1} +\def\@test{#2}\ifx\@test\empty\else +\ifx\spf@display\spf@flow {#2}\else\item[\the@pst@label]{#2} \fi\fi +\begin{pst@with@label}{\pst@label,\number\count\count10}} +{\end{pst@with@label}\next@pst@label} +\newenvironment{spfcase}[2][]{\metasetkeys{spf}{#1} +\ifx\spf@display\spf@flow\else\item[\the@pst@label]\fi +\def\@test{#2}\ifx\@test\@empty\else{\stDMemph{#2}:}\fi +\begin{pst@with@label}{\pst@label,\number\count\count10}} +{\ifx\spf@display\spf@flow\else\sproofend\fi\end{pst@with@label}\next@pst@label} +\newenvironment{subproof}[1][]% +{\begin{pst@with@label}{\pst@label,\number\count\count10}} +{\ifx\spf@display\spf@flow\else\sproofend\fi\end{pst@with@label}} +\srefaddidkey{just} +\addmetakey{just}{method} +\addmetakey{just}{premises} +\addmetakey{just}{args} +\newenvironment{justification}[1][]{}{} +\newcommand{\premise}[2][]{#2} +\newcommand{\justarg}[2][]{#2} +\endinput +%% +%% End of file `sproof.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty.ltxml b/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty.ltxml new file mode 100644 index 00000000000..042ba7f7dc7 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty.ltxml @@ -0,0 +1,125 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +RequirePackage('sref'); +DeclareOption('showmeta',''); +DefConstructor('\sproofend',""); +DefConstructor('\spfsketch OptionalKeyVals:pf{}', + "<omdoc:proof " + . "?&defined(&KeyVal(#1,'id'))(xml:id='&KeyVal(#1,'id')')()>\n" + . "?#2(<omdoc:omtext><omdoc:CMP>#2\n)()" + . "</omdoc:proof>\n"); +DefConstructor('\sProofEndSymbol {}',''); +DefEnvironment('{sproof} OptionalKeyVals:pf{}', + "<omdoc:proof " + . "?&KeyVal(#1,'for')(for='&hash_wrapper(&KeyVal(#1,'for'))')()" + . "?&defined(&KeyVal(#1,'id'))(xml:id='&KeyVal(#1,'id')')()>\n" + . "?#2(<omdoc:omtext>" + . "<omdoc:CMP>#2</omdoc:CMP>" + . "</omdoc:omtext>\n)()" + . "#body" + . "</omdoc:proof>\n"); +DefMacro('\sProof','\sproof'); +DefMacro('\endsProof','\endsproof'); +DefConstructor('\spfidea OptionalKeyVals:pf {}', + "<omdoc:proof " + . "?&defined(&KeyVal(#1,'id'))(xml:id='&KeyVal(#1,'id')')()" + . "?&KeyVal(#1,'for')(for='&hash_wrapper(&KeyVal(#1,'for'))')()>\n" + . "<omdoc:omtext><omdoc:CMP>#2</omdoc:omtext>\n" + . "</omdoc:proof>\n"); +DefEnvironment('{spfstep} OptionalKeyVals:pf', + "<omdoc:derive " + . "?&defined(&KeyVal(#1,'id'))(xml:id='&KeyVal(#1,'id')')()>" + . "<omdoc:CMP>#body</omdoc:derive>\n", + beforeConstruct=>sub { + $_[0]->maybeCloseElement('omdoc:CMP'); + });#$ +DefEnvironment('{sproofcomment} OptionalKeyVals:pf', + "<omdoc:omtext " + . "?&defined(&KeyVal(#1,'id'))(xml:id='&KeyVal(#1,'id')')()>" + . "<omdoc:CMP>#body</omdoc:CMP>" + . "</omdoc:omtext>"); +DefEnvironment('{spfcases} OptionalKeyVals:pf {}', + "<omdoc:derive " + . "?&defined(&KeyVal(#1,'id'))(xml:id='&KeyVal(#1,'id')')()>\n" + . "<omdoc:CMP>#2</omdoc:CMP>\n" + . "<omdoc:method xref='#proof-by-cases'>#body</omdoc:method>" + . "</omdoc:derive>\n"); +DefEnvironment('{spfcase} OptionalKeyVals:pf{}', + "<omdoc:proof " + . "?&defined(&KeyVal(#1,'id'))(xml:id='&KeyVal(#1,'id')')()>\n" + . "?#2(<omdoc:omtext>" + . "<omdoc:CMP>#2</omdoc:CMP>" + . "</omdoc:omtext>\n)()" + . "#body" + . "</omdoc:proof>\n"); +DefEnvironment('{subproof}[]', + "<omdoc:derive>" + . "?#1(<omdoc:CMP>#1</omdoc:CMP>)()" + . "<omdoc:method>" + . "<omdoc:proof>\n #body\n</omdoc:proof>" + . "</omdoc:method>" + ."</omdoc:derive>"); +DefKeyVal('just','id','Semiverbatim'); +DefKeyVal('just','method','Semiverbatim'); +DefKeyVal('just','premises','Semiverbatim'); +DefKeyVal('just','args','Semiverbatim'); +sub extractBodyText { + my ($box, $remove) = @_; + my $str = ''; + my @boxes = $box->unlist; + foreach my $b(@boxes) { + my $s = ''; + if ($b =~ /LaTeXML::Whatsit/) { + my $body = $b->getBody; + $s = $body ? extractBodyText($body, $remove) : ''; + } elsif ($b =~ /LaTeXML::Box/) { + $s = $b->toString || ''; + @{$b}[0] = '' if $remove; } + $str .= $s; } + $str =~ s/\s+/ /g; + $str; } + +DefEnvironment('{justification} OptionalKeyVals:just', sub { + my ($doc, $keys, %props) = @_; + my $text = extractBodyText($props{body}, 1); + my $node = LookupValue('_LastSeenCMP'); + #$node->appendText($text) if $node; + my $method = $keys ? $keys->getValue('method') : undef; + $doc->openElement("omdoc:method", $method ? (xref => $method) : ()); + $doc->absorb($props{body}) if $props{body}; + $doc->closeElement("omdoc:method"); + return; }); +DefMacro('\premise[]{}', sub { + my ($xref, $text) = ($_[1], $_[2]); + my @res = (T_CS('\premise@content')); + push(@res, T_OTHER('['), $xref->unlist, T_OTHER(']')) if $xref; + push(@res, T_SPACE, $text->unlist) if $text; + @res; }); +DefConstructor('\premise@content[]', + "<omdoc:premise xref='#1'/>"); +DefMacro('\justarg[]{}', sub { (($_[1] ? $_[1]->unlist : ()), +T_SPACE, $_[2]->unlist, T_SPACE); }); +Tag('omdoc:derive', afterClose=>sub { + my ($doc, $node) = @_; + my @children = grep($_->nodeType == XML_ELEMENT_NODE, $node->childNodes); + my $firstCMP = undef; + foreach my $child(@children) { + next unless ($child->localname || '') eq 'CMP'; + if ($child->hasChildNodes()) { + next unless $#{$child->childNodes} == 0; + next unless $child->firstChild->nodeType == XML_TEXT_NODE; } + + if ($firstCMP) { + $firstCMP->appendText($child->textContent); + $node->removeChild($child); + } else { $firstCMP = $child; } + } + });#$ +Tag('omdoc:proof',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:derive',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:method',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:premise',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:derive',afterOpen=>\&numberIt,afterClose=>\&locateIt); +1; diff --git a/Master/texmf-dist/tex/latex/stex/sref/sref.sty b/Master/texmf-dist/tex/latex/stex/sref/sref.sty new file mode 100644 index 00000000000..1cc4034f812 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/sref/sref.sty @@ -0,0 +1,105 @@ +%% +%% This is file `sref.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sref.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{sref}[2012/01/28 v1.0 Semantic Cross-References] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\newif\ifextrefs\extrefsfalse +\DeclareOption{extrefs}{\extrefstrue} +\ProcessOptions +\RequirePackage{metakeys} +\newcommand{\sref}[2][]{% +\@ifundefined{sref@part}{\sref@hlink[#1]{#2}}{\sref@hlink[#1]{\sref@part @#2}}} +\newcommand{\srefs}[3][]{% +\def\@test{#1}\ifx\@test\@empty\sref{#2} and \sref{#3}\else #1\fi} +\newcommand{\srefl}[3][]{% +\def\@test{#1}\ifx\@test\@empty\sref{#2} to \sref{#3}\else #1\fi} +\newcommand{\spageref}[1]{% +\@ifundefined{sref@part}{\sref@pageref{#1}}{\sref@pageref{\sref@part @#1}}} +\newif\ifhref\hreffalse +\AtBeginDocument{\@ifpackageloaded{hyperref}{\hreftrue}{\hreffalse}} +\newcommand\sref@href@ifh[2]{\ifhref\href{#1}{#2}\else#2\fi} +\newcommand\sref@hlink@ifh[2]{\ifhref\hyperlink{#1}{#2}\else#2\fi} +\newcommand\sref@target@ifh[2]{\ifhref\hypertarget{#1}{#2}\else#2\fi} +\def\sref@target% +{\ifx\sref@id\@empty\else% +\edef\@target{sref@\@ifundefined{sref@part}{}{\sref@part @}\sref@id @target} +\sref@target@ifh\@target{}\fi} +\newcommand\@sref@def[3]{\expandafter\gdef\csname sref@#1@#2\endcsname{#3}} +\ifextrefs\newwrite\refs@file\else\def\refs@file{\@auxout}\fi +\newcommand\sref@def[3]{%\@sref@def{#1}{#2}{#3}% +\protected@write\refs@file{}{\string\@sref@def{#1}{#2}{#3}}} +\addmetakey{srefaddidkey}{prefix} +\newcommand\srefaddidkey[2][]{\metasetkeys{srefaddidkey}{#1}% +\@metakeys@ext@clear@keys{#2}{sref@id}{}% id cannot have a default +\metakeys@ext@clear@keys{#2}{id}{}% +\metakeys@ext@showkeys{#2}{id}% +\define@key{#2}{id}{\edef\sref@id{\srefaddidkey@prefix ##1}% +\expandafter\edef\csname #2@id\endcsname{\srefaddidkey@prefix ##1}}} +\newcommand\makeextrefs[1]{\gdef\sref@part{#1}% +\makeatletter +\IfFileExists{\jobname.refs}{\input{\jobname.refs}}{}% +\immediate\openout\refs@file=\jobname.refs +\makeatother} +\newcommand\sref@label[2]{% +\sref@def{\@ifundefined{sref@part}{}{\sref@part @}#2}{page}{\thepage}% +\sref@def{\@ifundefined{sref@part}{}{\sref@part @}#2}{label}{#1}} +\newcommand\sreflabel[2]{\message{sreflabel: #1, #2}\sref@label{#1 \@currentlabel}{#2}} +\newcommand\sref@label@id[1]{\ifx\sref@id\@empty\else\sref@label{#1}{\sref@id}\fi} +\newcommand{\sref@hlink}[2][]{\def\@test{#1}% +\@ifundefined{sref@#2@label}% +{\protect\G@refundefinedtrue\@latex@warning{reference #2 undefined}??}% +{\sref@hlink@ifh{sref@#2@target}{\ifx\@test\@empty\@nameuse{sref@#2@label}\else #1\fi}}} +\newcommand{\sref@page@label}[1]{p.~{#1}} +\newcommand{\sref@pageref}[1]{\@ifundefined{sref@#1@page}% +{\protect\G@refundefinedtrue\@latex@warning{reference #1 undefined}\sref@page@label{??}}% +{\sref@hlink@ifh{sref@#1@target}{\sref@page@label{\@nameuse{sref@#1@page}}}}} +\newcommand{\sref@href}[3][]{\def\@test{#1}% +\@ifundefined{sref@#2@label}% +{\protect\G@refundefinedtrue\@latex@warning{reference #2 undefined}??}% +{\@ifundefined{sref@#3@URI}% +{\protect\G@refundefinedtrue\@latex@warning{external refs of type #3 undefined}??}% +{\edef\@uri{\@nameuse{sref@#3@URI}.pdf\#sref@#2@target} +\edef\@label{\ifx\@test\@empty\@nameuse{sref@#2@label}\else #1\fi} +\sref@href@ifh\@uri\@label}}} +\ifextrefs +\newcommand{\extref}[3][]{\def\theextref{\sref@href[#1]{#2@#3}{#2}}% +\csname doextref@#2\endcsname} +\else +\newcommand{\extref}[3][]{\sref[#1]{#3}} +\fi +\ifextrefs +\newcommand{\extpageref}[3][]{\def\theextref{\sref@pageref[#1]{#2@#3}{#2}}% +\csname doextpageref@#2\endcsname} +\else +\newcommand{\extpageref}[3][]{\spageref[#1]{#3}} +\fi +\newcommand\extrefstyle[2]{\expandafter\gdef\csname doextref@#1\endcsname{#2}} +\newcommand\extpagerefstyle[2]{\expandafter\gdef\csname doextpageref@#1\endcsname{#2}} +\newcommand{\inputrefs}[2]{% +\@namedef{sref@#1@URI}{#2} +\makeatletter% +\IfFileExists{#2.refs}{\input{#2.refs}} + {\PackageError{sref}{Reference file #1.refs does not exist} + {Maybe you have to run LaTeX on #2.tex first}} +\makeatother} +\srefaddidkey{sequation} +\def\sref@sequation@heading{equation} +\newenvironment{sequation}[1][]{\metasetkeys{sequation}{#1}% +\ifx\sref@id\@empty\begin{displaymath}\else% no id, using equation* +\begin{equation}\sref@target\sref@label@id{\sref@sequation@heading~(\theequation)}\fi} +{\ifx\sref@id\@empty\end{displaymath}\else\end{equation}\fi} +\newenvironment{seqnarray}[1][]% +{\metasetkeys{sequation}{#1}\begin{eqnarray*}\sref@target% +\sref@label@id{\sref@sequation@heading~(\theequation)}} +{\end{eqnarray*}} +\newcommand\withcite[2]{#2~\cite{#1}} +\newenvironment{withcitation}[1]{\def\citeit{\cite{#1}}}{} +\endinput +%% +%% End of file `sref.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/sref/sref.sty.ltxml b/Master/texmf-dist/tex/latex/stex/sref/sref.sty.ltxml new file mode 100644 index 00000000000..5d888c6715a --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/sref/sref.sty.ltxml @@ -0,0 +1,56 @@ +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +DeclareOption('extrefs',''); +RequirePackage('metakeys'); +sub withhash {'#';} +DefConstructor('\sref[]{}', + "<omdoc:oref href='&withhash()#2'/>"); +DefConstructor('\srefs[]{}', + "<omdoc:oref href='&withhash()#2'/>"); +DefConstructor('\srefl[]{}', + "<omdoc:oref href='&withhash()#2'/>"); +DefConstructor('\spageref{}', + "<omdoc:oref href='&withhash()#1'/>"); +DefConstructor('\makeextrefs{}',''); +DefConstructor('\extref[]{}{}', + "<omdoc:oref href='#2@#3'/>"); +DefConstructor('\theextref',''); +DefConstructor('\extpageref[]{}{}', + "<omdoc:oref href='#2@#3'/>"); +DefConstructor('\theextref',''); +DefConstructor('\extrefstyle{}{}',""); +DefConstructor('\extrefstyle{}{}',""); +DefConstructor('\inputrefs{}{}',''); +DefEnvironment('{sequation} OptionalKeyVals', + "<ltx:equation " + . "?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')' " + . "refnum='#refnum')(xml:id='#id')>" + . "<ltx:Math mode='display'>" + . "<ltx:XMath>#body</ltx:XMath>" + . "</ltx:Math>" + . "</ltx:equation>", + mode=>'display_math', + properties=> sub { RefStepCounter('equation') }, + locked=>1); +DefMacro('\seqnarray OptionalKeyVals','\begin{eqnarray*}'); +DefMacro('\endseqnarray','\end{eqnarray*}'); +DefMacro('\withcite{}{}','\begin{withcitation}{#1}#2\citeit\end{withcitation}'); +DefConstructor('\citeit',"<omdoc:citation/> ", +afterConstruct => sub { + my ($document,$whatsit) = @_; + # LibXML acrobatics, since we can't talk about the xml:id prior to construction's end + # (and please do correct me if this is inaccurate) + my $node = $document->getNode; + my ($citenode) = $document->findnodes('preceding-sibling::omdoc:citation',$node); + my ($phrase_parent) = $document->findnodes('ancestor::ltx:text[@xml:id]',$node); + return unless (defined $phrase_parent) && (defined $citenode); + my $id = $phrase_parent->getAttribute('xml:id'); + my $refs = $phrase_parent->getAttribute('citeit-refs'); + $phrase_parent->removeAttribute('citeit-refs'); + $citenode->setAttribute('for',$id); + $citenode->setAttribute('refs',$refs); +});#$ +DefEnvironment('{withcitation}{}', + "<ltx:text citeit-refs='#1'>#body</ltx:text>"); +1; diff --git a/Master/texmf-dist/tex/latex/stex/statements/statements.sty b/Master/texmf-dist/tex/latex/stex/statements/statements.sty new file mode 100644 index 00000000000..4c8f57560e8 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/statements/statements.sty @@ -0,0 +1,171 @@ +%% +%% This is file `statements.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% statements.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{statements}[2012/01/28 v1.1 Semantic Markup for Statements] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{omdoc}} +\ProcessOptions +\RequirePackage{omtext} +\RequirePackage{modules} +\RequirePackage[hyperref]{ntheorem} +\theoremstyle{plain} +\providecommand\STpresent[1]{#1} +\def\define@statement@env#1{% +\newenvironment{#1}[1][]{\metasetkeys{omtext}{##1}\sref@target% +\ifx\omtext@display\st@flow\else% +\ifx\omtext@title\@empty\begin{ST#1Env}\else\begin{ST#1Env}[\omtext@title]\fi% +\ifx\sref@id\@empty\else\label{#1.\sref@id}\fi +\csname st@#1@initialize\endcsname\fi +\ifx\sref@id\@empty\sref@label@id{here}\else% +\sref@label@id{\STpresent{\csname ST#1EnvKeyword\endcsname}~\@currentlabel}\fi} +{\csname st@#1@terminate\endcsname\ifx\omtext@display\st@flow\else\end{ST#1Env}\fi}} +\newenvironment{assertion}[1][]{\metasetkeys{omtext}{#1}\sref@target% +\ifx\omtext@display\st@flow\else% +\ifx\omtext@title\@empty\begin{ST\omtext@type AssEnv}% +\else\begin{ST\omtext@type AssEnv}[\omtext@title]\fi\fi% +\ifx\omtext@type\@empty\sref@label@id{here}\else% +\sref@label@id{\STpresent{\csname ST\omtext@type AssEnvKeyword\endcsname}~\@currentlabel}\fi} +{\ifx\omtext@display\st@flow\else\end{ST\omtext@type AssEnv}\fi} +\def\st@theorem@kw{Theorem} +\def\st@lemma@kw{Lemma} +\def\st@proposition@kw{Proposition} +\def\st@corollary@kw{Corollary} +\def\st@conjecture@kw{Conjecture} +\def\st@falseconjecture@kw{Conjecture (false)} +\def\st@postulate@kw{Postulate} +\def\st@obligation@kw{Obligation} +\def\st@assumption@kw{Assumption} +\def\st@observation@kw{Observation} +\theorembodyfont{\itshape} +\theoremheaderfont{\normalfont\bfseries} +\newtheorem{STtheoremAssEnv}{\st@theorem@kw} +\newtheorem{STlemmaAssEnv}[STtheoremAssEnv]{\st@lemma@kw} +\newtheorem{STpropositionAssEnv}[STtheoremAssEnv]{\st@proposition@kw} +\newtheorem{STcorollaryAssEnv}[STtheoremAssEnv]{\st@corollary@kw} +\newtheorem{STconjectureAssEnv}[STtheoremAssEnv]{\st@conjecture@kw} +\newtheorem{STfalseconjectureAssEnv}[STtheoremAssEnv]{\st@falseconjecture@kw} +\newtheorem{STpostulateAssEnv}[STtheoremAssEnv]{\st@postulate@kw} +\newtheorem{STobligationAssEnv}[STtheoremAssEnv]{\st@obligation@kw} +\newtheorem{STassumptionAssEnv}[STtheoremAssEnv]{\st@assumption@kw} +\newtheorem{STobservationAssEnv}[STtheoremAssEnv]{\st@observation@kw} +\def\st@example@initialize{}\def\st@example@terminate{} +\define@statement@env{example} +\def\st@example@kw{Example} +\theorembodyfont{\upshape} +\newtheorem{STexampleEnv}[STtheoremAssEnv]{\st@example@kw} +\def\st@axiom@initialize{}\def\st@axiom@terminate{} +\define@statement@env{axiom} +\def\st@axiom@kw{Axiom} +\theorembodyfont{\upshape} +\newtheorem{STaxiomEnv}[STtheoremAssEnv]{\st@axiom@kw} +\srefaddidkey{symboldec} +\addmetakey{symboldec}{functions} +\addmetakey{symboldec}{role} +\addmetakey*{symboldec}{title} +\addmetakey{symboldec}{name} +\addmetakey{symboldec}{subject} +\addmetakey*{symboldec}{display} +\def\symboldec@type{Symbol} +\newenvironment{symboldec}[1][]{\metasetkeys{symboldec}{#1}\sref@target\st@indeftrue% +\ifx\symboldec@display\st@flow\else{\stDMemph{\symboldec@type} \symboldec@name:}\fi% +\ifx\symboldec@title\@empty~\else~(\stDMemph{\symboldec@title})\par\fi}{} +\newcommand{\symtype}[2]{Type (#1): $#2$} +\newif\ifst@indef\st@indeffalse +\newenvironment{definition}[1][]{\metasetkeys{omtext}{#1}\sref@target\st@indeftrue% +\ifx\omtext@display\st@flow\else% +\ifx\omtext@title\@empty\begin{STdefinitionEnv}\else\begin{STdefinitionEnv}[\omtext@title]\fi\fi% +\ifx\sref@id\@empty\sref@label@id{here}\else% +\sref@label@id{\STpresent{\csname STdefinitionEnvKeyword\endcsname}~\@currentlabel}\fi} +{\ifx\omtext@display\st@flow\else\end{STdefinitionEnv}\fi} +\def\st@definition@kw{Definition} +\theorembodyfont{\upshape} +\newtheorem{STdefinitionEnv}[STtheoremAssEnv]{\st@definition@kw} +\def\notemph#1{{\bf{#1}}} +\def\st@notation@terminate{} +\def\st@notation@initialize{} +\define@statement@env{notation} +\def\st@notation@kw{Notation} +\theorembodyfont{\upshape} +\newtheorem{STnotationEnv}[STtheoremAssEnv]{\st@notation@kw} +\def\st@def@target#1#2{\def\@test{#1}% +\ifst@indef% if we are in a definition or such +\ifx\omtext@theory\@empty% if there is no theory attribute +\@ifundefined{mod@id}% if we are not in a module +{\PackageWarning{statements}{definiendum in unidentified module\MessageBreak +\protect\definiendum, \protect\defi, +\protect\defii, \protect\defiii\MessageBreak +can only be referenced when called in a module with id key}}% +{\ifx\@test\@empty% +\expandafter\sref@target@ifh{sref@#2@\mod@id @target}{}\else% +\expandafter\sref@target@ifh{sref@#1@\mod@id @target}{}\fi}% +\else\expandafter\sref@target@ifh{sref@#1@\omtext@theory @target}{}\fi% +\else\PackageError{statements}% +{definiendum outside definition context\MessageBreak +\protect\definiendum, \protect\defi, +\protect\defii, \protect\defiii\MessageBreak +do not make sense semantically outside a definition.\MessageBreak +Consider wrapping the defining phrase in a \protect\inlinedef}% +\fi} +\newcommand\@termdef[2][]{\def\@test{#1}% +\@ifundefined{mod@id}{}{\ifx\@test\@empty\def\@@name{#2}\else\def\@@name{#1}\fi% +\termdef{\mod@id @\@@name}{#2}}} +\newcommand\definiendum[2][]{\st@def@target{#1}{#2}\defemph{#2}} +\newcommand{\notatiendum}[2][]{\notemph{#2}} +\newcommand{\defi}[2][]{\definiendum[#1]{#2}\omdoc@index[#1]{#2}} +\newcommand{\adefi}[3][]{\def\@test{#1}% +\ifx\@test\@empty\definiendum[#3]{#2}% +\else\definiendum[#1]{#2}\omdoc@index[#1]{#3}\fi} +\newcommand{\defii}[3][]{\st@def@target{#1}{#2-#3}\defemph{#2 #3}\@twin[#1]{#2}{#3}} +\newcommand{\adefii}[4][]{\def\@test{#1}% +\ifx\@test\@empty\definiendum[#3-#4]{#2}% +\else\definiendum[#1]{#2}\@twin[#1]{#3}{#4}\fi} +\newcommand{\defiii}[4][]{\st@def@target{#1}{#2-#3-#4}\defemph{#2 #3 #4}\@atwin[#1]{#2}{#3}{#4}} +\newcommand{\adefiii}[5][]{\def\@test{#1}% +\ifx\@test\@empty\definiendum[#3-#4-#5]{#2}% +\else\definiendum[#1]{#2}\@atwin[#1]{#3}{#4}{#5}\fi} +\newcommand{\inlineex}[2][]{\metasetkeys{omtext}{#1}\sref@target\sref@label@id{here}#2} +\newcommand{\inlinedef}[2][]{\metasetkeys{omtext}{#1}\sref@target\sref@label@id{here}\st@indeftrue #2} +\addmetakey[\mod@id]{termref}{cd} +\addmetakey{termref}{cdbase} +\addmetakey{termref}{name} +\addmetakey{termref}{role} +\def\termref@set#1#2{\def\termref@name{#2}\metasetkeys{termref}{#1}} +\newcommand{\termref}[2][]{\metasetkeys{termref}{#1}\st@termref{#2}} +\def\st@termref#1{\ifx\termref@name\@empty\def\termref@name{#1}\fi% +\ifx\termref@cdbase\@empty\mod@termref\termref@cd\termref@name{#1}% +\else\sref@href@ifh\termref@cdbase{#1}\fi} +\newcommand\atrefi[3][]{\def\@test{#1}\ifx\@test\@empty\termref[name=#3]{#2}\else\termref[cd=#1,name=#3]{#2}\fi} +\newcommand\atrefii[4][]{\atrefi[#1]{#2}{#3-#4}} +\newcommand\atrefiii[5][]{\atrefi[#1]{#2}{#3-#4-#5}} +\newcommand{\trefi}[2][]{\atrefi[#1]{#2}{#2}} +\newcommand{\trefii}[3][]{\atrefi[#1]{#2 #3}{#2-#3}} +\newcommand{\trefiii}[4][]{\atrefi[#1]{#2 #3 #4}{#2-#3-#4}} +\providecommand{\termemph}[1]{#1} +\providecommand{\defemph}[1]{{\textbf{#1}}} +\providecommand{\stDMemph}[1]{{\textbf{#1}}} +\newcommand{\symref}[2]{\@nameuse{mod@symref@#1}{#2}} +\newcommand\defin[2][]{\defi[#1]{#2}% +\PackageWarning{statements}{\protect\defin\space is deprecated, use \protect\defi\space instead}} +\newcommand\twindef[3][]{\defii[#1]{#2}{#3}% +\PackageWarning{statements}{\protect\twindef\space is deprecated, use \protect\defii\space instead}} +\newcommand\atwindef[4][]{\defiii[#1]{#2}{#3}{#4}% +\PackageWarning{statements}{\protect\atwindef\space is deprecated, use \protect\defiii\space instead}} +\newcommand\definalt[3][]{\adefi[#1]{#2}{#3}% +\PackageWarning{statements}{\protect\definalt\space is deprecated, use \protect\adefi\space instead}} +\newcommand\twindefalt[4][]{\adefii[#1]{#2}{#3}{#4}% +\PackageWarning{statements}{\protect\twindefalt\space is deprecated, use \protect\adefii\space instead}} +\newcommand\atwindefalt[5][]{\adefiii[#1]{#2}{#3}{#4}{#5}% +\PackageWarning{statements}{\protect\atwindefalt\space is deprecated, use \protect\adefiii\space instead}} +\newcommand\twinref[3][]{\trefii[#1]{#2}{#3}% +\PackageWarning{statements}{\protect\twinref\space is deprecated, use \protect\trefii\space instead}} +\newcommand\atwinref[4][]{\atrefiii[#1]{#2}{#3}{#4}% +\PackageWarning{statements}{\protect\atwindef\space is deprecated, use \protect\trefiii\space instead}} +\endinput +%% +%% End of file `statements.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/statements/statements.sty.ltxml b/Master/texmf-dist/tex/latex/stex/statements/statements.sty.ltxml new file mode 100644 index 00000000000..92d7f8d8b84 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/statements/statements.sty.ltxml @@ -0,0 +1,365 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +RequirePackage('omtext'); +RequirePackage('modules'); +sub lowcase {my ($string) = @_; $string ? return lc(ToString($string)) : return('')}#$ +sub dashed { join('-',map($_->toString,@_));}#$ +sub makeNCName { + my ($name) = @_; + my $ncname=$name; + $ncname=~s/\s/_/g; #Spaces to underscores + $ncname="_$ncname" if $ncname!~/^(\w|_)/; #Ensure start with letter or underscore + ##More to come... + $ncname; +} +sub simple_wrapper { + #Deref if array reference + my @input; + foreach (@_) { + if (ref $_ && $_ =~ /ARRAY/ && $_ !~ /LaTeXML/) { + @input=(@input,@$_); + } else + { push (@input,$_); } + } + return '' if (!@input); + @input = map(split(/\s*,\s*/,ToString($_)),@input); + my $output=join(" ",@input); + $output=~s/(^ )|[{}]//g; #remove leading space and list separator brackets + $output||''; +} +sub hash_wrapper{ + #Deref if array reference + my @input; + foreach (@_) { + if (ref $_ && $_ =~ /ARRAY/ && $_ !~ /LaTeXML/) { + @input=(@input,@$_); + } else + { push (@input,$_); } + } + return '' if (!@input); + @input = map(split(/\s*,\s*/,ToString($_)),@input); + my $output=join(".sym #",@input); + $output=~s/(^\.sym )|[{}]//g; #remove leading space and list separator brackets + "#$output"||''; +} +DefEnvironment('{assertion} OptionalKeyVals:omtext', + "<omdoc:assertion " + . "?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')() " + . "?&KeyVal(#1,'theory')(theory='&KeyVal(#1,'theory')')() " + . "type='&lowcase(&KeyVal(#1,'type'))'>" + . "?&KeyVal(#1,'title')(<dc:title>&KeyVal(#1,'title')</dc:title>)()" + . "<omdoc:CMP>#body" + ."</omdoc:assertion>\n"); +DefEnvironment('{example} OptionalKeyVals:omtext', + "<omdoc:example " + . "?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')() " + . "?&KeyVal(#1,'for')(for='&hash_wrapper(&KeyVal(#1,'for'))')()>" + . "?&KeyVal(#1,'title')(<dc:title>&KeyVal(#1,'title')</dc:title>)()" + . "<omdoc:CMP>#body" + . "</omdoc:example>\n"); +DefEnvironment('{axiom} OptionalKeyVals:omtext', + "<omdoc:axiom " + . "?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')()>" + . "?&KeyVal(#1,'title')(<dc:title>&KeyVal(#1,'title')</dc:title>)()" + . "<omdoc:CMP>#body" + . "</omdoc:axiom>\n"); +DefEnvironment('{symboldec} OptionalKeyVals:symboldec', + "<omdoc:symbol " + . "?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')" + . "(xml:id='&makeNCName(&KeyVal(#1,'name')).def.sym')" + . "name='&KeyVal(#1,'name')'>" + . "?&KeyVal(#1,'title')(<dc:title>&KeyVal(#1,'title')</dc:title>)()" + . "<dc:description>#body" + ."</omdoc:symbol>\n"); +DefConstructor('\symtype{}{}', + "<omdoc:type system='#1'><ltx:Math><ltx:XMath>#2</ltx:XMath></ltx:Math></omdoc:type>"); +sub definitionBody { + my ($doc, $keyvals, %props) = @_; + my $for = $keyvals->getValue('for') if $keyvals; + my $type = $keyvals->getValue('type') if $keyvals; + my %for_attr=(); + if (ToString($for)) { + $for = ToString($for); + $for =~ s/^{(.+)}$/$1/eg; + foreach (split(/,\s*/,$for)) { + $for_attr{$_}=1; + }} + if ($props{theory}) { + my @symbols = @{$props{defs} || []}; + foreach my $symb(@symbols) { + next if $for_attr{$symb}; + $for_attr{$symb}=1; + $doc->insertElement('omdoc:symbol', undef, (name=>$symb, "xml:id"=>makeNCName("$symb.def.sym"))); + } + } + my %attrs = (); + $for = join(" ",(keys %for_attr)); + $attrs{'for'} = $for if $for; + my $id = $keyvals->getValue('id') if $keyvals; + $attrs{'xml:id'} = $id if $id; + $attrs{'type'} = $type if $type; + if ($props{theory}) { + $doc->openElement('omdoc:definition', %attrs); + } else { + $attrs{'type'}='definition'; + $doc->openElement('omdoc:omtext', %attrs); + } + my $title = $keyvals->getValue('title') if $keyvals; + if ($title) { + $doc->openElement('omdoc:metadata'); + $doc->openElement('dc:title'); + $doc->absorb($title); + $doc->closeElement('dc:title');} + $doc->openElement('omdoc:CMP'); + $doc->absorb($props{body}) if $props{body}; + $doc->maybeCloseElement('omdoc:CMP'); + if ($props{theory}) { + $doc->closeElement('omdoc:definition'); + } else { + $doc->closeElement('omdoc:omtext'); + } + return; } +DefEnvironment('{definition} OptionalKeyVals:omtext', sub{definitionBody(@_)}, + afterDigestBegin=>sub { + my ($stomach, $whatsit) = @_; + my @symbols = (); + $whatsit->setProperty(theory=>LookupValue('current_module')); + $whatsit->setProperty(defs=>\@symbols); + AssignValue('defs', \@symbols); return; }, + afterDigest => sub { AssignValue('defs', undef); return; });#$ +DefEnvironment('{notation} OptionalKeyVals:omtext', + "<omdoc:definition " + . "?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id').not')()" + . "?&KeyVal(#1,'for')(for='&simple_wrapper(&KeyVal(#1,'for'))')()>" + . "?&KeyVal(#1,'title')(<dc:title>&KeyVal(#1,'title')</dc:title>)()" + . "<omdoc:CMP>#body" + . "</omdoc:definition>\n"); +DefConstructor('\notatiendum OptionalKeyVals:notation {}', + "<ltx:text class='notatiendum'>#2</ltx:text>"); +DefConstructor('\definiendum [] {}', + "<omdoc:term role='definiendum' name='#name' cd='#theory'>#2</omdoc:term>", + afterDigest => sub { + my ($stomach, $whatsit) = @_; + my $addr = LookupValue('defs'); + my $name = $whatsit->getArg(1); + $name = $whatsit->getArg(2) unless $name; + $whatsit->setProperty(name=>$name->toString); + push(@$addr, $name->toString) if ($addr and $name); + $whatsit->setProperty(theory=>LookupValue('current_module')); + return; });#$ +DefConstructor('\defi[]{}', + "<omdoc:idx>" + . "<omdoc:idt>" + . "<omdoc:term role='definiendum' name='?#1(#1)(#2)' cd='#theory'>#2</omdoc:term>" + . "</omdoc:idt>" + . "<omdoc:ide index='default'><omdoc:idp>#2</omdoc:idp></omdoc:ide>" + ."</omdoc:idx>", + afterDigest => sub { + my ($stomach, $whatsit) = @_; + my $addr = LookupValue('defs'); + my $name = $whatsit->getArg(1); + $name = $whatsit->getArg(2) unless $name; + push(@$addr, $name->toString) if ($addr and $name); + $whatsit->setProperty(theory=>LookupValue('current_module'));#$ + return; }, + alias=>'\defi'); +DefConstructor('\adefi[]{}{}', + "<omdoc:idx>" + . "<omdoc:idt>" + . "<omdoc:term role='definiendum' name='?#1(#1)(#3)' cd='#theory'>#2</omdoc:term>" + . "</omdoc:idt>" + . "<omdoc:ide index='default'><omdoc:idp>#3</omdoc:idp></omdoc:ide>" + ."</omdoc:idx>", + afterDigest => sub { + my ($stomach, $whatsit) = @_; + my $addr = LookupValue('defs'); + my $name = $whatsit->getArg(1); + $name = $whatsit->getArg(3) unless $name; + push(@$addr, $name->toString) if ($addr and $name); + $whatsit->setProperty(theory=>LookupValue('current_module'));#$ + return; }, + alias=>'\adefi'); +DefConstructor('\defii[]{}{}', + "<omdoc:idx>" + . "<omdoc:idt>" + . "<omdoc:term role='definiendum' name='?#1(#1)(&dashed(#2,#3))' cd='#theory'>" + . "#2 #3" + . "</omdoc:term>" + . "</omdoc:idt>" + . "<omdoc:ide index='default'>" + . "<omdoc:idp>#2</omdoc:idp>" + . "<omdoc:idp>#3</omdoc:idp>" + . "</omdoc:ide>" + ."</omdoc:idx>", + afterDigest => sub { + my ($stomach, $whatsit) = @_; +my $addr = LookupValue('defs'); + my $name = $whatsit->getArg(1); + $name = $name->toString if $name; + $name = $whatsit->getArg(2)->toString.'-'.$whatsit->getArg(3)->toString unless $name; + push(@$addr, $name) if ($addr and $name); + $whatsit->setProperty(theory=>LookupValue('current_module')); + return; }, + alias=>'\defii');#$ +DefConstructor('\adefii[]{}{}{}', + "<omdoc:idx>" + . "<omdoc:idt>" + . "<omdoc:term role='definiendum' name='?#1(#1)(&dashed(#3,#4))' cd='#theory'>" + . "#2" + . "</omdoc:term>" + . "</omdoc:idt>" + . "<omdoc:ide index='default'>" + . "<omdoc:idp>#3</omdoc:idp>" + . "<omdoc:idp>#4</omdoc:idp>" + . "</omdoc:ide>" + ."</omdoc:idx>", + afterDigest => sub { + my ($stomach, $whatsit) = @_; + my $addr = LookupValue('defs'); + my $name = $whatsit->getArg(1); + $name = $name->toString if $name; + $name = $whatsit->getArg(3)->toString.'-'.$whatsit->getArg(4)->toString unless $name; + push(@$addr, $name) if ($addr and $name); + $whatsit->setProperty(theory=>LookupValue('current_module')); + return; }, + alias=>'\defii');#$ +DefConstructor('\defiii[]{}{}{}', + "<omdoc:idx>" + . "<omdoc:idt>" + . "<omdoc:term role='definiendum' cd='#theory' name='?#1(#1)(&dashed(#2,#3,#4))'>#2 #3 #4</omdoc:term>" + . "</omdoc:idt>" + . "<omdoc:ide index='default'>" + . "<omdoc:idp>#2</omdoc:idp>" + . "<omdoc:idp>#3</omdoc:idp>" + . "<omdoc:idp>#4</omdoc:idp>" + . "</omdoc:ide>" + . "</omdoc:idx>", + afterDigest => sub { + my ($stomach, $whatsit) = @_; + my $addr = LookupValue('defs'); + my $name = $whatsit->getArg(1); + $name = $name->toString if $name; + $name = $whatsit->getArg(2)->toString.'-'.$whatsit->getArg(3)->toString.'-'.$whatsit->getArg(4)->toString unless $name; + push(@$addr, $name) if ($addr and $name); + $whatsit->setProperty(theory=>LookupValue('current_module')); + return; }, + alias=>'\defiii'); +DefConstructor('\adefiii[]{}{}{}{}', + "<omdoc:idx>" + . "<omdoc:idt>" + . "<omdoc:term role='definiendum' cd='#theory' name='?#1(#1)(&dashed(#3,#4,#5))'>#2</omdoc:term>" + . "</omdoc:idt>" + . "<omdoc:ide index='default'>" + . "<omdoc:idp>#3</omdoc:idp>" + . "<omdoc:idp>#4</omdoc:idp>" + . "<omdoc:idp>#5</omdoc:idp>" + . "</omdoc:ide>" + . "</omdoc:idx>", + afterDigest => sub { + my ($stomach, $whatsit) = @_; + my $addr = LookupValue('defs'); + my $name = $whatsit->getArg(1); + $name = $name->toString if $name; + $name = $whatsit->getArg(3)->toString.'-'.$whatsit->getArg(4)->toString.'-'.$whatsit->getArg(5)->toString unless $name; + push(@$addr, $name) if ($addr and $name); + $whatsit->setProperty(theory=>LookupValue('current_module')); + return; }, + alias=>'\defiii'); +DefConstructor('\inlineex OptionalKeyVals:omtext {}', + "<ltx:text class='example'>#2</ltx:text>"); +DefConstructor('\inlinedef OptionalKeyVals:omtext {}', sub { + my ($document, $keyvals, $body, %props) = @_; + my $for = $keyvals->getValue('for') if $keyvals; + my %for_attr=(); + if (ToString($for)) { + $for = ToString($for); + $for =~ s/^{(.+)}$/$1/eg; + foreach (split(/,\s*/,$for)) { + $for_attr{$_}=1; + }} + my @symbols = @{$props{defs} || []}; + #Prepare for symbol insertion -insert before the parent of the closest ancestor CMP element + my $original_node = $document->getNode; + my $xc = XML::LibXML::XPathContext->new( $original_node ); + $xc->registerNs('omdoc', 'http://omdoc.org/ns'); + my ($statement_ancestor) = $xc->findnodes('./ancestor::omdoc:CMP/..'); + foreach my $symb(@symbols) { + next if $for_attr{$symb}; + $for_attr{$symb}=1; + my $symbolnode = XML::LibXML::Element->new('symbol'); + $symbolnode->setAttribute(name=>$symb); + $symbolnode->setAttribute("xml:id"=>makeNCName("$symb.def.sym")); + $statement_ancestor->parentNode->insertBefore($symbolnode,$statement_ancestor); + } + #Restore the insertion point + $document->setNode($original_node); + my %attrs = (); + $for = join(" ",(keys %for_attr)); + $attrs{'for'} = $for if $for; + my $id = $keyvals->getValue('id') if $keyvals; + $attrs{'xml:id'} = $id if $id; +$attrs{'class'} = 'inlinedef'; + $document->openElement('ltx:text',%attrs); + $document->absorb($body); +$document->closeElement('ltx:text'); }, + #Prepare 'defs' hooks for \defi and \definiendum symbol names + beforeDigest=>sub { + my @symbols = (); + AssignValue('defs', \@symbols); return; }, + #Adopt collected names as 'defs' property, remove hooks + afterDigest=>sub { + my ($stomach, $whatsit) = @_; + my $defsref = LookupValue('defs'); + my @defs = @$defsref; + $whatsit->setProperty('defs',\@defs); + AssignValue('defs',undef); + return; }); +DefConstructor('\termref OptionalKeyVals:termref {}', + "<omdoc:term " + . "?&KeyVal(#1,'cdbase')(cdbase='&KeyVal(#1,'cdbase')')() " + . "cd='?&KeyVal(#1,'cd')(&KeyVal(#1,'cd'))(#module)' " + . "name='&KeyVal(#1,'name')'>" + . "#2" + ."</omdoc:term>", + afterDigest=>sub{$_[1]->setProperty(module=>LookupValue('current_module'))}); +RawTeX(' +\newcommand\atrefi[3][]{\def\@test{#1}\ifx\@test\@empty\termref[name=#3]{#2}\else\termref[cd=#1,name=#3]{#2}\fi} +\newcommand\atrefii[4][]{\atrefi[#1]{#2}{#3-#4}} +\newcommand\atrefiii[5][]{\atrefi[#1]{#2}{#3-#4-#5}} +\newcommand{\trefi}[2][]{\atrefi[#1]{#2}{#2}} +\newcommand{\trefii}[3][]{\atrefi[#1]{#2 #3}{#2-#3}} +\newcommand{\trefiii}[4][]{\atrefi[#1]{#2 #3 #4}{#2-#3-#4}} +'); +DefConstructor('\symref{}{}', + "<omdoc:term cd='&LookupValue('symdef.#1.cd')' name='&LookupValue('symdef.#1.name')'>" + . "#2" + ."</omdoc:term>"); +Tag('omdoc:assertion',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:definition',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:example',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:requation',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:axiom',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:symbol',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:type',afterOpen=>\&numberIt,afterClose=>\&locateIt); +Tag('omdoc:term',afterOpen=>\&numberIt,afterClose=>\&locateIt); +RawTeX(' +\newcommand\defin[2][]{\defi[#1]{#2}% +\PackageWarning{statements}{\protect\defin\space is deprecated, use \protect\defi\space instead}} +\newcommand\twindef[3][]{\defii[#1]{#2}{#3}% +\PackageWarning{statements}{\protect\twindef\space is deprecated, use \protect\defii\space instead}} +\newcommand\atwindef[4][]{\defiii[#1]{#2}{#3}{#4}% +\PackageWarning{statements}{\protect\atwindef\space is deprecated, use \protect\defiii\space instead}} +\newcommand\definalt[3][]{\adefi[#1]{#2}{#3}% +\PackageWarning{statements}{\protect\definalt\space is deprecated, use \protect\adefi\space instead}} +\newcommand\twindefalt[4][]{\adefii[#1]{#2}{#3}{#4}% +\PackageWarning{statements}{\protect\twindefalt\space is deprecated, use \protect\adefii\space instead}} +\newcommand\atwindefalt[5][]{\adefiii[#1]{#2}{#3}{#4}{#5}% +\PackageWarning{statements}{\protect\atwindefalt\space is deprecated, use \protect\adefiii\space instead}} +\newcommand\twinref[3][]{\trefii[#1]{#2}{#3}% +\PackageWarning{statements}{\protect\twinref\space is deprecated, use \protect\trefii\space instead}} +\newcommand\atwinref[4][]{\atrefiii[#1]{#2}{#3}{#4}% +\PackageWarning{statements}{\protect\atwindef\space is deprecated, use \protect\trefiii\space instead}} +'); +1; diff --git a/Master/texmf-dist/tex/latex/stex/stex-logo.sty b/Master/texmf-dist/tex/latex/stex/stex-logo.sty new file mode 100644 index 00000000000..229aa300eb5 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/stex-logo.sty @@ -0,0 +1,5 @@ +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{stex-logo}[2009/08/07 v1.0 sTeX Logo] +\RequirePackage{xspace} +\def\stex{\@ifundefined{texorpdfstring}{\let\texorpdfstring\@firstoftwo}{}\texorpdfstring{\raisebox{-.5ex}S\kern-.5ex\TeX}{sTeX}\xspace} +\def\sTeX{\stex} diff --git a/Master/texmf-dist/tex/latex/stex/stex-logo.sty.ltxml b/Master/texmf-dist/tex/latex/stex/stex-logo.sty.ltxml new file mode 100644 index 00000000000..cd3ed6d0df4 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/stex-logo.sty.ltxml @@ -0,0 +1,18 @@ +# -*- CPERL -*- +# /=======================================================\ # +# | stex.sty - Implementation for LaTeXML | # +# | | # +# |=======================================================| # +# | Not Part of LaTeXML : http://dlmf.nist.gov/LaTeXML/ | # +# | Copyright (c) 2006 arXMLiv group | # +# | Released under the GNU Public License | # +# \=======================================================/ # + +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +RequirePackage('xspace'); +DefConstructor('\stex', + "<ltx:text>sTeX</ltx:text>"); +RawTeX('\def\sTeX{\stex}'); +1; diff --git a/Master/texmf-dist/tex/latex/stex/stex.sty b/Master/texmf-dist/tex/latex/stex/stex.sty new file mode 100644 index 00000000000..3e402a40932 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/stex.sty @@ -0,0 +1,24 @@ +% sTeX: a package for semantic markup in LaTeX +% Copyright (c) 2009 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% +% The development version of this file can be found at +% $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/stex.sty $ +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{stex}[2010/02/04 v0.9b Semantic Markup] +% we pass the options to the appropriate packages +\DeclareOption{extrefs}{\PassOptionsToPackage{\CurrentOption}{sref}} +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{omd}} +\DeclareOption{showmods}{\PassOptionsToPackage{\CurrentOption}{modules}} +\ProcessOptions +% now we require the respective packages. +\RequirePackage{stex-logo} +\RequirePackage{modules} +\RequirePackage{statements} +\RequirePackage{sproof} +\RequirePackage{omdoc} +\RequirePackage{presentation} +\RequirePackage{cmath} +\RequirePackage{dcm} + diff --git a/Master/texmf-dist/tex/latex/stex/stex.sty.ltxml b/Master/texmf-dist/tex/latex/stex/stex.sty.ltxml new file mode 100644 index 00000000000..ab396e36c6f --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/stex.sty.ltxml @@ -0,0 +1,24 @@ +# -*- CPERL -*- +# /=======================================================\ # +# | stex.sty - Implementation for LaTeXML | # +# | | # +# |=======================================================| # +# | Not Part of LaTeXML : http://dlmf.nist.gov/LaTeXML/ | # +# | Copyright (c) 2006 arXMLiv group | # +# | Released under the GNU Public License | # +# \=======================================================/ # + +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; + +RequirePackage('stex-logo'); +RequirePackage('modules'); +RequirePackage('statements'); +RequirePackage('sproof'); +RequirePackage('omdoc'); +RequirePackage('presentation'); +RequirePackage('cmath'); +RequirePackage('dcm'); + +1; diff --git a/Master/texmf-dist/tex/latex/stex/stex.tex b/Master/texmf-dist/tex/latex/stex/stex.tex new file mode 100644 index 00000000000..325128d4ddd --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/stex.tex @@ -0,0 +1,417 @@ +\documentclass{article} +\usepackage{a4wide,stex-logo} +\usepackage{textcomp,url,array,float,amsfonts} +\usepackage{listings} +\usepackage[show]{ed} +\usepackage[backref=true,hyperref=auto,style=alphabetic]{biblatex} +\bibliography{kwarc} +\usepackage{hyperref} +\makeindex +\floatstyle{boxed} +\newfloat{exfig}{thp}{lop} +\floatname{exfig}{Example} + +\def\ctancitesuffix{:ctan} +\def\ctancite#1{\cite{#1\ctancitesuffix}} +\def\meta#1{\textlangle\textit{#1}\textrangle} +\def\scsys#1{{{\sc #1}}\index{#1@{\sc #1}}} +\def\xslt{{\scsys{xslt}}} +\def\xml{\scsys{Xml}} +\def\mathml{\scsys{MathML}} +\def\omdoc{\scsys{OMDoc}} +\def\physml{\scsys{PhysML}} +\def\openmath{\scsys{OpenMath}} +\def\connexions{\scsys{Connexions}} +\def\latexml{\scsys{LaTeXML}} +\def\perl{\scsys{Perl}} +\def\cmathml{Content-{\sc MathML}\index{Content {\sc MathML}}\index{MathML@{\sc MathML}!content}} +\def\activemath{\scsys{ActiveMath}} +\def\twin#1#2{\index{#1!#2}\index{#2!#1}} +\def\twintoo#1#2{{#1 #2}\twin{#1}{#2}} +\def\atwin#1#2#3{\index{#1!#2!#3}\index{#3!#2 (#1)}} +\def\atwintoo#1#2#3{{#1 #2 #3}\atwin{#1}{#2}{#3}} + +% these macros are used in the short descriptions +\def\connexions{\scshape{Connexions}} +\def\cnxlatex{CNX\LaTeX} +\def\cnxml{\scshape{CNXml}} + +\title{{\stex}: Semantic Markup in {\TeX/\LaTeX}} +\author{Michael Kohlhase\\ + Jacobs University, Bremen\\ + \url{http://kwarc.info/kohlhase}} +\lstdefinelanguage{MathML}[]{XML}% +{morekeywords={math,semantics,annotation-xml,annotation, + maction, + mrow,mo,mi,mn, + apply,bvar,ci,cn,sep,csymbol, + condition,domainofapplication,lowlimit,uplimit,degree, + interval,inverse,lambda,compose,ident,domain,codomain,image, + piecewise, piece, otherwise, + quotient,factorial,divide,max,min,minus,plus,power,rem,times, root,gcd,lcm, + and,or,xor,not,implies,forall,exists, + abs,conjugate,arg,real,imaginary,floor,ceiling, + sin,cos,tan,sec,csc,cot,sinh,cosh,tanh,sech,csch,coth, + arcsin,arccos,arctan,arccosh,arccot,arccoth,arccsc,arccsch,arcsec,arcsech,arcsinh,arctanh, + eq,neq,gt,lt,geq,leq,equivalent,approx,factorof, + int,diff,partialdiff,divergence,grad,curl,laplacian, + set,list,union,intersect,in,notin,subset,prsubset,notsubset,notprsubset,setdiff,card,cartesianproduct, + sum,product,limit,tendsto,exp,ln,log,mean,sdev,variance,median,mode,moment,momentabout, + vector,matrix,matrixrow,determinant,transpose,selector,vectorproduct,scalarproduct,outerproduct, + integers,reals,rationals,naturalnumbers,complexes,primes, + exponentiale,imaginaryi,notanumber,true,false,emptyset,pi,eulergamma,infinity, + reln,fn,declare}, + sensitive=true} + +\begin{document} + \pagenumbering{roman} + \maketitle +\begin{abstract} + We present a collection of {\TeX} macro packages that allow to markup + {\TeX/\LaTeX} documents semantically without leaving the document format, + essentially turning {\TeX/\LaTeX} into a document format for mathematical + knowledge management (MKM). + \end{abstract} +\setcounter{tocdepth}{2}\tableofcontents +\clearpage +\pagenumbering{arabic} + +\section{Introduction} + +The last few years have seen the emergence of various content-oriented {\xml}-based, +content-oriented markup languages for mathematics on the web, e.g. +{\openmath}~\cite{BusCapCar:2oms04}, {\cmathml}~\cite{CarIon:MathML03}, or our own +{\omdoc}~\cite{Kohlhase:omfmd05}. These representation languages for mathematics, that +make the structure of the mathematical knowledge in a document explicit enough that +machines can operate on it. Other examples of content-oriented formats for mathematics +include the various logic-based languages found in automated reasoning tools +(see~\cite{RobVor:hoar01} for an overview), program specification languages (see +e.g.~\cite{Bergstra:as89}). + +The promise if these content-oriented approaches is that various tasks involved in ``doing +mathematics'' (e.g. search, navigation, cross-referencing, quality control, user-adaptive +presentation, proving, simulation) can be machine-supported, and thus the working +mathematician is relieved to do what humans can still do infinitely better than machines: +The creative part of mathematics --- inventing interesting mathematical objects, +conjecturing about their properties and coming up with creative ideas for proving these +conjectures. However, before these promises can be delivered upon (there is even a +conference series~\cite{MKM-IG-Meetings:online} studying ``Mathematical Knowledge +Management (MKM)''), large bodies of mathematical knowledge have to be converted into +content form. + +Even though {\mathml} is viewed by most as the coming standard for representing +mathematics on the web and in scientific publications, it has not not fully taken off in +practice. One of the reasons for that may be that the technical communities that need +high-quality methods for publishing mathematics already have an established method which +yields excellent results: the {\TeX/\LaTeX} system: and a large part of mathematical +knowledge is prepared in the form of {\TeX}/{\LaTeX} documents. + +{\TeX}~\cite{Knuth:ttb84} is a document presentation format that combines complex +page-description primitives with a powerful macro-expansion facility, which is utilized in +{\LaTeX} (essentially a set of {\TeX} macro packages, see~\cite{Lamport:ladps94}) to +achieve more content-oriented markup that can be adapted to particular tastes via +specialized document styles. It is safe to say that {\LaTeX} largely restricts content +markup to the document structure\footnote{supplying macros e.g. for sections, paragraphs, + theorems, definitions, etc.}, and graphics, leaving the user with the presentational +{\TeX} primitives for mathematical formulae. Therefore, even though {\LaTeX} goes a great +step into the direction of an MKM format, it is not, as it lacks infrastructure for +marking up the functional structure of formulae and mathematical statements, and their +dependence on and contribution to the mathematical context. + +\subsection{The {\xml} vs. {\TeX/\LaTeX} Formats and Workflows} + +{\mathml} is an {\xml}-based markup format for mathematical formulae, it is standardized +by the World Wide Web Consortium in {\cite{CarIon:MathML03}}, and is supported by the +major browsers. The {\mathml} format comes in two integrated components: presentation +{\mathml}\twin{presentation}{MathML} and content {\mathml}\twin{content}{MathML}. The +former provides a comprehensive set of layout primitives for presenting the visual +appearance of mathematical formulae, and the second one the functional/logical structure +of the conveyed mathematical objects. For all practical concerns, presentation {\mathml} +is equivalent to the math mode of {\TeX}. The text mode facilitates of {\TeX} (and the +multitude of {\LaTeX} classes) are relegated to other {\xml} formats, which embed +{\mathml}. + +The programming language constructs of {\TeX} (i.e. the macro definition +facilities\footnote{We count the parser manipulation facilities of {\TeX}, e.g. category + code changes into the programming facilities as well, these are of course impossible for + {\mathml}, since it is bound to {\xml} syntax.}) are relegated to the {\xml} +programming languages that can be used to develop language extensions. +transformation language {\xslt}~\cite{Deach:exls99,Kay:xpr00} or proper {\xml}-enabled +The {\xml}-based syntax and the separation of the presentational-, functional- and +programming/extensibility concerns in {\mathml} has some distinct advantages over the +integrated approach in {\TeX/\LaTeX} on the services side: {\mathml} gives us better +\begin{itemize} +\item integration with web-based publishing, +\item accessibility to disabled persons, e.g. (well-written) {\mathml} contains enough + structural information to supports screen readers. +\item reusability, searchabiliby and integration with mathematical software systems + (e.g. copy-and-paste to computer algebra systems), and +\item validation and plausibility checking. +\end{itemize} + +On the other hand, {\TeX/\LaTeX}/s adaptable syntax and tightly integrated programming +features within has distinct advantages on the authoring side: + +\begin{itemize} +\item The {\TeX/\LaTeX} syntax is much more compact than {\mathml} (see the difference in + Figure~\ref{fig:mathml-sum} and Equation ~\ref{eq:cmathml-sum}), and if needed, the + community develops {\LaTeX} packages that supply new functionality in with a succinct + and intuitive syntax. +\item The user can define ad-hoc abbreviations and bind them to new control sequences to + structure the source code. +\item The {\TeX/\LaTeX} community has a vast collection of language extensions and best + practice examples for every conceivable publication purpose and an established and very + active developer community that supports these. +\item There is a host of software systems centered around the {\TeX/\LaTeX} language that + make authoring content easier: many editors have special modes for {\LaTeX}, there are + spelling/style/grammar checkers, transformers to other markup formats, etc. +\end{itemize} + +In other words, the technical community is is heavily invested in the whole +{\index*{workflow}}, and technical know-how about the format permeates the +community. Since all of this would need to be re-established for a {\mathml}-based +workflow, the technical community is slow to take up {\mathml} over {\TeX/\LaTeX}, even in +light of the advantages detailed above. + +\subsection{A {\LaTeX}-based Workflow for {\xml}-based Mathematical Documents} + +An elegant way of sidestepping most of the problems inherent in transitioning from a +{\LaTeX}-based to an {\xml}-based workflow is to combine both and take advantage of the +respective advantages. + +The key ingredient in this approach is a system that can transform {\TeX\LaTeX} documents +to their corresponding {\xml}-based counterparts. That way, {\xml}-documents can be +authored and prototyped in the {\LaTeX} workflow, and transformed to {\xml} for +publication and added-value services, combining the two workflows. + +There are various attempts to solve the {\TeX/\LaTeX} to {\xml} transformation problem; the +most mature is probably Bruce Miller's {\latexml} system~\cite{Miller:latexml:online}. It +consists of two parts: a re-implementation of the {\TeX} {\index*{analyzer}} with all of +it's intricacies, and a extensible {\xml} emitter (the component that assembles the output +of the parser). Since the {\LaTeX} style files are (ultimately) programmed in {\TeX}, the +{\TeX} analyzer can handle all {\TeX} extensions, including all of {\LaTeX}. Thus the +{\latexml} parser can handle all of {\TeX/\LaTeX}, if the emitter is extensible, which is +guaranteed by the {\latexml} binding language: To transform a {\TeX/\LaTeX} document to a +given {\xml} format, all {\TeX} extensions\footnote{i.e. all macros, environments, and + syntax extensions used int the source document} must have ``{\latexml} +bindings''\index{LaTeXML}{binding}, i.e. a directive to the {\latexml} emitter that +specifies the target representation in {\xml}. + +\section{The Packages of the \protect\stex Collection}\label{sec:packages} + +In the following, we will shortly preview the packages and classes in the {\stex} +collection. They all provide part of the solution of representing semantic structure in +the {\TeX/\LaTeX} workflow. We will group them by the conceptual level they +address\ednote{come up with a nice overview figure here!} + +\subsection{Content Markup of Mathematical Formulae in {\TeX/\LaTeX}} + +The first two packages are concerned basically with the math mode in {\TeX}, +i.e. mathematical formulae. The underlying problem is that run-of-the-mill {\TeX/\LaTeX} +only specifies the presentation (i.e. what formulae look like) and not their content +(their functional structure). Unfortunately, there are no good methods (yet) to infer the +latter from the former, but there are ways to get presentation from content. + +Consider for instance the following ``standard notations''\footnote{The first one is + standard e.g. in Germany and the US, and the last one in France} for binomial +coefficients: $\left(n\atop k\right)$, $_nC^k$, $\mathcal{C}^n_k$ all mean the same thing: +$n!\over k!(n-k)!$. This shows that we cannot hope to reliably recover the functional +structure (in our case the fact that the expression is constructed by applying the +binomial function to the arguments $n$ and $k$) from the presentation alone. + +The solution to this problem is to dump the extra work on the author (after all she knows +what she is talking about) and give them the chance to specify the intended structure. The +markup infrastructure supplied by the {\stex} collection lets the author do this without +changing\footnote{However, semantic annotation will make the author more aware of the + functional structure of the document and thus may in fact entice the author to use + presentation in a more consistent way than she would usually have.} the visual +appearance, so that the {\LaTeX} workflow is not disrupted. . We speak of +{\twintoo{semantic}{preloading}} for this process and call our collection of macro +packages {\stex} (Semantic {\TeX}). For instance, we can now write +\begin{equation}\label{eq:cmathml-sum} + \verb|\CSumlLimits{k}1\infty{\Cexp{x}k}| \qquad\hbox{instead of the usual}\qquad + \verb|\sum_{k=1}^\infty x^k| +\end{equation} + +In the first form, we specify that you are applying a function (|CSumLimits| $\hat=$ Sum +with Limits) to 4 arguments: ({\sl{i}}) the bound variable $k$ (that runs from) +({\sl{ii}}) the number 1 (to) ({\sl{iii}}) $\infty$ (to infinity summing the terms) +({\sl{iv}}) \verb|\Cexp{x}k| (i.e. x to the power k). In the second form, we merely specify +hat {\LaTeX} should draw a capital Sigma character ($\sigma$) with a lower index which is +an equation $k=1$ and an upper index $\infty$. Then it should place next to it an $x$ with +an upper index $k$. + +Of course human readers (that understand the math) can infer the content structure from +this presentation, but the {\latexml} converter (who does not understand the math) cannot, +but we want to have the content {\mathml} expression in Figure~\ref{fig:mathml-sum} +\begin{exfig} +\begin{lstlisting}[language=MathML,belowskip=-1ex,aboveskip=-1ex] + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <sum/> + <bvar><ci>k</ci></bvar> + <lowlimit><cn>1</cn></lowlimit> + <uplimit><infinit/></cn></uplimit> + <apply><exp/><ci>x</ci><ci>k</ci></apply> + </apply> + </math> +\end{lstlisting} + \caption{Content {\mathml} Form of $\sum_{k=1}^\infty x^k$}\label{fig:mathml-sum} +\end{exfig} + +Obviously, a converter can infer this from the first {\LaTeX} structure with the help of +the curly braces that indicate the argument structure, but not from the second (because it +does not understand the math). The nice thing about the |cmathml| infrastructure is that +you can still run {\LaTeX} over the first form and get the same formula in the DVI file +that you would have gotten from running it over the second form. That means, if the author +is prepared to write the mathematical formulae a little differently in her {\LaTeX} +sources, then she can use them in {\xml} and {\LaTeX} at the same time. + + +\subsubsection{{\texttt{cmathml}}: Encoding Content {\mathml} in {\TeX/\LaTeX}} + +The {\texttt{cmathml}} package (see~\ctancite{Kohlhase:tbscml}) provides a set of macros that +correspond to the K-14 fragment of mathematics (Kindergarten to undergraduate college +level ($\hat=14^{th}$ grade)). We have already seen an example above in equation +(\ref{eq:cmathml-sum}), where the content markup in {\TeX} corresponds to a content +{\mathml}-expression (and can actually be translated to this by the {\latexml} system.) +However, the content {\mathml} vocabulary is fixed in the {\mathml} specification and +limited to the K-14 fragment; the notation of mathematics of course is much larger and +extensible on the fly. + + +\subsubsection{{\tt{presentation}}: Flexible Presentation for Semantic Macros} + +The {\texttt{presentation}} package (see~\ctancite{Kohlhase:ipsmsl}) supplies an +infrastructure that allows to specify the presentation of semantic macros, including +preference-based bracket elision. This allows to markup the functional structure of +mathematical formulae without having to lose high-quality human-oriented presentation in +{\LaTeX}. Moreover, the notation definitions can be used by MKM systems for added-value +services, either directly from the {\sTeX} sources, or after translation. + +\subsection{Mathematical Statements} + +\subsubsection{{\tt{statements}}: Extending Content Macros for Mathematical Notation} + +The \texttt{statements} package (see\ctancite{Kohlhase:smms}) provides semantic markup +facilities for mathematical statements like Theorems, Lemmata, Axioms, Definitions, +etc. in {\stex} files. This structure can be used by MKM systems for added-value services, +either directly from the {\sTeX} sources, or after translation. + +\subsubsection{{\tt{sproof}}: Extending Content Macros for Mathematical Notation} + +The \texttt{sproof} package (see~\ctancite{Kohlhase:smp})supplies macros and environment +that allow to annotate the structure of mathematical proofs in {\stex} files. This +structure can be used by MKM systems for added-value services, either directly from the +{\sTeX} sources, or after translation. + + +\subsection{Context Markup for Mathematics} + +\subsubsection{{\tt{modules}}: Extending Content Macros for Mathematical Notation} + +The \texttt{modules} package (see~\ctancite{KohAmb:smmssl}) supplies a definition +mechanism for semantic macros and a non-standard scoping construct for them, which is +oriented at the semantic dependency relation rather than the document structure. This +structure can be used by MKM systems for added-value services, either directly from the +{\sTeX} sources, or after translation. + +\subsection{Mathematical Document Classes} + +\subsubsection{Connexions Modules} + +{\cnxlatex} (see~\ctancite{Kohlhase:clbscm}) is a collection of {\LaTeX} macros that allow +to write {\connexions} modules without leaving the {\LaTeX} workflow. Modules are authored +in {\cnxlatex} using only a text editor, transformed to PDF and proofread as usual. In +particular, the {\LaTeX} workflow is independent of having access to the {\connexions} +system, which makes {\cnxlatex} attractive for the initial version of single-author +modules. + + +For publication, {\cnxlatex} modules are transformed to {\cnxml} via the {\latexml} +translator and can be uploaded to the {\connexions} system. + +\subsubsection{OMDoc Documents} + +The \texttt{omdoc} package provides an infrastructure that allows to markup {\omdoc} +documents in {\LaTeX}. It provides \texttt{omdoc.cls}, a class with the and +{\texttt{omdocdoc.sty}} + +\subsection{Conclusion}\label{sec:concl} + +The {\stex} collection provides a set of semantic macros that extends the familiar and +time-tried {\LaTeX} workflow in academics until the last step of Internet publication of +the material. For instance, a {\connexions} module can be authored and maintained in +{\LaTeX} using a simple text editor, a process most academics in technical subjects are +well familiar with. Only in a last publishing step (which is fully automatic) does it get +transformed into the {\xml} world, which is unfamiliar to most academics. + +Thus, {\stex} can serve as a conceptual interface between the document author and MKM +systems: Technically, the semantically preloaded {\LaTeX} documents are transformed into +the (usually {\xml}-based) MKM representation formats, but conceptually, the ability to +semantically annotate the source document is sufficient. + +The {\stex} macro packages have been validated together with a case +study~\cite{Kohlhase04:stex}, where we semantically preload the course materials for a +two-semester course in Computer Science at Jacobs University Bremen and transform them to +the {\omdoc} MKM format. + +\subsection{Licensing, Download and Setup}\label{sec:setup} + +The {\stex} packages are licensed under the {\LaTeX} Project Public License~\cite{LPPL}, +which basically means that they can be downloaded, used, copied, and even modified by +anyone under a set of simple conditions (e.g. if you modify you have to distribute under a +different name). + +The {\stex} packages and classes can be obtained as a self-documenting {\LaTeX} packages: +To obtain a package {\meta{package}} download the files \meta{package}\texttt{.dtx} and +\meta{package}\texttt{.ins} from +\begin{center} + {\url{https://svn.kwarc.info/repos/kwarc/projects/stex/sty/stex/}\meta{package}/} +\end{center} +To extract the {\LaTeX} package \meta{package}\texttt{.sty} and the {\latexml} bindings in +\meta{package}\texttt{.ltxml}, run the {\LaTeX} formatter on \texttt{cmathml.ins}, e.g. by typing +\texttt{latex cmathml.ins} to a shell. To extract the documentation (the version of this document that +goes with the extracted package) run the {\LaTeX} formatter on \texttt{cmathml.dtx} e.g. by +typing \texttt{latex }\meta{package}\texttt{.dtx} to a shell. + +Usually, the {\stex} distribution will also have the newest versions of the files +\meta{package}\texttt{.sty}, \meta{package}\texttt{.ltxml}, and the documentation \meta{package}\texttt{.pdf} +pre-generated for convenience, so they can be downloaded directly from the URL above. + +To install the package, copy the file \meta{package}\texttt{.sty} somewhere, where +{\TeX}/{\LaTeX} can find it and rebuild {\TeX}'s file name database. This is done by +running the command \texttt{texhash} or \texttt{mktexlsr} (they are the same). In \texttt{MikTEX}, there is a +menu option to do this. + +\section{Utilities}\label{sec:utilities} + +To simplify dealing with {\stex} documents, we are providing a small collection of command +line utilities, which we will describe here. For details and downloads go to +{\url{http://kwarc.info/projects/stex}}. + +\begin{description} +\item[{\tt{msplit}}] splits an {\stex} file into smaller ones (one module per file) +\item[{\tt{rf}}] computes the ``reuse factor'', i.e. how often {\stex} modules are reused + over a collection of documents +\item[{\tt{sgraph}}] visualizes the module graph +\item[{\tt{sms}}] computes the {\stex} module signatures for a give {\stex} file +\item[{\tt{bms}}] proposes a sensible module structure for an un-annotated {\stex} file +\end{description} +\printbibliography +\end{document} +%%% Local Variables: +%%% mode: LaTeX +%%% TeX-master: t +%%% End: + +% LocalWords: hoc LaTeXML nC CSumLimits cmathml DVI th sproof dtx mikoslides +% LocalWords: ltxml pdf texhash mktexlsr MikTEX msplit rf sgraph sms bms un eq +% LocalWords: cnx omdoc pagenumbering maketitle setcounter tocdepth clearpage +% LocalWords: tableofcontents openmath omfmd05 Bergstra mathml ttb84 ladps94 +% LocalWords: xslt Deach exls99 xpr00 stex ednote mathcal twintoo CSumlLimits +% LocalWords: infty Cexp qquad hbox qquad exfig lstlisting belowskip aboveskip +% LocalWords: xmlns bvar bvar lowlimit cn cn lowlimit uplimit uplimit exp tt +% LocalWords: subsubsection texttt ctancite tbscml ipsmsl smms smp KohAmb +% LocalWords: smmssl cnxlatex clbscm cnxml omdoc.cls omdocdoc.sty concl +% LocalWords: printbibliography diff --git a/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty b/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty new file mode 100644 index 00000000000..4dc956dd97f --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty @@ -0,0 +1,136 @@ +%% +%% This is file `workaddress.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% workaddress.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{workaddress}[2012/01/28 v0.4 WorkAddress] +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\ProcessOptions +\RequirePackage{sref} +\RequirePackage{pgf} +\addmetakey{wa@person}{id} +\addmetakey{wa@person}{birthdate} +\addmetakey{wa@person}{email} +\addmetakey{wa@person}{url} +\addmetakey{wa@person}{affiliation} +\addmetakey{wa@person}{personaltitle} +\addmetakey{wa@person}{academictitle} +\addmetakey{wa@person}{department} +\addmetakey{wa@person}{workaddress} +\addmetakey{wa@person}{privaddress} +\addmetakey{wa@person}{worktel} +\addmetakey{wa@person}{privtel} +\addmetakey{wa@person}{workfax} +\addmetakey{wa@person}{privfax} +\addmetakey{wa@person}{worktelfax} +\addmetakey{wa@person}{privtelfax} +\def\wa@def#1#2#3#4{\expandafter\xdef\csname wa@#1@#2@#3\endcsname{#4}} +\def\wa@ref@test#1#2#3{% +\@ifundefined{wa@#1@#2@#3}% +{\PackageError{workaddress}{reference to undefined #3 of #1 #2}% +{you must define a #1 with #2=#3\MessageBreak% +via the macro \protect\WA#1, before you can use it!}} +{}} +\def\wa@ref#1#2#3{\wa@ref@test{#1}{#2}{#3}\csname wa@#1@#2@#3\endcsname} +\let\wa@persons=\relax +\newcommand{\WAperson}[2][]{\metasetkeys{wa@person}{#1} +\ifx\wa@person@id\@empty\@latex@warning{key 'id' undefined in WAperson}\else +\wa@def{person}\wa@person@id{id}{\wa@person@id}% redundant, but useful for checking +\wa@def{person}\wa@person@id{name}{#2} +\wa@def{person}\wa@person@id{email}{\wa@person@email} +\wa@def{person}\wa@person@id{birthdate}{\wa@person@birthdate} +\wa@def{person}\wa@person@id{url}{\wa@person@url} +\wa@def{person}\wa@person@id{affiliation}{\wa@person@affiliation} +\wa@def{person}\wa@person@id{workaddress}{\wa@person@workaddress} +\wa@def{person}\wa@person@id{privaddress}{\wa@person@privaddress} +\wa@def{person}\wa@person@id{personaltitle}{\wa@person@personaltitle} +\wa@def{person}\wa@person@id{academictitle}{\wa@person@academictitle} +\wa@def{person}\wa@person@id{department}{\wa@person@department} +\wa@def{person}\wa@person@id{workaddress}{\wa@person@workaddress} +\wa@def{person}\wa@person@id{privaddress}{\wa@person@privaddress} +\wa@def{person}\wa@person@id{worktel}{\wa@person@worktel} +\wa@def{person}\wa@person@id{privtel}{\wa@person@privtel} +\wa@def{person}\wa@person@id{workfax}{\wa@person@workfax} +\wa@def{person}\wa@person@id{privfax}{\wa@person@privfax} +\wa@def{person}\wa@person@id{worktelfax}{\wa@person@worktelfax} +\wa@def{person}\wa@person@id{privtelfax}{\wa@person@privtelfax} +\@ifundefined{wa@persons} +{\xdef\wa@persons{\wa@person@id}} +{\xdef\wa@persons{\wa@persons,\wa@person@id}} +\fi} +\newcommand\DCMperson[2][]{\WAperson[#1]{#2}% +\PackageWarning{workaddress}{\protect\DCMperson\space is deprecated, use \protect\WAperson\space instead}} +\addmetakey{wa@institution}{id} +\addmetakey{wa@institution}{shortname} +\addmetakey{wa@institution}{acronym} +\addmetakey{wa@institution}{url} +\addmetakey{wa@institution}{partof} +\addmetakey{wa@institution}{countryshort} +\addmetakey{wa@institution}{logo} +\addmetakey{wa@institution}{streetaddress} +\addmetakey{wa@institution}{townzip} +\addmetakey{wa@institution}{type} +\addmetakey{wa@institution}{country} +\let\wa@institutions=\relax +\newcommand{\WAinstitution}[2][]{\metasetkeys{wa@institution}{#1} +\ifx\wa@institution@id\@empty\@latex@warning{key 'id' undefined in WAinstitution}\else +\wa@def{institution}\wa@institution@id{id}{\wa@institution@id}% redundant, but useful for checking +\wa@def{institution}\wa@institution@id{name}{#2} +\wa@def{institution}\wa@institution@id{shortname}{\wa@institution@shortname} +\wa@def{institution}\wa@institution@id{acronym}{\wa@institution@acronym} +\wa@def{institution}\wa@institution@id{url}{\wa@institution@url} +\wa@def{institution}\wa@institution@id{partof}{\wa@institution@partof} +\wa@def{institution}\wa@institution@id{countryshort}{\wa@institution@countryshort} +\wa@def{institution}\wa@institution@id{logo}{\wa@institution@logo} +\wa@def{institution}\wa@institution@id{townzip}{\wa@institution@townzip} +\wa@def{institution}\wa@institution@id{streetaddress}{\wa@institution@streetaddress} +\wa@def{institution}\wa@institution@id{country}{\wa@institution@country} +\wa@def{institution}\wa@institution@id{type}{\wa@institution@type} +\@ifundefined{wa@institutions} +{\xdef\wa@institutions{\wa@institution@id}} +{\xdef\wa@institutions{\wa@institutions,\wa@institution@id}} +\fi} +\newcommand\DCMinstitution[2][]{\WAinstitution[#1]{#2}% +\PackageWarning{workaddress}{\protect\DCMinstitution\space is deprecated, use \protect\WAinstitution\space instead}} +\addmetakey[false]{WAauthorblock}{dept}[true] +\addmetakey[false]{WAauthorblock}{aff}[true] +\addmetakey[false]{WAauthorblock}{url}[true] +\def\@true{true} +\newcounter{authors} +\newcommand\WAauthorblock[2][]{% +\metasetkeys{WAauthorblock}{#1} +{\let\tabularnewline\relax + \@for\@I:=#2\do{\stepcounter{authors}} + \def\@authors{}\def\@affs{}\def\@depts{}\def\@urls{} + \@for\@I:=#2\do + {\xdef\@authors{\@authors&\wa@ref{person}\@I{name}} + \xdef\@@dept{\wa@ref{person}\@I{department}} + \xdef\@shortname{\csname wa@institution@\@@dept @shortname\endcsname} + \xdef\@dept{\ifx\@shortname\@empty\wa@ref{institution}\@@dept{name}\else\@shortname\fi} + \xdef\@depts{\@depts&\@dept} + \xdef\@@aff{\wa@ref{person}\@I{affiliation}} + \xdef\@shortname{\csname wa@institution@\@@aff @shortname\endcsname} + \xdef\@aff{\ifx\@shortname\@empty\wa@ref{institution}\@@aff{name}\else\@shortname\fi} + \xdef\@affs{\@affs&\@aff} + \xdef\@urls{\@urls&\wa@ref{person}\@I{url}}} + \message{\theauthors authors: \@authors}} + \begin{tabular}[t]{l*{\theauthors}{c}} + \@authors\\ + \ifx\WAauthorblock@dept\@true\@depts\\\fi + \ifx\WAauthorblock@aff\@true\@affs\\\fi + \ifx\WAauthorblock@url\@true\@urls\\\fi +\end{tabular}} +\newcommand\wapname[1]{\wa@ref{person}{#1}{name}} +\newcommand\waptname[1]{\wa@ref{person}{#1}{personaltitle} \wa@ref{person}{#1}{name}} +\newcommand\wa@institution@logo[2][]{% +\pgfdeclareimage[#1]{logo}{\wa@ref{institution}{#2}{logo}} +\IfFileExists{\wa@ref{institution}{#2}{logo}}% +{\pgfuseimage{logo}} +{\fbox{#2 logo}\message{still need logo for #2}}} +\endinput +%% +%% End of file `workaddress.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty.ltxml b/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty.ltxml new file mode 100644 index 00000000000..be79b087423 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/workaddress/workaddress.sty.ltxml @@ -0,0 +1,63 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Global; +use LaTeXML::Package; +RequirePackage('sref'); + sub getKeyValue_noDelim { + my ($keyval,$key)=@_; + my $valuelist = $keyval && ToString($keyval->getValue($key)); + $valuelist =~ s/^{(.*)}$/$1/g if $valuelist; + return $valuelist; +} +sub ExportMetadata { + my $keys = shift; + my($id, $email,$affill,$address,$url,$name)=$keys + && map(getKeyValue_noDelim($keys,$_),qw(id email affiliation address url name)); + if ($id) { + AssignValue('WA_'.$id.'_email',$email,'global') if $email; + AssignValue('WA_'.$id.'_affiliation',$affill,'global') if $affill; + AssignValue('WA_'.$id.'_address',$email,'global') if $email; + AssignValue('WA_'.$id.'_url',$url,'global') if $url; + AssignValue('WA_'.$id.'_name',$name,'global') if $name; + } else {print STDERR "Warning: key 'id' undefined in \\WAperson\n"}; + return;}#$ +DefKeyVal('wa@person','id','Semiverbatim'); +DefKeyVal('wa@person','birthdate','Semiverbatim'); +DefKeyVal('wa@person','email','Semiverbatim'); +DefKeyVal('wa@person','url','Semiverbatim'); +DefKeyVal('wa@person','affiliation','Semiverbatim'); +DefKeyVal('wa@person','personaltitle','Semiverbatim'); +DefKeyVal('wa@person','academictitle','Semiverbatim'); +DefKeyVal('wa@person','department','Semiverbatim'); +DefKeyVal('wa@person','workaddress','Semiverbatim'); +DefKeyVal('wa@person','privaddress','Semiverbatim'); +DefKeyVal('wa@person','worktel','Semiverbatim'); +DefKeyVal('wa@person','privtel','Semiverbatim'); +DefKeyVal('wa@person','workfax','Semiverbatim'); +DefKeyVal('wa@person','privfax','Semiverbatim'); +DefKeyVal('wa@person','worktelfax','Semiverbatim'); +DefKeyVal('wa@person','privtelfax','Semiverbatim'); + +DefConstructor('\WAperson OptionalKeyVals:wa@person {}','', +afterDigest=>sub { + my ($stomach,$whatsit)=@_; + my $keys=$whatsit->getArg(1); + my $name=ToString($whatsit->getArg(2)); + $keys->setValue('name',$name); + ExportMetadata($keys); + return; +});#$ +DefKeyVal('wa@institution','id','Semiverbatim'); +DefKeyVal('wa@institution','url','Semiverbatim'); +DefKeyVal('wa@institution','partof','Semiverbatim'); +DefConstructor('\WAinstitution OptionalKeyVals:wa@institution {}','', +afterDigest=>sub { + my ($stomach,$whatsit)=@_; + my $keys=$whatsit->getArg(1); + my $name=ToString($whatsit->getArg(2)); + $keys->setValue('name',$name); + ExportMetadata($keys); + return; +});#$ +1; |