sphinxcontrib-bibtex
Sphinx extension for BibTeX style citations.
Overview
The bibtex extension allows BibTeX citations to be inserted into documentation generated by Sphinx, via a bibliography directive, along with :cite:p: and :cite:t: roles. These work similarly to LaTeX’s thebibliography environment and the \citet and \citep commands.
For formatting, the extension relies on pybtex written by Andrey Golovizin. The extension is inspired by Matthew Brett’s bibstuff.sphinxext.bibref and Weston Nielson’s sphinx-natbib.
Download: https://pypi.org/project/sphinxcontrib-bibtex/#files
Documentation: https://sphinxcontrib-bibtex.readthedocs.io/en/latest/
Development: https://github.com/mcmtroffaes/sphinxcontrib-bibtex/
Installation
Install the module with pip install sphinxcontrib-bibtex, or from source using pip install -e .. Then add:
extensions = ['sphinxcontrib.bibtex']
bibtex_bibfiles = ['refs.bib']
to your project’s Sphinx configuration file conf.py.
Minimal Example
In your project’s documentation, you can use :cite:t: for textual citation references, :cite:p: for parenthetical citation references, and .. bibliography:: for inserting the bibliography. For example:
See :cite:t:`1987:nelson` for an introduction to non-standard analysis.
Non-standard analysis is fun :cite:p:`1987:nelson`.
.. bibliography::
where refs.bib would contain an entry:
@Book{1987:nelson,
author = {Edward Nelson},
title = {Radically Elementary Probability Theory},
publisher = {Princeton University Press},
year = {1987}
}
In the default style, this will get rendered as:
See Nelson [Nel87a] for an introduction to non-standard analysis. Non-standard analysis is fun [Nel87a].
Citations in sphinx are resolved globally across all documents. Typically, you have a single bibliography directive across your entire project which collects all citations. Advanced use cases with multiple bibliography directives across your project are also supported, but some care needs to be taken from your end to avoid duplicate citations.
In contrast, footnotes in sphinx are resolved locally per document. To achieve local bibliographies per document, you can use citations represented by footnotes as follows:
See :footcite:t:`1987:nelson` for an introduction to non-standard analysis.
Non-standard analysis is fun\ :footcite:p:`1987:nelson`.
.. footbibliography::
which will get rendered as:
See Nelson[1] for an introduction to non-standard analysis. Non-standard analysis is fun[1].
Note the use of the backslash escaped space to suppress the space that would otherwise precede the footnote.
Typically, you have a single footbibliography directive at the bottom of each document that has footnote citations. Advanced use cases with multiple footbibliography directives per document are also supported. Since everything is local, there is no concern with duplicate citations when using footnotes.
Metadata
Release files for sphinxcontrib-bibtex 2.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sphinxcontrib_bibtex-2.7.0.tar.gz | 120.7 kB | With provenance | Details for sphinxcontrib_bibtex-2.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sphinxcontrib_bibtex-2.7.0-py3-none-any.whl | Python 3 | none | any | Details for sphinxcontrib_bibtex-2.7.0-py3-none-any.whl |
Total release size: 161.0 kB
Release files / sphinxcontrib_bibtex-2.7.0.tar.gz
| Download URL | sphinxcontrib_bibtex-2.7.0.tar.gz |
|---|---|
| Size | 120.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fee700f7aae29bb8f654c62913f00d34ac44fc0b8ca0fa67ac922ff4453addee
|
|
BLAKE2b-256 checksum How to use checksums |
156a8e0b2c2420286389e7fed78ff361ec30e2f1d58c8560af8d64df5e7b61e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 6, 2026.
Transparency logRelease files / sphinxcontrib_bibtex-2.7.0-py3-none-any.whl
| Download URL | sphinxcontrib_bibtex-2.7.0-py3-none-any.whl |
|---|---|
| Size | 40.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28cf0ec7a957d1c7548d5749317ed472ce877e1b629f430f88e3789aa51f87b1
|
|
BLAKE2b-256 checksum How to use checksums |
52c0d28e62407f4733bbe0169287bc012f0ac3b4a2021066b285570654119c8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 6, 2026.
Transparency logSecurity for sphinxcontrib-bibtex 2.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for sphinxcontrib_bibtex-2.7.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.