TeXnik - Tips TeX and LaTeX


Welcome to the TeXnik website (under construction)

Hyphenation
TUG logo

Main page

Index
UK FAQ
Documentation
Software
CTAN
Search CTAN:

Statistics

Google c.t.t.

Google d.c.t.t.

 


 


Hyphenation and Raggedright |  Package hyphenat (on/off switch) |  problems |  Raggedright and Hyphenation |  Slides |  sloppy |  Typewriterfont |  userdefined hyphenation |  wrong hyphenation | 


Examples
  • 3,5''-Diskette with ngerman.sty insert it as 3,5''"~Diskette

  • Slides
    Slides have by default no hyphenation, because it is very inappropriate.


    Raggedright and Hyphenation
    By default you get a text without any hyphenation when you choose the option \raggedright in your text. To get hyphenations too, write in preamble:
    \makeatletter
    \def\raggedright{%
         \rightskip=0pt plus 10mm
         \@rightskip=\rightskip}
    %\lefthyphenmin4\righthyphenmin4%
    \makeatother
    The last commands are only useful when you do not want to have hyphenations like hy-phenation. Instead of the above solution you can try package ragged2e, too.
    Typewriter font
    Text in typewriterfont can also be hyphend whit package hyphenat:
    \usepackage[htt]{hyphenat}
    This package is available at CTAN..


    sloppy
    With the command \sloppy you get a better formatting and less hyphenation problems. The following command sequence does this better than \sloppy. Put it in LaTeX preamble:
      \tolerance 1414
      \hbadness 1414
      \emergencystretch 1.5em
      \hfuzz 0.3pt
      \widowpenalty=10000
      \vfuzz \hfuzz
      \raggedbottom

    Problems with hyphenation
    Put the following commands in LaTeX preamble, if you have some lines which went out of the right margin:
    \tolerance=200
    \setlength{\emergencystretch}{2em}


    Userdefined hyphenation
    Always when the tex-hyphenation gives bad results you can force hyphenation in different ways. For example we have the word internationalisation with the possible hyphenations in-ter-na-tio-na-li-sa-tion
    1. in latex preamble write \hyphenation{in-ter-na-tio-na-li-sa-tion}
    2. in the text write in\-ter\-na \-tio\-na\-li \-sa\-tion


    Wrong hyphenation

    At first control, if latex supports hyphenation in your specific language. Have a look at Menu View->Latex LogFile

    This is TeX, Version 3.14159 (Web2C 7.3.1) (format=latex 2000.12.27)  27 DEC 2000 21:09
    **test.tex
    (test.tex
    LaTeX2e <1999/12/01> patch level 1
    Babel  and hyphenation patterns for american, british, french, german, n
    german, nohyphenation, loaded.
    It's the beginning of the logfile of the latex-run. In this configuration hyphenation is only supported for the languages american, british, french, german, n(ew)german hypehnrules.

    There is for example no support for spanish or norwegian. Follow these steps:

    1. Become root and run texconfig
    2. Go in the hyphenation->latex menu
    3. Texconfig lets you edit a configuration file
      The following steps belong to your local installation. In my system the standard editor is joe, other prefer vi. Anyway, look for a line which lists your language, e.g. spanish. uncomment the line by deleting the "%". With vi put the cursor under the character and type x once.
    4. Save and exit from the editor (Ctrl-K-x with joe or escape-:-x with vi)
    5. Exit from texconfig.

    Another latex-run shows that spanish is now a supported language for hyphenation:
    This is TeX, Version 3.14159 (Web2C 7.3.1) (format=latex 2000.12.27)  27 DEC 2000 22:57
    **Versuch.tex
    (Versuch.tex
    LaTeX2e <1999/12/01> patch level 1
    Babel  and hyphenation patterns for american, british, french, german, n
    german, spanish, nohyphenation, loaded.
    

    local time: Fri Apr 26 17:24:07 CEST 2024 ; file is: 1764.07778935185 days old
    contact webmaster _at_ TeXnik.de