Closed jbezos closed 1 year ago
as shown starting from here https://github.com/michal-h21/linebreaker/issues/7#issuecomment-1469845271the false/broken alignments also occur, even
multicol
andlinebreaker
package (this was the first place documenting the issue)simply using basic \twocolumn
@hpvd Thank you for the pointer, but please report babel
bugs when you find them or mention me in the original issue so that I can join the conversation.
....please report
babel
bugs when you find them or mention me in the original issue so that I can join the conversation.
sure, we weren't aware that's a babel issue yet. First we looked for linebreaker, then multicol, then the font and now babel :-)
Or even a combination of all tree 🙂. There is clearly a bug in babel
, but the misalignment of the last line is, I think, an issue in linebreaker
. I must investigate, but I wonder if linebreaker
makes any sense in unhyphenated languages, with different justification methods.
When enhancing babel testing / compatibility even further, maybe it's a good idea not only take https://ctan.org/pkg/linebreaker into account, but also directly https://ctan.org/pkg/lua-widow-control
both
@michal-h21 could locate and solve an issue in linebreaker package:
I've found the source of the issue with Linebreaker. It didn't pass the parameters table (which contained the info about pardir) to the line-breaking function when there was an overfull line in the paragraph. This is the reason why it was so random and why it happened with shorter line widths. The last update should fix that.
see: https://github.com/michal-h21/linebreaker/issues/7#issuecomment-1476246888
just a simple example to reproduce the issue: (linebreaker disabled, so only lipsum and babel package and 2 fonts activ) lualatex, Miktex, windows
This is LuaHBTeX, Version 1.16.0 (MiKTeX 23.1)
=> you only have to change:
\lipsum[1-4]
to\lipsum[1-5]
in the following code to make it visible:
with \lipsum[1-5]
the first page looks empty, and if you select the (invisible) content in the pdf, it looks strange
\documentclass[12pt,a4paper]{book}
%\usepackage{linebreaker}
\usepackage{lipsum}
\usepackage[bidi = basic]{babel}
\babelprovide[main, import]{english}
\babelprovide[import]{arabic}
\babelfont[english]{rm}{EB Garamond}
\babelfont[arabic]{rm}{Amiri}
\begin{document}
\twocolumn
\lipsum[1-4]
\begin{otherlanguage}{arabic}
لكن لا بد أن أوضح لك أن كل هذه الأفكار المغلوطة حول استنكار النشوة وتمجيد الألم
نشأت بالفعل، وسأعرض لك التفاصيل لتكتشف حقيقة وأساس تلك السعادة البشرية، فلا أحد
يرفض أو يكره أو يتجنب الشعور بالسعادة، ولكن بفضل هؤلاء الأشخاص الذين لا يدركون بأن
السعادة لا بد أن نستشعرها بصورة أكثر عقلانية ومنطقية فيعرضهم هذا لمواجهة الظروف
الأليمة، وأكرر بأنه لا يوجد من يرغب في الحب ونيل المنال ويتلذذ بالآلام، الألم هو الألم
ولكن نتيجة لظروف ما قد تكمن السعاده فيما نتحمله من كد وأسي.
\end{otherlanguage}
\end{document}
many thanks for this quick fix!
@amarakon confirmed everything works as expected now, see https://github.com/michal-h21/linebreaker/issues/7#issuecomment-1478555439
btw: would be great to release a new version of babel at ctan...
@jbezos there seems to be a remaining issue please see https://github.com/michal-h21/linebreaker/issues/7#issuecomment-1478635488
@hpvd I release a new version every 3 weeks, more or less, but when TeXLive is released I usually make a little pause. Very likely next week.
From https://tex.stackexchange.com/questions/680079/some-fonts-do-not-work-properly-with-multicols-and-babel.
The MWE (with a couple of minimal changes) is.
It seems
twocolumn
is preventingbabel
from adjusting the correct\pagedir
or\bodydir
(not yet sure).Workaround. Remove the par.
Note. The original example also included
linebreaker
. There is also some incompatibility with it, and I’m not sure this package works with RTL text.