Add support for Latex style blocks and inlines for Math

ozkn
Sat, 08 Jun 2024 09:20:47 +0000
Support

artificial intelligence gives answers in latex format. I wrote a prompt to convert this latex format to mathjax format, but the prompt is not always implemented and responds in latex format. When I wrote my problem to the openai community, the following suggestion came.

"I decided it wasn’t even worth the effort of cluttering up a system prompt, when I could just do the following on my end with the results:

    translateLaTex = (val: string): string => {
        if (val.indexOf("\\") == -1) return val;

        return val.replaceAll("\\(", "$")//
            .replaceAll("\\)", "$")//
            .replaceAll("\\[", "$")//
            .replaceAll("\\]", "$");
    }

"
Can you apply this solution in the next update?

8 messaggi - 4 partecipanti