I'm changing the focus of this question after experimenting a little further, I've left the original question in the quote at the bottom.

As the original question points out, newer versions of Word (I think from 2013 onward) support the importing of PDFs into editable form (though obviously with not 100% faithful reproduction).

However, Word doesn't seem to play nicely with PDFs I create with Tex, and it would be handy if they did so that my supervisor can proofread the doc.

My question therefore is what the differences are or what needs to be done to a TeX PDF in order for Word to be able to open it? Or is it impossible for some other reason?

As per the previous comments, I tried LuaLatex and XeLaTeX, but the same issues persist (see screen shots). I then thought that it might be due to the fact that on OSX, TeXShop's default encoding is Latin, but after shifting everything to UTF-8, there is still no difference - the result of file -I doc.tex states that the document is ASCII, which from my research is already a subset of UTF8.

The only other curiosity I've noticed, is that if I try to get Word to open the document, treating it as ASCII, it unchecks the box automatically, and doesn't render a preview, whereas I can select any other encoding just fine (though the preview is obviously gibberish).

There must be some subtlety here which I'm missing since PDF2DOCx.com is able to do a surprisingly faithful reconstruction of the whole TeX document that can be opened in Word.

Import process for Word

(using a PDF typeset under Unicode UTF-8 (Ascii) and exported with XeLaTeX)

enter image description here enter image description here

I realise this has been asked a million times, but I'm going round in circles at the moment, and a good number of the threads are old so I'm wondering if there is some more up to date information around with regards to converting Tex files (typeset, not raw) or better yet, PDFs in to Word 2013 or greater .docx formats?

Specifically, I'm looking for commandline tools so that I can include it in a workflow?

So far I've tried with Pandoc, but there are issues with UTF-8 formatting that I can't unpick, and you cant convert from PDF.

Word is capable of opening PDFs natively these days, and does a good job of it usually, but it doesn't seem to be able to read my LaTeX PDFs at all (if anyone has thoughts on this point too I'd be glad to hear them).

Despite the document being very large and complex, I've had some excellent results with online converters, but I'd really not like to have to use them each time if possible - thought this tells me it must be doable if only they were available on the commandline.

Has anyone come across and tools more recently perhaps that would fit the bill?

  • As a starting point, try compiling with XeTeX and LuaLatex and open the resulting PDFs with Word. Font handling is different for these tools, which may lead to word having an easier time. – DCTLib Mar 27 '18 at 11:24
  • 1
    You could try pandoc I don't know how capable it is though. – Thorbjørn E. K. Christensen Mar 27 '18 at 11:28
  • 1
    it all depends on your document and which features you use. tex4ht can compile LaTeX to odt which needs to be converted to docx using LibreOffice (Word has issue with these ODT files, because it seems that it doesn't really follow the ODT standard). It supports utf-8, math, footnotes, tables, images and other features. Try mk4ht oolatex filename.tex – michal.h21 Mar 27 '18 at 11:30
  • @DCTLib the document is very large and complex at this point (a thesis) and so won't compile with XeTeX or LuaLatex without a lot of messing about with the source (unless I'm missing something - I've never used them before). @Thorbjørn, I tried pandoc as my question mentions, but doesn't seem to be capable of it in this instance either. – Joe Healey Mar 27 '18 at 14:24
  • have you tried xelatex or lualatex? what error did you get? – David Carlisle Mar 27 '18 at 16:24

Your Answer

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

Browse other questions tagged or ask your own question.