Hot answers tagged

6

I think you need to put the local variables in two places, which is the org file and the bib file. The issue is that the notes functions are called while the bibtex buffer is active, so the local variables in the org file do not affect them. In my org file I put something like * File Local Variables # Local Variables: # org-ref-bibliography-notes: "/Users/...


4

The order of the components of the key are hard-coded, so you can't change them with a user option. However, you can re-write the function to set the order you want. You need to load your modified function after the original version, so your modification will replace it. The following code does this: (eval-after-load "bibtex" '(defun bibtex-generate-...


4

Helm Bibtex entries are presented in the reverse of the order in which they appear in your .bib file: https://github.com/tmalsburg/helm-bibtex/issues/21 You can reverse this order with the following (taken from the linked thread). Put this in your .emacs: (eval-after-load "helm-bibtex" '(advice-add 'bibtex-completion-candidates :filter-...


2

Here's a basic function to look up the entry and title based on the citation at point (bibtex-completion is a dependency of org-ref): (defun my/print-reference-title () "Print the title to the reference at point in the minibuffer." (interactive) (message (assoc-default "title" (bibtex-completion-get-entry (org-...


2

Suppose instead of putting all your reagents in one file, and then looking them up you use a syntax like: #+attr_org: :type reagents | Tween 20 | Sigma-Aldrich | batch-1 | | acetone | Fisher | 3456 | in your notebook entries. then, you can loop through your notebook files and collect them, and use that information in a completion tool like helm. ...


2

In a similar approach to @giordano, I would suggest you have a look at the excellent Org-Ref, which is a collection of org-mode modules for citations, cross-references, bibliographies in org-mode and useful bibtex tools; together with Helm-Bibtex, which can be used in unison with org-ref to search and manage your bibliographies. With your insert reference ...


2

To check if a field exists, one approach is: (defun bibtex-field-exists-p (field) (save-excursion (bibtex-beginning-of-entry) (let ((entry (bibtex-parse-entry))) (assoc field entry)))) If the field is missing, you could do something like: (unless (bibtex-field-exists-p "journal") (bibtex-make-field '("journal" nil "missing" nil)))


2

You can add something like this to your init file to do that. (helm-add-action-to-source "Copy formatted citation(s)" (lambda (_) (kill-new (mapconcat 'identity (cl-loop for key in (helm-marked-candidates) collect (org-ref-format-entry key)) "\n\n"))) helm-...


2

You have to allow frame breaking by adding the corresponding Beamer option as an Org property to the slide heading: * References :PROPERTIES: :BEAMER_opt: allowframebreaks,label= :END: bibliographystyle:unsrt bibliography:/path/to/my.bib


2

Org-ref supports standard bibtex and biblatex as far as I know. So far neither of those has been a limitation.


2

Take a look at the documentation of org-ref-get-pdf-filename-function. You can set it to either org-ref-get-mendeley-filename or org-ref-get-pdf-filename-helm-bibtex. Both the variants support Mendeley file fields.


2

You can do this to add all the .bib files in that directory: (require 'f) (setq org-ref-default-bibliography (f-files "~/Dropbox/Bib" (lambda (f) (f-ext? f "bib"))))


2

It is possible to use a different backend than helm-bibtex which offers different sorting options. The org-ref-helm-cite backend allows you to sort by key, year and first author lastname (both ascending and descending) with key bindings. You type M- and then you get a menu to select the sort type and direction. It is not a well-used feature even by me, so ...


2

I had the same problem. In my case, it was fixed by setting org-ref-get-filename-function: (setq org-ref-get-pdf-filename-function (lambda (key) (car (bibtex-completion-find-pdf key))))


1

I could succesfully config org-roam-bibtex after a lot of tries. This is my config if someone finds useful. I copied all the config from https://rgoswami.me/posts/org-note-workflow/ The part that gave me an issue is the org-ref-default-bibliography which must be a list even if you have only one directory for your bibtex file (otherwise it will throw you an ...


1

You seem to be on a MAC, but the PDF key in the bibtex contains a Windows path. Maybe Zotero should export differently? Not sure if this helps but I setup the variable (setq bibtex-completion-library-path "~/cloud/Papers/") to the path which contains all my papers. And then the bibtex entries only have the name of the file (with no path) in them. Given ...


1

If you know the bibtex key you want to cite then you can use org-insert-link to do this. Usually that is bound to C-c C-l, you will be prompted for what kind of link, you can choose cite (the capitalization is a little annoying and you might have to figure out how to not get Cite with this. I use ivy, and I have to toggle the case sensitivity, and search for ...


1

As stated in the comments, the statement (setq-default case-fold-search nil) conflicts somehow with the org-ref-open-bibtex-notes. The emacs wiki mentions that case-fold-search set to nil means that searches are case-sensitive, and non-nil means searches are case-insensitive. This variable affects how lots of programs work (as in this case). On the final ...


1

You may want to change the default citation type in your init.el file to the one you use a lot, e.g.: (setq org-ref-default-citation-link "citep") C-u is for a universal-argument in regular emacs. I think it is bound to Spc-u in Spacemacs. Maybe typing that inside the helm window will lead to alternate citation types.


1

from the org-ref manual: Controlling link messages and tooltips Org-ref is setup to provide messages in the minibuffer when your cursor is on a link, and tooltips when your mouse hovers over a link. If this is distracting you can turn it off by putting this in your init file: (setq org-ref-show-citation-on-enter nil) Alternatively, you can turn this on ...


1

I am beginning to suspect that, in Emacs, the best way to find out answers is to look though the source code... Looking through the code of org-export-as reveals the answer: org-export-expand-include-keyword.


1

You could use the amusingly named function (org-org-export-as-org), which will export to a buffer named *Org ORG Export* with all the #+INCLUDE lines expanded. Then you could do your further processing and export from that buffer. Full documentation for the function: org-org-export-as-org is an interactive autoloaded compiled Lisp function in ‘ox-org.el’. ...


1

Yes, it should be safe (assuming you're careful enough to make sure that the buffer is really unchanged in the end). But be careful: if the code that is run while the buffer is modified is complex enough you might get into trouble (e.g. it might fill the syntax-ppss cache with data which won't be flushed when you undo the changes). Even worse if the code ...


1

yes, but you have to do it for each link. Assuming you are using org 9, you can do it like this in an init file, or in an elisp src block in your org-file: (org-link-set-parameters "cite" :export 'some-new-export-function)


1

It is set for 0.5 sec. It is not customizable at the moment. But you can turn it off with the command rg-ref-cancel-link-messages I think.


1

For latex export it is required that you put a bibliography link in the org file.


1

Raise a bug report with the author of org-ref. doi-utils-add-bibtex-entry-from-doi in doi-utils.el of that package does this: (when (not (looking-back "\n\n" 3)) (insert "\n\n")) Which is a very odd-looking constraint, but then I really don't know anything about this code or its usage. Clearly in your instance, point is < 3, so that triggers an ...


Only top voted, non community-wiki answers of a minimum length are eligible