Skip to content

Commit

Permalink
Add special handling of the "-" (U+2D) operator so that it generates …
Browse files Browse the repository at this point in the history
…a minus sign (U+2212).
  • Loading branch information
fred-wang committed Sep 21, 2019
1 parent a4a106c commit d27fa18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions generateCharCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def addLaTeXCommands(aCodePoint, aLaTeXCommands):
if len(aCodePoint) == 1:
if aCodePoint[0] == 0x0023:
aLaTeXCommands.append("\\#")
if aCodePoint[0] == 0x0024:
elif aCodePoint[0] == 0x0024:
aLaTeXCommands.append("\\$")
if aCodePoint[0] == 0x0025:
elif aCodePoint[0] == 0x0025:
aLaTeXCommands.append("\\%")
elif aCodePoint[0] == 0x0026:
aLaTeXCommands.append("\\&")
Expand Down Expand Up @@ -175,6 +175,8 @@ def addLaTeXCommands(aCodePoint, aLaTeXCommands):
aLaTeXCommands.append("\\product")
elif aCodePoint[0] == 0x2210:
aLaTeXCommands.append("\\coproduct")
elif aCodePoint[0] == 0x2212:
aLaTeXCommands.append("-")
elif aCodePoint[0] == 0x2216:
aLaTeXCommands.append("\\smallsetminus")
elif aCodePoint[0] == 0x221D:
Expand Down Expand Up @@ -471,9 +473,9 @@ def __str__(self):

if len(codePoint) == 1:

# Skip special chars: { } ^ _ & \\ % $ '.
# Skip special chars: { } - ^ _ & \\ % $ ' . -
if (codePoint[0] in [0x7B, 0x7D, 0x5E, 0x5F, 0x26, 0x5C,
0x25, 0x24, 0x2E, 0x27]):
0x25, 0x24, 0x2E, 0x27, 0x2D]):
continue

# If it is a single char, add it to the appropriate unicode
Expand Down
2 changes: 1 addition & 1 deletion unit-tests.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d27fa18

Please sign in to comment.