2

Code

Consider the following example:

\documentclass{article}

\usepackage{multido} \usepackage{pstricks}

\begin{document}

\begin{figure} % https://tex.stackexchange.com/questions/114278/isometric-paper-and-drawing-on-it-with-pstricks \centering \psset{ linejoin = 2 } \SpecialCoor \begin{pspicture}(-0.5,-2)(10,8.5) \pstVerb{gsave [\fpeval{sqrt(3)/2} 0.5 0 1 0 -400] concat} {\psset{ linewidth = 0.3pt, linecolor = black!50 } \multido {\i = 0+1} {25} {\psline(\i,-4)(\i,20) \psline(!-5 \i\space 10 sub)(!20 \i\space 10 sub) \rput(!0 \i\space 15 sub){\psline(0,0)(!\i\space abs dup add dup)}} } {\psset{ linewidth = 2pt } \pspolygon(8,2)(8,6)(11,9)(11,5) \pspolygon(1,2)(1,6)(8,6)(8,2) \pspolygon(1,6)(2.5,9.5)(9.5,9.5)(8,6) \psline(11,9)(9.5,9.5) {\psset{ linestyle = dashed } \pspolygon(4,5)(4,9)(11,9)(11,5) \pspolygon(1,6)(4,9)(4,5)(1,2) \psline(4,9)(2.5,9.5) \pstVerb{grestore} } } \end{pspicture} \end{figure}

\end{document}

Output

When I compile using lualatex I get the following wrong output:

wrong

However, when I compile using latex --> dvips --> ps2pdf -dALLOWPSTRANSPARENCY I get the following correct output:

correct

Question

How can I compile using lualatex and get the correct output?

  • 1
    Did you get this error in your log? Extended graphic state modifications dropped since pdfmanagement-testphase is not loaded. – Thruston Nov 12 '22 at 09:26
  • @Thruston Yes, I did. I've added the log file. (If I add \RequirePackage{pdfmanagement-testphase} before \documentclass, I get the following warnings and error: `Package pdfmanagement Warning: The PDF resources management is not active (pdfmanagement) command '\pdfmanagement_add:nnn ' ignored.

    Package pdfmanagement Warning: The PDF resources management is not active (pdfmanagement) command '\pdfmanagement_add:nnn ' ignored.

    ! Undefined control sequence. __pdf_backend_metadata_stream:n

    l.49 \end{document}`.)

    – Svend Tveskæg Nov 12 '22 at 09:48
  • @Thruston: That is a simple message and not an error! – user187802 Nov 12 '22 at 10:36
  • 1
    @SvendTveskæg: You also need the line \DeclareDocumentMetadata{}. However, it is not important for your problem! PostScript and luapstricks have different coordinate systems for y. We'll investigate ... – user187802 Nov 12 '22 at 10:38
  • 1
    @user187802 in a current LaTeX you should use \DocumentMetadata{}. And loading the pdfmanagement-testphase package first is no longer needed. – Ulrike Fischer Nov 12 '22 at 11:27
  • @UlrikeFischer: Sure, but Svend uses already the \RequirePackage{pdfmanagement-testphase} – user187802 Nov 12 '22 at 13:01
  • 1
    @user187802 even then \DocumentMetadata{} is the right command in a current LaTeX. The other command is deprecated and will disappear at some time, so should only be mentioned if people explictly mention that they use an older tex systems. – Ulrike Fischer Nov 12 '22 at 13:17
  • @SvendTveskæg you are flooding the home page with edits – David Carlisle Mar 15 '24 at 14:53
  • @DavidCarlisle Sorry. It was just to edit the words in the header to make them start with capital letter. I'll stop immediately. – Svend Tveskæg Mar 15 '24 at 15:04

1 Answers1

5

Until we find a better (automatic) solution use it this way:

\DocumentMetadata{}
\documentclass{article}
\usepackage{multido}
\usepackage{pstricks}

\begin{document}

\begin{pspicture}showgrid(10,12) \ifPSTlualatex \pstVerb{ gsave [60 sin -0.5 0 1 0 100] concat }% \else \pstVerb{ gsave [60 sin 0.5 0 1 0 -400] concat }% \fi {\psset{linewidth = 0.3pt,linecolor = black!50}% \multido{\i = 0+1}{25}{% \psline(\i,-4)(\i,20) \psline(!-5 \i\space 10 sub)(!20 \i\space 10 sub) \rput(!0 \i\space 15 sub){\psline(0,0)(!\i\space abs dup add dup)}} }% \psset{linewidth = 2pt} \pspolygon(8,2)(8,6)(11,9)(11,5) \pspolygon(1,2)(1,6)(8,6)(8,2) \pspolygon(1,6)(2.5,9.5)(9.5,9.5)(8,6) \psline(11,9)(9.5,9.5) \psset{linestyle = dashed} \pspolygon(4,5)(4,9)(11,9)(11,5) \pspolygon(1,6)(4,9)(4,5)(1,2) \psline(4,9)(2.5,9.5) \psdotdotscale=3 \pspolygonlinecolor=red(10,10)(10,0)(0,10)(0,0) \pstVerb{grestore} \end{pspicture}

\end{document}

enter image description here

user187802
  • 16,850