mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Fixed typos (#2524)
This commit is contained in:
parent
a5d72c2ac1
commit
c3114fa380
@ -88,7 +88,7 @@ pub struct FuncModel {
|
|||||||
pub element: bool,
|
pub element: bool,
|
||||||
pub details: Html,
|
pub details: Html,
|
||||||
/// This example is only for nested function models. Others can have
|
/// This example is only for nested function models. Others can have
|
||||||
/// their example directly in their detals.
|
/// their example directly in their details.
|
||||||
pub example: Option<Html>,
|
pub example: Option<Html>,
|
||||||
#[serde(rename = "self")]
|
#[serde(rename = "self")]
|
||||||
pub self_: bool,
|
pub self_: bool,
|
||||||
|
@ -808,7 +808,7 @@ fn shape_range<'a>(
|
|||||||
let mut cursor = range.start;
|
let mut cursor = range.start;
|
||||||
|
|
||||||
// Group by embedding level and script. If the text's script is explicitly
|
// Group by embedding level and script. If the text's script is explicitly
|
||||||
// set (rather than inferred from the glpyhs), we keep the script at an
|
// set (rather than inferred from the glyphs), we keep the script at an
|
||||||
// unchanging `Script::Unknown` so that only level changes cause breaks.
|
// unchanging `Script::Unknown` so that only level changes cause breaks.
|
||||||
for i in range.clone() {
|
for i in range.clone() {
|
||||||
if !bidi.text.is_char_boundary(i) {
|
if !bidi.text.is_char_boundary(i) {
|
||||||
|
@ -31,7 +31,7 @@ pub struct HElem {
|
|||||||
/// next to weak spacing, you can explicitly write `[#" "]` (for a normal
|
/// next to weak spacing, you can explicitly write `[#" "]` (for a normal
|
||||||
/// space) or `[~]` (for a non-breaking space). The latter can be useful to
|
/// space) or `[~]` (for a non-breaking space). The latter can be useful to
|
||||||
/// create a construct that always attaches to the preceding word with one
|
/// create a construct that always attaches to the preceding word with one
|
||||||
/// non-breaking space, independently of wether a markup space existed in
|
/// non-breaking space, independently of whether a markup space existed in
|
||||||
/// front or not.
|
/// front or not.
|
||||||
///
|
///
|
||||||
/// ```example
|
/// ```example
|
||||||
|
@ -61,7 +61,7 @@ use crate::visualize::ImageElem;
|
|||||||
/// breakable and non-breakable blocks.
|
/// breakable and non-breakable blocks.
|
||||||
///
|
///
|
||||||
/// # Caption customization
|
/// # Caption customization
|
||||||
/// You can modify the apperance of the figure's caption with its associated
|
/// You can modify the appearance of the figure's caption with its associated
|
||||||
/// [`caption`]($figure.caption) function. In the example below, we emphasize
|
/// [`caption`]($figure.caption) function. In the example below, we emphasize
|
||||||
/// all captions:
|
/// all captions:
|
||||||
///
|
///
|
||||||
|
@ -8,7 +8,7 @@ use crate::prelude::*;
|
|||||||
/// # Example
|
/// # Example
|
||||||
/// ```example
|
/// ```example
|
||||||
/// Plato is often misquoted as the author of #quote[I know that I know
|
/// Plato is often misquoted as the author of #quote[I know that I know
|
||||||
/// nothing], however, this is a derivation form his orginal quote:
|
/// nothing], however, this is a derivation form his original quote:
|
||||||
/// #set quote(block: true)
|
/// #set quote(block: true)
|
||||||
/// #quote(attribution: [Plato])[
|
/// #quote(attribution: [Plato])[
|
||||||
/// ... ἔοικα γοῦν τούτου γε σμικρῷ τινι αὐτῷ τούτῳ σοφώτερος εἶναι, ὅτι
|
/// ... ἔοικα γοῦν τούτου γε σμικρῷ τινι αὐτῷ τούτῳ σοφώτερος εἶναι, ὅτι
|
||||||
@ -92,7 +92,7 @@ pub struct QuoteElem {
|
|||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// Note that bilbiography styles which do not include the author in the
|
/// Note that bilbiography styles which do not include the author in the
|
||||||
/// citation (label, numberic and notes) currently produce attributions such
|
/// citation (label, numeric and notes) currently produce attributions such
|
||||||
/// as `[---#super[1]]` or `[--- [1]]`, this will be fixed soon with CSL
|
/// as `[---#super[1]]` or `[--- [1]]`, this will be fixed soon with CSL
|
||||||
/// support. In the mean time you can simply cite yourself:
|
/// support. In the mean time you can simply cite yourself:
|
||||||
/// ```example
|
/// ```example
|
||||||
@ -161,7 +161,7 @@ impl Show for QuoteElem {
|
|||||||
|
|
||||||
// TODO: these should use the citation-format attribute, once CSL
|
// TODO: these should use the citation-format attribute, once CSL
|
||||||
// is implemented and retrieve the authors for non-author formats
|
// is implemented and retrieve the authors for non-author formats
|
||||||
// themeselves, see:
|
// themselves, see:
|
||||||
// - https://github.com/typst/typst/pull/2252#issuecomment-1741146989
|
// - https://github.com/typst/typst/pull/2252#issuecomment-1741146989
|
||||||
// - https://github.com/typst/typst/pull/2252#issuecomment-1744634132
|
// - https://github.com/typst/typst/pull/2252#issuecomment-1744634132
|
||||||
Ok(match bib.style(styles) {
|
Ok(match bib.style(styles) {
|
||||||
|
@ -128,7 +128,7 @@ impl Layout for ImageElem {
|
|||||||
styles: StyleChain,
|
styles: StyleChain,
|
||||||
regions: Regions,
|
regions: Regions,
|
||||||
) -> SourceResult<Fragment> {
|
) -> SourceResult<Fragment> {
|
||||||
// Take the format that was explicitly defined, or parse the extention,
|
// Take the format that was explicitly defined, or parse the extension,
|
||||||
// or try to detect the format.
|
// or try to detect the format.
|
||||||
let data = self.data();
|
let data = self.data();
|
||||||
let format = match self.format(styles) {
|
let format = match self.format(styles) {
|
||||||
|
@ -119,7 +119,7 @@ fn parse(stream: TokenStream, item: &syn::ItemFn) -> Result<Func> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parse details about a functino parameter.
|
/// Parse details about a function parameter.
|
||||||
fn parse_param(
|
fn parse_param(
|
||||||
special: &mut SpecialParams,
|
special: &mut SpecialParams,
|
||||||
params: &mut Vec<Param>,
|
params: &mut Vec<Param>,
|
||||||
|
@ -650,7 +650,7 @@ pub struct SyntaxError {
|
|||||||
pub span: Span,
|
pub span: Span,
|
||||||
/// The error message.
|
/// The error message.
|
||||||
pub message: EcoString,
|
pub message: EcoString,
|
||||||
/// Additonal hints to the user, indicating how this error could be avoided
|
/// Additional hints to the user, indicating how this error could be avoided
|
||||||
/// or worked around.
|
/// or worked around.
|
||||||
pub hints: EcoVec<EcoString>,
|
pub hints: EcoVec<EcoString>,
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ pub struct SourceDiagnostic {
|
|||||||
pub message: EcoString,
|
pub message: EcoString,
|
||||||
/// The trace of function calls leading to the problem.
|
/// The trace of function calls leading to the problem.
|
||||||
pub trace: EcoVec<Spanned<Tracepoint>>,
|
pub trace: EcoVec<Spanned<Tracepoint>>,
|
||||||
/// Additonal hints to the user, indicating how this problem could be avoided
|
/// Additional hints to the user, indicating how this problem could be avoided
|
||||||
/// or worked around.
|
/// or worked around.
|
||||||
pub hints: EcoVec<EcoString>,
|
pub hints: EcoVec<EcoString>,
|
||||||
}
|
}
|
||||||
@ -256,7 +256,7 @@ pub type HintedStrResult<T> = Result<T, HintedString>;
|
|||||||
pub struct HintedString {
|
pub struct HintedString {
|
||||||
/// A diagnostic message describing the problem.
|
/// A diagnostic message describing the problem.
|
||||||
pub message: EcoString,
|
pub message: EcoString,
|
||||||
/// Additonal hints to the user, indicating how this error could be avoided
|
/// Additional hints to the user, indicating how this error could be avoided
|
||||||
/// or worked around.
|
/// or worked around.
|
||||||
pub hints: Vec<EcoString>,
|
pub hints: Vec<EcoString>,
|
||||||
}
|
}
|
||||||
@ -382,7 +382,7 @@ impl From<FileError> for EcoString {
|
|||||||
/// A result type with a package-related error.
|
/// A result type with a package-related error.
|
||||||
pub type PackageResult<T> = Result<T, PackageError>;
|
pub type PackageResult<T> = Result<T, PackageError>;
|
||||||
|
|
||||||
/// An error that occured while trying to load a package.
|
/// An error that occurred while trying to load a package.
|
||||||
///
|
///
|
||||||
/// Some variants have an optional string can give more details, if available.
|
/// Some variants have an optional string can give more details, if available.
|
||||||
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
|
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
|
||||||
|
@ -1187,7 +1187,7 @@ impl Eval for ast::FuncCall<'_> {
|
|||||||
// allowed for functions, types, modules (because they are scopes),
|
// allowed for functions, types, modules (because they are scopes),
|
||||||
// and symbols (because they have modifiers).
|
// and symbols (because they have modifiers).
|
||||||
//
|
//
|
||||||
// For dictionaries, it is not allowed because it would be ambigious
|
// For dictionaries, it is not allowed because it would be ambiguous
|
||||||
// (prioritizing associated functions would make an addition of a
|
// (prioritizing associated functions would make an addition of a
|
||||||
// new associated function a breaking change and prioritizing fields
|
// new associated function a breaking change and prioritizing fields
|
||||||
// would break associated functions for certain dictionaries).
|
// would break associated functions for certain dictionaries).
|
||||||
|
@ -135,8 +135,8 @@ impl Content {
|
|||||||
|
|
||||||
/// Also auto expands sequence of sequences into flat sequence
|
/// Also auto expands sequence of sequences into flat sequence
|
||||||
pub fn sequence_recursive_for_each(&self, f: &mut impl FnMut(&Self)) {
|
pub fn sequence_recursive_for_each(&self, f: &mut impl FnMut(&Self)) {
|
||||||
if let Some(childs) = self.to_sequence() {
|
if let Some(children) = self.to_sequence() {
|
||||||
childs.for_each(|c| c.sequence_recursive_for_each(f));
|
children.for_each(|c| c.sequence_recursive_for_each(f));
|
||||||
} else {
|
} else {
|
||||||
f(self);
|
f(self);
|
||||||
}
|
}
|
||||||
|
@ -486,7 +486,7 @@ $ f(x) = (x + 1) / x $
|
|||||||
to include more than one value in a sub- or superscript, enclose their contents
|
to include more than one value in a sub- or superscript, enclose their contents
|
||||||
in parentheses: `{$x_(a -> epsilon)$}`.
|
in parentheses: `{$x_(a -> epsilon)$}`.
|
||||||
|
|
||||||
Since variables in math mode do not need to be preprended with a `#` or a `/`,
|
Since variables in math mode do not need to be prepended with a `#` or a `/`,
|
||||||
you can also call functions without these special characters:
|
you can also call functions without these special characters:
|
||||||
|
|
||||||
```example
|
```example
|
||||||
@ -545,7 +545,7 @@ The example below
|
|||||||
- sets wide [margins]($page.margin)
|
- sets wide [margins]($page.margin)
|
||||||
- enables [justification]($par.justify), [tighter lines]($par.leading) and
|
- enables [justification]($par.justify), [tighter lines]($par.leading) and
|
||||||
[first-line-indent]($par.first-line-indent)
|
[first-line-indent]($par.first-line-indent)
|
||||||
- [sets the font]($text.font) to "New Computer Modern", an OpenType derivate of
|
- [sets the font]($text.font) to "New Computer Modern", an OpenType derivative of
|
||||||
Computer Modern for both text and [code blocks]($raw)
|
Computer Modern for both text and [code blocks]($raw)
|
||||||
- disables paragraph [spacing]($block.spacing)
|
- disables paragraph [spacing]($block.spacing)
|
||||||
- increases [spacing]($block.spacing) around [headings]($heading)
|
- increases [spacing]($block.spacing) around [headings]($heading)
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.8 KiB |
@ -12,7 +12,7 @@ Sixth
|
|||||||
#pagebreak()
|
#pagebreak()
|
||||||
Seventh
|
Seventh
|
||||||
#pagebreak(to: "odd")
|
#pagebreak(to: "odd")
|
||||||
#page[Nineth]
|
#page[Ninth]
|
||||||
|
|
||||||
---
|
---
|
||||||
#set page(width: auto, height: auto)
|
#set page(width: auto, height: auto)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user