Math & Science ⇒ Dollar sign code
Dollar sign code
As most you can relate I find it very annoying that I have to type the dollar sign in my math text after I am done writing.So I am wondering if anyone has come up with a code that automatically puts the dollar sign when math lines are present in tex files.
Thank you,Tomas
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: 10359
- Joined: Mon Mar 10, 2008 9:44 pm
Dollar sign code
welcome to the board!
I'm not aware of any general solution. I know, that (if configured) TeX tries to switch the mode, even if displaying an error, when it encounters math mode control sequences. However, when should it switch back to text mode, in a reliable way? Letters can be variables, or products of variables, when would you decide that normal text starts?
I think delimiters for math mode are still required to distinguish modes. For example, a
-
in math mode (a minus) is not the same as a -
in text mode (a dash), which has a different width.Stefan
Dollar sign code
$
when writing inline math and then go back with left arrow key (or whatever it is correctly called...). This way I don't forget it.Regards
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Dollar sign code
I am used to proceed this way with ever kind of delimiter. So I rarely have problems with forgotten braces or similar stuff. But common editors support to keep track of delimiters by highlighting the content between them as soon as the cursor is placed correspondingly.cgnieder wrote:Not that it would be less typing but I always type in both$
when writing inline math and then go back with left arrow key (or whatever it is correctly called...). This way I don't forget it. […]
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Dollar sign code
Regards