(string)
| 38 | |
| 39 | |
| 40 | def _fix_a_slash_b(string): |
| 41 | if len(string.split("/")) != 2: |
| 42 | return string |
| 43 | a = string.split("/")[0] |
| 44 | b = string.split("/")[1] |
| 45 | try: |
| 46 | if "sqrt" not in a: |
| 47 | a = int(a) |
| 48 | if "sqrt" not in b: |
| 49 | b = int(b) |
| 50 | assert string == "{}/{}".format(a, b) |
| 51 | new_string = "\\frac{" + str(a) + "}{" + str(b) + "}" |
| 52 | return new_string |
| 53 | except: |
| 54 | return string |
| 55 | |
| 56 | |
| 57 | def _fix_sqrt(string): |