[Tex/LaTex] Problems with epstopdf: using .tif files in Latex does not work

epstopdfgraphics

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:

\usepackage{epstopdf}
\epstopdfDeclareGraphicsRule{.tif}{png}{.png}{convert #1 \OutputFile}
\AppendGraphicsExtensions{.tif}

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:

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

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

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

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:

\usepackage{epstopdf}
\def\eattif#1.tif{#1}
\DeclareGraphicsRule{.tif}{png}{.png}{ `convert #1 \eattif#1-tif-converted-to.png }
\AppendGraphicsExtensions{.tif}

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

Best Answer

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.

Related Question