ChatKit and latex equations

Hi, is there a way to make chatkit render latex equations? I could not figure that out.
I am using AgentBuilder. My agent outputs a JSON schema

{

“message: some text with latex equations“

“boolean”: some boolean that shows the message was complete

}

I output this via a wifget that parses and displays only the message. However, latex does not render.

Thanks,

L

1 Like

What engine version Live TeX 2024 or this new one 2025?

Is it, like, the pure display mode stuff or you have it inline along with some theory (and in that case you prolly have fontspec package included, as well)..?

What compiler do you use, something like xetex or lualatex?

Albeit having almost no insight into your thing - if you haven’t already, adapt your preamble and workflow for the STIX2Math OpenType and fully unicode.

Whatever issues you have with equations properly being transcoded trough JSON you will probably be able to solve this way - trust me it’s the future of math in LaTeX :

%—————- right after you open with “\documentclass{article}” you slam the majestic, lustrous, holy upon holies:

\usepackage{amsmath}

%—————- you keep your dear hyperref and fontspec, and then you include the final holy trinity

\usepackage{unicode-math}

\usepackage{hologo}

\usepackage{graphicx}

%—————- then a small STIX2 catch - you now open normally, however it’s totally out of place the way you define them STIX2/OpenType math fonts, it is schizophrenic and I’m positive that whoever is behind this abomination has had his or her Thorazine missed.

\begin{document}

\setmathfont{STIX2Math}[

Extension={.otf},

Path=./STIX2fonts/,

Scale=1]

(??!!!)

I just deployed the starter app for Chat Kit that OpenAI made available. I did not change any imports or packages. I don’t work with front-end, so I am struggling.

My agent workflow answers some equations. For example, if I ask what is Baye’s

theorem?

Here is a print of the answer after I run the GitHub clone repo for chat kit and the answer inside Agent Builder. (image attached)

I don’t need the agent to output LaTeX necessarily. It can be

any other thing that renders in the chat in a good visual way.

My agent has the following as part of the instructions:

# Tone and Style

- Warm and encouraging.

- Promote good math habits: define variables, visualize when possible, and walk through logic slowly.

- Always write all equations, mathematical expressions, and math-related notation in LaTeX.