# Mathematica style formatting of equations in Sage cell

Please, read the question carefully before posting an answer.

Mathematica Notebook supports the following type of formatting of equations when entering expressions into Mathematica computation cell:

1) Division sign as a horizontal line that contains two subcells above and below the line:

**Ctrl+/**

2) Power sign, that gives additional subcell to the right and above of the initial cell in the form as a superscript:

**Ctrl+^**

Question:Is there something analogous for Sage?

Would be nice if this worked for output cell too. For example if the traditional output was x^y, then in this hypothetical Notebook it would be formatted as $$ x^y $$ where $y$ would be a formattable subcell. Also it should be possible to copy this formatted output and paste it into another formatted Sage cell or subcell.

There is a markdown mode in Sage Notebook to enter formulas as comments. But what I'm talking about is entering formatted equations in the Sage's computational cell.

One might argue that this feature is not necessary and one can do away completely without it, that it is just a matter of habit. However, this question is not about arguing about these points.

You will need something like a custom Jupyter Widget to achieve this. Such a widget would be usable more generally than just in SageMath, so you might want address your question directly to Jupyter (or JupyterLab) people as well.

@rburing thanks. I will learn more about Jupyter Widget and then get back to this post...

I think this is related with one of my questions: https://ask.sagemath.org/question/54145/a-frontend-with-2d-input-and-palettes/

The use of such a widget should remain IMNSHO

optional, "graphical" math input is excruciatingly slow and painful in the few case I have used :Such interfaces are proposed in various word processor's "math" tools, such as Word or OpenOffice. In both cases, inputting LaTeX (in Word's case) or LibreOffice's math language is way faster and easier : mousing is slow and imprecise (especially if you have to use something else such as a trackpad), and "keyboard shortcuts" are an overload over a math language vocabulary, which is

per sesufficient.I don't expect a different result from a Jupyter widget.

In other words, such a widget, enticing to a casual user, hinders learning Sage's language, and is therefore a bad idea but for very casual users.

@Emmanuel Charpentier . You are talking about things that I have never experienced when I used Mathematica Notebook, so I assume you haven't used it. I think it can be downloaded as a standalone application for free in case anybody wants to get familiarized with it. How will adding two keyboard shortcuts "Ctrl+/" and "Ctrl+^" make an overload to the language syntax? How is it detrimental to learning Sage's language? I'm not talking about full graphical input system like that of Libre Office, not even close. Adding subcell capability and keyboard shortcuts for division and power can help to clear out some math input, that's it. to deal with very long math input when there are many nested brackets and many divisions with complicated numerator and denominator.