Skip to content

Commit 85f8899

Browse files
committed
fix partial
1 parent 09ff7f0 commit 85f8899

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hs-src/Language/Egison/MathOutput.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,15 @@ showMathExprLatex (Atom a []) = a
109109
showMathExprLatex (Atom a xs) = a ++ showMathExprLatexScript xs
110110
showMathExprLatex (Partial f xs) = "\\frac{" ++ convertToPartial (f, length xs) ++ "}{" ++ showPartial xs ++ "}"
111111
where showPartial :: [MathExpr] -> String
112-
showPartial xs = let lx = elemCount xs in convertToPartial (head lx) ++ foldr (\x acc -> " " ++ convertToPartial x ++ acc) "" (tail lx)
112+
showPartial xs = let lx = elemCount xs in convertToPartial2 (head lx) ++ foldr (\x acc -> " " ++ convertToPartial2 x ++ acc) "" (tail lx)
113113

114114
convertToPartial :: (MathExpr, Int) -> String
115115
convertToPartial (x, 1) = "\\partial " ++ showMathExprLatex x
116116
convertToPartial (x, n) = "\\partial^" ++ show n ++ " " ++ showMathExprLatex x
117+
118+
convertToPartial2 :: (MathExpr, Int) -> String
119+
convertToPartial2 (x, 1) = "\\partial " ++ showMathExprLatex x
120+
convertToPartial2 (x, n) = "\\partial " ++ showMathExprLatex x ++ "^" ++ show n
117121
showMathExprLatex (NegativeAtom a) = "-" ++ a
118122
showMathExprLatex (Plus []) = ""
119123
showMathExprLatex (Plus (x:xs)) = showMathExprLatex x ++ showMathExprLatexForPlus xs

0 commit comments

Comments
 (0)