Pelican
Pelican

Reputation: 303

emacs org mod with math expression

I am using org-mod to take note of some of my work, I have recently switched from sublime where I was used to writing some mathjax snippet.

What would be the correct and easiest way of having this snippet rendered correctly (either in the buffer or if not possible, via C-c C-c or C-c C-e).

\hat{y} = \hat{\beta}_{0}+\hat{\beta}_{1}x_{1}+\hat{\beta}_{2}x_{2}+...+\hat{\beta}_{p}x_{p}

ps : in my .emacs conf file I don't have anything closely related to mathjax or Latex.

Kr,

Upvotes: 1

Views: 1651

Answers (1)

NickD
NickD

Reputation: 6402

Enclose the latex fragment in \( ... \) or \[ ... \]and do C-c C-x C-l (bound to org-toggle-latex-fragment). See the doc string of this function for argument usage.

In recent versions of org, you customize org-preview-latex-default-process to set it to the value of the backend you want. You need either dvipng, dvisvgm or ImageMagick as the backend. See also the doc string of the variable org-preview-latex-process-alist: it might help explain some things, although you don't have to do anything with it.

If these variables don't exist, you might be using an earlier version of org where the setup is different. If that's the case, then please post which version you are using: M-x org-version would tell you.

EDIT: in earlier versions, the function is called org-preview-latex-fragment and it's not bound to a key by default. You can call it with M-x org-preview-latex-fragment and you can get rid of the preview with C-c C-c. The backend setup is different as well: there is support for dvipng and ImageMagick only and the variables are different.

Upvotes: 2

Related Questions