From 4ffb0652473b0dcfb7f6c53a3b50fccecf8ecb26 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 18 May 2006 20:03:00 +0200 Subject: stable 2006.05.18 20:03 --- scripts/context/ruby/ctxtools.rb | 71 ++++++--- scripts/context/ruby/graphics/gs.rb | 4 +- tex/context/base/cont-new.tex | 2 +- tex/context/base/context.tex | 2 +- tex/context/base/core-fil.tex | 29 +++- tex/context/base/core-pgr.tex | 3 +- tex/context/base/font-ini.tex | 2 +- tex/context/base/math-ini.tex | 92 +++++++++-- tex/context/base/mult-con.tex | 6 +- tex/context/base/x-newmml.tex | 304 +++++++++++++++++++++++++----------- tex/context/base/x-newmmo.tex | 126 +++++++++++++++ tex/context/base/x-om2cml.xsl | 8 + tex/context/base/x-sm2om.xsl | 106 +++++++++---- tex/context/interface/cont-ro.xml | 4 +- tex/context/interface/keys-cz.xml | 3 +- tex/context/interface/keys-de.xml | 3 +- tex/context/interface/keys-en.xml | 3 +- tex/context/interface/keys-fr.xml | 3 +- tex/context/interface/keys-it.xml | 3 +- tex/context/interface/keys-nl.xml | 3 +- tex/context/interface/keys-ro.xml | 5 +- 21 files changed, 606 insertions(+), 176 deletions(-) create mode 100644 tex/context/base/x-newmmo.tex diff --git a/scripts/context/ruby/ctxtools.rb b/scripts/context/ruby/ctxtools.rb index 2104eebf7..ee967ec31 100644 --- a/scripts/context/ruby/ctxtools.rb +++ b/scripts/context/ruby/ctxtools.rb @@ -44,7 +44,7 @@ # it cannot do that (it tries to hyphenate as if the "ffi" was a # character), and the result is wrong hyphenation. -banner = ['CtxTools', 'version 1.3.2', '2004/2006', 'PRAGMA ADE/POD'] +banner = ['CtxTools', 'version 1.3.3', '2004/2006', 'PRAGMA ADE/POD'] unless defined? ownpath ownpath = $0.sub(/[\\\/][a-z0-9\-]*?\.rb/i,'') @@ -528,7 +528,7 @@ class Commands $forsuresuffixes = [ "tui", "tup", "ted", "tes", "top", "log", "tmp", "run", "bck", "rlg", - "mpt", "mpx", "mpd", "mpo" + "mpt", "mpx", "mpd", "mpo", "ctl", ] $texonlysuffixes = [ "dvi", "ps", "pdf" @@ -1775,45 +1775,63 @@ class Commands # document: def flushentities(handle,entities,doctype=nil) # 'stylesheet' - tab = if doctype then "\t" else "" end - handle.puts("\n\n" + handle << "\n\n" + handle << "") + handle << "#{tab}\n" + end + if doctype then + handle << "]>\n" end - handle.puts("]>") if doctype end def listentities - # filename = `texmfstart tmftools.rb --progname=context enco-uc.tex`.chomp - filename = `kpsewhich --progname=context enco-uc.tex`.chomp + filenames = ['enco-uc.tex','contextnames.txt'] outputname = @commandline.argument('first') - - if filename and not filename.empty? and FileTest.file?(filename) then - entities = Hash.new - IO.readlines(filename).each do |line| - if line =~ /\\definecharacter\s+([a-zA-Z]+)\s+\{\\uchar\{*(\d+)\}*\{(\d+)\}\}/o then - name, low, high = $1, $2.to_i, $3.to_i - entities[name] = low*256 + high + doctype = @commandline.option('doctype') + entities = Hash.new + + filenames.each do |filename| + # filename = `texmfstart tmftools.rb --progname=context #{filename}`.chomp + filename = `kpsewhich --progname=context #{filename}`.chomp + if filename and not filename.empty? and FileTest.file?(filename) then + report("loading #{filename.gsub(/\\/,'/')}") unless outputname.empty? + IO.readlines(filename).each do |line| + case line + when /^[\#\%]/io then + # skip comment line + when /\\definecharacter\s+([a-z]+)\s+\{\\uchar\{*(\d+)\}*\{(\d+)\}\}/io then + name, code = $1, ($2.to_i*256 + $3.to_i).to_s + entities[name] = code.rjust(4,'0') unless entities.key?(name) + when /^([A-F0-9]+)\;([a-z][a-z]+)\;(.*?)\;(.*?)\s*$/io then + code, name, adobe, comment = $1, $2, $3, $4 + entities[name] = code.rjust(4,'0') unless entities.key?(name) + end end end - if outputname and not outputname.empty? then - if f = File.open(outputname,'w') then - flushentities(f,entities) - f.close - else - flushentities($stdout,entities) - end + end + if outputname and not outputname.empty? then + if f = File.open(outputname,'w') then + report("saving #{entities.size} entities in #{outputname}") + flushentities(f,entities,doctype) + f.close else - flushentities($stdout,entities) + flushentities($stdout,entities,doctype) end + else + flushentities($stdout,entities,doctype) end - end end - class Commands include CommandBase @@ -2289,11 +2307,13 @@ class Commands begin system("unzip -uo #{archive}") rescue + report("fatal error, make sure that you have 'unzip' in your path") return false else return true end else + report("fatal error, '{archive}' has not been downloaded") return false end end @@ -2364,6 +2384,7 @@ commandline.registerflag('all') commandline.registerflag('xml') commandline.registerflag('log') commandline.registerflag('utf8') +commandline.registerflag('doctype') # general diff --git a/scripts/context/ruby/graphics/gs.rb b/scripts/context/ruby/graphics/gs.rb index 588ef2417..2c1079d1a 100644 --- a/scripts/context/ruby/graphics/gs.rb +++ b/scripts/context/ruby/graphics/gs.rb @@ -356,7 +356,7 @@ class GhostScript arguments = '' arguments << "\@gsprofile.ini " - arguments << "-q -sDEVICE=pdfwrite -dNOPAUSE -dNOCACHE -dBATCH -dSAFER" + arguments << "-q -sDEVICE=pdfwrite -dNOPAUSE -dNOCACHE -dBATCH -dSAFER " arguments << "#{gscolorswitch} " arguments << "#{gsdefaults} " arguments << "-sOutputFile=#{outfile} #{gsstream} -c quit " @@ -432,7 +432,7 @@ class GhostScript # -dEPSFitPage and -dEPSCrop behave weird (don't work) - arguments = "-sDEVICE=bbox -dSAFER -dNOPAUSE -dBATCH #{inpfile}" + arguments = "-sDEVICE=bbox -dSAFER -dNOPAUSE -dBATCH #{inpfile} " debug("ghostscript: #{arguments}") diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index 9b1fa1627..b2f73df50 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.05.17 10:08} +\newcontextversion{2006.05.18 20:03} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index 7d41beb55..d279b2339 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.05.16 18:35} +\def\contextversion{2006.05.18 20:03} %D For those who want to use this: diff --git a/tex/context/base/core-fil.tex b/tex/context/base/core-fil.tex index a3311f562..d31b4af22 100644 --- a/tex/context/base/core-fil.tex +++ b/tex/context/base/core-fil.tex @@ -265,8 +265,8 @@ \fi \let\currentmoduleparameters\empty} -\def\moduleparameter #1#2{\csname\??md:#1:#2\endcsname} -\def\currentmoduleparameter#1{\csname\??md:\currentmodule:#1\endcsname} +\def\moduleparameter #1#2{\executeifdefined{\??md:#1:#2}\s!empty} +\def\currentmoduleparameter#1{\executeifdefined{\??md:\currentmodule:#1}\s!empty} % \usemodule[newmml] % \usemodule[newmml][a=b] @@ -274,10 +274,31 @@ % \usemodule[x][newmml][a=b] % % \startmodule [mathml] -% \setupmodule[a=c] [\currentmoduleparameter{a}] % user vars will be set afterwards -% \setupmodule[a=c] [\currentmoduleparameter{a}] % user vars are now forgotten +% \setupmodule[a=c] \relax [\currentmoduleparameter{a}] % user vars will be set afterwards +% \setupmodule[a=c] \relax [\currentmoduleparameter{a}] % user vars are now forgotten % \stopmodule +% one can introduce test sections with: +% +% \enablemode[newmml:test:\currentmoduleparameter{test}] +% \startmode[newmml:test:yes} ... \stopmode +% +% these will be ignored unless test=yes +% +% however, a better way is: + +\let\stopmoduletestsection\donothing + +\def\startmoduletestsection + {\bgroup + \setupmodule % we need to make sure that the vars are set + \doifelse{\currentmoduleparameter\v!test}\v!yes + {\egroup + \writestatus{\currentmodule}{loading experimental code}} + {\egroup + \writestatus{\currentmodule}{skipping experimental code}% + \gobbleuntil\stopmoduletestsection}} + %D We also support a singular call, which saves us for %D frustrations when we do a typo. diff --git a/tex/context/base/core-pgr.tex b/tex/context/base/core-pgr.tex index fa0836dee..fe82ac643 100644 --- a/tex/context/base/core-pgr.tex +++ b/tex/context/base/core-pgr.tex @@ -1343,7 +1343,8 @@ {\global\chardef\currentamrealpage0}}% % not found \expanded {\doglobal\noexpand\appendtoks - #1_menu_button(\currentamposition,\the\currentamrealpage,\noexpand\MPpos{#1:\currentamposition}) ; +% #1_menu_button(\currentamposition,\the\currentamrealpage,\noexpand\MPpos{#1:\currentamposition}) ; + #1_menu_button(\currentamposition,\the\currentamrealpage,\MPpos{#1:\currentamposition}) ; \to \MPmenutoks}% \hpos{#1:\currentamposition}{#3}} {#3}} diff --git a/tex/context/base/font-ini.tex b/tex/context/base/font-ini.tex index fa8523845..d8a06d68c 100644 --- a/tex/context/base/font-ini.tex +++ b/tex/context/base/font-ini.tex @@ -3539,7 +3539,7 @@ {\appendtoks \everyhbox{\mr\everyhbox\emptytoks}% \everyvbox{\mr\everyvbox\emptytoks}% - \to \everymath} + \to \everymathematics} % was \everymath % \enableencodinginmath % too untested to enable by default diff --git a/tex/context/base/math-ini.tex b/tex/context/base/math-ini.tex index a9f93a4f4..7f5074947 100644 --- a/tex/context/base/math-ini.tex +++ b/tex/context/base/math-ini.tex @@ -328,8 +328,42 @@ \def\definemathcharacter {\dosixtupleempty\dodefinemathcharacter} +% \def\dodefinemathcharacter[#1][#2][#3][#4][#5][#6]% +% {\setmathtoks +% \ifdynamicmathfamilies \let\purefamilyhex\relax \fi +% \doifnumberelse{#1} +% {\scratchcounter#1} +% {\scratchcounter\@EA`\string#1}% +% \appendetoks +% \ifsixthargument +% \delcode\the\scratchcounter="% +% \ifnum\puremathcode{#2}>7 0\else\puremathcode{#2}\fi +% \purefamilyhex{#3}\uchexnumbers{#4}% +% \purefamilyhex{#5}\uchexnumbers{#6}\space +% \else\iffourthargument +% \mathcode\the\scratchcounter="% +% \ifnum\puremathcode{#2}>7 0\else\puremathcode{#2}\fi +% \purefamilyhex{#3}\uchexnumbers{#4}\space +% \fi\fi\to\mathtoks +% \let\purefamilyhex\normalpurefamilyhex +% \tracemathcharacter{#1}} + +\newtoks\mathscratchtoks + +\def\definemathcharacter + {\chardef\mathcharactermode\zerocount + \dosixtupleempty\dodefinemathcharacter} + +\def\redefinemathcharacter + {\chardef\mathcharactermode\plusone + \dosixtupleempty\dodefinemathcharacter} + \def\dodefinemathcharacter[#1][#2][#3][#4][#5][#6]% - {\setmathtoks + {\ifcase\mathcharactermode + \setmathtoks + \or + \let\mathtoks\mathscratchtoks \mathtoks\emptytoks + \fi \ifdynamicmathfamilies \let\purefamilyhex\relax \fi \doifnumberelse{#1} {\scratchcounter#1} @@ -344,9 +378,16 @@ \mathcode\the\scratchcounter="% \ifnum\puremathcode{#2}>7 0\else\puremathcode{#2}\fi \purefamilyhex{#3}\uchexnumbers{#4}\space - \fi\fi\to\mathtoks + \fi\fi + \to \mathtoks \let\purefamilyhex\normalpurefamilyhex - \tracemathcharacter{#1}} + \ifcase\mathcharactermode + \expandafter\tracemathcharacter + \or + \the\mathtoks + \mathtoks\emptytoks + \expandafter\gobbleoneargument + \fi{#1}} % maybe lookahead \def\tracemathcharacter#1% {\iftracemathcollection @@ -461,25 +502,52 @@ %D {ifmathpunctuation, enablemathpunctuation, %D definemathpunctuation} %D +%D This will replace periods by comma's: +%D %D \starttyping -%D \definemathpunctuation . mathperiod textperiod -%D \definemathpunctuation , mathcomma textcomma +%D \definemathpunctuation . textcomma textperiod +%D \definemathpunctuation , textcomma textcomma +%D +%D \appendtoks +%D \redefinemathcharacter [.] [ord] [mi] ["3B]% +%D \to \everymathpunctuation %D \stoptyping -\newif\ifmathpunctuation +% \newif\ifmathpunctuation +% +% \def\enablemathpunctuation{\mathpunctuationtrue} +% +% \def\definemathpunctuation #1 #2 #3 % +% {\appendtoks +% \initializemathpunctuation{#1}{#2}{#3}% +% \to\everymathematics} +% +% \def\initializemathpunctuation#1#2#3% sloowww +% {\ifmathpunctuation % hm move thsi test to everymath, or better a separate token list +% \mathcode`#1="8000 +% \defineactivecharacter #1 {\dohandlemathpunctuation{#2}{#3}}% +% \fi} +% +% \unexpanded\def\dohandlemathpunctuation#1#2% \if fails in mathml interval +% {\def\next{\csname\ifx\space\nexttoken#2\else#1\fi\endcsname}% +% \futurelet\nexttoken\next} + +\newtoks\everymathpunctuation -\def\enablemathpunctuation{\mathpunctuationtrue} +\def\enablemathpunctuation % can be called inside math, so after \everymathematics + {\the\everymathpunctuation + \appendtoksonce + \the\everymathpunctuation + \to\everymathematics} \def\definemathpunctuation #1 #2 #3 % {\appendtoks \initializemathpunctuation{#1}{#2}{#3}% - \to\everymath} + \to\everymathpunctuation} \def\initializemathpunctuation#1#2#3% sloowww - {\ifmathpunctuation - \mathcode`#1="8000 - \defineactivecharacter #1 {\dohandlemathpunctuation{#2}{#3}}% - \fi} + {\mathcode`#1="8000 + \defineactivecharacter #1 {\dohandlemathpunctuation{#2}{#3}}} \unexpanded\def\dohandlemathpunctuation#1#2% \if fails in mathml interval {\def\next{\csname\ifx\space\nexttoken#2\else#1\fi\endcsname}% diff --git a/tex/context/base/mult-con.tex b/tex/context/base/mult-con.tex index 3e00c2e0a..5c359ca3a 100644 --- a/tex/context/base/mult-con.tex +++ b/tex/context/base/mult-con.tex @@ -2016,6 +2016,10 @@ subsubsubsubsubsubject: subsubsubsubsubonderwerp subsubsubsubsub an zap attivo on actif + test: test test + test test + test test + test serried: aanelkaar serried kleinerabstand semknuto vicino serried @@ -2849,7 +2853,7 @@ subsubsubsubsubsubject: subsubsubsubsubonderwerp subsubsubsubsub retour test: test test test test - test text + test test test inbetween: tussen inbetween zwischen mezi diff --git a/tex/context/base/x-newmml.tex b/tex/context/base/x-newmml.tex index 54e5940ca..517d67f55 100644 --- a/tex/context/base/x-newmml.tex +++ b/tex/context/base/x-newmml.tex @@ -21,7 +21,7 @@ %D Then we start defining the rendering macros: -\writestatus{loading}{Context XML Macros (MathML Rederer)} +\writestatus{loading}{Context XML Macros (MathML Renderer)} \startmodule [mathml] @@ -36,6 +36,8 @@ \def\MMLrm{\mr} +\def\MMLseparator#1{{#1}} % nils space after separator + %D First we define some general formula elements. \defineXMLenvironment [formula] [label=,sublabel=] @@ -106,8 +108,6 @@ %D A few math related macros: -\def\MMLccomma{{,}} % are the extra {} still needed? - \let\MMLctempresetlist\empty \def\setMMLcreset{\edef\MMLctempresetlist} \newcount\MMLapplydepth \def\MMLcreset{\MMLapplydepth\zerocount} @@ -244,51 +244,6 @@ \startsavingXMLelements \stopsetups -% \startsetups mmc:apply:stop -% \stopsavingXMLelements -% \MMLmathinner { -% \expanded{\doifinsetelse{\getXMLstackname\plusone}{\MMLcmainresetlist,\MMLctempresetlist}} -% \MMLcreset -% \donothing -% \ifcase\MMLapplydepth \else -% \doifXMLparelse{apply}{open} \donothing{\getXMLarguments{apply}{open="("}}% slow -% \doifXMLparelse{apply}{close}\donothing{\getXMLarguments{apply}{close=")"}}% slow -% \fi -% \doifXMLparelse{apply}{open}{\left\XMLpar{apply}{open}{}}\donothing -% \advance\MMLapplydepth\plusone -% \begingroup -% \let\MMLctempresetlist\empty -% \doifelse {\getXMLstackname\plusone} {apply} { -% % ... .. -% \MMLcreset -% \getXMLstackdata\plusone -% \ifconditional\somepostponedMMLactions -% \postponedMMLactions -% \else -% \left(\MMLcreset\getXMLstackdata\plustwo\right) -% \fi -% } { -% \doifelse {\getXMLstackname\plusone} {fn} { -% % also postpone -% \directsetup{mmc:fn:apply} -% } { -% \doifelse {\getXMLstackname\plusone} {ci} { -% \getXMLstackdata\plusone -% \ifnum\XMLstacklevel>\plusone -% \left(\MMLcreset\flushXMLstackwith\plustwo\MMLccomma\right) -% \fi -% } { -% \getXMLstackdata\plusone -% } -% } -% } -% \endgroup -% \advance\MMLapplydepth\minusone -% \doifXMLparelse{apply}{close}{\right\XMLpar{apply}{close}{}}\donothing -% } -% \endgroup -% \stopsetups - \startsetups mmc:apply:stop \stopsavingXMLelements \MMLmathinner { @@ -305,12 +260,12 @@ \let\MMLctempresetlist\empty \doifelse {\getXMLstackname\plusone} {apply} { % ... .. -\doifelseMMCfunctioninapply \plusone {plus,minus} { - % yet incomplete and rather untested - % x -} { - \MMLcreset -} + \doifelseMMCfunctioninapply \plusone {plus,minus} { + % yet incomplete and rather untested + % x + } { + \MMLcreset + } \getXMLstackdata\plusone \ifconditional\somepostponedMMLactions \postponedMMLactions @@ -322,13 +277,18 @@ % also postpone \directsetup{mmc:fn:apply} } { - \doifelse {\getXMLstackname\plusone} {ci} { - \getXMLstackdata\plusone - \ifnum\XMLstacklevel>\plusone - \left(\MMLcreset\flushXMLstackwith\plustwo\MMLccomma\right) - \fi + \doifelse {\getXMLstackname\plusone} {csymbol} { + % also postpone + \directsetup{mmc:csymbol:apply} } { - \getXMLstackdata\plusone + \doifelse {\getXMLstackname\plusone} {ci} { + \getXMLstackdata\plusone + \ifnum\XMLstacklevel>\plusone + \left(\MMLcreset\flushXMLstackwith\plustwo{\MMLseparator,}\right) + \fi + } { + \getXMLstackdata\plusone + } } } } @@ -395,7 +355,7 @@ \getXMLstackdata\plusone \ifnum\XMLstacklevel>\plusone \getXMLentity{NegThinSpace} - \left(\MMLcreset\flushXMLstackwith\plustwo\MMLccomma\right) + \left(\MMLcreset\flushXMLstackwith\plustwo{\MMLseparator,}\right) \fi } } { @@ -462,6 +422,56 @@ \defineXMLargument [cn] [type=,base=] {\XMLval{mmc:cn}{\XMLop{type}} {\firstofoneargument}} \defineXMLargument [csymbol] [encoding=text] {\XMLval{mmc:cs}{\XMLop{encoding}}{\firstofoneargument}} +%D The next definition provide a kind of plug-in mechanism (see +%D the open math extension module). + +\defineXMLsingular + [csymbol] + [encoding=text, + definitionURL=] + {} + +\startsetups mmc:csymbol:apply + \begingroup + \startsavingXMLelements + \rawXMLstacktext\plusone % still on stack, no check, just attr test + \stopsavingXMLelements + \doifsetupselse{mmc:csymbol:\XMLpar{csymbol}{definitionURL}{}} { + \expanded{\endgroup\noexpand\directsetup{mmc:csymbol:\XMLpar{csymbol}{definitionURL}{}}} + } { + \endgroup + \XMLval{mmc:cs}{\XMLop{encoding}}{\firstofoneargument} + } +\stopsetups + +%D Alternative b will convert periods into comma's: +%D +%D \startbuffer +%D \startXMLdata +%D 1.23 +%D 1.23 +%D \stopXMLdata +%D +%D \setupMMLappearance[cn] [alternative=b] +%D +%D \startXMLdata +%D 1.23 +%D 1.23 +%D \stopXMLdata +%D \stopbuffer +%D +%D \start \typebuffer \getbuffer \stop + +\setupMMLappearance[cn] [\c!alternative=\v!a] + +\defineXMLargument[cn][type=,base=]{\MMLdocn} + +\def\MMLdocn#1% + {\begingroup + \doif\@@MMLcnalternative\v!b{\redefinemathcharacter [.][ord][mi]["3B]\relax}% + \XMLval{mmc:cn}{\XMLop{type}}{\firstofoneargument}{#1}% + \endgroup} + \defineXMLsingular [sep] {\MMLcsep} \def\MMLcsep{\,} \setupMMLappearance[polar] [\c!alternative=\v!a] % a|b|c @@ -498,7 +508,7 @@ {#1}} \def\MMLcdopolara#1% - {\def\MMLcsep{\MMLccomma}\getXMLentity{polar}\left(#1\right)} + {\def\MMLcsep{\MMLseparator,}\getXMLentity{polar}\left(#1\right)} \def\MMLcdopolarb#1% {\def\MMLcsep##1\empty @@ -621,25 +631,25 @@ \endgroup \stopsetups -\setupMMLappearance[interval][\c!alternative=\v!a] +\setupMMLappearance[interval][\c!alternative=\v!a,\c!separator={,}] \mapXMLvalue {mmc:int} {closed} - {\left[\getXMLstackdata\plusone,\getXMLstackdata\plustwo\right]} + {\left[\getXMLstackdata\plusone\MMLseparator\@@MMLintervalseparator\getXMLstackdata\plustwo\right]} \mapXMLvalue {mmc:int} {open-closed} {\doifelse\@@MMLintervalalternative\v!b - {\left<\getXMLstackdata\plusone,\getXMLstackdata\plustwo\right]} - {\left(\getXMLstackdata\plusone,\getXMLstackdata\plustwo\right]}} + {\left<\getXMLstackdata\plusone\MMLseparator\@@MMLintervalseparator\getXMLstackdata\plustwo\right]} + {\left(\getXMLstackdata\plusone\MMLseparator\@@MMLintervalseparator\getXMLstackdata\plustwo\right]}} \mapXMLvalue {mmc:int} {closed-open} {\doifelse\@@MMLintervalalternative\v!b - {\left[\getXMLstackdata\plusone,\getXMLstackdata\plustwo\right>} - {\left[\getXMLstackdata\plusone,\getXMLstackdata\plustwo\right)}} + {\left[\getXMLstackdata\plusone\MMLseparator\@@MMLintervalseparator\getXMLstackdata\plustwo\right>} + {\left[\getXMLstackdata\plusone\MMLseparator\@@MMLintervalseparator\getXMLstackdata\plustwo\right)}} \mapXMLvalue {mmc:int} {open} {\doifelse\@@MMLintervalalternative\v!b - {\left<\getXMLstackdata\plusone,\getXMLstackdata\plustwo\right>} - {\left(\getXMLstackdata\plusone,\getXMLstackdata\plustwo\right)}} + {\left<\getXMLstackdata\plusone\MMLseparator\@@MMLintervalseparator\getXMLstackdata\plustwo\right>} + {\left(\getXMLstackdata\plusone\MMLseparator\@@MMLintervalseparator\getXMLstackdata\plustwo\right)}} % inverse @@ -722,11 +732,11 @@ \startsetups mmc:lambda:stop \stopsavingXMLelements \doifelse\@@MMLlambdaalternative\v!a { - \getXMLentity{lambda}(\flushXMLstackwith\plusone\MMLccomma) + \getXMLentity{lambda}(\flushXMLstackwith\plusone{\MMLseparator,}) } { \countXMLnamedstack{bvar} \ifnum\scratchcounter>\plusone - \left(\flushXMLnamedstackwith\plusone{bvar}\MMLccomma\right) + \left(\flushXMLnamedstackwith\plusone{bvar}{\MMLseparator,}\right) \else \XMLfirstnamed{bvar} \fi @@ -830,9 +840,9 @@ \startsetups mmc:minmax \doifelse{\getXMLstackdata\plustwo}{bvar} { {}_{\getXMLstackdata\plustwo} - \left\{\flushXMLstackwith\plusthree\MMLccomma\right\} + \left\{\flushXMLstackwith\plusthree{\MMLseparator,}\right\} } { - \left\{\flushXMLstackwith\plustwo \MMLccomma\right\} + \left\{\flushXMLstackwith\plustwo {\MMLseparator,}\right\} } \stopsetups @@ -845,7 +855,7 @@ \startsetups mmc:minus \doif \@@MMLsignreduction \v!yes { - \setMMLcreset{\MMLcfunctionlist} + \setMMLcreset{fn,\MMLcfunctionlist} } \ifcase\XMLstacklevel \or @@ -859,7 +869,7 @@ \startsetups mmc:plus \doifelse \@@MMLsignreduction \v!yes { - \setMMLcreset{plus/,minus/,\MMLcfunctionlist,\MMLcconstructlist} + \setMMLcreset{fn,plus,minus,\MMLcfunctionlist,\MMLcconstructlist}% was plus/, minus/ \doifelse{\getXMLstackname\plustwo} {apply} { % branch needed, else (a-b) + (c-d) goes wrong % reset check in case of (-x) + 37 @@ -980,7 +990,7 @@ % gcd -\defineXMLcommand [gcd] {\gcd\left(\MMLcreset\flushXMLstackwith\plustwo\MMLccomma\right)} +\defineXMLcommand [gcd] {\gcd\left(\MMLcreset\flushXMLstackwith\plustwo{\MMLseparator,}\right)} % and or xor implies @@ -1012,7 +1022,7 @@ \stopsetups \startsetups mmc:forall-exists - _{\flushXMLnamedstackwith\plustwo{bvar}\MMLccomma} + _{\flushXMLnamedstackwith\plustwo{bvar}{\MMLseparator,}} \XMLdoifonstackelse {condition} { \getXMLentity{ThickSpace} \begingroup @@ -1044,7 +1054,7 @@ \defineXMLcommand [arg] {\getXMLentity{arg} \left(\MMLcreset\flushXMLstackfrom\plustwo\right)} \defineXMLcommand [real] {\getXMLentity{real} \left(\MMLcreset\flushXMLstackfrom\plustwo\right)} \defineXMLcommand [imaginary] {\getXMLentity{imaginary}\left(\MMLcreset\flushXMLstackfrom\plustwo\right)} -\defineXMLcommand [lcm] {\getXMLentity{lcm} \left(\flushXMLstackwith\plustwo\MMLccomma\right)} +\defineXMLcommand [lcm] {\getXMLentity{lcm} \left(\flushXMLstackwith\plustwo{\MMLseparator,}\right)} \defineXMLcommand [floor] {\getXMLentity{lfloor} \flushXMLstackfrom\plustwo \getXMLentity{rfloor}} \defineXMLcommand [ceiling] {\getXMLentity{lceiling} \flushXMLstackfrom\plustwo \getXMLentity{rceiling}} @@ -1348,7 +1358,7 @@ \XMLdoifonstackelse{condition} { \left\{\XMLfirstnamed{bvar}\,\middle\vert\,\XMLfirstnamed{condition}\right\} } { - \left\{\flushXMLstackwith\plusone\MMLccomma\right\} + \left\{\flushXMLstackwith\plusone{\MMLseparator,}\right\} } \endgroup \stopsetups @@ -1369,7 +1379,7 @@ \ifconditional\MMLlistdelimiters\left [\fi \begingroup \settrue\MMLlistdelimiters - \flushXMLstackwith\plusone\MMLccomma + \flushXMLstackwith\plusone{\MMLseparator,} \endgroup \ifconditional\MMLlistdelimiters\right]\fi \endgroup @@ -1510,7 +1520,7 @@ \defineXMLcommand [vector] {\directsetup{mmc:vector}} % sequence -\setupMMLappearance [vector] [\c!direction=\v!horizontal] +\setupMMLappearance [vector] [\c!direction=\v!horizontal,\c!separator={,}] \defineXMLnested [vector] @@ -1522,12 +1532,11 @@ \startsavingXMLelements \stopsetups - \startsetups mmc:vector:stop \stopsavingXMLelements \ifnum\XMLstacklevel>\plusone \doifelse\@@MMLvectordirection\v!horizontal { - \left(\flushXMLstackwith\plusone\MMLccomma\right) + \left(\flushXMLstackwith\plusone{\MMLseparator\@@MMLvectorseparator}\right) } { \collectXMLstack\crcr \MMLcreset\left(\matrix{\the\XMLRtoks}\right) @@ -1595,7 +1604,7 @@ \stopsetups \startsetups mmc:selector - \MMLmathinner{\getXMLstackdata\plustwo}_{\MMLcreset\flushXMLstackwith\plusthree\MMLccomma} + \MMLmathinner{\getXMLstackdata\plustwo}_{\MMLcreset\flushXMLstackwith\plusthree{\MMLseparator,}} \stopsetups \defineXMLcommand [vectorproduct] {\getXMLstackdata\plustwo\getXMLentity{vectorproduct}\getXMLstackdata\plusthree} @@ -1648,9 +1657,6 @@ \defineXMLcommand [primes] {\getXMLentity{primes}} \defineXMLcommand [exponentiale] {\getXMLentity{ExponentialE}} \defineXMLcommand [imaginaryi] {\getXMLentity{ImaginaryI}} -% \defineXMLcommand [notanumber] {\mathop{\MMLrm NaN}} -% \defineXMLcommand [true] {\mathop{\MMLrm true}} -% \defineXMLcommand [false] {\mathop{\MMLrm false}} \defineXMLcommand [notanumber] {\mathop{\mfunction{NaN}}} \defineXMLcommand [true] {\mathop{\mfunction{true}}} \defineXMLcommand [false] {\mathop{\mfunction{false}}} @@ -2352,6 +2358,128 @@ \endgroup \stopsetups +% experimental patches + +\startmoduletestsection + +\let\MMLdoL\donothing +\let\MMLdoR\donothing + +\startsetups mmc:apply:stop + \stopsavingXMLelements + \MMLmathinner { + \expanded{\doifinsetelse{\getXMLstackname\plusone}{\MMLcmainresetlist,\MMLctempresetlist}} + \MMLcreset + \donothing + \ifcase\MMLapplydepth \else + \doifXMLparelse{apply}{open} \donothing{\getXMLarguments{apply}{open="("}}% slow + \doifXMLparelse{apply}{close}\donothing{\getXMLarguments{apply}{close=")"}}% slow + \fi + \doifXMLparelse{apply}{open} + {\def\MMLdoL{\left \XMLpar{apply}{open} {(}} + \def\MMLdoR{\right\XMLpar{apply}{close}{)}}} + {\let\MMLdoL\donothing + \let\MMLdoR\donothing} + \advance\MMLapplydepth\plusone + \begingroup + \let\MMLctempresetlist\empty + \doifelse {\getXMLstackname\plusone} {apply} { + % ... .. + \doifelseMMCfunctioninapply \plusone {plus,minus} { + % yet incomplete and rather untested + % x + } { + \MMLcreset + } + \MMLdoL + \getXMLstackdata\plusone + \ifconditional\somepostponedMMLactions + \postponedMMLactions + \else + \left(\MMLcreset\getXMLstackdata\plustwo\right) + \fi + \MMLdoR + } { + \doifelse {\getXMLstackname\plusone} {fn} { + % \MMLdoL/R are to be taken care of in the next setup + \directsetup{mmc:fn:apply} + } { + \doifelse {\getXMLstackname\plusone} {csymbol} { + % \MMLdoL/R are to be taken care of in the next setup + \directsetup{mmc:csymbol:apply} + } { + \doifelse {\getXMLstackname\plusone} {ci} { + % \MMLdoL/R are to be taken care of in the next setup + \directsetup{mmc:ci:apply} + } { + \MMLdoL + \getXMLstackdata\plusone + \MMLdoR + } + } + } + } + \endgroup + \advance\MMLapplydepth\minusone + \directsetup{apply:flush} + } + \endgroup +\stopsetups + +\startsetups mmc:fn:apply + \begingroup + \startsavingXMLelements + \rawXMLstacktext\plusone % still on stack, no check, just fn content + \stopsavingXMLelements + \doifelse {\getXMLstackname\plusone} {ci} { + \flattenXMLcontent{\getXMLstackdata\plusone} + \doifsetupselse{mmc:fn:\flattenedXMLcontent} { +% \MMLdoL/MMLdoR to be handled in plugin + \global\defXMLstackdata\XMLfnoperator\plusone + \expanded{\endgroup\noexpand\directsetup{mmc:fn:\flattenedXMLcontent}} + } { + \endgroup + \MMLcreset +\MMLdoL + \getXMLstackdata\plusone + \ifnum\XMLstacklevel>\plusone + \getXMLentity{NegThinSpace} + \left(\MMLcreset\flushXMLstackwith\plustwo{\MMLseparator,}\right) + \fi +\MMLdoR + } + } { + \endgroup + \MMLcreset +\MMLdoL + \getXMLstackdata\plusone +\MMLdoR + } +\stopsetups + +\startsetups mmc:csymbol:apply + \begingroup + \startsavingXMLelements + \rawXMLstacktext\plusone % still on stack, no check, just attr test + \stopsavingXMLelements + % \MMLdoL/MMLdoR to be handled in plugin + \doifsetupselse{mmc:csymbol:\XMLpar{csymbol}{definitionURL}{}} { + \expanded{\endgroup\noexpand\directsetup{mmc:csymbol:\XMLpar{csymbol}{definitionURL}{}}} + } { + \endgroup + \XMLval{mmc:cs}{\XMLop{encoding}}{\firstofoneargument} + } +\stopsetups + +\startsetups mmc:ci:apply + \getXMLstackdata\plusone + \ifnum\XMLstacklevel>\plusone + \left(\MMLcreset\flushXMLstackwith\plustwo{\MMLseparator,}\right) + \fi +\stopsetups + +\stopmoduletestsection + \stopmodule \protect \endinput diff --git a/tex/context/base/x-newmmo.tex b/tex/context/base/x-newmmo.tex new file mode 100644 index 000000000..2becfb30a --- /dev/null +++ b/tex/context/base/x-newmmo.tex @@ -0,0 +1,126 @@ +%D \module +%D [ file=x-newmmo, +%D version=2006.05.17, +%D title=\CONTEXT\ XML Modules, +%D subtitle=MathML Renderer/Open Math Extensions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Strange things, why not mapped onto normal content MathML and/or +%D onto processing instructions. + +\unprotect + +%D \startbuffer +%D +%D +%D +%D +%D a +%D 2 +%D +%D a +%D +%D +%D \stopbuffer +%D +%D \typebuffer \processXMLbuffer + +\startsetups mmc:csymbol:http://www.openmath.org/cd/nums1\string#rational + \MMLcreset + \getXMLstackdata\plustwo/\getXMLstackdata\plusthree +\stopsetups + +%D \startbuffer +%D +%D +%D +%D y +%D x +%D +%D +%D \stopbuffer +%D +%D \typebuffer \processXMLbuffer + +\startsetups mmc:csymbol:http://www.openmath.org/cd/math4all\string#diffquot + \MMLcreset + \frac { + \Delta\getXMLstackdata\plustwo + } { + \Delta\getXMLstackdata\plusthree + } +\stopsetups + +%D \startbuffer +%D +%D +%D +%D y +%D +%D +%D \stopbuffer +%D +%D \typebuffer \processXMLbuffer +%D +%D \startbuffer +%D +%D +%D +%D +%D +%D y +%D +%D +%D +%D f +%D x +%D +%D +%D f +%D +%D +%D x +%D 1 +%D +%D +%D +%D +%D +%D +%D \stopbuffer +%D +%D \typebuffer \processXMLbuffer + +\startsetups mmc:csymbol:http://www.openmath.org/cd/math4all\string#difference + \MMLcreset + \Delta\getXMLstackdata\plustwo +\stopsetups + +%D \startbuffer +%D +%D +%D +%D s +%D t +%D +%D +%D \stopbuffer +%D +%D \typebuffer \processXMLbuffer + +\startsetups mmc:csymbol:http://www.openmath.org/cd/math4all\string#diff + \MMLcreset + \frac { + \mfunction{\getXMLentity{mathematicald}}\getXMLstackdata\plustwo + } { + \mfunction{\getXMLentity{mathematicald}}\getXMLstackdata\plusthree + } +\stopsetups + +\protect \endinput diff --git a/tex/context/base/x-om2cml.xsl b/tex/context/base/x-om2cml.xsl index 06f7442c8..acd95db2c 100644 --- a/tex/context/base/x-om2cml.xsl +++ b/tex/context/base/x-om2cml.xsl @@ -1247,4 +1247,12 @@ + + + + + + + + diff --git a/tex/context/base/x-sm2om.xsl b/tex/context/base/x-sm2om.xsl index 04677f30a..a37ce1e75 100644 --- a/tex/context/base/x-sm2om.xsl +++ b/tex/context/base/x-sm2om.xsl @@ -26,10 +26,10 @@ - + - + @@ -39,13 +39,48 @@ /x-openmath.xsl + + + + + + + nums1 + rational + + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.openmath.org/OpenMath 2.0 - - - + + + @@ -66,34 +101,45 @@ http://www.openmath.org/OpenMath 2.0 + + + + cc + + + + + + interval1 - interval_oo + interval_ + + + + + + + + + + + + + + http://www.openmath.org/OpenMath + 2.0 + + + linalg3 + vector - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + diff --git a/tex/context/interface/cont-ro.xml b/tex/context/interface/cont-ro.xml index 70beba87a..bc7f41264 100644 --- a/tex/context/interface/cont-ro.xml +++ b/tex/context/interface/cont-ro.xml @@ -8505,7 +8505,7 @@ - + @@ -9317,7 +9317,7 @@ - + diff --git a/tex/context/interface/keys-cz.xml b/tex/context/interface/keys-cz.xml index 7ce6d9f6e..e165887d8 100644 --- a/tex/context/interface/keys-cz.xml +++ b/tex/context/interface/keys-cz.xml @@ -1,6 +1,6 @@ - + @@ -496,6 +496,7 @@ + diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml index 7fe0242cc..281f596ba 100644 --- a/tex/context/interface/keys-de.xml +++ b/tex/context/interface/keys-de.xml @@ -1,6 +1,6 @@ - + @@ -496,6 +496,7 @@ + diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml index 9641b780f..1e5439012 100644 --- a/tex/context/interface/keys-en.xml +++ b/tex/context/interface/keys-en.xml @@ -1,6 +1,6 @@ - + @@ -496,6 +496,7 @@ + diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml index 56b45a319..5977c0a3a 100644 --- a/tex/context/interface/keys-fr.xml +++ b/tex/context/interface/keys-fr.xml @@ -1,6 +1,6 @@ - + @@ -496,6 +496,7 @@ + diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml index eff156850..c5422a6c6 100644 --- a/tex/context/interface/keys-it.xml +++ b/tex/context/interface/keys-it.xml @@ -1,6 +1,6 @@ - + @@ -496,6 +496,7 @@ + diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml index b9fbc1980..a65e8f658 100644 --- a/tex/context/interface/keys-nl.xml +++ b/tex/context/interface/keys-nl.xml @@ -1,6 +1,6 @@ - + @@ -496,6 +496,7 @@ + diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml index 964963ccd..204033ebd 100644 --- a/tex/context/interface/keys-ro.xml +++ b/tex/context/interface/keys-ro.xml @@ -1,6 +1,6 @@ - + @@ -496,6 +496,7 @@ + @@ -703,7 +704,7 @@ - + -- cgit v1.2.3