Sharedsupport / 2015-04-26-211601-fricas.sagewsOpen in CoCalc
Authors: Harald Schilly, ℏal Snyder, William A. Stein
License: GNU General Public License v3.0
Description: Examples for support purposes.
fricas("2+3")
5
# a mode in SageMathCloud is just a function that takes as input a string. That's pretty much it (there's more, but). # For example, this takes whatever the cells input is, executes the code in Fricas, # then takes the output and displays it using Markdown. def fricas2(s): t = fricas.eval(s) md(t, hide=False)
%fricas2 2+3

5

                                                                                                                                                                                                                      Type: PositiveInteger
%fricas2 )set output algebra off )set output tex on sqrt(2)

$

sqrt {2}

leqno(13)

$

                                                                                                                                                                                                                           Type: AlgebraicNumber
# it seems that the fricas mode itself is not outputing two $$'s. I don't know... fricas.eval("sqrt(2)")
'$\r\r\nsqrt {2} \r\r\nleqno(15)\r\r\n$\r\r\n\r\n Type: AlgebraicNumber\r\r\n'