# Warn of long words without a hyphenation pattern?

For unusual words, is there a quick way to check if I must specify my own hyphenation pattern?

In this example, the word 'cacheability' needs a custom pattern. I do not want to scan my document looking for the problem words jutting into the margin. Currently, I provide a hyphenation for every long word my editor flags for spell checking, but it's a pain.

I'd really like a package that warns me of long words without a hyphenation pattern.

\documentclass{book}
%\hyphenation{ cache-abil-ity }
\usepackage[english]{babel}
\begin{document}
cacheability cacheability cacheability cacheability cacheability cacheability cacheability cacheability cacheability cacheability cacheability cacheability cacheability cacheability cacheability cacheability.
\end{document}

-
The answer is very short: no. –  egreg Aug 24 '12 at 19:45
Maybe you can use the showhyphens package as a basis for finding long words without hyphenation points? See this answer or maybe this question. –  Stephan Lehmke Aug 25 '12 at 5:59
If I can load existing hyphenation patters into a lua table, is there a hook to let lua check each word as it goes by? Is this better as a distinct question on stackexchange? –  srking Aug 28 '12 at 22:19
You may also want to check the \hfuzz parameter to suppress warnings of really small distortions. –  masu Oct 24 '13 at 14:01

## 1 Answer

I don't think there is a package for it, but maybe I also don't really get your point.

If LaTeX cannot hyphenate some word, it will let you know with a bad Box warning. If you keep track of your errors, warnings and badboxes (you should do this at least once -- right before you have your document finished for printing), then you will see if there is some hyphenation pattern missing. By taking a look at the corresponding badbox message in the log you can also see, where exactly the problem lies, because it prints the last words of a line where the linebreaking algorithm was forced to break the line.

Try to compile the following MWE and look at the logfile:

\documentclass{article}
\begin{document}
This is some random text to show a word that cannot be hyphenated cacheability
\end{document}


It will give you the following badbox warning

Overfull \hbox (6.11166pt too wide) in paragraph at lines 4--5 []\OT1/cmr/m/n/10 This is some ran-dom text to show a word that can-not be hy-p hen-ated cacheabil- []

If this is not enough for you, you can also set the draft option to your documentclass which will draw a highly visible black bar at the end of every line where a overfull box appears.

The things described before only notify you when hyphenation is really needed and are no general automatism. But unfortunately I don't think there's an automatic way to remind you of every word that has no hyphenation pattern defined.

-