A flag icon shows that page is written in: English, Japanese

LATEX


pLATEX

The most popular pTeX that was developed by ASCII and has been used in a lot of universities and companies can be seemlessly installed into Unix. pTeX can produce more beautiful documents written in Japanese than any other TeX at this time of writing.

It is combined with TeTeX and introduced in the web by Haruhiko Okumura to probably become famous.

I learned his name in the university and he's been posting lots of articles in the Wiki and even written a book analyzing Japanese TeX: Haruhiko's page

I summarized what you have to do to get it installed in a versatile way as explained below. Can someone create a deb or rpm package that will automate this work?


Installation from the source

Download the latest version of ptetex (Japanese patches to various tools in the original) from:

ptetex

Also you will need tetex source version 3.0 archive:

tetex-src-3.0.tar.gz

and tetex texmf archive:

tetex-texmf-3.0po.tar.gz

Place all those three in a directory and extract the one beginning with 'p' and chdir right there:

$ tar zxvf ptetex3-20yymmdd.tar.gz
$ cd ptetex3-20yymmdd

You should edit the file "../my_option" to enable the below and make PREFIX point where you want it to create share/texmf directory:

JAPANESE=traditional
KANJI_CODE=UTF8
conf_option --with-xdvi-x-toolkit=motif
XDVI=echo
PXDVI=echo
PREFIX=/usr/local

Or you can run this Perl script ptetex_edopt.pl with any prefix given as the first argument.

$ ptetex_edopt.pl [dir_to_install]

In this command expression, [dir_to_install] should point to the place where you want to install the system with the above options turned on.

The file "../my_option" is written in shift JIS but you should see "KANJI_CODE=UTF8" without the pound sign in the beginning.

Become root if necessary and do:

# make
# make install

Never set TEXMF environment variable as the program automatically finds the texmf tree closest to it. Forget the old style of using LaTeX.

I just installed TeX this way and have no problem with typesetting English and Japanese writing vertically with tarticle, creating a pdf with dvipdfmx, and slides using beamer class with images in eps that were originally in openoffice.

Embedding Fonts

If you want to show your document with xdvi or Acrobat Reader with no Asian font pack which can be installed from here , you need to copy texmf-var/fonts/map/dvipdfm/updmap/kanjix.map from the installation directory to a directory under your home which will be created by updmap and edit it.

Run:

$ updmap

and ~/.texmf-var/fonts/map will be created. You have to manually copy kanjix.map here, replace all "Ryumin-Light" to ":0:kochi-mincho" and all ":0:GothicBBB-Medium" to "kochi-gothic", and remove all the "!" marks. Or you can run

embed_fonts.pl [< source kanjix.map file] [> embedded font map file]

like this:

$ embed_fonts.pl < /usr/local/texmf-var/fonts/map/dvipdfm/updmap/kanjix.map
  > ~/.texmf-var/fonts/map/dvipdfm/updmap/embedded_fonts.map
$ mktexlsr

Then, you should be able to do:

$ platex hoge.tex
$ dvipdfmx -f embedded_fonts.map hoge.dvi

and see the pdf with Acrobat Reader or whatever is your favorite viewer.

TEX Live

TEX Live is an easy way to internationalize TEX. Although Unicode is not supported and installing it brings huge programs.

However there's a patched version for UTF-8 with Japanese.

To unarchive the ISO image of Live DVD that resides somewhere in CTAN, install xz-utils package from Debian Squeeze :

$ sudo aptitude install xz-utils xzdec
$ xzdec texlive2009-20091107.iso.xz > texlive2009-20091107.iso
$ sudo mkdir /media/TeXLive2009
$ sudo mount -o loop texlive2009-20091107.iso /media/TeXLive2009
$ sudo /media/TeXLive2009/install-tl

and select <I> start installation to hard disk.

You can change the mount point in ptexlive.cfg which was just copied from ptexlive.sample.

$ mkdir ptexlive
$ cd ptexlive
$ tar zxvf ptexlive-20100322.tar.gz
$ cd ptexlive-20100322
$ cp ptexlive.sample ../ptexlive.cfg

Then go into the ptexlive directory and compile and install :

$ make
$ sudo make install
$ sudo make distclean

If you get an error, install other packages like libxaw7-dev.

LYX - The GUI frontend to TEX

If you'd like to use LYX, you can install it from Debian bpo.

Install the Japanese package of Babel first.

$ cd /usr/local/texlive/p2009/texmf/ptex/platex/
$ sudo mkdir -p misc/japanese
$ cd misc/japanese
$ sudo wget http://www.ring.gr.jp/pub/text/CTAN/language/japanese/japanese/japanese.dtx
$ sudo wget http://www.ring.gr.jp/pub/text/CTAN/language/japanese/japanese/japanese.ins
$ sudo ptex japanese.ins
$ sudo mktexlsr

Add this line :

deb http://www.backports.org/debian lenny-backports main contrib non-free

to your /etc/apt/sources.list.

All backports are deactivated by default (i.e. the packages are pinned to 1 by using NotAutomatic: yes in the Release files, just as in experimental).

If you want to install something from backports run:

$ sudo apt-get -t lenny-backports install lyx

or

$ sudo aptitude -t lenny-backports install lyx

Edit stdtoolbars.inc to allow access to dvipdfm instead of pdflatex due to compatibility with Japanese :

$ sudo vi /usr/share/lyx/ui/stdtoolbars.inc

Move cursor to view/update block, and modify it.

Item "View DVI" "buffer-view dvi"
Item "Update DVI" "buffer-update dvi"
Item "View PDF (dvipdfm)" "buffer-view pdf3"
Item "Update PDF (dvipdfm)" "buffer-update pdf3"
Item "View PostScript" "buffer-view ps"
Item "Update PostScript" "buffer-update ps"

Home

Ryu: ryu@run.sh