I always thought tex turned code into pdf but it seems that has not always been the case. Depending on the process, I could end up with a DVI file or a PS file. Are these still commonly used? Can they be viewed and printed like PDFs? How did PDF end up being the dominant output?
-
2Half in pdftex - Is there any reason to compile to DVI rather than PDF these days? - TeX - LaTeX Stack Exchange. – user202729 Oct 16 '22 at 14:20
-
See also https://tex.stackexchange.com/questions/130518/is-the-dvi-format-de-facto-dead – lhf Dec 18 '22 at 11:54
2 Answers
No commonly used TeX variant had PostScript output (the only exception was vtex had PostScript and HTML in addition to DVI and PDF, I think)
Classic TeX just makes dvi as does xetex and the Japanese ptex variants. pdftex and luatex can make either pdf or dvi.
PDF viewers are by now far more common so usually people convert dvi to PDF (possibly via PostScript) for viewing or printing.
latex small2e makes a dvi file which I can view with xdvi
dvips small2e converts that to PostScript which I can view with gv
ps2pdf small2e.ps small2e.pdf converts that to PDF which I can view with xpdf
- 757,742
-
Could you elaborate on why this is the case? My understanding is that pdf wasn't a common format (or even invented?) when TeX came into being, but has become much more popular than dvi over the years because of Adobe. Is that correct? – Teepeemm Oct 16 '22 at 15:04
-
1@Teepeemm the popularity of pdf is essentially independent of the tex world, (and yes it did not exist as a format when tex started) but now if have
small2e.dvi,small2e.ps,small2e.pdfand I want to send someone the document or post it to a web site, naturally I would use the PDF and expect more or less anyone can read it. if I sent the dvi, most people would not have a viewer. – David Carlisle Oct 16 '22 at 15:18 -
Also, images are added by the dvi veiwer at display time (as are the fonts). – John Kormylo Oct 16 '22 at 23:59
Yes, dvi files can be viewed, but it can be a bit hit and miss due to slight deviations from the standard file format made by the various LaTeX engines (mostly to accomodate OpenType/TrueType fonts is seems).
My opensource Javascript module dvi-decode is an attempt to enable LuaTeX dvi files to be rendered directly in a web-browser.
You can try the demo React app here: DVI Viewer
- 21
- 2
