Question

I am using Sphinx (version 1.1.3) & sphinxcontrib.bibtex to create a document for a python coding project I am doing.

I have the following in a separate file from the rest of my documents in a file named zreferences.rst

.. rubric:: References

.. bibliography:: refs.bib
   :cited:

This works fine when building a html output with make html; however, when I run make latexpdf, the references are absent from this page of the document, but they do show on the Bibliography page that is automatically created from the latex template Sphinx uses.

I don't want to have a redundant references page, so I tried removing the references document, but then the html build ceases to compile.

Is there anybody familiar with Sphinx, LaTeX and Bibtex that knows what's going on here? Thanks!

Was it helpful?

Solution

Sphinx's latex writer needs fixing to match the html output more closely. This issue will occur also if you use regular citations in Sphinx: it has nothing to do with sphinxcontrib-bibtex per se.

Users of sphinxcontrib-bibtex are of course the most likely ones to encounter this problem. I've created an upstream ticket for it: https://github.com/mcmtroffaes/sphinxcontrib-bibtex/issues/48

For now, a workaround for this issue is to create a rubric only when html is generated:

.. only:: html

  .. rubric:: References

.. bibliography:: refs.bib
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top