Shortcuts in my-init-texmacs

i dont understand why my colors do not work :
(kbd-map (:mode in-math?)
("@ k" insert '(with “color” “red” “<#2665>”));marche pas
("@ p" “<#2660>”);pique
("@ k" “<#2665>”);coeur
("@ c" “<#2666>”);carreau
("@ r" “<#2663>”);trefle

i have tried also :
("@ k" (with “color” “red” “<#2665>”))

the rest work very fine

any help welcome…


Hi @vincent-douce and welcome to the forum!

There seems to be a pair of parenthesis missing:

(kbd-map (:mode in-math?)
  ("@ k" (insert '(with "color" "red" "<#2665>")))

thanks very much it was simple indeed
it works well
but i still have a question :
why does it works when i am on styx mode and not on roman mode ?
are not the same fonts installed in both modes ?

i have now an other question :

(kbd-map (:mode in-math?) ("a z d" (insert '
("a z d" (insert '(with "math-display" "true" ""))) 

a) this does not work
b) i would like to put the cursor, with insert-go-to maybe, i dont know how to find the way to do it

what do you think

I think the reason is that roman is not an unicode font so does not have these glyphs.

Hi Vincent,
I think that

(kbd-map (:mode in-math?) ("a z d" (insert-go-to '(with "math-display" "true" "") '(2 0))))

is what you want.

One needs to keep in mind the following: the list '(2 0) indicates the position inside the tree formed by

'(with "math-display" "true" "") 

And you need to count:
there is the main branch, that is the list that starts with with; the keyword with is the tag of the main branch and you must not count it; you count the children of the branch, starting from zero; they are

child number content
0 "math-display"
1 "true"
2 ""

So we want the third child, which is number 2, so our list for the position in the tree has 2 as its first element; the third child is a string, which is also a tree (with a hidden tag which is string, I just checked it), and we want to be in position 0 (the first child, which is beginning of the string); so '(2 0).


fantstic Giovanni thanks very much it seems to work very properly
also, your explanation is very clear about the list

1 Like