emacs-latex-preview-server/texpngweb.el
2024-06-22 08:04:00 -06:00

21 lines
1 KiB
EmacsLisp

;; Sample emacs configuration for this setup
;; Adjust dpi in ./public/tex2png.sh
;; dvipng -D 350 looks good on my device (400dpi)
(if (eq system-type 'android)
(progn
(setq org-preview-latex-process-alist
'((texpngweb
:programs ("curl")
:description "tex > png"
:message "you need to install curl."
:image-input-type "tex"
:image-output-type "png"
:image-size-adjust (1.0 . 1.0)
;; This works in my pc, but not in android.
;; :latex-compiler ("curl -F \"file=@%f\" http://0.0.0.0:8000")
;; For some reason this works in android (and also on pc)
;; And for whatever reason image-converter still needs to be set
:latex-compiler ("curl -F \"file=@%f\" http://0.0.0.0:8000 && curl http://0.0.0.0:8000/tmp.png -o %O")
:image-converter ("curl http://0.0.0.0:8000/tmp.png -o %O"))))
(setq org-latex-create-formula-image-program 'texpngweb)))