Citation

Symbolica documentation for getting started, symbolic expressions, numerical evaluation, pattern matching, and APIs in Python and Rust.

Citation

class Citation

A scientific reference with explanations of its relevance to a computation.

Fields are read-only. Reasons and description may contain Markdown.

Attributes

Name Description
bibtex The ready-to-export BibTeX entry.
description A description of the citation, optionally formatted as Markdown.
id The stable identity of the citation, preferably a DOI or arXiv ID.
reasons The reasons for including this citation, optionally formatted as Markdown.
reference The human-readable bibliographic reference.
relevance The relevance score, or None if unknown.

bibtex

Citation.bibtex: str

The ready-to-export BibTeX entry.

description

Citation.description: str

A description of the citation, optionally formatted as Markdown.

id

Citation.id: str

The stable identity of the citation, preferably a DOI or arXiv ID.

reasons

Citation.reasons: list[str]

The reasons for including this citation, optionally formatted as Markdown.

reference

Citation.reference: str

The human-readable bibliographic reference.

relevance

Citation.relevance: int | None

The relevance score, or None if unknown.

Methods

Name Description
__new__ Create a citation
__repr__ Return a compact representation suitable for lists of citations.
__str__ Display the reference, identifier, description, reasons and known relevance.
_repr_html_ Display an HTML report, with description and reasons as escaped text.
_repr_markdown_
_repr_pretty_
to_bibtex Return the original BibTeX entry unchanged, ready to write to a .bib file.
to_markdown Return a Markdown report, optionally including a fenced BibTeX entry.

__new__

Citation.__new__(
    id: str,
    reference: str,
    bibtex: str,
    *,
    reasons: Sequence[str] = (),
    description: str = '',
    relevance: int | None = None,
) -> Citation

Create a citation. Relevance is a nonnegative library-defined score.

__repr__

Citation.__repr__() -> str

Return a compact representation suitable for lists of citations.

__str__

Citation.__str__() -> str

Display the reference, identifier, description, reasons and known relevance.

_repr_html_

Citation._repr_html_() -> str

Display an HTML report, with description and reasons as escaped text.

_repr_markdown_

Citation._repr_markdown_() -> str

_repr_pretty_

Citation._repr_pretty_(pretty: Any, cycle: bool) -> None

to_bibtex

Citation.to_bibtex() -> str

Return the original BibTeX entry unchanged, ready to write to a .bib file.

to_markdown

Citation.to_markdown(include_bibtex: bool = False) -> str

Return a Markdown report, optionally including a fenced BibTeX entry.