nebhrajani · 2022-02-16 00:18
zelphirkaltstahl · 2022-02-16 11:11
This is to be expected for such FP code, but indeed great! I should have done the same … Didn't know about org-mode and literate programming though, when I started with SICP.
ourobo-ros · 2022-02-17 14:38
Anyone know why I can't get the latex to preview in the org file? I get:
org-compile-file: File "/tmp/orgtexelHBZc.dvi" wasn’t produced. Please adjust ‘dvipng’ part of ‘org-preview-latex-process-alist’.
zelphirkaltstahl · 2022-02-17 20:20
I think you need some configuration for that to work. Just copy pasting here what seems relevant from my config, without testing that separately:
```elisp
(setq org-preview-latex-default-process 'dvisvgm)
(setq org-preview-latex-process-alist
(quote
((dvipng :programs ("xelatex" "dvipng")
:description "dvi > png"
:message "you need to install the programs: xelatex and dvipng."
:image-input-type "dvi"
:image-output-type "png"
:image-size-adjust (1.0 . 1.0)
:latex-compiler ("xelatex -output-format dvi -interaction nonstopmode -output-directory %o %f")
:image-converter ("dvipng -fg %F -bg %B -D %D -T tight -o %O %f"))
(dvisvgm :programs ("xelatex" "dvisvgm")
:description "dvi > svg"
:message "you need to install the programs: xelatex and dvisvgm."
:use-xcolor t
:image-input-type "xdv"
:image-output-type "svg"
:image-size-adjust (1.7 . 1.5)
:latex-compiler ("xelatex -no-pdf -interaction nonstopmode -output-directory %o %f")
:image-converter ("dvisvgm %f -n -b min -c %S -o %O"))
(imagemagick :programs ("xelatex" "convert")
:description "pdf > png"
:message "you need to install the programs: xelatex and imagemagick."
:use-xcolor t
:image-input-type "pdf"
:image-output-type "png"
:image-size-adjust (1.0 . 1.0)
:latex-compiler ("xelatex -no-pdf -interaction nonstopmode -output-directory %o %f")
:image-converter ("convert -density %D -trim -antialias %f -quality 100 %O")))))
```
Of course you will need to have the tools installed in your system for that to work. Like `xelatex` and so on.