Bug 81428 - Import MathML format generated by MathJax into OpenOffice / LibreOffice
Import MathML format generated by MathJax into OpenOffice / LibreOffice
 Status: RESOLVED DUPLICATE of bug 47414 None LibreOffice Unclassified Formula Editor (show other bugs) 4.4.0.0.alpha0+ Master All All medium enhancement Not Assigned Formula-Editor Show dependency tree / graph

 Reported: 2014-07-16 12:53 UTC by rk601 2016-10-29 19:15 UTC (History) 2 users (show) rb.henschel vstuart.foote

Attachments
Request that LibreOffice integrate with MathML generated with MathJax (150.00 KB, image/png)
2014-07-16 12:53 UTC, rk601
Details
MathJax generates MathML (48.14 KB, image/png)
2015-07-14 14:58 UTC, rk601
Details
Copy MathJax generated MathML (103.52 KB, image/png)
2015-07-14 15:01 UTC, rk601
Details

 Note You need to log in before you can comment on or make changes to this bug.
 rk601 2014-07-16 12:53:56 UTC Created attachment 102921 [details] Request that LibreOffice integrate with MathML generated with MathJax The ability to generate and display higher mathematics is essential for numerous disciplines and businesses. For example, Cambridge Journals employs MathJax* to deliver high-quality, accessible mathematics in over 300 peer-reviewed journals. LibreOffice has begun to use MathML in its documents. However, MathML generated by MathJax does not import into LibreOffice without significant modification, and it is not possible to Copy and Paste the MathML format into LibreOffice. We request that LibreOffice integrate with MathML generated with MathJax via Import and Copy and Paste. For quite some time, MSWord has allowed for this type of integration. Please see the Web page and video located at the following address: http://www.mathjax.org/demos/copy-and-paste/ *Note: MathJax is an open source JavaScript display engine for mathematics that works in all modern browsers. rk601 2014-07-16 12:55:42 UTC Comment on attachment 102921 [details] Request that LibreOffice integrate with MathML generated with MathJax Please note that the attachment is a .PNG image. Dominik 2014-07-19 00:21:50 UTC that would be great, especially as i see that mathjax is gathering pace. Regina Henschel 2015-07-08 10:31:43 UTC Can you please be more exact about "MathML generated with MathJax". I thought MathJax is a rendering help for webpages which contain MathML segments. The only thing I see, is the ability to show MathML source in a separate window from the context menu of a formula, when showing the webpage in the browser. rk601 2015-07-08 16:16:19 UTC Dear Regina: The request that LibreOffice integrate with MathML generated with MathJax via Import and Copy and Paste was made more than a year ago, so the provided Web links to see how MathJax is implemented has changed. Please check the following link: https://web.archive.org/web/20141008170023/http://www.mathjax.org/demos/copy-and-paste/ Notice how MSWord can integrate with MathML generated with MathJax via Import and Copy and Paste. We request that LibreOffice integrate with MathML generated with MathJax via Import and Copy and Paste. If you have MSWord then you can use it and see how the MathJax syntax functions within the Word processor to generate accurate and beautiful formulas, functions, and math! MathJax Syntax MathJax uses LaTeX syntax to display math notations. For inline math, enclose the LaTeX syntax in dollar signs ($). For displayed math, enclose the syntax with two dollar signs ($$). For example, to display x squared inline (x2) type x^2 or type$$ x^2$\$ Syntax for MathJax can be found at the following Web address: http://www.suluclac.com/Wiki+MathJax+Syntax The ability to enhance and/or modify the existing MathML features of LibreOffice to work with MathJax would greatly impact the usage and desirability of LibreOffice. You will also find how MathJax and its syntax is used in the next two Web addresses: https://www.youtube.com/watch?v=9h7mMFFWer0 https://www.youtube.com/watch?v=TairRxyy_Hs LibreOffice often is NOT used because IT DOES NOT support this extremely useful and important math functionality! ( See: http://tex.stackexchange.com/questions/25223/embed-latex-math-equations-into-microsoft-word for additional information on MathJax usage in Word. Please note that LaTeX is not as easily used for the purpose of cross-application-integration. For example, we can generate the desired MathML based on MathJax syntax and implement it in Word or on the Web or within publications, etc! ) Regina Henschel 2015-07-08 17:50:15 UTC With commit http://cgit.freedesktop.org/libreoffice/core/commit/?id=64bc8b45b5c23efc5fe57585a69aa4263aaf4e83 I have added this: If you have text in the clipboard, which can be interpreted as a MathML segment with math as root element, or if you have a clipboard content of MIME type "application/mathml+xml" then you can import the content in module LibreOffice Math. Find the item in menu Tools in the Equation Editor module. As LibreOffice cannot natively render MathML, the import is transformed to StarMath. That has some known problems. -------------- Your description is still not clear. Perhaps you need to separate it into different issues. I guess you have the following wishes; correct me, where I'm wrong: (1) If the clipboard content has suitable MathML, then LibreOffice should offer "paste-special" and insert a formula immediately. [That has a performance problem, because you can only know, whether the content can be transformed, when you try to transform it.] (2) If you are in formula editing mode and the clipboard content has suitable MathML, than allow to paste it. [That have I done, see above. For MathML the parser and a piece of code, that transforms MathML to StarMath already exists for file import and 'only' need to be used for clipboard too. MathML is the language, which is specified for Formulas in OpenDocument.] (3) LibreOffice should offer to import clipboard content, which is actually Tex or Latex. (4) Allow to write Tex or Latex and transform it on demand into StarMath. But I do not see, what is the role of MathJax in all this. -------- I cannot play the video on web.archive.org. rk601 2015-07-14 14:19:51 UTC We desire LibreOffice to be able to use MathML syntax, characters, format, commands, and equations generated by/for MathJax so that LibreOffice correctly represents (displays) the equation with the mathematical notations -- capturing both its structure and content by simply copy and paste. Follow these steps to display MathJax generated MathML in MSWord: (1) Simply generate the desired MathJax MathML XML (within an Editor, Web browser, other software, or obtain it from an HTML fragment) (2) Copy the desired MathJax MathML XML fragment (3) Paste the MathJax MathML XML fragment copied from, for example, HTML, notepad, etc., into Word. Here is a simple Integral, specified using the int element. The variable of integration is represented using the element bvar. The upper and lower limits of integration are usually specified using the elements lowlimit and uplimit: x a b x [/itex] So, just Copy and Paste the above XML into Word and the Integral will be displayed in the document. Here is another example (when a≠0, there are two solutions to a x pow(2) +bx+c=0 and they are): x = b ± b2 4ac 2a . [/itex] Here is another example: square-root of X divided by (y squared - 1) Here is the XML: x y 2 - 1 [/itex] Here is some MathJax HTML (we can copy three different MathML fragments from the below HTML and then paste each fragment into Word; Word will correctly render and display each math fragment): MathJax MathML Test Page

