ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 21 Apr 2022 14:04:19 +0200Mathematica style formatting of equations in Sage cellhttps://ask.sagemath.org/question/62082/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.YStThu, 21 Apr 2022 14:04:19 +0200https://ask.sagemath.org/question/62082/SageMath code auto-formattinghttps://ask.sagemath.org/question/57558/sagemath-code-auto-formatting/ Hello there!
Are there any known code formatters for SageMath code, such as `yapf` and `black` are for Python code? If not, is it possible to make a fork of, say, `yapf` which recognises the special SageMath syntax?
It makes sense that this would be possible since SageMath code is essentially an extension of Python; however I have no idea how one would go about actually doing so.BakerbakuraTue, 15 Jun 2021 15:19:12 +0200https://ask.sagemath.org/question/57558/