Fixed numbering hint (#2012)

This commit is contained in:
Sébastien d'Herbais de Thun 2023-08-26 16:02:28 +02:00 committed by GitHub
parent 0f794c8c75
commit cd13e55dd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 2 deletions

View File

@ -1,4 +1,5 @@
use super::{BibliographyElem, CiteElem, Counter, Figurable, Numbering};
use crate::math::EquationElem;
use crate::meta::FootnoteElem;
use crate::prelude::*;
use crate::text::TextElem;
@ -189,8 +190,13 @@ impl Show for RefElem {
)
})
.hint(eco_format!(
"you can enable heading numbering with `#set {}(numbering: \"1.\")`",
elem.func().name()
"you can enable {} numbering with `#set {}(numbering: \"1.\")`",
elem.func().name(),
if elem.func() == EquationElem::func() {
"math.equation"
} else {
elem.func().name()
}
))
.at(span)?;

View File

@ -0,0 +1,15 @@
// In this bug, the hint and error messages for an equation
// being reference mentioned that it was a "heading" and was
// lacking the proper path.
// Ref: false
---
#set page(height: 70pt)
$
Delta = b^2 - 4 a c
$ <quadratic>
// Error: 14-24 cannot reference equation without numbering
// Hint: 14-24 you can enable equation numbering with `#set math.equation(numbering: "1.")`
Looks at the @quadratic formula.