Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using a table in my presentation and it is ordered by date but I want some major dates to be visible on the first slide and all other dates to become visible slide by slide.

I thought it would be a nice way to define a command:

\newcounter{coveredRows}
\newcommand{\uncoverrowauto}[3]{
    \addtocounter{coveredRows}{1}
    \uncoverrow{\value{coveredRows}-}{#1}{#2}{#3}
}
\newcommand{\uncoverrow}[4]{
    \uncover<#1>{#2} & \uncover<#1>{#3} & \uncover<#1>{#4}\\
}

And I would like to have a table like this:

..      
11.06. & ..begin.. & 24\\
\uncoverrowauto{11.06.}{begin subtask1}{24}
\uncoverrowauto{22.06.}{end subtask1}{25}
25.06.& ..mile stone.. & 26\\
\uncoverrowauto{25.06.}{begin subtask2}{26}
\uncoverrowauto{29.06.}{end subtask2}{26}
..

So it could become a big table and I am lazy so I would like to auto increment the counter when the rows are uncovered. Unfortunately this doesn't work, it compiles infinite number of slides.

Is there a nice solution for my wish or is the only way to define the slide manually where the different rows are uncovered?

EDIT As mentioned by David, here is a full example of what I have:

\documentclass{beamer}

\begin{document}

\begin{frame}
    \titlepage
\end{frame}

\begin{frame}
    \frametitle{Outline}
    \tableofcontents
\end{frame}

\section{Plan}

    \newcounter{coveredRows}
    \setcounter{coveredRows}{1}
    \newcommand{\uncoverrowauto}[3]{
        \addtocounter{coveredRows}{1}
        \uncoverrow{\value{coveredRows} -}{#1}{#2}{#3}
    }
    \newcommand{
        \uncoverrow}[4]{\uncover<#1>{#2} & \uncover<#1>{#3} & \uncover<#1>{#4}\\
    }

\begin{frame}
    \frametitle{Plan}
    \framesubtitle{Dates}

    \centering
    \begin{tabular}{| c l c |}
        \hline
        Date    & Explanation & Week\\
        \hline\hline
        11.06. & Begin of work & 24\\
        \uncoverrowauto{11.06.}{Begin of subtask one}{24}
        \uncoverrowauto{22.06.}{End of subtask one}{25}
        25.06.& Mile stone of work & 26\\
        \uncoverrowauto{25.06.}{Begin of subtask two}{26}
        \uncoverrowauto{29.06.}{End of subtask two}{26}
        \uncoverrowauto{02.07.}{Begin of subtask three}{27}
        \uncoverrowauto{30.07.}{Begin of subtask four}{31}
        \uncoverrowauto{03.08.}{End of subtask four}{31}
        \uncoverrowauto{17.08.}{End of subtask three}{33}
        \uncoverrowauto{24.08.}{Planned end of work}{34}
        03.09. & End of work & 36\\
        \hline
    \end{tabular}

\end{frame}
\end{document}
share|improve this question
3  
You improve your chances of an answer by providing a complete example (never mind that it does not work yet) rather than isolated fragments. That way, anybody willing to invest some time for an answer just needs to "make it work" (TM) rather than waste her creative energy on writing up a whole example all by herself. –  user9588 Jun 6 '12 at 9:23
    
I have a suspicion that the answer will be to put \resetcounteronoverlays{coveredRows} in the preamble, but as David says: without a fully compilable example it's hard to test if this is going to do what you want or not. –  Loop Space Jun 6 '12 at 9:46
    
Thanks for your comments! I didn't think about that. I will provide a complete example for further readers. But the answer of Andrew seems to do the thing. –  Bertram Nudelbach Jun 6 '12 at 10:02
add comment

1 Answer

up vote 3 down vote accepted

Here is the full solution, that was mentioned by Andrew. Thanks!!

\documentclass{beamer}

\resetcounteronoverlays{coveredRows}

\begin{document}

\begin{frame}
    \titlepage
\end{frame}

\begin{frame}
    \frametitle{Outline}
    \tableofcontents
\end{frame}

\section{Plan}

    \newcounter{coveredRows}
    \setcounter{coveredRows}{1}
    \newcommand{\uncoverrowauto}[3]{%
        \addtocounter{coveredRows}{1}%
        \uncoverrow{\value{coveredRows} -}{#1}{#2}{#3}
    }
    \newcommand{%
        \uncoverrow}[4]{\uncover<#1>{#2} & \uncover<#1>{#3} & \uncover<#1>{#4}\\
    }

\begin{frame}
    \frametitle{Plan}
    \framesubtitle{Dates}

    \centering
    \begin{tabular}{| c l c |}
        \hline
        Date    & Explanation & Week\\
        \hline\hline
        11.06. & Begin of work & 24\\
        \uncoverrowauto{11.06.}{Begin of subtask one}{24}
        \uncoverrowauto{22.06.}{End of subtask one}{25}
        25.06.& Mile stone of work & 26\\
        \uncoverrowauto{25.06.}{Begin of subtask two}{26}
        \uncoverrowauto{29.06.}{End of subtask two}{26}
        \uncoverrowauto{02.07.}{Begin of subtask three}{27}
        \uncoverrowauto{30.07.}{Begin of subtask four}{31}
        \uncoverrowauto{03.08.}{End of subtask four}{31}
        \uncoverrowauto{17.08.}{End of subtask three}{33}
        \uncoverrowauto{24.08.}{Planned end of work}{34}
        03.09. & End of work & 36\\
        \hline
    \end{tabular}

\end{frame}
\end{document}

The only thing is, that now the first cell of the rows have a leading space. Therefore I personally would remove the whitespaces in the definition of the two commands. But I'm not sure, if there's a better way, without destroying formatting.

EDIT

I inserted % in the sample above to solve the problem with leading spaces.

share|improve this answer
2  
Whitespaces can be removed by judicious placement of percent-signs. Try putting % at the end of each line in your new commands. –  Loop Space Jun 6 '12 at 10:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.