About semantic focus

In the documentation on mathematical formulas, there is the following paragraphs about semantic focus:

In order to activate the semantic editing facilities, please toggle Edit→Preferences→Mathematics→Semantic editing. In the semantic editing mode, several of the structured editing features of TeXmacs apply to the syntactic structure of the formula, rather than the visual structure of the document. For instance, the semantic focus is usually a subformula of the current focus. Similarly, only syntactically meaningful subformulas can be selected when making a selection.

The semantic focus is useful for several reasons. First of all, it is displayed in green if the formula is syntactically correct and in red if you made an error. This allows to quickly notice any typos while entering a formula. Secondly, if you have any doubt on the precedence of a mathematical operator or relation, then the semantic focus will inform you on the default interpretation: by putting your cursor right next to your operator, the subexpression to which the operator applies will be highlighted. In the case of an addition, or a more general associative operator, all summands are highlighted.

First, there is no Mathematics item in the Preferences. I guess it’s automatically turned on in the current version. Second, those functions typed in bold would be very helpful for editing math, but I can’t get any of them to work.

There is, I think, a UI bug in TeXmacs, in that the options are different if you select “Through the menus” or “Through popup windows” in the preferences under “Complex actions”.

For finding the Mathematics item you have to select “Through the menus” :slight_smile:
Then you should be able to select the semantic editing features. I tested them now for five minutes, and have seen the green frames, I recall having seen the red frames in another test that I made some time ago, but I am not able to make it appear now. You may want to experiment :slight_smile:

Thanks! The options are there if I select “Through the menus”.

The red frame will appear, for instance, if I type \alpha\beta with nothing in between the two letters.