-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ContentMathML extension proposal
Our current ContentMathML extension is built around David Carlisle's XSLT solution ctop (c-to-p, content to presentation). This solution makes it hard to maintain and use. It is also not ideal as xslt support in Chrome might be dropped.
- remove dependency on the xslt stylesheet, implement a pure JavaScript solution
- build on ctop.js
- if possible, improvements should be contributed upstream to ctop.js
- Identify, develop and document APIs to allow page authors to modify the conversion process
- scope: to be determined. A first approximation might be where the MathML spec offers two Presentation MathML constructs for one Content MathML element (e.g. interval, lambda).
- maintain or improve current Content-to-Presentation conversion quality
We do not implement the Content MathML => Strict Content MathML transformation mentioned (optionally) in the MathML spec. Instead, we take a down-to-earth approach to Strict Content MathML.
Essentially, by handling
<apply><csymbol>foo</csymbol>
and
<apply><foo/>
as the same thing.
This is a rather loose interpretation of Strict Content which should care about Content Dictionaries etc. However, we convert for presentation where it doesn't matter. If an author calls a symbol
<csymbol cd="some-weird-category">plus</plus>
then it gets rendered as an infix +. If that's not desired, then we humbly suggest not to call it plus
.
In the general case, <apply><csymbol>
will be rendered using prefix form. The important thing is that every expression has a rendering, It is not necessary to give strict forms the same rendering as the markup using the specific mathml container elements. But we're happy to accept contributions for specific cases.
So for example if you have
<set><ci>a</ci><ci>b</ci><ci>c</ci></set>
and
<apply>
<csymbol>set</csymbol>
<ci>a</ci><ci>b</ci><ci>c</ci>
</apply>
If one wants both to come out as {a,b,c}
that's fine but if the
first comes out as {a,b,c}
and the second as set(a,b,c)
that is OK too.
But it is always acceptable to render in prefix form.
Since many users of Strict are thinking in terms of lambda calculus expressions (e.g. for theorem provers), they will probably be happier if a sum of terms is rendered as plus(1,2,3)
rather than 1+2+3
or if lambda terms are rendered as written rather than our guess of what a simplified rendering should be.
- localization -- see https://github.com/mathjax/MathJax/issues/695
- prefer embedded Presentation MathML over the conversion. If an author makes the effort to add Presentation as annotation-xml, then MathJax should honor it.
These notes have all been copied into issues, so they're easier to cope with
-
http://www.w3.org/Math/testsuite/build/main/TortureTests/Complexity/complex4-form.xhtml
- unkown nodes: forall, exists, int, partialdiff, sum, product, limit, log,
- might be a different problem b/c these nodes work in other tests? maybe torture test tripping up the xslt?
- http://www.w3.org/Math/testsuite/build/main/Content/ArithmeticAlgebraLogic/divide/divide5-form.xhtml
-
http://www.w3.org/Math/testsuite/build/main/Content/ArithmeticAlgebraLogic/divide/divide3-form.xhtml
- FIXED by 120f49fc14
- styling bevelled will often go bad
- more examples:
- http://www.w3.org/Math/testsuite/build/main/Content/ConstantsAndSymbols/pi/rec-pi1-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/Content/ElementaryFunctions/arccosh/arccosh3-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/Content/ElementaryFunctions/arccsch/arccsch3-form.xhtml -- not even using mfrac??
- http://www.w3.org/Math/testsuite/build/main/StrictContent/ArithmeticAlgebraLogic/divide/divide3-form.xhtml
-
http://www.w3.org/Math/testsuite/build/main/Content/ArithmeticAlgebraLogic/logic7-form.xhtml
- FIXED by 65a8b26a0b, 05000bc175 and 50a7b081ef
- unkown node
fn
-
http://www.w3.org/Math/testsuite/build/main/Content/ArithmeticAlgebraLogic/max/max3-form.xhtml
- twisted around [but fine], one x missing
-
http://www.w3.org/Math/testsuite/build/main/Content/ArithmeticAlgebraLogic/minus/minus1-form.xhtml
- no parens
a - (b-c)
- http://www.w3.org/Math/testsuite/build/main/Content/ArithmeticAlgebraLogic/minus/minus2-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/Content/ArithmeticAlgebraLogic/minus/minus9-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/ArithmeticAlgebraLogic/minus/minus2-form.xhtml
- no parens
-
http://www.w3.org/Math/testsuite/build/main/Content/BasicContentElements/lambda/rec-lambda1-form.xhtml
-
lambda
has two suggestions in the spec. This one is valid but maybe we prefer the other? - http://www.w3.org/Math/testsuite/build/main/Content/BasicContentElements/lambda/rec-lambda2-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/BasicContentElements/lambda/rec-lambda1-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/BasicContentElements/lambda/rec-lambda2-form.xhtml
-
-
http://www.w3.org/Math/testsuite/build/main/Content/BasicContentElements/share/rec3-share-1-form.xhtml
- screwed up hrefs
-
http://www.w3.org/Math/testsuite/build/main/Content/Calculus/curl/rec-curl1-form.xhtml
-
curl
-- cf.lambda
above.
-
- http://www.w3.org/Math/testsuite/build/main/Content/Calculus/degree/rec-degree1-form.xhtml
-
http://www.w3.org/Math/testsuite/build/main/Content/Calculus/divergence/rec-divergence1-form.xhtml
-
div
, seecurl
,lambda
-
-
http://www.w3.org/Math/testsuite/build/main/Content/Calculus/grad/rec-grad1-form.xhtml
-
grad
, seecurl
etc
-
- http://www.w3.org/Math/testsuite/build/main/Content/Calculus/divergence/rec-divergence2-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/Content/ElementaryFunctions/arcsin/factorial3-form.xhtml
-
http://www.w3.org/Math/testsuite/build/main/Content/Error/rec-cerror1-form.xhtml
- poor spacing / missing colon
-
http://www.w3.org/Math/testsuite/build/main/Content/LinearAlgebra/matrix/matrix3-form.xhtml
- parens for matrices matter of taste or not?
- http://www.w3.org/Math/testsuite/build/main/Content/LinearAlgebra/vectorproduct/rec-vectorproduct1-form.xhtml
-
http://www.w3.org/Math/testsuite/build/main/Content/Relations/geq/geq2-form.xhtml
- unkown node: geq
- neq -- http://www.w3.org/Math/testsuite/build/main/Content/Relations/neq/neq2-form.xhtml
- in -- http://www.w3.org/Math/testsuite/build/main/Content/SequencesAndSeries/product/product2-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/Content/TheoryOfSets/in/in2-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/Content/TheoryOfSets/notprsubset/notprsubset2-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/Content/TheoryOfSets/notsubset/notsubset2-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/Content/TheoryOfSets/prsubset/prsubset2-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/Content/TheoryOfSets/subset/subset2-form.xhtml
-
http://www.w3.org/Math/testsuite/build/main/Content/Statistics/variance/rec-variance1-form.xhtml
- not sure if that's good. Also, multiple rendering options
var(X)
- not sure if that's good. Also, multiple rendering options
-
http://www.w3.org/Math/testsuite/build/main/Content/TheoryOfSets/cartesianproduct/rec-cartesianproduct2-form.xhtml
- not sure if that's what we want. Could be a conf. option
-
http://www.w3.org/Math/testsuite/build/main/Content/TheoryOfSets/union/union3-form.xhtml
- images has phi, ctop varphii -- but that seems correct for
φ
- images has phi, ctop varphii -- but that seems correct for
-
http://www.w3.org/Math/testsuite/build/main/StrictContent/ArithmeticAlgebraLogic/forall/forall1-form.xhtml
- lambda is not properly resolved (sort of duplicated); "such that" seems bad.
- http://www.w3.org/Math/testsuite/build/main/StrictContent/ArithmeticAlgebraLogic/forall/rec-forall4-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/ArithmeticAlgebraLogic/max/max3-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/ArithmeticAlgebraLogic/max/rec-max2-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/ArithmeticAlgebraLogic/min/min1-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/ArithmeticAlgebraLogic/min/rec-min2-form.xhtml
-
http://www.w3.org/Math/testsuite/build/main/StrictContent/BasicContentElements/image/rec-image1-form.xhtml
- interval_cc should not be visible?
- http://www.w3.org/Math/testsuite/build/main/StrictContent/BasicContentElements/interval/rec-interval2-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/BasicContentElements/piecewise/rec-piecewise1-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/Calculus/bvar/rec-bvar2-form.xhtml
-
http://www.w3.org/Math/testsuite/build/main/StrictContent/Calculus/degree/degree2-form.xhtml
- extra 0 subscript
-
http://www.w3.org/Math/testsuite/build/main/StrictContent/Calculus/divergence/rec-divergence2-form.xhtml
- might just be missing parens but looks very wrong...
- http://www.w3.org/Math/testsuite/build/main/StrictContent/Calculus/int/int1-form.xhtml (and lambda woes)
-
http://www.w3.org/Math/testsuite/build/main/StrictContent/Calculus/int/int2-form.xhtml
- more lambda problems
- http://www.w3.org/Math/testsuite/build/main/StrictContent/Calculus/int/rec-int3-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/Calculus/int/rec-int4-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/Calculus/int/rec-int5-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/Calculus/partialdiff/rec-partialdiff3-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/SequencesAndSeries/product/product2-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/SequencesAndSeries/product/rec-product3-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/SequencesAndSeries/sum/rec-sum1-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/SequencesAndSeries/sum/sum2-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/StrictContent/SequencesAndSeries/sum/sum3-form.xhtml
-
http://www.w3.org/Math/testsuite/build/main/StrictContent/Calculus/laplacian/rec-laplacian1-form.xhtml
- Laplacian; see
curl
,div
.
- Laplacian; see
-
http://www.w3.org/Math/testsuite/build/main/StrictContent/Calculus/partialdiff/rec-partialdiff5-form.xhtml
- very wrong.
- http://www.w3.org/Math/testsuite/build/main/StrictContent/ConstantsAndSymbols/primes/rec-primes1-form.xhtml
-
http://www.w3.org/Math/testsuite/build/main/StrictContent/LinearAlgebra/matrix/rec-matrix1-form.xhtml
- superfluous
matrixrow
strings - http://www.w3.org/Math/testsuite/build/main/StrictContent/LinearAlgebra/selector/rec-selector1-form.xhtml
- superfluous
-
http://www.w3.org/Math/testsuite/build/main/StrictContent/TheoryOfSets/card/rec-card1-form.xhtml
- alternative rendering
|A|
preferred? optional?
- alternative rendering
-
http://www.w3.org/Math/testsuite/build/main/ErrorHandling/NumChildren/noChildContent-form.xhtml
- unkown nodes: domainofapp, piece, otherwise, moment
- http://www.w3.org/Math/testsuite/build/main/ErrorHandling/NumChildren/emptyContent-form.xhtml
lots of bidi works. Does the ContentMML extension do anything here?
- http://www.w3.org/Math/testsuite/build/main/Topics/BiDi/Complex/Maghreb1-form.xhtml almost works -- but some VERY weird "unkown node: SVG" issue.
- http://www.w3.org/Math/testsuite/build/main/Topics/BiDi/RTL/longdivision-rtl1-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/Topics/LineBreak/linebreaking006-linebreakmultchar-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/Topics/LineBreak/linebreaking008-indentalign2-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/Topics/LineBreak/linebreaking010-indentshift-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/Topics/LineBreak/linebreaking011-indentamount-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/Topics/LineBreak/linebreaking011-indentamount-form.xhtml
- http://www.w3.org/Math/testsuite/build/main/Topics/LineBreak/linebreaking016-indentalign4-form.xhtml