0

How to fit two pictures side-by-side on a landscape page?

(EDIT: I have answered this Q&A style below. Other approaches or suggestions for improvement are welcomed)

4
  • 1
    Welcome to TSE. What did you try? Aug 26, 2021 at 14:11
  • below is the one that I got working, will edit the question. Aug 26, 2021 at 14:12
  • What is wrong with your code fragment? It works fine (including it in some test document).
    – Zarko
    Aug 26, 2021 at 15:36
  • the idea was to answer my own question q&a style but will be more specific in the future. stackoverflow.com/help/self-answer Aug 27, 2021 at 11:54

2 Answers 2

1

It is not clear what is your problem. Your code fragment inserted in some test document, for example as is:

\documentclass[11pt]{article}
\usepackage{geometry}
\usepackage{caption, subcaption}
\usepackage{pdflscape}
\usepackage{graphicx}

\begin{document}
% your code fragment
\end{document} 

works fine and it has today recommended form. Of course, you can make it a wee bit shorter by use of Gin keywords as I do in the following MWE:

\documentclass[11pt]{article}
\usepackage{geometry}
\usepackage{caption, subcaption}
\usepackage{pdflscape}
\usepackage{graphicx}

\begin{document}

\begin{landscape}
\begin{figure}[p]
  \setkeys{Gin}{width=\linewidth}  % <---
  \centering
  \begin{subfigure}[t]{0.45\linewidth}
\includegraphics{example-image-duck}
\caption{Caption 1}
\label{fig:subim1}
  \end{subfigure}
\hfil      
   \begin{subfigure}[t]{0.45\linewidth}
\includegraphics{example-image-duck}
\caption{Caption 2}
\label{fig:subim2}
  \end{subfigure}
\caption{Caption for this figure with two images: by use of \texttt{subfigure} (recommended)}
\label{fig:image2}
\end{figure}

\begin{figure}[p]
  \setkeys{Gin}{width=0.45\linewidth}  % <---
  \centering
  \subfloat[Caption 1   \label{fig:subim1}]{\includegraphics{example-image-duck}}
\hfil
  \subfloat[Caption 2   \label{fig:subim2}]{\includegraphics{example-image-duck}}
 
\caption{Caption for this figure with two images: by use of \texttt{subfloat} (less recommended)} 
\label{fig:image2}
\end{figure}

\end{landscape}

\end{document} 

enter image description here

Beside above solutions exist other too. See @Bernard answer (+1).

1

It is easy with the subfloatrow environment from package floatrow:

\documentclass[11pt]{article}
\usepackage{geometry}
\usepackage{caption, subcaption}
\usepackage{lscape} 
\usepackage{graphicx}
\usepackage{floatrow} 

\begin{document}

\begin{landscape}
\floatsetup{captionskip=2ex}
\begin{figure}[!htb]
  \ffigbox[\textheight]{%
  \begin{subfloatrow}[2]
      \centering
      \ffigbox[\FBwidth]{\caption{Ils se lèvent à la pointe du jour (1950)}\label{T1}}{\includegraphics[scale=0.3]{PointeduJour}}
        \qquad
      \ffigbox[\FBwidth]{\caption{La Dormeuse (1937)}\label{T2}}{\includegraphics[scale=1.37]{LaDormeuse}}
    \end{subfloatrow}%
    }{\caption{Two Paintings by Toyen}\label{Toyen}}
\end{figure}
\end{landscape}

\end{document} 

enter image description here

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