How to convert XML file to LaTex in java?

693 Views Asked by At

In my project, i am converting .docx file (containing OMML) into XML & now i am trying to convert this XML file into LaTex document format. Is it possible to convert XML file into LaTex file using java ?

1

There are 1 best solutions below

0
nafas On

Ok mate, I'm giving you some advice here by no means its a complete solution.

Assuming There is no library already implemented.

If it was me trying to implement a simple XML to LaTeX conversion. I would start with a simple map of all those mathematical characters(or atleast find a good source that has them)

for example something like this:

 α  <--> $\alpha$    //note \alpha is symbol of α in latex but it has to be in math mode
 γ  <---> $\gamma$

then you can replace them all.

for layout indention you could do something using this:

root node <--> no indent
1st child <--> \parindent{10pt}
2st child <--> \parindent{20pt}
and so on

well I'm using Latex for 5 years now, and still struggling. but it would be great if there was such thing (xml to latex) convertor.