Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index

Hi Marc,

Marc Grober schrieb:

It is exact as described in the link: First Insert>  Object>  Formula.
Now you are in the formula editor. And then Tools>  Import Formula.

Only if yo don't exit the equation editor before selecting
Tools->Import, which one might do in as much as the documentation does
not include those few precious words "while the equation editor is
open", lol.

Now, as far as importing xml files,  I have never been successful at
importing mathml and must assume that this is accomplished through some
secret handshake as well ;-)
for example, an attempt to import test.xml which consisted of the following:

  <?xml version="1.0" encoding="UTF-8"?>
   <!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN"
   <math xmlns="";>
       <mo>&#x2062;<!--&InvisibleTimes; --></mo>
       <mo>&#x2062;<!--&InvisibleTimes; --></mo>

was unsuccessful.

I had tested that very same example before I had answered. Besides the fact, that the character &#x2062; is rendered wrong, the import is without problems.

So there must be some difference between my and your way. So next try with a step by step description:

Precondition: The MathML is saved as file on disk, for example "mymath.xml".

1. Open a Writer document or use a new one. Set the cursor where the formula should be.

2. Insert > Object > Formula. Now the equation editor is open. The top menu has changed, a part of the writer document is shown, with a rectangle where the formula will be, and a command window with a blinking cursor exists.

4. Tools > Import Formula. You get a file picker. Choose your MathMl-file, here mymath.xml. Click on button 'Insert'.

5. Now you have the proper command in the command window. If something is wrong (for example the character &#x2062; mentioned above), you can correct it.

6. Klick outside the formula into your Writer document. Finished.

An attempt to export similar code as writer xml was similarly
ineffective on import.

If you only want to convert a single formula to MathML and your formula is inside a Writer document, then right-click the formula. The context menu opens and the last item is "Save as...". Use this and select "MathML" from the list of available file formats. You will get a single MathML file. It does not matter whether you use the file extension .mml or .xml. Reimporting this file as described above, gives the same formula as exported, because the original LO formula is written to an annotation element and read when imported. You should use grouping brackets to generate a well structured formula in LO, although LO does not need them to render the formula. It will give better results in export.

If you want to export the whole Writer document with an easy access to the MathML without unzipping, you can use File > Export > type XHTML, or File > Save as > type "Flat XML".

Do you understand German? Than the German "Handbuch für Math" on might give you some ideas.

Kind regards

For unsubscribe instructions e-mail to:
Posting guidelines + more:
List archive:
All messages sent to this list will be publicly archived and cannot be deleted


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.