Text Formatting ⇒ long table: page breaks within row/cell possible?
long table: page breaks within row/cell possible?
The initial results look pretty good to me. The only thing about using the table that's been a little bothersome is that page breaks seem to happen only where table rows end/begin. I'd like, however, for the rows to span pages; it's fine with me if, for example, the first few lines of a row are at the end of one page and the rest of the row's lines are on the next page. I suppose I could get an undesirable widow/orphan look by getting the program to break rows over two pages, but if that becomes a problem I'll deal with it later.
For the moment I just want to check whether it is possible to get table rows to span two pages? Also, some of my rows may end up taking more than a page; it'll be interesting to see what are the results for that scenario.
Thanks,
James
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
long table: page breaks within row/cell possible?
Re: long table: page breaks within row/cell possible?
To begin with, the document with which I'm experimenting has just the two parallel translations--there's no third column for the original language (as there was for yours). The two translations can vary fairly substantially, with one or other paragraph of the translation being several lines longer than the other. Table rows work well for the document insofar as the paragraphs are kept pretty close to parallel in those cases where one or other is significantly longer, and the whole document, i.e., the totality of paragraphs stays in sync (there's probably even a way using latex to cause shorter paragraphs to "stretch" in such a way that they stay better synched with the longer paragraphs to which they correspond--perhaps parcolumns does this, too?). Anyway, I'm just wondering how parcolumns would handle the paragraph-length discrepancy I've described?
Also, there are certain parts of this document which, due to unavailability of the second, display only one translation. These instances can be easily handled in a table by using \multicolumn{2}, which causes the two column arrangement to collapse into one (and back again when needed). How would parcolumns handle these instances?
Finally, I tried an experiment with one of the page-exceeding rows/cells found in my document. The results were unacceptable: the page-exceeding material simply gets cut off at the bottom page edge (overfull vbox). That might be dealt with by introducing manually a page break, I suppose. But if there's some solution to the matter I asked about in this thread's title, namely some way to cause table rows/cells to break across pages, that would resolve this overfull vbox problem as well, I assume. So, is there a way to do that, i.e., to have table rows/cells break across pages, or not?
The wikibook mentions supertab, xtabular, and possibly tabulary as other packages for handling long tables. Can anyone comment on how those packages would behave in the case of the many-page table with which I'm experimenting?
Thanks,
James
long table: page breaks within row/cell possible?
It shouldn't matter how many columns you have.jamtat wrote:To begin with, the document with which I'm experimenting has just the two parallel translations--there's no third column for the original language (as there was for yours).
It's up to you to decide how you would divide the text into chunks, and for each "chunk", they would start at the same place vertically just like they do in a table. If one side of a given chunk was longer than the other, there would just be a gap at the end of one of the sides. There may be a way to stretch the lines out, but I haven't really explored that. I don't think I'd like that aesthetically. as much as there just being gaps on one of the sides.The two translations can vary fairly substantially, with one or other paragraph of the translation being several lines longer than the other. Table rows work well for the document insofar as the paragraphs are kept pretty close to parallel in those cases where one or other is significantly longer, and the whole document, i.e., the totality of paragraphs stays in sync (there's probably even a way using latex to cause shorter paragraphs to "stretch" in such a way that they stay better synched with the longer paragraphs to which they correspond--perhaps parcolumns does this, too?). Anyway, I'm just wondering how parcolumns would handle the paragraph-length discrepancy I've described?
I don't think there's a special mechanism for it, but you could just end the parcolumns environment and start a new one later.Also, there are certain parts of this document which, due to unavailability of the second, display only one translation. These instances can be easily handled in a table by using \multicolumn{2}, which causes the two column arrangement to collapse into one (and back again when needed). How would parcolumns handle these instances?
Finally, I tried an experiment with one of the page-exceeding rows/cells found in my document. The results were unacceptable: the page-exceeding material simply gets cut off at the bottom page edge (overfull vbox).
That kind of thing would be easier to diagnose with a minimal working example.
Why don't you experiment with them a bit? I think I tried xtabular but ended up liking parcolumns better for my needs. I don't really remember why now. Your mileage my vary!The wikibook mentions supertab, xtabular, and possibly tabulary as other packages for handling long tables. Can anyone comment on how those packages would behave in the case of the many-page table with which I'm experimenting?
long table: page breaks within row/cell possible?
Code: Select all
\documentclass{article}
\usepackage[english]{babel}
\usepackage{longtable}
\usepackage{xtab}
\usepackage[top=1in,bottom=.5in,left=.7in,right=1in]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\begin{document}
\title{Parallel Translations}
\fancyhead{}
\fancyfoot{}
\chead{\textsc{Parallel Translations}}
\rhead{\thepage}
\cfoot{}
\begin{center}
\begin{longtable}{p{3.4in}|p{3.4in}}
\multicolumn{2}{c}{\textbf{Two Columns of Parallel Text}} \\
\multicolumn{1}{c}{\emph{Column 1}}
&\multicolumn{1}{c}{\emph{Column 2}}\\
\endhead
1st text here. & 2nd text here.\\
More of 1st text here. & More of second text here.\\
Even more of 1st text here. & Even more of 2nd text here.\\
Now insert so much text that it exceed page length here. & Now also insert so much text that it exceeds the page length.
\end{longtable}
\begin{longtable}{p{3.4in}|p{3.4in}}
\multicolumn{2}{c}{\textbf{Additional Set of Two Columns of Parallel Text}} \\
\multicolumn{1}{c}{\emph{Column 1}}
&\multicolumn{1}{c}{\emph{Column 2}}\\
\endhead
More 1st text here. & More second text here.\\
Even more of 1st text here. & Even more of 2nd text here.\\
\end{longtable}
\begin{longtable}{p{3.4in}|p{3.4in}}
\multicolumn{2}{c}{\textbf{Yet More Two Columns of Parallel Text}} \\
\multicolumn{1}{c}{\emph{Column 1}}
&\multicolumn{1}{c}{\emph{Column 2}}\\
\endhead
Etc. 1st text. & Etc. 2nd text.\\
More page-exceeding 1st text here. & More page-exceeding 2nd text here.\\
\end{longtable}
\end{center}
\end{document}
One noteworthy thing is that, by using a table, I can get a repeating header in each sub-section of my pages-long table--the look I desire for this document. In my initial experimentation with parcolumns, I don't see a way to do something like that: will that be possible?
I tried xtab but I had the same problem of the overfull \vbox and the text of the page-exceeding rows/columns simply being unceremoniously cut off at the bottom page edge. So it also seems not to want to place page breaks within table rows/cells.
Maybe I should have started my experiments with a simpler document

Thanks,
James
Re: long table: page breaks within row/cell possible?
Thanks,
James
Re: long table: page breaks within row/cell possible?

This query really needs to be divided into two threads; one inquiring about using a table for what I want to do, and which should be pursued in the Graphics, Figures & Tables forum, and one focusing on using parcolumns or perhaps ledpar for accomplishing my aim, and which might best be pursued in this forum(?).
So, to give a verbal description of what I want to do, the following. I'd like each page of this document (I'm using documentclass{article}) to have a heading that tells what the name of this document is and where the page number will also appear. I've accomplished that with the fancyhead package. On most pages of the document there should also appear two columns of parallel text (the exception being occasional pages where one of the two translations I'd like to use is not available to me). Furthermore, some additional headings should appear on each page: those headings should contain 1) an identifier for each of my two columns, and 2) a heading that spans both columns and that identifies which section of the document appears on that page.
Perhaps it would be helpful to think of this as a story composed of several chapters: in addition to identifying the translation that appears in each column on every page, the section of the document (chapter) should be identified on each page as well. Yet more difficult: if a section ends mid-page, there will actually be two page headings on that sheet--one for the section/chapter that just ended and another at the beginning of the new section/chapter.
Is there some way to do this using parcolumns? Perhaps I will need to implement some other package to create these additional headings that should appear on each page?
Thanks,
James
PS I could make a mock-up of the look I want using latex or some other program and upload it here if that would help. Perhaps a visual aid is warranted in this case?
long table: page breaks within row/cell possible?
Possibly, possibly not. You're suggesting a very complicated document layout, one which is it very likely that no one on this forum has ever done something exactly like him or herself.jamtat wrote:Hey, not bad. I managed to stump the experts on the first try. But seriously . . .
I have no doubt that it could be done with LaTeX, but it would probably take me an hour or two to even design a template for it. This is your project, not ours, so it's far better for you to try it first, and then ask when you reach a particular stumbling block, ask here, and when you do so, provide sample code in the form of a minimal working example which we can try to help you tweak, if at all possible.
I'd suggest using LaTeX's normal header mechanisms along with the fancyhdr package to set up the headers. You'll probably have to manually align the column headers with the columns, but since parcolumns (and ledpar?) and similar packages allow you to specify the column widths manually, that shouldn't be a problem. Use LaTeX's marking mechanisms to get section numbers in the headers. The fancyhdr documentation covers the marking mechanisms (though it's not the clearest documentation in the world, alas), and has commands for creating new marks, which you'll probably need to use here so you can have a separate mark for each column.
A visual aid might help, but actually, half-working code is probably more useful. (You can use, e.g., the lipsum or blindtext packages to provide filler text if need be.) Verbal descriptions aren't as helpful.