summaryrefslogtreecommitdiff
path: root/tex/context/third/cyrillicnumbers/t-cyrillicnumbers.mkvi
blob: 6c5ae073dc88bfe1bfa458ae0a1d869f68a1e85b (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
%D \module
%D   [     file=t-cyrillicnumbers.mkiv,
%D      version=2013-03-27 23:57:37+0100,
%D        title=\CONTEXT\ User Module,
%D     subtitle=Cyrillic Numbers,
%D       author=Philipp Gesang,
%D         date=\currentdate,
%D    copyright=Philipp Gesang,
%D      license=2-clause BSD,
%D        email={phg42 dot 2a at gmail dot com}]
%D This module is licensed under the conditions of the BSD license with
%D two clauses. There is a copy in a file named "COPYING" in the
%D t-cyrillicnumbers source tree.

%M \definehead[docsection] [chapter]
%M \setuphead [docsection] [page=no,style=\tf\bold\WORD,color=darkmagenta,alternative=inmargin,before={\blank[3*line]}]
%M \definehead[doctitle]   [coupling=docsection,default=docsection,incrementnumber=no,page=no]
%M \setuplist [docsection] [alternative=b,textstyle=\tf]
%M \setupinteraction[focus=standard,color=darkmagenta]

%D \doctitle{Overview}\placelist[docsection][criterium=all]\page[yes]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%D \docsection{Global strings and namespace initialization}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\writestatus{loading}{Cyrillic Number Support for ConTeXt}

\unprotect

\startinterface all
  \setinterfacevariable {cyrillicnumerals} {cyrillicnumerals}
  \setinterfacevariable {Cyrillicnumerals} {Cyrillicnumerals}
  \setinterfacevariable           {cyrnum} {cyrnum}
  \setinterfacevariable             {dots} {dots}
  \setinterfacevariable        {dotsymbol} {dotsymbol}
  \setinterfacevariable         {penwidth} {penwidth}
  \setinterfacevariable   {preferhundredk} {preferhundredk}
  \setinterfacevariable    {titlolocation} {titlolocation}
  \setinterfacevariable       {titlocolor} {titlocolor}
  \setinterfacevariable        {titlomode} {titlomode}
  \setinterfacevariable        {titlospan} {titlospan}
  \setinterfacevariable            {titlo} {titlo}
\stopinterface

\definenamespace [cyrnum] [
 \v!command=\v!yes,
    comment=cyrillic numbers,
    \s!name=\v!cyrnum,
  \s!parent=\v!cyrnum,
      setup=\v!list,
      style=\v!no,
       type=module,
    version=hg-tip,
]

%D Loading the \LUA\ conversion routines.

\registerctxluafile{cyrillicnumbers}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%D \docsection{Setup command}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%D The\reference[setupdef]{} autogenerated setup command needs to
%D be extended to pass values on to the \LUA\ end.

\def\cyrnumsetvariables{%
  \startluacode
    local tc = thirddata.cyrnum
    tc.placetitlo    = "\cyrnumparameter{\v!titlo}"
    tc.titlolocation = tc.position_synonyms["\cyrnumparameter{\v!titlolocation}"]   or "f"
    tc.prefer100k    = tc.     yes_synonyms["\cyrnumparameter{\v!preferhundredk}"]  or false
    tc.drawdots      = tc.     yes_synonyms["\cyrnumparameter{\v!dots}"]            or false
    tc.dotsymbol     = "\luaescapestring{\cyrnumparameter{\v!dotsymbol}}"

    local span   = "\cyrnumparameter{\v!titlospan}"
    local num = tonumber(span)
    if num then
      tc.titlotype = true
      tc.titlospan = num
    elseif span == "all" then
      tc.titlotype = false
    end
  \stopluacode%
}

\appendtoks \setuevalue{\currentcyrnum}{\do_cyrnum[\currentcyrnum]} \to \everydefinecyrnum
\appendtoks \cyrnumsetvariables                                     \to \everysetupcyrnum

%D This allows the module to be loaded with a second set of
%D key-value arguments. If initialized as follows, additional debug
%D information will be output on the terminal.
%D
%D \starttyping
%D \usemodule[cyrillicnumbers][test=yes]
%D \stoptyping

\startmoduletestsection
  \ctxlua{thirddata.cyrnum.debug = true}
\stopmoduletestsection

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%D \docsection{Titlo variants}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%D The {\em Cyrillic Numbers} module allows the titlo, if requested,
%D to be drawn in two different ways. If the setup parameter
%D \type{titlo} has the value {\em mp}, then the variant employing
%D \METAPOST\ is selected. As there are a couple of different
%D styles, it will be necessary that the user determine one by
%D setting the parameter \type{titlomode} to an integer.
%D Additionally it is possible to manipulate the pen width that
%D \METAPOST\ uses when executing the titlo code. {\em NB} as the
%D drawing routines differ, the \type{penwidth} parameter lead to
%D different results with different modes as well, ymmv.
%D
%D \starttyping
%D \setupcyrnum[
%D   titlo=mp,
%D   titlomode=4,
%D   penwidth=4,
%D ]
%D \stoptyping

\startuniqueMPgraphic{cyrnum-titlo1}
  path titlo ;
  save High, Low ;
  save Vfactor ; Vfactor = .15 ;
  save Hfactor ; Hfactor = .90 ;
  titlo := ( 0.00,    -Vfactor) ..
           ( 0.05,  .4*Vfactor) ..
           ( 0.95, -.4*Vfactor) ..
           ( 1.00,     Vfactor) ;
  pickup pensquare yscaled \cyrnumparameter{penwidth} xscaled 1 rotated -30 ;
  draw titlo
       xysized (Hfactor*OverlayWidth,Vfactor*OverlayHeight)
       shifted (.5*(OverlayWidth-Hfactor*OverlayWidth),OverlayHeight-Vfactor*OverlayHeight)
       withcolor \MPcolor{\cyrnumparameter{titlocolor}};
  setbounds currentpicture to boundingbox OverlayBox ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{cyrnum-titlo2}
  path titlo ;
  save penwidth ; penwidth = \cyrnumparameter{penwidth} ;
  save High, Low ;
  save Vfactor ; Vfactor = .15 ;
  save Hfactor ; Hfactor = .80 ;
  titlo := ( 0.05,    -Vfactor) --
           ( 0.07,  .7*Vfactor) ..
           ( 0.09,  .8*Vfactor) ..
           ( 0.91, -.8*Vfactor) ..
           ( 0.93, -.7*Vfactor) --
           ( 0.95,     Vfactor) ;
  pickup pensquare yscaled penwidth xscaled 1 rotated 70 ;
  draw titlo
       xysized (Hfactor*OverlayWidth,Vfactor*OverlayHeight)
       shifted (.5*(OverlayWidth-Hfactor*OverlayWidth)-.5*penwidth,OverlayHeight-Vfactor*OverlayHeight)
       withcolor \MPcolor{\cyrnumparameter{titlocolor}};
  setbounds currentpicture to boundingbox OverlayBox ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{cyrnum-titlo3}
  path titlo ;
  save penwidth ; penwidth = \cyrnumparameter{penwidth} ;
  save High, Low ;
  save Vfactor ; Vfactor = .15 ;
  save Hfactor ; Hfactor = .80 ;
  titlo := ( 0.05,      -Vfactor) --
           ( 0.07,  0.70*Vfactor) ..
           ( 0.09,  0.90*Vfactor) .. { dir 00 }
           ( 0.49, -0.00*Vfactor) --
           ( 0.49, -0.90*Vfactor) --
           ( 0.51,  0.90*Vfactor) --
           ( 0.51,  0.00*Vfactor) { dir 00 } ..
           ( 0.91, -0.90*Vfactor) ..
           ( 0.93, -0.70*Vfactor) --
           ( 0.95,       Vfactor) ;
  pickup pensquare yscaled penwidth xscaled 1 rotated 70 ;
  draw titlo
       xysized (Hfactor*OverlayWidth,Vfactor*OverlayHeight)
       shifted (.5*(OverlayWidth-Hfactor*OverlayWidth)-.5*penwidth,OverlayHeight-Vfactor*OverlayHeight)
       withcolor \MPcolor{\cyrnumparameter{titlocolor}};
  setbounds currentpicture to boundingbox OverlayBox ;
\stopuniqueMPgraphic

%%% Same as 2 with inner vertical stroke
\startuniqueMPgraphic{cyrnum-titlo4}
  path titlo, stroke ;
  save penwidth ; penwidth = \cyrnumparameter{penwidth} ;
  save High, Low ;
  save Vfactor ; Vfactor = .15 ;
  save Hfactor ; Hfactor = .80 ;
  titlo = ( 0.05, -1.00*Vfactor) --
          ( 0.07,  0.70*Vfactor) ..
          ( 0.09,  0.90*Vfactor) { dir 00 } .. { dir 00 }
          ( 0.91, -0.90*Vfactor) ..
          ( 0.93, -0.70*Vfactor) --
          ( 0.95,  1.00*Vfactor) ;
  stroke = ( 0.49*Hfactor*OverlayWidth+.5*penwidth, -0.30*Vfactor*OverlayHeight ) -- %% this is a mess
           ( 0.51*Hfactor*OverlayWidth+.5*penwidth,  0.50*Vfactor*OverlayHeight ) ;
  pickup pensquare yscaled penwidth xscaled 1 rotated 80 ;
  draw titlo
       xysized (Hfactor*OverlayWidth,Vfactor*OverlayHeight)
       shifted (.5*(OverlayWidth-Hfactor*OverlayWidth)-.5*penwidth,OverlayHeight-Vfactor*OverlayHeight)
       withcolor \MPcolor{\cyrnumparameter{titlocolor}};
  draw stroke
       % xysized (Hfactor*OverlayWidth,Vfactor*OverlayHeight) %% doesn’t work as expected somehow
       shifted (.5*(OverlayWidth-Hfactor*OverlayWidth)-.5*penwidth,OverlayHeight-Vfactor*OverlayHeight)
       withcolor \MPcolor{\cyrnumparameter{titlocolor}} ;
  setbounds currentpicture to boundingbox OverlayBox ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{cyrnum-titlo5}
  path titlo ;
  save penwidth ; penwidth = \cyrnumparameter{penwidth} ;
  save High, Low ;
  save Vfactor ; Vfactor = .20 ;
  save Hfactor ; Hfactor = .75 ;
  titlo := ( 0.00, -0.8*Vfactor) {dir 90} .. {dir 90}
           ( 1.00,  1.2*Vfactor) ;
  pickup pensquare yscaled penwidth xscaled 2 rotated 85 ;
  draw titlo
       xysized (Hfactor*OverlayWidth-penwidth,Vfactor*OverlayHeight)
       shifted (.5*(OverlayWidth-Hfactor*OverlayWidth),OverlayHeight-Vfactor*OverlayHeight)
       withcolor \MPcolor{\cyrnumparameter{titlocolor}} ;
  setbounds currentpicture to boundingbox OverlayBox ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{cyrnum-titlo6}
  path titlo ;
  save penwidth ; penwidth = \cyrnumparameter{penwidth} ;
  save High, Low ;
  save Vfactor ; Vfactor = .20 ;
  save Hfactor ; Hfactor = .85 ;
  titlo := ( 0.03, -0.80*Vfactor) --
           ( 0.03,  0.15*Vfactor) --
           ( 0.00,  0.20*Vfactor) {right} .. {right}
           ( 1.00, -0.20*Vfactor) --
           ( 0.97, -0.15*Vfactor) --
           ( 0.97,  0.80*Vfactor) ;
  pickup pensquare yscaled penwidth xscaled sqrt(2) rotated 90 ;
  draw titlo
       xysized (Hfactor*OverlayWidth-.5*penwidth,Vfactor*OverlayHeight)
       shifted (.5*(OverlayWidth-Hfactor*OverlayWidth),OverlayHeight-(0.5*Vfactor*OverlayHeight))
       withcolor \MPcolor{\cyrnumparameter{titlocolor}} ;
  setbounds currentpicture to boundingbox OverlayBox ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{cyrnum-titlo7}
  path titlo ;
  save penwidth ; penwidth = \cyrnumparameter{penwidth} ;
  save High, Low ;
  save Vfactor ; Vfactor = .20 ;
  save Hfactor ; Hfactor = .85 ;
  titlo := ( 0.05, -0.80*Vfactor) --
           ( 0.05, -0.30*Vfactor) {up} .. {right}
           ( 0.07, -0.00*Vfactor) --
           ( 0.93,  0.00*Vfactor) {right} .. {up}
           ( 0.95,  0.30*Vfactor) --
           ( 0.95,  0.80*Vfactor) ;
  pickup pensquare yscaled (0.66*penwidth) xscaled penwidth ;
  draw titlo
       xysized (Hfactor*OverlayWidth-2*penwidth,Vfactor*OverlayHeight)
       shifted ((.5*penwidth+.5*(OverlayWidth-Hfactor*OverlayWidth)),
                (OverlayHeight-(0.7*Vfactor*OverlayHeight)))
       withcolor \MPcolor{\cyrnumparameter{titlocolor}} ;
  setbounds currentpicture to boundingbox OverlayBox ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{cyrnum-titlo8}
  path titlo, stroke ;
  save penwidth ; penwidth = \cyrnumparameter{penwidth} ;
  save High, Low ;
  save Vfactor ; Vfactor = .20 ;
  save Hfactor ; Hfactor = .85 ;
  titlo := ( 0.15, -0.10*Vfactor) {dir 25} ..% tension 8 ..
            controls (0.40, 0.50) and (0.00, 0.35) ..
           ( 0.00, -0.00*Vfactor) {down} .. 
            controls (0.00, -0.30) and (0.10, -0.25) ..
           % ( 0.10, -0.20*Vfactor) {right} .. tension 4 .. {dir -120}
           ( 0.30, -0.90*Vfactor) ..
           controls
            ( 0.70,  0.20*Vfactor) and
            ( 0.97,  0.08*Vfactor) ..
           ( 0.97, -0.30*Vfactor) .. tension 6 .. {dir -140}
           ( 0.95, -0.90*Vfactor) ;
  stroke := ((0.45*Hfactor*OverlayWidth),-0.20*Vfactor*OverlayHeight) ..
            ((0.54*Hfactor*OverlayWidth), 0.35*Vfactor*OverlayHeight) ---
            ((0.65*Hfactor*OverlayWidth), 0.90*Vfactor*OverlayHeight) {dir -120} .. {dir 30}
            % ((0.54*Hfactor*OverlayWidth), 0.35*Vfactor*OverlayHeight) ..
            ((0.45*Hfactor*OverlayWidth), 0.90*Vfactor*OverlayHeight)
            ;
  pickup pensquare yscaled 2 xscaled (0.5*penwidth) rotated 10;
  % pickup pensquare yscaled 1 xscaled 2 ;
  draw titlo
       xysized (Hfactor*OverlayWidth,Vfactor*OverlayHeight)
       shifted ((.5*(OverlayWidth-Hfactor*OverlayWidth)),
                (OverlayHeight-(0.7*Vfactor*OverlayHeight)))
       withcolor \MPcolor{\cyrnumparameter{titlocolor}} ;
  pickup pensquare yscaled 2 xscaled (0.5*penwidth) rotated 70;
  draw stroke
       % xysized (Hfactor*OverlayWidth,Vfactor*OverlayHeight)
       shifted ((.6*(OverlayWidth-Hfactor*OverlayWidth)),
                (OverlayHeight-Vfactor*OverlayHeight))
       withcolor \MPcolor{\cyrnumparameter{titlocolor}} ;
       ;
  setbounds currentpicture to boundingbox OverlayBox ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{cyrnum-titlo9}
  path titlo ;
  save penwidth ; penwidth = \cyrnumparameter{penwidth} ;
  save High, Low ;
  save Vfactor ; Vfactor = .10 ;
  save Hfactor ; Hfactor = .85 ;
  titlo := ( 0.05, -0.40*Vfactor) --
           ( 0.05,  0.00*Vfactor) --
           ( 0.95,  0.00*Vfactor) --
           ( 0.95, -0.40*Vfactor) ;
  pickup pensquare yscaled (2*penwidth/3) xscaled penwidth ;
  draw titlo
       xysized (Hfactor*OverlayWidth-2*penwidth,Vfactor*OverlayHeight)
       shifted ((.5*penwidth+.5*(OverlayWidth-Hfactor*OverlayWidth)),
                (OverlayHeight-(0.7*Vfactor*OverlayHeight)))
       withcolor \MPcolor{\cyrnumparameter{titlocolor}} ;
  setbounds currentpicture to boundingbox OverlayBox ;
\stopuniqueMPgraphic

%D The \METAPOST\ titlo is drawn as an overlay which in turn
%D serves as the background for a dedicated \type{\framed} macro.
%D This titlo command is accessible in protected mode as
%D \type{\cyrnumdrawtitlo}, which is also called by the
%D \LUA\ functions.

\defineoverlay[cyrnum-titlo-overlay1][\uniqueMPgraphic{cyrnum-titlo1}]
\defineoverlay[cyrnum-titlo-overlay2][\uniqueMPgraphic{cyrnum-titlo2}]
\defineoverlay[cyrnum-titlo-overlay3][\uniqueMPgraphic{cyrnum-titlo3}]
\defineoverlay[cyrnum-titlo-overlay4][\uniqueMPgraphic{cyrnum-titlo4}]
\defineoverlay[cyrnum-titlo-overlay5][\uniqueMPgraphic{cyrnum-titlo5}]
\defineoverlay[cyrnum-titlo-overlay6][\uniqueMPgraphic{cyrnum-titlo6}]
\defineoverlay[cyrnum-titlo-overlay7][\uniqueMPgraphic{cyrnum-titlo7}]
\defineoverlay[cyrnum-titlo-overlay8][\uniqueMPgraphic{cyrnum-titlo8}]
\defineoverlay[cyrnum-titlo-overlay9][\uniqueMPgraphic{cyrnum-titlo9}]

\defineframed[cyrnum_titloframe][
    location=low,
       frame=off,
  background=cyrnum-titlo-overlay\cyrnumparameter{titlomode},
]

%D \macros
%D   {cyrnumdrawtitlo}
%D
%D The macro \type{\cyrnumdrawtitlo} allows for arbitrary titlo
%D placement which might be useful for other text elements besides
%D plain numbers, e.~g. abbreviations {\italic\letterampersand}c.

\let\cyrnumdrawtitlo\cyrnum_titloframe

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%D \docsection{User level interface}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%D \macros
%D   {definecyrnum}
%D
%D User interface to the main conversion routines. The definition
%D macro autogenerates the primary user-level macro, which in turn
%D relies \type{\setupcyrnum} for argument processing (see above on
%D \at{page}[setupdef]).
%D
%D Example usage:
%D
%D \starttyping
%D   \definecyrnum[titlofree]
%D   \setupcyrnum [titlofree][titlo=no]
%D   \starttext
%D     \titlofree{42}
%D   \stoptext
%D \stoptyping

\unexpanded\def\do_cyrnum[#1]{%
  \edef\currentcyrnum{#1}%
  \dosingleempty\dodo_cyrnum%
}

\def\dodo_cyrnum[#1]{%
  \begingroup
  \setupcyrnum[\currentcyrnum][#1]%
  \cyrnumparameter{command}\begingroup%
  \dododo_cyrnum%
}

\def\dododo_cyrnum#1{%
  \ctxcommand{cyrillicnumerals(\number#1)}%
  \endgroup%
  \endgroup%
}

%D \macros
%D    {setupcyrnum}
%D
%D The \type{\setupcyrnum} and \type{\definecyrnum} macros are
%D autogenerated via the namespace.

\setupcyrnum[
            \v!dots=\v!yes, % yes|no
       \v!dotsymbol=·,
        \v!penwidth=.66pt,
  \v!preferhundredk=no,
         \v!command=,
      \v!titlocolor=black,
   \v!titlolocation=\v!middle, % final|middle -- only effective if using the font’s titlo
       \v!titlomode=5,
       \v!titlospan=3,      % n|all
           \v!titlo=\v!mp,     % font|mp|no
]

%D \macros
%D   {cyrnum}
%D
%D The default user macro is defined as \type{\cyrnum}.

\definecyrnum[\v!cyrnum]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%D \docsection{Conversion routines}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%D \macros
%D   {cyrillicnumerals,Cyrillicnumerals}
%D
%D Conforming to the standard \CONTEXT\ naming scheme as employed
%D with number conversion macros, we define two macros for use with
%D conversions. As there is no definition for uppercase conversion,
%D the macro \type{\Cyrillicnumerals} exists only for compatibility
%D reasons.
%D
%D Also, we setup two corresponding conversions \type{cyr} and
%D \type{Cyr} for use with e.g. enumerations, headings, counters
%D {\italic\letterampersand}c. Instead of these predefined ones
%D the user may consider defining a dedicated conversion routine
%D for each purpose:

%D \starttyping
%D \definecyrnum    [mycyrnum] [titlo=mp,titlomode=7,titlospan=all,penwidth=2]
%D \defineconversion[myconversion][\mycyrnum]
%D
%D \setuphead[section][conversion=myconversion]
%D \stoptyping

\definecyrnum[\v!cyrillicnumerals]
\definecyrnum[\v!Cyrillicnumerals]

\defineconversion[cyrillicnumerals][\cyrillicnumerals]
\defineconversion[Cyrillicnumerals][\Cyrillicnumerals]
\defineconversion[cyr]             [\cyrillicnumerals]
\defineconversion[Cyr]             [\Cyrillicnumerals]

% \protect \endinput

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Fun %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\peano#1{\ctxcommand{peanonumerals(\number#1)}}
\defineconversion[peano][\peano]

\def\church#1{\ctxcommand{churchnumerals(\number#1)}}
\defineconversion[church][\church]

\protect \endinput

%   vi:ft=context:fo=co:ts=2:expandtab:sw=2