Subject: Re: bug#44578: AW: bug#44578: Investigating current preview problem

From: Ikumi Keita <[email-masked]>
Date: Fri, 07 Jan 2022 19:33:08 +0900

Hi Tassilo and all,

I can reproduce on TeX Live what Hugo and Tobias say.

>>>>> Tassilo Horn <[email-masked]> writes:
>> The minimum example I use is
>> 
>> \documentclass[12pt,a4paper]{article}
>> \usepackage[margin=2cm,a4paper]{geometry}
>> \usepackage{hyperref}
>> \title{psfrag in pdflatex }
>> \usepackage{graphicx}
>> \usepackage{pstool}
>> \usepackage{bookmark}
>> \begin{document}
>> Test
>> \begin{figure}[h!]
>> \centering
>> \psfragfig[mode=errorstop,width=0.9\textwidth]{use_any_eps_file_here}
>> \caption{The EPS image with psfragfig}
>> \end{figure}
>> \end{document}

I replaced "use_any_eps_file_here" with "tiger" and saved the file under
the name "xyz.tex". And I created symbolic link of tiger.eps in the
current directory (in my case, /tmp/):
ln -s /usr/local/texlive/2021/texmf-dist/doc/generic/pstricks/images/tiger.eps .

And I issued pdflatex in my shell (not using AUCTeX):
pdflatex -shell-escape xyz.tex

Then I got ghostscript error during the automatic invocation of ps2pdf:
=== pstool: ps2pdf ===
Error: /typecheck in --div--
Operand stack:
   1   0   0.0   -0.770989   a   65781.8
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1974   1   3   %oparray_pop   1973   1   3   %oparray_pop   1961   1   3   %oparray_pop   1817   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   --nostringval--   4   --nostringval--   %repeat_continue   --nostringval--
...

See the attached test kit (not including the symlink of eps file).

> You are right.  With a test-example EPS which comes with TeXLive, it
> again compiles well for me:

>    \psfragfig[mode=errorstop,width=0.9\textwidth]{/usr/share/texmf-dist/tex/latex/mwe/example-image}

It seems that the usage of "example-image" is the source of trouble. In
that case, I find in the log that "example-image.tex" is read in, not
"example-image.eps".

> I have no clue about pstools, so I copied the image next to the tex file
> so that it can write the eps-image-name.tex file.  Then it complained
> about missing tikzpicture, 

That's because "example-image.tex" contains tikzpicture environment. So
I infer that "example-image" isn't suitable to specify as an argument to
\psfragfig.

I experienced similar error with Hugo's example as well if I used the
command pdflatex, not latex when typesetting.

Regards,
Ikumi Keita