diff options
Diffstat (limited to 'Master/texmf-dist/doc/luatex/luavlna')
-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 | 87293 -> 89010 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.tex | 34 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/luavlna/luavlna.tex | 19 |
4 files changed, 52 insertions, 3 deletions
diff --git a/Master/texmf-dist/doc/luatex/luavlna/README.md b/Master/texmf-dist/doc/luatex/luavlna/README.md index 366cd21700c..b027486b216 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.1c, 2019-04-16 +# Luavlna, version v0.1d, 2019-10-22 # 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 c9295780139..cb80186aee2 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/doc/luatex/luavlna/luavlna-doc.tex b/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.tex index 1519d7fe9f7..f8c95a291cb 100644 --- a/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.tex +++ b/Master/texmf-dist/doc/luatex/luavlna/luavlna-doc.tex @@ -44,7 +44,7 @@ for enc\TeX, \verb!xevlna! for Xe\TeX, \verb!impnattypo! for Lua\LaTeX). %This package is for plain %lua\TeX and for lua\LaTeX. -Other feature of this package is including of non-breakable space after +Another feature is inclusion of a non-breakable space after initials, like in personal names, after or before academic degrees and between numbers and units (SI and others). @@ -52,10 +52,11 @@ The code is modified version of Patrick Gundlach's answer on TeX.sx\footnote{\url{http://tex.stackexchange.com/a/28128/2891}}. The difference is that it is possible to specify which single letters should be taken into account for different languages. -The support for degrees and units was added as well. +% The support for degrees and units was added as well. % The code works also for single letters at the beginning of the brackets. + \section{Usage} The usage is simple: @@ -169,6 +170,35 @@ Default values: \end{verbatim} \end{mycode} + +\subsection{Split hyphens} + +The hyphenated words like ``je-li'' should be be hyphenated as ``je-/-li`` +according to the Czech typesetting rules. This behaviour can be enabled or disabled for a particular +language using the following commands: + +\begin{mycode} + \cmd{\enablesplithyphens}\marg{language name}\\ + \cmd{\disablesplithyphens}\marg{language name} +\end{mycode} + +By default, it is enabled for the Czech language. + +Example in action: + +\begin{minipage}{3in} + \selectlanguage{czech} + Sedlec-Prčice, modro-zelený, překladatel-tlumočník, kuchař-číšník, propan-butan, + Otýlie Sklenářová-Malá, František Jílek-Oberpfalcer. + \selectlanguage{english} +\end{minipage} + +The similar behaviour can be achieved using the \verb|\splithyphens| command +provided by Czech langauge definitions for the Babel package, but it's use is +discouraged. It prevents use ot the hyphen character in many situations. The +solution provided by Luavlna should be safe. + + \subsection{Turning off language switching} By default, language of the nodes is taken into account. If you want to use diff --git a/Master/texmf-dist/doc/luatex/luavlna/luavlna.tex b/Master/texmf-dist/doc/luatex/luavlna/luavlna.tex index f3c44f1b695..a0fb9e515e9 100644 --- a/Master/texmf-dist/doc/luatex/luavlna/luavlna.tex +++ b/Master/texmf-dist/doc/luatex/luavlna/luavlna.tex @@ -5,6 +5,7 @@ langno = require "luavlna-langno" require "ltluatex" luatexbase.add_to_callback("pre_linebreak_filter", luavlna.preventsingle,"LuaVlna") +luatexbase.add_to_callback("hyphenate", luavlna.split_hyphens, "allow hyphen breaks") % -- define the attribute number luavlna.preventsingleid = math.random(2^16) @@ -54,6 +55,18 @@ set_main_language = function(lang) if not langid then return nil, "Cannot find language number for: "..lang end luavlna.set_main_language(langid) end + +enable_split_hyphens = function(lang) + local langid = languages:get_number(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) + if not langid then return nil, "Cannot find language number for: "..lang end + luavlna.split_hyphen_langs[langid] = nil +end } % Set letters which are prevented from breaking @@ -89,6 +102,11 @@ end \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")}} + % disable processing of units or degrees \def\nopredegrees{\directlua{luavlna.no_predegrees = true}} @@ -99,5 +117,6 @@ end \singlechars{czech}{AIiVvOoUuSsZzKk} \singlechars{slovak}{AIiVvOoUuSsZzKk} \compoundinitials{czech}{Ch,CH} + \enablesplithyphens{czech} \fi |