summaryrefslogtreecommitdiff
path: root/library/src/math
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-04-11 16:59:38 +0200
committerLaurenz <laurmaedje@gmail.com>2023-04-11 16:59:38 +0200
commit2606034ac7e4565d0b53188ccdf446d83f0bcd59 (patch)
tree1f4dfe8f93bf8ba1d5d664aeb13ce91854e2489b /library/src/math
parent9720424884d67d61fd4ab7cbcefa2bfcc21d03e1 (diff)
Fix heading supplement
Fixes #730
Diffstat (limited to 'library/src/math')
-rw-r--r--library/src/math/mod.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/library/src/math/mod.rs b/library/src/math/mod.rs
index 27eeb695..97e5548e 100644
--- a/library/src/math/mod.rs
+++ b/library/src/math/mod.rs
@@ -298,13 +298,12 @@ impl Refable for EquationElem {
fn reference(
&self,
vt: &mut Vt,
- styles: StyleChain,
supplement: Option<Content>,
+ lang: Lang,
) -> SourceResult<Content> {
// first we create the supplement of the heading
- let mut supplement = supplement.unwrap_or_else(|| {
- TextElem::packed(self.local_name(TextElem::lang_in(styles)))
- });
+ let mut supplement =
+ supplement.unwrap_or_else(|| TextElem::packed(self.local_name(lang)));
// we append a space if the supplement is not empty
if !supplement.is_empty() {
@@ -312,7 +311,7 @@ impl Refable for EquationElem {
};
// we check for a numbering
- let Some(numbering) = self.numbering(styles) else {
+ let Some(numbering) = self.numbering(StyleChain::default()) else {
bail!(self.span(), "only numbered equations can be referenced");
};
@@ -324,11 +323,11 @@ impl Refable for EquationElem {
Ok(supplement + numbers)
}
- fn numbering(&self, styles: StyleChain) -> Option<Numbering> {
- self.numbering(styles)
+ fn numbering(&self) -> Option<Numbering> {
+ self.numbering(StyleChain::default())
}
- fn counter(&self, _: StyleChain) -> Counter {
+ fn counter(&self) -> Counter {
Counter::of(Self::func())
}
}