[XeTeX] XeTeX and postscript output

Ross Moore ross at ics.mq.edu.au
Fri Feb 6 00:38:03 CET 2009


Hi Ulrike, and Kirk,

On 06/02/2009, at 2:08 AM, Ulrike Fischer wrote:

> Am Thu, 5 Feb 2009 09:05:10 -0500 schrieb Kirk Lowery:
>
>> I want to use the package xyling (for drawing linguistic tree
>> diagrams). However, the best way to use it is to generate a  
>> postscript
>> file and then ps2pdf or some such to get the final pdf file.
>> Otherwise, one can loose "branches", color and other sorts of errors.
>>
>> After looking at the docs, it doesn't seem that xelatex will generate
>> postscript output. Is there a way to do this?
>
> The problem is not the end format but the \specials:
> xyling/xypic will insert dvips specials in the dvi (latex) or xdv
> (xelatex). xelatex use xdvipdfmx to convert the xdv to pdf and
> xdvipdfmx which will probably not like or not understand some of
> this specials.
>
> It is probably possible to write a suitable driver file (xetex is
> able to handle a lot of pstricks) but as far as I can see it the
> work hasn't been done yet.

A way to handle this is to first process your document
using  pdfTeX with the {pdftricks} package, marking the
diagrams to be handled specially.
(You'll need \ifpdf  conditionals to bypass any
  XeTeX-specific stuff in your preamble.)
You'll need these environments, defined within pdftricks :

   \newenvironment{pdfdisplay}{...
   \newenvironment{pdfpic}{...
   \newenvironment{pdfinline}{...
   \newenvironment{psinputs}{...

This will cause a separate TeX job to be run on each
diagram, using dvips+Ghostscript to get a PDF image.

Then reprocess the whole document with XeTeX.
The special environments should now cause those images
to be included, instead of processing Xyling/Xypic coding.


If this last step doesn't work "out-of-the-box",
then you should be able to simulate the logic directly
using  \ifpdf  or  \ifxetex  conditionals to skip
the environment and use  \includegraphics  directly.

This is much easier programming that trying to develop
a special driver for someone else's software package.


You'll only need to reprocess using  pdfTeX if you
add more diagrams or change their order.
That is, you can organise your LaTeX source so that
it controls *all* the required steps, just by changing
the processing engine:  pdfTeX or XeTeX.

>
>
> -- 
> Ulrike Fischer


Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                       ross at maths.mq.edu.au
Mathematics Department                           office: E7A-419
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------





More information about the XeTeX mailing list