# Page breaking prohibition in some rows of the table

I use the longtable package. Its allow command \\*, for page breaking prohibition on row. Here the code, where \\* does not prohibit page breaking. (on line 44) Generaed pdf here: http://web-engineering.com.ua/mtest.pdf Can it be because of using multirow package? Please help.

    \documentclass[a4paper,oneside]{book}
\usepackage{ltablex}
\usepackage{calc}
\usepackage{multirow}

\newdimen{\newtblsparewidth}
\newdimen{\newtblstarfactor}

\begin{document}
\vbox to 450pt{}
\setlength{\newtblsparewidth}{\linewidth-2\tabcolsep-2\tabcolsep-2\tabcolsep-2\tabcolsep-2\tabcolsep}
\setlength{\newtblstarfactor}{\newtblsparewidth / \real{4}}
\begin{tabularx}{\linewidth}{l|l|l|X|}

\noalign{\vskip-\arrayrulewidth}\hline\endfoot

\multicolumn{1}{|m{0.13\newtblsparewidth}}{\multirow{3}{0.13\newtblsparewidth}{\textbf{/imp1}}} &
\multicolumn{3}
{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}
{This  command imports viewer’s settings from the file specified by  setting\_file\_name parameter. Please note, all your current settings will  be overridden and lost.} \\ \cline{2-4}

\multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{pagemode} &
\multicolumn{1}{|m{0.15\newtblsparewidth}}{} &
\multicolumn{1}{|m{0.37\newtblsparewidth}|}{} \\ \cline{2-4}

\multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{pagemode} &
\multicolumn{1}{|m{0.15\newtblsparewidth}}{} &
\multicolumn{1}{|m{0.37\newtblsparewidth}|}{} \\ \hline

% ----

\multicolumn{1}{|m{0.13\newtblsparewidth}}{\multirow{3}{0.13\newtblsparewidth}{\textbf{/imp2}}} &
\multicolumn{3}
{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}
{This  command imports viewer’s settings from the file specified by  setting\_file\_name parameter. Please note, all your current settings will  be overridden and lost.} \\ \cline{2-4}

\multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{pagemode} &
\multicolumn{1}{|m{0.15\newtblsparewidth}}{} &
\multicolumn{1}{|m{0.37\newtblsparewidth}|}{} \\ \cline{2-4}

\multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{pagemode} &
\multicolumn{1}{|m{0.15\newtblsparewidth}}{} &
\multicolumn{1}{|m{0.37\newtblsparewidth}|}{} \\* \hline

% ---

\multicolumn{1}{|m{0.13\newtblsparewidth}}{\multirow{3}{0.13\newtblsparewidth}{\textbf{/imp3}}} &
\multicolumn{3}
{|m{0.35\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.15\newtblsparewidth+2\tabcolsep+\arrayrulewidth+0.37\newtblsparewidth}|}
{This  command imports viewer’s settings from the file specified by  setting\_file\_name parameter. Please note, all your current settings will  be overridden and lost.} \\ \cline{2-4}

\multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{pagemode} &
\multicolumn{1}{|m{0.15\newtblsparewidth}}{} &
\multicolumn{1}{|m{0.37\newtblsparewidth}|}{} \\ \cline{2-4}

\multicolumn{1}{|l}{} & \multicolumn{1}{|m{0.35\newtblsparewidth}}{pagemode} &
\multicolumn{1}{|m{0.15\newtblsparewidth}}{} &
\multicolumn{1}{|m{0.37\newtblsparewidth}|}{} \\ \cline{2-4}

\end{tabularx}
\end{document}

-
please create a minimal example and do not use packages which are only available for you. –  Herbert Feb 21 '12 at 9:27
Thanks, Herbert. I have minified example as well as I can. On edited answer, you can see \* after second row (line 44) But page still breaks on this row. –  Andrew Feb 21 '12 at 10:02
\\* works the same way in longtable as it does outside, it doesn't actually prevent line breaking (as would a minipage box for example) it just tells TeX that breaking a line there is infinitely bad, trouble is, if you have big thick rows and it's trying to set the page "flushbottom" then not breaking the line and leaving the page very short or over long might be infinitely bad as well. If all its choices are infinitely bad, it picks one of them.... raggedbottom may be your friend here. –  David Carlisle Feb 21 '12 at 11:01
Thanks David. I tried insert \raggedbottom in preample before \begin{document}, before and after table definition (\begin{tabularx}) but that doesn't have effect. Where \raggedbottom command should be? –  Andrew Feb 21 '12 at 11:43

\makeatletter
\newcommand\nobreakhline{%
\multispan\LT@cols
\newcommand\nobreakcline[1]{\@nobreakcline#1\@nil}%
\def\@nobreakcline#1-#2\@nil{%
\omit
\@multicnt#1%
\ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
\@multicnt#2%
\noalign{\vskip-\arrayrulewidth}}
\makeatother


and then use

[...]
\multicolumn{1}{|m{0.37\newtblsparewidth}|}{} \\*\nobreakhline
[...]


or

[...]
\multicolumn{1}{|m{0.37\newtblsparewidth}|}{} \\*\nobreakcline
[...]


The problem is the \hline. A \\* without it works.

-
Thanks, Herbert Can you please modify your answer for nobreakcline? Because, when I try set \nobreakhline where cells are rowspanned, I receive line over merged cell, which does not look good. web-engineering.com.ua/mtest1.pdf –  Andrew Feb 21 '12 at 13:25
see edited answer –  Herbert Feb 21 '12 at 13:48
It works. Thanks. –  Andrew Feb 21 '12 at 14:07