Thanks Idris.
See my response to Bruce, and indeed his response to mine earlier. I'll have to leave it at that for now. Too many other matters pressing.
Julian
Hi Julian,
Am also interested in this matter (and played a bit with the code you provided); one suspects that others are as well.
Based on past experience, can affirm that it's sometimes time-consuming, even a pain, to produce an MWE to reproduce the relevant behavior. But it would be well worth the effort for the sake of improving the streams mechanism and clarifying its ultimate limitations.
Even if the final MWE seems too bulky, you could post cloud links to the source and pdf files. Thank you for your contribution.
Best wishesIdris
------ Original Message ------From "jbf" <roma83537@gmail.com>To "Bruce Horrocks" <ntg@scorecrow.com>; "mailing list for ConTeXt users" <ntg-context@ntg.nl>Date 9/14/2023 4:04:27 PMSubject [NTG-context] Re: streams reversed?
** Caution: EXTERNAL Sender **Bruce, that was kind of you to reply. I think we both know that thestreams mechanism, while 'workable' for the most part, is still in needof refinement.It is quite possible that what is causing my problem has less to do with'streams' per se, and more to do with the use of this mechanism in a'real book' using frontmatter, bodymatter etc. etc.Since it would be too long and complicated an MWE to place here in thelist to demonstrate my problem, I will send you the file separately soyou can see the issue: effectively, the streams have worked forfrontmatter (Foreword), but when I get to Chapter 1 in bodymatter, theyare reversed. You will see that. I can't work out why, but you might beable to see what is causing that.And of course, I have two other problems to work out before I could usethis in a real production scenario: there is the one you have alreadyalluded to of extra pages occasionally beforehand (hopefully easilysolvable) but I can see another problem when the text is a lengthyone... and this is the result of synchronization: when one language (vi)takes up more space than the other (en), we get an awkward break at theend of the chapter in en, so that the last line can 'catch up' with thelast paragraph (in vi). Maybe this one will be harder to solve!JulianOn 14/9/23 20:14, Bruce Horrocks wrote:On 13 Sep 2023, at 07:47, jbf <roma83537@gmail.com> wrote: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've modified the sample code you got from Wolfgang to include chapter headings and it all looks fine to me[1] - the red text is all on the right hand side and the greeen text is all on the left. If this doesn't help and you still have problems then you'll need to post a sample that actually shows the problem. I'm using ConTeXt ver: 2023.09.04 19:15.\starttext\startoutputstream[one]\startcolor[red]\dorecurse{5}{\chapter{Stream One}\dorecurse{10}{\input knuth\par}}\stopcolor\stopoutputstream\startoutputstream[two]\startcolor[green]\dorecurse{5}{\chapter{Stream Two}\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[1] Apart from unnecessary blank pages at the beginning but that's a different problem so I'm not addressing that for now.—Bruce Horrocks--
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80523