lvjr / tabularray

Typeset tabulars and arrays with LaTeX3
https://ctan.org/pkg/tabularray
247 stars 22 forks source link

Beamer overlays with \SetRow #429

Closed dmort27 closed 10 months ago

dmort27 commented 10 months ago

Thank you for creating tabularray, one of my top-four LaTeX packages of all time!

I would like to animate the styling of a tblr using beamer overlays. Something like this:

\begin{tblr}{ccc}
  \onslide<2->{\SetRow{cyan7}} 1 & 2 & 3\\
  4 & 5 & 6\\
\end{tblr}

I want the first row to have a cyan background on the second slide displaying the table, but not the first. However, this does not seem to work. I have also tried the beamer \only command, with the same result. Is there currently a way of achieving this? If not, is there any plan to add such a feature?

muzimuzhi commented 10 months ago

This seems to work.

\documentclass{beamer}
\usepackage{tabularray}

\NewTableCommand{\beamerTemporal}[4]{\temporal<#1>{#2}{#3}{#4}}

\begin{document}
\begin{frame}
  \begin{tblr}{ccc}
    \beamerTemporal{2-}{}{\SetRow{cyan7}}{} 1 & 2 & 3 \\
    4 & 5 & 6 \\
  \end{tblr}
\end{frame}
\end{document}

image

is there any plan to add such a feature?

According to #54 and #226, no tabularray has no plan to provide (built-in) support for beamer overlays.

dmort27 commented 10 months ago

Thank you very much! This solves my problem.