mailing-list for TeXmacs Users

Text archives Help


Re: customization


Chronological Thread 
  • From: Giovanni Piredda <address@hidden>
  • To: address@hidden
  • Subject: Re: customization
  • Date: Thu, 29 Jul 2021 11:25:38 +0000


Am 29.07.2021 um 08:19 schrieb vincent douce:
hi
thanks to this page following posts on this forum :
http://forum.texmacs.cn/t/wiki-assorted-code-snippets-to-customize-texmacs-behaviour/465 <http://forum.texmacs.cn/t/wiki-assorted-code-snippets-to-customize-texmacs-behaviour/465>
i have now a short cut Cmd-E...P that creates automatically a pdf file with the same name at the same place
it is for me a wonderful gain of time and gain of clicks…
i would like to know how to customize more TeXmacs
- disabling the dialog ("pdf still exists do you really want to…") ;

You have to substitute the following

(define (export-to-proposed-pdf)
  (wrapped-print-to-file (propose-pdf-name)))

for the function (export-to-proposed-pdf) defined in the snippet you took from the linked post.

do you think it would be possible, for people who can, to create new explanations on this web page for beginners to makes theses customizations step by step ?
Vincent


Please give me some time :-)

For one of the things you asked though

- remapping all the existing shortcuts

you can take a look at section 12.4 of the manual together with the example in the snippet you took from the post, which I copy here:

(kbd-map ("M-e p" (export-to-proposed-pdf)))

Please experiment a bit and maybe write again. I think that it is important that you experiment a bit with this because in this case I think it is the only way to become able to  use it.
In the key combination keys need to be separated by spaces (so pressing x twice is "x x").  A represents the alt key, C ctrl, S shift and M represents the meta key (in many keyboard setups it is the esc key, which needs to be pressed before the key it modifies, not simultaneously).
Moreover that if your key combination is interpreted ("intercepted") by the OS then it does not get input into TeXmacs and therefore the shortcut does not work. For example you can assign an action to shift-tab, but not to shift-p, because the latter would be interpreted as a capital p by the OS and so TeXmacs would not see "S-p" but "P" (I hope that I am getting this right ;-) ).

Finally (but you can consider this after you have experimented a bit) if the keyboard shortcut is defined in the TeXmacs default and loaded lazily, then the default definition would overwrite the one that you defined in my-texmacs-init.scm.
To make sure that this does not happen, you have to force the loading of default definitions before you set up yours. Please look at http://forum.texmacs.cn/t/change-systems-default-shortcut-for-symbols/310/14 for how to do it.

If you look at the kbd-map forms in progs/generic/generic-kbd.scm you could get some inspiration. Also here is a list of places where keyboard shortcuts are defined in TeXmacs: http://forum.texmacs.cn/t/quick-way-to-check-keyboard-shortcuts/87/3, maybe there should be an easier way to get all of the existing shortcuts (rather than through a program to search text).

For the other two questions:

- creating new items in "insert/énoncé"

please give me more time, in the meantime you can read section 12.3 of the manual (but I agree that a description which is paced more slowly could help). I should be able to write it up in a short time (I would add one or two examples to the ones already present in the manual).

- modifying the format of these items (definition in italic or no etc…)

my feeling is that either you get instructions for the effects that you want, but in this case the effort of generalizing those to all formatting rests completely on you, or you need to wait till someone writes a tutorial, which will take some time. Maybe I can write a tutorial limited to simple formatting (I do not have a grasp of the macros that is general enough to write a general tutorial), but not immediately.
By the way on this topic I have the feeling that in the tutorial one needs to convey the idea that one is addressing a limited set of the TeXmacs macro programming, and that the readers need to put in a little bit of intuition to figure out when what he is reading does *not* apply to the things that they would like to accomplish.




  • customization, vincent douce, 07/29/2021
    • Re: customization, Giovanni Piredda, 07/29/2021

Archive powered by MHonArc 2.6.19.

Top of page