6

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).

  • 2
    Welcome to TeX.SX! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Henri Menke May 20 '13 at 10:20
3

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.

  • @Gergely This should work the same. Just check how the language is called; it should be hungarian as well. – egreg May 20 '13 at 12:07
  • Actually I use MiKTeX at the moment, and MiKTeX has the language.dat file under generic/babel but it does not mention hungarian language. Nevertheless I tried \language=\l@hungarian and it has solved the problem stated. The only thing I do not understand where the hungarian name comes from? – Gergely May 20 '13 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.