# Replace the $$...$$ macro with the $...$ macros? - Prefer the way LaTeX lays it out, but $ are faster to write Is there a way to replace the $$...$$ macro with the $...$ macros? (and replace inline mathmode as well) I realised the only way I can write the \sum_{i=1}^{10} t_i is between the $...$ LaTeX maths-mode. It also seems to layout the maths nicer (bigger, with gaps). However, $$...$$ is faster to write... so is there a way to replace the $$...$$ macro, to act in the LaTeX fashion? • Nah, read that that mode isn't supported properly by LaTeX (ref: WikiBooks) – A T Oct 6 '11 at 0:49 • Caramdir: Well whichever is the one for inline want to replace$, and for newline replace $$– A T Oct 6 '11 at 0:50 • I don't think this is possible, since $...$ themselves are defined in terms of $$. Or am I wrong? Oct 6 '11 at 1:46
• You could use LuaTeX to write an "input transformation" to turn $$ into $ and $. Oct 6 '11 at 5:56 • Textmate's LaTeX mode turns $$[tab] into $ <cursor> $. Oct 6 '11 at 5:56

This is not a direct answer to your question but maybe a better solution: use snippet management to ease writing $...$ constructions. This of course requires an editor with support for snippets management.
You could create a snippet that activates when writing Tab (or some key command) and when it's activates it inputs   and places the cursor between them. In many snippets managers this snippet is simply: $1$  For an explanation of how YASnippet, a snippet manager for Emacs, works, see Working with templates. • That is what Textmate does (with -tab). I'd accept that answer if I had asked that question :) Oct 6 '11 at 6:17 • Since you are at it, replace it not with $...$ but with \begin{align*}...\end{align*}. It should be functionally equivalent, easier to read and transform into something else (want numbering? Remove the *. Want to display two equations side-by-side? Just do it!) Oct 6 '11 at 7:11 • I use TeXWorks. Is there a feature like this for it? – A T Oct 6 '11 at 15:19 • @AT Dunno. Maybe that is for another question. – N.N. Oct 6 '11 at 15:22 • N.N: Could you please illustrate a MWE if possible? Maybe rendering $...$ from typing  and automatically placing the cursor ready for typing inside the $cursor$ mode. Oct 9 '11 at 10:08 Personally, I think that you should just get into the habit of typing $ and $ as quickly as possible and I think that you'll find that you soon develop the right "muscle memory" that it becomes as fast as typing $$. But if you want to do a one shot conversion, then I have a script that might help you. I wrote it a while ago, probably when I was in a similar circumstance (the details are hazy in my memory) and wanted to convert my old files. I still use it when I get sent something by a collaborator or student that uses $$. You can find it from my website, at https://github.com/loopspace/debuck (The name is from the American word "buck" for "dollar".) No it is not possible to redefine them the way you want. However, if you write your maths correctly you can use either of them without any problem. Consider this code: \documentclass{article} \begin{document} \fbox{ \begin{minipage}{5cm} This is a test $$\sum_{i=1}^{10} t_i$$ and $$\sum_{i=1}^{10} t_i$$ and another \end{minipage}} \fbox{ \begin{minipage}{5cm} This is a test $\sum_{i=1}^{10} t_i$ and $\sum_{i=1}^{10} t_i$ and another \end{minipage}} %% This will make a slightly different layout \fbox{ \begin{minipage}[t]{5cm} This is a test $$\sum_{i=1}^{10} t_i$$ and $$\sum_{i=1}^{10} t_i$$ and another \end{minipage}} \fbox{ \begin{minipage}[t]{5cm} This is a test $\sum_{i=1}^{10} t_i$ and $\sum_{i=1}^{10} t_i$ and another \end{minipage}} \fbox{ \begin{minipage}{5cm} This is a test \math x=y+5 \endmath\ and \ldots This is a test x=y+5\$ and \ldots
This is a test $$x=y+5$$ and \ldots

The first two boxes are identical, as they have been written correctly as a single paragraph. The second one the LaTeX way, as you observed in your question is a bit "loose". If you are aware of these differences you can use $$ without any issues. For inline math I always use  and so far it hasn't caused the universe to collapse into a black hole! Caveat: If you use any maths packages or amsmath you will be well advised to rather stay with $..$, although for the example above just using usepackage{amsmath} will provide consistent results for both cases, but will fail if you use the option fleqn. See also Is  ...  okay to use, while$$ ... $$is not recommended? and Why is $...$ preferable to$$ ... $$?. • Every guide I've seen has said to avoid$$...$$due to a variety of issues, yet ... doesn't seem to be mentioned as much. ctan.org/pkg/l2tabu-english for example. Are you going to break packages like the AMS ones by using the plain-tex math mode? Oct 6 '11 at 2:13 • @Canageek You cannot break a package by using it, but you run the risk of inconsistent spacing. In my first example everything is one paragraph and hence there are no issues. Oct 6 '11 at 2:21 • @Canageek: You will certainly break parts of of amsmath like fleqn. You will also probably break some packages that modify math-mode layout (like breqn). \qedhere in equations will also stop working correctly. So I guess you should only use $$ if you really know what you are doing. Oct 6 '11 at 2:22