Skip to content

Latest commit

 

History

History
 
 

bibtex

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

BibTeX layer

img/logo.png

Table of Contents

Description

BibTeX and BibLaTeX files are a common way to manage bibliographies. The format was original designed to work with LaTeX files and subsequently has been adopted by other markup formats such as MarkDown and Org mode.

This layer adds support to manipulate BibTeX and BibLaTeX files and offer utilities to automatically add new entries by DOI, arXiv identifier, ISBN, and more.

Once enabled, this layer also introduces additional shortcuts in other modes to easily insert citations.

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add bibtex to the existing dotspacemacs-configuration-layers list in this file.

Configuration

This layer also supports having a global BibTeX file. For a basic configuration, add this to your ~/.spacemacs inside dotspacemacs/user-config:

(setq org-ref-default-bibliography '("~/Papers/references.bib")
      org-ref-pdf-directory "~/Papers/"
      org-ref-bibliography-notes "~/Papers/notes.org")

Certain modes, such as latex-mode with AucTeX, will automatically lookup references in a document if any of the recognized bibliography commands are used. Other modes may have a similar feature, or one could always set file-local variables (through SPC f v f).

You can also customize which program is used to display the PDFs. For example, to use Zathura:

(setq org-ref-open-pdf-function
  (lambda (fpath)
    (start-process "zathura" "*helm-bibtex-zathura*" "/usr/bin/zathura" fpath)))

More configuration options are available and are detailed in the org-ref and helm-bibtex package documentations.

Key bindings

In a Bib(La)TeX file, the following key bindings are added:

Key BindingDescription
SPC m j / g j / C-jNext entry
SPC m k / g k / C-kPrevious entry
SPC m pOpen PDF
SPC m nOpen notes
SPC m bOpen browser
SPC m iInsert new entry
SPC m sSort entry
SPC m hVarious actions on entry
SPC m l aLookup and add arXiv paper (don’t get PDF)
SPC m l ALookup and add arXiv paper (download PDF)
SPC m l dLookup and add paper by DOI
SPC m l iLookup and add book by ISBN
SPC m l pLookup and add paper by PMID

In addition, org-mode, latex-mode and markdown-mode all have the following key binding added:

Key BindingDescription
SPC m i cInsert citation