我的代码目前如下所示:
\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}
现在我想替换电子邮件的排版方式,从sean.sample&exmpl.org
到并定义如下内容:\mail{[email protected]}
\usepackage{xparse}
\NewDocumentCommand{\mail}{>{\SplitArgument{1}{@}}m}{%
\mailprocessor #1%
}
\NewDocumentCommand{\mailprocessor}{m m}{%
\commandA{#1} & \commandB{#2}%
}
但是 LaTeX 对 & 符号有所抱怨。此解决方案适用于tabular
和,但坚持使用/tabularx
时错误仍然存在。tblr
tabularray
(最终我想将论据传递到所提出的解决方案上这里用于将超链接的电子邮件地址与 @ 符号对齐,尽管我愿意接受其他解决方案来实现这种对齐,并且仍使链接正常工作)
无论如何,我怎样才能让这个“&”符号被接受呢?