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}\makeatotherand use\expandableinput{file}in the document. This will work independently of the document class. – egreg Feb 16 '20 at 23:32beamerframes collect their contents, so it's like you used a catcode change (\makeatletter) in the argument of a command, which does not work. – Phelype Oleinik Feb 16 '20 at 23:46beamer(this is why people here ask for minimal examples so much). You could use:\documentclass{beamer} \begin{document} \begin{frame} \begin{tabular}{c} \makeatletter\@@input file \makeatother \end{tabular} \end{frame} \end{document}, which is enough to demonstrate the problem. – Phelype Oleinik Feb 16 '20 at 23:57beamergrabs theframecontents: use\begin{frame}[fragile]"), but I couldn't find one that seemed an okay duplicate. If you know of one, you can mark your own question as duplicate, if you like. Otherwise, you can leave it as is, no problem in that either. – Phelype Oleinik Feb 17 '20 at 00:13