Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This is a counterpart to "How can I typeset an exam or assignment paper in LaTeX?", which was from a teacher looking for a template to compose assignments and exams. I'm a student, and I'd like to submit PDFs or printouts composed in LaTeX in response to assignments submitted as Word documents.

As a math and engineering student, I regularly receive emailed or uploaded assignments with .doc (and now .docx) attachments, which generally contain a numbered list of questions (often with parts A, B, C, etc.) to answer. Styles or other advanced Word structuring tools are rarely used. These assignments also frequently contain equations, tables, and images or Microsoft drawing objects (Usually circuits, graphs, or timing diagrams). I don't really mind copying the images over, or, if they're simple, drawing them myself (as I'll likely have to make changes to it in my answer anyways). However, on a long math assignment, the equations get tedious, and a little error in copying is a big problem.

From the tug.org converter page, I see winw2ltx, Word2TeX and Word-To-LaTeX (These utilities have such clever names...) which have some support for equation transformation.

One thing which isn't clear from the documentation is whether the MathType extension to Word must be used to create the equation, or whether it can simply convert an Equation Editor or .docx equation to LaTeX if it's installed on my computer.

The holy grail of answers to this question would be a utility which:

  • Recognizes MS Word numbered lists and outlines (I, 1, a, i, etc.).
  • Is faster than copy-pasting the text of each question into, say, the exam document class, writing the equations, and drawing the diagrams. This is what I do right now. Not too bad, but it adds half an hour to every assignment.
  • Makes better looking documents than the original Word document. I'd like to do a little evangelism here.
  • Includes support for equations, tables, and images.
  • Can import both .doc and .docx files. Saving the .docx as a .doc is not acceptable, as it renders the equations as bitmaps. Saving the .doc as .docx might be acceptable.

I don't really need it to structure the document; if it just sticks some selected text into a section of my LaTeX document, that would be plenty.

share|improve this question
3  
I'm rather surprised that you often have math assignments distributed in .doc and .docx. My sympathies! –  vanden Jul 27 '10 at 15:27
    
@vanden - One of my professors had a set of Word .doc files, organized in 30- to 50-page units totaling in excess of 200 ages, which he used to teach upper-level analog circuit design. Kirchhoff's laws, Thevenin and Norton transformations, node/mesh analysis, filter design, transfer functions, time/S domain, and the related algebraic, integral, and differential equations and example circuits...it was an astonishing piece of work. And it was ugly to read, impossible to maintain or manage, and impossible to search for information. –  Kevin Vermeer Jul 27 '10 at 18:38
    
It's much easier to search OOXML files than .doc files. –  Charles Stewart Jul 28 '10 at 8:49
1  
vanden: I'm much faster in typing math in Word (2007+) than LaTeX; the former of which uses a streamlined and logical evolution of LaTeX's math markup facilities. The old equation editor was horrible, indeed. But the current math typesetting is actually quite decent. –  Joey Sep 7 '11 at 11:19
add comment

2 Answers

up vote 9 down vote accepted

I'm sorry I wont be able to provide any answer other than: "Don't do it!"

Other than using some of the converters that you and other people have suggested, which may give you a reasonable place to start, there is really no satisfactory solution to convert an existing Word document into a LaTeX one. This is difficult to implement, and for a good reason. Word and LaTeX have two completely different approaches at describing and encoding documents. Word (as most people use it) stores formatting information while LaTeX encodes the "logical structure" of a document (which then gets translated to TeX formatting instructions while compiling). Trying to get a LaTeX document out of a Word document is somewhat similar to trying to obtain a C++ program from it's binary: You can do it, but the results wont be pretty.

You are better off taking a printout of your assignments and typing the whole thing yourself in LaTeX. Of course you can copy/paste large bodies of text, but for equations there is nothing better than typing them yourself. If you do this for a while, and show your beautiful documents to your teachers and colleagues, you might be even able to convince them to switch to LaTeX all together.

LaTeX is not a format to store pretty documents, it is a fully-fledged system to create those documents.

share|improve this answer
    
Absolutely agree with this. OpenOffice.org provides an extension for this, but results are never as good as hand-written documents. –  rivanvx Jul 28 '10 at 11:41
2  
As I said, I don't need the tool to structure it! All I want is to move the numbered list and the inlined equations into a section of my LaTeX document. I can strip titles, footnotes, page numbers, etc, and I don't care about including margins, fonts, styles, and all the other formatting stuff that Word does. I want to do the structuring in LaTeX. I just want to start with the content which is locked up in my word document. –  Kevin Vermeer Jul 28 '10 at 14:36
    
@rivanvx - I'll give OO.org a try as well. –  Kevin Vermeer Jul 28 '10 at 14:37
    
But you were asking for the tool also to parse the equations in the Word document, which I wouldn't advice for the same reasons. You shouldn't write syntactic equations, write semantic equations instead. –  Juan A. Navarro Jul 28 '10 at 15:48
    
@Juan - Could you clarify what you mean by syntactic vs. semantic equations? I'm not familiar with the internals of the Microsoft or OpenOffice equation storage, and so I must be missing the reason that these representations cannot be converted into equivalent LaTeX equations. –  Kevin Vermeer Jul 29 '10 at 15:33
show 5 more comments

I recommend docx2tex. Against your criteria:

  • Recognizes MS Word numbered lists and outlines (I, 1, a, i, etc.).
    • Yes, although it doesn't try to keep enum types;
  • Is faster than copy-pasting the text of each question into, say, the exam document class, writing the equations, and drawing the diagrams. This is what I do right now. Not too bad, but it adds half an hour to every assignment.
    • It is automatic, provided it recognises all of your OOXML markup (it doesn't handle everything).
  • Makes better looking documents than the original Word document. I'd like to do a little evangelism here.
    • It gives pretty easy-to-read, vanilla Latex. I don't call that beautiful, but it's easier to beautify than Word.
  • Includes support for equations, tables, and images.
    • Yes. It converts included images to .eps files; I'm not sure what quality that gives you with included SVG files.
  • Can import both .doc and .docx files. Saving the .docx as a .doc is not acceptable, as it renders the equations as bitmaps. Saving the .doc as .docx might be acceptable.
    • Only docx files. Provided you have Word 2007 or later, this shouldn't be a problem.

Issues: It's abandonware, not updated since November 2008. It only supports the DVI toolchain. It's native to Windows, being a C#/.NET3 based technology, and works very well there; away from Windows, it supposedly it works with Mono, although the last time I tried, about 18 months ago, it did not work. It's docx/OOXML-only technology. although since conversion of RTF/.doc to .docx is very well-behaved, this should not be a problem.

The TUG 2008 talk announcing the technology was recorded by River Valley TV.

share|improve this answer
    
I'll give it a shot! Vanilla LaTeX is what I'm looking for. –  Kevin Vermeer Jul 28 '10 at 14:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.