1

I am writing my thesis presentation using beamer template. I would like to create the following thing:

  • slide 1 -> shows a simple image
  • slide 2 -> shows a different image with a bullet list positioned where i want
  • slide 3 -> same as slide 2

I have red that this can be done by using tikz, but i don't seem to understand how it works. I have used the \only environment for the images and it works, but i need some help for the tikz part. Can any of you give me some tips?

Below the latex code i am working on:

\documentclass{beamer}
\usepackage{amsfonts,amsmath,oldgerm}

\newcommand{\testcolor}[1]{\colorbox{#1}{\textcolor{#1}{test}}~\texttt{#1}}

\usefonttheme[onlymath]{serif}
\usepackage[absolute,overlay]{textpos}
\usepackage{tikz}

\newcommand{\hrefcol}[2]{\textcolor{cyan}{\href{#1}{#2}}}
\begin{document}
\begin{frame}[t]{}
    \only<1>{\begin{tikzpicture}
        \node at (current page.center) {\includegraphics[scale=0.5]{example-image-a}};
    \end{tikzpicture}}
    \only<2->{\begin{tikzpicture}
        {\node at (current page.center) {\includegraphics[scale=0.5]{example-image-a}};
        \node [rectangle, text width=3cm] at (15,9) {\begin{itemize}
 \item item1
 \item item2
 \end{itemize}};
}
\end{tikzpicture}}
\end{frame}

\end{document}

enter image description here

11
  • 1
    Welcome. // Which Tikz part do you mean?
    – MS-SPO
    Commented Jan 20 at 18:35
  • 2
    TikZ is a drawing program/language for LaTeX. You must mean something else as you do not write anything about drawing. Commented Jan 20 at 18:42
  • You don't need the only in your code. It isn't doing anything whatsoever.
    – cfr
    Commented Jan 21 at 0:28
  • To combine text and images with tikz, put text in one node and \includegraphics in another node, and place them where you want them relative to each other. Commented Jan 21 at 4:23
  • 1
    @MS-SPO I added a tentative code using tikz with the resulting output. Moreover i specify the image to be in the center. Why it is aligned at the left side? Commented Jan 21 at 10:34

1 Answer 1

1

If you want to use page nodes like current page.center you have to use the remember picture option.

I'd either combine this with the overlay option or with visible on=... from the overlay-beamer-styles library to prevent other content of the slide from jumping around between overlays.

\documentclass{beamer}
\usepackage{oldgerm}

\usefonttheme[onlymath]{serif}
\usepackage{tikz}

\begin{document}
\begin{frame}[t]{}
   \begin{tikzpicture}[remember picture,overlay]
     \node<1-> at (current page.center) {\includegraphics[scale=0.5]{example-image-a}};
     \node<2->[rectangle, text width=3cm] at (10,-3) {
        \begin{itemize}
           \item item1
           \item item2
         \end{itemize}
     };
\end{tikzpicture}
\end{frame}

\end{document}

enter image description here

6
  • Thank you very much. Now the image is positioned in the center of the slide. Now i am trying to add a bullet list to the image side but it gives me the error: LaTeX Error: Something's wrong--perhaps a missing \item. I edited the original code with the new one. Can you give me some advices? Commented Jan 21 at 11:10
  • @AndreaTantucci See my updated answer Commented Jan 21 at 11:20
  • Ok thank you i will accept this answer. If you can i would like to ask you another question. What i would like to do is to have in the first slide an image centered (example-image-a) for example, while in slide 2 i would like to have example-image-b with the bullet list. I have to create another \begin{}/end{} tikzpicture or i can include everything inside the one i already have? Commented Jan 21 at 11:37
  • @AndreaTantucci If you want image a only on the first overlay, use \node<1> ... and then \node<2-> ... with another image Commented Jan 21 at 11:41
  • ok perfect. Thank you very much for your help! Commented Jan 21 at 11:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .