summaryrefslogtreecommitdiff
path: root/crates/typst-library/src/math/root.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-library/src/math/root.rs')
-rw-r--r--crates/typst-library/src/math/root.rs16
1 files changed, 4 insertions, 12 deletions
diff --git a/crates/typst-library/src/math/root.rs b/crates/typst-library/src/math/root.rs
index b889f1cb..03d0a212 100644
--- a/crates/typst-library/src/math/root.rs
+++ b/crates/typst-library/src/math/root.rs
@@ -2,14 +2,10 @@ use super::*;
/// A square root.
///
-/// ## Example { #example }
/// ```example
/// $ sqrt(3 - 2 sqrt(2)) = sqrt(2) - 1 $
/// ```
-///
-/// Display: Square Root
-/// Category: math
-#[func]
+#[func(title = "Square Root")]
pub fn sqrt(
/// The expression to take the square root of.
radicand: Content,
@@ -19,14 +15,10 @@ pub fn sqrt(
/// A general root.
///
-/// ## Example { #example }
/// ```example
/// $ root(3, x) $
/// ```
-///
-/// Display: Root
-/// Category: math
-#[element(LayoutMath)]
+#[elem(LayoutMath)]
pub struct RootElem {
/// Which root of the radicand to take.
#[positional]
@@ -129,10 +121,10 @@ fn layout(
frame.push(
line_pos,
FrameItem::Shape(
- Geometry::Line(Point::with_x(radicand.width())).stroked(Stroke {
+ Geometry::Line(Point::with_x(radicand.width())).stroked(FixedStroke {
paint: TextElem::fill_in(ctx.styles()),
thickness,
- ..Stroke::default()
+ ..FixedStroke::default()
}),
span,
),