1

Using one of the following codes from the answers of this question, how to add comments inside a frame (with specific background and foreground colours) which appear on certain slides (i.e. referring to certain circles) in specific locations.

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\usetikzlibrary{overlay-beamer-styles}
\usepackage{pgfplots}
\usepackage{tkz-fct}
\usetikzlibrary{fadings}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{}
\begin {center}
\begin{tikzpicture}[scale=.9, transform shape, remember picture,overlay]
\node[visible on=<{2,6}>,circle, outer color=yellow!60!green, inner color=white, minimum width=5cm] (center) at (current page.center) {};
\fill[visible on=<{2,6}>,pattern=dots,pattern color = black] ($(current page.center)+(-0.4,-0.4)$) rectangle + (0.8,0.8);
\node[visible on=<{5-6}>,circle, outer color=green!80!purple, inner color=purple, minimum width=4cm] (center) at (current page.center) {};
\node[visible on=<{4-6}>,circle, outer color=purple, inner color=purple!20!red, minimum width=3cm] (center) at (current page.center) {};
\node[visible on=<{3-6}>,circle, outer color=purple, inner color=purple!50!black, minimum width=2cm] (center) at (current page.center) {};
\end{tikzpicture}
\end {center}
\end{frame}


\begin{frame}[fragile,t]
\frametitle{}
\begin {center}
\begin{tikzpicture}[scale=.9, transform shape]
\node[visible on=<{2,6}>,circle, outer color=yellow!60!green, inner color=white, minimum width=5cm] (radial) at (4,0) {};
\fill[visible on=<{2,6}>,pattern=dots,pattern color = black] (3.6,-.4) -- + +(.8,0) -- ++ (0,.8) -- ++(-.8,0) -- cycle;
\node[visible on=<{5-6}>,circle, outer color=green!80!purple, inner color=purple, minimum width=4cm] (radial) at (4,0) {};
\node[visible on=<{4-6}>,circle, outer color=purple, inner color=purple!20!red, minimum width=3cm] (radial) at (4,0) {};
\node[visible on=<{3-6}>,circle, outer color=purple, inner color=purple!50!black, minimum width=2cm] (radial) at (4,0) {};
\end{tikzpicture}
\end {center}
\end{frame}
\end{document}

I tried the following primitive very limited code but with no success.

\vspace {-8.2cm}
\hspace {7.6cm}
\framebox[visible on=<{2,6}>]{blablabla blablabla blablabla blablabla} \par
Hany
  • 4,709
  • 1
    \framebox is not a TikZ command, so the aobs magic does not work here. You could simply try \only here. –  Jul 29 '18 at 13:17
  • I would like to control the background and foreground colours, and the location of the comment – Hany Jul 29 '18 at 13:31
  • 1
    You can do all that with the second solution in my answer below. If you add e.g. fill=yellow to the node, it has a yellow background, and of course you can change the location. –  Jul 29 '18 at 13:43

2 Answers2

1

Since you have two slides, I present two possible ways of adding the annotation. First with \only and then with the beamer-overlay-styles library. I'm glad to see you are using the latter, and I personally find it also more elegant.

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\usetikzlibrary{overlay-beamer-styles}
\usepackage{pgfplots}
\usepackage{tkz-fct}
\usetikzlibrary{fadings}
\begin{document}
\begin{frame}[fragile,t]
\frametitle{}
\begin{center}
\begin{tikzpicture}[scale=.9, transform shape, remember picture,overlay]
\node[visible on=<{2,6}>,circle, outer color=yellow!60!green, inner color=white, minimum width=5cm] (center) at (current page.center) {};
\fill[visible on=<{2,6}>,pattern=dots,pattern color = black] ($(current page.center)+(-0.4,-0.4)$) rectangle + (0.8,0.8);
\node[visible on=<{5-6}>,circle, outer color=green!80!purple, inner color=purple, minimum width=4cm] (center) at (current page.center) {};
\node[visible on=<{4-6}>,circle, outer color=purple, inner color=purple!20!red, minimum width=3cm] (center) at (current page.center) {};
\node[visible on=<{3-6}>,circle, outer color=purple, inner color=purple!50!black, minimum width=2cm] (center) at (current page.center) {};
\end{tikzpicture}
\only<2,6>{\vspace {-8.2cm}
\hspace {5.6cm}
\framebox{blablabla blablabla blablabla blablabla} 
}
\end{center}
\end{frame}


\begin{frame}[fragile,t]
\frametitle{}
\begin{center}
\begin{tikzpicture}[scale=.9, transform shape]
\node[overlay,visible on=<{2,6}>] at (8,2) {marmots always smell good};
\node[visible on=<{2,6}>,circle, outer color=yellow!60!green, inner color=white, minimum width=5cm] (radial) at (4,0) {};
\fill[visible on=<{2,6}>,pattern=dots,pattern color = black] (3.6,-.4) -- + +(.8,0) -- ++ (0,.8) -- ++(-.8,0) -- cycle;
\node[visible on=<{5-6}>,circle, outer color=green!80!purple, inner color=purple, minimum width=4cm] (radial) at (4,0) {};
\node[visible on=<{4-6}>,circle, outer color=purple, inner color=purple!20!red, minimum width=3cm] (radial) at (4,0) {};
\node[visible on=<{3-6}>,circle, outer color=purple, inner color=purple!50!black, minimum width=2cm] (radial) at (4,0) {};
\end{tikzpicture}
\end{center}
\end{frame}
\end{document}

EDIT: As for your comments: I would only use the beamer-overlay-styles solution, and I put the radial node at the center of the page, and avoid overwriting its definition. And I add a background to the node.

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\usetikzlibrary{overlay-beamer-styles}
\usepackage{pgfplots}
\usepackage{tkz-fct}
\usetikzlibrary{fadings}
\begin{document}

\begin{frame}[fragile,t]
\frametitle{Annotations with \texttt{beamer-overlay-styles}}
\begin{center}
\begin{tikzpicture}[scale=.9, transform shape]
\node[visible on=<{2,6}>,circle, outer color=yellow!60!green, inner color=white,
minimum width=5cm] (radial) at (current page.center) {};
\fill[visible on=<{2,6}>,pattern=dots,pattern color = black] 
(radial) -- ++ (-0.4,-0.4) -- ++(.8,0) -- ++ (0,.8) -- ++(-.8,0) 
-- ++(0,-0.8);
\node[visible on=<{5-6}>,circle, outer color=green!80!purple, inner
color=purple, minimum width=4cm] at (radial) {};
\node[visible on=<{4-6}>,circle, outer color=purple, inner color=purple!20!red,
minimum width=3cm] at (radial) {};
\node[visible on=<{3-6}>,circle, outer color=purple, inner
color=purple!50!black, minimum width=2cm] (radial) at (radial) {};
\node[overlay,visible on=<{2,6}>,fill=yellow] at ([xshift=3cm,yshift=2.4cm]radial)  {marmots always smell good};
\end{tikzpicture}
\end{center}
\end{frame}
\end{document}

enter image description here

EDIT: Added screen shot.

  • Thank you very much. This is exactly what I need. The overlay solution gives better control. Just one more comment please, can the framebox foreground and background colours be controlled (in case I use it in other situations). – Hany Jul 29 '18 at 13:46
  • In the overlay solution, using (center) at (current page.center) {}; instead of (radial) at (4,0) {}; centers the drawings horizontally; How can they be also centered vertically on the slides. – Hany Jul 29 '18 at 14:01
  • From Zarko answer, I`ve got the idea of applying \begin{frame}[fragile,c] to align the drawings vertically. Thank you – Hany Jul 29 '18 at 14:16
1

with you of accepted answer to your previous question and different option for frame content align:

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{tikz}
\usetikzlibrary{calc, fadings, patterns,
                overlay-beamer-styles}

\begin{document}
\begin{frame}[fragile,b]  % <---
\frametitle{Circles \dots}
\begin{tikzpicture}[remember picture,overlay,
circ/.style args = {#1/#2/#3}{circle,outer color=#1, inner color=#2, minimum width=#3},
                    ]
\only<1,5>{\node[circ=yellow!60!green/white/5cm] (center) at (current page.center) {};
           \fill[pattern=dots,pattern color = black]
           ($(current page.center)+(-0.4,-0.4)$) rectangle + (0.8,0.8); }
\only<4-5>{\node[circ=green!80!purple/purple/4cm] at (center) {}; }
\only<3-5>{\node[circ=purple/purple!20!red/3cm]   at (center) {}; }
\only<2-5>{\node[circ=purple/purple!50!black/2cm] at (center) {}; }
\end{tikzpicture}
\only<2,6>{\hspace*{44mm}% <---
            \framebox{blablabla blablabla blablabla blablabla}}
\end{frame}
\end{document}
Zarko
  • 296,517