0

I created a table that is embedded in a beamer presentation:

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

\usepackage{booktabs} % tables
\usepackage{amsmath} % align, 
\usepackage{siunitx} % units, numbers
\usepackage{mathtools}
\usepackage[singlelinecheck=false]{caption}
\usepackage{tabularray}
\UseTblrLibrary{amsmath,booktabs}

\setbeamerfont{caption}{size=\footnotesize}
\setbeamertemplate{caption label separator}[space]

\begin{document}
\begin{frame}{}
    \scriptsize
    \begin{table}
    \captionsetup{font=scriptsize}
        \qquad
        \begin{minipage}{0.342\linewidth}
            \caption{Title}
            \vspace{-1ex}
            \begin{tblr}{hline{1,Z},colspec={@{} l Q[l, mode={math}] @{}},rowsep=1pt}
            A&L\textsubscript{a}=\qty{11}{km}\\
            B&L\textsubscript{b}=\qty{1000}{km}\\
            C&L\textsubscript{c}=\qty{150}{km}\\
            \end{tblr} 
        \end{minipage}
    \end{table}
\end{frame}
\end{document}
  1. How can I add additional columns? (should be 3 rows x 7 columns)
  2. How can I add the column names?
3
  • 1
    Welcome to TeX.SX! Did you consider cosulting the package manual for tabularry? You specify two columns currently, one is text mode, one is math mode. You should describe more specific what kind of additional columns you'd like to add. And why did you tag this question with multicolumn? Commented Nov 14, 2023 at 13:40
  • the package manual was what I was looking for, thank you. Col 1 = textmode (rownames), col2-8 = mathmode. Row 1 = textmode (colnames), row 2-4 = mathmode Commented Nov 14, 2023 at 14:56
  • So, you want 8 columns and 5 rows in total, all cells should be math mode except the topmost row and the leftmost column? Do you care about the sizes (width) of the cells? Commented Nov 14, 2023 at 15:15

1 Answer 1

1

I am not sure how the result should look like, but maybe you want something similiar to this:

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

\usepackage{siunitx} % units, numbers
\usepackage[singlelinecheck=false]{caption}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}

\setbeamerfont{caption}{size=\footnotesize}
\setbeamertemplate{caption label separator}[space]

\begin{document}
\begin{frame}{}
    \scriptsize
    \begin{table}
    \captionsetup{font=scriptsize}
        \qquad
        \begin{minipage}{0.75\linewidth}
            \caption{Title}
            \vspace{-1ex}
            \begin{tblr}{
                colspec={ @{} l *{7}{Q[l, mode={math}]} @{} },
                row{1} = {mode={text}},
                hline{1,Z},
                rowsep=1pt
            }
              & I am in text mode    & & & & & & \\
            A & L_a = \qty{11}{km}   & x & x & x & x & x & x \\
            B & L_b = \qty{1000}{km} & & & & & & \\
            C & L_c = \qty{150}{km}  & & & & & & \\
            \end{tblr} 
        \end{minipage}
    \end{table}
\end{frame}
\end{document}

enter image description here

That is, there are 8 columns and 5 rows in total. All cells are in math mode except for the first row and the first column. Note that the table is most likely wider than the width that you stated for the minipage.

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.