latex3 / babel

The multilingual framework to localize LaTeX, LuaLaTeX and XeLaTeX
https://latex3.github.io/babel/
LaTeX Project Public License v1.3c
130 stars 35 forks source link

Wrong alignment in last line with otherlanguage* in RTL #139

Closed jbezos closed 3 years ago

jbezos commented 3 years ago

See https://tex.stackexchange.com/questions/602684/how-can-i-get-csquotes-and-babel-to-set-a-display-environment-rtl-for-hebrew-or/602689#602689 .


\documentclass{article}

\usepackage[bidi=basic, english]{babel}

\babelprovide[import]{hebrew}

\babelfont[hebrew]{rm}{FreeSerif}

\begin{document}

  % Wrong
  \begin{quotation}
  \begin{otherlanguage*}{hebrew}
      הַדָּבָר אֲשֶׁר־הָיָה אֶל־יִרְמְיָהוּ מֵאֵת יְהוָה בִּשְׁנַת
      [בַּ][שָּׁנָה] הָעֲשִׂרִית לְצִדְקִיָּהוּ מֶלֶךְ יְהוּדָה הִיא
      הַשָּׁנָה שְׁמֹנֶה־עֶשְׂרֵה שָׁנָה לִנְבוּכַדְרֶאצַּר׃
  \end{otherlanguage*}
  \end{quotation}

  %Correct
  \begin{quotation}
  \foreignlanguage*{hebrew}{%
      הַדָּבָר אֲשֶׁר־הָיָה אֶל־יִרְמְיָהוּ מֵאֵת יְהוָה בִּשְׁנַת
      [בַּ][שָּׁנָה] הָעֲשִׂרִית לְצִדְקִיָּהוּ מֶלֶךְ יְהוּדָה הִיא
      הַשָּׁנָה שְׁמֹנֶה־עֶשְׂרֵה שָׁנָה לִנְבוּכַדְרֶאצַּר׃}
  \end{quotation}

\end{document}
``
jbezos commented 3 years ago

Well, I've realized this is in fact the documented behaviour, because otherlanguage* is equivalent to \foreignlanguage which only switch the text direction, not the paragraph one. So, I'll close it.