sphinx-doc / sphinx-doc/sphinx

Customization of the bibliography in LaTeX output

Open
#5,893 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

builder:latex type:proposal
Dominant language
Python
Stars
8k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

This is a feature request that was discussed in the mailing list:
https://groups.google.com/forum/#!topic/sphinx-dev/qHIpc7XskZY

Problem

When using the sphinxcontrib-bibtex extension, the list of references can be placed in the document with the bibliography directive. At least that's the case for HTML output; in LaTeX output, the list of references is moved to the very end of the resulting LaTeX document.

This is documented: https://sphinxcontrib-bibtex.readthedocs.io/en/latest/usage.html#mismatch-between-output-of-html-and-latex-backends

The reason for this behavior is sphinx.builders.latex.BibliographyTransform, which cannot easily be disabled.

A work-around is shown there: https://github.com/mcmtroffaes/sphinxcontrib-bibtex/issues/156

In the mailing list, @tk0miya said:

I can provide the option for the transform like "as is", "per
chapter" and "per document".
If you like it, please post a feature request. I'll work for it (in future).

I think such an option would be great.

I'm mostly interested in the "as is" option, but other people might also want "per chapter".

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading sphinx.builders.latex.BibliographyTransform and the documented HTML/LaTeX mismatch. Review the linked sphinxcontrib-bibtex workaround and mailing-list discussion for the intended “as is” and “per chapter” behaviors. Done means LaTeX bibliography placement can be selected without disabling the transform manually.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex, python
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.