GNU TeXmacs Forum

Using unicode characters as triggers in keyboard capture

#1

My keyboard setup allows me to type some unicode characters directly (e.g. the greek letters). I would like to use this when writing in TeXmacs.

However, when I input the character α in math mode it gets input as a straight letter instead of the "italic" math mode alpha. Here is the comparison (the former is the unicode character input from the keyboard):

[画像:image]

Here is the relevant content of the tm file:

<\body>
 <\equation*>
 \<#3B1\>\<alpha\>
 </equation*>
</body>

I would like to change this so that the key inputs the <alpha> command. I cannot figure out what I should pass to kbd-map.

Here are things that DO NOT work:
(kbd-map ("<#3B1>" "<alpha>"))

(kbd-map ("<#03B1>" "<alpha>"))

(kbd-map ("α" "<alpha>"))

Help?!

I cannot make a binding with the ô key
#2

Use (make 'symbol), which is typically bind to things like ctrl+q or meta+q. then you type any coinpoint you want.

1 Like
#3

Thanks for the suggestion, but this is not exactly the problem I am having. The problem is not that it does not insert the correct symbol but rather that Texmacs does not DETECT keyboard input that is a unicode character.

 (kbd-map ("<#3B1>" "Hello"))

does not work either.

More in detail: for example, in progs\text\vietnamese\vietnamese.scm there is the following line:

(kbd-map
...
("a <#309>" "<#1EA3>")
...
)

Does it actually work?

#4

I seem to have figured out a solution to my problem:

(kbd-map ("alpha" "<alpha>"))

works and translates the unicode greek α to the math α. However, it still does not explain why unicode input with unicode codepoint notation does not get CAPTURED in kbd-map bindings.

#5

I managed to use this technique to capture most unicode greek letters. However, epsilon, does not work!

(kbd-map ("epsilon" "<epsilon>")) 

DOES NOTHING, while

(kbd-map ("alpha" "<alpha>"))

works reliably. This seems like a bug.

AltStyle によって変換されたページ (->オリジナル) /