Fix bug where inline equations were displayed in the outline (#2662)

This commit is contained in:
frozolotl 2023-11-13 12:04:34 +01:00 committed by GitHub
parent d25e6726e2
commit 97bb0fbce3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 7 deletions

View File

@ -367,6 +367,9 @@ impl Refable for EquationElem {
impl Outlinable for EquationElem { impl Outlinable for EquationElem {
fn outline(&self, vt: &mut Vt) -> SourceResult<Option<Content>> { fn outline(&self, vt: &mut Vt) -> SourceResult<Option<Content>> {
if !self.block(StyleChain::default()) {
return Ok(None);
}
let Some(numbering) = self.numbering(StyleChain::default()) else { let Some(numbering) = self.numbering(StyleChain::default()) else {
return Ok(None); return Ok(None);
}; };

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View File

@ -2,25 +2,33 @@
#set heading(numbering: "(1/a)") #set heading(numbering: "(1/a)")
#show heading.where(level: 1): set text(12pt) #show heading.where(level: 1): set text(12pt)
#show heading.where(level: 2): set text(10pt) #show heading.where(level: 2): set text(10pt)
#set math.equation(numbering: "1")
#outline() #outline()
#outline(title: [Figures], target: figure)
#outline(title: [Equations], target: math.equation)
= Einleitung = Introduction
#lorem(12) #lorem(12)
= Analyse = Analysis
#lorem(10) #lorem(10)
#[ #[
#set heading(outlined: false) #set heading(outlined: false)
== Methodik == Methodology
#lorem(6) #lorem(6)
] ]
== Verarbeitung == Math
#lorem(4) $x$ is a very useful constant. See it in action:
$ x = x $
== Programmierung == Interesting figures
#figure(rect[CENSORED], kind: image, caption: [A picture showing a programmer at work.])
#figure(table[1x1], caption: [A very small table.])
== Programming
```rust ```rust
fn main() { fn main() {
panic!("in the disco"); panic!("in the disco");
@ -33,5 +41,5 @@ Ok ...
// Ensure 'bookmarked' option doesn't affect the outline // Ensure 'bookmarked' option doesn't affect the outline
#set heading(numbering: "(I)", bookmarked: false) #set heading(numbering: "(I)", bookmarked: false)
= #text(blue)[Zusammen]fassung = #text(blue)[Sum]mary
#lorem(10) #lorem(10)