On 26 April 2015 at 20:49, William Stein <[email protected]> wrote:
> On Sun, Apr 26, 2015 at 5:40 PM, Bill Page <[email protected]> wrote:
> ...
>> Is there a way to tell the worksheet to render code
>> between $$ ... $$ as MathJax or have MathML markup rendered by
>> the browser instead of being treated simply as text?
>
> You'll have to write a new mode called something like
>
> %fricas2
>
> say. Then you can do pretty much anything. I could explain, but I
> don't have the time right now (I will later).
>
OK, thanks. Any pointers to documentation of "modes" in the Sage
worksheet would be fine too.
> Can you provide a very simple example of input to provide to fricas to
> get latex output, at least?
>
Sure. A worksheet cell with the contents
%fricas
)set output algebra off
)set output tex on
sqrt(2)
currently displays following output
$
sqrt {2}
leqno(10)
$
"algebra" is what FriCAS calls it's ascii output mode. "tex" is
actually the LaTeX mode (at least it is mostly LaTeX mod a few custom
commands). The actual output generated by Fricas is
$$
\sqrt {2}
\leqno(10)
$$
I do not know why the first character of each line is not shown in the
worksheet. Perhaps the current %fricas mode is trimming this first
character?
)set output tex off
)set output mathml on
sqrt(2)
produces the following MathML code
<math xmlns="http://www.w3.org/1998/Math/MathML" mathsize="big" display="block">
<msqrt><mrow><mn>2</mn></mrow></msqrt>
</math>
Getting MathJax to process FriCAS's LaTeX dialect might require some
extra work on the part of a new %fricas-latex mode, so I guess what I
would like most is a mode such as
%fricas-mml
that allows me to inject FriCAS-generated MathML into the worksheet output.
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.