Rendering LaTeX formulas in Chat Messages — Unique AI Documentation

Rendering LaTeX formulas in Chat Messages

This documentation provides guidelines on how to render LaTeX formulas in chat messages. The chat system supports Markdown, allowing users to include LaTeX formulas by following specific formatting rules.

Who is it for

This feature is designed for:

Benefits

Use Cases

Supported Latex formula syntax

We support LaTeX formulas in the following formats only:

Example: The area is \( \pi r^2 \).

Example:

\[\
    E = mc^2\
\]

Note: Other delimiters such as $...$ or $$...$$ are not supported.

Using with LLMs

If your LLM does not automatically produce the required delimiters, include an instruction in the system prompt such as:

“Render all LaTeX math using \(...\) for inline and \[...\] for block equations. Do not use $...$ or $$...$$.”

You can also reinforce this by adding:

Step-by-Step Guide

To render LaTeX formulas in chat messages, you need to use the LaTeX shorthand syntax for equations. This involves wrapping the formula in escaped square brackets \[...\].

Key Points

  1. Use LaTeX shorthand syntax:
    • Wrap the formula in escaped square brackets \[...\].
  2. Ensure correct LaTeX syntax:
    • Follow standard LaTeX syntax rules within the brackets.

Examples

Here are some examples to illustrate how to format LaTeX formulas in chat messages:

Basic Formula

To include a basic formula, wrap it in escaped square brackets:

\[E = mc^2\]

Complex Formula Example

For more complex formulas, ensure all LaTeX syntax is correctly used within the escaped square brackets:

The integral of a function is given by \[\int_{a}^{b} f(x) \, dx\].

Tips & Tricks

Limitations