3

I'm encountering a little problem with tabularray and beamer. Here is a working example:

\documentclass{beamer}

\usepackage{tabularray}
\begin{document}

\begin{frame}
    \frametitle{TEST}

    \begin{tblr}{colspec={cc}}
        \visible<+(1)->{Test} & \visible<+(1)->{Test} \\
        \visible<+(1)->{Test} & \visible<+(1)->{Test} \\
    \end{tblr}

\end{frame}
\end{document}

When compiled, it should result in FIVE frames. The first frame has nothing, the second one has the first Test word, the third has two words, and so on...

But this results in 25 frames !

I tried to identified where the problem is... so here are a couple of "research"

  • If I change tabularray to tabular, it is working correctly
  • If I change the overlay values to <2->, <3->, etc... as below, it is working correctly.
\documentclass{beamer}

\usepackage{tabularray}
\begin{document}

\begin{frame}
    \frametitle{TEST}

    \begin{tblr}{colspec={cc}}
        \visible<2->{Test} & \visible<3->{Test} \\
        \visible<4->{Test} & \visible<5->{Test} \\
    \end{tblr}

\end{frame}
\end{document}

Finally, I tried to include a counter, just to try to understand:

\documentclass{beamer}

\usepackage{tabularray}

\newcounter{mycountertest}
\setcounter{mycountertest}{2}

\newcommand{\showNumber}{\arabic{mycountertest}\stepcounter{mycountertest}}

\begin{document}

\begin{frame}
    \frametitle{TEST}

    \begin{tblr}{colspec={cc}}
        \visible<1->{Test \showNumber} & \visible<3->{Test \showNumber} \\
        \visible<4->{Test \showNumber} & \visible<5->{Test \showNumber} \\
    \end{tblr}

\end{frame}
\end{document}

And the first time Test appears, is for a counter value of... 25 ! On the final slide, the counter is set to 120!

Is there a way to counter this problem ? I know I can use tabular or eventually tabularx, but I'm using tabularray for other features...

Thanks for your help!

3
  • I suspect that there might be some subtle incompatibilities between tabularray and beamer since the two packages are both pushing LaTeX's parsing to its limits in different ways.
    – Don Hosek
    Commented Sep 23, 2021 at 14:13
  • 1
    @DonHosek it is not beamer, you get the same with article. tabularray processes the cells more than once but doesn't reset the counters. This looks like a clear bug to me. Commented Sep 23, 2021 at 15:47
  • I added an issue github.com/lvjr/tabularray/issues/116 Commented Sep 23, 2021 at 16:06

1 Answer 1

5

The counter problem was solved several days ago: I have added counter library to tabularray package for resetting LaTeX counters when needed. You may download the latest package file from here or wait for version 2021P scheduled on 2021-10-01.

\documentclass{beamer}

\usepackage{tabularray}

\UseTblrLibrary{counter} %% added this line

\begin{document}

\begin{frame}
    \frametitle{TEST}

    \begin{tblr}{colspec={cc}}
        \visible<+(1)->{Test} & \visible<+(1)->{Test} \\
        \visible<+(1)->{Test} & \visible<+(1)->{Test} \\
    \end{tblr}

\end{frame}
\end{document}

enter image description here

See also tabularray with inserted subfloats: why counter "subfigure" doesn't start from "1" (or "a")

1
  • Thanks! That's perfect !
    – Basil Gass
    Commented Sep 24, 2021 at 6:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .