starmath, ObjectReplacements, export, word2003

Yury yury.tarasievich at gmail.com
Wed May 20 00:50:09 PDT 2015


Hey guys,

It's somehow quite difficult to get any attention here. Am I doing something
wrong, like not addressing the audience properly, what? Would the IRC
channels be better place for the question I'm asking?

I'm trying to hack a stopgap solution (even if only for my own consumption;
i'm using the local build from source) for the problem of exporting a text
with formulas (starmath equations) to word2003 .DOC format.

Anyone using LO to prepare scientific papers, esp. in physics, mathematics
etc., would be inherently interested in such export going right. Lots of
publishers accept manuscripts in word2003 .DOC format only (to the point of
not even allowing word2007 or newer, I believe).

Currently (like, in 4.4 series releases), such exported .DOCs (meant to be
opened by word2003, mind you!) have two big problems:

1) Bibliography entries and index are exported incorrectly, word2003 opens
the exported .DOC with blanks in place of those. It's issue 88697, and I
have proposed a solution already (can use it in my local build, in fact). By
the way, nobody commented on my patch attached to issue – was that some
wrong thing to do on my part or something?

2) Formulas (starmath equations) have bitmap previews (placeholders,
replacements – I don't know the correct term) attached to them. When
exporting to .DOC, those bitmaps are processed (converted), I guess, but the
result is incorrect. See issue 90739 and any pair of snapshots attached to
it of word2003 opening such an exported .DOC. There are several problems
with those:

2.1) Immediately on open in word2003, the bitmap 'sits' too high in the text
paragraph line in which its frame is placed.

So, the human operator has to regenerate the bitmap manually (double-click,
then escape key). Imagine doing this for tens of bitmaps? Hundreds? Besides
creating the noticeable obstacle in workflow in mixed environment (and
frankly, any current environment in which LO is used is 'mixed'!), this can
result, e.g., in immediate rejection of manuscript as 'incorrectly prepared'.

2.2) Not a real problem, but may sidetrack/confuse – the fonts' sizes in
said snapshots are off, but that is already explained
(https://bugs.documentfoundation.org/show_bug.cgi?id=90739#c11) – you just
have to prepare the original document setting the respective sizes in
starmath objects as needed by party receiving the exported document – they
will likely have their word2003 preferences at those settings already.

2.3) MS Word standard pair of fonts for equations is Times New Roman /
Symbol. LO uses OpenSymbol which seems to use somewhat different
metrics/outlines for things like brackets and square brackets. At least in
case of scaled square brackets, the bitmap generated and put into .DOC
contains unexpected renderings – square brackets are rendered in an
equivalent of extrabold style. Again, an opening party has to re-click any
of such formula/equation.

I haven't done the detailed checking of this point yet, but it was
definitely there in late 2010. I believe there's no LO issue filed on this.

I guess the full solution for this in current LO design would be more
complicated. The stopgap would be switch on the 'OpenSymbol→MS Symbol' font
substitution in 'Options' – and to check how the bitmap converting routine
deals with scaling of symbols.

***

So, to deal with this, at least with point 2.1, one would need to know where
the processing of starmath metafile used in formula/equation conversion is
located in source. What file, what subroutine?

The LO source is rather complicated, my programming days were long ago, and
I never did any deep C++ programming. I have difficulties finding those places.

If somebody more acquainted with the subject would just point out the
relevant materiel?

-Yury


More information about the LibreOffice mailing list