summaryrefslogtreecommitdiff
path: root/library/src/math
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-03-08 10:43:03 +0100
committerLaurenz <laurmaedje@gmail.com>2023-03-08 10:44:24 +0100
commit1b2b53ecb91a9bd7fb3493e471ae03cd142a7c03 (patch)
tree682124c2343db9491c84bddbdca026c676f220c6 /library/src/math
parent25b5bd117529cd04bb789e1988eb3a3db8025a0e (diff)
Require font to be a named argument
Diffstat (limited to 'library/src/math')
-rw-r--r--library/src/math/delimited.rs13
-rw-r--r--library/src/math/mod.rs11
-rw-r--r--library/src/math/style.rs2
3 files changed, 9 insertions, 17 deletions
diff --git a/library/src/math/delimited.rs b/library/src/math/delimited.rs
index b0126cad..63cb916c 100644
--- a/library/src/math/delimited.rs
+++ b/library/src/math/delimited.rs
@@ -14,15 +14,6 @@ pub(super) const DELIM_SHORT_FALL: Em = Em::new(0.1);
/// $ lr(]sum_(x=1)^n] x, size: #50%) $
/// ```
///
-/// ## Parameters
-/// - body: `Content` (positional, variadic)
-/// The delimited content, including the delimiters.
-///
-/// - size: `Rel<Length>` (named)
-/// The size of the brackets, relative to the height of the wrapped content.
-///
-/// Defaults to `{100%}`.
-///
/// Display: Left/Right
/// Category: math
#[node(Construct, LayoutMath)]
@@ -32,7 +23,9 @@ pub struct LrNode {
#[required]
pub body: Content,
- /// The size of the brackets.
+ /// The size of the brackets, relative to the height of the wrapped content.
+ ///
+ /// Defaults to `{100%}`.
#[named]
#[default]
pub size: Smart<Rel<Length>>,
diff --git a/library/src/math/mod.rs b/library/src/math/mod.rs
index 9da12e4f..d719cb1a 100644
--- a/library/src/math/mod.rs
+++ b/library/src/math/mod.rs
@@ -41,8 +41,7 @@ use self::spacing::*;
use crate::layout::{HNode, ParNode, Spacing};
use crate::prelude::*;
use crate::text::{
- families, variant, FallbackList, FontFamily, LinebreakNode, SpaceNode, TextNode,
- TextSize,
+ families, variant, FontFamily, FontList, LinebreakNode, SpaceNode, TextNode, TextSize,
};
/// Create a module with all math definitions.
@@ -113,7 +112,7 @@ pub fn module() -> Module {
///
/// ## Example
/// ```example
-/// #set text("New Computer Modern")
+/// #set text(font: "New Computer Modern")
///
/// Let $a$, $b$, and $c$ be the side
/// lengths of right-angled triangle.
@@ -161,8 +160,8 @@ impl Finalize for FormulaNode {
realized
.styled(TextNode::WEIGHT, FontWeight::from_number(450))
.styled(
- TextNode::FAMILY,
- FallbackList(vec![FontFamily::new("New Computer Modern Math")]),
+ TextNode::FONT,
+ FontList(vec![FontFamily::new("New Computer Modern Math")]),
)
}
}
@@ -233,7 +232,7 @@ impl LayoutMath for Content {
if let Some(styled) = self.to::<StyledNode>() {
let map = styled.map();
- if map.contains(TextNode::FAMILY) {
+ if map.contains(TextNode::FONT) {
let frame = ctx.layout_content(self)?;
ctx.push(FrameFragment::new(ctx, frame).with_spaced(true));
return Ok(());
diff --git a/library/src/math/style.rs b/library/src/math/style.rs
index 99365106..43c1f391 100644
--- a/library/src/math/style.rs
+++ b/library/src/math/style.rs
@@ -183,7 +183,7 @@ impl LayoutMath for FrakNode {
/// $ mono(x + y = z) $
/// ```
///
-/// Display: Monospace
+/// Display: Monospace
/// Category: math
#[node(LayoutMath)]
pub struct MonoNode {