mvoidex/UnicodeMath

Defining synonyms in json configuration

JanTvrdik opened this issue · 7 comments

I really like the idea of synonyms for some symbols, so I would like to define my own synonyms in json configuration for symbols I frequently use. For example

{
    "alpha": "upalpha",
    "beta": "upbeta",
    "gamma": "upgamma",
    "delta": "updelta",
    "epsilon": "upepsilon",
    "eps": "upepsilon",
    "lambda": "uplambda",
    "union": "cup",
    "intersect": "cap"
}

Fixed in a5ac1ee
You can now edit custom symbols and synonims in user settings (available from menu or "UnicodeMath Settings" command).

Unfortunately, symbols can hold only unicode symbols below 0x10000 because of json limit.

{
    "symbols": {},
    "synonims": {
        "alpha": "upalpha",
        "beta": "upbeta",
        "gamma": "upgamma",
        "delta": "updelta",
        "epsilon": "upepsilon",
        "eps": "upepsilon",
        "lambda": "uplambda",
        "union": "cup",
        "intersect": "cap"
    }
}

Thanks! It works perfectly. Just two things:

  1. JSON can contain characters above U+FFFF (e.g. U+1D538 can be written as "\ud835\udd38" or simply as "letter"). The limitation is probably by Sublime Text parser.
  2. English is not my native language but I believe it should be "synonyms" not "synonims" (see OALD8).
  1. Yes, Sublime Text fails to parse this
  2. Thx, fixed

First of all thank you for implementing that functionality, it is really useful. I have a question regarding the synonyms: Is there a way I could get them to show up in the menu (Shift-cmd-p, "UnicodeMath: Insert")? If I use the synonyms from above I can use them, but only "cup" is showing up, not "union" e.g.

I can't reproduce that, seems ok

Synonyms

This feature is great, however it should be documented on the project home page. As far as I can tell, at the moment the only way to discover it is to read this closed bug.

There's mention in settings section.
Maybe there should be separate section named Custom symbols & synonyms, for example?