[Tex/LaTex] Parallel texts with header on each page

paralleltables

I have two English language texts that are translations of the same work and that I want to put in parallel: I do not plan to include the original, non-English text. This is for a document (of ca. 100 pages), by the way, rather than for a book. I have actually created said document using Open/Libre Office, so I have a sort of a working copy. But I want to recreate the same document using TeX/LaTeX.

With Open/Libre Office I used a table of two columns and three rows (the text of the translation occupies one row, while the other two rows are headings). I did some experimentation with LaTeX about a year ago and had some initial success using a table for the task, but eventually failed to complete the project. A description of the successful part, as well as the ultimate failure follows.

I used only about one page of text for the initial tests. The output looked superb–much better than my Open/Libre office document. But my enthusiasm was short-lived: I found that the table packages I tried all lacked the ability to produce page-spanning columns. In other words, any column that ends up being longer than one page in length simply gets cut off unceremoniously at the bottom of the page. In a case like mine, where I had a column that would end up being many pages long, I would wind up with only one page of output (overfull vbox error, as I recall); none of the subsequent pages would be produced.

I did look into other packages (ledpar, I believe?) that are made specifically for creating parallel texts and had some success with them as well. But in my view, the table solution output looked best. And as I recall, I had issues trying to introduce the material I had placed in the table headings using the parallel text packages, and I held it important to have a repeating header on each page (that would indicate which column contained which translation). So I got discouraged.

I still hope I might be able to use a table for this project, even though it is a bit of a violation of the intended use for tables. Can anyone offer suggestions about how to accomplish the task I've described in TeX/LaTeX? Will it really be impossible, as it seems to me, using a table?


UPDATE:

Thank you for the answers thus far provided. I had to go back and take another look at the experimental documents I created since this was done some time ago and my memory had gotten a bit vague.

I should start this reply by stating that I somewhat over-simplified the description of my document in the OP–apologies for that. And, having looked at my sample files again, I now realize that I had problems with both the table packages (and yes, I did try longtables) and with the parallel text package (which was, in fact, parcolumns, not ledpar). The final output looked a bit better using the table, but the look of the parcolumns experiment was nice as well.

The problem with the table packages I've described: no table column is allowed to exceed page length (seems to be a limitation coded into the packages–yes, even the longtable packge, I believe). That's a show-stopper for this project: I would have many columns in this document that would exceed page length–which brings me to the over-simplified description I gave in the OP and the problem I had with the parcolumns package.

The document actually could consist in many column chunks, and the parcolumns package does handle page-exceeding columns. The trouble I had with this package was inserting the table headings: they should appear on every page of the document, and I had trouble making that happen.

I should probably leave it at that for now since a more detailed description of the document here is likely to confuse and leave me open to being criticized for "moving the goal post." But I will note in closing that there are actually several sub-section in the document, and each sub-section needs to have a set of headers that repeats on every page.

Sorry for not having been more precise in my opening post.


ANOTHER UPDATE:

Wow, this forum is great–so many wonderful suggestions. Thank you so much for the helpful comments and questions. I've struggled to understand and use TeX/LaTeX for years and only recently did I meet with any success. Had this forum existed when I first started studying TeX/LaTeX (about 10 years ago), I'd be much further along by now.

Yes, it's true that the two translations can vary–sometimes wildly–in paragraph length. This is because one translation seems sometimes to give what seems more like a summary of a paragraph rather than an actual translation. So keeping the two in sync was a challenge. A table works well for that, since each paragraph of each translation is placed in a cell. That technique has the undesirable effect of introducing at some points a great deal of extraneous white space, but it does keep the paragraphs in sync.

With parcolumns, I used paragraphs to keep the two translations in sync–to pretty much the same effect as with the table. It would be nice to be able to have the longer translation somehow flow around the shorter one in cases where one is significantly longer than the other, but with the headers I'm talking about using, that would probably not be feasible.

The header suggestion provided by rdhs inspires me to resume my experiments using parcolumns–thanks so much for that. The header layout I implemented in my Open/Libre Office document is quite complex but results in the appearance I need. Implementing it in TeX/LaTeX is bound to be a challenge. What's needed is actually 3 sets of headers: one for the page (gives the title of the work); one for each section of the work (should contain a title like chapter 1, chapter 2, and should span both columns); and one for each column (containing titles something like translation 1, translation 2). With a table the last two can be easily done by specifying that the first two table rows are table headings to be repeated on each page, and the first row's columns get merged and the text centered. The first header described is just a standard page header.

Those headers should all repeat on every page, and there might be more than one set of headers on any given page (where there is, say, an extremely short chapter than takes up less than a page). I actually managed to get that look using the table package. But, as I said, the page-exceeding cells (I said page-exceeding columns earlier, but it's probably more precise to say cells of the table) are not allowed by any table package. So the experiment failed and I turned to parcolumns to try and recreate the layout I'd achieved in Open/Libre Office.

Again thanks for all the tips. This forum is really great (though a little confusing to use, at least for me)

James

Best Answer

Okay, here's a hack that uses atbegshi to add a header to parcolumns:

\documentclass{article}
\usepackage{parcolumns}
\usepackage{atbegshi}

\newcommand{\pcheaderfmt}[1]{{\large\sf\textbf{#1}}}
\newcommand{\pcheader}{}
\AtBeginShipout{\pcheader}

\begin{document}
\section{Latin and Piglatin}
    \renewcommand{\pcheader}
        {\par\noindent\pcheaderfmt{Latin}\hfill\pcheaderfmt{Piglatin}%
            \vspace{0.5ex}\hrule\vspace{1.5ex}}
    \pcheader
    \begin{parcolumns}{2}
    %
    \colchunk{Latin}
    %
    \colchunk{Piglatin}
    \colplacechunks
    %
    \colchunk{Latin}
    %
    \colchunk{Piglatin}
    %
    \end{parcolumns}
    \renewcommand{\pcheader}{}
\section{English and Pigenglish}
    \renewcommand{\pcheader}
        {\par\noindent\pcheaderfmt{English}\hfill\pcheaderfmt{Pigenglish?}%
            \vspace{0.5ex}\hrule\vspace{1.5ex}}
    \pcheader
    \begin{parcolumns}{2}
    %
    \colchunk{English}
    %
    \colchunk{Pigenglish}
    %
    \end{parcolumns}
    \renewcommand{\pcheader}{}
\end{document}
Related Question