How to exit an environment by only using the keyboard

I assume this must be documented somewhere but I am unable to find it.

So when I create a drawing with Insert -> Image -> Draw image, then when the image has focus, how can I exit the focus and continue writing by only using the keyboard? Also, when the image is at the end of the document, then clicking with the mouse after (i.e. under) the image does not make the image ‘loose focus’ so that I would not know how to continue writing (without doing some hack like first clicking before the image). B.t.w. I am on GNU/Linux (Fedora 35).

As I assume these things are documented somewhere, I would be interested to know where exactly I can find that documentation.

Thanks for the help and the great program!

I’d like to know, too.
Right now I have C-e bound to (structured-exit-right) and I just hit that until I’m out of the environment I’m trying to leave, but it would be nice to have a keyboard shortcut for “leave math environment” or “leave figure”.

I would guess that “structured-exit-right” is the “right” command. What is wrong with it? Also there are buttons on the focus bar (but not in graphics mode, even if the command should work there too, I haven’t checked although).

I can only get “structured exit right” to work if I have edited the graphics object (e.g. added a point or line). It doesn’t seem to work if the graphics object is entered without editing.

There is also “graphics-exit-right”, which is what the toolbar item “Exit graphics mode” is bound to. This does exit the graphics. This could be bound to the “exit” keyboard shortcut conditional on being inside a graphics object.

Ah thanks, this was indeed what I was looking for. Somehow I looked over the “Exit graphics mode” on the toolbar (maybe it is not in the most intuitive location). I am completely new to TeXmacs, but I think documentation of this functionality is lacking.

What do you mean with the ‘exit’ keyboard conditional? It sounds interesting.

Anyway, already thanks for all the answer!..

In TeXmacs you can make the behaviour of shortcuts depend on the context.
To exit graphics you could either define a completely new shortcut, or you could change the behaviour of the shortcut for “structured exit right” to something else when you’re inside graphics mode.

You need to put

(:mode in-active-graphics?)

inside the kbd-map to do this:

1 Like