LaTeX (dvipdfmx) online
Run LaTeX (dvipdfmx) online: the original latex program writes a DVI file and dvipdfmx converts it to PDF, both inside your browser.
Open in LaTeX.to Download the example (zip)
- Maintained, 1984
- Magic comment:
% !TeX program = latex-dvipdfmxon the first line of main.tex, which is how the example picks it under Auto. - License: Public domain, use freely.
- Files:
main.tex
% !TeX program = latex-dvipdfmx \documentclass[11pt]{article} \usepackage{graphicx} \usepackage{xcolor} \title{From DVI to PDF with dvipdfmx} \author{The other half of the classic route} \date{\today} \begin{document} \maketitle \section{A different path to a PDF} Most engines write PDF directly. This document takes two steps instead: \textbf{latex} compiles the source to a DVI file, and \textbf{dvipdfmx} converts that DVI into the PDF you are reading. Nothing else changes. The same source, the same fonts and the same packages give you the same pages, one step later. \section{You have to ask for it} The route is never chosen automatically, because nothing in a document asks for dvipdfmx. You either pick it in the engine dropdown or, as here, pin it with the magic comment on the very first line, \texttt{\% !TeX program = latex-dvipdfmx}. That keeps it out of the way until you want it. \section{What travels through the DVI} DVI is a compact record of boxes and glue, and colour and graphics ride along as specials the converter knows how to read: this {\color{teal}coloured phrase} and this \rotatebox{12}{rotated} word both reach the page that way, and so do included PDF, PNG and JPEG figures. Documents written with \texttt{dvipdfmx} driver options land here, and so do the Japanese engines pLaTeX and upLaTeX, which finish in this same converter. \section{Where it stops} PostScript does not travel this way. PSTricks drawings, \texttt{psfrag} labels and EPS figures nobody has converted want dvips and Ghostscript instead, which is what the plain \texttt{latex} choice runs. For a document written for dvipdfmx, though, this pipeline just works, exactly as it always has. \end{document}
How to compile with LaTeX (dvipdfmx) on LaTeX.to
Everything runs in your browser: nothing to install, no login, no compile timeout.
- Click Open in LaTeX.to. The example opens as a project with main.tex in the editor and its finished PDF in the preview.
- Edit, then press Ctrl+Enter (Cmd+Enter on a Mac). The first compile downloads what this engine needs; after that a compile takes seconds.
What the dvipdfmx route is
latex writes a DVI file, a compact record of boxes and glue, and dvipdfmx turns that DVI into the PDF you download. pdfLaTeX folded the second step into the engine and most of the world moved on, but this route never went away. In Japan it is the everyday one: the pTeX engines write only DVI, dvipdfmx is the standard PDF driver there, and nearly every Japanese document carries [dvipdfmx] on its graphicx and hyperref lines. Japanese text takes that toolchain through pLaTeX and upLaTeX; this page is the plain latex half of it, for a document that is not Japanese but was written the same way. Same fonts and same packages as pdfLaTeX, one extra step.
Auto never picks it, because nothing in a document asks for dvipdfmx by name. The example asks for it on its first line, % !TeX program = latex-dvipdfmx, and the same line works in your files.
When to use it
- A document written for dvipdfmx, with
\usepackage[dvipdfmx]{graphicx},\usepackage[dvipdfmx]{hyperref}or thedvipdfmxclass option in it: a Japanese lab's report template with the Japanese text taken out, for instance. - Checking that a document comes out the same on the route a Japanese co-author or publisher builds with.
- A build script or Makefile that expects a
.dvito exist. - Japanese text itself: not here but on pLaTeX or upLaTeX, which is this route with a Japanese engine in front.
- A fresh document with none of those ties: pdfLaTeX does the same in one pass, with microtypography on top.
What works and what does not
- Works: colour and rotation (
xcolorandgraphicxwrite DVI specials thatdvipdfmxunderstands), included PDF, PNG and JPEG graphics, EPS figures (dvipdfmx converts them through Ghostscript on the way), andhyperrefwith thedvipdfmxoption. - Does not work: anything that runs PostScript on the page itself.
pstricksandpsfragwant dvips and Ghostscript, which is the LaTeX route here, not this one. A drawing in TikZ works on this route once its dvipdfmx driver is named, as the TikZ page shows.
More engines: LuaLaTeX, pdfLaTeX, XeLaTeX, LaTeX and all engines.