texlive[58087] Master/texmf-dist: luavlna (3mar21)

commits+karl at tug.org commits+karl at tug.org
Wed Mar 3 23:46:05 CET 2021


Revision: 58087
          http://tug.org/svn/texlive?view=revision&revision=58087
Author:   karl
Date:     2021-03-03 23:46:05 +0100 (Wed, 03 Mar 2021)
Log Message:
-----------
luavlna (3mar21)

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.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-03-03 22:45:51 UTC (rev 58086)
+++ trunk/Master/texmf-dist/doc/luatex/luavlna/README.md	2021-03-03 22:46:05 UTC (rev 58087)
@@ -1,4 +1,4 @@
-# Luavlna, version 0.1h, 2021-01-08
+# Luavlna, version 0.1i, 2021-03-02
 
 # 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-03-03 22:45:51 UTC (rev 58086)
+++ trunk/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.tex	2021-03-03 22:46:05 UTC (rev 58087)
@@ -36,7 +36,7 @@
 \section{Introduction}
 
 
-This is a small package for plain Lua\TeX and Lua\LaTeX. In some languages, like
+This is a small package for Plain Lua\TeX and Lua\LaTeX. In some languages, like
 Czech or Polish, there should be no single letter words at the line
 end, according to the typographical norms. There exists some
 external commands (like \verb!vlna!) or packages (\verb!encxvlna!
@@ -144,6 +144,20 @@
   \item[\texttt{defaults}] -- load default settings. Enabled by default.
 \end{description}
 
+
+\section{Default values}
+
+Luavlna defines default settings for Czech and Slovak. If you want to disable them,
+you can use the \texttt{defaults=false} option for Luavlna package. In Plain Lua\TeX{},
+use:
+
+\begin{mycode}
+\begin{verbatim}
+\let\nosingledefaults\relax
+\input luavlna
+\end{verbatim}
+\end{mycode}
+
 \section{Commands}
 
 \begin{mycode}
@@ -165,6 +179,7 @@
 \end{verbatim}
 \end{mycode}
 
+
 %By default, all
 %single letters are processed, this command can be used to pass a
 %string of characters, which should be processed only.
@@ -224,7 +239,7 @@
 
 \subsection{Turning off processing}
 
-If you want to stop processing of the spaces in the document you can use command
+If you want to stop the processing of spaces in the document you can use the following command:
 
 \begin{mycode}
 \cmd{\preventsingleoff}

Modified: trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.sty	2021-03-03 22:45:51 UTC (rev 58086)
+++ trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.sty	2021-03-03 22:46:05 UTC (rev 58087)
@@ -1,4 +1,4 @@
-\ProvidesPackage{luavlna}[2021-01-08 luavlna]
+\ProvidesPackage{luavlna}[2021-03-02 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-03-03 22:45:51 UTC (rev 58086)
+++ trunk/Master/texmf-dist/tex/luatex/luavlna/luavlna.tex	2021-03-03 22:46:05 UTC (rev 58087)
@@ -51,7 +51,7 @@
 end
 
 set_main_language = 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.set_main_language(langid)
 end	
@@ -69,22 +69,33 @@
 end
 }     
 
+% the langno library supports both numeric and literal names
+% 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%
+  \fi%
+}
+
 % Set letters which are prevented from breaking
 \def\singlechars#1#2{%
-\directlua{set_singlechars("#1","#2")}
+  \directlua{set_singlechars("\singlecharsgetlang{#1}","#2")}%
 }
 
 % Define compound initials
 \def\compoundinitials#1#2{%
-\directlua{set_compounds("#1","#2")}
+  \directlua{set_compounds("\singlecharsgetlang{#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("\singlecharsgetlang{#1}")}%
 } 
 
 %\newluatexattribute\preventsinglestatus
@@ -94,18 +105,18 @@
 	\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
 
-\def\enablesplithyphens#1{\directlua{enable_split_hyphens("#1")}}
-\def\disablesplithyphens#1{\directlua{disable_split_hyphens("#1")}}
+\def\enablesplithyphens#1{\directlua{enable_split_hyphens("\singlecharsgetlang{#1}")}}
+\def\disablesplithyphens#1{\directlua{disable_split_hyphens("\singlecharsgetlang{#1}")}}
 
 % disable processing of units or degrees
 



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