Cannot use \toprule when doing \input inside tabular -- why?

\input is trying to be intelligent, and this seems to be upsetting LaTeX's picky tabular definition.

But you can access the original \input primitive from TeX which is less dangerous at this point.

After defining

\makeatletter
\newcommand\primitiveinput[1]
{\@@input #1 }
\makeatother

using \primitiveinput inside the tabular should work.


Some commands e.g. \toprule, \hline or \multicolumn must come directly at the start of a cell. There can't be anything before, this includes commands like \input.