Installing pTeXLive 2009 on Ubuntu Lucid 64-bit

I’ve been studying documentation formats for many months now, and although I generally like ReStructuredText, I’m not convinced that it is quite Japanese-friendly enough. This may be the fault of out of date conversion tools or the like perhaps, but making tables with special symbols seems to be especially awkward (for example, maru, sankaku and batsu: ○, △, ×)

Anyway, I’ve been looking into pTeX and TeXinfo, if not just plain pTeX, and doing so has led me to ptexlive 2009.

For people who just want a Japanese-compatible TeX, Ubuntu Lucid does provide ptex-base and ptex-bin. These, combined with the necessary other Japanese Postscript packages and the like, are likely adequate for most. However, I wanted to try something more modern, and this seems to be the cutting edge.

So, here’s the basic lowdown on how this went:

ptexlive 2009 Installation Guide

0. Prerequisites

It’s necessary to get and install from a DVD image of the official TeX Live distribution. Follow all the instructions as directed. It may also be necessary to add the installed program to your $PATH. I suggest doing a full proper install, up until you are able to run the TeX examples properly

Don’t forget: after install, it’s likely necessary to set up the XeTeX fonts.

1. Get ptexlive 2009 patch

The patch can be downloaded from here:

Yes, you read that right: ptexlive is basically a patch on top of TeX Live.

2. Set up ptexlive temporary folder

Replace ptexlive-20YYMMDD.tar.gz with the version you downloaded. (I tested with ptexlive-20100711.tar.gz.)

$ mkdir ~/ptexlive
$ cp ~/Downloads/ptexlive-20YYMMDD.tar.gz ~/ptexlive
$ cd ~/ptexlive
$ tar -xvf ptexlive-20YYMMDD.tar.gz
$ cd ptexlive-20YYMMDD
$ cp ptexlive.sample ../ptexlive.cfg

3. Edit ptexlive.cfg

The one required step is this: search for ISO_DIR and set it to the directory with the mounted TeX Live DVD iso. (Don’t have it mounted? Mount it!)

Additionally, you can search for make_option to set the -j flag for Make. If you’re on a multicore system this may speed things up, but it’s totally optional. On a Core i7, for example, you may want to set it to -j9 (8 HyperThreading threads, +1.)

4. Prepare to make ptexlive

  1. The dash shell of Ubuntu seems to cause problems. Setting CONFIG_SHELL may work around this, or it may not; I don’t know. What does work is: mv /bin/sh /bin/sh.bak; ln -s bash /bin/sh (Reversing this back to dash is up to you; some people prefer bash anyway…)
  2. Install all necessary prerequisite packages. To the best of my knowledge, this is what you need:
    1. libxt-dev
    2. libxaw7-dev
    3. ttf-sazanami-mincho
    4. ttf-sazanami-gothic
    5. gs-cjk-resource
    6. cmap-adobe-japan1
    7. cmap-adobe-japan2
    8. build-essential # Easy way to get gcc and friends

    It may also be worth looking at one of the Japanese build logs on the ptexlive page if the above does not seem sufficient.

  3. Refresh the font cache: sudo fc-cache -fsv

5. Run “make”, optionally “make otf”, and finally “make install”


I actually haven’t got this to build all the way to the end without errors. One single test regarding CVE-2007-0104, a PDF vulnerability, does not pass. I am not sure whether this is expected or not. However, if this is the only error you get, try “sudo make install”. ptexlive seems to work well enough.

Strange test output

On tests which passed, sometimes the output was rather odd.

The most worrisome are the utfsmpl-dvipdfmx.pdf and utfsmpl-ps2pdf.pdf files. For the first, all characters come out, but the Japanese emoticons have horrible character overlaps. In the latter, the emoticons look decent, but several characters don’t come out properly. The test technically passed, but these output files make me wonder if things are really okay.

Via dvipdfmx:

Via ps2pdf:

Finally, dNOKANJI.pdf seems like it passes, but there’s extra characters in the output of one section, so I am uncertain if it really is a pass or no:

Final thoughts

Basically, ptexlive 2009 seems to work just like the packaged ptex-bin/ptex-base in Ubuntu did, plus I can now write my TeX sources in UTF-8! However, it’d be nice to fix the few issues which did come up…

If anyone knows how to fix any of the problems I had, please feel free to leave a comment. For Japanese visitors, Japanese is okay. Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *