summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/luavlna/luavlna.sty
blob: aa6f623aa9c566691018f4773da2b070552994ed (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
\ProvidesPackage{luavlna}[2019/10/30 luavlna]

\RequirePackage{kvoptions}

\def\nosingledefaults{\relax}
\input luavlna 

% we need to redefine the setting functions to use directly the language numbers
% in order to support polyglossia
\def\singlechars#1#2{%
  \ifcsname l@#1\endcsname%
    \expandafter\directlua\expandafter{set_singlechars("\the\csname l@#1\endcsname","#2")}%
  \fi%
}

% Define compound initials
\def\compoundinitials#1#2{%
  \ifcsname l@#1\endcsname%
    \expandafter\directlua\expandafter{set_compounds("\the\csname l@#1\endcsname","#2")}%
  \fi%
}


\def\enablesplithyphens#1{%
  \ifcsname l@#1\endcsname%
  \typeout{set lang #1, \the\csname l@#1\endcsname}%
    \directlua{enable_split_hyphens("\the\csname l@#1\endcsname")}%
  \fi%
}

\def\disablesplithyphens#1{%
  \ifcsname l@#1\endcsname%
    \directlua{disable_split_hyphens("\the\csname l@#1\endcsname")}%
  \fi%
}

\DeclareVoidOption{noinitials}{\noinitials}
\DeclareVoidOption{nounits}{\nounits}
\DeclareVoidOption{nopredegrees}{\nopredegrees}
\DeclareVoidOption{nosufdegrees}{\nosufdegrees}
\DeclareVoidOption{noprocess}{\preventsingleoff}
\DeclareVoidOption{debug}{\preventsingledebugon}
\DeclareBoolOption[true]{defaults}
\ProcessKeyvalOptions*

\ifluavlna@defaults
\AtBeginDocument{%
  \singlechars{czech}{AIiVvOoUuSsZzKk}
  \singlechars{slovak}{AIiVvOoUuSsZzKk}
  \compoundinitials{czech}{Ch,CH}
  \enablesplithyphens{czech}
  \enablesplithyphens{slovak}
}
\fi
\endinput