diff options
author | Hans Hagen <pragma@wxs.nl> | 2020-08-06 19:42:33 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2020-08-06 19:42:33 +0200 |
commit | 6932ea879b43b36d023797e18b8bdcfc8cef05ba (patch) | |
tree | 92566591ee13ce6c106e9fa9254980ab6ed30faa /doc | |
parent | 39be501f308c8bdea7a36b0b366edebc21d4f382 (diff) | |
download | context-6932ea879b43b36d023797e18b8bdcfc8cef05ba.tar.gz |
2020-08-06 18:58:00
Diffstat (limited to 'doc')
-rw-r--r-- | doc/context/documents/general/magazines/mag-1105-mkiv.pdf | bin | 0 -> 54638 bytes | |||
-rw-r--r-- | doc/context/documents/general/manuals/luametatex.pdf | bin | 1231631 -> 1231680 bytes | |||
-rw-r--r-- | doc/context/sources/general/magazines/mag-1105-mkiv.tex | 186 | ||||
-rw-r--r-- | doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex | 9 |
4 files changed, 189 insertions, 6 deletions
diff --git a/doc/context/documents/general/magazines/mag-1105-mkiv.pdf b/doc/context/documents/general/magazines/mag-1105-mkiv.pdf Binary files differnew file mode 100644 index 000000000..1a81766fb --- /dev/null +++ b/doc/context/documents/general/magazines/mag-1105-mkiv.pdf diff --git a/doc/context/documents/general/manuals/luametatex.pdf b/doc/context/documents/general/manuals/luametatex.pdf Binary files differindex 4390a06a7..072f63507 100644 --- a/doc/context/documents/general/manuals/luametatex.pdf +++ b/doc/context/documents/general/manuals/luametatex.pdf diff --git a/doc/context/sources/general/magazines/mag-1105-mkiv.tex b/doc/context/sources/general/magazines/mag-1105-mkiv.tex new file mode 100644 index 000000000..df1ec7e2c --- /dev/null +++ b/doc/context/sources/general/magazines/mag-1105-mkiv.tex @@ -0,0 +1,186 @@ +% author : Hans Hagen +% copyright : PRAGMA ADE & ConTeXt Development Team +% license : Creative Commons Attribution ShareAlike 4.0 International +% reference : pragma-ade.nl | contextgarden.net | texlive (related) distributions +% origin : the ConTeXt distribution +% +% comment : Because this manual is distributed with TeX distributions it comes with a rather +% liberal license. We try to adapt these documents to upgrades in the (sub)systems +% that they describe. Using parts of the content otherwise can therefore conflict +% with existing functionality and we cannot be held responsible for that. Many of +% the manuals contain characteristic graphics and personal notes or examples that +% make no sense when used out-of-context. + +\ifdefined\parindentmode \parindentmode \plusone \fi % this will become default in lmtx +\ifdefined\normalizelinemode \normalizelinemode\plusone \fi % this will become default in lmtx + +\usemodule[magazine-basic,abr-02] + +\usemodule[scite] + +\startbuffer[abstract] + Here is yet another short example of a feature introduced in \CONTEXT\ \LMTX. + It is mostly meant as teaser: maybe users have additional demands for this + low level mechanisn. +\stopbuffer + +\setuplayout + [backspace=20mm, + topspace=10mm] + +\startdocument + [title={Playing with boxes, a teaser}, + author={Hans Hagen}, + %affiliation=PRAGMA ADE, + date=August 2020, + number=1105 LMTX] + +When a paragraph is typeset in a vertical box, we get a bunch of lines pasted +together. If you want to change something in the result, you can disassemble that +box in detailed ways (in \LUA) but maybe it's something simple that you like to +do. For that we have a an interface to the lines on such a box. We start with a +few settings: + +\starttyping[option=TEX] +\parindentmode \plusone +\normalizelinemode\plusone +\stoptyping + +These two settings will become default in \CONTEXT\ \LMTX, but here we need them in +order to show some properties of boxes. + +\startbuffer[sample] +\setbox0\ruledvbox \bgroup + \leftskip 10pt + \rightskip 20pt + \hangindent 40pt + \hangafter 2 + \parindent 5pt + \parfillleftskip 80pt plus 1 fill + \parfillrightskip 40pt plus 1 fill + \input tufte +\egroup +\stopbuffer + +\typebuffer[sample][option=TEX] + +This box has a bit weird setup but we want to demonstrate something to it's okay: + +\startlinecorrection + \getbuffer[sample] \box0 +\stoplinecorrection + + +In case you wonder, the left and right parskips are a \MKIV\ thing and supported +in \LMTX\ in a more advanced way. The left one can be used to push the last line +to the right. + +\startbuffer[overview] +\dorecurse {\boxlines 0} { + [#1] (% + \the\boxlinewd 0 #1, \the\boxlineht 0 #1, \the\boxlinedp 0 #1, + \the\boxlinels 0 #1, \the\boxliners 0 #1, + \the\boxlinelh 0 #1, \the\boxlinerh 0 #1, + \the\boxlinein 0 #1, \the\boxlinelp 0 #1, \the\boxlinerp 0 #1 + ) \par +} +\stopbuffer + +\typebuffer[overview][option=TEX] + +\getbuffer[sample] + +\startpacked \tt \txx + \getbuffer[overview] +\stoppacked + +The properties of a line are: width, height and depth, left and right skip, +applied left and right hang, indentation (of the first line), left and right +filler of the last line. You can use the commands shown as other dimensions, so +\type {\the} is only needed when you serialize a property. + +Some properties can be changed (others might follow later). Here we change the +width of line four (the equal sign is optional): + +\startbuffer +\the\boxlinewd 0 4 \space& \boxlinewd 0 4 = 40pt \the\boxlinewd 0 4 +\stopbuffer + +\typebuffer[option=TEX] + +We get: \inlinebuffer . We can detach a line from the box. Here we put two lines +in another box that gets assigned to a box register, and a third line is assigned +to a box register as|-|is: + +\startbuffer +\setbox2\ruledhbox{\copyboxline 0 2} +\setbox4\ruledhbox{\boxline 0 4} +\setbox6 \boxline 0 6 +\stopbuffer + +\typebuffer[option=TEX] \getbuffer + +The result is: + +\startbuffer +[2] [\box2] \par +[4] [\box4] \par +[6] [\box6] \par +\stopbuffer + +\typebuffer[option=TEX] + +\startlinecorrection + \startpacked + \getbuffer + \stoppacked +\stoplinecorrection + +Next we replace an existing line by a new line: + +\startbuffer +\setboxline 0 3 \hbox {\darkred \bold This is a replacement line!} +\stopbuffer + +\typebuffer[option=TEX] \getbuffer + +The original box is now: + +\startlinecorrection +\box0 +\stoplinecorrection + +We can repack the box with the usual \TEX\ commands: \type {\vpack {\unvbox0}} +but here we just did a \type {\box0}. + +An example of a more useful application is the following. First we fill a box: + +\startbuffer +\setbox\scratchbox\ruledvbox \bgroup + \input ward +\egroup +\stopbuffer + +\typebuffer[option=TEX] \getbuffer + +With little effort we can add line numbers: + +\startbuffer +\ruledvbox \bgroup + \dorecurse {\boxlines \scratchbox} {% + \dontleavehmode + \strut + \llap{\hbox to 1.5em{\txx#1\hss}}\boxline \scratchbox #1\par + } +} +\stopbuffer + +\typebuffer[option=TEX] + +The result is: + +\startlinecorrection + {\forgetall \getbuffer} +\stoplinecorrection + +\stopdocument diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex b/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex index 37818f28f..0d0218ed9 100644 --- a/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex +++ b/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex @@ -1182,12 +1182,9 @@ tail node. <node> tail = node.slide(<node> n) \stopfunctioncall -After some callbacks automatic sliding takes place. This feature can be turned -off with \type {node.fix_node_lists(false)} but you better make sure then that -you don't mess up lists. In most cases \TEX\ itself only uses \type {next} -pointers but your other callbacks might expect proper \type {prev} pointers too. -Future versions of \LUATEX\ can add more checking but this will not influence -usage. +In most cases \TEX\ itself only uses \type {next} pointers but your other +callbacks might expect proper \type {prev} pointers too. So, when you run into +issues or are in doubt, apply the slide function before you return the list. \stopsubsubsection |