GeneralAutomate Braces around Subscripts and Superscripts

General information and discussion about TeXnicCenter
Post Reply
Mikemania
Posts: 2
Joined: Tue Feb 21, 2012 4:48 pm

Automate Braces around Subscripts and Superscripts

Post by Mikemania »

Hello everybody,

does anyone know whether it is possible to automate TexnicCenter so that
  1. when I type _ it will give me _{} and put the cursor in between the braces?
  2. when I type ^ it will give me ^{} and put the cursor in between the braces?
Any help is much appreciated.


Cheers,
Mike

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

MartinC
Posts: 153
Joined: Wed Jan 17, 2007 10:09 pm

Re: Automate Braces around Subscripts and Superscripts

Post by MartinC »

You could assign a keyboard shortcut to it. Go in the Customize\Keyboard menu and assign shortcuts to Math\^ and Math\_
Mikemania
Posts: 2
Joined: Tue Feb 21, 2012 4:48 pm

Re: Automate Braces around Subscripts and Superscripts

Post by Mikemania »

Thanks Martin, this works just perfectly. For example, if I assign ^ to ^ in the shortcut menu you mentioned, it will actually give me ^{}, and place the cursor between the brackets, which is exactly what I needed. Again, thanks alot!
MartinC
Posts: 153
Joined: Wed Jan 17, 2007 10:09 pm

Re: Automate Braces around Subscripts and Superscripts

Post by MartinC »

You're welcome!
Post Reply