# prettify-math **Repository Path**: shaqtsui/prettify-math ## Basic Information - **Project Name**: prettify-math - **Description**: emacs minor mode to prettify math formula, include asciimath, tex math via mathjax engine - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-10-02 - **Last Updated**: 2022-01-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #+OPTIONS: \n:t * Prettify math is a emacs minor mode to prettify math formulas. Note this project current only support mac & linux, NOT windows as a bug in jsonrpc. [[./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://gitee.com/shaqxu/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: - [[https://gitlab.com/latex-math-preview/latex-math-preview][latex-math-preview]] - [[https://github.com/aaptel/preview-latex][preview-latex(px)]] - [[https://github.com/yangsheng6810/org-latex-impatient][org-latex-impatient]] - [[https://github.com/TobiasZawada/texfrag][texfrag]] - [[https://gitlab.com/matsievskiysv/math-preview][math-preview]] *** why prettify-math: - on-fly image generate, no disk temp file - Responsive style(foreground/background color, size) base on surrunding text. - JIT render instead of AOT render, which can support large files. - Not only to support latex math expression, but also asciimath expression, in future other may supported. - prettify-math implemented as minor mode, make it works in all major modes.