summaryrefslogtreecommitdiff
path: root/macros/luatex/latex/luahyphenrules/luahyphenrules.tex
blob: d249d9d9ac6106c9b34a87400e91b4030387a373 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
% +--------------------------------------------------+
% | Typeset this file to get the documentation.      |
% +--------------------------------------------------+
%
%% Copyright (C) 2016 Javier Bezos
%% All Rights Reserved
%% http://www.texnia.com
%%
%% This work may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.3 of this
%% license or (at your option) any later version.  The latest version
%% of this license is in
%%     http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% This Current Maintainer of this work is Javier Bezos.
%%
%% This work consists of the files luahyphenrules.tex and
%% luahyphenrules.sty.
\documentclass[a4paper]{ltxguide}

\title{\textsf{luahyphenrules}\\\large Version 1.0}

\author{Javier Bezos\\\texttt{http://www.texnia.com}}

\date{2016-12-07}
   
\raggedright
\parskip=.8ex
\advance\oddsidemargin-.7cm
\advance\textwidth2cm
\addtolength{\textheight}{3.5cm}
\addtolength{\topmargin}{-2cm}

\usepackage{xcolor,bera}

\definecolor{notes}{rgb}{.75, .3, .3}%

\makeatletter
\def\@begintheorem#1#2{%
  \list{}{}%
  \global\advance\@listdepth\m@ne
  \item[{\sffamily\bfseries\color{notes}\MakeUppercase{#1}}]}%
\makeatother
\newtheorem{warning}{Warning}
\newtheorem{note}{Note}
\newtheorem{example}{Example}

\begin{document}

\vspace*{1cm}
{\fontsize{48}{48}\selectfont \color{notes}{luahyphenrules}\par}
{\LARGE Loading patterns in \textsf{lualatex} with
\texttt{language.dat}\par}
\vspace*{1ex}
Version 1.0 (2016-12-07)\par
Javier Bezos (\texttt{http://www.texnia.com})

\vspace*{6ex}

Preloading hyphenation patterns (or ``hyphen rules'') into the format
is not required in Lua\TeX. On the contrary, it is even discouraged
and accordingly recent releases of \textsf{babel} don't do it. This file is
addressed to those who just want to select the language and load their
patterns without loading at all the \textsf{babel} package with
|\usepackage|.

When \textsf{luahyphenrules} is loaded, it reads |language.dat| and
stores its data. Then, you can use the following command to select the
language.

\begin{decl}
|\HyphenRules{<language-name>}|
\end{decl}

Here |<language-name>| is the name in |language.dat|. It select the
language, if exists, and loads its hyphenations patterns if not done
before. If the language does not exist or there are no patterns, it
raises and error.

\begin{note}
  If you are using \textsf{babel} you do not need this package.
\end{note}

\begin{note}
  Actually, loading hypenations patterns in Lua\TeX{} is so simple as
  inputting the corresponding file with the correct catcode regime
  when the language is active (which in turn may be created with
  |\newlanguage|). This package is mostly about reading and
  parsing |language.dat| at runtime.
\end{note}

\begin{note}
  The internal variable |\bbl@languages|, containing the list of
  languages in |language.dat|, is also set by this package. See the
  \textsf{babel} manual for further info.
\end{note}

\begin{warning}
  This package only works with Lua\LaTeX.
\end{warning}


\end{document}