Debian Codegraph @

texmf-dist/tex/latex/polyglossia/polyglossia-latin.lua

raw
1 --
2 -- polyglossia-latin.lua
3 -- part of polyglossia v2.10 -- 2026/04/18
4 --
5
6 require('polyglossia-punct')
7
8 -- For ecclesiastic Latin (and sometimes for Italian) a very small space is
9 -- used for the punctuation. The ecclesiastic package uses a space of
10 -- 0.3\fontdimen2, where \fontdimen2 is a interword space, which is typically
11 -- between 1/4 and 1/3 of a quad. We choose a half of a \thinspace here.
12 local hairspace = 0.08333 -- 1/12
13
14 local function space_left(char)
15 polyglossia.add_left_spaced_character('latin', char, hairspace, 'quad')
16 end
17
18 local function space_right(char)
19 polyglossia.add_right_spaced_character('latin', char, hairspace, 'quad')
20 end
21
22 polyglossia.clear_spaced_characters('latin')
23 space_left('!')
24 space_left('?')
25 space_left('‼')
26 space_left('⁇')
27 space_left('⁈')
28 space_left('⁉')
29 space_left('‽') -- U+203D (interrobang)
30 space_left(':')
31 space_left(';')
32 space_left('»')
33 space_left('›')
34 space_right('«')
35 space_right('‹')
36
37 local function activate_latin_punct()
38 polyglossia.activate_punct('latin')
39 end
40
41 local function deactivate_latin_punct()
42 polyglossia.deactivate_punct()
43 end
44
45 polyglossia.activate_latin_punct = activate_latin_punct
46 polyglossia.deactivate_latin_punct = deactivate_latin_punct