| 1 |
%% |
| 2 |
%% This is file `lua-list-hyphen.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% lua-list-hyphen.dtx (with options: `package') |
| 8 |
%% |
| 9 |
%% This is a generated file. |
| 10 |
%% |
| 11 |
%% Copyright (C) 2026 Alan J. Cain |
| 12 |
%% |
| 13 |
%% This file may be distributed and/or modified under the |
| 14 |
%% conditions of the LaTeX Project Public License, either |
| 15 |
%% version 1.3c of this license or (at your option) any later |
| 16 |
%% version. The latest version of this license is in: |
| 17 |
%% |
| 18 |
%% http://www.latex-project.org/lppl.txt |
| 19 |
%% |
| 20 |
%% and version 1.3c or later is part of all distributions of |
| 21 |
%% LaTeX version 2008-05-04 or later. |
| 22 |
%% |
| 23 |
\NeedsTeXFormat{LaTeX2e}[2020-02-02] |
| 24 |
\ProvidesExplPackage{lua-list-hyphen}{2026-05-27}{0.3.20} |
| 25 |
{Listing hyphenated words for LuaLaTeX} |
| 26 |
\sys_if_engine_luatex:F |
| 27 |
{ |
| 28 |
\msg_new:nnn{ lua-list-hyphen }{ lualatex_required } |
| 29 |
{ LuaLaTeX~required.~Package~loading~will~abort. } |
| 30 |
\msg_critical:nn{ lua-list-hyphen }{ lualatex_required } |
| 31 |
} |
| 32 |
\keys_define:nn { lua-list-hyphen }{ |
| 33 |
verbose .bool_set:N = \l__lualisthyphen_verbose_bool, |
| 34 |
} |
| 35 |
\keys_define:nn { lua-list-hyphen }{ |
| 36 |
context-before .int_set:N = \l__lualisthyphen_context_before_int, |
| 37 |
context-before .initial:n = { 2 }, |
| 38 |
context-after .int_set:N = \l__lualisthyphen_context_after_int, |
| 39 |
context-after .initial:n = { 2 }, |
| 40 |
context .code:n = { |
| 41 |
\keys_set:nn{ lua-list-hyphen }{ |
| 42 |
context-before=#1, |
| 43 |
context-after=#1, |
| 44 |
} |
| 45 |
}, |
| 46 |
|
| 47 |
} |
| 48 |
\int_new:N\l__lualisthyphen_unique_int |
| 49 |
\keys_define:nn { lua-list-hyphen }{ |
| 50 |
unique .choices:nn = { none, case, nocase }{ |
| 51 |
\int_set:Nn\l__lualisthyphen_unique_int{ \l_keys_choice_int - 1 } |
| 52 |
}, |
| 53 |
} |
| 54 |
\int_new:N\l__lualisthyphen_sort_int |
| 55 |
\keys_define:nn { lua-list-hyphen }{ |
| 56 |
sort .choices:nn = { none, case, nocase }{ |
| 57 |
\int_set:Nn\l__lualisthyphen_sort_int{ \l_keys_choice_int - 1 } |
| 58 |
}, |
| 59 |
} |
| 60 |
\keys_define:nn { lua-list-hyphen }{ |
| 61 |
include-non-output .bool_set:N = \l__lualisthyphen_include_non_output_bool, |
| 62 |
} |
| 63 |
\keys_define:nn { lua-list-hyphen }{ |
| 64 |
prefix .str_set:N = \l__lualisthyphen_file_prefix_str, |
| 65 |
prefix .initial:e = { \c_sys_jobname_str- }, |
| 66 |
} |
| 67 |
\keys_define:nn { lua-list-hyphen }{ |
| 68 |
extension .str_set:N = \l__lualisthyphen_file_extension_str, |
| 69 |
extension .initial:n = { .hyph }, |
| 70 |
} |
| 71 |
\int_new:N\l__lualisthyphen_debug_int |
| 72 |
\keys_define:nn { lua-list-hyphen }{ |
| 73 |
debug .code:n = {\int_set_eq:NN\l__lualisthyphen_debug_int\c_one_int} |
| 74 |
} |
| 75 |
\ProcessKeyOptions [ lua-list-hyphen ] |
| 76 |
\int_new:N\l__lualisthyphen_verbose_int |
| 77 |
\bool_if:NT\l__lualisthyphen_verbose_bool |
| 78 |
{ \int_set_eq:NN\l__lualisthyphen_verbose_int\c_one_int } |
| 79 |
\int_new:N\l__lualisthyphen_include_non_output_int |
| 80 |
\bool_if:NT\l__lualisthyphen_include_non_output_bool |
| 81 |
{ \int_set_eq:NN\l__lualisthyphen_include_non_output_int\c_one_int } |
| 82 |
\lua_now:n{ |
| 83 |
lualisthyphen = require('lua-list-hyphen') |
| 84 |
} |
| 85 |
\hook_gput_code:nnn{ enddocument/afterlastpage }{ lua-list-hyphen } { |
| 86 |
\__lualisthyphen_babel_save_language_names: |
| 87 |
} |
| 88 |
\cs_new:Npn \__lualisthyphen_babel_save_language_names: |
| 89 |
{ |
| 90 |
\cs_if_exist:NT\bbl@languages |
| 91 |
{ |
| 92 |
\group_begin: |
| 93 |
\cs_set_eq:NN |
| 94 |
\bbl@elt |
| 95 |
\__lualisthyphen_babel_save_language_names_elt:nnnn |
| 96 |
\bbl@languages |
| 97 |
\group_end: |
| 98 |
} |
| 99 |
} |
| 100 |
\cs_new:Npn \__lualisthyphen_babel_save_language_names_elt:nnnn #1#2#3#4 |
| 101 |
{ |
| 102 |
\lua_now:n{ |
| 103 |
lualisthyphen.babel_save_language_name(#2,'#1') |
| 104 |
} |
| 105 |
} |
| 106 |
\hook_gput_code:nnn{ enddocument/info }{ lua-list-hyphen } { |
| 107 |
\__lualisthyphen_process_write_hyphenation_lists:ee |
| 108 |
{\str_use:N\l__lualisthyphen_file_prefix_str} |
| 109 |
{\str_use:N\l__lualisthyphen_file_extension_str} |
| 110 |
} |
| 111 |
\cs_new:Npn \__lualisthyphen_process_write_hyphenation_lists:nn #1#2 |
| 112 |
{ |
| 113 |
\lua_now:e{ |
| 114 |
lualisthyphen.process_write_hyphenation_lists( |
| 115 |
'\luaescapestring{#1}', |
| 116 |
'\luaescapestring{#2}' |
| 117 |
) |
| 118 |
} |
| 119 |
} |
| 120 |
\cs_generate_variant:Nn |
| 121 |
\__lualisthyphen_process_write_hyphenation_lists:nn |
| 122 |
{ ee } |
| 123 |
|