better defaults and fix typo
This commit is contained in:
parent
b4c4c8339e
commit
d9dafb4ab8
2 changed files with 20 additions and 16 deletions
|
@ -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
|
||||||
|
|
34
texpngweb.el
34
texpngweb.el
|
@ -1,17 +1,21 @@
|
||||||
;; 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)
|
||||||
|
|
||||||
(setq org-preview-latex-process-alist
|
(if (eq system-type 'android)
|
||||||
'((texpngweb
|
(progn
|
||||||
:programs ("curl")
|
(setq org-preview-latex-process-alist
|
||||||
:description "tex > png"
|
'((texpngweb
|
||||||
:message "you need to install curl."
|
:programs ("curl")
|
||||||
:image-input-type "tex"
|
:description "tex > png"
|
||||||
:image-output-type "png"
|
:message "you need to install curl."
|
||||||
:image-size-adjust (1.0 . 1.0)
|
:image-input-type "tex"
|
||||||
;; This works in my pc, but not in android.
|
:image-output-type "png"
|
||||||
;; :latex-compiler ("curl -F \"file=@%f\" http://0.0.0.0:8000")
|
:image-size-adjust (1.0 . 1.0)
|
||||||
;; For some reason this works in android (and also on pc)
|
;; This works in my pc, but not in android.
|
||||||
: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")
|
||||||
:image-converter ("curl http://0.0.0.0:8000/tmp.png -o %O"))))
|
;; For some reason this works in android (and also on pc)
|
||||||
|
;; And for whatever reason image-converter still needs to be set
|
||||||
(setq org-latex-create-formula-image-program 'texpngweb)
|
: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)))
|
||||||
|
|
Loading…
Reference in a new issue