tex2typst 0.3.0 → 0.3.2

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
@@ -1,4 +1,5 @@
1
- # tex2typst
1
+ # tex2typst.js
2
+
2
3
  JavaScript library for conversion between TeX/LaTeX and Typst math formula code.
3
4
 
4
5
  Despite the name `tex2typst` due to the initial goal of converting TeX to Typst, the library can also convert Typst to TeX since version 0.3.0.
@@ -18,24 +19,23 @@ npm install tex2typst
18
19
  ## Or just loading it in a web page
19
20
 
20
21
  ```html
21
- <script src="https://cdn.jsdelivr.net/npm/tex2typst@0.3.0-beta-5/dist/tex2typst.min.js"></script>
22
+ <script src="https://cdn.jsdelivr.net/npm/tex2typst@0.3.0/dist/tex2typst.min.js"></script>
22
23
  <!-- or -->
23
- <script src="https://unpkg.com/tex2typst@0.3.0-beta-5/dist/tex2typst.min.js"></script>
24
+ <script src="https://unpkg.com/tex2typst@0.3.0/dist/tex2typst.min.js"></script>
24
25
  ```
25
26
 
26
- Replace `0.3.0-beta-5` with the latest version number in case this README is outdated.
27
+ Replace `0.3.0` with the latest version number in case this README is outdated.
27
28
 
28
29
 
29
30
  ## Usage
30
31
 
31
-
32
32
  ```javascript
33
33
  import { tex2typst, typst2tex } from 'tex2typst';
34
34
 
35
35
  let tex = "e \overset{\text{def}}{=} \lim_{{n \to \infty}} \left(1 + \frac{1}{n}\right)^n";
36
36
  let typst = tex2typst(tex);
37
37
  console.log(typst);
38
- // e eq.def lim_(n arrow.r infinity)(1 + frac(1, n))^n
38
+ // e eq.def lim_(n arrow.r infinity)(1 + 1/n)^n
39
39
 
40
40
  let tex_recovered = typst2tex(typst);
41
41
  console.log(tex_recovered);
@@ -44,6 +44,8 @@ console.log(tex_recovered);
44
44
 
45
45
  If you are using the library in a web page via a `<script>` tag, you don't need the line of `import`, function `tex2typst` and `typst2tex` should be available in the global scope.
46
46
 
47
+ tex2typst.js supports some advanced options to customize the conversion. For more details, please refer to the [API Reference](docs/api-reference.md).
48
+
47
49
  ## Open-source license
48
50
 
49
51
  GPL v3. See [LICENSE](LICENSE) for details.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Tex2TypstOptions } from "./types";
1
+ import type { Tex2TypstOptions } from "./types";
2
2
  import { symbolMap } from "./map";
3
3
  export declare function tex2typst(tex: string, options?: Tex2TypstOptions): string;
4
4
  export declare function typst2tex(typst: string): string;