Org-Roam-Bibtext when there is no document

Hi, I just started using the extensions to Org Roam and it looks great.

I have an interesting issue. When I want to create a new note for a bibliography entry that has a document everything goes ok. But, when I want to do the same for a physical document without a link to the pdf, the system forces me to enter something. This is fine as I add something and then later remove it from the header.

Is there a way to stop this behaviour?

Hi,

What is it physical document ?

Books! The stuff we read before we had computers :slight_smile:

1 Like

@danderzei Hi!

First of all Org Roam BibTeX (without trailing “T”).
Second, it’s not very clear what templates you are using and even what exactly you are doing. So I’ll try to guess.

As soon as there are any wildcard expansions in your template, the system will “force” you to enter something if it cannot retrieve it from the BibTeX file. It’s by design and there is no way for a computer to guess your intentions. If you told it to expand wildcards, it will expand them or ask you to provide the desired expansion by typing it manually. Of course, it is possible to tell the computer to silently insert nothing if it doesn’t find anything, but that is not implemented currently. And I’m personally always suspicious when computers do things silently. If you are interested in such a feature, please open a feature request on GitHub and provide a link to this forum thread there.

Since you are talking about pdf links, I assume you have the following or similar in your configuration file:

(setq orb-templates
      '(("r" "ref" plain (function org-roam-capture--get-point)
         ""
         :file-name "${citekey}"
         :head "#+TITLE: ${citekey}: ${title}\n#+ROAM_KEY: ${ref}

- tags ::
- keywords :: ${keywords}

* ${title}
:PROPERTIES:
:Custom_ID: ${citekey}
:URL: ${url}
:AUTHOR: ${author-or-editor}
:NOTER_DOCUMENT: %(orb-process-file-field \"${citekey}\")  ;; <= this part requests a pdf link
:NOTER_PAGE:
:END:")))

To currently solve your issue, simply create another template that will not have the wildcard expansions you do not want:

(setq orb-templates
      '( ;; template for digital documents
        ("r" "ref" plain (function org-roam-capture--get-point)
         ""
         :file-name "${citekey}"
         :head "#+TITLE: ${citekey}: ${title}\n#+ROAM_KEY: ${ref}

- tags ::
- keywords :: ${keywords}

* ${title}
:PROPERTIES:
:Custom_ID: ${citekey}
:URL: ${url}
:AUTHOR: ${author-or-editor}
:NOTER_DOCUMENT: %(orb-process-file-field \"${citekey}\")
:NOTER_PAGE:
:END:")

        ;; template for old-fashioned physical documents and information carriers
       ("p" "books" plain (function org-roam-capture--get-point)
                ""
                :file-name "${citekey}"
                :head "#+TITLE: ${citekey}: ${title}\n#+ROAM_KEY: ${ref}
- tags ::
- keywords :: ${keywords}")))
3 Likes

Tanks for taking the time to provide that config.

That would solve the issue.

I am still a bit confused about workflow with all the various packages. I read all the blog posts and manual, but they only tell me how to configure the software, not use cases.

How do I activate these templates when in helm-bibtex?

For books, I do essentially the same flow as @mancub describes here. Obviously, there is no PDF involved, so it is something like this:

  1. Add a book’s bibliographic information manually in zotero -> .bib updated via Better BibTex for Zotero plugin
  2. Open helm-bibtex
  3. Find the book in helm
  4. hit f9 (Which is edit notes - opens up org-roam capture template I have setup)
  5. Take notes

@danderzei, when you have several templates, you will be prompted to choose one when creating a note.

Thanks for your help. I only just found time to play with it and it works mostly (you missed one " at the end).

When I use these templates, it asks to me provide citekey.

Physical books are not old fashioned. They are superior to ebooks as the batteries never run out :slight_smile:

This is my init file (under note-taking and referencing)

P:)

Not at all. Thank you, I fixed it for future references.

Of course it does! You have the keyword =key= set for expansion (“preformatting”). Org Roam BibTeX will expand any ${=key=} and %^{=key=} occurrences in your template, provided it is able to retrieve the citation key from your BibTeX file. Since you did not set citekey for preformatting, it will not try to expand it and the org-roam-capture mechanism will prompt you to supply values for ${citekey} and/or %^{citekey} wildcards. From the ORB’s point of view, citekey and =key= are synonyms—they both point ORB to retrieve the citation key—but they are surely not the same word!

Here you have two options:

  1. Set citekey for preformatting (setq orb-preformat-keywords ("citekey" ...))
  2. Keep preformatting of =key= and replace any citekey with =key= wildcards in your templates

The superiority of paper books is questionable, but they definitely have their own benefits. With respect to durability (“batteries”), stone carvings are far more superior. They have been proven to be able to store information for tens of thousands of years. Yet the information density, read/write speeds and mobility they provide are at best mediocre :slight_smile: