Skip to content

Instantly share code, notes, and snippets.

@kai2nenobu
Last active August 29, 2015 14:08
Show Gist options
  • Save kai2nenobu/2757934b8bb5497bfb95 to your computer and use it in GitHub Desktop.
Save kai2nenobu/2757934b8bb5497bfb95 to your computer and use it in GitHub Desktop.
yatexのbegin-end型のコマンドに名前をつける
(defun YaTeX-define-begend-key-with-name (key env &optional map)
"Define YaTeX-make-begin-end command with name and bind it."
(let ((func (intern (format "YaTeX-make-begin-end-%s" env))))
(fset func
`(lambda (arg)
,(format "Make LaTeX environment command of \\begin{%s} ... \\end{%s}."
env env)
(interactive "P")
(YaTeX-insert-begin-end ,env arg)))
(YaTeX-define-key key func map)))
(cl-loop for (key envname)
in '(("ba" "align") ("bc" "center") ("bd" "document") ("bD" "description")
("be" "enumerate") ("bE" "equation") ("bf" "frame") ("bg" "gather")
("bi" "itemize") ("bl" "flushleft") ("bm" "minipage") ("bt" "tabbing")
("bT" "tabular") ("b\^t" "table") ("bp" "picture") ("bq" "quote")
("bQ" "quotation") ("br" "flushright") ("bv" "verbatim") ("bV" "verse"))
do (YaTeX-define-begend-key-with-name key envname))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment