Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert TEX files to PDF or DOCX?

I'm using Doxygen to build an API library from C# source code. Doxygen generates a library of TEX files.

My client has asked for a PDF version of this API library so I need to convert the TEX file library into a single PDF or DOCX.

I've been looking into tools such as LyX, OpenOffice, and ProText but still haven't found a solution.

All suggetions welcome.

like image 523
pixelbobby Avatar asked Sep 29 '09 17:09

pixelbobby


3 Answers

The simplest way to get pdf files is to use pdflatex. Any TeX installation will include it, including MikTeX and TeXLive, the two major Windows implementations. The conversion is perfect by definition because pdflatex is a standard LaTeX compiler.

Other methods include dvi2pdf, dvi2ps followed by ps2pdf, etc. But these involve an additional step.

To get a docx file is trickier. There are a range of tex to word converters. I've used Tex2Word with reasonable success, although there is always a deal of tidying up to do. Other tools are discussed here. Whatever you use, you will probably need to convert to doc first, and then to docx, as I don't think any of the conversion tools produce direct docx output.

like image 184
Rob Hyndman Avatar answered Sep 19 '22 18:09

Rob Hyndman


Why not just compile the .tex documents with LaTeX? On windows use MiKTeX and TeXnicCenter. I'm not sure how much formatting you will need to add, but give the document a standard preamble, and compile. You can output PDF.

EDIT: Further note... the package tex4ht on miktex works pretty well, as long as your latex markup is fairly standard. tex4ht will dump into html, openoffice, and a bunch of other stuff. If you can get it into html, you can take it into word (i've found that this works better than going straight to openoffice).

like image 24
Mica Avatar answered Sep 18 '22 18:09

Mica


After some time of research, I stepped across that nice free converter tool that amongst others creates you a .docx file out of a .tex file. Check it out:

Pandoc - a universal document converter.

See their Example Page for demos.

To convert .tex to .docx, use:

pandoc -s example.tex -o example.docx

which will give you a quite satisfying output depending on your expectations. It also converts equations to regular word equations, although not every symbol properly.

like image 38
Flaudre Avatar answered Sep 19 '22 18:09

Flaudre