diff --git a/index.php b/index.php new file mode 100644 index 0000000..43c4521 --- /dev/null +++ b/index.php @@ -0,0 +1,18 @@ + diff --git a/public/index.php b/public/index.php deleted file mode 100644 index fb6d41b..0000000 --- a/public/index.php +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/public/tex2png.sh b/public/tex2png.sh deleted file mode 100755 index 73ba76b..0000000 --- a/public/tex2png.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -file="$1" -dpi="$2" -[ "$file" ] || exit 1 -out="${file%.tex}.png" - -makepng() { - latex -interaction nonstopmode "$file" >/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 d5a9183..7faaeb9 100644 --- a/texpngweb.el +++ b/texpngweb.el @@ -3,13 +3,13 @@ (if (eq system-type 'android) (progn ;; Android custom org-latex-preview (setq org-preview-latex-process-alist - '((texpngweb - :programs ("curl") - :description "tex > png" - :message "you need to install curl." - :image-input-type "tex" + '((dvipngweb + :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 ("") - :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))) + :latex-compiler ("curl -F \"file=@%f\" -F \"type=tex\" 0.0.0.0:8000 && curl 0.0.0.0:8000/tmp.dvi -o %O") + :image-converter ("curl -F \"file=@%f\" -F \"type=dvi\" -F \"dpi=%D\" -o %O 0.0.0.0:8000 && curl 0.0.0.0:8000/tmp.png -o %O")))) + (setq org-latex-create-formula-image-program 'dvipngweb)))