Discussion:
[AUCTeX] eps graphics empty with dvipdfmx
Jan Menzel
2017-08-22 19:24:13 UTC
Permalink
Hi all!
After our IT department recently upgraded my system to Ubuntu 16.04 LTS
graphics preview stopped working. In order to get the new latex version
to compile my thesis I had to change "dvipdfm" to "dvipdfmx" in
\documentcalss. Now previews in general work well again, captions are
also correct, but my figures (all .eps) are just empty boxes. However,
the size of the boxes correspond to their bounding boxes. (I've checked
the .pngs that are generated for the preview as well.)
The minimum example that replicates my problem is as follows:

\documentclass[dvipdfmx]{book}
\usepackage{graphicx}
\begin{document}
\begin{figure}[t]
\centering
\includegraphics[]{test.eps}
\caption[]{Caption}
\end{figure}
\end{document}

Ubuntu 16.04 LTS comes with auctex 11.88-1.1ubuntu1, ghostscript
9.18~dfsg~0-0ubuntu2.6, Emacs 24.5.1 and pdfTex 3.14159265-2.6-1.40.16.
Has anyone any idea how to get graphics preview back?

Best regards
Jan
Ikumi Keita
2017-08-23 09:48:25 UTC
Permalink
Hi Jan,
Post by Jan Menzel
Hi all!
After our IT department recently upgraded my system to Ubuntu 16.04 LTS
graphics preview stopped working. In order to get the new latex version
to compile my thesis I had to change "dvipdfm" to "dvipdfmx" in
\documentcalss. Now previews in general work well again, captions are
also correct, but my figures (all .eps) are just empty boxes. However,
the size of the boxes correspond to their bounding boxes. (I've checked
the .pngs that are generated for the preview as well.)
\documentclass[dvipdfmx]{book}
\usepackage{graphicx}
\begin{document}
\begin{figure}[t]
\centering
\includegraphics[]{test.eps}
\caption[]{Caption}
\end{figure}
\end{document}
Why do you give dvipdfmx option to documentclass? I suppose you are
using pdflatex. Then, there is no need for dvipdfmx, which is used for
converting dvi file into pdf file. I think that just deleting
"[dvipdfmx]" would be sufficient.

Regards,
Ikumi Keita
David Kastrup
2017-08-23 10:03:57 UTC
Permalink
Post by Ikumi Keita
Hi Jan,
Post by Jan Menzel
Hi all!
After our IT department recently upgraded my system to Ubuntu 16.04 LTS
graphics preview stopped working. In order to get the new latex version
to compile my thesis I had to change "dvipdfm" to "dvipdfmx" in
\documentcalss. Now previews in general work well again, captions are
also correct, but my figures (all .eps) are just empty boxes. However,
the size of the boxes correspond to their bounding boxes. (I've checked
the .pngs that are generated for the preview as well.)
\documentclass[dvipdfmx]{book}
\usepackage{graphicx}
\begin{document}
\begin{figure}[t]
\centering
\includegraphics[]{test.eps}
\caption[]{Caption}
\end{figure}
\end{document}
Why do you give dvipdfmx option to documentclass? I suppose you are
using pdflatex.
While including test.eps? Unlikely.
--
David Kastrup
Ikumi Keita
2017-08-24 11:23:54 UTC
Permalink
Hi David,
Post by David Kastrup
Post by Ikumi Keita
Why do you give dvipdfmx option to documentclass? I suppose you are
using pdflatex.
While including test.eps? Unlikely.
Oh, thanks for pointing out that. Foolish me.

Regards,
Ikumi Keita
Jan Menzel
2017-08-24 07:06:51 UTC
Permalink
Hi Ikumi!
Many thanks for your response!
Post by Ikumi Keita
Hi Jan,
Post by Jan Menzel
Hi all!
After our IT department recently upgraded my system to Ubuntu 16.04 LTS
graphics preview stopped working. In order to get the new latex version
to compile my thesis I had to change "dvipdfm" to "dvipdfmx" in
\documentcalss. Now previews in general work well again, captions are
also correct, but my figures (all .eps) are just empty boxes. However,
the size of the boxes correspond to their bounding boxes. (I've checked
the .pngs that are generated for the preview as well.)
\documentclass[dvipdfmx]{book}
\usepackage{graphicx}
\begin{document}
\begin{figure}[t]
\centering
\includegraphics[]{test.eps}
\caption[]{Caption}
\end{figure}
\end{document}
Why do you give dvipdfmx option to documentclass? I suppose you are
using pdflatex. Then, there is no need for dvipdfmx, which is used for
converting dvi file into pdf file. I think that just deleting
"[dvipdfmx]" would be sufficient.
You are right. I'm converting to DVI first then to PS and PDF. This
works very well with dvipdfmx. Removing dvipdfmx the image is shown (in
preview) but collides with the caption.
Any other ideas?

Best regards
Jan
Ikumi Keita
2017-08-24 12:16:19 UTC
Permalink
Hi Jan,
Post by Jan Menzel
You are right. I'm converting to DVI first then to PS and PDF. This
works very well with dvipdfmx. Removing dvipdfmx the image is shown (in
preview)
Let me confirm what that "preview" mean. I guess that you are talking
about the images displayed in emacs buffer by preview-latex
functionality. I assume so in the rest of this message.
Post by Jan Menzel
but collides with the caption.
Any other ideas?
I'm not sure what that collision is. Attached is a screenshot of the
buffer with the example latex file you gave in the first message with
a symbolic link
test.eps -> /usr/local/share/ghostscript/9.16/examples/tiger.eps
and preview-latex enabled. No collision is here.

Anyway, you can try another way. Add the following lines to your
file and re-open the file.
%%% Local Variables:
%%% TeX-PDF-mode: nil
%%% End:
If your file already has local variales section, only add the line of
TeX-PDF-mode there.

This will make AUCTeX to stop using pdflatex and to use the usual path
dvi->ps->png instead. On my machine, almost the same image was
displayed in the buffer when preview-latex is enabled.

If that doesn't work either, giving us more detailed information about
your environment might help. It would be a good choice to include the
output of M-x preview-report-bug.

Regards,
Ikumi Keita
Jan Menzel
2017-08-25 17:31:00 UTC
Permalink
Hi Ikumi!
Many thanks for your suggestions.
Post by Ikumi Keita
Hi Jan,
Post by Jan Menzel
You are right. I'm converting to DVI first then to PS and PDF. This
works very well with dvipdfmx. Removing dvipdfmx the image is shown (in
preview)
Let me confirm what that "preview" mean. I guess that you are talking
about the images displayed in emacs buffer by preview-latex
functionality. I assume so in the rest of this message.
Post by Jan Menzel
but collides with the caption.
Any other ideas?
I'm not sure what that collision is. Attached is a screenshot of the
buffer with the example latex file you gave in the first message with
a symbolic link
test.eps -> /usr/local/share/ghostscript/9.16/examples/tiger.eps
and preview-latex enabled. No collision is here.
Anyway, you can try another way. Add the following lines to your
file and re-open the file.
%%% TeX-PDF-mode: nil
If your file already has local variales section, only add the line of
TeX-PDF-mode there.
This will make AUCTeX to stop using pdflatex and to use the usual path
dvi->ps->png instead. On my machine, almost the same image was
displayed in the buffer when preview-latex is enabled.
I've tried to set TeX-PDF-mode to nil and it works better now. However,
the image is cropped on the right and the caption is not centred below
the image. Please find the resulting .png attached. (I've extended the
caption a little bit compared to my original code).
Post by Ikumi Keita
If that doesn't work either, giving us more detailed information about
your environment might help. It would be a good choice to include the
output of M-x preview-report-bug.
Please find the report attached. (I've removed the header and footer on
a Windows PC. This might have altered the line ending.)
Hopefully this allows you to make further suggestions...

Best regards
Jan
Ikumi Keita
2017-08-26 03:36:58 UTC
Permalink
Hi Jan,
Post by Jan Menzel
I've tried to set TeX-PDF-mode to nil and it works better now. However,
the image is cropped on the right and the caption is not centred below
the image. Please find the resulting .png attached. (I've extended the
caption a little bit compared to my original code).
Hmm, I'm not confident, but it seems that the options of
\includegraphics are related to the case. After modifying the line to
\includegraphics[width=\linewidth]{test.eps}
, the buffer looks as the attached image, without a crop on the right
side. I've applied the setq command in your report log with a
modification /usr/bin/gs -> /usr/local/bin/gs.

Loading...