Files
doom/snippets/latex-mode/Fraction auto

16 lines
388 B
Plaintext
Raw Normal View History

2025-11-16 15:47:31 +11:00
# key: //
# name: Fraction auto
# type: command
# condition: (and (texmathp) (quote auto))
# group: math
# --
(let ((numerator t))
(condition-case nil
(save-excursion
(backward-sexp)
(kill-sexp)
(delete-char 1))
(error (setq numerator 'nil)))
(insert "\\frac{" (if numerator (current-kill 0) "")
"}{}")
(backward-char (if numerator 1 3)))