diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-04-11 16:59:38 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-04-11 16:59:38 +0200 |
| commit | 2606034ac7e4565d0b53188ccdf446d83f0bcd59 (patch) | |
| tree | 1f4dfe8f93bf8ba1d5d664aeb13ce91854e2489b /library/src/math/mod.rs | |
| parent | 9720424884d67d61fd4ab7cbcefa2bfcc21d03e1 (diff) | |
Fix heading supplement
Fixes #730
Diffstat (limited to 'library/src/math/mod.rs')
| -rw-r--r-- | library/src/math/mod.rs | 15 |
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()) } } |
