Usage of minipage in a single column of a two column document

minipagetwo-column

I want to insert two figures side by side in one column, in a two column document, using minipage.

Here is a MWE:

\documentclass[a4paper, landscape, twocolumn]{article}
\usepackage{geometry}
\usepackage{graphicx}   
\usepackage{lipsum}  

\begin{document}    
\lipsum[1]  

\noindent
\begin{minipage}[t]{0.4\textwidth}
    \includegraphics[width=0.4\textwidth]{example-image-a}
\end{minipage}
%
\begin{minipage}[t]{0.4\textwidth}
    \includegraphics[width=0.4\textwidth]{example-image-a}
\end{minipage}

\lipsum[1]     
\end{document}

The result:

enter image description here

I can't understand why this doesn't work. Is this by design (of minipage)?
If so, what alternative do I have?

I searched relevant topics without success.

Best Answer

Use \columnwidth, rather than \textwidth (which gives the width of the full page, not the column):

\documentclass[a4paper, landscape, twocolumn]{article}
\usepackage{geometry}
\usepackage{graphicx}   
\usepackage{lipsum}  

\begin{document}    
\lipsum[1]  

\noindent
\begin{minipage}[t]{0.49\columnwidth}
    \includegraphics[width=\textwidth]{example-image-a}
\end{minipage}
%
\begin{minipage}[t]{0.49\columnwidth}
    \includegraphics[width=\textwidth]{example-image-a}
\end{minipage}

\lipsum[1]     
\end{document}

(Note each image is slightly less than half the column width, to allow for space between, etc.) Notice also that the \textwidth specified in \includegraphics is within the minipage environment, and as such returns the width of the minipage.

In fact, for this example you don't need to use minipage at all:

\documentclass[a4paper, landscape, twocolumn]{article}
\usepackage{geometry}
\usepackage{graphicx}   
\usepackage{lipsum}  

\begin{document}    
\lipsum[1]  

\noindent
    \includegraphics[width=0.5\columnwidth]{example-image-a}%
    \includegraphics[width=0.5\columnwidth]{example-image-a}

\lipsum[1]     
\end{document}

The result is as follows:

Two columns with images side-by-side in one column