summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDVDTSB <66365801+DVDTSB@users.noreply.github.com>2023-09-26 11:29:43 +0300
committerGitHub <noreply@github.com>2023-09-26 10:29:43 +0200
commit34b3f7237017ec9b4e463ad2a6d58d469258e66d (patch)
tree427938cce8cba334fea31729e09ddc36fe2505da
parent63b5ced5db24c51ac8450283083c0488241f0bbe (diff)
Add `wide` spacing for math (#2224)
-rw-r--r--crates/typst-library/src/layout/spacing.rs2
-rw-r--r--crates/typst-library/src/math/spacing.rs2
2 files changed, 3 insertions, 1 deletions
diff --git a/crates/typst-library/src/layout/spacing.rs b/crates/typst-library/src/layout/spacing.rs
index 868b3d50..50f66a8e 100644
--- a/crates/typst-library/src/layout/spacing.rs
+++ b/crates/typst-library/src/layout/spacing.rs
@@ -17,7 +17,7 @@ use crate::prelude::*;
///
/// # Mathematical Spacing { #math-spacing }
/// In [mathematical formulas]($category/math), you can additionally use these
-/// constants to add spacing between elements: `thin`, `med`, `thick`, `quad`.
+/// constants to add spacing between elements: `thin`, `med`, `thick`, `quad`, `wide`.
#[elem(title = "Spacing (H)", Behave)]
pub struct HElem {
/// How much spacing to insert.
diff --git a/crates/typst-library/src/math/spacing.rs b/crates/typst-library/src/math/spacing.rs
index 80bb30a0..3dfce024 100644
--- a/crates/typst-library/src/math/spacing.rs
+++ b/crates/typst-library/src/math/spacing.rs
@@ -4,6 +4,7 @@ pub(super) const THIN: Em = Em::new(1.0 / 6.0);
pub(super) const MEDIUM: Em = Em::new(2.0 / 9.0);
pub(super) const THICK: Em = Em::new(5.0 / 18.0);
pub(super) const QUAD: Em = Em::new(1.0);
+pub(super) const WIDE: Em = Em::new(2.0);
/// Hook up all spacings.
pub(super) fn define(math: &mut Scope) {
@@ -11,6 +12,7 @@ pub(super) fn define(math: &mut Scope) {
math.define("med", HElem::new(MEDIUM.into()).pack());
math.define("thick", HElem::new(THICK.into()).pack());
math.define("quad", HElem::new(QUAD.into()).pack());
+ math.define("wide", HElem::new(WIDE.into()).pack());
}
/// Create the spacing between two fragments in a given style.