| 1 |
% +--------------------------------------------------+ |
| 2 |
% | Typeset this file to get the documentation. | |
| 3 |
% +--------------------------------------------------+ |
| 4 |
% |
| 5 |
%% Copyright (C) 2016-2020 Javier Bezos |
| 6 |
%% All Rights Reserved |
| 7 |
%% http://www.texnia.com |
| 8 |
%% |
| 9 |
%% This work may be distributed and/or modified under the conditions |
| 10 |
%% of the LaTeX Project Public License, either version 1.3 of this |
| 11 |
%% license or (at your option) any later version. The latest version |
| 12 |
%% of this license is in |
| 13 |
%% http://www.latex-project.org/lppl.txt |
| 14 |
%% and version 1.3 or later is part of all distributions of LaTeX |
| 15 |
%% version 2003/12/01 or later. |
| 16 |
%% |
| 17 |
%% This work has the LPPL maintenance status "maintained". |
| 18 |
%% |
| 19 |
%% This Current Maintainer of this work is Javier Bezos. |
| 20 |
%% |
| 21 |
%% This work consists of the files luahyphenrules.tex and |
| 22 |
%% luahyphenrules.sty. |
| 23 |
\documentclass[a4paper]{ltxguide} |
| 24 |
|
| 25 |
\title{\textsf{luahyphenrules}\\\large Version 1.1} |
| 26 |
|
| 27 |
\author{Javier Bezos\\\texttt{http://www.texnia.com}} |
| 28 |
|
| 29 |
\date{2020-08-28} |
| 30 |
|
| 31 |
\raggedright |
| 32 |
\parskip=.8ex |
| 33 |
\advance\oddsidemargin-.7cm |
| 34 |
\advance\textwidth2cm |
| 35 |
\addtolength{\textheight}{3.5cm} |
| 36 |
\addtolength{\topmargin}{-2cm} |
| 37 |
|
| 38 |
\usepackage{xcolor,bera} |
| 39 |
|
| 40 |
\definecolor{notes}{rgb}{.75, .3, .3}% |
| 41 |
|
| 42 |
\makeatletter |
| 43 |
\def\@begintheorem#1#2{% |
| 44 |
\list{}{}% |
| 45 |
\global\advance\@listdepth\m@ne |
| 46 |
\item[{\sffamily\bfseries\color{notes}\MakeUppercase{#1}}]}% |
| 47 |
\makeatother |
| 48 |
\newtheorem{warning}{Warning} |
| 49 |
\newtheorem{note}{Note} |
| 50 |
\newtheorem{example}{Example} |
| 51 |
\newtheorem{changes}{Changes} |
| 52 |
|
| 53 |
\begin{document} |
| 54 |
|
| 55 |
\vspace*{1cm} |
| 56 |
{\fontsize{48}{48}\selectfont \color{notes}{luahyphenrules}\par} |
| 57 |
{\LARGE Loading patterns in \textsf{lualatex} with |
| 58 |
\texttt{language.dat}\par} |
| 59 |
\vspace*{1ex} |
| 60 |
Version 1.1 (2020-08-28)\par |
| 61 |
Javier Bezos (\texttt{http://www.texnia.com}) |
| 62 |
|
| 63 |
\vspace*{6ex} |
| 64 |
|
| 65 |
Preloading hyphenation patterns (or ``hyphen rules'') into the format |
| 66 |
is not required in Lua\TeX. On the contrary, it is even discouraged |
| 67 |
and accordingly recent releases of \textsf{babel} don't do it. This file is |
| 68 |
addressed to those who just want to select the language and load their |
| 69 |
patterns without loading at all the \textsf{babel} package with |
| 70 |
|\usepackage|. |
| 71 |
|
| 72 |
When \textsf{luahyphenrules} is loaded, it reads |language.dat| and |
| 73 |
stores its data. Then, you can use the following command to select the |
| 74 |
language. |
| 75 |
|
| 76 |
\begin{decl} |
| 77 |
|\HyphenRules{<language-name>}| |
| 78 |
\end{decl} |
| 79 |
|
| 80 |
Here |<language-name>| is the name in |language.dat|. It select the |
| 81 |
language, if exists, and loads its hyphenations patterns if not done |
| 82 |
before. If the language does not exist or there are no patterns, it |
| 83 |
raises and error. |
| 84 |
|
| 85 |
\begin{note} |
| 86 |
If you are using \textsf{babel} you do not need this package. |
| 87 |
\end{note} |
| 88 |
|
| 89 |
\begin{note} |
| 90 |
Actually, loading hypenations patterns in Lua\TeX{} is so simple as |
| 91 |
inputting the corresponding file with the correct catcode regime |
| 92 |
when the language is active (which in turn may be created with |
| 93 |
|\newlanguage|). This package is mostly about reading and |
| 94 |
parsing |language.dat| at runtime. |
| 95 |
\end{note} |
| 96 |
|
| 97 |
\begin{note} |
| 98 |
The internal variable |\bbl@languages|, containing the list of |
| 99 |
languages in |language.dat|, is also set by this package. See the |
| 100 |
\textsf{babel} manual for further info. |
| 101 |
\end{note} |
| 102 |
|
| 103 |
\begin{warning} |
| 104 |
This package only works with Lua\LaTeX. |
| 105 |
\end{warning} |
| 106 |
|
| 107 |
\begin{changes} |
| 108 |
\textbf{1.1.} Fixed a bug with recent |babel| versions. |
| 109 |
\end{changes} |
| 110 |
|
| 111 |
\end{document} |