better defaults and fix typo

This commit is contained in:
tavo-wasd 2024-06-22 08:04:00 -06:00
parent b4c4c8339e
commit d9dafb4ab8
2 changed files with 20 additions and 16 deletions

View file

@ -5,7 +5,7 @@ out="${file%.tex}.png"
makepng() { makepng() {
latex -interaction nonstopmode "$file" >/dev/null 2>&1 || return 1 latex -interaction nonstopmode "$file" >/dev/null 2>&1 || return 1
dvipng -D 150 -T tight -bg Transparent -o "$out" "${file%.tex}.dvi" >/dev/null 2>&1 || return 1 dvipng -D 200 -T tight -bg Transparent -o "$out" "${file%.tex}.dvi" >/dev/null 2>&1 || return 1
} }
makepng && echo "$out" || exit 1 makepng && echo "$out" || exit 1

View file

@ -1,5 +1,9 @@
;; Sample emacs configuration for this setup ;; 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 (setq org-preview-latex-process-alist
'((texpngweb '((texpngweb
:programs ("curl") :programs ("curl")
@ -11,7 +15,7 @@
;; This works in my pc, but not in android. ;; This works in my pc, but not in android.
;; :latex-compiler ("curl -F \"file=@%f\" http://0.0.0.0:8000") ;; :latex-compiler ("curl -F \"file=@%f\" http://0.0.0.0:8000")
;; For some reason this works in android (and also on pc) ;; 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") :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")))) :image-converter ("curl http://0.0.0.0:8000/tmp.png -o %O"))))
(setq org-latex-create-formula-image-program 'texpngweb)))
(setq org-latex-create-formula-image-program 'texpngweb)