Macaulay2 / Macaulay2/M2

utf8 characters in M2 and Emacs

Open
#1,069 17 comments 0 reactions 1 assignee View on GitHub

@pzinn is already working on this.

Since May 18, 2020.

Core under discussion
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

Is there any interest in using utf8 (or even unicode) characters more in Emacs? Recent versions of Emacs as well as most terminal emulators support unicode (not sure since which version). M2 itself also supports utf8 characters for variable names:
```
S = QQ[θ]; -- in Emacs use C-x 8 [Enter] 03B8 [Enter] to type θ
gens S
θ^2
S_0^2
```

Entering them is not super easy, but for instance `S_0` is a an easy shortcut. I don't think allowing `\theta` as variable name would be possible.

As an example of an alternative way, some Sage functions have a [`latex_name`](https://doc.sagemath.org/html/en/reference/calculus/sage/calculus/var.html) option, which just tells Sage to print the LaTeX name of the variable or function when using `latex(variable)`. Example:
```
sage: function('riemann', latex_name="\\mathcal{R}")
riemann
sage: latex(riemann(x))
\mathcal{R}\left(x\right)
```

We could have a similar option so that on viewers supporting utf8 we can print the utf8 character and on viewers supporting LaTeX, for instance in the documentation or the interactive shell, use the LaTeX code and let MathJax or KaTeX do the conversion.

This is somewhat related to #522

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.