# Problem inserting figure to LaTeX file using Texlipse

I'm trying to insert a figure into my LaTeX file using the following syntax:

\begin{figure}
\centering
\includegraphics [width=3in]{fig1.png}
\caption{Calculation of shortest path betweenness}
\label{Fig.3:Shortest path betweenness}
\end{figure}


It worked for me before but this time I'm getting the following error:

 LaTeX Error: \begin{figure} on input line xxx ended by \end{document}


Also, hovering over the red cross symbol indicating error in Eclipse, I see this message

 paragraph ended before Gin@iii was completed.


It's obvious that I have the \end{figure} to end my \begin{figure} so I don't understand how I still get that error.

Can someone please tell me what the problem is?

Edit: Add more details for debugging. The problem went away if I remove '[width=3in]'. Here is the detail error:

pdflatex> Runaway argument?
pdflatex> width=3in]{fig1.png} \caption {Caption} \label {Fig.1}
pdflatex> ! Paragraph ended before \Gin@iii was complete.
pdflatex>                    \par
pdflatex> l.40
pdflatex>
pdflatex>
pdflatex> Underfull \vbox (badness 10000) has occurred while \output is active
pdflatex> (./document.bbl
pdflatex>
pdflatex> Package natbib Warning: Empty thebibliography' environment on input line 3.


\documentclass[10pt,psfig,letterpaper,twocolumn]{article}
\usepackage{geometry}
\usepackage{graphics}
\usepackage{setspace}
\usepackage{natbib}
\usepackage{verbatim}
\usepackage[scaled=0.9]{helvet}
\singlespacing
\paperwidth 8.5in
\paperheight 11in
\oddsidemargin 0in
\geometry{left=0.75in,top=0.75in,right=0.75in,bottom=1in}
\textwidth 7in
\textheight 9.25in
\columnsep 0.4in
\footskip 0in
\renewcommand{\bibname}{REFERENCE}
\pagestyle{empty}
\begin{document}
\bibliographystyle{acm}

\title{\fontfamily{phv}\selectfont{\huge{\bfseries{Title here}}}} \author{
{\fontfamily{ptm}\selectfont{\large{\bfseries{author name}}}}\thanks{contact
info }}

\maketitle
\thispagestyle{empty}

\section*{\fontfamily{phv}\selectfont{\normalsize{\bfseries{Section name}}}}

\begin{figure}
\centering
\includegraphics[width=3in]{fig1.png}
\caption{Caption}
\label{Fig.1}
\end{figure}

\pagebreak[4]
\vspace*{5.52in}
\bibliography{ref}
\end{document}

-
Please add a minimal working example (MWE) that illustrates your problem. –  Torbjørn T. Dec 8 '11 at 22:43
is there anyway I can attach a sample tex file to the question instead of pasting it? –  chepukha Dec 8 '11 at 23:06
Not here. Some people post these files on other sites. However, this should not be necessary when provided a minimal working example. Also note that "Runaway argument" (or many of TeX's error messages) could potentially pertain to an entirely different part of your document that what is output to the console/.log. –  Werner Dec 8 '11 at 23:07
No, but you should reduce your file to the minimum that still produces the error. Then it probably won't be too long to paste in. –  Torbjørn T. Dec 8 '11 at 23:08

The problem seems to be in the fact that you load

\usepackage{graphics}


\usepackage{graphicx}

\includegraphics[width=3in]{fig1.png}
`