3

I would like to display the different lines of an array, using overlays. However I have trouble with the \hline command which seems to include an carriage return. Here is a minimal example, I guess what I want is quite obvious: the same result without the first | on the new line

\documentclass{beamer}
\mode<presentation>
\begin{document}
\begin{frame}
$$\begin{array}{|c|c|c|}
\hline \mbox{first line} & bla&bla \\
\hline\pause 
\visible<2->{\mbox{second line} & bla & bla \\
\hline}\pause
\mbox{third line} & bla &bla
\\ \hline
\end{array}$$
\end{frame}
\end{document}
user42070
  • 342

1 Answers1

3

Don't use $$, use \[...\] instead (for details see this question and answers). You can put \noalign{\pause} at the end. Then \pause is applied just when the one row is finished and before the next row is started. Also, it is better to use \text instead of \mbox as the former is more font friendly.

\documentclass{beamer}
\usepackage{amsmath}
\mode<presentation>
\begin{document}
\begin{frame}
\[\begin{array}{|c|c|c|}
\hline \text{first line} & bla&bla \\
\hline\noalign{\pause}
\text{second line} & bla & bla \\
\hline\noalign{\pause}
\text{third line} & bla &bla
\\ \hline
\end{array}\]
\end{frame}
\end{document}

enter image description here

  • Thanks a lot, perfect. And yes I realised after that I did use the good old $$.. $$. Greetings – user42070 Apr 15 '15 at 13:19
  • by the way how people do this litlle preview of pdf ? i was not able to do that for my question... (did not look that much). – user42070 Apr 15 '15 at 13:21
  • thanks as well for your remark on \text instead of \mbox. I did learn qui some with my question :). – user42070 Apr 15 '15 at 13:23
  • 1
    @user42070 I converted the obtained pdf in to gif using imagemagick and uploaded it. –  Apr 15 '15 at 13:28