[Tex/LaTex] using subfig (side-by-side) figures

epsfloatssubfloats

I used the package subfig for my first time, I got this error:
! LaTeX Error: File figures/Rnefft1310' not found.
! LaTeX Error: File
figures/imt1310' not found.
However, I am sure the file is there as eps. What is wrong?

Am I using the wrong code for subfig?
here is what I wrote:

\begin{figure}
\centering
\subfloat[]{\includegraphics[width=3.1in]{figures/Rnefft1310}} 
\subfloat[]{\includegraphics[width=3.1in]{figures/imt1310}}
\caption{Real and imaginary part of effective index } 
\label{fig:EcUND} 
\end{figure} 

Best Answer

This is not really an answer - I don't know what the problem you are having is! It is really hard to help with this sort of thing! It's very strange that you can plot them when not in the subfloat - it implies there is no package missing for rendering graphics generally.

I thought it might be useful for me to send you some code that works for me so you can see if there is a difference in what you are doing or how you are loading the packages. Obviously replace my .eps files with your own!

If this doesn't point you in the right direction, please change your question to include a minimal working example - i.e. something that can be compiled by someone else, as it may help someone to spot some incompatibility somewhere in your preamble.

\documentclass{report}

\usepackage{graphicx}      % needed for including graphics
\usepackage{epstopdf}
\usepackage{grffile}
\graphicspath{{figures/}}
\usepackage{caption, subfig}

\makeatletter
\g@addto@macro\@floatboxreset\centering % automatically center floats
\makeatother


\begin{document}


\begin{figure}

  \subfloat[Temperature]{\label{fig:opt_nmc_t}\includegraphics[clip=true, width=0.4\textwidth, height=0.3\textheight]{figures/AoptBandB_t_RTTOV10_MoistCovVNMC_F_TH_NEW.eps}} \quad
  \subfloat[Watervapour]{\label{fig:opt_nmc_q}\includegraphics[clip=true,  width=0.4\textwidth, height=0.3\textheight]{figures/AoptBandB_q_RTTOV10_MoistCovVNMC_F_TH_NEW.eps}}

  \caption{Some figures}
  \label{fig:opt_nmc_bc}

\end{figure}


\end{document}