# How should I write inline equations in Org Mode so they export to LaTeX properly?

I have a sentence with the words 42 m s^{-1}. When this is exported to LaTeX it exports as 42 m s$^{\text{-1}}$. How should I write it, or what flags should I set in the #+OPTIONS: line, so that it exports as 42 m s^{-1}?

Also, it is good to know that the dollar syntax $...$ is not always recommended in LaTeX (and the double dollar syntax, $$...$$, for displayed equations, in strongly discouraged). For further info see this and this question on TeX.SE.

Needless to say, Org-mode supports both $$...$$ and $...$. Try exporting this to LaTeX:

* Dollars
hello $E=mc^2$
* Parens
hello $$E=mc^2$$
* Double dollars
hello $$E=mc^2$$
* Brackets
hello $E=mc^2$

• Yes, but note that these all cause issues with pandoc, except for the $foo$ syntax. Oct 27 '14 at 1:35
• Oh hi there, mbork! :) I do have to wonder if org-mode would be able to transform double-dollar to the more proper $…$ as part of its export process. (It's more of a rhetorical wondering, I suppose—of course you can customize it :)) Oct 27 '14 at 3:04
• @mankoff: I'd consider this a bug in pandoc, then. Dollars (especially the double ones) are not proper LaTeX syntax. Oct 27 '14 at 7:49
• I'd like to point out the comment section of one of the linked answers: tex.stackexchange.com/questions/510/… Jul 29 '15 at 17:44

Just wrap it with the TeX-dollars:

$x^2$


exports to

...
$x^2$
...

• @Thriveth $ isn't going anywhere – see Frank's comment as linked above; Frank has been in a leadership position with LaTeX for many years now, so his word carries quite a bit of weight. Mar 31 '17 at 5:34 • You are arguing with the wrong guy... All I know is that $ is officially discouraged, and I simply guessed that could be the reason why someone else had downvoted this. I am not claiming to be knowledgeable or for that matter having an opinion about whether this is a good idea or not. Apr 7 '17 at 14:23
Actually, in this case where you are working with units, you might consider using the siunitx LaTeX package. After loading the package in your org file:
#+LaTeX_+HEADER: \usepackage{siunitx}

you can use \SI{42}{m.s^{-1}} in your text. This will make sure that the spaces between quantity and unit are appropriate, e.g. not allowing line breaks between any of the components. Moreover, the siunitx package also knows how to properly format numbers like 1.23e45 as 1.23 \times 10^{45}, etc.
• Shouldn't it be \SI{42}{\meters\per\second}? I love siunitx, but I don't think it works with pandoc and I have to be able to convert to Word... Oct 28 '14 at 12:55
• You can use either (see e.g. page 5 of the documentation, just above section 4). I personally think the explicit \meters\per\second way is too much work :-). Oct 28 '14 at 13:33