When a0 [/itex], there are two solutions to ax2 + bx + c = 0 [/itex] and they are x = b ± b2 4ac 2a . [/itex]

Please see the following links for more information: https://bugs.documentfoundation.org/show_bug.cgi?id=47414 and http://listarchives.libreoffice.org/global/users/msg03980.html rk601 2015-07-14 14:58:57 UTC Created attachment 117237 [details] MathJax generates MathML Follow these steps, MathJax generates MathML: Go to the following Web Address: (A) http://mathjs.org/examples/browser/pretty_printing_with_mathjax.html (B) Right click on the formula, to the right of the "Pretty print:" label. (C) From the Pop-Up menu select "Show Math As" command. (D) Select "MathML Code" (E) Copy the generated MathML Code (F) Paste the generated MathML Code into LibreOffice. (E) LibreOffice will correctly render and display the correct math. rk601 2015-07-14 15:01:03 UTC Created attachment 117238 [details] Copy MathJax generated MathML Click within the TextArea, select all of the text, and use the Copy command. Within LibreOffice, click on the document and use the Paste command. Regina Henschel 2015-07-14 18:14:19 UTC I see, it is nothing special about MathJax, but it is about importing MathML. This issue covers the same request as issue 47414. Therefore I suggest to close this as duplicate. Please get a current daily build http://dev-builds.libreoffice.org/daily/ and look at the new feature for importing MathML. Insert a formula object or start with a formula document, then find the new command "Insert MathML from Clipboard" in the menu Tools. It will import the MathML source generated bei MathJax and those generated from other tools. Content Markup as in your first example in comment 6 is not supported by LibreOffice and there are currently no efforts to implement it. I know, that the result in converting to StarMath has many problems, especially bug 75171 is still not fixed. And I know, that the current StarMath is not able to reflect all features of MathML. BTW: (B) in comment#7 does not work for me with browser Seamonkey, I have to use Alt+Right-click. I have got Word 2010, but no one of your examples in comment#6 will turn into a formula, when pasted into a Word document. I do not find any option for that, there is no "paste special" and nothing in context menu, neither in the text document itself or when in edit mode of a formula. V Stuart Foote 2016-10-29 19:15:34 UTC  *** This bug has been marked as a duplicate of bug 47414 ***
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6621781587600708, "perplexity": 4213.032440821803}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-40/segments/1600400221980.49/warc/CC-MAIN-20200925021647-20200925051647-00713.warc.gz"}