Given a LaTeX file, foo.tex, that requires xelatex, one can convert it to PDF in the following two ways:

  1. Run xelatex foo (which directly generates foo.pdf)
  2. Run xelatex -no-pdf foo (which generates foo.xdv) followed by xdvipdfmx foo (which converts the xdv file to foo.pdf)

Do the two approaches, in effect, produce the same pdf file? Or is there some advantage to (1) (or indeed (2))?

(The context for this is that in the past I had always assumed that with a latex file that does not require xelatex it was preferable to call pdflatex rather than calling latex and converting the DVI to PDF. Indeed, in the past latexmk with the -xelatex argument would follow route (1), however newer versions follow (2), which initially concerned me, in analogy with my pdflatex comment above. Having found "latexmk with xelatex xdv mode" I suspect that (1) and (2) are essentially equivalent, but I wanted to confirm this. In particular I want to be sure the two routes are equivalent even if one is using packages such as microtype or hyperref.)


1 Answer 1


The approaches are identical because xetex calls xdvipdfmx unless you specify -no-pdf.

xetex is not like pdftex or luatex that have a modified back end that generates pdf, it always generates (extended) dvi but it runs xdvipdfmx at the end and deletes the intermediate files unless --no-pdf option is given.

  • 1
    @banbh er... I have the sources checked out, does that count?:-) if you go xetex --help then among the options is -output-driver=CMD use CMD as the XDV-to-PDF driver instead of xdvipdfmx which sort of hints that the default behaviour is to run xdvipdfmx but it isn't mentioned in the xetex manual as far as I can see. Nov 15, 2017 at 17:07
  • 1
    Hey David, does xelatex calls xdvipdfmx with any flags? It seems that xelatex == xelatex -no-pdf + xdvipdfmx -E?
    – Ch'en Meng
    Apr 3, 2018 at 7:21
  • 3
    @Ch'enMeng Checking the XeTeX sources I found: const char *outputdriver = "xdvipdfmx -q -E"; /* default to portable xdvipdfmx driver */, so calling xelatex is essentially the same as calling xelatex -output-driver='xdvipdfmx -q -E' or xelatex -no-pdf + xdvipdfmx -q -E. Feb 7, 2019 at 18:19
  • 1
    @PhelypeOleinik yes, especially the choice to run xdvpdfmx in quiet mode by default masks many warnings that might have been better not hidden, but it is what it is.... Feb 7, 2019 at 18:30
  • 1
    Hi @PhelypeOleinik, thanks for the information. : )
    – Ch'en Meng
    Feb 11, 2019 at 11:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .