On 3-10-2010 10:24, Thomas A. Schmitz wrote:
Hi all, Hans,
On Feb 11, 2010, at 6:17 PM, Hans Hagen wrote:
1. index sorts uppercase letters after lowercase letters. Minimal example:
\starttext
\index{Aardvark}Aardvark
\index{azygous}azygous
\page
\setupregister[index][n=1]
\placeregister[index]
\stoptext
I would expect azygous to follow Aardvark, but it is sorted before.
are you sure that that's the convention for english? it's easy to change it ...
\startluacode
sorters.mappings['en'] = {
["a"] = 2, ["b"] = 4, ["c"] = 6, ["d"] = 8, ["e"] = 10,
["f"] = 12, ["g"] = 14, ["h"] = 16, ["i"] = 18, ["j"] = 20,
["k"] = 22, ["l"] = 24, ["m"] = 26, ["n"] = 28, ["o"] = 30,
["p"] = 32, ["q"] = 34, ["r"] = 36, ["s"] = 38, ["t"] = 40,
["u"] = 42, ["v"] = 44, ["w"] = 46, ["x"] = 48, ["y"] = 50,
["z"] = 52,
["A"] = 1, ["B"] = 3, ["C"] = 5, ["D"] = 7, ["E"] = 9,
["F"] = 11, ["G"] = 13, ["H"] = 15, ["I"] = 17, ["J"] = 19,
["K"] = 21, ["L"] = 23, ["M"] = 25, ["N"] = 27, ["O"] = 29,
["P"] = 31, ["Q"] = 33, ["R"] = 35, ["S"] = 37, ["T"] = 39,
["U"] = 41, ["V"] = 43, ["W"] = 45, ["X"] = 47, ["Y"] = 49,
["Z"] = 51,
}
\stopluacode
\starttext
\index{Aardvark}Aardvark \par
\index{azygous}azygous
\placeregister[index][n=1]
\stoptext
we had this pretty old thread about sorting in indexes. AFAICS, the latest beta
defaults to cases-sensitive sorting. Two quick questions:
1. Is there a setup command that will make index sorting case-insensitive? The
code above doesn't work anymore, so maybe you made it user-configurable now?
indeed, and in a nice obscure way ...
\setuplayout[topspace=1cm,height=middle]
\setupbodyfont[11pt]
\starttext
\def\Test#1%
{\vbox{{\bf#1}\blank\placeregister[index][language=cz,n=1,method={#1}]}\blank}
wanted result: oá öb Oč Öď Oo Öo oo öo Öq öř Oš oů \blank
\startcolumns[n=3]
\Test{mc,mm,uc} \Test{mc,zm,uc} \Test{mc,pm,uc}
\Test{zc,mm,uc} \Test{zc,zm,uc} \Test{zc,pm,uc}
\Test{pc,mm,uc} \Test{pc,zm,uc} \Test{pc,pm,uc}
\stopcolumns
\page
wanted result: oá öb Oč Öď Oo Öo oo öo Öq öř Oš oů \blank
\startcolumns[n=3]
\Test{mm,mc,uc} \Test{zm,mc,uc} \Test{pm,mc,uc}
\Test{mm,zc,uc} \Test{zm,zc,uc} \Test{pm,zc,uc}
\Test{mm,pc,uc} \Test{zm,pc,uc} \Test{pm,pc,uc}
\stopcolumns
\page
\dorecurse {2} {
\page \recurselevel:
\index{oá} \index{öb} \index{Oč} \index{Öď}
\index{oo} \index{öo} \index{Oo} \index{Öo}
\index{Öq} \index{öř} \index{Oš} \index{oů}
done
}
\stoptext
2. Is it really a good idea to make case-sensitive sorting the default in
English? I can't remember seeing a single academic book in English that has
this sort of index sorting.
Currently Jano and I are figuring out some details (as Jano does the
testing with more complex multilingual indices).
I have no preferece ... we can configure each language independently
using the method key in the entries in sort-lan.lua As I seldom consult
an index I have no clue what to expect or default to so feel free to
tell me what the defaults should be. We now have predefined:
local predefinedmethods = {
[variables.before] = "mm,mc,uc",
[variables.after] = "pm,mc,uc",
[variables.first] = "pc,mm,uc",
[variables.last] = "mc,mm,uc",
}
Hans
-----------------------------------------------------------------
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
___________________________________________________________________________________