# Inputting a separate hyphenation file

\documentclass{article}
\usepackage[english]{babel}
\usepackage{filecontents}

\begin{filecontents*}{english.yp}
hom-ony-mous
gene-ral-ly
\end{filecontents*}{english.yp}

\hyphenation{
\input english.yp
}

\begin{document}
spinach.
\end{document}


This does not compile, (but does if I move \hyphenation{ and } in the first and last lines of the file.) Why not?

The LaTeX implementation of \input is not expandable in order to allow a test for braces. However, \hyphenation requires an argument which fully expands to text. You therefore have to use the underlying primitive

\documentclass{article}
\usepackage[english]{babel}
\usepackage{filecontents}

\begin{filecontents*}{english.yp}
hom-ony-mous
gene-ral-ly
\end{filecontents*}
\makeatletter
\hyphenation{
\@@input english.yp
}
\makeatother
\begin{document}
spinach.
\end{document}

• Thanks! But this example turned out to be too minimal. Posting another. – Toothrot Apr 1 '16 at 12:02