mathdown icon indicating copy to clipboard operation
mathdown copied to clipboard

\symbol autocomplete

Open cben opened this issue 10 years ago • 6 comments

Should offer autocomplete when typing \foo.

  • [ ] Autocomplete dollars when outside math: \al -> $\alpha$ (with cursor before closing $ if possible).
  • [ ] Bag-of-words search & spelling, ideally \arow should offer \rightarrow etc.
  • [ ] Display symbols in completions list.

Big question: should I autocomplete to unicode chars (e.g. \beta -> β) to encourage Mathdown's "the source is the document" ethos? It's seems to be supported well enough by MathJax(?). Should limit to only chars that work with \usepackage[utf8]{inputenc} on pdflatex. Anyway there must be an option to export back to ascii.

  • [ ] Integrate (or just link to) Detexify? Or for unicode, http://shapecatcher.com/. Keep an eye on Detexify's client-side successor https://github.com/kirel/sketch-a-char (not yet trained).

cben avatar Mar 11 '14 20:03 cben

  • [ ] Also offer "related" symbols to normal ascii characters, e.g. offer ± for +. https://github.com/kasperpeulen/PressAndHold/ does this in an excellent way popping up after long press.

https://github.com/thehogfather/brackets-latex has a lot of latex-in-CodeMirror goodies (including \macro autocomplete)

cben avatar Sep 29 '14 11:09 cben

Should alo take a look at MS Office's Equation Editor shortcuts and autocorrect — I hear it's very keyboard friendly these days. http://iun.edu/~mathiho/useful/word07shortcuts.pdf https://support.office.com/en-us/article/Linear-format-equations-and-Math-AutoCorrect-in-Word-2e00618d-b1fd-49d8-8cb4-8d17f25754f8 I'm impressed that they support "Use Math AutoCorrect rules outside of an equation"!

cben avatar Nov 26 '14 13:11 cben

CoffeeTeX is a quite interesting unicode-based latex superset. Its demo editor is based on PressAndHold (by same person), including auto-converting latex macros to unicode (\alpha to α).

It's quite tempting to adopt it wholesale for mathdown!

cben avatar Dec 09 '14 13:12 cben

OTOH, using CoffeeTeX syntaxes that are not currently supported by pandoc/scholdoc (with unicode.tex/xetex/luatex) would be unwise. E.g. x\overset{ℝ}{+} y=x\overset{ℚ}{+} y is cool, x+↖ℝ y=x+↖ℚ y is not. Should figure out what subset works.

cben avatar Dec 09 '14 13:12 cben

IPython Notebook now also does \symbol autocomplete: http://ipython.org/ipython-doc/dev/whatsnew/version3.html#typing-unicode-identifiers

cben avatar Mar 02 '15 13:03 cben

Turns out unicode "mathematical" chars vs \symbol is a complicated matter. E.g. β (GREEK SMALL LETTER BETA) vs 𝛽 (MATHEMATICAL ITALIC SMALL BETA) vs \beta. Most people typeset all math (including \beta) as italic anyway. Should regular β be normalized to italic? Should italic 𝛽 be disregarded if doing upright typesetting? http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/unicode-math/unicode-math.pdf has a lot of options to control this.

MathJax seems to sometimes normalize β vs 𝛽 or not depending on output renderer.

I'm not sure this matters to encouraging unicode here, but should think more. The default .tex export template (when I implement export) should probably use \usepackage[math-style=literal]{unicode-math}.

cben avatar Mar 22 '15 11:03 cben