TeX2DocX
Convert a LaTeX document to Word (.docx) from VS Code, so reviewers can comment
and use Track Changes.
Usage
Open a .tex file and press Ctrl+Alt+R, click the icon in the editor title
bar, or right-click the file in the Explorer → Convert to Word (.docx).
The .docx is written next to the .tex.
If the open file is part of a larger document (\included or \input by
it), the main document is converted. Add % !TEX root = main.tex to the
file when the main document is elsewhere.
When Word opens the result it asks whether to update the fields: answer
Yes. That fills in the figure and table numbers, the page numbers of the
acronym list and the table of contents (or turn on tex2docx.updateInWord).
TeX2DocX: Convert to Word (re-convert figures) clears the cache of
converted SVG/PDF figures.
What it handles
- Figure, subfigure (a, b, …), table and equation numbering,
\ref
- Citations (
\cite, natbib \citet, \citeauthor; BibTeX or biblatex)
in the style the document asks for: \bibliographystyle{...} or
biblatex style=... (IEEE, APA, Harvard, Nature, Vancouver, ACS, APS,
ACM, author-year; a <style>.csl next to the .tex wins)
glossaries acronyms (\gls) and the acronym list with page numbers
- Minipages side by side with
\captionof (a figure next to a table)
\include / \input, \newcolumntype, siunitx (\DeclareSIUnit)
- SVG and PDF figures, converted like LaTeX's
\includesvg (SVG → PDF →
300 dpi PNG; needs Inkscape and pdftoppm from
Poppler on the PATH)
Read from the LaTeX
The layout follows the document, including its own .sty / .cls files:
| Word |
LaTeX |
| Page size and margins |
\documentclass[a4paper], geometry; else the class's own text block |
| Font size |
\documentclass[11pt] |
| Line spacing |
setspace (\onehalfspacing, \doublespacing, \setstretch), \linespread |
| Paragraph indent and spacing |
\parindent, \parskip, the parskip package |
| Page numbers |
centred; fancyhdr \lfoot / \cfoot / \rfoot / \fancyfoot[...]{\thepage}; none with \pagestyle{empty} |
| Cover page |
a titlepage in the document's \maketitle (page 0, unnumbered); else title, author and date |
| Headings |
\contentsname, \refname / \bibname, \acronymname, title= options |
| Contents depth, numbered levels |
tocdepth, secnumdepth |
| Citation style |
\bibliographystyle, biblatex style= |
Settings
| Setting |
Default |
tex2docx.pandocPath |
bundled pandoc |
tex2docx.referenceDoc |
bundled Word styles, laid out as the LaTeX says |
tex2docx.csl |
the style the LaTeX asks for |
tex2docx.resourcePath |
., Images, images, figures, Figures |
tex2docx.updateInWord |
false (Windows + Word: update numbers and contents) |
License
GPL-2.0-or-later. The bundled pandoc.exe is a modified build of
pandoc (© John MacFarlane, GPL-2.0-or-later); its
source is at
https://github.com/Ro2Nava/pandoc/tree/docx-subfigure-numbering.
| |