From f1033c3ea68149c030f2ffb5b83a7b5f8a8a53d4 Mon Sep 17 00:00:00 2001 From: tavo-wasd Date: Sat, 22 Jun 2024 00:54:56 -0600 Subject: [PATCH] emax smaple --- index.php => public/index.php | 0 tex2png.sh => public/tex2png.sh | 2 +- public/texpngweb.el | 14 ++++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) rename index.php => public/index.php (100%) rename tex2png.sh => public/tex2png.sh (77%) create mode 100644 public/texpngweb.el diff --git a/index.php b/public/index.php similarity index 100% rename from index.php rename to public/index.php diff --git a/tex2png.sh b/public/tex2png.sh similarity index 77% rename from tex2png.sh rename to public/tex2png.sh index b5c732d..554f09c 100755 --- a/tex2png.sh +++ b/public/tex2png.sh @@ -5,7 +5,7 @@ out="${file%.tex}.png" makepng() { latex -interaction nonstopmode "$file" >/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 150 -T tight -bg Transparent -o "$out" "${file%.tex}.dvi" >/dev/null 2>&1 || return 1 } makepng && echo "$out" || exit 1 diff --git a/public/texpngweb.el b/public/texpngweb.el new file mode 100644 index 0000000..96c01a8 --- /dev/null +++ b/public/texpngweb.el @@ -0,0 +1,14 @@ +;; Sample emacs configuration for this setup + +(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) + :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")))) + +(setq org-latex-create-formula-image-program 'texpngweb)