LoginSignup
1
0

More than 1 year has passed since last update.

Ubuntu 20.04 で imaxima を動かす方法

Posted at

wxMaxima も悪くないのですが、やはり Emacs の方が使い慣れています。Emacs 上で綺麗な数式表示を見るには imaxima を使えばよいそうなのですが、手元の Ubuntu 20.04 ではうまく動きませんでした。

調べたところ、imaxima.el を修正すれば Ubuntu 20.04 でも動くという情報を見つけたので記録しておきます。

手順

  1. maxima-emacs をインストールします。

    $ apt-get -y install texlive texlive-science maxima maxima-emacs
    
  2. /usr/share/emacs/site-lisp/maxima/imaxima.el があるので、ホームディレクトリの下の適当なディレクトリにコピーします。
    当方の場合は ~/.emacs.d/maxima/ というディレクトリを作ってその下にコピーしました:

    $ mkdir ~/.emacs.d/maxima
    $ cp /usr/share/emacs/site-lisp/maxima/imaxima.el ~/.emacs.d/maxima/
    
  3. flexisym の前に amsmath をロードするように、コピーしたファイルを修正します:

    --- /usr/share/emacs/site-lisp/maxima/imaxima.el    2020-02-21 06:13:41.000000000 +0900
    +++ /home/xxx/.emacs.d/maxima/imaxima.el    2021-09-01 20:25:38.507329964 +0900
    @@ -827,6 +827,7 @@
      imaxima-latex-preamble
      "\\usepackage{color}\n"
      "\\usepackage{exscale}\n"
    +     "\\usepackage{amsmath}\n"
      "\\usepackage[cmbase]{flexisym}\n"
      "\\usepackage{breqn}\n"
      "\\setkeys{breqn}{compact}\n"
    
  4. 修正した imaxima.el を読み込むように、コピー先ディレクトリを Emacs ロードパスに追加します。
    例えば、以下のようなものを init.el などに追加します:

    (setq load-path 
      (append (list (concat (getenv "HOME") "/.emacs.d/maxima"))
              load-path))
    
  5. Emacs を再起動して imaxima を動かし、$\LaTeX$ で整形された数式が表示されれば完了です。

参考にした文書

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0