Re: [NTG-context] Parallel texts: verse with blanks between stanzas via tabulate

2022-08-30 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Dienstag, 30. August 2022 14:31
> An: Maier, Denis Christian (UB) ; mailing list for
> ConTeXt users 
> Betreff: Re: AW: [NTG-context] Parallel texts: verse with blanks between
> stanzas via tabulate
> 
> On 8/30/2022 1:40 PM, denis.ma...@unibe.ch wrote:
> 
> > Thanks for the updated version. So, that means the basic restriction
> > is that blanks will need to be inserted between rows, right? We cannot
> > have to two completely independent formatted poems, right? (For
> > reference, see the attached PNG. This was done with paragraphs, and
> > works as longs as this stays on a single page. One is one long stanza,
> > the other one consists of multiple smaller stanzas.)
> You need to be more prececise in defining what you want .. this example is not
> a parallel obe right? Just two columns.
> 

Sorry for not being precise enough.

I'm not sure I understand. This example shows two poems side by side. Both are 
totally different in structure. One has a heading, and consists of multiple 
paragraphs. The other is just one long stanza. Until now, I've used tabulate 
for these kind of sidebyside texts. Usually there are not poems, just regular 
paragraphs, but with poems I've realized that blanks seem not be supported in 
individual table cells.

Denis

\startbuffer[lines1]
\startlines[inbetween={\blank}]
this
is
a
poem
with
one 
longer 
stanza
\stoplines
\stopbuffer

\startbuffer[lines2]
\startlines[inbetween={\blank}]
this
is
a
poem

with
some
stanzas

here is 
another one

and another one
\stoplines
\stopbuffer

\starttext

Just the buffers.

One:

\getbuffer[lines1]

Two:

\getbuffer[lines2]


Via paragraphs

\defineparagraphs[paraverse][n=2 ]
\setupparagraphs[paraverse][1][
   width=.45\textwidth, distance=2em,
   align={verytolerant,stretch}]

\startparaverse
\getbuffer[lines1]
\nextparaverse
\getbuffer[lines2]
\stopparaverse

Via tabulate
\starttabulate[|p|p|]
\NC \getbuffer[lines1]
\NC \getbuffer[lines2]
\NC\NR
\stoptabulate

\stoptext

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Parallel texts: verse with blanks between stanzas via tabulate

2022-08-30 Thread Hans Hagen via ntg-context

On 8/30/2022 1:40 PM, denis.ma...@unibe.ch wrote:


Thanks for the updated version. So, that means the basic restriction is that 
blanks will need to be inserted between rows, right? We cannot have to two 
completely independent formatted poems, right? (For reference, see the attached 
PNG. This was done with paragraphs, and works as longs as this stays on a 
single page. One is one long stanza, the other one consists of multiple smaller 
stanzas.)
You need to be more prececise in defining what you want .. this example 
is not a parallel obe right? Just two columns.


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Parallel texts: verse with blanks between stanzas via tabulate

2022-08-30 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-

> Von: ntg-context 
> mailto:ntg-context-boun...@ntg.nl>> Im Auftrag 
> von Hans Hagen

> via ntg-context

> Gesendet: Montag, 29. August 2022 13:58

> An: ntg-context@ntg.nl<mailto:ntg-context@ntg.nl>

> Cc: Hans Hagen mailto:j.ha...@xs4all.nl>>

> Betreff: Re: [NTG-context] Parallel texts: verse with blanks between stanzas

> via tabulate

>

> On 8/29/2022 1:31 PM, Denis Maier via ntg-context wrote:

> >> -Ursprüngliche Nachricht-

> >> Von: Hans Hagen mailto:j.ha...@freedom.nl>>

> >> Gesendet: Sonntag, 28. August 2022 10:41

> >> An: mailing list for ConTeXt users 
> >> mailto:ntg-context@ntg.nl>>

> >> Cc: Maier, Denis Christian (UB) 
> >> mailto:denis.ma...@unibe.ch>>

> >> Betreff: Re: [NTG-context] Parallel texts: verse with blanks between

> >> stanzas via tabulate

> >>

> >> On 8/27/2022 11:25 PM, Denis Maier via ntg-context wrote:

> >>> Thanks, Wolfgang. That gives me a blank between the verses. However

> >>> the

> >> blank is rather huge and I don't see how I could make it smaller? Is

> >> it possible to do this?

