[Dev-luatex] LuaTeX doesn't discard empty paragraphs when textdir is used

Hans Hagen j.hagen at xs4all.nl
Thu Jul 29 14:21:01 CEST 2021


On 7/29/2021 9:54 AM, luigi scarso wrote:
> 
> 
> On Mon, Jun 21, 2021 at 5:03 PM Marcel Krüger <tex at 2krueger.de 
> <mailto:tex at 2krueger.de>> wrote:
> 
>     Hi,
> 
>     consider the following plain LuaTeX document:
> 
>     \textdir TRT
>     \noindent\par
>     \bye
> 
>     without the `\textdir TRT` line or with `\textdir TLT`, this would lead
>     to "warning  (pdf backend): no pages of output.", but with the non
>     default "\textdir", it creates an empty (except for the page number)
>     page
>     instead.
> 
>     This can be avoided by setting \pardir too:
> 
>     \textdir TRT\pardir TRT
>     \noindent\par
>     \bye
> 
>     again produces no output, but adding a group around it reintroduces the
>     issue:
> 
>     \begingroup
>     \textdir TRT\pardir TRT
>     \noindent\par
>     \endgroup
>     \bye
> 
>     leads to an empty page.
> 
>     Of course similar things happen not only for otherwise empty documents:
>     Instead of empty paragraphs disappearing, they add empty lines.
> 
>     Together, this is not only inconsistent with other engines which always
>     discard empty paragraphs, but also leads to hard to predict behavior
>     (especially for users who are not familiar with the implementation of
>     LuaTeX's directional system), so I think it would be great if LuaTeX
>     could always remove such empty paragraphs.
> 
> 
> (sorry for the delay)
> Do you have  a patch to propose  ?
it's a side effect of the direction handler picking up states ... kind 
of tricky code but i can probably come up with a fix (maybe under 
parameter control)

(of course normally a macro package will catch these kind of things if 
needed)

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the dev-luatex mailing list