Page 1 of 1

Converting equation/formula to HTML

PostPosted: Fri Jun 22, 2012 1:06 am
by zac
Hi,

I'm trying to convert docx containing equations to on Android. I came across docx4j which is great and tested
Code: Select all
HtmlExporterNonXSTL

However I noticed that it doesn't handler equations well - if some symbol or number has some power and/or indices their position is alway in the middle e.g.
Code: Select all
k_{n+1}^2 (using latex format here so you can get the gist)

is displayed as:
Code: Select all
kn+12 (with 'n+12' having correct smaller font but they are both centered vertically)


Is there any way to adjust CSS to handle powers and indices? (full formula conversion would be better but I guess it is not so easy). I'm new to docx4j but looks like somehow
Code: Select all
handlePPr()
method will need to be modified in HtmlExporterNonXSLT example. Before I would dive into it I thought about asking is it even possible to accomplish it (any way to obtain the offset property of a run?

Another think: All generated styles are inline. Is there any way to add 'id' so e.g. font size can be later changed by adjusting css?