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



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?

  • 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
  • 6
    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
  • 4
    @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

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

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

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:

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

can substitute the three lines of code above.

  • XeTeX on Mac OS X will read .tiff (and most other pixel image format) files, by using Mac OS X's coreimage for the heavy-lifting. – WillAdams Dec 23 '15 at 20:32

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.