mirror of
https://github.com/typst/typst
synced 2025-05-21 20:45:27 +08:00
Improve documentation for figure kind (#2654)
This commit is contained in:
parent
e07275163f
commit
8219ec2595
@ -10,7 +10,7 @@ use crate::visualize::ImageElem;
|
|||||||
|
|
||||||
/// A figure with an optional caption.
|
/// A figure with an optional caption.
|
||||||
///
|
///
|
||||||
/// Automatically detects its contents to select the correct counting track. For
|
/// Automatically detects its kind to select the correct counting track. For
|
||||||
/// example, figures containing images will be numbered separately from figures
|
/// example, figures containing images will be numbered separately from figures
|
||||||
/// containing tables.
|
/// containing tables.
|
||||||
///
|
///
|
||||||
@ -124,8 +124,12 @@ pub struct FigureElem {
|
|||||||
|
|
||||||
/// The kind of figure this is.
|
/// The kind of figure this is.
|
||||||
///
|
///
|
||||||
|
/// All figures of the same kind share a common counter.
|
||||||
|
///
|
||||||
/// If set to `{auto}`, the figure will try to automatically determine its
|
/// If set to `{auto}`, the figure will try to automatically determine its
|
||||||
/// kind. All figures of the same kind share a common counter.
|
/// kind based on the type of its body. Automatically detected kinds are
|
||||||
|
/// [tables]($table) and [code]($raw). In other cases, the inferred kind is
|
||||||
|
/// that of an [image]($image).
|
||||||
///
|
///
|
||||||
/// Setting this to something other than `{auto}` will override the
|
/// Setting this to something other than `{auto}` will override the
|
||||||
/// automatic detection. This can be useful if
|
/// automatic detection. This can be useful if
|
||||||
@ -135,8 +139,9 @@ pub struct FigureElem {
|
|||||||
/// its content.
|
/// its content.
|
||||||
///
|
///
|
||||||
/// You can set the kind to be an element function or a string. If you set
|
/// You can set the kind to be an element function or a string. If you set
|
||||||
/// it to an element function that is not supported by the figure, you will
|
/// it to an element function other than [`{table}`]($table), [`{raw}`](raw)
|
||||||
/// need to manually specify the figure's supplement.
|
/// or [`{image}`](image), you will need to manually specify the figure's
|
||||||
|
/// supplement.
|
||||||
///
|
///
|
||||||
/// ```example
|
/// ```example
|
||||||
/// #figure(
|
/// #figure(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user