mailing-list for TeXmacs Users

Text archives Help


Re: about shortcuts


Chronological Thread 
  • From: Giovanni Piredda <address@hidden>
  • To: address@hidden
  • Subject: Re: about shortcuts
  • Date: Sat, 28 Aug 2021 17:53:35 +0000

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