Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions M2/Macaulay2/m2/latex.m2
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,14 @@ texMathMutable :=
texMath MutableList := L -> concatenate(texMath class L, "\\left\\{", if #L > 0 then "\\ldots "|#L|"\\ldots" else "\\,", "\\right\\}")

texMath HashTable := H -> (
if isMutable H then texMathMutable H
else texMath class H | texMath apply(sortByName pairs H, (k, v) -> k => v)
texMath class H | texMath apply(sortByName pairs H, (k, v) -> k => v)
)

texMath RingFamily :=
texMath Ring := R -> (
if R.?texMath then R.texMath
else if hasAttribute(R, ReverseDictionary) then texMath toString getAttribute(R, ReverseDictionary)
else (lookup(texMath,HashTable)) R -- should never happen
)
texMath MutableHashTable := H -> (
if H.?texMath then H.texMath -- used by some rings, e.g., ZZ, QQ, RR
else if hasAttribute(H, ReverseDictionary)
then texMath toString getAttribute(H, ReverseDictionary)
else texMathMutable H)

texMath Function := f -> texMath toString f

Expand Down
3 changes: 3 additions & 0 deletions M2/Macaulay2/tests/normal/texmath.m2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
assert Equation(
texMath new HashTable,
///\texttt{HashTable}\left\{\,\right\}///)
Loading