2

I can't really make a minimal working example who shows the problem, because the problem just are there sometimes. But here is the code used:

\documentclass[twocolumn, a4, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}

\begin{document}
\end{document}

Sometimes the hyphenation splits the word incorrectly in the danish version. Like "marmo-rgade" or "kal-ksten". That is one problem. The other problem is that it sometimes don't split the word at all, so the word sometimes reaches into another column (and lay over another word).

I thought danish babel should solve this problem? Am I the only one with this problem and do anyone know how to solve it? I've solved it earlier by chaging the sentence - but always to do that in a long document is too hard.

Thank you very much in advance. Kind regards!

Andrew Swann
  • 95,762
Amelie B. Blackstone
  • 1,502
  • 1
  • 13
  • 26
  • 2
    I get the hyphenation points mar-mor-ga-de and kal-k-sten (the second word seems indeed dubious, but I don't know Danish). You should also load \usepackage[T1]{fontenc} in order to hyphenate words containing accented letters such as ä. – egreg Oct 07 '15 at 20:42
  • 1
    after changing the input coding conventions as suggested by @egreg, you can check individual hyphenations by putting the words you want to check inside \showhyphens{...}; the report will be on your screen and in the log, but not typeset. if something really isn't hyphenating where it ought to, you can fix it in a \hyphenation{...} directive, or use a "discretionary hyphen", \-. – barbara beeton Oct 07 '15 at 20:51
  • The installed hyphenation patterns are a (rather) good first approximation. Even in English there are a number of exceptions/incorrect hyphenations performed by babel, see http://tex.stackexchange.com/q/22867/15925 – Andrew Swann Oct 10 '15 at 15:57
  • 1
    The Danish patterns used to have difficulties with some very frequent words (e.g. "h-vis") but these seem to be fixed today and generally the results are fine. Exeptions are most often compound words, like your "kal-k-sten" but this problem is inherent to pattern-based hyphenation rules and could afaik only be solved by using a wordlist for hyphenations. – Florian Oct 10 '15 at 18:42
  • @Florian but how do I use a wordlist with hyphenations? – Amelie B. Blackstone Oct 10 '15 at 22:30
  • 1
    That's not an option for TeX as far as I know. That was just a general remark on the limitations of the approach used by TeX. But as Barbara already suggested you could add exception rules whenever you notice wrong hyphenations and over the time collect a list. Personally I put all my hyphenation exceptions in one file and add them to my main file with input{hyph-dan.tex}. For US-English there is a neat precompiled list that can be called with \input{ushyphex.tex} but for other languages you are on your own. – Florian Oct 11 '15 at 10:14
  • Is there any news here? – Johannes_B Dec 25 '15 at 11:41

1 Answers1

2

With \usepackage[danish]{babel} I get the hyphenations

mar-mor-ga-de
kal-k-sten

It is recommended to also load fontenc with the T1 encoding.

If kal-ksten is wrong, you can fix it in the preamble:

\documentclass[twocolumn, a4paper, 12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}

\babelhyphenation[danish]{kalk-sten}

\begin{document}

\parbox{0pt}{% to get all possible hyphenation points
\hspace{0pt}%
marmorgade
kalksten
}

\end{document}

The \parbox is used to make TeX split words at every feasible point.

enter image description here

egreg
  • 1,121,712