In order to input data from a file into a tabular
environment, the TeX macro \@@input
has to be used (see this question), since \input
is non-expandable. Why is it not possible to change the catcode in a tabular contained in a beamer frame, e.g.
\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{tabular}{c}
\makeatletter \@@input file \makeatother
\end{tabular}
\end{frame}
\end{document}
Although this does not give any errors, it only outputs @input file
.
Why do I have to use \csname @@input\endcsname file
(see David Carlisle's answer to this question)?
\makeatletter\newcommand{\expandableinput}[1]{\@@input #1\relax}\makeatother
and use\expandableinput{file}
in the document. This will work independently of the document class.beamer
frames collect their contents, so it's like you used a catcode change (\makeatletter
) in the argument of a command, which does not work.