Pari/GP-Mode for the Text Editor SciTE

Pari/GP is a computer algebra system for fast computations in number theory. While being well integrated in Unix (emacs mode, readline, etc.), it is hard to use for many beginners. Especially if they are Windows users.

Though emacs' pari-mode is very comfortable (if you are comfortable with emacs), the emacs editor is also too hard to learn for many Windows users. For example I use Pari/GP from within emacs, but I do not use the the pari-mode. For Windows users there are some GUIs available but each has its limitations:

Fortunately there are many good text-editors which support new languages by adding some config-file.

One of these editors is SciTE - the scintilla editor. SciTE is platform independent, so it supports windows and linux. SciTE is flexible and modes for many major programming languages (and LaTeX, Html etc.) are already included.

A pari mode for SciTE

Based on scite's C++ mode I have created a mode for working with Pari/GP. It is aimed at new users of Pari/GP and especially (new) Pari/GP users under Windows.
Features of the Pari/GP-mode for SciTE consists of:

Have a look at the screenshot:
screenshot showing scite with parimode


  1. Install SciTE.
  2. You need the files. This file contains the settings for the SciTE Pari/GP-mode.
  3. For Windows: in the lower part of this file, you have to change the GP_PATH to the directory where your Pari/GP is installed.
    For Linux I assume that gp and gphelp are in the PATH.
  4. Start SciTE, in SciTE: chose from the menu "Options" then "Open User Options File", then append these lines:
    # import from /usr/local/include/scite:
    import /usr/local/include/scite/pari
    be sure to change /usr/local/include/scite to the directory where you have saved and yes, the import line is without .properties.
  5. (There are many more settings you can change here. Have a look in the SciTE-Help, available via the Help-menu.)

That's it. There is one flaw: the gphelp-script under Windows uses Ansi-Escape-Seqences for formatting (e.g. bold), which disturb output in the output-window. There are at least two ways to deal with this situation:

Under Linux this problem does not exist because gphelp opens xdvi with the corresponding part of the Users-Guide. If you prefer help in the scite window, you may change the$( line in the if PLAT_GTK part of the file to:$( -detex 

But then you have the same problem as explained above and you may want to patch the gphelp script too, so you better change the line to:$( -detex

or use the sed filter$( -detex  | sed "s/\d027\[[0-9]\?m//g" 

The Option -detex is needed since otherwise gphelp opens a xdvi window.

nach oben

Letzte Änderung: 03.11.2008
© Lars Fischer

Valid XHTML 1.1!  Valid CSS!