I expect a cell like
from IPython.display import display, Math
display(Math(r"e^\alpha"))
to render with MathJax as it does in normal jupyter, but instead it just displays latex code like:
$$e^\alpha$$
Is there a way to get Colaboratory to render it correctly? (It manages it fine for text cells).
I am not sure that it's the right method,but it works:
First you question is uncorrect, it should be "inline" not output in colaboratory.
Second to answer your question, just change "Code" option in menu bar to "Markdown" and executive
$= e^\alpha$
or$$= e^\alpha$$
in "In box".This is example colab show latex in mardown
Update: Sorry for my late update, i saw in colaboratory notebook so difference , to show LaTeX in it, just Insert "text cell" in Insert menu bar and executive
$$= e^\alpha$$
or$= e^\alpha$
in input boxSimplify scraaappy's answer a bit.
It just includes
MathJax
library so the following equations can be displayed.Or use the built-in
output._publish
(Aug 2018)Instead of CDN, you can also use MathJax that comes with Colab.
https://colab.research.google.com/static/mathjax/MathJax.js?config=default
As a temporary workaround, you can define your own equation rendering function:
And then use it as follows: