-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Wrong direction in bidirectional documents #7
Comments
This seems a bit strange. When Lineberak breaks this paragraph:
it is marked in Anyway, when I add a paragraph end inside
|
Unfortunately, this workaround doesn't work within a \documentclass{book}
\usepackage{linebreaker}
\usepackage{lipsum}
\usepackage{multicol}
\usepackage[bidi = basic]{babel}
\babelprovide[main, import]{english}
\babelprovide[import]{arabic}
\babelfont[english]{rm}{EB Garamond}
\babelfont[arabic]{rm}{Amiri}
\begin{document}
\begin{multicols}{2}
\lipsum[1-6]
\begin{otherlanguage}{arabic}
لكن لا بد أن أوضح لك أن كل هذه الأفكار المغلوطة حول استنكار النشوة وتمجيد الألم
نشأت بالفعل، وسأعرض لك التفاصيل لتكتشف حقيقة وأساس تلك السعادة البشرية، فلا أحد
يرفض أو يكره أو يتجنب الشعور بالسعادة، ولكن بفضل هؤلاء الأشخاص الذين لا يدركون بأن
السعادة لا بد أن نستشعرها بصورة أكثر عقلانية ومنطقية فيعرضهم هذا لمواجهة الظروف
الأليمة، وأكرر بأنه لا يوجد من يرغب في الحب ونيل المنال ويتلذذ بالآلام، الألم هو الألم
ولكن نتيجة لظروف ما قد تكمن السعاده فيما نتحمله من كد وأسي.
\end{otherlanguage}
\end{multicols}
\end{document} If you uncomment the line |
Ah, that will need further investigation. Unfortunately, I received a bit too many bug reports this week, so it can take some time before I will have the capacity to do that :/ |
Sure, no rush. |
I've tried your Multicols MWE, and it seems that it produces this wrong result even if I remove Linebreaker altogether. Maybe it is rather bug in Multicols, or in Babel? |
You’re right, the bug still happens without |
just gave it a few tries... when using basic enabling/disabling
|
just to verify that not the automatic pagebreak makes the difference: |
hmm if you add another lipsum after the arabic part, strange things happen even without linebreaker package
|
Here is even more strange test. The alignment of the last line seems to be pretty random:
|
to help on this topic, @amarakon started a discussion on tex.stackexchange.com |
there seems to be a babel issue too, but possibly several things come together:
|
I've found the source of the issue with Linebreaker. It didn't pass the parameters table (which contained the info about |
awesome! many thanks! |
Me too. I tested it and the paragraph direction is now correct. There is still the other issue of the whole text being shifted way far to the left until the last page. |
great, since the still existing issue seems to be a babel bug this one may be closed. (with the option to reopen, if the upcoming babel fix will not solve it completely) |
Thanks for noticing. It seems that I didn't push tags from my other computer. I've fixed another issue regarding the debug print, and updated CTAN. I hope I can close this issue now :) |
there was already a fix implemented in babel and the issue was closed, see could you @amarakon and @michal-h21 confirm, that this (latest linebreaker plus latest babel) make it work for you? |
hmm adding \listfiles to tex file shows that I'm not using the latest babel version I have just installed. |
I can confirm that I am seeing the expected result. Are you using the latest babel version from CTAN? I think you have to clone and install it manually from GitHub. |
@amarakon that's great to hear :-) |
Actually I realized I did not have |
@amarakon are you using latest linebreaker and checked with \listfiles comment at the beginning of the tex file the outputted package versions in the logfile? Maybe you can post your
If both packages are used in latest version, we have to reopen here. |
Testing Code\documentclass{book}
\usepackage{linebreaker}
\usepackage[bidi = basic]{babel}
\babelprovide[main, import]{english}
\babelprovide[import]{arabic}
\babelfont[english]{rm}{EB Garamond}
\babelfont[arabic]{rm}{Amiri}
\begin{document}
\begin{otherlanguage}{arabic}
لكن لا بد أن أوضح لك أن كل هذه الأفكار المغلوطة حول استنكار النشوة وتمجيد الألم
نشأت بالفعل، وسأعرض لك التفاصيل لتكتشف حقيقة وأساس تلك السعادة البشرية، فلا أحد
يرفض أو يكره أو يتجنب الشعور بالسعادة، ولكن بفضل هؤلاء الأشخاص الذين لا يدركون بأن
السعادة لا بد أن نستشعرها بصورة أكثر عقلانية ومنطقية فيعرضهم هذا لمواجهة الظروف
الأليمة، وأكرر بأنه لا يوجد من يرغب في الحب ونيل المنال ويتلذذ بالآلام، الألم هو الألم
ولكن نتيجة لظروف ما قد تكمن السعاده فيما نتحمله من كد وأسي.
\end{otherlanguage}
\end{document} ResultFile List
|
This is again the issue that we don't get the right paragraph direction in this case, you get the direction of the surrounding text, which is left to right. I don't think that there is a solution for this issue, other than explicit paragraph end before |
@michal-h21 btw linebreaker package seems not to have the meta information included used by listfiles command, like exact version and date |
If so, couldn't/shouldn't this be done automatically by babel? Do you understand the latest changes by babel? |
The latest change in Babel solves just the multicolumn issue, I think. The problem here is that the |
can confirm latest babel solved the multicolumn issue |
...but there seems to be another edgecase which produce problems when enabling linebreaker. |
In issue #6, I mentioned how Arabic documents look wrong when using this package. This was fixed shortly after. However, a problem still persists. In bilingual documents where one language is left-to-right and the other language is right-to-left, both cannot work at the same time. If my main language is English and my secondary language is Arabic, the bottom line of the Arabic paragraph will be aligned to the left, when it should be aligned to the right. Similarly, if my main language is Arabic and my secondary language is English, the Arabic paragraph will be rendered correctly but the bottom line of the English paragraph will be aligned to the right instead of the left. Below, I have provided two minimum working examples that demonstrate this, along with the expected behaviour that happens when I don't load the
linebreaker
package.Expected result
The text was updated successfully, but these errors were encountered: