[Tex/LaTex] longtable – start on next page

afterpagefloatslongtabletypography

The formatting guidelines that I am bound to require me to have tables either at the top or bottom of a page. Up to now, I used a longtable for every table – even if it does not span multiple pages (but for the sake of consistency).

I found a post by Mico and his proposal to use afterpage which seems to go in the right direction. However, in the following example, the table does not start on the next page as desired but on the page after that. Is there a way to force it on the next page (without manual typesetting)?

\documentclass[]{scrbook}

\usepackage{afterpage} 
\usepackage{longtable}
\usepackage{blindtext}


\begin{document}

    \blindtext[1]
    This is where I inserted afterpage. 

    \afterpage{%
        \footnotesize
        \renewcommand*{\arraystretch}{1.2}
        \begin{longtable}{{ll}}
            \caption{some text}\\
            Head & Head \\
            A & B\\ 
        \end{longtable}
    }

    \blindtext[5]
\end{document}

image

Best Answer

You need a \par at the end:

\documentclass[]{scrbook}

\usepackage{afterpage}
\usepackage{longtable}
\usepackage{blindtext}


\begin{document}

    \blindtext[1]
    This is where I inserted afterpage.

    \afterpage{%
        \footnotesize
        \renewcommand*{\arraystretch}{1.2}
        \begin{longtable}{{ll}}
            \caption{some text}\\
            Head & Head \\
            A & B\\
        \end{longtable}
    }

    \blindtext[5]\par %<--- or an empty line ...
\end{document}

But imho it would be much better to use a normal float like table + tabular.