ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Problems with indexing (+feature requests)
@ 2016-08-18  2:48 Mohammad Hossein Bateni
  2016-08-22  8:49 ` Mohammad Hossein Bateni
  0 siblings, 1 reply; 4+ messages in thread
From: Mohammad Hossein Bateni @ 2016-08-18  2:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2247 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 3025 bytes --]

[-- Attachment #2: bug.pdf --]
[-- Type: application/pdf, Size: 52796 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problems with indexing (+feature requests)
  2016-08-18  2:48 Problems with indexing (+feature requests) Mohammad Hossein Bateni
@ 2016-08-22  8:49 ` Mohammad Hossein Bateni
  2016-08-22  9:06   ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Mohammad Hossein Bateni @ 2016-08-22  8:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3154 bytes --]

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 <bateni@gmail.com>
wrote:

> 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
>

[-- Attachment #1.2: Type: text/html, Size: 4842 bytes --]

[-- Attachment #2: i.pdf --]
[-- Type: application/pdf, Size: 40912 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problems with indexing (+feature requests)
  2016-08-22  8:49 ` Mohammad Hossein Bateni
@ 2016-08-22  9:06   ` Wolfgang Schuster
  2016-08-27 16:50     ` Mohammad Hossein Bateni
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2016-08-22  9:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 782 bytes --]

> 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

[-- Attachment #1.2: Type: text/html, Size: 1870 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problems with indexing (+feature requests)
  2016-08-22  9:06   ` Wolfgang Schuster
@ 2016-08-27 16:50     ` Mohammad Hossein Bateni
  0 siblings, 0 replies; 4+ messages in thread
From: Mohammad Hossein Bateni @ 2016-08-27 16:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1427 bytes --]

This is great, Wolfgang!

On Mon, Aug 22, 2016 at 5:06 AM, Wolfgang Schuster <
schuster.wolfgang@gmail.com> wrote:

> Mohammad Hossein Bateni <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
>
> ____________________________________________________________
> _______________________
> 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
> ____________________________________________________________
> _______________________
>

[-- Attachment #1.2: Type: text/html, Size: 3153 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-27 16:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-18  2:48 Problems with indexing (+feature requests) Mohammad Hossein Bateni
2016-08-22  8:49 ` Mohammad Hossein Bateni
2016-08-22  9:06   ` Wolfgang Schuster
2016-08-27 16:50     ` Mohammad Hossein Bateni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).