[texhax] table and page break

Uwe Lueck uwe.lueck at web.de
Wed Jan 4 22:03:49 CET 2012


"Christian Pleul" <chrisptex at googlemail.com> wrote 03.01.2012 12:19:39:
> For a cooperative latex document with a lot of authors,
> it was decided to use tables for certain structures.
> Therefore, I have to cope with the problem of automatic page breaks
> of tables that only consist of 1 column and several rows.
> The column often contain different lists. The attached example
> shows the problem: The table does not break within a list.
> Is there a way to work around this issue?

A longtable row is a single box that cannot break accross pages.

A *manual* page break could be implemented in a straightforward way,
saving the counter value,

But actually you do not need any alignment, you are abusing longtable
for drawing lines around blocks. So you can get something similar
with the framed or mdframed package (ctan.org/pkg/framed,
ctan.org/pkg/mdframed), i.e., a framed block may break across pages.

I am aware of differences, such as (i) having a single horizontal line
instead of two between those blocks (essential??), (ii) having
a shorthand like \\ closing one block and opening another,
(iii) narrowing the content text so that the vertical lines delimit
the type area rather than being in the margins --

-- but actually p{\textwidth} is a mistake, you get "Overfull \hbox"
warnings, don't you?

Sorry, I cannot afford dealing with details right now.

Hope it helps though

 -- Uwe.



[Christian Pleul's:]
----- example ------
\documentclass{book}
\usepackage{longtable}
\usepackage{blindtext}
\usepackage{paralist}

\begin{document}
\begin{longtable}{|p{\textwidth}|}
\hline
\blindtext[1]\\
\blindtext[2]\\\hline
\begin{compactenum}
\item test
\item test
\item test
\item test
\item test
\item test
\item test
\item test
\item test
\item test
\item test
\item test
\item test
\end{compactenum}\\
\blindtext[2]
\hline
\end{longtable}
\end{document}
------------------------
 



More information about the texhax mailing list