Tunning org-latex-preview-impatient in Emacs

Posted on June 22, 2025
Tags:

Table of Contents

  1. Installation
  2. Org-latex-preview-impatient preview
    1. Inline Math
    2. Display Math
  3. Kelly Criterion
  4. Bayes’ theorem
  5. Shannon–Hartley theorem
  6. Maxwell’s equations (TBD)
  7. Curvature
  8. ROI, Return on Investment
  9. Limit definition of the constant e
  10. Least squares (TBD)
  11. EOQ
  12. Beta

Installation

Declare package install in packages.el, in Doom1 for instance:

(package! org-latex-impatient
  :recipe (:host github
           :repo "yangsheng6810/org-latex-impatient"
           :branch "master"))

Add env setting of NODE_OPTIONS for avoiding failure in parsing xml when tex2svg generates svg with deprecation warning in xml:

(use-package org-latex-impatient
  :defer t
  :hook (org-mode . org-latex-impatient-mode)
  :init
  (setq org-latex-impatient-tex2svg-bin
        ;; location of tex2svg executable
        (file-truename "~/node_modules/mathjax-node-cli/bin/tex2svg"))
  (setenv "NODE_OPTIONS" "--no-deprecation")
  (setq max-image-size nil))

Org-latex-preview-impatient2 preview

Open a .org file and insert content like following latex segements, then enable org-latex-impatient-mode by M-x org-latex-impatient-mode . img

Inline Math

We are aware that the solutions to ax2 + bx + c = 0 are $$x_{1},x_{2} = \frac{-b \pm \sqrt{b^{2} - 4ac}}{2a}$$

Display Math

$$x_{1},x_{2} = \frac{-b \pm \sqrt{b^{2} - 4ac}}{2a}$$

Kelly Criterion

$$f^* = \frac{bp - q}{b}$$

Bayes’ theorem

$$P(A|B) = \frac{P(B|A)* P(A))}{P(B)}$$

Shannon–Hartley theorem

$$C=B\log_{2}{(1+\frac{S}{N})}$$

Maxwell’s equations (TBD)

Curvature

$$\kappa(x) = \frac{ \left| f''(x) \right| }{ \left( 1 + \left(f'(x)\right)^2 \right)^{3/2} }$$

ROI, Return on Investment

$$\text{ROI} = \frac{\text{收益} - \text{投资成本}}{\text{投资成本}} \times 100\%$$

Limit definition of the constant e

$$e = \lim_{n \to \infty} \left( 1 + \frac{1}{n} \right)^n$$

Least squares (TBD)

EOQ

$$Q^* = \sqrt{\frac{2DS}{H}}$$

Beta

$$\beta = \frac{Cov(R_{i},R_{m})}{Var(R_{m})}$$

Footnotes

1 https://github.com/doomemacs/doomemacs

2 https://github.com/yangsheng6810/org-latex-impatient