From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/77674 Path: news.gmane.org!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: Re: 2 columns: 1 language per column (solved) Date: Tue, 31 Jul 2012 17:17:56 +0200 Message-ID: References: <87vch6muf0.fsf@micropit.couberia.bzh> <5017A00B.3020809@wxs.nl> <87ehns8emb.fsf@micropit.couberia.bzh> <5017A8F8.9060404@wxs.nl> <87obmw6mpv.fsf_-_@micropit.couberia.bzh> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1485\)) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1343747887 24899 80.91.229.3 (31 Jul 2012 15:18:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 31 Jul 2012 15:18:07 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Jul 31 17:18:07 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SwED1-0008Ut-6c for gctc-ntg-context-518@m.gmane.org; Tue, 31 Jul 2012 17:18:07 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 103771020A; Tue, 31 Jul 2012 17:18:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GUu6+szPHWu0; Tue, 31 Jul 2012 17:18:04 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id EDD1C10213; Tue, 31 Jul 2012 17:18:03 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7394B10213 for ; Tue, 31 Jul 2012 17:18:02 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3-dOYwg6OU89 for ; Tue, 31 Jul 2012 17:18:01 +0200 (CEST) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id 597721020A for ; Tue, 31 Jul 2012 17:18:01 +0200 (CEST) Original-Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q6VFI0pL004123 for ; Tue, 31 Jul 2012 17:18:00 +0200 Original-Received: by wgbdq12 with SMTP id dq12so4457147wgb.2 for ; Tue, 31 Jul 2012 08:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=kI91yJk4/WrMxpj9Vv5CC5xxP1R6maBsEN3fxNF61sU=; b=PMD031EldZbFjqUmGh9zweuDV3cJlS4T5OtkKprBqLufKz5mmcJaE/fWaJ00Rz+z8L EDvqXtbKXH4SoX39P0S9UvhIsfT+rV3fZXcjdci1bQTd39E/+qyajzE4Rdu1F7jFSrZ6 lhmPBIiCE4ew4jvix6eu5EemBZt7Wx7mCSEOiZxaWfZxlqoA+sW9wuZcy/LMtmUttU5x S1kyjdLathByd01IvgZY8xJm5hLUhLZit1CETVXMz13RghH6BChpYu3DgpYLJi6168Iu zQKV2zj5Zy9+5nAoSBKXFLrSXpElXBgZMeeuahftYsVqEgQ60jUsNjWZjHxTCorvTIZg WcTw== Original-Received: by 10.180.90.195 with SMTP id by3mr530440wib.7.1343747878336; Tue, 31 Jul 2012 08:17:58 -0700 (PDT) Original-Received: from lmv-uvsq-102.home (AOrleans-553-1-44-5.w92-152.abo.wanadoo.fr. [92.152.10.5]) by mx.google.com with ESMTPS id b7sm860194wiz.9.2012.07.31.08.17.56 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 Jul 2012 08:17:57 -0700 (PDT) In-Reply-To: <87obmw6mpv.fsf_-_@micropit.couberia.bzh> X-Mailer: Apple Mail (2.1485) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.82.45; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0VHF3i09F - 902e80f76de9 - 20120731 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.220 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:77674 Archived-At: Hi Peter, Can you give please an example showing how to use your code? Thanks: OK On 31 juil. 2012, at 16:15, Peter M=FCnster wrote: > On Tue, Jul 31 2012, Hans Hagen wrote: > = >> \startmixedcolumns >> \placeparallel[main][one,two][criterium=3Dall] >> \stopmixedcolumns >> = >> there will be better support for that kind of things at some point > = > I don't get the desired result with \placeparallel, but I've found a > solution, that works quite well. I just can't place figures, that span > the 2 columns, but that's no problem for my project. > = > Here the (not very contextish) solution (cld-file): > = > --8<---------------cut here---------------start------------->8--- > local C =3D context > local format =3D string.format > = > local function create_environment() > local fp =3D io.open("env.tex", "w") > fp:write([[ > \startenvironment env > = > \def\ColumnDistance{1cm} > = > \startmode[columns] > \definepapersize[columns][ > width=3D\dimexpr (\textwidth - \ColumnDistance) / 2 \relax, > height=3D\textheight] > \setuppapersize[columns] > \setuplayout[page] > \setuppagenumbering[location=3D] > \setupalign[verytolerant, stretch, line] > \setupwhitespace[small] > \stopmode > = > \startbuffer[german] > \it\dorecurse{15}{\dorecurse{20}{german }\par} > \stopbuffer > = > \startbuffer[french] > \bf\dorecurse{15}{\dorecurse{20}{french }\par} > \stopbuffer > = > \stopenvironment > ]]) > fp:close() > end > = > local function create_pages(s) > local fp =3D io.open("pages.tex", "w") > fp:write(format([[ > \enablemode[columns] > \environment env > \starttext > \getbuffer[%s] > \stoptext > ]], s)) > fp:close() > os.execute(format("context --result=3Dpages-%s pages", s)) > end > = > local function create_columns(l, r) > local function pdf(x) return "pages-" .. x .. ".pdf" end > create_pages(l) > create_pages(r) > local pdfobj =3D epdf.open(pdf(l)) > local n =3D pdfobj:getNumPages() > for i =3D 1, n do > C.dontleavehmode() > C.externalfigure({pdf(l)}, {page =3D i}) > C"\\hskip\\ColumnDistance" > C.externalfigure({pdf(r)}, {page =3D i}) > C.page() > end > end > = > create_environment() > C.environment(false, "env ") > C.starttext() > C"Before" > C.page() > create_columns("german", "french") > C"After" > C.stoptext() > --8<---------------cut here---------------end--------------->8--- > = > -- = > Peter > _________________________________________________________________________= __________ > 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-co= ntext > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________