How to read and write in Japanese/ja

このガイドでは、非日本語環境でどのように日本語を読み書きするか説明します. このガイドは、個人的な知識もしくは経験を元に自由に編集できます. (訳注：自由に編集できるのは翻訳元である英語のガイドです)

要件
日本語および日本の文字をサポートするために、いくつかのツール、ライブラリ、およびそれらをインストールするための知識が必要です.

日本語フォント
大部分の非日本語環境は日本語フォントをインストールしていません. 単にユーザーがキーボードから日本語のキャラクターを入力しようとした時でさえ、画面上の文字が出るはずであろう場所に小さい長方形しか見ることができません.

入力メソッド
日本語で読み書きするために最初にしなければならないことは、キーボードで日本語の文字を入力することです. これは"入力メソッド"と呼ばれるソフトを通して行われます. 今のところ、日本語については２つの標準的な方法があります. "anthy"と"mozc"です.

それらソフトウェアで"ta"とタイプすると、ワードプロセッサーにひらがなのたが入力されます. 入力メソッドの動作に関連したいくつかの単純な操作で、ひらがなのたをカタカナのタに簡単に変換できます.

同様に、"nihon"はにほんを入力することになり、別の単純な操作でさらに漢字である日本に変換できます.

IME
On top of this users also need a way to switch from the input method normally used for the primary language to the one needed for the Japanese language. This functionality is provided by another piece of software called an IME (Input Method Editor) such as, or.

Once installed, this allows users to switch from one language's input method to the Japanese input method using a key combination or using the mouse to select a relevant icon in the icon tray.

日本語フォント
As a minimum, install the package.

Additionally, the following packages are also available:

Input tools
It is recommended to use ibus to scim.

To install ibus, install :

mozc
mozc is provided through the package.

Launching the ibus daemon at login time
Add these lines to the file and log out/log in again.

This will allow the ibus daemon to start at login time.

Configuring
To configure the Input Method Editor, use the following command as a standard user

Alternatively, when using GNOME, type "ibus" in the search bar and launch "ibus-preferences".

In the dialog box that appears, click on the tab and add the "japanese-anthy" method. Then return to the tab and define a key combination as a keyboard short cut for switching the input method.

Latex
Here are some additional requirements to write Latex files in Japanese.

ibus-qt
When using editor aiming at writing Latex files such as TexMaker or TexStudio, ibus crashes each time a Latex command is entered (specially after entering the {{Key|{}} char. To solve this kind of malfunctioning install :

CJK and xetex support
In order to write Japanese chunks in Latex files, add support for CJK languages and for [xetex] in Texlive.

This can be accomplished by adding or modifying the following lines in :

Then reinstall the packages:

Here is a working short LaTeX sample:

Editor configuration
To compile and visualize the output of the sample above Texmaker or Texstudio editor needs to be configured properly.

Open Texmaker, and go to ->. Under the tab change the following:


 * At the LaTeX line, change "latex" with "platex".
 * At the Dvipdfm line, change "divipdfm" with "dvipdfmx".

Through the tab, choose "Latex + Dvipdfm + View PDF".

Finally go to the tab, choose UTF8 encoding and deselect  on the dictionary line.