Friday, September 08, 2006

Print UTF8 CJK charactors by texLive

Firstly, let's install texlive2005 on the computer. It is very simple.

  1. Download texlive2005-inst-20051102.iso from ctan.org.
  2. Install texlive2005, mount it and run install-tl.sh.
    # su -
    # mount -o loop path-to-iso-file/texlive2005-inst-20051102.iso /media/cdrom
    # cd /media/cdrom
    # ./install-tl.sh
  3. Set the enviroment variable, you'd better put the content below into the /etc/profile.d/texlive2005.sh if you use Gentoo Linux, where you run mktexlsr (texhash).
    export TEXDIR=/usr/local/texlive/2005
    export TEXMFMAIN=$TEXDIR/texmf
    export TEXMFDIST=$TEXDIR/texmf-dist
    export TEXMFLOCAL=/home/apps/texlive/texmf-local:$TEXDIR/texmf-local
    export VARTEXMF=$TEXDIR/texmf-var
    export PATH=$PATH:$TEXDIR/bin/i386-linux
  4. Initialize the texLive.
    $ su -
    # mktexlsr
    # updmap-sys --syncwithtrees
    # texexec --make
  5. Then, we configure UTF8 fonts, this step is even more simple.
    1. Download arphic fonts from ctan.org.http://www.ctan.org/tex-archive/fonts/arphic/ There are four kinds of chinese fonts:
      bkai00mp-20050720.tar.gz  2005-07-20  9841 Kbyte  BIG5   Kaiti
      bsmi00lp-20050720.tar.gz  2005-07-20  9852 Kbyte  BIG5   MingLiu
      gbsn00lp-20050720.tar.gz  2005-07-20  4583 Kbyte  GB2312 Songti
      gkai00mp-20050720.tar.gz  2005-07-20  4538 Kbyte  GB2312 Kaiti
    2. Uncompress them into the directory $texmf-local, probably /usr/local/texlive/texmf-local/, or the directory $HOME/texmf, or $HOME/.texlive2005/texmf-var/, just inheriting the directory fabic of "texmf". Then, find out all the ".map" files under the directory $texmf-local/fonts/map/, includes bkaiu.map,bsmiu.map, gbsnu.map and gkaiu.map. Then, run the command updmap-sys --edit as root, and add these maps information in the bottom:
      Map bkaiu.map
      Map bsmiu.map
      Map gbsnu.map
      Map gkaiu.map
      After updmap-sys re-generate all map settings, all is done.
    3. Ok, now, set latex enviorment {CJK}{UTF8}{gbsn} or {CJK}{UTF8}{gkai}, you can use pdflatex or dvipdfmx to generate your pdf files.
    4. Append some contents below into $texmf-var/dvips/config/config.ps, then you can use dvips to print out ps files.
      p +cm-dvipdfm-fix.map
      p +dvipdfm.map
      p +gkaiu.map
      p +gbsnu.map
PS: when texlive2007, just choose basic scheme to install for the general application. And there is only about less than 200M bytes.

No comments: