Re: [NTG-context] footnotes when using RtL (Arabic)
I’m reviving this old thread, as the problem appears to still exist. Consider the following:
\starttext \showframe
\definenote[afootnote][rule={on,right},paragraph=no]
\startalignment[r2l] Testing.\afootnote{This is footnote one.} Testing testing.\afootnote{This is footnote two.} Testing testing testing.\afootnote{This is footnote three.} \stopalignment
\stoptext
In the output (r2l.pdf), the text runs from right to left as it should, and the footnote reference numbers are in the right margin, as they should be. However, if we switch the option “paragraph” to “yes”, the entire frame no longer runs r2l (see the output in r2l-yes.pdf). What I want is for the text to read as follows:
.eerht etontoof si sihT 3 .owt etontoof si sihT 2 .eno etontoof si sihT 1
where the entire frame begins at the right margin, such that the first footnote number (1) is in the right margin, instead of in the left margin as it is in r2l-yes.pdf. To say it another way, the entire footnote frame should be r2l, regardless of its contents, perhaps (as Idris wrote to me) through some hard direction switch for the entire frame. Best wishes, Talal
I wonder whether anyone might have any thoughts about the below? Many thanks.
On 21 Jul 2015, at 20:56, talazem@fastmail.fm wrote:
I’m reviving this old thread, as the problem appears to still exist. Consider the following:
\starttext \showframe
\definenote[afootnote][rule={on,right},paragraph=no]
\startalignment[r2l] Testing.\afootnote{This is footnote one.} Testing testing.\afootnote{This is footnote two.} Testing testing testing.\afootnote{This is footnote three.} \stopalignment
\stoptext
In the output (r2l.pdf), the text runs from right to left as it should, and the footnote reference numbers are in the right margin, as they should be.
However, if we switch the option “paragraph” to “yes”, the entire frame no longer runs r2l (see the output in r2l-yes.pdf).
What I want is for the text to read as follows: .eerht etontoof si sihT 3 .owt etontoof si sihT 2 .eno etontoof si sihT 1
where the entire frame begins at the right margin, such that the first footnote number (1) is in the right margin, instead of in the left margin as it is in r2l-yes.pdf. To say it another way, the entire footnote frame should be r2l, regardless of its contents, perhaps (as Idris wrote to me) through some hard direction switch for the entire frame.
Best wishes, Talal
On 07/30/2015 03:00 PM, talazem@fastmail.fm wrote:
I wonder whether anyone might have any thoughts about the below? Many thanks.
I wonder whether there is a bug somewhere in notes, because you may have r2l notations, but the notes paragraph is built l2r: \setuppapersize[A6] \starttext \showframe \definenote[afootnote][rule={on,right}, paragraph=yes] \definenotation[afootnote][align=r2l] \startalignment[r2l] Testing.\afootnote{This is footnote one.} Testing testing.\afootnote{This is footnote two.} Testing testing testing.\afootnote{This is footnote three.} \stopalignment \stoptext Just in case it might help, Pablo -- http://www.ousia.tk
Thank you, Pablo. This is indeed the problem: the individual elements — the notes — are correctly RTL, but the overall “paragraph” is ordering the elements LTR (with the additional caveat the footnote paragraph is not properly aligned/justified to the right margin either). Best wishes, Talal
On 30 Jul 2015, at 15:26, Pablo Rodriguez
wrote: On 07/30/2015 03:00 PM, talazem@fastmail.fm wrote:
I wonder whether anyone might have any thoughts about the below? Many thanks.
I wonder whether there is a bug somewhere in notes, because you may have r2l notations, but the notes paragraph is built l2r:
\setuppapersize[A6] \starttext \showframe
\definenote[afootnote][rule={on,right}, paragraph=yes] \definenotation[afootnote][align=r2l]
\startalignment[r2l] Testing.\afootnote{This is footnote one.} Testing testing.\afootnote{This is footnote two.} Testing testing testing.\afootnote{This is footnote three.} \stopalignment
\stoptext
Just in case it might help,
Pablo -- http://www.ousia.tk ___________________________________________________________________________________ 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 ___________________________________________________________________________________
On 07/30/2015 04:43 PM, talazem@fastmail.fm wrote:
Thank you, Pablo. This is indeed the problem: the individual elements — the notes — are correctly RTL, but the overall “paragraph” is ordering the elements LTR (with the additional caveat the footnote paragraph is not properly aligned/justified to the right margin either).
Adding "\definenotation[afootnote][alternative=serried, align=r2l]" makes alignment even worse. Pablo
On 30 Jul 2015, at 15:26, Pablo Rodriguez wrote: On 07/30/2015 03:00 PM, talazem@fastmail.fm wrote:
I wonder whether anyone might have any thoughts about the below? Many thanks.
I wonder whether there is a bug somewhere in notes, because you may have r2l notations, but the notes paragraph is built l2r:
\setuppapersize[A6] \starttext \showframe
\definenote[afootnote][rule={on,right}, paragraph=yes] \definenotation[afootnote][align=r2l]
\startalignment[r2l] Testing.\afootnote{This is footnote one.} Testing testing.\afootnote{This is footnote two.} Testing testing testing.\afootnote{This is footnote three.} \stopalignment
\stoptext
Just in case it might help,
Pablo
Pablo Rodriguez mailto:oinos@gmx.es 30. Juli 2015 16:26
I wonder whether there is a bug somewhere in notes, because you may have r2l notations, but the notes paragraph is built l2r:
\setuppapersize[A6] \starttext \showframe
\definenote[afootnote][rule={on,right}, paragraph=yes] \definenotation[afootnote][align=r2l]
\startalignment[r2l] Testing.\afootnote{This is footnote one.} Testing testing.\afootnote{This is footnote two.} Testing testing testing.\afootnote{This is footnote three.} \stopalignment
\stoptext Can you test the following patch.
\unprotect \def\strc_notes_flush_global {\begingroup \useinterlinespaceparameter\noteparameter \doifelse{\noteparameter\c!paragraph}\v!yes {%\vbox\starthboxestohbox \vbox\ifconditional\displaylefttoright \else dir TRT \fi\starthboxestohbox \iftrialtypesetting\unvcopy\else\unvbox\fi\currentnoteinsertionnumber \stophboxestohbox} {\iftrialtypesetting\unvcopied\else\unvboxed\fi\currentnoteinsertionnumber}% \endgroup} \protect %\setupalign[righttoleft] \setupnote[footnote][paragraph=yes,align=righttoleft] \setupnotation[footnote][align=righttoleft] \showframe \starttext First note.\footnote{This is the first footnote.} Second note.\footnote{This is the second footnote.} \stoptext Wolfgang
Hi Wolfgang,
On Thu, 30 Jul 2015 11:54:55 -0600, Wolfgang Schuster
Pablo Rodriguez mailto:oinos@gmx.es 30. Juli 2015 16:26
I wonder whether there is a bug somewhere in notes, because you may have r2l notations, but the notes paragraph is built l2r:
\setuppapersize[A6] \starttext \showframe
\definenote[afootnote][rule={on,right}, paragraph=yes] \definenotation[afootnote][align=r2l]
\startalignment[r2l] Testing.\afootnote{This is footnote one.} Testing testing.\afootnote{This is footnote two.} Testing testing testing.\afootnote{This is footnote three.} \stopalignment
\stoptext Can you test the following patch.
\unprotect
\def\strc_notes_flush_global {\begingroup \useinterlinespaceparameter\noteparameter \doifelse{\noteparameter\c!paragraph}\v!yes {%\vbox\starthboxestohbox \vbox\ifconditional\displaylefttoright \else dir TRT \fi\starthboxestohbox \iftrialtypesetting\unvcopy\else\unvbox\fi\currentnoteinsertionnumber \stophboxestohbox} {\iftrialtypesetting\unvcopied\else\unvboxed\fi\currentnoteinsertionnumber}% \endgroup}
\protect
%\setupalign[righttoleft]
\setupnote[footnote][paragraph=yes,align=righttoleft] \setupnotation[footnote][align=righttoleft]
\showframe
\starttext
First note.\footnote{This is the first footnote.} Second note.\footnote{This is the second footnote.}
\stoptext
Wolfgang
Looking good... Question: ========From strc-not.mkvi======= \def\strc_notes_flush_global {\begingroup \useinterlinespaceparameter\noteparameter \doifelse{\noteparameter\c!paragraph}\v!yes {\vbox\starthboxestohbox \iftrialtypesetting\unvcopy\else\unvbox\fi\currentnoteinsertionnumber \stophboxestohbox} {\iftrialtypesetting\unvcopied\else\unvboxed\fi\currentnoteinsertionnumber}% \endgroup} ================================= What was key point of attack in the original definition that was hardwiring the TLT in the note markers? Best wishes Idris -- Idris Samawi Hamid Professor of Philosophy Colorado State University Fort Collins, CO 80523
Indeed, that seems to do the trick, Wolfgang.
On 30 Jul 2015, at 18:54, Wolfgang Schuster
wrote: Pablo Rodriguez mailto:oinos@gmx.es 30. Juli 2015 16:26
I wonder whether there is a bug somewhere in notes, because you may have r2l notations, but the notes paragraph is built l2r:
\setuppapersize[A6] \starttext \showframe
\definenote[afootnote][rule={on,right}, paragraph=yes] \definenotation[afootnote][align=r2l]
\startalignment[r2l] Testing.\afootnote{This is footnote one.} Testing testing.\afootnote{This is footnote two.} Testing testing testing.\afootnote{This is footnote three.} \stopalignment
\stoptext Can you test the following patch.
\unprotect
\def\strc_notes_flush_global {\begingroup \useinterlinespaceparameter\noteparameter \doifelse{\noteparameter\c!paragraph}\v!yes {%\vbox\starthboxestohbox \vbox\ifconditional\displaylefttoright \else dir TRT \fi\starthboxestohbox \iftrialtypesetting\unvcopy\else\unvbox\fi\currentnoteinsertionnumber \stophboxestohbox} {\iftrialtypesetting\unvcopied\else\unvboxed\fi\currentnoteinsertionnumber}% \endgroup}
\protect
%\setupalign[righttoleft]
\setupnote[footnote][paragraph=yes,align=righttoleft] \setupnotation[footnote][align=righttoleft]
\showframe
\starttext
First note.\footnote{This is the first footnote.} Second note.\footnote{This is the second footnote.}
\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 ___________________________________________________________________________________
On 07/30/2015 07:54 PM, Wolfgang Schuster wrote:
Pablo Rodriguez 30. Juli 2015 16:26
I wonder whether there is a bug somewhere in notes, because you may have r2l notations, but the notes paragraph is built l2r: [...] Can you test the following patch.
Hi Wolfgang, your patch works fine with both samples. What I wonder is wheter \setupnote and \setupnototation should inherit the property from \setupalign[r2l] or from the alignment in the body position where they are inserted. Pablo
\unprotect
\def\strc_notes_flush_global {\begingroup \useinterlinespaceparameter\noteparameter \doifelse{\noteparameter\c!paragraph}\v!yes {%\vbox\starthboxestohbox \vbox\ifconditional\displaylefttoright \else dir TRT \fi\starthboxestohbox
\iftrialtypesetting\unvcopy\else\unvbox\fi\currentnoteinsertionnumber \stophboxestohbox}
{\iftrialtypesetting\unvcopied\else\unvboxed\fi\currentnoteinsertionnumber}% \endgroup}
\protect
%\setupalign[righttoleft]
\setupnote[footnote][paragraph=yes,align=righttoleft] \setupnotation[footnote][align=righttoleft]
\showframe
\starttext
First note.\footnote{This is the first footnote.} Second note.\footnote{This is the second footnote.}
\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 ___________________________________________________________________________________
I’ve come across a snag. When using parentheses in Arabic footnotes, they are flipped. In any earlier email (http://article.gmane.org/gmane.comp.tex.context/91501/match=setupdirections+...), you had advised adding the following:
\startsetups[note:footnote] \setupdirections[bidi=global] \stopsetups
\setupnote[footnote][setups=note:footnote] % align=righttoleft
However, if one does this with your patch, the second footnote gets dropped. Here is the MWE:
\unprotect
\def\strc_notes_flush_global {\begingroup \useinterlinespaceparameter\noteparameter \doifelse{\noteparameter\c!paragraph}\v!yes {%\vbox\starthboxestohbox \vbox\ifconditional\displaylefttoright \else dir TRT \fi\starthboxestohbox \iftrialtypesetting\unvcopy\else\unvbox\fi\currentnoteinsertionnumber \stophboxestohbox} {\iftrialtypesetting\unvcopied\else\unvboxed\fi\currentnoteinsertionnumber}% \endgroup}
\protect
\definefontfamily[mainface][serif][ALMFixed][features=arabic,range=arabic,] \setupbodyfont [mainface]
\startsetups[note:footnote] \setupdirections[bidi=global] \stopsetups
\setupnote[footnote][paragraph=yes,align=righttoleft,setups=note:footnote,] \setupnotation[footnote][align=righttoleft,alternative=serried,]
\showframe
\starttext
First note.\footnote{هذه هي (التعليقة) الأولى.} Second note.\footnote{هذه هي (التعليقة) الثانية.}
\stoptext
All the best, Talal
On 30 Jul 2015, at 18:54, Wolfgang Schuster
wrote: Pablo Rodriguez mailto:oinos@gmx.es 30. Juli 2015 16:26
I wonder whether there is a bug somewhere in notes, because you may have r2l notations, but the notes paragraph is built l2r:
\setuppapersize[A6] \starttext \showframe
\definenote[afootnote][rule={on,right}, paragraph=yes] \definenotation[afootnote][align=r2l]
\startalignment[r2l] Testing.\afootnote{This is footnote one.} Testing testing.\afootnote{This is footnote two.} Testing testing testing.\afootnote{This is footnote three.} \stopalignment
\stoptext Can you test the following patch.
\unprotect
\def\strc_notes_flush_global {\begingroup \useinterlinespaceparameter\noteparameter \doifelse{\noteparameter\c!paragraph}\v!yes {%\vbox\starthboxestohbox \vbox\ifconditional\displaylefttoright \else dir TRT \fi\starthboxestohbox \iftrialtypesetting\unvcopy\else\unvbox\fi\currentnoteinsertionnumber \stophboxestohbox} {\iftrialtypesetting\unvcopied\else\unvboxed\fi\currentnoteinsertionnumber}% \endgroup}
\protect
%\setupalign[righttoleft]
\setupnote[footnote][paragraph=yes,align=righttoleft] \setupnotation[footnote][align=righttoleft]
\showframe
\starttext
First note.\footnote{This is the first footnote.} Second note.\footnote{This is the second footnote.}
\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 ___________________________________________________________________________________
talazem@fastmail.fm mailto:talazem@fastmail.fm 30. Juli 2015 20:37 I’ve come across a snag. When using parentheses in Arabic footnotes, they are flipped. In any earlier email (http://article.gmane.org/gmane.comp.tex.context/91501/match=setupdirections+...), you had advised adding the following:
\startsetups[note:footnote] \setupdirections[bidi=global] \stopsetups
\setupnote[footnote][setups=note:footnote] % align=righttoleft
However, if one does this with your patch, the second footnote gets dropped. Here is the MWE:
The second note disappears even without the patch, the problem this the paragraph option for the notes. Wolfgang
You’re right. The patch gets us half way to the desired behaviour (namely, correct ordering of the footnotes within the paragraph). But it seems that the ‘paragraph’ option doesn’t play well with RTL generally, resulting in the second note disappearing when using \startsetups[note:footnote] \setupdirections[bidi=global] \stopsetups.
On 30 Jul 2015, at 20:04, Wolfgang Schuster
wrote: talazem@fastmail.fm mailto:talazem@fastmail.fm 30. Juli 2015 20:37 I’ve come across a snag. When using parentheses in Arabic footnotes, they are flipped. In any earlier email (http://article.gmane.org/gmane.comp.tex.context/91501/match=setupdirections+... http://article.gmane.org/gmane.comp.tex.context/91501/match=setupdirections+...), you had advised adding the following:
\startsetups[note:footnote] \setupdirections[bidi=global] \stopsetups
\setupnote[footnote][setups=note:footnote] % align=righttoleft However, if one does this with your patch, the second footnote gets dropped. Here is the MWE:
The second note disappears even without the patch, the problem this the paragraph option for the notes.
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 ___________________________________________________________________________________
On 7/31/2015 1:51 AM, talazem@fastmail.fm wrote:
You’re right. The patch gets us half way to the desired behaviour (namely, correct ordering of the footnotes within the paragraph). But it seems that the ‘paragraph’ option doesn’t play well with RTL generally, resulting in the second note disappearing when using \startsetups[note:footnote] \setupdirections[bidi=global] \stopsetups.
can you try \unprotect \unexpanded\def\leftorrightvbox{\ifconditional\displaylefttoright\expandafter\lefttorightvbox\else\expandafter\righttoleftvbox\fi} \def\strc_notes_flush_global {\begingroup \useinterlinespaceparameter\noteparameter \doifelse{\noteparameter\c!paragraph}\v!yes {\leftorrightvbox {\starthboxestohbox \iftrialtypesetting\unvcopy\else\unvbox\fi\currentnoteinsertionnumber \stophboxestohbox}} {\iftrialtypesetting\unvcopied\else\unvboxed\fi\currentnoteinsertionnumber}% \endgroup} \protect
On 30 Jul 2015, at 20:04, Wolfgang Schuster
mailto:schuster.wolfgang@gmail.com> wrote: talazem@fastmail.fm mailto:talazem@fastmail.fm 30. Juli 2015 20:37 I’ve come across a snag. When using parentheses in Arabic footnotes, they are flipped. In any earlier email (http://article.gmane.org/gmane.comp.tex.context/91501/match=setupdirections+...), you had advised adding the following:
\startsetups[note:footnote] \setupdirections[bidi=global] \stopsetups
\setupnote[footnote][setups=note:footnote] % align=righttoleft However, if one does this with your patch, the second footnote gets dropped. Here is the MWE:
The second note disappears even without the patch, the problem this the paragraph option for the notes.
Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl mailto: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 ___________________________________________________________________________________
___________________________________________________________________________________ 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 ___________________________________________________________________________________
-- ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Excellent. This seems to solve the problem completely. I even tried mixing Arabic and English text in the RTL footnotes, switched on the “alternative=serried” option, and defined my own custom note streams — everything worked very well. The only thing that didn’t work is to mix, in the same stream, footnotes that are LTR with footnotes that are RTL. But I did not expect this to work, and I cannot think of a real world scenario in which such footnotes would/should be mixed in the same stream. Attached are both the .tex file and the PDF with a perfectly working example. Many thanks to you both, Wolfgang and Hans. Hans, I assume we’ll know if the patch eventually makes it into a beta? Best, Talal
On 31 Jul 2015, at 09:39, Hans Hagen
wrote: On 7/31/2015 1:51 AM, talazem@fastmail.fm wrote:
You’re right. The patch gets us half way to the desired behaviour (namely, correct ordering of the footnotes within the paragraph). But it seems that the ‘paragraph’ option doesn’t play well with RTL generally, resulting in the second note disappearing when using \startsetups[note:footnote] \setupdirections[bidi=global] \stopsetups.
can you try
\unprotect
\unexpanded\def\leftorrightvbox{\ifconditional\displaylefttoright\expandafter\lefttorightvbox\else\expandafter\righttoleftvbox\fi}
\def\strc_notes_flush_global {\begingroup \useinterlinespaceparameter\noteparameter \doifelse{\noteparameter\c!paragraph}\v!yes {\leftorrightvbox {\starthboxestohbox \iftrialtypesetting\unvcopy\else\unvbox\fi\currentnoteinsertionnumber \stophboxestohbox}} {\iftrialtypesetting\unvcopied\else\unvboxed\fi\currentnoteinsertionnumber}% \endgroup}
\protect
On 30 Jul 2015, at 20:04, Wolfgang Schuster
mailto:schuster.wolfgang@gmail.com> wrote: talazem@fastmail.fm mailto:talazem@fastmail.fm 30. Juli 2015 20:37 I’ve come across a snag. When using parentheses in Arabic footnotes, they are flipped. In any earlier email (http://article.gmane.org/gmane.comp.tex.context/91501/match=setupdirections+...), you had advised adding the following:
\startsetups[note:footnote] \setupdirections[bidi=global] \stopsetups
\setupnote[footnote][setups=note:footnote] % align=righttoleft However, if one does this with your patch, the second footnote gets dropped. Here is the MWE:
The second note disappears even without the patch, the problem this the paragraph option for the notes.
Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl mailto: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 ___________________________________________________________________________________
___________________________________________________________________________________ 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 ___________________________________________________________________________________
--
----------------------------------------------------------------- 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 ___________________________________________________________________________________
Talal, Wolfgang, Hans,
Salaam.
This is beautiful progress!
Nice Arabic editing font in the sample too -)
Best wishes
Idris
On Fri, 31 Jul 2015 05:07:45 -0600, talazem@fastmail.fm
Excellent. This seems to solve the problem completely. I even tried mixing Arabic and English text in the RTL footnotes, switched on the “alternative=serried” option, and defined my own custom note streams — everything worked very well. The only thing that didn’t work is to mix, in the same stream, footnotes that are LTR with footnotes that are RTL. But I did not expect this to work, and I cannot think of a real world scenario in which such footnotes would/should be mixed in the same stream.
Attached are both the .tex file and the PDF with a perfectly working example. Many thanks to you both, Wolfgang and Hans. Hans, I assume we’ll know if the patch eventually makes it into a beta?
Best, Talal
-- Idris Samawi Hamid Professor of Philosophy Colorado State University Fort Collins, CO 80523
On 7/31/2015 1:07 PM, talazem@fastmail.fm wrote:
Excellent. This seems to solve the problem completely. I even tried mixing Arabic and English text in the RTL footnotes, switched on the “alternative=serried” option, and defined my own custom note streams — everything worked very well. The only thing that didn’t work is to mix, in the same stream, footnotes that are LTR with footnotes that are RTL. But I did not expect this to work, and I cannot think of a real world scenario in which such footnotes would/should be mixed in the same stream.
Attached are both the .tex file and the PDF with a perfectly working example. Many thanks to you both, Wolfgang and Hans. Hans, I assume we’ll know if the patch eventually makes it into a beta?
yes but no upload today (i've also added the example to the test suite) Hans (you can put the patch in cont-new.mkiv in the meantime) ----------------------------------------------------------------- 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 -----------------------------------------------------------------
I’ve run into a hiccup. In the previous MWE that worked with Woflgang and Hans’ patch, the notes were footnotes. However, if make them into linenotes, we run into a strange problem: the first note is typeset correctly, but all the remaining linenotes in that stream are typeset on the bottom left corner of the page. See attached files. Best wishes, Talal
On 31 Jul 2015, at 12:07, talazem@fastmail.fm wrote:
Excellent. This seems to solve the problem completely. I even tried mixing Arabic and English text in the RTL footnotes, switched on the “alternative=serried” option, and defined my own custom note streams — everything worked very well. The only thing that didn’t work is to mix, in the same stream, footnotes that are LTR with footnotes that are RTL. But I did not expect this to work, and I cannot think of a real world scenario in which such footnotes would/should be mixed in the same stream.
Attached are both the .tex file and the PDF with a perfectly working example. Many thanks to you both, Wolfgang and Hans. Hans, I assume we’ll know if the patch eventually makes it into a beta?
Best, Talal
On 31 Jul 2015, at 09:39, Hans Hagen
wrote: On 7/31/2015 1:51 AM, talazem@fastmail.fm wrote:
You’re right. The patch gets us half way to the desired behaviour (namely, correct ordering of the footnotes within the paragraph). But it seems that the ‘paragraph’ option doesn’t play well with RTL generally, resulting in the second note disappearing when using \startsetups[note:footnote] \setupdirections[bidi=global] \stopsetups.
can you try
\unprotect
\unexpanded\def\leftorrightvbox{\ifconditional\displaylefttoright\expandafter\lefttorightvbox\else\expandafter\righttoleftvbox\fi}
\def\strc_notes_flush_global {\begingroup \useinterlinespaceparameter\noteparameter \doifelse{\noteparameter\c!paragraph}\v!yes {\leftorrightvbox {\starthboxestohbox \iftrialtypesetting\unvcopy\else\unvbox\fi\currentnoteinsertionnumber \stophboxestohbox}} {\iftrialtypesetting\unvcopied\else\unvboxed\fi\currentnoteinsertionnumber}% \endgroup}
\protect
On 30 Jul 2015, at 20:04, Wolfgang Schuster
mailto:schuster.wolfgang@gmail.com> wrote: talazem@fastmail.fm mailto:talazem@fastmail.fm 30. Juli 2015 20:37 I’ve come across a snag. When using parentheses in Arabic footnotes, they are flipped. In any earlier email (http://article.gmane.org/gmane.comp.tex.context/91501/match=setupdirections+...), you had advised adding the following:
\startsetups[note:footnote] \setupdirections[bidi=global] \stopsetups
\setupnote[footnote][setups=note:footnote] % align=righttoleft However, if one does this with your patch, the second footnote gets dropped. Here is the MWE:
The second note disappears even without the patch, the problem this the paragraph option for the notes.
Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl mailto: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 ___________________________________________________________________________________
___________________________________________________________________________________ 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 ___________________________________________________________________________________
--
----------------------------------------------------------------- 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 ___________________________________________________________________________________
___________________________________________________________________________________ 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 ___________________________________________________________________________________
On 08/02/2015 12:36 AM, talazem@fastmail.fm wrote:
I’ve run into a hiccup. In the previous MWE that worked with Woflgang and Hans’ patch, the notes were footnotes. However, if make them into linenotes, we run into a strange problem: the first note is typeset correctly, but all the remaining linenotes in that stream are typeset on the bottom left corner of the page. See attached files.
Hi Talal, I experienced this issue before (although r2l languages are all Greek to me :-(). \setupdirections[bidi=global, method=two] seems to fix the problem. I hope it helps, Pablo -- http://www.ousia.tk
Thank you, Pablo, for bringing method=two to my attention. I’ve read what has been written about in on the mailing list. However, in my case, it does not solve the problem. On the document I’ve attached: - using method=default produces the error I raised yesterday; - using method=one (or method=two) seem to do nothing — the parentheses are still inversed, as if I hadn’t defined \setupdirections at all. See attached: Talal
On 2 Aug 2015, at 08:52, Pablo Rodriguez
wrote: On 08/02/2015 12:36 AM, talazem@fastmail.fm wrote:
I’ve run into a hiccup. In the previous MWE that worked with Woflgang and Hans’ patch, the notes were footnotes. However, if make them into linenotes, we run into a strange problem: the first note is typeset correctly, but all the remaining linenotes in that stream are typeset on the bottom left corner of the page. See attached files.
Hi Talal,
I experienced this issue before (although r2l languages are all Greek to me :-().
\setupdirections[bidi=global, method=two] seems to fix the problem.
I hope it helps,
Pablo -- http://www.ousia.tk ___________________________________________________________________________________ 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 ___________________________________________________________________________________
Apologies: While the problem remains, I realise now that using "method=one" or "method=two" wasn’t having any effect because I had forgotten to add the option "align=righttoleft,” to "\setupnotations[lnote]”. Having done so, adding the method options do have an effect. But the output is still flawed; the beginning of the third note is missing at the end of the first line of the footnote, while its last few words can be seen on the second line of the footnote. See my new attachment (linenotes r2l 3,tex) below:
On 2 Aug 2015, at 10:20, talazem@fastmail.fm wrote:
Thank you, Pablo, for bringing method=two to my attention. I’ve read what has been written about in on the mailing list. However, in my case, it does not solve the problem. On the document I’ve attached: - using method=default produces the error I raised yesterday; - using method=one (or method=two) seem to do nothing — the parentheses are still inversed, as if I hadn’t defined \setupdirections at all. See attached:
Talal
On 2 Aug 2015, at 08:52, Pablo Rodriguez
wrote: On 08/02/2015 12:36 AM, talazem@fastmail.fm wrote:
I’ve run into a hiccup. In the previous MWE that worked with Woflgang and Hans’ patch, the notes were footnotes. However, if make them into linenotes, we run into a strange problem: the first note is typeset correctly, but all the remaining linenotes in that stream are typeset on the bottom left corner of the page. See attached files.
Hi Talal,
I experienced this issue before (although r2l languages are all Greek to me :-().
\setupdirections[bidi=global, method=two] seems to fix the problem.
I hope it helps,
Pablo -- http://www.ousia.tk ___________________________________________________________________________________ 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 ___________________________________________________________________________________
On 08/02/2015 12:02 PM, talazem@fastmail.fm wrote:
Apologies: While the problem remains, I realise now that using "method=one" or "method=two" wasn’t having any effect because I had forgotten to add the option "align=righttoleft,” to "\setupnotations[lnote]”. Having done so, adding the method options do have an effect. But the output is still flawed; the beginning of the third note is missing at the end of the first line of the footnote, while its last few words can be seen on the second line of the footnote. See my new attachment (linenotes r2l 3,tex) below:
Hi Talal, replace you bidi settings with this ones: \setupdirections[bidi=global, method=two] \startsetups[note:linenote] \setupdirections[bidi=global,method=two,fences=yes] \stopsetups \setupalign[r2l] At least, they work for me. Pablo -- http://www.ousia.tk
Thanks for the help, Pablo, but, unfortunately, this is not solving the problem (at least over here): The beginning of the third footnote/linenote is still missing. It should read (at the end of line one and at the beginning of line two of the notes): 0 وهذه تعليقة The end of line one is dropped. I have put an arrow on the attached PDF to demonstrate where it should be. (Of course, it is possible that our source tex files are slightly different?) Talal
On 2 Aug 2015, at 11:47, Pablo Rodriguez
wrote: On 08/02/2015 12:02 PM, talazem@fastmail.fm wrote:
Apologies: While the problem remains, I realise now that using "method=one" or "method=two" wasn’t having any effect because I had forgotten to add the option "align=righttoleft,” to "\setupnotations[lnote]”. Having done so, adding the method options do have an effect. But the output is still flawed; the beginning of the third note is missing at the end of the first line of the footnote, while its last few words can be seen on the second line of the footnote. See my new attachment (linenotes r2l 3,tex) below:
Hi Talal,
replace you bidi settings with this ones:
\setupdirections[bidi=global, method=two]
\startsetups[note:linenote] \setupdirections[bidi=global,method=two,fences=yes] \stopsetups
\setupalign[r2l]
At least, they work for me.
Pablo -- http://www.ousia.tk ___________________________________________________________________________________ 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 ___________________________________________________________________________________
On 08/02/2015 12:47 PM, Pablo Rodriguez wrote:
[...] Hi Talal,
replace you bidi settings with these ones: [...] At least, they work for me.
Talal, sorry for the noise, the first linenote has the problem you described. I thought it belonged to the second linenote. Pablo -- http://www.ousia.tk
In a separate thread ("r2l alignment and linenumbering conflict? http://article.gmane.org/gmane.comp.tex.context/92201"), we've gotten numerals in an Arabic RTL document to (a) display as Arabic numerals, and (b) to order their digits in the right order (e.g. 2015 instead of 5102). By defining the headstyle of linenotes, we can even get linenotes to display the digits within individual numbers in the correct order (see below). However, when there is a line range in the linenote head, it is flipping the order of the page ranges. In the example PDF attached below, where it should read ١٥-١٦ (16-15, with the fifteen on the right and the sixteen on the left, for R2L word ordering), instead the output is ١٦-١٥. This seems to be a further example of the problems arising from not being able to apply bidi to the linenote stream, due to the bug or conflict between footnotes/linenotes and R2L. In the minimal example below, I have commented out the \startsetups[note:linenote]. The lines may be toggled to see the effect it has. ===== \mainlanguage[arabic] \definefontfamily [mainface] [rm] [ALM Fixed] [range=arabic,features=arabic] \setupbodyfont[mainface,12pt] \setupdirections[bidi=global,method=two] \setupalign[r2l] %% CONVERSION INTO ARABIC-HINDI NUMERALS \defineconversion[myconversion][١,٢,٣,٤,٥,٦,٧,٨,٩,١٠,١١,١٢,١٣,١٤,١٥,١٦,١٧,١٨,١٩,٢٠,] %% HEADINGS \setuppagenumber[numberconversion=myconversion] %%% LINENUMBERING \setuplinenumbering[% style=\tfxx, referencing=on, step=1, location=outer, method=page, align=left, distance=1em, width=0.4em, conversion=myconversion, ] \definelinenote[linenote][% setups=note:linenote, before={\blank[3.2em]}, align=righttoleft, rule={on,right}, paragraph=yes, frame=on,framecolor=red, ] \setupnotations[linenote][% align=righttoleft, alternative=serried, width=broad, distance=.5em, display=no, numberconversion=arabic-hindi, headstyle=\lefttoright, ] \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}}} %%% DOCUMENT %\startsetups[note:linenote] % \setupdirections[bidi=on,method=default,fences=no] %\stopsetups \starttext \showframe \startlinenumbering \input ward\linenote{هذه تعليقة أولى.} \input ward\linenote{هذه تعليقة ثانية.} \input ward\linenote{هذه تعليقة ثالثة.} مرحباً بالعالم مرحباً بالعالم مرحباً بالعالم . هذا مثال على استعمال كونتكست لأجل تحقيق المخطوطات في اللغة العربية . وقد قربنا من \variant{الوصول إلى الحلول}{الحصول على الحلول} التي نحتاجها لتصميم الخطوط التي تكتب من اليمين إلى الشمال . \linenote{هذه تعليقة خامسة.} \stoplinenumbering \stoptext ===== Best, Talal
On 2 Aug 2015, at 12:11, Pablo Rodriguez
wrote: On 08/02/2015 12:47 PM, Pablo Rodriguez wrote:
[...] Hi Talal,
replace you bidi settings with these ones: [...] At least, they work for me.
Talal,
sorry for the noise, the first linenote has the problem you described.
I thought it belonged to the second linenote.
Pablo -- http://www.ousia.tk ___________________________________________________________________________________ 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 ___________________________________________________________________________________
participants (5)
-
Hans Hagen
-
Idris Samawi Hamid ادريس سماوي ح امد
-
Pablo Rodriguez
-
talazem@fastmail.fm
-
Wolfgang Schuster