summaryrefslogtreecommitdiff
path: root/crates/typst-library/src/math
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-library/src/math')
-rw-r--r--crates/typst-library/src/math/lr.rs9
-rw-r--r--crates/typst-library/src/math/op.rs5
2 files changed, 7 insertions, 7 deletions
diff --git a/crates/typst-library/src/math/lr.rs b/crates/typst-library/src/math/lr.rs
index 965f5351..7558717a 100644
--- a/crates/typst-library/src/math/lr.rs
+++ b/crates/typst-library/src/math/lr.rs
@@ -1,7 +1,6 @@
-use crate::foundations::{elem, func, Content, NativeElement};
+use crate::foundations::{elem, func, Content, NativeElement, SymbolElem};
use crate::layout::{Length, Rel};
use crate::math::Mathy;
-use crate::text::TextElem;
/// Scales delimiters.
///
@@ -19,7 +18,7 @@ pub struct LrElem {
#[parse(
let mut arguments = args.all::<Content>()?.into_iter();
let mut body = arguments.next().unwrap_or_default();
- arguments.for_each(|arg| body += TextElem::packed(',') + arg);
+ arguments.for_each(|arg| body += SymbolElem::packed(',') + arg);
body
)]
pub body: Content,
@@ -125,9 +124,9 @@ fn delimited(
) -> Content {
let span = body.span();
let mut elem = LrElem::new(Content::sequence([
- TextElem::packed(left),
+ SymbolElem::packed(left),
body,
- TextElem::packed(right),
+ SymbolElem::packed(right),
]));
// Push size only if size is provided
if let Some(size) = size {
diff --git a/crates/typst-library/src/math/op.rs b/crates/typst-library/src/math/op.rs
index 5b3f58be..55696e53 100644
--- a/crates/typst-library/src/math/op.rs
+++ b/crates/typst-library/src/math/op.rs
@@ -1,6 +1,6 @@
use ecow::EcoString;
-use crate::foundations::{elem, Content, NativeElement, Scope};
+use crate::foundations::{elem, Content, NativeElement, Scope, SymbolElem};
use crate::layout::HElem;
use crate::math::{upright, Mathy, THIN};
use crate::text::TextElem;
@@ -38,6 +38,7 @@ macro_rules! ops {
let operator = EcoString::from(ops!(@name $name $(: $value)?));
math.define(
stringify!($name),
+ // Latex also uses their equivalent of `TextElem` here.
OpElem::new(TextElem::new(operator).into())
.with_limits(ops!(@limit $($tts)*))
.pack()
@@ -46,7 +47,7 @@ macro_rules! ops {
let dif = |d| {
HElem::new(THIN.into()).with_weak(true).pack()
- + upright(TextElem::packed(d))
+ + upright(SymbolElem::packed(d))
};
math.define("dif", dif('d'));
math.define("Dif", dif('D'));