13

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}
doncherry
  • 54,637
srking
  • 1,125

1 Answers1

6

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.

Benedikt Bauer
  • 6,590
  • 2
  • 34
  • 60