tex2typst 0.0.17 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +844 -22
- package/dist/parser.d.ts +1 -1
- package/dist/tex2typst.min.js +1 -0
- package/package.json +6 -2
- package/src/index.ts +3 -0
- package/src/map.ts +5 -8
- package/src/parser.ts +1 -1
- package/src/tex2typst.ts +9 -0
- package/src/writer.ts +13 -0
- package/tool/dist/dist/ka.js +13654 -0
- package/tool/dist/ka.js +13634 -0
- package/tsconfig.json +4 -3
- package/.github/workflows/github-ci.yml +0 -35
- package/dist/map.js +0 -291
- package/dist/parser.js +0 -265
- package/dist/types.js +0 -2
- package/dist/writer.js +0 -356
package/README.md
CHANGED
|
@@ -7,23 +7,38 @@ A Web UI wrapper is available at [https://qwinsi.github.io/tex2typst-webapp/](ht
|
|
|
7
7
|
|
|
8
8
|
## Installation
|
|
9
9
|
|
|
10
|
+
## Installing it in a Node.js project
|
|
11
|
+
|
|
10
12
|
```bash
|
|
11
13
|
npm install tex2typst
|
|
12
14
|
```
|
|
13
15
|
|
|
16
|
+
## Or just loading it in a web page
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<script src="https://cdn.jsdelivr.net/npm/tex2typst@0.0.19/dist/tex2typst.min.js"></script>
|
|
20
|
+
<!-- or -->
|
|
21
|
+
<script src="https://unpkg.com/tex2typst@0.0.19/dist/tex2typst.min.js"></script>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Replace `0.0.19` with the latest version number in case this README is outdated.
|
|
25
|
+
|
|
14
26
|
## Usage
|
|
15
27
|
|
|
16
28
|
### Basic usage
|
|
17
29
|
|
|
18
30
|
```javascript
|
|
19
|
-
import {
|
|
31
|
+
import { tex2typst } from 'tex2typst';
|
|
20
32
|
|
|
21
33
|
let output = tex2typst("\\zeta(s) = \\sum_{n=1}^{\\infty}\\frac{1}{n^s}");
|
|
22
34
|
console.log(output);
|
|
23
35
|
// zeta(s) = sum_(n = 1)^infinity frac(1, n^s)
|
|
24
36
|
```
|
|
25
37
|
|
|
26
|
-
|
|
38
|
+
If you are using the library in a web page via a `<script>` tag, you don't need the line of `import`, function `tex2typst` should be available in the global scope.
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Advanced options
|
|
27
42
|
|
|
28
43
|
- custom TeX macros/commands
|
|
29
44
|
|
|
@@ -33,7 +48,7 @@ let macros = {
|
|
|
33
48
|
"\\sgn": "\\operatorname{sgn}"
|
|
34
49
|
};
|
|
35
50
|
let input = "y = \\sgn(x)";
|
|
36
|
-
|
|
51
|
+
let output = tex2typst(input, {customTexMacros: macros});
|
|
37
52
|
console.log(output);
|
|
38
53
|
// y = op("sgn")(x)
|
|
39
54
|
```
|
package/dist/index.d.ts
CHANGED