diff options
-rw-r--r-- | Master/texmf-dist/doc/luatex/luavlna/README.md | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.pdf | bin | 89010 -> 88997 bytes | |||
-rw-r--r-- | Master/texmf-dist/tex/luatex/luavlna/luavlna.lua | 3 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/luavlna/luavlna.sty | 18 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/luavlna/luavlna.tex (renamed from Master/texmf-dist/doc/luatex/luavlna/luavlna.tex) | 7 | ||||
-rwxr-xr-x | Master/tlpkg/libexec/ctan2tds | 2 |
6 files changed, 26 insertions, 6 deletions
diff --git a/Master/texmf-dist/doc/luatex/luavlna/README.md b/Master/texmf-dist/doc/luatex/luavlna/README.md index b027486b216..ae6eb4cfb89 100644 --- a/Master/texmf-dist/doc/luatex/luavlna/README.md +++ b/Master/texmf-dist/doc/luatex/luavlna/README.md @@ -1,4 +1,4 @@ -# Luavlna, version v0.1d, 2019-10-22 +# Luavlna, version v0.1e, 2019-10-29 # Introduction diff --git a/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.pdf b/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.pdf Binary files differindex cb80186aee2..177832d3f4f 100644 --- a/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.pdf +++ b/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.pdf diff --git a/Master/texmf-dist/tex/luatex/luavlna/luavlna.lua b/Master/texmf-dist/tex/luatex/luavlna/luavlna.lua index 73a10fe9ba8..dea4c052eb0 100644 --- a/Master/texmf-dist/tex/luatex/luavlna/luavlna.lua +++ b/Master/texmf-dist/tex/luatex/luavlna/luavlna.lua @@ -317,7 +317,8 @@ local break_hyphens = function(head, tail) local glyph_id = node.id("glyph") local n = head while n do - if n.id == glyph_id and hyphenate_langs[n.lang] and n.char == hyphenchar then + local skip = node.has_attribute(n, M.preventsingleid) + if skip ~= 1 and n.id == glyph_id and hyphenate_langs[n.lang] and n.char == hyphenchar then -- Insert an infinite penalty before, and a zero-width glue node after, the hyphen. -- Like writing "\nobreak-\hspace{0pt}" or equivalently "\penalty10000-\hskip0pt" local p = node.new(node.id('penalty')) diff --git a/Master/texmf-dist/tex/luatex/luavlna/luavlna.sty b/Master/texmf-dist/tex/luatex/luavlna/luavlna.sty index 44efffb6bd6..48db36b5f47 100644 --- a/Master/texmf-dist/tex/luatex/luavlna/luavlna.sty +++ b/Master/texmf-dist/tex/luatex/luavlna/luavlna.sty @@ -3,6 +3,8 @@ \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")}% @@ -16,10 +18,26 @@ \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% +} + + \AtBeginDocument{% \singlechars{czech}{AIiVvOoUuSsZzKk} \singlechars{slovak}{AIiVvOoUuSsZzKk} \compoundinitials{czech}{Ch,CH} \enablesplithyphens{czech} + \enablesplithyphens{slovak} } \endinput diff --git a/Master/texmf-dist/doc/luatex/luavlna/luavlna.tex b/Master/texmf-dist/tex/luatex/luavlna/luavlna.tex index a0fb9e515e9..5159fbe5b54 100644 --- a/Master/texmf-dist/doc/luatex/luavlna/luavlna.tex +++ b/Master/texmf-dist/tex/luatex/luavlna/luavlna.tex @@ -11,7 +11,7 @@ luavlna.preventsingleid = math.random(2^16) local languages = langno.load_languages() local get_lang_id = function(lang) - local langid = lang + local langid = tonumber(lang) if not tonumber(lang) then langid = languages:get_number(lang) end @@ -57,13 +57,13 @@ set_main_language = function(lang) end enable_split_hyphens = function(lang) - local langid = languages:get_number(lang) + local langid = get_lang_id(lang) if not langid then return nil, "Cannot find language number for: "..lang end luavlna.split_hyphen_langs[langid] = true end disable_split_hyphens = function(lang) - local langid = languages:get_number(lang) + local langid = get_lang_id(lang) if not langid then return nil, "Cannot find language number for: "..lang end luavlna.split_hyphen_langs[langid] = nil end @@ -118,5 +118,6 @@ end \singlechars{slovak}{AIiVvOoUuSsZzKk} \compoundinitials{czech}{Ch,CH} \enablesplithyphens{czech} + \enablesplithyphens{slovak} \fi diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index 3bd72096eab..85ec0b11098 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -1877,7 +1877,7 @@ $standardtex 'luapackageloader', '\.lua|' . $standardtex, 'luatexko', '\.lua|' . $standardtex, 'luatodonotes','\.lua|' . $standardtex, - 'luavlna', 'luavlna.*\.lua|' . $standardtex, + 'luavlna', 'luavlna.*\.lua|luavlna\.tex|' . $standardtex, 'luaxml', '\.lua|' . $standardtex, 'lyluatex', '\.sty', # not *.cls 'magyar', 'NULL', # do not install in runtime, conflicts with babel |