#!/bin/sh
TEXMACS_MAXIMA_PATH="$TEXMACS_PATH/plugins/maxima/lisp"
export TEXMACS_MAXIMA_PATH
case $1 in
  5.6)
    case $2 in
      gcl) exec maxima -load "$TEXMACS_MAXIMA_PATH/texmacs-maxima-5.6.lisp" \
          | maxima_filter;;
      clisp) exec maxima -i "$TEXMACS_MAXIMA_PATH/texmacs-maxima-5.6.lisp" \
          | maxima_filter;;
      *) echo -e "\2latex:\\red Unsupported lisp for old maxima: $2\5"
    esac;;
  5.9.0) exec maxima -u $1 -l $2 -p "$TEXMACS_MAXIMA_PATH/texmacs-maxima-5.9.0.lisp" \
      | maxima_filter;;
  5.9.0.9* | 5.9.1) exec maxima -u $1 -l $2 -p "$TEXMACS_MAXIMA_PATH/texmacs-maxima-5.9.1.lisp";;
  *) echo -e "\2latex:\\red Unsupported version of maxima: $1\5"
esac
