[XeTeX] ps4xelatex release .00001

Roger Hart rhart at mail.utexas.edu
Sun Feb 27 09:17:16 CET 2005


Please forgive my somewhat ill-considered comments, due to frustration 
with not understanding the TeX language, and thanks very much indeed 
for the all the very kind and generous help. In particular, Bruno's 
suggestion for TeX by Topic was exactly what I was looking for! This is 
indeed not for the faint of heart! I can see I also need to purchase 
Knuth's TeXbook.

But for my purposes, as an absolute novice and simple end-user of 
xelatex, I had in mind something much more pedestrian than Bruno's 
expert insights.  I think the following  is probably sufficient for my 
own personal needs, where I've incorporated Bernhard's suggesting for 
testing for xelatex, and post it only as an idea that admittedly may 
create disastrous results I'm not knowledgeable enough to foresee.  
Fools rush in ...


\ProvidesPackage{ps4xelatex}[2005/02/25 version .00001]
\RequirePackage{calc}

\ifx\XeTeXversion\undefined
	\usepackage[all,dvips,ps]{xy}
	\xyoption{all}
	\usepackage{color}
	\usepackage{pstricks}
	\usepackage{ps4pdf}
	\newcommand{\PSforXeLaTex}[2]{\scalebox{#1}{\PSforPDF{#2}}}
\else
	\newcommand*\PfX at container{\jobname-pics.pdf}
	\newcommand*\containerName[1]{\def\PfX at container{#1}}
	\newcounter{psforpdfpgnum}
	\newcounter{pdfscale}
	\IfFileExists{\PfX at container}%
   	{}{%
       	\PackageWarningNoLine{ps4xelatex}{%
       	  Graphic container `\PfX at container' not found}%
	 }%
	\newcommand{\PSforXeLaTex}[2]{%
		\stepcounter{psforpdfpgnum}%
		\setcounter{pdfscale}{1000*\real{#1}}%
		\XeTeXpdffile "\PfX at container" page \value{psforpdfpgnum} scaled 
\value{pdfscale}%
	}%
\fi


Then I use:

\usepackage{ps4xelatex}
...
\PSforXeLaTex{my-scale-factor}{my-old-PS4PDF-code}

If I run this with the ps4pdf engine for TeXShop that Herb(?) released 
(or using a shell or perl in to process the file following the 
documentation with ps4pdf, with latex ->  dvips -> ps2pdf -> pdflatex), 
then I get the desired pdf file my-document-pics.pdf. Then running 
under pdflatex or xelatex just inserts the pdfs.

Again, obviously, I really don't know what I'm doing here, but it seems 
to be a usable albeit crude solution.

Again, thanks for all the very kind and constructive suggestions to my 
intemperate remarks,

Best,

Roger

********************************

Roger Hart
Assistant Professor, Departments of History and Asian Studies
University of Texas at Austin

office: Room 405, Garrison Hall
office phone: 512-475-7258
department fax: 512-475-7222
email: rhart at mail.utexas.edu
http://uts.cc.utexas.edu/~rhart

*********************************



More information about the XeTeX mailing list