gpt-4x use to output code and latex in such formats that they could be formatted via syntax highlighting libraries, because they used markdown format standards that most text highlighting libraries can understand.
Now gpt-5 wont output code or equations in such a way, instead, it just writes them out in plain text. You can make the LLM generate code and latex in the correct formats by prompting it. But can you do it programmatically from the API call?
Unfortunately there is no “turn off the system message prompt that OpenAI is adding to make gpt-5 not write markdown” API parameter. And no response to a demand to desist.