1

I am writing a dissertation which already contains dozens of images in eps format. All of them compile just fine. Except for this one:

I get the following error message: Unable to read an entire line---bufsize=200000. Please increase buf_size in texmf.cnf. /user/textbin/dvips: ! unexpected eof in DVI file

Let me first emphasize that I have encountered this error before. From my understanding, it means LaTeX cannot compile the image itself (usually because I've photoshopped the picture). I've always successfully managed to fix the problem by copy-pasting the image itself into a new blank image and re-saving it.

This time, no amount of copy-pasting into a new image works. This may be due to the fact that this image is extremely heavily Photoshopped.

Here's the link to the image itself: https://www.dropbox.com/s/tz8b3xhwplijiko/supernatural_photoshop.eps?dl=0

Can any of you successfully embed it in a LaTeX file?

Thanks in advance for your help.

21
  • 1
    The link to the image isn't loading for me...would you mind posting the image within the question?
    – auden
    Commented Aug 11, 2016 at 19:50
  • 1
    The upload to my local DropBox does not work. Are you sure that the relevant file really is an .eps file?
    – user31729
    Commented Aug 11, 2016 at 19:51
  • I apologize, my Dropbox was taking its sweet time syncing due to a poor internet connection. The image is now up and running via the link I provided.
    – morthicia
    Commented Aug 11, 2016 at 20:09
  • @morthicia: Thanks for fixing the Dropbox issue. I've downloaded your file and examined it -- it is a DOS EPS binary file, perhaps compressed, as far as I can say this is not understable by latex
    – user31729
    Commented Aug 11, 2016 at 20:14
  • 1
    @ChristianHupfer the original is EPS but it has a binary tiff preview at the front (as allowed by the format) the one I uploaded, I just removed the preview in emacs. Commented Aug 11, 2016 at 20:29

3 Answers 3

2

The file has a binary preview at the start. You can either delete it (everything from the start up to %!PS) in any reasonable editor, or re-save the image from the original application without a preview.

0
1

The EPS is given as binary EPS file (DOS EPS binary file), a format, which allows the bundling of the PostScript section with a TIFF or Windows Metafile. The first version of the specification seems to be written in 1985, the current version is 3.0 from 1992. This age explains the "DOS" a bit.

Unhappily dvips does not support this kind of file. Some time ago, I have written a converter to extract the PostScript (and other sections) of a binary EPS file, see dosepsbin, available in CTAN and packaged in TeX Live, and MiKTeX.

The command line:

dosepsbin --eps-file supernatural.eps supernatural_photoshop.eps

Then supernatural.eps is used in LaTeX.

5
  • Thanks. Just checked out your package and doc. How do you call the package? \usepackage{dosepsbin} ??
    – morthicia
    Commented Aug 11, 2016 at 20:45
  • @morthicia It's not a TeX package, but a program. The command line is given in the answer. The program comes with documentation and there is also help on the command line: dosepsbin --help and dosepsbin --man. Commented Aug 11, 2016 at 20:49
  • @morthicia: I've converted the file to .pdf format with epspdf (a texlua scripts). Can I post it somewhere?
    – Bernard
    Commented Aug 11, 2016 at 20:59
  • @Bernard dvips cannot include PDF files. It would need to be converted back to EPS. In the case of pdflatex, which supports PDF as image format, it can directly include bitmaps like PNG or JPEG with no need to convert to EPS in the first place. Commented Aug 11, 2016 at 21:10
  • @Heiko Oberdiek: Actually, epsdpdf first converted the binary eps to a standard .eps (cropped), then I converted the latter to .pdf format.
    – Bernard
    Commented Aug 11, 2016 at 21:19
1

I did it a somewhat unorthodox way (I don't know if this is helpful to you or not):

I just did a screenshot of the image, and it looked the same as it did in the dropbox file. Then, I uploaded it (I use sharelatex.com) and used the code

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}

\begin{document}

\includegraphics{Babylon}

\end{document}

And got the photo on a LaTeX document.

If this isn't an option for you (to screenshot it) I'll delete this answer, but I just thought I'd throw the idea out there. Hope this helps!

2
  • The problem with doing this (although it has the advantage of working for anything that you can show on screen in any application) is that you have no idea about any possible loss of resolution. The things may look identical on screen but if the original was a 1200dpi high resolution bitmap and the screendump is from a 600x400 vga screen, they certainly won't look the same when printed. Commented Aug 12, 2016 at 8:46
  • @DavidCarlisle, of course. It was mainly meant to be a "last resort" sort of option.
    – auden
    Commented Aug 12, 2016 at 13:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .