Bug 66287 - Add an option to insert MathJax script element when exporting to XHTML
Summary: Add an option to insert MathJax script element when exporting to XHTML
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
4.2.0.0.alpha0+ Master
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: (X)HTML-Export
  Show dependency treegraph
 
Reported: 2013-06-27 23:22 UTC by Frédéric Wang
Modified: 2019-10-08 15:54 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Sample odt document (12.71 KB, application/vnd.oasis.opendocument.text)
2013-06-27 23:22 UTC, Frédéric Wang
Details
Sample output (3.82 KB, application/xhtml+xml)
2013-06-27 23:23 UTC, Frédéric Wang
Details
Patch (2.67 KB, patch)
2013-06-30 13:17 UTC, Frédéric Wang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang 2013-06-27 23:22:28 UTC
Created attachment 81593 [details]
Sample odt document

When exporting to XHTML a document with mathematical formulas, it would be great to have an option to insert

<script type="text/javascript" 
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=MML_HTMLorMML"></script>

in the header in order to workaround the lack of MathML support in the browser. That would be something like "insert MathJax header".
Comment 1 Frédéric Wang 2013-06-27 23:23:55 UTC
Created attachment 81594 [details]
Sample output

Here is how the output could look like. Note that the MathML will display correctly in any browsers.

Compare with attachment 81592 [details].
Comment 2 Frédéric Wang 2013-06-30 13:17:31 UTC
Created attachment 81741 [details]
Patch

This modifies the XHTML filter so that the XSLT stylesheets have an option to insert the MathJax script. Set <xsl:param name="mathjax"> to "true()" to test it.

At the moment there is no UI to enable that option and pass it to the XSLT processor.
Comment 3 Regina Henschel 2019-10-08 15:54:51 UTC
On https://www.mathjax.org/#gettingstarted
I see <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>

Of cause for XHTML a value for the attribute is needed, that is:
<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>

What is the difference to
<script type="text/javascript" 
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=MML_HTMLorMML"></script>
which is included in the patch?