texlive[57379] Master/texmf-dist: luavlna (10jan21)

commits+karl at tug.org commits+karl at tug.org
Sun Jan 10 22:56:45 CET 2021


Revision: 57379
          http://tug.org/svn/texlive?view=revision&revision=57379
Author:   karl
Date:     2021-01-10 22:56:45 +0100 (Sun, 10 Jan 2021)
Log Message:
-----------
luavlna (10jan21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/luatex/luavlna/README.md
    trunk/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.pdf
    trunk/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.tex
    trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.lua
    trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.sty
    trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.tex

Modified: trunk/Master/texmf-dist/doc/luatex/luavlna/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luavlna/README.md	2021-01-10 21:56:31 UTC (rev 57378)
+++ trunk/Master/texmf-dist/doc/luatex/luavlna/README.md	2021-01-10 21:56:45 UTC (rev 57379)
@@ -1,4 +1,4 @@
-# Luavlna, version v0.1g, 2020-06-02
+# Luavlna, version 0.1h, 2021-01-08
 
 # Introduction
 

Modified: trunk/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.tex	2021-01-10 21:56:31 UTC (rev 57378)
+++ trunk/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.tex	2021-01-10 21:56:45 UTC (rev 57379)
@@ -83,7 +83,8 @@
 
 Různé možnosti [v závorkách <i jiných znacích
 
-Podpora iniciál a titulů: M. J. Hegel, Ing. Běháková, Ph.D., Ž. Zíbrt.
+Podpora iniciál a titulů: M. J. Hegel, Ing. Běháková, Ph.D., Ž. Zíbrt, 
+Ch. Borner.
 
 Podpora jednotek: 100,5 MN\cdot{}s, 100.5 kJ, 200 µA, $-1$ dag, 
 12 MiB, 1 m$^3$/s.
@@ -110,7 +111,7 @@
 
 Různé možnosti [v závorkách \textless i jiných znacích
 
-Podpora iniciál a titulů: M. J. Hegel, Ing. Běháková, Ph.D., Ž. Zíbrt.
+Podpora iniciál a titulů: M. J. Hegel, Ing. Běháková, Ph.D., Ž. Zíbrt, Ch. Borner.
 
 Podpora jednotek: 100,5 MN\cdot{}s, 100.5 kJ, 200 µA, $-1$ dag, 12 MiB, 1 m$^3$/s.
 

Modified: trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.lua	2021-01-10 21:56:31 UTC (rev 57378)
+++ trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.lua	2021-01-10 21:56:45 UTC (rev 57379)
@@ -166,6 +166,20 @@
 
 local init_buffer = ""
 local is_initial = function(c, lang)
+  -- space is not initial
+  if c == " " then 
+    init_buffer = ""
+    return false
+  end
+  -- look in the initals table
+  if lang then
+    -- insert the current character to the init_buffer
+    -- and try to find the string in the initial table
+    -- for the current language
+    init_buffer = init_buffer .. c
+    local tbl = initials[lang] or {}
+    if tbl[init_buffer] then return true end
+  end
   return is_uppercase(c)
 end
 
@@ -295,7 +309,7 @@
         space = false
         -- handle initials
         -- uppercase letter followed by period (code 46)
-      elseif no_initials~=true and init and head.id == glyph_id and head.char == period_char and nextn.id == glue_id and utf_len(word) == 1 then 
+      elseif no_initials~=true and init and head.id == glyph_id and head.char == period_char and nextn.id == glue_id  then 
         head = insert_penalty(head)
       elseif head.id == glyph_id then
         local char = getchar(head)
@@ -334,7 +348,7 @@
 
 -- detect if the current character is a hyphen
 local function is_breakable_hyphen(n)
-  return n.id == glyph_id and hyphenate_langs[n.lang] and n.char == hyphenchar 
+  return n.id == glyph_id and hyphenate_langs[n.lang] and n.char == hyphenchar and n.next 
 end
 
 -- don't process hyphens if the next node is penalty
@@ -346,6 +360,14 @@
   end
 end
 
+-- split hyphens should be active only inside words, there is no need to break
+-- standalone hyphens 
+local function is_next_glyph(n)
+  local next_node = n.next
+  return next_node and next_node.id == glyph_id
+end
+
+
 -- Enable hyphenation of words that contain hyphens
 -- and repeating of the explicit hyphen on a new line when
 -- the hyphen is hyphenated
@@ -357,7 +379,7 @@
     local n = head
     while n do
        local skip = node.has_attribute(n, M.preventsingleid)
-       if skip ~= 1 and is_breakable_hyphen(n) and not is_next_penalty(n) and not is_hyphen_ligature(n)  then
+       if skip ~= 1 and is_breakable_hyphen(n) and not is_next_penalty(n) and is_next_glyph(n) and not is_hyphen_ligature(n)  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'))

Modified: trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.sty	2021-01-10 21:56:31 UTC (rev 57378)
+++ trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.sty	2021-01-10 21:56:45 UTC (rev 57379)
@@ -1,4 +1,4 @@
-\ProvidesPackage{luavlna}[2019/10/30 luavlna]
+\ProvidesPackage{luavlna}[2021-01-08 luavlna]
 
 \RequirePackage{kvoptions}
 
@@ -23,7 +23,7 @@
 
 \def\enablesplithyphens#1{%
   \ifcsname l@#1\endcsname%
-  \typeout{set lang #1, \the\csname l@#1\endcsname}%
+  \typeout{set lang #1, \the\csname l@#1\endcsname}
     \directlua{enable_split_hyphens("\the\csname l@#1\endcsname")}%
   \fi%
 }

Modified: trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.tex
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.tex	2021-01-10 21:56:31 UTC (rev 57378)
+++ trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.tex	2021-01-10 21:56:45 UTC (rev 57379)
@@ -71,20 +71,20 @@
 
 % Set letters which are prevented from breaking
 \def\singlechars#1#2{%
-\directlua{set_singlechars("#1","#2")}%
+\directlua{set_singlechars("#1","#2")}
 }
 
 % Define compound initials
 \def\compoundinitials#1#2{%
-\directlua{set_compounds("#1","#2")}%
+\directlua{set_compounds("#1","#2")}
 }
 % Enable inserting of visual marks for debugging
 \def\preventsingledebugon{%
-\directlua{luavlna.debug(true)}%
+\directlua{luavlna.debug(true)}
 }
 
 \def\preventsinglelang#1{%
-	\directlua{set_main_language("#1")}%
+	\directlua{set_main_language("#1")}
 } 
 
 %\newluatexattribute\preventsinglestatus
@@ -94,12 +94,12 @@
 	\preventsinglestatus=2
 }
 
-\def\preventsingleoff{%
+\def\preventsingleoff{
 	\preventsinglestatus=1
 }
 % Disable inserting of visual marks for dewbugging
 \def\preventsingledebugoff{%
-\directlua{luavlna.debug(false)}%
+\directlua{luavlna.debug(false)}
 }
 
 % enable/disable split hyphens for a language



More information about the tex-live-commits mailing list.