[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.4 Language Support

TeX and Emacs are usable for European (Latin, Cyrillic, Greek) based languages. Some LaTeX and EmacsLisp packages are available for easy typesetting and editing documents in European languages.

For CJK (Chinese, Japanese, and Korean) languages, Emacs or XEmacs with MULE (MULtilingual Enhancement to GNU Emacs) support is required. MULE is part of Emacs by default since Emacs 20. XEmacs has to be configured with the ‘--with-mule’ option. Special versions of TeX are needed for CJK languages: CTeX and ChinaTeX for Chinese, ASCII pTeX and NTT jTeX for Japanese, HLaTeX and kTeX for Korean. The CJK-LaTeX package is required for supporting multiple CJK scripts within a single document.

Note that Unicode is not fully supported in Emacs 21 and XEmacs 21. CJK characters are not usable. Please use the MULE-UCS EmacsLisp package or Emacs 22 (not released yet) if you need CJK.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.4.1 Using AUCTeX with European Languages


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.4.1.1 Typing and Displaying Non-ASCII Characters

First you will need a way to write non-ASCII characters. You can either use macros, or teach TeX about the ISO character sets. I prefer the latter, it has the advantage that the usual standard emacs word movement and case change commands will work.

With LaTeX2e, just add ‘\usepackage[latin1]{inputenc}’. Other languages than Western European ones will probably have other encoding needs.

To be able to display non-ASCII characters you will need an appropriate font and a version of GNU Emacs capable of displaying 8-bit characters (e.g. Emacs 21). The manner in which this is supported differs between Emacsen, so you need to take a look at your respective documentation.

A compromise is to use an European character set when editing the file, and convert to TeX macros when reading and writing the files.

iso-cvt.el

Much like ‘iso-tex.el’ but is bundled with Emacs 19.23 and later.

x-compose.el

Similar package bundled with new versions of XEmacs.

X-Symbol

a much more complete package for both Emacs and XEmacs that can also handle a lot of mathematical characters and input methods.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.4.1.2 Style Files for Different Languages

AUCTeX supports style files for several languages. Each style file may modify AUCTeX to better support the language, and will run a language specific hook that will allow you to for example change ispell dictionary, or run code to change the keyboard remapping. The following will for example choose a Danish dictionary for documents including ‘\usepackage[danish]{babel}’. This requires parsing to be enabled, see section Automatic Parsing of TeX Files.

 
(add-hook 'TeX-language-dk-hook
	  (lambda () (ispell-change-dictionary "danish")))

The following style files are recognized:

bulgarian

Runs style hook TeX-language-bg-hook. Gives ‘"’ word syntax, makes the <"> key insert a literal ‘"’. Typing <"> twice will insert insert ‘"`’ or ‘"'’ depending on context. Typing <-> twice will insert ‘"=’, three times ‘--’.

czech

Runs style hook TeX-language-cz-hook. Pressing <"> will insert ‘\uv{’ and ‘}’ depending on context.

danish

Runs style hook TeX-language-dk-hook. Pressing <"> will insert ‘"`’ and ‘"'’ depending on context. Typing <-> twice will insert ‘"=’, i.e. a hyphen string allowing hyphenation in the composing words.

dutch

Runs style hook TeX-language-nl-hook.

german
ngerman

Runs style hook TeX-language-de-hook. Gives ‘"’ word syntax, makes the <"> key insert a literal ‘"’. Pressing the key twice will give you opening or closing German quotes (‘"`’ or ‘"'’). Typing <-> twice will insert ‘"=’, three times ‘--’.

frenchb
francais

Runs style hook TeX-language-fr-hook. Pressing <"> will insert ‘\\og’ and ‘\\fg’ depending on context. Note that the language name for customizing TeX-quote-language-alist is ‘french’.

icelandic

Runs style hook TeX-language-is-hook. Gives ‘"’ word syntax, makes the <"> key insert a literal ‘"’. Typing <"> twice will insert insert ‘"`’ or ‘"'’ depending on context. Typing <-> twice will insert ‘"=’, three times ‘--’.

italian

Runs style hook TeX-language-it-hook. Pressing <"> will insert ‘"<’ and ‘">’ depending on context.

polish

Runs style hook TeX-language-pl-hook. Gives ‘"’ word syntax and makes the <"> key insert a literal ‘"’. Pressing <"> twice will insert ‘"`’ or ‘"'’ depending on context.

polski

Runs style hook TeX-language-pl-hook. Makes the <"> key insert a literal ‘"’. Pressing <"> twice will insert ‘,,’ or ‘''’ depending on context.

slovak

Runs style hook TeX-language-sk-hook. Pressing <"> will insert ‘\uv{’ and ‘}’ depending on context.

swedish

Runs style hook TeX-language-sv-hook. Pressing <"> will insert ‘''’. Typing <-> twice will insert ‘"=’, three times ‘--’.

Replacement of language-specific hyphen strings like ‘"=’ with dashes does not require to type <-> three times in a row. You can put point after the hypen string anytime and trigger the replacement by typing <->.

In case you are not satisfied with the suggested behavior of quote and hyphen insertion you can change it by customizing the variables TeX-quote-language-alist and LaTeX-babel-hyphen-language-alist respectively.

User Option: TeX-quote-language-alist

Used for overriding the default language-specific quote insertion behavior. This is an alist where each element is a list consisting of four items. The first item is the name of the language in concern as a string. See the list of supported languages above. The second item is the opening quotation mark. The third item is the closing quotation mark. Opening and closing quotation marks can be specified directly as strings or as functions returning a string. The fourth item is a boolean controlling quote insertion. It should be non-nil if if the special quotes should only be used after inserting a literal ‘"’ character first, i.e. on second key press.

User Option: LaTeX-babel-hyphen-language-alist

Used for overriding the behavior of hyphen insertion for specific languages. Every element in this alist is a list of three items. The first item should specify the affected language as a string. The second item denotes the hyphen string to be used as a string. The third item, a boolean, controls the behavior of hyphen insertion and should be non-nil if the special hyphen should be inserted after inserting a literal ‘-’ character, i.e. on second key press.

The defaults of hyphen insertion are defined by the variables LaTeX-babel-hyphen and LaTeX-babel-hyphen-after-hyphen respectively.

User Option: LaTeX-babel-hyphen

String to be used when typing <->. This usually is a hyphen alternative or hyphenation aid provided by ‘babel’ and the related language style files, like ‘"=’, ‘"~’ or ‘"-’.

Set it to an empty string or nil in order to disable language-specific hyphen insertion.

User Option: LaTeX-babel-hyphen-after-hyphen

Control insertion of hyphen strings. If non-nil insert normal hyphen on first key press and swap it with the language-specific hyphen string specified in the variable LaTeX-babel-hyphen on second key press. If nil do it the other way round.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.4.2 Using AUCTeX with Japanese TeX

To write Japanese text with AUCTeX, you need to have versions of TeX and Emacs that support Japanese. There exist at least two variants of TeX for Japanese text (NTT jTeX and ASCII pTeX). AUCTeX can be used with MULE (MULtilingual Enhancement to GNU Emacs) supported Emacsen.

To use the Japanese TeX variants, simply activate japanese-plain-tex-mode or japanese-latex-mode and everything should work. If not, send mail to Masayuki Ataka ‘<ataka@milk.freemail.ne.jp>’, who kindly donated the code for supporting Japanese in AUCTeX. None of the primary AUCTeX maintainers understand Japanese, so they cannot help you.

If you usually use AUCTeX in Japanese, setting the following variables is useful.

User Option: TeX-default-mode

Mode to enter for a new file when it cannott be determined whether the file is plain TeX or LaTeX or what.

If you want to enter Japanese LaTeX mode whenever this may happen, set the variable like this:

 
(setq TeX-default-mode 'japanese-latex-mode)
User Option: japanese-TeX-command-default

The default command for TeX-command in Japanese TeX mode.

The default value is ‘"pTeX"’.

User Option: japanese-LaTeX-command-default

The default command for TeX-command in Japanese LaTeX mode.

The default value is ‘"LaTeX"’.

User Option: japanese-LaTeX-default-style

The default style/class when creating a new Japanese LaTeX document.

The default value is ‘"jarticle"’.

See ‘tex-jp.el’ for more information.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated on October 16, 2018 using texi2html 1.82.