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> <to be read again>
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.
Added sample code:
\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
\headsep 1.3cm
\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}
.log
.