Git Product home page Git Product logo

helm-bibtex's Introduction

Bibtex-completion, helm-bibtex, ivy-bibtex

Helm-bibtex: http://melpa.org/packages/helm-bibtex-badge.svg Ivy-bibtex: http://melpa.org/packages/ivy-bibtex-badge.svg

Helm-bibtex and ivy-bibtex allow you to search and manage your BibTeX bibliography. They both share the same generic backend, bibtex-completion, but one uses the Helm completion framework and the other Ivy as a front-end.

News

  • 2024-01-09: New customization variable bibtex-completion-watch-bibliography. Can be used to deactivate automatic reloading of the bibliography.
  • 2022-01-17: More support for org-mode citations, see here. (Thanks to akirakyle.)
  • 2021-08-25: It is now possible to mark and act on multiple entries in ivy-bitex. See here.
  • 2021-07-25: helm-bibtex-with-local-bibliography and ivy-bibtex-with-local-bibliography now also use locally and globally defined bibliographies in org files. These are bibliographies specified using the new #+BIBLIOGRAPHY: key word and those in the variable org-cite-global-bibliography.
  • 2021-07-18: Added a citation function for Org’s new citation system: bibtex-completion-format-citation-org-cite (for use in configuration variable bibtex-completion-format-citation-functions)
  • 2021-04-12: Added a section below explaining how the bibliography can be automatically reloaded when PDFs and notes are added. See here.
  • 2021-04-08: It is now possible to search for entries with PDFs and notes by entering =has-pdf= and =has-note=.
  • 2020-04-29: New commands helm-bibtex-with-notes and ivy-bibtex-with-noted for searching just within the entries that have notes.
  • 2018-06-09: Added virtual APA field author-or-editor for use in notes templates.
  • 2018-06-02: Reload bibliography proactively when bib files are changed.
  • 2017-10-21: Added support for multiple PDFs or other file types. See sections “Additional PDFs” and “Other file types than PDF”.
  • 2017-10-10: Added support for @string constants.
  • 2017-10-02: Use date field if year is not defined.
  • 2017-09-29: If there is a BibTeX entry, citation macro, or org-bibtex entry at point, the corresponding publication will be pre-selected in helm-bibtex and ivy-bibtex giving quick access to PDFs and other functions.

See NEWS.org for old news.

Key features

  • Quick access to your bibliography from within Emacs
  • Powerful search capabilities
  • Provides instant search results as you type
  • Tightly integrated with LaTeX authoring, emails, Org mode, etc.
  • Open the PDFs, URLs, or DOIs associated with an entry
  • Insert LaTeX cite commands, Ebib links, or Pandoc citations, BibTeX entries, or plain text references at point, attach PDFs to emails
  • Support for note taking
  • Quick access to online bibliographic databases such as Pubmed, arXiv, Google Scholar, Library of Congress, etc.
  • Import BibTeX entries from CrossRef and other sources.

Helm-bibtex’ and ivy-bibtex’ main selling points are efficient search in large bibliographies using powerful search expressions and tight integration into your Emacs workflows. They both can perform the following actions on entries matching the search expression: open the PDF associated with an entry, its URL or DOI, insert a citation for that entry, the BibTeX key, the BibTeX entry, or a plain text reference, attach the PDF to an email, take notes, edit the BibTeX entry. Many aspects can be configured to suit personal preferences.

Example

Below is a screenshot showing a helm-bibtex search for entries containing the expression “eye tracking”.

screenshot.png

The regular expression eye.?tracking allows searching for different spellings (“eye tracking”, “eye-tracking”, “eyetracking”). A looped square symbol (⌘) next to an entry indicates that a PDF is available. A pen symbol (✎) means that there are notes attached to this entry. At the bottom, there are entries that can be used to search in online databases.

Installation

The easiest way to install helm-bibtex or ivy-bibtex is through MELPA. Alternatively, put the files bibtex-completion.el and either helm-bibtex.el or ivy-bibtex.el in a directory included in your load-path and add the following line to your start-up file (typically init.el):

(autoload 'helm-bibtex "helm-bibtex" "" t)

or

(autoload 'ivy-bibtex "ivy-bibtex" "" t)
;; ivy-bibtex requires ivy's `ivy--regex-ignore-order` regex builder, which
;; ignores the order of regexp tokens when searching for matching candidates.
;; Add something like this to your init file:
(setq ivy-re-builders-alist
      '((ivy-bibtex . ivy--regex-ignore-order)
        (t . ivy--regex-plus)))

Helm-bibtex and ivy-bibtex depend on a number of packages that will be automatically installed if you use MELPA.

When using helm-bibtex or ivy-bibtex, make sure that helm or ivy is correctly configured (see helm documentation or ivy documentation).

Minimal configuration

A minimal configuration involves telling bibtex-completion where your bibliographies can be found:

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

Org-bibtex users can also specify org-mode bibliography files, in which case it will be assumed that a BibTeX file exists with the same name and extension bib instead of org. 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")))

Basic configuration (recommended)

PDF files

Specify where PDFs can be found:

(setq bibtex-completion-library-path '("/path1/to/pdfs" "/path2/to/pdfs"))

Bibtex-completion assumes that the name of a PDF consists of the BibTeX key followed plus a user-defined suffix (.pdf by default). For example, if a BibTeX entry has the key Darwin1859, bibtex-completion searches for Darwin1859.pdf.

If the BibTeX entries have a field that specifies the full path to the PDFs, that field can also be used. For example, JabRef and Zotero store the location of PDFs in a field called File:

(setq bibtex-completion-pdf-field "File")

If bibtex-completion-pdf-field is non-nil, bibtex-completion will first try to retrieve the file specified in this field. If the field is not set for an entry or if the specified file does not exists, bibtex-completion falls back to the method described above (searching for key + .pdf in the directories listed in bibtex-completion-library-path).

File specifications can be bare paths or follow the format used by JabRef, Zotero, Calibre, and Mendeley. This format also allows the specification of multiple files (e.g., the main paper and supplementary material). Examples:

  • File = {/path/to/article.pdf}
  • File = {:/path/to/article.pdf:PDF}
  • File = {:/path/to/article.pdf:PDF;:/path/to/supplementary_materials.pdf:PDF}

Notes

Bibtex-completion supports two methods for storing notes. It can either store all notes in one file or store notes in multiple files, one file per publication. In the first case, the customization variable bibtex-completion-notes-path has to be set to the full path of the notes file:

(setq bibtex-completion-notes-path "/path/to/notes.org")

If one file per publication is preferred, bibtex-completion-notes-path should point to the directory used for storing the notes files:

(setq bibtex-completion-notes-path "/path/to/notes")

The names of these files consist of the BibTeX key plus a user-defined suffix (.org by default).

At this point most people will be ready to go. Skip to Usage below to see how to use helm-bibtex and ivy-bibtex.

Follow processor for helm

Invoking helm-bibtex or ivy-bibtex when point is on an org-mode citation will automatically select that key. However, the default org-open-at-point on a org citation will take you to the corresponding bibliography entry. The following code will change this behavior to instead open helm-bibtex-follow when following an org citation by entering RET or clicking on it:

(setq org-cite-follow-processor 'helm-bibtex-org-cite-follow)

Note in the case of an org citation with multiple keys, the above code will not preselect any entry when the [cite: portion is selected. See here for the ivy alternative.

Advanced configuration

Customize layout of search results

The variable bibtex-completion-display-formats can be used to customize how search results are presented on a per-entry-type basis. The default is

'((t . "${author:36} ${title:*} ${year:4} ${=has-pdf=:1}${=has-note=:1} ${=type=:7}"))

which means that all entry types are presented in the same way: authors, title, year, … In this format string, the numbers indicate how much space is reserved for the respective field. If there is a * instead of a number that means that this field gets whatever space remains. Here is a setup that uses a different layout for different entry types:

(setq bibtex-completion-display-formats
    '((article       . "${=has-pdf=:1}${=has-note=:1} ${=type=:3} ${year:4} ${author:36} ${title:*} ${journal:40}")
      (inbook        . "${=has-pdf=:1}${=has-note=:1} ${=type=:3} ${year:4} ${author:36} ${title:*} Chapter ${chapter:32}")
      (incollection  . "${=has-pdf=:1}${=has-note=:1} ${=type=:3} ${year:4} ${author:36} ${title:*} ${booktitle:40}")
      (inproceedings . "${=has-pdf=:1}${=has-note=:1} ${=type=:3} ${year:4} ${author:36} ${title:*} ${booktitle:40}")
      (t             . "${=has-pdf=:1}${=has-note=:1} ${=type=:3} ${year:4} ${author:36} ${title:*}")))

For this to work, you have to add journal and booktitle to bibtex-completion-additional-search-fields. See next section.

Fields used for searching

The default fields used for searching are: author, title, year, BibTeX key, entry type (article, inproceedings, …). The variable bibtex-completion-addition-search-fields can be used to extend this list. Example:

(setq bibtex-completion-additional-search-fields '(keywords))

Symbols used for indicating the availability of notes and PDF files

(setq bibtex-completion-pdf-symbol "")
(setq bibtex-completion-notes-symbol "")

Different naming schemes for PDF files

If the PDFs files follow a different naming scheme than BibTeX key + .pdf, the function bibtex-completion-find-pdf-in-library can be modified to accommodate that.

Application used for opening PDFs

By default Emacs is used to open PDF files. This means that either DocView is used, or, if installed, the much superior pdf-tools extension which offers features such as incremental search in PDF files and creation and modification of annotations that are compatible with annotations created by Adobe software.

To configure another PDF viewer the customization variable bibtex-completion-pdf-open-function can be used. Here is an example configuration for the OS X PDF viewer Skim:

(setq bibtex-completion-pdf-open-function
  (lambda (fpath)
    (call-process "open" nil 0 nil "-a" "/Applications/Skim.app" fpath)))

Here is another example for the Linux PDF viewer Evince:

(setq bibtex-completion-pdf-open-function
  (lambda (fpath)
    (call-process "evince" nil 0 nil fpath)))

It is sometimes desirable to have both options (Emacs itself and external viewer) to open the PDF. The following adds an action with Evince as an external viewer bound to P, in addition to the regular Emacs viewer with p. The action works with ivy-bibtex; it would have to be adjusted for helm-bibtex (change the path to another viewer if necessary):

(defun bibtex-completion-open-pdf-external (keys &optional fallback-action)
  (let ((bibtex-completion-pdf-open-function
         (lambda (fpath) (start-process "evince" "*helm-bibtex-evince*" "/usr/bin/evince" fpath))))
    (bibtex-completion-open-pdf keys fallback-action)))

(ivy-bibtex-ivify-action bibtex-completion-open-pdf-external ivy-bibtex-open-pdf-external)

(ivy-add-actions
 'ivy-bibtex
 '(("P" ivy-bibtex-open-pdf-external "Open PDF file in external viewer (if present)")))

Additional PDFs

You may store additional PDFs for a given entry, such as an annotated version of the original PDF, a file containing supplemental material, or chapter files. If the file field is used to link PDFs to entries (see section PDF files), these additional PDFs can simply be added to that field. If the action “Open PDF file” is triggered, you will then be prompted for the file to open.

If the file field is not used but instead the naming scheme bibtex-key + .pdf (again see PDF files), you can obtain the same behavior with:

(setq bibtex-completion-find-additional-pdfs t)

All files whose name start with the BibTeX key will then be associated with an entry. It is then sufficient to name your files accordingly (for example with the rename utility). Examples:

  • bibtex-key-annotated.pdf
  • bibtex-key-supplemental.pdf
  • bibtex-key-chapter1.pdf

Note that for performance reasons, these additional files are only detected when triggering an action, such as “Open PDF file”. When the whole bibliography is loaded, only the “main” PDF bibtex-key.pdf is detected.

Other file types than PDF

If documents are referenced via the naming scheme bibtex-key.pdf but you are storing files in a different format than PDF, you can set the variable bibtex-completion-pdf-extension accordingly. Example:

(setq bibtex-completion-pdf-extension ".djvu")

If you store files in various formats, then you can specify a list instead of a single file type:

(setq bibtex-completion-pdf-extension '(".pdf" ".djvu", ".jpg"))

Extensions in this list are then tried sequentially until a file is found. Beware that this can reduce performance for large bibliographies.

Browser used for opening URLs and DOIs

By default bibtex-completion uses whatever is Emacs’ default. However, there are a variety of alternatives (see the documentation of bibtex-completion-browser-function for a complete list). Example:

(setq bibtex-completion-browser-function 'browser-url-chromium)

User-defined functions can be used, too:

(setq bibtex-completion-browser-function
  (lambda (url _) (start-process "firefox" "*firefox*" "firefox" url)))

Prevent automatic reloading of bibliography when it was changed

Automatic reloading can be configured using bibtex-completion-watch-bibliography.

Format of citations

Bibtex-completion creates citations based on the major mode in which the citation is inserted:

org-mode
insert link for opening the entry in Ebib
latex-mode
insert LaTeX citation command
markdown-mode
insert Pandoc citation macro
python-mode
insert sphinxcontrib-bibtex citation role
rst-mode
insert sphinxcontrib-bibtex citation role
other modes
insert plain BibTeX key

The list of modes can be extended and the citation functions can be changed using the customization variable bibtex-completion-format-citation-functions. For example, people who don’t use Ebib might prefer links to the PDFs instead of Ebib-links in org mode files:

(setq bibtex-completion-format-citation-functions
  '((org-mode      . bibtex-completion-format-citation-org-link-to-PDF)
    (latex-mode    . bibtex-completion-format-citation-cite)
    (markdown-mode . bibtex-completion-format-citation-pandoc-citeproc)
    (default       . bibtex-completion-format-citation-default)))

When you want to create a reading to-do list in org-mode, you may perfer using the title of the PDF file in the link. To achieve this goal, you can modify the variable bibtex-completion-format-citation-functions using the following code snippet:

(setq bibtex-completion-format-citation-functions
  '((org-mode      . bibtex-completion-format-citation-org-title-link-to-PDF)
    (latex-mode    . bibtex-completion-format-citation-cite)
    (markdown-mode . bibtex-completion-format-citation-pandoc-citeproc)
    (default       . bibtex-completion-format-citation-default)))

A citation function has to accept a list of keys as input and return a string containing the citations. See the predefined citation functions for examples.

LaTeX citation commands

Bibtex-completion prompts for a LaTeX citation command when inserting citations in LaTeX documents. The list of commands available for auto-completion can be defined using the variable bibtex-completion-cite-commands.

The default setting includes all cite commands defined in biblatex (except multicite commands and \volcite et al.). If no command is entered, a default command is used which can be configured using bibtex-completion-cite-default-command. The default value for the default command is cite. The variable bibtex-completion-cite-default-as-initial-input controls how the default command is used. If t, it is inserted into the minibuffer before reading input from the user. If nil, it is not inserted into the minibuffer but used as the default if the user doesn’t enter anything.

By default, bibtex-completion also prompts for the optional pre- and postnotes for the citation. This can be switched off by setting the variable bibtex-completion-cite-prompt-for-optional-arguments to nil.

See also the section Insert LaTeX cite commands below.

Online databases

Online databases can be configured using the customization variable bibtex-completion-fallback-options. This variable contains an alist where the first element of each entry is the name of the database and the second element is either a URL or a function. The URL must contain a %s at the position where the current search expression should be inserted. If a function is used, that function should take this search expression as single argument.

Key-bindings

For quick access to the bibliography, bind the search command, helm-bibtex or ivy-bibtex, to a convenient key.

Helm-bibtex: I use the menu key as the prefix key for all helm commands and bind helm-bibtex to b. Helm-bibtex can then be started using <menu> b. It is also useful to bind helm-resume to <menu> in helm-command-map. With this binding, <menu> <menu> can be used to reopen the last helm search.

(global-set-key (kbd "<menu>") 'helm-command-prefix)

(define-key helm-command-map "b" 'helm-bibtex)
(define-key helm-command-map "B" 'helm-bibtex-with-local-bibliography)
(define-key helm-command-map "n" 'helm-bibtex-with-notes)
(define-key helm-command-map (kbd "<menu>") 'helm-resume)

Ivy-bibtex: You could similarly bind ivy-bibtex to <menu> b and ivy-resume to <menu> <menu>.

Predefined searches

For convenience, frequent searches can be captured in commands and bound to key combinations. Below is example code that defines a search for publications authored by “Jane Doe” and binds the search command to C-x p.

Helm-bibtex:

(defun helm-bibtex-my-publications (&optional arg)
  "Search BibTeX entries authored by “Jane Doe”.

With a prefix ARG, the cache is invalidated and the bibliography reread."
  (interactive "P")
  (helm-bibtex arg nil "Jane Doe"))

;; Bind this search function to Ctrl-x p:
(global-set-key (kbd "C-x p") 'helm-bibtex-my-publications)

Ivy-bibtex:

(defun ivy-bibtex-my-publications (&optional arg)
  "Search BibTeX entries authored by “Jane Doe”.

With a prefix ARG, the cache is invalidated and the bibliography reread."
  (interactive "P")
  (when arg
    (bibtex-completion-clear-cache))
  (bibtex-completion-init)
  (ivy-read "BibTeX Items: "
            (bibtex-completion-candidates)
            :initial-input "Jane Doe"
            :caller 'ivy-bibtex
            :action ivy-bibtex-default-action))

;; Bind this search function to Ctrl-x p:
(global-set-key (kbd "C-x p") 'ivy-bibtex-my-publications)

Change the available actions

Pressing <enter> on a publication triggers the “default action” which is opening the PDF associated with the publication, if present, or its URL or DOI otherwise. Pressing <tab> in helm-bibtex or M-o in ivy-bibtex instead displays an action menu listing the available actions. Here is the list of all available actions along with their functions (these are the generic action functions, for helm-bibtex the function names start with helm-bibtex- instead of bibtex-completion-, and for ivy-bibtex they start with ivy-bibtex- instead):

  • Open PDF, URL or DOI: bibtex-completion-open-any
  • Open PDF file (if present): bibtex-completion-open-pdf
  • Open URL or DOI in browser: bibtex-completion-open-url-or-doi
  • Insert citation: bibtex-completion-insert-citation
  • Insert reference: bibtex-completion-insert-reference
  • Insert BibTeX key: bibtex-completion-insert-key
  • Insert BibTeX entry: bibtex-completion-insert-bibtex
  • Attach PDF to email: bibtex-completion-add-PDF-attachment
  • Edit notes: bibtex-completion-edit-notes
  • Show entry: bibtex-completion-show-entry
  • Add PDF to library: bibtex-completion-add-pdf-to-library

Helm-bibtex: The action list can be modified through the commands helm-add-action-to-source and helm-delete-action-from-source. For instance, the following adds a new action helm-bibtex-open-annotated-pdf (see above) just after the first item in the list above:

(helm-add-action-to-source
 "Open annotated PDF (if present)" 'helm-bibtex-open-annotated-pdf
 helm-source-bibtex 1)

If the last, numerical argument in helm-add-action-to-source is omitted, the new action is added at the end of the list. Since the default action is simply the first entry in the list of actions, the default action can be changed by deleting an action and re-inserting it at the top of the list. Below is an example showing how to make “Insert BibTeX key” the default action:

(helm-delete-action-from-source "Insert BibTeX key" helm-source-bibtex)
(helm-add-action-to-source "Insert BibTeX key" 'helm-bibtex-insert-key helm-source-bibtex 0)

Ivy-bibtex: The default action and the additional available actions are set separately. The default action is controlled by the variables ivy-bibtex-default-action and ivy-bibtex-default-multi-action, with the latter intended for lists of marked entries (see Apply actions to multiple entries). For example, the following code changes the default action to “insert BibTeX key”:

(setq ivy-bibtex-default-action 'ivy-bibtex-insert-key)

In the same way, the following code sets the default action for lists of marked entries to “insert BibTeX key” which will insert a nice comma-separated list of keys:

(setq ivy-bibtex-default-multi-action 'ivy-bibtex-insert-key)

The additional actions are set by passing the desired action list to the command ivy-set-actions. For instance, the following codes keeps only two available actions in addition to the default one:

(ivy-set-actions
 'ivy-bibtex
 '(("p" ivy-bibtex-open-any "Open PDF, URL, or DOI" ivy-bibtex-open-any)
   ("e" ivy-bibtex-edit-notes "Edit notes" ivy-bibtex-edit-notes)))

The letters p and e are the key bindings for the two actions in the action menu. The key binding o is reserved for the default action. The second appearance of the action in this code alerts ivy that the action can handle lists of marked entries. It can safely be omitted if the right thing to do is simply apply the action to each entry in turn.

If you only want to add new actions at the end of the action list, you can alternatively use the command ivy-add-actions. For instance, the following adds a new action ivy-bibtex-open-annotated-pdf (see above) at the end of the action list:

(ivy-add-actions
   'ivy-bibtex
   '(("P" ivy-bibtex-open-annotated-pdf "Open annotated PDF (if present)" ivy-bibtex-open-annotated-pdf)))

Create new actions

Creating a new action for helm-bibtex or ivy-bibtex can be done in three steps. For an example see Action for opening annotated PDFs above.

The first and main step is to create a generic action function bibtex-completion-<action> (e.g. bibtex-completion-open-annotated-pdf). This function should take as single argument a list of BibTeX keys and perform the action on the corresponding BibTeX entries.

The second step is to tailor the generic action function for helm-bibtex or ivy-bibtex, so that it will be run in the correct buffer and receive the keys of the selected entries).

Helm-bibtex: This is simply done with:

(helm-bibtex-helmify-action bibtex-completion-<action> helm-bibtex-<action>)

Ivy-bibtex: This is simply done with:

(ivy-bibtex-ivify-action bibtex-completion-<action> ivy-bibtex-<action>)

The third and final step is to make the tailored action function helm-bibtex-<action> or ivy-bibtex-<action> available in helm-bibtex or ivy-bibtex by adding it to the action menu. See Change the available actions.

Window size

Helm-bibtex: By default helm-bibtex uses the entire frame to display the bibliography. This can be changed by setting the variable helm-bibtex-full-frame to nil, in which case helm’s standard is used (typically vertical split, with the helm search being shown in the lower window).

Ivy-bibtex: Ivy-bibtex always displays the bibliography in the minibuffer. The variable ivy-height controls the number of lines for the minibuffer window in all ivy commands.

Templates for new notes

Bibtex-completion populates new notes with some basic information about the publication. In the case of just one note file for all publications, new entries look like the following example:

Gigerenzer, G. (1998): We need statistical thinking, not statistical rituals
  :PROPERTIES:
  :Custom_ID: Gigerenzer1998
  :END:

The title of the new section consists of the author names, the year, and the title of the publication. The property Custom_ID specifies the BibTeX key of the entry (it’s named Custom_ID for compatibility with org-ref).

In the case of one file per publication, a new notes file contains a title in the following format:

#+TITLE: Notes on: Gigerenzer, G. (1998): We need statistical thinking, not statistical rituals

If other formats are desired, the templates for new notes can be changed using the customization variables bibtex-completion-notes-template-one-file and bibtex-completion-notes-template-multiple-files.

File type of note files

By default bibtex-completion assumes that note files are in org-mode format. However, any other format can be used as well. In the case of just one notes file, it is enough to set bibtex-completion-notes-path to point to the desired file. In the case of multiple note files, the type of the files can be specified using the customization variable bibtex-completion-notes-extension. For example, if Markdown is the desired file type:

(setq bibtex-completion-notes-path "/path/to/notes")
(setq bibtex-completion-notes-extension ".md")

If the file type is set to something else than org-mode, the templates for new note files need to be adjusted as well. See the section above for details.

Refresh bibliography when new PDFs and notes are added

Bibtex-completion automatically reloads the bibliography when a .bib file is changed on disk. However, bibtex-completion does not watch PDFs and notes. Thus, when a new PDF or note is added, the bibliography must be manually reloaded to display the PDF and note symbols correctly (via prefix argument, e.g. C-u M-x helm-bibtex). Unfortunately, implementing automatic reloading for PDFs and notes is not entirely straightforward since bibtex completion is quite flexible in how PDFs and notes can be handled. But for simple setups, there is an easy solution: just watch the bibtex-completion-library-path and bibtex-completion-notes-path directories and reload the bibliography when they change. Example for the PDF directory:

(setq tmalsburg-pdf-watch
      (file-notify-add-watch bibtex-completion-library-path
                             '(change)
                             (lambda (event) (bibtex-completion-candidates))))

Usage

Search publications

Use M-x helm-bibtex or M-x ivy-bibtex to start a new search. The default fields for searching are: author, title, year, BibTeX key, and entry type. Regular expressions can be used. Example searches:

Everything published by Janet Fodor:

janet fodor

All PhD theses:

phdthesis

Lyn Frazier’s PhD thesis:

phdthesis frazier

Publications about eye tracking. A regular expression is used to match various spellings (“eyetracking”, “eye tracking”, “eye-tracking”):

eye.?tracking

Conference presentations in 2013:

2013 inproceedings

Publications from 2010 and 2011:

\(2010\|2011\)

Articles co-authored by David Caplan and Gloria Waters:

article waters caplan

Search for articles by David Caplan that are not co-authored by Gloria Waters:

article caplan !waters

Search in the local bibliography

Use helm-bibtex-with-local-bibliography or ivy-bibtex-with-local-bibliography to start a search in the current buffer’s “local bibliography”, instead of the “global bibliography” defined by bibtex-completion-bibliography. If the current file is a BibTeX file, that bibliography is going to be used. If the current file is a LaTeX file, reftex will be used to determine the local bibliography from the standard LaTeX bibliography commands \bibliography and \addbibresource. If the file is an org file, the local and/or global org bibliography is used (as specified using the new #+BIBLIOGRAPHY: key word and the variable org-cite-global-bibliography). If no local bibliography can be found, the global bibliography (bibtex-completion-bibliography) will be used.

Search in entries with notes

Use helm-bibtex-with-notes or ivy-bibtex-with-notes to search only among entries that have notes. Particularly useful in combination with ~org-roam-bibtex.el~.

Search the word under the cursor

A common use case is where a search term is written in a document (say in your LaTeX manuscript) and you want to search for it in your bibliography. In this situation, just start helm-bibtex or ivy-bibtex and enter M-n. This inserts the word under the cursor as the search term. (This is a helm / ivy feature and can be used in all helm / ivy commands, not just helm-bibtex / ivy-bibtex.) Note that it is also possible to use BibTeX keys for searching. So if your cursor is on a BibTeX key (e.g., in a LaTeX cite command) you can start helm-bibtex or ivy-bibtex, hit M-n and see the entry associated with that BibTeX key. Special case: you want to open the PDF associated with the BibTeX key under the cursor: M-x helm-bibtex M-n RET or M-x ivy-bibtex M-n RET. This is of course shorter if you bind helm-bibtex or ivy-bibtex to a convenient key (see Key-bindings).

Actions for selected publications

The available actions are:

  • Open a PDF if present, or a URL or DOI (default action)
  • Open the URL or DOI in browser
  • Insert citation
  • Insert reference
  • Insert BibTeX key
  • Insert BibTeX entry
  • Attach PDF to email
  • Edit notes
  • Show entry
  • Add PDF to library

Helm-bibtex: Select an entry and press <return> to execute the default action. Alternatively, press TAB (tabulator) to see a list of all available actions, execute one of them and exit helm-bibtex.

Ivy-bibtex: Select an entry and press <return> to execute the default action. Alternatively, press M-o to see a list of all available actions, execute one of them and exit ivy-bibtex.

Apply actions to multiple entries

Helm-bibtex: Start helm-bibtex, enter the search expression, move the cursor to the matching entry and enter C-<space> (control + space bar) to mark this entry, optionally change your search expression, mark more entries, finally press <return> or <tab> to execute an action for all selected entries at once and exit helm-bibtex.

Ivy-bibtex: Start ivy-bibtex, enter the search expression, move the cursor to the matching entry and enter C-<space> (control + space bar) to mark this entry, optionally change your search expression, mark more entries, finally press <return> to execute the default action on all the selected entries or M-o to choose another action. Press S-<space> (shift + space bar) to un-mark a marked entry.

A colleague asks for copies of your new papers

Helm-bibtex: Start an email to your colleague (C-x m) and execute helm-bibtex. Search for your new publications and mark them with C-<space>, then press <f7> to execute the action “Attach PDF to email”. Then M-x helm-resume (the publications are still marked) and press <f6> to execute the action “Insert BibTeX entry”. Optionally insert more human readable references using M-x helm-resume and <f4> to execute the action “Insert reference”. Send email (C-c C-c). Done. This takes less than 10 seconds.

Ivy-bibtex: Start an email to your colleague (C-x m) and execute ivy-bibtex. Search for your new publications and and mark them with C-<space>, then press C-M-o a to execute the action “Attach PDF to email” while keeping ivy open. Then press M-o b to execute the action “Insert BibTeX entry” or insert more human readable references using M-o r to execute the action “Insert reference”. Send email (C-c C-c). Done. This takes less than 10 seconds.

Of course, this assumes that you’re sending email from Emacs, e.g. via Mu4e.

Tag publications

Helm-bibtex and ivy-bibtex have powerful search capabilities but some common searches cannot be performed simply because the relevant information is typically not represented in BibTeX files. For example, bibtex-completion doesn’t know whether a conference presentation was a talk or a poster because both are represented as inproceedings. So if you want to compile a list of your conference talks (e.g., for your CV), that’s not possible – not without some additional work. One solution is to “tag” publications. Tags are like keywords except that they don’t represent the content of a publications but meta data. Example:

@inproceedings{BibtexKey2015,
  author = {Jane Doe and Monika Mustermann},
  title = {This is the title},
  crossref = {XYZ-conference-2015},
  keywords = {keyword1, keyword2},
  pages = {10},
  tags = {poster},
}

Since tags is not a standard BibTeX field, bibtex-completion by default doesn’t consider it when searching. In order to be able to search for tags, we therefore have to tell bibtex-completion that the tags field is relevant, too:

(setq bibtex-completion-additional-search-fields '(tags))

There are many other ways in which tags can be used. For example, they can be used to mark articles that you plan to read or important articles or manuscripts in progress, etc. Be creative.

Insert LaTeX cite commands

The action for inserting a citation command into a LaTeX document prompts for the citation command and, if applicable, for the pre- and postnote arguments. The prompt for the citation command has its own minibuffer history, which means that previous inputs can be accessed by pressing the <up> key for helm-bibtex or M-p for ivy-bibtex. By pressing <down> it is also possible to access the list of all citation commands defined in biblatex (except for multicite commands and volcite et al. which have different argument structures). The prompt also supports auto-completion via the tab key. If no command is entered, the default command is used. The default command is defined in the customization variable bibtex-completion-cite-default-command. By default, helm-bibtex and ivy-bibtex prompt for pre- and postnotes for the citation. This can be switched off by setting the variable bibtex-completion-cite-prompt-for-optional-arguments to nil.

Force reloading of the bibliography

Bibtex-completion caches the bibliography to prevent a costly reread when a new query is started. However, bibtex-completion does not check whether new PDFs or notes were added since the last read and hence the symbols indicating the presence or absence of these items may be incorrect. A reread can be forced using a prefix argument.

Helm-bibtex: Either do C-u M-x helm-bibtex or C-u followed by whatever key binding you use to invoke helm-bibtex.

Ivy-bibtex: Either do C-u M-x ivy-bibtex or C-u followed by whatever key binding you use to invoke ivy-bibtex.

Import BibTeX from CrossRef

Helm-bibtex: Start helm-bibtex and enter search terms. Then select “CrossRef” in the section titled “Fallback options”. (You can use the left and right arrow keys to switch between sections.)

Ivy-bibtex: Start ivy-bibtex and enter search terms. Then press M-o f to see the list of fallback options and select “CrossRef”.

This will use biblio.el to search the CrossRef database. In the results list, place the cursor on the entry of interest and hit c to copy the BibTeX for that entry or i to insert it at point. Press q to close the buffer with the search results. See the documentation of biblio.el for details.

Searching on a different source

Sometimes the search term will not yield the desired results on the first fallback source selected and you may wish to pick another fallback option with the same search term. For this you can use helm-resume (or ivy-resume) to get back to the initial helm (ivy) menu with the last search term pre-entered allowing you to efficiently choose another option.

Advanced usage (a.k.a. hacks)

Below I provide code that was useful for me or other users. Note that this code may make assumptions that do not hold in your setup. Read the code carefully before executing it and make changes as needed.

Convert multiple note files to one notes file

The code below reads all note files in your bibtex-completion-notes-path and creates a new notes file containing a section for each publication. This code assumes that bibtex-completion is still configured for multiple note files and that you want to store the notes in the file notes.org in your bibtex-completion-notes-path. The code also adds a level to all org headlines found in the individual note files (because top-level headings are used for the publications in the new notes file). If a note file doesn’t have a corresponding entry in the bibliography, it is ignored.

(let ((note-files (directory-files bibtex-completion-notes-path t "^[^.]+\\.org$"))
      (bibtex-completion-notes-path (f-join bibtex-completion-notes-path "notes.org")))
  (cl-loop
   for note-file in note-files
   for key = (f-no-ext (f-filename note-file))
   do (condition-case nil
          (progn
            (bibtex-completion-edit-notes key)
            (insert (with-temp-buffer
                      (insert-file-contents note-file)
                      (replace-regexp "^*" "**")
                      (buffer-string))))
        (error nil))))

Create a BibTeX file containing only specific entries

Say you want to create a BibTeX file containing only entries that you cited in an article, then you can use the following code to populate the new BibTeX file with entries:

(progn
  (switch-to-buffer (generate-new-buffer "my_new_bibliography.bib"))
  (--map (insert (bibtex-completion-make-bibtex it)) (-distinct '("Key1" "Key2"))))

If LaTeX is used to write the article, grep and sed can be used to extract the cited keys:

grep '\entry{' manuscript.bbl | sed 's/^.*\entry{\([^}]*\)}.*$/\1/'

Create a list with the paths of all PDFs in your bibliography

This can be useful if you’d like to transfer all your PDFs to another directory or similar.

(flatten-tree
 (mapcar
  (lambda (entry) (bibtex-completion-find-pdf entry))
  (bibtex-completion-candidates)))

Reverse order of entries

Helm-bibtex and ivy-bibtex display entries in the order in which they appear in the BibTeX file reversed. This way, entries that were added at the bottom of the BibTeX file show up at the top when searching. There is currently no support for sorting but if you want to reverse the order of entries you can use the code below:

(advice-add 'bibtex-completion-candidates
            :filter-return 'reverse)

Use ivy-bibtex as an org-cite-follow-processor

As mentioned here, the default org-open-at-point on a org citation will take you to the corresponding bibliography entry. The following code will change this behavior to instead open ivy-bibtex when following an org citation by entering RET or clicking on it:

(org-cite-register-processor 'my-ivy-bibtex-org-cite-follow
  :follow (lambda (_ _) (ivy-bibtex)))

(setq org-cite-follow-processor 'my-ivy-bibtex-org-cite-follow)

Troubleshooting

Helm-bibtex doesn’t show any entries

This usually happens when a BibTeX file isn’t well-formed. Common problems are opening quotes or parentheses that don’t have matching counterparts. Unfortunately, Helm swallows the error message that is generated in these cases and just shows an empty buffer.

One way to diagnose the problem is to call the function for reading BibTeX directly and to see what error message it produces:

(bibtex-completion-candidates)

If you see

forward-sexp: Scan error: "Unbalanced parentheses", 181009, 512282

this means that there is an unmatched opening parenthesis at the position 181009. To find this parenthesis, open the BibTeX file and do M-: (goto-char 181009) RET. You can also use the command M-x bibtex-validate RET to check for errors. Fix any problems and try again.

helm-bibtex's People

Contributors

akoehn avatar ashiklom avatar basille avatar byguess avatar daniron26 avatar dankessler avatar demon386 avatar ericdanan avatar franburstall avatar gusbrs avatar jabranham avatar jagrg avatar joostkremers avatar justbur avatar ksunden avatar malb avatar mgttlinger avatar mohkale avatar mwlodarczak avatar plantarum avatar shuguangsun avatar ssfrr avatar swflint avatar syohex avatar titan-c avatar tmalsburg avatar tpapp avatar xingnix avatar yuchen-lea avatar zaeph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

helm-bibtex's Issues

Insert reference generates "Wrong type argument"

Hi,

I was trying the helm-bibtex-insert-reference command today using the most recent helm-bibtex on melpa and noticed that any entry with the author field containing "Lastname, Firstname" generated wrong type argument. Author fields containing "Firstname Lastname" were fine. I didn't try any with multiple authors. The error pops up within helm-bibtex-apa-format-authors.

Thanks in advance, if you can get a chance to confirm and/or fix it.

Scott

auto create orgnote if not present?

Hi :)

i would like to suggest that (if possible) helm-bitex would offer to create a note (or org file) and move to it if not present for a bibtex entry. as far as i can tell currently it only says:

Non-existent agenda file ~/org/files/Uni/papers/bib/notes/_(sub)_ChronicEffectsTemperature.org. [R]emove from list or [A]bort?

thx!

z

Request for multiple directories in helm-bibtex-library-path

I'm trying helm-bibtex for the first time and am very impressed. I have my PDF files in several directories, including one for papers and one for books. I'd therefore like helm-bibtex-library-path to support a list of directories, in the same way that helm-bibtex-bibliography supports a list of bib-files.

I suppose some people might also want the option to search all subdirectories of a given path, though that wouldn't meet my present need.

helm-bibtex gets stuck on "Loading blbliography ... " with newest version from MELPA

Hi,
with the latest MELPA version of helm-bibtex (2015-02-13), I no longer get any results when trying to search for a string (even with a single character, such as "a"). Instead, the fallback menu is shown straight away, and when searching the message buffer displays only "Loading bibliography ...". However, helm-bibtex does have the correct path to the bibliography, and displays the fallback option "Create new entry in bibliography-name.bib", where bibliography-name.bib is the correct name of my bib file.

Any ideas what might be causing this to happen?

helm-bibtex doesn't propose the "search bibtext entries"

Hi,

When I do "M-x search-bibtex" the only things that it proposes to me is the "fallback options":

Search in Google Scholar
Search in Pubmed
Search in arXiv
Search in Bodleian Library
Search in Library of Congress
Search in Deutsche Nationalbibliothek
Search in British National Library
Search in Bibliothèque nationale de France
Search in Gallica Bibliothèque Numérique
Create new entry in test.bib

But nothing to search in my bib fil (test.bib).

I did something wrong?

Config:
(setq helm-bibtex-bibliography "/Users/Sam/Dropbox/Textes/test.bib")
mac OS10.9
emacs 24.3

insert formatted references "leaves out" authors

Hi Titus

As requested im posting the issue on github. i have put an example below of a .bib entry i have

@article{abby-2015-prenat-early,
  author =   {Abby F. Fleisch, Heike Luttmann-Gibson, Wei Perng,
                  Sheryl L. Rifas-Shiman, Brent A. Coull,
                  Petros Koutrakis, Joel D. Schwartz, Antonella
                  Zanobetti, Christos S.  Mantzoros, Matthew
                  W. Gillman, , Diane R. Gold, , Emily Oken, },
  title =    {Prenatal and Early Life Exposure To Traffic
                  Pollution and Cardiometabolic Health in Childhood},
  journal =  {},
  year =     {2105},
  pubstate =     {prep},
  tags =     { },
}

and how org inserts the formatted references into emacs (only the 1st author is present as you can see:

- Abby F. Fleisch, H. L. (2015). Prenatal and early life exposure to
  traffic pollution and cardiometabolic health in childhood. , (), .

Maybe its my entry that isnt properly formatted (i use org-ref-clean for that)?

thx

Z

Feature request: opening files specified in "File" field.

(Disclaimer: I am new to helm-bibtex, so maybe I am missing something obvious).
I see we can redefine helm-bibtex-find-pdf. A use case that might not be that rare is when the name of the PDF has no clear relationship with the key, but is actually specified in the file field
File = {:home/ramon/a_directory/some_file_123.pdf:PDF},

But this might now always be the case, so some entries might follow the usual pattern (key.pdf). Is the reommended procedure to redefine helm-bibtex-find-pdf so we search both in the "File" field and the standard way? Or is there some easier procedure? (If the way to do it is by modifying the function, what is the best way to "get the file field" or similar ---elisp ignorant here, with just enough knowledge to modify elisp code by trial and error).

"Loading bibliography ..." information when "helm-bibtex-library-path" is set

Hi,

Thanks for this powerful extension of Emacs first. I would like to report an issue on my Mac as described in the title.

I installed helm-bibtex via melpa with the newest version. My Emacs is Emacs 24.4 on Mac 10.10.2.

At first, I only have the following setting in my init.el:

(setq helm-bibtex-bibliography '("~/Documents/Work/Papers/MPC.bib"))

helm-bibtex works fine with this setting. However, if I add the following setting in init.el:

(setq helm-bibtex-library-path '("~/Documents/Work/Papers/MPC"))

Then when I ran helm-bibtex in Emacs, it will display "Loading bibliography ..." message in the echo area, which is similar to Issue #38.

So now I would just try the management function with helm-bibtex. Could you please help me with this? Thanks in advance.

helm-bibtex-additional-search-fileds does not work properly

Hello,

thanks for this useful package. I tried to the helm-bibtex-additional-search-fields function for searching abstracts of my entries. This is the setup

(require 'helm-bibtex)
(setq helm-bibtex-bibliography "~/Documents/prova.bib")
(setq helm-bibtex-library-path "~/Dropbox/PDF")
(setq helm-bibtex-additional-search-fields '(abstract))

And this is a sample bib file

@article{Aron2007,
    file = {Aron2007},
    author = "Aron, Adam R",
    title = "The neural basis of inhibition in cognitive control.",
    DOI = "10.1177/1073858407299288",
    volume = "13",
    number = "3",
    year = "2007",
    journal = "Neuroscientist",
    pages = "214--228",
    abstract = "The concept of "inhibition" is widely used in synaptic, circuit, and systems neuroscience, where it has a clear meaning because it is clearly observable. The concept is also ubiquitous in psychology. One common use is to connote an active/willed process underlying cognitive control. Many authors claim that subjects execute cognitive control over unwanted stimuli, task sets, responses, memories, and emotions by inhibiting them, and that frontal lobe damage induces distractibility, impulsivity, and perseveration because of damage to an inhibitory mechanism. However, with the exception of the motor domain, the notion of an active inhibitory process underlying cognitive control has been heavily challenged. Alternative explanations have been provided that explain cognitive control without recourse to inhibition as concept, mechanism, or theory. This article examines the role that neuroscience can play when examining whether the psychological concept of active inhibition can be meaningfully applied in cognitive control research.",
    month = "June"
}


@Article{BertinMaghit2009,
    abstract = {L’elettrizzazione corrisponde all’insieme delle conseguenze derivanti dall’esposizione alla corrente elettrica. L’elettrocuzione è un arresto cardiaco indotto dalla corrente elettrica. La gravità immediata dei casi di elettrizzazione con corrente a bassa tensione, essenzialmente costituiti da incidenti domestici, è cardiovascolare, con il rischio di arresto cardiaco per fibrillazione ventricolare, di asfissia per tetania dei muscoli respiratori e di infarto miocardico. La corrente ad alta tensione provoca lesioni tissutali e viscerali tra i punti di entrata e di uscita, sedi di ustioni profonde. I bisogni idroelettrolitici iniziali sono maggiori di quelli che possono essere stimati sulla base delle sole ustioni visibili. Il trattamento chirurgico richiede interventi reiterati. La fulminazione nella sua forma grave richiede una gestione simile a quella dei casi di elettrizzazione da corrente ad alta tensione.},
    file = {Bertin2009.pdf},
    doi = {10.1016/S1286-9341(09)70016-X},
    url = {http://gen.lib.rus.ec/scimag/index.php?s=10.1016/S1286-9341(09)70016-X},
    number = {2},
    volume = {13},
    year = {2009},
    journal = {EMC - Urgenze},
    title = {Elettrizzazione, elettrocuzione, fulminazione},
    author = {Bertin-Maghit, M.}
}


@article{Biffl2009,
    author = "Biffl, Walter L and Kaups, Krista L and Cothren, C Clay and Brasel, Karen J and Dicker, Rochelle A and Bullard, M Kelley and Haan, James M and Jurkovich, Gregory J and Harrison, Paul and Moore, Forrest O and others",
    title = "Management of patients with anterior abdominal stab wounds: a Western Trauma Association multicenter trial",
    file = {Biffl2009.pdf},
    volume = "66",
    number = "5",
    year = "2009",
    journal = "Journal of Trauma and Acute Care Surgery",
    pages = "1294--1301",
    abstract = "The optimal managementof hemodynamically stable, asymptomaticpatients with anterior abdominal stabwounds (AASWs) remains controversial.The goal is to identify and treat injuries in asafe, cost-effective manner. Common evaluationstrategies include local wound exploration(LWE)/diagnostic peritoneal lavage(DPL), serial clinical assessments (SCAs),and computed tomography (CT) imaging.The purpose of this multicenter study was toevaluate the clinical course of patients managedby the various strategies, to determinewhether there are differences in associatednontherapeutic laparotomy (NONTHERLAP), emergency department (ED) discharge,or complication rates."
}

It seems that helm-bibtexlooks just in the default fields. It fails to show entries when I try to use words in abstract fields.

Feature Request: Citation command.

Dear Titus,

I like the idea of replacing ebib with helm-bibtex. The only thing I would wish for is a way to specify the citation command to use ( \cite{}, \textcite{}, etc)

If there was a way to add an argument like in ebib:

 '(ebib-citation-commands (quote 
((any (("cite" "\\cite%<[%A]%>{%K}") 
("t" "\\textcite%<[%A]%>{%K}") 
("p" "\\parencite%<[%A]%>{%K}"))) 
(org-mode (("ebib" "[[ebib:%K][%D]]")))
(markdown-mode (("t" "@%K%< [%A]%>"))))))

That would be great!

Wish I could code up the elisp right now, but I am late on a couple of deadlines!

Thanks,

-Cyrus

```helm-bibtex-show-entry``` fails for single file.

You probably need to add a conditional for the case where there is only one bibtex file and not a list, e.g.,

(if (listp helm-bibtex-bibliography)
                helm-bibtex-bibliography
              (list helm-bibtex-bibliography)) 

PS. Great job on all the new features! I love what you are doing here...

Request for new action: insert link to pdf and title

Hi Titus,
Sorry if this is a very personalized request. When I was using RefTex, I had customized an "citation" option that inserted an org link to the pdf and the title of the selected reference. I used this quite a bit to prepare lists of bilbiography to read for particular projects. When using this option, I would get something like this:

** [[/home/julian/Documents/Refs/Lurton2015.pdf][Lurton2015]] Backscatter measurements by seafloor-mapping sonars

It seems that it should be relatively simple to create a new function to do this. But my emacs lisp knowledge is very limited. I started with this:

(defun helm-bibtex-insert-link-to-pdf-and-title (_)
"Insert link to pdf and title at point."
(let ((keys (helm-marked-candidates :with-wildcard t)))
(with-helm-current-buffer
(insert
(concat "**[["
helm-bibtex-library-path
(funcall 'helm-bibtex-format-citation-default keys)
".pdf]["
(funcall 'helm-bibtex-format-citation-default keys)
"]]"
)))))

But obviously does not work (I get a "Wrong type argument: characterp" error), and I am not sure how to get the title in. Whenever you have the chance, could you give me a hand?
Many thanks,

Julian

Add tags/categories to items

In the long term, it would be amazing to have a tagging mechanism for candidates. This allows:

  1. work planning: mark papers as read/unread/favorite/indexed/reviewed etc.
  2. content indexing: group papers which are relevant to a certain concept

The index could be stored as a separate file (in the same path as the .bib file) which has a mapping from keys to a list of tags. For content indexing tags should be hierarchical, with 1 or 2 levels of nesting.

helm-bibtex would let users:

  1. search based on tag using some simple syntax e.g.:
    • simple :read - entries matching the read tag
    • hierarchy :conjugate gradient.sparse - the conjugate gradient -> sparse hierarchy
    • union :conjugate gradient|:sparse - either conjugate gradient or sparse
    • intersection :conjugate gradient&:sparse - matching both
  2. edit candidate tags via an extra option in the candidate menu
  3. generate a text version of its index (markdown would be easy)

An example markdown index:

% Paper Index

# Conjugate gradient
* Dense [@lopes2008high]
* Sparse [@chow2014efficient]

What do you think?

Highlighted and clickable pandoc citations

Hello,

First of all sorry about my lack of emacs knowledge to achieve what I'm asking here.

Would there be any way of making an inserted pandoc citation a link highlighted and clickable?

As you know a typical pandoc citation is like this [@mycitation]

I would like @mycitation to become an active link in emacs. When clicked, it should take the person to the related entry in helm-bibtex.

Thanks in advance,

Steve

Add resolution of cross-references

A request: it would be helpful if helm-bibtex used the crossref field, if available, to show the inherited auhtor and year fields for inbook, incollection, inproceeding entries.

Sort order

Ebib sorts the bib file alphabetically (a-z), but helm-bibtex reverses the order (z-a). Any idea how to fix this?

Feature request: make fallback options helm actions

The current implementation adds the fallbacks as another helm source and therefore requires navigating in the helm buffer to select a fallback. If these were actions instead, a user could hit tab and use helm filtering again to more quickly get to the fallback they wanted.

Request for helm-bibtex-notes-file

Instead of storing my notes in a separate directory, which I think is what helm-bibtex proposes, I like to keep my notes in one org file, which looks something like this:

** Author (2013) Title
:PROPERTIES:
:Custom_ID: bibtex-key
:END:

So I was wondering if you could add "helm-bibtex-notes-file", which would be the equivalent of "helm-bibtex-notes-path". But instead of searching for the bibtex-key.org file, it would search for the bibtex-key in the file specified by the user, for example:

(setq helm-bibtex-notes-file "~/.emacs.d/annotation.org")

unhelpful error if helm-bibtex-library-path is not set

Hello,
I stumbled over an odd error in helm-bibtex today. If the variable helm-bibtex-library-path is not set, which is the default, one gets the error

f-absolute?: Wrong type argument: stringp, nil

when pressing RET over an entry. Obviously, this is not very telling (to me at least). Just setting the variable to "~/" fixes the issue, even though there are no pdf's to be found under that path. I think a good default value would be the folder of the bib file?
Cheers,
Christian

Issues with parsebib in version 20141214.1529

Hi,

Thanks for your continuous work, I really like your extension! Too bad that the latest version does not work for me anymore (using emacs 24.4.1 on ubuntu). First, there is some weird issue with the parsebib.el dependency. When I run helm-bibtex, it does not show any entries. Turning on debugging-on-error does not return any error and (require 'parsebib) does not help either. While debugging, I discovered that evaluating some parsebib functions manually, or calling (load "parsebib.el") fixes the issue in so far as the bibtex items are displayed in helm-bibtex again. With this, however, opening pdfs and note files from helm-bibtex does not work (the filenames are wrong, although they are correct when deciding whether or not to draw the corresponding icons).
Let me know if you have any idea what my problem could be...

Thanks
Peter

[Feature request] impact factor and cited number

Hi @tmalsburg

Do you have any idea that how to add the impact factor of general and cited number to helm-bibtex?

Because I have a lot of papers, I would like to choose paper with good impact factor and well cited number to read and cite first. Of course, I can do it manually by looking up in website or by memorizing the journals. However, it is still convenient to pick up papers if IF and cited number are there.

Thanks in advance.
llcc

Add open-notes/pdf-at-point?

Hi, thanks for the tool once again!

Recently I needed to do lookups of notes or pdfs given a bibtex key. This is easy with the functions bellow:

(defun open-notes-at-point ()
  "Open notes corresponding to the citation key at point"
  (interactive)
  (find-file (format "%s/%s%s" helm-bibtex-notes-path (word-at-point) helm-bibtex-notes-extension)))

(defun open-pdf-at-point ()
  "Open pdf corresponding to the citation key at point"
  (interactive)
  (find-file 
   (format "%s/%s.pdf" helm-bibtex-library-path (word-at-point))))

Maybe helm-bibtex already has these functions and I missed them somehow?

If not and unless I am missing something, I think it might be convenient to include them since:

  1. (IMHO) these type of lookups are common (e.g. when revising material, writing surveys etc.)
  2. the configuration is already in place

Do not see any bibtex entries

Hi,

I tried helm bibtex with a test .bib file but I only get the fallback options and no search results. The bibtex file is validated and syntactically correct.
For helm-bibtex I tried the latest version from github as well as the package from melpa. I use helm version helm-20141226.1305.

No Error messages in the Messages Buffer

Thanks for any ideas on what could be wrong.

Bibtex file

@article{Siebert2010,
title = "Quantifying blue and green virtual water contents in global crop production as well as potential production losses without irrigation ",
journal = "Journal of Hydrology ",
volume = 384,
number = "3–4",
pages = "198 - 217",
year = 2010,
note = "Green-Blue Water Initiative (GBI) ",
issn = "0022-1694",
doi = "http://dx.doi.org/10.1016/j.jhydrol.2009.07.031",
url = "http://www.sciencedirect.com/science/article/pii/S0022169409004235",
author = "Stefan Siebert and Petra Döll",
keywords = "Crop water requirement",
keywords = "Global crop water model",
keywords = "Virtual water content",
keywords = "Irrigation water use",
keywords = "Crop production",
keywords = "Crop yield "
}

@article{Zwart2010WATPRO,
title = "WATPRO: A remote sensing based model for mapping water productivity of wheat ",
journal = "Agricultural Water Management ",
volume = 97,
number = 10,
pages = "1628 - 1636",
year = 2010,
issn = "0378-3774",
doi = "http://dx.doi.org/10.1016/j.agwat.2010.05.017",
url = "http://www.sciencedirect.com/science/article/pii/S037837741000185X",
author = "Sander J. Zwart and Wim G.M. Bastiaanssen and Charlotte de Fraiture and David J. Molden",
keywords = "Water productivity",
keywords = "Global modelling",
keywords = "Benchmarking",
keywords = "Wheat",
keywords = "Remote sensing "
}

Allow to Insert citation in pandoc markdown format

Thank you for this nice mode. Really useful and fast to deal with references and documents.

Would be nice if it could insert citation in the pandoc-citeproc format. In this format (http://johnmacfarlane.net/pandoc/README.html#citations):

Citations go inside square brackets and are separated by semicolons. Each citation must have a key, composed of ‘@’ + the citation identifier from the database, and may optionally have a prefix, a locator, and a suffix. The citation key must begin with a letter or _, and may contain alphanumerics, _, and internal punctuation characters (:.#$%&-+?<>~/). Here are some examples:
Blah blah [see @doe99, pp. 33-35; also @smith04, ch. 1].
Blah blah [@doe99, pp. 33-35, 38-39 and passim].
Blah blah [@smith04; @doe99].
A minus sign (-) before the @ will suppress mention of the author in the citation. This can be useful when the author is already mentioned in the text:
Smith says blah [-@smith04].

Candidates not formatted on helm-bibtex call

Hey, first thanks for a really useful package!

Second, here's an issue I bumped into: when I open the helm buffer (calling helm-bibtex), candidates are not formatted which is a bit annoying with long title references as lines get wrapped: here

This issue goes away after I start filtering some candidates and even if I delete the pattern completely: this

I was thinking that a call to helm-bibtex-candidates-formatter just when the buffer is loaded should fix the issue. I played a bit with the helm-bibtex and helm source but I can't really figure out where this should go. If you can give me some pointers I'm happy to send a pull request.

helm-bibtex-additional-search-fields with repeated fields

If one exports a bibtex file from Zotero one can have multiple annote fields per entry. If one has

(setq helm-bibtex-additional-search-field '(annote))`

only the contents of the last annote are searched. Is there a way to have it search in all annotes of every entry?

Quote key before using in re-search-forward.

Quote the key before using re-search-forward in helm-bibtex-get-entry,
because the key can contain regexp chars.

Use the same search algorithm in helm-bibtex-show-entry to find the
entry as in helm-bibtex-get-entry, because it can be possible to
have string entries which contain the key.

diff --git a/helm-bibtex.el b/helm-bibtex.el
index 237b047..98944b8 100644
--- a/helm-bibtex.el
+++ b/helm-bibtex.el
@@ -262,7 +262,7 @@ (defun helm-bibtex-get-entry (entry-key)
(goto-char (point-min))
(re-search-forward (concat "^@(" parsebib--bibtex-identifier
")[[:space:]][({][[:space:]]"

  •                           entry-key))
    
  •                           (regexp-quote entry-key)))
    
    (let ((entry-type (match-string 1)))
    (helm-bibtex-prep-entry (parsebib-read-entry entry-type)))))

@@ -494,7 +494,10 @@ (defun helm-bibtex-show-entry (key)
(let ((buf (helm-bibtex-buffer-visiting bibtex-file)))
(find-file bibtex-file)
(goto-char (point-min))

  •    (if (search-forward key nil t)
    
  •    (if (re-search-forward
    
  •         (concat "^@\(" parsebib--bibtex-identifier
    
  •                 "\)[[:space:]]_[({][[:space:]]_"
    
  •                 (regexp-quote key)) nil t)
         (throw 'break t)
       (unless buf
         (kill-buffer)))))))
    

Problem of presention - helm bibtex

I have two elements of configuration that are a problem for helm bibtex:
(global-visual-line-mode 1)
(set-fringe-mode 0)
As you can see above it breaks the lines and lead to a very bad presentation of helm bibtex
capture d ecran 2014-09-21 a 00 04 30
I do not know how I could manage to stop (global-visual-line-mode 1) and (set-fringe-mode 0) just when I am using helm-bibtex
Something like "add-hook" could be useful, I suppose. But don't know how to deal with that.

Feature request: Option to auto-populate orgmode notes file

First off, helm-bibtex is AWESOME. I'm not sure I've yet come down from my high from learning about this to help with my research.

I use the orgmode notes option a great deal. I find I start all my note files the same way: by converting key parts of the bibtex entry into org tags. For example, starting my notes file:

#+TITLE: [[http://books.google.com/books?id%3Dy8GiAwAAQBAJ][Event Cognition]] (2014)
#+AUTHOR: Radvansky, G.A. and Zacks, J.M.

from:

@book{radvansky2014event,
  publisher = {Oxford University Press},
  year = {2014},
  url = {http://books.google.com/books?id=y8GiAwAAQBAJ},
  isbn = {9780199898145},
  author = {Radvansky, G.A. and Zacks, J.M.},
  title = {Event Cognition},
}

It would be nice if there were a function/variable to do this automatically if the notes are not yet created, since I'm visiting them via selection of a bibtex entry anyway.

show bibkey in main view

Hi and thx for this great little helm addon.
is there anyway to have the main table show the bibkey alongside date and name?

thx!

Z

File mode specification error

Hi Titus,

I am having an issue with a few items in my bibliography. I insert a citation, using the helm-bibtex function, but when I click on the link (to open the pdf, for example) I get the following in the message buffer:

File mode specification error: (invalid-function dbus-ignore-errors)
(No changes need to be saved)
File mode specification error: (invalid-function dbus-ignore-errors)
progn: Wrong type argument: stringp, nil
(No changes need to be saved)
File mode specification error: (invalid-function dbus-ignore-errors)
!!! No entry found !!!

This happens only with some references. Here is the bibtex entry for two of them, in case it is of any use:

@TechReport{Cameron2011,
Title = {EUSeaMap - Preparatory Action for development and assessment of a European broad-scale seabed habitat map final report},
Author = {Cameron, A., and Askew, N.},
Year = {2011},
Note = {Available at http://jncc.gov.uk/euseamap},
File = {:Cameron2011.pdf:PDF},
Timestamp = {2013.09.09}
}

@TechReport{EUSeaMap,
Title = {Technical Appendix No. 2: Wave base data and thresholds},
Author = {EUSeaMap},
File = {:EUSeaMap.pdf:PDF},
Owner = {julian},
Timestamp = {2015.05.22}
}

Let me know if you need any other information

All the best,

Julian

Possibility of star system

Hi @tmalsburg

Is it possible to give a star function to helm-bibtex, then it can be easier to find some important bibliographies marked before? or think in another way, like i can add priority to any single org-mode headline in org-mode, then let helm-bibtex recognize it? Does this can come true?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.