TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is an orphan line on page 2.

How to get rid of it?

Minimal Code

\documentclass{article}
\usepackage[a4paper,margin=5cm,landscape]{geometry}
\usepackage{longtable,array}


\usepackage{pstricks}
\def\pic{\begin{pspicture}(5,5)\psframe(5,5)\end{pspicture}}
\def\row{\pic&\pic\\\hline}

\begin{document}

\begin{longtable}{|*{2}{m{0.4\linewidth}|}}
\hline
\row\row\row
\end{longtable}

\begin{longtable}{|*{2}{m{0.4\linewidth}|}}
\hline
\row\row\row
\end{longtable}

\end{document}
share|improve this question
up vote 3 down vote accepted

Do a test with \Needspace from package needspace if there is enough space on the page for beginning the table, which first draws the rule and then decides if the next row could be set on the current page.

\documentclass[dvips]{article}
\usepackage[a4paper,margin=5cm,landscape]{geometry}
\usepackage{longtable,array,needspace}


\usepackage{pstricks}
\def\pic{\begin{pspicture}(5,5)\psframe(5,5)\end{pspicture}}
\def\row{\pic & \pic\\\hline}

\begin{document}

\begin{longtable}{|*{2}{m{0.4\linewidth}|}}
\hline
\row\row\row
\end{longtable}

\Needspace*{5.5cm}
\begin{longtable}{|*{2}{m{0.4\linewidth}|}}\hline
\row\row\row
\end{longtable}

\end{document}
share|improve this answer

That's the \hline of the next longtable. You could try e.g. \Needspace{6cm} (from the needspace package) before the second longtable to force a page break. Or enlarge the page a bit with \enlargethispage{1cm}.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.