1

I'm trying to produce a table like this: enter image description here

My code currently looks like this:

\documentclass[paper=a4, BCOR=0mm, usegeometry]{scrartcl}
\usepackage[lmargin=2.1cm, rmargin=2.1cm, bottom=3cm, footskip=1.5cm]{geometry}
\usepackage{tabularray}
\usepackage[table]{xcolor}

\begin{document} \begin{tblr}{ row{1} = {black!20, font={\bfseries}}, colspec = {|X[m]|X[m]|l|r@{}>{@}l|l|}, hlines, cell{1}{4} = {c=2}{c}, } Role & Name & Tel-Nr. & E-Mail & & Team\ Apprentice & Imogen Illustration & 000 000 00 00 & imogen.illustration&example.info & Example Team 1 \ Instructor & Eric Example & 000 000 00 00 & eric.example&example.info & Example Team 1 \ Expert & Sean Sample & 000 000 00 00 & sean.sample&exmpl.org & Exmpl Org \ \end{tblr} \end{document}

Now I'd like to replace how the emails are typeset from sean.sample&exmpl.org to \mail{sean.sample@exmpl.org} and defining something like this:

\usepackage{xparse}
\NewDocumentCommand{\mail}{>{\SplitArgument{1}{@}}m}{%
  \mailprocessor #1%
}
\NewDocumentCommand{\mailprocessor}{m m}{%
  \commandA{#1} & \commandB{#2}%
}

But LaTeX complains about the ampersand. This solution works for tabular and tabularx, but the error remains when sticking to tblr/tabularray.

(ultimately I want to pass the arguments on to the solution proposed here for aligning hyperlinked email-addresses along the @ sign, though I'm open for other solutions of doing that alignment and still have the links work)

Anyway, how can I get that ampersand to be accepted somehow?

joelproko
  • 115
  • You would have to tell tblr to expand the macro that generates the &, like \begin{tblr}[expand=\mail], but you must also make sure that this also expands \mailprocessor. – Pieter van Oostrum Jan 05 '23 at 16:21
  • This post https://tex.stackexchange.com/questions/648904/misplaced-alignment-tab-character-with-tabularray-and-expl3 can help you – pascal974 Jan 06 '23 at 14:39

0 Answers0