docxwright
docxwright converts a LaTeX manuscript into an editable DOCX document without
requiring Pandoc. It is intended for handing a LaTeX paper to co-authors and
editors who work in Microsoft Word, and aims to reproduce the content and look
of the LaTeX-compiled PDF as closely as a Word document can:
- Structure: title block (authors, affiliations, date), abstract, a table of
contents (a real Word TOC field that Word can update with page numbers),
numbered sections, unnumbered
\section*headings, lists and page breaks. Included files (\subfile,\input,\include) are followed. - Text: bold/italic/monospace/small caps,
\verb, hyperlinks (\href,\url), LaTeX quotes, dashes, accents and special characters, simple user macros (\newcommand,\def) defined in the preamble or document. - Math: inline formulas become formatted text (italic variables, real superscripts/subscripts, TeX-like spacing); anything beyond that (fractions, sums, roots, matrices, cases, ...) and all display equations become native, editable Word equations. Numbered equations get their number flush right.
- Cross-references:
\ref,\eqref,\autoref/\crefare resolved to the numbers LaTeX would print (two passes, like LaTeX). - Citations and bibliography:
biblatexwith theauthoryearstyle is emulated from the.bibfile(s): citation labels (\parencite,\cite,\textcite,\citeauthor,\citeyear, pre/postnotes,maxcitenames, ..., disambiguation letters such as 2018a/2018b), and a "References" list sorted and formatted like biblatex's standard drivers (fields cleared with\AtEveryBibitem{\clearfield{...}}are honoured). - Tables: real Word tables with the column alignment of the LaTeX column
specification,
\hline/booktabs rules as borders,\multicolumnand\multirowas merged cells, and the caption above or below as in the source. - Figures: every
figureenvironment (TikZ, PGFPlots,\includegraphics, sub-figures, anything) is rendered by LaTeX with the document's own preamble and embedded as a high-resolution PNG (400 dpi by default) at the size it has in the PDF. Each figure is placed on its own page: a page break is inserted right after the text preceding the figure and after its caption, which sits below the figure.
Installation
pip install docxwright
Figure rendering requires a LaTeX installation (pdflatex; lualatex/xelatex
are used automatically for documents that load fontspec/unicode-math) and a
PDF rasterizer: pdftoppm (poppler-utils), Ghostscript or MuPDF's mutool.
Without them the conversion still succeeds and figures are replaced by clearly
marked placeholders. The document is compiled from the directory of the main
.tex file, so relative \input/\includegraphics paths work as in LaTeX.
Usage
docxwright paper/main.tex -o paper/out/main.docx
Options:
| option | meaning |
|---|---|
--markdown FILE |
also write a Markdown-like rendering of the intermediate document (useful for review and diffs) |
--no-figures |
skip LaTeX figure rendering and insert placeholders |
--dpi N |
resolution of rendered figures (default 400) |
--latex-engine {pdflatex,lualatex,xelatex} |
override the engine used for figures |
Anything that cannot be converted faithfully (unknown commands, footnotes, unresolved references or citation keys, ...) is reported as a warning on stderr.
Limitations
- Pagination, fonts and float placement are not reproduced; tables stay where they appear in the source, figures get their own page.
- Citation styles other than biblatex
authoryearare approximated with the author-year format;uniquename/uniquelistdisambiguation is not emulated. - Footnotes are rendered inline in parentheses.
Metadata
Release files for docxwright 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| docxwright-2.0.1.tar.gz | 66.6 kB | Without provenance | Details for docxwright-2.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| docxwright-2.0.1-py3-none-any.whl | Python 3 | none | any | Details for docxwright-2.0.1-py3-none-any.whl |
Total release size: 132.9 kB
Release files / docxwright-2.0.1.tar.gz
| Download URL | docxwright-2.0.1.tar.gz |
|---|---|
| Size | 66.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c10ac2c22a4274930b659890f98966c9dc965c0f678177a267c5b41d6f1ea99
|
|
BLAKE2b-256 checksum How to use checksums |
a2e70f2b5ba7887b03df3e22a77b6374d4fb73198186b6f77b7c129cc6138321
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / docxwright-2.0.1-py3-none-any.whl
| Download URL | docxwright-2.0.1-py3-none-any.whl |
|---|---|
| Size | 66.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b66d113beba4b199691ca4a60d781bc53c3fb55c3ac4e498ad7e643442e7f248
|
|
BLAKE2b-256 checksum How to use checksums |
f0868b2bdd2f817f47f50e2d2fe83d3286dabf6c07d21879397f589b806b217c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for docxwright 2.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.