diff --git a/M2/Macaulay2/m2/latex.m2 b/M2/Macaulay2/m2/latex.m2 index c8d977eeb2..e890295512 100644 --- a/M2/Macaulay2/m2/latex.m2 +++ b/M2/Macaulay2/m2/latex.m2 @@ -89,7 +89,7 @@ keywordTexMath = applyKeys(hashTable { -- both unary and binary keywords symbol ==> => "\\Longrightarrow ", symbol <== => "\\Longleftarrow ", symbol <==> => "\\Longleftrightarrow ", - symbol _> => "{}_>", + symbol _> => "{}_>", -- temporary solution to KaTeX issue https://github.com/KaTeX/KaTeX/issues/3576 symbol _< => "{}_<", symbol ^> => "{}^>", symbol ^< => "{}^<", @@ -124,10 +124,13 @@ keywordTexMath = applyKeys(hashTable { -- both unary and binary keywords symbol |> => "\\rangle ", symbol | => "\\mid", symbol || => "\\mid\\mid", - symbol ^** => "{}^{\\otimes}", -- temporary solution to KaTeX issue https://github.com/KaTeX/KaTeX/issues/3576 - symbol _* => "{}_*", -- temporary solution to KaTeX issue https://github.com/KaTeX/KaTeX/issues/3576 - symbol ^* => "{}^*", -- temporary solution to KaTeX issue https://github.com/KaTeX/KaTeX/issues/3576 --- symbol ยท => "\\cdot", + symbol ^** => "{}^{\\otimes}", + symbol _* => "{}_*", + symbol ^* => "{}^*", + symbol ^<= => "{}^{\\le}", + symbol ^>= => "{}^{\\ge}", + symbol _<= => "{}_{\\le}", + symbol _>= => "{}_{\\ge}" },symbolBody) bbLetters := set characters "kABCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -143,7 +146,9 @@ texMathLiteralTable := merge(texLiteralTable, "๐”ด" => "\\mathfrak{w}","๐”ต" => "\\mathfrak{x}","๐”ถ" => "\\mathfrak{y}","๐”ท" => "\\mathfrak{z}","๐”„" => "\\mathfrak{A}","๐”…" => "\\mathfrak{B}","๐”†" => "\\mathfrak{C}","๐”‡" => "\\mathfrak{D}","๐”ˆ" => "\\mathfrak{E}","๐”‰" => "\\mathfrak{F}","๐”Š" => "\\mathfrak{G}", "๐”‹" => "\\mathfrak{H}","๐”Œ" => "\\mathfrak{I}","๐”" => "\\mathfrak{J}","๐”Ž" => "\\mathfrak{K}","๐”" => "\\mathfrak{L}","๐”" => "\\mathfrak{M}","๐”‘" => "\\mathfrak{N}","๐”’" => "\\mathfrak{O}","๐”“" => "\\mathfrak{P}","๐””" => "\\mathfrak{Q}","๐”•" => "\\mathfrak{R}", "๐”–" => "\\mathfrak{S}","๐”—" => "\\mathfrak{T}","๐”˜" => "\\mathfrak{U}","๐”™" => "\\mathfrak{V}","๐”š" => "\\mathfrak{W}","๐”›" => "\\mathfrak{X}","๐”œ" => "\\mathfrak{Y}","๐”" => "\\mathfrak{Z}", - "ร—" => "\\times", "รท" => "\\div", "ยฑ" => "\\pm", + "ร—" => "\\times", "รท" => "\\div", "ยฑ" => "\\pm", "โŠ " => "\\boxtimes", + "ยท" => "\\cdot", "โ‹ฏ" => "\\cdots", "โ‹ฑ" => "\\ddots", "โ‹ฎ" => "\\vdots", "โ€ฆ" => "\\ldots", + "โ†" => "\\leftarrow", "โ†‘" => "\\uparrow", "โ†’" => "\\rightarrow", "โ†“" => "\\downarrow", "โ†”" => "\\leftrightarrow", "โ†•" => "\\updownarrow", "โ†–" => "\\nwarrow", "โ†—" => "\\nearrow", "โ†˜" => "\\searrow", "โ†™" => "\\swarrow" },last) texMathLiteral = texLiteral1 texMathLiteralTable -- TODO: expand and document this behavior @@ -156,10 +161,8 @@ texVariable := x -> ( if (r := regex(suffixesRegExp, x)) =!= null then return ( r = r#1; "\\" | substring(r, x) | "{" | texVariable substring(x, 0, r#0) | "}"); if #x === 1 or regex("[^[:alnum:]]", x) =!= null then x else "\\mathit{" | x | "}") -texMathSymbol := -texMath Symbol := texVariable @@ texMathLiteral @@ toString -texMath Keyword := texMath @@ symbolBody -texMath SymbolBody := s -> if keywordTexMath#?s then keywordTexMath#s else texMathSymbol s +texMath Symbol := texMath @@ symbolBody +texMath SymbolBody := s -> if keywordTexMath#?s then keywordTexMath#s else texVariable texMathLiteral toString s -- add augmented operators removeLast := s -> substring(s,0,#s-1)