# [XeTeX] pdfpages and XeTeX

Mojca Miklavec mojca.miklavec.lists at gmail.com
Fri Sep 8 01:59:48 CEST 2006

On 9/8/06, Bruno Voisin wrote:
> Le 7 sept. 06 à 22:01, Pablo Rodríguez a écrit :
>
> > I have to insert a 20-page PDF document into a XeTeX document (both
> > use
> > the same paper size). I have tried to use pdfpages, but I guess they
> > don't fit together (it seems to have problems with the driver and it
> > doesn't find the \includepdf command).

(skipping the LaTeX-based part)

> That said, ConTeXt is provided with a script texexec which includes,
> among other things, the possibility to manipulate PDF files
> (concatenating files, rearranging pages, and much more). Try "man
> texexec" in Terminal (texexec is included in gwTeX), and look for
> example at the --pdfcombine and --pdfselect flags.

I doubt that Pablo who posted the question would be interested in what
follows, but since the topic has been started here are some comments.

http://wiki.contextgarden.net/Including_pages_from_PDF_document

>  From an old post by me to the OS X TeX list:
>
> > De : Bruno Voisin
> > Date : 19 août 2003 16:34:07 HAEC
> > À : "TeX on Mac OS X Mailing List"
> > Objet : The joy of TeXexec (was Re: [OS X TeX] Re: PDF booklet making)
> >
> > Le samedi, 16 aoû 2003, à 13:23 Europe/Paris, Maarten Sneep a écrit :
> >
> >> try texexec --help. it gives a list of options. one of those seems
> >> to be "--result", with description: "resulting file =name     :
> >> filename". It seems to be what you need.
> >>     texexec --pdfarrange --paper=A5A4 --print=2up --
> >> result=outfile.pdf infile.pdf
> >
> > So far I had not paid much attention to messages and solutions
> > involving TeXexec, being an Apple devotee at heart and thus somehow
> > reticent to everything command-line.
> >
> > However, today a colleague asked me about a free (ie not involving
> > purchasing Adobe Acrobat) solution for extracting all odd or even
> > pages of a PDF document. There is a solution involving
> > pdfpages.sty, but it requires (i) creating a LaTeX file to compile
> > and (ii) specifying manually the pages to be included, as in:
> >
> >       \documentclass[a4paper]{article}
> >       \usepackage{pdfpages}
> >
> >       \begin{document}
> >
> >       \includepdf[pages={1,3,5,7,9}]{complet.pdf}
> >
> >       \end{document}
> >
> > Guided by the postings in the mentioned thread, and with only a
> > couple of minutes typing "man texexec" and browsing through the
> > output, I came out with the command-line solution:
> >
> >       texexec --pdfselect --selection=odd --result=extrait.pdf complet.pdf
> >
> > which works wonderfully.
> >
> > A great praise for the capabilities of TeXexec, and for Gerben's
> > hard work at making this available to us with minimal fuss (for us,
> > not him)!
> >
> > Bruno Voisin
>
> I think there are ConTeXt users on this list.

There are some, but not many (and since most issues here deal with
LaTeX anyway, I often skip the whole thread if the title doesn't seem
relevant enough). It's much better to use the ConTeXt mailing list,
even if the question is XeTeX-related.

> Could texexec work with XeTeX?

What exactly do you mean? texexec and XeTeX have been friends for
quite some time.
texexec --xtx [everything else should be the same]

But bear in mind that "texmfstart" (google for it) should be enabled
if possible, which is the default only in MikTeX 2.5 (where XeTeX
doesn't work) and in ConTeXt stand-alone distribution. Gerben's
i-Installer hasn't been set up in that sense yet and under tetex on
Linux you have to reinstall ConTeXt completely anyway unless you want
to work with the pre-historic version. I have no idea to what extent
XeTeX is supported in the old texexec.pl (it is, but ...).

PS: The equivalent to the definition above would be:
texexec --xtx --pdfselect --selection=odd --result=extrait.pdf complet.pdf
however:

1.) First of all: you don't need the --xtx switch for the job
mentioned above. And on the other hand it's not the solution that
could be an alternative to the ability of inserting PDF pages in the
middle of the (LaTeX) document (possible, but too cumbersome).

2.) Latest beta has some minor problems with inclusion of PDFs, but
that should go away soon, I believe. Hans reimplemented figure
inclusions lately and asked for bug reports, so I think that he would
be really happy to see and repair this one ;)

Mojca