Skip to content

Commit dcc2421

Browse files
committed
Fix recursion error in texMath(HashTable)
Replace texMath(Ring) with more general texMath(MutableHashTable)
1 parent b7a9a12 commit dcc2421

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

M2/Macaulay2/m2/latex.m2

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,14 @@ texMathMutable :=
197197
texMath MutableList := L -> concatenate(texMath class L, "\\left\\{", if #L > 0 then "\\ldots "|#L|"\\ldots" else "\\,", "\\right\\}")
198198
199199
texMath HashTable := H -> (
200-
if isMutable H then texMathMutable H
201-
else texMath class H | texMath apply(sortByName pairs H, (k, v) -> k => v)
200+
texMath class H | texMath apply(sortByName pairs H, (k, v) -> k => v)
202201
)
203202
204-
texMath RingFamily :=
205-
texMath Ring := R -> (
206-
if R.?texMath then R.texMath
207-
else if hasAttribute(R, ReverseDictionary) then texMath toString getAttribute(R, ReverseDictionary)
208-
else (lookup(texMath,HashTable)) R -- should never happen
209-
)
203+
texMath MutableHashTable := H -> (
204+
if H.?texMath then H.texMath -- used by some rings, e.g., ZZ, QQ, RR
205+
else if hasAttribute(H, ReverseDictionary)
206+
then texMath toString getAttribute(H, ReverseDictionary)
207+
else texMathMutable H)
210208
211209
texMath Function := f -> texMath toString f
212210
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
assert Equation(
2+
texMath new HashTable,
3+
///\texttt{HashTable}\left\{\,\right\}///)

0 commit comments

Comments
 (0)