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

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 - Name of your bibtex file. Either the absolute path or the path relative to mkdocs.yml
  • bib_dir - Directory for bibtex files to load, same as above for path resolution
  • bib_command - The command for your bibliography, defaults to \bibliography
  • full_bib_command - The command for your full bibliography, defaults to \full_bibliography
  • csl_file - Bibtex CSL file to format the citation with, defaults to None, using a built in plain format instead

Usage

In your markdown files:

  1. Add your citations as you would if you used pandoc, IE: [@first_cite;@second_cite]
  2. Add in \bibliography or whatever you set your bib_command to where you want your references.
  3. Add in \full_bibliography or whatever you set your full_bib_command to where you want the full set of references. Note: This is not work just right since this plugin can't dictate the orer 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 an order of processing, IE: 01_my_first_file.md
  4. (Optional) Setup csl_file to control 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-2.0.1.tar.gz (14.9 kB view details)

Uploaded Source

File details

Details for the file mkdocs-bibtex-2.0.1.tar.gz.

File metadata

  • Download URL: mkdocs-bibtex-2.0.1.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for mkdocs-bibtex-2.0.1.tar.gz
Algorithm Hash digest
SHA256 5a3b1eb1ed0688ad8a303e7273dbbaf283f678ddeaed796b0cbfa7d4e53c63e7
MD5 f8e932bd6269e97cfb9c2c3ad3ee120b
BLAKE2b-256 0b6dd7608f8e76dca6207a88bc66fbfe70f1c5060bf31b1e78184e51d596e60b

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