summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/lualatex/lua-check-hyphen/doc/luacheckhyphenmanual.tex
blob: 4fcbaa84a3fa0c497fb9b3cae9852609990147d1 (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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
\documentclass{ltxdockit}
\usepackage{csquotes,graphicx}
\newcommand\pkgversion{0.6}

\titlepage{%
  title={The lua-check-hyphen package},
  subtitle={Checking your hyphenated words},
  url={https://github.com/pgundlach/lua-check-hyphen},
  author={Patrick Gundlach},
  email={patrick@gundla.ch},
  revision={\pkgversion},
  date={\today}}

\hypersetup{%
  pdftitle={The lua-check-hyphen package},
  pdfsubject={Checking your hyphenated words},
  pdfauthor={Patrick Gundlach},
  pdfkeywords={tex, latex, hyphenation}}




\begin{document}
\printtitlepage
\tableofcontents

\section{Introduction}

\TeX\ is pretty good at hyphenating words. But a computer algorithm is not perfect, sometimes we wish to manually check all used hyphenations in a document. This package helps you on this task.

\section{Usage}

This package only works with Lua\TeX. To activate it a

\begin{verbatim}
	\usepackage{lua-check-hyphen}
\end{verbatim}
is enough.

When you process your document with Lua\LaTeX, a file with the suffix \verb|.uhy| is created with that contains every hyphenated word. You can check that file for hyphenation errors. With the package option \texttt{nofile}, you can tell the package not to write the external file. In any case the list is written to the log file.

\section{Advanced usage}
\label{sec:advanced_usage}

With longer documents it becomes tedious checking for the same hyphenated words over and over. Therefore this package allows you to create a whitelist of \emph{accepted hyphenation}. This whitelist is a simple textfile where the words are separated by whitespace and the allowed hyphenation is marked with a dash (-). You can use the output file \texttt{.uhy} as an input for the whitelist file. You load the file in your document with

\begin{verbatim}
	\LuaCheckHyphen{whitelist=myfile.txt}
\end{verbatim}

and a sample file looks like this:

\begin{verbatim}
seren-ity
morn-ings
posses-sion
\end{verbatim}

or

\begin{verbatim}
seren-ity morn-ings posses-sion
\end{verbatim}

The format is not important, the entries must be separated by whitespace.

Words in this whitelist won't be reported. \sty{lua-check-hyphen} assumes that these are valid break points.

You can have more than one whitelist file by giving the filenames separated by comma:

\begin{verbatim}
\LuaCheckHyphen{whitelist={file1.txt,file2.txt,file3.txt}}
\end{verbatim}

\section{Visual marker}

You might want to use the PDF viewer to check for incorrectly hyphenated words. To enable visual feedback, just pass the \texttt{mark} option to the \cmd{usepackage} or to the \cmd{LuaCheckHyphen} command:

\begin{verbatim}
\usepackage[mark]{lua-check-hyphen}
% or:
\LuaCheckHyphen{mark}
\end{verbatim}

This marks all non-whitelisted used hyphenation points in the document with a black square (not to be confused with overfull boxes):

\includegraphics{sample-crop}

\section{Options to \cmd{LuaCheckHyphen}}

For the true/false options you don't need to write the \texttt{=true} part. All options except for the \texttt{whitelist} can be passed directly to the package:

\begin{verbatim}
\usepackage[mark,nofile]{lua-check-hyphen}
\end{verbatim}

\noindent All options can be set in \cmd{LuaCheckHyphen}.

\begin{verbatim}
\LuaCheckHyphen{mark,nofile,whitelist=myfile.txt}
\end{verbatim}


\begin{optionlist}
  \boolitem[true]{compact}{Words with different hyphenation occurrences are listed only once.}
  \boolitem[false]{mark}{Create visual markers when an unknown hyphenation encountered.}
  \boolitem[false]{nofile}{Don't write to an external file (\texttt{.uhy}).}
  \boolitem[false]{file}{Don't do anything. This is for the last document run, no marks will be generated.}
  \valitem{whitelist}{files}{List of files, separated by \enquote{\texttt{,}}. You need to wrap the filenames in braces \texttt{\textbraceleft...\textbraceright} so that the comma won't be seen as a option separator.}
\end{optionlist}

\section{Final document}

When you pass the Option \opt{final} to the \cmd{documentclass}, the \cmd{usepackage} or the \cmd{LuaCheckHyphen} command, all processing is disabled.

\section{Changes}
\begin{changelog}
\begin{release}{0.6}{2018-02-07}
  \item Remove dependencies and update package to a modern LuaTeX. Thanks to Christian Stadelmann.
\end{release}
\begin{release}{0.5}{2017-07-31}
  \item Fix error where I can't find a whitelist file, but the io.open() call does not return an error message.
\end{release}
\begin{release}{0.4}{2016-04-01}
  \item Compact representation of hyphenated words that occur more than once with different hyphenation positions (option copmact=true).
  \item Sort uhy entries alphabetically and only use lowercase words in the file.
\end{release}
 \begin{release}{0.2}{2012-06-22}
  \item Fix ligature counting error (github issue \#1)
  \item Add nofile option
  \item No hyphenation list in the terminal output (log only)
  \item License details added
 \end{release}
\end{changelog}

\section{Bugs}

\begin{itemize}
  \item Paragraphs that end with \verb+\end{document}+ are ignored. Inserting an empty line or
        \cmd{par} helps.
\end{itemize}

\section{License}

This file (documentation and the package) is released under the terms of the MIT License. See the file \texttt{mit-license.txt} in the distribution.

% Copyright (c) 2012 Patrick Gundlach

% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the \enquote{Software}), to deal
% in the Software without restriction, including without limitation the rights
% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
% copies of the Software, and to permit persons to whom the Software is
% furnished to do so, subject to the following conditions:

% The above copyright notice and this permission notice shall be included in all
% copies or substantial portions of the Software.

% THE SOFTWARE IS PROVIDED \enquote{AS IS}, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
% SOFTWARE.

\end{document}