lvjr / tabularray

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

The longtblr environment doesn't work well in beamer frame #466

Open cqc717 opened 10 months ago

cqc717 commented 10 months ago

\documentclass[10pt,aspectratio=169]{beamer}

\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{color}
\usepackage{xcolor}

\usepackage{array}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}

\begin{document}
\author{C.}
\title{}
%\subtitle{}
%\logo{}
\institute{}
\date{\today}
%\subject{}
%\setbeamercovered{transparent}
%\setbeamertemplate{navigation symbols}{}
\begin{frame}[plain]
    \maketitle
\end{frame}

\section{The Model}

\begin{frame}[allowframebreaks]{The Model}

test

%
\begin{longtblr}
    [caption = {Characterization of Advertisers' Profits When \textcolor{red}{$b_i>b_j$}},
     label   = {tab_budget},
     entry = {Short Caption},
    ]
    {
             colspec = {Q[c,m, 0.23\linewidth] Q[c,m] Q[c,m]},
             colsep = 2mm,
             row{1} = {font=\bfseries, bg=gray!50},
             row{odd[2]} = {bg=gray!10},
             font=\tiny
             }
    \toprule
%\SetRow{}
  Scenario         
& Conditions on Budgets
& Advertiser' Profits
\\
    \midrule
  {Both are non-depleted\\ 
  $(t_i, t_j = 1)$
  }        
& {$B_i > \sigma b_j$ \\ 
   $B_j > r$
  }
& {$\Pi_i = \sigma(\pi_i-b_j)$ \\ 
   $\Pi_j = \pi_j-r$
  } 
\\
 {Only $B_i$ is depleted\\ $(t_i<1=t_j)$
 }
& {$B_i < \sigma b_j$ \\ 
   $B_j \geq \frac{B_i}{\sigma b_j} r + \left(1-\frac{B_i}{\sigma b_j}\right) \sigma r$
  } 
& {$\Pi_i = \frac{(\pi_i-b_j)B_i}{b_j}$ \\ 
   $\Pi_j = \frac{B_i}{\sigma b_j} \left(\pi_j-r\right) + \left(1-\frac{B_i}{\sigma b_j}\right) \sigma \left(\pi_j-r\right)$
  }
\\
 {Only $B_j$ is depleted\\ $(t_j<1=t_i)$
 }
& {$B_i \geq \sigma b_j \frac{B_j}{r} + \left( 1 - \frac{B_j}{r} \right) \sigma r $ \\ 
   $B_j < r$
  }
& {$\Pi_i= \sigma \frac{B_j}{r} \left( \pi_i -b_j \right) + \left( 1 - \frac{B_j}{r} \right) \sigma \left( \pi_i -r \right) $ \\
   $\Pi_j=  \frac{B_j}{r}\left(\pi_j-r\right)$}
\\
 {Both are depleted and $B_i$ is depleted sooner\\
  $(t_i \leq t_j \leq 1)$
  }
& {$B_i \leq \sigma b_j$, $B_j \geq \frac{B_i r}{\sigma b_j}$\\ 
  $\frac{B_i}{\sigma b_j}+\frac{B_j-\frac{B_i r}{\sigma b_j}}{\sigma r} \leq 1$}
& {$\Pi_i=\frac{\left(\pi_i-b_j\right) B_i}{b_j}$\\
   $\Pi_j=\frac{\left(\pi_j-r\right) B_j}{r}$}
\\
  {Both are depleted and $B_j$ is depleted sooner\\
    $(t_j \leq t_i \leq 1)$}
& {$B_i>\frac{B_j \sigma b_j}{r}$, $B_j<r$\\
   $\frac{B_j}{r}+\frac{B_i-\frac{B_j \sigma b_j}{r}}{\sigma r} \leq 1$}
& {$\Pi_i=\frac{B_j \sigma\left(\pi_i-b_j\right)}{r}+\frac{B_i-\frac{B_j \sigma b_j}{r}}{r}\left(\pi_i-r\right)$\\
   $\Pi_j=\frac{\left(\pi_j-r\right) B_j}{r}$}
\\
    \bottomrule
\end{longtblr}

text

\end{frame}

\end{document}

image

muzimuzhi commented 10 months ago

According to https://tex.stackexchange.com/a/665959, one workaround is to break longtblr manually with \pagebreak.