org-roam / org-roam-bibtex

Org Roam integration with bibliography management software
GNU General Public License v3.0
568 stars 47 forks source link

set prefix for created org file or separate directory #192

Closed fab6 closed 3 years ago

fab6 commented 3 years ago

Hi, currently the file naming is based on the bibtex key e.g. like zhouTotalRadiativeHeat2017.org.

Is there an option to add a general prefix to the naming e.g. like lit_ so the file name becomes lit_zhouTotalRadiativeHeat2017.org?

And is there an option to define a subdirectory to org-roam standard-directory where all these files are placed?

Thank you in advance! Fab

myshevchuk commented 3 years ago

Hi,

yes, both is possible with configuring the template appropriately. For ORB version <0.6 this can be achieved as follows:

(setq orb-templates
  (("r" "ref" plain (function org-roam-capture--get-point) ""
        ;; - files will be placed into "subdir" directory of org-roam-directory
        ;; - files will be prefixed with "lit_" prefix
        :file-name "subdir/lit_${citekey}"    ;; <= adjust the file name to your needs
        :head "#+TITLE: ${title}\n#+ROAM_KEY: ${ref}\n"
        :unnarrowed t)))

Please, consider reading README before opening new issues on GitHub. In particular, read carefully the section Getting Help. This question has been asked multiple times on Discourse and Slack. Thank you for your understanding.

fab6 commented 3 years ago

Hi, thank you for your quick reply and help! And yes, your are right, I did not read it carefully enough, now I see it... excuse for this.

myshevchuk commented 3 years ago

That's fine, no problem.