# [texhax] nopagebreak \hline in a longtable

Nico Van Cleemput nico.vancleemput at gmail.com
Thu Oct 16 09:39:48 CEST 2008

I use the longtable package for some very long tables I have, however
sometimes I want to rows to stay together even if it isn't ideal for
the layout. This is possible by using the \\* or a \nopagebreak at the
beginning of the row. This works fine if there is no \hline between
the two rows. At first I thought I'll try \nopagebreak\hline, but this
doesn't work. When I looked into the longtable package, it's seems
that this isn't working because \hline in longtable actually adds two
lines and the rows are split in between those two lines. So my guess
was that the only solution was to add a sort of \hline* command that
adds a line without the possibility of a pagebreak on that line. My
TeX knowledge however is far from sufficient to tackle such a hack as
I noticed. I was mostly guessing what would happen without any
certainty that what I was doing was right. So it's no surprise that I
didn't succeed.

My question is if anyone knows how to this, or could give me some
hints or knows a better way to achieve this effect.

kind regards,

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