├── .gitignore ├── .github └── workflows │ ├── cleanup.yml │ ├── watch.yml │ ├── release.yml │ └── tag.yml ├── README.md ├── cliff.toml ├── CHANGELOG.md ├── LICENSE └── undergradmath.typ /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | undergradmath.pdf 3 | -------------------------------------------------------------------------------- /.github/workflows/cleanup.yml: -------------------------------------------------------------------------------- 1 | name: Clean up 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | version: 6 | description: "SemVer" 7 | required: true 8 | type: string 9 | jobs: 10 | clean-up: 11 | runs-on: macos-latest 12 | steps: 13 | - name: Delete the given tag and release 14 | uses: dev-drprasad/delete-tag-and-release@v1.0 15 | with: 16 | tag_name: "v${{ inputs.version }}" 17 | github_token: ${{ secrets.PAT }} 18 | -------------------------------------------------------------------------------- /.github/workflows/watch.yml: -------------------------------------------------------------------------------- 1 | name: Watch 2 | on: 3 | push: 4 | branches-ignore: 5 | - main 6 | pull_request: 7 | jobs: 8 | check-changed: 9 | runs-on: macos-latest 10 | outputs: 11 | modified: ${{ contains(steps.changed-files.outputs.modified_files, 'undergradmath.typ') }} 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v4 15 | - name: Check changed files 16 | id: changed-files 17 | uses: tj-actions/changed-files@v46 18 | - name: List all modified files 19 | run: | 20 | echo "List all the files that have been modified: ${{ steps.changed-files.outputs.modified_files }}" 21 | build-pdf: 22 | runs-on: macos-latest 23 | needs: check-changed 24 | if: needs.check-changed.outputs.modified == 'true' 25 | steps: 26 | - name: Checkout 27 | uses: actions/checkout@v4 28 | - name: Update Homebrew 29 | run: brew update 30 | - name: Install Typst 31 | run: brew install typst 32 | - name: Install fonts 33 | run: brew install --cask font-twitter-color-emoji 34 | - name: Build PDF 35 | run: typst compile undergradmath.typ 36 | - name: Upload PDF as artifact 37 | uses: actions/upload-artifact@v4 38 | with: 39 | name: Undergradmath 40 | path: undergradmath.pdf 41 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | on: 3 | push: 4 | tags: 5 | - 'v*.*.*' 6 | jobs: 7 | release: 8 | runs-on: macos-latest 9 | permissions: 10 | contents: write 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v4 14 | with: 15 | fetch-depth: 0 16 | fetch-tags: true 17 | - name: Update Homebrew 18 | run: brew update 19 | - name: Install Typst 20 | run: brew install typst 21 | - name: Install fonts 22 | run: brew install --cask font-twitter-color-emoji 23 | - name: Build PDF 24 | run: typst compile undergradmath.typ 25 | - name: Upload PDF as artifact 26 | uses: actions/upload-artifact@v4 27 | with: 28 | name: Undergradmath 29 | path: undergradmath.pdf 30 | - name: Install git-cliff 31 | run: brew install git-cliff 32 | - name: Generate changelog 33 | id: generate-changelog 34 | run: | 35 | echo "changelog<> $GITHUB_OUTPUT 36 | git cliff -vv -s all -l >> $GITHUB_OUTPUT 37 | echo "EOF" >> $GITHUB_OUTPUT 38 | git cliff -vv -s all -l 39 | - name: Print changelog 40 | run: | 41 | echo "${{ steps.generate-changelog.outputs.changelog }}" 42 | - name: Release 43 | uses: softprops/action-gh-release@v1 44 | with: 45 | body: ${{ steps.generate-changelog.outputs.changelog }} 46 | name: ${{ github.ref_name }} 47 | files: undergradmath.pdf 48 | -------------------------------------------------------------------------------- /.github/workflows/tag.yml: -------------------------------------------------------------------------------- 1 | name: Tag 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | version: 6 | description: "SemVer, use automatically generated version if omitted" 7 | type: string 8 | jobs: 9 | check-version: 10 | runs-on: macos-latest 11 | outputs: 12 | modified: ${{ contains(steps.changed-files.outputs.modified_files, 'undergradmath.typ') }} 13 | version: ${{ steps.output-version.outputs.version }} 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v4 17 | with: 18 | fetch-depth: 0 19 | fetch-tags: true 20 | - name: Get previous tag 21 | id: check-tag 22 | uses: mathieudutour/github-tag-action@v6.2 23 | with: 24 | dry_run: true 25 | github_token: ${{ secrets.PAT }} 26 | - name: Get base 27 | id: get-base 28 | run: | 29 | echo -n "base=" >> $GITHUB_OUTPUT 30 | git rev-list -n 1 "tags/${{ steps.check-tag.outputs.previous_tag }}" >> $GITHUB_OUTPUT 31 | - name: Check changed files 32 | id: changed-files 33 | uses: tj-actions/changed-files@v46 34 | with: 35 | base_sha: ${{ steps.get-base.outputs.base }} 36 | - name: Output the version 37 | id: output-version 38 | run: | 39 | if [[ -n "${{ inputs.version }}" ]]; then 40 | echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT 41 | else 42 | echo "version=${{ steps.check-tag.outputs.new_version }}" >> $GITHUB_OUTPUT 43 | fi 44 | - name: List all modified files 45 | run: | 46 | echo "List all the files that have been modified: ${{ steps.changed-files.outputs.modified_files }}" 47 | tag-changelog: 48 | runs-on: macos-latest 49 | needs: check-version 50 | if: needs.check-version.outputs.modified == 'true' 51 | permissions: 52 | contents: write 53 | steps: 54 | - name: Checkout 55 | uses: actions/checkout@v4 56 | with: 57 | fetch-depth: 0 58 | fetch-tags: true 59 | token: ${{ secrets.PAT }} 60 | - name: Update Homebrew 61 | run: brew update 62 | - name: Install git-cliff 63 | run: brew install git-cliff 64 | - name: Generate changelog 65 | id: generate-changelog 66 | run: | 67 | git cliff -vv -t ${{ needs.check-version.outputs.version }} -o CHANGELOG.md 68 | - name: Add changelog and commit 69 | id: add-changelog 70 | uses: EndBug/add-and-commit@v9 71 | with: 72 | add: 'CHANGELOG.md' 73 | author_name: github-actions[bot] 74 | author_email: 41898282+github-actions[bot]@users.noreply.github.com 75 | message: "release: update changelog for ${{ needs.check-version.outputs.version }} release" 76 | - name: Add tag 77 | uses: mathieudutour/github-tag-action@v6.2 78 | if: steps.add-changelog.outputs.committed == 'true' 79 | with: 80 | commit_sha: ${{ steps.add-changelog.outputs.commit_long_sha }} 81 | custom_tag: ${{ needs.check-version.outputs.version }} 82 | github_token: ${{ secrets.PAT }} 83 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # typst-undergradmath 2 | 3 | [![CC BY-SA 4.0](https://badgers.space/github/license/johanvx/typst-undergradmath)][cc-by-sa] 4 | [![Latest release](https://badgers.space/github/release/johanvx/typst-undergradmath)][latest-release] 5 | ![Checks status](https://badgers.space/github/checks/johanvx/typst-undergradmath) 6 | 7 | A [Typst] port of [undergradmath]. 8 | 9 | ## Limitations 10 | 11 | The following limitations are also annotated in the [document][latest-release]. 12 | 13 | - [x] ~Script letters, such as $\mathscr{P}$ form `\mathscr{P}`, are unavailable.~ 14 | It's possible to get script letters like $\mathscr{P}$ from `cal(P)` by changing the [`stylistic-set` of the `text()` function]. 15 | The stylistic set to apply is font-specific, so it's necessary to consult the font to know which set is desired. 16 | - [x] ~Greek letter $\varsigma$ `\u{03C2}` from `\varsigma` is not defined as a symbol and should probably be defined as `sigma.alt`.~ 17 | `sigma.alt` is available as from `typst v0.5.0`. 18 | - [x] $\emptyset$ from `\emptyset` is available in Typst as `nothing`, while $\varnothing$ from `\varnothing` is not. 19 | May need a `let` binding with some specific fonts. 20 | See the Version 3.93 section of README at https://www.ctan.org/tex-archive/fonts/newcomputermodern. 21 | See also [#10] and [#16] for details. 22 | - [x] ~$\imath$ `\u{1D6A4}` and $\jmath$ `\u{1D6A5}`, from `\imath` and `\jmath` respectively, are not defined as symbols. 23 | They are used in like vectors $\vec{\imath}$ with `\vec{\imath}`.~ 24 | $\imath$ and $\jmath$ are `dotless.i` and `dotless.j` respectively as from `typst v0.4.0`. 25 | - [x] ~$\widehat{x + y}$ from `\widehat{x + y}` is unavailable.~ It's automatic if you write `$hat(x+y)$`, as mentioned in [#2]. 26 | - [x] ~No idea with $\doteq$ from `\doteq`. 27 | Maybe use fonts from [mathabx] or do some spacing adjustment with `dot` and `eq`.~ 28 | It can be obtained with `\u{2250}`, which is a bit tricky. 29 | - [x] ~LaTeX arrays (i.e., matrices without fences) are unavailable, but it's easy to get them with the `grid` function. 30 | For math mode, it would be nice to add a new option `""` for `delim` of the `mat` function.~ 31 | It's actually available with `$mat(delim: #none, ..)$`. 32 | - [x] ~No idea with spacing between values and units. It would be really great to have something like [siunitx].~ 33 | The space between values and units can be `thin` (`\u{2009}`), as mentioned in [#17]. 34 | There are also some amazing Typst ports of siunitx, such as [metro] and [unify]. 35 | 36 | ## License 37 | 38 | [Like undergradmath], typst-undergradmath is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International License][cc-by-sa]. 39 | 40 | ## Contributing to typst-undergradmath 41 | 42 | If you're interested in contributing to this project, feel free to comment on 43 | existing issues, open new issues and create pull requests. 44 | 45 | If you create a pull request, make sure to observe the following rules: 46 | 47 | 1. adopt [Conventional Commits], and 48 | 2. keep the document two-page. 49 | 50 | 51 | 52 | [#2]: https://github.com/johanvx/typst-undergradmath/issues/2 53 | [#10]: https://github.com/johanvx/typst-undergradmath/issues/10 54 | [#16]: https://github.com/johanvx/typst-undergradmath/pull/16 55 | [#17]: https://github.com/johanvx/typst-undergradmath/issues/17 56 | [`stylistic-set` of the `text()` function]: https://typst.app/docs/reference/text/text/#parameters-stylistic-set 57 | [Conventional Commits]: https://www.conventionalcommits.org/en/v1.0.0/ 58 | [Like undergradmath]: https://gitlab.com/jim.hefferon/undergradmath/-/blob/5b19eff74454f7c71664f85e8042d7b30fcf9cfb/LICENSE 59 | [Typst]: https://github.com/typst/typst 60 | [cc-by-sa]: http://creativecommons.org/licenses/by-sa/4.0/ 61 | [latest-release]: https://github.com/johanvx/typst-undergradmath/releases/latest 62 | [mathabx]: https://www.ctan.org/tex-archive/fonts/mathabx 63 | [metro]: https://github.com/fenjalien/metro 64 | [siunitx]: https://www.ctan.org/pkg/siunitx 65 | [undergradmath]: https://gitlab.com/jim.hefferon/undergradmath 66 | [unify]: https://github.com/ChHecker/unify 67 | -------------------------------------------------------------------------------- /cliff.toml: -------------------------------------------------------------------------------- 1 | # git-cliff ~ default configuration file 2 | # https://git-cliff.org/docs/configuration 3 | # 4 | # Lines starting with "#" are comments. 5 | # Configuration options are organized into tables and keys. 6 | # See documentation for more information on available options. 7 | 8 | [changelog] 9 | # changelog header 10 | header = """ 11 | # Changelog\n 12 | All notable changes to this project will be documented in this file.\n 13 | """ 14 | # template for the changelog body 15 | # https://keats.github.io/tera/docs/#introduction 16 | body = """ 17 | {% if version %}\ 18 | {% if previous.version %}\ 19 | ## [{{ version | trim_start_matches(pat="v") }}](/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} 20 | {% else %}\ 21 | ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} 22 | {% endif %}\ 23 | {% else %}\ 24 | ## [unreleased] 25 | {% endif %}\ 26 | 27 | {% macro commit(commit) -%} 28 | - {% if commit.scope %}*({{ commit.scope }})* {% endif %}{% if commit.breaking %}[**breaking**] {% endif %}\ 29 | {{ commit.message | upper_first }} - ([{{ commit.id | truncate(length=7, end="") }}](/commit/{{ commit.id }}))\ 30 | {% endmacro -%} 31 | 32 | {% for group, commits in commits | group_by(attribute="group") %} 33 | ### {{ group | striptags | trim | upper_first }} 34 | {% for commit in commits 35 | | filter(attribute="scope") 36 | | sort(attribute="scope") %} 37 | {{ self::commit(commit=commit) }} 38 | {%- endfor -%} 39 | {% raw %}\n{% endraw %}\ 40 | {%- for commit in commits %} 41 | {%- if not commit.scope -%} 42 | {{ self::commit(commit=commit) }} 43 | {% endif -%} 44 | {% endfor -%} 45 | {% endfor %}\n 46 | """ 47 | # remove the leading and trailing whitespace from the template 48 | trim = true 49 | # changelog footer 50 | footer = """ 51 | 52 | """ 53 | # postprocessors 54 | postprocessors = [ 55 | { pattern = '', replace = "https://github.com/johanvx/typst-undergradmath" }, # replace repository URL 56 | ] 57 | [git] 58 | # parse the commits based on https://www.conventionalcommits.org 59 | conventional_commits = true 60 | # filter out the commits that are not conventional 61 | filter_unconventional = true 62 | # process each line of a commit as an individual commit 63 | split_commits = false 64 | # regex for preprocessing the commit messages 65 | commit_preprocessors = [ 66 | # { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](/issues/${2}))"}, # replace issue numbers 67 | ] 68 | # regex for parsing and grouping commits 69 | commit_parsers = [ 70 | { message = "^feat", group = "Features" }, 71 | { message = "^fix", group = "Bug Fixes" }, 72 | { message = "^doc", group = "Documentation" }, 73 | { message = "^perf", group = "Performance" }, 74 | { message = "^refactor", group = "Refactor" }, 75 | { message = "^style", group = "Styling" }, 76 | { message = "^test", group = "Testing" }, 77 | { message = "^chore\\(release\\): prepare for", skip = true }, 78 | { message = "^chore\\(deps\\)", skip = true }, 79 | { message = "^chore\\(pr\\)", skip = true }, 80 | { message = "^chore\\(pull\\)", skip = true }, 81 | { message = "^chore|ci", group = "Miscellaneous" }, 82 | { body = ".*security", group = "Security" }, 83 | { message = "^revert", group = "Revert" }, 84 | { message = "^release", skip = true }, 85 | ] 86 | # protect breaking changes from being skipped due to matching a skipping commit_parser 87 | protect_breaking_commits = false 88 | # filter out the commits that are not matched by commit parsers 89 | filter_commits = false 90 | # regex for matching git tags 91 | tag_pattern = "v[0-9].*" 92 | 93 | # regex for skipping tags 94 | skip_tags = "v0.1.0-beta.1" 95 | # regex for ignoring tags 96 | ignore_tags = "rc" 97 | # sort the tags topologically 98 | topo_order = false 99 | # sort the commits inside sections by oldest/newest order 100 | sort_commits = "newest" 101 | # limit the number of commits included in the changelog. 102 | # limit_commits = 42 103 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | ## [1.5.1](https://github.com/johanvx/typst-undergradmath/compare/v1.5.0..1.5.1) - 2025-04-13 6 | 7 | ### Bug Fixes 8 | 9 | - Update the link to the Typst array - ([842fb87](https://github.com/johanvx/typst-undergradmath/commit/842fb872171bd0fc818a616b920675e31ed033fd)) 10 | 11 | ## [1.5.0](https://github.com/johanvx/typst-undergradmath/compare/v1.4.0..v1.5.0) - 2025-04-13 12 | 13 | ### Bug Fixes 14 | 15 | - Use a semantically correct code for the unit example - ([50b81e8](https://github.com/johanvx/typst-undergradmath/commit/50b81e839332bf3ead76acf239fcc43c5f75124a)) 16 | - Replace the deprecated `sect` with `inter` - ([755eaed](https://github.com/johanvx/typst-undergradmath/commit/755eaedb3ef0e1af5e581248ef5955e83baf176c)) 17 | - Replace the removed `style` with a `context` expression - ([04578d4](https://github.com/johanvx/typst-undergradmath/commit/04578d4c361c3ccf0807653966515b4547b6f200)) 18 | 19 | ### Features 20 | 21 | - Use newly introduced `asymp` symbol - ([2401863](https://github.com/johanvx/typst-undergradmath/commit/24018638b28783b114ac5bf202313ea732292cf0)) 22 | 23 | ### Miscellaneous 24 | 25 | - Remove homebrew/cask-fonts tap - ([d40067e](https://github.com/johanvx/typst-undergradmath/commit/d40067ec1c478bbbd314e7d67af7f935c88b5cfb)) 26 | - Update mathieudutour/github-tag-action from v6.1 to v6.2 - ([9d51d58](https://github.com/johanvx/typst-undergradmath/commit/9d51d5887424a58d1d9841d003fa60777568a014)) 27 | - Update actions/upload-artifact from deprecated v3 to v4 - ([708f0e2](https://github.com/johanvx/typst-undergradmath/commit/708f0e2cbeb783351ed550801a5c01e7f7f57019)) 28 | 29 | ### Styling 30 | 31 | - Format code with typstyle - ([6ddf040](https://github.com/johanvx/typst-undergradmath/commit/6ddf040a40d6b823257b7ee54b323b7d65937bd6)) 32 | 33 | ## [1.4.0](https://github.com/johanvx/typst-undergradmath/compare/v1.3.0..v1.4.0) - 2024-05-19 34 | 35 | ### Features 36 | 37 | - Use `thin` for the space between values and units (#43) - ([ca9cc03](https://github.com/johanvx/typst-undergradmath/commit/ca9cc039dd1cc284ff841498d430526134bfb7e9)) 38 | - Update spacing description (#42) - ([74a826a](https://github.com/johanvx/typst-undergradmath/commit/74a826a4d0e4655fc60591115b19d065fc88dfd9)) 39 | 40 | ## [1.3.0](https://github.com/johanvx/typst-undergradmath/compare/v1.2.0..v1.3.0) - 2024-05-14 41 | 42 | ### Bug Fixes 43 | 44 | - Stop underlining the title - ([2272ede](https://github.com/johanvx/typst-undergradmath/commit/2272edeec374255cbd8b80377895573d248e68a7)) 45 | 46 | ### Documentation 47 | 48 | - Add instructions for obtaining script letters - ([e98a15a](https://github.com/johanvx/typst-undergradmath/commit/e98a15a1dc9537905b0aa04a571cd5b0de2fecc2)) 49 | 50 | ### Features 51 | 52 | - Provide a simpler approach to get `\varnothing` in LaTeX - ([605b7b9](https://github.com/johanvx/typst-undergradmath/commit/605b7b94f8fcf5ff753df3e840da456a11c93b4a)) 53 | - Add script letters - ([2334574](https://github.com/johanvx/typst-undergradmath/commit/2334574f5e51cb531ef660e71975b831d49dd01f)) 54 | 55 | ### Miscellaneous 56 | 57 | - Remove `@unavailable` figure - ([d314d33](https://github.com/johanvx/typst-undergradmath/commit/d314d33c9145859de72e43037673560fbaabc909)) 58 | 59 | ### Refactor 60 | 61 | - Make the footer an acutal footer - ([d3b5eb7](https://github.com/johanvx/typst-undergradmath/commit/d3b5eb7ba515af7e7b107050b1a841fdbde5242f)) 62 | 63 | ## [1.2.0](https://github.com/johanvx/typst-undergradmath/compare/v1.1.0..v1.2.0) - 2023-12-08 64 | 65 | ### Documentation 66 | 67 | - *(README)* Mention some packages dedicated to typesetting unit - ([b1b62a7](https://github.com/johanvx/typst-undergradmath/commit/b1b62a706d94957671f52c3862050f1a363889fd)) 68 | - Add the contributing guide section - ([4b59481](https://github.com/johanvx/typst-undergradmath/commit/4b5948171bd7e6e791291cec6f0b60b6d08e08a1)) 69 | 70 | ### Features 71 | 72 | - Mention the compiler version in the introduction - ([6ee483d](https://github.com/johanvx/typst-undergradmath/commit/6ee483d010377e0e4e9dcd1fd886e15a6b0d42fa)) 73 | - Use newly introduced `sys.version` - ([9c532b4](https://github.com/johanvx/typst-undergradmath/commit/9c532b49252297e0b6dc721f2fe59680b8c75ffe)) 74 | - Use newly introduced `wide` - ([54d8723](https://github.com/johanvx/typst-undergradmath/commit/54d87237fec250a942f6fd849403d763298d8f1a)) 75 | 76 | ### Miscellaneous 77 | 78 | - Checkout with secrets.PAT - ([e2837c8](https://github.com/johanvx/typst-undergradmath/commit/e2837c8f5a45e130f1309dc16b5cc30280637517)) 79 | - Set author to github-actions[bot] - ([08301b2](https://github.com/johanvx/typst-undergradmath/commit/08301b27e53aa968e9deb0db6d5a4c3614fa674a)) 80 | - Set author and email explicitly - ([cbcbdb4](https://github.com/johanvx/typst-undergradmath/commit/cbcbdb40abf5582672c264dbd40dab7ef980f73b)) 81 | - Try to pass the protection rule - ([8f1a6f3](https://github.com/johanvx/typst-undergradmath/commit/8f1a6f39fd15014ebfef1eb7276d6eca654ccfe8)) 82 | - Fix the repository URL in cliff.toml - ([4eea288](https://github.com/johanvx/typst-undergradmath/commit/4eea288d139f8f60a4f9b4df28ef15424d49393b)) 83 | - Add cliff.toml - ([49352ce](https://github.com/johanvx/typst-undergradmath/commit/49352cec0ac2fc472bcb36168cbc5ba67838e79a)) 84 | - Support deleting tags and associated releases - ([0604a5a](https://github.com/johanvx/typst-undergradmath/commit/0604a5a39043d736ab1d9a9446cb6b498c8ea676)) 85 | - Support changelog and manual tagging - ([3726d22](https://github.com/johanvx/typst-undergradmath/commit/3726d2250082c75540ac9aaccbdb3157d7a81ae5)) 86 | - Remove unused environment variables - ([c024293](https://github.com/johanvx/typst-undergradmath/commit/c024293251fca478588f038582d253aec162c4d3)) 87 | 88 | ## [1.1.0](https://github.com/johanvx/typst-undergradmath/compare/v1.0.0..v1.1.0) - 2023-09-16 89 | 90 | ### Features 91 | 92 | - Add custom maths operator section - ([992d543](https://github.com/johanvx/typst-undergradmath/commit/992d5437cc0626d81ec77f7bbc50b1cdfd85198b)) 93 | 94 | ## [1.0.0](https://github.com/johanvx/typst-undergradmath/compare/v0.1.1..v1.0.0) - 2023-08-08 95 | 96 | ### Features 97 | 98 | - [**breaking**] Use renamed symbols - ([47a06f4](https://github.com/johanvx/typst-undergradmath/commit/47a06f41fcfaa3a8d822b2f8f231504cc4347637)) 99 | 100 | ## [0.1.1](https://github.com/johanvx/typst-undergradmath/compare/v0.1.0..v0.1.1) - 2023-07-20 101 | 102 | ### Bug Fixes 103 | 104 | - Correct a typo in the link to the doc of `array` - ([57e3564](https://github.com/johanvx/typst-undergradmath/commit/57e3564c7799a031933e5031c3e2b7271091bbd8)) 105 | 106 | ## [0.1.0](https://github.com/johanvx/typst-undergradmath/compare/v0.0.2..v0.1.0) - 2023-06-15 107 | 108 | ### Bug Fixes 109 | 110 | - Add missing raw text `kappa` - ([3dc79c1](https://github.com/johanvx/typst-undergradmath/commit/3dc79c15d6184ed46651c40cd9ff23f8270f7ca6)) 111 | 112 | ### Features 113 | 114 | - Adjust the alignment and gutters of math-code listings - ([7832fd3](https://github.com/johanvx/typst-undergradmath/commit/7832fd3a35d2d4f88a974eb441235ba71d3aa62e)) 115 | - Use a shorter name for Ring Operator `\u{2218}` - ([7ae19a0](https://github.com/johanvx/typst-undergradmath/commit/7ae19a056469ffaf16e362390daa69dd08167e3b)) 116 | - Remove the noidea annotation - ([a04b098](https://github.com/johanvx/typst-undergradmath/commit/a04b098aebda950b52ee77ce58609fa25790ab5a)) 117 | - Use dotless i and j - ([399419e](https://github.com/johanvx/typst-undergradmath/commit/399419ecd5dfc6c1cc42a915be20cc4905421ce8)) 118 | - Use `datetime` - ([e4768ea](https://github.com/johanvx/typst-undergradmath/commit/e4768ea3db27403755c397fe0f693f9a284213c5)) 119 | - Use `sigma.alt` - ([44c80e2](https://github.com/johanvx/typst-undergradmath/commit/44c80e2151dfb3c3911c5c6af21bb6e135833c53)) 120 | 121 | ### Miscellaneous 122 | 123 | - Add gitignore file - ([1540948](https://github.com/johanvx/typst-undergradmath/commit/1540948f26240f5ad649f5d2eac2e7b362ec321d)) 124 | 125 | ## [0.0.2](https://github.com/johanvx/typst-undergradmath/compare/v0.0.1..v0.0.2) - 2023-05-21 126 | 127 | ### Documentation 128 | 129 | - *(README)* Add new badges and clean up a bit - ([4224021](https://github.com/johanvx/typst-undergradmath/commit/42240217292c4025fcda3043ed8de4b3d622324b)) 130 | - *(README)* Update the link to the lastest release - ([2f6816e](https://github.com/johanvx/typst-undergradmath/commit/2f6816e3a3caf875234ad1ed8786114fbf5f6b1e)) 131 | 132 | ### Miscellaneous 133 | 134 | - Update date - ([f4e7768](https://github.com/johanvx/typst-undergradmath/commit/f4e77683777f4f25e07fbbfa84b7c97ca1aa6959)) 135 | 136 | ### Refactor 137 | 138 | - Remove unnecessary capitalization - ([c5b0afa](https://github.com/johanvx/typst-undergradmath/commit/c5b0afa0117c879d7c90d915ebfe863f88c2b822)) 139 | - Simplify some symbols - ([bf58fae](https://github.com/johanvx/typst-undergradmath/commit/bf58faeb1c6e167b3c0f5f64506d828923820a12)) 140 | 141 | ## [0.0.1] - 2023-04-18 142 | 143 | ### Bug Fixes 144 | 145 | - Add a hashtag for the h function example - ([0341034](https://github.com/johanvx/typst-undergradmath/commit/03410342f4a33efd51791deb095113100a5a71fc)) 146 | 147 | ### Documentation 148 | 149 | - *(README)* Update comments on `\varnothing` - ([7c68c65](https://github.com/johanvx/typst-undergradmath/commit/7c68c65cf685c43c44be6851c1d95c6520a5be52)) 150 | - *(README)* Update comments on doteq - ([65faf7c](https://github.com/johanvx/typst-undergradmath/commit/65faf7ceaa479ce0f1981008a7f51284eafdd58b)) 151 | - *(README)* Add a comment on arrays - ([537b126](https://github.com/johanvx/typst-undergradmath/commit/537b1264c1f526617ce39818cde154a19a98697a)) 152 | - Add a link to Typst - ([5c148c4](https://github.com/johanvx/typst-undergradmath/commit/5c148c4234ec640b6215d68a6e0f177e3e931bec)) 153 | - Add limitations section - ([b026d4b](https://github.com/johanvx/typst-undergradmath/commit/b026d4be113373a091321e0beb7cc63ea034f17c)) 154 | - Add README - ([3416ef3](https://github.com/johanvx/typst-undergradmath/commit/3416ef33d226bab3a1b02b642244aef08d21d1e4)) 155 | 156 | ### Features 157 | 158 | - *(arrays, matrices)* [**breaking**] Add array example - ([ef7c246](https://github.com/johanvx/typst-undergradmath/commit/ef7c246bcba1c16c730b14e3d99f4c94ca7afc3d)) 159 | - Update comment to `\varnothing` - ([ee80553](https://github.com/johanvx/typst-undergradmath/commit/ee8055306eebeb072f32a6ca3129277e17dd8798)) 160 | - Update code example for `\varnothing` - ([878ea8d](https://github.com/johanvx/typst-undergradmath/commit/878ea8dd2c75412b047a38c7020f57d0931ec5ed)) 161 | - Add an alternative for not equal - ([430b79b](https://github.com/johanvx/typst-undergradmath/commit/430b79bcaf78709873e7b21aedeb2ce86d71c541)) 162 | - Add tricky doteq symbol - ([7001164](https://github.com/johanvx/typst-undergradmath/commit/7001164e4fdc8f7f9b4fe17fa4389e30e7f98ed3)) 163 | - Update notes on determinant - ([49fab7c](https://github.com/johanvx/typst-undergradmath/commit/49fab7cafbbd0b6919f13d137b609b42a76f45a7)) 164 | - Add some comment on auto-scaling of fences - ([1146cd3](https://github.com/johanvx/typst-undergradmath/commit/1146cd3f6685233c88709cc5dcc8038970665528)) 165 | - Add a value-unit example - ([d4084ec](https://github.com/johanvx/typst-undergradmath/commit/d4084ec042fdd1b1ae6c1f2a9d04d799b36bf8c6)) 166 | - Add widehat example - ([317c168](https://github.com/johanvx/typst-undergradmath/commit/317c16823b6ce6e097b97d5f3fa28e3648b5dfe8)) 167 | - Add main contents - ([06e8f21](https://github.com/johanvx/typst-undergradmath/commit/06e8f217c78d7f9cf8a56f572cf8373dbf2efdee)) 168 | 169 | ### Miscellaneous 170 | 171 | - Support auto-release after pushing new tags - ([764a9e1](https://github.com/johanvx/typst-undergradmath/commit/764a9e1dcebe48af5e05aa3aad095c0fd8c19d72)) 172 | - Support tagging - ([16a59c9](https://github.com/johanvx/typst-undergradmath/commit/16a59c925018ad4b0af0f503561169efd214638c)) 173 | - Upload PDF as artifact on push to non main branch - ([d72f758](https://github.com/johanvx/typst-undergradmath/commit/d72f758ddfaa5d187cda1d18c41e4ea95018068a)) 174 | - Remove the PDF file - ([9f18cc0](https://github.com/johanvx/typst-undergradmath/commit/9f18cc03ac70942a1c7c62d28efc6f4d16ccae39)) 175 | - Update date - ([51f56a8](https://github.com/johanvx/typst-undergradmath/commit/51f56a8efed7b441b23d255cb0d809197df7652c)) 176 | - Add LICENSE - ([6ba2286](https://github.com/johanvx/typst-undergradmath/commit/6ba2286c786f9bb7c4a05da176dae77c0f20e73b)) 177 | 178 | 179 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Attribution-ShareAlike 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More_considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution-ShareAlike 4.0 International Public 58 | License 59 | 60 | By exercising the Licensed Rights (defined below), You accept and agree 61 | to be bound by the terms and conditions of this Creative Commons 62 | Attribution-ShareAlike 4.0 International Public License ("Public 63 | License"). To the extent this Public License may be interpreted as a 64 | contract, You are granted the Licensed Rights in consideration of Your 65 | acceptance of these terms and conditions, and the Licensor grants You 66 | such rights in consideration of benefits the Licensor receives from 67 | making the Licensed Material available under these terms and 68 | conditions. 69 | 70 | 71 | Section 1 -- Definitions. 72 | 73 | a. Adapted Material means material subject to Copyright and Similar 74 | Rights that is derived from or based upon the Licensed Material 75 | and in which the Licensed Material is translated, altered, 76 | arranged, transformed, or otherwise modified in a manner requiring 77 | permission under the Copyright and Similar Rights held by the 78 | Licensor. For purposes of this Public License, where the Licensed 79 | Material is a musical work, performance, or sound recording, 80 | Adapted Material is always produced where the Licensed Material is 81 | synched in timed relation with a moving image. 82 | 83 | b. Adapter's License means the license You apply to Your Copyright 84 | and Similar Rights in Your contributions to Adapted Material in 85 | accordance with the terms and conditions of this Public License. 86 | 87 | c. BY-SA Compatible License means a license listed at 88 | creativecommons.org/compatiblelicenses, approved by Creative 89 | Commons as essentially the equivalent of this Public License. 90 | 91 | d. Copyright and Similar Rights means copyright and/or similar rights 92 | closely related to copyright including, without limitation, 93 | performance, broadcast, sound recording, and Sui Generis Database 94 | Rights, without regard to how the rights are labeled or 95 | categorized. For purposes of this Public License, the rights 96 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 97 | Rights. 98 | 99 | e. Effective Technological Measures means those measures that, in the 100 | absence of proper authority, may not be circumvented under laws 101 | fulfilling obligations under Article 11 of the WIPO Copyright 102 | Treaty adopted on December 20, 1996, and/or similar international 103 | agreements. 104 | 105 | f. Exceptions and Limitations means fair use, fair dealing, and/or 106 | any other exception or limitation to Copyright and Similar Rights 107 | that applies to Your use of the Licensed Material. 108 | 109 | g. License Elements means the license attributes listed in the name 110 | of a Creative Commons Public License. The License Elements of this 111 | Public License are Attribution and ShareAlike. 112 | 113 | h. Licensed Material means the artistic or literary work, database, 114 | or other material to which the Licensor applied this Public 115 | License. 116 | 117 | i. Licensed Rights means the rights granted to You subject to the 118 | terms and conditions of this Public License, which are limited to 119 | all Copyright and Similar Rights that apply to Your use of the 120 | Licensed Material and that the Licensor has authority to license. 121 | 122 | j. Licensor means the individual(s) or entity(ies) granting rights 123 | under this Public License. 124 | 125 | k. Share means to provide material to the public by any means or 126 | process that requires permission under the Licensed Rights, such 127 | as reproduction, public display, public performance, distribution, 128 | dissemination, communication, or importation, and to make material 129 | available to the public including in ways that members of the 130 | public may access the material from a place and at a time 131 | individually chosen by them. 132 | 133 | l. Sui Generis Database Rights means rights other than copyright 134 | resulting from Directive 96/9/EC of the European Parliament and of 135 | the Council of 11 March 1996 on the legal protection of databases, 136 | as amended and/or succeeded, as well as other essentially 137 | equivalent rights anywhere in the world. 138 | 139 | m. You means the individual or entity exercising the Licensed Rights 140 | under this Public License. Your has a corresponding meaning. 141 | 142 | 143 | Section 2 -- Scope. 144 | 145 | a. License grant. 146 | 147 | 1. Subject to the terms and conditions of this Public License, 148 | the Licensor hereby grants You a worldwide, royalty-free, 149 | non-sublicensable, non-exclusive, irrevocable license to 150 | exercise the Licensed Rights in the Licensed Material to: 151 | 152 | a. reproduce and Share the Licensed Material, in whole or 153 | in part; and 154 | 155 | b. produce, reproduce, and Share Adapted Material. 156 | 157 | 2. Exceptions and Limitations. For the avoidance of doubt, where 158 | Exceptions and Limitations apply to Your use, this Public 159 | License does not apply, and You do not need to comply with 160 | its terms and conditions. 161 | 162 | 3. Term. The term of this Public License is specified in Section 163 | 6(a). 164 | 165 | 4. Media and formats; technical modifications allowed. The 166 | Licensor authorizes You to exercise the Licensed Rights in 167 | all media and formats whether now known or hereafter created, 168 | and to make technical modifications necessary to do so. The 169 | Licensor waives and/or agrees not to assert any right or 170 | authority to forbid You from making technical modifications 171 | necessary to exercise the Licensed Rights, including 172 | technical modifications necessary to circumvent Effective 173 | Technological Measures. For purposes of this Public License, 174 | simply making modifications authorized by this Section 2(a) 175 | (4) never produces Adapted Material. 176 | 177 | 5. Downstream recipients. 178 | 179 | a. Offer from the Licensor -- Licensed Material. Every 180 | recipient of the Licensed Material automatically 181 | receives an offer from the Licensor to exercise the 182 | Licensed Rights under the terms and conditions of this 183 | Public License. 184 | 185 | b. Additional offer from the Licensor -- Adapted Material. 186 | Every recipient of Adapted Material from You 187 | automatically receives an offer from the Licensor to 188 | exercise the Licensed Rights in the Adapted Material 189 | under the conditions of the Adapter's License You apply. 190 | 191 | c. No downstream restrictions. You may not offer or impose 192 | any additional or different terms or conditions on, or 193 | apply any Effective Technological Measures to, the 194 | Licensed Material if doing so restricts exercise of the 195 | Licensed Rights by any recipient of the Licensed 196 | Material. 197 | 198 | 6. No endorsement. Nothing in this Public License constitutes or 199 | may be construed as permission to assert or imply that You 200 | are, or that Your use of the Licensed Material is, connected 201 | with, or sponsored, endorsed, or granted official status by, 202 | the Licensor or others designated to receive attribution as 203 | provided in Section 3(a)(1)(A)(i). 204 | 205 | b. Other rights. 206 | 207 | 1. Moral rights, such as the right of integrity, are not 208 | licensed under this Public License, nor are publicity, 209 | privacy, and/or other similar personality rights; however, to 210 | the extent possible, the Licensor waives and/or agrees not to 211 | assert any such rights held by the Licensor to the limited 212 | extent necessary to allow You to exercise the Licensed 213 | Rights, but not otherwise. 214 | 215 | 2. Patent and trademark rights are not licensed under this 216 | Public License. 217 | 218 | 3. To the extent possible, the Licensor waives any right to 219 | collect royalties from You for the exercise of the Licensed 220 | Rights, whether directly or through a collecting society 221 | under any voluntary or waivable statutory or compulsory 222 | licensing scheme. In all other cases the Licensor expressly 223 | reserves any right to collect such royalties. 224 | 225 | 226 | Section 3 -- License Conditions. 227 | 228 | Your exercise of the Licensed Rights is expressly made subject to the 229 | following conditions. 230 | 231 | a. Attribution. 232 | 233 | 1. If You Share the Licensed Material (including in modified 234 | form), You must: 235 | 236 | a. retain the following if it is supplied by the Licensor 237 | with the Licensed Material: 238 | 239 | i. identification of the creator(s) of the Licensed 240 | Material and any others designated to receive 241 | attribution, in any reasonable manner requested by 242 | the Licensor (including by pseudonym if 243 | designated); 244 | 245 | ii. a copyright notice; 246 | 247 | iii. a notice that refers to this Public License; 248 | 249 | iv. a notice that refers to the disclaimer of 250 | warranties; 251 | 252 | v. a URI or hyperlink to the Licensed Material to the 253 | extent reasonably practicable; 254 | 255 | b. indicate if You modified the Licensed Material and 256 | retain an indication of any previous modifications; and 257 | 258 | c. indicate the Licensed Material is licensed under this 259 | Public License, and include the text of, or the URI or 260 | hyperlink to, this Public License. 261 | 262 | 2. You may satisfy the conditions in Section 3(a)(1) in any 263 | reasonable manner based on the medium, means, and context in 264 | which You Share the Licensed Material. For example, it may be 265 | reasonable to satisfy the conditions by providing a URI or 266 | hyperlink to a resource that includes the required 267 | information. 268 | 269 | 3. If requested by the Licensor, You must remove any of the 270 | information required by Section 3(a)(1)(A) to the extent 271 | reasonably practicable. 272 | 273 | b. ShareAlike. 274 | 275 | In addition to the conditions in Section 3(a), if You Share 276 | Adapted Material You produce, the following conditions also apply. 277 | 278 | 1. The Adapter's License You apply must be a Creative Commons 279 | license with the same License Elements, this version or 280 | later, or a BY-SA Compatible License. 281 | 282 | 2. You must include the text of, or the URI or hyperlink to, the 283 | Adapter's License You apply. You may satisfy this condition 284 | in any reasonable manner based on the medium, means, and 285 | context in which You Share Adapted Material. 286 | 287 | 3. You may not offer or impose any additional or different terms 288 | or conditions on, or apply any Effective Technological 289 | Measures to, Adapted Material that restrict exercise of the 290 | rights granted under the Adapter's License You apply. 291 | 292 | 293 | Section 4 -- Sui Generis Database Rights. 294 | 295 | Where the Licensed Rights include Sui Generis Database Rights that 296 | apply to Your use of the Licensed Material: 297 | 298 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 299 | to extract, reuse, reproduce, and Share all or a substantial 300 | portion of the contents of the database; 301 | 302 | b. if You include all or a substantial portion of the database 303 | contents in a database in which You have Sui Generis Database 304 | Rights, then the database in which You have Sui Generis Database 305 | Rights (but not its individual contents) is Adapted Material, 306 | 307 | including for purposes of Section 3(b); and 308 | c. You must comply with the conditions in Section 3(a) if You Share 309 | all or a substantial portion of the contents of the database. 310 | 311 | For the avoidance of doubt, this Section 4 supplements and does not 312 | replace Your obligations under this Public License where the Licensed 313 | Rights include other Copyright and Similar Rights. 314 | 315 | 316 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 317 | 318 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 319 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 320 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 321 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 322 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 323 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 324 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 325 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 326 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 327 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 328 | 329 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 330 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 331 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 332 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 333 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 334 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 335 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 336 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 337 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 338 | 339 | c. The disclaimer of warranties and limitation of liability provided 340 | above shall be interpreted in a manner that, to the extent 341 | possible, most closely approximates an absolute disclaimer and 342 | waiver of all liability. 343 | 344 | 345 | Section 6 -- Term and Termination. 346 | 347 | a. This Public License applies for the term of the Copyright and 348 | Similar Rights licensed here. However, if You fail to comply with 349 | this Public License, then Your rights under this Public License 350 | terminate automatically. 351 | 352 | b. Where Your right to use the Licensed Material has terminated under 353 | Section 6(a), it reinstates: 354 | 355 | 1. automatically as of the date the violation is cured, provided 356 | it is cured within 30 days of Your discovery of the 357 | violation; or 358 | 359 | 2. upon express reinstatement by the Licensor. 360 | 361 | For the avoidance of doubt, this Section 6(b) does not affect any 362 | right the Licensor may have to seek remedies for Your violations 363 | of this Public License. 364 | 365 | c. For the avoidance of doubt, the Licensor may also offer the 366 | Licensed Material under separate terms or conditions or stop 367 | distributing the Licensed Material at any time; however, doing so 368 | will not terminate this Public License. 369 | 370 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 371 | License. 372 | 373 | 374 | Section 7 -- Other Terms and Conditions. 375 | 376 | a. The Licensor shall not be bound by any additional or different 377 | terms or conditions communicated by You unless expressly agreed. 378 | 379 | b. Any arrangements, understandings, or agreements regarding the 380 | Licensed Material not stated herein are separate from and 381 | independent of the terms and conditions of this Public License. 382 | 383 | 384 | Section 8 -- Interpretation. 385 | 386 | a. For the avoidance of doubt, this Public License does not, and 387 | shall not be interpreted to, reduce, limit, restrict, or impose 388 | conditions on any use of the Licensed Material that could lawfully 389 | be made without permission under this Public License. 390 | 391 | b. To the extent possible, if any provision of this Public License is 392 | deemed unenforceable, it shall be automatically reformed to the 393 | minimum extent necessary to make it enforceable. If the provision 394 | cannot be reformed, it shall be severed from this Public License 395 | without affecting the enforceability of the remaining terms and 396 | conditions. 397 | 398 | c. No term or condition of this Public License will be waived and no 399 | failure to comply consented to unless expressly agreed to by the 400 | Licensor. 401 | 402 | d. Nothing in this Public License constitutes or may be interpreted 403 | as a limitation upon, or waiver of, any privileges and immunities 404 | that apply to the Licensor or You, including from the legal 405 | processes of any jurisdiction or authority. 406 | 407 | 408 | ======================================================================= 409 | 410 | Creative Commons is not a party to its public 411 | licenses. Notwithstanding, Creative Commons may elect to apply one of 412 | its public licenses to material it publishes and in those instances 413 | will be considered the “Licensor.” The text of the Creative Commons 414 | public licenses is dedicated to the public domain under the CC0 Public 415 | Domain Dedication. Except for the limited purpose of indicating that 416 | material is shared under a Creative Commons public license or as 417 | otherwise permitted by the Creative Commons policies published at 418 | creativecommons.org/policies, Creative Commons does not authorize the 419 | use of the trademark "Creative Commons" or any other trademark or logo 420 | of Creative Commons without its prior written consent including, 421 | without limitation, in connection with any unauthorized modifications 422 | to any of its public licenses or any other arrangements, 423 | understandings, or agreements concerning use of licensed material. For 424 | the avoidance of doubt, this paragraph does not form part of the 425 | public licenses. 426 | 427 | Creative Commons may be contacted at creativecommons.org. 428 | -------------------------------------------------------------------------------- /undergradmath.typ: -------------------------------------------------------------------------------- 1 | // Meta data 2 | #set document(title: "Typst Math for Undergrads", author: "johanvx") 3 | 4 | // headcolor 5 | #let headcolor = rgb("004225") 6 | 7 | // Margin and footer 8 | #set page( 9 | margin: 0.5in, 10 | footer: context { 11 | if counter(page).display() == "2" { 12 | grid( 13 | columns: (1fr, 1fr), 14 | [], 15 | block( 16 | inset: 4pt, 17 | stroke: (top: headcolor), 18 | text(headcolor)[johanvx (https://github.com/johanvx) #h(1fr) #datetime.today().display()], 19 | ), 20 | ) 21 | } else { 22 | [] 23 | } 24 | }, 25 | ) 26 | 27 | // Font size 28 | #let scriptsize = 7pt 29 | #let normalsize = 10pt 30 | #let large = 12pt 31 | #set text(size: normalsize, lang: "en") 32 | 33 | // Some horizontal spacing 34 | #let kern(length) = h(length, weak: true) 35 | #let enspace = kern(0.5em) 36 | 37 | // For table/grid, something like "lhs \enspace rhs" 38 | #let cell(lhs, rhs) = box(lhs + enspace + rhs) 39 | // Grid for code blocks 40 | #set grid(columns: (2em, auto)) 41 | // Table for math-code listing 42 | #set table(stroke: none, align: horizon + left, inset: 0pt, row-gutter: 0.45em) 43 | 44 | // LaTeX and TeX logos 45 | #let TeX = context { 46 | let e = measure(text(normalsize, "E")) 47 | let T = "T" 48 | let E = text(normalsize, baseline: e.height / 2, "E") 49 | let X = "X" 50 | box(T + kern(-0.1667em) + E + kern(-0.125em) + X) 51 | } 52 | #let LaTeX = context { 53 | let l = measure(text(10pt, "L")) 54 | let a = measure(text(7pt, "A")) 55 | let L = "L" 56 | let A = text(7pt, baseline: a.height - l.height, "A") 57 | box(L + kern(-0.36em) + A + kern(-0.15em) + TeX) 58 | } 59 | 60 | // Unavailable (last check version) 61 | #show "??": box(text(red, [v#sys.version #emoji.crossmark])) 62 | // Tricky 63 | #show "!!": box(text(blue, emoji.drops)) 64 | // No idea 65 | #show "?!": box(text(orange, [No idea #emoji.face.unhappy])) 66 | // Tricky figure numbering 67 | #set figure( 68 | numbering: n => { 69 | ([??], [!!], [?!]).at(n) 70 | }, 71 | ) 72 | // No prefix 73 | #set ref(supplement: "") 74 | 75 | // Justified paragraphs 76 | #set par(justify: true) 77 | 78 | // Run-in sections, like LaTeX \paragraph 79 | #show heading.where(level: 1): it => text( 80 | size: normalsize, 81 | weight: "bold", 82 | fill: headcolor, 83 | it.body + h(0.67em), 84 | ) 85 | 86 | // Black raw code 87 | #show raw.where(block: false): it => { it.text } 88 | 89 | // Two-column layout 90 | #show: rest => columns(2, rest) 91 | 92 | // Title 93 | #align( 94 | center, 95 | link("https://github.com/johanvx/typst-undergradmath")[ 96 | #text(large, headcolor)[*Typst Math for Undergrads*] 97 | ], 98 | ) 99 | 100 | // Put this here to avoid affecting the title 101 | #show link: underline 102 | 103 | This is a Typst port with typst #sys.version of _#LaTeX Math for Undergrads_ by Jim Hefferon. 104 | The original version is available at #link("https://gitlab.com/jim.hefferon/undergradmath"). 105 | 106 | = Meaning of annotations 107 | // #figure( 108 | // table( 109 | // columns: (1fr, 2fr), 110 | // [??], [Unavailable until typst #sys.version.], 111 | // ) 112 | // ) 113 | #figure( 114 | table( 115 | columns: (1fr, 2fr), 116 | [!!], [Tricky. A simpler method is needed.], 117 | ), 118 | ) 119 | // #figure( 120 | // table( 121 | // columns: (1fr, 2fr), 122 | // [?!], [Don't know how to get this.], 123 | // ) 124 | // ) 125 | 126 | = Rule One 127 | Any mathematics at all, even a single character, gets a mathematical setting. 128 | Thus, for "the value of $x$ is $7$" enter `the value of $x$ is $7$`. 129 | 130 | = Template 131 | Your document should contain at least this. 132 | 133 | #grid( 134 | "", 135 | ``` 136 | -- document body here -- 137 | ``` 138 | ) 139 | 140 | = Common constructs 141 | #align( 142 | center, 143 | table( 144 | columns: 4, 145 | align: (right, left, right, left), 146 | column-gutter: (1em, 1.5em, 1em), 147 | [$x^2$], [`x^2`], 148 | [$sqrt(2)$, $root(n, 3)$], [`sqrt(2)`, `root(n, 3)`], 149 | [$x_(i, j)$], [`x_(i, j)`], 150 | [$2 / 3$, $2 \/ 3$], [`2 / 3`, `2 \/ 3` or `2 slash 3`], // Maybe use `slash`? 151 | ), 152 | ) 153 | 154 | = Calligraphic letters 155 | Use as in `$cal(A)$`. 156 | 157 | $ cal(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) $ 158 | 159 | #show math.equation: set text(stylistic-set: 1) 160 | Get script letters, such as $cal(P)$ from `$cal(P)$`, by changing the `stylistic-set` parameter of `text()` to the corresponding set. 161 | 162 | = Greek 163 | #align( 164 | center, 165 | table( 166 | columns: 4, 167 | align: (right, left, right, left), 168 | column-gutter: (1em, 1.5em, 1em), 169 | [$alpha$], [`alpha`], [$xi$, $Xi$], [`xi`, `Xi`], 170 | [$beta$], [`beta`], [$omicron$], [`omicron`], 171 | [$gamma$, $Gamma$], [`gamma`, `Gamma`], [$pi$, $Pi$], [`pi`, `Pi`], 172 | [$delta$, $Delta$], [`delta`, `Delta`], [$pi.alt$], [`pi.alt`], 173 | [$epsilon.alt$], [`epsilon.alt`], [$rho$], [`rho`], 174 | [$epsilon$], [`epsilon`], [$rho.alt$], [`rho.alt`], 175 | [$zeta$], [`zeta`], [$sigma$, $Sigma$], [`sigma`, `Sigma`], 176 | [$eta$], [`eta`], [$sigma.alt$], [`sigma.alt`], 177 | [$theta$, $Theta$], [`theta`, `Theta`], [$tau$], [`tau`], 178 | [$theta.alt$], 179 | [`theta.alt`], 180 | [$upsilon$, $Upsilon$], 181 | [`upsilon`, `Upsilon`], 182 | 183 | [$iota$], [`iota`], [$phi.alt$, $Phi$], [`phi.alt`, `Phi`], 184 | [$kappa$], [`kappa`], [$phi$], [`phi`], 185 | [$lambda$, $Lambda$], [`lambda`, `Lambda`], [$chi$], [`chi`], 186 | [$mu$], [`mu`], [$psi$, $Psi$], [`psi`, `Psi`], 187 | [$nu$], [`nu`], [$omega$, $Omega$], [`omega`, `Omega`], 188 | ), 189 | ) 190 | 191 | = Sets and logic 192 | #align( 193 | center, 194 | table( 195 | columns: 6, 196 | align: (right, left, right, left, right, left), 197 | column-gutter: (1em, 1.5em, 1em, 1.5em, 1em), 198 | [$union$], [`union`], [$RR$], [`RR`, `bb(R)`], [$forall$], [`forall`], 199 | [$inter$], [`inter`], [$bb(Z)$], [`ZZ`, `bb(Z)`], [$exists$], [`exists`], 200 | [$subset$], [`subset`], [$bb(Q)$], [`QQ`, `bb(Q)`], [$not$], [`not`], 201 | [$subset.eq$], [`subset.eq`], [$bb(N)$], [`NN`, `bb(N)`], [$or$], [`or`], 202 | [$supset$], [`supset`], [$bb(C)$], [`CC`, `bb(C)`], [$and$], [`and`], 203 | [$supset.eq$], 204 | [`supset.eq`], 205 | [$diameter$], 206 | [`diameter`], 207 | [$tack.r$], 208 | [`tack.r`], 209 | 210 | [$in$], [`in`], [$nothing$], [`nothing`], [$models$], [`models`], 211 | [$in.not$], [`in.not`], [$alef$], [`alef`], [$without$], [`without`], 212 | ), 213 | ) 214 | 215 | Negate an operator, as in $subset.not$, with `subset.not`. 216 | Get the set complement $A^(sans(c))$ with `A^(sans(c))` (or $A^(complement)$ with `A^(complement)`, or $overline(A)$ with `overline(A)`). 217 | 218 | // https://www.ctan.org/tex-archive/fonts/newcomputermodern 219 | // 220 | // README 221 | // 222 | // Version 3.93 223 | // 224 | // Provides access to Russian and Greek guillemotleft and guillemotright 225 | // using the character variant tables cv3 and cv4 respectively. 226 | // 227 | // The Math fonts provide the character \varnothing, an alternative to \emptyset, 228 | // through Character Variant cv01. The fontsetup package provides the option 229 | // 'varnothing' to easily switch to the alternative character. 230 | 231 | // http://mirrors.ctan.org/fonts/newcomputermodern/doc/newcm-doc.pdf 232 | // 233 | // Version 5.1 234 | // 235 | // The NewComputerModern FontFamily §14.5 236 | // The Math fonts provide the character \varnothing (⌀, U+2300), as an alternative to \emptyset (a slashed zero), through Character Variant cv01. 237 | // The fontsetup package provides the option ‘varnothing’ to easily switch to the alternative character. 238 | 239 | / Remark: Using `diameter` for `\varnothing` may cause some confusion. 240 | However, in #LaTeX, the `\varnothing` provided through Character Variant `cv01` is also `diameter` 241 | (see #link("http://mirrors.ctan.org/fonts/newcomputermodern/doc/newcm-doc.pdf")[newcm $section$14.5]). 242 | So a simple solution with the default math font _New Computer Modern Math_ is to define a new symbol `varnothing` with `#let varnothing = math.diameter`. 243 | Other solutions can be found in #link("https://sitandr.github.io/typst-examples-book/book/basics/math/symbols.html#empty-set")[Typst Examples Book]. 244 | 245 | = Decorations 246 | #align( 247 | center, 248 | table( 249 | columns: 6, 250 | align: (right, left, right, left, right, left), 251 | column-gutter: (1em, 1.5em, 1em, 1.5em, 1em), 252 | [$f'$], 253 | [`f'`, `f prime`], 254 | [$dot(a)$], 255 | [`dot(a)`], 256 | [$tilde(a)$], 257 | [`tilde(a)`], 258 | 259 | [$f prime.double$], 260 | [`f prime.double`], 261 | [$diaer(a)$], 262 | [`diaer(a)`], 263 | [$macron(a)$], 264 | [`macron(a)`], 265 | 266 | [$Sigma^*$], 267 | [`Sigma^*`], 268 | [$hat(a)$], 269 | [`hat(a)`], 270 | [$arrow(a)$], 271 | [`arrow(a)`], 272 | ), 273 | ) 274 | 275 | If the decorated letter is $i$ or $j$ then some decorations need `dotless.i` and `dotless.j`, as in $arrow(dotless.i)$ with `arrow(dotless.i)`. 276 | Some authors use boldface for vectors: `bold(x)`. 277 | 278 | Entering `overline(x + y)` produces $overline(x + y)$, and `hat(x + y)` gives $hat(x + y)$. 279 | Comment on an expression as here (there is also `overbrace(..)`). 280 | 281 | #align( 282 | center, 283 | table( 284 | columns: 2, 285 | column-gutter: 1em, 286 | [$ underbrace(x + y, |A|) $], 287 | [ 288 | ``` 289 | underbrace(x + y, |A|) 290 | ``` 291 | ], 292 | ), 293 | ) 294 | 295 | = Dots 296 | Use low dots in a list ${0, 1, 2, ...}$, entered as `{0, 1, 2, ...}`. 297 | Use centered dots in a sum or product $1 + dots.h.c + 100$, entered as `1 + dots.h.c + 100`. 298 | You can also get vertical dots `dots.v`, diagonal dots `dots.down` and anti-diagonal dots `dots.up`. 299 | 300 | = Roman names 301 | Just type them! 302 | 303 | #align( 304 | center, 305 | table( 306 | columns: 6, 307 | align: (right, left, right, left, right, left), 308 | column-gutter: (1em, 1.5em, 1em, 1.5em, 1em), 309 | [$sin$], [`sin`], [$sinh$], [`sinh`], [$arcsin$], [`arcsin`], 310 | [$cos$], [`cos`], [$cosh$], [`cosh`], [$arccos$], [`arccos`], 311 | [$tan$], [`tan`], [$tanh$], [`tanh`], [$arctan$], [`arctan`], 312 | [$sec$], [`sec`], [$coth$], [`coth`], [$min$], [`min`], 313 | [$csc$], [`csc`], [$det$], [`det`], [$max$], [`max`], 314 | [$cot$], [`cot`], [$dim$], [`dim`], [$inf$], [`inf`], 315 | [$exp$], [`exp`], [$ker$], [`ker`], [$sup$], [`sup`], 316 | [$log$], [`log`], [$deg$], [`deg`], [$liminf$], [`liminf`], 317 | [$ln$], [`ln`], [$arg$], [`arg`], [$limsup$], [`limsup`], 318 | [$lg$], [`lg`], [$gcd$], [`gcd`], [$lim$], [`lim`], 319 | ), 320 | ) 321 | 322 | #let cosec = math.op("cosec") 323 | 324 | If an operator you wish to use does not exist, you can create one using `math.op`. For example, to create the $cosec$ operator: 325 | 326 | ``` 327 | #let cosec = math.op("cosec") 328 | $ cosec x = 1/(sin x) $ 329 | ``` 330 | 331 | $ cosec x = 1 / (sin x) $ 332 | 333 | = Other symbols 334 | #align( 335 | center, 336 | table( 337 | columns: 6, 338 | align: (right, left, right, left, right, left), 339 | column-gutter: (0.5em, 1em, 0.5em, 1em, 0.5em), 340 | [$<$], [`<`, `lt`], [$angle$], [`angle`], [$dot$], [`dot`], 341 | [$<=$], 342 | [`<=`, `lt.eq`], 343 | [$angle.arc$], 344 | [`angle.arc`], 345 | [$plus.minus$], 346 | [`plus.minus`], 347 | 348 | [$>$], [`>`, `gt`], [$ell$], [`ell`], [$minus.plus$], [`minus.plus`], 349 | [$>=$], [`>=`, `gt.eq`], [$parallel$], [`parallel`], [$times$], [`times`], 350 | [$!=$], [`!=`, `eq.not`], [$45 degree$], [`45 degree`], [$div$], [`div`], 351 | [$<<$], 352 | [`<<`, `lt.double`], 353 | [$tilde.equiv$], 354 | [`tilde.equiv`], 355 | [$*$], 356 | [`*`, `ast`], 357 | 358 | [$>>$], 359 | [`>>`, `gt.double`], 360 | [$tilde.nequiv$], 361 | [`tilde.nequiv`], 362 | [$divides$], 363 | [`divides`], 364 | 365 | [$approx$], 366 | [`approx`], 367 | [$tilde$], 368 | [`tilde`], 369 | [$divides.not$], 370 | [`divides.not`], 371 | 372 | [$asymp$], [`asymp`], [$tilde.eq$], [`tilde.eq`], [$n!$], [`n!`], 373 | [$equiv$], [`equiv`], [$tilde.not$], [`tilde.not`], [$diff$], [`diff`], 374 | [$prec$], [`prec`], [$plus.circle$], [`plus.circle`], [$nabla$], [`nabla`], 375 | [$prec.eq$], 376 | [`prec.eq`], 377 | [$minus.circle$], 378 | [`minus.cirle`], 379 | [$planck.reduce$], 380 | [`planck.reduce`], 381 | 382 | [$succ$], 383 | [`succ`], 384 | [$dot.circle$], 385 | [`dot.circle`], 386 | [$compose$], 387 | [`compose`], 388 | 389 | [$succ.eq$], 390 | [`succ.eq`], 391 | [$times.circle$], 392 | [`times.circle`], 393 | [$star$], 394 | [`star`], 395 | 396 | [$prop$], 397 | [`prop`], 398 | [$\u{2298}$], 399 | [`\u{2298}` @tricky], 400 | [$sqrt("")$], 401 | [`sqrt("")`], 402 | 403 | [$\u{2250}$], 404 | [`\u{2250}` @tricky], 405 | [$harpoon.tr$], 406 | [`harpoon.tr`], 407 | [$checkmark$], 408 | [`checkmark`], 409 | ), 410 | ) 411 | 412 | Use `a divides b` for the divides relation, $a divides b$, and `a divides.not b` for the negation, $a divides.not b$. 413 | Use `|` to get set builder notation ${a in S | a "is odd"}$ with `{a in S | a "is odd"}`. 414 | 415 | = Arrows 416 | #align( 417 | center, 418 | table( 419 | columns: 4, 420 | align: (right, left, right, left), 421 | column-gutter: (1em, 1.5em, 1em), 422 | [$->$], [`->`, `arrow.r`], [$|->$], [`|->`, `arrow.r.bar`], 423 | [$arrow.r.not$], 424 | [`arrow.r.not`], 425 | [$arrow.r.long.bar$], 426 | [`arrow.r.long.bar`], 427 | 428 | [$-->$], [`-->`, `arrow.r.long`], [$<-$], [`<-`, `arrow.l`], 429 | [$=>$], [`=>`, `arrow.r.double`], [$<->$], [`<->`, `arrow.l.r`], 430 | [$arrow.r.double.not$], [`arrow.r.double.not`], [$arrow.b$], [`arrow.b`], 431 | [$==>$], [`==>`, `arrow.r.double.long`], [$arrow.t$], [`arrow.t`], 432 | [$arrow.squiggly$], [`arrow.squiggly`], [$arrow.t.b$], [`arrow.t.b`], 433 | ), 434 | ) 435 | 436 | The right arrows in the first column have matching left arrows, such as `arrow.l.not`, and there are some other matches for down arrows, etc. 437 | 438 | = Variable-sized operators 439 | The summation $sum_(j = 0)^3 j^2$ `sum_(j = 0)^3 j^2` and the integral $integral_(x = 0)^3 x^2 dif x$ `integral_(x = 0)^3 x^2 dif x` expand when displayed. 440 | 441 | $ sum_(j = 0)^3 j^2 wide integral_(x = 0)^3 x^2 dif x $ 442 | 443 | These do the same. 444 | 445 | #align( 446 | center, 447 | table( 448 | columns: 4, 449 | align: (right, left, right, left), 450 | column-gutter: (1em, 1.5em, 1em), 451 | row-gutter: 0.5em, 452 | [$integral$], [`integral`], [$integral.double$], [`integral.double`], 453 | [$integral.triple$], 454 | [`integral.triple`], 455 | [$integral.cont$], 456 | [`integral.cont`], 457 | 458 | [$union.big$], [`union.big`], [$inter.big$], [`inter.big`], 459 | ), 460 | ) 461 | 462 | = Fences 463 | #align( 464 | center, 465 | table( 466 | columns: 6, 467 | align: (right, left, right, left, right, left), 468 | column-gutter: (1em, 1.5em, 1em, 1.5em, 1em), 469 | row-gutter: 0.5em, 470 | [$()$], 471 | [`()`], 472 | [$angle.l angle.r$], 473 | [`angle.l angle.r`], 474 | [$abs("")$], 475 | [`abs("")`], 476 | 477 | [$[]$], [`[]`], [$floor("")$], [`floor("")`], [$norm("")$], [`norm("")`], 478 | [${}$], [`{}`], [$ceil("")$], [`ceil("")`], 479 | ), 480 | ) 481 | 482 | Fix the size with the `lr` function. 483 | 484 | #align( 485 | center, 486 | table( 487 | columns: 2, 488 | column-gutter: 1em, 489 | [$ lr([sum_(k = 0)^n e^(k^2)], size: #50%) $], 490 | [ 491 | ``` 492 | lr([sum_(k = 0)^n e^(k^2)], size: #50%) 493 | ``` 494 | ], 495 | ), 496 | ) 497 | 498 | To have them grow with the enclosed formula, also use the `lr` function. 499 | 500 | #align( 501 | center, 502 | table( 503 | columns: 2, 504 | column-gutter: 1em, 505 | [$ lr(angle.l i, 2^(2^i) angle.r) $], 506 | [ 507 | ``` 508 | lr(angle.l i, 2^(2^i) angle.r) 509 | ``` 510 | ], 511 | ), 512 | ) 513 | 514 | Fences scale by default if entered directly as codepoints, and don't scale automatically if entered as symbol notation. 515 | 516 | #align( 517 | center, 518 | table( 519 | columns: 2, 520 | align: (right + horizon, left + horizon), 521 | column-gutter: 1em, 522 | [$ (1 / n^(alpha)) $], 523 | [ 524 | ``` 525 | (1 / n^(alpha)) 526 | ``` 527 | ], 528 | 529 | [$ paren.l 1 / n^(alpha) paren.r $], 530 | [ 531 | ``` 532 | paren.l 1 / n^(alpha) paren.r 533 | ``` 534 | ], 535 | ), 536 | ) 537 | 538 | The `lr` function also allows to scale unmatched delimiters and one-side fences. 539 | 540 | #align( 541 | center, 542 | table( 543 | columns: 2, 544 | column-gutter: 1em, 545 | [$ lr(frac(dif f, dif x) |)_(x_0) $], 546 | [ 547 | ``` 548 | lr(frac(dif f, dif x) |)_(x_0) 549 | ``` 550 | ], 551 | ), 552 | ) 553 | 554 | = Arrays, Matrices 555 | Get a matrix with the `mat` function. You can pass an array to it. 556 | 557 | #align( 558 | center, 559 | table( 560 | columns: 2, 561 | column-gutter: 1em, 562 | [$ mat(a, b; c, d) $], 563 | [ 564 | ``` 565 | $ mat(a, b; c, d) $ 566 | ``` 567 | ], 568 | ), 569 | ) 570 | 571 | In Typst, #link("https://typst.app/docs/reference/foundations/array")[array] is a sequence of values, 572 | while in #LaTeX, array is a matrix without fences, which is `$mat(delim: #none, ..)$` in Typst. 573 | 574 | For the determinant use `|A|`, text operator $det$ `det` or `mat(delim: "|", ..)`. 575 | 576 | Definition by cases can be easily obtained with the `cases` function. 577 | 578 | #align( 579 | center, 580 | table( 581 | columns: 2, 582 | column-gutter: 1em, 583 | [ 584 | $ 585 | f_n = cases( 586 | a &"if" n = 0, 587 | r dot f_(n - 1) &"else" 588 | ) 589 | $ 590 | ], 591 | [ 592 | ``` 593 | $ f_n = cases( 594 | a &"if" n = 0, 595 | r dot f_(n - 1) &"else" 596 | ) $ 597 | ``` 598 | ], 599 | ), 600 | ) 601 | 602 | = Spacing in mathematics 603 | Improve $sqrt(2) x$ to $sqrt(2) thin x$ with a thin space, as in `sqrt(2) thin x`. 604 | Slightly wider are `med` and `thick` (the three are in ratio $3 : 4 : 5$). 605 | Bigger space are: `quad` for $-> quad <-$ and `wide` for $-> wide <-$, which are useful between parts of a display. 606 | Get arbitrary space with the `h` function. 607 | For example, use `#h(-0.1667em)` for `\!` in #LaTeX. 608 | 609 | = Displayed equations 610 | Display equations in a block level using `$ ... $` with at least one space separating the math content and the `$`. 611 | 612 | #align( 613 | center, 614 | table( 615 | columns: 2, 616 | column-gutter: 1em, 617 | [$ S = k dot lg W $], 618 | [ 619 | ``` 620 | $ S = k dot lg W $ 621 | ``` 622 | ], 623 | ), 624 | ) 625 | 626 | You can break into multiple lines. 627 | 628 | #align( 629 | center, 630 | table( 631 | columns: 2, 632 | column-gutter: 1em, 633 | [ 634 | $ 635 | sin(x) = x - x^3 / 3! \ 636 | + x^5 / 5! - dots.h.c 637 | $ 638 | ], 639 | [ 640 | ``` 641 | $ sin(x) = x - x^3 / 3! \ 642 | + x^5 / 5! - dots.h.c $ 643 | ``` 644 | ], 645 | ), 646 | ) 647 | 648 | Align equations using `&` 649 | 650 | #align( 651 | center, 652 | table( 653 | columns: 2, 654 | column-gutter: 1em, 655 | [ 656 | $ 657 | nabla dot bold(D) &= rho \ 658 | nabla dot bold(B) &= 0 659 | $ 660 | ], 661 | ``` 662 | $ nabla dot bold(D) &= rho \ 663 | nabla dot bold(B) &= 0 $ 664 | ```, 665 | ), 666 | ) 667 | 668 | (the left or right side of an alignment can be empty). 669 | Get a numbered version by `#set math.equation(numbering: ..)`. 670 | 671 | = Calculus examples 672 | The last three here are display style. 673 | 674 | #align( 675 | center, 676 | table( 677 | columns: 2, 678 | column-gutter: 1em, 679 | [$ f: RR -> RR $], 680 | [ 681 | ``` 682 | f: RR -> RR 683 | ``` 684 | ], 685 | 686 | [$ 9.8 thin "m" slash "s"^2 $], [`9.8 thin "m" slash "s"^2` @tricky], 687 | [$ lim_(h->0) (f(x+h)-f(x)) / h $], 688 | [ 689 | ``` 690 | lim_(h -> 0) (f(x + h) - f(x)) / h 691 | ``` 692 | ], 693 | 694 | [$ integral x^2 dif x = x^3 \/ 3 + C $], 695 | [ 696 | ``` 697 | integral x^2 dif x = x^3 \/ 3 + C 698 | ``` 699 | ], 700 | 701 | [$ 702 | nabla = bold(i) dif / (dif x) + bold(j) dif / (dif y) + bold(k) dif / (dif z) 703 | $], 704 | [ 705 | ``` 706 | nabla = bold(i) dif / (dif x) + bold(j) dif / (dif y) + bold(k) dif / (dif z) 707 | ``` 708 | ], 709 | ), 710 | ) 711 | 712 | = Discrete mathematics examples 713 | For modulo, there is a symbol $equiv$ from `equiv` and a text operator $mod$ from `mod`. 714 | 715 | For combinations the binomial symbol $binom(n, k)$ is from `binom(n, k)`. 716 | This resizes to be bigger in a display. 717 | 718 | For permutations use $n^(underline(r))$ from `n^(underline(r))` (some authors use $P(n, r)$, or $""_n P_r$ from `""_n P_r`). 719 | 720 | = Statistics examples 721 | #align( 722 | center, 723 | table( 724 | columns: 2, 725 | column-gutter: 1em, 726 | [$ sigma^2 = sqrt(sum(x_i - mu)^2 \/ N) $], 727 | [ 728 | ``` 729 | sigma^2 = sqrt(sum(x_i - mu)^2 \/ N) 730 | ``` 731 | ], 732 | 733 | [$ E(X) = mu_X = sum(x_i - P(x_i)) $], 734 | [ 735 | ``` 736 | E(X) = mu_X = sum(x_i - P(x_i)) 737 | ``` 738 | ], 739 | 740 | [$ 1 / sqrt(2 sigma^2 pi) e^(- (x - mu)^2 / (2 sigma^2)) $], 741 | [ 742 | ``` 743 | 1 / sqrt(2 sigma^2 pi) e^(- (x - mu)^2 / (2 sigma^2)) 744 | ``` 745 | ], 746 | ), 747 | ) 748 | 749 | = For more 750 | See also the Typst Documentation at #link("https://typst.app/docs"). 751 | --------------------------------------------------------------------------------