On Mon, Oct 29, 2018 at 11:21:38PM +0200, Khaled Hosny wrote:
> Hello all,
>
> I’m working on a package that modifies the node list, and I’m working by
> copying the node list one node at a time, doing some modifications
> (possibly adding or dropping some of the nodes). This is working fine so
> far, with one exception:
>
> When setting an RTL paragraph like this:
>
> \begingroup
> \pardir TRT
> \textdir TRT
> text
> \endgroup
>
> The resulting paragraph is not right aligned after my code processes it,
> but properly aligned otherwise. On the other hand, if I drop the
> \{begin,end}group things are fine. Looking closely, there seem to be an
> an +TLT dir node inserted without a closing -TLT one. If I change my
> code to drop that node, things are fine again.
>
> I’m not sure whether this unpaired +TLT node is expected or not, or what
> is wrong with my code that is causing the misalignment. I’m attaching a
> sample file that shows this behaviour, with some commented out code that
> shows that removing the stray dir node fixes things.Here is a slightly updated example moving \pardir outside of the group, since the issue happens with just \textdir inside the group. Also the issue happens when using node.copy_list() as well, not only with manual iterating and copying each node. Regards, Khaled
unpaired-dir.tex
Description: TeX document
