3

I just installed MacTeX, and I'm trying to compile a document, but I get the following error:

! LaTeX Error: File `psfig.sty' not found.

The preamble is as follows:

\documentclass[12pt]{article}
\usepackage{psfig}
\usepackage{subfigure}
\usepackage{rotating}
\usepackage{fullpage}
\usepackage{setspace}
  %\singlespacing
  %\onehalfspacing
  \doublespacing
\usepackage{mathptm}
\usepackage{amsmath}
%\usepackage{cite}
\usepackage{bibentry}
\usepackage{fancyhdr}

I tried updating everything using TeX Live Utility, but that didn't fix it.

Where can I find psfig.sty and how do I install it?

3
  • 4
    psfig is a very obsolete package. Use graphicx
    – egreg
    Commented May 5, 2012 at 17:21
  • 1
    Further to @egreg's comment: Rather use \usepackage{graphicx} and then use \includegraphics{file}. graphicx searches for the appropriate file extension (.pdf, .eps, ...) and if you're using pdflatex, conversion from PS to EPS should be automated.
    – Werner
    Commented May 5, 2012 at 19:03
  • Thank you both! How do I close out this question? Commented May 5, 2012 at 20:51

2 Answers 2

2

To allow this question to be closed, I'll wrap up the above comments by egreg and Werner into a short answer.

psfig is an obsolete package that should not be used anymore. Instead, use graphicx. This allows you to insert an external file name.ext by using the command \includegraphics{name} where .ext is automatically appended from a list of appropriate file extensions, such as .pdf, .eps, .png, .jpg, … The exact list of extensions depends (a) on your driver (e.g., pdftex) and (b) on the manually selected list of extensions specified by \ DeclareGraphicsExtensions{…}. Read more about graphicx here: http://en.wikibooks.org/wiki/LaTeX/Importing_Graphics

1
  • 2
    It may be obsolete, but the OP was asking how to deal with a document that uses this package. So saying "don't use it" is not a good answer.
    – Leopd
    Commented Oct 11, 2012 at 18:29
0

I solved a similar problem

! LaTeX Error: File `psfig.tex' not found.

by downloading the file psfig.tex from here and putting it in the same directory as the file I was converting. Then the formatting worked fine.

Hope this helps.

3
  • The default package repository is available from CTAN.
    – Werner
    Commented Oct 11, 2012 at 18:38
  • @werner: yes, and the ctan catalogue says it's non-free (nosell, in this case). that's why it's not in tex live, and consequently not in mactex. Commented Oct 11, 2012 at 18:49
  • @lockstep, psfig.tex must be renamed to psfig.sty then it works fine. Commented Apr 12, 2013 at 15:25

You must log in to answer this question.

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