Last active
August 29, 2015 14:08
-
-
Save kai2nenobu/2757934b8bb5497bfb95 to your computer and use it in GitHub Desktop.
yatexのbegin-end型のコマンドに名前をつける
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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