OthersTikZ + Beamer: Placing text immediately under images

Information and discussion about other tools not listed above.
Post Reply
kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

TikZ + Beamer: Placing text immediately under images

Post by kaiserkarl13 »

There are many times when I'm making a beamer-based presentation and I want to include an image that is accompanied, right below it (either centered or left-aligned), by a caption denoting where I got the image. In in-line images, I can work around this with line breaks, but what I really want is something like this:

Code: Select all

\begin{tikzpicture}
  \node (main) at (0,0) {\includegraphics{myimage}};
  \node [below of=main] {My caption};
  \node (second) at (3,0.5) {\includegraphics{myotherimage}};
  \node [below of=second] {My second caption};
\end{tikzpicture}
This will, unfortunately, result in "captions" that overlay the pictures or are too far from them. It works perfectly if I specify [anchor=south west] for the main image and [anchor= north west] for the first caption, but if I try that for the second image, the second caption is right on top of the first one, regardless of what I specify for the second image.

What I'm really trying to do is avoid specifying "node distance=XXX" by trial-and-error or laying out each picture/caption set with exact coordinates (i.e., what I want is to move one and the other moves with it, but they're always right below the images).

Any suggestions?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

TikZ + Beamer: Placing text immediately under images

Post by Stefan Kottwitz »

Hi,

did you solve this challenge in the meantime?

I think it may not be hard. It's just that there was no actual code here, to try, so it was a bit too theoretical for me to answer.

Stefan
LaTeX.org admin
Post Reply