# My legacy PSTricks code is not compilable anymore

The following code worked several years ago but it does not now. I lost my conscious and I might be in a generation gap. I attempted to compile with either lualatex or latex->dvips->ps2pdf sequence but it ends with errors.

\documentclass{beamer}
\usepackage{pstricks}

\usepackage[active,tightpage]{preview}
\PreviewEnvironment{pspicture}
\PreviewBorder=1cm\relax

\usepackage{graphicx}

\def\RightPart
{
\only<+->{\psline(0.5,2.7)(!6.5 3.5 82 eP2C)}
\only<+->{\psbezier(1.2,1.3)(1.3,1.0)(2.0,1.0)}
\only<+->{\psbezier(3.0,1.0)(3.0,2.2)(!6.5 3.5 73 eP2C)}
\only<+->{\psellipticarcn(6.5,3.5){(!6.5 3.5 73 eP2C)}{(!6.5 3.5 73 neg eP2C)}}
\only<+->{\psbezier(4,-2)(4,0)(2.2,-1.8)}
\only<+->{\psbezier(1.5,-1)(1,-1)(!6.5 3.5 -90 eP2C)}
}

\def\LeftPart
{
\only<+->{\psbezier(1,-1)(1.5,-1)(2.2,-1.8)}
\only<+->{\psbezier(4,0)(4,-2)(!6.5 3.5 73 neg eP2C)}
\only<+->{\psellipticarc(6.5,3.5){(!6.5 3.5 73 neg eP2C)}}{(!6.5 3.5 73 eP2C)}
\only<+->{\psbezier(3.0,2.2)(3.0,1.0)(2.0,1.0)}
\only<+->{\psbezier(1.3,1.0)(1.2,1.3)(!6.5 3.5 82 eP2C)}
\only<+->{\psline(0.5,2.7)}
\only<+->{\closepath}
}

\begin{document}
\begin{frame}{Test}
\begin{pspicture}[showgrid=false](-7,-4)(7,4)
\pstVerb{/eP2C {PtoCab} def}%
%\psclip{%
\pscustom[dimen=m,linewidth=4\pslinewidth]
{
\only<+->{\RightPart}
\code{-1 1 scale}
\LeftPart
\only<+->{\fill[fillcolor=yellow,fillstyle=solid]}
}%}
\only<+->{\rput(0,0){\parbox{12cm}{\centering \bf\fontsize{15pt}{15pt}\selectfont Entity Framework Core  \\ Happy Coding}}}
%\only<+->{\rput(-2.5,-.75){\includegraphics[scale=2.2]{parents}}}%
%\endpsclip
\end{pspicture}
\end{frame}
\end{document}

• The errors when compiled with latex-dvips-ps2pdf:

• The errors when compiled with lualatex:

Note: For the sake of my convenience, the errors are intentionally sent as images.

• +1: It may be useful to also post the error message. Jun 24 at 14:49
• I only had a few warnings (overfullhbox), compiling with xelatex --shell-escape. Jun 24 at 15:10
• @Bernard: Yes. It is compilable with xelatex. Jun 24 at 15:15
• the problem is preview. It has not been adapted to the new shipout code of LaTeX and now choke over code in the shipout hooks. If I remove preview it compiles in texlive 2022 both with lualatex and with latex-dvips-ps2pdf. Jun 24 at 16:15

preview has not been adapted to the current LaTeX and chokes over some hooks. You can try to empty the hooks. For lualatex you should also load the pro-file in the picture:

\documentclass{beamer}
\usepackage{pstricks}

\usepackage[active,tightpage]{preview}
\PreviewEnvironment{pspicture}
\PreviewBorder=1cm\relax

\RemoveFromHook{shipout/firstpage}[hyperref]
\RemoveFromHook{shipout/before}[hyperref]

\usepackage{graphicx}

\def\RightPart
{
\only<+->{\psline(0.5,2.7)(!6.5 3.5 82 eP2C)}
\only<+->{\psbezier(1.2,1.3)(1.3,1.0)(2.0,1.0)}
\only<+->{\psbezier(3.0,1.0)(3.0,2.2)(!6.5 3.5 73 eP2C)}
\only<+->{\psellipticarcn(6.5,3.5){(!6.5 3.5 73 eP2C)}{(!6.5 3.5 73 neg eP2C)}}
\only<+->{\psbezier(4,-2)(4,0)(2.2,-1.8)}
\only<+->{\psbezier(1.5,-1)(1,-1)(!6.5 3.5 -90 eP2C)}
}

\def\LeftPart
{
\only<+->{\psbezier(1,-1)(1.5,-1)(2.2,-1.8)}
\only<+->{\psbezier(4,0)(4,-2)(!6.5 3.5 73 neg eP2C)}
\only<+->{\psellipticarc(6.5,3.5){(!6.5 3.5 73 neg eP2C)}}{(!6.5 3.5 73 eP2C)}
\only<+->{\psbezier(3.0,2.2)(3.0,1.0)(2.0,1.0)}
\only<+->{\psbezier(1.3,1.0)(1.2,1.3)(!6.5 3.5 82 eP2C)}
\only<+->{\psline(0.5,2.7)}
\only<+->{\closepath}
}

\begin{document}
\begin{frame}{Test}
\begin{pspicture}[showgrid=false](-7,-4)(7,4)
\pstheader{pstricks.pro} % for luatex
\pstVerb{/eP2C {PtoCab} def}%
%\psclip{%
\pscustom[dimen=m,linewidth=4\pslinewidth]
{
\only<+->{\RightPart}
\code{-1 1 scale}
\LeftPart
\only<+->{\fill[fillcolor=yellow,fillstyle=solid]}
}%}
\only<+->{\rput(0,0){\parbox{12cm}{\centering \bf\fontsize{15pt}{15pt}\selectfont Entity Framework Core  \\ Happy Coding}}}
%\only<+->{\rput(-2.5,-.75){\includegraphics[scale=2.2]{parents}}}%
%\endpsclip
\end{pspicture}
\end{frame}
\end{document}