Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\nopagebreak is not working with \cline #16

Open
masics opened this issue Jul 2, 2021 · 3 comments
Open

\nopagebreak is not working with \cline #16

masics opened this issue Jul 2, 2021 · 3 comments

Comments

@masics
Copy link

masics commented Jul 2, 2021

If I add a \nopagebreak after \cline, it is not working.

@hvoss49
Copy link
Collaborator

hvoss49 commented Jul 2, 2021

Example please!

@masics
Copy link
Author

masics commented Jul 2, 2021

Easy.

\documentclass{article}

\usepackage{xltabular}

\title{xltabular}

\begin{document}

\begin{xltabular}{\textwidth}{|l|X|X|}
\caption{A sample long table.} \label{tab:long} \\

\hline \multicolumn{1}{|c|}{\textbf{First column}} & \multicolumn{1}{c|}{\textbf{Second column}} & \multicolumn{1}{c|}{\textbf{Third column}} \\ \hline 
\endfirsthead

\multicolumn{3}{c}%
{\tablename\ \thetable{} -- continued from previous page} \\
\hline \multicolumn{1}{|c|}{\textbf{First column}} & \multicolumn{1}{c|}{\textbf{Second column}} & \multicolumn{1}{c|}{\textbf{Third column}} \\ \hline 
\endhead

\hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline
\endfoot

\hline
\endlastfoot

Line 1 & & \\
Line 2 & & \\ \hline
Line 1 & & \\
Line 2 & & \\ \hline
Line 1 & & \\
Line 2 & & \\ \hline
Line 1 & & \\
Line 2 & & \\ \hline
Line 1 & & \\
Line 2 & & \\ \hline
Line 1 & & \\
Line 2 & & \\ \hline
Line 1 & & \\
Line 2 & & \\ \hline
Line 1 & & \\
Line 2 & & \\ \hline
Line 1 & & \\
Line 2 & & \\ \hline
Line 1 & & \\
Line 2 & & \\ \hline
Line 1 & & \\
Line 2 & & \\ \hline
Line 1 & & \\  \cline{2-3} 
Line 2 & & \\ \hline
Line 1 & & \\ \cline{2-3} 
Line 2 & & \\ \hline
Line 1 & & \\ \cline{2-3} 
Line 2 & & \\ \hline
Line 1 & & \\ \cline{2-3} 
Line 2 & & \\ \hline
Line 1 & & \\ \cline{2-3} 
Line 2 & & \\ \hline
Line 1 & & \\ \cline{2-3} 
Line 2 & & \\ \hline
Line 1 & & \\ \cline{2-3} 
Line 2 & & \\ \hline
Line 1 & & \\ \cline{2-3} 
Line 2 & & \\ \hline
Line 1 & & \\ \cline{2-3} 
Line 2 & & \\ \hline \nopagebreak
Line 11 & & \\ \cline{2-3} 
Line 12 & & \\ \hline
Line 1 & & \\ \cline{2-3} 
Line 2 & & \\ \hline
Line 1 & & \\  \cline{2-3} 
Line 2 & & \\ \hline
Line 1 & & \\
Line 2 & & \\ \hline
Line 1 & & \\
Line 2 & & \\ \hline

\end{xltabular}



\end{document}

@hvoss49
Copy link
Collaborator

hvoss49 commented Jul 2, 2021

This is out of the control of xltabular, it also happens for a simple longtable. Use the other way round and insert \pagebreak where it should appear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants