auctex: Japanese
5.4.2 Using AUCTeX with Japanese TeX
------------------------------------
To write Japanese text with AUCTeX, you need the versions of TeX and
Emacs that support Japanese. AUCTeX supports three Japanese TeX engines
by default: NTT jTeX, ASCII pTeX and upTeX.
To use the Japanese TeX engines, activate 'japanese-plain-tex-mode'
or 'japanese-latex-mode'. If it doesn't work, send mail to Masayuki
Ataka '<masayuki.ataka@gmail.com>' or Ikumi Keita
'<ikumikeita@jcom.home.ne.jp>', who currently concern with stuff related
to Japanese in AUCTeX. None of the primary AUCTeX maintainers
understand Japanese, so they cannot help you.
It is recommended to enable 'TeX-parse-self' for typical Japanese
LaTeX users. When enabled, 'japanese-latex-mode' selects the suitable
Japanese TeX engine automatically based on the class file name (such as
'jbook', 'jsarticle' and 'tjreport') and its option. Parsing
Files.
It is important to select the suitable Japanese TeX engine because
the selected engine determines the command name such as 'platex' and
'uptex' to typeset the document. If you find that wrong command is
used, check the value of 'TeX-engine' on that buffer. If the value does
not suit the current document, change the value by the 'TeXing Options'
submenu below the 'Command' menu. Processor Options.
To make the selected engine to persist across Emacs sessions, there
are two ways from which you can choose one according to your needs:
1. If you use a specific engine (almost) exclusively, customize the
option 'japanese-TeX-engine-default'.
-- User Option: japanese-TeX-engine-default
The default TeX engine in Japanese TeX mode.
The default value is 'ptex'.
2. If you want to set the engine on a per file basis, use the file
local variables to set 'TeX-engine'.
Here is a sample code to set 'TeX-engine' to 'uptex':
%%% Local Variables:
%%% mode: japanese-latex
%%% TeX-engine: uptex
%%% End:
In the both cases above, the valid value is one of 'ptex', 'jtex' and
'uptex'.
You can override the command names associated with the above three
engines or define your own engine by customizing 'TeX-engine-alist'.
Processor Options.
It is sometimes necessary to use an engine which differs from the one
AUCTeX selects automatically. For example, even when you want to use
'j-article' document class deliberately with ASCII pLaTeX, AUCTeX
selects NTT jLaTeX command if 'TeX-parse-self' is enabled, because
'j-article' originally belongs to NTT jLaTeX. In such cases, use the
file local variable method above to select the engine you intend to use.
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 cannot 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-LaTeX-default-style
The default style/class when creating a new Japanese LaTeX
document.
The default value is '"jarticle"'.
It is recommended also for Japanese users to customize the option
'TeX-PDF-from-DVI' to '"Dvipdfmx"'. Processor Options
There are three customize options with regard to the encoding of
Japanese text.
-- User Option: japanese-TeX-use-kanji-opt-flag
If non-nil, AUCTeX adds '-kanji' option to the typesetting command
when 'TeX-engine' is 'ptex'.
Usually AUCTeX guesses the right coding systems for input to and
output from the Japanese TeX process, but you can override them by the
following two customize options.
-- User Option: TeX-japanese-process-input-coding-system
If non-nil, used for encoding input to Japanese TeX process. When
'nil', AUCTeX tries to choose suitable coding system.
-- User Option: TeX-japanese-process-output-coding-system
If non-nil, used for decoding output from Japanese TeX process.
When 'nil', AUCTeX tries to choose suitable coding system.
The former customize options 'japanese-TeX-command-default' and
'japanese-LaTeX-command-default' are obsolete. Use
'japanese-TeX-engine-default' instead. If you need to customize the
executable file name such as '"latex"', the options for them, or both,
customize 'TeX-engine-alist'.
Also, the option 'japanese-TeX-command-list' is considered as
semi-obsolete. It still functions as before, but in theory, it is not
required anymore in normal use.
The following two additional font commands are available in LaTeX
mode buffer.
'C-c C-f g'
Insert gothic face font command '\textbf{-!-}' or '\mathbf{-!-}'
depending on the context.
'C-c C-f m'
Insert mincho font command '\textmc{-!-}' or '\mathmc{-!-}'
depending on the context.
Although they are meaningful only with 'ptex' and 'uptex' engines, it
won't matter in buffers with other engines.
See 'tex-jp.el' for more information.