tmalsburg/helm-bibtex

About the cons cell for setting the entries of `bibtex-completion-bibliography`.

hongyi-zhao opened this issue · 6 comments

Here says the following:

 If the bib file has a different name, use a cons cell ("orgfile.org" . “bibfile.bib") instead:

(setq bibtex-completion-bibliography
      '("/path/to/bibtex-file-1.bib"
        "/path/to/org-bibtex-file.org"
        ("/path/to/org-bibtex-file2.org" . "/path/to/bibtex-file.bib")))

I'm so confused on the above example. Specifically, why shouldn't I write it in the following form:

(setq bibtex-completion-bibliography
      '(("/path/to/bibtex-file-1.bib" . "/path/to/org-bibtex-file.org")
        ("/path/to/org-bibtex-file2.org" . "/path/to/bibtex-file.bib")))

Regards,
HY

In the example, there are three sources of entries

  1. /path/to/bibtex-file-1.bib
  2. /path/to/org-bibtex-file.org
  3. /path/to/org-bibtex-file2.org which has the same entries as /path/to/bibtex-file.bib

In your example there are only two sources of entries.

3\. `/path/to/org-bibtex-file2.org` which has the same entries as `/path/to/bibtex-file.bib`

Are the following two forms equivalent?

("/path/to/org-bibtex-file2.org" . "/path/to/bibtex-file.bib")
("/path/to/bibtex-file.bib" . "/path/to/org-bibtex-file2.org" )

Are the following two forms equivalent?

No, you need to list the .org file first and then the corresponding .bib file as in the example given in the documentation.

No, you need to list the .org file first and then the corresponding .bib file as in the example given in the documentation.

  1. Do you mean the order does matter here, so the cons cell is needed instead of a list?
  2. Is this specific order requirement a contrived rule or needed by the nature of the org-mode itself?
  1. Do you mean the order does matter here, so the cons cell is needed instead of a list?

A cons cell is needed if you're using org-bib, and the order matters.

  1. Is this specific order requirement a contrived rule or needed by the nature of the org-mode itself?

We needed to choose one of the two possible orders ('org, bib' or 'bib, org') and the former ('org, bib') seemed more natural since the org-bib file is the primary source of truth in these setups.

Thank you for your explanation. Got it.