[XeTeX] XeTeX and postscript output

Herbert Schulz herbs at wideopenwest.com
Tue Feb 24 14:27:14 CET 2009


On Feb 24, 2009, at 5:35 AM, وفا خلیقی wrote:

> Hi Ross, *Alan Munn, **Kirk Lowery  and others*
>
> you can use pdftricks directly in xetex.
>
>
> As far as I have tested pdftricks works in xetex but there is an  
> isuue which
> I will talk about in a minute:
>
> say we only want to draw a line by pstricks, then you can have
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \documentclass{article}
> \usepackage{pdftricks}
> \begin{psinputs}
> \usepackage{pstricks}
> \end{psinputs}
> \begin{document}
> \begin{pdfdisplay}
> \TeXtoEPS
> \begin{pspicture}(0,0)(2,2)
> \psline(1,1)(2,2)
> \end{pspicture}
> \endTeXtoEPS
> \end{pdfdisplay}
> \end{document}
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> then if we assume the name of the file is "test.tex", you will need  
> to run
> "xelatex -shell-escape test" in a terminal/command line.
> then on the run xetex stops, produces the images in ps, then  
> converts them
> to pdf and the run continues and eventually include them in the  
> final pdf.
>
> But what happens if you actually have a text in pstricks environment  
> which
> you want to be typeset in a particular font? will you see the text  
> in the
> font you specified, or you get CMR fonts? the answer is you will get  
> CMR
> font, for example try this:
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \documentclass{article}
> \usepackage{fontspec}
> \setmainfont[Scale=1,Mapping=tex-text]{Junicode}
> \usepackage{pdftricks}
> \begin{psinputs}
> \usepackage{pstricks}
> \end{psinputs}
> \begin{document}
> \begin{pdfdisplay}
> \TeXtoEPS
> \begin{pspicture}(0,0)(2,2)
> \psline(1,1)(2,2)
> \uput[0](0,0){I want this to be typeset in \emph{Junicode} font.}
> \end{pspicture}
> \endTeXtoEPS
> \end{pdfdisplay}
> \end{document}
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> But when you run "xelatex -shell-escape test", you see that in your  
> output,
> the sentense "I want this to be typeset in \emph{Junicode} font." is  
> typeset
> in CMR and not in Junicode.
>
> But if you do not care about this, then you should be fine.
>
>
> Hope this helps
>
> -- 
> VK

Howdy,

That's most likely because the pdftricks package creates figure  
file(s) which it then processes (in the background---hence the need  
for shell escape) using latex rather than xelatex.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)





More information about the XeTeX mailing list