1

Consider the following (non-minimal) example test.tex:

\documentclass{article}

\usepackage{xfp}
\usepackage{multido}
\usepackage{pst-slpe}

% Atommodel.
\psset{dimen = m}
\newcommand*\bane[1]{%
  \rput{#1}(3.15,3.55){%
    \psellipse[
      linestyle = dashed,
      linewidth = \pslinewidth
    ](0,0)(3.55,1.05)}}
\def\elektron(#1,#2){%
  \rput(#1,#2){\psBall{white}{0.7ex}}
  \rput(#1,#2){\psBall{green!70!black}{0.5ex}}
  \rput(#1,#2){\tiny$-$}}
\def\proton#1#2{%
  \rput(\fpeval{3.15+#1*cosd(#2)},\fpeval{3.55+#1*sind(#2)}){\psBall{red}{2ex}}
  \rput(\fpeval{3.15+#1*cosd(#2)},\fpeval{3.55+#1*sind(#2)}){$+$}}
\def\neutron#1#2{%
  \rput(\fpeval{3.15+#1*cosd(#2)},\fpeval{3.55+#1*sind(#2)}){\psBall{blue}{2ex}}}

\begin{document}

\begin{figure}[htbp]
  \begin{pspicture}(6.3,7.1)
   % Elektronbaner.
   \bane{30}
   \elektron(5.07,5.48)
   \bane{90}
   \elektron(3.94,1.24)
   \bane{150}
   \elektron(0.75,4)
   % Kerne.
   \multido{\iA = 30+120, \iB = 90+120}{3}{%
     \neutron{0.5}{\iA}
     \proton{0.5}{\iB}}
   \neutron{0}{0}
   % Betegnelser.
  {\psset{linecolor = orange}
   \pscircle[
     linewidth = 1.5\pslinewidth
   ](3.15,3.55){0.95}
   \rput(1.3,6.5){%
     \shortstack[c]{%
       Atomkerne/\strut\\[-0.75ex]
       nukleon\strut}}
   \psline{->}(1.3,6)(2.5,4.2)}
   \rput(0.9,0.6){Elektron}
   \psline[linecolor = green!70!black]{->}(1.8,0.6)(3.8,1.2)
   \rput(5.5,0.6){Proton}
   \psline[linecolor = red]{->}(5.5,0.85)(3.65,3.25)
   \rput(5.5,6.5){Neutron}
   \psline[linecolor = blue]{->}(5.5,6.25)(3.6,3.8)
  \end{pspicture}
\end{figure}

\end{document}

When I compile it using latex test.tex --> dvips test.tex --> p2pdf -dALLOWPSTRANSPARENCY test.ps everything is fine. However, when I compile it using xelatex test.tex the drawing is "destroyed".

I need to use xelatex or something similar which can be used with the pdfpages package. How do I get around this?

Update

With Ulrike's help, it's now working for me.

9

1 Answer 1

3

Update 2021-09-12

The bug has been resolved in 2021/09/10 v3.08 `PSTricks'.


PSTricks with XeLaTeX is currently broken, but the maintainer knows it already.

As an alternative you can try LuaLaTeX with the experimental luapstricks from https://github.com/zauguin/luapstricks. You example works fine for me with it.

4
  • Can put as a note that this works on a local TeX installation and NOT on overleaf? Commented Sep 8, 2021 at 9:06
  • 2
    @SvendTveskæg please don't misuse such a question for personal support by updating at every new problem. Ask a new question if you have new problem. Commented Sep 12, 2021 at 13:44
  • 1
    it works fine for me, check if you have the newest luapstricks version. Commented Sep 12, 2021 at 14:13
  • The above example still does NOT work on just updated my MikTeX installation and the XeTeX engine. It seems like \rput(x,y){z} ignores x,y. My pstricks version is 2022/01/09 v3.13 `PSTricks' (tvz,hv). With the LuaTeX engine it works fine, however. Commented Aug 10, 2022 at 10:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .