In my .org
file I embedded a simple Latex segment:
$f(x) = x^2$
Then I use the following command to generate a preview for that segment:
org-toggle-latex-fragment
But I get an error:
org-compile-file: File "/var/folders/x2/zp6vz8z97xv48g97pht5_mrc0000gn/T/orgtexu9KnIy.dvi" wasn’t produced.
Please adjust ‘dvipng’ part of ‘org-preview-latex-process-alist’.
I tried to debug the issue:
- The file
/var/folders/x2/zp6vz8z97xv48g97pht5_mrc0000gn/T/orgtexu9KnIy.tex
exists - I can use
pdflatex
to create a file from the above.tex
without any issue. - I can also create a
dvi
from the above by just runninglatex orgtexu9KnIy.tex
. No error happens. When I run
dvipng orgtexu9KnIy
I get the following output:This is /usr/local/texlive/2017/bin/x86_64-darwin/dvipng (dvipng (TeX Live)) 1.15 Copyright 2002-2015 Jan-Ake Larsson [1]
And I have a file orgtexu9KnIy1.png
in the current folder. I'm suspicious bit wondering about the additional 1
in the file name.
Org expects the file name to be orgtexu9KnIy.png
and not orgtexu9KnIy1.png
.
The value of the variable org-preview-latex-process-alist
:
((dvipng :programs
("latex" "dvipng")
:description "dvi > png" :message "you need to install the programs: latex and dvipng." :image-input-type "dvi" :image-output-type "png" :image-size-adjust
(1.0 . 1.0)
:latex-compiler
("latex -interaction nonstopmode -output-directory %o %f")
:image-converter
("dvipng -fg %F -bg %B -D %D -T tight -o %O %f"))
(dvisvgm :programs
("latex" "dvisvgm")
:description "dvi > svg" :message "you need to install the programs: latex and dvisvgm." :use-xcolor t :image-input-type "dvi" :image-output-type "svg" :image-size-adjust
(1.7 . 1.5)
:latex-compiler
("latex -interaction nonstopmode -output-directory %o %f")
:image-converter
("dvisvgm %f -n -b min -c %S -o %O"))
(imagemagick :programs
("latex" "convert")
:description "pdf > png" :message "you need to install the programs: latex and imagemagick." :use-xcolor t :image-input-type "pdf" :image-output-type "png" :image-size-adjust
(1.0 . 1.0)
:latex-compiler
("pdflatex -interaction nonstopmode -output-directory %o %f")
:image-converter
("convert -density %D -trim -antialias %f -quality 100 %O")))
dvipng orgtexu9KnIy.dvi
, and see if that succeeds too? Also,please add the value oforg-preview-latex-process-alist
to your question.orgtexu9KnIy1.png
which has an additional1
in the filename, which is a bit strange. There are no other pngs in the same folder.