Problems with indexing (+feature requests)
![](https://secure.gravatar.com/avatar/f129f440ec71ca911da1a6024736cda2.jpg?s=120&d=mm&r=g)
Hello, For a few days I have been playing with registers to generate an RTL index. Beside sorting, I ran into the following. 1) How can I get the index section using \subject? In some styles, I do not want to see the section number. 2) How can I get the Persian comma used instead of the English comma in page numbers and also before "see also"? The first one I can fix by a hack but not the second one: defining a custom pagecommand that sets \registerpageseparatorsymbol to the Persian comma! There is a TODO comment in strc-reg.mkiv that the comma customization has been planned. 3) In RTL registers, if an entry starts with an LTR char, the order of index entry and page number will be incorrect. We had similar issues with section headings before. I can "fix" this by setting pagestyle=\zwnj, but is there a more principled way to handle this? See the MWE below. 4) Is there a way to define the style of "see also" different from pagestyle? What if I want to distinguish "see also" from the actual entry this is referring to? 5) Currently I use \setupmixedcolumns[register][direction=reverse] to get the two-column register in the correct order. What if I have two index registers, one for RTL and another for LTR? Is there a way to set the direction key for a specific register? 6) In a two-column Persian index, using almost any (non-mono) font, some letter headings (those extending significantly below the baseline) end up with extra space below. See attached PDF and the MWE. (I could not reproduce this with DejaVuSans or ALM Fixed.) \definefontfamily [myfamily] [serif] [Scheherazade] [features=arabic] \setupbodyfont [myfamily] \setupalign[r2l] \setupdirections[bidi=global,method=two] \setupmixedcolumns[register][direction=reverse] \setupregister[index][ before=,after=, command=\MyCommand, alternative=b, color=red, ] \def\MyCommand#1{#1} %\def\MyCommand#1{\inframed[frame=no]{#1}} % this fixes the problem \showboxes \starttext \index{آب} \index{عذر} \index[تک]{TEX} testing \placeindex \stoptext Some of the setups are to refute suspected causes. Notice that using \inframed fixes the problem. Thanks, Hossein
![](https://secure.gravatar.com/avatar/f129f440ec71ca911da1a6024736cda2.jpg?s=120&d=mm&r=g)
Same problem, item (6) of email below, observed with arabtype font. See
attached. MWE follows.
\definefontfamily [myfamily] [serif] [arabictypesetting] [features=arabic]
\setupbodyfont [myfamily]
\setupalign[r2l]
\setupdirections[bidi=global,method=two]
\setupmixedcolumns[register][direction=reverse]
\setupregister[index][
before=,after=,
command=\MyCommand,
alternative=b,
color=red,
]
\def\MyCommand#1{#1}
%\def\MyCommand#1{\inframed[frame=no]{#1}} % this fixes the problem
\showboxes
\starttext
\index{آب}
\index{عذر}
\index[تک]{TEX}
testing
\placeindex
\stoptext
any insights about other items in the previous email?
—MHB
On Wed, Aug 17, 2016 at 10:48 PM, Mohammad Hossein Bateni
Hello,
For a few days I have been playing with registers to generate an RTL index. Beside sorting, I ran into the following.
1) How can I get the index section using \subject? In some styles, I do not want to see the section number.
2) How can I get the Persian comma used instead of the English comma in page numbers and also before "see also"? The first one I can fix by a hack but not the second one: defining a custom pagecommand that sets \ registerpageseparatorsymbol to the Persian comma! There is a TODO comment in strc-reg.mkiv that the comma customization has been planned.
3) In RTL registers, if an entry starts with an LTR char, the order of index entry and page number will be incorrect. We had similar issues with section headings before. I can "fix" this by setting pagestyle=\zwnj, but is there a more principled way to handle this? See the MWE below.
4) Is there a way to define the style of "see also" different from pagestyle? What if I want to distinguish "see also" from the actual entry this is referring to?
5) Currently I use \setupmixedcolumns[register][direction=reverse] to get the two-column register in the correct order. What if I have two index registers, one for RTL and another for LTR? Is there a way to set the direction key for a specific register?
6) In a two-column Persian index, using almost any (non-mono) font, some letter headings (those extending significantly below the baseline) end up with extra space below. See attached PDF and the MWE. (I could not reproduce this with DejaVuSans or ALM Fixed.)
\definefontfamily [myfamily] [serif] [Scheherazade] [features=arabic] \setupbodyfont [myfamily] \setupalign[r2l] \setupdirections[bidi=global,method=two]
\setupmixedcolumns[register][direction=reverse] \setupregister[index][ before=,after=,
command=\MyCommand, alternative=b, color=red, ]
\def\MyCommand#1{#1}
%\def\MyCommand#1{\inframed[frame=no]{#1}} % this fixes the problem
\showboxes
\starttext \index{آب} \index{عذر} \index[تک]{TEX} testing \placeindex \stoptext
Some of the setups are to refute suspected causes. Notice that using \inframed fixes the problem.
Thanks, Hossein
![](https://secure.gravatar.com/avatar/b79687264c3e06cba13b54d05b12a9f5.jpg?s=120&d=mm&r=g)
Mohammad Hossein Bateni mailto:bateni@gmail.com 22. August 2016 um 10:49 Same problem, item (6) of email below, observed with arabtype font. See attached. MWE follows.
\definefontfamily [myfamily] [serif] [arabictypesetting] [features=arabic] \setupbodyfont [myfamily] \setupalign[r2l] \setupdirections[bidi=global,method=two]
\setupmixedcolumns[register][direction=reverse] When you have a font with large ascender/descender you can increase the linespacing (line key) or change the height/depth (height and depth keys) values for \strut.
\startsetups[register:interlinespace] \setupinterlinespace[height=0.6,depth=0.4,line=3.2ex] \stopsetups \setupmixedcolumns [index] [direction=reverse, setups=register:interlinespace] Wolfgang
![](https://secure.gravatar.com/avatar/f129f440ec71ca911da1a6024736cda2.jpg?s=120&d=mm&r=g)
This is great, Wolfgang! On Mon, Aug 22, 2016 at 5:06 AM, Wolfgang Schuster < schuster.wolfgang@gmail.com> wrote:
Mohammad Hossein Bateni
22. August 2016 um 10:49 Same problem, item (6) of email below, observed with arabtype font. See attached. MWE follows. \definefontfamily [myfamily] [serif] [arabictypesetting] [features=arabic] \setupbodyfont [myfamily] \setupalign[r2l] \setupdirections[bidi=global,method=two]
\setupmixedcolumns[register][direction=reverse]
When you have a font with large ascender/descender you can increase the linespacing (line key) or change the height/depth (height and depth keys) values for \strut.
\startsetups[register:interlinespace] \setupinterlinespace[height=0.6,depth=0.4,line=3.2ex] \stopsetups
\setupmixedcolumns [index] [direction=reverse, setups=register:interlinespace]
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 ____________________________________________________________ _______________________
participants (2)
-
Mohammad Hossein Bateni
-
Wolfgang Schuster