diff --git a/library/src/meta/counter.rs b/library/src/meta/counter.rs index fb656c766..1d8e642d7 100644 --- a/library/src/meta/counter.rs +++ b/library/src/meta/counter.rs @@ -583,6 +583,10 @@ struct DisplayElem { impl Show for DisplayElem { fn show(&self, vt: &mut Vt, styles: StyleChain) -> SourceResult { + if !vt.introspector.init() { + return Ok(Content::empty()); + } + let location = self.0.location().unwrap(); let counter = self.counter(); let numbering = self diff --git a/library/src/meta/state.rs b/library/src/meta/state.rs index 110735946..3e6d65b27 100644 --- a/library/src/meta/state.rs +++ b/library/src/meta/state.rs @@ -393,6 +393,10 @@ struct DisplayElem { impl Show for DisplayElem { fn show(&self, vt: &mut Vt, _: StyleChain) -> SourceResult { + if !vt.introspector.init() { + return Ok(Content::empty()); + } + let location = self.0.location().unwrap(); let value = self.state().at(vt, location)?; Ok(match self.func() {