shaqtsui / prettify-math

emacs minor mode to view latex math, asicii math on fly
GNU General Public License v3.0
7 stars 1 forks source link

+OPTIONS: \n:t

[[./prettify-math-demo.gif]]

It's base on mathjax, refer mathjax for math formula related stuffs. Default math formula delimiters: | ~`~ | inline asciimath | | ~``~ | block asciimath | | ~$~ | inline latex | | ~$$~ | block latex |

** Prerequisite ~nodejs~ - used to run mathjax, if not available simple installation refer: [[https://nodejs.dev/download/package-manager][Installing Node.js]]

** Installation *** via straight.el

+begin_src elisp

(straight-use-package '(prettify-math :host nil :repo "https://github.com/shaqtsui/prettify-math" :files (:defaults "mathjax-jsonrpc.js")))

+end_src

*** or from ~melpa~

  1. add melpa in init.el if not available

    +begin_src elisp

    (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) (package-initialize)

    +end_src

  2. command: ~M-x package-refresh-contents RET~ ~M-x package-install RET prettify-math RET~

** Usage Enable in current buffer: ~M-x prettify-math-mode RET~, or globally: ~M-x global-prettify-math-mode RET~.

** Customization *** Customize ~prettify-math-default-scale~ for formula scale

*** Set delimiter before this module loaded. Code example in init.el:

+begin_src elisp

(setq prettify-math-delimiters-alist '(("$" tex) ("$$" tex block) (("\(" . "\)") tex block) ("`" asciimath) ("``" asciimath block))) (require 'prettify-math)

+end_src

** Compare with existing similar packges *** Existing similar packages:

*** why prettify-math: