3

I created the following table:

\begin{columns}[c] \begin{column}{7.5cm} \begin{table}[ht] \small \centering \caption{Test table} \begin{tabular}{ll} \midrule A &$a \sim \qty{e6}{m}$\\ B &$b \sim \qty{e-4}{s^{-1}}$\\ C &$c \sim \qty{e8}{m.s^{-2}}$\\ \begin{rcases} \textnormal{D}\\ \textnormal{E}\\ \end{rcases} &$d \sim \qty{e2}{K}$\\ F &$f = \qty{e-3}{m^2.s^{-2}.K}$\\ \bottomrule \end{tabular} \end{table} \end{column} \hspace{7.5cm} \end{columns} 

I would like to add a bracket to the right side of the table as shown in the screenshot and I would like to place a text next to the bracket containing several quantities.

enter image description here

I found other questions on that topic, but I could not use them for my specific example. Do you know how I could do it?

EDIT:

\documentclass[serif,10pt, aspectratio=169]{beamer} \usepackage{booktabs} % package for table \usepackage{siunitx} % package for units and numbers \usepackage{mathtools} \usepackage[singlelinecheck=false]{caption} \begin{document} \section{Section1} \frame{{title}{} \begin{columns}[c] \begin{column}{7.5cm} \begin{table}[ht] \small \centering \caption{Test table} \begin{tabular}{ll} \midrule A &$a \sim \qty{e6}{m}$\\ B &$b \sim \qty{e-4}{s^{-1}}$\\ C &$c \sim \qty{e8}{m.s^{-2}}$\\ \begin{rcases} \textnormal{D}\\ \textnormal{E}\\ \end{rcases} &$d \sim \qty{e2}{K}$\\ F &$f = \qty{e-3}{m^2.s^{-2}.K}$\\ \bottomrule \end{tabular} \end{table} \end{column} \hspace{7.5cm} \end{columns} } \end{document} 
2
  • 1
    Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for the users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Commented Nov 9, 2023 at 9:30
  • I am sorry, I have not thought about that! Latex is still new to me. I added additional comments. Does that help? Commented Nov 9, 2023 at 9:44

2 Answers 2

3
  • the serif class option is deprecated. Use \usefonttheme{serif} instead (this will also avoid the warning in the log file about this)

  • rcases needs to be in math mode. Please don't ignore error messages.

  • floating specifier like [ht] don't make a lot of sense in a document class without floating mechanism

  • you don't need \centering, tables are automatically centred in beamer

  • you could use the tabularray package to create a table with a large brace on the right hand side:


\documentclass[10pt, aspectratio=169]{beamer} \usefonttheme{serif} \usepackage{booktabs} % package for table \usepackage{siunitx} % package for units and numbers \usepackage{mathtools} %\usepackage[singlelinecheck=false]{caption} \usepackage{tabularray} \UseTblrLibrary{amsmath,booktabs} \begin{document} \section{Section1} \begin{frame} \frametitle{title} \begin{table} \small \caption{Test table} \begin{+array}{ delimiter = {right=\rbrace, left=.}, column{2} = {mode={imath}} } \midrule A & a \sim \qty{e6}{m}\\ B & b \sim \qty{e-4}{s^{-1}}\\ C & c \sim \qty{e8}{m.s^{-2}}\\ $\begin{rcases} \text{D}\\ \text{E}\\ \end{rcases}$ & d \sim \qty{e2}{K}\\ F & f = \qty{e-3}{m^2.s^{-2}.K}\\ \bottomrule \end{+array} Description \end{table} \end{frame} \end{document} 

enter image description here

2
  • This is prefect, thank you so much! Commented Nov 9, 2023 at 10:46
  • @Sylvia You're welcome! Commented Nov 9, 2023 at 10:46
3

Use the current recommended syntax:

  • \usefonttheme{serif} rather than the option serif
  • \begin{frame}...\end{frame} rather than \frame{...}

Next you can use nicetabular.

\documentclass[10pt, aspectratio=169]{beamer} \usefonttheme{serif} \usepackage{booktabs} % package for table \usepackage{siunitx} % package for units and numbers \usepackage{nicematrix} \usepackage[singlelinecheck=false]{caption} \begin{document} \section{Section1} \begin{frame} \frametitle{title} \begin{columns}[c] \begin{column}{7.5cm} \begin{table}[ht] \small \centering \caption{Test table} \begin{NiceTabular}{@{} l l @{}} \toprule A &$a \sim \qty{e6}{m}$ \\ B &$b \sim \qty{e-4}{s^{-1}}$\\ C &$c \sim \qty{e8}{m.s^{-2}}$\\ D & \Block{2-1}{$d \sim \qty{e2}{K}$} \\ E & \\ F &$f = \qty{e-3}{m^2.s^{-2}.K}$\\ \bottomrule \CodeAfter\SubMatrix.{4-1}{5-1}\}\SubMatrix.{1-2}{6-2}\} \end{NiceTabular} $\quad\begin{matrix} x \\ y \\ z \end{matrix}$ \end{table} \end{column} \hspace{7.5cm} \end{columns} \end{frame} \end{document} 

enter image description here

2
  • This is a beautiful solution. However, the description switches from right to bottom when I edit the table entries. Did that occur to you? Commented Nov 9, 2023 at 10:34
  • @Sylvia I guess you don't want the description on the side or to increase the allotted width. Commented Nov 9, 2023 at 11:01

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.