1

I have been struggling for a while trying to insert png figures. I want to use powerdot so I should go through latex->dvi->ps->pdf.

The following did work until my last update

\includegraphics[width=0.3\textwidth,bb=0 0 401 337]{DipoloSmoot.png}

No errors in LaTeX - dvips but in the ps2pdf step

I am using a MikTeX installation on Windows 10:

>>> pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9 64-bit)
(preloaded format=latex 2016.8.6)
>>> dvips.exe -Ppdf "test_powerdot_png.dvi"
This is dvips(k) 5.996 Copyright 2016 Radical Eye Software
(www.radicaleye.com) *' TeX output 2016.08.06:1831' -> test_powerdot_png.ps

>>> "C:\Program Files\gs\gs9.19\bin\gswin64c.exe" -q -dSAFER -dNOPAUSE
-dBATCH -sOutputFile="test_powerdot_png.pdf" -sDEVICE=pdfwrite -c
-setpdfwrite -f "test_powerdot_png.ps"
...
Last OS error: No such file or directory
GPL Ghostscript 9.19: Unrecoverable error, exit code 1

Please forgive my inexperience, I don't know how to upload log and relevant files. Any hint? Thank you in advance

Surfing around I see things similar to mine:

How to configure WinEdt/MikTeX/ps2pdf to use a new version of Ghostscript when converting ps->pdf?
which seems to be solved in the current MikTeX distribution.

However none of the solutions solves the problem.

  • dvips tries to use emtex special for bitmap images. But I think that is not always successful. It is better to convert bitmap images to eps files before the latex: for example, magick DipoloSmoot.png DipoloSmoot.eps \includegraphics[width=0.3\textwidth]{DipoloSmoot.eps} – Akira Kakuto Aug 7 '16 at 23:39
  • But the message No such file or directory may suggest other problem in your case. – Akira Kakuto Aug 7 '16 at 23:49
  • @AkiraKakuto: good to learn that dvips calls some other piece of tex, thanks. I will investigate in that direction. If the ps from bitmap is produced on the flight and it doesn't work, that may explain the No such file or directory . – Francesco Aug 9 '16 at 12:55
  • I realized looking at the .dvi file that the .png was not converted anymore to .eps. I obtained the previous behaviour by including \DeclareGraphicsRule{.png}{eps}{.bb}{``convert #1 eps:-} after having installed ImageMagick®. – Francesco Aug 12 '16 at 11:58
  • Was the conversion once made by the MikTeK environment? Has the default behaviour changed? – Francesco Aug 12 '16 at 12:03
1

After having installed ImageMagick®:

  • either convert images beforehand, as indicated by Akira KaKuto:

    > convert DipoloSmoot.png DipoloSmoot.eps
    

before running latex.

  • or insert in your tex file:

    \DeclareGraphicsRule{.png}{eps}{.bb}
    {`convert #1 -density 72x72 -units PixelsPerInch eps:-}
    

Depending on which program created the .png file, you may need to use the convert option -density 72x72 -units PixelsPerInch, in both cases.

| improve this answer | |

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.