1

In the past, I have used the array package to create a tabulated enumerated list, as in the following example.

\documentclass[11pt]{article}

%%%% Packages and options
\usepackage{mathtools} % extension of amsmath and will load amsmath

\usepackage[letterpaper, hmargin={0.6in, 0.6in}]{geometry}
\setlength{\parindent}{0pt}

%%%% for multiple choice tables
\newcounter{mc}
\newcommand*{\AddLabel}{%
    \stepcounter{mc}%
    \makebox[1.75em][l]{(\Alph{mc})}~%
}%

\usepackage{array}
\newcolumntype{P}[1]{>{\AddLabel}p{#1}<{}}
\setlength{\tabcolsep}{0pt} % Default value: 6pt


%%%% Begin document
\begin{document}

\noindent $\int xe^{x^2}\,dx =$ \\

\noindent
\setcounter{mc}{0}
  \begin{tabular}[t]{*{5}{P{0.2\linewidth}}}
    $\frac{1}{2}e^{x^2} + C$
    & $e^{x^2} + C$
    & $xe^{x^2} + C$
    & $\frac{1}{2}e^{2x} + C$
    & $e^{2x} + C$
  \end{tabular}
  
\end{document}

compilation result

I was wondering if there is a way to achieve the same result using the tabularray package. Thanks!

1 Answer 1

1

Try

\documentclass[11pt]{article}
\usepackage[letterpaper, hmargin={0.6in, 0.6in}]{geometry}

%%%% Packages and options
\usepackage{mathtools}   % extension of amsmath and will load amsmath
\usepackage{tabularray}  % <---
\UseTblrLibrary{counter} % <---
\newcounter{mc}
\newcommand*{\AddLabel}{\stepcounter{mc}\Alph{mc})} % <---

\setlength{\parindent}{0pt}

%%%% Begin document
\begin{document}
$\displaystyle\int xe^{x^2}\,dx =$ \\
\begin{tblr}{colspec={@{} *{5}{>{\AddLabel\quad}X[l]} @{}} }
$\frac{1}{2}e^{x^2} + C$
    & $e^{x^2} + C$
    & $xe^{x^2} + C$
    & $\frac{1}{2}e^{2x} + C$
    & $e^{2x} + C$
\end{tblr}
\end{document}

enter image description here

1
  • Thanks, that does it!
    – Minh
    Dec 17, 2022 at 2:26

You must log in to answer this question.

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