Converting documentation Using common tools, we can quickly convert .docx or .tex files to .rst [Pandoc](https://pandoc.org/) is a great tool to quickly convert files between formats. Although it does the bulk of the work for us, we still need to through the output and clean it up. To convert PDF/EPS images or images in other formats we can use [Magick](https://imagemagick.org/index.php) and [Ghostscript](https://www.ghostscript.com/). Ideally, SMEs create and update documentation directly via Sphinx. For times when this is not possible, we can use similar commands as below. ```bash pandoc topic.tex -o topic.rst --wrap=none # Converting base tex files to rst pandoc document.docx -o document.rst --wrap=none # Converting docx documents to rst magick mogrify -trim -format png *.pdf # Convert all pdf (replace with eps if needed) files within a folder ```
1 minute read | Concept

Converting documentation

Using common tools, we can quickly convert .docx or .tex files to .rst

Pandoc is a great tool to quickly convert files between formats.

Although it does the bulk of the work for us, we still need to through the output and clean it up.

To convert PDF/EPS images or images in other formats we can use Magick and Ghostscript.

Ideally, SMEs create and update documentation directly via Sphinx. For times when this is not possible, we can use similar commands as below.

Example
pandoc topic.tex -o topic.rst --wrap=none           # Converting base tex files to rst

pandoc document.docx -o document.rst --wrap=none    # Converting docx documents to rst

magick mogrify -trim -format png *.pdf              # Convert all pdf (replace with eps if needed) files within a folder


Home | Contact