Graphics, Figures & TablesSide-by-side figures with variable width and height

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
afonso
Posts: 1
Joined: Thu Jul 25, 2013 6:05 pm

Side-by-side figures with variable width and height

Post by afonso »

Hi,

I'm trying to set two figures, side-by-side, both with variable width and both with the height of the tallest.

Code: Select all

\documentclass[]{article}

\usepackage{varwidth}

\begin{document}

\begin{figure}[H]

\begin{varwidth}{\textwidth}
  \framebox{
    \begin{tabular}{l}
	first row \\
	second row \\
	third row
    \end{tabular}
  }
  \caption{First figure.}
\end{varwidth}
\hfill
\begin{varwidth}{\textwidth}
  \framebox{
    \begin{tabular}{l}
	first row \\
	second row \\
    \end{tabular}
  }
  \caption{second figure.}
\end{varwidth}

\end{figure}

\end{document}
Any ideas how can I do this? Thank you.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Spider
Posts: 6
Joined: Sat Jul 27, 2013 3:45 pm

Side-by-side figures with variable width and height

Post by Spider »

Hi.
You can use two minipages side-by-side.
Here is an example.

Code: Select all

\begin{figure}
\begin{minipage}[c]{9cm}
\includegraphics[width=9cm, height=5cm]{jet.jpg}
\caption{jet}
\label{jet}
\end{minipage}
\begin{minipage}[c]{7cm}
\includegraphics[width=7cm, height=5cm]{plume.jpg}
\caption{Panache}
\label{panache}
\end{minipage}
\end{figure}
Aplus.
Post Reply