A MkDocs plugin for citation management using bibtex.
Install the plugin using pip:
pip install mkdocs-bibtex
Next, add the following lines to your mkdocs.yml
:
plugins:
- search
- bibtex:
bib_file: "refs.bib"
cite_style: "pandoc"
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.
bib_file
- Name of your bibtex file. Either the absolute path or the path relative tomkdocs.yml
bib_dir
- Directory for bibtex files to load, same as above for path resolutioncite_style
- The way you place citations into text: "pandoc" for[@myRef]
and "plain" for@myRef
bib_command
- The command for your bibliography, defaults to\bibliography
full_bib_command
- The command for your 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
In your markdown files:
- Add your citations as you would normally using either "plain" or "pandoc" style
- Add in
\bibliography
or whatever you set yourbib_command
to where you want your references. - Add in
\full_bibliography
or whatever you set yourfull_bib_command
to where you want the full set of references. Note: This is not guaranteed to work yet since one issue is the order in which markdown files are processed. Might need to do something using theon_files()
event first. - (Optional) Setup
csl_file
to control the citation text formatting.