aboutsummaryrefslogtreecommitdiff
path: root/bard-emacs-modules
diff options
context:
space:
mode:
authorBardofSprites <[email protected]>2026-04-21 17:01:59 -0400
committerBardofSprites <[email protected]>2026-04-21 17:01:59 -0400
commite2321043adb6b819fe374d13a48933d439cb7226 (patch)
tree9ddf8a1d57fe776ea966290739677cdd8656f440 /bard-emacs-modules
parent64ad15461ab8e9f115e46be3a85f017b0d461b7f (diff)
function for making bib entry
Diffstat (limited to 'bard-emacs-modules')
-rw-r--r--bard-emacs-modules/bard-emacs-writing.el22
1 files changed, 22 insertions, 0 deletions
diff --git a/bard-emacs-modules/bard-emacs-writing.el b/bard-emacs-modules/bard-emacs-writing.el
index 1daed2a..37a62a0 100644
--- a/bard-emacs-modules/bard-emacs-writing.el
+++ b/bard-emacs-modules/bard-emacs-writing.el
@@ -308,4 +308,26 @@
:ensure t
)
+(defun bard/create-bib-entry ()
+ (interactive)
+ (let* ((default-file (when (derived-mode-p 'dired-mode)
+ (dired-get-file-for-visit)))
+ (file (read-file-name "PDF: "
+ "~/Documents/Research Articles/"
+ default-file nil
+ (when default-file
+ (file-name-nondirectory default-file)))))
+ (find-file "~/Documents/bib/references.bib")
+ (goto-char (point-max))
+ (yas-expand-snippet
+ (format "@article{$1,
+ author = {$2},
+ title = {$3},
+ journaltitle = {$4},
+ year = {$5},
+ doi = {$9},
+ url = {$10},
+ file = {PDF:%s:application/pdf},
+}" file))))
+
(provide 'bard-emacs-writing)