mailing-list for TeXmacs Users

Text archives Help


Re: about esc-esc-& in math centered equation


Chronological Thread 
  • From: Giovanni Piredda <address@hidden>
  • To: address@hidden
  • Subject: Re: about esc-esc-& in math centered equation
  • Date: Thu, 2 Sep 2021 16:12:49 +0000


On 02.09.21 13:56, vincent douce wrote:
hi
in the esc-esc-$ mode, if i type a=2 then esc-esc-& i get aligned equations
(esc-esc-& mode)
very useful
a) please what is the shortcut to exchange between $ mode (equation) and
esc-esc-$ mode (centered equation)
knowing it would be useful for me to navigate between these 3modes


I do not know if there is a shortcut; for making one I would start from either this example of the Scheme developer manual, which turns :

(tm-define (special t) (and-with p (tree-outer t) (special p)))

(tm-define (special) (:require (tree-is? t 'rsub)) (tree-set! t `(rsup ,(tree-ref t 0))))

substituting (focus-tree) for t

or from the definition of the menu button for changing inline into display formulae (from progs/math/math-menu.scm):

(tm-menu (focus-variant-menu t)
  (:require (tree-in? t '(math equation equation*)))
  ("Inline formula" (variant-formula t))
  ("Displayed formula" (variant-equation t)))

where again t needs to be substituted by (focus-tree).

I do not have immediately time for this, but if noone else does it before me I shall try to provide the working code within one/two days. By the way to find the code I used the search functionality of GitHub: I search for "Inline formula" (which is the text which appears in the button) and then restrict the search to Scheme functions; often most of the search results can be excluded immediately (e.g. files for translations) and one needs to look through a few files only. I know that the software ack (https://beyondgrep.com/) is also a powerful search tool, but I have been lazy and I haven't yet learnt it :-)

b) if i type in esc-esc-$ mode : a=2+2<=>a=4 and then esc-esc-& i don't get
the expected result
though, i would find it very useful to consider that <=> has something like
an anteriority among =
i mean, a=2+2<=>a=4 after esc-esc-& may give :
...........a=2+2
...<=>a=4
what do you think ?

Same :-) Here I think I would start from the definition of the ctrl-& shortcut :-)



Vincent



Archive powered by MHonArc 2.6.19.

Top of page