<< | Page list | >>
How to set up LyX for Japanese
I. Windows
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
texinst756 C:\pTeX
- 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 C:\gs\gs8.63\fonts
):
- 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:
- Edit
C:\tex\texmf\fonts\map\dvips\base\kanji.map
(which may not exist by default) to contain the following lines:
% Japanese
rml Ryumin-Light--H
rmlv Ryumin-Light--V
gbm GothicBBB-Medium-H
gbmv GothicBBB-Medium-V
nrml Ryumin-Light-H
ngbm GothicBBB-Medium-H
% Morisawa
ryumin-l Ryumin-Light-H
ryumin-l-v Ryumin-Light-V
gtbbb-m GothicBBB-Medium-H
gtbbb-m-v GothicBBB-Medium-V
futomin-b FutoMinA101-Bold-H
futomin-b-v FutoMinA101-Bold-V
futogo-b FutoGoB101-Bold-H
futogo-b-v FutoGoB101-Bold-V
jun101-l Jun101-Light-H
jun101-l-v Jun101-Light-V
MJKanji KozMinStd-Bold-90pv-H
MJKanji-v KozMinStd-Bold-90pv-V
MJKata-h MojikumiKata-EB-90pv-H
MJKata-v MojikumiKata-EB-90pv-V
|
- From command line, execute
updmap -add kanji.map
and mktexlsr
.
- 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
platex japanese.ins
- Change in the console to the folder C:\pTeX\bin and execute the command
texhash
- (Only for LyX-1.5.x) Install Japanese layout files:
Download following Japanese layout files to C:\Program Files\LyX15\Resources\layouts
- jarticle.layout
- jreport.layout
- jbook.layout
- jsarticle.layout
- jsbook.layout
- (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. notepad
).
- (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
End
Encoding jis-plain JIS-pLaTeX ISO-2022-JP variable none
End
Encoding shift-jis-plain SJIS-pLaTeX CP932 variable none
End
|
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
platex $$i
- 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
dviout
, say C:\usr\dviout\dviout
if it is in the folder C:\usr\dviout\
- Push "Apply" button
- Open the menu Tool -> Preferences -> Language setting -> Language
- Change the "Default language:" to "Japanese"
- Push "Save" button
(Notes)
- 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.
II. Mac
- 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)
III. Categories
Japanese / Windows / Mac