Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{beamer}
- usepackage{booktabs}
- begin{document}
- begin{frame}{Example}
- begin{tabular}{ll}
- toprule
- bla & bla \
- midrule
- A & A \
- B & B \
- only<1>{%
- midrule
- C & C \
- D & D \ }
- bottomrule
- end{tabular}
- only<2>{Something else}
- end{frame}
- end{document}
- documentclass{beamer}
- usepackage{booktabs}
- begin{document}
- begin{frame}{Example}
- begin{tabular}{ll}
- toprule
- bla & bla \
- midrule
- A & A \
- B & B %
- only<1>{%
- \midrule
- C & C %
- }%
- only<2>%
- {%
- \
- D & D %
- }%
- \ bottomrule
- end{tabular}
- end{frame}
- end{document}
- begin{frame}{Example}
- only<1>{begin{tabular}{ll}
- toprule
- bla & bla \
- midrule
- A & A \
- B & B \
- midrule
- C & C \
- D & D \
- bottomrule
- end{tabular}
- }
- only<2->{begin{tabular}{ll}
- toprule
- bla & bla \
- midrule
- A & A \
- B & B \
- bottomrule
- end{tabular}
- }
- only<2>{Something else}
- end{frame}
- documentclass{beamer}
- usepackage{booktabs}
- % ------- xalt -------
- makeatletter
- providecommand@secondofthree[3]{#2}
- defxalt<#1>{%
- if *#1%
- % matches any overlay
- expandafter @secondofthree
- else
- % continue overlay check
- expandafter @firstofone
- fi
- {@xalt@checkrange<#1->}%
- }
- def@xalt@checkrange<#1-#2>{%
- ifx relax#2relax
- % is not a range
- expandafter @firstoftwo
- else
- % is a range
- expandafter @secondoftwo
- fi
- {@xalt@checknumber<#1>}%
- {@xalt@checklower<#1-#2>}%
- }
- def@xalt@checknumber<#1>{%
- ifnum beamer@slideinframe=#1
- % overlay is matched
- expandafter @firstoftwo
- else
- % overlay is *not* matched
- expandafter @secondoftwo
- fi
- }
- def@xalt@checklower<#1-#2>{%
- ifx relax#1relax
- % lower bound not given => match
- expandafter @firstofone
- else ifnum beamer@slideinframe<#1
- % overlay is *not* matched
- expandafterexpandafterexpandafter @thirdofthree
- else
- % lower bound is matched
- expandafterexpandafterexpandafter @firstofone
- fi fi
- {@xalt@checkupper<-#2>}%
- }
- % #2 ends with an additional -
- def@xalt@checkupper<-#1->{%
- ifx relax#1relax
- % upper bound not given => match
- expandafter @firstoftwo
- else ifnum beamer@slideinframe>#1
- % overlay is *not* matched
- expandafterexpandafterexpandafter @secondoftwo
- else
- % upper bound is matched
- expandafterexpandafterexpandafter @firstoftwo
- fi fi
- }
- makeatother
- % ------- toprule -------
- letoriginaltoprule=toprule
- defoverlayawaretoprule<#1>{%
- xalt<#1>%
- {toprule}%
- {addlinespace[dimexpr abovetopsep + heavyrulewidth + belowrulesep relax]}%
- }
- renewcommand{toprule}[1]{%
- ifx <#1%
- expandafter overlayawaretoprule
- else
- expandafter originaltoprule
- fi
- #1%
- }
- % ------- midrule -------
- letoriginalmidrule=midrule
- defoverlayawaremidrule<#1>{%
- xalt<#1>%
- {midrule}%
- {addlinespace[dimexpr aboverulesep + lightrulewidth + belowrulesep relax]}%
- }
- renewcommand{midrule}[1]{%
- ifx <#1%
- expandafter overlayawaremidrule
- else
- expandafter originalmidrule
- fi
- #1%
- }
- % ------- bottomrule -------
- letoriginalbottomrule=bottomrule
- defoverlayawarebottomrule<#1>{%
- xalt<#1>%
- {bottomrule}%
- {addlinespace[dimexpr aboverulesep + heavyrulewidth + belowbottomsep relax]}%
- }
- renewcommand{bottomrule}[1]{%
- ifx <#1%
- expandafter overlayawarebottomrule
- else
- expandafter originalbottomrule
- fi
- #1%
- }
- % ------- test document -------
- begin{document}
- begin{frame}{Example}
- begin{table}
- begin{tabular}{ll}
- toprule
- bla & bla \
- midrule
- A & A \
- B & B \
- midrule<2->
- uncover<2->{C & C} \
- uncover<2->{D & D} \
- bottomrule
- end{tabular}
- end{table}
- uncover<3->{Something else}
- end{frame}
- end{document}
- defxonly<#1>#2{xalt<#1>{#2}{}}
- begin{document}
- begin{frame}{Example}
- begin{table}
- begin{tabular}{ll}
- toprule
- bla & bla \
- midrule
- A & A \
- B & B \
- xonly<2->{midrule}
- xonly<2->{C & C \}
- xonly<2->{D & D \}
- bottomrule
- end{tabular}
- end{table}
- only<3->{Something else}
- end{frame}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement