From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/93217 Path: news.gmane.org!not-for-mail From: Mohammad Hossein Bateni Newsgroups: gmane.comp.tex.context Subject: Re: Footnote rules for bidi document Date: Sun, 3 Jan 2016 19:00:44 -0500 Message-ID: References: <56899FE7.1050504@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5567600764249387953==" X-Trace: ger.gmane.org 1451865703 25510 80.91.229.3 (4 Jan 2016 00:01:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Jan 2016 00:01:43 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 04 01:01:30 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aFsaY-0003wp-4e for gctc-ntg-context-518@m.gmane.org; Mon, 04 Jan 2016 01:01:30 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6FAF75CC8; Mon, 4 Jan 2016 01:01:03 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IQy_Ffo7iyCw; Mon, 4 Jan 2016 01:01:00 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 139395CC0; Mon, 4 Jan 2016 01:01:00 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id B1EAF5CC0 for ; Mon, 4 Jan 2016 01:00:58 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Hl5zzlqktdik for ; Mon, 4 Jan 2016 01:00:57 +0100 (CET) Original-Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 6630B5CBF for ; Mon, 4 Jan 2016 01:00:47 +0100 (CET) Original-Received: by mail-oi0-f42.google.com with SMTP id o124so246891840oia.1 for ; Sun, 03 Jan 2016 16:00:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=k68/2MV6E3lXemelS3XXg5bsnWvDEFPheEv3m6SPnK4=; b=tEMIUN+YrZQoio3h6bcmZBP1e+/+x7m+xjSCyD8ASFsET0GG/8+YtpD3nQ/1XlNNLw XZ+z3S+2UZ6BtYeRx7JmYwCofsNg+f3+YCZizdE7XOPa4nb7veXsIy8C18SuZd6bwwIQ yJTkFrwOq4xk8dadEh6cHZwM5ctUkAynnMWL1rm77jHNYDPlR+eQIaK5FuxeUwFkdlMV vYDzFAUYICizWe5RX7fT7hGyCUWl8JR14EAocmUFC7u55y3TLyqMicXnuYazQqvXl1Pc mw25Qj52wUDx6p+6FzgSlIUBzA4HHU5Wzs7nDgKUFDfzMDhPTGifpLbvN1O6uCgfurkG uZyA== X-Received: by 10.202.83.74 with SMTP id h71mr56508898oib.115.1451865645061; Sun, 03 Jan 2016 16:00:45 -0800 (PST) Original-Received: by 10.202.57.86 with HTTP; Sun, 3 Jan 2016 16:00:44 -0800 (PST) Original-Received: by 10.202.57.86 with HTTP; Sun, 3 Jan 2016 16:00:44 -0800 (PST) In-Reply-To: <56899FE7.1050504@wxs.nl> 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:93217 Archived-At: --===============5567600764249387953== Content-Type: multipart/alternative; boundary=001a113d12a4091dc6052876d076 --001a113d12a4091dc6052876d076 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I see your point, Hans. For what it's worth, that's the default for mixed Persian/English documents unless one uses a system that cannot do it. For instance, FarsiTeX and XePersian provide that as default behavior. That said, I'm not asking for this to be the default. I only want to know how it can be achieved. The code will be put in my style file or module. Is it possible to determine the direction of the first line of footnote block while typesetting the footnote rule? I imagine it should not be difficult in Lua. Note that this may be the leftover from a long footnote that started on some previous page. --MHB On Jan 3, 2016 5:26 PM, "Hans Hagen" wrote: > On 1/3/2016 8:58 PM, Mohammad Hossein Bateni wrote: > >> I just found out that >> \definenote[afootnote][rule=3D{on,right}] >> instead of >> \definenote[afootnote][rule=3Dright] >> works and places the footnote rule on the right-hand side. >> >> Still wondering about how to get automatic right/left rules. >> > > what do you mean with automatic ... the problem with mixed direction > documents is that these things are part of the document design: dominant > direction vs local direction and right now we don't have a clear model fo= r > that (if only because till now demands were always conflicting so what > works as default for someone doesn't for someone else) > > (i can imagine some modules that set up things) > > On Sun, Jan 3, 2016 at 1:22 PM, Mohammad Hossein Bateni >> > wrote: >> >> Hi, >> >> This has been previously discussed on the list but I didn't find a >> resolution to the issue. It might as well be my fault since I >> didn't go through the entire archive and I am needless to say new to >> CONTEXT. >> >> In a bidi text (Persian/English in my case), I would like the >> footnote rule to be placed on the right-hand side if and only if the >> first line of the footnote text is RTL. Is there a way this >> information can be obtained within a user-defined rulecommand. >> Ideally I'd like a rule=3Dautodir attribute for notes in addition to >> the current left & right. >> >> Speaking of which, the left & right rules do not seem to work, or I >> misunderstand their point. When used (either left or right), the >> footnote rule disappears. >> >> \starttext >> >> \definenote[afootnote][paragraph=3Dno,rule=3Dright] >> >> \startalignment[r2l] >> righttoleft text\afootnote{\input ward } >> \input tufte >> \stopalignment >> >> \startalignment[l2r] >> lefttoright text\afootnote{\input ward} >> \input tufte >> \stopalignment >> >> \stoptext >> >> I see these defined in strc-not.mkvi >> < >> http://repo.or.cz/w/context.git/blob/HEAD:/tex/context/base/strc-not.mkv= i> >> and >> still don't work with "% macros=3Dmkvi" in the first line of the inp= ut >> file and when the file has extension mkvi. Is this some issue of >> mkiv vs mkvi? For what it's worth, I don't notice a reference to >> MKVI in the compilation output. >> >> Back to the main question, I can define my own rule as follows: >> >> \unprotect >> \def\myfootrule{% >> \ifvmode >> \dontleavehmode \hskip.8\hsize\blackrule >> [\c!color=3D\noteparameter\c!rulecolor, >> \c!width=3D.2\hsize, >> \c!height=3D\noteparameter\c!rulethickness, >> \c!depth=3D\zeropoint]% >> \endgraf >> \kern\strutdepth >> \fi} >> \protect >> >> Then I can use >> >> >> \definenote[afootnote][paragraph=3Dno,rule=3Dcommand,rulecommand=3D\myfo= otrule] >> >> to get a footnote rule on the right-hand side. If I can figure out >> whether the first line of the footnote text is RTL or LTR, an >> if-statement can do the trick I want. >> >> Somewhat related to this, I was wondering whether it's possible to >> define two note commands, say \footnote and \afootnote, that use the >> same counter but are otherwise completely different. >> >> I use TeXLive 2015 on Mac OS X, >> CONTEXT 2015.05.18 12:26, and >> LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238). >> >> Thanks a lot! >> =E2=80=94MHB >> >> >> >> >> >> ________________________________________________________________________= ___________ >> If your question is of interest to others as well, please add an entry t= o >> 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 >> >> ________________________________________________________________________= ___________ >> >> > > -- > > ----------------------------------------------------------------- > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com > | www.pragma-pod.nl > ----------------------------------------------------------------- > > _________________________________________________________________________= __________ > 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 > > _________________________________________________________________________= __________ --001a113d12a4091dc6052876d076 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

