[OS X TeX] pstricks in pdftex and xetex

Ross Moore ross at maths.mq.edu.au
Tue Oct 12 08:12:09 EDT 2004


Hi Jan, Michael, and others

On 12/10/2004, at 7:37 PM, Jan Eden wrote:

> Michael Gedalin wrote on 12.10.2004:
>
>> I know two packages aimed to substitute/extend pstricks for using in
>> non-postscript tex. One is pgf which defines its own commands
>> instead of pstricks for produce directly pdf output. The other is
>> pdftricks which is a kind of wrapper for pstricks, It uses \write18
>> (or --shell-escape). Both are working with pdfelatex for my, neither
>> is working with xetex. While I do not get any error/warning I could
>> understand from pgf, running pdftricks results in "no \write18
>> capability", although I enable 'xetex --shell-escape' via the
>> TeXShop preferences.
>
> That is what I experienced - I am using the beamer class which uses 
> pgf for its various display tricks.

Sorry for my ignorance --- what is  pgf ?

>
> Among other things, including a pdf image is not possible with xetex 
> and the beamer class: \usepackage[xetex]{graphicx} gives me an option 
> clash.

Including  pdf images is certainly possible with XeTeX.
Please provide an example file that is giving you difficulty.

>
> I already tested several workarounds for using pstricks with 
> pdf(la)tex (like ps4pdf), and I wanted to switch to pgf finally. But 
> now, since xetex has problems with pgf, I am stuck again.

It should indeed be possible to use {ps4pdf}, but perhaps not yet
  "out-of-the-box".
When Jonathan fixes the reported \write18 problem, this should be
tested again, and a full workable solution devised, if necessary.


For those who have never tried {ps4pdf}, it first causes (standard)
LaTeX to be run on a document, processing only  \PSforPDF{...}  blocks,
each into an image. Then dvips + ps2pdf (i.e. Ghostscript) are run to 
create
a multipage PDF archive consisting of those images only.
Finally, the desired LaTeX engine (e.g. XeLaTeX) is run to process the
whole document, replacing each \PSforPDF{...}  block with the 
appropriate
image imported from the previously constructed PDF archive.

Subsequent runs do not need to recreate the PDF archive, unless changes
which affect the order of images or requiring new images, have occurred.
So the subsequent runs are usually significantly faster.



There is absolutely no reason why this strategy should not be usable 
with XeTeX,
on documents that would ordinarily require special PostScript 
processing.
(e.g. using PSTricks, psfrag, Xy-pic + PS backend, other PS-dependent 
packages).

It does, however, require installation of the  {preview}  package for
ordinary LaTeX or pdf-LaTeX, which complicates things a bit.
It'll probably require a little bit of extra coding to use this with 
XeTeX,
as an engine that can read PDF images.



Hope this helps,

	Ross


>
> - Jan
> -- 
> If all else fails read the instructions. - Donald Knuth
> --------------------- Info ---------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>            & FAQ: http://latex.yauh.de/faq/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
>
>
>
------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia                                  fax: +61 +2 9850 8114
------------------------------------------------------------------------

--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the MacOSX-TeX mailing list