> >> morning exercise attached (you can run the file)

> >>

> >> Hans

> >

> > Another, more general question on this: why is the function

> poetry.sidebyside defined twice? If I understand correctly, depending on the

> input one or the other will be used, but I don't see where that happens...

> the first can be commented as it is the first simple variant

>



I see.



Thanks for the updated version. So, that means the basic restriction is that 
blanks will need to be inserted between rows, right? We cannot have to two 
completely independent formatted poems, right? (For reference, see the attached 
PNG. This was done with paragraphs, and works as longs as this stays on a 
single page. One is one long stanza, the other one consists of multiple smaller 
stanzas.)



Denis
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Parallel texts: verse with blanks between stanzas via tabulate

2022-08-29 Thread Hans Hagen via ntg-context

On 8/29/2022 1:31 PM, Denis Maier via ntg-context wrote:

-Ursprüngliche Nachricht-
Von: Hans Hagen 
Gesendet: Sonntag, 28. August 2022 10:41
An: mailing list for ConTeXt users 
Cc: Maier, Denis Christian (UB) 
Betreff: Re: [NTG-context] Parallel texts: verse with blanks between stanzas
via tabulate

On 8/27/2022 11:25 PM, Denis Maier via ntg-context wrote:

Thanks, Wolfgang. That gives me a blank between the verses. However the

blank is rather huge and I don't see how I could make it smaller? Is it possible
to do this?
morning exercise attached (you can run the file)

Hans


Another, more general question on this: why is the function poetry.sidebyside 
defined twice? If I understand correctly, depending on the input one or the 
other will be used, but I don't see where that happens...

