mirror of https://github.com/stelzo/typst.git
Compare commits
4 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
be849526b6 | |
|
|
91245311a8 | |
|
|
9cc920cc62 | |
|
|
e0246192ee |
File diff suppressed because it is too large
Load Diff
5022
Cargo.lock.bak
5022
Cargo.lock.bak
File diff suppressed because it is too large
Load Diff
102
Cargo.toml
102
Cargo.toml
|
|
@ -4,8 +4,8 @@ default-members = ["crates/typst-cli"]
|
|||
resolver = "2"
|
||||
|
||||
[workspace.package]
|
||||
version = "0.13.1"
|
||||
rust-version = "1.81" # also change in ci.yml
|
||||
version = "0.13.0"
|
||||
rust-version = "1.81" # also change in ci.yml
|
||||
authors = ["The Typst Project Developers"]
|
||||
edition = "2021"
|
||||
homepage = "https://typst.app"
|
||||
|
|
@ -16,32 +16,37 @@ keywords = ["typst"]
|
|||
readme = "README.md"
|
||||
|
||||
[workspace.dependencies]
|
||||
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 = "0.13.1"
|
||||
typst-dev-assets = { git = "https://github.com/typst/typst-dev-assets", tag = "v0.13.1" }
|
||||
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 = "0.13.0"
|
||||
typst-dev-assets = { git = "https://github.com/typst/typst-dev-assets", tag = "v0.13.0" }
|
||||
arrayvec = "0.7.4"
|
||||
az = "1.2"
|
||||
base64 = "0.22"
|
||||
bitflags = { version = "2", features = ["serde"] }
|
||||
bumpalo = { version = "3.15.4", features = ["boxed", "collections"] }
|
||||
bytemuck = "1"
|
||||
chinese-number = { version = "0.7.2", default-features = false, features = ["number-to-chinese"] }
|
||||
chrono = { version = "0.4.24", default-features = false, features = ["clock", "std"] }
|
||||
chinese-number = { version = "0.7.2", default-features = false, features = [
|
||||
"number-to-chinese",
|
||||
] }
|
||||
chrono = { version = "0.4.24", default-features = false, features = [
|
||||
"clock",
|
||||
"std",
|
||||
] }
|
||||
ciborium = "0.2.1"
|
||||
clap = { version = "4.4", features = ["derive", "env", "wrap_help"] }
|
||||
clap_complete = "4.2.1"
|
||||
|
|
@ -68,7 +73,11 @@ icu_provider_adapters = "1.4"
|
|||
icu_provider_blob = "1.4"
|
||||
icu_segmenter = { version = "1.4", features = ["serde"] }
|
||||
if_chain = "1"
|
||||
image = { version = "0.25.5", default-features = false, features = ["png", "jpeg", "gif"] }
|
||||
image = { version = "0.25.5", default-features = false, features = [
|
||||
"png",
|
||||
"jpeg",
|
||||
"gif",
|
||||
] }
|
||||
indexmap = { version = "2", features = ["serde"] }
|
||||
kamadak-exif = "0.6"
|
||||
kurbo = "0.11"
|
||||
|
|
@ -81,8 +90,15 @@ notify = "8"
|
|||
once_cell = "1"
|
||||
open = "5.0.1"
|
||||
openssl = "0.10"
|
||||
oxipng = { version = "9.0", default-features = false, features = ["filetime", "parallel", "zopfli"] }
|
||||
palette = { version = "0.7.3", default-features = false, features = ["approx", "libm"] }
|
||||
oxipng = { version = "9.0", default-features = false, features = [
|
||||
"filetime",
|
||||
"parallel",
|
||||
"zopfli",
|
||||
] }
|
||||
palette = { version = "0.7.3", default-features = false, features = [
|
||||
"approx",
|
||||
"libm",
|
||||
] }
|
||||
parking_lot = "0.12.1"
|
||||
pathdiff = "0.2"
|
||||
pdf-writer = "0.12.1"
|
||||
|
|
@ -97,9 +113,13 @@ 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.43", default-features = false, features = [
|
||||
"raster-images",
|
||||
] }
|
||||
roxmltree = "0.20"
|
||||
rust_decimal = { version = "1.36.0", default-features = false, features = ["maths"] }
|
||||
rust_decimal = { version = "1.36.0", default-features = false, features = [
|
||||
"maths",
|
||||
] }
|
||||
rustybuzz = "0.18"
|
||||
same-file = "1"
|
||||
self-replace = "1.3.7"
|
||||
|
|
@ -110,21 +130,35 @@ serde_yaml = "0.9"
|
|||
shell-escape = "0.1.5"
|
||||
sigpipe = "0.1"
|
||||
siphasher = "1"
|
||||
smallvec = { version = "1.11.1", features = ["union", "const_generics", "const_new"] }
|
||||
smallvec = { version = "1.11.1", features = [
|
||||
"union",
|
||||
"const_generics",
|
||||
"const_new",
|
||||
] }
|
||||
stacker = "0.1.15"
|
||||
subsetter = "0.2"
|
||||
svg2pdf = "0.12"
|
||||
syn = { version = "2", features = ["full", "extra-traits"] }
|
||||
syntect = { version = "5", default-features = false, features = ["parsing", "regex-fancy", "plist-load", "yaml-load"] }
|
||||
syntect = { version = "5", default-features = false, features = [
|
||||
"parsing",
|
||||
"regex-fancy",
|
||||
"plist-load",
|
||||
"yaml-load",
|
||||
] }
|
||||
tar = "0.4"
|
||||
tempfile = "3.7.0"
|
||||
thin-vec = "0.2.13"
|
||||
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"] }
|
||||
toml = { version = "0.8", default-features = false, features = [
|
||||
"parse",
|
||||
"display",
|
||||
] }
|
||||
ttf-parser = "0.24.1"
|
||||
two-face = { version = "0.4.3", default-features = false, features = ["syntect-fancy"] }
|
||||
two-face = { version = "0.4.3", default-features = false, features = [
|
||||
"syntect-fancy",
|
||||
] }
|
||||
typed-arena = "2"
|
||||
unicode-bidi = "0.3.18"
|
||||
unicode-ident = "1.0"
|
||||
|
|
@ -132,7 +166,11 @@ unicode-math-class = "0.1"
|
|||
unicode-script = "0.5"
|
||||
unicode-segmentation = "1"
|
||||
unscanny = "0.1"
|
||||
ureq = { version = "2", default-features = false, features = ["native-tls", "gzip", "json"] }
|
||||
ureq = { version = "2", default-features = false, features = [
|
||||
"native-tls",
|
||||
"gzip",
|
||||
"json",
|
||||
] }
|
||||
usvg = { version = "0.43", default-features = false, features = ["text"] }
|
||||
walkdir = "2"
|
||||
wasmi = "0.40.0"
|
||||
|
|
|
|||
|
|
@ -120,6 +120,32 @@ impl PackageStorage {
|
|||
&self,
|
||||
spec: &VersionlessPackageSpec,
|
||||
) -> StrResult<PackageVersion> {
|
||||
/*if spec.namespace == DEFAULT_NAMESPACE {
|
||||
// For `DEFAULT_NAMESPACE`, download the package index and find the latest
|
||||
// version.
|
||||
self.download_index()?
|
||||
.iter()
|
||||
.filter_map(|value| MinimalPackageInfo::deserialize(value).ok())
|
||||
.filter(|package| package.name == spec.name)
|
||||
.map(|package| package.version)
|
||||
.max()
|
||||
.ok_or_else(|| eco_format!("failed to find package {spec}"))
|
||||
} else {
|
||||
// For other namespaces, search locally. We only search in the data
|
||||
// directory and not the cache directory, because the latter is not
|
||||
// intended for storage of local packages.
|
||||
let subdir = format!("{}/{}", spec.namespace, spec.name);
|
||||
self.package_path
|
||||
.iter()
|
||||
.flat_map(|dir| std::fs::read_dir(dir.join(&subdir)).ok())
|
||||
.flatten()
|
||||
.filter_map(|entry| entry.ok())
|
||||
.map(|entry| entry.path())
|
||||
.filter_map(|path| path.file_name()?.to_string_lossy().parse().ok())
|
||||
.max()
|
||||
.ok_or_else(|| eco_format!("please specify the desired version"))
|
||||
}*/
|
||||
|
||||
self.download_index(spec)?
|
||||
.iter()
|
||||
.filter(|package| package.name == spec.name)
|
||||
|
|
|
|||
|
|
@ -284,7 +284,6 @@ impl<'a> CurveBuilder<'a> {
|
|||
self.last_point = point;
|
||||
self.last_control_from = point;
|
||||
self.is_started = true;
|
||||
self.is_empty = true;
|
||||
}
|
||||
|
||||
/// Add a line segment.
|
||||
|
|
|
|||
|
|
@ -769,7 +769,7 @@ impl Array {
|
|||
///
|
||||
/// ```example
|
||||
/// #let array = (1, 2, 3, 4, 5, 6, 7, 8)
|
||||
/// #array.chunks(3) \
|
||||
/// #array.chunks(3)
|
||||
/// #array.chunks(3, exact: true)
|
||||
/// ```
|
||||
#[func]
|
||||
|
|
|
|||
|
|
@ -34,14 +34,14 @@ use crate::loading::{DataSource, Load, Readable};
|
|||
/// let author = find-child(elem, "author")
|
||||
/// let pars = find-child(elem, "content")
|
||||
///
|
||||
/// [= #title.children.first()]
|
||||
/// heading(title.children.first())
|
||||
/// text(10pt, weight: "medium")[
|
||||
/// Published by
|
||||
/// #author.children.first()
|
||||
/// ]
|
||||
///
|
||||
/// for p in pars.children {
|
||||
/// if type(p) == dictionary {
|
||||
/// if (type(p) == "dictionary") {
|
||||
/// parbreak()
|
||||
/// p.children.first()
|
||||
/// }
|
||||
|
|
@ -50,7 +50,7 @@ use crate::loading::{DataSource, Load, Readable};
|
|||
///
|
||||
/// #let data = xml("example.xml")
|
||||
/// #for elem in data.first().children {
|
||||
/// if type(elem) == dictionary {
|
||||
/// if (type(elem) == "dictionary") {
|
||||
/// article(elem)
|
||||
/// }
|
||||
/// }
|
||||
|
|
|
|||
|
|
@ -326,10 +326,7 @@ 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 mut text = TextElem::packed(elem.text).spanned(elem.span());
|
||||
if let Some(label) = elem.label() {
|
||||
text.set_label(label);
|
||||
}
|
||||
let text = TextElem::packed(elem.text).spanned(elem.span());
|
||||
visit(s, s.store(text), styles)?;
|
||||
return Ok(true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -294,20 +294,20 @@ feature flag.
|
|||
`errorbar.diamond.stroked`, `errorbar.diamond.filled`,
|
||||
`errorbar.circle.stroked`, `errorbar.circle.filled`
|
||||
- `numero`
|
||||
- Renamed **(Breaking change)**
|
||||
- `Omega.inv`
|
||||
- Renamed
|
||||
- `ohm.inv` to `Omega.inv`
|
||||
- Changed codepoint **(Breaking change)**
|
||||
- Changed codepoint
|
||||
- `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 **(Breaking change)**
|
||||
- Removed
|
||||
- `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
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
---
|
||||
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" />
|
||||
|
|
@ -10,7 +10,6 @@ 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)
|
||||
|
|
|
|||
|
|
@ -447,7 +447,7 @@ document.
|
|||
To let a function style your whole document, the show rule processes everything
|
||||
that comes after it and calls the function specified after the colon with the
|
||||
result as an argument. The `.with` part is a _method_ that takes the `conf`
|
||||
function and pre-configures some of its arguments before passing it on to the
|
||||
function and pre-configures some if its arguments before passing it on to the
|
||||
show rule.
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ requirements with examples.
|
|||
Typst's default page size is A4 paper. Depending on your region and your use
|
||||
case, you will want to change this. You can do this by using the
|
||||
[`{page}`]($page) set rule and passing it a string argument to use a common page
|
||||
size. Options include the complete ISO 216 series (e.g. `"a4"` and `"iso-c2"`),
|
||||
size. Options include the complete ISO 216 series (e.g. `"iso-a4"`, `"iso-c2"`),
|
||||
customary US formats like `"us-legal"` or `"us-letter"`, and more. Check out the
|
||||
reference for the [page's paper argument]($page.paper) to learn about all
|
||||
available options.
|
||||
|
|
|
|||
|
|
@ -188,7 +188,6 @@ 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")),
|
||||
|
|
|
|||
|
|
@ -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 change the font, could be to look
|
||||
might have when you want, for example, to justify the report, could be to look
|
||||
for a function that does that and wrap the complete document in it.
|
||||
|
||||
```example
|
||||
#text(font: "New Computer Modern")[
|
||||
#par(justify: true)[
|
||||
= 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. 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.
|
||||
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.
|
||||
|
||||
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,9 +47,7 @@ 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 text(
|
||||
font: "New Computer Modern"
|
||||
)
|
||||
#set par(justify: true)
|
||||
|
||||
= Background
|
||||
In the case of glaciers, fluid
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 85 B |
Binary file not shown.
|
Before Width: | Height: | Size: 243 B |
|
|
@ -151,7 +151,3 @@
|
|||
--- 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, "😀")
|
||||
|
|
|
|||
|
|
@ -38,16 +38,6 @@
|
|||
curve.close(mode: "smooth"),
|
||||
)
|
||||
|
||||
--- curve-multiple-non-closed ---
|
||||
#curve(
|
||||
stroke: 2pt,
|
||||
curve.line((20pt, 0pt)),
|
||||
curve.move((0pt, 10pt)),
|
||||
curve.line((20pt, 10pt)),
|
||||
curve.move((0pt, 20pt)),
|
||||
curve.line((20pt, 20pt)),
|
||||
)
|
||||
|
||||
--- curve-line ---
|
||||
#curve(
|
||||
fill: purple,
|
||||
|
|
|
|||
Loading…
Reference in New Issue