[Tex/LaTex] How to view .xdv files

viewersxetex

How can I view eXtended DVi files in a computer? These are the output of the command xelatex -no-pdf. I am particularly interested for the solution on a Mac, but please comment on other platforms as well. Traditional programs like xdvi or Okular seem not to be able to deal with the .xdv file.

Best Answer

When Jonathan Kew wrote XeTeX, he found it easier using an extension of the DVI output format rather than direct PDF output. So he defined the XDV format and wrote a driver xdv2pdf for transforming the XDV file into a PDF one.

However the xdv2pdf program used extensively the Apple font libraries, so it wasn't easy to adapt it to other platforms. Later on, the xdvipdfmx driver, based on dvipdfmx (which in turn is based on M. Wicks's dvipdfm), was written. Now XeTeX uses the fontconfig library on all systems (but on Mac OS X it can still use Apple libraries). As Khaled Hosny remarks in a comment, xdvipdfmx doesn't rely on fontconfig, however.

Each run of xetex produces a file in XDV format which is transparently fed to xdvipdfmx (with no user intervention) and then removed.

There is no previewer for the XDV format. While it may be possible to extend xdvi for this purpose, I don't think that this will ever be attempted: one should link it to the fontconfig libraries and do many other changes for accommodating all "specials" understood by xdvipdfmx. PDF previewers are fast and reliable, so there's no point in trying such a path.

In olden times, previewing a DVI instead of a PostScript/PDF file was maybe faster (with some limitations related mainly to rotation); nowadays the difference in time is probably negligible.