diff options
-rw-r--r-- | lisp/init-bib.el | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/init-bib.el b/lisp/init-bib.el index 8cc4a1a..aa4cd6b 100644 --- a/lisp/init-bib.el +++ b/lisp/init-bib.el @@ -18,6 +18,7 @@ (add-hook 'bibtex-clean-entry-hook 'km/bibtex-pages-use-double-hyphen) (add-hook 'bibtex-clean-entry-hook 'km/bibtex-remove-doi-leader) (add-hook 'bibtex-clean-entry-hook 'km/bibtex-set-coding-system) +(add-hook 'bibtex-clean-entry-hook 'km/bibtex-remove-entry-space) (defvar km/bibtex-unimportant-title-words '("a" "aboard" "about" "above" "absent" "across" "after" "against" @@ -94,6 +95,20 @@ all other words unless they are protected by brackets." (defun km/bibtex-set-coding-system () (set-buffer-file-coding-system 'utf-8)) +(defun km/bibtex-remove-entry-space () + "Remove space in entry header. +For example, convert + + @article { + +to + + @article{" + (save-excursion + (bibtex-beginning-of-entry) + (when (looking-at "@\\w+\\(\\s-+\\)") + (replace-match "" nil nil nil 1)))) + (defun km/bibtex-pages-use-double-hyphen () "Use double hyphen for page range." (interactive) |