diff options
Diffstat (limited to 'macros/luatex/generic')
-rw-r--r-- | macros/luatex/generic/luavlna/README.md | 2 | ||||
-rw-r--r-- | macros/luatex/generic/luavlna/luavlna-doc.pdf | bin | 92180 -> 85036 bytes | |||
-rw-r--r-- | macros/luatex/generic/luavlna/luavlna-doc.tex | 8 | ||||
-rw-r--r-- | macros/luatex/generic/luavlna/luavlna-langno.lua | 3 | ||||
-rw-r--r-- | macros/luatex/generic/luavlna/luavlna.lua | 19 | ||||
-rw-r--r-- | macros/luatex/generic/luavlna/luavlna.sty | 2 | ||||
-rw-r--r-- | macros/luatex/generic/luavlna/luavlna.tex | 13 |
7 files changed, 32 insertions, 15 deletions
diff --git a/macros/luatex/generic/luavlna/README.md b/macros/luatex/generic/luavlna/README.md index 1fe76754d5..aeaf7d2bd0 100644 --- a/macros/luatex/generic/luavlna/README.md +++ b/macros/luatex/generic/luavlna/README.md @@ -1,4 +1,4 @@ -# Luavlna, version 0.1l, 2023-06-21 +# Luavlna, version 0.1m, 2024-05-02 # Introduction diff --git a/macros/luatex/generic/luavlna/luavlna-doc.pdf b/macros/luatex/generic/luavlna/luavlna-doc.pdf Binary files differindex a75499a3c9..7f80b780a7 100644 --- a/macros/luatex/generic/luavlna/luavlna-doc.pdf +++ b/macros/luatex/generic/luavlna/luavlna-doc.pdf diff --git a/macros/luatex/generic/luavlna/luavlna-doc.tex b/macros/luatex/generic/luavlna/luavlna-doc.tex index 470822d4ac..698f46e52d 100644 --- a/macros/luatex/generic/luavlna/luavlna-doc.tex +++ b/macros/luatex/generic/luavlna/luavlna-doc.tex @@ -87,7 +87,7 @@ 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. +12 MiB. Uvnitř matematiky by mělo být zpracování vypnuté: $k \in \mathbb N$. Pokračujeme v příkladu. @@ -113,7 +113,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, Ch. Borner. -Podpora jednotek: 100,5 MN\cdot{}s, 100.5 kJ, 200 µA, $-1$ dag, 12 MiB, 1 m$^3$/s. +Podpora jednotek: 100,5 MN\cdot{}s, 100.5 kJ, 200 µA, $-1$ dag, 12 MiB. Uvnitř matematiky by mělo být zpracování vypnuté: $k \in \mathbb N$. Pokračujeme v příkladu. @@ -298,7 +298,9 @@ File \verb|language.dat| is processed to load language names, aliases and assign local luatex = langno.load_languages(fmt) local t = {} for k, v in pairs(luatex.names) do - t[#t+1]=k + if k and k~="" then + t[#t+1]=k + end end table.sort(t) tex.print(table.concat(t,", ")) diff --git a/macros/luatex/generic/luavlna/luavlna-langno.lua b/macros/luatex/generic/luavlna/luavlna-langno.lua index f703e4328a..7f25d84100 100644 --- a/macros/luatex/generic/luavlna/luavlna-langno.lua +++ b/macros/luatex/generic/luavlna/luavlna-langno.lua @@ -58,7 +58,8 @@ local load_lang_dat = function(start) end local load_lang_dat_lualatex = function() - return load_lang_dat(1) + -- it used to be 1, but it seems that in newer LuaLaTeX versions, we should start at 0 + return load_lang_dat(0) end local load_csplain= function() diff --git a/macros/luatex/generic/luavlna/luavlna.lua b/macros/luatex/generic/luavlna/luavlna.lua index 416ecc5841..3e5f79346f 100644 --- a/macros/luatex/generic/luavlna/luavlna.lua +++ b/macros/luatex/generic/luavlna/luavlna.lua @@ -260,6 +260,15 @@ local is_unit = function(word) return false end +local function handle_unit(word, anchor) + -- insert nbsp between numbers and units + word = cut_off_end_chars(word, false) + if is_unit(word) then + anchor = replace_with_thin_space(anchor) + insert_penalty(anchor.prev) + end +end + local predegrees = Set (require "luavlna-predegrees") local sufdegrees = Set (require "luavlna-sufdegrees") @@ -299,11 +308,7 @@ local function prevent_single_letter (head) if wasnumber then if word ~= "" then wasnumber = false - word = cut_off_end_chars(word, false) - if is_unit(word) then - anchor = replace_with_thin_space(anchor) - insert_penalty(anchor.prev) - end + handle_unit(word, anchor) end elseif is_number(word) then wasnumber = true @@ -356,6 +361,10 @@ local function prevent_single_letter (head) end head = head.next end + -- insert spaces at the end of node list + if wasnumber then + handle_unit(word, anchor) + end return true end diff --git a/macros/luatex/generic/luavlna/luavlna.sty b/macros/luatex/generic/luavlna/luavlna.sty index 9f411c5f9f..b49ef89803 100644 --- a/macros/luatex/generic/luavlna/luavlna.sty +++ b/macros/luatex/generic/luavlna/luavlna.sty @@ -1,4 +1,4 @@ -\ProvidesPackage{luavlna}[2023-06-21 luavlna] +\ProvidesPackage{luavlna}[2024-05-02 luavlna] \ifdefined\directlua\else \PackageWarning{luavlna}{Luavlna needs LuaLaTeX, aborting} diff --git a/macros/luatex/generic/luavlna/luavlna.tex b/macros/luatex/generic/luavlna/luavlna.tex index d678854e9a..ddddf8ab9e 100644 --- a/macros/luatex/generic/luavlna/luavlna.tex +++ b/macros/luatex/generic/luavlna/luavlna.tex @@ -72,10 +72,15 @@ end % we can try to find the language ID from macros first, if it fails % we pass the language name to Lua. it will try to find ID in luanguage.dat and other sources \def\singlecharsgetlang#1{% - \ifcsname lang@#1\endcsname% - \the\csname lang@#1\endcsname% - \else% unknown language macro, let langno library to find it - #1% + \ifcsname l@#1\endcsname% + \the\csname l@#1\endcsname% + \else% + \ifcsname lang@#1\endcsname% + \the\csname lang@#1\endcsname% + \else% + % unknown language macro, let langno library to find it + #1% + \fi% \fi% } |