[XeTeX] [tex-implementors] Proposal : that TeX engines generating PDF directly should be able to close the output file without terminating.

David Kastrup dak at gnu.org
Fri Jul 3 22:32:58 CEST 2020

Bruno Le Floch <blflatex at gmail.com> writes:

[multiple PDF per TeX run]

> A major use case could be for AucTeX preview of equations,

AUCTeX's preview-mode already compiles a single PDF file from which it
then extracts one-page images as needed into a single Ghostscript
process.  Which means that not only does LaTeX get to see only one
instance of the document preamble, but Ghostscript gets to process only
one instance of the PDF "preamble" (preview-latex uses the psd2dsc
utility for creating a DSC-structures "view" of the PDF) and fonts for
all equations in one document.

> or other
> wysywyg-like interfaces where one wants to compile chunks of TeX code
> always with the same preamble, and with no relevant changes in macros:
> one could have an ongoing TeX run producing pdfs when provided with
> further input.  A currently-working variant of this is the following
> (in bash), which ships out a first page, then waits 10 seconds, then
> ships out another one.
> $ (echo '\relax Hello world!\vfill\break' && sleep 10 && echo '\relax Another
> pdf.\bye') | xetex
> One could imagine a primitive \nextpdf that would make xetex produce 2 separate
> pdfs (in the present case texput.pdf and secondfile.pdf)
> $ (echo '\relax Hello world!\nextpdf{secondfile}' && sleep 10 && echo '\relax
> Another pdf.\bye') | xetex

Of course, other tools may have other applications for such
functionality, but I doubt one would be able to make much use of it in

David Kastrup

More information about the XeTeX mailing list.