# auto-pst-pdf and hyperref conflict

This code don't work on texlive-2021 or on Miktex (MiKTeX 21.8), with pdflatex : the auxilliary complation fail.

\documentclass{article}
\usepackage{pstricks}
%\usepackage[cleanup={},pspdf={-dALLOWPSTRANSPARENCY -dNOSAFER}]{auto-pst-pdf}%
\usepackage{auto-pst-pdf}
\usepackage{hyperref}
\begin{document}

Some text
\begin{pspicture}(0,0)(5,5)
\psline(0,0)(5,5)
\end{pspicture}
Other text

\end{document}


• Sep 19, 2021 at 10:12

Just to explicit the answer that can be found following Ulrike Fischer's comment, adding the following in the preamble should work (also I think -dALLOWPSTRANSPARENCY is currently needed in the ps2pdf step, do not comment it out).

\makeatletter
\AtBeginDocument{
\ifpdf\else

However, it might not behave well in future versions, and is not enough to make [auto-]pst-pdf work with beamer.