In the past (may be last year or so), I have used these three packages together successfully (and produced a conditionally colored long table). That tex file still compiles nicely; however, the following MWE produces errors if any of the % signs (from the table definition) is deleted.
More specifically, if the number of rows is greater than 19 or any of the line endings is marked as non-breakable -- i.e. \\* -- then each of such cases produces the following error:
! Missing \endgroup inserted.< inserted text > \endgroup x
where x is the line number.
Moreover, if the arydshln package is also loaded then the number of errors for each such case is triples and produces the following errors:
! Extra }, or forgotten \endgroup.< template > ... \endcollectcell \relax \d@llarend }\adl@colhtdp \unhbox \adl@... x
! Missing \endgroup inserted.< inserted text >\endgroup x
! Missing } inserted.< inserted text >} x
I suspected that the order of the packages might be the reason but that was not the case. Do you have any idea why this is happening or how I can fix it?
%MWE
\documentclass[12pt,a4paper]{report}
\usepackage{longtable}
\usepackage{collcell}
%\usepackage{arydshln}
\newcolumntype{R}{>{\collectcell\fbox}r<{\endcollectcell}}%
\begin{document}
\begin{longtable}[c]{R}
\hline
$n$ \\
\hline
\endhead
\hline
\endfoot
1 \\%*
2 \\
3 \\
4 \\
5 \\
6 \\
7 \\
8 \\%*
9 \\
10 \\
11 \\
12 \\
13 \\
14 \\
15 \\
16 \\
17 \\
18 \\
19 \\
% 20 \\
% 20 \\
% 20 \\
\end{longtable}
\end{document}
longtable, since the actual memory requirement depends only on the number of table rows read, not on the value ofLTchunksize. – Moss_the_TeXie Jan 29 '20 at 11:20