Languages Other than English: Using Babel
[ LaTeX for Linguists, .dvi, .ps, .pdf]


  • The Problem
  • How to Do It
  • Examples
  • References

  • [PostScript, pdf, and DVI versions of this document are available, as is a sample source file that you can play with.]

    The Problem

    Suppose you have a document some parts of which are written in one language, and some parts in another, or others. For example, in an English document you might have extensive quotations in Greek, or whole sections written in German. Changing from one language to another might involve: It would be a pain to have to all this `by hand'.

    The solution is to use the `Babel' package.

    [Of course, the package also works where a whole document is being written in a language other than English, and you want to change the script, hyphenation patterns, date string, etc. But you probably know that anyway.]

    How to Do It

    In the preamble put the following (L1, L2, ..., Ln are the languages you need), Ln will be the default language:
            \usepackage[L1,L2,...,Ln]{babel}
    
    For example, this document is mainly English, but with bits of German, Greek, French, Italian, Welsh, and Greek:
    \usepackage[german,french,italian,welsh,greek,english]{babel}
    

    You change from one language to another using:

    \selectlanguage{L}
    
    For example, to switch to German, use:
    \selectlanguage{german}
    

    Examples

    The following shows the same input text in various language contexts. You will see that sometimes not much changes apart from the way the date is realized, and the names for chapters, and so on; sometimes the meaning of some of the input characters change (in German, "s is realized as ß, and "a produces ä) and sometimes (as in Greek) almost everything is different. Some different language packages provide special commands.

    These examples are just to give you a feeling for what is possible. They do not show anything like the full range of possibilities. For more information see, [GMS94] Ch9.

    The input text is in every case the following:

    ABCDEFGHIJKLMNOPQRSTUVWXYZ \\  % Upper case letters
    abcdefghijklmnopqrstuvwxyz\\   % lower case letters
    "a "s\\                        % a couple of special letters
    \figurename  \\                % name attached to figures
    \tablename   \\                % name attached to figures
    \chaptername \\                % name attached to tables
    \refname     \\                % name of the `References' section
    \today       \\                % today's date
    
    English
    \selectlanguage{english}
    ABCDEFGHIJKLMNOPQRSTUVWXYZ
    abcdefghijklmnopqrstuvwxyz
    "a "s
    Figure
    Table
    Chapter
    References
    September 25, 2007

    References

     [GMS94]
    Michel Goossens, Frank Mittelbach, and Alexander Samarin. The LaTeX Companion. Addison Wesley, new york edition, 1994.

    LaTeX for Linguists,
    Doug Arnold,
    doug@essex.ac.uk,
    September 25, 2007.