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.
dvipdfmx document.dvi # → document.pdf
dvipdfmx -p a4 -o out.pdf document.dvi| Option | What it does |
|---|---|
-o FILE | Output filename (- for stdout); defaults to the input name |
-p SIZE | Paper size by name: a4, letter, a3, legal, … |
-V N | PDF minor version (default 5 = PDF 1.5) |
-l | Landscape (swap the paper’s width and height) |
-s RANGE | Limit 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).
dvips -t a4 -o document.ps document.dvi # DVI → PostScript
ps2pdf document.ps # PostScript → PDF| Option | What it does |
|---|---|
-o FILE | Output PostScript filename |
-t PAPER | Paper type: a4, letter, legal, or landscape |
-P NAME | Load 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.
| Flags | Engine used |
|---|---|
(なし / none) | ptex |
-l | platex (pLaTeX) |
-u | uptex |
-l -u | uplatex (upLaTeX) |
# upLaTeX で組版し、UTF-8 入力と SyncTeX を指定して PDF まで
ptex2pdf -l -u -ot '-kanji=utf8 -synctex=1' document.texTo 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 text —
latex→dvipdfmx. - PDF, Japanese — one shot with
ptex2pdf -l -u …. - Print submission, EPS, PSTricks —
dvips→ps2pdf. - 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
ps2pdfon the PostScript fromdvips, confirm that EPS and PostScript specials survived. - For Japanese documents:
ptex2pdf -l -uis convenient, but the real contract is that the two-stepuplatexplusdvipdfmxroute succeeds. - Names and locations: keep the DVI, PDF, and
.synctex.gzbase names aligned, and if outputs go elsewhere, make the build tool specify that path consistently.