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 question already has an answer here:

The question Extracting the contents of text in a specified environment into a new file (and answers therein) involve using the extract package to produce a LaTeX file that contains all the text within in a specified environment.

My question is if it is possible to do the reverse? I am forced to work with Microsoft Word users. Due to Word's stability issues we usually maintain a .docx file containing all the text for a paper (or in this case my thesis) and one containing all of the figures and captions. Some journals require this approach as well. The endfloat package gets part of the way there by placing figures at the end of the PDF that is generated. I've had trouble using TeX4ht or latex2rtf because all of my figures are PDF. Figures in PDF format work great with pdftex, which I use to generated the PDF files.

Being a chemist, I use a lot of superscripts and subscripts, in particular with the mhchem package. I was hoping that if I could the text into HTML or RTF I could import to word without have to redo every subscript and superscript in the text. I've tried placing all of the \includegraphics commands within a comment environment (like textonly below) using the comment package:

\begin{figure}
\begin{textonly}
\centering
\includegraphics{figurefile}
\end{textonly}
\label{fig:figure}
\end{figure}

This approach broke all of my references (\ref{fig:figure}) to figures - they typeset as ??.

Is finding a way to compile the LaTeX code into a more Word friendly format the way to go or is converting the PDF generated by pdftex the best approach? I find that I have to manually fix the subscripts and superscripts to be recognized by Word. Additionally, all of the \refs work in the final output PDF, where that may be a problem in a split file approach.

share|improve this question
4  
My condolences. I know how you feel. –  Sašo Živanović Jan 31 '13 at 22:19
    
There is a pdf to word converter (free trial): pdftoword.com I haven't tried and can't say anything about it's quality. If you try and it works please give a feedback. –  schmendrich Feb 1 '13 at 7:40
    
MS Word 2013 allows editing pdf files. Have not tried it, don't know how good it works. –  matth Feb 1 '13 at 10:08
    
This comes down to the 'workflow for Word' issue, really. I've duped: if I'm wrong, ping me and I'll reopen. –  Joseph Wright Aug 6 '13 at 6:02
add comment

marked as duplicate by Joseph Wright Aug 6 '13 at 6:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

There are many options, but the routes involving HTML/XML are nicer than those involving RTF.

Word 2007 and later allows you to save .docx files as HTML files using CSS (as Word 2003 allowed you to save .doc files as really nasty HTML). The output isn't pretty, but using Pandoc to convert this HTML into Markdown is possible.

I've done this, but it was ages ago and I don't recall what the complications were - when I have more time I'll try this out.

share|improve this answer
add comment

For the text of a paper here, I ended up writing a word (2003) macro to read in the .tex file. It can handle text-mode sub- and super- scripts, and a few of my own simple macros, and applies some rudimentary formatting to \section etc. However math mode is completely out, as are tables. Images are imported automatically if they exist as .png (use imagemagick first).

The use case here is collaborating on the text of a paper, allowing the use of word's comment and track changes tools.

It's more in the spirit of an MWE than a polished tool, but you're welcome to play with it. It needs a little work before I can upload it (detaching it from some personal stuff) so let me know if (anyone) wants a look.

share|improve this answer
    
I've just seen this was an old thread, must have got poked by community, so probably of no interest to @Phillip, but the offer stands. –  Chris H Jul 31 '13 at 12:34
add comment

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