Package: mkdocs-bibtex
mkdocs-bibtexAMkDocsplugin for citation management using bibtex.SetupInstall the plugin using pip:pip install mkdocs-bibtexNote: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 pypandocwhich will install a version with built in pandoc binariesNext, add the following lines to yourmkdocs.yml:plugins:
  - search
  - bibtex:
      bib_file: "refs.bib"
markdown_extensions:
  - footnotesThe footnotes extension is how citations are linked for now.If you have nopluginsentry in your config file yet, you'll likely also want to add thesearchplugin. MkDocs enables it by default if there is nopluginsentry set.Optionsbib_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=bibtexbib_dir- Directory for bibtex files to load, same as above for path resolutionbib_command- The syntax to render your bibliography, defaults to\bibliographybib_by_default- Automatically append thebib_commandat the end of every markdown document, defaults totruefull_bib_command- The syntax to render your entire bibliography, defaults to\full_bibliographycsl_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_fileto be specified. Defaults toFalse.UsageIn 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_defaultis 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 thecsl_fileoption to dictate the citation text formatting.DebuggingYou may wish to use the verbose flag in mkdocs (-v) to log debug messages. You should see something like this(...)DEBUG-Parsingbibtexfile'docs/bib/papers.bib'...
INFO-SUCCESSParsingbibtexfile'docs/bib/papers.bib'DEBUG-DownloadingCSLfilefromURLhttps://raw.githubusercontent.com/citation-style-language/styles/master/apa-6th-edition.csltotemporaryfile...
INFO-CSLfiledownladedfromURLhttps://raw.githubusercontent.com/citation-style-language/styles/master/apa-6th-edition.csltotemporaryfile(<tempfile._TemporaryFileWrapperobjectat0x00000203E4F2F650>)(...)DEBUG-Reading:publications.md
DEBUG-Running2`page_markdown`events
DEBUG-Formattingallbibentries...
DEBUG---Convertingbibtexentry'foo2019'withCSLfile'docs/bib/apa_verbose.csl'usingpandoc>=2.11
DEBUG---SUCCESSConvertingbibtexentry'foo2019'withCSLfile'docs/bib/apa_verbose.csl'usingpandoc>=2.11
DEBUG---Convertingbibtexentry'bar2024'withCSLfile'docs/bib/apa_verbose.csl'usingpandoc>=2.11
DEBUG---SUCCESSConvertingbibtexentry'bar2024'withCSLfile'docs/bib/apa_verbose.csl'usingpandoc>=2.11
INFO-SUCCESSFormattingallbibentries
DEBUG-Replacingcitationkeyswiththegeneratedones...
DEBUG---Renderingcitationinlinefor'[@foo2019]'...
DEBUG-----Convertingpandoccitationkey'[@foo2019]'withCSLfile'docs/bib/apa_verbose.csl'andBibliographyfile'(...)/tmpzt7t8p0y/temp.bib'...
DEBUG-----SUCCESSConvertingpandoccitationkey'[@foo2019]'withCSLfile'docs/bib/apa_verbose.csl'andBibliographyfile'(...)/tmpzt7t8p0y/temp.bib'DEBUG---SUCCESSRenderingcitationinlinefor'[@foo2019]'DEBUG---Renderingcitationinlinefor'[@bar2024]'...
DEBUG-----Convertingpandoccitationkey'[@bar2024]'withCSLfile'docs/bib/apa_verbose.csl'andBibliographyfile'(...)/tmpzt7t8p0y/temp.bib'...
DEBUG-----SUCCESSConvertingpandoccitationkey'[@bar2024]'withCSLfile'docs/bib/apa_verbose.csl'andBibliographyfile'(...)/tmpzt7t8p0y/temp.bib'DEBUG---SUCCESSRenderingcitationinlinefor'[@bar2024]'DEBUG-SUCCESSReplacingcitationkeyswiththegeneratedones