# Third-party notices

Typlet is licensed under the MIT License (see `LICENSE`). This repository and the published package include, or are derived from, the third-party works below. docs/DESIGN.md §8 explains how Typlet meets their conditions.

## Typst

- Source: https://github.com/typst/typst, version 0.15.1 (commit `9dfd3a08500b7896045f907433cf7b4b02434fad`)
- Copyright: The Typst Project Developers
- License: Apache License 2.0, in `LICENSES/Apache-2.0.txt`
- Used in Typlet:
  - **Ported source code.** Files under `src/` whose header says "Ported from Typst" are TypeScript translations of Typst's Rust source, modified for Typlet. Each header names its upstream file, and `docs/UPSTREAM.md` lists all of them.
  - **Styles.** `fonts/typlet.css` carries Typst's styles for MathML, from `crates/typst-html/src/mathml.rs`, through their port in `src/mathml/mathml.ts`.
  - **Generated data.** `src/generated/names.ts` lists the names in Typst's global scope, generated by running Typst (see `oracle/`).
  - **Test fixtures.** `test/fixtures/` holds output generated by running Typst (see `oracle/`).
  - **Test corpus.** `test/corpus/typst-docs.jsonl` holds the math examples from the documentation comments in Typst's `typst-library/src/math` source.
- Typst's own NOTICE file lists third-party components. These apply to code Typlet ports:
  - Typst's default color set, adapted from colors.css (https://clrs.cc/), MIT License. It defines Typlet's named colors.
  - Typst's `SyntaxSet`, based on rust-analyzer's `TokenSet` (https://github.com/rust-lang/rust-analyzer), MIT or Apache-2.0. It is the basis of the syntax sets in Typlet's parser.

## codex

- Source: https://github.com/typst/codex, version 0.3.0
- Copyright: The Typst Project Developers
- License: Apache License 2.0, in `LICENSES/Apache-2.0.txt`
- Used in Typlet:
  - **Generated data.** The symbol tables in `src/generated/symbols.ts`.
  - **Ported source code.** The alphanumeric styling in `src/utils/styling.ts`, the symbol modifier matching in `src/eval/symbol.ts` and the numeral systems of numbering patterns in `src/eval/numeral.ts`, whose headers say "Ported from codex".

## typst-assets and W3C MathML Core

- Source: https://github.com/typst/typst-assets, version 0.15.1, `files/mathml/data.rs`
- License of the crate's code: Apache License 2.0, in `LICENSES/Apache-2.0.txt`
- License of the MathML data in it, which the crate derives from MathML Core (https://www.w3.org/TR/mathml-core/), © 2025 World Wide Web Consortium: the W3C Software and Document License (2023), with the notice, in `LICENSES/W3C-2023.txt`
- Used in Typlet: the MathML operator dictionary and inline-axis data, in `src/generated/mathml.ts`, which `tools/codegen/mathml.mjs` generates from the crate's tables as TypeScript tables with a compact range encoding. The data is unchanged.

## syntect

- Source: https://github.com/trishume/syntect, version 5.3.0
- License: MIT License, below
- Used in Typlet: Typst colors raw code with syntect's themes. To color code the same way, `src/mathml/raw.ts` adapts syntect's matching of theme scope selectors (`ScopeSelector::does_match`) and its choice of a style for a scope stack.

```text
MIT License

Copyright (c) 2017 Tristan Hume, Keith Hall, Google Inc and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

## unicode-math-class

- Source: https://github.com/typst/unicode-math-class
- License: MIT or Apache-2.0, used under the MIT License
- Used in Typlet: the table of Unicode math classes, under `src/generated/`.

## New Computer Modern

- Author: Antonis Tsolomitis
- Source: New Computer Modern Math Book, version 4.0, and Bold, version 5.3.0, as bundled with Typst 0.15.1 in typst-assets
- License: GUST Font License, version 1.0 (based on the LaTeX Project Public License 1.3c), in `fonts/GUST-FONT-LICENSE.txt`
- Used in Typlet:
  - **Derived fonts.** The fonts under `fonts/` are subset, split and converted from New Computer Modern Math Book and Bold. As the license requests, they are renamed "Typlet NewCM Math", and `fonts/MANIFEST-typlet-newcm-math.txt` lists the files and the changes.
  - **Metrics.** `src/generated/metrics.ts` and `src/generated/metrics-extended.ts` hold glyph metrics and MATH table data read from New Computer Modern Math Book, and `src/generated/metrics-bold.ts` the metrics of its Bold font's Latin characters.

## KaTeX (development only)

- Source: https://github.com/KaTeX/KaTeX, MIT License
- Used in Typlet: a development dependency of the benchmarks in `bench/` and of the documentation site's comparison page. It is not part of the published package. The site's build (`tools/site/build.mjs`) copies KaTeX's script, stylesheet and fonts from its npm package into `site/katex/`, unmodified and with its license, so that the page can render the same formulas with both. The LaTeX formulas in `test/corpus/paired.jsonl` are Typlet's own, written for KaTeX.
- The integrations follow the APIs of KaTeX's auto-render and copy-tex modules and of rehype-katex (https://github.com/remarkjs/remark-math, MIT License), so pages can switch from KaTeX easily: `contrib/auto-render.ts`, `contrib/copy-typst.ts` and `packages/rehype-typlet/`. They are written for Typlet and share no code with them.
