Maxima in CoCalc's sagews worksheets
Using Maxima in CoCalc's .sagews
worksheets
This discussion is prompted by CoCalc issue #54:
This file is shared at:
Use cell magic to set the worksheet to Maxima mode
The first thing to do is to use the %default_mode
magic to set the whole worksheet to Maxima mode.
(Note: it's important to put this magic command in its own cell.)
We can now use Maxima syntax.
How to deal with Maxima names that start with %
Problem
For example, the mathematical constants and are represented by %pi
and %e
in Maxima, but here starting a cell with %
is interpreted as a cell magic.
Similarly, one would normally get numerical expression for and by evaluating the following in Maxima:
Workarounds
Working around the problem is easy: it is enough to put something before the %pi
, %e
, or other %
-expression, so that %
is no longer the first character in the cell, and thus does not get interpreted as a cell magic.
For example,
introduce an initial space in the compute cell before the
%
expression, orintroduce an initial blank line in the compute cell before the
%
expression, orintroduce an initial comment in the compute cell before the
%
expression.
These three are illustrated below.