the first can be commented as it is the first simple variant

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-%D \module
%D   [   file=m-poetry,
%Dversion=2022.08.28
%D  title=\CONTEXT\ Extra Modules,
%D   subtitle=Whatever comes up,
%D author=Hans Hagen,
%D   date=\currentdate,
%D  copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

% For Denis Maier (see mails to list end of August 2022)

\startluacode

local  poetry = moduledata.poetry or { }
moduledata.poetry = poetry

-- function poetry.sidebyside(specification)
-- local first   = string.splitlines(buffers.getcontent(specification.left))
-- local second  = 
string.splitlines(buffers.getcontent(specification.right))
-- local template = specification.template or "|||"
-- context.starttabulate { template }
-- for i=1,#first do
-- local f = first [i] or ""
-- local s = second[i] or ""
-- if f == "" and s == "" then
-- context.TB { "medium" }
-- else
-- context.NC() context(f)
-- context.NC() context(s)
-- context.NC() context.NR()
-- end
-- end
-- context.stoptabulate()
-- end

function poetry.sidebyside(specification)
local left= specification.left
local right   = specification.right
local first   = left  and string.splitlines(buffers.getcontent(left )) or { 
}
local second  = right and string.splitlines(buffers.getcontent(right)) or { 
}

if #first > 0 and #second == 0 then
for i=1,#first do
local t = string.split(first[i], "|")
first[i]  = string.strip(t[1] or "")
second[i] = string.strip(t[2] or "")
end
end

local template = specification.template or "|||"

context.starttabulate { template }
local fi = 1
local si = 1
local n  = #first > #second and #first or #second

local function flush(f,s)
context.NC() context(f)
context.NC() context(s)
context.NC() context.NR()
if f ~= "" then
fi = fi + 1
end
if s ~= "" then
si = si + 1
end
end

while fi <= n and si <= n do
local f = first [fi] or ""
local s = second[si] or ""
if f ~= "" and s ~= "" then
flush(f,s)
else
while true do
if f ~= "" or s ~= "" then
flush(f,s)
else
while f == "" do
fi = fi + 1
f = first [fi] or ""
end
while s == "" do
si = si + 1
s = second[si] or ""
end
break
end
f = first [fi] or ""
s = second[si] or ""
end
 -- context.HL()
context.TB { "medium" }
end
end
context.stoptabulate()
end

interfaces.implement {
name  = "poetrysidebyside",
protected = true,
public= true,
actions   = poetry.sidebyside,
arguments = "hash",
}

\stopluacode

\continueifinputfile{m-poetry.mkxl}

\starttext

\starttext

\startbuffer[lines-1]

Re: [NTG-context] Parallel texts: verse with blanks between stanzas via tabulate

2022-08-29 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Sonntag, 28. August 2022 10:41
> An: mailing list for ConTeXt users 
> Cc: Maier, Denis Christian (UB) 
> Betreff: Re: [NTG-context] Parallel texts: verse with blanks between stanzas
> via tabulate
> 
> On 8/27/2022 11:25 PM, Denis Maier via ntg-context wrote:
> > Thanks, Wolfgang. That gives me a blank between the verses. However the
> blank is rather huge and I don't see how I could make it smaller? Is it 
> possible
> to do this?
> morning exercise attached (you can run the file)
> 
> Hans

Another, more general question on this: why is the function poetry.sidebyside 
defined twice? If I understand correctly, depending on the input one or the 
other will be used, but I don't see where that happens...

Best,
Denis
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Parallel texts: verse with blanks between stanzas via tabulate

2022-08-29 Thread Denis Maier via ntg-context
Thanks Hans, that's very nice indeed. Looks like I really need to dive into 
CLD. There seem to be so many possibilies...

However, the major pitfall seems to be that this assumes stanzas of equal 
length (as it relies on \TB to produce the blanks), which does not apply to my 
situation. (Modfied version attached.)
Do you see any way to support this kind of situation?

Best,
Denis



> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Sonntag, 28. August 2022 10:41
> An: mailing list for ConTeXt users 
> Cc: Maier, Denis Christian (UB) 
> Betreff: Re: [NTG-context] Parallel texts: verse with blanks between stanzas
> via tabulate
> 
> On 8/27/2022 11:25 PM, Denis Maier via ntg-context wrote:
> > Thanks, Wolfgang. That gives me a blank between the verses. However the
> blank is rather huge and I don't see how I could make it smaller? Is it 
> possible
> to do this?
> morning exercise attached (you can run the file)
> 
> Hans
> 
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -


m-poetry.mkxl
Description: m-poetry.mkxl
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Parallel texts: verse with blanks between stanzas via tabulate

2022-08-28 Thread Hans Hagen via ntg-context

On 8/27/2022 11:25 PM, Denis Maier via ntg-context wrote:

Thanks, Wolfgang. That gives me a blank between the verses. However the blank 
is rather huge and I don't see how I could make it smaller? Is it possible to 
do this?

morning exercise attached (you can run the file)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-%D \module
%D   [   file=m-poetry,
%Dversion=2022.08.28
%D  title=\CONTEXT\ Extra Modules,
%D   subtitle=Whatever comes up,
%D author=Hans Hagen,
%D   date=\currentdate,
%D  copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

% For Denis Maier (see mails to list end of August 2022)

\startluacode

local  poetry = moduledata.poetry or { }
moduledata.poetry = poetry

function poetry.sidebyside(specification)
local first   = string.splitlines(buffers.getcontent(specification.left))
local second  = string.splitlines(buffers.getcontent(specification.right))
local template = specification.template or "|||"
context.starttabulate { template }
for i=1,#first do
local f = first [i] or ""
local s = second[i] or ""
if f == "" and s == "" then
context.TB { "medium" }
else
context.NC() context(f)
context.NC() context(s)
context.NC() context.NR()
end
end
context.stoptabulate()
end

function poetry.sidebyside(specification)
local left= specification.left
local right   = specification.right
local first   = left  and string.splitlines(buffers.getcontent(left )) or { 
}
local second  = right and string.splitlines(buffers.getcontent(right)) or { 
}

if #first > 0 and #second == 0 then
for i=1,#first do
local t = string.split(first[i], "|")
first[i]  = string.strip(t[1] or "")
second[i] = string.strip(t[2] or "")
end
end

local template = specification.template or "|||"

context.starttabulate { template }
for i=1,#first do
local f = first [i] or ""
local s = second[i] or ""
if f == "" and s == "" then
context.TB { "medium" }
else
context.NC() context(f)
context.NC() context(s)
context.NC() context.NR()
end
end
context.stoptabulate()
end

interfaces.implement {
name  = "poetrysidebyside",
protected = true,
public= true,
actions   = poetry.sidebyside,
arguments = "hash",
}

\stopluacode

\continueifinputfile{m-poetry.mkxl}

\starttext

\startbuffer[lines-1]
THIS
IS
A
POEM

WITH
TWO
STANZAS
\stopbuffer

\startbuffer[lines-2]
this
is
a
poem

with
two
stanzas
\stopbuffer

\startbuffer[lines-3]
this | THIS
is   | IS
a| A
poem | POEM
 |
with | WITH
two  | TWO
stanzas  | STANZAS
\stopbuffer

\ctxlua {
moduledata.poetry.sidebyside {
left = "lines-1",
right= "lines-2",
template = "|l|i2r|"
}
}

\ctxlua {
moduledata.poetry.sidebyside {
left = "lines-3",
template = "|r|il|"
}
}

\poetrysidebyside
  [left=lines-3,
   template={|r|il|}]

\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Parallel texts: verse with blanks between stanzas via tabulate

2022-08-27 Thread Denis Maier via ntg-context
Thanks, Wolfgang. That gives me a blank between the verses. However the blank 
is rather huge and I don't see how I could make it smaller? Is it possible to 
do this?

Denis

> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Wolfgang
> Schuster via ntg-context
> Gesendet: Samstag, 27. August 2022 09:27
> An: mailing list for ConTeXt users 
> Cc: Wolfgang Schuster 
> Betreff: Re: [NTG-context] Parallel texts: verse with blanks between stanzas
> via tabulate
> 
> Denis Maier via ntg-context schrieb am 27.08.2022 um 09:17:
> > Thanks. I'll try that. But, iirc, these had some other drawbacks I'll 
> > check
> if it works for my use case.
> >
> > Is there a way to have blanks in the tabulate?
> 
> \startlines[inbetween={\dontleavehmode\crlf}]
> ...
> 
> Wolfgang
> 
> __
> _
> If your question is of interest to others as well, please add an entry to the
> Wiki!
> 
> maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-
> context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net archive
> : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> __
> _
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Parallel texts: verse with blanks between stanzas via tabulate

2022-08-27 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-
> Von: ntg-context  Im Auftrag von Henning
> Hraban Ramm via ntg-context
> Gesendet: Freitag, 26. August 2022 23:27
> An: Denis Maier via ntg-context 
> Cc: Henning Hraban Ramm 
> Betreff: Re: [NTG-context] Parallel texts: verse with blanks between stanzas
> via tabulate
> 
> Am 26.08.22 um 22:00 schrieb Denis Maier via ntg-context:
> > Hi,
> >
> > I need to typeset two poems side by side. Usually, I use the tabulate
> > environment for typesetting parallel texts. However, for poems this
> > does not quite work as tabulate does not seem to allow blanks between
> > the stanzas. See MWE below. Am I missing someting? Is there a better
> > way to achieve this?
> 
> How about columnsets or paragraphs?
> 
> \definecolumnset[Zwei][n=2]
> \startcolumnset[Zwei]
> \startlines
> Starlight, star bright,
> first star I see tonight;
> \stoplines
> \column
> \startlines
> I wish I may, I wish I might
> have the wish I wish tonight.
> \stoplines
> \stopcolumnset
> 
> 
> \defineparagraphs[Zwei][n=2]
> \setupparagraphs[Zwei][1][
>width=.45\textwidth, distance=2em,
>align={verytolerant,stretch}]
> % width of 2nd column is calculated automatically
> 
> \startZwei
> ...
> \nextZwei
> ...
> \stopZwei
> 
> 

Ok, I've had a chance to look into this. Maybe I'm missing something, but 
paragraphs cannot be split across pages. Is that correct? That's a bit of a 
problem.

As for columnsets, they seem to change the output routine for the entire page. 
Also not ideal in this case.

Denis
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Parallel texts: verse with blanks between stanzas via tabulate

2022-08-27 Thread Wolfgang Schuster via ntg-context

Denis Maier via ntg-context schrieb am 27.08.2022 um 09:17:

Thanks. I'll try that. But, iirc, these had some other drawbacks I'll check 
if it works for my use case.

Is there a way to have blanks in the tabulate?


\startlines[inbetween={\dontleavehmode\crlf}]
...

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Parallel texts: verse with blanks between stanzas via tabulate

2022-08-27 Thread Denis Maier via ntg-context
Thanks. I'll try that. But, iirc, these had some other drawbacks I'll check 
if it works for my use case.

Is there a way to have blanks in the tabulate?
Denis




Von: ntg-context  im Auftrag von Henning Hraban 
Ramm via ntg-context 
Gesendet: Freitag, 26. August 2022 23:26:56
An: Denis Maier via ntg-context
Cc: Henning Hraban Ramm
Betreff: Re: [NTG-context] Parallel texts: verse with blanks between stanzas 
via tabulate

Am 26.08.22 um 22:00 schrieb Denis Maier via ntg-context:
> Hi,
>
> I need to typeset two poems side by side. Usually, I use the tabulate
> environment for typesetting parallel texts. However, for poems this does
> not quite work as tabulate does not seem to allow blanks between the
> stanzas. See MWE below. Am I missing someting? Is there a better way to
> achieve this?

How about columnsets or paragraphs?

\definecolumnset[Zwei][n=2]
\startcolumnset[Zwei]
\startlines
Starlight, star bright,
first star I see tonight;
\stoplines
\column
\startlines
I wish I may, I wish I might
have the wish I wish tonight.
\stoplines
\stopcolumnset


\defineparagraphs[Zwei][n=2]
\setupparagraphs[Zwei][1][
   width=.45\textwidth, distance=2em,
   align={verytolerant,stretch}]
% width of 2nd column is calculated automatically

\startZwei
...
\nextZwei
...
\stopZwei


Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Parallel texts: verse with blanks between stanzas via tabulate

2022-08-26 Thread Henning Hraban Ramm via ntg-context

Am 26.08.22 um 22:00 schrieb Denis Maier via ntg-context:

Hi,

I need to typeset two poems side by side. Usually, I use the tabulate 
environment for typesetting parallel texts. However, for poems this does 
not quite work as tabulate does not seem to allow blanks between the 
stanzas. See MWE below. Am I missing someting? Is there a better way to 
achieve this?


How about columnsets or paragraphs?

\definecolumnset[Zwei][n=2]
\startcolumnset[Zwei]
\startlines
Starlight, star bright,
first star I see tonight;
\stoplines
\column
\startlines
I wish I may, I wish I might
have the wish I wish tonight.
\stoplines
\stopcolumnset


\defineparagraphs[Zwei][n=2]
\setupparagraphs[Zwei][1][
  width=.45\textwidth, distance=2em,
  align={verytolerant,stretch}]
% width of 2nd column is calculated automatically

\startZwei
...
\nextZwei
...
\stopZwei


Hraban
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Parallel texts: verse with blanks between stanzas via tabulate

2022-08-26 Thread Denis Maier via ntg-context
Hi,

I need to typeset two poems side by side. Usually, I use the tabulate 
environment for typesetting parallel texts. However, for poems this does not 
quite work as tabulate does not seem to allow blanks between the stanzas. See 
MWE below. Am I missing someting? Is there a better way to achieve this?

Best,
Denis

%%%
\startbuffer[lines]
\startlines[after={\blank}]
this
is
a
poem

with
two
stanzas
\stoplines
\stopbuffer

\starttext

With a blank between the stanzas:
\getbuffer[lines]

Without a blank between the stanzas:
\starttabulate[|p|p|]
\NC \getbuffer[lines]
\NC \getbuffer[lines]
\NC\NR
\stoptabulate
\stoptext
%%%

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] parallel texts, setuptabulate and widows-orphans control

2016-04-19 Thread massifr
Hello list,
I've found that \start ... \stoptabulate can be used to format parallel texts,
with paragraphs that are synchronized and split well on different pages.

I also found that they don't play well with widow-orphan penalties.
Try this:

\setuptabulate[split=yes]

\starttext
  \setpenalties\widowpenalties{1}{1}
  \setpenalties\clubpenalties{1}{1}
  \starttabulate[|p|p|]
\NC
\dorecurse{3}{\input knuth}
\NC
\dorecurse{2}{\input knuth}
\NC\NR
  \stoptabulate
\stoptext

The penalties' settings make some lines overlap.
Comment out those two lines and everything works well.
Not a great problem, since I don't think you need
widow-orphan control in parallel texts.

It took me some time to understand what was making 
lines overlap.
So I leave it here for future reference, if someone else
stumbles on the same problem.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Parallel texts

2007-11-20 Thread Steffen Wolfrum
Hi,

I am looking for a way to typeset bilingual text as parallel text,  
keeping each paragraph opposite the corresponding paragraph (left/ 
right page).

The ledpar package from the ledmac bundle does this (I was told).


How can this be done with ConTeXt?


Thanks,

Steffen
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Parallel texts

2007-11-20 Thread luigi scarso
On Nov 20, 2007 6:18 PM, Steffen Wolfrum [EMAIL PROTECTED] wrote:

 Hi,

 I am looking for a way to typeset bilingual text as parallel text,
 keeping each paragraph opposite the corresponding paragraph (left/
 right page).

 The ledpar package from the ledmac bundle does this (I was told).


 How can this be done with ConTeXt?

maybe streams?


-- 
luigi
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Parallel texts

2007-11-20 Thread Steffen Wolfrum

Am 20.11.2007 um 19:38 schrieb luigi scarso:

 I am looking for a way to typeset bilingual text as parallel text,
 keeping each paragraph opposite the corresponding paragraph (left/
 right page).

 The ledpar package from the ledmac bundle does this (I was told).


 How can this be done with ConTeXt?
 maybe streams?


Maybe streams.

Right! Idris started a thread on parallel texts called Streams in  
March, 7th.
But this thread never received any answer ... o(

Steffen


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Parallel texts

2007-11-20 Thread Idris Samawi Hamid
Hi,

On Tue, 20 Nov 2007 12:24:50 -0700, Steffen Wolfrum  
[EMAIL PROTECTED] wrote:


 Am 20.11.2007 um 19:38 schrieb luigi scarso:

 I am looking for a way to typeset bilingual text as parallel text,
 keeping each paragraph opposite the corresponding paragraph (left/
 right page).

 The ledpar package from the ledmac bundle does this (I was told).


 How can this be done with ConTeXt?
 maybe streams?


 Maybe streams.

 Right! Idris started a thread on parallel texts called Streams in
 March, 7th.
 But this thread never received any answer ... o(

True, but there is a m-streams module in the distribution. Hans was  
experimenting with these once upon a time and you can check them out. I  
think luigi was referring to that.

Best wishes
Idris

-- 
Professor Idris Samawi Hamid, Editor-in-Chief
International Journal of Shi`i Studies
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Parallel texts

2007-11-20 Thread luigi scarso
On Nov 20, 2007 8:32 PM, Idris Samawi Hamid [EMAIL PROTECTED] wrote:

 Hi,

 On Tue, 20 Nov 2007 12:24:50 -0700, Steffen Wolfrum
 [EMAIL PROTECTED] wrote:

 
  Am 20.11.2007 um 19:38 schrieb luigi scarso:
 
  I am looking for a way to typeset bilingual text as parallel text,
  keeping each paragraph opposite the corresponding paragraph (left/
  right page).
 
  The ledpar package from the ledmac bundle does this (I was told).
 
 
  How can this be done with ConTeXt?
  maybe streams?
 
 
  Maybe streams.
 
  Right! Idris started a thread on parallel texts called Streams in
  March, 7th.
  But this thread never received any answer ... o(

 True, but there is a m-streams module in the distribution. Hans was
 experimenting with these once upon a time and you can check them out. I
 think luigi was referring to that.


It's not mine!
search for thomas.schmitz at uni-bonn.de

%%%
\usemodule[streams]

\def\StartCouple{\page\SwitchToNormal}
\def\StopCouple {\SwitchToNormal \SynchronizeLeftAndRight
\FlushLeftAndRight}
\def\Original   {\SwitchToNormal\SynchronizeLeftAndRight\SwitchToLeft}
\def\Translation{\SwitchToRight}

%%So you put the part of your document where synchronization should
%%take place between \StartCouple and \StopCouple. After that ,
%%\Original and \Translation switches between even and odd pages.
\starttext

\scale[width=\textwidth,height=\textheight,factor=fit]{\ss m-streams}
\page
\StartCouple
\Original
this is an original text \crlf
\input knuth
\blank[1cm]
\Translation
THIS IS THE TRANSLATION \crlf
\input tufte
\Original
\ss this is an original text \crlf
\input knuth
\Translation
\tt THIS IS THE TRANSLATION \crlf
\input tufte
\StopCouple
\stoptext







 Best wishes
 Idris

 --
 Professor Idris Samawi Hamid, Editor-in-Chief
 International Journal of Shi`i Studies
 Department of Philosophy
 Colorado State University
 Fort Collins, CO 80523

 --
 Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

 ___
 If your question is of interest to others as well, please add an entry to
 the Wiki!

 maillist : ntg-context@ntg.nl /
 http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : https://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net

 ___




-- 
luigi
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___