longtable misplaced noalign
This isn't the answer to the original post, but I came here Googling for "Longtable misplaced noalign" so my eventual solution might be useful for someone.
In my case I needed a \\
after the \caption
and \label
. This seems incredibly counterintuitive to me so if anyone can explain why or tell me where this is documented I'd be grateful.
\documentclass{article}
\usepackage{booktabs}
\usepackage{longtable}
\begin{document}
\begin{longtable}{ll}
% Uncomment the \\ on the next line and the misplaced \noalign disappears!
\caption{Captions should appear on top of tables}\label{tbl:table}%\\
\toprule
& foo \\
\midrule
\endfirsthead
bar & 1 \\
baz & 2 \\
\bottomrule
\end{longtable}
\end{document}
All \nopagebreak
's are undesired:
\documentclass{scrartcl}
\usepackage{longtable}
\usepackage{booktabs}
\begin{document}
\section{Table test}
\begin{longtable}{llc}
\hline
& & \multicolumn{1}{c}{All} \\
\hline
m & \rule{0pt}{1.7\normalbaselineskip}April & $1$ \\
& July & $1$ \\
& June & $1$ \\
l & \rule{0pt}{1.7\normalbaselineskip}C & $1$ \\
& F & $1$ \\
& S & $1$ \\
nums & \rule{0pt}{1.7\normalbaselineskip}28 & $2$ \\
& 62 & $1$ \\
\hline
\end{longtable}
\end{document}