ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jean-Pierre Delange <adeimantos@free.fr>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Different text versions in columns?
Date: Sun, 27 Nov 2016 18:28:54 +0100 (CET)	[thread overview]
Message-ID: <26686895.115592679.1480267734242.JavaMail.root@spooler6-g27.priv.proxad.net> (raw)
In-Reply-To: <583ADC15.2010208@gmail.com>

Hi Wolfgang,

Thank you very much to clarify the use of \pushoutputstream.
I'm going to work with your two examples, in order to elaborate a sample of parallel texts in two different language on alternate pages...
JP

----- Mail original -----
De: "Wolfgang Schuster" <schuster.wolfgang@gmail.com>
À: "Mailing list for ConTeXt users" <ntg-context@ntg.nl>
Envoyé: Dimanche 27 Novembre 2016 14:13:57
Objet: Re: [NTG-context] Different text versions in columns?

> Arthur Reutenauer <mailto:arthur.reutenauer@normalesup.org>
> 26. November 2016 um 00:14
>> 1. Streams work in MkIV
>> 2. The MkIV version has a command to set sync points.
>
>    That’s \pushoutputstreams, I presume.
Yes, you can use it to create paragraphs of equal height in different 
streams.

\setupbodyfont[tt]

\starttext

\startoutputstream[one]
     \setupalign[flushleft]
     \dorecurse{3}{Line \recurselevel\par}\pushoutputstream
     \blank
     \dorecurse{6}{Line \recurselevel\par}\pushoutputstream
     \blank
     \dorecurse{4}{Line \recurselevel\par}\pushoutputstream
\stopoutputstream

\startoutputstream[two]
     \setupalign[flushright]
     \dorecurse{5}{Line \recurselevel\par}\pushoutputstream
     \blank
     \dorecurse{2}{Line \recurselevel\par}\pushoutputstream
     \blank
     \dorecurse{7}{Line \recurselevel\par}\pushoutputstream
\stopoutputstream

\synchronizestreams[one,two]

\startoverlay
     {\outputstreambox[one]}
     {\raise2\strutdp\outputstreambox[two]}
\stopoverlay

\stoptext

>> Only the mechanism to create pages/columns for the stream content is
>> missing.
>
>    Can you elaborate a bit?  I’m having the following use case in mind:
> exactly two streams, one on even-numbered pages, the other on the
> odd-numbered ones, with infrequent synchronisations.  The two streams
> could run in parallel, facing each other on the spread, and only be
> resynchronised every 5 or 10 pages, say.  Is that currently not
> possible?
You can save text and flush it afterwards but there is no command which
places the content side by side (or in columns). Below is a simple example
but I had to write the splitter myself.

\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

Wolfgang
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2016-11-27 17:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 20:42 Henning Hraban Ramm
2016-11-22 22:01 ` Wolfgang Schuster
2016-11-24 20:13   ` Henning Hraban Ramm
2016-11-24 23:19     ` Wolfgang Schuster
2016-11-25 23:14   ` Arthur Reutenauer
2016-11-27 13:13     ` Wolfgang Schuster
2016-11-27 17:28       ` Jean-Pierre Delange [this message]
2016-11-27 17:44       ` Henning Hraban Ramm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26686895.115592679.1480267734242.JavaMail.root@spooler6-g27.priv.proxad.net \
    --to=adeimantos@free.fr \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).