From 2606034ac7e4565d0b53188ccdf446d83f0bcd59 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 11 Apr 2023 16:59:38 +0200 Subject: Fix heading supplement Fixes #730 --- library/src/math/mod.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'library/src/math') 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, + lang: Lang, ) -> SourceResult { // 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 { - self.numbering(styles) + fn numbering(&self) -> Option { + self.numbering(StyleChain::default()) } - fn counter(&self, _: StyleChain) -> Counter { + fn counter(&self) -> Counter { Counter::of(Self::func()) } } -- cgit v1.2.3