Math & Science ⇒ Quick way to nest within dollar signs?
-
- Posts: 3
- Joined: Mon Apr 18, 2011 2:14 am
Quick way to nest within dollar signs?
So I just downloaded Texniccenter today (lyx was giving me a headache with the lack of fine control I had).
I'm starting to type my thesis where I have to put in a LOT of superscripts and subscripts just among my normal text. So I've assigned keyboard shortcuts to both of those and they're handy enough. But then what really slows progress is having to then click on either side of them and put in a $ sign every single time. I've searched and searched and gone through the documentation but can't find a keyboard shortcut (or make one) that will simply nest dollar signs around my super or subscripts...
I'd love to be able to just type something like "ctrl+m ctrl+= 2" and have $_{2}$ pop up... it would save me a whole lot of time.
Cheers
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Quick way to nest within dollar signs?
welcome to the board!
It seems a bit strange to me to put just superscripts and subscripts in math mode, instead of complete expressions. What comes before? Text or math? Do you use normal upright letters for names of variables? If that's the case, variables are hard to distinguish from normal text. Just imagine products. What's meant by abs? A product a*b*s, an operator abs or a "word" abs?
It's very common to use an italic font for variables. Just have a look at math or other science books.
I guess it would be good for your thesis to put complete math expressions in math mode.
It doesn't answer the shortcut question but I hope it helps. At least, you might need ness dollor signs.
Btw. you could use \( ... \) instead of $...$. If you use a shortcut, it's typed the same but is better readable. And, there are keyboard shortcut tools which also can be used with LaTeX editors.
Stefan
-
- Posts: 3
- Joined: Mon Apr 18, 2011 2:14 am
Quick way to nest within dollar signs?
To give you an example of what a fairly typical sentence in my thesis looks like:
Code: Select all
Oxygen 2$p_{y}$ orbitals have $\pi$-type interaction
with the metal cations in Mn$O_{2}$ and IrO$_{2}$
($d^{5}$ valence) and are aligned perpendicular
to the M$_3$O trigonal planes.

If there's no way to make a shortcut for \("script"\) or $"script"$ I guess I'll probably just end up mapping "$" to another key somehow.
What do you think?
Cheers
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Quick way to nest within dollar signs?
Code: Select all
\documentclass{article}
\usepackage[version=3]{mhchem}
\begin{document}
\ce{MnO2} and \ce{IrO2}
\end{document}
-
- Posts: 3
- Joined: Mon Apr 18, 2011 2:14 am
Quick way to nest within dollar signs?
Thanks that's useful. I can see how it would be extremely desirable for someone who had to type in a lot of long chemical formalae, but it unfortunately only solves part of my problem and very frequently typing \ce{} is about as time-consuming as $$.josephwright wrote:Use the mhchem package
If anyone is interested (googling in years to come?), I came by a solution in TeXnicCenter (1.0 stable version, I believe 2.0 will be more easily custimised) that suits my needs perfectly:
Going to insert -> own text modules -> manage text modules
Deleted all other modules.
Made new one putting in $ before cursor and same after.
Then went to tools -> customise -> keyboard (tab)
found insert own text module and mapped it to ctrl-'l'.
Now if I want to type $^{2}$ it's far more efficient: ctrl-'l' ctrl-'=' '2'. This can be done surprisingly fast, has increased my productivity and sated my frustration.
The own text modules is useful too for longer specialised things you use less frequently. Make more and you can map them to alt-'i' 'm' then whatever number it is. I periodically need to highlight and colour parts of my text red for editing purposes for example, and this makes it easier.
Thanks for your input guys, I learned quite a bit in this process.

-
- Posts: 1
- Joined: Thu Jul 17, 2025 11:01 am