3

I'd like to know if in my TeX editor, TeXstudio, the buttons can be customized? i.e:

The marked button produces $ $, and I'd like to have ${}$ enter image description here

This other button produces \\ and I'd like to have

\par
%

enter image description here

Is that possible?

  • Why do you want ${ }$? (Probably not a good idea.) – Torbjørn T. Sep 28 '17 at 18:12
  • 2
    I can't help with the editor, sorry I don't use TeXStudio, but it seems a strange request: you almost never need \par in a document and ${}$ similarly is somewhat dangerous to add automatically since {} in math mode typically affects spacing. – David Carlisle Sep 28 '17 at 18:12

1 Answers1

7

I don't know if you can edit existing buttons, but you can make new ones, and you can have them insert arbitrary code.

Step 1 -- make a macro

Go to Macros --> Edit macros, and make a new macro with the code you want inserted in the "LaTeX content" box:

new texstudio macro

The %| construct is a placeholder only, it indicates where the cursor is placed when you use this macro.

(See Help --> User manual, the section on "Personal macros". See also Defining New ShortCuts in TexStudio)

Step 2 -- add a new button

Go to Options --> Configure TeXstudio, and look in the Toolbars tab. The toolbar you want to modify is called "Central", so choose that in the first drop-down menu. In the second drop-down menu, choose "All menus". Find the macro you just created, and doubleclick to move it over to the toolbar:

toolbar modification

  • You can choose a different icon by right clicking on the toolbar entry and navigating to an image file. (I don't know where you can find the ones that TeXstudio uses.)

  • You can move items up and down by dragging with the mouse

Step 3 -- don't use it for what you've said you're going to use it for.

You don't really want to always use ${ .. }$ for inline math, for one thing it inhibits line breaking. And why use \par, and not just an empty line?

Torbjørn T.
  • 206,688