[texhax] nopagebreak \hline in a longtable

Nico Van Cleemput nico.vancleemput at gmail.com
Fri Oct 17 09:03:57 CEST 2008


When trying this solution this morning I was surprised to see that it
has not the desired effect. It does indeed prohibit a line break on
the line, but does not keep the rows together.
Let me try it by giving a diagram. The original output was

PAGE 1:

row1
-------

PAGE 2:

-------
row2
-------
row3

And I want row1 and row 2 to stay together. After using this solution,
the result is

PAGE 1:

row1
-------

PAGE 2:

row2
-------
row3

So the only effect is that the line is no longer on two pages. The
desired effect however is

PAGE 1:

row1
-------
row2
-------

PAGE 2:

-------
row3

So maybe I'm more looking for something to group several rows and
disallow any break within that group.


Kind regards and thanks in advance for any help.

Nico Van Cleemput
Applied Mathematics and Computer Science
Ghent University
Krijgslaan 281 - S9
B - 9000 Ghent

2008/10/16 Ulrike Fischer <news2 at nililand.de>:
> Am Thu, 16 Oct 2008 09:39:48 +0200 schrieb Nico Van Cleemput:
>
>
> a search google.groups ("hline longtable nopagebreak") gives this
> solution:
>
> \documentclass{article}
> \usepackage{longtable}
>
> \makeatletter
> \newcommand*{\nonbreakhline}{\cline{1-\LT at cols}}
> \makeatother
> \begin{document}
> \begin{longtable}{llll}
> links & mitte links & mitte rechts & rechts \\\nonbreakhline
> links & mitte links & mitte rechts & rechts \\*\nonbreakhline
> links & mitte links & mitte rechts & rechts \\
> \end{longtable}
> \end{document}
>
> --
> Ulrike Fischer
>
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
>
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
>


More information about the texhax mailing list