1

As the title says, inline math snippets such as $x+1$ are replaced during org latex export by \(x+1\). But, no one is writing inline math in LaTex files like this. Is there a way to tell Org to leave my dollars alone?

Context: the LaTeX file is collaborative and people are simply not used to \(...\) syntax.

2

You can hack away a fix by executing the following after loading ox-latex:

(defun org-latex-math-block (_math-block contents _info)
  "Transcode a MATH-BLOCK object from Org to LaTeX.
CONTENTS is a string.  INFO is a plist used as a communication
channel."
  (when (org-string-nw-p contents)
    (format "$%s$" (org-trim contents))))

This means every LaTeX export, for all of your files, will use $$ instead of \( ). More portable solutions would define a new derived backend.

For instructions, see: https://orgmode.org/manual/Advanced-Export-Configuration.html

1

Either @@latex:$x+1$@@ or src_latex{$x+1$} should work.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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