Using Latex in Prompting

Today a participant in my GenAI workshop asked a question about whether the output in ChatGPT response can be in colour. The context was to mark a valid/invalid field conditionally in response.

I had so far not come across this usage. I explored a bit and found that it is indeed possible and one can use Latex for this purpose, as seen in the screenshot.

Colour text is just a basic example. This realisation that one can use Latex in prompts, opens up another range of opportunities in prompting, for me (and I guess for some of you too). Last time when I learned that Markdown can be used in prompting had a similar enhancement in my approach.

I wanted to put the assumption that I made in my last post to test, that Latex could be used for many more situations. The last post was about discovering how Latex can be used for formatting colour conditionally. So, the use case was for output customisation.Can we use Latex to define input?Here’s the prompt I gave to GPT-4 which is basic representation of a math function in Latex.Generate a value table for 1-10 by processing them through the following Latex:

Output in the screenshot attached.


PS: HTML tags for the purpose don’t seem to work. Also, if we ask ChatGPT to generate text in color, it mostly generates HTML tags around the text **after HTML Encoding** which defeats the purpose. May be there is way to use this as well. No success so far.


Leave a comment