bidi in footnotes
Dear gang, In the attached/following example, bidi is not applied in the footnote: \setupdirections[bidi=global] \starttext \definedfont[file:almfixed.otf*arabic at 14pt] Test امتحان test \startfootnote \definedfont[file:almfixed.otf*arabic at 14pt] Test امتحان test \stopfootnote{} \stoptext Is there something else that I need to do? Thanks in advance! [Also: Is there a way to not have to declare \definedfont twice?] Best wishes Idris -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80512
maybe something like this would help: \startsetups[bidi:footnotes] \setupdirections[bidi=on] \stopsetups \setupnotes[footnote][setups=bidi:footnotes] but I did not test it now. On Wed, Jun 20, 2018 at 5:26 PM Idris Samawi Hamid ادريس سماوي حامد < Idris.Hamid@colostate.edu> wrote:
Dear gang,
In the attached/following example, bidi is not applied in the footnote:
\setupdirections[bidi=global]
\starttext \definedfont[file:almfixed.otf*arabic at 14pt] Test امتحان test \startfootnote \definedfont[file:almfixed.otf*arabic at 14pt] Test امتحان test \stopfootnote{} \stoptext
Is there something else that I need to do? Thanks in advance!
[Also: Is there a way to not have to declare \definedfont twice?]
Best wishes Idris -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80512___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net
___________________________________________________________________________________
Hi Idriss, As Mohammad Hossein pointed out, adding a setups solves both problems you mentioned (font declaration and bidi in footnotes): %%%%% begin test-bidi-footnote.tex \setupdirections[bidi=global] \startsetups[bidi:footnotes] \setupdirections[bidi=on] \definedfont[file:almfixed.otf*arabic at 14pt] \stopsetups \setupnotes[footnote][setups=bidi:footnotes] \starttext \definedfont[file:almfixed.otf*arabic at 14pt] Test امتحان test \startfootnote Test امتحان test \stopfootnote{} \stoptext %%%%% end test-bidi-footnote.tex Best regards: OK
On 20 Jun 2018, at 23:22, Idris Samawi Hamid ادريس سماوي حامد <Idris.Hamid@colostate.edu> wrote:
Dear gang,
In the attached/following example, bidi is not applied in the footnote:
\setupdirections[bidi=global]
\starttext \definedfont[file:almfixed.otf*arabic at 14pt] Test امتحان test \startfootnote \definedfont[file:almfixed.otf*arabic at 14pt] Test امتحان test \stopfootnote{} \stoptext
Is there something else that I need to do? Thanks in advance!
[Also: Is there a way to not have to declare \definedfont twice?]
Best wishes Idris -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80512
___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
Salaam, Mohammad Hossein, Otared,
On Wed, 20 Jun 2018 15:27:56 -0600, Mohammad Hossein Bateni
\startsetups[bidi:footnotes] \setupdirections[bidi=on] \stopsetups \setupnotes[footnote][setups=bidi:footnotes]
On Wed, 20 Jun 2018 22:31:05 -0600, Otared Kavian
%%%%% begin test-bidi-footnote.tex \setupdirections[bidi=global] \startsetups[bidi:footnotes] \setupdirections[bidi=on] \definedfont[file:almfixed.otf*arabic at 14pt] \stopsetups \setupnotes[footnote][setups=bidi:footnotes]
\starttext \definedfont[file:almfixed.otf*arabic at 14pt] Test امتحان test \startfootnote Test امتحان test \stopfootnote{} \stoptext %%%%% end test-bidi-footnote.tex
Many thanks. Question: Is this use of setups now the "official" or preferred way to handle footnote typography options? On the surface, it appears to be overkill. For the declaration \setupdirections[bidi=global] shouldn't that mean that bidi is applied, well, globally? For \definedfont the behavior is less surprising, since that is obviously a local command. But is setups the official way to globalize the command (aside from typescripts or simplefonts)? Best wishes Idris
On 20 Jun 2018, at 23:22, Idris Samawi Hamid ادريس سماوي حامد <Idris.Hamid@colostate.edu> wrote:
Dear gang,
In the attached/following example, bidi is not applied in the footnote:
\setupdirections[bidi=global]
\starttext \definedfont[file:almfixed.otf*arabic at 14pt] Test امتحان test \startfootnote \definedfont[file:almfixed.otf*arabic at 14pt] Test امتحان test \stopfootnote{} \stoptext
Is there something else that I need to do? Thanks in advance!
[Also: Is there a way to not have to declare \definedfont twice?]
-- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80512
I believe, you would need the setups, even if you had set up typescripts. For some reason, the environments for footnotes and marginnotes are different from that of the main content's. I got this solution from Wolfgang/Hans two years ago, so I suppose it's the officially recommended way. I do not know how heavy setupdirections is, but this method, I guess, applies that command *once per page*. It might be too much, but it's the price you pay for correct bidi formatting. For example, I hate to see that I need to babysit page numbers (LTR) within Farsi text (RTL) in headers but that's life. On Thu, Jun 21, 2018 at 8:22 AM Idris Samawi Hamid ادريس سماوي حامد < Idris.Hamid@colostate.edu> wrote:
Salaam, Mohammad Hossein, Otared,
On Wed, 20 Jun 2018 15:27:56 -0600, Mohammad Hossein Bateni
wrote: \startsetups[bidi:footnotes] \setupdirections[bidi=on] \stopsetups \setupnotes[footnote][setups=bidi:footnotes]
On Wed, 20 Jun 2018 22:31:05 -0600, Otared Kavian
wrote: %%%%% begin test-bidi-footnote.tex \setupdirections[bidi=global] \startsetups[bidi:footnotes] \setupdirections[bidi=on] \definedfont[file:almfixed.otf*arabic at 14pt] \stopsetups \setupnotes[footnote][setups=bidi:footnotes]
\starttext \definedfont[file:almfixed.otf*arabic at 14pt] Test امتحان test \startfootnote Test امتحان test \stopfootnote{} \stoptext %%%%% end test-bidi-footnote.tex
Many thanks. Question: Is this use of setups now the "official" or preferred way to handle footnote typography options? On the surface, it appears to be overkill. For the declaration
\setupdirections[bidi=global]
shouldn't that mean that bidi is applied, well, globally?
For \definedfont the behavior is less surprising, since that is obviously a local command. But is setups the official way to globalize the command (aside from typescripts or simplefonts)?
Best wishes Idris
On 20 Jun 2018, at 23:22, Idris Samawi Hamid ادريس سماوي حامد <Idris.Hamid@colostate.edu> wrote:
Dear gang,
In the attached/following example, bidi is not applied in the footnote:
\setupdirections[bidi=global]
\starttext \definedfont[file:almfixed.otf*arabic at 14pt] Test امتحان test \startfootnote \definedfont[file:almfixed.otf*arabic at 14pt] Test امتحان test \stopfootnote{} \stoptext
Is there something else that I need to do? Thanks in advance!
[Also: Is there a way to not have to declare \definedfont twice?]
-- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80512
___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net
___________________________________________________________________________________
On Thu, 21 Jun 2018 06:20:45 -0600
Idris Samawi Hamid ادريس سماوي حامد
Many thanks. Question: Is this use of setups now the "official" or preferred way to handle footnote typography options? On the surface, it appears to be overkill. For the declaration
\setupdirections[bidi=global]
shouldn't that mean that bidi is applied, well, globally?
The same holds for \setupalign[verytolerant], for example, that does not get applied to a (figure,table) caption... These environments (captions, footnotes, ...) inherit their settings and then live independently. Alan
On Thu, 21 Jun 2018 08:36:52 -0600, Alan Braslau
On Thu, 21 Jun 2018 06:20:45 -0600 Idris Samawi Hamid ادريس سماوي حامد
wrote: Many thanks. Question: Is this use of setups now the "official" or preferred way to handle footnote typography options? On the surface, it appears to be overkill. For the declaration
\setupdirections[bidi=global]
shouldn't that mean that bidi is applied, well, globally?
The same holds for \setupalign[verytolerant], for example, that does not get applied to a (figure,table) caption...
These environments (captions, footnotes, ...) inherit their settings and then live independently.
Many thanks. Is there (Hans? Wolfgang?) available somewhere 1. a complete list of these environments whose typographical settings are decoupled from the rest of the document? 2. a complete list of those typographical settings (bidi, whitespace, etc,) which are have to explicitly setup for such environments? If not, such lists should be compiled in lieu of trial and error -) Best wishes Idris -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80512
Idris Samawi Hamid ادريس سماوي حامد mailto:Idris.Hamid@colostate.edu 22. Juni 2018 um 21:01 On Thu, 21 Jun 2018 08:36:52 -0600, Alan Braslau
wrote: Many thanks. Is there (Hans? Wolfgang?) available somewhere
1. a complete list of these environments whose typographical settings are decoupled from the rest of the document?
The problem you mentioned isn’t limited to bidi but applies also to linbreaking for east asian languages (e.g. chinese) and fixing it makes sense. The reason why you have to re-enable the functions is that certain environment disable a number of Lua attributes to avoid side effects, e.g. to change the footnote color when you change the text color at the page break. One way to fix this is to make the attributes of the affected commands global which means they won’t be reseted, e.g. change the line (typo-dir.mkiv) \definesystemattribute[directions][public] to \definesystemattribute[directions][public,global] Another way is to re-enable the commands in footnotes etc. \appendtoks \ifcase\directionsbidimode \else \setdirection[\number\directionsbidimode]% \fi \to \everybeforenoteinsert There are three parts in context where attributes are disabled which affects bidi: 1. Note inserts which affects \footnote. 2. Margin data which affects \inmargin etc. 3. The output routine which affects header and footer lines. 2. a complete list of those typographical settings (bidi, whitespace, etc,) which are have to explicitly setup for such environments? Whitespace etc. are unrelated to the problem above and can be changed with the normal setup-commands. Wolfgang
On Fri, 22 Jun 2018 14:13:22 -0600, Wolfgang Schuster
2. a complete list of those typographical settings (bidi, whitespace, etc,) which are have to explicitly setup for such environments?
Whitespace etc. are unrelated to the problem above and can be changed with the normal setup-commands.
Counterexample to whitespace attached and below: \setupwhitespace[big] \starttext \input ward \par \input ward \startfootnote \input ward \par \input ward \stopfootnote{} \stoptext Whitespace is applied in the main text but not in the footnotes. How is this case different from global declaration of bidi etc.? It seems these elements really do live in their own world now.. Again, what are the general classes of commands and guidelines governing what declarations are globally applied and which are not? -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80512
oops, attached
On Sat, 23 Jun 2018 06:17:27 -0600, Idris Samawi Hamid ادريس سماوي حامد
On Fri, 22 Jun 2018 14:13:22 -0600, Wolfgang Schuster
wrote: 2. a complete list of those typographical settings (bidi, whitespace, etc,) which are have to explicitly setup for such environments?
Whitespace etc. are unrelated to the problem above and can be changed with the normal setup-commands.
Counterexample to whitespace attached and below:
\setupwhitespace[big]
\starttext \input ward \par \input ward \startfootnote \input ward \par \input ward \stopfootnote{} \stoptext
Whitespace is applied in the main text but not in the footnotes. How is this case different from global declaration of bidi etc.? It seems these elements really do live in their own world now..
Again, what are the general classes of commands and guidelines governing what declarations are globally applied and which are not?
-- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80512
Idris Samawi Hamid ادريس سماوي حامد mailto:Idris.Hamid@colostate.edu 23. Juni 2018 um 14:17 On Fri, 22 Jun 2018 14:13:22 -0600, Wolfgang Schuster
wrote: 2. a complete list of those typographical settings (bidi, whitespace, etc,) which are have to explicitly setup for such environments?
Whitespace etc. are unrelated to the problem above and can be changed with the normal setup-commands.
Counterexample to whitespace attached and below:
\setupwhitespace[big]
\starttext \input ward \par \input ward \startfootnote \input ward \par \input ward \stopfootnote{} \stoptext
Whitespace is applied in the main text but not in the footnotes. How is this case different from global declaration of bidi etc.? It seems these elements really do live in their own world now..
This would lead to other side effects shown in the following example. When you use the global whitespace settings in footnotes you get the same space between each footnote entry. What can be done is to add a whitespace key to setupnote which is easier than using setups-environment. \definedescription[Spaced][before=,after=] \starttext \startSpaced First entry. \stopSpaced \startSpaced Second entry. \stopSpaced \blank[2*line] \setupwhitespace[big] \startSpaced Third entry. \stopSpaced \startSpaced Fourth entry. \stopSpaced \stoptext Wolfgang
On Sat, 23 Jun 2018 07:10:27 -0600, Wolfgang Schuster
Idris Samawi Hamid ادريس سماوي حامد mailto:Idris.Hamid@colostate.edu 23. Juni 2018 um 14:17 On Fri, 22 Jun 2018 14:13:22 -0600, Wolfgang Schuster
wrote: 2. a complete list of those typographical settings (bidi, whitespace, etc,) which are have to explicitly setup for such environments?
Whitespace etc. are unrelated to the problem above and can be changed with the normal setup-commands.
Counterexample to whitespace attached and below:
\setupwhitespace[big]
\starttext \input ward \par \input ward \startfootnote \input ward \par \input ward \stopfootnote{} \stoptext
Whitespace is applied in the main text but not in the footnotes. How is this case different from global declaration of bidi etc.? It seems these elements really do live in their own world now..
This would lead to other side effects shown in the following example.
Yes, ok.
When you use the global whitespace settings in footnotes you get the same space between each footnote entry. What can be done is to add a whitespace key to setupnote which is easier than using setups-environment.
Could this be a feature request then? So \setupnote[whitespace=big,bidi=on] [Although in the case of bidi I still think that one declaration of bidi=global at the beginning of the document should radiate to all other elements, except as otherwise configured through their \setup<command>'s etc.] Many thanks for the explanations. Best wishes Idris -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80512
Idris Samawi Hamid ادريس سماوي حامد mailto:Idris.Hamid@colostate.edu 23. Juni 2018 um 23:49 On Sat, 23 Jun 2018 07:10:27 -0600, Wolfgang Schuster
wrote: When you use the global whitespace settings in footnotes you get the same space between each footnote entry. What can be done is to add a whitespace key to setupnote which is easier than using setups-environment.
Could this be a feature request then? So
\setupnote[whitespace=big,bidi=on] I forgot that you can set the whitespace also with the style-key from \setupnotation.
\setupnotation[footnote][style={\setupwhitespace[line]}] \starttext \input ward\footnote{\input{knuth}} \stoptext Wolfgang
On Wed, 27 Jun 2018 02:03:32 -0600, Wolfgang Schuster
Idris Samawi Hamid ادريس سماوي حامد mailto:Idris.Hamid@colostate.edu 23. Juni 2018 um 23:49 On Sat, 23 Jun 2018 07:10:27 -0600, Wolfgang Schuster
wrote: When you use the global whitespace settings in footnotes you get the same space between each footnote entry. What can be done is to add a whitespace key to setupnote which is easier than using setups-environment.
Could this be a feature request then? So
\setupnote[whitespace=big,bidi=on] I forgot that you can set the whitespace also with the style-key from \setupnotation.
\setupnotation[footnote][style={\setupwhitespace[line]}]
\starttext \input ward\footnote{\input{knuth}} \stoptext
Many thanks. Although bidi is not technically a "style" option, and one may be accused of mixing apples and oranges here, decided to test - see attached and below: ======= \setupdirections[bidi=global] \setupwhitespace[big] \setupnotation[footnote][style={\setupwhitespace[big],\setupdirections[bidi=global]}] \starttext \definedfont[file:almfixed.otf*arabic at 14pt] Test امتحان test \par Test امتحان test \startfootnote \definedfont[file:almfixed.otf*arabic at 14pt] Test امتحان test \par Test امتحان test \stopfootnote{} \stoptext ======= Why does bidi=global get applied to the second paragraph of the footnote, but not to the first? Idris -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80512
On Fri, 22 Jun 2018 14:13:22 -0600, Wolfgang Schuster
Idris Samawi Hamid ادريس سماوي حامد mailto:Idris.Hamid@colostate.edu 22. Juni 2018 um 21:01 On Thu, 21 Jun 2018 08:36:52 -0600, Alan Braslau
wrote: Many thanks. Is there (Hans? Wolfgang?) available somewhere
1. a complete list of these environments whose typographical settings are decoupled from the rest of the document?
The problem you mentioned isn’t limited to bidi but applies also to linbreaking for east asian languages (e.g. chinese) and fixing it makes sense.
The reason why you have to re-enable the functions is that certain environment disable a number of Lua attributes to avoid side effects, e.g. to change the footnote color when you change the text color at the page break.
One way to fix this is to make the attributes of the affected commands global which means they won’t be reseted, e.g. change the line (typo-dir.mkiv)
\definesystemattribute[directions][public]
to
\definesystemattribute[directions][public,global]
Another way is to re-enable the commands in footnotes etc.
\appendtoks \ifcase\directionsbidimode \else \setdirection[\number\directionsbidimode]% \fi \to \everybeforenoteinsert
There are three parts in context where attributes are disabled which affects bidi:
1. Note inserts which affects \footnote.
2. Margin data which affects \inmargin etc.
3. The output routine which affects header and footer lines.
This helps: many thanks for this detailed explanation! -- Idris Samawi Hamid, Professor Department of Philosophy Colorado State University Fort Collins, CO 80512
On 6/22/2018 9:01 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
On Thu, 21 Jun 2018 08:36:52 -0600, Alan Braslau
wrote: On Thu, 21 Jun 2018 06:20:45 -0600 Idris Samawi Hamid ادريس سماوي حامد
wrote: Many thanks. Question: Is this use of setups now the "official" or preferred way to handle footnote typography options? On the surface, it appears to be overkill. For the declaration
\setupdirections[bidi=global]
shouldn't that mean that bidi is applied, well, globally?
The same holds for \setupalign[verytolerant], for example, that does not get applied to a (figure,table) caption...
These environments (captions, footnotes, ...) inherit their settings and then live independently.
Many thanks. Is there (Hans? Wolfgang?) available somewhere
1. a complete list of these environments whose typographical settings are decoupled from the rest of the document?
2. a complete list of those typographical settings (bidi, whitespace, etc,) which are have to explicitly setup for such environments?
If not, such lists should be compiled in lieu of trial and error -) long ago i was working with someone on a wrapup of where/how to use/apply directional layout and bidi and such ... seems to be stalled forever
Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (6)
-
Alan Braslau
-
Hans Hagen
-
Idris Samawi Hamid ادريس سماوي ح امد
-
Mohammad Hossein Bateni
-
Otared Kavian
-
Wolfgang Schuster