diff --git a/citar.el b/citar.el index c92058ed..8e5ed9cd 100644 --- a/citar.el +++ b/citar.el @@ -345,6 +345,11 @@ always prompt to select." (function-item citar-open-notes) (function-item citar-open-note)))) +(defcustom citar-bibtex-no-export-fields nil + "A list of fields that should be ignored when exporting BibTeX entries." + :group 'citar + :type '(repeat string)) + ;;;; File, note, and URL handling (defcustom citar-open-resources '(:files :links :notes :create-notes) @@ -1676,6 +1681,12 @@ including the citekeys, is maintained in Zotero with Better BibTeX." (dolist (bib-file bibtex-files) (insert-file-contents bib-file)) (bibtex-search-entry citekey) + (dolist (field citar-bibtex-no-export-fields) + (let ((position (bibtex-search-forward-field + field t))) + (when position + (delete-region (caar position) + (car (last position)))))) (let ((beg (bibtex-beginning-of-entry)) (end (bibtex-end-of-entry))) (buffer-substring-no-properties beg end)))))