I am trying to find out how to have Kashida justification in Luatex (in TexLive) for bidi text.


  • I can see by searching that support might appear in babel here but nothing implemented yet.
  • In Xetex (bidi or xeperisan ?), Kashida justification is implemented by \XetexInterCharToks, using \hrule but not the glyph ( which was visually problematic in letter joints).
  • Using (stretching) the Kashida glyph directly or applying the new variable fonts feature are the two alternatives.
  • I also noticed that \XetexInterCharToks can be implemented in Luatex in someway here.
  • Previously, I asked about finding the width of glue space between chars here.
  • No idea, if harfbuzz implementation (any support for Kashida ?) can be related. Harfbuzz can be used through luahbtex here

Edit (About Kashida):

Kashida (from keshideh which means "stretched" in Persian) is a dash-like justification that can be added between (actually to the end of the first letter) some letters in Arabic/Persian/Urdu scripts (and probably Hebrew see here). Its Unicode character is (U+0640), also known as Arabic Tatweel.

It has two functionalities:

  1. aesthetically: more beautiful typesetting and a replacement for white-space justification
  2. It can be used in stressing some words, as a replacement for capital letters or small-caps which do not exist in those scripts.

One can add manually the default character ((U+0640)) as many time as it seems appropriate:


However, (1) any use of Kashida letter might create problem when searching for a word, and (2), the right amount of width of Keshida is not a proper multiple of the default width of it in a font. Therefore, a right solution might be to use variable fonts technology. This also can fix another problem that Kashida is not always a stretchable dash but it can be/should be a stretchable curve part of a glyph.

  • 2
    You can't implement \XetexInterCharToks in LuaTeX like this anymore because the token_filter callback is gone. Commented Dec 11, 2019 at 6:35
  • 1
    in luatex rather than using interchar tokens and two runs to see the stretched glue you could probably do it in one pass by adjusting a glue node in the post linebreak callback Commented Dec 11, 2019 at 7:50
  • 1
    for harfbuzz you probably want to watch this issue github.com/harfbuzz/harfbuzz/issues/586 Commented Dec 11, 2019 at 7:53
  • 1
    What is Kashida? I can guess from your question that it has something to do with spaces but the rules are unclear. Commented Dec 11, 2019 at 7:55
  • 1
    @UlrikeFischer stretchy line-y character thing that can stretch to avoid stretching space. en.wikipedia.org/wiki/Kashida Commented Dec 11, 2019 at 7:57

1 Answer 1


You can use TeXNegar package.

From the User Documentation of the package:

The TEXNegar package implements kashida justification in LuaTeX and XeTeX and fixes known bugs in xepersian.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .