I'm typesetting a complex table with the contents created by an external program. When I use \input I get unexpected behavior from \rowcolor. See the MWE below
\documentclass{article}
\usepackage{xcolor}
\usepackage{colortbl}
\begin{document}
Works\par
\begin{tabular}{ll}
\rowcolor{blue!20}%
A & B
\end{tabular}
Doesn't work\par
\begin{tabular}{ll}
% Uncomment line below to get the unexpected behavior
%\input{mwe-bit.tex}
\end{tabular}
\end{document}
where mwe-bit.tex simply contains
\rowcolor{blue!20}%
A & B
being the same two lines as directly included above. When I run this, the first part works, but the second generates (when uncommented):
! Misplaced \noalign.
\rowcolor ->\noalign
{\ifnum 0=`}\fi \global \let \CT@do@color \CT@@do@color...
l.1 \rowcolor
{blue!20}
I added the % after the \rowcolor in an abundance of caution, but it doesn't seem to make a difference.
I'm still something of a newbie when it comes to posting here, so apologies for any missteps.
(Update, original post had a pair of \rowcolor instructions for each attempt. I'd been thinking it was something to do with changing an already-specified color, but actually, just having one inside the inputted file is sufficient to generate the error)
