Skip to main content

An MkDocs plugin that enables managing citations with BibTex

Project description

testing codecov Language grade: Python

mkdocs-bibtex

A MkDocs plugin for citation management using bibtex.

Setup

Install the plugin using pip:

pip install mkdocs-bibtex

Note: This plugin requires pandoc to be installed on your system.
If you're having trouble with pandoc, try installing the conda-forge version of pypandoc: conda install -c conda-forge pypandoc which will install a version with built in pandoc binaries

Next, add the following lines to your mkdocs.yml:

plugins:
  - search
  - bibtex:
      bib_file: "refs.bib"
markdown_extensions:
  - footnotes

The footnotes extension is how citations are linked for now.

If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if there is no plugins entry set.

Options

  • bib_file - The path or url to a single bibtex file. Path can either be absolute or relative to mkdocs.yml. Example URL: https://api.zotero.org/*/items?format=bibtex
  • bib_dir - Directory for bibtex files to load, same as above for path resolution
  • bib_command - The syntax to render your bibliography, defaults to \bibliography
  • bib_by_default - Automatically append the bib_command at the end of every markdown document, defaults to true
  • full_bib_command - The syntax to render your entire bibliography, defaults to \full_bibliography
  • csl_file - The path or url to a bibtex CSL file, specifying your citation format. Defaults to None, which renders in a plain format. A registry of citation styles can be found here: https://github.com/citation-style-language/styles
  • cite_inline - Whether or not to render citations inline, requires csl_file to be specified. Defaults to False.

Usage

In your markdown files:

  1. Add your citations as you would if you used pandoc, IE: [@first_cite;@second_cite]
  2. Add \bibliography, or the value of bib_command, to the doc you want your references rendered (if bib_by_default is set to true this is automatically applied for every page).
  3. (Optional) Add \full_bibliography, or the value of full_bib_command, to where you want the full bibliography rendered. Note: This is currently not working properly, since this plugin can't dictate the order in which files are processed. The best way to ensure the file with the full bibliography gets processed last is to use numbers in front of file/folder names to enforce the order of processing, IE: 01_my_first_file.md
  4. (Optional) Configure the csl_file option to dictate the citation text formatting.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs-bibtex-recursive-2.8.14.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

mkdocs_bibtex_recursive-2.8.14-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs-bibtex-recursive-2.8.14.tar.gz.

File metadata

File hashes

Hashes for mkdocs-bibtex-recursive-2.8.14.tar.gz
Algorithm Hash digest
SHA256 936807db679caba29ce613c5126ef2a4dfaa27e8c3a3a51ce88383152477592c
MD5 09407769c4f1955529c76db3e02ba2f4
BLAKE2b-256 0f3bcb7db7659145c7663c33a18377b1301e84c812cfcc6b9569a855f57c016c

See more details on using hashes here.

File details

Details for the file mkdocs_bibtex_recursive-2.8.14-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_bibtex_recursive-2.8.14-py3-none-any.whl
Algorithm Hash digest
SHA256 b636ac0ffd5f1a0c52858bfa035b7f45e3c9f2298d41fb30e664e1a7e15fb53f
MD5 49433a421417e141ba75fdf3b4016717
BLAKE2b-256 cb9f4eed4f8fd5186703fdac3e5996bb89584c0fada3007b426417f704c4c0a1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page