bibtex: format layer

Remove packages-config.el
Fix format of README
This commit is contained in:
syl20bnr 2016-04-16 22:32:11 -04:00
parent 97aff9d8db
commit 9160109110
6 changed files with 87 additions and 107 deletions

View File

@ -5,6 +5,7 @@
* Table of Contents :TOC_4_gh:noexport:
- [[#description][Description]]
- [[#features][Features:]]
- [[#bibtex][BibTeX]]
- [[#important-note][Important Note]]
- [[#install][Install]]
- [[#layer][Layer]]
@ -31,10 +32,7 @@
- [[#org-mime][Org-MIME]]
* Description
This layer enables [[http://orgmode.org/][org mode]] for Spacemacs.
For more extensive support of references through BibTeX files, have a look at
the [[../+lang/bibtex][BibTeX layer]].
This layer enables [[http://orgmode.org/][org mode]] for Spacemacs.
** Features:
- Vim inspired key bindings are provided by [[https://github.com/edwtjo/evil-org-mode][evil-org-mode]]
@ -43,6 +41,10 @@ the [[../+lang/bibtex][BibTeX layer]].
- TODO capture via [[https://github.com/waymondo/org-repo-todo][org-repo-todo]]
- presentation mode via [[https://github.com/rlister/org-present][org-present]]
** BibTeX
For more extensive support of references through BibTeX files, have a look at
the [[../+lang/bibtex][BibTeX layer]].
** Important Note
Since version 0.104, spacemacs uses the =org= version from the org ELPA
repository instead of the one shipped with emacs. Then, any =org= related code

View File

@ -1,11 +1,12 @@
#+TITLE: BibTeX layer
#+HTML_HEAD_EXTRA: <link rel="stylesheet" type="text/css" href="../../css/readtheorg.css" />
[[file:img/logo.png]]
* Table of Contents :TOC_4_org:noexport:
- [[Description][Description]]
- [[Install][Install]]
- [[Configuration][Configuration]]
- [[Key bindings][Key bindings]]
* Table of Contents :TOC_4_gh:noexport:
- [[#description][Description]]
- [[#install][Install]]
- [[#configuration][Configuration]]
- [[#key-bindings][Key bindings]]
* Description
BibTeX and BibLaTeX files are a common way to manage bibliographies. The format
@ -20,11 +21,9 @@ Once enabled, this layer also introduces additional shortcuts in other modes to
easily insert citations.
* Install
To use this contribution add it to your =~/.spacemacs=
#+begin_src emacs-lisp
(setq-default dotspacemacs-configuration-layers '(bibtex))
#+end_src
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
@ -37,7 +36,7 @@ configuration, add this to your =~/.spacemacs= inside
org-ref-bibliography-notes "~/Papers/notes.org")
#+end_src
Certain modes, such as ~latex-mode~ with AucTeX, will automatically lookup
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~).
@ -46,32 +45,34 @@ You can also customize which program is used to display the PDFs. For example,
to use Zathura:
#+begin_src emacs-lisp
(setq org-ref-open-pdf-function (lambda (fpath) (start-process "zathura" "*helm-bibtex-zathura*" "/usr/bin/zathura" fpath)))
(setq org-ref-open-pdf-function
(lambda (fpath)
(start-process "zathura" "*helm-bibtex-zathura*" "/usr/bin/zathura" fpath)))
#+end_src
More configuration options are available and are detailed in the ~org-ref~ and
~helm-bibtex~ package documentations.
More configuration options are available and are detailed in the =org-ref= and
=helm-bibtex= package documentations.
* Key bindings
In a Bib(La)TeX files, the following key bindings are added:
In a Bib(La)TeX file, the following key bindings are added:
| Key Binding | Description |
|---------------+--------------------------------------------|
| ~<SPC> m j~ | Next entry |
| ~<SPC> m 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 |
| ~<SPC> m l a~ | Lookup and add arXiv paper (don't get PDF) |
| ~<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 |
| Key Binding | Description |
|-------------+--------------------------------------------|
| ~SPC m j~ | Next entry |
| ~SPC m 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 |
| ~SPC m l a~ | Lookup and add arXiv paper (don't get PDF) |
| ~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 |
In addition, ~org-mode~, ~latex-mode~ and ~markdown-mode~ all have the following
In addition, =org-mode=, =latex-mode= and =markdown-mode= all have the following
key binding added:
| Key Binding | Description |

View File

@ -1,57 +0,0 @@
;;; packages-config.el --- BibTeX Layer packages file for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Joshua Ellis <josh@jpellis.me>
;; URL: https://github.com/JP-Ellis
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;;; Commentary:
;;; Code:
(defun bibtex/init-org-ref ()
(use-package org-ref
:defer t
:config
(progn
(spacemacs/set-leader-keys-for-major-mode 'bibtex-mode
;; Navigation
"j" 'org-ref-bibtex-next-entry
"k" 'org-ref-bibtex-previous-entry
;; Open
"b" 'org-ref-open-in-browser
"n" 'org-ref-open-bibtex-notes
"p" 'org-ref-open-bibtex-pdf
;; Misc
"h" 'org-ref-bibtex-hydra/body
"i" 'org-ref-bibtex-hydra/org-ref-bibtex-new-entry/body-and-exit
"s" 'org-ref-sort-bibtex-entry
;; Lookup utilities
"la" 'arxiv-add-bibtex-entry
"lA" 'arxiv-get-pdf-add-bibtex-entry
"ld" 'doi-utils-add-bibtex-entry-from-doi
"li" 'isbn-to-bibtex
"lp" 'pubmed-insert-bibtex-from-pmid
))))
(defun bibtex/post-init-auctex ()
(spacemacs/set-leader-keys-for-major-mode 'latex-mode
"ic" 'org-ref-helm-insert-cite-link))
(defun bibtex/post-init-org ()
(spacemacs/set-leader-keys-for-major-mode 'org-mode
"ic" 'org-ref-helm-insert-cite-link))
(defun bibtex/post-init-markdown-mode ()
(spacemacs/set-leader-keys-for-major-mode 'markdown-mode
"ic" 'org-ref-helm-insert-cite-link))
;;; packages.el ends here

View File

@ -9,17 +9,49 @@
;;
;;; License: GPLv3
;;; Commentary:
;;; Code:
(defconst bibtex-packages
'(
auctex
helm
org
org-ref
markdown-mode
))
(defun bibtex/post-init-auctex ()
(spacemacs/set-leader-keys-for-major-mode 'latex-mode
"ic" 'org-ref-helm-insert-cite-link))
(defun bibtex/post-init-org ()
(spacemacs/set-leader-keys-for-major-mode 'org-mode
"ic" 'org-ref-helm-insert-cite-link))
(defun bibtex/init-org-ref ()
(use-package org-ref
:defer t
:config (spacemacs/set-leader-keys-for-major-mode 'bibtex-mode
;; Navigation
"j" 'org-ref-bibtex-next-entry
"k" 'org-ref-bibtex-previous-entry
;; Open
"b" 'org-ref-open-in-browser
"n" 'org-ref-open-bibtex-notes
"p" 'org-ref-open-bibtex-pdf
;; Misc
"h" 'org-ref-bibtex-hydra/body
"i" 'org-ref-bibtex-hydra/org-ref-bibtex-new-entry/body-and-exit
"s" 'org-ref-sort-bibtex-entry
;; Lookup utilities
"la" 'arxiv-add-bibtex-entry
"lA" 'arxiv-get-pdf-add-bibtex-entry
"ld" 'doi-utils-add-bibtex-entry-from-doi
"li" 'isbn-to-bibtex
"lp" 'pubmed-insert-bibtex-from-pmid)))
(defun bibtex/post-init-markdown-mode ()
(spacemacs/set-leader-keys-for-major-mode 'markdown-mode
"ic" 'org-ref-helm-insert-cite-link))
;;; packages-config.el ends here

View File

@ -5,6 +5,7 @@
* Table of Contents :TOC_4_gh:noexport:
- [[#description][Description]]
- [[#features][Features]]
- [[#bibtex][BibTeX]]
- [[#install][Install]]
- [[#layer][Layer]]
- [[#auto-completion][Auto-completion]]
@ -19,15 +20,16 @@
* Description
This layer adds support for LaTeX files with [[https://savannah.gnu.org/projects/auctex/][AucTeX]].
For more extensive support of BibTeX files than RefTeX provides, have a look at
the [[../bibtex][BibTeX layer]].
** Features
- Auto-build with [[https://github.com/tom-tan/auctex-latexmk/][auctex-latexmk]]
- Auto-completion with [[https://github.com/alexeyr/company-auctex][company-auctex]]
- Tags navigation on ~%~ with [[https://github.com/redguardtoo/evil-matchit][evil-matchit]]
- Labels, references, citations and index entries management with [[http://www.gnu.org/software/emacs/manual/html_node/reftex/index.html][RefTeX]]
** BibTeX
For more extensive support of BibTeX files than RefTeX provides, have a look at
the [[../bibtex][BibTeX layer]].
* Install
** Layer
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
@ -86,6 +88,7 @@ is nil.
#+END_SRC
* Keybindings
| Key Binding | Description |
|---------------+--------------------------------------------|
| ~SPC m -~ | recenter output buffer |

View File

@ -5,6 +5,7 @@
* Table of Contents :TOC_4_gh:noexport:
- [[#description][Description]]
- [[#features][Features:]]
- [[#bibtex][BibTeX]]
- [[#install][Install]]
- [[#usage][Usage]]
- [[#key-bindings][Key bindings]]
@ -20,30 +21,28 @@
- [[#promotion-demotion][Promotion, Demotion]]
* Description
This layer adds markdown support to Spacemacs.
For more extensive support of references with BibTeX files, have a look at the
[[../bibtex][BibTeX layer]].
** Features:
- markdown files support via [[http://jblevins.org/git/markdown-mode.git/][markdown-mode]]
- TOC generation via [[https://github.com/ardumont/markdown-toc][markdown-toc]]
- Completion of Emojis using [[https://github.com/dunn/company-emoji][company-emoji]] (still needs a way of showing, either
using the =emoji= layer or having a proper font) :clap:
** BibTeX
For more extensive support of references with BibTeX files, have a look at the
[[../bibtex][BibTeX layer]].
* Install
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
add =markdown= to the existing =dotspacemacs-configuration-layers= list in this
file.
* Usage
To generate a table of contents type on top of the buffer:
~SPC SPC markdown-toc/generate-toc RET~
* Key bindings
** Element insertion
| Key Binding | Description |