I see your point, Hans. For what it's worth, that's = the default for mixed Persian/English documents unless one uses a system th= at cannot do it. For instance, FarsiTeX and XePersian provide that as defau= lt behavior.

That said, I'm not asking for this to be the default. I = only want to know how it can be achieved. The code will be put in my style = file or module.

Is it possible to determine the direction of the first line = of footnote block while typesetting the footnote rule? I imagine it should = not be difficult in Lua. Note that this may be the leftover from a long foo= tnote that started on some previous page.

--MHB

On Jan 3, 2016 5:26 PM, "Hans Hagen" &= lt;pragma@wxs.nl> wrote:
On 1/3/2016 8:58 PM, Mohammad = Hossein Bateni wrote:
I just found out that
=C2=A0 =C2=A0\definenote[afootnote][rule=3D{on,right}]
instead of
=C2=A0 =C2=A0\definenote[afootnote][rule=3Dright]
works and places the footnote rule on the right-hand side.

Still wondering about how to get automatic right/left rules.

what do you mean with automatic ... the problem with mixed direction docume= nts is that these things are part of the document design: dominant directio= n vs local direction and right now we don't have a clear model for that= (if only because till now demands were always conflicting so what works as= default for someone doesn't for someone else)

(i can imagine some modules that set up things)

On Sun, Jan 3, 2016 at 1:22 PM, Mohammad Hossein Bateni
<bateni@gmail.com<= /a> <mailto:bateni= @gmail.com>> wrote:

=C2=A0 =C2=A0 Hi,

=C2=A0 =C2=A0 This has been previously discussed on the list but I didn'= ;t find a
=C2=A0 =C2=A0 resolution to the issue.=C2=A0 It might as well be my fault s= ince I
=C2=A0 =C2=A0 didn't go through the entire archive and I am needless to= say new to
=C2=A0 =C2=A0 CONTEXT.

=C2=A0 =C2=A0 In a bidi text (Persian/English in my case), I would like the=
=C2=A0 =C2=A0 footnote rule to be placed on the right-hand side if and only= if the
=C2=A0 =C2=A0 first line of the footnote text is RTL.=C2=A0 Is there a way = this
=C2=A0 =C2=A0 information can be obtained within a user-defined rulecommand= .
=C2=A0 =C2=A0 Ideally I'd like a rule=3Dautodir attribute for notes in = addition to
=C2=A0 =C2=A0 the current left & right.

=C2=A0 =C2=A0 Speaking of which, the left & right rules do not seem to = work, or I
=C2=A0 =C2=A0 misunderstand their point.=C2=A0 When used (either left or ri= ght), the
=C2=A0 =C2=A0 footnote rule disappears.

=C2=A0 =C2=A0 \starttext

=C2=A0 =C2=A0 \definenote[afootnote][paragraph=3Dno,rule=3Dright]

=C2=A0 =C2=A0 \startalignment[r2l]
=C2=A0 =C2=A0 righttoleft text\afootnote{\input ward }
=C2=A0 =C2=A0 \input tufte
=C2=A0 =C2=A0 \stopalignment

=C2=A0 =C2=A0 \startalignment[l2r]
=C2=A0 =C2=A0 lefttoright text\afootnote{\input ward}
=C2=A0 =C2=A0 \input tufte
=C2=A0 =C2=A0 \stopalignment

=C2=A0 =C2=A0 \stoptext

=C2=A0 =C2=A0 I see these defined in strc-not.mkvi
=C2=A0 =C2=A0 <http://re= po.or.cz/w/context.git/blob/HEAD:/tex/context/base/strc-not.mkvi> an= d
=C2=A0 =C2=A0 still don't work with "% macros=3Dmkvi" in the = first line of the input
=C2=A0 =C2=A0 file and when the file has extension mkvi.=C2=A0 Is this some= issue of
=C2=A0 =C2=A0 mkiv vs mkvi?=C2=A0 For what it's worth, I don't noti= ce a reference to
=C2=A0 =C2=A0 MKVI in the compilation output.

=C2=A0 =C2=A0 Back to the main question, I can define my own rule as follow= s:

=C2=A0 =C2=A0 \unprotect
=C2=A0 =C2=A0 \def\myfootrule{%
=C2=A0 =C2=A0 =C2=A0 \ifvmode
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\dontleavehmode \hskip.8\hsize\bla= ckrule
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[\c!color=3D\noteparameter\= c!rulecolor,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \c!width=3D.2\hsize,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \c!height=3D\noteparameter= \c!rulethickness,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \c!depth=3D\zeropoint]% =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\endgraf
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\kern\strutdepth
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\fi}
=C2=A0 =C2=A0 \protect

=C2=A0 =C2=A0 Then I can use

=C2=A0 =C2=A0 \definenote[afootnote][paragraph=3Dno,rule=3Dcommand,rulecomm= and=3D\myfootrule]

=C2=A0 =C2=A0 to get a footnote rule on the right-hand side.=C2=A0 If I can= figure out
=C2=A0 =C2=A0 whether the first line of the footnote text is RTL or LTR, an=
=C2=A0 =C2=A0 if-statement can do the trick I want.

=C2=A0 =C2=A0 Somewhat related to this, I was wondering whether it's po= ssible to
=C2=A0 =C2=A0 define two note commands, say \footnote and \afootnote, that = use the
=C2=A0 =C2=A0 same counter but are otherwise completely different.

=C2=A0 =C2=A0 I use TeXLive 2015 on Mac OS X,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 CONTEXT 2015.05.18 12:26= , and
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 LuaTeX, Version beta-0.80.= 0 (TeX Live 2015) (rev 5238).

=C2=A0 =C2=A0 Thanks a lot!
=C2=A0 =C2=A0 =E2=80=94MHB




___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://tex.aanhet.net
archive=C2=A0 : http://foundry.supelec.fr/projects/con= textrev/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________



--

-----------------------------------------------------------------
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 H= ans Hagen | PRAGMA ADE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Ridderstraat 27 | 8061 GH = Hasselt | The Netherlands
=C2=A0 =C2=A0 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://tex.aanhet.net
archive=C2=A0 : http://foundry.supelec.fr/projects/con= textrev/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________
--001a113d12a4091dc6052876d076-- --===============5567600764249387953== 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= --===============5567600764249387953==--