2016-03-30 08:44:30 +00:00
|
|
|
|
#+TITLE: BibTeX layer
|
2016-04-17 02:32:11 +00:00
|
|
|
|
|
2016-03-30 08:44:30 +00:00
|
|
|
|
[[file:img/logo.png]]
|
2016-04-17 02:32:11 +00:00
|
|
|
|
|
2018-09-19 03:54:47 +00:00
|
|
|
|
* Table of Contents :TOC_4_gh:noexport:
|
2017-05-22 14:16:12 +00:00
|
|
|
|
- [[#description][Description]]
|
2018-01-09 21:38:12 +00:00
|
|
|
|
- [[#features][Features:]]
|
2017-05-22 14:16:12 +00:00
|
|
|
|
- [[#install][Install]]
|
|
|
|
|
- [[#configuration][Configuration]]
|
|
|
|
|
- [[#key-bindings][Key bindings]]
|
2016-03-30 08:44:30 +00:00
|
|
|
|
|
|
|
|
|
* Description
|
2018-01-09 21:38:12 +00:00
|
|
|
|
BibTeX and BibLaTeX files are a common way to manage bibliographies. The format
|
2016-03-30 08:44:30 +00:00
|
|
|
|
was original designed to work with LaTeX files and subsequently has been adopted
|
|
|
|
|
by other markup formats such as MarkDown and Org mode.
|
|
|
|
|
|
2018-01-09 21:38:12 +00:00
|
|
|
|
This layer adds support to manipulate BibTeX and BibLaTeX files in Spacemacs.
|
2016-03-30 08:44:30 +00:00
|
|
|
|
|
2018-01-09 21:38:12 +00:00
|
|
|
|
** Features:
|
|
|
|
|
- Syntax highlighting for BibTeX and BibLaTeX files.
|
|
|
|
|
- Utilities for automatically adding entries from different data sources.
|
|
|
|
|
- Support for inserting citations in various other modes.
|
2016-03-30 08:44:30 +00:00
|
|
|
|
|
|
|
|
|
* Install
|
2016-04-17 02:32:11 +00:00
|
|
|
|
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.
|
2016-03-30 08:44:30 +00:00
|
|
|
|
|
|
|
|
|
* Configuration
|
2018-01-09 21:38:12 +00:00
|
|
|
|
This layer also supports having a global BibTeX file. For a basic
|
2016-03-30 08:44:30 +00:00
|
|
|
|
configuration, add this to your =~/.spacemacs= inside
|
|
|
|
|
=dotspacemacs/user-config=:
|
|
|
|
|
|
2018-09-19 03:54:47 +00:00
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
2016-03-30 08:44:30 +00:00
|
|
|
|
(setq org-ref-default-bibliography '("~/Papers/references.bib")
|
|
|
|
|
org-ref-pdf-directory "~/Papers/"
|
|
|
|
|
org-ref-bibliography-notes "~/Papers/notes.org")
|
2018-09-19 03:54:47 +00:00
|
|
|
|
#+END_SRC
|
2016-03-30 08:44:30 +00:00
|
|
|
|
|
2016-04-17 02:32:11 +00:00
|
|
|
|
Certain modes, such as =latex-mode= with AucTeX, will automatically lookup
|
2016-03-30 08:44:30 +00:00
|
|
|
|
references in a document if any of the recognized bibliography commands are
|
2018-01-09 21:38:12 +00:00
|
|
|
|
used. Other modes may have a similar feature, or one could always set
|
2016-03-30 08:44:30 +00:00
|
|
|
|
file-local variables (through ~SPC f v f~).
|
|
|
|
|
|
2018-01-09 21:38:12 +00:00
|
|
|
|
You can also customize which program is used to display the PDFs. For example,
|
2016-03-30 08:44:30 +00:00
|
|
|
|
to use Zathura:
|
|
|
|
|
|
2018-09-19 03:54:47 +00:00
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
2016-04-17 02:32:11 +00:00
|
|
|
|
(setq org-ref-open-pdf-function
|
|
|
|
|
(lambda (fpath)
|
|
|
|
|
(start-process "zathura" "*helm-bibtex-zathura*" "/usr/bin/zathura" fpath)))
|
2018-09-19 03:54:47 +00:00
|
|
|
|
#+END_SRC
|
2016-03-30 08:44:30 +00:00
|
|
|
|
|
2016-04-17 02:32:11 +00:00
|
|
|
|
More configuration options are available and are detailed in the =org-ref= and
|
|
|
|
|
=helm-bibtex= package documentations.
|
2016-03-30 08:44:30 +00:00
|
|
|
|
|
|
|
|
|
* Key bindings
|
2016-04-17 02:32:11 +00:00
|
|
|
|
In a Bib(La)TeX file, the following key bindings are added:
|
|
|
|
|
|
2016-05-06 11:03:30 +00:00
|
|
|
|
| Key Binding | Description |
|
|
|
|
|
|---------------------------+--------------------------------------------|
|
|
|
|
|
| ~SPC m j~ / ~g j~ / ~C-j~ | Next entry |
|
|
|
|
|
| ~SPC m k~ / ~g k~ / ~C-k~ | Previous entry |
|
|
|
|
|
| ~SPC m p~ | Open PDF |
|
|
|
|
|
| ~SPC m n~ | Open notes |
|
|
|
|
|
| ~SPC m b~ | Open browser |
|
|
|
|
|
| ~SPC m i~ | Insert new entry |
|
|
|
|
|
| ~SPC m s~ | Sort entry |
|
|
|
|
|
| ~SPC m h~ | Various actions on entry |
|
2018-09-19 03:54:47 +00:00
|
|
|
|
| ~SPC m l a~ | Lookup and add arXiv paper (don’t get PDF) |
|
2016-05-06 11:03:30 +00:00
|
|
|
|
| ~SPC m l A~ | Lookup and add arXiv paper (download PDF) |
|
|
|
|
|
| ~SPC m l d~ | Lookup and add paper by DOI |
|
|
|
|
|
| ~SPC m l i~ | Lookup and add book by ISBN |
|
|
|
|
|
| ~SPC m l p~ | Lookup and add paper by PMID |
|
2016-04-17 02:32:11 +00:00
|
|
|
|
|
|
|
|
|
In addition, =org-mode=, =latex-mode= and =markdown-mode= all have the following
|
2016-03-30 08:44:30 +00:00
|
|
|
|
key binding added:
|
|
|
|
|
|
|
|
|
|
| Key Binding | Description |
|
|
|
|
|
|-------------+-----------------|
|
|
|
|
|
| ~SPC m i c~ | Insert citation |
|