Skip to content

Instantly share code, notes, and snippets.

@natfarleydev
Created September 27, 2013 18:56
Show Gist options
  • Save natfarleydev/6733510 to your computer and use it in GitHub Desktop.
Save natfarleydev/6733510 to your computer and use it in GitHub Desktop.
Emacs functions to insert \sfrac{n}{m}
(defun insert-half ()
"Insert '\sfrac{1}{2} '"
(interactive)
(insert "\\sfrac{1}{2} "))
(defun insert-third ()
"Insert '\sfrac{1}{3} '"
(interactive)
(insert "\\sfrac{1}{3} "))
(defun insert-quarter ()
"Insert '\sfrac{1}{4} '"
(interactive)
(insert "\\sfrac{1}{4} "))
(global-set-key (kbd "C-c 2") 'insert-half)
(global-set-key (kbd "C-c 3") 'insert-third)
(global-set-key (kbd "C-c 4") 'insert-quarter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment