Chapter 12. Document Encoding

Table of Contents

The ucs Package
CJK Support
CJK Troubleshooting
How do I input CJK in Unicode?

The Kile editor allows you to read, convert and set the text to the encoding your document needs. This allows you to use non-standard letters and symbols; you can use, for example, accented characters for Italian or French. Selecting the encoding for your document can be done in three ways:

LATEX itself understands only ASCII, a very limited set of characters, so you could not use accented or special letters directly. To use accented letters, a special syntax was created: such as for example \"e for ë. There is a package to help you with this, called inputenc, and is included in the preamble using \usepackage[latin1]{inputenc}, where the optional argument is the encoding you would like to use (nowadays in most cases utf8x). This tells LATEX to translate all of the ë's you wrote to \"e's before compiling. Please refer to the inputenc documents directly for more information on inputenc. Last but not least: remember to make sure that your file is actually encoded in the same encoding you told inputenc!

Choosing the source file's encoding

Choosing the source file's encoding

This host of different character coding tables has been creating problems on many applications: for example, you cannot write a course of Turkish in French without losing one language's special characters. There is general agreement that, sooner or later, everybody will switch to Unicode. There are many implementations of Unicode, and UTF-8 is the most successful in Linux; Windows(R) relies instead on the more cumbersome and less flexible UCS-2. Some distributions, as RedHat, have already begun setting their default encoding to UTF-8, and therefore you may be very interested in using of the utf8x argument to the inputenc package.

The ucs Package

If you don't have the ucs package installed, you can proceed as follows:

  • Get the ucs package from the home page of Unicode support for LATEX, by Dominique Unruh from the University of Karlsruhe.

  • To install it, unpack the downloaded file and place it in a directory listed in your $TEXINPUTS envirnoment variable. This can also be set inside kile.