diff --git a/public/index.php b/public/index.php index dea88ad..fb6d41b 100644 --- a/public/index.php +++ b/public/index.php @@ -1,6 +1,7 @@ /dev/null 2>&1 || return 1 - dvipng -D 200 -T tight -bg Transparent -o "$out" "${file%.tex}.dvi" >/dev/null 2>&1 || return 1 + dvipng -D "$dpi" -T tight -bg Transparent -o "$out" "${file%.tex}.dvi" >/dev/null 2>&1 || return 1 } makepng && echo "$out" || exit 1 diff --git a/texpngweb.el b/texpngweb.el index 17699de..d5a9183 100644 --- a/texpngweb.el +++ b/texpngweb.el @@ -1,9 +1,7 @@ -;; Sample emacs configuration for this setup -;; Adjust dpi in ./public/tex2png.sh -;; dvipng -D 350 looks good on my device (400dpi) +;; Sample emacs configuration (if (eq system-type 'android) - (progn + (progn ;; Android custom org-latex-preview (setq org-preview-latex-process-alist '((texpngweb :programs ("curl") @@ -12,10 +10,6 @@ :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")))) + :latex-compiler ("") + :image-converter ("curl -F \"file=@%f\" -F \"dpi=%D\" http://0.0.0.0:8000 && curl http://0.0.0.0:8000/tmp.png -o %O")))) (setq org-latex-create-formula-image-program 'texpngweb)))