Skip to content

foot style in bibtex_reference_style #380

@MLopez-Ibanez

Description

@MLopez-Ibanez

The super and foot styles differ in a few details:

  • super does not have brackets, foot does.
  • Even if we add brackets to super by customizing (see below), the brackets are not hyperlinked, unlike foot style.

Thus, to achieve a consistent style when using both cite and footcite, it would be great to be able to use foot in bibtex_reference_style.

from dataclasses import dataclass, field
from sphinxcontrib.bibtex.style.referencing import BracketStyle,PersonStyle
from sphinxcontrib.bibtex.style.referencing.super_ import SuperReferenceStyle
from sphinxcontrib.bibtex.plugin import register_plugin as sphinxcontrib_register_plugin

@dataclass
class SuperWithBrackets(SuperReferenceStyle):
    #: Bracket style for textual citations (:cite:t: and variations).
    bracket_textual: BracketStyle = field(default_factory=BracketStyle)

    #: Person style (applies to all relevant citation commands).
    person: PersonStyle = field(default_factory=PersonStyle)

sphinxcontrib_register_plugin('sphinxcontrib.bibtex.style.referencing',
                              'super_with_brackets', SuperWithBrackets)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions