2

I'm customizing a beamer template and would like to insert three images in the title page, all aligned horizontally and equally spaced.

I've been struggling a lot with options for \node but haven't come to a good solution.

I'm using basically

\node[anchor=north west](img1) at (0,\slideheight-0.2cm)
    {\includegraphics[width=.2\textwidth]{img1.png}};

\node[anchor=north west](img2) at (2cm,\slideheight-0.2cm)
    {\includegraphics[width=.2\textwidth]{img2.png}};

And trying to tweak distances, but that is A Very Bad Idea™.

1

Do you really need nodes for this. Just \includegraphics should do the job with few \hfills. However, this can be done with nodes. Place the first node at 0, second at 0.5\textwidth third at \textwidth. Now choose uniform width for nodes by text width which I have set at 0.3333\textwidth. Then select the proper anchor for each node as in the following code and align=center.

\documentclass{beamer}
\usepackage{tikz}
\begin{document}
  \begin{frame}
  X\hrulefill X

  \includegraphics[width=.2\textwidth]{example-image-a}\hfill
  \includegraphics[width=.2\textwidth]{example-image-b}\hfill
  \includegraphics[width=.2\textwidth]{example-image-c}
  \end{frame}
  \begin{frame}
  X\hrulefill X

    \begin{tikzpicture}
      \node[anchor=north west,text width=0.3333\textwidth,align=center](img1) at
           (0,\textheight-0.2cm)
           {\includegraphics[width=0.5\linewidth]{example-image-a}};
     \node[anchor=north,text width=0.3333\textwidth,align=center](img2) at
           (0.5\textwidth,\textheight-0.2cm)
           {\includegraphics[width=0.5\linewidth]{example-image-b}};
     \node[anchor=north east,text width=0.3333\textwidth,align=center](img2) at
           (\textwidth,\textheight-0.2cm)
           {\includegraphics[width=0.5\linewidth]{example-image-c}};
    \end{tikzpicture}
  \end{frame}
\end{document}

enter image description here

  • Thanks! I needed a solution with nodes because the title page has some Tikz customization such as filling most of it with a color. The plain \includegraphics didn't work for me, I really had to use the nodes. – erickrf Oct 31 '15 at 5:36

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.