# Side by side figures general code, subfigures, both figures automatically adapted to the main text width

I'm one of those new users and have a problem making a general code for side by side figures using subfigures. I've been reading and searching a lot but haven't found what I’m looking for. Can any of you pros help me making a general code for this?

What I want is to have two (or if wanted more pictures just by adding the general code) side by side so that the total figure (containing figure a, b, (c), (d) etc.) automatically adapt to the main text (see figure two here).

I know that subfigures package is the oldest of a series of package implementing commands for placing figures and tables side by side. But I have found out that it provides support for captioning and labeling of the sub-figures and sub-tables, which is missing? in the minipage environment.

The first figure shows what my code makes right now and the second figure is how I what it.

My code:

\begin{figure}[ht]
\centering
\subfigure[Interface of Grasshopper]{\label{fig:a}\includegraphics[width=70mm]{Test2_5.jpg}}
\subfigure[Interface of Rhino3D]{\label{fig:b}\includegraphics[width=70mm]{Test2_6.jpg}}
\caption{Grasshopper and Rhino3D}
\end{figure}


You need to add a \hfill between the subfigures and the \centering is then not needed anymore.
\begin{figure}[ht]