LaTeX to Word: the basic issue

It seems to me that there are two possible avenues for the challenge of converting LaTeX source to Microsoft Word—a challenge which humanists will have to take up whenever they collaborate with non-TeXnical co-authors and editors. One route is to parse the source and output Word or, more likely, a less closed intermediate markup format. Humanists are actually better off here than scientists, since they don’t use the major feature that TeX handles very differently from word processors—and far, far better: namely, mathematical equation typesetting. And assuming that Word is not going to be the format for final publication, there’s no need to cry (much) over the loss of typographical quality resulting from subjecting your paragraphs to Word’s justification and pagination “algorithms” rather than TeX’s. The goal is most likely just to share and edit content. For these purposes (from shared authorship to substantial editing to copy-editing), LaTeX markup for humanists can be pretty simple—indeed, practically equivalent to the text-markup subset of HTML itself: paragraph, header, section (division), span. For this very minimal version of LaTeX—entirely conceivable as a possibility for humanists—conversion to Word is a matter of getting a parser for the minimal LaTeX and outputting its equivalent in XML.

read more…

ODT/XML first aid

If you work with tex4ht to convert LaTeX to OpenDocument (for subsequent Word conversion in NeoOffice, say), you may find yourself wanting to doctor an .odt file. At least I did; sometimes tex4ht outputs an odt with problems or syntax errors. But here’s the nice thing, if you need some quick odt first aid: as I learned from this article by Maarten Wisse, an odt is really just a zip archive.

> unzip test.odt
Archive:  test.odt
   creating: META-INF/
  inflating: META-INF/manifest.xml
   creating: Pictures/
  inflating: content.xml
  inflating: meta.xml
  inflating: settings.xml
  inflating: styles.xml

Mirabile dictu, those xml files are pretty easy to read. All the good stuff is in content.xml and styles.xml. You can burrow into these files wth a text editor, modifying style parameters or the way tex4ht has tried to tag your content. And when you’re done:

> zip test.odt content.xml
updating: content.xml (deflated 81%)

That’s all! If NeoOffice gives you an error when it tries to open a generated odt, it will tell you the line number of the syntax problem, and you can just fix it by hand.

All right, I know, kludge city. But very, very useful in a pinch.

Life with tex4ht: a teaser

The grand challenge for TeX loyalists in the humanities is clear: TeX/Word interoperation.

It’s been a long day of debugging, and I’m still not all the way there. But I’ll be using this space soon to post some results on using the tex4ht suite to generate an OpenDocument file (which can then be converted by NeoOffice to Word format). It can be done, even with a 200 pp book manuscript with hundreds of autogenerated footnotes and lots of Unicode text. The current maintainers of tex4ht have done amazing work on keeping it functioning in tandem with cutting-edge packages. There are lots of issues, and hopefully they’ll be making some serious updates soon, but still.

Anyway, more to come here on this subject. TeX to Word is within reach.