{"record":{"id":"2ee7c5224bed8419","repo":"typst/typst","slug":"please-specify-the-figure-s-supplement","errorCode":null,"errorMessage":"please specify the figure's supplement","messagePattern":"please specify the figure's supplement","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/typst-library/src/model/figure.rs","lineNumber":377,"sourceCode":"                .unwrap_or_else(|| FigureKind::Elem(ImageElem::ELEM))\n        });\n\n        // Resolve the supplement.\n        let supplement = match elem.supplement.get_ref(styles).as_ref() {\n            Smart::Auto => {\n                // Default to the local name for the kind, if available.\n                let name = match &kind {\n                    FigureKind::Elem(func) => func\n                        .local_name(\n                            styles.get(TextElem::lang),\n                            styles.get(TextElem::region),\n                        )\n                        .map(TextElem::packed),\n                    FigureKind::Name(_) => None,\n                };\n\n                if numbering.is_some() && name.is_none() {\n                    bail!(span, \"please specify the figure's supplement\")\n                }\n\n                Some(name.unwrap_or_default())\n            }\n            Smart::Custom(None) => None,\n            Smart::Custom(Some(supplement)) => {\n                // Resolve the supplement with the first descendant of the kind or\n                // just the body, if none was found.\n                let descendant = match kind {\n                    FigureKind::Elem(func) => elem\n                        .body\n                        .query_first_naive(&Selector::Elem(func, None))\n                        .map(Cow::Owned),\n                    FigureKind::Name(_) => None,\n                };\n\n                let target = descendant.unwrap_or_else(|| Cow::Borrowed(&elem.body));\n                Some(supplement.resolve(engine, styles, [target])?)","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/typst/typst/blob/35417aa769ab9d699a60384f91082b09bc6ba421/crates/typst-library/src/model/figure.rs#L359-L395","documentation":"Raised during FigureElem synthesis: the supplement is auto, the figure's kind has no localizable name, and no caption/supplement is available, so Typst cannot form a caption like 'Figure 1'.","triggerScenarios":"Thrown at crates/typst-library/src/model/figure.rs:377 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set `supplement` explicitly, e.g. `supplement: [Diagram]`","Add a caption to the figure","Use a kind whose name Typst knows (e.g. image, table)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35417aa769ab9d699a60384f91082b09bc6ba421","analyzedAt":"2026-08-17T21:03:48.984Z","contentChangedAt":"2026-08-17T21:03:48.984Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}