[OS X TeX] pstricks in pdftex and xetex

Bruno Voisin bvoisin at mac.com
Tue Oct 12 09:40:59 CEST 2004


Le 12 oct. 04, à 09:24, Michael Gedalin a écrit :

> 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.

Hello,

I just checked that XeTeX does indeed have a -shell-escape option:


legimc11:~ brunovoisin$ xetex -h
Usage: xetex [OPTION]... [TEXNAME[.tex]] [COMMANDS]
    or: xetex [OPTION]... \FIRST-LINE
    or: xetex [OPTION]... &FMT ARGS
   Run XeTeX on TEXNAME, usually creating TEXNAME.pdf.
   Any remaining COMMANDS are processed as XeTeX input, after TEXNAME is 
read.
   If the first line of TEXNAME is %&FMT, and FMT is an existing .xfmt 
file,
   use it.  Else use `NAME.xfmt', where NAME is the program invocation 
name,
   most commonly `xetex'.

   Alternatively, if the first non-option argument begins with a 
backslash,
   interpret all non-option arguments as a line of XeTeX input.

   Alternatively, if the first non-option argument begins with a &, the
   next word is taken as the FMT to read, overriding all else.  Any
   remaining arguments are processed as above.

   If no arguments or options are specified, prompt for input.

-file-line-error-style   print file:line:error style messages
-ini                     be xeinitex, for dumping formats; this is 
implicitly
                           true if the program name is `xeinitex'
-interaction=STRING      set interaction mode 
(STRING=batchmode/nonstopmode/
                           scrollmode/errorstopmode)
-jobname=STRING          set the job name to STRING
-kpathsea-debug=NUMBER   set path searching debugging flags according to
                           the bits of NUMBER
[-no]-mktex=FMT          disable/enable mktexFMT generation 
(FMT=tex/tfm)
-output-comment=STRING   use STRING for output file comment instead of 
date
-papersize=STRING        use STRING for PDF media size instead of 
default
-parse-first-line        parse of the first line of the input file
[-no]-pdf                disable/enable automatic conversion of XDV to 
PDF
-progname=STRING         set program (and fmt) name to STRING
-recorder                enable filename recorder
-shell-escape            enable \write18{SHELL COMMAND}
-src-specials            insert source specials into the output file
-src-specials=WHERE      insert source specials in certain places of
                           the output file. WHERE is a comma-separated 
value
                           list: cr display hbox math par parend vbox
-help                    display this help and exit
-version                 output version information and exit
-xfmt=FMTNAME            use FMTNAME instead of program name or a %& 
line


Did you try running "xetex -shell-escape -no-pdf" then "xdv2pdf" from 
the command line, to see at which stage the error is produced.

That said, I think pdftricks is tailored specifically for pdfTeX, and 
possibly cannot work with XeTeX. To make the LaTeX graphics package 
work with XeTeX, Ross Moore had to write a specific definition file 
/usr/local/teTeX/share/texmf.local/tex/xetex/xetex.def, used when 
specifying \usepackage[xetex]{graphics, color}. It's possible a similar 
file needs to be written for pdftricks, I'm not sure (not using 
pdftricks myself, apart from an occasional try one said, which did not 
convince me).

Something which may or may not solve the issue: to make sure the 
[xetex] option is activated implicitly, for the graphics and color 
packages, each time XeLaTeX is run, without having to specify it 
yourself, you may try to put copies of 
/usr/local/teTeX/share/texmf.tetex/tex/latex/config/color.cfg and 
/usr/local/teTeX/share/texmf.tetex/tex/latex/config/graphics.cfg inside 
~/texmf/tex/latex/config/, and replace in them


% Select an appropriate default driver
\begingroup
   \chardef\x=0 %
   % check pdfTeX
   \@ifundefined{pdfoutput}{}{%
     \ifcase\pdfoutput
     \else
       \chardef\x=1 %
     \fi
   }%
   % check VTeX
   \@ifundefined{OpMode}{}{%
     \chardef\x=2 %
   }%
\expandafter\endgroup
\ifcase\x
   % default case
   \ExecuteOptions{dvips}%
\or
   % pdfTeX is running in pdf mode
   \ExecuteOptions{pdftex}%
\else
   % VTeX is running
   \ExecuteOptions{vtex}%
\fi


by


% Select an appropriate default driver
\begingroup
   \chardef\x=0 %
   % check pdfTeX
   \@ifundefined{pdfoutput}{}{%
     \ifcase\pdfoutput
     \else
       \chardef\x=1 %
     \fi
   }%
   % check VTeX
   \@ifundefined{OpMode}{}{%
     \chardef\x=2 %
   }%
   % check XeTeX
   \@ifundefined{XeTeXversion}{}{%
     \chardef\x=3 %
   }%
\expandafter\endgroup
\ifcase\x
   % default case
   \ExecuteOptions{dvips}%
\or
   % pdfTeX is running in pdf mode
   \ExecuteOptions{pdftex}%
\or
   % VTeX is running
   \ExecuteOptions{vtex}%
\else
   % XeTeX is running
   \ExecuteOptions{xetex}%
\fi


Hope this helps,

Bruno Voisin

--------------------- 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 Macostex-archives mailing list