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