DVI converters

The latex command and the Japanese platex / uplatex produce a DVI intermediate file, not a PDF. Turning that into a real, readable document is the job of a DVI converter: dvipdfmx for PDF, dvips for PostScript, and — for Japanese — ptex2pdf, which runs the whole typeset-and-convert in one command. This page covers all three and the options you actually use.

What DVI is, and why you convert it

DVI (device-independent) is the intermediate format TeX emits: a record of *which glyph or rule sits at which position*. As the name says, it is independent of the output device, and it does not embed the actual fonts. That makes it compact but awkward to view, print, or share directly — so you convert it for the target you need: PDF for screens and distribution, PostScript for print workflows and certain packages. The commands that *produce* DVI are covered in “Compile commands.”

dvipdfmx — DVI to PDF

dvipdfmx is the standard DVI-to-PDF converter in TeX Live. Its ancestor dvipdfm was written by Mark A. Wicks; dvipdfmx is the extended version (CJK support, font embedding, object streams, …) by Jin-Hwan Cho, Shunsaku Hirata, and others. The xdvipdfmx that XeTeX uses internally is from the same family but is not meant to be invoked directly.

terminal
dvipdfmx document.dvi            # → document.pdf
dvipdfmx -p a4 -o out.pdf document.dvi
OptionWhat it does
-o FILEOutput filename (- for stdout); defaults to the input name
-p SIZEPaper size by name: a4, letter, a3, legal, …
-V NPDF minor version (default 5 = PDF 1.5)
-lLandscape (swap the paper’s width and height)
-s RANGELimit pages processed, e.g. -s 1-10

dvips — DVI to PostScript

dvips (by Tomas Rokicki) is the venerable tool that converts DVI to PostScript (.ps). It is still used for print-shop submission, generating EPS, and PostScript-based drawing packages (PSTricks and the like). When you need a PDF, the usual route is to pass the resulting .ps through ps2pdf (bundled with Ghostscript).

terminal
dvips -t a4 -o document.ps document.dvi   # DVI → PostScript
ps2pdf document.ps                        # PostScript → PDF
OptionWhat it does
-o FILEOutput PostScript filename
-t PAPERPaper type: a4, letter, legal, or landscape
-P NAMELoad the printer config config.NAME (resolution, font setup)

ptex2pdf — Japanese to PDF in one step

In Japanese you take two steps: “typeset with uplatex, then make a PDF with dvipdfmx.” ptex2pdf folds that into one command — it runs a pTeX-family engine and then calls dvipdfmx automatically. It is a texlua script by texjporg (the Japanese TeX development community) and Norbert Preining, originally built so TeXworks could pick a Japanese engine easily.

You pick the engine by combining flags. With none, it is ptex; -l selects a LaTeX format, -u the upTeX family, -e the e-pTeX family. For example, upLaTeX — the standard for Japanese papers — is -l -u.

FlagsEngine used
(なし / none)ptex
-lplatex (pLaTeX)
-uuptex
-l -uuplatex (upLaTeX)
terminal
# upLaTeX で組版し、UTF-8 入力と SyncTeX を指定して PDF まで
ptex2pdf -l -u -ot '-kanji=utf8 -synctex=1' document.tex

To pass fine-grained options through, use -ot '...' for the TeX engine and -od '...' for dvipdfmx. Add -s to stop at DVI, -i to keep intermediate files, and -output-directory to redirect the output.

Which one to use

  • PDF, English/European textlatexdvipdfmx.
  • PDF, Japanese — one shot with ptex2pdf -l -u ….
  • Print submission, EPS, PSTricksdvipsps2pdf.
  • Avoid DVI entirely — emit PDF directly with pdflatex / lualatex.

In practice you rarely run these by hand in sequence. A build tool like latexmk handles the number of compile passes and the DVI conversion for you (latexmk supports the (u)platex + dvipdfmx setup too).

Pre-submission DVI conversion check

  • For PDF submission: after dvipdfmx, open the PDF in the same viewer or upload target you will use and check embedded fonts, paper size, bookmarks, and links.
  • For print workflows: before and after running ps2pdf on the PostScript from dvips, confirm that EPS and PostScript specials survived.
  • For Japanese documents: ptex2pdf -l -u is convenient, but the real contract is that the two-step uplatex plus dvipdfmx route succeeds.
  • Names and locations: keep the DVI, PDF, and .synctex.gz base names aligned, and if outputs go elsewhere, make the build tool specify that path consistently.