texstudio icon indicating copy to clipboard operation
texstudio copied to clipboard

Feature Request: Add a toggle button for macros

Open eljokun opened this issue 10 months ago • 6 comments

Describe the feature and the current behavior/state

I'm not familiar with there being an option to disable a macro without deleting it for now, and it would be great to disable a macro so as not to use it while working on different documents, and so on, by means of a toggle enable/disable button added to the macros tab.

Who will benefit with this feature?

Practically everyone that wants the convenience of disabling a macro temporarily.

eljokun avatar Jan 31 '25 11:01 eljokun

Just to clarify: How do you execute your macros? I mean, you just could not use those you don't need?

Notes: This is espacially interesting for macros executed by triggers. To deactivate these you have to remember and remove the trigger, Deactivated macros should not appear in the main menu Macros. Should a macro always be executed by pressing the Execute button or only when it is activated?

octaeder avatar Jan 31 '25 11:01 octaeder

Just to clarify: How do you execute your macros? I mean, you just could not use those you don't need?

Notes: This is espacially interesting for macros executed by triggers. To deactivate these you have to remember and remove the trigger, Deactivated macros should not appear in the main menu Macros.

Exactly. I use the ?inEnv trigger to place ^{} and _{} automatically in equations, which is especially useful when i'm working in microelectronics, having to write $\huge V_{\text{CE2}_{\text{SAT}}}$, for example, but becomes annoying when i have to do multiple single-character subscripts, like $\huge \Pi_T (t)$ or

$$\large I_1 R_1 C_2 R_7 L_2 - \dfrac{R_f}{R_i}$$

and so on... It would be nice to have this in general! Like some sort of a "suspended" macro

eljokun avatar Jan 31 '25 11:01 eljokun

Thanks for pointing out this. It could be usefull to have an action on folders (in list to the left) which (de)activates all macros in this folder and all subfolders. Then you could create macros per document or so in a folder.

octaeder avatar Jan 31 '25 11:01 octaeder

Thanks for pointing out this. It could be usefull to have an action on folders (in list to the left) which (de)activates all macros in this folder and all subfolders. Then you could create macros per document or so in a folder.

Sure! But i believe a better approach would be to add a tick box to each macro definition as a toggle, so you can switch them on and off accordingly instead of having to define them per document.

eljokun avatar Jan 31 '25 11:01 eljokun

The idea is that the action sets or unsets the option on each macro. So, this is compatible with what you want to have.

octaeder avatar Jan 31 '25 11:01 octaeder

@sunderme please add label Enhancement to this issue.

octaeder avatar Jan 31 '25 11:01 octaeder