summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalo <57839069+MDLC01@users.noreply.github.com>2023-11-13 12:18:05 +0100
committerGitHub <noreply@github.com>2023-11-13 12:18:05 +0100
commit8219ec259511f4f2f03b8921a4f20f3a39c43821 (patch)
treef94639e4183427fc64a149d6aa263ac609fb2d6c
parente07275163f6039a0f93e14574b136bd1041bb2ad (diff)
Improve documentation for figure kind (#2654)
-rw-r--r--crates/typst-library/src/meta/figure.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/crates/typst-library/src/meta/figure.rs b/crates/typst-library/src/meta/figure.rs
index 362f869e..6124e9d5 100644
--- a/crates/typst-library/src/meta/figure.rs
+++ b/crates/typst-library/src/meta/figure.rs
@@ -10,7 +10,7 @@ use crate::visualize::ImageElem;
/// 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
/// containing tables.
///
@@ -124,8 +124,12 @@ pub struct FigureElem {
/// 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
- /// 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
/// automatic detection. This can be useful if
@@ -135,8 +139,9 @@ pub struct FigureElem {
/// its content.
///
/// 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
- /// need to manually specify the figure's supplement.
+ /// it to an element function other than [`{table}`]($table), [`{raw}`](raw)
+ /// or [`{image}`](image), you will need to manually specify the figure's
+ /// supplement.
///
/// ```example
/// #figure(