I am writing my thesis in Latex and have multiple .tif pictures to include. Of course, I can convert them manually, but I would prefer to let Latex do this job to save time.

I am trying to use the epstopdf package for converting the .tif files and included the following code in the preamble of my .tex document:

\epstopdfDeclareGraphicsRule{.tif}{png}{.png}{convert #1 \OutputFile}

However, this does not work, I get an error for the line of the .tif file in the log as follows:

Package epstopdf Info: Source file: <picture.tif>
(epstopdf) date: 2015-08-18 14:06:10
(epstopdf) size: 1231850 bytes
(epstopdf) Output file: <picture-tif-converted-to.png>
(epstopdf) Command: <convert picture.tif picture-tif-converted-to.png>
(epstopdf) \includegraphics on input line 331.
runsystem(convert picture.tif picture-tif-converted-to.png)...executed.
Package epstopdf Info: Result file: <picture.png>.
! Package pdftex.def Error: File `picture.png' not found.

For your information, I changed the file name to keep the code a bit more simple. But this should not matter to the issue.

In addition, Texmaker tells me the following:

Process started
Invalid Parameter - picture-tif-converted-to.png
Process exited with error(s)

I have also tried the following commands instead of the regular one from above. I found them in a forum where this answer was accepted and seemed to work:

\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `basename #1 .tif`.png}

or respectively this command for the same picture in the subfolder "figures":

\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}

Both commands produce the same error in Texmaker and the log file as with the regular command above.

I have also tried an alternative with the following code in my preamble:

\DeclareGraphicsRule{.tif}{png}{.png}{ `convert #1 \eattif#1-tif-converted-to.png }

Nevertheless, this code does not even get to the converting of the picture, but produces another error, namely that there is one } too much in the third line. And I can't figure out where this should be.

Since I am running Miktex, I have also enabled the shell extension (for all of the alternatives posted above) by using pdflatex in Texmaker as follows:

pdflatex -synctex=1 -interaction=nonstopmode --shell-escape --enable-write18 %.tex

I am running out of ideas now about how to make it work. It seems to me that the epstopdf package is successfully called, but there is no output file in the folder where the picture and the .tex file is saved, neither is it somewhere else on my computer.

I am using the graphicx package to include my pictures.

Maybe one of you guys knows more??

Is it possible that the epstopdf package conflicts with another package??

OS: Win 7 Enterprise 64bit

Latex: Basic Miktex 2.9.5640 (update of all packages was run today)

Editor: Texmaker 4.4.1

  • 1
    To convert a ton of images from one format to another on Windows, I normally end up using IrfanView. Batch conversion instructions can be found here, among other places. This doesn't answer your specific question, but you end up with the same result: a bunch of PNG files from your TIFF originals. – Mike Renfro Oct 23 '15 at 15:06
  • @MikeRenfro: Thanks for your comment and the link to the instructions for the batch processing with IrfanView. I am aware of this method and thinking about using it, before I spend too much time on fixing my Latex issue. Still, I hope your hint can be useful for other people. Additionally, I am still interested in my issue and also wanted to summarize different pieces of code regarding the epstopdf package. – Max Oct 23 '15 at 15:42

For anyone stumbling over this like me after having this problem as well: After installing ImageMagick (which is needed for the convert) and restarting TexStudio in my case the first version with epstopdf worked perfectly.

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.