A couple of questions

I have reached a point where I’m using texmacs to write all my notes. There are a couple of things that could make my experience much better.

  1. I’m having this issue that when the length of text is more than a page, the text goes outside the margin. Here’s an example when using the solution environment.

  2. Sometimes, I would like to type letters and have them continue looking in “italic”. For example, I would like xA to look xA. One way I can do that now is to multiply them, but this creates a visible space between them, which I don’t want.

  3. How do I type the differential dx instead of dx?

  4. I like typing equations like normal text. Is it possible to do things:
    a. Typing sr after a single letter raises the letter to the second power. For example, asr -> a^2.
    b. Typing a number after a single letter, becomes a subscript. For example, a1 -> a_1.

  5. Lots of the inbuit shortcuts are brutal on the hand. In fact, some of them don’t even work, particular those with that use the meta key. Is there a way to remap the shortcuts?

  6. Is it possible to add line numbers to code snippets?

  7. How do I change the color of all math symbols ?

Answers to some of your questions

To obtain xA with italic x and A, you can “insert a textual operator” (“op” from the ribbon) and choose italic in the menu that appears. See also https://lists.texmacs.org/wws/arc/texmacs-users/2021-08/msg00041.html

Same idea, and you can even write a keyboard shortcut that you define for math mode only, for example.
For defining shortcuts, pls. look at the TeXmacs user manual https://www.texmacs.org/tmweb/documents/manuals/texmacs-manual.en.pdf, sect, 12.4, and pls. write if you have questions.
Take into account as well Change system's default shortcut for symbols, which will let you define keyboard shortcuts over the default ones (that in at least some cases get loaded after the user initialization file).

Perhaps it is possible to define keyboard shortcuts using pattern matching; I went quickly through section 2.2 (Matching regular expressions) of the Scheme developer guide, but I need more time to understand whether it will work for what you want.

For the shortcuts defined using meta, pls. check if it is possible to use the esc key, which you can press before the other keys, not at the same time (I remember that @mgubi explained it to me in a message, which I cannot find now).

Thanks as usual for answering. What about the last question, about changing the color of all math objects are once?

I let it slip :wink:

If you mean “all of the math expressions”, that is we do not have to filter the math expressions for sub-types, then redefining the math environments is a way to do that. You have to take the definitions for math environments and wrap them inside a with tag (written so that it fixes locally the color environment variable).

Perhaps take a look first at https://texmacs.github.io/notes/docs/macro-editor.html, which tells you how to go after macro definitions (and will be useful for all cases where you want to change a macro), then in case you need more help write again. Let me know if this is fair for you.

1 Like

Actually, I’ve already done that. I thought there was a universal way to change it in all environments at once.
I also forgot to ask: how do I manage long pages as per question 1?

Maybe but I have to think about it (and I do not know if thinking about it will make me find it out).

I do not know that, sorry. To me it looks like a bug. Perhaps some other forum member will be able to help.

Last question, I promise. I’m using the article style. When I’m inside the solution environment, the text size is smaller and everything is indented by 1 tab. I’d like to remove that effect. Any idea?

Please take first a look at https://texmacs.github.io/notes/docs/macro-editor.html.
To this case, I applied the method described there once and I saw that one has to apply it iteratively (the solution environment depends on other macros).
The first macro that appears is based on render-exercise, so you want to modify that (I do not know why it has been arranged inside a compound macro, I do not understand well enough the semantics of TeXmacs macros—I think it is the semantics :wink: ). I expect modifying render-exercise will lead you to what you want.
IMHO you going through the exercise is better than me giving you a solution. Then if you get stuck we can discuss.

Thanks once more. I’ve actually been playing with it. It’s just that this one was not so obvious as the other ones I’ve been doing.