[Tex/LaTex] How to change hyphenation language without Babel

babelhyphenation

I would like to change hyphenation pattern in pdlatex without using babel, because babel kills my document class in my language (hungarian). Unfortunately I cannot find a way to change the pattern even using the hint in hyph-utf8 package:

\language=\l@hu

but this one says that 'Missing number, treated as zero'. The other one does not work either:

\hyphenrules{langname}

and tells me the 'Missing number…' message again (I think the latter macro uses \l@hu).

Best Answer

The symbolic name for the language is \l@hungarian; but to be certain you need to look at the file language.dat that has, on a typical TeX Live distribution, the path

/usr/local/texlive/2012/texmf/tex/generic/config/language.dat

although the one which is really used is

/usr/local/texlive/2012/texmf-var/tex/generic/config/language.dat

(usually, if there are no site specific changes, they are identical). The relevant line are

% from hyphen-hungarian:
hungarian loadhyph-hu.tex

that tell LaTeX to define a \l@hungarian set of hyphenation patterns by looking at the file loadhyph-hu.tex.

There are a couple of ways to cope with the problem:

\RequirePackage[english=hungarian]{hyphsubst}
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\begin{document}

This, however, will make it impossible to use English in the document (with correct hyphenation patterns). You can also do

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\begin{document}
\hyphenrules{hungarian}

and, for the possible parts in English, use the otherlanguage environment.

In both cases you'll have to redefine the fixed tags, which you easily find in the hungarian.ldf file.

Related Question