Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have to add .tif graphic in my LaTeX file, but it is not working.

\usepackage{graphicx}

\begin{figure}[h]
    \begin{center}
       \includegraphics[width=15mm]{myGraphic.tif}
    \end{center}
\end{figure}

After some research, .tif files won't work in pdfLaTeX or something. But I need to have my figure with .tif extension (not .jpg or others). How can I add .tif figure in my .tex file?

share|improve this question
4  
We hav a question yesterday asking much the same, which got marked as a duplicate of Which graphics formats can be included in documents processed by latex or pdflatex?. Bottom line: you have to convert your TIFF into another format. –  Joseph Wright Jan 9 '13 at 11:09
5  
You should convert your file to PNG. There's no problem with this, it's a lossless format, so the picture will look identical to your TIFF, with the added benefit of usually resulting in a smaller file size. Take a look at Using macros in \DeclareGraphicsRule statement using shell command for an automated way of doing this on the fly. –  Jake Jan 9 '13 at 11:12
4  
A printing house that requires a particular format would normally not want the image included into the latex at all they would want a blank in the main document and the images as separate high resolution bitmaps printed via a separate process for re-combination later. –  David Carlisle Jan 9 '13 at 11:21
3  
@user2168 Many print houses still ask for TIFF images, but that is separate from any typeset version as David says. In any case, LaTeX cannot read TIFF files, so you have no option but to convert them if you want to be able to typeset your document. –  Joseph Wright Jan 9 '13 at 11:23
3  
tiff stands for "tagged image file format" -- it contains tags specifying format and actual images. so in principal, a tiff file can contain png, jpg, gif, and so on (since gif was still a proprietary format when pdftex was being developed, it supposedly couldn't be processed using free software, which led to pdftex dropping tiff format support). so you should in principal convert your tiff image into a format that matches that inside the tiff -- mapping gif to png as necessary. –  wasteofspace Jan 9 '13 at 11:26

1 Answer 1

up vote 31 down vote accepted

No LaTeX engine can read .tif files directly: you will have to convert to another format (more on the graphics formats recognised by TeX is in Which graphics formats can be included in documents processed by latex or pdflatex?). Probably the easiest route is to use pdfLaTeX with the graphics converted to .png format. This conversion is lossless and therefore the images will be identical.

You can do this by hand, but it is also possible to set up to do the job automatically. The method is discussed in Using macros in \DeclareGraphicsRule statement using shell command: the basic requirement is something like

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

in your preamble to enable the conversion. This requires that the convert program is available and needs shell escape enabled.

You can use a perhaps clearer syntax by loading the package epstopdf:

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

can substitute the three lines of code above.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.