I am writing a comprehensive scientific thesis. In December 2020, my toolchain stopped working, which combined pdfLaTeX, pstool to apply psfrag, and hyperref.

I reported the issue here pdfLaTeX fails on pstool when hyperref is included. Maybe it is related to here Is pstool incompatible with hyperref??

It turned out that this is a bug that cannot be easily solved, and I was informed that it is related to the packages pstool and preview, but not directly hyperref (see https://github.com/latex3/hyperref/issues/166). @ulrike-fischer proposed a workaround that really saved me in that moment - thanks again for the quick help for a newbie! The error, however, had been reported by her in advance (see https://lists.gnu.org/archive/html/bug-auctex/2020-11/msg00000.html).

Upon her advice, I created bug reports for pstool and preview:

  • I placed a bug report in the GitHub repository of pstool here https://github.com/wspr/pstool/issues/33. Unfortunately, there is no reaction and I am not sure whether the maintainer is willing to update the package. The last update has been in 2018, and I was not able to reach the maintainer by eMail to get a life sign.
  • I reported on the mailing list for preview bug reports, see history here https://www.mail-archive.com/bug-auctex@gnu.org/msg03845.html. I was informed that changes within the package hyperref are to blaim and that a bug fix is not likely to happen under these conditions, considering the effort. Furthermore, I was pointed to using a legacy LaTeX version which is indeed a solution for now, but not the future.

Please, let me know which toolchains you would use in that situation, using MikTeX under Windows 10 . Considering the responses above, I am not sure that my original toolchain will be fixed, and clearly, I am not in a position to push any voluntary maintainer! So I might use the workaround for some time, but I would welcome an approach that is likely working in the future as well.

Note, according to the pstool workflow, I included all psfrag commands in separate *.tex files named identical to their corresponding *.eps figures, which I would prefer to keep.

So far, I tried:

  • Changing the build chain to TeX -> DviPs -> PS -> PDF, but this does not allow me to use PNGs anymore. Encapsulating in EPS blowed up file size and is always extra work. Furthermore, hyperlinks in BibTeX have issues with line breaks.
  • Switching to epstopdf, but this did not allow me to include psfrag easily
  • Moving to auto-pst-pdf. It is sad but funny that this package is maintained by the maintainer of pstool who advises not to use it anymore and to switch to pstool if possible. Contrarily, he updated auto-pst-pdf in 2020, thus it is more recent than pstool.

The last option is my fallback at the moment, and even processes my *.tex files containing psfrag commands per image. It is missing the elegance of pstool for individual image processing and thus takes lots of extra compilation time. Plus, I am afraid that the package maintainer will consider this as a legacy package soon as announced.

I am looking forward to any advice or comment. In case you have a similar issue, this thread is also meant to provide an overview on my approaches so far... maybe it helps.

Thank you!

  • the claim on the auctex list that hyperref is to blame is wrong. The problem is in preview.sty. I sent the maintainer an example without hyperref as a proof some weeks ago. Mar 17 '21 at 13:42
  • beside this using pdfcrop instead of preview with \usepackage[crop=pdfcrop]{pstool} works for me. Mar 17 '21 at 14:11
  • ... that... is really awesome. It works for me as well. Thank you! - Is there any limitation of pdfcrop compared to preview in this approach, or should I generally be fine with this in the future as well?
    – Tobias
    Mar 17 '21 at 14:49
  • Just as a side note: This also affects package pst-pdf (github.com/rolfn/pst-pdf/issues/6) as well as pstricks-pdf which uses the former one
    – mrpiggi
    Mar 30 '21 at 22:47
  • The problem is that we cannot expect a fix for preview, except some new maintainer gets involved - or we collect enough money to pay the current ones. But I don't know the sum we would need to collect.
    – Tobias
    Apr 2 '21 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.