You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.2 KiB
38 lines
1.2 KiB
from dataclasses import dataclass, field
|
|
from typing import TYPE_CHECKING, Union
|
|
|
|
from . import BracketStyle, GroupReferenceStyle, PersonStyle
|
|
from .basic_foot import (
|
|
BasicFootParentheticalReferenceStyle,
|
|
BasicFootTextualReferenceStyle,
|
|
)
|
|
|
|
if TYPE_CHECKING:
|
|
from pybtex.richtext import BaseText
|
|
|
|
|
|
@dataclass
|
|
class FootReferenceStyle(GroupReferenceStyle):
|
|
"""Textual or parenthetical reference using footnotes."""
|
|
|
|
#: 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)
|
|
|
|
#: Separator between text and reference for textual citations.
|
|
text_reference_sep: Union["BaseText", str] = ""
|
|
|
|
def __post_init__(self):
|
|
self.styles.extend(
|
|
[
|
|
BasicFootParentheticalReferenceStyle(),
|
|
BasicFootTextualReferenceStyle(
|
|
bracket=self.bracket_textual,
|
|
person=self.person,
|
|
text_reference_sep=self.text_reference_sep,
|
|
),
|
|
]
|
|
)
|
|
super().__post_init__()
|
|
|