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 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 { parseTex, tex2typst } from 'tex2typst';
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
- ### Advanced settings
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
- const output = tex2typst(input, {customTexMacros: macros});
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
@@ -1,2 +1,3 @@
1
1
  import { Tex2TypstOptions } from "./types";
2
2
  export declare function tex2typst(tex: string, options?: Tex2TypstOptions): string;
3
+ export { Tex2TypstOptions };