# increase \hyphenation{word1 word-2...} capacity

We use LaTeX to typeset a large collection of books with many proper names. We use the \hyphenation{word1 word-2...} command to specify words that should not be hyphenated and to suggest hyphenation points for other words.

Our problem is we have way too many words.

How can we increase the capacity of \hyphenation{...} in, say, TeXLive or MiKTeX? (We are now stuck in a powerful but unsupported VTeX 8.42, but may switch to a standard distribution.)

• Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Jul 31 '13 at 18:30
• \hyphenation is actually a TeX (not a LaTeX) commmand, so the tex-core tag is more appropriate. Jul 31 '13 at 18:33
• I think, there would be problem with compiling such file (tex would will search every word in a large list before deciding to hyphenate it). The better solution will be a slight preprocessor that will build a list for command \hyphenation{} for given file from a large database. Jul 31 '13 at 19:01
• if there is any consistency or commonality to the names, it might be possible to develop patterns for groups of them, to augment the existing patterns. an augmented set of patterns for english was created by gerard kuiken and published in tugobat; a later version (2005) is available from ctan as ushyphmax.tex. these incorporated patterns that covered place names ending in "-chester", for example. Jul 31 '13 at 19:55

With TeX Live you can add the line

hyph_size = 32749


to /usr/local/texlive/2013/texmf.cnf.

The value must be a prime number less than 32767, and 32749 is the maximum possible, see http://primes.utm.edu/lists/small/10000.txt

With MiKTeX it should be similar.

• Is hyph_size the number of words, or number of characters, allowed in \hyphenate{}? Jul 31 '13 at 21:17
• I searched miktex and found [docs.miktex.org/manual/texdefaults.html] says: ;; Space for hyphenation patterns. trie_size=700000 ;; Prime number of hyphenation exceptions. hyph_size=8191 In MikTeX, what is trie_size and is there a TeXLive equivalent? Jul 31 '13 at 21:19
• Why not take the work from TeX and give it to a (e.g.) Python script to replace word with wo\-rd or \hbox{word} before TeX'ing; or use @Eddy_Em's good idea and generate a custom \hyphenate{} each time? Jul 31 '13 at 21:21
• @user2620830 trie_size is for hyphenation patterns, not for hyphenation exceptions. The value used by TeX Live 2013 is trie_size = 1000000, which is sufficient for the 78 languages currently loaded. For hyph_size, what can I say is that filling the memory would be adding hyphenation exceptions for all words in a rather big book. Jul 31 '13 at 22:02

Consider using Luatex. Luatex has a completely different algorithm for hyphenation (although it uses traditional patgen files for representing hyphenation dictionaries) and has no limit on the number of patterns stored.

See section 6.4 of the Luatex reference manual for details of the differences between Luatex and mainstream Tex with respect to hyphenation.

• the link is broken Apr 24 '19 at 8:18