[XeTeX] XeTexXpdffile problem/bug

Andreas Matthias andreas.matthias at gmail.com
Sat Dec 6 13:39:02 CET 2008

Rik Kabel wrote:

> Attached are two minimal examples demonstrating a problem with \XeTeXpdffile.
> The problem is that the included file is not processed if there is nothing
> present on the page before the graphic.

> %< ================= Minimal example 1 fails ==================
> % This example produces no output file
>   \documentclass{minimal}
>   \begin{document}
>   \XeTeXpdffile "ok.pdf"
>   \end{document}
> %< ================= end minimal example 1 fails ==============

This is not a bug. It's just the way \special's are treated by
TeX (all TeX-engines not only XeTeX). Remember that \XeTeXpdffile
is just a \special.

In the command \special{<token list>} the token list will get
expanded by TeX and will then be written directly to the dvi file.
It is up to the driver (dvips, xdvipdfmx,...) to do something
useful with it. TeX doesn't look at the token list to see if
it makes any sense.


Try this example with "xelatex -no-pdf <file>" and "latex <file>".
Concerning TeX the \special's token list does not contribute to
any contents. That's why it does not output any page and hence
xdvipdfmx or other driver are coming too late.


More information about the XeTeX mailing list