Skip to Content.
Sympa Menu

texmacs-users - Re: about shortcuts

Subject: mailing-list for TeXmacs Users

List archive

Re: about shortcuts


Chronological Thread 
  • From: Giovanni Piredda <address@hidden>
  • To: address@hidden
  • Subject: Re: about shortcuts
  • Date: Mon, 30 Aug 2021 08:00:21 +0000


Am 30.08.2021 um 08:46 schrieb vincent douce:
hi Giovanni, thank for all your tipps, i have made great steps in my personal remapping of TeXmacs, i will share with you

responses to your email :

------------ about my-init-texmacs --------------
i understand the necessity of writing my shortcuts in my-init-texmacs instead of math-kbd.scm
so, i have written this in my-init-texmacs and restarted TeXmacs :

  (kbd-map
  (:mode in-math?) ("< <" "<alpha>")   )
you know, just to see if it works just to see, in fact, if there is a sort of priority between my-init-texmacs and math-kbd.scm but my alpha doesn't work

Try this:

(delayed (lazy-keyboard-force) (kbd-map
  (:mode in-math?)
("< <" "<alpha>")
  ))

and you can put all of your keyboard shortcuts inside the same "delayed" form.

It forces the default keyboard shortcuts to be loaded immediately, so they will be overwritten by the definition you are setting. I think that if you do not do that, the Scheme files with the default shortcuts will be loaded the first time you are writing a mathematical equation, so they will overwrite the shortcuts in my-init-texmacs.


------------ shortcut themselves --------------
so i have made your other suggestions for the moment in math-kbd.scm

* these work very fine : ("A-s" (make-sqrt)) ("C-s" (make-sqrt)))
("f f" (make-fraction)))

* these are not yet perfect :

(kbd-map (:mode in-math?) ("v v" (begin (make-hybrid) (insert "vect")) ))
works fine except that i have to type enter i.e. v v enter : it would be fine if vv would directly put a box under a vector arrow...

I figured it out by browsing the source files:

(kbd-map (:mode in-math?) ("v v" (begin (make-hybrid) (insert "vect") (kbd-return) )))



by me ("'" "*") (to replace the key ` by *) does-nt work yet due maybe to the way mac's keyboard's key ` works ? i have to see

and as you, § is not accepted by TeXmacs when I press it either in math or text (where it should represent itself)

I do not know where to search for information about this. Does anyone?

question "why the shortcut C-& does not have any effect"
it works in equations that contain the equality symbol; if there is no equality symbol, it does not do anything :-)
by me : never works, even if i am in a math equation say a=2

Is the equation you are in inline or displayed? It should work with displayed, and not do anything with inline. If it does not work with displayed, we can investigate more.

Finally for this message, I think that we could publish your nice document on shortcuts in the TeXmacs blog, I am available to help with that.

Giovanni


Vincent

Le 28 août 2021 à 19:53, Giovanni Piredda <address@hidden> a écrit :

Hi Vincent,

here you are answers to some of your questions (for the ones I am not able to answer, I hope someone else will).

First of all (now that you have become familiar with progs/math/math-kbd.scm ) some TeXmacs source files where one learns other Scheme forms that control the behaviour of the keyboard (as far as I understand, there are a few more Scheme constructs, beyond the ones of these files, for keyboard customization, but not many):

--- progs/texmacs/keyboard/latex-kbd.scm

where one sees the form kbd-commands, which is used to define "Latex-mode" commands

--- progs/utils/library/cpp-wrap.scm

where one reads a list of Scheme forms which generate mathematical expressions (at the end of the file, e.g. (make-fraction), (make-sqrt), (make-tree))

--- progs/math/math-edit.scm

other forms for editing maths (somewhat complex Scheme code, I am not able to understand what it does at the first reading)

Said this ---

question - how to send both alt-s and ctrl-s to the same effect:

(kbd-map
  (:mode in-math?)

("A-s" (make-sqrt))

  ("C-s" (make-sqrt)))

that is, assign the same effect to both key combinations. If you do this in a Scheme session, TeXmacs responds with the list of shortcuts that are active for that shortcut.


-- question "how to generate math operators:"

One possibility is with the Scheme function math-big-operator (which is defined as a Scheme function in math-edit.scm, I did not read the definition :-) )

(kbd-map
  (:mode in-math?)
  ("C-e" (math-big-operator "sum")))

Another possibility is using the form (make-hybrid), which tells TeXmacs that it should go into hybrid mode (where you insert LaTeX commands, you enter into this mode from the editor by pressing slash). Example:

(kbd-map (:mode in-math?) ("v v" (begin (make-hybrid) (insert "vect")) ))


-- question "remap § and ' into *": I tried

(kbd-map
  (:mode in-math?)
  ("§" "*")
  ("'" "*")
  )

' works, but § is not accepted by TeXmacs when I press it either in math or text (where it should represent itself). I do not know why. Someone does?

-- question "why the shortcut C-& does not have any effect"

it works in equations that contain the equality symbol; if there is no equality symbol, it does not do anything :-)


-- I leave to someone else question 4 (how to transform an integral sign into the [] combination). I think it needs some Scheme :-)

The shortcuts introduced in this message may be a bit complicated when taken all together but please ask and we can enter into each detail

Giovanni

Am 28.08.2021 um 06:57 schrieb vincent douce:
hi

i have dived into /Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/progs/math/math-kbd.scm 
and i have noticed that shortcuts are thought in an exhaustive and coherent way :
- exhaustive because the programmer seems to have wanted to put a maximum of symbols as shortcuts
- coherent because for example all symbols "looking like" a = are in the {=tab,=tabtab,..} list
my way of using TeXmacs doesnt need exhastivity not coherence ; it needs rapidity : i teach maths through Skype
so i have modifyed (a very little bit for the moment, see 1.15) my own /math-kbd.scm in order to get most used (by me) symbols in a quick way
for example :
= tab gives now on my computer the really most used <=>
x tab gives \times
etc...

i still have a lot of questions to go further in this work (see beginning of the document)

during this work i have made a little summary that would gain to be a bit worked on but that could be useful

questions and summary here, tm and pdf version :



Vincent




Archive powered by MHonArc 2.6.19.

Top of Page