Is it possible to create a \newcolumntype
-like macro accepting more than one argument and one of them is an optional argument?
I want to create a column type A
that can accept more than 1 argument such that I can create a tabular as follows:
\begin{tabular}{|A[2cm]{1cm}{5cm}|c|l|r|}
...
\end{tabular}
Note: the column type A
accepts 3 arguments in this example.
Best Answer
Herbert has explained how to do mandatory arguments. Optional arguments is doable but requires some low-level hackery, auxiliary functions and is not for the faint-hearted. You can see two versions of the same approach in numprint and siunitx (the later is an adaptation of the former).