2

@JavierBezos has added a new feature kashida with version 3.59 of babel which is discribed here https://github.com/latex3/babel/blob/main/news-guides/news/whats-new-in-babel-3.59.md

The problem is I can't find a complete example on how to use the feature, any help is appreciated.

Salim Bou
  • 17,021
  • 2
  • 31
  • 76

1 Answers1

2

I've modified one of the samples in the GitHub repository, but it only works more or less correctly with the development version. The code is in https://github.com/latex3/babel/blob/main/samples/lua-arabic.tex and the resulting pdf in https://github.com/latex3/babel/blob/main/samples/lua-arabic.pdf .

In version 3.60 \hbox’es containing some infinite glue produce weird results, like in heads and foots, and there are still many messages of underfull boxes generated by the internal calculations. There are other things to be sorted out, like vowels or the ‘long’ kaf. Comments and suggestions are welcome.

Hopefully, in version 3.61 or 3.62 it will be useable in real documents.

Here is a short document:

\documentclass{article}

\usepackage[bidi=basic]{babel}

\usepackage{multicol}

\babelprovide[import, main, justification = kashida, transforms = kashida.plain] {arabic}

\babelfont{rm}{FreeSerif}

\begin{document}

\begin{multicols}{4}

سمي النظام بالديكارتي هكذا نسبة إلى الرياضي والفيلسوف الفرنسي ريني ديكارت (كارتيسيوس باللاتينية)، والذي عمل على ادماج الجبر والهندسة الإقليدية. كان هذا العمل حاسما في مجال الهندسة التحليلية ودراسة الدوال والخرائط.

تم تطوير فكرة النظام هذا سنة 1637، في كتابتين مختلفتين لديكارت. في الجزء الثاني من حديث الطريقة، يقدّم ديكارت فكرته الجديدة لتحديد موقع نقطة أو شكل على المستوي، باستعمال محورين متقاطعين كأداة للقياس.

\end{multicols} \end{document}

enter image description here

Javier Bezos
  • 10,003
  • Thanks Javier for the useful feature, as far as I understand, the feature is only applicable to certain types of opentype fonts ? – Salim Bou Jun 07 '21 at 17:19
  • 1
    @SalimBou With heavily ligatured fonts (Amiri), it doesn't make sense, because in these cases justification is achieved by breaking ligatures. This is feasible, but it will take some time. Other fonts insert glyphs to join letters, and they don't work out of the box with the default kashida.plain transform, but it can be fine-tuned to avoid tatweels at these places. (1/2) – Javier Bezos Jun 08 '21 at 12:28
  • The ideal is the JSTF OpenType table, but it doesn't seem very popular and fontspec doesn't even mention it. Well, the JALT table isn't very popular either (see https://tex.stackexchange.com/questions/595220/arabic-fonts-with-justification-alternatives ). (2/2) – Javier Bezos Jun 08 '21 at 12:28