I have notes containing many of the following type of LaTeX fragments

$p$-adic ... $n$-th ...

But org-mode exports them as literal dollar sign instead of math. The problem seems to be the - directly following the second dollar sign.

How can I change this behavior?

2 Answers 2


Change the syntax of character - from symbol to punctuation in org-mode. You can do that by:

(defun my-org-change-minus-syntax-fun ()
  (modify-syntax-entry ?- "."))

(add-hook 'org-mode-hook #'my-org-change-minus-syntax-fun)

You can add these lines to your init file.

Note that I have running that setup for ages now with no relevant negative effects.


Org-mode translates $n$ to \(n\) in latex. You can also directly write \(n\)-doc in the org file and it should export just fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.