As I'm obviously ignorant with regard to some well-intended advices, I ran into a compilation error after updating my MiKTeX distribution after two or three months. I was able to track the error down to the following MNWE:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{auto-pst-pdf}
\usepackage{pdfpages}
\begin{document}
\includepdf{example-image-a.pdf}
\begin{figure}
\includegraphics{example-image-b.eps}
\end{figure}
\end{document}
Compiling using pdflatex --shell-escape mwe.tex will show compilation errors during the auto-pst-pdf stage. mwe-autopp.log reads somewhat like:
[...]
File: example-image-b.eps Graphic file (type eps)
<example-image-b.eps>
Preview: Tightpage -39321600 -39321600 39321600 39321600
! You can't use `\prevdepth' in horizontal mode.
\nointerlineskip ->\prevdepth
-\@m \p@
l.13 \includegraphics{example-image-b.eps}
Sorry, but I'm not programmed to handle this case;
I'll just pretend that you didn't ask for it.
If you're in the wrong mode, you might be able to
return to the right one by typing I}' orI$' or `I\par'.
! Missing $ inserted.
<inserted text>
$
l.13 \includegraphics{example-image-b.eps}
[...]
Compilation will run fine when either the \includepdf line or the figure environment are commented out, respectively. Could you please advice me on how to fix this one...? Thanks a lot!
/edit In response to comments by @Marijn and @Ulrike Fischer:
You are right, my MNWE was not chosen very cleverly! As a matter of fact, I also need the chemnum package in my real-world example to replace strings within the eps file. This method does need the auto-pst-pdf package and the --shell-escape option for pdflatex as far as I know. Let me slightly expand the example from above:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{auto-pst-pdf}
\usepackage{pdfpages}
\usepackage{chemnum}
\begin{document}
\includepdf{example-image-a.pdf}
\begin{figure}
\replacecmpd[tag=benzene]{benzene}
\includegraphics{benzene.eps}
\end{figure}
\end{document}
I've put the contents of benzene.eps to Pastebin: click.
\usepackage{auto-pst-pdf}, the conversion of eps to pdf is automatic (shell-escapeis also not needed). – Marijn Dec 01 '20 at 20:46example-image-b.epsbecause that is located in a system folder where a converted pdf cannot be written, but it should work with a normal eps located in the folder of your .tex document) – Marijn Dec 01 '20 at 20:48auto-pst-pdfand--shell-escapeas my real world example also requires thechemnumpackage. I've updated the initial question to better reflect this situation. I also made sure that MiKTeX is up-to-date both within user and administrator mode. – tstone-1 Dec 01 '20 at 21:06benzene.eps. I ran into the same error as described before... Maybe this is related to a package other thanchemnum,auto-pst-pdfandpdfpages? – tstone-1 Dec 02 '20 at 07:33