I was working on a presentation and had to place several logos at the end of a slide. Initially, I just added them using includegraphics
. However, it looked terrible because each logo was of a different size. Obviously, I wanted to arrange them at least half-decently. For that, I aligned them vertically and added some space between each logo.
Vertical alignment
Here, the adjustbox package, together with graphicx, provides a handy solution. The option valign=c
(center) worked nicely in my case. In another case, valign=t
(top) might look better.
%Preamble \usepackage[export]{adjustbox} %Document \includegraphics[width=2cm,valign=c]{logo1}
Horizontal alignment
To align the logos horizontally, I added \hfill
commands between each figure. This will divide whitespace equally between figures.
\includegraphics{logo1}\hfill\includegraphics{logo2}
An additional \hfill
before and after adds extra space to the left and right of the logo chain.
Complete code example
\documentclass[11pt]{article} \usepackage[export]{adjustbox} \begin{document} \hfill\includegraphics[width=2cm,valign=c]{logo1} \hfill\includegraphics[width=2cm, valign=c]{logo2} \hfill\includegraphics[width=2cm, valign=c]{logo3} \hfill\includegraphics[width=2cm, valign=c]{logo4}\hspace*{\fill} \end{document}
Jim Ratliff
Tom, I think you’ll find that your last \hfill isn’t doing anything, because its space is getting gobbled up due to its position at the end of the line. (See, e.g., “What is the difference between \hspace*{\fill} and \hfill?,” TeX Stack Exchange, https://tex.stackexchange.com/questions/45948/what-is-the-difference-between-hspace-fill-and-hfill )
If you replace that last \hfill with \hspace*{\fill} you’ll see the difference.
tom
Hi Jim,
Thanks for pointing this out to me, I appreciate it. I updated the code.
Best, Tom