How to get the timing of Shiny Chat’s equation display right?
The code below is for a chatbot designed to format equations nicely in LaTeX. However, there’s an issue where the equations in the current response are not LaTeX formatted, while the preceding response is correctly formatted as expected. In other words, request 1 returns a well-formatted response after I submit request 2, and the formatting for request 2 is achieved only after the submission of request 3.