[luatex] The effect of \pardir and \textdir on \indent and \parfillskip

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Dec 12 10:03:26 CET 2012


Hello all,

Continuing my attempts to understand RTL primitives in LuaTeX, I've come
across what I'd regard as unexpected behaviour in terms of the
relationship between \textdir and \pardir.

For example, in the demo

  \newbox\mybox
  \parskip 1 em %

  Hello world Hello world Hello world Hello world Hello world
  Hello world Hello world Hello world Hello world Hello world
  Hello world Hello world Hello world Hello world Hello world
  Hello world Hello world Hello world Hello world Hello world
  Hello world Hello world Hello world Hello world Hello world

  \pardir TRT
  Hello world Hello world Hello world Hello world Hello world
  Hello world Hello world Hello world Hello world Hello world
  Hello world Hello world Hello world Hello world Hello world
  Hello world Hello world Hello world Hello world Hello world
  Hello world Hello world Hello world Hello world Hello world

  \leavevmode
  \setbox\mybox=\lastbox
  \textdir TRT\box\mybox\textdir TLT
  Hello world Hello world Hello world Hello world Hello world
  Hello world Hello world Hello world Hello world Hello world
  Hello world Hello world Hello world Hello world Hello world
  Hello world Hello world Hello world Hello world Hello world
  Hello world Hello world Hello world Hello world Hello world

  \bye

I find it surprising that the middle paragraph has the \indent on the
left, and that it's necessary to alter the text direction to get it on
the right.

How do others see this: is the current behaviour 'expected', and more
importantly is it useful? (OK, most of the time \pardir and \textdir
will agree on direction, but my reading of the primitive names was that
they are intended to separate out the run of the text and the shape of
the paragraph.)
-- 
Joseph Wright


More information about the luatex mailing list