# How to create Japanese language documents under GNU/Linux using LaTeX

Mark Alford. Last updated: 2014-Feb-07.

For inputting Japanese characters in Linux, see Viewing and creating Japanese documents under GNU/Linux.
If you just want to create a Japanese text file, see How to create a Japanese text file using emacs.

These instructions work for the TeX Live TeX distribution. They were tested with TeX Live 2013 in Fedora 19. Earlier versions of this document gave instructions for TeX Live 2011 and TeX Live 2007.

## (1) Install TeX Live 2013

In Fedora 19, TeX Live is available as a set of rpm packages which can be installed using yum. For a manual install, see the instructions for TeX Live 2011.

## (2) Japanese typesetting using TeX

In TeX Live 2013 there are various ways to achieve this. For all of them you need to be able to create TeX (plain text) files containing Japanese text: see How to create a Japanese text file using emacs.

• Use xetex, which is LaTeX with Unicode support. To install it,
```yum install texlive-xetex texlive-euenc texlive-xetex-def vlgothic-fonts
```
(note that xetex needs euenc and xetex-def, but they are not automatically installed via dependencies). Here is an xetex example file, in which the main text is in English, using the DejaVu Serif font family, and Japanese text is selected using the \jap command, which switches to the VL Gothic font family. You can reverse this, setting Japanese to be the default, by \setmainfont{VL Gothic} and defining a command to switch to another font for English text (VL Gothic gives rather odd-looking English text). To see what Japanese fonts are available, fc-list :lang=ja. To process the example file,
``` xelatex xetex_japanese_2013
```
and it produces a PDF file.
• Use the CJK package.
``` yum install texlive-cjk texlive-cjkutils texlive-cjkutils-doc texlive-bxcjkjatype texlive-bxcjkjatype-doc
```
There are example files in /usr/share/texlive/texmf-dist/doc/latex/bxcjkjatype/.
• Use the ptex package. This is for documents that are primarily Japanese, including vertical writing. I have not tested it.

For more general information on Japanese and computing, see Jim Breen's Japanese page.