Command/keyword:method

From Wiki
< Command
Revision as of 21:19, 1 June 2014 by Benjamin (talk | contribs)
Jump to navigation Jump to search

Description

The way in which e. g. lists or registers are sorted when \placeregister or \placelistofsynonyms is influenced by an appropriate keyword passed to ConTeXt's sort module (sort-ini.lua).

The details lay in a rather obscure set of methods (see source), for which the following short-cuts are defined:

Note that in some instances (if no key is specified) uppercase letters are sorted before lowercase ones.

Example

Here [1] is a modified example posted on the mailing list by Hans to illustrate the impact of different sorting methods:

\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=2]
     \Test{before}   \Test{first} 
     \Test{default}  \Test{after}  \Test{last}
\stopcolumns

\page

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{}  \index{öb}  \index{}  \index{Öď}
         \index{oo}  \index{öo}  \index{Oo}  \index{Öo}
         \index{Öq}  \index{öř}  \index{}  \index{}
    done
}

\stoptext

The key set "zm,mc,uc", "zm,zc,uc" and "zm,pc,uc" give the wanted result in this example.


See also