# New Domains

Classes and methods to maintain any bibtex information that is stored outside the doctree.

class sphinxcontrib.bibtex.domain.Citation(citation_id: str, bibliography_key: BibliographyKey, key: str, entry: Entry, formatted_entry: FormattedEntry, tooltip_entry: FormattedEntry | None)

  Information about a citation.

  bibliography_key: BibliographyKey

    Key of its bibliography directive.

  citation_id: str

    Unique id of this citation.

  entry: Entry

    Entry from pybtex.

  formatted_entry: FormattedEntry

    Formatted entry for bibliography.

  key: str

    Key (with prefix).

  tooltip_entry: FormattedEntry | None

    Formatted entry for tooltip.

class sphinxcontrib.bibtex.domain.BibtexDomain(env: BuildEnvironment)

  Sphinx domain for the bibtex extension.

  property bibdata: BibData

    Information about the bibliography files.

  property bibliographies: Dict[BibliographyKey, BibliographyValue]

    Map storing information about each bibliography directive.

  property citation_refs: List[CitationRef]

    Citation reference data.

  property citations: List[Citation]

    Citation data.

  clear_doc(docname: str) → None

    Remove traces of a document in the domain-specific inventories.

  data_version = 4

    data version, bump this when the format of self.data changes

  get_all_cited_keys(docnames)

    Yield all citation keys for given docnames in order, then ordered by citation order.

  get_entries(bibfiles: List[Path]) → Iterable[Entry]

    Return all bibliography entries from the bib files, unsorted (i.e. in order of appearance in the bib files).

  get_filtered_entries(bibliography_key: BibliographyKey) → Iterable[Tuple[str, Entry]]

    Return unsorted bibliography entries filtered by the filter expression.

  get_formatted_entries(bibliography_key: BibliographyKey, docnames: List[str], tooltips: bool, tooltips_style: str) → Iterable[Tuple[Entry, FormattedEntry, FormattedEntry | None]]

    Get sorted bibliography entries along with their pybtex labels, with additional sorting and formatting applied from the pybtex style.

  get_sorted_entries(bibliography_key: BibliographyKey, docnames: List[str]) → Iterable[Tuple[str, Entry]]

    Return filtered bibliography entries sorted by citation order.

  initial_data: dict[str, Any] = {'bibdata': ('', {}, BibliographyData( entries=OrderedCaseInsensitiveDict([]), preamble=[])), 'bibliographies': {}, 'bibliography_header': <container: >, 'citation_refs': [], 'citations': []}

    data value for a fresh environment

  label = 'BibTeX Citations'

    domain label: longer, more descriptive (used in messages)

  merge_domaindata(docnames: AbstractSet[str], otherdata: Dict) → None

    Merge in data regarding docnames from a different domaindata inventory (coming from a subprocess in parallel builds).

  name = 'cite'

    domain name: should be short, but unique

  resolve_any_xref(env: BuildEnvironment, fromdocname: str, builder: Builder, target: str, node: pending_xref, contnode: Element) → List[Tuple[str, Element]]

    Replace node by list of citation references (one for each key), provided that the target has citation keys.

  resolve_xref(env: BuildEnvironment, fromdocname: str, builder: Builder, typ: str, target: str, node: pending_xref, contnode: Element) → Element

    Replace node by list of citation references (one for each key).

Domain for footnote citations.

class sphinxcontrib.bibtex.foot_domain.BibtexFootDomain(env: BuildEnvironment)

  Sphinx domain for footnote citations.

  data_version = 0

    data version, bump this when the format of self.data changes

  initial_data: dict[str, Any] = {'bibliography_header': <container: >}

    data value for a fresh environment

  label = 'BibTeX Footnote Citations'

    domain label: longer, more descriptive (used in messages)

  merge_domaindata(docnames: AbstractSet[str], otherdata: Dict) → None

    Merge in data regarding docnames from domain data inventory otherdata.

    As there is no document specific data for this domain, this function does nothing.

  name = 'footcite'

    domain name: should be short, but unique

  resolve_any_xref(env: BuildEnvironment, fromdocname: str, builder: Builder, target: str, node: pending_xref, contnode: Element) → List[Tuple[str, reference]]

    Resolve the pending reference node with the given target, where the reference comes from an “any” role.

    Since citation references are resolved to regular citations, and not to footnote citations, this implementation simply returns an empty list.