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.
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.
TeX Updates and Side Blog
I made some updates to my LaTeX page. Then I realized I had so many notes on the subject that I decided to start a little side blog on the subject of TeX and digital document preparation in the humanities. I’ll add entries there occasionally as I make discoveries and encounter problems of a technological kind.
Update, November 2012. I have migrated the posts from this blog onto this site. You can view them in the page of all blog posts tagged “tex”.
Chicago Manual-style footnote numbers
Here’s a first tip for humanist TeXheads.
hyperref makes PDFs with awesome features
A PDF file can be more than just an image.
If you’ve copied text and pasted it from a PDF (or opened a JSTOR scan and discovered you couldn’t), then you know that a PDF is not just a picture for printing but a hypertext in its own right. If you use modern TeX at all, you know that pdflatex and xelatex produce well-behaved PDFs that can indeed be copied from. (In the old days, when you had to use a tex to dvi to postscript to pdf workflow, things were not so reliable.)
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.
Why LaTeX and Literary Studies?
An Introduction
Why blog about the LaTeX typesetting system and literary studies?