summaryrefslogtreecommitdiff
path: root/macros/luatex/latex/lua-check-hyphen/lua-check-hyphen.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/luatex/latex/lua-check-hyphen/lua-check-hyphen.sty
Initial commit
Diffstat (limited to 'macros/luatex/latex/lua-check-hyphen/lua-check-hyphen.sty')
-rw-r--r--macros/luatex/latex/lua-check-hyphen/lua-check-hyphen.sty44
1 files changed, 44 insertions, 0 deletions
diff --git a/macros/luatex/latex/lua-check-hyphen/lua-check-hyphen.sty b/macros/luatex/latex/lua-check-hyphen/lua-check-hyphen.sty
new file mode 100644
index 0000000000..933694871a
--- /dev/null
+++ b/macros/luatex/latex/lua-check-hyphen/lua-check-hyphen.sty
@@ -0,0 +1,44 @@
+% Copyright 2012–2017 Patrick Gundlach (patrick@gundla.ch)
+% Public repository: https://github.com/pgundlach/lua-check-hyphen
+% Licensed under the MIT license. See the file 'mit-license.txt' for exact terms.
+
+% Don't change these two lines, they are updated automatically
+\def\luachekchyphenpkgdate{2018/04/19}
+\def\luachekchyphenversion{0.7a}
+
+
+\RequirePackage{ifluatex}
+\RequirePackage{luatexbase}
+\RequirePackage{keyval}
+
+\DeclareOption{final}{\setkeys{luacheckhyphen}{final}}
+\DeclareOption{nofile}{\setkeys{luacheckhyphen}{nofile}}
+
+\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}{nofile}[true]{\directlua{luachekchyphen.nofile = "\luaescapestring{#1}"}}
+\define@key{luacheckhyphen}{compact}[true]{\directlua{luachekchyphen.compact = "\luaescapestring{#1}"}}
+\define@key{luacheckhyphen}{final}[true]{\directlua{luachekchyphen.final = "\luaescapestring{#1}"}}
+\define@key{luacheckhyphen}{mark}[true]{\directlua{luachekchyphen.mark = "\luaescapestring{#1}"}}
+\define@key{luacheckhyphen}{whitelist}{\directlua{luachekchyphen.whitelist = "\luaescapestring{#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
+
+