summaryrefslogtreecommitdiff
path: root/crates/typst-library/src/math/attach.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-09-11 14:40:22 +0200
committerLaurenz <laurmaedje@gmail.com>2023-09-11 14:40:22 +0200
commitb471ac7d590abd2398ce25193b4e4df373bf2e9c (patch)
treeb5f7a6fdc807ee3340a4f42b0ad3cc563fe45429 /crates/typst-library/src/math/attach.rs
parent8f36fca68447a5d42a3d54b5fac7e5546ee244be (diff)
First-class types
Makes types first-class values.
Diffstat (limited to 'crates/typst-library/src/math/attach.rs')
-rw-r--r--crates/typst-library/src/math/attach.rs35
1 files changed, 5 insertions, 30 deletions
diff --git a/crates/typst-library/src/math/attach.rs b/crates/typst-library/src/math/attach.rs
index d74beafe..c33b58e4 100644
--- a/crates/typst-library/src/math/attach.rs
+++ b/crates/typst-library/src/math/attach.rs
@@ -2,26 +2,13 @@ use super::*;
/// A base with optional attachments.
///
-/// ## Example { #example }
/// ```example
-/// // With syntax.
-/// $ sum_(i=0)^n a_i = 2^(1+i) $
-///
-/// // With function call.
/// $ attach(
/// Pi, t: alpha, b: beta,
/// tl: 1, tr: 2+3, bl: 4+5, br: 6,
/// ) $
/// ```
-///
-/// ## Syntax { #syntax }
-/// This function also has dedicated syntax for attachments after the base: Use
-/// the underscore (`_`) to indicate a subscript i.e. bottom attachment and the
-/// hat (`^`) to indicate a superscript i.e. top attachment.
-///
-/// Display: Attachment
-/// Category: math
-#[element(LayoutMath)]
+#[elem(LayoutMath)]
pub struct AttachElem {
/// The base to which things are attached.
#[required]
@@ -86,19 +73,15 @@ impl LayoutMath for AttachElem {
/// Grouped primes.
///
-/// ## Example { #example }
/// ```example
/// $ a'''_b = a^'''_b $
/// ```
///
-/// ## Syntax
+/// # Syntax
/// This function has dedicated syntax: use apostrophes instead of primes. They
/// will automatically attach to the previous element, moving superscripts to
/// the next level.
-///
-/// Display: Attachment
-/// Category: math
-#[element(LayoutMath)]
+#[elem(LayoutMath)]
pub struct PrimesElem {
/// The number of grouped primes.
#[required]
@@ -141,14 +124,10 @@ impl LayoutMath for PrimesElem {
/// Forces a base to display attachments as scripts.
///
-/// ## Example { #example }
/// ```example
/// $ scripts(sum)_1^2 != sum_1^2 $
/// ```
-///
-/// Display: Scripts
-/// Category: math
-#[element(LayoutMath)]
+#[elem(LayoutMath)]
pub struct ScriptsElem {
/// The base to attach the scripts to.
#[required]
@@ -167,14 +146,10 @@ impl LayoutMath for ScriptsElem {
/// Forces a base to display attachments as limits.
///
-/// ## Example { #example }
/// ```example
/// $ limits(A)_1^2 != A_1^2 $
/// ```
-///
-/// Display: Limits
-/// Category: math
-#[element(LayoutMath)]
+#[elem(LayoutMath)]
pub struct LimitsElem {
/// The base to attach the limits to.
#[required]