typst_library/model/
strong.rs

1use crate::foundations::{Content, elem};
2use crate::introspection::{Locatable, Tagged};
3
4/// Strongly emphasizes content by increasing the font weight.
5///
6/// Increases the current font weight by a given `delta`.
7///
8/// # Example
9/// ```example
10/// This is *strong.* \
11/// This is #strong[too.] \
12///
13/// #show strong: set text(red)
14/// And this is *evermore.*
15/// ```
16///
17/// # Syntax
18/// This function also has dedicated syntax: To strongly emphasize content,
19/// simply enclose it in stars/asterisks (`*`). Note that this only works at
20/// word boundaries. To strongly emphasize part of a word, you have to use the
21/// function.
22#[elem(title = "Strong Emphasis", keywords = ["bold", "weight"], Locatable, Tagged)]
23pub struct StrongElem {
24    /// The delta to apply on the font weight.
25    ///
26    /// ```example
27    /// #set strong(delta: 0)
28    /// No *effect!*
29    /// ```
30    #[default(300)]
31    pub delta: i64,
32
33    /// The content to strongly emphasize.
34    #[required]
35    pub body: Content,
36}