1

I installed org-ref (via Melpa) to work with my bibliography entries in Org Mode. The installation seemed to be successful. I was able to add a citation with the command C-c ].

When I export to LaTeX with C-c C-e C-s l o a .pdf file is produced, but with the warning of an undefined reference. But the bibtex file is found and an entry with the bibtex key is available.

Here are my entries in the Emacs startup file (nearly unchanged to the recommended basic settings from the Github page):

    ;; org-ref
(setq reftex-default-bibliography '("~/Documents/Bibliography/references.bib"))

;; see org-ref for use of these variables
(setq org-ref-bibliography-notes "~/Documents/Bibliography/notes.org"
      org-ref-default-bibliography '("~/Documents/Bibliography/references.bib")
      org-ref-pdf-directory "~/Documents/Bibliography/Bibtex-Pdfs/")

(setq bibtex-completion-bibliography "~/Documents/Bibliography/references.bib"
      bibtex-completion-library-path "~/Documents/Bibliography/Bibtex-Pdfs"
      bibtex-completion-notes-path "~/Documents/Bibliography/helm-bibtex-notes")

;; open pdf with system pdf viewer (works on mac)
(setq bibtex-completion-pdf-open-function
  (lambda (fpath)
    (start-process "open" "*open*" "open" fpath)))

;; alternative
;; (setq bibtex-completion-pdf-open-function 'org-open-file)

(setq org-latex-pdf-process (list "latexmk -shell-escape -bibtex -f -pdf %f"))
(require 'org-ref)

An excerpt from my org mode file:

** Installed version
- emax64-26.3-20191225 cite:Freeman2015
- [[https://github.com/m-parashar/emax64][m-parashar / emax64]]

And the entry in the BibTeX File:

% Encoding: UTF-8
 
@Book{Freeman2015,
  author    = {Freeman, Eric},
  editor    = {Freeman, Eric [Verfasser/in] and Robson, Elisabeth [Verfasser/in] and Sierra, Kathy [Verfasser/in] and Bates, Bert and Schulten, Lars and Buchholz, Elke},
  publisher = {O'Reilly Verlag},
  title     = {Entwurfsmuster von Kopf bis Fuß},
  year      = {2015},
  address   = {[Erscheinungsort nicht ermittelbar]},
  isbn      = {9783955619879},
  note      = {1 Online-Ressource},
  file      = {:Freeman2015_EntwurfsmusterVonKopfBisFuss.pdf:PDF},
  groups    = {Erzeugungsmuster},
  keywords  = {Entwurfsmuster. Java 8. Software-Design},
  language  = {Deutsch},
  url       = {http://www.content-select.com/index.php?id=bib_view&ean=9783955619879},
}
 
@Comment{jabref-meta: databaseType:bibtex;}
 
@Comment{jabref-meta: grouping:
0 AllEntriesGroup:;
1 StaticGroup:Erzeugungsmuster\;0\;1\;0x8a8a8aff\;\;\;;
}

Thanks to NickD for his hint.

My bibliography link which is necessary for LaTeX export how Tyler mentioned. Perhaps the problem can be found here.

* Bibliographie
<<bibliography>>
[[bibliography:../../Documents/Bibliography/references.bib]]
  • It would make sense to add a small Org mode file and a small portion of your bibliography that exhibit the problem. That would help people try to duplicate the problem on their own. – NickD Sep 25 at 12:50
  • Thanks for adding the info: it should make it easier for somebody to figure out what is broken. – NickD Sep 25 at 19:28
0

Make sure you have a bibliography link in your document. Even with a defined default bibliography you need this for LaTeX export:

Citations

org-ref uses the bibliography link to determine which bibtex files to get citations from, and falls back to the bibtex files defined in the variable reftex-default-bibliography or org-ref-default-bibliography if no bibliography link is found. Note that you must include a bibliography link in your document if you are exporting your document to pdf; org-ref-default-bibliography is not used by the LaTeX exporter.

See also discussion here and here

| improve this answer | |
  • You are right but I already had a bibliography link in my org file. – tester Sep 25 at 19:11
  • Ok. It will be easier to debug if you can provide a complete org file, with all the data necessary to reproduce the problem, rather than excerpts. – Tyler Sep 25 at 20:08
0

I found a solution. I have to add an citation style too. For example>

<<bibliographystyle link>>
[[bibliographystyle:unsrt]]
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.