I want to have a column type where to every cell a certain text is added.
I was thinking of using:
\newcolumntype{C}{>{\shortstack\bgroup extratext\\}c<{\egroup}}
I expected this would would give me the desired result but it complains about missing } and {. An explanation why this happens would be greatly appreciated.
MWE:
\documentclass{article}
\usepackage{array}
\newcolumntype{C}{>{\shortstack\bgroup extratext\\}c<{\egroup}}
\begin{document}
\begin{tabular}{CCC}
a & b & c
\end{tabular}
\end{document}
\shortstack
doesn't allow its argument to be between\bgroup
and\egroup
(only a few macros do, because they're based on primitives, but this behavior is very particular). – egreg Nov 21 '17 at 17:06