OASIS Open Document Format for Office Applications (OpenDocument) TC

  • 1.  Enable MathML for browsers

    Posted 10-08-2019 11:57
    Hi all, from https://www.mathjax.org/#gettingstarted is the tip to include the following lines in the HTML code <script src=" https://polyfill.io/v3/polyfill.min.js?features=es6" ;></script> <script id="MathJax-script" async src=" https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" ;></script> For XHTML you need a little change, because attributes without values are not possible: <script src=" https://polyfill.io/v3/polyfill.min.js?features=es6" ;></script> <script id="MathJax-script" async="async" src=" https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" ;></script> I have put it before the </head> tag. Then indeed Google Chrome and Microsoft Edge render MathML. I cannot set Internet Explorer 11 to use script, so for Internet Explorer it does not work for me. I have no environment to test Safari. The XTML filter in LibreOffice generates the attribute display="block" in the <math> element. I think, that should be changed to display="inline". I was wrong, that the attribute 'id' in the generated XHTML would be suitable to find the corresponding replacement image. The value from the attribute 'id' is generated from the attribute 'draw:name'. I'm not even sure, that it is unique. It might be the same after copy&paste a formula. To get the replacement image, it would be necessary to bring the 'href' value of the surrounding <draw:frame> element into the XHTML output. Perhaps a comment will work. Kind regards Regina


  • 2.  Re: [office] Enable MathML for browsers

    Posted 10-08-2019 12:09
    Hi all, Regina Henschel schrieb am 08-Oct-19 um 13:56: I have put it before the </head> tag. Then indeed Google Chrome and Microsoft Edge render MathML. I cannot set Internet Explorer 11 to use script, so for Internet Explorer it does not work for me. I have no environment to test Safari. In Firefox, or SeaMonkey for me, the script works too, but the native rendering is nicer. Kind regards Regina


  • 3.  Re: [office] Enable MathML for browsers

    Posted 10-08-2019 12:55
    Hi all I tested saving CSD01 Part 4 from LO in both HTML (File - Save as) and XHTML (File - Export), and the <img/> elements in the HTML appear to have name attributes with the same values as the id attributes on corresponding <span> elements containing MathML expressions. I haven't checked this thoroughly, but the first and last MathML expressions correspond, and a spot-check of equations elsewhere in the spec correspond. So, Regina, maybe you are too pessimistic. Kind regards, Francis On 08/10/2019 12:56, Regina Henschel wrote: Hi all, from https://www.mathjax.org/#gettingstarted is the tip to include the following lines in the HTML code <script src=" https://polyfill.io/v3/polyfill.min.js?features=es6" ;></script> <script id="MathJax-script" async src=" https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" ;></script> For XHTML you need a little change, because attributes without values are not possible: <script src=" https://polyfill.io/v3/polyfill.min.js?features=es6" ;></script> <script id="MathJax-script" async="async" src=" https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" ;></script> I have put it before the </head> tag. Then indeed Google Chrome and Microsoft Edge render MathML. I cannot set Internet Explorer 11 to use script, so for Internet Explorer it does not work for me. I have no environment to test Safari. The XTML filter in LibreOffice generates the attribute display="block" in the <math> element. I think, that should be changed to display="inline". I was wrong, that the attribute 'id' in the generated XHTML would be suitable to find the corresponding replacement image. The value from the attribute 'id' is generated from the attribute 'draw:name'. I'm not even sure, that it is unique. It might be the same after copy&paste a formula. To get the replacement image, it would be necessary to bring the 'href' value of the surrounding <draw:frame> element into the XHTML output. Perhaps a comment will work. Kind regards Regina --------------------------------------------------------------------- To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. Follow this link to all your TCs in OASIS at: https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php


  • 4.  Re: [office] Enable MathML for browsers

    Posted 10-08-2019 14:56
    hi Regina, On 08.10.19 13:56, Regina Henschel wrote: Hi all, from https://www.mathjax.org/#gettingstarted is the tip to include the following lines in the HTML code <script src=" https://polyfill.io/v3/polyfill.min.js?features=es6" ;></script> <script id="MathJax-script" async src=" https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" ;></script> For XHTML you need a little change, because attributes without values are not possible: <script src=" https://polyfill.io/v3/polyfill.min.js?features=es6" ;></script> <script id="MathJax-script" async="async" src=" https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" ;></script> I have put it before the </head> tag. Then indeed Google Chrome and Microsoft Edge render MathML. I cannot set Internet Explorer 11 to use script, so for Internet Explorer it does not work for me. I have no environment to test Safari. that's great, i think this is by far the simplest fix here. The XTML filter in LibreOffice generates the attribute display="block" in the <math> element. I think, that should be changed to display="inline". this is actually already in the flat-ODT that is the input to the XHTML filter. i've got a hack to export XHTML with formulas as images ... at first i thought it's just a 1 line tweak to the XSLT, but then it turned out the image i got was a horrible StarView MetaFile, which has even poorer support in browsers than MathML :( i was able to get it to write a PNG in addition, but of course this requires C++ changes... images also have the problem that they have poor accessibility compared to MathML (presumably), so if we can keep the MathML with the MathJax polyfill then i'm all for it. regards, michael -- Michael Stahl Senior Software-Entwickler LibreOffice CIB software GmbH GeschÃftsstelle Hamburg Flachsland 10 22083 Hamburg T +49 (40) / 28 48 42 -296 F +49 (40) / 28 48 42 -100 Michael.Stahl@cib.de www.cib.de Sitz: MÃnchen Registergericht MÃnchen, HRB 123286 GeschÃftsfÃhrer: Dipl.-Ing. Ulrich Brandner


  • 5.  Re: [office] Enable MathML for browsers

    Posted 10-08-2019 15:53
    Hi all, Regina Henschel schrieb am 08-Oct-19 um 13:56: <script src=" https://polyfill.io/v3/polyfill.min.js?features=es6" ;></script> <script id="MathJax-script" async="async" src=" https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" ;></script> The following works in Google Chrome and Microsoft Edge too: <script type="text/javascript" src=" http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=MML_HTMLorMML" ;></script> That is from FrÃdÃric Wang from https://bugs.documentfoundation.org/show_bug.cgi?id=66287 . Kind regards Regina