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

Ulrike Fischer luatex at nililand.de
Wed Dec 12 18:56:23 CET 2012


Am Wed, 12 Dec 2012 17:00:16 +0000 schrieb Joseph Wright:

> On 12/12/2012 16:50, Ulrike Fischer wrote:
>>>  What I found odd was that I'd view the \indent as
>>> a part of the 'shape within a paragraph', in the same way that say
>>> \rightskip is (used to alter what happens *within* any 'outer' \parshape
>>> or \hangindent). However, it's treated as part of the text itself, not
>>> the shaping. 
>> 
>> I now see what you mean. I personally do find it quite natural, that
>> \parindent is "attached" to the first word of the paragraph. 
> 
> That's what I'm trying to find out: how other people see this.

Well I'm not qualified to say something definitive about
bidirectional text. I do find the idea of text changing its
direction quite bewildering. Last time I got involved (when trying
to analyze a xetex bug) I had to fight against hebrew chars suddenly
writing in the wrong direction ;-). 

But as you wrote about "shape" I tried \parshape + hangindent: It
doesn't change the side either -- even with \textdir. And this I do
find inconsequent. Why does \parindent move with \textdir but not
the shape defined with \parshape? 

\documentclass{article}


\directlua {
tex.enableprimitives('',{'pagedir','bodydir','pardir','textdir','mathdir'})
}
\begin{document}
\parindent=2cm
\parshape= 5 1cm 5cm 1cm 4cm 1cm 3cm 1cm 4cm 1cm 5cm
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

\hrule

\parindent=0cm\hangindent2cm\hangafter=-2
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

\hrule

\pardir TRT \textdir TRT
\parindent=2cm
\parshape= 5 1cm 5cm 1cm 4cm 1cm 3cm 1cm 4cm 1cm 5cm
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

\hrule

\parindent=0cm\hangindent2cm\hangafter=-2
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
\end{document}

-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/



More information about the luatex mailing list