mirror of
https://github.com/typst/typst
synced 2025-05-13 12:36:23 +08:00
Formatting fixes
This commit is contained in:
parent
6f7e8dd497
commit
815ee3254c
@ -3,29 +3,29 @@ use crate::text::TextNode;
|
|||||||
|
|
||||||
/// # Columns
|
/// # Columns
|
||||||
/// Separate a region into multiple equally sized columns.
|
/// Separate a region into multiple equally sized columns.
|
||||||
///
|
///
|
||||||
/// The `column` function allows to separate the interior of any container into
|
/// The `column` function allows to separate the interior of any container into
|
||||||
/// multiple columns. It will not equalize the height of the columns, instead,
|
/// multiple columns. It will not equalize the height of the columns, instead,
|
||||||
/// the columns will take up the height of their container or the remaining
|
/// the columns will take up the height of their container or the remaining
|
||||||
/// height on the page. The columns function can break across pages if
|
/// height on the page. The columns function can break across pages if
|
||||||
/// necessary.
|
/// necessary.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
/// = Towards Advanced Deep Learning
|
/// = Towards Advanced Deep Learning
|
||||||
///
|
///
|
||||||
/// #box(height: 68pt,
|
/// #box(height: 68pt,
|
||||||
/// columns(2, gutter: 11pt)[
|
/// columns(2, gutter: 11pt)[
|
||||||
/// #set par(justify: true)
|
/// #set par(justify: true)
|
||||||
/// This research was funded by the
|
/// This research was funded by the
|
||||||
/// National Academy of Sciences.
|
/// National Academy of Sciences.
|
||||||
/// NAoS provided support for field
|
/// NAoS provided support for field
|
||||||
/// tests and interviews with a
|
/// tests and interviews with a
|
||||||
/// grant of up to USD 40.000 for a
|
/// grant of up to USD 40.000 for a
|
||||||
/// period of 6 months.
|
/// period of 6 months.
|
||||||
/// ]
|
/// ]
|
||||||
/// )
|
/// )
|
||||||
///
|
///
|
||||||
/// In recent years, deep learning has
|
/// In recent years, deep learning has
|
||||||
/// increasingly been used to solve a
|
/// increasingly been used to solve a
|
||||||
/// variety of problems.
|
/// variety of problems.
|
||||||
@ -150,11 +150,11 @@ impl Layout for ColumnsNode {
|
|||||||
|
|
||||||
/// # Column Break
|
/// # Column Break
|
||||||
/// A forced column break.
|
/// A forced column break.
|
||||||
///
|
///
|
||||||
/// The function will behave like a [page break](@pagebreak) when used in a
|
/// The function will behave like a [page break](@pagebreak) when used in a
|
||||||
/// single column layout or the last column on a page. Otherwise, content after
|
/// single column layout or the last column on a page. Otherwise, content after
|
||||||
/// the column break will be placed in the next column.
|
/// the column break will be placed in the next column.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
/// #set page(columns: 2)
|
/// #set page(columns: 2)
|
||||||
@ -163,7 +163,7 @@ impl Layout for ColumnsNode {
|
|||||||
/// revealed a hitherto unknown
|
/// revealed a hitherto unknown
|
||||||
/// phenomenon of extraordinary
|
/// phenomenon of extraordinary
|
||||||
/// significance.
|
/// significance.
|
||||||
///
|
///
|
||||||
/// #colbreak()
|
/// #colbreak()
|
||||||
/// Through rigorous experimentation
|
/// Through rigorous experimentation
|
||||||
/// and analysis, we have discovered
|
/// and analysis, we have discovered
|
||||||
|
@ -39,7 +39,7 @@ use crate::prelude::*;
|
|||||||
/// ### Example
|
/// ### Example
|
||||||
/// ```
|
/// ```
|
||||||
/// #set align(center)
|
/// #set align(center)
|
||||||
///
|
///
|
||||||
/// #box(
|
/// #box(
|
||||||
/// width: 80pt,
|
/// width: 80pt,
|
||||||
/// height: 80pt,
|
/// height: 80pt,
|
||||||
|
@ -4,11 +4,11 @@ use crate::prelude::*;
|
|||||||
|
|
||||||
/// # Spacing (H)
|
/// # Spacing (H)
|
||||||
/// Insert horizontal spacing into a paragraph.
|
/// Insert horizontal spacing into a paragraph.
|
||||||
///
|
///
|
||||||
/// The spacing can be a length or a fractional. In the latter case, the
|
/// The spacing can be a length or a fractional. In the latter case, the
|
||||||
/// remaining space on the line is distributed among all fractional spacings
|
/// remaining space on the line is distributed among all fractional spacings
|
||||||
/// according to their relative fractions.
|
/// according to their relative fractions.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
/// #circle(fill: red)
|
/// #circle(fill: red)
|
||||||
@ -26,7 +26,7 @@ use crate::prelude::*;
|
|||||||
/// If true, the spacing collapses at the start or end of a paragraph.
|
/// If true, the spacing collapses at the start or end of a paragraph.
|
||||||
/// Moreover, from multiple adjacent weak spacings all but the largest one
|
/// Moreover, from multiple adjacent weak spacings all but the largest one
|
||||||
/// collapse.
|
/// collapse.
|
||||||
///
|
///
|
||||||
/// ### Example
|
/// ### Example
|
||||||
/// ```
|
/// ```
|
||||||
/// #h(1cm, weak: true)
|
/// #h(1cm, weak: true)
|
||||||
@ -70,13 +70,13 @@ impl HNode {
|
|||||||
|
|
||||||
impl HNode {
|
impl HNode {
|
||||||
/// Normal strong spacing.
|
/// Normal strong spacing.
|
||||||
pub fn strong(amount: Spacing) -> Self {
|
pub fn strong(amount: impl Into<Spacing>) -> Self {
|
||||||
Self { amount, weak: false }
|
Self { amount: amount.into(), weak: false }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// User-created weak spacing.
|
/// User-created weak spacing.
|
||||||
pub fn weak(amount: Spacing) -> Self {
|
pub fn weak(amount: impl Into<Spacing>) -> Self {
|
||||||
Self { amount, weak: true }
|
Self { amount: amount.into(), weak: true }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ impl Behave for HNode {
|
|||||||
|
|
||||||
/// # Spacing (V)
|
/// # Spacing (V)
|
||||||
/// Insert vertical spacing.
|
/// Insert vertical spacing.
|
||||||
///
|
///
|
||||||
/// The spacing can be a length or a fractional. In the latter case, the
|
/// The spacing can be a length or a fractional. In the latter case, the
|
||||||
/// remaining space on the page is distributed among all fractional spacings
|
/// remaining space on the page is distributed among all fractional spacings
|
||||||
/// according to their relative fractions.
|
/// according to their relative fractions.
|
||||||
@ -111,15 +111,15 @@ impl Behave for HNode {
|
|||||||
/// considerations that must be
|
/// considerations that must be
|
||||||
/// taken into account when
|
/// taken into account when
|
||||||
/// conducting psychological
|
/// conducting psychological
|
||||||
/// research:
|
/// research:
|
||||||
/// #v(5mm)
|
/// #v(5mm)
|
||||||
///
|
///
|
||||||
/// - Informed consent
|
/// - Informed consent
|
||||||
/// - Participant confidentiality
|
/// - Participant confidentiality
|
||||||
/// - The use of
|
/// - The use of
|
||||||
/// vulnerable populations.
|
/// vulnerable populations.
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ## Parameters
|
/// ## Parameters
|
||||||
/// - amount: Spacing (positional, required)
|
/// - amount: Spacing (positional, required)
|
||||||
/// How much spacing to insert.
|
/// How much spacing to insert.
|
||||||
@ -129,7 +129,7 @@ impl Behave for HNode {
|
|||||||
/// from multiple adjacent weak spacings all but the largest one collapse.
|
/// from multiple adjacent weak spacings all but the largest one collapse.
|
||||||
/// Weak spacings will always collapse adjacent paragraph spacing, even if the
|
/// Weak spacings will always collapse adjacent paragraph spacing, even if the
|
||||||
/// paragraph spacing is larger.
|
/// paragraph spacing is larger.
|
||||||
///
|
///
|
||||||
/// ### Example
|
/// ### Example
|
||||||
/// ```
|
/// ```
|
||||||
/// The following theorem is
|
/// The following theorem is
|
||||||
|
@ -45,7 +45,7 @@ impl Align {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the position of this alignment in a container with the given
|
/// Returns the position of this alignment in a container with the given
|
||||||
/// extentq.
|
/// extent.
|
||||||
pub fn position(self, extent: Abs) -> Abs {
|
pub fn position(self, extent: Abs) -> Abs {
|
||||||
match self {
|
match self {
|
||||||
Self::Left | Self::Top => Abs::zero(),
|
Self::Left | Self::Top => Abs::zero(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user