ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* aligning heads in indices
@ 2017-04-01 12:38 Pablo Rodriguez
  2017-04-01 14:04 ` Rik Kabel
  0 siblings, 1 reply; 3+ messages in thread
From: Pablo Rodriguez @ 2017-04-01 12:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

I have the following sample:

    \showframe
    \definefontfeature[smcp][smcp=yes]
    \definefontfamily[mainface][rm][GFS Didot]
    \setupbodyfont[mainface]

    \setupregister[index][style=\addfs{smcp}, command={\hfill}]
    \starttext
    ancient\index{ancient}
    better\index{better}
    complexity\index{complexity}
    daemonic\index{daemonic}
    energic\index{energic}
    ἄγαν\index{ἄγαν}
    βεβαιος\index{βεβαιος}
    γυναικός\index{γυναικός}
    δαίμων\index{δαίμων}
    ἐνέργεια\index{ἐνέργεια}
    \placeindex
    \stoptext

Is there no way to center the head in indices?

I tried the creepy usage of \hfill in command, which I can replace with
\centerline from TeX.

But I wonder whether none before wanted to do this. The align options
centers both head and entries. And there is no headalign option.

Many thanks for your 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: aligning heads in indices
  2017-04-01 12:38 aligning heads in indices Pablo Rodriguez
@ 2017-04-01 14:04 ` Rik Kabel
  2017-04-01 15:53   ` Pablo Rodriguez
  0 siblings, 1 reply; 3+ messages in thread
From: Rik Kabel @ 2017-04-01 14:04 UTC (permalink / raw)
  To: ntg-context

On 2017-04-01 08:38, Pablo Rodriguez wrote:
> Dear list,
>
> I have the following sample:
>
>      \showframe
>      \definefontfeature[smcp][smcp=yes]
>      \definefontfamily[mainface][rm][GFS Didot]
>      \setupbodyfont[mainface]
>
>      \setupregister[index][style=\addfs{smcp}, command={\hfill}]
>      \starttext
>      ancient\index{ancient}
>      better\index{better}
>      complexity\index{complexity}
>      daemonic\index{daemonic}
>      energic\index{energic}
>      ἄγαν\index{ἄγαν}
>      βεβαιος\index{βεβαιος}
>      γυναικός\index{γυναικός}
>      δαίμων\index{δαίμων}
>      ἐνέργεια\index{ἐνέργεια}
>      \placeindex
>      \stoptext
>
> Is there no way to center the head in indices?
>
> I tried the creepy usage of \hfill in command, which I can replace with
> \centerline from TeX.
>
> But I wonder whether none before wanted to do this. The align options
> centers both head and entries. And there is no headalign option.
>
> Many thanks for your help,
>
> Pablo

As to the centering, it works fine here with command=\centerline . Index 
heads (a, b, ..., β, ἄ, ...) are centered over each of the two columns.

But that last bit is a problem. ἄ is indexed separately from α, and it 
is placed after β. I don't think you want that. I do not know how you 
would support more than one language in a single index sort.

-- 
Rik

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

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

* Re: aligning heads in indices
  2017-04-01 14:04 ` Rik Kabel
@ 2017-04-01 15:53   ` Pablo Rodriguez
  0 siblings, 0 replies; 3+ messages in thread
From: Pablo Rodriguez @ 2017-04-01 15:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 04/01/2017 04:04 PM, Rik Kabel wrote:
> On 2017-04-01 08:38, Pablo Rodriguez wrote:
>> Dear list,
>>
>> I have the following sample:
>>
>>      \showframe
>>      \definefontfeature[smcp][smcp=yes]
>>      \definefontfamily[mainface][rm][GFS Didot]
>>      \setupbodyfont[mainface]
>>
>>      \setupregister[index][style=\addfs{smcp}, command={\hfill}]
>> [...]
>> Is there no way to center the head in indices?
>> [...]
> 
> As to the centering, it works fine here with command=\centerline . Index 
> heads (a, b, ..., β, ἄ, ...) are centered over each of the two columns.

I got the same results, but I wonder whether this is the right way of
doing it.

> But that last bit is a problem. ἄ is indexed separately from α, and it 
> is placed after β. I don't think you want that. I do not know how you 
> would support more than one language in a single index sort.

It was only a test and the font has some issues with OpenType features.

The real problem comes with this source:
http://www.ousia.tk/grc-index.tex (output in
http://www.ousia.tk/grc-index.pdf).

Each word-starting letter with a different diacritical mark is
considerer a different letter for the index sorting.

It seems to be a problem only related to ancient Greek, since the
following works as expected:

    \mainlanguage[es]
    \define[1]\indx{#1\index{#1}}
    \setupregister[index][n=6, balance=no, command={\centerline}]
    \starttext
    \indx{a} \indx{á} \indx{ñ} \indx{n} \indx{ü} \indx{u}
    \indx{A} \indx{Á} \indx{Ñ} \indx{n} \indx{Û} \indx{u}
    \placeindex
    \stoptext

German is rather tricky (sorting rules in German are tricky, too), but
it works as it should (after fine tuning):

    \mainlanguage[de-at]
    \define[1]\indx{#1\index{#1}}
    \setupregister[index][language=de-AT, balance=no]
    \starttext
    \indx{üben} \indx{Übung} \indx{U-Bahn}
    \currentlanguage
    \placeindex
    \stoptext

I guess having different language names (de-at and de-AT) for
\mainlanguage and index sorting is unnecessarily complex.

If it were possible, I think it would be extremely helpful to be able to
invoke languages by their XML standards (or
https://tools.ietf.org/html/bcp47).

This would mean grc for agr, de-1901, de-AT and de-CH for deo, de-at and
de-CH... and so on.

I mean this as full-working alternatives, not as replacements that would
break existing compatibility.

But even defining a language synonym doesn’t work with index sorting:

    \installlanguage [de-AT] [de-at]
    \mainlanguage[de-AT]
    \define[1]\indx{#1\index{#1}}
    \setupregister[index][balance=no]
    \starttext
    \indx{üben} \indx{Übung} \indx{U-Bahn}
    \currentlanguage
    \placeindex
    \stoptext

Hans, how about improving alternate (standard for the rest of markup)
language invocation and allowing the main language to specify the
sorting order in German indexes too?

Many thanks for your 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2017-04-01 15:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-01 12:38 aligning heads in indices Pablo Rodriguez
2017-04-01 14:04 ` Rik Kabel
2017-04-01 15:53   ` Pablo Rodriguez

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