On 7/10/2016 2:19 AM, Idris Samawi Hamid ادريس سماوي حامد wrote:
On Fri, 08 Jul 2016 10:55:36 -0600, Hans Hagen
wrote: On 7/8/2016 6:48 PM, Javier Bezos wrote:
Hans,
> Sure. Compare the behaviour of \leftskip and \parshape. > IMO, they should be the same.
Well, after thinking a little more about this I'm not so sure.
But same problem with \hangindent. This is easier to catch (just change the sign), but it would be nice if its behaviour is mirrored like \parindent, \leftskip, etc. I think LuaTeX must overcome the limitations of the XeT-TeX bidi model.
changing such things now will break existing code
I know, but not changing it breaks also existing code for bidi texts, except if we modify lots of things, which is an overkill (and very likely the code will end up with many hacks). And after all, 0.95 also broke existing code. I think not adding now a proper bidi model is a missed opportunity and in the years to come very likely we'll speak of a "long standing bug" in the bidi behavior of \hangindent. It's MHO.
Well, if one looks at it from the point of viuew of the par builder where left/right skips are kind of global and applied later to the broken lines, then it's not a bug but a choice.
Since Hans is adding support for more mirroring options, I suppose the following is moot. In any case, I played around with this today. It seems that \parshape and \hangindent are interpreted so as to assume a global coordinate system for the page, i.e., beyond the paragraph level.
After thinking about this global-page vs local-paragraph distinction, went back and found the old Omega documentation: There were two other primitives
\pardirHR \pardirLR
(which were later expunged from luatex).
I suspect that \parshape and \hangindent were mirrored with \pardirHR invoked. If so, then the current issue raised by Javier is a residue of the old Omega/Aleph model: Dropping \pardirHR \pardirLR left an ambiguity.
i can imagine a real mess with using them .. it definitely assumes macro package level support for consistency (and what if different mechanisms want different pdfdirs); storing some state in the pardir node will not help here
If the above analysis is correct, we should ask: What other primitives if any (besides \parshape and \hangindent) did the Omega/Aleph bidi model treat at the \pardirHR \pardirLR level?
with parindent we can imagine a key but not with hangindent
I think Hans' point (philosophy?) is that the macropackage should handle things at the page/coordinate-system level. Perhaps that had something to do with dropping \pardirHR \pardirLR in the first place?
Indeed, as the document layout is kind of independent of the writing direction. In fact one can even dispute the left|right skip but those skips are added later (in fact, in context i have places where i do quite some juggling to get around it but that's beyond this discussion)
A related point is that luatex is explicitly designed for extensibility of, e.g, primitives via lua, so there should also be a straightforward way for experts to implement the desired low-level behavior. For example, something along the lines of \pardirHR \pardirLR could be reimplemented in lua. That *might* be a better approach than the mirroring Javier requested and which Hans has agreed to do; especially if there is additional residue out there of more primitives that need this kind of treatment.
hm, that make me think that we can reset \shapemode after each paragraph, like hangindent and parshape are .. let me think about that as it makes much sense
Again, the question may be moot now, but that's my 2 cents (perhaps 1 cent).
Best wishes Idris
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------