Request to Fix KaTeX Rendering Issues for RTL Languages

I want to bring to your attention an issue regarding the rendering of mathematical equations in right-to-left (RTL) languages such as Hebrew and Arabic.

Issue Description:

When writing mathematical equations inside ChatGPT in an RTL language, the KaTeX-rendered expressions inherit the directionality of the surrounding text. This results in misaligned, hard-to-read equations. For example, an equation like:

plaintext

CopyEdit

F = m ⋅ a

May appear incorrectly formatted when written within an RTL context.

Proposed Solution:

To resolve this issue, I suggest adding the following CSS rule globally to enforce left-to-right (LTR) alignment for KaTeX-rendered equations:

css

CopyEdit

.katex-display>.katex>.katex-html {
    direction: ltr;
}

This simple change ensures that all mathematical expressions are consistently left-aligned, maintaining their correct formatting regardless of the surrounding text direction.

Why This Matters:

:heavy_check_mark: Improves readability – Equations are displayed as intended, preventing distortion.
:heavy_check_mark: Enhances accessibility – RTL users (students, professionals, researchers) can use ChatGPT without formatting issues.
:heavy_check_mark: Minimal implementation effort – A simple CSS tweak solves the problem without requiring backend modifications.

Would it be possible to integrate this fix into the default rendering behavior of ChatGPT? This adjustment would significantly enhance usability for RTL language users, making mathematical equations clear and accurate.

Thank you for your time and consideration! I look forward to your response.

Best regards,
Tomer