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

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

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> Underfull \vbox (badness 10000) has occurred while \output is active
pdflatex> (./document.bbl
pdflatex> Package natbib Warning: Empty `thebibliography' environment on input line 3.

Added sample code:

\paperwidth 8.5in
\paperheight 11in
\oddsidemargin 0in
\headsep 1.3cm 
\textwidth 7in 
\textheight 9.25in
\columnsep 0.4in
\footskip 0in 

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


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


  • 1
    Please add a minimal working example (MWE) that illustrates your problem. Commented Dec 8, 2011 at 22:43
  • is there anyway I can attach a sample tex file to the question instead of pasting it?
    – chepukha
    Commented Dec 8, 2011 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
    Commented Dec 8, 2011 at 23:07
  • 1
    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. Commented Dec 8, 2011 at 23:08

1 Answer 1


The problem seems to be in the fact that you load


instead of


Only with the latter declaration you are able to use the syntax

  • 1
    Yes, that's exactly where the problem is. Thank you very much, egreg.
    – chepukha
    Commented Dec 9, 2011 at 3:34

You must log in to answer this question.

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