LaTeX forum ⇒ OthersTikZ + Beamer: Placing text immediately under images

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

TikZ + Beamer: Placing text immediately under images

Postby kaiserkarl13 » Tue Feb 14, 2017 7:59 pm

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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \begin{tikzpicture}
  2. \node (main) at (0,0) {\includegraphics{myimage}};
  3. \node [below of=main] {My caption};
  4. \node (second) at (3,0.5) {\includegraphics{myotherimage}};
  5. \node [below of=second] {My second caption};
  6. \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?


User avatar
Stefan Kottwitz
Site Admin
Posts: 9565
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat May 27, 2017 2:20 pm


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 admin

Return to “Others”

Who is online

Users browsing this forum: No registered users and 2 guests