The following code works for me, but if I remove the comment and thus add the longtabu/longtable, then the \enlargethispage loses its effect.
\documentclass{article}
\usepackage{lipsum}
\usepackage{afterpage}
\usepackage{longtable,tabu}
\usepackage{fancyhdr}
\usepackage[margin=2cm,showframe]{geometry}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{\small\thepage}
\begin{document}
\enlargethispage{-2cm}
%\begin{longtabu}{Xl} a&b\\ \end{longtabu}
%\begin{longtable}{ll} a&b\\ \end{longtable}
\lipsum
\lipsum
\end{document}
How do I work around this?
\enlargethispageis a feature of the standard one, so it's not that longtable stops it working, more a feature request that the feature be added to longtable's. – David Carlisle Sep 11 '15 at 14:54\enlargethispageis entirely helpful as well. – Max Sep 11 '15 at 14:57\enlargethispagebehind the longtable. – Ulrike Fischer Sep 11 '15 at 15:05\AtBeginDocument{\enlargethispage{-2cm}}. I cannot know if longtable is part of the game or not and if it will be on the page of the header. – Max Sep 11 '15 at 15:22longtablecorrectly then it is due to the changed output routine ignoring the\textheight. – Max Sep 12 '15 at 15:53longtableorlongtabu? The question says one. The code says another. (I don't know if it makes a difference to the problem, but I avoidlongtabuon principle, so it makes a difference to me.) – cfr Sep 17 '15 at 02:34\enlargethispagecommand inlatexsets the insert\@kludgeinswhich is in turn honoured by the\outputroutine. Thelongtablepackage redefines said output routine and replaces it with its own, that doesn't know about the\@kludgeinsand thus in effect breaks the command. I have a rough idea where to patch it in, but have so far not been successfull. I found the problem withlongtabu, but the root cause is inlongtablewhich is what provides the page breaking behaviour tolongtabu. I changed the sample to reflect this. – Max Sep 17 '15 at 08:30\usepackage[margin=2cm,bottom=4cm,showframe]{geometry}this set text height -2cm and\makeatletter \AtBeginDocument{% \afterpage{% \global\addtolength\textheight{2cm}% \global\setlength{\@colht}{\textheight}% }} \makeatotherwill add 2cm. – touhami Sep 23 '15 at 07:50