sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.22k stars 2.04k forks source link

Latex bibliography doublings handling #8918

Open MuellerSeb opened 3 years ago

MuellerSeb commented 3 years ago

Problem When citing something more than once in the documentation with the same label, it will occur multiple times in the bibliography output in latex.

This can be seen for example in the Numpy documentation: https://numpy.org/doc/1.20/numpy-ref.pdf

On page 1811:

[1]: G. H. Golub and C. F. Van Loan,Matrix Computations, 3rd ed., Baltimore, MD, Johns Hopkins University Press,1996, pg. 8. [1]: G. H. Golub and C. F. Van Loan,Matrix Computations, 3rd ed., Baltimore, MD, Johns Hopkins University Press,1996, pg. 8.

This is totally redundant and non-informative.

Describe the solution you'd like It would be nice to have an option, to only show the first occurrence of a label in the bibliography to get the opportunity to have a non-redundant bibliography by using one-to-one labels ([Golub1996] for example for the situation given above)

This could be a simple switch in the conf.py:

latex_bibliography_single_lables = True

This should be False by default to keep the current behavior.

Additional context This of course would mess up references that have the same label (e.g. the often used [1]), but this should then be handled by the user. It would be nice to get the ability to clean up the bibliography without switching to a bibtex file.

MuellerSeb commented 3 years ago

Any opinion on this?