In Atom, particularly Juno, or VSCode via plugin "LaTeX Input:, special characters, e.g. beta (β) could be entered into the editor with "\beta", followed by "Tab" key. Can this feature be added into SciTE?
Currently, symbols (or smiley) are entered by from/copy web and paste it. Second method is using Windows+"." keys combinations for Win10 (of course UTF8 encoding file only). Thank you.
From Emacs documentation -> https://www.emacswiki.org/emacs/TeXInputMethod
Sounds like the abbreviations feature.
Edit | Expand Abbreviation(Ctrl+B) with definitions set up in the abbreviations fileOptions | Open Abbreviations File.I have an implementation at https://github.com/zufuliu/notepad2/blob/master/scintilla/win32/ScintillaWin.cxx#L1334
You can try it in Notepad2 after enable LaTeX input method (under Settings menu).
See https://github.com/zufuliu/notepad2/issues/289 and https://github.com/zufuliu/notepad2/issues/296
I tried for 20 minutes the abbreviations approach, but didn't manage to get it working. It shows that it is not easy-to-use feature. Symbol or emoji are standard - thus is the reason (I'm guessing) Emacs created this feature.
The implementation by Notepad2 is the rather easy to use. Thanks Liu Zufu.
Attached an example abbrev.properties file.
Last edit: Neil Hodgson 2021-06-09
How about implement this inside Scintilla? my ScintillaWin::HandleLaTeXTabCompletion() is almost platform independent (it currently call MultiByteFromWideChar() to convert the result, see https://github.com/zufuliu/notepad2/blob/master/scintilla/include/LaTeXInput.h#L57).
The changes would be:
My current implementation have 67 KiB data (2508 LaTeX, 46 KiB; 1373 emoji, 26 KiB), bigger than Unicode category data, if size matters, a preprocessor can be added to make this feature optional by default.
This appears to be better as application functionality. An application can set the definitions appropriate to their users, make them context sensitive, and allow users to add to and modify the definitions.
Thanks for the sample abbreviation. It works for simple notation. Complicated notation such as subscript_x ("_x") or superscript_y ("\^y") are harder. My sample abbreviation is below.
E.g. β⁰ + α₁ + Yx
Last edit: honfui 2021-06-09
A daft implementation for SciTE, show input sequences on auto-completion list is not implemented.
following sequences are not supported (maybe others that contains special punctuation).
Added auto-completion, the code needs some tweaks, e.g.
StringList wl(true);inSciTEBase::StartAutoCompleteWord()can be optimized out.There's a memory out-of-bounds write so it needs something like:
Another way to access emoji and mathematical symbols is through the Windows Touch keyboard which has the advantage of showing the characters and requires less memorization.

Good catch. updated patch with hard-coded mapping for
There are other problems: (1) SciTEGTK.cxx needs update to add new menus. (2) "Open LaTeXInput.properties" should be hided from Options menu.
(3) An property for visible item count on auto-completion list other than the 16 for
wEditor.AutoCSetMaxHeight.The file can be used with the current abbreviations feature so why is there a need for duplicate functionality? The file can be simply placed on SciTE files (https://github.com/moltenform/scite-files) for users to download which also removes it from being a maintenance burden for SciTE.
It may be worth adding an autocompletion when Insert Abbreviation doesn't find a match.
Some form of escaping could be added but it should have minimal impact. Perhaps allowing
\ufollowed by exactly 4 hexadecimal digits would be sufficiently unique to not match other keys (there is a\uin the list). This could be applied to keys just in the abbreviations but may be safe for keys in all properties. It can't be applied to values (or whole lines) in properties files as they often parse escapes themselves in a particular manner.moved the content into abbrev.properties, the GTK changes is not tested.
[e5dc12] allows Unicode escapes
\x,\u, and\Uto be used for keys in property files, so enabling abbreviations like^=. The escapes must be followed by 2, 4, or 8 hex characters (matching thex,u, orU) to be converted. Any invalid sequence is treated verbatim. The code point is converted to UTF-8.Thus, these properties:
Will cause this behaviour:
Related
Commit: [e5dc12]
Updated script to generate hex escape
\x3Dfor=:Escape feature included in 5.1.2 release.
To minimize differences, parts of the patch have been committed.
[edb2cd] allows specifying number of items in autocompletion lists but changes the property to "autocomplete.visible.item.count" for consistency and set the default to 9 as that is the current behaviour.
[8701f0] adds a (reduced) AutoCompleteWordList class and uses it for Complete Word. Marked AutoCompleteWordList::Get as const and initialized minWordLength to SIZE_MAX to avoid casting.
Still not understanding why the patch diverges from current behaviour like binding to Tab instead of Ctrl+B. If users don't like key bindings they can change them.
Related
Commit: [8701f0]
Commit: [edb2cd]
Thanks both for the great effort. Tested the abbrev.properties approach (downloaded). The superscript doesn't work or not available, e.g.
\^2or\^y.Tested again, superscript does work. My apology.
A problem with the large abbreviations file on GTK is that the pop-up combo-box in the dialog contains so many values that it produces a window taller than 32K pixels which fails due to maximum window size. It also takes a long time so can appear to hang.
It would be possible to use a scrolling list instead of a pop-up. Its a little surprising that GTK doesn't automatically use a scrolling window as it does for menus that are too tall.