# Longtable inside multicols fails on “\thanks”

Good afternoon,

This is a continuation of this question, which solved the problem of putting a longtable inside the multicols environment (which is not currently supported without some tinkering). This is excellent, and as the example below shows it works beautifully.

However when I want to add a "thanks" field to the author and this trick seems to stop working (longtable discovers it is in twocolumn mode). The code block below will reproduce the error, and the forced output is shown at the very end.

Does anyone have an idea why this is happening? (FYI I would like to stick to "longtable" because I am using this in conjunction with the glossaries package (it actually works!) and I could not get "supertable" to span exactly the column width.)

Sigve

\documentclass[article]{memoir}
%
\usepackage{longtable}
\usepackage{multicol}
\usepackage{blindtext}
%
\newsavebox\ltmcbox
\newcounter{entryno}
\setcounter{entryno}{1}
\def\tablines{\tabline\tabline\tabline\tabline\tabline}
% Remove "\thanks{---}" before typesetting
%   %%%
%   %%%
%  %%%%%
%   %%%
%    %
\author{Author Authorson}
%
\begin{document}
%
\maketitle
%
\begin{multicols}{2}
%
\blindtext
%
% ----------------------------------------------------
% Make "longtable" believe it is in one-column mode
\setbox\ltmcbox\vbox\bgroup
\makeatletter\col@number\@ne
\begin{longtable}{|l|l|l|}
\tablines\tablines
\end{longtable}
\unskip
\unpenalty
\unpenalty\egroup
\unvbox\ltmcbox
%
\blindtext
\end{multicols}
%
\end{document}


oops, it's not really \thanks other than that slightly changed the page breaking. It was an accident waiting to happen in the original code...

Add an extra line to disable longtables's end game.

\documentclass[article]{memoir}
%
\usepackage{longtable}
\usepackage{multicol}
\usepackage{blindtext}
%
\newsavebox\ltmcbox
\newcounter{entryno}
\setcounter{entryno}{1}
\def\tablines{\tabline\tabline\tabline\tabline\tabline}
% Remove "\thanks{---}" before typesetting
%   %%%
%   %%%
%  %%%%%
%   %%%
%    %
\author{Author Authorson}
%
\begin{document}
%
\maketitle
%

\begin{multicols}{2}
%
\blindtext
%
% ----------------------------------------------------
% Make "longtable" believe it is in one-column mode
\setbox\ltmcbox\vbox\bgroup
\makeatletter\col@number\@ne
\mathchardef\LT@end@pen=0 %<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
\begin{longtable}{|l|l|l|}
\tablines\tablines
\end{longtable}
\unskip
\unpenalty
\unpenalty\egroup
\unvbox\ltmcbox
%
\blindtext

\end{multicols}
%
\end{document}

• Fantastic! Thank you very much for your excellent work on this package David. – Sigve Karolius Apr 7 '17 at 16:07
• really David ... better to discover from within longtable that you are inside multicols and stop needing all they gymnastics :-) – Frank Mittelbach Apr 8 '17 at 21:56