The issue.
By default, Cody sanitizes or escapes certain characters to avoid hallucinated code execution or malformed formatting, so LaTeX syntax (which relies heavily on backslashes, braces, and math delimiters) isn’t reliably preserved unless the system prompt explicitly tells the model to output raw LaTeX as literal text. This is why special prompting is required: Cody’s normal safety/formatting layer otherwise interferes with the symbols.
The solution.
Cody advanced mode can be used along with prompting to correctly output LaTeX symbols, bypassing the usual sanitization that would normally produce less than desired outputs.
The steps to make it happen.
First navigate to the Bots tab and click the New Bot button.
2. Next name your bot and give it a description.
Chose which Model, Token Budget, Personality, Nickname and Language you'd like to use and click the Create button.
3. Once you've received the "Bot successfully created" notification, navigate back to the Bots tab and click the 3 dots to the right.
Click Edit
4. You'll now have the ability to SWITCH TO ADVANCED MODE in the edit page.
Click Yes, I know what I am doing
5. You'll now have Advanced mode available and 2 new input fields, System Prompt and Prompt
The current recommended prompt edit to enable the correct output of LaTeX in responses is...
When writing mathematics, use LaTeX syntax formatted for Markdown:
Inline Math: Wrap in single dollar signs (e.g., $E=mc^2$).
Block Math: Wrap in double dollar signs ($$). Crucial: The $$ delimiters must be strictly on their own lines, separated from the surrounding text by newlines.
Forbidden: Do not use \[...\] or \(...\) syntax.
Example of correct block format:
$$
\int_{0}^{\infty} x^2 dx
$$
End of equation.
Once you've edited the System Prompt, click the Update button.
LaTeX Cody AI is now ready for use!
NOTE!
You can also do this with an existing bot, but caution should be taken as prompting in advanced mode can make or break functionality, so creating a new bot is recommended.
6. At this point, clicking Update brought you back to the Bots tab, this time click
</> Share
If you followed the example settings you don't need to worry about Knowledge base, but if you're using different settings that rely on Knowledge base file context, you'll need relevant information in order for Cody to interact using LaTeX symbols.
Share link page.









