How to read and write in Japanese/zh-cn

本指南将会告诉你如何在非日语系统上读写日语. 你可以根据自己的经验来对下述步骤进行修改.

需求
为了能支持日语和日语符号，我们需要安装或启用一些工具、库和功能.

日语字体
大多数非日语系统上都没有安装日语字体. 在这时如果试图输入日语，你将只能在屏幕上看到一个个小方块.

输入法
首先我们要实现能通过键盘输入日语文字和符号. 我们使用一种被叫做“输入法”的程序来实现这个目标. 我们有两种常见的日语输入法：anthy 和 mozc.

使用输入法可以在我们在键盘上敲下 ta 时输入日语假名 た. 同时通过一些简单的操作可以从平假名 た 切换到片假名 タ.

同时我们敲下 “nihou” 时将会输入 にほん，我们也可以很容易得切换到日语汉字版的词语，日本.

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.

Japanese fonts
As a minimum, install the package.

Additionally, the following packages are also available:

Input tools
It is recommended to use ibus instead of scim.

To install ibus, install :

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.