diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-01-23 15:03:10 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-01-23 15:23:52 +0100 |
| commit | 4653ffebb43d733a3cff873d0903c7d00aaeb499 (patch) | |
| tree | 6a97b2e6a6903b3198547d6f3d0a7e3d2eb023cd /library/src/math/spacing.rs | |
| parent | 84c6c8b0e6b17996a603ec88b7490107154f38f3 (diff) | |
Math module
Diffstat (limited to 'library/src/math/spacing.rs')
| -rw-r--r-- | library/src/math/spacing.rs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/library/src/math/spacing.rs b/library/src/math/spacing.rs index 0f613309..d5a7603d 100644 --- a/library/src/math/spacing.rs +++ b/library/src/math/spacing.rs @@ -1,10 +1,18 @@ use super::*; -pub(super) const ZERO: Em = Em::zero(); -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); +const ZERO: Em = Em::zero(); +const THIN: Em = Em::new(1.0 / 6.0); +const MEDIUM: Em = Em::new(2.0 / 9.0); +const THICK: Em = Em::new(5.0 / 18.0); +const QUAD: Em = Em::new(1.0); + +/// Hook up all spacings. +pub(super) fn define_spacings(math: &mut Scope) { + math.define("thin", HNode::strong(THIN).pack()); + math.define("med", HNode::strong(MEDIUM).pack()); + math.define("thick", HNode::strong(THICK).pack()); + math.define("quad", HNode::strong(QUAD).pack()); +} /// Determine the spacing between two fragments in a given style. pub(super) fn spacing(left: MathClass, right: MathClass, style: MathStyle) -> Em { |
