ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Cite​Bibtex

by sjpfenninger ST3

Effortlessly insert citations from BibTeX into texts written in Pandoc or LaTeX

Details

Installs

  • Total 7K
  • Win 3K
  • Mac 3K
  • Linux 1K
Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13
Windows 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0
Mac 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

CiteBibtex

A Sublime Text plugin to effortlessly insert citations from BibTeX into texts written in Pandoc or LaTeX.

Installation

Install via Package Control.

Compatible with Sublime Text 3 only.

Initial configuration

Set the path to your global BibTeX file (bibtex_file) in the plugin settings.

Use

Pressing the citation shortcut key (bound to F10 by default) brings up a quick panel for searching the bibliography file. Once the desired reference is found, pressing enter or clicking on it will insert a citation at the current cursor position (if there is more than one cursor, at the first cursor's position). The BibTeX file is checked for modifications each time the quick panel is brought up.

The format for inserted citations is auto-detected as pandoc (for use with Pandoc) or latex based on the syntax of the open file (this can be disabled by setting "autodetect_citation_style": false in the plugin settings). If auto-detection fails, the default is to use pandoc (which can be changed by setting default_citation_style in the plugin settings).

The bibtex_file setting can be overridden on a per-project basis in the project settings, using either a path relative to the project settings file or an absolute path. The following example project settings demonstrate this:

{
    "folders":
    [
        {
            "follow_symlinks": true,
            "path": ".",
        }
    ],
    "bibtex_file": "path/to/bibtex.bib"
}

Inserting plaintext bibliography entries

There is a separate command (bound to F9 by default) to insert a pre-formatted plaintext bibliography entry rather than a citation key. This is configured via the new citation_format_string setting in the plugin settings, which is a Python format string, set to "{author} ({year}). {title}" by default. Any BibTeX field can be used in the format string, missing ones will be replaced with an empty string.

Extraction of citations from master BibTeX file

The command CiteBibTeX: Extract citations in current file is available via the command palette, and will extract all references used in the currently open file from the global BibTeX file, saving that subset in a local BibTeX file.

For example, if my_paper.md is currently open and cites 10 out of 100 references in the global BibTeX file, calling this command will save those 10 references in a file called my_paper.bib in the same directory as my_paper.md. This may useful to keep references portable alongside the text that uses them for sharing or archiving.

Acknowledgments

Includes the BibTeX parsing library python-bibtexparser (LGPLv3-licensed).

Includes md2bib.py from pandoc-wrappers by Joseph Reagle (GPLv3-licensed).

License

GNU GPLv3 (see LICENSE file).