Changing the template for inline math mode in TeXStudio

I used to follow Tobi's method for replacing the inline-math mode, until I found out how I can configure the default mapping. It's very easy actually :)

  1. Go to Options Menu > Tick "Show Advanced Options" at the bottom (inline with OK and Cancel buttons).
  2. In Texstudio Options list on the left, choose Menus.
  3. Go to Math (3rd top-level entry) > Inline math mode.
  4. Replace the command with this (just remove the space on both sides): $%|$

  5. That's it. The %| is used to denote that the cursor will be placed there :)

I am late to the party, but hope it helps someone. Thank you.


I don’t know if it is possible to change the predefined template, but you can add a user macro and assign a shortcut to it. To create the script go to Macros > edit macros (I got only the german version, but it should be named equally):

edit macros

and add a new “normal” script (mine is called “Inlinemathe”):

$%<math%>$

new script

you can replace math by whatever you want it is the text shown, when triggering the script. After creating the new script you must assign a short cut in Preferences > Short cuts > Macros

assign shortcut

You can read more about user macros and scripts in the manual, which is available via the Help menu …