groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff] FW: Parallel text on two pages


From: Ted Harding
Subject: [Groff] FW: Parallel text on two pages
Date: Sun, 19 Aug 2001 11:52:17 +0100 (BST)

Hi Folks,

The following just appeared on the 'lout' list, and it raises
an interesting problem -- which any of us might face -- which
I reckon is sovable in groff (though I haven't tried) ...

-----FW: <address@hidden>-----

Date: Sun, 19 Aug 2001 02:04:43 +0200 (MET DST)
From: Oliver Bandel <address@hidden>
To: Lout mailing list <address@hidden>
Subject: Parallel text on two pages

Hello,

is it possible to set text on two pages in parallel?

This is intended to be used in texts in two different languages,
where on one page is the text in one language and on the
other side there is the related text in the other language.

The paragraphs on both pages should be related in their positions,
so that it is possible to use paragraphs of different length
in both languages and the related text in the second language
is positioned in relation to the according text of the first
language.

Is there a way to solve this problem in lout?

Ciao,
   Oliver

--------------End of forwarded message-------------------------

I've done this kind of thing with two columns on each page
(one for each language), and then it's very straightforward:
do it in 'tbl', using "text blocks" for each chunk of text in
each language. This automatically takes care of aligning
the paragraphs. However, it does impose that paragraphs
will not flow onto the next page: page breaks will occur
between paragrags (i.e. between lines of the table in
which you are working).

Doing it on successive pages poses more of a challenge.
The sort of solution I have in mind would be something like

1. Set up two page-diversions, one for each page.

2. Set up two paragraph-diversions, one for each page.

3. for languages L1 and L2, enter the L1 paragraph L1 into
   one para-div and the L2 paragraph into the other para-div.
   Find out which para-div has the lesser height, and pad
   it with blank vertical space so that they have equal heights.

4. If the (equal) heights of page-div_L1/L1 plus heights of
   para-div_L1/2 do not exceed the page height, plant
   para-div_L1/L2 into page_div_L1/L2.

   Otherwise ".bp" and output page-div_L1, ".bp" and
   output page-div_L2; then begin new page-divs_L1/L2
   and plant para-div_L1/L2 therein.

5. Go back to 3.

This should work like the 'tbl' solution, in that page
breaks will occur between paragraphs.

It is much more challenging if you want page-breaks to
occur where they naturally would if it was continuous
text in a single language, i.e. page_L1/L2 will go down
to the bottom of the printing area, and then what is left
of para-div_L1/L2 will run on to the top of the next printed
page _plus_one_ !

I can see how to do this "by hand", which involves entering
page-sized blocks of L1/L2 texts in two different places in
the source file, adjusting para spacings until it comes out
right (tedious though this might be); and I have a general
belief that if you can do it by hand in groff then you can
in almost all cases do it by macro; but in this case I don't
have a clear vision of how to proceed.

Any ideas, anyone?

This looks like one of those cases where out ingenious
colleague Thomas Baruchel might have an unexpected idea;

and I also wonder if Stewart Russel's bilingual publishing
skills can give a solution (or a hint based on how other
software does the job -- as I'm pretty sure some publishing
packages can do).

Best wishes to all,
Ted.

PS There's a related question, which is inspired by printing
wide spreadsheets (Excel type of thing). You may want columns
of a very wide table to print on successive pages, until
you come to the end of the columns, with rows of the table
in corresponding positions across this range of pages;
and then, on the next page, you start again with column 1
for the table-row following the last row you printed.
This could also have its uses in groff, nicht wahr?

(Though in this case I suspect the best approach consists
of pre-processing the input table, e.g. with 'awk', to
produce separate files, one for each page-range of columns,
and use these to generate groff input files. This still
involves "hand-work", though, to get the total width of
columns-per-page right, unless a groff mechanism could
be found which could work this out ...)

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 167 1972
Date: 19-Aug-01                                       Time: 11:52:17
------------------------------ XFMail ------------------------------

reply via email to

[Prev in Thread] Current Thread [Next in Thread]