# Figures caption

I am using \subfigure package to place two figures side by side. The following are the code lines for this purpose.

\begin{figure}
\centering
\subfigure{\includegraphics[width=2in]{Figure 2b.png} }}
\caption{FE model geometry and boundary conditions; (a) tension/compression, (b) simple shear} %\label{Fig. 2}
\end{figure}


The placement of figures (2a and 2b) are correct but with the caption of the figure 2a.png and 2b.png are appearing (before the caption) in the document. I tried many ways to remove them but havn't succeeded.

Yours valuable suggestions are highly appreciated.

Thanks

-
The subcaptions should go before \includegraphics –  dustin Jul 31 '13 at 21:40
Welcome to TeX.SX! –  mafp Jul 31 '13 at 21:57
Please complete your code snippet to a full compilable document. In particular include information about how you load the subfigure package, as this will affect the answer. –  Andrew Swann Aug 1 '13 at 11:02
The way I understand it, you want to remove the subcaptions. However, your code snippet, when placed in a document loading just the necessary packages, produce no subcaption. So please do as Andrew suggested, and produce a complete, compilable example, a minimal working example (MWE), that demonstrates the problem. –  Torbjørn T. Aug 6 '13 at 19:02

You shouldn't be using subfigure, but either subfig or subcaption.

Here's the version for subfig:

\documentclass{article}

\usepackage[demo]{graphicx} % demo is just for the example
\usepackage{subfig}

\begin{document}
\begin{figure}
\centering

\subfloat[]{\includegraphics[width=2in]{Figure 2b.png}}

\caption{FE model geometry and boundary conditions; (a)~tension\slash compression,
(b)~simple shear}\label{fig:FEmodel}

\end{figure}

\end{document}


Note that the enclosing \mbox is not needed.

A very similar output is obtained with subcaption:

\documentclass{article}
\usepackage[demo]{graphicx} % demo is just for the example
\usepackage{subcaption}

\begin{document}
\begin{figure}
\centering

\begin{subfigure}{2in}
\centering
\includegraphics[width=2in]{Figure 2a.png}
\subcaption{}
\begin{subfigure}{2in}
\includegraphics[width=2in]{Figure 2b.png}
\subcaption{}
\end{subfigure}

\caption{FE model geometry and boundary conditions; (a)~tension\slash compression,
(b)~simple shear}\label{fig:FEmodel}

\end{figure}

\end{document}

-

In you code snippet, you should put your subcaptions before \includegraphics; that is,

\begin{figure}
\centering
\mbox{\subfigure{\caption{tension/compression}

Also, many will tell you to use descriptive labels and not numbers. I ran into this problem awhile ago. If you place a figure in front of it, you would have to re-index your whole document or you would have fig 1, fig just placed in between, fig 2 which is now 3, etc.