MCPcopy Create free account
hub / github.com/bytedance/Dolphin / aligned_to_array

Function aligned_to_array

utils/markdown_utils.py:29–38  ·  view source on GitHub ↗
(latex: str)

Source from the content-addressed store, hash-verified

27
28
29def aligned_to_array(latex: str) -> str:
30 pattern = re.compile(r"\\begin\{aligned\}(.*?)\\end\{aligned\}", flags=re.DOTALL)
31
32 def repl(match):
33 content = match.group(1).strip()
34 new_content = content.replace("&", "")
35 return f"\\begin{{array}}{{l}}\n{new_content}\n\\end{{array}}"
36
37 converted = pattern.sub(repl, latex)
38 return converted
39
40
41def gathered_to_aligned(latex: str) -> str:

Callers 1

_handle_formulaMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected