1

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}
1
  • Welcome to TeX.SX! Please help us (and also you) and add a minimal working example (MWE), that illustrates your problem. ( in future)
    – Bobyandbob
    Commented Jun 11, 2017 at 13:38

1 Answer 1

5

In general \textwidth is the total width of the text area, so you shouldn't specify figure widths in twocolumn layout in terms of this width (only for figure* 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:

\documentclass[twocolumn]{article}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{lipsum}

\begin{document}

\lipsum[1-3]

\begin{figure}
  \begin{subfigure}[b]{0.4\columnwidth}
    \includegraphics[width=\linewidth]{example-image-a}
    \caption{Picture 1}
    \label{fig:1}
  \end{subfigure}
  \hfill %%
  \begin{subfigure}[b]{0.4\columnwidth}
    \includegraphics[width=\linewidth]{example-image-b}
    \caption{Picture 2}
    \label{fig:2}
  \end{subfigure}
\end{figure}

\lipsum[4]

\end{document}

This will produce the following:

Output

You must log in to answer this question.

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