Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

mdbook-bib

GitHub Crate Test status MPL-2.0 License

mdbook-bib is an mdBook preprocessor for adding citations and bibliographies to your books. mdBook is written in Rust Klabnik2018.

Two Rendering Backends

mdbook-bib offers two rendering backends to suit different needs:

FeatureCustom (Handlebars)CSL
Use caseFull customizationStandard academic formats
Citation stylesCustom templatesIEEE, Chicago, Nature, APA, 80+ more
Interactive elementsCopy buttons, collapsible detailsBasic (links only)
ConfigurationMore flexibleSimpler

Custom Backend (Default)

The Custom backend uses Handlebars templates for maximum flexibility. You control exactly how citations and bibliography entries are rendered, including custom HTML, CSS, and JavaScript.

Best for: Power users who need custom layouts, interactive elements, or non-standard citation formats.

See Custom Backend for details.

CSL Backend

The CSL backend uses hayagriva to render citations in standard academic formats. Simply specify a style name and get properly formatted output.

Best for: Academic writing where you need standard citation styles like IEEE, APA, or Chicago.

See CSL Backend for details.

Quick Start

Configure the preprocessor in book.toml:

[preprocessor.bib]
bibliography = "refs.bib"      # BibTeX or YAML
# Custom mode by default
# backend = "csl"              # Optional: use CSL instead of custom
# csl-style = "ieee"           # Required when backend = "csl"

Cite entries with {{#cite key}} or @@key. For Pandoc compatibility, enable citation-syntax = "pandoc" to also use @key, [@key], and [-@key].

GitHub project

mdbook-bib is Open Source and available on GitHub.

License

mdbook-bib is released under the MPL-2.0 License.

Chapter References
mdBook1 mdBook Documentation
Contributors, Various — 2015 Abstract
Abstract
mdBook is a command line tool and Rust crate to create books using Markdown (as by the CommonMark specification) files. It's very similar to Gitbook but written in Rust.