Docutils 0.8 in Ubuntu 10.04

In howto on Apr 23, 2012 by theoryl Tagged: , , , , , ,

I wonder if I’m the only person having trouble upgrading Docutils in Ubuntu Lucid Lynx. Docutils is a text processing package, written in Python and for Python, that implements reStructuredText — a plaintext markup language. The Ubuntu 10.04 repository has a really old version 0.6.3. It is missing a feature that is very important to me: the “math” role and directive (added in 0.8).

To upgrade the current version of Docutils, first uninstall the old version. That seems to be the source of all the trouble that I was having. (Before I uninstalled it, all the docutils commands still called the old version 0.6.3). So:

sudo apt-get remove python-docutils

The installation is fairly simple. Download either the snapshot or the stable release listed on the homepage. Then:

tar -xvzf docutils-0.8.1.tar.gz
cd docutils-0.8.1
sudo ./ install

You can check if you have install successfully by doing e.g. --version

To use LaTeX equations with rst directive:

.. math::
    e^{i\pi} = -1

Or with rst role:

:math:`e^{i\pi} = -1`

When using, one can use --math-output command line option to specify the math display format: MathJax (default), HTML, MathML or LaTeX. To get fancy with math in reStructuredText, see this post.


One Response to “Docutils 0.8 in Ubuntu 10.04”

  1. Thanks!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: