1

I am trying to draw circles on two cells on Latex beamer then use \pause to mention that. here an example which I want to draw a circle around AA and BB, the mentions shows that BB first then AA.

\documentclass{beamer}


\begin{document}

\begin{frame}
\frametitle{test}

\begin{tabular}{|ccccccc|}
\hline
AA&
B&
C&
BB&
A&
B&
C\\
\hline
\end{tabular}
\end{frame}

\end{document}

May give me a hand, please?

  • does http://tex.stackexchange.com/a/4861/36296 help? – samcarter_is_at_topanswers.xyz May 25 '16 at 09:28
  • I have seen it but I did not manage to add '\pause' to them. – R. Saeiti May 25 '16 at 09:33
  • 1
    Can you draw a sketch, what should be on the first slide etc? At the moment I find it a bit unclear. Should all the cells be there and only the circle added? Or should the cells be overlayed? Instead of \pause, I would rather use \only<>{}, see the beameruserguide.pdf for detailed explanation. – samcarter_is_at_topanswers.xyz May 25 '16 at 22:15
  • You can use tikzmark (which is a package/library providing functions similar to the code in the answer @samcarter linked). But \onslide or \only or similar is definitely the way to go here rather than \pause which is too crude for this. (I'm not sure what you want exactly either, but I'm sure \pause will be too crude.) – cfr May 26 '16 at 00:23

1 Answers1

3

I am still not sure what exactly you mean by "\pause to mention that", so I just guess, that you want the circles to appear stepwise.

Based on Highlighting table cells

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{fit,shapes.geometric}

\newcounter{nodemarkers}
\newcommand<>\circletext[1]{%
    \tikz[overlay,remember picture] 
    \node (marker-\arabic{nodemarkers}-a) at (0,1.5ex) {};%
    #1%
    \tikz[overlay,remember picture]
    \node (marker-\arabic{nodemarkers}-b) at (0,0){};%
    \tikz[overlay,remember picture,inner sep=2pt]
    \node#2[draw,ellipse,fit=(marker-\arabic{nodemarkers}-a.center) (marker-\arabic{nodemarkers}-b.center)] {};%
    \stepcounter{nodemarkers}%
}

\begin{document}

    \begin{frame}
        \frametitle{test}

        \begin{tabular}{|ccccccc|}
            \hline
            \circletext<2->{AA}&
            B&
            C&
            \circletext<3>{BB}&
            A&
            B&
            C\\
            \hline
        \end{tabular}
    \end{frame}

\end{document}

enter image description here