<< | Page list | >>
How to set up LyX for Japanese
1. Setup TeX environment and tune up LyX
- Install LyX for Windows. If you intend to use pTeX only, you don't have to install MikTeX during the installation process. Otherwise, make sure to set paths correctly so that pTeX which will be installed in the next step does not conflict with MikTeX.
- Install pTeX (Japanese-specific LaTeX-programs) from this page:
Download all packages from there to a folder on your computer that doesn't have spaces in its path, e.g. to "C:\pTeX".
- Extract the package file texinst756.zip to the folder C:\pTeX
- Open a console, change to the folder C:\pTeX and execute the command
- Download dviout (DVI viewer that can handle Japanese characters) from CTAN and install
- After finishing installation, start
dviout and open menu Option -> Setup Parameters...
- In the Font tab, set TEXROOT, TEXPK and TEXFONTS variables appropriately. Pushing "Guess" button may help.
- In the Font2 tab, set gen: appropriately. Pushing "gen:" button does automatic search for you.
- In the WinJFont tab, choose appropriate Japanese font for "Windows Font". Normally "MS Mincho" (font name may be shown in Japanese name) is used.
- Add ghostscript fonts:
If you use Japanese variant of ghostscript, you may need to add URW fonts with Cyrill characters. In such a case, please download one of the following files and expand it in the
ghostscript folder (e.g. if it is
C:\gs\gs8.63, each font file should go in
- http://www.int.otaru-uc.ac.jp/lyx-howto/install/gs-urw-fonts-1.0.7pre22.zip(approve sites)
- http://www.int.otaru-uc.ac.jp/lyx-howto/install/gs-urw-fonts-1.0.7pre22.lzh(approve sites)
- Make dvips kanji-aware which comes with pTeX:
C:\tex\texmf\fonts\map\dvips\base\kanji.map (which may not exist by default) to contain the following lines:
- From command line, execute
updmap -add kanji.map and
- Install the LaTeX-package "japanese":
- Download it from here
- Extract the zip file to C:\pTeX\share\texmf\tex\latex\japanese
- Open a console, change to the directory C:\pTeX\share\texmf\tex\latex\japanese and execute the command
- Change in the console to the folder C:\pTeX\bin and execute the command
- (Only for LyX-1.5.x) Install Japanese layout files:
Download following Japanese layout files to C:\Program Files\LyX15\Resources\layouts
- (Only for LyX-1.5.x) Open C:\Program Files\LyX15\Resources\languages file with an editor and find a line beginning with "japanese" and edit as follows:
japanese "" "Japanese" false shift-jis-plain ja_JP ""
Note: The return code of the file is not for Windows, so lines may look mixed depending on the editor you choose (e.g.
- (Only for LyX-1.5.x) Open C:\Program Files\LyX15\Resources\encodings file with an editor and add the following lines
# Japanese TeX programs require neither CJK nor inputenc package
Encoding euc-jp-plain EUC-JP-pLaTeX EUC-JP variable none
Encoding jis-plain JIS-pLaTeX ISO-2022-JP variable none
Encoding shift-jis-plain SJIS-pLaTeX CP932 variable none
2. Modify LyX settings
After starting LyX, modify the settings as follows.
- (Only for LyX-1.5.x) Open the menu Tool -> Preferences -> Converters
- Remove the converter definition "LaTeX (plain) -> DraftDVI"
- Add a converter definition "LaTeX (plain) -> DVI" with the converter
- Push "Apply" button
- Open the menu Tool -> Preferences -> Converters
- Select the converter definition "DVI -> Postscript"
- Modify the converter definition from
dvips -o $$o $$i to
dvips -Ppdf -z -o $$o $$i.
- Push "Modify" button
- Push "Apply" button
- Open the menu Tool -> Preferences -> File formats
- Choose "DVI" from the "File formats" pane
- Modify "Viewer:" to the path of
C:\usr\dviout\dviout if it is in the folder
- Push "Apply" button
- Open the menu Tool -> Preferences -> Language setting -> Language
- Change the "Default language:" to "Japanese"
- Push "Save" button
- You need for all steps of the Windows installation administrator privileges.
- There is currently no Japanese spellchecker dictionary available.
- pdflatex cannot be used with Japanese language. Use dvipdfm or ps2pdf.
- Install LyX for Mac as explained on this Wiki page.
- Install the pTeX-package for MacOS as explained here.
- Follow the steps from 3. to 6. from the Windows installation routine (Use the platex path of your system and not C:\pTeX\bin)
Japanese / Windows / Mac