5

from Tex FAQ - hyphenation I see that trying to help Latex in correctly hyphenating words won't work when the utf8 encoding is used. Is there a work around?

6
  • Is 'Use LuaTeX or XeTeX' going to be an acceptable answer?
    – Joseph Wright
    Apr 27 '11 at 13:17
  • 2
    The web page you are quoting doesn't contain the word "utf8" and actually doesn't say anything about input encodings. Your claim is wrong. Apr 27 '11 at 13:19
  • @Ulrike: should I add \usepackage[T1]{fontenc} in my preambule together with \usepackage[utf8]{inputenc}?
    – pluton
    Apr 27 '11 at 13:40
  • @Joseph: I am still a pdflatex user but I may switch sometime in the future.
    – pluton
    Apr 27 '11 at 13:41
  • @pluton: Yes you need T1-encoding. Apr 27 '11 at 13:51
2

since it may be useful to someone, for specific languages with accents for instance, the \hyphenation command will correctly work only with a T1-encoding \usepackage[T1]{fontenc} but won't without.

7
  • @pluton: I don't think this is quite correct. The \hyphenation command will work when the font encoding corresponds to what is pre-supposed in the pattern file, and when the hyphenated word uses only accented letters available as single glyphs. Althougth I am not sure what I say is 100% correct, at least the following code shows that your restriction to T1 is not correct:
    – user4686
    Apr 27 '11 at 16:20
  • \documentclass{article} \usepackage[greek]{babel} \usepackage{gfsbodoni} \usepackage[LGRx,LGR]{fontenc} \hyphenation{\'ab-gd-\>ez} \def\somestuff{abgdez abgdez abgdez abgdez abgdez abgdez abgdez} \def\somestuffwithaccent{\'abgd\>ez \'abgd\>ez \'abgd\>ez \'abgd\>ez \'abgd\>ez \'abgd\>ez \'abgd\>ez} \begin{document} \parbox{2cm}{\somestuff}\hspace{1cm} \parbox{2cm}{\somestuffwithaccent} \end{document}
    – user4686
    Apr 27 '11 at 16:23
  • I should have said that my example uses lgrxenc.def available from milde.users.sourceforge.net/LGR furthermore, my latex format is not precompiled with the greek patterns, so babel complains in the log, and perhaps if I am extremely unlucky a more complete set-up would hyphenate by default abgdez like I arbitrarely declared for its version with the two accents.
    – user4686
    Apr 27 '11 at 16:27
  • all existing hyphenation pattern packages on ctan have been translated into utf-8, and xetex and luatex use those translated tables (note that in those processors, the font is unicode-based). inputenc/utf-8 input is translated to some font encoding (e.g., t1, or t2a) that deals with the characters, so hyphenation in this case is completely unaffected by the input coding. Apr 27 '11 at 16:43
  • 2
    @pluton: You need T1-encoding for your (french) words. The LGR-encoding mentioned by jfbu is for greek and not relevant for you. Apr 28 '11 at 8:15

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.