blob: a4253fb0579887d0131756570d5c4e1f8daf4e64 (
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
|
% see lua file for copyright information (MIT License)
\def\luachekchyphenpkgdate{2012/06/20}
\def\luachekchyphenversion{0.1}
\RequirePackage{ifluatex}
\RequirePackage{luatexbase-attr}
\RequirePackage{luatextra}
\RequirePackage{keyval}
\DeclareOption{final}{\setkeys{luacheckhyphen}{final}}
\DeclareOption*{\setkeys{luacheckhyphen}{\CurrentOption}}
\ProvidesPackage{lua-check-hyphen}[\luachekchyphenpkgdate\space v\luachekchyphenversion\space Hyphenation checking for LuaTeX (PGU)]
\def\luachekchyphendothings{\directlua{luachekchyphen.enable() }}
\define@key{luacheckhyphen}{final}[true]{\directlua{luachekchyphen.final = "\luatexluaescapestring{#1}"}}
\define@key{luacheckhyphen}{mark}[true]{\directlua{luachekchyphen.mark = "\luatexluaescapestring{#1}"}}
\define@key{luacheckhyphen}{whitelist}{\directlua{luachekchyphen.whitelist = "\luatexluaescapestring{#1}"}}
\ifluatex
\AtBeginDocument{\luachekchyphendothings}
\directlua{luachekchyphen = require('lua-check-hyphen')}
\def\LuaCheckHyphen#1{\setkeys{luacheckhyphen}{#1}}
\AtEndDocument{\directlua{luachekchyphen.listhyphenatedwords()}}
\else
\def\LuaCheckHyphen#1{}
\message{Warning: lua-check-hyphen only works with LuaTeX (LaTeX format for now)}
\fi
\ProcessOptions
|