summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/start/en/ma-cb-en-registers.tex
blob: 315e2bfa48842d80e34d8596cf7f284b41ab3c13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
\startcomponent ma-cb-en-registers

\enablemode[**en-us]

\project ma-cb

\startchapter[title=Registers]

\index{register}

\Command{\tex{index}}
\Command{\tex{placeindex}}
\Command{\tex{completeindex}}
\Command{\tex{defineregister}}
\Command{\tex{placeregister}}
\Command{\tex{completeregister}}
\Command{\tex{setupregister}}

It is possible to generate one or more registers. By default the command
\type{\index} is available. If you want to add a word to the index you type:

\starttyping
\index{town hall}
\stoptyping

The word {\em town hall} will appear as an index entry in the sorted register.
Sometimes the index word does not appear in normal alphabetic order. For example,
entries such as symbols have to provide extra sorting information in order to
produce a correct alphabetical list:

\starttyping
\index[minus]{$-$}
\stoptyping

Sometimes you have sub- or sub sub entries. These can be defined as follows:

\starttyping
\index{town hall+location}
\index{town hall+architecture}
\stoptyping

You can generate your register with the command:

\starttyping
\placeindex
\stoptyping

or

\starttyping
\completeindex
\stoptyping

The command \type{\index} is a predefined \CONTEXT\ command, but of course you
can also define your own registers.

\shortsetup{defineregister}

For example if you want to make a new register based on the streets in Hasselt
you could type:

\starttyping
\defineregister[street]
\stoptyping

Now a new register command \type{\street} is available. Now
\type{\street{Ridderstraat}} is a new index entry. To produce a list of entries
you could now use:

\starttyping
\placeregister[street]
\placestreet
\completestreet
\stoptyping

You can alter the layout of the registers with:

\shortsetup{setupregister}

\stopchapter

\stopcomponent