Is your version of LO from the OpenSUSE repository or the LO website? I don’t have an answer to why the same filter appears to behave differently via headless mode and the UI. Under Crunchbang 11 running TDF/LO v4.0.3.3 I managed to obtain the blacked-out graphics using your suggested command:
$ soffice --headless --convert-to html:"HTML (StarWriter)" maths.doc
I thought I tried this originally and it worked OK, but I must have gotten confused amongst the various tests I did, because it certain produces the same black-out graphics you are seeing:
Sorry for any confusion. Using the File > Save As… > HTML Document (Writer) menu method the graphics appear OK:
I don’t know why this is as both methods would appear to be using the “HTML (StarWriter)” filter, presumably HTML__StarWriter_.xcu
and HTML__StarWriter__ui.xcu
(source). I can’t get LO to run in headless mode under MacOS so could not test this. Under MacOS 10.6.8 running LO v4.0.3.3 using the File > Save As… > HTML Document (Writer) menu method the graphics appear OK (slightly better quality than under GNU/Linux, although still fairly poor):
… most of the embedded images are corrupted on both Mac and Linux with default HTML filter.
I had a look at the embedded formulas in your original DOC. The objects that are displaying as blacked-out GIFs are graphic objects (not formula objects). They appear to be vector graphics that the filter cannot understand (although why this works via the UI and not in headless mode I don’t know).
If I save the DOC in DOCX/ODT format these formulas are included as WMF format graphics. There are known issues with how LO handles vector objects. It is steadily improving although Windows vector formats (WMF/EMF, which is possibly what the original objects are) may never be fully supported, as SVG is the preferred format for such objects. The ability to store an equation as MathML (DOCX) rather than a graphic (DOC) offers significantly better quality of output.
I don’t want to use gif at all. I would like to use --convert-to html to embed all in one html file.
The “XHTML Writer File” filter (same as File > Export… > XHTML file type) embeds the equation in the html as you desire. Unfortunately though this appears to work better for a DOCX source that a DOC source. For a basic formula object a DOC produces this output:
<!--Next 'span' is a draw:frame.-->
<span style="height:31.01pt;width:83.99pt; padding:0; " class="fr1" id="graphics1">
<img style="height:1.094cm;width:2.963cm;" alt="" src="data:image/*;base64,
... embedded graphic ...
/>
</span>
… while a DOCX source produces this output:
<!--Next 'span' is a draw:frame.-->
<span style="height:31.15pt;width:77.9pt; padding:0; " class="fr1">
<math xmlns="http://www.w3.org/1998/Math/MathML">
... MathML object ...
</math>
<img style="height:1.0989cm;width:2.7481cm;" alt="" src="data:image/*;base64,
... embedded graphic ...
/>
</span>
For reference, this AskLO thread on HTML exporting and this AskLO thread on MathML are likely related.