Skip to content

Commit

Permalink
v0.2.0 grand new parser
Browse files Browse the repository at this point in the history
  • Loading branch information
qwinsi committed Aug 21, 2024
1 parent 375fc4a commit 25eedd1
Show file tree
Hide file tree
Showing 11 changed files with 732 additions and 326 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ npm install tex2typst

Replace `0.1.20` with the latest version number in case this README is outdated.

The size of minimized library `tex2typst.min.js` is about 23 KB.

## Usage

### Basic usage
Expand Down Expand Up @@ -60,7 +62,7 @@ graph LR
tex[TeX code] --parser--> ast[TeX AST] --writer--> typst[Typst code]
```

- parser: Implemented in function `parseTex()`. At present, it depends on the parser implemented by [KaTeX](https://github.com/KaTeX/KaTeX).
- parser: Implemented in class `LatexParser()`.
- writer: Implemented in class `TypstWriter()`

## Contributing
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tex2typst",
"version": "0.1.20",
"version": "0.2.0",
"description": "JavaScript library for converting TeX code to Typst",
"type": "module",
"main": "dist/index.js",
Expand Down Expand Up @@ -30,7 +30,5 @@
"typescript": "^5.5.3",
"vitest": "^2.0.2"
},
"dependencies": {
"katex": "^0.16.11"
}
"dependencies": {}
}
4 changes: 4 additions & 0 deletions src/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export const symbolMap = new Map<string, string>([
['overline', 'overline'], // same
['underline', 'underline'], // same
['bar', 'macron'],
['dbinom', 'binom'],
['tbinom', 'binom'],
['dfrac', 'frac'],
['tfrac', 'frac'],

['boldsymbol', 'bold'],
['mathbf', 'bold'],
Expand Down
Loading

0 comments on commit 25eedd1

Please sign in to comment.