Merge branch 'typst:main' into context-documentation

This commit is contained in:
Ullrich Koethe 2025-03-11 19:14:04 +01:00 committed by GitHub
commit ab5a9ee5ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 146 additions and 97 deletions

88
Cargo.lock generated
View File

@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "adler2"
@ -772,9 +772,9 @@ dependencies = [
[[package]]
name = "fontdb"
version = "0.21.0"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37be9fc20d966be438cd57a45767f73349477fb0f85ce86e000557f787298afb"
checksum = "457e789b3d1202543297a350643cf459f836cade38934e7a4cf6a39e7cde2905"
dependencies = [
"fontconfig-parser",
"log",
@ -1175,9 +1175,9 @@ dependencies = [
[[package]]
name = "image-webp"
version = "0.1.3"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f79afb8cbee2ef20f59ccd477a218c12a93943d075b492015ecb1bb81f8ee904"
checksum = "b77d01e822461baa8409e156015a1d91735549f0f2c17691bd2d996bef238f7f"
dependencies = [
"byteorder-lite",
"quick-error",
@ -1804,9 +1804,9 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315"
[[package]]
name = "pixglyph"
version = "0.5.1"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d15afa937836bf3d876f5a04ce28810c06045857bf46c3d0d31073b8aada5494"
checksum = "3c1106193bc18a4b840eb075ff6664c8a0b0270f0531bb12a7e9c803e53b55c5"
dependencies = [
"ttf-parser",
]
@ -2048,9 +2048,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]]
name = "resvg"
version = "0.43.0"
version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7314563c59c7ce31c18e23ad3dd092c37b928a0fa4e1c0a1a6504351ab411d1"
checksum = "dd43d1c474e9dadf09a8fdf22d713ba668b499b5117b9b9079500224e26b5b29"
dependencies = [
"gif",
"image-webp",
@ -2121,9 +2121,9 @@ checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4"
[[package]]
name = "rustybuzz"
version = "0.18.0"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c85d1ccd519e61834798eb52c4e886e8c2d7d698dd3d6ce0b1b47eb8557f1181"
checksum = "fd3c7c96f8a08ee34eff8857b11b49b07d71d1c3f4e88f8a88d4c9e9f90b1702"
dependencies = [
"bitflags 2.8.0",
"bytemuck",
@ -2410,9 +2410,9 @@ checksum = "74f98178f34057d4d4de93d68104007c6dea4dfac930204a69ab4622daefa648"
[[package]]
name = "svg2pdf"
version = "0.12.0"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5014c9dadcf318fb7ef8c16438e95abcc9de1ae24d60d5bccc64c55100c50364"
checksum = "e50dc062439cc1a396181059c80932a6e6bd731b130e674c597c0c8874b6df22"
dependencies = [
"fontdb",
"image",
@ -2709,9 +2709,9 @@ dependencies = [
[[package]]
name = "ttf-parser"
version = "0.24.1"
version = "0.25.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5be21190ff5d38e8b4a2d3b6a3ae57f612cc39c96e83cedeaf7abc338a8bac4a"
checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31"
dependencies = [
"core_maths",
]
@ -2735,7 +2735,7 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a"
[[package]]
name = "typst"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"comemo",
"ecow",
@ -2752,12 +2752,12 @@ dependencies = [
[[package]]
name = "typst-assets"
version = "0.13.0"
source = "git+https://github.com/typst/typst-assets?rev=fa0f8a4#fa0f8a438cc4bc2113cc0aa3304cd68cdc2bc020"
version = "0.13.1"
source = "git+https://github.com/typst/typst-assets?rev=ab1295f#ab1295ff896444e51902e03c2669955e1d73604a"
[[package]]
name = "typst-cli"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"chrono",
"clap",
@ -2802,12 +2802,12 @@ dependencies = [
[[package]]
name = "typst-dev-assets"
version = "0.13.0"
source = "git+https://github.com/typst/typst-dev-assets?rev=61aebe9#61aebe9575a5abff889f76d73c7b01dc8e17e340"
version = "0.13.1"
source = "git+https://github.com/typst/typst-dev-assets?rev=9879589#9879589f4b3247b12c5e694d0d7fa86d4d8a198e"
[[package]]
name = "typst-docs"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"clap",
"ecow",
@ -2830,7 +2830,7 @@ dependencies = [
[[package]]
name = "typst-eval"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"comemo",
"ecow",
@ -2848,7 +2848,7 @@ dependencies = [
[[package]]
name = "typst-fuzz"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"comemo",
"libfuzzer-sys",
@ -2860,7 +2860,7 @@ dependencies = [
[[package]]
name = "typst-html"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"comemo",
"ecow",
@ -2874,7 +2874,7 @@ dependencies = [
[[package]]
name = "typst-ide"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"comemo",
"ecow",
@ -2891,7 +2891,7 @@ dependencies = [
[[package]]
name = "typst-kit"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"dirs",
"ecow",
@ -2914,7 +2914,7 @@ dependencies = [
[[package]]
name = "typst-layout"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"az",
"bumpalo",
@ -2944,7 +2944,7 @@ dependencies = [
[[package]]
name = "typst-library"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"az",
"bitflags 2.8.0",
@ -3005,7 +3005,7 @@ dependencies = [
[[package]]
name = "typst-macros"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"heck",
"proc-macro2",
@ -3015,7 +3015,7 @@ dependencies = [
[[package]]
name = "typst-pdf"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"arrayvec",
"base64",
@ -3041,7 +3041,7 @@ dependencies = [
[[package]]
name = "typst-realize"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"arrayvec",
"bumpalo",
@ -3057,7 +3057,7 @@ dependencies = [
[[package]]
name = "typst-render"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"bytemuck",
"comemo",
@ -3073,7 +3073,7 @@ dependencies = [
[[package]]
name = "typst-svg"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"base64",
"comemo",
@ -3091,7 +3091,7 @@ dependencies = [
[[package]]
name = "typst-syntax"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"ecow",
"serde",
@ -3107,7 +3107,7 @@ dependencies = [
[[package]]
name = "typst-tests"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"clap",
"comemo",
@ -3132,7 +3132,7 @@ dependencies = [
[[package]]
name = "typst-timing"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"parking_lot",
"serde",
@ -3142,7 +3142,7 @@ dependencies = [
[[package]]
name = "typst-utils"
version = "0.13.0"
version = "0.13.1"
dependencies = [
"once_cell",
"portable-atomic",
@ -3185,15 +3185,15 @@ checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5"
[[package]]
name = "unicode-bidi-mirroring"
version = "0.3.0"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64af057ad7466495ca113126be61838d8af947f41d93a949980b2389a118082f"
checksum = "5dfa6e8c60bb66d49db113e0125ee8711b7647b5579dc7f5f19c42357ed039fe"
[[package]]
name = "unicode-ccc"
version = "0.3.0"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "260bc6647b3893a9a90668360803a15f96b85a5257b1c3a0c3daf6ae2496de42"
checksum = "ce61d488bcdc9bc8b5d1772c404828b17fc481c0a582b5581e95fb233aef503e"
[[package]]
name = "unicode-ident"
@ -3288,9 +3288,9 @@ dependencies = [
[[package]]
name = "usvg"
version = "0.43.0"
version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6803057b5cbb426e9fb8ce2216f3a9b4ca1dd2c705ba3cbebc13006e437735fd"
checksum = "2ac8e0e3e4696253dc06167990b3fe9a2668ab66270adf949a464db4088cb354"
dependencies = [
"base64",
"data-url",

View File

@ -4,7 +4,7 @@ default-members = ["crates/typst-cli"]
resolver = "2"
[workspace.package]
version = "0.13.0"
version = "0.13.1"
rust-version = "1.83" # also change in ci.yml
authors = ["The Typst Project Developers"]
edition = "2021"
@ -16,24 +16,24 @@ keywords = ["typst"]
readme = "README.md"
[workspace.dependencies]
typst = { path = "crates/typst", version = "0.13.0" }
typst-cli = { path = "crates/typst-cli", version = "0.13.0" }
typst-eval = { path = "crates/typst-eval", version = "0.13.0" }
typst-html = { path = "crates/typst-html", version = "0.13.0" }
typst-ide = { path = "crates/typst-ide", version = "0.13.0" }
typst-kit = { path = "crates/typst-kit", version = "0.13.0" }
typst-layout = { path = "crates/typst-layout", version = "0.13.0" }
typst-library = { path = "crates/typst-library", version = "0.13.0" }
typst-macros = { path = "crates/typst-macros", version = "0.13.0" }
typst-pdf = { path = "crates/typst-pdf", version = "0.13.0" }
typst-realize = { path = "crates/typst-realize", version = "0.13.0" }
typst-render = { path = "crates/typst-render", version = "0.13.0" }
typst-svg = { path = "crates/typst-svg", version = "0.13.0" }
typst-syntax = { path = "crates/typst-syntax", version = "0.13.0" }
typst-timing = { path = "crates/typst-timing", version = "0.13.0" }
typst-utils = { path = "crates/typst-utils", version = "0.13.0" }
typst-assets = { git = "https://github.com/typst/typst-assets", rev = "fa0f8a4" }
typst-dev-assets = { git = "https://github.com/typst/typst-dev-assets", rev = "61aebe9" }
typst = { path = "crates/typst", version = "0.13.1" }
typst-cli = { path = "crates/typst-cli", version = "0.13.1" }
typst-eval = { path = "crates/typst-eval", version = "0.13.1" }
typst-html = { path = "crates/typst-html", version = "0.13.1" }
typst-ide = { path = "crates/typst-ide", version = "0.13.1" }
typst-kit = { path = "crates/typst-kit", version = "0.13.1" }
typst-layout = { path = "crates/typst-layout", version = "0.13.1" }
typst-library = { path = "crates/typst-library", version = "0.13.1" }
typst-macros = { path = "crates/typst-macros", version = "0.13.1" }
typst-pdf = { path = "crates/typst-pdf", version = "0.13.1" }
typst-realize = { path = "crates/typst-realize", version = "0.13.1" }
typst-render = { path = "crates/typst-render", version = "0.13.1" }
typst-svg = { path = "crates/typst-svg", version = "0.13.1" }
typst-syntax = { path = "crates/typst-syntax", version = "0.13.1" }
typst-timing = { path = "crates/typst-timing", version = "0.13.1" }
typst-utils = { path = "crates/typst-utils", version = "0.13.1" }
typst-assets = { git = "https://github.com/typst/typst-assets", rev = "ab1295f" }
typst-dev-assets = { git = "https://github.com/typst/typst-dev-assets", rev = "9879589" }
arrayvec = "0.7.4"
az = "1.2"
base64 = "0.22"
@ -56,7 +56,7 @@ dirs = "6"
ecow = { version = "0.2", features = ["serde"] }
env_proxy = "0.4"
flate2 = "1"
fontdb = { version = "0.21", default-features = false }
fontdb = { version = "0.23", default-features = false }
fs_extra = "1.3"
hayagriva = "0.8.1"
heck = "0.5"
@ -86,7 +86,7 @@ parking_lot = "0.12.1"
pathdiff = "0.2"
pdf-writer = "0.12.1"
phf = { version = "0.11", features = ["macros"] }
pixglyph = "0.5.1"
pixglyph = "0.6"
png = "0.17"
portable-atomic = "1.6"
proc-macro2 = "1"
@ -96,10 +96,10 @@ quote = "1"
rayon = "1.7.0"
regex = "1"
regex-syntax = "0.8"
resvg = { version = "0.43", default-features = false, features = ["raster-images"] }
resvg = { version = "0.45", default-features = false, features = ["raster-images"] }
roxmltree = "0.20"
rust_decimal = { version = "1.36.0", default-features = false, features = ["maths"] }
rustybuzz = "0.18"
rustybuzz = "0.20"
same-file = "1"
self-replace = "1.3.7"
semver = "1"
@ -112,7 +112,7 @@ siphasher = "1"
smallvec = { version = "1.11.1", features = ["union", "const_generics", "const_new"] }
stacker = "0.1.15"
subsetter = "0.2"
svg2pdf = "0.12"
svg2pdf = "0.13"
syn = { version = "2", features = ["full", "extra-traits"] }
syntect = { version = "5", default-features = false, features = ["parsing", "regex-fancy", "plist-load", "yaml-load"] }
tar = "0.4"
@ -122,7 +122,7 @@ time = { version = "0.3.20", features = ["formatting", "macros", "parsing"] }
tiny_http = "0.12"
tiny-skia = "0.11"
toml = { version = "0.8", default-features = false, features = ["parse", "display"] }
ttf-parser = "0.24.1"
ttf-parser = "0.25.0"
two-face = { version = "0.4.3", default-features = false, features = ["syntect-fancy"] }
typed-arena = "2"
unicode-bidi = "0.3.18"
@ -133,7 +133,7 @@ unicode-normalization = "0.1.24"
unicode-segmentation = "1"
unscanny = "0.1"
ureq = { version = "2", default-features = false, features = ["native-tls", "gzip", "json"] }
usvg = { version = "0.43", default-features = false, features = ["text"] }
usvg = { version = "0.45", default-features = false, features = ["text"] }
walkdir = "2"
wasmi = "0.40.0"
web-sys = "0.3"

View File

@ -26,7 +26,7 @@ pub fn analyze_expr(
ast::Expr::Str(v) => Value::Str(v.get().into()),
_ => {
if node.kind() == SyntaxKind::Contextual {
if let Some(child) = node.children().last() {
if let Some(child) = node.children().next_back() {
return analyze_expr(world, &child);
}
}

View File

@ -115,7 +115,7 @@ impl<'a, 'b> Composer<'a, 'b, '_, '_> {
let column_height = regions.size.y;
let backlog: Vec<_> = std::iter::once(&column_height)
.chain(regions.backlog)
.flat_map(|&h| std::iter::repeat(h).take(self.config.columns.count))
.flat_map(|&h| std::iter::repeat_n(h, self.config.columns.count))
.skip(1)
.collect();

View File

@ -1469,7 +1469,7 @@ impl<'a> GridLayouter<'a> {
// last height is the one for the current region.
rowspan
.heights
.extend(std::iter::repeat(Abs::zero()).take(amount_missing_heights));
.extend(std::iter::repeat_n(Abs::zero(), amount_missing_heights));
// Ensure that, in this region, the rowspan will span at least
// this row.

View File

@ -85,14 +85,15 @@ pub fn layout_root(
ascent.set_max(shift_up + index.ascent());
}
let radicand_x = sqrt_offset + sqrt.width();
let sqrt_x = sqrt_offset.max(Abs::zero());
let radicand_x = sqrt_x + sqrt.width();
let radicand_y = ascent - radicand.ascent();
let width = radicand_x + radicand.width();
let size = Size::new(width, ascent + descent);
// The extra "- thickness" comes from the fact that the sqrt is placed
// in `push_frame` with respect to its top, not its baseline.
let sqrt_pos = Point::new(sqrt_offset, radicand_y - gap - thickness);
let sqrt_pos = Point::new(sqrt_x, radicand_y - gap - thickness);
let line_pos = Point::new(radicand_x, radicand_y - gap - (thickness / 2.0));
let radicand_pos = Point::new(radicand_x, radicand_y);
@ -100,7 +101,8 @@ pub fn layout_root(
frame.set_baseline(ascent);
if let Some(index) = index {
let index_pos = Point::new(kern_before, ascent - index.ascent() - shift_up);
let index_x = -sqrt_offset.min(Abs::zero()) + kern_before;
let index_pos = Point::new(index_x, ascent - index.ascent() - shift_up);
frame.push_frame(index_pos, index);
}

View File

@ -302,6 +302,6 @@ fn assemble(
fn parts(assembly: GlyphAssembly, repeat: usize) -> impl Iterator<Item = GlyphPart> + '_ {
assembly.parts.into_iter().flat_map(move |part| {
let count = if part.part_flags.extender() { repeat } else { 1 };
std::iter::repeat(part).take(count)
std::iter::repeat_n(part, count)
})
}

View File

@ -21,7 +21,7 @@ use crate::foundations::{
///
/// Type casting works as follows:
/// - [`Reflect for T`](Reflect) describes the possible Typst values for `T`
/// (for documentation and autocomplete).
/// (for documentation and autocomplete).
/// - [`IntoValue for T`](IntoValue) is for conversion from `T -> Value`
/// (infallible)
/// - [`FromValue for T`](FromValue) is for conversion from `Value -> T`

View File

@ -112,7 +112,7 @@ use crate::foundations::{
/// it into another file by writing `{import "foo.typ": alert}`.
///
/// # Unnamed functions { #unnamed }
/// You can also created an unnamed function without creating a binding by
/// You can also create an unnamed function without creating a binding by
/// specifying a parameter list followed by `=>` and the function body. If your
/// function has just one parameter, the parentheses around the parameter list
/// are optional. Unnamed functions are mainly useful for show rules, but also

View File

@ -394,7 +394,7 @@ impl NumberingKind {
const SYMBOLS: &[char] = &['*', '†', '‡', '§', '¶', '‖'];
let symbol = SYMBOLS[(n - 1) % SYMBOLS.len()];
let amount = ((n - 1) / SYMBOLS.len()) + 1;
std::iter::repeat(symbol).take(amount).collect()
std::iter::repeat_n(symbol, amount).collect()
}
Self::Hebrew => hebrew_numeral(n),

View File

@ -574,8 +574,7 @@ impl Gradient {
}
let n = repetitions.v;
let mut stops = std::iter::repeat(self.stops_ref())
.take(n)
let mut stops = std::iter::repeat_n(self.stops_ref(), n)
.enumerate()
.flat_map(|(i, stops)| {
let mut stops = stops

View File

@ -180,7 +180,7 @@ pub fn write_font_descriptor<'a>(
font.to_em(global_bbox.y_max).to_font_units(),
);
let italic_angle = ttf.italic_angle().unwrap_or(0.0);
let italic_angle = ttf.italic_angle();
let ascender = metrics.ascender.to_font_units();
let descender = metrics.descender.to_font_units();
let cap_height = metrics.cap_height.to_font_units();

View File

@ -326,7 +326,10 @@ fn visit_math_rules<'a>(
// Symbols in non-math content transparently convert to `TextElem` so we
// don't have to handle them in non-math layout.
if let Some(elem) = content.to_packed::<SymbolElem>() {
let text = TextElem::packed(elem.text).spanned(elem.span());
let mut text = TextElem::packed(elem.text).spanned(elem.span());
if let Some(label) = elem.label() {
text.set_label(label);
}
visit(s, s.store(text), styles)?;
return Ok(true);
}

View File

@ -69,9 +69,11 @@ pub fn render_shape(canvas: &mut sk::Pixmap, state: State, shape: &Shape) -> Opt
let dash = dash.as_ref().and_then(to_sk_dash_pattern);
let bbox = shape.geometry.bbox_size();
let offset_bbox = (!matches!(shape.geometry, Geometry::Line(..)))
.then(|| offset_bounding_box(bbox, *thickness))
.unwrap_or(bbox);
let offset_bbox = if !matches!(shape.geometry, Geometry::Line(..)) {
offset_bounding_box(bbox, *thickness)
} else {
bbox
};
let fill_transform =
(!matches!(shape.geometry, Geometry::Line(..))).then(|| {

View File

@ -294,20 +294,20 @@ feature flag.
`errorbar.diamond.stroked`, `errorbar.diamond.filled`,
`errorbar.circle.stroked`, `errorbar.circle.filled`
- `numero`
- `Omega.inv`
- Renamed
- Renamed **(Breaking change)**
- `ohm.inv` to `Omega.inv`
- Changed codepoint
- Changed codepoint **(Breaking change)**
- `angle.l.double` from `《` to `⟪`
- `angle.r.double` from `》` to `⟫`
- `angstrom` from U+212B (`Å`) to U+00C5 (`Å`)
- Deprecated
- `sect` and all its variants in favor of `inter`
- `integral.sect` in favor of `integral.inter`
- Removed
- Removed **(Breaking change)**
- `degree.c` in favor of `°C` (`[$upright(°C)$]` or `[$upright(degree C)$]` in math)
- `degree.f` in favor of `°F` (`[$upright(°F)$]` or `[$upright(degree F)$]` in math)
- `kelvin` in favor of just K (`[$upright(K)$]` in math)
- `ohm` in favor of `Omega`
## Deprecations
- The [`path`] function in favor of the [`curve`] function

29
docs/changelog/0.13.1.md Normal file
View File

@ -0,0 +1,29 @@
---
title: 0.13.1
description: Changes in Typst 0.13.1
---
# Version 0.13.1 (March 7, 2025)
## Command Line Interface
- Fixed high CPU usage for `typst watch` on Linux. Depending on the project
size, CPU usage would spike for varying amounts of time. This bug appeared
with 0.13.0 due to a behavioral change in the inotify file watching backend.
## HTML export
- Fixed export of tables with [gutters]($table.gutter)
- Fixed usage of `<html>` and `<body>` element within [context]
- Fixed querying of [metadata] next to `<html>` and `<body>` element
## Visualization
- Fixed [curves]($curve) with multiple non-closed components
## Introspection
- Fixed a regression where labelled [symbols]($symbol) could not be
[queried]($query) by label
## Deprecations
- Fixed false positives in deprecation warnings for type/str comparisons
## Contributors
<contributors from="v0.13.0" to="v0.13.1" />

View File

@ -10,6 +10,7 @@ forward. This section documents all changes to Typst since its initial public
release.
## Versions
- [Typst 0.13.1]($changelog/0.13.1)
- [Typst 0.13.0]($changelog/0.13.0)
- [Typst 0.12.0]($changelog/0.12.0)
- [Typst 0.11.1]($changelog/0.11.1)

View File

@ -188,6 +188,7 @@ fn changelog_pages(resolver: &dyn Resolver) -> PageModel {
let mut page = md_page(resolver, resolver.base(), load!("changelog/welcome.md"));
let base = format!("{}changelog/", resolver.base());
page.children = vec![
md_page(resolver, &base, load!("changelog/0.13.1.md")),
md_page(resolver, &base, load!("changelog/0.13.0.md")),
md_page(resolver, &base, load!("changelog/0.12.0.md")),
md_page(resolver, &base, load!("changelog/0.11.1.md")),

View File

@ -13,11 +13,11 @@ your report using Typst's styling system.
As we have seen in the previous chapter, Typst has functions that _insert_
content (e.g. the [`image`] function) and others that _manipulate_ content that
they received as arguments (e.g. the [`align`] function). The first impulse you
might have when you want, for example, to justify the report, could be to look
might have when you want, for example, to change the font, could be to look
for a function that does that and wrap the complete document in it.
```example
#par(justify: true)[
#text(font: "New Computer Modern")[
= Background
In the case of glaciers, fluid
dynamics principles can be used
@ -37,9 +37,9 @@ do in Typst, there is special syntax for it: Instead of putting the content
inside of the argument list, you can write it in square brackets directly after
the normal arguments, saving on punctuation.
As seen above, that works. The [`par`] function justifies all paragraphs within
it. However, wrapping the document in countless functions and applying styles
selectively and in-situ can quickly become cumbersome.
As seen above, that works. With the [`text`] function, we can adjust the font
for all text within it. However, wrapping the document in countless functions
and applying styles selectively and in-situ can quickly become cumbersome.
Fortunately, Typst has a more elegant solution. With _set rules,_ you can apply
style properties to all occurrences of some kind of content. You write a set
@ -47,7 +47,9 @@ rule by entering the `{set}` keyword, followed by the name of the function whose
properties you want to set, and a list of arguments in parentheses.
```example
#set par(justify: true)
#set text(
font: "New Computer Modern"
)
= Background
In the case of glaciers, fluid

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 902 B

View File

@ -44,3 +44,9 @@ $ root(2, x) quad
$ 2^3 = sqrt(2^3) $
$ (x+y) quad x quad x $
$ (2+3) = (sqrt(2)+3) $
--- math-root-frame-size-index ---
// Test size of final frame when there is an index.
$ a root(, 3) & a root(., 3) \
a sqrt(3) & a root(2, 3) \
a root(#h(-1em), 3) & a root(123, 3) $

View File

@ -151,3 +151,7 @@
--- symbol-sect-deprecated ---
// Warning: 5-9 `sect` is deprecated, use `inter` instead
$ A sect B = A inter B $
--- issue-5930-symbol-label ---
#emoji.face<lab>
#context test(query(<lab>).first().text, "😀")