Skip to content

Commit

Permalink
add rule \colon -> : (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwinsi committed Jan 15, 2025
1 parent 353848f commit a9f3b8e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tex2typst",
"version": "0.2.14",
"version": "0.2.15",
"description": "JavaScript library for converting TeX code to Typst",
"type": "module",
"main": "dist/index.js",
Expand Down
2 changes: 2 additions & 0 deletions src/writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,8 @@ function convertToken(token: string): string {
} else if (token === '\\|') {
// \| in LaTeX is double vertical bar looks like ||
return 'parallel';
} else if (token === '\\colon') {
return ':';
} else if (token === '\\\\') {
return '\\';
} else if (['\\$', '\\#', '\\&', '\\_'].includes(token)) {
Expand Down
2 changes: 1 addition & 1 deletion test/cheat-sheet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ cdots = "dots.c"
checkmark = "checkmark"
chi = "chi"
circ = "circle.small" # 'circle.small' or 'compose'
colon = "colon"
# colon = "colon"
cong = "tilde.equiv"
coprod = "product.co"
copyright = "copyright"
Expand Down
5 changes: 4 additions & 1 deletion test/math.yml
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,7 @@ cases:
c + d
typst: |-
a + b \
c + d
c + d
- title: colon
tex: a\colon b
typst: "a : b"

0 comments on commit a9f3b8e

Please sign in to comment.