From a62e1d4e096be4d689f337c35488333116c5e3e4 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 20 May 2008 17:50:33 +0000 Subject: new package stex (10may08) git-svn-id: svn://tug.org/texlive/trunk@8255 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/stex/cmathml.sty | 450 ++++++++++ Master/texmf-dist/tex/latex/stex/cmathml.sty.ltxml | 974 +++++++++++++++++++++ Master/texmf-dist/tex/latex/stex/cmathmlx.sty | 14 + .../texmf-dist/tex/latex/stex/cmathmlx.sty.ltxml | 22 + Master/texmf-dist/tex/latex/stex/cnx.cls | 141 +++ Master/texmf-dist/tex/latex/stex/cnx.cls.ltxml | 281 ++++++ Master/texmf-dist/tex/latex/stex/modules.sty | 145 +++ Master/texmf-dist/tex/latex/stex/modules.sty.ltxml | 246 ++++++ Master/texmf-dist/tex/latex/stex/omdoc.cls | 15 + Master/texmf-dist/tex/latex/stex/omdoc.cls.ltxml | 22 + Master/texmf-dist/tex/latex/stex/omdoc.sty | 83 ++ Master/texmf-dist/tex/latex/stex/omdoc.sty.ltxml | 230 +++++ Master/texmf-dist/tex/latex/stex/presentation.sty | 125 +++ .../tex/latex/stex/presentation.sty.ltxml | 197 +++++ Master/texmf-dist/tex/latex/stex/sproof.sty | 112 +++ Master/texmf-dist/tex/latex/stex/sproof.sty.ltxml | 107 +++ Master/texmf-dist/tex/latex/stex/statements.sty | 85 ++ .../texmf-dist/tex/latex/stex/statements.sty.ltxml | 142 +++ Master/texmf-dist/tex/latex/stex/stex.sty | 20 + 19 files changed, 3411 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/stex/cmathml.sty create mode 100644 Master/texmf-dist/tex/latex/stex/cmathml.sty.ltxml create mode 100644 Master/texmf-dist/tex/latex/stex/cmathmlx.sty create mode 100644 Master/texmf-dist/tex/latex/stex/cmathmlx.sty.ltxml create mode 100644 Master/texmf-dist/tex/latex/stex/cnx.cls create mode 100644 Master/texmf-dist/tex/latex/stex/cnx.cls.ltxml create mode 100644 Master/texmf-dist/tex/latex/stex/modules.sty create mode 100644 Master/texmf-dist/tex/latex/stex/modules.sty.ltxml create mode 100644 Master/texmf-dist/tex/latex/stex/omdoc.cls create mode 100644 Master/texmf-dist/tex/latex/stex/omdoc.cls.ltxml create mode 100644 Master/texmf-dist/tex/latex/stex/omdoc.sty create mode 100644 Master/texmf-dist/tex/latex/stex/omdoc.sty.ltxml create mode 100644 Master/texmf-dist/tex/latex/stex/presentation.sty create mode 100644 Master/texmf-dist/tex/latex/stex/presentation.sty.ltxml create mode 100644 Master/texmf-dist/tex/latex/stex/sproof.sty create mode 100644 Master/texmf-dist/tex/latex/stex/sproof.sty.ltxml create mode 100644 Master/texmf-dist/tex/latex/stex/statements.sty create mode 100644 Master/texmf-dist/tex/latex/stex/statements.sty.ltxml create mode 100644 Master/texmf-dist/tex/latex/stex/stex.sty (limited to 'Master/texmf-dist/tex/latex/stex') diff --git a/Master/texmf-dist/tex/latex/stex/cmathml.sty b/Master/texmf-dist/tex/latex/stex/cmathml.sty new file mode 100644 index 00000000000..90b215dd2ab --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/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.sty.ltxml b/Master/texmf-dist/tex/latex/stex/cmathml.sty.ltxml new file mode 100644 index 00000000000..a6ce629f220 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/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 [] {} {}', + "#2 #3"); +DefConstructor('\Ccn [] {}',"#2"); +DefConstructor('\Cci [] {}',"#2"); +DefConstructor('\Ccsymbol [] {}', + ""); +DefConstructor('\Cccinterval [] {}{}', + "" + . "" + . "#2" + . "#3"); +DefConstructor('\Ccointerval [] {}{}', + "" + . "" + . "#2" + . "#3"); +DefConstructor('\Cocinterval [] {}{}', + "" + . "" + . "#2" + . "#3"); +DefConstructor('\Coointerval [] {}{}', + "" + . "" + . "#2" + . "#3"); +DefConstructor('\Cinverse [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Clambda [] {}{}', + "" + . "" + . "#2" + . "#2" + . ""); +DefConstructor('\ClambdaDA [] {}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . ""); +DefConstructor('\Crestrict [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CcomposeOp []', + ""); +DefConstructor('\Ccompose [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\Cident []', + ""); +DefConstructor('\Cdomain [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Ccodomain [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cimage [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cpiecewise [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cpiece [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\Cotherwise [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cquotient [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CfactorialOp []', + ""); +DefConstructor('\Cfactorial [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\CdivideOp []', + ""); +DefConstructor('\Cdivide [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CmaxOp []', + ""); +DefConstructor('\Cmax [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\CminOp []', + ""); +DefConstructor('\Cmin [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\CminusOp []', + ""); +DefConstructor('\Cminus [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\Cuminus [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\CplusOp []', + ""); +DefConstructor('\Cplus [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\Cpower [] {} {}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CremOp []', + ""); +DefConstructor('\Crem [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CtimesOp []', + ""); +DefConstructor('\Ctimes [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CrootOp []', + ""); +DefConstructor('\Croot [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\Cgcd [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\CandOp []', + ""); +DefConstructor('\Cand [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CorOp []', + ""); +DefConstructor('\Cor [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CxorOp []', + ""); +DefConstructor('\Cxor [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CnotOp []', + ""); +DefConstructor('\Cnot [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\CimpliesOp []', + ""); +DefConstructor('\Cimplies [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CAndDa [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CAndCond [] {}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . ""); +DefConstructor('\COrDa [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\COrCond [] {}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . ""); +DefConstructor('\CXorDa [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CXorCond [] {}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . ""); +DefConstructor('\Cforall [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CforallCond [] {}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . ""); +DefConstructor('\Cexists [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CexistsCond [] {}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . ""); +DefConstructor('\Cabs [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cconjugate [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Carg [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Creal [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cimaginary [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Clcm [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cfloor [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cceiling [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\CeqOp []', + ""); +DefConstructor('\Ceq [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CneqOp []', + ""); +DefConstructor('\Cneq [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CgtOp []', + ""); +DefConstructor('\Cgt [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CltOp []', + ""); +DefConstructor('\Clt [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CgeqOp []', + ""); +DefConstructor('\Cgeq [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CleqOp []', + ""); +DefConstructor('\Cleq [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CequivalentOp []', + ""); +DefConstructor('\Cequivalent [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\CapproxOp []', + ""); +DefConstructor('\Capprox [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CfactorofOp []', + ""); +DefConstructor('\Cfactorof [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CintOp []', + ""); +DefConstructor('\Cint [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\CintLimits [] {}{}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . "#5" + . ""); +DefConstructor('\CintDA [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CintCond [] {}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . ""); +DefConstructor('\Cdiff [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cddiff [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\Cpartialdiff [] {}{}{}', + "" + . "" + . "#3" + . "?#2(#2)()" + . "#4" + . ""); +DefConstructor('\Cdegree {}{}', + "" + . "" + . "#2" + . "#1" + . ""); +DefConstructor('\Climit [] {}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . ""); +DefConstructor('\ClimitCond [] {}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . ""); +DefConstructor('\CtendstoOp []', + ""); +DefConstructor('\Ctendsto [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CtendstoAboveOp []', + ""); +DefConstructor('\CtendstoAbove [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CtendstoBelowOp []', + ""); +DefConstructor('\CtendstoBelow [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\Cdivergence [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cgrad [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Curl [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Claplacian [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cset [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CsetRes [] {}{}', + "" + . "" + . "#2" + . "#3" + . "#2" + . ""); +DefConstructor('\CsetCond [] {}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . ""); +DefConstructor('\CsetDA [] {}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . ""); +DefConstructor('\ClistOp []', + ""); +DefConstructor('\Clist [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CunionOp []', + ""); +DefConstructor('\Cunion [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CintersectOp []', + ""); +DefConstructor('\Cintersect [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CinOp []', + ""); +DefConstructor('\Cin [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CnotinOp []', + ""); +DefConstructor('\Cnotin [] {}{}', + "" + . "" + . "#2" + . ""); +DefConstructor('\CsubsetOp []', + ""); +DefConstructor('\Csubset [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CprsubsetOp []', + ""); +DefConstructor('\Cprsubset [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CnotsubsetOp []', + ""); +DefConstructor('\Cnotsubset [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CnotprsubsetOp []', + ""); +DefConstructor('\Cnotprsubset [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CsetdiffOp []', + ""); +DefConstructor('\Csetdiff [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CcardOp []', + ""); +DefConstructor('\Ccard [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\CcartesianproductOp []', + ""); +DefConstructor('\Ccartesianproduct [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\CsupsetOp []', + ""); +DefConstructor('\CprsupsetOp []', + ""); +DefConstructor('\CnotsupsetOp []', + ""); +DefConstructor('\CnotprsupsetOp []', + ""); +DefMacro('\Csupset[]{}','\Csubset[#1]{#2}'); +DefMacro('\Cprsupset[]{}','\Cprsubset[#1]{#2}'); +DefMacro('\Cnotsupset[]{}{}','\Cnotsubset[#1]{#3}{#2}'); +DefMacro('\Cnotprsupset[]{}{}','\Cnotprsubset[#1]{#3}{#2}'); +DefConstructor('\CUnionDAOp []', + ""); +DefConstructor('\CUnionDA [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CUnionCond [] {}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . ""); +DefConstructor('\CIntersectDaOp []', + ""); +DefConstructor('\CIntersectDa [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CIntersectCond [] {}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . ""); +DefConstructor('\CCartesianproductDaOp []', + ""); +DefConstructor('\CCartesianproductDa [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CCartesianproductCond [] {}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . ""); +DefConstructor('\CsumOp []', + ""); +DefConstructor('\CsumLimits [] {}{}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . "#5"); +DefConstructor('\CprodOp []', + ""); +DefConstructor('\CprodLimits [] {}{}{}{}', + "" + . "" + . "#2" + . "#3" + . "#4" + . "#5"); +DefConstructor('\Csin [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Ccos [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Ctan [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Csec [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Ccsc [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Ccot [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Csinh [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Ccosh [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Ctanh [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Csech [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Ccsch [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Ccoth [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Carcsin [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Carccos [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Carctan [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Carcsec [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Carccsc [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Carccot [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Carcsinh [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Carccosh [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Carctanh [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Carcsech [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Carccsch [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Carccoth [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cexp [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cln [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Clog [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\Cmean [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Csdev [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cvar [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cmedian [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cmode [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cmoment [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cvector [] {}', + "" + . "" + . "#2" + . "", + afterDigest=>sub { remove_math_commas($_[1], 2); }); +DefConstructor('\Cmatrix [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\Cdeterminant [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Ctranspose [] {}', + "" + . "" + . "#2" + . ""); +DefConstructor('\Cselector [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CvectorproductOp []', + ""); +DefConstructor('\Cvectorproduct [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\Cscalarproduct [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\CouterproductOp []', + ""); +DefConstructor('\Couterproduct [] {}{}', + "" + . "" + . "#2" + . "#3" + . ""); +DefConstructor('\Cintegers []', + ""); +DefConstructor('\Creals []', + ""); +DefConstructor('\Crationals []', + ""); +DefConstructor('\Cnaturalnumbers []', + ""); +DefConstructor('\Ccomplexes []', + ""); +DefConstructor('\Cprimes []', + ""); +DefConstructor('\Cexponentiale []', + ""); +DefConstructor('\Cimaginaryi []', + ""); +DefConstructor('\Cnotanumber []', + ""); +DefConstructor('\Ctrue []', + ""); +DefConstructor('\Cfalse []', + ""); +DefConstructor('\Cemptyset []', + ""); +DefConstructor('\Cpi []', + ""); +DefConstructor('\Ceulergamma []', + ""); +DefConstructor('\Cinfinit []', + ""); +1; diff --git a/Master/texmf-dist/tex/latex/stex/cmathmlx.sty b/Master/texmf-dist/tex/latex/stex/cmathmlx.sty new file mode 100644 index 00000000000..dd9f04945f4 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/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/cmathmlx.sty.ltxml b/Master/texmf-dist/tex/latex/stex/cmathmlx.sty.ltxml new file mode 100644 index 00000000000..93025278369 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/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 [] {}', + "" + . "" + . "#2" + . ""); +\endinput +%% +%% End of file `cmathmlx.sty.ltxml'. diff --git a/Master/texmf-dist/tex/latex/stex/cnx.cls b/Master/texmf-dist/tex/latex/stex/cnx.cls new file mode 100644 index 00000000000..ca898bce841 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/cnx.cls @@ -0,0 +1,141 @@ +%% +%% This is file `cnx.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% cnx.dtx (with options: `cls') +%% +\RequirePackage{keyval} +\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} +\define@key{cnxmodule}{name}{\def\cnx@title{#1}} +\define@key{cnxmodule}{id}{} +\newenvironment{cnxmodule}[1][]{\setkeys{cnxmodule}{#1}}{} +\newenvironment{ccontent}{}{} +\newcounter{section} +\define@key{sectioning}{id}{} +\newenvironment{csection}[2][]% +{\stepcounter{section}\strut\\[1.5ex]\noindent% +{\Large\bfseries\arabic{section}.~{#2}}\\[1.5ex] +\setkeys{sectioning}{#1}} +{} +\newcounter{subsection}[section] +\newenvironment{csubsection}[2][] +{\refstepcounter{subsection}\strut\\[1ex]\noindent% +{\large\bfseries{\arabic{section}.\arabic{subsection}.~#2\\[1ex]}}% +\setkeys{sectioning}{#1}}% +{} +\newcounter{subsubsection}[subsection] +\newenvironment{csubsubsection}[2][] +{\refstepcounter{subsubsection}\strut\\[.5ex]\noindent +{\bfseries\arabic{section}.\arabic{subsection}.\arabic{subsubsecction}~#2\\[.5ex]}% +\setkeys{sectioning}{#1}}{} +\define@key{para}{id}{} +\newenvironment{cpara}[1][]{\setkeys{para}{#1}}{\par} +\define@key{note}{id}{} +\define@key{note}{type}{\def\note@type{#1}} +\newenvironment{cnote}[1][]% +{\setkeys{note}{#1}\par\noindent\strut\hfill\begin{minipage}{10cm}{\bfseries\note@type}:~}% +{\end{minipage}\hfill\strut\par} +\define@key{equation}{id}{} +\newenvironment{cequation}[1][]% +{\setkeys{equation}{#1}\begin{displaymath}} +{\end{displaymath}} +\define@key{cquote}{id}{} +\define@key{cquote}{type}{} +\define@key{cquote}{src}{} +\newenvironment{cquote}[1][]{% +\setkeys{cquote}{#1}\begin{center}\begin{minipage}{.8\textwidth}}{\end{minipage}\end{center}} +\newcommand{\litem}[2][]{\item[#1]\label{#2}} +\define@key{example}{id}{} +\define@key{example}{name}{\def\example@name{#1}} +\newenvironment{cexample}[1][]{\setkeys{example}{#1} +{\@ifundefined{example@name}{}{\noindent\bfseries{\example@name}}}} +{} +\newcounter{cexercise} +\define@key{cexercise}{id}{} +\define@key{cexercise}{name}{\def\cexercise@name{#1}} +\newenvironment{cexercise}[1][]{\setkeys{cexercise}{#1} +{\@ifundefined{cexercise@name}{}{\stepcounter{cexercise}\noindent\bfseries{\cexercise@name~\arabic{cexercise}}}}} +{} +\define@key{cproblem}{id}{} +\newenvironment{cproblem}[1][]{\setkeys{cproblem}{#1}}{}{} +\define@key{csolution}{id}{} +\newenvironment{csolution}[1][]{\setkeys{csolution}{#1}}{\par\noindent\bfseries{Solution}}{} +\define@key{rule}{id}{} +\define@key{rule}{name}{\def\rule@name{#1}} +\define@key{rule}{type}{\def\rule@type{#1}} +\newenvironment{crule}[1][]{\setkeys{rule}{#1}% +{\noindent\bfseries{\rule@type:}\@ifundefined{rule@name}{}{~(\rule@name)}}}% +{} +\define@key{statement}{id}{} +\newenvironment{statement}[1][]{\setkeys{statement}{#1}}{} +\define@key{proof}{id}{} +\newenvironment{proof}[1][]{\setkeys{proof}{#1}}{} +\define@key{definition}{term}{} +\define@key{definition}{id}{} +\define@key{definition}{seealso}{} +\newenvironment{definition}[1][]{\setkeys{definition}{#1}{\noindent\bfseries{Definition:}}}{} +\define@key{meaning}{id}{} +\newenvironment{cmeaning}[1][]{\setkeys{meaning}{#1}}{} +\define@key{cnxn}{document}{\def\cnxn@doc{#1}} +\define@key{cnxn}{target}{\def\cnxn@target{#1}} +\define@key{cnxn}{strength}{} +\newcommand{\cnxn}[2][]% keys, link text +{\setkeys{cnxn}{#1}{\underline{#2}}\footnote{{\ttfamily\@ifundefined{cnxn@doc}{\cnxn@doc}{}\#\cnxn@target}}} +\newcommand\@makefntext[1]{\parindent 1em\noindent\hb@xt@1.8em{\hss\@makefnmark}#1} +\define@key{link}{src}{} +\newcommand{\link}[2][]{\setkeys{link}{#1}\underline{#2}} +\define@key{cfigure}{id}{\def\cf@id{#1}} +\define@key{cfigure}{type}{} +\define@key{cfigure}{caption}{\def\cf@caption{#1}} +\newcounter{figure} +\newcommand{\cfigure}[3][]{% cnx_keys, graphicx_keys, path +\begin{center}% +\includegraphics[#2]{#3}% +\setkeys{cfigure}{#1}% +\@ifundefined{cfigure@caption}{}{{\par\noindent Figure\refstepcounter{figure}} {\arabic{figure}}: \cf@caption% +\protected@edef\@currentlabel{\arabic{figure}}% +\@ifundefined{cf@id}{}{\label{\cf@id}}}% +\end{center}} +\define@key{ccite}{src}{} +\newcommand{\ccite}[2][]{\setkeys{ccite}{#1}\emph{#2}} +\newcommand{\term}[1]{{\bfseries\underline{#1}}} +\define@key{metadata}{version}{} +\define@key{metadata}{created}{} +\define@key{metadata}{revised}{} +\newsavebox{\metadatabox} +\newenvironment{metadata}[1][]% +{\noindent\hfill\begin{lrbox}{\metadatabox} +\begin{minipage}{.8\textwidth}% +{\Large\bfseries CNX Module: \cnx@title\hfill\strut}\\[2ex]}% +{\end{minipage}\end{lrbox}\fbox{\usebox\metadatabox}\hfill} +\newenvironment{authorlist}{{\bfseries{Authors}:~}}{\\[1ex]} +\newenvironment{maintainerlist}{{\bfseries{Maintainers}:~}}{\\[1ex]} +\define@key{auth}{id}{} +\define@key{auth}{honorific}{\def\auth@honorific{#1}} +\define@key{auth}{firstname}{\def\auth@first{#1}} +\define@key{auth}{other}{\def\auth@other{#1}} +\define@key{auth}{surname}{\def\auth@sur{#1}} +\define@key{auth}{lineage}{\def\auth@line{#1}} +\define@key{auth}{email}{} +\newcommand{\cnxauthor}[1][]{\setkeys{auth}{#1}\auth@first~\auth@sur,} +\newcommand{\maintainer}[1][]{\setkeys{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.cls.ltxml b/Master/texmf-dist/tex/latex/stex/cnx.cls.ltxml new file mode 100644 index 00000000000..d29f6776607 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/cnx.cls.ltxml @@ -0,0 +1,281 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +RequirePackage('keyval'); +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}','#body', + beforeDigest=> sub { AssignValue(inPreamble=>0); }, + afterDigest=> sub { $_[0]->getGullet->flush; return; }); +DefEnvironment('{cnxmodule} OptionalKeyVals:cnxmodule', + "&KeyVal('#1','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}',"#body"); +DefKeyVal('sectioning','id','Semiverbatim'); +DefEnvironment('{csection}OptionalKeyVals:sectioning{}', + "\n" + . "?#2(#2\n)()" + . "#body\n\n"); +DefEnvironment('{csubsection}OptionalKeyVals:sectioning{}', + "\n" + . "?#2(#2\n)()" + . "#body\n\n"); +DefEnvironment('{csubsubsection}OptionalKeyVals:sectioning{}', + "\n" + . "?#2(#2\n)()" + . "#body\n\n"); +DefKeyVal('para','id','Semiverbatim'); +DefEnvironment('{cpara} OptionalKeyVals:para','#body'); +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','#body'); +DefKeyVal('equation','id','Semiverbatim'); +DefEnvironment('{cequation} OptionalKeyVals:equation', + "" + . "" + . "#body" + . "", + mode=>'display_math'); +DefKeyVal('cquote','id','Semiverbatim'); +DefKeyVal('cquote','type','Semiverbatim'); +DefKeyVal('cquote','src','Semiverbatim'); +DefEnvironment('{cquote} OptionalKeyVals:cquote', + "#body"); +DefConstructor('\footnote[]{}',"#2"); +DefConstructor('\emph{}',"#1"); +DefConstructor('\[', + "" + . "" + . "" + . "#body" + . "" + . "" + ."", + beforeDigest=> sub{ $_[0]->beginMode('display_math'); }, + captureBody=>1, + properties=> sub { RefStepID('equation') }); +DefConstructor('\]' ,"",beforeDigest=> sub{ $_[0]->endMode('display_math'); }); +DefConstructor('\[', + "" + . "" + . "" + . "#body" + . "" + . "" + ."", + 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[]',"?#1(#1)"); +DefConstructor('\litem[]{}',"?#1(#1)"); +DefConstructor('\itemize@item[]', + "?#1(#1)", + properties=>sub{ RefStepItemCounter(); }); +DefConstructor('\enumerate@item[]', + "?#1(#1)", + properties=>sub{ RefStepItemCounter(); }); +DefConstructor('\description@item[]', + "?#1(#1)", + properties=>sub{ RefStepItemCounter(); }); +AssignValue(itemlevel=>0); +DefEnvironment('{itemize}', + "#body", + properties=>sub { beginItemize('itemize'); }); +DefEnvironment('{enumerate}', + "#body", + properties=>sub { beginItemize('enumerate'); }); +DefEnvironment('{description}', + "#body", + 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', "&LookupValue('LABEL@#1')"); +DefKeyVal('example','id','Semiverbatim'); +DefEnvironment('{cexample}OptionalKeyVals:example', + "#body"); +DefKeyVal('cexercise','id','Semiverbatim'); +DefKeyVal('cexercise','name','Semiverbatim'); +DefEnvironment('{cexercise}OptionalKeyVals:exercise', + "" + . "#body" + . ""); +DefKeyVal('cproblem','id','Semiverbatim'); +DefKeyVal('cproblem','name','Semiverbatim'); +DefEnvironment('{cproblem}OptionalKeyVals:cproblem', + "" + . "?&KeyVal(#1,'name')(&KeyVal(#1,'name')\n)()" + . "#body" + . ""); +DefKeyVal('csolution','id','Semiverbatim'); +DefKeyVal('csolution','name','Semiverbatim'); +DefEnvironment('{csolution}OptionalKeyVals:cproblem', + "" + . "?&KeyVal(#1,'name')(&KeyVal(#1,'name')\n)()" + . "#body" + . ""); +DefKeyVal('rule','id','Semiverbatim'); +DefKeyVal('rule','name','Semiverbatim'); +DefKeyVal('rule','type','Semiverbatim'); +DefEnvironment('{crule}OptionalKeyVals:rule', + "\n" + . "?&KeyVal(#1,'name')(&KeyVal(#1,'name')\n)()" + . "\n#body\n" + . "\n"); +DefKeyVal('statement','id','Semiverbatim'); +DefEnvironment('{statement}OptionalKeyVals:statement','#body'); +DefKeyVal('proof','id','Semiverbatim'); +DefEnvironment('{proof}OptionalKeyVals:proof','#body'); +DefKeyVal('definition','id','Semiverbatim'); +DefKeyVal('definition','term','Semiverbatim'); +DefKeyVal('definition','seealso','Semiverbatim'); +DefEnvironment('{definition}OptionalKeyVals:definition', + "\n" + . "?&KeyVal(#1,'term')(&KeyVal(#1,'term')\n)()" + . "\n#body\n" + . "?&KeyVal(#1,'seealso')(&KeyVal(#1,'term')\n)()" + . "\n"); +DefKeyVal('meaning','id','Semiverbatim'); +DefEnvironment('{cmeaning}OptionalKeyVals:meaning','#body'); +DefKeyVal('cnxn','document','Semiverbatim'); +DefKeyVal('cnxn','target','Semiverbatim'); +DefKeyVal('cnxn','strength','Semiverbatim'); +DefConstructor('\cnxn OptionalKeyVals:cnxn {}','#1'); +DefKeyVal('link','src','Semiverbatim'); +DefConstructor('\link OptionalKeyVals:link {}','#2'); +DefKeyVal('cfigure','id','Semiverbatim'); +DefKeyVal('cfigure','name','Semiverbatim'); +DefKeyVal('cfigure','type','Semiverbatim'); +DefKeyVal('cfigure','caption','Semiverbatim'); +DefConstructor('\cfigure OptionalKeyVals:cfigure Semiverbatim Semiverbatim', + "" + . "?&KeyVal(#1,'name')(&KeyVal(#1,'name')\n)()" + . "" + . "?&KeyVal(#1,'caption')(&KeyVal(#1,'caption')\n)()" + . ""); +DefKeyVal('ccite','src','Semiverbatim'); +DefConstructor('\ccite OptionalKeyVals:ccite {}','#2'); +DefConstructor('\term[]{}',"#2"); +DefKeyVal('metadata','version','Semiverbatim'); +DefKeyVal('metadata','created','Semiverbatim'); +DefKeyVal('metadata','revised','Semiverbatim'); +DefEnvironment('{metadata}OptionalKeyVals:metadata', + "\n" + . "&KeyVal('#1','version')\n" + . "&KeyVal('#1','created')\n" + . "&KeyVal('#1','revised')\n" + . "#body\n" + . ""); +DefEnvironment('{authorlist}',"#body"); +DefEnvironment('{maintainerlist}',"#body"); +DefKeyVal('auth','id','Semiverbatim'); +DefKeyVal('auth','firstname','Semiverbatim'); +DefKeyVal('auth','surname','Semiverbatim'); +DefKeyVal('auth','email','Semiverbatim'); +DefConstructor('\cnxauthor OptionalKeyVals:auth', + "\n" + . "?&KeyVal(#1,'honorific')(&KeyVal('#1','honorific')\n)()" + . "?&KeyVal(#1,'firstname')(&KeyVal('#1','firstname')\n)()" + . "?&KeyVal(#1,'other')(&KeyVal('#1','other')\n)()" + . "?&KeyVal(#1,'surname')(&KeyVal('#1','surname')\n)()" + . "?&KeyVal(#1,'lineage')(&KeyVal('#1','lineage')\n)()" + . "?&KeyVal(#1,'email')(&KeyVal('#1','email')\n)()" + . "\n"); +DefConstructor('\maintainer OptionalKeyVals:auth', + "\n" + . "?&KeyVal(#1,'honorific')(&KeyVal('#1','honorific')\n)()" + . "?&KeyVal(#1,'firstname')(&KeyVal('#1','firstname')\n)()" + . "?&KeyVal(#1,'other')(&KeyVal('#1','other')\n)()" + . "?&KeyVal(#1,'surname')(&KeyVal('#1','surname')\n)()" + . "?&KeyVal(#1,'lineage')(&KeyVal('#1','lineage')\n)()" + . "?&KeyVal(#1,'email')(&KeyVal('#1','email')\n)()" + . "\n"); +DefEnvironment('{keywordlist}',"\n#body\n"); +DefConstructor('\keyword {}',"#1"); +DefEnvironment('{cnxabstract} OptionalKeyVals:cnxabstract', + "\n#body\n\n"); +1; diff --git a/Master/texmf-dist/tex/latex/stex/modules.sty b/Master/texmf-dist/tex/latex/stex/modules.sty new file mode 100644 index 00000000000..49ce55bc45c --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/modules.sty @@ -0,0 +1,145 @@ +%% +%% 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}[2006/01/13 v0.9a Semantic Markup] + +\newif\ifmod@env\mod@envfalse +\newif\ifmod@id\mod@idfalse +\newif\ifmod@display\mod@displayfalse +\newif\ifmod@uses\mod@usesfalse +\newif\ifmod@usesqualified\mod@usesqualifiedfalse +\DeclareOption{env}{\mod@envtrue} +\DeclareOption{id}{\mod@idtrue} +\DeclareOption{uses}{\mod@usestrue} +\DeclareOption{display}{\mod@displaytrue} +\DeclareOption{usesqualified}{\mod@usesqualifiedtrue} +\def\modtrue{\mod@idtrue\mod@usestrue\mod@displaytrue\mod@usesqualifiedtrue} +\DeclareOption{draft}{\modtrue} +\DeclareOption{all}{\modtrue} +\ProcessOptions +\RequirePackage{keyval}[1997/11/10] +\define@key{module}{cd}{} +\define@key{module}{id}{% + \edef\this@module{\expandafter\noexpand\csname module@defs@#1\endcsname}% + \edef\this@qualified@module{\expandafter\noexpand\csname module@defs@qualified@#1\endcsname}% + \global\@namedef{module@defs@#1}{} + \global\@namedef{module@defs@qualified@#1}{} + \def\mod@id{#1}} +\newenvironment{module}[1][]{\setkeys{module}{#1}\ifmod@env\show@mod@keys{module}\fi}{} +\def\show@mod@keys@aux{% +\@ifundefined{mod@id}{}{\ifmod@id{id=\mod@id},\fi}% +\@ifundefined{mod@display}{}{\ifmod@display{display=\mod@display}\fi} +\@ifundefined{mod@uses}{\relax}{\ifmod@uses{uses=\mod@uses},\fi} +\@ifundefined{mod@usesqualified}\relax\else + \ifmod@usesqualified{usesqualified=\mod@usesqualified},\fi\fi} +\def\clear@mod@keys{\let\mod@usesqualified=\relax\mod@uses=\relax + \let\st@id=\relax\let\st@display=\relax} +\def\show@mod@keys#1{\footnote{#1[\show@mod@keys@aux]}\clear@mod@keys} +\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}}} +\newcommand{\importmodule}[2][]{\def\@test{#1}% +\ifx\@test\@empty\else\requiremodules{#1}\fi +\activate@defs{#2}\export@defs{#2}} +\define@key{symdef}{aliases}{} +\define@key{symdef}{local}[true]{\@symdeflocaltrue} +\define@key{symdef}{cmml}{} +\define@key{symdef}{cattrs}{} +\define@key{symdef}{definitionURL}{} +\newif\if@symdeflocal +\def\symdef{\@ifnextchar[{\@symdef}{\@symdef[]}} +\def\@symdef[#1]#2{\@ifnextchar[{\@@symdef[#1]{#2}}{\@@symdef[#1]{#2}[0]}} +\def\@@symdef[#1]#2[#3]#4{% +\@symdeflocalfalse\setkeys{symdef}{#1} + \expandafter\providecommand\csname modules@#2@pres\endcsname[#3]{#4} + \expandafter\def\csname#2\endcsname{\csname modules@#2@pres\endcsname} + \if@symdeflocal\else + \@ifundefined{mod@id}{}{ + \expandafter\g@addto@macro\this@module{\expandafter\providecommand\csname modules@#2@pres\endcsname[#3]{#4}}% + \expandafter\g@addto@macro\this@module{\expandafter\def\csname#2\endcsname{\csname modules@#2@pres\endcsname}} + \expandafter\g@addto@macro\this@qualified@module{\expandafter\providecommand\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} +\def\redefine#1[#2]#3{\expandafter\renewcommand\csname modules@#1@pres\endcsname[#2]{#3}} +\let\abbrdef\symdef +\def\mod@simplify#1{\expandafter\mod@simpl#1/\relax} +\def\mod@simpl#1/#2\relax{%\message{ 1 = #1, 2 = #2 }% +\def\mod@test{}\ifx\mod@blaaaa\mod@test\edef\mod@savedprefix{}\def\mod@blaaaa{aaa}\else\fi +\def\mod@comp{#2}\ifx\mod@test\mod@comp\edef\mod@savedprefix{\mod@savedprefix#1}% +\else\mod@simplhelp#1/#2\relax\fi} +\def\mod@simplhelp#1/#2/#3\relax{% +\def\mod@test{}\def\mod@tust{#2}\def\mod@tist{#3}\def\mod@tost{..}\ifx\mod@test\mod@tist% +\ifx\mod@tost\mod@tust\edef\mod@savedprefix{}\else\edef\mod@savedprefix +{\mod@savedprefix#1/#2}\fi \else\ifx\mod@tost\mod@tust\mod@simpl#3\relax% +\else\edef\mod@savedprefix{\mod@savedprefix#1/}\mod@simplhelp#2/#3\relax\fi\fi}% +\newif\ifmodules +\gdef\reg{} +\def\mod@update#1{\def\mod@empty{} +\ifx\reg\mod@empty\xdef\reg{#1}\else\xdef\reg{#1@\reg}\fi} +\def\mod@check#1@#2///#3\relax{% +\def\mod@empty{}\def\mod@one{#1}\def\mod@two{#2}\def\mod@three{#3}% +\expandafter\ifx\mod@three\mod@one\modulestrue\else\ifx\mod@two\mod@empty\modulesfalse% +\else\mod@check#2///#3\relax\fi\fi} +\def\mod@search#1{% +\modulesfalse\expandafter\mod@check\reg @///#1\relax% +\ifmodules\else\mod@update{#1}\fi} +\def\mod@reguse#1{\modulesfalse\expandafter\mod@check\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@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\reg % use to compare, in case the .sms file was loaded before +\mod@search{\mod@savedprefix} % update registry +\ifx\newreg\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\reg % use to compare, in case the .sms file was loaded before +\mod@search{\mod@savedprefix} % update registry +\ifx\newreg\reg%\message{This file has been previously introduced} +\else\input{\mod@savedprefix}\fi}} +\def\requirepackage#1#2{\makeatletter\input{#1.sty}\makeatother} +\endinput +%% +%% End of file `modules.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/modules.sty.ltxml b/Master/texmf-dist/tex/latex/stex/modules.sty.ltxml new file mode 100644 index 00000000000..4d1313374a4 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/modules.sty.ltxml @@ -0,0 +1,246 @@ + +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Global; +use LaTeXML::Package; +RequirePackage('keyval'); +DefKeyVal('Module','cd','Semiverbatim'); +DefKeyVal('Module','id','Semiverbatim'); +DefEnvironment('{module} OptionalKeyVals:Module', + "?#excluded()( #body)", +#closed bracket ) seems to work fine now + +#commented this out - do we need current_theory? +#plus: keyvals->getValue seems to be undefined?! + + #beforeConstruct=> sub { + #my ($doc, $keyvals, %props) = @_; + #my $theory = $keyvals->getValue('id') if $keyvals; + #$theory = ref $theory ? $theory->toString : 'UNDEFINED'; + #AssignValue(current_theory => $theory); + #return;}, +# $Doc->openElement('omdoc:theory', 'xml:id' => $theory); +# my $uses = $keyvals->getValue('usses'); +# $uses = ref $uses ? $uses->toString || '' : ''; +# $uses =~ s/\s+//g; $uses=~ s/^\{//; $uses=~ s/\}$//; +# my $module_paths = LookupValue('module_paths') || {}; +# foreach my $used(split(',',$uses)) { +# my $file = $module_paths->{$used}; $file .= '.omdoc#' if $file; +# $doc->openElement('omdoc:imports', 'from' => $file.$used); +# $doc->closeElement('omdoc:imports'); } +# $doc->absorb($props{body}) if $props{body}; +# $doc->closeElement('omdoc:theory'); } +# return; }, + 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)); + $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; +# my @uses = (); +# if($uses){ +# $uses =~ s/\s//g; $uses=~ s/^\{//; $uses=~ s/\}$//; +# @uses = split(',',$uses); } +############### AssignValue("module_${id}_uses" => [@uses], 'global'); +#Idea: introdcue global list of used modules and activateScope on it once at the +# main block. + #use_module($id); #22.02.08 need to ALWAYS invoke this to make things global + + #activate the module in our current scope + $STATE->activateScope("module:".$id); #changed from use_module as only needs to take care of current module + return; }); +sub use_module { + my($module)=@_; + $module = ToString($module); + # Depth-first load definitions from used modules + foreach my $used_module (@{ LookupValue("module_${module}_uses") || []}){ + use_module($used_module); } + # then load definitions for this module + $STATE->activateScope("module:$module"); } +DefConstructor('\importmodule[]{}',"", + afterDigest=>sub { + my($stomach,$whatsit)=@_; + my $file = $whatsit->getArg(1); + my $module = $whatsit->getArg(2); + $module = ToString($module); + #if filepath is not supply simply look for the $module.sms file + if (!$file) {$file=ToString($module)}; + my $containing_module = LookupValue('current_module'); + #set the relation between the current module and the one to be imported + PushValue("module_".$containing_module."_uses"=>$module); + #check if we've already loaded this module + if(LookupValue('module_'.$module.'_loaded')) {use_module($module);} #if so activate it! + else { + #if not: + my $gullet = $stomach->getGullet; + #1) mark as loaded + AssignValue('module_'.$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'), T_OTHER($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;}); +DefKeyVal('symdef','aliases','Semiverbatim'); +DefKeyVal('symdef','local','Semiverbatim','true'); +DefKeyVal('symdef','cmml','Semiverbatim','true'); +DefKeyVal('symdef','cattrs','Semiverbatim','true'); +DefKeyVal('symdef','definitionURL','Semiverbatim','true'); +DefMacro('\symdef OptionalKeyVals:symdef {}[][]{}', + sub { +my($self,@args)=@_; +# print STDERR "excluding" if LookupValue('excluding_modules'); +((Invocation(T_CS('\@symdef'),@args)->unlist), + (LookupValue('excluding_modules') ? () + : (Invocation(T_CS('\@symdef@pres'), @args)->unlist))); +}); + +DefPrimitive('\@symdef OptionalKeyVals:symdef {}[][]{}', sub { + my($stomach,$keys,$cs,$nargs,$opt,$presentation)=@_; + my($name,$cd,$role,$cmml,$cattrs,$definitionURL)=$keys + && map($_ && $_->toString,map($keys->getValue($_), qw(name cd role cmml cattrs definitionURL))); + $cd = LookupValue('module_cd') unless $cd; + $nargs = (ref $nargs ? $nargs->toString : $nargs || 0); + my $module = LookupValue('current_module'); +# print STDERR "Define ".Stringify($cs)." in $module\n"; + my $scope = (($keys && ($keys->getValue('local') || '' eq 'true')) ? 'module_local' : 'module').":".$module; + my $attr="name='#name' meaning='#meaning' omcd='#omcd'"; + DefConstructorI("\\".$cs->toString,convertLaTeXArgs($nargs,$opt), + ($nargs == 0 + ? "" + : "" + . "" + . join('',map("#$_", (1..$nargs))) + .""), + properties => {name=>$name, meaning=>$cs->toString,omcd=>$cd,role => $role}, + scope=>$scope); + return; }); +DefPrimitive('\abbrdef OptionalKeyVals:symdef {}[][]{}', sub { + my($stomach,$keys,$cs,$nargs,$opt,$presentation)=@_; + my $module = LookupValue('current_module'); + my $scope = (($keys && ($keys->getValue('local') || '' eq 'true')) ? 'module_local' : 'module').":$module"; + DefMacroI("\\".$cs->toString,convertLaTeXArgs($nargs,$opt),$presentation, + scope=>$scope); + return; }); +DefPrimitive('\requiremodules{}', sub { + my($stomach,$module)=@_; + my $GULLET = $stomach->getGullet; + $module = Digest($module)->toString; + if(LookupValue('module_'.$module.'_loaded')) {} + else { + AssignValue('module_'.$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{}', sub { + my($stomach,$module)=@_; + my $GULLET = $stomach->getGullet; + $module = Digest($module)->toString; + AssignValue('module_'.$module.'_loaded' => 1, 'global'); + $stomach->bgroup; + AssignValue('last_module_path', $module); + $GULLET->unread(Invocation(T_CS('\end@requiredmodule'),T_OTHER($module))->unlist); + $GULLET->input($module,['tex']); + return;}); +DefMacro('\@symdef@pres OptionalKeyVals:symdef {}[][]{}', sub { + my($self,$keys, $cs,$nargs,$opt,$presentation)=@_; + Invocation(T_CS('\@symdef@pres@aux'), + $cs, + ($nargs || Tokens(T_OTHER(0))), + symdef_presentation_pmml($cs,ToString($nargs)||0,$presentation), + symdef_presentation_TeX($presentation), + $keys)->unlist; }); +sub symdef_presentation_pmml { + my($cs,$nargs,$presentation)=@_; + my @toks = $presentation->unlist; + while(@toks && $toks[0]->equals(T_SPACE)){ pop(@toks); } # Remove leading space + $presentation = Tokens(@toks); + # Wrap with \@use, unless already has a recognized formatter. + $presentation = Invocation(T_CS('\@use'),$presentation) # Using simple text for now, until getting a proper \@use + unless @toks && ($toks[0]->toString =~ /^\\(infix|prefix|postfix|assoc|use|mixfixi|mixfixa|mixfixii|mixfixia|mixfixai|mixfixiii)$/); + # Low level substitution. + my @args = map(Invocation(T_CS('\@SYMBOL'),T_OTHER("pres_arg:".($_+1))),1..$nargs); + $presentation = Tokens(LaTeXML::Expandable::substituteTokens($presentation,@args)); + $presentation; } +DefConstructor('\@use {}', + "" + . "" + ."" + ."" + . "#1" + ."", + mode=>'inline_math'); +sub get_cd { + my($name,$cd,$role,$cmml,$cattrs,$definitionURL)=@_; + return $cd;} +DefConstructor('\@symdef@pres@aux{}{}{}{} OptionalKeyVals:symdef', + "" + ."" + ."#3" + ."", + afterDigest=>sub { my ($stomach, $whatsit) = @_; + my $keys = $whatsit->getArg(5); + 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{}', "", + afterDigest=>sub { my ($stomach, $whatsit) = @_; + my $select = $whatsit->getArg(1); + $select = ref $select ? $select->toString : ''; + $whatsit->setProperty(select=>"*[".$select."]"); }); + +DefConstructor('\@symdef@pres@text{}', "#1"); +DefConstructor('\requirepackage{} Semiverbatim',"", + afterDigest=>sub { my ($stomach, $whatsit) = @_; + my $select = $whatsit->getArg(1); + RequirePackage($select->toString); }); +1; diff --git a/Master/texmf-dist/tex/latex/stex/omdoc.cls b/Master/texmf-dist/tex/latex/stex/omdoc.cls new file mode 100644 index 00000000000..0e19acb0bd3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/omdoc.cls @@ -0,0 +1,15 @@ +%% +%% 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}[2007/09/09 v0.3 OMDoc Documents] +\LoadClass{article} +\RequirePackage{omdoc} +\endinput +%% +%% End of file `omdoc.cls'. diff --git a/Master/texmf-dist/tex/latex/stex/omdoc.cls.ltxml b/Master/texmf-dist/tex/latex/stex/omdoc.cls.ltxml new file mode 100644 index 00000000000..e197af2a37d --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/omdoc.cls.ltxml @@ -0,0 +1,22 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +LoadClass('article'); +RegisterNamespace('omdoc'=>"http://www.mathweb.org/omdoc"); # OMDoc namespace +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"); +RelaxNGSchema('/Users/kohlhase/stex/rnc/omdoc+ltxml', + '#default'=>"http://www.mathweb.org/omdoc", + '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", + 'ltx'=>"http://dlmf.nist.gov/LaTeXML"); +RequirePackage('omdoc'); +DefEnvironment('{document}','#body', + beforeDigest=> sub { AssignValue(inPreamble=>0); }, + afterDigest=> sub { $_[0]->getGullet->flush; return; }); +1; diff --git a/Master/texmf-dist/tex/latex/stex/omdoc.sty b/Master/texmf-dist/tex/latex/stex/omdoc.sty new file mode 100644 index 00000000000..38d365517dc --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/omdoc.sty @@ -0,0 +1,83 @@ +%% +%% 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}[2007/09/09 v0.3 OMDoc document Structure] +\RequirePackage{keyval}[1997/11/10] +\define@key{omgroup}{id}{\label{#1}} +\define@key{omgroup}{type}{\def\omgroup@type{#1}} +\define@key{omgroup}{display}{\def\omgroup@display{#1}} +\def\omgroup@flow{flow} +\newcount\section@level\section@level=1 +\newenvironment{omgroup}[2][]% title +{\setkeys{omgroup}{#1} +\ifx\omgroup@display\omgroup@flow{#2}\else +\ifnum\section@level=1\section{#2}\fi +\ifnum\section@level=2\subsection{#2}\fi +\ifnum\section@level=3\subsubsection{#2}\fi +\ifnum\section@level=4\paragraph{#2}\fi +\advance\section@level by 1\fi}{} +\def\tgroup{\omgroup}\def\endtgroup{\endomgroup} +\define@key{stat}{id}{\def\st@id{#1}} +\define@key{stat}{display}{\def\st@display{#1}} +\define@key{stat}{for}{\def\stat@for{#1}} +\define@key{stat}{from}{\def\stat@from{#1}} +\define@key{stat}{type}{\def\stat@type{#1}} +\define@key{stat}{title}{\def\stat@title{#1}} +\define@key{stat}{continues}{\def\stat@continues{#1}} +\def\show@st@keys@aux{% +\@ifundefined{st@id}{}{\ifst@id{id=\st@id},\fi}% +\@ifundefined{st@display}{}{\ifst@display{display=\st@display}\fi}} +\def\clear@st@keys{\let\st@id=\relax\let\st@display=\relax} +\def\show@stat@keys@aux{% +\@ifundefined{st@for}{}{\ifstat@for{for=\stat@for},\fi}% +\@ifundefined{st@from}{}{\ifstat@from{from=\stat@from},\fi}% +\@ifundefined{st@type}{}{\ifstat@type{type=\stat@type},\fi}% +\@ifundefined{st@title}{}{\ifstat@title{title=\stat@title},\fi}% +\@ifundefined{st@continues}{}{\ifstat@continues{continues=\stat@continues}\fi}} +\def\show@stat@keys#1{\footnote{#1[\show@st@keys@aux\show@stat@keys@aux]}% +\clear@st@keys\clear@stat@keys} +\def\clear@stat@keys{\let\stat@for=\relax\let\stat@from=\relax% +\let\stat@type=\relax\let\stat@title=\relax\let\stat@continues=\relax} +\def\st@flow{flow} +\def\omtext@pre@skip{\smallskip} +\def\omtext@post@skip{} +\newenvironment{omtext}[1][]{\setkeys{stat}{#1}{% keyval args +\def\lec#1{\@lec{#1}}% so the trailing \par does not get into the way +\omtext@pre@skip\par\noindent +\@ifundefined{stat@title}{}{\ifx\st@display\st@flow\else\stDMemph{\stat@title}:\fi}} +\ifst@env\show@stat@keys{omtext:\stat@title}\fi +\omtext@post@skip}{} +\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} +\long\def\@semantics[#1]#2#3{#2\STRlabeldef{#1}{#2}} +\def\STRlabeldef#1{\expandafter\gdef\csname STR@#1\endcsname} +\def\STRsemantics{\@ifnextchar[\@semantics{\@semantics[]}} +\define@key{phrase}{id}{} +\define@key{phrase}{style}{} +\define@key{phrase}{class}{} +\define@key{phrase}{index}{} +\define@key{phrase}{verbalizes}{} +\define@key{phrase}{type}{} +\newenvironment{phrase}[1][]{\setkeys{phrase}{#1}}{} +\def\nlex#1{\green{\sl{#1}}} +\def\nlcex#1{*\green{\sl{#1}}} +\def\inlinequote#1{``{\sl{#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\omspace#1{\hspace*{#1}} +\endinput +%% +%% End of file `omdoc.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/omdoc.sty.ltxml b/Master/texmf-dist/tex/latex/stex/omdoc.sty.ltxml new file mode 100644 index 00000000000..24c3ca3b119 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/omdoc.sty.ltxml @@ -0,0 +1,230 @@ +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +RequirePackage('keyval'); +DefKeyVal('omgroup','id','Semiverbatim'); +DefKeyVal('omgroup','type','Semiverbatim'); +DefKeyVal('omgroup','display','Semiverbatim'); +DefEnvironment('{omgroup} OptionalKeyVals:omgroup {}', + "\n" + . "?#1(#1\n)()" + . "#body\n" + . ""); + +DefEnvironment('{tgroup} OptionalKeyVals:omgroup {}', + "\n" + . "?#1(#1\n)()" + . "#body\n" + . ""); +DefParameterType('IfBeginFollows', sub { + my ($gullet) = @_; + $gullet->skipSpaces; + return 1 unless $gullet->ifNext(T_CS('\begin')); + return; }, + reversion=>'', optional=>1); + +Let('\group@item@maybe@unwrap','\relax'); + +DefMacro('\group@item[] IfBeginFollows', sub { + my($gullet,$tag,$needwrapper)=@_; + ( T_CS('\group@item@maybe@unwrap'), + ($needwrapper ? (Invocation(T_CS('\group@item@wrap'),$tag)->unlist) : ()) ); }); + +DefConstructor('\group@item@wrap {}', + "" + . "?#1(#1)()" + . "", + beforeDigest=>sub { + Let('\group@item@maybe@unwrap','\group@item@unwrap'); + $_[0]->bgroup; + useCMPItemizations(); + return; }, + properties=>sub{ RefStepItemCounter(); }); +DefConstructor('\group@item@unwrap', + "", + beforeDigest=>sub { + $_[0]->egroup; + Let('\group@item@maybe@unwrap','\relax'); }); + +Let('group@item@maybe@unwrap','\relax'); + +Let('\itemize@item'=>'\group@item'); +Let('\enumerate@item'=>'\group@item'); +Let('\description@item'=>'\group@item'); + +DefEnvironment('{itemize}', + "#body", + properties=>sub { beginItemize('itemize'); }, + beforeDigestEnd=>sub { Digest(T_CS('\group@item@maybe@unwrap')); }); +DefEnvironment('{enumerate}', + "#body", + properties=>sub { beginItemize('enumerate'); }, + beforeDigestEnd=>sub { Digest(T_CS('\group@item@maybe@unwrap')); }); +DefEnvironment('{description}', + "#body", + properties=>sub { beginItemize('description'); }, + beforeDigestEnd=>sub { Digest(T_CS('\group@item@maybe@unwrap')); }); +Let('\tgroup@itemize@item'=>'\group@item'); +Let('\tgroup@enumerate@item'=>'\group@item'); +Let('\tgroup@description@item'=>'\group@item'); + +DefEnvironment('{tgroup@itemize}', + "#body", + properties=>sub { beginItemize('tgroup@itemize'); }, + beforeDigest=>sub { Let(T_CS('\end{itemize}') =>T_CS('\end{tgroup@itemize}')); }, + beforeDigestEnd=>sub { Digest(T_CS('\group@item@maybe@unwrap')); }); +DefEnvironment('{tgroup@enumerate}', + "#body", + properties=>sub { beginItemize('tgroup@enumerate'); }, + beforeDigest=>sub{ Let(T_CS('\end{enumerate}') =>T_CS('\end{tgroup@enumerate}'));}, + beforeDigestEnd=>sub { Digest(T_CS('\group@item@maybe@unwrap')); }); +DefEnvironment('{tgroup@description}', + "#body", + properties=>sub { beginItemize('tgroup@description'); }, + beforeDigest=>sub{ Let(T_CS('\end{description}') =>T_CS('\end{tgroup@description}'));}, + beforeDigestEnd=>sub { Digest(T_CS('\group@item@maybe@unwrap')); }); + +sub useTheoryItemizations { + Let(T_CS('\begin{itemize}') =>T_CS('\begin{tgroup@itemize}')); + Let(T_CS('\begin{enumerate}') =>T_CS('\begin{tgroup@enumerate}')); + Let(T_CS('\begin{description}')=>T_CS('\begin{tgroup@description}')); + return; } +DefConstructor('\CMP@itemize@item[]', + '' + . '?#1(#1)()', + properties=>sub{ RefStepItemCounter(); }); + +DefConstructor('\CMP@enumerate@item[]', + '' + . '?#1(#1)()', + properties=>sub{ RefStepItemCounter(); }); + +DefConstructor('\CMP@description@item[]', + '' + . '?#1(#1)()', # trust di and dt to autoclose + properties=>sub{ RefStepItemCounter(); }); + +DefEnvironment('{CMP@itemize}', + "#body", + properties=>sub { beginItemize('CMP@itemize'); }, + beforeDigest=>sub { Let(T_CS('\end{itemize}') =>T_CS('\end{CMP@itemize}')); }); +DefEnvironment('{CMP@enumerate}', + "#body", + properties=>sub { beginItemize('CMP@enumerate'); }, + beforeDigest=>sub { Let(T_CS('\end{enumerate}') =>T_CS('\end{CMP@enumerate}')); }); +DefEnvironment('{CMP@description}', + "#body", + properties=>sub { beginItemize('CMP@description'); }, + beforeDigest=>sub { Let(T_CS('\end{description}') =>T_CS('\end{CMP@description}'));}); + +sub useCMPItemizations { + Let(T_CS('\begin{itemize}') =>T_CS('\begin{CMP@itemize}')); + Let(T_CS('\begin{enumerate}') =>T_CS('\begin{CMP@enumerate}')); + Let(T_CS('\begin{description}')=>T_CS('\begin{CMP@description}')); + return; } + +Tag('omdoc:CMP', afterOpen => sub { + AssignValue('_LastSeenCMP', $_[1], 'global'); + return; }); + +Tag('omdoc:li', autoClose=>1); +Tag('omdoc:dd', autoClose=>1); +Tag('omdoc:di', autoClose=>1); +DefKeyVal('stat','id','Semiverbatim'); +DefKeyVal('stat','for','Semiverbatim'); +DefKeyVal('stat','title','Semiverbatim'); +DefKeyVal('stat','from','Semiverbatim'); +DefKeyVal('stat','type','Semiverbatim'); +DefKeyVal('stat','display','Semiverbatim'); # not used at the moment +DefCMPEnvironment('{omtext} OptionalKeyVals:stat', + "" + . "?&KeyVal(#1,'title')(&KeyVal(#1,'title'))()" + . "#body" + . "\n"); +sub DefCMPEnvironment { + my ($proto, $replacement, %options) = @_; + my @before = $options{beforeDigest} ? ($options{beforeDigest}) : (); + push(@before, \&useCMPItemizations); + $options{beforeDigest} = \@before; + DefEnvironment($proto, $replacement, %options); +} +DefConstructor('\STRlabel{}{}', sub { + my($document,$label,$object)=@_; + $document->absorb($object); + $document->addAttribute('xml:id'=>ToString($label)) if $label; }); +DefConstructor('\STRcopy{}',""); +DefMacro('\STRlabeldef{}{}', ""); +DefConstructor('\STRsemantics[]{}{}', sub { + my($document,$label,$ignore,$object)=@_; + $document->absorb($object); + $document->addAttribute('xml:id'=>ToString($label)) if $label; }); +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 {}', + "#body"); +DefConstructor('\nlex{}',"#1"); +DefConstructor('\nlcex{}',"#1"); +DefConstructor('\inlinequote{}',"#1"); +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)(#2)"); +foreach my $color(qw(blue red green magenta cyan brown yellow)) { + DefMacro("\\".$color.'{}', sub { omdocColorMacro($color, @_); }); } +DefConstructor('\par',sub { $_[0]->maybeCloseElement('omdoc:p'); },alias=>"\\par\n"); +Tag('omdoc:p', autoClose=>1, autoOpen=>1); +DefConstructor('\omspace{}',''); +DefConstructor('\emph{}',"#1"); +DefConstructor('\em',""); +Tag('omdoc:phrase', autoClose=>1); +DefEnvironment('{center}','#body'); +DefEnvironment('{minipage}{}','#body'); +DefEnvironment('{quote}',"#body"); +DefEnvironment('{quotation}',"#body"); +DefEnvironment('{small}','#body'); +DefEnvironment('{footnotesize}','#body'); +DefEnvironment('{tiny}','#body'); +DefEnvironment('{scriptsize}','#body'); +DefConstructor('\LARGE',''); +DefConstructor('\Large',''); +DefConstructor('\large',''); +DefConstructor('\small',''); + +DefConstructor('\fbox{}','#1'); + +DefConstructor('\footnote[]{}', + "#2"); +DefConstructor('\footnotemark[]',""); +DefConstructor('\footnotetext[]{}', + "#2"); + +DefConstructor('\sf', ''); +DefConstructor('\sc', ''); +Tag('omdoc:p',afterOpen=>\&numberIt); +Tag('omdoc:omtext',afterOpen=>\&numberIt); +Tag('omdoc:omgroup',afterOpen=>\&numberIt); +Tag('omdoc:tgroup',afterOpen=>\&numberIt); +Tag('omdoc:CMP',afterOpen=>\&numberIt); +sub numberIt { + my($document,$node,$whatsit)=@_; + my(@parents)=$document->findnodes('ancestor::*[@xml:id]',$node); # find 1st id'd parent. + 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')); + $node->setAttribute('xml:id'=>$prefix."p$n") unless $id; } +DefConstructor('\url Semiverbatim',"#1"); +1; diff --git a/Master/texmf-dist/tex/latex/stex/presentation.sty b/Master/texmf-dist/tex/latex/stex/presentation.sty new file mode 100644 index 00000000000..53eb139fe7a --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/presentation.sty @@ -0,0 +1,125 @@ +%% +%% 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}[2007/09/03 v0.9e presentation for semantic macros] + +\RequirePackage{keyval}[1997/11/10] +\def\pres@default@precedence{1000} +\def\setDefaultPrecedence#1{\def\pres@default@precedence{#1}} +\def\pres@initial@precedence{1000} +\def\setInitialPrecedence#1{\def\pres@initial@precedence{#1}} +\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\setDefaultLeftBracket#1{\def\pres@default@lbrack{#1}} +\def\setDefaultRightBracket#1{\def\pres@default@rbrack{#1}} +\def\PrecSet#1{\def\pres@default@precedence{#1}} +\def\PrecWrite#1{\ifnum\pres@current@precedence>\pres@p\else{#1}\fi} +\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}{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 +{\setkeys{mi}{#1}\prep@keys@mi\clearkeys +\PrecWrite\pres@lbrack% write bracket if necessary +#2{\edef\pres@current@precedence{\pres@pi}#3}#4% +\PrecWrite\pres@rbrack} +\newcommand{\mixfixa}[5][]%key, pre, arg, post, assocop +{\setkeys{mi}{#1}\prep@keys@mi\clearkeys% +\PrecWrite\pres@lbrack{#2}{\@assoc\pres@pi{#5}{#3}}{#4}\PrecWrite\pres@rbrack} +\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}}% +\let\pres@pii@key=\relax} +\newcommand{\mixfixii}[6][]%key, pre, arg1, mid, arg2, post +{\setkeys{mii}{#1}\prep@keys@mii\clearkeys% +\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 +{\setkeys{mii}{#1}\prep@keys@mii\clearkeys% +\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 +{\setkeys{mii}{#1}\prep@keys@mii\clearkeys% +\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}{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 +{\setkeys{miii}{#1}\prep@keys@miii\clearkeys% +\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{\prefix}[3][]%key, fn, arg +{\setkeys{mi}{#1}\prep@keys@mi\clearkeys +#2\PrecWrite\pres@lbrack% write bracket if necessary +{\edef\pres@current@precedence{\pres@pi}#3}% +\PrecWrite\pres@rbrack} +\newcommand{\postfix}[3][]%key, fn, arg +{\setkeys{mi}{#1}\prep@keys@mi\clearkeys +\PrecWrite\pres@lbrack% write bracket if necessary +{\edef\pres@current@precedence{\pres@pi}#3}% +\PrecWrite\pres@rbrack{#2}} +\newcommand{\prefixa}[4][]{\mixfixa[#1]{#2}{#3}{}{#4}} +\newcommand{\postfixa}[4][]{{#1}\mixfixa[#1]{}{#3}{#2}{#4}} +\newcommand{\infix}[4][]{\mixfixii[#1]{}{#3}{#2}{#4}{}} +\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{\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{1000} +\PackageError{presentation}{undefined egroup #1, assuming value 1000}% +{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}{1000}.}}% +{\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} +\def\MOD@namedef#1{\expandafter\def\csname MOD@name@#1\endcsname} +\def\MOD@name[#1]#2{#2\def\@test{#2}\ifx\@test\empty\else\MOD@namedef{#1}{#2}\fi} +\def\vname{\@ifnextchar[\MOD@name{\MOD@name[]}} +\def\vnref#1{\csname MOD@name@#1\endcsname} +\def\hrcr#1#2{\hyperlink{#1@\mod@id}{#2}} +\endinput +%% +%% End of file `presentation.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/presentation.sty.ltxml b/Master/texmf-dist/tex/latex/stex/presentation.sty.ltxml new file mode 100644 index 00000000000..cd153933e57 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/presentation.sty.ltxml @@ -0,0 +1,197 @@ + +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +RequirePackage('keyval'); +DefKeyVal('mi','lbrack','Semiverbatim'); +DefKeyVal('mi','rbrack','Semiverbatim'); +DefKeyVal('mi','p','Semiverbatim'); +DefKeyVal('mi','pi','Semiverbatim'); +DefConstructor('\mixfixi OptionalKeyVals:mi {}{}{}', + "" + . "" + . ""##### need to get $cd and $name here. + . "" + . "" + ."" + ."" + . "" + . "#2" + . "" + . "#4" + . "" + ."", + mode=>'inline_math'); +DefConstructor('\mixfixa OptionalKeyVals:mi {}{}{}{}', + "" + . "" + . ""##### need to get $cd and $name here. + . "" + . "" + . "" + . "" + ."" + ."" + . "" + . "#2" + . "" + . "" + . "#5" + . "" + . "" + . "" + . "#4" + . "" + ."", + mode=>'inline_math'); +DefKeyVal('mii','lbrack','Semiverbatim'); +DefKeyVal('mii','rbrack','Semiverbatim'); +DefKeyVal('mii','p','Semiverbatim'); +DefKeyVal('mii','pi','Semiverbatim'); +DefKeyVal('mii','pii','Semiverbatim'); +DefConstructor('\mixfixii OptionalKeyVals:mi {}{}{}{}{}', + "" + . "" + . ""##### need to get $cd and $name here. + . "" + . "" + . "" + ."" + ."" + . "" + . "#2" + . "" + . "#4" + . "" + . "#6" + . "" + ."", + mode=>'inline_math'); +DefConstructor('\mixfixia OptionalKeyVals:mi {}{}{}{}{}{}', + "" + . "" + . ""##### need to get $cd and $name here. + . "" + . "" + . "" + . "" + . "" + ."" + ."" + . "" + . "#2" + . "" + . "#4" + . "" + . "" + . "#7" + . "" + . "" + . "" + . "#6" + . "" + ."", + mode=>'inline_math'); +DefConstructor('\mixfixai OptionalKeyVals:mi {}{}{}{}{}{}', + "" + . "" + . ""##### need to get $cd and $name here. + . "" + . "" + . "" + . "" + . "" + ."" + ."" + . "" + . "#2" + . "" + . "" + . "#7" + . "" + . "" + . "" + . "#4" + . "" + . "#6" + . "" + ."", + mode=>'inline_math'); +DefKeyVal('miii','lbrack','Semiverbatim'); +DefKeyVal('miii','rbrack','Semiverbatim'); +DefKeyVal('miii','p','Semiverbatim'); +DefKeyVal('miii','pi','Semiverbatim'); +DefKeyVal('miii','pii','Semiverbatim'); +DefKeyVal('miii','piii','Semiverbatim'); +DefConstructor('\mixfixiii OptionalKeyVals:mi {}{}{}{}{}{}{}', + "" + . "" + . ""##### need to get $cd and $name here. + . "" + . "" + . "" + . "" + ."" + ."" + . "" + . "#2" + . "" + . "#4" + . "" + . "#6" + . "" + . "#8" + . "" + ."", + mode=>'inline_math'); +DefConstructor('\prefix OptionalKeyVals:mi {}{}', + "" + . "" + . ""##### need to get $cd and $name here. + . "" + . "" + ."" + ."" + . "" + . "#2" + . "" + . "" + ."", + mode=>'inline_math'); +DefConstructor('\postfix OptionalKeyVals:mi {}{}', + "" + . "" + . ""##### need to get $cd and $name here. + . "" + . "" + ."" + ."" + . "" + . "" + . "#2" + . "" + ."", + mode=>'inline_math'); +DefMacro('\infix []{}{}{}','\mixfixii[#1]{}{#3}{#2}{#4}{}'); +DefConstructor('\assoc OptionalKeyVals:mi {}{}', + "" + . "" + . ""##### need to get $cd and $name here. + . "" + . "" + . "" + . "" + ."" + ."" + . "" + . "" + . "" + . "#3" + . "" + . "" + . "" + . "" + ."", + mode=>'inline_math'); +1; diff --git a/Master/texmf-dist/tex/latex/stex/sproof.sty b/Master/texmf-dist/tex/latex/stex/sproof.sty new file mode 100644 index 00000000000..b2501b45948 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/sproof.sty @@ -0,0 +1,112 @@ +%% +%% 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}[2006/01/13 v0.9a Semantic Markup for Proofs] +\RequirePackage{omdoc}[2007/09/09] +\newif\ifjust@method\just@methodfalse +\DeclareOption{method}{\just@methodtrue} +\newif\ifspf@env\spf@envfalse +\newif\ifspf@id\spf@idfalse +\newif\ifspf@display\spf@displayfalse +\DeclareOption{id}{\spf@idtrue\spf@envtrue} +\DeclareOption{env}{\spf@envtrue} +\DeclareOption{display}{\spf@displaytrue\spf@envtrue} +\newif\ifspf@for\spf@forfalse +\newif\ifspf@from\spf@forfalse +\newif\ifspf@type\spf@typefalse +\newif\ifspf@title\spf@titlefalse +\newif\ifspf@proofend\spf@proofendtrue +\newif\ifspf@continues\spf@continuesfalse +\DeclareOption{for}{\spf@fortrue\spf@envtrue} +\DeclareOption{from}{\spf@fromtrue\spf@envtrue} +\DeclareOption{type}{\spf@typetrue\spf@envtrue} +\DeclareOption{title}{\spf@titletrue\spf@envtrue} +\DeclareOption{continues}{\spf@continuepfrue\spf@envtrue} +\DeclareOption{noproofend}{\spf@proofendfalse\spf@envtrue} +\def\spftrue{\spf@fortrue\spf@fromtrue\spf@typetrue\spf@continuepfrue} +\DeclareOption{draft}{\spf@envtrue\just@methodtrue} +\DeclareOption{all}{\spf@envtrue\just@medhodtrue} +\ProcessOptions +\define@key{spf}{id}{\def\spf@id{#1}} +\define@key{spf}{display}{\def\spf@display{#1}} +\define@key{spf}{for}{\def\spf@for{#1}} +\define@key{spf}{from}{\def\spf@from{#1}} +\define@key{spf}{sproofend}{\spf@proofendtrue\def\sproof@box{#1}} +\define@key{spf}{noproofend}[imeanit]{\spf@proofendfalse} +\define@key{spf}{type}{\def\spf@type{#1}} +\define@key{spf}{title}{\def\spf@title{#1}} +\define@key{spf}{continues}{\def\spf@continues{#1}} +\def\show@st@keys@aux{% +\@ifundefined{spf@id}{}{\ifspf@id{id=\spf@id},\fi}% +\@ifundefined{spf@display}{}{\ifspf@display{display=\spf@display}\fi}} +\def\clear@pf@keys{\let\spf@id=\relax\let\spf@display=\relax} +\def\show@pf@keys@aux{% +\@ifundefined{spf@for}{}{\ifspf@for{for=\spf@for},\fi}% +\@ifundefined{spf@from}{}{\ifspf@from{from=\spf@from},\fi}% +\@ifundefined{spf@prefix}{}{\ifspf@prefix{prefix=\spf@prefix},\fi}% +\@ifundefined{spf@type}{}{\ifspf@type{type=\spf@type},\fi}% +\@ifundefined{spf@title}{}{\ifspf@title{title=\spf@title},\fi}% +\@ifundefined{spf@continues}{}{\ifspf@continues{continues=\spf@continues}\fi}} +\def\show@pf@keys#1{\footnote{#1[\show@pf@keys@aux\show@pf@keys@aux]}% +\clear@pf@keys\clear@pf@keys} +\def\clear@pf@keys{\let\spf@for=\relax\let\spf@from=\relax\let\spf@prefix=\relax% +\let\spf@type=\relax\let\spf@title=\relax\let\spf@continues=\relax} +\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@label.\number\count\count10} +\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\sproofend{\ifspf@proofend\hfil\null\nobreak\hfill\sproof@box\par\smallskip\fi} +\def\sProofEndSymbol#1{\def\sproof@box{#1}} +\newenvironment{@proof}[2][]{\setkeys{spf}{#1} +\count10=10\ifx\spf@display\spf@flow\else{\stDMemph{Proof}:}\fi% +\ifspf@env\show@pf@keys{sproof}\fi{ #2}% +\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{@proof}[#1]{#2}}{\sproofend\end{@proof}} +\newcommand{\sproofidea}[2][]{{\stDMemph{Proof Idea}:} #2\sproofend} +\newenvironment{spfstep}[1][]{\setkeys{spf}{#1} +\ifx\spf@display\spf@flow\else\item[\the@pst@label]\fi +\@ifundefined{spf@title}{}{(\stDMemph{\spf@title})}% +\ifspf@env\show@pf@keys{spfstep}\fi} +{\next@pst@label} +\newenvironment{sproofcomment}[1][]{\setkeys{spf}{#1} +\ifx\spf@display\spf@flow\else\item[\the@pst@label]\fi +\ifspf@env\show@pf@keys{sproofcomment}\fi} +{\next@pst@label} +\newenvironment{spfcases}[2][]{\setkeys{spf}{#1} +\def\@test{#2}\ifx\@test\empty\else +\ifx\spf@display\spf@flow {#2}\else\item[\the@pst@label]{#2} \fi\fi +\ifspf@env\show@pf@keys{spfcases}\fi +\begin{pst@with@label}{\pst@label.\number\count\count10}} +{\end{pst@with@label}\next@pst@label} +\newenvironment{spfcase}[2][]{\setkeys{spf}{#1} +\ifx\spf@display\spf@flow\else\item[\the@pst@label]\fi +\def\@test{#2}\ifx\@test\empty\else{\stDMemph{#2}:}\fi +\ifspf@env\show@pf@keys{spfcase}\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}{\begin{pst@with@label}{\pst@label.\number\count\count10}} +{\ifx\spf@display\spf@flow\else\sproofend\fi\end{pst@with@label}} +\define@key{just}{id}{\def\just@id{#1}} +\define@key{just}{method}{\def\just@method{#1}} +\def\show@just@keys#1{\footnote{#1[\show@pf@keys@aux\show@just@keys@aux]}}% +\def\show@just@keys@aux{% +\@ifundefined{just@method}{\relax}{\ifjust@method{method=\just@method},\fi}% +\clear@pf@keys\clear@just@keys} +\def\clear@just@keys{\let\just@method=\relax} +\newenvironment{justification}[1][]{\ifspf@env\setkeys{just}{#1} + \show@just@keys{justification}\fi}{} +\newcommand{\premise}[2][]{#2} +\newcommand{\justarg}[2][]{#2} +\endinput +%% +%% End of file `sproof.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/sproof.sty.ltxml b/Master/texmf-dist/tex/latex/stex/sproof.sty.ltxml new file mode 100644 index 00000000000..afd3433e9b8 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/sproof.sty.ltxml @@ -0,0 +1,107 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +RequirePackage('omdoc'); +DefKeyVal('pf','id','Semiverbatim'); +DefKeyVal('pf','display','Semiverbatim'); # not used at the moment +DefKeyVal('pf','for','Semiverbatim'); +DefKeyVal('pf','from','Semiverbatim'); +DefKeyVal('pf','proofend','Semiverbatim'); +DefKeyVal('pf','noproofend','Semiverbatim'); +DefKeyVal('pf','type','Semiverbatim'); +DefKeyVal('pf','title','Semiverbatim'); +DefKeyVal('pf','continues','Semiverbatim'); +DefConstructor('\sproofend',""); +DefEnvironment('{sproof} OptionalKeyVals:pf{}', + "\n" + . "?#2(#2\n)()" + . "#body" + . "\n"); +DefEnvironment('{sproofidea} OptionalKeyVals:pf {}', + "\n" + . "#2\n" + . "\n"); +DefCMPEnvironment('{spfstep} OptionalKeyVals:pf', + "" + . "#body" + . "\n"); +DefCMPEnvironment('{sproofcomment} OptionalKeyVals:pf', + "" + . "#body" + . ""); +DefEnvironment('{spfcases} OptionalKeyVals:pf {}', + "\n" + . "#2\n" + . "" + . "#body" + . "" + . "\n"); +DefEnvironment('{spfcase} OptionalKeyVals:pf{}', + "\n" + . "?#2(#2\n)()" + . "#body" + . "\n"); +DefEnvironment('{subproof}', + "\n #body\n\n"); +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[]', ""); +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); +Tag('omdoc:derive',afterOpen=>\&numberIt); +Tag('omdoc:method',afterOpen=>\&numberIt); +1; diff --git a/Master/texmf-dist/tex/latex/stex/statements.sty b/Master/texmf-dist/tex/latex/stex/statements.sty new file mode 100644 index 00000000000..0ae7cda7c74 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/statements.sty @@ -0,0 +1,85 @@ +%% +%% 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}[2007/09/09 v0.9d Semantic Markup for Statements] +\newif\ifst@env\st@envfalse +\newif\ifst@id\st@idfalse +\newif\ifst@display\st@displayfalse +\DeclareOption{id}{\st@idtrue\st@envtrue} +\DeclareOption{env}{\st@envtrue} +\DeclareOption{display}{\st@displaytrue\st@envtrue} +\newif\ifstat@for\stat@forfalse +\newif\ifstat@from\stat@forfalse +\newif\ifstat@type\stat@typefalse +\newif\ifstat@title\stat@titlefalse +\newif\ifstat@continues\stat@continuesfalse +\DeclareOption{for}{\stat@fortrue\st@envtrue} +\DeclareOption{from}{\stat@fromtrue\st@envtrue} +\DeclareOption{type}{\stat@typetrue\st@envtrue} +\DeclareOption{title}{\stat@titletrue\st@envtrue} +\DeclareOption{continues}{\stat@continuestrue\st@envtrue} +\def\stattrue{\stat@fortrue\stat@fromtrue\stat@typetrue\stat@continuestrue} +\DeclareOption{draft}{\st@envtrue\st@idtrue\stat@fortrue\stat@fromtrue\typetrue\justtrue} +\DeclareOption{all}{\st@envtrue\stattrue\justtrue} +\ProcessOptions +\RequirePackage{omdoc}[2007/09/09] +\def\define@statement@env#1#2{ +\newenvironment{#1}[1][]{\setkeys{stat}{##1} +\ifx\st@display\st@flow\else\stDMemph{#2}:\fi% +\@ifundefined{stat@title}{}% +{\space\ifx\st@display\st@flow\else(\fi\stDMemph{\stat@title}\ifx\st@display\st@flow:\else)\par\fi}\space% +\ifst@env\show@stat@keys{#1}\fi\csname st@#1@initialize\endcsname} +{\csname st@#1@terminate\endcsname}} +\newenvironment{assertion}[1][]{\setkeys{stat}{#1} +\ifx\st@display\st@flow\else{\stDMemph{\stat@type}:}\fi% +\@ifundefined{stat@title}{~}{~(\stDMemph{\stat@title})\par}% +\ifst@env\show@stat@keys{#1}\fi\em}{} +\newenvironment{simpleDef}[1][]{\setkeys{stat}{#1} +\ifx\st@display\st@flow\else{\stDMemph{Definition}:}\fi% +\@ifundefined{stat@title}{~}{~(\stDMemph{\stat@title})\par}% +\ifst@env\show@stat@keys{#1}\fi}{} +\newenvironment{PatternDef}[1][]{\setkeys{stat}{#1} +\ifx\st@display\st@flow\else{\stDMemph{Definition}:}\fi% +\@ifundefined{stat@title}{~}{~(\stDMemph{\stat@title})\par}% +\ifst@env\show@stat@keys{#1}\fi}{} +\newenvironment{PatternRule}[1]{#1$\colon=$}{} +\newenvironment{PatternCMP}{}{} +\newenvironment{RecDef}[1][]{\setkeys{stat}{#1} +\ifx\st@display\st@flow\else{\stDMemph{Definition}:}\fi% +\@ifundefined{stat@title}{~}{~(\stDMemph{\stat@title})\par}% +\ifst@env\show@stat@keys{#1}\fi}{} +\def\st@example@initialize{}\def\st@example@terminate{} +\define@statement@env{example}{Example} +\def\st@axiom@initialize{}\def\st@axiom@terminate{} +\define@statement@env{axiom}{Axiom} +\define@key{consymb}{type}{\def\consymb@type{#1}} +\define@key{consymb}{title}{\def\consymb@title{#1}} +\define@key{consymb}{name}{\def\consymb@name{#1}} +\def\consymb@type{Symbol} +\newenvironment{consymb}[1][]{\setkeys{consymb}{#1} +\ifx\st@display\st@flow\else{\stDMemph{\consymb@type} \consymb@name:}\fi% +\@ifundefined{consymb@title}{~}{~(\stDMemph{\consymb@title})\par}}{} +\newcommand{\symtype}[2]{Type (#1): #2} +\def\st@definition@initialize{% +\newcommand{\notatiendum}[2][]{\notemph{##2}} +\newcommand{\definiendum}[2][]{\defemph{##2}}} +\def\st@definition@terminate{} +\define@statement@env{definition}{Definition} +\def\notemph#1{{\bf{#1}}} +\def\st@notation@initialize{\newcommand{\notatiendum}[2][]{\notemph{##2}}} +\def\st@notation@terminate{} +\define@statement@env{notation}{Notation} +\def\termin{\@ifnextchar[{\@termin}{\@termin[]}} +\def\@termin[#1]#2{{\termemph{\index*{#2}}}} +\providecommand{\termemph}[1]{#1} +\providecommand{\defemph}[1]{{\bf{#1}}} +\providecommand{\stDMemph}[1]{{\bf{#1}}} +\endinput +%% +%% End of file `statements.sty'. diff --git a/Master/texmf-dist/tex/latex/stex/statements.sty.ltxml b/Master/texmf-dist/tex/latex/stex/statements.sty.ltxml new file mode 100644 index 00000000000..d938af97167 --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/statements.sty.ltxml @@ -0,0 +1,142 @@ +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +RequirePackage('omdoc'); +RequirePackage('myindex'); +DefCMPEnvironment('{assertion} OptionalKeyVals:stat', + "" + . "?&KeyVal(#1,'title')(&KeyVal(#1,'title'))()" + . "#body" + ."\n"); +DefCMPEnvironment('{simpleDef} OptionalKeyVals:stat', + "?&KeyVal(#1,'for')()()" + . "" + . "?&KeyVal(#1,'title')(&KeyVal(#1,'title'))()" + . "#body" + . "\n"); +DefCMPEnvironment('{PatternDef} OptionalKeyVals:stat', + "?&KeyVal(#1,'for')()()" + . "" + . "?&KeyVal(#1,'title')(&KeyVal(#1,'title'))()" + . "#body" + . "\n"); +DefEnvironment('{PatternRule}{}', + "#1 #body"); +DefEnvironment('{PatternCMP}{}', + "#body"); +DefEnvironment('{RecDef} OptionalKeyVals:stat', + "?&KeyVal(#1,'for')()()" + . "" + . "?&KeyVal(#1,'title')(&KeyVal(#1,'title'))()" + . "#body" + . "\n"); +DefCMPEnvironment('{example} OptionalKeyVals:stat', + "" + . "#body" + . "\n"); +DefCMPEnvironment('{axiom} OptionalKeyVals:stat', + "" + . "?&KeyVal(#1,'title')(&KeyVal(#1,'title'))()" + . "#body" + . "\n"); +DefEnvironment('{consymb} OptionalKeyVals:stat', + "" + . "" + . "" + . "#body" + . "" + . "" + . "\n"); +DefConstructor('\symtype{}{}',"#2"); +DefCMPEnvironment('{definition} OptionalKeyVals:stat', sub { + my ($doc, $keyvals, %props) = @_; + my @symbols = @{$props{defs} || []}; + foreach my $symb(@symbols) { + $doc->openElement('omdoc:symbol', name=>$symb); + $doc->closeElement('omdoc:symbol'); } + my %attrs = (); + my $id = $keyvals->getValue('id') if $keyvals; + $attrs{'xml:id'} = $id if $id; + my $ffor = $keyvals->getValue('for') if $keyvals; + my $for = $ffor . join(' ',@symbols) if $ffor; + $attrs{for} = $for if $for; + $doc->openElement('omdoc:definition', %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->closeElement('omdoc:metadata'); } + $doc->openElement('omdoc:CMP'); + $doc->openElement('omdoc:p'); + $doc->absorb($props{body}) if $props{body}; + $doc->closeElement('omdoc:p'); + $doc->closeElement('omdoc:CMP'); + $doc->closeElement('omdoc:definition'); + return; }, + afterDigestBegin=>sub { + my ($stomach, $whatsit) = @_; + my @symbols = (); + $whatsit->setProperty(defs=>\@symbols); + AssignValue('defs', \@symbols, 'global'); + return; }, + afterDigest => sub { + AssignValue('defs', undef, 'global'); + return; }); + +DefConstructor('\definiendum[]{}', + "#2", + afterDigest => sub { + my ($stomach, $whatsit) = @_; + my $addr = LookupValue('defs'); + push(@$addr, $whatsit->getArg(1)->toString) if $addr; + $whatsit->setProperty(theory=>LookupValue('current_module')); + return; }); +DefMacro('\defin{}', sub { + my @args = (T_BEGIN, $_[1]->unlist, T_END); + (T_CS('\definiendum'), T_OTHER('['), $_[1]->unlist, T_OTHER(']'), @args, T_CS('\defin@index'), @args); }); +DefMacro('\twindef{}{}', sub { + my @args = (T_BEGIN, $_[1]->unlist, T_END, T_BEGIN, $_[2]->unlist, T_END); + (T_CS('\twindef@def'), @args, T_CS('\twindef@index'), @args); }); +DefMacro('\atwindef{}{}{}', sub { + my @args = (T_BEGIN, $_[1]->unlist, T_END, T_BEGIN, $_[2]->unlist, T_END, + T_BEGIN, $_[3]->unlist, T_END); + (T_CS('\atwindef@def'), @args, T_CS('\atwindef@index'), @args); }); +DefConstructor('\twindef@def{}{}', + "#1 #2", + afterDigest => sub { + my ($stomach, $whatsit) = @_; + my $addr = LookupValue('defs'); + push(@$addr, $whatsit->getArg(1)->toString.'-'.$whatsit->getArg(2)->toString) if $addr; + $whatsit->setProperty(theory=>LookupValue('current_module')); + return; }, + alias => ''); +DefConstructor('\atwindef@def{}{}{}', + "#1 #2 #3", + afterDigest => sub { + my ($stomach, $whatsit) = @_; + my $addr = LookupValue('defs'); + push(@$addr, $whatsit->getArg(1)->toString.'-'.$whatsit->getArg(2)->toString + .'-'.$whatsit->getArg(3)->toString) if $addr; + $whatsit->setProperty(theory=>LookupValue('current_module')); + return; }, + alias => ''); +DefCMPEnvironment('{notation} OptionalKeyVals:stat', + "" + . "?&KeyVal(#1,'title')(&KeyVal(#1,'title'))()" + . "#body" + . "\n"); +DefConstructor('\notatiendum OptionalKeyVals:notation {}', + "#1"); +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..518540f8bca --- /dev/null +++ b/Master/texmf-dist/tex/latex/stex/stex.sty @@ -0,0 +1,20 @@ +%% +%% This is file `stex.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% stex.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{stex}[2006/01/13 v0.9a Semantic Markup] +\def\stex{{\raisebox{-.5ex}S\kern-.5ex\TeX}} +\def\sTeX{\stex} +\usepackage{modules} +\usepackage{statements} +\usepackage{sproof} +\usepackage{omdoc} +\usepackage{presentation} +\endinput +%% +%% End of file `stex.sty'. -- cgit v1.2.3