[pstricks] pstricks and xelatex

Herbert Voss Herbert.Voss at fu-berlin.de
Mon Sep 6 09:12:14 CEST 2021



Am 05.09.21 um 22:27 schrieb Norberto Moreno Quiben:
>
> Thank you for your answer, Herbert.
> I eliminated the line that gave you an error (for me it is working 
> fine) and the references to it in the example. The output of xelatex 
> gives the same mixture of text, line and labels but the 
> latex-to-ps2pdf works just fine. I should add that xelatex was giving 
> the correct output two months ago (I use xelatex as the default engine 
> in LaTeX-iT to generate pstricks graphics to embed them in presentations).
>
> \documentclass[10pt]{article}
> \usepackage[utf8]{inputenc} %useful to type directly diacritic characters
>

btw: This is the default for years and not needed for xelatex.

> \usepackage{pstricks,pst-jtree,pst-node}
> \listfiles
>
> \begin{document}
>
> \jtree[xunit=2.8em,yunit=1em]
> \def\Vi{V$\mskip-5mu _i$}
> ! = {ST}
>

I do not get any output with your example. However, try it yourself with 
the attached
file. Put it for a test into the same directory as the document.

Herbert






> :[scaleby=1.5]{SN$\mskip-5mu _k$}(<vartri>{The student}) [scaleby=1.5]{T'}
> :!b [scaleby=1.5]{SV}
> :{h$\mskip-5mu _k$}{V'}
> :{SAdv}(<vartri>{carefully}) [scaleby=1.5]{V'}
> : {$h_i$}@A2 [scaleby=1.5]{SN}
> : {D}({the}) {N'}(<vert>{N}({test})) .
> \psset{scaleby=.6 .6}
> !b = {T}
> :!c {Conc} .
> !c = {T}
> :{\Vi}({examined}@B2 ) {T} .
> \nccurve[angleB=-90,nodesepB=.5ex, 
> nodesepA=.5ex,angleA=-90,ncurv=1]{<-}{B2}{A2}
> \endjtree
>
> \end{document}
>
>

-------------- next part --------------
% $Id: xdvipdfmx.cfg 191 2021-09-05 20:07:31Z herbert $
%
%% BEGIN: pstricks.con (for dvipdfmx driver)
%%
%% Configuration file for PSTricks
%%
%% Version 0.07 (2021/09/05)
%%
%% For use with dvipdfmx
%% Created by SMiyata based on standard pstricks.con from TeXLive distribution.
%% This file may be distributed, used and modified freely.
%% Modified by Denis Girou, Herbert Voss
%%
\def\pstdriver{dvipdfmx}%
\def\pstverb#1{\special{pst: #1}}% Check catcode of "
\def\pstunit{1bp}%
\def\pstVerb#1{\immediate\special{PST: #1}}%
\def\pstverbscale{72.27 72 div dup scale }%
\def\pstnodescale{72 72.27 div dup scale }%
% DG/SR modification begin  - Apr. 28, 1997 (D. Carlisle + S. Rahtz)
% \def\pstheader#1{\special{header=#1}}
% We used to check for |\AtBeginDvi|, but that was broken in early release
% so we now check for the existence of |\textsuperscript| (added 1995/05/16)
\ifx\textsuperscript\@undefined
   \def\pstheader#1{\special{header=#1}}%
\else
  \ifx\Gin at PS@file at header\@undefined
    \def\pstheader#1{\AtBeginDvi{\special{header=#1}}}%
  \else
    \let\pstheader\Gin at PS@file at header%
  \fi
\fi
% DG/SR modification end 
%
%%
%%
%% In the following, CP is short for currentpoint.
%% The neg is necessary because dvips scales the coordinates by 1 -1.
%% \tx at NET means neg exch neg exch translate.
\def\pstrotate{CP CP translate 3 -1 roll neg rotate \tx at NET}%
%%
%% ****************** END dvipdfmx *****************************


%%%%%%%%%%%%%%%%%%% !! CUSTOMIZATION STUFF GOES HERE: !! %%%%%%%%%%%%%%%%%%
%% If you want to include your own customizations to pstricks.tex, then
%% uncomment the \pstcustomize command, and include your modifications
%% after \pstcustomize. These will be read in after pstricks.tex.
\def\c at lor@to at ps#1 #2\@@{\csname c at lor@ps@#1\endcsname#2 \@@}%
\def\c at lor@ps@#1 #2\@@{TeXDict begin #1 end}%
\def\c at lor@ps at rgb#1\@@{#1 setrgbcolor}%
\def\c at lor@ps at hsb#1\@@{#1 sethsbcolor}%
\def\c at lor@ps at cmyk#1\@@{#1 setcmykcolor}%
\def\c at lor@ps at gray#1\@@{#1 setgray}%
\pstcustomize
\typeout{Using PSTricks configuration for LaTeX+dvipdfmx}%
\def\@@scalebox{%
  \leavevmode
  \hbox{%
\ifdim\pst at tempd\p@<\z@
\pst at dimg=\pst at tempd\ht\pst at hbox
\pst at dimh=\pst at tempd\dp\pst at hbox
\dp\pst at hbox=-\pst at dimg
\ht\pst at hbox=-\pst at dimh
\else
\ht\pst at hbox=\pst at tempd\ht\pst at hbox
\dp\pst at hbox=\pst at tempd\dp\pst at hbox
\fi
\pst at dima=\pst at tempc\wd\pst at hbox
\ifdim\pst at dima<\z@\kern-\pst at dima\fi
\special{x: bscale \pst at tempc \pst at tempd}%
\hbox to \z@{\box\pst at hbox\hss}%
\special{x: escale}%
\ifdim\pst at dima>\z@\kern\pst at dima\fi}}%
%
\let\ps@@scalebox\@@scalebox
\def\ps at rotateleft#1{%
\leavevmode\hbox{\hskip\ht#1\hskip\dp#1\vbox{\vskip\wd#1%
\pst at Verb{90 \tx at RotBegin}%
\vbox to \z@{\vss\hbox to \z@{\box#1\hss}\vskip\z@}%
\pst at Verb{\tx at RotEnd}}}}%
%
\def\ps at rotateright#1{%
  \leavevmode\hbox{%
  \hskip\ht#1\hskip\dp#1\vbox{\vskip\wd#1%
  \pst at Verb{-90 \tx at RotBegin}%
  \vbox to \z@{\hbox to \z@{\hss\box#1}\vss}%
  \pst at Verb{\tx at RotEnd}}}}%
%
\def\ps at rotatedown#1{%
\hbox{\hskip\wd#1\vbox{\vskip\ht#1\vskip\dp#1%
\pst at Verb{180 \tx at RotBegin}%
\vbox to \z@{\hbox to \z@{\box#1\hss}\vss}%
\pst at Verb{\tx at RotEnd}}}}%
%
\def\begin at psclip{\special{x: gsave}}%
\def\end at psclip{\special{x: grestore}}%
\def\@newcolor#1#2#3{%
\expandafter\edef\csname #1\endcsname{\noexpand\pst at color{#2}}%
\expandafter\edef\csname\string\color@#1\endcsname{#2}%    hv 1.14 2005-12-17
\expandafter\edef\csname\string\color at xetex@#1\endcsname{#3}%
\ignorespaces}%
%
\def\newgray#1#2{%
  \pst at checknum{#2}\pst at tempg
  \@newcolor{#1}{\pst at tempg setgray}{gray \pst at tempg}%
}
\def\newrgbcolor#1#2{%
  \pst at expandafter\pst at getnumiii{#2} {} {} {} {}\@nil
  \@newcolor{#1}{\pst at tempg \pst at temph \pst at tempi setrgbcolor}{rgb \pst at tempg \pst at temph \pst at tempi}%
}%
\def\newhsbcolor#1#2{%
  \pst at expandafter\pst at getnumiii{#2} {} {} {} {}\@nil
  \@newcolor{#1}{\pst at tempg \pst at temph \pst at tempi sethsbcolor}{hsb \pst at tempg \pst at temph \pst at tempi}%
}%
\def\newcmykcolor#1#2{%
  \pst at expandafter\pst at getnumiv{#2} {} {} {} {} {}\@nil
  \@newcolor{#1}{\pst at tempg \pst at temph \pst at tempi \pst at tempj setcmykcolor}%
                {cmyk \pst at tempg \pst at temph \pst at tempi \pst at tempj}%
}%
\newgray{black}{0}%
\newgray{darkgray}{.25}%
\newgray{gray}{.5}%
\newgray{lightgray}{.75}%
\newgray{white}{1}%
\newrgbcolor{red}{1 0 0}%
\newrgbcolor{green}{0 1 0}%
\newrgbcolor{blue}{0 0 1}%
\newrgbcolor{yellow}{1 1 0}%
\newrgbcolor{cyan}{0 1 1}%
\newrgbcolor{magenta}{1 0 1}%

\@ifundefined{LaTeXe}%
  {\def\current@@@@color{\csname\string\color at xetex@\psfillcolor\endcsname}}{%
  \AtBeginDocument{\@ifpackageloaded{xcolor}{\def\current@@@@color{\psfillcolor}}%
    {\def\current@@@@color{\csname\string\color@\psfillcolor\endcsname}}}}%
%
\iffalse
\def\pst at starbox{%
\setbox\pst at hbox\hbox{{%
  \def\current at color{\current@@@@color}%
\dimen@\wd\pst at hbox\advance\dimen at 2\psframesep\wd\pst at hbox\dimen@%
\dimen@\ht\pst at hbox\advance\dimen@\psframesep\ht\pst at hbox\dimen@%
\dimen@\dp\pst at hbox\advance\dimen@\psframesep\dp\pst at hbox\dimen@%
\@ifundefined{LaTeXe}{\special{color push \current at color}%
    \rlap{\vrule width\wd\pst at hbox height\ht\pst at hbox depth\dp\pst at hbox}%
    \special{color pop}}%
  {\color at block{\wd\pst at hbox}{\ht\pst at hbox}{\dp\pst at hbox}}}%
\rlap{\hskip\psframesep\unhbox\pst at hbox}}}
\fi
%
\def\AltClipMode{}%
%
\def\putoverlaybox#1{%
\hbox{\special{x: gsave}\special{x: initoverlay #1}\copy\theoverlaybox\special{x: grestore}}}%
%
\def\pst at overlay#1{\edef\curr at overlay{#1}\special{x: clipoverlay #1}\aftergroup\pst at endoverlay}%
\def\pst at endoverlay{\special{x: clipoverlay \curr at overlay}}%
\def\AltOverlayMode{}%
%The next line is not necessary, if pstricks.sty of [2007/02/18 v0.33] or newer is used.
\@ifundefined{LaTeXe}{}{\AtBeginDocument{\psset{fillcolor=white}}}%
%
\endinput
%
%
%%%%%%%%%%%%%%%% DESCRIPTION OF CONFIGURATION DEFINITIONS %%%%%%%%%%%%%%%

Here are the commands that must be defined in this file:

   \pstverb{}    -  The argument is included as verbatim PostScript,
                    grouped by save and restore. The coordinate system
		    should be square, not rotated, and with the origin
		    at TeX's currentpoint.

   \pstVerb{}    -  The argument is included as verbatim PostScript, not
                    grouped by (g)save and (g)restore. The currentpoint
		    should be TeX's currentpoint.

   \pstunit      -  The units used by driver for graphics included with
                    \pstverb. Probably 1bp or 1sp.

   \pstverbscale - The PostScript code that scales the coordinate system
                   from that in effect with \pstVerb to that in effect
                   with \pstverb. Should not translate to the currentpoint.

   \pstrotate    - The PostScript code that takes a number off the stack
                   and rotates the axes properly. I.e.,
                   \pstVerb{angle \pstrotate} is used to begin rotations.

   \pstheader{}  - The argument is a header file (e.g., .pro file).
                   If your driver does not support such a special, then
                   the command might just remind you to include the header
                   when printing. You can use PSTricks without a header,
                   in which case it does not matter how you define
                   \pstheader. See read-me.pst for details.
                   If you cannot change the default directory where your
                   driver looks for header files, and you cannot write to
                   that directory, then you include the path for your
                   PSTricks header files.
                   E.g., \def\pstheader#1{\special{header=~/tex/#1}}.

   \pstdriver    - The name of the driver.


%%%%%%%%% !! HOW TO MAKE A TEX FORMAT WITH PSTRICKS PRELOADED !! %%%%%%%%

See your local TeX documentation for instructions on creating a TeX format.

Before making the format, be sure that this configuration file is correct.
It will be read only when creating the format, and not with every job.

If you are not using header files, there are no more special instructions.

Special instructions when using header files:

 - If you want to include supplementary PSTricks files (e.g., pst-node.tex),
   add \input commands in the customization section above.

 - If your definition of \pstheader is, e.g.

     \def\pstheader#1{\special{\header=#1}}

   then change it to

     \def\pstheader#1{%
       \expandafter\everyjob\expandafter{\the\everyjob
         \special{header=#1}}}

   and put your original definition in the customization section, AFTER
   any \input commands. E.g., the customization section might look like:

     \pstcustomize
     \input pst-node.tex
     \input pst-coil.tex
     \def\pstheader#1{\special{header=#1}}

 - Input pstricks.tex at the appropriate time when creating the format.
   E.g., when initex stops running:
     *\input pstricks
     *\dump


%%
%% END: pstricks.con


More information about the PSTricks mailing list.