typst_library/math/underover.rs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
use crate::foundations::{elem, Content};
use crate::math::Mathy;
/// A horizontal line under content.
///
/// ```example
/// $ underline(1 + 2 + ... + 5) $
/// ```
#[elem(Mathy)]
pub struct UnderlineElem {
/// The content above the line.
#[required]
pub body: Content,
}
/// A horizontal line over content.
///
/// ```example
/// $ overline(1 + 2 + ... + 5) $
/// ```
#[elem(Mathy)]
pub struct OverlineElem {
/// The content below the line.
#[required]
pub body: Content,
}
/// A horizontal brace under content, with an optional annotation below.
///
/// ```example
/// $ underbrace(1 + 2 + ... + 5, "numbers") $
/// ```
#[elem(Mathy)]
pub struct UnderbraceElem {
/// The content above the brace.
#[required]
pub body: Content,
/// The optional content below the brace.
#[positional]
pub annotation: Option<Content>,
}
/// A horizontal brace over content, with an optional annotation above.
///
/// ```example
/// $ overbrace(1 + 2 + ... + 5, "numbers") $
/// ```
#[elem(Mathy)]
pub struct OverbraceElem {
/// The content below the brace.
#[required]
pub body: Content,
/// The optional content above the brace.
#[positional]
pub annotation: Option<Content>,
}
/// A horizontal bracket under content, with an optional annotation below.
///
/// ```example
/// $ underbracket(1 + 2 + ... + 5, "numbers") $
/// ```
#[elem(Mathy)]
pub struct UnderbracketElem {
/// The content above the bracket.
#[required]
pub body: Content,
/// The optional content below the bracket.
#[positional]
pub annotation: Option<Content>,
}
/// A horizontal bracket over content, with an optional annotation above.
///
/// ```example
/// $ overbracket(1 + 2 + ... + 5, "numbers") $
/// ```
#[elem(Mathy)]
pub struct OverbracketElem {
/// The content below the bracket.
#[required]
pub body: Content,
/// The optional content above the bracket.
#[positional]
pub annotation: Option<Content>,
}
/// A horizontal parenthesis under content, with an optional annotation below.
///
/// ```example
/// $ underparen(1 + 2 + ... + 5, "numbers") $
/// ```
#[elem(Mathy)]
pub struct UnderparenElem {
/// The content above the parenthesis.
#[required]
pub body: Content,
/// The optional content below the parenthesis.
#[positional]
pub annotation: Option<Content>,
}
/// A horizontal parenthesis over content, with an optional annotation above.
///
/// ```example
/// $ overparen(1 + 2 + ... + 5, "numbers") $
/// ```
#[elem(Mathy)]
pub struct OverparenElem {
/// The content below the parenthesis.
#[required]
pub body: Content,
/// The optional content above the parenthesis.
#[positional]
pub annotation: Option<Content>,
}
/// A horizontal tortoise shell bracket under content, with an optional
/// annotation below.
///
/// ```example
/// $ undershell(1 + 2 + ... + 5, "numbers") $
/// ```
#[elem(Mathy)]
pub struct UndershellElem {
/// The content above the tortoise shell bracket.
#[required]
pub body: Content,
/// The optional content below the tortoise shell bracket.
#[positional]
pub annotation: Option<Content>,
}
/// A horizontal tortoise shell bracket over content, with an optional
/// annotation above.
///
/// ```example
/// $ overshell(1 + 2 + ... + 5, "numbers") $
/// ```
#[elem(Mathy)]
pub struct OvershellElem {
/// The content below the tortoise shell bracket.
#[required]
pub body: Content,
/// The optional content above the tortoise shell bracket.
#[positional]
pub annotation: Option<Content>,
}