ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] streams reversed?
@ 2023-09-13  6:47 jbf
  2023-09-14 10:14 ` [NTG-context] " Bruce Horrocks
  0 siblings, 1 reply; 7+ messages in thread
From: jbf @ 2023-09-13  6:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1920 bytes --]

I am making some progress with a bilingual text using the streams 
mechanism suggested by Wolfgang: https://wiki.contextgarden.net/Columns, 
but see below.

The aim has been to have en and vi on facing pages (en left, vi right).

It works correctly for the Foreword in two languages (en, vi) in 
frontmatter.

When I come to bodymatter and Chapter 1, again it works, except that the 
positions of the languages are reversed, so I end up with vi on the left 
and en on the right. By Chapter 2 we are back to the correct position 
once more (en left and vi right).

I want to know why this is happening, and if I can prevent it happening.

I am using the code you can see below, except that instead of 
\startoutputstream[one] and \startoutputstream[two] etc.  I am using 
[en-front][vi-front], and then in bodymatter [en-chap1][vi-chap1] etc. 
etc. with the relevant repetitions of these identifiers where needed. I 
assume that to get a degree of synchronization I need to use this 
approach for each set of chapters. But I cannot understand why the 
languages alternate their starting page positions each chapter.

There are other issues I have to solve, but first of all I wish to 
resolve this one.

Julian


The original (Wolfgang) code is as follows:

\starttext

\startoutputstream[one]
    \startcolor[red]
    \dorecurse{10}{\input  knuth\par}
    \stopcolor
\stopoutputstream

\startoutputstream[two]
    \startcolor[green]
    \dorecurse{10}{\input  zapf\par}
    \stopcolor
\stopoutputstream

\synchronizestreams[one,two]

\setbox\scratchboxone\outputstreambox[one]
\setbox\scratchboxtwo\outputstreambox[two]

\doloop
  {\ifvoid\scratchboxone
     \exitloop
   \else
     \setbox\scratchboxfour\vsplit\scratchboxone  to\textheight
     \vbox  to\vsize{\box\scratchboxfour\vss}%
     \setbox\scratchboxfive\vsplit\scratchboxtwo  to\textheight
     \vbox  to\vsize{\box\scratchboxfive\vss}%
   \fi}

\stoptext

[-- Attachment #1.2: Type: text/html, Size: 4908 bytes --]

[-- Attachment #2: Type: text/plain, Size: 495 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-09-17  8:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-13  6:47 [NTG-context] streams reversed? jbf
2023-09-14 10:14 ` [NTG-context] " Bruce Horrocks
2023-09-14 22:04   ` jbf
2023-09-15 12:43     ` Hamid,Idris
2023-09-15 22:57       ` jbf
2023-09-17  8:01         ` Hans Hagen via ntg-context
     [not found]     ` <611158B6-83A3-424A-823C-78CA3C3EAFAD@scorecrow.com>
2023-09-15 22:55       ` jbf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).