Skip to content

Commit

Permalink
add citar
Browse files Browse the repository at this point in the history
  • Loading branch information
chens committed Nov 18, 2024
1 parent c61dfe7 commit 52e19ab
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
2 changes: 2 additions & 0 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@
(require 'init-anki)
(require 'init-date)
(require 'init-auto-space)
(require 'init-citar)
(require 'init-pdf)
(require 'init-epub)

;; Extra packages which don't require any configuration


Expand Down
54 changes: 54 additions & 0 deletions lisp/init-citar.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
;;; init-citar.el --- citar -*- lexical-binding: t -*-

;; Copyright (C) 2024 chens
;;
;; Version: 0.0.1
;; Keywords: citar
;; Author: chens
;; Package-Requires: ((emacs "24.4"))

;; This file is NOT part of GNU Emacs.

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

;;; Commentary:

;;

;;; Code:

(use-package citar
:custom
(org-cite-insert-processor 'citar)
(org-cite-follow-processor 'citar)
(org-cite-activate-processor 'citar)
(citar-bibliography org-cite-global-bibliography)
;; optional: org-cite-insert is also bound to C-c C-x C-@
:hook
(LaTeX-mode . citar-capf-setup)
(org-mode . citar-capf-setup)
:bind
(:map org-mode-map :package org ("C-c b" . #'org-cite-insert)))


(use-package citar-embark
:after citar embark
:no-require
:config
(citar-embark-mode)
(setq citar-at-point-function 'embark-act))

(provide 'init-citar)
;;; init-citar.el ends here
4 changes: 4 additions & 0 deletions lisp/init-local.el
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
bibtex-completion-library-path "~/Nutstore Files/Nutstore/bibliography/bibtex-pdfs"
bibtex-completion-notes-path "~/Nutstore Files/Nutstore/bibliography/helm-bibtex-notes")


(setq citar-bibliography '("~/Nutstore Files/Nutstore/bibliography/references.bib"))
(setq org-cite-global-bibliography '("~/Nutstore Files/Nutstore/bibliography/references.bib"))

;; open pdf with system pdf viewer (works on mac)
(setq bibtex-completion-pdf-open-function
(lambda (fpath)
Expand Down

0 comments on commit 52e19ab

Please sign in to comment.