Skip to content

Using Macaulay2 with Org Mode

Doug Torrance edited this page Jun 5, 2023 · 2 revisions

Org Mode is an Emacs major mode with many features, including authoring computational notebooks.

To add Macaulay2 support to Org Mode, first install the Emacs package ob-M2 and make sure that the cons cell (M2 . t) is an element of the list org-babel-load-languages. See the README for instructions.

Then open a file in Emacs with the .org file extension and add a source code block (optionally using C-c C-, followed by s):

#+BEGIN_SRC M2
  R = QQ[x, y, z, w]
  monomialCurveIdeal(R, {1, 2, 3})
#+END_SRC

Then type C-c C-c. This will run the code, giving you the result:

#+RESULTS:
:         2                    2
: ideal (z  - y*w, y*z - x*w, y  - x*z)

See the Org Mode manual on Working with Source Code for more.

Clone this wiki locally