7

I work with a lot of word documents. I want to make some of these look better with LaTex, but it's almost impossible to manually extract images/equations and put them into a .tex file and then convert them to LaTex.

I know I might be asking for too much, but is there a nice, free way to do convert Word documents to .tex? I've tried Abiword and rtf2latex2e but neither worked too well. Word2TeX is the BEST option out there (gives extremely clean, almost-perfect .tex code), but sadly it is not free and it goes pretty deep in the pocket.

Just to clarify, I'm not looking for a way to store word documents in LaTex format just to make them look pretty. I genuinely want to convert a bunch of existing .docx files into LaTex so that my colleagues and I can maintain them in .tex format for future edits. Any advice would be appreciated.

7

I tried different commercial and free converters. All have there advantages and disadvantages but in the end I settled for the very nice docx2tex.

There were some troubles when the docx-file contains a mix of different fonts but other than that the output is reasonably good. With a bit of manual work I converted a 70 page thesis but have not tried the mathematical part much.

If you want commercial support there are also Word-to-Latex (www.grindeq.com) and another product under the same name Word-to-Latex (www.wordtolatex.com). Both have a free trial version.

For all tools you want to have a nicely structured Word document to start with. No converter can guess the structure of the document if sections are just formatted in bold, etc.

  • I do have nicely structured and formatted word documents to begin with. The main reason I want a Word to LaTex converter is that I'm ending up spending almost as much time manually formatting my Word documents. I'd much rather be doing that with LaTeX as the end result is so much better. The problem is that free options do not grab images very well from the Word docs. Commercial packages are out of my budget ($100) and I'm kind of desperate for a decent free alternative – prrao Feb 20 '12 at 20:16
  • docx2tex seems to work fine! It does have a few shortcomings but for a free tool it is simply amazing. Thanks! – prrao Feb 21 '12 at 17:43
5

Another solution for converting docx to TeX that I use, is to load the Word-file into LibreOffice and export it to LaTeX with the help of Writer2LaTeX. The new version 1.4 has lot of options for tinkering with the export filter.

Of course this assumes your Word-file can be converted to (or opened in) LibreOffice without lots of errors. The import filter in later versions version > 3.5.x is much better than before, but the docx-format is said to be complex and with some dark corners.

EDIT: If you are not able to, or willing to, install LibreOffice, in newer versions of Office (> 2010) you may in Word save the file as an .odt-file. Then you can use the command line facility of Writer2Latex to convert the .odt-file to LaTeX-format. See pages 13 ff. in the Wrtier2LaTeX-manual.

3

In my experience Pandoc does a decent job of converting from MS Word 2016 files (.docx) to LaTeX. After installation on OSX El Capitan, I ran the following command to convert my MS Word file:

pandoc -f docx -t latex -o out.tex in.docx

Granted you'll still have to make some edits to match the original, but it is way better than starting afresh and it's free. Also, it supports OSX, Windows and Linux.

3

This website is in beta state but is constantly improving. If you follow all guidelines then you can get pretty descent ".tex" code and ".pdf". If you face any issues ,leave them a message and they will fix it.

Give it a try https://www.docx2latex.com/

1

You can use docx2tex. It's Open Source and you can get it on GitHub.

http://github.com/transpect/docx2tex

It supports both Microsoft and MathType equations and has many heuristics to optimize the LaTeX output, even if the author worked sloppy in MS Word. It comes with many fontmaps to convert common Symbol or Wingdings fonts to LaTeX. It's basically a command line tool with a frontend Bash script for MacOSX/Linux and a Batch file for Windows.

  • This is essentially the same as the accepted answer. You should avoid answering the same as other people. – Phelype Oleinik Mar 2 '18 at 15:22
  • @Phelype How to proceed with a duplicate answer? Flagging? – AlexG Mar 2 '18 at 15:31
  • @AlexG Personally, I don't think it's a problem, especially because it's his first answer. I just told him for the next time :) – Phelype Oleinik Mar 2 '18 at 15:34
  • @P Alright, I understand. – AlexG Mar 2 '18 at 15:40
0

You can check an online free conversion word to latex at http://www.word2latex.net/convert-ms-word-to-latex-online-automatically/.

  • 1
    Welcome to TeX.SE!. Please consider explaining in more detail and to add context around the link so your fellow users will have some idea why your answer could help us, in case the target site is unreachable or goes permanently offline. – Cragfelt Dec 9 '17 at 23:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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