diff options
Diffstat (limited to 'Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-modifications.tex')
-rw-r--r-- | Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-modifications.tex | 363 |
1 files changed, 360 insertions, 3 deletions
diff --git a/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-modifications.tex b/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-modifications.tex index 0507a56e0fa..2857603ea0f 100644 --- a/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-modifications.tex +++ b/Master/texmf-dist/doc/context/sources/general/manuals/luatex/luatex-modifications.tex @@ -67,7 +67,19 @@ most still comes from the original. But we divert a bit. \stopitem \startitem - Magnification (\type {\mag}) is only supported in \DVI\ output mode. + Magnification (\type {\mag}) is only supported in \DVI\ output mode. You can + set this parameter and it even works with \type {true} units till you switch + to \PDF\ output mode. When you use \PDF\ output you can best not touch the + \type {\mag} variable. This fuzzy behaviour is not much different from using + \PDF\ backend related functionality while eventually \DVI\ output is + required. + + After the output mode has been frozen (normally that happens when the first + page is shipped out) or when \PDF\ output is enabled, the \type {true} + specification is ignored. When you preload a plain format adapted to + \LUATEX\ it can be that the \type {\mag} parameter already has been set. +\stopitem + \stopitemize \stopsubsection @@ -514,7 +526,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 @@ -603,6 +617,7 @@ The configuration related registers have become: \edef\pdfinclusionerrorlevel {\pdfvariable inclusionerrorlevel} \edef\pdfignoreunknownimages {\pdfvariable ignoreunknownimages} \edef\pdfgentounicode {\pdfvariable gentounicode} +\edef\pdfomitcidset {\pdfvariable omitcidset} \edef\pdfpagebox {\pdfvariable pagebox} \edef\pdfminorversion {\pdfvariable minorversion} \edef\pdfuniqueresname {\pdfvariable uniqueresname} @@ -662,6 +677,7 @@ the defaults; these are: \pdfinclusionerrorlevel 0 \pdfignoreunknownimages 0 \pdfgentounicode 0 +\pdfomitcidset 0 \pdfpagebox 0 \pdfminorversion 4 \pdfuniqueresname 0 @@ -765,7 +781,348 @@ normally generated by the engine: So, you even need to include the brackets! -\stopsubsection +Although we started from a merge of \PDFTEX\ and \ALEPH, by now the code base as +well as functionality has diverted from those parents. Here we show the options +that can be passed to the extensions. + +\starttexsyntax +\pdfextension literal + [ direct | page | raw ] { tokens } +\stoptexsyntax + +\starttexsyntax +\pdfextension dest + num integer | name { tokens }!crlf + [ fitbh | fitbv | fitb | fith| fitv | fit | + fitr <rule spec> | xyz [ zoom <integer> ] +\stoptexsyntax + +\starttexsyntax +\pdfextension annot + reserveobjnum | useobjnum <integer> + { tokens } +\stoptexsyntax + +\starttexsyntax +\pdfextension save +\stoptexsyntax + +\starttexsyntax +\pdfextension restore +\stoptexsyntax + +\starttexsyntax +\pdfextension setmatrix + { tokens } +\stoptexsyntax + +\starttexsyntax +[ \immediate ] \pdfextension obj + reserveobjnum +\stoptexsyntax + +\starttexsyntax +[ \immediate ] \pdfextension obj + [ useobjnum <integer> ] + [ uncompressed ] + [ stream [ attr { tokens } ] ] + [ file ] + { tokens } +\stoptexsyntax + +\starttexsyntax +\pdfextension refobj + <integer> +\stoptexsyntax + +\starttexsyntax +\pdfextension colorstack + <integer> + set { tokens } | push { tokens } | pop | current +\stoptexsyntax + +\starttexsyntax +\pdfextension startlink + [ attr { tokens } ] + user { tokens } | goto | thread + [ file { tokens } ] + [ page <integer> { tokens } | name { tokens } | num integer ] + [ newwindow | nonewwindow ] +\stoptexsyntax + +\starttexsyntax +\pdfextension endlink +\stoptexsyntax + +\starttexsyntax +\pdfextension startthread + num <integer> | name { tokens } +\stoptexsyntax + +\starttexsyntax +\pdfextension endthread +\stoptexsyntax + +\starttexsyntax +\pdfextension thread + num <integer> | name { tokens } +\stoptexsyntax + +\starttexsyntax +\pdfextension outline + [ attr { tokens } ] + [ useobjnum <integer> ] + [ count <integer> ] + { tokens } +\stoptexsyntax + +\starttexsyntax +\pdfextension glyphtounicode + { tokens } + { tokens } +\stoptexsyntax + +\starttexsyntax +\pdfextension catalog + { tokens } + [ openaction + user { tokens } | goto | thread + [ file { tokens } ] + [ page <integer> { tokens } | name { tokens } | num <integer> ] + [ newwindow | nonewwindow ] ] +\stoptexsyntax + +\starttexsyntax +\pdfextension fontattr + <integer> + {tokens} +\stoptexsyntax + +\starttexsyntax +\pdfextension mapfile + {tokens} +\stoptexsyntax + +\starttexsyntax +\pdfextension mapline + {tokens} +\stoptexsyntax + +\starttexsyntax +\pdfextension includechars + {tokens} +\stoptexsyntax + +\starttexsyntax +\pdfextension info + {tokens} +\stoptexsyntax + +\starttexsyntax +\pdfextension names + {tokens} +\stoptexsyntax + +\starttexsyntax +\pdfextension trailer + {tokens} +\stoptexsyntax + +\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. + +Another adaptation to the \ALEPH\ directional model is control over shapes driven +by \type {\hangindent} and \type {\parshape}. This is controlled by a new parameter +\type {\shapemode}: + +\starttabulate[|cTB|c|] +\NC \NC \bf \type {\hangindent} \NC \bf \type {\parshape} \NC \NR +\NC 0 \NC normal \NC normal \NC \NR +\NC 1 \NC mirrored \NC normal \NC \NR +\NC 2 \NC normal \NC mirrored \NC \NR +\NC 3 \NC mirrored \NC mirrored \NC \NR +\stoptabulate + +The value is reset to zero (like \type {\hangindent} and \type {\parshape}) +after the paragraph is done with. You can use negative values to preven t +this. + +In \in {figure} [fig:shapemode] a few examples are given. + +\startplacefigure[reference=fig:shapemode,title={The effect of \type {shapemode}.}] + \startcombination[2*3] + {\ruledvbox \bgroup \setuptolerance[verytolerant] + \hsize .45\textwidth \switchtobodyfont[6pt] + \pardir TLT \textdir TLT + \hangindent 40pt \hangafter -3 + \leftskip10pt \input tufte \par + \egroup} {TLT: hangindent} + {\ruledvbox \bgroup \setuptolerance[verytolerant] + \hsize .45\textwidth \switchtobodyfont[6pt] + \pardir TLT \textdir TLT + \parshape 4 0pt .8\hsize 10pt .8\hsize 20pt .8\hsize 0pt \hsize + \input tufte \par + \egroup} {TLT: parshape} + {\ruledvbox \bgroup \setuptolerance[verytolerant] + \hsize .45\textwidth \switchtobodyfont[6pt] + \pardir TRT \textdir TRT + \hangindent 40pt \hangafter -3 + \leftskip10pt \input tufte \par + \egroup} {TRT: hangindent mode 0} + {\ruledvbox \bgroup \setuptolerance[verytolerant] + \hsize .45\textwidth \switchtobodyfont[6pt] + \pardir TRT \textdir TRT + \parshape 4 0pt .8\hsize 10pt .8\hsize 20pt .8\hsize 0pt \hsize + \input tufte \par + \egroup} {TRT: parshape mode 0} + {\ruledvbox \bgroup \setuptolerance[verytolerant] + \hsize .45\textwidth \switchtobodyfont[6pt] + \shapemode=3 + \pardir TRT \textdir TRT + \hangindent 40pt \hangafter -3 + \leftskip10pt \input tufte \par + \egroup} {TRT: hangindent mode 1 & 3} + {\ruledvbox \bgroup \setuptolerance[verytolerant] + \hsize .45\textwidth \switchtobodyfont[6pt] + \shapemode=3 + \pardir TRT \textdir TRT + \parshape 4 0pt .8\hsize 10pt .8\hsize 20pt .8\hsize 0pt \hsize + \input tufte \par + \egroup} {TRT: parshape mode 2 & 3} + \stopcombination +\stopplacefigure \stopsection |