How to convert LaTeX to Word
Run pandoc paper.tex -o paper.docx --citeproc --bibliography=refs.bib in the paper's folder to get an editable Word file with the equations as Word equations and a formatted reference list; pandoc reads the text but not what LaTeX works out while typesetting, so equation, figure and section numbers and what \ref prints need fixing, and PDF figures do not show in Word. In Manulyx, File → Download as Word (.docx) writes any project as Word with those numbers filled in, PDF and EPS figures converted to pictures Word shows, and the references formatted from your .bib.
Convert it yourself with pandoc
Run pandoc in the folder that holds the main .tex file, so it finds the files the paper includes and its figures:
pandoc paper.tex -o paper.docx --number-sections \
--citeproc --bibliography=refs.bib --csl=style.csl--citeprocformats the citations and adds the reference list, from the .bib named by--bibliography(repeat it for several files). Without it a citation shows as its key.--cslchooses the citation style from a CSL style file; without one pandoc uses Chicago author–date. For a numbered style, use a numbered CSL file.--number-sectionsnumbers the headings 1, 1.1, …--reference-doc=reference.docxtakes fonts, margins, page size and paragraph styles from a Word file of your own. Start from pandoc's:pandoc -o reference.docx --print-default-data-file reference.docx, change its styles in Word, and pass it in.
Figures
Word does not show PDF or EPS figures, which is what most LaTeX papers use. Convert them to PNG before converting the paper, for example with Ghostscript, and point the \includegraphics lines at the PNG files:
gs -sDEVICE=png16m -r200 -o figure.png figure.pdfWhen the paper uses many packages: make4ht
make4ht (part of TeX Live) runs TeX on the paper itself, so the numbers and cross-references come out as LaTeX would print them. It writes an OpenDocument file, which LibreOffice turns into .docx:
make4ht -f odt paper.tex
soffice --headless --convert-to docx paper.odtCheck the equations and tables in the result: how they come across depends on the packages the paper uses.
What pandoc loses
| In the LaTeX paper | What you get from pandoc |
|---|---|
| Equations | Word equations you can edit. An equation pandoc cannot convert stays as LaTeX text, and pandoc warns "Could not convert TeX math". |
| Equation, figure, table and section numbers | Not computed: pandoc does not typeset, so a \ref or \eqref does not print the number it prints in the PDF. --number-sections restores section numbers only. |
| Citations | Formatted with --citeproc; without it, only the keys. |
| PDF and EPS figures | Missing in Word: convert them to PNG first. |
| Drawings written in LaTeX (TikZ and the like) | Not drawn: compile each one to PDF, convert it to PNG and include that. |
Your own \newcommand macros | Simple ones are expanded; commands from packages pandoc does not know may be dropped or left as text. |
| The journal class's layout (two columns, title block, running heads) | Not reproduced: Word gets plain styles, or those of your --reference-doc. |
What to check after converting
- Every equation: open each one; look for any shown as LaTeX text rather than as an equation.
- Equation, figure and table numbers, and each place the text refers to them.
- Every figure is there and readable at the size Word shows it.
- Citations: none shown as a bare key, and the reference list in the style you meant.
- Tables: merged cells and column widths.
- The title, authors and affiliations, which the class's own commands may not carry across.
- Footnotes, and any text inside a custom environment.
How Manulyx does it
File → Download as Word (.docx) writes any project as a Word file, for a co-author, supervisor or editor who reads and comments in Word. It runs pandoc, after doing in the source the part of LaTeX's work that pandoc cannot:
- Numbers: equations (
equation,align,gather,multline,\tag,\nonumber), figures and sub-figures, tables and sections are numbered, every\ref,\eqref,\autorefand\crefprints the number, and each numbered equation carries its number at the right margin. - Captions start "Fig. 3." or "Table 1.", and sub-figures (
\subfloat,subfigure,\subcaptionbox) keep their pictures. - Figures: PDF and EPS figures are turned into PNG, since Word shows neither.
- Acronyms from the acronym and glossaries packages are written out as the packages print them.
- References are formatted from the project's .bib; a numbered style stays numbered, [1].
- Equations become Word equations. Any that Word's converter still cannot read stay as LaTeX text, and a note at the top of the document says which.
- Every
\inputand\includeis resolved from the project's own files.
The journal's own layout does not come across, and is not meant to: the Word file is for reading and commenting.
Questions
Will the equations be editable in Word?
Yes. Pandoc writes LaTeX math as Word equations. One it cannot convert stays as LaTeX text; Manulyx lists those in a note at the top of the document.
Why do the cross-references in my Word file have no numbers?
Pandoc reads LaTeX's text but does not typeset it, so it never works out the numbers of equations, figures and tables that \ref prints. make4ht runs TeX and gets them; Manulyx numbers them in the source before converting.
Why are my figures missing in the Word file?
Word does not show PDF or EPS figures. Convert them to PNG first and include the PNG files; Manulyx does this for you.
Can I keep my journal's layout in Word?
No. A journal class's two columns, title block and running heads are LaTeX's work; Word gets plain styles. Use --reference-doc with pandoc to set fonts, margins and styles.
Or read the guide first: Help: Download as Word.