2

I want to align three images like this, only specifying the total height, like this:

 ______   _________
|      | |         |
|      | |         |
|      | |_________|
|      |  _________
|      | |         |
|______| |_________|

This is what I tried so far:

\documentclass{standalone}
\usepackage{graphicx}
\usepackage{adjustbox}
\begin{document}
\includegraphics[height=10cm]{img/detectors-field.pdf}%
\adjustbox{height=10cm}{%
    \begin{minipage}{10cm}%
        \includegraphics[width=10cm]{img/coax_pic.jpg} \\
        \includegraphics[width=10cm]{img/bege_pic.jpg}%
    \end{minipage}%
}%
\end{document}

But I get this result:

bad-result

Why doesn't \adjustbox work in this case? What's the correct way to achieve the positioning I want?

3

After some clarification by the OP, I have revised my answer to suit.

The syntax is

\makecomposite{<left-img>}{<top-right-img>}{<bottom-right-img>}{<composite-height>}

The MWE:

\documentclass{article}
\usepackage{graphicx}
\usepackage{stackengine,scalerel}
\newcommand\makecomposite[4]{%
  \savestack\imgstack{\stackengine{0pt}{\includegraphics[width=1in]{#3}}
        {\belowbaseline[0pt]{\includegraphics[width=1in]{#2}}}
        {O}{l}{F}{F}{S}}%
  \savestack\imgcomposite{\scalerel{\includegraphics{#1}}{\imgstack}}%
  \scaleto{\imgcomposite}{#4}
}
\parskip 1em
\begin{document}
\makecomposite{example-image-a}{example-image-b}{example-image-10x16}{5cm}

\makecomposite{example-image-a}{example-image-b}{example-image-golden}{3cm}

\makecomposite{example-image-a}{example-image-b}{example-image-c}{3cm}
\end{document}

enter image description here

| improve this answer | |
  • Nice! However, I'm wondering if there exists a solution that lets everything scale correctly with myheight... – Luigi Pertoldi May 14 '18 at 13:05
  • @LuigiPertoldi Define "correctly". i.e., Are not my scales correct? Does "correct" have anything to do with the gap size? – Steven B. Segletes May 14 '18 at 13:11
  • @LuigiPertoldi If the goal is to eliminate the vertical gap between images B and C, see the ADDENDUM to my answer. – Steven B. Segletes May 14 '18 at 13:34
  • With "scales correctly with myheight" I mean that the relative proportions of each image are preserved when changing myheight (and then one does not have to tweak with the widths of B and C). The feature that I'm looking for, that is missing in your addendum, is that the horizontal widths of B and C must be the same. – Luigi Pertoldi May 14 '18 at 13:55
  • The theoretical problem with what you are trying to automate @LuigiPertoldi is that a "solution" is not possible for all conceivable image aspect ratios for the three images. You need at least one other constraint or variable relaxation of a constraint in order to automate it. This might involve cropping of one or more images, or a non-full-width image if that is not possible. So you need to specify your problem and potentially allowable "fixes". – Aubrey Blumsohn May 14 '18 at 14:18
0

This only works if the two images on the right have the same width (you can use width to equalize them first.

In the example I use both width and height to get different aspect ratios.

The idea is to scale the image on the left and the combination of the two images on the right at the same height, then resize the whole to the desired target height.

\documentclass{article}
\usepackage{graphicx}

\begin{document}

\begin{figure}[htp]
\centering

\resizebox{!}{6cm}{% 6cm is the target height
  \resizebox{!}{1cm}{% 1cm is arbitrary
    \includegraphics[height=10cm,width=4cm]{example-image}%
  }%
  \resizebox{!}{1cm}{%
    \renewcommand{\arraystretch}{0}%
    \begin{tabular}[b]{@{}c@{}}
    \includegraphics[height=6cm,width=8cm]{example-image}\\
    \includegraphics[height=3cm,width=8cm]{example-image}
    \end{tabular}%
  }%
}

\caption{Three images}

\end{figure}

\end{document}

enter image description here

If you want to fill a target width:

\documentclass{article}
\usepackage{graphicx}

\begin{document}

\begin{figure}[htp]
\centering

\resizebox{0.8\textwidth}{!}{% 0.8\textwidth is the target width
  \resizebox{!}{1cm}{% 1cm is arbitrary
    \includegraphics[height=10cm,width=4cm]{example-image}%
  }%
  \resizebox{!}{1cm}{%
    \renewcommand{\arraystretch}{0}%
    \begin{tabular}[b]{@{}c@{}}
    \includegraphics[height=6cm,width=8cm]{example-image}\\
    \includegraphics[height=3cm,width=8cm]{example-image}
    \end{tabular}%
  }%
}

\caption{Three images}

\end{figure}

\end{document}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.