0

I've been trying to find a fix for this for a few days now and it's driving me crazy, so any help would be amazing. I'm trying to set my emacs up for making maths notes using org-mode. However, I've run into several problems displaying equations within org-mode.

First, when I used c-c c-x c-l I got the error,

can't find 'latex' (you need to install programs: latex and dvipng.)

I managed to find a fix for this using the following code in my init file:

(setenv "PATH" (concat ":/Library/TeX/texbin/" (getenv "PATH")))
(add-to-list 'exec-path "/Library/TeX/texbin/")

but I now get a new error:

File "var/folders/z5/kbjq2cd50mv3fmzpwsr1s94h0000gn/T/orgtex905eux.dvi" wasn't produced. Please adjust 'dvipng' of 'org-preview-latex-process-alist'.

I've navigated to this file and found orgtex905eux.tex and manually converted this to a PNG using latex and dvipng in the terminal. As per link. And I noticed it adds a 1 to the end of the file name, but doesn't fix my problem.

Also I'm using mac OS.

2 Answers 2

1

The same happen to me, and it turned out to be an error in the formula.

For example:

Incorrect formula:
\begin{equation}
   y[x/e'] =
   \begin{cases}
   e' & \text{if x = y}\\
   y  & \text{if x \neq y}
   \end{cases}
   \end{equation}

Correct formula:
\begin{equation}
   y[x/e'] =
   \begin{cases}
   e' & \text{if x = y}\\
   y  & \text{if x $\neq$ y}
   \end{cases}
   \end{equation}

Notice the $\neq$ (correct) vs \neq (incorrect).

I recommend that you debug your formula bit by bit.

1
  • 1
    Welcome to tex.sx. Actually, the entire math expression within \text should be marked as math: $x = y$ and $x \neq y$. However, this doesn't really appear to answer the question. (But I can't answer it either.) Oct 24, 2020 at 15:45
0

Regarding the wasn't produced. Please adjust 'dvipng' of 'org-preview-latex-process-alist' error: if on Linux, you might be missing some packages. This fixed it for me:

sudo apt install texlive-latex-extra

Couldn't tell which of the many latex packages was the one I was missing, despite having latex and dvipng available. The Org manual (v9.5 retrieved 2022/08/20) says that those should be enough, though.

Credits

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .