Here's what I'm having now
\documentclass{article}
\usepackage{array}
\newcommand{\test}[1][default]{#1}
\begin{document}
\begin{tabular}{>{\test}c}
[one]1\\
1\\
1\\
1
\end{tabular}
\end{document}
As you can see, \test
expands before table's row has been appended. The desired result would be having
\test[one]1\\
\test1\\
\test1\\
\test1
for actual columns, but automated with >{...}
column specification. So that the printed result would be
one1
default1
default1
default1
I've also tried to apply \noexpand
here, but it doesn't seem to work.
\ignorespaces
is insertedcollcell
package to get something that might support your use case.\NewDocumentCommand{\test}{mO{default}}{#2\ignorespaces}
and it almost works, but someMissing {
rises. How can I fix that.