An MkDocs plugin that enables managing citations with BibTex
Project description
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 thesearch
plugin. MkDocs enables it by default if there is noplugins
entry set.
Options
bib_file
- The path or url to a single bibtex file. Path can either be absolute or relative tomkdocs.yml
. Example URL:https://api.zotero.org/*/items?format=bibtex
bib_dir
- Directory for bibtex files to load, same as above for path resolutionbib_command
- The syntax to render your bibliography, defaults to\bibliography
bib_by_default
- Automatically append thebib_command
at the end of every markdown document, defaults totrue
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 toNone
, which renders in a plain format. A registry of citation styles can be found here: https://github.com/citation-style-language/stylescite_inline
- Whether or not to render citations inline, requirescsl_file
to be specified. Defaults toFalse
.
Usage
In your markdown files:
- Add your citations as you would if you used pandoc, IE:
[@first_cite;@second_cite]
- Add
\bibliography
, or the value ofbib_command
, to the doc you want your references rendered (ifbib_by_default
is set to true this is automatically applied for every page). - (Optional) Add
\full_bibliography
, or the value offull_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
- (Optional) Configure the
csl_file
option to dictate the citation text formatting.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file mkdocs-bibtex-2.8.3.tar.gz
.
File metadata
- Download URL: mkdocs-bibtex-2.8.3.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 787d8cbe97736d26cc9d38843df49479d3589b0cf10e7931ec1a89e9f533891c |
|
MD5 | a2d18eeb1122f26932f9abcd66eb8335 |
|
BLAKE2b-256 | 37a4ecab491c8211c8d55e3ffdd5ef8e0d0400309d6e46c72689129603526c08 |