I have a quite simple problem that I am unable to resolve.

I use pdfLaTeX from latest MikTeX together with WinEdt. I need to use psfrag for my EPS figures and therefore, I apply the pstool package. This worked fine until summer.

Now I opened a document working at that time, but the same document and toolchain fails: The extended LaTeX run initiated by pstool fails and an empty PDF is created from the EPS.

A minimum example:


\title{psfrag in pdflatex }


\caption{The EPS image with psfragfig}


Interestingly, removing hyperref and bookmarks resolves the issue and creates the correct PDF!!! Thus, I assume my LaTeX configuration is basically doing the right job. Maybe a package is broken? Would someone please test my minimum example and report?

This is the result of the run. Note, there is a warning that no Pulley_movable.tex was found including psfrag commands, but I left them out to avoid any issue there. Providing the file does not help:

Startup Folder: C:\Users\xxxx\Documents\Papers\pstool-problem

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.11 Portable)
entering extended mode
LaTeX2e <2020-10-01> patch level 2
L3 programming layer <2020-10-27> xparse <2020-03-03>
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
) (C:\ProgramData\Npackd\MiKTeX\texmfs\install\tex/latex/l3kernel\expl3.sty
No file test.aux.
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
[Loading MPS to PDF converter (version 2006.09.02).]
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.11 Portable)
entering extended mode
LaTeX2e <2020-10-01> patch level 2
L3 programming layer <2020-10-27> xparse <2020-03-03>
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
No file test.oldaux.
No file Pulley_movable-pstool.aux.
*geometry* driver: auto-detecting
*geometry* detected driver: dvips

Package hyperref Warning: Rerun to get /PageLabels entry.

Preview: Fontsize 12pt
Preview: Tightpage -32891 -32891 32891 32891
[1] [2] (Pulley_movable-pstool.aux)

LaTeX Warning: Temporary extra page added at the end. Rerun to get it removed.

Output written on C:\Users\xxxx\Documents\Papers\pstool-problem\Pulley_movab
le-pstool.dvi (2 pages, 4272 bytes).
Transcript written on C:\Users\xxxx\Documents\Papers\pstool-problem\Pulley_m

Package pstool Warning: No file "Pulley_movable.tex" or "Pulley_movable-psfrag.
tex" can be found that may contain macros for "Pulley_movable.eps" on input lin
e 17.

This is dvips(k) 2020.1 Copyright 2020 Radical Eye Software (www.radicaleye.com)
' TeX output 2020.11.11:1110' -> Pulley_movable-pstool.ps
[1<./Pulley_movable.eps>] [2<./Pulley_movable-pstool.out.ps>] 
Error: /typecheck in --div--
Operand stack:
   1   0   0.0   -0.907531   a   65781.8
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   2015   1   3   %oparray_pop   2014   1   3   %oparray_pop   1998   1   3   %oparray_pop   1884   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   --nostringval--   4   --nostringval--   %repeat_continue   --nostringval--
Dictionary stack:
   --dict:974/1684(ro)(G)--   --dict:0/20(G)--   --dict:113/200(L)--   --dict:178/300(L)--
Current allocation mode is local
Current file position is 89152
MiKTeX GPL Ghostscript 9.25: Unrecoverable error, exit code 1

Overfull \hbox (113.53291pt too wide) in paragraph at lines 17--17

LaTeX Warning: Float too large for page by 140.75291pt on input line 18.

LaTeX Warning: `!h' float specifier changed to `!ht'.

Non-PDF special ignored!
<special> header=psfrag.pro
{C:/ProgramData/Npackd/MiKTeX/texmfs/data/pdftex/config/pdftex.map}] [2 <./Pull
ey_movable.pdf>] (test.aux
! Undefined control sequence.
l.20 \HyPL@Entry

I reinstalled MikTeX but without any effect. Any help is greatly appreciated - thanks!

  • Welcome to TeX.SX! This really seems to be a MiKTeX issue. With TeXlive 2020 on Linux it works.
    – gernot
    Nov 11, 2020 at 11:20
  • Thanks. Is there any MikTeX user who can confirm it crashes on any recent MikTeX installation? Note, I use windows.
    – Tobias
    Nov 11, 2020 at 11:39
  • I will check a bit later Nov 11, 2020 at 11:52
  • It fails for me too, and I can't confirm that it works without hyperref/bookmark: then there is no error, but I don't get a picture either, at least not with a simple eps. Nov 11, 2020 at 13:44
  • Hopefully, problem lies in your .eps file, if I use the standard image ` \psfragfig[mode=errorstop,width=0.9\textwidth]{example-image-a}`, then it works fine for me....
    – MadyYuvi
    Nov 11, 2020 at 15:42

1 Answer 1


The main problem is an incompability between preview and hyperref due to changes in the shipout code of LaTeX that I already reported here: https://lists.gnu.org/archive/html/bug-auctex/2020-11/msg00000.html

Because of this incompability the ghostscript call fails and then you get error both in miktex and texlive (but slightly different ones).

In your example you can get around this incompability either by not using preview but pdfcrop instead:




Beside there is the error

! Undefined control sequence.
  l.20 \HyPL@Entry

The problem here is that the command is only defined in the dvips driver of hyperref. hyperref normally adds a \providecommand to the aux, but this is missing and when pstool uses the aux also with pdftex it errors.

A work-around is to simply provide the command (after loading hyperref or bookmark)

  • bug auctex? Are you sure?
    – Keks Dose
    Nov 14, 2020 at 16:22
  • @KeksDose yes, I looked into the preview documentation (and into preview.sty). Nov 14, 2020 at 16:23
  • @UlrikeFischer: This is strange: I am not an expert, but I simply installed TexLive portable and tried with the example. While MikTeX fails, TeXLive worked fine. Notably, I had no issues until summer. Is this maybe a bug that just appears for newer versions of some code. and TeXlive ist simply using the older code?
    – Tobias
    Nov 16, 2020 at 10:56
  • Sorry but comments are a very bad place to discuss this. pstool is a very tricky package and without complete test document including all files like graphics and log-files is it very hard to say something. You are not even mentioning which error message you actually get. On the whole I think that is it mostly a pstool issue. Nov 16, 2020 at 11:20
  • @UlrikeFischer: Thanks, I tested both workarounds, but the do not properly work. The second one, however, generated the correctly psfrag'ed PDF, but the final test. pdf contains an error message again: ´´´An error occured processing graphic: ‘./take_any_EPS.eps’ ´´´ So conversion works, but embedding fails...?!?
    – Tobias
    Nov 16, 2020 at 11:22

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.