3

I have Latex code embedded in my org file.

*** Equations
\begin{equation}
h(x) = \theta_0 + \theta_1 x
\end{equation}

When I run C-c C-x C-l while my cursor is on the code, I get an empty box rendered on my file. Why is the code not rendering correctly?

EDIT 1: I have dvipng installed, and I have set org-latex-create-formula-image-program to dvipng.

(setq org-latex-create-formula-image-program 'dvipng)

I am using org mode version 8.2.10.

EDIT 2: I installed imagemagick and set org-latex-create-formula-image-program to it. No luck. When I run C-c C-x C-l, the command bar displays two messages in quick succession.

Creating image...1
PDF file /tmp/orgtex8421NqG.pdf wasn't produced
NJay
  • 51
  • 6

2 Answers2

2

Do you have dvipng or imagemagick installed? Depending on the setting of org-preview-latex-default-process (in versions of org-mode >= 9.0) or org-latex-create-formula-image-program (in earlier versions), you need one or the other (or you could install both).

NickD
  • 27,023
  • 3
  • 23
  • 42
2

The problem was fixed when I installed package texlive-full. I was missing some latex packages, which led to a white box being rendered instead of the equation.

The update on this question led me to question whether I had all required latex packages: Preview Latex Fragment in org mode : blank square shown

Sure enough, when I checked my logs in /tmp directory of my system, I was missing package ulem. On Linux Mint, latex package ulem can be installed by installing texlive-full.

sudo apt install texlive-full
NJay
  • 51
  • 6