ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* sync text streams in facing pages
@ 2022-08-15 10:42 Pablo Rodriguez via ntg-context
  2022-08-15 15:19 ` Write a long chapter title in two lines Jeong Dal via ntg-context
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2022-08-15 10:42 UTC (permalink / raw)
  To: ConTeXt users; +Cc: Pablo Rodriguez

Dear list,

adapting a the sample from mkxl/page-str.mkxl (and code from the list),
I came with the following sample:

  \setuppapersize[A6]
  \showgrid
  %\setuplayout[grid=yes]
  \starttext
  \input tufte
  \startoutputstream[es]
   \dorecurse{25}
    {\startlanguage[es]\input cervantes-es\stoplanguage%
      \par\pushoutputstream}
  \enableoutputstream[en]
   \dorecurse{25}
    {\input zapf\par\pushoutputstream}
  \disableoutputstream
  \stopoutputstream
  \synchronizestreams[es,en]
  \page \flushoutputstream[es]
  \page \flushoutputstream[en]
  \stoptext

To reorder pages, I rename the output to "wg.pdf" and run the following
code:

  \setuppapersize[A6]
  \setuplayout[page]
  \starttext
  \dorecurse{26}
  {\ifnum\recurselevel = 1
    \externalfigure[wg.pdf][page=\recurselevel]\else
    \externalfigure[wg.pdf][page=\recurselevel]
    \externalfigure[wg.pdf][page={\the\numexpr \recurselevel + 25}]\fi}
  \stoptext

I’m afraid that the paragraph mistmatch is clear (the number of pages is
way different for each versions).

Using the grid, the mismatch is not so evident (but there is still a
different number of pages for each version).

Page reordering would be in this case:

  \setuppapersize[A6]
  \setuplayout[page]
  \starttext
  \dorecurse{20}
  {\ifnum\recurselevel = 1
    \externalfigure[wg.pdf][page=\recurselevel]\else
    \externalfigure[wg.pdf][page=\recurselevel]
    \externalfigure[wg.pdf][page={\the\numexpr \recurselevel + 19}]\fi}
  \stoptext

I would need that for a bilingual edition. I don’t mind reodering the
pages (if there is no other option).

But what am I doing wrong not to get synced text streams for facing pages?

Many thanks for your help,

Pablo
___________________________________________________________________________________
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] 2+ messages in thread

end of thread, other threads:[~2022-08-15 15:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-15 10:42 sync text streams in facing pages Pablo Rodriguez via ntg-context
2022-08-15 15:19 ` Write a long chapter title in two lines Jeong Dal via ntg-context

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).