mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Fixed numbering hint (#2012)
This commit is contained in:
parent
0f794c8c75
commit
cd13e55dd1
@ -1,4 +1,5 @@
|
|||||||
use super::{BibliographyElem, CiteElem, Counter, Figurable, Numbering};
|
use super::{BibliographyElem, CiteElem, Counter, Figurable, Numbering};
|
||||||
|
use crate::math::EquationElem;
|
||||||
use crate::meta::FootnoteElem;
|
use crate::meta::FootnoteElem;
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
use crate::text::TextElem;
|
use crate::text::TextElem;
|
||||||
@ -189,8 +190,13 @@ impl Show for RefElem {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
.hint(eco_format!(
|
.hint(eco_format!(
|
||||||
"you can enable heading numbering with `#set {}(numbering: \"1.\")`",
|
"you can enable {} numbering with `#set {}(numbering: \"1.\")`",
|
||||||
elem.func().name()
|
elem.func().name(),
|
||||||
|
if elem.func() == EquationElem::func() {
|
||||||
|
"math.equation"
|
||||||
|
} else {
|
||||||
|
elem.func().name()
|
||||||
|
}
|
||||||
))
|
))
|
||||||
.at(span)?;
|
.at(span)?;
|
||||||
|
|
||||||
|
15
tests/typ/bugs/equation-numbering-reference.typ
Normal file
15
tests/typ/bugs/equation-numbering-reference.typ
Normal 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.
|
Loading…
x
Reference in New Issue
Block a user