Open mlg556 opened 4 years ago
I don't believe so, the ipython kernel is doing some magic to generate display messages.
Not quite what you want but you can generate a latex representation of the expression using
latex((a+5)/(a-3))
and copy the output between '' and paste the output between that into $$ either in markdown or in another cell using %%latex or %latex
I have noticed that fprintf("$%s$", latex((a+5)/(a-3))); gives a string close to the latex expression with text/latex if _execute_sync doesn't print the output using self.Print and uses self.Display instead???
Maybe if a line magic was created %symlatex
and the magic made the expression expr
was bracketed by fprintf("$%s$", latex(expr));
Then one would need to search within the output for $... $ and then set this fragment to be a text/latex and use the Ipython.display maybe...
Anyway, this is a rough idea...
On second thoughts, a line magic would be rather annoying and I'm not even sure existing metakernel code allows for the magic code to become normal code.
If one could invent ending line magic in this case this would be okay only if %symlatex or whatever name was; the last thing on the line with whitespace....
The delimiter to wrap around the latex expr generated by matlab maybe shouldn't be $ $, it could be something else.... but would need to be replaced to $ $ in the json
Anyway, I was investigating things re typing an maths assignment up....
I was wondering if it was somehow possible to implement displaying the symbolic variables in the notebook environment like
sympy
does.For clarification, this is the current situation:
How symbolic output is displayed in sympy: