Estimated read time: 2 minutes
TL;DR: Import of old-style (pre-2010 for RTF, pre-2007 for DOCX) math equations embedded into text documents should be now imported as editable embedded math objects.
Longer version: if you want to embed math equations into RTF or DOCX files, you have two choices. The older approach is to embed a MathType OLE object into the file, the newer one is a native OOXML markup, which has an RTF markup equivalent as well. Handling of the later has been implemented by Luboš Luňák for DOCX a long time ago, and I contributed the RTF equivalent almost 3 years ago.
What remains is the handling of the older version, the embedded OLE object. Previously only the replacement graphic was imported, so regardless of the Tools → Options → Load / Save → Microsoft Office → MathType to Math checkbox, the result was never editable.
Here is how it looks like now:
Given that the RTF and the DOCX importers share lots of code in the
writerfilter/
module, I implemented the same for the DOCX import at the same
time, too. The interesting challenge was that writerfilter wants an
XFilter
implementation for the embedded object if it is to be handled internally by
LibreOffice, but the MathType filter (originally created to handle math
objects inside binary DOC files) didn’t have one. Once I implemented such a
filter
wrapper, the
rest
wasn’t too hard.
Here are test documents if you want to try it yourself. You’ll need a 5.0 daily build for that, though. ;-)
If I’m at describing features new in LibreOffice Writer 5.0 file filters, here are a few more:
-
Automatic hyphenation at a document level and exceptions to it is now imported in RTF. I also adjusted the exporter, so now Word sort of understands our hyphenation rules, replacing the OOo-specific custom hyphenation RTF extension that Word just ignored.
-
picture wrap distance properties are now handled in the RTF importer — previously that was only handled for shapes.
And a number of bugfixes for the RTF filter:
Do these sound interesting? Look at what others did for LibreOffice 5.0 on the TDF wiki, even if it’s far from complete, as the 5.0 branch is not yet created. :-)