Are there any LaTeX commands provided either by LaTeX, or by the article class, or by the babel package, or by the luatex engine, or else by some other babel+luatex compatible package, that enable a piece of LaTeX code to dynamically determine answers to the following questions:
Is the text flow at the current location directed from left to right as in English, or from right to left as in Hebrew?
Is the text flow of the current paragraph directed from left to right or from right to left? (This would be different than the answer to the 1st question when the current location is inside a short Hebrew quote embedded in an English paragraph.)
Does the text flow of the main language at the current location have a left to right directionality or a right to left directionality? (This would be different than the answer to the 2nd question when the current location is inside a Hebrew paragraph that is embedded in an otherwise English text.)
I'm especially interested in the first of these questions.
bidithere are two conditionals just for that.\if@RTLis true inside RTL mode and false outside.\if@RTLmainis true if the main direction of the document is RTL, otherwise false – Udi Fogiel Dec 31 '22 at 09:56bidiis notbabel+luatexcompatible. – Evan Aad Dec 31 '22 at 10:03\the\textdiror\showthe\textdir. – Ulrike Fischer Dec 31 '22 at 11:19\textdirection,\pardirection, etc. The number is 0 for LTR and 1 for RTL. – Udi Fogiel May 27 '23 at 14:49