From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/92149 Path: news.gmane.org!not-for-mail From: "talazem@fastmail.fm" Newsgroups: gmane.comp.tex.context Subject: Re: r2l alignment and linenumbering conflict? Date: Sun, 2 Aug 2015 10:24:12 +0100 Message-ID: <744B7EEA-9D1D-416E-AA76-7237786EBC8C@fastmail.fm> References: <23253135-8B88-487D-9271-39A683A8A060@fastmail.fm> <55BD1438.4020504@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 9.0 \(3073\)) Content-Type: multipart/mixed; boundary="===============1107722908==" X-Trace: ger.gmane.org 1438507605 14681 80.91.229.3 (2 Aug 2015 09:26:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Aug 2015 09:26:45 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Aug 02 11:26:24 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZLpXE-000241-Bi for gctc-ntg-context-518@m.gmane.org; Sun, 02 Aug 2015 11:26:24 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 765A410233 for ; Sun, 2 Aug 2015 11:26:23 +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 OS1xwIniHkiT for ; Sun, 2 Aug 2015 11:26:22 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 88DA410248 for ; Sun, 2 Aug 2015 11:25:49 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B577410206 for ; Sun, 2 Aug 2015 11:25:44 +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 wHzSid3jX6xw for ; Sun, 2 Aug 2015 11:25:43 +0200 (CEST) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 45CB710213 for ; Sun, 2 Aug 2015 11:23:27 +0200 (CEST) Original-Received: from host21.specialservers.com (host21.specialservers.com [213.175.196.29] (may be forged)) by filter1-til.mf.surf.net (8.14.4/8.14.4/Debian-4) with ESMTP id t729NPb3027493 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 2 Aug 2015 11:23:26 +0200 Original-Received: from cpc69046-oxfd25-2-0-cust964.4-3.cable.virginm.net ([81.109.87.197]:44741 helo=[10.0.1.2]) by host21.specialservers.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.85) (envelope-from ) id 1ZLpUK-001nns-Cl for ntg-context@ntg.nl; Sun, 02 Aug 2015 10:23:24 +0100 In-Reply-To: <55BD1438.4020504@gmail.com> X-Mailer: Apple Mail (2.3073) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host21.specialservers.com X-AntiAbuse: Original Domain - ntg.nl X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - fastmail.fm X-Get-Message-Sender-Via: host21.specialservers.com: authenticated_id: talal@alazem.org X-Source: X-Source-Args: X-Source-Dir: X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=213.175.196.29; country=GB; latitude=51.5000; longitude=-0.1300; http://maps.google.com/maps?q=51.5000,-0.1300&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0ROXJnqR6 - 0d2832d3604a - 20150802 Received-SPF: neutral (filter1-til.mf.surf.net: 213.175.196.29 is neither permitted nor denied by domain talazem@fastmail.fm) receiver=filter1-til.mf.surf.net; client-ip=213.175.196.29; envelope-from=; helo=host21.specialservers.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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" Xref: news.gmane.org gmane.comp.tex.context:92149 Archived-At: --===============1107722908== Content-Type: multipart/alternative; boundary="Apple-Mail=_1E7F05B2-77FA-4BFA-8650-A8E4A189F35C" --Apple-Mail=_1E7F05B2-77FA-4BFA-8650-A8E4A189F35C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Thanks for that, Wolfgang. I can only hope that, as the culprit is = known, it can be apprehended! Idris: here is the document that I had sent (and many thanks to you and = to Pablo for the more general advice): > \unexpanded\def\doVariant#1#2#3% > {\startlinenote[#1]{#2] #3}#2\stoplinenote[#1]} >=20 > \newcounter\countvariants > \unexpanded\def\variant > {\doglobal\increment\countvariants > \normalexpanded{\doVariant{Varia:\countvariants}}} >=20 > \setupalign[r2l] >=20 > \showframe \starttext=20 >=20 > \section{Correct} > Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque = molestie dictum quam non congue. Integer ut dolor vel mi vestibulum = molestie vel et nulla. Morbi id justo vitae quam rhoncus tincidunt ut = adipiscing nisi. >=20 > \section{Incorrect} > \startlinenumbering > Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque = molestie dictum quam non congue. Integer ut dolor vel mi vestibulum = molestie vel et nulla. Morbi id justo vitae quam rhoncus tincidunt ut = adipiscing nisi. > \stoplinenumbering >=20 > \stoptext All the best, Talal > On 1 Aug 2015, at 19:47, Wolfgang Schuster = wrote: >=20 >> talazem@fastmail.fm 1. August 2015 = 17:37 >> Sorry to pester, but this problem is barring me from moving my book = project into ConTeXt this weekend. >>=20 >> The use of linenumbers seems to throw off the R2L mechanism. Example = of the problem attached.=20 >>=20 >=20 > The culprit is the function "boxed.stage_two" in page.lua which output = each text line in the line numbering > environment in left to right mode. When you have justified lines = everything is fine but when you have a ragged > line (e.g. the last line in a paragraph) ConTeXt aligns the context = with the left margin. >=20 > \starttext \showframe >=20 > \startalignment[righttoleft,flushleft] >=20 > \input ward >=20 > \blank >=20 > \startlinenumbering > \input ward > \stoplinenumbering >=20 > \stopalignment >=20 > \stoptext >=20 > Wolfgang > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > maillist : ntg-context@ntg.nl / = http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > = __________________________________________________________________________= _________ --Apple-Mail=_1E7F05B2-77FA-4BFA-8650-A8E4A189F35C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1 Thanks for that, Wolfgang. I can only hope that, as the = culprit is known, it can be apprehended!

Idris: here is the document that I had sent (and many thanks = to you and to Pablo for the more general advice):

 \unexpanded\def\doVariant#1#2#3%
      {\startlinenote[#1]{#2] = #3}#2\stoplinenote[#1]}

   \newcounter\countvariants
   \unexpanded\def\variant
      = {\doglobal\increment\countvariants
    =   =  \normalexpanded{\doVariant{Varia:\countvariants}}}

\setupalign[r2l]

\showframe = \starttext 

\section{Correct}
Lorem ipsum dolor sit = amet, consectetur adipiscing elit. Pellentesque molestie dictum quam non = congue. Integer ut dolor vel mi vestibulum molestie vel et nulla. Morbi = id justo vitae quam rhoncus tincidunt ut adipiscing nisi.

\section{Incorrect}
\startlinenumbering
Lorem ipsum dolor = sit amet, consectetur adipiscing elit. Pellentesque molestie dictum quam = non congue. Integer ut dolor vel mi vestibulum molestie vel et nulla. = Morbi id justo vitae quam rhoncus tincidunt ut adipiscing = nisi.
\stoplinenumbering

\stoptext

All the = best,
Talal

On = 1 Aug 2015, at 19:47, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

=20 1. August 2015=20 17:37
Sorry to = pester, but this=20 problem is barring me from moving my book project into ConTeXt this=20 weekend.

The use of=20= linenumbers seems to throw off the R2L mechanism. Example of the = problem attached. 


The culprit is the function "boxed.stage_two" in page.lua which output=20= each text line in the line numbering
environment in left to right mode. When you have justified lines=20 everything is fine but when you have a ragged
line (e.g. the last line in a paragraph) ConTeXt aligns the context with the left margin.

\starttext \showframe

\startalignment[righttoleft,flushleft]

    \input ward

    \blank

    \startlinenumbering
    \input ward
    \stoplinenumbering

\stopalignment

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
_______________________________________________________________= ____________________

= --Apple-Mail=_1E7F05B2-77FA-4BFA-8650-A8E4A189F35C-- --===============1107722908== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============1107722908==--