I want both figures side by side in one column of a two-column LaTeX document, but the result is both the figures are one below another.
\begin{figure}[H]
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{cure.png}
\caption{Picture 1}
\label{fig:1}
\end{subfigure}
\hfill %%
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{cluto.png}
\caption{Picture 2}
\label{fig:2}
\end{subfigure}
\end{figure}
Best Answer
In general
\textwidth
is the total width of the text area, so you shouldn't specifyfigure
widths in twocolumn layout in terms of this width (only forfigure*
environments).If you want the figure to only span one column in a twocolumn document, use
\columnwidth
(see egreg's answer here for the reason why) instead.So in short:
This will produce the following: