kvafa / bidi

Bidirectional typesetting in plain TeX and LaTeX, using XeTeX
https://ctan.org/pkg/bidi
6 stars 1 forks source link

Add automatic direction recognition #3

Open Davoodeh opened 2 years ago

Davoodeh commented 2 years ago

Brief outline of the feature request

Add one or more environment that each use a their own respective method of automatically detecting text direction.

This will greatly improve the UX and noob-friendlyness of LaTeX as a whole alongside the code readability.

Check/indicate

Minimal example

\usepackage{bidi}
\begin{document}

\begin{autodir}{unicode,base=ltr}
This is a bidi text that has a phrase in it like سلام دنیا.
Which would likely be rendered as دنیا سلام if not for this environment.

With this `autodir` environment, the bidi direction will
automatically add the `rl` macro to it before processing.
\end{autodir}

\end{document}