support for arabic inside latex
im facing issue rendering arabic latex , any work arounds ?
Try the latest version flutter_tex: ^5.0.1 and use the newly introduced widget TeXWidget (see example). It's not based on webview, so I hope you can use inline Arabic.
What worked for me is to wrap the content within the TeXViewDocument's body string with an HTML div using dir="rtl" and applying CSS to preserve whitespace and newlines. Example:
<style>
.preserve-lines {
white-space: pre-wrap; /* Preserves whitespace & newlines, wraps text */
/* Or: white-space: pre-line; // Collapses multiple spaces, preserves newlines & wraps */
}
</style>
<div dir="rtl" class="preserve-lines">
هذا mix بين \(\left( u_{n} \right)\) عربية and أخرى english.
لتكن \(\left( u_{n} \right)\) متتالية عددية.
\[u_{n + 1} = \frac{1}{2}u_{n} + 1\]
</div>
Pass this HTML string as the body to a TeXViewDocument. The dir="rtl" handles the text direction, and white-space: pre-wrap; (or pre-line;) ensures Arabic text formatting and line breaks are respected around the inline math.
This setup allowed mixed English, Arabic, inline math, and display math to render correctly.