def match(cls, responses, targets) -> int:
        """Whether two LaTeX expressions are equal."""
        if not isinstance(responses, str) or not isinstance(targets, str):
            return 0

        tgt_texts, tgt_latex = separate_text_and_latex(targets)
        res_texts, res_latex = separate_text_and_latex(responses)

        res_text_join = "".join(res_texts).replace(",", "")
        tgt_text_join = "".join(tgt_texts).replace(",", "")
        text_match = SimpleStrMatch.match(res_text_join, tgt_text_join)

        res_latex_join = join_latex(res_latex)
        tgt_latex_join = join_latex(tgt_latex)
        latex_match = LatexExprEquality.match(res_latex_join, tgt_latex_join)

        return 1 if text_match and latex_match else 0
Whether two LaTeX expressions are equal.
vlmeval/dataset/utils/megabench/scoring/latex_expr_equality.py