summaryrefslogtreecommitdiff
path: root/library/src/math
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-05-17 14:41:46 +0200
committerLaurenz <laurmaedje@gmail.com>2023-05-17 14:41:46 +0200
commit551ea99d05166b0be50792f767ddd38b996e32fa (patch)
treeec5e86a087e79e8c181c7d4b904216a775227e2d /library/src/math
parent46aace78ac4ac1c075b9b1670dbb7372df1a0a82 (diff)
Show default values in documentation
Fixes #169 Fixes #1102
Diffstat (limited to 'library/src/math')
-rw-r--r--library/src/math/cancel.rs13
-rw-r--r--library/src/math/delimited.rs2
-rw-r--r--library/src/math/op.rs2
3 files changed, 5 insertions, 12 deletions
diff --git a/library/src/math/cancel.rs b/library/src/math/cancel.rs
index 9a0ffb7a..643eb9eb 100644
--- a/library/src/math/cancel.rs
+++ b/library/src/math/cancel.rs
@@ -24,8 +24,6 @@ pub struct CancelElem {
/// the whole element being "cancelled". A value of `{100%}` would then have
/// the line span precisely the element's diagonal.
///
- /// Defaults to `{100% + 3pt}`.
- ///
/// ```example
/// >>> #set page(width: 140pt)
/// $ a + cancel(x, length: #200%)
@@ -37,8 +35,6 @@ pub struct CancelElem {
/// If the cancel line should be inverted (pointing to the top left instead
/// of top right).
///
- /// Defaults to `{false}`.
- ///
/// ```example
/// >>> #set page(width: 140pt)
/// $ (a cancel((b + c), inverted: #true)) /
@@ -50,8 +46,6 @@ pub struct CancelElem {
/// If two opposing cancel lines should be drawn, forming a cross over the
/// element. Overrides `inverted`.
///
- /// Defaults to `{false}`.
- ///
/// ```example
/// >>> #set page(width: 140pt)
/// $ cancel(Pi, cross: #true) $
@@ -85,6 +79,11 @@ pub struct CancelElem {
/// ```
#[resolve]
#[fold]
+ #[default(PartialStroke {
+ // Default stroke has 0.5pt for better visuals.
+ thickness: Smart::Custom(Abs::pt(0.5)),
+ ..Default::default()
+ })]
pub stroke: PartialStroke,
}
@@ -100,10 +99,8 @@ impl LayoutMath for CancelElem {
let span = self.span();
let length = self.length(styles).resolve(styles);
- // Default stroke has 0.5pt for better visuals.
let stroke = self.stroke(styles).unwrap_or(Stroke {
paint: TextElem::fill_in(styles),
- thickness: Abs::pt(0.5),
..Default::default()
});
diff --git a/library/src/math/delimited.rs b/library/src/math/delimited.rs
index a4639de6..403f7922 100644
--- a/library/src/math/delimited.rs
+++ b/library/src/math/delimited.rs
@@ -19,8 +19,6 @@ pub(super) const DELIM_SHORT_FALL: Em = Em::new(0.1);
#[element(LayoutMath)]
pub struct LrElem {
/// The size of the brackets, relative to the height of the wrapped content.
- ///
- /// Defaults to `{100%}`.
pub size: Smart<Rel<Length>>,
/// The delimited content, including the delimiters.
diff --git a/library/src/math/op.rs b/library/src/math/op.rs
index 1a3acaa3..cc57eb61 100644
--- a/library/src/math/op.rs
+++ b/library/src/math/op.rs
@@ -27,8 +27,6 @@ pub struct OpElem {
pub text: EcoString,
/// Whether the operator should force attachments to display as limits.
- ///
- /// Defaults to `{false}`.
#[default(false)]
pub limits: bool,
}