0

I bought a new laptop (Thinkpad E590, Window 10 Pro). Only on this laptop, MiKTeX fails to create pdf images from the eps files (which I create with R, although I guess it's irrelevant). The pdf file converted from the eps file is created, but it's blank. I tried every possible fix I found on the web, and I even reinstalled MiKTeX. Nothing worked. Here's a minimal working example. I create an image with this R code:

x <- c(1:10)
y <- c(11:20)
plot(x,y)

And save the plot as "Rplot.eps", in the same folder with the .tex file. The code of the .tex file is as follows:

\documentclass[a4paper,11pt]{article}
\usepackage{graphicx}
\date{}
\title{}
\begin{document}

This is my picture

\begin{figure}
    \includegraphics{Rplot.eps}
\end{figure}    

\end{document}

When I compile it, I just get a pdf with "This is my picture" written on it and no image. The Rplot-eps-converted-to.pdf file that is created is just a blank pdf.

I get this message: "MiKTeX GPL Ghostscript 9.25: Unrecoverable error, exit code 1"

Also get this log: "pdflatex.exe (file ./Rplot-eps-converted-to.pdf): PDF inclusion: found PDF version <1.7>, but at most version <1.5> allowedFile: Rplot-eps-converted-to.pdf Graphic file (type pdf)Package pdftex.def Info: Rplot-eps-converted-to.pdf used"

And this other one: "Overfull \hbox (53.54398pt too wide) in paragraph"

How can I fix this?

  • apart from the issue withghostscript, do you have to save the image as eps from R? can you not save it as pdf (I don't really know R, but saving as pdf would simplify things a lot) – David Carlisle Mar 16 at 15:13
  • @DavidCarlisle I can save images as pdf, but I have to specify a size, and when I set the linewidth on LaTeX the original width/height ratio of the picture is not kept on the pdf you get after compiling. Saving as eps and let LaTeX do the conversion ensures everything is done right (when it works). – Hanx70 Mar 16 at 15:21
  • Do you have a basic miktex? Try to install more packages (look e.g. for font packages), the basic miktex seems to miss something. – Ulrike Fischer Mar 16 at 15:21
  • 1
    latex should not distort the pdf on scaling (unless you specify both height and width) – David Carlisle Mar 16 at 15:24

Your Answer

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

Browse other questions tagged or ask your own question.