Cyrillic Numbers
Cyrillic Numbers
Cyrillic Numbers
C Y R I L L I C
N U M E R A L S
A Module
·а·
·в·
·г·
·д·
·е·
·ѕ·
·з·
·и·
·ѳ·
·і·
· аі ·
· ві ·
· гі ·
· ді ·
· еі ·
· ѕі ·
· зі ·
· иі ·
· ѳі ·
·к·
а INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
в FUNCTIONALITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
в.а Setup 4
в.в Predefined Commands 8
в.г Command Derivation 10
L I CENSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
R EFERENCES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1
а INTRODUCTION
1 Thorough examinations of how Cyrillic numbers were used in praxi are hard to
find. The best that the couple of bookshelfs dedicated to grammar in a local de-
partment of Slavonic languages has to offer appears to be Žolobov (2006). Another
work, Trunte (2005), although it follows a less descriptive but rather instructional
approach, deserves mentioning as well.
2
introduction 3
в.а setup
\usemodule[cyrillicnumbers]
1
\setupcyrnum [...] [..,.=2 .,..]
Optional
1 Identifier
2 command = \...#1
dots = no yes
dotsymbol = Text
penwidth = Dimension
preferhundredk = no yes
titlo = mp font
titlocolor = Identifier
titlolocation = middle final first
titlomode = Number
titlospan = Number
Let’s walk through the options one by one. As was hinted in the
dots
whatever reason another symbol is required, the solution will look like
this: \setupcyrnum[dots=yes,dotsymbol=\cdot]. The result of this
modification looks as follows: ⋅мв⋅. As the dot can be an arbitrary
symbol, it could be replaced by the asterisk: *мв*, or – even weirder –
the hash character (“Gartenzaun”): #мв#.
4
functionality 5
preferhundredk
hundred thousands sign or the thousands prefix may be employed.
Thus, the setup key preferhundredk determines which one will be
chosen. If set to yes, then it’s going to be the houndred thousands sign,
else the regular thousands sign: ц҈ = ҂с + ҂ѱ. (As is obvious from this
example, the visual quality of the houndred thousands sign, which is a
separate glyph, depends on the font used.)
Not every font contains proper glyphs for the entire Cyrillic uni-
code range, in fact every dedicated font for a single Cyrillic alphabet
– contemporary Russian, say – might not contain all the characters
needed to represent every Cyrillic numeral. This is the result of the his-
command
torical development the respective scripts went through. This process
usually lead to the elimination of several glyphs at different stages of
the development. For example the Russian alphabet experienced one
significant reduction of letters at the hand of emperor Peter I2 and
another later in 1917 as a consequence of – not only – the revolution.3
Thus, chances are that in order to represent Cyrillic numbers, which
rely on a superset of the modern Russian alphabet, another font needs
to be chosen.4 The Cyrillic Numbers module provides a hook for this
kind of customization: you may define your own font switching macro
and assign it to the command key of the setup. Suppose you decide to
typeset your numbers using the Paratype Serif font.5
мв мв мв мв мв мв мв мв мв
Figure 1 Titlo as a matter of taste.
\unexpanded\define[1]\numbercommand{%
\begingroup
\language[ru]%
\setupbodyfont[numberfont]%
#1%
\endgroup%
}
%%% 5. ????
%%% 6. Profit!!!!!
specify a position first: ҂д҃смв, middle: ҂дсм҃в, and final: ҂дсмв҃. (For even
character counts, the middle argument will pick one place to the right
of the exact middle.)
functionality 7
titlomode,titlospan
user wants the numeral to be covered as a whole, E can simply pass
the value all. Beware that the dimensions of the titlo are proportional
to the width of the numeral. Therefore, sufficiently wide (in terms of
non-zero digits) numbers will cause the titlo to shrink horizontally as
seen in figure 2. E. g. for the single digit number а the titlo even
exceeds the character it sits on, while it does not entirely cover the five
digits plus two thousand signs of ҂н҂дтка . When using the mp titlo
the color of this element can be chosen separately by passing a valid
color identifier to the titlocolor key. The following example code
titlocolor
demonstrates the colorization and drawing facilities.
\usemodule [cyrillicnumbers]
\setupbodyfont [computer-modern-unicode]
\setupcyrnum [
titlo=mp,
titlocolor=blue,
titlospan=all,
titlomode=7,
]
\starttext
\startlines
6 Cf. http://ru.wikipedia.org/wiki/##.D0.92_.D0.98.D0.BC.D0.BF.D0.B5.D1.80
.D0.B0.D1.82.D0.BE.D1.80.D1.81.D0.BA.D0.BE.D0.B9_.D0.A0.D0.BE.D1.81.D1
.81.D0.B8.D0.B8.
8 functionality
\cyrnum {42}
\cyrnum [titlocolor=red,titlomode=9] {141213}
\cyrnum [titlocolor=green,titlomode=2] {271828}
\cyrnum [titlocolor=cyan,titlomode=4] {314159}
\stoplines
\stoptext
rather obviously determines the width of the pen that is used when
drawing a titlo. Finding the optimal width can involve a lot of testing
on the user’s side; as a rule, the greater the font size, the wider the
pen should be. Refer to table 1 for a demonstration of different values
for this parameter.
\usemodule[cyrillicnumbers]
\starttext
\cyrnum{1}
\cyrnum[titlo=mp,titlomode=4]{42}
\cyrnum{15}
\stoptext
*
\cyrnumdrawtitlo {...}
* Content
господь ->\cyrnumdrawtitlo{гь}
1
\definecyrnum [...] [..,.=2 .,..]
Optional
1 Identifier
2 inherits from \setupcyrnum
All the options that can be passed to \definecyrnum are also valid
for derived macros; they inherit the setups of the macros they are
derived from. A full example to play with is given in below listing:
\usemodule[cyrillicnumbers]
\setupbodyfont[computer-modern-unicode]
\definecyrnum[mynumone][titlo=no,dots=no]
\definecyrnum[mynumtwo][mynumone]
\setupcyrnum [mynumtwo][titlo=mp,titlomode=2,titlocolor=red]
\definecyrnum[mynumthree][mynumtwo]
\setupcyrnum [mynumthree][titlomode=4,dots=yes]
\starttext
\mynumone{42}
\mynumtwo{42}
\mynumthree{42}
\stoptext \endinput
г.а counters
\usemodule [cyrillicnumbers]
\setupbodyfont [computer-modern-unicode]
\starttext
\dorecurse{10}{%
\startmychapter[title=foo]
\input knuth
\stopmychapter
}
11
12 usage and precautions
\stoptext \endinput