-
Notifications
You must be signed in to change notification settings - Fork 71
Description
Current Behavior
When building documentation using sphinxcontrib-bibtex
together with sphinx-multiversion
, citations inside Python docstrings (e.g., :cite:\
...``) fail with an error such as:
docstring of quemb.molbe.fragment.fragmentate:19: WARNING: could not find bibtex key "weser_automated_2023" [bibtex.key_not_found]
However, the same citation works correctly when used in an .rst
file. The error only occurs when using sphinx-multiversion
, but not when using sphinx-build
directly or via make html
.
Expected Behavior
Citations in Python docstrings (e.g., using :cite:
) should work identically whether the docs are built using sphinx-build
or sphinx-multiversion
.
Reproduction Steps
Steps to reproduce the behavior:
- Clone the repo:
git clone git@github.com:troyvvgroup/quemb.git
cd quemb
git checkout improve_doc
pip install .
cd docs
pip install -r requirements.txt
- Build the documentation using make (this works):
make html
- Build the documentation manually using sphinx-build (this also works):
sphinx-build -W --keep-going -n source build/html
- Build using sphinx-multiversion (this fails):
sphinx-multiversion -W --keep-going -n source build/html
Environment
Code appears both locally and on GitHub CI pipeline with different python versions.
My local environment:
- Ubuntu 24.04.2 LTS
- Python 3.12.3
Additional Context
-
I am not sure if this is a problem of
sphinxcontrib-bibtex
or ofsphinx-multiversion
and reported the same issue also there -
Link to PR where bug appeared: Improve doc troyvvgroup/quemb#181
-
The citation key exists in the
literature.bib
file and is used successfully in .rst files. -
I asked the question on StackOverflow.
-
A dumbed down
conf.py
of our project looks like this
from pathlib import Path
extensions = [
"sphinx_multiversion",
"sphinxcontrib.bibtex",
]
CONF_DIR = Path(__file__).parent
bibtex_bibfiles = [str(CONF_DIR / "literature.bib")]
Metadata
Metadata
Assignees
Labels
Type
Projects
Status