Including citations in your book


Because jupyter-book is built on top of Jekyll, we can use the excellent jekyll-scholar book to include citations and a bibliography with your book.

Note that this only works if you're building your book HTML locally and hosting the HTML files online somewhere. This can still use GitHub pages, but not the auto-generation of a cite from markdown files feature of GitHub pages. This is because GitHub pages doesn't include the jekyll-scholar plugin.

How to use citations

Including citations with your markdown files or notebooks is done in the following way.

  1. Modify the file in _bibliography/references.bib. This has a few sample citations in bibtex form. Update as you wish!
  2. In your content, add the following text to include a citation

    {% cite bibtex_shortname %}

    For example, this text: {% cite holdgraf_evidence_2014 %} generates this citation: (Holdgraf, de Heer, Pasley, & Knight, 2014)

    You can also include multiple citations in one go, like so:

    {% cite holdgraf_evidence_2014 holdgraf_portable_2017 ruby %} becomes (Holdgraf, de Heer, Pasley, & Knight, 2014; Holdgraf et al., 2017; Flanagan & Matsumoto, 2008)

  3. Generate a bibliography on your page by using the following text:

    {% bibliography %}

    This will generate a bibliography for your entire bibtex file. If you'd like to restrict the bibliography to only the citations you've used on a page, use the following syntax:

    {% bibliography --cited %}

When your book is built, the bibliography and citations will now be included. For example, see the Bibliography generated below!


  1. Holdgraf, C. R., de Heer, W., Pasley, B. N., & Knight, R. T. (2014). Evidence for Predictive Coding in Human Auditory Cortex. In International Conference on Cognitive Neuroscience. Brisbane, Australia, Australia: Frontiers in Neuroscience.
  2. Holdgraf, C. R., Culich, A., Rokem, A., Deniz, F., Alegro, M., & Ushizima, D. (2017). Portable learning environments for hands-on computational instruction using container-and cloud-based technology to teach data science. In ACM International Conference Proceeding Series (Vol. Part F1287).
  3. Flanagan, D., & Matsumoto, Y. (2008). The Ruby Programming Language. O’Reilly Media.