Skip to content

Commit 4170719

Browse files
Omikhleiaalerque
authored andcommitted
fix(math): The (escaped) percent is an ordinary atom in TeX-like syntax
1 parent 81a1be5 commit 4170719

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/math/texlike.lua

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -595,9 +595,6 @@ local function convertTexlike (_, content)
595595
return ret
596596
end
597597

598-
registerCommand("%", {}, function ()
599-
return { "%", command = "mo", options = {} }
600-
end)
601598
registerCommand("mi", { [1] = objType.str }, function (x)
602599
return x
603600
end)
@@ -617,6 +614,7 @@ compileToMathML(
617614
\def{sqrt}{\msqrt{#1}}
618615
\def{bi}{\mi[mathvariant=bold-italic]{#1}}
619616
\def{dsi}{\mi[mathvariant=double-struck]{#1}}
617+
\def{vec}{\mover[accent=true]{#1}{\rightarrow}}
620618
621619
\def{lim}{\mo[movablelimits=true]{lim}}
622620
@@ -691,7 +689,6 @@ compileToMathML(
691689
\def{phantom}{\mphantom{#1}}
692690
\def{hphantom}{\mpadded[height=0, depth=0]{\mphantom{#1}}}
693691
\def{vphantom}{\mpadded[width=0]{\mphantom{#1}}}
694-
%\mphantom[special=v]{#1}}}
695692
]==],
696693
})
697694
)

packages/math/unicode-symbols.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ local function addAlias (symbol, alias)
1919
symbols[symbol] = symbols[alias]
2020
end
2121

22+
-- \% in TeX is the regular ordinary mathpercent symbol (U+0025)
23+
addAlias("%", "mathpercent")
24+
2225
-- Additional TeX-like operators
2326
addAlias("dots", "unicodeellipsis")
2427
addAlias("ldots", "unicodeellipsis")

0 commit comments

Comments
 (0)