summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/xindex/xindex-norsk.lua
blob: 82e443d17a5230fd08c3047796ca6cb43de42e12 (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
-----------------------------------------------------------------------
--         FILE:  xindex-norsk.lua
--  DESCRIPTION:  configuration file for xindex.lua
-- REQUIREMENTS:  
--       AUTHOR:  Herbert Voß
--     MODIFIED:  Sveinung Heggen (2020-01-02)
--      LICENSE:  LPPL1.3
--
-- $Id: xindex-norsk.lua 12 2021-08-15 09:28:32Z hvoss $
-----------------------------------------------------------------------

if not modules then modules = { } end modules ['xindex-no'] = {
      version = 0.33,
      comment = "configuration to xindex.lua",
       author = "Herbert Voss",
    copyright = "Herbert Voss",
      license = "LPPL 1.3"
}


itemPageDelimiter = ","     -- Hello, 14
compressPages     = true    -- something like 12--15, instaead of 12,13,14,15. the |( ... |) syntax is still valid
fCompress	  = false    -- 3f -> page 3, 4 and 3ff -> page 3, 4, 5
minCompress       = 2       -- 14--17 or 
rangeSymbol       = "-"     -- 14-17 instead of -- 
numericPage       = true    -- for non numerical pagenumbers, like "VI-17"
sublabels         = {"", "-\\,", "--\\,", "---\\,"} -- for the (sub(sub(sub-items  first one is for item
pageNoPrefixDel   = ""     -- a delimiter for page numbers like "VI-17"  -- not used !!!
indexOpening      = ""     -- commands after \begin{theindex}
idxnewletter      = "\\textbf"  -- Only valid if -n is not set
envStart          = "\\begin{theindex}"  
envStop           = "\\end{theindex}"

escape_chars = { -- by default " is the escape char
  {'""', "\\escapedquote",      '\"{}' },
  {'"@', "\\escapedat",         "@"    },
  {'"|', "\\escapedvert",       "|"    },
  {'"!', "\\escapedexcl",       "!"    },
  {'"(', "\\escapedparenleft",  "("   },
  {'")', "\\escapedparenright", ")"  }
}

alphabet_lower = { --   for sorting
    { ' ' },  -- only for internal tests
    { 'a', 'á', 'à', },
    { 'b' },
    { 'c', 'ç' },
    { 'd' },
    { 'e', 'é', 'è', 'ë', 'ê' },
    { 'f' },
    { 'g' },
    { 'h' },
    { 'i', 'í', 'ì', 'î', 'ï' },
    { 'j' },
    { 'k' },
    { 'l' },
    { 'm' },
    { 'n', 'ñ' },
    { 'o', 'ó', 'ò', 'ô' },
    { 'p' },
    { 'q' },
    { 'r' },
    { 's', 'š', 'ß' },
    { 't' },
    { 'u', 'ú', 'ù', 'û' },
    { 'v' },
    { 'w' },
    { 'x' },
    { 'y', 'ý', 'ÿ', 'ü' },
    { 'z', 'ž' },
    { 'æ', 'œ', 'ä' },
    { 'ø', 'ö' },
    { 'å' }
}
alphabet_upper = { -- for sorting
    { ' ' },
    { 'A', 'Á', 'À', 'Â'},
    { 'B' },
    { 'C', 'Ç' },
    { 'D' },
    { 'E', 'È', 'É', 'Ë', 'Ê' },
    { 'F' },
    { 'G' },
    { 'H' },
    { 'I', 'Í', 'Ì', 'Ï', 'Î' },
    { 'J' },
    { 'K' },
    { 'L' },
    { 'M' },
    { 'N', 'Ñ' },
    { 'O', 'Ó', 'Ò', 'Ô' },
    { 'P' },
    { 'Q' },
    { 'R' },
    { 'S', 'Š' },
    { 'T' },
    { 'U', 'Ú', 'Ù', 'Û' },
    { 'V' },
    { 'W' },
    { 'X' },
    { 'Y', 'Ý', 'Ÿ', 'Ü' },
    { 'Z', 'Ž' },
    { 'Æ', 'Œ', 'Ä' },
    { 'Ø', 'Ö' },
    { 'Å' }
}

--ABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ

--A   Á   B   C   Č   D   Ð   E   F   G   H   I   J   K   L   M   N   Ŋ   O   P   Q   R   S   Š   T   Ŧ   U   V   W   X   Y   Z   Ž   Æ   Ä   Ø   Ö   Å   Aa  
--1   3   5   7   9   11  13  15  17  19  21  23  25  27  29  31  33  35  37  39  41  43  45  47  49  51  53  55  57  59  61  63  65  67  69  71  73  75  75  
--a   á   b   c   č   d   đ   e   f   g   h   i   j   k   l   m   n   ŋ   o   p   q   r   s   š   t   ŧ   u   v   w   x   y   z   ž   æ   ä   ø   ö   å   aa  
--2   4   6   8   10  12  14  16  18  20  22  24  26  28  30  32  34  36  38  40  42  44  46  48  50  52  54  56  58  60  62  64  66  68  70  72  74  76  76  

alphabet_sort = {
{"A"},  
{"a"},  
{"Á"},  
{"á"},  
{"B"},  
{"b"},  
{"C"},  
{"c"},  
{"Č"},  
{"č"},  
{"D"},  
{"d"},  
{"Ð"},  
{"đ"},  
{"E"},  
{"e"},  
{"F"},  
{"f"},  
{"G"},  
{"g"},  
{"H"},  
{"h"},  
{"I"},  
{"i"},  
{"J"},  
{"j"},  
{"K"},  
{"k"},  
{"L"},  
{"l"},  
{"M"},  
{"m"},  
{"N"},  
{"n"},  
{"Ŋ"},  
{"ŋ"},  
{"O", "Ö"},  
{"o", "ö"},  
{"P"},  
{"p"},  
{"Q"},  
{"q"},  
{"R"},  
{"r"},  
{"S"},  
{"s"},  
{"Š"},  
{"š"},  
{"T"},  
{"t"},  
{"Ŧ"},  
{"ŧ"},  
{"U"},  
{"u"},  
{"V"},  
{"v"},  
{"W"},  
{"w"},  
{"X"},  
{"x"},  
{"Y"},  
{"y"},  
{"Z"},  
{"z"},  
{"Ž"},  
{"ž"},  
{"Æ"},  
{"æ"},  
{"Ä"},  
{"ä"},  
{"Ø"},  
{"ø"},  
{"Ö"},  
{"ö"},  
{"Å", "Aa"},  
{"å", "aa"},
{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}
}

--function getCharType(c)
--  return 2
--end
  
function SORTendhook(list)
  print ("We have "..#list.." total list entries")
  local alpha = {}
  local symbols = {}
  local numbers = {}
  local others = {}
  local firstChar, charType
  local firstCharNumber
  local v
  local latin = {}
  print ("#alphabet_sort: "..#alphabet_sort)
  for j=1,#alphabet_sort do
    print ("Check: "..alphabet_sort[j][1].."["..#alphabet_sort[j].."]")
    for i=1,#list do
      v = list[i]
      if #alphabet_sort[j] > 1 then
        for k = 1,#alphabet_sort[j] do
          if utf.sub(v["Entry"],1,1) == alphabet_sort[j][k] then
            print (alphabet_sort[j],v["Entry"])
            latin[#latin+1] = v
          end
        end
      else
        if utf.sub(v["Entry"],1,1) == alphabet_sort[j][1] then
          print (alphabet_sort[j][1],v["Entry"])
          latin[#latin+1] = v
        end
      end
    end
  end
--[[
  for i=1,#list do
    v = list[i]
    firstChar = NormalizedUppercase(utf.sub(v["sortChar"],1,1))
    v["sortChar"] = firstChar -- to be sure it is an uppercase unicode char
    firstCharNumber = string.utfvalue(firstChar)
    charType = getCharType(firstChar)
    if charType == 0 then 
      symbols[#symbols+1] = v
    elseif charType == 1 then 
      numbers[#numbers+1] = v
    elseif firstCharNumber > 0x052F then  -- 0x052F is last cyrillic character
      others[#others+1] = v
    end
  end
  print ("We have "..#letter.." Latin entries")
  print ("We have "..#symbols.." Symbol entries")
  print ("We have "..#numbers.." Number entries")
  print ("We have "..#others.." other entries")

  list = {}
  for i = 1,#letter do list[#list+1] = letter[i] end
  list[#list]["Macro"] = "\\vspace{1cm}"
  for i = 1,#symbols do list[#list+1] = symbols[i] end
  for i = 1,#numbers do list[#list+1] = numbers[i] end
  for i = 1,#others do list[#list+1] = others[i] end
  print ("Sorted "..#list.." entries")
  return list
]]
  return latin
end