From 9db0c39e07509226287ef0075dfda8d2386416ed Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Mon, 13 Jun 2016 18:16:16 +0200 Subject: 2016-06-13 17:04:00 --- doc/context/documents/general/manuals/luatex.pdf | Bin 999551 -> 1007511 bytes .../manuals/luatex/luatex-modifications.tex | 139 ++++++++++++++++++++- .../sources/general/manuals/luatex/luatex.tex | 2 +- 3 files changed, 138 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/context/documents/general/manuals/luatex.pdf b/doc/context/documents/general/manuals/luatex.pdf index b727209ef..e185c7e86 100644 Binary files a/doc/context/documents/general/manuals/luatex.pdf and b/doc/context/documents/general/manuals/luatex.pdf differ diff --git a/doc/context/sources/general/manuals/luatex/luatex-modifications.tex b/doc/context/sources/general/manuals/luatex/luatex-modifications.tex index e59e09e1e..7105330a2 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-modifications.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-modifications.tex @@ -524,7 +524,9 @@ different: \stopsubsection -\startsubsection[reference=backendprimitives,title=The backend primitives \type {\pdf*}] +\stopsection + +\startsection[reference=backendprimitives,title=The backend primitives \type {\pdf*}] In a previous section we mentioned that some \PDFTEX\ primitives were removed and others promoted to core \LUATEX\ primitives. That is only part of the story. In @@ -775,7 +777,140 @@ normally generated by the engine: So, you even need to include the brackets! -\stopsubsection +\stopsection + +\startsection[title=Directions] + +The directional model in \LUATEX\ is inherited from \OMEGA|/|\ALEPH\ but we tried +to improve it a bit. At some point we played with recovery of modes but that was +disabled later on when we found that it interfered with nested directions. That +itself had as side effect that the node list was no longer balanced with respect +to directional nodes which in turn can give side effects when a series of dir +changes happens without grouping. + +The current (0.97 onward) approach is that we again make the list balanced but +try to avoid some side effects. What happens is quite intuitive if we forget +about spaces (turned into glue) but even there what happens makes sense if you +look at it in detail. However that logic makes in|-|group switching kind of +useless when no proper nested grouping is used: switching from right to left +several times nested, results in spacing ending up after each other due to nested +mirroring. Of course a sane macro package will manage this for the user but here +we are discussing the low level dir injection. + +This is what happens: + +\starttyping +\textdir TRT nur {\textdir TLT run \textdir TRT NUR} nur +\stoptyping + +This becomes stepwise: + +\startnarrower +\starttyping +injected: [+TRT]nur {[+TLT]run [+TRT]NUR} nur +balanced: [+TRT]nur {[+TLT]run [-TLT][+TRT]NUR[-TRT]} nur[-TRT] +result : run {RUNrun } run +\stoptyping +\stopnarrower + +And this: + +\starttyping +\textdir TRT nur {nur \textdir TLT run \textdir TRT NUR} nur +\stoptyping + +becomes: + +\startnarrower +\starttyping +injected: [+TRT]nur {nur [+TLT]run [+TRT]NUR} nur +balanced: [+TRT]nur {nur [+TLT]run [-TLT][+TRT]NUR[-TRT]} nur[-TRT] +result : run {run RUNrun } run +\stoptyping +\stopnarrower + +Now, in the following examples watch where we put the braces: + +\startbuffer +\textdir TRT nur {{\textdir TLT run} {\textdir TRT NUR}} nur +\stopbuffer + +\typebuffer + +This becomes: + +\startnarrower +\getbuffer +\stopnarrower + +Compare this to: + +\startbuffer +\textdir TRT nur {{\textdir TLT run }{\textdir TRT NUR}} nur +\stopbuffer + +\typebuffer + +Which renders as: + +\startnarrower +\getbuffer +\stopnarrower + +So how do we deal with the next? + +\startbuffer +\def\ltr{\textdir TLT\relax} +\def\rtl{\textdir TRT\relax} + +run {\rtl nur {\ltr run \rtl NUR \ltr run \rtl NUR} nur} +run {\ltr run {\rtl nur \ltr RUN \rtl nur \ltr RUN} run} +\stopbuffer + +\typebuffer + +It gets typeset as: + +\startnarrower +\startlines +\getbuffer +\stoplines +\stopnarrower + +We could define the two helpers to look back, pick up a skip, remove it and +inject it after the dir node. But that way we loose the subtype information that +for some applications can be handy to be kept as|-|is. This is why we now have a +variant of \type {\textdir} which injects the balanced node before the skip. +Instead of the previous definition we can use: + +\startbuffer[def] +\def\ltr{\linedir TLT\relax} +\def\rtl{\linedir TRT\relax} +\stopbuffer + +\typebuffer[def] + +and this time: + +\startbuffer[txt] +run {\rtl nur {\ltr run \rtl NUR \ltr run \rtl NUR} nur} +run {\ltr run {\rtl nur \ltr RUN \rtl nur \ltr RUN} run} +\stopbuffer + +\typebuffer[txt] + +comes out as a properly spaced: + +\startnarrower +\startlines +\getbuffer[def,txt] +\stoplines +\stopnarrower + +Anything more complex that this, like combination of skips and penalties, or +kerns, should be handled in the input or macro package because there is no way we +can predict the expected behaviour. In fact, the \type {\linedir} is just a +convenience extra which could also have been implemented using node list parsing. \stopsection diff --git a/doc/context/sources/general/manuals/luatex/luatex.tex b/doc/context/sources/general/manuals/luatex/luatex.tex index c997835c5..6bcd1c4e8 100644 --- a/doc/context/sources/general/manuals/luatex/luatex.tex +++ b/doc/context/sources/general/manuals/luatex/luatex.tex @@ -11,7 +11,7 @@ \dontcomplain \startdocument - [version=0.96.0, + [version=0.97.0, status=Pre-release] \component luatex-titlepage -- cgit v1.2.3