summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/colo-ini.tex94
-rw-r--r--tex/context/base/cont-new.tex18
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/core-job.tex2
-rw-r--r--tex/context/base/core-lst.tex2
-rw-r--r--tex/context/base/core-mat.tex2
-rw-r--r--tex/context/base/core-not.tex4
-rw-r--r--tex/context/base/core-ref.tex42
-rw-r--r--tex/context/base/core-sec.tex5
-rw-r--r--tex/context/base/core-syn.tex12
-rw-r--r--tex/context/base/font-ini.tex7
-rw-r--r--tex/context/base/hand-ini.tex4
-rw-r--r--tex/context/base/lang-ita.tex4
-rw-r--r--tex/context/base/m-database.tex287
-rw-r--r--tex/context/base/m-streams.tex2
-rw-r--r--tex/context/base/page-flt.tex83
-rw-r--r--tex/context/base/page-ini.tex2
-rw-r--r--tex/context/base/page-one.tex14
-rw-r--r--tex/context/base/prop-lay.tex4
-rw-r--r--tex/context/base/s-pre-30.tex245
-rw-r--r--tex/context/base/syst-ext.tex6
-rw-r--r--tex/context/base/syst-gen.tex2
-rw-r--r--tex/context/base/x-om2cml.xsl1250
-rw-r--r--tex/context/base/x-openmath.xsl35
-rw-r--r--tex/context/interface/cont-cz.xml2
-rw-r--r--tex/context/interface/cont-de.xml2
-rw-r--r--tex/context/interface/cont-en.xml2
-rw-r--r--tex/context/interface/cont-fr.xml2
-rw-r--r--tex/context/interface/cont-it.xml2
-rw-r--r--tex/context/interface/cont-nl.xml2
-rw-r--r--tex/context/interface/cont-ro.xml2
-rw-r--r--tex/context/interface/keys-cz.xml2
-rw-r--r--tex/context/interface/keys-de.xml2
-rw-r--r--tex/context/interface/keys-en.xml2
-rw-r--r--tex/context/interface/keys-fr.xml2
-rw-r--r--tex/context/interface/keys-it.xml2
-rw-r--r--tex/context/interface/keys-nl.xml2
-rw-r--r--tex/context/interface/keys-ro.xml2
38 files changed, 2018 insertions, 138 deletions
diff --git a/tex/context/base/colo-ini.tex b/tex/context/base/colo-ini.tex
index 779479681..0fac60740 100644
--- a/tex/context/base/colo-ini.tex
+++ b/tex/context/base/colo-ini.tex
@@ -326,64 +326,6 @@
\def\dodefineglobalcolor{\dododefinecolor\doglobal\setgvalue\setxvalue1}
\def\dodefinenamedcolor {\dododefinecolor\doglobal\setvalue \setevalue0}
-% keep this for readability
-%
-% \def\dodefinecolor[#1][#2]%
-% {\addtocommalist{#1}\colorlist
-% \doifassignmentelse{#2}
-% {\@@resetcolorparameters
-% \getparameters[\??cl @@][#2]%
-% \doifelse{\@@cl@@r\@@cl@@g\@@cl@@b}{\@@cl@@z\@@cl@@z\@@cl@@z}
-% {\doifelse{\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k}{\@@cl@@z\@@cl@@z\@@cl@@z\@@cl@@z}
-% {\doifelse\@@cl@@s\@@cl@@z
-% {\showmessage\m!colors8{{[#2]},#1}%
-% \setevalue{\??cr#1}{\colorZpattern}}
-% {\setevalue{\??cr#1}{\colorSpattern}}}
-% {\setevalue{\??cr#1}{\colorCpattern}}}
-% {\setevalue{\??cr#1}{\colorRpattern}}}
-% {\doifdefinedelse{\??cr#2}
-% {\doifelse{#1}{#2}
-% {% this way we can freeze \definecolor[somecolor][somecolor]
-% % and still prevent cyclic definitions
-% \iffreezecolors\setevalue{\??cr#1}{\getvalue{\??cr#2}}\fi}
-% {\iffreezecolors\@EA\setevalue\else\@EA\setvalue\fi
-% {\??cr#1}{\getvalue{\??cr#2}}}}
-% {\showmessage\m!colors3{#1}\empty}}%
-% \unexpanded\setvalue{#1}{\color[#1]}} % \unexpanded toegevoegd
-
-% \def\dododefinecolor#1#2#3#4[#5][#6]% #2==set(g)value #3==set[e|x]value
-% {#1\addtocommalist{#5}\colorlist % optional
-% \doifassignmentelse{#6}
-% {\@@resetcolorparameters
-% \getparameters[\??cl @@][#6]%
-% \ifx\@@cl@@h\empty
-% \doifelse{\@@cl@@r\@@cl@@g\@@cl@@b}{\@@cl@@z\@@cl@@z\@@cl@@z}
-% {\doifelse{\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k}{\@@cl@@z\@@cl@@z\@@cl@@z\@@cl@@z}
-% {\doifelse\@@cl@@s\@@cl@@z
-% {\showmessage\m!colors8{{[#6]},#5}%
-% #3{\??cr#5}{\colorZpattern}}
-% {#3{\??cr#5}{\colorSpattern}}}
-% {#3{\??cr#5}{\colorCpattern}}}
-% {#3{\??cr#5}{\colorRpattern}}%
-% \else
-% \setxvalue{\??cr#5}{\colorHpattern}%
-% \fi
-% % new: e=external spot color name
-% \ifx\@@cl@@e\empty \else
-% \doregisterspotcolorname{#5}\@@cl@@e
-% \fi}
-% {\doifdefinedelse{\??cr#6}
-% {\doifelse{#5}{#6}
-% {% this way we can freeze \definecolor[somecolor][somecolor]
-% % and still prevent cyclic definitions
-% \iffreezecolors#3{\??cr#5}{\getvalue{\??cr#6}}\fi}
-% {\iffreezecolors\@EA#3\else\@EA#2\fi
-% {\??cr#5}{\getvalue{\??cr#6}}}}
-% {\showmessage\m!colors3{#5 (def)}}}%
-% \ifcase#4\or
-% \unexpanded#2{#5}{\switchtocolor[#5]}% \unexpanded toegevoegd
-% \fi}
-
\def\dododefinecolor#1#2#3#4[#5][#6]% #2==set(g)value #3==set[e|x]value
{#1\addtocommalist{#5}\colorlist % optional
\doifassignmentelse{#6}
@@ -416,9 +358,9 @@
{\doifelse{#5}{#6}
{% this way we can freeze \definecolor[somecolor][somecolor]
% and still prevent cyclic definitions
- \iffreezecolors#3{\??cr#5}{\getvalue{\??cr#6}}\fi}
+ \iffreezecolors#3{\??cr#5}{\csname\??cr#6\endcsname}\fi}
{\iffreezecolors\@EA#3\else\@EA#2\fi
- {\??cr#5}{\getvalue{\??cr#6}}}}
+ {\??cr#5}{\csname\??cr#6\endcsname}}}
{\showmessage\m!colors3{#5 (def)}}%
\fi}%
\ifcase#4\or
@@ -427,7 +369,7 @@
\def\paletcolorspec#1%
% {\executeifdefined{\??cr\currentpalet#1}{\executeifdefined{\??cr#1}\empty}}
- {\getvalue{\??cr\currentpalet#1}}
+ {\csname\??cr\currentpalet#1\endcsname}
%D Hex color support is not enabled by default. You need to say \setupcolor
%D [hex] to get this working.
@@ -449,6 +391,9 @@
\edef\@@cl@@n{#2}%
\getparameters[\??cl @@][#3]%
\doifnothing\@@cl@@p{\let\@@cl@@p\!!plusone}%
+ \ifx\@@cl@@e\empty \else
+ \doregisterspotcolorname{#2}\@@cl@@e
+ \fi
\doglobal\addtocommalist{#2}\allspotcolors
\setxvalue{\??cr#1}{\colorPpattern}% was \setevalue
\setgvalue{#1}{\switchtocolor[#1]}}} % was \setvalue
@@ -534,14 +479,15 @@
\processcommalist[#1]\docommand}}
\def\checkmultitonecolor#1%
- {\getvalue{\??cl#1\s!check}\letgvalue{\??cl#1\s!check}\relax}
+ {\csname\??cl#1\s!check\endcsname\letgvalue{\??cl#1\s!check}\relax}
-\def\dodefinespotcolor[#1][#2][#3]% todo: always global
+\def\dodefinespotcolor[#1][#2][#3]% todo: always global (REDEFINED)
{\doifnot{#1}{#2}
{\@@resetcolorparameters
\edef\@@cl@@n{#2}%
\getparameters[\??cl @@][#3]%
- \doifnothing\@@cl@@p{\let\@@cl@@p\!!plusone}%
+ \doifnothing \@@cl@@p{\let\@@cl@@p\!!plusone}%
+ \doifsomething\@@cl@@e{\doregisterspotcolorname{#2}\@@cl@@e}%
\doglobal\addtocommalist{#2}\allspotcolors
\setxvalue{\??cr#1}{\colorPpattern}% was \setevalue
\setgvalue{#1}{\switchtocolor[#1]}}}% was \setvalue
@@ -2174,7 +2120,7 @@
{\dodoformatcolor{#1}}
\def\doformatcolor#1:%
- {\getvalue{doformatcolor#1}}
+ {\csname doformatcolor#1\endcsname}
\def\colorvalue
{\dowithcolor\doformatcolor}
@@ -2197,7 +2143,7 @@
{\dowithcolor\doformatcolor{#1}}
\def\doformatgray#1:%
- {\getvalue{doformatgray#1}}
+ {\csname doformatgray#1\endcsname}
\def\grayvalue
{\dowithcolor\doformatgray}
@@ -2300,28 +2246,28 @@
\setevalue{\??pa\??pa#1}{#2}%
\def\dodododefinepalet[##1=##2]%
{\doifvaluesomething{\??pa#1}
- {\setevalue{\??pa#1}{\getvalue{\??pa#1},}}%
- \setevalue{\??pa#1}{\getvalue{\??pa#1}##1}%
+ {\setevalue{\??pa#1}{\csname\??pa#1\endcsname,}}%
+ \setevalue{\??pa#1}{\csname\??pa\endcsname##1}%
\doifassignmentelse{##2}
{% == \definepalet[test][xx={y=.4}]
\definecolor[\??pa#1:##1][##2]%
\iffreezecolors\@EA\setevalue\else\@EA\setvalue\fi
- {\??cr#1:##1}{\getvalue{\??cr\??pa#1:##1}}}
+ {\??cr#1:##1}{\csname\??cr\??pa#1:##1\endcsname}}
{% == \definepalet[test][xx=green]
\doifdefinedelse{\??cr##2}
{\iffreezecolors\@EA\setevalue\else\@EA\setvalue\fi
- {\??cr#1:##1}{\getvalue{\??cr##2}}}
+ {\??cr#1:##1}{\csname\??cr##2\endcsname}}
{\letvalue{\??cr#1:##1}\colorXpattern}}}%
\def\dododefinepalet##1%
{\dodododefinepalet[##1]}%
\processcommalist[#2]\dododefinepalet}
{\doifdefined{\??pa#2}
- {\expanded{\dodefinepalet[#1][\getvalue{\??pa\??pa#2}]}}}}
+ {\expanded{\dodefinepalet[#1][\csname\??pa\??pa#2\endcsname]}}}}
\let\paletsize\!!zerocount
\def\getpaletsize[#1]%
- {\getcommacommandsize[\getvalue{\??pa\??pa#1}]%
+ {\getcommacommandsize[\csname\??pa\??pa#1\endcsname]%
\edef\paletsize{\number\commalistsize}}
%D Instead of refering to colors, one can also directly specify
@@ -2408,7 +2354,7 @@
[#2]
[ \v!cmyk=>\edef\currentcolorspace{C},
\v!rgb=>\edef\currentcolorspace{R},
- \v!gray=>\edef\currentcolorspace{S},
+ \v!gray=>\edef\currentcolorspace{S},
\v!spot=>\edef\currentcolorspace{P},
\v!s=>\edef\currentcolorspace{S},
\s!unknown=>\edef\currentcolorspace{R}]%
@@ -2423,7 +2369,7 @@
{\doloop
{\doifdefinedelse{\??cr#2:\recurselevel}
{\setevalue{\??cr#1:\recurselevel}%
- {\getvalue{\??cr#2:\recurselevel}}}
+ {\csname\??cr#2:\recurselevel\endcsname}}
{\exitloop}}}%
\fi}
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index 4f332abe9..02030165c 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2006.04.23 23:55}
+\newcontextversion{2006.04.27 00:58}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
@@ -26,6 +26,22 @@
\writestatus{\m!systems}{beware: some patches loaded from cont-new.tex}
+\def\environment #1 % at outermost level only (load only once)
+ {\pushmacro\startenvironment
+ \pushmacro\stopenvironment
+ \def\startenvironment ##1 {}%
+ \let\stopenvironment\relax
+ \startreadingfile
+ \doexecutefileonce{#1}
+ \stopreadingfile
+ \popmacro\startenvironment
+ \popmacro\stopenvironment}
+
+\def\singlewidened #1{\hbox spread 1em{\hss#1\hss}}
+\def\complexwidened[#1]#2{\hbox spread #1{\hss#2\hss}}
+
+\definecomplexorsimple\widened
+
% todo
%
% \def\definelocation{\dodoubleargument\dodefinelocation}
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex
index b2c5f6c25..1f2d5043c 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -31,7 +31,7 @@
%D 2004.8.30 the low level interface is english. Watch out and adapt
%D your styles an modules.
-\def\contextversion{2006.04.23 23:55}
+\def\contextversion{2006.04.27 00:58}
%D For those who want to use this:
diff --git a/tex/context/base/core-job.tex b/tex/context/base/core-job.tex
index 7a950fc95..5e129caae 100644
--- a/tex/context/base/core-job.tex
+++ b/tex/context/base/core-job.tex
@@ -352,7 +352,7 @@
\def\donextlevel#1#2#3#4#5#6#7\\%
{\pushmacro\currentcomponent
- \let\currentcomponent#1
+ \let\currentcomponent#1%
\setsystemmode\currentcomponent
\beforesplitstring#7\at.\to#2\relax
\ifcase\filelevel\relax
diff --git a/tex/context/base/core-lst.tex b/tex/context/base/core-lst.tex
index d3a5ebdb4..e63212575 100644
--- a/tex/context/base/core-lst.tex
+++ b/tex/context/base/core-lst.tex
@@ -282,7 +282,7 @@
\dosetlistmode
\endgroup}
-% the simple appreach:
+% the simple approach:
%
% \def\dosettoclevel#1#2%
% {\dosetfilterlevel{\getvalue{#1#2\c!criterium}}\empty}
diff --git a/tex/context/base/core-mat.tex b/tex/context/base/core-mat.tex
index 8624396cc..c3edf584e 100644
--- a/tex/context/base/core-mat.tex
+++ b/tex/context/base/core-mat.tex
@@ -2071,7 +2071,7 @@
\edef\currentmathcases{#1}%
\doifassignmentelse{#2}{\setupmathcases[#1][#2]}\donothing
\mathcasesparameter\c!left
- \ruledvcenter\bgroup
+ \vcenter\bgroup
\pushmacro\docasesNC
\let\endmath\relax
\def\NC{\docasesNC}%
diff --git a/tex/context/base/core-not.tex b/tex/context/base/core-not.tex
index 410df6e47..6ab983ec1 100644
--- a/tex/context/base/core-not.tex
+++ b/tex/context/base/core-not.tex
@@ -446,14 +446,14 @@
\def\settextnotes
{\def\startpushnote {\startvboxtohbox
+ \edef\@@defaultnotedefloc{\ifnum\noteparameter\c!n=\zerocount\v!serried\else\v!inleft \fi}%
+ \edef\@@defaultnotedefdis{\ifnum\noteparameter\c!n=\zerocount .5em\else\!!zeropoint\fi}%
\startnotedef}%
\def\stoppushnote {\stopnotedef
\hskip\noteparameter\c!columndistance % plus.5em minus.5em
\stopvboxtohbox}%
\def\startpopnotes {\vbox\bgroup
% here, else problems in preroll
- \edef\@@defaultnotedefloc{\ifnum\noteparameter\c!n=\zerocount\v!serried\else\v!inleft \fi}%
- \edef\@@defaultnotedefdis{\ifnum\noteparameter\c!n=\zerocount .5em\else\!!zeropoint\fi}%
\doifnotinset{\noteparameter\c!width}{\v!fit,\v!broad}\setnotehsize
\beginofshapebox}%
\def\stoppopnotes {\endofshapebox
diff --git a/tex/context/base/core-ref.tex b/tex/context/base/core-ref.tex
index 7306987bb..4d31bf3a0 100644
--- a/tex/context/base/core-ref.tex
+++ b/tex/context/base/core-ref.tex
@@ -615,10 +615,47 @@
\def\currentfolioreference{0}
+% \def\dogetreferenceelements#1#2#3#4#5%
+% {\chardef\currentreferencetype=\ifx#1\relax0\else#1\fi\relax
+% \ifnum\currentreferencetype<2
+% \edef\currentpagereference{#2}%
+% \ifx\currentpagereference \empty
+% \let\currentfolioreference\folio
+% \else
+% \def \currentpagereference {\referencepagenumber[#2]}%
+% \edef\currentfolioreference{\dosplitofffoliopart[#2]}%
+% \fi
+% \edef\currentrealreference{#3}%
+% \settextreferences#4\end
+% \ifnum0#5<\crossreferencenumber
+% \forwardreferencetrue
+% \else
+% \forwardreferencefalse
+% \fi
+% \else
+% \edef\currentrealreference {#3}%
+% \def \currentdatareference {#2}%
+% \let \currentfolioreference\folio
+% \settextreferences#4\end
+% \forwardreferencefalse
+% \fi
+% \ifodd\currentreferencetype
+% \realreferencepagefalse
+% \else
+% \docheckrealreferencepage\currentrealreference
+% \ifrealreferencepage \else
+% \docheckrealreferencepage\currentdatareference
+% \fi
+% \fi}
+
+\let\currentlocationreference\empty
+
\def\dogetreferenceelements#1#2#3#4#5%
{\chardef\currentreferencetype=\ifx#1\relax0\else#1\fi\relax
- \ifnum\currentreferencetype<2
+ \ifnum\currentreferencetype<\plustwo
\edef\currentpagereference{#2}%
+ \let \currentdatareference\empty
+ \edef\currentlocationreference{#2}%
\ifx\currentpagereference \empty
\let\currentfolioreference\folio
\else
@@ -633,6 +670,7 @@
\forwardreferencefalse
\fi
\else
+ \let \currentlocationreference\empty
\edef\currentrealreference {#3}%
\def \currentdatareference {#2}%
\let \currentfolioreference\folio
@@ -1369,7 +1407,7 @@
% \egroup
% \doresetgotowhereever} % to prevent problems with direct goto's
-\def\doifreferencefoundelse#1#2#3% REF \cs
+\def\doifreferencefoundelse#1#2#3% REF \cs / never more than one group (else \aftergroup usage problems)
{\checkreferences
% first we collect the secondary ones
\bgroup
diff --git a/tex/context/base/core-sec.tex b/tex/context/base/core-sec.tex
index 446eab57e..63a5254cf 100644
--- a/tex/context/base/core-sec.tex
+++ b/tex/context/base/core-sec.tex
@@ -571,8 +571,13 @@
\fi}%
\dobacktrackcommando\lastsection}}
+% \def\ignoresectionconversion % brrr
+% {\let\@@sectionconversion\secondoftwoarguments}
+
\def\dosetfilterlevel#1#2% beware: this one is \let
{\bgroup
+ \let\@@shortsectionnumber\@@sectionvalue
+% \ignoresectionconversion
\edef\askedlevel{#1}%
\edef\askedfilter{#2}%
\ifx\askedlevel\v!current
diff --git a/tex/context/base/core-syn.tex b/tex/context/base/core-syn.tex
index ac48b38f2..9c291f156 100644
--- a/tex/context/base/core-syn.tex
+++ b/tex/context/base/core-syn.tex
@@ -251,11 +251,23 @@
\endgroup
\ifutilitydone\else\nowhitespace\fi}
+% to be tested
+%
+% \def\doplacelistofsorts#1% NOG EEN RUWE VERSIE MAKEN
+% {\startpacked
+% \doutilities{#1}\jobname{#1}\relax\par
+% \stoppacked}
+
\def\docompletelistofsorts#1#2%
{\expanded{\systemsuppliedchapter[#1]{\noexpand\headtext{#2}}}%
\doplacelistofsorts{#1}%
\page[\v!yes]}
+% todo:
+%
+% \def\placelistofsorts[#1]%
+% {\doplacelistofsorts{#1}}
+
\def\processsort#1#2#3%
{\explicithmode
\begingroup % was \bgroup
diff --git a/tex/context/base/font-ini.tex b/tex/context/base/font-ini.tex
index 782e9cd9c..1dc28a250 100644
--- a/tex/context/base/font-ini.tex
+++ b/tex/context/base/font-ini.tex
@@ -2850,8 +2850,8 @@
\fi}%
\chardef\currentxfontsize\zerocount}
-\def\dodosetfont#1#2% #1 = set/switch state
- {\dododosetfont{#1}{#2}{\showmessage\m!fonts4{#2}}}
+\def\dodosetfont#1#2% #1 = set/switch state | check fo rempty, else space
+ {\doifsomething{#2}{\dododosetfont{#1}{#2}{\showmessage\m!fonts4{#2}}}}
\def\dododosetfont#1#2#3% #1 = set/switch state
{\doifnumberelse{#2}
@@ -3619,8 +3619,7 @@
%D because \PLAIN\ \TEX\ is english anyway.
\def\dodefinebodyfontswitch[#1][#2]%
- {\def\docommando##1%
- {\setvalue{##1}{\switchtobodyfont[#2]}}%
+ {\def\docommando##1{\setvalue{##1}{\switchtobodyfont[#2]}}%
\processcommalist[#1]\docommando}
\def\definebodyfontswitch
diff --git a/tex/context/base/hand-ini.tex b/tex/context/base/hand-ini.tex
index 44fcf2973..e11e3da1a 100644
--- a/tex/context/base/hand-ini.tex
+++ b/tex/context/base/hand-ini.tex
@@ -208,15 +208,15 @@
\def\dosetfontadjusting#1%
{\iftracefonthandling\showfontadjusting{#1}\fi
\pdffontexpand\handledfont
- \csname\@fha@\@fha@#1\c!min \endcsname\space
\csname\@fha@\@fha@#1\c!max \endcsname\space
+ \csname\@fha@\@fha@#1\c!min \endcsname\space
\csname\@fha@\@fha@#1\c!step\endcsname\space
\@@pdfexpandbonus\relax}
\def\showfontadjusting#1%
{\writestatus\m!handlings{[adjust]\space#1\space
- \csname\@fha@\@fha@#1\c!min \endcsname/%
\csname\@fha@\@fha@#1\c!max \endcsname/%
+ \csname\@fha@\@fha@#1\c!min \endcsname/%
\csname\@fha@\@fha@#1\c!step\endcsname\space
\fontname\handledfont}}
\fi
diff --git a/tex/context/base/lang-ita.tex b/tex/context/base/lang-ita.tex
index cc2f8af93..776078118 100644
--- a/tex/context/base/lang-ita.tex
+++ b/tex/context/base/lang-ita.tex
@@ -162,7 +162,7 @@
\setupheadtext [\s!pt] [\v!content=Conte\'udo]
\setupheadtext [\s!ro] [\v!content=Cuprins]
-\setupheadtext [\s!fr] [\v!tables=Tables]
+\setupheadtext [\s!fr] [\v!tables=Tableaux]
\setupheadtext [\s!es] [\v!tables=Tablas]
\setupheadtext [\s!ca] [\v!tables=Taules]
\setupheadtext [\s!it] [\v!tables=Tabelle]
@@ -226,7 +226,7 @@
\setupheadtext [\s!pt] [\v!units=Unidades]
\setupheadtext [\s!ro] [\v!units=Unit\u{a}\c{t}i]
-\setuplabeltext [\s!fr] [\v!table=Table ]
+\setuplabeltext [\s!fr] [\v!table=Tableau ]
\setuplabeltext [\s!es] [\v!table=Tablas ]
\setuplabeltext [\s!ca] [\v!table=Taules ]
\setuplabeltext [\s!it] [\v!table=Tabella ]
diff --git a/tex/context/base/m-database.tex b/tex/context/base/m-database.tex
new file mode 100644
index 000000000..a657e38c3
--- /dev/null
+++ b/tex/context/base/m-database.tex
@@ -0,0 +1,287 @@
+%D \module
+%D [ file=m-database,
+%D version=2006.04.23,
+%D title=\CONTEXT\ Modules,
+%D subtitle=Database Thingies,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA
+
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+
+\unprotect
+
+% % % to be added to mult-* files
+%
+% % % todo: \dontcollectseparatedlist via k/v
+
+\definesystemvariable{ls}
+\def\c!first{first}
+\def\c!last {last}
+
+% % % so far
+
+% \long\def\processseplist#1#2#3\end
+% {\def\doprocessseplist####1####2\end
+% {\ifx\end####1%
+% \expandafter\gobbleoneargument
+% \else
+% #2{####1####2}%
+% \fi
+% \doprocessseplist}%
+% \dodoprocessseplist#3\end}
+
+\def\dodefineprocessseplist#1#2% separator \docommand
+ {\def\dodoprocessseplist##1##2#1%
+ {\ifx\relax##1%
+ \expandafter\nodoprocessseplist
+ \else\ifx##1#1%
+ #2{}%
+ #2{##2}%
+ \expandafter\expandafter\expandafter\dodoprocessseplist
+ \else
+ #2{##1##2}%
+ \expandafter\expandafter\expandafter\dodoprocessseplist
+ \fi\fi}%
+ \def\doprocessseplist##1\relax
+ {\dodoprocessseplist##1#1\relax#1\relax\relax\end}}
+
+\def\nodoprocessseplist#1\end
+ {}
+
+\long\def\processseplist#1#2#3\relax
+ {\dodefineprocessseplist{#1}{#2}%
+ \dodoprocessseplist#3#1\relax#1\relax\relax\end}
+
+% \dodefineprocessseplist{,}\test
+% \dodoprocessseplist{,}a,b,c\relax,\relax\relax\end
+% \doprocessseplista,b,c\relax
+
+% \def\test#1{[#1]}
+% \startlines
+% \processseplist{,}\test ,2,,\relax
+% \processseplist{,}\test ,,,44\relax
+% \processseplist{,}\test ,,33,44\relax
+% \processseplist{,}\test 11,,33,44\relax
+% \processseplist{,}\test 1,2,3,4\relax
+% \stoplines
+
+\newtoks\separatedlistdata
+
+\def\appendseparatedlistparameter#1%
+ {\@EAEAEA\appendtoks\csname\??ls\currentseparatedlist#1\endcsname\to\separatedlistdata}
+
+\def\appendseparatedlistcontent#1%
+ {\appendtoks#1\to\separatedlistdata}
+
+\def\flushseparatedlistdata
+ {\the\separatedlistdata
+ \separatedlistdata\emptytoks}
+
+\def\initializeseparatedlistdata
+ {\separatedlistdata{\egroup}}
+
+\def\dontcollectseparatedlist
+ {\def\dodoprocessseparatedfileline
+ {\the\separatedlistdata
+ \separatedlistdata\emptytoks
+ \doprocessseparatedfileline}%
+ \def\dodoprocessseparatedline
+ {\the\separatedlistdata
+ \separatedlistdata\emptytoks
+ \doprocessseparatedline}%
+ \let\flushseparatedlistdata\egroup
+ \let\initializeseparatedlistdata\donothing}
+
+\chardef\separatedlistmode\zerocount
+
+\bgroup \obeylines
+
+\gdef\doprocessseparatedfileline%
+ {\ifeof\scratchread%
+ \ifcase\separatedlistmode\appendseparatedlistparameter\c!after\fi%
+ \immediate\closein\scratchread%
+ \expandafter\flushseparatedlistdata%
+ \else\ifx\line\empty%
+ % skip, can be comment
+ \read\scratchread to\line%
+ \@EA\dodoprocessseparatedfileline%
+ \else
+ \appendseparatedlistparameter{\ifcase\separatedlistmode\c!first\else\c!command\fi}%
+ \expandafter\doprocessseplist\line\relax%
+ \ifcase\separatedlistmode\appendseparatedlistparameter\c!last\fi%
+ \read\scratchread to\line%
+ \@EAEAEA\dodoprocessseparatedfileline%
+ \fi\fi}
+
+\gdef\dodoprocessseparatedfileline%
+ {\doprocessseparatedfileline}
+
+\gdef\doprocessseparatedfile[#1][#2]%
+ {\bgroup%
+ \edef\currentseparatedlist{#1}%
+ \doifdefined{\??ls\currentseparatedlist\c!command}{\chardef\separatedlistmode\plusone}%
+ \edef\currentlistseparator{\csname\??ls\currentseparatedlist\c!separator\endcsname}%
+ \ifx\currentlistseparator\empty\def\currentlistseparator{,}\fi%
+ \expandafter\dodefineprocessseplist\expandafter{\currentlistseparator}\doprocessseparateditem%
+ \initializeseparatedlistdata%
+ \directsetup{\currentseparatedlist:\executeifdefined{\??ls\currentseparatedlist\c!setups}\s!default}%
+ \ifcase\separatedlistmode\appendseparatedlistparameter\c!before\fi%
+ \endlinechar\minusone%
+ \ignorelines%
+ \catcode`\#\@@comment
+ \immediate\openin\scratchread=#2\relax% todo: \doopenin
+ \read\scratchread to\line%
+ \doprocessseparatedfileline}
+
+\gdef\dostartseparatedlist#1[#2]%
+ {\bgroup%
+ \edef\currentseparatedlist{#2}%
+ \doifdefined{\??ls\currentseparatedlist\c!command}{\chardef\separatedlistmode\plusone}%
+ \obeylines%
+ \let#1\relax%
+ \def\separateslistend{#1}%
+ \edef\currentlistseparator{\csname\??ls\currentseparatedlist\c!separator\endcsname}%
+ \ifx\currentlistseparator\empty\def\currentlistseparator{,}\fi%
+ \expandafter\dodefineprocessseplist\expandafter{\currentlistseparator}\doprocessseparateditem%
+ \directsetup{\currentseparatedlist:\executeifdefined{\??ls\currentseparatedlist\c!setups}\s!default}%
+ \initializeseparatedlistdata%
+ \ifcase\separatedlistmode\appendseparatedlistparameter\c!before\fi%
+ \dodostartseparatedlist}
+
+\gdef\dodostartseparatedlist#1
+ {\doprocessseparatedline}
+
+\gdef\doprocessseparatedline#1
+ {\def\!!stringa{#1}%
+ \ifx\!!stringa\separateslistend%
+ \ifcase\separatedlistmode\appendseparatedlistparameter\c!after\fi%
+ \expandafter\flushseparatedlistdata%
+ \else%
+ \appendseparatedlistparameter{\ifcase\separatedlistmode\c!first\else\c!command\fi}%
+ \expandafter\doprocessseplist#1\relax%
+ \ifcase\separatedlistmode\appendseparatedlistparameter\c!last\fi%
+ \expandafter\dodoprocessseparatedline%
+ \fi}
+
+\gdef\dodoprocessseparatedline%
+ {\doprocessseparatedline}
+
+\gdef\doprocessseparateditem#1%
+ {\ifcase\separatedlistmode
+ \appendseparatedlistparameter\c!left%
+ \appendseparatedlistcontent{#1}%
+ \appendseparatedlistparameter\c!right
+ \else
+ \appendseparatedlistcontent{{#1}}%
+ \fi}
+
+\egroup
+
+\startsetups CVS:unix
+ \catcode`\#=\@@comment
+\stopsetups
+
+\def\defineseparatedlist
+ {\dodoubleempty\dodefineseparatedlist}
+
+\def\dodefineseparatedlist[#1][#2]%
+ {\setvalue{\e!start#1}{\expandafter\dostartseparatedlist\csname\e!stop#1\endcsname[#1]}%
+ \getparameters
+ [\??ls#1]
+ [\c!separator=,
+ \c!first=,
+ \c!left=,
+ \c!before=,
+ \c!right=,
+ \c!last=,
+ \c!after=,
+% \c!command=,
+ #2]}
+
+\def\startseparatedlist[#1]%
+ {\dostartseparatedlist\stopseparatedlist[#1]}
+
+\def\processseparatedfile
+ {\dodoubleargument\doprocessseparatedfile}
+
+\protect \endinput
+
+\defineseparatedlist
+ [CVS]
+ [separator={,},
+ first=\bTR,last=\eTR,
+ left=\bTD,right=\eTD,
+ before=\bTABLE,after=\eTABLE]
+
+\startseparatedlist[CVS]
+a,b,c
+d,e,f
+\stopseparatedlist
+
+\startCVS
+a,b,c
+d,e,f
+\stopCVS
+
+\defineseparatedlist
+ [CVS]
+ [separator={,},
+ first=\NC,last=\NR,
+ left=,right=\NC,
+ before={\starttabulate[|l|l|l|]},after=\stoptabulate]
+
+\startCVS
+a,b,c
+d,e,f
+\stopCVS
+
+\defineseparatedlist
+ [CVS]
+ [separator={ },
+ first=\NC,last=\NR,
+ left=,right=\NC,
+ before={\starttabulate[|l|l|l|]},after=\stoptabulate]
+
+\startCVS
+a b c
+d e f
+\stopCVS
+
+\defineseparatedlist
+ [CVS]
+ [setups=unix,
+ first=\NC,last=\NR,
+ left=,right=\NC,
+ before={\starttabulate[|l|l|l|]},after=\stoptabulate]
+
+% \startsetups CVS:unix
+% \catcode`\#=\@@comment
+% \stopsetups
+
+% %1,2,3
+% 1,2,3
+% # 4,5,6
+% 4,5,6
+
+\processseparatedfile[CVS][test.dat]
+
+\defineseparatedlist
+ [CVSX]
+ [command=\Whatever,
+ separator={,},
+ first=\bTR,last=\eTR,
+ left=\bTD,right=\eTD,
+ before=\bTABLE,after=\eTABLE]
+
+\def\Whatever#1#2#3{[#1][#2][#3]\endgraf}
+
+\startseparatedlist[CVSX]
+a,b,c
+d,e,f
+\stopseparatedlist
+
+\stoptext
diff --git a/tex/context/base/m-streams.tex b/tex/context/base/m-streams.tex
index d465c390a..fd93f2655 100644
--- a/tex/context/base/m-streams.tex
+++ b/tex/context/base/m-streams.tex
@@ -374,6 +374,8 @@
\starttext
+% \definestreamlayer[block]
+%
% \startstreamlayer[block]
% \title{Sample \recurselevel}
% \startcolumns
diff --git a/tex/context/base/page-flt.tex b/tex/context/base/page-flt.tex
index 18ea5113a..3b9396d28 100644
--- a/tex/context/base/page-flt.tex
+++ b/tex/context/base/page-flt.tex
@@ -1055,18 +1055,18 @@
% \goodbreak}%
% \doinsertfloatinfo}
-\def\OTRONEsomepagefloat[#1]%
- {%\checkwaitingfloats{#1}%
- \global\setbox\collectedpagefloats\vbox
- {\ifvoid\collectedpagefloats\else\unvbox\collectedpagefloats\fi
- \vbox to \textheight % vss and unvbox catch too high and limited floats
- {\vss
- \doifnotinset\v!high{#1}\vfill
- \unvbox\floatbox
- \doifnotinset\v!low{#1}\vfill
- \vss}%
- \goodbreak}%
- \doinsertfloatinfo}
+% \def\OTRONEsomepagefloat[#1]%
+% {%\checkwaitingfloats{#1}%
+% \global\setbox\collectedpagefloats\vbox
+% {\ifvoid\collectedpagefloats\else\unvbox\collectedpagefloats\fi
+% \vbox to \textheight % vss and unvbox catch too high and limited floats
+% {\vss
+% \doifnotinset\v!high{#1}\vfill
+% \unvbox\floatbox
+% \doifnotinset\v!low{#1}\vfill
+% \vss}%
+% \goodbreak}%
+% \doinsertfloatinfo}
% test case:
%
@@ -2132,14 +2132,35 @@
% \ifinpostponing: handhaven, want gebruikt in stijlen ! ! ! ! !
+\def\flushpagefloats
+ {\doifoddpageelse
+ {\ifvoid\collectedleftpagefloats
+ \ifvoid\collectedrightpagefloats\else
+ \unvbox\collectedrightpagefloats
+ \page
+ %\the\everytopofpage
+ \fi
+ \fi}
+ {\ifvoid\collectedleftpagefloats\else
+ \unvbox\collectedleftpagefloats
+ \page
+ %\the\everytopofpage
+ \fi
+ \ifvoid\collectedrightpagefloats\else
+ \unvbox\collectedrightpagefloats
+ \page
+ %\the\everytopofpage
+ \fi}%
+ \ifvoid\collectedpagefloats\else
+ % message
+ \unvbox\collectedpagefloats
+ \fi}
+
\def\dopostponeblock
{\bgroup % new may 2004
\setsystemmode\v!postponing % new may 2004
\the\everytopofpage
- \ifvoid\collectedpagefloats\else
- % message
- \unvbox\collectedpagefloats
- \fi
+ \flushpagefloats
\donefalse
\ifinpostponing \else
\ifcase\nofpostponedblocks \else \donetrue \fi
@@ -2393,6 +2414,8 @@
\installfloathandler \v!margin \somemarginfloat
\installfloathandler \v!opposite \somefacefloat
\installfloathandler \v!page \somepagefloat
+\installfloathandler \v!leftpage \someleftpagefloat
+\installfloathandler \v!rightpage \somerightpagefloat
\installfloathandler \v!inmargin \someinmarginfloat
\installfloathandler \v!inleft \someinleftmarginfloat
\installfloathandler \v!inright \someinrightmarginfloat
@@ -2415,14 +2438,16 @@
\installfloathandler {fxtb} \someslotfloat
\installfloathandler {fxbt} \someslotfloat
-\def\placesomeslotfloat {\OTRcommand\someslotfloat}
-\def\placesomeherefloat {\OTRcommand\someherefloat}
-\def\placesomefixdfloat {\OTRcommand\somefixdfloat}
-\def\placesomepagefloat {\OTRcommand\somepagefloat}
-\def\placesometopsfloat {\OTRcommand\sometopsfloat}
-\def\placesomebotsfloat {\OTRcommand\somebotsfloat}
-\def\placesomesidefloat {\OTRcommand\somesidefloat}
-\def\placesomefacefloat {\OTRcommand\somefacefloat}
+\def\placesomeslotfloat {\OTRcommand\someslotfloat}
+\def\placesomeherefloat {\OTRcommand\someherefloat}
+\def\placesomefixdfloat {\OTRcommand\somefixdfloat}
+\def\placesomepagefloat {\OTRcommand\somepagefloat}
+\def\placesomeleftpagefloat {\OTRcommand\someleftpagefloat}
+\def\placesomerightpagefloat{\OTRcommand\somerightpagefloat}
+\def\placesometopsfloat {\OTRcommand\sometopsfloat}
+\def\placesomebotsfloat {\OTRcommand\somebotsfloat}
+\def\placesomesidefloat {\OTRcommand\somesidefloat}
+\def\placesomefacefloat {\OTRcommand\somefacefloat}
\def\someleftsidefloat [#1]{\somesidefloat[#1]\presetindentation}
\def\somerightsidefloat [#1]{\somesidefloat[#1]}
@@ -2440,9 +2465,11 @@
\def\somebackspacefloat [#1]{\somesidefloat[#1]}
\def\somecutspacefloat [#1]{\somesidefloat[#1]}
-\def\somefixdfloat {\placesomefixdfloat}
-\def\somepagefloat {\placesomepagefloat}
-\def\somefacefloat {\placesomefacefloat}
-\def\someslotfloat {\placesomeslotfloat}
+\def\somefixdfloat {\placesomefixdfloat}
+\def\somepagefloat {\placesomepagefloat}
+\def\someleftpagefloat {\placesomeleftpagefloat}
+\def\somerightpagefloat{\placesomerightpagefloat}
+\def\somefacefloat {\placesomefacefloat}
+\def\someslotfloat {\placesomeslotfloat}
\protect \endinput
diff --git a/tex/context/base/page-ini.tex b/tex/context/base/page-ini.tex
index c41019232..5184df72a 100644
--- a/tex/context/base/page-ini.tex
+++ b/tex/context/base/page-ini.tex
@@ -922,6 +922,8 @@
\newif\ifpackcolumnfloats \packcolumnfloatstrue
\newbox\collectedpagefloats
+\newbox\collectedleftpagefloats
+\newbox\collectedrightpagefloats
%D The \type {\ifdim} test is needed, because otherwise the
%D last line of a text end up on top of the baseline instead of
diff --git a/tex/context/base/page-one.tex b/tex/context/base/page-one.tex
index df92c1f03..a52196c59 100644
--- a/tex/context/base/page-one.tex
+++ b/tex/context/base/page-one.tex
@@ -586,17 +586,21 @@
\doifinset\v!tall{#1}\flushsidefloatsafterpar
\fi}
-\def\OTRONEsomepagefloat[#1]%
+\def\OTRONEdosomepagefloat#1[#2]%
{%\checkwaitingfloats{#1}%
- \global\setbox\collectedpagefloats\vbox
- {\unvbox\collectedpagefloats
+ \global\setbox#1\vbox
+ {\unvbox#1%
\vbox to \textheight
- {\doifnotinset\v!high{#1}\vfill
+ {\doifnotinset\v!high{#2}\vfill
\box\floatbox
- \doifnotinset\v!low{#1}\vfill}%
+ \doifnotinset\v!low{#2}\vfill}%
\goodbreak}%
\doinsertfloatinfo}
+\def\OTRONEsomepagefloat {\OTRONEdosomepagefloat\collectedpagefloats}
+\def\OTRONEsomeleftpagefloat {\OTRONEdosomepagefloat\collectedleftpagefloats}
+\def\OTRONEsomerightpagefloat{\OTRONEdosomepagefloat\collectedrightpagefloats}
+
\def\OTRONEsometopsfloat[#1]%
{\ifdim\topinserted=\zeropoint
\topofinserttrue
diff --git a/tex/context/base/prop-lay.tex b/tex/context/base/prop-lay.tex
index a5f43dc13..0e5038d19 100644
--- a/tex/context/base/prop-lay.tex
+++ b/tex/context/base/prop-lay.tex
@@ -27,8 +27,8 @@
\def\checklayerproperty
{\doifelse{\checkedpropertyparameter\v!printable\currentproperty}\v!no
- {\def\printviewerlayer{0}}%
- {\def\printviewerlayer{1}}
+ {\def\printviewerlayer{0}}
+ {\def\printviewerlayer{1}}%
\dodefineviewerlayer
\currentproperty % tag
{\checkedpropertyparameter\c!title\currentproperty}%
diff --git a/tex/context/base/s-pre-30.tex b/tex/context/base/s-pre-30.tex
new file mode 100644
index 000000000..2f983e51b
--- /dev/null
+++ b/tex/context/base/s-pre-30.tex
@@ -0,0 +1,245 @@
+%D \module
+%D [ file=s-pre-30,
+%D version=2006.04.25,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Presentation Environment 30,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\usemodule[streams]
+
+\setuppapersize
+ [S6] [S6]
+
+\setupbodyfont
+ [12pt,tt]
+
+\definemeasure[bleed][6pt]
+
+\definecolor[maincolor-3][r=.5,g=.2,b=.2]
+\definecolor[maincolor-1][r=.2,g=.5,b=.2]
+\definecolor[maincolor-2][r=.2,g=.2,b=.5]
+
+\definecolor[pagecolor] [s=.5]
+\definecolor[resultcolor][s=1,t=.85,a=1]
+\definecolor[maincolor] [maincolor-3]
+
+\definecolorgroup
+ [maingroup]
+ [.5:.2:.2,
+ .2:.5:.2,
+ .2:.2:.5]
+
+\definecolorgroup
+ [resultgroup]
+ [1:.85:.85,
+ .85:1:.85,
+ .85:.85:1]
+
+\def\CurrentColor{1}
+
+\definecolor[maincolor] [maingroup:\CurrentColor]
+\definecolor[resultcolor][resultgroup:\CurrentColor]
+
+\def\NextColor{\ifnum\CurrentColor=3 \def\CurrentColor{1}\else\doglobal\increment\CurrentColor\fi}
+
+\setuplayout
+ [backspace=\measure{bleed},
+ topspace=30pt,
+ bottomdistance=\measure{bleed},
+ bottom=\dimexpr30pt-\measure{bleed}\relax,
+ header=0pt,
+ footer=0pt,
+ topdistance=\measure{bleed},
+ top=\dimexpr30pt-\measure{bleed}\relax,
+ width=middle,
+ height=middle]
+
+\setuptop
+ [before=\vfill,
+ after=\vfill,
+ strut=yes]
+
+\setupbackgrounds
+ [text]
+ [backgroundoffset=\measure{bleed},
+ background=color,
+ backgroundcolor=maincolor]
+
+\setupbackgrounds
+ [page]
+ [background=color,
+ backgroundcolor=pagecolor]
+
+\setupcolors
+ [state=start,
+ textcolor=white]
+
+\setuphead
+ [chapter]
+ [style=\ttd]
+
+\setuphead
+ [section]
+ [style=\ttd]
+
+\defineproperty
+ [result]
+ [layer]
+ [state=stop]
+
+\definelayer
+ [result]
+
+\setuplayer
+ [result]
+ [width=\textwidth,
+ height=\textheight]
+
+\setupbackgrounds
+ [text]
+ [background={color,toggle,foreground,result}]
+
+\setupinteraction
+ [state=start,
+ click=no,
+ menu=on,
+ color=white,
+ contrastcolor=white,
+ closepageaction=HideLayer{result},
+ openpageaction=HideLayer{result}]
+
+% We add a dummy color switch so that each page has at least one
+% transparency; else acrobat will render the pages differently
+% bug in 6 and 7).
+
+\startinteractionmenu[bottom]
+% \color[resultcolor]{ }%
+ \hfill
+ \got [content] content \\
+ \got [previouspage] previous \\
+ \got [nextpage] next \\
+ \got [ToggleLayer{result}] result \\
+ \got [CloseDocument] close \\
+\stopinteractionmenu
+
+\setuphead
+ [section]
+ [placehead=no,
+ incrementnumber=list]
+
+\setuplist
+ [section]
+ [alternative=f]
+
+\defineoverlay
+ [toggle]
+ [\overlaybutton{ToggleLayer{result}}]
+
+\definestreamlayer
+ [resultstream]
+
+\startsetups streamlayer:resultstream:flush
+ \setlayer
+ [result]
+ [preset=middlebottom,
+ hoffset=\measure{bleed},
+% voffset=-\measure{bleed}]
+ voffset=\measure{bleed}]
+ {\startproperty[result]%
+% \framed
+% [offset=overlay,
+% frame=off,
+% background=color,
+% backgroundoffset=1\dimexpr\measure{bleed}\relax,
+% backgroundcolor=maincolor]
+ {\framed
+ [offset=overlay,
+ frame=off,
+ foregroundcolor=maincolor,
+ background=color,
+ backgroundoffset=1\dimexpr\measure{bleed}\relax,
+ backgroundcolor=resultcolor]
+ {\tightlayer[\currentstreamlayer]}}
+ \stopproperty}
+\stopsetups
+
+\startsetups show-definition
+ \subject{definition}
+ \typebuffer
+ \getbuffer
+ \page
+\stopsetups
+
+\startsetups show-result
+ \startstreamlayer[resultstream]
+ \subject{result}
+ \getbuffer
+ \stopstreamlayer
+ \placestreamlayer[resultstream]
+ \page
+\stopsetups
+
+\startsetups show-usage
+ \subject{usage}
+ \typebuffer
+ \startstreamlayer[resultstream]
+ \subject{result}
+ \getbuffer
+ \stopstreamlayer
+ \placestreamlayer[resultstream]
+ \page
+\stopsetups
+
+\startsetups show-contents
+ \startcolumns[n=3]
+ \placelist[section][criterium=text]
+ \stopcolumns
+ \pagereference[content]
+ \page
+ \NextColor
+\stopsetups
+
+\def\TitlePage#1%
+ {\title{#1}
+ \setups{show-contents}}
+
+\def\StartSample#1%
+ {\starttext
+ \page
+ \section{#1}
+ \setuptoptexts[][\processedfile\enspace:\enspace\lowercase{#1}]}
+
+\def\StopSample
+ {\page
+ \setuptoptexts[][]
+ \stoptext
+ \NextColor}
+
+\endinput
+
+\usemodule[pre-30]
+
+% \TitlePage{Howling to the moon}
+
+\StartSample{Basics}
+
+\startbuffer
+\lua{a = 1.5 ; b = 1.8 ; c = a*b ; tex.print(c) ;}
+
+\startlua
+ a = 1
+ b = 2
+ c = a*b
+ tex.print(c)
+\stoplua
+\stopbuffer
+
+\setups{show-usage}
+
+\StopSample
diff --git a/tex/context/base/syst-ext.tex b/tex/context/base/syst-ext.tex
index b903a2778..55b1c5687 100644
--- a/tex/context/base/syst-ext.tex
+++ b/tex/context/base/syst-ext.tex
@@ -3777,18 +3777,16 @@
%D \processlist(){=>}\docommando(a=>b=>c=>d)
%D \stoptyping
-\long\def\processlist#1#2#3#4%
+\long\def\processlist#1#2#3#4% no blank skipping !
{\def\doprocesslist##1#2%
{\def\dodoprocesslist####1####2#3%
{\ifx#2####1%
\let\dodoprocesslist\relax
\else\ifx#2####2%
\let\dodoprocesslist\relax
- \else\ifx\blankspace####2%
- #4{####1}%
\else
#4{####1####2}%
- \fi\fi\fi
+ \fi\fi
\dodoprocesslist}%
\expandafter\dodoprocesslist\gobbleoneargument##1#3#2#3}%
\def\dodoprocesslist#1%
diff --git a/tex/context/base/syst-gen.tex b/tex/context/base/syst-gen.tex
index e249325b9..eea5351b8 100644
--- a/tex/context/base/syst-gen.tex
+++ b/tex/context/base/syst-gen.tex
@@ -2539,7 +2539,7 @@
%D Even more important is that this alternative is fully
%D expandable!
-\long\def\doifnumberelse#1%
+\long\def\doifnumberelse#1% does not accept counters
{\ifcase0\ifcase1#1\or\or\or\or\or\or\or\or\or\else1\fi\space
\expandafter\secondoftwoarguments
\else
diff --git a/tex/context/base/x-om2cml.xsl b/tex/context/base/x-om2cml.xsl
new file mode 100644
index 000000000..06f7442c8
--- /dev/null
+++ b/tex/context/base/x-om2cml.xsl
@@ -0,0 +1,1250 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ This style sheet is used in the Math4All project. This project
+ will provide an on-line math method for secondary and tertiary
+ education. In addition to the web-bases content the project
+ provides high quality typeset output as well.
+
+ This stylesheet is a copy of the one used by the group of Arjeh
+ Cohen (TU Eindhoven). This steet has multiple authors: David
+ Carlisle, and Clare M. So and Hans Cuypers (also see notice
+ below.)
+
+ In due time we may extend this sheet with options needed for the
+ project (alternative rendering, additional dictionaries).
+
+ Hans Hagen, PRAGMA ADE, Hasselt NL / 2006-04-14
+
+-->
+
+<!-- ********************************************************** -->
+<!-- XSL Transform of OpenMath to Content MathML -->
+<!-- (Based on initial version by David Carlisle) -->
+<!-- -->
+<!-- Author: Clare M. So <clare@scl.csd.uwo.ca> -->
+<!-- -->
+<!-- May to August 2002 -->
+<!-- -->
+<!-- (Last updated July 9, 2003) -->
+<!-- ********************************************************** -->
+
+<!-- ********************************************************** -->
+<!-- CHANGE LOG -->
+<!-- ********************************************************** -->
+<!-- May 13, 2003 - Add template nthdiff of calculus1 CD -->
+<!-- May 14, 2003 - Add templates for moreerrors CD -->
+<!-- May 15, 2003 - Split templates for multiset1, set1, -->
+<!-- and list1 CDs -->
+<!-- Split templates for s_dist1 and s_data1 CDs -->
+<!-- June 4, 2003 - Fix bugs in splitting set1, multiset1, and -->
+<!-- set1 CDs -->
+<!-- - Add templates for transc3 CD -->
+<!-- July 9, 2003 - Add template for nthdiff -->
+
+<!-- Special MathML entities -->
+
+<!DOCTYPE stylesheet [
+<!ENTITY pi "&#x003C0;">
+<!ENTITY e "&#x02147E;">
+<!ENTITY ee "&#x02147E;">
+<!ENTITY ExponentialE "&#x02147E;">
+<!ENTITY ImaginaryI "&#x02148;">
+<!ENTITY ii "&#x02148;">
+<!ENTITY gamma "&#x003B3;">
+<!ENTITY infin "&#x0221E;">
+<!ENTITY infty "&#x0221E;">
+<!ENTITY true "&#xF0002;">
+<!ENTITY false "&#xF0003;">
+<!ENTITY NotANumber "&#xF0001;">
+<!ENTITY NaN "&#xF0001;">
+]>
+
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:om="http://www.openmath.org/OpenMath"
+ xmlns="http://www.w3.org/1998/Math/MathML"
+ exclude-result-prefixes="om"
+ version="1.0">
+
+ <!-- xsl:output method="xml" indent="yes"/ -->
+ <xsl:output method="xml"/>
+
+ <xsl:strip-space elements="*"/>
+
+ <xsl:variable name="defaultOMSpriority">-10</xsl:variable>
+
+ <!-- **************************************************** -->
+ <!-- ****************** Basic Elements ****************** -->
+ <!-- **************************************************** -->
+
+ <!-- OMOBJ (D. Carlisle) -->
+ <xsl:template match="om:OMOBJ">
+ <math>
+ <xsl:apply-templates/>
+ </math>
+ </xsl:template>
+
+ <!-- OMI (D. Carlisle) -->
+ <xsl:template match="om:OMI">
+ <cn type="integer">
+ <xsl:variable name="x" select="normalize-space(.)"/>
+ <xsl:choose>
+ <xsl:when test="contains($x,'x')">
+ <xsl:attribute name="base">16</xsl:attribute>
+ <xsl:value-of select="concat(substring-before($x,'x'),substring-after($x,'x'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$x"/> <!-- default is decimal -->
+ </xsl:otherwise>
+ </xsl:choose>
+ </cn>
+ </xsl:template>
+
+ <!-- OMV (D. Carlisle) -->
+ <xsl:template match="om:OMV">
+ <ci>
+ <xsl:value-of select="normalize-space(@name)"/>
+ </ci>
+ </xsl:template>
+
+ <!-- OMF (decimal) -->
+ <xsl:template match="om:OMF[@dec]">
+ <cn>
+ <xsl:value-of select="normalize-space(@dec)"/>
+ </cn>
+ </xsl:template>
+
+ <!-- OMF (hex) -->
+ <xsl:template match="om:OMF[@hex]">
+ <cn base="16">
+ <xsl:value-of select="normalize-space(@hex)"/>
+ </cn>
+ </xsl:template>
+
+ <!-- OMA (D. Carlisle) -->
+ <xsl:template match="om:OMA">
+ <apply>
+ <xsl:apply-templates/>
+ </apply>
+ </xsl:template>
+
+ <!-- OMB -->
+ <!-- Note: No Content MathML equivalent -->
+ <xsl:template match="om:OMB">
+ <mtext definitionURL="http://www.openmath.org/objects#OMB">
+ <xsl:value-of select="."/>
+ </mtext>
+ </xsl:template>
+
+ <!-- OMSTR (D. Carlisle) -->
+ <!-- Note: mtext is a presentational MathML tag -->
+ <xsl:template match="om:OMSTR">
+ <mtext>
+ <xsl:value-of select="."/>
+ </mtext>
+ </xsl:template>
+
+ <!-- ***************************************************** -->
+ <!-- ****************** MathML group ******************** -->
+ <!-- ***************************************************** -->
+
+ <!-- Content Dicitionary: alg1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: zero, one -->
+
+ <!-- Trivial cases: none -->
+ <xsl:template match="om:OMS[@cd='alg1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- zero -->
+ <xsl:template match="om:OMS[@cd='alg1' and @name='zero']">
+ <cn type="integer">0</cn>
+ </xsl:template>
+
+ <!-- one -->
+ <xsl:template match="om:OMS[@cd='alg1' and @name='one']">
+ <cn type="integer">1</cn>
+ </xsl:template>
+
+ <!-- Content Dictionary: arith1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD conatains: abs, divide, gcd, lcm, minus, plus, power, product,
+ root, sum, unary_minus -->
+
+ <!-- Trivial Cases: abs, divide, gcd, lcm, minus, plus -->
+ <xsl:template match="om:OMS[@cd='arith1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- unary_minus -->
+ <xsl:template match="om:OMS[@cd='arith1' and @name='unary_minus']">
+ <minus/>
+ </xsl:template>
+
+ <!-- root -->
+ <xsl:template match="om:OMA[om:OMS[@cd='arith1' and @name='root']]">
+ <apply>
+ <root/>
+ <degree>
+ <xsl:apply-templates select="*[3]"/>
+ </degree>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- sum and product -->
+ <xsl:template match="om:OMA[om:OMS[@cd='arith1' and (@name='sum' or @name='product')]]">
+ <apply>
+ <xsl:element name="{om:OMS[1]/@name}"/>
+ <bvar>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="3"/> <!-- the bounded var is in the func -->
+ </xsl:apply-templates>
+ </bvar>
+ <xsl:apply-templates select="*[2]"/> <!-- range of product/summation -->
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: bigfloat1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: bigfloat, bigfloatprec -->
+
+ <!-- Trivial cases: none -->
+
+ <!-- bigfloat -->
+ <xsl:template match="om:OMA[om:OMS[@cd='bigfloat1' and @name='bigfloat']]">
+ <apply>
+ <times/>
+ <xsl:apply-templates select="*[2]"/>
+ <apply>
+ <power/>
+ <xsl:apply-templates select="*[3]"/>
+ <xsl:apply-templates select="*[4]"/>
+ </apply>
+ </apply>
+ </xsl:template>
+
+ <!-- bigfloatprec -->
+ <!-- Note: No Content MathML equivalent -->
+ <xsl:template match="om:OMS[@cd='bigfloat1' and @name='bigfloatprec']">
+ <csymbol encoding="OpenMath"
+ definitionURL="http://www.openmath.org/cd/bigfloat1#bigfloatprec"/>
+ </xsl:template>
+
+ <!-- Content Dictionary: calculus1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: defint, diff, int, nthdiff, partialdiff -->
+
+ <!-- Trivial cases: partialdiff -->
+ <xsl:template match="om:OMS[@cd='calculus1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- diff, int -->
+ <xsl:template match="om:OMA[om:OMS[@cd='calculus1' and (@name='diff' or @name='int')]]">
+ <apply>
+ <xsl:element name="{om:OMS[1]/@name}"/>
+ <bvar>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="2"/>
+ </xsl:apply-templates>
+ </bvar>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- defint -->
+ <xsl:template match="om:OMA[om:OMS[@cd='calculus1' and @name='defint']]">
+ <apply>
+ <int/> <!-- pretty much the same as sum and product... CHECK domainofapp -->
+ <bvar> <!-- perphaps write a method for the similar parts... -->
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="3"/>
+ </xsl:apply-templates>
+ </bvar>
+ <xsl:apply-templates select="*[2]"/> <!-- range of diff -->
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- nthdiff -->
+ <xsl:template match="om:OMA[om:OMS[@cd='calculus1' and @name='nthdiff']]">
+ <apply>
+ <diff/>
+ <bvar>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="3"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="*[2]"/>
+ </bvar>
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionaries: complex1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: argument, complex_cartesian, complex_polar, conjugate,
+ imaginary, real -->
+
+ <!-- Trivial cases: conjugate, imaginary, real -->
+ <xsl:template match="om:OMS[@cd='complex1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- argument -->
+ <xsl:template match="om:OMS[@cd='complex1' and @name='argument']">
+ <arg/>
+ </xsl:template>
+
+ <!-- complex_cartesian or complex_polar -->
+ <xsl:template match="om:OMA[om:OMS[@cd='complex1' and (@name='complex_cartesian' or @name='complex_polar')]]">
+ <xsl:variable name="type_name" select="translate(om:OMS[1]/@name,'_','-')"/>
+ <xsl:choose>
+ <xsl:when test="child::om:OMV or child::om:OMA">
+ <apply>
+ <csymbol definitionURL="{concat('http://www.openmath.org/cd/complex1#',om:OMS[1]/@name)}"/>
+ <xsl:apply-templates select="*[2]"/>
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:when>
+ <xsl:otherwise>
+ <cn type="{$type_name}">
+ <xsl:apply-templates select="*[2]" mode="convert"/>
+ <sep/>
+ <xsl:apply-templates select="*[3]" mode="convert"/>
+ </cn>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Content Dictionary: fns1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: domain, domainofapplication, identity, image, inverse,
+ lambda, left_compose, left_inverse, right_inverse -->
+
+ <!-- Trivial cases: domain, image, inverse -->
+ <xsl:template match="om:OMS[@cd='fns1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- domainofapplication -->
+ <xsl:template match="om:OMA[om:OMS[@cd='fns1' and @name='domainofapplication']]">
+ <domainofapplication>
+ <xsl:apply-templates select="*[2]"/>
+ </domainofapplication>
+ </xsl:template>
+
+ <!-- identity -->
+ <xsl:template match="om:OMS[@cd='fns1' and @name='identity']">
+ <ident/>
+ </xsl:template>
+
+ <!-- lambda -->
+ <xsl:template match="om:OMBIND[om:OMS[@cd='fns1' and @name='lambda']]">
+ <lambda>
+ <xsl:for-each select="om:OMBVAR/child::om:OMV">
+ <bvar>
+ <xsl:apply-templates select="."/>
+ </bvar>
+ </xsl:for-each>
+ <xsl:apply-templates select="*[3]"/>
+ </lambda>
+ </xsl:template>
+
+ <!-- range -->
+ <xsl:template match="om:OMS[@cd='fns1' and @name='range']">
+ <codomain/>
+ </xsl:template>
+
+ <!-- left_compose -->
+ <xsl:template match="om:OMS[@cd='fns1' and @name='left_compose']">
+ <compose/>
+ </xsl:template>
+
+ <!-- left_inverse -->
+ <xsl:template match="om:OMS[@cd='fns1' and @name='left_inverse']">
+ <inverse/>
+ </xsl:template>
+
+ <!-- right_inverse -->
+ <!-- Note: No Content MathML equivalent -->
+ <xsl:template match="om:OMS[@cd='fns1' and @name='right_inverse']">
+ <inverse encoding="OpenMath" definitionURL="http://www.openmath.org/cd/fns1#right_inverse"/>
+ </xsl:template>
+
+ <!-- Content Dictionary: integer1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: factorial, factorof, quotient, remainder -->
+
+ <!-- Trivial cases: factorof, factorial, quotient -->
+ <xsl:template match="om:OMS[@cd='integer1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- remainder -->
+ <xsl:template match="om:OMS[@cd='integer1' and @name='remainder']">
+ <rem/>
+ </xsl:template>
+
+ <!-- Content Dictionary: interval1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: integer_interval, interval, interval_oo, interval_cc,
+ interval_oc, interval_co -->
+
+ <!-- Trivial case: none -->
+
+ <!-- (All) -->
+ <xsl:template match="om:OMA[om:OMS[@cd='interval1']]">
+ <interval>
+ <xsl:choose>
+ <xsl:when test="om:OMS[1]/@name='interval_oo'">
+ <xsl:attribute name='closure'>open</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="om:OMS[1]/@name='interval_cc'">
+ <xsl:attribute name='closure'>closed</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="om:OMS[1]/@name='interval_oc'">
+ <xsl:attribute name='closure'>open-closed</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="om:OMS[1]/@name='interval_co'">
+ <xsl:attribute name='closure'>closed-open</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:apply-templates select="*[2]"/>
+ <xsl:apply-templates select="*[3]"/>
+ </interval>
+ </xsl:template>
+
+ <!-- Content Dictionary: linalg1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: determinant, matrix_selector, outerproduct,
+ scalarproduct, transpose, vector_selector, vector_product -->
+
+ <!-- Trivial cases: determinant, outerproduct, scalarproduct, transpose,
+ vectorproduct -->
+ <xsl:template match="om:OMS[@cd='linalg1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- vector_selector -->
+ <xsl:template match="om:OMA[om:OMS[@cd='linalg1' and @name='vector_selector']]">
+ <apply>
+ <selector/>
+ <xsl:apply-templates select="*[3]"/> <!-- the vector -->
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- matrix_selector -->
+ <xsl:template match="om:OMA[om:OMS[@cd='linalg1' and @name='matrix_selector']]">
+ <apply>
+ <selector/>
+ <xsl:apply-templates select="*[4]"/> <!-- the matrix -->
+ <xsl:apply-templates select="*[3]"/>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: linalg2 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: matrix, matrixrow, vector -->
+
+ <!-- Trivial cases: none -->
+
+ <!-- matrixrow, matrix -->
+ <xsl:template match="om:OMA[om:OMS[@cd='linalg2']]">
+ <xsl:element name="{om:OMS[1]/@name}">
+ <xsl:apply-templates select="*[position()>1]"/>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- (row) vector -->
+ <xsl:template match="om:OMA[om:OMS[@cd='linalg2' and @name='vector']]">
+ <apply>
+ <transpose/>
+ <vector>
+ <xsl:apply-templates select="*[position()>1]"/>
+ </vector>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: limit1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: above, below, bothsides, limit, null -->
+
+ <!-- Trivial cases: none -->
+
+ <!-- both_sides, above, below, null -->
+ <xsl:template match="om:OMA[om:OMS[@cd='limit1']]">
+ <apply>
+ <limit/>
+ <bvar>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="4"/>
+ </xsl:apply-templates>
+ </bvar>
+ <xsl:choose>
+ <xsl:when test="om:OMS[2]/@name='null'">
+ <lowlimit>
+ <xsl:apply-templates select="*[2]"/>
+ </lowlimit>
+ </xsl:when>
+ <xsl:otherwise>
+ <condition>
+ <apply>
+ <tendsto>
+ <xsl:choose>
+ <xsl:when test="om:OMS[2]/@name='both_sides'">
+ <xsl:attribute name="type">all</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="om:OMS[2]/@name='above'">
+ <xsl:attribute name="type">above</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="om:OMS[2]/@name='below'">
+ <xsl:attribute name="type">below</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </tendsto>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="4"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </condition>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:apply-templates select="*[4]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: list1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: list, map, suchthat -->
+
+ <!-- Trivial cases: none -->
+
+ <!-- list -->
+ <xsl:template match="om:OMA[om:OMS[@cd='list1' and @name='list']]">
+ <list>
+ <xsl:apply-templates select="*[position()>1]"/>
+ </list>
+ </xsl:template>
+
+ <!-- map -->
+ <xsl:template match="om:OMA[om:OMS[@cd='list1' and @name='map']]">
+ <list>
+ <xsl:apply-templates select="." mode="map"/>
+ </list>
+ </xsl:template>
+
+ <!-- suchthat -->
+ <xsl:template match="om:OMA[om:OMS[@cd='list1' and @name='suchthat']]">
+ <list>
+ <xsl:apply-templates select="." mode="suchthat"/>
+ </list>
+ </xsl:template>
+
+ <!-- Content Dictionary: logic1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: and, equivalent, false, implies, not, or, true, xor -->
+
+ <!-- Trivial cases: all -->
+ <xsl:template match="om:OMS[@cd='logic1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- Content Dictionary: mathmltypes -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: complex_cartesian_type, complex_polar_type, constant_type,
+ fn_type, integer_type, list_type, matrix_type, rational_type, real_type,
+ set_type, type, vector_type -->
+
+ <!-- (All mathmltypes elements) -->
+ <xsl:template match="om:OMATTR[om:OMATP[om:OMS[@cd='mathmltypes' and @name='type']]]">
+ <xsl:variable name="type_name" select="normalize-space(translate(substring-before(om:OMATP/om:OMS[2]/@name,'_type'),'_','-'))"/>
+ <xsl:choose>
+ <xsl:when test="*[2]=om:OMV">
+ <ci type="{$type_name}">
+ <xsl:value-of select="normalize-space(*[2]/@name)"/>
+ </ci>
+ </xsl:when>
+ <xsl:when test="*[2]=om:OMI">
+ <cn type="{$type_name}">
+ <xsl:variable name="x" select="normalize-space(*[2])"/>
+ <xsl:choose>
+ <xsl:when test="contains($x,'x')">
+ <xsl:attribute name="base">16</xsl:attribute>
+ <xsl:value-of select="concat(substring-before($x,'x'),substring-after($x,'x'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$x"/> <!-- default is decimal -->
+ </xsl:otherwise>
+ </xsl:choose>
+ </cn>
+ </xsl:when>
+ <xsl:when test="*[2]=om:OMF[@dec]">
+ <cn type="{$type_name}">
+ <xsl:value-of select="normalize-space(*[2]/@dec)"/>
+ </cn>
+ </xsl:when>
+ <xsl:when test="*[2]=om:OMF[@hex]">
+ <cn type="{$type_name}" base="16">
+ <xsl:value-of select="normalize-space(*[2]/@hex)"/>
+ </cn>
+ </xsl:when>
+ <xsl:otherwise> <!-- MathML cannot add type attribute to other objects -->
+ <xsl:comment>
+ Content MathML cannot add type <xsl:value-of select="$type_name"/> for the object after this comment.
+ </xsl:comment>
+ <xsl:apply-templates select="*[2]"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Content Dictionary: minmax1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: max, min -->
+ <xsl:template match="om:OMS[@cd='minmax1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- Trivial cases: none -->
+
+ <!-- max, min -->
+ <xsl:template match="om:OMA[om:OMS[@cd='minmax1']]">
+ <apply>
+ <xsl:element name="{om:OMS/@name}"/>
+ <xsl:choose>
+ <xsl:when test="*[2]=om:OMA[om:OMS[@cd='set1' and @name='set']]">
+ <xsl:apply-templates select="om:OMA/*[position()>1]"/>
+ </xsl:when>
+ <xsl:when test="*[2]=om:OMA[om:OMS[@cd='multiset1' and @name='multiset']]">
+ <xsl:apply-templates select="om:OMA/*[position()>1]"/>
+ </xsl:when>
+ <xsl:when test="*[2]=om:OMA[om:OMS[@cd='set1' and @name='suchthat']]">
+ <xsl:apply-templates select="*[2]" mode="suchthat"/>
+ </xsl:when>
+ <xsl:when test="*[2]=om:OMA[om:OMS[@cd='set1' and @name='map']]">
+ <xsl:apply-templates select="*[2]" mode="map"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <bvar><ci>x</ci></bvar>
+ <condition>
+ <apply>
+ <in/>
+ <ci>x</ci>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </condition>
+ </xsl:otherwise>
+ </xsl:choose>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: multiset1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: cartesian_product, emptyset, in, intersect, multiset,
+ notin, notprsubset, notsubset, prsubset, setdiff, size, subset, union -->
+
+ <!-- Trivial cases: emptyset, in, interset, notin, notprsubset, notsubset, prsubset,
+ subset, union -->
+ <xsl:template match="om:OMS[@cd='multiset1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- cartesian_product -->
+ <xsl:template match="om:OMS[@cd='multiset1' and @name='cartesian_product']">
+ <cartesianproduct/>
+ </xsl:template>
+
+
+ <!-- multiset -->
+ <xsl:template match="om:OMA[om:OMS[@cd='multiset1' and @name='multiset']]">
+ <set type="multiset">
+ <xsl:apply-templates select="*[position()>1]"/>
+ </set>
+ </xsl:template>
+
+ <!-- size -->
+ <xsl:template match="om:OMS[@cd='multiset1' and @name='size']">
+ <card/>
+ </xsl:template>
+
+ <!-- Content Dictionary: nums1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains based_integer, e, gamma, i, infinity, NaN, pi, rational -->
+
+ <!-- Trivial cases: pi, infinity -->
+ <xsl:template match="om:OMS[@cd='nums1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- based_integer -->
+ <!-- Note: Content MathML does not support base that is represented by a variable -->
+ <xsl:template match="om:OMA[om:OMS[@cd='nums1' and @name='based_integer']]">
+ <xsl:choose>
+ <xsl:when test="*[2]=om:OMV">
+ <apply>
+ <csymbol encoding="OpenMath" definitionURL="http://www.openmath.org/cd/nums1#based_integer"/>
+ <xsl:apply-templates select="*[2]"/>
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:when>
+ <xsl:otherwise>
+ <cn type="integer" base="{normalize-space(*[2])}">
+ <xsl:value-of select="normalize-space(om:OMSTR)"/>
+ </cn>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- e -->
+ <xsl:template match="om:OMS[@cd='nums1' and @name='e']">
+ <exponentiale/>
+ </xsl:template>
+
+ <!-- gamma -->
+ <xsl:template match="om:OMS[@cd='nums1' and @name='gamma']">
+ <eulergamma/>
+ </xsl:template>
+
+ <!-- i -->
+ <xsl:template match="om:OMS[@cd='nums1' and @name='i']">
+ <imaginaryi/>
+ </xsl:template>
+
+ <!-- NaN -->
+ <xsl:template match="om:OMS[@cd='nums1' and @name='NaN']">
+ <notanumber/>
+ </xsl:template>
+
+ <!-- rational -->
+ <!-- Note: Content MathML does not support rational numbers that are
+ made up of variables or other mathematical objects -->
+ <xsl:template match="om:OMA[om:OMS[@cd='nums1' and @name='rational']]">
+ <xsl:choose>
+ <xsl:when test="child::om:OMV or child::om:OMA">
+ <apply>
+ <csymbol definitionURL="http://www.openmath.org/cd/nums1#rational"/>
+ <xsl:apply-templates select="*[2]"/>
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:when>
+ <xsl:otherwise>
+ <cn type="rational">
+ <xsl:apply-templates select="*[2]" mode="convert"/>
+ <sep/>
+ <xsl:apply-templates select="*[3]" mode="convert"/>
+ </cn>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Content Dictionary: piece1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: otherwise, piece, piecewise -->
+
+ <!-- Trivial cases: (All of the OMSs here are almost trivial, except
+ that these functions are used without "apply" in Content MathML) -->
+
+ <!-- piecewise, piece, otherwise -->
+ <xsl:template match="om:OMA[om:OMS[@cd='piece1']]">
+ <xsl:element name="{om:OMS/@name}">
+ <xsl:apply-templates select="*[position()>1]"/>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- Content Dictionary: quant1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: forall, exists -->
+
+ <!-- forall,exists -->
+ <xsl:template match="om:OMBIND[om:OMS[@cd='quant1']]">
+ <apply>
+ <xsl:element name="{om:OMS[1]/@name}"/>
+ <xsl:for-each select="om:OMBVAR/om:OMV">
+ <bvar>
+ <xsl:apply-templates select="."/>
+ </bvar>
+ </xsl:for-each>
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: relation1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: approx, eq, geq, gt, leq, lt, neq -->
+
+ <!-- Trivial cases: all -->
+
+ <xsl:template match="om:OMS[@cd='relation1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- Content Dictionary: setname1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: C, N, P, Q, R, Z -->
+
+ <!-- Trivial cases: none -->
+
+ <!-- P -->
+ <xsl:template match="om:OMS[@cd='setname1' and @name='P']">
+ <primes/>
+ </xsl:template>
+
+ <!-- N -->
+ <xsl:template match="om:OMS[@cd='setname1' and @name='N']">
+ <naturalnumbers/>
+ </xsl:template>
+
+ <!-- Z -->
+ <xsl:template match="om:OMS[@cd='setname1' and @name='Z']">
+ <integers/>
+ </xsl:template>
+
+ <!-- Z -->
+ <xsl:template match="om:OMS[@cd='setname1' and @name='Q']">
+ <rationals/>
+ </xsl:template>
+
+ <!-- R -->
+ <xsl:template match="om:OMS[@cd='setname1' and @name='R']">
+ <reals/>
+ </xsl:template>
+
+ <!-- C -->
+ <xsl:template match="om:OMS[@cd='setname1' and @name='C']">
+ <complexes/>
+ </xsl:template>
+
+ <!-- Content Dictionary: rounding1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: ceiling, floor, round, trunc -->
+
+ <!-- Trivial Cases: ceiling, floor -->
+ <xsl:template match="om:OMS[@cd='rounding1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- trunc -->
+ <xsl:template match="om:OMA[om:OMS[@cd='rounding1' and @name='trunc']]">
+ <apply>
+ <quotient/>
+ <xsl:apply-templates select="*[2]"/>
+ <cn>1</cn>
+ </apply>
+ </xsl:template>
+
+ <!-- round -->
+ <xsl:template match="om:OMA[om:OMS[@cd='rounding1' and @name='round']]">
+ <piecewise>
+ <piece>
+ <apply>
+ <floor/>
+ <apply>
+ <plus/>
+ <cn>0.5</cn>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </apply>
+ <apply>
+ <geq/>
+ <xsl:apply-templates select="*[2]"/>
+ <cn>0</cn>
+ </apply>
+ </piece>
+ <piece>
+ <apply>
+ <ceiling/>
+ <apply>
+ <minus/>
+ <xsl:apply-templates select="*[2]"/>
+ <cn>0.5</cn>
+ </apply>
+ </apply>
+ <apply>
+ <lt/>
+ <xsl:apply-templates select="*[2]"/>
+ <cn>0</cn>
+ </apply>
+ </piece>
+ </piecewise>
+ </xsl:template>
+
+ <!-- Content Dictionary: set1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: cartesian_product, emptyset, in, intersect, map, notin,
+ notprsubset, notsubset, prsubset, set, setdiff, size, subset, suchthat, union -->
+
+ <!-- Trivial cases: emptyset, in, intersect, notin, notprsubset, notsubset, prsubset
+ setdiff, subset, union -->
+ <xsl:template match="om:OMS[@cd='set1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- cartesian_product -->
+ <xsl:template match="om:OMS[@cd='set1' and @name='cartesian_product']">
+ <cartesianproduct/>
+ </xsl:template>
+
+ <!-- map -->
+ <xsl:template match="om:OMA[om:OMS[@cd='set1' and @name='map']]">
+ <set>
+ <xsl:apply-templates select="." mode="map"/>
+ </set>
+ </xsl:template>
+
+ <!-- size -->
+ <xsl:template match="om:OMS[@cd='set1' and @name='size']">
+ <card/>
+ </xsl:template>
+
+ <!-- suchthat -->
+ <xsl:template match="om:OMA[om:OMS[@cd='set1' and @name='suchthat']]">
+ <set>
+ <xsl:apply-templates select="." mode="suchthat"/>
+ </set>
+ </xsl:template>
+
+ <!-- Content Dictionary: s_data1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: mean, median, mode, moment, sdev, variance -->
+
+ <!-- Trivial cases: mean, median, mode, sdev, variance -->
+ <xsl:template match="om:OMS[@cd='s_data1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- moment -->
+ <xsl:template match="om:OMA[om:OMS[@cd='s_data1' and @name='moment']]">
+ <apply>
+ <moment/>
+ <degree>
+ <xsl:apply-templates select="*[2]"/>
+ </degree>
+ <momentabout>
+ <xsl:apply-templates select="*[3]"/>
+ </momentabout>
+ <xsl:apply-templates select="*[position()>3]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: s_dist1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: mean, moment, sdev, variance -->
+
+ <!-- Trivial cases: mean, sdev, variance -->
+ <xsl:template match="om:OMS[@cd='s_dist1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- moment -->
+ <xsl:template match="om:OMA[om:OMS[@cd='s_dist1' and @name='moment']]">
+ <apply>
+ <moment/>
+ <degree>
+ <xsl:apply-templates select="*[2]"/>
+ </degree>
+ <momentabout>
+ <xsl:apply-templates select="*[3]"/>
+ </momentabout>
+ <xsl:apply-templates select="*[position()>3]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: transc1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: arccos, arccosh, arccot, arccoth, arccsc,
+ arccsch, arcsec, arcsech, arcsin, arcsinh, arctan, arctanh, cos,
+ cosh, cot, coth, csc, csch, exp, ln, log, sec, sech, sin, sinh,
+ tan, tanh -->
+
+ <!-- Trivial cases: all except log -->
+ <xsl:template match="om:OMS[@cd='transc1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- log -->
+ <xsl:template match="om:OMA[om:OMS[@cd='transc1' and @name='log']]">
+ <apply>
+ <log/>
+ <logbase>
+ <xsl:apply-templates select="*[2]"/>
+ </logbase>
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: veccalc1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: curl, divergence, grad, Laplacian -->
+
+ <!-- Trivial cases: all except Laplacian -->
+ <xsl:template match="om:OMS[@cd='veccalc1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- Laplacian -->
+ <!-- Note: Capital "L" -->
+ <xsl:template match="om:OMS[@cd='veccalc1' and @name='Laplacian']">
+ <laplacian/>
+ </xsl:template>
+
+ <!-- Content Dictionary: altenc -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: LaTeX_encoding, MathML_encoding -->
+
+ <!-- Trivial cases: none -->
+
+ <!-- (Everything in altenc) -->
+ <xsl:template match="om:OMATTR[om:OMATP[om:OMS[@cd='altenc']]]">
+ <semantics>
+ <xsl:apply-templates select="*[2]"/>
+ <xsl:apply-templates select="om:OMATP/child::om:OMS"/>
+ </semantics>
+ </xsl:template>
+
+ <!-- MathML_encoding -->
+ <xsl:template match="om:OMS[@cd='altenc' and @name='MathML_encoding']">
+ <annotation-xml encoding="MathML">
+ <xsl:value-of select="normalize-space(following-sibling::*[position()=1])"/> <!-- OMXML or OMSTR-->
+ </annotation-xml>
+ </xsl:template>
+
+ <!-- LaTeX_encoding -->
+ <xsl:template match="om:OMS[@cd='altenc' and @name='LaTeX_encoding']">
+ <annotation encoding="LaTeX">
+ <xsl:value-of select="normalize-space(following::om:OMSTR)"/>
+ </annotation>
+ </xsl:template>
+
+ <!-- **************************************************** -->
+ <!-- ************** Not in MathML group CDs ************* -->
+ <!-- **************************************************** -->
+
+ <!-- Everything below should not be handled by the Trivial case!) -->
+
+ <!-- Content Dictionary: linalg3 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- (column) vector -->
+ <xsl:template match="om:OMA[om:OMS[@cd='linalg3' and @name='vector']]">
+ <vector>
+ <xsl:apply-templates select="*[position()>1]"/>
+ </vector>
+ </xsl:template>
+
+ <!-- Content Dictionary: arith2 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: inverse, times -->
+
+ <!-- times -->
+ <!-- Note: This function is n-ary just like MathML! -->
+ <xsl:template match="om:OMS[@cd='arith2' and @name='times']">
+ <times/>
+ </xsl:template>
+
+ <!-- Content Dictionary: error -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- (all errors) -->
+ <xsl:template match="om:OME">
+ <mtext>
+ <xsl:text>ERROR:</xsl:text>
+ <xsl:text> Error Type: </xsl:text><xsl:value-of select="om:OMS[1]/@name"/>
+ <xsl:text> Error occured in CD: </xsl:text><xsl:value-of select="om:OMS[2]/@cd"/>
+ <xsl:text> Error occured in symbol: </xsl:text><xsl:value-of select="om:OMS[2]/@name"/>
+ </mtext>
+ </xsl:template>
+
+ <!-- Content Dictionary: moreerrors -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: algorithm, asynchronousError, encodingError, limitation,
+ unexpected -->
+
+ <!-- (all) -->
+ <xsl:template match="om:OMA[om:OMS[@cd='moreerrors']]">
+ <mtext>
+ <xsl:text>ERROR:</xsl:text>
+ <xsl:text> Error Type: </xsl:text><xsl:value-of select="normalize-space(om:OMS/@name)"/>
+ <xsl:text> Description: </xsl:text><xsl:value-of select="normalize-space(om:OMSTR)"/>
+ </mtext>
+ </xsl:template>
+
+ <!-- Content Dicitionary: transc3 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: arccos, arccosh, arccot, arccoth, arccsc, arccsch,
+ arcsec, arcsech, arcsin, arcsinh, arctan, arctanh, ln, log -->
+
+ <!-- (all except log) -->
+ <xsl:template match="om:OMS[@cd='transc3']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- log -->
+ <xsl:template match="om:OMA[om:OMS[@cd='transc3' and @name='log']]">
+ <apply>
+ <log/>
+ <logbase>
+ <xsl:apply-templates select="*[3]"/>
+ </logbase>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- **************************************************** -->
+ <!-- **************** EVERYTHING ELSE ******************* -->
+ <!-- **************************************************** -->
+
+ <!-- Note: Rather than hard code all of the CDs, I just assign the lowest
+ priority among all templates. -->
+
+ <xsl:template match="om:OMS[@cd and @name]" priority="-10">
+ <csymbol>
+ <xsl:attribute name="definitionURL">
+ <xsl:value-of select="concat(concat(concat('http://www.openmath.org/cd/',@cd),'#'),@name)"/>
+ </xsl:attribute>
+ </csymbol>
+ </xsl:template>
+
+ <!-- **************************************************** -->
+ <!-- **************** HELPER TEMPLATES ****************** -->
+ <!-- **************************************************** -->
+
+ <!-- All mode "convert" templates are for converting OMSs or OMIs to
+ numbers including in various cn containing <sep/> -->
+
+ <xsl:template match="om:OMS[@cd='alg1' and @name='zero']" mode="convert">0</xsl:template>
+
+ <xsl:template match="om:OMS[@cd='alg1' and @name='one']" mode="convert">1</xsl:template>
+
+ <xsl:template match="om:OMS" mode="convert">
+ <xsl:choose>
+ <xsl:when test="@name='pi'">&pi;</xsl:when>
+ <xsl:when test="@name='i'">&ii;</xsl:when>
+ <xsl:when test="@name='NaN'">&NaN;</xsl:when>
+ <xsl:when test="@name='gamma'">&gamma;</xsl:when>
+ <xsl:when test="@name='e'">&ee;</xsl:when>
+ <xsl:when test="@name='true'">&true;</xsl:when>
+ <xsl:when test="@name='false'">&false;</xsl:when>
+ <xsl:when test="@name='infinity'">&infin;</xsl:when>
+ <xsl:otherwise><xsl:value-of select="normalize-space(.)"/></xsl:otherwise> <!-- for debugging -->
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="om:OMI" mode="convert">
+ <xsl:variable name="x" select="normalize-space(.)"/>
+ <xsl:choose>
+ <xsl:when test="contains($x,'x')">
+ <xsl:value-of select="concat(substring-before($x,'x'),substring-after($x,'x'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$x"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="om:OMF" mode="convert">
+ <xsl:value-of select="@*"/>
+ </xsl:template>
+
+ <!-- The following templates, with mode "map" and "suchthat", are used to contruct sets or lists
+ without enumerating every element -->
+
+ <xsl:template match="om:OMA" mode="map">
+ <bvar>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="2"/>
+ </xsl:apply-templates>
+ </bvar>
+ <condition>
+ <apply>
+ <in/>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="2"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </condition>
+ <xsl:apply-templates select="*[2]"/>
+ </xsl:template>
+
+ <xsl:template match="om:OMA" mode="suchthat">
+ <bvar>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="3"/>
+ </xsl:apply-templates>
+ </bvar>
+ <condition>
+ <apply>
+ <and/>
+ <xsl:apply-templates select="*[3]"/>
+ <apply>
+ <in/>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="3"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </apply>
+ </condition>
+ </xsl:template>
+
+ <!-- This template is for getting bound variables (all variables in <OMBIND>) -->
+ <!-- Note: Default bound variable is "x" -->
+
+ <xsl:template match="om:OMA" mode="getVar">
+ <xsl:param name="NUM" select="3"/>
+ <xsl:choose>
+ <xsl:when test="*[$NUM]=om:OMBIND">
+ <xsl:apply-templates select="*[$NUM]/om:OMBVAR/om:OMV[position()>0]"/>
+ </xsl:when>
+ <xsl:otherwise> <!-- default -->
+ <ci>x</ci>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Added by Hans Hagen -->
+
+ <xsl:template match="om:OMS[@cd='altenc' and @name='TeX_encoding']">
+ <annotation encoding="TeX">
+ <xsl:value-of select="normalize-space(following::om:OMSTR)"/>
+ </annotation>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/tex/context/base/x-openmath.xsl b/tex/context/base/x-openmath.xsl
new file mode 100644
index 000000000..e91b83e51
--- /dev/null
+++ b/tex/context/base/x-openmath.xsl
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:output method="xml"/>
+
+ <!-- newline, temp hack, latest texexec handles it okay -->
+
+ <xsl:template match ="processing-instruction()"><xsl:copy/><xsl:text>
+ </xsl:text></xsl:template>
+
+ <!-- xsl:template match="*"><xsl:copy/></xsl:template -->
+ <!-- xsl:element name="{name(current())}"><xsl:apply-templates/></xsl:element -->
+
+<!--
+ <xsl:template match="*">
+ <xsl:copy>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+-->
+
+ <xsl:template match = "node()|@*" >
+ <xsl:copy>
+ <xsl:apply-templates select = "node()|@*" />
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="comment"></xsl:template>
+
+ <xsl:variable name='openmath-to-content-mathml'><value-of select='$stylesheet-path'/>/x-openmath.xsl</xsl:variable>
+
+ <xsl:include href="x-om2cml.xsl"/>
+
+</xsl:stylesheet>
diff --git a/tex/context/interface/cont-cz.xml b/tex/context/interface/cont-cz.xml
index 821a9ff64..d61b5e8d7 100644
--- a/tex/context/interface/cont-cz.xml
+++ b/tex/context/interface/cont-cz.xml
@@ -7560,6 +7560,8 @@
<cd:constant type="nizko"/>
<cd:constant type="prizpusobive"/>
<cd:constant type="stranka"/>
+ <cd:constant type="levastranka"/>
+ <cd:constant type="pravastranka"/>
<cd:constant type="naproti"/>
<cd:constant type="vzdy"/>
<cd:constant type="auto"/>
diff --git a/tex/context/interface/cont-de.xml b/tex/context/interface/cont-de.xml
index 542c0fd24..dcab05847 100644
--- a/tex/context/interface/cont-de.xml
+++ b/tex/context/interface/cont-de.xml
@@ -7560,6 +7560,8 @@
<cd:constant type="tief"/>
<cd:constant type="passend"/>
<cd:constant type="seite"/>
+ <cd:constant type="linkerseite"/>
+ <cd:constant type="rechterseite"/>
<cd:constant type="gegenueber"/>
<cd:constant type="immer"/>
<cd:constant type="auto"/>
diff --git a/tex/context/interface/cont-en.xml b/tex/context/interface/cont-en.xml
index e67085c00..ccf8b3dc1 100644
--- a/tex/context/interface/cont-en.xml
+++ b/tex/context/interface/cont-en.xml
@@ -7560,6 +7560,8 @@
<cd:constant type="low"/>
<cd:constant type="fit"/>
<cd:constant type="page"/>
+ <cd:constant type="leftpage"/>
+ <cd:constant type="rightpage"/>
<cd:constant type="opposite"/>
<cd:constant type="always"/>
<cd:constant type="auto"/>
diff --git a/tex/context/interface/cont-fr.xml b/tex/context/interface/cont-fr.xml
index 0cfd795c1..8060afb2f 100644
--- a/tex/context/interface/cont-fr.xml
+++ b/tex/context/interface/cont-fr.xml
@@ -7560,6 +7560,8 @@
<cd:constant type="bas"/>
<cd:constant type="adapte"/>
<cd:constant type="page"/>
+ <cd:constant type="pagegauche"/>
+ <cd:constant type="pagedroite"/>
<cd:constant type="opposition"/>
<cd:constant type="toujours"/>
<cd:constant type="auto"/>
diff --git a/tex/context/interface/cont-it.xml b/tex/context/interface/cont-it.xml
index aa09da6bd..b5d18a716 100644
--- a/tex/context/interface/cont-it.xml
+++ b/tex/context/interface/cont-it.xml
@@ -7560,6 +7560,8 @@
<cd:constant type="basso"/>
<cd:constant type="adatta"/>
<cd:constant type="pagina"/>
+ <cd:constant type="paginasinistra"/>
+ <cd:constant type="paginadestra"/>
<cd:constant type="opposto"/>
<cd:constant type="sempre"/>
<cd:constant type="auto"/>
diff --git a/tex/context/interface/cont-nl.xml b/tex/context/interface/cont-nl.xml
index 1734b2962..40f05f3a8 100644
--- a/tex/context/interface/cont-nl.xml
+++ b/tex/context/interface/cont-nl.xml
@@ -7560,6 +7560,8 @@
<cd:constant type="laag"/>
<cd:constant type="passend"/>
<cd:constant type="pagina"/>
+ <cd:constant type="linkerpagina"/>
+ <cd:constant type="rechterpagina"/>
<cd:constant type="naast"/>
<cd:constant type="altijd"/>
<cd:constant type="auto"/>
diff --git a/tex/context/interface/cont-ro.xml b/tex/context/interface/cont-ro.xml
index 9ed76d25c..17dd9eb13 100644
--- a/tex/context/interface/cont-ro.xml
+++ b/tex/context/interface/cont-ro.xml
@@ -7560,6 +7560,8 @@
<cd:constant type="jos"/>
<cd:constant type="ajustat"/>
<cd:constant type="pagina"/>
+ <cd:constant type="paginastanga"/>
+ <cd:constant type="paginadreapta"/>
<cd:constant type="opus"/>
<cd:constant type="totdeauna"/>
<cd:constant type="auto"/>
diff --git a/tex/context/interface/keys-cz.xml b/tex/context/interface/keys-cz.xml
index 9f2ff1790..ce25d7971 100644
--- a/tex/context/interface/keys-cz.xml
+++ b/tex/context/interface/keys-cz.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="cz" version="2006.04.23 23:55">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="cz" version="2006.04.27 00:58">
<cd:variables>
<cd:variable name="one" value="jedna"/>
diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml
index 58688600d..6d71f6247 100644
--- a/tex/context/interface/keys-de.xml
+++ b/tex/context/interface/keys-de.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="de" version="2006.04.23 23:55">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="de" version="2006.04.27 00:58">
<cd:variables>
<cd:variable name="one" value="eins"/>
diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml
index d40557aa5..9e77a60e2 100644
--- a/tex/context/interface/keys-en.xml
+++ b/tex/context/interface/keys-en.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2006.04.23 23:55">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2006.04.27 00:58">
<cd:variables>
<cd:variable name="one" value="one"/>
diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml
index 9f0740bce..b38033867 100644
--- a/tex/context/interface/keys-fr.xml
+++ b/tex/context/interface/keys-fr.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="fr" version="2006.04.23 23:55">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="fr" version="2006.04.27 00:58">
<cd:variables>
<cd:variable name="one" value="un"/>
diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml
index 408fb3211..4fff964bf 100644
--- a/tex/context/interface/keys-it.xml
+++ b/tex/context/interface/keys-it.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="it" version="2006.04.23 23:55">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="it" version="2006.04.27 00:58">
<cd:variables>
<cd:variable name="one" value="uno"/>
diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml
index 0a62e9780..4919806b5 100644
--- a/tex/context/interface/keys-nl.xml
+++ b/tex/context/interface/keys-nl.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="nl" version="2006.04.23 23:55">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="nl" version="2006.04.27 00:58">
<cd:variables>
<cd:variable name="one" value="een"/>
diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml
index 5137fd255..346519a21 100644
--- a/tex/context/interface/keys-ro.xml
+++ b/tex/context/interface/keys-ro.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="ro" version="2006.04.23 23:55">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="ro" version="2006.04.27 00:58">
<cd:variables>
<cd:variable name="one" value="unu"/>